most-box 0.1.4 → 0.1.6
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/README.md +22 -12
- package/electron/main.js +31 -10
- package/out/404/index.html +3 -3
- package/out/404.html +3 -3
- package/out/__next.__PAGE__.txt +6 -6
- package/out/__next._full.txt +16 -16
- package/out/__next._head.txt +3 -3
- package/out/__next._index.txt +8 -8
- package/out/__next._tree.txt +5 -5
- package/out/_next/static/chunks/{06lttvu7563zo.css → 0-ryc9icn6dql.css} +1 -1
- package/out/_next/static/chunks/088-v8tzobg5g.js +1 -0
- package/out/_next/static/chunks/0g9303i8psy6z.js +1 -0
- package/out/_next/static/chunks/0nwdp-n94owg0.css +1 -0
- package/out/_next/static/chunks/{0pt.5cg1t09qs.js → 0s7i7nfr9j3b1.js} +1 -1
- package/out/_next/static/chunks/0vmjat-s4a3yj.css +1 -0
- package/out/_next/static/chunks/10p6-qnuk3p9x.js +1 -0
- package/out/_next/static/chunks/1ei8b9nw-ea8p.css +1 -0
- package/out/_next/static/chunks/1lxjpnw925-0p.css +1 -0
- package/out/_next/static/chunks/1v-molv0hbcjl.js +1 -0
- package/out/_next/static/chunks/23kls47vn_rpg.css +23 -0
- package/out/_next/static/chunks/2524ggtr3e4fp.js +1 -0
- package/out/_next/static/chunks/2fmkcw8ui5xp3.js +5 -0
- package/out/_next/static/chunks/2mcmt4yla_xle.js +1 -0
- package/out/_next/static/chunks/2uget3ephe4e3.js +736 -0
- package/out/_next/static/chunks/2v7_4ps1l4a8o.css +1 -0
- package/out/_next/static/chunks/2va-v1iiap4zv.js +1 -0
- package/out/_next/static/chunks/2vk2ln79gpvm4.js +1 -0
- package/out/_next/static/chunks/2vm9uslik2wfi.css +5 -0
- package/out/_next/static/chunks/37msy2-4ucgts.js +1 -0
- package/out/_next/static/chunks/384w3w4qvhw61.js +1 -0
- package/out/_next/static/chunks/3aa-weedhv4e0.js +1 -0
- package/out/_next/static/chunks/3erbaukgkw8f2.js +1 -0
- package/out/_next/static/chunks/3fea100s764m-.js +1 -0
- package/out/_next/static/chunks/3g0c367tk4esf.js +1 -0
- package/out/_next/static/chunks/{0gcsdf57gcm6h.js → 3oe03qxgd_rid.js} +1 -1
- package/out/_next/static/chunks/3qj5xz_d4cbk6.js +1 -0
- package/out/_next/static/chunks/3r5wf57k0gys9.js +1 -0
- package/out/_next/static/chunks/3yc_zd5vxq0j7.css +1 -0
- package/out/_next/static/chunks/{turbopack-0xta0kqwzkf28.js → turbopack-026p0g9v9_pva.js} +1 -1
- package/out/_not-found/__next._full.txt +13 -13
- package/out/_not-found/__next._head.txt +3 -3
- package/out/_not-found/__next._index.txt +8 -8
- package/out/_not-found/__next._not-found.__PAGE__.txt +4 -4
- package/out/_not-found/__next._not-found.txt +3 -3
- package/out/_not-found/__next._tree.txt +3 -3
- package/out/_not-found/index.html +3 -3
- package/out/_not-found/index.txt +13 -13
- package/out/admin/__next._full.txt +15 -15
- package/out/admin/__next._head.txt +3 -3
- package/out/admin/__next._index.txt +8 -8
- package/out/admin/__next._tree.txt +4 -4
- package/out/admin/__next.admin.__PAGE__.txt +4 -4
- package/out/admin/__next.admin.txt +4 -4
- package/out/admin/index.html +3 -3
- package/out/admin/index.txt +15 -15
- package/out/app/__next._full.txt +14 -14
- package/out/app/__next._head.txt +3 -3
- package/out/app/__next._index.txt +8 -8
- package/out/app/__next._tree.txt +3 -3
- package/out/app/__next.app.__PAGE__.txt +4 -4
- package/out/app/__next.app.txt +3 -3
- package/out/app/index.html +3 -3
- package/out/app/index.txt +14 -14
- package/out/chat/__next._full.txt +15 -15
- package/out/chat/__next._head.txt +3 -3
- package/out/chat/__next._index.txt +8 -8
- package/out/chat/__next._tree.txt +4 -4
- package/out/chat/__next.chat.__PAGE__.txt +4 -4
- package/out/chat/__next.chat.txt +4 -4
- package/out/chat/index.html +3 -3
- package/out/chat/index.txt +15 -15
- package/out/chat/join/__next._full.txt +15 -15
- package/out/chat/join/__next._head.txt +3 -3
- package/out/chat/join/__next._index.txt +8 -8
- package/out/chat/join/__next._tree.txt +4 -4
- package/out/chat/join/__next.chat.join.__PAGE__.txt +4 -4
- package/out/chat/join/__next.chat.join.txt +3 -3
- package/out/chat/join/__next.chat.txt +4 -4
- package/out/chat/join/index.html +3 -3
- package/out/chat/join/index.txt +15 -15
- package/out/demo/__next._full.txt +27 -0
- package/out/demo/__next._head.txt +5 -0
- package/out/demo/__next._index.txt +9 -0
- package/out/demo/__next._tree.txt +7 -0
- package/out/demo/__next.demo.__PAGE__.txt +12 -0
- package/out/demo/__next.demo.txt +5 -0
- package/out/demo/index.html +17 -0
- package/out/demo/index.txt +27 -0
- package/out/download/__next._full.txt +35 -37
- package/out/download/__next._head.txt +3 -3
- package/out/download/__next._index.txt +8 -8
- package/out/download/__next._tree.txt +5 -5
- package/out/download/__next.download.__PAGE__.txt +7 -7
- package/out/download/__next.download.txt +3 -3
- package/out/download/index.html +3 -3
- package/out/download/index.txt +35 -37
- package/out/favicon.ico +0 -0
- package/out/game/__next._full.txt +13 -13
- package/out/game/__next._head.txt +3 -3
- package/out/game/__next._index.txt +8 -8
- package/out/game/__next._tree.txt +4 -4
- package/out/game/__next.game.__PAGE__.txt +2 -2
- package/out/game/__next.game.txt +4 -4
- package/out/game/gandengyan/__next._full.txt +16 -16
- package/out/game/gandengyan/__next._head.txt +3 -3
- package/out/game/gandengyan/__next._index.txt +8 -8
- package/out/game/gandengyan/__next._tree.txt +5 -5
- package/out/game/gandengyan/__next.game.gandengyan.__PAGE__.txt +5 -5
- package/out/game/gandengyan/__next.game.gandengyan.txt +3 -3
- package/out/game/gandengyan/__next.game.txt +4 -4
- package/out/game/gandengyan/index.html +3 -3
- package/out/game/gandengyan/index.txt +16 -16
- package/out/game/index.html +1 -1
- package/out/game/index.txt +13 -13
- package/out/game/zhajinhua/__next._full.txt +15 -15
- package/out/game/zhajinhua/__next._head.txt +3 -3
- package/out/game/zhajinhua/__next._index.txt +8 -8
- package/out/game/zhajinhua/__next._tree.txt +4 -4
- package/out/game/zhajinhua/__next.game.txt +4 -4
- package/out/game/zhajinhua/__next.game.zhajinhua.__PAGE__.txt +4 -4
- package/out/game/zhajinhua/__next.game.zhajinhua.txt +3 -3
- package/out/game/zhajinhua/index.html +3 -3
- package/out/game/zhajinhua/index.txt +15 -15
- package/out/index.html +3 -3
- package/out/index.txt +16 -16
- package/out/logo-512.png +0 -0
- package/out/logo.ico +0 -0
- package/out/logo.svg +12 -0
- package/out/note/__next._full.txt +14 -14
- package/out/note/__next._head.txt +3 -3
- package/out/note/__next._index.txt +8 -8
- package/out/note/__next._tree.txt +3 -3
- package/out/note/__next.note.__PAGE__.txt +4 -4
- package/out/note/__next.note.txt +3 -3
- package/out/note/index.html +3 -3
- package/out/note/index.txt +14 -14
- package/out/ping/__next._full.txt +16 -16
- package/out/ping/__next._head.txt +3 -3
- package/out/ping/__next._index.txt +8 -8
- package/out/ping/__next._tree.txt +5 -5
- package/out/ping/__next.ping.__PAGE__.txt +5 -5
- package/out/ping/__next.ping.txt +4 -4
- package/out/ping/index.html +3 -3
- package/out/ping/index.txt +16 -16
- package/out/web3/__next._full.txt +15 -15
- package/out/web3/__next._head.txt +3 -3
- package/out/web3/__next._index.txt +8 -8
- package/out/web3/__next._tree.txt +4 -4
- package/out/web3/__next.web3.__PAGE__.txt +4 -4
- package/out/web3/__next.web3.txt +4 -4
- package/out/web3/ed25519/__next._full.txt +13 -13
- package/out/web3/ed25519/__next._head.txt +3 -3
- package/out/web3/ed25519/__next._index.txt +8 -8
- package/out/web3/ed25519/__next._tree.txt +4 -4
- package/out/web3/ed25519/__next.web3.ed25519.__PAGE__.txt +2 -2
- package/out/web3/ed25519/__next.web3.ed25519.txt +3 -3
- package/out/web3/ed25519/__next.web3.txt +4 -4
- package/out/web3/ed25519/index.html +1 -1
- package/out/web3/ed25519/index.txt +13 -13
- package/out/web3/index.html +3 -3
- package/out/web3/index.txt +15 -15
- package/out/web3/tools/__next._full.txt +13 -13
- package/out/web3/tools/__next._head.txt +3 -3
- package/out/web3/tools/__next._index.txt +8 -8
- package/out/web3/tools/__next._tree.txt +4 -4
- package/out/web3/tools/__next.web3.tools.__PAGE__.txt +2 -2
- package/out/web3/tools/__next.web3.tools.txt +3 -3
- package/out/web3/tools/__next.web3.txt +4 -4
- package/out/web3/tools/index.html +1 -1
- package/out/web3/tools/index.txt +13 -13
- package/package.json +27 -27
- package/public/favicon.ico +0 -0
- package/public/logo-512.png +0 -0
- package/public/logo.ico +0 -0
- package/public/logo.svg +12 -0
- package/server/src/core/mostLink.js +1 -1
- package/server/src/games/gandengyan.js +49 -19
- package/server/src/http/app.js +40 -15
- package/server/src/http/nodeStatus.js +37 -0
- package/server/src/http/uploads.js +1 -0
- package/server/src/index.js +417 -112
- package/server/src/utils/avatar.js +3 -2
- package/out/_next/static/chunks/03gsbg0fr00ey.js +0 -1
- package/out/_next/static/chunks/0adx~d-j05c9d.css +0 -24
- package/out/_next/static/chunks/0ao1lbi4b.sfa.js +0 -1
- package/out/_next/static/chunks/0fo9-h4knidcz.js +0 -1
- package/out/_next/static/chunks/0g_a~e050bgzg.css +0 -1
- package/out/_next/static/chunks/0h4r.qtmpa6eh.js +0 -1
- package/out/_next/static/chunks/0hpev4am9jpmu.css +0 -1
- package/out/_next/static/chunks/0hyds~bp.auvh.js +0 -1
- package/out/_next/static/chunks/0i9sfdypwuw8~.js +0 -1
- package/out/_next/static/chunks/0o9ce4cyf76by.js +0 -736
- package/out/_next/static/chunks/0olqjomda37-e.js +0 -1
- package/out/_next/static/chunks/0puk.7e.tr2zy.js +0 -1
- package/out/_next/static/chunks/0qgx9t4jx16ua.css +0 -1
- package/out/_next/static/chunks/0s1k6rlwy02c2.js +0 -1
- package/out/_next/static/chunks/0sgltmtk_9s8p.css +0 -1
- package/out/_next/static/chunks/0snehvtvu1n4q.js +0 -1
- package/out/_next/static/chunks/0s~g.l~x049o2.js +0 -1
- package/out/_next/static/chunks/0t_3xxx4zkerp.js +0 -5
- package/out/_next/static/chunks/0u38kke9vhobe.js +0 -1
- package/out/_next/static/chunks/0vd4_a5x-wpdh.js +0 -1
- package/out/_next/static/chunks/0xdwau5k2augv.css +0 -4
- package/out/_next/static/chunks/0xx_10jns1.s7.css +0 -1
- package/out/_next/static/chunks/10f-t2n4y1zx8.js +0 -1
- package/out/_next/static/chunks/13jdyag9a-~kk.js +0 -1
- package/out/_next/static/chunks/153-sz7s.qml2.js +0 -1
- package/out/_next/static/chunks/17cwkb2yn_akx.js +0 -1
- /package/out/_next/static/{sSvbBrwXZY-4lBmcHshga → NPIlpdzQWkiVZpgfhlypH}/_buildManifest.js +0 -0
- /package/out/_next/static/{sSvbBrwXZY-4lBmcHshga → NPIlpdzQWkiVZpgfhlypH}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{sSvbBrwXZY-4lBmcHshga → NPIlpdzQWkiVZpgfhlypH}/_ssgManifest.js +0 -0
- /package/out/_next/static/chunks/{0bld2u_ld~va2.js → 0-jy8rfo075fy.js} +0 -0
- /package/out/_next/static/chunks/{0bliugh5lxw55.js → 0-kczrcxjk7lc.js} +0 -0
- /package/out/_next/static/chunks/{00d9h1tddnnnd.js → 012yllpioyi-k.js} +0 -0
- /package/out/_next/static/chunks/{00tkdqwxch-3s.js → 02f7w-ybfnvpd.js} +0 -0
- /package/out/_next/static/chunks/{01l3o90g~1z42.js → 04_v8i3c2y4ni.js} +0 -0
- /package/out/_next/static/chunks/{01xlw8hd842-c.js → 05-c3ty_6dwfk.js} +0 -0
- /package/out/_next/static/chunks/{01mfky9camw6i.js → 052vp9tk7oqx6.js} +0 -0
- /package/out/_next/static/chunks/{01r.v-pqs1vrm.js → 05k6874y7n0cw.js} +0 -0
- /package/out/_next/static/chunks/{02zzxfop_k6tl.css → 09g8c9-u_uh1z.css} +0 -0
- /package/out/_next/static/chunks/{03edqrb4zdj~g.js → 0az8vxg2gfuhm.js} +0 -0
- /package/out/_next/static/chunks/{03h_6oo-gqkhz.js → 0b899y85ei3i_.js} +0 -0
- /package/out/_next/static/chunks/{03~yq9q893hmn.js → 0cz1d0mv5g_q7.js} +0 -0
- /package/out/_next/static/chunks/{04hcgsanv1hhu.js → 0eg1osglq6nq7.js} +0 -0
- /package/out/_next/static/chunks/{05g2q0w5b34.g.js → 0hlvocunlbrjs.js} +0 -0
- /package/out/_next/static/chunks/{05of77xycbt8~.js → 0i9k23rx749fx.js} +0 -0
- /package/out/_next/static/chunks/{05zwemzfjx3sh.js → 0j6wiyqf1637r.js} +0 -0
- /package/out/_next/static/chunks/{06dpc5df94.v1.js → 0knzyzd1jvley.js} +0 -0
- /package/out/_next/static/chunks/{06e1~1-z_ic9a.js → 0kp8ujaqwut11.js} +0 -0
- /package/out/_next/static/chunks/{075s7sn.ns~u5.js → 0n92y9hb-ta0u.js} +0 -0
- /package/out/_next/static/chunks/{07dynrbvd3.f4.js → 0nybb-z3ufrbx.js} +0 -0
- /package/out/_next/static/chunks/{07r9nn-pzlgg1.js → 0o-o9af-grvj8.js} +0 -0
- /package/out/_next/static/chunks/{07p~uva5pwgwe.js → 0oxr0r0aewn99.js} +0 -0
- /package/out/_next/static/chunks/{08576xhv~~jck.js → 0qh3b90ouc9bd.js} +0 -0
- /package/out/_next/static/chunks/{08u211~k~qu52.js → 0sh_jm8siqvek.js} +0 -0
- /package/out/_next/static/chunks/{08.72abkgwy9g.js → 0t86ducxkqweb.js} +0 -0
- /package/out/_next/static/chunks/{098.p.2-zm4p7.js → 0u0j5i6-n4oqd.js} +0 -0
- /package/out/_next/static/chunks/{09ngvtajm7e5y.js → 0v73vfxjds7sj.js} +0 -0
- /package/out/_next/static/chunks/{09ps~-43n5qyo.js → 0ve8ixremhwy0.js} +0 -0
- /package/out/_next/static/chunks/{09v7_0gclxr46.js → 0vv5cwj6kr506.js} +0 -0
- /package/out/_next/static/chunks/{09yql86dir9c4.js → 0w3wf8o-ewec9.js} +0 -0
- /package/out/_next/static/chunks/{09zmlfljowj1~.js → 0w6o4o76scrb2.js} +0 -0
- /package/out/_next/static/chunks/{0n4t80gjc3q5h.js → 1-88dio6azz54.js} +0 -0
- /package/out/_next/static/chunks/{0cn9a7aimbdzq.js → 12zg24u7mbv4z.js} +0 -0
- /package/out/_next/static/chunks/{0d3f-nk3c.2re.js → 14lsse587-ccf.js} +0 -0
- /package/out/_next/static/chunks/{0dtohpf7~3d12.js → 16qtikqm_sate.js} +0 -0
- /package/out/_next/static/chunks/{0e531nije_ln2.js → 17_ly1mk2z3q8.js} +0 -0
- /package/out/_next/static/chunks/{0e5zvj_rh0z3m.js → 181421-y2xzj7.js} +0 -0
- /package/out/_next/static/chunks/{0myp4sjagr~h0.js → 1_e-vuvfsntao.js} +0 -0
- /package/out/_next/static/chunks/{0e-3e8h7g99yf.js → 1aljc62wfhqhr.js} +0 -0
- /package/out/_next/static/chunks/{0f4y~rkk-n81e.js → 1b7mbzsylsn-m.js} +0 -0
- /package/out/_next/static/chunks/{0fk~0~p7ivfn1.js → 1cjakikh0o1tm.js} +0 -0
- /package/out/_next/static/chunks/{0fw6juc~lsj3z.js → 1dfzez629llzh.js} +0 -0
- /package/out/_next/static/chunks/{0g0u7785a73vo.js → 1e4ilit3ave6c.js} +0 -0
- /package/out/_next/static/chunks/{0gze5uso1mbe9.js → 1gzgcv355ziff.js} +0 -0
- /package/out/_next/static/chunks/{0g_fpgh7drfda.js → 1h0o6fj73le9_.js} +0 -0
- /package/out/_next/static/chunks/{0hf.aosc-7172.js → 1in766ibz5l-p.js} +0 -0
- /package/out/_next/static/chunks/{0hgz35c1ejbs9.js → 1ip_c70si4tj2.js} +0 -0
- /package/out/_next/static/chunks/{0hrw-r.xmvmsq.js → 1jlu197-yog_n.js} +0 -0
- /package/out/_next/static/chunks/{0hzg4al.v~8~m.js → 1k788fny29y_j.js} +0 -0
- /package/out/_next/static/chunks/{0ip9xrols_83o.js → 1mnhfyfn52md5.js} +0 -0
- /package/out/_next/static/chunks/{0j4-d0qf.v~kn.js → 1o8brm8yipzn4.js} +0 -0
- /package/out/_next/static/chunks/{0jhdeq.j9_02m.js → 1p8oa39bqu6ed.js} +0 -0
- /package/out/_next/static/chunks/{0jy63h3i-y69i.js → 1qmnmb_dutuw8.js} +0 -0
- /package/out/_next/static/chunks/{0kdnx_u-60k9s.js → 1s6rdcw0q185p.js} +0 -0
- /package/out/_next/static/chunks/{0kq~edq42o1-c.js → 1ta0w8zc7tae7.js} +0 -0
- /package/out/_next/static/chunks/{0l682p362d-5w.js → 1uvi_hie0s3z5.js} +0 -0
- /package/out/_next/static/chunks/{0m68p9txef5rs.js → 1y36s6sv2z7r4.js} +0 -0
- /package/out/_next/static/chunks/{0mme-fm5d2oz2.js → 1zf4i-oj7n-ll.js} +0 -0
- /package/out/_next/static/chunks/{0y.li-~3oybew.js → 2-vtwv8h_uokj.js} +0 -0
- /package/out/_next/static/chunks/{0n.qlfk~z7o.6.js → 2227enga_0c-6.js} +0 -0
- /package/out/_next/static/chunks/{0oz3yl6_-716p.js → 24zr4q96g-eii.js} +0 -0
- /package/out/_next/static/chunks/{0pqt~8bl3ukh4.js → 27jktro2p5rq9.js} +0 -0
- /package/out/_next/static/chunks/{0yl2t7cs-n_ng.js → 2_cqphhur0a6t.js} +0 -0
- /package/out/_next/static/chunks/{0yq3kh.hchtm_.js → 2_s88st3j0tql.js} +0 -0
- /package/out/_next/static/chunks/{0ys0l5au.9c2c.js → 2_y6edbaubqrt.js} +0 -0
- /package/out/_next/static/chunks/{0qqupeexg83u7.js → 2at8y3pbt5cue.js} +0 -0
- /package/out/_next/static/chunks/{0rb-ri481.kc9.js → 2cv1zex4has67.js} +0 -0
- /package/out/_next/static/chunks/{0rsnmahfd.59p.js → 2e6j5h4ftd4jd.js} +0 -0
- /package/out/_next/static/chunks/{0rt6rgnvr-s_p.js → 2e8b26r0td7ou.js} +0 -0
- /package/out/_next/static/chunks/{0runh28p_gg6..js → 2ecppdrjm9cs4.js} +0 -0
- /package/out/_next/static/chunks/{0shy.t1fwqcev.js → 2gl0wusc9zf3d.js} +0 -0
- /package/out/_next/static/chunks/{0t2xr05rlu96l.js → 2im7c515bo69p.js} +0 -0
- /package/out/_next/static/chunks/{0t6h56rhg1y5i.js → 2ixaku9ie8hym.js} +0 -0
- /package/out/_next/static/chunks/{0tdqd1zunusgk.js → 2jhnrjgj_k2-z.js} +0 -0
- /package/out/_next/static/chunks/{0ujbnp38x63ek.js → 2n6pb94vmohgf.js} +0 -0
- /package/out/_next/static/chunks/{0ukyg~tkm~h2m.css → 2nbju8t9-ux58.css} +0 -0
- /package/out/_next/static/chunks/{0v68pdrp54lb-.js → 2pdxw43rsbho0.js} +0 -0
- /package/out/_next/static/chunks/{0vsm0m5sxrb.3.js → 2r6z3vlfw0ppd.js} +0 -0
- /package/out/_next/static/chunks/{0vzlz.iboqo3c.js → 2rskzmv3skmq3.js} +0 -0
- /package/out/_next/static/chunks/{0w87vbpkf-ogd.js → 2stoe6xiau1b3.js} +0 -0
- /package/out/_next/static/chunks/{0xgg0~kmf3gd-.js → 2wqoc60afpg_5.js} +0 -0
- /package/out/_next/static/chunks/{0xj24-70ptdzp.js → 2wyvwsayrr98o.js} +0 -0
- /package/out/_next/static/chunks/{0xxlx772fr3x4.js → 2y3o2mnyfnx68.js} +0 -0
- /package/out/_next/static/chunks/{16i.qbk8t8gf_.js → 3-7y7sjol3yto.js} +0 -0
- /package/out/_next/static/chunks/{0z48pmi6buytt.js → 3089gugfv3ov9.js} +0 -0
- /package/out/_next/static/chunks/{0zapnvgy89mg..js → 30s3_0brd77ky.js} +0 -0
- /package/out/_next/static/chunks/{0_s~ebb-7b2hr.js → 35idql3ziq0wz.js} +0 -0
- /package/out/_next/static/chunks/{0_w-0-2z5oqd_.js → 35unmm4isvqg5.js} +0 -0
- /package/out/_next/static/chunks/{0-n3pg7th.zza.js → 389wmv2b6x2nn.js} +0 -0
- /package/out/_next/static/chunks/{0~4f5p6tvn1lq.js → 39-oy5n969lo6.js} +0 -0
- /package/out/_next/static/chunks/{0~3ik-hfp9s-7.js → 39yvee40syj70.js} +0 -0
- /package/out/_next/static/chunks/{0~_0ys.2whxbw.js → 3clhij8e1eul0.js} +0 -0
- /package/out/_next/static/chunks/{0~_ui9l7.2sxf.js → 3cnsdzbvm3q7p.js} +0 -0
- /package/out/_next/static/chunks/{0~.-vxi5oc.r0.js → 3cxmalqqghdac.js} +0 -0
- /package/out/_next/static/chunks/{0.4j.0k5a64vg.js → 3d9p88evh2scq.js} +0 -0
- /package/out/_next/static/chunks/{0.ozi1_x2.m.~.js → 3eyprczj7yrg6.js} +0 -0
- /package/out/_next/static/chunks/{0.t5wlt51zou5.js → 3f9v_gtppe4hs.js} +0 -0
- /package/out/_next/static/chunks/{0.w4hkvap~bva.js → 3fj0amtzqae6f.js} +0 -0
- /package/out/_next/static/chunks/{1037jlyw5~7ht.js → 3gf98e08a-l_e.js} +0 -0
- /package/out/_next/static/chunks/{1045hfzu533z0.js → 3gi6og9m_yaak.js} +0 -0
- /package/out/_next/static/chunks/{104e5nmc.c-pl.js → 3giw7r1lii84y.js} +0 -0
- /package/out/_next/static/chunks/{109taw1pbh-0b.js → 3gzhy1cs_f2oi.js} +0 -0
- /package/out/_next/static/chunks/{10ynz1dy483wf.js → 3i_ceknny1oqt.js} +0 -0
- /package/out/_next/static/chunks/{10x7~onqwp338.js → 3iw0815ssih3b.js} +0 -0
- /package/out/_next/static/chunks/{11hds.mg~4_r-.js → 3kun-vwr7nzd4.js} +0 -0
- /package/out/_next/static/chunks/{11ibzaklcauw~.js → 3kxm1e-b1er3_.js} +0 -0
- /package/out/_next/static/chunks/{11z.0s6.42b.p.js → 3mc8fynmv71yg.js} +0 -0
- /package/out/_next/static/chunks/{126enaq~f7scl.js → 3n6cor2n9zyn7.js} +0 -0
- /package/out/_next/static/chunks/{12pep-2t-qg4n.css → 3or2h8swxfxyj.css} +0 -0
- /package/out/_next/static/chunks/{12-9n56l0y3yr.js → 3ppt04b6xqz29.js} +0 -0
- /package/out/_next/static/chunks/{1380op_pfk.qo.js → 3ql2pi_m5_5p_.js} +0 -0
- /package/out/_next/static/chunks/{14a4fwbiq.l3z.js → 3t-6u8caafiu9.js} +0 -0
- /package/out/_next/static/chunks/{146oiw1bggtn4.js → 3tqdzb_n12tdm.js} +0 -0
- /package/out/_next/static/chunks/{14cowsqn95m1k.js → 3u6zpg943kpst.js} +0 -0
- /package/out/_next/static/chunks/{14dtd3l03v.kx.js → 3uaedu2hf291z.js} +0 -0
- /package/out/_next/static/chunks/{14tm3qa-v9o-4.js → 3vladx3wh0d4k.js} +0 -0
- /package/out/_next/static/chunks/{14_inksek_rth.js → 3w4o9hklow6fg.js} +0 -0
- /package/out/_next/static/chunks/{14_po2rb_arn4.js → 3w56w25z6u89b.js} +0 -0
- /package/out/_next/static/chunks/{157z7bowux3xj.js → 3x1y_gkazt6kx.js} +0 -0
- /package/out/_next/static/chunks/{15m1_677az2cm.js → 3y7r1h96dtcov.js} +0 -0
- /package/out/_next/static/chunks/{15v.~.ne6ogkk.js → 3z0hydntmwg19.js} +0 -0
- /package/out/_next/static/chunks/{15-o4kb-evqd7.js → 3zhu1svjr0bc5.js} +0 -0
- /package/out/_next/static/chunks/{16u9f35gylw8l.js → 404orp1erq__7.js} +0 -0
- /package/out/_next/static/chunks/{17ajyb5ogk5yj.js → 41talcs-dc2tc.js} +0 -0
- /package/out/_next/static/chunks/{17dyfxbq8yz8n.js → 421pn8weymo-b.js} +0 -0
- /package/out/_next/static/chunks/{180zln9pcq9ih.js → 44987pmr20now.js} +0 -0
- /package/out/_next/static/chunks/{1814izi5gh.kp.js → 449ygeh62gitc.js} +0 -0
- /package/out/_next/static/media/{KaTeX_AMS-Regular.0b~8ki5y928w2.woff → KaTeX_AMS-Regular.10y3kupq4t663.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_AMS-Regular.0p1vbqd84i2~o.woff2 → KaTeX_AMS-Regular.25ieegmnh38ts.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_AMS-Regular.173t6ktr7uf-w.ttf → KaTeX_AMS-Regular.418dr7cz3fo2x.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Caligraphic-Bold.01-pzluls4zgb.woff2 → KaTeX_Caligraphic-Bold.06b-ya9t43ioz.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Caligraphic-Bold.0x2v1lwn~880f.woff → KaTeX_Caligraphic-Bold.2vmk2hva4ctha.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Caligraphic-Bold.16zv5fax0h0ka.ttf → KaTeX_Caligraphic-Bold.40ltxhe834pns.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Caligraphic-Regular.02i3z7wig438t.ttf → KaTeX_Caligraphic-Regular.07-7u27-nhn_r.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Caligraphic-Regular.0rysu1t-ncjq8.woff2 → KaTeX_Caligraphic-Regular.2eph4dlhid_m9.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Caligraphic-Regular.10927swgekwun.woff → KaTeX_Caligraphic-Regular.3gxeetazf831f.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Fraktur-Bold.0et27v~3~4uhe.ttf → KaTeX_Fraktur-Bold.19yqa_tc9d_gx.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Fraktur-Bold.0e-16u10iuyyf.woff → KaTeX_Fraktur-Bold.1alcy76__wdj2.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Fraktur-Bold.0w23i72~hprpq.woff2 → KaTeX_Fraktur-Bold.2sasz-d-jtw8y.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Fraktur-Regular.0b.riegzdfue2.woff → KaTeX_Fraktur-Regular.110oo81prr9n5.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Fraktur-Regular.0rekyoa-52fj_.woff2 → KaTeX_Fraktur-Regular.2d10y4xmjvzlf.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Fraktur-Regular.0vjwa15znhk~4.ttf → KaTeX_Fraktur-Regular.2qhy34r6a05dn.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Bold.09i7~607shf-h.ttf → KaTeX_Main-Bold.0us_n0tnxlxu7.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Bold.09lmynrorhcbw.woff → KaTeX_Main-Bold.0v1esh257kqpe.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Bold.16pfc63_du6mx.woff2 → KaTeX_Main-Bold.3-rowy8o6_4ky.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-BoldItalic.0cp37g7x1q8h6.woff → KaTeX_Main-BoldItalic.13355ck5zr48q.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-BoldItalic.0d54rk08rx11s.woff2 → KaTeX_Main-BoldItalic.14r2naom8mrec.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-BoldItalic.15j6k~hix2t_0.ttf → KaTeX_Main-BoldItalic.3x_u9cepaced0.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Italic.0382gqciexmbu.woff → KaTeX_Main-Italic.0afv392dj4w59.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Italic.06o5nq0_91v60.woff2 → KaTeX_Main-Italic.0lig0v9j0700p.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Italic.0su4i6mm18-wo.ttf → KaTeX_Main-Italic.2hkw3230mfwcv.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Regular.08zh8z.7shijf.ttf → KaTeX_Main-Regular.0symfa7dqj6jd.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Regular.0diheg01zyoph.woff → KaTeX_Main-Regular.15u8r3b2y7fv4.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Main-Regular.0kaf-ag2_wkm-.woff2 → KaTeX_Main-Regular.1ryvsdzh2w1_e.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Math-BoldItalic.0ajzxypnbx1h1.ttf → KaTeX_Math-BoldItalic.0y5w36a5aq__2.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Math-BoldItalic.0ck1myuerwyqw.woff → KaTeX_Math-BoldItalic.12pl58orkw9rg.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Math-BoldItalic.0ja97dn.cpc87.woff2 → KaTeX_Math-BoldItalic.1oopuu636h4il.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Math-Italic.09xkhecjcn5r9.woff → KaTeX_Math-Italic.0w0b1ugh62cfr.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Math-Italic.0x23a-bmp-5tg.ttf → KaTeX_Math-Italic.2vkekfblmz5nb.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Math-Italic.0zrha2c4sl2je.woff2 → KaTeX_Math-Italic.32405s1aq8vas.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Bold.05a9.pc1j_zx9.woff2 → KaTeX_SansSerif-Bold.0h3wi2z_eouyg.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Bold.0jcl-ayi1uun0.woff → KaTeX_SansSerif-Bold.1ovw5p-yjp56g.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Bold.0re8y.dm7.mt5.ttf → KaTeX_SansSerif-Bold.2d03q85pwxpti.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Italic.0a0234dc3s62j.woff2 → KaTeX_SansSerif-Italic.0wkjc4dm2kcit.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Italic.0judofdln9731.woff → KaTeX_SansSerif-Italic.1qavw__2zz8gk.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Italic.10z1iap9pfus8.ttf → KaTeX_SansSerif-Italic.3i-q087b23-m8.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Regular.0h9yjlugq4q_e.woff → KaTeX_SansSerif-Regular.1i4afx8nk8n4r.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Regular.0v6gcj32-czft.woff2 → KaTeX_SansSerif-Regular.2peiewu59z3d-.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_SansSerif-Regular.0zm18kga42ebc.ttf → KaTeX_SansSerif-Regular.31pbu25feko_c.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Script-Regular.0c4.h-mer83d_.woff2 → KaTeX_Script-Regular.11h14300o9pd0.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Script-Regular.0q14y6zkzlpob.ttf → KaTeX_Script-Regular.28p_x7iz71ofe.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Script-Regular.0ze6v4r_-99oy.woff → KaTeX_Script-Regular.3110jb9c-bxna.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Size1-Regular.013x6a4ierotp.woff2 → KaTeX_Size1-Regular.03lhvx36ekcou.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Size1-Regular.0kidw0oi.m68o.woff → KaTeX_Size1-Regular.1slf4bh0hc6vm.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Size1-Regular.0m6y-i6wfokni.ttf → KaTeX_Size1-Regular.1y57-ck23ey8c.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Size2-Regular.0blpmluwilgbg.woff → KaTeX_Size2-Regular.0-kwyvx03omo8.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Size2-Regular.0d5inmyp-tyv3.woff2 → KaTeX_Size2-Regular.14s5gg-puz6h-.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Size2-Regular.0wnhnvj-.k9d5.ttf → KaTeX_Size2-Regular.2u0s-b07k2o9m.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Size3-Regular.01h0xm_sfctj3.woff → KaTeX_Size3-Regular.04o9a_02gu_e8.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Size3-Regular.0iukctyhw5j56.woff2 → KaTeX_Size3-Regular.1n1rgzz84z8r9.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Size3-Regular.0jl8mqyf4gzpn.ttf → KaTeX_Size3-Regular.1pkn-dge4q0fv.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Size4-Regular.0w3.rb_c4stzk.woff2 → KaTeX_Size4-Regular.2sgotkdv3dcyv.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Size4-Regular.0wr_9l81-mu06.ttf → KaTeX_Size4-Regular.2uelkfk2yna5e.ttf} +0 -0
- /package/out/_next/static/media/{KaTeX_Size4-Regular.12tvaesf3.zl3.woff → KaTeX_Size4-Regular.3p2r1l7xmebxv.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Typewriter-Regular.0c4zdxz~8frhm.woff2 → KaTeX_Typewriter-Regular.11gr2d2wuwz77.woff2} +0 -0
- /package/out/_next/static/media/{KaTeX_Typewriter-Regular.0cgrzn5l3kao5.woff → KaTeX_Typewriter-Regular.12f8myjij3617.woff} +0 -0
- /package/out/_next/static/media/{KaTeX_Typewriter-Regular.128~qc3858otl.ttf → KaTeX_Typewriter-Regular.3nee9kjfy6nm8.ttf} +0 -0
- /package/out/{pwa-512x512.png → avatar.png} +0 -0
- /package/public/{pwa-512x512.png → avatar.png} +0 -0
|
@@ -0,0 +1,736 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2073,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},a=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},c=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},u=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(l)return l(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,o,l,h=arguments[0],d=1,p=arguments.length,f=!1;for("boolean"==typeof h&&(f=h,h=arguments[1]||{},d=2),(null==h||"object"!=typeof h&&"function"!=typeof h)&&(h={});d<p;++d)if(t=arguments[d],null!=t)for(n in t)r=u(h,n),h!==(i=u(t,n))&&(f&&i&&(a(i)||(o=s(i)))?(o?(o=!1,l=r&&s(r)?r:[]):l=r&&a(r)?r:{},c(h,{name:n,newValue:e(f,l,i)})):void 0!==i&&c(h,{name:n,newValue:i}));return h}},34859,e=>{"use strict";let t,n,r,i,o,l,s,a,c,u,h,d,p,f,m,g,y,b,w,x,k;var C,S,M,A,T,O,E,N,D,I,L,_,R,z,P,B,F,H,q,j,V,$,W,U,G,K,J,Z,Y,X,Q,ee,et,en,er,ei,eo,el,es,ea,ec,eu,eh,ed,ep,ef,em,eg,ev,ey,eb,ew,ex,ek,eC,eS,eM,eA,eT,eO,eE,eN,eD,eI,eL,e_,eR,ez,eP,eB,eF,eH,eq,ej,eV,e$,eW,eU,eG,eK,eJ,eZ,eY,eX,eQ,e0,e1,e4,e5,e2,e3,e7,e6,e8,e9,te,tt,tn,tr,ti,to,tl,ts,ta,tc,tu,th,td,tp,tf=e.i(18050),tm=e.i(71645);let tg=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},tv=function(e){return e};var ty=Math.max,tb=e.g&&e.g.Object===Object&&e.g,tw="object"==typeof self&&self&&self.Object===Object&&self,tx=tb||tw||Function("return this")(),tk=tx.Symbol,tC=Object.prototype,tS=tC.hasOwnProperty,tM=tC.toString,tA=tk?tk.toStringTag:void 0;let tT=function(e){var t=tS.call(e,tA),n=e[tA];try{e[tA]=void 0;var r=!0}catch(e){}var i=tM.call(e);return r&&(t?e[tA]=n:delete e[tA]),i};var tO=Object.prototype.toString,tE=tk?tk.toStringTag:void 0;let tN=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":tE&&tE in Object(e)?tT(e):tO.call(e)},tD=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},tI=function(e){if(!tD(e))return!1;var t=tN(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};var tL=tx["__core-js_shared__"],t_=(S=/[^.]+$/.exec(tL&&tL.keys&&tL.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",tR=Function.prototype.toString;let tz=function(e){if(null!=e){try{return tR.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var tP=/^\[object .+?Constructor\]$/,tB=Object.prototype,tF=Function.prototype.toString,tH=tB.hasOwnProperty,tq=RegExp("^"+tF.call(tH).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");let tj=function(e){return!!tD(e)&&(!t_||!(t_ in e))&&(tI(e)?tq:tP).test(tz(e))},tV=function(e,t){var n=null==e?void 0:e[t];return tj(n)?n:void 0};var t$=function(){try{var e=tV(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),tW=Date.now,tU=(M=t$?function(e,t){return t$(e,"toString",{configurable:!0,enumerable:!1,value:function(){return t},writable:!0})}:tv,A=0,T=0,function(){var e=tW(),t=16-(e-T);if(T=e,t>0){if(++A>=800)return arguments[0]}else A=0;return M.apply(void 0,arguments)});let tG=function(e,t){var n;return tU((n=ty(void 0===(n=t)?e.length-1:n,0),function(){for(var t=arguments,r=-1,i=ty(t.length-n,0),o=Array(i);++r<i;)o[r]=t[n+r];r=-1;for(var l=Array(n+1);++r<n;)l[r]=t[r];return l[n]=tv(o),tg(e,this,l)}),e+"")},tK=function(e,t){return e===t||e!=e&&t!=t},tJ=function(e,t){for(var n=e.length;n--;)if(tK(e[n][0],t))return n;return -1};var tZ=Array.prototype.splice;function tY(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}tY.prototype.clear=function(){this.__data__=[],this.size=0},tY.prototype.delete=function(e){var t=this.__data__,n=tJ(t,e);return!(n<0)&&(n==t.length-1?t.pop():tZ.call(t,n,1),--this.size,!0)},tY.prototype.get=function(e){var t=this.__data__,n=tJ(t,e);return n<0?void 0:t[n][1]},tY.prototype.has=function(e){return tJ(this.__data__,e)>-1},tY.prototype.set=function(e,t){var n=this.__data__,r=tJ(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var tX=tV(tx,"Map"),tQ=tV(Object,"create"),t0=Object.prototype.hasOwnProperty,t1=Object.prototype.hasOwnProperty;function t4(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}t4.prototype.clear=function(){this.__data__=tQ?tQ(null):{},this.size=0},t4.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=!!t,t},t4.prototype.get=function(e){var t=this.__data__;if(tQ){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return t0.call(t,e)?t[e]:void 0},t4.prototype.has=function(e){var t=this.__data__;return tQ?void 0!==t[e]:t1.call(t,e)},t4.prototype.set=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=tQ&&void 0===t?"__lodash_hash_undefined__":t,this};let t5=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},t2=function(e,t){var n=e.__data__;return t5(t)?n["string"==typeof t?"string":"hash"]:n.map};function t3(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function t7(e){var t=this.__data__=new tY(e);this.size=t.size}t3.prototype.clear=function(){this.size=0,this.__data__={hash:new t4,map:new(tX||tY),string:new t4}},t3.prototype.delete=function(e){var t=t2(this,e).delete(e);return this.size-=!!t,t},t3.prototype.get=function(e){return t2(this,e).get(e)},t3.prototype.has=function(e){return t2(this,e).has(e)},t3.prototype.set=function(e,t){var n=t2(this,e),r=n.size;return n.set(e,t),this.size+=+(n.size!=r),this},t7.prototype.clear=function(){this.__data__=new tY,this.size=0},t7.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},t7.prototype.get=function(e){return this.__data__.get(e)},t7.prototype.has=function(e){return this.__data__.has(e)},t7.prototype.set=function(e,t){var n=this.__data__;if(n instanceof tY){var r=n.__data__;if(!tX||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new t3(r)}return n.set(e,t),this.size=n.size,this};let t6=function(e,t,n){"__proto__"==t&&t$?t$(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},t8=function(e,t,n){(void 0===n||tK(e[t],n))&&(void 0!==n||t in e)||t6(e,t,n)},t9=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),l=o.length;l--;){var s=o[++r];if(!1===t(i[s],s,i))break}return e},ne=function(e,t){if(t)return e.slice();var n=e.length,r=new e.constructor(n);return e.copy(r),r};var nt=tx.Uint8Array;let nn=function(e){var t=new e.constructor(e.byteLength);return new nt(t).set(new nt(e)),t},nr=function(e,t){var n=t?nn(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},ni=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var no=Object.create,nl=function(){function e(){}return function(t){if(!tD(t))return{};if(no)return no(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),ns=(O=Object.getPrototypeOf,E=Object,function(e){return O(E(e))}),na=Object.prototype;let nc=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||na)},nu=function(e){return null!=e&&"object"==typeof e},nh=function(e){return nu(e)&&"[object Arguments]"==tN(e)};var nd=Object.prototype,np=nd.hasOwnProperty,nf=nd.propertyIsEnumerable,nm=nh(function(){return arguments}())?nh:function(e){return nu(e)&&np.call(e,"callee")&&!nf.call(e,"callee")},ng=Array.isArray;let nv=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=0x1fffffffffffff},ny=function(e){return null!=e&&nv(e.length)&&!tI(e)},nb=function(){return!1};var nw=Object.prototype,nx=Function.prototype.toString,nk=nw.hasOwnProperty,nC=nx.call(Object);let nS=function(e){if(!nu(e)||"[object Object]"!=tN(e))return!1;var t=ns(e);if(null===t)return!0;var n=nk.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&nx.call(n)==nC};var nM={};nM["[object Float32Array]"]=nM["[object Float64Array]"]=nM["[object Int8Array]"]=nM["[object Int16Array]"]=nM["[object Int32Array]"]=nM["[object Uint8Array]"]=nM["[object Uint8ClampedArray]"]=nM["[object Uint16Array]"]=nM["[object Uint32Array]"]=!0,nM["[object Arguments]"]=nM["[object Array]"]=nM["[object ArrayBuffer]"]=nM["[object Boolean]"]=nM["[object DataView]"]=nM["[object Date]"]=nM["[object Error]"]=nM["[object Function]"]=nM["[object Map]"]=nM["[object Number]"]=nM["[object Object]"]=nM["[object RegExp]"]=nM["[object Set]"]=nM["[object String]"]=nM["[object WeakMap]"]=!1;var nA=function(){try{return!1}catch(e){}}(),nT=nA&&nA.isTypedArray,nO=nT?function(e){return nT(e)}:function(e){return nu(e)&&nv(e.length)&&!!nM[tN(e)]};let nE=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var nN=Object.prototype.hasOwnProperty;let nD=function(e,t,n){var r=e[t];nN.call(e,t)&&tK(r,n)&&(void 0!==n||t in e)||t6(e,t,n)},nI=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,l=t.length;++o<l;){var s=t[o],a=r?r(n[s],e[s],s,n,e):void 0;void 0===a&&(a=e[s]),i?t6(n,s,a):nD(n,s,a)}return n},nL=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var n_=/^(?:0|[1-9]\d*)$/;let nR=function(e,t){var n=typeof e;return!!(t=null==t?0x1fffffffffffff:t)&&("number"==n||"symbol"!=n&&n_.test(e))&&e>-1&&e%1==0&&e<t};var nz=Object.prototype.hasOwnProperty;let nP=function(e,t){var n=ng(e),r=!n&&nm(e),i=!n&&!r&&nb(e),o=!n&&!r&&!i&&nO(e),l=n||r||i||o,s=l?nL(e.length,String):[],a=s.length;for(var c in e)(t||nz.call(e,c))&&!(l&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||nR(c,a)))&&s.push(c);return s},nB=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var nF=Object.prototype.hasOwnProperty;let nH=function(e){if(!tD(e))return nB(e);var t=nc(e),n=[];for(var r in e)"constructor"==r&&(t||!nF.call(e,r))||n.push(r);return n},nq=function(e){return ny(e)?nP(e,!0):nH(e)},nj=function(e,t,n,r,i,o,l){var s=nE(e,n),a=nE(t,n),c=l.get(a);if(c)return void t8(e,n,c);var u=o?o(s,a,n+"",e,t,l):void 0,h=void 0===u;if(h){var d=ng(a),p=!d&&nb(a),f=!d&&!p&&nO(a);(u=a,d||p||f)?ng(s)?u=s:nu(s)&&ny(s)?u=ni(s):p?(h=!1,u=ne(a,!0)):f?(h=!1,u=nr(a,!0)):u=[]:nS(a)||nm(a)?(u=s,nm(s))?u=nI(s,nq(s)):(!tD(s)||tI(s))&&(u="function"!=typeof a.constructor||nc(a)?{}:nl(ns(a))):h=!1}h&&(l.set(a,u),i(u,a,r,o,l),l.delete(a)),t8(e,n,u)},nV=function e(t,n,r,i,o){t!==n&&t9(n,function(l,s){if(o||(o=new t7),tD(l))nj(t,n,s,r,e,i,o);else{var a=i?i(nE(t,s),l,s+"",t,n,o):void 0;void 0===a&&(a=l),t8(t,s,a)}},nq)},n$=function e(t,n,r,i,o,l){return tD(t)&&tD(n)&&(l.set(n,t),nV(t,n,void 0,e,l),l.delete(n)),t},nW=function(e,t,n){if(!tD(n))return!1;var r=typeof t;return("number"==r?!!(ny(n)&&nR(t,n.length)):"string"==r&&t in n)&&tK(n[t],e)};var nU=(N=function(e,t,n,r){nV(e,t,n,r)},tG(function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=N.length>3&&"function"==typeof i?(r--,i):void 0,o&&nW(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var l=t[n];l&&N(e,l,n,i)}return e})),nG=tG(function(e){return e.push(void 0,n$),tg(nU,void 0,e)}),nK=e.i(93125);function nJ(e){return new nK.LanguageSupport(nK.StreamLanguage.define(e))}function nZ(t){return e.A(92486).then(e=>e.sql({dialect:e[t]}))}let nY=[nK.LanguageDescription.of({name:"C",extensions:["c","h","ino"],load:()=>e.A(56379).then(e=>e.cpp())}),nK.LanguageDescription.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load:()=>e.A(56379).then(e=>e.cpp())}),nK.LanguageDescription.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load:()=>nZ("Cassandra")}),nK.LanguageDescription.of({name:"CSS",extensions:["css"],load:()=>e.A(96001).then(e=>e.css())}),nK.LanguageDescription.of({name:"Go",extensions:["go"],load:()=>e.A(44955).then(e=>e.go())}),nK.LanguageDescription.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load:()=>e.A(65698).then(e=>e.html())}),nK.LanguageDescription.of({name:"Java",extensions:["java"],load:()=>e.A(15213).then(e=>e.java())}),nK.LanguageDescription.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load:()=>e.A(71071).then(e=>e.javascript())}),nK.LanguageDescription.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load:()=>e.A(10898).then(e=>e.jinja())}),nK.LanguageDescription.of({name:"JSON",alias:["json5"],extensions:["json","map"],load:()=>e.A(65781).then(e=>e.json())}),nK.LanguageDescription.of({name:"JSX",extensions:["jsx"],load:()=>e.A(71071).then(e=>e.javascript({jsx:!0}))}),nK.LanguageDescription.of({name:"LESS",extensions:["less"],load:()=>e.A(63544).then(e=>e.less())}),nK.LanguageDescription.of({name:"Liquid",extensions:["liquid"],load:()=>e.A(41372).then(e=>e.liquid())}),nK.LanguageDescription.of({name:"MariaDB SQL",load:()=>nZ("MariaSQL")}),nK.LanguageDescription.of({name:"Markdown",extensions:["md","markdown","mkd"],load:()=>e.A(73016).then(e=>e.markdown())}),nK.LanguageDescription.of({name:"MS SQL",load:()=>nZ("MSSQL")}),nK.LanguageDescription.of({name:"MySQL",load:()=>nZ("MySQL")}),nK.LanguageDescription.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load:()=>e.A(10007).then(e=>e.php())}),nK.LanguageDescription.of({name:"PLSQL",extensions:["pls"],load:()=>nZ("PLSQL")}),nK.LanguageDescription.of({name:"PostgreSQL",load:()=>nZ("PostgreSQL")}),nK.LanguageDescription.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load:()=>e.A(15314).then(e=>e.python())}),nK.LanguageDescription.of({name:"Rust",extensions:["rs"],load:()=>e.A(72431).then(e=>e.rust())}),nK.LanguageDescription.of({name:"Sass",extensions:["sass"],load:()=>e.A(83206).then(e=>e.sass({indented:!0}))}),nK.LanguageDescription.of({name:"SCSS",extensions:["scss"],load:()=>e.A(83206).then(e=>e.sass())}),nK.LanguageDescription.of({name:"SQL",extensions:["sql"],load:()=>nZ("StandardSQL")}),nK.LanguageDescription.of({name:"SQLite",load:()=>nZ("SQLite")}),nK.LanguageDescription.of({name:"TSX",extensions:["tsx"],load:()=>e.A(71071).then(e=>e.javascript({jsx:!0,typescript:!0}))}),nK.LanguageDescription.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load:()=>e.A(71071).then(e=>e.javascript({typescript:!0}))}),nK.LanguageDescription.of({name:"WebAssembly",extensions:["wat","wast"],load:()=>e.A(92742).then(e=>e.wast())}),nK.LanguageDescription.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load:()=>e.A(72460).then(e=>e.xml())}),nK.LanguageDescription.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load:()=>e.A(52350).then(e=>e.yaml())}),nK.LanguageDescription.of({name:"APL",extensions:["dyalog","apl"],load:()=>e.A(15482).then(e=>nJ(e.apl))}),nK.LanguageDescription.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load:()=>e.A(23151).then(e=>nJ(e.asciiArmor))}),nK.LanguageDescription.of({name:"ASN.1",extensions:["asn","asn1"],load:()=>e.A(26042).then(e=>nJ(e.asn1({})))}),nK.LanguageDescription.of({name:"Asterisk",filename:/^extensions\.conf$/i,load:()=>e.A(70385).then(e=>nJ(e.asterisk))}),nK.LanguageDescription.of({name:"Brainfuck",extensions:["b","bf"],load:()=>e.A(22966).then(e=>nJ(e.brainfuck))}),nK.LanguageDescription.of({name:"Cobol",extensions:["cob","cpy"],load:()=>e.A(3802).then(e=>nJ(e.cobol))}),nK.LanguageDescription.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load:()=>e.A(81866).then(e=>nJ(e.csharp))}),nK.LanguageDescription.of({name:"Clojure",extensions:["clj","cljc","cljx"],load:()=>e.A(12396).then(e=>nJ(e.clojure))}),nK.LanguageDescription.of({name:"ClojureScript",extensions:["cljs"],load:()=>e.A(12396).then(e=>nJ(e.clojure))}),nK.LanguageDescription.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load:()=>e.A(83703).then(e=>nJ(e.gss))}),nK.LanguageDescription.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load:()=>e.A(40138).then(e=>nJ(e.cmake))}),nK.LanguageDescription.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load:()=>e.A(624).then(e=>nJ(e.coffeeScript))}),nK.LanguageDescription.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load:()=>e.A(86124).then(e=>nJ(e.commonLisp))}),nK.LanguageDescription.of({name:"Cypher",extensions:["cyp","cypher"],load:()=>e.A(27745).then(e=>nJ(e.cypher))}),nK.LanguageDescription.of({name:"Cython",extensions:["pyx","pxd","pxi"],load:()=>e.A(82028).then(e=>nJ(e.cython))}),nK.LanguageDescription.of({name:"Crystal",extensions:["cr"],load:()=>e.A(76263).then(e=>nJ(e.crystal))}),nK.LanguageDescription.of({name:"D",extensions:["d"],load:()=>e.A(45328).then(e=>nJ(e.d))}),nK.LanguageDescription.of({name:"Dart",extensions:["dart"],load:()=>e.A(81866).then(e=>nJ(e.dart))}),nK.LanguageDescription.of({name:"diff",extensions:["diff","patch"],load:()=>e.A(55191).then(e=>nJ(e.diff))}),nK.LanguageDescription.of({name:"Dockerfile",filename:/^Dockerfile$/,load:()=>e.A(55899).then(e=>nJ(e.dockerFile))}),nK.LanguageDescription.of({name:"DTD",extensions:["dtd"],load:()=>e.A(91148).then(e=>nJ(e.dtd))}),nK.LanguageDescription.of({name:"Dylan",extensions:["dylan","dyl","intr"],load:()=>e.A(15889).then(e=>nJ(e.dylan))}),nK.LanguageDescription.of({name:"EBNF",load:()=>e.A(12656).then(e=>nJ(e.ebnf))}),nK.LanguageDescription.of({name:"ECL",extensions:["ecl"],load:()=>e.A(70055).then(e=>nJ(e.ecl))}),nK.LanguageDescription.of({name:"edn",extensions:["edn"],load:()=>e.A(12396).then(e=>nJ(e.clojure))}),nK.LanguageDescription.of({name:"Eiffel",extensions:["e"],load:()=>e.A(45593).then(e=>nJ(e.eiffel))}),nK.LanguageDescription.of({name:"Elm",extensions:["elm"],load:()=>e.A(74464).then(e=>nJ(e.elm))}),nK.LanguageDescription.of({name:"Erlang",extensions:["erl"],load:()=>e.A(50270).then(e=>nJ(e.erlang))}),nK.LanguageDescription.of({name:"Esper",load:()=>e.A(40172).then(e=>nJ(e.esper))}),nK.LanguageDescription.of({name:"Factor",extensions:["factor"],load:()=>e.A(63431).then(e=>nJ(e.factor))}),nK.LanguageDescription.of({name:"FCL",load:()=>e.A(93792).then(e=>nJ(e.fcl))}),nK.LanguageDescription.of({name:"Forth",extensions:["forth","fth","4th"],load:()=>e.A(29975).then(e=>nJ(e.forth))}),nK.LanguageDescription.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load:()=>e.A(91487).then(e=>nJ(e.fortran))}),nK.LanguageDescription.of({name:"F#",alias:["fsharp"],extensions:["fs"],load:()=>e.A(4218).then(e=>nJ(e.fSharp))}),nK.LanguageDescription.of({name:"Gas",extensions:["s"],load:()=>e.A(38790).then(e=>nJ(e.gas))}),nK.LanguageDescription.of({name:"Gherkin",extensions:["feature"],load:()=>e.A(41167).then(e=>nJ(e.gherkin))}),nK.LanguageDescription.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load:()=>e.A(85488).then(e=>nJ(e.groovy))}),nK.LanguageDescription.of({name:"Haskell",extensions:["hs"],load:()=>e.A(98039).then(e=>nJ(e.haskell))}),nK.LanguageDescription.of({name:"Haxe",extensions:["hx"],load:()=>e.A(64198).then(e=>nJ(e.haxe))}),nK.LanguageDescription.of({name:"HXML",extensions:["hxml"],load:()=>e.A(64198).then(e=>nJ(e.hxml))}),nK.LanguageDescription.of({name:"HTTP",load:()=>e.A(68434).then(e=>nJ(e.http))}),nK.LanguageDescription.of({name:"IDL",extensions:["pro"],load:()=>e.A(40958).then(e=>nJ(e.idl))}),nK.LanguageDescription.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load:()=>e.A(24125).then(e=>nJ(e.jsonld))}),nK.LanguageDescription.of({name:"Julia",extensions:["jl"],load:()=>e.A(83715).then(e=>nJ(e.julia))}),nK.LanguageDescription.of({name:"Kotlin",extensions:["kt","kts"],load:()=>e.A(81866).then(e=>nJ(e.kotlin))}),nK.LanguageDescription.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load:()=>e.A(66264).then(e=>nJ(e.liveScript))}),nK.LanguageDescription.of({name:"Lua",extensions:["lua"],load:()=>e.A(37340).then(e=>nJ(e.lua))}),nK.LanguageDescription.of({name:"mIRC",extensions:["mrc"],load:()=>e.A(78509).then(e=>nJ(e.mirc))}),nK.LanguageDescription.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load:()=>e.A(43287).then(e=>nJ(e.mathematica))}),nK.LanguageDescription.of({name:"Modelica",extensions:["mo"],load:()=>e.A(61918).then(e=>nJ(e.modelica))}),nK.LanguageDescription.of({name:"MUMPS",extensions:["mps"],load:()=>e.A(5319).then(e=>nJ(e.mumps))}),nK.LanguageDescription.of({name:"Mbox",extensions:["mbox"],load:()=>e.A(12416).then(e=>nJ(e.mbox))}),nK.LanguageDescription.of({name:"Nginx",filename:/nginx.*\.conf$/i,load:()=>e.A(39007).then(e=>nJ(e.nginx))}),nK.LanguageDescription.of({name:"NSIS",extensions:["nsh","nsi"],load:()=>e.A(80949).then(e=>nJ(e.nsis))}),nK.LanguageDescription.of({name:"NTriples",extensions:["nt","nq"],load:()=>e.A(44248).then(e=>nJ(e.ntriples))}),nK.LanguageDescription.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load:()=>e.A(81866).then(e=>nJ(e.objectiveC))}),nK.LanguageDescription.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load:()=>e.A(81866).then(e=>nJ(e.objectiveCpp))}),nK.LanguageDescription.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load:()=>e.A(4218).then(e=>nJ(e.oCaml))}),nK.LanguageDescription.of({name:"Octave",extensions:["m"],load:()=>e.A(98773).then(e=>nJ(e.octave))}),nK.LanguageDescription.of({name:"Oz",extensions:["oz"],load:()=>e.A(85529).then(e=>nJ(e.oz))}),nK.LanguageDescription.of({name:"Pascal",extensions:["p","pas"],load:()=>e.A(89579).then(e=>nJ(e.pascal))}),nK.LanguageDescription.of({name:"Perl",extensions:["pl","pm"],load:()=>e.A(86460).then(e=>nJ(e.perl))}),nK.LanguageDescription.of({name:"Pig",extensions:["pig"],load:()=>e.A(22405).then(e=>nJ(e.pig))}),nK.LanguageDescription.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load:()=>e.A(68761).then(e=>nJ(e.powerShell))}),nK.LanguageDescription.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load:()=>e.A(23211).then(e=>nJ(e.properties))}),nK.LanguageDescription.of({name:"ProtoBuf",extensions:["proto"],load:()=>e.A(60722).then(e=>nJ(e.protobuf))}),nK.LanguageDescription.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load:()=>e.A(17435).then(e=>nJ(e.pug))}),nK.LanguageDescription.of({name:"Puppet",extensions:["pp"],load:()=>e.A(34862).then(e=>nJ(e.puppet))}),nK.LanguageDescription.of({name:"Q",extensions:["q"],load:()=>e.A(75415).then(e=>nJ(e.q))}),nK.LanguageDescription.of({name:"R",alias:["rscript"],extensions:["r","R"],load:()=>e.A(92345).then(e=>nJ(e.r))}),nK.LanguageDescription.of({name:"RPM Changes",load:()=>e.A(52375).then(e=>nJ(e.rpmChanges))}),nK.LanguageDescription.of({name:"RPM Spec",extensions:["spec"],load:()=>e.A(52375).then(e=>nJ(e.rpmSpec))}),nK.LanguageDescription.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load:()=>e.A(95841).then(e=>nJ(e.ruby))}),nK.LanguageDescription.of({name:"SAS",extensions:["sas"],load:()=>e.A(32140).then(e=>nJ(e.sas))}),nK.LanguageDescription.of({name:"Scala",extensions:["scala"],load:()=>e.A(81866).then(e=>nJ(e.scala))}),nK.LanguageDescription.of({name:"Scheme",extensions:["scm","ss"],load:()=>e.A(98424).then(e=>nJ(e.scheme))}),nK.LanguageDescription.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load:()=>e.A(44545).then(e=>nJ(e.shell))}),nK.LanguageDescription.of({name:"Sieve",extensions:["siv","sieve"],load:()=>e.A(47020).then(e=>nJ(e.sieve))}),nK.LanguageDescription.of({name:"Smalltalk",extensions:["st"],load:()=>e.A(38160).then(e=>nJ(e.smalltalk))}),nK.LanguageDescription.of({name:"Solr",load:()=>e.A(59676).then(e=>nJ(e.solr))}),nK.LanguageDescription.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load:()=>e.A(4218).then(e=>nJ(e.sml))}),nK.LanguageDescription.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load:()=>e.A(42116).then(e=>nJ(e.sparql))}),nK.LanguageDescription.of({name:"Spreadsheet",alias:["excel","formula"],load:()=>e.A(86237).then(e=>nJ(e.spreadsheet))}),nK.LanguageDescription.of({name:"Squirrel",extensions:["nut"],load:()=>e.A(81866).then(e=>nJ(e.squirrel))}),nK.LanguageDescription.of({name:"Stylus",extensions:["styl"],load:()=>e.A(46786).then(e=>nJ(e.stylus))}),nK.LanguageDescription.of({name:"Swift",extensions:["swift"],load:()=>e.A(43377).then(e=>nJ(e.swift))}),nK.LanguageDescription.of({name:"sTeX",load:()=>e.A(14920).then(e=>nJ(e.stex))}),nK.LanguageDescription.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load:()=>e.A(14920).then(e=>nJ(e.stex))}),nK.LanguageDescription.of({name:"SystemVerilog",extensions:["v","sv","svh"],load:()=>e.A(68269).then(e=>nJ(e.verilog))}),nK.LanguageDescription.of({name:"Tcl",extensions:["tcl"],load:()=>e.A(8241).then(e=>nJ(e.tcl))}),nK.LanguageDescription.of({name:"Textile",extensions:["textile"],load:()=>e.A(47519).then(e=>nJ(e.textile))}),nK.LanguageDescription.of({name:"TiddlyWiki",load:()=>e.A(87078).then(e=>nJ(e.tiddlyWiki))}),nK.LanguageDescription.of({name:"Tiki wiki",load:()=>e.A(1390).then(e=>nJ(e.tiki))}),nK.LanguageDescription.of({name:"TOML",extensions:["toml"],load:()=>e.A(12614).then(e=>nJ(e.toml))}),nK.LanguageDescription.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load:()=>e.A(18349).then(e=>nJ(e.troff))}),nK.LanguageDescription.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load:()=>e.A(7291).then(e=>nJ(e.ttcn))}),nK.LanguageDescription.of({name:"TTCN_CFG",extensions:["cfg"],load:()=>e.A(65691).then(e=>nJ(e.ttcnCfg))}),nK.LanguageDescription.of({name:"Turtle",extensions:["ttl"],load:()=>e.A(3129).then(e=>nJ(e.turtle))}),nK.LanguageDescription.of({name:"Web IDL",extensions:["webidl"],load:()=>e.A(52651).then(e=>nJ(e.webIDL))}),nK.LanguageDescription.of({name:"VB.NET",extensions:["vb"],load:()=>e.A(31029).then(e=>nJ(e.vb))}),nK.LanguageDescription.of({name:"VBScript",extensions:["vbs"],load:()=>e.A(40947).then(e=>nJ(e.vbScript))}),nK.LanguageDescription.of({name:"Velocity",extensions:["vtl"],load:()=>e.A(44709).then(e=>nJ(e.velocity))}),nK.LanguageDescription.of({name:"Verilog",extensions:["v"],load:()=>e.A(68269).then(e=>nJ(e.verilog))}),nK.LanguageDescription.of({name:"VHDL",extensions:["vhd","vhdl"],load:()=>e.A(7543).then(e=>nJ(e.vhdl))}),nK.LanguageDescription.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load:()=>e.A(77836).then(e=>nJ(e.xQuery))}),nK.LanguageDescription.of({name:"Yacas",extensions:["ys"],load:()=>e.A(29630).then(e=>nJ(e.yacas))}),nK.LanguageDescription.of({name:"Z80",extensions:["z80"],load:()=>e.A(92030).then(e=>nJ(e.z80))}),nK.LanguageDescription.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load:()=>e.A(63880).then(e=>nJ(e.mscgen))}),nK.LanguageDescription.of({name:"Xù",extensions:["xu"],load:()=>e.A(63880).then(e=>nJ(e.xu))}),nK.LanguageDescription.of({name:"MsGenny",extensions:["msgenny"],load:()=>e.A(63880).then(e=>nJ(e.msgenny))}),nK.LanguageDescription.of({name:"Vue",extensions:["vue"],load:()=>e.A(53289).then(e=>e.vue())}),nK.LanguageDescription.of({name:"Angular Template",load:()=>e.A(83704).then(e=>e.angular())})];var nX=e.i(15080),nQ=e.i(16455);let n0="#e06c75",n1="#abb2bf",n4="#7d8799",n5="#d19a66",n2="#2c313a",n3="#282c34",n7="#353a42",n6="#528bff",n8=nX.EditorView.theme({"&":{color:n1,backgroundColor:n3},".cm-content":{caretColor:n6},".cm-cursor, .cm-dropCursor":{borderLeftColor:n6},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:n1},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:n3,color:n4,border:"none"},".cm-activeLineGutter":{backgroundColor:n2},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:n7},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:n7,borderBottomColor:n7},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:n2,color:n1}}},{dark:!0}),n9=nK.HighlightStyle.define([{tag:nQ.tags.keyword,color:"#c678dd"},{tag:[nQ.tags.name,nQ.tags.deleted,nQ.tags.character,nQ.tags.propertyName,nQ.tags.macroName],color:n0},{tag:[nQ.tags.function(nQ.tags.variableName),nQ.tags.labelName],color:"#61afef"},{tag:[nQ.tags.color,nQ.tags.constant(nQ.tags.name),nQ.tags.standard(nQ.tags.name)],color:n5},{tag:[nQ.tags.definition(nQ.tags.name),nQ.tags.separator],color:n1},{tag:[nQ.tags.typeName,nQ.tags.className,nQ.tags.number,nQ.tags.changed,nQ.tags.annotation,nQ.tags.modifier,nQ.tags.self,nQ.tags.namespace],color:"#e5c07b"},{tag:[nQ.tags.operator,nQ.tags.operatorKeyword,nQ.tags.url,nQ.tags.escape,nQ.tags.regexp,nQ.tags.link,nQ.tags.special(nQ.tags.string)],color:"#56b6c2"},{tag:[nQ.tags.meta,nQ.tags.comment],color:n4},{tag:nQ.tags.strong,fontWeight:"bold"},{tag:nQ.tags.emphasis,fontStyle:"italic"},{tag:nQ.tags.strikethrough,textDecoration:"line-through"},{tag:nQ.tags.link,color:n4,textDecoration:"underline"},{tag:nQ.tags.heading,fontWeight:"bold",color:n0},{tag:[nQ.tags.atom,nQ.tags.bool,nQ.tags.special(nQ.tags.variableName)],color:n5},{tag:[nQ.tags.processingInstruction,nQ.tags.string,nQ.tags.inserted],color:"#98c379"},{tag:nQ.tags.invalid,color:"#ffffff"}]),re=[n8,(0,nK.syntaxHighlighting)(n9)];var rt=((D={}).docTypeError="docTypeError",D.contextNotFound="contextNotFound",D.timerNotFound="timerNotFound",D.ctxCallOutOfScope="ctxCallOutOfScope",D.createNodeInParserFail="createNodeInParserFail",D.stackOverFlow="stackOverFlow",D.parserMatchError="parserMatchError",D.serializerMatchError="serializerMatchError",D.getAtomFromSchemaFail="getAtomFromSchemaFail",D.expectDomTypeError="expectDomTypeError",D.callCommandBeforeEditorView="callCommandBeforeEditorView",D.missingRootElement="missingRootElement",D.missingNodeInSchema="missingNodeInSchema",D.missingMarkInSchema="missingMarkInSchema",D.ctxNotBind="ctxNotBind",D.missingYjsDoc="missingYjsDoc",D.aiProviderError="aiProviderError",D.aiBuildContextError="aiBuildContextError",D),rn=class extends Error{constructor(e,t,n){super(t,n),this.name="MilkdownError",this.code=e,n?.cause!==void 0&&(this.cause=n.cause)}},rr=(e,t)=>"function"==typeof t?"[Function]":t;function ri(){return new rn(rt.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function ro(){return new rn(rt.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function rl(e){return new rn(rt.expectDomTypeError,`Expect to be a dom, but get: ${JSON.stringify(e,rr)}.`)}function rs(){return new rn(rt.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")}function ra(e){return new rn(rt.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${e}" in schema.`)}function rc(e){try{return JSON.stringify(e,rr)}catch{return"[Unserializable]"}}var ru=class{constructor(){this.sliceMap=new Map,this.get=e=>{let t="string"==typeof e?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);if(!t){var n;throw n="string"==typeof e?e:e.name,new rn(rt.contextNotFound,`Context "${n}" not found, do you forget to inject it?`)}return t},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)}},rh=class{#e;#t;#n;constructor(e,t,n){this.#e=[],this.#n=()=>{this.#e.forEach(e=>e(this.#t))},this.set=e=>{this.#t=e,this.#n()},this.get=()=>this.#t,this.update=e=>{this.#t=e(this.#t),this.#n()},this.type=n,this.#t=t,e.set(n.id,this)}on(e){return this.#e.push(e),()=>{this.#e=this.#e.filter(t=>t!==e)}}once(e){let t=this.on(n=>{e(n),t()});return t}off(e){this.#e=this.#e.filter(t=>t!==e)}offAll(){this.#e=[]}},rd=class{constructor(e,t){this.id=Symbol(`Context-${t}`),this.name=t,this._defaultValue=e,this._typeInfo=()=>{throw ri()}}create(e,t=this._defaultValue){return new rh(e,t,this)}},rp=(e,t)=>new rd(e,t),rf=class{#r;#i;#o;#l;#s;#a;#c;constructor(e,t,n){this.#l=new Set,this.#s=new Set,this.#a=new Map,this.#c=new Map,this.read=()=>({metadata:this.#r,injectedSlices:[...this.#l].map(e=>({name:"string"==typeof e?e:e.name,value:this.#u(e)})),consumedSlices:[...this.#s].map(e=>({name:"string"==typeof e?e:e.name,value:this.#u(e)})),recordedTimers:[...this.#a].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#h(e)})),waitTimers:[...this.#c].map(([e,{duration:t}])=>({name:e.name,duration:t,status:this.#h(e)}))}),this.onRecord=e=>{this.#a.set(e,{start:Date.now(),duration:0})},this.onClear=e=>{this.#a.delete(e)},this.onDone=e=>{let t=this.#a.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.#l.add(e)},this.onRemove=e=>{this.#l.delete(e)},this.onUse=e=>{this.#s.add(e)},this.#u=e=>this.#i.get(e).get(),this.#h=e=>this.#o.get(e).status,this.#i=e,this.#o=t,this.#r=n}#u;#h},rm=class e{#i;#o;#r;#d;constructor(t,n,r){this.produce=t=>t&&Object.keys(t).length?new e(this.#i,this.#o,{...t}):this,this.inject=(e,t)=>{let n=e.create(this.#i.sliceMap);return null!=t&&n.set(t),this.#d?.onInject(e),this},this.remove=e=>(this.#i.remove(e),this.#d?.onRemove(e),this),this.record=e=>(e.create(this.#o.store),this.#d?.onRecord(e),this),this.clearTimer=e=>(this.#o.remove(e),this.#d?.onClear(e),this),this.isInjected=e=>this.#i.has(e),this.isRecorded=e=>this.#o.has(e),this.use=e=>(this.#d?.onUse(e),this.#i.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.#o.get(e),this.done=e=>{this.timer(e).done(),this.#d?.onDone(e)},this.wait=e=>{let t=this.timer(e).start();return this.#d?.onWait(e,t),t},this.waitTimers=async e=>{await Promise.all(this.get(e).map(e=>this.wait(e)))},this.#i=t,this.#o=n,this.#r=r,r&&(this.#d=new rf(t,n,r))}get meta(){return this.#r}get inspector(){return this.#d}},rg=class{constructor(){this.store=new Map,this.get=e=>{let t=this.store.get(e.id);if(!t){var n;throw n=e.name,new rn(rt.timerNotFound,`Timer "${n}" not found, do you forget to record it?`)}return t},this.remove=e=>{this.store.delete(e.id)},this.has=e=>this.store.has(e.id)}},rv=class{#p;#f;#m;#g;constructor(e,t){this.#p=null,this.#f=null,this.#g="pending",this.start=()=>(this.#p??=new Promise((e,t)=>{this.#f=t=>{t instanceof CustomEvent&&t.detail.id===this.#m&&(this.#g="resolved",this.#v(),t.stopImmediatePropagation(),e())},this.#y(()=>{"pending"===this.#g&&(this.#g="rejected"),this.#v(),t(Error(`Timing ${this.type.name} timeout.`))}),this.#g="pending",addEventListener(this.type.name,this.#f)}),this.#p),this.done=()=>{dispatchEvent(new CustomEvent(this.type.name,{detail:{id:this.#m}}))},this.#v=()=>{this.#f&&removeEventListener(this.type.name,this.#f)},this.#y=e=>{setTimeout(()=>{e()},this.type.timeout)},this.#m=Symbol(t.name),this.type=t,e.set(t.id,this)}get status(){return this.#g}#v;#y},ry=class{constructor(e,t=3e3){this.create=e=>new rv(e,this),this.id=Symbol(`Timer-${e}`),this.name=e,this.timeout=t}},rb=(e,t=3e3)=>new ry(e,t);let rw={};function rx(e,t){let n=t||rw;return rk(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function rk(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return rC(e.children,t,n)}return Array.isArray(e)?rC(e,t,n):""}function rC(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=rk(e[i],t,n);return r.join("")}function rS(e,t,n,r){let i,o=e.length,l=0;if(t=t<0?-t>o?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);l<r.length;)(i=r.slice(l,l+1e4)).unshift(t,0),e.splice(...i),l+=1e4,t+=1e4}function rM(e,t){return e.length>0?(rS(e,e.length,0,t),e):t}let rA={}.hasOwnProperty;function rT(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(rA.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];if(o)for(r in o){rA.call(i,r)||(i[r]=[]);let e=o[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);rS(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let rO=rH(/[A-Za-z]/),rE=rH(/[\dA-Za-z]/),rN=rH(/[#-'*+\--9=?A-Z^-~]/);function rD(e){return null!==e&&(e<32||127===e)}let rI=rH(/\d/),rL=rH(/[\dA-Fa-f]/),r_=rH(/[!-/:-@[-`{-~]/);function rR(e){return null!==e&&e<-2}function rz(e){return null!==e&&(e<0||32===e)}function rP(e){return -2===e||-1===e||32===e}let rB=rH(/\p{P}|\p{S}/u),rF=rH(/\s/);function rH(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function rq(e,t,n,r){let i=r?r-1:1/0,o=0;return function(r){return rP(r)?(e.enter(n),function r(l){return rP(l)&&o++<i?(e.consume(l),r):(e.exit(n),t(l))}(r)):t(r)}}let rj={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rq(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return rR(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},rV={tokenize:function(e){let t,n,r,i=this,o=[],l=0;return s;function s(t){if(l<o.length){let n=o[l];return i.containerState=n[1],e.attempt(n[0].continuation,a,c)(t)}return c(t)}function a(e){if(l++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&y();let r=i.events.length,o=r;for(;o--;)if("exit"===i.events[o][0]&&"chunkFlow"===i.events[o][1].type){n=i.events[o][1].end;break}g(l);let s=r;for(;s<i.events.length;)i.events[s][1].end={...n},s++;return rS(i.events,o+1,0,i.events.slice(r)),i.events.length=s,c(e)}return s(e)}function c(n){if(l===o.length){if(!t)return d(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(r$,u,h)(n)}function u(e){return t&&y(),g(l),d(e)}function h(e){return i.parser.lazy[i.now().line]=l!==o.length,r=i.now().offset,f(e)}function d(t){return i.containerState={},e.attempt(r$,p,f)(t)}function p(e){return l++,o.push([i.currentConstruct,i.containerState]),d(e)}function f(r){if(null===r){t&&y(),g(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){m(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return rR(n)?(e.consume(n),m(e.exit("chunkFlow")),l=0,i.interrupt=void 0,s):(e.consume(n),t)}(r)}function m(e,o){let s=i.sliceStream(e);if(o&&s.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(s),i.parser.lazy[e.start.line]){let e,n,o=t.events.length;for(;o--;)if(t.events[o][1].start.offset<r&&(!t.events[o][1].end||t.events[o][1].end.offset>r))return;let s=i.events.length,a=s;for(;a--;)if("exit"===i.events[a][0]&&"chunkFlow"===i.events[a][1].type){if(e){n=i.events[a][1].end;break}e=!0}for(g(l),o=s;o<i.events.length;)i.events[o][1].end={...n},o++;rS(i.events,a+1,0,i.events.slice(s)),i.events.length=o}}function g(t){let n=o.length;for(;n-- >t;){let t=o[n];i.containerState=t[1],t[0].exit.call(i,e)}o.length=t}function y(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},r$={tokenize:function(e,t,n){return rq(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},rW={partial:!0,tokenize:function(e,t,n){return function(t){return rP(t)?rq(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||rR(e)?t(e):n(e)}}};class rU{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&rG(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),rG(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),rG(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);rG(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);rG(this.left,t.reverse())}}}function rG(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function rK(e){let t,n,r,i,o,l,s,a={},c=-1,u=new rU(e);for(;++c<u.length;){for(;c in a;)c=a[c];if(t=u.get(c),c&&"chunkFlow"===t[1].type&&"listItemPrefix"===u.get(c-1)[1].type&&((r=0)<(l=t[1]._tokenizer.events).length&&"lineEndingBlank"===l[r][1].type&&(r+=2),r<l.length&&"content"===l[r][1].type))for(;++r<l.length&&"content"!==l[r][1].type;)"chunkText"===l[r][1].type&&(l[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(a,function(e,t){let n,r,i=e.get(t)[1],o=e.get(t)[2],l=t-1,s=[],a=i._tokenizer;!a&&(a=o.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));let c=a.events,u=[],h={},d=-1,p=i,f=0,m=0,g=[0];for(;p;){for(;e.get(++l)[1]!==p;);s.push(l),!p._tokenizer&&(n=o.sliceStream(p),p.next||n.push(null),r&&a.defineSkip(p.start),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(n),p._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),r=p,p=p.next}for(p=i;++d<c.length;)"exit"===c[d][0]&&"enter"===c[d-1][0]&&c[d][1].type===c[d-1][1].type&&c[d][1].start.line!==c[d][1].end.line&&(m=d+1,g.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(a.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),d=g.length;d--;){let t=c.slice(g[d],g[d+1]),n=s.pop();u.push([n,n+t.length-1]),e.splice(n,2,t)}for(u.reverse(),d=-1;++d<u.length;)h[f+u[d][0]]=f+u[d][1],f+=u[d][1]-u[d][0]-1;return h}(u,c)),c=a[c],s=!0);else if(t[1]._container){for(r=c,n=void 0;r--;)if("lineEnding"===(i=u.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(u.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...u.get(n)[1].start},(o=u.slice(n,c)).unshift(t),u.splice(n,c-n+1,o))}}return rS(e,0,1/0,u.slice(0)),!s}let rJ={resolve:function(e){return rK(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):rR(t)?e.check(rZ,o,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function o(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},rZ={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rq(e,i,"linePrefix")};function i(i){if(null===i||rR(i))return n(i);let o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},rY={tokenize:function(e){let t=this,n=e.attempt(rW,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,rq(e,e.attempt(this.parser.constructs.flow,r,e.attempt(rJ,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},rX={resolveAll:r4()},rQ=r1("string"),r0=r1("text");function r1(e){return{resolveAll:r4("text"===e?r5:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,o,l);return o;function o(e){return a(e)?i(e):l(e)}function l(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return a(e)?(t.exit("data"),i(e)):(t.consume(e),s)}function a(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function r4(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function r5(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],o=t.sliceStream(i),l=o.length,s=-1,a=0;for(;l--;){let e=o[l];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)a++,s--;if(s)break;s=-1}else if(-2===e)r=!0,a++;else if(-1===e);else{l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){let o={type:n===e.length||r||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?s:i.start._bufferIndex+s,_index:i.start._index+l,line:i.end.line,column:i.end.column-a,offset:i.end.offset-a},end:{...i.end}};i.end={...o.start},i.start.offset===i.end.offset?Object.assign(i,o):(e.splice(n,0,["enter",o,t],["exit",o,t]),n+=2)}n++}return e}function r2(e){return null===e||rz(e)||rF(e)?1:rB(e)?2:void 0}function r3(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}let r7={name:"attention",resolveAll:function(e,t){let n,r,i,o,l,s,a,c,u=-1;for(;++u<e.length;)if("enter"===e[u][0]&&"attentionSequence"===e[u][1].type&&e[u][1]._close){for(n=u;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[u][1]).charCodeAt(0)){if((e[n][1]._close||e[u][1]._open)&&(e[u][1].end.offset-e[u][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[u][1].end.offset-e[u][1].start.offset)%3))continue;s=e[n][1].end.offset-e[n][1].start.offset>1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;let h={...e[n][1].end},d={...e[u][1].start};r6(h,-s),r6(d,s),o={type:s>1?"strongSequence":"emphasisSequence",start:h,end:{...e[n][1].end}},l={type:s>1?"strongSequence":"emphasisSequence",start:{...e[u][1].start},end:d},i={type:s>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[u][1].start}},r={type:s>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[n][1].end={...o.start},e[u][1].start={...l.end},a=[],e[n][1].end.offset-e[n][1].start.offset&&(a=rM(a,[["enter",e[n][1],t],["exit",e[n][1],t]])),a=rM(a,[["enter",r,t],["enter",o,t],["exit",o,t],["enter",i,t]]),a=rM(a,r3(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),a=rM(a,[["exit",i,t],["enter",l,t],["exit",l,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,a=rM(a,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,rS(e,n-1,u-n+3,a),u=n+a.length-c-2;break}}for(u=-1;++u<e.length;)"attentionSequence"===e[u][1].type&&(e[u][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,o=r2(i);return function(l){return n=l,e.enter("attentionSequence"),function l(s){if(s===n)return e.consume(s),l;let a=e.exit("attentionSequence"),c=r2(s),u=!c||2===c&&o||r.includes(s),h=!o||2===o&&c||r.includes(i);return a._open=!!(42===n?u:u&&(o||!h)),a._close=!!(42===n?h:h&&(c||!u)),t(s)}(l)}}};function r6(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let r8={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return rP(t)?rq(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(r8,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return rP(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},r9={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return r_(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},ie=document.createElement("i");function it(e){let t="&"+e+";";ie.innerHTML=t;let n=ie.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let ir={name:"characterReference",tokenize:function(e,t,n){let r,i,o=this,l=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),a):(e.enter("characterReferenceValue"),r=31,i=rE,c(t))}function a(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=rL,c):(e.enter("characterReferenceValue"),r=7,i=rI,c(t))}function c(s){if(59===s&&l){let r=e.exit("characterReferenceValue");return i!==rE||it(o.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(s)}return i(s)&&l++<r?(e.consume(s),c):n(s)}}},ii={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},io={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,o={partial:!0,tokenize:function(e,t,n){let o=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),l};function l(t){return e.enter("codeFencedFence"),rP(t)?rq(e,a,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)}function a(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o>=s?(e.exit("codeFencedFenceSequence"),rP(i)?rq(e,c,"whitespace")(i):c(i)):n(i)}(t)):n(t)}function c(r){return null===r||rR(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},l=0,s=0;return function(t){var o;let c;return o=t,l=(c=i.events[i.events.length-1])&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,r=o,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(s++,e.consume(i),t):s<3?n(i):(e.exit("codeFencedFenceSequence"),rP(i)?rq(e,a,"whitespace")(i):a(i))}(o)};function a(o){return null===o||rR(o)?(e.exit("codeFencedFence"),i.interrupt?t(o):e.check(ii,u,f)(o)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||rR(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),a(i)):rP(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),rq(e,c,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(o))}function c(t){return null===t||rR(t)?a(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||rR(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),a(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function u(t){return e.attempt(o,f,h)(t)}function h(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d}function d(t){return l>0&&rP(t)?rq(e,p,"linePrefix",l+1)(t):p(t)}function p(t){return null===t||rR(t)?e.check(ii,u,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||rR(n)?(e.exit("codeFlowValue"),p(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},il={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),rq(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?o(n):rR(n)?e.attempt(is,t,o)(n):(e.enter("codeFlowValue"),function n(r){return null===r||rR(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function o(n){return e.exit("codeIndented"),t(n)}}},is={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):rR(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):rq(e,o,"linePrefix",5)(t)}function o(e){let o=r.events[r.events.length-1];return o&&"linePrefix"===o[1].type&&o[2].sliceSerialize(o[1],!0).length>=4?t(e):rR(e)?i(e):n(e)}}};function ia(e,t,n,r,i,o,l,s,a){let c=a||1/0,u=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(o),e.consume(t),e.exit(o),h):null===t||32===t||41===t||rD(t)?n(t):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),f(t))};function h(n){return 62===n?(e.enter(o),e.consume(n),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),d(n))}function d(t){return 62===t?(e.exit("chunkString"),e.exit(s),h(t)):null===t||60===t||rR(t)?n(t):(e.consume(t),92===t?p:d)}function p(t){return 60===t||62===t||92===t?(e.consume(t),d):d(t)}function f(i){return!u&&(null===i||41===i||rz(i))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(i)):u<c&&40===i?(e.consume(i),u++,f):41===i?(e.consume(i),u--,f):null===i||32===i||40===i||rD(i)?n(i):(e.consume(i),92===i?m:f)}function m(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function ic(e,t,n,r,i,o){let l,s=this,a=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(o),c};function c(h){return a>999||null===h||91===h||93===h&&!l||94===h&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):93===h?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):rR(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(t){return null===t||91===t||93===t||rR(t)||a++>999?(e.exit("chunkString"),c(t)):(e.consume(t),l||(l=!rP(t)),92===t?h:u)}function h(t){return 91===t||92===t||93===t?(e.consume(t),a++,u):u(t)}}function iu(e,t,n,r,i,o){let l;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),l=40===t?41:t,s):n(t)};function s(n){return n===l?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(o),a(n))}function a(t){return t===l?(e.exit(o),s(l)):null===t?n(t):rR(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),rq(e,a,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===l||null===t||rR(t)?(e.exit("chunkString"),a(t)):(e.consume(t),92===t?u:c)}function u(t){return t===l||92===t?(e.consume(t),c):c(t)}}function ih(e,t){let n;return function r(i){return rR(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):rP(i)?rq(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function id(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let ip={partial:!0,tokenize:function(e,t,n){return function(t){return rz(t)?ih(e,r)(t):n(t)};function r(t){return iu(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return rP(t)?rq(e,o,"whitespace")(t):o(t)}function o(e){return null===e||rR(e)?t(e):n(e)}}},im=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ig=["pre","script","style","textarea"],iv={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(rW,t,n)}}},iy={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return rR(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},ib={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&rS(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,o,l=e.length,s=0;for(;l--;)if(n=e[l][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[l][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[l][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=l,"labelLink"!==n.type)){s=2;break}}else"labelEnd"===n.type&&(i=l);let a={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},u={type:"labelText",start:{...e[r+s+2][1].end},end:{...e[i-2][1].start}};return o=rM(o=[["enter",a,t],["enter",c,t]],e.slice(r+1,r+s+3)),o=rM(o,[["enter",u,t]]),o=rM(o,r3(t.parser.constructs.insideSpan.null,e.slice(r+s+4,i-3),t)),o=rM(o,[["exit",u,t],e[i-2],e[i-1],["exit",c,t]]),o=rM(o,e.slice(i+1)),o=rM(o,[["exit",a,t]]),rS(e,r,e.length,o),e},tokenize:function(e,t,n){let r,i,o=this,l=o.events.length;for(;l--;)if(("labelImage"===o.events[l][1].type||"labelLink"===o.events[l][1].type)&&!o.events[l][1]._balanced){r=o.events[l][1];break}return function(t){return r?r._inactive?u(t):(i=o.parser.defined.includes(id(o.sliceSerialize({start:r.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s):n(t)};function s(t){return 40===t?e.attempt(iw,c,i?c:u)(t):91===t?e.attempt(ix,c,i?a:u)(t):i?c(t):u(t)}function a(t){return e.attempt(ik,c,u)(t)}function c(e){return t(e)}function u(e){return r._balanced=!0,n(e)}}},iw={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return rz(t)?ih(e,i)(t):i(t)}function i(t){return 41===t?c(t):ia(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function o(t){return rz(t)?ih(e,s)(t):c(t)}function l(e){return n(e)}function s(t){return 34===t||39===t||40===t?iu(e,a,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):c(t)}function a(t){return rz(t)?ih(e,c)(t):c(t)}function c(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},ix={tokenize:function(e,t,n){let r=this;return function(t){return ic.call(r,e,i,o,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(id(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}},ik={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},iC={name:"labelStartImage",resolveAll:ib.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),o):n(t)}function o(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},iS={name:"labelStartLink",resolveAll:ib.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},iM={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),rq(e,t,"linePrefix")}}},iA={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(o){var l;return e.enter("thematicBreak"),r=l=o,function o(l){return l===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),rP(n)?rq(e,o,"whitespace")(n):o(n))}(l)):i>=3&&(null===l||rR(l))?(e.exit("thematicBreak"),t(l)):n(l)}(l)}}},iT={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(rW,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,rq(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!rP(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(iE,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,rq(e,e.attempt(iT,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,l=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:rI(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(iA,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return rI(i)&&++l<10?(e.consume(i),t):(!r.interrupt||l<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),s(i)):n(i)}(t)}return n(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(rW,r.interrupt?n:a,e.attempt(iO,u,c))}function a(e){return r.containerState.initialBlankLine=!0,o++,u(e)}function c(t){return rP(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),u):n(t)}function u(n){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},iO={partial:!0,tokenize:function(e,t,n){let r=this;return rq(e,function(e){let i=r.events[r.events.length-1];return!rP(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},iE={partial:!0,tokenize:function(e,t,n){let r=this;return rq(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},iN={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,o=e.length;for(;o--;)if("enter"===e[o][0]){if("content"===e[o][1].type){n=o;break}"paragraph"===e[o][1].type&&(r=o)}else"content"===e[o][1].type&&e.splice(o,1),i||"definition"!==e[o][1].type||(i=o);let l={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",l,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=l,e.push(["exit",l,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var l;let s,a=i.events.length;for(;a--;)if("lineEnding"!==i.events[a][1].type&&"linePrefix"!==i.events[a][1].type&&"content"!==i.events[a][1].type){s="paragraph"===i.events[a][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||s)?(e.enter("setextHeadingLine"),r=t,l=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),rP(n)?rq(e,o,"lineSuffix")(n):o(n))}(l)):n(t)};function o(r){return null===r||rR(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,ic.call(i,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function o(t){return(r=id(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l):n(t)}function l(t){return rz(t)?ih(e,s)(t):s(t)}function s(t){return ia(e,a,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function a(t){return e.attempt(ip,c,c)(t)}function c(t){return rP(t)?rq(e,u,"whitespace")(t):u(t)}function u(o){return null===o||rR(o)?(e.exit("definition"),i.parser.defined.push(r),t(o)):n(o)}}}},"disable",0,{null:[]},"document",0,{42:iT,43:iT,45:iT,48:iT,49:iT,50:iT,51:iT,52:iT,53:iT,54:iT,55:iT,56:iT,57:iT,62:r8},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),i-2>o&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(o===i-1||i-4>o&&"whitespace"===e[i-2][1].type)&&(i-=o+1===i?2:4),i>o&&(n={type:"atxHeadingText",start:e[o][1].start,end:e[i][1].end},r={type:"chunkText",start:e[o][1].start,end:e[i][1].end,contentType:"text"},rS(e,o,i-o+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var o;return e.enter("atxHeading"),o=i,e.enter("atxHeadingSequence"),function i(o){return 35===o&&r++<6?(e.consume(o),i):null===o||rz(o)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||rR(r)?(e.exit("atxHeading"),t(r)):rP(r)?rq(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||rz(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(o)):n(o)}(o)}}},42:iA,45:[iN,iA],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,o,l,s,a=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),c};function c(l){return 33===l?(e.consume(l),u):47===l?(e.consume(l),i=!0,p):63===l?(e.consume(l),r=3,a.interrupt?t:L):rO(l)?(e.consume(l),o=String.fromCharCode(l),f):n(l)}function u(i){return 45===i?(e.consume(i),r=2,h):91===i?(e.consume(i),r=5,l=0,d):rO(i)?(e.consume(i),r=4,a.interrupt?t:L):n(i)}function h(r){return 45===r?(e.consume(r),a.interrupt?t:L):n(r)}function d(r){let i="CDATA[";return r===i.charCodeAt(l++)?(e.consume(r),l===i.length)?a.interrupt?t:M:d:n(r)}function p(t){return rO(t)?(e.consume(t),o=String.fromCharCode(t),f):n(t)}function f(l){if(null===l||47===l||62===l||rz(l)){let s=47===l,c=o.toLowerCase();return!s&&!i&&ig.includes(c)?(r=1,a.interrupt?t(l):M(l)):im.includes(o.toLowerCase())?(r=6,s)?(e.consume(l),m):a.interrupt?t(l):M(l):(r=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(l):i?function t(n){return rP(n)?(e.consume(n),t):C(n)}(l):g(l))}return 45===l||rE(l)?(e.consume(l),o+=String.fromCharCode(l),f):n(l)}function m(r){return 62===r?(e.consume(r),a.interrupt?t:M):n(r)}function g(t){return 47===t?(e.consume(t),C):58===t||95===t||rO(t)?(e.consume(t),y):rP(t)?(e.consume(t),g):C(t)}function y(t){return 45===t||46===t||58===t||95===t||rE(t)?(e.consume(t),y):b(t)}function b(t){return 61===t?(e.consume(t),w):rP(t)?(e.consume(t),b):g(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,x):rP(t)?(e.consume(t),w):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||rz(n)?b(n):(e.consume(n),t)}(t)}function x(t){return t===s?(e.consume(t),s=null,k):null===t||rR(t)?n(t):(e.consume(t),x)}function k(e){return 47===e||62===e||rP(e)?g(e):n(e)}function C(t){return 62===t?(e.consume(t),S):n(t)}function S(t){return null===t||rR(t)?M(t):rP(t)?(e.consume(t),S):n(t)}function M(t){return 45===t&&2===r?(e.consume(t),E):60===t&&1===r?(e.consume(t),N):62===t&&4===r?(e.consume(t),_):63===t&&3===r?(e.consume(t),L):93===t&&5===r?(e.consume(t),I):rR(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(iv,R,A)(t)):null===t||rR(t)?(e.exit("htmlFlowData"),A(t)):(e.consume(t),M)}function A(t){return e.check(iy,T,R)(t)}function T(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),O}function O(t){return null===t||rR(t)?A(t):(e.enter("htmlFlowData"),M(t))}function E(t){return 45===t?(e.consume(t),L):M(t)}function N(t){return 47===t?(e.consume(t),o="",D):M(t)}function D(t){if(62===t){let n=o.toLowerCase();return ig.includes(n)?(e.consume(t),_):M(t)}return rO(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),D):M(t)}function I(t){return 93===t?(e.consume(t),L):M(t)}function L(t){return 62===t?(e.consume(t),_):45===t&&2===r?(e.consume(t),L):M(t)}function _(t){return null===t||rR(t)?(e.exit("htmlFlowData"),R(t)):(e.consume(t),_)}function R(n){return e.exit("htmlFlow"),t(n)}}},61:iN,95:iA,96:io,126:io},"flowInitial",0,{[-2]:il,[-1]:il,32:il},"insideSpan",0,{null:[r7,rX]},"string",0,{38:ir,92:r9},"text",0,{[-5]:iM,[-4]:iM,[-3]:iM,33:iC,38:ir,42:r7,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return rO(t)?(e.consume(t),o):64===t?n(t):s(t)}function o(t){return 43===t||45===t||46===t||rE(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,l):(43===n||45===n||46===n||rE(n))&&r++<32?(e.consume(n),t):(r=0,s(n))}(t)):s(t)}function l(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||rD(r)?n(r):(e.consume(r),l)}function s(t){return 64===t?(e.consume(t),a):rN(t)?(e.consume(t),s):n(t)}function a(i){return rE(i)?function i(o){return 46===o?(e.consume(o),r=0,a):62===o?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(o),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(o){if((45===o||rE(o))&&r++<63){let n=45===o?t:i;return e.consume(o),n}return n(o)}(o)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,o,l=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),a):47===t?(e.consume(t),x):63===t?(e.consume(t),b):rO(t)?(e.consume(t),C):n(t)}function a(t){return 45===t?(e.consume(t),c):91===t?(e.consume(t),i=0,p):rO(t)?(e.consume(t),y):n(t)}function c(t){return 45===t?(e.consume(t),d):n(t)}function u(t){return null===t?n(t):45===t?(e.consume(t),h):rR(t)?(o=u,D(t)):(e.consume(t),u)}function h(t){return 45===t?(e.consume(t),d):u(t)}function d(e){return 62===e?N(e):45===e?h(e):u(e)}function p(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),m):rR(t)?(o=f,D(t)):(e.consume(t),f)}function m(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?N(t):93===t?(e.consume(t),g):f(t)}function y(t){return null===t||62===t?N(t):rR(t)?(o=y,D(t)):(e.consume(t),y)}function b(t){return null===t?n(t):63===t?(e.consume(t),w):rR(t)?(o=b,D(t)):(e.consume(t),b)}function w(e){return 62===e?N(e):b(e)}function x(t){return rO(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||rE(t)?(e.consume(t),k):function t(n){return rR(n)?(o=t,D(n)):rP(n)?(e.consume(n),t):N(n)}(t)}function C(t){return 45===t||rE(t)?(e.consume(t),C):47===t||62===t||rz(t)?S(t):n(t)}function S(t){return 47===t?(e.consume(t),N):58===t||95===t||rO(t)?(e.consume(t),M):rR(t)?(o=S,D(t)):rP(t)?(e.consume(t),S):N(t)}function M(t){return 45===t||46===t||58===t||95===t||rE(t)?(e.consume(t),M):function t(n){return 61===n?(e.consume(n),A):rR(n)?(o=t,D(n)):rP(n)?(e.consume(n),t):S(n)}(t)}function A(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,T):rR(t)?(o=A,D(t)):rP(t)?(e.consume(t),A):(e.consume(t),O)}function T(t){return t===r?(e.consume(t),r=void 0,E):null===t?n(t):rR(t)?(o=T,D(t)):(e.consume(t),T)}function O(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||rz(t)?S(t):(e.consume(t),O)}function E(e){return 47===e||62===e||rz(e)?S(e):n(e)}function N(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function D(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),I}function I(t){return rP(t)?rq(e,L,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):L(t)}function L(t){return e.enter("htmlTextData"),o(t)}}}],91:iS,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return rR(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},r9],93:ib,95:r7,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,o=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),o++,t):(e.exit("codeTextSequence"),l(n))}(t)};function l(a){return null===a?n(a):32===a?(e.enter("space"),e.consume(a),e.exit("space"),l):96===a?(i=e.enter("codeTextSequence"),r=0,function n(l){return 96===l?(e.consume(l),r++,n):r===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(l)):(i.type="codeTextData",s(l))}(a)):rR(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):(e.enter("codeTextData"),s(a))}function s(t){return null===t||32===t||96===t||rR(t)?(e.exit("codeTextData"),l(t)):(e.consume(t),s)}}}}],4127);var iD=e.i(4127);let iI=/[\0\t\n\r]/g;function iL(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let i_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function iR(e){return e.replace(i_,iz)}function iz(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return iL(n.slice(t?2:1),t?16:10)}return it(n)||e}function iP(e){return e&&"object"==typeof e?"position"in e||"type"in e?iF(e.position):"start"in e||"end"in e?iF(e):"line"in e||"column"in e?iB(e):"":""}function iB(e){return iH(e&&e.line)+":"+iH(e&&e.column)}function iF(e){return iB(e&&e.start)+"-"+iB(e&&e.end)}function iH(e){return e&&"number"==typeof e?e:1}let iq={}.hasOwnProperty;function ij(e){return{line:e.line,column:e.column,offset:e.offset}}function iV(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+iP({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+iP({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+iP({start:t.start,end:t.end})+") is still open")}function i$(e){let t=this;t.parser=function(n){var r,i;let o,l,s,a;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(y),autolinkProtocol:c,autolinkEmail:c,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:r(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(p,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:c,data:c,codeFlowValue:c,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(m),hardBreakTrailing:r(m),htmlFlow:r(g,i),htmlFlowData:c,htmlText:r(g,i),htmlTextData:c,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(y),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(b,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(b),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:l(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:l(),autolinkEmail:function(e){u.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){u.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:l(),characterEscapeValue:u,characterReferenceMarkerHexadecimal:d,characterReferenceMarkerNumeric:d,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=iL(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=it(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=ij(e.end)},codeFenced:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:u,codeIndented:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:u,data:u,definition:l(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=id(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:l(),hardBreakEscape:l(h),hardBreakTrailing:l(h),htmlFlow:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:u,htmlText:l(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:u,image:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=iR(t),n.identifier=id(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=ij(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(c.call(this,e),u.call(this,e))},link:l(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=id(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:l(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:l(),thematicBreak:l()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(iq.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},l={stack:[r],tokenStack:[],config:t,enter:o,exit:s,buffer:i,resume:a,data:n},c=[],u=-1;for(;++u<e.length;)("listOrdered"===e[u][1].type||"listUnordered"===e[u][1].type)&&("enter"===e[u][0]?c.push(u):u=function(e,t,n){let r,i,o,l,s=t-1,a=-1,c=!1;for(;++s<=n;){let t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?a++:a--,l=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||l||a||o||(o=s),l=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:l=void 0}if(!a&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===a&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let l=s;for(i=void 0;l--;){let t=e[l];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",c=!0),t[1].type="lineEnding",i=l}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}o&&(!i||o<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||s,0,["exit",r,t[2]]),s++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(s,0,["enter",i,t[2]]),s++,n++,o=void 0,l=!0}}}return e[t][1]._spread=c,n}(e,c.pop(),u));for(u=-1;++u<e.length;){let n=t[e[u][0]];iq.call(n,e[u][1].type)&&n[e[u][1].type].call(Object.assign({sliceSerialize:e[u][2].sliceSerialize},l),e[u][1])}if(l.tokenStack.length>0){let e=l.tokenStack[l.tokenStack.length-1];(e[1]||iV).call(l,void 0,e[0])}for(r.position={start:ij(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ij(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u<t.transforms.length;)r=t.transforms[u](r)||r;return r};function r(e,t){return function(n){o.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function o(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ij(t.start),end:void 0}}function l(e){return function(t){e&&e.call(this,t),s.call(this,t)}}function s(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||iV).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+iP({start:e.start,end:e.end})+"): it’s not open");n.position.end=ij(e.end)}function a(){return rx(this.stack.pop())}function c(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:ij(e.start),end:void 0},t.push(n)),this.stack.push(n)}function u(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ij(e.end)}function h(){this.data.atHardBreak=!0}function d(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function m(){return{type:"break"}}function g(){return{type:"html",value:""}}function y(){return{type:"link",title:null,url:"",children:[]}}function b(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!rK(e););return e}((function(e){let t={constructs:rT([iD,...(e||{}).extensions||[]]),content:n(rj),defined:[],document:n(rV),flow:n(rY),lazy:{},string:n(rQ),text:n(r0)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],l=[],s=[],a={attempt:f(function(e,t){m(e,t.from)}),check:f(p),consume:function(e){rR(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=d(),c.events.push(["enter",n,c]),s.push(n),n},exit:function(e){let t=s.pop();return t.end=d(),c.events.push(["exit",t,c]),t},interrupt:f(p,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,g()},events:[],now:d,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let o,l=e[r];if("string"==typeof l)o=l;else switch(l){case -5:o="\r";break;case -4:o="\n";break;case -3:o="\r\n";break;case -2:o=t?" ":" ";break;case -1:if(!t&&n)continue;o=" ";break;default:o=String.fromCharCode(l)}n=-2===l,i.push(o)}return i.join("")}(h(e),t)},sliceStream:h,write:function(e){return(l=rM(l,e),function(){let e;for(;r._index<l.length;){let n=l[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),u=u(t)}else u=u(n)}}(),null!==l[l.length-1])?[]:(m(t,0),c.events=r3(o,c.events,c),c.events)}},u=t.tokenize.call(c,a);return t.resolveAll&&o.push(t),c;function h(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,o=t.end._index,l=t.end._bufferIndex;if(r===o)n=[e[r].slice(i,l)];else{if(n=e.slice(r,o),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}l>0&&n.push(e[o].slice(0,l))}return n}(l,e)}function d(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:o}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:o}}function p(e,t){t.restore()}function f(e,t){return function(n,i,o){var l;let u,h,p,f;return Array.isArray(n)?m(n):"tokenize"in n?m([n]):(l=n,function(e){let t=null!==e&&l[e],n=null!==e&&l.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function m(e){return(u=e,h=0,0===e.length)?o:y(e[h])}function y(e){return function(n){let i,o,l,u,h;return(i=d(),o=c.previous,l=c.currentConstruct,u=c.events.length,h=Array.from(s),f={from:u,restore:function(){r=i,c.previous=o,c.currentConstruct=l,c.events.length=u,s=h,g()}},p=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?w(n):e.tokenize.call(t?Object.assign(Object.create(c),t):c,a,b,w)(n)}}function b(t){return e(p,f),i}function w(e){return(f.restore(),++h<u.length)?y(u[h]):o}}}function m(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&rS(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function g(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((l=1,s="",a=!0,function(e,t,n){let r,i,c,u,h,d=[];for(e=s+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),c=0,s="",a&&(65279===e.charCodeAt(0)&&c++,a=void 0);c<e.length;){if(iI.lastIndex=c,u=(r=iI.exec(e))&&void 0!==r.index?r.index:e.length,h=e.charCodeAt(u),!r){s=e.slice(c);break}if(10===h&&c===u&&o)d.push(-3),o=void 0;else switch(o&&(d.push(-5),o=void 0),c<u&&(d.push(e.slice(c,u)),l+=u-c),h){case 0:d.push(65533),l++;break;case 9:for(i=4*Math.ceil(l/4),d.push(-2);l++<i;)d.push(-1);break;case 10:d.push(-4),l=1;break;default:o=!0,l=1}c=u+1}return n&&(o&&d.push(-5),s&&d.push(s),d.push(null)),d})(n,r,!0))))}}let iW={}.hasOwnProperty,iU={}.hasOwnProperty;function iG(e,t,n){return">"+(n?"":" ")+e}function iK(e,t){return iJ(e,t.inConstruct,!0)&&!iJ(e,t.notInConstruct,!1)}function iJ(e,t,n){if("string"==typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function iZ(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if("\n"===n.unsafe[i].character&&iK(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return"\\\n"}function iY(e,t){let n=String(e),r=n.indexOf(t),i=r,o=0,l=0;if("string"!=typeof t)throw TypeError("Expected substring");for(;-1!==r;)r===i?++o>l&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function iX(e,t){return!!(!1===t.options.fences&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function iQ(e,t,n){return(n?"":" ")+e}function i0(e){let t=e.options.quote||'"';if('"'!==t&&"'"!==t)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function i1(e){return"&#x"+e.toString(16).toUpperCase()+";"}function i4(e,t,n){let r=r2(e),i=r2(t);return void 0===r?void 0===i?"_"===n?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===r?void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===i?{inside:!1,outside:!1}:1===i?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function i5(e,t,n,r){let i=function(e){let t=e.options.emphasis||"*";if("*"!==t&&"_"!==t)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}(n),o=n.enter("emphasis"),l=n.createTracker(r),s=l.move(i),a=l.move(n.containerPhrasing(e,{after:i,before:s,...l.current()})),c=a.charCodeAt(0),u=i4(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(a=i1(c)+a.slice(1));let h=a.charCodeAt(a.length-1),d=i4(r.after.charCodeAt(0),h,i);d.inside&&(a=a.slice(0,-1)+i1(h));let p=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},s+a+p}i5.peek=function(e,t,n){return n.options.emphasis||"*"};let i2=function(e){var t,n;if(null==e)return i7;if("function"==typeof e)return i3(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=i2(e[n]);return i3(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,i3(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,i3(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function i3(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function i7(){return!0}let i6=[],i8="skip";function i9(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let o=i2(i),l=r?-1:1;(function e(i,s,a){let c=i&&"object"==typeof i?i:{};if("string"==typeof c.type){let e="string"==typeof c.tagName?c.tagName:"string"==typeof c.name?c.name:void 0;Object.defineProperty(u,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return u;function u(){var c;let u,h,d,p=i6;if((!t||o(i,s,a[a.length-1]||void 0))&&!1===(p=Array.isArray(c=n(i,a))?c:"number"==typeof c?[!0,c]:null==c?i6:[c])[0])return p;if("children"in i&&i.children&&i.children&&p[0]!==i8)for(h=(r?i.children.length:-1)+l,d=a.concat(i);h>-1&&h<i.children.length;){if(!1===(u=e(i.children[h],h,d)())[0])return u;h="number"==typeof u[1]?u[1]:h+l}return p}})(e,void 0,[])()}function oe(e,t,n,r){let i,o,l;"function"==typeof t&&"function"!=typeof n?(o=void 0,l=t,i=n):(o=t,l=n,i=r),i9(e,o,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return l(e,r,n)},i)}function ot(e,t){let n=!1;return oe(e,function(e){if("value"in e&&/\r?\n|\r/.test(e.value)||"break"===e.type)return n=!0,!1}),!!((!e.depth||e.depth<3)&&rx(e)&&(t.options.setext||n))}function on(e){return e.value||""}function or(e,t,n,r){let i=i0(n),o='"'===i?"Quote":"Apostrophe",l=n.enter("image"),s=n.enter("label"),a=n.createTracker(r),c=a.move("![");return c+=a.move(n.safe(e.alt,{before:c,after:"]",...a.current()})),c+=a.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(s=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),s()),c+=a.move(")"),l(),c}function oi(e,t,n,r){let i=e.referenceType,o=n.enter("imageReference"),l=n.enter("label"),s=n.createTracker(r),a=s.move("!["),c=n.safe(e.alt,{before:a,after:"]",...s.current()});a+=s.move(c+"]["),l();let u=n.stack;n.stack=[],l=n.enter("reference");let h=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return l(),n.stack=u,o(),"full"!==i&&c&&c===h?"shortcut"===i?a=a.slice(0,-1):a+=s.move("]"):a+=s.move(h+"]"),a}function oo(e,t,n){let r=e.value||"",i="`",o=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){let e,t=n.unsafe[o],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}function ol(e,t){let n=rx(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&1===e.children.length&&"text"===e.children[0].type&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}function oa(e,t,n,r){let i,o,l=i0(n),s='"'===l?"Quote":"Apostrophe",a=n.createTracker(r);if(ol(e,n)){let t=n.stack;n.stack=[],i=n.enter("autolink");let r=a.move("<");return r+=a.move(n.containerPhrasing(e,{before:r,after:">",...a.current()})),r+=a.move(">"),i(),n.stack=t,r}i=n.enter("link"),o=n.enter("label");let c=a.move("[");return c+=a.move(n.containerPhrasing(e,{before:c,after:"](",...a.current()})),c+=a.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(o=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":")",...a.current()}))),o(),e.title&&(o=n.enter(`title${s}`),c+=a.move(" "+l),c+=a.move(n.safe(e.title,{before:c,after:l,...a.current()})),c+=a.move(l),o()),c+=a.move(")"),i(),c}function oc(e,t,n,r){let i=e.referenceType,o=n.enter("linkReference"),l=n.enter("label"),s=n.createTracker(r),a=s.move("["),c=n.containerPhrasing(e,{before:a,after:"]",...s.current()});a+=s.move(c+"]["),l();let u=n.stack;n.stack=[],l=n.enter("reference");let h=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return l(),n.stack=u,o(),"full"!==i&&c&&c===h?"shortcut"===i?a=a.slice(0,-1):a+=s.move("]"):a+=s.move(h+"]"),a}function ou(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function oh(e){let t=e.options.rule||"*";if("*"!==t&&"-"!==t&&"_"!==t)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}on.peek=function(){return"<"},or.peek=function(){return"!"},oi.peek=function(){return"!"},oo.peek=function(){return"`"},oa.peek=function(e,t,n){return ol(e,n)?"<":"["},oc.peek=function(){return"["};let od=i2(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function op(e,t,n,r){let i=function(e){let t=e.options.strong||"*";if("*"!==t&&"_"!==t)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}(n),o=n.enter("strong"),l=n.createTracker(r),s=l.move(i+i),a=l.move(n.containerPhrasing(e,{after:i,before:s,...l.current()})),c=a.charCodeAt(0),u=i4(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(a=i1(c)+a.slice(1));let h=a.charCodeAt(a.length-1),d=i4(r.after.charCodeAt(0),h,i);d.inside&&(a=a.slice(0,-1)+i1(h));let p=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:d.outside,before:u.outside},s+a+p}op.peek=function(e,t,n){return n.options.strong||"*"};let of={blockquote:function(e,t,n,r){let i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);let l=n.indentLines(n.containerFlow(e,o.current()),iG);return i(),l},break:iZ,code:function(e,t,n,r){let i=function(e){let t=e.options.fence||"`";if("`"!==t&&"~"!==t)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}(n),o=e.value||"",l="`"===i?"GraveAccent":"Tilde";if(iX(e,n)){let e=n.enter("codeIndented"),t=n.indentLines(o,iQ);return e(),t}let s=n.createTracker(r),a=i.repeat(Math.max(iY(o,i)+1,3)),c=n.enter("codeFenced"),u=s.move(a);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=s.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=s.move(" "),u+=s.move(n.safe(e.meta,{before:u,after:"\n",encode:["`"],...s.current()})),t()}return u+=s.move("\n"),o&&(u+=s.move(o+"\n")),u+=s.move(a),c(),u},definition:function(e,t,n,r){let i=i0(n),o='"'===i?"Quote":"Apostrophe",l=n.enter("definition"),s=n.enter("label"),a=n.createTracker(r),c=a.move("[");return c+=a.move(n.safe(n.associationId(e),{before:c,after:"]",...a.current()})),c+=a.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),c+=a.move("<"),c+=a.move(n.safe(e.url,{before:c,after:">",...a.current()})),c+=a.move(">")):(s=n.enter("destinationRaw"),c+=a.move(n.safe(e.url,{before:c,after:e.title?" ":"\n",...a.current()}))),s(),e.title&&(s=n.enter(`title${o}`),c+=a.move(" "+i),c+=a.move(n.safe(e.title,{before:c,after:i,...a.current()})),c+=a.move(i),s()),l(),c},emphasis:i5,hardBreak:iZ,heading:function(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(ot(e,n)){let t=n.enter("headingSetext"),r=n.enter("phrasing"),l=n.containerPhrasing(e,{...o.current(),before:"\n",after:"\n"});return r(),t(),l+"\n"+(1===i?"=":"-").repeat(l.length-(Math.max(l.lastIndexOf("\r"),l.lastIndexOf("\n"))+1))}let l="#".repeat(i),s=n.enter("headingAtx"),a=n.enter("phrasing");o.move(l+" ");let c=n.containerPhrasing(e,{before:"# ",after:"\n",...o.current()});return/^[\t ]/.test(c)&&(c=i1(c.charCodeAt(0))+c.slice(1)),c=c?l+" "+c:l,n.options.closeAtx&&(c+=" "+l),a(),s(),c},html:on,image:or,imageReference:oi,inlineCode:oo,link:oa,linkReference:oc,list:function(e,t,n,r){let i=n.enter("list"),o=n.bulletCurrent,l=e.ordered?function(e){let t=e.options.bulletOrdered||".";if("."!==t&&")"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}(n):ou(n),s=e.ordered?"."===l?")":".":function(e){let t=ou(e),n=e.options.bulletOther;if(!n)return"*"===t?"-":"*";if("*"!==n&&"+"!==n&&"-"!==n)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}(n),a=!!t&&!!n.bulletLastUsed&&l===n.bulletLastUsed;if(!e.ordered){let t=e.children?e.children[0]:void 0;if("*"!==l&&"-"!==l||!t||t.children&&t.children[0]||"list"!==n.stack[n.stack.length-1]||"listItem"!==n.stack[n.stack.length-2]||"list"!==n.stack[n.stack.length-3]||"listItem"!==n.stack[n.stack.length-4]||0!==n.indexStack[n.indexStack.length-1]||0!==n.indexStack[n.indexStack.length-2]||0!==n.indexStack[n.indexStack.length-3]||(a=!0),oh(n)===l&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&"listItem"===n.type&&n.children&&n.children[0]&&"thematicBreak"===n.children[0].type){a=!0;break}}}}a&&(l=s),n.bulletCurrent=l;let c=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),c},listItem:function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),o=n.bulletCurrent||ou(n);t&&"list"===t.type&&t.ordered&&(o=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+o);let l=o.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(l=4*Math.ceil(l/4));let s=n.createTracker(r);s.move(o+" ".repeat(l-o.length)),s.shift(l);let a=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,s.current()),function(e,t,n){return t?(n?"":" ".repeat(l))+e:(n?o:o+" ".repeat(l-o.length))+e});return a(),c},paragraph:function(e,t,n,r){let i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l},root:function(e,t,n,r){return(e.children.some(function(e){return od(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)},strong:op,text:function(e,t,n,r){return n.safe(e.value,r)},thematicBreak:function(e,t,n){let r=(oh(n)+(n.options.ruleSpaces?" ":"")).repeat(function(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}(n));return n.options.ruleSpaces?r.slice(0,-1):r}},om=[function(e,t,n,r){if("code"===t.type&&iX(t,r)&&("list"===e.type||e.type===t.type&&iX(e,r)))return!1;if("spread"in n&&"boolean"==typeof n.spread){if("paragraph"===e.type&&(e.type===t.type||"definition"===t.type||"heading"===t.type&&ot(t,r)))return;return+!!n.spread}}],og=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],ov=[{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:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:og},{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:og},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:og},{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:og},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:og},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:og},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:og},{atBreak:!0,character:"~"}];function oy(e){return e.label||!e.identifier?e.label||"":iR(e.identifier)}function ob(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}let ow=/\r?\n|\r/g;function ox(e,t){let n,r=[],i=0,o=0;for(;n=ow.exec(e);)l(e.slice(i,n.index)),r.push(n[0]),i=n.index+n[0].length,o++;return l(e.slice(i)),r.join("");function l(e){r.push(t(e,o,!e))}}function ok(e,t){return e-t}function oC(e,t){let n,r=/\\(?=[!-/:-@[-`{-~])/g,i=[],o=[],l=e+t,s=-1,a=0;for(;n=r.exec(l);)i.push(n.index);for(;++s<i.length;)a!==i[s]&&o.push(e.slice(a,i[s])),o.push("\\"),a=i[s];return o.push(e.slice(a)),o.join("")}function oS(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,o=n.column||1;return{move:function(e){let t=e||"",n=t.split(/\r?\n|\r/g),l=n[n.length-1];return i+=n.length-1,o=1===n.length?o+l.length:1+l.length+r,t},current:function(){return{now:{line:i,column:o},lineShift:r}},shift:function(e){r+=e}}}function oM(e){throw Error("Cannot handle value `"+e+"`, expected node")}function oA(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function oT(e,t){if("definition"===e.type&&e.type===t.type)return 0}function oO(e,t){return function(e,t,n){let r,i=t.indexStack,o=e.children||[],l=[],s=-1,a=n.before;i.push(-1);let c=t.createTracker(n);for(;++s<o.length;){let u,h=o[s];if(i[i.length-1]=s,s+1<o.length){let n=t.handle.handlers[o[s+1].type];n&&n.peek&&(n=n.peek),u=n?n(o[s+1],e,t,{before:"",after:"",...c.current()}).charAt(0):""}else u=n.after;l.length>0&&("\r"===a||"\n"===a)&&"html"===h.type&&(l[l.length-1]=l[l.length-1].replace(/(\r?\n|\r)$/," "),a=" ",(c=t.createTracker(n)).move(l.join("")));let d=t.handle(h,e,t,{...c.current(),after:u,before:a});r&&r===d.slice(0,1)&&(d=i1(r.charCodeAt(0))+d.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,r=void 0,p&&(l.length>0&&p.before&&a===l[l.length-1].slice(-1)&&(l[l.length-1]=l[l.length-1].slice(0,-1)+i1(a.charCodeAt(0))),p.after&&(r=u)),c.move(d),l.push(d),a=d.slice(-1)}return i.pop(),l.join("")}(e,this,t)}function oE(e,t){return function(e,t,n){let r=t.indexStack,i=e.children||[],o=t.createTracker(n),l=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,l.push(o.move(t.handle(n,e,t,{before:"\n",after:"\n",...o.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),s<i.length-1&&l.push(o.move(function(e,t,n,r){let i=r.join.length;for(;i--;){let o=r.join[i](e,t,n,r);if(!0===o||1===o)break;if("number"==typeof o)return"\n".repeat(1+o);if(!1===o)return"\n\n<!---->\n\n"}return"\n\n"}(n,i[s+1],e,t)))}return r.pop(),l.join("")}(e,this,t)}function oN(e,t){return function(e,t,n){let r=(n.before||"")+(t||"")+(n.after||""),i=[],o=[],l={},s=-1;for(;++s<e.unsafe.length;){let t,n=e.unsafe[s];if(!iK(e.stack,n))continue;let o=e.compilePattern(n);for(;t=o.exec(r);){let e="before"in n||!!n.atBreak,r="after"in n,o=t.index+(e?t[1].length:0);i.includes(o)?(l[o].before&&!e&&(l[o].before=!1),l[o].after&&!r&&(l[o].after=!1)):(i.push(o),l[o]={before:e,after:r})}}i.sort(ok);let a=n.before?n.before.length:0,c=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];!(e<a)&&!(e>=c)&&(!(e+1<c)||i[s+1]!==e+1||!l[e].after||l[e+1].before||l[e+1].after)&&(i[s-1]!==e-1||!l[e].before||l[e-1].before||l[e-1].after)&&(a!==e&&o.push(oC(r.slice(a,e),"\\")),a=e,!/[!-/:-@[-`{-~]/.test(r.charAt(e))||n.encode&&n.encode.includes(r.charAt(e))?(o.push(i1(r.charCodeAt(e))),a++):o.push("\\"))}return o.push(oC(r.slice(a,c),n.after)),o.join("")}(this,e,t)}function oD(e){let t=this;t.compiler=function(n){var r;let i,o;return r={...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]},!function e(t,n){var r,i,o,l;let s,a=-1;if(n.extensions)for(;++a<n.extensions.length;)e(t,n.extensions[a]);for(s in n)if(iU.call(n,s))switch(s){case"extensions":break;case"unsafe":case"join":r=t[s],(i=n[s])&&r.push(...i);break;case"handlers":o=t[s],(l=n[s])&&Object.assign(o,l);break;default:t.options[s]=n[s]}return t}(i={associationId:oy,containerPhrasing:oO,containerFlow:oE,createTracker:oS,compilePattern:ob,enter:function(e){return i.stack.push(e),function(){i.stack.pop()}},handlers:{...of},handle:void 0,indentLines:ox,indexStack:[],join:[...om],options:{},safe:oN,stack:[],unsafe:[...ov]},r||{}),i.options.tightDefinitions&&i.join.push(oT),i.handle=function(e,t){let n=t||{};function r(t,...n){let i=r.invalid,o=r.handlers;if(t&&iW.call(t,e)){let n=String(t[e]);i=iW.call(o,n)?o[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("type",{invalid:oM,unknown:oA,handlers:i.handlers}),(o=i.handle(n,void 0,i,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0}))&&10!==o.charCodeAt(o.length-1)&&13!==o.charCodeAt(o.length-1)&&(o+="\n"),o}}function oI(e){if(e)throw e}var oL=e.i(2073);function o_(){}function oR(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}class oz extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},o=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(o=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=l?l.line:void 0,this.name=iP(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}oz.prototype.file="",oz.prototype.name="",oz.prototype.reason="",oz.prototype.message="",oz.prototype.stack="",oz.prototype.column=void 0,oz.prototype.line=void 0,oz.prototype.ancestors=void 0,oz.prototype.cause=void 0,oz.prototype.fatal=void 0,oz.prototype.place=void 0,oz.prototype.ruleId=void 0,oz.prototype.source=void 0;let oP=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');oq(e);let r=0,i=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else i<0&&(n=!0,i=o+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let l=-1,s=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(n){r=o+1;break}}else l<0&&(n=!0,l=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(i=o):(s=-1,i=l));return r===i?i=l:i<0&&(i=e.length),e.slice(r,i)},oB=function(e){let t;if(oq(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},oF=function(e){let t;oq(e);let n=e.length,r=-1,i=0,o=-1,l=0;for(;n--;){let s=e.codePointAt(n);if(47===s){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===s?o<0?o=n:1!==l&&(l=1):o>-1&&(l=-1)}return o<0||r<0||0===l||1===l&&o===r-1&&o===i+1?"":e.slice(o,r)},oH=function(...e){var t;let n,r,i,o=-1;for(;++o<e.length;)oq(e[o]),e[o]&&(i=void 0===i?e[o]:i+"/"+e[o]);return void 0===i?".":(oq(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",o=0,l=-1,s=0,a=-1;for(;++a<=e.length;){if(a<e.length)n=e.codePointAt(a);else if(47===n)break;else n=47;if(47===n){if(l===a-1||1===s);else if(l!==a-1&&2===s){if(i.length<2||2!==o||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",o=0):o=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),l=a,s=0;continue}}else if(i.length>0){i="",o=0,l=a,s=0;continue}}t&&(i=i.length>0?i+"/..":"..",o=2)}else i.length>0?i+="/"+e.slice(l+1,a):i=e.slice(l+1,a),o=a-l-1;l=a,s=0}else 46===n&&s>-1?s++:s=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function oq(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function oj(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let oV=["history","path","basename","stem","extname","dirname"];class o${constructor(e){let t,n;t=e?oj(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<oV.length;){const e=oV[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)oV.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?oP(this.path):void 0}set basename(e){oU(e,"basename"),oW(e,"basename"),this.path=oH(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?oB(this.path):void 0}set dirname(e){oG(this.basename,"dirname"),this.path=oH(e||"",this.basename)}get extname(){return"string"==typeof this.path?oF(this.path):void 0}set extname(e){if(oW(e,"extname"),oG(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=oH(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){oj(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!oj(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),oU(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?oP(this.path,this.extname):void 0}set stem(e){oU(e,"stem"),oW(e,"stem"),this.path=oH(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new oz(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function oW(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function oU(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function oG(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let oK=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},oJ={}.hasOwnProperty;class oZ extends oK{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(o,...l){let s=e[++n],a=-1;if(o)return void r(o);for(;++a<t.length;)(null===l[a]||void 0===l[a])&&(l[a]=t[a]);t=l,s?(function(e,t){let n;return function(...t){let o,l=e.length>t.length;l&&t.push(r);try{o=e.apply(this,t)}catch(e){if(l&&n)throw e;return r(e)}l||(o&&o.then&&"function"==typeof o.then?o.then(i,r):o instanceof Error?r(o):i(o))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(s,i)(...l):r(null,...l)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new oZ,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,oL.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(o0("data",this.frozen),this.namespace[e]=t,this):oJ.call(this.namespace,e)&&this.namespace[e]||void 0:e?(o0("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=o5(e),n=this.parser||this.Parser;return oX("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),oX("process",this.parser||this.Parser),oQ("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let o=o5(e),l=n.parse(o);function s(e,n){e||!n?i(e):r?r(n):(o_(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(l,o,function(e,t,r){var i,o;if(e||!t||!r)return s(e);let l=n.stringify(t,r);"string"==typeof(i=l)||(o=i)&&"object"==typeof o&&"byteLength"in o&&"byteOffset"in o?r.value=l:r.result=l,s(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),oX("processSync",this.parser||this.Parser),oQ("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,oI(e),t=r}),o4("processSync","process",n),o_(t,"we either bailed on an error or have a tree"),t}run(e,t,n){o1(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,o){o_("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let l=o5(t);r.run(e,l,function(t,r,l){let s=r||e;t?o(t):i?i(s):(o_(n,"`done` is defined if `resolve` is not"),n(void 0,s,l))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){oI(e),n=t,r=!0}),o4("runSync","run",r),o_(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=o5(t),r=this.compiler||this.Compiler;return oQ("stringify",r),o1(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(o0("use",this.frozen),null==e);else if("function"==typeof e)l(e,t);else if("object"==typeof e)Array.isArray(e)?o(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,oL.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)l(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;l(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function l(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...o]=t,l=n[i][1];oR(l)&&oR(r)&&(r=(0,oL.default)(!0,l,r)),n[i]=[e,r,...o]}}}}let oY=new oZ().freeze();function oX(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function oQ(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function o0(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function o1(e){if(!oR(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function o4(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function o5(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new o$(e)}function o2(e){this.content=e}o2.prototype={constructor:o2,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return -1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new o2(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new o2(n)},addToStart:function(e,t){return new o2([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new o2(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new o2(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=o2.from(e)).size?new o2(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=o2.from(e)).size?new o2(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=o2.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},o2.from=function(e){if(e instanceof o2)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new o2(t)};class o3{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,l=0;l<t;o++){let s=this.content[o],a=l+s.nodeSize;if(a>e&&!1!==n(s,r+l,i||null,o)&&s.content.size){let i=l+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}l=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(l,s)=>{let a=l.isText?l.text.slice(Math.max(e,s)-s,t-s):l.isLeaf?r?"function"==typeof r?r(l):r:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&a||l.isTextblock)&&n&&(o?o=!1:i+=n),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new o3(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],s=o+l.nodeSize;s>e&&((o<e||s>t)&&(l=l.isText?l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),r+=l.nodeSize),o=s}return new o3(n,r)}cutByIndex(e,t){return e==t?o3.empty:0==e&&t==this.content.length?this:new o3(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new o3(r,i)}addToStart(e){return new o3([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new o3(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let o=t.child(i),l=n.child(i);if(o==l){r+=o.nodeSize;continue}if(!o.sameMarkup(l))return r;if(o.isText&&o.text!=l.text){for(let e=0;o.text[e]==l.text[e];e++)r++;return r}if(o.content.size||l.content.size){let t=e(o.content,l.content,r+1);if(null!=t)return t}r+=o.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let o=t.childCount,l=n.childCount;;){if(0==o||0==l)return o==l?null:{a:r,b:i};let s=t.child(--o),a=n.child(--l),c=s.nodeSize;if(s==a){r-=c,i-=c;continue}if(!s.sameMarkup(a))return{a:r,b:i};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(s.content.size||a.content.size){let t=e(s.content,a.content,r-1,i-1);if(t)return t}r-=c,i-=c}}(this,e,t,n)}findIndex(e){if(0==e)return o6(0,e);if(e==this.size)return o6(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return o6(t+1,r);return o6(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return o3.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return o3.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return o3.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new o3(t||e,n)}static from(e){if(!e)return o3.empty;if(e instanceof o3)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new o3([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}o3.empty=new o3([],0);let o7={index:0,offset:0};function o6(e,t){return o7.index=e,o7.offset=t,o7}function o8(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!o8(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!o8(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class o9{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&o8(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return o9.none;if(e instanceof o9)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}o9.none=[];class le extends Error{}class lt{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i,o,l){let{index:s,offset:a}=t.findIndex(n),c=t.maybeChild(s);if(a==n||c.isText)return l&&i<=0&&o<=0&&!l.canReplace(s,s,r)?null:t.cut(0,n).append(r).append(t.cut(n));let u=e(c.content,n-a-1,r,0==s?i-1:0,s==t.childCount-1?o-1:0,c);return u&&t.replaceChild(s,c.copy(u))}(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new lt(n,this.openStart,this.openEnd)}removeBetween(e,t){return new lt(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),l=t.maybeChild(i),{index:s,offset:a}=t.findIndex(r);if(o==n||l.isText){if(a!=r&&!t.child(s).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=s)throw RangeError("Removing non-flat range");return t.replaceChild(i,l.copy(e(l.content,n-o-1,r-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return lt.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new lt(o3.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new lt(e,n,r)}}function ln(e,t){if(!t.type.compatibleContent(e.type))throw new le("Cannot join "+t.type.name+" onto "+e.type.name)}function lr(e,t,n){let r=e.node(n);return ln(r,t.node(n)),r}function li(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function lo(e,t,n,r){let i=(t||e).node(n),o=0,l=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(li(e.nodeAfter,r),o++));for(let e=o;e<l;e++)li(i.child(e),r);t&&t.depth==n&&t.textOffset&&li(t.nodeBefore,r)}function ll(e,t){return e.type.checkContent(t),e.copy(t)}function ls(e,t,n){let r=[];return lo(null,e,n,r),e.depth>n&&li(ll(lr(e,t,n+1),ls(e,t,n+1)),r),lo(t,null,n,r),new o3(r)}lt.empty=new lt(o3.empty,0,0);class la{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return o9.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ld(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),l=i-o;if(n.push(t,e,r+o),!l||(t=t.child(e)).isText)break;i=l-1,r+=o+1}return new la(t,n,i)}static resolveCached(e,t){let n=lh.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else lh.set(e,n=new lc);let r=n.elts[n.i]=la.resolve(e,t);return n.i=(n.i+1)%lu,r}}class lc{constructor(){this.elts=[],this.i=0}}let lu=12,lh=new WeakMap;class ld{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let lp=Object.create(null);class lf{constructor(e,t,n,r=o9.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||o3.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&o8(this.attrs,t||e.defaultAttrs||lp)&&o9.sameSet(this.marks,n||o9.none)}copy(e=null){return e==this.content?this:new lf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new lf(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return lt.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),l=r.start(o);return new lt(r.node(o).content.cut(r.pos-l,i.pos-l),r.depth-o,i.depth-o)}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new le("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new le("Inconsistent open depths");return function e(t,n,r,i){let o=t.index(i),l=t.node(i);if(o==n.index(i)&&i<t.depth-r.openStart){let s=e(t,n,r,i+1);return l.copy(l.content.replaceChild(o,s))}if(!r.content.size)return ll(l,ls(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:o}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(o3.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return ll(l,function e(t,n,r,i,o){let l=t.depth>o&&lr(t,n,o+1),s=i.depth>o&&lr(r,i,o+1),a=[];return lo(null,t,o,a),l&&s&&n.index(o)==r.index(o)?(ln(l,s),li(ll(l,e(t,n,r,i,o+1)),a)):(l&&li(ll(l,ls(t,n,o+1)),a),lo(n,r,o,a),s&&li(ll(s,ls(r,i,o+1)),a)),lo(i,null,o,a),new o3(a)}(t,e,o,n,i))}{let e=t.parent,i=e.content;return ll(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,i,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return la.resolveCached(this,e)}resolveNoCache(e){return la.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),lg(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=o3.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=o9.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!o9.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=o3.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}lf.prototype.text=void 0;class lm extends lf{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):lg(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new lm(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new lm(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function lg(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class lv{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new ly(e,t);if(null==i.next)return lv.empty;let o=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=lb(e),r=n;return e.eat(",")&&(r="}"!=e.next?lb(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next)return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"))return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let l=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let l=e(t.exprs[r],o);if(r==t.exprs.length-1)return l;i(l,o=n())}else if("star"==t.type){let l=n();return r(o,l),i(e(t.expr,l),l),[r(l)]}else if("plus"==t.type){let l=n();return i(e(t.expr,o),l),i(e(t.expr,l),l),[r(l)]}else if("opt"==t.type)return[r(o)].concat(e(t.expr,o));else if("range"==t.type){let l=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,l),r),l=r}if(-1==t.max)i(e(t.expr,l),l);else for(let o=t.min;o<t.max;o++){let o=n();r(l,o),i(e(t.expr,l),o),l=o}return[r(l)]}else if("name"==t.type)return[r(o,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}}(o),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);lx(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new lv(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(lw);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return o}(lx(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:l}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(l)&&r.push(l)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(l,i),l}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,l){let s=o.matchFragment(e,n);if(s&&(!t||s.validEnd))return o3.from(l.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,l.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:l}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!l.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}lv.empty=new lv(!0);class ly{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function lb(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function lw(e,t){return t-e}function lx(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(lw)}function lk(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function lC(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function lS(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function lM(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new lT(e,r,t[r]);return n}class lA{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=lM(e,n.attrs),this.defaultAttrs=lk(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==lv.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:lC(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new lf(this,this.computeAttrs(e),o3.from(t),o9.setFrom(n))}createChecked(e=null,t,n){return t=o3.from(t),this.checkContent(t),new lf(this,this.computeAttrs(e),t,o9.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=o3.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(o3.empty,!0);return i?new lf(this,e,t.append(i),o9.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){lS(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:o9.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new lA(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class lT{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class lO{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=lM(e,r.attrs),this.excluded=null;let i=lk(this.attrs);this.instance=i?new o9(this,i):null}create(e=null){return!e&&this.instance?this.instance:new o9(this,lC(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new lO(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){lS(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class lE{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=o2.from(e.nodes),t.marks=o2.from(e.marks||{}),this.nodes=lA.compile(this.spec.nodes,this),this.marks=lO.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=lv.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?lN(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:lN(this,n.split(" "))}this.nodeFromJSON=e=>lf.fromJSON(this,e),this.markFromJSON=e=>o9.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof lA){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new lm(n,n.defaultAttrs,e,o9.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function lN(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],l=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(l=r)}if(!l)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class lD{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new lP(this,t,!1);return n.addAll(e,o9.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new lP(this,t,!0);return n.addAll(e,o9.none,t.from,t.to),lt.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=lB(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=lB(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new lD(e,lD.schemaRules(e)))}}let lI={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},lL={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},l_={ol:!0,ul:!0};function lR(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class lz{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=o9.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(o3.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=o3.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(o3.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!lI.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class lP{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,o=lR(null,t.preserveWhitespace,0)|4*!!n;i=r?new lz(r.type,r.attrs,o9.none,!0,t.topMatch||r.type.contentMatch,o):n?new lz(null,null,o9.none,!0,null,o):new lz(e.schema.topNodeType,null,o9.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:o}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;l_.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&l_.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,n));e:if(s?s.ignore:lL.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(lI.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let l=s&&s.skip?t:this.readStyles(e,t);l&&this.addAll(e,l),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,!1===s.consuming?l:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,o;if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,l=null==r?null:e.childNodes[r];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let l=this.nodes[t],s=l.findWrapping(e);if(s&&(!r||r.length>s.length+o)&&(r=s,i=l,!s.length))break;if(l.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=o9.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):lF(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=lR(e,i,o.options);4&o.options&&0==o.content.length&&(l|=4);let s=o9.none;return n=n.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!lF(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new lz(e,t,s,r,null,l)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(e,l)=>{for(;e>=0;e--){let s=t[e];if(""==s){if(e==t.length-1||0==e)continue;for(;l>=i;l--)if(o(e-1,l))return!0;return!1}{let e=l>0||0==l&&r?this.nodes[l].type:n&&l>=i?n.node(l-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function lB(e){let t={};for(let n in e)t[n]=e[n];return t}function lF(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],l=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&l(i))return!0}};if(l(i.contentMatch))return!0}}class lH{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=lj(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],l=this.serializeMark(n,e.isInline,t);l&&(i.push([n,r]),r.appendChild(l.dom),r=l.contentDOM||l.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return lj(t).createTextNode(e.text);let{dom:n,contentDOM:r}=l$(lj(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&l$(lj(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:l$(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new lH(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=lq(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return lq(e.marks)}}function lq(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function lj(e){return e.document||window.document}let lV=new WeakMap;function l$(e,t,n,r){let i,o,l;if(3==t.nodeType)return{dom:t};if(t.dom&&3==t.dom.nodeType)return t;let s=t[0],a;if("string"!=typeof s)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=lV.get(r))&&lV.set(r,(l=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])l||(l=[]),l.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),o=l)),a=o)&&a.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=s.indexOf(" ");c>0&&(n=s.slice(0,c),s=s.slice(c+1));let u=n?e.createElementNS(n,s):e.createElement(s),h=t[1],d=1;if(h&&"object"==typeof h&&null==h.nodeType&&!Array.isArray(h)){for(let e in d=2,h)if(null!=h[e]){let t=e.indexOf(" ");t>0?u.setAttributeNS(e.slice(0,t),e.slice(t+1),h[e]):"style"==e&&u.style?u.style.cssText=h[e]:u.setAttribute(e,h[e])}}for(let o=d;o<t.length;o++){let l=t[o];if(0===l){if(o<t.length-1||o>d)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}if("string"==typeof l)u.appendChild(e.createTextNode(l));else{let{dom:t,contentDOM:o}=l$(e,l,n,r);if(u.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:u,contentDOM:i}}class lW{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class lU{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&lU.empty)return lU.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let s=this.ranges[l]-(this.inverted?r:0);if(s>e)break;let a=this.ranges[l+i],c=this.ranges[l+o],u=s+a;if(e<=u){let i=a?e==s?-1:e==u?1:t:t,o=s+r+(i<0?0:c);if(n)return o;let h=e==(t<0?s:u)?null:l/3+(e-s)*65536,d=e==s?2:e==u?1:4;return(t<0?e!=s:e!=u)&&(d|=8),new lW(o,d,h)}r+=c-a}return n?e+r:new lW(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let l=this.ranges[t]-(this.inverted?n:0);if(l>e)break;let s=this.ranges[t+i];if(e<=l+s&&t==3*r)return!0;n+=this.ranges[t+o]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],l=o-(this.inverted?i:0),s=o+(this.inverted?0:i),a=this.ranges[r+t],c=this.ranges[r+n];e(l,l+a,s,s+c),i+=c-a}}invert(){return new lU(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?lU.empty:new lU(e<0?[0,-e,0]:[0,0,e])}}lU.empty=new lU([]);class lG{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new lG(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new lG;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new lW(e,r,null)}}let lK=Object.create(null);class lJ{getMap(){return lU.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=lK[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in lK)throw RangeError("Duplicate use of step JSON ID "+e);return lK[e]=t,t.prototype.jsonID=e,t}}class lZ{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new lZ(e,null)}static fail(e){return new lZ(null,e)}static fromReplace(e,t,n,r){try{return lZ.ok(e.replace(t,n,r))}catch(e){if(e instanceof le)return lZ.fail(e.message);throw e}}}function lY(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(lY(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return o3.fromArray(r)}class lX extends lJ{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new lt(lY(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return lZ.fromReplace(e,this.from,this.to,i)}invert(){return new lQ(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new lX(t.pos,n.pos,this.mark)}merge(e){return e instanceof lX&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new lX(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new lX(t.from,t.to,e.markFromJSON(t.mark))}}lJ.jsonID("addMark",lX);class lQ extends lJ{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new lt(lY(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return lZ.fromReplace(e,this.from,this.to,n)}invert(){return new lX(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new lQ(t.pos,n.pos,this.mark)}merge(e){return e instanceof lQ&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new lQ(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new lQ(t.from,t.to,e.markFromJSON(t.mark))}}lJ.jsonID("removeMark",lQ);class l0 extends lJ{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return lZ.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return lZ.fromReplace(e,this.pos,this.pos+1,new lt(o3.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new l0(this.pos,t.marks[n]);return new l0(this.pos,this.mark)}}return new l1(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new l0(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new l0(t.pos,e.markFromJSON(t.mark))}}lJ.jsonID("addNodeMark",l0);class l1 extends lJ{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return lZ.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return lZ.fromReplace(e,this.pos,this.pos+1,new lt(o3.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new l0(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new l1(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new l1(t.pos,e.markFromJSON(t.mark))}}lJ.jsonID("removeNodeMark",l1);class l4 extends lJ{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&l2(e,this.from,this.to)?lZ.fail("Structure replace would overwrite content"):lZ.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new lU([this.from,this.to-this.from,this.slice.size])}invert(e){return new l4(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&l4.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new l4(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof l4)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?lt.empty:new lt(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new l4(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?lt.empty:new lt(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new l4(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new l4(t.from,t.to,lt.fromJSON(e,t.slice),!!t.structure)}}l4.MAP_BIAS=1,lJ.jsonID("replace",l4);class l5 extends lJ{constructor(e,t,n,r,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(l2(e,this.from,this.gapFrom)||l2(e,this.gapTo,this.to)))return lZ.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return lZ.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?lZ.fromReplace(e,this.from,this.to,n):lZ.fail("Content does not fit in gap")}getMap(){return new lU([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new l5(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new l5(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new l5(t.from,t.to,t.gapFrom,t.gapTo,lt.fromJSON(e,t.slice),t.insert,!!t.structure)}}function l2(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function l3(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),l=[],s=t+1;for(let t=0;t<o.childCount;t++){let a=o.child(t),c=s+a.nodeSize,u=r.matchType(a.type);if(u){r=u;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new lQ(s,c,a.marks[t]));if(i&&a.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(a.text);)r||(r=new lt(o3.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),l.push(new l4(s+e.index,s+e.index+e[0].length,r))}}else l.push(new l4(s,c,lt.empty));s=c}if(!r.validEnd){let t=r.fillBefore(o3.empty,!0);e.replace(s,s,new lt(t,0,0))}for(let t=l.length-1;t>=0;t--)e.step(l[t])}function l7(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),l=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(l,s,t))return n;if(0==n||o.type.spec.isolating||!((0==l||o.canReplace(l,o.childCount))&&(s==o.childCount||o.canReplace(0,s))))break;l&&(r=1),s<o.childCount&&(i=1)}return null}function l6(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let l=o.length?o[0]:t;return n.canReplaceWith(r,i,l)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),l=t.contentMatch.findWrapping(o.type);if(!l)return null;let s=(l.length?l[l.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return s&&s.validEnd?l:null}(r,t);return o?i.map(l8).concat({type:t,attrs:n}).concat(o.map(l8)):null}function l8(e){return{type:e,attrs:null}}function l9(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let l,s=/\r?\n|\r/g;for(;l=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+l.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function se(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function st(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,l=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!l.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let l=n.content.cutByIndex(o,n.childCount),s=r&&r[t+1];s&&(l=l.replaceChild(0,s.type.create(s.attrs)));let a=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!a.type.validContent(l))return!1}let s=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(s,s,a?a.type:i.node(o+1).type)}function sn(e,t){var n,r;let i=e.resolve(t),o=i.index();return n=i.nodeBefore,r=i.nodeAfter,!!(n&&r&&!n.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),l=o.type==r?e.type.schema.nodes.text:o.type;if(!(n=n.matchType(l))||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(n,r))&&i.parent.canReplace(o,o+1)}function sr(e,t,n=t,r=lt.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return si(i,o,r)?new l4(t,n,r):new so(i,o,r).fit()}function si(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}lJ.jsonID("replaceAround",l5);class so{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=o3.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=o3.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,l=r.depth;for(;o&&l&&1==i.childCount;)i=i.firstChild.content,o--,l--;let s=new lt(i,o,l);return e>-1?new l5(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new l4(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=sa(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:o,match:l}=this.frontier[i],s,a=null;if(1==t&&(r?l.matchType(r.type)||(a=l.fillBefore(o3.from(r),!1)):e&&o.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:a};if(2==t&&r&&(s=l.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:s};if(e&&l.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=sa(e,t);return!!r.childCount&&!r.firstChild.isLeaf&&(this.unplaced=new lt(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=sa(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new lt(sl(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new lt(sl(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,l=n?n.content:o.content,s=o.openStart-e,a=0,c=[],{match:u,type:h}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let d=l.size+e-(o.content.size-o.openEnd);for(;a<l.childCount;){let e=l.child(a),t=u.matchType(e.type);if(!t)break;(++a>1||0==s||e.content.size)&&(u=t,c.push(function e(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,e(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(o3.empty,!0)))),t.copy(i)}(e.mark(h.allowedMarks(e.marks)),1==a?s:0,a==l.childCount?d:-1)))}let p=a==l.childCount;p||(d=-1),this.placed=ss(this.placed,t,o3.from(c)),this.frontier[t].match=u,p&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e<d;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?0==e?lt.empty:new lt(sl(o.content,e-1,1),e-1,d<0?o.openEnd:e-1):new lt(sl(o.content,e,a),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!sc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=sc(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=sc(e,n,r,t,!0);if(!i||i.childCount)continue t}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=ss(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=ss(this.placed,this.depth,o3.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(o3.empty,!0);e.childCount&&(this.placed=ss(this.placed,this.frontier.length,e))}}function sl(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(sl(e.firstChild.content,t-1,n)))}function ss(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(ss(e.lastChild.content,t-1,n)))}function sa(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function sc(e,t,n,r,i){let o=e.node(t),l=i?e.indexAfter(t):e.index(t);if(l==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,l);return s&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,l)?s:null}function su(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class sh extends lJ{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return lZ.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return lZ.fromReplace(e,this.pos,this.pos+1,new lt(o3.from(r),0,+!t.isLeaf))}getMap(){return lU.empty}invert(e){return new sh(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new sh(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new sh(t.pos,t.attr,t.value)}}lJ.jsonID("attr",sh);class sd extends lJ{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return lZ.ok(n)}getMap(){return lU.empty}invert(e){return new sd(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new sd(t.attr,t.value)}}lJ.jsonID("docAttr",sd);let sp=class extends Error{};(sp=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),sp.prototype.constructor=sp,sp.prototype.name="TransformError";class sf{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new lG}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new sp(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=lt.empty){let r=sr(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new lt(o3.from(n),0,0))}delete(e,t){return this.replace(e,t,lt.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(si(i,o,r))return e.step(new l4(t,n,r));let l=su(i,o);0==l[l.length-1]&&l.pop();let s=-(i.depth+1);l.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?s=e:i.before(e)==t&&l.splice(1,0,-e)}let a=l.indexOf(s),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){var h;let t=c[e],n=(h=t.type).spec.defining||h.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),h=c[s];if(h)for(let t=0;t<l.length;t++){let c=l[(t+a)%l.length],u=!0;c<0&&(u=!1,c=-c);let d=i.node(c-1),p=i.index(c-1);if(d.canReplaceWith(p,p,h.type,h.marks))return e.replace(i.before(c),u?o.after(c):n,new lt(function e(t,n,r,i,o){if(n<r){let o=t.firstChild;t=t.replaceChild(0,o.copy(e(o.content,n+1,r,i,o)))}if(n>i){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(o3.empty,!0))}return t}(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=l.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=l[s];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var r=e,i=t;if(!n.isInline&&r==i&&this.doc.resolve(r).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break}return null}(this.doc,r,n.type);null!=e&&(r=i=e)}return this.replaceRange(r,i,new lt(o3.from(n),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&0==r.parentOffset&&0==i.parentOffset){let o=r.sharedDepth(n),l=!1;for(let e=r.depth;e>o;e--)r.node(e).type.spec.isolating&&(l=!0);for(let e=i.depth;e>o;e--)i.node(e).type.spec.isolating&&(l=!0);if(!l){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let o=su(r,i);for(let t=0;t<o.length;t++){let n=o[t],l=t==o.length-1;if(l&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(l||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:r,$to:i,depth:o}=t,l=r.before(o+1),s=i.after(o+1),a=l,c=s,u=o3.empty,h=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=o3.from(r.node(e).copy(u)),h++):a--;let d=o3.empty,p=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,d=o3.from(i.node(e).copy(d)),p++):c++;e.step(new l5(a,c,l,s,new lt(u.append(d),h,p),u.size-h,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),l=o.node().type;if(i&&l.inlineContent){let e="pre"==l.whitespace,t=!!l.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);se(e,r.node(),r.before(),s)}l.inlineContent&&l3(e,t+n-1,l,o.node().contentMatchAt(o.index()),null==r);let a=e.mapping.slice(s),c=a.map(t-n);if(e.step(new l4(c,a.map(t+n,-1),lt.empty,!0)),!0===r){let t=e.doc.resolve(c);l9(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let r=o3.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=o3.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new l5(i,o,i,o,new lt(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){var i=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var l,s,a;let c,u,h="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,h)&&(l=i.doc,s=i.mapping.slice(o).map(t),a=n,u=(c=l.resolve(s)).index(),c.parent.canReplaceWith(u,u+1,a))){let r=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&se(i,e,t,o),l3(i,i.mapping.slice(o).map(t,1),n,void 0,null===r);let l=i.mapping.slice(o),s=l.map(t,1),a=l.map(t+e.nodeSize,1);return i.step(new l5(s,a,s+1,a-1,new lt(o3.from(n.create(h,null,e.marks)),0,0),1,!0)),!0===r&&l9(i,e,t,o),!1}}),this}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw RangeError("No node at given position");n||(n=o.type);let l=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,l);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);e.step(new l5(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new lt(o3.from(l),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new sh(e,t,n)),this}setDocAttribute(e,t){return this.step(new sd(e,t)),this}addNodeMark(e,t){return this.step(new l0(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof o9)t.isInSet(n.marks)&&this.step(new l1(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new l1(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return!function(e,t,n=1,r){let i=e.doc.resolve(t),o=o3.empty,l=o3.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){o=o3.from(i.node(e).copy(o));let t=r&&r[s];l=o3.from(t?t.type.create(t.attrs,l):i.node(e).copy(l))}e.step(new l4(t,t,new lt(o.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let i,o,l,s;return r=this,l=[],s=[],r.doc.nodesBetween(e,t,(r,a,c)=>{if(!r.isInline)return;let u=r.marks;if(!n.isInSet(u)&&c.type.allowsMarkType(n.type)){let c=Math.max(a,e),h=Math.min(a+r.nodeSize,t),d=n.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(d)||(i&&i.to==c&&i.mark.eq(u[e])?i.to=h:l.push(i=new lQ(c,h,u[e])));o&&o.to==c?o.to=h:s.push(o=new lX(c,h,n))}}),l.forEach(e=>r.step(e)),s.forEach(e=>r.step(e)),this}removeMark(e,t,n){var r;let i,o;return r=this,i=[],o=0,r.doc.nodesBetween(e,t,(r,l)=>{if(!r.isInline)return;o++;let s=null;if(n instanceof lO){let e=r.marks,t;for(;t=n.isInSet(e);)(s||(s=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(r.marks)&&(s=[n]):s=r.marks;if(s&&s.length){let n=Math.min(l+r.nodeSize,t);for(let t=0;t<s.length;t++){let r=s[t],a;for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&r.eq(i[e].style)&&(a=t)}a?(a.to=n,a.step=o):i.push({style:r,from:Math.max(l,e),to:n,step:o})}}}),i.forEach(e=>r.step(new lQ(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return l3(this,e,t,n),this}}let sm=Object.create(null);class sg{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new sv(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=lt.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:s,$to:a}=o[l],c=e.mapping.slice(i);e.replaceRange(c.map(s.pos),c.map(a.pos),l?lt.empty:t),0==l&&sT(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:l}=r[i],s=e.mapping.slice(n),a=s.map(o.pos),c=s.map(l.pos);i?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),sT(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new sw(e):sA(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?sA(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):sA(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new sS(e.node(0))}static atStart(e){return sA(e,e,0,0,1)||new sS(e)}static atEnd(e){return sA(e,e,e.content.size,e.childCount,-1)||new sS(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=sm[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in sm)throw RangeError("Duplicate use of selection JSON ID "+e);return sm[e]=t,t.prototype.jsonID=e,t}getBookmark(){return sw.between(this.$anchor,this.$head).getBookmark()}}sg.prototype.visible=!0;class sv{constructor(e,t){this.$from=e,this.$to=t}}let sy=!1;function sb(e){sy||e.parent.inlineContent||(sy=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class sw extends sg{constructor(e,t=e){sb(e),sb(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return sg.near(n);let r=e.resolve(t.map(this.anchor));return new sw(r.parent.inlineContent?r:n,n)}replace(e,t=lt.empty){if(super.replace(e,t),t==lt.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof sw&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sx(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new sw(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=sg.findFrom(t,n,!0)||sg.findFrom(t,-n,!0);if(!e)return sg.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(sg.findFrom(e,-n,!0)||sg.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new sw(e,t)}}sg.jsonID("text",sw);class sx{constructor(e,t){this.anchor=e,this.head=t}map(e){return new sx(e.map(this.anchor),e.map(this.head))}resolve(e){return sw.between(e.resolve(this.anchor),e.resolve(this.head))}}class sk extends sg{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?sg.near(i):new sk(i)}content(){return new lt(o3.from(this.node),0,0)}eq(e){return e instanceof sk&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new sC(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new sk(e.resolve(t.anchor))}static create(e,t){return new sk(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}sk.prototype.visible=!1,sg.jsonID("node",sk);class sC{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new sx(n,n):new sC(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&sk.isSelectable(n)?new sk(t):sg.near(t)}}class sS extends sg{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=lt.empty){if(t==lt.empty){e.delete(0,e.doc.content.size);let t=sg.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new sS(e)}map(e){return new sS(e)}eq(e){return e instanceof sS}getBookmark(){return sM}}sg.jsonID("all",sS);let sM={map(){return this},resolve:e=>new sS(e)};function sA(e,t,n,r,i,o=!1){if(t.inlineContent)return sw.create(e,n);for(let l=r-(i>0?0:1);i>0?l<t.childCount:l>=0;l+=i){let r=t.child(l);if(r.isAtom){if(!o&&sk.isSelectable(r))return sk.create(e,n-(i<0?r.nodeSize:0))}else{let t=sA(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function sT(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof l4||o instanceof l5)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(sg.near(e.doc.resolve(r),n)))}class sO extends sf{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return o9.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||o9.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(sg.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function sE(e,t){return t&&e?e.bind(t):e}class sN{constructor(e,t,n){this.name=e,this.init=sE(t.init,n),this.apply=sE(t.apply,n)}}let sD=[new sN("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new sN("selection",{init:(e,t)=>e.selection||sg.atStart(t.doc),apply:e=>e.selection}),new sN("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new sN("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class sI{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sD.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new sN(e.key,e.spec.state,e))})}}class sL{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let s=r?r[o].n:0,a=r?r[o].state:this,c=s<t.length&&l.spec.appendTransaction.call(l,s?t.slice(s):t,a,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new sL(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new sO(this)}static create(e){let t=new sI(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new sL(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new sI(this.schema,e.plugins),n=t.fields,r=new sL(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new sI(e.schema,e.plugins),i=new sL(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=lf.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=sg.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let l=n[o],s=l.spec.state;if(l.key==r.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){i[r.name]=s.fromJSON.call(l,e,t[o],i);return}}i[r.name]=r.init(e,i)}}),i}}class s_{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:sz("plugin")}getState(e){return e[this.key]}}let sR=Object.create(null);function sz(e){return e in sR?e+"$"+ ++sR[e]:(sR[e]=0,e+"$")}class sP{constructor(e="key"){this.key=sz(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}let sB=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function sF(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let sH=(e,t,n)=>{let r=sF(e,n);if(!r)return!1;let i=s$(r);if(!i){let n=r.blockRange(),i=n&&l7(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(sK(e,i,t,-1))return!0;if(0==r.parent.content.size&&(sj(o,"end")||sk.isSelectable(o)))for(let n=r.depth;;n--){let l=sr(e.doc,r.before(n),r.after(n),lt.empty);if(l&&l.slice.size<l.to-l.from){if(t){let n=e.tr.step(l);n.setSelection(sj(o,"end")?sg.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):sk.create(n.doc,i.pos-o.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)},sq=(e,t,n)=>{let r=sF(e,n);if(!r)return!1;let i=s$(r);return!!i&&function(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let o=t.nodeAfter,l=t.pos+1;for(;!o.isTextblock;l++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let s=sr(e.doc,i,l,lt.empty);if(!s||s.from!=i||s instanceof l4&&s.slice.size>=l-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(sw.create(t.doc,i)),n(t.scrollIntoView())}return!0}(e,i,t)};function sj(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let sV=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=s$(r)}let l=o&&o.nodeBefore;return!!l&&!!sk.isSelectable(l)&&(t&&t(e.tr.setSelection(sk.create(e.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function s$(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 sW(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 sU(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 sG=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),l=sU(i.contentMatchAt(o));if(!l||!i.canReplaceWith(o,o,l))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,l.createAndFill());i.setSelection(sg.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0};function sK(e,t,n,r){let i,o,l,s=t.nodeBefore,a=t.nodeAfter,c,u,h=s.type.spec.isolating||a.type.spec.isolating;if(!h&&(i=t.nodeBefore,o=t.nodeAfter,l=t.index(),i&&o&&i.type.compatibleContent(o.type)&&(!i.content.size&&t.parent.canReplace(l-1,l)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(l,l+1)&&!!(o.isTextblock||sn(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let d=!h&&t.parent.canReplace(t.index(),t.index()+1);if(d&&(c=(u=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&u.matchType(c[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,i=o3.empty;for(let e=c.length-1;e>=0;e--)i=o3.from(c[e].create(null,i));i=o3.from(s.copy(i));let o=e.tr.step(new l5(t.pos-1,r,t.pos,r,new lt(i,1,0),c.length,!0)),l=o.doc.resolve(r+2*c.length);l.nodeAfter&&l.nodeAfter.type==s.type&&sn(o.doc,l.pos)&&o.join(l.pos),n(o.scrollIntoView())}return!0}let p=a.type.spec.isolating||r>0&&h?null:sg.findFrom(t,1),f=p&&p.$from.blockRange(p.$to),m=f&&l7(f);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(f,m).scrollIntoView()),!0;if(d&&sj(a,"start",!0)&&sj(s,"end")){let r=s,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=a,l=1;for(;!o.isTextblock;o=o.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=o3.empty;for(let e=i.length-1;e>=0;e--)r=o3.from(i[e].copy(r));n(e.tr.step(new l5(t.pos-i.length,t.pos+a.nodeSize,t.pos+l,t.pos+a.nodeSize-l,new lt(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function sJ(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(sw.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let sZ=sJ(-1),sY=sJ(1);function sX(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,l=i.blockRange(o),s=l&&l6(l,e,t);return!!s&&(r&&r(n.tr.wrap(l,s).scrollIntoView()),!0)}}function sQ(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[r];n.doc.nodesBetween(o,l,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[r];i.setBlockType(o,l,e,t)}r(i.scrollIntoView())}return!0}}function s0(e,t=null,n){let r=!1!==(n&&n.removeWhenPresent),i=!1!==(n&&n.enterInlineAtoms),o=!(n&&n.includeWhitespace);return function(n,l){let{empty:s,$cursor:a,ranges:c}=n.selection;if(s&&!a||!function(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:o,$to:l}=t[i],s=0==o.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(o.pos,l.pos,(e,t)=>{if(s||!r&&e.isAtom&&e.isInline&&t>=o.pos&&t+e.nodeSize<=l.pos)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)}),s)return!0}return!1}(n.doc,c,e,i))return!1;if(l)if(a)l(e.isInSet(n.storedMarks||a.marks())?n.tr.removeStoredMark(e):n.tr.addStoredMark(e.create(t)));else{let s,a=n.tr;i||(c=function(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:i}=e[n];r.doc.nodesBetween(r.pos,i.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new sv(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1}),r.pos<i.pos&&t.push(new sv(r,i))}return t}(c)),s=r?!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,(r,i,o)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!o&&o.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))))}),!n});for(let n=0;n<c.length;n++){let{$from:r,$to:i}=c[n];if(s){let n=r.pos,l=i.pos,s=r.nodeAfter,c=i.nodeBefore,u=o&&s&&s.isText?/^\s*/.exec(s.text)[0].length:0,h=o&&c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+u<l&&(n+=u,l-=h),a.addMark(n,l,e.create(t))}else a.removeMark(r.pos,i.pos,e)}l(a.scrollIntoView())}return!0}}function s1(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let s4=s1(sB,sH,sV),s5=s1(sB,(e,t,n)=>{let r=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(!r)return!1;let i=sW(r);if(!i)return!1;let o=i.nodeAfter;if(sK(e,i,t,1))return!0;if(0==r.parent.content.size&&(sj(o,"start")||sk.isSelectable(o))){let n=sr(e.doc,r.before(),r.after(),lt.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(sj(o,"start")?sg.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):sk.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=sW(r)}let l=o&&o.nodeAfter;return!!l&&!!sk.isSelectable(l)&&(t&&t(e.tr.setSelection(sk.create(e.doc,o.pos)).scrollIntoView()),!0)}),s2={Enter:s1((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)},(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof sS||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=sU(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(n,o.createAndFill());l.setSelection(sw.create(l.doc,n+1)),t(l.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 r=n.before();if(st(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&l7(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof sk&&e.selection.node.isBlock)return!!n.parentOffset&&!!st(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i=[],o,l,s=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;s=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),l=sU(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));i.unshift(t||(s&&l?{type:l}:null)),o=e;break}if(1==e)return!1;i.unshift(null)}let c=e.tr;(e.selection instanceof sw||e.selection instanceof sS)&&c.deleteSelection();let u=c.mapping.map(n.pos),h=st(c.doc,u,i.length,i);if(h||(i[0]=l?{type:l}:null,h=st(c.doc,u,i.length,i)),!h)return!1;if(c.split(u,i.length,i),!s&&a&&n.node(o).type!=l){let e=c.mapping.map(n.before(o)),t=c.doc.resolve(e);l&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,l)&&c.setNodeMarkup(c.mapping.map(n.before(o)),l)}return t&&t(c.scrollIntoView()),!0}),"Mod-Enter":sG,Backspace:s4,"Mod-Backspace":s4,"Shift-Backspace":s4,Delete:s5,"Mod-Delete":s5,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new sS(e.doc))),!0)},s3={"Ctrl-h":s2.Backspace,"Alt-Backspace":s2["Mod-Backspace"],"Ctrl-d":s2.Delete,"Ctrl-Alt-Backspace":s2["Mod-Delete"],"Alt-Delete":s2["Mod-Delete"],"Alt-d":s2["Mod-Delete"],"Ctrl-a":sZ,"Ctrl-e":sY};for(let e in s2)s3[e]=s2[e];let s7=("u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&!!os.platform&&"darwin"==os.platform())?s3:s2;class s6{constructor(e,t,n={}){this.match=e,this.match=e,this.handler="string"==typeof t?function(e){return function(t,n,r,i){let o=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);o+=n[0].slice(e+n[1].length);let t=(r+=e)-i;t>0&&(o=n[0].slice(e-t,e)+o,r=i)}return t.tr.insertText(o,r,i)}}(t):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1,this.inCodeMark=!1!==n.inCodeMark}}let s8=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){let n=e.tr,r=o.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(o.text){let t=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,e.schema.text(o.text,t))}else n.delete(o.from,o.to);t(n)}return!0}}return!1};function s9(e,t,n=null,r){return new s6(e,(e,i,o,l)=>{let s=n instanceof Function?n(i):n,a=e.tr.delete(o,l),c=a.doc.resolve(o).blockRange(),u=c&&l6(c,t,s);if(!u)return null;a.wrap(c,u);let h=a.doc.resolve(o-1).nodeBefore;return h&&h.type==t&&sn(a.doc,o-1)&&(!r||r(i,h))&&a.join(o-1),a})}function ae(e,t,n=null){return new s6(e,(e,r,i,o)=>{let l=e.doc.resolve(i),s=n instanceof Function?n(r):n;return l.node(-1).canReplaceWith(l.index(-1),l.indexAfter(-1),t)?e.tr.delete(i,o).setBlockType(i,i,t,s):null})}new s6(/--$/,"—",{inCodeMark:!1}),new s6(/\.\.\.$/,"…",{inCodeMark:!1}),new s6(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new s6(/"$/,"”",{inCodeMark:!1}),new s6(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new s6(/'$/,"’",{inCodeMark:!1});let at="u">typeof navigator?navigator:null,an="u">typeof document?document:null,ar=at&&at.userAgent||"",ai=/Edge\/(\d+)/.exec(ar),ao=/MSIE \d/.exec(ar),al=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ar),as=!!(ao||al||ai),aa=ao?document.documentMode:al?+al[1]:ai?+ai[1]:0,ac=!as&&/gecko\/(\d+)/i.test(ar),au=ac&&+(/Firefox\/(\d+)/.exec(ar)||[0,0])[1],ah=!as&&/Chrome\/(\d+)/.exec(ar),ad=!!ah,ap=ah?+ah[1]:0,af=!as&&!!at&&/Apple Computer/.test(at.vendor),am=af&&(/Mobile\/\w+/.test(ar)||!!at&&at.maxTouchPoints>2),ag=am||!!at&&/Mac/.test(at.platform),av=/Android \d/.test(ar),ay=!!an&&"webkitFontSmoothing"in an.documentElement.style,ab=ay?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var aw=Object.freeze({__proto__:null,android:av,chrome:ad,chrome_version:ap,gecko:ac,gecko_version:au,ie:as,ie_version:aa,ios:am,mac:ag,safari:af,webkit:ay,webkit_version:ab});function ax(e,t,n,r,i,o){if(e.composing)return!1;let l=e.state,s=l.doc.resolve(t);if(s.parent.type.spec.code)return!1;let a=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,void 0,"")+r;for(let s of i){let i=s.match.exec(a),c=i&&i[0]&&s.handler(l,i,t-(i[0].length-r.length),n);if(c)return!1!==s.undoable&&c.setMeta(o,{transform:c,from:t,to:n,text:r}),e.dispatch(c),!0}return!1}let ak=new sP("MILKDOWN_CUSTOM_INPUTRULES");function aC(e,t,n={}){return new s6(e,(e,r,i,o)=>{var l,s,a,c;let u,{tr:h}=e,d=r.length,p=r[d-1],f=r[0],m=[],g={group:p,fullMatch:f,start:i,end:o},y=null==(l=n.updateCaptured)?void 0:l.call(n,g);if(Object.assign(g,y),{group:p,fullMatch:f,start:i,end:o}=g,null===f||(null==p?void 0:p.trim())==="")return null;if(p){let e=f.search(/\S/),l=i+f.indexOf(p),d=l+p.length;m=null!=(s=h.storedMarks)?s:[],d<o&&h.delete(d,o),l>i&&h.delete(i+e,l),u=i+e+p.length;let g=null==(a=n.getAttr)?void 0:a.call(n,r);h.addMark(i,u,t.create(g)),h.setStoredMarks(m),null==(c=n.beforeDispatch)||c.call(n,{match:r,start:i,end:o,tr:h})}return h})}var aS=Object.defineProperty,aM=Object.defineProperties,aA=Object.getOwnPropertyDescriptors,aT=Object.getOwnPropertySymbols,aO=Object.prototype.hasOwnProperty,aE=Object.prototype.propertyIsEnumerable,aN=(e,t,n)=>t in e?aS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function aD(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function aI(e,t,n){let r=e.state.doc.content.size,i=aD(t,0,r),o=aD(n,0,r),l=e.coordsAtPos(i),s=e.coordsAtPos(o,-1),a=Math.min(l.top,s.top),c=Math.max(l.bottom,s.bottom),u=Math.min(l.left,s.left),h=Math.max(l.right,s.right),d={top:a,bottom:c,left:u,right:h,width:h-u,height:c-a,x:u,y:a};return aM(((e,t)=>{for(var n in t||(t={}))aO.call(t,n)&&aN(e,n,t[n]);if(aT)for(var n of aT(t))aE.call(t,n)&&aN(e,n,t[n]);return e})({},d),aA({toJSON:()=>d}))}function aL(e){return Object.assign(Object.create(e),e).setTime(Date.now())}function a_(e){return t=>{for(let n=t.depth;n>0;n-=1){let r=t.node(n);if(e(r))return{from:t.before(n),to:t.after(n),node:r}}}}function aR(e){return t=>{for(let n=t.depth;n>0;n--){let r=t.node(n);if(e(r))return{pos:t.before(n),start:t.start(n),depth:n,node:r}}}}let az=(e,t)=>{let{selection:n,doc:r}=e;if(n instanceof sk)return{hasNode:n.node.type===t,pos:n.from,target:n.node};let{from:i,to:o}=n,l=!1,s=-1,a=null;return r.nodesBetween(i,o,(e,n)=>!a&&(e.type!==t||(l=!0,s=n,a=e,!1))),{hasNode:l,pos:s,target:a}};var aP=e.i(31989);let aB="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),aF="u">typeof navigator&&/Win/.test(navigator.platform);function aH(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 aq(e){return new s_({props:{handleKeyDown:aj(e)}})}function aj(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),l=o[o.length-1];"Space"==l&&(l=" ");for(let e=0;e<o.length-1;e++){let l=o[e];if(/^(cmd|meta|m)$/i.test(l))i=!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))r=!0;else if(/^mod$/i.test(l))aB?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+l)}return t&&(l="Alt-"+l),n&&(l="Ctrl-"+l),i&&(l="Meta-"+l),r&&(l="Shift-"+l),l}(n)]=e[n];return t}(e);return function(e,n){let r=(0,aP.keyName)(n),i,o=t[aH(r,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==r.length&&" "!=r){if(n.shiftKey){let i=t[aH(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(aF&&n.ctrlKey&&n.altKey)&&(i=aP.base[n.keyCode])&&i!=r){let r=t[aH(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var aV=class{},a$=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 ro();return e}}},aW=class e extends aV{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,r){return new e(t,n,r)}},aU=class extends a${#b;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(t,e),n.toDoc())}}constructor(e){super(),this.#b=o9.none,this.#w=e=>e.isText,this.#x=(e,t)=>{if(this.#w(e)&&this.#w(t)&&o9.sameSet(e.marks,t.marks))return this.schema.text(e.text+t.text,e.marks)},this.#k=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.parseMarkdown.match(e));if(!t){var n;throw n=e,new rn(rt.parserMatchError,`Cannot match target parser for node: ${JSON.stringify(n,rr)}.`)}return t},this.#C=e=>{let t=this.#k(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(aW.create(e,[],t)),this),this.#S=()=>{this.#b=o9.none;let e=this.close();return this.#M(e.type,e.attrs,e.content)},this.closeNode=()=>{try{this.#S()}catch(e){console.error(e)}return this},this.#M=(e,t,n)=>{let r=e.createAndFill(t,n,this.#b);if(!r){let r,i,o;throw r=`Cannot create node for ${"name"in e?e.name:e}`,i=e=>{if(null==e)return"null";if(Array.isArray(e))return`[${e.map(i).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]"}},o=[["[Description]",r],["[Attributes]",t],["[Content]",(n??[]).map(e=>e?"object"==typeof e&&"type"in e?`${e}`:i(e):"null")]].reduce((e,[t,n])=>{let r=`${t}: ${i(n)}.`;return e.concat(r)},[]),new rn(rt.createNodeInParserFail,o.join("\n"))}return this.push(r),r},this.addNode=(e,t,n)=>{try{this.#M(e,t,n)}catch(e){console.error(e)}return this},this.openMark=(e,t)=>{let n=e.create(t);return this.#b=n.addToSet(this.#b),this},this.closeMark=e=>(this.#b=e.removeFromSet(this.#b),this),this.addText=e=>{try{let t=this.top();if(!t)throw ro();let n=t.pop(),r=this.schema.text(e,this.#b);if(!n)return t.push(r),this;let i=this.#x(n,r);if(i)return t.push(i),this;return t.push(n,r),this}catch(e){return console.error(e),this}},this.build=()=>{let e;do e=this.#S();while(this.size())return e},this.next=(e=[])=>([e].flat().forEach(e=>this.#C(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}#w;#x;#k;#C;#S;#M},aG=class e extends aV{constructor(e,t,n,r={}){super(),this.type=e,this.children=t,this.value=n,this.props=r,this.push=(e,...t)=>{this.children||(this.children=[]),this.children.push(e,...t)},this.pop=()=>this.children?.pop()}static{this.create=(t,n,r,i={})=>new e(t,n,r,i)}},aK=class extends a${#b;static{this.create=(e,t)=>{let n=new this(e);return e=>(n.run(e),n.toString(t))}}constructor(e){super(),this.#b=o9.none,this.#k=e=>{let t=Object.values({...this.schema.nodes,...this.schema.marks}).find(t=>t.spec.toMarkdown.match(e));if(!t){var n;throw n=e.type,new rn(rt.serializerMatchError,`Cannot match target serializer for node: ${JSON.stringify(n,rr)}.`)}return t},this.#A=e=>this.#k(e).spec.toMarkdown.runner(this,e),this.#T=(e,t)=>this.#k(e).spec.toMarkdown.runner(this,e,t),this.#C=e=>{let{marks:t}=e,n=e=>e.type.spec.priority??50;[...t].sort((e,t)=>n(e)-n(t)).every(t=>!this.#T(t,e))&&this.#A(e),t.forEach(e=>this.#O(e))},this.#E=(e,t)=>{if(e.type===t||e.children?.length!==1)return e;let n=e=>{if(e.type===t)return null!=e.value?null:e;if(e.children?.length!==1)return null;let[r]=e.children;return r?n(r):null},r=n(e);if(!r)return e;let i=r.children?[...r.children]:void 0,o={...e,children:i};return o.children=i,r.children=[o],r},this.#N=e=>{let{children:t}=e;return t&&(e.children=t.reduce((e,t,n)=>{if(0===n)return[t];let r=e.at(-1);if(r&&r.isMark&&t.isMark){let{children:n,...i}=t=this.#E(t,r.type),{children:o,...l}=r;if(t.type===r.type&&n&&o&&JSON.stringify(i)===JSON.stringify(l)){let t={...l,children:[...o,...n]};return e.slice(0,-1).concat(this.#N(t))}}return e.concat(t)},[])),e},this.#D=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(aG.create(e,void 0,t,n)),this),this.#I=(e,t)=>{let n="",r="",i=e.children,o=-1,l=-1;if(i){i&&i.forEach((e,t)=>{"text"===e.type&&e.value&&(o<0&&(o=t),l=t)});let e=i?.[l],t=i?.[o];if(e&&e.value.endsWith(" ")){let t=e.value,n=t.trimEnd();r=t.slice(n.length),e.value=n}if(t&&t.value.startsWith(" ")){let e=t.value,r=e.trimStart();n=e.slice(0,e.length-r.length),t.value=r}}n.length&&this.#M("text",void 0,n);let s=t();return r.length&&this.#M("text",void 0,r),s},this.#S=(e=!1)=>{let t=this.close(),n=()=>this.#M(t.type,t.children,t.value,t.props);return e?this.#I(t,n):n()},this.closeNode=()=>(this.#S(),this),this.#M=(e,t,n,r)=>{let i=aG.create(e,t,n,r),o=this.#N(this.#D(i));return this.push(o),o},this.addNode=(e,t,n,r)=>(this.#M(e,t,n,r),this),this.#L=(e,t,n,r)=>e.isInSet(this.#b)?this:(this.#b=e.addToSet(this.#b),this.openNode(t,n,{...r,isMark:!0})),this.#O=e=>{e.isInSet(this.#b)&&(this.#b=e.type.removeFromSet(this.#b),this.#S(!0))},this.withMark=(e,t,n,r)=>(this.#L(e,t,n,r),this),this.closeMark=e=>(this.#O(e),this),this.build=()=>{let e=null;do e=this.#S();while(this.size())return e},this.next=e=>(Object.prototype.hasOwnProperty.call(e,"size")?e.forEach(e=>{this.#C(e)}):this.#C(e),this),this.toString=e=>e.stringify(this.build()),this.run=e=>(this.next(e),this),this.schema=e}#k;#A;#T;#C;#E;#N;#D;#I;#S;#M;#L;#O};let aJ=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},aZ=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},aY=null,aX=function(e,t,n){let r=aY||(aY=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},aQ=function(){aY=null},a0=function(e,t,n,r){return n&&(a4(e,t,n,r,-1)||a4(e,t,n,r,1))},a1=/^(img|br|input|textarea|hr)$/i;function a4(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:a5(e))){let n=e.parentNode;if(!n||1!=n.nodeType||a2(e)||a1.test(e.nodeName)||"false"==e.contentEditable)return!1;t=aJ(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(o=n.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;else e=n,t=i<0?a5(e):0}}}function a5(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function a2(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 a3=function(e){return e.focusNode&&a0(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function a7(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let a6="u">typeof navigator?navigator:null,a8="u">typeof document?document:null,a9=a6&&a6.userAgent||"",ce=/Edge\/(\d+)/.exec(a9),ct=/MSIE \d/.exec(a9),cn=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a9),cr=!!(ct||cn||ce),ci=ct?document.documentMode:cn?+cn[1]:ce?+ce[1]:0,co=!cr&&/gecko\/(\d+)/i.test(a9);co&&(/Firefox\/(\d+)/.exec(a9)||[0,0])[1];let cl=!cr&&/Chrome\/(\d+)/.exec(a9),cs=!!cl,ca=cl?+cl[1]:0,cc=!cr&&!!a6&&/Apple Computer/.test(a6.vendor),cu=cc&&(/Mobile\/\w+/.test(a9)||!!a6&&a6.maxTouchPoints>2),ch=cu||!!a6&&/Mac/.test(a6.platform),cd=!!a6&&/Win/.test(a6.platform),cp=/Android \d/.test(a9),cf=!!a8&&"webkitFontSmoothing"in a8.documentElement.style,cm=cf?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function cg(e,t){return"number"==typeof e?e:e[t]}function cv(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let l=n||e.dom;l;){if(1!=l.nodeType){l=aZ(l);continue}let e=l,n=e==o.body,s=n?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}}(o):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}(e),a=0,c=0;if(t.top<s.top+cg(r,"top")?c=-(s.top-t.top+cg(i,"top")):t.bottom>s.bottom-cg(r,"bottom")&&(c=t.bottom-t.top>s.bottom-s.top?t.top+cg(i,"top")-s.top:t.bottom-s.bottom+cg(i,"bottom")),t.left<s.left+cg(r,"left")?a=-(s.left-t.left+cg(i,"left")):t.right>s.right-cg(r,"right")&&(a=t.right-s.right+cg(i,"right")),a||c)if(n)o.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let u=n?"fixed":getComputedStyle(l).position;if(/^(fixed|sticky)$/.test(u))break;l="absolute"==u?l.offsetParent:aZ(l)}}function cy(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=aZ(r));return t}function cb(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let cw=null;function cx(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function ck(e){return e.top<e.bottom||e.left<e.right}function cC(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(ck(e))return e}return Array.prototype.find.call(n,ck)||e.getBoundingClientRect()}let cS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function cM(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),l=cf||co;if(3==r.nodeType)if(l&&(cS.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=cC(aX(r,i,i),n);if(co&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=cC(aX(r,i-1,i-1),-1);if(t.top==e.top){let n=cC(aX(r,i,i+1),-1);if(n.top!=e.top)return cA(n,n.left<t.left)}}return e}else{let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,cA(cC(aX(r,e,t),o),o<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==a5(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return cT(e.getBoundingClientRect(),!1)}if(null==o&&i<a5(r)){let e=r.childNodes[i];if(1==e.nodeType)return cT(e.getBoundingClientRect(),!0)}return cT(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==a5(r))){let e=r.childNodes[i-1],t=3==e.nodeType?aX(e,a5(e)-!l):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return cA(cC(t,1),!1)}if(null==o&&i<a5(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?aX(e,0,+!l):1==e.nodeType?e:null:null;if(t)return cA(cC(t,-1),!0)}return cA(cC(3==r.nodeType?aX(r):r,-n),n>=0)}function cA(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 cT(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 cO(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}let cE=/[\u0590-\u08ac]/,cN=null,cD=null,cI=!1;class cL{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,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(){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 r=this.children[t];if(r==e)return n;n+=r.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 r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>aJ(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),o;if(i&&(!t||i.node))if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;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 r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],o=t+i.size;if(o>e||i instanceof cH){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof c_&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?aJ(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?aJ(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 r=-1,i=-1;for(let o=n,l=0;;l++){let n=this.children[l],s=o+n.size;if(-1==r&&e<=s){let i=o+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=l;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=aJ(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(s>t||l==this.children.length-1)){t=s;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)){i=aJ(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}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(1!=t.nodeType||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let l=0,s=0;l<this.children.length;l++){let a=this.children[l],c=s+a.size;if(i>s&&o<c)return a.setSelection(e-s-a.border,t-s-a.border,n,r);s=c}let l=this.domFromPos(e,e?-1:1),s=t==e?l:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),c=n.domSelectionRange(),u=!1;if((co||cc)&&e==t){let{node:e,offset:t}=l;if(3==e.nodeType){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=s={node:n.parentNode,offset:aJ(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(co&&c.focusNode&&c.focusNode!=s.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||u&&cc)&&a0(l.node,l.offset,c.anchorNode,c.anchorOffset)&&a0(s.node,s.offset,c.focusNode,c.focusOffset))return;let h=!1;if((a.extend||e==t)&&!(u&&co)){a.collapse(l.node,l.offset);try{e!=t&&a.extend(s.node,s.offset),h=!0}catch(e){}}if(!h){if(e>t){let e=l;l=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(l.node,l.offset),a.removeAllRanges(),a.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,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,l=o-i.border;if(e>=r&&t<=l){this.dirty=e==n||t==o?2:1,e==r&&t==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}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 c_ extends cL{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=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 cR extends cL{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}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 cz extends cL{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=lH.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new cz(e,t,o.dom,o.contentDOM||o.dom,o)}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 r=cz.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=cY(i,t,o,n)),e>0&&(i=cY(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class cP extends cL{constructor(e,t,n,r,i,o,l,s,a){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=l}static create(e,t,n,r,i,o){let l=i.nodeViews[t.type.name],s,a=l&&l(t,i,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o,n,r),c=a&&a.dom,u=a&&a.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=lH.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:u}=e)}u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return(c=cU(c,n,t),a)?s=new cq(e,t,n,r,c,u||null,h,a,i,o+1):t.isText?new cF(e,t,n,r,c,h,i):new cP(e,t,n,r,c,u||null,h,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>o3.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&cG(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,s=new cJ(this,o&&o.node,e);(function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let l=e.child(n);r(l,i,t.forChild(o,l),n),o+=l.nodeSize}return}let l=0,s=[],a=null;for(let c=0;;){let u,h,d,p;for(;l<i.length&&i[l].to==o;){let e=i[l++];e.widget&&(u?(h||(h=[u])).push(e):u=e)}if(u)if(h){h.sort(cZ);for(let e=0;e<h.length;e++)n(h[e],c,!!a)}else n(u,c,!!a);if(a)p=-1,d=a,a=null;else if(c<e.childCount)p=c,d=e.child(c++);else break;for(let e=0;e<s.length;e++)s[e].to<=o&&s.splice(e--,1);for(;l<i.length&&i[l].from<=o&&i[l].to>o;)s.push(i[l++]);let f=o+d.nodeSize;if(d.isText){let e=f;l<i.length&&i[l].from<e&&(e=i[l].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<f&&(a=d.cut(e-o),d=d.cut(0,e-o),f=e,p=-1)}else for(;l<i.length&&i[l].to<f;)l++;let m=d.isInline&&!d.isLeaf?s.filter(e=>!e.inline):s.slice();r(d,m,t.forChild(o,d),p),o=f}})(this.node,this.innerDeco,(t,i,o)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!o&&s.syncToMarks(i==this.node.childCount?o9.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,o,a,c)=>{let u;s.syncToMarks(t.marks,n,e,c),s.findNodeMatch(t,o,a,c)||l&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,o,a,u,e)||s.updateNextNode(t,o,a,e,c,r)||s.addNode(t,o,a,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),function e(t,n,r){let i=t.firstChild,o=!1;for(let l=0;l<n.length;l++){let s=n[l],a=s.dom;if(a.parentNode==t){for(;a!=i;)i=cK(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(a,i);if(s instanceof cz){let n=i?i.previousSibling:t.lastChild;e(s.contentDOM,s.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=cK(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),cu&&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,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof sw)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,o=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let l=e.child(i++),s=o;if(o+=l.nodeSize,!l.isText)continue;let a=l.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;a+=t.text}if(o>=n){if(o>=r&&a.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?a.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&a.length>=r+t.length-s&&a.slice(r-s,r-s+t.length)==t)return r}}return -1}(this.node.content,e,n-t,r-t);return o<0?null:{node:i,pos:o,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new cR(this,i,t,r);e.input.compositionNodes.push(o),this.children=cY(this.children,n,n+r.length,e,o)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(cG(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=cW(this.dom,this.nodeDOM,c$(this.outerDeco,this.node,t),c$(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function cB(e,t,n,r,i){cU(r,t,e);let o=new cP(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class cF extends cP{constructor(e,t,n,r,i,o,l){super(e,t,n,r,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){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,r.trackWrites==this.nodeDOM&&(r.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 r=this.node.cut(e,t),i=document.createTextNode(r.text);return new cF(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}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 cH extends cL{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 cq extends cP{constructor(e,t,n,r,i,o,l,s,a,c){super(e,t,n,r,i,o,l,a,c),this.spec=s}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}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 cj=function(e){e&&(this.nodeName=e)};cj.prototype=Object.create(null);let cV=[new cj];function c$(e,t,n){if(0==e.length)return cV;let r=n?cV[0]:new cj,i=[r];for(let o=0;o<e.length;o++){let l=e[o].type.attrs;if(l)for(let e in l.nodeName&&i.push(r=new cj(l.nodeName)),l){let o=l[e];null!=o&&(n&&1==i.length&&i.push(r=new cj(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}return i}function cW(e,t,n,r){if(n==cV&&r==cV)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],l=n[t];if(t){let t;l&&l.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),l=cV[0]),i=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(i,l||cV[0],o)}return i}function cU(e,t,n){return cW(e,e,cV,c$(t,n,1!=e.nodeType))}function cG(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 cK(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class cJ{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,r=n.children.length,i=e.childCount,o=new Map,l=[];n:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof cz)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let a=s.node;if(a){if(a!=e.child(i-1))break;--i,o.set(s,i),l.push(s)}}return{index:i,matched:o,matches:l.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,r){let i=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;i<l&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,l=this.top.children.length;r<this.preMatch.index&&(l=Math.min(this.index+3,l));for(let t=this.index;t<l;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=cz.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),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,r,i,o){for(let l=this.index;l<this.top.children.length;l++){let s=this.top.children[l];if(s instanceof cP){let a=this.preMatch.matched.get(s);if(null!=a&&a!=i)return!1;let c=s.dom,u,h=this.isLocked(c)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&3!=s.dirty&&cG(t,s.outerDeco));if(!h&&s.update(e,t,n,r))return this.destroyBetween(this.index,l),s.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(u=this.recreateWrapper(s,e,t,n,r,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(r,o+1),u.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!cG(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let l=cP.create(this.top,t,n,r,i,o);if(l.contentDOM)for(let t of(l.children=e.children,e.children=[],l.children))t.parent=l;return e.destroy(),l}addNode(e,t,n,r,i){let o=cP.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new c_(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof cz;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof cF)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((cc||cs)&&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 r=new cH(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function cZ(e,t){return e.type.side-t.type.side}function cY(e,t,n,r,i){let o=[];for(let l=0,s=0;l<e.length;l++){let a=e[l],c=s,u=s+=a.size;c>=n||u<=t?o.push(a):(c<t&&o.push(a.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(a.slice(n-c,a.size,r)))}return o}function cX(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let s=r.resolve(l),a,c;if(a3(n)){for(a=l;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&sk.isSelectable(e)&&i.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==a5(e);r||i;){if(e==n)return!0;let t=aJ(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==a5(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;c=new sk(l==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=l,i=l;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[a,l]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(l)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let u=r.resolve(a);if(!c){let n="pointer"==t||e.state.selection.head<s.pos&&!o?1:-1;c=c6(e,u,s,n)}return c}function cQ(e){return e.editable?e.hasFocus():c9(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function c0(e,t=!1){let n=e.state.selection;if(c3(e,n),cQ(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&cs){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&a0(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,aJ(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&cr&&ci<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var r;let i,o,l,s,{anchor:a,head:c}=n,u,h;c1&&!(n instanceof sw)&&(n.$from.parent.inlineContent||(u=c4(e,n.from)),n.empty||n.$from.parent.inlineContent||(h=c4(e,n.to))),e.docView.setSelection(a,c,e,t),c1&&(u&&c2(u),h&&c2(h)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=(r=e).dom.ownerDocument).removeEventListener("selectionchange",r.input.hideSelectionGuard),l=(o=r.domSelectionRange()).anchorNode,s=o.anchorOffset,i.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(o.anchorNode!=l||o.anchorOffset!=s)&&(i.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!cQ(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let c1=cc||cs&&ca<63;function c4(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(cc&&i&&"false"==i.contentEditable)return c5(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return c5(i);else if(o)return c5(o)}}function c5(e){return e.contentEditable="true",cc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function c2(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function c3(e,t){if(t instanceof sk){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(c7(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else c7(e)}function c7(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function c6(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||sw.between(t,n,r)}function c8(e){return(!e.editable||!!e.hasFocus())&&c9(e)}function c9(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function ue(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&sg.findFrom(o,t)}function ut(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function un(e,t,n){let r=e.state.selection;if(r instanceof sw){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return ut(e,new sw(r.$anchor,o))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=ue(e.state,t);return!!n&&n instanceof sk&&ut(e,n)}else if(!(ch&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,o;if(!i||i.isText)return!1;let l=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(o=e.docView.descAt(l))&&!o.contentDOM)&&(sk.isSelectable(i)?ut(e,new sk(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):!!cf&&ut(e,new sw(e.state.doc.resolve(t<0?l:l+i.nodeSize))))}}else{if(r instanceof sk&&r.node.isInline)return ut(e,new sw(t>0?r.$to:r.$from));let n=ue(e.state,t);return!!n&&ut(e,n)}}function ur(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function ui(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function uo(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,l=!1;for(co&&1==n.nodeType&&r<ur(n)&&ui(n.childNodes[r],-1)&&(l=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(ui(e,-1))i=n,o=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(ul(n))break;else{let t=n.previousSibling;for(;t&&ui(t,-1);)i=n.parentNode,o=aJ(t),t=t.previousSibling;if(t)r=ur(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}l?us(e,n,r):i&&us(e,i,o)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let l=ur(i);for(;;)if(o<l){if(1!=i.nodeType)break;if(ui(i.childNodes[o],1))t=i,n=++o;else break}else if(ul(i))break;else{let r=i.nextSibling;for(;r&&ui(r,1);)t=r.parentNode,n=aJ(r)+1,r=r.nextSibling;if(r)o=0,l=ur(i=r);else{if((i=i.parentNode)==e.dom)break;o=l=0}}t&&us(e,t,n)}(e)}function ul(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function us(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!a2(e);)t=aJ(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!a2(e);)t=aJ(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(a3(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&c0(e)},50)}function ua(e,t){let n=e.state.doc.resolve(t);if(!(cs||cd)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function uc(e,t,n){let r=e.state.selection;if(r instanceof sw&&!r.empty||n.indexOf("s")>-1||ch&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ue(e.state,t);if(n&&n instanceof sk)return ut(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,l=r instanceof sS?sg.near(n,t):sg.findFrom(n,t);return!!l&&ut(e,l)}return!1}function uu(e,t){if(!(e.state.selection instanceof sw))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function uh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ud(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let l=e.someProp("clipboardSerializer")||lH.fromSchema(e.state.schema),s=uw(),a=s.createElement("div");a.appendChild(l.serializeFragment(r,{document:s}));let c=a.firstChild,u,h=0;for(;c&&1==c.nodeType&&(u=uy[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),h++}c=a.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function up(e,t,n,r,i){let o,l,s=i.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(r||s||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,s||r,e)}),s)return l=new lt(o3.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let n=e.someProp("clipboardTextParser",n=>n(t,i,r,e));if(n)l=n;else{let n=i.marks(),{schema:r}=e.state,l=lH.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(l.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),o=function(e){var t;let n,r=/^(\s*<meta [^>]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let i=uw().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e),l;if((l=o&&uy[o[1].toLowerCase()])&&(e=l.map(e=>"<"+e+">").join("")+e+l.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(ux||(ux=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),ux.createHTML(t)):t),l)for(let e=0;e<l.length;e++)i=i.querySelector(l[e])||i;return i}(n),cf&&function(e){let t=e.querySelectorAll(cs?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||lD.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||uf.test(e.parentNode.nodeName)?null:{ignore:!0}})),u)l=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:l}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=o3.from(t.create(r[e+1],i)),o++,l++}return new lt(i,o,l)}(uv(l,+u[1],+u[2]),u[4]);else if((l=lt.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,o=[];if(e.forEach(e=>{if(!o)return;let t=r.findWrapping(e.type),n;if(!t)return o=null;if(n=o.length&&i.length&&function e(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let l=e(t,n,r,i.lastChild,o+1);if(l)return i.copy(i.content.replaceChild(i.childCount-1,l));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(o3.from(um(r,t,o+1))))}}(t,i,e,o[o.length-1],0))o[o.length-1]=n;else{o.length&&(o[o.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(o3.empty,!0);return t.copy(r.append(i))}(o[o.length-1],i.length));let n=um(e,t);o.push(n),r=r.matchType(n.type),i=t}}),o)return o3.from(o)}return e}(l.content,i),!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=uv(l,e,t)}return e.someProp("transformPasted",t=>{l=t(l,e,a)}),l}let uf=/^(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 um(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,o3.from(e));return e}function ug(e,t,n,r,i,o){let l=t<0?e.firstChild:e.lastChild,s=l.content;return e.childCount>1&&(o=0),i<r-1&&(s=ug(s,t,n,r,i+1,o)),i>=n&&(s=t<0?l.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(l.contentMatchAt(l.childCount).fillBefore(o3.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(s))}function uv(e,t,n){return t<e.openStart&&(e=new lt(ug(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new lt(ug(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let uy={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},ub=null;function uw(){return ub||(ub=document.implementation.createHTMLDocument("title"))}let ux=null,uk={},uC={},uS={touchstart:!0,touchmove:!0};class uM{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 uA(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function uT(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>uO(e,t))})}function uO(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function uE(e){return{left:e.clientX,top:e.clientY}}function uN(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function uD(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}uC.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!u_(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!cp||!cs||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!cu||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||ch&&72==r&&"c"==i)return uu(e,-1)||uo(e,-1);if(46==r&&!t.shiftKey||ch&&68==r&&"c"==i)return uu(e,1)||uo(e,1);if(13==r||27==r)return!0;if(37==r||ch&&66==r&&"c"==i){let t=37==r?"ltr"==ua(e,e.state.selection.from)?-1:1:-1;return un(e,t,i)||uo(e,t)}if(39==r||ch&&70==r&&"c"==i){let t=39==r?"ltr"==ua(e,e.state.selection.from)?1:-1:1;return un(e,t,i)||uo(e,t)}else if(38==r||ch&&80==r&&"c"==i)return uc(e,-1,i)||uo(e,-1);else if(40==r||ch&&78==r&&"c"==i)return function(e){if(!cc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;uh(e,n,"true"),setTimeout(()=>uh(e,n,"false"),20)}return!1}(e)||uc(e,1,i)||uo(e,1);else if(i==(ch?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():uA(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,a7(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},uC.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},uC.keypress=(e,t)=>{if(u_(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||ch&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof sw)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault()}};let uI=ch?"metaKey":"ctrlKey";uk.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let o=uB(e),l=Date.now(),s="singleClick";l-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[uI]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?s="doubleClick":"doubleClick"==e.input.lastClick.type&&(s="tripleClick")),e.input.lastClick={time:l,x:t.clientX,y:t.clientY,type:s,button:t.button};let a=e.posAtCoords(uE(t));a&&("singleClick"==s?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new uL(e,a,t,!!o)):("doubleClick"==s?function(e,t,n,r){return uN(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return uN(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(uD(e,sw.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)uD(e,sw.create(r,o+1,o+1+n.content.size),"pointer");else{if(!sk.isSelectable(n))continue;uD(e,sk.create(r,o),"pointer")}return!0}}(e,n,r)})(e,a.pos,a.inside,t)?t.preventDefault():uA(e,"pointer"))};class uL{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[uI],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const l=r?null:n.target,s=l?e.docView.nearestDesc(l,!0):null;this.target=s&&1==s.nodeDOM.nodeType?s.nodeDOM:null;let{selection:a}=e.state;0==n.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof sk&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&co&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),uA(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>c0(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(uE(e))),this.updateAllowDefault(e),this.allowDefault||!t)uA(this.view,"pointer");else{var n,r,i,o;(n=this.view,r=t.pos,i=t.inside,o=this.selectNode,uN(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(o?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof sk&&(r=n.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(sk.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(e);break}}return null!=i&&(uD(e,sk.create(e.state.doc,i),"pointer"),!0)}(n,i):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&sk.isSelectable(r))&&(uD(e,new sk(n),"pointer"),!0)}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||cc&&this.mightDrag&&!this.mightDrag.node.isAtom||cs&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(uD(this.view,sg.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):uA(this.view,"pointer")}}move(e){this.updateAllowDefault(e),uA(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function u_(e,t){return!!e.composing||!!(cc&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}uk.touchstart=e=>{e.input.lastTouch=Date.now(),uB(e),uA(e,"pointer")},uk.touchmove=e=>{e.input.lastTouch=Date.now(),uA(e,"pointer")},uk.contextmenu=e=>uB(e);let uR=cp?5e3:-1;function uz(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>uB(e),t))}function uP(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function uB(e,t=!1){if(!cp||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),uP(e),t||e.docView&&e.docView.dirty){let n=cX(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}uC.compositionstart=uC.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof sw&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||cs&&cd&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),uB(e,!0),e.markCursor=null;else if(uB(e,!t.selection.empty),co&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}uz(e,uR)},uC.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,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++,uz(e,20))};let uF=cr&&ci<15||cu&&cm<604;function uH(e,t,n,r,i){let o=up(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||lt.empty)))return!0;if(!o)return!1;let l=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,s=l?e.state.tr.replaceSelectionWith(l,r):e.state.tr.replaceSelection(o);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function uq(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," "):""}uk.copy=uC.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=uF?null:t.clipboardData,{dom:o,text:l}=ud(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",l)):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 r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},uC.paste=(e,t)=>{if(e.composing&&!cp)return;let n=uF?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&uH(e,uq(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?uH(e,r.value,null,i,t):uH(e,r.textContent,r.innerHTML,i,t)},50)}(e,t)};class uj{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let uV=ch?"altKey":"ctrlKey";function u$(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[uV]}for(let e in uk.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(uE(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof sk?i.to-1:i.to));else if(r&&r.mightDrag)n=sk.create(e.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=sk.create(e.state.doc,r.posBefore))}let l=(n||e.state.selection).content(),{dom:s,text:a,slice:c}=ud(e,l);t.dataTransfer.files.length&&cs&&!(ca>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(uF?"Text":"text/html",s.innerHTML),t.dataTransfer.effectAllowed="copyMove",uF||t.dataTransfer.setData("text/plain",a),e.dragging=new uj(c,u$(e,t),n)},uk.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},uC.dragover=uC.dragenter=(e,t)=>t.preventDefault(),uC.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(uE(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=up(e,uq(t.dataTransfer),uF?null:t.dataTransfer.getData("text/html"),!1,i);let l=!!(n&&u$(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||lt.empty,l)))return t.preventDefault();if(!o)return;t.preventDefault();let s=o?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),l=r.node(t),s=!1;if(1==e)s=l.canReplace(o,o,i);else{let e=l.contentMatchAt(o).findWrapping(i.firstChild.type);s=e&&l.canReplaceWith(o,o,e[0])}if(s)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}(e.state.doc,i.pos,o):i.pos;null==s&&(s=i.pos);let a=e.state.tr;if(l){let{node:e}=n;e?e.replace(a):a.deleteSelection()}let c=a.mapping.map(s),u=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,h=a.doc;if(u?a.replaceRangeWith(c,c,o.content.firstChild):a.replaceRange(c,c,o),a.doc.eq(h))return;let d=a.doc.resolve(c);if(u&&sk.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))a.setSelection(new sk(d));else{let t=a.mapping.map(s);a.mapping.maps[a.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),a.setSelection(c6(e,d,a.doc.resolve(t)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},uk.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())&&c0(e)},20))},uk.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)},uk.beforeinput=(e,t)=>{if(cs&&cp&&"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,a7(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)}},uC)uk[e]=uC[e];function uW(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 uU{constructor(e,t){this.toDOM=e,this.spec=t||uY,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new uJ(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof uU&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&uW(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class uG{constructor(e,t){this.attrs=e,this.spec=t||uY}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new uJ(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof uG&&uW(this.attrs,e.attrs)&&uW(this.spec,e.spec)}static is(e){return e.type instanceof uG}destroy(){}}class uK{constructor(e,t){this.attrs=e,this.spec=t||uY}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new uJ(i.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(e){return this==e||e instanceof uK&&uW(this.attrs,e.attrs)&&uW(this.spec,e.spec)}destroy(){}}class uJ{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new uJ(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 uJ(e,e,new uU(t,n))}static inline(e,t,n,r){return new uJ(e,t,new uG(n,r))}static node(e,t,n,r){return new uJ(e,t,new uK(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof uG}get widget(){return this.type instanceof uU}}let uZ=[],uY={};class uX{constructor(e,t){this.local=e.length?e:uZ,this.children=t.length?t:uZ}static create(e,t){return t.length?u2(t,e,0,uY):uQ}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=t&&l.to>=e&&(!i||i(l.spec))&&n.push(l.copy(l.from+r,l.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,n,r+l,i)}}map(e,t,n){return this==uQ||0==e.maps.length?this:this.mapInner(e,t,0,0,n||uY)}mapInner(e,t,n,r,i){let o;for(let l=0;l<this.local.length;l++){let s=this.local[l].map(e,n,r);s&&s.type.valid(t,s)?(o||(o=[])).push(s):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?function(e,t,n,r,i,o,l){let s=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let l=o-i-(n-e);for(let i=0;i<s.length;i+=3){let o=s[i+1];if(o<0||e>o+t-r)continue;let a=s[i]+t-r;n>=a?s[i+1]=e<=a?-2:-1:e>=t&&l&&(s[i]+=l,s[i+1]+=l)}r+=l}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(-2==s[t+1]){a=!0,s[t+1]=-1;continue}let c=n.map(e[t]+o),u=c-i;if(u<0||u>=r.content.size){a=!0;continue}let h=n.map(e[t+1]+o,-1)-i,{index:d,offset:p}=r.content.findIndex(u),f=r.maybeChild(d);if(f&&p==u&&p+f.nodeSize==h){let r=s[t+2].mapInner(n,f,c+1,e[t]+o+1,l);r!=uQ?(s[t]=u,s[t+1]=h,s[t+2]=r):(s[t+1]=-2,a=!0)}else a=!0}if(a){let a=u2(function(e,t,n,r,i,o,l){for(let s=0;s<e.length;s+=3)-1==e[s+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let s=t.local[e].map(r,i,o);s?n.push(s):l.onRemove&&l.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1)}(e[s+2],t[s]+o+1);return n}(s,e,t,n,i,o,l),r,0,l);t=a.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new uX(t.sort(u3),s)}(this.children,o||[],e,t,n,r,i):o?new uX(o.sort(u3),uZ):uQ}add(e,t){return t.length?this==uQ?uX.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let l=o+n,s;if(s=u4(t,e,l)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,l+1):r.splice(i,0,o,o+e.nodeSize,u2(s,e,l+1,uY)),i+=3}});let o=u1(i?u5(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new uX(o.length?this.local.concat(o).sort(u3):this.local,r||this.children)}remove(e){return 0==e.length||this==uQ?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,l=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<l&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let s=n[r+2].removeInner(i,o+1);s!=uQ?n[r+2]=s:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new uX(r,n):uQ}forChild(e,t){let n,r;if(this==uQ)return this;if(t.isLeaf)return uX.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 i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof uG){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new uX(r.sort(u3),uZ);return n?new u0([e,n]):e}return n||uQ}eq(e){if(this==e)return!0;if(!(e instanceof uX)||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 u7(this.localsInner(e))}localsInner(e){if(this==uQ)return uZ;if(e.inlineContent||!this.local.some(uG.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof uG||t.push(this.local[e]);return t}forEachSet(e){e(this)}}uX.empty=new uX([],[]),uX.removeOverlap=u7;let uQ=uX.empty;class u0{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,uY));return u0.from(n)}forChild(e,t){if(t.isLeaf)return uX.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=uQ&&(i instanceof u0?n=n.concat(i.members):n.push(i))}return u0.from(n)}eq(e){if(!(e instanceof u0)||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 r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?u7(n?t:t.sort(u3)):uZ}static from(e){switch(e.length){case 0:return uQ;case 1:return e[0];default:return new u0(e.every(e=>e instanceof uX)?e:e.reduce((e,t)=>e.concat(t instanceof uX?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function u1(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new uJ(i.from+t,i.to+t,i.type))}return n}function u4(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i}function u5(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function u2(e,t,n,r){let i=[],o=!1;t.forEach((t,l)=>{let s=u4(e,t,l+n);if(s){o=!0;let e=u2(s,t,n+l+1,r);e!=uQ&&i.push(l,l+t.nodeSize,e)}});let l=u1(o?u5(e):e,-n).sort(u3);for(let e=0;e<l.length;e++)l[e].type.valid(t,l[e])||(r.onRemove&&r.onRemove(l[e].spec),l.splice(e--,1));return l.length||i.length?new uX(l,i):uQ}function u3(e,t){return e.from-t.from||e.to-t.to}function u7(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),u6(t,i+1,o.copy(r.to,o.to)));continue}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),u6(t,i,r.copy(o.from,r.to)));break}}return t}function u6(e,t,n){for(;t<e.length&&u3(n,e[t])>0;)t++;e.splice(t,0,n)}function u8(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=uQ&&t.push(r)}),e.cursorWrapper&&t.push(uX.create(e.state.doc,[e.cursorWrapper.deco])),u0.from(t)}let u9={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},he=cr&&ci<=11;class ht{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 hn{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ht,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]);cr&&ci<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():cc&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),he&&(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,u9)),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(c8(this.view)){if(this.suppressingSelectionUpdates)return c0(this.view);if(cr&&ci<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&a0(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=aZ(n))t.add(n);for(let r=e.anchorNode;r;r=aZ(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:3==n.nodeType?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:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&c8(t)&&!this.ignoreSelectionChange(r),o=-1,l=-1,s=!1,a=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],a);t&&(o=o<0?t.from:Math.min(t.from,o),l=l<0?t.to:Math.max(t.to,l),t.typeOver&&(s=!0))}if(a.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&1==t.nodeType;){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(co&&a.length){let e=a.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:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||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}(t,n)!=e)&&r.remove()}}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&a3(r)&&(c=cX(t))&&c.eq(sg.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,c0(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,l),e=t,!hr.has(e)&&(hr.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=co,hi||(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."),hi=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(n=o.parentNode)?void 0:n.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(t,a)),this.handleDOMChange(o,l,s,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||c0(t),this.currentSelection.set(r))}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 r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(cr&&ci<=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))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let o=r&&r.parentNode==e.target?aJ(r)+1:0,l=n.localPosFromDOM(e.target,o,-1),s=i&&i.parentNode==e.target?aJ(i):e.target.childNodes.length;return{from:l,to:n.localPosFromDOM(e.target,s,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 hr=new WeakMap,hi=!1;function ho(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,l=e.domAtPos(e.state.selection.anchor);return a0(l.node,l.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function hl(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(cc&&/^(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||cc&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let hs=/^(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 ha(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:c6(e,t.resolve(n.anchor),t.resolve(n.head))}function hc(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function hu(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class hh{constructor(e,t){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 uM,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(hg),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=hf(this),hp(this),this.nodeViews=hm(this),this.docView=cB(this.state.doc,hd(this),u8(this),this.dom,this),this.domObserver=new hn(this,(e,t,n,r)=>(function(e,t,n,r,i){let o,l,s,a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=cX(e,t);if(n&&!e.state.selection.eq(n)){if(cs&&cp&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,a7(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),a&&r.setMeta("composition",a),e.dispatch(r)}return}let c=e.state.doc.resolve(t),u=c.sharedDepth(n);t=c.before(u+1),n=e.state.doc.resolve(n).after(u+1);let h=e.state.selection,d=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:l,from:s,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],a3(c)||r.push({node:c.focusNode,offset:c.focusOffset})),cs&&8===e.input.lastKeyCode)for(let e=l;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){l=e;break}if(!n||n.size)break}let h=e.state.doc,d=e.someProp("domParser")||lD.fromSchema(e.state.schema),p=h.resolve(s),f=null,m=d.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:l,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:hl,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+s,head:t+s}}return{doc:m,sel:f,from:s,to:a}}(e,t,n),p=e.state.doc,f=p.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(o=e.state.selection.to,l="end"):(o=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let m=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:l,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){let e=Math.max(0,o-Math.min(l,s));r-=l+e-o}if(l<o&&e.size<t.size){let e=r<=o&&r>=l?o-r:0;(o-=e)&&o<t.size&&hu(t.textBetween(o-1,o+1))&&(o+=e?1:-1),s=o+(s-l),l=o}else if(s<o){let t=r<=o&&r>=s?o-r:0;(o-=t)&&o<e.size&&hu(e.textBetween(o-1,o+1))&&(o+=t?1:-1),l=o+(l-s),s=o}return{start:o,endA:l,endB:s}}(f.content,d.doc.content,d.from,o,l);if(m&&e.input.domChangeCount++,(cu&&e.input.lastIOSEnter>Date.now()-225||cp)&&i.some(e=>1==e.nodeType&&!hs.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",t=>t(e,a7(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!m)if(r&&h instanceof sw&&!h.empty&&h.$head.sameParent(h.$anchor)&&!e.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:h.from,endA:h.to,endB:h.to};else{if(d.sel){let t=ha(e,e.state.doc,d.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta("composition",a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof sw&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),cr&&ci<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&" "==d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),y=d.doc.resolveNoCache(m.endB-d.from),b=p.resolve(m.start),w=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA;if((cu&&e.input.lastIOSEnter>Date.now()-225&&(!w||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!w&&g.pos<d.doc.content.size&&(!g.sameParent(y)||!g.parent.inlineContent)&&g.pos<y.pos&&!/\S/.test(d.doc.textBetween(g.pos,y.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,a7(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||hc(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let l=e.resolve(hc(o,!0,!0));return!(!l.parent.isTextblock||l.pos>n||hc(l,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(l.parent.content)}(p,m.start,m.endA,g,y)&&e.someProp("handleKeyDown",t=>t(e,a7(8,"Backspace")))){cp&&cs&&e.domObserver.suppressSelectionUpdates();return}cs&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),cp&&!w&&g.start()!=y.start()&&0==y.parentOffset&&g.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,a7(13,"Enter"))})},20));let x=m.start,k=m.endA,C=t=>{let n=t||e.state.tr.replace(x,k,d.doc.slice(m.start-d.from,m.endB-d.from));if(d.sel){let t=ha(e,n.doc,d.sel);t&&!(cs&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==x||t.head==n.mapping.map(k)-1)||cr&&t.empty&&t.head==x)&&n.setSelection(t)}return a&&n.setMeta("composition",a),n.scrollIntoView()};if(w)if(g.pos==y.pos){cr&&ci<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>c0(e),20));let t=C(e.state.tr.delete(x,k)),n=p.resolve(m.start).marksAcross(p.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(s=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,l,s,a;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)o=n[e].removeFromSet(o);if(1==i.length&&0==o.length)s=i[0],l="add",a=e=>e.mark(s.addToSet(e.marks));else{if(0!=i.length||1!=o.length)return null;s=o[0],l="remove",a=e=>e.mark(s.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(a(t.child(e)));if(o3.from(c).eq(e))return{mark:s,type:l}}(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let t=C(e.state.tr);"add"==s.type?t.addMark(x,k,s.mark):t.removeMark(x,k,s.mark),e.dispatch(t)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-!y.textOffset){let t=g.parent.textBetween(g.parentOffset,y.parentOffset),n=()=>C(e.state.tr.insertText(t,x,k));e.someProp("handleTextInput",r=>r(e,x,k,t,n))||e.dispatch(n())}else e.dispatch(C());else e.dispatch(C())})(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in uk){let n=uk[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!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}(e,t)||uO(e,t)||!e.editable&&t.type in uC||n(e,t)},uS[t]?{passive:!0}:void 0)}cc&&e.dom.addEventListener("input",()=>null),uT(e)}(this),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&&uT(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(hg),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,r,i;let o=this.state,l=!1,s=!1;e.storedMarks&&this.composing&&(uP(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=hm(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,l=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&uT(this),this.editable=hf(this),hp(this);let c=u8(this),u=hd(this),h=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",d=l||!this.docView.matchesNode(e.doc,u,c);(d||!e.selection.eq(o.selection))&&(s=!0);let p="preserve"==h&&s&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,l=i+1;l<Math.min(innerHeight,r.bottom);l+=5){let r=e.root.elementFromPoint(o,l);if(!r||r==e.dom||!e.dom.contains(r))continue;let s=r.getBoundingClientRect();if(s.top>=i-20){t=r,n=s.top;break}}return{refDOM:t,refTop:n,stack:cy(e.dom)}}(this);if(s){let t,n,s;this.domObserver.stop();let a=d&&(cr||cs)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(r=o.selection,i=e.selection,s=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(s)!=i.$anchor.start(s));if(d){let t=cs?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(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=a5(e=e.childNodes[t-1])}else{if(!e.parentNode||a2(e))return null;t=aJ(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||a2(e))return null;t=aJ(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(l||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=cB(e.doc,u,c,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(a=!0)}a||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),a0(t.node,t.offset,n.anchorNode,n.anchorOffset)))?c0(this,a):(c3(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null==(n=this.dragging)?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==h?this.dom.scrollTop=0:"to selection"==h?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;cb(n,0==r?0:r-t)}(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof sk){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&cv(this,t.getBoundingClientRect(),e)}else cv(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,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new uj(e.slice,e.move,r<0?void 0:sk.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let o=i[n].props[e];if(null!=o&&(r=t?t(o):o))return r}}hasFocus(){if(cr){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(cw)return e.focus(cw);let t=cy(e);e.focus(null==cw?{get preventScroll(){return cw={preventScroll:!0},!0}}:void 0),cw||(cw=!1,cb(t,0))}(this.dom),c0(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 r,i,o=e.dom.ownerDocument,l,s=0,a=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(a5(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(a5(r.startContainer),r.startOffset)}}}(o,t.left,t.top);a&&({node:l,offset:s}=a);let c=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(1!=c.nodeType?c.parentNode:c)){let n=e.dom.getBoundingClientRect();if(!cx(t,n)||!(c=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),l=o;;){let r=t.childNodes[l];if(1==r.nodeType){let t=r.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(cx(n,o))return e(r,n,o)}}if((l=(l+1)%i)==o)break}return t}(e.dom,t,n)))return null}if(cc)for(let e=c;l&&e;e=aZ(e))e.draggable&&(l=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,l){let n;if(co&&1==l.nodeType&&(s=Math.min(s,l.childNodes.length))<l.childNodes.length){let e=l.childNodes[s],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&s++}cf&&s&&1==l.nodeType&&1==(n=l.childNodes[s-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&s--,l==e.dom&&s==l.childNodes.length-1&&1==l.lastChild.nodeType&&t.top>l.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==s||1!=l.nodeType||"BR"!=l.childNodes[s-1].nodeName)&&(i=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),l;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((l=t.dom.getBoundingClientRect()).width||l.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?i=t.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,l,s,t))}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,o,l=2e8,s,a=0,c=n.top,u=n.top;for(let e=t.firstChild,h=0;e;e=e.nextSibling,h++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=aX(e).getClientRects()}for(let d=0;d<t.length;d++){let p=t[d];if(p.top<=c&&p.bottom>=u){c=Math.max(p.bottom,c),u=Math.min(p.top,u);let t=p.left>n.left?p.left-n.left:p.right<n.left?n.left-p.right:0;if(t<l){o=e,l=t,s=t&&3==o.nodeType?{left:p.right<n.left?p.right:p.left,top:n.top}:n,1==e.nodeType&&t&&(a=h+ +(n.left>=(p.left+p.right)/2));continue}}else p.top>n.top&&!r&&p.left<=n.left&&p.right>=n.left&&(r=e,i={left:Math.max(p.left,Math.min(p.right,n.left)),top:p.top});!o&&(n.left>=p.right&&n.top>=p.top||n.left>=p.left&&n.top>=p.bottom)&&(a=h+1)}}return(!o&&r&&(o=r,s=i,l=0),o&&3==o.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=cC(r,1);if(n.top!=n.bottom&&cx(t,n)){i={node:e,offset:o+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}(o,s):!o||l&&1==o.nodeType?{node:t,offset:a}:e(o,s)}(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,c,t));let u=e.docView.nearestDesc(c,!0);return{pos:i,inside:u?u.posAtStart-u.border:-1}}(this,e)}coordsAtPos(e,t=1){return cM(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 r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,i;return cN==t&&cD==n?cI:(cN=t,cD=n,cI="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,cO(e,t,()=>{let{node:t}=e.docView.domFromPos(i.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 r=cM(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=aX(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=i==r.parent.content.size,l=e.domSelection();return l?cE.test(r.parent.textContent)&&l.modify?cO(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),a=l.caretBidiLevel;l.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:h}=e.domSelectionRange(),d=u&&!c.contains(1==u.nodeType?u:u.parentNode)||t==u&&i==h;try{l.collapse(o,s),t&&(t!=o||i!=s)&&l.extend&&l.extend(t,i)}catch(e){}return null!=a&&(l.caretBidiLevel=a),d}):"left"==n||"backward"==n?!i:o:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return uH(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return uH(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return ud(this,e)}destroy(){if(this.docView){for(let e in 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,[],u8(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,aQ()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!uO(this,e)&&uk[e.type]&&(this.editable||!(e.type in uC))&&uk[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?cc&&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 ho(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?ho(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function hd(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"),[uJ.node(0,e.state.doc.content.size,t)]}function hp(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:uJ.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function hf(e){return!e.someProp("editable",t=>!1===t(e.state))}function hm(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 hg(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")}function hv(e,t){return e.meta={package:"@milkdown/core",group:"System",...t},e}hh.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};var hy={text:(e,t,n,r)=>{let i=e.value;return/^[^*_\\]*\s+$/.test(i)?i:n.safe(i,{...r,encode:[]})},strong:(e,t,n,r)=>{let i=e.marker||n.options.strong||"*",o=n.enter("strong"),l=n.createTracker(r),s=l.move(i+i);return s+=l.move(n.containerPhrasing(e,{before:s,after:i,...l.current()})),s+=l.move(i+i),o(),s},emphasis:(e,t,n,r)=>{let i=e.marker||n.options.emphasis||"*",o=n.enter("emphasis"),l=n.createTracker(r),s=l.move(i);return s+=l.move(n.containerPhrasing(e,{before:s,after:i,...l.current()})),s+=l.move(i),o(),s}},hb=rp({},"editorView"),hw=rp({},"editorState"),hx=rp([],"initTimer"),hk=rp({},"editor"),hC=rp([],"inputRules"),hS=rp([],"prosePlugins"),hM=rp([],"remarkPlugins"),hA=rp([],"nodeView"),hT=rp([],"markView"),hO=rp(oY().use(i$).use(oD),"remark"),hE=rp({handlers:hy,encode:[]},"remarkStringifyOptions"),hN=rb("ConfigReady"),hD=rb("InitReady"),hI=rb("SchemaReady"),hL=rp([],"schemaTimer"),h_=rp({},"schema"),hR=rp([],"nodes"),hz=rp([],"marks");function hP(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var hB=e=>(e.inject(h_,{}).inject(hR,[]).inject(hz,[]).inject(hL,[hD]).record(hI),async()=>{await e.waitTimers(hL);let t=e.get(hO),n=e.get(hM).reduce((e,t)=>e.use(t.plugin,t.options),t);e.set(hO,n);let r=new lE({nodes:Object.fromEntries(e.get(hR).map(([e,t])=>[e,hP(t)])),marks:Object.fromEntries(e.get(hz).map(([e,t])=>[e,hP(t)]))});return e.set(h_,r),e.done(hI),()=>{e.remove(h_).remove(hR).remove(hz).remove(hL).clearTimer(hI)}});hv(hB,{displayName:"Schema"});var hF=class{constructor(){this.#i=new ru,this.#_=null,this.setCtx=e=>{this.#_=e},this.chain=()=>{if(null==this.#_)throw rs();let e=this.#_,t=[],n=this.get.bind(this),r={run:()=>{let n=s1(...t),r=e.get(hb);return n(r.state,r.dispatch,r)},inline:e=>(t.push(e),r),pipe:(function(e,i){let o=n(e);return t.push(o(i)),r}).bind(this)};return r}}#i;#_;get ctx(){return this.#_}create(e,t){let n=e.create(this.#i.sliceMap);return n.set(t),n}get(e){return this.#i.get(e).get()}remove(e){return this.#i.remove(e)}call(e,t){if(null==this.#_)throw rs();let n=this.get(e)(t),r=this.#_.get(hb);return n(r.state,r.dispatch,r)}inline(e){if(null==this.#_)throw rs();let t=this.#_.get(hb);return e(t.state,t.dispatch,t)}},hH=rp(new hF,"commands"),hq=rp([hI],"commandsTimer"),hj=rb("CommandsReady"),hV=e=>{let t=new hF;return t.setCtx(e),e.inject(hH,t).inject(hq,[hI]).record(hj),async()=>(await e.waitTimers(hq),e.done(hj),()=>{e.remove(hH).remove(hq).clearTimer(hj)})};hv(hV,{displayName:"Commands"});var h$=class{constructor(){this.#_=null,this.#R=[],this.setCtx=e=>{this.#_=e},this.add=e=>(this.#R.push(e),()=>{this.#R=this.#R.filter(t=>t!==e)}),this.addObjectKeymap=e=>{let t=[];return Object.entries(e).forEach(([e,n])=>{if("function"==typeof n){let r={key:e,onRun:()=>n};this.#R.push(r),t.push(()=>{this.#R=this.#R.filter(e=>e!==r)})}else this.#R.push(n),t.push(()=>{this.#R=this.#R.filter(e=>e!==n)})}),()=>{t.forEach(e=>e())}},this.addBaseKeymap=()=>{let e=(s7.Backspace=s1(s8,sB,sq,sV),s7);return this.addObjectKeymap(e)},this.build=()=>{let e={};return this.#R.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,r)=>{let i=this.#_;if(null==i)throw ri();return s1(...n.map(e=>e.onRun(i)))(e,t,r)}]}))}}#_;#R;get ctx(){return this.#_}},hW=rp(new h$,"keymap"),hU=rp([hI],"keymapTimer"),hG=rb("KeymapReady"),hK=e=>{let t=new h$;return t.setCtx(e),e.inject(hW,t).inject(hU,[hI]).record(hG),async()=>(await e.waitTimers(hU),e.done(hG),()=>{e.remove(hW).remove(hU).clearTimer(hG)})},hJ=rb("ParserReady"),hZ=()=>{throw ri()},hY=rp(hZ,"parser"),hX=rp([],"parserTimer"),hQ=e=>(e.inject(hY,hZ).inject(hX,[hI]).record(hJ),async()=>{await e.waitTimers(hX);let t=e.get(hO),n=e.get(h_);return e.set(hY,aU.create(n,t)),e.done(hJ),()=>{e.remove(hY).remove(hX).clearTimer(hJ)}});hv(hQ,{displayName:"Parser"});var h0=rb("SerializerReady"),h1=rp([],"serializerTimer"),h4=()=>{throw ri()},h5=rp(h4,"serializer"),h2=e=>(e.inject(h5,h4).inject(h1,[hI]).record(h0),async()=>{await e.waitTimers(h1);let t=e.get(hO),n=e.get(h_);return e.set(h5,aK.create(n,t)),e.done(h0),()=>{e.remove(h5).remove(h1).clearTimer(h0)}});hv(h2,{displayName:"Serializer"});var h3=rp("","defaultValue"),h7=rp(e=>e,"stateOptions"),h6=rp([],"editorStateTimer"),h8=rb("EditorStateReady"),h9=new sP("MILKDOWN_STATE_TRACKER"),de=e=>(e.inject(h3,"").inject(hw,{}).inject(h7,e=>e).inject(h6,[hJ,h0,hj,hG]).record(h8),async()=>{await e.waitTimers(h6);let t=e.get(h_),n=e.get(hY),r=e.get(hC),i=e.get(h7),o=e.get(hS),l=function(e,t,n){var r;if("string"==typeof e)return t(e);if("html"===e.type)return lD.fromSchema(n).parse(e.dom);if("json"===e.type)return lf.fromJSON(n,e.value);throw r=e,new rn(rt.docTypeError,`Doc type error, unsupported type: ${JSON.stringify(r,rr)}`)}(e.get(h3),n,t),s=e.get(hW),a=s.addBaseKeymap(),c=[...o,new s_({key:h9,state:{init:()=>{},apply:(t,n,r,i)=>{e.set(hw,i)}}}),function({rules:e}){let t=new s_({key:ak,isInputRules:!0,state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,i,o)=>ax(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>(setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&ax(n,r.pos,r.pos,"",e,t)}),!1),keydown:(e,t)=>!!(av&&ad&&"Enter"===t.key)&&!e.composing&&!!e.someProp("handleKeyDown",n=>n(e,t))&&(t.preventDefault(),!0)},handleKeyDown(n,r){if("Enter"!==r.key)return!1;let{$cursor:i}=n.state.selection;return!!i&&ax(n,i.pos,i.pos,"\n",e,t)}}});return t}({rules:r}),aq(s.build())];e.set(hS,c);let u=i({schema:t,doc:l,plugins:c}),h=sL.create(u);return e.set(hw,h),e.done(h8),()=>{a(),e.remove(h3).remove(hw).remove(h7).remove(h6).clearTimer(h8)}});hv(de,{displayName:"EditorState"});var dt=rp([],"pasteRule"),dn=rp([hI],"pasteRuleTimer"),dr=rb("PasteRuleReady"),di=e=>(e.inject(dt,[]).inject(dn,[hI]).record(dr),async()=>(await e.waitTimers(dn),e.done(dr),()=>{e.remove(dt).remove(dn).clearTimer(dr)}));hv(di,{displayName:"PasteRule"});var dl=rb("EditorViewReady"),ds=rp([],"editorViewTimer"),da=rp({},"editorViewOptions"),dc=rp(null,"root"),du=rp(null,"rootDOM"),dh=rp({},"rootAttrs"),dd=new sP("MILKDOWN_VIEW_CLEAR"),dp=e=>(e.inject(dc,document.body).inject(hb,{}).inject(da,{}).inject(du,null).inject(dh,{}).inject(ds,[h8,dr]).record(dl),async()=>{var t;await e.wait(hD);let n=e.get(dc)||document.body,r="string"==typeof n?document.querySelector(n):n;e.update(hS,t=>[new s_({key:dd,view:t=>{let n,i=r?((n=document.createElement("div")).className="milkdown",r.appendChild(n),e.set(du,n),Object.entries(e.get(dh)).forEach(([e,t])=>n.setAttribute(e,t)),n):void 0;if(i&&r){let e=t.dom;r.replaceChild(i,e),i.appendChild(e)}return{destroy:()=>{i?.parentNode&&i?.parentNode.replaceChild(t.dom,i),i?.remove()}}}}),...t]),await e.waitTimers(ds);let i=e.get(hw),o=e.get(da),l=new hh(r,{state:i,nodeViews:Object.fromEntries(e.get(hA)),markViews:Object.fromEntries(e.get(hT)),transformPasted:(t,n,r)=>(e.get(dt).sort((e,t)=>(t.priority??50)-(e.priority??50)).map(e=>e.run).forEach(e=>{t=e(t,n,r)}),t),...o});return(t=l.dom).classList.add("editor"),t.setAttribute("role","textbox"),e.set(hb,l),e.done(dl),()=>{l?.destroy(),e.remove(dc).remove(hb).remove(da).remove(du).remove(dh).remove(ds).clearTimer(dl)}});hv(dp,{displayName:"EditorView"});var df=((I={}).Idle="Idle",I.OnCreate="OnCreate",I.Created="Created",I.OnDestroy="OnDestroy",I.Destroyed="Destroyed",I),dm=class e{constructor(){this.#z=!1,this.#g=df.Idle,this.#P=[],this.#B=()=>void 0,this.#i=new ru,this.#o=new rg,this.#F=new Map,this.#H=new Map,this.#_=new rm(this.#i,this.#o),this.#q=()=>{var e,t;let n,r,i=(e=async e=>{await Promise.all(this.#P.map(t=>Promise.resolve(t(e))))},hv(n=t=>(t.record(hN),async()=>(await e(t),t.done(hN),()=>{t.clearTimer(hN)})),{displayName:"Config"}),n),o=[hB,hQ,h2,hV,hK,di,de,dp,(t=this,hv(r=e=>(e.inject(hk,t).inject(hS,[]).inject(hM,[]).inject(hC,[]).inject(hA,[]).inject(hT,[]).inject(hE,{handlers:hy,encode:[]}).inject(hO,oY().use(i$).use(oD)).inject(hx,[hN]).record(hD),async()=>{await e.waitTimers(hx);let t=e.get(hE);return e.set(hO,oY().use(i$).use(oD,t)),e.done(hD),()=>{e.remove(hk).remove(hS).remove(hM).remove(hC).remove(hA).remove(hT).remove(hE).remove(hO).remove(hx).clearTimer(hD)}}),{displayName:"Init"}),r),i];this.#j(o,this.#H)},this.#j=(e,t)=>{e.forEach(e=>{let n=this.#_.produce(this.#z?e.meta:void 0),r=e(n);t.set(e,{ctx:n,handler:r,cleanup:void 0})})},this.#V=(e,t=!1)=>Promise.all([e].flat().map(async e=>{let n=this.#F.get(e)?.cleanup;return(t?this.#F.delete(e):this.#F.set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),"function"==typeof n)?n():n})),this.#$=async()=>{await Promise.all([...this.#H.entries()].map(async([e,{cleanup:t}])=>"function"==typeof t?t():t)),this.#H.clear()},this.#W=e=>{this.#g=e,this.#B(e)},this.#U=e=>[...e.entries()].map(async([t,n])=>{let{ctx:r,handler:i}=n;if(!i)return;let o=await i();e.set(t,{ctx:r,handler:i,cleanup:o})}),this.enableInspector=(e=!0)=>(this.#z=e,this),this.onStatusChange=e=>(this.#B=e,this),this.config=e=>(this.#P.push(e),this),this.removeConfig=e=>(this.#P=this.#P.filter(t=>t!==e),this),this.use=e=>{let t=[e].flat();return t.flat().forEach(e=>{this.#F.set(e,{ctx:void 0,handler:void 0,cleanup:void 0})}),this.#g===df.Created&&this.#j(t,this.#F),this},this.remove=async e=>this.#g===df.OnCreate?(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.#V([e].flat(),!0),this),this.create=async()=>(this.#g===df.OnCreate||(this.#g===df.Created&&await this.destroy(),this.#W(df.OnCreate),this.#q(),this.#j([...this.#F.keys()],this.#F),await Promise.all([this.#U(this.#H),this.#U(this.#F)].flat()),this.#W(df.Created)),this),this.destroy=async(e=!1)=>this.#g===df.Destroyed||this.#g===df.OnDestroy?this:this.#g===df.OnCreate?new Promise(t=>{setTimeout(()=>{t(this.destroy(e))},50)}):(e&&(this.#P=[]),this.#W(df.OnDestroy),await this.#V([...this.#F.keys()],e),await this.#$(),this.#W(df.Destroyed),this),this.action=e=>e(this.#_),this.inspect=()=>this.#z?[...this.#H.values(),...this.#F.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}#z;#g;#P;#B;#i;#o;#F;#H;#_;#q;#j;#V;#$;#W;#U;get ctx(){return this.#_}get status(){return this.#g}};let dg=e=>crypto.getRandomValues(new Uint8Array(e));function dv(e,t){let n=function(e="cmdKey"){return rp(()=>()=>!1,e)}(e),r=i=>async()=>{r.key=n,await i.wait(hj);let o=t(i);return i.get(hH).create(n,o),r.run=t=>i.get(hH).call(e,t),()=>{i.get(hH).remove(n)}};return r}function dy(e){let t=n=>async()=>{await n.wait(hI);let r=e(n);return n.update(hC,e=>[...e,r]),t.inputRule=r,()=>{n.update(hC,e=>e.filter(e=>e!==r))}};return t}function db(e,t){let n=r=>async()=>{let i=t(r);return r.update(hR,t=>[...t.filter(t=>t[0]!==e),[e,i]]),n.id=e,n.schema=i,()=>{r.update(hR,t=>t.filter(([t])=>t!==e))}};return n.type=t=>{let n=t.get(h_).nodes[e];if(!n)throw ra(e);return n},n}function dw(e){let t,n=n=>async()=>(await n.wait(hI),t=e(n),n.update(hS,e=>[...e,t]),()=>{n.update(hS,e=>e.filter(e=>e!==t))});return n.plugin=()=>t,n.key=()=>t.spec.key,n}function dx(e){let t=n=>async()=>{await n.wait(hG);let r=n.get(hW),i=e(n),o=r.addObjectKeymap(i);return t.keymap=i,()=>{o()}};return t}function dk(e,t){let n=r=>async()=>{await r.wait(hI);let i=t(r);return e.type(r)instanceof lA?r.update(hA,t=>[...t,[e.id,i]]):r.update(hT,t=>[...t,[e.id,i]]),n.view=i,n.type=e,()=>{e.type(r)instanceof lA?r.update(hA,t=>t.filter(t=>t[0]!==e.id)):r.update(hT,t=>t.filter(t=>t[0]!==e.id))}};return n}function dC(e,t){let n=rp(e,t),r=e=>(e.inject(n),()=>()=>{e.remove(n)});return r.key=n,r}function dS(e,t){let n=dC(t,e),r=db(e,e=>e.get(n.key)(e)),i=[n,r];return i.id=r.id,i.node=r,i.type=e=>r.type(e),i.ctx=n,i.key=n.key,i.extendSchema=n=>dS(e,n(t)),i}function dM(e,t){var n;let r,i=dC(t,e),o=(n=e=>e.get(i.key)(e),(r=t=>async()=>{let i=n(t);return t.update(hz,t=>[...t.filter(t=>t[0]!==e),[e,i]]),r.id=e,r.schema=i,()=>{t.update(hz,t=>t.filter(([t])=>t!==e))}}).type=t=>{let n=t.get(h_).marks[e];if(!n)throw new rn(rt.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${e}" in schema.`);return n},r),l=[i,o];return l.id=o.id,l.mark=o,l.type=e=>o.type(e),l.ctx=i,l.key=i.key,l.extendSchema=n=>dM(e,n(t)),l}function dA(e,t){let n=dC(Object.fromEntries(Object.entries(t).map(([e,{shortcuts:t,priority:n}])=>[e,{shortcuts:t,priority:n}])),`${e}Keymap`),r=dx(e=>{let r=e.get(n.key);return Object.fromEntries(Object.entries(t).flatMap(([e,{command:t}])=>{let n=r[e],i=[n.shortcuts].flat(),o=n.priority;return i.map(e=>[e,{key:e,onRun:t,priority:o}])}))}),i=[n,r];return i.ctx=n,i.shortcuts=r,i.key=n.key,i.keymap=r.keymap,i}((e,t=21)=>((e,t,n)=>{let r=256-256%e.length;if(256===r){let r=e.length-1;return (i=t)=>{if(!i)return"";let o="";for(;;){let t=n(i),l=i;for(;l--;)if((o+=e[t[l]&r]).length>=i)return o}}}let i=Math.ceil(409.6*t/r);return (o=t)=>{if(!o)return"";let l="";for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(l+=e[t[s]%e.length]).length>=o)return l}}})(e,0|t,dg))("abcedfghicklmn",10);var dT=(e,t=()=>({}))=>dC(t,`${e}Attr`),dO=(e,t=()=>({}))=>dC(t,`${e}Attr`);function dE(e,t,n){let r=dC(n??{},e),i=e=>async()=>{await e.wait(hD);let n={plugin:t(e),options:e.get(r.key)};return e.update(hM,e=>[...e,n]),()=>{e.update(hM,e=>e.filter(e=>e!==n))}},o=[r,i];return o.id=e,o.plugin=i,o.options=r,o}function dN(e,t=!1){return n=>{let r=n.get(hb),i=n.get(hY)(e);if(!i)return;if(!t){let{state:e}=r;return r.dispatch(e.tr.replace(0,e.doc.content.size,new lt(i.content,0,0)))}let o=n.get(h_),l=n.get(h7)({schema:o,doc:i,plugins:n.get(hS)}),s=sL.create(l);r.updateState(s)}}let dD={encodeCharacter:e=>e,encodeNodeStart:e=>e.type.name,encodeNodeEnd:e=>{var t;let n,r;return-(null==(r=(n=(t=e.type).schema.cached.changeSetIDs||(t.schema.cached.changeSetIDs=Object.create(null)))[t.name])&&(n[t.name]=r=Object.keys(t.schema.nodes).indexOf(t.name)+1),r)},compareTokens:(e,t)=>e===t};function dI(e,t,n,r,i){for(let o=0,l=0;o<e.childCount;o++){let s=e.child(o),a=l+s.nodeSize,c=Math.max(l,n),u=Math.min(a,r);if(c<u)if(s.isText)for(let e=c;e<u;e++)i.push(t.encodeCharacter(s.text.charCodeAt(e-l),s.marks));else s.isLeaf?i.push(t.encodeNodeStart(s)):(c==l&&i.push(t.encodeNodeStart(s)),dI(s.content,t,Math.max(l+1,c)-l-1,Math.min(a-1,u)-l-1,i),u==a&&i.push(t.encodeNodeEnd(s)));l=a}return i}function dL(e,t,n,r=dD){let i=dI(e,r,n.fromA,n.toA,[]),o=dI(t,r,n.fromB,n.toB,[]),l=0,s=i.length,a=o.length,c=r.compareTokens;for(;l<i.length&&l<o.length&&c(i[l],o[l]);)l++;if(l==i.length&&l==o.length)return[];for(;s>l&&a>l&&c(i[s-1],o[a-1]);)s--,a--;if(s==l||a==l||s==a&&s==l+1)return[n.slice(l,s,l,a)];let u=s-l,h=a-l,d=Math.min(5e3,u+h),p=[],f=[];for(let e=2*(d+1),t=0;t<e;t++)f[t]=-1;for(let e=0;e<=d;e++){for(let t=-e;t<=e;t+=2){let r=f[t+1+d],m=f[t-1+d],g=r<m?m:r+1,y=g+t;for(;g<u&&y<h&&c(i[l+g],o[l+y]);)g++,y++;if(f[t+d]=g,g>=u&&y>=h){let r=[],i=Math.min(15,Math.max(2,Math.floor(Math.max(s-l,a-l)/10))),o=-1,c=-1,u=-1,h=-1,m=(e,t,l,s)=>{o>-1&&o<t+i?(o=e,u=l):(o>-1&&r.push(n.slice(o,c,u,h)),o=e,c=t,u=l,h=s)};for(let n=e-1;n>=0;n--){let e=f[t+1+d],r=f[t-1+d];e<r?(t--,y=(g=r+l)+t,m(g,g,y,y+1)):(t++,y=(g=e+l)+t,m(g,g+1,y,y)),f=p[n>>1]}return o>-1&&r.push(n.slice(o,c,u,h)),r.reverse()}}e%2==0&&p.push(f.slice())}return[n.slice(l,s,l,a)]}class d_{constructor(e,t){this.length=e,this.data=t}cut(e){return e==this.length?this:new d_(e,this.data)}static slice(e,t,n){if(t==n)return d_.none;if(0==t&&n==d_.len(e))return e;let r=[];for(let i=0,o=0;o<n;i++){let l=e[i],s=o+l.length,a=Math.min(n,s)-Math.max(t,o);a>0&&r.push(l.cut(a)),o=s}return r}static join(e,t,n){if(0==e.length)return t;if(0==t.length)return e;let r=n(e[e.length-1].data,t[0].data);if(null==r)return e.concat(t);let i=e.slice(0,e.length-1);i.push(new d_(e[e.length-1].length+t[0].length,r));for(let e=1;e<t.length;e++)i.push(t[e]);return i}static len(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;return t}}d_.none=[];class dR{constructor(e,t,n,r,i,o){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r,this.deleted=i,this.inserted=o}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(e,t,n,r){return 0==e&&0==n&&t==this.toA-this.fromA&&r==this.toB-this.fromB?this:new dR(this.fromA+e,this.fromA+t,this.fromB+n,this.fromB+r,d_.slice(this.deleted,e,t),d_.slice(this.inserted,n,r))}static merge(e,t,n){if(0==e.length)return t;if(0==t.length)return e;let r=[];for(let i=0,o=0,l=e[0],s=t[0];;)if(!l&&!s)return r;else if(l&&(!s||l.toB<s.fromA)){let n=o?t[o-1].toB-t[o-1].toA:0;r.push(0==n?l:new dR(l.fromA,l.toA,l.fromB+n,l.toB+n,l.deleted,l.inserted)),l=i++==e.length?null:e[i]}else if(s&&(!l||s.toA<l.fromB)){let n=i?e[i-1].toB-e[i-1].toA:0;r.push(0==n?s:new dR(s.fromA-n,s.toA-n,s.fromB,s.toB,s.deleted,s.inserted)),s=o++==t.length?null:t[o]}else{let a=Math.min(l.fromB,s.fromA),c=Math.min(l.fromA,s.fromA-(i?e[i-1].toB-e[i-1].toA:0)),u=c,h=Math.min(s.fromB,l.fromB+(o?t[o-1].toB-t[o-1].toA:0)),d=h,p=d_.none,f=d_.none,m=!1,g=!1;for(;;){let r=Math.min(l?a>=l.fromB?l.toB:l.fromB:2e8,s?a>=s.fromA?s.toA:s.fromA:2e8),c=l&&a>=l.fromB,h=s&&a>=s.fromA;if(!c&&!h)break;c&&a==l.fromB&&!m&&(p=d_.join(p,l.deleted,n),u+=l.lenA,m=!0),c&&!h&&(f=d_.join(f,d_.slice(l.inserted,a-l.fromB,r-l.fromB),n),d+=r-a),h&&a==s.fromA&&!g&&(f=d_.join(f,s.inserted,n),d+=s.lenB,g=!0),h&&!c&&(p=d_.join(p,d_.slice(s.deleted,a-s.fromA,r-s.fromA),n),u+=r-a),c&&r==l.toB&&(l=i++==e.length?null:e[i],m=!1),h&&r==s.toA&&(s=o++==t.length?null:t[o],g=!1),a=r}(c<u||h<d)&&r.push(new dR(c,u,h,d,p,f))}}static fromJSON(e){return new dR(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(e=>new d_(e.length,e.data)),e.inserted.map(e=>new d_(e.length,e.data)))}toJSON(){return this}}try{RegExp("[\\p{Alphabetic}_]","u")}catch(e){}class dz{constructor(e,t){this.config=e,this.changes=t}addSteps(e,t,n){let r=[];for(let e=0;e<t.length;e++){let i=Array.isArray(n)?n[e]:n,o=0;t[e].forEach((e,t,n,l)=>{r.push(new dR(e+o,t+o,n,l,e==t?d_.none:[new d_(t-e,i)],n==l?d_.none:[new d_(l-n,i)])),o=l-n-(t-e)})}if(0==r.length)return this;let i=function e(t,n,r=0,i=t.length){if(i==r+1)return[t[r]];let o=r+i>>1;return dR.merge(e(t,n,r,o),e(t,n,o,i),n)}(r,this.config.combine),o=dR.merge(this.changes,i,this.config.combine),l=o;for(let t=0;t<l.length;t++){let n=l[t];if(n.fromA==n.toA||n.fromB==n.toB||!i.some(e=>e.toB>n.fromB&&e.fromB<n.toB))continue;let r=dL(this.config.doc.content,e.content,n,this.config.encoder);(1!=r.length||0!=r[0].fromB||r[0].toB!=n.toB-n.fromB)&&(l==o&&(l=o.slice()),1==r.length?l[t]=r[0]:(l.splice(t,1,...r),t+=r.length-1))}return new dz(this.config,l)}get startDoc(){return this.config.doc}map(e){let t=t=>{let n=e(t);return n===t.data?t:new d_(t.length,n)};return new dz(this.config,this.changes.map(e=>new dR(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(t),e.inserted.map(t))))}changedRange(e,t){if(e==this)return null;let n=t&&function(e){let t=dP(e);if(!t)return null;let n=dP(e.map(e=>e.invert()).reverse());return{fromA:n.from,toA:n.to,fromB:t.from,toB:t.to}}(t),r=n?n.toB-n.fromB-(n.toA-n.fromA):0;function i(e){return!n||e<=n.fromA?e:e+r}let o=n?n.fromB:2e8,l=n?n.toB:-2e8;function s(e,t=e){o=Math.min(e,o),l=Math.max(t,l)}let a=this.changes,c=e.changes;for(let e=0,t=0;e<a.length&&t<c.length;){var u,h,d;let n=a[e],r=c[t];n&&r&&(u=n,h=r,(d=i)(u.fromB)==h.fromB&&d(u.toB)==h.toB&&dB(u.deleted,h.deleted)&&dB(u.inserted,h.inserted))?(e++,t++):r&&(!n||i(n.fromB)>=r.fromB)?(s(r.fromB,r.toB),t++):(s(i(n.fromB),i(n.toB)),e++)}return o<=l?{from:o,to:l}:null}static create(e,t=(e,t)=>e===t?e:null,n=dD,r=[]){return new dz({combine:t,doc:e,encoder:n},r)}}function dP(e){let t=2e8,n=-2e8;for(let r=0;r<e.length;r++){let i=e[r];2e8!=t&&(t=i.map(t,-1),n=i.map(n,1)),i.forEach((e,r,i,o)=>{t=Math.min(t,i),n=Math.max(n,o)})}return 2e8==t?null:{from:t,to:n}}function dB(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].length!=t[n].length||e[n].data!==t[n].data)return!1;return!0}function dF(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-diff",...t}}),e}function dH(e,t,n){let r=[],i=0;return e.content.forEach(e=>{r.push({node:e,offset:i,size:e.nodeSize,signature:function e(t,n,r){let i=r.get(t);if(null!=i)return i;let o=[String(n.encodeNodeStart(t))];if(t.isText){let e=t.text;for(let r=0;r<e.length;r++)o.push(":"+String(n.encodeCharacter(e.charCodeAt(r),t.marks)))}else t.content.forEach(t=>{o.push("/"+e(t,n,r))});o.push("\\"+String(n.encodeNodeEnd(t)));let l=o.join("");return r.set(t,l),l}(e,n.encoder,n.sigCache)}),i+=e.nodeSize}),{node:e,contentStart:t,content:r}}function dq(e,t,n){return dR.fromJSON({fromA:e.fromA+t,toA:e.toA+t,fromB:e.fromB+n,toB:e.toB+n,deleted:e.deleted.map(e=>({length:e.length,data:e.data})),inserted:e.inserted.map(e=>({length:e.length,data:e.data}))})}function dj(e,t){let n=e.content;if(t<n.length)return e.contentStart+n[t].offset;if(t>0){let r=n[t-1];return e.contentStart+r.offset+r.size}return e.contentStart+e.node.content.size}function dV(e,t,n,r,i){if(e.childCount>500||t.childCount>500){let o;return o=new l4(0,e.content.size,new lt(t.content,0,0)),dz.create(e,void 0,i.encoder).addSteps(t,[o.getMap()],null).changes.map(e=>dq(e,n,r))}let o=dH(e,n,i),l=dH(t,r,i),s=function(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array.from({length:r+1},()=>0));for(let o=n-1;o>=0;o--)for(let n=r-1;n>=0;n--)e[o].signature===t[n].signature?i[o][n]=i[o+1][n+1]+1:i[o][n]=Math.max(i[o+1][n],i[o][n+1]);let o=[],l=0,s=0;for(;l<n&&s<r;)e[l].signature===t[s].signature?(o.push([l,s]),l++,s++):i[l+1][s]>=i[l][s+1]?l++:s++;return o}(o.content,l.content),a=[],c=0,u=0;for(let[e,t]of s)d$(o,l,{oldStart:c,oldEnd:e,newStart:u,newEnd:t},i,a),c=e+1,u=t+1;return d$(o,l,{oldStart:c,oldEnd:o.content.length,newStart:u,newEnd:l.content.length},i,a),a}function d$(e,t,n,r,i){let o=e.content,l=t.content,s=n.oldStart,a=n.newStart;for(;s<n.oldEnd||a<n.newEnd;){var c,u;let h=s<n.oldEnd?o[s]:null,d=a<n.newEnd?l[a]:null,p=h&&d&&h.node.type===d.node.type;if(h&&d&&p){i.push(...function(e,t,n,r,i){var o,l,s,a,c;let u=e.contentStart+n.offset,h=t.contentStart+r.offset;if(!(function(e,t){if(e.type!==t.type)return!1;let n=e.type;return!n.isTextblock&&!n.isAtom&&!0!==n.spec.code&&!!n.isBlock}(n.node,r.node)&&(o=n.node,l=r.node,(s=i.encoder).encodeNodeStart(o)===s.encodeNodeStart(l)))){let o,l,s;return a={node:n.node,parent:e.node,abs:u},c={node:r.node,parent:t.node,abs:h},o=a.parent.copy(o3.from(a.node)),l=c.parent.copy(o3.from(c.node)),s=new l4(0,o.content.size,new lt(l.content,0,0)),dz.create(o,void 0,i.encoder).addSteps(l,[s.getMap()],null).changes.map(e=>dq(e,a.abs,c.abs))}return dV(n.node,r.node,u+1,h+1,i)}(e,t,h,d,r)),s++,a++;continue}if(h&&(!d||!p)){let n=e.contentStart+h.offset;i.push((c=dj(t,a),dR.fromJSON({fromA:n,toA:n+h.size,fromB:c,toB:c,deleted:[{length:h.size,data:null}],inserted:[]}))),s++;continue}if(d){let n=t.contentStart+d.offset;i.push((u=dj(e,s),dR.fromJSON({fromA:u,toA:u,fromB:n,toB:n+d.size,deleted:[],inserted:[{length:d.size,data:null}]}))),a++}}}function dW(e,t,n){let r=function(e={}){let t=new WeakMap,n=new WeakMap;function r(e){let n=t.get(e);if(null!=n)return n;let r=e.attrs,i=r?Object.keys(r).filter(e=>null!=r[e]).sort():[];if(0===i.length)n=e.type.name;else{let t={};for(let e of i)t[e]=r[e];n=`${e.type.name}:${JSON.stringify(t)}`}return t.set(e,n),n}return{encodeCharacter:(e,t)=>{if(0===t.length)return e;let i=n.get(t);return null==i&&(i=t.map(r).join(","),n.set(t,i)),`${e}:${i}`},encodeNodeStart:t=>{let n=t.attrs;if(n&&Object.keys(n).length>0){let r=e[t.type.name]??[],i=Object.keys(n).filter(e=>{if(r.includes(e))return!1;let i=t.type.spec.attrs?.[e]?.default;return n[e]!==i});if(i.length>0){let e={};for(let t of i.sort())e[t]=n[t];return`${t.type.name}:${JSON.stringify(e)}`}}return t.type.name},encodeNodeEnd:e=>{let t=e.type.schema,n=t.cached.changeSetIDs||(t.cached.changeSetIDs=Object.create(null)),r=n[e.type.name];return null==r&&(n[e.type.name]=r=Object.keys(t.nodes).indexOf(e.type.name)+1),-r},compareTokens:(e,t)=>e===t}}(n?.ignoreAttrs),i={encoder:r,sigCache:new WeakMap},o=e.content.size,l=t.content.size,s=n?.range;if(null==s)return dV(e,t,0,0,i);let a=Math.min(o,l),c=Math.max(0,Math.min(s.from??0,a)),u=Math.max(c,Math.min(s.to??a,a));if(c===u)return[];if(0===c&&u===a&&o===l)return dV(e,t,0,0,i);let h=function(e,t,n,r,i){let o=e.resolve(n),l=e.resolve(r),s=t.resolve(n),a=t.resolve(r),c=o.sharedDepth(r);if(s.sharedDepth(r)!==c)throw RangeError(`computeDocDiff: range [${n}, ${r}) resolves to different sharedDepth in old and new docs`);for(let e=0;e<=c;e++){if(i.encodeNodeStart(o.node(e))!==i.encodeNodeStart(s.node(e)))throw RangeError(`computeDocDiff: ancestor at depth ${e} differs in type or non-ignored attrs along the path to the shared ancestor`);if(o.start(e)!==s.start(e))throw RangeError(`computeDocDiff: ancestor at depth ${e} starts at different absolute positions in old and new docs (content before the range differs in size)`)}let u=o.node(c);if(u.isTextblock)throw RangeError(`computeDocDiff: range [${n}, ${r}) lands inside a textblock; widen the range to a block boundary`);if(o.depth!==c||l.depth!==c||s.depth!==c||a.depth!==c)throw RangeError(`computeDocDiff: range [${n}, ${r}) endpoints must be aligned to child boundaries of the shared ancestor`);let h=s.node(c),d=o.start(c),p=n-d,f=r-d;return{oldCut:u.copy(u.content.cut(p,f)),newCut:h.copy(h.content.cut(p,f)),cutAbsStart:n}}(e,t,c,u,r);return dV(h.oldCut,h.newCut,h.cutAbsStart,h.cutAbsStart,i)}dz.computeDiff=dL;var dU=dC({ignoreAttrs:{heading:["id"]}},"diffConfig");dF(dU,{displayName:"Ctx<diffConfig>",group:"Diff"});var dG=new sP("MILKDOWN_DIFF");function dK(e){return e.changes.filter(t=>!e.rejectedRanges.some(e=>t.fromB<e.toB&&t.toB>e.fromB))}var dJ=dw(e=>{let t=e.get(dU.key);return new s_({key:dG,state:{init:()=>null,apply(e,n,r,i){var o,l,s;let a,c,u=e.getMeta(dG);if(!n){if(u?.type==="start"){let e=dW(i.doc,u.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:u.newDoc,changes:e,rejectedRanges:[],active:!0}}return null}let h=n;if(e.docChanged&&h.active&&(o=i.doc,l=h,s={ignoreAttrs:t.ignoreAttrs},c=dW(o,l.newDoc,s),h={...l,changes:c}),!u)return h;switch(u.type){case"start":{let e=dW(i.doc,u.newDoc,{ignoreAttrs:t.ignoreAttrs});return{newDoc:u.newDoc,changes:e,rejectedRanges:[],active:!0}}case"accept":case"acceptRange":a=h;break;case"reject":a={...h,rejectedRanges:[...h.rejectedRanges,{fromB:u.fromB,toB:u.toB}]};break;case"rejectRange":a={...h,rejectedRanges:[...h.rejectedRanges,{fromB:u.range.fromB,toB:u.range.toB}]};break;case"acceptAll":case"clear":return null;default:return h}return a.active&&0===dK(a).length?null:a}},filterTransaction:(e,t)=>!!(!dG.getState(t)?.active||e.getMeta(dG))||!e.docChanged})});dF(dJ,{displayName:"Prose<diff>",group:"Diff"});var dZ=dv("StartDiffReview",e=>t=>(n,r)=>{if(null==t)return!1;let i=e.get(hY)(t);return!!i&&(r&&r(n.tr.setMeta(dG,{type:"start",newDoc:i})),!0)});dF(dZ,{displayName:"Command<startDiffReview>",group:"Diff"});var dY=dv("StartDiffReviewFromDoc",()=>e=>(t,n)=>!!e&&e.type===t.doc.type&&(n&&n(t.tr.setMeta(dG,{type:"start",newDoc:e})),!0));dF(dY,{displayName:"Command<startDiffReviewFromDoc>",group:"Diff"});var dX=dv("AcceptDiffChunk",()=>e=>(t,n)=>{if(null==e)return!1;let r=dG.getState(t);if(!r)return!1;let i=dK(r)[e];if(!i)return!1;if(n){let o=r.newDoc.slice(i.fromB,i.toB),l=t.tr.replace(i.fromA,i.toA,o);n(l=l.setMeta(dG,{type:"accept",changeIndex:e}))}return!0});dF(dX,{displayName:"Command<acceptDiffChunk>",group:"Diff"});var dQ=dv("RejectDiffChunk",()=>e=>(t,n)=>{if(null==e)return!1;let r=dG.getState(t);if(!r)return!1;let i=dK(r)[e];return!!i&&(n&&n(t.tr.setMeta(dG,{type:"reject",fromB:i.fromB,toB:i.toB})),!0)});dF(dQ,{displayName:"Command<rejectDiffChunk>",group:"Diff"});var d0=dv("AcceptDiffRange",()=>e=>(t,n)=>{if(!e)return!1;let r=dG.getState(t);if(!r)return!1;if(n){let i=r.newDoc.slice(e.fromB,e.toB),o=t.tr.replace(e.fromA,e.toA,i);n(o=o.setMeta(dG,{type:"acceptRange",range:e}))}return!0});dF(d0,{displayName:"Command<acceptDiffRange>",group:"Diff"});var d1=dv("RejectDiffRange",()=>e=>(t,n)=>!!e&&!!dG.getState(t)&&(n&&n(t.tr.setMeta(dG,{type:"rejectRange",range:e})),!0));dF(d1,{displayName:"Command<rejectDiffRange>",group:"Diff"});var d4=dv("AcceptAllDiffs",()=>()=>(e,t)=>{let n=dG.getState(e);return!!n&&(t&&t((0===n.rejectedRanges.length?e.tr.replaceWith(0,e.doc.content.size,n.newDoc.content):function(e,t){let n=dK(t);for(let r=n.length-1;r>=0;r--){let i=n[r],o=t.newDoc.slice(i.fromB,i.toB);e=e.replace(i.fromA,i.toA,o)}return e}(e.tr,n)).setMeta(dG,{type:"acceptAll"})),!0)});dF(d4,{displayName:"Command<acceptAllDiffs>",group:"Diff"});var d5=dv("ClearDiffReview",()=>()=>(e,t)=>!!dG.getState(e)&&(t&&t(e.tr.setMeta(dG,{type:"clear"})),!0));dF(d5,{displayName:"Command<clearDiffReview>",group:"Diff"});var d2=[dU,dJ,dZ,dY,dX,d0,dQ,d1,d4,d5],d3=Object.defineProperty,d7=Object.getOwnPropertySymbols,d6=Object.prototype.hasOwnProperty,d8=Object.prototype.propertyIsEnumerable,d9=(e,t,n)=>t in e?d3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function pe(e,t){return Object.assign(e,{meta:((e,t)=>{for(var n in t||(t={}))d6.call(t,n)&&d9(e,n,t[n]);if(d7)for(var n of d7(t))d8.call(t,n)&&d9(e,n,t[n]);return e})({package:"@milkdown/components"},t)}),e}let pt="milkdown-diff",pn=dC({acceptLabel:"Accept",rejectLabel:"Reject",customBlockTypes:[]},"diffComponentConfig");function pr(e,t,n){if(t>=n)return!1;let r=e.resolve(t),i=e.resolve(n);if(r.sameParent(i)&&r.parent.isTextblock)return!1;let o=!1;return e.nodesBetween(t,n,(e,r)=>{if(o)return!1;if(!e.isBlock)return!0;let i=r+e.nodeSize;return!(r>=t)||!(i<=n)||(o=!0,!1)}),o}function pi(e,t){let n=e.resolve(t);for(let e=n.depth;e>=1;e--)if(n.node(e).isTextblock)return n.before(e);return t}function po(e,t,n,r){let i=0;for(let o=0;o<e.childCount;o++){let l=e.child(o),s=i+l.nodeSize;if(i>=n)break;s>t&&i<n&&r(l,i,s),i=s}}function pl(e,t,n,r){po(e,t,n,(t,n,i)=>{(i!==e.content.size||"paragraph"!==t.type.name||0!==t.content.size)&&r.push(uJ.node(n,i,{class:`${pt}-removed-block`}))})}function ps(e,t,n=!1){if(t<0||t>e.content.size)return null;let r=e.resolve(Math.min(t,e.content.size));if(r.depth>=1)return{from:r.before(1),to:r.after(1)};if(n){let e=r.nodeBefore;if(e)return{from:t-e.nodeSize,to:t};let n=r.nodeAfter;if(n)return{from:t,to:t+n.nodeSize}}else{let e=r.nodeAfter;if(e)return{from:t,to:t+e.nodeSize};let n=r.nodeBefore;if(n)return{from:t-n.nodeSize,to:t}}return null}function pa(e,t,n){if(t<0||t>e.content.size)return null;let r=e.resolve(Math.min(t,e.content.size));for(let e=r.depth;e>=0;e--){let t=r.node(e).type.name;if(n.has(t))return t}return null}function pc(e,t,n,r=!1){let i=pa(e,t,n);if(i)return i;let o=e.resolve(Math.min(Math.max(t,0),e.content.size)),l=r?o.nodeBefore:o.nodeAfter;return l&&n.has(l.type.name)?l.type.name:null}pe(pn,{displayName:"Ctx<diffComponentConfig>",group:"DiffComponent"});function pu(e,t,n,r){return t===n?null!=pa(e,t,r):null!=pc(e,t,r)||null!=pc(e,n,r,!0)}function ph(e,t,n,r){return t===n?null==pa(e,t,r)?null:ps(e,t):null!=pc(e,t,r)?ps(e,t):null!=pc(e,n,r,!0)?ps(e,n,!0):null}let pd=new sP("MILKDOWN_DIFF_DECORATION"),pp=dw(e=>{let t=e.get(pn.key);return new s_({key:pd,state:{init:()=>uX.empty,apply(n,r,i,o){let l=dG.getState(o);return(null==l?void 0:l.active)?n.getMeta(dG)||n.docChanged?function(e,t,n,r){let i=[],o=e.get(hH),l=new Set(r.customBlockTypes),s=function(e,t,n,r){var i,o,l,s,a,c,u,h,d,p,f,m,g,y,b,w;let x=[],k=new Set;for(let C=0;C<e.length;C++){if(k.has(C))continue;let S=e[C];if(!(pu(t,S.fromA,S.toA,r)||pu(n,S.fromB,S.toB,r))){x.push({fromA:S.fromA,toA:S.toA,fromB:S.fromB,toB:S.toB,isCustomBlock:!1});continue}let M=ph(t,S.fromA,S.toA,r),A=ph(n,S.fromB,S.toB,r),T={fromA:Math.min(null!=(i=null==M?void 0:M.from)?i:S.fromA,S.fromA),toA:Math.max(null!=(o=null==M?void 0:M.to)?o:S.toA,S.toA),fromB:Math.min(null!=(l=null==A?void 0:A.from)?l:S.fromB,S.fromB),toB:Math.max(null!=(s=null==A?void 0:A.to)?s:S.toB,S.toB),isCustomBlock:!0};k.add(C);for(let t=C+1;t<e.length;t++){if(k.has(t))continue;let n=e[t],r=M&&(a=n.fromA,c=n.toA,u=M.from,a<M.to&&c>u),i=A&&(h=n.fromB,d=n.toB,p=A.from,h<A.to&&d>p);(r||i)&&(k.add(t),T.fromA=Math.min(T.fromA,n.fromA),T.toA=Math.max(T.toA,n.toA),T.fromB=Math.min(T.fromB,n.fromB),T.toB=Math.max(T.toB,n.toB))}let O=[];for(let e=0;e<x.length;e++){let t=x[e];if(!t.isCustomBlock)continue;let n=(f=T.fromA,m=T.toA,g=t.fromA,f<t.toA&&m>g),r=(y=T.fromB,b=T.toB,w=t.fromB,y<t.toB&&b>w);(n||r)&&(T.fromA=Math.min(T.fromA,t.fromA),T.toA=Math.max(T.toA,t.toA),T.fromB=Math.min(T.fromB,t.fromB),T.toB=Math.max(T.toB,t.toB),O.push(e))}for(let e=O.length-1;e>=0;e--)x.splice(O[e],1);x.push(T)}return x}(dK(n),t,n.newDoc,l),a=function(e){let t=e.content.size;for(let n=e.childCount-1;n>=0;n--){let r=e.child(n);if("paragraph"!==r.type.name||r.content.size>0)break;t-=r.nodeSize}return t}(t);if(a!==t.content.size)for(let e of s)e.fromA===e.toA&&e.fromB<e.toB&&e.fromA>=a&&(e.fromA=a,e.toA=a);for(let e=0;e<s.length;e++){let l=s[e],a=l.fromA<l.toA,c=l.fromB<l.toB;if(a&&!c&&function(e,t,n){if(n!==e.content.size)return!1;let r=e.resolve(t);if(0!==r.depth)return!1;for(let t=r.index(0);t<e.childCount;t++){let n=e.child(t);if("paragraph"!==n.type.name||n.content.size>0)return!1}return!0}(t,l.fromA,l.toA))continue;let u=a&&function(e,t,n){if(t===n)return!1;let r=e.resolve(t),i=e.resolve(n);return r.index(0)!==(0===i.depth?Math.max(0,i.index(0)-1):i.index(0))}(t,l.fromA,l.toA),h=a&&pr(t,l.fromA,l.toA),d=c&&pr(n.newDoc,l.fromB,l.toB),p=a&&!u&&!h&&!l.isCustomBlock&&!d,f=(u||h||d)&&!p;if(f&&!l.isCustomBlock){let s=function(e,t,n){let r,i=e.resolve(n.fromA);if(!i.parent.isTextblock||i.depth<1||!i.node(1).isTextblock)return null;let o=i.after(1),l=t.resolve(n.fromB);if(l.depth>=1&&l.node(1).isTextblock?(r=l.after(1))>n.toB&&(r=n.toB):r=n.fromB,o>=n.toA&&r>=n.toB)return null;let s=[];return(o>n.fromA||r>n.fromB)&&s.push({fromA:n.fromA,toA:Math.min(o,n.toA),fromB:n.fromB,toB:r,isBlock:!1}),(n.toA>o||n.toB>r)&&s.push({fromA:o,toA:Math.max(o,n.toA),fromB:r,toB:n.toB,isBlock:!0}),s.length>1?s:null}(t,n.newDoc,l);if(s){!function({doc:e,newDoc:t,segments:n,change:r,changeIndex:i,commands:o,acceptLabel:l,rejectLabel:s,decorations:a}){for(let r=0;r<n.length;r++){let o=n[r],l=o.fromA<o.toA,s=o.fromB<o.toB;if(l&&(o.isBlock?pl(e,o.fromA,o.toA,a):a.push(uJ.inline(o.fromA,o.toA,{class:`${pt}-removed`}))),s){let n=o.isBlock?pi(e,l?o.toA:o.fromA):l?o.toA:o.fromA,s=pf(t,o,o.isBlock);a.push(uJ.widget(n,s,{side:-1,key:`added-${i}-${r}`}))}}let c=n[n.length-1],u=pi(e,c.isBlock?c.fromA<c.toA?c.toA:c.fromA:r.toA),h=pm({commands:o,isBlockLevel:!0,change:r,acceptLabel:l,rejectLabel:s});a.push(uJ.widget(u,h,{side:-1,key:`controls-${i}`}))}({doc:t,newDoc:n.newDoc,segments:s,change:l,changeIndex:e,commands:o,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel,decorations:i});continue}}a&&(l.isCustomBlock||f?pl(t,l.fromA,l.toA,i):i.push(uJ.inline(l.fromA,l.toA,{class:`${pt}-removed`})));let m=a?l.toA:l.fromA,g=f?pi(t,m):m;if(c){let t=pf(n.newDoc,l,f);i.push(uJ.widget(g,t,{side:-1,key:`added-${e}`}))}let y=pm({commands:o,isBlockLevel:f,change:l,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel});i.push(uJ.widget(g,y,{side:f?-1:1,key:`controls-${e}`}))}return uX.create(t,i)}(e,o.doc,l,t):r.map(n.mapping,n.doc):uX.empty}},props:{decorations(e){var t;return null!=(t=pd.getState(e))?t:uX.empty}}})});function pf(e,t,n){var r,i,o;let l=document.createElement(n?"div":"span");l.className=`${pt}-added`,l.contentEditable="false",n&&l.classList.add(`${pt}-added-block`);let s=lH.fromSchema(e.type.schema);if(n){let n,r,a,c,u=(i=t.fromB,o=t.toB,n=[],r=!0,a=-1,c=-1,po(e,i,o,(e,t,r)=>{-1===a&&(a=t),c=r,n.push(e)}),(0===n.length||a!==i||c!==o)&&(r=!1),r?n:[]);if(u.length>0){let e=document.createDocumentFragment();for(let t of u)e.appendChild(s.serializeNode(t));return l.appendChild(e),l}}let a=e.slice(t.fromB,t.toB),c=s.serializeFragment(a.content);if(l.appendChild(c),!(null==(r=l.textContent)?void 0:r.trim())&&!l.querySelector("img, video, audio, canvas, svg")){let n=e.textBetween(t.fromB,t.toB,"\n","\n");n.trim()&&(l.textContent=n)}return l}function pm({commands:e,isBlockLevel:t,change:n,acceptLabel:r,rejectLabel:i}){let o=document.createElement(t?"div":"span");o.className=`${pt}-controls`,o.contentEditable="false",t&&o.classList.add(`${pt}-controls-block`);let l=t=>r=>{r.preventDefault(),r.stopPropagation();let i={fromA:n.fromA,toA:n.toA,fromB:n.fromB,toB:n.toB},o="accept"===t?d0.key:d1.key;e.call(o,i)},s=document.createElement("button");s.className=`${pt}-accept`,s.textContent=r,s.addEventListener("click",l("accept"));let a=document.createElement("button");return a.className=`${pt}-reject`,a.textContent=i,a.addEventListener("click",l("reject")),o.appendChild(s),o.appendChild(a),o}pe(pp,{displayName:"Prose<diffDecoration>",group:"DiffComponent"});let pg=[pn,pp];function pv(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-streaming",...t}}),e}var py=dC({throttleMs:100,scrollFollow:!0,diffReviewOnEnd:!1,ignoreAttrs:{heading:["id"]}},"streamingConfig");function pb(e){if(0===e.childCount)return e;let t=e.lastChild;return"paragraph"===t.type.name&&0===t.content.size?e.cut(0,e.size-t.nodeSize):e}pv(py,{displayName:"Ctx<streamingConfig>",group:"Streaming"});var pw=/[*_~`[\\<]/;function px(e,t,n){if(!n)return o3.empty;if(!pw.test(n))return o3.from(t.text(n));let r=e.get(hY)(n)?.firstChild;if(r?.type.name!=="paragraph"||0===r.content.size)return o3.from(t.text(n));let i=!1;if(r.content.forEach(e=>{(!e.isText||e.marks.length>0)&&(i=!0)}),!i)return o3.from(t.text(n));let o=r.content,l=/^\s+/.exec(n)?.[0];l&&!(o.firstChild?.isText?o.firstChild.text??"":"").startsWith(l)&&(o=o3.from(t.text(l)).append(o));let s=/\s+$/.exec(n)?.[0];return s&&!(o.lastChild?.isText?o.lastChild.text??"":"").endsWith(s)&&(o=o.append(o3.from(t.text(s)))),o}function pk(e,t,n){if(null!=n.insertPos){let r=n.insertPos,i=function(e,t,n){let{insertPos:r,currentEndPos:i}=n,o=n.buffer.replace(/\r\n?/g,"\n");if(!o)return{tr:t,applied:!1,insertEndPos:i};let l=t.doc.content.size,s=Math.max(0,Math.min(r,l)),a=Math.max(s,Math.min(i,l)),c=t.doc.resolve(s),u=(e.get(py.key).insertStrategy??function(e){if(e.parent.type.spec.code)return{type:"plain-text",preserveNewlines:!0};for(let t=e.depth;t>0;t--)if("table"===e.node(t).type.name)return{type:"plain-text",preserveNewlines:!1};return e.depth>=1?{type:"split-block"}:{type:"block"}})(c),h={ctx:e,tr:t,buffer:o,from:s,to:a,resolved:c};switch(u.type){case"plain-text":return function({tr:e,buffer:t,from:n,to:r},i){let o=i?t:t.replace(/\n/g," "),l=e.doc.type.schema.text(o);return{tr:e=e.replaceWith(n,r,l),applied:!0,insertEndPos:n+o.length}}(h,u.preserveNewlines??!1);case"split-block":return function({ctx:e,tr:t,buffer:n,from:r,to:i,resolved:o}){let l=t.doc.type.schema,s=n.indexOf("\n");if(s<0){let o=px(e,l,n);return{tr:t=t.replaceWith(r,i,o),applied:!0,insertEndPos:r+o.size}}let a=n.substring(0,s),c=n.substring(s+1),u=e.get(hY),h=c.trim()?u(c):null,d=h?pb(h.content):o3.empty;if(0===d.childCount){let o=px(e,l,n.replace(/\n/g," "));return{tr:t=t.replaceWith(r,i,o),applied:!0,insertEndPos:r+o.size}}let p=o.depth,f=px(e,l,a);for(let e=p;e>0;e--)f=o3.from(o.node(e).copy(f));let m=f.append(d),g=new lt(m,p,0),y=t.doc.content.size,b=t.doc.resolve(Math.min(i,y)),w=i;return p>0&&b.depth===p&&b.parentOffset===b.parent.content.size&&(w=b.after(p)),{tr:t=t.replace(r,w,g),applied:!0,insertEndPos:r+(m.size-p)}}(h);case"block":return function({ctx:e,tr:t,buffer:n,from:r,to:i}){let o=e.get(hY)(n);if(!o)return{tr:t,applied:!1,insertEndPos:i};let l=pb(o.content);return 0===l.size?{tr:t,applied:!1,insertEndPos:i}:{tr:t=t.replace(r,i,new lt(l,0,0)),applied:!0,insertEndPos:r+l.size}}(h)}}(e,t,{buffer:n.buffer,insertPos:r,currentEndPos:n.insertEndPos??r});return{tr:i.tr,newDoc:i.applied?i.tr.doc:null,insertEndPos:i.insertEndPos}}return function(e,t,n){let r=e.get(hY)(n);if(!r)return{tr:t,newDoc:null};let i=e.get(py.key).ignoreAttrs,o=dW(t.doc,r,i?{ignoreAttrs:i}:void 0);for(let e=o.length-1;e>=0;e--){let n=o[e],i=r.slice(n.fromB,n.toB);t=t.replace(n.fromA,n.toA,i)}return{tr:t,newDoc:r}}(e,t,n.buffer)}var pC=new sP("MILKDOWN_STREAMING"),pS=dw(e=>{let t=e.get(py.key);return new s_({key:pC,state:{init:()=>null,apply:(e,t)=>(function(e,t){if(!e&&t?.type!=="start")return null;if(!t)return e;switch(t.type){case"start":return{buffer:"",originalDoc:t.originalDoc,active:!0,lastApplyTime:t.lastApplyTime,insertPos:t.insertPos??null,insertEndPos:t.insertEndPos??t.insertPos??null};case"push":if(!e)return null;return{...e,buffer:e.buffer+t.token};case"apply":if(!e)return null;return{...e,lastApplyTime:t.lastApplyTime,insertEndPos:t.insertEndPos??e.insertEndPos};case"end":case"abort":return null;default:return e}})(t,e.getMeta(pC))},filterTransaction:(e,t)=>!!(!pC.getState(t)?.active||e.getMeta(pC))||!e.docChanged,view:()=>(function(e,t){let n=null,r=-1,i=null;function o(){if(!i)return;let n=pC.getState(i.state);if(!n?.active||n.buffer.length===r)return;r=n.buffer.length;let o=pk(e,i.state.tr,n);if(!o.newDoc)return;let l=o.tr;(l.docChanged||null!=o.insertEndPos)&&(l=l.setMeta(pC,{type:"apply",lastApplyTime:Date.now(),insertEndPos:o.insertEndPos}),t.scrollFollow&&(l=l.scrollIntoView()),i.dispatch(l))}return{update(e){i=e;let l=pC.getState(e.state);if(!l?.active){null!=n&&(clearTimeout(n),n=null),r=-1;return}l.buffer.length!==r&&(Date.now()-l.lastApplyTime>=t.throttleMs?o():(null!=n&&clearTimeout(n),n=setTimeout(o,t.throttleMs)))},destroy(){null!=n&&(clearTimeout(n),n=null),i=null}}})(e,t)})});pv(pS,{displayName:"Prose<streaming>",group:"Streaming"});var pM=dv("StartStreaming",()=>e=>(t,n)=>{if(pC.getState(t)?.active)return!1;if(n){let r,i;if(e?.insertAt!=null)if("selection"===e.insertAt){if(r=t.selection.from,i=t.selection.to,t.selection.empty){let e=t.doc.resolve(r);e.parent.isTextblock&&!e.parent.type.spec.code&&0===e.parent.content.size&&1===e.depth&&(r=e.before(e.depth),i=e.after(e.depth))}}else{let n="cursor"===e.insertAt?t.selection.head:e.insertAt;if(!Number.isFinite(n))return!1;r=Math.max(0,Math.min(Math.round(n),t.doc.content.size));let o=t.doc.resolve(r);o.parent.isTextblock&&!o.parent.type.spec.code&&0===o.parent.content.size&&1===o.depth&&(r=o.before(o.depth),i=o.after(o.depth))}n(t.tr.setMeta(pC,{type:"start",originalDoc:t.doc,insertPos:r,insertEndPos:i,lastApplyTime:Date.now()}))}return!0});pv(pM,{displayName:"Command<startStreaming>",group:"Streaming"});var pA=dv("PushChunk",()=>e=>(t,n)=>null!=e&&!!pC.getState(t)?.active&&(n&&n(t.tr.setMeta(pC,{type:"push",token:e})),!0));pv(pA,{displayName:"Command<pushChunk>",group:"Streaming"});var pT=dv("EndStreaming",e=>t=>(n,r)=>{let i=pC.getState(n);if(!i?.active)return!1;if(r){let o=e.get(py.key),l=t?.diffReview??o.diffReviewOnEnd,s=pk(e,n.tr,i),a=s.tr;if(a=a.setMeta(pC,{type:"end"}),l&&s.newDoc){let t=a.doc;r(a=a.replace(0,a.doc.content.size,new lt(i.originalDoc.content,0,0)));try{e.get(hH).call(dY.key,t)}catch(e){console.warn("[milkdown/streaming] diff review handoff skipped:",e)}return!0}r(a)}return!0});pv(pT,{displayName:"Command<endStreaming>",group:"Streaming"});var pO=dv("AbortStreaming",e=>t=>(n,r)=>{let i=pC.getState(n);if(!i?.active)return!1;if(r){let o=t?.keep??!1,l=n.tr;r(l=(l=o?pk(e,l,i).tr:l.replace(0,n.doc.content.size,new lt(i.originalDoc.content,0,0))).setMeta(pC,{type:"abort"}))}return!0});pv(pO,{displayName:"Command<abortStreaming>",group:"Streaming"});var pE=[py,pS,pM,pA,pT,pO];function pN(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let pD=Object.entries,pI=Object.setPrototypeOf,pL=Object.isFrozen,p_=Object.getPrototypeOf,pR=Object.getOwnPropertyDescriptor,pz=Object.freeze,pP=Object.seal,pB=Object.create,pF="u">typeof Reflect&&Reflect,pH=pF.apply,pq=pF.construct;pz||(pz=function(e){return e}),pP||(pP=function(e){return e}),pH||(pH=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)}),pq||(pq=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)});let pj=p8(Array.prototype.forEach),pV=p8(Array.prototype.lastIndexOf),p$=p8(Array.prototype.pop),pW=p8(Array.prototype.push),pU=p8(Array.prototype.splice),pG=Array.isArray,pK=p8(String.prototype.toLowerCase),pJ=p8(String.prototype.toString),pZ=p8(String.prototype.match),pY=p8(String.prototype.replace),pX=p8(String.prototype.indexOf),pQ=p8(String.prototype.trim),p0=p8(Number.prototype.toString),p1=p8(Boolean.prototype.toString),p4="u"<typeof BigInt?null:p8(BigInt.prototype.toString),p5="u"<typeof Symbol?null:p8(Symbol.prototype.toString),p2=p8(Object.prototype.hasOwnProperty),p3=p8(Object.prototype.toString),p7=p8(RegExp.prototype.test),p6=(C=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return pq(C,t)});function p8(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return pH(e,t,r)}}function p9(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:pK;if(pI&&pI(e,null),!pG(t))return e;let r=t.length;for(;r--;){let i=t[r];if("string"==typeof i){let e=n(i);e!==i&&(pL(t)||(t[r]=e),i=e)}e[i]=!0}return e}function fe(e){let t=pB(null);for(let r of pD(e)){var n=function(e){if(Array.isArray(e))return e}(r)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,i,o,l=[],s=!0,a=!1;try{i=(t=t.call(e)).next,!1;for(;!(s=(n=i.call(t)).done)&&(l.push(n.value),2!==l.length);s=!0);}catch(e){a=!0,r=e}finally{try{if(!s&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(a)throw r}}return l}}(r)||function(e){if(e){if("string"==typeof e)return pN(e,2);var t=({}).toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?pN(e,2):void 0}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();let i=n[0],o=n[1];p2(e,i)&&(pG(o)?t[i]=function(e){for(let t=0;t<e.length;t++)p2(e,t)||(e[t]=null);return e}(o):o&&"object"==typeof o&&o.constructor===Object?t[i]=fe(o):t[i]=o)}return t}function ft(e,t){for(;null!==e;){let n=pR(e,t);if(n){if(n.get)return p8(n.get);if("function"==typeof n.value)return p8(n.value)}e=p_(e)}return function(){return null}}let fn=pz(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),fr=pz(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fi=pz(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fo=pz(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fl=pz(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),fs=pz(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fa=pz(["#text"]),fc=pz(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),fu=pz(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fh=pz(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fd=pz(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),fp=pP(/{{[\w\W]*|^[\w\W]*}}/g),ff=pP(/<%[\w\W]*|^[\w\W]*%>/g),fm=pP(/\${[\w\W]*/g),fg=pP(/^data-[\-\w.\u00B7-\uFFFF]+$/),fv=pP(/^aria-[\-\w]+$/),fy=pP(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),fb=pP(/^(?:\w+script|data):/i),fw=pP(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fx=pP(/^html$/i),fk=pP(/^[a-z][.\w]*(-[.\w]+)+$/i),fC=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null,r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},fS=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};var fM=function e(){let t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"<typeof window?null:window,r=t=>e(t);if(r.version="3.4.8",r.removed=[],!n||!n.document||9!==n.document.nodeType||!n.Element)return r.isSupported=!1,r;let i=n.document,o=i,l=o.currentScript;n.DocumentFragment;let s=n.HTMLTemplateElement,a=n.Node,c=n.Element,u=n.NodeFilter;void 0===n.NamedNodeMap&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;let h=n.DOMParser,d=n.trustedTypes,p=c.prototype,f=ft(p,"cloneNode"),m=ft(p,"remove"),g=ft(p,"nextSibling"),y=ft(p,"childNodes"),b=ft(p,"parentNode"),w=ft(p,"shadowRoot"),x=ft(p,"attributes"),k=a&&a.prototype?ft(a.prototype,"nodeType"):null,C=a&&a.prototype?ft(a.prototype,"nodeName"):null;if("function"==typeof s){let e=i.createElement("template");e.content&&e.content.ownerDocument&&(i=e.content.ownerDocument)}let S="",M=0,A=function(e){if(M>0)throw p6('The configured TRUSTED_TYPES_POLICY.createHTML must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose createHTML wraps DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.');M++;try{return t.createHTML(e)}finally{M--}},T=i,O=T.implementation,E=T.createNodeIterator,N=T.createDocumentFragment,D=T.getElementsByTagName,I=o.importNode,L=fS();r.isSupported="function"==typeof pD&&"function"==typeof b&&O&&void 0!==O.createHTMLDocument;let _=fy,R=null,z=p9({},[...fn,...fr,...fi,...fl,...fa]),P=null,B=p9({},[...fc,...fu,...fh,...fd]),F=Object.seal(pB(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),H=null,q=null,j=Object.seal(pB(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),V=!0,$=!0,W=!1,U=!0,G=!1,K=!0,J=!1,Z=!1,Y=!1,X=!1,Q=!1,ee=!1,et=!0,en=!1,er="user-content-",ei=!0,eo=!1,el={},es=null,ea=p9({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ec=null,eu=p9({},["audio","video","img","source","image","track"]),eh=null,ed=p9({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ep="http://www.w3.org/1998/Math/MathML",ef="http://www.w3.org/2000/svg",em="http://www.w3.org/1999/xhtml",eg=em,ev=!1,ey=null,eb=p9({},[ep,ef,em],pJ),ew=p9({},["mi","mo","mn","ms","mtext"]),ex=p9({},["annotation-xml"]),ek=p9({},["title","style","font","a","script"]),eC=null,eS=["application/xhtml+xml","text/html"],eM=null,eA=null,eT=i.createElement("form"),eO=function(e){return e instanceof RegExp||e instanceof Function},eE=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(eA&&eA===e)return;e&&"object"==typeof e||(e={}),e=fe(e),eM="application/xhtml+xml"===(eC=-1===eS.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?pJ:pK,R=p2(e,"ALLOWED_TAGS")&&pG(e.ALLOWED_TAGS)?p9({},e.ALLOWED_TAGS,eM):z,P=p2(e,"ALLOWED_ATTR")&&pG(e.ALLOWED_ATTR)?p9({},e.ALLOWED_ATTR,eM):B,ey=p2(e,"ALLOWED_NAMESPACES")&&pG(e.ALLOWED_NAMESPACES)?p9({},e.ALLOWED_NAMESPACES,pJ):eb,eh=p2(e,"ADD_URI_SAFE_ATTR")&&pG(e.ADD_URI_SAFE_ATTR)?p9(fe(ed),e.ADD_URI_SAFE_ATTR,eM):ed,ec=p2(e,"ADD_DATA_URI_TAGS")&&pG(e.ADD_DATA_URI_TAGS)?p9(fe(eu),e.ADD_DATA_URI_TAGS,eM):eu,es=p2(e,"FORBID_CONTENTS")&&pG(e.FORBID_CONTENTS)?p9({},e.FORBID_CONTENTS,eM):ea,H=p2(e,"FORBID_TAGS")&&pG(e.FORBID_TAGS)?p9({},e.FORBID_TAGS,eM):fe({}),q=p2(e,"FORBID_ATTR")&&pG(e.FORBID_ATTR)?p9({},e.FORBID_ATTR,eM):fe({}),el=!!p2(e,"USE_PROFILES")&&(e.USE_PROFILES&&"object"==typeof e.USE_PROFILES?fe(e.USE_PROFILES):e.USE_PROFILES),V=!1!==e.ALLOW_ARIA_ATTR,$=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,U=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,G=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,J=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,ee=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,et=!1!==e.SANITIZE_DOM,en=e.SANITIZE_NAMED_PROPS||!1,ei=!1!==e.KEEP_CONTENT,eo=e.IN_PLACE||!1,_=!function(e){try{return p7(e,""),!0}catch(e){return!1}}(e.ALLOWED_URI_REGEXP)?fy:e.ALLOWED_URI_REGEXP,eg="string"==typeof e.NAMESPACE?e.NAMESPACE:em,ew=p2(e,"MATHML_TEXT_INTEGRATION_POINTS")&&e.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof e.MATHML_TEXT_INTEGRATION_POINTS?fe(e.MATHML_TEXT_INTEGRATION_POINTS):p9({},["mi","mo","mn","ms","mtext"]),ex=p2(e,"HTML_INTEGRATION_POINTS")&&e.HTML_INTEGRATION_POINTS&&"object"==typeof e.HTML_INTEGRATION_POINTS?fe(e.HTML_INTEGRATION_POINTS):p9({},["annotation-xml"]);let n=p2(e,"CUSTOM_ELEMENT_HANDLING")&&e.CUSTOM_ELEMENT_HANDLING&&"object"==typeof e.CUSTOM_ELEMENT_HANDLING?fe(e.CUSTOM_ELEMENT_HANDLING):pB(null);if(F=pB(null),p2(n,"tagNameCheck")&&eO(n.tagNameCheck)&&(F.tagNameCheck=n.tagNameCheck),p2(n,"attributeNameCheck")&&eO(n.attributeNameCheck)&&(F.attributeNameCheck=n.attributeNameCheck),p2(n,"allowCustomizedBuiltInElements")&&"boolean"==typeof n.allowCustomizedBuiltInElements&&(F.allowCustomizedBuiltInElements=n.allowCustomizedBuiltInElements),G&&($=!1),Q&&(X=!0),el&&(R=p9({},fa),P=pB(null),!0===el.html&&(p9(R,fn),p9(P,fc)),!0===el.svg&&(p9(R,fr),p9(P,fu),p9(P,fd)),!0===el.svgFilters&&(p9(R,fi),p9(P,fu),p9(P,fd)),!0===el.mathMl&&(p9(R,fl),p9(P,fh),p9(P,fd))),j.tagCheck=null,j.attributeCheck=null,p2(e,"ADD_TAGS")&&("function"==typeof e.ADD_TAGS?j.tagCheck=e.ADD_TAGS:pG(e.ADD_TAGS)&&(R===z&&(R=fe(R)),p9(R,e.ADD_TAGS,eM))),p2(e,"ADD_ATTR")&&("function"==typeof e.ADD_ATTR?j.attributeCheck=e.ADD_ATTR:pG(e.ADD_ATTR)&&(P===B&&(P=fe(P)),p9(P,e.ADD_ATTR,eM))),p2(e,"ADD_URI_SAFE_ATTR")&&pG(e.ADD_URI_SAFE_ATTR)&&p9(eh,e.ADD_URI_SAFE_ATTR,eM),p2(e,"FORBID_CONTENTS")&&pG(e.FORBID_CONTENTS)&&(es===ea&&(es=fe(es)),p9(es,e.FORBID_CONTENTS,eM)),p2(e,"ADD_FORBID_CONTENTS")&&pG(e.ADD_FORBID_CONTENTS)&&(es===ea&&(es=fe(es)),p9(es,e.ADD_FORBID_CONTENTS,eM)),ei&&(R["#text"]=!0),J&&p9(R,["html","head","body"]),R.table&&(p9(R,["tbody"]),delete H.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw p6('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw p6('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let n=t;t=e.TRUSTED_TYPES_POLICY;try{S=A("")}catch(e){throw t=n,e}}else void 0===t&&null!==e.TRUSTED_TYPES_POLICY&&(t=fC(d,l)),t&&"string"==typeof S&&(S=A(""));(L.uponSanitizeElement.length>0||L.uponSanitizeAttribute.length>0)&&R===z&&(R=fe(R)),L.uponSanitizeAttribute.length>0&&P===B&&(P=fe(P)),pz&&pz(e),eA=e},eN=p9({},[...fr,...fi,...fo]),eD=p9({},[...fl,...fs]),eI=function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:eg,tagName:"template"});let n=pK(e.tagName),r=pK(t.tagName);return!!ey[e.namespaceURI]&&(e.namespaceURI===ef?t.namespaceURI===em?"svg"===n:t.namespaceURI===ep?"svg"===n&&("annotation-xml"===r||ew[r]):!!eN[n]:e.namespaceURI===ep?t.namespaceURI===em?"math"===n:t.namespaceURI===ef?"math"===n&&ex[r]:!!eD[n]:e.namespaceURI===em?(t.namespaceURI!==ef||!!ex[r])&&(t.namespaceURI!==ep||!!ew[r])&&!eD[n]&&(ek[n]||!eN[n]):"application/xhtml+xml"===eC&&!!ey[e.namespaceURI])},eL=function(e){pW(r.removed,{element:e});try{b(e).removeChild(e)}catch(t){m(e)}},e_=function(e,t){try{pW(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){pW(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(X||Q)try{eL(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},eR=function(e){let n=null,r=null;if(Y)e="<remove></remove>"+e;else{let t=pZ(e,/^[\r\n\t ]+/);r=t&&t[0]}"application/xhtml+xml"===eC&&eg===em&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let o=t?A(e):e;if(eg===em)try{n=new h().parseFromString(o,eC)}catch(e){}if(!n||!n.documentElement){n=O.createDocument(eg,"template",null);try{n.documentElement.innerHTML=ev?S:o}catch(e){}}let l=n.body||n.documentElement;return(e&&r&&l.insertBefore(i.createTextNode(r),l.childNodes[0]||null),eg===em)?D.call(n,J?"html":"body")[0]:J?n.documentElement:l},ez=function(e){return E.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},eP=function(e){var t,n;e.normalize();let r=E.call(e.ownerDocument||e,e,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null),i=r.nextNode();for(;i;){let e=i.data;pj([fp,ff,fm],t=>{e=pY(e,t," ")}),i.data=e,i=r.nextNode()}pj(Array.from(null!=(t=null==(n=e.querySelectorAll)?void 0:n.call(e,"template"))?t:[]),e=>{eF(e.content)&&eP(e.content)})},eB=function(e){let t=C?C(e):null;return"string"==typeof t&&"form"===eM(t)&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||e.attributes!==x(e)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes||e.nodeType!==k(e)||e.childNodes!==y(e))},eF=function(e){if(!k||"object"!=typeof e||null===e)return!1;try{return 11===k(e)}catch(e){return!1}},eH=function(e){if(!k||"object"!=typeof e||null===e)return!1;try{return"number"==typeof k(e)}catch(e){return!1}};function eq(e,t,n){pj(e,e=>{e.call(r,t,n,eA)})}let ej=function(e){let t=null;if(eq(L.beforeSanitizeElements,e,null),eB(e))return eL(e),!0;let n=eM(C?C(e):e.nodeName);if(eq(L.uponSanitizeElement,e,{tagName:n,allowedTags:R}),K&&e.hasChildNodes()&&!eH(e.firstElementChild)&&p7(/<[/\w!]/g,e.innerHTML)&&p7(/<[/\w!]/g,e.textContent)||K&&e.namespaceURI===em&&"style"===n&&eH(e.firstElementChild)||7===e.nodeType||K&&8===e.nodeType&&p7(/<[/\w]/g,e.data))return eL(e),!0;if(H[n]||!(j.tagCheck instanceof Function&&j.tagCheck(n))&&!R[n]){if(!H[n]&&eW(n)&&(F.tagNameCheck instanceof RegExp&&p7(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n)))return!1;if(ei&&!es[n]){let t=b(e),n=y(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=f(n[i],!0);t.insertBefore(r,g(e))}}}return eL(e),!0}return(k?k(e):e.nodeType)===1&&!eI(e)||("noscript"===n||"noembed"===n||"noframes"===n)&&p7(/<\/no(script|embed|frames)/i,e.innerHTML)?(eL(e),!0):(G&&3===e.nodeType&&(t=e.textContent,pj([fp,ff,fm],e=>{t=pY(t,e," ")}),e.textContent!==t&&(pW(r.removed,{element:e.cloneNode()}),e.textContent=t)),eq(L.afterSanitizeElements,e,null),!1)},eV=function(e,t,n){if(q[t]||et&&("id"===t||"name"===t)&&(n in i||n in eT))return!1;let r=P[t]||j.attributeCheck instanceof Function&&j.attributeCheck(t,e);if($&&!q[t]&&p7(fg,t));else if(V&&p7(fv,t));else if(!r||q[t]){if(!(eW(e)&&(F.tagNameCheck instanceof RegExp&&p7(F.tagNameCheck,e)||F.tagNameCheck instanceof Function&&F.tagNameCheck(e))&&(F.attributeNameCheck instanceof RegExp&&p7(F.attributeNameCheck,t)||F.attributeNameCheck instanceof Function&&F.attributeNameCheck(t,e))||"is"===t&&F.allowCustomizedBuiltInElements&&(F.tagNameCheck instanceof RegExp&&p7(F.tagNameCheck,n)||F.tagNameCheck instanceof Function&&F.tagNameCheck(n))))return!1}else if(eh[t]);else if(p7(_,pY(n,fw,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===pX(n,"data:")&&ec[e]);else if(W&&!p7(fb,pY(n,fw,"")));else if(n)return!1;return!0},e$=p9({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),eW=function(e){return!e$[pK(e)]&&p7(fk,e)},eU=function(e){eq(L.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||eB(e))return;let i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0},o=n.length;for(;o--;){let l=n[o],s=l.name,a=l.namespaceURI,c=l.value,u=eM(s),h="value"===s?c:pQ(c);if(i.attrName=u,i.attrValue=h,i.keepAttr=!0,i.forceKeepAttr=void 0,eq(L.uponSanitizeAttribute,e,i),h=i.attrValue,en&&("id"===u||"name"===u)&&0!==pX(h,er)&&(e_(s,e),h=er+h),K&&p7(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,h)||"attributename"===u&&pZ(h,"href")){e_(s,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr||!U&&p7(/\/>/i,h)){e_(s,e);continue}G&&pj([fp,ff,fm],e=>{h=pY(h,e," ")});let p=eM(e.nodeName);if(!eV(p,u,h)){e_(s,e);continue}if(t&&"object"==typeof d&&"function"==typeof d.getAttributeType)if(a);else switch(d.getAttributeType(p,u)){case"TrustedHTML":h=A(h);break;case"TrustedScriptURL":h=t.createScriptURL(h)}if(h!==c)try{a?e.setAttributeNS(a,s,h):e.setAttribute(s,h),eB(e)?eL(e):p$(r.removed)}catch(t){e_(s,e)}}eq(L.afterSanitizeAttributes,e,null)},eG=function(e){let t=null,n=ez(e);for(eq(L.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(eq(L.uponSanitizeShadowNode,t,null),ej(t),eU(t),eF(t.content)&&eG(t.content),(k?k(t):t.nodeType)===1){let e=w(t);eF(e)&&(eK(e),eG(e))}eq(L.afterSanitizeShadowDOM,e,null)},eK=function(e){let t=k?k(e):e.nodeType;if(1===t){let t=w(e);eF(t)&&(eK(t),eG(t))}let n=y(e);if(!n)return;let r=[];for(let e of(pj(n,e=>{pW(r,e)}),r))eK(e);if(1===t){let t=C?C(e):null;if("string"==typeof t&&"template"===eM(t)){let t=e.content;eF(t)&&eK(t)}}};return r.sanitize=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null,l=null,s=null,a=null;if((ev=!e)&&(e="<!-->"),"string"!=typeof e&&!eH(e)&&"string"!=typeof(e=function(e){switch(typeof e){case"string":return e;case"number":return p0(e);case"boolean":return p1(e);case"bigint":return p4?p4(e):"0";case"symbol":return p5?p5(e):"Symbol()";case"undefined":default:return p3(e);case"function":case"object":{if(null===e)return p3(e);let t=ft(e,"toString");if("function"==typeof t){let n=t(e);return"string"==typeof n?n:p3(n)}return p3(e)}}}(e)))throw p6("dirty is not a string, aborting");if(!r.isSupported)return e;if(Z||eE(n),r.removed=[],"string"==typeof e&&(eo=!1),eo){let t=C?C(e):e.nodeName;if("string"==typeof t){let e=eM(t);if(!R[e]||H[e])throw p6("root node is forbidden and cannot be sanitized in-place")}if(eB(e))throw p6("root node is clobbered and cannot be sanitized in-place");eK(e)}else if(eH(e))1===(l=(i=eR("<!---->")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?i=l:i.appendChild(l),eK(l);else{if(!X&&!G&&!J&&-1===e.indexOf("<"))return t&&ee?A(e):e;if(!(i=eR(e)))return X?null:ee?S:""}i&&Y&&eL(i.firstChild);let c=ez(eo?e:i);for(;s=c.nextNode();)ej(s),eU(s),eF(s.content)&&eG(s.content);if(eo)return G&&eP(e),e;if(X){if(G&&eP(i),Q)for(a=N.call(i.ownerDocument);i.firstChild;)a.appendChild(i.firstChild);else a=i;return(P.shadowroot||P.shadowrootmode)&&(a=I.call(o,a,!0)),a}let u=J?i.outerHTML:i.innerHTML;return J&&R["!doctype"]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&p7(fx,i.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+i.ownerDocument.doctype.name+">\n"+u),G&&pj([fp,ff,fm],e=>{u=pY(u,e," ")}),t&&ee?A(u):u},r.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eE(e),Z=!0},r.clearConfig=function(){eA=null,Z=!1},r.isValidAttribute=function(e,t,n){return eA||eE({}),eV(eM(e),eM(t),n)},r.addHook=function(e,t){"function"==typeof t&&pW(L[e],t)},r.removeHook=function(e,t){if(void 0!==t){let n=pV(L[e],t);return -1===n?void 0:pU(L[e],n,1)[0]}return p$(L[e])},r.removeHooks=function(e){L[e]=[]},r.removeAllHooks=function(){L=fS()},r}();let fA=Math.min,fT=Math.max,fO=Math.round,fE=Math.floor,fN=e=>({x:e,y:e}),fD={left:"right",right:"left",bottom:"top",top:"bottom"};function fI(e,t){return"function"==typeof e?e(t):e}function fL(e){return e.split("-")[0]}function f_(e){return e.split("-")[1]}function fR(e){return"x"===e?"y":"x"}function fz(e){return"y"===e?"height":"width"}function fP(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function fB(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let fF=["left","right"],fH=["right","left"],fq=["top","bottom"],fj=["bottom","top"];function fV(e){let t=fL(e);return fD[t]+e.slice(t.length)}function f$(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fW(e,t,n){let r,{reference:i,floating:o}=e,l=fP(t),s=fR(fP(t)),a=fz(s),c=fL(t),u="y"===l,h=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[a]/2-o[a]/2;switch(c){case"top":r={x:h,y:i.y-o.height};break;case"bottom":r={x:h,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:d};break;case"left":r={x:i.x-o.width,y:d};break;default:r={x:i.x,y:i.y}}switch(f_(t)){case"start":r[s]-=p*(n&&u?-1:1);break;case"end":r[s]+=p*(n&&u?-1:1)}return r}async function fU(e,t){var n,r;void 0===t&&(t={});let{x:i,y:o,platform:l,rects:s,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=fI(t,e),m="number"!=typeof(r=f)?{top:0,right:0,bottom:0,left:0,...r}:{top:r,right:r,bottom:r,left:r},g=a[p?"floating"===d?"reference":"floating":d],y=f$(await l.getClippingRect({element:null==(n=await (null==l.isElement?void 0:l.isElement(g)))||n?g:g.contextElement||await (null==l.getDocumentElement?void 0:l.getDocumentElement(a.floating)),boundary:u,rootBoundary:h,strategy:c})),b="floating"===d?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await (null==l.getOffsetParent?void 0:l.getOffsetParent(a.floating)),x=await (null==l.isElement?void 0:l.isElement(w))&&await (null==l.getScale?void 0:l.getScale(w))||{x:1,y:1},k=f$(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:w,strategy:c}):b);return{top:(y.top-k.top+m.top)/x.y,bottom:(k.bottom-y.bottom+m.bottom)/x.y,left:(y.left-k.left+m.left)/x.x,right:(k.right-y.right+m.right)/x.x}}let fG=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,s=l.detectOverflow?l:{...l,detectOverflow:fU},a=await (null==l.isRTL?void 0:l.isRTL(t)),c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:h}=fW(c,r,a),d=r,p=0,f={};for(let n=0;n<o.length;n++){let m=o[n];if(!m)continue;let{name:g,fn:y}=m,{x:b,y:w,data:x,reset:k}=await y({x:u,y:h,initialPlacement:r,placement:d,strategy:i,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=b?b:u,h=null!=w?w:h,f[g]={...f[g],...x},k&&p<50&&(p++,"object"==typeof k&&(k.placement&&(d=k.placement),k.rects&&(c=!0===k.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:u,y:h}=fW(c,d,a)),n=-1)}return{x:u,y:h,placement:d,strategy:i,middlewareData:f}},fK=new Set(["left","top"]);async function fJ(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),l=fL(n),s=f_(n),a="y"===fP(n),c=fK.has(l)?-1:1,u=o&&a?-1:1,h=fI(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&"number"==typeof f&&(p="end"===s?-1*f:f),a?{x:p*u,y:d*c}:{x:d*c,y:p*u}}function fZ(){return"u">typeof window}function fY(e){return f0(e)?(e.nodeName||"").toLowerCase():"#document"}function fX(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fQ(e){var t;return null==(t=(f0(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function f0(e){return!!fZ()&&(e instanceof Node||e instanceof fX(e).Node)}function f1(e){return!!fZ()&&(e instanceof Element||e instanceof fX(e).Element)}function f4(e){return!!fZ()&&(e instanceof HTMLElement||e instanceof fX(e).HTMLElement)}function f5(e){return!(!fZ()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof fX(e).ShadowRoot)}function f2(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function f3(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let f7=/transform|translate|scale|rotate|perspective|filter/,f6=/paint|layout|strict|content/,f8=e=>!!e&&"none"!==e;function f9(e){let t=f1(e)?mn(e):e;return f8(t.transform)||f8(t.translate)||f8(t.scale)||f8(t.rotate)||f8(t.perspective)||!me()&&(f8(t.backdropFilter)||f8(t.filter))||f7.test(t.willChange||"")||f6.test(t.contain||"")}function me(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function mt(e){return/^(html|body|#document)$/.test(fY(e))}function mn(e){return fX(e).getComputedStyle(e)}function mr(e){return f1(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mi(e){if("html"===fY(e))return e;let t=e.assignedSlot||e.parentNode||f5(e)&&e.host||fQ(e);return f5(t)?t.host:t}function mo(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=mi(t);return mt(n)?t.ownerDocument?t.ownerDocument.body:t.body:f4(n)&&f2(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),l=fX(i);if(!o)return t.concat(i,mo(i,[],n));{let e=ml(l);return t.concat(l,l.visualViewport||[],f2(i)?i:[],e&&n?mo(e):[])}}function ml(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ms(e){let t=mn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=f4(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=fO(n)!==o||fO(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function ma(e){return f1(e)?e:e.contextElement}function mc(e){let t=ma(e);if(!f4(t))return fN(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=ms(t),l=(o?fO(n.width):n.width)/r,s=(o?fO(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}let mu=fN(0);function mh(e){let t=fX(e);return me()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:mu}function md(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),l=ma(e),s=fN(1);t&&(r?f1(r)&&(s=mc(r)):s=mc(e));let a=(void 0===(i=n)&&(i=!1),r&&(!i||r===fX(l))&&i)?mh(l):fN(0),c=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,h=o.width/s.x,d=o.height/s.y;if(l){let e=fX(l),t=r&&f1(r)?fX(r):r,n=e,i=ml(n);for(;i&&r&&t!==n;){let e=mc(i),t=i.getBoundingClientRect(),r=mn(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,h*=e.x,d*=e.y,c+=o,u+=l,i=ml(n=fX(i))}}return f$({width:h,height:d,x:c,y:u})}function mp(e,t){let n=mr(e).scrollLeft;return t?t.left+n:md(fQ(e)).left+n}function mf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-mp(e,n),y:n.top+t.scrollTop}}function mm(e,t,n){var r;let i;if("viewport"===t)i=function(e,t){let n=fX(e),r=fQ(e),i=n.visualViewport,o=r.clientWidth,l=r.clientHeight,s=0,a=0;if(i){o=i.width,l=i.height;let e=me();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,a=i.offsetTop)}let c=mp(r);if(c<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-i);l<=25&&(o-=l)}else c<=25&&(o+=c);return{width:o,height:l,x:s,y:a}}(e,n);else if("document"===t){let t,n,o,l,s,a,c;r=fQ(e),t=fQ(r),n=mr(r),o=r.ownerDocument.body,l=fT(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=fT(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+mp(r),c=-n.scrollTop,"rtl"===mn(o).direction&&(a+=fT(t.clientWidth,o.clientWidth)-l),i={width:l,height:s,x:a,y:c}}else if(f1(t)){let e,r,o,l,s,a;r=(e=md(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,l=f4(t)?mc(t):fN(1),s=t.clientWidth*l.x,a=t.clientHeight*l.y,i={width:s,height:a,x:o*l.x,y:r*l.y}}else{let n=mh(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return f$(i)}function mg(e){return"static"===mn(e).position}function mv(e,t){if(!f4(e)||"fixed"===mn(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fQ(e)===n&&(n=n.ownerDocument.body),n}function my(e,t){var n;let r=fX(e);if(f3(e))return r;if(!f4(e)){let t=mi(e);for(;t&&!mt(t);){if(f1(t)&&!mg(t))return t;t=mi(t)}return r}let i=mv(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(fY(n)))&&mg(i);)i=mv(i,t);return i&&mt(i)&&mg(i)&&!f9(i)?r:i||function(e){let t=mi(e);for(;f4(t)&&!mt(t);){if(f9(t))return t;if(f3(t))break;t=mi(t)}return null}(e)||r}let mb=async function(e){let t=this.getOffsetParent||my,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=f4(t),i=fQ(t),o="fixed"===n,l=md(e,!0,o,t),s={scrollLeft:0,scrollTop:0},a=fN(0);if(r||!r&&!o)if(("body"!==fY(t)||f2(i))&&(s=mr(t)),r){let e=md(t,!0,o,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else i&&(a.x=mp(i));o&&!r&&i&&(a.x=mp(i));let c=!i||r||o?fN(0):mf(i,s);return{x:l.left+s.scrollLeft-a.x-c.x,y:l.top+s.scrollTop-a.y-c.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},mw={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,l=fQ(r),s=!!t&&f3(t.floating);if(r===l||s&&o)return n;let a={scrollLeft:0,scrollTop:0},c=fN(1),u=fN(0),h=f4(r);if((h||!h&&!o)&&(("body"!==fY(r)||f2(l))&&(a=mr(r)),h)){let e=md(r);c=mc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let d=!l||h||o?fN(0):mf(l,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-a.scrollTop*c.y+u.y+d.y}},getDocumentElement:fQ,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?f3(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=mo(e,[],!1).filter(e=>f1(e)&&"body"!==fY(e)),i=null,o="fixed"===mn(e).position,l=o?mi(e):e;for(;f1(l)&&!mt(l);){let t=mn(l),n=f9(l);n||"fixed"!==t.position||(i=null),(o?n||i:!(!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||f2(l)&&!n&&function e(t,n){let r=mi(t);return!(r===n||!f1(r)||mt(r))&&("fixed"===mn(r).position||e(r,n))}(e,l)))?i=t:r=r.filter(e=>e!==l),l=mi(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=mm(t,o[0],i),s=l.top,a=l.right,c=l.bottom,u=l.left;for(let e=1;e<o.length;e++){let n=mm(t,o[e],i);s=fT(n.top,s),a=fA(n.right,a),c=fA(n.bottom,c),u=fT(n.left,u)}return{width:a-u,height:c-s,x:u,y:s}},getOffsetParent:my,getElementRects:mb,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=ms(e);return{width:t,height:n}},getScale:mc,isElement:f1,isRTL:function(e){return"rtl"===mn(e).direction}};function mx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mk(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,u=ma(e),h=o||l?[...u?mo(u):[],...t?mo(t):[]]:[];h.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});let d=u&&a?function(e,t){let n,r=null,i=fQ(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function l(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),o();let c=e.getBoundingClientRect(),{left:u,top:h,width:d,height:p}=c;if(s||t(),!d||!p)return;let f={rootMargin:-fE(h)+"px "+-fE(i.clientWidth-(u+d))+"px "+-fE(i.clientHeight-(h+p))+"px "+-fE(u)+"px",threshold:fT(0,fA(1,a))||1},m=!0;function g(t){let r=t[0].intersectionRatio;if(r!==a){if(!m)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||mx(c,e.getBoundingClientRect())||l(),m=!1}try{r=new IntersectionObserver(g,{...f,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),o}(u,n):null,p=-1,f=null;s&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),u&&!c&&f.observe(u),t&&f.observe(t));let m=c?md(e):null;return c&&function t(){let r=md(e);m&&!mx(m,r)&&n(),m=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{o&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,c&&cancelAnimationFrame(i)}}let mC=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:i,y:o,placement:l,middlewareData:s}=t,a=await fJ(t,e);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+a.x,y:o+a.y,data:{...a,placement:l}}}}},mS=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,i,o,l,s,a,c;let u,h,d,{placement:p,middlewareData:f,rects:m,initialPlacement:g,platform:y,elements:b}=t,{mainAxis:w=!0,crossAxis:x=!0,fallbackPlacements:k,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:M=!0,...A}=fI(e,t);if(null!=(n=f.arrow)&&n.alignmentOffset)return{};let T=fL(p),O=fP(g),E=fL(g)===g,N=await (null==y.isRTL?void 0:y.isRTL(b.floating)),D=k||(E||!M?[fV(g)]:(u=fV(g),[fB(g),u,fB(u)])),I="none"!==S;!k&&I&&D.push(...(h=f_(g),d=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?fH:fF;return t?fF:fH;case"left":case"right":return t?fq:fj;default:return[]}}(fL(g),"start"===S,N),h&&(d=d.map(e=>e+"-"+h),M&&(d=d.concat(d.map(fB)))),d));let L=[g,...D],_=await y.detectOverflow(t,A),R=[],z=(null==(r=f.flip)?void 0:r.overflows)||[];if(w&&R.push(_[T]),x){let e,t,n,r,i=(s=p,a=m,void 0===(c=N)&&(c=!1),e=f_(s),n=fz(t=fR(fP(s))),r="x"===t?e===(c?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[n]>a.floating[n]&&(r=fV(r)),[r,fV(r)]);R.push(_[i[0]],_[i[1]])}if(z=[...z,{placement:p,overflows:R}],!R.every(e=>e<=0)){let e=((null==(i=f.flip)?void 0:i.index)||0)+1,t=L[e];if(t&&("alignment"!==x||O===fP(t)||z.every(e=>fP(e.placement)!==O||e.overflows[0]>0)))return{data:{index:e,overflows:z},reset:{placement:t}};let n=null==(o=z.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!n)switch(C){case"bestFit":{let e=null==(l=z.filter(e=>{if(I){let t=fP(e.placement);return t===O||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:l[0];e&&(n=e);break}case"initialPlacement":n=g}if(p!==n)return{reset:{placement:n}}}return{}}}},mM=(e,t,n)=>{let r=new Map,i={platform:mw,...n},o={...i.platform,_c:r};return fG(e,t,{...i,platform:o})},mA=function(){return tx.Date.now()};var mT=/\s/;let mO=function(e){for(var t=e.length;t--&&mT.test(e.charAt(t)););return t};var mE=/^\s+/,mN=0/0,mD=/^[-+]0x[0-9a-f]+$/i,mI=/^0b[01]+$/i,mL=/^0o[0-7]+$/i,m_=parseInt;let mR=function(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||nu(t)&&"[object Symbol]"==tN(t))return mN;if(tD(e)){var t,n,r="function"==typeof e.valueOf?e.valueOf():e;e=tD(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=(n=e)?n.slice(0,mO(n)+1).replace(mE,""):n;var i=mI.test(e);return i||mL.test(e)?m_(e.slice(2),i?2:8):mD.test(e)?mN:+e};var mz=Math.max,mP=Math.min;let mB=function(e,t,n){var r,i,o,l,s,a,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw TypeError("Expected a function");function p(t){var n=r,o=i;return r=i=void 0,c=t,l=e.apply(o,n)}function f(e){var n=e-a,r=e-c;return void 0===a||n>=t||n<0||h&&r>=o}function m(){var e,n,r,i=mA();if(f(i))return g(i);s=setTimeout(m,(e=i-a,n=i-c,r=t-e,h?mP(r,o-n):r))}function g(e){return(s=void 0,d&&r)?p(e):(r=i=void 0,l)}function y(){var e,n=mA(),o=f(n);if(r=arguments,i=this,a=n,o){if(void 0===s)return c=e=a,s=setTimeout(m,t),u?p(e):l;if(h)return clearTimeout(s),s=setTimeout(m,t),p(a)}return void 0===s&&(s=setTimeout(m,t)),l}return t=mR(t)||0,tD(n)&&(u=!!n.leading,o=(h="maxWait"in n)?mz(mR(n.maxWait)||0,t):o,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=a=i=s=void 0},y.flush=function(){return void 0===s?l:g(mA())},y},mF=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return tD(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),mB(e,t,{leading:r,maxWait:t,trailing:i})};var mH=class{#G;#K;#J;#Z;#Y;#X;#Q;#ee;#et;#en;constructor(e){this.#X=!1,this.onShow=()=>{},this.onHide=()=>{},this.#er=e=>{var t;mM(e,this.element,{placement:this.#Z.placement??"top",middleware:[mS(),mC(this.#ee),(void 0===(t=this.#et)&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:r,placement:i,platform:o}=e,{mainAxis:l=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=fI(t,e),u={x:n,y:r},h=await o.detectOverflow(e,c),d=fP(fL(i)),p=fR(d),f=u[p],m=u[d];if(l){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=f+h[e],r=f-h[t];f=fT(n,fA(f,r))}if(s){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",n=m+h[e],r=m-h[t];m=fT(n,fA(m,r))}let g=a.fn({...e,[p]:f,[d]:m});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:l,[d]:s}}}}}),...this.#J],...this.#Z}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error)},this.#ei=e=>this.#Y!==e.dom.parentElement,this.#eo=(e,t)=>{let{state:n,composing:r}=e,{selection:i,doc:o}=n,{ranges:l}=i,s=Math.min(...l.map(e=>e.$from.pos)),a=Math.max(...l.map(e=>e.$to.pos)),c=t&&t.doc.eq(o)&&t.selection.eq(i);if(this.#X||((this.#Y??e.dom.parentElement??document.body).appendChild(this.element),this.#X=!0),r||c)return;if(this.#Q?.(),this.#Q=void 0,!this.#K(e,t))return void this.hide();let u={getBoundingClientRect:()=>aI(e,s,a),contextElement:e.dom};this.#ei(e)?this.#Q=mk(u,this.element,()=>this.#er(u)):this.#er(u),this.show()},this.update=(e,t)=>{this.#en(e,t)},this.#el=e=>{let{doc:t,selection:n}=e.state,{empty:r,from:i,to:o}=n,l=!t.textBetween(i,o).length&&e.state.selection instanceof sw,s=this.element.contains(document.activeElement),a=!e.hasFocus()&&!s,c=!e.editable;return!a&&!r&&!l&&!c},this.destroy=()=>{this.#Q?.(),this.#en.cancel()},this.show=(e,t)=>{if(this.element.dataset.show="true",e){this.#Q?.(),this.#Q=void 0;let n={...e,contextElement:t?.dom};t&&this.#ei(t)?this.#Q=mk(n,this.element,()=>this.#er(n)):this.#er(n)}this.onShow()},this.hide=()=>{"false"!==this.element.dataset.show&&(this.element.dataset.show="false",this.onHide())},this.element=e.content,this.#G=e.debounce??200,this.#K=e.shouldShow??this.#el,this.#ee=e.offset,this.#et=e.shift,this.#J=e.middleware??[],this.#Z=e.floatingUIOptions??{},this.#Y=e.root,this.element.dataset.show="false",this.#en=mF(this.#eo,this.#G)}#er;#ei;#eo;#el};function mq(e){let t=dC({},`${e}_TOOLTIP_SPEC`),n=dw(n=>{let r=n.get(t.key);return new s_({key:new sP(`${e}_TOOLTIP`),...r})}),r=[t,n];return r.key=t.key,r.pluginKey=n.key,t.meta={package:"@milkdown/plugin-tooltip",displayName:`Ctx<tooltipSpec>|${e}`},n.meta={package:"@milkdown/plugin-tooltip",displayName:`Prose<tooltip>|${e}`},r}function mj(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}e.i(47167);let mV={},m$=[],mW=()=>{},mU=()=>!1,mG=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),mK=e=>e.startsWith("onUpdate:"),mJ=Object.assign,mZ=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},mY=Object.prototype.hasOwnProperty,mX=(e,t)=>mY.call(e,t),mQ=Array.isArray,m0=e=>"function"==typeof e,m1=e=>"string"==typeof e,m4=e=>"symbol"==typeof e,m5=e=>null!==e&&"object"==typeof e,m2=e=>(m5(e)||m0(e))&&m0(e.then)&&m0(e.catch),m3=Object.prototype.toString,m7=e=>m1(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,m6=mj(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),m8=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},m9=/-\w/g,ge=m8(e=>e.replace(m9,e=>e.slice(1).toUpperCase())),gt=/\B([A-Z])/g,gn=m8(e=>e.replace(gt,"-$1").toLowerCase()),gr=m8(e=>e.charAt(0).toUpperCase()+e.slice(1)),gi=m8(e=>e?`on${gr(e)}`:""),go=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},gl=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},gs=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ga=()=>n||(n="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:e.g);function gc(e){if(mQ(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=m1(r)?function(e){let t={};return e.replace(gd,"").split(gu).forEach(e=>{if(e){let n=e.split(gh);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(r):gc(r);if(i)for(let e in i)t[e]=i[e]}return t}if(m1(e)||m5(e))return e}let gu=/;(?![^(]*\))/g,gh=/:([^]+)/,gd=/\/\*[^]*?\*\//g;function gp(e){let t="";if(m1(e))t=e;else if(mQ(e))for(let n=0;n<e.length;n++){let r=gp(e[n]);r&&(t+=r+" ")}else if(m5(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}let gf=mj("itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly");class gm{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&r&&(r.active?(this.parent=r,this.index=(r.scopes||(r.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){let e,t;if(this._isPaused=!1,this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=r;try{return r=this,e()}finally{r=t}}}on(){1==++this._on&&(this.prevScope=r,r=this)}off(){if(this._on>0&&0==--this._on){if(r===this)r=this.prevScope;else{let e=r;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,this.effects.length=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}}let gg=new WeakSet;class gv{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,r&&(r.active?r.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,gg.has(this)&&(gg.delete(this),this.trigger()))}notify(){(!(2&this.flags)||32&this.flags)&&(8&this.flags||gb(this))}run(){if(!(1&this.flags))return this.fn();this.flags|=2,gN(this),gx(this);let e=i,t=gA;i=this,gA=!0;try{return this.fn()}finally{gk(this),i=e,gA=t,this.flags&=-3}}stop(){if(1&this.flags){for(let e=this.deps;e;e=e.nextDep)gM(e);this.deps=this.depsTail=void 0,gN(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?gg.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){gC(this)&&this.run()}get dirty(){return gC(this)}}let gy=0;function gb(e,t=!1){if(e.flags|=8,t){e.next=l,l=e;return}e.next=o,o=e}function gw(){let e;if(!(--gy>0)){if(l){let e=l;for(l=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;o;){let t=o;for(o=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function gx(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function gk(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;-1===r.version?(r===n&&(n=e),gM(r),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function gC(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(gS(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function gS(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===gD)||(e.globalVersion=gD,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!gC(e))))return;e.flags|=2;let t=e.dep,n=i,r=gA;i=e,gA=!0;try{let n;gx(e);let r=e.fn(e._value);(0===t.version||(n=e._value,!Object.is(r,n)))&&(e.flags|=128,e._value=r,t.version++)}catch(e){throw t.version++,e}finally{i=n,gA=r,gk(e),e.flags&=-3}}function gM(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)gM(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}let gA=!0,gT=[];function gO(){gT.push(gA),gA=!1}function gE(){let e=gT.pop();gA=void 0===e||e}function gN(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=i;i=void 0;try{t()}finally{i=e}}}let gD=0;class gI{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class gL{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!i||!gA||i===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==i)t=this.activeLink=new gI(i,this),i.deps?(t.prevDep=i.depsTail,i.depsTail.nextDep=t,i.depsTail=t):i.deps=i.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let r=t.dep.subs;r!==t&&(t.prevSub=r,r&&(r.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=i.depsTail,t.nextDep=void 0,i.depsTail.nextDep=t,i.depsTail=t,i.deps===t&&(i.deps=e)}return t}trigger(e){this.version++,gD++,this.notify(e)}notify(e){gy++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{gw()}}}let g_=new WeakMap,gR=Symbol(""),gz=Symbol(""),gP=Symbol("");function gB(e,t,n){if(gA&&i){let t=g_.get(e);t||g_.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new gL),r.map=t,r.key=n),r.track()}}function gF(e,t,n,r,i,o){let l=g_.get(e);if(!l)return void gD++;let s=e=>{e&&e.trigger()};if(gy++,"clear"===t)l.forEach(s);else{let i=mQ(e),o=i&&m7(n);if(i&&"length"===n){let e=Number(r);l.forEach((t,n)=>{("length"===n||n===gP||!m4(n)&&n>=e)&&s(t)})}else switch((void 0!==n||l.has(void 0))&&s(l.get(n)),o&&s(l.get(gP)),t){case"add":if(i)o&&s(l.get("length"));else{let t;s(l.get(gR));"[object Map]"===(t=e,m3.call(t))&&s(l.get(gz))}break;case"delete":if(!i){let t;s(l.get(gR));"[object Map]"===(t=e,m3.call(t))&&s(l.get(gz))}break;case"set":let a;"[object Map]"===(a=e,m3.call(a))&&s(l.get(gR))}}gw()}function gH(e){let t=vh(e);return t===e?t:(gB(t,"iterate",gP),vc(e)?t:t.map(vd))}function gq(e){return gB(e=vh(e),"iterate",gP),e}function gj(e,t){return va(e)?vs(e)?vp(vd(t)):vp(t):vd(t)}let gV={__proto__:null,[Symbol.iterator](){return g$(this,Symbol.iterator,e=>gj(this,e))},concat(...e){return gH(this).concat(...e.map(e=>mQ(e)?gH(e):e))},entries(){return g$(this,"entries",e=>(e[1]=gj(this,e[1]),e))},every(e,t){return gU(this,"every",e,t,void 0,arguments)},filter(e,t){return gU(this,"filter",e,t,e=>e.map(e=>gj(this,e)),arguments)},find(e,t){return gU(this,"find",e,t,e=>gj(this,e),arguments)},findIndex(e,t){return gU(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return gU(this,"findLast",e,t,e=>gj(this,e),arguments)},findLastIndex(e,t){return gU(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return gU(this,"forEach",e,t,void 0,arguments)},includes(...e){return gK(this,"includes",e)},indexOf(...e){return gK(this,"indexOf",e)},join(e){return gH(this).join(e)},lastIndexOf(...e){return gK(this,"lastIndexOf",e)},map(e,t){return gU(this,"map",e,t,void 0,arguments)},pop(){return gJ(this,"pop")},push(...e){return gJ(this,"push",e)},reduce(e,...t){return gG(this,"reduce",e,t)},reduceRight(e,...t){return gG(this,"reduceRight",e,t)},shift(){return gJ(this,"shift")},some(e,t){return gU(this,"some",e,t,void 0,arguments)},splice(...e){return gJ(this,"splice",e)},toReversed(){return gH(this).toReversed()},toSorted(e){return gH(this).toSorted(e)},toSpliced(...e){return gH(this).toSpliced(...e)},unshift(...e){return gJ(this,"unshift",e)},values(){return g$(this,"values",e=>gj(this,e))}};function g$(e,t,n){let r=gq(e),i=r[t]();return r===e||vc(e)||(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}let gW=Array.prototype;function gU(e,t,n,r,i,o){let l=gq(e),s=l!==e&&!vc(e),a=l[t];if(a!==gW[t]){let t=a.apply(e,o);return s?vd(t):t}let c=n;l!==e&&(s?c=function(t,r){return n.call(this,gj(e,t),r,e)}:n.length>2&&(c=function(t,r){return n.call(this,t,r,e)}));let u=a.call(l,c,r);return s&&i?i(u):u}function gG(e,t,n,r){let i=gq(e),o=i!==e&&!vc(e),l=n,s=!1;i!==e&&(o?(s=0===r.length,l=function(t,r,i){return s&&(s=!1,t=gj(e,t)),n.call(this,t,gj(e,r),i,e)}):n.length>3&&(l=function(t,r,i){return n.call(this,t,r,i,e)}));let a=i[t](l,...r);return s?gj(e,a):a}function gK(e,t,n){let r=vh(e);gB(r,"iterate",gP);let i=r[t](...n);return(-1===i||!1===i)&&vu(n[0])?(n[0]=vh(n[0]),r[t](...n)):i}function gJ(e,t,n=[]){gO(),gy++;let r=vh(e)[t].apply(e,n);return gw(),gE(),r}let gZ=mj("__proto__,__v_isRef,__isVue"),gY=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(m4));function gX(e){m4(e)||(e=String(e));let t=vh(this);return gB(t,"has",e),t.hasOwnProperty(e)}class gQ{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if("__v_isReactive"===t)return!r;if("__v_isReadonly"===t)return r;if("__v_isShallow"===t)return i;if("__v_raw"===t)return n===(r?i?vr:vn:i?vt:ve).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let o=mQ(e);if(!r){let e;if(o&&(e=gV[t]))return e;if("hasOwnProperty"===t)return gX}let l=Reflect.get(e,t,vf(e)?e:n);if((m4(t)?gY.has(t):gZ(t))||(r||gB(e,"get",t),i))return l;if(vf(l)){let e=o&&m7(t)?l:l.value;return r&&m5(e)?vo(e):e}return m5(l)?r?vo(l):vi(l):l}}class g0 extends gQ{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],o=mQ(e)&&m7(t);if(!this._isShallow){let e=va(i);if(vc(n)||va(n)||(i=vh(i),n=vh(n)),!o&&vf(i)&&!vf(n))if(e)return!0;else return i.value=n,!0}let l=o?Number(t)<e.length:mX(e,t),s=Reflect.set(e,t,n,vf(e)?e:r);return e===vh(r)&&(l?Object.is(n,i)||gF(e,"set",t,n,i):gF(e,"add",t,n)),s}deleteProperty(e,t){let n=mX(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&gF(e,"delete",t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return m4(t)&&gY.has(t)||gB(e,"has",t),n}ownKeys(e){return gB(e,"iterate",mQ(e)?"length":gR),Reflect.ownKeys(e)}}let g1=new g0,g4=new class extends gQ{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},g5=new g0(!0),g2=e=>e;function g3(e){return function(){return"delete"!==e&&("clear"===e?void 0:this)}}function g7(e,t){let n,r=(mJ(n={get(n){let r=this.__v_raw,i=vh(r),o=vh(n);e||(Object.is(n,o)||gB(i,"get",n),gB(i,"get",o));let{has:l}=Reflect.getPrototypeOf(i),s=t?g2:e?vp:vd;return l.call(i,n)?s(r.get(n)):l.call(i,o)?s(r.get(o)):void(r!==i&&r.get(n))},get size(){let t=this.__v_raw;return e||gB(vh(t),"iterate",gR),t.size},has(t){let n=this.__v_raw,r=vh(n),i=vh(t);return e||(Object.is(t,i)||gB(r,"has",t),gB(r,"has",i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,o=i.__v_raw,l=vh(o),s=t?g2:e?vp:vd;return e||gB(l,"iterate",gR),o.forEach((e,t)=>n.call(r,s(e),s(t),i))}},e?{add:g3("add"),set:g3("set"),delete:g3("delete"),clear:g3("clear")}:{add(e){let n=vh(this),r=Reflect.getPrototypeOf(n),i=vh(e),o=t||vc(e)||va(e)?e:i;return r.has.call(n,o)||!Object.is(e,o)&&r.has.call(n,e)||!Object.is(i,o)&&r.has.call(n,i)||(n.add(o),gF(n,"add",o,o)),this},set(e,n){t||vc(n)||va(n)||(n=vh(n));let r=vh(this),{has:i,get:o}=Reflect.getPrototypeOf(r),l=i.call(r,e);l||(e=vh(e),l=i.call(r,e));let s=o.call(r,e);return(r.set(e,n),l)?Object.is(n,s)||gF(r,"set",e,n,s):gF(r,"add",e,n),this},delete(e){let t=vh(this),{has:n,get:r}=Reflect.getPrototypeOf(t),i=n.call(t,e);i||(e=vh(e),i=n.call(t,e));let o=r?r.call(t,e):void 0,l=t.delete(e);return i&&gF(t,"delete",e,void 0,o),l},clear(){let e=vh(this),t=0!==e.size,n=e.clear();return t&&gF(e,"clear",void 0,void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=function(...n){let i,o=this.__v_raw,l=vh(o),s="[object Map]"===(i=l,m3.call(i)),a="entries"===r||r===Symbol.iterator&&s,c=o[r](...n),u=t?g2:e?vp:vd;return e||gB(l,"iterate","keys"===r&&s?gz:gR),mJ(Object.create(c),{next(){let{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}}})}}),n);return(t,n,i)=>"__v_isReactive"===n?!e:"__v_isReadonly"===n?e:"__v_raw"===n?t:Reflect.get(mX(r,n)&&n in t?r:t,n,i)}let g6={get:g7(!1,!1)},g8={get:g7(!1,!0)},g9={get:g7(!0,!1)},ve=new WeakMap,vt=new WeakMap,vn=new WeakMap,vr=new WeakMap;function vi(e){return va(e)?e:vl(e,!1,g1,g6,ve)}function vo(e){return vl(e,!0,g4,g9,vn)}function vl(e,t,n,r,i){let o;if(!m5(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let l=i.get(e);if(l)return l;let s=function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((o=e,m3.call(o)).slice(8,-1));if(0===s)return e;let a=new Proxy(e,2===s?r:n);return i.set(e,a),a}function vs(e){return va(e)?vs(e.__v_raw):!!(e&&e.__v_isReactive)}function va(e){return!!(e&&e.__v_isReadonly)}function vc(e){return!!(e&&e.__v_isShallow)}function vu(e){return!!e&&!!e.__v_raw}function vh(e){let t=e&&e.__v_raw;return t?vh(t):e}let vd=e=>m5(e)?vi(e):e,vp=e=>m5(e)?vo(e):e;function vf(e){return!!e&&!0===e.__v_isRef}function vm(e){return vg(e,!1)}function vg(e,t){return vf(e)?e:new vv(e,t)}class vv{constructor(e,t){this.dep=new gL,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:vh(e),this._value=t?e:vd(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||vc(e)||va(e);Object.is(e=n?e:vh(e),t)||(this._rawValue=e,this._value=n?e:vd(e),this.dep.trigger())}}let vy={get:(e,t,n)=>{var r;return"__v_raw"===t?e:vf(r=Reflect.get(e,t,n))?r.value:r},set:(e,t,n,r)=>{let i=e[t];return vf(i)&&!vf(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function vb(e){return vs(e)?e:new Proxy(e,vy)}class vw{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new gL(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=gD-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&i!==this)return gb(this,!0),!0}get value(){let e=this.dep.track();return gS(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let vx={},vk=new WeakMap;function vC(e,t=1/0,n){if(t<=0||!m5(e)||e.__v_skip||((n=n||new Map).get(e)||0)>=t)return e;if(n.set(e,t),t--,vf(e))vC(e.value,t,n);else if(mQ(e))for(let r=0;r<e.length;r++)vC(e[r],t,n);else{let r,i;if("[object Set]"===(r=e,m3.call(r))||"[object Map]"===(i=e,m3.call(i)))e.forEach(e=>{vC(e,t,n)});else{let r;if("[object Object]"===(r=e,m3.call(r))){for(let r in e)vC(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&vC(e[r],t,n)}}}return e}let vS=[],vM=!1;function vA(e,...t){if(vM)return;vM=!0,gO();let n=vS.length?vS[vS.length-1].component:null,r=n&&n.appContext.config.warnHandler,i=function(){let e=vS[vS.length-1];if(!e)return[];let t=[];for(;e;){let n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});let r=e.component&&e.component.parent;e=r&&r.vnode}return t}();if(r)vT(r,n,11,[e+t.map(e=>{var t,n;return null!=(n=null==(t=e.toString)?void 0:t.call(e))?n:JSON.stringify(e)}).join(""),n&&n.proxy,i.map(({vnode:e})=>`at <${bz(n,e.type)}>`).join("\n"),i]);else{let n,r=[`[Vue warn]: ${e}`,...t];i.length&&r.push(`
|
|
2
|
+
`,...(n=[],i.forEach((e,t)=>{n.push(...0===t?[]:[`
|
|
3
|
+
`],...function({vnode:e,recurseCount:t}){var n;let r,i,o=t>0?`... (${t} recursive calls)`:"",l=!!e.component&&null==e.component.parent,s=` at <${bz(e.component,e.type,l)}`,a=">"+o;return e.props?[s,...(n=e.props,r=[],(i=Object.keys(n)).slice(0,3).forEach(e=>{r.push(...function e(t,n,r){return m1(n)?(n=JSON.stringify(n),r?n:[`${t}=${n}`]):"number"==typeof n||"boolean"==typeof n||null==n?r?n:[`${t}=${n}`]:vf(n)?(n=e(t,vh(n.value),!0),r?n:[`${t}=Ref<`,n,">"]):m0(n)?[`${t}=fn${n.name?`<${n.name}>`:""}`]:(n=vh(n),r?n:[`${t}=`,n])}(e,n[e]))}),i.length>3&&r.push(" ..."),r),a]:[s+a]}(e))}),n)),console.warn(...r)}gE(),vM=!1}function vT(e,t,n,r){try{return r?e(...r):e()}catch(e){vE(e,t,n)}}function vO(e,t,n,r){if(m0(e)){let i=vT(e,t,n,r);return i&&m2(i)&&i.catch(e=>{vE(e,t,n)}),i}if(mQ(e)){let i=[];for(let o=0;o<e.length;o++)i.push(vO(e[o],t,n,r));return i}}function vE(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||mV;if(t){let r=t.parent,i=t.proxy,l=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(!1===t[n](e,i,l))return}r=r.parent}if(o){gO(),vT(o,null,10,[e,i,l]),gE();return}}!function(e,t=!0,n=!1){if(n)throw e;console.error(e)}(e,r,l)}let vN=[],vD=-1,vI=[],vL=null,v_=0,vR=Promise.resolve(),vz=null;function vP(e){let t=vz||vR;return e?t.then(this?e.bind(this):e):t}function vB(e){if(!(1&e.flags)){let t=vj(e),n=vN[vN.length-1];!n||!(2&e.flags)&&t>=vj(n)?vN.push(e):vN.splice(function(e){let t=vD+1,n=vN.length;for(;t<n;){let r=t+n>>>1,i=vN[r],o=vj(i);o<e||o===e&&2&i.flags?t=r+1:n=r}return t}(t),0,e),e.flags|=1,vF()}}function vF(){vz||(vz=vR.then(function e(t){try{for(vD=0;vD<vN.length;vD++){let e=vN[vD];e&&!(8&e.flags)&&(4&e.flags&&(e.flags&=-2),vT(e,e.i,e.i?15:14),4&e.flags||(e.flags&=-2))}}finally{for(;vD<vN.length;vD++){let e=vN[vD];e&&(e.flags&=-2)}vD=-1,vN.length=0,vq(t),vz=null,(vN.length||vI.length)&&e(t)}}))}function vH(e,t,n=vD+1){for(;n<vN.length;n++){let t=vN[n];if(t&&2&t.flags){if(e&&t.id!==e.uid)continue;vN.splice(n,1),n--,4&t.flags&&(t.flags&=-2),t(),4&t.flags||(t.flags&=-2)}}}function vq(e){if(vI.length){let e=[...new Set(vI)].sort((e,t)=>vj(e)-vj(t));if(vI.length=0,vL)return void vL.push(...e);for(v_=0,vL=e;v_<vL.length;v_++){let e=vL[v_];4&e.flags&&(e.flags&=-2),8&e.flags||e(),e.flags&=-2}vL=null,v_=0}}let vj=e=>null==e.id?2&e.flags?-1:1/0:e.id,vV=[],v$=!1;function vW(e,...t){s?s.emit(e,...t):v$||vV.push({event:e,args:t})}let vU=vJ("component:added"),vG=vJ("component:updated"),vK=vJ("component:removed");function vJ(e){return t=>{vW(e,t.appContext.app,t.uid,t.parent?t.parent.uid:void 0,t)}}let vZ=null,vY=null;function vX(e){let t=vZ;return vZ=e,vY=e&&e.type.__scopeId||null,t}function vQ(e,t,n,r){let i=e.dirs,o=t&&t.dirs;for(let l=0;l<i.length;l++){let s=i[l];o&&(s.oldValue=o[l].value);let a=s.dir[r];a&&(gO(),vO(a,n,8,[e.el,s,e,t]),gE())}}function v0(e,t,n=!1){let r=bA();if(r||y$){let i=y$?y$._context.provides:r?null==r.parent||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&m0(t)?t.call(r&&r.proxy):t}}let v1=Symbol.for("v-scx");function v4(e,t){return v5(e,null,t)}function v5(e,t,n=mV){let i,{immediate:o,deep:l,flush:s,once:a}=n,c=mJ({},n),u=t&&o||!t&&"post"!==s;if(bN){if("sync"===s){let e=v0(v1);i=e.__watcherHandles||(e.__watcherHandles=[])}else if(!u){let e=()=>{};return e.stop=mW,e.resume=mW,e.pause=mW,e}}let h=bM;c.call=(e,t,n)=>vO(e,h,t,n);let d=!1;"post"===s?c.scheduler=e=>{bt(e,h&&h.suspense)}:"sync"!==s&&(d=!0,c.scheduler=(e,t)=>{t?e():vB(e)}),c.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,h&&(e.id=h.uid,e.i=h))};let p=function(e,t,n=mV){let i,o,l,s,{immediate:a,deep:c,once:u,scheduler:h,augmentJob:d,call:p}=n,f=e=>c?e:vc(e)||!1===c||0===c?vC(e,1):vC(e),m=!1,y=!1;if(vf(e)?(o=()=>e.value,m=vc(e)):vs(e)?(o=()=>f(e),m=!0):mQ(e)?(y=!0,m=e.some(e=>vs(e)||vc(e)),o=()=>e.map(e=>vf(e)?e.value:vs(e)?f(e):m0(e)?p?p(e,2):e():void 0)):o=m0(e)?t?p?()=>p(e,2):e:()=>{if(l){gO();try{l()}finally{gE()}}let t=g;g=i;try{return p?p(e,3,[s]):e(s)}finally{g=t}}:mW,t&&c){let e=o,t=!0===c?1/0:c;o=()=>vC(e(),t)}let b=r,w=()=>{i.stop(),b&&b.active&&mZ(b.effects,i)};if(u&&t){let e=t;t=(...t)=>{e(...t),w()}}let x=y?Array(e.length).fill(vx):vx,k=e=>{if(1&i.flags&&(i.dirty||e))if(t){let e=i.run();if(c||m||(y?e.some((e,t)=>!Object.is(e,x[t])):!Object.is(e,x))){l&&l();let n=g;g=i;try{let n=[e,x===vx?void 0:y&&x[0]===vx?[]:x,s];x=e,p?p(t,3,n):t(...n)}finally{g=n}}}else i.run()};return d&&d(k),(i=new gv(o)).scheduler=h?()=>h(k,!1):k,s=e=>(function(e,t=!1,n=g){if(n){let t=vk.get(n);t||vk.set(n,t=[]),t.push(e)}})(e,!1,i),l=i.onStop=()=>{let e=vk.get(i);if(e){if(p)p(e,4);else for(let t of e)t();vk.delete(i)}},t?a?k(!0):x=i.run():h?h(k.bind(null,!0),!0):i.run(),w.pause=i.pause.bind(i),w.resume=i.resume.bind(i),w.stop=w,w}(e,t,c);return bN&&(i?i.push(p):u&&p()),p}function v2(e,t,n){let r,i=this.proxy,o=m1(e)?e.includes(".")?v3(i,e):()=>i[e]:e.bind(i,i);m0(t)?r=t:(r=t.handler,n=t);let l=bT(this),s=v5(o,r.bind(i),n);return l(),s}function v3(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}let v7=Symbol("_vte"),v6=Symbol("_leaveCb"),v8=Symbol("_enterCb"),v9=[Function,Array],ye={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:v9,onEnter:v9,onAfterEnter:v9,onEnterCancelled:v9,onBeforeLeave:v9,onLeave:v9,onAfterLeave:v9,onLeaveCancelled:v9,onBeforeAppear:v9,onAppear:v9,onAfterAppear:v9,onAppearCancelled:v9},yt=e=>{let t=e.subTree;return t.component?yt(t.component):t};function yn(e,t){6&e.shapeFlag&&e.component?(e.transition=t,yn(e.component.subTree,t)):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function yr(e,t){return m0(e)?mJ({name:e.name},t,{setup:e}):e}function yi(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function yo(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}let yl=new WeakMap;function ys(e,t,n,r,i=!1){if(mQ(e))return void e.forEach((e,o)=>ys(e,t&&(mQ(t)?t[o]:t),n,r,i));if(yc(r)&&!i){512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&ys(e,t,n,r.component.subTree);return}let o=4&r.shapeFlag?b_(r.component):r.el,l=i?null:o,{i:s,r:a}=e,c=t&&t.r,u=s.refs===mV?s.refs={}:s.refs,h=s.setupState,d=vh(h),p=h===mV?mU:e=>!yo(u,e)&&mX(d,e),f=(e,t)=>!(t&&yo(u,t));if(null!=c&&c!==a&&(ya(t),m1(c)?(u[c]=null,p(c)&&(h[c]=null)):vf(c)&&(f(c,t.k)&&(c.value=null),t.k&&(u[t.k]=null))),m0(a))vT(a,s,12,[l,u]);else{let t=m1(a),r=vf(a);if(t||r){let s=()=>{if(e.f){let n=t?p(a)?h[a]:u[a]:f(a)||!e.k?a.value:u[e.k];if(i)mQ(n)&&mZ(n,o);else if(mQ(n))n.includes(o)||n.push(o);else if(t)u[a]=[o],p(a)&&(h[a]=u[a]);else{let t=[o];f(a,e.k)&&(a.value=t),e.k&&(u[e.k]=t)}}else t?(u[a]=l,p(a)&&(h[a]=l)):r&&(f(a,e.k)&&(a.value=l),e.k&&(u[e.k]=l))};if(l){let t=()=>{s(),yl.delete(e)};t.id=-1,yl.set(e,t),bt(t,n)}else ya(e),s()}}}function ya(e){let t=yl.get(e);t&&(t.flags|=8,yl.delete(e))}ga().requestIdleCallback,ga().cancelIdleCallback;let yc=e=>!!e.type.__asyncLoader,yu=e=>e.type.__isKeepAlive;function yh(e,t){yp(e,"a",t)}function yd(e,t){yp(e,"da",t)}function yp(e,t,n=bM){let r=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(yf(t,r,n),n){let e=n.parent;for(;e&&e.parent;)yu(e.parent.vnode)&&function(e,t,n,r){let i=yf(t,e,r,!0);yx(()=>{mZ(r[t],i)},n)}(r,t,n,e),e=e.parent}}function yf(e,t,n=bM,r=!1){if(n){let i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...r)=>{gO();let i=bT(n),o=vO(t,n,e,r);return i(),gE(),o});return r?i.unshift(o):i.push(o),o}}let ym=e=>(t,n=bM)=>{bN&&"sp"!==e||yf(e,(...e)=>t(...e),n)},yg=ym("bm"),yv=ym("m"),yy=ym("bu"),yb=ym("u"),yw=ym("bum"),yx=ym("um"),yk=ym("sp"),yC=ym("rtg"),yS=ym("rtc");function yM(e,t=bM){yf("ec",e,t)}let yA=Symbol.for("v-ndc"),yT=e=>e?bE(e)?b_(e):yT(e.parent):null,yO=mJ(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>yT(e.parent),$root:e=>yT(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?y_(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{vB(e.update)}),$nextTick:e=>e.n||(e.n=vP.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?v2.bind(e):mW}),yE=(e,t)=>e!==mV&&!e.__isScriptSetup&&mX(e,t),yN={get({_:e},t){let n,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:o,data:l,props:s,accessCache:a,type:c,appContext:u}=e;if("$"!==t[0]){let e=a[t];if(void 0!==e)switch(e){case 1:return o[t];case 2:return l[t];case 4:return i[t];case 3:return s[t]}else{if(yE(o,t))return a[t]=1,o[t];if(__VUE_OPTIONS_API__&&l!==mV&&mX(l,t))return a[t]=2,l[t];if(mX(s,t))return a[t]=3,s[t];if(i!==mV&&mX(i,t))return a[t]=4,i[t];(!__VUE_OPTIONS_API__||yI)&&(a[t]=0)}}let h=yO[t];return h?("$attrs"===t&&gB(e.attrs,"get",""),h(e)):(n=c.__cssModules)&&(n=n[t])?n:i!==mV&&mX(i,t)?(a[t]=4,i[t]):mX(r=u.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:r,setupState:i,ctx:o}=e;return yE(i,t)?(i[t]=n,!0):__VUE_OPTIONS_API__&&r!==mV&&mX(r,t)?(r[t]=n,!0):!mX(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:o,type:l}},s){let a;return!!(n[s]||__VUE_OPTIONS_API__&&e!==mV&&"$"!==s[0]&&mX(e,s)||yE(t,s)||mX(o,s)||mX(r,s)||mX(yO,s)||mX(i.config.globalProperties,s)||(a=l.__cssModules)&&a[s])},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:mX(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function yD(e){return mQ(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let yI=!0;function yL(e,t,n){vO(mQ(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function y_(e){let t,n=e.type,{mixins:r,extends:i}=n,{mixins:o,optionsCache:l,config:{optionMergeStrategies:s}}=e.appContext,a=l.get(n);return a?t=a:o.length||r||i?(t={},o.length&&o.forEach(e=>yR(t,e,s,!0)),yR(t,n,s)):t=n,m5(n)&&l.set(n,t),t}function yR(e,t,n,r=!1){let{mixins:i,extends:o}=t;for(let l in o&&yR(e,o,n,!0),i&&i.forEach(t=>yR(e,t,n,!0)),t)if(r&&"expose"===l);else{let r=yz[l]||n&&n[l];e[l]=r?r(e[l],t[l]):t[l]}return e}let yz={data:yP,props:yq,emits:yq,methods:yH,computed:yH,beforeCreate:yF,created:yF,beforeMount:yF,mounted:yF,beforeUpdate:yF,updated:yF,beforeDestroy:yF,beforeUnmount:yF,destroyed:yF,unmounted:yF,activated:yF,deactivated:yF,errorCaptured:yF,serverPrefetch:yF,components:yH,directives:yH,watch:function(e,t){if(!e)return t;if(!t)return e;let n=mJ(Object.create(null),e);for(let r in t)n[r]=yF(e[r],t[r]);return n},provide:yP,inject:function(e,t){return yH(yB(e),yB(t))}};function yP(e,t){return t?e?function(){return mJ(m0(e)?e.call(this,this):e,m0(t)?t.call(this,this):t)}:t:e}function yB(e){if(mQ(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function yF(e,t){return e?[...new Set([].concat(e,t))]:t}function yH(e,t){return e?mJ(Object.create(null),e,t):t}function yq(e,t){return e?mQ(e)&&mQ(t)?[...new Set([...e,...t])]:mJ(Object.create(null),yD(e),yD(null!=t?t:{})):t}function yj(){return{app:null,config:{isNativeTag:mU,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let yV=0,y$=null;function yW(e,t,...n){var r;let i,o;if(e.isUnmounted)return;let l=e.vnode.props||mV,s=n,a=t.startsWith("update:"),c=a&&("modelValue"===(o=t.slice(7))||"model-value"===o?l.modelModifiers:l[`${o}Modifiers`]||l[`${ge(o)}Modifiers`]||l[`${gn(o)}Modifiers`]);c&&(c.trim&&(s=n.map(e=>m1(e)?e.trim():e)),c.number&&(s=n.map(gs))),__VUE_PROD_DEVTOOLS__&&(r=s,vW("component:emit",e.appContext.app,e,t,r));let u=l[i=gi(t)]||l[i=gi(ge(t))];!u&&a&&(u=l[i=gi(gn(t))]),u&&vO(u,e,6,s);let h=l[i+"Once"];if(h){if(e.emitted){if(e.emitted[i])return}else e.emitted={};e.emitted[i]=!0,vO(h,e,6,s)}}let yU=new WeakMap;function yG(e,t){return!!e&&!!mG(t)&&(mX(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||mX(e,gn(t))||mX(e,t))}function yK(e){let t,n,{type:r,vnode:i,proxy:o,withProxy:l,propsOptions:[s],slots:a,attrs:c,emit:u,render:h,renderCache:d,props:p,data:f,setupState:m,ctx:g,inheritAttrs:y}=e,b=vX(e);try{if(4&i.shapeFlag){let e=l||o;t=bb(h.call(e,e,d,p,m,f,g)),n=c}else t=bb(r.length>1?r(p,{attrs:c,slots:a,emit:u}):r(p,null)),n=r.props?c:yJ(c)}catch(n){bc.length=0,vE(n,e,1),t=bv(bs)}let w=t;if(n&&!1!==y){let e=Object.keys(n),{shapeFlag:t}=w;if(e.length){if(7&t)s&&e.some(mK)&&(n=yZ(n,s)),w=by(w,n,!1,!0);else if(0){let e=Object.keys(c),t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];mG(i)?mK(i)||t.push(i[2].toLowerCase()+i.slice(3)):n.push(i)}n.length&&vA(`Extraneous non-props attributes (${n.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`),t.length&&vA(`Extraneous non-emits event listeners (${t.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`)}}}return i.dirs&&((w=by(w,null,!1,!0)).dirs=w.dirs?w.dirs.concat(i.dirs):i.dirs),i.transition&&yn(w,i.transition),t=w,vX(b),t}let yJ=e=>{let t;for(let n in e)("class"===n||"style"===n||mG(n))&&((t||(t={}))[n]=e[n]);return t},yZ=(e,t)=>{let n={};for(let r in e)mK(r)&&r.slice(9)in t||(n[r]=e[r]);return n};function yY(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let o=r[i];if(yX(t,e,o)&&!yG(n,o))return!0}return!1}function yX(e,t,n){let r=e[n],i=t[n];return"style"===n&&m5(r)&&m5(i)?!function e(t,n){let r,i;if(t===n)return!0;let o="[object Date]"===(r=t,m3.call(r)),l="[object Date]"===(i=n,m3.call(i));if(o||l)return!!o&&!!l&&t.getTime()===n.getTime();if(o=m4(t),l=m4(n),o||l)return t===n;if(o=mQ(t),l=mQ(n),o||l)return!!o&&!!l&&function(t,n){if(t.length!==n.length)return!1;let r=!0;for(let i=0;r&&i<t.length;i++)r=e(t[i],n[i]);return r}(t,n);if(o=m5(t),l=m5(n),o||l){if(!o||!l||Object.keys(t).length!==Object.keys(n).length)return!1;for(let r in t){let i=t.hasOwnProperty(r),o=n.hasOwnProperty(r);if(i&&!o||!i&&o||!e(t[r],n[r]))return!1}}return String(t)===String(n)}(r,i):r!==i}let yQ={},y0=e=>Object.getPrototypeOf(e)===yQ;function y1(e,t,n,r){let i,[o,l]=e.propsOptions,s=!1;if(t)for(let a in t){let c;if(m6(a))continue;let u=t[a];o&&mX(o,c=ge(a))?l&&l.includes(c)?(i||(i={}))[c]=u:n[c]=u:yG(e.emitsOptions,a)||a in r&&u===r[a]||(r[a]=u,s=!0)}if(l){let t=vh(n),r=i||mV;for(let i=0;i<l.length;i++){let s=l[i];n[s]=y4(o,t,s,r[s],e,!mX(r,s))}}return s}function y4(e,t,n,r,i,o){let l=e[n];if(null!=l){let e=mX(l,"default");if(e&&void 0===r){let e=l.default;if(l.type!==Function&&!l.skipFactory&&m0(e)){let{propsDefaults:o}=i;if(n in o)r=o[n];else{let l=bT(i);r=o[n]=e.call(null,t),l()}}else r=e;i.ce&&i.ce._setProp(n,r)}l[0]&&(o&&!e?r=!1:l[1]&&(""===r||r===gn(n))&&(r=!0))}return r}let y5=new WeakMap;function y2(e){return!("$"===e[0]||m6(e))}let y3=e=>"_"===e||"_ctx"===e||"$stable"===e,y7=e=>mQ(e)?e.map(bb):[bb(e)],y6=(e,t,n)=>{if(t._n)return t;let r=function(e,t=vZ){if(!t||e._n)return e;let n=(...r)=>{let i;n._d&&bd(-1);let o=vX(t);try{i=e(...r)}finally{vX(o),n._d&&bd(1)}return __VUE_PROD_DEVTOOLS__&&vG(t),i};return n._n=!0,n._c=!0,n._d=!0,n}((...e)=>y7(t(...e)),n);return r._c=!1,r},y8=(e,t,n)=>{let r=e._ctx;for(let n in e){if(y3(n))continue;let i=e[n];if(m0(i))t[n]=y6(n,i,r);else if(null!=i){let e=y7(i);t[n]=()=>e}}},y9=(e,t)=>{let n=y7(t);e.slots.default=()=>n},be=(e,t,n)=>{for(let r in t)(n||!y3(r))&&(e[r]=t[r])},bt=function(e,t){if(t&&t.pendingBranch)mQ(e)?t.effects.push(...e):t.effects.push(e);else mQ(e)?vI.push(...e):vL&&-1===e.id?vL.splice(v_+1,0,e):1&e.flags||(vI.push(e),e.flags|=1),vF()};function bn({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function br({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function bi(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}let bo=Symbol.for("v-fgt"),bl=Symbol.for("v-txt"),bs=Symbol.for("v-cmt"),ba=Symbol.for("v-stc"),bc=[],bu=null,bh=1;function bd(e,t=!1){bh+=e,e<0&&bu&&t&&(bu.hasOnce=!0)}function bp(e){return!!e&&!0===e.__v_isVNode}function bf(e,t){return e.type===t.type&&e.key===t.key}let bm=({key:e})=>null!=e?e:null,bg=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?m1(e)||vf(e)||m0(e)?{i:vZ,r:e,k:t,f:!!n}:e:null),bv=function(e,t=null,n=null,r=0,i=null,o=!1){var l,s;if(e&&e!==yA||(e=bs),bp(e)){let r=by(e,t,!0);return n&&bx(r,n),bh>0&&!o&&bu&&(6&r.shapeFlag?bu[bu.indexOf(e)]=r:bu.push(r)),r.patchFlag=-2,r}if(m0(l=e)&&"__vccOpts"in l&&(e=e.__vccOpts),t){let{class:e,style:n}=t=(s=t)?vu(s)||y0(s)?mJ({},s):s:null;e&&!m1(e)&&(t.class=gp(e)),m5(n)&&(vu(n)&&!mQ(n)&&(n=mJ({},n)),t.style=gc(n))}let a=m1(e)?1:e.__isSuspense?128:e.__isTeleport?64:m5(e)?4:2*!!m0(e);return function(e,t=null,n=null,r=0,i=null,o=+(e!==bo),l=!1,s=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&bm(t),ref:t&&bg(t),scopeId:vY,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:vZ};return s?(bx(a,n),128&o&&e.normalize(a)):n&&(a.shapeFlag|=m1(n)?8:16),bh>0&&!l&&bu&&(a.patchFlag>0||6&o)&&32!==a.patchFlag&&bu.push(a),a}(e,t,n,r,i,a,o,!0)};function by(e,t,n=!1,r=!1){let{props:i,ref:o,patchFlag:l,children:s,transition:a}=e,c=t?function(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if("class"===e)t.class!==r.class&&(t.class=gp([t.class,r.class]));else if("style"===e)t.style=gc([t.style,r.style]);else if(mG(e)){let n=t[e],i=r[e];i&&n!==i&&!(mQ(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:null!=i||null!=n||mK(e)||(t[e]=i)}else""!==e&&(t[e]=r[e])}return t}(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&bm(c),ref:t&&t.ref?n&&o?mQ(o)?o.concat(bg(t)):[o,bg(t)]:bg(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==bo?-1===l?16:16|l:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&by(e.ssContent),ssFallback:e.ssFallback&&by(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&r&&yn(u,a.clone(u)),u}function bb(e){return null==e||"boolean"==typeof e?bv(bs):mQ(e)?bv(bo,null,e.slice()):bp(e)?bw(e):bv(bl,null,String(e))}function bw(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:by(e)}function bx(e,t){let n=0,{shapeFlag:r}=e;if(null==t)t=null;else if(mQ(t))n=16;else if("object"==typeof t)if(65&r){let n=t.default;n&&(n._c&&(n._d=!1),bx(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;r||y0(t)?3===r&&vZ&&(1===vZ.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=vZ}else m0(t)?(t={default:t,_ctx:vZ},n=32):(t=String(t),64&r?(n=16,t=[function(e=" ",t=0){return bv(bl,null,e,t)}(t)]):n=8);e.children=t,e.shapeFlag|=n}function bk(e,t,n,r=null){vO(e,t,7,[n,r])}let bC=yj(),bS=0,bM=null,bA=()=>bM||vZ;{let e=ga(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};a=t("__VUE_INSTANCE_SETTERS__",e=>bM=e),c=t("__VUE_SSR_SETTERS__",e=>bN=e)}let bT=e=>{let t=bM;return a(e),e.scope.on(),()=>{e.scope.off(),a(t)}},bO=()=>{bM&&bM.scope.off(),a(null)};function bE(e){return 4&e.vnode.shapeFlag}let bN=!1;function bD(e,t,n){m0(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:m5(t)&&(__VUE_PROD_DEVTOOLS__&&(e.devtoolsRawSetupState=t),e.setupState=vb(t)),bI(e,n)}function bI(e,t,n){let r=e.type;if(!e.render){if(!t&&u&&!r.render){let t=r.template||__VUE_OPTIONS_API__&&y_(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:o,compilerOptions:l}=r;r.render=u(t,mJ(mJ({isCustomElement:n,delimiters:o},i),l))}}e.render=r.render||mW,h&&h(e)}if(__VUE_OPTIONS_API__&&1){let t=bT(e);gO();try{!function(e){let t=y_(e),n=e.proxy,r=e.ctx;yI=!1,t.beforeCreate&&yL(t.beforeCreate,e,"bc");let{data:i,computed:o,methods:l,watch:s,provide:a,inject:c,created:u,beforeMount:h,mounted:d,beforeUpdate:p,updated:f,activated:m,deactivated:g,beforeDestroy:y,beforeUnmount:b,destroyed:w,unmounted:x,render:k,renderTracked:C,renderTriggered:S,errorCaptured:M,serverPrefetch:A,expose:T,inheritAttrs:O,components:E,directives:N,filters:D}=t;if(c&&function(e,t,n=mW){for(let n in mQ(e)&&(e=yB(e)),e){let r,i=e[n];vf(r=m5(i)?"default"in i?v0(i.from||n,i.default,!0):v0(i.from||n):v0(i))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[n]=r}}(c,r,null),l)for(let e in l){let t=l[e];m0(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);m5(t)&&(e.data=vi(t))}if(yI=!0,o)for(let e in o){let t=o[e],i=m0(t)?t.bind(n,n):m0(t.get)?t.get.bind(n,n):mW,l=bP({get:i,set:!m0(t)&&m0(t.set)?t.set.bind(n):mW});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e})}if(s)for(let e in s)!function e(t,n,r,i){let o=i.includes(".")?v3(r,i):()=>r[i];if(m1(t)){let e=n[t];m0(e)&&v5(o,e,void 0)}else if(m0(t))v5(o,t.bind(r),void 0);else if(m5(t))if(mQ(t))t.forEach(t=>e(t,n,r,i));else{let e=m0(t.handler)?t.handler.bind(r):n[t.handler];m0(e)&&v5(o,e,t)}}(s[e],r,n,e);if(a){let e=m0(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{var n=e[t];if(bM){let e=bM.provides,r=bM.parent&&bM.parent.provides;r===e&&(e=bM.provides=Object.create(r)),e[t]=n}})}function I(e,t){mQ(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(u&&yL(u,e,"c"),I(yg,h),I(yv,d),I(yy,p),I(yb,f),I(yh,m),I(yd,g),I(yM,M),I(yS,C),I(yC,S),I(yw,b),I(yx,x),I(yk,A),mQ(T))if(T.length){let t=e.exposed||(e.exposed={});T.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===mW&&(e.render=k),null!=O&&(e.inheritAttrs=O),E&&(e.components=E),N&&(e.directives=N),A&&yi(e)}(e)}finally{gE(),t()}}}let bL={get:(e,t)=>(gB(e,"get",""),e[t])};function b_(e){var t;return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(vb((!mX(t=e.exposed,"__v_skip")&&Object.isExtensible(t)&&gl(t,"__v_skip",!0),t)),{get:(t,n)=>n in t?t[n]:n in yO?yO[n](e):void 0,has:(e,t)=>t in e||t in yO})):e.proxy}let bR=/(?:^|[-_])\w/g;function bz(e,t,n=!1){let r=function(e,t=!0){return m0(e)?e.displayName||e.name:e.name||t&&e.__name}(t);if(!r&&t.__file){let e=t.__file.match(/([^/\\]+)\.\w+$/);e&&(r=e[1])}if(!r&&e){let n=e=>{for(let n in e)if(e[n]===t)return n};r=n(e.components)||e.parent&&n(e.parent.type.components)||n(e.appContext.components)}return r?r.replace(bR,e=>e.toUpperCase()).replace(/[-_]/g,""):n?"App":"Anonymous"}let bP=(e,t)=>(function(e,t=!1){let n,r;return m0(e)?n=e:(n=e.get,r=e.set),new vw(n,r,t)})(e,bN);function bB(e,t,n){try{bd(-1);let r=arguments.length;if(2!==r)return r>3?n=Array.prototype.slice.call(arguments,2):3===r&&bp(n)&&(n=[n]),bv(e,t,n);if(!m5(t)||mQ(t))return bv(e,null,t);if(bp(t))return bv(e,null,[t]);return bv(e,t)}finally{bd(1)}}let bF="3.5.35",bH="u">typeof window&&window.trustedTypes;if(bH)try{y=bH.createPolicy("vue",{createHTML:e=>e})}catch(e){}let bq=y?e=>y.createHTML(e):e=>e,bj="u">typeof document?document:null,bV=bj&&bj.createElement("template"),b$=Symbol("_vtc"),bW=Symbol("_vod"),bU=Symbol("_vsh"),bG=Symbol(""),bK=/(?:^|;)\s*display\s*:/,bJ=/\s*!important$/;function bZ(e,t,n){if(mQ(n))n.forEach(n=>bZ(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let r=function(e,t){let n=bX[t];if(n)return n;let r=ge(t);if("filter"!==r&&r in e)return bX[t]=r;r=gr(r);for(let n=0;n<bY.length;n++){let i=bY[n]+r;if(i in e)return bX[t]=i}return t}(e,t);bJ.test(n)?e.setProperty(gn(r),n.replace(bJ,""),"important"):e[r]=n}}let bY=["Webkit","Moz","ms"],bX={},bQ="http://www.w3.org/1999/xlink";function b0(e,t,n,r,i,o=gf(t)){if(r&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(bQ,t.slice(6,t.length)):e.setAttributeNS(bQ,t,n);else null==n||o&&!(n||""===n)?e.removeAttribute(t):e.setAttribute(t,o?"":m4(n)?String(n):n)}function b1(e,t,n,r,i){if("innerHTML"===t||"textContent"===t){null!=n&&(e[t]="innerHTML"===t?bq(n):n);return}let o=e.tagName;if("value"===t&&"PROGRESS"!==o&&!o.includes("-")){let r="OPTION"===o?e.getAttribute("value")||"":e.value,i=null==n?"checkbox"===e.type?"on":"":String(n);r===i&&"_value"in e||(e.value=i),null==n&&e.removeAttribute(t),e._value=n;return}let l=!1;if(""===n||null==n){let r=typeof e[t];if("boolean"===r){var s;n=!!(s=n)||""===s}else null==n&&"string"===r?(n="",l=!0):"number"===r&&(n=0,l=!0)}try{e[t]=n}catch(e){}l&&e.removeAttribute(i||t)}let b4=Symbol("_vei"),b5=/(?:Once|Passive|Capture)$/,b2=0,b3=Promise.resolve(),b7=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2);"u">typeof HTMLElement&&HTMLElement;let b6=mJ({patchProp:(e,t,n,r,i,o)=>{let l="svg"===i;if("class"===t){var s;let t;s=r,(t=e[b$])&&(s=(s?[s,...t]:[...t]).join(" ")),null==s?e.removeAttribute("class"):l?e.setAttribute("class",s):e.className=s}else"style"===t?function(e,t,n){let r=e.style,i=m1(n),o=!1;if(n&&!i){if(t)if(m1(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&bZ(r,t,"")}else for(let e in t)null==n[e]&&bZ(r,e,"");for(let i in n){var l,s,a,c;"display"===i&&(o=!0);let u=n[i];null!=u?(l=e,s=i,a=!m1(t)&&t?t[i]:void 0,c=u,"TEXTAREA"===l.tagName&&("width"===s||"height"===s)&&m1(c)&&a===c||bZ(r,i,u)):bZ(r,i,"")}}else if(i){if(t!==n){let e=r[bG];e&&(n+=";"+e),r.cssText=n,o=bK.test(n)}}else t&&e.removeAttribute("style");bW in e&&(e[bW]=o?r.display:"",e[bU]&&(r.display="none"))}(e,n,r):mG(t)?mK(t)||function(e,t,n,r=null){let i=e[b4]||(e[b4]={}),o=i[t];if(n&&o)o.value=n;else{let[a,c]=function(e){let t;if(b5.test(e)){let n;for(t={};n=e.match(b5);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):gn(e.slice(2)),t]}(t);if(n){var l,s;let o,u=i[t]=(l=n,s=r,(o=e=>{if(e._vts){if(e._vts<=o.attached)return}else e._vts=Date.now();let t=o.value;if(mQ(t)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let r=t.slice(),i=[e];for(let t=0;t<r.length&&!e._stopped;t++){let e=r[t];e&&vO(e,s,5,i)}}else vO(t,s,5,[e])}).value=l,o.attached=b2||(b3.then(()=>b2=0),b2=Date.now()),o);e.addEventListener(a,u,c)}else o&&(e.removeEventListener(a,o,c),i[t]=void 0)}}(e,t,r,o):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,r){if(r)return!!("innerHTML"===t||"textContent"===t||t in e&&b7(t)&&m0(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t||"sandbox"===t&&"IFRAME"===e.tagName||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(b7(t)&&m1(n))&&t in e}(e,t,r,l))?e._isVueCE&&(function(e,t){let n=e._def.props;if(!n)return!1;let r=ge(t);return Array.isArray(n)?n.some(e=>ge(e)===r):Object.keys(n).some(e=>ge(e)===r)}(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!m1(r)))?b1(e,ge(t),r,o,t):("true-value"===t?e._trueValue=r:"false-value"===t&&(e._falseValue=r),b0(e,t,r,l)):(b1(e,t,r),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||b0(e,t,r,l,o,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i="svg"===t?bj.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?bj.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?bj.createElement(e,{is:n}):bj.createElement(e);return"select"===e&&r&&null!=r.multiple&&i.setAttribute("multiple",r.multiple),i},createText:e=>bj.createTextNode(e),createComment:e=>bj.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>bj.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,o){let l=n?n.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==o&&(i=i.nextSibling););else{bV.innerHTML=bq("svg"===r?`<svg>${e}</svg>`:"mathml"===r?`<math>${e}</math>`:e);let i=bV.content;if("svg"===r||"mathml"===r){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),b8=(...e)=>{let t=(d||(d=function(e){var t;let n,r;"boolean"!=typeof __VUE_OPTIONS_API__&&(ga().__VUE_OPTIONS_API__=!0),"boolean"!=typeof __VUE_PROD_DEVTOOLS__&&(ga().__VUE_PROD_DEVTOOLS__=!1),"boolean"!=typeof __VUE_PROD_HYDRATION_MISMATCH_DETAILS__&&(ga().__VUE_PROD_HYDRATION_MISMATCH_DETAILS__=!1);let i=ga();i.__VUE__=!0,__VUE_PROD_DEVTOOLS__&&function e(t,n){var r,i;(s=t)?(s.enabled=!0,vV.forEach(({event:e,args:t})=>s.emit(e,...t)),vV=[]):"u">typeof window&&window.HTMLElement&&!(null==(i=null==(r=window.navigator)?void 0:r.userAgent)?void 0:i.includes("jsdom"))?((n.__VUE_DEVTOOLS_HOOK_REPLAY__=n.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(t=>{e(t,n)}),setTimeout(()=>{s||(n.__VUE_DEVTOOLS_HOOK_REPLAY__=null,v$=!0,vV=[])},3e3)):(v$=!0,vV=[])}(i.__VUE_DEVTOOLS_GLOBAL_HOOK__,i);let{insert:o,remove:l,patchProp:a,createElement:u,createText:h,createComment:d,setText:p,setElementText:f,parentNode:m,nextSibling:g,setScopeId:y=mW,insertStaticContent:b}=e,w=(e,t,n,r=null,i=null,o=null,l,s=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!bf(e,t)&&(r=U(e),q(e,i,o,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:c,ref:u,shapeFlag:h}=t;switch(c){case bl:x(e,t,n,r);break;case bs:k(e,t,n,r);break;case ba:null==e&&C(t,n,r,l);break;case bo:D(e,t,n,r,i,o,l,s,a);break;default:1&h?S(e,t,n,r,i,o,l,s,a):6&h?I(e,t,n,r,i,o,l,s,a):(64&h||128&h)&&c.process(e,t,n,r,i,o,l,s,a,J)}null!=u&&i?ys(u,e&&e.ref,o,t||e,!t):null==u&&e&&null!=e.ref&&ys(e.ref,null,o,e,!0)},x=(e,t,n,r)=>{if(null==e)o(t.el=h(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&p(n,t.children)}},k=(e,t,n,r)=>{null==e?o(t.el=d(t.children||""),n,r):t.el=e.el},C=(e,t,n,r)=>{[e.el,e.anchor]=b(e.children,t,n,r,e.el,e.anchor)},S=(e,t,n,r,i,o,l,s,a)=>{if("svg"===t.type?l="svg":"math"===t.type&&(l="mathml"),null==e)M(t,n,r,i,o,l,s,a);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),O(e,t,i,o,l,s,a)}finally{n&&n._endPatch()}}},M=(e,t,n,r,i,l,s,c)=>{var h,d;let p,m,{props:g,shapeFlag:y,transition:b,dirs:w}=e;if(p=e.el=u(e.type,l,g&&g.is,g),8&y?f(p,e.children):16&y&&T(e.children,p,null,r,i,bn(e,l),s,c),w&&vQ(e,null,r,"created"),A(p,e,e.scopeId,s,r),g){for(let e in g)"value"===e||m6(e)||a(p,e,null,g[e],l,r);"value"in g&&a(p,"value",null,g.value,l),(m=g.onVnodeBeforeMount)&&bk(m,r,e)}__VUE_PROD_DEVTOOLS__&&(gl(p,"__vnode",e,!0),gl(p,"__vueParentComponent",r,!0)),w&&vQ(e,null,r,"beforeMount");let x=(h=i,d=b,(!h||h&&!h.pendingBranch)&&d&&!d.persisted);x&&b.beforeEnter(p),o(p,t,n),((m=g&&g.onVnodeMounted)||x||w)&&bt(()=>{m&&bk(m,r,e),x&&b.enter(p),w&&vQ(e,null,r,"mounted")},i)},A=(e,t,n,r,i)=>{if(n&&y(e,n),r)for(let t=0;t<r.length;t++)y(e,r[t]);if(i){let n=i.subTree;if(t===n||n.type.__isSuspense&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;A(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},T=(e,t,n,r,i,o,l,s,a=0)=>{for(let c=a;c<e.length;c++)w(null,e[c]=s?bw(e[c]):bb(e[c]),t,n,r,i,o,l,s)},O=(e,t,n,r,i,o,l)=>{let s,c=t.el=e.el;__VUE_PROD_DEVTOOLS__&&(c.__vnode=t);let{patchFlag:u,dynamicChildren:h,dirs:d}=t;u|=16&e.patchFlag;let p=e.props||mV,m=t.props||mV;if(n&&br(n,!1),(s=m.onVnodeBeforeUpdate)&&bk(s,n,t,e),d&&vQ(t,e,n,"beforeUpdate"),n&&br(n,!0),(p.innerHTML&&null==m.innerHTML||p.textContent&&null==m.textContent)&&f(c,""),h?E(e.dynamicChildren,h,c,n,r,bn(t,i),o):l||P(e,t,c,null,n,r,bn(t,i),o,!1),u>0){if(16&u)N(c,p,m,n,i);else if(2&u&&p.class!==m.class&&a(c,"class",null,m.class,i),4&u&&a(c,"style",p.style,m.style,i),8&u){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],l=m[r];(l!==o||"value"===r)&&a(c,r,o,l,i,n)}}1&u&&e.children!==t.children&&f(c,t.children)}else l||null!=h||N(c,p,m,n,i);((s=m.onVnodeUpdated)||d)&&bt(()=>{s&&bk(s,n,t,e),d&&vQ(t,e,n,"updated")},r)},E=(e,t,n,r,i,o,l)=>{for(let s=0;s<t.length;s++){let a=e[s],c=t[s],u=a.el&&(a.type===bo||!bf(a,c)||198&a.shapeFlag)?m(a.el):n;w(a,c,u,null,r,i,o,l,!0)}},N=(e,t,n,r,i)=>{if(t!==n){if(t!==mV)for(let o in t)m6(o)||o in n||a(e,o,t[o],null,i,r);for(let o in n){if(m6(o))continue;let l=n[o],s=t[o];l!==s&&"value"!==o&&a(e,o,s,l,i,r)}"value"in n&&a(e,"value",t.value,n.value,i)}},D=(e,t,n,r,i,l,s,a,c)=>{let u=t.el=e?e.el:h(""),d=t.anchor=e?e.anchor:h(""),{patchFlag:p,dynamicChildren:f,slotScopeIds:m}=t;(m&&(a=a?a.concat(m):m),null==e)?(o(u,n,r),o(d,n,r),T(t.children||[],n,d,i,l,s,a,c)):p>0&&64&p&&f&&e.dynamicChildren&&e.dynamicChildren.length===f.length?(E(e.dynamicChildren,f,n,i,l,s,a),(null!=t.key||i&&t===i.subTree)&&function e(t,n,r=!1){let i=t.children,o=n.children;if(mQ(i)&&mQ(o))for(let t=0;t<i.length;t++){let n=i[t],l=o[t];1&l.shapeFlag&&!l.dynamicChildren&&((l.patchFlag<=0||32===l.patchFlag)&&((l=o[t]=bw(o[t])).el=n.el),r||-2===l.patchFlag||e(n,l)),l.type===bl&&(-1===l.patchFlag&&(l=o[t]=bw(l)),l.el=n.el),l.type!==bs||l.el||(l.el=n.el)}}(e,t,!0)):P(e,t,n,d,i,l,s,a,c)},I=(e,t,n,r,i,o,l,s,a)=>{t.slotScopeIds=s,null==e?512&t.shapeFlag?i.ctx.activate(t,n,r,l,a):L(t,n,r,i,o,l,a):_(e,t,a)},L=(e,t,n,r,i,o,l)=>{var s,a,u;let h,d,p,f=(s=e,a=r,u=i,h=s.type,d=(a?a.appContext:s.appContext)||bC,(p={uid:bS++,vnode:s,type:h,parent:a,appContext:d,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new gm(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:a?a.provides:Object.create(d.provides),ids:a?a.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:function e(t,n,r=!1){let i=__VUE_OPTIONS_API__&&r?y5:n.propsCache,o=i.get(t);if(o)return o;let l=t.props,s={},a=[],c=!1;if(__VUE_OPTIONS_API__&&!m0(t)){let i=t=>{c=!0;let[r,i]=e(t,n,!0);mJ(s,r),i&&a.push(...i)};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}if(!l&&!c)return m5(t)&&i.set(t,m$),m$;if(mQ(l))for(let e=0;e<l.length;e++){let t=ge(l[e]);y2(t)&&(s[t]=mV)}else if(l)for(let e in l){let t=ge(e);if(y2(t)){let n=l[e],r=s[t]=mQ(n)||m0(n)?{type:n}:mJ({},n),i=r.type,o=!1,c=!0;if(mQ(i))for(let e=0;e<i.length;++e){let t=i[e],n=m0(t)&&t.name;if("Boolean"===n){o=!0;break}"String"===n&&(c=!1)}else o=m0(i)&&"Boolean"===i.name;r[0]=o,r[1]=c,(o||mX(r,"default"))&&a.push(t)}}let u=[s,a];return m5(t)&&i.set(t,u),u}(h,d),emitsOptions:function e(t,n,r=!1){let i=__VUE_OPTIONS_API__&&r?yU:n.emitsCache,o=i.get(t);if(void 0!==o)return o;let l=t.emits,s={},a=!1;if(__VUE_OPTIONS_API__&&!m0(t)){let i=t=>{let r=e(t,n,!0);r&&(a=!0,mJ(s,r))};!r&&n.mixins.length&&n.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}return l||a?(mQ(l)?l.forEach(e=>s[e]=null):mJ(s,l),m5(t)&&i.set(t,s),s):(m5(t)&&i.set(t,null),null)}(h,d),emit:null,emitted:null,propsDefaults:mV,inheritAttrs:h.inheritAttrs,ctx:mV,data:mV,props:mV,attrs:mV,slots:mV,refs:mV,setupState:mV,setupContext:null,suspense:u,suspenseId:u?u.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null}).ctx={_:p},p.root=a?a.root:p,p.emit=yW.bind(null,p),s.ce&&s.ce(p),e.component=p);if(yu(e)&&(f.ctx.renderer=J),!function(e,t=!1,n=!1){t&&c(t);let{props:r,children:i}=e.vnode,o=bE(e);!function(e,t,n,r=!1){let i={},o=Object.create(yQ);for(let n in e.propsDefaults=Object.create(null),y1(e,t,i,o),e.propsOptions[0])n in i||(i[n]=void 0);n?e.props=r?i:vl(i,!1,g5,g8,vt):e.type.props?e.props=i:e.props=o,e.attrs=o}(e,r,o,t);var l=n||t;let s=e.slots=Object.create(yQ);if(32&e.vnode.shapeFlag){let e=i._;e?(be(s,i,l),l&&gl(s,"_",e,!0)):y8(i,s)}else i&&y9(e,i);o&&function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,yN);let{setup:r}=n;if(r){var i;gO();let n=e.setupContext=r.length>1?{attrs:new Proxy((i=e).attrs,bL),slots:i.slots,emit:i.emit,expose:e=>{i.exposed=e||{}}}:null,o=bT(e),l=vT(r,e,0,[e.props,n]),s=m2(l);if(gE(),o(),(s||e.sp)&&!yc(e)&&yi(e),s){if(l.then(bO,bO),t)return l.then(n=>{bD(e,n,t)}).catch(t=>{vE(t,e,0)});e.asyncDep=l}else bD(e,l,t)}else bI(e,t)}(e,t),t&&c(!1)}(f,!1,l),f.asyncDep){if(i&&i.registerDep(f,R,l),!e.el){let r=f.subTree=bv(bs);k(null,r,t,n),e.placeholder=r.el}}else R(f,e,t,n,i,o,l)},_=(e,t,n)=>{let r=t.component=e.component;if(function(e,t,n){let{props:r,children:i,component:o}=e,{props:l,children:s,patchFlag:a}=t,c=o.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!i||!!s)&&(!s||!s.$stable)||r!==l&&(r?!l||yY(r,l,c):!!l);if(1024&a)return!0;if(16&a)return r?yY(r,l,c):!!l;if(8&a){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(yX(l,r,n)&&!yG(c,n))return!0}}return!1}(e,t,n))if(r.asyncDep&&!r.asyncResolved)return void z(r,t,n);else r.next=t,r.update();else t.el=e.el,r.vnode=t},R=(e,t,n,i,o,l,s)=>{e.scope.on();let a=e.effect=new gv(()=>{if(e.isMounted){let t,{next:n,bu:r,u:i,parent:a,vnode:u}=e;{let t=function e(t){let n=t.subTree.component;if(n)if(n.asyncDep&&!n.asyncResolved)return n;else return e(n)}(e);if(t){n&&(n.el=u.el,z(e,n,s)),t.asyncDep.then(()=>{bt(()=>{e.isUnmounted||c()},o)});return}}let h=n;br(e,!1),n?(n.el=u.el,z(e,n,s)):n=u,r&&go(r),(t=n.props&&n.props.onVnodeBeforeUpdate)&&bk(t,a,n,u),br(e,!0);let d=yK(e),p=e.subTree;e.subTree=d,w(p,d,m(p.el),U(p),e,o,l),n.el=d.el,null===h&&function({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}(e,d.el),i&&bt(i,o),(t=n.props&&n.props.onVnodeUpdated)&&bt(()=>bk(t,a,n,u),o),__VUE_PROD_DEVTOOLS__&&vG(e)}else{let s,{el:a,props:c}=t,{bm:u,m:h,parent:d,root:p,type:f}=e,m=yc(t);if(br(e,!1),u&&go(u),!m&&(s=c&&c.onVnodeBeforeMount)&&bk(s,d,t),br(e,!0),a&&r){let t=()=>{e.subTree=yK(e),r(a,e.subTree,e,o,null)};m&&f.__asyncHydrate?f.__asyncHydrate(a,e,t):t()}else{p.ce&&p.ce._hasShadowRoot()&&p.ce._injectChildStyle(f,e.parent?e.parent.type:void 0);let r=e.subTree=yK(e);w(null,r,n,i,e,o,l),t.el=r.el}if(h&&bt(h,o),!m&&(s=c&&c.onVnodeMounted)){let e=t;bt(()=>bk(s,d,e),o)}(256&t.shapeFlag||d&&yc(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&bt(e.a,o),e.isMounted=!0,__VUE_PROD_DEVTOOLS__&&vU(e),t=n=i=null}});e.scope.off();let c=e.update=a.run.bind(a),u=e.job=a.runIfDirty.bind(a);u.i=e,u.id=e.uid,a.scheduler=()=>vB(u),br(e,!0),c()},z=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,r){let{props:i,attrs:o,vnode:{patchFlag:l}}=e,s=vh(i),[a]=e.propsOptions,c=!1;if((r||l>0)&&!(16&l)){if(8&l){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let l=n[r];if(yG(e.emitsOptions,l))continue;let u=t[l];if(a)if(mX(o,l))u!==o[l]&&(o[l]=u,c=!0);else{let t=ge(l);i[t]=y4(a,s,t,u,e,!1)}else u!==o[l]&&(o[l]=u,c=!0)}}}else{let r;for(let l in y1(e,t,i,o)&&(c=!0),s)t&&(mX(t,l)||(r=gn(l))!==l&&mX(t,r))||(a?n&&(void 0!==n[l]||void 0!==n[r])&&(i[l]=y4(a,s,l,void 0,e,!0)):delete i[l]);if(o!==s)for(let e in o)t&&mX(t,e)||(delete o[e],c=!0)}c&&gF(e.attrs,"set","")}(e,t.props,r,n),((e,t,n)=>{let{vnode:r,slots:i}=e,o=!0,l=mV;if(32&r.shapeFlag){let e=t._;e?n&&1===e?o=!1:be(i,t,n):(o=!t.$stable,y8(t,i)),l=t}else t&&(y9(e,t),l={default:1});if(o)for(let e in i)y3(e)||null!=l[e]||delete i[e]})(e,t.children,n),gO(),vH(e),gE()},P=(e,t,n,r,i,o,l,s,a=!1)=>{let c=e&&e.children,u=e?e.shapeFlag:0,h=t.children,{patchFlag:d,shapeFlag:p}=t;if(d>0){if(128&d)return void F(c,h,n,r,i,o,l,s,a);else if(256&d)return void B(c,h,n,r,i,o,l,s,a)}8&p?(16&u&&W(c,i,o),h!==c&&f(n,h)):16&u?16&p?F(c,h,n,r,i,o,l,s,a):W(c,i,o,!0):(8&u&&f(n,""),16&p&&T(h,n,r,i,o,l,s,a))},B=(e,t,n,r,i,o,l,s,a)=>{let c;e=e||m$,t=t||m$;let u=e.length,h=t.length,d=Math.min(u,h);for(c=0;c<d;c++){let r=t[c]=a?bw(t[c]):bb(t[c]);w(e[c],r,n,null,i,o,l,s,a)}u>h?W(e,i,o,!0,!1,d):T(t,n,r,i,o,l,s,a,d)},F=(e,t,n,r,i,o,l,s,a)=>{let c=0,u=t.length,h=e.length-1,d=u-1;for(;c<=h&&c<=d;){let r=e[c],u=t[c]=a?bw(t[c]):bb(t[c]);if(bf(r,u))w(r,u,n,null,i,o,l,s,a);else break;c++}for(;c<=h&&c<=d;){let r=e[h],c=t[d]=a?bw(t[d]):bb(t[d]);if(bf(r,c))w(r,c,n,null,i,o,l,s,a);else break;h--,d--}if(c>h){if(c<=d){let e=d+1,h=e<u?t[e].el:r;for(;c<=d;)w(null,t[c]=a?bw(t[c]):bb(t[c]),n,h,i,o,l,s,a),c++}}else if(c>d)for(;c<=h;)q(e[c],i,o,!0),c++;else{let p,f=c,m=c,g=new Map;for(c=m;c<=d;c++){let e=t[c]=a?bw(t[c]):bb(t[c]);null!=e.key&&g.set(e.key,c)}let y=0,b=d-m+1,x=!1,k=0,C=Array(b);for(c=0;c<b;c++)C[c]=0;for(c=f;c<=h;c++){let r,u=e[c];if(y>=b){q(u,i,o,!0);continue}if(null!=u.key)r=g.get(u.key);else for(p=m;p<=d;p++)if(0===C[p-m]&&bf(u,t[p])){r=p;break}void 0===r?q(u,i,o,!0):(C[r-m]=c+1,r>=k?k=r:x=!0,w(u,t[r],n,null,i,o,l,s,a),y++)}let S=x?function(e){let t,n,r,i,o,l=e.slice(),s=[0],a=e.length;for(t=0;t<a;t++){let a=e[t];if(0!==a){if(e[n=s[s.length-1]]<a){l[t]=n,s.push(t);continue}for(r=0,i=s.length-1;r<i;)e[s[o=r+i>>1]]<a?r=o+1:i=o;a<e[s[r]]&&(r>0&&(l[t]=s[r-1]),s[r]=t)}}for(r=s.length,i=s[r-1];r-- >0;)s[r]=i,i=l[i];return s}(C):m$;for(p=S.length-1,c=b-1;c>=0;c--){let e=m+c,h=t[e],d=t[e+1],f=e+1<u?d.el||function e(t){if(t.placeholder)return t.placeholder;let n=t.component;return n?e(n.subTree):null}(d):r;0===C[c]?w(null,h,n,f,i,o,l,s,a):x&&(p<0||c!==S[p]?H(h,n,f,2):p--)}}},H=(e,t,n,r,i=null)=>{let{el:s,type:a,transition:c,children:u,shapeFlag:h}=e;if(6&h)return void H(e.component.subTree,t,n,r);if(128&h)return void e.suspense.move(t,n,r);if(64&h)return void a.move(e,t,n,J);if(a===bo){o(s,t,n);for(let e=0;e<u.length;e++)H(u[e],t,n,r);o(e.anchor,t,n);return}if(a===ba)return void(({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=g(e),o(e,n,r),e=i;o(t,n,r)})(e,t,n);if(2!==r&&1&h&&c)if(0===r)c.persisted&&!s[v6]?o(s,t,n):(c.beforeEnter(s),o(s,t,n),bt(()=>c.enter(s),i));else{let{leave:r,delayLeave:i,afterLeave:a}=c,u=()=>{e.ctx.isUnmounted?l(s):o(s,t,n)},h=()=>{let e=s._isLeaving||!!s[v6];s._isLeaving&&s[v6](!0),c.persisted&&!e?u():r(s,()=>{u(),a&&a()})};i?i(s,u,h):h()}else o(s,t,n)},q=(e,t,n,r=!1,i=!1)=>{let o,{type:l,props:s,ref:a,children:c,dynamicChildren:u,shapeFlag:h,patchFlag:d,dirs:p,cacheIndex:f,memo:m}=e;if(-2===d&&(i=!1),null!=a&&(gO(),ys(a,null,n,e,!0),gE()),null!=f&&(t.renderCache[f]=void 0),256&h)return void t.ctx.deactivate(e);let g=1&h&&p,y=!yc(e);if(y&&(o=s&&s.onVnodeBeforeUnmount)&&bk(o,t,e),6&h)$(e.component,n,r);else{if(128&h)return void e.suspense.unmount(n,r);g&&vQ(e,null,t,"beforeUnmount"),64&h?e.type.remove(e,t,n,J,r):u&&!u.hasOnce&&(l!==bo||d>0&&64&d)?W(u,t,n,!1,!0):(l===bo&&384&d||!i&&16&h)&&W(c,t,n),r&&j(e)}let b=null!=m&&null==f;(y&&(o=s&&s.onVnodeUnmounted)||g||b)&&bt(()=>{o&&bk(o,t,e),g&&vQ(e,null,t,"unmounted"),b&&(e.el=null)},n)},j=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===bo)return void V(n,r);if(t===ba)return void(({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=g(e),l(e),e=n;l(t)})(e);let o=()=>{l(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(1&e.shapeFlag&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,l=()=>t(n,o);r?r(e.el,o,l):l()}else o()},V=(e,t)=>{let n;for(;e!==t;)n=g(e),l(e),e=n;l(t)},$=(e,t,n)=>{let{bum:r,scope:i,job:o,subTree:l,um:a,m:c,a:u}=e;bi(c),bi(u),r&&go(r),i.stop(),o&&(o.flags|=8,q(l,e,t,n)),a&&bt(a,t),bt(()=>{e.isUnmounted=!0},t),__VUE_PROD_DEVTOOLS__&&s&&"function"==typeof s.cleanupBuffer&&!s.cleanupBuffer(e)&&vK(e)},W=(e,t,n,r=!1,i=!1,o=0)=>{for(let l=o;l<e.length;l++)q(e[l],t,n,r,i)},U=e=>{if(6&e.shapeFlag)return U(e.component.subTree);if(128&e.shapeFlag)return e.suspense.next();let t=g(e.anchor||e.el),n=t&&t[v7];return n?g(n):t},G=!1,K=(e,t,n)=>{let r;null==e?t._vnode&&(q(t._vnode,null,null,!0),r=t._vnode.component):w(t._vnode||null,e,t,null,null,null,n),t._vnode=e,G||(G=!0,vH(r),vq(),G=!1)},J={p:w,um:q,m:H,r:j,mt:L,mc:T,pc:P,pbc:E,n:U,o:e};return{render:K,hydrate:n,createApp:(t=n,function(e,n=null){m0(e)||(e=mJ({},e)),null==n||m5(n)||(n=null);let r=yj(),i=new WeakSet,o=[],l=!1,s=r.app={_uid:yV++,_component:e,_props:n,_container:null,_context:r,_instance:null,version:bF,get config(){return r.config},set config(v){},use:(e,...t)=>(i.has(e)||(e&&m0(e.install)?(i.add(e),e.install(s,...t)):m0(e)&&(i.add(e),e(s,...t))),s),mixin:e=>(__VUE_OPTIONS_API__&&(r.mixins.includes(e)||r.mixins.push(e)),s),component:(e,t)=>t?(r.components[e]=t,s):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,s):r.directives[e],mount(i,o,a){if(l);else{let c=s._ceVNode||bv(e,n);return c.appContext=r,!0===a?a="svg":!1===a&&(a=void 0),o&&t?t(c,i):K(c,i,a),l=!0,s._container=i,i.__vue_app__=s,__VUE_PROD_DEVTOOLS__&&(s._instance=c.component,vW("app:init",s,bF,{Fragment:bo,Text:bl,Comment:bs,Static:ba})),b_(c.component)}},onUnmount(e){o.push(e)},unmount(){l&&(vO(o,s._instance,16),K(null,s._container),__VUE_PROD_DEVTOOLS__&&(s._instance=null,vW("app:unmount",s)),delete s._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,s),runWithContext(e){let t=y$;y$=s;try{return e()}finally{y$=t}}};return s})}}(b6))).createApp(...e),{mount:n}=t;return t.mount=e=>{var r,i;let o=m1(r=e)?document.querySelector(r):r;if(!o)return;let l=t._component;m0(l)||l.render||l.template||(l.template=o.innerHTML),1===o.nodeType&&(o.textContent="");let s=n(o,!1,(i=o)instanceof SVGElement?"svg":"function"==typeof MathMLElement&&i instanceof MathMLElement?"mathml":void 0);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),s},t},b9=function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=function e(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=" "),i+=r)}else for(r in t)t[r]&&(i&&(i+=" "),i+=r);return i}(e))&&(r&&(r+=" "),r+=t);return r};function we({icon:e,class:t,onClick:n}){return bB("span",{class:b9("milkdown-icon",t),onPointerdown:n,innerHTML:e?fM.sanitize(e.trim()):void 0})}function wt(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-block",...t}}),e}we.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}};var wn=dC({filterNodes:e=>!a_(e=>"table"===e.type.name)(e)},"blockConfig");wt(wn,{displayName:"Ctx<blockConfig>"});var wr=aw.ie&&aw.ie_version<15||aw.ios&&aw.webkit_version<604,wi=class{constructor(){this.#es=()=>{if(!this.#ea)return null;let e=this.#ea,t=this.#ec;if(t&&sk.isSelectable(e.node)){let n=sk.create(t.state.doc,e.$pos.pos);return t.dispatch(t.state.tr.setSelection(n)),t.focus(),this.#eu=n,n}return null},this.#eu=null,this.#ea=null,this.#eh=void 0,this.#ed=!1,this.#ep=()=>{this.#ef?.({type:"hide"}),this.#ea=null},this.#em=e=>{this.#ea=e,this.#ef?.({type:"show",active:e})},this.bind=(e,t)=>{this.#_=e,this.#ef=t},this.addEvent=e=>{e.addEventListener("mousedown",this.#eg),e.addEventListener("mouseup",this.#ev),e.addEventListener("dragstart",this.#ey),e.addEventListener("dragend",this.#eb)},this.removeEvent=e=>{e.removeEventListener("mousedown",this.#eg),e.removeEventListener("mouseup",this.#ev),e.removeEventListener("dragstart",this.#ey),e.removeEventListener("dragend",this.#eb)},this.unBind=()=>{this.#ef=void 0},this.#eg=()=>{this.#eh=this.#ea?.el.getBoundingClientRect(),this.#es()},this.#ev=()=>{this.#ed?(this.#ed=!1,this.#eu=null):requestAnimationFrame(()=>{this.#eh&&this.#ec?.focus()})},this.#ey=e=>{this.#ed=!0;let t=this.#ec;if(!t)return;t.dom.dataset.dragging="true";let n=this.#eu;if(e.dataTransfer&&n){let r=n.content();e.dataTransfer.effectAllowed="copyMove";let{dom:i,text:o}=t.serializeForClipboard(r);e.dataTransfer.clearData(),e.dataTransfer.setData(wr?"Text":"text/html",i.innerHTML),wr||e.dataTransfer.setData("text/plain",o);let l=this.#ea?.el;l&&e.dataTransfer.setDragImage(l,0,0),t.dragging={slice:r,move:!0}}},this.#eb=()=>{this.#ec&&this.#ew(this.#ec)},this.keydownCallback=e=>(this.#ep(),this.#ed=!1,e.dom.dataset.dragging="false",!1),this.#ex=mF((e,t)=>{if(!e.editable)return;let n=e.dom.getBoundingClientRect(),r=n.left+n.width/2;if(!(e.root.elementFromPoint(r,t.clientY)instanceof Element))return void this.#ep();let i=this.#ek;if(!i)return;let o=function(e,t,n){if(!e.dom.parentElement)return null;try{let r=e.posAtCoords({left:t.x,top:t.y})?.inside;if(null==r||r<0)return null;let i=e.state.doc.resolve(r),o=e.state.doc.nodeAt(r),l=e.nodeDOM(r),s=t=>{let r=i.depth>=1&&0===i.index(i.depth);if(!(t||r))return;let a=i.before(i.depth);o=e.state.doc.nodeAt(a),l=e.nodeDOM(a),i=e.state.doc.resolve(a),n(i,o)||s(!0)};if(s(!n(i,o)),!l||!o)return null;return{node:o,$pos:i,el:l}}catch{return null}}(e,{x:r,y:t.clientY},i);o?this.#em(o):this.#ep()},200),this.mousemoveCallback=(e,t)=>!e.composing&&!!e.editable&&(this.#ex(e,t),!1),this.dragoverCallback=(e,t)=>{if(this.#ed){let n=this.#ec?.dom.parentElement;if(!n)return!1;let r=n.scrollHeight>n.clientHeight,i=n.getBoundingClientRect();if(r){if(n.scrollTop>0&&20>Math.abs(t.y-i.y))return n.scrollTop=n.scrollTop>10?n.scrollTop-10:0,!1;let r=Math.round(e.dom.getBoundingClientRect().height);Math.round(n.scrollTop+i.height)<r&&20>Math.abs(t.y-(i.height+i.y))&&(n.scrollTop=n.scrollTop+10)}}return!1},this.dragenterCallback=e=>{e.dragging&&(this.#ed=!0,e.dom.dataset.dragging="true")},this.dragleaveCallback=(e,t)=>{let n=t.clientX,r=t.clientY;(n<0||r<0||n>window.innerWidth||r>window.innerHeight)&&(this.#ea=null,this.#ew(e))},this.dropCallback=e=>(this.#ew(e),!1),this.dragendCallback=e=>{this.#ew(e)},this.#ew=e=>{this.#ed=!1,e.dom.dataset.dragging="false"}}#_;#es;#eu;#ea;#eh;#ed;get #ek(){try{return this.#_?.get(wn.key).filterNodes}catch{return}}get #ec(){return this.#_?.get(hb)}#ef;#ep;#em;#eg;#ev;#ey;#eb;#ex;#ew},wo=dC(()=>new wi,"blockService"),wl=dC({},"blockServiceInstance");wt(wo,{displayName:"Ctx<blockService>"}),wt(wl,{displayName:"Ctx<blockServiceInstance>"});var ws=dC({},"blockSpec");wt(ws,{displayName:"Ctx<blockSpec>"});var wa=dw(e=>{let t=new sP("MILKDOWN_BLOCK"),n=e.get(wo.key)();e.set(wl.key,n);let r=e.get(ws.key);return new s_({key:t,...r,props:{...r.props,handleDOMEvents:{drop:e=>n.dropCallback(e),pointermove:(e,t)=>n.mousemoveCallback(e,t),keydown:e=>n.keydownCallback(e),dragover:(e,t)=>n.dragoverCallback(e,t),dragleave:(e,t)=>n.dragleaveCallback(e,t),dragenter:e=>n.dragenterCallback(e),dragend:e=>n.dragendCallback(e)}}})});wt(wa,{displayName:"Prose<block>"});var wc=class{#eC;#_;#eS;#eM;#Y;#X;#J;#Z;#eA;#eT;#eO;get active(){return this.#eM}constructor(e){this.#eM=null,this.#X=!1,this.update=()=>{requestAnimationFrame(()=>{if(!this.#X)try{this.#eE(),this.#X=!0}catch{}})},this.destroy=()=>{this.#eS?.unBind(),this.#eS?.removeEvent(this.#eC),this.#eC.remove()},this.show=e=>{let t=e.el,n=this.#_.get(hb).dom,r={ctx:this.#_,active:e,editorDom:n,blockDom:this.#eC},i=[mS()];if(this.#eA){let e=mC(this.#eA(r));i.push(e)}mM({contextElement:t,getBoundingClientRect:()=>this.#eT?this.#eT(r):t.getBoundingClientRect()},this.#eC,{placement:this.#eO?this.#eO(r):"left",middleware:[...i,...this.#J],...this.#Z}).then(({x:e,y:t})=>{Object.assign(this.#eC.style,{left:`${e}px`,top:`${t}px`}),this.#eC.dataset.show="true"}).catch(console.error)},this.hide=()=>{this.#eC.dataset.show="false"},this.#_=e.ctx,this.#eC=e.content,this.#eA=e.getOffset,this.#eT=e.getPosition,this.#eO=e.getPlacement,this.#J=e.middleware??[],this.#Z=e.floatingUIOptions??{},this.#Y=e.root,this.hide()}#eE(){let e=this.#_.get(hb);(this.#Y??e.dom.parentElement??document.body).appendChild(this.#eC);let t=this.#_.get(wl.key);t.bind(this.#_,e=>{"hide"===e.type?(this.hide(),this.#eM=null):"show"===e.type&&(this.show(e.active),this.#eM=e.active)}),this.#eS=t,this.#eS.addEvent(this.#eC),this.#eC.draggable=!0}},wu=[ws,wn,wo,wl,wa];function wh(e){return String(e||"").toUpperCase()}function wd(){return function(e){let t=function(e){let t=new Map;if(!e||!e.type)throw Error("mdast-util-definitions expected node");return oe(e,"definition",function(e){let n=wh(e.identifier);n&&!t.get(n)&&t.set(n,e)}),function(e){let n=wh(e);return t.get(n)}}(e);oe(e,function(e,n,r){if("definition"===e.type&&void 0!==r&&"number"==typeof n)return r.children.splice(n,1),[i8,n];if("imageReference"===e.type||"linkReference"===e.type){let i=t(e.identifier);if(i&&r&&"number"==typeof n)return r.children[n]="imageReference"===e.type?{type:"image",url:i.url,title:i.title,alt:e.alt}:{type:"link",url:i.url,title:i.title,children:e.children},[i8,n]}})}}function wp(e,t){if(!(t.childCount>=1&&t.lastChild?.type.name==="hardbreak"))return void e.next(t.content);let n=[];t.content.forEach((e,r,i)=>{i!==t.childCount-1&&n.push(e)}),e.next(o3.fromArray(n))}function wf(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e}wu.key=ws.key,wu.pluginKey=wa.key;var wm=dO("emphasis");wf(wm,{displayName:"Attr<emphasis>",group:"Emphasis"});var wg=dM("emphasis",e=>({attrs:{marker:{default:e.get(hE).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>"italic"===e}],toDOM:t=>["em",e.get(wm.key)(t)],parseMarkdown:{match:e=>"emphasis"===e.type,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"emphasis"===e.type.name,runner:(e,t)=>{e.withMark(t,"emphasis",void 0,{marker:t.attrs.marker})}}}));wf(wg.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"}),wf(wg.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var wv=dv("ToggleEmphasis",e=>()=>s0(wg.type(e)));wf(wv,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var wy=dy(e=>aC(/(?:^|[^*])\*([^*]+)\*$/,wg.type(e),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}));wf(wy,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var wb=dy(e=>aC(/\b_(?![_\s])(.*?[^_\s])_\b/,wg.type(e),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}}));wf(wb,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var ww=dA("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{let t=e.get(hH);return()=>t.call(wv.key)}}});wf(ww.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"}),wf(ww.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var wx=dO("strong");wf(wx,{displayName:"Attr<strong>",group:"Strong"});var wk=dM("strong",e=>({attrs:{marker:{default:e.get(hE).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:e=>"normal"!=e.style.fontWeight&&null},{tag:"strong"},{style:"font-style",getAttrs:e=>"bold"===e},{style:"font-weight=400",clearMark:e=>"strong"==e.type.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:t=>["strong",e.get(wx.key)(t)],parseMarkdown:{match:e=>"strong"===e.type,runner:(e,t,n)=>{e.openMark(n,{marker:t.marker}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strong"===e.type.name,runner:(e,t)=>{e.withMark(t,"strong",void 0,{marker:t.attrs.marker})}}}));wf(wk.mark,{displayName:"MarkSchema<strong>",group:"Strong"}),wf(wk.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var wC=dv("ToggleStrong",e=>()=>s0(wk.type(e)));wf(wC,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var wS=dy(e=>aC(/(?<![\w:/])(?:\*\*|__)([^*_]+?)(?:\*\*|__)(?![\w/])$/,wk.type(e),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));wf(wS,{displayName:"InputRule<strong>",group:"Strong"});var wM=dA("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{let t=e.get(hH);return()=>t.call(wC.key)}}});wf(wM.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"}),wf(wM.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var wA=dO("inlineCode");wf(wA,{displayName:"Attr<inlineCode>",group:"InlineCode"});var wT=dM("inlineCode",e=>({priority:100,code:!0,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(wA.key)(t)],parseMarkdown:{match:e=>"inlineCode"===e.type,runner:(e,t,n)=>{e.openMark(n),e.addText(t.value),e.closeMark(n)}},toMarkdown:{match:e=>"inlineCode"===e.type.name,runner:(e,t,n)=>(e.withMark(t,"inlineCode",n.text||""),!0)}}));wf(wT.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"}),wf(wT.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var wO=dv("ToggleInlineCode",e=>()=>(t,n)=>{let{selection:r,tr:i}=t;if(r.empty)return!1;let{from:o,to:l}=r;return t.doc.rangeHasMark(o,l,wT.type(e))?n?.(i.removeMark(o,l,wT.type(e))):(Object.keys(t.schema.marks).filter(e=>e!==wT.type.name).map(e=>t.schema.marks[e]).forEach(e=>{i.removeMark(o,l,e)}),n?.(i.addMark(o,l,wT.type(e).create()))),!0});wf(wO,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var wE=dy(e=>aC(/(?:`)([^`]+)(?:`)$/,wT.type(e)));wf(wE,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var wN=dA("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{let t=e.get(hH);return()=>t.call(wO.key)}}});wf(wN.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"}),wf(wN.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var wD=dO("link");wf(wD,{displayName:"Attr<link>",group:"Link"});var wI=dM("link",e=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(wD.key)(t),...t.attrs}],parseMarkdown:{match:e=>"link"===e.type,runner:(e,t,n)=>{let r=t.url,i=t.title;e.openMark(n,{href:r,title:i}),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"link"===e.type.name,runner:(e,t)=>{e.withMark(t,"link",void 0,{title:t.attrs.title,url:t.attrs.href})}}}));wf(wI.mark,{displayName:"MarkSchema<link>",group:"Link"});var wL=dv("ToggleLink",e=>(t={})=>s0(wI.type(e),t));wf(wL,{displayName:"Command<toggleLinkCommand>",group:"Link"});var w_=dv("UpdateLink",e=>(t={})=>(n,r)=>{let i;if(!r)return!1;let o=-1,{selection:l}=n,{from:s,to:a}=l;if(n.doc.nodesBetween(s,s===a?a+1:a,(t,n)=>{if(wI.type(e).isInSet(t.marks))return i=t,o=n,!1}),!i)return!1;let c=i.marks.find(({type:t})=>t===wI.type(e));if(!c)return!1;let u=o,h=o+i.nodeSize,{tr:d}=n,p=wI.type(e).create({...c.attrs,...t});return!!p&&(r(d.removeMark(u,h,c).addMark(u,h,p).setSelection(new sw(d.selection.$anchor)).scrollIntoView()),!0)});wf(w_,{displayName:"Command<updateLinkCommand>",group:"Link"});var wR=db("doc",()=>({content:"block+",parseMarkdown:{match:({type:e})=>"root"===e,runner:(e,t,n)=>{e.injectRoot(t,n)}},toMarkdown:{match:e=>"doc"===e.type.name,runner:(e,t)=>{e.openNode("root"),e.next(t.content)}}}));function wz(e){return i9(e,e=>"html"===e.type&&["<br />","<br>","<br >","<br/>"].includes(e.value?.trim()),(e,t)=>{if(!t.length)return;let n=t[t.length-1];if(!n)return;let r=n.children.indexOf(e);-1!==r&&n.children.splice(r,1)},!0)}wf(wR,{displayName:"NodeSchema<doc>",group:"Doc"});var wP=dE("remark-preserve-empty-line",()=>()=>wz);wf(wP.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"}),wf(wP.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var wB=dT("paragraph");wf(wB,{displayName:"Attr<paragraph>",group:"Paragraph"});var wF=dS("paragraph",e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(wB.key)(t),0],parseMarkdown:{match:e=>"paragraph"===e.type,runner:(e,t,n)=>{e.openNode(n),t.children?e.next(t.children):e.addText(t.value||""),e.closeNode()}},toMarkdown:{match:e=>"paragraph"===e.type.name,runner:(t,n)=>{let r=e.get(hb).state?.doc.lastChild;t.openNode("paragraph"),(!n.content||0===n.content.size)&&n!==r&&function(e){let t=!1;try{e.get(wP.id),t=!0}catch{t=!1}return t}(e)?t.addNode("html",void 0,"<br />"):wp(t,n),t.closeNode()}}}));wf(wF.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"}),wf(wF.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var wH=dv("TurnIntoText",e=>()=>sQ(wF.type(e)));wf(wH,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var wq=dA("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{let t=e.get(hH);return()=>t.call(wH.key)}}});wf(wq.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"}),wf(wq.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var wj=Array(6).fill(0).map((e,t)=>t+1),wV=dC(function(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,"-")},"headingIdGenerator");wf(wV,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var w$=dT("heading");wf(w$,{displayName:"Attr<heading>",group:"Heading"});var wW=dS("heading",e=>{let t=e.get(wV.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:wj.map(e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw rl(t);return{level:e,id:t.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get(w$.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>"heading"===e,runner:(e,t,n)=>{let r=t.depth;e.openNode(n,{level:r}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"heading"===e.type.name,runner:(e,t)=>{e.openNode("heading",void 0,{depth:t.attrs.level}),wp(e,t),e.closeNode()}}}});wf(wW.node,{displayName:"NodeSchema<heading>",group:"Heading"}),wf(wW.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var wU=dy(e=>ae(/^(?<hashes>#+)\s$/,wW.type(e),t=>{let n=t.groups?.hashes?.length||0,{$from:r}=e.get(hb).state.selection,i=r.node();if("heading"===i.type.name){let e=Number(i.attrs.level)+Number(n);return e>6&&(e=6),{level:e}}return{level:n}}));wf(wU,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var wG=dv("WrapInHeading",e=>t=>(t??=1)<1?sQ(wF.type(e)):sQ(wW.type(e),{level:t}));wf(wG,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var wK=dv("DowngradeHeading",e=>()=>(t,n,r)=>{let{$from:i}=t.selection,o=i.node();if(o.type!==wW.type(e)||!t.selection.empty||0!==i.parentOffset)return!1;let l=o.attrs.level-1;return l?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...o.attrs,level:l})),!0):sQ(wF.type(e))(t,n,r)});wf(wK,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var wJ=dA("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{let t=e.get(hH);return()=>t.call(wG.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{let t=e.get(hH);return()=>t.call(wG.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{let t=e.get(hH);return()=>t.call(wG.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{let t=e.get(hH);return()=>t.call(wG.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{let t=e.get(hH);return()=>t.call(wG.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{let t=e.get(hH);return()=>t.call(wG.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{let t=e.get(hH);return()=>t.call(wK.key)}}});wf(wJ.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"}),wf(wJ.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var wZ=dT("blockquote");wf(wZ,{displayName:"Attr<blockquote>",group:"Blockquote"});var wY=dS("blockquote",e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(wZ.key)(t),0],parseMarkdown:{match:({type:e})=>"blockquote"===e,runner:(e,t,n)=>{e.openNode(n).next(t.children).closeNode()}},toMarkdown:{match:e=>"blockquote"===e.type.name,runner:(e,t)=>{e.openNode("blockquote").next(t.content).closeNode()}}}));wf(wY.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"}),wf(wY.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var wX=dy(e=>s9(/^\s*>\s$/,wY.type(e)));wf(wX,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var wQ=dv("WrapInBlockquote",e=>()=>sX(wY.type(e)));wf(wQ,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var w0=dA("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{let t=e.get(hH);return()=>t.call(wQ.key)}}});wf(w0.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"}),wf(w0.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var w1=dT("codeBlock",()=>({pre:{},code:{}}));wf(w1,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var w4=dS("code_block",e=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{language:e.dataset.language}}}],toDOM:t=>{let n=e.get(w1.key)(t),r=t.attrs.language,i=r&&r.length>0?{"data-language":r}:void 0;return["pre",{...n.pre,...i},["code",n.code,0]]},parseMarkdown:{match:({type:e})=>"code"===e,runner:(e,t,n)=>{let r=t.lang??"",i=t.value;e.openNode(n,{language:r}),i&&e.addText(i),e.closeNode()}},toMarkdown:{match:e=>"code_block"===e.type.name,runner:(e,t)=>{e.addNode("code",void 0,t.content.firstChild?.text||"",{lang:t.attrs.language})}}}));wf(w4.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"}),wf(w4.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var w5=dy(e=>ae(/^```(?<language>[a-z]*)?[\s\n]$/,w4.type(e),e=>({language:e.groups?.language??""})));wf(w5,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var w2=dv("CreateCodeBlock",e=>(t="")=>sQ(w4.type(e),{language:t}));wf(w2,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"}),wf(dv("UpdateCodeBlockLanguage",()=>({pos:e,language:t}={pos:-1,language:""})=>(n,r)=>e>=0&&(r?.(n.tr.setNodeAttribute(e,"language",t)),!0)),{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var w3=dA("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{let t=e.get(hH);return()=>t.call(w2.key)}}});wf(w3.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"}),wf(w3.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var w7=dT("image");wf(w7,{displayName:"Attr<image>",group:"Image"});var w6=dS("image",e=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(w7.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>"image"===e,runner:(e,t,n)=>{let r=t.url,i=t.alt,o=t.title;e.addNode(n,{src:r,alt:i,title:o})}},toMarkdown:{match:e=>"image"===e.type.name,runner:(e,t)=>{e.addNode("image",void 0,void 0,{title:t.attrs.title,url:t.attrs.src,alt:t.attrs.alt})}}}));wf(w6.node,{displayName:"NodeSchema<image>",group:"Image"}),wf(w6.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var w8=dv("InsertImage",e=>(t={})=>(n,r)=>{if(!r)return!0;let{src:i="",alt:o="",title:l=""}=t,s=w6.type(e).create({src:i,alt:o,title:l});return!s||(r(n.tr.replaceSelectionWith(s).scrollIntoView()),!0)});wf(w8,{displayName:"Command<insertImageCommand>",group:"Image"});var w9=dv("UpdateImage",e=>(t={})=>(n,r)=>{let i=function(e,t){if(!(e instanceof sk))return;let{node:n,$from:r}=e;if(Array.isArray(t)&&t.includes(n.type)||n.type===t)return{node:n,pos:r.pos,start:r.start(r.depth),depth:r.depth}}(n.selection,w6.type(e));if(!i)return!1;let{node:o,pos:l}=i,s={...o.attrs},{src:a,alt:c,title:u}=t;return void 0!==a&&(s.src=a),void 0!==c&&(s.alt=c),void 0!==u&&(s.title=u),r?.(n.tr.setNodeMarkup(l,void 0,s).scrollIntoView()),!0});wf(w9,{displayName:"Command<updateImageCommand>",group:"Image"}),wf(dy(e=>new s6(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,r,i)=>{let[o,l,s="",a]=n;return o?t.tr.replaceWith(r,i,w6.type(e).create({src:s,alt:l,title:a})):null})),{displayName:"InputRule<insertImageInputRule>",group:"Image"});var xe=dT("hardbreak",e=>({"data-type":"hardbreak","data-is-inline":e.attrs.isInline}));wf(xe,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var xt=dS("hardbreak",e=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:t=>t.attrs.isInline?["span",e.get(xe.key)(t)," "]:["br",e.get(xe.key)(t)],parseMarkdown:{match:({type:e})=>"break"===e,runner:(e,t,n)=>{e.addNode(n,{isInline:!!t.data?.isInline})}},leafText:()=>"\n",toMarkdown:{match:e=>"hardbreak"===e.type.name,runner:(e,t)=>{t.attrs.isInline?e.addNode("text",void 0,"\n"):e.addNode("break")}}}));wf(xt.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"}),wf(xt.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var xn=dv("InsertHardbreak",e=>()=>(t,n)=>{let{selection:r,tr:i}=t;if(!(r instanceof sw))return!1;if(r.empty){let e=r.$from.node();if(e.childCount>0&&e.lastChild?.type.name==="hardbreak")return n?.(i.replaceRangeWith(r.to-1,r.to,t.schema.node("paragraph")).setSelection(sg.near(i.doc.resolve(r.to))).scrollIntoView()),!0}return n?.(i.setMeta("hardbreak",!0).replaceSelectionWith(xt.type(e).create()).scrollIntoView()),!0});wf(xn,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var xr=dA("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{let t=e.get(hH);return()=>t.call(xn.key)}}});wf(xr.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"}),wf(xr.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var xi=dT("hr");wf(xi,{displayName:"Attr<hr>",group:"Hr"});var xo=dS("hr",e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(xi.key)(t)],parseMarkdown:{match:({type:e})=>"thematicBreak"===e,runner:(e,t,n)=>{e.addNode(n)}},toMarkdown:{match:e=>"hr"===e.type.name,runner:e=>{e.addNode("thematicBreak")}}}));wf(xo.node,{displayName:"NodeSchema<hr>",group:"Hr"}),wf(xo.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var xl=dy(e=>new s6(/^(?:---|___\s|\*\*\*\s)$/,(t,n,r,i)=>{let{tr:o}=t;return n[0]&&o.replaceWith(r-1,i,xo.type(e).create()),o}));wf(xl,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var xs=dv("InsertHr",e=>()=>(t,n)=>{if(!n)return!0;let r=wF.node.type(e).create(),{tr:i,selection:o}=t,{from:l}=o,s=xo.type(e).create();if(!s)return!0;let a=i.replaceSelectionWith(s).insert(l,r),c=sg.findFrom(a.doc.resolve(l),1,!0);return!c||(n(a.setSelection(c).scrollIntoView()),!0)});wf(xs,{displayName:"Command<insertHrCommand>",group:"Hr"});var xa=dT("bulletList");wf(xa,{displayName:"Attr<bulletList>",group:"BulletList"});var xc=dS("bullet_list",e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{spread:"true"===e.dataset.spread}}}],toDOM:t=>["ul",{...e.get(xa.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!t,runner:(e,t,n)=>{let r=null!=t.spread?`${t.spread}`:"false";e.openNode(n,{spread:r}).next(t.children).closeNode()}},toMarkdown:{match:e=>"bullet_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!1,spread:t.attrs.spread}).next(t.content).closeNode()}}}));wf(xc.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"}),wf(xc.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var xu=dy(e=>s9(/^\s*([-+*])\s$/,xc.type(e)));wf(xu,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var xh=dv("WrapInBulletList",e=>()=>sX(xc.type(e)));wf(xh,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var xd=dA("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{let t=e.get(hH);return()=>t.call(xh.key)}}});wf(xd.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"}),wf(xd.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var xp=dT("orderedList");wf(xp,{displayName:"Attr<orderedList>",group:"OrderedList"});var xf=dS("ordered_list",e=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{spread:e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(xp.key)(t),...1===t.attrs.order?{}:{start:t.attrs.order},"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!!t,runner:(e,t,n)=>{let r=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{spread:r,order:t.start??1}).next(t.children).closeNode()}},toMarkdown:{match:e=>"ordered_list"===e.type.name,runner:(e,t)=>{e.openNode("list",void 0,{ordered:!0,start:t.attrs.order??1,spread:"true"===t.attrs.spread}),e.next(t.content),e.closeNode()}}}));wf(xf.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"}),wf(xf.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var xm=dy(e=>s9(/^\s*(\d+)\.\s$/,xf.type(e),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));wf(xm,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var xg=dv("WrapInOrderedList",e=>()=>sX(xf.type(e)));wf(xg,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var xv=dA("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{let t=e.get(hH);return()=>t.call(xg.key)}}});wf(xv.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"}),wf(xv.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var xy=dT("listItem");wf(xy,{displayName:"Attr<listItem>",group:"ListItem"});var xb=dS("list_item",e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:"true"===e.dataset.spread}}}],toDOM:t=>["li",{...e.get(xy.key)(t),"data-label":t.attrs.label,"data-list-type":t.attrs.listType,"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,n)=>{let r=null!=t.label?`${t.label}.`:"•",i=null!=t.label?"ordered":"bullet",o=null!=t.spread?`${t.spread}`:"true";e.openNode(n,{label:r,listType:i,spread:o}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{e.openNode("listItem",void 0,{spread:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));wf(xb.node,{displayName:"NodeSchema<listItem>",group:"ListItem"}),wf(xb.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var xw=dv("SinkListItem",e=>()=>{var t;return t=xb.type(e),function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,e=>e.childCount>0&&e.firstChild.type==t);if(!o)return!1;let l=o.startIndex;if(0==l)return!1;let s=o.parent,a=s.child(l-1);if(a.type!=t)return!1;if(n){let r=a.lastChild&&a.lastChild.type==s.type,i=o3.from(r?t.create():null),l=new lt(o3.from(t.create(null,o3.from(s.type.create(null,i)))),r?3:1,0),c=o.start,u=o.end;n(e.tr.step(new l5(c-(r?3:1),u,c,u,l,1,!0)).scrollIntoView())}return!0}});wf(xw,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var xx=dv("LiftListItem",e=>()=>{var t;return t=xb.type(e),function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,e=>e.childCount>0&&e.firstChild.type==t);return!!o&&(!n||(r.node(o.depth-1).type==t?function(e,t,n,r){let i=e.tr,o=r.end,l=r.$to.end(r.depth);o<l&&(i.step(new l5(o-1,l,o,l,new lt(o3.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ld(i.doc.resolve(r.$from.pos),i.doc.resolve(l),r.depth));let s=l7(r);if(null==s)return!1;i.lift(r,s);let a=i.doc.resolve(i.mapping.map(o,-1)-1);return sn(i.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&i.join(a.pos),t(i.scrollIntoView()),!0}(e,n,t,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),l=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let s=0==n.startIndex,a=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+ +!s,u+1,l.content.append(a?o3.empty:o3.from(i))))return!1;let h=o.pos,d=h+l.nodeSize;return r.step(new l5(h-!!s,d+ +!!a,h+1,d-1,new lt((s?o3.empty:o3.from(i.copy(o3.empty))).append(a?o3.empty:o3.from(i.copy(o3.empty))),+!s,+!a),+!s)),t(r.scrollIntoView()),!0}(e,n,o)))}});wf(xx,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var xk=dv("SplitListItem",e=>()=>{var t;return t=xb.type(e),function(e,n){let{$from:r,$to:i,node:o}=e.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(i))return!1;let l=r.node(-1);if(l.type!=t)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(3==r.depth||r.node(-3).type!=t||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=o3.empty,o=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-o;e>=r.depth-3;e--)i=o3.from(r.node(e).copy(i));let l=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;i=i.append(o3.from(t.createAndFill()));let s=r.before(r.depth-(o-1)),a=e.tr.replace(s,r.after(-l),new lt(i,4-o,0)),c=-1;a.doc.nodesBetween(s,a.doc.content.size,(e,t)=>{if(c>-1)return!1;e.isTextblock&&0==e.content.size&&(c=t+1)}),c>-1&&a.setSelection(sg.near(a.doc.resolve(c))),n(a.scrollIntoView())}return!0}let s=i.pos==r.end()?l.contentMatchAt(0).defaultType:null,a=e.tr.delete(r.pos,i.pos),c=s?[null,{type:s}]:void 0;return!!st(a.doc,r.pos,2,c)&&(n&&n(a.split(r.pos,2,c).scrollIntoView()),!0)}});wf(xk,{displayName:"Command<splitListItemCommand>",group:"ListItem"});var xC=dv("LiftFirstListItem",e=>()=>(t,n,r)=>{let{selection:i}=t;if(!(i instanceof sw))return!1;let{empty:o,$from:l}=i;return!!o&&0===l.parentOffset&&l.node(-1).type===xb.type(e)&&sH(t,n,r)});wf(xC,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var xS=dA("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{let t=e.get(hH);return()=>t.call(xk.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{let t=e.get(hH);return()=>t.call(xw.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{let t=e.get(hH);return()=>t.call(xx.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:e=>{let t=e.get(hH);return()=>t.call(xC.key)}}});wf(xS.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"}),wf(xS.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var xM=db("text",()=>({group:"inline",parseMarkdown:{match:({type:e})=>"text"===e,runner:(e,t)=>{e.addText(t.value)}},toMarkdown:{match:e=>"text"===e.type.name,runner:(e,t)=>{e.addNode("text",void 0,t.text)}}}));wf(xM,{displayName:"NodeSchema<text>",group:"Text"});var xA=dT("html");wf(xA,{displayName:"Attr<html>",group:"Html"});var xT=dS("html",e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:t=>{let n=document.createElement("span"),r={...e.get(xA.key)(t),"data-value":t.attrs.value,"data-type":"html"};return n.textContent=t.attrs.value,["span",r,t.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>"html"===e,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>"html"===e.type.name,runner:(e,t)=>{e.addNode("html",void 0,t.attrs.value)}}}));wf(xT.node,{displayName:"NodeSchema<html>",group:"Html"}),wf(xT.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var xO=[wR,wB,wF,wV,w$,wW,xe,xt,wZ,wY,w1,w4,xi,xo,w7,w6,xa,xc,xp,xf,xy,xb,wm,wg,wx,wk,wA,wT,wD,wI,xA,xT,xM].flat(),xE=[wX,xu,xm,w5,xl,wU].flat(),xN=[wy,wb,wE,wS],xD=dv("IsMarkSelected",()=>e=>t=>{if(!e)return!1;let{doc:n,selection:r}=t;return n.rangeHasMark(r.from,r.to,e)}),xI=dv("IsNoteSelected",()=>e=>t=>!!e&&az(t,e).hasNode),xL=dv("ClearTextInCurrentBlock",()=>()=>(e,t)=>{let n=e.tr,{$from:r,$to:i}=n.selection,{pos:o}=r,{pos:l}=i,s=o-r.node().content.size;return!(s<0)&&(n=n.deleteRange(s,l),t?.(n),!0)}),x_=dv("SetBlockType",()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let o=t.tr,{from:l,to:s}=o.selection;try{o.setBlockType(l,s,r,i)}catch{return!1}return n?.(o),!0}),xR=dv("WrapInBlockType",()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let o=t.tr;try{let{$from:e,$to:t}=o.selection,n=e.blockRange(t),l=n&&l6(n,r,i);if(!l)return!1;o=o.wrap(n,l)}catch{return!1}return n?.(o),!0}),xz=dv("AddBlockType",()=>e=>(t,n)=>{let{nodeType:r,attrs:i=null}=e??{};if(!r)return!1;let o=t.tr;try{let e=r instanceof lf?r:r.createAndFill(i);if(!e)return!1;o.replaceSelectionWith(e)}catch{return!1}return n?.(o),!0}),xP=dv("SelectTextNearPos",()=>e=>(t,n)=>{let{pos:r}=e??{};if(null==r)return!1;let i=t.tr;try{let e,n=t.doc.resolve((e=t.doc.content.size,Math.min(Math.max(r,0),e)));i.setSelection(sw.near(n))}catch{return!1}return n?.(i.scrollIntoView()),!0}),xB=[wH,wQ,wG,wK,w2,xn,xs,w8,w9,xg,xh,xw,xk,xx,xC,wv,wO,wC,wL,w_,xD,xI,xL,x_,xR,xz,xP],xF=[w0,w3,xr,wJ,xS,xv,xd,wq,ww,wN,wM].flat(),xH=dE("remarkAddOrderInList",()=>()=>e=>{oe(e,"list",e=>{if(e.ordered){let t=e.start??1;e.children.forEach((e,n)=>{e.label=n+t})}})});wf(xH.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"}),wf(xH.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var xq=dE("remarkLineBreak",()=>()=>e=>{let t=/[\t ]*(?:\r?\n|\r)/g;oe(e,"text",(e,n,r)=>{if(!e.value||"string"!=typeof e.value)return;let i=[],o=0;t.lastIndex=0;let l=t.exec(e.value);for(;l;){let n=l.index;o!==n&&i.push({type:"text",value:e.value.slice(o,n)}),i.push({type:"break",data:{isInline:!0}}),o=n+l[0].length,l=t.exec(e.value)}if(i.length>0&&r&&"number"==typeof n)return o<e.value.length&&i.push({type:"text",value:e.value.slice(o)}),r.children.splice(n,1,...i),n+i.length})});wf(xq.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"}),wf(xq.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var xj=dE("remarkInlineLink",()=>wd);wf(xj.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"}),wf(xj.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var xV=["root","blockquote","listItem"],x$=dE("remarkHTMLTransformer",()=>()=>e=>{(function e(t,n,r){if(t.children){let n=[];for(let r=0,i=t.children.length;r<i;r++){let i=t.children[r];if(i){let o=e(i,r,t);if(o)for(let e=0,t=o.length;e<t;e++){let t=o[e];t&&n.push(t)}}}t.children=n}return((e,t,n)=>("html"!==e.type||n&&xV.includes(n.type)&&(e.children=[{...e}],delete e.value,e.type="paragraph"),[e]))(t,n,r)})(e,0,null)[0]});wf(x$.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"}),wf(x$.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var xW=dE("remarkMarker",()=>()=>(e,t)=>{oe(e,e=>["strong","emphasis"].includes(e.type),e=>{e.marker=t.value.charAt(e.position.start.offset)})});wf(xW.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"}),wf(xW.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var xU=dw(()=>{let e=!1,t=new s_({key:new sP("MILKDOWN_INLINE_NODES_CURSOR"),state:{init:()=>!1,apply(e){if(!e.selection.empty)return!1;let t=e.selection.$from,n=t.nodeBefore,r=t.nodeAfter;return!!n&&!!r&&!!n.isInline&&!n.isText&&!!r.isInline&&!r.isText}},props:{handleDOMEvents:{compositionend:(n,r)=>!!e&&(e=!1,requestAnimationFrame(()=>{if(t.getState(n.state)){let e=n.state.selection.from;r.preventDefault(),n.dispatch(n.state.tr.insertText(r.data||"",e))}}),!0),compositionstart:n=>(t.getState(n.state)&&(e=!0),!1),beforeinput:(n,r)=>{if(t.getState(n.state)&&r instanceof InputEvent&&r.data&&!e){let e=n.state.selection.from;return r.preventDefault(),n.dispatch(n.state.tr.insertText(r.data||"",e)),!0}return!1}},decorations(e){if(t.getState(e)){let t=e.selection.$from.pos,n=document.createElement("span"),r=uJ.widget(t,n,{side:-1}),i=document.createElement("span"),o=uJ.widget(t,i);return setTimeout(()=>{n.contentEditable="true",i.contentEditable="true"}),uX.create(e.doc,[r,o])}return uX.empty}}});return t});wf(xU,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var xG=dw(e=>new s_({key:new sP("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(t,n,r)=>{if(!t.length)return;let[i]=t;if(!i)return;let[o]=i.steps;if(i.getMeta("hardbreak")){if(!(o instanceof l4))return;let{from:t}=o;return r.tr.setNodeMarkup(t,xt.type(e),void 0,[])}if(o instanceof lX){let t=r.tr,{from:n,to:i}=o;return r.doc.nodesBetween(n,i,(n,r)=>{n.type===xt.type(e)&&(t=t.setNodeMarkup(r,xt.type(e),void 0,[]))}),t}}}));wf(xG,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var xK=dC(["table","code_block"],"hardbreakFilterNodes");wf(xK,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var xJ=dw(e=>{let t=e.get(xK.key);return new s_({key:new sP("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(e,n)=>{let r=e.getMeta("hardbreak"),[i]=e.steps;if(r&&i){let{from:e}=i,r=n.doc.resolve(e),o=r.depth,l=!0;for(;o>0;)t.includes(r.node(o).type.name)&&(l=!1),o--;return l}return!0}})});wf(xJ,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var xZ=dw(e=>{let t=new sP("MILKDOWN_HEADING_ID"),n=n=>{if(n.composing)return;let r=e.get(wV.key),i=n.state.tr.setMeta("addToHistory",!1),o=!1,l={};n.state.doc.descendants((n,s)=>{if(n.type===wW.type(e)){if(0===n.textContent.trim().length)return;let e=n.attrs,a=r(n);l[a]?(l[a]+=1,a+=`-#${l[a]}`):l[a]=1,e.id!==a&&(o=!0,i.setMeta(t,!0).setNodeMarkup(s,void 0,{...e,id:a}))}}),o&&n.dispatch(i)};return new s_({key:t,view:e=>(n(e),{update:(e,t)=>{e.state.doc.eq(t.doc)||n(e)}})})});wf(xZ,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var xY=dw(e=>new s_({key:new sP("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:(t,n,r)=>{if(!r.selection||t.some(e=>!1===e.getMeta("addToHistory")||!e.isGeneric))return null;let i=xf.type(e),o=xc.type(e),l=xb.type(e),s=(e,t,n=1)=>{let r=!1,i=`${t+n}.`;return e.label!==i&&(e.label=i,r=!0),r},a=r.tr,c=!1;return r.doc.descendants((e,t,n,r)=>{if(e.type===o){let n=e.maybeChild(0);n?.type===l&&"ordered"===n.attrs.listType&&(c=!0,a.setNodeMarkup(t,i,{spread:"true"}),e.descendants((e,t,n,r)=>{if(e.type===l){let n={...e.attrs};s(n,r)&&(a=a.setNodeMarkup(t,void 0,n))}return!1}))}else if(e.type===l&&n?.type===i){let i={...e.attrs},o=!1;"ordered"!==i.listType&&(i.listType="ordered",o=!0),n?.maybeChild(0)&&(o=s(i,r,n?.attrs.order??1)),o&&(a=a.setNodeMarkup(t,void 0,i),c=!0)}}),c?a.setMeta("addToHistory",!1):null}}));wf(xY,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var xX=[xO,xE,xN,xB,xF,[xG,xK,xJ,xU,xH,xj,xq,x$,xW,wP,xZ,xY].flat()].flat(),xQ=class{#X;#J;#Z;#Y;#G;#eN;#K;#en;#ee;constructor(e){this.#X=!1,this.onShow=()=>{},this.onHide=()=>{},this.#eo=(e,t)=>{let{state:n,composing:r}=e,{selection:i,doc:o}=n,{ranges:l}=i,s=Math.min(...l.map(e=>e.$from.pos)),a=Math.max(...l.map(e=>e.$to.pos)),c=t&&t.doc.eq(o)&&t.selection.eq(i);if(this.#X||((this.#Y??e.dom.parentElement??document.body).appendChild(this.element),this.#X=!0),!r&&!c){if(!this.#K(e,t))return void this.hide();mM({getBoundingClientRect:()=>aI(e,s,a)},this.element,{placement:"bottom-start",middleware:[mS(),mC(this.#ee),...this.#J],...this.#Z}).then(({x:e,y:t})=>{Object.assign(this.element.style,{left:`${e}px`,top:`${t}px`})}).catch(console.error),this.show()}},this.#el=e=>{let t=this.getContent(e);if(!t)return!1;let n=t.at(-1);return!!n&&(Array.isArray(this.#eN)?this.#eN.includes(n):this.#eN===n)},this.update=(e,t)=>{this.#en(e,t)},this.getContent=(e,t=e=>"paragraph"===e.type.name)=>{let{selection:n}=e.state,{empty:r,$from:i}=n,o=e.state.selection instanceof sw;if("u"<typeof document)return;let l=this.element.contains(document.activeElement),s=!e.hasFocus()&&!l,a=!e.editable,c=!(e=>aR(t)(e.$from))(e.state.selection);if(!s&&!a&&r&&o&&!c)return i.parent.textBetween(Math.max(0,i.parentOffset-500),i.parentOffset,void 0,"")},this.destroy=()=>{this.#en.cancel()},this.show=()=>{this.element.dataset.show="true",this.onShow()},this.hide=()=>{this.element.dataset.show="false",this.onHide()},this.element=e.content,this.#G=e.debounce??200,this.#K=e.shouldShow??this.#el,this.#eN=e.trigger??"/",this.#ee=e.offset,this.#J=e.middleware??[],this.#Z=e.floatingUIOptions??{},this.#Y=e.root,this.#en=mB(this.#eo,this.#G)}#eo;#el};let x0=e=>crypto.getRandomValues(new Uint8Array(e)),x1=(e,t=21)=>((e,t,n)=>{let r=256-256%e.length;if(256===r){let r=e.length-1;return (i=t)=>{if(!i)return"";let o="";for(;;){let t=n(i),l=i;for(;l--;)if((o+=e[t[l]&r]).length>=i)return o}}}let i=Math.ceil(409.6*t/r);return (o=t)=>{if(!o)return"";let l="";for(;;){let t=n(i),s=i;for(;s--;)if(t[s]<r&&(l+=e[t[s]%e.length]).length>=o)return l}}})(e,0|t,x0);var x4=Object.defineProperty,x5=Object.getOwnPropertySymbols,x2=Object.prototype.hasOwnProperty,x3=Object.prototype.propertyIsEnumerable,x7=(e,t,n)=>t in e?x4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function x6(e,t){return Object.assign(e,{meta:((e,t)=>{for(var n in t||(t={}))x2.call(t,n)&&x7(e,n,t[n]);if(x5)for(var n of x5(t))x3.call(t,n)&&x7(e,n,t[n]);return e})({package:"@milkdown/components"},t)}),e}let x8=dC({imageIcon:"🌌",captionIcon:"💬",uploadButton:"Upload file",confirmButton:"Confirm ⏎",uploadPlaceholderText:"or paste the image link ...",captionPlaceholderText:"Image caption",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},"imageBlockConfigCtx");function x9(e){return oe(e,"paragraph",(e,t,n)=>{var r,i;if((null==(r=e.children)?void 0:r.length)!==1)return;let o=null==(i=e.children)?void 0:i[0];if(!o||"image"!==o.type)return;let{url:l,alt:s,title:a}=o;n.children.splice(t,1,{type:"image-block",url:l,alt:s,title:a})})}x6(x8,{displayName:"Config<image-block>",group:"ImageBlock"});let ke=dE("remark-image-block",()=>()=>x9);x6(ke.plugin,{displayName:"Remark<remarkImageBlock>",group:"ImageBlock"}),x6(ke.options,{displayName:"RemarkConfig<remarkImageBlock>",group:"ImageBlock"});var kt=Object.defineProperty,kn=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,ki=Object.prototype.propertyIsEnumerable,ko=(e,t,n)=>t in e?kt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let kl="image-block",ks=dS("image-block",()=>({inline:!1,group:"block",selectable:!0,draggable:!0,isolating:!0,marks:"",atom:!0,priority:100,attrs:{src:{default:"",validate:"string"},caption:{default:"",validate:"string"},ratio:{default:1,validate:"number"}},parseDOM:[{tag:`img[data-type="${kl}"]`,getAttrs:e=>{var t;if(!(e instanceof HTMLElement))throw rl(e);return{src:e.getAttribute("src")||"",caption:e.getAttribute("caption")||"",ratio:Number(null!=(t=e.getAttribute("ratio"))?t:1)}}}],toDOM:e=>["img",((e,t)=>{for(var n in t||(t={}))kr.call(t,n)&&ko(e,n,t[n]);if(kn)for(var n of kn(t))ki.call(t,n)&&ko(e,n,t[n]);return e})({"data-type":kl},e.attrs)],parseMarkdown:{match:({type:e})=>"image-block"===e,runner:(e,t,n)=>{let r=t.url,i=t.title,o=Number(t.alt||1);(Number.isNaN(o)||0===o)&&(o=1),e.addNode(n,{src:r,caption:i,ratio:o})}},toMarkdown:{match:e=>"image-block"===e.type.name,runner:(e,t)=>{e.openNode("paragraph"),e.addNode("image",void 0,void 0,{title:t.attrs.caption,url:t.attrs.src,alt:`${Number.parseFloat(t.attrs.ratio).toFixed(2)}`}),e.closeNode()}}}));function ka(){}function kc({icon:e,class:t,onClick:n}){return bB("span",{class:b9("milkdown-icon",t),onPointerdown:n,innerHTML:e?fM.sanitize(e.trim()):void 0})}x6(ks.node,{displayName:"NodeSchema<image-block>",group:"ImageBlock"}),ka(bB),kc.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}},ka(bB,bo);let ku=x1("abcdefg",8),kh=yr({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:i,uploadButton:o,confirmButton:l,uploadPlaceholderText:s,className:a,onImageLoadError:c}){var u,h;let d=vm(!1),p=vm(),f=vm(null!=(u=t.value)?u:""),m=vm(ku()),g=vm((null==(h=t.value)?void 0:h.length)!==0),y=e=>{let t=e.target.value;g.value=0!==t.length,f.value=t},b=e=>{var t,r;"Enter"===e.key&&n(null!=(r=null==(t=p.value)?void 0:t.value)?r:"")},w=e=>{var t;let i=null==(t=e.target.files)?void 0:t[0];i&&r(i).then(e=>{e&&(n(e),g.value=!0)}).catch(e=>{console.error("An error occurred while uploading image"),console.error(e)})};return()=>bB("div",{class:b9("image-edit",a)},bB(kc,{icon:i,class:"image-icon"}),bB("div",{class:b9("link-importer",d.value&&"focus")},bB("input",{ref:p,draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:"link-input-area",value:f.value,onInput:y,onKeydown:b,onFocus:()=>d.value=!0,onBlur:()=>d.value=!1}),!g.value&&bB("div",{class:"placeholder"},bB("input",{disabled:e.value,class:"hidden",id:m.value,type:"file",accept:"image/*",onChange:w}),bB("label",{class:"uploader",for:m.value},bB(kc,{icon:o})),bB("span",{class:"text",onClick:()=>{var e;return null==(e=p.value)?void 0:e.focus()}},s))),f.value&&bB(bo,null,bB("div",{class:"image-preview"},bB("img",{src:f.value,alt:"",onError:e=>Promise.resolve(null==c?void 0:c(e)).catch(()=>{})})),bB("div",{class:"confirm",onClick:()=>{var e,t;n(null!=(t=null==(e=p.value)?void 0:e.value)?t:"")}},bB(kc,{icon:l}))))}});ka(bB,bo);let kd=yr({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup({src:e,caption:t,ratio:n,readonly:r,setAttr:i,config:o}){var l;let s=vm(),a=vm(),c=vm(!!(null==(l=t.value)?void 0:l.length)),u=vm(0),h=()=>{var e;let t=s.value;if(!t)return;let r=t.closest(".milkdown-image-block");if(!r)return;let i=r.getBoundingClientRect().width;if(!i)return;o.maxWidth&&o.maxWidth<i&&(i=o.maxWidth);let l=t.naturalHeight,a=t.naturalWidth,c=a<i?l:l/a*i;o.maxHeight&&c>o.maxHeight&&(c=o.maxHeight);let u=(c*(null!=(e=n.value)?e:1)).toFixed(2);t.dataset.origin=c.toFixed(2),t.dataset.height=u,t.style.height=`${u}px`,o.maxWidth&&(t.style.maxWidth=`${o.maxWidth}px`)},d=e=>{e.preventDefault(),e.stopPropagation(),r.value||(c.value=!c.value)},p=e=>{let t=e.target.value;u.value&&window.clearTimeout(u.value),u.value=window.setTimeout(()=>{i("caption",t)},1e3)},f=e=>{let t=e.target.value;u.value&&(window.clearTimeout(u.value),u.value=0),i("caption",t)},m=e=>{e.preventDefault();let t=s.value;if(!t)return;let n=t.getBoundingClientRect().top,r=e.clientY-n;r<100&&(r=100),o.maxHeight&&r>o.maxHeight&&(r=o.maxHeight);let i=Number(r).toFixed(2);t.dataset.height=i,t.style.height=`${i}px`},g=()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",g);let e=s.value;if(!e)return;let t=Number(e.dataset.origin),n=Number.parseFloat(Number(Number(e.dataset.height)/t).toFixed(2));Number.isNaN(n)||i("ratio",n)},y=e=>{r.value||(e.preventDefault(),e.stopPropagation(),window.addEventListener("pointermove",m),window.addEventListener("pointerup",g))};return()=>bB(bo,null,bB("div",{class:"image-wrapper"},bB("div",{class:"operation"},bB("div",{class:"operation-item",onPointerdown:d},bB(kc,{icon:o.captionIcon}))),bB("img",{ref:s,"data-type":kl,onLoad:h,src:e.value,alt:t.value,onError:e=>{var t;return Promise.resolve(null==(t=o.onImageLoadError)?void 0:t.call(o,e)).catch(()=>{})}}),bB("div",{ref:a,class:"image-resize-handle",onPointerdown:y})),c.value&&bB("input",{draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},class:"caption-input",placeholder:null==o?void 0:o.captionPlaceholderText,onInput:p,onBlur:f,value:t.value}))}});var kp=Object.defineProperty,kf=Object.getOwnPropertySymbols,km=Object.prototype.hasOwnProperty,kg=Object.prototype.propertyIsEnumerable,kv=(e,t,n)=>t in e?kp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;ka(bB,bo);let ky=yr({props:{src:{type:Object,required:!0},caption:{type:Object,required:!0},ratio:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){let{src:t}=e;return()=>{var n;return(null==(n=t.value)?void 0:n.length)?bB(kd,((e,t)=>{for(var n in t||(t={}))km.call(t,n)&&kv(e,n,t[n]);if(kf)for(var n of kf(t))kg.call(t,n)&&kv(e,n,t[n]);return e})({},e)):bB(kh,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr("src",t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,onImageLoadError:e.config.onImageLoadError})}}}),kb=dk(ks.node,e=>(t,n,r)=>{let i=vm(t.attrs.src),o=vm(t.attrs.caption),l=vm(t.attrs.ratio),s=vm(!1),a=vm(!n.editable),c=e.get(x8.key),u=b8(ky,{src:i,caption:o,ratio:l,selected:s,readonly:a,setAttr:(e,t)=>{if(!n.editable)return;let i=r();null!=i&&n.dispatch(n.state.tr.setNodeAttribute(i,e,"src"===e?fM.sanitize(t):t))},config:c}),h=document.createElement("div");h.className="milkdown-image-block";let d=v4(()=>{s.value?h.classList.add("selected"):h.classList.remove("selected")}),p=c.proxyDomURL,f=e=>{if(p){let t=p(e.attrs.src);"string"==typeof t?i.value=t:t.then(e=>{i.value=e}).catch(console.error)}else i.value=e.attrs.src;l.value=e.attrs.ratio,o.value=e.attrs.caption,a.value=!n.editable};return f(t),u.mount(h),{dom:h,update:e=>e.type===t.type&&(f(e),!0),stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{d(),u.unmount(),h.remove()}}});x6(kb,{displayName:"NodeView<image-block>",group:"ImageBlock"});let kw=[ke,ks,kb,x8].flat();if("u">typeof WeakMap){let e=new WeakMap;p=t=>e.get(t),f=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;p=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},f=(n,r)=>(10==t&&(t=0),e[t++]=n,e[t++]=r)}var kx=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,o=r+1,l=i+1;for(let e=1;o<this.width&&this.map[t+e]==n;e++)o++;for(let e=1;l<this.height&&this.map[t+this.width*e]==n;e++)l++;return{left:r,top:i,right:o,bottom:l}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:o,bottom:l}=this.findCell(e);return"horiz"==t?(n<0?0==r:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?0==o:l==this.height)?null:this.map[r+this.width*(n<0?o-1:l)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:l,right:s,top:a,bottom:c}=this.findCell(t);return{left:Math.min(n,l),top:Math.min(i,a),right:Math.max(r,s),bottom:Math.max(o,c)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let o=r*this.width+i,l=this.map[o];!n[l]&&(n[l]=!0,i==e.left&&i&&this.map[o-1]==l||r==e.top&&r&&this.map[o-this.width]==l||t.push(l))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?o-1:this.map[n]}i=o}}static get(e){return p(e)||f(e,function(e){if("table"!=e.type.spec.tableRole)throw RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),o=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(o+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);o+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=o:t!=o&&(t=Math.max(t,o))}return t}(e),n=e.childCount,r=[],i=0,o=null,l=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,a=0;s<n;s++){let c=e.child(s);a++;for(let e=0;;e++){for(;i<r.length&&0!=r[i];)i++;if(e==c.childCount)break;let u=c.child(e),{colspan:h,rowspan:d,colwidth:p}=u.attrs;for(let e=0;e<d;e++){if(e+s>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:a,n:d-e});break}let c=i+e*t;for(let e=0;e<h;e++){0==r[c+e]?r[c+e]=a:(o||(o=[])).push({type:"collision",row:s,pos:a,n:h-e});let n=p&&p[e];if(n){let r=(c+e)%t*2,i=l[r];null==i||i!=n&&1==l[r+1]?(l[r]=n,l[r+1]=1):i==n&&l[r+1]++}}}i+=h,a+=u.nodeSize}let u=(s+1)*t,h=0;for(;i<u;)0==r[i++]&&h++;h&&(o||(o=[])).push({type:"missing",row:s,n:h}),a++}(0===t||0===n)&&(o||(o=[])).push({type:"zero_sized"});let s=new kx(t,n,r,o),a=!1;for(let e=0;!a&&e<l.length;e+=2)null!=l[e]&&l[e+1]<n&&(a=!0);return a&&function(e,t,n){e.problems||(e.problems=[]);let r={};for(let i=0;i<e.map.length;i++){let o=e.map[i];if(r[o])continue;r[o]=!0;let l=n.nodeAt(o);if(!l)throw RangeError(`No cell with offset ${o} found`);let s=null,a=l.attrs;for(let n=0;n<a.colspan;n++){let r=t[(i+n)%e.width*2];null==r||a.colwidth&&a.colwidth[n]==r||((s||(s=function(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}(a)))[n]=r)}s&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:s})}}(s,l,e),s}(e))}};function kk(e,t){if("string"==typeof e)return{};let n=e.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(e=>Number(e)):null,i=Number(e.getAttribute("colspan")||1),o={colspan:i,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:r&&r.length==i?r:null};for(let n in t){let r=t[n].getFromDOM,i=r&&r(e);null!=i&&(o[n]=i)}return o}function kC(e,t){let n={};for(let r in 1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(",")),t){let i=t[r].setDOMAttr;i&&i(e.attrs[r],n)}return n}function kS(e){if(null!==e){if(!Array.isArray(e))throw TypeError("colwidth must be null or an array");for(let t of e)if("number"!=typeof t)throw TypeError("colwidth must be null or an array of numbers")}}function kM(e){let t=e.cached.tableNodeTypes;if(!t)for(let n in t=e.cached.tableNodeTypes={},e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}return t}let kA=new sP("selectingCells");function kT(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function kO(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function kE(e){let t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;let n=kT(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function kN(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function kD(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function kI(e,t,n){let r=e.node(-1),i=kx.get(r),o=e.start(-1),l=i.nextCell(e.pos-o,t,n);return null==l?null:e.node(0).resolve(o+l)}function kL(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}var k_=class e extends sg{constructor(e,t=e){const n=e.node(-1),r=kx.get(n),i=e.start(-1),o=r.rectBetween(e.pos-i,t.pos-i),l=e.node(0),s=r.cellsInRect(o).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);const a=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new sv(l.resolve(r),l.resolve(r+t.content.size))});super(a[0].$from,a[0].$to,a),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(kN(r)&&kN(i)&&kD(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return sw.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=kx.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let n=r.top;n<r.bottom;n++){let l=[];for(let o=n*t.width+r.left,s=r.left;s<r.right;s++,o++){let n=t.map[o];if(i[n])continue;i[n]=!0;let s=t.findCell(n),a=e.nodeAt(n);if(!a)throw RangeError(`No cell with offset ${n} found`);let c=r.left-s.left,u=s.right-r.right;if(c>0||u>0){let e=a.attrs;if(c>0&&(e=kL(e,0,c)),u>0&&(e=kL(e,e.colspan-u,u)),s.left<r.left){if(!(a=a.type.createAndFill(e)))throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else a=a.type.create(e,a.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...a.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};a=s.top<r.top?a.type.createAndFill(e):a.type.create(e,a.content)}l.push(a)}o.push(e.child(n).copy(o3.from(l)))}let l=this.isColSelection()&&this.isRowSelection()?e:o;return new lt(o3.from(l),1,1)}replace(e,t=lt.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:l}=r[i],s=e.mapping.slice(n);e.replace(s.map(o.pos),s.map(l.pos),i?lt.empty:t)}let i=sg.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new lt(o3.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=kx.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);return!(Math.min(e,t)>0)&&Math.max(e+this.$anchorCell.nodeAfter.attrs.rowspan,t+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=kx.get(r),o=t.start(-1),l=i.findCell(t.pos-o),s=i.findCell(n.pos-o),a=t.node(0);return l.top<=s.top?(l.top>0&&(t=a.resolve(o+i.map[l.left])),s.bottom<i.height&&(n=a.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=a.resolve(o+i.map[s.left])),l.bottom<i.height&&(t=a.resolve(o+i.map[i.width*(i.height-1)+l.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=kx.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);return!(Math.min(r,i)>0)&&Math.max(r+this.$anchorCell.nodeAfter.attrs.colspan,i+this.$headCell.nodeAfter.attrs.colspan)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=kx.get(r),o=t.start(-1),l=i.findCell(t.pos-o),s=i.findCell(n.pos-o),a=t.node(0);return l.left<=s.left?(l.left>0&&(t=a.resolve(o+i.map[l.top*i.width])),s.right<i.width&&(n=a.resolve(o+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=a.resolve(o+i.map[s.top*i.width])),l.right<i.width&&(t=a.resolve(o+i.map[i.width*(l.top+1)-1]))),new e(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new kR(this.$anchorCell.pos,this.$headCell.pos)}};k_.prototype.visible=!1,sg.jsonID("cell",k_);var kR=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&kD(t,n)?new k_(t,n):sg.near(n,1)}};function kz(e){if(!(e.selection instanceof k_))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(uJ.node(n,n+e.nodeSize,{class:"selectedCell"}))}),uX.create(e.doc,t)}let kP=new sP("fix-tables");function kB(e){let t=kx.get(e),n=[],r=t.height,i=t.width;for(let o=0;o<r;o++){let r=[];for(let n=0;n<i;n++){let l=o*i+n,s=t.map[l];if(o>0){let e=l-i;if(s===t.map[e]){r.push(null);continue}}if(n>0){let e=l-1;if(s===t.map[e]){r.push(null);continue}}r.push(e.nodeAt(s))}n.push(r)}return n}function kF(e,t){let n=[],r=kx.get(e),i=r.height,o=r.width;for(let l=0;l<i;l++){let i=e.child(l),s=[];for(let n=0;n<o;n++){let i=t[l][n];if(!i)continue;let o=r.map[l*r.width+n],a=e.nodeAt(o);if(!a)continue;let c=a.type.createChecked(i.attrs,i.content,i.marks);s.push(c)}let a=i.type.createChecked(i.attrs,s,i.marks);n.push(a)}return e.type.createChecked(e.attrs,n,e.marks)}function kH(e,t,n,r){let i,o=t[0]>n[0]?-1:1,l=e.splice(t[0],t.length),s=+(l.length%2==0);return i=-1===r&&1===o?n[0]-1:1===r&&-1===o?n[n.length-1]-s+1:-1===o?n[0]:n[n.length-1]-s,e.splice(i,0,...l),e}function kq(e){var t=e;for(let e=t.depth;e>=0;e-=1){let n=t.node(e);if((e=>"table"===e.type.spec.tableRole)(n))return{node:n,pos:0===e?0:t.before(e),start:t.start(e),depth:e}}return null}function kj(e,t){let n=kq(t.$from);if(!n)return;let r=kx.get(n.node);if(!(e<0)&&!(e>r.width-1))return r.cellsInRect({left:e,right:e+1,top:0,bottom:r.height}).map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function kV(e,t){let n=kq(t.$from);if(!n)return;let r=kx.get(n.node);if(!(e<0)&&!(e>r.height-1))return r.cellsInRect({left:0,right:r.width,top:e,bottom:e+1}).map(e=>{let t=n.node.nodeAt(e),r=e+n.start;return{pos:r,start:r+1,node:t,depth:n.depth+2}})}function k$(e,t,n=t){let r,i=t,o=n;for(let n=t;n>=0;n--){let t=kj(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.colspan+n-1;t>=i&&(i=n),t>o&&(o=t)})}for(let n=t;n<=o;n++){let t=kj(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.colspan+n-1;e.node.attrs.colspan>1&&t>o&&(o=t)})}let l=[];for(let t=i;t<=o;t++){let n=kj(t,e.selection);n&&n.length>0&&l.push(t)}i=l[0],o=l[l.length-1];let s=kj(i,e.selection),a=kV(0,e.selection);if(!s||!a)return;let c=e.doc.resolve(s[s.length-1].pos);for(let t=o;t>=i;t--){let n=kj(t,e.selection);if(n&&n.length>0){for(let e=a.length-1;e>=0;e--)if(a[e].pos===n[0].pos){r=n[0];break}if(r)break}}if(r)return{$anchor:c,$head:e.doc.resolve(r.pos),indexes:l}}function kW(e,t,n=t){let r,i=t,o=n;for(let n=t;n>=0;n--){let t=kV(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.rowspan+n-1;t>=i&&(i=n),t>o&&(o=t)})}for(let n=t;n<=o;n++){let t=kV(n,e.selection);t&&t.forEach(e=>{let t=e.node.attrs.rowspan+n-1;e.node.attrs.rowspan>1&&t>o&&(o=t)})}let l=[];for(let t=i;t<=o;t++){let n=kV(t,e.selection);n&&n.length>0&&l.push(t)}i=l[0],o=l[l.length-1];let s=kV(i,e.selection),a=kj(0,e.selection);if(!s||!a)return;let c=e.doc.resolve(s[s.length-1].pos);for(let t=o;t>=i;t--){let n=kV(t,e.selection);if(n&&n.length>0){for(let e=a.length-1;e>=0;e--)if(a[e].pos===n[0].pos){r=n[0];break}if(r)break}}if(r)return{$anchor:c,$head:e.doc.resolve(r.pos),indexes:l}}function kU(e){return e[0].map((t,n)=>e.map(e=>e[n]))}function kG(e){let t=e.selection,n=kE(e),r=n.node(-1),i=n.start(-1),o=kx.get(r);return{...t instanceof k_?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function kK(e,{map:t,tableStart:n,table:r},i){let o=i>0?-1:0;(function(e,t,n){let r=kM(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0})(t,r,i+o)&&(o=0==i||i==t.width?null:0);for(let l=0;l<t.height;l++){let s=l*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let o=t.map[s],a=r.nodeAt(o);e.setNodeMarkup(e.mapping.map(n+o),null,function(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}(a.attrs,i-t.colCount(o))),l+=a.attrs.rowspan-1}else{let a=null==o?kM(r.type.schema).cell:r.nodeAt(t.map[s+o]).type,c=t.positionAt(l,i,r);e.insert(e.mapping.map(n+c),a.createAndFill())}}return e}function kJ(e,t){if(!kO(e))return!1;if(t){let n=kG(e);t(kK(e.tr,n,n.left))}return!0}function kZ(e,t){if(!kO(e))return!1;if(t){let n=kG(e);t(kK(e.tr,n,n.right))}return!0}function kY(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function kX(e,t){if((t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic)return function(t,n){if(!kO(t))return!1;if(n){let r=kM(t.schema),i=kG(t),o=t.tr,l=i.map.cellsInRect("column"==e?{left:i.left,top:0,right:i.right,bottom:i.map.height}:"row"==e?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=l.map(e=>i.table.nodeAt(e));for(let e=0;e<l.length;e++)s[e].type==r.header_cell&&o.setNodeMarkup(i.tableStart+l[e],r.cell,s[e].attrs);if(0===o.steps.length)for(let e=0;e<l.length;e++)o.setNodeMarkup(i.tableStart+l[e],r.header_cell,s[e].attrs);n(o)}return!0};return function(t,n){if(!kO(t))return!1;if(n){let r=kM(t.schema),i=kG(t),o=t.tr,l=kY("row",i,r),s=kY("column",i,r),a=+("column"===e?!!l:"row"===e&&!!s),c="column"==e?{left:0,top:a,right:1,bottom:i.map.height}:"row"==e?{left:a,top:0,right:i.map.width,bottom:1}:i,u="column"==e?s?r.cell:r.header_cell:"row"==e?l?r.cell:r.header_cell:r.cell;i.map.cellsInRect(c).forEach(e=>{let t=e+i.tableStart,n=o.doc.nodeAt(t);n&&o.setNodeMarkup(t,u,n.attrs)}),n(o)}return!0}}function kQ(e){return function(t,n){if(!kO(t))return!1;let r=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}(kE(t),e);if(null==r)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(sw.between(e,e.node(0).resolve(e.pos+e.nodeAfter.nodeSize))).scrollIntoView())}return!0}}function k0(e,t){let n=e.selection;if(!(n instanceof k_))return!1;if(t){let r=e.tr,i=kM(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new lt(i,0,0))}),r.docChanged&&t(r)}return!0}function k1(e,t){let n=e.createAndFill();return new sf(n).replace(0,n.content.size,t).doc}function k4(e,t,n,r,i,o,l,s){if(0==l||l==t.height)return!1;let a=!1;for(let c=i;c<o;c++){let i=l*t.width+c,o=t.map[i];if(t.map[i-t.width]==o){a=!0;let i=n.nodeAt(o),{top:u,left:h}=t.findCell(o);e.setNodeMarkup(e.mapping.slice(s).map(o+r),null,{...i.attrs,rowspan:l-u}),e.insert(e.mapping.slice(s).map(t.positionAt(l,h,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-l})),c+=i.attrs.colspan-1}}return a}function k5(e,t,n,r,i,o,l,s){if(0==l||l==t.width)return!1;let a=!1;for(let c=i;c<o;c++){let i=c*t.width+l,o=t.map[i];if(t.map[i-1]==o){a=!0;let i=n.nodeAt(o),u=t.colCount(o),h=e.mapping.slice(s).map(o+r);e.setNodeMarkup(h,null,kL(i.attrs,l-u,i.attrs.colspan-(l-u))),e.insert(h+i.nodeSize,i.type.createAndFill(kL(i.attrs,0,l-u))),c+=i.attrs.rowspan-1}}return a}function k2(e,t,n,r,i){let o=n?e.doc.nodeAt(n-1):e.doc;if(!o)throw Error("No table found");let l=kx.get(o),{top:s,left:a}=r,c=a+i.width,u=s+i.height,h=e.tr,d=0;function p(){if(!(o=n?h.doc.nodeAt(n-1):h.doc))throw Error("No table found");l=kx.get(o),d=h.mapping.maps.length}(function(e,t,n,r,i,o){let l,s,a=kM(e.doc.type.schema);if(i>t.width)for(let o=0,c=0;o<t.height;o++){let u,h=n.child(o);c+=h.nodeSize;let d=[];u=null==h.lastChild||h.lastChild.type==a.cell?l||(l=a.cell.createAndFill()):s||(s=a.header_cell.createAndFill());for(let e=t.width;e<i;e++)d.push(u);e.insert(e.mapping.slice(0).map(c-1+r),d)}if(o>t.height){let c=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==a.header_cell;c.push(i?s||(s=a.header_cell.createAndFill()):l||(l=a.cell.createAndFill()))}let u=a.row.create(null,o3.from(c)),h=[];for(let e=t.height;e<o;e++)h.push(u);e.insert(e.mapping.slice(0).map(r+n.nodeSize-2),h)}return!!(l||s)})(h,l,o,n,c,u)&&p(),k4(h,l,o,n,a,c,s,d)&&p(),k4(h,l,o,n,a,c,u,d)&&p(),k5(h,l,o,n,s,u,a,d)&&p(),k5(h,l,o,n,s,u,c,d)&&p();for(let e=s;e<u;e++){let t=l.positionAt(e,a,o),r=l.positionAt(e,c,o);h.replace(h.mapping.slice(d).map(t+n),h.mapping.slice(d).map(r+n),new lt(i.rows[e-s],0,0))}p(),h.setSelection(new k_(h.doc.resolve(n+l.positionAt(s,a,o)),h.doc.resolve(n+l.positionAt(u-1,c-1,o)))),t(h)}kX("row",{useDeprecatedLogic:!0}),kX("column",{useDeprecatedLogic:!0}),kX("cell",{useDeprecatedLogic:!0});let k3=aj({ArrowLeft:k6("horiz",-1),ArrowRight:k6("horiz",1),ArrowUp:k6("vert",-1),ArrowDown:k6("vert",1),"Shift-ArrowLeft":k8("horiz",-1),"Shift-ArrowRight":k8("horiz",1),"Shift-ArrowUp":k8("vert",-1),"Shift-ArrowDown":k8("vert",1),Backspace:k0,"Mod-Backspace":k0,Delete:k0,"Mod-Delete":k0});function k7(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function k6(e,t){return(n,r,i)=>{if(!i)return!1;let o=n.selection;if(o instanceof k_)return k7(n,r,sg.near(o.$headCell,t));if("horiz"!=e&&!o.empty)return!1;let l=Cn(i,e,t);if(null==l)return!1;if("horiz"==e)return k7(n,r,sg.near(n.doc.resolve(o.head+t),t));{let i,o=n.doc.resolve(l),s=kI(o,e,t);return i=s?sg.near(s,1):t<0?sg.near(n.doc.resolve(o.before(-1)),-1):sg.near(n.doc.resolve(o.after(-1)),1),k7(n,r,i)}}}function k8(e,t){return(n,r,i)=>{let o;if(!i)return!1;let l=n.selection;if(l instanceof k_)o=l;else{let r=Cn(i,e,t);if(null==r)return!1;o=new k_(n.doc.resolve(r))}let s=kI(o.$headCell,e,t);return!!s&&k7(n,r,new k_(o.$anchorCell,s))}}function k9(e,t){let n=kT(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new k_(n))),!0)}function Ce(e,t,n){if(!kO(e.state))return!1;let r=function(e){if(0===e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.child(0).type.spec.tableRole);)n--,r--,t=t.child(0).content;let i=t.child(0),o=i.type.spec.tableRole,l=i.type.schema,s=[];if("row"==o)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,o=e?0:Math.max(0,n-1),a=e<t.childCount-1?0:Math.max(0,r-1);(o||a)&&(i=k1(kM(l).row,new lt(i,o,a)).content),s.push(i)}else{if("cell"!=o&&"header_cell"!=o)return null;s.push(n||r?k1(kM(l).row,new lt(t,n,r)).content:t)}return function(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:o}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+o}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(o3.empty),n[i]<r){let o=kM(e).cell.createAndFill(),l=[];for(let e=n[i];e<r;e++)l.push(o);t[i]=t[i].append(o3.from(l))}return{height:t.length,width:r,rows:t}}(l,s)}(n),i=e.state.selection;if(i instanceof k_){r||(r={width:1,height:1,rows:[o3.from(k1(kM(e.state.schema).cell,n))]});let t=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),l=kx.get(t).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=function({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let o=n[e],l=[];for(let n=t[e]||0,i=0;n<r;i++){let s=o.child(i%o.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(kL(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),l.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(o3.from(l))}n=i,e=r}if(t!=i){let e=[];for(let r=0,o=0;r<i;r++,o++){let l=[],s=n[o%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),l.push(t)}e.push(o3.from(l))}n=e,t=i}return{width:e,height:t,rows:n}}(r,l.right-l.left,l.bottom-l.top),k2(e.state,e.dispatch,o,l,r),!0}if(!r)return!1;{let t=kE(e.state),n=t.start(-1);return k2(e.state,e.dispatch,n,kx.get(t.node(-1)).findCell(t.pos-n),r),!0}}function Ct(e,t){var n;let r;if(0!=t.button||t.ctrlKey||t.metaKey)return;let i=Cr(e,t.target);if(t.shiftKey&&e.state.selection instanceof k_)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&i&&null!=(r=kT(e.state.selection.$anchor))&&(null==(n=Ci(e,t))?void 0:n.pos)!=r.pos)o(r,t),t.preventDefault();else if(!i)return;function o(t,n){let r=Ci(e,n),i=null==kA.getState(e.state);if(!r||!kD(t,r))if(!i)return;else r=t;let o=new k_(t,r);if(i||!e.state.selection.eq(o)){let n=e.state.tr.setSelection(o);i&&n.setMeta(kA,t.pos),e.dispatch(n)}}function l(){e.root.removeEventListener("mouseup",l),e.root.removeEventListener("dragstart",l),e.root.removeEventListener("mousemove",s),null!=kA.getState(e.state)&&e.dispatch(e.state.tr.setMeta(kA,-1))}function s(n){let r,s=kA.getState(e.state);if(null!=s)r=e.state.doc.resolve(s);else if(Cr(e,n.target)!=i&&!(r=Ci(e,t)))return l();r&&o(r,n)}e.root.addEventListener("mouseup",l),e.root.addEventListener("dragstart",l),e.root.addEventListener("mousemove",s)}function Cn(e,t,n){if(!(e.state.selection instanceof sw))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))break;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){let o=r.before(i),l="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?o:null}}return null}function Cr(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function Ci(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&kT(e.state.doc.resolve(r))||kT(e.state.doc.resolve(i))}var Co=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Cl(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,Cl(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function Cl(e,t,n,r,i,o){let l=0,s=!0,a=t.firstChild,c=e.firstChild;if(c){for(let e=0,n=0;e<c.childCount;e++){let{colspan:u,colwidth:h}=c.child(e).attrs;for(let e=0;e<u;e++,n++){let c=i==n?o:h&&h[e],u=c?c+"px":"";if(l+=c||r,c||(s=!1),a)a.style.width!=u&&(a.style.width=u),a=a.nextSibling;else{let e=document.createElement("col");e.style.width=u,t.appendChild(e)}}}for(;a;){var u;let e=a.nextSibling;null==(u=a.parentNode)||u.removeChild(a),a=e}s?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}let Cs=new sP("tableColumnResizing");var Ca=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=t.getMeta(Cs);if(n&&null!=n.setHandle)return new e(n.setHandle,!1);if(n&&void 0!==n.setDragging)return new e(this.activeHandle,n.setDragging);if(this.activeHandle>-1&&t.docChanged){let n=t.mapping.map(this.activeHandle,-1);return kN(t.doc.resolve(n))||(n=-1),new e(n,this.dragging)}return this}};function Cc(e,t,n,r){let i=e.posAtCoords({left:t.clientX+("right"==n?-r:r),top:t.clientY});if(!i)return -1;let{pos:o}=i,l=kT(e.state.doc.resolve(o));if(!l)return -1;if("right"==n)return l.pos;let s=kx.get(l.node(-1)),a=l.start(-1),c=s.map.indexOf(l.pos-a);return c%s.width==0?-1:a+s.map[c-1]}function Cu(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Ch(e,t){e.dispatch(e.state.tr.setMeta(Cs,{setHandle:t}))}function Cd(e,t,n,r){let i=e.state.doc.resolve(t),o=i.node(-1),l=i.start(-1),s=kx.get(o).colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1,a=e.domAtPos(i.start(-1)).node;for(;a&&"TABLE"!=a.nodeName;)a=a.parentNode;a&&Cl(o,a.firstChild,a,r,s,n)}var Cp="u">typeof navigator?navigator:null,Cf=Cp&&Cp.userAgent||"",Cm=/Edge\/(\d+)/.exec(Cf),Cg=/MSIE \d/.exec(Cf),Cv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Cf),Cy=!(Cg||Cv||Cm)&&!!Cp&&/Apple Computer/.test(Cp.vendor),Cb=new sP("safari-ime-span"),Cw=!1;function Cx(e){let t=e.dom.ownerDocument.createElement("span");return t.className="ProseMirror-safari-ime-span",t}var Ck=new s_(Cy?{key:Cb,props:{decorations:function(e){let{$from:t,$to:n,to:r}=e.selection;if(Cw&&t.sameParent(n)){let t=uJ.widget(r,Cx,{ignoreSelection:!0,key:"safari-ime-span"});return uX.create(e.doc,[t])}},handleDOMEvents:{compositionstart:()=>{Cw=!0},compositionend:()=>{Cw=!1}}}}:{key:Cb});function CC(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let CS="phrasing",CM=["autolink","link","image","label"];function CA(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function CT(e){this.config.enter.autolinkProtocol.call(this,e)}function CO(e){this.config.exit.autolinkProtocol.call(this,e)}function CE(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];o_("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function CN(e){this.config.exit.autolinkEmail.call(this,e)}function CD(e){this.exit(e)}function CI(e){!function(e,t,n){let r=i2((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),o=-1;for(;++o<i.length;)i9(e,"text",l);function l(e,t){let n,l=-1;for(;++l<t.length;){let e=t[l],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[o][0],l=i[o][1],s=0,a=n.children.indexOf(e),c=!1,u=[];r.lastIndex=0;let h=r.exec(e.value);for(;h;){let n=h.index,i={index:h.index,input:h.input,stack:[...t,e]},o=l(...h,i);if("string"==typeof o&&(o=o.length>0?{type:"text",value:o}:void 0),!1===o?r.lastIndex=n+1:(s!==n&&u.push({type:"text",value:e.value.slice(s,n)}),Array.isArray(o)?u.push(...o):o&&u.push(o),s=n+h[0].length,c=!0),!r.global)break;h=r.exec(e.value)}return c?(s<e.value.length&&u.push({type:"text",value:e.value.slice(s)}),n.children.splice(a,1,...u)):u=[e],a+u.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,CL],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,C_]],{ignore:["link","linkReference"]})}function CL(e,t,n,r,i){let o,l="";if(!CR(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",l="http://"),(o=n.split(".")).length<2||o[o.length-1]&&(/_/.test(o[o.length-1])||!/[a-zA-Z\d]/.test(o[o.length-1]))||o[o.length-2]&&(/_/.test(o[o.length-2])||!/[a-zA-Z\d]/.test(o[o.length-2])))return!1;let s=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=CC(e,"("),o=CC(e,")");for(;-1!==r&&i>o;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),o++;return[e,n]}(n+r);if(!s[0])return!1;let a={type:"link",title:null,url:l+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function C_(e,t,n,r){return!(!CR(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function CR(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||rF(n)||rB(n))&&(!t||47!==n)}function Cz(){this.buffer()}function CP(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function CB(){this.buffer()}function CF(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function CH(e){let t=this.resume(),n=this.stack[this.stack.length-1];o_("footnoteReference"===n.type),n.identifier=id(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Cq(e){this.exit(e)}function Cj(e){let t=this.resume(),n=this.stack[this.stack.length-1];o_("footnoteDefinition"===n.type),n.identifier=id(this.sliceSerialize(e)).toLowerCase(),n.label=t}function CV(e){this.exit(e)}function C$(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),l=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),l(),o+=i.move("]")}function CW(e,t,n){return 0===t?e:CU(e,t,n)}function CU(e,t,n){return(n?"":" ")+e}C$.peek=function(){return"["};let CG=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function CK(e){this.enter({type:"delete",children:[]},e)}function CJ(e){this.exit(e)}function CZ(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function CY(e){return e.length}function CX(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}function CQ(e){let t=e._align;o_(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function C0(e){this.exit(e),this.data.inTable=void 0}function C1(e){this.enter({type:"tableRow",children:[]},e)}function C4(e){this.exit(e)}function C5(e){this.enter({type:"tableCell",children:[]},e)}function C2(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,C3));let n=this.stack[this.stack.length-1];o_("inlineCode"===n.type),n.value=t,this.exit(e)}function C3(e,t){return"|"===t?t:e}function C7(e){let t=this.stack[this.stack.length-2];o_("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function C6(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];o_("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,o=-1;for(;++o<i.length;){let e=i[o];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function C8(e,t,n,r){let i=e.children[0],o="boolean"==typeof e.checked&&i&&"paragraph"===i.type,l="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(l);let a=of.listItem(e,t,n,{...r,...s.current()});return o&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+l})),a}CZ.peek=function(){return"~"};let C9={tokenize:function(e,t,n){let r=0;return function t(o){return(87===o||119===o)&&r<3?(r++,e.consume(o),t):46===o&&3===r?(e.consume(o),i):n(o)};function i(e){return null===e?n(e):t(e)}},partial:!0},Se={tokenize:function(e,t,n){let r,i,o;return l;function l(t){return 46===t||95===t?e.check(Sn,a,s)(t):null===t||rz(t)||rF(t)||45!==t&&rB(t)?a(t):(o=!0,e.consume(t),l)}function s(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),l}function a(e){return i||r||!o?n(e):t(e)}},partial:!0},St={tokenize:function(e,t){let n=0,r=0;return i;function i(l){return 40===l?(n++,e.consume(l),i):41===l&&r<n?o(l):33===l||34===l||38===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||60===l||63===l||93===l||95===l||126===l?e.check(Sn,t,o)(l):null===l||rz(l)||rF(l)?t(l):(e.consume(l),i)}function o(t){return 41===t&&r++,e.consume(t),i}},partial:!0},Sn={tokenize:function(e,t,n){return r;function r(l){return 33===l||34===l||39===l||41===l||42===l||44===l||46===l||58===l||59===l||63===l||95===l||126===l?(e.consume(l),r):38===l?(e.consume(l),o):93===l?(e.consume(l),i):60===l||null===l||rz(l)||rF(l)?t(l):n(l)}function i(e){return null===e||40===e||91===e||rz(e)||rF(e)?t(e):r(e)}function o(t){return rO(t)?function t(i){return 59===i?(e.consume(i),r):rO(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},Sr={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return rE(e)?n(e):t(e)}},partial:!0},Si={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!Sc.call(r,r.previous)||Sp(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(C9,e.attempt(Se,e.attempt(St,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:Sc},So={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",o=!1;return function(t){return(72===t||104===t)&&Su.call(r,r.previous)&&!Sp(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),l):n(t)};function l(t){if(rO(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),l;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),s}return n(t)}function s(t){return 47===t?(e.consume(t),o)?a:(o=!0,s):n(t)}function a(t){return null===t||rD(t)||rz(t)||rF(t)||rB(t)?n(t):e.attempt(Se,e.attempt(St,c),n)(t)}function c(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:Su},Sl={name:"emailAutolink",tokenize:function(e,t,n){let r,i,o=this;return function(t){return!Sd(t)||!Sh.call(o,o.previous)||Sp(o.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return Sd(r)?(e.consume(r),t):64===r?(e.consume(r),l):n(r)}(t))};function l(t){return 46===t?e.check(Sr,a,s)(t):45===t||95===t||rE(t)?(i=!0,e.consume(t),l):a(t)}function s(t){return e.consume(t),r=!0,l}function a(l){return i&&r&&rO(o.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(l)):n(l)}},previous:Sh},Ss={},Sa=48;for(;Sa<123;)Ss[Sa]=Sl,58==++Sa?Sa=65:91===Sa&&(Sa=97);function Sc(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||rz(e)}function Su(e){return!rO(e)}function Sh(e){return!(47===e||Sd(e))}function Sd(e){return 43===e||45===e||46===e||95===e||rE(e)}function Sp(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}Ss[43]=Sl,Ss[45]=Sl,Ss[46]=Sl,Ss[95]=Sl,Ss[72]=[Sl,So],Ss[104]=[Sl,So],Ss[87]=[Sl,Si],Ss[119]=[Sl,Si];let Sf={tokenize:function(e,t,n){let r=this;return rq(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function Sm(e,t,n){let r,i=this,o=i.events.length,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;o--;){let e=i.events[o][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!r||!r._balanced)return n(o);let s=id(i.sliceSerialize({start:r.end,end:i.now()}));return 94===s.codePointAt(0)&&l.includes(s.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)):n(o)}}function Sg(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function Sv(e,t,n){let r,i=this,o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),l=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),s};function s(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",a)}function a(s){if(l>999||93===s&&!r||null===s||91===s||rz(s))return n(s);if(93===s){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return o.includes(id(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(s),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(s)}return rz(s)||(r=!0),l++,e.consume(s),92===s?c:a}function c(t){return 91===t||92===t||93===t?(e.consume(t),l++,a):a(t)}}function Sy(e,t,n){let r,i,o=this,l=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),a};function a(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(s>999||93===t&&!i||null===t||91===t||rz(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=id(o.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return rz(t)||(i=!0),s++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),s++,c):c(t)}function h(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),l.includes(r)||l.push(r),rq(e,d,"gfmFootnoteDefinitionWhitespace")):n(t)}function d(e){return t(e)}}function Sb(e,t,n){return e.check(rW,t,e.attempt(Sf,t,n))}function Sw(e){e.exit("gfmFootnoteDefinition")}class Sx{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function Sk(e,t,n){let r,i=this,o=0,l=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,o="tableHead"===r||"tableRow"===r?b:s;return o===b&&i.parser.lazy[i.now().line]?n(e):o(e)};function s(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,l+=1),a(n)}function a(t){return null===t?n(t):rR(t)?l>1?(l=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h):n(t):rP(t)?rq(e,a,"whitespace")(t):(l+=1,r&&(r=!1,o+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,a):(e.enter("data"),c(t))}function c(t){return null===t||124===t||rz(t)?(e.exit("data"),a(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function h(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,rP(t))?rq(e,d,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):d(t)}function d(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return rP(t)?rq(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(l+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),m):45===t?(l+=1,m(t)):null===t||rR(t)?y(t):n(t)}function m(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return rP(t)?rq(e,y,"whitespace")(t):y(t)}function y(i){if(124===i)return d(i);if(null===i||rR(i))return r&&o===l?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function b(t){return e.enter("tableRow"),w(t)}function w(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),w):null===n||rR(n)?(e.exit("tableRow"),t(n)):rP(n)?rq(e,w,"whitespace")(n):(e.enter("data"),x(n))}function x(t){return null===t||124===t||rz(t)?(e.exit("data"),w(t)):(e.consume(t),92===t?k:x)}function k(t){return 92===t||124===t?(e.consume(t),x):x(t)}}function SC(e,t){let n,r,i,o=-1,l=!0,s=0,a=[0,0,0,0],c=[0,0,0,0],u=!1,h=0,d=new Sx;for(;++o<e.length;){let p=e[o],f=p[1];"enter"===p[0]?"tableHead"===f.type?(u=!1,0!==h&&(SM(d,t,h,n,r),r=void 0,h=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},d.add(o,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(l=!0,i=void 0,a=[0,0,0,0],c=[0,o+1,0,0],u&&(u=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},d.add(o,0,[["enter",r,t]])),s="tableDelimiterRow"===f.type?2:r?3:1):s&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(l=!1,0===c[2]&&(0!==a[1]&&(c[0]=c[1],i=SS(d,t,a,s,void 0,i),a=[0,0,0,0]),c[2]=o)):"tableCellDivider"===f.type&&(l?l=!1:(0!==a[1]&&(c[0]=c[1],i=SS(d,t,a,s,void 0,i)),c=[(a=c)[1],o,0,0])):"tableHead"===f.type?(u=!0,h=o):"tableRow"===f.type||"tableDelimiterRow"===f.type?(h=o,0!==a[1]?(c[0]=c[1],i=SS(d,t,a,s,o,i)):0!==c[1]&&(i=SS(d,t,c,s,o,i)),s=0):s&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(c[3]=o)}for(0!==h&&SM(d,t,h,n,r),d.consume(t.events),o=-1;++o<t.events.length;){let e=t.events[o];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,o))}return e}function SS(e,t,n,r,i,o){0!==n[0]&&(o.end=Object.assign({},SA(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let l=SA(t.events,n[1]);if(o={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),0!==n[2]){let i=SA(t.events,n[2]),o=SA(t.events,n[3]),l={type:"tableContent",start:Object.assign({},i),end:Object.assign({},o)};if(e.add(n[2],0,[["enter",l,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",l,t]])}return void 0!==i&&(o.end=Object.assign({},SA(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function SM(e,t,n,r,i){let o=[],l=SA(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function SA(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let ST={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return rz(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),o):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),o):n(t)}function o(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(t)}function l(r){return rR(r)?t(r):rP(r)?e.check({tokenize:SO},t,n)(r):n(r)}}};function SO(e,t,n){return rq(e,function(e){return null===e?n(e):t(e)},"whitespace")}let SE={};function SN(e){let t,n,r,i=e||SE,o=this.data(),l=o.micromarkExtensions||(o.micromarkExtensions=[]),s=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),a=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);l.push(rT([{text:Ss},{document:{91:{name:"gfmFootnoteDefinition",tokenize:Sy,continuation:{tokenize:Sb},exit:Sw}},text:{91:{name:"gfmFootnoteCall",tokenize:Sv},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Sm,resolveTo:Sg}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,o=this.events,l=0;return function(s){return 126===i&&"characterEscape"!==o[o.length-1][1].type?r(s):(e.enter("strikethroughSequenceTemporary"),function o(s){let a=r2(i);if(126===s)return l>1?r(s):(e.consume(s),l++,o);if(l<2&&!t)return r(s);let c=e.exit("strikethroughSequenceTemporary"),u=r2(s);return c._open=!u||2===u&&!!a,c._close=!a||2===a&&!!u,n(s)}(s))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},o={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},l=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",o,t]],s=t.parser.constructs.insideSpan.null;s&&rS(l,l.length,0,r3(s,e.slice(r+1,n),t)),rS(l,l.length,0,[["exit",o,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),rS(e,r-1,n-r+3,l),n=r+l.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:Sk,resolveAll:SC}}},{text:{91:ST}}])),s.push([{transforms:[CI],enter:{literalAutolink:CA,literalAutolinkEmail:CT,literalAutolinkHttp:CT,literalAutolinkWww:CT},exit:{literalAutolink:CD,literalAutolinkEmail:CN,literalAutolinkHttp:CO,literalAutolinkWww:CE}},{enter:{gfmFootnoteCallString:Cz,gfmFootnoteCall:CP,gfmFootnoteDefinitionLabelString:CB,gfmFootnoteDefinition:CF},exit:{gfmFootnoteCallString:CH,gfmFootnoteCall:Cq,gfmFootnoteDefinitionLabelString:Cj,gfmFootnoteDefinition:CV}},{canContainEols:["delete"],enter:{strikethrough:CK},exit:{strikethrough:CJ}},{enter:{table:CQ,tableData:C5,tableHeader:C5,tableRow:C1},exit:{codeText:C2,table:C0,tableData:C4,tableHeader:C4,tableRow:C4}},{exit:{taskListCheckValueChecked:C7,taskListCheckValueUnchecked:C7,paragraph:C6}}]),a.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:CS,notInConstruct:CM},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:CS,notInConstruct:CM},{character:":",before:"[ps]",after:"\\/",inConstruct:CS,notInConstruct:CM}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let o=n.createTracker(i),l=o.move("[^"),s=n.enter("footnoteDefinition"),a=n.enter("label");return l+=o.move(n.safe(n.associationId(e),{before:l,after:"]"})),a(),l+=o.move("]:"),e.children&&e.children.length>0&&(o.shift(4),l+=o.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,o.current()),r?CU:CW))),s(),l},footnoteReference:C$},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:CG}],handlers:{delete:CZ}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=of.inlineCode(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return s(function(e,t,n){let r=e.children,i=-1,o=[],l=t.enter("table");for(;++i<r.length;)o[i]=a(r[i],t,n);return l(),o}(e,n,r),e.align)},tableCell:l,tableRow:function(e,t,n,r){let i=s([a(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function l(e,t,n,r){let i=n.enter("tableCell"),l=n.enter("phrasing"),s=n.containerPhrasing(e,{...r,before:o,after:o});return l(),i(),s}function s(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||CY,o=[],l=[],s=[],a=[],c=0,u=-1;for(;++u<e.length;){let t=[],r=[],o=-1;for(e[u].length>c&&(c=e[u].length);++o<e[u].length;){var h;let l=null==(h=e[u][o])?"":String(h);if(!1!==n.alignDelimiters){let e=i(l);r[o]=e,(void 0===a[o]||e>a[o])&&(a[o]=e)}t.push(l)}l[u]=t,s[u]=r}let d=-1;if("object"==typeof r&&"length"in r)for(;++d<c;)o[d]=CX(r[d]);else{let e=CX(r);for(;++d<c;)o[d]=e}d=-1;let p=[],f=[];for(;++d<c;){let e=o[d],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,a[d]-t.length-r.length),l=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>a[d]&&(a[d]=i),f[d]=i),p[d]=l}l.splice(1,0,p),s.splice(1,0,f),u=-1;let m=[];for(;++u<l.length;){let e=l[u],t=s[u];d=-1;let r=[];for(;++d<c;){let i=e[d]||"",l="",s="";if(!1!==n.alignDelimiters){let e=a[d]-(t[d]||0),n=o[d];114===n?l=" ".repeat(e):99===n?e%2?(l=" ".repeat(e/2+.5),s=" ".repeat(e/2-.5)):s=l=" ".repeat(e/2):s=" ".repeat(e)}!1===n.delimiterStart||d||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||d)&&r.push(" "),!1!==n.alignDelimiters&&r.push(l),r.push(i),!1!==n.alignDelimiters&&r.push(s),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||d!==c-1)&&r.push("|")}m.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return m.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function a(e,t,n){let r=e.children,i=-1,o=[],s=t.enter("tableRow");for(;++i<r.length;)o[i]=l(r[i],e,t,n);return s(),o}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:C8}}]})}function SD(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e}var SI=dO("strike_through");SD(SI,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var SL=dM("strike_through",e=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:t=>["del",e.get(SI.key)(t)],parseMarkdown:{match:e=>"delete"===e.type,runner:(e,t,n)=>{e.openMark(n),e.next(t.children),e.closeMark(n)}},toMarkdown:{match:e=>"strike_through"===e.type.name,runner:(e,t)=>{e.withMark(t,"delete")}}}));SD(SL.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"}),SD(SL.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var S_=dv("ToggleStrikeThrough",e=>()=>s0(SL.type(e)));SD(S_,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var SR=dy(e=>aC(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)/,SL.type(e)));SD(SR,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var Sz=dA("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{let t=e.get(hH);return()=>t.call(S_.key)}}});SD(Sz.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"}),SD(Sz.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var SP=function(e){let t=e.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:kS}};for(let e in t)n[e]={default:t[e].default,validate:t[e].validate};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.tableGroup,parseDOM:[{tag:"table"}],toDOM:()=>["table",["tbody",0]]},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:()=>["tr",0]},table_cell:{content:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:e=>kk(e,t)}],toDOM:e=>["td",kC(e,t),0]},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:e=>kk(e,t)}],toDOM:e=>["th",kC(e,t),0]}}}({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),SB=dS("table",()=>({...SP.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:e=>"table"===e.type,runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,t)=>({...e,align:r,isHeader:0===t}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>"table"===e.type.name,runner:(e,t)=>{let n=t.content.firstChild?.content;if(!n)return;let r=[];n.forEach(e=>{r.push(e.attrs.alignment)}),e.openNode("table",void 0,{align:r}),e.next(t.content),e.closeNode()}}}));SD(SB.node,{displayName:"NodeSchema<table>",group:"Table"}),SD(SB.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var SF=dS("table_header_row",()=>({...SP.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:e=>e instanceof HTMLElement&&!!e.querySelector("th")&&{}}],toDOM:()=>["tr",{"data-is-header":!0},0],parseMarkdown:{match:e=>!!("tableRow"===e.type&&e.isHeader),runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,n)=>({...e,align:r[n],isHeader:t.isHeader}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>"table_header_row"===e.type.name,runner:(e,t)=>{0!==t.content.size&&(e.openNode("tableRow",void 0,{isHeader:!0}),e.next(t.content),e.closeNode())}}}));SD(SF.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"}),SD(SF.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var SH=dS("table_row",()=>({...SP.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:e=>"tableRow"===e.type,runner:(e,t,n)=>{let r=t.align,i=t.children.map((e,t)=>({...e,align:r[t]}));e.openNode(n),e.next(i),e.closeNode()}},toMarkdown:{match:e=>"table_row"===e.type.name,runner:(e,t)=>{0!==t.content.size&&(e.openNode("tableRow"),e.next(t.content),e.closeNode())}}}));SD(SH.node,{displayName:"NodeSchema<tableRow>",group:"Table"}),SD(SH.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var Sq=dS("table_cell",()=>({...SP.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>"table_cell"===e.type.name,runner:(e,t)=>{e.openNode("tableCell").next(t.content).closeNode()}}}));SD(Sq.node,{displayName:"NodeSchema<tableCell>",group:"Table"}),SD(Sq.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var Sj=dS("table_header",()=>({...SP.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!!e.isHeader,runner:(e,t,n)=>{let r=t.align;e.openNode(n,{alignment:r}),e.openNode(e.schema.nodes.paragraph),e.next(t.children),e.closeNode(),e.closeNode()}},toMarkdown:{match:e=>"table_header"===e.type.name,runner:(e,t)=>{e.openNode("tableCell"),e.next(t.content),e.closeNode()}}}));function SV(e,t=3,n=3){let r=Array(n).fill(0).map(()=>Sq.type(e).createAndFill()),i=Array(n).fill(0).map(()=>Sj.type(e).createAndFill()),o=Array(t).fill(0).map((t,n)=>0===n?SF.type(e).create(null,i):SH.type(e).create(null,r));return SB.type(e).create(null,o)}function S$(e){return(t,n)=>r=>{n=n??r.selection.from;let i=r.doc.resolve(n),o=aR(e=>"table"===e.type.name)(i),l=o?{node:o.node,from:o.start}:void 0,s="row"===e;if(l){let e=kx.get(l.node);if(t>=0&&t<(s?e.height:e.width)){let n=e.positionAt(s?t:e.height-1,s?e.width-1:t,l.node),i=r.doc.resolve(l.from+n),o=s?k_.rowSelection:k_.colSelection,a=e.positionAt(s?t:0,s?0:t,l.node),c=r.doc.resolve(l.from+a);return aL(r.setSelection(o(i,c)))}}return r}}SD(Sj.node,{displayName:"NodeSchema<tableHeader>",group:"Table"}),SD(Sj.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});var SW=S$("row"),SU=S$("col");function SG(e,t,{map:n,tableStart:r,table:i},o){let l=Array(o).fill(0).reduce((e,t,n)=>e+i.child(n).nodeSize,r),s=Array(n.width).fill(0).map((t,r)=>{let o=i.nodeAt(n.map[r]);return Sq.type(e).createAndFill({alignment:o?.attrs.alignment})});return t.insert(l,SH.type(e).create(null,s)),t}var SK=dv("GoToPrevTableCell",()=>()=>kQ(-1));SD(SK,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var SJ=dv("GoToNextTableCell",()=>()=>kQ(1));SD(SJ,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var SZ=dv("ExitTable",e=>()=>(t,n)=>{var r;if(!kO(t))return!1;let{$head:i}=t.selection,o=(r=SB.type(e),a_(e=>e.type===r)(i));if(!o)return!1;let{to:l}=o,s=t.tr.replaceWith(l,l,wF.type(e).createAndFill());return s.setSelection(sg.near(s.doc.resolve(l),1)).scrollIntoView(),n?.(s),!0});SD(SZ,{displayName:"Command<breakTableCommand>",group:"Table"});var SY=dv("InsertTable",e=>({row:t,col:n}={})=>(r,i)=>{let{selection:o,tr:l}=r,{from:s}=o,a=SV(e,t,n),c=l.replaceSelectionWith(a),u=sg.findFrom(c.doc.resolve(s),1,!0);return u&&c.setSelection(u),i?.(c),!0});SD(SY,{displayName:"Command<insertTableCommand>",group:"Table"});var SX=dv("MoveRow",()=>({from:e,to:t,pos:n}={})=>{var r;return r={from:e??0,to:t??0,pos:n},(e,t)=>{let{from:n,to:i,select:o=!0,pos:l=e.selection.from}=r,s=e.tr;return!!function(e){var t,n,r,i,o;let l,{tr:s,originIndex:a,targetIndex:c,select:u,pos:h}=e,d=kq(s.doc.resolve(h));if(!d)return!1;let p=null==(t=kW(s,a))?void 0:t.indexes,f=null==(n=kW(s,c))?void 0:n.indexes;if(!p||!f||p.includes(c))return!1;let m=(r=d.node,i=p,o=f,l=kB(r),kF(r,l=kH(l,i,o,0)));if(s.replaceWith(d.pos,d.pos+d.node.nodeSize,m),!u)return!0;let g=kx.get(m),y=d.start,b=g.positionAt(c,g.width-1,m),w=s.doc.resolve(y+b),x=g.positionAt(c,0,m),k=s.doc.resolve(y+x);return s.setSelection(k_.rowSelection(w,k)),!0}({tr:s,originIndex:n,targetIndex:i,select:o,pos:l})&&(null==t||t(s),!0)}});SD(SX,{displayName:"Command<moveRowCommand>",group:"Table"});var SQ=dv("MoveCol",()=>({from:e,to:t,pos:n}={})=>{var r;return r={from:e??0,to:t??0,pos:n},(e,t)=>{let{from:n,to:i,select:o=!0,pos:l=e.selection.from}=r,s=e.tr;return!!function(e){var t,n,r,i,o;let l,{tr:s,originIndex:a,targetIndex:c,select:u,pos:h}=e,d=kq(s.doc.resolve(h));if(!d)return!1;let p=null==(t=k$(s,a))?void 0:t.indexes,f=null==(n=k$(s,c))?void 0:n.indexes;if(!p||!f||p.includes(c))return!1;let m=(r=d.node,i=p,o=f,l=kU(kB(r)),kF(r,l=kU(l=kH(l,i,o,0))));if(s.replaceWith(d.pos,d.pos+d.node.nodeSize,m),!u)return!0;let g=kx.get(m),y=d.start,b=g.positionAt(g.height-1,c,m),w=s.doc.resolve(y+b),x=g.positionAt(0,c,m),k=s.doc.resolve(y+x);return s.setSelection(k_.colSelection(w,k)),!0}({tr:s,originIndex:n,targetIndex:i,select:o,pos:l})&&(null==t||t(s),!0)}});SD(SQ,{displayName:"Command<moveColCommand>",group:"Table"});var S0=dv("SelectRow",()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(SW(e.index,e.pos)(r))});SD(S0,{displayName:"Command<selectRowCommand>",group:"Table"});var S1=dv("SelectCol",()=>(e={index:0})=>(t,n)=>{let{tr:r}=t;return!!n?.(SU(e.index,e.pos)(r))});SD(S1,{displayName:"Command<selectColCommand>",group:"Table"});var S4=dv("SelectTable",()=>()=>(e,t)=>{let{tr:n}=e;return!!t?.(function(e){let t=function(e){let t=kq(e.$from);if(!t)return;let n=kx.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(e=>{let n=t.node.nodeAt(e),r=e+t.start;return{pos:r,start:r+1,node:n}})}(e.selection);if(t&&t[0]){let n=e.doc.resolve(t[0].pos),r=t[t.length-1];if(r){let t=e.doc.resolve(r.pos);return aL(e.setSelection(new k_(t,n)))}}return e}(n))});SD(S4,{displayName:"Command<selectTableCommand>",group:"Table"});var S5=dv("DeleteSelectedCells",()=>()=>(e,t)=>{let{selection:n}=e;if(!(n instanceof k_))return!1;let r=n.isRowSelection(),i=n.isColSelection();if(r&&i){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}if(i){if(!kO(e))return!1;if(t){let n=kG(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;!function(e,{map:t,table:n,tableStart:r},i){let o=e.mapping.maps.length;for(let l=0;l<t.height;){let s=l*t.width+i,a=t.map[s],c=n.nodeAt(a),u=c.attrs;if(i>0&&t.map[s-1]==a||i<t.width-1&&t.map[s+1]==a)e.setNodeMarkup(e.mapping.slice(o).map(r+a),null,kL(u,i-t.colCount(a)));else{let t=e.mapping.slice(o).map(r+a);e.delete(t,t+c.nodeSize)}l+=u.rowspan}}(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=kx.get(e)}t(r)}return!0}if(!kO(e))return!1;if(t){let n=kG(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;!function(e,{map:t,table:n,tableStart:r},i){let o=0;for(let e=0;e<i;e++)o+=n.child(e).nodeSize;let l=o+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(o+r,l+r);let a=new Set;for(let o=0,l=i*t.width;o<t.width;o++,l++){let c=t.map[l];if(!a.has(c)){if(a.add(c),i>0&&c==t.map[l-t.width]){let t=n.nodeAt(c).attrs;e.setNodeMarkup(e.mapping.slice(s).map(c+r),null,{...t,rowspan:t.rowspan-1}),o+=t.colspan-1}else if(i<t.height&&c==t.map[l+t.width]){let l=n.nodeAt(c),a=l.attrs,u=l.type.create({...a,rowspan:l.attrs.rowspan-1},l.content),h=t.positionAt(i+1,o,n);e.insert(e.mapping.slice(s).map(r+h),u),o+=a.colspan-1}}}}(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError("No table found");n.table=e,n.map=kx.get(n.table)}t(r)}return!0});SD(S5,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var S2=dv("AddColBefore",()=>()=>kJ);SD(S2,{displayName:"Command<addColBeforeCommand>",group:"Table"});var S3=dv("AddColAfter",()=>()=>kZ);SD(S3,{displayName:"Command<addColAfterCommand>",group:"Table"});var S7=dv("AddRowBefore",e=>()=>(t,n)=>{if(!kO(t))return!1;if(n){let r=kG(t);n(SG(e,t.tr,r,r.top))}return!0});SD(S7,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var S6=dv("AddRowAfter",e=>()=>(t,n)=>{if(!kO(t))return!1;if(n){let r=kG(t);n(SG(e,t.tr,r,r.bottom))}return!0});SD(S6,{displayName:"Command<addRowAfterCommand>",group:"Table"});var S8=dv("SetAlign",()=>(e="left")=>{var t;return t="alignment",function(n,r){if(!kO(n))return!1;let i=kE(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){let o=n.tr;n.selection instanceof k_?n.selection.forEachCell((n,r)=>{n.attrs[t]!==e&&o.setNodeMarkup(r,null,{...n.attrs,[t]:e})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[t]:e}),r(o)}return!0}});SD(S8,{displayName:"Command<setAlignCommand>",group:"Table"});var S9=dy(e=>new s6(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,r,i)=>{let o=t.doc.resolve(r);if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),SB.type(e)))return null;let l=SV(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(r,i,l);return s.setSelection(sw.create(s.doc,r+3)).scrollIntoView()}));SD(S9,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var Me=(L=e=>({run:(t,n,r)=>{if(r)return t;function i(t){let n=t.childCount,r=t.lastChild?.childCount??0;if(0===n||0===r)return wF.type(e).create();let i=t.firstChild;if(!(r>0&&i&&0===i.childCount))return t;if(n>=3){let r=t.child(1),o=[];for(let t=0;t<r.childCount;t++){let n=r.child(t);o.push(Sj.type(e).create(n.attrs,n.content,n.marks))}let l=i.type.create(i.attrs,o),s=[];for(let e=2;e<n;e++)s.push(t.child(e));return t.type.create(t.attrs,[l,...s])}let o=Array(r).fill(0).map(()=>Sj.type(e).createAndFill()),l=new lt(o3.from(o),0,0),s=i.replace(0,0,l);return t.replace(0,i.nodeSize,new lt(o3.from(s),0,0))}let o=function t(n){let r=function(t){let n=SH.type(e),r=[],o=[],l=!1;function s(){if(0===o.length)return;let t=SF.type(e).createAndFill(),n=SB.type(e).create(null,[t,...o]);r.push(i(n)),o=[]}return t.forEach(e=>{e.type===n?(l=!0,o.push(e)):(s(),r.push(e))}),s(),l?o3.from(r):t}(n),o=r!==n,l=[];return r.forEach(n=>{if(n.type===SB.type(e)){let e=i(n);e!==n&&(o=!0),l.push(e)}else if(n.childCount>0){let e=t(n.content);e!==n.content?(o=!0,l.push(n.copy(e))):l.push(n)}else l.push(n)}),o?o3.from(l):n}(t.content);return o=function(t){let n=[],r=[];t.forEach(e=>r.push(e));for(let t=0;t<r.length;t++){let i=r[t],o=r[t+1];i.type===wF.type(e)&&0===i.content.size&&o&&o.type===SB.type(e)||n.push(i)}return n.length<r.length?o3.from(n):t}(o),new lt(o3.from(o),t.openStart,t.openEnd)}}),b=e=>async()=>{await e.wait(hI);let t=L(e);return e.update(dt,e=>[...e,t]),b.pasteRule=t,()=>{e.update(dt,e=>e.filter(e=>e!==t))}});SD(Me,{displayName:"PasteRule<table>",group:"Table"});var Mt=dA("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:e=>{let t=e.get(hH);return()=>t.call(SJ.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{let t=e.get(hH);return()=>t.call(SK.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:e=>{let t=e.get(hH);return()=>t.call(SZ.key)}}});SD(Mt.ctx,{displayName:"KeymapCtx<table>",group:"Table"}),SD(Mt.shortcuts,{displayName:"Keymap<table>",group:"Table"});var Mn="footnote_definition",Mr="footnoteDefinition",Mi=dS("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${Mn}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{let t=e.attrs.label;return["dl",{"data-label":t,"data-type":Mn},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===Mr,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===Mn,runner:(e,t)=>{e.openNode(Mr,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));SD(Mi.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"}),SD(Mi.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var Mo="footnote_reference",Ml=dS("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${Mo}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{label:e.dataset.label}}}],toDOM:e=>{let t=e.attrs.label;return["sup",{"data-label":t,"data-type":Mo},t]},parseMarkdown:{match:({type:e})=>"footnoteReference"===e,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===Mo,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));SD(Ml.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"}),SD(Ml.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var Ms=xb.extendSchema(e=>t=>{let n=e(t);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:e=>{if(!(e instanceof HTMLElement))throw rl(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:e.dataset.spread,checked:e.dataset.checked?"true"===e.dataset.checked:null}}},...n?.parseDOM||[]],toDOM:e=>n.toDOM&&null==e.attrs.checked?n.toDOM(e):["li",{"data-item-type":"task","data-label":e.attrs.label,"data-list-type":e.attrs.listType,"data-spread":e.attrs.spread,"data-checked":e.attrs.checked},0],parseMarkdown:{match:({type:e})=>"listItem"===e,runner:(e,t,r)=>{if(null==t.checked)return void n.parseMarkdown.runner(e,t,r);let i=null!=t.label?`${t.label}.`:"•",o=null!=t.checked?!!t.checked:null,l=null!=t.label?"ordered":"bullet",s=null!=t.spread?`${t.spread}`:"true";e.openNode(r,{label:i,listType:l,spread:s,checked:o}),e.next(t.children),e.closeNode()}},toMarkdown:{match:e=>"list_item"===e.type.name,runner:(e,t)=>{if(null==t.attrs.checked)return void n.toMarkdown.runner(e,t);let r=t.attrs.label,i=t.attrs.listType,o="true"===t.attrs.spread,l=t.attrs.checked;e.openNode("listItem",void 0,{label:r,listType:i,spread:o,checked:l}),e.next(t.content),e.closeNode()}}}});SD(Ms.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"}),SD(Ms.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var Ma=dy(()=>new s6(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,r)=>{let i=e.doc.resolve(n),o=0,l=i.node(o);for(;l&&"list_item"!==l.type.name;)o--,l=i.node(o);if(!l||null!=l.attrs.checked)return null;let s=t.groups?.checked==="x",a=i.before(o),c=e.tr;return c.deleteRange(n,r).setNodeMarkup(a,void 0,{...l.attrs,checked:s}),c}));SD(Ma,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var Mc=[Sz,Mt].flat(),Mu=[S9,Ma],Mh=[SR],Md=[Me],Mp=dw(()=>Ck);SD(Mp,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"}),SD(dw(()=>(function({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Co,lastColumnResizable:i=!0}={}){let o=new s_({key:Cs,state:{init(e,t){var i;let l=null==(i=o.spec)||null==(i=i.props)?void 0:i.nodeViews,s=kM(t.schema).table.name;return r&&l&&(l[s]=(e,t)=>new r(e,n,t)),new Ca(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>{let t=Cs.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(t,n)=>{!function(e,t,n,r){if(!e.editable)return;let i=Cs.getState(e.state);if(i&&!i.dragging){let o=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),l=-1;if(o){let{left:r,right:i}=o.getBoundingClientRect();t.clientX-r<=n?l=Cc(e,t,"left",n):i-t.clientX<=n&&(l=Cc(e,t,"right",n))}if(l!=i.activeHandle){if(!r&&-1!==l){let t=e.state.doc.resolve(l),n=t.node(-1),r=kx.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Ch(e,l)}}}(t,n,e,i)},mouseleave:e=>{!function(e){if(!e.editable)return;let t=Cs.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Ch(e,-1)}(e)},mousedown:(e,r)=>{!function(e,t,n,r){var i;if(!e.editable)return;let o=null!=(i=e.dom.ownerDocument.defaultView)?i:window,l=Cs.getState(e.state);if(!l||-1==l.activeHandle||l.dragging)return;let s=e.state.doc.nodeAt(l.activeHandle),a=function(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=e.domAtPos(t),l=o.node.childNodes[o.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(l-=r[e],s--);return l/s}(e,l.activeHandle,s.attrs);function c(t){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",u);let r=Cs.getState(e.state);(null==r?void 0:r.dragging)&&(function(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),o=kx.get(i),l=r.start(-1),s=o.colCount(r.pos-l)+r.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let e=0;e<o.height;e++){let t=e*o.width+s;if(e&&o.map[t]==o.map[t-o.width])continue;let r=o.map[t],c=i.nodeAt(r).attrs,u=1==c.colspan?0:s-o.colCount(r);if(c.colwidth&&c.colwidth[u]==n)continue;let h=c.colwidth?c.colwidth.slice():Array(c.colspan).fill(0);h[u]=n,a.setNodeMarkup(l+r,null,{...c,colwidth:h})}a.docChanged&&e.dispatch(a)}(e,r.activeHandle,Cu(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Cs,{setDragging:null})))}function u(t){if(!t.which)return c(t);let i=Cs.getState(e.state);if(i&&i.dragging){let o=Cu(i.dragging,t,n);Cd(e,i.activeHandle,o,r)}}e.dispatch(e.state.tr.setMeta(Cs,{setDragging:{startX:t.clientX,startWidth:a}})),Cd(e,l.activeHandle,a,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",u),t.preventDefault()}(e,r,t,n)}},decorations:e=>{let t=Cs.getState(e);if(t&&t.activeHandle>-1)return function(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return uX.empty;let o=kx.get(i),l=r.start(-1),s=o.colCount(r.pos-l)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<o.height;t++){let r=s+t*o.width;if((s==o.width-1||o.map[r]!=o.map[r+1])&&(0==t||o.map[r]!=o.map[r-o.width])){var a;let t=o.map[r],s=l+t+i.nodeAt(t).nodeSize-1,c=document.createElement("div");c.className="column-resize-handle",(null==(a=Cs.getState(e))?void 0:a.dragging)&&n.push(uJ.node(l+t,l+t+i.nodeAt(t).nodeSize,{class:"column-resize-dragging"})),n.push(uJ.widget(s,c))}}return uX.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return o})({})),{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var Mf=dw(()=>(function({allowTableNodeSelection:e=!1}={}){return new s_({key:kA,state:{init:()=>null,apply(e,t){let n=e.getMeta(kA);if(null!=n)return -1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:kz,handleDOMEvents:{mousedown:Ct},createSelectionBetween:e=>null!=kA.getState(e.state)?e.state.selection:null,handleTripleClick:k9,handleKeyDown:k3,handlePaste:Ce},appendTransaction:(t,n,r)=>{let i,o;return function(e,t,n){let r,i,o=(t||e).selection,l=(t||e).doc;if(o instanceof sk&&(i=o.node.type.spec.tableRole)){if("cell"==i||"header_cell"==i)r=k_.create(l,o.from);else if("row"==i){let e=l.resolve(o.from+1);r=k_.rowSelection(e,e)}else if(!n){let e=kx.get(o.node),t=o.from+1,n=t+e.map[e.width*e.height-1];r=k_.create(l,t+1,n)}}else o instanceof sw&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}(o)?r=sw.create(l,o.from):o instanceof sw&&function({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===t.parentOffset}(o)&&(r=sw.create(l,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,(o=(e,t)=>{"table"==e.type.spec.tableRole&&(i=function(e,t,n,r){let i,o,l=kx.get(t);if(!l.problems)return r;r||(r=e.tr);let s=[];for(let e=0;e<l.height;e++)s.push(0);for(let e=0;e<l.problems.length;e++){let i=l.problems[e];if("collision"==i.type){let e=t.nodeAt(i.pos);if(!e)continue;let o=e.attrs;for(let e=0;e<o.rowspan;e++)s[i.row+e]+=i.n;r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,kL(o,o.colspan-i.n,i.n))}else if("missing"==i.type)s[i.row]+=i.n;else if("overlong_rowspan"==i.type){let e=t.nodeAt(i.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-i.n})}else if("colwidth mismatch"==i.type){let e=t.nodeAt(i.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,{...e.attrs,colwidth:i.colwidth})}else if("zero_sized"==i.type){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}for(let e=0;e<s.length;e++)s[e]&&(null==i&&(i=e),o=e);for(let a=0,c=n+1;a<l.height;a++){let n=t.child(a),l=c+n.nodeSize,u=s[a];if(u>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);let s=[];for(let n=0;n<u;n++){let n=kM(e.schema)[t].createAndFill();n&&s.push(n)}let h=(0==a||i==a-1)&&o==a?c+1:l-1;r.insert(r.mapping.map(h),s)}c=l}return r.setMeta(kP,{fixTables:!0})}(r,e,t,i))},n?n.doc!=r.doc&&function e(t,n,r,i){let o=t.childCount,l=n.childCount;n:for(let s=0,a=0;s<l;s++){let l=n.child(s);for(let e=a,n=Math.min(o,s+3);e<n;e++)if(t.child(e)==l){a=e+1,r+=l.nodeSize;continue n}i(l,r),a<o&&t.child(a).sameMarkup(l)?e(t.child(a),l,r+1,i):l.nodesBetween(0,l.content.size,i,r+1),r+=l.nodeSize}}(n.doc,r.doc,0,o):r.doc.descendants(o),i),e)}})})({allowTableNodeSelection:!0}));SD(Mf,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var Mm=dE("remarkGFM",()=>SN);SD(Mm.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"}),SD(Mm.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var Mg=new sP("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN"),Mv=dw(()=>new s_({key:Mg,appendTransaction:(e,t,n)=>{let r;return t.doc!==n.doc&&n.doc.descendants((e,t)=>{let i;if(r||(r=n.tr),"table_cell"!==e.type.name)return;let o=n.doc.resolve(t),l=o.node(o.depth),s=o.node(o.depth-1).firstChild;if(!s)return;let a=(i=0,l.forEach((t,n,r)=>{t===e&&(i=r)}),i),c=s.maybeChild(a);if(!c)return;let u=c.attrs.alignment;u!==e.attrs.alignment&&r.setNodeMarkup(t,void 0,{...e.attrs,alignment:u})}),r}}));SD(Mv,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var My=[Mv,Mp,Mm,Mf].flat(),Mb=[[Ms,SB,SF,SH,Sj,Sq,Mi,Ml,SI,SL].flat(),Mu,Md,Mh,Mc,[SJ,SK,SZ,SY,SX,SQ,S0,S1,S4,S5,S7,S6,S2,S3,S8,S_],My].flat(),Mw=e.i(56421),Mx=e.i(50990);function Mk(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}let MC=Mk(function(e,t,n=t.selection.ranges){let r=[],i=-1;r:for(let{from:e,to:o}of n){let n=r.length,l=1e9,s;for(let n=e;n<=o;){let a=t.doc.lineAt(n);if(void 0==s&&!(s=MA(t,a.from).line))continue r;if(a.from>i&&(e==o||o>a.from)){i=a.from;let e=/^\s*/.exec(a.text)[0].length,t=e==a.length,n=a.text.slice(e,e+s.length)==s?e:-1;e<a.text.length&&e<l&&(l=e),r.push({line:a,comment:n,token:s,indent:e,empty:t,single:!1})}n=a.to+1}if(l<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=l);r.length==n+1&&(r[n].single=!0)}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:o,single:l}of r)(l||!o)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,o=r+i.length;" "==t.text[o-t.from]&&o++,e.push({from:r,to:o})}return{changes:e}}return null},0),MS=Mk(MT,0),MM=Mk((e,t)=>MT(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let o=t.length-1;o>=0&&t[o].to>r.from?t[o].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}(t)),0);function MA(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}function MT(e,t,n=t.selection.ranges){let r=n.map(e=>MA(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},r,i){let o,l,s=e.sliceDoc(r-50,r),a=e.sliceDoc(i,i+50),c=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(a)[0].length,h=s.length-c;if(s.slice(h-t.length,h)==t&&a.slice(u,u+n.length)==n)return{open:{pos:r-c,margin:c&&1},close:{pos:i+u,margin:u&&1}};i-r<=100?o=l=e.sliceDoc(r,i):(o=e.sliceDoc(r,r+50),l=e.sliceDoc(i-50,i));let d=/^\s*/.exec(o)[0].length,p=/\s*$/.exec(l)[0].length,f=l.length-p-n.length;return o.slice(d,d+t.length)==t&&l.slice(f,f+n.length)==n?{open:{pos:r+d+t.length,margin:+!!/\s/.test(o.charAt(d+t.length))},close:{pos:i-p-n.length,margin:+!!/\s/.test(l.charAt(f-1))}}:null})(t,r[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:o,close:l}=n;e.push({from:o.pos-i.open.length,to:o.pos+o.margin},{from:l.pos-l.margin,to:l.pos+i.close.length})}return{changes:e}}return null}let MO=Mw.Annotation.define(),ME=Mw.Annotation.define(),MN=Mw.Facet.define(),MD=Mw.Facet.define({combine:e=>(0,Mw.combineConfig)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),MI=Mw.StateField.define({create:()=>MW.empty,update(e,t){let n=t.state.facet(MD),r=t.annotation(MO);if(r){let i=MB.fromTransaction(t,r.selection),o=r.side,l=0==o?e.undone:e.done;return l=i?MF(l,l.length,n.minDepth,i):Mj(l,t.startState.selection),new MW(0==o?r.rest:l,0==o?l:r.rest)}let i=t.annotation(ME);if(("full"==i||"before"==i)&&(e=e.isolate()),!1===t.annotation(Mw.Transaction.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let o=MB.fromTransaction(t),l=t.annotation(Mw.Transaction.time),s=t.annotation(Mw.Transaction.userEvent);return o?e=e.addChanges(o,l,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,s,n.newGroupDelay)),("full"==i||"after"==i)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new MW(e.done.map(MB.fromJSON),e.undone.map(MB.fromJSON))});function ML(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(MI,!1);if(!i)return!1;let o=i.pop(e,n,t);return!!o&&(r(o),!0)}}let M_=ML(0,!1),MR=ML(1,!1),Mz=ML(0,!0),MP=ML(1,!0);class MB{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new MB(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null==(e=this.changes)?void 0:e.toJSON(),mapped:null==(t=this.mapped)?void 0:t.toJSON(),startSelection:null==(n=this.startSelection)?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new MB(e.changes&&Mw.ChangeSet.fromJSON(e.changes),[],e.mapped&&Mw.ChangeDesc.fromJSON(e.mapped),e.startSelection&&Mw.EditorSelection.fromJSON(e.startSelection),e.selectionsAfter.map(Mw.EditorSelection.fromJSON))}static fromTransaction(e,t){let n=Mq;for(let t of e.startState.facet(MN)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new MB(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Mq)}static selection(e){return new MB(void 0,Mq,void 0,void 0,e)}}function MF(e,t,n,r){let i=e.slice(t+1>n+20?t-n-1:0,t);return i.push(r),i}function MH(e,t){return e.length?t.length?e.concat(t):e:t}let Mq=[];function Mj(e,t){if(!e.length)return[MB.selection([t])];{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),MF(e,e.length-1,1e9,n.setSelAfter(r)))}}function MV(e,t){if(!e.length)return e;let n=e.length,r=Mq;for(;n;){let i=function(e,t,n){let r=MH(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):Mq,n);if(!e.changes)return MB.selection(r);let i=e.changes.map(t),o=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(o):o;return new MB(i,Mw.StateEffect.mapEffects(e.effects,t),l,e.startSelection.map(o),r)}(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[MB.selection(r)]:Mq}let M$=/^(input\.type|delete)($|\.)/;class MW{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new MW(this.done,this.undone):this}addChanges(e,t,n,r,i){var o,l;let s,a,c=this.done,u=c[c.length-1];return new MW(c=u&&u.changes&&!u.changes.empty&&e.changes&&(!n||M$.test(n))&&(!u.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,(o=u.changes,l=e.changes,s=[],a=!1,o.iterChangedRanges((e,t)=>s.push(e,t)),l.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<s.length;){let t=s[e++],i=s[e++];r>=t&&n<=i&&(a=!0)}}),a))||"input.type.compose"==n)?MF(c,c.length-1,r.minDepth,new MB(e.changes.compose(u.changes),MH(Mw.StateEffect.mapEffects(e.effects,u.changes),u.effects),u.mapped,u.startSelection,Mq)):MF(c,c.length,r.minDepth,e),Mq,t,n)}addSelection(e,t,n,r){var i;let o=this.done.length?this.done[this.done.length-1].selectionsAfter:Mq;return o.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=o[o.length-1],i.ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length)?this:new MW(Mj(this.done,e),this.undone,t,n)}addMapping(e){return new MW(MV(this.done,e),MV(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1],o=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):t.selection);if(n&&i.selectionsAfter.length){let n,l;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:MO.of({side:e,rest:(n=r[r.length-1],(l=r.slice())[r.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),l),selection:o}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}{if(!i.changes)return null;let n=1==r.length?Mq:r.slice(0,r.length-1);return i.mapped&&(n=MV(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:MO.of({side:e,rest:n,selection:o}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}MW.empty=new MW(Mq,Mq);function MU(e,t){return Mw.EditorSelection.create(e.ranges.map(t),e.mainIndex)}function MG(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function MK({state:e,dispatch:t},n){let r=MU(e.selection,n);return!r.eq(e.selection,!0)&&(t(MG(e,r)),!0)}function MJ(e,t){return Mw.EditorSelection.cursor(t?e.to:e.from)}function MZ(e,t){return MK(e,n=>n.empty?e.moveByChar(n,t):MJ(n,t))}function MY(e){return e.textDirectionAt(e.state.selection.main.head)==nX.Direction.LTR}let MX=e=>MZ(e,!MY(e)),MQ=e=>MZ(e,MY(e));function M0(e,t){return MK(e,n=>n.empty?e.moveByGroup(n,t):MJ(n,t))}function M1(e,t,n){let r,i,o=(0,nK.syntaxTree)(e).resolveInner(t.head),l=n?Mx.NodeProp.closedBy:Mx.NodeProp.openedBy;for(let r=t.head;;){let t=n?o.childAfter(r):o.childBefore(r);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,l)?r=n?t.to:t.from:o=t}return i=o.type.prop(l)&&(r=n?(0,nK.matchBrackets)(e,o.from,1):(0,nK.matchBrackets)(e,o.to,-1))&&r.matched?n?r.end.to:r.end.from:n?o.to:o.from,Mw.EditorSelection.cursor(i,n?-1:1)}function M4(e,t){return MK(e,n=>{if(!n.empty)return MJ(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"u">typeof Intl&&Intl.Segmenter;let M5=e=>M4(e,!1),M2=e=>M4(e,!0);function M3(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(nX.EditorView.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function M7(e,t){let n,r=M3(e),{state:i}=e,o=MU(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):MJ(n,t));if(o.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),s=l.top+r.marginTop,a=l.bottom-r.marginBottom;t&&t.top>s&&t.bottom<a&&(n=nX.EditorView.scrollIntoView(o.main.head,{y:"start",yMargin:t.top-s}))}return e.dispatch(MG(i,o),{effects:n}),!0}let M6=e=>M7(e,!1),M8=e=>M7(e,!0);function M9(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Mw.EditorSelection.cursor(r.from+n))}return i}function Ae(e,t){let n=MU(e.state.selection,e=>{let n=t(e);return Mw.EditorSelection.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0,n.assoc)});return!n.eq(e.state.selection)&&(e.dispatch(MG(e.state,n)),!0)}function At(e,t){return Ae(e,n=>e.moveByChar(n,t))}let An=e=>At(e,!MY(e)),Ar=e=>At(e,MY(e));function Ai(e,t){return Ae(e,n=>e.moveByGroup(n,t))}function Ao(e,t){return Ae(e,n=>e.moveVertically(n,t))}let Al=e=>Ao(e,!1),As=e=>Ao(e,!0);function Aa(e,t){return Ae(e,n=>e.moveVertically(n,t,M3(e).height))}let Ac=e=>Aa(e,!1),Au=e=>Aa(e,!0),Ah=({state:e,dispatch:t})=>(t(MG(e,{anchor:0})),!0),Ad=({state:e,dispatch:t})=>(t(MG(e,{anchor:e.doc.length})),!0),Ap=({state:e,dispatch:t})=>(t(MG(e,{anchor:e.selection.main.anchor,head:0})),!0),Af=({state:e,dispatch:t})=>(t(MG(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function Am(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let o=n.doc.lineAt(r.head);if(t?o.to<e.state.doc.length:o.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<o.from||r.head>o.to){i.some(e=>e.head==r.head)||i.push(r);break}if(r.head==n.head)break;n=r}}return i.length!=r.ranges.length&&(e.dispatch(MG(n,Mw.EditorSelection.create(i,i.length-1))),!0)}function Ag(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:o}=r;if(i==o){let l=t(r);l<i?(n="delete.backward",l=Av(e,l,!1)):l>i&&(n="delete.forward",l=Av(e,l,!0)),i=Math.min(i,l),o=Math.max(o,l)}else i=Av(e,i,!1),o=Av(e,o,!0);return i==o?{range:r}:{changes:{from:i,to:o},range:Mw.EditorSelection.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?nX.EditorView.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Av(e,t,n){if(e instanceof nX.EditorView)for(let r of e.state.facet(nX.EditorView.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let Ay=(e,t,n)=>Ag(e,r=>{let i=r.from,{state:o}=e,l=o.doc.lineAt(i),s,a;if(n&&!t&&i>l.from&&i<l.from+200&&!/[^ \t]/.test(s=l.text.slice(0,i-l.from))){if(" "==s[s.length-1])return i-1;let e=(0,Mw.countColumn)(s,o.tabSize)%(0,nK.getIndentUnit)(o)||(0,nK.getIndentUnit)(o);for(let t=0;t<e&&" "==s[s.length-1-t];t++)i--;a=i}else(a=(0,Mw.findClusterBreak)(l.text,i-l.from,t,t)+l.from)==i&&l.number!=(t?o.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(l.text.slice(a-l.from,i-l.from))&&(a=(0,Mw.findClusterBreak)(l.text,a-l.from,!1,!1)+l.from);return a}),Ab=e=>Ay(e,!1,!0),Aw=e=>Ay(e,!0,!1),Ax=(e,t)=>Ag(e,n=>{let r=n.head,{state:i}=e,o=i.doc.lineAt(r),l=i.charCategorizer(r);for(let e=null;;){if(r==(t?o.to:o.from)){r==n.head&&o.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=(0,Mw.findClusterBreak)(o.text,r-o.from,t)+o.from,a=o.text.slice(Math.min(r,s)-o.from,Math.max(r,s)-o.from),c=l(a);if(null!=e&&c!=e)break;(" "!=a||r!=n.head)&&(e=c),r=s}return r}),Ak=e=>Ax(e,!1);function AC(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),o=e.doc.lineAt(r.to);if(r.empty||r.to!=o.from||(o=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=o.to,e.ranges.push(r)}else t.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return t}function AS(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of AC(e)){if(n?t.to==e.doc.length:0==t.from)continue;let o=e.doc.lineAt(n?t.to+1:t.from-1),l=o.length+1;if(n)for(let n of(r.push({from:t.to,to:o.to},{from:t.from,insert:o.text+e.lineBreak}),t.ranges))i.push(Mw.EditorSelection.range(Math.min(e.doc.length,n.anchor+l),Math.min(e.doc.length,n.head+l)));else for(let n of(r.push({from:o.from,to:t.from},{from:t.to,insert:e.lineBreak+o.text}),t.ranges))i.push(Mw.EditorSelection.range(n.anchor-l,n.head-l))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:Mw.EditorSelection.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}function AM(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of AC(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});let i=e.changes(r);return t(e.update({changes:i,selection:e.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}let AA=AO(!1),AT=AO(!0);function AO(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,o=t.doc.lineAt(r),l=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,nK.syntaxTree)(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),o;return r&&i&&r.to<=t&&i.from>=t&&(o=r.type.prop(Mx.NodeProp.closedBy))&&o.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,r);e&&(r=i=(i<=o.to?o:t.doc.lineAt(i)).to);let s=new nK.IndentContext(t,{simulateBreak:r,simulateDoubleBreak:!!l}),a=(0,nK.getIndentation)(s,r);for(null==a&&(a=(0,Mw.countColumn)(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));i<o.to&&/\s/.test(o.text[i-o.from]);)i++;l?{from:r,to:i}=l:r>o.from&&r<o.from+100&&!/\S/.test(o.text.slice(0,r))&&(r=o.from);let c=["",(0,nK.indentString)(t,a)];return l&&c.push((0,nK.indentString)(t,s.lineIndent(o.from,-1))),{changes:{from:r,to:i,insert:Mw.Text.of(c)},range:Mw.EditorSelection.cursor(r+1+c[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function AE(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let l=e.doc.lineAt(o);l.number>n&&(r.empty||r.to>l.from)&&(t(l,i,r),n=l.number),o=l.to+1}let o=e.changes(i);return{changes:i,range:Mw.EditorSelection.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}let AN=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(AE(e,(t,n)=>{n.push({from:t.from,insert:e.facet(nK.indentUnit)})}),{userEvent:"input.indent"})),!0),AD=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(AE(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=(0,Mw.countColumn)(r,e.tabSize),o=0,l=(0,nK.indentString)(e,Math.max(0,i-(0,nK.getIndentUnit)(e)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;n.push({from:t.from+o,to:t.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),AI=[{key:"Ctrl-b",run:MX,shift:An,preventDefault:!0},{key:"Ctrl-f",run:MQ,shift:Ar},{key:"Ctrl-p",run:M5,shift:Al},{key:"Ctrl-n",run:M2,shift:As},{key:"Ctrl-a",run:e=>MK(e,t=>Mw.EditorSelection.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>Ae(e,t=>Mw.EditorSelection.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>MK(e,t=>Mw.EditorSelection.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>Ae(e,t=>Mw.EditorSelection.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:Aw},{key:"Ctrl-h",run:Ab},{key:"Ctrl-k",run:e=>Ag(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:Ak},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:Mw.Text.of(["",""])},range:Mw.EditorSelection.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:(0,Mw.findClusterBreak)(r.text,n-r.from,!1)+r.from,o=n==r.to?n+1:(0,Mw.findClusterBreak)(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:o,insert:e.doc.slice(n,o).append(e.doc.slice(i,n))},range:Mw.EditorSelection.cursor(o)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:M8}],AL=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>MK(e,t=>M1(e.state,t,!MY(e))),shift:e=>Ae(e,t=>M1(e.state,t,!MY(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>MK(e,t=>M1(e.state,t,MY(e))),shift:e=>Ae(e,t=>M1(e.state,t,MY(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>AS(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>AM(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>AS(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>AM(e,t,!0)},{key:"Mod-Alt-ArrowUp",run:e=>Am(e,!1)},{key:"Mod-Alt-ArrowDown",run:e=>Am(e,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Mw.EditorSelection.create([n.main]):n.main.empty||(r=Mw.EditorSelection.create([Mw.EditorSelection.cursor(n.main.head)])),!!r&&(t(MG(e,r)),!0)}},{key:"Mod-Enter",run:AT},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=AC(e).map(({from:t,to:n})=>Mw.EditorSelection.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Mw.EditorSelection.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=MU(e.selection,t=>{let n=(0,nK.syntaxTree)(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Mw.EditorSelection.range(n.to,n.from)}return t});return!n.eq(e.selection)&&(t(MG(e,n)),!0)},preventDefault:!0},{key:"Mod-[",run:AD},{key:"Mod-]",run:AN},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new nK.IndentContext(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=AE(e,(t,i,o)=>{let l=(0,nK.getIndentation)(r,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let s=/^\s*/.exec(t.text)[0],a=(0,nK.indentString)(e,l);(s!=a||o.from<t.from+s.length)&&(n[t.from]=l,i.push({from:t.from,to:t.from+s.length,insert:a}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(AC(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=MU(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=MU(e.selection,t=>{let r=(0,nK.matchBrackets)(e,t.head,-1)||(0,nK.matchBrackets)(e,t.head,1)||t.head>0&&(0,nK.matchBrackets)(e,t.head-1,1)||t.head<e.doc.length&&(0,nK.matchBrackets)(e,t.head+1,-1);if(!r||!r.end)return t;n=!0;let i=r.start.from==t.head?r.end.to:r.end.from;return Mw.EditorSelection.cursor(i)}),!!n&&(t(MG(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=MA(e.state,n.from);return r.line?MC(e):!!r.block&&MM(e)}},{key:"Alt-A",run:MS},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat([{key:"ArrowLeft",run:MX,shift:An,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>M0(e,!MY(e)),shift:e=>Ai(e,!MY(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>MK(e,t=>M9(e,t,!MY(e))),shift:e=>Ae(e,t=>M9(e,t,!MY(e))),preventDefault:!0},{key:"ArrowRight",run:MQ,shift:Ar,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>M0(e,MY(e)),shift:e=>Ai(e,MY(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>MK(e,t=>M9(e,t,MY(e))),shift:e=>Ae(e,t=>M9(e,t,MY(e))),preventDefault:!0},{key:"ArrowUp",run:M5,shift:Al,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Ah,shift:Ap},{mac:"Ctrl-ArrowUp",run:M6,shift:Ac},{key:"ArrowDown",run:M2,shift:As,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ad,shift:Af},{mac:"Ctrl-ArrowDown",run:M8,shift:Au},{key:"PageUp",run:M6,shift:Ac},{key:"PageDown",run:M8,shift:Au},{key:"Home",run:e=>MK(e,t=>M9(e,t,!1)),shift:e=>Ae(e,t=>M9(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:Ah,shift:Ap},{key:"End",run:e=>MK(e,t=>M9(e,t,!0)),shift:e=>Ae(e,t=>M9(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:Ad,shift:Af},{key:"Enter",run:AA,shift:AA},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Ab,shift:Ab,preventDefault:!0},{key:"Delete",run:Aw,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Ak,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Ax(e,!0),preventDefault:!0},{mac:"Mod-Backspace",run:e=>Ag(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),preventDefault:!0},{mac:"Mod-Delete",run:e=>Ag(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),preventDefault:!0}].concat(AI.map(e=>({mac:e.key,run:e.run,shift:e.shift})))),A_={key:"Tab",run:AN,shift:AD};var AR=function(){};AR.prototype.append=function(e){return e.length?(e=AR.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},AR.prototype.prepend=function(e){return e.length?AR.from(e).append(this):this},AR.prototype.appendInner=function(e){return new AP(this,e)},AR.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?AR.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},AR.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},AR.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},AR.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},AR.from=function(e){return e instanceof AR?e:e&&e.length?new Az(e):AR.empty};var Az=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(AR);AR.empty=new Az([]);var AP=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(AR);class AB{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let l=this.items.length;for(;;l--)if(this.items.get(l-1).selection){--l;break}t&&(r=(n=this.remapping(l,this.items.length)).maps.length);let s=e.tr,a=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(l,t+1)).maps.length),r--,c.push(e);return}if(n){c.push(new AF(e.map));let t=e.step.map(n.slice(r)),i;t&&s.maybeStep(t).doc&&(i=s.mapping.maps[s.mapping.maps.length-1],a.push(new AF(i,void 0,void 0,a.length+c.length))),r--,i&&n.appendMap(i,r)}else s.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new AB(this.items.slice(0,l).append(c.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:s,selection:i}}addTransform(e,t,n,r){var i,o;let l,s=[],a=this.eventCount,c=this.items,u=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new AF(e.mapping.maps[n],i,t),l;(l=u&&u.merge(o))&&(o=l,n?s.pop():c=c.slice(0,c.length-1)),s.push(o),t&&(a++,t=void 0),r||(u=o)}let h=a-n.depth;return h>Aq&&(i=c,o=h,i.forEach((e,t)=>{if(e.selection&&0==o--)return l=t,!1}),c=i.slice(l),a-=h),new AB(c.append(s),a)}remapping(e,t){let n=new lG;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new AB(this.items.append(e.map(e=>new AF(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(e=>{e.selection&&l--},r);let s=t;this.items.forEach(t=>{let r=i.getMirror(--s);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(s+1,r));c&&l++,n.push(new AF(a,o,c))}else n.push(new AF(a))},r);let a=[];for(let e=t;e<o;e++)a.push(new AF(i.maps[e]));let c=new AB(this.items.slice(0,r).append(a).append(n),l);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),l=e&&e.getMap();if(n--,l&&t.appendMap(l,n),e){let s=o.selection&&o.selection.map(t.slice(n));s&&i++;let a=new AF(l.invert(),e,s),c,u=r.length-1;(c=r.length&&r[u].merge(a))?r[u]=c:r.push(a)}}else o.map&&n--},this.items.length,0),new AB(AR.from(r.reverse()),i)}}AB.empty=new AB(AR.empty,0);class AF{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new AF(t.getMap().invert(),t,this.selection)}}}class AH{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let Aq=20;function Aj(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function AV(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let A$=!1,AW=null;function AU(e){let t=e.plugins;if(AW!=t){A$=!1,AW=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){A$=!0;break}}return A$}let AG=new sP("history"),AK=new sP("closeHistory");function AJ(e,t){return(n,r)=>{let i=AG.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=AU(t),i=AG.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let l=o.selection.resolve(o.transform.doc),s=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),a=new AH(n?s:o.remaining,n?o.remaining:s,null,0,-1);return o.transform.setSelection(l).setMeta(AG,{redo:n,historyState:a})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let AZ=AJ(!1,!0),AY=AJ(!0,!0);AJ(!1,!1),AJ(!0,!1);var AX=Object.defineProperty,AQ=Object.getOwnPropertySymbols,A0=Object.prototype.hasOwnProperty,A1=Object.prototype.propertyIsEnumerable,A4=(e,t,n)=>t in e?AX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function A5(e,t){return Object.assign(e,{meta:((e,t)=>{for(var n in t||(t={}))A0.call(t,n)&&A4(e,n,t[n]);if(AQ)for(var n of AQ(t))A1.call(t,n)&&A4(e,n,t[n]);return e})({package:"@milkdown/components"},t)}),e}let A2=dC({extensions:[],languages:[],expandIcon:"⬇",searchIcon:"🔍",clearSearchIcon:"⌫",searchPlaceholder:"Search language",noResultText:"No result",copyText:"Copy",copyIcon:"📋",onCopy:()=>{},renderLanguage:e=>e,renderPreview:()=>null,previewToggleButton:e=>e?"Edit":"Hide",previewLabel:"Preview",previewLoading:"Loading..."},"codeBlockConfigCtx");A5(A2,{displayName:"Config<code-block>",group:"CodeBlock"});class A3{constructor(e){this.languages=e,this.map={},e.forEach(e=>{e.alias.forEach(t=>{this.map[t]=e})})}getAll(){return this.languages.map(e=>({name:e.name,alias:e.alias}))}load(e){let t=this.map[e.toLowerCase()];return t?t.support?Promise.resolve(t.support):t.load():Promise.resolve(void 0)}}function A7(){}function A6({icon:e,class:t,onClick:n}){return bB("span",{class:b9("milkdown-icon",t),onPointerdown:n,innerHTML:e?fM.sanitize(e.trim()):void 0})}A7(bB),A6.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}},A7(bB,bo);let A8=yr({props:{copyText:{type:String,required:!0},copyIcon:{type:String,required:!0},onCopy:{type:Function,required:!0},text:{type:String,required:!0}},setup(e){let t=()=>{(function(e){let t,n;return t=this,n=function*(){try{return navigator.clipboard.writeText(e)}catch(o){let t=document.createElement("textarea"),n=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";let r=document.getSelection(),i=r?r.rangeCount>0&&r.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(t),i&&(r.removeAllRanges(),r.addRange(i)),n&&n.focus()}},new Promise((e,r)=>{var i=e=>{try{l(n.next(e))}catch(e){r(e)}},o=e=>{try{l(n.throw(e))}catch(e){r(e)}},l=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,o);l((n=n.apply(t,null)).next())})})(e.text).then(()=>e.onCopy(e.text)).catch(console.error)};return()=>bB(bo,null,bB("button",{type:"button",class:"copy-button",onClick:t},bB(A6,{icon:e.copyIcon}),e.copyText))}});A7(bB,bo);let A9=yr({props:{language:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},config:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0}},setup({language:e,config:t,setLanguage:n,getAllLanguages:r,getReadOnly:i}){let o=vm(),l=vm(!1),s=vm(),a=vm(),c=vm("");v5([l,o,a],()=>{c.value="";let e=o.value,t=a.value;e&&t&&mM(e,t,{placement:"bottom-start"}).then(({x:e,y:n})=>{Object.assign(t.style,{left:`${e}px`,top:`${n}px`})}).catch(console.error)},void 0);let u=e=>{if(e.preventDefault(),e.stopPropagation(),i())return;let t=!l.value;l.value=t,t&&setTimeout(()=>{var e;return null==(e=s.value)?void 0:e.focus()},0)},h=e=>{c.value=e.target.value},d=e=>{"Escape"===e.key&&(c.value="")},p=bP(()=>{var t;if(!l.value)return[];let n=null!=(t=r())?t:[],i=n.find(t=>t.name.toLowerCase()===e.value.toLowerCase()),o=n.filter(e=>{let t=c.value.toLowerCase();return(e.name.toLowerCase().includes(t)||e.alias.some(e=>e.toLowerCase().includes(t)))&&e!==i});return 0===o.length?[]:i?[i,...o]:o}),f=e=>{let t=e.target;if(o.value&&o.value.contains(t))return;let n=a.value,r=o.value;r&&n&&"true"===r.dataset.expanded&&(n.contains(t)||(l.value=!1))};return yv(()=>{window.addEventListener("click",f)}),yx(()=>{window.removeEventListener("click",f)}),()=>bB(bo,null,bB("button",{type:"button",ref:o,class:"language-button",onClick:u,"data-expanded":String(l.value)},e.value||"Text",bB("div",{class:"expand-icon"},bB(A6,{icon:t.expandIcon}))),bB("div",{ref:a,class:"language-picker"},l.value?bB("div",{class:"list-wrapper"},bB("div",{class:"search-box"},bB("div",{class:"search-icon"},bB(A6,{icon:t.searchIcon})),bB("input",{ref:s,class:"search-input",placeholder:t.searchPlaceholder,value:c.value,onInput:h,onKeydown:d}),bB("div",{class:b9("clear-icon",0===c.value.length&&"hidden"),onMousedown:e=>{e.preventDefault(),c.value=""}},bB(A6,{icon:t.clearSearchIcon}))),bB("ul",{class:"language-list",role:"listbox",onKeydown:e=>{if("Enter"===e.key){let e=document.activeElement;e instanceof HTMLElement&&e.dataset.language&&n(e.dataset.language)}}},p.value.length?p.value.map(r=>bB("li",{role:"listitem",tabindex:"0",class:"language-list-item","aria-selected":r.name.toLowerCase()===e.value.toLowerCase(),"data-language":r.name,onClick:()=>{n(r.name),l.value=!1}},t.renderLanguage(r.name,r.name.toLowerCase()===e.value.toLowerCase()))):bB("li",{class:"language-list-item no-result"},t.noResultText))):null))}});A7(bB,bo);let Te=yr({props:{text:{type:Object,required:!0},language:{type:Object,required:!0},config:{type:Object,required:!0},previewOnlyMode:{type:Object,required:!0},preview:{type:Object,required:!0}},setup(e){let{previewOnlyMode:t,config:n,preview:r}=e,i=vm();return v4(()=>{let e,t,n=i.value;if(!n)return;for(;n.firstChild;)n.removeChild(n.firstChild);let o=r.value;("string"==typeof o||o instanceof Element)&&(null!=m||(e=fM(),t={ADD_TAGS:["foreignObject"],ADD_ATTR:["xmlns"],HTML_INTEGRATION_POINTS:{foreignobject:!0}},e.addHook("uponSanitizeElement",(e,t)=>{var n;if("foreignobject"===t.tagName){let t=e.parentElement;t&&"http://www.w3.org/2000/svg"===t.namespaceURI||null==(n=e.parentNode)||n.removeChild(e)}}),m=n=>e.sanitize(n,t)),n.innerHTML=m(o))}),()=>r.value?bB("div",{class:"preview-panel"},!t.value&&bB(bo,null,bB("div",{class:"preview-divider"}),bB("div",{class:"preview-label"},n.previewLabel)),bB("div",{ref:i,class:"preview"})):null}});A7(bB,bo);let Tt=yr({props:{text:{type:Object,required:!0},selected:{type:Object,required:!0},getReadOnly:{type:Function,required:!0},codemirror:{type:Object,required:!0},language:{type:Object,required:!0},getAllLanguages:{type:Function,required:!0},setLanguage:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){var t;let n=vm(null!=(t=e.config.previewOnlyByDefault)?t:e.getReadOnly()),r=vm(),i=vm(null);yv(()=>{for(var t;null==(t=r.value)?void 0:t.firstChild;)r.value.removeChild(r.value.firstChild);r.value&&r.value.appendChild(e.codemirror.dom)}),v5(()=>[e.text.value,e.language.value],()=>{let t=e.config.renderPreview(e.language.value,e.text.value,e=>i.value=e);t&&(i.value=t),void 0!==t||i.value||(i.value=fM.sanitize(e.config.previewLoading)),null===t&&(i.value=null)},{immediate:!0});let o=()=>{};return()=>{var t;return bB(bo,null,bB("div",{class:"tools"},bB(A9,{language:e.language,config:e.config,setLanguage:e.setLanguage,getAllLanguages:e.getAllLanguages,getReadOnly:e.getReadOnly}),bB("div",{class:"tools-button-group"},bB(A8,{copyIcon:e.config.copyIcon,copyText:e.config.copyText,onCopy:null!=(t=e.config.onCopy)?t:o,text:e.text.value}),i.value?bB("button",{class:"preview-toggle-button",onClick:()=>n.value=!n.value},bB(A6,{icon:e.config.previewToggleButton(n.value)})):null)),bB("div",{ref:r,class:b9("codemirror-host",i.value&&n.value&&"hidden")}),bB(Te,{text:e.text,language:e.language,config:e.config,previewOnlyMode:n,preview:i}))}}}),Tn=new WeakMap,Tr=null;function Ti(){return Tr||(Tr=new IntersectionObserver(e=>{for(let t of e){let e=Tn.get(t.target);null==e||e(t.isIntersecting)}},{rootMargin:"200px"})),Tr}let To=class e{constructor(e,t,n,r,i){var o;this.node=e,this.view=t,this.getPos=n,this.loader=r,this.config=i,this.selected=vm(!1),this.language=vm(""),this.text=vm(""),this.initialized=!1,this.updating=!1,this.languageName="",this.teardownTimer=null,this.forwardUpdate=e=>{var t;if(this.updating||!this.cm.hasFocus)return;let n=(null!=(t=this.getPos())?t:0)+1,{main:r}=e.state.selection,i=n+r.from,o=n+r.to,l=this.view.state.selection;if(e.docChanged||l.from!==i||l.to!==o){let t=this.view.state.tr;e.changes.iterChanges((e,r,i,o,l)=>{l.length?t.replaceWith(n+e,n+r,this.view.state.schema.text(l.toString())):t.delete(n+e,n+r),n+=o-i-(r-e)}),t.setSelection(sw.create(t.doc,i,o)),this.view.dispatch(t)}},this.createApp=()=>b8(Tt,{text:this.text,selected:this.selected,codemirror:this.cm,language:this.language,getAllLanguages:this.getAllLanguages,getReadOnly:()=>!this.view.editable,setLanguage:this.setLanguage,config:this.config}),this.codeMirrorKeymap=()=>{let e=this.view;return[{key:"ArrowUp",run:()=>this.maybeEscape("line",-1)},{key:"ArrowLeft",run:()=>this.maybeEscape("char",-1)},{key:"ArrowDown",run:()=>this.maybeEscape("line",1)},{key:"ArrowRight",run:()=>this.maybeEscape("char",1)},{key:"Mod-Enter",run:()=>!!sG(e.state,e.dispatch)&&(e.focus(),!0)},{key:"Mod-z",run:()=>AZ(e.state,e.dispatch)},{key:"Shift-Mod-z",run:()=>AY(e.state,e.dispatch)},{key:"Mod-y",run:()=>AY(e.state,e.dispatch)},{key:"Backspace",run:()=>{var e;let t=this.cm.state.selection.ranges;if(t.length>1)return!1;let n=t[0];if(n&&(!n.empty||n.anchor>0)||this.cm.state.doc.lines>=2)return!1;let r=this.view.state,i=null!=(e=this.getPos())?e:0,o=r.tr.replaceWith(i,i+this.node.nodeSize,r.schema.nodes.paragraph.createChecked({},this.node.content));return o.setSelection(sw.near(o.doc.resolve(i))),this.view.dispatch(o),this.view.focus(),!0}}]},this.maybeEscape=(e,t)=>{var n;let{state:r}=this.cm,i=r.selection.main;if(!i.empty||("line"===e&&(i=r.doc.lineAt(i.head)),t<0?i.from>0:i.to<r.doc.length))return!1;let o=(null!=(n=this.getPos())?n:0)+(t<0?0:this.node.nodeSize),l=sw.near(this.view.state.doc.resolve(o),t),s=this.view.state.tr.setSelection(l).scrollIntoView();return this.view.dispatch(s),this.view.focus(),!0},this.setLanguage=e=>{var t;this.view.dispatch(this.view.state.tr.setNodeAttribute(null!=(t=this.getPos())?t:0,"language",e))},this.getAllLanguages=()=>this.loader.getAll(),this.languageConf=new Mw.Compartment,this.readOnlyConf=new Mw.Compartment,this.text.value=this.node.textContent,this.language.value=null!=(o=this.node.attrs.language)?o:"",this.dom=document.createElement("div"),this.dom.className="milkdown-code-block",this.disposeSelectedWatcher=v4(()=>{this.selected.value?this.dom.classList.add("selected"):this.dom.classList.remove("selected")}),this.renderPlaceholder(),Tn.set(this.dom,e=>{e?(this.cancelTeardown(),this.initializeCodeMirror()):this.initialized&&this.scheduleTeardown()}),Ti().observe(this.dom)}renderPlaceholder(){let e=document.createElement("pre");e.className="milkdown-code-block-placeholder";let t=document.createElement("code");t.textContent=this.node.textContent,e.appendChild(t),this.dom.appendChild(e)}initializeCodeMirror(){if(this.initialized)return;this.initialized=!0,this.cm=new nX.EditorView({doc:this.node.textContent,root:this.view.root,extensions:[this.readOnlyConf.of(Mw.EditorState.readOnly.of(!this.view.editable)),(0,nX.drawSelection)(),nX.keymap.of(this.codeMirrorKeymap()),this.languageConf.of([]),Mw.EditorState.changeFilter.of(()=>this.view.editable),...this.config.extensions,nX.EditorView.updateListener.of(this.forwardUpdate)]});let e=this.dom.querySelector(".milkdown-code-block-placeholder");e&&this.dom.removeChild(e),this.app=this.createApp(),this.app.mount(this.dom),this.updateLanguage()}teardownCodeMirror(){if(this.initialized&&!this.cm.hasFocus&&!this.selected.value){for(this.app.unmount(),this.cm.destroy(),this.initialized=!1,this.languageName="";this.dom.firstChild;)this.dom.removeChild(this.dom.firstChild);this.renderPlaceholder()}}scheduleTeardown(){this.cancelTeardown(),this.teardownTimer=setTimeout(()=>this.teardownCodeMirror(),e.TEARDOWN_DELAY)}cancelTeardown(){null!=this.teardownTimer&&(clearTimeout(this.teardownTimer),this.teardownTimer=null)}updateLanguage(){let e=this.node.attrs.language;e===this.languageName||(this.language.value=e,this.loader.load(null!=e?e:"").then(t=>{t&&(this.cm.dispatch({effects:this.languageConf.reconfigure(t)}),this.languageName=e)}).catch(console.error))}setSelection(e,t){this.initialized||this.initializeCodeMirror(),this.cm.dom.isConnected&&(this.cm.focus(),this.updating=!0,this.cm.dispatch({selection:{anchor:e,head:t}}),this.updating=!1)}update(e){var t;if(e.type!==this.node.type)return!1;if(this.updating)return!0;if(this.node=e,this.text.value=e.textContent,this.language.value=null!=(t=e.attrs.language)?t:"",!this.initialized){let t=this.dom.querySelector(".milkdown-code-block-placeholder code");return t&&(t.textContent=e.textContent),!0}this.updateLanguage(),this.view.editable===this.cm.state.readOnly&&this.cm.dispatch({effects:this.readOnlyConf.reconfigure(Mw.EditorState.readOnly.of(!this.view.editable))});let n=function(e,t){if(e===t)return null;let n=0,r=e.length,i=t.length;for(;n<r&&e.charCodeAt(n)===t.charCodeAt(n);)++n;for(;r>n&&i>n&&e.charCodeAt(r-1)===t.charCodeAt(i-1);)r--,i--;return{from:n,to:r,text:t.slice(n,i)}}(this.cm.state.doc.toString(),e.textContent);return n&&(this.updating=!0,this.cm.dispatch({changes:{from:n.from,to:n.to,insert:n.text},scrollIntoView:!0}),this.updating=!1),!0}selectNode(){this.initialized||this.initializeCodeMirror(),this.selected.value=!0,this.cm.focus()}deselectNode(){this.selected.value=!1}stopEvent(){return!0}destroy(){this.cancelTeardown(),Ti().unobserve(this.dom),Tn.delete(this.dom),this.initialized&&(this.app.unmount(),this.cm.destroy()),this.disposeSelectedWatcher()}};To.TEARDOWN_DELAY=5e3;let Tl=dk(w4.node,e=>{let t=e.get(A2.key),n=new A3(t.languages);return(e,r,i)=>new To(e,r,i,n,t)});A5(Tl,{displayName:"NodeView<code-block>",group:"CodeBlock"});let Ts=[Tl,A2];var Ta=e.i(93453);let Tc="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class Tu{constructor(e,t,n=0,r=e.length,i,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(Tc(e)):Tc,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return -1;this.bufferPos=0,this.buffer=this.iter.value}return(0,Mw.codePointAt)(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=(0,Mw.fromCodePoint)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,Mw.codePointSize)(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,o=!0;;e++){let n=r.charCodeAt(e),l=this.match(n,i,o,this.bufferPos+this.bufferStart,e==r.length-1);if(l)return this.value=l,this;if(e==r.length-1)break;o&&e<t.length&&t.charCodeAt(e)==n?i++:o=!1}}}match(e,t,n,r,i){let o=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],l=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?o={from:n.from,to:r,precise:i&&n.precise}:(n.index++,l=!0)),l?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(1==this.query.length?o={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}"u">typeof Symbol&&(Tu.prototype[Symbol.iterator]=function(){return this});let Th={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Td="gm"+(null==/x/.unicode?"":"u");class Tp{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=Th,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Tg(e,t,n,r,i);this.re=new RegExp(t,Td+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=Tv(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=Tv(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}let Tf=new WeakMap;class Tm{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=Tf.get(e);if(!r||r.from>=n||r.to<=t){let r=new Tm(t,e.sliceString(t,n));return Tf.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:o}=r;return o>t&&(i=e.sliceString(t,o)+i,o=t),r.to<n&&(i+=e.sliceString(r.to,n)),Tf.set(e,new Tm(o,i)),new Tm(t,i.slice(t-o,n-o))}}class Tg{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=Th,this.matchPos=Tv(e,r),this.re=new RegExp(t,Td+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=Tm.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=Tv(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Tm.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Tv(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}"u">typeof Symbol&&(Tp.prototype[Symbol.iterator]=Tg.prototype[Symbol.iterator]=function(){return this});let Ty={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Tb=Mw.Facet.define({combine:e=>(0,Mw.combineConfig)(e,Ty,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),Tw=nX.Decoration.mark({class:"cm-selectionMatch"}),Tx=nX.Decoration.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Tk(e,t,n,r){return(0==n||e(t.sliceDoc(n-1,n))!=Mw.CharCategory.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Mw.CharCategory.Word)}let TC=nX.ViewPlugin.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Tb),{state:n}=e,r=n.selection;if(r.ranges.length>1)return nX.Decoration.none;let i=r.main,o,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return nX.Decoration.none;let e=n.wordAt(i.head);if(!e)return nX.Decoration.none;l=n.charCategorizer(i.head),o=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return nX.Decoration.none;if(t.wholeWords){var s,a,c;if(o=n.sliceDoc(i.from,i.to),!(Tk(l=n.charCategorizer(i.head),n,i.from,i.to)&&(s=l,a=i.from,c=i.to,s(n.sliceDoc(a,a+1))==Mw.CharCategory.Word&&s(n.sliceDoc(c-1,c))==Mw.CharCategory.Word)))return nX.Decoration.none}else if(!(o=n.sliceDoc(i.from,i.to)))return nX.Decoration.none}let u=[];for(let r of e.visibleRanges){let e=new Tu(n.doc,o,r.from,r.to);for(;!e.next().done;){let{from:r,to:o}=e.value;if((!l||Tk(l,n,r,o))&&(i.empty&&r<=i.from&&o>=i.to?u.push(Tx.range(r,o)):(r>=i.to||o<=i.from)&&u.push(Tw.range(r,o)),u.length>t.maxMatches))return nX.Decoration.none}}return nX.Decoration.set(u)}},{decorations:e=>e.decorations}),TS=nX.EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),TM=Mw.Facet.define({combine:e=>(0,Mw.combineConfig)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new T0(e),scrollToMatch:e=>nX.EditorView.scrollIntoView(e)})});class TA{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Td),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new TL(this):new TE(this)}getCursor(e,t=0,n){let r=e.doc?e:Mw.EditorState.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?TN(this,r,t,n):TO(this,r,t,n)}}class TT{constructor(e){this.spec=e}}function TO(e,t,n,r){var i,o,l,s;let a;return e.wholeWord&&(l=t.doc,s=t.charCategorizer(t.selection.main.head),a=(e,t,n,r)=>((r>e||r+n.length<t)&&(r=Math.max(0,e-2),n=l.sliceString(r,Math.min(l.length,t+2))),(s(TD(n,e-r))!=Mw.CharCategory.Word||s(TI(n,e-r))!=Mw.CharCategory.Word)&&(s(TI(n,t-r))!=Mw.CharCategory.Word||s(TD(n,t-r))!=Mw.CharCategory.Word))),e.test&&(i=e.test,o=a,a=(e,n,r,l)=>(!o||!!o(e,n,r,l))&&i(e>=l&&n<=l+r.length?r.slice(e-l,n-l):t.doc.sliceString(e,n),t,e,n)),new Tu(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),a)}class TE extends TT{constructor(e){super(e)}nextMatch(e,t,n){let r=TO(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=TO(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=TO(this.spec,e,n,r),o=null;for(;!i.nextOverlapping().done;)o=i.value;if(o)return o;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=TO(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=TO(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function TN(e,t,n,r){var i,o,l;let s;return e.wholeWord&&(l=t.charCategorizer(t.selection.main.head),s=(e,t,n)=>!n[0].length||(l(TD(n.input,n.index))!=Mw.CharCategory.Word||l(TI(n.input,n.index))!=Mw.CharCategory.Word)&&(l(TI(n.input,n.index+n[0].length))!=Mw.CharCategory.Word||l(TD(n.input,n.index+n[0].length))!=Mw.CharCategory.Word)),e.test&&(i=e.test,o=s,s=(e,n,r)=>(!o||o(e,n,r))&&i(r[0],t,e,n)),new Tp(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:s},n,r)}function TD(e,t){return e.slice((0,Mw.findClusterBreak)(e,t,!1),t)}function TI(e,t){return e.slice(t,(0,Mw.findClusterBreak)(e,t))}class TL extends TT{nextMatch(e,t,n){let r=TN(this.spec,e,n,e.doc.length).next();return r.done&&(r=TN(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),o=TN(this.spec,e,i,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(i==t||l.from>i+10))return l;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if("&"==n)return e.match[0];if("$"==n)return"$";for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=TN(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=TN(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}let T_=Mw.StateEffect.define(),TR=Mw.StateEffect.define(),Tz=Mw.StateField.define({create:e=>new TP(TK(e).create(),null),update(e,t){for(let n of t.effects)n.is(T_)?e=new TP(n.value.create(),e.panel):n.is(TR)&&(e=new TP(e.query,n.value?TG:null));return e},provide:e=>nX.showPanel.from(e,e=>e.panel)});class TP{constructor(e,t){this.query=e,this.panel=t}}let TB=nX.Decoration.mark({class:"cm-searchMatch"}),TF=nX.Decoration.mark({class:"cm-searchMatch cm-searchMatch-selected"}),TH=nX.ViewPlugin.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Tz))}update(e){let t=e.state.field(Tz);(t!=e.startState.field(Tz)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return nX.Decoration.none;let{view:n}=this,r=new Mw.RangeSetBuilder;for(let t=0,i=n.visibleRanges,o=i.length;t<o;t++){let{from:l,to:s}=i[t];for(;t<o-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,l,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?TF:TB)})}return r.finish()}},{decorations:e=>e.decorations});function Tq(e){return t=>{let n=t.state.field(Tz,!1);return n&&n.query.spec.valid?e(t,n):TY(t)}}let Tj=Tq((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Mw.EditorSelection.single(r.from,r.to),o=e.state.facet(TM);return e.dispatch({selection:i,effects:[T5(e,r),o.scrollToMatch(i.main,e)],userEvent:"select.search"}),TZ(e),!0}),TV=Tq((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let o=Mw.EditorSelection.single(i.from,i.to),l=e.state.facet(TM);return e.dispatch({selection:o,effects:[T5(e,i),l.scrollToMatch(o.main,e)],userEvent:"select.search"}),TZ(e),!0}),T$=Tq((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:Mw.EditorSelection.create(n.map(e=>Mw.EditorSelection.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),TW=Tq((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=t.nextMatch(n,r,r);if(!o)return!1;let l=o,s=[],a,c,u=[];l.precise?l.from==r&&l.to==i&&(c=n.toText(t.getReplacement(l)),s.push({from:l.from,to:l.to,insert:c}),u.push(nX.EditorView.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):l=t.nextMatch(n,l.from,l.to);let h=e.state.changes(s);return l&&(a=Mw.EditorSelection.single(l.from,l.to).map(h),u.push(T5(e,l)),u.push(n.facet(TM).scrollToMatch(a.main,e))),e.dispatch({changes:h,selection:a,effects:u,userEvent:"input.replace"}),!0}),TU=Tq((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:o}=r;o&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:nX.EditorView.announce.of(r),userEvent:"input.replace.all"}),!0});function TG(e){return e.state.facet(TM).createPanel(e)}function TK(e,t){var n,r,i,o,l;let s=e.selection.main,a=s.empty||s.to>s.from+100?"":e.sliceDoc(s.from,s.to);if(t&&!a)return t;let c=e.facet(TM);return new TA({search:(null!=(n=null==t?void 0:t.literal)?n:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:null!=(r=null==t?void 0:t.caseSensitive)?r:c.caseSensitive,literal:null!=(i=null==t?void 0:t.literal)?i:c.literal,regexp:null!=(o=null==t?void 0:t.regexp)?o:c.regexp,wholeWord:null!=(l=null==t?void 0:t.wholeWord)?l:c.wholeWord})}function TJ(e){let t=(0,nX.getPanel)(e,TG);return t&&t.dom.querySelector("[main-field]")}function TZ(e){let t=TJ(e);t&&t==e.root.activeElement&&t.select()}let TY=e=>{let t=e.state.field(Tz,!1);if(t&&t.panel){let n=TJ(e);if(n&&n!=e.root.activeElement){let r=TK(e.state,t.query.spec);r.valid&&e.dispatch({effects:T_.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[TR.of(!0),t?T_.of(TK(e.state,t.query.spec)):Mw.StateEffect.appendConfig.of(T3)]});return!0},TX=e=>{let t=e.state.field(Tz,!1);if(!t||!t.panel)return!1;let n=(0,nX.getPanel)(e,TG);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:TR.of(!1)}),!0},TQ=[{key:"Mod-f",run:TY,scope:"editor search-panel"},{key:"F3",run:Tj,shift:TV,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Tj,shift:TV,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:TX,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],l=0;for(let t=new Tu(e.doc,e.sliceDoc(r,i));!t.next().done;){if(o.length>1e3)return!1;t.value.from==r&&(l=o.length),o.push(Mw.EditorSelection.range(t.value.from,t.value.to))}return t(e.update({selection:Mw.EditorSelection.create(o,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=(0,nX.showDialog)(e,{label:t.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:t.phrase("go")});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i)return void e.dispatch({effects:r});let o=t.doc.lineAt(t.selection.main.head),[,l,s,a,c]=i,u=a?+a.slice(1):0,h=s?+s:o.number;if(s&&c){let e=h/100;l&&(e=e*("-"==l?-1:1)+o.number/t.doc.lines),h=Math.round(t.doc.lines*e)}else s&&l&&(h=h*("-"==l?-1:1)+o.number);let d=t.doc.line(Math.max(1,Math.min(t.doc.lines,h))),p=Mw.EditorSelection.cursor(d.from+Math.max(0,Math.min(u,d.length)));e.dispatch({effects:[r,nX.EditorView.scrollIntoView(p.from,{y:"center"})],selection:p})}),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return(({state:e,dispatch:t})=>{let{selection:n}=e,r=Mw.EditorSelection.create(n.ranges.map(t=>e.wordAt(t.head)||Mw.EditorSelection.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)})({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new Tu(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new Tu(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(o){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}(e,r);return!!i&&(t(e.update({selection:e.selection.addRange(Mw.EditorSelection.range(i.from,i.to),!1),effects:nX.EditorView.scrollIntoView(i.to)})),!0)},preventDefault:!0}];class T0{constructor(e){this.view=e;let t=this.query=e.state.field(Tz).query.spec;function n(e,t,n){return(0,Ta.default)("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=(0,Ta.default)("input",{value:t.search,placeholder:T1(e,"Find"),"aria-label":T1(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=(0,Ta.default)("input",{value:t.replace,placeholder:T1(e,"Replace"),"aria-label":T1(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=(0,Ta.default)("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=(0,Ta.default)("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=(0,Ta.default)("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=(0,Ta.default)("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>Tj(e),[T1(e,"next")]),n("prev",()=>TV(e),[T1(e,"previous")]),n("select",()=>T$(e),[T1(e,"all")]),(0,Ta.default)("label",null,[this.caseField,T1(e,"match case")]),(0,Ta.default)("label",null,[this.reField,T1(e,"regexp")]),(0,Ta.default)("label",null,[this.wordField,T1(e,"by word")]),...e.state.readOnly?[]:[(0,Ta.default)("br"),this.replaceField,n("replace",()=>TW(e),[T1(e,"replace")]),n("replaceAll",()=>TU(e),[T1(e,"replace all")])],(0,Ta.default)("button",{name:"close",onclick:()=>TX(e),"aria-label":T1(e,"close"),type:"button"},["×"])])}commit(){let e=new TA({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:T_.of(e)}))}keydown(e){(0,nX.runScopeHandlers)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?TV:Tj)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),TW(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(T_)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(TM).top}}function T1(e,t){return e.state.phrase(t)}let T4=/[\s\.,:;?!]/;function T5(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,o=Math.max(r.from,t-30),l=Math.min(i,n+30),s=e.state.sliceDoc(o,l);if(o!=r.from){for(let e=0;e<30;e++)if(!T4.test(s[e+1])&&T4.test(s[e])){s=s.slice(e);break}}if(l!=i){for(let e=s.length-1;e>s.length-30;e--)if(!T4.test(s[e-1])&&T4.test(s[e])){s=s.slice(0,e);break}}return nX.EditorView.announce.of(`${e.state.phrase("current match")}. ${s} ${e.state.phrase("on line")} ${r.number}.`)}let T2=nX.EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),T3=[Tz,Mw.Prec.low(TH),T2];var T7=e.i(73295),T6=nX;class T8{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class T9{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=n.facet(Ou).markerFilter;r&&(e=r(e,n));let i=e.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new Mw.RangeSetBuilder,l=[],s=0,a=n.doc.iter(),c=0,u=n.doc.length;for(let e=0;;){let t,n,r=e==i.length?null:i[e];if(!r&&!l.length)break;if(l.length)t=s,n=l.reduce((e,t)=>Math.min(e,t.to),r&&r.from>t?r.from:1e8);else{if((t=r.from)>u)break;n=r.to,l.push(r),e++}for(;e<i.length;){let r=i[e];if(r.from==t&&(r.to>r.from||r.to==t))l.push(r),e++,n=Math.min(r.to,n);else{n=Math.min(r.from,n);break}}n=Math.min(n,u);let h=!1;if(l.some(e=>e.from==t&&(e.to==n||n==u))&&!(h=t==n)&&n-t<10){let e=t-(c+a.value.length);e>0&&(a.next(e),c=t);for(let e=t;;){if(e>=n){h=!0;break}if(!a.lineBreak&&c+a.value.length>e)break;e=c+a.value.length,c+=a.value.length,a.next()}}let d=Ob(l);if(h)o.add(t,t,T6.Decoration.widget({widget:new Of(d),diagnostics:l.slice()}));else{let e=l.reduce((e,t)=>t.markClass?e+" "+t.markClass:e,"");o.add(t,n,T6.Decoration.mark({class:"cm-lintRange cm-lintRange-"+d+e,diagnostics:l.slice(),inclusiveEnd:l.some(e=>e.to>n)}))}if((s=n)==u)break;for(let e=0;e<l.length;e++)l[e].to<=s&&l.splice(e--,1)}let h=o.finish();return new T9(h,t,Oe(h))}}function Oe(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&0>i.diagnostics.indexOf(t)))if(r){if(0>i.diagnostics.indexOf(r.diagnostic))return!1;r=new T8(r.from,n,r.diagnostic)}else r=new T8(e,n,t||i.diagnostics[0])}),r}function Ot(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(Ou).hideOn(e,n,r);if(null!=i)return i;let o=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(On))||e.changes.touchesRange(o.from,Math.max(o.to,r)))}let On=Mw.StateEffect.define(),Or=Mw.StateEffect.define(),Oi=Mw.StateEffect.define(),Oo=Mw.StateField.define({create:()=>new T9(T6.Decoration.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=Oe(n,e.selected.diagnostic,i)||Oe(n,null,i)}!n.size&&i&&t.state.facet(Ou).autoPanel&&(i=null),e=new T9(n,i,r)}for(let n of t.effects)if(n.is(On)){let r=t.state.facet(Ou).autoPanel?n.value.length?Og.open:null:e.panel;e=T9.init(n.value,r,t.state)}else n.is(Or)?e=new T9(e.diagnostics,n.value?Og.open:null,e.selected):n.is(Oi)&&(e=new T9(e.diagnostics,e.panel,n.value));return e},provide:e=>[T6.showPanel.from(e,e=>e.panel),T6.EditorView.decorations.from(e,e=>e.diagnostics)]}),Ol=T6.Decoration.mark({class:"cm-lintRange cm-lintRange-active"});function Os(e,t){return(0,Ta.default)("ul",{class:"cm-tooltip-lint"},t.map(t=>Op(e,t,!1)))}let Oa=e=>{let t=e.state.field(Oo,!1);return!!t&&!!t.panel&&(e.dispatch({effects:Or.of(!1)}),!0)},Oc=[{key:"Mod-Shift-m",run:e=>{var t,n;let r=e.state.field(Oo,!1);r&&r.panel||e.dispatch({effects:(t=e.state,n=[Or.of(!0)],t.field(Oo,!1)?n:n.concat(Mw.StateEffect.appendConfig.of(OC)))});let i=(0,T6.getPanel)(e,Og.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Oo,!1);if(!t)return!1;let n=e.state.selection.main,r=Oe(t.diagnostics,null,n.to+1);return(!!r||!!(r=Oe(t.diagnostics,null,0))&&(r.from!=n.from||r.to!=n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),(0,T6.activateHover)(e,r.from,1,{tooltip:Ok,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],Ou=Mw.Facet.define({combine:e=>({sources:e.map(e=>e.source).filter(e=>null!=e),...(0,Mw.combineConfig)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Oh,tooltipFilter:Oh,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})})});function Oh(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function Od(e){let t=[];if(e)i:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue i}}t.push("")}return t}function Op(e,t,n){var r;let i=n?Od(t.actions):[];return(0,Ta.default)("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},(0,Ta.default)("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null==(r=t.actions)?void 0:r.map((n,r)=>{let o=!1,l=r=>{if(r.preventDefault(),o)return;o=!0;let i=Oe(e.state.field(Oo).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,a=i[r]?s.indexOf(i[r]):-1,c=a<0?s:[s.slice(0,a),(0,Ta.default)("u",s.slice(a,a+1)),s.slice(a+1)],u=n.markClass?" "+n.markClass:"";return(0,Ta.default)("button",{type:"button",class:"cm-diagnosticAction"+u,onclick:l,onmousedown:l,"aria-label":` Action: ${s}${a<0?"":` (access key "${i[r]})"`}.`},c)}),t.source&&(0,Ta.default)("div",{class:"cm-diagnosticSource"},t.source))}class Of extends T6.WidgetType{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return(0,Ta.default)("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class Om{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(0xffffffff*Math.random()).toString(16),this.dom=Op(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Og{constructor(e){this.view=e,this.items=[];let t=t=>{if(!t.ctrlKey&&!t.altKey&&!t.metaKey){if(27==t.keyCode)Oa(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],r=Od(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=Oe(this.view.state.field(Oo).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}t.preventDefault()}},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=(0,Ta.default)("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=(0,Ta.default)("div",{class:"cm-panel-lint"},this.list,(0,Ta.default)("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Oa(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Oo).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Oo),n=0,r=!1,i=null,o=new Set;for(e.between(0,this.view.state.doc.length,(e,l,{spec:s})=>{for(let e of s.diagnostics){if(o.has(e))continue;o.add(e);let l=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){l=t;break}l<0?(s=new Om(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[l],l>n&&(this.items.splice(n,l-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute("aria-selected")||(s.dom.setAttribute("aria-selected","true"),i=s):s.dom.hasAttribute("aria-selected")&&s.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new Om(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Oe(this.view.state.field(Oo).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Oi.of(t)})}static open(e){return new Og(e)}}function Ov(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let Oy=T6.EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Ov("#f11")},".cm-lintRange-warning":{backgroundImage:Ov("orange")},".cm-lintRange-info":{backgroundImage:Ov("#999")},".cm-lintRange-hint":{backgroundImage:Ov("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Ob(e){let t="hint",n=1;for(let i of e){var r;let e="error"==(r=i.severity)?4:"warning"==r?3:"info"==r?2:1;e>n&&(n=e,t=i.severity)}return t}T6.GutterMarker;let Ow=Mw.StateEffect.define(),Ox=Mw.StateField.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=Ot(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(Ow)?t.value:e,e)),provide:e=>T6.showTooltip.from(e)}),Ok=(0,T6.hoverTooltip)(function(e,t,n){let{diagnostics:r}=e.state.field(Oo),i,o=-1,l=-1;r.between(t-(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,o=e,l=r,!1});let s=e.state.facet(Ou).tooltipFilter;return(i&&s&&(i=s(i,e.state)),i)?{pos:o,end:l,above:e.state.doc.lineAt(o).to<l,create:()=>({dom:Os(e,i)})}:null},{hideOn:Ot}),OC=[Oo,T6.EditorView.decorations.compute([Oo],e=>{let{selected:t,panel:n}=e.field(Oo);return t&&n&&t.from!=t.to?T6.Decoration.set([Ol.range(t.from,t.to)]):T6.Decoration.none}),Ok,Oy],OS=Mw.Facet.define({combine:e=>(0,Mw.combineConfig)(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})}),OM=[(0,nX.lineNumbers)(),(0,nX.highlightActiveLineGutter)(),(0,nX.highlightSpecialChars)(),function(e={}){return[MI,MD.of(e),nX.EditorView.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?M_:"historyRedo"==e.inputType?MR:null;return!!n&&(e.preventDefault(),n(t))}})]}(),(0,nK.foldGutter)(),(0,nX.drawSelection)(),(0,nX.dropCursor)(),Mw.EditorState.allowMultipleSelections.of(!0),(0,nK.indentOnInput)(),(0,nK.syntaxHighlighting)(nK.defaultHighlightStyle,{fallback:!0}),(0,nK.bracketMatching)(),(0,T7.closeBrackets)(),(0,T7.autocompletion)(),(0,nX.rectangularSelection)(),(0,nX.crosshairCursor)(),(0,nX.highlightActiveLine)(),[TS,TC],nX.keymap.of([...T7.closeBracketsKeymap,...AL,...TQ,{key:"Mod-z",run:M_,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:MR,preventDefault:!0},{linux:"Ctrl-Shift-z",run:MR,preventDefault:!0},{key:"Mod-u",run:Mz,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:MP,preventDefault:!0},...nK.foldKeymap,...T7.completionKeymap,...Oc])];function OA(e,t){return Math.abs(e[0]-t[0])+Math.abs(e[1]-t[1])}function OT(e,t){return Math.min(OA(e,[t[0],t[1]]),OA(e,[t[2],t[3]]))}WeakMap,WeakMap;class OO extends sg{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return OO.valid(n)?new OO(n):sg.near(n)}content(){return lt.empty}eq(e){return e instanceof OO&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new OO(e.resolve(t.pos))}getBookmark(){return new OE(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||ON(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||ON(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){o:for(;;){if(!n&&OO.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let l=e.doc.resolve(r);if(OO.valid(l))return l}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!sk.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue o}break}i=o,r+=t;let l=e.doc.resolve(r);if(OO.valid(l))return l}return null}}}OO.prototype.visible=!1,OO.findFrom=OO.findGapCursorFrom,sg.jsonID("gapcursor",OO);class OE{constructor(e){this.pos=e}map(e){return new OE(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return OO.valid(t)?new OO(t):sg.near(t)}}function ON(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let OD=aj({ArrowLeft:OI("horiz",-1),ArrowRight:OI("horiz",1),ArrowUp:OI("vert",-1),ArrowDown:OI("vert",1)});function OI(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,l=t>0?o.$to:o.$from,s=o.empty;if(o instanceof sw){if(!i.endOfTextblock(n)||0==l.depth)return!1;s=!1,l=e.doc.resolve(t>0?l.after():l.before())}let a=OO.findGapCursorFrom(l,t,s);return!!a&&(r&&r(e.tr.setSelection(new OO(a))),!0)}}function OL(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!OO.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&sk.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new OO(r))),!0)}function O_(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof OO))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=o3.empty;for(let e=r.length-1;e>=0;e--)i=o3.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new lt(i,0,0));return o.setSelection(sw.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function OR(e){if(!(e.selection instanceof OO))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",uX.create(e.doc,[uJ.widget(e.selection.head,t,{key:"gapcursor"})])}function Oz(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-cursor",...t}}),e}var OP=dC(null,"dropIndicatorState");Oz(OP,{displayName:"Ctx<dropIndicatorState>"});var OB=dC({width:2,color:!1,class:"milkdown-drop-indicator"},"dropIndicatorConfig");Oz(OB,{displayName:"Ctx<dropIndicatorConfig>"});var OF=new sP("MILKDOWN_DROP_INDICATOR_DOM"),OH=dw(e=>new s_({key:OF,view:t=>{let n=e.get(OB.key),r=document.createElement("div");Object.assign(r.style,{position:"fixed",pointerEvents:"none",display:"none",backgroundColor:n.color,top:"0",left:"0"}),r.classList.add(n.class),r.classList.add("milkdown-drop-indicator"),t.dom.parentNode?.appendChild(r);let i=e.use(OP.key),o=e=>{!function(e,t,n){let r,i;if(!t)return Object.assign(e.style,{display:"none"});let{line:o}=t,{width:l}=n,{p1:{x:s,y:a},p2:{x:c,y:u}}=o,h=a,d=s;a===u?(r=c-s,i=l,h-=l/2):(r=l,i=u-a,d-=l/2),h=Math.round(h),d=Math.round(d),Object.assign(e.style,{display:"block",width:`${r}px`,height:`${i}px`,transform:`translate(${d}px, ${h}px)`})}(r,e,n)};return i.on(o),{destroy:()=>{i.off(o),r.remove()}}}}));Oz(OH,{displayName:"Prose<dropIndicatorDOM>"});var Oq=dw(e=>{var t;let n;return t={onShow:t=>{e.set(OP.key,t)},onHide:()=>{e.set(OP.key,null)},onDrag:()=>!0},new s_({key:new sP("prosekit-drop-indicator"),view:e=>{var r,i,o,l;let s,a,c,u,h,d,p,f,m,g,y,b;return r=t.onDrag,h=[],i=e,o=n=(t,n)=>{var i,o;return c&&(i=c,o=t,i[0]===o[0]&&i[1]===o[1])?u:(c=t,u=((t,n)=>{let i,o;if(!e.editable||e.isDestroyed)return;let l=(i=e.dom.getBoundingClientRect(),o=e.state.doc,h&&s&&a&&i.width===a.width&&i.height===a.height&&i.x===a.x&&i.y===a.y&&s.eq(o)?h:(a=i,s=o,h=function(e){let t=[[-1,e.state.doc]],n=[];for(;t.length>0;){let[i,o]=t.pop();if(i>=0){var r;let t=e.nodeDOM(i);if(t&&1===(r=t).nodeType&&"http://www.w3.org/1999/xhtml"===r.namespaceURI){let{top:e,bottom:r,left:l,right:s}=t.getBoundingClientRect();n.push([i,[l,e,s,e]],[i+o.nodeSize,[l,r,s,r]])}}if(o.isBlock&&!o.isTextblock){let e=i+1;for(let n of o.children)t.push([e,n]),e+=n.nodeSize}}return n}(e)));l.sort((e,n)=>{let[r,i]=e,[o,l]=n;return OT(t,i)-OT(t,l)||r-o});let c=(l=l.slice(0,8)).find(t=>r?.({view:e,pos:t[0],event:n})!==!1);if(!(c&&function(e,t){let n=e.dragging;if(!n)return;let{move:r}=n;if(!r)return;let i=e.state.selection;if(!(i instanceof sk))return;let{from:o,to:l}=i;return o<=t&&t<=l}(e,c[0])))return c})(t,n))},l=t,m=i.dom,g=!1,y=()=>{d&&clearTimeout(d),g=!1,d=setTimeout(()=>{g||l.onHide?.()},30)},b=e=>{g=!0;let{clientX:t,clientY:n}=e;if(p===t&&f===n)return;p=t,f=n;let r=o([t,n],e);if(!r)return void y();{let[e,[t,n,o,s]]=r;l.onShow?.({view:i,pos:e,line:{p1:{x:t,y:n},p2:{x:o,y:s}}})}},m.addEventListener("dragover",b),m.addEventListener("dragend",y),m.addEventListener("drop",y),m.addEventListener("dragleave",y),{destroy:()=>{m.removeEventListener("dragover",b),m.removeEventListener("dragend",y),m.removeEventListener("drop",y),m.removeEventListener("dragleave",y)}}},props:{handleDrop(e,t,r,i){if(!n)return!1;let o=n([t.clientX,t.clientY],t);if(!o)return!1;t.preventDefault();let l=o[0],s=e.state.tr;if(i){let{node:t}=e.dragging||{};t?t.replace(s):s.deleteSelection()}let a=s.mapping.map(l),c=0==r.openStart&&0==r.openEnd&&1==r.content.childCount,u=s.doc;if(c?s.replaceRangeWith(a,a,r.content.firstChild):s.replaceRange(a,a,r),s.doc.eq(u))return!0;let h=s.doc.resolve(a);if(c&&sk.isSelectable(r.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(r.content.firstChild))s.setSelection(new sk(h));else{var d,p,f;let t=s.mapping.map(l);s.mapping.maps[s.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),s.setSelection((d=e,p=h,f=s.doc.resolve(t),d.someProp("createSelectionBetween",e=>e(d,p,f))||sw.between(p,f,void 0)))}return e.focus(),e.dispatch(s.setMeta("uiEvent","drop")),!0}}})});Oz(Oq,{displayName:"Prose<dropIndicator>"});var Oj=dw(()=>new s_({props:{decorations:OR,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&OO.valid(n)?new OO(n):null,handleClick:OL,handleKeyDown:OD,handleDOMEvents:{beforeinput:O_}}}));Oz(Oj,{displayName:"Prose<gapCursor>"});var OV=[Oj,OB,OP,OH,Oq].flat(),O$=new sP("prosemirror-virtual-cursor");function OW(e){let t=e.index(),n=e.parent.maybeChild(t),r=e.textOffset?n:null;return!r&&t>0&&(r=e.parent.maybeChild(t-1)),[null==r?void 0:r.marks,null==n?void 0:n.marks]}function OU(e){return e&&"object"==typeof e&&"$cursor"in e}var OG=Object.defineProperty,OK=Object.getOwnPropertySymbols,OJ=Object.prototype.hasOwnProperty,OZ=Object.prototype.propertyIsEnumerable,OY=(e,t,n)=>t in e?OG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function OX(e,t){return Object.assign(e,{meta:((e,t)=>{for(var n in t||(t={}))OJ.call(t,n)&&OY(e,n,t[n]);if(OK)for(var n of OK(t))OZ.call(t,n)&&OY(e,n,t[n]);return e})({package:"@milkdown/components"},t)}),e}let OQ=dC({imageIcon:"🌌",uploadButton:"Upload",confirmButton:"⏎",uploadPlaceholderText:"/Paste",onUpload:e=>Promise.resolve(URL.createObjectURL(e))},"inlineImageConfigCtx");function O0(){}function O1({icon:e,class:t,onClick:n}){return bB("span",{class:b9("milkdown-icon",t),onPointerdown:n,innerHTML:e?fM.sanitize(e.trim()):void 0})}OX(OQ,{displayName:"Config<image-inline>",group:"ImageInline"}),O0(bB),O1.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}},O0(bB,bo);let O4=x1("abcdefg",8),O5=yr({props:{src:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setLink:{type:Function,required:!0},imageIcon:{type:String,required:!1},uploadButton:{type:String,required:!1},confirmButton:{type:String,required:!1},uploadPlaceholderText:{type:String,required:!1},onUpload:{type:Function,required:!0},onImageLoadError:{type:Function,required:!1}},setup({readonly:e,src:t,setLink:n,onUpload:r,imageIcon:i,uploadButton:o,confirmButton:l,uploadPlaceholderText:s,className:a,onImageLoadError:c}){var u,h;let d=vm(!1),p=vm(),f=vm(null!=(u=t.value)?u:""),m=vm(O4()),g=vm((null==(h=t.value)?void 0:h.length)!==0),y=e=>{let t=e.target.value;g.value=0!==t.length,f.value=t},b=e=>{var t,r;"Enter"===e.key&&n(null!=(r=null==(t=p.value)?void 0:t.value)?r:"")},w=e=>{var t;let i=null==(t=e.target.files)?void 0:t[0];i&&r(i).then(e=>{e&&(n(e),g.value=!0)}).catch(e=>{console.error("An error occurred while uploading image"),console.error(e)})};return()=>bB("div",{class:b9("image-edit",a)},bB(O1,{icon:i,class:"image-icon"}),bB("div",{class:b9("link-importer",d.value&&"focus")},bB("input",{ref:p,draggable:"true",onDragstart:e=>{e.preventDefault(),e.stopPropagation()},disabled:e.value,class:"link-input-area",value:f.value,onInput:y,onKeydown:b,onFocus:()=>d.value=!0,onBlur:()=>d.value=!1}),!g.value&&bB("div",{class:"placeholder"},bB("input",{disabled:e.value,class:"hidden",id:m.value,type:"file",accept:"image/*",onChange:w}),bB("label",{class:"uploader",for:m.value},bB(O1,{icon:o})),bB("span",{class:"text",onClick:()=>{var e;return null==(e=p.value)?void 0:e.focus()}},s))),f.value&&bB(bo,null,bB("div",{class:"image-preview"},bB("img",{src:f.value,alt:"",onError:e=>Promise.resolve(null==c?void 0:c(e)).catch(()=>{})})),bB("div",{class:"confirm",onClick:()=>{var e,t;n(null!=(t=null==(e=p.value)?void 0:e.value)?t:"")}},bB(O1,{icon:l}))))}});O0(bB,bo);let O2=yr({props:{src:{type:Object,required:!0},alt:{type:Object,required:!0},title:{type:Object,required:!0},selected:{type:Object,required:!0},readonly:{type:Object,required:!0},setAttr:{type:Function,required:!0},config:{type:Object,required:!0}},setup(e){let{src:t,alt:n,title:r}=e;return()=>{var i;return(null==(i=t.value)?void 0:i.length)?bB("img",{class:"image-inline",src:t.value,alt:n.value,title:r.value}):bB(O5,{src:e.src,selected:e.selected,readonly:e.readonly,setLink:t=>e.setAttr("src",t),imageIcon:e.config.imageIcon,uploadButton:e.config.uploadButton,confirmButton:e.config.confirmButton,uploadPlaceholderText:e.config.uploadPlaceholderText,onUpload:e.config.onUpload,className:"empty-image-inline"})}}}),O3=dk(w6.node,e=>(t,n,r)=>{let i=vm(t.attrs.src),o=vm(t.attrs.alt),l=vm(t.attrs.title),s=vm(!1),a=vm(!n.editable),c=e.get(OQ.key),u=b8(O2,{src:i,alt:o,title:l,selected:s,readonly:a,setAttr:(e,t)=>{if(!n.editable)return;let i=r();null!=i&&n.dispatch(n.state.tr.setNodeAttribute(i,e,"src"===e?fM.sanitize(t):t))},config:c}),h=document.createElement("span");h.className="milkdown-image-inline";let d=v4(()=>{s.value?h.classList.add("selected"):h.classList.remove("selected")}),p=c.proxyDomURL,f=e=>{if(p){let t=p(e.attrs.src);"string"==typeof t?i.value=t:t.then(e=>{i.value=e}).catch(console.error)}else i.value=e.attrs.src;o.value=e.attrs.alt,l.value=e.attrs.title};return f(t),u.mount(h),{dom:h,update:e=>e.type===t.type&&(f(e),!0),stopEvent:e=>e.target instanceof HTMLInputElement,selectNode:()=>{s.value=!0},deselectNode:()=>{s.value=!1},destroy:()=>{d(),u.unmount(),h.remove()}}});OX(O3,{displayName:"NodeView<image-inline>",group:"ImageInline"});let O7=[OQ,O3];class O6 extends Error{constructor(e,t){var n="KaTeX parse error: "+e,r=t&&t.loc;if(r&&r.start<=r.end){var i,o,l=r.lexer.input;i=r.start,o=r.end,i===l.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var s=l.slice(i,o).replace(/[^]/g,"$&̲");n+=(i>15?"…"+l.slice(i-15,i):l.slice(0,i))+s+(o+15<l.length?l.slice(o,o+15)+"…":l.slice(o))}super(n),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,O6.prototype),this.position=i,null!=i&&null!=o&&(this.length=o-i),this.rawMessage=e}}var O8=/([A-Z])/g,O9=e=>e.replace(O8,"-$1").toLowerCase(),Ee={"&":"&",">":">","<":"<",'"':""","'":"'"},Et=/[&><"']/g,En=e=>String(e).replace(Et,e=>Ee[e]),Er=e=>{if("ordgroup"===e.type||"color"===e.type)if(1===e.body.length)return Er(e.body[0]);else return e;return"font"===e.type?Er(e.body):e},Ei=new Set(["mathord","textord","atom"]),Eo=e=>Ei.has(Er(e).type),El={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};class Es{constructor(e){for(var t of(void 0===e&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Object.keys(El))){var n=El[t];n&&function(e,t,n,r){var i=n[t];e[t]=void 0!==i?r.processor?r.processor(i):i:function(e){if(void 0!==e.default)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;if("string"!=typeof t)return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw Error("Unexpected schema type; settings must declare an explicit default.")}}(r)}(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new O6("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" [")+e+"]",n);"warn"===r?"u">typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" [")+e+"]"):"u">typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+r+"': "+t+" [")+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}return!!r&&"ignore"!==r&&(!0===r||"error"===r||("warn"===r?("u">typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" [")+e+"]"),!1):("u">typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+r+"': "+t+" [")+e+"]"),!1)))}isTrusted(e){if("url"in e&&e.url&&!e.protocol){var t,n,r=(t=e.url,(n=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(t))?":"===n[2]&&/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(n[1])?n[1].toLowerCase():null:"_relative");if(null==r)return!1;e.protocol=r}return!!("function"==typeof this.trust?this.trust(e):this.trust)}}class Ea{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Ec[Eu[this.id]]}sub(){return Ec[Eh[this.id]]}fracNum(){return Ec[Ed[this.id]]}fracDen(){return Ec[Ep[this.id]]}cramp(){return Ec[Ef[this.id]]}text(){return Ec[Em[this.id]]}isTight(){return this.size>=2}}var Ec=[new Ea(0,0,!1),new Ea(1,0,!0),new Ea(2,1,!1),new Ea(3,1,!0),new Ea(4,2,!1),new Ea(5,2,!0),new Ea(6,3,!1),new Ea(7,3,!0)],Eu=[4,5,4,5,6,7,6,7],Eh=[5,5,5,5,7,7,7,7],Ed=[2,3,4,5,6,7,6,7],Ep=[3,3,5,5,7,7,7,7],Ef=[1,1,3,3,5,5,7,7],Em=[0,1,2,3,2,3,2,3],Eg={DISPLAY:Ec[0],TEXT:Ec[2],SCRIPT:Ec[4],SCRIPTSCRIPT:Ec[6]},Ev=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],Ey=[];function Eb(e){for(var t=0;t<Ey.length;t+=2)if(e>=Ey[t]&&e<=Ey[t+1])return!0;return!1}Ev.forEach(e=>e.blocks.forEach(e=>Ey.push(...e)));var Ew=function(e,t,n){t*=1e3;var r,i,o,l,s,a,c="";switch(e){case"sqrtMain":c="M95,"+(622+(r=t)+80)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+r/2.075+" -"+r+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+r)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+r)+" 80h400000v"+(40+r)+"h-400000z";break;case"sqrtSize1":c="M263,"+(601+(i=t)+80)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+i/2.084+" -"+i+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+i)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+i)+" 80h400000v"+(40+i)+"h-400000z";break;case"sqrtSize2":c="M983 "+(10+(o=t)+80)+"\nl"+o/3.13+" -"+o+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+o)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+o)+" 80h400000v"+(40+o)+"h-400000z";break;case"sqrtSize3":c="M424,"+(2398+(l=t)+80)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+l/4.223+" -"+l+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+l)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+l)+" 80\nh400000v"+(40+l)+"h-400000z";break;case"sqrtSize4":c="M473,"+(2713+(s=t)+80)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+s/5.298+" -"+s+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+s)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+s)+" 80h400000v"+(40+s)+"H1017.7z";break;case"sqrtTall":c="M702 "+((a=t)+80)+"H400000"+(40+a)+"\nH742v"+(n-54-80-a)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 80H400000v"+(40+a)+"H742z"}return c},Ex=function(e,t){switch(e){case"⎜":let n;return(n="M291 0 H417 V"+t+" H291z")+" "+n;case"∣":let r;return(r="M145 0 H188 V"+t+" H145z")+" "+r;case"∥":let i,o;return(i="M145 0 H188 V"+t+" H145z")+" "+i+((o="M367 0 H410 V"+t+" H367z")+" ")+o;case"⎟":let l;return(l="M457 0 H583 V"+t+" H457z")+" "+l;case"⎢":let s;return(s="M319 0 H403 V"+t+" H319z")+" "+s;case"⎥":let a;return(a="M263 0 H347 V"+t+" H263z")+" "+a;case"⎪":let c;return(c="M384 0 H504 V"+t+" H384z")+" "+c;case"⏐":let u;return(u="M312 0 H355 V"+t+" H312z")+" "+u;case"‖":let h,d;return(h="M257 0 H300 V"+t+" H257z")+" "+h+((d="M478 0 H521 V"+t+" H478z")+" ")+d;default:return""}},Ek={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z M40 281 V428 H0 V94 H40 V241 H400000 v40z",leftbracketunder:"M0 0 h120 V290 H399995 v120 H0z M0 0 h120 V290 H399995 v120 H0z",leftbracketover:"M0 440 h120 V150 H399995 v-120 H0z M0 440 h120 V150 H399995 v-120 H0z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z M40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z M0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z M399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightbracketunder:"M399995 0 h-120 V290 H0 v120 H400000z M399995 0 h-120 V290 H0 v120 H400000z",rightbracketover:"M399995 440 h-120 V150 H0 v-120 H399995z M399995 440 h-120 V150 H0 v-120 H399995z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},EC=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw Error("Unknown stretchy delimiter.")}};class ES{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if("toText"in e)return e.toText();throw Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}var EM={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},EA={ex:!0,em:!0,mu:!0},ET=function(e){return"string"!=typeof e&&(e=e.unit),e in EM||e in EA||"ex"===e},EO=function(e,t){var n,r;if(e.unit in EM)n=EM[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else if("em"===e.unit)n=r.fontMetrics().quad;else throw new O6("Invalid unit: '"+e.unit+"'");r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},EE=function(e){return+e.toFixed(4)+"em"},EN=function(e){return e.filter(e=>e).join(" ")},ED=function(e){var t="";for(var n of Object.keys(e)){var r=e[n];void 0!==r&&(t+=O9(n)+":"+r+";")}return t},EI=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},EL=function(e){var t=document.createElement(e);for(var n of(t.className=EN(this.classes),Object.assign(t.style,this.style),Object.keys(this.attributes)))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},E_=/[\s"'>/=\x00-\x1f]/,ER=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+En(EN(this.classes))+'"');var n=ED(this.style);for(var r of(n&&(t+=' style="'+En(n)+'"'),Object.keys(this.attributes))){if(E_.test(r))throw new O6("Invalid attribute name '"+r+"'");t+=" "+r+'="'+En(this.attributes[r])+'"'}t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+("</"+e+">")};class Ez{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,EI.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return EL.call(this,"span")}toMarkup(){return ER.call(this,"span")}}class EP{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,EI.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return EL.call(this,"a")}toMarkup(){return ER.call(this,"a")}}class EB{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){var e='<img src="'+En(this.src)+'" alt="'+En(this.alt)+'"',t=ED(this.style);return t&&(e+=' style="'+En(t)+'"'),e+="'/>"}}var EF={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class EH{constructor(e,t,n,r,i,o,l,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=o||0,this.classes=l||[],this.style=s||{},this.maxFontSize=0;var a=function(e){for(var t=0;t<Ev.length;t++)for(var n=Ev[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}(this.text.charCodeAt(0));a&&this.classes.push(a+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=EF[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return(this.italic>0&&((t=document.createElement("span")).style.marginRight=EE(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=EN(this.classes)),Object.keys(this.style).length>0&&Object.assign((t=t||document.createElement("span")).style,this.style),t)?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=En(EN(this.classes)),t+='"');var n="";this.italic>0&&(n+="margin-right:"+EE(this.italic)+";"),(n+=ED(this.style))&&(e=!0,t+=' style="'+En(n)+'"');var r=En(this.text);return e?(t+=">",t+=r,t+="</span>"):r}}class Eq{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t of Object.keys(this.attributes))e+=" "+t+'="'+En(this.attributes[t])+'"';e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+"</svg>"}}class Ej{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",Ek[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+En(this.alternate)+'"/>':'<path d="'+En(Ek[this.pathName])+'"/>'}}class EV{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t of Object.keys(this.attributes))e+=" "+t+'="'+En(this.attributes[t])+'"';return e+"/>"}}var E$={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},EW={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},EU={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function EG(e,t,n){if(!E$[t])throw Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),i=E$[t][r];if(!i&&e[0]in EU&&(r=EU[e[0]].charCodeAt(0),i=E$[t][r]),!i&&"text"===n&&Eb(r)&&(i=E$[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var EK={},EJ={math:{},text:{}};function EZ(e,t,n,r,i,o){EJ[e][i]={font:t,group:n,replace:r},o&&r&&(EJ[e][r]=EJ[e][i])}var EY="math",EX="text",EQ="main",E0="accent-token",E1="close",E4="inner",E5="mathord",E2="op-token",E3="open",E7="punct",E6="spacing",E8="textord";EZ(EY,EQ,"rel","≡","\\equiv",!0),EZ(EY,EQ,"rel","≺","\\prec",!0),EZ(EY,EQ,"rel","≻","\\succ",!0),EZ(EY,EQ,"rel","∼","\\sim",!0),EZ(EY,EQ,"rel","⊥","\\perp"),EZ(EY,EQ,"rel","⪯","\\preceq",!0),EZ(EY,EQ,"rel","⪰","\\succeq",!0),EZ(EY,EQ,"rel","≃","\\simeq",!0),EZ(EY,EQ,"rel","∣","\\mid",!0),EZ(EY,EQ,"rel","≪","\\ll",!0),EZ(EY,EQ,"rel","≫","\\gg",!0),EZ(EY,EQ,"rel","≍","\\asymp",!0),EZ(EY,EQ,"rel","∥","\\parallel"),EZ(EY,EQ,"rel","⋈","\\bowtie",!0),EZ(EY,EQ,"rel","⌣","\\smile",!0),EZ(EY,EQ,"rel","⊑","\\sqsubseteq",!0),EZ(EY,EQ,"rel","⊒","\\sqsupseteq",!0),EZ(EY,EQ,"rel","≐","\\doteq",!0),EZ(EY,EQ,"rel","⌢","\\frown",!0),EZ(EY,EQ,"rel","∋","\\ni",!0),EZ(EY,EQ,"rel","∝","\\propto",!0),EZ(EY,EQ,"rel","⊢","\\vdash",!0),EZ(EY,EQ,"rel","⊣","\\dashv",!0),EZ(EY,EQ,"rel","∋","\\owns"),EZ(EY,EQ,E7,".","\\ldotp"),EZ(EY,EQ,E7,"⋅","\\cdotp"),EZ(EY,EQ,E7,"⋅","·"),EZ(EX,EQ,E8,"⋅","·"),EZ(EY,EQ,E8,"#","\\#"),EZ(EX,EQ,E8,"#","\\#"),EZ(EY,EQ,E8,"&","\\&"),EZ(EX,EQ,E8,"&","\\&"),EZ(EY,EQ,E8,"ℵ","\\aleph",!0),EZ(EY,EQ,E8,"∀","\\forall",!0),EZ(EY,EQ,E8,"ℏ","\\hbar",!0),EZ(EY,EQ,E8,"∃","\\exists",!0),EZ(EY,EQ,E8,"∇","\\nabla",!0),EZ(EY,EQ,E8,"♭","\\flat",!0),EZ(EY,EQ,E8,"ℓ","\\ell",!0),EZ(EY,EQ,E8,"♮","\\natural",!0),EZ(EY,EQ,E8,"♣","\\clubsuit",!0),EZ(EY,EQ,E8,"℘","\\wp",!0),EZ(EY,EQ,E8,"♯","\\sharp",!0),EZ(EY,EQ,E8,"♢","\\diamondsuit",!0),EZ(EY,EQ,E8,"ℜ","\\Re",!0),EZ(EY,EQ,E8,"♡","\\heartsuit",!0),EZ(EY,EQ,E8,"ℑ","\\Im",!0),EZ(EY,EQ,E8,"♠","\\spadesuit",!0),EZ(EY,EQ,E8,"§","\\S",!0),EZ(EX,EQ,E8,"§","\\S"),EZ(EY,EQ,E8,"¶","\\P",!0),EZ(EX,EQ,E8,"¶","\\P"),EZ(EY,EQ,E8,"†","\\dag"),EZ(EX,EQ,E8,"†","\\dag"),EZ(EX,EQ,E8,"†","\\textdagger"),EZ(EY,EQ,E8,"‡","\\ddag"),EZ(EX,EQ,E8,"‡","\\ddag"),EZ(EX,EQ,E8,"‡","\\textdaggerdbl"),EZ(EY,EQ,E1,"⎱","\\rmoustache",!0),EZ(EY,EQ,E3,"⎰","\\lmoustache",!0),EZ(EY,EQ,E1,"⟯","\\rgroup",!0),EZ(EY,EQ,E3,"⟮","\\lgroup",!0),EZ(EY,EQ,"bin","∓","\\mp",!0),EZ(EY,EQ,"bin","⊖","\\ominus",!0),EZ(EY,EQ,"bin","⊎","\\uplus",!0),EZ(EY,EQ,"bin","⊓","\\sqcap",!0),EZ(EY,EQ,"bin","∗","\\ast"),EZ(EY,EQ,"bin","⊔","\\sqcup",!0),EZ(EY,EQ,"bin","◯","\\bigcirc",!0),EZ(EY,EQ,"bin","∙","\\bullet",!0),EZ(EY,EQ,"bin","‡","\\ddagger"),EZ(EY,EQ,"bin","≀","\\wr",!0),EZ(EY,EQ,"bin","⨿","\\amalg"),EZ(EY,EQ,"bin","&","\\And"),EZ(EY,EQ,"rel","⟵","\\longleftarrow",!0),EZ(EY,EQ,"rel","⇐","\\Leftarrow",!0),EZ(EY,EQ,"rel","⟸","\\Longleftarrow",!0),EZ(EY,EQ,"rel","⟶","\\longrightarrow",!0),EZ(EY,EQ,"rel","⇒","\\Rightarrow",!0),EZ(EY,EQ,"rel","⟹","\\Longrightarrow",!0),EZ(EY,EQ,"rel","↔","\\leftrightarrow",!0),EZ(EY,EQ,"rel","⟷","\\longleftrightarrow",!0),EZ(EY,EQ,"rel","⇔","\\Leftrightarrow",!0),EZ(EY,EQ,"rel","⟺","\\Longleftrightarrow",!0),EZ(EY,EQ,"rel","↦","\\mapsto",!0),EZ(EY,EQ,"rel","⟼","\\longmapsto",!0),EZ(EY,EQ,"rel","↗","\\nearrow",!0),EZ(EY,EQ,"rel","↩","\\hookleftarrow",!0),EZ(EY,EQ,"rel","↪","\\hookrightarrow",!0),EZ(EY,EQ,"rel","↘","\\searrow",!0),EZ(EY,EQ,"rel","↼","\\leftharpoonup",!0),EZ(EY,EQ,"rel","⇀","\\rightharpoonup",!0),EZ(EY,EQ,"rel","↙","\\swarrow",!0),EZ(EY,EQ,"rel","↽","\\leftharpoondown",!0),EZ(EY,EQ,"rel","⇁","\\rightharpoondown",!0),EZ(EY,EQ,"rel","↖","\\nwarrow",!0),EZ(EY,EQ,"rel","⇌","\\rightleftharpoons",!0),EZ(EY,"ams","rel","≮","\\nless",!0),EZ(EY,"ams","rel","","\\@nleqslant"),EZ(EY,"ams","rel","","\\@nleqq"),EZ(EY,"ams","rel","⪇","\\lneq",!0),EZ(EY,"ams","rel","≨","\\lneqq",!0),EZ(EY,"ams","rel","","\\@lvertneqq"),EZ(EY,"ams","rel","⋦","\\lnsim",!0),EZ(EY,"ams","rel","⪉","\\lnapprox",!0),EZ(EY,"ams","rel","⊀","\\nprec",!0),EZ(EY,"ams","rel","⋠","\\npreceq",!0),EZ(EY,"ams","rel","⋨","\\precnsim",!0),EZ(EY,"ams","rel","⪹","\\precnapprox",!0),EZ(EY,"ams","rel","≁","\\nsim",!0),EZ(EY,"ams","rel","","\\@nshortmid"),EZ(EY,"ams","rel","∤","\\nmid",!0),EZ(EY,"ams","rel","⊬","\\nvdash",!0),EZ(EY,"ams","rel","⊭","\\nvDash",!0),EZ(EY,"ams","rel","⋪","\\ntriangleleft"),EZ(EY,"ams","rel","⋬","\\ntrianglelefteq",!0),EZ(EY,"ams","rel","⊊","\\subsetneq",!0),EZ(EY,"ams","rel","","\\@varsubsetneq"),EZ(EY,"ams","rel","⫋","\\subsetneqq",!0),EZ(EY,"ams","rel","","\\@varsubsetneqq"),EZ(EY,"ams","rel","≯","\\ngtr",!0),EZ(EY,"ams","rel","","\\@ngeqslant"),EZ(EY,"ams","rel","","\\@ngeqq"),EZ(EY,"ams","rel","⪈","\\gneq",!0),EZ(EY,"ams","rel","≩","\\gneqq",!0),EZ(EY,"ams","rel","","\\@gvertneqq"),EZ(EY,"ams","rel","⋧","\\gnsim",!0),EZ(EY,"ams","rel","⪊","\\gnapprox",!0),EZ(EY,"ams","rel","⊁","\\nsucc",!0),EZ(EY,"ams","rel","⋡","\\nsucceq",!0),EZ(EY,"ams","rel","⋩","\\succnsim",!0),EZ(EY,"ams","rel","⪺","\\succnapprox",!0),EZ(EY,"ams","rel","≆","\\ncong",!0),EZ(EY,"ams","rel","","\\@nshortparallel"),EZ(EY,"ams","rel","∦","\\nparallel",!0),EZ(EY,"ams","rel","⊯","\\nVDash",!0),EZ(EY,"ams","rel","⋫","\\ntriangleright"),EZ(EY,"ams","rel","⋭","\\ntrianglerighteq",!0),EZ(EY,"ams","rel","","\\@nsupseteqq"),EZ(EY,"ams","rel","⊋","\\supsetneq",!0),EZ(EY,"ams","rel","","\\@varsupsetneq"),EZ(EY,"ams","rel","⫌","\\supsetneqq",!0),EZ(EY,"ams","rel","","\\@varsupsetneqq"),EZ(EY,"ams","rel","⊮","\\nVdash",!0),EZ(EY,"ams","rel","⪵","\\precneqq",!0),EZ(EY,"ams","rel","⪶","\\succneqq",!0),EZ(EY,"ams","rel","","\\@nsubseteqq"),EZ(EY,"ams","bin","⊴","\\unlhd"),EZ(EY,"ams","bin","⊵","\\unrhd"),EZ(EY,"ams","rel","↚","\\nleftarrow",!0),EZ(EY,"ams","rel","↛","\\nrightarrow",!0),EZ(EY,"ams","rel","⇍","\\nLeftarrow",!0),EZ(EY,"ams","rel","⇏","\\nRightarrow",!0),EZ(EY,"ams","rel","↮","\\nleftrightarrow",!0),EZ(EY,"ams","rel","⇎","\\nLeftrightarrow",!0),EZ(EY,"ams","rel","△","\\vartriangle"),EZ(EY,"ams",E8,"ℏ","\\hslash"),EZ(EY,"ams",E8,"▽","\\triangledown"),EZ(EY,"ams",E8,"◊","\\lozenge"),EZ(EY,"ams",E8,"Ⓢ","\\circledS"),EZ(EY,"ams",E8,"®","\\circledR"),EZ(EX,"ams",E8,"®","\\circledR"),EZ(EY,"ams",E8,"∡","\\measuredangle",!0),EZ(EY,"ams",E8,"∄","\\nexists"),EZ(EY,"ams",E8,"℧","\\mho"),EZ(EY,"ams",E8,"Ⅎ","\\Finv",!0),EZ(EY,"ams",E8,"⅁","\\Game",!0),EZ(EY,"ams",E8,"‵","\\backprime"),EZ(EY,"ams",E8,"▲","\\blacktriangle"),EZ(EY,"ams",E8,"▼","\\blacktriangledown"),EZ(EY,"ams",E8,"■","\\blacksquare"),EZ(EY,"ams",E8,"⧫","\\blacklozenge"),EZ(EY,"ams",E8,"★","\\bigstar"),EZ(EY,"ams",E8,"∢","\\sphericalangle",!0),EZ(EY,"ams",E8,"∁","\\complement",!0),EZ(EY,"ams",E8,"ð","\\eth",!0),EZ(EX,EQ,E8,"ð","ð"),EZ(EY,"ams",E8,"╱","\\diagup"),EZ(EY,"ams",E8,"╲","\\diagdown"),EZ(EY,"ams",E8,"□","\\square"),EZ(EY,"ams",E8,"□","\\Box"),EZ(EY,"ams",E8,"◊","\\Diamond"),EZ(EY,"ams",E8,"¥","\\yen",!0),EZ(EX,"ams",E8,"¥","\\yen",!0),EZ(EY,"ams",E8,"✓","\\checkmark",!0),EZ(EX,"ams",E8,"✓","\\checkmark"),EZ(EY,"ams",E8,"ℶ","\\beth",!0),EZ(EY,"ams",E8,"ℸ","\\daleth",!0),EZ(EY,"ams",E8,"ℷ","\\gimel",!0),EZ(EY,"ams",E8,"ϝ","\\digamma",!0),EZ(EY,"ams",E8,"ϰ","\\varkappa"),EZ(EY,"ams",E3,"┌","\\@ulcorner",!0),EZ(EY,"ams",E1,"┐","\\@urcorner",!0),EZ(EY,"ams",E3,"└","\\@llcorner",!0),EZ(EY,"ams",E1,"┘","\\@lrcorner",!0),EZ(EY,"ams","rel","≦","\\leqq",!0),EZ(EY,"ams","rel","⩽","\\leqslant",!0),EZ(EY,"ams","rel","⪕","\\eqslantless",!0),EZ(EY,"ams","rel","≲","\\lesssim",!0),EZ(EY,"ams","rel","⪅","\\lessapprox",!0),EZ(EY,"ams","rel","≊","\\approxeq",!0),EZ(EY,"ams","bin","⋖","\\lessdot"),EZ(EY,"ams","rel","⋘","\\lll",!0),EZ(EY,"ams","rel","≶","\\lessgtr",!0),EZ(EY,"ams","rel","⋚","\\lesseqgtr",!0),EZ(EY,"ams","rel","⪋","\\lesseqqgtr",!0),EZ(EY,"ams","rel","≑","\\doteqdot"),EZ(EY,"ams","rel","≓","\\risingdotseq",!0),EZ(EY,"ams","rel","≒","\\fallingdotseq",!0),EZ(EY,"ams","rel","∽","\\backsim",!0),EZ(EY,"ams","rel","⋍","\\backsimeq",!0),EZ(EY,"ams","rel","⫅","\\subseteqq",!0),EZ(EY,"ams","rel","⋐","\\Subset",!0),EZ(EY,"ams","rel","⊏","\\sqsubset",!0),EZ(EY,"ams","rel","≼","\\preccurlyeq",!0),EZ(EY,"ams","rel","⋞","\\curlyeqprec",!0),EZ(EY,"ams","rel","≾","\\precsim",!0),EZ(EY,"ams","rel","⪷","\\precapprox",!0),EZ(EY,"ams","rel","⊲","\\vartriangleleft"),EZ(EY,"ams","rel","⊴","\\trianglelefteq"),EZ(EY,"ams","rel","⊨","\\vDash",!0),EZ(EY,"ams","rel","⊪","\\Vvdash",!0),EZ(EY,"ams","rel","⌣","\\smallsmile"),EZ(EY,"ams","rel","⌢","\\smallfrown"),EZ(EY,"ams","rel","≏","\\bumpeq",!0),EZ(EY,"ams","rel","≎","\\Bumpeq",!0),EZ(EY,"ams","rel","≧","\\geqq",!0),EZ(EY,"ams","rel","⩾","\\geqslant",!0),EZ(EY,"ams","rel","⪖","\\eqslantgtr",!0),EZ(EY,"ams","rel","≳","\\gtrsim",!0),EZ(EY,"ams","rel","⪆","\\gtrapprox",!0),EZ(EY,"ams","bin","⋗","\\gtrdot"),EZ(EY,"ams","rel","⋙","\\ggg",!0),EZ(EY,"ams","rel","≷","\\gtrless",!0),EZ(EY,"ams","rel","⋛","\\gtreqless",!0),EZ(EY,"ams","rel","⪌","\\gtreqqless",!0),EZ(EY,"ams","rel","≖","\\eqcirc",!0),EZ(EY,"ams","rel","≗","\\circeq",!0),EZ(EY,"ams","rel","≜","\\triangleq",!0),EZ(EY,"ams","rel","∼","\\thicksim"),EZ(EY,"ams","rel","≈","\\thickapprox"),EZ(EY,"ams","rel","⫆","\\supseteqq",!0),EZ(EY,"ams","rel","⋑","\\Supset",!0),EZ(EY,"ams","rel","⊐","\\sqsupset",!0),EZ(EY,"ams","rel","≽","\\succcurlyeq",!0),EZ(EY,"ams","rel","⋟","\\curlyeqsucc",!0),EZ(EY,"ams","rel","≿","\\succsim",!0),EZ(EY,"ams","rel","⪸","\\succapprox",!0),EZ(EY,"ams","rel","⊳","\\vartriangleright"),EZ(EY,"ams","rel","⊵","\\trianglerighteq"),EZ(EY,"ams","rel","⊩","\\Vdash",!0),EZ(EY,"ams","rel","∣","\\shortmid"),EZ(EY,"ams","rel","∥","\\shortparallel"),EZ(EY,"ams","rel","≬","\\between",!0),EZ(EY,"ams","rel","⋔","\\pitchfork",!0),EZ(EY,"ams","rel","∝","\\varpropto"),EZ(EY,"ams","rel","◀","\\blacktriangleleft"),EZ(EY,"ams","rel","∴","\\therefore",!0),EZ(EY,"ams","rel","∍","\\backepsilon"),EZ(EY,"ams","rel","▶","\\blacktriangleright"),EZ(EY,"ams","rel","∵","\\because",!0),EZ(EY,"ams","rel","⋘","\\llless"),EZ(EY,"ams","rel","⋙","\\gggtr"),EZ(EY,"ams","bin","⊲","\\lhd"),EZ(EY,"ams","bin","⊳","\\rhd"),EZ(EY,"ams","rel","≂","\\eqsim",!0),EZ(EY,EQ,"rel","⋈","\\Join"),EZ(EY,"ams","rel","≑","\\Doteq",!0),EZ(EY,"ams","bin","∔","\\dotplus",!0),EZ(EY,"ams","bin","∖","\\smallsetminus"),EZ(EY,"ams","bin","⋒","\\Cap",!0),EZ(EY,"ams","bin","⋓","\\Cup",!0),EZ(EY,"ams","bin","⩞","\\doublebarwedge",!0),EZ(EY,"ams","bin","⊟","\\boxminus",!0),EZ(EY,"ams","bin","⊞","\\boxplus",!0),EZ(EY,"ams","bin","⋇","\\divideontimes",!0),EZ(EY,"ams","bin","⋉","\\ltimes",!0),EZ(EY,"ams","bin","⋊","\\rtimes",!0),EZ(EY,"ams","bin","⋋","\\leftthreetimes",!0),EZ(EY,"ams","bin","⋌","\\rightthreetimes",!0),EZ(EY,"ams","bin","⋏","\\curlywedge",!0),EZ(EY,"ams","bin","⋎","\\curlyvee",!0),EZ(EY,"ams","bin","⊝","\\circleddash",!0),EZ(EY,"ams","bin","⊛","\\circledast",!0),EZ(EY,"ams","bin","⋅","\\centerdot"),EZ(EY,"ams","bin","⊺","\\intercal",!0),EZ(EY,"ams","bin","⋒","\\doublecap"),EZ(EY,"ams","bin","⋓","\\doublecup"),EZ(EY,"ams","bin","⊠","\\boxtimes",!0),EZ(EY,"ams","rel","⇢","\\dashrightarrow",!0),EZ(EY,"ams","rel","⇠","\\dashleftarrow",!0),EZ(EY,"ams","rel","⇇","\\leftleftarrows",!0),EZ(EY,"ams","rel","⇆","\\leftrightarrows",!0),EZ(EY,"ams","rel","⇚","\\Lleftarrow",!0),EZ(EY,"ams","rel","↞","\\twoheadleftarrow",!0),EZ(EY,"ams","rel","↢","\\leftarrowtail",!0),EZ(EY,"ams","rel","↫","\\looparrowleft",!0),EZ(EY,"ams","rel","⇋","\\leftrightharpoons",!0),EZ(EY,"ams","rel","↶","\\curvearrowleft",!0),EZ(EY,"ams","rel","↺","\\circlearrowleft",!0),EZ(EY,"ams","rel","↰","\\Lsh",!0),EZ(EY,"ams","rel","⇈","\\upuparrows",!0),EZ(EY,"ams","rel","↿","\\upharpoonleft",!0),EZ(EY,"ams","rel","⇃","\\downharpoonleft",!0),EZ(EY,EQ,"rel","⊶","\\origof",!0),EZ(EY,EQ,"rel","⊷","\\imageof",!0),EZ(EY,"ams","rel","⊸","\\multimap",!0),EZ(EY,"ams","rel","↭","\\leftrightsquigarrow",!0),EZ(EY,"ams","rel","⇉","\\rightrightarrows",!0),EZ(EY,"ams","rel","⇄","\\rightleftarrows",!0),EZ(EY,"ams","rel","↠","\\twoheadrightarrow",!0),EZ(EY,"ams","rel","↣","\\rightarrowtail",!0),EZ(EY,"ams","rel","↬","\\looparrowright",!0),EZ(EY,"ams","rel","↷","\\curvearrowright",!0),EZ(EY,"ams","rel","↻","\\circlearrowright",!0),EZ(EY,"ams","rel","↱","\\Rsh",!0),EZ(EY,"ams","rel","⇊","\\downdownarrows",!0),EZ(EY,"ams","rel","↾","\\upharpoonright",!0),EZ(EY,"ams","rel","⇂","\\downharpoonright",!0),EZ(EY,"ams","rel","⇝","\\rightsquigarrow",!0),EZ(EY,"ams","rel","⇝","\\leadsto"),EZ(EY,"ams","rel","⇛","\\Rrightarrow",!0),EZ(EY,"ams","rel","↾","\\restriction"),EZ(EY,EQ,E8,"‘","`"),EZ(EY,EQ,E8,"$","\\$"),EZ(EX,EQ,E8,"$","\\$"),EZ(EX,EQ,E8,"$","\\textdollar"),EZ(EY,EQ,E8,"%","\\%"),EZ(EX,EQ,E8,"%","\\%"),EZ(EY,EQ,E8,"_","\\_"),EZ(EX,EQ,E8,"_","\\_"),EZ(EX,EQ,E8,"_","\\textunderscore"),EZ(EY,EQ,E8,"∠","\\angle",!0),EZ(EY,EQ,E8,"∞","\\infty",!0),EZ(EY,EQ,E8,"′","\\prime"),EZ(EY,EQ,E8,"△","\\triangle"),EZ(EY,EQ,E8,"Γ","\\Gamma",!0),EZ(EY,EQ,E8,"Δ","\\Delta",!0),EZ(EY,EQ,E8,"Θ","\\Theta",!0),EZ(EY,EQ,E8,"Λ","\\Lambda",!0),EZ(EY,EQ,E8,"Ξ","\\Xi",!0),EZ(EY,EQ,E8,"Π","\\Pi",!0),EZ(EY,EQ,E8,"Σ","\\Sigma",!0),EZ(EY,EQ,E8,"Υ","\\Upsilon",!0),EZ(EY,EQ,E8,"Φ","\\Phi",!0),EZ(EY,EQ,E8,"Ψ","\\Psi",!0),EZ(EY,EQ,E8,"Ω","\\Omega",!0),EZ(EY,EQ,E8,"A","Α"),EZ(EY,EQ,E8,"B","Β"),EZ(EY,EQ,E8,"E","Ε"),EZ(EY,EQ,E8,"Z","Ζ"),EZ(EY,EQ,E8,"H","Η"),EZ(EY,EQ,E8,"I","Ι"),EZ(EY,EQ,E8,"K","Κ"),EZ(EY,EQ,E8,"M","Μ"),EZ(EY,EQ,E8,"N","Ν"),EZ(EY,EQ,E8,"O","Ο"),EZ(EY,EQ,E8,"P","Ρ"),EZ(EY,EQ,E8,"T","Τ"),EZ(EY,EQ,E8,"X","Χ"),EZ(EY,EQ,E8,"¬","\\neg",!0),EZ(EY,EQ,E8,"¬","\\lnot"),EZ(EY,EQ,E8,"⊤","\\top"),EZ(EY,EQ,E8,"⊥","\\bot"),EZ(EY,EQ,E8,"∅","\\emptyset"),EZ(EY,"ams",E8,"∅","\\varnothing"),EZ(EY,EQ,E5,"α","\\alpha",!0),EZ(EY,EQ,E5,"β","\\beta",!0),EZ(EY,EQ,E5,"γ","\\gamma",!0),EZ(EY,EQ,E5,"δ","\\delta",!0),EZ(EY,EQ,E5,"ϵ","\\epsilon",!0),EZ(EY,EQ,E5,"ζ","\\zeta",!0),EZ(EY,EQ,E5,"η","\\eta",!0),EZ(EY,EQ,E5,"θ","\\theta",!0),EZ(EY,EQ,E5,"ι","\\iota",!0),EZ(EY,EQ,E5,"κ","\\kappa",!0),EZ(EY,EQ,E5,"λ","\\lambda",!0),EZ(EY,EQ,E5,"μ","\\mu",!0),EZ(EY,EQ,E5,"ν","\\nu",!0),EZ(EY,EQ,E5,"ξ","\\xi",!0),EZ(EY,EQ,E5,"ο","\\omicron",!0),EZ(EY,EQ,E5,"π","\\pi",!0),EZ(EY,EQ,E5,"ρ","\\rho",!0),EZ(EY,EQ,E5,"σ","\\sigma",!0),EZ(EY,EQ,E5,"τ","\\tau",!0),EZ(EY,EQ,E5,"υ","\\upsilon",!0),EZ(EY,EQ,E5,"ϕ","\\phi",!0),EZ(EY,EQ,E5,"χ","\\chi",!0),EZ(EY,EQ,E5,"ψ","\\psi",!0),EZ(EY,EQ,E5,"ω","\\omega",!0),EZ(EY,EQ,E5,"ε","\\varepsilon",!0),EZ(EY,EQ,E5,"ϑ","\\vartheta",!0),EZ(EY,EQ,E5,"ϖ","\\varpi",!0),EZ(EY,EQ,E5,"ϱ","\\varrho",!0),EZ(EY,EQ,E5,"ς","\\varsigma",!0),EZ(EY,EQ,E5,"φ","\\varphi",!0),EZ(EY,EQ,"bin","∗","*",!0),EZ(EY,EQ,"bin","+","+"),EZ(EY,EQ,"bin","−","-",!0),EZ(EY,EQ,"bin","⋅","\\cdot",!0),EZ(EY,EQ,"bin","∘","\\circ",!0),EZ(EY,EQ,"bin","÷","\\div",!0),EZ(EY,EQ,"bin","±","\\pm",!0),EZ(EY,EQ,"bin","×","\\times",!0),EZ(EY,EQ,"bin","∩","\\cap",!0),EZ(EY,EQ,"bin","∪","\\cup",!0),EZ(EY,EQ,"bin","∖","\\setminus",!0),EZ(EY,EQ,"bin","∧","\\land"),EZ(EY,EQ,"bin","∨","\\lor"),EZ(EY,EQ,"bin","∧","\\wedge",!0),EZ(EY,EQ,"bin","∨","\\vee",!0),EZ(EY,EQ,E8,"√","\\surd"),EZ(EY,EQ,E3,"⟨","\\langle",!0),EZ(EY,EQ,E3,"∣","\\lvert"),EZ(EY,EQ,E3,"∥","\\lVert"),EZ(EY,EQ,E1,"?","?"),EZ(EY,EQ,E1,"!","!"),EZ(EY,EQ,E1,"⟩","\\rangle",!0),EZ(EY,EQ,E1,"∣","\\rvert"),EZ(EY,EQ,E1,"∥","\\rVert"),EZ(EY,EQ,"rel","=","="),EZ(EY,EQ,"rel",":",":"),EZ(EY,EQ,"rel","≈","\\approx",!0),EZ(EY,EQ,"rel","≅","\\cong",!0),EZ(EY,EQ,"rel","≥","\\ge"),EZ(EY,EQ,"rel","≥","\\geq",!0),EZ(EY,EQ,"rel","←","\\gets"),EZ(EY,EQ,"rel",">","\\gt",!0),EZ(EY,EQ,"rel","∈","\\in",!0),EZ(EY,EQ,"rel","","\\@not"),EZ(EY,EQ,"rel","⊂","\\subset",!0),EZ(EY,EQ,"rel","⊃","\\supset",!0),EZ(EY,EQ,"rel","⊆","\\subseteq",!0),EZ(EY,EQ,"rel","⊇","\\supseteq",!0),EZ(EY,"ams","rel","⊈","\\nsubseteq",!0),EZ(EY,"ams","rel","⊉","\\nsupseteq",!0),EZ(EY,EQ,"rel","⊨","\\models"),EZ(EY,EQ,"rel","←","\\leftarrow",!0),EZ(EY,EQ,"rel","≤","\\le"),EZ(EY,EQ,"rel","≤","\\leq",!0),EZ(EY,EQ,"rel","<","\\lt",!0),EZ(EY,EQ,"rel","→","\\rightarrow",!0),EZ(EY,EQ,"rel","→","\\to"),EZ(EY,"ams","rel","≱","\\ngeq",!0),EZ(EY,"ams","rel","≰","\\nleq",!0),EZ(EY,EQ,E6," ","\\ "),EZ(EY,EQ,E6," ","\\space"),EZ(EY,EQ,E6," ","\\nobreakspace"),EZ(EX,EQ,E6," ","\\ "),EZ(EX,EQ,E6," "," "),EZ(EX,EQ,E6," ","\\space"),EZ(EX,EQ,E6," ","\\nobreakspace"),EZ(EY,EQ,E6,"","\\nobreak"),EZ(EY,EQ,E6,"","\\allowbreak"),EZ(EY,EQ,E7,",",","),EZ(EY,EQ,E7,";",";"),EZ(EY,"ams","bin","⊼","\\barwedge",!0),EZ(EY,"ams","bin","⊻","\\veebar",!0),EZ(EY,EQ,"bin","⊙","\\odot",!0),EZ(EY,EQ,"bin","⊕","\\oplus",!0),EZ(EY,EQ,"bin","⊗","\\otimes",!0),EZ(EY,EQ,E8,"∂","\\partial",!0),EZ(EY,EQ,"bin","⊘","\\oslash",!0),EZ(EY,"ams","bin","⊚","\\circledcirc",!0),EZ(EY,"ams","bin","⊡","\\boxdot",!0),EZ(EY,EQ,"bin","△","\\bigtriangleup"),EZ(EY,EQ,"bin","▽","\\bigtriangledown"),EZ(EY,EQ,"bin","†","\\dagger"),EZ(EY,EQ,"bin","⋄","\\diamond"),EZ(EY,EQ,"bin","⋆","\\star"),EZ(EY,EQ,"bin","◃","\\triangleleft"),EZ(EY,EQ,"bin","▹","\\triangleright"),EZ(EY,EQ,E3,"{","\\{"),EZ(EX,EQ,E8,"{","\\{"),EZ(EX,EQ,E8,"{","\\textbraceleft"),EZ(EY,EQ,E1,"}","\\}"),EZ(EX,EQ,E8,"}","\\}"),EZ(EX,EQ,E8,"}","\\textbraceright"),EZ(EY,EQ,E3,"{","\\lbrace"),EZ(EY,EQ,E1,"}","\\rbrace"),EZ(EY,EQ,E3,"[","\\lbrack",!0),EZ(EX,EQ,E8,"[","\\lbrack",!0),EZ(EY,EQ,E1,"]","\\rbrack",!0),EZ(EX,EQ,E8,"]","\\rbrack",!0),EZ(EY,EQ,E3,"(","\\lparen",!0),EZ(EY,EQ,E1,")","\\rparen",!0),EZ(EX,EQ,E8,"<","\\textless",!0),EZ(EX,EQ,E8,">","\\textgreater",!0),EZ(EY,EQ,E3,"⌊","\\lfloor",!0),EZ(EY,EQ,E1,"⌋","\\rfloor",!0),EZ(EY,EQ,E3,"⌈","\\lceil",!0),EZ(EY,EQ,E1,"⌉","\\rceil",!0),EZ(EY,EQ,E8,"\\","\\backslash"),EZ(EY,EQ,E8,"∣","|"),EZ(EY,EQ,E8,"∣","\\vert"),EZ(EX,EQ,E8,"|","\\textbar",!0),EZ(EY,EQ,E8,"∥","\\|"),EZ(EY,EQ,E8,"∥","\\Vert"),EZ(EX,EQ,E8,"∥","\\textbardbl"),EZ(EX,EQ,E8,"~","\\textasciitilde"),EZ(EX,EQ,E8,"\\","\\textbackslash"),EZ(EX,EQ,E8,"^","\\textasciicircum"),EZ(EY,EQ,"rel","↑","\\uparrow",!0),EZ(EY,EQ,"rel","⇑","\\Uparrow",!0),EZ(EY,EQ,"rel","↓","\\downarrow",!0),EZ(EY,EQ,"rel","⇓","\\Downarrow",!0),EZ(EY,EQ,"rel","↕","\\updownarrow",!0),EZ(EY,EQ,"rel","⇕","\\Updownarrow",!0),EZ(EY,EQ,E2,"∐","\\coprod"),EZ(EY,EQ,E2,"⋁","\\bigvee"),EZ(EY,EQ,E2,"⋀","\\bigwedge"),EZ(EY,EQ,E2,"⨄","\\biguplus"),EZ(EY,EQ,E2,"⋂","\\bigcap"),EZ(EY,EQ,E2,"⋃","\\bigcup"),EZ(EY,EQ,E2,"∫","\\int"),EZ(EY,EQ,E2,"∫","\\intop"),EZ(EY,EQ,E2,"∬","\\iint"),EZ(EY,EQ,E2,"∭","\\iiint"),EZ(EY,EQ,E2,"∏","\\prod"),EZ(EY,EQ,E2,"∑","\\sum"),EZ(EY,EQ,E2,"⨂","\\bigotimes"),EZ(EY,EQ,E2,"⨁","\\bigoplus"),EZ(EY,EQ,E2,"⨀","\\bigodot"),EZ(EY,EQ,E2,"∮","\\oint"),EZ(EY,EQ,E2,"∯","\\oiint"),EZ(EY,EQ,E2,"∰","\\oiiint"),EZ(EY,EQ,E2,"⨆","\\bigsqcup"),EZ(EY,EQ,E2,"∫","\\smallint"),EZ(EX,EQ,E4,"…","\\textellipsis"),EZ(EY,EQ,E4,"…","\\mathellipsis"),EZ(EX,EQ,E4,"…","\\ldots",!0),EZ(EY,EQ,E4,"…","\\ldots",!0),EZ(EY,EQ,E4,"⋯","\\@cdots",!0),EZ(EY,EQ,E4,"⋱","\\ddots",!0),EZ(EY,EQ,E8,"⋮","\\varvdots"),EZ(EX,EQ,E8,"⋮","\\varvdots"),EZ(EY,EQ,E0,"ˊ","\\acute"),EZ(EY,EQ,E0,"ˋ","\\grave"),EZ(EY,EQ,E0,"¨","\\ddot"),EZ(EY,EQ,E0,"~","\\tilde"),EZ(EY,EQ,E0,"ˉ","\\bar"),EZ(EY,EQ,E0,"˘","\\breve"),EZ(EY,EQ,E0,"ˇ","\\check"),EZ(EY,EQ,E0,"^","\\hat"),EZ(EY,EQ,E0,"⃗","\\vec"),EZ(EY,EQ,E0,"˙","\\dot"),EZ(EY,EQ,E0,"˚","\\mathring"),EZ(EY,EQ,E5,"","\\@imath"),EZ(EY,EQ,E5,"","\\@jmath"),EZ(EY,EQ,E8,"ı","ı"),EZ(EY,EQ,E8,"ȷ","ȷ"),EZ(EX,EQ,E8,"ı","\\i",!0),EZ(EX,EQ,E8,"ȷ","\\j",!0),EZ(EX,EQ,E8,"ß","\\ss",!0),EZ(EX,EQ,E8,"æ","\\ae",!0),EZ(EX,EQ,E8,"œ","\\oe",!0),EZ(EX,EQ,E8,"ø","\\o",!0),EZ(EX,EQ,E8,"Æ","\\AE",!0),EZ(EX,EQ,E8,"Œ","\\OE",!0),EZ(EX,EQ,E8,"Ø","\\O",!0),EZ(EX,EQ,E0,"ˊ","\\'"),EZ(EX,EQ,E0,"ˋ","\\`"),EZ(EX,EQ,E0,"ˆ","\\^"),EZ(EX,EQ,E0,"˜","\\~"),EZ(EX,EQ,E0,"ˉ","\\="),EZ(EX,EQ,E0,"˘","\\u"),EZ(EX,EQ,E0,"˙","\\."),EZ(EX,EQ,E0,"¸","\\c"),EZ(EX,EQ,E0,"˚","\\r"),EZ(EX,EQ,E0,"ˇ","\\v"),EZ(EX,EQ,E0,"¨",'\\"'),EZ(EX,EQ,E0,"˝","\\H"),EZ(EX,EQ,E0,"◯","\\textcircled");var E9={"--":!0,"---":!0,"``":!0,"''":!0};EZ(EX,EQ,E8,"–","--",!0),EZ(EX,EQ,E8,"–","\\textendash"),EZ(EX,EQ,E8,"—","---",!0),EZ(EX,EQ,E8,"—","\\textemdash"),EZ(EX,EQ,E8,"‘","`",!0),EZ(EX,EQ,E8,"‘","\\textquoteleft"),EZ(EX,EQ,E8,"’","'",!0),EZ(EX,EQ,E8,"’","\\textquoteright"),EZ(EX,EQ,E8,"“","``",!0),EZ(EX,EQ,E8,"“","\\textquotedblleft"),EZ(EX,EQ,E8,"”","''",!0),EZ(EX,EQ,E8,"”","\\textquotedblright"),EZ(EY,EQ,E8,"°","\\degree",!0),EZ(EX,EQ,E8,"°","\\degree"),EZ(EX,EQ,E8,"°","\\textdegree",!0),EZ(EY,EQ,E8,"£","\\pounds"),EZ(EY,EQ,E8,"£","\\mathsterling",!0),EZ(EX,EQ,E8,"£","\\pounds"),EZ(EX,EQ,E8,"£","\\textsterling",!0),EZ(EY,"ams",E8,"✠","\\maltese"),EZ(EX,"ams",E8,"✠","\\maltese");for(var Ne='0123456789/@."',Nt=0;Nt<Ne.length;Nt++){var Nn=Ne.charAt(Nt);EZ(EY,EQ,E8,Nn,Nn)}for(var Nr='0123456789!@*()-=+";:?/.,',Ni=0;Ni<Nr.length;Ni++){var No=Nr.charAt(Ni);EZ(EX,EQ,E8,No,No)}for(var Nl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ns=0;Ns<Nl.length;Ns++){var Na=Nl.charAt(Ns);EZ(EY,EQ,E5,Na,Na),EZ(EX,EQ,E8,Na,Na)}EZ(EY,"ams",E8,"C","ℂ"),EZ(EX,"ams",E8,"C","ℂ"),EZ(EY,"ams",E8,"H","ℍ"),EZ(EX,"ams",E8,"H","ℍ"),EZ(EY,"ams",E8,"N","ℕ"),EZ(EX,"ams",E8,"N","ℕ"),EZ(EY,"ams",E8,"P","ℙ"),EZ(EX,"ams",E8,"P","ℙ"),EZ(EY,"ams",E8,"Q","ℚ"),EZ(EX,"ams",E8,"Q","ℚ"),EZ(EY,"ams",E8,"R","ℝ"),EZ(EX,"ams",E8,"R","ℝ"),EZ(EY,"ams",E8,"Z","ℤ"),EZ(EX,"ams",E8,"Z","ℤ"),EZ(EY,EQ,E5,"h","ℎ"),EZ(EX,EQ,E5,"h","ℎ");for(var Nc=0;Nc<Nl.length;Nc++){var Nu=Nl.charAt(Nc);EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56320+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56372+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56424+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56580+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56684+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56736+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56788+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56840+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56944+Nc)),EZ(EX,EQ,E8,Nu,B),Nc<26&&(EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56632+Nc)),EZ(EX,EQ,E8,Nu,B),EZ(EY,EQ,E5,Nu,B=String.fromCharCode(55349,56476+Nc)),EZ(EX,EQ,E8,Nu,B))}EZ(EY,EQ,E5,"k",B=String.fromCharCode(55349,56668)),EZ(EX,EQ,E8,"k",B);for(var Nh=0;Nh<10;Nh++){var Nd=Nh.toString();EZ(EY,EQ,E5,Nd,B=String.fromCharCode(55349,57294+Nh)),EZ(EX,EQ,E8,Nd,B),EZ(EY,EQ,E5,Nd,B=String.fromCharCode(55349,57314+Nh)),EZ(EX,EQ,E8,Nd,B),EZ(EY,EQ,E5,Nd,B=String.fromCharCode(55349,57324+Nh)),EZ(EX,EQ,E8,Nd,B),EZ(EY,EQ,E5,Nd,B=String.fromCharCode(55349,57334+Nh)),EZ(EX,EQ,E8,Nd,B)}for(var Np="ÐÞþ",Nf=0;Nf<Np.length;Nf++){var Nm=Np.charAt(Nf);EZ(EY,EQ,E5,Nm,Nm),EZ(EX,EQ,E8,Nm,Nm)}var Ng={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Nv={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Ny={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},Nb={mathClass:"",textClass:"",font:""},Nw={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},Nx={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Nk={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},NC={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},NS={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},NM={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},NA={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},NT=[Ng,Ng,Nv,Nv,Ny,Ny,{mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Nb,Nb,Nb,Nw,Nw,Nx,Nx,Nk,Nk,NC,NC,NS,NS,NM,NM,Nb,Nb,NA,NA],NO=[Ng,Nb,NC,NS,NA],NE=function(e,t,n){if(EJ[n][e]){var r=EJ[n][e].replace;r&&(e=r)}return{value:e,metrics:EG(e,t,n)}},NN=function(e,t,n,r,i){var o,l=NE(e,t,n),s=l.metrics;if(e=l.value,s){var a=s.italic;("text"===n||r&&"mathit"===r.font)&&(a=0),o=new EH(e,s.height,s.depth,a,s.skew,s.width,i)}else"u">typeof console&&console.warn("No character metrics "+("for '"+e+"' in style '"+t+"' and mode '")+n+"'"),o=new EH(e,0,0,0,0,0,i);if(r){o.maxFontSize=r.sizeMultiplier,r.style.isTight()&&o.classes.push("mtight");var c=r.getColor();c&&(o.style.color=c)}return o},ND=function(e,t,n,r){return(void 0===r&&(r=[]),"boldsymbol"===n.font&&NE(e,"Main-Bold",t).metrics)?NN(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===EJ[t][e].font?NN(e,"Main-Regular",t,n,r):NN(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},NI=function(e,t){var n="mathord"===e.type?"mathord":"textord",r=e.mode,i=e.text,o=["mord"],{font:l,fontFamily:s,fontWeight:a,fontShape:c}=t,u="math"===r||"text"===r&&!!l,h=u?l:s,d="",p="";if(55349===i.charCodeAt(0)){var f=(e=>{var t=(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320)+65536;if(119808<=t&&t<120484)return NT[Math.floor((t-119808)/26)];if(120782<=t&&t<=120831)return NO[Math.floor((t-120782)/10)];if(120485===t||120486===t)return NT[0];if(120486<t&&t<120782)return Nb;throw new O6("Unsupported character: "+e)})(i);d=f.font,p=f[r+"Class"]}if(d)return NN(i,d,r,t,o.concat(p));if(h){if("boldsymbol"===h){var m,g,y="textord"!==n&&NE(i,"Math-BoldItalic",r).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"};m=y.fontName,g=[y.fontClass]}else u?(m=NU[l].fontName,g=[l]):(m=NW(s,a,c),g=[s,a,c]);if(NE(i,m,r).metrics)return NN(i,m,r,t,o.concat(g));if(E9.hasOwnProperty(i)&&"Typewriter"===m.slice(0,10)){for(var b=[],w=0;w<i.length;w++)b.push(NN(i[w],m,r,t,o.concat(g)));return NH(b)}}if("mathord"===n)return NN(i,"Math-Italic",r,t,o.concat(["mathnormal"]));if("textord"===n){var x=EJ[r][i]&&EJ[r][i].font;if("ams"===x)return NN(i,NW("amsrm",a,c),r,t,o.concat("amsrm",a,c));if("main"===x||!x)return NN(i,NW("textrm",a,c),r,t,o.concat(a,c));var k=NW(x,a,c);return NN(i,k,r,t,o.concat(k,a,c))}throw Error("unexpected type: "+n+" in makeOrd")},NL=(e,t)=>{if(EN(e.classes)!==EN(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||0!==e.italic&&e.hasClass("mathnormal"))return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},N_=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof EH&&r instanceof EH&&NL(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},NR=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var o=e.children[i];o.height>t&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>r&&(r=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},Nz=function(e,t,n,r){var i=new Ez(e,t,n,r);return NR(i),i},NP=(e,t,n,r)=>new Ez(e,t,n,r),NB=function(e,t,n){var r=Nz([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=EE(r.height),r.maxFontSize=1,r},NF=function(e,t,n,r){var i=new EP(e,t,n,r);return NR(i),i},NH=function(e){var t=new ES(e);return NR(t),t},Nq=function(e,t){return e instanceof ES?Nz([],[e],t):e},Nj=function(e){if("individualShift"===e.positionType){for(var t,n=e.children,r=[n[0]],i=-n[0].shift-n[0].elem.depth,o=i,l=1;l<n.length;l++){var s=-n[l].shift-o-n[l].elem.depth,a=s-(n[l-1].elem.height+n[l-1].elem.depth);o+=s,r.push({type:"kern",size:a}),r.push(n[l])}return{children:r,depth:i}}if("top"===e.positionType){for(var c=e.positionData,u=0;u<e.children.length;u++){var h=e.children[u];c-="kern"===h.type?h.size:h.elem.height+h.elem.depth}t=c}else if("bottom"===e.positionType)t=-e.positionData;else{var d=e.children[0];if("elem"!==d.type)throw Error('First child must have type "elem".');if("shift"===e.positionType)t=-d.elem.depth-e.positionData;else if("firstBaseline"===e.positionType)t=-d.elem.depth;else throw Error("Invalid positionType "+e.positionType+".")}return{children:e.children,depth:t}},NV=function(e,t){for(var n,{children:r,depth:i}=Nj(e),o=0,l=0;l<r.length;l++){var s=r[l];if("elem"===s.type){var a=s.elem;o=Math.max(o,a.maxFontSize,a.height)}}o+=2;var c=Nz(["pstrut"],[]);c.style.height=EE(o);for(var u=[],h=i,d=i,p=i,f=0;f<r.length;f++){var m=r[f];if("kern"===m.type)p+=m.size;else{var g=m.elem,y=Nz(m.wrapperClasses||[],[c,g],void 0,m.wrapperStyle||{});y.style.top=EE(-o-p-g.depth),m.marginLeft&&(y.style.marginLeft=m.marginLeft),m.marginRight&&(y.style.marginRight=m.marginRight),u.push(y),p+=g.height+g.depth}h=Math.min(h,p),d=Math.max(d,p)}var b=Nz(["vlist"],u);if(b.style.height=EE(d),h<0){var w=Nz([],[]),x=Nz(["vlist"],[w]);x.style.height=EE(-h);var k=Nz(["vlist-s"],[new EH("")]);n=[Nz(["vlist-r"],[b,k]),Nz(["vlist-r"],[x])]}else n=[Nz(["vlist-r"],[b])];var C=Nz(["vlist-t"],n);return 2===n.length&&C.classes.push("vlist-t2"),C.height=d,C.depth=-h,C},N$=(e,t)=>{var n=Nz(["mspace"],[],t),r=EO(e,t);return n.style.marginRight=EE(r),n},NW=(e,t,n)=>{var r;switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===n?"Italic":"Regular")},NU={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},NG={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},NK=function(e,t){var[n,r,i]=NG[e],o=NP(["overlay"],[new Eq([new Ej(n)],{width:EE(r),height:EE(i),style:"width:"+EE(r),viewBox:"0 0 "+1e3*r+" "+1e3*i,preserveAspectRatio:"xMinYMin"})],t);return o.height=i,o.style.height=EE(i),o.style.width=EE(r),o},NJ={number:3,unit:"mu"},NZ={number:4,unit:"mu"},NY={number:5,unit:"mu"},NX={mord:{mop:NJ,mbin:NZ,mrel:NY,minner:NJ},mop:{mord:NJ,mop:NJ,mrel:NY,minner:NJ},mbin:{mord:NZ,mop:NZ,mopen:NZ,minner:NZ},mrel:{mord:NY,mop:NY,mopen:NY,minner:NY},mopen:{},mclose:{mop:NJ,mbin:NZ,mrel:NY,minner:NJ},mpunct:{mord:NJ,mop:NJ,mrel:NY,mopen:NJ,mclose:NJ,mpunct:NJ,minner:NJ},minner:{mord:NJ,mop:NJ,mbin:NZ,mrel:NY,mopen:NJ,mpunct:NJ,minner:NJ}},NQ={mord:{mop:NJ},mop:{mord:NJ,mop:NJ},mbin:{},mrel:{},mopen:{},mclose:{mop:NJ},mpunct:{},minner:{mop:NJ}},N0={},N1={},N4={};function N5(e){for(var{type:t,names:n,htmlBuilder:r,mathmlBuilder:i}=e,o=0;o<n.length;++o)N0[n[o]]=e;t&&(r&&(N1[t]=r),i&&(N4[t]=i))}function N2(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;n&&(N1[t]=n),r&&(N4[t]=r)}var N3=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},N7=function(e){return"ordgroup"===e.type?e.body:[e]},N6=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),N8=new Set(["rightmost","mrel","mclose","mpunct"]),N9={display:Eg.DISPLAY,text:Eg.TEXT,script:Eg.SCRIPT,scriptscript:Eg.SCRIPTSCRIPT},De={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Dt=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var i=[],o=0;o<e.length;o++){var l=Ds(e[o],t);if(l instanceof ES){var s=l.children;i.push(...s)}else i.push(l)}if(N_(i),!n)return i;var a=t;if(1===e.length){var c=e[0];"sizing"===c.type?a=t.havingSize(c.size):"styling"===c.type&&(a=t.havingStyle(N9[c.style]))}var u=Nz([r[0]||"leftmost"],[],t),h=Nz([r[1]||"rightmost"],[],t),d="root"===n;return Dn(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&N8.has(r)?t.classes[0]="mord":"mbin"===r&&N6.has(n)&&(e.classes[0]="mord")},{node:u},h,d),Dn(i,(e,t)=>{var n,r,i=Do(t),o=Do(e),l=i&&o?e.hasClass("mtight")?null==(n=NQ[i])?void 0:n[o]:null==(r=NX[i])?void 0:r[o]:null;if(l)return N$(l,a)},{node:u},h,d),i},Dn=function(e,t,n,r,i){r&&e.push(r);for(var o=0;o<e.length;o++){let r;var l=e[o],s=Dr(l);if(s){Dn(s.children,t,n,null,i);continue}var a=!l.hasClass("mspace");if(a){var c=t(l,n.node);c&&(n.insertAfter?n.insertAfter(c):(e.unshift(c),o++))}a?n.node=l:i&&l.hasClass("newline")&&(n.node=Nz(["leftmost"])),r=o,n.insertAfter=t=>{e.splice(r+1,0,t),o++}}r&&e.pop()},Dr=function(e){return e instanceof ES||e instanceof EP||e instanceof Ez&&e.hasClass("enclosing")?e:null},Di=function(e,t){var n=Dr(e);if(n){var r=n.children;if(r.length){if("right"===t)return Di(r[r.length-1],"right");else if("left"===t)return Di(r[0],"left")}}return e},Do=function(e,t){return e?(t&&(e=Di(e,t)),De[e.classes[0]]||null):null},Dl=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Nz(t.concat(n))},Ds=function(e,t,n){if(!e)return Nz();if(N1[e.type]){var r=N1[e.type](e,t);if(n&&t.size!==n.size){r=Nz(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new O6("Got group of unknown type: '"+e.type+"'")};function Da(e,t){var n=Nz(["base"],e,t),r=Nz(["strut"]);return r.style.height=EE(n.height+n.depth),n.depth&&(r.style.verticalAlign=EE(-n.depth)),n.children.unshift(r),n}function Dc(e,t){var n,r,i=null;1===e.length&&"tag"===e[0].type&&(i=e[0].tag,e=e[0].body);var o=Dt(e,t,"root");2===o.length&&o[1].hasClass("tag")&&(n=o.pop());for(var l=[],s=[],a=0;a<o.length;a++)if(s.push(o[a]),o[a].hasClass("mbin")||o[a].hasClass("mrel")||o[a].hasClass("allowbreak")){for(var c=!1;a<o.length-1&&o[a+1].hasClass("mspace")&&!o[a+1].hasClass("newline");)a++,s.push(o[a]),o[a].hasClass("nobreak")&&(c=!0);c||(l.push(Da(s,t)),s=[])}else o[a].hasClass("newline")&&(s.pop(),s.length>0&&(l.push(Da(s,t)),s=[]),l.push(o[a]));s.length>0&&l.push(Da(s,t)),i?((r=Da(Dt(i,t,!0),t)).classes=["tag"],l.push(r)):n&&l.push(n);var u=Nz(["katex-html"],l);if(u.setAttribute("aria-hidden","true"),r){var h=r.children[0];h.style.height=EE(u.height+u.depth),u.depth&&(h.style.verticalAlign=EE(-u.depth))}return u}class Du{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=EN(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof Dh&&this.children[n+1]instanceof Dh){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof Dh;)r+=this.children[++n].toText();e.appendChild(new Dh(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=En(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+En(EN(this.classes))+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+("</"+this.type+">")}toText(){return this.children.map(e=>e.toText()).join("")}}class Dh{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return En(this.toText())}toText(){return this.text}}class Dd{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character=" ":e>=-.05556&&e<=-.05555?this.character=" ":e>=-.1667&&e<=-.1666?this.character=" ":e>=-.2223&&e<=-.2222?this.character=" ":e>=-.2778&&e<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",EE(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+EE(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var Dp=new Set(["\\imath","\\jmath"]),Df=new Set(["mrow","mtable"]),Dm=function(e,t,n){return EJ[t][e]&&EJ[t][e].replace&&55349!==e.charCodeAt(0)&&!(E9.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6)))&&(e=EJ[t][e].replace),new Dh(e)},Dg=function(e){return 1===e.length?e[0]:new Du("mrow",e)},Dv={mathit:"italic",boldsymbol:e=>"textord"===e.type?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},Dy=(e,t)=>{if("text"===e.mode){if("texttt"===t.fontFamily)return"monospace";else if("textsf"===t.fontFamily)if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"sans-serif-bold-italic";else if("textit"===t.fontShape)return"sans-serif-italic";else if("textbf"===t.fontWeight)return"bold-sans-serif";else return"sans-serif";else if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";else if("textit"===t.fontShape)return"italic";else if("textbf"===t.fontWeight)return"bold"}var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode,i=Dv[n];if(i)return"function"==typeof i?i(e):i;var o=e.text;if(Dp.has(o))return null;if(EJ[r][o]){var l=EJ[r][o].replace;l&&(o=l)}return EG(o,NU[n].fontName,r)?NU[n].variant:null};function Db(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){var t=e.children[0];return t instanceof Dh&&"."===t.text}if("mo"!==e.type||1!==e.children.length||"true"!==e.getAttribute("separator")||"0em"!==e.getAttribute("lspace")||"0em"!==e.getAttribute("rspace"))return!1;var n=e.children[0];return n instanceof Dh&&","===n.text}var Dw=function(e,t,n){if(1===e.length){var r,i=Dk(e[0],t);return n&&i instanceof Du&&"mo"===i.type&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var o=[],l=0;l<e.length;l++){var s=Dk(e[l],t);if(s instanceof Du&&r instanceof Du){if("mtext"===s.type&&"mtext"===r.type&&s.getAttribute("mathvariant")===r.getAttribute("mathvariant")){r.children.push(...s.children);continue}else if("mn"===s.type&&"mn"===r.type){r.children.push(...s.children);continue}else if(Db(s)&&"mn"===r.type){r.children.push(...s.children);continue}else if("mn"===s.type&&Db(r))s.children=[...r.children,...s.children],o.pop();else if(("msup"===s.type||"msub"===s.type)&&s.children.length>=1&&("mn"===r.type||Db(r))){var a=s.children[0];a instanceof Du&&"mn"===a.type&&(a.children=[...r.children,...a.children],o.pop())}else if("mi"===r.type&&1===r.children.length){var c=r.children[0];if(c instanceof Dh&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof Dh&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),o.pop())}}}o.push(s),r=s}return o},Dx=function(e,t,n){return Dg(Dw(e,t,n))},Dk=function(e,t){if(!e)return new Du("mrow");if(N4[e.type])return N4[e.type](e,t);throw new O6("Got group of unknown type: '"+e.type+"'")};function DC(e,t,n,r,i){var o,l=Dw(e,n);o=1===l.length&&l[0]instanceof Du&&Df.has(l[0].type)?l[0]:new Du("mrow",l);var s=new Du("annotation",[new Dh(t)]);s.setAttribute("encoding","application/x-tex");var a=new Du("semantics",[o,s]),c=new Du("math",[a]);return c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block"),Nz([i?"katex":"katex-mathml"],[c])}var DS=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],DM=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],DA=function(e,t){return t.size<2?e:DS[e-1][t.size-1]};class DT{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||DT.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=DM[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new DT(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:DA(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:DM[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=DA(DT.BASESIZE,e);return this.size===t&&this.textSize===DT.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==DT.BASESIZE?["sizing","reset-size"+this.size,"size"+DT.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!EK[t=e>=5?0:e>=3?1:2]){var n=EK[t]={cssEmPerMu:EW.quad[t]/18};for(var r in EW)EW.hasOwnProperty(r)&&(n[r]=EW[r][t])}return EK[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}DT.BASESIZE=6;var DO=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Nz(n,[e])}return e},DE=function(e,t,n){var r,i=new DT({style:(r=n).displayMode?Eg.DISPLAY:Eg.TEXT,maxSize:r.maxSize,minRuleThickness:r.minRuleThickness});return"mathml"===n.output?DC(e,t,i,n.displayMode,!0):DO("html"===n.output?Nz(["katex"],[Dc(e,i)]):Nz(["katex"],[DC(e,t,i,n.displayMode,!1),Dc(e,i)]),n)},DN={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},DD=function(e){var t=new Du("mo",[new Dh(DN[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},DI={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},DL=new Set(["widehat","widecheck","widetilde","utilde"]),D_=function(e,t){var{span:n,minWidth:r,height:i}=function(){var n=4e5,r=e.label.slice(1);if(DL.has(r)&&"base"in e){var i,o,l,s="ordgroup"===e.base.type?e.base.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(i=420,n=2364,l=.42,o=r+"4"):(i=312,n=2340,l=.34,o="tilde4");else{var a=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][a],i=[0,239,300,360,420][a],l=[0,.24,.3,.3,.36,.42][a],o=r+a):(n=[0,600,1033,2339,2340][a],i=[0,260,286,306,312][a],l=[0,.26,.286,.3,.306,.34][a],o="tilde"+a)}return{span:NP([],[new Eq([new Ej(o)],{width:"100%",height:EE(l),viewBox:"0 0 "+n+" "+i,preserveAspectRatio:"none"})],t),minWidth:0,height:l}}var c,u,h=[],d=DI[r];if(!d)throw Error('No SVG data for "'+r+'".');var[p,f,m]=d,g=m/1e3,y=p.length;if(1===y){if(4!==d.length)throw Error('Expected 4-tuple for single-path SVG data "'+r+'".');c=["hide-tail"],u=[d[3]]}else if(2===y)c=["halfarrow-left","halfarrow-right"],u=["xMinYMin","xMaxYMin"];else if(3===y)c=["brace-left","brace-center","brace-right"],u=["xMinYMin","xMidYMin","xMaxYMin"];else throw Error("Correct katexImagesData or update code here to support\n "+y+" children.");for(var b=0;b<y;b++){var w=new Eq([new Ej(p[b])],{width:"400em",height:EE(g),viewBox:"0 0 "+n+" "+m,preserveAspectRatio:u[b]+" slice"}),x=NP([c[b]],[w],t);if(1===y)return{span:x,minWidth:f,height:g};x.style.height=EE(g),h.push(x)}return{span:Nz(["stretchy"],h,t),minWidth:f,height:g}}();return n.height=i,n.style.height=EE(i),r>0&&(n.style.minWidth=EE(r)),n},DR=function(e,t,n,r,i){var o,l=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(o=Nz(["stretchy",t],[],i),"fbox"===t){var s=i.color&&i.getColor();s&&(o.style.borderColor=s)}}else{var a=[];/^[bx]cancel$/.test(t)&&a.push(new EV({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&a.push(new EV({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"})),o=NP([],[new Eq(a,{width:"100%",height:EE(l)})],i)}return o.height=l,o.style.height=EE(l),o},Dz={bin:1,close:1,inner:1,open:1,punct:1,rel:1},DP={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function DB(e,t){if(!e||e.type!==t)throw Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function DF(e){var t=DH(e);if(!t)throw Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function DH(e){return e&&("atom"===e.type||DP.hasOwnProperty(e.type))?e:null}var Dq=e=>e instanceof EH?e:(e instanceof Ez||e instanceof EP||e instanceof ES)&&1===e.children.length?Dq(e.children[0]):void 0,Dj=(e,t)=>{e&&"supsub"===e.type?(s=(a=DB(e.base,"accent")).base,e.base=s,c=function(e){if(e instanceof Ez)return e;throw Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Ds(e,t)),e.base=a):s=(a=DB(e,"accent")).base;var n=Ds(s,t.havingCrampedStyle()),r=a.isShifty&&Eo(s),i=0;r&&(i=null!=(u=null==(h=Dq(n))?void 0:h.skew)?u:0);var o="\\c"===a.label,l=o?n.height+n.depth:Math.min(n.height,t.fontMetrics().xHeight);if(a.isStretchy)f=NV({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"elem",elem:f=D_(a,t),wrapperClasses:["svg-align"],wrapperStyle:i>0?{width:"calc(100% - "+EE(2*i)+")",marginLeft:EE(2*i)}:void 0}]});else{"\\vec"===a.label?(d=NK("vec",t),p=NG.vec[1]):((d=function(e){if(e instanceof EH)return e;throw Error("Expected symbolNode but got "+String(e)+".")}(d=NI({type:"textord",mode:a.mode,text:a.label},t))).italic=0,p=d.width,o&&(l+=d.depth));var s,a,c,u,h,d,p,f=Nz(["accent-body"],[d]),m="\\textcircled"===a.label;m&&(f.classes.push("accent-full"),l=n.height);var g=i;m||(g-=p/2),f.style.left=EE(g),"\\textcircled"===a.label&&(f.style.top=".2em"),f=NV({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:-l},{type:"elem",elem:f}]})}var y=Nz(["mord","accent"],[f],t);return c?(c.children[0]=y,c.height=Math.max(y.height,c.height),c.classes[0]="mord",c):y},DV=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));N5({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],numArgs:1,handler:(e,t)=>{var n=N3(t[0]),r=!DV.test(e.funcName),i=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Dj,mathmlBuilder:(e,t)=>{var n=e.isStretchy?DD(e.label):new Du("mo",[Dm(e.label,e.mode)]),r=new Du("mover",[Dk(e.base,t),n]);return r.setAttribute("accent","true"),r}}),N5({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),N5({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Ds(e.base,t),r=D_(e,t),i=.12*("\\utilde"===e.label);return Nz(["mord","accentunder"],[NV({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=DD(e.label),r=new Du("munder",[Dk(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var D$=e=>{var t=new Du("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};N5({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r,funcName:i}=e;return{type:"xArrow",mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n,r,i=t.style,o=t.havingStyle(i.sup()),l=Nq(Ds(e.body,o,t),t),s="\\x"===e.label.slice(0,2)?"x":"cd";l.classes.push(s+"-arrow-pad"),e.below&&(o=t.havingStyle(i.sub()),(n=Nq(Ds(e.below,o,t),t)).classes.push(s+"-arrow-pad"));var a=D_(e,t),c=-t.fontMetrics().axisHeight+.5*a.height,u=-t.fontMetrics().axisHeight-.5*a.height-.111;if((l.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=l.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*a.height+.111;r=NV({positionType:"individualShift",children:[{type:"elem",elem:l,shift:u},{type:"elem",elem:a,shift:c,wrapperClasses:["svg-align"]},{type:"elem",elem:n,shift:h}]})}else r=NV({positionType:"individualShift",children:[{type:"elem",elem:l,shift:u},{type:"elem",elem:a,shift:c,wrapperClasses:["svg-align"]}]});return Nz(["mrel","x-arrow"],[r],t)},mathmlBuilder(e,t){var n,r=DD(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var i=D$(Dk(e.body,t));n=e.below?new Du("munderover",[r,D$(Dk(e.below,t)),i]):new Du("mover",[r,i])}else n=e.below?new Du("munder",[r,D$(Dk(e.below,t))]):new Du("mover",[r,n=D$()]);return n}}),N5({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],numArgs:1,primitive:!0,handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.slice(5),body:N7(i),isCharacterBox:Eo(i)}},htmlBuilder:function(e,t){var n=Dt(e.body,t,!0);return Nz([e.mclass],n,t)},mathmlBuilder:function(e,t){var n,r=Dw(e.body,t);return"minner"===e.mclass?n=new Du("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new Du("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new Du("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):("mopen"===e.mclass||"mclose"===e.mclass)&&(n.attributes.lspace="0em",n.attributes.rspace="0em")),n}});var DW=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"===t.type&&("bin"===t.family||"rel"===t.family)?"m"+t.family:"mord"};N5({type:"mclass",names:["\\@binrel"],numArgs:2,handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:DW(t[0]),body:N7(t[1]),isCharacterBox:Eo(t[1])}}}),N5({type:"mclass",names:["\\stackrel","\\overset","\\underset"],numArgs:2,handler(e,t){var n,{parser:r,funcName:i}=e,o=t[1],l=t[0];n="\\stackrel"!==i?DW(o):"mrel";var s={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==i,body:N7(o)},a="\\underset"===i?{type:"supsub",mode:l.mode,base:s,sub:l}:{type:"supsub",mode:l.mode,base:s,sup:l};return{type:"mclass",mode:r.mode,mclass:n,body:[a],isCharacterBox:Eo(a)}}}),N5({type:"pmb",names:["\\pmb"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:DW(t[0]),body:N7(t[0])}},htmlBuilder(e,t){var n=Dt(e.body,t,!0),r=Nz([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=new Du("mstyle",Dw(e.body,t));return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var DU={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},DG=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),DK=e=>"textord"===e.type&&"@"===e.text,DJ=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;N5({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Nq(Ds(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=EE(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Du("mrow",[Dk(e.label,t)]);return(n=new Du("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Du("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),N5({type:"cdlabelparent",names:["\\\\cdparent"],numArgs:1,handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Nq(Ds(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new Du("mrow",[Dk(e.fragment,t)])}),N5({type:"textord",names:["\\@char"],numArgs:1,allowedInText:!0,handler(e,t){for(var n,{parser:r}=e,i=DB(t[0],"ordgroup").body,o="",l=0;l<i.length;l++)o+=DB(i[l],"textord").text;var s=parseInt(o);if(isNaN(s))throw new O6("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new O6("\\@char with invalid code point "+o);return s<=65535?n=String.fromCharCode(s):(s-=65536,n=String.fromCharCode((s>>10)+55296,(1023&s)+56320)),{type:"textord",mode:r.mode,text:n}}}),N5({type:"color",names:["\\textcolor"],numArgs:2,allowedInText:!0,argTypes:["color","original"],handler(e,t){var{parser:n}=e,r=DB(t[0],"color-token").color,i=t[1];return{type:"color",mode:n.mode,color:r,body:N7(i)}},htmlBuilder:(e,t)=>NH(Dt(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Du("mstyle",Dw(e.body,t.withColor(e.color)));return n.setAttribute("mathcolor",e.color),n}}),N5({type:"color",names:["\\color"],numArgs:1,allowedInText:!0,argTypes:["color"],handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=DB(t[0],"color-token").color;n.gullet.macros.set("\\current@color",i);var o=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:i,body:o}}}),N5({type:"cr",names:["\\\\"],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var{parser:r}=e,i="["===r.gullet.future().text?r.parseSizeGroup(!0):null,o=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:o,size:i&&DB(i,"size").value}},htmlBuilder(e,t){var n=Nz(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=EE(EO(e.size,t)))),n},mathmlBuilder(e,t){var n=new Du("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",EE(EO(e.size,t)))),n}});var DZ={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},DY=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new O6("Expected a control sequence",e);return t},DX=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);null==i&&(n.noexpand=!0,i={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};N5({type:"internal",names:["\\global","\\long","\\\\globallong"],numArgs:0,allowedInText:!0,handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(DZ[r.text])return("\\global"===n||"\\\\globallong"===n)&&(r.text=DZ[r.text]),DB(t.parseFunction(),"internal");throw new O6("Invalid token after macro prefix",r)}}),N5({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t,{parser:n,funcName:r}=e,i=n.gullet.popToken(),o=i.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new O6("Expected a control sequence",i);for(var l=0,s=[[]];"{"!==n.gullet.future().text;)if("#"===(i=n.gullet.popToken()).text){if("{"===n.gullet.future().text){t=n.gullet.future(),s[l].push("{");break}if(i=n.gullet.popToken(),!/^[1-9]$/.test(i.text))throw new O6('Invalid argument number "'+i.text+'"');if(parseInt(i.text)!==l+1)throw new O6('Argument number "'+i.text+'" out of order');l++,s.push([])}else if("EOF"===i.text)throw new O6("Expected a macro definition");else s[l].push(i.text);var{tokens:a}=n.gullet.consumeArg();return t&&a.unshift(t),("\\edef"===r||"\\xdef"===r)&&(a=n.gullet.expandTokens(a)).reverse(),n.gullet.macros.set(o,{tokens:a,numArgs:l,delimiters:s},r===DZ[r]),{type:"internal",mode:n.mode}}}),N5({type:"internal",names:["\\let","\\\\globallet"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t,{parser:n,funcName:r}=e,i=DY(n.gullet.popToken());n.gullet.consumeSpaces();var o=("="===(t=n.gullet.popToken()).text&&" "===(t=n.gullet.popToken()).text&&(t=n.gullet.popToken()),t);return DX(n,i,o,"\\\\globallet"===r),{type:"internal",mode:n.mode}}}),N5({type:"internal",names:["\\futurelet","\\\\globalfuture"],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var{parser:t,funcName:n}=e,r=DY(t.gullet.popToken()),i=t.gullet.popToken(),o=t.gullet.popToken();return DX(t,r,o,"\\\\globalfuture"===n),t.gullet.pushToken(o),t.gullet.pushToken(i),{type:"internal",mode:t.mode}}});var DQ=function(e,t,n){var r=EG(EJ.math[e]&&EJ.math[e].replace||e,t,n);if(!r)throw Error("Unsupported symbol "+e+" and font size "+t+".");return r},D0=function(e,t,n,r){var i=n.havingBaseStyle(t),o=Nz(r.concat(i.sizingClasses(n)),[e],n),l=i.sizeMultiplier/n.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=i.sizeMultiplier,o},D1=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=EE(i),e.height-=i,e.depth+=i},D4=function(e,t,n,r,i,o){var l=D0(NN(e,"Main-Regular",i,r),t,r,o);return n&&D1(l,r,t),l},D5=function(e,t,n,r,i,o){var l=NN(e,"Size"+t+"-Regular",i,r),s=D0(Nz(["delimsizing","size"+t],[l],r),Eg.TEXT,r,o);return n&&D1(s,r,Eg.TEXT),s},D2=function(e,t,n){return{type:"elem",elem:Nz(["delimsizinginner","Size1-Regular"===t?"delim-size1":"delim-size4"],[Nz([],[NN(e,t,n)])])}},D3=function(e,t,n){var r=E$["Size4-Regular"][e.charCodeAt(0)]?E$["Size4-Regular"][e.charCodeAt(0)][4]:E$["Size1-Regular"][e.charCodeAt(0)][4],i=NP([],[new Eq([new Ej("inner",Ex(e,Math.round(1e3*t)))],{width:EE(r),height:EE(t),style:"width:"+EE(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"})],n);return i.height=t,i.style.height=EE(t),i.style.width=EE(r),{type:"elem",elem:i}},D7={type:"kern",size:-.008},D6=new Set(["|","\\lvert","\\rvert","\\vert"]),D8=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),D9=function(e,t,n,r,i,o){var l,s,a,c,u="",h=0;l=a=c=e,s=null;var d="Size1-Regular";"\\uparrow"===e?a=c="⏐":"\\Uparrow"===e?a=c="‖":"\\downarrow"===e?l=a="⏐":"\\Downarrow"===e?l=a="‖":"\\updownarrow"===e?(l="\\uparrow",a="⏐",c="\\downarrow"):"\\Updownarrow"===e?(l="\\Uparrow",a="‖",c="\\Downarrow"):D6.has(e)?(a="∣",u="vert",h=333):D8.has(e)?(a="∥",u="doublevert",h=556):"["===e||"\\lbrack"===e?(l="⎡",a="⎢",c="⎣",d="Size4-Regular",u="lbrack",h=667):"]"===e||"\\rbrack"===e?(l="⎤",a="⎥",c="⎦",d="Size4-Regular",u="rbrack",h=667):"\\lfloor"===e||"⌊"===e?(a=l="⎢",c="⎣",d="Size4-Regular",u="lfloor",h=667):"\\lceil"===e||"⌈"===e?(l="⎡",a=c="⎢",d="Size4-Regular",u="lceil",h=667):"\\rfloor"===e||"⌋"===e?(a=l="⎥",c="⎦",d="Size4-Regular",u="rfloor",h=667):"\\rceil"===e||"⌉"===e?(l="⎤",a=c="⎥",d="Size4-Regular",u="rceil",h=667):"("===e||"\\lparen"===e?(l="⎛",a="⎜",c="⎝",d="Size4-Regular",u="lparen",h=875):")"===e||"\\rparen"===e?(l="⎞",a="⎟",c="⎠",d="Size4-Regular",u="rparen",h=875):"\\{"===e||"\\lbrace"===e?(l="⎧",s="⎨",c="⎩",a="⎪",d="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(l="⎫",s="⎬",c="⎭",a="⎪",d="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(l="⎧",c="⎩",a="⎪",d="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(l="⎫",c="⎭",a="⎪",d="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(l="⎧",c="⎭",a="⎪",d="Size4-Regular"):("\\rmoustache"===e||"⎱"===e)&&(l="⎫",c="⎩",a="⎪",d="Size4-Regular");var p=DQ(l,d,i),f=p.height+p.depth,m=DQ(a,d,i),g=m.height+m.depth,y=DQ(c,d,i),b=y.height+y.depth,w=0,x=1;if(null!==s){var k=DQ(s,d,i);w=k.height+k.depth,x=2}var C=f+b+w,S=Math.max(0,Math.ceil((t-C)/(x*g))),M=C+S*x*g,A=r.fontMetrics().axisHeight;n&&(A*=r.sizeMultiplier);var T=M/2-A,O=[];if(u.length>0){var E=Math.round(1e3*M),N=EC(u,Math.round(1e3*(M-f-b))),D=new Ej(u,N),I=EE(h/1e3),L=EE(E/1e3),_=NP([],[new Eq([D],{width:I,height:L,viewBox:"0 0 "+h+" "+E})],r);_.height=E/1e3,_.style.width=I,_.style.height=L,O.push({type:"elem",elem:_})}else{if(O.push(D2(c,d,i)),O.push(D7),null===s)O.push(D3(a,M-f-b+.016,r));else{var R=(M-f-b-w)/2+.016;O.push(D3(a,R,r)),O.push(D7),O.push(D2(s,d,i)),O.push(D7),O.push(D3(a,R,r))}O.push(D7),O.push(D2(l,d,i))}var z=r.havingBaseStyle(Eg.TEXT);return D0(Nz(["delimsizing","mult"],[NV({positionType:"bottom",positionData:T,children:O})],z),Eg.TEXT,r,o)},Ie=function(e,t,n,r,i){var o=Ew(e,r,n);return NP(["hide-tail"],[new Eq([new Ej(e,o)],{width:"400em",height:EE(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"})],i)},It=function(e,t){var n,r,i,o,l,s=t.havingBaseSizing(),a=Ih("\\surd",e*s.sizeMultiplier,Ic,s),c=s.sizeMultiplier,u=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness);return"small"===a.type?(o=1e3+1e3*u+80,e<1?c=1:e<1.4&&(c=.7),r=(1+u+.08)/c,i=(1+u)/c,(n=Ie("sqrtMain",r,o,u,t)).style.minWidth="0.853em",l=.833/c):"large"===a.type?(o=1080*Io[a.size],i=(Io[a.size]+u)/c,r=(Io[a.size]+u+.08)/c,(n=Ie("sqrtSize"+a.size,r,o,u,t)).style.minWidth="1.02em",l=1/c):(r=e+u+.08,i=e+u,(n=Ie("sqrtTall",r,o=Math.floor(1e3*e+u)+80,u,t)).style.minWidth="0.742em",l=1.056),n.height=i,n.style.height=EE(r),{span:n,advanceWidth:l,ruleWidth:(t.fontMetrics().sqrtRuleThickness+u)*c}},In=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),Ir=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),Ii=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Io=[0,1.2,1.8,2.4,3],Il=function(e,t,n,r,i){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":(">"===e||"\\gt"===e||"⟩"===e)&&(e="\\rangle"),In.has(e)||Ii.has(e))return D5(e,t,!1,n,r,i);if(Ir.has(e))return D9(e,Io[t],!1,n,r,i);throw new O6("Illegal delimiter: '"+e+"'")},Is=[{type:"small",style:Eg.SCRIPTSCRIPT},{type:"small",style:Eg.SCRIPT},{type:"small",style:Eg.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ia=[{type:"small",style:Eg.SCRIPTSCRIPT},{type:"small",style:Eg.SCRIPT},{type:"small",style:Eg.TEXT},{type:"stack"}],Ic=[{type:"small",style:Eg.SCRIPTSCRIPT},{type:"small",style:Eg.SCRIPT},{type:"small",style:Eg.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Iu=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw Error("Add support for delim type '"+e.type+"' here.")},Ih=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size),o=i;o<n.length;o++){var l=n[o];if("stack"===l.type)break;var s=DQ(e,Iu(l),"math"),a=s.height+s.depth;if("small"===l.type&&(a*=r.havingBaseStyle(l.style).sizeMultiplier),a>t)return l}return n[n.length-1]},Id=function(e,t,n,r,i,o){"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":(">"===e||"\\gt"===e||"⟩"===e)&&(e="\\rangle");var l=Ii.has(e)?Is:In.has(e)?Ic:Ia,s=Ih(e,t,l,r);return"small"===s.type?D4(e,s.style,n,r,i,o):"large"===s.type?D5(e,s.size,n,r,i,o):D9(e,t,n,r,i,o)},Ip=function(e,t,n,r,i,o){var l=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,a=Math.max(t-l,n+l);return Id(e,Math.max(a/500*901,2*a-s),!0,r,i,o)},If={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Im=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function Ig(e){return"isMiddle"in e}function Iv(e,t){var n=DH(e);if(n&&Im.has(n.text))return n;if(n)throw new O6("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e);throw new O6("Invalid delimiter type '"+e.type+"'",e)}function Iy(e){if(!e.body)throw Error("Bug: The leftright ParseNode wasn't fully parsed.")}N5({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],numArgs:1,argTypes:["primitive"],handler:(e,t)=>{var n=Iv(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:If[e.funcName].size,mclass:If[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Nz([e.mclass]):Il(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(Dm(e.delim,e.mode));var n=new Du("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=EE(Io[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),N5({type:"leftright-right",names:["\\right"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new O6("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Iv(t[0],e).text,color:n}}}),N5({type:"leftright",names:["\\left"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Iv(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect("\\right",!1);var o=DB(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:i,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{Iy(e);for(var n,r,i=Dt(e.body,t,!0,["mopen","mclose"]),o=0,l=0,s=!1,a=0;a<i.length;a++)Ig(i[a])?s=!0:(o=Math.max(i[a].height,o),l=Math.max(i[a].depth,l));if(o*=t.sizeMultiplier,l*=t.sizeMultiplier,n="."===e.left?Dl(t,["mopen"]):Ip(e.left,o,l,t,e.mode,["mopen"]),i.unshift(n),s)for(var c=1;c<i.length;c++){var u=i[c];if(Ig(u)){var h=u.isMiddle;i[c]=Ip(h.delim,o,l,h.options,e.mode,[])}}if("."===e.right)r=Dl(t,["mclose"]);else{var d=e.rightColor?t.withColor(e.rightColor):t;r=Ip(e.right,o,l,d,e.mode,["mclose"])}return i.push(r),Nz(["minner"],i,t)},mathmlBuilder:(e,t)=>{Iy(e);var n=Dw(e.body,t);if("."!==e.left){var r=new Du("mo",[Dm(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var i=new Du("mo",[Dm(e.right,e.mode)]);i.setAttribute("fence","true"),e.rightColor&&i.setAttribute("mathcolor",e.rightColor),n.push(i)}return Dg(n)}}),N5({type:"middle",names:["\\middle"],numArgs:1,primitive:!0,handler:(e,t)=>{var n=Iv(t[0],e);if(!e.parser.leftrightDepth)throw new O6("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return"."===e.delim?n=Dl(t,[]):(n=Il(e.delim,1,t,e.mode,[])).isMiddle={delim:e.delim,options:t},n},mathmlBuilder:(e,t)=>{var n=new Du("mo",["\\vert"===e.delim||"|"===e.delim?Dm("|","text"):Dm(e.delim,e.mode)]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}}),N5({type:"enclose",names:["\\colorbox"],numArgs:2,allowedInText:!0,argTypes:["color","hbox"],handler(e,t,n){var{parser:r,funcName:i}=e,o=DB(t[0],"color-token").color,l=t[1];return{type:"enclose",mode:r.mode,label:i,backgroundColor:o,body:l}},htmlBuilder:(e,t)=>{var n,r=Nq(Ds(e.body,t),t),i=e.label.slice(1),o=t.sizeMultiplier,l=Eo(e.body);if("sout"===i)(h=Nz(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/o,d=-.5*t.fontMetrics().xHeight;else if("phase"===i){var s=EO({number:.6,unit:"pt"},t),a=EO({number:.35,unit:"ex"},t);o/=t.havingBaseSizing().sizeMultiplier;var c=r.height+r.depth+s+a;r.style.paddingLeft=EE(c/2+s);var u=Math.floor(1e3*c*o);(h=NP(["hide-tail"],[new Eq([new Ej("phase","M400000 "+u+" H0 L"+u/2+" 0 l65 45 L145 "+(u-80)+" H400000z")],{width:"400em",height:EE(u/1e3),viewBox:"0 0 400000 "+u,preserveAspectRatio:"xMinYMin slice"})],t)).style.height=EE(c),d=r.depth+s+a}else{/cancel/.test(i)?l||r.classes.push("cancel-pad"):"angl"===i?r.classes.push("anglpad"):r.classes.push("boxpad");var h,d,p,f,m=0;/box/.test(i)?(m=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),f=p=t.fontMetrics().fboxsep+("colorbox"===i?0:m)):"angl"===i?(p=4*(m=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),f=Math.max(0,.25-r.depth)):f=p=.2*!!l,h=DR(r,i,p,f,t),/fbox|boxed|fcolorbox/.test(i)?(h.style.borderStyle="solid",h.style.borderWidth=EE(m)):"angl"===i&&.049!==m&&(h.style.borderTopWidth=EE(m),h.style.borderRightWidth=EE(m)),d=r.depth+f,e.backgroundColor&&(h.style.backgroundColor=e.backgroundColor,e.borderColor&&(h.style.borderColor=e.borderColor))}return(n=e.backgroundColor?NV({positionType:"individualShift",children:[{type:"elem",elem:h,shift:d},{type:"elem",elem:r,shift:0}]}):NV({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:h,shift:d,wrapperClasses:/cancel|phase/.test(i)?["svg-align"]:[]}]}),/cancel/.test(i)&&(n.height=r.height,n.depth=r.depth),/cancel/.test(i)&&!l)?Nz(["mord","cancel-lap"],[n],t):Nz(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n,r=new Du(e.label.includes("colorbox")?"mpadded":"menclose",[Dk(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+EE(i)+" solid "+e.borderColor)}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r}}),N5({type:"enclose",names:["\\fcolorbox"],numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"],handler(e,t,n){var{parser:r,funcName:i}=e,o=DB(t[0],"color-token").color,l=DB(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:i,backgroundColor:l,borderColor:o,body:s}}}),N5({type:"enclose",names:["\\fbox"],numArgs:1,argTypes:["hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),N5({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}}}),N5({type:"enclose",names:["\\sout"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e;"math"===n.mode&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var i=t[0];return{type:"enclose",mode:n.mode,label:r,body:i}}}),N5({type:"enclose",names:["\\angl"],numArgs:1,argTypes:["hbox"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Ib={};function Iw(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:o,mathmlBuilder:l}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},a=0;a<n.length;++a)Ib[n[a]]=s;o&&(N1[t]=o),l&&(N4[t]=l)}var Ix={};class Ik{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Ik(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class IC{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new IC(t,Ik.range(this,e))}}function IS(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var IM=e=>{if(!e.parser.settings.displayMode)throw new O6("{"+e.envName+"} can be used only in display mode.")},IA=new Set(["gather","gather*"]);function IT(e){if(!e.includes("ed"))return!e.includes("*")}function IO(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:o,arraystretch:l,colSeparationType:s,autoTag:a,singleRow:c,emptySingleRow:u,maxNumCols:h,leqno:d}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!l){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)l=1;else if(!(l=parseFloat(p))||l<0)throw new O6("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var f=[],m=[f],g=[],y=[],b=null!=a?[]:void 0;function w(){a&&e.gullet.macros.set("\\@eqnsw","1",!0)}function x(){b&&(e.gullet.macros.get("\\df@tag")?(b.push(e.subparse([new IC("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):b.push(!!a&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(w(),y.push(IS(e));;){var k=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var C={type:"ordgroup",mode:e.mode,body:k};n&&(C={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[C]}),f.push(C);var S=e.fetch().text;if("&"===S){if(h&&f.length===h)if(c||s)throw new O6("Too many tab characters: &",e.nextToken);else e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.");e.consume()}else if("\\end"===S){x(),1===f.length&&"styling"===C.type&&1===C.body.length&&"ordgroup"===C.body[0].type&&0===C.body[0].body.length&&(m.length>1||!u)&&m.pop(),y.length<m.length+1&&y.push([]);break}else if("\\\\"===S){e.consume();var M=void 0;" "!==e.gullet.future().text&&(M=e.parseSizeGroup(!0)),g.push(M?M.value:null),x(),y.push(IS(e)),f=[],m.push(f),w()}else throw new O6("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:i,arraystretch:l,body:m,cols:o,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:y,colSeparationType:s,tags:b,leqno:d}}function IE(e){return"d"===e.slice(0,1)?"display":"text"}var IN=function(e,t){var n=e.body.length,r=e.hLinesBeforeRow,i=0,o=Array(n),l=[],s=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),a=1/t.fontMetrics().ptPerEm,c=5*a;e.colSeparationType&&"small"===e.colSeparationType&&(c=.2778*(t.havingStyle(Eg.SCRIPT).sizeMultiplier/t.sizeMultiplier));var u="CD"===e.colSeparationType?EO({number:3,unit:"ex"},t):12*a,h=3*a,d=e.arraystretch*u,p=.7*d,f=.3*d,m=0;function g(e){for(var t=0;t<e.length;++t)t>0&&(m+=.25),l.push({pos:m,isDashed:e[t]})}for(g(r[0]),L=0;L<e.body.length;++L){var y=e.body[L],b=p,w=f;i<y.length&&(i=y.length);var x={cells:Array(y.length),height:0,depth:0,pos:0};for(_=0;_<y.length;++_){var k=Ds(y[_],t);w<k.depth&&(w=k.depth),b<k.height&&(b=k.height),x.cells[_]=k}var C=e.rowGaps[L],S=0;C&&(S=EO(C,t))>0&&(w<(S+=f)&&(w=S),S=0),e.addJot&&L<e.body.length-1&&(w+=h),x.height=b,x.depth=w,x.pos=m+=b,m+=w+S,o[L]=x,g(r[L+1])}var M=m/2+t.fontMetrics().axisHeight,A=e.cols||[],T=[],O=[];if(e.tags&&e.tags.some(e=>e))for(L=0;L<n;++L){var E=o[L],N=E.pos-M,D=e.tags[L],I=void 0;(I=!0===D?Nz(["eqn-num"],[],t):!1===D?Nz([],[],t):Nz([],Dt(D,t,!0),t)).depth=E.depth,I.height=E.height,O.push({type:"elem",elem:I,shift:N})}for(_=0,z=0;_<i||z<A.length;++_,++z){for(var L,_,R,z,P,B,F,H,q,j,V=A[z],$=!0;(null==(B=V)?void 0:B.type)==="separator";){if($||((R=Nz(["arraycolsep"],[])).style.width=EE(t.fontMetrics().doubleRuleSep),T.push(R)),"|"===V.separator||":"===V.separator){var W="|"===V.separator?"solid":"dashed",U=Nz(["vertical-separator"],[],t);U.style.height=EE(m),U.style.borderRightWidth=EE(s),U.style.borderRightStyle=W,U.style.margin="0 "+EE(-s/2);var G=m-M;G&&(U.style.verticalAlign=EE(-G)),T.push(U)}else throw new O6("Invalid separator type: "+V.separator);V=A[++z],$=!1}if(!(_>=i)){var K=void 0;(_>0||e.hskipBeforeAndAfter)&&0!==(K=null!=(F=null==(H=V)?void 0:H.pregap)?F:c)&&((R=Nz(["arraycolsep"],[])).style.width=EE(K),T.push(R));var J=[];for(L=0;L<n;++L){var Z=o[L],Y=Z.cells[_];if(Y){var X=Z.pos-M;Y.depth=Z.depth,Y.height=Z.height,J.push({type:"elem",elem:Y,shift:X})}}var Q=NV({positionType:"individualShift",children:J}),ee=Nz(["col-align-"+((null==(P=V)?void 0:P.align)||"c")],[Q]);T.push(ee),(_<i-1||e.hskipBeforeAndAfter)&&0!==(K=null!=(q=null==(j=V)?void 0:j.postgap)?q:c)&&((R=Nz(["arraycolsep"],[])).style.width=EE(K),T.push(R))}}var et=Nz(["mtable"],T);if(l.length>0){for(var en=NB("hline",t,s),er=NB("hdashline",t,s),ei=[{type:"elem",elem:et,shift:0}];l.length>0;){var eo=l.pop(),el=eo.pos-M;eo.isDashed?ei.push({type:"elem",elem:er,shift:el}):ei.push({type:"elem",elem:en,shift:el})}et=NV({positionType:"individualShift",children:ei})}return 0===O.length?Nz(["mord"],[et],t):NH([et,Nz(["tag"],[NV({positionType:"individualShift",children:O})],t)])},ID={c:"center ",l:"left ",r:"right "},II=function(e,t){for(var n=[],r=new Du("mtd",[],["mtr-glue"]),i=new Du("mtd",[],["mml-eqn-num"]),o=0;o<e.body.length;o++){for(var l=e.body[o],s=[],a=0;a<l.length;a++)s.push(new Du("mtd",[Dk(l[a],t)]));e.tags&&e.tags[o]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Du("mtr",s))}var c=new Du("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+.09*!!e.addJot;c.setAttribute("rowspacing",EE(u));var h="",d="";if(e.cols&&e.cols.length>0){var p=e.cols,f="",m=!1,g=0,y=p.length;"separator"===p[0].type&&(h+="top ",g=1),"separator"===p[p.length-1].type&&(h+="bottom ",y-=1);for(var b=g;b<y;b++){var w=p[b];"align"===w.type?(d+=ID[w.align],m&&(f+="none "),m=!0):"separator"===w.type&&m&&(f+="|"===w.separator?"solid ":"dashed ",m=!1)}c.setAttribute("columnalign",d.trim()),/[sd]/.test(f)&&c.setAttribute("columnlines",f.trim())}if("align"===e.colSeparationType){for(var x=e.cols||[],k="",C=1;C<x.length;C++)k+=C%2?"0em ":"1em ";c.setAttribute("columnspacing",k.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var S="",M=e.hLinesBeforeRow;h+=(M[0].length>0?"left ":"")+(M[M.length-1].length>0?"right ":"");for(var A=1;A<M.length-1;A++)S+=0===M[A].length?"none ":M[A][0]?"dashed ":"solid ";return/[sd]/.test(S)&&c.setAttribute("rowlines",S.trim()),""!==h&&(c=new Du("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Du("mstyle",[c])).setAttribute("scriptlevel","1"),c},IL=function(e,t){e.envName.includes("ed")||IM(e);var n=[],r="split"===e.envName,i=IO(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:IT(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes("at")?"alignat":"align",maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},"display"),o=0,l=0,s={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var a="",c=0;c<t[0].body.length;c++)a+=DB(t[0].body[c],"textord").text;l=2*(o=Number(a))}var u=!l;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2){var n=DB(e[t],"styling");DB(n.body[0],"ordgroup").body.unshift(s)}if(u)l<e.length&&(l=e.length);else{var r=e.length/2;if(o<r)throw new O6("Too many math in a row: expected "+o+", but got "+r,e[0])}});for(var h=0;h<l;++h){var d="r",p=0;h%2==1?d="l":h>0&&u&&(p=1),n[h]={type:"align",align:d,pregap:p,postgap:0}}return i.colSeparationType=u?"align":"alignat",i};Iw({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(DH(t[0])?[t[0]]:DB(t[0],"ordgroup").body).map(function(e){var t=DF(e).text;if("lcr".includes(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new O6("Unknown column alignment: "+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return IO(e.parser,r,IE(e.envName))},htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!"lcr".includes(n))throw new O6("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),r.cols=[{type:"align",align:n}]}}var o=IO(e.parser,r,IE(e.envName)),l=Math.max(0,...o.body.map(e=>e.length));return o.cols=Array(l).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=IO(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(DH(t[0])?[t[0]]:DB(t[0],"ordgroup").body).map(function(e){var t=DF(e).text;if("lc".includes(t))return{type:"align",align:t};throw new O6("Unknown column alignment: "+t,e)});if(n.length>1)throw new O6("{subarray} can contain only one column");var r=IO(e.parser,{cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},"script");if(r.body.length>0&&r.body[0].length>1)throw new O6("{subarray} can contain only one column");return r},htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=IO(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},IE(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:IL,htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){IA.has(e.envName)&&IM(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:IT(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return IO(e.parser,t,"display")},htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:IL,htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){IM(e);var t={autoTag:IT(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return IO(e.parser,t,"display")},htmlBuilder:IN,mathmlBuilder:II}),Iw({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(IM(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"===n||"\\\\"===n)e.consume();else if("\\end"===n){0===t[t.length-1].length&&t.pop();break}else throw new O6("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var r=[],i=[r],o=0;o<t.length;o++){for(var l=t[o],s=DG(),a=0;a<l.length;a++)if(DK(l[a])){r.push(s);var c=DF(l[a+=1]).text,u=[,,];if(u[0]={type:"ordgroup",mode:"math",body:[]},u[1]={type:"ordgroup",mode:"math",body:[]},"=|.".includes(c));else if("<>AV".includes(c))for(var h=0;h<2;h++){for(var d=!0,p=a+1;p<l.length;p++){if(DJ(l[p],c)){d=!1,a=p;break}if(DK(l[p]))throw new O6("Missing a "+c+" character to complete a CD arrow.",l[p]);u[h].body.push(l[p])}if(d)throw new O6("Missing a "+c+" character to complete a CD arrow.",l[a])}else throw new O6('Expected one of "<>AV=|." after @',l[a]);var f={type:"styling",body:[function(e,t,n){var r=DU[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var i=n.callFunction("\\\\cdleft",[t[0]],[]),o=n.callFunction("\\Big",[{type:"atom",text:r,mode:"math",family:"rel"}],[]),l=n.callFunction("\\\\cdright",[t[1]],[]);return n.callFunction("\\\\cdparent",[{type:"ordgroup",mode:"math",body:[i,o,l]}],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}(c,u,e)],mode:"math",style:"display",resetFont:!0};r.push(f),s=DG()}else s.body.push(l[a]);o%2==0?r.push(s):r.shift(),r=[],i.push(r)}e.gullet.endGroup(),e.gullet.endGroup();var m=Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:m,colSeparationType:"CD",hLinesBeforeRow:Array(i.length+1).fill([])}}(e.parser)),htmlBuilder:IN,mathmlBuilder:II}),Ix["\\nonumber"]="\\gdef\\@eqnsw{0}",Ix["\\notag"]="\\nonumber",N5({type:"text",names:["\\hline","\\hdashline"],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new O6(e.funcName+" valid only within array environment")}}),N5({type:"environment",names:["\\begin","\\end"],numArgs:1,argTypes:["text"],handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if("ordgroup"!==i.type)throw new O6("Invalid environment name",i);for(var o="",l=0;l<i.body.length;++l)o+=DB(i.body[l],"textord").text;if("\\begin"===r){if(!Ib.hasOwnProperty(o))throw new O6("No such environment: "+o,i);var s=Ib[o],{args:a,optArgs:c}=n.parseArguments("\\begin{"+o+"}",s),u={mode:n.mode,envName:o,parser:n},h=s.handler(u,a,c);n.expect("\\end",!1);var d=n.nextToken,p=DB(n.parseFunction(),"environment");if(p.name!==o)throw new O6("Mismatch: \\begin{"+o+"} matched by \\end{"+p.name+"}",d);return h}return{type:"environment",mode:n.mode,name:o,nameGroup:i}}});var I_={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};N5({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=N3(t[0]),o=r in I_?I_[r]:r;return{type:"font",mode:n.mode,font:o.slice(1),body:i}},htmlBuilder:(e,t)=>{var n=e.font,r=t.withFont(n);return Ds(e.body,r)},mathmlBuilder:(e,t)=>{var n=e.font,r=t.withFont(n);return Dk(e.body,r)}}),N5({type:"mclass",names:["\\boldsymbol","\\bm"],numArgs:1,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"mclass",mode:n.mode,mclass:DW(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:Eo(r)}}}),N5({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],numArgs:0,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:o}=n,l=n.parseExpression(!0,i);return{type:"font",mode:o,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:l}}}});var IR=(e,t)=>t?{type:"styling",mode:e.mode,style:t,body:[e]}:e;N5({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n,{parser:r,funcName:i}=e,o=t[0],l=t[1],s=null,a=null;switch(i){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",a=")";break;case"\\\\bracefrac":n=!1,s="\\{",a="\\}";break;case"\\\\brackfrac":n=!1,s="[",a="]";break;default:throw Error("Unrecognized genfrac command")}var c="\\cfrac"===i,u=null;return c||i.startsWith("\\d")?u="display":i.startsWith("\\t")&&(u="text"),IR({type:"genfrac",mode:r.mode,numer:o,denom:l,continued:c,hasBarLine:n,leftDelim:s,rightDelim:a,barSize:null},u)},htmlBuilder:(e,t)=>{var n,r,i,o,l,s,a,c,u,h,d,p=t.style,f=p.fracNum(),m=p.fracDen();n=t.havingStyle(f);var g=Ds(e.numer,n,t);if(e.continued){var y=8.5/t.fontMetrics().ptPerEm,b=3.5/t.fontMetrics().ptPerEm;g.height=g.height<y?y:g.height,g.depth=g.depth<b?b:g.depth}n=t.havingStyle(m);var w=Ds(e.denom,n,t);if(e.hasBarLine?(e.barSize?(i=EO(e.barSize,t),r=NB("frac-line",t,i)):r=NB("frac-line",t),i=r.height,o=r.height):(r=null,i=0,o=t.fontMetrics().defaultRuleThickness),p.size===Eg.DISPLAY.size?(l=t.fontMetrics().num1,s=i>0?3*o:7*o,a=t.fontMetrics().denom1):(i>0?(l=t.fontMetrics().num2,s=o):(l=t.fontMetrics().num3,s=3*o),a=t.fontMetrics().denom2),r){var x=t.fontMetrics().axisHeight;l-g.depth-(x+.5*i)<s&&(l+=s-(l-g.depth-(x+.5*i))),x-.5*i-(w.height-a)<s&&(a+=s-(x-.5*i-(w.height-a))),c=NV({positionType:"individualShift",children:[{type:"elem",elem:w,shift:a},{type:"elem",elem:r,shift:-(x-.5*i)},{type:"elem",elem:g,shift:-l}]})}else{var k=l-g.depth-(w.height-a);k<s&&(l+=.5*(s-k),a+=.5*(s-k)),c=NV({positionType:"individualShift",children:[{type:"elem",elem:w,shift:a},{type:"elem",elem:g,shift:-l}]})}return n=t.havingStyle(p),c.height*=n.sizeMultiplier/t.sizeMultiplier,c.depth*=n.sizeMultiplier/t.sizeMultiplier,u=p.size===Eg.DISPLAY.size?t.fontMetrics().delim1:p.size===Eg.SCRIPTSCRIPT.size?t.havingStyle(Eg.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,h=null==e.leftDelim?Dl(t,["mopen"]):Id(e.leftDelim,u,!0,t.havingStyle(p),e.mode,["mopen"]),d=e.continued?Nz([]):null==e.rightDelim?Dl(t,["mclose"]):Id(e.rightDelim,u,!0,t.havingStyle(p),e.mode,["mclose"]),Nz(["mord"].concat(n.sizingClasses(t)),[h,Nz(["mfrac"],[c]),d],t)},mathmlBuilder:(e,t)=>{var n=new Du("mfrac",[Dk(e.numer,t),Dk(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=EO(e.barSize,t);n.setAttribute("linethickness",EE(r))}}else n.setAttribute("linethickness","0px");if(null!=e.leftDelim||null!=e.rightDelim){var i=[];if(null!=e.leftDelim){var o=new Du("mo",[new Dh(e.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),i.push(o)}if(i.push(n),null!=e.rightDelim){var l=new Du("mo",[new Dh(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),i.push(l)}return Dg(i)}return n}}),N5({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],numArgs:0,infix:!0,handler(e){var t,{parser:n,funcName:r,token:i}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:i}}});var Iz=["display","text","script","scriptscript"],IP=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};N5({type:"genfrac",names:["\\genfrac"],numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"],handler(e,t){var n,{parser:r}=e,i=t[4],o=t[5],l=N3(t[0]),s="atom"===l.type&&"open"===l.family?IP(l.text):null,a=N3(t[1]),c="atom"===a.type&&"close"===a.family?IP(a.text):null,u=DB(t[2],"size"),h=null;n=!!u.isBlank||(h=u.value).number>0;var d=null,p=t[3];return"ordgroup"===p.type?p.body.length>0&&(d=Iz[Number(DB(p.body[0],"textord").text)]):d=Iz[Number((p=DB(p,"textord")).text)],IR({type:"genfrac",mode:r.mode,numer:i,denom:o,continued:!1,hasBarLine:n,barSize:h,leftDelim:s,rightDelim:c},d)}}),N5({type:"infix",names:["\\above"],numArgs:1,argTypes:["size"],infix:!0,handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:DB(t[0],"size").value,token:i}}}),N5({type:"genfrac",names:["\\\\abovefrac"],numArgs:3,argTypes:["math","size","math"],handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],o=DB(t[1],"infix").size;if(!o)throw Error("\\\\abovefrac expected size, but got "+String(o));var l=t[2],s=o.number>0;return{type:"genfrac",mode:n.mode,numer:i,denom:l,continued:!1,hasBarLine:s,barSize:o,leftDelim:null,rightDelim:null}}});var IB=(e,t)=>{var n,r,i,o=t.style;"supsub"===e.type?(n=e.sup?Ds(e.sup,t.havingStyle(o.sup()),t):Ds(e.sub,t.havingStyle(o.sub()),t),r=DB(e.base,"horizBrace")):r=DB(e,"horizBrace");var l=Ds(r.base,t.havingBaseStyle(Eg.DISPLAY)),s=D_(r,t);if(i=r.isOver?NV({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:s,wrapperClasses:["svg-align"]}]}):NV({positionType:"bottom",positionData:l.depth+.1+s.height,children:[{type:"elem",elem:s,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:l}]}),n){var a=Nz(["minner",r.isOver?"mover":"munder"],[i],t);i=r.isOver?NV({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:n}]}):NV({positionType:"bottom",positionData:a.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:a}]})}return Nz(["minner",r.isOver?"mover":"munder"],[i],t)};N5({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],numArgs:1,handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:r.includes("\\over"),base:t[0]}},htmlBuilder:IB,mathmlBuilder:(e,t)=>{var n=DD(e.label);return new Du(e.isOver?"mover":"munder",[Dk(e.base,t),n])}}),N5({type:"href",names:["\\href"],numArgs:2,argTypes:["url","original"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[1],i=DB(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:n.mode,href:i,body:N7(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Dt(e.body,t,!1);return NF(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Dx(e.body,t);return n instanceof Du||(n=new Du("mrow",[n])),n.setAttribute("href",e.href),n}}),N5({type:"href",names:["\\url"],numArgs:1,argTypes:["url"],allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=DB(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var i=[],o=0;o<r.length;o++){var l=r[o];"~"===l&&(l="\\textasciitilde"),i.push({type:"textord",mode:"text",text:l})}var s={type:"text",mode:n.mode,font:"\\texttt",body:i};return{type:"href",mode:n.mode,href:r,body:N7(s)}}}),N5({type:"hbox",names:["\\hbox"],numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0,handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:N7(t[0])}},htmlBuilder:(e,t)=>NH(Dt(e.body,t.withFont(""),!1)),mathmlBuilder:(e,t)=>new Du("mrow",Dw(e.body,t.withFont("")))}),N5({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],numArgs:2,argTypes:["raw","original"],allowedInText:!0,handler:(e,t)=>{var n,{parser:r,funcName:i,token:o}=e,l=DB(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var a={};switch(i){case"\\htmlClass":a.class=l,n={command:"\\htmlClass",class:l};break;case"\\htmlId":a.id=l,n={command:"\\htmlId",id:l};break;case"\\htmlStyle":a.style=l,n={command:"\\htmlStyle",style:l};break;case"\\htmlData":for(var c=l.split(","),u=0;u<c.length;u++){var h=c[u],d=h.indexOf("=");if(d<0)throw new O6("\\htmlData key/value '"+h+"' missing equals sign");var p=h.slice(0,d),f=h.slice(d+1);a["data-"+p.trim()]=f}n={command:"\\htmlData",attributes:a};break;default:throw Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:a,body:N7(s)}:r.formatUnsupportedCmd(i)},htmlBuilder:(e,t)=>{var n=Dt(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=Nz(r,n,t);for(var o in e.attributes)"class"!==o&&e.attributes.hasOwnProperty(o)&&i.setAttribute(o,e.attributes[o]);return i},mathmlBuilder:(e,t)=>Dx(e.body,t)}),N5({type:"htmlmathml",names:["\\html@mathml"],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:N7(t[0]),mathml:N7(t[1])}},htmlBuilder:(e,t)=>NH(Dt(e.html,t,!1)),mathmlBuilder:(e,t)=>Dx(e.mathml,t)});var IF=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new O6("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!ET(n))throw new O6("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};N5({type:"includegraphics",names:["\\includegraphics"],numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1,handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:"em"},o={number:.9,unit:"em"},l={number:0,unit:"em"},s="";if(n[0])for(var a=DB(n[0],"raw").string.split(","),c=0;c<a.length;c++){var u=a[c].split("=");if(2===u.length){var h=u[1].trim();switch(u[0].trim()){case"alt":s=h;break;case"width":i=IF(h);break;case"height":o=IF(h);break;case"totalheight":l=IF(h);break;default:throw new O6("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var d=DB(t[0],"url").url;return(""===s&&(s=(s=(s=d).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:d}))?{type:"includegraphics",mode:r.mode,alt:s,width:i,height:o,totalheight:l,src:d}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=EO(e.height,t),r=0;e.totalheight.number>0&&(r=EO(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=EO(e.width,t));var o={height:EE(n+r)};i>0&&(o.width=EE(i)),r>0&&(o.verticalAlign=EE(-r));var l=new EB(e.src,e.alt,o);return l.height=n,l.depth=r,l},mathmlBuilder:(e,t)=>{var n=new Du("mglyph",[]);n.setAttribute("alt",e.alt);var r=EO(e.height,t),i=0;if(e.totalheight.number>0&&(i=EO(e.totalheight,t)-r,n.setAttribute("valign",EE(-i))),n.setAttribute("height",EE(r+i)),e.width.number>0){var o=EO(e.width,t);n.setAttribute("width",EE(o))}return n.setAttribute("src",e.src),n}}),N5({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,i=DB(t[0],"size");if(n.settings.strict){var o="m"===r[1],l="mu"===i.value.unit;o?(l||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+i.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):l&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:i.value}},htmlBuilder:(e,t)=>N$(e.dimension,t),mathmlBuilder:(e,t)=>new Dd(EO(e.dimension,t))}),N5({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{"clap"===e.alignment?(n=Nz([],[Ds(e.body,t)]),n=Nz(["inner"],[n],t)):n=Nz(["inner"],[Ds(e.body,t)]);var n,r=Nz(["fix"],[]),i=Nz([e.alignment],[n,r],t),o=Nz(["strut"]);return o.style.height=EE(i.height+i.depth),i.depth&&(o.style.verticalAlign=EE(-i.depth)),i.children.unshift(o),i=Nz(["thinbox"],[i],t),Nz(["mord","vbox"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Du("mpadded",[Dk(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),N5({type:"styling",names:["\\(","$"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var{funcName:n,parser:r}=e,i=r.mode;r.switchMode("math");var o="\\("===n?"\\)":"$",l=r.parseExpression(!1,o);return r.expect(o),r.switchMode(i),{type:"styling",mode:r.mode,style:"text",resetFont:!0,body:l}}}),N5({type:"text",names:["\\)","\\]"],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new O6("Mismatched "+e.funcName)}});var IH=(e,t)=>{switch(t.style.size){case Eg.DISPLAY.size:return e.display;case Eg.TEXT.size:return e.text;case Eg.SCRIPT.size:return e.script;case Eg.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};N5({type:"mathchoice",names:["\\mathchoice"],numArgs:4,primitive:!0,handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:N7(t[0]),text:N7(t[1]),script:N7(t[2]),scriptscript:N7(t[3])}},htmlBuilder:(e,t)=>NH(Dt(IH(e,t),t,!1)),mathmlBuilder:(e,t)=>Dx(IH(e,t),t)});var Iq=(e,t,n,r,i,o,l)=>{e=Nz([],[e]);var s,a,c,u=n&&Eo(n);if(t){var h=Ds(t,r.havingStyle(i.sup()),r);a={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=Ds(n,r.havingStyle(i.sub()),r);s={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(a&&s)c=NV({positionType:"bottom",positionData:r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+l,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:EE(-o)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:a.kern},{type:"elem",elem:a.elem,marginLeft:EE(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]});else if(s)c=NV({positionType:"top",positionData:e.height-l,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:EE(-o)},{type:"kern",size:s.kern},{type:"elem",elem:e}]});else{if(!a)return e;c=NV({positionType:"bottom",positionData:e.depth+l,children:[{type:"elem",elem:e},{type:"kern",size:a.kern},{type:"elem",elem:a.elem,marginLeft:EE(o)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]})}var p=[c];if(s&&0!==o&&!u){var f=Nz(["mspace"],[],r);f.style.marginRight=EE(o),p.unshift(f)}return Nz(["mop","op-limits"],p,r)},Ij=new Set(["\\smallint"]),IV=(e,t)=>{var n,r,i,o,l,s,a=!1;"supsub"===e.type?(n=e.sup,r=e.sub,i=DB(e.base,"op"),a=!0):i=DB(e,"op");var c=t.style,u=!1;if(c.size===Eg.DISPLAY.size&&i.symbol&&!Ij.has(i.name)&&(u=!0),i.symbol){var h=u?"Size2-Regular":"Size1-Regular",d="";("\\oiint"===i.name||"\\oiiint"===i.name)&&(d=i.name.slice(1),i.name="oiint"===d?"\\iint":"\\iiint"),l=(o=NN(i.name,h,"math",t,["mop","op-symbol",u?"large-op":"small-op"])).italic,d.length>0&&(o=NV({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:NK(d+"Size"+(u?"2":"1"),t),shift:.08*!!u}]}),i.name="\\"+d,o.classes.unshift("mop"),o.italic=l)}else if(i.body){var p=Dt(i.body,t,!0);1===p.length&&p[0]instanceof EH?(o=p[0]).classes[0]="mop":o=Nz(["mop"],p,t)}else{for(var f=[],m=1;m<i.name.length;m++)f.push(ND(i.name[m],i.mode,t));o=Nz(["mop"],f,t)}var g=0,y=0;return((o instanceof EH||"\\oiint"===i.name||"\\oiiint"===i.name)&&!i.suppressBaseShift&&(g=(o.height-o.depth)/2-t.fontMetrics().axisHeight,y=null!=(s=o.italic)?s:0),a)?Iq(o,n,r,t,c,y,g):(g&&(o.style.position="relative",o.style.top=EE(g)),o)},I$={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};N5({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],numArgs:0,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return 1===i.length&&(i=I$[i]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:IV,mathmlBuilder:(e,t)=>{var n;if(e.symbol)n=new Du("mo",[Dm(e.name,e.mode)]),Ij.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Du("mo",Dw(e.body,t));else{n=new Du("mi",[new Dh(e.name.slice(1))]);var r=new Du("mo",[Dm("","text")]);n=e.parentIsSupSub?new Du("mrow",[n,r]):new ES([n,r])}return n}}),N5({type:"op",names:["\\mathop"],numArgs:1,primitive:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:N7(r)}}});var IW={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};N5({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),N5({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],numArgs:0,handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),N5({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],numArgs:0,allowedInArgument:!0,handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=IW[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}}});var IU=(e,t)=>{var n,r,i,o,l=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,i=DB(e.base,"operatorname"),l=!0):i=DB(e,"operatorname"),i.body.length>0){for(var s=Dt(i.body.map(e=>{var t="text"in e?e.text:void 0;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),t.withFont("mathrm"),!0),a=0;a<s.length;a++){var c=s[a];c instanceof EH&&(c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}o=Nz(["mop"],s,t)}else o=Nz(["mop"],[],t);return l?Iq(o,n,r,t,t.style,0,0):o};function IG(e,t,n){for(var r=Dt(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,o=0;o<r.length;o++){var l=r[o].classes.indexOf("sizing");l<0?Array.prototype.push.apply(r[o].classes,t.sizingClasses(n)):r[o].classes[l+1]==="reset-size"+t.size&&(r[o].classes[l+1]="reset-size"+n.size),r[o].height*=i,r[o].depth*=i}return NH(r)}N5({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],numArgs:1,handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:"operatorname",mode:n.mode,body:N7(i),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:IU,mathmlBuilder:(e,t)=>{for(var n=Dw(e.body,t.withFont("mathrm")),r=!0,i=0;i<n.length;i++){var o=n[i];if(o instanceof Dd);else if(o instanceof Du)switch(o.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":var l=o.children[0];1===o.children.length&&l instanceof Dh?l.text=l.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}r&&(n=[new Dh(n.map(e=>e.toText()).join(""))]);var s=new Du("mi",n);s.setAttribute("mathvariant","normal");var a=new Du("mo",[Dm("","text")]);return e.parentIsSupSub?new Du("mrow",[s,a]):new ES([s,a])}}),Ix["\\operatorname"]="\\@ifstar\\operatornamewithlimits\\operatorname@",N2({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?NH(Dt(e.body,t,!1)):Nz(["mord"],Dt(e.body,t,!0),t),mathmlBuilder:(e,t)=>Dx(e.body,t,!0)}),N5({type:"overline",names:["\\overline"],numArgs:1,handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=Ds(e.body,t.havingCrampedStyle()),r=NB("overline-line",t),i=t.fontMetrics().defaultRuleThickness;return Nz(["mord","overline"],[NV({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:r},{type:"kern",size:i}]})],t)},mathmlBuilder(e,t){var n=new Du("mo",[new Dh("‾")]);n.setAttribute("stretchy","true");var r=new Du("mover",[Dk(e.body,t),n]);return r.setAttribute("accent","true"),r}}),N5({type:"phantom",names:["\\phantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:N7(r)}},htmlBuilder:(e,t)=>NH(Dt(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Du("mphantom",Dw(e.body,t))}),Ix["\\hphantom"]="\\smash{\\phantom{#1}}",N5({type:"vphantom",names:["\\vphantom"],numArgs:1,allowedInText:!0,handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=Nz(["inner"],[Ds(e.body,t.withPhantom())]),r=Nz(["fix"],[]);return Nz(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=new Du("mphantom",Dw(N7(e.body),t)),r=new Du("mpadded",[n]);return r.setAttribute("width","0px"),r}}),N5({type:"raisebox",names:["\\raisebox"],numArgs:2,argTypes:["size","hbox"],allowedInText:!0,handler(e,t){var{parser:n}=e,r=DB(t[0],"size").value,i=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Ds(e.body,t);return NV({positionType:"shift",positionData:-EO(e.dy,t),children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Du("mpadded",[Dk(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),N5({type:"internal",names:["\\relax"],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),N5({type:"rule",names:["\\rule"],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"],handler(e,t,n){var{parser:r}=e,i=n[0],o=DB(t[0],"size"),l=DB(t[1],"size");return{type:"rule",mode:r.mode,shift:i&&DB(i,"size").value,width:o.value,height:l.value}},htmlBuilder(e,t){var n=Nz(["mord","rule"],[],t),r=EO(e.width,t),i=EO(e.height,t),o=e.shift?EO(e.shift,t):0;return n.style.borderRightWidth=EE(r),n.style.borderTopWidth=EE(i),n.style.bottom=EE(o),n.width=r,n.height=i+o,n.depth=-o,n.maxFontSize=1.125*i*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=EO(e.width,t),r=EO(e.height,t),i=e.shift?EO(e.shift,t):0,o=t.color&&t.getColor()||"black",l=new Du("mspace");l.setAttribute("mathbackground",o),l.setAttribute("width",EE(n)),l.setAttribute("height",EE(r));var s=new Du("mpadded",[l]);return i>=0?s.setAttribute("height",EE(i)):(s.setAttribute("height",EE(i)),s.setAttribute("depth",EE(-i))),s.setAttribute("voffset",EE(i)),s}});var IK=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];N5({type:"sizing",names:IK,numArgs:0,allowedInText:!0,handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,o=i.parseExpression(!1,n);return{type:"sizing",mode:i.mode,size:IK.indexOf(r)+1,body:o}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return IG(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Du("mstyle",Dw(e.body,n));return r.setAttribute("mathsize",EE(n.sizeMultiplier)),r}}),N5({type:"smash",names:["\\smash"],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r,{parser:i}=e,o=!1,l=!1,s=n[0]&&DB(n[0],"ordgroup");if(s)for(var a=0;a<s.body.length;++a)if("t"===(r=DF(s.body[a]).text))o=!0;else if("b"===r)l=!0;else{o=!1,l=!1;break}else o=!0,l=!0;var c=t[0];return{type:"smash",mode:i.mode,body:c,smashHeight:o,smashDepth:l}},htmlBuilder:(e,t)=>{var n=Nz([],[Ds(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return Nz(["mord","smash"],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return Nz(["mord"],[NV({positionType:"firstBaseline",children:[{type:"elem",elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Du("mpadded",[Dk(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),N5({type:"sqrt",names:["\\sqrt"],numArgs:1,numOptionalArgs:1,handler(e,t,n){var{parser:r}=e,i=n[0],o=t[0];return{type:"sqrt",mode:r.mode,body:o,index:i}},htmlBuilder(e,t){var n=Ds(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Nq(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Eg.TEXT.id&&(i=t.fontMetrics().xHeight);var o=r+i/4,{span:l,ruleWidth:s,advanceWidth:a}=It(n.height+n.depth+o+r,t),c=l.height-s;c>n.height+n.depth+o&&(o=(o+c-n.height-n.depth)/2);var u=l.height-n.height-o-s;n.style.paddingLeft=EE(a);var h=NV({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+u)},{type:"elem",elem:l},{type:"kern",size:s}]});if(!e.index)return Nz(["mord","sqrt"],[h],t);var d=t.havingStyle(Eg.SCRIPTSCRIPT),p=Ds(e.index,d,t),f=Nz(["root"],[NV({positionType:"shift",positionData:-(.6*(h.height-h.depth)),children:[{type:"elem",elem:p}]})]);return Nz(["mord","sqrt"],[f,h],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Du("mroot",[Dk(n,t),Dk(r,t)]):new Du("msqrt",[Dk(n,t)])}});var IJ={display:Eg.DISPLAY,text:Eg.TEXT,script:Eg.SCRIPT,scriptscript:Eg.SCRIPTSCRIPT};N5({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,o=i.parseExpression(!0,n),l=r.slice(1,r.length-5);if(!(l in IJ))throw Error("Unknown style: "+l);return{type:"styling",mode:i.mode,style:l,body:o}},htmlBuilder(e,t){var n=IJ[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont("")),IG(e.body,r,t)},mathmlBuilder(e,t){var n=IJ[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(""));var i=new Du("mstyle",Dw(e.body,r)),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var IZ=function(e,t){var n=e.base;if(!n)return null;if("op"===n.type)return n.limits&&(t.style.size===Eg.DISPLAY.size||n.alwaysHandleSupSub)?IV:null;if("operatorname"===n.type)return n.alwaysHandleSupSub&&(t.style.size===Eg.DISPLAY.size||n.limits)?IU:null;if("accent"===n.type)return Eo(n.base)?Dj:null;if("horizBrace"===n.type)return!e.sub===n.isOver?IB:null;else return null};N2({type:"supsub",htmlBuilder(e,t){var n,r=IZ(e,t);if(r)return r(e,t);var{base:i,sup:o,sub:l}=e,s=Ds(i,t),a=t.fontMetrics(),c=0,u=0,h=i&&Eo(i);if(o){var d=t.havingStyle(t.style.sup());y=Ds(o,d,t),h||(c=s.height-d.fontMetrics().supDrop*d.sizeMultiplier/t.sizeMultiplier)}if(l){var p=t.havingStyle(t.style.sub());b=Ds(l,p,t),h||(u=s.depth+p.fontMetrics().subDrop*p.sizeMultiplier/t.sizeMultiplier)}w=t.style===Eg.DISPLAY?a.sup1:t.style.cramped?a.sup3:a.sup2;var f=t.sizeMultiplier,m=EE(.5/a.ptPerEm/f),g=null;if(b){var y,b,w,x,k=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(s instanceof EH||k)&&(g=EE(-(null!=(x=s.italic)?x:0)))}if(y&&b){c=Math.max(c,w,y.depth+.25*a.xHeight),u=Math.max(u,a.sub2);var C=4*a.defaultRuleThickness;if(c-y.depth-(b.height-u)<C){u=C-(c-y.depth)+b.height;var S=.8*a.xHeight-(c-y.depth);S>0&&(c+=S,u-=S)}n=NV({positionType:"individualShift",children:[{type:"elem",elem:b,shift:u,marginRight:m,marginLeft:g},{type:"elem",elem:y,shift:-c,marginRight:m}]})}else if(b)n=NV({positionType:"shift",positionData:u=Math.max(u,a.sub1,b.height-.8*a.xHeight),children:[{type:"elem",elem:b,marginLeft:g,marginRight:m}]});else if(y)n=NV({positionType:"shift",positionData:-(c=Math.max(c,w,y.depth+.25*a.xHeight)),children:[{type:"elem",elem:y,marginRight:m}]});else throw Error("supsub must have either sup or sub.");return Nz([Do(s,"right")||"mord"],[s,Nz(["msupsub"],[n])],t)},mathmlBuilder(e,t){var n,r,i=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(i=!0,n=e.base.isOver),e.base&&("op"===e.base.type||"operatorname"===e.base.type)&&(e.base.parentIsSupSub=!0);var o=[Dk(e.base,t)];if(e.sub&&o.push(Dk(e.sub,t)),e.sup&&o.push(Dk(e.sup,t)),i)r=n?"mover":"munder";else if(e.sub)if(e.sup){var l=e.base;r=l&&"op"===l.type&&l.limits&&t.style===Eg.DISPLAY||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(t.style===Eg.DISPLAY||l.limits)?"munderover":"msubsup"}else{var s=e.base;r=s&&"op"===s.type&&s.limits&&(t.style===Eg.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===Eg.DISPLAY)?"munder":"msub"}else{var a=e.base;r=a&&"op"===a.type&&a.limits&&(t.style===Eg.DISPLAY||a.alwaysHandleSupSub)||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(a.limits||t.style===Eg.DISPLAY)?"mover":"msup"}return new Du(r,o)}}),N2({type:"atom",htmlBuilder:(e,t)=>ND(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new Du("mo",[Dm(e.text,e.mode)]);if("bin"===e.family){var r=Dy(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)}else"punct"===e.family?n.setAttribute("separator","true"):("open"===e.family||"close"===e.family)&&n.setAttribute("stretchy","false");return n}});var IY={mi:"italic",mn:"normal",mtext:"normal"};N2({type:"mathord",htmlBuilder:(e,t)=>NI(e,t),mathmlBuilder(e,t){var n=new Du("mi",[Dm(e.text,e.mode,t)]),r=Dy(e,t)||"italic";return r!==IY[n.type]&&n.setAttribute("mathvariant",r),n}}),N2({type:"textord",htmlBuilder:(e,t)=>NI(e,t),mathmlBuilder(e,t){var n,r=Dm(e.text,e.mode,t),i=Dy(e,t)||"normal";return i!==IY[(n="text"===e.mode?new Du("mtext",[r]):/[0-9]/.test(e.text)?new Du("mn",[r]):"\\prime"===e.text?new Du("mo",[r]):new Du("mi",[r])).type]&&n.setAttribute("mathvariant",i),n}});var IX={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},IQ={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};N2({type:"spacing",htmlBuilder(e,t){if(IQ.hasOwnProperty(e.text)){var n=IQ[e.text].className||"";if("text"!==e.mode)return Nz(["mspace",n],[ND(e.text,e.mode,t)],t);var r=NI(e,t);return r.classes.push(n),r}if(IX.hasOwnProperty(e.text))return Nz(["mspace",IX[e.text]],[],t);throw new O6('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){var n;if(IQ.hasOwnProperty(e.text))n=new Du("mtext",[new Dh(" ")]);else if(IX.hasOwnProperty(e.text))return new Du("mspace");else throw new O6('Unknown type of space "'+e.text+'"');return n}});var I0=()=>{var e=new Du("mtd",[]);return e.setAttribute("width","50%"),e};N2({type:"tag",mathmlBuilder(e,t){var n=new Du("mtable",[new Du("mtr",[I0(),new Du("mtd",[Dx(e.body,t)]),I0(),new Du("mtd",[Dx(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var I1={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},I4={"\\textbf":"textbf","\\textmd":"textmd"},I5={"\\textit":"textit","\\textup":"textup"},I2=(e,t)=>{var n=e.font;return n?I1[n]?t.withTextFontFamily(I1[n]):I4[n]?t.withTextFontWeight(I4[n]):"\\emph"===n?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(I5[n]):t};N5({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0,handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:"text",mode:n.mode,body:N7(i),font:r}},htmlBuilder(e,t){var n=I2(e,t);return Nz(["mord","text"],Dt(e.body,n,!0),n)},mathmlBuilder(e,t){var n=I2(e,t);return Dx(e.body,n)}}),N5({type:"underline",names:["\\underline"],numArgs:1,allowedInText:!0,handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ds(e.body,t),r=NB("underline-line",t),i=t.fontMetrics().defaultRuleThickness;return Nz(["mord","underline"],[NV({positionType:"top",positionData:n.height,children:[{type:"kern",size:i},{type:"elem",elem:r},{type:"kern",size:3*i},{type:"elem",elem:n}]})],t)},mathmlBuilder(e,t){var n=new Du("mo",[new Dh("‾")]);n.setAttribute("stretchy","true");var r=new Du("munder",[Dk(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),N5({type:"vcenter",names:["\\vcenter"],numArgs:1,argTypes:["original"],allowedInText:!1,handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Ds(e.body,t),r=t.fontMetrics().axisHeight;return NV({positionType:"shift",positionData:.5*(n.height-r-(n.depth+r)),children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Du("mpadded",[Dk(e.body,t)],["vcenter"]);return new Du("mrow",[n])}}),N5({type:"verb",names:["\\verb"],numArgs:0,allowedInText:!0,handler(e,t,n){throw new O6("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=I3(e),r=[],i=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var l=n[o];"~"===l&&(l="\\textasciitilde"),r.push(NN(l,"Typewriter-Regular",e.mode,i,["mord","texttt"]))}return Nz(["mord","text"].concat(i.sizingClasses(t)),N_(r),i)},mathmlBuilder(e,t){var n=new Du("mtext",[new Dh(I3(e))]);return n.setAttribute("mathvariant","monospace"),n}});var I3=e=>e.body.replace(/ /g,e.star?"␣":" "),I7="[ \r\n ]",I6="[̀-ͯ]",I8=RegExp(I6+"+$"),I9="("+I7+"+)|\\\\(\n|[ \r ]+\n?)[ \r ]*|([!-\\[\\]-‧-豈-]"+I6+"*|[\uD800-\uDBFF][\uDC00-\uDFFF]"+I6+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)"+I7+"*|\\\\[^\uD800-\uDFFF])";class Le{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=RegExp(I9,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new IC("EOF",new Ik(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new O6("Unexpected character: '"+e[t]+"'",new IC(e[t],new Ik(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ");if(14===this.catcodes[r]){var i=e.indexOf("\n",this.tokenRegex.lastIndex);return -1===i?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new IC(r,new Ik(this,t,this.tokenRegex.lastIndex))}}class Lt{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new O6("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}Ix["\\noexpand"]=function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}},Ix["\\expandafter"]=function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}},Ix["\\@firstoftwo"]=function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}},Ix["\\@secondoftwo"]=function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}},Ix["\\@ifnextchar"]=function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}},Ix["\\@ifstar"]="\\@ifnextchar *{\\@firstoftwo{#1}}",Ix["\\TextOrMath"]=function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}};var Ln={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Ix["\\char"]=function(e){var t,n,r=e.popToken(),i=0;if("'"===r.text)t=8,r=e.popToken();else if('"'===r.text)t=16,r=e.popToken();else if("`"===r.text)if("\\"===(r=e.popToken()).text[0])i=r.text.charCodeAt(1);else if("EOF"===r.text)throw new O6("\\char` missing argument");else i=r.text.charCodeAt(0);else t=10;if(t){if(null==(i=Ln[r.text])||i>=t)throw new O6("Invalid base-"+t+" digit "+r.text);for(;null!=(n=Ln[e.future().text])&&n<t;)i*=t,i+=n,e.popToken()}return"\\@char{"+i+"}"};var Lr=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(1!==i.length)throw new O6("\\newcommand's first argument must be a macro name");var o=i[0].text,l=e.isDefined(o);if(l&&!t)throw new O6("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!l&&!n)throw new O6("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var s=0;if(1===(i=e.consumeArg().tokens).length&&"["===i[0].text){for(var a="",c=e.expandNextToken();"]"!==c.text&&"EOF"!==c.text;)a+=c.text,c=e.expandNextToken();if(!a.match(/^\s*[0-9]+\s*$/))throw new O6("Invalid number of arguments: "+a);s=parseInt(a),i=e.consumeArg().tokens}return l&&r||e.macros.set(o,{tokens:i,numArgs:s}),""};Ix["\\newcommand"]=e=>Lr(e,!1,!0,!1),Ix["\\renewcommand"]=e=>Lr(e,!0,!1,!1),Ix["\\providecommand"]=e=>Lr(e,!0,!0,!0),Ix["\\message"]=e=>(console.log(e.consumeArgs(1)[0].reverse().map(e=>e.text).join("")),""),Ix["\\errmessage"]=e=>(console.error(e.consumeArgs(1)[0].reverse().map(e=>e.text).join("")),""),Ix["\\show"]=e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),N0[n],EJ.math[n],EJ.text[n]),""},Ix["\\bgroup"]="{",Ix["\\egroup"]="}",Ix["~"]="\\nobreakspace",Ix["\\lq"]="`",Ix["\\rq"]="'",Ix["\\aa"]="\\r a",Ix["\\AA"]="\\r A",Ix["\\textcopyright"]="\\html@mathml{\\textcircled{c}}{\\char`©}",Ix["\\copyright"]="\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}",Ix["\\textregistered"]="\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}",Ix["ℬ"]="\\mathscr{B}",Ix["ℰ"]="\\mathscr{E}",Ix["ℱ"]="\\mathscr{F}",Ix["ℋ"]="\\mathscr{H}",Ix["ℐ"]="\\mathscr{I}",Ix["ℒ"]="\\mathscr{L}",Ix["ℳ"]="\\mathscr{M}",Ix["ℛ"]="\\mathscr{R}",Ix["ℭ"]="\\mathfrak{C}",Ix["ℌ"]="\\mathfrak{H}",Ix["ℨ"]="\\mathfrak{Z}",Ix["\\Bbbk"]="\\Bbb{k}",Ix["\\llap"]="\\mathllap{\\textrm{#1}}",Ix["\\rlap"]="\\mathrlap{\\textrm{#1}}",Ix["\\clap"]="\\mathclap{\\textrm{#1}}",Ix["\\mathstrut"]="\\vphantom{(}",Ix["\\underbar"]="\\underline{\\text{#1}}",Ix["\\not"]='\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}',Ix["\\neq"]="\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}",Ix["\\ne"]="\\neq",Ix["≠"]="\\neq",Ix["\\notin"]="\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}",Ix["∉"]="\\notin",Ix["≘"]="\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}",Ix["≙"]="\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}",Ix["≚"]="\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}",Ix["≛"]="\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}",Ix["≝"]="\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}",Ix["≞"]="\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}",Ix["≟"]="\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}",Ix["⟂"]="\\perp",Ix["‼"]="\\mathclose{!\\mkern-0.8mu!}",Ix["∌"]="\\notni",Ix["⌜"]="\\ulcorner",Ix["⌝"]="\\urcorner",Ix["⌞"]="\\llcorner",Ix["⌟"]="\\lrcorner",Ix["©"]="\\copyright",Ix["®"]="\\textregistered",Ix["\\ulcorner"]='\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}',Ix["\\urcorner"]='\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}',Ix["\\llcorner"]='\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}',Ix["\\lrcorner"]='\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}',Ix["\\vdots"]="{\\varvdots\\rule{0pt}{15pt}}",Ix["⋮"]="\\vdots",Ix["\\varGamma"]="\\mathit{\\Gamma}",Ix["\\varDelta"]="\\mathit{\\Delta}",Ix["\\varTheta"]="\\mathit{\\Theta}",Ix["\\varLambda"]="\\mathit{\\Lambda}",Ix["\\varXi"]="\\mathit{\\Xi}",Ix["\\varPi"]="\\mathit{\\Pi}",Ix["\\varSigma"]="\\mathit{\\Sigma}",Ix["\\varUpsilon"]="\\mathit{\\Upsilon}",Ix["\\varPhi"]="\\mathit{\\Phi}",Ix["\\varPsi"]="\\mathit{\\Psi}",Ix["\\varOmega"]="\\mathit{\\Omega}",Ix["\\substack"]="\\begin{subarray}{c}#1\\end{subarray}",Ix["\\colon"]="\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax",Ix["\\boxed"]="\\fbox{$\\displaystyle{#1}$}",Ix["\\iff"]="\\DOTSB\\;\\Longleftrightarrow\\;",Ix["\\implies"]="\\DOTSB\\;\\Longrightarrow\\;",Ix["\\impliedby"]="\\DOTSB\\;\\Longleftarrow\\;",Ix["\\dddot"]="{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}",Ix["\\ddddot"]="{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}";var Li={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},Lo=new Set(["bin","rel"]);Ix["\\dots"]=function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in Li?t=Li[n]:"\\not"===n.slice(0,4)?t="\\dotsb":n in EJ.math&&Lo.has(EJ.math[n].group)&&(t="\\dotsb"),t};var Ll={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Ix["\\dotso"]=function(e){return e.future().text in Ll?"\\ldots\\,":"\\ldots"},Ix["\\dotsc"]=function(e){var t=e.future().text;return t in Ll&&","!==t?"\\ldots\\,":"\\ldots"},Ix["\\cdots"]=function(e){return e.future().text in Ll?"\\@cdots\\,":"\\@cdots"},Ix["\\dotsb"]="\\cdots",Ix["\\dotsm"]="\\cdots",Ix["\\dotsi"]="\\!\\cdots",Ix["\\dotsx"]="\\ldots\\,",Ix["\\DOTSI"]="\\relax",Ix["\\DOTSB"]="\\relax",Ix["\\DOTSX"]="\\relax",Ix["\\tmspace"]="\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax",Ix["\\,"]="\\tmspace+{3mu}{.1667em}",Ix["\\thinspace"]="\\,",Ix["\\>"]="\\mskip{4mu}",Ix["\\:"]="\\tmspace+{4mu}{.2222em}",Ix["\\medspace"]="\\:",Ix["\\;"]="\\tmspace+{5mu}{.2777em}",Ix["\\thickspace"]="\\;",Ix["\\!"]="\\tmspace-{3mu}{.1667em}",Ix["\\negthinspace"]="\\!",Ix["\\negmedspace"]="\\tmspace-{4mu}{.2222em}",Ix["\\negthickspace"]="\\tmspace-{5mu}{.277em}",Ix["\\enspace"]="\\kern.5em ",Ix["\\enskip"]="\\hskip.5em\\relax",Ix["\\quad"]="\\hskip1em\\relax",Ix["\\qquad"]="\\hskip2em\\relax",Ix["\\tag"]="\\@ifstar\\tag@literal\\tag@paren",Ix["\\tag@paren"]="\\tag@literal{({#1})}",Ix["\\tag@literal"]=e=>{if(e.macros.get("\\df@tag"))throw new O6("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"},Ix["\\bmod"]="\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}",Ix["\\pod"]="\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)",Ix["\\pmod"]="\\pod{{\\rm mod}\\mkern6mu#1}",Ix["\\mod"]="\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1",Ix["\\newline"]="\\\\\\relax",Ix["\\TeX"]="\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}";var Ls=EE(E$["Main-Regular"][84][1]-.7*E$["Main-Regular"][65][1]);Ix["\\LaTeX"]="\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Ls+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}",Ix["\\KaTeX"]="\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Ls+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}",Ix["\\hspace"]="\\@ifstar\\@hspacer\\@hspace",Ix["\\@hspace"]="\\hskip #1\\relax",Ix["\\@hspacer"]="\\rule{0pt}{0pt}\\hskip #1\\relax",Ix["\\ordinarycolon"]=":",Ix["\\vcentcolon"]="\\mathrel{\\mathop\\ordinarycolon}",Ix["\\dblcolon"]='\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}',Ix["\\coloneqq"]='\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}',Ix["\\Coloneqq"]='\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}',Ix["\\coloneq"]='\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}',Ix["\\Coloneq"]='\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}',Ix["\\eqqcolon"]='\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}',Ix["\\Eqqcolon"]='\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}',Ix["\\eqcolon"]='\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}',Ix["\\Eqcolon"]='\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}',Ix["\\colonapprox"]='\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}',Ix["\\Colonapprox"]='\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}',Ix["\\colonsim"]='\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}',Ix["\\Colonsim"]='\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}',Ix["∷"]="\\dblcolon",Ix["∹"]="\\eqcolon",Ix["≔"]="\\coloneqq",Ix["≕"]="\\eqqcolon",Ix["⩴"]="\\Coloneqq",Ix["\\ratio"]="\\vcentcolon",Ix["\\coloncolon"]="\\dblcolon",Ix["\\colonequals"]="\\coloneqq",Ix["\\coloncolonequals"]="\\Coloneqq",Ix["\\equalscolon"]="\\eqqcolon",Ix["\\equalscoloncolon"]="\\Eqqcolon",Ix["\\colonminus"]="\\coloneq",Ix["\\coloncolonminus"]="\\Coloneq",Ix["\\minuscolon"]="\\eqcolon",Ix["\\minuscoloncolon"]="\\Eqcolon",Ix["\\coloncolonapprox"]="\\Colonapprox",Ix["\\coloncolonsim"]="\\Colonsim",Ix["\\simcolon"]="\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Ix["\\simcoloncolon"]="\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}",Ix["\\approxcolon"]="\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}",Ix["\\approxcoloncolon"]="\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}",Ix["\\notni"]="\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}",Ix["\\limsup"]="\\DOTSB\\operatorname*{lim\\,sup}",Ix["\\liminf"]="\\DOTSB\\operatorname*{lim\\,inf}",Ix["\\injlim"]="\\DOTSB\\operatorname*{inj\\,lim}",Ix["\\projlim"]="\\DOTSB\\operatorname*{proj\\,lim}",Ix["\\varlimsup"]="\\DOTSB\\operatorname*{\\overline{lim}}",Ix["\\varliminf"]="\\DOTSB\\operatorname*{\\underline{lim}}",Ix["\\varinjlim"]="\\DOTSB\\operatorname*{\\underrightarrow{lim}}",Ix["\\varprojlim"]="\\DOTSB\\operatorname*{\\underleftarrow{lim}}",Ix["\\gvertneqq"]="\\html@mathml{\\@gvertneqq}{≩}",Ix["\\lvertneqq"]="\\html@mathml{\\@lvertneqq}{≨}",Ix["\\ngeqq"]="\\html@mathml{\\@ngeqq}{≱}",Ix["\\ngeqslant"]="\\html@mathml{\\@ngeqslant}{≱}",Ix["\\nleqq"]="\\html@mathml{\\@nleqq}{≰}",Ix["\\nleqslant"]="\\html@mathml{\\@nleqslant}{≰}",Ix["\\nshortmid"]="\\html@mathml{\\@nshortmid}{∤}",Ix["\\nshortparallel"]="\\html@mathml{\\@nshortparallel}{∦}",Ix["\\nsubseteqq"]="\\html@mathml{\\@nsubseteqq}{⊈}",Ix["\\nsupseteqq"]="\\html@mathml{\\@nsupseteqq}{⊉}",Ix["\\varsubsetneq"]="\\html@mathml{\\@varsubsetneq}{⊊}",Ix["\\varsubsetneqq"]="\\html@mathml{\\@varsubsetneqq}{⫋}",Ix["\\varsupsetneq"]="\\html@mathml{\\@varsupsetneq}{⊋}",Ix["\\varsupsetneqq"]="\\html@mathml{\\@varsupsetneqq}{⫌}",Ix["\\imath"]="\\html@mathml{\\@imath}{ı}",Ix["\\jmath"]="\\html@mathml{\\@jmath}{ȷ}",Ix["\\llbracket"]="\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}",Ix["\\rrbracket"]="\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}",Ix["⟦"]="\\llbracket",Ix["⟧"]="\\rrbracket",Ix["\\lBrace"]="\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}",Ix["\\rBrace"]="\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}",Ix["⦃"]="\\lBrace",Ix["⦄"]="\\rBrace",Ix["\\minuso"]="\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}",Ix["⦵"]="\\minuso",Ix["\\darr"]="\\downarrow",Ix["\\dArr"]="\\Downarrow",Ix["\\Darr"]="\\Downarrow",Ix["\\lang"]="\\langle",Ix["\\rang"]="\\rangle",Ix["\\uarr"]="\\uparrow",Ix["\\uArr"]="\\Uparrow",Ix["\\Uarr"]="\\Uparrow",Ix["\\N"]="\\mathbb{N}",Ix["\\R"]="\\mathbb{R}",Ix["\\Z"]="\\mathbb{Z}",Ix["\\alef"]="\\aleph",Ix["\\alefsym"]="\\aleph",Ix["\\Alpha"]="\\mathrm{A}",Ix["\\Beta"]="\\mathrm{B}",Ix["\\bull"]="\\bullet",Ix["\\Chi"]="\\mathrm{X}",Ix["\\clubs"]="\\clubsuit",Ix["\\cnums"]="\\mathbb{C}",Ix["\\Complex"]="\\mathbb{C}",Ix["\\Dagger"]="\\ddagger",Ix["\\diamonds"]="\\diamondsuit",Ix["\\empty"]="\\emptyset",Ix["\\Epsilon"]="\\mathrm{E}",Ix["\\Eta"]="\\mathrm{H}",Ix["\\exist"]="\\exists",Ix["\\harr"]="\\leftrightarrow",Ix["\\hArr"]="\\Leftrightarrow",Ix["\\Harr"]="\\Leftrightarrow",Ix["\\hearts"]="\\heartsuit",Ix["\\image"]="\\Im",Ix["\\infin"]="\\infty",Ix["\\Iota"]="\\mathrm{I}",Ix["\\isin"]="\\in",Ix["\\Kappa"]="\\mathrm{K}",Ix["\\larr"]="\\leftarrow",Ix["\\lArr"]="\\Leftarrow",Ix["\\Larr"]="\\Leftarrow",Ix["\\lrarr"]="\\leftrightarrow",Ix["\\lrArr"]="\\Leftrightarrow",Ix["\\Lrarr"]="\\Leftrightarrow",Ix["\\Mu"]="\\mathrm{M}",Ix["\\natnums"]="\\mathbb{N}",Ix["\\Nu"]="\\mathrm{N}",Ix["\\Omicron"]="\\mathrm{O}",Ix["\\plusmn"]="\\pm",Ix["\\rarr"]="\\rightarrow",Ix["\\rArr"]="\\Rightarrow",Ix["\\Rarr"]="\\Rightarrow",Ix["\\real"]="\\Re",Ix["\\reals"]="\\mathbb{R}",Ix["\\Reals"]="\\mathbb{R}",Ix["\\Rho"]="\\mathrm{P}",Ix["\\sdot"]="\\cdot",Ix["\\sect"]="\\S",Ix["\\spades"]="\\spadesuit",Ix["\\sub"]="\\subset",Ix["\\sube"]="\\subseteq",Ix["\\supe"]="\\supseteq",Ix["\\Tau"]="\\mathrm{T}",Ix["\\thetasym"]="\\vartheta",Ix["\\weierp"]="\\wp",Ix["\\Zeta"]="\\mathrm{Z}",Ix["\\argmin"]="\\DOTSB\\operatorname*{arg\\,min}",Ix["\\argmax"]="\\DOTSB\\operatorname*{arg\\,max}",Ix["\\plim"]="\\DOTSB\\mathop{\\operatorname{plim}}\\limits",Ix["\\bra"]="\\mathinner{\\langle{#1}|}",Ix["\\ket"]="\\mathinner{|{#1}\\rangle}",Ix["\\braket"]="\\mathinner{\\langle{#1}\\rangle}",Ix["\\Bra"]="\\left\\langle#1\\right|",Ix["\\Ket"]="\\left|#1\\right\\rangle";var La=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,o=t.consumeArg().tokens,l=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var a=t=>n=>{e&&(n.macros.set("|",l),i.length&&n.macros.set("\\|",s));var o=t;return!t&&i.length&&"|"===n.future().text&&(n.popToken(),o=!0),{tokens:o?i:r,numArgs:0}};t.macros.set("|",a(!1)),i.length&&t.macros.set("\\|",a(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...o,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};_=La(!1),Ix["\\bra@ket"]=_,R=La(!0),Ix["\\bra@set"]=R,Ix["\\Braket"]="\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}",Ix["\\Set"]="\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}",Ix["\\set"]="\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}",Ix["\\angln"]="{\\angl n}",Ix["\\blue"]="\\textcolor{##6495ed}{#1}",Ix["\\orange"]="\\textcolor{##ffa500}{#1}",Ix["\\pink"]="\\textcolor{##ff00af}{#1}",Ix["\\red"]="\\textcolor{##df0030}{#1}",Ix["\\green"]="\\textcolor{##28ae7b}{#1}",Ix["\\gray"]="\\textcolor{gray}{#1}",Ix["\\purple"]="\\textcolor{##9d38bd}{#1}",Ix["\\blueA"]="\\textcolor{##ccfaff}{#1}",Ix["\\blueB"]="\\textcolor{##80f6ff}{#1}",Ix["\\blueC"]="\\textcolor{##63d9ea}{#1}",Ix["\\blueD"]="\\textcolor{##11accd}{#1}",Ix["\\blueE"]="\\textcolor{##0c7f99}{#1}",Ix["\\tealA"]="\\textcolor{##94fff5}{#1}",Ix["\\tealB"]="\\textcolor{##26edd5}{#1}",Ix["\\tealC"]="\\textcolor{##01d1c1}{#1}",Ix["\\tealD"]="\\textcolor{##01a995}{#1}",Ix["\\tealE"]="\\textcolor{##208170}{#1}",Ix["\\greenA"]="\\textcolor{##b6ffb0}{#1}",Ix["\\greenB"]="\\textcolor{##8af281}{#1}",Ix["\\greenC"]="\\textcolor{##74cf70}{#1}",Ix["\\greenD"]="\\textcolor{##1fab54}{#1}",Ix["\\greenE"]="\\textcolor{##0d923f}{#1}",Ix["\\goldA"]="\\textcolor{##ffd0a9}{#1}",Ix["\\goldB"]="\\textcolor{##ffbb71}{#1}",Ix["\\goldC"]="\\textcolor{##ff9c39}{#1}",Ix["\\goldD"]="\\textcolor{##e07d10}{#1}",Ix["\\goldE"]="\\textcolor{##a75a05}{#1}",Ix["\\redA"]="\\textcolor{##fca9a9}{#1}",Ix["\\redB"]="\\textcolor{##ff8482}{#1}",Ix["\\redC"]="\\textcolor{##f9685d}{#1}",Ix["\\redD"]="\\textcolor{##e84d39}{#1}",Ix["\\redE"]="\\textcolor{##bc2612}{#1}",Ix["\\maroonA"]="\\textcolor{##ffbde0}{#1}",Ix["\\maroonB"]="\\textcolor{##ff92c6}{#1}",Ix["\\maroonC"]="\\textcolor{##ed5fa6}{#1}",Ix["\\maroonD"]="\\textcolor{##ca337c}{#1}",Ix["\\maroonE"]="\\textcolor{##9e034e}{#1}",Ix["\\purpleA"]="\\textcolor{##ddd7ff}{#1}",Ix["\\purpleB"]="\\textcolor{##c6b9fc}{#1}",Ix["\\purpleC"]="\\textcolor{##aa87ff}{#1}",Ix["\\purpleD"]="\\textcolor{##7854ab}{#1}",Ix["\\purpleE"]="\\textcolor{##543b78}{#1}",Ix["\\mintA"]="\\textcolor{##f5f9e8}{#1}",Ix["\\mintB"]="\\textcolor{##edf2df}{#1}",Ix["\\mintC"]="\\textcolor{##e0e5cc}{#1}",Ix["\\grayA"]="\\textcolor{##f6f7f7}{#1}",Ix["\\grayB"]="\\textcolor{##f0f1f2}{#1}",Ix["\\grayC"]="\\textcolor{##e3e5e6}{#1}",Ix["\\grayD"]="\\textcolor{##d6d8da}{#1}",Ix["\\grayE"]="\\textcolor{##babec2}{#1}",Ix["\\grayF"]="\\textcolor{##888d93}{#1}",Ix["\\grayG"]="\\textcolor{##626569}{#1}",Ix["\\grayH"]="\\textcolor{##3b3e40}{#1}",Ix["\\grayI"]="\\textcolor{##21242c}{#1}",Ix["\\kaBlue"]="\\textcolor{##314453}{#1}",Ix["\\kaGreen"]="\\textcolor{##71B307}{#1}";var Lc={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class Lu{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Lt(Ix,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new Le(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),{tokens:r,end:n}=this.consumeArg(["]"])}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new IC("EOF",n.loc)),this.pushTokens(r),new IC("",Ik.range(t,n))}consumeSpaces(){for(;;)if(" "===this.future().text)this.stack.pop();else break}consumeArg(e){var t,n=[],r=e&&e.length>0;r||this.consumeSpaces();var i=this.future(),o=0,l=0;do{if(t=this.popToken(),n.push(t),"{"===t.text)++o;else if("}"===t.text){if(-1==--o)throw new O6("Extra }",t)}else if("EOF"===t.text)throw new O6("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",t);if(e&&r)if((0===o||1===o&&"{"===e[l])&&t.text===e[l]){if(++l===e.length){n.splice(-l,l);break}}else l=0}while(0!==o||r)return"{"===i.text&&"}"===n[n.length-1].text&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:t}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new O6("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new O6("Use of the macro doesn't match its definition",i)}}for(var o=[],l=0;l<e;l++)o.push(this.consumeArg(t&&t[l+1]).tokens);return o}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new O6("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new O6("Undefined control sequence: "+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,o=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var l=i.length-1;l>=0;--l){var s=i[l];if("#"===s.text){if(0===l)throw new O6("Incomplete placeholder at end of macro body",s);if("#"===(s=i[--l]).text)i.splice(l+1,1);else if(/^[1-9]$/.test(s.text))i.splice(l,2,...o[s.text-1]);else throw new O6("Not a valid argument number",s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new IC(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(!1===this.expandOnce(!0)){var r=this.stack.pop();r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var i=0;if(r.includes("#"))for(var o=r.replace(/##/g,"");o.includes("#"+(i+1));)++i;for(var l=new Le(r,this.settings),s=[],a=l.lex();"EOF"!==a.text;)s.push(a),a=l.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||N0.hasOwnProperty(e)||EJ.math.hasOwnProperty(e)||EJ.text.hasOwnProperty(e)||Lc.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:N0.hasOwnProperty(e)&&!N0[e].primitive}}var Lh=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Ld=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9",ₐ:"a",ₑ:"e",ₕ:"h",ᵢ:"i",ⱼ:"j",ₖ:"k",ₗ:"l",ₘ:"m",ₙ:"n",ₒ:"o",ₚ:"p",ᵣ:"r",ₛ:"s",ₜ:"t",ᵤ:"u",ᵥ:"v",ₓ:"x",ᵦ:"β",ᵧ:"γ",ᵨ:"ρ",ᵩ:"ϕ",ᵪ:"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9",ᴬ:"A",ᴮ:"B",ᴰ:"D",ᴱ:"E",ᴳ:"G",ᴴ:"H",ᴵ:"I",ᴶ:"J",ᴷ:"K",ᴸ:"L",ᴹ:"M",ᴺ:"N",ᴼ:"O",ᴾ:"P",ᴿ:"R",ᵀ:"T",ᵁ:"U",ⱽ:"V",ᵂ:"W",ᵃ:"a",ᵇ:"b",ᶜ:"c",ᵈ:"d",ᵉ:"e",ᶠ:"f",ᵍ:"g",ʰ:"h",ⁱ:"i",ʲ:"j",ᵏ:"k",ˡ:"l",ᵐ:"m",ⁿ:"n",ᵒ:"o",ᵖ:"p",ʳ:"r",ˢ:"s",ᵗ:"t",ᵘ:"u",ᵛ:"v",ʷ:"w",ˣ:"x",ʸ:"y",ᶻ:"z",ᵝ:"β",ᵞ:"γ",ᵟ:"δ",ᵠ:"ϕ",ᵡ:"χ",ᶿ:"θ"}),Lp={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},Lf={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Lm{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Lu(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new O6("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new IC("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(Lm.endOfExpression.has(r.text)||t&&r.text===t||e&&N0[r.text]&&N0[r.text].infix)break;var i=this.parseAtom(t);if(i){if("internal"===i.type)continue}else break;n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n=0;n<e.length;n++){var r=e[n];if("infix"===r.type){if(-1!==t)throw new O6("only one infix operator per group",r.token);t=n,i=r.replaceWith}}if(-1===t||!i)return e;var i,o,l,s=e.slice(0,t),a=e.slice(t+1);return o=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},l=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},["\\\\abovefrac"===i?this.callFunction(i,[o,e[t],l],[]):this.callFunction(i,[o,l],[])]}handleSupSubscript(e){var t,n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();do t=this.parseGroup(e);while((null==t?void 0:t.type)==="internal")if(!t)throw new O6("Expected group after '"+r+"'",n);return t}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t,n,r=this.parseGroup("atom",e);if((null==r?void 0:r.type)==="internal"||"text"===this.mode)return r;for(;;){this.consumeSpaces();var i=this.fetch();if("\\limits"===i.text||"\\nolimits"===i.text){if(r&&"op"===r.type)r.limits="\\limits"===i.text,r.alwaysHandleSupSub=!0;else if(r&&"operatorname"===r.type)r.alwaysHandleSupSub&&(r.limits="\\limits"===i.text);else throw new O6("Limit controls must follow a math operator",i);this.consume()}else if("^"===i.text){if(t)throw new O6("Double superscript",i);t=this.handleSupSubscript("superscript")}else if("_"===i.text){if(n)throw new O6("Double subscript",i);n=this.handleSupSubscript("subscript")}else if("'"===i.text){if(t)throw new O6("Double superscript",i);var o={type:"textord",mode:this.mode,text:"\\prime"},l=[o];for(this.consume();"'"===this.fetch().text;)l.push(o),this.consume();"^"===this.fetch().text&&l.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:l}}else if(Ld[i.text]){var s=Lh.test(i.text),a=[];for(a.push(new IC(Ld[i.text])),this.consume();;){var c=this.fetch().text;if(!Ld[c]||Lh.test(c)!==s)break;a.unshift(new IC(Ld[c])),this.consume()}var u=this.subparse(a);s?n={type:"ordgroup",mode:"math",body:u}:t={type:"ordgroup",mode:"math",body:u}}else break}return t&&n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:t?{type:"supsub",mode:this.mode,base:r,sup:t}:n?{type:"supsub",mode:this.mode,base:r,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,i=N0[r];if(!i)return null;if(this.consume(),t&&"atom"!==t&&!i.allowedInArgument)throw new O6("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"!==this.mode||i.allowedInText){if("math"===this.mode&&!1===i.allowedInMath)throw new O6("Can't use function '"+r+"' in math mode",n)}else throw new O6("Can't use function '"+r+"' in text mode",n);var{args:o,optArgs:l}=this.parseArguments(r,i);return this.callFunction(r,o,l,n,e)}callFunction(e,t,n,r,i){var o=N0[e];if(o&&o.handler)return o.handler({funcName:e,parser:this,token:r,breakOnTokenText:i},t,n);throw new O6("No function handler for "+e)}parseArguments(e,t){var n=null!=(s=t.numOptionalArgs)?s:0,r=t.numArgs+n;if(0===r)return{args:[],optArgs:[]};for(var i=[],o=[],l=0;l<r;l++){var s,a,c=null==(a=t.argTypes)?void 0:a[l],u=l<n;("primitive"in t&&t.primitive&&null==c||"sqrt"===t.type&&1===l&&null==o[0])&&(c="primitive");var h=this.parseGroupOfType("argument to '"+e+"'",c,u);if(u)o.push(h);else if(null!=h)i.push(h);else throw new O6("Null argument, please report this as a bug")}return{args:i,optArgs:o}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text",resetFont:!0}:null;case"raw":var i=this.parseStringGroup(n);return null!=i?{type:"raw",mode:"text",string:i.text}:null;case"primitive":if(n)throw new O6("A primitive argument cannot be optional");var o=this.parseGroup(e);if(null==o)throw new O6("Expected group as "+e,this.fetch());return o;case"original":case void 0:return this.parseArgumentGroup(n);default:throw new O6("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e){var t,n=this.gullet.scanArgument(e);if(null==n)return null;for(var r="";"EOF"!==(t=this.fetch()).text;)r+=t.text,this.consume();return this.consume(),n.text=r,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),i=r,o="";"EOF"!==(n=this.fetch()).text&&e.test(o+n.text);)o+=(i=n).text,this.consume();if(""===o)throw new O6("Invalid "+t+": '"+r.text+"'",r);return r.range(i,o)}parseColorGroup(e){var t=this.parseStringGroup(e);if(null==t)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new O6("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),!(t=e||"{"===this.gullet.future().text?this.parseStringGroup(e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new O6("Invalid size: '"+t.text+"'",t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!ET(i))throw new O6("Invalid unit: '"+i.unit+"'",t);return{type:"size",mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),o}parseGroup(e,t){var n,r=this.fetch(),i=r.text;if("{"===i||"\\begingroup"===i){this.consume();var o="{"===i?"}":"\\endgroup";this.gullet.beginGroup();var l=this.parseExpression(!1,o),s=this.fetch();this.expect(o),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Ik.range(r,s),body:l,semisimple:"\\begingroup"===i||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===i[0]&&!Lc.hasOwnProperty(i)){if(this.settings.throwOnError)throw new O6("Undefined control sequence: "+i,r);n=this.formatUnsupportedCmd(i),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if("textord"===r.type){var i=r.text,o=e[n+1];if(o&&"textord"===o.type){if("-"===i&&"-"===o.text){var l=e[n+2];n+1<t&&l&&"textord"===l.type&&"-"===l.text?(e.splice(n,3,{type:"textord",mode:"text",loc:Ik.range(r,l),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Ik.range(r,o),text:"--"}),t-=1)}("'"===i||"`"===i)&&o.text===i&&(e.splice(n,2,{type:"textord",mode:"text",loc:Ik.range(r,o),text:i+i}),t-=1)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new O6("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}Lf.hasOwnProperty(t[0])&&!EJ[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=Lf[t[0]]+t.slice(1));var i=I8.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),EJ[this.mode][t]){this.settings.strict&&"math"===this.mode&&Np.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var o,l,s=EJ[this.mode][t].group,a=Ik.range(e);o=l=s in Dz?{type:"atom",mode:this.mode,family:s,loc:a,text:t}:{type:s,mode:this.mode,loc:a,text:t}}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(Eb(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Ik.range(e),text:t}}if(this.consume(),i)for(var c=0;c<i[0].length;c++){var u=i[0][c];if(!Lp[u])throw new O6("Unknown accent ' "+u+"'",e);var h=Lp[u][this.mode]||Lp[u].text;if(!h)throw new O6("Accent "+u+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Ik.range(e),label:h,isStretchy:!1,isShifty:!0,base:o}}return o}}Lm.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Lg=function(e,t){if(!("string"==typeof e||e instanceof String))throw TypeError("KaTeX can only parse string typed expression");var n=new Lm(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse();if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new O6("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new IC("\\df@tag")])}]}return r},Lv=function(e,t,n){t.textContent="";var r=Lb(e,n).toNode();t.appendChild(r)};"u">typeof document&&"CSS1Compat"!==document.compatMode&&("u">typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Lv=function(){throw new O6("KaTeX doesn't work in quirks mode.")});var Ly=function(e,t,n){if(n.throwOnError||!(e instanceof O6))throw e;var r=Nz(["katex-error"],[new EH(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},Lb=function(e,t){var n=new Es(t);try{var r=Lg(e,n);return DE(r,e,n)}catch(t){return Ly(t,e,n)}},Lw=Lv;let Lx={tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,l=0;return function(t){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),function t(r){return 36===r?(e.consume(r),l++,t):l<2?n(r):(e.exit("mathFlowFenceSequence"),rq(e,s,"whitespace")(r))}(t)};function s(t){return null===t||rR(t)?a(t):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(r){return null===r||rR(r)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),a(r)):36===r?n(r):(e.consume(r),t)}(t))}function a(n){return(e.exit("mathFlowFence"),r.interrupt)?t(n):e.attempt(Lk,c,d)(n)}function c(t){return e.attempt({tokenize:p,partial:!0},d,u)(t)}function u(t){return(o?rq(e,h,"linePrefix",o+1):h)(t)}function h(t){return null===t?d(t):rR(t)?e.attempt(Lk,c,d)(t):(e.enter("mathFlowValue"),function t(n){return null===n||rR(n)?(e.exit("mathFlowValue"),h(n)):(e.consume(n),t)}(t))}function d(n){return e.exit("mathFlow"),t(n)}function p(e,t,n){let i=0;return rq(e,function(t){return e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),function t(r){return 36===r?(i++,e.consume(r),t):i<l?n(r):(e.exit("mathFlowFenceSequence"),rq(e,o,"whitespace")(r))}(t)},"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function o(r){return null===r||rR(r)?(e.exit("mathFlowFence"),t(r)):n(r)}}},concrete:!0,name:"mathFlow"},Lk={tokenize:function(e,t,n){let r=this;return function(n){return null===n?t(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0};function LC(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("mathTextData"===e[t][1].type){e[r][1].type="mathTextPadding",e[i][1].type="mathTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="mathTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e}function LS(e){return 36!==e||"characterEscape"===this.events[this.events.length-1][1].type}let LM={};function LA(e){let t,n=e||LM,r=this.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push({flow:{36:Lx},text:{36:(null==(t=(n||{}).singleDollarTextMath)&&(t=!0),{tokenize:function(e,n,r){let i,o,l=0;return function(n){return e.enter("mathText"),e.enter("mathTextSequence"),function n(i){return 36===i?(e.consume(i),l++,n):l<2&&!t?r(i):(e.exit("mathTextSequence"),s(i))}(n)};function s(t){return null===t?r(t):36===t?(o=e.enter("mathTextSequence"),i=0,function t(r){return 36===r?(e.consume(r),i++,t):i===l?(e.exit("mathTextSequence"),e.exit("mathText"),n(r)):(o.type="mathTextData",a(r))}(t)):32===t?(e.enter("space"),e.consume(t),e.exit("space"),s):rR(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s):(e.enter("mathTextData"),a(t))}function a(t){return null===t||32===t||36===t||rR(t)?(e.exit("mathTextData"),s(t)):(e.consume(t),a)}},resolve:LC,previous:LS,name:"mathText"})}}),o.push(function(){return{enter:{mathFlow:function(e){this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[{type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]}]}},e)},mathFlowFenceMeta:function(){this.buffer()},mathText:function(e){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},e),this.buffer()}},exit:{mathFlow:function(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),n=this.stack[this.stack.length-1];o_("math"===n.type),this.exit(e),n.value=t;let r=n.data.hChildren[0];o_("element"===r.type),o_("code"===r.tagName),r.children.push({type:"text",value:t}),this.data.mathFlowInside=void 0},mathFlowFence:function(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)},mathFlowFenceMeta:function(){let e=this.resume(),t=this.stack[this.stack.length-1];o_("math"===t.type),t.meta=e},mathFlowValue:e,mathText:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];o_("inlineMath"===n.type),this.exit(e),n.value=t,n.data.hChildren.push({type:"text",value:t})},mathTextData:e}};function e(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}()),l.push(function(e){let t=(e||{}).singleDollarTextMath;return null==t&&(t=!0),n.peek=function(){return"$"},{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:"\n",inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:function(e,t,n,r){let i=e.value||"",o=n.createTracker(r),l="$".repeat(Math.max(iY(i,"$")+1,2)),s=n.enter("mathFlow"),a=o.move(l);if(e.meta){let t=n.enter("mathFlowMeta");a+=o.move(n.safe(e.meta,{after:"\n",before:a,encode:["$"],...o.current()})),t()}return a+=o.move("\n"),i&&(a+=o.move(i+"\n")),a+=o.move(l),s(),a},inlineMath:n}};function n(e,n,r){let i=e.value||"",o=1;for(!t&&o++;RegExp("(^|[^$])"+"\\$".repeat(o)+"([^$]|$)").test(i);)o++;let l="$".repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=" "+i+" ");let s=-1;for(;++s<r.unsafe.length;){let e,t=r.unsafe[s];if(!t.atBreak)continue;let n=r.compilePattern(t);for(;e=n.exec(i);){let t=e.index;10===i.codePointAt(t)&&13===i.codePointAt(t-1)&&t--,i=i.slice(0,t)+" "+i.slice(e.index+1)}}return l+i+l}}(n))}var LT=Object.defineProperty,LO=Object.getOwnPropertySymbols,LE=Object.prototype.hasOwnProperty,LN=Object.prototype.propertyIsEnumerable,LD=(e,t,n)=>t in e?LT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function LI(e,t){return Object.assign(e,{meta:((e,t)=>{for(var n in t||(t={}))LE.call(t,n)&&LD(e,n,t[n]);if(LO)for(var n of LO(t))LN.call(t,n)&&LD(e,n,t[n]);return e})({package:"@milkdown/components"},t)}),e}var LL=Object.defineProperty,L_=Object.getOwnPropertySymbols,LR=Object.prototype.hasOwnProperty,Lz=Object.prototype.propertyIsEnumerable,LP=(e,t,n)=>t in e?LL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,LB=(e,t)=>{for(var n in t||(t={}))LR.call(t,n)&&LP(e,n,t[n]);if(L_)for(var n of L_(t))Lz.call(t,n)&&LP(e,n,t[n]);return e};let LF=dC(LB({},{mode:"preview"}),"linkTooltipStateCtx");LI(LF,{displayName:"State<link-tooltip>",group:"LinkTooltip"});let LH=dC(LB({},{addLink:()=>{},editLink:()=>{},removeLink:()=>{}}),"linkTooltipAPICtx");LI(LF,{displayName:"API<link-tooltip>",group:"LinkTooltip"});let Lq=dC(LB({},{linkIcon:"🔗",editButton:"✎",removeButton:"⌫",confirmButton:"Confirm ⏎",onCopyLink:()=>{},inputPlaceholder:"Paste link..."}),"linkTooltipConfigCtx");LI(LF,{displayName:"Config<link-tooltip>",group:"LinkTooltip"});let Lj=dv("ToggleLink",e=>()=>t=>{let{doc:n,selection:r}=t,i=wI.type(e);return n.rangeHasMark(r.from,r.to,i)?e.get(LH.key).removeLink(r.from,r.to):e.get(LH.key).addLink(r.from,r.to),!0}),LV=mq("LINK_PREVIEW");LI(LV[0],{displayName:"PreviewTooltipSpec<link-tooltip>",group:"LinkTooltip"}),LI(LV[1],{displayName:"PreviewTooltipPlugin<link-tooltip>",group:"LinkTooltip"});let L$=mq("LINK_EDIT");function LW(){}function LU({icon:e,class:t,onClick:n}){return bB("span",{class:b9("milkdown-icon",t),onPointerdown:n,innerHTML:e?fM.sanitize(e.trim()):void 0})}LI(L$[0],{displayName:"EditTooltipSpec<link-tooltip>",group:"LinkTooltip"}),LI(L$[1],{displayName:"EditTooltipPlugin<link-tooltip>",group:"LinkTooltip"}),LW(bB),LU.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}},LW(bB);let LG=yr({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({config:e,src:t,onConfirm:n,onCancel:r}){let i=vm(t);v5(t,e=>{i.value=e},void 0);let o=()=>{n(i.value)},l=e=>{e.stopPropagation(),"Enter"===e.key&&(e.preventDefault(),o()),"Escape"===e.key&&(e.preventDefault(),r())};return()=>bB("div",{class:"link-edit"},bB("input",{class:"input-area",placeholder:e.value.inputPlaceholder,onKeydown:l,onInput:e=>{i.value=e.target.value},value:i.value}),i.value?bB(LU,{class:"button confirm",icon:e.value.confirmButton,onClick:o}):null)}});var LK=Object.defineProperty,LJ=Object.defineProperties,LZ=Object.getOwnPropertyDescriptors,LY=Object.getOwnPropertySymbols,LX=Object.prototype.hasOwnProperty,LQ=Object.prototype.propertyIsEnumerable,L0=e=>{throw TypeError(e)},L1=(e,t,n)=>t in e?LK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L4=(e,t)=>{for(var n in t||(t={}))LX.call(t,n)&&L1(e,n,t[n]);if(LY)for(var n of LY(t))LQ.call(t,n)&&L1(e,n,t[n]);return e},L5=(e,t,n)=>t.has(e)||L0("Cannot "+n),L2=(e,t,n)=>(L5(e,t,"read from private field"),n?n.call(e):t.get(e)),L3=(e,t,n)=>t.has(e)?L0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),L7=(e,t,n,r)=>(L5(e,t,"write to private field"),t.set(e,n),n);let L6={from:-1,to:-1,mark:null};class L8{constructor(e,t){this.ctx=e,L3(this,F),L3(this,H),L3(this,q,L4({},L6)),L3(this,j),L3(this,V),L3(this,$,vm("")),L3(this,W,()=>{L2(this,K).call(this),L2(this,H).hide(),this.ctx.update(LF.key,e=>LJ(L4({},e),LZ({mode:"preview"}))),L7(this,q,L4({},L6))}),L3(this,U,e=>{let t=e.target;!t||L2(this,F).contains(t)||L2(this,W).call(this)}),L3(this,G,()=>{document.addEventListener("pointerdown",L2(this,U),!0)}),L3(this,K,()=>{document.removeEventListener("pointerdown",L2(this,U),!0)}),L3(this,J,e=>{let t=this.ctx.get(hb),{from:n,to:r,mark:i}=L2(this,q),o=wI.type(this.ctx),l=fM.sanitize(e);if(i&&i.attrs.href===l)return void L2(this,W).call(this);let s=t.state.tr;if(i&&s.removeMark(n,r,i),n===r){if(!l)return void L2(this,W).call(this);let e=o.create({href:l});s.insertText(l,n),s.addMark(n,n+l.length,e)}else s.addMark(n,r,o.create({href:l}));t.dispatch(s),L2(this,W).call(this)}),L3(this,Z,(e,t,n)=>{let r=this.ctx.get(Lq.key);L2(this,V).value=r,L2(this,$).value=e,this.ctx.update(LF.key,e=>LJ(L4({},e),LZ({mode:"edit"})));let i=this.ctx.get(hb);i.dispatch(i.state.tr.setSelection(sw.create(i.state.doc,t,n))),L2(this,H).show({getBoundingClientRect:()=>aI(i,t,n)},i),L2(this,G).call(this),requestAnimationFrame(()=>{var e;null==(e=L2(this,F).querySelector("input"))||e.focus()})}),this.update=e=>{let{state:t}=e,{selection:n}=t;if(!(n instanceof sw))return;let{from:r,to:i}=n;(r!==L2(this,q).from||i!==L2(this,q).to)&&L2(this,W).call(this)},this.destroy=()=>{L2(this,K).call(this),L2(this,j).unmount(),L2(this,H).destroy(),L2(this,F).remove()},this.addLink=(e,t)=>{L7(this,q,{from:e,to:t,mark:null}),L2(this,Z).call(this,"",e,t)},this.editLink=(e,t,n)=>{L7(this,q,{from:t,to:n,mark:e}),L2(this,Z).call(this,e.attrs.href,t,n)},this.removeLink=(e,t)=>{let n=this.ctx.get(hb),r=n.state.tr;r.removeMark(e,t,wI.type(this.ctx)),n.dispatch(r),L2(this,W).call(this)},L7(this,V,vm(this.ctx.get(Lq.key)));const n=document.createElement("div");n.className="milkdown-link-edit";const r=b8(LG,{config:L2(this,V),src:L2(this,$),onConfirm:L2(this,J),onCancel:L2(this,W)});r.mount(n),L7(this,j,r),L7(this,F,n),L7(this,H,new mH({content:n,debounce:0,shouldShow:()=>!1})),L2(this,H).onHide=()=>{requestAnimationFrame(()=>{t.dom.focus({preventScroll:!0})})},L2(this,H).update(t)}}F=new WeakMap,H=new WeakMap,q=new WeakMap,j=new WeakMap,V=new WeakMap,$=new WeakMap,W=new WeakMap,U=new WeakMap,G=new WeakMap,K=new WeakMap,J=new WeakMap,Z=new WeakMap;var L9=Object.defineProperty,_e=Object.defineProperties,_t=Object.getOwnPropertyDescriptors,_n=Object.getOwnPropertySymbols,_r=Object.prototype.hasOwnProperty,_i=Object.prototype.propertyIsEnumerable,_o=(e,t,n)=>t in e?L9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;LW(bB);let _l=yr({props:{config:{type:Object,required:!0},src:{type:Object,required:!0},onEdit:{type:Object,required:!0},onRemove:{type:Object,required:!0}},setup({config:e,src:t,onEdit:n,onRemove:r}){let i=e=>{e.preventDefault(),e.stopPropagation(),n.value()},o=e=>{e.preventDefault(),e.stopPropagation(),r.value()},l=n=>{n.preventDefault();let r=t.value;navigator.clipboard&&r&&navigator.clipboard.writeText(r).then(()=>{e.value.onCopyLink(r)}).catch(e=>console.error(e))};return()=>bB("div",{class:"link-preview"},bB(LU,{class:"button link-icon",icon:e.value.linkIcon,onClick:l}),bB("a",{href:t.value,target:"_blank",class:"link-display"},t.value),bB(LU,{class:"button link-edit-button",icon:e.value.editButton,onClick:i}),bB(LU,{class:"button link-remove-button",icon:e.value.removeButton,onClick:o}))}});var _s=e=>{throw TypeError(e)},_a=(e,t,n)=>t.has(e)||_s("Cannot "+n),_c=(e,t,n)=>(_a(e,t,"read from private field"),n?n.call(e):t.get(e)),_u=(e,t,n)=>t.has(e)?_s("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_h=(e,t,n,r)=>(_a(e,t,"write to private field"),t.set(e,n),n);class _d{constructor(e,t){this.ctx=e,_u(this,Y),_u(this,X),_u(this,Q),_u(this,ee),_u(this,et,vm("")),_u(this,en,vm(()=>{})),_u(this,er,vm(()=>{})),_u(this,ei),_u(this,eo),_u(this,el,!1),_u(this,es,({mode:e})=>{"edit"===e&&_c(this,eu).call(this)}),_u(this,ea,()=>{_h(this,el,!0)}),_u(this,ec,()=>{_h(this,el,!1)}),_u(this,eu,()=>{_c(this,X).hide(),_c(this,X).element.removeEventListener("mouseenter",_c(this,ea)),_c(this,X).element.removeEventListener("mouseleave",_c(this,ec))}),this.show=(e,t,n,r)=>{_c(this,ee).value=this.ctx.get(Lq.key),_c(this,et).value=e.attrs.href,_c(this,en).value=()=>{this.ctx.get(LH.key).editLink(e,t,n)},_c(this,er).value=()=>{this.ctx.get(LH.key).removeLink(t,n),_c(this,eu).call(this)},_c(this,X).show({getBoundingClientRect:()=>r},_c(this,eo)),_c(this,X).element.addEventListener("mouseenter",_c(this,ea)),_c(this,X).element.addEventListener("mouseleave",_c(this,ec))},this.hide=()=>{_c(this,el)||_c(this,eu).call(this)},this.update=()=>{},this.destroy=()=>{_c(this,ei).unmount(),_c(this,Q).off(_c(this,es)),_c(this,X).destroy(),_c(this,Y).remove()},_h(this,eo,t),_h(this,ee,vm(this.ctx.get(Lq.key))),_h(this,ei,b8(_l,{config:_c(this,ee),src:_c(this,et),onEdit:_c(this,en),onRemove:_c(this,er)})),_h(this,Y,document.createElement("div")),_c(this,Y).className="milkdown-link-preview",_c(this,ei).mount(_c(this,Y)),_h(this,X,new mH({debounce:0,content:_c(this,Y),shouldShow:()=>!1})),_c(this,X).update(t),_h(this,Q,e.use(LF.key)),_c(this,Q).on(_c(this,es))}}function _p(e){let t,n,r;n=mB((n,r)=>{if(!t||!n.hasFocus()||"edit"===e.get(LF.key).mode)return;let i=function(e,t,n){let r=t.posAtCoords({left:n.clientX,top:n.clientY});if(!r)return;let{pos:i}=r,o=t.state.doc.nodeAt(i);if(!o)return;let l=o.marks.find(t=>t.type===wI.mark.type(e));if(l&&LV.pluginKey())return{show:!0,pos:i,node:o,mark:l}}(e,n,r);if(i){var o,l,s,a,c;let e,r=n.state.doc.resolve(i.pos),u=(o=i.mark,l=i.node,s=n.state.doc,a=r.before(),c=r.after(),e={start:-1,end:-1},s.nodesBetween(a,c,(t,n)=>{if(e.start>-1)return!1;-1===e.start&&o.isInSet(t.marks)&&l===t&&(e={start:n,end:n+Math.max(t.textContent.length,1)})}),e),h=u.start,d=u.end;t.show(i.mark,h,d,aI(n,h,d));return}t.hide()},50),e.set(LV.key,{props:{handleDOMEvents:{mousemove:n,mouseleave:()=>{setTimeout(()=>{null==t||t.hide()},50)}}},view:n=>t=new _d(e,n)}),e.update(LH.key,e=>_e(((e,t)=>{for(var n in t||(t={}))_r.call(t,n)&&_o(e,n,t[n]);if(_n)for(var n of _n(t))_i.call(t,n)&&_o(e,n,t[n]);return e})({},e),_t({addLink:(e,t)=>{null==r||r.addLink(e,t)},editLink:(e,t,n)=>{null==r||r.editLink(e,t,n)},removeLink:(e,t)=>{null==r||r.removeLink(e,t)}}))),e.set(L$.key,{view:t=>r=new L8(e,t)})}Y=new WeakMap,X=new WeakMap,Q=new WeakMap,ee=new WeakMap,et=new WeakMap,en=new WeakMap,er=new WeakMap,ei=new WeakMap,eo=new WeakMap,el=new WeakMap,es=new WeakMap,ea=new WeakMap,ec=new WeakMap,eu=new WeakMap;let _f=[LF,LH,Lq,LV,L$,Lj].flat();var _m=Object.defineProperty,_g=Object.getOwnPropertySymbols,_v=Object.prototype.hasOwnProperty,_y=Object.prototype.propertyIsEnumerable,_b=(e,t,n)=>t in e?_m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function _w(e,t){return Object.assign(e,{meta:((e,t)=>{for(var n in t||(t={}))_v.call(t,n)&&_b(e,n,t[n]);if(_g)for(var n of _g(t))_y.call(t,n)&&_b(e,n,t[n]);return e})({package:"@milkdown/components"},t)}),e}let _x=dC({renderLabel:({label:e,listType:t,checked:n})=>null==n?"bullet"===t?"⦿":e:n?"☑":"□"},"listItemBlockConfigCtx");function _k(){}function _C({icon:e,class:t,onClick:n}){return bB("span",{class:b9("milkdown-icon",t),onPointerdown:n,innerHTML:e?fM.sanitize(e.trim()):void 0})}_w(_x,{displayName:"Config<list-item-block>",group:"ListItemBlock"}),_k(bB),_C.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}},_k(bB);let _S=yr({props:{label:{type:Object,required:!0},checked:{type:Object,required:!0},listType:{type:Object,required:!0},config:{type:Object,required:!0},readonly:{type:Object,required:!0},selected:{type:Object,required:!0},setAttr:{type:Function,required:!0},onMount:{type:Function,required:!0}},setup({label:e,checked:t,listType:n,config:r,readonly:i,setAttr:o,onMount:l,selected:s}){let a=e=>{null!=e&&e instanceof Element&&l(e)},c=e=>{e.stopPropagation(),e.preventDefault(),null!=t.value&&o("checked",!t.value)},u=bP(()=>r.renderLabel({label:e.value,listType:n.value,checked:t.value,readonly:i.value})),h=bP(()=>null==t.value?"bullet"===n.value?"bullet":"ordered":t.value?"checked":"unchecked");return()=>bB("li",{class:b9("list-item",s.value&&"ProseMirror-selectednode")},bB("div",{class:"label-wrapper",onPointerdown:c,contenteditable:!1},bB(_C,{class:b9("label",i.value&&"readonly",h.value),icon:u.value})),bB("div",{class:"children",ref:a}))}}),_M=dk(xb.node,e=>(t,n,r)=>{let i=document.createElement("div");i.className="milkdown-list-item-block";let o=document.createElement("div");o.setAttribute("data-content-dom","true"),o.classList.add("content-dom");let l=vm(t.attrs.label),s=vm(t.attrs.checked),a=vm(t.attrs.listType),c=vm(!n.editable),u=e.get(_x.key),h=vm(!1),d=v4(()=>{h.value?i.classList.add("selected"):i.classList.remove("selected")}),p=0,f=b8(_S,{label:l,checked:s,listType:a,readonly:c,config:u,selected:h,setAttr:(e,t)=>{if(!n.editable)return;let i=r();null!=i&&(n.hasFocus()||n.focus(),n.dispatch(n.state.tr.setNodeAttribute(i,e,t)))},onMount:e=>{let{anchor:t,head:r}=n.state.selection;e.appendChild(o);let i=n.state.doc.resolve(t),l=n.state.doc.resolve(r);p=requestAnimationFrame(()=>{if(cancelAnimationFrame(p),!i.doc.eq(n.state.doc))return;let e=new sw(i,l);n.dispatch(n.state.tr.setSelection(e))})}});f.mount(i);let m=e=>{a.value=e.attrs.listType,l.value=e.attrs.label,s.value=e.attrs.checked,c.value=!n.editable};m(t);let g=t;return{dom:i,contentDOM:o,update:e=>e.type===t.type&&(!!(e.sameMarkup(g)&&e.content.eq(g.content))||(g=e,m(e),!0)),ignoreMutation:e=>!i||!o||"selection"!==e.type&&(o===e.target&&"attributes"===e.type||!o.contains(e.target)),selectNode:()=>{h.value=!0},deselectNode:()=>{h.value=!1},destroy:()=>{d(),f.unmount(),i.remove(),o.remove()}}});_w(_M,{displayName:"NodeView<list-item-block>",group:"ListItemBlock"});let _A=[_x,_M];var _T=Object.defineProperty,_O=Object.getOwnPropertySymbols,_E=Object.prototype.hasOwnProperty,_N=Object.prototype.propertyIsEnumerable,_D=(e,t,n)=>t in e?_T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function _I(e,t){return Object.assign(e,{meta:((e,t)=>{for(var n in t||(t={}))_E.call(t,n)&&_D(e,n,t[n]);if(_O)for(var n of _O(t))_N.call(t,n)&&_D(e,n,t[n]);return e})({package:"@milkdown/components"},t)}),e}var _L=Object.defineProperty,__=Object.getOwnPropertySymbols,_R=Object.prototype.hasOwnProperty,_z=Object.prototype.propertyIsEnumerable,_P=(e,t,n)=>t in e?_L(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;let _B=dC(((e,t)=>{for(var n in t||(t={}))_R.call(t,n)&&_P(e,n,t[n]);if(__)for(var n of __(t))_z.call(t,n)&&_P(e,n,t[n]);return e})({},{renderButton:e=>{switch(e){case"add_row":case"add_col":return"+";case"delete_row":case"delete_col":return"-";case"align_col_left":return"left";case"align_col_center":return"center";case"align_col_right":return"right";case"col_drag_handle":case"row_drag_handle":return"="}}}),"tableBlockConfigCtx");function _F(){}function _H({icon:e,class:t,onClick:n}){return bB("span",{class:b9("milkdown-icon",t),onPointerdown:n,innerHTML:e?fM.sanitize(e.trim()):void 0})}function _q(e){let{dragPreviewRef:t,tableWrapperRef:n,contentWrapperRef:r,yLineHandleRef:i,xLineHandleRef:o,colHandleRef:l,rowHandleRef:s}=e,a=t.value;if(!a)return;let c=n.value;if(!c)return;let u=r.value;if(!u)return;let h=u.querySelector("tbody");if(!h)return;let d=a.querySelector("tbody");if(!d)return;let p=i.value;if(!p)return;let f=o.value;if(!f)return;let m=l.value;if(!m)return;let g=s.value;if(g)return{preview:a,wrapper:c,content:u,contentRoot:h,previewRoot:d,yHandle:p,xHandle:f,colHandle:m,rowHandle:g}}function _j(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function _V(e,t,n,r,i){let{width:o,height:l}=r.querySelector("tbody").getBoundingClientRect();if("y"===e){let e=r.querySelectorAll("tr")[i];if(!e)return;n.appendChild(e.cloneNode(!0));let l=e.getBoundingClientRect().height;Object.assign(t.style,{width:`${o}px`,height:`${l}px`}),t.dataset.show="true";return}if("x"===e){let e;Array.from(r.querySelectorAll("tr")).forEach(t=>{let r=t.children[i];if(!r)return;void 0===e&&(e=r.getBoundingClientRect().width);let o=r.parentElement.cloneNode(!1),l=r.cloneNode(!0);o.appendChild(l),n.appendChild(o)}),Object.assign(t.style,{width:`${e}px`,height:`${l}px`}),t.dataset.show="true";return}}function _$(e,t,n,r){let{xHandle:i,yHandle:o,colHandle:l,rowHandle:s,preview:a}=n;i.dataset.displayType="y"===e?"indicator":"none",o.dataset.displayType="x"===e?"indicator":"none","y"===e?(l.dataset.show="false",_U(s)):(s.dataset.show="false",_U(l));let{hoverIndex:c,dragInfo:u}=r,[h,d]=c.value;u.value={startCoords:[t.clientX,t.clientY],startIndex:"y"===e?h:d,endIndex:"y"===e?h:d,type:"y"===e?"row":"col"},a.dataset.direction="y"===e?"vertical":"horizontal"}function _W(e,t,n,r){let i=null==n?void 0:n.get(hb);if(!(null==i?void 0:i.editable))return;t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.effectAllowed="move");let o=_q(e);o&&requestAnimationFrame(()=>{r(o)})}function _U(e){var t;null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","false")}function _G(e,t){for(let n=0;n<e.childCount;n++)if(e.child(n)===t)return n;return -1}function _K(e,[t,n]){let r=e.value;if(!r)return;let i=r.querySelectorAll("tr"),o=i[t];if(!o)return;let l=i[0];if(!l)return;let s=l.children[n];if(!s)return;let a=o.children[n];if(a)return{row:o,col:a,headerCol:s}}function _J({refs:e,index:t,before:n,after:r}){let{contentWrapperRef:i,colHandleRef:o,hoverIndex:l}=e,s=o.value;if(!s)return;l.value=t;let a=_K(i,t);if(!a)return;let{headerCol:c}=a;s.dataset.show="true",n&&n(s),mM(c,s,{placement:"top"}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function _Z({refs:e,index:t,before:n,after:r}){let{contentWrapperRef:i,rowHandleRef:o,hoverIndex:l}=e,s=o.value;if(!s)return;l.value=t;let a=_K(i,t);if(!a)return;let{row:c}=a;s.dataset.show="true",n&&n(s),mM(c,s,{placement:"left"}).then(({x:e,y:t})=>{Object.assign(s.style,{left:`${e}px`,top:`${t}px`}),r&&r(s)}).catch(console.error)}function _Y(e,t,n){let r="x"===n?"left":"top",i="x"===n?"right":"bottom",o=e.length-1,l=e.findIndex((e,n)=>{let l=e.getBoundingClientRect(),s=l[r],a=l[i];return!!(s<=t)&&!!(t<=a)||n===o&&!!(t>a)||0===n&&!!(t<s)}),s=e[l];return s?[s,l]:void 0}_I(_B,{displayName:"Config<table-block>",group:"TableBlock"}),_F(bB),_H.props={icon:{type:String,required:!1},class:{type:String,required:!1},onClick:{type:Function,required:!1}},_F(bB);let _X=yr({props:{view:{type:Object,required:!0},ctx:{type:Object,required:!0},getPos:{type:Function,required:!0},config:{type:Object,required:!0},onMount:{type:Function,required:!0},node:{type:Object,required:!0}},setup({view:e,node:t,ctx:n,getPos:r,config:i,onMount:o}){let l=vm(),s=e=>{null!=e&&(e instanceof HTMLElement?(l.value=e,o(e)):l.value=void 0)},a=vm(),c=vm(),u=vm(),h=vm(),d=vm(),p=vm(),f=vm([0,0]),m={dragPreviewRef:p,tableWrapperRef:d,contentWrapperRef:l,yLineHandleRef:h,xLineHandleRef:u,colHandleRef:a,rowHandleRef:c,hoverIndex:f,lineHoverIndex:vm([-1,-1]),dragInfo:vm()},{pointerLeave:g,pointerMove:y}={pointerMove:mF(t=>{if(!(null==e?void 0:e.editable))return;let{contentWrapperRef:n,yLineHandleRef:r,xLineHandleRef:i,colHandleRef:o,rowHandleRef:l,hoverIndex:s,lineHoverIndex:a}=m,c=r.value;if(!c)return;let u=i.value;if(!u)return;let h=n.value;if(!h)return;let d=l.value;if(!d)return;let p=o.value;if(!p)return;let f=function(e,t){var n,r,i;if(t)try{let o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return;let l=null==o?void 0:o.inside;if(null==l||l<0)return;let s=t.state.doc.resolve(l),a=t.state.doc.nodeAt(l);if(!a)return;let c=["table_cell","table_header"],u=["table_row","table_header_row"],h=c.includes(a.type.name)?a:null==(n=a_(e=>c.includes(e.type.name))(s))?void 0:n.node,d=null==(r=a_(e=>u.includes(e.type.name))(s))?void 0:r.node,p=null==(i=a_(e=>"table"===e.type.name)(s))?void 0:i.node;if(!h||!d||!p)return;let f=_G(d,h);return[_G(p,d),f]}catch(e){return}}(t,e);if(!f)return;let g=_K(n,f);if(!g)return;let[y,b]=f,w=g.col.getBoundingClientRect(),x=8>Math.abs(t.clientX-w.left),k=8>Math.abs(w.right-t.clientX),C=8>Math.abs(t.clientY-w.top),S=8>Math.abs(w.bottom-t.clientY),M=d.querySelector(".button-group"),A=p.querySelector(".button-group");if(M&&(M.dataset.show="false"),A&&(A.dataset.show="false"),x||k||C||S){let e=h.getBoundingClientRect();d.dataset.show="false",p.dataset.show="false",u.dataset.displayType="tool",c.dataset.displayType="tool";let t=c.getBoundingClientRect().width,n=u.getBoundingClientRect().height;x||k?(a.value[1]=x?b:b+1,mM(g.col,c,{placement:x?"left":"right",middleware:[mC(x?-1*t:0)]}).then(({x:t})=>{c.dataset.show="true",Object.assign(c.style,{height:`${e.height}px`,left:`${t}px`})}).catch(console.error)):c.dataset.show="false",0!==f[0]&&(C||S)?(a.value[0]=C?y:y+1,mM(g.row,u,{placement:C?"top":"bottom",middleware:[mC(C?-1*n:0)]}).then(({y:t})=>{u.dataset.show="true",Object.assign(u.style,{width:`${e.width}px`,top:`${t}px`})}).catch(console.error)):u.dataset.show="false";return}a.value=[-1,-1],c.dataset.show="false",u.dataset.show="false",d.dataset.show="true",p.dataset.show="true",_Z({refs:m,index:f}),_J({refs:m,index:f}),s.value=f},20),pointerLeave:()=>{let{rowHandleRef:e,colHandleRef:t,yLineHandleRef:n,xLineHandleRef:r}=m;setTimeout(()=>{let i=e.value;if(!i)return;let o=t.value;if(!o)return;let l=n.value;if(!l)return;let s=r.value;s&&(i.dataset.show="false",o.dataset.show="false",l.dataset.show="false",s.dataset.show="false")},200)}},{dragRow:b,dragCol:w}=function(e,t,n){let{dragPreviewRef:r,yLineHandleRef:i,xLineHandleRef:o,dragInfo:l}=e,s=n=>{_W(e,n,t,t=>{_$("y",n,t,e);let{preview:r,content:i,previewRoot:o}=t;_j(o);let{hoverIndex:l}=e,[s]=l.value;_V("y",r,o,i,s)})},a=n=>{_W(e,n,t,t=>{_$("x",n,t,e);let{preview:r,content:i,previewRoot:o}=t,{hoverIndex:l}=e,[s,a]=l.value;_j(o),_V("x",r,o,i,a)})},c=()=>{let e=r.value;if(!e||"false"===e.dataset.show)return;let t=null==e?void 0:e.querySelector("tbody");for(;null==t?void 0:t.firstChild;)null==t||t.removeChild(t.firstChild);e&&(e.dataset.show="false")},u=()=>{var s;let a=r.value;if(!a)return;let c=i.value;if(!c)return;let u=o.value;if(!u)return;let h=l.value;if(!h||!t||"false"===a.dataset.show||!e.colHandleRef.value||!e.rowHandleRef.value||(c.dataset.show="false",u.dataset.show="false",h.startIndex===h.endIndex))return;let d=t.get(hH),p={from:h.startIndex,to:h.endIndex,pos:(null!=(s=null==n?void 0:n())?s:0)+1};"col"===h.type?(d.call(S1.key,{pos:p.pos,index:h.startIndex}),d.call(SQ.key,p),_J({refs:e,index:[0,h.endIndex]})):(d.call(S0.key,{pos:p.pos,index:h.startIndex}),d.call(SX.key,p),_Z({refs:e,index:[h.endIndex,0]})),requestAnimationFrame(()=>{t.get(hb).focus()})},h=mF(t=>{let n=_q(e);if(!n)return;let{preview:r,content:i,contentRoot:o,xHandle:l,yHandle:s}=n,{dragInfo:a,hoverIndex:c}=e;if("false"===r.dataset.show)return;let u=_K(e.contentWrapperRef,c.value);if(!u||!o.querySelector("tr"))return;let h=a.value;if(!h||!o.offsetParent)return;let d=o.offsetParent.offsetTop,p=o.offsetParent.offsetLeft;if("col"===h.type){let e=u.col.getBoundingClientRect().width,{left:n,width:l}=o.getBoundingClientRect(),a=p-n,c=t.clientX+a-e/2,[f]=h.startCoords,m=f<t.clientX?"right":"left";r.style.top=`${d}px`;let g=c<n+a-20?n+a-20:c>n+l+a-e+20?n+l+a-e+20:c;r.style.left=`${g}px`;let y=function(e,t){let n=e.querySelector("tr");if(n)return _Y(Array.from(n.children),t,"x")}(o,t.clientX);if(y){let[e,t]=y,n=s.getBoundingClientRect().width,r=i.getBoundingClientRect();h.endIndex=t,mM(e,s,{placement:"left"===m?"left":"right",middleware:[mC("left"===m?-1*n:0)]}).then(({x:e})=>{s.dataset.show="true",Object.assign(s.style,{height:`${r.height}px`,left:`${e}px`,top:`${d}px`})}).catch(console.error)}}else if("row"===h.type){var f;let e=u.row.getBoundingClientRect().height,{top:n,height:s}=o.getBoundingClientRect(),a=d-n,c=t.clientY+a-e/2,[m,g]=h.startCoords,y=g<t.clientY?"down":"up",b=c<n+a-20?n+a-20:c>n+s+a-e+20?n+s+a-e+20:c;r.style.top=`${b}px`,r.style.left=`${p}px`;let w=(f=t.clientY,_Y(Array.from(o.querySelectorAll("tr")),f,"y"));if(w){let[e,t]=w,n=l.getBoundingClientRect().height,r=i.getBoundingClientRect();h.endIndex=t,mM(e,l,{placement:"up"===y?"top":"bottom",middleware:[mC("up"===y?-1*n:0)]}).then(({y:e})=>{l.dataset.show="true",Object.assign(l.style,{width:`${r.width}px`,top:`${e}px`})}).catch(console.error)}}},20);return yv(()=>{window.addEventListener("dragover",h),window.addEventListener("dragend",c),window.addEventListener("drop",u)}),yx(()=>{window.removeEventListener("dragover",h),window.removeEventListener("dragend",c),window.removeEventListener("drop",u)}),{dragRow:s,dragCol:a}}(m,n,r),{onAddRow:x,onAddCol:k,selectCol:C,selectRow:S,deleteSelected:M,onAlign:A}=function(e,t,n){let{xLineHandleRef:r,contentWrapperRef:i,colHandleRef:o,rowHandleRef:l,hoverIndex:s,lineHoverIndex:a}=e;return{onAddRow:()=>{var e,o,l;if(!t)return;let s=r.value;if(!s)return;let[c]=a.value;if(c<0||!t.get(hb).editable)return;let u=Array.from(null!=(o=null==(e=i.value)?void 0:e.querySelectorAll("tr"))?o:[]),h=t.get(hH),d=(null!=(l=null==n?void 0:n())?l:0)+1;u.length===c?(h.call(S0.key,{pos:d,index:c-1}),h.call(S6.key)):(h.call(S0.key,{pos:d,index:c}),h.call(S7.key)),h.call(S0.key,{pos:d,index:c}),s.dataset.show="false"},onAddCol:()=>{var e,o,l,s;if(!t||!r.value)return;let[c,u]=a.value;if(u<0||!t.get(hb).editable)return;let h=Array.from(null!=(l=null==(o=null==(e=i.value)?void 0:e.querySelector("tr"))?void 0:o.children)?l:[]),d=t.get(hH),p=(null!=(s=null==n?void 0:n())?s:0)+1;h.length===u?(d.call(S1.key,{pos:p,index:u-1}),d.call(S3.key)):(d.call(S1.key,{pos:p,index:u}),d.call(S2.key)),d.call(S1.key,{pos:p,index:u})},selectCol:()=>{var e,r;if(!t)return;let[i,l]=s.value,a=t.get(hH),c=(null!=(e=null==n?void 0:n())?e:0)+1;a.call(S1.key,{pos:c,index:l});let u=null==(r=o.value)?void 0:r.querySelector(".button-group");u&&(u.dataset.show="true"===u.dataset.show?"false":"true")},selectRow:()=>{var e,r;if(!t)return;let[i,o]=s.value,a=t.get(hH),c=(null!=(e=null==n?void 0:n())?e:0)+1;a.call(S0.key,{pos:c,index:i});let u=null==(r=l.value)?void 0:r.querySelector(".button-group");u&&i>0&&(u.dataset.show="true"===u.dataset.show?"false":"true")},deleteSelected:e=>{t&&t.get(hb).editable&&(e.preventDefault(),e.stopPropagation(),t.get(hH).call(S5.key),requestAnimationFrame(()=>{t.get(hb).focus()}))},onAlign:e=>n=>{t&&t.get(hb).editable&&(n.preventDefault(),n.stopPropagation(),t.get(hH).call(S8.key,e),requestAnimationFrame(()=>{t.get(hb).focus()}))}}}(m,n,r);return yv(()=>{requestAnimationFrame(()=>{e.editable&&function(e,t,n){if(!n||!t)return;let{selection:r}=t.state;if(!(r instanceof k_))return;let{$from:i}=r,o=kq(i);if(o&&o.node===n){if(r.isColSelection()){let{$head:t}=r;_J({refs:e,index:[0,t.index(t.depth-1)],before:e=>{var t;null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","true")}});return}if(r.isRowSelection()){let{$head:t}=r,n=a_(e=>"table_row"===e.type.name||"table_header_row"===e.type.name)(t);if(!n)return;let i=_G(o.node,n.node);_Z({refs:e,index:[i,0],before:e=>{var t;i>0&&(null==(t=e.querySelector(".button-group"))||t.setAttribute("data-show","true"))}})}}}(m,e,t.value)})}),()=>bB("div",{onDragstart:e=>e.preventDefault(),onDragover:e=>e.preventDefault(),onDragleave:e=>e.preventDefault(),onPointermove:y,onPointerleave:g},bB("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"col-drag-handle",class:"handle cell-handle",onDragstart:w,onClick:C,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:a},bB(_H,{icon:i.renderButton("col_drag_handle")}),bB("div",{"data-show":"false",class:"button-group",onPointermove:e=>e.stopPropagation()},bB("button",{type:"button",onPointerdown:A("left")},bB(_H,{icon:i.renderButton("align_col_left")})),bB("button",{type:"button",onPointerdown:A("center")},bB(_H,{icon:i.renderButton("align_col_center")})),bB("button",{type:"button",onPointerdown:A("right")},bB(_H,{icon:i.renderButton("align_col_right")})),bB("button",{type:"button",onPointerdown:M},bB(_H,{icon:i.renderButton("delete_col")})))),bB("div",{"data-show":"false",contenteditable:"false",draggable:"true","data-role":"row-drag-handle",class:"handle cell-handle",onDragstart:b,onClick:S,onPointerdown:e=>e.stopPropagation(),onPointermove:e=>e.stopPropagation(),ref:c},bB(_H,{icon:i.renderButton("row_drag_handle")}),bB("div",{"data-show":"false",class:"button-group",onPointermove:e=>e.stopPropagation()},bB("button",{type:"button",onPointerdown:M},bB(_H,{icon:i.renderButton("delete_row")})))),bB("div",{class:"table-wrapper",ref:d},bB("div",{"data-show":"false",class:"drag-preview","data-direction":"vertical",ref:p},bB("table",null,bB("tbody",null))),bB("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"x-line-drag-handle",class:"handle line-handle",onPointermove:e=>e.stopPropagation(),ref:u},bB("button",{type:"button",onClick:x,class:"add-button"},bB(_H,{icon:i.renderButton("add_row")}))),bB("div",{"data-show":"false",contenteditable:"false","data-display-type":"tool","data-role":"y-line-drag-handle",class:"handle line-handle",onPointermove:e=>e.stopPropagation(),ref:h},bB("button",{type:"button",onClick:k,class:"add-button"},bB(_H,{icon:i.renderButton("add_col")}))),bB("table",{ref:s,class:"children"})))}});var _Q=e=>{throw TypeError(e)};class _0{constructor(e,t,n,r){this.ctx=e,this.node=t,this.view=n,this.getPos=r,((e,t,n)=>t.has(e)?_Q("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n))(this,eh);const i=document.createElement("div");i.className="milkdown-table-block";const o=document.createElement("tbody");this.contentDOM=o,o.setAttribute("data-content-dom","true"),o.classList.add("content-dom"),this.nodeRef=function(e){return vg(e,!0)}(t);const l=b8(_X,{view:n,ctx:e,getPos:r,config:e.get(_B.key),onMount:e=>{e.appendChild(o)},node:this.nodeRef});l.mount(i),this.app=l,this.dom=i}update(e){return!(e.type!==this.node.type||e.sameMarkup(this.node)&&e.content.eq(this.node.content))&&(this.node=e,this.nodeRef.value=e,!0)}stopEvent(e){if("drop"===e.type||e.type.startsWith("drag"))return!0;if("mousedown"===e.type||"pointerdown"===e.type){if(e.target instanceof Element&&e.target.closest("button"))return!0;let r=e.target;if(r instanceof HTMLElement&&(r.closest("th")||r.closest("td"))){var t,n;return(t=eh,n=ed,t.has(this)||_Q("Cannot access private method"),n).call(this,e)}}return!1}ignoreMutation(e){return!this.dom||!this.contentDOM||"selection"!==e.type&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target))}destroy(){this.app.unmount(),this.dom.remove(),this.contentDOM.remove()}}eh=new WeakSet,ed=function(e){let t=this.view;if(!t.editable)return!1;let{state:n,dispatch:r}=t,i=t.posAtCoords({left:e.clientX,top:e.clientY});if(!i)return!1;let o=n.doc.resolve(i.inside),l=a_(e=>"table_cell"===e.type.name||"table_header"===e.type.name)(o);if(!l)return!1;if(n.selection instanceof sw){let e=a_(e=>"table_cell"===e.type.name||"table_header"===e.type.name)(n.selection.$from);if((null==e?void 0:e.node)===l.node)return!1}let{from:s}=l,a=sk.create(n.doc,s+1);return!n.selection.eq(a)&&(n.selection instanceof k_?setTimeout(()=>{r(n.tr.setSelection(a).scrollIntoView())},20):requestAnimationFrame(()=>{r(n.tr.setSelection(a).scrollIntoView())}),!0)};let _1=dk(SB.node,e=>(t,n,r)=>new _0(e,t,n,r));_I(_1,{displayName:"NodeView<table-block>",group:"TableBlock"});let _4=[_B,_1];function _5(e,t){let n=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}(t);if(n)return e.dispatch(e.state.tr.replaceSelectionWith(n,!0)),!0;try{return e.dispatch(e.state.tr.replaceSelection(t)),!0}catch{return!1}}var _2=dw(e=>{let t=e.get(h_);return e.update(da,e=>({...e,editable:e.editable??(()=>!0),transformPastedHTML:(t,n)=>{let r=e.transformPastedHTML;return r&&(t=r(t,n)),t.includes("docs-internal-guid")&&(t=(t=t.replace(/<b[^>]*id="docs-internal-guid[^"]*"[^>]*>([\s\S]*)<\/b>/,"$1")).replace(/<div[^>]*>(<table[\s\S]*?<\/table>)<\/div>/g,"$1")),t}})),new s_({key:new sP("MILKDOWN_CLIPBOARD"),props:{handlePaste:(n,r,i)=>{let o,l=e.get(hY),s=n.props.editable?.(n.state),{clipboardData:a}=r;if(!s||!a||n.state.selection.$from.node().type.spec.code)return!1;let c=a.getData("text/plain"),u=a.getData("vscode-editor-data");if(u){let e=JSON.parse(u)?.mode;if(c&&e){let{tr:r}=n.state,i=function(e,t){let n=t.nodes[e];if(!n)throw new rn(rt.getAtomFromSchemaFail,`Cannot get node: ${e} from schema.`);return n}("code_block",t);return r.replaceSelectionWith(i.create({language:e})).setSelection(sw.near(r.doc.resolve(Math.max(0,r.selection.from-2)))).insertText(c.replace(/\r\n?/g,"\n")),n.dispatch(r),!0}}let h=a.getData("text/html");if(0===h.length&&0===c.length)return!1;if(h.length>0&&i)return _5(n,i);let d=lD.fromSchema(t);if(0===h.length){let e=l(c);if(!e||"string"==typeof e)return!1;o=lH.fromSchema(t).serializeFragment(e.content)}else{let e=document.createElement("template");e.innerHTML=h,o=e.content.cloneNode(!0),e.remove()}return _5(n,d.parseSlice(o))},clipboardTextSerializer:n=>{let r=e.get(h5);if(function e(t){if(!t)return!1;if(Array.isArray(t))return!(t.length>1)&&e(t[0]);let n=t.content;return n?e(n):"text"===t.type}(n.content.toJSON()))return n.content.textBetween(0,n.content.size,"\n\n");let i=t.topNodeType.createAndFill(void 0,n.content);return i?r(i):""}}})});function _3(e,t){return Object.assign(e,{meta:{package:"@milkdown/plugin-history",...t}}),e}Object.assign(_2,{meta:{package:"@milkdown/plugin-clipboard",displayName:"Prose<clipboard>"}});var _7=dv("Undo",()=>()=>AZ);_3(_7,{displayName:"Command<undo>"});var _6=dv("Redo",()=>()=>AY);_3(_6,{displayName:"Command<redo>"});var _8=dC({},"historyProviderConfig");_3(_8,{displayName:"Ctx<historyProviderConfig>"});var _9=dw(e=>(function(e={}){return new s_({key:AG,state:{init:()=>new AH(AB.empty,AB.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(AG),o;if(i)return i.historyState;n.getMeta(AK)&&(e=new AH(e.done,e.undone,null,0,-1));let l=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(l&&l.getMeta(AG))if(l.getMeta(AG).redo)return new AH(e.done.addTransform(n,void 0,r,AU(t)),e.undone,Aj(n.mapping.maps),e.prevTime,e.prevComposition);else return new AH(e.done,e.undone.addTransform(n,void 0,r,AU(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||l&&!1===l.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new AH(e.done.rebased(n,o),e.undone.rebased(n,o),AV(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new AH(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),AV(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!l&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),s=l?AV(e.prevRanges,n.mapping):Aj(n.mapping.maps);return new AH(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,AU(t)),AB.empty,s,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?AZ:"historyRedo"==n?AY:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})})(e.get(_8.key)));_3(_9,{displayName:"Ctx<historyProviderPlugin>"});var Re=dA("historyKeymap",{Undo:{shortcuts:"Mod-z",command:e=>{let t=e.get(hH);return()=>t.call(_7.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:e=>{let t=e.get(hH);return()=>t.call(_6.key)}}});_3(Re.ctx,{displayName:"KeymapCtx<history>"}),_3(Re.shortcuts,{displayName:"Keymap<history>"});var Rt=[_8,_9,Re,_7,_6].flat(),Rn=dC({type:"space",size:2},"indentConfig");Rn.meta={package:"@milkdown/plugin-indent",displayName:"Ctx<indentConfig>"};var Rr=dx(e=>({Tab:(t,n)=>{let r=e.get(Rn.key),{tr:i}=t,o=function(e,t){let{doc:n,selection:r}=e;if(!n||!r||!(r instanceof sw||r instanceof sS))return e;let{to:i}=r,o="space"===t.type?Array(t.size).fill(" ").join(""):" ";return e.insertText(o,i)}(i,r);return!!o.docChanged&&(n?.(o),!0)}}));Rr.meta={package:"@milkdown/plugin-indent",displayName:"Shortcut<indent>"};var Ri=[Rn,Rr],Ro=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=e=>(this.beforeMountedListeners.push(e),this),this.mounted=e=>(this.mountedListeners.push(e),this),this.updated=e=>(this.updatedListeners.push(e),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(e){return this.markdownUpdatedListeners.push(e),this}blur(e){return this.blurListeners.push(e),this}focus(e){return this.focusListeners.push(e),this}destroy(e){return this.destroyListeners.push(e),this}selectionUpdated(e){return this.selectionUpdatedListeners.push(e),this}},Rl=rp(new Ro,"listener"),Rs=new sP("MILKDOWN_LISTENER"),Ra=e=>(e.inject(Rl,new Ro),async()=>{await e.wait(hD);let{listeners:t}=e.get(Rl);t.beforeMount.forEach(t=>t(e)),await e.wait(h0);let n=e.get(h5),r=null,i=null,o=null,l=null,s=mB(()=>{if(!l)return;let{doc:o}=l;if(t.updated.length>0&&r&&!r.eq(o)&&t.updated.forEach(t=>{t(e,o,r)}),t.markdownUpdated.length>0&&r&&!r.eq(o)){let r=n(o);t.markdownUpdated.forEach(t=>{t(e,r,i)}),i=r}r=o,l=null},200),a=new s_({key:Rs,view:()=>({destroy:()=>{s.cancel(),t.destroy.forEach(t=>t(e))}}),props:{handleDOMEvents:{focus:()=>(t.focus.forEach(t=>t(e)),!1),blur:()=>(t.blur.forEach(t=>t(e)),!1)}},state:{init:(e,t)=>{r=t.doc,i=n(t.doc)},apply:n=>{let r=n.selection;(!o&&r||o&&!r.eq(o))&&(t.selectionUpdated.forEach(t=>{t(e,r,o)}),o=r),(n.docChanged||n.storedMarksSet)&&!1!==n.getMeta("addToHistory")&&(l=n,s())}}});e.update(hS,e=>e.concat(a)),await e.wait(dl),t.mounted.forEach(t=>t(e))});Ra.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};var Rc=dC({shouldAppend:e=>!(!e||["heading","paragraph"].includes(e.type.name)),getNode:e=>e.schema.nodes.paragraph.create()},"trailingConfig");Rc.meta={package:"@milkdown/plugin-trailing",displayName:"Ctx<trailingConfig>"};var Ru=dw(e=>{let t=new sP("MILKDOWN_TRAILING"),{shouldAppend:n,getNode:r}=e.get(Rc.key),i=new s_({key:t,state:{init:(e,t)=>n(t.tr.doc.lastChild,t),apply:(e,t,r,i)=>e.docChanged?n(e.doc.lastChild,i):t},appendTransaction:(e,t,n)=>{let{doc:o,tr:l}=n,s=r?.(n),a=i.getState(n),c=o.content.size;if(a&&s)return l.insert(c,s)}});return i});Ru.meta={package:"@milkdown/plugin-trailing",displayName:"Prose<trailing>"};var Rh=[Rc,Ru],Rd=dC({uploader:async(e,t)=>{let n=[];for(let t=0;t<e.length;t++){let r=e.item(t);r&&r.type.includes("image")&&n.push(r)}let{image:r}=t.nodes;if(!r)throw ra("image");return(await Promise.all(n.map(e=>new Promise(t=>{let n=new FileReader;n.addEventListener("load",()=>{t({alt:e.name,src:n.result})},!1),n.readAsDataURL(e)})))).map(({alt:e,src:t})=>r.createAndFill({src:t,alt:e}))},enableHtmlFileUploader:!1,uploadWidgetFactory:(e,t)=>{let n=document.createElement("span");return n.textContent="Upload in progress...",uJ.widget(e,n,t)}},"uploadConfig");Rd.meta={package:"@milkdown/plugin-upload",displayName:"Ctx<uploadConfig>"};var Rp=dw(e=>{let t=new sP("MILKDOWN_UPLOAD"),n=(n,r,i)=>{if(!i||i.length<=0)return!1;let o=Symbol("upload symbol"),l=e.get(h_),{uploader:s,getInsertPos:a}=e.get(Rd.key),{tr:c}=n.state,u=r instanceof DragEvent?n.posAtCoords({left:r.clientX,top:r.clientY})?.pos??c.selection.from:c.selection.from,h="function"==typeof a?a(r,e,u):u;return n.dispatch(c.setMeta(t,{add:{id:o,pos:h}})),s(i,l,e,h).then(e=>{let r=((e,n)=>{let r=t.getState(e);if(!r)return -1;let i=r.find(void 0,void 0,e=>e.id===n);return i.length?i[0]?.from??-1:-1})(n.state,o);r<0||n.dispatch(n.state.tr.replaceWith(r,r,e).setMeta(t,{remove:{id:o}}))}).catch(e=>{console.error(e)}),!0};return new s_({key:t,state:{init:()=>uX.empty,apply(t,n){let r=n.map(t.mapping,t.doc),i=t.getMeta(this);if(!i)return r;if(i.add){let{uploadWidgetFactory:n}=e.get(Rd.key),o=n(i.add.pos,{id:i.add.id});return r.add(t.doc,[o])}if(i.remove){let e=r.find(void 0,void 0,e=>e.id===i.remove.id);return r.remove(e)}return r}},props:{decorations(e){return this.getState(e)},handlePaste:(t,r)=>{let{enableHtmlFileUploader:i}=e.get(Rd.key);return!(!(r instanceof ClipboardEvent)||!i&&r.clipboardData?.getData("text/html"))&&n(t,r,r.clipboardData?.files)},handleDrop:(e,t)=>t instanceof DragEvent&&n(e,t,t.dataTransfer?.files)}})});Rp.meta={package:"@milkdown/plugin-upload",displayName:"Prose<upload>"};var Rf=[Rd,Rp],Rm=((z=Rm||{}).CodeMirror="code-mirror",z.ListItem="list-item",z.LinkTooltip="link-tooltip",z.Cursor="cursor",z.ImageBlock="image-block",z.BlockEdit="block-edit",z.Toolbar="toolbar",z.Placeholder="placeholder",z.Table="table",z.Latex="latex",z.TopBar="top-bar",z.AI="ai",z);let Rg={cursor:!0,"list-item":!0,"link-tooltip":!0,"image-block":!0,"block-edit":!0,placeholder:!0,toolbar:!0,"code-mirror":!0,table:!0,latex:!0,"top-bar":!1,ai:!1},Rv=`
|
|
4
|
+
<svg
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
width="24"
|
|
7
|
+
height="24"
|
|
8
|
+
viewBox="0 0 24 24"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
d="M19 9l1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm0 14l1.25-2.75L23 19l-2.75-1.25L19 15l-1.25 2.75L15 19l2.75 1.25zM9 20l3-6.5L18 10l-6-3.5L9 0L6 6.5L0 10l6 3.5z"
|
|
13
|
+
transform="translate(3 3) scale(0.75)"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
16
|
+
`,Ry=`
|
|
17
|
+
<svg
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
width="24"
|
|
20
|
+
height="24"
|
|
21
|
+
viewBox="0 0 24 24"
|
|
22
|
+
>
|
|
23
|
+
<path
|
|
24
|
+
d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM8.25 16.625C8.0375 16.625 7.85942 16.5531 7.71575 16.4093C7.57192 16.2654 7.5 16.0872 7.5 15.8748C7.5 15.6621 7.57192 15.484 7.71575 15.3405C7.85942 15.1968 8.0375 15.125 8.25 15.125H15.75C15.9625 15.125 16.1406 15.1969 16.2843 15.3408C16.4281 15.4846 16.5 15.6628 16.5 15.8753C16.5 16.0879 16.4281 16.266 16.2843 16.4095C16.1406 16.5532 15.9625 16.625 15.75 16.625H8.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM8.25 8.875C8.0375 8.875 7.85942 8.80308 7.71575 8.65925C7.57192 8.51542 7.5 8.33725 7.5 8.12475C7.5 7.91208 7.57192 7.734 7.71575 7.5905C7.85942 7.44683 8.0375 7.375 8.25 7.375H15.75C15.9625 7.375 16.1406 7.44692 16.2843 7.59075C16.4281 7.73458 16.5 7.91275 16.5 8.12525C16.5 8.33792 16.4281 8.516 16.2843 8.6595C16.1406 8.80317 15.9625 8.875 15.75 8.875H8.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
`,Rb=`
|
|
28
|
+
<svg
|
|
29
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
30
|
+
width="24"
|
|
31
|
+
height="24"
|
|
32
|
+
viewBox="0 0 24 24"
|
|
33
|
+
>
|
|
34
|
+
<path
|
|
35
|
+
d="M4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25ZM4.25 16.625C4.0375 16.625 3.85942 16.5531 3.71575 16.4093C3.57192 16.2654 3.5 16.0872 3.5 15.8748C3.5 15.6621 3.57192 15.484 3.71575 15.3405C3.85942 15.1968 4.0375 15.125 4.25 15.125H13.75C13.9625 15.125 14.1406 15.1969 14.2843 15.3408C14.4281 15.4846 14.5 15.6628 14.5 15.8753C14.5 16.0879 14.4281 16.266 14.2843 16.4095C14.1406 16.5532 13.9625 16.625 13.75 16.625H4.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM4.25 8.875C4.0375 8.875 3.85942 8.80308 3.71575 8.65925C3.57192 8.51542 3.5 8.33725 3.5 8.12475C3.5 7.91208 3.57192 7.734 3.71575 7.5905C3.85942 7.44683 4.0375 7.375 4.25 7.375H13.75C13.9625 7.375 14.1406 7.44692 14.2843 7.59075C14.4281 7.73458 14.5 7.91275 14.5 8.12525C14.5 8.33792 14.4281 8.516 14.2843 8.6595C14.1406 8.80317 13.9625 8.875 13.75 8.875H4.25ZM4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25Z"
|
|
36
|
+
/>
|
|
37
|
+
</svg>
|
|
38
|
+
`,Rw=`
|
|
39
|
+
<svg
|
|
40
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
41
|
+
width="24"
|
|
42
|
+
height="24"
|
|
43
|
+
viewBox="0 0 24 24"
|
|
44
|
+
>
|
|
45
|
+
<path
|
|
46
|
+
d="M4.25 5C4.0375 5 3.85942 4.92808 3.71575 4.78425C3.57192 4.64042 3.5 4.46225 3.5 4.24975C3.5 4.03708 3.57192 3.859 3.71575 3.7155C3.85942 3.57183 4.0375 3.5 4.25 3.5H19.75C19.9625 3.5 20.1406 3.57192 20.2843 3.71575C20.4281 3.85958 20.5 4.03775 20.5 4.25025C20.5 4.46292 20.4281 4.641 20.2843 4.7845C20.1406 4.92817 19.9625 5 19.75 5H4.25ZM10.25 8.875C10.0375 8.875 9.85942 8.80308 9.71575 8.65925C9.57192 8.51542 9.5 8.33725 9.5 8.12475C9.5 7.91208 9.57192 7.734 9.71575 7.5905C9.85942 7.44683 10.0375 7.375 10.25 7.375H19.75C19.9625 7.375 20.1406 7.44692 20.2843 7.59075C20.4281 7.73458 20.5 7.91275 20.5 8.12525C20.5 8.33792 20.4281 8.516 20.2843 8.6595C20.1406 8.80317 19.9625 8.875 19.75 8.875H10.25ZM4.25 12.75C4.0375 12.75 3.85942 12.6781 3.71575 12.5343C3.57192 12.3904 3.5 12.2122 3.5 11.9998C3.5 11.7871 3.57192 11.609 3.71575 11.4655C3.85942 11.3218 4.0375 11.25 4.25 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2843 11.4658C20.4281 11.6096 20.5 11.7878 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2843 12.5345C20.1406 12.6782 19.9625 12.75 19.75 12.75H4.25ZM10.25 16.625C10.0375 16.625 9.85942 16.5531 9.71575 16.4093C9.57192 16.2654 9.5 16.0872 9.5 15.8748C9.5 15.6621 9.57192 15.484 9.71575 15.3405C9.85942 15.1968 10.0375 15.125 10.25 15.125H19.75C19.9625 15.125 20.1406 15.1969 20.2843 15.3408C20.4281 15.4846 20.5 15.6628 20.5 15.8753C20.5 16.0879 20.4281 16.266 20.2843 16.4095C20.1406 16.5532 19.9625 16.625 19.75 16.625H10.25ZM4.25 20.5C4.0375 20.5 3.85942 20.4281 3.71575 20.2843C3.57192 20.1404 3.5 19.9622 3.5 19.7498C3.5 19.5371 3.57192 19.359 3.71575 19.2155C3.85942 19.0718 4.0375 19 4.25 19H19.75C19.9625 19 20.1406 19.0719 20.2843 19.2158C20.4281 19.3596 20.5 19.5378 20.5 19.7502C20.5 19.9629 20.4281 20.141 20.2843 20.2845C20.1406 20.4282 19.9625 20.5 19.75 20.5H4.25Z"
|
|
47
|
+
/>
|
|
48
|
+
</svg>
|
|
49
|
+
`,Rx=`
|
|
50
|
+
<svg
|
|
51
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
52
|
+
width="24"
|
|
53
|
+
height="24"
|
|
54
|
+
viewBox="0 0 24 24"
|
|
55
|
+
>
|
|
56
|
+
<path
|
|
57
|
+
d="M8.85758 18.625C8.4358 18.625 8.07715 18.4772 7.78163 18.1817C7.48613 17.8862 7.33838 17.5275 7.33838 17.1058V6.8942C7.33838 6.47242 7.48613 6.11377 7.78163 5.81825C8.07715 5.52275 8.4358 5.375 8.85758 5.375H12.1999C13.2191 5.375 14.1406 5.69231 14.9643 6.32693C15.788 6.96154 16.1999 7.81603 16.1999 8.89038C16.1999 9.63779 16.0194 10.2471 15.6585 10.7183C15.2976 11.1894 14.9088 11.5314 14.4922 11.7442C15.005 11.9211 15.4947 12.2708 15.9614 12.7933C16.428 13.3157 16.6614 14.0192 16.6614 14.9038C16.6614 16.182 16.1902 17.1217 15.2479 17.723C14.3056 18.3243 13.3563 18.625 12.3999 18.625H8.85758ZM9.4883 16.6327H12.3191C13.1063 16.6327 13.6627 16.4141 13.9884 15.9769C14.314 15.5397 14.4768 15.1205 14.4768 14.7192C14.4768 14.3179 14.314 13.8987 13.9884 13.4615C13.6627 13.0243 13.0909 12.8057 12.273 12.8057H9.4883V16.6327ZM9.4883 10.875H12.0826C12.6903 10.875 13.172 10.7013 13.5278 10.3539C13.8836 10.0064 14.0615 9.59037 14.0615 9.10575C14.0615 8.59035 13.8733 8.16918 13.497 7.84225C13.1207 7.51533 12.6595 7.35188 12.1133 7.35188H9.4883V10.875Z"
|
|
58
|
+
/>
|
|
59
|
+
</svg>
|
|
60
|
+
`,Rk=`
|
|
61
|
+
<svg
|
|
62
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
63
|
+
width="24"
|
|
64
|
+
height="24"
|
|
65
|
+
viewBox="0 0 24 24"
|
|
66
|
+
>
|
|
67
|
+
<g clip-path="url(#clip0_952_6527)">
|
|
68
|
+
<circle cx="12" cy="12" r="3" />
|
|
69
|
+
</g>
|
|
70
|
+
<defs>
|
|
71
|
+
<clipPath id="clip0_952_6527">
|
|
72
|
+
<rect width="24" height="24" />
|
|
73
|
+
</clipPath>
|
|
74
|
+
</defs>
|
|
75
|
+
</svg>
|
|
76
|
+
`,RC=`
|
|
77
|
+
<svg
|
|
78
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
79
|
+
width="24"
|
|
80
|
+
height="24"
|
|
81
|
+
viewBox="0 0 24 24"
|
|
82
|
+
>
|
|
83
|
+
<g clip-path="url(#clip0_977_8070)">
|
|
84
|
+
<path
|
|
85
|
+
d="M4 10.5C3.17 10.5 2.5 11.17 2.5 12C2.5 12.83 3.17 13.5 4 13.5C4.83 13.5 5.5 12.83 5.5 12C5.5 11.17 4.83 10.5 4 10.5ZM4 4.5C3.17 4.5 2.5 5.17 2.5 6C2.5 6.83 3.17 7.5 4 7.5C4.83 7.5 5.5 6.83 5.5 6C5.5 5.17 4.83 4.5 4 4.5ZM4 16.5C3.17 16.5 2.5 17.18 2.5 18C2.5 18.82 3.18 19.5 4 19.5C4.82 19.5 5.5 18.82 5.5 18C5.5 17.18 4.83 16.5 4 16.5ZM8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19ZM8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13ZM7 6C7 6.55 7.45 7 8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6Z"
|
|
86
|
+
/>
|
|
87
|
+
</g>
|
|
88
|
+
<defs>
|
|
89
|
+
<clipPath id="clip0_977_8070">
|
|
90
|
+
<rect width="24" height="24" />
|
|
91
|
+
</clipPath>
|
|
92
|
+
</defs>
|
|
93
|
+
</svg>
|
|
94
|
+
`,RS=`
|
|
95
|
+
<svg
|
|
96
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
97
|
+
width="32"
|
|
98
|
+
height="32"
|
|
99
|
+
viewBox="0 0 24 24"
|
|
100
|
+
>
|
|
101
|
+
<path
|
|
102
|
+
fill="currentColor"
|
|
103
|
+
d="M9 22a1 1 0 0 1-1-1v-3H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6.1l-3.7 3.71c-.2.19-.45.29-.7.29zm1-6v3.08L13.08 16H20V4H4v12z"
|
|
104
|
+
/>
|
|
105
|
+
</svg>
|
|
106
|
+
`,RM=`
|
|
107
|
+
<svg
|
|
108
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
109
|
+
width="24"
|
|
110
|
+
height="24"
|
|
111
|
+
viewBox="0 0 24 24"
|
|
112
|
+
>
|
|
113
|
+
<g clip-path="url(#clip0_1803_1151)">
|
|
114
|
+
<path
|
|
115
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM10.71 16.29C10.32 16.68 9.69 16.68 9.3 16.29L5.71 12.7C5.32 12.31 5.32 11.68 5.71 11.29C6.1 10.9 6.73 10.9 7.12 11.29L10 14.17L16.88 7.29C17.27 6.9 17.9 6.9 18.29 7.29C18.68 7.68 18.68 8.31 18.29 8.7L10.71 16.29Z"
|
|
116
|
+
/>
|
|
117
|
+
</g>
|
|
118
|
+
<defs>
|
|
119
|
+
<clipPath id="clip0_1803_1151">
|
|
120
|
+
<rect width="24" height="24" />
|
|
121
|
+
</clipPath>
|
|
122
|
+
</defs>
|
|
123
|
+
</svg>
|
|
124
|
+
`,RA=`
|
|
125
|
+
<svg
|
|
126
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
127
|
+
width="24"
|
|
128
|
+
height="24"
|
|
129
|
+
viewBox="0 0 24 24"
|
|
130
|
+
>
|
|
131
|
+
<g clip-path="url(#clip0_1803_535)">
|
|
132
|
+
<path
|
|
133
|
+
d="M18 19H6C5.45 19 5 18.55 5 18V6C5 5.45 5.45 5 6 5H18C18.55 5 19 5.45 19 6V18C19 18.55 18.55 19 18 19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3Z"
|
|
134
|
+
/>
|
|
135
|
+
</g>
|
|
136
|
+
<defs>
|
|
137
|
+
<clipPath id="clip0_1803_535">
|
|
138
|
+
<rect width="24" height="24" />
|
|
139
|
+
</clipPath>
|
|
140
|
+
</defs>
|
|
141
|
+
</svg>
|
|
142
|
+
`,RT=`
|
|
143
|
+
<svg
|
|
144
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
145
|
+
fill="none"
|
|
146
|
+
viewBox="0 0 24 24"
|
|
147
|
+
stroke-width="1.5"
|
|
148
|
+
stroke="currentColor"
|
|
149
|
+
class="w-6 h-6"
|
|
150
|
+
>
|
|
151
|
+
<path
|
|
152
|
+
stroke-linecap="round"
|
|
153
|
+
stroke-linejoin="round"
|
|
154
|
+
d="M19.5 8.25l-7.5 7.5-7.5-7.5"
|
|
155
|
+
/>
|
|
156
|
+
</svg>
|
|
157
|
+
`,RO=`
|
|
158
|
+
<svg
|
|
159
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
160
|
+
fill="none"
|
|
161
|
+
viewBox="0 0 24 24"
|
|
162
|
+
stroke-width="1.5"
|
|
163
|
+
stroke="currentColor"
|
|
164
|
+
>
|
|
165
|
+
<path
|
|
166
|
+
stroke-linecap="round"
|
|
167
|
+
stroke-linejoin="round"
|
|
168
|
+
d="M15.75 19.5L8.25 12l7.5-7.5"
|
|
169
|
+
/>
|
|
170
|
+
</svg>
|
|
171
|
+
`,RE=`
|
|
172
|
+
<svg
|
|
173
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
174
|
+
fill="none"
|
|
175
|
+
viewBox="0 0 24 24"
|
|
176
|
+
stroke-width="1.5"
|
|
177
|
+
stroke="currentColor"
|
|
178
|
+
>
|
|
179
|
+
<path
|
|
180
|
+
stroke-linecap="round"
|
|
181
|
+
stroke-linejoin="round"
|
|
182
|
+
d="M8.25 4.5l7.5 7.5-7.5 7.5"
|
|
183
|
+
/>
|
|
184
|
+
</svg>
|
|
185
|
+
`,RN=`
|
|
186
|
+
<svg
|
|
187
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
188
|
+
width="24"
|
|
189
|
+
height="24"
|
|
190
|
+
viewBox="0 0 24 24"
|
|
191
|
+
>
|
|
192
|
+
<g clip-path="url(#clip0_1098_15553)">
|
|
193
|
+
<path
|
|
194
|
+
d="M18.3007 5.70973C17.9107 5.31973 17.2807 5.31973 16.8907 5.70973L12.0007 10.5897L7.1107 5.69973C6.7207 5.30973 6.0907 5.30973 5.7007 5.69973C5.3107 6.08973 5.3107 6.71973 5.7007 7.10973L10.5907 11.9997L5.7007 16.8897C5.3107 17.2797 5.3107 17.9097 5.7007 18.2997C6.0907 18.6897 6.7207 18.6897 7.1107 18.2997L12.0007 13.4097L16.8907 18.2997C17.2807 18.6897 17.9107 18.6897 18.3007 18.2997C18.6907 17.9097 18.6907 17.2797 18.3007 16.8897L13.4107 11.9997L18.3007 7.10973C18.6807 6.72973 18.6807 6.08973 18.3007 5.70973Z"
|
|
195
|
+
/>
|
|
196
|
+
</g>
|
|
197
|
+
<defs>
|
|
198
|
+
<clipPath id="clip0_1098_15553">
|
|
199
|
+
<rect width="24" height="24" />
|
|
200
|
+
</clipPath>
|
|
201
|
+
</defs>
|
|
202
|
+
</svg>
|
|
203
|
+
`,RD=`
|
|
204
|
+
<svg
|
|
205
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
206
|
+
width="24"
|
|
207
|
+
height="24"
|
|
208
|
+
viewBox="0 0 24 24"
|
|
209
|
+
>
|
|
210
|
+
<g clip-path="url(#clip0_977_8081)">
|
|
211
|
+
<path
|
|
212
|
+
d="M9.4 16.6L4.8 12L9.4 7.4L8 6L2 12L8 18L9.4 16.6ZM14.6 16.6L19.2 12L14.6 7.4L16 6L22 12L16 18L14.6 16.6Z"
|
|
213
|
+
/>
|
|
214
|
+
</g>
|
|
215
|
+
<defs>
|
|
216
|
+
<clipPath id="clip0_977_8081">
|
|
217
|
+
<rect width="24" height="24" />
|
|
218
|
+
</clipPath>
|
|
219
|
+
</defs>
|
|
220
|
+
</svg>
|
|
221
|
+
`,RI=`
|
|
222
|
+
<svg
|
|
223
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
224
|
+
width="24"
|
|
225
|
+
height="24"
|
|
226
|
+
viewBox="0 0 24 24"
|
|
227
|
+
>
|
|
228
|
+
<path
|
|
229
|
+
d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm8 10h6v2h-6v-2zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243-1.415-1.415L8.667 12z"
|
|
230
|
+
/>
|
|
231
|
+
</svg>
|
|
232
|
+
`,RL=`
|
|
233
|
+
<svg
|
|
234
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
235
|
+
width="24"
|
|
236
|
+
height="24"
|
|
237
|
+
viewBox="0 0 24 24"
|
|
238
|
+
fill="none"
|
|
239
|
+
>
|
|
240
|
+
<g clip-path="url(#clip0_1013_1606)">
|
|
241
|
+
<path
|
|
242
|
+
d="M9.00012 16.1998L5.50012 12.6998C5.11012 12.3098 4.49012 12.3098 4.10012 12.6998C3.71012 13.0898 3.71012 13.7098 4.10012 14.0998L8.29012 18.2898C8.68012 18.6798 9.31012 18.6798 9.70012 18.2898L20.3001 7.69982C20.6901 7.30982 20.6901 6.68982 20.3001 6.29982C19.9101 5.90982 19.2901 5.90982 18.9001 6.29982L9.00012 16.1998Z"
|
|
243
|
+
fill="#817567"
|
|
244
|
+
/>
|
|
245
|
+
</g>
|
|
246
|
+
<defs>
|
|
247
|
+
<clipPath id="clip0_1013_1606">
|
|
248
|
+
<rect width="24" height="24" />
|
|
249
|
+
</clipPath>
|
|
250
|
+
</defs>
|
|
251
|
+
</svg>
|
|
252
|
+
`,R_=`
|
|
253
|
+
<svg
|
|
254
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
255
|
+
height="24px"
|
|
256
|
+
viewBox="0 -960 960 960"
|
|
257
|
+
width="24px"
|
|
258
|
+
fill="none"
|
|
259
|
+
>
|
|
260
|
+
<path
|
|
261
|
+
d="M360-240q-33 0-56.5-23.5T280-320v-480q0-33 23.5-56.5T360-880h360q33 0 56.5 23.5T800-800v480q0 33-23.5 56.5T720-240H360Zm0-80h360v-480H360v480ZM200-80q-33 0-56.5-23.5T120-160v-560h80v560h440v80H200Zm160-240v-480 480Z"
|
|
262
|
+
/>
|
|
263
|
+
</svg>
|
|
264
|
+
`,RR=`
|
|
265
|
+
<svg
|
|
266
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
267
|
+
width="24"
|
|
268
|
+
height="24"
|
|
269
|
+
viewBox="0 0 24 24"
|
|
270
|
+
>
|
|
271
|
+
<g clip-path="url(#clip0_977_7900)">
|
|
272
|
+
<path
|
|
273
|
+
fill-rule="evenodd"
|
|
274
|
+
clip-rule="evenodd"
|
|
275
|
+
d="M19 13H5C4.45 13 4 12.55 4 12C4 11.45 4.45 11 5 11H19C19.55 11 20 11.45 20 12C20 12.55 19.55 13 19 13Z"
|
|
276
|
+
/>
|
|
277
|
+
</g>
|
|
278
|
+
<defs>
|
|
279
|
+
<clipPath id="clip0_977_7900">
|
|
280
|
+
<rect width="24" height="24" />
|
|
281
|
+
</clipPath>
|
|
282
|
+
</defs>
|
|
283
|
+
</svg>
|
|
284
|
+
`,Rz=`
|
|
285
|
+
<svg
|
|
286
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
287
|
+
width="16"
|
|
288
|
+
height="16"
|
|
289
|
+
viewBox="0 0 16 16"
|
|
290
|
+
>
|
|
291
|
+
<path
|
|
292
|
+
d="M3.5 9.83366C3.35833 9.83366 3.23961 9.78571 3.14383 9.68983C3.04794 9.59394 3 9.47516 3 9.33349C3 9.19171 3.04794 9.07299 3.14383 8.97733C3.23961 8.88155 3.35833 8.83366 3.5 8.83366H12.5C12.6417 8.83366 12.7604 8.8816 12.8562 8.97749C12.9521 9.07338 13 9.19216 13 9.33383C13 9.4756 12.9521 9.59433 12.8562 9.68999C12.7604 9.78577 12.6417 9.83366 12.5 9.83366H3.5ZM3.5 7.16699C3.35833 7.16699 3.23961 7.11905 3.14383 7.02316C3.04794 6.92727 3 6.80849 3 6.66683C3 6.52505 3.04794 6.40633 3.14383 6.31066C3.23961 6.21488 3.35833 6.16699 3.5 6.16699H12.5C12.6417 6.16699 12.7604 6.21494 12.8562 6.31083C12.9521 6.40671 13 6.52549 13 6.66716C13 6.80894 12.9521 6.92766 12.8562 7.02333C12.7604 7.1191 12.6417 7.16699 12.5 7.16699H3.5Z"
|
|
293
|
+
/>
|
|
294
|
+
</svg>
|
|
295
|
+
`,RP=`
|
|
296
|
+
<svg
|
|
297
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
298
|
+
width="24"
|
|
299
|
+
height="24"
|
|
300
|
+
viewBox="0 0 24 24"
|
|
301
|
+
>
|
|
302
|
+
<g clip-path="url(#clip0_1013_1585)">
|
|
303
|
+
<path
|
|
304
|
+
d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z"
|
|
305
|
+
/>
|
|
306
|
+
</g>
|
|
307
|
+
<defs>
|
|
308
|
+
<clipPath id="clip0_1013_1585">
|
|
309
|
+
<rect width="24" height="24" />
|
|
310
|
+
</clipPath>
|
|
311
|
+
</defs>
|
|
312
|
+
</svg>
|
|
313
|
+
`,RB=`
|
|
314
|
+
<svg
|
|
315
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
316
|
+
width="24"
|
|
317
|
+
height="24"
|
|
318
|
+
viewBox="0 0 24 24"
|
|
319
|
+
>
|
|
320
|
+
<path
|
|
321
|
+
fill="currentColor"
|
|
322
|
+
d="M9 16l-5-5l5-5l1.4 1.4L7.825 10H18V6h2v6H7.825l2.575 2.6z"
|
|
323
|
+
/>
|
|
324
|
+
</svg>
|
|
325
|
+
`,RF=`
|
|
326
|
+
<svg
|
|
327
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
328
|
+
width="24"
|
|
329
|
+
height="24"
|
|
330
|
+
viewBox="0 0 24 24"
|
|
331
|
+
>
|
|
332
|
+
<path
|
|
333
|
+
fill="currentColor"
|
|
334
|
+
d="M9.55 17.575L4.225 12.25l1.4-1.425L9.55 14.75l8.825-8.825l1.4 1.425z"
|
|
335
|
+
/>
|
|
336
|
+
</svg>
|
|
337
|
+
`,RH=`
|
|
338
|
+
<svg
|
|
339
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
340
|
+
width="24"
|
|
341
|
+
height="24"
|
|
342
|
+
viewBox="0 0 24 24"
|
|
343
|
+
>
|
|
344
|
+
<g clip-path="url(#clip0_992_5553)">
|
|
345
|
+
<path
|
|
346
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM12 17H14V7H10V9H12V17Z"
|
|
347
|
+
/>
|
|
348
|
+
</g>
|
|
349
|
+
<defs>
|
|
350
|
+
<clipPath id="clip0_992_5553">
|
|
351
|
+
<rect width="24" height="24" />
|
|
352
|
+
</clipPath>
|
|
353
|
+
</defs>
|
|
354
|
+
</svg>
|
|
355
|
+
`,Rq=`
|
|
356
|
+
<svg
|
|
357
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
358
|
+
width="24"
|
|
359
|
+
height="24"
|
|
360
|
+
viewBox="0 0 24 24"
|
|
361
|
+
>
|
|
362
|
+
<g clip-path="url(#clip0_992_5559)">
|
|
363
|
+
<path
|
|
364
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15H11V13H13C14.1 13 15 12.11 15 11V9C15 7.89 14.1 7 13 7H9V9H13V11H11C9.9 11 9 11.89 9 13V17H15V15Z"
|
|
365
|
+
/>
|
|
366
|
+
</g>
|
|
367
|
+
<defs>
|
|
368
|
+
<clipPath id="clip0_992_5559">
|
|
369
|
+
<rect width="24" height="24" />
|
|
370
|
+
</clipPath>
|
|
371
|
+
</defs>
|
|
372
|
+
</svg>
|
|
373
|
+
`,Rj=`
|
|
374
|
+
<svg
|
|
375
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
376
|
+
width="24"
|
|
377
|
+
height="24"
|
|
378
|
+
viewBox="0 0 24 24"
|
|
379
|
+
>
|
|
380
|
+
<g clip-path="url(#clip0_992_5565)">
|
|
381
|
+
<path
|
|
382
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13.5C15 12.67 14.33 12 13.5 12C14.33 12 15 11.33 15 10.5V9C15 7.89 14.1 7 13 7H9V9H13V11H11V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
|
|
383
|
+
/>
|
|
384
|
+
</g>
|
|
385
|
+
<defs>
|
|
386
|
+
<clipPath id="clip0_992_5565">
|
|
387
|
+
<rect width="24" height="24" />
|
|
388
|
+
</clipPath>
|
|
389
|
+
</defs>
|
|
390
|
+
</svg>
|
|
391
|
+
`,RV=`
|
|
392
|
+
<svg
|
|
393
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
394
|
+
width="24"
|
|
395
|
+
height="24"
|
|
396
|
+
viewBox="0 0 24 24"
|
|
397
|
+
>
|
|
398
|
+
<g clip-path="url(#clip0_977_7757)">
|
|
399
|
+
<path
|
|
400
|
+
d="M19.04 3H5.04004C3.94004 3 3.04004 3.9 3.04004 5V19C3.04004 20.1 3.94004 21 5.04004 21H19.04C20.14 21 21.04 20.1 21.04 19V5C21.04 3.9 20.14 3 19.04 3ZM19.04 19H5.04004V5H19.04V19ZM13.04 17H15.04V7H13.04V11H11.04V7H9.04004V13H13.04V17Z"
|
|
401
|
+
/>
|
|
402
|
+
</g>
|
|
403
|
+
<defs>
|
|
404
|
+
<clipPath id="clip0_977_7757">
|
|
405
|
+
<rect width="24" height="24" />
|
|
406
|
+
</clipPath>
|
|
407
|
+
</defs>
|
|
408
|
+
</svg>
|
|
409
|
+
`,R$=`
|
|
410
|
+
<svg
|
|
411
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
412
|
+
width="24"
|
|
413
|
+
height="24"
|
|
414
|
+
viewBox="0 0 24 24"
|
|
415
|
+
>
|
|
416
|
+
<g clip-path="url(#clip0_977_7760)">
|
|
417
|
+
<path
|
|
418
|
+
d="M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19ZM15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H9V13H13V15H9V17H13C14.1 17 15 16.11 15 15Z"
|
|
419
|
+
/>
|
|
420
|
+
</g>
|
|
421
|
+
<defs>
|
|
422
|
+
<clipPath id="clip0_977_7760">
|
|
423
|
+
<rect width="24" height="24" />
|
|
424
|
+
</clipPath>
|
|
425
|
+
</defs>
|
|
426
|
+
</svg>
|
|
427
|
+
`,RW=`
|
|
428
|
+
<svg
|
|
429
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
430
|
+
width="24"
|
|
431
|
+
height="24"
|
|
432
|
+
viewBox="0 0 24 24"
|
|
433
|
+
>
|
|
434
|
+
<g clip-path="url(#clip0_977_7763)">
|
|
435
|
+
<path
|
|
436
|
+
d="M11 17H13C14.1 17 15 16.11 15 15V13C15 11.89 14.1 11 13 11H11V9H15V7H11C9.9 7 9 7.89 9 9V15C9 16.11 9.9 17 11 17ZM11 13H13V15H11V13ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM19 19H5V5H19V19Z"
|
|
437
|
+
/>
|
|
438
|
+
</g>
|
|
439
|
+
<defs>
|
|
440
|
+
<clipPath id="clip0_977_7763">
|
|
441
|
+
<rect width="24" height="24" />
|
|
442
|
+
</clipPath>
|
|
443
|
+
</defs>
|
|
444
|
+
</svg>
|
|
445
|
+
`,RU=`
|
|
446
|
+
<svg
|
|
447
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
448
|
+
width="24"
|
|
449
|
+
height="24"
|
|
450
|
+
viewBox="0 0 24 24"
|
|
451
|
+
>
|
|
452
|
+
<g clip-path="url(#clip0_977_8075)">
|
|
453
|
+
<path
|
|
454
|
+
d="M19 5V19H5V5H19ZM19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3ZM14.14 11.86L11.14 15.73L9 13.14L6 17H18L14.14 11.86Z"
|
|
455
|
+
/>
|
|
456
|
+
</g>
|
|
457
|
+
<defs>
|
|
458
|
+
<clipPath id="clip0_977_8075">
|
|
459
|
+
<rect width="24" height="24" />
|
|
460
|
+
</clipPath>
|
|
461
|
+
</defs>
|
|
462
|
+
</svg>
|
|
463
|
+
`,RG=`
|
|
464
|
+
<svg
|
|
465
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
466
|
+
width="24"
|
|
467
|
+
height="24"
|
|
468
|
+
viewBox="0 0 24 24"
|
|
469
|
+
>
|
|
470
|
+
<path
|
|
471
|
+
d="M6.29811 18.625C6.04505 18.625 5.83115 18.5375 5.65641 18.3626C5.48166 18.1877 5.39429 17.9736 5.39429 17.7203C5.39429 17.467 5.48166 17.2532 5.65641 17.0788C5.83115 16.9045 6.04505 16.8173 6.29811 16.8173H9.21159L12.452 7.18265H9.53851C9.28545 7.18265 9.07155 7.0952 8.89681 6.9203C8.72206 6.7454 8.63469 6.5313 8.63469 6.278C8.63469 6.02472 8.72206 5.81089 8.89681 5.63652C9.07155 5.46217 9.28545 5.375 9.53851 5.375H16.8847C17.1377 5.375 17.3516 5.46245 17.5264 5.63735C17.7011 5.81225 17.7885 6.02634 17.7885 6.27962C17.7885 6.53293 17.7011 6.74676 17.5264 6.92113C17.3516 7.09548 17.1377 7.18265 16.8847 7.18265H14.2789L11.0385 16.8173H13.6443C13.8973 16.8173 14.1112 16.9048 14.286 17.0797C14.4607 17.2546 14.5481 17.4687 14.5481 17.722C14.5481 17.9752 14.4607 18.1891 14.286 18.3634C14.1112 18.5378 13.8973 18.625 13.6443 18.625H6.29811Z"
|
|
472
|
+
/>
|
|
473
|
+
</svg>
|
|
474
|
+
`,RK=`
|
|
475
|
+
<svg
|
|
476
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
477
|
+
width="24"
|
|
478
|
+
height="24"
|
|
479
|
+
viewBox="0 0 24 24"
|
|
480
|
+
>
|
|
481
|
+
<path
|
|
482
|
+
d="M17.0385 19.5003V16.5388H14.0769V15.0388H17.0385V12.0773H18.5384V15.0388H21.5V16.5388H18.5384V19.5003H17.0385ZM10.8077 16.5388H7.03845C5.78282 16.5388 4.7125 16.0963 3.8275 15.2114C2.9425 14.3266 2.5 13.2564 2.5 12.0009C2.5 10.7454 2.9425 9.67504 3.8275 8.78979C4.7125 7.90454 5.78282 7.46191 7.03845 7.46191H10.8077V8.96186H7.03845C6.1987 8.96186 5.48235 9.25834 4.8894 9.85129C4.29645 10.4442 3.99998 11.1606 3.99998 12.0003C3.99998 12.8401 4.29645 13.5564 4.8894 14.1494C5.48235 14.7423 6.1987 15.0388 7.03845 15.0388H10.8077V16.5388ZM8.25 12.7503V11.2504H15.75V12.7503H8.25ZM21.5 12.0003H20C20 11.1606 19.7035 10.4442 19.1106 9.85129C18.5176 9.25834 17.8013 8.96186 16.9615 8.96186H13.1923V7.46191H16.9615C18.2171 7.46191 19.2875 7.90441 20.1725 8.78939C21.0575 9.67439 21.5 10.7447 21.5 12.0003Z"
|
|
483
|
+
/>
|
|
484
|
+
</svg>
|
|
485
|
+
`,RJ=`
|
|
486
|
+
<svg
|
|
487
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
488
|
+
width="24"
|
|
489
|
+
height="24"
|
|
490
|
+
viewBox="0 0 24 24"
|
|
491
|
+
>
|
|
492
|
+
<path
|
|
493
|
+
fill="currentColor"
|
|
494
|
+
d="M3 18v-2h13v2zm0-5v-2h18v2zm0-5V6h18v2zm15 13v-3h-3v-2h3v-3h2v3h3v2h-3v3z"
|
|
495
|
+
/>
|
|
496
|
+
</svg>
|
|
497
|
+
`,RZ=`
|
|
498
|
+
<svg
|
|
499
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
500
|
+
width="24"
|
|
501
|
+
height="24"
|
|
502
|
+
viewBox="0 0 24 24"
|
|
503
|
+
>
|
|
504
|
+
<g clip-path="url(#clip0_971_7680)">
|
|
505
|
+
<path
|
|
506
|
+
d="M11 18C11 19.1 10.1 20 9 20C7.9 20 7 19.1 7 18C7 16.9 7.9 16 9 16C10.1 16 11 16.9 11 18ZM9 10C7.9 10 7 10.9 7 12C7 13.1 7.9 14 9 14C10.1 14 11 13.1 11 12C11 10.9 10.1 10 9 10ZM9 4C7.9 4 7 4.9 7 6C7 7.1 7.9 8 9 8C10.1 8 11 7.1 11 6C11 4.9 10.1 4 9 4ZM15 8C16.1 8 17 7.1 17 6C17 4.9 16.1 4 15 4C13.9 4 13 4.9 13 6C13 7.1 13.9 8 15 8ZM15 10C13.9 10 13 10.9 13 12C13 13.1 13.9 14 15 14C16.1 14 17 13.1 17 12C17 10.9 16.1 10 15 10ZM15 16C13.9 16 13 16.9 13 18C13 19.1 13.9 20 15 20C16.1 20 17 19.1 17 18C17 16.9 16.1 16 15 16Z"
|
|
507
|
+
/>
|
|
508
|
+
</g>
|
|
509
|
+
<defs>
|
|
510
|
+
<clipPath id="clip0_971_7680">
|
|
511
|
+
<rect width="24" height="24" />
|
|
512
|
+
</clipPath>
|
|
513
|
+
</defs>
|
|
514
|
+
</svg>
|
|
515
|
+
`,RY=`
|
|
516
|
+
<svg
|
|
517
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
518
|
+
width="24"
|
|
519
|
+
height="24"
|
|
520
|
+
viewBox="0 0 24 24"
|
|
521
|
+
>
|
|
522
|
+
<g clip-path="url(#clip0_977_8067)">
|
|
523
|
+
<path
|
|
524
|
+
d="M8 7H20C20.55 7 21 6.55 21 6C21 5.45 20.55 5 20 5H8C7.45 5 7 5.45 7 6C7 6.55 7.45 7 8 7ZM20 17H8C7.45 17 7 17.45 7 18C7 18.55 7.45 19 8 19H20C20.55 19 21 18.55 21 18C21 17.45 20.55 17 20 17ZM20 11H8C7.45 11 7 11.45 7 12C7 12.55 7.45 13 8 13H20C20.55 13 21 12.55 21 12C21 11.45 20.55 11 20 11ZM4.5 16H2.5C2.22 16 2 16.22 2 16.5C2 16.78 2.22 17 2.5 17H4V17.5H3.5C3.22 17.5 3 17.72 3 18C3 18.28 3.22 18.5 3.5 18.5H4V19H2.5C2.22 19 2 19.22 2 19.5C2 19.78 2.22 20 2.5 20H4.5C4.78 20 5 19.78 5 19.5V16.5C5 16.22 4.78 16 4.5 16ZM2.5 5H3V7.5C3 7.78 3.22 8 3.5 8C3.78 8 4 7.78 4 7.5V4.5C4 4.22 3.78 4 3.5 4H2.5C2.22 4 2 4.22 2 4.5C2 4.78 2.22 5 2.5 5ZM4.5 10H2.5C2.22 10 2 10.22 2 10.5C2 10.78 2.22 11 2.5 11H3.8L2.12 12.96C2.04 13.05 2 13.17 2 13.28V13.5C2 13.78 2.22 14 2.5 14H4.5C4.78 14 5 13.78 5 13.5C5 13.22 4.78 13 4.5 13H3.2L4.88 11.04C4.96 10.95 5 10.83 5 10.72V10.5C5 10.22 4.78 10 4.5 10Z"
|
|
525
|
+
/>
|
|
526
|
+
</g>
|
|
527
|
+
<defs>
|
|
528
|
+
<clipPath id="clip0_977_8067">
|
|
529
|
+
<rect width="24" height="24" />
|
|
530
|
+
</clipPath>
|
|
531
|
+
</defs>
|
|
532
|
+
</svg>
|
|
533
|
+
`,RX=`
|
|
534
|
+
<svg
|
|
535
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
536
|
+
width="24"
|
|
537
|
+
height="24"
|
|
538
|
+
viewBox="0 0 24 24"
|
|
539
|
+
>
|
|
540
|
+
<g clip-path="url(#clip0_971_7676)">
|
|
541
|
+
<path
|
|
542
|
+
d="M18 13H13V18C13 18.55 12.55 19 12 19C11.45 19 11 18.55 11 18V13H6C5.45 13 5 12.55 5 12C5 11.45 5.45 11 6 11H11V6C11 5.45 11.45 5 12 5C12.55 5 13 5.45 13 6V11H18C18.55 11 19 11.45 19 12C19 12.55 18.55 13 18 13Z"
|
|
543
|
+
/>
|
|
544
|
+
</g>
|
|
545
|
+
<defs>
|
|
546
|
+
<clipPath id="clip0_971_7676">
|
|
547
|
+
<rect width="24" height="24" />
|
|
548
|
+
</clipPath>
|
|
549
|
+
</defs>
|
|
550
|
+
</svg>
|
|
551
|
+
`,RQ=`
|
|
552
|
+
<svg
|
|
553
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
554
|
+
width="24"
|
|
555
|
+
height="24"
|
|
556
|
+
viewBox="0 0 24 24"
|
|
557
|
+
>
|
|
558
|
+
<g clip-path="url(#clip0_977_7897)">
|
|
559
|
+
<path
|
|
560
|
+
d="M7.17 17C7.68 17 8.15 16.71 8.37 16.26L9.79 13.42C9.93 13.14 10 12.84 10 12.53V8C10 7.45 9.55 7 9 7H5C4.45 7 4 7.45 4 8V12C4 12.55 4.45 13 5 13H7L5.97 15.06C5.52 15.95 6.17 17 7.17 17ZM17.17 17C17.68 17 18.15 16.71 18.37 16.26L19.79 13.42C19.93 13.14 20 12.84 20 12.53V8C20 7.45 19.55 7 19 7H15C14.45 7 14 7.45 14 8V12C14 12.55 14.45 13 15 13H17L15.97 15.06C15.52 15.95 16.17 17 17.17 17Z"
|
|
561
|
+
/>
|
|
562
|
+
</g>
|
|
563
|
+
<defs>
|
|
564
|
+
<clipPath id="clip0_977_7897">
|
|
565
|
+
<rect width="24" height="24" />
|
|
566
|
+
</clipPath>
|
|
567
|
+
</defs>
|
|
568
|
+
</svg>
|
|
569
|
+
`,R0=`
|
|
570
|
+
<svg
|
|
571
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
572
|
+
width="24"
|
|
573
|
+
height="24"
|
|
574
|
+
viewBox="0 0 24 24"
|
|
575
|
+
>
|
|
576
|
+
<path
|
|
577
|
+
d="M7.30775 20.4997C6.81058 20.4997 6.385 20.3227 6.031 19.9687C5.677 19.6147 5.5 19.1892 5.5 18.692V5.99973H5.25C5.0375 5.99973 4.85942 5.92782 4.71575 5.78398C4.57192 5.64015 4.5 5.46198 4.5 5.24948C4.5 5.03682 4.57192 4.85873 4.71575 4.71523C4.85942 4.57157 5.0375 4.49973 5.25 4.49973H9C9 4.2549 9.08625 4.04624 9.25875 3.87374C9.43108 3.7014 9.63967 3.61523 9.8845 3.61523H14.1155C14.3603 3.61523 14.5689 3.7014 14.7413 3.87374C14.9138 4.04624 15 4.2549 15 4.49973H18.75C18.9625 4.49973 19.1406 4.57165 19.2843 4.71548C19.4281 4.85932 19.5 5.03748 19.5 5.24998C19.5 5.46265 19.4281 5.64073 19.2843 5.78423C19.1406 5.9279 18.9625 5.99973 18.75 5.99973H18.5V18.692C18.5 19.1892 18.323 19.6147 17.969 19.9687C17.615 20.3227 17.1894 20.4997 16.6923 20.4997H7.30775ZM17 5.99973H7V18.692C7 18.7818 7.02883 18.8556 7.0865 18.9132C7.14417 18.9709 7.21792 18.9997 7.30775 18.9997H16.6923C16.7821 18.9997 16.8558 18.9709 16.9135 18.9132C16.9712 18.8556 17 18.7818 17 18.692V5.99973ZM10.1543 16.9997C10.3668 16.9997 10.5448 16.9279 10.6885 16.7842C10.832 16.6404 10.9037 16.4622 10.9037 16.2497V8.74973C10.9037 8.53723 10.8318 8.35907 10.688 8.21523C10.5443 8.07157 10.3662 7.99973 10.1535 7.99973C9.941 7.99973 9.76292 8.07157 9.61925 8.21523C9.47575 8.35907 9.404 8.53723 9.404 8.74973V16.2497C9.404 16.4622 9.47583 16.6404 9.6195 16.7842C9.76333 16.9279 9.94158 16.9997 10.1543 16.9997ZM13.8465 16.9997C14.059 16.9997 14.2371 16.9279 14.3807 16.7842C14.5243 16.6404 14.596 16.4622 14.596 16.2497V8.74973C14.596 8.53723 14.5242 8.35907 14.3805 8.21523C14.2367 8.07157 14.0584 7.99973 13.8458 7.99973C13.6333 7.99973 13.4552 8.07157 13.3115 8.21523C13.168 8.35907 13.0962 8.53723 13.0962 8.74973V16.2497C13.0962 16.4622 13.1682 16.6404 13.312 16.7842C13.4557 16.9279 13.6338 16.9997 13.8465 16.9997Z"
|
|
578
|
+
/>
|
|
579
|
+
</svg>
|
|
580
|
+
`,R1=`
|
|
581
|
+
<svg
|
|
582
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
583
|
+
width="24"
|
|
584
|
+
height="24"
|
|
585
|
+
viewBox="0 0 24 24"
|
|
586
|
+
>
|
|
587
|
+
<path
|
|
588
|
+
fill="currentColor"
|
|
589
|
+
d="M12 20q-3.35 0-5.675-2.325T4 12q0-3.35 2.325-5.675T12 4q1.725 0 3.3.713T18 6.75V4h2v7h-7V9h4.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12q0 2.5 1.75 4.25T12 18q1.925 0 3.475-1.1T17.65 14h2.1q-.7 2.65-2.85 4.325T12 20"
|
|
590
|
+
/>
|
|
591
|
+
</svg>
|
|
592
|
+
`,R4=`
|
|
593
|
+
<svg
|
|
594
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
595
|
+
fill="none"
|
|
596
|
+
viewBox="0 0 24 24"
|
|
597
|
+
stroke-width="1.5"
|
|
598
|
+
stroke="currentColor"
|
|
599
|
+
class="w-6 h-6"
|
|
600
|
+
>
|
|
601
|
+
<path
|
|
602
|
+
stroke-linecap="round"
|
|
603
|
+
stroke-linejoin="round"
|
|
604
|
+
d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
|
|
605
|
+
/>
|
|
606
|
+
</svg>
|
|
607
|
+
`,R5=`
|
|
608
|
+
<svg
|
|
609
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
610
|
+
width="24"
|
|
611
|
+
height="24"
|
|
612
|
+
viewBox="0 0 24 24"
|
|
613
|
+
>
|
|
614
|
+
<path
|
|
615
|
+
fill="currentColor"
|
|
616
|
+
d="M11 20V7.825l-5.6 5.6L4 12l8-8l8 8l-1.4 1.425l-5.6-5.6V20z"
|
|
617
|
+
/>
|
|
618
|
+
</svg>
|
|
619
|
+
`,R2=`
|
|
620
|
+
<svg
|
|
621
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
622
|
+
width="24"
|
|
623
|
+
height="24"
|
|
624
|
+
viewBox="0 0 24 24"
|
|
625
|
+
>
|
|
626
|
+
<path
|
|
627
|
+
fill="currentColor"
|
|
628
|
+
d="M3 20v-6l8-2l-8-2V4l19 8z"
|
|
629
|
+
/>
|
|
630
|
+
</svg>
|
|
631
|
+
`,R3=`
|
|
632
|
+
<svg
|
|
633
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
634
|
+
width="24"
|
|
635
|
+
height="24"
|
|
636
|
+
viewBox="0 0 24 24"
|
|
637
|
+
>
|
|
638
|
+
<path
|
|
639
|
+
fill="currentColor"
|
|
640
|
+
d="M5 13v-2h14v2z"
|
|
641
|
+
/>
|
|
642
|
+
</svg>
|
|
643
|
+
`,R7=`
|
|
644
|
+
<svg
|
|
645
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
646
|
+
width="24"
|
|
647
|
+
height="24"
|
|
648
|
+
viewBox="0 0 24 24"
|
|
649
|
+
>
|
|
650
|
+
<path
|
|
651
|
+
d="M3.25 13.7404C3.0375 13.7404 2.85938 13.6684 2.71563 13.5246C2.57188 13.3808 2.5 13.2026 2.5 12.99C2.5 12.7774 2.57188 12.5993 2.71563 12.4558C2.85938 12.3122 3.0375 12.2404 3.25 12.2404H20.75C20.9625 12.2404 21.1406 12.3123 21.2843 12.4561C21.4281 12.5999 21.5 12.7781 21.5 12.9907C21.5 13.2033 21.4281 13.3814 21.2843 13.525C21.1406 13.6686 20.9625 13.7404 20.75 13.7404H3.25ZM10.9423 10.2596V6.62495H6.5673C6.2735 6.62495 6.02377 6.52201 5.8181 6.31613C5.61245 6.11026 5.50963 5.86027 5.50963 5.56615C5.50963 5.27205 5.61245 5.02083 5.8181 4.8125C6.02377 4.60417 6.2735 4.5 6.5673 4.5H17.4423C17.7361 4.5 17.9858 4.60294 18.1915 4.80883C18.3971 5.01471 18.5 5.2647 18.5 5.5588C18.5 5.85292 18.3971 6.10413 18.1915 6.31245C17.9858 6.52078 17.7361 6.62495 17.4423 6.62495H13.0673V10.2596H10.9423ZM10.9423 15.7211H13.0673V18.4423C13.0673 18.7361 12.9643 18.9858 12.7584 19.1915C12.5526 19.3971 12.3026 19.5 12.0085 19.5C11.7144 19.5 11.4631 19.3962 11.2548 19.1887C11.0465 18.9811 10.9423 18.7291 10.9423 18.4327V15.7211Z"
|
|
652
|
+
/>
|
|
653
|
+
</svg>
|
|
654
|
+
`,R6=`
|
|
655
|
+
<svg
|
|
656
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
657
|
+
width="24"
|
|
658
|
+
height="24"
|
|
659
|
+
viewBox="0 0 24 24"
|
|
660
|
+
>
|
|
661
|
+
<g clip-path="url(#clip0_977_8078)">
|
|
662
|
+
<path
|
|
663
|
+
d="M20 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H20C21.1 21 22 20.1 22 19V5C22 3.9 21.1 3 20 3ZM20 5V8H5V5H20ZM15 19H10V10H15V19ZM5 10H8V19H5V10ZM17 19V10H20V19H17Z"
|
|
664
|
+
/>
|
|
665
|
+
</g>
|
|
666
|
+
<defs>
|
|
667
|
+
<clipPath id="clip0_977_8078">
|
|
668
|
+
<rect width="24" height="24" />
|
|
669
|
+
</clipPath>
|
|
670
|
+
</defs>
|
|
671
|
+
</svg>
|
|
672
|
+
`,R8=`
|
|
673
|
+
<svg
|
|
674
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
675
|
+
width="24"
|
|
676
|
+
height="24"
|
|
677
|
+
viewBox="0 0 24 24"
|
|
678
|
+
>
|
|
679
|
+
<g clip-path="url(#clip0_992_5547)">
|
|
680
|
+
<path
|
|
681
|
+
d="M5 5.5C5 6.33 5.67 7 6.5 7H10.5V17.5C10.5 18.33 11.17 19 12 19C12.83 19 13.5 18.33 13.5 17.5V7H17.5C18.33 7 19 6.33 19 5.5C19 4.67 18.33 4 17.5 4H6.5C5.67 4 5 4.67 5 5.5Z"
|
|
682
|
+
/>
|
|
683
|
+
</g>
|
|
684
|
+
<defs>
|
|
685
|
+
<clipPath id="clip0_992_5547">
|
|
686
|
+
<rect width="24" height="24" />
|
|
687
|
+
</clipPath>
|
|
688
|
+
</defs>
|
|
689
|
+
</svg>
|
|
690
|
+
`,R9=`
|
|
691
|
+
<svg
|
|
692
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
693
|
+
width="24"
|
|
694
|
+
height="24"
|
|
695
|
+
viewBox="0 0 24 24"
|
|
696
|
+
>
|
|
697
|
+
<path
|
|
698
|
+
d="M5.66936 16.3389L9.39244 12.6158C9.54115 12.4671 9.71679 12.3937 9.91936 12.3957C10.1219 12.3976 10.2975 12.4761 10.4463 12.6312C10.5847 12.7823 10.654 12.9585 10.654 13.1599C10.654 13.3613 10.5847 13.5363 10.4463 13.6851L6.32704 17.8197C6.14627 18.0004 5.93538 18.0908 5.69436 18.0908C5.45333 18.0908 5.24243 18.0004 5.06166 17.8197L3.01744 15.7754C2.87899 15.637 2.81136 15.4629 2.81456 15.2533C2.81776 15.0437 2.88859 14.8697 3.02706 14.7312C3.16551 14.5928 3.34008 14.5235 3.55076 14.5235C3.76144 14.5235 3.93494 14.5928 4.07126 14.7312L5.66936 16.3389ZM5.66936 8.72359L9.39244 5.00049C9.54115 4.85177 9.71679 4.77838 9.91936 4.78031C10.1219 4.78223 10.2975 4.86075 10.4463 5.01586C10.5847 5.16691 10.654 5.34314 10.654 5.54454C10.654 5.74592 10.5847 5.92097 10.4463 6.06969L6.32704 10.2043C6.14627 10.3851 5.93538 10.4755 5.69436 10.4755C5.45333 10.4755 5.24243 10.3851 5.06166 10.2043L3.01744 8.16009C2.87899 8.02162 2.81136 7.84759 2.81456 7.63799C2.81776 7.42837 2.88859 7.25433 3.02706 7.11586C3.16551 6.97741 3.34008 6.90819 3.55076 6.90819C3.76144 6.90819 3.93494 6.97741 4.07126 7.11586L5.66936 8.72359ZM13.7597 16.5581C13.5472 16.5581 13.3691 16.4862 13.2253 16.3424C13.0816 16.1986 13.0097 16.0204 13.0097 15.8078C13.0097 15.5952 13.0816 15.4171 13.2253 15.2735C13.3691 15.13 13.5472 15.0582 13.7597 15.0582H20.7597C20.9722 15.0582 21.1503 15.1301 21.2941 15.2739C21.4378 15.4177 21.5097 15.5959 21.5097 15.8085C21.5097 16.0211 21.4378 16.1992 21.2941 16.3427C21.1503 16.4863 20.9722 16.5581 20.7597 16.5581H13.7597ZM13.7597 8.94276C13.5472 8.94276 13.3691 8.87085 13.2253 8.72704C13.0816 8.58324 13.0097 8.40504 13.0097 8.19244C13.0097 7.97985 13.0816 7.80177 13.2253 7.65819C13.3691 7.5146 13.5472 7.44281 13.7597 7.44281H20.7597C20.9722 7.44281 21.1503 7.51471 21.2941 7.65851C21.4378 7.80233 21.5097 7.98053 21.5097 8.19311C21.5097 8.40571 21.4378 8.5838 21.2941 8.72739C21.1503 8.87097 20.9722 8.94276 20.7597 8.94276H13.7597Z"
|
|
699
|
+
/>
|
|
700
|
+
</svg>
|
|
701
|
+
`,ze=`
|
|
702
|
+
<svg
|
|
703
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
704
|
+
width="24"
|
|
705
|
+
height="24"
|
|
706
|
+
viewBox="0 0 24 24"
|
|
707
|
+
>
|
|
708
|
+
<path
|
|
709
|
+
fill="currentColor"
|
|
710
|
+
d="m12.9 16l-2.55-2.5l.05-.05q1.45-1.6 2.262-3.117T13.95 7H16V5h-6V3H8v2H2v2h9.1q-.5 1.2-1.225 2.387T8 11.7q-.6-.6-1.187-1.412T5.85 8.6H3.85q.5 1.4 1.3 2.7T6.95 13.7L2.85 17.75L4.25 19.15L8 15.4L10.55 17.95zM18.5 22h-2L21 10h2l4.5 12h-2l-1.05-3h-4.9zm1.6-5h3.6l-1.8-5.1z"
|
|
711
|
+
/>
|
|
712
|
+
</svg>
|
|
713
|
+
`,zt=`
|
|
714
|
+
<svg
|
|
715
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
716
|
+
width="32"
|
|
717
|
+
height="32"
|
|
718
|
+
viewBox="0 0 24 24"
|
|
719
|
+
>
|
|
720
|
+
<path
|
|
721
|
+
fill="currentColor"
|
|
722
|
+
d="M7 19v-.808L13.096 12L7 5.808V5h10v1.25H9.102L14.727 12l-5.625 5.77H17V19z"
|
|
723
|
+
/>
|
|
724
|
+
</svg>
|
|
725
|
+
`,zn=`
|
|
726
|
+
<svg
|
|
727
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
728
|
+
height="24px"
|
|
729
|
+
viewBox="0 -960 960 960"
|
|
730
|
+
width="24px"
|
|
731
|
+
>
|
|
732
|
+
<path
|
|
733
|
+
d="m644-428-58-58q9-47-27-88t-93-32l-58-58q17-8 34.5-12t37.5-4q75 0 127.5 52.5T660-500q0 20-4 37.5T644-428Zm128 126-58-56q38-29 67.5-63.5T832-500q-50-101-143.5-160.5T480-720q-29 0-57 4t-55 12l-62-62q41-17 84-25.5t90-8.5q151 0 269 83.5T920-500q-23 59-60.5 109.5T772-302Zm20 246L624-222q-35 11-70.5 16.5T480-200q-151 0-269-83.5T40-500q21-53 53-98.5t73-81.5L56-792l56-56 736 736-56 56ZM222-624q-29 26-53 57t-41 67q50 101 143.5 160.5T480-280q20 0 39-2.5t39-5.5l-36-38q-11 3-21 4.5t-21 1.5q-75 0-127.5-52.5T300-500q0-11 1.5-21t4.5-21l-84-82Zm319 93Zm-151 75Z"
|
|
734
|
+
/>
|
|
735
|
+
</svg>
|
|
736
|
+
`,zr={[Rm.CodeMirror]:{theme:re,languages:nY,expandIcon:RT,searchIcon:R4,clearSearchIcon:RN,searchPlaceholder:"Search language",noResultText:"No result",previewToggleIcon:e=>e?RP:zn}},zi=rp([],"FeaturesCtx"),zo=rp({},"CrepeCtx");function zl(e){return e.use("FeaturesCtx")}function zs(e){return t=>{zl(t).update(t=>t.includes(e)?t:[...t,e])}}let za=dC({provider:void 0,buildContext:void 0,diffReviewOnEnd:!0,onError:e=>{console.error(`[milkdown/ai] [${e.code}]`,e)},aiIcon:void 0},"aiProviderConfig"),zc=dC({abortController:null,label:"",lastInstruction:"",lastLabel:void 0,lastFrom:-1,lastTo:-1,diffOwnedByAI:!1},"aiSession");function zu(e,t){let n=e.get(za.key);try{n.onError(t)}catch(e){console.error("[milkdown/ai] onError handler failed:",e)}}function zh(e){let t=e.get(zc.key);e.set(zc.key,{...t,abortController:null,label:""})}async function zd(e,t,n,r){try{let i=t(n,r.signal),o=e.get(hH);for await(let e of i){if(r.signal.aborted)break;o.call(pA.key,e)}if(r.signal.aborted)return;let l=e.get(za.key);if(l.diffReviewOnEnd){let t=e.get(zc.key);e.set(zc.key,{...t,diffOwnedByAI:!0})}let s=o.call(pT.key,{diffReview:l.diffReviewOnEnd});if(l.diffReviewOnEnd&&!s){let t=e.get(zc.key);e.set(zc.key,{...t,diffOwnedByAI:!1})}}catch(n){let t;if(r.signal.aborted)return;zu(e,(t=n instanceof Error?n.message:rc(n),new rn(rt.aiProviderError,`AI provider error: ${t}`,{cause:n}))),e.get(hH).call(pO.key,{keep:!1})}finally{e.get(zc.key).abortController===r&&zh(e)}}let zp=dv("RunAI",e=>t=>(n,r)=>{var i,o,l,s;let a;if(!(null==t?void 0:t.instruction))return!1;let c=e.get(za.key);if(!c.provider||e.get(zc.key).abortController||(null==(i=pC.getState(n))?void 0:i.active)||(null==(o=dG.getState(n))?void 0:o.active))return!1;if(!r)return!0;let u=new AbortController,{from:h,to:d}=n.selection;e.set(zc.key,{abortController:u,label:null!=(l=t.label)?l:"",lastInstruction:t.instruction,lastLabel:t.label,lastFrom:h,lastTo:d,diffOwnedByAI:!1});let p=e.get(hH),f=n.selection.empty?"cursor":"selection";if(!p.call(pM.key,{insertAt:f}))return zh(e),!1;try{a=(null!=(s=c.buildContext)?s:function(e,t){var n;let r=e.get(hb),i=e.get(h5),{state:o}=r,l=i(o.doc),s="";if(!o.selection.empty){let{from:e,to:t}=o.selection,r=o.doc.slice(e,t),{schema:l}=o.doc.type,a=l.topNodeType.createAndFill(null,r.content);if(!a){let e=null==(n=l.nodes.paragraph)?void 0:n.createAndFill(null,r.content);e&&(a=l.topNodeType.createAndFill(null,e))}s=a?i(a):o.doc.textBetween(e,t)}return{document:l,selection:s,instruction:t}})(e,t.instruction)}catch(n){let t;return zu(e,(t=n instanceof Error?n.message:rc(n),new rn(rt.aiBuildContextError,`AI buildContext failed: ${t}`,{cause:n}))),p.call(pO.key,{keep:!1}),zh(e),!1}return zd(e,c.provider,a,u),!0}),zf=dv("AbortAI",e=>t=>(n,r)=>{var i;let o=e.get(zc.key);return r?!!o.abortController&&(o.abortController.abort(),zh(e),(null==(i=pC.getState(n))?void 0:i.active)&&e.get(hH).call(pO.key,t),!0):!!o.abortController});var zm=e=>{throw TypeError(e)},zg=(e,t,n)=>t.has(e)||zm("Cannot "+n),zv=(e,t,n)=>(zg(e,t,"read from private field"),n?n.call(e):t.get(e)),zy=(e,t,n)=>t.has(e)?zm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zb=(e,t,n,r)=>(zg(e,t,"write to private field"),t.set(e,n),n),zw=(e,t,n)=>(zg(e,t,"access private method"),n);let zx="milkdown-ai-diff-actions";function zk(e,t){e.innerHTML=fM.sanitize(t.trim())}class zC{constructor(e,t,n){this.ctx=e,zy(this,ex),zy(this,ep),zy(this,ef),zy(this,em),zy(this,eg),zy(this,ev,!1),zy(this,ey,!1),zy(this,eb,null),zy(this,ew,!1),zy(this,eM,()=>{let e=this.ctx.get(zc.key);if(!e.lastInstruction||!zv(this,ew)||!zw(this,ex,eA).call(this))return;let t=this.ctx.get(hH);t.call(d5.key);let n=this.ctx.get(hb),{doc:r}=n.state,i=Math.min(Math.max(e.lastFrom,0),r.content.size),o=Math.min(Math.max(e.lastTo,0),r.content.size);n.dispatch(n.state.tr.setSelection(sw.create(n.state.doc,i,o))),t.call(zp.key,{instruction:e.lastInstruction,label:e.lastLabel})}),zy(this,eT,()=>{this.ctx.get(hH).call(d5.key)}),zy(this,eO,()=>{this.ctx.get(hH).call(d4.key)}),zb(this,eg,n),zb(this,ef,zw(this,ex,ek).call(this,t));const r=document.createElement("div");r.className=zx,r.dataset.show="false",zb(this,em,zw(this,ex,eC).call(this,"retry",n.retryIcon,n.retryLabel,zv(this,eM))),r.appendChild(zv(this,em)),r.appendChild(zw(this,ex,eC).call(this,"reject",n.rejectIcon,n.rejectAllLabel,zv(this,eT)));const i=zw(this,ex,eC).call(this,"accept",n.acceptIcon,n.acceptAllLabel,zv(this,eO));i.appendChild(zw(this,ex,eS).call(this)),r.appendChild(i),zb(this,ep,r),zv(this,ef).appendChild(r),this.update(t)}update(e){var t;let n=!!(null==(t=dG.getState(e.state))?void 0:t.active);if(n!==zv(this,ey))if(zb(this,ey,n),n){let t=this.ctx.get(zc.key);zb(this,ew,t.diffOwnedByAI),zb(this,eb,e.state.doc)}else{zb(this,ew,!1),zb(this,eb,null);let e=this.ctx.get(zc.key);e.diffOwnedByAI&&this.ctx.set(zc.key,{...e,diffOwnedByAI:!1})}let r=n&&zv(this,ew);if(r!==zv(this,ev)&&(zb(this,ev,r),zv(this,ep).dataset.show=r?"true":"false"),r){let t=this.ctx.get(zc.key),n=!!zv(this,eb)&&e.state.doc.eq(zv(this,eb));zv(this,em).disabled=!t.lastInstruction||!n}}destroy(){zv(this,ep).remove()}}ep=new WeakMap,ef=new WeakMap,em=new WeakMap,eg=new WeakMap,ev=new WeakMap,ey=new WeakMap,eb=new WeakMap,ew=new WeakMap,ex=new WeakSet,ek=function(e){var t;return null!=(t=e.dom.closest(".milkdown"))?t:document.body},eC=function(e,t,n,r){let i,o=document.createElement("button");o.type="button",o.className=`${zx}-btn ${zx}-btn-${e}`,o.appendChild(((i=document.createElement("span")).className=`${zx}-icon`,zk(i,t),i));let l=document.createElement("span");return l.textContent=n,o.appendChild(l),o.addEventListener("mousedown",e=>e.preventDefault()),o.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),r()}),o},eS=function(){let e=document.createElement("span");e.className=`${zx}-shortcut`;let t=document.createElement("span");t.textContent=zv(this,eg).modSymbol;let n=document.createElement("span");return n.className=`${zx}-shortcut-icon`,zk(n,zv(this,eg).enterKeyIcon),e.append(t,n),e},eM=new WeakMap,eA=function(){return!!zv(this,eb)&&this.ctx.get(hb).state.doc.eq(zv(this,eb))},eT=new WeakMap,eO=new WeakMap;let zS=new sP("CREPE_AI_DIFF_ACTIONS_PANEL"),zM=function(){var e,t,n,r;if("u"<typeof navigator)return"⌘";let i=navigator,o=null!=(r=null!=(n=null!=(t=null==(e=i.userAgentData)?void 0:e.platform)?t:i.platform)?n:i.userAgent)?r:"";return/mac|iphone|ipad|ipod/i.test(o)?"⌘":"Ctrl"}();var zA=e=>{throw TypeError(e)},zT=(e,t,n)=>t.has(e)||zA("Cannot "+n),zO=(e,t,n)=>(zT(e,t,"read from private field"),n?n.call(e):t.get(e)),zE=(e,t,n)=>t.has(e)?zA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zN=(e,t,n,r)=>(zT(e,t,"write to private field"),t.set(e,n),n);function zD(e){let t={addItem:(n,r)=>(e.items.set(n,r),t),removeItem:n=>(e.items.delete(n),t),getItem:t=>e.items.get(t),clear:()=>(e.items.clear(),t)};return t}class zI{constructor(){zE(this,eE,[]),this.addItem=(e,t)=>(zO(this,eN).call(this,e),zO(this,eE).push({kind:"item",id:e,item:t}),this),this.addSubmenu=(e,t,n)=>{zO(this,eN).call(this,e);let r={def:t,items:new Map};return n&&n(zD(r)),zO(this,eE).push({kind:"submenu",id:e,node:r}),this},this.removeItem=e=>(zO(this,eN).call(this,e),this),this.getItem=e=>{let t=zO(this,eE).find(t=>"item"===t.kind&&t.id===e);return(null==t?void 0:t.kind)==="item"?t.item:void 0},this.getSubmenu=e=>{let t=zO(this,eE).find(t=>"submenu"===t.kind&&t.id===e);return(null==t?void 0:t.kind)==="submenu"?zD(t.node):void 0},this.clear=()=>(zN(this,eE,[]),this),this.build=()=>{let e=[],t={};for(let n of zO(this,eE))"item"===n.kind?e.push({kind:"item",id:n.id,item:n.item}):(e.push({kind:"submenu",id:n.id,def:n.node.def}),t[n.id]={def:n.node.def,items:Array.from(n.node.items.entries()).map(([e,t])=>({id:e,item:t}))});return{main:e,submenus:t}},zE(this,eN,e=>{zN(this,eE,zO(this,eE).filter(t=>t.id!==e))})}}function zL(){}eE=new WeakMap,eN=new WeakMap,zL(bB);let z_=yr({props:{placeholder:{type:Object,required:!0},resetSignal:{type:Object,required:!0},suggestions:{type:Object,required:!0},chrome:{type:Object,required:!0},onConfirm:{type:Function,required:!0},onCancel:{type:Function,required:!0}},setup({placeholder:e,resetSignal:t,suggestions:n,chrome:r,onConfirm:i,onCancel:o}){let l=vm(""),s=vm({kind:"main"}),a=vm(0),c=vm(null),u=vm(null),h=`ai-instruction-list-${Math.random().toString(36).slice(2,9)}`,d=e=>`${h}-opt-${e}`;v5(t,()=>{l.value="",s.value={kind:"main"},a.value=0},void 0);let p=bP(()=>{if("submenu"===s.value.kind){let e=n.submenus[s.value.id];return e?e.items.map(({id:e,item:t})=>({id:e,icon:t.icon,label:t.label,hasSubmenu:!1,prompt:{text:t.prompt,streamingLabel:t.streamingLabel}})):[]}return n.main.map(e=>"item"===e.kind?{id:e.id,icon:e.item.icon,label:e.item.label,hasSubmenu:!1,prompt:{text:e.item.prompt,streamingLabel:e.item.streamingLabel}}:{id:e.id,icon:e.def.icon,label:e.def.label,hasSubmenu:!0})}),f=bP(()=>{var e,t;return"submenu"!==s.value.kind?null:null!=(t=null==(e=n.submenus[s.value.id])?void 0:e.def)?t:null}),m=bP(()=>{let e=l.value.trim().toLowerCase();return e?p.value.filter(t=>t.label.toLowerCase().includes(e)):p.value}),g=bP(()=>l.value.trim().length>0),y=bP(()=>m.value.length+ +!!g.value);v5([m,s,g],()=>{a.value=g.value?m.value.length:0},void 0);let b=()=>{vP(()=>{var e;return null==(e=c.value)?void 0:e.focus()})},w=()=>{s.value={kind:"main"},l.value="",a.value=0,b()},x=e=>{e.hasSubmenu?(s.value={kind:"submenu",id:e.id},l.value="",a.value=0,b()):e.prompt&&(i(e.prompt.text,e.prompt.streamingLabel),l.value="")},k=()=>{let e=l.value.trim();e&&(i(e),l.value="")},C=()=>{vP(()=>{let e=u.value;if(!e)return;let t=e.querySelector(`[data-index="${a.value}"]`);null==t||t.scrollIntoView({block:"nearest"})})},S=e=>{if(e.stopPropagation(),"ArrowDown"===e.key){if(e.preventDefault(),0===y.value)return;a.value=(a.value+1)%y.value,C();return}if("ArrowUp"===e.key){if(e.preventDefault(),0===y.value)return;a.value=(a.value-1+y.value)%y.value,C();return}if("Enter"===e.key){let t,n;e.preventDefault(),t=a.value,t<(n=m.value).length?x(n[t]):g.value&&k();return}if("Escape"===e.key){e.preventDefault(),"submenu"===s.value.kind?w():o();return}"Backspace"===e.key&&""===l.value&&"submenu"===s.value.kind&&(e.preventDefault(),w())},M=e=>{e.preventDefault()};return()=>{let t=m.value,n=g.value,i=f.value;return bB("div",{class:"ai-instruction"},bB("div",{class:"ai-instruction-input"},bB("span",{class:"ai-instruction-input-prefix"},bB(we,{icon:r.aiIcon})),bB("input",{ref:c,class:"ai-instruction-input-field",role:"combobox","aria-expanded":"true","aria-autocomplete":"list","aria-controls":h,"aria-activedescendant":y.value>0?d(a.value):void 0,placeholder:i?i.searchPlaceholder:e.value,value:l.value,onInput:e=>{l.value=e.target.value},onKeydown:S}),bB("button",{type:"button",class:"ai-instruction-submit","aria-label":r.submitButtonLabel,disabled:!n,onMousedown:M,onClick:k},bB(we,{icon:r.sendIcon}))),bB("div",{class:"ai-instruction-list",ref:u,id:h,role:"listbox","aria-label":r.listboxLabel},i&&bB("button",{type:"button",class:"ai-instruction-back",onMousedown:M,onClick:w},bB("span",{class:"ai-instruction-back-icon","aria-hidden":"true"},bB(we,{icon:r.chevronLeftIcon})),bB("span",null,i.title)),t.length>0&&bB("div",{class:"ai-instruction-section"},bB("div",{class:"ai-instruction-section-header"},r.suggestionsHeaderLabel),t.map((e,t)=>bB("div",{key:e.id,id:d(t),"data-index":t,role:"option","aria-selected":t===a.value,class:["ai-instruction-item",t===a.value?"active":""],onMousedown:M,onClick:()=>x(e),onPointerenter:()=>{a.value=t}},bB("span",{class:"ai-instruction-item-icon"},bB(we,{icon:e.icon})),bB("span",{class:"ai-instruction-item-label"},function(e,t){let n=t.trim();if(!n)return[e];let r=e.toLowerCase(),i=n.toLowerCase(),o=r.indexOf(i);return -1===o?[e]:[e.slice(0,o),bB("mark",null,e.slice(o,o+n.length)),e.slice(o+n.length)]}(e.label,l.value)),e.hasSubmenu&&bB("span",{class:"ai-instruction-item-arrow"},bB(we,{icon:r.chevronRightIcon}))))),n&&bB("div",{class:"ai-instruction-section"},bB("div",{class:"ai-instruction-section-header"},r.sendAsPromptHeaderLabel),bB("div",{id:d(t.length),"data-index":t.length,role:"option","aria-selected":a.value===t.length,class:["ai-instruction-item","ai-instruction-item-prompt",a.value===t.length?"active":""],onMousedown:M,onClick:k,onPointerenter:()=>{a.value=t.length}},bB("span",{class:"ai-instruction-item-icon"},bB(we,{icon:r.sendPromptIcon})),bB("span",{class:"ai-instruction-item-label"},r.sendAsPromptLabel," ",bB("span",{class:"ai-instruction-item-quote"},'"',l.value,'"')),bB("span",{class:"ai-instruction-item-shortcut"},bB(we,{icon:r.enterKeyIcon}))))))}}});var zR=e=>{throw TypeError(e)},zz=(e,t,n)=>t.has(e)||zR("Cannot "+n),zP=(e,t,n)=>(zz(e,t,"read from private field"),n?n.call(e):t.get(e)),zB=(e,t,n)=>t.has(e)?zR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zF=(e,t,n,r)=>(zz(e,t,"write to private field"),t.set(e,n),n);class zH{constructor(e,t,n){this.ctx=e,zB(this,eD),zB(this,eI),zB(this,eL),zB(this,e_),zB(this,eR),zB(this,ez,-1),zB(this,eP,-1),zB(this,eB,!1),zB(this,eF,(e,t)=>{!e.trim()||this.ctx.get(hH).call(zp.key,{instruction:e,label:t})&&(zF(this,eB,!1),zP(this,eI).hide())}),zB(this,eH,()=>{zF(this,eB,!1),zP(this,eI).hide()}),this.show=(e,t)=>{zF(this,ez,e),zF(this,eP,t),zP(this,eR).value++,zF(this,eB,!0);let n=this.ctx.get(hb);zP(this,eI).show({getBoundingClientRect:()=>aI(n,e,t)},n),requestAnimationFrame(()=>{var e;null==(e=zP(this,eD).querySelector("input"))||e.focus()})},this.update=(e,t)=>{let{selection:n}=e.state,r=n instanceof sw,i=n.from!==zP(this,ez)||n.to!==zP(this,eP);if(!r||i){zF(this,eB,!1),zP(this,eI).hide();return}zP(this,eI).update(e,t)},this.destroy=()=>{zP(this,eL).unmount(),zP(this,eI).destroy(),zP(this,eD).remove()},zF(this,e_,vm(n.placeholder)),zF(this,eR,vm(0));const r=document.createElement("div");r.className="milkdown-ai-instruction";const i=b8(z_,{placeholder:zP(this,e_),resetSignal:zP(this,eR),suggestions:n.suggestions,chrome:n.chrome,onConfirm:zP(this,eF),onCancel:zP(this,eH)});i.mount(r),zF(this,eL,i),zF(this,eD,r),zF(this,eI,new mH({content:r,debounce:0,offset:10,shouldShow:()=>zP(this,eB),floatingUIOptions:{placement:"bottom"}})),zP(this,eI).onHide=()=>{zF(this,eB,!1),requestAnimationFrame(()=>{try{let e=zP(this,eD).getRootNode().activeElement;if(!e||!zP(this,eD).contains(e))return;this.ctx.get(hb).dom.focus({preventScroll:!0})}catch(e){}})},zP(this,eI).update(t)}}eD=new WeakMap,eI=new WeakMap,eL=new WeakMap,e_=new WeakMap,eR=new WeakMap,ez=new WeakMap,eP=new WeakMap,eB=new WeakMap,eF=new WeakMap,eH=new WeakMap;let zq=dC({show:()=>{}},"aiInstructionTooltipAPI"),zj=mq("CREPE_AI_INSTRUCTION");var zV=e=>{throw TypeError(e)},z$=(e,t,n)=>t.has(e)||zV("Cannot "+n),zW=(e,t,n)=>(z$(e,t,"read from private field"),n?n.call(e):t.get(e)),zU=(e,t,n)=>t.has(e)?zV("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),zG=(e,t,n,r)=>(z$(e,t,"write to private field"),t.set(e,n),n);let zK="milkdown-ai-streaming",zJ=new sP("CREPE_AI_STREAMING_INDICATOR");class zZ{constructor(e,t,n){zU(this,eq),zU(this,ej),zU(this,eV),zU(this,e$,performance.now()),zU(this,eW,""),zU(this,eU,0),zU(this,eG,()=>{let e=performance.now()-zW(this,e$);zW(this,eq).style.transform=`rotate(${e/800*360}deg)`,zG(this,eU,requestAnimationFrame(zW(this,eG)))}),zG(this,eV,t);const r=document.createElement("span");r.className=`${zK}-indicator`,r.contentEditable="false",r.setAttribute("role","status"),r.setAttribute("aria-live","polite");const i=document.createElement("span");i.className=`${zK}-spinner`,i.setAttribute("aria-hidden","true"),r.appendChild(i);const o=document.createElement("span");o.className=`${zK}-label`,r.appendChild(o);const l=document.createElement("span");l.className=`${zK}-esc`,l.textContent=n,r.appendChild(l),this.dom=r,zG(this,eq,i),zG(this,ej,o),this.setLabel(e),zW(this,eG).call(this)}setLabel(e){let t=e.get(zc.key),n=`${t.label||zW(this,eV)}\u2026`;n!==zW(this,eW)&&(zG(this,eW,n),zW(this,ej).textContent=n)}destroy(){zW(this,eU)&&cancelAnimationFrame(zW(this,eU)),zG(this,eU,0)}}eq=new WeakMap,ej=new WeakMap,eV=new WeakMap,e$=new WeakMap,eW=new WeakMap,eU=new WeakMap,eG=new WeakMap;let zY=["table","image-block","code_block"],zX={heading:["id"]};function zQ(e){return"code_block"===e.$from.parent.type.name}function z0(e){var t;let n=null==(t=e.$from.node(e.$from.depth-1))?void 0:t.type;return(null==n?void 0:n.name)==="list_item"}var z1=e=>{throw TypeError(e)},z4=(e,t,n)=>t.has(e)||z1("Cannot "+n),z5=(e,t,n)=>(z4(e,t,"read from private field"),n?n.call(e):t.get(e)),z2=(e,t,n)=>t.has(e)?z1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);class z3{constructor(){z2(this,eK,[]),this.clear=()=>{let e,t;return t=[],z4(this,e=eK,"write to private field"),e.set(this,t),this},z2(this,eJ,e=>{let t={group:e,addItem:(n,r)=>{let i={...r,key:n};return e.items.push(i),t},clear:()=>(e.items=[],t)};return t}),this.addGroup=(e,t)=>{let n={key:e,label:t,items:[]};return z5(this,eK).push(n),z5(this,eJ).call(this,n)},this.getGroup=e=>{let t=z5(this,eK).find(t=>t.key===e);if(!t)throw Error(`Group with key ${e} not found`);return z5(this,eJ).call(this,t)},this.build=()=>z5(this,eK)}}eK=new WeakMap,eJ=new WeakMap,zL(bB);let z7=yr({props:{ctx:{type:Object,required:!0},show:{type:Object,required:!0},filter:{type:Object,required:!0},hide:{type:Function,required:!0},config:{type:Object,required:!1}},setup({ctx:e,show:t,filter:n,hide:r,config:i}){let o=vm(),l=bP(()=>(function(e,t,n){var r,i,o,l,s,a,c,u,h,d,p,f,m,g,y,b,w,x,k,C,S,M,A,T,O,E,N,D,I,L,_,R,z,P,B,F,H,q,j,V,$,W,U,G,K,J,Z,Y,X,Q,ee,et,en,er,ei,eo,el,es,ea,ec,eu,eh,ed,ep,ef,em,eg,ev,ey,eb,ew,ex,ek,eC,eS,eM,eA,eT,eO,eE,eN,eD,eI,eL,e_,eR,ez,eP,eB,eF,eH,eq,ej,eV,e$,eW,eU,eG,eK,eJ,eZ,eY,eX,eQ,e0,e1,e4,e5,e2,e3,e7,e6,e8,e9,te,tt,tn,tr,ti;let to=n&&zl(n).get(),tl=null==to?void 0:to.includes(Rm.Latex),ts=null==to?void 0:to.includes(Rm.ImageBlock),ta=null==to?void 0:to.includes(Rm.Table),tc=new z3;if((null==t?void 0:t.textGroup)!==null){let e=tc.addGroup("text",null!=(i=null==(r=null==t?void 0:t.textGroup)?void 0:r.label)?i:"Text");(null==(o=null==t?void 0:t.textGroup)?void 0:o.text)!==null&&e.addItem("text",{label:null!=(a=null==(s=null==(l=null==t?void 0:t.textGroup)?void 0:l.text)?void 0:s.label)?a:"Text",icon:null!=(h=null==(u=null==(c=null==t?void 0:t.textGroup)?void 0:c.text)?void 0:u.icon)?h:R8,onRun:e=>{let t=e.get(hH),n=wF.type(e);t.call(xL.key),t.call(x_.key,{nodeType:n})}}),(null==(d=null==t?void 0:t.textGroup)?void 0:d.h1)!==null&&e.addItem("h1",{label:null!=(m=null==(f=null==(p=null==t?void 0:t.textGroup)?void 0:p.h1)?void 0:f.label)?m:"Heading 1",icon:null!=(b=null==(y=null==(g=null==t?void 0:t.textGroup)?void 0:g.h1)?void 0:y.icon)?b:RH,onRun:e=>{let t=e.get(hH),n=wW.type(e);t.call(xL.key),t.call(x_.key,{nodeType:n,attrs:{level:1}})}}),(null==(w=null==t?void 0:t.textGroup)?void 0:w.h2)!==null&&e.addItem("h2",{label:null!=(C=null==(k=null==(x=null==t?void 0:t.textGroup)?void 0:x.h2)?void 0:k.label)?C:"Heading 2",icon:null!=(A=null==(M=null==(S=null==t?void 0:t.textGroup)?void 0:S.h2)?void 0:M.icon)?A:Rq,onRun:e=>{let t=e.get(hH),n=wW.type(e);t.call(xL.key),t.call(x_.key,{nodeType:n,attrs:{level:2}})}}),(null==(T=null==t?void 0:t.textGroup)?void 0:T.h3)!==null&&e.addItem("h3",{label:null!=(N=null==(E=null==(O=null==t?void 0:t.textGroup)?void 0:O.h3)?void 0:E.label)?N:"Heading 3",icon:null!=(L=null==(I=null==(D=null==t?void 0:t.textGroup)?void 0:D.h3)?void 0:I.icon)?L:Rj,onRun:e=>{let t=e.get(hH),n=wW.type(e);t.call(xL.key),t.call(x_.key,{nodeType:n,attrs:{level:3}})}}),(null==(_=null==t?void 0:t.textGroup)?void 0:_.h4)!==null&&e.addItem("h4",{label:null!=(P=null==(z=null==(R=null==t?void 0:t.textGroup)?void 0:R.h4)?void 0:z.label)?P:"Heading 4",icon:null!=(H=null==(F=null==(B=null==t?void 0:t.textGroup)?void 0:B.h4)?void 0:F.icon)?H:RV,onRun:e=>{let t=e.get(hH),n=wW.type(e);t.call(xL.key),t.call(x_.key,{nodeType:n,attrs:{level:4}})}}),(null==(q=null==t?void 0:t.textGroup)?void 0:q.h5)!==null&&e.addItem("h5",{label:null!=($=null==(V=null==(j=null==t?void 0:t.textGroup)?void 0:j.h5)?void 0:V.label)?$:"Heading 5",icon:null!=(G=null==(U=null==(W=null==t?void 0:t.textGroup)?void 0:W.h5)?void 0:U.icon)?G:R$,onRun:e=>{let t=e.get(hH),n=wW.type(e);t.call(xL.key),t.call(x_.key,{nodeType:n,attrs:{level:5}})}}),(null==(K=null==t?void 0:t.textGroup)?void 0:K.h6)!==null&&e.addItem("h6",{label:null!=(Y=null==(Z=null==(J=null==t?void 0:t.textGroup)?void 0:J.h6)?void 0:Z.label)?Y:"Heading 6",icon:null!=(ee=null==(Q=null==(X=null==t?void 0:t.textGroup)?void 0:X.h6)?void 0:Q.icon)?ee:RW,onRun:e=>{let t=e.get(hH),n=wW.type(e);t.call(xL.key),t.call(x_.key,{nodeType:n,attrs:{level:6}})}}),(null==(et=null==t?void 0:t.textGroup)?void 0:et.quote)!==null&&e.addItem("quote",{label:null!=(ei=null==(er=null==(en=null==t?void 0:t.textGroup)?void 0:en.quote)?void 0:er.label)?ei:"Quote",icon:null!=(es=null==(el=null==(eo=null==t?void 0:t.textGroup)?void 0:eo.quote)?void 0:el.icon)?es:RQ,onRun:e=>{let t=e.get(hH),n=wY.type(e);t.call(xL.key),t.call(xR.key,{nodeType:n})}}),(null==(ea=null==t?void 0:t.textGroup)?void 0:ea.divider)!==null&&e.addItem("divider",{label:null!=(eh=null==(eu=null==(ec=null==t?void 0:t.textGroup)?void 0:ec.divider)?void 0:eu.label)?eh:"Divider",icon:null!=(ef=null==(ep=null==(ed=null==t?void 0:t.textGroup)?void 0:ed.divider)?void 0:ep.icon)?ef:RR,onRun:e=>{let t=e.get(hH),n=xo.type(e);t.call(xL.key),t.call(xz.key,{nodeType:n})}})}if((null==t?void 0:t.listGroup)!==null){let e=tc.addGroup("list",null!=(eg=null==(em=null==t?void 0:t.listGroup)?void 0:em.label)?eg:"List");(null==(ev=null==t?void 0:t.listGroup)?void 0:ev.bulletList)!==null&&e.addItem("bullet-list",{label:null!=(ew=null==(eb=null==(ey=null==t?void 0:t.listGroup)?void 0:ey.bulletList)?void 0:eb.label)?ew:"Bullet List",icon:null!=(eC=null==(ek=null==(ex=null==t?void 0:t.listGroup)?void 0:ex.bulletList)?void 0:ek.icon)?eC:RC,onRun:e=>{let t=e.get(hH),n=xc.type(e);t.call(xL.key),t.call(xR.key,{nodeType:n})}}),(null==(eS=null==t?void 0:t.listGroup)?void 0:eS.orderedList)!==null&&e.addItem("ordered-list",{label:null!=(eT=null==(eA=null==(eM=null==t?void 0:t.listGroup)?void 0:eM.orderedList)?void 0:eA.label)?eT:"Ordered List",icon:null!=(eN=null==(eE=null==(eO=null==t?void 0:t.listGroup)?void 0:eO.orderedList)?void 0:eE.icon)?eN:RY,onRun:e=>{let t=e.get(hH),n=xf.type(e);t.call(xL.key),t.call(xR.key,{nodeType:n})}}),(null==(eD=null==t?void 0:t.listGroup)?void 0:eD.taskList)!==null&&e.addItem("task-list",{label:null!=(e_=null==(eL=null==(eI=null==t?void 0:t.listGroup)?void 0:eI.taskList)?void 0:eL.label)?e_:"Task List",icon:null!=(eP=null==(ez=null==(eR=null==t?void 0:t.listGroup)?void 0:eR.taskList)?void 0:ez.icon)?eP:R9,onRun:e=>{let t=e.get(hH),n=xb.type(e);t.call(xL.key),t.call(xR.key,{nodeType:n,attrs:{checked:!1}})}})}if((null==t?void 0:t.advancedGroup)!==null){let e=tc.addGroup("advanced",null!=(eF=null==(eB=null==t?void 0:t.advancedGroup)?void 0:eB.label)?eF:"Advanced");(null==(eH=null==t?void 0:t.advancedGroup)?void 0:eH.image)!==null&&ts&&e.addItem("image",{label:null!=(eV=null==(ej=null==(eq=null==t?void 0:t.advancedGroup)?void 0:eq.image)?void 0:ej.label)?eV:"Image",icon:null!=(eU=null==(eW=null==(e$=null==t?void 0:t.advancedGroup)?void 0:e$.image)?void 0:eW.icon)?eU:RU,onRun:e=>{let t=e.get(hH),n=ks.type(e);t.call(xL.key),t.call(xz.key,{nodeType:n})}}),(null==(eG=null==t?void 0:t.advancedGroup)?void 0:eG.codeBlock)!==null&&e.addItem("code",{label:null!=(eZ=null==(eJ=null==(eK=null==t?void 0:t.advancedGroup)?void 0:eK.codeBlock)?void 0:eJ.label)?eZ:"Code",icon:null!=(eQ=null==(eX=null==(eY=null==t?void 0:t.advancedGroup)?void 0:eY.codeBlock)?void 0:eX.icon)?eQ:RD,onRun:e=>{let t=e.get(hH),n=w4.type(e);t.call(xL.key),t.call(x_.key,{nodeType:n})}}),(null==(e0=null==t?void 0:t.advancedGroup)?void 0:e0.table)!==null&&ta&&e.addItem("table",{label:null!=(e5=null==(e4=null==(e1=null==t?void 0:t.advancedGroup)?void 0:e1.table)?void 0:e4.label)?e5:"Table",icon:null!=(e7=null==(e3=null==(e2=null==t?void 0:t.advancedGroup)?void 0:e2.table)?void 0:e3.icon)?e7:R6,onRun:e=>{let t=e.get(hH),n=e.get(hb);t.call(xL.key);let{from:r}=n.state.selection;t.call(xz.key,{nodeType:SV(e,3,3)}),t.call(xP.key,{pos:r})}}),(null==(e6=null==t?void 0:t.advancedGroup)?void 0:e6.math)!==null&&tl&&e.addItem("math",{label:null!=(te=null==(e9=null==(e8=null==t?void 0:t.advancedGroup)?void 0:e8.math)?void 0:e9.label)?te:"Math",icon:null!=(tr=null==(tn=null==(tt=null==t?void 0:t.advancedGroup)?void 0:tt.math)?void 0:tn.icon)?tr:zt,onRun:e=>{let t=e.get(hH),n=w4.type(e);t.call(xL.key),t.call(xz.key,{nodeType:n,attrs:{language:"LaTeX"}})}})}null==(ti=null==t?void 0:t.buildMenu)||ti.call(t,tc);let tu=tc.build();e&&(tu=tu.map(t=>{let n=t.items.filter(t=>t.label.toLowerCase().includes(e.toLowerCase()));return{...t,items:n}}).filter(e=>e.items.length>0));let th=tu.flatMap(e=>e.items);return th.forEach((e,t)=>{Object.assign(e,{index:t})}),tu.reduce((e,t)=>{let n=e+t.items.length;return Object.assign(t,{range:[e,n]}),n},0),{groups:tu,size:th.length}})(n.value,i,e)),s=vm(0),a=vm({x:-999,y:-999}),c=e=>{let{x:t,y:n}=e;a.value={x:t,y:n}};v5([l,t],()=>{let{size:e}=l.value;0===e&&t.value?r():s.value>=e&&(s.value=0)},void 0);let u=(e,t)=>{let n=s.value,r="function"==typeof e?e(n):e;null==t||t(r),s.value=r},h=e=>{var t,n;let r=null==(t=o.value)?void 0:t.querySelector(`[data-index="${e}"]`),i=null==(n=o.value)?void 0:n.querySelector(".menu-groups");r&&i&&(i.scrollTop=r.offsetTop-i.offsetTop)},d=t=>{let n=l.value.groups.flatMap(e=>e.items).at(t);(null==n?void 0:n.onRun)&&e&&n.onRun(e),r()},p=e=>{let{size:t,groups:n}=l.value;if("Escape"===e.key){e.preventDefault(),null==r||r();return}return"ArrowDown"===e.key?(e.preventDefault(),u(e=>e<t-1?e+1:e,h)):"ArrowUp"===e.key?(e.preventDefault(),u(e=>e<=0?e:e-1,h)):"ArrowLeft"===e.key?(e.preventDefault(),u(e=>{let t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;let r=n[n.indexOf(t)-1];return r?r.range[1]-1:e},h)):"ArrowRight"===e.key?(e.preventDefault(),u(e=>{let t=n.find(t=>t.range[0]<=e&&t.range[1]>e);if(!t)return e;let r=n[n.indexOf(t)+1];return r?r.range[0]:e},h)):void("Enter"===e.key&&(e.preventDefault(),d(s.value)))};return v4(()=>{t.value?window.addEventListener("keydown",p,{capture:!0}):window.removeEventListener("keydown",p,{capture:!0})}),yx(()=>{window.removeEventListener("keydown",p,{capture:!0})}),()=>bB("div",{ref:o,onPointerdown:e=>e.preventDefault()},bB("nav",{class:"tab-group"},bB("ul",null,l.value.groups.map(e=>bB("li",{key:e.key,onPointerdown:()=>u(e.range[0],h),class:s.value>=e.range[0]&&s.value<e.range[1]?"selected":""},e.label)))),bB("div",{class:"menu-groups",onPointermove:c},l.value.groups.map(e=>bB("div",{key:e.key,class:"menu-group"},bB("h6",null,e.label),bB("ul",null,e.items.map(e=>{let t;return bB("li",{key:e.key,"data-index":e.index,class:s.value===e.index?"hover":"",onPointerenter:(t=e.index,e=>{let n=a.value;if(!n)return;let{x:r,y:i}=e;(r!==n.x||i!==n.y)&&u(t)}),onPointerdown:()=>{var t,n;null==(n=null==(t=o.value)?void 0:t.querySelector(`[data-index="${e.index}"]`))||n.classList.add("active")},onPointerup:()=>{var t,n;null==(n=null==(t=o.value)?void 0:t.querySelector(`[data-index="${e.index}"]`))||n.classList.remove("active"),d(e.index)}},bB(we,{icon:e.icon}),bB("span",null,e.label))}))))))}});var z6=e=>{throw TypeError(e)},z8=(e,t,n)=>t.has(e)||z6("Cannot "+n),z9=(e,t,n)=>(z8(e,t,"read from private field"),n?n.call(e):t.get(e)),Pe=(e,t,n)=>t.has(e)?z6("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pt=(e,t,n,r)=>(z8(e,t,"write to private field"),t.set(e,n),n);let Pn=(P="CREPE_MENU",w=dC({},`${P}_SLASH_SPEC`),x=dw(e=>{let t=e.get(w.key);return new s_({key:new sP(`${P}_SLASH`),...t})}),(k=[w,x]).key=w.key,k.pluginKey=x.key,w.meta={package:"@milkdown/plugin-slash",displayName:`Ctx<slashSpec>|${P}`},x.meta={package:"@milkdown/plugin-slash",displayName:`Prose<slash>|${P}`},k),Pr=dC({show:()=>{},hide:()=>{}},"menuAPICtx");class Pi{constructor(e,t,n){Pe(this,eZ),Pe(this,eY),Pe(this,eX),Pe(this,eQ),Pe(this,e0,null),this.update=e=>{z9(this,eQ).update(e)},this.show=e=>{Pt(this,e0,e),z9(this,eX).value="",z9(this,eQ).show()},this.hide=()=>{Pt(this,e0,null),z9(this,eQ).hide()},this.destroy=()=>{z9(this,eQ).destroy(),z9(this,eY).unmount(),z9(this,eZ).remove()};const r=document.createElement("div");r.classList.add("milkdown-slash-menu");const i=vm(!1),o=vm("");Pt(this,eX,o);const l=b8(z7,{ctx:e,config:n,show:i,filter:o,hide:this.hide});Pt(this,eY,l),l.mount(r),Pt(this,eZ,r);const s=this;Pt(this,eQ,new xQ({content:z9(this,eZ),debounce:20,shouldShow(e){if(zQ(e.state.selection)||z0(e.state.selection))return!1;let t=this.getContent(e,e=>["paragraph","heading"].includes(e.type.name));if(null==t||!function(e){if(!(e instanceof sw))return!1;let{$head:t}=e,n=t.parent;return t.parentOffset===n.content.size}(e.state.selection))return!1;let n=z9(s,e0);if(o.value=t.startsWith("/")?t.slice(1):t,"number"==typeof n){let t=Math.min(n,e.state.doc.nodeSize-2);return e.state.doc.resolve(t).node()===e.state.doc.resolve(e.state.selection.from).node()||(Pt(s,e0,null),!1)}return!!t.startsWith("/")},offset:10})),z9(this,eQ).onShow=()=>{i.value=!0},z9(this,eQ).onHide=()=>{i.value=!1},this.update(t),e.set(Pr.key,{show:e=>this.show(e),hide:()=>this.hide()})}}eZ=new WeakMap,eY=new WeakMap,eX=new WeakMap,eQ=new WeakMap,e0=new WeakMap,zL(bB,bo);let Po=yr({props:{onAdd:{type:Function,required:!0},addIcon:{type:String,required:!0},handleIcon:{type:String,required:!0}},setup(e){let t=vm();return()=>bB(bo,null,bB("div",{ref:t,class:"operation-item",onPointerdown:e=>{var n;e.preventDefault(),e.stopPropagation(),null==(n=t.value)||n.classList.add("active")},onPointerup:n=>{var r;n.preventDefault(),n.stopPropagation(),null==(r=t.value)||r.classList.remove("active"),e.onAdd()}},bB(we,{icon:e.addIcon})),bB("div",{class:"operation-item"},bB(we,{icon:e.handleIcon})))}});var Pl=e=>{throw TypeError(e)},Ps=(e,t,n)=>t.has(e)||Pl("Cannot "+n),Pa=(e,t,n)=>(Ps(e,t,"read from private field"),n?n.call(e):t.get(e)),Pc=(e,t,n)=>t.has(e)?Pl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pu=(e,t,n,r)=>(Ps(e,t,"write to private field"),t.set(e,n),n);class Ph{constructor(e,t){var n,r,i;Pc(this,e1),Pc(this,e4),Pc(this,e5),Pc(this,e2),this.update=()=>{Pa(this,e4).update()},this.destroy=()=>{Pa(this,e4).destroy(),Pa(this,e1).remove(),Pa(this,e5).unmount()},this.onAdd=()=>{let e=Pa(this,e2),t=e.get(hb);t.hasFocus()||t.focus();let{state:n,dispatch:r}=t,i=Pa(this,e4).active;if(!i)return;let o=i.$pos.pos+i.node.nodeSize,l=n.tr.insert(o,wF.type(e).create());r((l=l.setSelection(sw.near(l.doc.resolve(o)))).scrollIntoView()),Pa(this,e4).hide(),e.get(Pr.key).show(l.selection.from)},Pu(this,e2,e);const o=document.createElement("div");o.classList.add("milkdown-block-handle");const l=b8(Po,{onAdd:this.onAdd,addIcon:null!=(n=null==t?void 0:t.handleAddIcon)?n:RX,handleIcon:null!=(r=null==t?void 0:t.handleDragIcon)?r:RZ});l.mount(o),Pu(this,e5,l),Pu(this,e1,o);const s=null!=(i=null==t?void 0:t.blockHandle)?i:{};Pu(this,e4,new wc({ctx:e,content:o,getOffset:()=>16,getPlacement:({active:e,blockDom:t})=>{if("heading"===e.node.type.name)return"left";let n=0;e.node.descendants(e=>{n+=e.childCount});let r=e.el,i=r.getBoundingClientRect(),o=t.getBoundingClientRect(),l=window.getComputedStyle(r),s=Number.parseInt(l.paddingTop,10)||0,a=Number.parseInt(l.paddingBottom,10)||0,c=i.height-s-a,u=o.height;return n>2||u<c?"left-start":"left"},...s})),this.update()}}e1=new WeakMap,e4=new WeakMap,e5=new WeakMap,e2=new WeakMap;let Pd=w4.extendSchema(e=>t=>{let n=e(t);return{...n,toMarkdown:{match:n.toMarkdown.match,runner:(e,t)=>{var r,i;if("latex"!==(null!=(r=t.attrs.language)?r:"").toLowerCase())return n.toMarkdown.runner(e,t);e.addNode("math",void 0,(null==(i=t.content.firstChild)?void 0:i.text)||"")}}}}),Pp="math_inline",Pf=dS(Pp,()=>({group:"inline",inline:!0,draggable:!0,atom:!0,attrs:{value:{default:""}},parseDOM:[{tag:`span[data-type="${Pp}"]`,getAttrs:e=>{var t;return{value:null!=(t=e.dataset.value)?t:""}}}],toDOM:e=>{let t=e.attrs.value,n=document.createElement("span");return n.dataset.type=Pp,n.dataset.value=t,Lw(t,n,{throwOnError:!1}),n},parseMarkdown:{match:e=>"inlineMath"===e.type,runner:(e,t,n)=>{e.addNode(n,{value:t.value})}},toMarkdown:{match:e=>e.type.name===Pp,runner:(e,t)=>{e.addNode("inlineMath",void 0,t.attrs.value)}}})),Pm=dv("ToggleLatex",e=>()=>(t,n)=>{let{hasNode:r,pos:i,target:o}=az(t,Pf.type(e)),{selection:l,doc:s,tr:a}=t;if(!r){let t=s.textBetween(l.from,l.to),r=a.replaceSelectionWith(Pf.type(e).create({value:t}));return n&&n(r.setSelection(sk.create(r.doc,l.from))),!0}let{from:c,to:u}=l;if(!o||i<0)return!1;let h=a.delete(i,i+1),d=o.attrs.value;return h=h.insertText(d,i),n&&n(h.setSelection(sw.create(h.doc,c,u+d.length-1))),!0}),Pg=mq("INLINE_LATEX");zL(bB);let Pv=yr({props:{config:{type:Object,required:!0},innerView:{type:Object,required:!0},updateValue:{type:Object,required:!0}},setup(e){let t=t=>{if(t&&t instanceof HTMLElement){for(;t.firstChild;)t.removeChild(t.firstChild);e.innerView.value&&t.appendChild(e.innerView.value.dom)}},n=t=>{t.preventDefault(),e.updateValue.value()};return()=>bB("div",{class:"container"},e.innerView&&bB("div",{ref:t}),bB("button",{type:"button",onPointerdown:n},bB(we,{icon:e.config.inlineEditConfirm})))}});var Py=e=>{throw TypeError(e)},Pb=(e,t,n)=>t.has(e)||Py("Cannot "+n),Pw=(e,t,n)=>(Pb(e,t,"read from private field"),n?n.call(e):t.get(e)),Px=(e,t,n)=>t.has(e)?Py("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pk=(e,t,n,r)=>(Pb(e,t,"write to private field"),t.set(e,n),n);class PC{constructor(e,t,n){this.ctx=e,Px(this,e3),Px(this,e7),Px(this,e6),Px(this,e8,vg(null,!0)),Px(this,e9,function(e){return vg(e,!0)}(()=>{})),Px(this,te),Px(this,tt,()=>{Pw(this,e8).value&&(Pw(this,e8).value.destroy(),Pw(this,e8).value=null)}),Px(this,tn,e=>{let t=(()=>{if(!e.editable)return!1;let{selection:t,schema:n}=e.state;if(t.empty||!(t instanceof sk))return!1;let r=t.node;if(r.type.name!==Pp)return!1;let i=t.from,o=n.nodes.paragraph.create(null,n.text(r.attrs.value)),l=new hh(Pw(this,e6),{state:sL.create({doc:o,schema:new lE({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},text:{group:"inline"}}}),plugins:[aq({"Mod-z":AZ,"Mod-Z":AY,"Mod-y":AY,Enter:()=>(Pw(this,e9).value(),!0)})]})});return Pw(this,e8).value=l,Pw(this,e9).value=()=>{let{tr:t}=e.state;t.setNodeAttribute(i,"value",l.state.doc.textContent),e.dispatch(t),requestAnimationFrame(()=>{e.focus()})},!0})();return t||Pw(this,tt).call(this),t}),this.update=(e,t)=>{Pw(this,e7).update(e,t)},this.destroy=()=>{Pw(this,te).unmount(),Pw(this,e7).destroy(),Pw(this,e3).remove()};const r=document.createElement("div");r.className="milkdown-latex-inline-edit",Pk(this,e3,r),Pk(this,te,b8(Pv,{config:n,innerView:Pw(this,e8),updateValue:Pw(this,e9)})),Pw(this,te).mount(r),Pk(this,e7,new mH({debounce:0,content:Pw(this,e3),shouldShow:Pw(this,tn),offset:10,floatingUIOptions:{placement:"bottom"}})),Pw(this,e7).update(t),Pk(this,e6,document.createElement("div"))}}e3=new WeakMap,e7=new WeakMap,e6=new WeakMap,e8=new WeakMap,e9=new WeakMap,te=new WeakMap,tt=new WeakMap,tn=new WeakMap;let PS=dy(e=>(function(e,t,n={}){return new s6(e,(e,r,i,o)=>{var l,s,a;let{tr:c}=e,u=r[1],h=r[0],d={group:u,fullMatch:h,start:i,end:o},p=null==(l=n.updateCaptured)?void 0:l.call(n,d);if(Object.assign(d,p),{group:u,fullMatch:h,start:i,end:o}=d,null===h||!u||""===u.trim())return null;let f=null==(s=n.getAttr)?void 0:s.call(n,r),m=t.createAndFill(f);return m&&(c.replaceRangeWith(t.isBlock?c.doc.resolve(i).before():i,o,m),null==(a=n.beforeDispatch)||a.call(n,{match:[h,u],start:i,end:o,tr:c})),c})})(/(?:\$)([^$]+)(?:\$)$/,Pf.type(e),{getAttr:e=>{var t;return{value:null!=(t=e[1])?t:""}}})),PM=dy(e=>ae(/^\$\$[\s\n]$/,w4.type(e),()=>({language:"LaTeX"}))),PA=dE("remarkMath",()=>LA);function PT(e){return oe(e,"math",(e,t,n)=>{let{value:r}=e;n.children.splice(t,1,{type:"code",lang:"LaTeX",value:r})})}let PO=dE("remarkMathBlock",()=>()=>PT),PE=dC({text:"Please enter...",mode:"block"},"placeholderConfigCtx"),PN=dw(e=>new s_({key:new sP("CREPE_PLACEHOLDER"),props:{decorations:t=>{var n,r,i;if(e.get("CrepeCtx").readonly)return null;let o=e.get(PE.key);if("doc"===o.mode&&!((r=t.doc).childCount<=1&&!(null==(i=r.firstChild)?void 0:i.content.size))||zQ(t.selection)||z0(t.selection))return null;let l=function(e,t){let{selection:n}=e;if(!n.empty)return null;let r=n.$anchor,i=r.parent;if(i.content.size>0||a_(e=>"table"===e.type.name)(r))return null;let o=r.before();return uJ.node(o,o+i.nodeSize,{class:"crepe-placeholder","data-placeholder":t})}(t,null!=(n=o.text)?n:"Please enter...");return l?uX.create(t.doc,[l]):null}}}));zL(bB,bo);let PD=yr({props:{ctx:{type:Object,required:!0},hide:{type:Function,required:!0},show:{type:Object,required:!0},selection:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){let{ctx:t,config:n}=e,r=bP(()=>(function(e,t){var n,r,i,o,l,s,a,c,u;let h=new z3;h.addGroup("formatting","Formatting").addItem("bold",{icon:null!=(n=null==e?void 0:e.boldIcon)?n:Rx,active:e=>e.get(hH).call(xD.key,wk.type(e)),onRun:e=>{e.get(hH).call(wC.key)}}).addItem("italic",{icon:null!=(r=null==e?void 0:e.italicIcon)?r:RG,active:e=>e.get(hH).call(xD.key,wg.type(e)),onRun:e=>{e.get(hH).call(wv.key)}}).addItem("strikethrough",{icon:null!=(i=null==e?void 0:e.strikethroughIcon)?i:R7,active:e=>e.get(hH).call(xD.key,SL.type(e)),onRun:e=>{e.get(hH).call(S_.key)}});let d=h.addGroup("function","Function");d.addItem("code",{icon:null!=(o=null==e?void 0:e.codeIcon)?o:RD,active:e=>e.get(hH).call(xD.key,wT.type(e)),onRun:e=>{e.get(hH).call(wO.key)}});let p=t&&zl(t).get();if((null==p?void 0:p.includes(Rm.Latex))&&d.addItem("latex",{icon:null!=(l=null==e?void 0:e.latexIcon)?l:zt,active:e=>{let t=e.get(hH),n=e.get(h_).nodes[Pp];return t.call(xI.key,n)},onRun:e=>{e.get(hH).call("ToggleLatex")}}),d.addItem("link",{icon:null!=(s=null==e?void 0:e.linkIcon)?s:RK,active:e=>e.get(hH).call(xD.key,wI.type(e)),onRun:e=>{e.get(hH).call(Lj.key)}}),t&&(null==p?void 0:p.includes(Rm.AI))){let n=t.get(za.key);n.provider&&d.addItem("ai",{icon:null!=(c=null!=(a=null==e?void 0:e.aiIcon)?a:n.aiIcon)?c:Rv,active:()=>!1,onRun:e=>{let t=e.get(zq.key),{from:n,to:r}=e.get(hb).state.selection;t.show(n,r)}})}return null==(u=null==e?void 0:e.buildToolbar)||u.call(e,h),h.build()})(n,t));return()=>bB(bo,null,r.value.map(n=>n.items.map(n=>{var r;let i;return bB("button",{type:"button",class:b9("toolbar-item",t&&(r=n.active,zL(e.selection.value),t.get(hk).status===df.Created&&r(t))&&"active"),onPointerdown:(i=n.onRun,e=>{e.preventDefault(),t&&(null==i||i(t))})},bB(we,{icon:n.icon}))})).reduce((e,t,n)=>(0===n?e.push(...t):e.push(bB("div",{class:"divider"}),...t),e),[]))}});var PI=e=>{throw TypeError(e)},PL=(e,t,n)=>t.has(e)||PI("Cannot "+n),P_=(e,t,n)=>(PL(e,t,"read from private field"),n?n.call(e):t.get(e)),PR=(e,t,n)=>t.has(e)?PI("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pz=(e,t,n,r)=>(PL(e,t,"write to private field"),t.set(e,n),n);let PP=mq("CREPE_TOOLBAR");class PB{constructor(e,t,n){PR(this,tr),PR(this,ti),PR(this,to),PR(this,tl),PR(this,ts,vm(!1)),this.update=(e,t)=>{P_(this,tr).update(e,t),P_(this,tl).value=e.state.selection},this.destroy=()=>{P_(this,tr).destroy(),P_(this,to).unmount(),P_(this,ti).remove()},this.hide=()=>{P_(this,tr).hide()};const r=document.createElement("div");r.className="milkdown-toolbar",Pz(this,tl,function(e){return vg(e,!0)}(t.state.selection));const i=b8(PD,{ctx:e,hide:this.hide,config:n,selection:P_(this,tl),show:P_(this,ts)});i.mount(r),Pz(this,ti,r),Pz(this,to,i),Pz(this,tr,new mH({content:P_(this,ti),debounce:20,offset:10,shouldShow(e){let{doc:t,selection:n}=e.state,{empty:i,from:o,to:l}=n,s=!t.textBetween(o,l).length&&n instanceof sw,a=!(n instanceof sw),c=e.dom.getRootNode().activeElement,u=r.contains(c),h=!e.hasFocus()&&!u,d=!e.editable;return!h&&!a&&!i&&!s&&!d}})),P_(this,tr).onShow=()=>{P_(this,ts).value=!0},P_(this,tr).onHide=()=>{P_(this,ts).value=!1},this.update(t)}}tr=new WeakMap,ti=new WeakMap,to=new WeakMap,tl=new WeakMap,ts=new WeakMap;let PF=[{label:"Paragraph",level:null},{label:"Heading 1",level:1},{label:"Heading 2",level:2},{label:"Heading 3",level:3},{label:"Heading 4",level:4},{label:"Heading 5",level:5},{label:"Heading 6",level:6}];function PH(e,t){if(e.get(hH).call(xD.key,t))return!0;let{state:n}=e.get(hb);if(n.storedMarks)return n.storedMarks.some(e=>e.type===t);if(n.selection instanceof sw){let{$cursor:e}=n.selection;if(e)return e.marks().some(e=>e.type===t)}return!1}zL(bB,bo);let Pq=yr({props:{ctx:{type:Object,required:!0},version:{type:Object,required:!0},config:{type:Object,required:!1}},setup(e){let{ctx:t,config:n}=e,r=vm(null);function i(){return t.get(hk).status===df.Created}function o(){zL(e.version.value)}let l=e=>{e.target.closest(".top-bar-heading-selector")||(r.value=null)};yv(()=>{window.addEventListener("pointerdown",l)}),yx(()=>{window.removeEventListener("pointerdown",l)});let s=bP(()=>{var e,r,i,o,l,s,a,c,u,h,d,p,f,m,g,y,b;let w,x,k,C,S,M,A,T;return x=null==(w=t&&zl(t).get())?void 0:w.includes(Rm.Latex),k=null==w?void 0:w.includes(Rm.ImageBlock),C=null==w?void 0:w.includes(Rm.Table),(S=new z3).addGroup("heading","Heading").addItem("heading-selector",{...(y=null==n?void 0:n.headingOptions,b=null==n?void 0:n.chevronDownIcon,{icon:"",active:()=>!1,selector:{chevronIcon:null!=b?b:RT,activeLabel:e=>(function(e,t){var n,r;let i=null!=t?t:PF,{$from:o}=e.get(hb).state.selection,l=o.parent,s=null!=(n=i.find(e=>null===e.level))?n:i[0];if(l.type===wW.type(e)){let e=l.attrs.level;return null!=(r=i.find(t=>t.level===e))?r:s}return s})(e,M).label,options:(M=null!=y?y:PF).map(e=>({label:e.label,onSelect:t=>(function(e,t){let n=e.get(hH);if(null==t){let t=wF.type(e);n.call(x_.key,{nodeType:t})}else{let r=wW.type(e);n.call(x_.key,{nodeType:r,attrs:{level:t}})}})(t,e.level)}))}})}),S.addGroup("formatting","Formatting").addItem("bold",{icon:null!=(e=null==n?void 0:n.boldIcon)?e:Rx,active:e=>PH(e,wk.type(e)),onRun:e=>{e.get(hH).call(wC.key)}}).addItem("italic",{icon:null!=(r=null==n?void 0:n.italicIcon)?r:RG,active:e=>PH(e,wg.type(e)),onRun:e=>{e.get(hH).call(wv.key)}}).addItem("strikethrough",{icon:null!=(i=null==n?void 0:n.strikethroughIcon)?i:R7,active:e=>PH(e,SL.type(e)),onRun:e=>{e.get(hH).call(S_.key)}}).addItem("code",{icon:null!=(o=null==n?void 0:n.codeIcon)?o:RD,active:e=>PH(e,wT.type(e)),onRun:e=>{let t=e.get(hb),{state:n}=t;if(n.selection.empty){let r=wT.type(e);PH(e,r)?t.dispatch(n.tr.removeStoredMark(r)):t.dispatch(n.tr.addStoredMark(r.create()))}else e.get(hH).call(wO.key)}}),S.addGroup("list","List").addItem("bullet-list",{icon:null!=(l=null==n?void 0:n.bulletListIcon)?l:RC,active:()=>!1,onRun:e=>{let t=e.get(hH),n=xc.type(e);t.call(xR.key,{nodeType:n})}}).addItem("ordered-list",{icon:null!=(s=null==n?void 0:n.orderedListIcon)?s:RY,active:()=>!1,onRun:e=>{let t=e.get(hH),n=xf.type(e);t.call(xR.key,{nodeType:n})}}).addItem("task-list",{icon:null!=(a=null==n?void 0:n.taskListIcon)?a:R9,active:()=>!1,onRun:e=>{let t=e.get(hH),n=xb.type(e);t.call(xR.key,{nodeType:n,attrs:{checked:!1}})}}),(A=S.addGroup("insert","Insert")).addItem("link",{icon:null!=(c=null==n?void 0:n.linkIcon)?c:RK,active:e=>PH(e,wI.type(e)),onRun:e=>{let t=e.get(hb),{state:n}=t,r=wI.type(e);n.selection.empty&&PH(e,r)?t.dispatch(n.tr.removeStoredMark(r)):e.get(hH).call(Lj.key)}}),k&&A.addItem("image",{icon:null!=(u=null==n?void 0:n.imageIcon)?u:RU,active:()=>!1,onRun:e=>{let t=e.get(hH),n=ks.type(e);t.call(xz.key,{nodeType:n})}}),C&&A.addItem("table",{icon:null!=(h=null==n?void 0:n.tableIcon)?h:R6,active:()=>!1,onRun:e=>{let t=e.get(hH),{from:n}=e.get(hb).state.selection;t.call(xz.key,{nodeType:SV(e,3,3)}),t.call(xP.key,{pos:n})}}),(T=S.addGroup("block","Block")).addItem("code-block",{icon:null!=(d=null==n?void 0:n.codeBlockIcon)?d:RI,active:()=>!1,onRun:e=>{let t=e.get(hH),n=w4.type(e);t.call(x_.key,{nodeType:n})}}),x&&T.addItem("math",{icon:null!=(p=null==n?void 0:n.mathIcon)?p:zt,active:()=>!1,onRun:e=>{let t=e.get(hH),n=w4.type(e);t.call(xz.key,{nodeType:n,attrs:{language:"LaTeX"}})}}),S.addGroup("more","More").addItem("quote",{icon:null!=(f=null==n?void 0:n.quoteIcon)?f:RQ,active:()=>!1,onRun:e=>{let t=e.get(hH),n=wY.type(e);t.call(xR.key,{nodeType:n})}}).addItem("hr",{icon:null!=(m=null==n?void 0:n.hrIcon)?m:RR,active:()=>!1,onRun:e=>{let t=e.get(hH),n=xo.type(e);t.call(xz.key,{nodeType:n})}}),null==(g=null==n?void 0:n.buildTopBar)||g.call(n,S),S.build()});return()=>{let e=i()?t.get(hb):null;return e&&!e.editable?null:bB("div",{class:"top-bar-inner"},s.value.map(e=>e.items.map(e=>{var n,l,s,a,c;let u;if(e.selector){let c,u;return n=e.key,l=e.selector,c=r.value===n,bB("div",{key:n,class:"top-bar-heading-selector"},bB("button",{type:"button",class:"top-bar-heading-button",onPointerdown:e=>{e.preventDefault(),e.stopPropagation(),r.value=r.value===n?null:n}},bB("span",{class:"top-bar-heading-label"},(o(),u=i()?l.activeLabel(t):null!=(a=null==(s=l.options[0])?void 0:s.label)?a:"")),l.chevronIcon&&bB("span",{class:"top-bar-chevron"},bB(we,{icon:l.chevronIcon}))),c&&bB("div",{class:"top-bar-heading-dropdown"},l.options.map((e,i)=>bB("button",{key:`${n}-${i}`,type:"button",class:b9("top-bar-heading-option",u===e.label&&"active"),onPointerdown:n=>{n.preventDefault(),n.stopPropagation(),r.value=null,e.onSelect(t)}},e.label))))}return e.onRun?bB("button",{key:e.key,type:"button",class:b9("top-bar-item",(c=e.active,o(),!!i()&&c(t)&&"active")),onPointerdown:(u=e.onRun,e=>{e.preventDefault(),t&&u(t)})},bB(we,{icon:e.icon})):null})).reduce((e,t,n)=>{var r,i;if(0===n)e.push(...t);else{let o=null!=(i=null==(r=s.value[n])?void 0:r.key)?i:n;e.push(bB("div",{key:`divider-${o}`,class:"top-bar-divider"}),...t)}return e},[]))}}});var Pj=e=>{throw TypeError(e)},PV=(e,t,n)=>t.has(e)||Pj("Cannot "+n),P$=(e,t,n)=>(PV(e,t,"read from private field"),n?n.call(e):t.get(e)),PW=(e,t,n)=>t.has(e)?Pj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),PU=(e,t,n,r)=>(PV(e,t,"write to private field"),t.set(e,n),n);let PG=new sP("CREPE_TOP_BAR");class PK{constructor(e,t,n){PW(this,ta),PW(this,tc),PW(this,tu),this.update=(e,t)=>{P$(this,ta).style.display=e.editable?"":"none",P$(this,tu).value++},this.destroy=()=>{P$(this,tc).unmount(),P$(this,ta).remove()},PU(this,tu,vm(0));const r=document.createElement("div");r.className="milkdown-top-bar";const i=b8(Pq,{ctx:e,config:n,version:P$(this,tu)});i.mount(r),PU(this,ta,r),PU(this,tc,i);const o=t.dom.parentElement;o&&o.insertBefore(r,o.firstChild),this.update(t)}}ta=new WeakMap,tc=new WeakMap,tu=new WeakMap;let PJ=dC({view:()=>({update:()=>{},destroy:()=>{}})},"topBarConfig"),PZ=dw(e=>new s_({key:PG,view:e.get(PJ.key).view}));var PY=e=>{throw TypeError(e)},PX=(e,t,n)=>t.has(e)||PY("Cannot "+n),PQ=(e,t,n)=>(PX(e,t,"read from private field"),n?n.call(e):t.get(e)),P0=(e,t,n)=>t.has(e)?PY("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),P1=(e,t,n,r)=>(PX(e,t,"write to private field"),t.set(e,n),n);class P4{constructor({root:e,defaultValue:t=""}={}){var n;P0(this,th),P0(this,td),P0(this,tp,!0),this.addFeature=(e,t)=>(e(PQ(this,th),t),this),this.create=()=>PQ(this,th).create(),this.destroy=()=>PQ(this,th).destroy(),this.setReadonly=e=>(P1(this,tp,!e),PQ(this,th).action(t=>{PQ(this,th).status===df.Created&&t.get(hb).setProps({editable:()=>!e})}),this),this.getMarkdown=()=>PQ(this,th).action(e=>{let t=e.get(hb),n=(e.get(h_),e.get(h5));return n(t.state.doc)}),this.on=e=>(PQ(this,th).status!==df.Created?PQ(this,th).config(t=>{e(t.get(Rl))}):PQ(this,th).action(t=>{e(t.get(Rl))}),this),P1(this,td,null!=(n="string"==typeof e?document.querySelector(e):e)?n:document.body),P1(this,th,dm.make().config(e=>{e.inject(zo,this),e.inject(zi,[])}).config(e=>{e.set(dc,PQ(this,td)),e.set(h3,t),e.set(da,{editable:()=>PQ(this,tp)}),e.update(Rn.key,e=>({...e,size:4})),e.update(Rd.key,e=>({...e,uploader:async(e,t,n)=>{let r=zl(n).get().includes(Rm.ImageBlock),i=r?t.nodes["image-block"]:t.nodes.image;if(!i)return[];let o=r?n.get(x8.key).onUpload:void 0,l=[];for(let t=0;t<e.length;t++){let n=e.item(t);n&&n.type.includes("image")&&l.push(n)}return await Promise.all(l.map(async e=>{let t=o?await o(e):URL.createObjectURL(e);return i.createAndFill({src:t})}))}}))}).use(xX).use(Ra).use(Rt).use(Ri).use(Rh).use(_2).use(Rf).use(Mb))}get editor(){return PQ(this,th)}get readonly(){return!PQ(this,tp)}}th=new WeakMap,td=new WeakMap,tp=new WeakMap;class P5 extends P4{constructor({features:e={},featureConfigs:t={},...n}={}){super(n);const r=nG(t,zr);Object.entries({...Rg,...e}).filter(([,e])=>e).map(([e])=>e).forEach(e=>{let t=r[e];!function(e,t,n){switch(e){case Rm.CodeMirror:return((e,t={})=>{e.config(zs(Rm.CodeMirror)).config(e=>{let{languages:n=[],theme:r}=t,i=[nX.keymap.of(AL.concat(A_)),OM];r&&i.push(r),t.extensions&&i.push(...t.extensions),e.update(A2.key,e=>{var r;return{extensions:i,languages:n,expandIcon:t.expandIcon||RT,searchIcon:t.searchIcon||R4,clearSearchIcon:t.clearSearchIcon||RN,searchPlaceholder:t.searchPlaceholder||"Search language",copyText:t.copyText||"Copy",copyIcon:t.copyIcon||R_,onCopy:t.onCopy||(()=>{}),noResultText:t.noResultText||"No result",renderLanguage:t.renderLanguage||e.renderLanguage,renderPreview:t.renderPreview||e.renderPreview,previewToggleButton:e=>{var n,r;return[(null==(n=t.previewToggleIcon)?void 0:n.call(t,e))||(e?RP:zn),(null==(r=t.previewToggleText)?void 0:r.call(t,e))||(e?"Edit":"Hide")].map(e=>e.trim()).join(" ")},previewLabel:t.previewLabel||e.previewLabel,previewLoading:t.previewLoading||e.previewLoading,previewOnlyByDefault:null!=(r=t.previewOnlyByDefault)?r:e.previewOnlyByDefault}})}).use(Ts)})(t,n);case Rm.ListItem:return t.config(zs(Rm.ListItem)).config(e=>{e.set(_x.key,{renderLabel:({label:e,listType:t,checked:r})=>{var i,o,l;return null==r?"bullet"===t?null!=(i=null==n?void 0:n.bulletIcon)?i:Rk:e:r?null!=(o=null==n?void 0:n.checkBoxCheckedIcon)?o:RM:null!=(l=null==n?void 0:n.checkBoxUncheckedIcon)?l:RA}})}).use(_A);case Rm.LinkTooltip:return t.config(zs(Rm.LinkTooltip)).config(_p).config(e=>{e.update(Lq.key,e=>{var t,r,i,o,l,s;return{...e,linkIcon:null!=(t=null==n?void 0:n.linkIcon)?t:R_,editButton:null!=(r=null==n?void 0:n.editButton)?r:RP,removeButton:null!=(i=null==n?void 0:n.removeButton)?i:R0,confirmButton:null!=(o=null==n?void 0:n.confirmButton)?o:RL,inputPlaceholder:null!=(l=null==n?void 0:n.inputPlaceholder)?l:"Paste link...",onCopyLink:null!=(s=null==n?void 0:n.onCopyLink)?s:()=>{}}})}).use(_f);case Rm.ImageBlock:return t.config(zs(Rm.ImageBlock)).config(e=>{e.update(OQ.key,e=>{var t,r,i,o,l,s;return{uploadButton:null!=(t=null==n?void 0:n.inlineUploadButton)?t:"Upload",imageIcon:null!=(r=null==n?void 0:n.inlineImageIcon)?r:RU,confirmButton:null!=(i=null==n?void 0:n.inlineConfirmButton)?i:RL,uploadPlaceholderText:null!=(o=null==n?void 0:n.inlineUploadPlaceholderText)?o:"or paste link",onUpload:null!=(s=null!=(l=null==n?void 0:n.inlineOnUpload)?l:null==n?void 0:n.onUpload)?s:e.onUpload,proxyDomURL:null==n?void 0:n.proxyDomURL}}),e.update(x8.key,e=>{var t,r,i,o,l,s,a,c,u;return{uploadButton:null!=(t=null==n?void 0:n.blockUploadButton)?t:"Upload file",imageIcon:null!=(r=null==n?void 0:n.blockImageIcon)?r:RU,captionIcon:null!=(i=null==n?void 0:n.blockCaptionIcon)?i:RS,confirmButton:null!=(o=null==n?void 0:n.blockConfirmButton)?o:"Confirm",captionPlaceholderText:null!=(l=null==n?void 0:n.blockCaptionPlaceholderText)?l:"Write Image Caption",uploadPlaceholderText:null!=(s=null==n?void 0:n.blockUploadPlaceholderText)?s:"or paste link",onUpload:null!=(c=null!=(a=null==n?void 0:n.blockOnUpload)?a:null==n?void 0:n.onUpload)?c:e.onUpload,proxyDomURL:null==n?void 0:n.proxyDomURL,onImageLoadError:null!=(u=null==n?void 0:n.onImageLoadError)?u:e.onImageLoadError,maxWidth:null==n?void 0:n.maxWidth,maxHeight:null==n?void 0:n.maxHeight}})}).use(kw).use(O7);case Rm.Cursor:var r,i;let o,l;if(t.config(zs(Rm.Cursor)).config(e=>{e.update(OB.key,()=>{var e,t;return{class:"crepe-drop-cursor",width:null!=(e=null==n?void 0:n.width)?e:4,color:null!=(t=null==n?void 0:n.color)&&t}})}).use(OV),(null==n?void 0:n.virtual)===!1)return;let s=(o=!1,l="u"<typeof document?null:document.createElement("div"),new s_({key:O$,view:e=>{let t;!0!==o&&function(e,t){for(let[n,r]of Object.entries(e.marks))!1!==r.spec.inclusive||t.includes(n)||console.warn(`[prosemirror-virtual-cursor] Virtual cursor does not work well with marks that have inclusive set to false. Please consider removing the inclusive option from the "${n}" mark or adding it to the "skipWarning" option.`)}(e.state.schema,o||[]);let n=e.dom.ownerDocument,r=l=l||document.createElement("div"),i=()=>{!function(e,t){var n,r;if(!e||!e.dom||e.isDestroyed||!t)return;let{state:i,dom:o}=e,{selection:l}=i;if(!OU(l))return;let s=function(e,t){var n;let r=window.getSelection();if(!r||!r.rangeCount)return null;let i=null==(n=null==r?void 0:r.getRangeAt(0))?void 0:n.cloneRange();if(!i)return null;i.collapse(t);let o=i.getClientRects(),l=(null==o?void 0:o.length)?o[o.length-1]:null;return(null==l?void 0:l.height)?l:e.coordsAtPos(e.state.selection.head)}(e,l.$head===l.$from);if(!s)return;let a=o.getBoundingClientRect(),c="prosemirror-virtual-cursor",u=i.selection.$head,[h,d]=OW(u),p=i.storedMarks||u.marks();l.$cursor&&h&&d&&p&&!o9.sameSet(h,d)&&(o9.sameSet(h,p)?c+=" prosemirror-virtual-cursor-left":o9.sameSet(d,p)&&(c+=" prosemirror-virtual-cursor-right")),t.className=c,r="prosemirror-virtual-cursor-animation",(n=t).classList.remove(r),n.offsetWidth,n.classList.add(r),t.style.height=`${s.bottom-s.top}px`,t.style.left=`${s.left-a.left}px`,t.style.top=`${s.top-a.top}px`}(e,r)};return window.ResizeObserver&&(t=new window.ResizeObserver(()=>i())).observe(e.dom),n.addEventListener("selectionchange",i),{update:()=>{i()},destroy:()=>{n.removeEventListener("selectionchange",i),t&&t.unobserve(e.dom)}}},props:{handleKeyDown:(e,t)=>{var n;let{selection:r}=e.state;if(t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||t.isComposing||!["ArrowLeft","ArrowRight"].includes(t.key)||!OU(r)||!r.empty)return!1;let i=r.$head,[o,l]=OW(i),s=e.state.storedMarks||i.marks();if(o&&l&&!o9.sameSet(o,l)){if("ArrowLeft"===t.key&&!o9.sameSet(o,s))return e.dispatch(e.state.tr.setStoredMarks(o)),!0;if("ArrowRight"===t.key&&!o9.sameSet(l,s))return e.dispatch(e.state.tr.setStoredMarks(l)),!0}return"ArrowLeft"===t.key&&1===i.textOffset?(e.dispatch(e.state.tr.setSelection(sw.create(e.state.doc,i.pos-1)).setStoredMarks(i.marks())),!0):"ArrowRight"===t.key&&i.textOffset+1===(null==(n=i.parent.maybeChild(i.index()))?void 0:n.nodeSize)&&(e.dispatch(e.state.tr.setSelection(sw.create(e.state.doc,i.pos+1)).setStoredMarks(i.marks())),!0)},decorations:e=>{if(l&&OU(e.selection)&&e.selection.empty)return uX.create(e.doc,[uJ.widget(0,l,{key:"prosemirror-virtual-cursor"})])},attributes:{class:"virtual-cursor-enabled"}}}));t.use(dw(()=>s));return;case Rm.BlockEdit:return t.config(zs(Rm.BlockEdit)).config(e=>{e.set(wn.key,{filterNodes:e=>!a_(e=>["table","blockquote","math_inline"].includes(e.type.name))(e)}),e.set(wu.key,{view:()=>new Ph(e,n)})}).config(e=>{e.set(Pn.key,{view:t=>new Pi(e,t,n)})}).use(Pr).use(wu).use(Pn);case Rm.Placeholder:return t.config(zs(Rm.Placeholder)).config(e=>{n&&e.update(PE.key,e=>({...e,...n}))}).use(PN).use(PE);case Rm.Toolbar:return t.config(zs(Rm.Toolbar)).config(e=>{e.set(PP.key,{view:t=>new PB(e,t,n)})}).use(PP);case Rm.Table:return t.config(zs(Rm.Table)).config(e=>{e.update(_B.key,e=>({...e,renderButton:e=>{var t,r,i,o,l,s,a,c,u;switch(e){case"add_row":return null!=(t=null==n?void 0:n.addRowIcon)?t:RX;case"add_col":return null!=(r=null==n?void 0:n.addColIcon)?r:RX;case"delete_row":return null!=(i=null==n?void 0:n.deleteRowIcon)?i:R0;case"delete_col":return null!=(o=null==n?void 0:n.deleteColIcon)?o:R0;case"align_col_left":return null!=(l=null==n?void 0:n.alignLeftIcon)?l:Rb;case"align_col_center":return null!=(s=null==n?void 0:n.alignCenterIcon)?s:Ry;case"align_col_right":return null!=(a=null==n?void 0:n.alignRightIcon)?a:Rw;case"col_drag_handle":return null!=(c=null==n?void 0:n.colDragHandleIcon)?c:Rz;case"row_drag_handle":return null!=(u=null==n?void 0:n.rowDragHandleIcon)?u:Rz}}}))}).use(_4);case Rm.Latex:return t.config(zs(Rm.Latex)).config(e=>{if(!zl(e).get().includes(Rm.CodeMirror))throw Error("You need to enable CodeMirror to use LaTeX feature");e.update(A2.key,e=>({...e,renderPreview:(t,r,i)=>"latex"===t.toLowerCase()&&r.length>0?Lb(r,{...null==n?void 0:n.katexOptions,throwOnError:!1,displayMode:!0}).toMarkup():(0,e.renderPreview)(t,r,i)})),e.set(Pg.key,{view:t=>{var r;return new PC(e,t,{inlineEditConfirm:null!=(r=null==n?void 0:n.inlineEditConfirm)?r:RL,...n})}})}).use(PA).use(PO).use(Pf).use(Pg).use(PS).use(PM).use(Pd).use(Pm);case Rm.TopBar:return t.config(zs(Rm.TopBar)).config(e=>{e.set(PJ.key,{view:t=>new PK(e,t,n)})}).use(PJ).use(PZ);case Rm.AI:let a,c;return a=null!=(r=null==n?void 0:n.diff)?r:{},c=null!=(i=null==n?void 0:n.streaming)?i:{},t.config(zs(Rm.AI)).config(e=>{e.update(dU.key,e=>{var t;return{...e,ignoreAttrs:null!=(t=a.ignoreAttrs)?t:zX}});let{ignoreAttrs:t,...n}=a;e.update(pn.key,e=>{var t;return{...e,customBlockTypes:null!=(t=n.customBlockTypes)?t:zY,...n}})}).use(d2).use(pg).config(e=>{e.update(py.key,e=>{var t;return{...e,...c,ignoreAttrs:null!=(t=c.ignoreAttrs)?t:zX,...(null==n?void 0:n.diffReviewOnEnd)!==void 0?{diffReviewOnEnd:n.diffReviewOnEnd}:{}}})}).use(pE).config(e=>{e.update(za.key,e=>{var t;return{...e,...(null==n?void 0:n.provider)!==void 0?{provider:n.provider}:{},...(null==n?void 0:n.buildContext)!==void 0?{buildContext:n.buildContext}:{},diffReviewOnEnd:null!=(t=null==n?void 0:n.diffReviewOnEnd)?t:e.diffReviewOnEnd,...(null==n?void 0:n.onError)!==void 0?{onError:n.onError}:{},...(null==n?void 0:n.aiIcon)!==void 0?{aiIcon:n.aiIcon}:{}}})}).use(za).use(zc).use(zp).use(zf).config(e=>{var t,r,i,o,l,s,a,c,u,h,d,p,f;let m,g=((m=new zI).addItem("improve",{icon:Rv,label:"Improve writing",streamingLabel:"Improving writing",prompt:"Improve the writing while preserving the original meaning."}).addItem("grammar",{icon:RF,label:"Fix grammar & spelling",streamingLabel:"Fixing grammar & spelling",prompt:"Fix any grammar and spelling errors without changing the meaning."}).addItem("shorter",{icon:R3,label:"Make shorter",streamingLabel:"Making shorter",prompt:"Make this shorter while preserving the key information."}).addItem("longer",{icon:RJ,label:"Make longer",streamingLabel:"Expanding",prompt:"Expand this with more detail and examples."}),m.addSubmenu("tone",{icon:RP,label:"Change tone…",title:"Change tone",searchPlaceholder:"Search tones…"},e=>{for(let[t,n]of[["professional","Professional"],["casual","Casual"],["confident","Confident"],["friendly","Friendly"],["direct","Direct"],["formal","Formal"]])e.addItem(t,{icon:RP,label:n,streamingLabel:"Adjusting tone",prompt:`Rewrite this in a ${n.toLowerCase()} tone.`})}),m.addSubmenu("translate",{icon:ze,label:"Translate…",title:"Translate",searchPlaceholder:"Search languages…"},e=>{for(let[t,n,r]of[["english","English","English"],["chinese","Chinese","Chinese (Simplified)"],["japanese","Japanese","Japanese"],["korean","Korean","Korean"],["spanish","Spanish","Spanish"],["french","French","French"],["german","German","German"]])e.addItem(t,{icon:ze,label:n,streamingLabel:`Translating to ${n}`,prompt:`Translate this to ${r}.`})}),null==(t=null==n?void 0:n.buildAISuggestions)||t.call(n,m),{placeholder:null!=(r=null==n?void 0:n.instructionPlaceholder)?r:"Tell AI what to do with the selection…",chrome:{aiIcon:null!=(i=null==n?void 0:n.aiIcon)?i:Rv,sendIcon:null!=(o=null==n?void 0:n.sendIcon)?o:R5,sendPromptIcon:null!=(l=null==n?void 0:n.sendPromptIcon)?l:R2,enterKeyIcon:null!=(s=null==n?void 0:n.enterKeyIcon)?s:RB,chevronLeftIcon:null!=(a=null==n?void 0:n.chevronLeftIcon)?a:RO,chevronRightIcon:null!=(c=null==n?void 0:n.chevronRightIcon)?c:RE,suggestionsHeaderLabel:null!=(u=null==n?void 0:n.suggestionsHeaderLabel)?u:"SUGGESTIONS",sendAsPromptHeaderLabel:null!=(h=null==n?void 0:n.sendAsPromptHeaderLabel)?h:"SEND AS PROMPT",sendAsPromptLabel:null!=(d=null==n?void 0:n.sendAsPromptLabel)?d:"Ask AI:",submitButtonLabel:null!=(p=null==n?void 0:n.submitButtonLabel)?p:"Send prompt",listboxLabel:null!=(f=null==n?void 0:n.listboxLabel)?f:"AI suggestions"},suggestions:m.build()}),y=null;e.update(zq.key,e=>({...e,show:(e,t)=>{null==y||y.show(e,t)}})),e.set(zj.key,{view:t=>y=new zH(e,t,g)})}).use(zq).use(zj).use(function(e={}){var t,n;let{config:r}=e,i=null!=(t=null==r?void 0:r.fallbackLabel)?t:"Generating",o=null!=(n=null==r?void 0:r.cancelHint)?n:"Esc to cancel";return dw(e=>{let t=null;function n(){t&&(t.destroy(),t=null)}return new s_({key:zJ,state:{init:()=>uX.empty,apply(r,l,s,a){let c=pC.getState(a);if(!(null==c?void 0:c.active)||null==c.insertEndPos)return n(),uX.empty;if(r.getMeta(pC)||r.docChanged){var u;let n,r;return u=a.doc,n=Math.min(c.insertEndPos,u.content.size),r=uJ.widget(n,(t?t.setLabel(e):t=new zZ(e,i,o),t).dom,{side:1,key:"ai-streaming-indicator"}),uX.create(u,[r])}return l.map(r.mapping,r.doc)}},view:()=>({destroy(){n()}}),props:{decorations(e){var t;return null!=(t=zJ.getState(e))?t:uX.empty},handleKeyDown(t,n){var r;if("Escape"!==n.key)return!1;let i=e.get(hH);return e.get(zc.key).abortController?(n.preventDefault(),i.call(zf.key,{keep:!0}),!0):null!=(r=pC.getState(t.state))&&!!r.active&&(n.preventDefault(),i.call(pO.key,{keep:!0}),!0)}}})})}({config:null==n?void 0:n.streamingIndicator})).use(function(e={}){let t=function(e){var t,n,r,i,o,l,s;let{config:a,enterKeyIcon:c}=e;return{retryLabel:null!=(t=null==a?void 0:a.retryLabel)?t:"Retry",rejectAllLabel:null!=(n=null==a?void 0:a.rejectAllLabel)?n:"Reject all",acceptAllLabel:null!=(r=null==a?void 0:a.acceptAllLabel)?r:"Accept all",retryIcon:null!=(i=null==a?void 0:a.retryIcon)?i:R1,rejectIcon:null!=(o=null==a?void 0:a.rejectIcon)?o:RN,acceptIcon:null!=(l=null==a?void 0:a.acceptIcon)?l:RL,enterKeyIcon:null!=c?c:RB,modSymbol:null!=(s=null==a?void 0:a.modSymbol)?s:zM}}(e);return dw(e=>new s_({key:zS,view:n=>new zC(e,n,t),props:{handleKeyDown(t,n){var r;return"Enter"===n.key&&!!(n.metaKey||n.ctrlKey)&&!!(null==(r=dG.getState(t.state))?void 0:r.active)&&!!e.get(zc.key).diffOwnedByAI&&(n.preventDefault(),e.get(hH).call(d4.key),!0)}}}))}({config:null==n?void 0:n.diffActions,enterKeyIcon:null==n?void 0:n.enterKeyIcon}))}}(e,this.editor,t)})}}P5.Feature=Rm;let P2=(0,tm.forwardRef)(({content:e,readOnly:t,onChange:n,className:r},i)=>{let o=(0,tm.useRef)(null),l=(0,tm.useRef)(null),s=(0,tm.useRef)(n),[a,c]=(0,tm.useState)(!1);return(0,tm.useEffect)(()=>{s.current=n},[n]),(0,tm.useImperativeHandle)(i,()=>({setMarkdown:e=>{l.current&&a&&l.current.editor.action(dN(e))},getMarkdown:()=>l.current?.getMarkdown()||""})),(0,tm.useEffect)(()=>{if(!o.current)return;let n=new P5({root:o.current,defaultValue:e,featureConfigs:{[P5.Feature.Placeholder]:{text:"输入 / 以使用命令..."},[P5.Feature.ImageBlock]:{inlineUploadButton:"上传图片",inlineUploadPlaceholderText:"或粘贴图片链接...",blockUploadButton:"上传图片",blockUploadPlaceholderText:"或粘贴图片链接...",blockCaptionPlaceholderText:"添加标题..."},[P5.Feature.BlockEdit]:{textGroup:{label:"基础",text:{label:"文本"},h1:{label:"一级标题"},h2:{label:"二级标题"},h3:{label:"三级标题"},h4:{label:"四级标题"},h5:{label:"五级标题"},h6:{label:"六级标题"},quote:{label:"引用"},divider:{label:"分割线"}},listGroup:{label:"列表",bulletList:{label:"无序列表"},orderedList:{label:"有序列表"},taskList:{label:"任务列表"}},advancedGroup:{label:"高级",image:{label:"图片"},codeBlock:{label:"代码块"},table:{label:"表格"},math:{label:"数学公式"}}}}});n.editor.config(e=>{e.set(wD.key,()=>({rel:"noopener noreferrer",target:"_blank"}))}),n.on(e=>{e.markdownUpdated((e,t,n)=>{s.current&&t!==n&&s.current(t)})});let r=!1;return n.create().then(()=>{r?n.destroy():(l.current=n,n.setReadonly(!!t),c(!0))}),()=>{r=!0,l.current&&(l.current.destroy(),l.current=null)}},[]),(0,tm.useEffect)(()=>{l.current&&a&&l.current.setReadonly(!!t)},[t,a]),(0,tm.useEffect)(()=>{l.current&&a&&e!==l.current.getMarkdown()&&l.current.editor.action(dN(e))},[e,a]),(0,tf.jsx)("div",{ref:o,className:r||"milkdown-editor"})});P2.displayName="MilkdownEditor",e.s(["MilkdownEditor",0,P2],34859)},36975,e=>{e.n(e.i(34859))}]);
|