superfactory 0.0.0-stage → 0.4.30

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.
Files changed (308) hide show
  1. package/README.md +34 -2
  2. package/THIRD-PARTY-NOTICES.md +27604 -0
  3. package/bin/superfactory.js +57 -0
  4. package/cli/agent-rf446fr1.js +2 -0
  5. package/cli/agent-state-wv62c1td.js +2 -0
  6. package/cli/bin-0cvfmkhh.js +33 -0
  7. package/cli/bin-0t68hf99.js +3 -0
  8. package/cli/bin-19vpzq7g.js +4 -0
  9. package/cli/bin-37w316c6.js +3 -0
  10. package/cli/bin-3dsqxzbz.js +3 -0
  11. package/cli/bin-4j0jjd8g.js +3 -0
  12. package/cli/bin-4tdqjbbd.js +229 -0
  13. package/cli/bin-4zvje4sn.js +502 -0
  14. package/cli/bin-674kd343.js +7 -0
  15. package/cli/bin-8jdkg4ke.js +3 -0
  16. package/cli/bin-d99yte0j.js +5 -0
  17. package/cli/bin-fgvkq9cq.js +867 -0
  18. package/cli/bin-fkp3j5f3.js +3 -0
  19. package/cli/bin-fypan1f6.js +951 -0
  20. package/cli/bin-gg19acwr.js +4 -0
  21. package/cli/bin-ghp5x0x5.js +139 -0
  22. package/cli/bin-gk00mnmn.js +5 -0
  23. package/cli/bin-gne2w036.js +29 -0
  24. package/cli/bin-grxzwpe8.js +3 -0
  25. package/cli/bin-h57gajkz.js +8 -0
  26. package/cli/bin-mbpvzx2b.js +8 -0
  27. package/cli/bin-nnq8kd9z.js +4 -0
  28. package/cli/bin-ven2efjq.js +3 -0
  29. package/cli/bin-yqb1d1mw.js +22 -0
  30. package/cli/bin-z5b3tt05.js +20 -0
  31. package/cli/bin-za1by1n5.js +3 -0
  32. package/cli/bin-zpfe0pxz.js +1 -0
  33. package/cli/bin.js +3 -0
  34. package/cli/child-agent-qgeqvs03.js +4 -0
  35. package/cli/connect-chn8pxyf.js +2 -0
  36. package/cli/container-j6zr9gww.js +4 -0
  37. package/cli/dev-gsaehf19.js +7 -0
  38. package/cli/health-nqzge5kh.js +2 -0
  39. package/cli/home-lock-5seng0k3.js +2 -0
  40. package/cli/host-7dfjhf0z.js +1507 -0
  41. package/cli/index-1wseh1tm.js +2 -0
  42. package/cli/index-axfe8zef.js +2 -0
  43. package/cli/index-s9pw90xe.js +2 -0
  44. package/cli/install-17r8t45e.js +2 -0
  45. package/cli/join-551zg7yr.js +31 -0
  46. package/cli/local-server-2smsafvg.js +2 -0
  47. package/cli/machine-zfjmpw7h.js +2 -0
  48. package/cli/main-0mxhd968.js +33 -0
  49. package/cli/main-53qmhxmd.js +303 -0
  50. package/cli/move-to-xrr2b135.js +2 -0
  51. package/cli/npm-package.json +1 -0
  52. package/cli/pair-phone-070c9ztt.js +5 -0
  53. package/cli/prompt-psc4drtd.js +2 -0
  54. package/cli/reached-vwzx2cdg.js +2 -0
  55. package/cli/sessions-bm4mk37y.js +3 -0
  56. package/cli/sf-cli-s42gkp0b.js +2 -0
  57. package/cli/sf-db-r8f1a20b.js +23 -0
  58. package/cli/sf-deploy-wqaa4fdm.js +21 -0
  59. package/cli/sf-pr-rg3q3tn6.js +13 -0
  60. package/cli/sf-test-pff158qc.js +10 -0
  61. package/cli/tart-isolation-wr3xwfmw.js +3 -0
  62. package/cli/tray-4rr0y1dv.png +0 -0
  63. package/cli/tray-mac-offline-89dva0gs.png +0 -0
  64. package/cli/tray-mac-paused-hq3a1cxv.png +0 -0
  65. package/cli/tray-mac-tvtavf0g.png +0 -0
  66. package/cli/tray-offline-xj6b5ta4.png +0 -0
  67. package/cli/tray-paused-6pzdv5ze.png +0 -0
  68. package/cli/vm-keeper-p0ggcw3z.js +3 -0
  69. package/package.json +50 -4
  70. package/plugins/sf-video-review/.claude-plugin/plugin.json +17 -0
  71. package/plugins/sf-video-review/.mcp.json +9 -0
  72. package/plugins/sf-video-review/dist/video-review.mjs +135 -0
  73. package/plugins/sf-video-review/skills/video-review/SKILL.md +65 -0
  74. package/plugins/sf-video-studio/.claude-plugin/plugin.json +17 -0
  75. package/plugins/sf-video-studio/.mcp.json +19 -0
  76. package/plugins/sf-video-studio/dist/demo-video.mjs +139 -0
  77. package/plugins/sf-video-studio/dist/narration-voice.mjs +134 -0
  78. package/plugins/sf-video-studio/dist/video-generation.mjs +131 -0
  79. package/plugins/sf-video-studio/fonts/DejaVuSansMono-Bold.ttf +0 -0
  80. package/plugins/sf-video-studio/fonts/DejaVuSansMono.ttf +0 -0
  81. package/plugins/sf-video-studio/fonts/LICENSE-DejaVu +187 -0
  82. package/plugins/sf-video-studio/hooks/hooks.json +17 -0
  83. package/plugins/sf-video-studio/hooks/no-robot-voice.sh +77 -0
  84. package/plugins/sf-video-studio/kokoro/package-lock.json +1137 -0
  85. package/plugins/sf-video-studio/kokoro/package.json +11 -0
  86. package/plugins/sf-video-studio/skills/demo-video/SKILL.md +101 -0
  87. package/plugins/sf-video-studio/skills/narration-voice/SKILL.md +49 -0
  88. package/plugins/sf-video-studio/skills/video-generation/SKILL.md +30 -0
  89. package/server/dist/account.js +3 -0
  90. package/server/dist/backup-process.js +2 -0
  91. package/server/dist/backup.js +3 -0
  92. package/server/dist/chunk-0tbq288f.js +3055 -0
  93. package/server/dist/chunk-18n7tr66.js +3 -0
  94. package/server/dist/chunk-1kgfrgmv.js +3 -0
  95. package/server/dist/chunk-1rnmxaav.js +209 -0
  96. package/server/dist/chunk-26zhqbyn.js +25 -0
  97. package/server/dist/chunk-34mn2zj2.js +2 -0
  98. package/server/dist/chunk-3psgsw9t.js +2 -0
  99. package/server/dist/chunk-8zbwppny.js +391 -0
  100. package/server/dist/chunk-9pn7q001.js +3 -0
  101. package/server/dist/chunk-9y7a9gkf.js +2 -0
  102. package/server/dist/chunk-bhm6jzch.js +8 -0
  103. package/server/dist/chunk-dbzjsqvb.js +17 -0
  104. package/server/dist/chunk-fxn504n0.js +2 -0
  105. package/server/dist/chunk-g6pwaap3.js +2 -0
  106. package/server/dist/chunk-gefgv8rg.js +7 -0
  107. package/server/dist/chunk-jg8b833v.js +2 -0
  108. package/server/dist/chunk-jy148bhn.js +3 -0
  109. package/server/dist/chunk-ky4nz39j.js +7 -0
  110. package/server/dist/chunk-mbd1y9qk.js +2 -0
  111. package/server/dist/chunk-neyhk32g.js +13 -0
  112. package/server/dist/chunk-nrz953bx.js +2 -0
  113. package/server/dist/chunk-padvv31s.js +2 -0
  114. package/server/dist/chunk-q1s2ez77.js +3 -0
  115. package/server/dist/chunk-q403h2bh.js +10 -0
  116. package/server/dist/chunk-t64r6enn.js +4 -0
  117. package/server/dist/chunk-vccappg7.js +59 -0
  118. package/server/dist/chunk-vj60fbhw.js +2 -0
  119. package/server/dist/chunk-xj26rwda.js +3 -0
  120. package/server/dist/chunk-xyw98jst.js +5 -0
  121. package/server/dist/main.js +43 -0
  122. package/server/dist/move.js +3 -0
  123. package/server/drizzle/pg/0000_baseline.sql +632 -0
  124. package/server/drizzle/pg/0001_transcripts_packed.sql +2 -0
  125. package/server/drizzle/pg/0002_vm_server_origin.sql +1 -0
  126. package/server/drizzle/pg/0003_reached_machines.sql +1 -0
  127. package/server/drizzle/pg/0004_link_records.sql +2 -0
  128. package/server/drizzle/pg/0005_task_columns.sql +7 -0
  129. package/server/drizzle/pg/0006_task_bundle.sql +3 -0
  130. package/server/drizzle/pg/0007_server_log.sql +9 -0
  131. package/server/drizzle/pg/0008_notification_pauses.sql +6 -0
  132. package/server/drizzle/pg/0009_vm_replaces.sql +1 -0
  133. package/server/drizzle/pg/0010_question_told_once.sql +10 -0
  134. package/server/drizzle/pg/0011_node_next_key.sql +3 -0
  135. package/server/drizzle/pg/0012_task_work.sql +8 -0
  136. package/server/drizzle/pg/0013_task_secret_grants.sql +9 -0
  137. package/server/drizzle/pg/0014_node_paused.sql +2 -0
  138. package/server/drizzle/pg/0015_ssh_machines.sql +19 -0
  139. package/server/drizzle/pg/0016_node_wake.sql +1 -0
  140. package/server/drizzle/pg/0017_node_uninstall_key.sql +1 -0
  141. package/server/drizzle/pg/0018_release_starts.sql +6 -0
  142. package/server/drizzle/pg/0019_session_memory.sql +7 -0
  143. package/server/drizzle/pg/meta/_journal.json +146 -0
  144. package/server/drizzle/sqlite/0000_pre_drizzle_schema.sql +351 -0
  145. package/server/drizzle/sqlite/0001_cluster.sql +36 -0
  146. package/server/drizzle/sqlite/0002_task_records.sql +22 -0
  147. package/server/drizzle/sqlite/0003_indexes.sql +12 -0
  148. package/server/drizzle/sqlite/0004_project_machines.sql +19 -0
  149. package/server/drizzle/sqlite/0005_session_events.sql +7 -0
  150. package/server/drizzle/sqlite/0006_task_platforms.sql +8 -0
  151. package/server/drizzle/sqlite/0007_session_event_tags.sql +7 -0
  152. package/server/drizzle/sqlite/0008_sprints.sql +7 -0
  153. package/server/drizzle/sqlite/0009_project_vms.sql +19 -0
  154. package/server/drizzle/sqlite/0010_server_repairs.sql +4 -0
  155. package/server/drizzle/sqlite/0011_drop_todos.sql +2 -0
  156. package/server/drizzle/sqlite/0012_hypervisors.sql +14 -0
  157. package/server/drizzle/sqlite/0013_manager_leads.sql +2 -0
  158. package/server/drizzle/sqlite/0014_session_text.sql +35 -0
  159. package/server/drizzle/sqlite/0015_vm_resize_machine_instructions_access.sql +22 -0
  160. package/server/drizzle/sqlite/0016_tunnel.sql +23 -0
  161. package/server/drizzle/sqlite/0017_session_secret_grants.sql +7 -0
  162. package/server/drizzle/sqlite/0018_https.sql +18 -0
  163. package/server/drizzle/sqlite/0019_secret_grant_runs.sql +1 -0
  164. package/server/drizzle/sqlite/0020_session_transcripts.sql +16 -0
  165. package/server/drizzle/sqlite/0021_claude_signed_out.sql +2 -0
  166. package/server/drizzle/sqlite/0022_machine_disabled.sql +1 -0
  167. package/server/drizzle/sqlite/0023_machine_access_granted_by.sql +1 -0
  168. package/server/drizzle/sqlite/0024_machine_vms.sql +27 -0
  169. package/server/drizzle/sqlite/0025_machine_tunnel_fallback.sql +1 -0
  170. package/server/drizzle/sqlite/0026_tunnel_peer_linked.sql +3 -0
  171. package/server/drizzle/sqlite/0027_tunnel_upgrade_grace.sql +2 -0
  172. package/server/drizzle/sqlite/0028_dialed_machines.sql +2 -0
  173. package/server/drizzle/sqlite/0029_node_link.sql +3 -0
  174. package/server/drizzle/sqlite/0030_sprint_calendar.sql +1 -0
  175. package/server/drizzle/sqlite/0031_transcripts_packed.sql +2 -0
  176. package/server/drizzle/sqlite/0032_vm_server_origin.sql +1 -0
  177. package/server/drizzle/sqlite/meta/_journal.json +237 -0
  178. package/server/src/account.ts +2 -0
  179. package/server/src/backup.ts +2 -0
  180. package/server/src/features/backups/backup-process.ts +2 -0
  181. package/server/src/main.ts +2 -0
  182. package/server/src/move.ts +2 -0
  183. package/ui/dist/_expo/static/css/global-d378e211074d97e633bc15418ccf57d4.css +2 -0
  184. package/ui/dist/_expo/static/css/xterm-8a7c4e0dca731c11dbe6bdff98fb667c.css +1 -0
  185. package/ui/dist/_expo/static/js/web/Network-f300a5960620f5029c91c06cae29dba5.js +3 -0
  186. package/ui/dist/_expo/static/js/web/[...rest]-9e454d985f211f5c983f42bec15b6ad9.js +1 -0
  187. package/ui/dist/_expo/static/js/web/[managerId]-2580b90e8d862ad66197eecb1dc04a12.js +1 -0
  188. package/ui/dist/_expo/static/js/web/[managerId]-39308153b42eed025c0abb9242ae6c71.js +1 -0
  189. package/ui/dist/_expo/static/js/web/[managerId]-8b7a94ec818e50a371b6b2750b73df6a.js +1 -0
  190. package/ui/dist/_expo/static/js/web/[managerId]-ac3a14c7607e4576d7e6c39c1014bcaf.js +1 -0
  191. package/ui/dist/_expo/static/js/web/[managerId]-e8549b2313a119437c373e30207518c0.js +1 -0
  192. package/ui/dist/_expo/static/js/web/[ref]-9b46f1ec4348f980e9838b68d47c34bf.js +2 -0
  193. package/ui/dist/_expo/static/js/web/[sessionId]-09e376674fb8b3edc4ae8aa9b3a189d7.js +1 -0
  194. package/ui/dist/_expo/static/js/web/[sessionId]-0e5fdba25c9f78220cea4cb66227743d.js +1 -0
  195. package/ui/dist/_expo/static/js/web/[sessionId]-104af3c3885009e6a8d204b6fd6e2c3a.js +1 -0
  196. package/ui/dist/_expo/static/js/web/[sessionId]-863a34ca3835b469134ddbc4ebc6fafc.js +1 -0
  197. package/ui/dist/_expo/static/js/web/[taskId]-1218e1dd3ecf175ffb7701fc886d62c9.js +1 -0
  198. package/ui/dist/_expo/static/js/web/[taskId]-31a48c7017dbd096f8ece9dc102a9762.js +1 -0
  199. package/ui/dist/_expo/static/js/web/[taskId]-a56cf85bcfd14f2d6b5d4180ea17e8d7.js +1 -0
  200. package/ui/dist/_expo/static/js/web/[taskId]-f2a157b3cb676b3c5d04c8eadfe90cdd.js +1 -0
  201. package/ui/dist/_expo/static/js/web/__common-1ad58e53e08528a67b99f53a1690b669.js +2078 -0
  202. package/ui/dist/_expo/static/js/web/__expo-metro-runtime-1f8f5d3ca6b7f58204d51e14506d73fb.js +5 -0
  203. package/ui/dist/_expo/static/js/web/_layout-057457e97e0af20433ed41b39cb5e809.js +1 -0
  204. package/ui/dist/_expo/static/js/web/_layout-2a7d73d5356823e1f7d2dab23e440d09.js +7 -0
  205. package/ui/dist/_expo/static/js/web/_layout-42e6a6b7855655d456015ce41aefdd39.js +1 -0
  206. package/ui/dist/_expo/static/js/web/_layout-a5e5a5b2fb3bfbfcc2914131976679e7.js +1 -0
  207. package/ui/dist/_expo/static/js/web/_layout-b2cbba92506f66815a5d744fd7cd5d8c.js +1 -0
  208. package/ui/dist/_expo/static/js/web/_layout-b4d13dc52bbcb65b18b4e52813d53883.js +198 -0
  209. package/ui/dist/_expo/static/js/web/_layout-fb0f75b354800de2e1582dc963f5c148.js +1 -0
  210. package/ui/dist/_expo/static/js/web/index-41299a961569cc8e5410ec53ba2b87c4.js +4 -0
  211. package/ui/dist/_expo/static/js/web/index-6c2bb0d3b6d00c5c007a663e9f4ce108.js +1 -0
  212. package/ui/dist/_expo/static/js/web/index-70484f7d2769d9ae01dac1fdb22aef1d.js +14 -0
  213. package/ui/dist/_expo/static/js/web/index-7d764cb7cefe0a217728c24d44990057.js +14 -0
  214. package/ui/dist/_expo/static/js/web/index-a5eb3d0c6aa4c483674beb5de428634c.js +12 -0
  215. package/ui/dist/_expo/static/js/web/index-b1c2543003cba86eeb3abfa4d21fd8da.js +14 -0
  216. package/ui/dist/_expo/static/js/web/index-d200aded5448966e5e05d9ccb77b56a4.js +5 -0
  217. package/ui/dist/_expo/static/js/web/index-ea43f51ceec4a981c942fc6dce9cedc4.js +2378 -0
  218. package/ui/dist/_expo/static/js/web/index-efa68d817a7febbf8c0163303bf4cd49.js +29 -0
  219. package/ui/dist/_expo/static/js/web/licenses-30f8c0555f7f4d434a68ee4706fa433d.js +1 -0
  220. package/ui/dist/_expo/static/js/web/pair-3f6f72208023894f43f4f07db5116cca.js +1 -0
  221. package/ui/dist/_expo/static/js/web/rich-markdown-editor-dea9c0f7c0306da4146e54ee44cce173.js +228 -0
  222. package/ui/dist/_expo/static/js/web/sign-in-67d2a0c00232e0e6f40efade1a83dc4b.js +4 -0
  223. package/ui/dist/_expo/static/js/web/terminal-view-32db8e6f8a21dd073f6a310862d36db8.js +90 -0
  224. package/ui/dist/apple-touch-icon.png +0 -0
  225. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/100Thin/GeistMono_100Thin.95eed4519d8c395e41b3b837ca97edea.ttf +0 -0
  226. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/100Thin_Italic/GeistMono_100Thin_Italic.2e50fb9a43d70ceb4925a2c54502097c.ttf +0 -0
  227. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/200ExtraLight/GeistMono_200ExtraLight.0714ea94ac265d76bc16698dd1808599.ttf +0 -0
  228. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/200ExtraLight_Italic/GeistMono_200ExtraLight_Italic.107f2670e94507223548f1d38eb14087.ttf +0 -0
  229. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/300Light/GeistMono_300Light.d6a3533adfd5834dd9f68ee37faa1e2d.ttf +0 -0
  230. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/300Light_Italic/GeistMono_300Light_Italic.09420cdceda8d1f1612daceae1e4890e.ttf +0 -0
  231. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/400Regular/GeistMono_400Regular.3656dcb247d3a6cd141f7601c2101125.ttf +0 -0
  232. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/400Regular_Italic/GeistMono_400Regular_Italic.88343c321b266476ad3bc56735cc6ac7.ttf +0 -0
  233. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/500Medium/GeistMono_500Medium.a298cd61aebdb709299e2a7deb73ed93.ttf +0 -0
  234. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/500Medium_Italic/GeistMono_500Medium_Italic.e149441dd9360bd7dbffeb1de9aa1685.ttf +0 -0
  235. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/600SemiBold/GeistMono_600SemiBold.cae945cb3b6156e396a1008b6252af21.ttf +0 -0
  236. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/600SemiBold_Italic/GeistMono_600SemiBold_Italic.e939ba436795ee2f0a379e7271bb957d.ttf +0 -0
  237. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/700Bold/GeistMono_700Bold.7fcc8478bc1dcadc865d97626ba3206b.ttf +0 -0
  238. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/700Bold_Italic/GeistMono_700Bold_Italic.8cc57ff1f3c45e7ed84e74853c141e06.ttf +0 -0
  239. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/800ExtraBold/GeistMono_800ExtraBold.b09b5457204e06ea7bacff03f0880065.ttf +0 -0
  240. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/800ExtraBold_Italic/GeistMono_800ExtraBold_Italic.0b4dd8c1b0e6d8791ea34c8f1417edfd.ttf +0 -0
  241. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/900Black/GeistMono_900Black.9ec025adf049c8a476588eeac81a36e4.ttf +0 -0
  242. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+geist-mono@0.4.3-2a25012349fb7712/node_modules/@expo-google-fonts/geist-mono/900Black_Italic/GeistMono_900Black_Italic.8dfe24b2fef43fb3d535316e2412be7d.ttf +0 -0
  243. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/100Thin/HankenGrotesk_100Thin.2d9c9415d97b66fb3bbca06b538f11d8.ttf +0 -0
  244. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/100Thin_Italic/HankenGrotesk_100Thin_Italic.5ad53da9f1ff702f55cf870763a159ff.ttf +0 -0
  245. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/200ExtraLight/HankenGrotesk_200ExtraLight.2cae1a1078b5af081aff084011b07522.ttf +0 -0
  246. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/200ExtraLight_Italic/HankenGrotesk_200ExtraLight_Italic.5d4eff887cdb33164b4fba2066c687e3.ttf +0 -0
  247. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/300Light/HankenGrotesk_300Light.2be9fd730ff95b91631e3f99bc449709.ttf +0 -0
  248. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/300Light_Italic/HankenGrotesk_300Light_Italic.4ae6910889ffdf69093da607b369b0a8.ttf +0 -0
  249. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/400Regular/HankenGrotesk_400Regular.2e544d6119b4e635f6cc5a47800523bb.ttf +0 -0
  250. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/400Regular_Italic/HankenGrotesk_400Regular_Italic.ed9d322cffe9e614205ce9512f144834.ttf +0 -0
  251. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/500Medium/HankenGrotesk_500Medium.a822d33614b51eb05478e0e29cf757f3.ttf +0 -0
  252. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/500Medium_Italic/HankenGrotesk_500Medium_Italic.bc71c45237e12974e52335b615fab7da.ttf +0 -0
  253. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/600SemiBold/HankenGrotesk_600SemiBold.b016ff502f15ce9b59c453304c74fb48.ttf +0 -0
  254. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/600SemiBold_Italic/HankenGrotesk_600SemiBold_Italic.94428d43b74e372dc47910fd4fc6b552.ttf +0 -0
  255. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/700Bold/HankenGrotesk_700Bold.14d2af6df606492d846389d2108dae50.ttf +0 -0
  256. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/700Bold_Italic/HankenGrotesk_700Bold_Italic.d075966aaf26126d8aaac0802735e310.ttf +0 -0
  257. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/800ExtraBold/HankenGrotesk_800ExtraBold.b419489745bc870b4e4288e969945f31.ttf +0 -0
  258. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/800ExtraBold_Italic/HankenGrotesk_800ExtraBold_Italic.ea7ac4778026e067a5d637f4a494b2d2.ttf +0 -0
  259. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/900Black/HankenGrotesk_900Black.55e860e6549b53fa530d9eda7c7518a2.ttf +0 -0
  260. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+hanken-grotesk@0.4.3-9a0105bf7cbf8f8b/node_modules/@expo-google-fonts/hanken-grotesk/900Black_Italic/HankenGrotesk_900Black_Italic.dcad6f722a66aae93f70a72604112754.ttf +0 -0
  261. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/200ExtraLight/Newsreader_200ExtraLight.1ee07dc260606863f8bf8101308d85f2.ttf +0 -0
  262. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/200ExtraLight_Italic/Newsreader_200ExtraLight_Italic.52c51abab458715d1205b8732b55735f.ttf +0 -0
  263. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/300Light/Newsreader_300Light.bf0dfa126654b01f65e1c53a4507ec12.ttf +0 -0
  264. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/300Light_Italic/Newsreader_300Light_Italic.03190fe46aa9b7083610981ac13b10f3.ttf +0 -0
  265. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/400Regular/Newsreader_400Regular.b1d919187d5645f84124ef065868ba9e.ttf +0 -0
  266. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/400Regular_Italic/Newsreader_400Regular_Italic.f7b81d92eb42d85de96b6dc1c72d2c36.ttf +0 -0
  267. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/500Medium/Newsreader_500Medium.df89e83cfd4e37176dda53076a01b3b7.ttf +0 -0
  268. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/500Medium_Italic/Newsreader_500Medium_Italic.fb45099c4fb3c395e8f12e181475230c.ttf +0 -0
  269. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/600SemiBold/Newsreader_600SemiBold.20bce29dc5180892ce1fbf4a563737a0.ttf +0 -0
  270. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/600SemiBold_Italic/Newsreader_600SemiBold_Italic.93e2816e201fa363d3289e741f757ff0.ttf +0 -0
  271. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/700Bold/Newsreader_700Bold.bf7c54edbd2afe9b289d5da777f489e9.ttf +0 -0
  272. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/700Bold_Italic/Newsreader_700Bold_Italic.e2f5e5260513d7d4f9f3edbdcbc9f43f.ttf +0 -0
  273. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/800ExtraBold/Newsreader_800ExtraBold.702211ca77927e4c276b28169dc3694c.ttf +0 -0
  274. package/ui/dist/assets/_____.bun/install/cache/links/@expo-google-fonts+newsreader@0.4.1-869d74885c3fd9d6/node_modules/@expo-google-fonts/newsreader/800ExtraBold_Italic/Newsreader_800ExtraBold_Italic.9b9eacc7d72e5152e692cb144ef7a9fd.ttf +0 -0
  275. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/arrow_down.017bc6ba3fc25503e5eb5e53826d48a8.png +0 -0
  276. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/error.d1ea1496f9057eb392d5bbf3732a61b7.png +0 -0
  277. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/file.19eeb73b9593a38f8e9f418337fc7d10.png +0 -0
  278. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/forward.d8b800c443b8972542883e0b9de2bdc6.png +0 -0
  279. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/pkg.ab19f4cbc543357183a20571f68380a3.png +0 -0
  280. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/drawer/toggle-drawer-icon.ae74bb20586a731af545e6b00fe14a09.png +0 -0
  281. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/back-icon-mask.0a328cd9c1afd0afe8e3b1ec5165b1b4.png +0 -0
  282. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/back-icon.35ba0eaec5a4f5ed12ca16fabeae451d.png +0 -0
  283. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55.png +0 -0
  284. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@2x.png +0 -0
  285. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@3x.png +0 -0
  286. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/clear-icon.c94f6478e7ae0cdd9f15de1fcb9e5e55@4x.png +0 -0
  287. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7.png +0 -0
  288. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@2x.png +0 -0
  289. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@3x.png +0 -0
  290. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/close-icon.808e1b1b9b53114ec2838071a7e6daa7@4x.png +0 -0
  291. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/react-navigation/elements/search-icon.286d67d3f74808a60a78d3ebf1a5fb57.png +0 -0
  292. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/sitemap.412dd9275b6b48ad28f5e3d81bb1f626.png +0 -0
  293. package/ui/dist/assets/_____.bun/install/cache/links/expo-router@57.0.24+dc951f634b001cec-a06b318b98b13101/node_modules/expo-router/assets/unmatched.20e71bdf79e3a97bf55fd9e164041578.png +0 -0
  294. package/ui/dist/favicon.ico +0 -0
  295. package/ui/dist/favicon.svg +10 -0
  296. package/ui/dist/icon-192.png +0 -0
  297. package/ui/dist/icon-512.png +0 -0
  298. package/ui/dist/index.html +45 -0
  299. package/ui/dist/legal/privacy-policy.md +174 -0
  300. package/ui/dist/legal/terms-of-use.md +76 -0
  301. package/ui/dist/load-again.js +42 -0
  302. package/ui/dist/manifest.webmanifest +12 -0
  303. package/ui/dist/metadata.json +1 -0
  304. package/ui/dist/sounds/bell.wav +0 -0
  305. package/ui/dist/sounds/chime.wav +0 -0
  306. package/ui/dist/sounds/knock.wav +0 -0
  307. package/ui/dist/sounds/pop.wav +0 -0
  308. package/ui/dist/sw.js +121 -0
@@ -0,0 +1,228 @@
1
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e=r(d[0]),n=r(d[1]),t=r(d[2]),o=r(d[3]),l=r(d[4]),s=r(d[5]),p=r(d[6]),c=r(d[7]);function u({markdown:l,look:u,onChange:x,onSave:b,onCancel:h}){const k=(0,p.useRef)(null),y=(0,p.useRef)(null),C=(0,p.useRef)({onChange:x,onSave:b,onCancel:h});C.current={onChange:x,onSave:b,onCancel:h},(0,p.useEffect)(()=>{const s=k.current;if(!s)return;let p,c=!1;const u=e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),C.current.onSave())},x=e=>{"Escape"===e.key&&(e.stopPropagation(),C.current.onCancel())};return s.addEventListener("keydown",u),s.addEventListener("keyup",x),e.Editor.make().config(n=>{n.set(e.rootCtx,s),n.set(e.defaultValueCtx,l)}).use(t.commonmark).use(o.gfm).use(n.history).use(f(e=>C.current.onChange(e))).create().then(n=>{c?n.destroy():(p=n,y.current=n,n.action(n=>n.get(e.editorViewCtx).focus()))}),()=>{c=!0,s.removeEventListener("keydown",u),s.removeEventListener("keyup",x),p?.destroy(),y.current=null}},[]);const w=(n,t)=>{y.current?.action((0,s.callCommand)(n.key,t)),y.current?.action(n=>n.get(e.editorViewCtx).focus())},v=[{label:"Heading",text:"H",style:{fontWeight:600},run:()=>w(t.wrapInHeadingCommand,2)},{label:"Bold",text:"B",style:{fontWeight:700},run:()=>w(t.toggleStrongCommand)},{label:"Italic",text:"I",style:{fontStyle:"italic"},run:()=>w(t.toggleEmphasisCommand)},{label:"Strikethrough",text:"S",style:{textDecoration:"line-through"},run:()=>w(o.toggleStrikethroughCommand)},{label:"Bulleted list",text:"\u2022 List",run:()=>w(t.wrapInBulletListCommand)},{label:"Numbered list",text:"1. List",run:()=>w(t.wrapInOrderedListCommand)},{label:"Quote",text:"\u201c Quote",run:()=>w(t.wrapInBlockquoteCommand)},{label:"Inline code",text:"`code`",style:{fontFamily:u.mono},run:()=>w(t.toggleInlineCodeCommand)},{label:"Code block",text:"{ } Block",style:{fontFamily:u.mono},run:()=>w(t.createCodeBlockCommand)},{label:"Link",text:"Link",style:{textDecoration:"underline"},run:()=>{const e=window.prompt("Link address");e&&w(t.toggleLinkCommand,{href:e})}},{label:"Table",text:"Table",run:()=>w(o.insertTableCommand,{row:3,col:3})}];return(0,c.jsxs)("div",{className:"sf-md",children:[(0,c.jsx)("style",{children:($=u,`\nhtml, body { margin: 0; background: transparent; }\n.sf-md { color: ${$.ink}; font-family: ${$.sans}; font-size: 16px; line-height: 1.625; }\n.sf-md-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid ${$.line}; }\n.sf-md-tools button { all: unset; cursor: pointer; min-width: 32px; height: 32px; padding: 0 8px; box-sizing: border-box;\n display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: ${$.ink2}; font-size: 14px; }\n.sf-md-tools button:hover { background: ${$.sunken}; color: ${$.ink}; }\n.sf-md-tools button:focus-visible { outline: 2px solid ${$.accent}; }\n.sf-md-body { padding: 12px 14px; }\n.sf-md .ProseMirror { outline: none; min-height: 180px; white-space: pre-wrap; word-wrap: break-word; }\n.sf-md .ProseMirror > :first-child { margin-top: 0; }\n.sf-md .ProseMirror > :last-child { margin-bottom: 0; }\n.sf-md p { margin: 0 0 12px; }\n.sf-md h1, .sf-md h2, .sf-md h3, .sf-md h4 { font-weight: 600; margin: 18px 0 8px; line-height: 1.3; }\n.sf-md h1 { font-size: 20px; } .sf-md h2 { font-size: 17px; } .sf-md h3, .sf-md h4 { font-size: 15px; }\n.sf-md ul, .sf-md ol { margin: 0 0 12px; padding-left: 24px; }\n.sf-md li > p { margin: 0 0 4px; }\n.sf-md li[data-item-type="task"] { list-style: none; position: relative; }\n.sf-md li[data-item-type="task"]::before { content: "\u2610"; position: absolute; left: -22px; color: ${$.ink3}; }\n.sf-md li[data-item-type="task"][data-checked="true"]::before { content: "\u2611"; }\n.sf-md blockquote { margin: 0 0 12px; padding-left: 12px; border-left: 2px solid ${$.line}; color: ${$.ink2}; }\n.sf-md code { font-family: ${$.mono}; font-size: 0.875em; background: ${$.sunken}; border-radius: 4px; padding: 1px 4px; }\n.sf-md pre { font-family: ${$.mono}; background: ${$.sunken}; border: 1px solid ${$.line}; border-radius: 8px;\n padding: 10px 12px; overflow-x: auto; margin: 0 0 12px; white-space: pre; }\n.sf-md pre code { background: none; padding: 0; }\n.sf-md a { color: ${$.accent}; text-decoration: underline; }\n.sf-md hr { border: none; border-top: 1px solid ${$.line}; margin: 16px 0; }\n.sf-md table { border-collapse: collapse; margin: 0 0 12px; font-size: 14px; }\n.sf-md th, .sf-md td { border: 1px solid ${$.line}; padding: 6px 10px; min-width: 60px; vertical-align: top; }\n.sf-md th { background: ${$.sunken}; font-weight: 600; }\n.sf-md td > p, .sf-md th > p { margin: 0; }\n.sf-md .selectedCell { background: ${$.sunken}; }\n.sf-md .ProseMirror-selectednode { outline: 2px solid ${$.accent}; }\n.sf-md .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }\n.sf-md .ProseMirror-focused .ProseMirror-gapcursor { display: block; }\n`)}),(0,c.jsx)("div",{className:"sf-md-tools",role:"toolbar","aria-label":"Formatting",children:v.map(e=>(0,c.jsx)("button",{type:"button",title:e.label,"aria-label":e.label,onMouseDown:e=>e.preventDefault(),onClick:e.run,style:e.style,children:e.text},e.label))}),(0,c.jsx)("div",{ref:k,className:"sf-md-body","data-testid":"rich-editor"})]});var $}function f(n){return(0,s.$prose)(t=>new l.Plugin({view:()=>({update:(o,l)=>{o.state.doc.eq(l.doc)||n(t.get(e.serializerCtx)(o.state.doc))}})}))}},2463,[2464,2628,2636,2645,2689,2690,224,467]);
2
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2464,[2465]);
3
+ __d(function(g,r,i,_a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CommandManager",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(_e,"CommandsReady",{enumerable:!0,get:function(){return F}}),Object.defineProperty(_e,"ConfigReady",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"Editor",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(_e,"EditorStateReady",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(_e,"EditorStatus",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(_e,"EditorViewReady",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"InitReady",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"KeymapManager",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"KeymapReady",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(_e,"ParserReady",{enumerable:!0,get:function(){return te}}),Object.defineProperty(_e,"PasteRulesReady",{enumerable:!0,get:function(){return je}}),Object.defineProperty(_e,"SchemaReady",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"SerializerReady",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(_e,"commands",{enumerable:!0,get:function(){return G}}),Object.defineProperty(_e,"commandsCtx",{enumerable:!0,get:function(){return J}}),Object.defineProperty(_e,"commandsTimerCtx",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"config",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"createCmdKey",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"defaultValueCtx",{enumerable:!0,get:function(){return me}}),Object.defineProperty(_e,"editorCtx",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"editorState",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"editorStateCtx",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"editorStateOptionsCtx",{enumerable:!0,get:function(){return de}}),Object.defineProperty(_e,"editorStateTimerCtx",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"editorView",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(_e,"editorViewCtx",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"editorViewOptionsCtx",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(_e,"editorViewTimerCtx",{enumerable:!0,get:function(){return we}}),Object.defineProperty(_e,"getDoc",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"init",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"initTimerCtx",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"inputRulesCtx",{enumerable:!0,get:function(){return v}}),Object.defineProperty(_e,"keymap",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(_e,"keymapCtx",{enumerable:!0,get:function(){return U}}),Object.defineProperty(_e,"keymapTimerCtx",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_e,"markViewCtx",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"marksCtx",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"nodeViewCtx",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"nodesCtx",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"parser",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(_e,"parserCtx",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(_e,"parserTimerCtx",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"pasteRule",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(_e,"pasteRulesCtx",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"pasteRulesTimerCtx",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(_e,"prosePluginsCtx",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"remarkCtx",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"remarkPluginsCtx",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"remarkStringifyOptionsCtx",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"rootAttrsCtx",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(_e,"rootCtx",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"rootDOMCtx",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(_e,"schema",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"schemaCtx",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"schemaTimerCtx",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"serializer",{enumerable:!0,get:function(){return le}}),Object.defineProperty(_e,"serializerCtx",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(_e,"serializerTimerCtx",{enumerable:!0,get:function(){return ce}});var t=r(d[0]),n=e(r(d[1])),a=e(r(d[2])),o=r(d[3]),c=r(d[4]),s=r(d[5]),u=r(d[6]),l=r(d[7]),p=r(d[8]),f=r(d[9]),h=r(d[10]),y=r(d[11]),b=r(d[12]);function P(e,t){return e.meta={package:"@milkdown/core",group:"System",...t},e}var j={text:(e,t,n,a)=>{const o=e.value;return/^[^*_\\]*\s+$/.test(o)?o:n.safe(o,{...a,encode:[]})},strong:(e,t,n,a)=>{const o=e.marker||n.options.strong||"*",c=n.enter("strong"),s=n.createTracker(a);let u=s.move(o+o);return u+=s.move(n.containerPhrasing(e,{before:u,after:o,...s.current()})),u+=s.move(o+o),c(),u},emphasis:(e,t,n,a)=>{const o=e.marker||n.options.emphasis||"*",c=n.enter("emphasis"),s=n.createTracker(a);let u=s.move(o);return u+=s.move(n.containerPhrasing(e,{before:u,after:o,...s.current()})),u+=s.move(o),c(),u}},O=(0,t.createSlice)({},"editorView"),S=(0,t.createSlice)({},"editorState"),w=(0,t.createSlice)([],"initTimer"),C=(0,t.createSlice)({},"editor"),v=(0,t.createSlice)([],"inputRules"),x=(0,t.createSlice)([],"prosePlugins"),k=(0,t.createSlice)([],"remarkPlugins"),T=(0,t.createSlice)([],"nodeView"),R=(0,t.createSlice)([],"markView"),E=(0,t.createSlice)((0,o.unified)().use(n.default).use(a.default),"remark"),I=(0,t.createSlice)({handlers:j,encode:[]},"remarkStringifyOptions"),V=(0,t.createTimer)("ConfigReady");function N(e){const t=t=>(t.record(V),async()=>(await e(t),t.done(V),()=>{t.clearTimer(V)}));return P(t,{displayName:"Config"}),t}var D=(0,t.createTimer)("InitReady");function M(e){const t=t=>(t.inject(C,e).inject(x,[]).inject(k,[]).inject(v,[]).inject(T,[]).inject(R,[]).inject(I,{handlers:j,encode:[]}).inject(E,(0,o.unified)().use(n.default).use(a.default)).inject(w,[V]).record(D),async()=>{await t.waitTimers(w);const e=t.get(I);return t.set(E,(0,o.unified)().use(n.default).use(a.default,e)),t.done(D),()=>{t.remove(C).remove(x).remove(k).remove(v).remove(T).remove(R).remove(I).remove(E).remove(w).clearTimer(D)}});return P(t,{displayName:"Init"}),t}var K=(0,t.createTimer)("SchemaReady"),L=(0,t.createSlice)([],"schemaTimer"),_=(0,t.createSlice)({},"schema"),z=(0,t.createSlice)([],"nodes"),B=(0,t.createSlice)([],"marks");function A(e){return{...e,parseDOM:e.parseDOM?.map(t=>({priority:e.priority,...t}))}}var W=e=>(e.inject(_,{}).inject(z,[]).inject(B,[]).inject(L,[D]).record(K),async()=>{await e.waitTimers(L);const t=e.get(E),n=e.get(k).reduce((e,t)=>e.use(t.plugin,t.options),t);e.set(E,n);const a=Object.fromEntries(e.get(z).map(([e,t])=>[e,A(t)])),o=Object.fromEntries(e.get(B).map(([e,t])=>[e,A(t)])),c=new u.Schema({nodes:a,marks:o});return e.set(_,c),e.done(K),()=>{e.remove(_).remove(z).remove(B).remove(L).clearTimer(K)}});P(W,{displayName:"Schema"});var Y=class{constructor(){this.#e=new t.Container,this.#t=null,this.setCtx=e=>{this.#t=e},this.chain=()=>{if(null==this.#t)throw(0,c.callCommandBeforeEditorView)();const e=this.#t,t=[],n=this.get.bind(this),a={run:()=>{const n=(0,s.chainCommands)(...t),a=e.get(O);return n(a.state,a.dispatch,a)},inline:e=>(t.push(e),a),pipe:function(e,o){const c=n(e);return t.push(c(o)),a}.bind(this)};return a}}#e;#t;get ctx(){return this.#t}create(e,t){const n=e.create(this.#e.sliceMap);return n.set(t),n}get(e){return this.#e.get(e).get()}remove(e){return this.#e.remove(e)}call(e,t){if(null==this.#t)throw(0,c.callCommandBeforeEditorView)();const n=this.get(e)(t),a=this.#t.get(O);return n(a.state,a.dispatch,a)}inline(e){if(null==this.#t)throw(0,c.callCommandBeforeEditorView)();const t=this.#t.get(O);return e(t.state,t.dispatch,t)}};function q(e="cmdKey"){return(0,t.createSlice)(()=>()=>!1,e)}var J=(0,t.createSlice)(new Y,"commands"),$=(0,t.createSlice)([K],"commandsTimer"),F=(0,t.createTimer)("CommandsReady"),G=e=>{const t=new Y;return t.setCtx(e),e.inject(J,t).inject($,[K]).record(F),async()=>(await e.waitTimers($),e.done(F),()=>{e.remove(J).remove($).clearTimer(F)})};function H(e){return e.Backspace=(0,s.chainCommands)(h.undoInputRule,s.deleteSelection,s.joinTextblockBackward,s.selectNodeBackward),e}P(G,{displayName:"Commands"});var Q=class{constructor(){this.#t=null,this.#r=[],this.setCtx=e=>{this.#t=e},this.add=e=>(this.#r.push(e),()=>{this.#r=this.#r.filter(t=>t!==e)}),this.addObjectKeymap=e=>{const t=[];return Object.entries(e).forEach(([e,n])=>{if("function"==typeof n){const a={key:e,onRun:()=>n};this.#r.push(a),t.push(()=>{this.#r=this.#r.filter(e=>e!==a)})}else this.#r.push(n),t.push(()=>{this.#r=this.#r.filter(e=>e!==n)})}),()=>{t.forEach(e=>e())}},this.addBaseKeymap=()=>{const e=H(s.baseKeymap);return this.addObjectKeymap(e)},this.build=()=>{const e={};return this.#r.forEach(t=>{e[t.key]=[...e[t.key]||[],t]}),Object.fromEntries(Object.entries(e).map(([e,t])=>{const n=t.sort((e,t)=>(t.priority??50)-(e.priority??50));return[e,(e,t,a)=>{const o=this.#t;if(null==o)throw(0,c.ctxCallOutOfScope)();const u=n.map(e=>e.onRun(o));return(0,s.chainCommands)(...u)(e,t,a)}]}))}}#t;#r;get ctx(){return this.#t}},U=(0,t.createSlice)(new Q,"keymap"),X=(0,t.createSlice)([K],"keymapTimer"),Z=(0,t.createTimer)("KeymapReady"),ee=e=>{const t=new Q;return t.setCtx(e),e.inject(U,t).inject(X,[K]).record(Z),async()=>(await e.waitTimers(X),e.done(Z),()=>{e.remove(U).remove(X).clearTimer(Z)})},te=(0,t.createTimer)("ParserReady"),re=()=>{throw(0,c.ctxCallOutOfScope)()},ne=(0,t.createSlice)(re,"parser"),ie=(0,t.createSlice)([],"parserTimer"),ae=e=>(e.inject(ne,re).inject(ie,[K]).record(te),async()=>{await e.waitTimers(ie);const t=e.get(E),n=e.get(_);return e.set(ne,y.ParserState.create(n,t)),e.done(te),()=>{e.remove(ne).remove(ie).clearTimer(te)}});P(ae,{displayName:"Parser"});var oe=(0,t.createTimer)("SerializerReady"),ce=(0,t.createSlice)([],"serializerTimer"),se=()=>{throw(0,c.ctxCallOutOfScope)()},ue=(0,t.createSlice)(se,"serializer"),le=e=>(e.inject(ue,se).inject(ce,[K]).record(oe),async()=>{await e.waitTimers(ce);const t=e.get(E),n=e.get(_);return e.set(ue,y.SerializerState.create(n,t)),e.done(oe),()=>{e.remove(ue).remove(ce).clearTimer(oe)}});P(le,{displayName:"Serializer"});var me=(0,t.createSlice)("","defaultValue"),de=(0,t.createSlice)(e=>e,"stateOptions"),pe=(0,t.createSlice)([],"editorStateTimer"),fe=(0,t.createTimer)("EditorStateReady");function he(e,t,n){if("string"==typeof e)return t(e);if("html"===e.type)return u.DOMParser.fromSchema(n).parse(e.dom);if("json"===e.type)return u.Node.fromJSON(n,e.value);throw(0,c.docTypeError)(e)}var ye=new f.PluginKey("MILKDOWN_STATE_TRACKER"),ge=e=>(e.inject(me,"").inject(S,{}).inject(de,e=>e).inject(pe,[te,oe,F,Z]).record(fe),async()=>{await e.waitTimers(pe);const t=e.get(_),n=e.get(ne),a=e.get(v),o=e.get(de),c=e.get(x),s=he(e.get(me),n,t),u=e.get(U),h=u.addBaseKeymap(),y=[...c,new f.Plugin({key:ye,state:{init:()=>{},apply:(t,n,a,o)=>{e.set(S,o)}}}),(0,l.customInputRules)({rules:a}),(0,p.keymap)(u.build())];e.set(x,y);const b=o({schema:t,doc:s,plugins:y}),P=f.EditorState.create(b);return e.set(S,P),e.done(fe),()=>{h(),e.remove(me).remove(S).remove(de).remove(pe).clearTimer(fe)}});P(ge,{displayName:"EditorState"});var be=(0,t.createSlice)([],"pasteRule"),Pe=(0,t.createSlice)([K],"pasteRuleTimer"),je=(0,t.createTimer)("PasteRuleReady"),Oe=e=>(e.inject(be,[]).inject(Pe,[K]).record(je),async()=>(await e.waitTimers(Pe),e.done(je),()=>{e.remove(be).remove(Pe).clearTimer(je)}));P(Oe,{displayName:"PasteRule"});var Se=(0,t.createTimer)("EditorViewReady"),we=(0,t.createSlice)([],"editorViewTimer"),Ce=(0,t.createSlice)({},"editorViewOptions"),ve=(0,t.createSlice)(null,"root"),xe=(0,t.createSlice)(null,"rootDOM"),ke=(0,t.createSlice)({},"rootAttrs");function Te(e,t){const n=document.createElement("div");n.className="milkdown",e.appendChild(n),t.set(xe,n);const a=t.get(ke);return Object.entries(a).forEach(([e,t])=>n.setAttribute(e,t)),n}var Re=new f.PluginKey("MILKDOWN_VIEW_CLEAR"),Ee=e=>(e.inject(ve,document.body).inject(O,{}).inject(Ce,{}).inject(xe,null).inject(ke,{}).inject(we,[fe,je]).record(Se),async()=>{await e.wait(D);const t=e.get(ve)||document.body,n="string"==typeof t?document.querySelector(t):t;e.update(x,t=>[new f.Plugin({key:Re,view:t=>{const a=n?Te(n,e):void 0;return(()=>{if(a&&n){const e=t.dom;n.replaceChild(a,e),a.appendChild(e)}})(),{destroy:()=>{a?.parentNode&&a?.parentNode.replaceChild(t.dom,a),a?.remove()}}}}),...t]),await e.waitTimers(we);const a=e.get(S),o=e.get(Ce),c=Object.fromEntries(e.get(T)),s=Object.fromEntries(e.get(R)),u=new b.EditorView(n,{state:a,nodeViews:c,markViews:s,transformPasted:(t,n,a)=>(e.get(be).sort((e,t)=>(t.priority??50)-(e.priority??50)).map(e=>e.run).forEach(e=>{t=e(t,n,a)}),t),...o});var l;return(l=u.dom).classList.add("editor"),l.setAttribute("role","textbox"),e.set(O,u),e.done(Se),()=>{u?.destroy(),e.remove(ve).remove(O).remove(Ce).remove(xe).remove(ke).remove(we).clearTimer(Se)}});P(Ee,{displayName:"EditorView"});var Ie=(function(e){return e.Idle="Idle",e.OnCreate="OnCreate",e.Created="Created",e.OnDestroy="OnDestroy",e.Destroyed="Destroyed",e})({}),Ve=class e{constructor(){this.#n=!1,this.#i="Idle",this.#a=[],this.#o=()=>{},this.#e=new t.Container,this.#c=new t.Clock,this.#s=new Map,this.#u=new Map,this.#t=new t.Ctx(this.#e,this.#c),this.#l=()=>{const e=N(async e=>{await Promise.all(this.#a.map(t=>Promise.resolve(t(e))))}),t=[W,ae,le,G,ee,Oe,ge,Ee,M(this),e];this.#m(t,this.#u)},this.#m=(e,t)=>{e.forEach(e=>{const n=this.#t.produce(this.#n?e.meta:void 0),a=e(n);t.set(e,{ctx:n,handler:a,cleanup:void 0})})},this.#d=(e,t=!1)=>Promise.all([e].flat().map(async e=>{const n=this.#s.get(e)?.cleanup;return t?this.#s.delete(e):this.#s.set(e,{ctx:void 0,handler:void 0,cleanup:void 0}),"function"==typeof n?n():n})),this.#p=async()=>{await Promise.all([...this.#u.entries()].map(async([e,{cleanup:t}])=>"function"==typeof t?t():t)),this.#u.clear()},this.#f=e=>{this.#i=e,this.#o(e)},this.#h=e=>[...e.entries()].map(async([t,n])=>{const{ctx:a,handler:o}=n;if(!o)return;const c=await o();e.set(t,{ctx:a,handler:o,cleanup:c})}),this.enableInspector=(e=!0)=>(this.#n=e,this),this.onStatusChange=e=>(this.#o=e,this),this.config=e=>(this.#a.push(e),this),this.removeConfig=e=>(this.#a=this.#a.filter(t=>t!==e),this),this.use=e=>{const t=[e].flat();return t.flat().forEach(e=>{this.#s.set(e,{ctx:void 0,handler:void 0,cleanup:void 0})}),"Created"===this.#i&&this.#m(t,this.#s),this},this.remove=async e=>"OnCreate"===this.#i?(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.#d([e].flat(),!0),this),this.create=async()=>("OnCreate"===this.#i||("Created"===this.#i&&await this.destroy(),this.#f("OnCreate"),this.#l(),this.#m([...this.#s.keys()],this.#s),await Promise.all([this.#h(this.#u),this.#h(this.#s)].flat()),this.#f("Created")),this),this.destroy=async(e=!1)=>"Destroyed"===this.#i||"OnDestroy"===this.#i?this:"OnCreate"===this.#i?new Promise(t=>{setTimeout(()=>{t(this.destroy(e))},50)}):(e&&(this.#a=[]),this.#f("OnDestroy"),await this.#d([...this.#s.keys()],e),await this.#p(),this.#f("Destroyed"),this),this.action=e=>e(this.#t),this.inspect=()=>this.#n?[...this.#u.values(),...this.#s.values()].map(({ctx:e})=>e?.inspector?.read()).filter(e=>Boolean(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}#n;#i;#a;#o;#e;#c;#s;#u;#t;#l;#m;#d;#p;#f;#h;get ctx(){return this.#t}get status(){return this.#i}}},2465,[2466,2468,2531,2594,2467,2611,2617,2618,2620,2623,2624,2625,2626]);
4
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Clock",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"Container",{enumerable:!0,get:function(){return e}}),Object.defineProperty(_e,"Ctx",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"Inspector",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"Slice",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"SliceType",{enumerable:!0,get:function(){return n}}),Object.defineProperty(_e,"Timer",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"TimerType",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"createSlice",{enumerable:!0,get:function(){return o}}),Object.defineProperty(_e,"createTimer",{enumerable:!0,get:function(){return f}});var t=r(d[0]),e=class{constructor(){this.sliceMap=new Map,this.get=e=>{const s="string"==typeof e?[...this.sliceMap.values()].find(t=>t.type.name===e):this.sliceMap.get(e.id);if(!s){const s="string"==typeof e?e:e.name;throw(0,t.contextNotFound)(s)}return s},this.remove=t=>{const e="string"==typeof t?[...this.sliceMap.values()].find(e=>e.type.name===t):this.sliceMap.get(t.id);e&&this.sliceMap.delete(e.type.id)},this.has=t=>"string"==typeof t?[...this.sliceMap.values()].some(e=>e.type.name===t):this.sliceMap.has(t.id)}},s=class{#t;#e;#i;constructor(t,e,s){this.#t=[],this.#i=()=>{this.#t.forEach(t=>t(this.#e))},this.set=t=>{this.#e=t,this.#i()},this.get=()=>this.#e,this.update=t=>{this.#e=t(this.#e),this.#i()},this.type=s,this.#e=e,t.set(s.id,this)}on(t){return this.#t.push(t),()=>{this.#t=this.#t.filter(e=>e!==t)}}once(t){const e=this.on(s=>{t(s),e()});return e}off(t){this.#t=this.#t.filter(e=>e!==t)}offAll(){this.#t=[]}},n=class{constructor(e,s){this.id=Symbol(`Context-${s}`),this.name=s,this._defaultValue=e,this._typeInfo=()=>{throw(0,t.ctxCallOutOfScope)()}}create(t,e=this._defaultValue){return new s(t,e,this)}},o=(t,e)=>new n(t,e),h=class{#s;#n;#r;#o;#h;#c;#a;constructor(t,e,s){this.#o=new Set,this.#h=new Set,this.#c=new Map,this.#a=new Map,this.read=()=>({metadata:this.#s,injectedSlices:[...this.#o].map(t=>({name:"string"==typeof t?t:t.name,value:this.#u(t)})),consumedSlices:[...this.#h].map(t=>({name:"string"==typeof t?t:t.name,value:this.#u(t)})),recordedTimers:[...this.#c].map(([t,{duration:e}])=>({name:t.name,duration:e,status:this.#l(t)})),waitTimers:[...this.#a].map(([t,{duration:e}])=>({name:t.name,duration:e,status:this.#l(t)}))}),this.onRecord=t=>{this.#c.set(t,{start:Date.now(),duration:0})},this.onClear=t=>{this.#c.delete(t)},this.onDone=t=>{const e=this.#c.get(t);e&&(e.duration=Date.now()-e.start)},this.onWait=(t,e)=>{const s=Date.now();e.finally(()=>{this.#a.set(t,{duration:Date.now()-s})}).catch(console.error)},this.onInject=t=>{this.#o.add(t)},this.onRemove=t=>{this.#o.delete(t)},this.onUse=t=>{this.#h.add(t)},this.#u=t=>this.#n.get(t).get(),this.#l=t=>this.#r.get(t).status,this.#n=t,this.#r=e,this.#s=s}#u;#l},c=class t{#n;#r;#s;#m;constructor(e,s,n){this.produce=e=>e&&Object.keys(e).length?new t(this.#n,this.#r,{...e}):this,this.inject=(t,e)=>{const s=t.create(this.#n.sliceMap);return null!=e&&s.set(e),this.#m?.onInject(t),this},this.remove=t=>(this.#n.remove(t),this.#m?.onRemove(t),this),this.record=t=>(t.create(this.#r.store),this.#m?.onRecord(t),this),this.clearTimer=t=>(this.#r.remove(t),this.#m?.onClear(t),this),this.isInjected=t=>this.#n.has(t),this.isRecorded=t=>this.#r.has(t),this.use=t=>(this.#m?.onUse(t),this.#n.get(t)),this.get=t=>this.use(t).get(),this.set=(t,e)=>this.use(t).set(e),this.update=(t,e)=>this.use(t).update(e),this.timer=t=>this.#r.get(t),this.done=t=>{this.timer(t).done(),this.#m?.onDone(t)},this.wait=t=>{const e=this.timer(t).start();return this.#m?.onWait(t,e),e},this.waitTimers=async t=>{await Promise.all(this.get(t).map(t=>this.wait(t)))},this.#n=e,this.#r=s,this.#s=n,n&&(this.#m=new h(e,s,n))}get meta(){return this.#s}get inspector(){return this.#m}},u=class{constructor(){this.store=new Map,this.get=e=>{const s=this.store.get(e.id);if(!s)throw(0,t.timerNotFound)(e.name);return s},this.remove=t=>{this.store.delete(t.id)},this.has=t=>this.store.has(t.id)}},l=class{#d;#p;#g;#f;#w;constructor(t,e){this.#d=null,this.#p=null,this.#f="pending",this.#w=null,this.start=()=>(this.#d??=new Promise((t,e)=>{this.#p=e=>{e instanceof CustomEvent&&e.detail.id===this.#g&&(this.#f="resolved",this.#y(),e.stopImmediatePropagation(),t())},this.#v(()=>{"pending"===this.#f&&(this.#f="rejected"),this.#y(),e(new Error(`Timing ${this.type.name} timeout.`))}),this.#f="pending",addEventListener(this.type.name,this.#p)}),this.#d),this.done=()=>{const t=new CustomEvent(this.type.name,{detail:{id:this.#g}});dispatchEvent(t)},this.#y=()=>{null!==this.#w&&(clearTimeout(this.#w),this.#w=null),this.#p&&removeEventListener(this.type.name,this.#p)},this.#v=t=>{this.#w=setTimeout(()=>{this.#w=null,t()},this.type.timeout)},this.#g=Symbol(e.name),this.type=e,t.set(e.id,this)}get status(){return this.#f}#y;#v},p=class{constructor(t,e=3e3){this.create=t=>new l(t,this),this.id=Symbol(`Timer-${t}`),this.name=t,this.timeout=e}},f=(t,e=3e3)=>new p(t,e)},2466,[2467]);
5
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ErrorCode",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"MilkdownError",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"aiBuildContextError",{enumerable:!0,get:function(){return M}}),Object.defineProperty(e,"aiProviderError",{enumerable:!0,get:function(){return C}}),Object.defineProperty(e,"callCommandBeforeEditorView",{enumerable:!0,get:function(){return w}}),Object.defineProperty(e,"contextNotFound",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"createNodeInParserFail",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"ctxCallOutOfScope",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"ctxNotBind",{enumerable:!0,get:function(){return x}}),Object.defineProperty(e,"docTypeError",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"expectDomTypeError",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"getAtomFromSchemaFail",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"missingMarkInSchema",{enumerable:!0,get:function(){return N}}),Object.defineProperty(e,"missingNodeInSchema",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"missingRootElement",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"missingYjsDoc",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"parserMatchError",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"serializerMatchError",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"stackOverFlow",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"timerNotFound",{enumerable:!0,get:function(){return f}});var n=(function(n){return n.docTypeError="docTypeError",n.contextNotFound="contextNotFound",n.timerNotFound="timerNotFound",n.ctxCallOutOfScope="ctxCallOutOfScope",n.createNodeInParserFail="createNodeInParserFail",n.stackOverFlow="stackOverFlow",n.parserMatchError="parserMatchError",n.serializerMatchError="serializerMatchError",n.getAtomFromSchemaFail="getAtomFromSchemaFail",n.expectDomTypeError="expectDomTypeError",n.callCommandBeforeEditorView="callCommandBeforeEditorView",n.missingRootElement="missingRootElement",n.missingNodeInSchema="missingNodeInSchema",n.missingMarkInSchema="missingMarkInSchema",n.ctxNotBind="ctxNotBind",n.missingYjsDoc="missingYjsDoc",n.aiProviderError="aiProviderError",n.aiBuildContextError="aiBuildContextError",n})({}),t=class extends Error{constructor(n,t,o){super(t,o),this.name="MilkdownError",this.code=n,void 0!==o?.cause&&(this.cause=o.cause)}},o=(n,t)=>"function"==typeof t?"[Function]":t,c=n=>JSON.stringify(n,o);function u(o){return new t(n.docTypeError,`Doc type error, unsupported type: ${c(o)}`)}function s(o){return new t(n.contextNotFound,`Context "${o}" not found, do you forget to inject it?`)}function f(o){return new t(n.timerNotFound,`Timer "${o}" not found, do you forget to record it?`)}function l(){return new t(n.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function p(o,c,u){const s=`Cannot create node for ${"name"in o?o.name:o}`,f=n=>{if(null==n)return"null";if(Array.isArray(n))return`[${n.map(f).join(", ")}]`;if("object"==typeof n)return"toJSON"in n&&"function"==typeof n.toJSON?JSON.stringify(n.toJSON()):"spec"in n?JSON.stringify(n.spec):JSON.stringify(n);if("string"==typeof n||"number"==typeof n||"boolean"==typeof n)return JSON.stringify(n);if("function"==typeof n)return`[Function: ${n.name||"anonymous"}]`;try{return String(n)}catch{return"[Unserializable]"}},l=[["[Description]",s],["[Attributes]",c],["[Content]",(u??[]).map(n=>n?"object"==typeof n&&"type"in n?`${n}`:f(n):"null")]].reduce((n,[t,o])=>{const c=`${t}: ${f(o)}.`;return n.concat(c)},[]);return new t(n.createNodeInParserFail,l.join("\n"))}function b(){return new t(n.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function y(o){return new t(n.parserMatchError,`Cannot match target parser for node: ${c(o)}.`)}function O(o){return new t(n.serializerMatchError,`Cannot match target serializer for node: ${c(o)}.`)}function h(o,c){return new t(n.getAtomFromSchemaFail,`Cannot get ${o}: ${c} from schema.`)}function E(o){return new t(n.expectDomTypeError,`Expect to be a dom, but get: ${c(o)}.`)}function w(){return new t(n.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}function j(){return new t(n.missingRootElement,"Missing root element, milkdown cannot find root element of the editor.")}function P(o){return new t(n.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${o}" in schema.`)}function N(o){return new t(n.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${o}" in schema.`)}function x(){return new t(n.ctxNotBind,"Context not bind, please make sure the plugin has been initialized.")}function S(){return new t(n.missingYjsDoc,"Missing yjs doc, please make sure you have bind one.")}function F(n){try{return c(n)}catch{return"[Unserializable]"}}function C(o){const c=o instanceof Error?o.message:F(o);return new t(n.aiProviderError,`AI provider error: ${c}`,{cause:o})}function M(o){const c=o instanceof Error?o.message:F(o);return new t(n.aiBuildContextError,`AI buildContext failed: ${c}`,{cause:o})}},2467,[]);
6
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},2468,[2469]);
7
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=r(d[0]);function n(n){const o=this;o.parser=function(s){return(0,t.fromMarkdown)(s,{...o.data('settings'),...n,extensions:o.data('micromarkExtensions')||[],mdastExtensions:o.data('fromMarkdownExtensions')||[]})}}},2469,[2470]);
8
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"fromMarkdown",{enumerable:!0,get:function(){return n.fromMarkdown}});var n=r(d[0])},2470,[2471]);
9
+ __d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fromMarkdown=function(t,s,c){s&&'object'==typeof s&&(c=s,s=void 0);return u(c)((0,n.postprocess)((0,n.parse)(c).document().write((0,n.preprocess)()(t,s,!0))))};var t=r(_d[0]),n=r(_d[1]),s=r(_d[2]),c=r(_d[3]),o=r(_d[4]),l=r(_d[5]),h=r(_d[6]);const d={}.hasOwnProperty;function u(n){const u={afterExit:[],beforeEnter:[],transforms:[],canContainEols:['emphasis','fragment','heading','paragraph','strong'],enter:{autolink:S(O),autolinkProtocol:F,autolinkEmail:F,atxHeading:S(H),blockQuote:S(function(){return{type:'blockquote',children:[],position:void 0}}),characterEscape:F,characterReference:F,codeFenced:S(C),codeFencedFenceInfo:b,codeFencedFenceMeta:b,codeIndented:S(C,b),codeText:S(function(){return{type:'inlineCode',value:'',position:void 0}},b),codeTextData:F,data:F,codeFlowValue:F,definition:S(function(){return{type:'definition',identifier:'',label:null,title:null,url:'',position:void 0}}),definitionDestinationString:b,definitionLabelString:b,definitionTitleString:b,emphasis:S(function(){return{type:'emphasis',children:[],position:void 0}}),hardBreakEscape:S(B),hardBreakTrailing:S(B),htmlFlow:S(L,b),htmlFlowData:F,htmlText:S(L,b),htmlTextData:F,image:S(function(){return{type:'image',title:null,url:'',alt:null,position:void 0}}),label:b,link:S(O),listItem:S(function(t){return{type:'listItem',spread:t._spread,checked:null,children:[],position:void 0}}),listItemValue:function(t){if(this.data.expectingFirstListItemValue){this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(t),10),this.data.expectingFirstListItemValue=void 0}},listOrdered:S(D,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:S(D),paragraph:S(function(){return{type:'paragraph',children:[],position:void 0}}),reference:function(){this.data.referenceType='collapsed'},referenceString:b,resourceDestinationString:b,resourceTitleString:b,setextHeading:S(H),strong:S(function(){return{type:'strong',children:[],position:void 0}}),thematicBreak:S(function(){return{type:'thematicBreak',position:void 0}})},exit:{atxHeading:I(),atxHeadingSequence:function(t){const n=this.stack[this.stack.length-1];if(!n.depth){const s=this.sliceSerialize(t).length;n.depth=s}},autolink:I(),autolinkEmail:function(t){z.call(this,t);this.stack[this.stack.length-1].url='mailto:'+this.sliceSerialize(t)},autolinkProtocol:function(t){z.call(this,t);this.stack[this.stack.length-1].url=this.sliceSerialize(t)},blockQuote:I(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:R,characterReferenceMarkerNumeric:R,characterReferenceValue:function(t){const n=this.sliceSerialize(t),c=this.data.characterReferenceType;let o;if(c)o=(0,s.decodeNumericCharacterReference)(n,"characterReferenceMarkerNumeric"===c?10:16),this.data.characterReferenceType=void 0;else{o=(0,l.decodeNamedCharacterReference)(n)}this.stack[this.stack.length-1].value+=o},characterReference:function(t){this.stack.pop().position.end=f(t.end)},codeFenced:I(function(){const t=this.resume();this.stack[this.stack.length-1].value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,''),this.data.flowCodeInside=void 0}),codeFencedFence:function(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0},codeFencedFenceInfo:function(){const t=this.resume();this.stack[this.stack.length-1].lang=t},codeFencedFenceMeta:function(){const t=this.resume();this.stack[this.stack.length-1].meta=t},codeFlowValue:z,codeIndented:I(function(){const t=this.resume();this.stack[this.stack.length-1].value=t.replace(/(\r?\n|\r)$/g,'')}),codeText:I(function(){const t=this.resume();this.stack[this.stack.length-1].value=t}),codeTextData:z,data:z,definition:I(),definitionDestinationString:function(){const t=this.resume();this.stack[this.stack.length-1].url=t},definitionLabelString:function(t){const n=this.resume(),s=this.stack[this.stack.length-1];s.label=n,s.identifier=(0,o.normalizeIdentifier)(this.sliceSerialize(t)).toLowerCase()},definitionTitleString:function(){const t=this.resume();this.stack[this.stack.length-1].title=t},emphasis:I(),hardBreakEscape:I(P),hardBreakTrailing:I(P),htmlFlow:I(function(){const t=this.resume();this.stack[this.stack.length-1].value=t}),htmlFlowData:z,htmlText:I(function(){const t=this.resume();this.stack[this.stack.length-1].value=t}),htmlTextData:z,image:I(function(){const t=this.stack[this.stack.length-1];if(this.data.inReference){const n=this.data.referenceType||'shortcut';t.type+='Reference',t.referenceType=n,delete t.url,delete t.title}else delete t.identifier,delete t.label;this.data.referenceType=void 0}),label:function(){const t=this.stack[this.stack.length-1],n=this.resume(),s=this.stack[this.stack.length-1];if(this.data.inReference=!0,'link'===s.type){const n=t.children;s.children=n}else s.alt=n},labelText:function(t){const n=this.sliceSerialize(t),s=this.stack[this.stack.length-2];s.label=(0,c.decodeString)(n),s.identifier=(0,o.normalizeIdentifier)(n).toLowerCase()},lineEnding:function(t){const n=this.stack[this.stack.length-1];if(this.data.atHardBreak){return n.children[n.children.length-1].position.end=f(t.end),void(this.data.atHardBreak=void 0)}!this.data.setextHeadingSlurpLineEnding&&u.canContainEols.includes(n.type)&&(F.call(this,t),z.call(this,t))},link:I(function(){const t=this.stack[this.stack.length-1];if(this.data.inReference){const n=this.data.referenceType||'shortcut';t.type+='Reference',t.referenceType=n,delete t.url,delete t.title}else delete t.identifier,delete t.label;this.data.referenceType=void 0}),listItem:I(),listOrdered:I(),listUnordered:I(),paragraph:I(),referenceString:function(t){const n=this.resume(),s=this.stack[this.stack.length-1];s.label=n,s.identifier=(0,o.normalizeIdentifier)(this.sliceSerialize(t)).toLowerCase(),this.data.referenceType='full'},resourceDestinationString:function(){const t=this.resume();this.stack[this.stack.length-1].url=t},resourceTitleString:function(){const t=this.resume();this.stack[this.stack.length-1].title=t},resource:function(){this.data.inReference=void 0},setextHeading:I(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(t){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(t).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:I(),thematicBreak:I()}};p(u,(n||{}).mdastExtensions||[]);const k={};return function(t){let n={type:'root',children:[],position:void 0};const s={stack:[n],tokenStack:[],config:u,enter:E,exit:T,buffer:b,resume:w,data:k},c=[],o=[];let l=-1;for(;++l<t.length;)if(o.push(t[l]),"listOrdered"===t[l][1].type||"listUnordered"===t[l][1].type)if('enter'===t[l][0])c.push(o.length-1);else{x(o,c.pop())}t=o,l=-1;for(;++l<t.length;){const n=u[t[l][0]];'enter'===t[l][0]&&u.beforeEnter.length>0&&v(u.beforeEnter,{...s,sliceSerialize:t[l][2].sliceSerialize},t[l][1]),d.call(n,t[l][1].type)&&n[t[l][1].type].call({...s,sliceSerialize:t[l][2].sliceSerialize},t[l][1]),'exit'===t[l][0]&&u.afterExit.length>0&&v(u.afterExit,{...s,sliceSerialize:t[l][2].sliceSerialize},t[l][1])}if(s.tokenStack.length>0){const t=s.tokenStack[s.tokenStack.length-1];(t[1]||y).call(s,void 0,t[0])}n.position={start:f(t.length>0?t[0][1].start:{line:1,column:1,offset:0}),end:f(t.length>0?t[t.length-2][1].end:{line:1,column:1,offset:0})},l=-1;for(;++l<u.transforms.length;)n=u.transforms[l](n)||n;return n};function v(t,n,s){let c=-1;for(;++c<t.length;)t[c].call(n,s)}function x(t,n){const s=t.length-1;let c,o,l,h,d=n-1,u=-1,f=!1;const p=[];for(;++d<=s;){const n=t[d];switch(n[1].type){case"listUnordered":case"listOrdered":case"blockQuote":'enter'===n[0]?u++:u--,h=void 0;break;case"lineEndingBlank":'enter'===n[0]&&(!c||h||u||l||(l=d),h=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:h=void 0}if(!u&&'enter'===n[0]&&"listItemPrefix"===n[1].type||-1===u&&'exit'===n[0]&&("listUnordered"===n[1].type||"listOrdered"===n[1].type)){if(c){let s=d;for(o=void 0;s--;){const n=t[s];if("lineEnding"===n[1].type||"lineEndingBlank"===n[1].type){if('exit'===n[0])continue;o&&(t[o][1].type="lineEndingBlank",f=!0),n[1].type="lineEnding",o=s}else if("linePrefix"!==n[1].type&&"blockQuotePrefix"!==n[1].type&&"blockQuotePrefixWhitespace"!==n[1].type&&"blockQuoteMarker"!==n[1].type&&"listItemIndent"!==n[1].type)break}l&&(!o||l<o)&&(c._spread=!0),c.end=Object.assign({},o?t[o][1].start:n[1].end),p.push({at:o||d,event:['exit',c,n[2]]})}if("listItemPrefix"===n[1].type){const t={type:'listItem',_spread:!1,start:Object.assign({},n[1].start),end:void 0};c=t,p.push({at:d,event:['enter',t,n[2]]}),l=void 0,h=!0}}}const k=t.splice(n);let y=0;for(d=-1;++d<k.length;){for(;y<p.length&&p[y].at===n+d;)t.push(p[y++].event);t.push(k[d])}t[n][1]._spread=f}function S(t,n){return function(s){E.call(this,t(s),s),n&&n.call(this,s)}}function b(){this.stack.push({type:'fragment',children:[]})}function E(t,n,s){this.stack[this.stack.length-1].children.push(t),this.stack.push(t),this.tokenStack.push([n,s||void 0]),t.position={start:f(n.start),end:void 0}}function I(t){return function(n){t&&t.call(this,n);T.call(this,n)}}function T(t,n){const s=this.stack.pop(),c=this.tokenStack.pop();if(!c)throw new Error('Cannot close `'+t.type+'` ('+(0,h.stringifyPosition)({start:t.start,end:t.end})+'): it\u2019s not open');if(c[0].type!==t.type)if(n)n.call(this,t,c[0]);else{(c[1]||y).call(this,t,c[0])}s.position.end=f(t.end)}function w(){return(0,t.toString)(this.stack.pop())}function F(t){const n=this.stack[this.stack.length-1].children;let s=n[n.length-1];s&&'text'===s.type||(s={type:'text',value:'',position:void 0},s.position={start:f(t.start),end:void 0},n.push(s)),this.stack.push(s)}function z(t){const n=this.stack.pop();n.value+=this.sliceSerialize(t),n.position.end=f(t.end)}function P(){this.data.atHardBreak=!0}function R(t){this.data.characterReferenceType=t.type}function C(){return{type:'code',lang:null,meta:null,value:'',position:void 0}}function H(){return{type:'heading',depth:0,children:[],position:void 0}}function B(){return{type:'break',position:void 0}}function L(){return{type:'html',value:'',position:void 0}}function O(){return{type:'link',title:null,url:'',children:[],position:void 0}}function D(t){return{type:'list',ordered:'listOrdered'===t.type,start:null,spread:t._spread,children:[],position:void 0}}}function f(t){return{line:t.line,column:t.column,offset:t.offset}}function p(t,n){let s=-1;for(;++s<n.length;){const c=n[s];Array.isArray(c)?p(t,c):k(t,c)}}function k(t,n){let s;for(s in n)if(d.call(n,s))switch(s){case'canContainEols':{const c=n[s];c&&t[s].push(...c);break}case'transforms':{const c=n[s];c&&t[s].push(...c);break}case'afterExit':case'beforeEnter':{const c=n[s];c&&t[s].push(c);break}case'enter':case'exit':{const c=n[s];c&&Object.assign(t[s],c);break}}}function y(t,n){if(t)throw new Error('Cannot close `'+t.type+'` ('+(0,h.stringifyPosition)({start:t.start,end:t.end})+'): a different token (`'+n.type+'`, '+(0,h.stringifyPosition)({start:n.start,end:n.end})+') is open');throw new Error('Cannot close document, a token (`'+n.type+'`, '+(0,h.stringifyPosition)({start:n.start,end:n.end})+') is still open')}},2471,[2472,2474,2479,2528,2481,2476,2529]);
10
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"toString",{enumerable:!0,get:function(){return t.toString}});var t=r(d[0])},2472,[2473]);
11
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.toString=function(l,o){const u=o||n,c='boolean'!=typeof u.includeImageAlt||u.includeImageAlt,f='boolean'!=typeof u.includeHtml||u.includeHtml;return t(l,c,f)};const n={};function t(n,t,u){if(o(n)){if('value'in n)return'html'!==n.type||u?n.value:'';if(t&&'alt'in n&&n.alt)return n.alt;if('children'in n)return l(n.children,t,u)}return Array.isArray(n)?l(n,t,u):''}function l(n,l,o){const u=[];let c=-1;for(;++c<n.length;)u[c]=t(n[c],l,o);return u.join('')}function o(n){return Boolean(n&&'object'==typeof n)}},2473,[]);
12
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"compile",{enumerable:!0,get:function(){return t.compile}}),Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return n.parse}}),Object.defineProperty(e,"postprocess",{enumerable:!0,get:function(){return o.postprocess}}),Object.defineProperty(e,"preprocess",{enumerable:!0,get:function(){return p.preprocess}}),e.micromark=function(c,s,u){'string'!=typeof s&&(u=s,s=void 0);return(0,t.compile)(u)((0,o.postprocess)((0,n.parse)(u).document().write((0,p.preprocess)()(c,s,!0))))};var t=r(d[0]),n=r(d[1]),o=r(d[2]),p=r(d[3])},2474,[2475,2484,2526,2527]);
13
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.compile=function(S){const k=S||{};let x=!0;const E={},b=[[]],T=[],I=[],z={enter:{blockQuote:function(){I.push(!1),_(),H('<blockquote>')},codeFenced:function(){_(),H('<pre><code'),C('fencesCount',0)},codeFencedFenceInfo:y,codeFencedFenceMeta:y,codeIndented:function(){_(),H('<pre><code>')},codeText:function(){C('inCodeText',!0),H('<code>')},content:function(){C('slurpAllLineEndings',!0)},definition:function(){y(),T.push({})},definitionDestinationString:function(){y(),C('ignoreEncode',!0)},definitionLabelString:y,definitionTitleString:y,emphasis:function(){H('<em>')},htmlFlow:function(){_(),Q()},htmlText:Q,image:function(){T.push({image:!0}),x=void 0},label:y,link:function(){T.push({})},listItemMarker:function(){w('expectFirstItem')?H('>'):N();_(),H('<li>'),C('expectFirstItem'),C('lastWasTag')},listItemValue:function(n){if(w('expectFirstItem')){const t=Number.parseInt(this.sliceSerialize(n),10);1!==t&&H(' start="'+M(String(t))+'"')}},listOrdered:function(n){I.push(!n._loose),_(),H('<ol'),C('expectFirstItem',!0)},listUnordered:function(n){I.push(!n._loose),_(),H('<ul'),C('expectFirstItem',!0)},paragraph:function(){I[I.length-1]||(_(),H('<p>'));C('slurpAllLineEndings')},reference:y,resource:function(){y(),T[T.length-1].destination=''},resourceDestinationString:function(){y(),C('ignoreEncode',!0)},resourceTitleString:y,setextHeading:function(){y(),C('slurpAllLineEndings')},strong:function(){H('<strong>')}},exit:{atxHeading:function(){H('</h'+w('headingRank')+'>'),C('headingRank')},atxHeadingSequence:function(n){if(w('headingRank'))return;C('headingRank',this.sliceSerialize(n).length),_(),H('<h'+w('headingRank')+'>')},autolinkEmail:function(n){const t=this.sliceSerialize(n);H('<a href="'+(0,u.sanitizeUri)('mailto:'+t)+'">'),O(M(t)),H('</a>')},autolinkProtocol:function(n){const t=this.sliceSerialize(n);H('<a href="'+(0,u.sanitizeUri)(t,k.allowDangerousProtocol?void 0:h)+'">'),O(M(t)),H('</a>')},blockQuote:function(){I.pop(),_(),H('</blockquote>'),C('slurpAllLineEndings')},characterEscapeValue:q,characterReferenceMarkerHexadecimal:$,characterReferenceMarkerNumeric:$,characterReferenceValue:function(t){const o=this.sliceSerialize(t);O(M(w('characterReferenceType')?(0,c.decodeNumericCharacterReference)(o,"characterReferenceMarkerNumeric"===w('characterReferenceType')?10:16):(0,n.decodeNamedCharacterReference)(o))),C('characterReferenceType')},codeFenced:B,codeFencedFence:function(){const n=w('fencesCount')||0;n||(H('>'),C('slurpOneLineEnding',!0));C('fencesCount',n+1)},codeFencedFenceInfo:function(){H(' class="language-'+A()+'"')},codeFencedFenceMeta:U,codeFlowValue:function(n){O(M(this.sliceSerialize(n))),C('flowCodeSeenData',!0)},codeIndented:B,codeText:function(){C('inCodeText'),H('</code>')},codeTextData:q,data:q,definition:function(){const n=T[T.length-1],t=(0,s.normalizeIdentifier)(n.labelId);A(),f.call(E,t)||(E[t]=T[T.length-1]);T.pop()},definitionDestinationString:function(){T[T.length-1].destination=A(),C('ignoreEncode')},definitionLabelString:function(n){A(),T[T.length-1].labelId=this.sliceSerialize(n)},definitionTitleString:function(){T[T.length-1].title=A()},emphasis:function(){H('</em>')},hardBreakEscape:V,hardBreakTrailing:V,htmlFlow:j,htmlFlowData:q,htmlText:j,htmlTextData:q,image:W,label:function(){T[T.length-1].label=A()},labelText:function(n){T[T.length-1].labelId=this.sliceSerialize(n)},lineEnding:function(n){if(w('slurpAllLineEndings'))return;if(w('slurpOneLineEnding'))return void C('slurpOneLineEnding');if(w('inCodeText'))return void O(' ');O(M(this.sliceSerialize(n)))},link:W,listOrdered:function(){N(),I.pop(),P(),H('</ol>')},listUnordered:function(){N(),I.pop(),P(),H('</ul>')},paragraph:function(){I[I.length-1]?C('slurpAllLineEndings',!0):H('</p>')},reference:U,referenceString:function(n){T[T.length-1].referenceId=this.sliceSerialize(n)},resource:U,resourceDestinationString:function(){T[T.length-1].destination=A(),C('ignoreEncode')},resourceTitleString:function(){T[T.length-1].title=A()},setextHeading:function(){const n=A();_(),H('<h'+w('headingRank')+'>'),O(n),H('</h'+w('headingRank')+'>'),C('slurpAllLineEndings'),C('headingRank')},setextHeadingLineSequence:function(n){C('headingRank',61===this.sliceSerialize(n).charCodeAt(0)?1:2)},setextHeadingText:function(){C('slurpAllLineEndings',!0)},strong:function(){H('</strong>')},thematicBreak:function(){_(),H('<hr />')}}},F=(0,o.combineHtmlExtensions)([z,...k.htmlExtensions||[]]),R={definitions:E,tightStack:I},L={buffer:y,encode:M,getData:w,lineEndingIfNeeded:_,options:k,raw:O,resume:A,setData:C,tag:H};let D=k.defaultLineEnding;return function(n){let o=-1,c=0;const l=[];let s=[],u=[];for(;++o<n.length;)D||"lineEnding"!==n[o][1].type&&"lineEndingBlank"!==n[o][1].type||(D=n[o][2].sliceSerialize(n[o][1])),"listOrdered"!==n[o][1].type&&"listUnordered"!==n[o][1].type||('enter'===n[o][0]?l.push(o):v(n.slice(l.pop(),o))),"definition"===n[o][1].type&&('enter'===n[o][0]?(u=(0,t.push)(u,n.slice(c,o)),c=o):(s=(0,t.push)(s,n.slice(c,o+1)),c=o+1));s=(0,t.push)(s,u),s=(0,t.push)(s,n.slice(c)),o=-1;const h=s;F.enter.null&&F.enter.null.call(L);for(;++o<n.length;){const n=F[h[o][0]],t=h[o][1].type,c=n[t];f.call(n,t)&&c&&c.call({sliceSerialize:h[o][2].sliceSerialize,...L},h[o][1])}F.exit.null&&F.exit.null.call(L);return b[0].join('')};function v(n){const t=n.length;let o,c=0,l=0,s=!1;for(;++c<t;){const t=n[c];if(t[1]._container)o=void 0,'enter'===t[0]?l++:l--;else switch(t[1].type){case"listItemPrefix":'exit'===t[0]&&(o=!0);break;case"linePrefix":break;case"lineEndingBlank":'enter'!==t[0]||l||(o?o=void 0:s=!0);break;default:o=void 0}}n[0][1]._loose=s}function C(n,t){R[n]=t}function w(n){return R[n]}function y(){b.push([])}function A(){return b.pop().join('')}function H(n){x&&(C('lastWasTag',!0),b[b.length-1].push(n))}function O(n){C('lastWasTag'),b[b.length-1].push(n)}function P(){O(D||'\n')}function _(){const n=b[b.length-1],t=n[n.length-1],o=t?t.charCodeAt(t.length-1):null;10!==o&&13!==o&&null!==o&&P()}function M(n){return w('ignoreEncode')?n:(0,l.encode)(n)}function U(){A()}function N(){w('lastWasTag')&&!w('slurpAllLineEndings')&&_(),H('</li>'),C('slurpAllLineEndings')}function B(){const n=w('fencesCount');void 0!==n&&n<2&&R.tightStack.length>0&&!w('lastWasTag')&&P(),w('flowCodeSeenData')&&_(),H('</code></pre>'),void 0!==n&&n<2&&_(),C('flowCodeSeenData'),C('fencesCount'),C('slurpOneLineEnding')}function W(){let n=T.length-1;const t=T[n],o=t.referenceId||t.labelId,c=void 0===t.destination?E[(0,s.normalizeIdentifier)(o)]:t;for(x=!0;n--;)if(T[n].image){x=void 0;break}t.image?(H('<img src="'+(0,u.sanitizeUri)(c.destination,k.allowDangerousProtocol?void 0:p)+'" alt="'),O(t.label),H('"')):H('<a href="'+(0,u.sanitizeUri)(c.destination,k.allowDangerousProtocol?void 0:h)+'"'),H(c.title?' title="'+c.title+'"':''),t.image?H(' />'):(H('>'),O(t.label),H('</a>')),T.pop()}function q(n){O(M(this.sliceSerialize(n)))}function V(){H('<br />')}function j(){C('ignoreEncode')}function Q(){k.allowDangerousHtml&&C('ignoreEncode',!0)}function $(n){C('characterReferenceType',n.type)}};var n=r(d[0]),t=r(d[1]),o=r(d[2]),c=r(d[3]),l=r(d[4]),s=r(d[5]),u=r(d[6]);const f={}.hasOwnProperty,h=/^(https?|ircs?|mailto|xmpp)$/i,p=/^https?$/i},2475,[2476,2477,2478,2479,2480,2481,2482]);
14
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.decodeNamedCharacterReference=function(n){const c='&'+n+';';t.innerHTML=c;const o=t.textContent;if(59===o.charCodeAt(o.length-1)&&'semi'!==n)return!1;return o!==c&&o};const t=document.createElement('i')},2476,[]);
15
+ __d(function(g,r,i,a,m,e,d){"use strict";function t(t,n,l,s){const c=t.length;let u,f=0;if(n=n<0?-n>c?0:c+n:n>c?c:n,l=l>0?l:0,s.length<1e4)u=Array.from(s),u.unshift(n,l),t.splice(...u);else for(l&&t.splice(n,l);f<s.length;)u=s.slice(f,f+1e4),u.unshift(n,0),t.splice(...u),f+=1e4,n+=1e4}Object.defineProperty(e,'__esModule',{value:!0}),e.splice=t,e.push=function(n,l){if(n.length>0)return t(n,n.length,0,l),n;return l}},2477,[]);
16
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.combineExtensions=function(n){const t={};let c=-1;for(;++c<n.length;)o(t,n[c]);return t},e.combineHtmlExtensions=function(n){const t={};let o=-1;for(;++o<n.length;)l(t,n[o]);return t};var n=r(d[0]);const t={}.hasOwnProperty;function o(n,o){let l;for(l in o){const s=(t.call(n,l)?n[l]:void 0)||(n[l]={}),f=o[l];let u;if(f)for(u in f){t.call(s,u)||(s[u]=[]);const n=f[u];c(s[u],Array.isArray(n)?n:n?[n]:[])}}}function c(t,o){let c=-1;const l=[];for(;++c<o.length;)('after'===o[c].add?t:l).push(o[c]);(0,n.splice)(t,0,0,l)}function l(n,o){let c;for(c in o){const l=(t.call(n,c)?n[c]:void 0)||(n[c]={}),s=o[c];let f;if(s)for(f in s)l[f]=s[f]}}},2478,[2477]);
17
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.decodeNumericCharacterReference=function(t,n){const c=Number.parseInt(t,n);if(c<9||11===c||c>13&&c<32||c>126&&c<160||c>55295&&c<57344||c>64975&&c<65008||!(65535&~c)||65534==(65535&c)||c>1114111)return"\ufffd";return String.fromCodePoint(c)}},2479,[]);
18
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.encode=function(n){return n.replace(/["&<>]/g,function(n){return'&'+t[n]+';'})};const t={'"':'quot','&':'amp','<':'lt','>':'gt'}},2480,[]);
19
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.normalizeIdentifier=function(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,'').toLowerCase().toUpperCase()}},2481,[]);
20
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.sanitizeUri=function(n,c){const s=(0,t.encode)(o(n||''));if(!c)return s;const f=s.indexOf(':'),l=s.indexOf('?'),u=s.indexOf('#'),C=s.indexOf('/');if(f<0||C>-1&&f>C||l>-1&&f>l||u>-1&&f>u||c.test(s.slice(0,f)))return s;return''},e.normalizeUri=o;var n=r(d[0]),t=r(d[1]);function o(t){const o=[];let c=-1,s=0,f=0;for(;++c<t.length;){const l=t.charCodeAt(c);let u='';if(37===l&&(0,n.asciiAlphanumeric)(t.charCodeAt(c+1))&&(0,n.asciiAlphanumeric)(t.charCodeAt(c+2)))f=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(u=String.fromCharCode(l));else if(l>55295&&l<57344){const n=t.charCodeAt(c+1);l<56320&&n>56319&&n<57344?(u=String.fromCharCode(l,n),f=1):u="\ufffd"}else u=String.fromCharCode(l);u&&(o.push(t.slice(s,c),encodeURIComponent(u)),s=c+f+1,u=''),f&&(c+=f,f=0)}return o.join('')+t.slice(s)}},2482,[2483,2480]);
21
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"asciiAlpha",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"asciiAlphanumeric",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"asciiAtext",{enumerable:!0,get:function(){return u}}),e.asciiControl=function(n){return null!==n&&(n<32||127===n)},Object.defineProperty(e,"asciiDigit",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"asciiHexDigit",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"asciiPunctuation",{enumerable:!0,get:function(){return f}}),e.markdownLineEnding=function(n){return null!==n&&n<-2},e.markdownLineEndingOrSpace=function(n){return null!==n&&(n<0||32===n)},e.markdownSpace=function(n){return-2===n||-1===n||32===n},Object.defineProperty(e,"unicodePunctuation",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"unicodeWhitespace",{enumerable:!0,get:function(){return b}});const n=p(/[A-Za-z]/),t=p(/[\dA-Za-z]/),u=p(/[#-'*+\--9=?A-Z^-~]/);const c=p(/\d/),o=p(/[\dA-Fa-f]/),f=p(/[!-/:-@[-`{-~]/);const l=p(/\p{P}|\p{S}/u),b=p(/\s/);function p(n){return function(t){return null!==t&&t>-1&&n.test(String.fromCharCode(t))}}},2483,[]);
22
+ __d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.parse=function(f){const d=f||{},l={constructs:(0,e.combineExtensions)([u,...d.extensions||[]]),content:b(t.content),defined:[],document:b(n.document),flow:b(o.flow),lazy:{},string:b(c.string),text:b(c.text)};return l;function b(e){return function(t){return(0,s.createTokenizer)(l,e,t)}}};var e=r(_d[0]),t=r(_d[1]),n=r(_d[2]),o=r(_d[3]),c=r(_d[4]),u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[5])),s=r(_d[6])},2484,[2478,2485,2487,2489,2523,2524,2525]);
23
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"content",{enumerable:!0,get:function(){return u}});var n=r(d[0]),t=r(d[1]);const u={tokenize:function(u){const c=u.attempt(this.parser.constructs.contentInitial,function(t){if(null===t)return void u.consume(t);return u.enter("lineEnding"),u.consume(t),u.exit("lineEnding"),(0,n.factorySpace)(u,c,"linePrefix")},function(n){return u.enter("paragraph"),s(n)});let o;return c;function s(n){const t=u.enter("chunkText",{contentType:"text",previous:o});return o&&(o.next=t),o=t,f(n)}function f(n){return null===n?(u.exit("chunkText"),u.exit("paragraph"),void u.consume(n)):(0,t.markdownLineEnding)(n)?(u.consume(n),u.exit("chunkText"),s):(u.consume(n),f)}}}},2485,[2486,2483]);
24
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.factorySpace=function(t,u,c,o){const f=o?o-1:1/0;let p=0;return function(o){if((0,n.markdownSpace)(o))return t.enter(c),s(o);return u(o)};function s(o){return(0,n.markdownSpace)(o)&&p++<f?(t.consume(o),s):(t.exit(c),u(o))}},e.factorySpaceMinMax=function(t,u,c,o,f,p){let s=0;return function(u){if(p>0&&(0,n.markdownSpace)(u))return t.enter(o),S(u);return k(u)};function S(u){return(0,n.markdownSpace)(u)&&s<p?(t.consume(u),s++,S):(t.exit(o),k(u))}function k(n){return s>=f?u(n):c(n)}};var n=r(d[0])},2486,[2483]);
25
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"document",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),o=r(d[2]);const c={tokenize:function(t){const c=this,s=[];let l,f,v,p=0;return h;function h(n){if(p<s.length){const o=s[p];return c.containerState=o[1],t.attempt(o[0].continuation,w,k)(n)}return k(n)}function w(t){if(p++,c.containerState._closeFlow){c.containerState._closeFlow=void 0,l&&E();const n=c.events.length;let u,s=n;for(;s--;)if('exit'===c.events[s][0]&&"chunkFlow"===c.events[s][1].type){u=c.events[s][1].end;break}C(p);let f=n;for(;f<c.events.length;)c.events[f][1].end={...u},f++;const v=new o.EditMap;return v.add(s+1,0,c.events.slice(n)),v.add(n,f-n,[]),v.consume(c.events),k(t)}return h(t)}function k(n){if(p===s.length){if(!l)return _(n);if(l.currentConstruct&&l.currentConstruct.concrete)return b(n);c.interrupt=Boolean(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return c.containerState={},t.check(u,S,y)(n)}function S(t){return l&&E(),C(p),_(t)}function y(t){return c.parser.lazy[c.now().line]=p!==s.length,v=c.now().offset,b(t)}function _(n){return c.containerState={},t.attempt(u,F,b)(n)}function F(t){return p++,s.push([c.currentConstruct,c.containerState]),_(t)}function b(n){return null===n?(l&&E(),C(0),void t.consume(n)):(l=l||c.parser.flow(c.now()),t.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:f}),x(n))}function x(o){return null===o?(z(t.exit("chunkFlow"),!0),C(0),void t.consume(o)):(0,n.markdownLineEnding)(o)?(t.consume(o),z(t.exit("chunkFlow")),p=0,c.interrupt=void 0,h):(t.consume(o),x)}function z(t,n){const u=c.sliceStream(t);if(n&&u.push(null),t.previous=f,f&&(f.next=t),f=t,l.defineSkip(t.start),l.write(u),c.parser.lazy[t.start.line]){let t=l.events.length;for(;t--;)if(l.events[t][1].start.offset<v&&(!l.events[t][1].end||l.events[t][1].end.offset>v))return;const n=c.events.length;let u,s,f=n;for(;f--;)if('exit'===c.events[f][0]&&"chunkFlow"===c.events[f][1].type){if(u){s=c.events[f][1].end;break}u=!0}for(C(p),t=n;t<c.events.length;)c.events[t][1].end={...s},t++;const h=new o.EditMap;h.add(f+1,0,c.events.slice(n)),h.add(n,t-n,[]),h.consume(c.events)}}function C(n){let o=s.length;for(;o-- >n;){const n=s[o];c.containerState=n[1],n[0].exit.call(c,t)}s.length=n}function E(){l.write([null]),f=void 0,l=void 0,c.containerState._closeFlow=void 0}}},u={tokenize:function(n,o,c){return(0,t.factorySpace)(n,n.attempt(this.parser.constructs.document,o,c),"linePrefix",this.parser.constructs.disable.null.includes('codeIndented')?void 0:4)}}},2487,[2486,2483,2488]);
26
+ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EditMap",{enumerable:!0,get:function(){return t}});class t{constructor(){this.index=new Map,this.map=[]}add(t,n,h){s(this,t,n,h,!1)}addBefore(t,n,h){s(this,t,n,h,!0)}consume(t){if(this.map.sort(function(t,s){return t[0]-s[0]}),0===this.map.length)return;let s=this.map.length;const n=[];for(;s>0;)s-=1,n.push(t.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),t.length=this.map[s][0];n.push(t.slice()),t.length=0;let h=n.pop();for(;h;){for(const s of h)t.push(s);h=n.pop()}this.map.length=0,this.index.clear()}}function s(t,s,n,h,p){if(0===n&&0===h.length)return;const o=t.index.get(s);if(o)return o[1]+=n,void(p?(h.push(...o[2]),o[2]=h):o[2].push(...h));const u=[s,n,h];t.map.push(u),t.index.set(s,u)}},2488,[]);
27
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"flow",{enumerable:!0,get:function(){return o}});var n=r(d[0]),t=r(d[1]);r(d[2]);const o={tokenize:function(o){const u=this,c=o.attempt(n.blankLine,function(n){if(null===n)return void o.consume(n);return o.enter("lineEndingBlank"),o.consume(n),o.exit("lineEndingBlank"),u.currentConstruct=void 0,c},o.attempt(this.parser.constructs.flowInitial,s,(0,t.factorySpace)(o,o.attempt(this.parser.constructs.flow,s,o.attempt(n.content,s)),"linePrefix")));return c;function s(n){if(null!==n)return o.enter("lineEnding"),o.consume(n),o.exit("lineEnding"),u.currentConstruct=void 0,c;o.consume(n)}}}},2489,[2490,2486,2483]);
28
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"attention",{enumerable:!0,get:function(){return t.attention}}),Object.defineProperty(e,"autolink",{enumerable:!0,get:function(){return n.autolink}}),Object.defineProperty(e,"blankLine",{enumerable:!0,get:function(){return c.blankLine}}),Object.defineProperty(e,"blockQuote",{enumerable:!0,get:function(){return u.blockQuote}}),Object.defineProperty(e,"characterEscape",{enumerable:!0,get:function(){return o.characterEscape}}),Object.defineProperty(e,"characterReference",{enumerable:!0,get:function(){return b.characterReference}}),Object.defineProperty(e,"codeFenced",{enumerable:!0,get:function(){return l.codeFenced}}),Object.defineProperty(e,"codeIndented",{enumerable:!0,get:function(){return f.codeIndented}}),Object.defineProperty(e,"codeText",{enumerable:!0,get:function(){return p.codeText}}),Object.defineProperty(e,"content",{enumerable:!0,get:function(){return j.content}}),Object.defineProperty(e,"definition",{enumerable:!0,get:function(){return y.definition}}),Object.defineProperty(e,"hardBreakEscape",{enumerable:!0,get:function(){return O.hardBreakEscape}}),Object.defineProperty(e,"headingAtx",{enumerable:!0,get:function(){return P.headingAtx}}),Object.defineProperty(e,"htmlFlow",{enumerable:!0,get:function(){return h.htmlFlow}}),Object.defineProperty(e,"htmlText",{enumerable:!0,get:function(){return k.htmlText}}),Object.defineProperty(e,"labelEnd",{enumerable:!0,get:function(){return s.labelEnd}}),Object.defineProperty(e,"labelStartImage",{enumerable:!0,get:function(){return x.labelStartImage}}),Object.defineProperty(e,"labelStartLink",{enumerable:!0,get:function(){return E.labelStartLink}}),Object.defineProperty(e,"lineEnding",{enumerable:!0,get:function(){return B.lineEnding}}),Object.defineProperty(e,"list",{enumerable:!0,get:function(){return F.list}}),Object.defineProperty(e,"setextUnderline",{enumerable:!0,get:function(){return I.setextUnderline}}),Object.defineProperty(e,"thematicBreak",{enumerable:!0,get:function(){return L.thematicBreak}});var t=r(d[0]),n=r(d[1]),c=r(d[2]),u=r(d[3]),o=r(d[4]),b=r(d[5]),l=r(d[6]),f=r(d[7]),p=r(d[8]),j=r(d[9]),y=r(d[10]),O=r(d[11]),P=r(d[12]),h=r(d[13]),k=r(d[14]),s=r(d[15]),x=r(d[16]),E=r(d[17]),B=r(d[18]),F=r(d[19]),I=r(d[20]),L=r(d[21])},2490,[2491,2494,2495,2496,2497,2498,2499,2501,2502,2503,2506,2511,2512,2513,2515,2516,2517,2518,2519,2520,2522,2521]);
29
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"attention",{enumerable:!0,get:function(){return o}});var t=r(d[0]),n=r(d[1]),s=r(d[2]);const o={name:'attention',resolveAll:function(n,o){let c,u=-1;for(;++u<n.length;)if('enter'===n[u][0]&&'attentionSequence'===n[u][1].type&&n[u][1]._close){let l=u;for(;l--;)if('exit'===n[l][0]&&'attentionSequence'===n[l][1].type&&n[l][1]._open&&o.sliceSerialize(n[l][1]).charCodeAt(0)===o.sliceSerialize(n[u][1]).charCodeAt(0)){if((n[l][1]._close||n[u][1]._open)&&(n[u][1].end.offset-n[u][1].start.offset)%3&&!((n[l][1].end.offset-n[l][1].start.offset+n[u][1].end.offset-n[u][1].start.offset)%3))continue;const p=n[l][1].end.offset-n[l][1].start.offset>1&&n[u][1].end.offset-n[u][1].start.offset>1?2:1,h={...n[l][1].end},y={...n[u][1].start};f(h,-p),f(y,p);const S={type:p>1?"strongSequence":"emphasisSequence",start:h,end:{...n[l][1].end}},x={type:p>1?"strongSequence":"emphasisSequence",start:{...n[u][1].start},end:y},_={type:p>1?"strongText":"emphasisText",start:{...n[l][1].end},end:{...n[u][1].start}},q={type:p>1?"strong":"emphasis",start:{...S.start},end:{...x.end}};n[l][1].end={...S.start},n[u][1].start={...x.end},c=[],n[l][1].end.offset-n[l][1].start.offset&&(c=(0,t.push)(c,[['enter',n[l][1],o],['exit',n[l][1],o]])),c=(0,t.push)(c,[['enter',q,o],['enter',S,o],['exit',S,o],['enter',_,o]]),c=(0,t.push)(c,(0,s.resolveAll)(o.parser.constructs.insideSpan.null,n.slice(l+1,u),o)),c=(0,t.push)(c,[['exit',_,o],['enter',x,o],['exit',x,o],['exit',q,o]]);let b=0;n[u][1].end.offset-n[u][1].start.offset&&(b=2,c=(0,t.push)(c,[['enter',n[u][1],o],['exit',n[u][1],o]])),(0,t.splice)(n,l-1,u-l+3,c),u=l+c.length-b-2;break}}u=-1;for(;++u<n.length;)'attentionSequence'===n[u][1].type&&(n[u][1].type='data');return n},tokenize:function(t,s){const o=this.parser.constructs.attentionMarkers.null,f=this.previous,c=(0,n.classifyCharacter)(f);let u;return function(n){return u=n,t.enter('attentionSequence'),l(n)};function l(p){if(p===u)return t.consume(p),l;const h=t.exit('attentionSequence'),y=(0,n.classifyCharacter)(p),S=!y||2===y&&c||o.includes(p)&&42!==p&&95!==p,x=!c||2===c&&y||o.includes(f)&&42!==f&&95!==f;return h._open=Boolean(42===u?S:S&&(c||!x)),h._close=Boolean(42===u?x:x&&(y||!S)),s(p)}}};function f(t,n){t.column+=n,t.offset+=n,t._bufferIndex+=n}},2491,[2477,2492,2493]);
30
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.classifyCharacter=function(t){if(null===t||(0,n.markdownLineEndingOrSpace)(t)||(0,n.unicodeWhitespace)(t))return 1;if((0,n.unicodePunctuation)(t))return 2};var n=r(d[0])},2492,[2483]);
31
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveAll=function(l,t,n){const o=[];let s=-1;for(;++s<l.length;){const u=l[s].resolveAll;u&&!o.includes(u)&&(t=u(t,n),o.push(u))}return t}},2493,[]);
32
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"autolink",{enumerable:!0,get:function(){return t}});var n=r(d[0]);const t={name:'autolink',tokenize:function(t,u,o){let c=0;return function(n){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(n),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),l};function l(u){return(0,n.asciiAlpha)(u)?(t.consume(u),s):64===u?o(u):p(u)}function s(t){return 43===t||45===t||46===t||(0,n.asciiAlphanumeric)(t)?(c=1,k(t)):p(t)}function k(u){return 58===u?(t.consume(u),c=0,f):(43===u||45===u||46===u||(0,n.asciiAlphanumeric)(u))&&c++<32?(t.consume(u),k):(c=0,p(u))}function f(c){return 62===c?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(c),t.exit("autolinkMarker"),t.exit("autolink"),u):null===c||32===c||60===c||(0,n.asciiControl)(c)?o(c):(t.consume(c),f)}function p(u){return 64===u?(t.consume(u),x):(0,n.asciiAtext)(u)?(t.consume(u),p):o(u)}function x(t){return(0,n.asciiAlphanumeric)(t)?M(t):o(t)}function M(n){return 46===n?(t.consume(n),c=0,x):62===n?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(n),t.exit("autolinkMarker"),t.exit("autolink"),u):A(n)}function A(u){if((45===u||(0,n.asciiAlphanumeric)(u))&&c++<63){const n=45===u?A:M;return t.consume(u),n}return o(u)}}}},2494,[2483]);
33
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"blankLine",{enumerable:!0,get:function(){return u}});var n=r(d[0]),t=r(d[1]);const u={partial:!0,tokenize:function(u,o,c){return function(o){return(0,t.markdownSpace)(o)?(0,n.factorySpace)(u,f,"linePrefix")(o):f(o)};function f(n){return null===n||(0,t.markdownLineEnding)(n)?o(n):c(n)}}}},2495,[2486,2483]);
34
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"blockQuote",{enumerable:!0,get:function(){return o}});var t=r(d[0]),n=r(d[1]);const o={continuation:{tokenize:function(c,u,f){const l=this;return function(o){if((0,n.markdownSpace)(o))return(0,t.factorySpace)(c,s,"linePrefix",l.parser.constructs.disable.null.includes('codeIndented')?void 0:4)(o);return s(o)};function s(t){return c.attempt(o,u,f)(t)}}},exit:function(t){t.exit("blockQuote")},name:'blockQuote',tokenize:function(t,o,c){const u=this;return function(n){if(62===n){const o=u.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(n),t.exit("blockQuoteMarker"),f}return c(n)};function f(c){return(0,n.markdownSpace)(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),o):(t.exit("blockQuotePrefix"),o(c))}}}},2496,[2486,2483]);
35
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"characterEscape",{enumerable:!0,get:function(){return t}});var c=r(d[0]);const t={name:'characterEscape',tokenize:function(t,n,u){return function(c){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(c),t.exit("escapeMarker"),s};function s(s){return(0,c.asciiPunctuation)(s)?(t.enter("characterEscapeValue"),t.consume(s),t.exit("characterEscapeValue"),t.exit("characterEscape"),n):u(s)}}}},2497,[2483]);
36
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"characterReference",{enumerable:!0,get:function(){return t}});var c=r(d[0]),n=r(d[1]);const t={name:'characterReference',tokenize:function(t,u,f){const h=this;let o,s,R=0;return function(c){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(c),t.exit("characterReferenceMarker"),l};function l(c){return 35===c?(t.enter("characterReferenceMarkerNumeric"),t.consume(c),t.exit("characterReferenceMarkerNumeric"),k):(t.enter("characterReferenceValue"),o=31,s=n.asciiAlphanumeric,x(c))}function k(c){return 88===c||120===c?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(c),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=n.asciiHexDigit,x):(t.enter("characterReferenceValue"),o=7,s=n.asciiDigit,x(c))}function x(l){if(59===l&&R){const o=t.exit("characterReferenceValue");return s!==n.asciiAlphanumeric||(0,c.decodeNamedCharacterReference)(h.sliceSerialize(o))?(t.enter("characterReferenceMarker"),t.consume(l),t.exit("characterReferenceMarker"),t.exit("characterReference"),u):f(l)}return s(l)&&R++<o?(t.consume(l),x):f(l)}}}},2498,[2476,2483]);
37
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"codeFenced",{enumerable:!0,get:function(){return o}});var n=r(d[0]),c=r(d[1]),t=r(d[2]);const o={concrete:!0,name:'codeFenced',tokenize:function(o,u,l){const f=this,F={partial:!0,tokenize:function(t,o,u){let l=0;return F;function F(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),p}function p(o){return t.enter("codeFencedFence"),(0,c.markdownSpace)(o)?(0,n.factorySpace)(t,S,"linePrefix",f.parser.constructs.disable.null.includes('codeIndented')?void 0:4)(o):S(o)}function S(n){return n===s?(t.enter("codeFencedFenceSequence"),w(n)):u(n)}function w(o){return o===s?(l++,t.consume(o),w):l>=k?(t.exit("codeFencedFenceSequence"),(0,c.markdownSpace)(o)?(0,n.factorySpace)(t,x,"whitespace")(o):x(o)):u(o)}function x(n){return null===n||(0,c.markdownLineEnding)(n)?(t.exit("codeFencedFence"),o(n)):u(n)}}};let s,p=0,k=0;return function(n){return S(n)};function S(n){const c=f.events[f.events.length-1];return p=c&&"linePrefix"===c[1].type?c[2].sliceSerialize(c[1],!0).length:0,s=n,o.enter("codeFenced"),o.enter("codeFencedFence"),o.enter("codeFencedFenceSequence"),w(n)}function w(t){return t===s?(k++,o.consume(t),w):k<3?l(t):(o.exit("codeFencedFenceSequence"),(0,c.markdownSpace)(t)?(0,n.factorySpace)(o,x,"whitespace")(t):x(t))}function x(n){return null===n||(0,c.markdownLineEnding)(n)?(o.exit("codeFencedFence"),f.interrupt?u(n):o.check(t.nonLazyContinuation,L,q)(n)):(o.enter("codeFencedFenceInfo"),o.enter("chunkString",{contentType:"string"}),h(n))}function h(t){return null===t||(0,c.markdownLineEnding)(t)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),x(t)):(0,c.markdownSpace)(t)?(o.exit("chunkString"),o.exit("codeFencedFenceInfo"),(0,n.factorySpace)(o,y,"whitespace")(t)):96===t&&t===s?l(t):(o.consume(t),h)}function y(n){return null===n||(0,c.markdownLineEnding)(n)?x(n):(o.enter("codeFencedFenceMeta"),o.enter("chunkString",{contentType:"string"}),E(n))}function E(n){return null===n||(0,c.markdownLineEnding)(n)?(o.exit("chunkString"),o.exit("codeFencedFenceMeta"),x(n)):96===n&&n===s?l(n):(o.consume(n),E)}function L(n){return o.attempt(F,q,v)(n)}function v(n){return o.enter("lineEnding"),o.consume(n),o.exit("lineEnding"),z}function z(t){return p>0&&(0,c.markdownSpace)(t)?(0,n.factorySpace)(o,P,"linePrefix",p+1)(t):P(t)}function P(n){return null===n||(0,c.markdownLineEnding)(n)?o.check(t.nonLazyContinuation,L,q)(n):(o.enter("codeFlowValue"),b(n))}function b(n){return null===n||(0,c.markdownLineEnding)(n)?(o.exit("codeFlowValue"),P(n)):(o.consume(n),b)}function q(n){return o.exit("codeFenced"),u(n)}}}},2499,[2486,2483,2500]);
38
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"nonLazyContinuation",{enumerable:!0,get:function(){return n}}),r(d[0]);const n={partial:!0,tokenize:function(n,t,u){const o=this;return function(t){if(null===t)return u(t);return n.enter("lineEnding"),n.consume(t),n.exit("lineEnding"),c};function c(n){return o.parser.lazy[o.now().line]?u(n):t(n)}}}},2500,[2483]);
39
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"codeIndented",{enumerable:!0,get:function(){return o}});var n=r(d[0]),t=r(d[1]);const o={name:'codeIndented',tokenize:function(o,c,l){return function(t){return o.enter("codeIndented"),(0,n.factorySpaceMinMax)(o,f,l,"linePrefix",4,4)(t)};function f(n){return null===n?p(n):(0,t.markdownLineEnding)(n)?o.attempt(u,f,p)(n):(o.enter("codeFlowValue"),s(n))}function s(n){return null===n||(0,t.markdownLineEnding)(n)?(o.exit("codeFlowValue"),f(n)):(o.consume(n),s)}function p(n){return o.exit("codeIndented"),c(n)}}},u={partial:!0,tokenize:function(o,u,c){const l=this;return f;function f(p){return l.parser.lazy[l.now().line]?c(p):(0,t.markdownLineEnding)(p)?(o.enter("lineEnding"),o.consume(p),o.exit("lineEnding"),f):(0,n.factorySpaceMinMax)(o,u,s,"linePrefix",4,4)(p)}function s(n){return(0,t.markdownLineEnding)(n)?f(n):c(n)}}}},2501,[2486,2483]);
40
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"codeText",{enumerable:!0,get:function(){return t}});var n=r(d[0]);const t={name:'codeText',previous:function(n){return 96!==n||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(n){let t,c,o=n.length-4,u=3;if(!("lineEnding"!==n[u][1].type&&'space'!==n[u][1].type||"lineEnding"!==n[o][1].type&&'space'!==n[o][1].type))for(t=u;++t<o;)if("codeTextData"===n[t][1].type){n[u][1].type="codeTextPadding",n[o][1].type="codeTextPadding",u+=2,o-=2;break}t=u-1,o++;for(;++t<=o;)void 0===c?t!==o&&"lineEnding"!==n[t][1].type&&(c=t):t!==o&&"lineEnding"!==n[t][1].type||(n[c][1].type="codeTextData",t!==c+2&&(n[c][1].end=n[t-1][1].end,n.splice(c+2,t-c-2),o-=t-c-2,t=c+2),c=void 0);return n},tokenize:function(t,c,o){let u,p,s=0;return function(n){return t.enter("codeText"),t.enter("codeTextSequence"),x(n)};function x(n){return 96===n?(t.consume(n),s++,x):(t.exit("codeTextSequence"),l(n))}function l(c){return null===c?o(c):32===c?(t.enter('space'),t.consume(c),t.exit('space'),l):96===c?(p=t.enter("codeTextSequence"),u=0,T(c)):(0,n.markdownLineEnding)(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),l):(t.enter("codeTextData"),f(c))}function f(c){return null===c||32===c||96===c||(0,n.markdownLineEnding)(c)?(t.exit("codeTextData"),l(c)):(t.consume(c),f)}function T(n){return 96===n?(t.consume(n),u++,T):u===s?(t.exit("codeTextSequence"),t.exit("codeText"),c(n)):(p.type="codeTextData",f(n))}}}},2502,[2483]);
41
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"content",{enumerable:!0,get:function(){return c}});var n=r(d[0]),t=r(d[1]),o=r(d[2]);const c={resolve:function(n){return(0,o.subtokenize)(n),n},tokenize:function(n,o){let c;return function(t){return n.enter("content"),c=n.enter("chunkContent",{contentType:"content"}),s(t)};function s(o){return null===o?l(o):(0,t.markdownLineEnding)(o)?n.check(u,f,l)(o):(n.consume(o),s)}function l(t){return n.exit("chunkContent"),n.exit("content"),o(t)}function f(t){return n.consume(t),n.exit("chunkContent"),c.next=n.enter("chunkContent",{contentType:"content",previous:c}),c=c.next,s}}},u={partial:!0,tokenize:function(o,c,u){const s=this;return function(t){return o.exit("chunkContent"),o.enter("lineEnding"),o.consume(t),o.exit("lineEnding"),(0,n.factorySpace)(o,l,"linePrefix")};function l(n){if(null===n||(0,t.markdownLineEnding)(n))return u(n);const l=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes('codeIndented')&&l&&"linePrefix"===l[1].type&&l[2].sliceSerialize(l[1],!0).length>=4?c(n):o.interrupt(s.parser.constructs.flow,u,c)(n)}}}},2503,[2486,2483,2504]);
42
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SpliceBuffer",{enumerable:!0,get:function(){return n.SpliceBuffer}}),e.subtokenize=function(o){const l={};let p,f,c,u,y,_,I,h=-1;const k=new n.SpliceBuffer(o);for(;++h<k.length;){for(;h in l;)h=l[h];if(p=k.get(h),h&&"chunkFlow"===p[1].type&&"listItemPrefix"===k.get(h-1)[1].type&&(_=p[1]._tokenizer.events,c=0,c<_.length&&"lineEndingBlank"===_[c][1].type&&(c+=2),c<_.length&&"content"===_[c][1].type))for(;++c<_.length&&"content"!==_[c][1].type;)"chunkText"===_[c][1].type&&(_[c][1]._isInFirstContentOfListItem=!0,c++);if('enter'===p[0])p[1].contentType&&(Object.assign(l,s(k,h)),h=l[h],I=!0);else if(p[1]._container){for(c=h,f=void 0;c--;)if(u=k.get(c),"lineEnding"===u[1].type||"lineEndingBlank"===u[1].type)'enter'===u[0]&&(f&&(k.get(f)[1].type="lineEndingBlank"),u[1].type="lineEnding",f=c);else if("linePrefix"!==u[1].type&&"listItemIndent"!==u[1].type)break;f&&(p[1].end={...k.get(f)[1].start},y=k.slice(f,h),y.unshift(p),k.splice(f,h-f+1,y))}}return(0,t.splice)(o,0,Number.POSITIVE_INFINITY,k.slice(0)),!I};var t=r(d[0]),n=r(d[1]);function s(t,n){const s=t.get(n)[1],o=t.get(n)[2];let l=n-1;const p=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const c=f.events,u=[],y={};let _,I,h=-1,k=s,v=0,T=0;const x=[T];for(;k;){for(;t.get(++l)[1]!==k;);p.push(l),k._tokenizer||(_=o.sliceStream(k),k.next||_.push(null),I&&f.defineSkip(k.start),k._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(_),k._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),I=k,k=k.next}for(k=s;++h<c.length;)'exit'===c[h][0]&&'enter'===c[h-1][0]&&c[h][1].type===c[h-1][1].type&&c[h][1].start.line!==c[h][1].end.line&&(T=h+1,x.push(T),k._tokenizer=void 0,k.previous=void 0,k=k.next);for(f.events=[],k?(k._tokenizer=void 0,k.previous=void 0):x.pop(),h=x.length;h--;){const n=c.slice(x[h],x[h+1]),s=p.pop();u.push([s,s+n.length-1]),t.splice(s,2,n)}for(u.reverse(),h=-1;++h<u.length;)y[v+u[h][0]]=v+u[h][1],v+=u[h][1]-u[h][0]-1;return y}},2504,[2477,2505]);
43
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SpliceBuffer",{enumerable:!0,get:function(){return t}});class t{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError('Cannot access index `'+t+'` in a splice buffer of size `'+(this.left.length+this.right.length)+'`');return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,h){const s=null==h?Number.POSITIVE_INFINITY:h;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,s,l){const n=s||0;this.setCursor(Math.trunc(t));const f=this.right.splice(this.right.length-n,Number.POSITIVE_INFINITY);return l&&h(this.left,l),f.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),h(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),h(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&0===this.right.length||t<0&&0===this.left.length))if(t<this.left.length){const s=this.left.splice(t,Number.POSITIVE_INFINITY);h(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);h(this.left,s.reverse())}}}function h(t,h){let s=0;if(h.length<1e4)t.push(...h);else for(;s<h.length;)t.push(...h.slice(s,s+1e4)),s+=1e4}},2505,[]);
44
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"definition",{enumerable:!0,get:function(){return s}});var n=r(d[0]),t=r(d[1]),o=r(d[2]),f=r(d[3]),c=r(d[4]),u=r(d[5]),l=r(d[6]);const s={name:'definition',tokenize:function(f,s,k){const L=this;let S;return function(n){return f.enter("definition"),w(n)};function w(n){return t.factoryLabel.call(L,f,y,k,"definitionLabel","definitionLabelMarker","definitionLabelString")(n)}function y(n){return S=(0,l.normalizeIdentifier)(L.sliceSerialize(L.events[L.events.length-1][1]).slice(1,-1)),58===n?(f.enter("definitionMarker"),f.consume(n),f.exit("definitionMarker"),b):k(n)}function b(n){return(0,u.markdownLineEndingOrSpace)(n)?(0,c.factoryWhitespace)(f,h)(n):h(n)}function h(t){return(0,n.factoryDestination)(f,D,k,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function D(n){return f.attempt(p,M,M)(n)}function M(n){return(0,u.markdownSpace)(n)?(0,o.factorySpace)(f,v,"whitespace")(n):v(n)}function v(n){return null===n||(0,u.markdownLineEnding)(n)?(f.exit("definition"),L.parser.defined.push(S),s(n)):k(n)}}},p={partial:!0,tokenize:function(n,t,l){return function(t){return(0,u.markdownLineEndingOrSpace)(t)?(0,c.factoryWhitespace)(n,s)(t):l(t)};function s(t){return(0,f.factoryTitle)(n,p,l,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function p(t){return(0,u.markdownSpace)(t)?(0,o.factorySpace)(n,k,"whitespace")(t):k(t)}function k(n){return null===n||(0,u.markdownLineEnding)(n)?t(n):l(n)}}}},2506,[2507,2508,2486,2509,2510,2483,2481]);
45
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.factoryDestination=function(t,u,c,o,s,l,f,x,k){const S=k||Number.POSITIVE_INFINITY;let I=0;return function(u){if(60===u)return t.enter(o),t.enter(s),t.enter(l),t.consume(u),t.exit(l),_;if(null===u||32===u||41===u||(0,n.asciiControl)(u))return c(u);return t.enter(o),t.enter(f),t.enter(x),t.enter("chunkString",{contentType:"string"}),y(u)};function _(n){return 62===n?(t.enter(l),t.consume(n),t.exit(l),t.exit(s),t.exit(o),u):(t.enter(x),t.enter("chunkString",{contentType:"string"}),h(n))}function h(u){return 62===u?(t.exit("chunkString"),t.exit(x),_(u)):null===u||60===u||(0,n.markdownLineEnding)(u)?c(u):(t.consume(u),92===u?p:h)}function p(n){return 60===n||62===n||92===n?(t.consume(n),h):h(n)}function y(s){return I||null!==s&&41!==s&&!(0,n.markdownLineEndingOrSpace)(s)?I<S&&40===s?(t.consume(s),I++,y):41===s?(t.consume(s),I--,y):null===s||32===s||40===s||(0,n.asciiControl)(s)?c(s):(t.consume(s),92===s?T:y):(t.exit("chunkString"),t.exit(x),t.exit(f),t.exit(o),u(s))}function T(n){return 40===n||41===n||92===n?(t.consume(n),y):y(n)}};var n=r(d[0])},2507,[2483]);
46
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.factoryLabel=function(t,u,o,c,s,l){const f=this;let p,x=0;return function(n){return t.enter(c),t.enter(s),t.consume(n),t.exit(s),t.enter(l),k};function k(h){return x>999||null===h||91===h||93===h&&!p||94===h&&!x&&'_hiddenFootnoteSupport'in f.parser.constructs?o(h):93===h?(t.exit(l),t.enter(s),t.consume(h),t.exit(s),t.exit(c),u):(0,n.markdownLineEnding)(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),k):(t.enter("chunkString",{contentType:"string"}),_(h))}function _(u){return null===u||91===u||93===u||(0,n.markdownLineEnding)(u)||x++>999?(t.exit("chunkString"),k(u)):(t.consume(u),p||(p=!(0,n.markdownSpace)(u)),92===u?h:_)}function h(n){return 91===n||92===n||93===n?(t.consume(n),x++,_):_(n)}};var n=r(d[0])},2508,[2483]);
47
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.factoryTitle=function(u,c,o,f,l,s){let x;return function(n){if(34===n||39===n||40===n)return u.enter(f),u.enter(l),u.consume(n),u.exit(l),x=40===n?41:n,k;return o(n)};function k(n){return n===x?(u.enter(l),u.consume(n),u.exit(l),u.exit(f),c):(u.enter(s),y(n))}function y(c){return c===x?(u.exit(s),k(x)):null===c?o(c):(0,t.markdownLineEnding)(c)?(u.enter("lineEnding"),u.consume(c),u.exit("lineEnding"),(0,n.factorySpace)(u,y,"linePrefix")):(u.enter("chunkString",{contentType:"string"}),E(c))}function E(n){return n===x||null===n||(0,t.markdownLineEnding)(n)?(u.exit("chunkString"),y(n)):(u.consume(n),92===n?_:E)}function _(n){return n===x||92===n?(u.consume(n),E):E(n)}};var n=r(d[0]),t=r(d[1])},2509,[2486,2483]);
48
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.factoryWhitespace=function(u,c){let f;return function o(l){if((0,t.markdownLineEnding)(l))return u.enter("lineEnding"),u.consume(l),u.exit("lineEnding"),f=!0,o;if((0,t.markdownSpace)(l))return(0,n.factorySpace)(u,o,f?"linePrefix":"lineSuffix")(l);return c(l)}};var n=r(d[0]),t=r(d[1])},2510,[2486,2483]);
49
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"hardBreakEscape",{enumerable:!0,get:function(){return t}});var n=r(d[0]);const t={name:'hardBreakEscape',tokenize:function(t,c,u){return function(n){return t.enter("hardBreakEscape"),t.consume(n),o};function o(o){return(0,n.markdownLineEnding)(o)?(t.exit("hardBreakEscape"),c(o)):u(o)}}}},2511,[2483]);
50
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"headingAtx",{enumerable:!0,get:function(){return u}});var n=r(d[0]),t=r(d[1]),c=r(d[2]);const u={name:'headingAtx',resolve:function(n,t){let u=n.length-2,o=3;"whitespace"===n[o][1].type&&(o+=2);u-2>o&&"whitespace"===n[u][1].type&&(u-=2);"atxHeadingSequence"===n[u][1].type&&(o===u-1||u-4>o&&"whitespace"===n[u-2][1].type)&&(u-=o+1===u?2:4);if(u>o){const x={type:"atxHeadingText",start:n[o][1].start,end:n[u][1].end},p={type:"chunkText",start:n[o][1].start,end:n[u][1].end,contentType:"text"};(0,c.splice)(n,o,u-o+1,[['enter',x,t],['enter',p,t],['exit',p,t],['exit',x,t]])}return n},tokenize:function(c,u,o){let x=0;return function(n){return c.enter("atxHeading"),p(n)};function p(n){return c.enter("atxHeadingSequence"),s(n)}function s(n){return 35===n&&x++<6?(c.consume(n),s):null===n||(0,t.markdownLineEndingOrSpace)(n)?(c.exit("atxHeadingSequence"),f(n)):o(n)}function f(o){return 35===o?(c.enter("atxHeadingSequence"),l(o)):null===o||(0,t.markdownLineEnding)(o)?(c.exit("atxHeading"),u(o)):(0,t.markdownSpace)(o)?(0,n.factorySpace)(c,f,"whitespace")(o):(c.enter("atxHeadingText"),y(o))}function l(n){return 35===n?(c.consume(n),l):(c.exit("atxHeadingSequence"),f(n))}function y(n){return null===n||35===n||(0,t.markdownLineEndingOrSpace)(n)?(c.exit("atxHeadingText"),f(n)):(c.consume(n),y)}}}},2512,[2486,2483,2477]);
51
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"htmlFlow",{enumerable:!0,get:function(){return c}});var n=r(d[0]),t=r(d[1]),u=r(d[2]),o=r(d[3]);const c={concrete:!0,name:'htmlFlow',resolveTo:function(n){let t=n.length;for(;t--&&('enter'!==n[t][0]||"htmlFlow"!==n[t][1].type););t>1&&"linePrefix"===n[t-2][1].type&&(n[t][1].start=n[t-2][1].start,n[t+1][1].start=n[t-2][1].start,n.splice(t-2,2));return n},tokenize:function(u,c,l){const f=this;let p,h,w,k,C;return function(n){return L(n)};function L(n){return u.enter("htmlFlow"),u.enter("htmlFlowData"),u.consume(n),E}function E(t){return 33===t?(u.consume(t),S):47===t?(u.consume(t),h=!0,x):63===t?(u.consume(t),p=3,f.interrupt?c:Q):(0,n.asciiAlpha)(t)?(u.consume(t),w=String.fromCharCode(t),y):l(t)}function S(t){return 45===t?(u.consume(t),p=2,A):91===t?(u.consume(t),p=5,k=0,F):(0,n.asciiAlpha)(t)?(u.consume(t),p=4,f.interrupt?c:Q):l(t)}function A(n){return 45===n?(u.consume(n),f.interrupt?c:Q):l(n)}function F(n){const t="CDATA[";return n===t.charCodeAt(k++)?(u.consume(n),6===k?f.interrupt?c:B:F):l(n)}function x(t){return(0,n.asciiAlpha)(t)?(u.consume(t),w=String.fromCharCode(t),y):l(t)}function y(o){if(null===o||47===o||62===o||(0,n.markdownLineEndingOrSpace)(o)){const n=47===o,s=w.toLowerCase();return n||h||!t.htmlRawNames.includes(s)?t.htmlBlockNames.includes(w.toLowerCase())?(p=6,n?(u.consume(o),D):f.interrupt?c(o):B(o)):(p=7,f.interrupt&&!f.parser.lazy[f.now().line]?l(o):h?b(o):z(o)):(p=1,f.interrupt?c(o):B(o))}return 45===o||(0,n.asciiAlphanumeric)(o)?(u.consume(o),w+=String.fromCharCode(o),y):l(o)}function D(n){return 62===n?(u.consume(n),f.interrupt?c:B):l(n)}function b(t){return(0,n.markdownSpace)(t)?(u.consume(t),b):R(t)}function z(t){return 47===t?(u.consume(t),R):58===t||95===t||(0,n.asciiAlpha)(t)?(u.consume(t),O):(0,n.markdownSpace)(t)?(u.consume(t),z):R(t)}function O(t){return 45===t||46===t||58===t||95===t||(0,n.asciiAlphanumeric)(t)?(u.consume(t),O):_(t)}function _(t){return 61===t?(u.consume(t),v):(0,n.markdownSpace)(t)?(u.consume(t),_):z(t)}function v(t){return null===t||60===t||61===t||62===t||96===t?l(t):34===t||39===t?(u.consume(t),C=t,N):(0,n.markdownSpace)(t)?(u.consume(t),v):P(t)}function N(t){return t===C?(u.consume(t),C=null,j):null===t||(0,n.markdownLineEnding)(t)?l(t):(u.consume(t),N)}function P(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||(0,n.markdownLineEndingOrSpace)(t)?_(t):(u.consume(t),P)}function j(t){return 47===t||62===t||(0,n.markdownSpace)(t)?z(t):l(t)}function R(n){return 62===n?(u.consume(n),T):l(n)}function T(t){return null===t||(0,n.markdownLineEnding)(t)?B(t):(0,n.markdownSpace)(t)?(u.consume(t),T):l(t)}function B(t){return 45===t&&2===p?(u.consume(t),H):60===t&&1===p?(u.consume(t),I):62===t&&4===p?(u.consume(t),U):63===t&&3===p?(u.consume(t),Q):93===t&&5===p?(u.consume(t),K):!(0,n.markdownLineEnding)(t)||6!==p&&7!==p?null===t||(0,n.markdownLineEnding)(t)?(u.exit("htmlFlowData"),M(t)):(u.consume(t),B):(u.exit("htmlFlowData"),u.check(s,V,M)(t))}function M(n){return u.check(o.nonLazyContinuation,q,V)(n)}function q(n){return u.enter("lineEnding"),u.consume(n),u.exit("lineEnding"),G}function G(t){return null===t||(0,n.markdownLineEnding)(t)?M(t):(u.enter("htmlFlowData"),B(t))}function H(n){return 45===n?(u.consume(n),Q):B(n)}function I(n){return 47===n?(u.consume(n),w='',J):B(n)}function J(o){if(62===o){const n=w.toLowerCase();return t.htmlRawNames.includes(n)?(u.consume(o),U):B(o)}return(0,n.asciiAlpha)(o)&&w.length<8?(u.consume(o),w+=String.fromCharCode(o),J):B(o)}function K(n){return 93===n?(u.consume(n),Q):B(n)}function Q(n){return 62===n?(u.consume(n),U):45===n&&2===p?(u.consume(n),Q):B(n)}function U(t){return null===t||(0,n.markdownLineEnding)(t)?(u.exit("htmlFlowData"),V(t)):(u.consume(t),U)}function V(n){return u.exit("htmlFlow"),c(n)}}},s={partial:!0,tokenize:function(n,t,o){return function(c){return n.enter("lineEnding"),n.consume(c),n.exit("lineEnding"),n.attempt(u.blankLine,t,o)}}}},2513,[2483,2514,2495,2500]);
52
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"htmlBlockNames",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"htmlRawNames",{enumerable:!0,get:function(){return o}});const t=['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'],o=['pre','script','style','textarea']},2514,[]);
53
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"htmlText",{enumerable:!0,get:function(){return t}});var n=r(d[0]),u=r(d[1]);const t={name:'htmlText',tokenize:function(t,c,o){const s=this;let l,f,p;return function(n){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(n),k};function k(n){return 33===n?(t.consume(n),h):47===n?(t.consume(n),_):63===n?(t.consume(n),b):(0,u.asciiAlpha)(n)?(t.consume(n),j):o(n)}function h(n){return 45===n?(t.consume(n),w):91===n?(t.consume(n),f=0,A):(0,u.asciiAlpha)(n)?(t.consume(n),O):o(n)}function w(n){return 45===n?(t.consume(n),L):o(n)}function E(n){return null===n?o(n):45===n?(t.consume(n),x):(0,u.markdownLineEnding)(n)?(p=E,H(n)):(t.consume(n),E)}function x(n){return 45===n?(t.consume(n),L):E(n)}function L(n){return 62===n?G(n):45===n?x(n):E(n)}function A(n){const u="CDATA[";return n===u.charCodeAt(f++)?(t.consume(n),6===f?S:A):o(n)}function S(n){return null===n?o(n):93===n?(t.consume(n),T):(0,u.markdownLineEnding)(n)?(p=S,H(n)):(t.consume(n),S)}function T(n){return 93===n?(t.consume(n),D):S(n)}function D(n){return 62===n?G(n):93===n?(t.consume(n),D):S(n)}function O(n){return null===n||62===n?G(n):(0,u.markdownLineEnding)(n)?(p=O,H(n)):(t.consume(n),O)}function b(n){return null===n?o(n):63===n?(t.consume(n),v):(0,u.markdownLineEnding)(n)?(p=b,H(n)):(t.consume(n),b)}function v(n){return 62===n?G(n):b(n)}function _(n){return(0,u.asciiAlpha)(n)?(t.consume(n),y):o(n)}function y(n){return 45===n||(0,u.asciiAlphanumeric)(n)?(t.consume(n),y):P(n)}function P(n){return(0,u.markdownLineEnding)(n)?(p=P,H(n)):(0,u.markdownSpace)(n)?(t.consume(n),P):G(n)}function j(n){return 45===n||(0,u.asciiAlphanumeric)(n)?(t.consume(n),j):47===n||62===n||(0,u.markdownLineEndingOrSpace)(n)?C(n):o(n)}function C(n){return 47===n?(t.consume(n),G):58===n||95===n||(0,u.asciiAlpha)(n)?(t.consume(n),z):(0,u.markdownLineEnding)(n)?(p=C,H(n)):(0,u.markdownSpace)(n)?(t.consume(n),C):G(n)}function z(n){return 45===n||46===n||58===n||95===n||(0,u.asciiAlphanumeric)(n)?(t.consume(n),z):I(n)}function I(n){return 61===n?(t.consume(n),M):(0,u.markdownLineEnding)(n)?(p=I,H(n)):(0,u.markdownSpace)(n)?(t.consume(n),I):C(n)}function M(n){return null===n||60===n||61===n||62===n||96===n?o(n):34===n||39===n?(t.consume(n),l=n,q):(0,u.markdownLineEnding)(n)?(p=M,H(n)):(0,u.markdownSpace)(n)?(t.consume(n),M):(t.consume(n),B)}function q(n){return n===l?(t.consume(n),l=void 0,F):null===n?o(n):(0,u.markdownLineEnding)(n)?(p=q,H(n)):(t.consume(n),q)}function B(n){return null===n||34===n||39===n||60===n||61===n||96===n?o(n):47===n||62===n||(0,u.markdownLineEndingOrSpace)(n)?C(n):(t.consume(n),B)}function F(n){return 47===n||62===n||(0,u.markdownLineEndingOrSpace)(n)?C(n):o(n)}function G(n){return 62===n?(t.consume(n),t.exit("htmlTextData"),t.exit("htmlText"),c):o(n)}function H(n){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),J}function J(c){return(0,u.markdownSpace)(c)?(0,n.factorySpace)(t,K,"linePrefix",s.parser.constructs.disable.null.includes('codeIndented')?void 0:4)(c):K(c)}function K(n){return t.enter("htmlTextData"),p(n)}}}},2515,[2486,2483]);
54
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"labelEnd",{enumerable:!0,get:function(){return p}});var n=r(d[0]),t=r(d[1]),c=r(d[2]),l=r(d[3]),o=r(d[4]),u=r(d[5]),s=r(d[6]),f=r(d[7]);const p={name:'labelEnd',resolveAll:function(n){let t=-1;const c=[];for(;++t<n.length;){const l=n[t][1];if(c.push(n[t]),"labelImage"===l.type||"labelLink"===l.type||"labelEnd"===l.type){const n="labelImage"===l.type?4:2;l.type="data",t+=n}}n.length!==c.length&&(0,u.splice)(n,0,n.length,c);return n},resolveTo:function(n,t){let c,l,o,s=n.length,p=0;for(;s--;){const t=n[s][1];if(c){if("link"===t.type||"labelLink"===t.type&&t._inactive)break;'enter'===n[s][0]&&"labelLink"===t.type&&(t._inactive=!0)}else if(l){if('enter'===n[s][0]&&("labelImage"===t.type||"labelLink"===t.type)&&!t._balanced&&(c=s,"labelLink"!==t.type)){p=2;break}}else"labelEnd"===t.type&&(l=s)}const k={type:"labelLink"===n[c][1].type?"link":"image",start:{...n[c][1].start},end:{...n[n.length-1][1].end}},b={type:"label",start:{...n[c][1].start},end:{...n[l][1].end}},y={type:"labelText",start:{...n[c+p+2][1].end},end:{...n[l-2][1].start}};return o=[['enter',k,t],['enter',b,t]],o=(0,u.push)(o,n.slice(c+1,c+p+3)),o=(0,u.push)(o,[['enter',y,t]]),o=(0,u.push)(o,(0,f.resolveAll)(t.parser.constructs.insideSpan.null,n.slice(c+p+4,l-3),t)),o=(0,u.push)(o,[['exit',y,t],n[l-2],n[l-1],['exit',b,t]]),o=(0,u.push)(o,n.slice(l+1)),o=(0,u.push)(o,[['exit',k,t]]),(0,u.splice)(n,c,n.length,o),n},tokenize:function(n,t,c){const l=this,o=l._labelStarts;let u,f;if(o){for(;o.length>0&&o[o.length-1]._balanced;)o.pop();u=o[o.length-1]}return function(t){if(!u)return c(t);if(u._inactive)return x(t);return f=l.parser.defined.includes((0,s.normalizeIdentifier)(l.sliceSerialize({start:u.end,end:l.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(t),n.exit("labelMarker"),n.exit("labelEnd"),p};function p(t){return 40===t?n.attempt(k,M,f?M:x)(t):91===t?n.attempt(b,M,f?h:x)(t):f?M(t):x(t)}function h(t){return n.attempt(y,M,x)(t)}function M(n){return o.pop(),t(n)}function x(n){return u._balanced=!0,c(n)}}},k={tokenize:function(t,u,s){return function(n){return t.enter("resource"),t.enter("resourceMarker"),t.consume(n),t.exit("resourceMarker"),f};function f(n){return(0,o.markdownLineEndingOrSpace)(n)?(0,l.factoryWhitespace)(t,p)(n):p(n)}function p(c){return 41===c?M(c):(0,n.factoryDestination)(t,k,b,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function k(n){return(0,o.markdownLineEndingOrSpace)(n)?(0,l.factoryWhitespace)(t,y)(n):M(n)}function b(n){return s(n)}function y(n){return 34===n||39===n||40===n?(0,c.factoryTitle)(t,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(n):M(n)}function h(n){return(0,o.markdownLineEndingOrSpace)(n)?(0,l.factoryWhitespace)(t,M)(n):M(n)}function M(n){return 41===n?(t.enter("resourceMarker"),t.consume(n),t.exit("resourceMarker"),t.exit("resource"),u):s(n)}}},b={tokenize:function(n,c,l){const o=this;return function(c){return t.factoryLabel.call(o,n,u,f,"reference","referenceMarker","referenceString")(c)};function u(n){return o.parser.defined.includes((0,s.normalizeIdentifier)(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?c(n):l(n)}function f(n){return l(n)}}},y={tokenize:function(n,t,c){return function(t){return n.enter("reference"),n.enter("referenceMarker"),n.consume(t),n.exit("referenceMarker"),l};function l(l){return 93===l?(n.enter("referenceMarker"),n.consume(l),n.exit("referenceMarker"),n.exit("reference"),t):c(l)}}}},2516,[2507,2508,2509,2510,2483,2477,2481,2493]);
55
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"labelStartImage",{enumerable:!0,get:function(){return t}});const t={name:'labelStartImage',resolveAll:r(d[0]).labelEnd.resolveAll,tokenize:function(t,l,n){const o=this;let u;return function(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),s};function s(l){return 91===l?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),u=t.exit("labelImage"),b):n(l)}function b(t){return 94===t&&'_hiddenFootnoteSupport'in o.parser.constructs?n(t):(o._labelStarts=o._labelStarts||[],o._labelStarts.push(u),l(t))}}}},2517,[2516]);
56
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"labelStartLink",{enumerable:!0,get:function(){return t}});const t={name:'labelStartLink',resolveAll:r(d[0]).labelEnd.resolveAll,tokenize:function(t,n,l){const o=this;let u;return function(n){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(n),t.exit("labelMarker"),u=t.exit("labelLink"),s};function s(t){return 94===t&&'_hiddenFootnoteSupport'in o.parser.constructs?l(t):(o._labelStarts=o._labelStarts||[],o._labelStarts.push(u),n(t))}}}},2518,[2516]);
57
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"lineEnding",{enumerable:!0,get:function(){return t}});var n=r(d[0]);r(d[1]);const t={name:'lineEnding',tokenize:function(t,u){return function(c){return t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),(0,n.factorySpace)(t,u,"linePrefix")}}}},2519,[2486,2483]);
58
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"list",{enumerable:!0,get:function(){return s}});var t=r(d[0]),n=r(d[1]),c=r(d[2]),o=r(d[3]);const s={continuation:{tokenize:function(o,l,f){const S=this;return S.containerState._closeFlow=void 0,o.check(c.blankLine,function(n){return S.containerState.furtherBlankLines=S.containerState.furtherBlankLines||S.containerState.initialBlankLine,(0,t.factorySpace)(o,l,"listItemIndent",S.containerState.size+1)(n)},function(t){if(S.containerState.furtherBlankLines||!(0,n.markdownSpace)(t))return S.containerState.furtherBlankLines=void 0,S.containerState.initialBlankLine=void 0,p(t);return S.containerState.furtherBlankLines=void 0,S.containerState.initialBlankLine=void 0,o.attempt(u,l,p)(t)});function p(n){return S.containerState._closeFlow=!0,S.interrupt=void 0,(0,t.factorySpace)(o,o.attempt(s,l,f),"linePrefix",S.parser.constructs.disable.null.includes('codeIndented')?void 0:4)(n)}}},exit:function(t){t.exit(this.containerState.type)},name:'list',tokenize:function(t,s,u){const f=this,S=f.events[f.events.length-1];let p=S&&"linePrefix"===S[1].type?S[2].sliceSerialize(S[1],!0).length:0,k=0;return function(c){const s=f.containerState.type||(42===c||43===c||45===c?"listUnordered":"listOrdered");if("listUnordered"===s?!f.containerState.marker||c===f.containerState.marker:(0,n.asciiDigit)(c)){if(f.containerState.type||(f.containerState.type=s,t.enter(s,{_container:!0})),"listUnordered"===s)return t.enter("listItemPrefix"),42===c||45===c?t.check(o.thematicBreak,u,I)(c):I(c);if(!f.interrupt||49===c)return t.enter("listItemPrefix"),t.enter("listItemValue"),h(c)}return u(c)};function h(c){return(0,n.asciiDigit)(c)&&++k<10?(t.consume(c),h):(!f.interrupt||k<2)&&(f.containerState.marker?c===f.containerState.marker:41===c||46===c)?(t.exit("listItemValue"),I(c)):u(c)}function I(n){return t.enter("listItemMarker"),t.consume(n),t.exit("listItemMarker"),f.containerState.marker=f.containerState.marker||n,t.check(c.blankLine,f.interrupt?u:v,t.attempt(l,y,x))}function v(t){return f.containerState.initialBlankLine=!0,p++,y(t)}function x(c){return(0,n.markdownSpace)(c)?(t.enter("listItemPrefixWhitespace"),t.consume(c),t.exit("listItemPrefixWhitespace"),y):u(c)}function y(n){return f.containerState.size=p+f.sliceSerialize(t.exit("listItemPrefix"),!0).length,s(n)}}},l={partial:!0,tokenize:function(c,o,s){const l=this;return(0,t.factorySpace)(c,function(t){const c=l.events[l.events.length-1];return!(0,n.markdownSpace)(t)&&c&&"listItemPrefixWhitespace"===c[1].type?o(t):s(t)},"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes('codeIndented')?void 0:5)}},u={partial:!0,tokenize:function(n,c,o){const s=this;return(0,t.factorySpace)(n,function(t){const n=s.events[s.events.length-1];return n&&"listItemIndent"===n[1].type&&n[2].sliceSerialize(n[1],!0).length===s.containerState.size?c(t):o(t)},"listItemIndent",s.containerState.size+1)}}},2520,[2486,2483,2495,2521]);
59
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"thematicBreak",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]);const c={name:'thematicBreak',tokenize:function(c,u,o){let f,k=0;return function(t){return c.enter("thematicBreak"),h(t)};function h(t){return f=t,l(t)}function l(t){return t===f?(c.enter("thematicBreakSequence"),s(t)):k>=3&&(null===t||(0,n.markdownLineEnding)(t))?(c.exit("thematicBreak"),u(t)):o(t)}function s(u){return u===f?(c.consume(u),k++,s):(c.exit("thematicBreakSequence"),(0,n.markdownSpace)(u)?(0,t.factorySpace)(c,l,"whitespace")(u):l(u))}}}},2521,[2486,2483]);
60
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"setextUnderline",{enumerable:!0,get:function(){return s}});var n=r(d[0]),t=r(d[1]),o=r(d[2]);const s={name:'setextUnderline',resolveTo:function(n,t){const s=new o.EditMap;let u,c,f,l=n.length;for(;l--;)if('enter'===n[l][0]){if("content"===n[l][1].type){u=l;break}"paragraph"===n[l][1].type&&(c=l)}else"content"===n[l][1].type&&s.add(l,1,[]),f||"definition"!==n[l][1].type||(f=l);const p={type:"setextHeading",start:{...n[u][1].start},end:{...n[n.length-1][1].end}};n[c][1].type="setextHeadingText",f?(s.add(c,0,[['enter',p,t]]),s.add(f+1,0,[['exit',n[u][1],t]]),n[u][1].end={...n[f][1].end}):n[u][1]=p;return s.add(n.length,0,[['exit',p,t]]),s.consume(n),n},tokenize:function(o,s,u){const c=this;let f;return function(n){let t,s=c.events.length;for(;s--;)if("lineEnding"!==c.events[s][1].type&&"linePrefix"!==c.events[s][1].type&&"content"!==c.events[s][1].type){t="paragraph"===c.events[s][1].type;break}if(!c.parser.lazy[c.now().line]&&(c.interrupt||t))return o.enter("setextHeadingLine"),f=n,l(n);return u(n)};function l(n){return o.enter("setextHeadingLineSequence"),p(n)}function p(s){return s===f?(o.consume(s),p):(o.exit("setextHeadingLineSequence"),(0,t.markdownSpace)(s)?(0,n.factorySpace)(o,x,"lineSuffix")(s):x(s))}function x(n){return null===n||(0,t.markdownLineEnding)(n)?(o.exit("setextHeadingLine"),s(n)):u(n)}}}},2522,[2486,2483,2488]);
61
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"resolver",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"string",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"text",{enumerable:!0,get:function(){return u}});var t=r(d[0]);const n={resolveAll:s()},o=f('string'),u=f('text');function f(t){return{resolveAll:s('text'===t?l:void 0),tokenize:function(n){const o=this,u=this.parser.constructs[t],f=n.attempt(u,s,l);return s;function s(t){return p(t)?f(t):l(t)}function l(t){if(null!==t)return n.enter("data"),n.consume(t),c;n.consume(t)}function c(t){return p(t)?(n.exit("data"),f(t)):(n.consume(t),c)}function p(t){if(null===t)return!0;const n=u[t];let f=-1;if(n)for(;++f<n.length;){const t=n[f];if(!t.previous||t.previous.call(o,o.previous))return!0}return!1}}}}function s(t){return function(n,o){let u,f=-1;for(;++f<=n.length;)void 0===u?n[f]&&"data"===n[f][1].type&&(u=f,f++):n[f]&&"data"===n[f][1].type||(f!==u+2&&(n[u][1].end=n[f-1][1].end,n.splice(u+2,f-u-2),f=u+2),u=void 0);return t?t(n,o):n}}function l(n,o){const u=new t.EditMap;let f=0;for(;++f<=n.length;)if((f===n.length||"lineEnding"===n[f][1].type)&&"data"===n[f-1][1].type){const t=n[f-1][1],s=o.sliceStream(t);let l,c=s.length,p=-1,b=0;for(;c--;){const t=s[c];if('string'==typeof t){for(p=t.length;32===t.charCodeAt(p-1);)b++,p--;if(p)break;p=-1}else if(-2===t)l=!0,b++;else if(-1!==t){c++;break}}if(o._contentTypeTextTrailing&&f===n.length&&(b=0),b){const s={type:f===n.length||l||b<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?p:t.start._bufferIndex+p,_index:t.start._index+c,line:t.end.line,column:t.end.column-b,offset:t.end.offset-b},end:{...t.end}};t.end={...s.start},t.start.offset===t.end.offset?Object.assign(t,s):u.add(f,0,[['enter',s,o],['exit',s,o]])}f++}return u.consume(n),n}},2523,[2488]);
62
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"document",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"contentInitial",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"flowInitial",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"flow",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"string",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"text",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"insideSpan",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"attentionMarkers",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"disable",{enumerable:!0,get:function(){return h}});var t=r(d[0]),n=r(d[1]);const l={42:t.list,43:t.list,45:t.list,48:t.list,49:t.list,50:t.list,51:t.list,52:t.list,53:t.list,54:t.list,55:t.list,56:t.list,57:t.list,62:t.blockQuote},c={91:t.definition},o={[-2]:t.codeIndented,[-1]:t.codeIndented,32:t.codeIndented},u={35:t.headingAtx,42:t.thematicBreak,45:[t.setextUnderline,t.thematicBreak],60:t.htmlFlow,61:t.setextUnderline,95:t.thematicBreak,96:t.codeFenced,126:t.codeFenced},s={38:t.characterReference,92:t.characterEscape},f={[-5]:t.lineEnding,[-4]:t.lineEnding,[-3]:t.lineEnding,33:t.labelStartImage,38:t.characterReference,42:t.attention,60:[t.autolink,t.htmlText],91:t.labelStartLink,92:[t.hardBreakEscape,t.characterEscape],93:t.labelEnd,95:t.attention,96:t.codeText},b={null:[t.attention,n.resolver]},p={null:[42,95]},h={null:[]}},2524,[2490,2523]);
63
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createTokenizer=function(c,f,l){let _={_bufferIndex:-1,_index:0,line:l&&l.line||1,column:l&&l.column||1,offset:l&&l.offset||0};const p={},v=[];let x=[],h=[],b=!0;const I={attempt:O(function(n,t){T(n,t.from)}),check:O(w),consume:function(t){(0,n.markdownLineEnding)(t)?(_.line++,_.column=1,_.offset+=-3===t?2:1,L()):-1!==t&&(_.column++,_.offset++);_._bufferIndex<0?_._index++:(_._bufferIndex++,_._bufferIndex===x[_._index].length&&(_._bufferIndex=-1,_._index++));k.previous=t,b=!0},enter:function(n,t){const u=t||{};return u.type=n,u.start=z(),k.events.push(['enter',u,k]),h.push(u),u},exit:function(n){const t=h.pop();return t.end=z(),k.events.push(['exit',t,k]),t},interrupt:O(w,{interrupt:!0})},k={code:null,containerState:{},defineSkip:function(n){p[n.line]=n.column,L()},events:[],now:z,parser:c,previous:null,sliceSerialize:function(n,t){return s(C(n),t)},sliceStream:C,write:function(n){if(x=(0,t.push)(x,n),S(),null!==x[x.length-1])return[];return T(f,0),k.events=(0,u.resolveAll)(v,k.events,k),k.events}};let y,A=f.tokenize.call(k,I);f.resolveAll&&v.push(f);return k;function C(n){return o(x,n)}function z(){const{_bufferIndex:n,_index:t,line:u,column:o,offset:s}=_;return{_bufferIndex:n,_index:t,line:u,column:o,offset:s}}function S(){for(;_._index<x.length;){const n=x[_._index];if('string'==typeof n){const t=_._index;for(_._bufferIndex<0&&(_._bufferIndex=0);_._index===t&&_._bufferIndex<n.length;)j(n.charCodeAt(_._bufferIndex))}else j(n)}}function j(n){b=void 0,y=n,A=A(n)}function w(n,t){t.restore()}function O(n,t){return function(u,o,s){let c,f,l,_;return Array.isArray(u)?p(u):'tokenize'in u?p([u]):(function(n){return t;function t(t){const u=null!==t&&n[t],o=null!==t&&n.null;return p([...Array.isArray(u)?u:u?[u]:[],...Array.isArray(o)?o:o?[o]:[]])(t)}})(u);function p(n){return c=n,f=0,0===n.length?s:v(n[f])}function v(n){return function(u){_=E(),l=n,n.partial||(k.currentConstruct=n);if(n.name&&k.parser.constructs.disable.null.includes(n.name))return h(u);return n.tokenize.call(t?Object.assign(Object.create(k),t):k,I,x,h)(u)}}function x(t){return b=!0,n(l,_),o}function h(n){return b=!0,_.restore(),++f<c.length?v(c[f]):s}}}function T(n,u){n.resolveAll&&!v.includes(n)&&v.push(n),n.resolve&&(0,t.splice)(k.events,u,k.events.length-u,n.resolve(k.events.slice(u),k)),n.resolveTo&&(k.events=n.resolveTo(k.events,k))}function E(){const n=z(),t=k.previous,u=k.currentConstruct,o=k.events.length,s=Array.from(h);return{from:o,restore:function(){_=n,k.previous=t,k.currentConstruct=u,k.events.length=o,h=s,L()}}}function L(){_.line in p&&_.column<2&&(_.column=p[_.line],_.offset+=p[_.line]-1)}};var n=r(d[0]),t=r(d[1]),u=r(d[2]);function o(n,t){const u=t.start._index,o=t.start._bufferIndex,s=t.end._index,c=t.end._bufferIndex;let f;if(u===s)f=[n[u].slice(o,c)];else{if(f=n.slice(u,s),o>-1){const n=f[0];'string'==typeof n?f[0]=n.slice(o):f.shift()}c>0&&f.push(n[s].slice(0,c))}return f}function s(n,t){let u=-1;const o=[];let s;for(;++u<n.length;){const c=n[u];let f;if('string'==typeof c)f=c;else switch(c){case-5:f="\r";break;case-4:f="\n";break;case-3:f="\r\n";break;case-2:f=t?" ":"\t";break;case-1:if(!t&&s)continue;f=" ";break;default:f=String.fromCharCode(c)}s=-2===c,o.push(f)}return o.join('')}},2525,[2483,2477,2493]);
64
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.postprocess=function(o){for(;!(0,t.subtokenize)(o););return o};var t=r(d[0])},2526,[2504]);
65
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.preprocess=function(){let s,n=1,o='',c=!0;return function(u,h,l){u=o+('string'==typeof u?u.toString():new TextDecoder(h||void 0).decode(u));const p=[];let f=0;o='',c&&(65279===u.charCodeAt(0)&&f++,c=void 0);for(;f<u.length;){t.lastIndex=f;const c=t.exec(u),h=c&&void 0!==c.index?c.index:u.length,l=u.charCodeAt(h);if(!c){o=u.slice(f);break}if(10===l&&f===h&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),f<h&&(p.push(u.slice(f,h)),n+=h-f),l){case 0:p.push(65533),n++;break;case 9:{const t=4*Math.ceil(n/4);for(p.push(-2);n++<t;)p.push(-1);break}case 10:p.push(-4),n=1;break;default:s=!0,n=1}f=h+1}l&&(s&&p.push(-5),o&&p.push(o),p.push(null));return p}};const t=/[\0\t\n\r]/g},2527,[]);
66
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.decodeString=function(c){return c.replace(n,o)};var c=r(d[0]),t=r(d[1]);const n=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function o(n,o,u){if(o)return o;if(35===u.charCodeAt(0)){const c=u.charCodeAt(1),n=120===c||88===c;return(0,t.decodeNumericCharacterReference)(u.slice(n?2:1),n?16:10)}return(0,c.decodeNamedCharacterReference)(u)||n}},2528,[2476,2479]);
67
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"stringifyPosition",{enumerable:!0,get:function(){return t.stringifyPosition}});var t=r(d[0])},2529,[2530]);
68
+ __d(function(g,r,i,a,m,e,d){"use strict";function n(n){return u(n&&n.line)+':'+u(n&&n.column)}function t(t){return n(t&&t.start)+'-'+n(t&&t.end)}function u(n){return n&&'number'==typeof n?n:1}Object.defineProperty(e,'__esModule',{value:!0}),e.stringifyPosition=function(u){if(!u||'object'!=typeof u)return'';if('position'in u||'type'in u)return t(u.position);if('start'in u||'end'in u)return t(u);if('line'in u||'column'in u)return n(u);return''}},2530,[]);
69
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},2531,[2532]);
70
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}});var t=r(d[0]);function n(n){const o=this;o.compiler=function(s){return(0,t.toMarkdown)(s,{...o.data('settings'),...n,extensions:o.data('toMarkdownExtensions')||[]})}}},2532,[2533]);
71
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"toMarkdown",{enumerable:!0,get:function(){return t.toMarkdown}}),Object.defineProperty(e,"defaultHandlers",{enumerable:!0,get:function(){return n.handle}});var t=r(d[0]),n=r(d[1])},2533,[2534,2541]);
72
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.toMarkdown=function(f,p){const k=p||{},L={associationId:l.association,bulletCurrent:void 0,bulletLastUsed:void 0,containerPhrasing:b,containerFlow:j,createTracker:v.track,compilePattern:h.compilePattern,enter:function(n){return L.stack.push(n),t;function t(){L.stack.pop()}},handlers:{...c.handle},handle:void 0,indentLines:w.indentLines,indexStack:[],join:[...s.join],options:{},safe:_,stack:[],unsafe:[...u.unsafe]};(0,o.configure)(L,k),L.options.tightDefinitions&&L.join.push(P);L.handle=(0,t.zwitch)('type',{invalid:y,unknown:C,handlers:L.handlers});let x=L.handle((0,n.phrasing)(f)?{type:'root',children:[f]}:f,void 0,L,{before:'\n',after:'\n',now:{line:1,column:1},lineShift:0});x&&10!==x.charCodeAt(x.length-1)&&13!==x.charCodeAt(x.length-1)&&(x+='\n');return x};var n=r(d[0]),t=r(d[1]),o=r(d[2]),c=r(d[3]),s=r(d[4]),u=r(d[5]),l=r(d[6]),h=r(d[7]),f=r(d[8]),p=r(d[9]),w=r(d[10]),k=r(d[11]),v=r(d[12]);function y(n){throw new Error('Cannot handle value `'+n+'`, expected node')}function C(n){throw new Error('Cannot handle unknown node `'+n.type+'`')}function P(n,t){if('definition'===n.type&&n.type===t.type)return 0}function b(n,t){return(0,f.containerPhrasing)(n,this,t)}function j(n,t){return(0,p.containerFlow)(n,this,t)}function _(n,t){return(0,k.safe)(this,n,t)}},2534,[2535,2539,2540,2541,2582,2584,2585,2586,2587,2590,2591,2592,2593]);
73
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"phrasing",{enumerable:!0,get:function(){return n.phrasing}});var n=r(d[0])},2535,[2536]);
74
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"phrasing",{enumerable:!0,get:function(){return t}});const t=(0,r(d[0]).convert)(['break','delete','emphasis','footnote','footnoteReference','image','imageReference','inlineCode','inlineMath','link','linkReference','mdxJsxTextElement','mdxTextExpression','strong','text','textDirective'])},2536,[2537]);
75
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"is",{enumerable:!0,get:function(){return t.is}}),Object.defineProperty(e,"convert",{enumerable:!0,get:function(){return t.convert}});var t=r(d[0])},2537,[2538]);
76
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"is",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"convert",{enumerable:!0,get:function(){return t}});const n=function(o,u,f,c,l){const s=t(u);if(null!=f&&('number'!=typeof f||f<0||f===Number.POSITIVE_INFINITY))throw new Error('Expected positive finite index');if(!(null==c||n(c)&&c.children))throw new Error('Expected parent node');if(null==c!=(null==f))throw new Error('Expected both parent and index');return!!p(o)&&s.call(l,o,f,c)},t=function(n){if(null==n)return l;if('function'==typeof n)return c(n);if('object'==typeof n)return Array.isArray(n)?o(n):u(n);if('string'==typeof n)return f(n);throw new Error('Expected function, string, or object as test')};function o(n){const o=[];let u=-1;for(;++u<n.length;)o[u]=t(n[u]);return c(function(...n){let t=-1;for(;++t<o.length;)if(o[t].apply(this,n))return!0;return!1})}function u(n){const t=n;return c(function(o){const u=o;let f;for(f in n)if(u[f]!==t[f])return!1;return!0})}function f(n){return c(function(t){return t&&t.type===n})}function c(n){return function(t,o,u){return Boolean(p(t)&&n.call(this,t,'number'==typeof o?o:void 0,u||void 0))}}function l(){return!0}function p(n){return null!==n&&'object'==typeof n&&'type'in n}},2538,[]);
77
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.zwitch=function(t,l){const c=l||{};function o(l,...c){let s=o.invalid;const u=o.handlers;if(l&&n.call(l,t)){const c=String(l[t]);s=n.call(u,c)?u[c]:o.unknown}if(s)return s.call(this,l,...c)}return o.handlers=c.handlers||{},o.invalid=c.invalid,o.unknown=c.unknown,o};const n={}.hasOwnProperty},2539,[]);
78
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.configure=function o(c,f){let u,l=-1;if(f.extensions)for(;++l<f.extensions.length;)o(c,f.extensions[l]);for(u in f)if(n.call(f,u))switch(u){case'extensions':break;case'unsafe':case'join':s(c[u],f[u]);break;case'handlers':t(c[u],f[u]);break;default:c.options[u]=f[u]}return c};const n={}.hasOwnProperty;function s(n,s){s&&n.push(...s)}function t(n,s){s&&Object.assign(n,s)}},2540,[]);
79
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"handle",{enumerable:!0,get:function(){return y}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),c=r(d[4]),h=r(d[5]),s=r(d[6]),k=r(d[7]),f=r(d[8]),u=r(d[9]),p=r(d[10]),b=r(d[11]),B=r(d[12]),R=r(d[13]),_=r(d[14]),j=r(d[15]),q=r(d[16]),v=r(d[17]),x=r(d[18]);const y={blockquote:t.blockquote,break:n.hardBreak,code:o.code,definition:l.definition,emphasis:c.emphasis,hardBreak:n.hardBreak,heading:h.heading,html:s.html,image:k.image,imageReference:f.imageReference,inlineCode:u.inlineCode,link:p.link,linkReference:b.linkReference,list:B.list,listItem:R.listItem,paragraph:_.paragraph,root:j.root,strong:q.strong,text:v.text,thematicBreak:x.thematicBreak}},2541,[2542,2543,2545,2549,2551,2553,2561,2562,2563,2564,2565,2567,2568,2573,2575,2576,2577,2579,2580]);
80
+ __d(function(g,r,i,a,m,e,d){"use strict";function t(t,n,o){return'>'+(o?'':' ')+t}Object.defineProperty(e,'__esModule',{value:!0}),e.blockquote=function(n,o,c,u){const s=c.enter('blockquote'),f=c.createTracker(u);f.move('> '),f.shift(2);const l=c.indentLines(c.containerFlow(n,f.current()),t);return s(),l}},2542,[]);
81
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.hardBreak=function(n,f,c,o){let u=-1;for(;++u<c.unsafe.length;){const n=c.unsafe[u];if('\n'===n.character&&!n.before&&!n.after&&(0,t.patternInScope)(c.stack,n))return/[\t ]/.test(o.before)?'':' '}return'\\\n'};var t=r(d[0])},2543,[2544]);
82
+ __d(function(g,r,i,a,m,e,d){"use strict";function t(t,n,u){if('string'==typeof n&&(n=[n]),!n||0===n.length)return u;let o=-1;for(;++o<n.length;)if(t.includes(n[o]))return!0;return!1}Object.defineProperty(e,'__esModule',{value:!0}),e.patternInScope=function(n,u){return t(n,u.inConstruct,!0)&&!t(n,u.notInConstruct,!1)}},2544,[]);
83
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.code=function(f,s,u,v){const l=(0,c.checkFence)(u),F=f.value||'';if((0,t.formatCodeAsIndented)(f,u)){const n=u.enter('codeIndented'),t=u.indentLines(F,o);return n(),t}const _=u.createTracker(v),b=l.repeat(Math.max((0,n.longestStreak)(F,l)+1,3)),k=u.enter('codeFenced'),M='`'===l?'GraveAccent':'Tilde';let h=_.move(b);if(f.lang){const n=u.enter(`codeFencedLang${M}`);h+=_.move(u.safe(f.lang,{before:h,after:' ',encode:['`'],..._.current()})),n()}if(f.lang&&f.meta){const n=u.enter(`codeFencedMeta${M}`);h+=_.move(' '),h+=_.move(u.safe(f.meta,{before:h,after:'\n',encode:['`'],..._.current()})),n()}h+=_.move('\n'),F&&(h+=_.move(F+'\n'));return h+=_.move(b),k(),h};var n=r(d[0]),t=r(d[1]),c=r(d[2]);function o(n,t,c){return(c?'':' ')+n}},2545,[2546,2547,2548]);
84
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.longestStreak=function(t,n){const o=String(t);let f=o.indexOf(n),s=f,u=0,c=0;if('string'!=typeof n)throw new TypeError('Expected substring');for(;-1!==f;)f===s?++u>c&&(c=u):u=1,s=f+n.length,f=o.indexOf(n,s);return c}},2546,[]);
85
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.formatCodeAsIndented=function(t,n){return Boolean(!1===n.options.fences&&t.value&&!t.lang&&/[^\n\r ]/.test(t.value)&&!/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(t.value))}},2547,[]);
86
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkFence=function(n){const o=n.options.fence||'`';if('`'!==o&&'~'!==o)throw new Error('Cannot serialize code with `'+o+'` for `options.fence`, expected `` ` `` or `~`');return o}},2548,[]);
87
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.definition=function(o,n,f,u){const c=(0,t.checkQuote)(f),l='"'===c?'Quote':'Apostrophe',s=f.enter('definition');let v=f.enter('label');const b=f.createTracker(u);let _=b.move('[');_+=b.move(f.safe(f.associationId(o),{before:_,after:']',...b.current()})),_+=b.move(']: '),v(),!o.url||/[\0- \u007F]/.test(o.url)?(v=f.enter('destinationLiteral'),_+=b.move('<'),_+=b.move(f.safe(o.url,{before:_,after:'>',...b.current()})),_+=b.move('>')):(v=f.enter('destinationRaw'),_+=b.move(f.safe(o.url,{before:_,after:o.title?' ':'\n',...b.current()})));v(),o.title&&(v=f.enter(`title${l}`),_+=b.move(' '+c),_+=b.move(f.safe(o.title,{before:_,after:c,...b.current()})),_+=b.move(c),v());return s(),_};var t=r(d[0])},2549,[2550]);
88
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkQuote=function(t){const o=t.options.quote||'"';if('"'!==o&&"'"!==o)throw new Error('Cannot serialize title with `'+o+'` for `options.quote`, expected `"`, or `\'`');return o}},2550,[]);
89
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.emphasis=t;var n=r(d[0]);function t(n,t,s,o){const c=s.enter('phrasing'),u=s.containerPhrasing({type:'root',children:[n]},o);return c(),u}t.attention=function(t,s){return{construct:'emphasis',markers:'*'===(0,n.checkEmphasis)(s)?['*','_']:['_','*'],sizes:[1]}},t.peek=function(n,t,s){return s.options.emphasis||'*'}},2551,[2552]);
90
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkEmphasis=function(s){const o=s.options.emphasis||'*';if('*'!==o&&'_'!==o)throw new Error('Cannot serialize emphasis with `'+o+'` for `options.emphasis`, expected `*`, or `_`');return o}},2552,[]);
91
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.heading=function(c,o,s,h){const f=Math.max(Math.min(6,c.depth||1),1),u=s.createTracker(h);if((0,n.formatHeadingAsSetext)(c,s)){const t=s.enter('headingSetext'),n=s.enter('phrasing'),o=s.containerPhrasing(c,{...u.current(),before:'\n',after:'\n'});return n(),t(),o+'\n'+(1===f?'=':'-').repeat(o.length-(Math.max(o.lastIndexOf('\r'),o.lastIndexOf('\n'))+1))}const l='#'.repeat(f),x=s.enter('headingAtx'),p=s.enter('phrasing');u.move(l+' ');let A=s.containerPhrasing(c,{before:'# ',after:'\n',...u.current()});const M=A.charCodeAt(0);9!==M&&32!==M||(A=(0,t.encodeCharacterReference)(M)+A.slice(1));A=A?l+' '+A:l,s.options.closeAtx&&(A+=' '+l);return p(),x(),A};var t=r(d[0]),n=r(d[1])},2553,[2554,2555]);
92
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.encodeCharacterReference=function(t){return'&#x'+t.toString(16).toUpperCase()+';'}},2554,[]);
93
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.formatHeadingAsSetext=function(o,u){let s=!1;return(0,t.visit)(o,function(n){if('value'in n&&/\r?\n|\r/.test(n.value)||'break'===n.type)return s=!0,t.EXIT}),Boolean((!o.depth||o.depth<3)&&(0,n.toString)(o)&&(u.options.setext||s))};var t=r(d[0]),n=r(d[1])},2555,[2556,2472]);
94
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CONTINUE",{enumerable:!0,get:function(){return t.CONTINUE}}),Object.defineProperty(e,"EXIT",{enumerable:!0,get:function(){return t.EXIT}}),Object.defineProperty(e,"SKIP",{enumerable:!0,get:function(){return t.SKIP}}),Object.defineProperty(e,"visit",{enumerable:!0,get:function(){return t.visit}});var t=r(d[0])},2556,[2557]);
95
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CONTINUE",{enumerable:!0,get:function(){return t.CONTINUE}}),Object.defineProperty(e,"EXIT",{enumerable:!0,get:function(){return t.EXIT}}),Object.defineProperty(e,"SKIP",{enumerable:!0,get:function(){return t.SKIP}}),e.visit=function(n,o,u,c){let f,l,b;'function'==typeof o&&'function'!=typeof u?(l=void 0,b=o,f=u):(l=o,b=u,f=c);(0,t.visitParents)(n,l,function(t,n){const o=n[n.length-1],u=o?o.children.indexOf(t):void 0;return b(t,u,o)},f)};var t=r(d[0])},2557,[2558]);
96
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CONTINUE",{enumerable:!0,get:function(){return t.CONTINUE}}),Object.defineProperty(e,"EXIT",{enumerable:!0,get:function(){return t.EXIT}}),Object.defineProperty(e,"SKIP",{enumerable:!0,get:function(){return t.SKIP}}),Object.defineProperty(e,"visitParents",{enumerable:!0,get:function(){return t.visitParents}});var t=r(d[0])},2558,[2559]);
97
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CONTINUE",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"EXIT",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"SKIP",{enumerable:!0,get:function(){return u}}),e.visitParents=function(c,y,p,s){let b;'function'==typeof y&&'function'!=typeof p?(s=p,p=y):b=y;const h=(0,n.convert)(b),v=s?-1:1;!(function n(c,b,P){const j=c&&'object'==typeof c?c:{};if('string'==typeof j.type){const n='string'==typeof j.tagName?j.tagName:'string'==typeof j.name?j.name:void 0;Object.defineProperty(O,'name',{value:'node ('+(0,t.color)(c.type+(n?'<'+n+'>':''))+')'})}return O;function O(){let t,j,O,N=o;if((!y||h(c,b,P[P.length-1]||void 0))&&(N=l(p(c,P)),N[0]===f))return N;if('children'in c&&c.children){const o=c;if(o.children&&N[0]!==u)for(j=(s?o.children.length:-1)+v,O=P.concat(o);j>-1&&j<o.children.length;){if(t=n(o.children[j],j,O)(),t[0]===f)return t;j='number'==typeof t[1]?t[1]:j+v}}return N}})(c,void 0,[])()};var n=r(d[0]),t=r(d[1]);const o=[],c=!0,f=!1,u='skip';function l(n){return Array.isArray(n)?n:'number'==typeof n?[c,n]:null==n?o:[n]}},2559,[2537,2560]);
98
+ __d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.color=function(t){return t}},2560,[]);
99
+ __d(function(g,r,i,a,m,e,d){"use strict";function t(t){return t.value||''}Object.defineProperty(e,'__esModule',{value:!0}),e.html=t,t.peek=function(){return'<'}},2561,[]);
100
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.image=o;var t=r(d[0]);function o(o,n,u,l){const f=(0,t.checkQuote)(u),c='"'===f?'Quote':'Apostrophe',s=u.enter('image');let v=u.enter('label');const b=u.createTracker(l);let p=b.move('![');return p+=b.move(u.safe(o.alt,{before:p,after:']',...b.current()})),p+=b.move(']('),v(),!o.url&&o.title||/[\0- \u007F]/.test(o.url)?(v=u.enter('destinationLiteral'),p+=b.move('<'),p+=b.move(u.safe(o.url,{before:p,after:'>',...b.current()})),p+=b.move('>')):(v=u.enter('destinationRaw'),p+=b.move(u.safe(o.url,{before:p,after:o.title?' ':')',...b.current()}))),v(),o.title&&(v=u.enter(`title${c}`),p+=b.move(' '+f),p+=b.move(u.safe(o.title,{before:p,after:f,...b.current()})),p+=b.move(f),v()),p+=b.move(')'),s(),p}o.peek=function(){return'!'}},2562,[2550]);
101
+ __d(function(g,r,i,a,m,e,_d){"use strict";function t(t,n,c,o){const s=t.referenceType,f=c.enter('imageReference');let u=c.enter('label');const l=c.createTracker(o);let k=l.move('![');const v=c.safe(t.alt,{before:k,after:']',...l.current()});k+=l.move(v+']['),u();const b=c.stack;c.stack=b.filter(function(t){return'phrasing'!==t}),u=c.enter('reference');const d=c.safe(c.associationId(t),{before:k,after:']',...l.current()});return u(),c.stack=b,f(),'full'!==s&&v&&v===d?'shortcut'===s?k=k.slice(0,-1):k+=l.move(']'):k+=l.move(d+']'),k}Object.defineProperty(e,'__esModule',{value:!0}),e.imageReference=t,t.peek=function(){return'!'}},2563,[]);
102
+ __d(function(g,r,i,a,m,e,d){"use strict";function t(t,n,o){let c=t.value||'',s='`',u=-1;for(;new RegExp('(^|[^`])'+s+'([^`]|$)').test(c);)s+='`';for(/[^\n\r ]/.test(c)&&(/^[\n\r ]/.test(c)&&/[\n\r ]$/.test(c)||/^`|`$/.test(c))&&(c=' '+c+' ');++u<o.unsafe.length;){const t=o.unsafe[u],n=o.compilePattern(t);if(!t.atBreak)continue;let s;for(;s=n.exec(c);){let t=s.index;10===c.charCodeAt(t)&&13===c.charCodeAt(t-1)&&t--,c=c.slice(0,t)+' '+c.slice(s.index+1)}}return s+c+s}Object.defineProperty(e,'__esModule',{value:!0}),e.inlineCode=t,t.peek=function(){return'`'}},2564,[]);
103
+ __d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.link=o;var t=r(_d[0]),n=r(_d[1]);function o(o,u,c,f){const l=(0,t.checkQuote)(c),s='"'===l?'Quote':'Apostrophe',v=c.createTracker(f);if((0,n.formatLinkAsAutolink)(o,c)){const t=c.stack;c.stack=t.filter(function(t){return'phrasing'!==t});const n=c.enter('autolink');let u=v.move('<');return u+=v.move(c.containerPhrasing(o,{before:u,after:'>',...v.current()})),u+=v.move('>'),n(),c.stack=t,u}const k=c.enter('link');let b=c.enter('label'),d=v.move('[');return d+=v.move(c.containerPhrasing(o,{before:d,after:'](',...v.current()})),d+=v.move(']('),b(),!o.url&&o.title||/[\0- \u007F]/.test(o.url)?(b=c.enter('destinationLiteral'),d+=v.move('<'),d+=v.move(c.safe(o.url,{before:d,after:'>',...v.current()})),d+=v.move('>')):(b=c.enter('destinationRaw'),d+=v.move(c.safe(o.url,{before:d,after:o.title?' ':')',...v.current()}))),b(),o.title&&(b=c.enter(`title${s}`),d+=v.move(' '+l),d+=v.move(c.safe(o.title,{before:d,after:l,...v.current()})),d+=v.move(l),b()),d+=v.move(')'),k(),d}o.peek=function(t,o,u){return(0,n.formatLinkAsAutolink)(t,u)?'<':'['}},2565,[2550,2566]);
104
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.formatLinkAsAutolink=function(n,l){const o=(0,t.toString)(n);return Boolean(!l.options.resourceLink&&n.url&&!n.title&&n.children&&1===n.children.length&&'text'===n.children[0].type&&(o===n.url||'mailto:'+o===n.url)&&/^[a-z][+\-.a-z]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))};var t=r(d[0])},2566,[2472]);
105
+ __d(function(g,r,i,a,m,e,_d){"use strict";function t(t,n,c,o){const s=t.referenceType,f=c.enter('linkReference');let u=c.enter('label');const l=c.createTracker(o);let k=l.move('[');const v=c.containerPhrasing(t,{before:k,after:']',...l.current()});k+=l.move(v+']['),u();const b=c.stack;c.stack=b.filter(function(t){return'phrasing'!==t}),u=c.enter('reference');const d=c.safe(c.associationId(t),{before:k,after:']',...l.current()});return u(),c.stack=b,f(),'full'!==s&&v&&v===d?'shortcut'===s?k=k.slice(0,-1):k+=l.move(']'):k+=l.move(d+']'),k}Object.defineProperty(e,'__esModule',{value:!0}),e.linkReference=t,t.peek=function(){return'['}},2567,[]);
106
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.list=function(s,h,k,u){const o=k.enter('list'),b=k.bulletCurrent;let f=s.ordered?(0,c.checkBulletOrdered)(k):(0,t.checkBullet)(k);const x=s.ordered?'.'===f?')':'.':(0,l.checkBulletOther)(k);let S=!(!h||!k.bulletLastUsed)&&f===k.bulletLastUsed;if(!s.ordered){const t=s.children?s.children[0]:void 0;if('*'!==f&&'-'!==f||!t||t.children&&t.children[0]||'list'!==k.stack[k.stack.length-1]||'listItem'!==k.stack[k.stack.length-2]||'list'!==k.stack[k.stack.length-3]||'listItem'!==k.stack[k.stack.length-4]||0!==k.indexStack[k.indexStack.length-1]||0!==k.indexStack[k.indexStack.length-2]||0!==k.indexStack[k.indexStack.length-3]||(S=!0),(0,n.checkRule)(k)===f&&t){let t=-1;for(;++t<s.children.length;){const l=s.children[t];if(l&&'listItem'===l.type&&l.children&&l.children[0]&&'thematicBreak'===l.children[0].type){S=!0;break}}}}S&&(f=x);k.bulletCurrent=f;const B=k.containerFlow(s,u);return k.bulletLastUsed=f,k.bulletCurrent=b,o(),B};var t=r(d[0]),l=r(d[1]),c=r(d[2]),n=r(d[3])},2568,[2569,2570,2571,2572]);
107
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkBullet=function(t){const o=t.options.bullet||'*';if('*'!==o&&'+'!==o&&'-'!==o)throw new Error('Cannot serialize items with `'+o+'` for `options.bullet`, expected `*`, `+`, or `-`');return o}},2569,[]);
108
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkBulletOther=function(o){const n=(0,t.checkBullet)(o),l=o.options.bulletOther;if(!l)return'*'===n?'-':'*';if('*'!==l&&'+'!==l&&'-'!==l)throw new Error('Cannot serialize items with `'+l+'` for `options.bulletOther`, expected `*`, `+`, or `-`');if(l===n)throw new Error('Expected `bullet` (`'+n+'`) and `bulletOther` (`'+l+'`) to be different');return l};var t=r(d[0])},2570,[2569]);
109
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkBulletOrdered=function(t){const o=t.options.bulletOrdered||'.';if('.'!==o&&')'!==o)throw new Error('Cannot serialize items with `'+o+'` for `options.bulletOrdered`, expected `.` or `)`');return o}},2571,[]);
110
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkRule=function(o){const t=o.options.rule||'*';if('*'!==t&&'-'!==t&&'_'!==t)throw new Error('Cannot serialize rules with `'+t+'` for `options.rule`, expected `*`, `-`, or `_`');return t}},2572,[]);
111
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.listItem=function(s,c,l,o){const u=(0,n.checkListItemIndent)(l);let p=l.bulletCurrent||(0,t.checkBullet)(l);c&&'list'===c.type&&c.ordered&&(p=('number'==typeof c.start&&c.start>-1?c.start:1)+(!1===l.options.incrementListMarker?0:c.children.indexOf(s))+p);let f=p.length+1;('tab'===u||'mixed'===u&&(c&&'list'===c.type&&c.spread||s.spread))&&(f=4*Math.ceil(f/4));const h=l.createTracker(o);h.move(p+' '.repeat(f-p.length)),h.shift(f);const b=l.enter('listItem'),k=l.indentLines(l.containerFlow(s,h.current()),function(t,n,s){if(n)return(s?'':' '.repeat(f))+t;return(s?p:p+' '.repeat(f-p.length))+t});return b(),k};var t=r(d[0]),n=r(d[1])},2573,[2569,2574]);
112
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkListItemIndent=function(t){const n=t.options.listItemIndent||'one';if('tab'!==n&&'one'!==n&&'mixed'!==n)throw new Error('Cannot serialize items with `'+n+'` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`');return n}},2574,[]);
113
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.paragraph=function(n,t,c,o){const p=c.enter('paragraph'),s=c.enter('phrasing'),u=c.containerPhrasing(n,o);return s(),p(),u}},2575,[]);
114
+ __d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.root=function(t,o,c,u){if(!t.children.some(function(t){return(0,n.phrasing)(t)}))return c.containerFlow(t,u);const s=c.enter('phrasing'),f=c.containerPhrasing(t,u);return s(),f};var n=r(_d[0])},2576,[2535]);
115
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.strong=t;var n=r(d[0]);function t(n,t,o,s){const c=o.enter('phrasing'),u=o.containerPhrasing({type:'root',children:[n]},s);return c(),u}t.attention=function(t,o){return{construct:'strong',markers:'*'===(0,n.checkStrong)(o)?['*','_']:['_','*'],sizes:[2]}},t.peek=function(n,t,o){return o.options.strong||'*'}},2577,[2578]);
116
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkStrong=function(o){const t=o.options.strong||'*';if('*'!==t&&'_'!==t)throw new Error('Cannot serialize strong with `'+t+'` for `options.strong`, expected `*`, or `_`');return t}},2578,[]);
117
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.text=function(t,n,o,f){const u=n?n.children:[],c=u.indexOf(t);return o.safe(t.value,{...f,afterNode:u[c+1],beforeNode:u[c-1]})}},2579,[]);
118
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.thematicBreak=function(n,o,u){const s=((0,c.checkRule)(u)+(u.options.ruleSpaces?' ':'')).repeat((0,t.checkRuleRepetition)(u));return u.options.ruleSpaces?s.slice(0,-1):s};var t=r(d[0]),c=r(d[1])},2580,[2581,2572]);
119
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.checkRuleRepetition=function(t){const o=t.options.ruleRepetition||3;if(o<3)throw new Error('Cannot serialize rules with repetition `'+o+'` for `options.ruleRepetition`, expected `3` or more');return o}},2581,[]);
120
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"join",{enumerable:!0,get:function(){return p}});var t=r(d[0]),n=r(d[1]),o=r(d[2]);const p=[function(p,f,u,y){if('code'===f.type&&(0,t.formatCodeAsIndented)(f,y)&&('list'===p.type||p.type===f.type&&(0,t.formatCodeAsIndented)(p,y)))return!1;if('spread'in u&&'boolean'==typeof u.spread){if('paragraph'===p.type&&(p.type===f.type||'definition'===f.type||'heading'===f.type&&(0,n.formatHeadingAsSetext)(f,y)))return;if('html'===p.type){const t=(0,o.htmlKind)(p.value);if(void 0===t||6===t||7===t)return 1}if('paragraph'===p.type&&'html'===f.type){const t=(0,o.htmlKind)(f.value);if(void 0===t||7===t)return 1}return u.spread?1:0}}]},2582,[2547,2555,2583]);
121
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.htmlKind=function(n){if(60!==n.charCodeAt(0))return;const o=n.charCodeAt(1);if(33===o){const c=n.charCodeAt(2);return 45===c?2:91===c?5:(0,t.asciiAlpha)(c)?4:void 0}if(63===o)return 3;const s=47===o,u=s?2:1;let l=u,h=n.charCodeAt(l);if(!(0,t.asciiAlpha)(h))return;for(;45===h||(0,t.asciiAlphanumeric)(h);)h=n.charCodeAt(++l);const f=n.slice(u,l).toLowerCase();if(!s&&47!==h&&c.htmlRawNames.includes(f))return 1;return c.htmlBlockNames.includes(f)?6:7};var t=r(d[0]),c=r(d[1])},2583,[2483,2514]);
122
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"unsafe",{enumerable:!0,get:function(){return n}});const t=['autolink','destinationLiteral','destinationRaw','reference','titleQuote','titleApostrophe'],n=[{character:'\t',after:'[\\r\\n]',inConstruct:'phrasing'},{character:'\t',before:'[\\r\\n]',inConstruct:'phrasing'},{character:'\t',inConstruct:['codeFencedLangGraveAccent','codeFencedLangTilde']},{character:'\r',inConstruct:['codeFencedLangGraveAccent','codeFencedLangTilde','codeFencedMetaGraveAccent','codeFencedMetaTilde','destinationLiteral','headingAtx']},{character:'\n',inConstruct:['codeFencedLangGraveAccent','codeFencedLangTilde','codeFencedMetaGraveAccent','codeFencedMetaTilde','destinationLiteral','headingAtx']},{character:'\r',before:'[\\r\\n]',inConstruct:'phrasing'},{character:'\r',after:'\\r',inConstruct:'phrasing'},{character:'\n',before:'\\n',inConstruct:'phrasing'},{character:'\n',after:'[\\r\\n]',inConstruct:'phrasing'},{character:' ',after:'[\\r\\n]',inConstruct:'phrasing'},{character:' ',before:'[\\r\\n]',inConstruct:'phrasing'},{character:' ',inConstruct:['codeFencedLangGraveAccent','codeFencedLangTilde']},{character:'!',after:'\\[',inConstruct:'phrasing',notInConstruct:t},{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:t},{atBreak:!0,before:'\\d+',character:')'},{character:')',inConstruct:'destinationRaw'},{atBreak:!0,character:'*',after:'(?:[ \t\r\n*])'},{character:'*',inConstruct:'phrasing',notInConstruct:t},{atBreak:!0,character:'+',after:'(?:[ \t\r\n])'},{atBreak:!0,character:'-',after:'(?:[ \t\r\n-])'},{atBreak:!0,before:'\\d+',character:'.',after:'(?:[ \t\r\n]|$)'},{atBreak:!0,character:'<',after:'[!/?A-Za-z]'},{character:'<',after:'[!/?A-Za-z]',inConstruct:'phrasing',notInConstruct:t},{character:'<',inConstruct:'destinationLiteral'},{atBreak:!0,character:'='},{atBreak:!0,character:'>'},{character:'>',inConstruct:'destinationLiteral'},{atBreak:!0,character:'['},{character:'[',inConstruct:'phrasing',notInConstruct:t},{character:'[',inConstruct:['label','reference']},{character:'\\',after:'[\\r\\n]',inConstruct:'phrasing'},{character:']',inConstruct:['label','reference']},{atBreak:!0,character:'_'},{character:'_',inConstruct:'phrasing',notInConstruct:t},{atBreak:!0,character:'`'},{character:'`',inConstruct:['codeFencedLangGraveAccent','codeFencedMetaGraveAccent']},{character:'`',inConstruct:'phrasing',notInConstruct:t},{atBreak:!0,character:'~'},{character:'<',inConstruct:'autolink'},{character:'>',inConstruct:'autolink'},{character:'\x7f',inConstruct:'autolink'}];let c=-1;for(;++c<33;)n.push({character:String.fromCharCode(c),inConstruct:'autolink'})},2584,[]);
123
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.association=function(n){if(n.label||!n.identifier)return n.label||'';return(0,t.decodeString)(n.identifier)};var t=r(d[0])},2585,[2528]);
124
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.compilePattern=function(t){if(!t._compiled){const o=(t.atBreak?'[\\r\\n][\\t ]*':'')+(t.before?'(?:'+t.before+')':'');t._compiled=new RegExp((t.beforeNode?'^':o?'('+o+')':'')+(/[$()*+.?[\\\]^{|}]/.test(t.character)?'\\':'')+t.character+(t.afterNode?'$':t.after?'(?:'+t.after+')':''),t.unicode?'gu':'g')}return t._compiled}},2586,[]);
125
+ __d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.containerPhrasing=function(t,n,o){return A(C(t,n,o),o.before,o.after)};var t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),s=r(_d[3]),c=r(_d[4]),l=r(_d[5]);const h=new Map([['*',!1],['_',!0]]);function f(t,n,o){const s=new Set;for(const c of t){const t=o.get(c);if(t&&c.attention&&n.some(t=>t.attention===c.attention))for(const n of t.tokens)s.add(n.attention)}const c=[];for(const n of t)n.attention&&s.delete(n.attention)&&c.push(n.attention);return c.reverse(),c}function u(t,o,s){const c=[],l=new Map,u=new Map;let d=0;for(;d<t.length;){if(!t[d].attention){d++;continue}const f=t[d].value.charAt(0),p=h.get(f);let v=d+1;for(;v<t.length&&t[v].attention&&t[v].value.charAt(0)===f;)v++;const k=d?t[d-1].value:o,C=(0,n.classifyCharacter)(k.charCodeAt(k.length-1)),w=(0,n.classifyCharacter)((v<t.length?t[v].value:s).charCodeAt(0)),A=!w||2===w&&Boolean(C),b=!C||2===C&&Boolean(w),y={tokens:t.slice(d,v),markers:[],start:0,end:0,open:p?A&&(Boolean(C)||!b):A,close:p?b&&(Boolean(w)||!A):b,split:void 0!==p};for(const t of y.tokens){l.set(t,[...y.tokens]),u.set(t,y);let n=t.value.length;for(;n--;)y.markers.push(t)}y.end=y.markers.length,c.push(y),d=v}for(v(c,l),d=-1;++d<t.length;){const n=l.get(t[d]);if(n)return{attention:f(t,n,u),index:d}}}function d(t,n){const c=t[n?0:t.length-1];if(!c||c.attention)return;const l=n?(0,o.firstCharacter)(c.value):(0,o.lastCharacter)(c.value),h=(0,s.encodeCharacterReference)(l.codePointAt(0));c.value=n?h+c.value.slice(l.length):c.value.slice(0,c.value.length-l.length)+h}function p(t,n,o,s,c){for(const l of o.attention){const h=n.get(l)||l.sequences[0];for(const f of l.sequences){if(f===h)continue;const d=new Map(n);d.set(l,f);const p=w(t,d,s,c),v=u(p,s,c);if(!v||v.index>o.index)return{chosen:d,mistake:v,tokens:p}}}}function v(t,n){let o=0;for(;o<t.length;){const s=t[o],c=s.tokens[0].value.charAt(0),l=s.end-s.start;let h=s.close&&l?o:0;for(;h--;){const o=t[h],f=o.end-o.start;if(o.tokens[0].value.charAt(0)===c&&o.open&&f&&(s.split?!((o.close||s.open)&&l%3)||(f+l)%3:f===o.markers.length&&f===l)){const t=s.split?f>1&&l>1?2:1:l,c=o.markers.slice(o.end-t,o.end),h=s.markers.slice(s.start,s.start+t),u=c[0],d=h[0];if(u===c[t-1]&&u.value.length===t&&d===h[t-1]&&d.value.length===t&&u.attention===d.attention)n.delete(u),n.delete(d);else{const t=[...new Set([...c,...h])];for(const o of t){const s=n.get(o);s&&s.push(...t)}}o.end-=t,s.start+=t;break}}-1!==h&&s.start!==s.end||o++}}function k(n,o,s){if(0===o.length)throw new Error('Cannot serialize `'+n+'` as attention without markers, expected one or more markers');if(0===s.length)throw new Error('Cannot serialize `'+n+'` as attention without sizes, expected one or more sizes');for(const t of s)if(!Number.isSafeInteger(t)||t<1)throw new Error('Cannot serialize `'+n+'` as attention with `'+t+'` as size, expected positive integer');const c=[];for(const l of o){if(1!==l.length)throw new Error('Cannot serialize `'+n+'` as attention with `'+l+'` as marker, expected a single ascii character');if(!(0,t.asciiPunctuation)(l.charCodeAt(0)))throw new Error('Cannot serialize `'+n+'` as attention with `'+l+'` as marker, expected ascii punctuation');for(const t of s)c.push(l.repeat(t))}return c}function C(t,n,s){const c=n.indexStack,h=t.children||[],f=[];let u=-1,d=s.before;c.push(-1);let p=n.createTracker(s);for(;++u<h.length;){const v=h[u];let w;if(c[c.length-1]=u,u+1<h.length){let s=n.handle.handlers[h[u+1].type];s&&s.peek&&(s=s.peek),w=s?(0,o.firstCharacter)(s(h[u+1],t,n,{before:'',after:'',...p.current()})):''}else w=s.after;const b=f[f.length-1];'string'!=typeof b||'\r'!==d&&'\n'!==d||'html'!==v.type||7===(0,l.htmlKind)(v.value)||(f[f.length-1]=b.replace(/(\r?\n|\r)$/,' '),d=' ',p=n.createTracker(s),p.move(A(f,s.before,s.after)));const y=n.handle.handlers[v.type];if(y&&y.attention){const{construct:t,markers:o,sizes:s}=y.attention(v,n),c=k(v.type,o,s),l=c[0],h=n.enter(t);p.move(l);const u=C(v,n,{...p.current(),before:l,after:l});p.move(A(u,l,l)),p.move(l),h(),f.push({children:u,sequences:c}),d=l.charAt(l.length-1)}else{const s=n.handle(v,t,n,{...p.current(),after:w,before:d});if(!s)continue;p.move(s),f.push(s),d=(0,o.lastCharacter)(s)}}return c.pop(),f}function w(t,n,s,l){const h=[];let f,u=(0,o.lastCharacter)(s),p=-1;for(;++p<t.length;){const s=t[p];if('string'==typeof s){const t={value:s,attention:void 0};f&&f===(0,o.firstCharacter)(s)&&d([t],!0),f=void 0,h.push(t),t.value&&(u=(0,o.lastCharacter)(t.value));continue}const v=n.get(s)||s.sequences[0],k=v.charAt(0),C=t[p+1],A=u,b=(0,o.firstCharacter)(void 0===C?l:'string'==typeof C?C:n.get(C)||C.sequences[0]),y=w(s.children,n,v,v),x=y.length>0?y[0].value:'',z=(0,c.encodeInfo)(A.charCodeAt(A.length-1),x.charCodeAt(0),k);z.inside&&d(y,!0);const M=y.length>0?(0,o.lastCharacter)(y[y.length-1].value):'',q=(0,c.encodeInfo)(b.charCodeAt(0),M.charCodeAt(M.length-1),k);q.inside&&d(y,!1),z.outside&&'\n'!==A&&'\r'!==A&&d(h,!1),q.outside&&(f=b),h.push({value:v,attention:s},...y,{value:v,attention:s}),u=v.charAt(v.length-1)}return h}function A(t,n,o){let s=new Map;const c=w(t,s,n,o);let l=c,h=u(l,n,o);for(;h;){const f=p(t,s,h,n,o);if(!f){l=c;break}s=f.chosen,l=f.tokens,h=f.mistake}let f='';for(const t of l)f+=t.value;return f}},2587,[2483,2492,2588,2554,2589,2583]);
126
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.firstCharacter=function(t){const n=t.codePointAt(0);return void 0===n?'':String.fromCodePoint(n)},e.lastCharacter=function(t){const n=t.codePointAt(t.length-2);return void 0!==n&&n>65535?t.slice(-2):t.slice(-1)}},2588,[]);
127
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.encodeInfo=function(t,n,o){const u=(0,s.classifyCharacter)(t),c=(0,s.classifyCharacter)(n);if(void 0===u)return void 0===c?'_'===o?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===c?{inside:!0,outside:!0}:{inside:!1,outside:!0};if(1===u)return void 0===c?{inside:!1,outside:!1}:1===c?{inside:!0,outside:!0}:{inside:!1,outside:!1};return void 0===c?{inside:!1,outside:!1}:1===c?{inside:!0,outside:!1}:{inside:!1,outside:!1}};var s=r(d[0])},2589,[2492]);
128
+ __d(function(g,r,i,a,m,e,d){"use strict";function n(n,t,o,u){let c=u.join.length;for(;c--;){const l=u.join[c](n,t,o,u);if(!0===l||1===l)break;if('number'==typeof l)return'\n'.repeat(1+l);if(!1===l)return'\n\n\x3c!----\x3e\n\n'}return'\n\n'}Object.defineProperty(e,'__esModule',{value:!0}),e.containerFlow=function(t,o,u){const c=o.indexStack,l=t.children||[],f=o.createTracker(u),s=[];let h=-1;c.push(-1);for(;++h<l.length;){const u=l[h];c[c.length-1]=h,s.push(f.move(o.handle(u,t,o,{before:'\n',after:'\n',...f.current()}))),'list'!==u.type&&(o.bulletLastUsed=void 0),h<l.length-1&&s.push(f.move(n(u,l[h+1],t,o)))}return c.pop(),s.join('')}},2590,[]);
129
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.indentLines=function(t,c){const s=[];let o,u=0,l=0;for(;o=n.exec(t);)f(t.slice(u,o.index)),s.push(o[0]),u=o.index+o[0].length,l++;return f(t.slice(u)),s.join('');function f(n){s.push(c(n,l,!n))}};const n=/\r?\n|\r/g},2591,[]);
130
+ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.safe=function(l,h,u){const p=(u.before||'')+(h||'')+(u.after||''),b=[],A=[],C={},_=l.stack.includes('autolink'),y=u.before?u.before.length:0,N=p.length-(u.after?u.after.length:0);let v=-1;for(;++v<l.unsafe.length;){const t=l.unsafe[v];if(!(0,n.patternInScope)(l.stack,t)||!a(t.beforeNode,u.beforeNode)||!a(t.afterNode,u.afterNode))continue;const o=l.compilePattern(t),f=t.beforeNode?y:0,s=p.slice(f,t.afterNode?N:void 0);let h;for(;h=o.exec(s);){const o='before'in t||Boolean(t.atBreak),n='after'in t,a=f+h.index+(o?h[1].length:0);c.call(C,a)?(C[a].before&&!o&&(C[a].before=!1),C[a].after&&!n&&(C[a].after=!1)):(b.push(a),C[a]={before:o,after:n})}}b.sort(f);let k=y;v=-1;for(;++v<b.length;){const n=b[v];if(!(n<k||n>=N)){if('_'===p.charAt(n)&&n>0&&void 0===(0,t.classifyCharacter)(p.charCodeAt(n-1))&&!c.call(C,n-1)&&(n-1!==y||!/[*_]/.test(p.charAt(y-1)))){let o=n+1;for(;o<N&&'_'===p.charAt(o);)o++;const a=o-n-1;if(b[v+a]===o-1&&o<p.length&&void 0===(0,t.classifyCharacter)(p.charCodeAt(o))&&!c.call(C,o)&&(o!==N-1||!/[*_]/.test(p.charAt(N)))){v+=a;continue}}if(!(n+1<N&&b[v+1]===n+1&&C[n].after&&!C[n+1].before&&!C[n+1].after||b[v-1]===n-1&&C[n].before&&!C[n-1].before&&!C[n-1].after)){if(k!==n){const t=p.slice(k,n);A.push(_?t:s(t,'\\'))}k=n,_?(A.push('%'+p.charCodeAt(n).toString(16).toUpperCase().padStart(2,'0')),k++):!/[!-/:-@[-`{-~]/.test(p.charAt(n))||u.encode&&u.encode.includes(p.charAt(n))?(A.push((0,o.encodeCharacterReference)(p.charCodeAt(n))),k++):A.push('\\')}}}const x=p.slice(k,N);return A.push(_?x:s(x,u.after)),A.join('')};var t=r(d[0]),o=r(d[1]),n=r(d[2]);const c={}.hasOwnProperty;function a(t,o){return!t||!!o&&('string'==typeof t?t===o.type:t.includes(o.type))}function f(t,o){return t-o}function s(t,o){const n=/\\(?=[!-/:-@[-`{-~])/g,c=[],a=[],f=t+o;let s,l=-1,h=0;for(;s=n.exec(f);)c.push(s.index);for(;++l<c.length;)h!==c[l]&&a.push(t.slice(h,c[l])),a.push('\\'),h=c[l];return a.push(t.slice(h)),a.join('')}},2592,[2492,2554,2544]);
131
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.track=function(n){const t=n||{},l=t.now||{};let o=t.lineShift||0,u=l.line||1,c=l.column||1;return{move:function(n){const t=n||'',l=t.split(/\r?\n|\r/g),f=l[l.length-1];return u+=l.length-1,c=1===l.length?c+f.length:1+f.length+o,t},current:function(){return{now:{line:u,column:c},lineShift:o}},shift:function(n){o+=n}}}},2593,[]);
132
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"unified",{enumerable:!0,get:function(){return n.unified}});var n=r(d[0])},2594,[2595]);
133
+ __d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"Processor",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"unified",{enumerable:!0,get:function(){return p}});var t=r(d[0]),n=e(r(d[1])),s=r(d[2]),o=e(r(d[3])),c=r(d[4]),f=r(d[5]),u=r(d[6]);const h={}.hasOwnProperty;class l extends u.CallableInstance{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=(0,c.trough)()}copy(){const e=new l;let t=-1;for(;++t<this.attachers.length;){const n=this.attachers[t];e.use(...n)}return e.data((0,n.default)(!0,{},this.namespace)),e}data(e,t){return'string'==typeof e?2===arguments.length?(b('data',this.frozen),this.namespace[e]=t,this):h.call(this.namespace,e)&&this.namespace[e]||void 0:e?(b('data',this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[t,...n]=this.attachers[this.freezeIndex];if(!1===n[0])continue;!0===n[0]&&(n[0]=void 0);const s=t.call(e,...n);'function'==typeof s&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const t=E(e),n=this.parser||this.Parser;return y('parse',n),n(String(t),t)}process(e,t){const n=this;return this.freeze(),y('process',this.parser||this.Parser),w('process',this.compiler||this.Compiler),t?o(void 0,t):new Promise(o);function o(o,c){const f=E(e),u=n.parse(f);function h(e,n){e||!n?c(e):o?o(n):((0,s.ok)(t,'`done` is defined if `resolve` is not'),t(void 0,n))}n.run(u,f,function(e,t,s){if(e||!t||!s)return h(e);const o=t,c=n.stringify(o,s);var f;'string'==typeof(f=c)||x(f)?s.value=c:s.result=c,h(e,s)})}}processSync(e){let n,o=!1;return this.freeze(),y('processSync',this.parser||this.Parser),w('processSync',this.compiler||this.Compiler),this.process(e,function(e,s){o=!0,(0,t.bail)(e),n=s}),z('processSync','process',o),(0,s.ok)(n,'we either bailed on an error or have a tree'),n}run(e,t,n){v(e),this.freeze();const o=this.transformers;return n||'function'!=typeof t||(n=t,t=void 0),n?c(void 0,n):new Promise(c);function c(c,f){(0,s.ok)('function'!=typeof t,'`file` can\u2019t be a `done` anymore, we checked');const u=E(t);o.run(e,u,function(t,o,u){const h=o||e;t?f(t):c?c(h):((0,s.ok)(n,'`done` is defined if `resolve` is not'),n(void 0,h,u))})}}runSync(e,n){let o,c=!1;return this.run(e,n,function(e,n){(0,t.bail)(e),o=n,c=!0}),z('runSync','run',c),(0,s.ok)(o,'we either bailed on an error or have a tree'),o}stringify(e,t){this.freeze();const n=E(t),s=this.compiler||this.Compiler;return w('stringify',s),v(e),s(e,n)}use(e,...t){const s=this.attachers,c=this.namespace;if(b('use',this.frozen),null==e);else if('function'==typeof e)l(e,t);else{if('object'!=typeof e)throw new TypeError('Expected usable value, not `'+e+'`');Array.isArray(e)?h(e):u(e)}return this;function f(e){if('function'==typeof e)l(e,[]);else{if('object'!=typeof e)throw new TypeError('Expected usable value, not `'+e+'`');if(Array.isArray(e)){const[t,...n]=e;l(t,n)}else u(e)}}function u(e){if(!('plugins'in e)&&!('settings'in e))throw new 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');h(e.plugins),e.settings&&(c.settings=(0,n.default)(!0,c.settings,e.settings))}function h(e){let t=-1;if(null==e);else{if(!Array.isArray(e))throw new TypeError('Expected a list of plugins, not `'+e+'`');for(;++t<e.length;){f(e[t])}}}function l(e,t){let c=-1,f=-1;for(;++c<s.length;)if(s[c][0]===e){f=c;break}if(-1===f)s.push([e,...t]);else if(t.length>0){let[c,...u]=t;const h=s[f][1];(0,o.default)(h)&&(0,o.default)(c)&&(c=(0,n.default)(!0,h,c)),s[f]=[e,c,...u]}}}}const p=(new l).freeze();function y(e,t){if('function'!=typeof t)throw new TypeError('Cannot `'+e+'` without `parser`')}function w(e,t){if('function'!=typeof t)throw new TypeError('Cannot `'+e+'` without `compiler`')}function b(e,t){if(t)throw new Error('Cannot call `'+e+'` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.')}function v(e){if(!(0,o.default)(e)||'string'!=typeof e.type)throw new TypeError('Expected node, got `'+e+'`')}function z(e,t,n){if(!n)throw new Error('`'+e+'` finished async. Use `'+t+'` instead')}function E(e){return P(e)?e:new f.VFile(e)}function P(e){return Boolean(e&&'object'==typeof e&&'message'in e&&'messages'in e)}function x(e){return Boolean(e&&'object'==typeof e&&'byteLength'in e&&'byteOffset'in e)}},2595,[2596,2597,2598,2599,2600,2602,2610]);
134
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.bail=function(t){if(t)throw t}},2596,[]);
135
+ __d(function(g,r,_i,a,m,e,d){'use strict';var t=Object.prototype.hasOwnProperty,o=Object.prototype.toString,n=Object.defineProperty,c=Object.getOwnPropertyDescriptor,u=function(t){return'function'==typeof Array.isArray?Array.isArray(t):'[object Array]'===o.call(t)},i=function(n){if(!n||'[object Object]'!==o.call(n))return!1;var c,u=t.call(n,'constructor'),i=n.constructor&&n.constructor.prototype&&t.call(n.constructor.prototype,'isPrototypeOf');if(n.constructor&&!u&&!i)return!1;for(c in n);return void 0===c||t.call(n,c)},l=function(t,o){n&&'__proto__'===o.name?n(t,o.name,{enumerable:!0,configurable:!0,value:o.newValue,writable:!0}):t[o.name]=o.newValue},f=function(o,n){if('__proto__'===n){if(!t.call(o,n))return;if(c)return c(o,n).value}return o[n]};m.exports=function t(){var o,n,c,p,y,s,b=arguments[0],_=1,j=arguments.length,O=!1;for('boolean'==typeof b&&(O=b,b=arguments[1]||{},_=2),(null==b||'object'!=typeof b&&'function'!=typeof b)&&(b={});_<j;++_)if(null!=(o=arguments[_]))for(n in o)c=f(b,n),b!==(p=f(o,n))&&(O&&p&&(i(p)||(y=u(p)))?(y?(y=!1,s=c&&u(c)?c:[]):s=c&&i(c)?c:{},l(b,{name:n,newValue:t(O,s,p)})):void 0!==p&&l(b,{name:n,newValue:p}));return b}},2597,[]);
136
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deprecate=function(n){return n},e.equal=function(){},e.ok=function(){},e.unreachable=function(){}},2598,[]);
137
+ __d(function(g,r,i,a,m,e,d){"use strict";function t(t){if('object'!=typeof t||null===t)return!1;const n=Object.getPrototypeOf(t);return!(null!==n&&n!==Object.prototype&&null!==Object.getPrototypeOf(n)||Symbol.toStringTag in t||Symbol.iterator in t)}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}})},2599,[]);
138
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"trough",{enumerable:!0,get:function(){return t.trough}}),Object.defineProperty(e,"wrap",{enumerable:!0,get:function(){return t.wrap}});var t=r(d[0])},2600,[2601]);
139
+ __d(function(g,r,i,a,m,e,d){"use strict";function n(n,t){let o;return function(...t){const f=n.length>t.length;let l;f&&t.push(u);try{l=n.apply(this,t)}catch(n){if(f&&o)throw n;return u(n)}f||(l&&l.then&&'function'==typeof l.then?l.then(c,u):l instanceof Error?u(l):c(l))};function u(n,...u){o||(o=!0,t(n,...u))}function c(n){u(null,n)}}Object.defineProperty(e,'__esModule',{value:!0}),e.trough=function(){const t=[],o={run:function(...o){let u=-1;const c=o.pop();if('function'!=typeof c)throw new TypeError('Expected function as last argument, not '+c);function f(l,...p){const s=t[++u];let h=-1;if(l)c(l);else{for(;++h<o.length;)null!==p[h]&&void 0!==p[h]||(p[h]=o[h]);o=p,s?n(s,f)(...p):c(null,...p)}}f(null,...o)},use:function(n){if('function'!=typeof n)throw new TypeError('Expected `middelware` to be a function, not '+n);return t.push(n),o}};return o},e.wrap=n},2601,[]);
140
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VFile",{enumerable:!0,get:function(){return t.VFile}});var t=r(d[0])},2602,[2603]);
141
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VFile",{enumerable:!0,get:function(){return p}});var t=r(d[0]),s=r(d[1]),n=r(d[2]),h=r(d[3]);const o=['history','path','basename','stem','extname','dirname'];class p{constructor(t){let s;s=t?(0,h.isUrl)(t)?{path:t}:'string'==typeof t||l(t)?{value:t}:t:{},this.cwd='cwd'in s?'':n.minproc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let p,u=-1;for(;++u<o.length;){const t=o[u];t in s&&void 0!==s[t]&&null!==s[t]&&(this[t]='history'===t?[...s[t]]:s[t])}for(p in s)o.includes(p)||(this[p]=s[p])}get basename(){return'string'==typeof this.path?s.minpath.basename(this.path):void 0}set basename(t){c(t,'basename'),u(t,'basename'),this.path=s.minpath.join(this.dirname||'',t)}get dirname(){return'string'==typeof this.path?s.minpath.dirname(this.path):void 0}set dirname(t){f(this.basename,'dirname'),this.path=s.minpath.join(t||'',this.basename)}get extname(){return'string'==typeof this.path?s.minpath.extname(this.path):void 0}set extname(t){if(u(t,'extname'),f(this.dirname,'extname'),t){if(46!==t.codePointAt(0))throw new Error('`extname` must start with `.`');if(t.includes('.',1))throw new Error('`extname` cannot contain multiple dots')}this.path=s.minpath.join(this.dirname,this.stem+(t||''))}get path(){return this.history[this.history.length-1]}set path(t){(0,h.isUrl)(t)&&(t=(0,h.urlToPath)(t)),c(t,'path'),this.path!==t&&this.history.push(t)}get stem(){return'string'==typeof this.path?s.minpath.basename(this.path,this.extname):void 0}set stem(t){c(t,'stem'),u(t,'stem'),this.path=s.minpath.join(this.dirname||'',t+(this.extname||''))}fail(t,s,n){const h=this.message(t,s,n);throw h.fatal=!0,h}info(t,s,n){const h=this.message(t,s,n);return h.fatal=void 0,h}message(s,n,h){const o=new t.VFileMessage(s,n,h);return this.path&&(o.name=this.path+':'+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){if(void 0===this.value)return'';if('string'==typeof this.value)return this.value;return new TextDecoder(t||void 0).decode(this.value)}}function u(t,n){if(t&&t.includes(s.minpath.sep))throw new Error('`'+n+'` cannot be a path: did not expect `'+s.minpath.sep+'`')}function c(t,s){if(!t)throw new Error('`'+s+'` cannot be empty')}function f(t,s){if(!t)throw new Error('Setting `'+s+'` requires `path` to be set too')}function l(t){return Boolean(t&&'object'==typeof t&&'byteLength'in t&&'byteOffset'in t)}},2603,[2604,2606,2607,2608]);
142
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VFileMessage",{enumerable:!0,get:function(){return t.VFileMessage}});var t=r(d[0])},2604,[2605]);
143
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VFileMessage",{enumerable:!0,get:function(){return o}});var t=r(d[0]);class o extends Error{constructor(o,s,c){super(),'string'==typeof s&&(c=s,s=void 0);let n='',p={},l=!1;if(s&&(p='line'in s&&'column'in s||'start'in s&&'end'in s?{place:s}:'type'in s?{ancestors:[s],place:s.position}:{...s}),'string'==typeof o?n=o:!p.cause&&o&&(l=!0,n=o.message,p.cause=o),!p.ruleId&&!p.source&&'string'==typeof c){const t=c.indexOf(':');-1===t?p.ruleId=c:(p.source=c.slice(0,t),p.ruleId=c.slice(t+1))}if(!p.place&&p.ancestors&&p.ancestors){const t=p.ancestors[p.ancestors.length-1];t&&(p.place=t.position)}const u=p.place&&'start'in p.place?p.place.start:p.place;this.ancestors=p.ancestors||void 0,this.cause=p.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file='',this.message=n,this.line=u?u.line:void 0,this.name=(0,t.stringifyPosition)(p.place)||'1:1',this.place=p.place||void 0,this.reason=this.message,this.ruleId=p.ruleId||void 0,this.source=p.source||void 0,this.stack=l&&p.cause&&'string'==typeof p.cause.stack?p.cause.stack:'',this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}o.prototype.file='',o.prototype.name='',o.prototype.reason='',o.prototype.message='',o.prototype.stack='',o.prototype.column=void 0,o.prototype.line=void 0,o.prototype.ancestors=void 0,o.prototype.cause=void 0,o.prototype.fatal=void 0,o.prototype.place=void 0,o.prototype.ruleId=void 0,o.prototype.source=void 0},2605,[2529]);
144
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"minpath",{enumerable:!0,get:function(){return t}});const t={basename:function(t,n){if(void 0!==n&&'string'!=typeof n)throw new TypeError('"ext" argument must be a string');l(t);let o,f=0,c=-1,s=t.length;if(void 0===n||0===n.length||n.length>t.length){for(;s--;)if(47===t.codePointAt(s)){if(o){f=s+1;break}}else c<0&&(o=!0,c=s+1);return c<0?'':t.slice(f,c)}if(n===t)return'';let u=-1,h=n.length-1;for(;s--;)if(47===t.codePointAt(s)){if(o){f=s+1;break}}else u<0&&(o=!0,u=s+1),h>-1&&(t.codePointAt(s)===n.codePointAt(h--)?h<0&&(c=s):(h=-1,c=u));f===c?c=u:c<0&&(c=t.length);return t.slice(f,c)},dirname:function(t){if(l(t),0===t.length)return'.';let n,o=-1,f=t.length;for(;--f;)if(47===t.codePointAt(f)){if(n){o=f;break}}else n||(n=!0);return o<0?47===t.codePointAt(0)?'/':'.':1===o&&47===t.codePointAt(0)?'//':t.slice(0,o)},extname:function(t){l(t);let n,o=t.length,f=-1,c=0,s=-1,u=0;for(;o--;){const l=t.codePointAt(o);if(47!==l)f<0&&(n=!0,f=o+1),46===l?s<0?s=o:1!==u&&(u=1):s>-1&&(u=-1);else if(n){c=o+1;break}}if(s<0||f<0||0===u||1===u&&s===f-1&&s===c+1)return'';return t.slice(s,f)},join:function(...t){let o,f=-1;for(;++f<t.length;)l(t[f]),t[f]&&(o=void 0===o?t[f]:o+'/'+t[f]);return void 0===o?'.':n(o)},sep:'/'};function n(t){l(t);const n=47===t.codePointAt(0);let f=o(t,!n);return 0!==f.length||n||(f='.'),f.length>0&&47===t.codePointAt(t.length-1)&&(f+='/'),n?'/'+f:f}function o(t,n){let o,l,f='',c=0,s=-1,u=0,h=-1;for(;++h<=t.length;){if(h<t.length)o=t.codePointAt(h);else{if(47===o)break;o=47}if(47===o){if(s===h-1||1===u);else if(s!==h-1&&2===u){if(f.length<2||2!==c||46!==f.codePointAt(f.length-1)||46!==f.codePointAt(f.length-2))if(f.length>2){if(l=f.lastIndexOf('/'),l!==f.length-1){l<0?(f='',c=0):(f=f.slice(0,l),c=f.length-1-f.lastIndexOf('/')),s=h,u=0;continue}}else if(f.length>0){f='',c=0,s=h,u=0;continue}n&&(f=f.length>0?f+'/..':'..',c=2)}else f.length>0?f+='/'+t.slice(s+1,h):f=t.slice(s+1,h),c=h-s-1;s=h,u=0}else 46===o&&u>-1?u++:u=-1}return f}function l(t){if('string'!=typeof t)throw new TypeError('Path must be a string. Received '+JSON.stringify(t))}},2606,[]);
145
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"minproc",{enumerable:!0,get:function(){return n}});const n={cwd:function(){return'/'}}},2607,[]);
146
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"isUrl",{enumerable:!0,get:function(){return t.isUrl}}),e.urlToPath=function(n){if('string'==typeof n)n=new URL(n);else if(!(0,t.isUrl)(n)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+'`');throw t.code='ERR_INVALID_ARG_TYPE',t}if('file:'!==n.protocol){const t=new TypeError('The URL must be of scheme file');throw t.code='ERR_INVALID_URL_SCHEME',t}return o(n)};var t=r(d[0]);function o(t){if(''!==t.hostname){const t=new TypeError('File URL host must be "localhost" or empty on darwin');throw t.code='ERR_INVALID_FILE_URL_HOST',t}const o=t.pathname;let n=-1;for(;++n<o.length;)if(37===o.codePointAt(n)&&50===o.codePointAt(n+1)){const t=o.codePointAt(n+2);if(70===t||102===t){const t=new TypeError('File URL path must not include encoded / characters');throw t.code='ERR_INVALID_FILE_URL_PATH',t}}return decodeURIComponent(o)}},2608,[2609]);
147
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isUrl=function(o){return Boolean(null!==o&&'object'==typeof o&&'href'in o&&o.href&&'protocol'in o&&o.protocol&&void 0===o.auth)}},2609,[]);
148
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CallableInstance",{enumerable:!0,get:function(){return t}});const t=function(t){const n=this.constructor.prototype,o=n[t],c=function(){return o.apply(c,arguments)};return Object.setPrototypeOf(c,n),c}},2610,[]);
149
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2611,[2612]);
150
+ __d(function(g,_r,_i,_a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"autoJoin",{enumerable:!0,get:function(){return K}}),Object.defineProperty(e,"baseKeymap",{enumerable:!0,get:function(){return L}}),Object.defineProperty(e,"chainCommands",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"createParagraphNear",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"deleteSelection",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"exitCode",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"joinBackward",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"joinDown",{enumerable:!0,get:function(){return k}}),Object.defineProperty(e,"joinForward",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"joinTextblockBackward",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"joinTextblockForward",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"joinUp",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"lift",{enumerable:!0,get:function(){return w}}),Object.defineProperty(e,"liftEmptyBlock",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"macBaseKeymap",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"newlineInCode",{enumerable:!0,get:function(){return x}}),Object.defineProperty(e,"pcBaseKeymap",{enumerable:!0,get:function(){return H}}),Object.defineProperty(e,"selectAll",{enumerable:!0,get:function(){return M}}),Object.defineProperty(e,"selectNodeBackward",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"selectNodeForward",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"selectParentNode",{enumerable:!0,get:function(){return B}}),Object.defineProperty(e,"selectTextblockEnd",{enumerable:!0,get:function(){return N}}),Object.defineProperty(e,"selectTextblockStart",{enumerable:!0,get:function(){return v}}),Object.defineProperty(e,"setBlockType",{enumerable:!0,get:function(){return F}}),Object.defineProperty(e,"splitBlock",{enumerable:!0,get:function(){return A}}),Object.defineProperty(e,"splitBlockAs",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"splitBlockKeepMarks",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"toggleMark",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"wrapIn",{enumerable:!0,get:function(){return R}});var t=_r(_d[0]),n=_r(_d[1]),r=_r(_d[2]);const o=(t,n)=>!t.selection.empty&&(n&&n(t.tr.deleteSelection().scrollIntoView()),!0);function l(t,n){let{$cursor:r}=t.selection;return!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const i=(o,i,c)=>{let s=l(o,c);if(!s)return!1;let f=d(s);if(!f){let n=s.blockRange(),r=n&&(0,t.liftTarget)(n);return null!=r&&(i&&i(o.tr.lift(n,r).scrollIntoView()),!0)}let p=f.nodeBefore;if(V(o,f,i,-1))return!0;if(0==s.parent.content.size&&(a(p,"end")||r.NodeSelection.isSelectable(p)))for(let l=s.depth;;l--){let c=(0,t.replaceStep)(o.doc,s.before(l),s.after(l),n.Slice.empty);if(c&&c.slice.size<c.to-c.from){if(i){let t=o.tr.step(c);t.setSelection(a(p,"end")?r.Selection.findFrom(t.doc.resolve(t.mapping.map(f.pos,-1)),-1):r.NodeSelection.create(t.doc,f.pos-p.nodeSize)),i(t.scrollIntoView())}return!0}if(1==l||s.node(l-1).childCount>1)break}return!(!p.isAtom||f.depth!=s.depth-1)&&(i&&i(o.tr.delete(f.pos-p.nodeSize,f.pos).scrollIntoView()),!0)},c=(t,n,r)=>{let o=l(t,r);if(!o)return!1;let i=d(o);return!!i&&f(t,i,n)},s=(t,n,r)=>{let o=u(t,r);if(!o)return!1;let l=y(o);return!!l&&f(t,l,n)};function f(o,l,i){let c=l.nodeBefore,s=l.pos-1;for(;!c.isTextblock;s--){if(c.type.spec.isolating)return!1;let t=c.lastChild;if(!t)return!1;c=t}let f=l.nodeAfter,a=l.pos+1;for(;!f.isTextblock;a++){if(f.type.spec.isolating)return!1;let t=f.firstChild;if(!t)return!1;f=t}let p=(0,t.replaceStep)(o.doc,s,a,n.Slice.empty);if(!p||p.from!=s||p instanceof t.ReplaceStep&&p.slice.size>=a-s)return!1;if(i){let t=o.tr.step(p);t.setSelection(r.TextSelection.create(t.doc,s)),i(t.scrollIntoView())}return!0}function a(t,n,r=!1){for(let o=t;o;o="start"==n?o.firstChild:o.lastChild){if(o.isTextblock)return!0;if(r&&1!=o.childCount)return!1}return!1}const p=(t,n,o)=>{let{$head:l,empty:i}=t.selection,c=l;if(!i)return!1;if(l.parent.isTextblock){if(o?!o.endOfTextblock("backward",t):l.parentOffset>0)return!1;c=d(l)}let s=c&&c.nodeBefore;return!(!s||!r.NodeSelection.isSelectable(s))&&(n&&n(t.tr.setSelection(r.NodeSelection.create(t.doc,c.pos-s.nodeSize)).scrollIntoView()),!0)};function d(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){if(t.index(n)>0)return t.doc.resolve(t.before(n+1));if(t.node(n).type.spec.isolating)break}return null}function u(t,n){let{$cursor:r}=t.selection;return!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const b=(o,l,i)=>{let c=u(o,i);if(!c)return!1;let s=y(c);if(!s)return!1;let f=s.nodeAfter;if(V(o,s,l,1))return!0;if(0==c.parent.content.size&&(a(f,"start")||r.NodeSelection.isSelectable(f))){let i=(0,t.replaceStep)(o.doc,c.before(),c.after(),n.Slice.empty);if(i&&i.slice.size<i.to-i.from){if(l){let t=o.tr.step(i);t.setSelection(a(f,"start")?r.Selection.findFrom(t.doc.resolve(t.mapping.map(s.pos)),1):r.NodeSelection.create(t.doc,t.mapping.map(s.pos))),l(t.scrollIntoView())}return!0}}return!(!f.isAtom||s.depth!=c.depth-1)&&(l&&l(o.tr.delete(s.pos,s.pos+f.nodeSize).scrollIntoView()),!0)},h=(t,n,o)=>{let{$head:l,empty:i}=t.selection,c=l;if(!i)return!1;if(l.parent.isTextblock){if(o?!o.endOfTextblock("forward",t):l.parentOffset<l.parent.content.size)return!1;c=y(l)}let s=c&&c.nodeAfter;return!(!s||!r.NodeSelection.isSelectable(s))&&(n&&n(t.tr.setSelection(r.NodeSelection.create(t.doc,c.pos)).scrollIntoView()),!0)};function y(t){if(!t.parent.type.spec.isolating)for(let n=t.depth-1;n>=0;n--){let r=t.node(n);if(t.index(n)+1<r.childCount)return t.doc.resolve(t.after(n+1));if(r.type.spec.isolating)break}return null}const S=(n,o)=>{let l,i=n.selection,c=i instanceof r.NodeSelection;if(c){if(i.node.isTextblock||!(0,t.canJoin)(n.doc,i.from))return!1;l=i.from}else if(l=(0,t.joinPoint)(n.doc,i.from,-1),null==l)return!1;if(o){let t=n.tr.join(l);c&&t.setSelection(r.NodeSelection.create(t.doc,l-n.doc.resolve(l).nodeBefore.nodeSize)),o(t.scrollIntoView())}return!0},k=(n,o)=>{let l,i=n.selection;if(i instanceof r.NodeSelection){if(i.node.isTextblock||!(0,t.canJoin)(n.doc,i.to))return!1;l=i.to}else if(l=(0,t.joinPoint)(n.doc,i.to,1),null==l)return!1;return o&&o(n.tr.join(l).scrollIntoView()),!0},w=(n,r)=>{let{$from:o,$to:l}=n.selection,i=o.blockRange(l),c=i&&(0,t.liftTarget)(i);return null!=c&&(r&&r(n.tr.lift(i,c).scrollIntoView()),!0)},x=(t,n)=>{let{$head:r,$anchor:o}=t.selection;return!(!r.parent.type.spec.code||!r.sameParent(o))&&(n&&n(t.tr.insertText("\n").scrollIntoView()),!0)};function $(t){for(let n=0;n<t.edgeCount;n++){let{type:r}=t.edge(n);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const j=(t,n)=>{let{$head:o,$anchor:l}=t.selection;if(!o.parent.type.spec.code||!o.sameParent(l))return!1;let i=o.node(-1),c=o.indexAfter(-1),s=$(i.contentMatchAt(c));if(!s||!i.canReplaceWith(c,c,s))return!1;if(n){let l=o.after(),i=t.tr.replaceWith(l,l,s.createAndFill());i.setSelection(r.Selection.near(i.doc.resolve(l),1)),n(i.scrollIntoView())}return!0},O=(t,n)=>{let o=t.selection,{$from:l,$to:i}=o;if(o instanceof r.AllSelection||l.parent.inlineContent||i.parent.inlineContent)return!1;let c=$(i.parent.contentMatchAt(i.indexAfter()));if(!c||!c.isTextblock)return!1;if(n){let o=(!l.parentOffset&&i.index()<i.parent.childCount?l:i).pos,s=t.tr.insert(o,c.createAndFill());s.setSelection(r.TextSelection.create(s.doc,o+1)),n(s.scrollIntoView())}return!0},T=(n,r)=>{let{$cursor:o}=n.selection;if(!o||o.parent.content.size)return!1;if(o.depth>1&&o.after()!=o.end(-1)){let l=o.before();if((0,t.canSplit)(n.doc,l))return r&&r(n.tr.split(l).scrollIntoView()),!0}let l=o.blockRange(),i=l&&(0,t.liftTarget)(l);return null!=i&&(r&&r(n.tr.lift(l,i).scrollIntoView()),!0)};function P(n){return(o,l)=>{if(o.selection instanceof r.NodeSelection&&o.selection.node.isBlock){let{$from:n}=o.selection;return!(!n.parentOffset||!(0,t.canSplit)(o.doc,n.pos))&&(l&&l(o.tr.split(n.pos).scrollIntoView()),!0)}if(!o.selection.$from.depth)return!1;let i=o.tr;!o.selection.empty&&(o.selection instanceof r.TextSelection||o.selection instanceof r.AllSelection)&&i.deleteSelection();let c,s,{$from:f}=i.selection,a=i.steps.length,p=[],d=!1,u=!1;for(let t=f.depth;;t--){if(f.node(t).isBlock){d=f.end(t)==f.pos+(f.depth-t),u=f.start(t)==f.pos-(f.depth-t),s=$(f.node(t-1).contentMatchAt(f.indexAfter(t-1)));let r=n&&n(f.parent,d,f);p.unshift(r||(d&&s?{type:s}:null)),c=t;break}if(1==t)return!1;p.unshift(null)}let b=f.pos,h=(0,t.canSplit)(i.doc,b,p.length,p);if(h||(p[0]=s?{type:s}:null,h=(0,t.canSplit)(i.doc,b,p.length,p)),!h)return!1;if(i.split(b,p.length,p),!d&&u&&f.node(c).type!=s){let t=i.mapping.slice(a),n=t.map(f.before(c)),r=i.doc.resolve(n);s&&f.node(c-1).canReplaceWith(r.index(),r.index()+1,s)&&i.setNodeMarkup(t.map(f.before(c)),s)}return l&&l(i.scrollIntoView()),!0}}const A=P(),I=(t,n)=>A(t,n&&(r=>{let o=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();o&&r.ensureMarks(o),n(r)})),B=(t,n)=>{let o,{$from:l,to:i}=t.selection,c=l.sharedDepth(i);return 0!=c&&(o=l.before(c),n&&n(t.tr.setSelection(r.NodeSelection.create(t.doc,o))),!0)},M=(t,n)=>(n&&n(t.tr.setSelection(new r.AllSelection(t.doc))),!0);function C(n,r,o){let l=r.nodeBefore,i=r.nodeAfter,c=r.index();return!!(l&&i&&l.type.compatibleContent(i.type))&&(!l.content.size&&r.parent.canReplace(c-1,c)?(o&&o(n.tr.delete(r.pos-l.nodeSize,r.pos).scrollIntoView()),!0):!(!r.parent.canReplace(c,c+1)||!i.isTextblock&&!(0,t.canJoin)(n.doc,r.pos))&&(o&&o(n.tr.join(r.pos).scrollIntoView()),!0))}function V(o,l,i,c){let s,f,p=l.nodeBefore,d=l.nodeAfter,u=p.type.spec.isolating||d.type.spec.isolating;if(!u&&C(o,l,i))return!0;let b=!u&&l.parent.canReplace(l.index(),l.index()+1);if(b&&(s=(f=p.contentMatchAt(p.childCount)).findWrapping(d.type))&&f.matchType(s[0]||d.type).validEnd){if(i){let r=l.pos+d.nodeSize,c=n.Fragment.empty;for(let t=s.length-1;t>=0;t--)c=n.Fragment.from(s[t].create(null,c));c=n.Fragment.from(p.copy(c));let f=o.tr.step(new t.ReplaceAroundStep(l.pos-1,r,l.pos,r,new n.Slice(c,1,0),s.length,!0)),a=f.doc.resolve(r+2*s.length);a.nodeAfter&&a.nodeAfter.type==p.type&&(0,t.canJoin)(f.doc,a.pos)&&f.join(a.pos),i(f.scrollIntoView())}return!0}let h=d.type.spec.isolating||c>0&&u?null:r.Selection.findFrom(l,1),y=h&&h.$from.blockRange(h.$to),S=y&&(0,t.liftTarget)(y);if(null!=S&&S>=l.depth)return i&&i(o.tr.lift(y,S).scrollIntoView()),!0;if(b&&a(d,"start",!0)&&a(p,"end")){let r=p,c=[];for(;c.push(r),!r.isTextblock;)r=r.lastChild;let s=d,f=1;for(;!s.isTextblock;s=s.firstChild)f++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(i){let r=n.Fragment.empty;for(let t=c.length-1;t>=0;t--)r=n.Fragment.from(c[t].copy(r));i(o.tr.step(new t.ReplaceAroundStep(l.pos-c.length,l.pos+d.nodeSize,l.pos+f,l.pos+d.nodeSize-f,new n.Slice(r,c.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function z(t){return function(n,o){let l=n.selection,i=t<0?l.$from:l.$to,c=i.depth;for(;i.node(c).isInline;){if(!c)return!1;c--}return!!i.node(c).isTextblock&&(o&&o(n.tr.setSelection(r.TextSelection.create(n.doc,t<0?i.start(c):i.end(c)))),!0)}}const v=z(-1),N=z(1);function R(n,r=null){return function(o,l){let{$from:i,$to:c}=o.selection,s=i.blockRange(c),f=s&&(0,t.findWrapping)(s,n,r);return!!f&&(l&&l(o.tr.wrap(s,f).scrollIntoView()),!0)}}function F(t,n=null){return function(r,o){let l=!1;for(let o=0;o<r.selection.ranges.length&&!l;o++){let{$from:{pos:i},$to:{pos:c}}=r.selection.ranges[o];r.doc.nodesBetween(i,c,(o,i)=>{if(l)return!1;if(o.isTextblock&&!o.hasMarkup(t,n))if(o.type==t)l=!0;else{let n=r.doc.resolve(i),o=n.index();l=n.parent.canReplaceWith(o,o+1,t)}})}if(!l)return!1;if(o){let l=r.tr;for(let o=0;o<r.selection.ranges.length;o++){let{$from:{pos:i},$to:{pos:c}}=r.selection.ranges[o];l.setBlockType(i,c,t,n)}o(l.scrollIntoView())}return!0}}function D(t,n,r,o){for(let l=0;l<n.length;l++){let{$from:i,$to:c}=n[l],s=0==i.depth&&(t.inlineContent&&t.type.allowsMarkType(r));if(t.nodesBetween(i.pos,c.pos,(t,n)=>{if(s||!o&&t.isAtom&&t.isInline&&n>=i.pos&&n+t.nodeSize<=c.pos)return!1;s=t.inlineContent&&t.type.allowsMarkType(r)}),s)return!0}return!1}function W(t){let n=[];for(let o=0;o<t.length;o++){let{$from:l,$to:i}=t[o];l.doc.nodesBetween(l.pos,i.pos,(t,o)=>{if(t.isAtom&&t.content.size&&t.isInline&&o>=l.pos&&o+t.nodeSize<=i.pos)return o+1>l.pos&&n.push(new r.SelectionRange(l,l.doc.resolve(o+1))),l=l.doc.resolve(o+1+t.content.size),!1}),l.pos<i.pos&&n.push(new r.SelectionRange(l,i))}return n}function E(t,n=null,r){let o=!1!==(r&&r.removeWhenPresent),l=!1!==(r&&r.enterInlineAtoms),i=!(r&&r.includeWhitespace);return function(r,c){let{empty:s,$cursor:f,ranges:a}=r.selection;if(s&&!f||!D(r.doc,a,t,l))return!1;if(c)if(f)t.isInSet(r.storedMarks||f.marks())?c(r.tr.removeStoredMark(t)):c(r.tr.addStoredMark(t.create(n)));else{let s,f=r.tr;l||(a=W(a)),s=o?!a.some(n=>r.doc.rangeHasMark(n.$from.pos,n.$to.pos,t)):!a.every(n=>{let r=!1;return f.doc.nodesBetween(n.$from.pos,n.$to.pos,(o,l,i)=>{if(r)return!1;r=!t.isInSet(o.marks)&&!!i&&i.type.allowsMarkType(t)&&!(o.isText&&/^\s*$/.test(o.textBetween(Math.max(0,n.$from.pos-l),Math.min(o.nodeSize,n.$to.pos-l))))}),!r});for(let r=0;r<a.length;r++){let{$from:o,$to:l}=a[r];if(s){let r=o.pos,c=l.pos,s=o.nodeAfter,a=l.nodeBefore,p=i&&s&&s.isText?/^\s*/.exec(s.text)[0].length:0,d=i&&a&&a.isText?/\s*$/.exec(a.text)[0].length:0;r+p<c&&(r+=p,c-=d),f.addMark(r,c,t.create(n))}else f.removeMark(o.pos,l.pos,t)}c(f.scrollIntoView())}return!0}}function J(n,r){return o=>{if(!o.isGeneric)return n(o);let l=[];for(let t=0;t<o.mapping.maps.length;t++){let n=o.mapping.maps[t];for(let t=0;t<l.length;t++)l[t]=n.map(l[t]);n.forEach((t,n,r,o)=>l.push(r,o))}let i=[];for(let t=0;t<l.length;t+=2){let n=l[t],c=l[t+1],s=o.doc.resolve(n),f=s.sharedDepth(c),a=s.node(f);for(let t=s.indexAfter(f),n=s.after(f+1);n<=c;++t){let o=a.maybeChild(t);if(!o)break;if(t&&-1==i.indexOf(n)){let l=a.child(t-1);l.type==o.type&&r(l,o)&&i.push(n)}n+=o.nodeSize}}i.sort((t,n)=>t-n);for(let n=i.length-1;n>=0;n--)(0,t.canJoin)(o.doc,i[n])&&o.join(i[n]);n(o)}}function K(t,n){let r=Array.isArray(n)?t=>n.indexOf(t.type.name)>-1:n;return(n,o,l)=>t(n,o&&J(o,r),l)}function _(...t){return function(n,r,o){for(let l=0;l<t.length;l++)if(t[l](n,r,o))return!0;return!1}}let q=_(o,i,p),G=_(o,b,h);const H={Enter:_(x,O,T,A),"Mod-Enter":j,Backspace:q,"Mod-Backspace":q,"Shift-Backspace":q,Delete:G,"Mod-Delete":G,"Mod-a":M},U={"Ctrl-h":H.Backspace,"Alt-Backspace":H["Mod-Backspace"],"Ctrl-d":H.Delete,"Ctrl-Alt-Backspace":H["Mod-Delete"],"Alt-Delete":H["Mod-Delete"],"Alt-d":H["Mod-Delete"],"Ctrl-a":v,"Ctrl-e":N};for(let t in H)U[t]=H[t];const L=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?U:H},2612,[2613,2614,2616]);
151
+ __d(function(g,r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"AddMarkStep",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"AddNodeMarkStep",{enumerable:!0,get:function(){return m}}),Object.defineProperty(_e,"AttrStep",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(_e,"DocAttrStep",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"MapResult",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"Mapping",{enumerable:!0,get:function(){return a}}),Object.defineProperty(_e,"RemoveMarkStep",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"RemoveNodeMarkStep",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"ReplaceAroundStep",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"ReplaceStep",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"Step",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"StepMap",{enumerable:!0,get:function(){return l}}),Object.defineProperty(_e,"StepResult",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"Transform",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(_e,"TransformError",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"canJoin",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"canSplit",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"dropPoint",{enumerable:!0,get:function(){return G}}),Object.defineProperty(_e,"findWrapping",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"insertPoint",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"joinPoint",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"liftTarget",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"replaceStep",{enumerable:!0,get:function(){return H}});var e=r(_d[0]);const t=Math.pow(2,16);function n(e,n){return e+n*t}function i(e){return 65535&e}function o(e){return(e-(65535&e))/t}class s{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 l{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&l.empty)return l.empty}recover(e){let t=0,n=i(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+o(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,i){let o=0,l=this.inverted?2:1,a=this.inverted?1:2;for(let p=0;p<this.ranges.length;p+=3){let h=this.ranges[p]-(this.inverted?o:0);if(h>e)break;let c=this.ranges[p+l],f=this.ranges[p+a],u=h+c;if(e<=u){let l=h+o+((c?e==h?-1:e==u?1:t:t)<0?0:f);if(i)return l;let a=e==(t<0?h:u)?null:n(p/3,e-h),d=0;return c&&(d|=e==h?2:e==u?1:4,(t<0?e!=h:e!=u)&&(d|=8)),new s(l,d,a)}o+=f-c}return i?e+o:new s(e+o,0,null)}touches(e,t){let n=0,o=i(t),s=this.inverted?2:1,l=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let i=this.ranges[t]-(this.inverted?n:0);if(i>e)break;let a=this.ranges[t+s];if(e<=i+a&&t==3*o)return!0;n+=this.ranges[t+l]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],l=s-(this.inverted?o:0),a=s+(this.inverted?0:o),p=this.ranges[i+t],h=this.ranges[i+n];e(l,l+p,a,a+h),o+=h-p}}invert(){return new l(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?l.empty:new l(e<0?[0,-e,0]:[0,0,e])}}l.empty=new l([]);class a{constructor(e,t,n=0,i=(e?e.length:0)){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new a(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 i=e.getMirror(t);this.appendMap(e._maps[t],null!=i&&i<t?n+i: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 i=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=i&&i>t?n-i-1:void 0)}}invert(){let e=new a;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 i=0;for(let n=this.from;n<this.to;n++){let o=this._maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return n?e:new s(e,i,null)}}const p=Object.create(null);class h{getMap(){return l.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=p[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in p)throw new RangeError("Duplicate use of step JSON ID "+e);return p[e]=t,t.prototype.jsonID=e,t}}class c{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new c(e,null)}static fail(e){return new c(null,e)}static fromReplace(t,n,i,o){try{return c.ok(t.replace(n,i,o))}catch(t){if(t instanceof e.ReplaceError)return c.fail(t.message);throw t}}}function f(t,n,i){let o=[];for(let e=0;e<t.childCount;e++){let s=t.child(e);s.content.size&&(s=s.copy(f(s.content,n,s))),s.isInline&&(s=n(s,i,e)),o.push(s)}return e.Fragment.fromArray(o)}class u extends h{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(t){let n=t.slice(this.from,this.to),i=t.resolve(this.from),o=i.node(i.sharedDepth(this.to)),s=new e.Slice(f(n.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,o),n.openStart,n.openEnd);return c.fromReplace(t,this.from,this.to,s)}invert(){return new d(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 u(t.pos,n.pos,this.mark)}merge(e){return e instanceof u&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new u(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 new RangeError("Invalid input for AddMarkStep.fromJSON");return new u(t.from,t.to,e.markFromJSON(t.mark))}}h.jsonID("addMark",u);class d extends h{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(t){let n=t.slice(this.from,this.to),i=new e.Slice(f(n.content,e=>e.mark(this.mark.removeFromSet(e.marks)),t),n.openStart,n.openEnd);return c.fromReplace(t,this.from,this.to,i)}invert(){return new u(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 d(t.pos,n.pos,this.mark)}merge(e){return e instanceof d&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new d(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 new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new d(t.from,t.to,e.markFromJSON(t.mark))}}h.jsonID("removeMark",d);class m extends h{constructor(e,t){super(),this.pos=e,this.mark=t}apply(t){let n=t.nodeAt(this.pos);if(!n)return c.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return c.fromReplace(t,this.pos,this.pos+1,new e.Slice(e.Fragment.from(i),0,n.isLeaf?0:1))}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 m(this.pos,t.marks[n]);return new m(this.pos,this.mark)}}return new y(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new m(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 new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new m(t.pos,e.markFromJSON(t.mark))}}h.jsonID("addNodeMark",m);class y extends h{constructor(e,t){super(),this.pos=e,this.mark=t}apply(t){let n=t.nodeAt(this.pos);if(!n)return c.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return c.fromReplace(t,this.pos,this.pos+1,new e.Slice(e.Fragment.from(i),0,n.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new m(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new y(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 new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new y(t.pos,e.markFromJSON(t.mark))}}h.jsonID("removeNodeMark",y);class w extends h{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&k(e,this.from,this.to)?c.fail("Structure replace would overwrite content"):c.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new l([this.from,this.to-this.from,this.slice.size])}invert(e){return new w(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&&w.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new w(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure)}merge(t){if(!(t instanceof w)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?e.Slice.empty:new e.Slice(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new w(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?e.Slice.empty:new e.Slice(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new w(this.from,this.to+(t.to-t.from),n,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(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new w(n.from,n.to,e.Slice.fromJSON(t,n.slice),!!n.structure)}}w.MAP_BIAS=1,h.jsonID("replace",w);class S extends h{constructor(e,t,n,i,o,s,l=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=o,this.insert=s,this.structure=l}apply(e){if(this.structure&&(k(e,this.from,this.gapFrom)||k(e,this.gapTo,this.to)))return c.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return c.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?c.fromReplace(e,this.from,this.to,n):c.fail("Content does not fit in gap")}getMap(){return new l([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 S(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),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||o>n.pos?null:new S(t.pos,n.pos,i,o,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(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new S(n.from,n.to,n.gapFrom,n.gapTo,e.Slice.fromJSON(t,n.slice),n.insert,!!n.structure)}}function k(e,t,n){let i=e.resolve(t),o=n-t,s=i.depth;for(;o>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,o--;if(o>0){let e=i.node(s).maybeChild(i.indexAfter(s));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function b(e,t,n,i){let o,s,l=[],a=[];e.doc.nodesBetween(t,n,(e,p,h)=>{if(!e.isInline)return;let c=e.marks;if(!i.isInSet(c)&&h.type.allowsMarkType(i.type)){let h=Math.max(p,t),f=Math.min(p+e.nodeSize,n),m=i.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(m)||(o&&o.to==h&&o.mark.eq(c[e])?o.to=f:l.push(o=new d(h,f,c[e])));s&&s.to==h?s.to=f:a.push(s=new u(h,f,i))}}),l.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function v(t,n,i,o){let s=[],l=0;t.doc.nodesBetween(n,i,(t,a)=>{if(!t.isInline)return;l++;let p=null;if(o instanceof e.MarkType){let e,n=t.marks;for(;e=o.isInSet(n);)(p||(p=[])).push(e),n=e.removeFromSet(n)}else o?o.isInSet(t.marks)&&(p=[o]):p=t.marks;if(p&&p.length){let e=Math.min(a+t.nodeSize,i);for(let t=0;t<p.length;t++){let i,o=p[t];for(let e=0;e<s.length;e++){let t=s[e];t.step==l-1&&o.eq(s[e].style)&&(i=t)}i?(i.to=e,i.step=l):s.push({style:o,from:Math.max(a,n),to:e,step:l})}}}),s.forEach(e=>t.step(new d(e.from,e.to,e.style)))}function M(t,n,i,o=i.contentMatch,s=!0){let l=t.doc.nodeAt(n),a=[],p=n+1;for(let n=0;n<l.childCount;n++){let h=l.child(n),c=p+h.nodeSize,f=o.matchType(h.type);if(f){o=f;for(let e=0;e<h.marks.length;e++)i.allowsMarkType(h.marks[e].type)||t.step(new d(p,c,h.marks[e]));if(s&&h.isText&&"pre"!=i.whitespace){let t,n,o=/\r?\n|\r/g;for(;t=o.exec(h.text);)n||(n=new e.Slice(e.Fragment.from(i.schema.text(" ",i.allowedMarks(h.marks))),0,0)),a.push(new w(p+t.index,p+t.index+t[0].length,n))}}else a.push(new w(p,c,e.Slice.empty));p=c}if(!o.validEnd){let n=o.fillBefore(e.Fragment.empty,!0);t.replace(p,p,new e.Slice(n,0,0))}for(let e=a.length-1;e>=0;e--)t.step(a[e])}function R(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function x(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,i=0,o=0;;--n){let s=e.$from.node(n),l=e.$from.index(n)+i,a=e.$to.indexAfter(n)-o;if(n<e.depth&&s.canReplace(l,a,t))return n;if(0==n||s.type.spec.isolating||!R(s,l,a))break;l&&(i=1),a<s.childCount&&(o=1)}return null}function O(t,n,i){let{$from:o,$to:s,depth:l}=n,a=o.before(l+1),p=s.after(l+1),h=a,c=p,f=e.Fragment.empty,u=0;for(let t=l,n=!1;t>i;t--)n||o.index(t)>0?(n=!0,f=e.Fragment.from(o.node(t).copy(f)),u++):h--;let d=e.Fragment.empty,m=0;for(let t=l,n=!1;t>i;t--)n||s.after(t+1)<s.end(t)?(n=!0,d=e.Fragment.from(s.node(t).copy(d)),m++):c++;t.step(new S(h,c,a,p,new e.Slice(f.append(d),u,m),f.size-u,!0))}function C(e,t,n=null,i=e){let o=F(e,t),s=o&&A(i,t);return s?o.map(N).concat({type:t,attrs:n}).concat(s.map(N)):null}function N(e){return{type:e,attrs:null}}function F(e,t){let{parent:n,startIndex:i,endIndex:o}=e,s=n.contentMatchAt(i).findWrapping(t);if(!s)return null;let l=s.length?s[0]:t;return n.canReplaceWith(i,o,l)?s:null}function A(e,t){let{parent:n,startIndex:i,endIndex:o}=e,s=n.child(i),l=t.contentMatch.findWrapping(s.type);if(!l)return null;let a=(l.length?l[l.length-1]:t).contentMatch;for(let e=i;a&&e<o;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?l:null}function T(t,n,i){let o=e.Fragment.empty;for(let t=i.length-1;t>=0;t--){if(o.size){let e=i[t].type.contentMatch.matchFragment(o);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=e.Fragment.from(i[t].type.create(i[t].attrs,o))}let s=n.start,l=n.end;t.step(new S(s,l,s,l,new e.Slice(o,0,0),i.length,!0))}function I(t,n,i,o,s){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=t.steps.length;t.doc.nodesBetween(n,i,(n,i)=>{let a="function"==typeof s?s(n):s;if(n.isTextblock&&!n.hasMarkup(o,a)&&J(t.doc,t.mapping.slice(l).map(i),o)){let s=null;if(o.schema.linebreakReplacement){let e="pre"==o.whitespace,t=!!o.contentMatch.matchType(o.schema.linebreakReplacement);e&&!t?s=!1:!e&&t&&(s=!0)}!1===s&&j(t,n,i,l),M(t,t.mapping.slice(l).map(i,1),o,void 0,null===s);let p=t.mapping.slice(l),h=p.map(i,1),c=p.map(i+n.nodeSize,1);return t.step(new S(h,c,h+1,c-1,new e.Slice(e.Fragment.from(o.create(a,null,n.marks)),0,0),1,!0)),!0===s&&E(t,n,i,l),!1}})}function E(e,t,n,i){t.forEach((o,s)=>{if(o.isText){let l,a=/\r?\n|\r/g;for(;l=a.exec(o.text);){let o=e.mapping.slice(i).map(n+1+s+l.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function j(e,t,n,i){t.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(i).map(n+1+s);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function J(e,t,n){let i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}function z(t,n,i,o,s){let l=t.doc.nodeAt(n);if(!l)throw new RangeError("No node at given position");i||(i=l.type);let a=i.create(o,null,s||l.marks);if(l.isLeaf)return t.replaceWith(n,n+l.nodeSize,a);if(!i.validContent(l.content))throw new RangeError("Invalid content for node type "+i.name);t.step(new S(n,n+l.nodeSize,n+1,n+l.nodeSize-1,new e.Slice(e.Fragment.from(a),0,0),1,!0))}function _(e,t,n=1,i){let o=e.resolve(t),s=o.depth-n,l=i&&i[i.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!l.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>s;e--,t--){let n=o.node(e),s=o.index(e);if(n.type.spec.isolating)return!1;let l=n.content.cutByIndex(s,n.childCount),a=i&&i[t+1];a&&(l=l.replaceChild(0,a.type.create(a.attrs)));let p=i&&i[t]||n;if(!n.canReplace(s+1,n.childCount)||!p.type.validContent(l))return!1}let a=o.indexAfter(s),p=i&&i[0];return o.node(s).canReplaceWith(a,a,p?p.type:o.node(s+1).type)}function P(t,n,i=1,o){let s=t.doc.resolve(n),l=e.Fragment.empty,a=e.Fragment.empty;for(let t=s.depth,n=s.depth-i,p=i-1;t>n;t--,p--){l=e.Fragment.from(s.node(t).copy(l));let n=o&&o[p];a=e.Fragment.from(n?n.type.create(n.attrs,a):s.node(t).copy(a))}t.step(new w(n,n,new e.Slice(l.append(a),i,i),!0))}function D(e,t){let n=e.resolve(t),i=n.index();return $(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function B(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:i}=e.type.schema;for(let o=0;o<t.childCount;o++){let s=t.child(o),l=s.type==i?e.type.schema.nodes.text:s.type;if(n=n.matchType(l),!n)return!1;if(!e.type.allowsMarks(s.marks))return!1}return n.validEnd}function $(e,t){return!(!e||!t||e.isLeaf||!B(e,t))}function W(e,t,n=-1){let i=e.resolve(t);for(let e=i.depth;;e--){let o,s,l=i.index(e);if(e==i.depth?(o=i.nodeBefore,s=i.nodeAfter):n>0?(o=i.node(e+1),l++,s=i.node(e).maybeChild(l)):(o=i.node(e).maybeChild(l-1),s=i.node(e+1)),o&&!o.isTextblock&&$(o,s)&&i.node(e).canReplace(l,l+1))return t;if(0==e)break;t=n<0?i.before(e):i.after(e)}}function L(t,n,i){let o=null,{linebreakReplacement:s}=t.doc.type.schema,l=t.doc.resolve(n-i),a=l.node().type;if(s&&a.inlineContent){let e="pre"==a.whitespace,t=!!a.contentMatch.matchType(s);e&&!t?o=!1:!e&&t&&(o=!0)}let p=t.steps.length;if(!1===o){let e=t.doc.resolve(n+i);j(t,e.node(),e.before(),p)}a.inlineContent&&M(t,n+i-1,a,l.node().contentMatchAt(l.index()),null==o);let h=t.mapping.slice(p),c=h.map(n-i);if(t.step(new w(c,h.map(n+i,-1),e.Slice.empty,!0)),!0===o){let e=t.doc.resolve(c);E(t,e.node(),e.before(),t.steps.length)}return t}function q(e,t,n){let i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(let e=i.depth-1;e>=0;e--){let t=i.index(e);if(i.node(e).canReplaceWith(t,t,n))return i.before(e+1);if(t>0)return null}if(i.parentOffset==i.parent.content.size)for(let e=i.depth-1;e>=0;e--){let t=i.indexAfter(e);if(i.node(e).canReplaceWith(t,t,n))return i.after(e+1);if(t<i.node(e).childCount)return null}return null}function G(e,t,n){let i=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=i.depth;t>=0;t--){let n=t==i.depth?0:i.pos<=(i.start(t+1)+i.end(t+1))/2?-1:1,s=i.index(t)+(n>0?1:0),l=i.node(t),a=!1;if(1==e)a=l.canReplace(s,s,o);else{let e=l.contentMatchAt(s).findWrapping(o.firstChild.type);a=e&&l.canReplaceWith(s,s,e[0])}if(a)return 0==n?i.pos:n<0?i.before(t+1):i.after(t+1)}return null}function H(t,n,i=n,o=e.Slice.empty){if(n==i&&!o.size)return null;let s=t.resolve(n),l=t.resolve(i);return K(s,l,o)?new w(n,i,o):new Q(s,l,o).fit()}function K(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}h.jsonID("replaceAround",S);class Q{constructor(t,n,i){this.$from=t,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=e.Fragment.empty;for(let e=0;e<=t.depth;e++){let n=t.node(e);this.frontier.push({type:n.type,match:n.contentMatchAt(t.indexAfter(e))})}for(let n=t.depth;n>0;n--)this.placed=e.Fragment.from(t.node(n).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 t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;let s=this.placed,l=i.depth,a=o.depth;for(;l&&a&&1==s.childCount;)s=s.firstChild.content,l--,a--;let p=new e.Slice(s,l,a);return t>-1?new S(i.pos,t,this.$to.pos,this.$to.end(),p,n):p.size||i.pos!=this.$to.pos?new w(i.pos,o.pos,p):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,n=0,i=this.unplaced.openEnd;n<t;n++){let o=e.firstChild;if(e.childCount>1&&(i=0),o.type.spec.isolating&&i<=n){t=n;break}e=o.content}for(let n=1;n<=2;n++)for(let i=1==n?t:this.unplaced.openStart;i>=0;i--){let t,o=null;i?(o=X(this.unplaced.content,i-1).firstChild,t=o.content):t=this.unplaced.content;let s=t.firstChild;for(let t=this.depth;t>=0;t--){let l,{type:a,match:p}=this.frontier[t],h=null;if(1==n&&(s?p.matchType(s.type)||(h=p.fillBefore(e.Fragment.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:i,frontierDepth:t,parent:o,inject:h};if(2==n&&s&&(l=p.findWrapping(s.type)))return{sliceDepth:i,frontierDepth:t,parent:o,wrap:l};if(o&&p.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:i}=this.unplaced;return!(re(t,-1)<=n)&&(this.unplaced.size>1&&re(t,1)>i&&i++,this.unplaced=new e.Slice(t,n+1,i),!0)}dropNode(){let{content:t,openStart:n,openEnd:i}=this.unplaced,o=X(t,n);if(o.childCount<=1&&n>0){let s=t.size-n<=n+o.size;this.unplaced=new e.Slice(U(t,n-1,1),n-1,s?n-1:i)}else this.unplaced=new e.Slice(U(t,n,1),n,i)}placeNodes({sliceDepth:t,frontierDepth:n,parent:i,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let e=0;e<s.length;e++)this.openFrontierNode(s[e]);let l=this.unplaced,a=i?i.content:l.content,p=l.openStart-t,h=0,c=[],{match:f,type:u}=this.frontier[n];if(o){for(let e=0;e<o.childCount;e++)c.push(o.child(e));f=f.matchFragment(o)}let d=a.size+t-(l.content.size-l.openEnd);for(;h<a.childCount;){let e=a.child(h),t=f.matchType(e.type);if(!t)break;h++,(h>1||0==p||e.content.size)&&(f=t,c.push(Y(e.mark(u.allowedMarks(e.marks)),1==h?p:0,h==a.childCount?d:-1)))}let m=h==a.childCount;m||(d=-1),this.placed=V(this.placed,n,e.Fragment.from(c)),this.frontier[n].match=f,m&&d<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=a;e<d;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=m?0==t?e.Slice.empty:new e.Slice(U(l.content,t-1,1),t-1,d<0?l.openEnd:t-1):new e.Slice(U(l.content,t,h),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Z(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,i=this.$to.after(n);for(;n>1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=Z(e,t,i,n,o);if(s){for(let n=t-1;n>=0;n--){let{match:t,type:i}=this.frontier[n],o=Z(e,n,i,t,!0);if(!o||o.childCount)continue e}return{depth:t,fit:s,move:o?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=V(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),i=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,i)}return e}openFrontierNode(t,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=V(this.placed,this.depth,e.Fragment.from(t.create(n,i))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(e.Fragment.empty,!0);t.childCount&&(this.placed=V(this.placed,this.frontier.length,t))}}function U(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(U(e.firstChild.content,t-1,n)))}function V(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(V(e.lastChild.content,t-1,n)))}function X(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Y(t,n,i){if(n<=0)return t;let o=t.content;return n>1&&(o=o.replaceChild(0,Y(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=t.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(e.Fragment.empty,!0)))),t.copy(o)}function Z(e,t,n,i,o){let s=e.node(t),l=o?e.indexAfter(t):e.index(t);if(l==s.childCount&&!n.compatibleContent(s.type))return null;let a=i.fillBefore(s.content,!0,l);return a&&!ee(n,s.content,l)?a:null}function ee(e,t,n){for(let i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}function te(e){return e.spec.defining||e.spec.definingForContent}function re(e,t){for(let n=0;;n++){let i=t<0?e.firstChild:e.lastChild;if(!i||i.isAtom)return n;e=i.content}}function ne(t,n,i,o){if(!o.size)return t.deleteRange(n,i);let s=t.doc.resolve(n),l=t.doc.resolve(i);if(K(s,l,o))return t.step(new w(n,i,o));let a=le(s,l);0==a[a.length-1]&&a.pop();let p=-(s.depth+1);a.unshift(p);for(let e=s.depth,t=s.pos-1;e>0;e--,t--){let n=s.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;a.indexOf(e)>-1?p=e:s.before(e)==t&&a.splice(1,0,-e)}let h=a.indexOf(p),c=[],f=o.openStart;for(let e=o.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==o.openStart)break;e=n.content}for(let e=f-1;e>=0;e--){let t=c[e],n=te(t.type);if(n&&!t.sameMarkup(s.node(Math.abs(p)-1)))f=e;else if(n||!t.type.isTextblock)break}for(let n=o.openStart;n>=0;n--){let p=(n+f+1)%(o.openStart+1),u=c[p];if(u)for(let n=0;n<a.length;n++){let c=a[(n+h)%a.length],f=!0;c<0&&(f=!1,c=-c);let d=s.node(c-1),m=s.index(c-1);if(d.canReplaceWith(m,m,u.type,u.marks))return t.replace(s.before(c),f?l.after(c):i,new e.Slice(ie(o.content,0,o.openStart,p),p,o.openEnd))}}let u=t.steps.length;for(let e=a.length-1;e>=0&&(t.replace(n,i,o),!(t.steps.length>u));e--){let t=a[e];t<0||(n=s.before(t),i=l.after(t))}}function ie(t,n,i,o,s){if(n<i){let e=t.firstChild;t=t.replaceChild(0,e.copy(ie(e.content,n+1,i,o,e)))}if(n>o){let n=s.contentMatchAt(0),i=n.fillBefore(t).append(t);t=i.append(n.matchFragment(i).fillBefore(e.Fragment.empty,!0))}return t}function oe(t,n,i,o){if(!o.isInline&&n==i&&t.doc.resolve(n).parent.content.size){let e=q(t.doc,n,o.type);null!=e&&(n=i=e)}t.replaceRange(n,i,new e.Slice(e.Fragment.from(o),0,0))}function se(e,t,n){let i=e.doc.resolve(t),o=e.doc.resolve(n);if(i.parent.isTextblock&&o.parent.isTextblock&&i.start()!=o.start()&&0==i.parentOffset&&0==o.parentOffset){let s=i.sharedDepth(n),l=!1;for(let e=i.depth;e>s;e--)i.node(e).type.spec.isolating&&(l=!0);for(let e=o.depth;e>s;e--)o.node(e).type.spec.isolating&&(l=!0);if(!l){for(let e=i.depth;e>0&&t==i.start(e);e--)t=i.before(e);for(let e=o.depth;e>0&&n==o.start(e);e--)n=o.before(e);i=e.doc.resolve(t),o=e.doc.resolve(n)}}let s=le(i,o);for(let t=0;t<s.length;t++){let n=s[t],l=t==s.length-1;if(l&&0==n||i.node(n).type.contentMatch.validEnd)return e.delete(i.start(n),o.end(n));if(n>0&&(l||i.node(n-1).canReplace(i.index(n-1),o.indexAfter(n-1))))return e.delete(i.before(n),o.after(n))}for(let s=1;s<=i.depth&&s<=o.depth;s++)if(t-i.start(s)==i.depth-s&&n>i.end(s)&&o.end(s)-n!=o.depth-s&&i.start(s-1)==o.start(s-1)&&i.node(s-1).canReplace(i.index(s-1),o.index(s-1)))return e.delete(i.before(s),n);e.delete(t,n)}function le(e,t){let n=[];for(let i=Math.min(e.depth,t.depth);i>=0;i--){let o=e.start(i);if(o<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;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class ae extends h{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return c.fail("No node at attribute step's position");let i=Object.create(null);for(let e in n.attrs)i[e]=n.attrs[e];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return c.fromReplace(t,this.pos,this.pos+1,new e.Slice(e.Fragment.from(o),0,n.isLeaf?0:1))}getMap(){return l.empty}invert(e){return new ae(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 ae(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 new RangeError("Invalid input for AttrStep.fromJSON");return new ae(t.pos,t.attr,t.value)}}h.jsonID("attr",ae);class pe extends h{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 c.ok(n)}getMap(){return l.empty}invert(e){return new pe(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 new RangeError("Invalid input for DocAttrStep.fromJSON");return new pe(t.attr,t.value)}}h.jsonID("docAttr",pe);let he=class extends Error{};he=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},he.prototype=Object.create(Error.prototype),he.prototype.constructor=he,he.prototype.name="TransformError";class ce{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new a}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new he(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 i=this.mapping.maps[n];n&&(e=i.map(e,1),t=i.map(t,-1)),i.forEach((n,i,o,s)=>{e=Math.min(e,o),t=Math.max(t,s)})}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(t,n=t,i=e.Slice.empty){let o=H(this.doc,t,n,i);return o&&this.step(o),this}replaceWith(t,n,i){return this.replace(t,n,new e.Slice(e.Fragment.from(i),0,0))}delete(t,n){return this.replace(t,n,e.Slice.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return ne(this,e,t,n),this}replaceRangeWith(e,t,n){return oe(this,e,t,n),this}deleteRange(e,t){return se(this,e,t),this}lift(e,t){return O(this,e,t),this}join(e,t=1){return L(this,e,t),this}wrap(e,t){return T(this,e,t),this}setBlockType(e,t=e,n,i=null){return I(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return z(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new ae(e,t,n)),this}setDocAttribute(e,t){return this.step(new pe(e,t)),this}addNodeMark(e,t){return this.step(new m(e,t)),this}removeNodeMark(t,n){let i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at position "+t);if(n instanceof e.Mark)n.isInSet(i.marks)&&this.step(new y(t,n));else{let e,o=i.marks,s=[];for(;e=n.isInSet(o);)s.push(new y(t,e)),o=e.removeFromSet(o);for(let e=s.length-1;e>=0;e--)this.step(s[e])}return this}split(e,t=1,n){return P(this,e,t,n),this}addMark(e,t,n){return b(this,e,t,n),this}removeMark(e,t,n){return v(this,e,t,n),this}clearIncompatible(e,t,n){return M(this,e,t,n),this}}},2613,[2614]);
152
+ __d(function(g,_r,_i,_a,_m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ContentMatch",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"DOMParser",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(_e,"DOMSerializer",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(_e,"Fragment",{enumerable:!0,get:function(){return h}}),Object.defineProperty(_e,"Mark",{enumerable:!0,get:function(){return u}}),Object.defineProperty(_e,"MarkType",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(_e,"Node",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"NodeRange",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"NodeType",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(_e,"ReplaceError",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"ResolvedPos",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"Schema",{enumerable:!0,get:function(){return it}}),Object.defineProperty(_e,"Slice",{enumerable:!0,get:function(){return f}});var t,e=_r(_d[0]),n=(t=e)&&t.__esModule?t:{default:t};function r(t,e,n){for(let i=0;;i++){if(i==t.childCount||i==e.childCount)return t.childCount==e.childCount?null:n;let h=t.child(i),l=e.child(i);if(h!=l){if(!h.sameMarkup(l))return n;if(h.isText&&h.text!=l.text){let t=h.text,e=l.text,r=0;for(;t[r]==e[r];r++)n++;return r&&r<t.length&&r<e.length&&o(t.charCodeAt(r-1))&&s(t.charCodeAt(r))&&n--,n}if(h.content.size||l.content.size){let t=r(h.content,l.content,n+1);if(null!=t)return t}n+=h.nodeSize}else n+=h.nodeSize}}function i(t,e,n,r){for(let h=t.childCount,l=e.childCount;;){if(0==h||0==l)return h==l?null:{a:n,b:r};let a=t.child(--h),c=e.child(--l),u=a.nodeSize;if(a!=c){if(!a.sameMarkup(c))return{a:n,b:r};if(a.isText&&a.text!=c.text){let t=a.text,e=c.text,i=t.length,h=e.length;for(;i>0&&h>0&&t[i-1]==e[h-1];)i--,h--,n--,r--;return i&&h&&i<t.length&&o(t.charCodeAt(i-1))&&s(t.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(a.content.size||c.content.size){let t=i(a.content,c.content,n-1,r-1);if(t)return t}n-=u,r-=u}else n-=u,r-=u}}function s(t){return t>=56320&&t<57344}function o(t){return t>=55296&&t<56320}class h{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;e<t.length;e++)this.size+=t[e].nodeSize}nodesBetween(t,e,n,r=0,i){for(let s=0,o=0;o<e;s++){let h=this.content[s],l=o+h.nodeSize;if(l>t&&!1!==n(h,r+o,i||null,s)&&h.content.size){let i=o+1;h.nodesBetween(Math.max(0,t-i),Math.min(h.content.size,e-i),n,r+i)}o=l}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,n,r){let i="",s=!0;return this.nodesBetween(t,e,(o,h)=>{let l=o.isText?o.text.slice(Math.max(t,h)-h,e-h):o.isLeaf?r?"function"==typeof r?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&l||o.isTextblock)&&n&&(s?s=!1:i+=n),i+=l},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,n=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);i<t.content.length;i++)r.push(t.content[i]);return new h(r,this.size+t.size)}cut(t,e=this.size){if(0==t&&e==this.size)return this;let n=[],r=0;if(e>t)for(let i=0,s=0;s<e;i++){let o=this.content[i],h=s+o.nodeSize;h>t&&((s<t||h>e)&&(o=o.isText?o.cut(Math.max(0,t-s),Math.min(o.text.length,e-s)):o.cut(Math.max(0,t-s-1),Math.min(o.content.size,e-s-1))),n.push(o),r+=o.nodeSize),s=h}return new h(n,r)}cutByIndex(t,e){return t==e?h.empty:0==t&&e==this.content.length?this:new h(this.content.slice(t,e))}replaceChild(t,e){let n=this.content[t];if(n==e)return this;let r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new h(r,i)}addToStart(t){return new h([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new h(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))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(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,n=0;e<this.content.length;e++){let r=this.content[e];t(r,n,e),n+=r.nodeSize}}findDiffStart(t,e=0){return r(this,t,e)}findDiffEnd(t,e=this.size,n=t.size){return i(this,t,e,n)}findIndex(t){if(0==t)return a(0,t);if(t==this.size)return a(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,n=0;;e++){let r=n+this.child(e).nodeSize;if(r>=t)return r==t?a(e+1,r):a(e,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return h.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return h.fromArray(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return h.empty;let e,n=0;for(let r=0;r<t.length;r++){let i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new h(e||t,n)}static from(t){if(!t)return h.empty;if(t instanceof h)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new h([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}h.empty=new h([],0);const l={index:0,offset:0};function a(t,e){return l.index=t,l.offset=e,l}function c(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!c(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!c(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}class u{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,n=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&c(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let n=t.marks[e.type];if(!n)throw new RangeError(`There is no mark type ${e.type} in this schema`);return n.create(e.attrs)}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&0==t.length)return u.none;if(t instanceof u)return[t];let e=t.slice();return e.sort((t,e)=>t.type.rank-e.type.rank),e}}u.none=[];class p extends Error{}class f{constructor(t,e,n){this.content=t,this.openStart=e,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let n=m(this.content,t+this.openStart,e,this.openStart+1,this.openEnd+1);return n&&new f(n,this.openStart,this.openEnd)}removeBetween(t,e){return new f(d(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return f.empty;let n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new f(h.fromJSON(t,e.content),n,r)}static maxOpen(t,e=!0){let n=0,r=0;for(let r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=t.lastChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.lastChild)r++;return new f(t,n,r)}}function d(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:h}=t.findIndex(n);if(i==e||s.isText){if(h!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(d(s.content,e-i-1,n-i-1)))}function m(t,e,n,r,i,s){let{index:o,offset:h}=t.findIndex(e),l=t.maybeChild(o);if(h==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=m(l.content,e-h-1,n,0==o?r-1:0,o==t.childCount-1?i-1:0,l);return a&&t.replaceChild(o,l.copy(a))}function y(t,e,n){if(n.openStart>t.depth)throw new p("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new p("Inconsistent open depths");return x(t,e,n,0)}function x(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=x(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){let{start:i,end:o}=v(n,t);return O(s,C(t,i,o,e,r))}{let r=t.parent,i=r.content;return O(r,i.cut(0,t.parentOffset).append(n.content).append(i.cut(e.parentOffset)))}}return O(s,E(t,e,r))}function k(t,e){if(!e.type.compatibleContent(t.type))throw new p("Cannot join "+e.type.name+" onto "+t.type.name)}function w(t,e,n){let r=t.node(n);return k(r,e.node(n)),r}function S(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function b(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(S(t.nodeAfter,r),s++));for(let t=s;t<o;t++)S(i.child(t),r);e&&e.depth==n&&e.textOffset&&S(e.nodeBefore,r)}function O(t,e){if(!t.type.validContent(e))throw new p("Invalid content for node "+t.type.name);return t.copy(e)}function C(t,e,n,r,i){let s=t.depth>i&&w(t,e,i+1),o=r.depth>i&&w(n,r,i+1),l=[];return b(null,t,i,l),s&&o&&e.index(i)==n.index(i)?(k(s,o),S(O(s,C(t,e,n,r,i+1)),l)):(s&&S(O(s,E(t,e,i+1)),l),b(e,n,i,l),o&&S(O(o,E(n,r,i+1)),l)),b(r,null,i,l),new h(l)}function E(t,e,n){let r=[];if(b(null,t,n,r),t.depth>n){S(O(w(t,e,n+1),E(t,e,n+1)),r)}return b(e,null,n,r),new h(r)}function v(t,e){let n=e.depth-t.openStart,r=e.node(n).copy(t.content);for(let t=n-1;t>=0;t--)r=e.node(t).copy(h.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}f.empty=new f(h.empty,0,0);class T{constructor(t,e,n){this.pos=t,this.path=e,this.parentOffset=n,this.depth=e.length/3-1}resolveDepth(t){return null==t?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[3*this.resolveDepth(t)]}index(t){return this.path[3*this.resolveDepth(t)+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1;for(let e=0;e<t;e++)r+=n.child(e).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(0==t.content.size)return u.none;if(this.textOffset)return t.child(e).marks;let n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){let t=n;n=r,r=t}let i=n.marks;for(var s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let n=e.marks,r=t.parent.maybeChild(t.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(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new z(this,t,n);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let n=[],r=0,i=e;for(let e=t;;){let{index:t,offset:s}=e.content.findIndex(i),o=i-s;if(n.push(e,t,r+s),!o)break;if(e=e.child(t),e.isText)break;i=o-1,r+=s+1}return new T(e,n,i)}static resolveCached(t,e){let n=A.get(t);if(n)for(let t=0;t<n.elts.length;t++){let r=n.elts[t];if(r.pos==e)return r}else A.set(t,n=new M);let r=n.elts[n.i]=T.resolve(t,e);return n.i=(n.i+1)%N,r}}class M{constructor(){this.elts=[],this.i=0}}const N=12,A=new WeakMap;class z{constructor(t,e,n){this.$from=t,this.$to=e,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)}}const R=Object.create(null);class I{constructor(t,e,n,r=u.none){this.type=t,this.attrs=e,this.marks=r,this.content=n||h.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,n,r=0){this.content.nodesBetween(t,e,n,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,n,r){return this.content.textBetween(t,e,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,n){return this.type==t&&c(this.attrs,e||t.defaultAttrs||R)&&u.sameSet(this.marks,n||u.none)}copy(t=null){return t==this.content?this:new I(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new I(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,n=!1){if(t==e)return f.empty;let r=this.resolve(t),i=this.resolve(e),s=n?0:r.sharedDepth(e),o=r.start(s),h=r.node(s).content.cut(r.pos-o,i.pos-o);return new f(h,r.depth-s,i.depth-s)}replace(t,e,n){return y(this.resolve(t),this.resolve(e),n)}nodeAt(t){for(let e=this;;){let{index:n,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(n),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:n}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:n}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:n}=this.content.findIndex(t);if(n<t)return{node:this.content.child(e),index:e,offset:n};let r=this.content.child(e-1);return{node:r,index:e-1,offset:n-r.nodeSize}}resolve(t){return T.resolveCached(this,t)}resolveNoCache(t){return T.resolve(this,t)}rangeHasMark(t,e,n){let r=!1;return e>t&&this.nodesBetween(t,e,t=>(n.isInSet(t.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 t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),F(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,n=h.empty,r=0,i=n.childCount){let s=this.contentMatchAt(t).matchFragment(n,r,i),o=s&&s.matchFragment(this.content,e);if(!o||!o.validEnd)return!1;for(let t=r;t<i;t++)if(!this.type.allowsMarks(n.child(t).marks))return!1;return!0}canReplaceWith(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(n),s=i&&i.matchFragment(this.content,e);return!!s&&s.validEnd}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),B(this.type.attrs,this.attrs,"node",this.type.name);let t=u.none;for(let e=0;e<this.marks.length;e++){let n=this.marks[e];B(n.type.attrs,n.attrs,"mark",n.type.name),t=n.addToSet(t)}if(!u.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(t=>t.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let n;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}let r=h.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}I.prototype.text=void 0;class P extends I{constructor(t,e,n,r){if(super(t,e,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):F(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new P(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new P(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function F(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}function B(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in t)t[n].validate&&t[n].validate(e[n])}class D{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let n=new j(t,e);if(null==n.next)return D.empty;let r=J(n);n.next&&n.err("Unexpected trailing text");let i=K(G(r));return Q(i,n),i}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,n=t.childCount){let r=this;for(let i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}fillBefore(t,e=!1,n=0){let r=[this];return(function i(s,o){let l=s.matchFragment(t,n);if(l&&(!e||l.validEnd))return h.from(o.map(t=>t.createAndFill()));for(let t=0;t<s.next.length;t++){let{type:e,next:n}=s.next[t];if(!e.isText&&!e.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let t=i(n,o.concat(e));if(t)return t}}return null})(this,[])}findWrapping(t){for(let e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(t)){let t=[];for(let e=r;e.type;e=e.via)t.push(e.type);return t.reverse()}for(let t=0;t<i.next.length;t++){let{type:s,next:o}=i.next[t];s.isLeaf||s.hasRequiredAttrs()||s.name in e||r.type&&!o.validEnd||(n.push({match:s.contentMatch,type:s,via:r}),e[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];return(function e(n){t.push(n);for(let r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)})(this),t.map((e,n)=>{let r=n+(e.validEnd?"*":" ")+" ";for(let n=0;n<e.next.length;n++)r+=(n?", ":"")+e.next[n].type.name+"->"+t.indexOf(e.next[n].next);return r}).join("\n")}}D.empty=new D(!0);class j{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function J(t){let e=[];do{e.push(q(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function q(t){let e=[];do{e.push($(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function $(t){let e=_(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=W(t,e)}return e}function L(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function W(t,e){let n=L(t),r=n;return t.eat(",")&&(r="}"!=t.next?L(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function U(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let t in n){let r=n[t];r.isInGroup(e)&&i.push(r)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i}function _(t){if(t.eat("(")){let e=J(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){let e=U(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.err("Unexpected token '"+t.next+"'")}function G(t){let e=[[]];return i((function t(e,s){if("choice"==e.type)return e.exprs.reduce((e,n)=>e.concat(t(n,s)),[]);if("seq"!=e.type){if("star"==e.type){let o=n();return r(s,o),i(t(e.expr,o),o),[r(o)]}if("plus"==e.type){let o=n();return i(t(e.expr,s),o),i(t(e.expr,o),o),[r(o)]}if("opt"==e.type)return[r(s)].concat(t(e.expr,s));if("range"==e.type){let o=s;for(let r=0;r<e.min;r++){let r=n();i(t(e.expr,o),r),o=r}if(-1==e.max)i(t(e.expr,o),o);else for(let s=e.min;s<e.max;s++){let s=n();r(o,s),i(t(e.expr,o),s),o=s}return[r(o)]}if("name"==e.type)return[r(s,void 0,e.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let o=t(e.exprs[r],s);if(r==e.exprs.length-1)return o;i(o,s=n())}})(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){let i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach(t=>t.to=e)}}function V(t,e){return e-t}function H(t,e){let n=[];return(function e(r){let i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(let t=0;t<i.length;t++){let{term:r,to:s}=i[t];r||-1!=n.indexOf(s)||e(s)}})(e),n.sort(V)}function K(t){let e=Object.create(null);return(function n(r){let i=[];r.forEach(e=>{t[e].forEach(({term:e,to:n})=>{if(!e)return;let r;for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);H(t,n).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})})});let s=e[r.join(",")]=new D(r.indexOf(t.length-1)>-1);for(let t=0;t<i.length;t++){let r=i[t][1].sort(V);s.next.push({type:i[t][0],next:e[r.join(",")]||n(r)})}return s})(H(t,0))}function Q(t,e){for(let n=0,r=[t];n<r.length;n++){let t=r[n],i=!t.validEnd,s=[];for(let e=0;e<t.next.length;e++){let{type:n,next:o}=t.next[e];s.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(o)&&r.push(o)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function X(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Y(t,e){let n=Object.create(null);for(let r in t){let i=t[r],s=e&&e[r];if(void 0===s){if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+r);s=i.default}else i.validate&&i.validate(s);n[r]=s}return n}function Z(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new nt(t,r,e[r]);return n}class tt{constructor(t,e,n){this.name=t,this.schema=e,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=Z(t,n.attrs),this.defaultAttrs=X(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==D.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:Y(this.attrs,t)}create(t=null,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new I(this,this.computeAttrs(t),h.from(e),u.setFrom(n))}createChecked(t=null,e,n){return e=h.from(e),this.checkContent(e),new I(this,this.computeAttrs(t),e,u.setFrom(n))}createAndFill(t=null,e,n){if(t=this.computeAttrs(t),(e=h.from(e)).size){let t=this.contentMatch.fillBefore(e);if(!t)return null;e=t.append(e)}let r=this.contentMatch.matchFragment(e),i=r&&r.fillBefore(h.empty,!0);return i?new I(this,t,e.append(i),u.setFrom(n)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let e=0;e<t.childCount;e++)if(!this.allowsMarks(t.child(e).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){}allowsMarkType(t){return null==this.markSet||this.markSet.indexOf(t)>-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(null==this.markSet)return t;let e;for(let n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:u.none:t}static compile(t,e){let n=Object.create(null);t.forEach((t,r)=>n[t]=new tt(t,e,r));let r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let t in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}function et(t,e,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class nt{constructor(t,e,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?et(t,e,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class rt{constructor(t,e,n,r){this.name=t,this.rank=e,this.schema=n,this.spec=r,this.attrs=Z(t,r.attrs),this.excluded=null;let i=X(this.attrs);this.instance=i?new u(this,i):null}create(t=null){return!t&&this.instance?this.instance:new u(this,Y(this.attrs,t))}static compile(t,e){let n=Object.create(null),r=0;return t.forEach((t,i)=>n[t]=new rt(t,r++,e,i)),n}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}excludes(t){return this.excluded.indexOf(t)>-1}}class it{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let n in t)e[n]=t[n];e.nodes=n.default.from(t.nodes),e.marks=n.default.from(t.marks||{}),this.nodes=tt.compile(this.spec.nodes,this),this.marks=rt.compile(this.spec.marks,this);let r=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes[t],n=e.spec.content||"",i=e.spec.marks;if(e.contentMatch=r[n]||(r[n]=D.parse(n,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!e.isInline||!e.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=e}e.markSet="_"==i?null:i?st(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let t in this.marks){let e=this.marks[t],n=e.spec.excludes;e.excluded=null==n?[e]:""==n?[]:st(this,n.split(" "))}this.nodeFromJSON=t=>I.fromJSON(this,t),this.markFromJSON=t=>u.fromJSON(this,t),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof tt))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}text(t,e){let n=this.nodes.text;return new P(n,n.defaultAttrs,t,u.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function st(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let e in t.marks){let r=t.marks[e];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=r)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function ot(t){return null!=t.tag}function ht(t){return null!=t.style}class lt{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let n=this.matchedStyles=[];e.forEach(t=>{if(ot(t))this.tags.push(t);else if(ht(t)){let e=/[^=]*/.exec(t.style)[0];n.indexOf(e)<0&&n.push(e),this.styles.push(t)}}),this.normalizeLists=!this.tags.some(e=>{if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;let n=t.nodes[e.node];return n.contentMatch.matchType(n)})}parse(t,e={}){let n=new dt(this,e,!1);return n.addAll(t,u.none,e.from,e.to),n.finish()}parseSlice(t,e={}){let n=new dt(this,e,!0);return n.addAll(t,u.none,e.from,e.to),f.maxOpen(n.finish())}matchTag(t,e,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(gt(t,n.tag)&&(void 0===n.namespace||t.namespaceURI==n.namespace)&&(!n.context||e.matchesContext(n.context))){if(n.getAttrs){let e=n.getAttrs(t);if(!1===e)continue;n.attrs=e||void 0}return n}}}matchStyle(t,e,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],s=r.style;if(!(0!=s.indexOf(t)||r.context&&!n.matchesContext(r.context)||s.length>t.length&&(61!=s.charCodeAt(t.length)||s.slice(t.length+1)!=e))){if(r.getAttrs){let t=r.getAttrs(e);if(!1===t)continue;r.attrs=t||void 0}return r}}}static schemaRules(t){let e=[];function n(t){let n=null==t.priority?50:t.priority,r=0;for(;r<e.length;r++){let t=e[r];if((null==t.priority?50:t.priority)<n)break}e.splice(r,0,t)}for(let e in t.marks){let r=t.marks[e].spec.parseDOM;r&&r.forEach(t=>{n(t=yt(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)})}for(let e in t.nodes){let r=t.nodes[e].spec.parseDOM;r&&r.forEach(t=>{n(t=yt(t)),t.node||t.ignore||t.mark||(t.node=e)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new lt(t,lt.schemaRules(t)))}}const at={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ct={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ut={ol:!0,ul:!0};function pt(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}class ft{constructor(t,e,n,r,i,s){this.type=t,this.attrs=e,this.marks=n,this.solid=r,this.options=s,this.content=[],this.activeMarks=u.none,this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(h.from(t));if(!e){let e,n=this.type.contentMatch;return(e=n.findWrapping(t.type))?(this.match=n,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content[this.content.length-1];if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let e=h.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(h.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!at.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class dt{constructor(t,e,n){this.parser=t,this.options=e,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r,i=e.topNode,s=pt(null,e.preserveWhitespace,0)|(n?4:0);r=i?new ft(i.type,i.attrs,u.none,!0,e.topMatch||i.type.contentMatch,s):new ft(n?null:t.schema.topNodeType,null,u.none,!0,null,s),this.nodes=[r],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){3==t.nodeType?this.addTextNode(t,e):1==t.nodeType&&this.addElement(t,e)}addTextNode(t,e){let n=t.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:s}=this.parser;if("full"===i||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let t=n.split(/\r?\n|\r/);for(let n=0;n<t.length;n++)n&&this.insertNode(s.linebreakReplacement.create(),e,!0),t[n]&&this.insertNode(s.text(t[n]),e,!/\S/.test(t[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 e=r.content[r.content.length-1],i=t.previousSibling;(!e||i&&'BR'==i.nodeName||e.isText&&/[ \t\r\n\u000c]$/.test(e.text))&&(n=n.slice(1))}n&&this.insertNode(s.text(n),e,!/\S/.test(n)),this.findInText(t)}else this.findInside(t)}addElement(t,e,n){let r=this.localPreserveWS,i=this.top;("PRE"==t.tagName||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s,o=t.nodeName.toLowerCase();ut.hasOwnProperty(o)&&this.parser.normalizeLists&&mt(t);let h=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(s=this.parser.matchTag(t,this,n));t:if(h?h.ignore:ct.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,e);else if(!h||h.skip||h.closeParent){h&&h.closeParent?this.open=Math.max(0,this.open-1):h&&h.skip.nodeType&&(t=h.skip);let n,r=this.needsBlock;if(at.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(!t.firstChild){this.leafFallback(t,e);break t}let s=h&&h.skip?e:this.readStyles(t,e);s&&this.addAll(t,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(t,e);n&&this.addElementByRule(t,h,n,!1===h.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(t,e){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"),e)}ignoreFallback(t,e){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let n=t.style;if(n&&n.length)for(let t=0;t<this.parser.matchedStyles.length;t++){let r=this.parser.matchedStyles[t],i=n.getPropertyValue(r);if(i)for(let t;;){let n=this.parser.matchStyle(r,i,this,t);if(!n)break;if(n.ignore)return null;if(e=n.clearMark?e.filter(t=>!n.clearMark(t)):e.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1!==n.consuming)break;t=n}}return e}addElementByRule(t,e,n,r){let i,s;if(e.node)if(s=this.parser.schema.nodes[e.node],s.isLeaf)this.insertNode(s.create(e.attrs),n,"BR"==t.nodeName)||this.leafFallback(t,n);else{let t=this.enter(s,e.attrs||null,n,e.preserveWhitespace);t&&(i=!0,n=t)}else{let t=this.parser.schema.marks[e.mark];n=n.concat(t.create(e.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(t);else if(r)this.addElement(t,n,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach(t=>this.insertNode(t,n,!1));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r,n),this.findAround(t,r,!1)}i&&this.sync(o)&&this.open--}addAll(t,e,n,r){let i=n||0;for(let s=n?t.childNodes[n]:t.firstChild,o=null==r?null:t.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(s,e);this.findAtPoint(t,i)}findPlace(t,e,n){let r,i;for(let e=this.open,s=0;e>=0;e--){let o=this.nodes[e],h=o.findWrapping(t);if(h&&(!r||r.length>h.length+s)&&(r=h,i=o,!h.length))break;if(o.solid){if(n)break;s+=2}}if(!r)return null;this.sync(i);for(let t=0;t<r.length;t++)e=this.enterInner(r[t],null,e,!1);return e}insertNode(t,e,n){if(t.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&(e=this.enterInner(t,null,e))}let r=this.findPlace(t,e,n);if(r){this.closeExtra();let e=this.top;e.match&&(e.match=e.match.matchType(t.type));let n=u.none;for(let i of r.concat(t.marks))(e.type?e.type.allowsMarkType(i.type):xt(i.type,t.type))&&(n=i.addToSet(n));return e.content.push(t.mark(n)),!0}return!1}enter(t,e,n,r){let i=this.findPlace(t.create(e),n,!1);return i&&(i=this.enterInner(t,e,n,!0,r)),i}enterInner(t,e,n,r=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let o=pt(t,i,s.options);4&s.options&&0==s.content.length&&(o|=4);let h=u.none;return n=n.filter(e=>!(s.type?s.type.allowsMarkType(e.type):xt(e.type,t))||(h=e.addToSet(h),!1)),this.nodes.push(new ft(t,e,h,r,null,o)),this.open++,n}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));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(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=1)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let n=this.nodes[e].content;for(let e=n.length-1;e>=0;e--)t+=n[e].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,n){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)){e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),s=(t,o)=>{for(;t>=0;t--){let h=e[t];if(""==h){if(t==e.length-1||0==t)continue;for(;o>=i;o--)if(s(t-1,o))return!0;return!1}{let t=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!t||t.name!=h&&!t.isInGroup(h))return!1;o--}}return!0};return s(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}}function mt(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let t=1==e.nodeType?e.nodeName.toLowerCase():null;t&&ut.hasOwnProperty(t)&&n?(n.appendChild(e),e=n):"li"==t?n=e:t&&(n=null)}}function gt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function yt(t){let e={};for(let n in t)e[n]=t[n];return e}function xt(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=t=>{s.push(t);for(let n=0;n<t.edgeCount;n++){let{type:r,next:i}=t.edge(n);if(r==e)return!0;if(s.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}class kt{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},n){n||(n=St(e).createDocumentFragment());let r=n,i=[];return t.forEach(t=>{if(i.length||t.marks.length){let n=0,s=0;for(;n<i.length&&s<t.marks.length;){let e=t.marks[s];if(this.marks[e.type.name]){if(!e.eq(i[n][0])||!1===e.type.spec.spanning)break;n++,s++}else s++}for(;n<i.length;)r=i.pop()[1];for(;s<t.marks.length;){let n=t.marks[s++],o=this.serializeMark(n,t.isInline,e);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(t,e))}),n}serializeNodeInner(t,e){if(t.isText)return St(e).createTextNode(t.text);let{dom:n,contentDOM:r}=Et(St(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return n}serializeNode(t,e={}){let n=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(t,e,n={}){let r=this.marks[t.type.name];return r&&Et(St(n),r(t,e),null,t.attrs)}static renderSpec(t,e,n=null,r){return"string"==typeof e?{dom:t.createTextNode(e)}:Et(t,e,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new kt(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=wt(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return wt(t.marks)}}function wt(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function St(t){return t.document||window.document}const bt=new WeakMap;function Ot(t){let e=bt.get(t);return void 0===e&&bt.set(t,e=Ct(t)),e}function Ct(t){let e=null;return(function t(n){if(n&&"object"==typeof n)if(Array.isArray(n))if("string"==typeof n[0])e||(e=[]),e.push(n);else for(let e=0;e<n.length;e++)t(n[e]);else for(let e in n)t(n[e])})(t),e}function Et(t,e,n,r){if(1==e.nodeType)return{dom:e};if(e.dom&&1==e.dom.nodeType)return e;let i,s=e[0];if("string"!=typeof s)throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Ot(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o,h=s.indexOf(" ");h>0&&(n=s.slice(0,h),s=s.slice(h+1));let l=n?t.createElementNS(n,s):t.createElement(s),a=e[1],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){c=2;for(let t in a)if(null!=a[t]){let e=t.indexOf(" ");e>0?l.setAttributeNS(t.slice(0,e),t.slice(e+1),a[t]):"style"==t&&l.style?l.style.cssText=a[t]:l.setAttribute(t,a[t])}}for(let i=c;i<e.length;i++){let s=e[i];if(0===s){if(i<e.length-1||i>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}if("string"==typeof s)l.appendChild(t.createTextNode(s));else{let{dom:e,contentDOM:i}=Et(t,s,n,r);if(l.appendChild(e),i){if(o)throw new RangeError("Multiple content holes");o=i}}}return{dom:l,contentDOM:o}}},2614,[2615]);
153
+ __d(function(g,r,_i,a,m,e,d){"use strict";function t(t){this.content=t}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}}),t.prototype={constructor:t,find:function(t){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===t)return n;return-1},get:function(t){var n=this.find(t);return-1==n?void 0:this.content[n+1]},update:function(n,o,i){var c=i&&i!=n?this.remove(i):this,u=c.find(n),s=c.content.slice();return-1==u?s.push(i||n,o):(s[u+1]=o,i&&(s[u]=i)),new t(s)},remove:function(n){var o=this.find(n);if(-1==o)return this;var i=this.content.slice();return i.splice(o,2),new t(i)},addToStart:function(n,o){return new t([n,o].concat(this.remove(n).content))},addToEnd:function(n,o){var i=this.remove(n).content.slice();return i.push(n,o),new t(i)},addBefore:function(n,o,i){var c=this.remove(o),u=c.content.slice(),s=c.find(n);return u.splice(-1==s?u.length:s,0,o,i),new t(u)},forEach:function(t){for(var n=0;n<this.content.length;n+=2)t(this.content[n],this.content[n+1])},prepend:function(n){return(n=t.from(n)).size?new t(n.content.concat(this.subtract(n).content)):this},append:function(n){return(n=t.from(n)).size?new t(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var o=this;n=t.from(n);for(var i=0;i<n.content.length;i+=2)o=o.remove(n.content[i]);return o},toObject:function(){var t={};return this.forEach(function(n,o){t[n]=o}),t},get size(){return this.content.length>>1}},t.from=function(n){if(n instanceof t)return n;var o=[];if(n)for(var i in n)o.push(i,n[i]);return new t(o)};var n=t},2615,[]);
154
+ __d(function(g,r,_i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AllSelection",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"EditorState",{enumerable:!0,get:function(){return v}}),Object.defineProperty(e,"NodeSelection",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"Plugin",{enumerable:!0,get:function(){return J}}),Object.defineProperty(e,"PluginKey",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"Selection",{enumerable:!0,get:function(){return i}}),Object.defineProperty(e,"SelectionRange",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"TextSelection",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"Transaction",{enumerable:!0,get:function(){return w}});var t=r(d[0]),n=r(d[1]);const s=Object.create(null);class i{constructor(t,n,s){this.$anchor=t,this.$head=n,this.ranges=s||[new o(t.min(n),t.max(n))]}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 t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(n,s=t.Slice.empty){let i=s.content.lastChild,o=null;for(let t=0;t<s.openEnd;t++)o=i,i=i.lastChild;let l=n.steps.length,c=this.ranges;for(let h=0;h<c.length;h++){let{$from:u,$to:p}=c[h],f=n.mapping.slice(l);n.replaceRange(f.map(u.pos),f.map(p.pos),h?t.Slice.empty:s),0==h&&k(n,l,(i?i.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(t,n){let s=t.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:l,$to:c}=i[o],h=t.mapping.slice(s),u=h.map(l.pos),p=h.map(c.pos);o?t.deleteRange(u,p):(t.replaceRangeWith(u,p,n),k(t,s,n.isInline?-1:1))}}static findFrom(t,n,s=!1){let i=t.parent.inlineContent?new h(t):y(t.node(0),t.parent,t.pos,t.index(),n,s);if(i)return i;for(let i=t.depth-1;i>=0;i--){let o=n<0?y(t.node(0),t.node(i),t.before(i+1),t.index(i),n,s):y(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,s);if(o)return o}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new m(t.node(0))}static atStart(t){return y(t,t,0,0,1)||new m(t)}static atEnd(t){return y(t,t,t.content.size,t.childCount,-1)||new m(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=s[n.type];if(!i)throw new RangeError(`No selection type ${n.type} defined`);return i.fromJSON(t,n)}static jsonID(t,n){if(t in s)throw new RangeError("Duplicate use of selection JSON ID "+t);return s[t]=n,n.prototype.jsonID=t,n}getBookmark(){return h.between(this.$anchor,this.$head).getBookmark()}}i.prototype.visible=!0;class o{constructor(t,n){this.$from=t,this.$to=n}}let l=!1;function c(t){l||t.parent.inlineContent||(l=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class h extends i{constructor(t,n=t){c(t),c(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let s=t.resolve(n.map(this.head));if(!s.parent.inlineContent)return i.near(s);let o=t.resolve(n.map(this.anchor));return new h(o.parent.inlineContent?o:s,s)}replace(n,s=t.Slice.empty){if(super.replace(n,s),s==t.Slice.empty){let t=this.$from.marksAcross(this.$to);t&&n.ensureMarks(t)}}eq(t){return t instanceof h&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new u(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new h(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,s=n){let i=t.resolve(n);return new this(i,s==n?i:t.resolve(s))}static between(t,n,s){let o=t.pos-n.pos;if(s&&!o||(s=o>=0?1:-1),!n.parent.inlineContent){let t=i.findFrom(n,s,!0)||i.findFrom(n,-s,!0);if(!t)return i.near(n,s);n=t.$head}return t.parent.inlineContent||(0==o||(t=(i.findFrom(t,-s,!0)||i.findFrom(t,s,!0)).$anchor).pos<n.pos!=o<0)&&(t=n),new h(t,n)}}i.jsonID("text",h);class u{constructor(t,n){this.anchor=t,this.head=n}map(t){return new u(t.map(this.anchor),t.map(this.head))}resolve(t){return h.between(t.resolve(this.anchor),t.resolve(this.head))}}class p extends i{constructor(t){let n=t.nodeAfter,s=t.node(0).resolve(t.pos+n.nodeSize);super(t,s),this.node=n}map(t,n){let{deleted:s,pos:o}=n.mapResult(this.anchor),l=t.resolve(o);return s?i.near(l):new p(l)}content(){return new t.Slice(t.Fragment.from(this.node),0,0)}eq(t){return t instanceof p&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new f(this.anchor)}static fromJSON(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new p(t.resolve(n.anchor))}static create(t,n){return new p(t.resolve(n))}static isSelectable(t){return!t.isText&&!1!==t.type.spec.selectable}}p.prototype.visible=!1,i.jsonID("node",p);class f{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:s}=t.mapResult(this.anchor);return n?new u(s,s):new f(s)}resolve(t){let n=t.resolve(this.anchor),s=n.nodeAfter;return s&&p.isSelectable(s)?new p(n):i.near(n)}}class m extends i{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(n,s=t.Slice.empty){if(s==t.Slice.empty){n.delete(0,n.doc.content.size);let t=i.atStart(n.doc);t.eq(n.selection)||n.setSelection(t)}else super.replace(n,s)}toJSON(){return{type:"all"}}static fromJSON(t){return new m(t)}map(t){return new m(t)}eq(t){return t instanceof m}getBookmark(){return S}}i.jsonID("all",m);const S={map(){return this},resolve:t=>new m(t)};function y(t,n,s,i,o,l=!1){if(n.inlineContent)return h.create(t,s);for(let c=i-(o>0?0:1);o>0?c<n.childCount:c>=0;c+=o){let i=n.child(c);if(i.isAtom){if(!l&&p.isSelectable(i))return p.create(t,s-(o<0?i.nodeSize:0))}else{let n=y(t,i,s+o,o<0?i.childCount:0,o,l);if(n)return n}s+=i.nodeSize*o}return null}function k(t,s,o){let l=t.steps.length-1;if(l<s)return;let c,h=t.steps[l];(h instanceof n.ReplaceStep||h instanceof n.ReplaceAroundStep)&&(t.mapping.maps[l].forEach((t,n,s,i)=>{null==c&&(c=i)}),t.setSelection(i.near(t.doc.resolve(c),o)))}class w extends n.Transform{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.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(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(n){return t.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),n)||this.setStoredMarks(n),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(t,n){super.addStep(t,n),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(n,s=!0){let i=this.selection;return s&&(n=n.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||t.Mark.none))),i.replaceWith(this,n),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,s){let o=this.doc.type.schema;if(null==n)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();{if(null==s&&(s=n),!t)return this.deleteRange(n,s);let l=this.storedMarks;if(!l){let t=this.doc.resolve(n);l=s==n?t.marks():t.marksAcross(this.doc.resolve(s))}return this.replaceRangeWith(n,s,o.text(t,l)),this.selection.empty||this.selection.to!=n+t.length||this.setSelection(i.near(this.selection.$to)),this}}setMeta(t,n){return this.meta["string"==typeof t?t:t.key]=n,this}getMeta(t){return this.meta["string"==typeof t?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function O(t,n){return n&&t?t.bind(n):t}class b{constructor(t,n,s){this.name=t,this.init=O(n.init,s),this.apply=O(n.apply,s)}}const $=[new b("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new b("selection",{init:(t,n)=>t.selection||i.atStart(n.doc),apply:t=>t.selection}),new b("storedMarks",{init:t=>t.storedMarks||null,apply:(t,n,s,i)=>i.selection.$cursor?t.storedMarks:null}),new b("scrollToSelection",{init:()=>0,apply:(t,n)=>t.scrolledIntoView?n+1:n})];class M{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=$.slice(),n&&n.forEach(t=>{if(this.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey[t.key]=t,t.spec.state&&this.fields.push(new b(t.key,t.spec.state,t))})}}class v{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let s=0;s<this.config.plugins.length;s++)if(s!=n){let n=this.config.plugins[s];if(n.spec.filterTransaction&&!n.spec.filterTransaction.call(n,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],s=this.applyInner(t),i=null;for(;;){let o=!1;for(let l=0;l<this.config.plugins.length;l++){let c=this.config.plugins[l];if(c.spec.appendTransaction){let h=i?i[l].n:0,u=i?i[l].state:this,p=h<n.length&&c.spec.appendTransaction.call(c,h?n.slice(h):n,u,s);if(p&&s.filterTransaction(p,l)){if(p.setMeta("appendedTransaction",t),!i){i=[];for(let t=0;t<this.config.plugins.length;t++)i.push(t<l?{state:s,n:n.length}:{state:this,n:0})}n.push(p),s=s.applyInner(p),o=!0}i&&(i[l]={state:s,n:n.length})}}if(!o)return{state:s,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new v(this.config),s=this.config.fields;for(let i=0;i<s.length;i++){let o=s[i];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new w(this)}static create(t){let n=new M(t.doc?t.doc.type.schema:t.schema,t.plugins),s=new v(n);for(let i=0;i<n.fields.length;i++)s[n.fields[i].name]=n.fields[i].init(t,s);return s}reconfigure(t){let n=new M(this.schema,t.plugins),s=n.fields,i=new v(n);for(let n=0;n<s.length;n++){let o=s[n].name;i[o]=this.hasOwnProperty(o)?this[o]:s[n].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(t=>t.toJSON())),t&&'object'==typeof t)for(let s in t){if("doc"==s||"selection"==s)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[s],o=i.spec.state;o&&o.toJSON&&(n[s]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(n,s,o){if(!s)throw new RangeError("Invalid input for EditorState.fromJSON");if(!n.schema)throw new RangeError("Required config field 'schema' missing");let l=new M(n.schema,n.plugins),c=new v(l);return l.fields.forEach(l=>{if("doc"==l.name)c.doc=t.Node.fromJSON(n.schema,s.doc);else if("selection"==l.name)c.selection=i.fromJSON(c.doc,s.selection);else if("storedMarks"==l.name)s.storedMarks&&(c.storedMarks=s.storedMarks.map(n.schema.markFromJSON));else{if(o)for(let t in o){let i=o[t],h=i.spec.state;if(i.key==l.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(s,t))return void(c[l.name]=h.fromJSON.call(i,n,s[t],c))}c[l.name]=l.init(n,c)}}),c}}function N(t,n,s){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=N(o,n,{})),s[i]=o}return s}class J{constructor(t){this.spec=t,this.props={},t.props&&N(t.props,this,this.props),this.key=t.key?t.key.key:R("plugin")}getState(t){return t[this.key]}}const T=Object.create(null);function R(t){return t in T?t+"$"+ ++T[t]:(T[t]=0,t+"$")}class j{constructor(t="key"){this.key=R(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}},2616,[2614,2613]);
155
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2617,[2614]);
156
+ __d(function(g,r,_i,_a2,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"CARET_MARKER",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(e,"RANGE_CLOSE_MARKER",{enumerable:!0,get:function(){return de}}),Object.defineProperty(e,"RANGE_OPEN_MARKER",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(e,"browser",{enumerable:!0,get:function(){return w}}),Object.defineProperty(e,"calculateNodePosition",{enumerable:!0,get:function(){return G}}),Object.defineProperty(e,"calculateTextPosition",{enumerable:!0,get:function(){return q}}),Object.defineProperty(e,"cloneTr",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,"customInputRules",{enumerable:!0,get:function(){return A}}),Object.defineProperty(e,"customInputRulesKey",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"equalNodeType",{enumerable:!0,get:function(){return V}}),Object.defineProperty(e,"findChildren",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(e,"findChildrenByMark",{enumerable:!0,get:function(){return te}}),Object.defineProperty(e,"findNodeInSelection",{enumerable:!0,get:function(){return se}}),Object.defineProperty(e,"findParent",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(e,"findParentNode",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(e,"findParentNodeClosestToPos",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(e,"findParentNodeType",{enumerable:!0,get:function(){return re}}),Object.defineProperty(e,"findSelectedNodeOfType",{enumerable:!0,get:function(){return le}}),Object.defineProperty(e,"flatten",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(e,"getMarkFromSchema",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(e,"getMarkRange",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(e,"getNodeFromSchema",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(e,"getSelectionSnapshot",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(e,"isTextOnlySlice",{enumerable:!0,get:function(){return X}}),Object.defineProperty(e,"markRule",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"nodeRule",{enumerable:!0,get:function(){return N}}),Object.defineProperty(e,"posToDOMRect",{enumerable:!0,get:function(){return J}}),Object.defineProperty(e,"posToTextOffset",{enumerable:!0,get:function(){return me}}),Object.defineProperty(e,"textOffsetToPos",{enumerable:!0,get:function(){return be}});var t=r(d[0]),n=r(d[1]),o=r(d[2]);const i="undefined"!=typeof navigator?navigator:null,u="undefined"!=typeof document?document:null,c=i&&i.userAgent||"",l=/Edge\/(\d+)/.exec(c),s=/MSIE \d/.exec(c),f=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(c),a=!!(s||f||l),p=s?document.documentMode:f?+f[1]:l?+l[1]:0,b=!a&&/gecko\/(\d+)/i.test(c),h=b&&+(/Firefox\/(\d+)/.exec(c)||[0,0])[1],y=!a&&/Chrome\/(\d+)/.exec(c),O=!!y,P=y?+y[1]:0,x=!a&&!!i&&/Apple Computer/.test(i.vendor),k=x&&(/Mobile\/\w+/.test(c)||!!i&&i.maxTouchPoints>2),j=k||!!i&&/Mac/.test(i.platform),v=/Android \d/.test(c),M=!!u&&"webkitFontSmoothing"in u.documentElement.style,S=M?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var w=Object.freeze({__proto__:null,android:v,chrome:O,chrome_version:P,gecko:b,gecko_version:h,ie:a,ie_version:p,ios:k,mac:j,safari:x,webkit:M,webkit_version:S});function R(t,n,o,i,u,c){if(t.composing)return!1;const l=t.state,s=l.doc.resolve(n);if(s.parent.type.spec.code)return!1;const f=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,void 0,"\ufffc")+i;for(let s of u){const u=s,a=u.match.exec(f),p=a&&a[0]&&u.handler(l,a,n-(a[0].length-i.length),o);if(p)return!1!==u.undoable&&p.setMeta(c,{transform:p,from:n,to:o,text:i}),t.dispatch(p),!0}return!1}const T=new t.PluginKey("MILKDOWN_CUSTOM_INPUTRULES");function A({rules:n}){const o=new t.Plugin({key:T,isInputRules:!0,state:{init:()=>null,apply(t,n){const o=t.getMeta(this);return o||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput:(t,i,u,c)=>R(t,i,u,c,n,o),handleDOMEvents:{compositionend:t=>(setTimeout(()=>{const{$cursor:i}=t.state.selection;i&&R(t,i.pos,i.pos,"",n,o)}),!1),keydown:(t,n)=>!(!v||!O||"Enter"!==n.key)&&(!t.composing&&(!!t.someProp("handleKeyDown",o=>o(t,n))&&(n.preventDefault(),!0)))},handleKeyDown(t,i){if("Enter"!==i.key)return!1;const{$cursor:u}=t.state.selection;return!!u&&R(t,u.pos,u.pos,"\n",n,o)}}});return o}function E(t){return t.some(t=>t.type.spec.code)}function C(t,n,o){if(n>=o)return!1;let i=!1;return t.doc.nodesBetween(n,o,t=>(t.isInline&&E(t.marks)&&(i=!0),!i)),i}function _(t,n){var o;return E(null!=(o=t.storedMarks)?o:t.doc.resolve(n).marks())}function I(t,o,i={}){return new n.InputRule(t,(t,n,u,c)=>{var l,s,f,a;const{tr:p}=t;let b,h=n[n.length-1],y=n[0],O=[];const P={group:h,fullMatch:y,start:u,end:c},x=null==(l=i.updateCaptured)?void 0:l.call(i,P);if(Object.assign(P,x),({group:h,fullMatch:y,start:u,end:c}=P),null===y)return null;if(""===(null==h?void 0:h.trim()))return null;if(h){const l=y.search(/\S/),P=u+y.indexOf(h),x=P+h.length,k=C(t,u+l,P),j=x<c&&C(t,x,c);if(k||j||_(t,c))return null;O=null!=(s=p.storedMarks)?s:[],x<c&&p.delete(x,c),P>u&&p.delete(u+l,P),b=u+l+h.length;const v=null==(f=i.getAttr)?void 0:f.call(i,n);p.addMark(u,b,o.create(v)),p.setStoredMarks(O),null==(a=i.beforeDispatch)||a.call(i,{match:n,start:u,end:c,tr:p})}return p})}function N(t,o,i={}){return new n.InputRule(t,(t,n,u,c)=>{var l,s,f;const{tr:a}=t;let p=n[1],b=n[0];const h={group:p,fullMatch:b,start:u,end:c},y=null==(l=i.updateCaptured)?void 0:l.call(i,h);if(Object.assign(h,y),({group:p,fullMatch:b,start:u,end:c}=h),null===b)return null;if(!p||""===p.trim())return null;const O=null==(s=i.getAttr)?void 0:s.call(i,n),P=o.createAndFill(O);return P&&(a.replaceRangeWith(o.isBlock?a.doc.resolve(u).before():u,c,P),null==(f=i.beforeDispatch)||f.call(i,{match:[b,p],start:u,end:c,tr:a})),a})}var $=Object.defineProperty,B=Object.defineProperties,D=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,K=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,L=(t,n,o)=>n in t?$(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,U=(t,n)=>{for(var o in n||(n={}))K.call(n,o)&&L(t,o,n[o]);if(F)for(var o of F(n))z.call(n,o)&&L(t,o,n[o]);return t},W=(t,n)=>B(t,D(n));function G(t,n,i){const u=t.state,{from:c}=u.selection,{node:l}=t.domAtPos(c),s=l instanceof Text?l.parentElement:l;if(!(s instanceof HTMLElement))throw(0,o.expectDomTypeError)(s);const f=s.getBoundingClientRect(),a=n.getBoundingClientRect(),p=n.parentElement;if(!p)throw(0,o.expectDomTypeError)(p);const b=p.getBoundingClientRect(),[h,y]=i(f,a,b);n.style.top=`${h}px`,n.style.left=`${y}px`}function q(t,n,i){const u=t.state,{from:c,to:l}=u.selection,s=t.coordsAtPos(c),f=t.coordsAtPos(l),a=n.getBoundingClientRect(),p=n.parentElement;if(!p)throw(0,o.missingRootElement)();const b=p.getBoundingClientRect(),[h,y]=i(s,f,a,b);n.style.top=`${h}px`,n.style.left=`${y}px`}function H(t=0,n=0,o=0){return Math.min(Math.max(t,n),o)}function J(t,n,o){const i=t.state.doc.content.size,u=H(n,0,i),c=H(o,0,i),l=t.coordsAtPos(u),s=t.coordsAtPos(c,-1),f=Math.min(l.top,s.top),a=Math.max(l.bottom,s.bottom),p=Math.min(l.left,s.left),b=Math.max(l.right,s.right),h={top:f,bottom:a,left:p,right:b,width:b-p,height:a-f,x:p,y:f};return W(U({},h),{toJSON:()=>h})}function Q(t){return Object.assign(Object.create(t),t).setTime(Date.now())}function V(t,n){return Array.isArray(t)&&t.includes(n.type)||n.type===t}function X(t){if(1===t.content.childCount){const n=t.content.firstChild;if("text"===(null==n?void 0:n.type.name)&&0===n.marks.length)return n;if("paragraph"===(null==n?void 0:n.type.name)&&1===n.childCount){const t=n.firstChild;if("text"===(null==t?void 0:t.type.name)&&0===t.marks.length)return t}}return!1}function Y(t,n){const o=t.parent;let i=o.childAfter(t.parentOffset);if(i.node&&n.isInSet(i.node.marks)||(i=o.childBefore(t.parentOffset)),!i.node)return;const u=n.isInSet(i.node.marks);if(!u)return;let c=i.index,l=t.start()+i.offset,s=l+i.node.nodeSize;for(;c>0&&u.isInSet(o.child(c-1).marks);)c-=1,l-=o.child(c).nodeSize;let f=i.index+1;for(;f<o.childCount&&u.isInSet(o.child(f).marks);)s+=o.child(f).nodeSize,f+=1;return{mark:u,from:l,to:s}}function Z(t,n=!0){const o=[];return t.descendants((t,i)=>{if(o.push({node:t,pos:i}),!n)return!1}),o}function ee(t){return(n,o)=>Z(n,o).filter(n=>t(n.node))}function te(t,n,o){return ee(t=>Boolean(n.isInSet(t.marks)))(t,o)}function ne(t){return n=>{for(let o=n.depth;o>0;o-=1){const i=n.node(o);if(t(i)){return{from:n.before(o),to:n.after(o),node:i}}}}}function re(t,n){return ne(t=>t.type===n)(t)}function oe(t,n){const i=n.nodes[t];if(!i)throw(0,o.getAtomFromSchemaFail)("node",t);return i}function ie(t,n){const i=n.marks[t];if(!i)throw(0,o.getAtomFromSchemaFail)("mark",t);return i}function ue(t){return n=>{for(let o=n.depth;o>0;o--){const i=n.node(o);if(t(i))return{pos:n.before(o),start:n.start(o),depth:o,node:i}}}}function ce(t){return n=>ue(t)(n.$from)}function le(n,o){if(!(n instanceof t.NodeSelection))return;const{node:i,$from:u}=n;return V(o,i)?{node:i,pos:u.pos,start:u.start(u.depth),depth:u.depth}:void 0}const se=(n,o)=>{const{selection:i,doc:u}=n;if(i instanceof t.NodeSelection)return{hasNode:i.node.type===o,pos:i.from,target:i.node};const{from:c,to:l}=i;let s=!1,f=-1,a=null;return u.nodesBetween(c,l,(t,n)=>!a&&(t.type!==o||(s=!0,f=n,a=t,!1))),{hasNode:s,pos:f,target:a}},fe="\u2503",ae="\u2770",de="\u2771";function pe(t,n){const{blockSeparator:o="\n",leafText:i="\u25a1"}=null!=n?n:{},u=[];let c=!0;const l=t=>{c?c=!1:u.push({text:o,kind:"separator",from:t,to:t})};return t.descendants((t,n)=>{var o;return t.isText?(u.push({text:null!=(o=t.text)?o:"",kind:"text",from:n,to:n+t.nodeSize}),!1):t.isInline&&t.isLeaf?(u.push({text:i,kind:"leaf",from:n,to:n+t.nodeSize}),!1):t.isTextblock?(l(n),!0):!t.isLeaf||(l(n),u.push({text:i,kind:"leaf",from:n,to:n+t.nodeSize}),!1)}),u}function me(t,n,o){let i=0;for(const u of pe(t,o)){if("text"===u.kind||"leaf"===u.kind){if(n<u.from)return i;if(n<=u.to)return"leaf"===u.kind?n<=u.from?i:i+u.text.length:i+(n-u.from)}else if(n<=u.from)return i;i+=u.text.length}return i}function be(t,n,o){let i=0,u=0;for(const c of pe(t,o)){const t=i+c.text.length;if(n<t||n===t&&"text"===c.kind)return"text"===c.kind?c.from+(n-i):"leaf"===c.kind?c.from:c.from-1;i=t,u=c.to}return u}function ge(t,n){const{doc:o,selection:i}=t,u=pe(o,n).map(t=>t.text).join("");if(i.empty){const t=me(o,i.head,n);return`${u.slice(0,t)}${fe}${u.slice(t)}`}const c=me(o,i.from,n),l=me(o,i.to,n);return`${u.slice(0,c)}${ae}${u.slice(c,l)}${de}${u.slice(l)}`}},2618,[2616,2619,2467]);
157
+ __d(function(g,r,_i,a,_m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"InputRule",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"closeDoubleQuote",{enumerable:!0,get:function(){return m}}),Object.defineProperty(e,"closeSingleQuote",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"ellipsis",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"emDash",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"inputRules",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"openDoubleQuote",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"openSingleQuote",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"smartQuotes",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"textblockTypeInputRule",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"undoInputRule",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"wrappingInputRule",{enumerable:!0,get:function(){return C}});var t=r(d[0]),n=r(d[1]);class o{constructor(t,n,o={}){var i;this.match=t,this.match=t,this.handler="string"==typeof n?(i=n,function(t,n,o,u){let l=i;if(n[1]){let t=n[0].lastIndexOf(n[1]);l+=n[0].slice(t+n[1].length);let i=(o+=t)-u;i>0&&(l=n[0].slice(t-i,t)+l,o=u)}return t.tr.insertText(l,o,u)}):n,this.undoable=!1!==o.undoable,this.inCode=o.inCode||!1,this.inCodeMark=!1!==o.inCodeMark}}const i=500;function u({rules:n}){let o=new t.Plugin({state:{init:()=>null,apply(t,n){let o=t.getMeta(this);return o||(t.selectionSet||t.docChanged?null:n)}},props:{handleTextInput:(t,i,u,c)=>l(t,i,u,c,n,o),handleDOMEvents:{compositionend:t=>{setTimeout(()=>{let{$cursor:i}=t.state.selection;i&&l(t,i.pos,i.pos,"",n,o)})}}},isInputRules:!0});return o}function l(t,n,o,u,l,c){if(t.composing)return!1;let s=t.state,f=s.doc.resolve(n),p=f.parent.textBetween(Math.max(0,f.parentOffset-i),f.parentOffset,null,"\ufffc")+u;for(let i=0;i<l.length;i++){let m=l[i];if(!m.inCodeMark&&f.marks().some(t=>t.type.spec.code))continue;if(f.parent.type.spec.code){if(!m.inCode)continue}else if("only"===m.inCode)continue;let b=m.match.exec(p);if(!b||b[0].length<u.length)continue;let h=n-(b[0].length-u.length);if(!m.inCodeMark){let t=!1;if(s.doc.nodesBetween(h,f.pos,n=>{n.isInline&&n.marks.some(t=>t.type.spec.code)&&(t=!0)}),t)continue}let y=m.handler(s,b,h,o);if(y)return m.undoable&&y.setMeta(c,{transform:y,from:n,to:o,text:u}),t.dispatch(y),!0}return!1}const c=(t,n)=>{let o=t.plugins;for(let i=0;i<o.length;i++){let u,l=o[i];if(l.spec.isInputRules&&(u=l.getState(t))){if(n){let o=t.tr,i=u.transform;for(let t=i.steps.length-1;t>=0;t--)o.step(i.steps[t].invert(i.docs[t]));if(u.text){let n=o.doc.resolve(u.from).marks();o.replaceWith(u.from,u.to,t.schema.text(u.text,n))}else o.delete(u.from,u.to);n(o)}return!0}}return!1},s=new o(/--$/,"\u2014",{inCodeMark:!1}),f=new o(/\.\.\.$/,"\u2026",{inCodeMark:!1}),p=new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201c",{inCodeMark:!1}),m=new o(/"$/,"\u201d",{inCodeMark:!1}),b=new o(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018",{inCodeMark:!1}),h=new o(/'$/,"\u2019",{inCodeMark:!1}),y=[p,m,b,h];function C(t,i,u=null,l){return new o(t,(t,o,c,s)=>{let f=u instanceof Function?u(o):u,p=t.tr.delete(c,s),m=p.doc.resolve(c).blockRange(),b=m&&(0,n.findWrapping)(m,i,f);if(!b)return null;p.wrap(m,b);let h=p.doc.resolve(c-1).nodeBefore;return h&&h.type==i&&(0,n.canJoin)(p.doc,c-1)&&(!l||l(o,h))&&p.join(c-1),p})}function O(t,n,i=null){return new o(t,(t,o,u,l)=>{let c=t.doc.resolve(u),s=i instanceof Function?i(o):i;return c.node(-1).canReplaceWith(c.index(-1),c.indexAfter(-1),n)?t.tr.delete(u,l).setBlockType(u,u,n,s):null})}},2619,[2616,2613]);
158
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2620,[2621]);
159
+ __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"keydownHandler",{enumerable:!0,get:function(){return s}}),Object.defineProperty(e,"keymap",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]);const i="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),l="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function f(t){let n,l,f,o,c=t.split(/-(?!$)/),u=c[c.length-1];"Space"==u&&(u=" ");for(let t=0;t<c.length-1;t++){let u=c[t];if(/^(cmd|meta|m)$/i.test(u))o=!0;else if(/^a(lt)?$/i.test(u))n=!0;else if(/^(c|ctrl|control)$/i.test(u))l=!0;else if(/^s(hift)?$/i.test(u))f=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: "+u);i?o=!0:l=!0}}return n&&(u="Alt-"+u),l&&(u="Ctrl-"+u),o&&(u="Meta-"+u),f&&(u="Shift-"+u),u}function o(t){let n=Object.create(null);for(let i in t)n[f(i)]=t[i];return n}function c(t,n,i=!0){return n.altKey&&(t="Alt-"+t),n.ctrlKey&&(t="Ctrl-"+t),n.metaKey&&(t="Meta-"+t),i&&n.shiftKey&&(t="Shift-"+t),t}function u(t){return new n.Plugin({props:{handleKeyDown:s(t)}})}function s(n){let i=o(n);return function(n,f){let o,u=(0,t.keyName)(f),s=i[c(u,f)];if(s&&s(n.state,n.dispatch,n))return!0;if(1==u.length&&" "!=u){if(f.shiftKey){let t=i[c(u,f,!1)];if(t&&t(n.state,n.dispatch,n))return!0}if((f.altKey||f.metaKey||f.ctrlKey)&&!(l&&f.ctrlKey&&f.altKey)&&(o=t.base[f.keyCode])&&o!=u){let t=i[c(o,f)];if(t&&t(n.state,n.dispatch,n))return!0}}return!1}}},2621,[2622,2616]);
160
+ __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"base",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"shift",{enumerable:!0,get:function(){return n}}),e.keyName=function(f){var c=!(o&&f.metaKey&&f.shiftKey&&!f.ctrlKey&&!f.altKey||i&&f.shiftKey&&f.key&&1==f.key.length||"Unidentified"==f.key)&&f.key||(f.shiftKey?n:t)[f.keyCode]||f.key||"Unidentified";"Esc"==c&&(c="Escape");"Del"==c&&(c="Delete");"Left"==c&&(c="ArrowLeft");"Up"==c&&(c="ArrowUp");"Right"==c&&(c="ArrowRight");"Down"==c&&(c="ArrowDown");return c};for(var t={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},n={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:"\""},o="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),i="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),f=0;f<10;f++)t[48+f]=t[96+f]=String(f);for(f=1;f<=24;f++)t[f+111]="F"+f;for(f=65;f<=90;f++)t[f]=String.fromCharCode(f+32),n[f]=String.fromCharCode(f);for(var c in t)n.hasOwnProperty(c)||(n[c]=t[c])},2622,[]);
161
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2623,[2616]);
162
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2624,[2619]);
163
+ __d(function(g,r,_i,_a,m,_e,d){"use strict";var t,e,s,i,a,h,l,n,u,o,c,f,p,v,b,y,k,w,P,O,j,M,x,N;function S(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ParserState",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"SerializerState",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"Stack",{enumerable:!0,get:function(){return F}}),Object.defineProperty(_e,"StackElement",{enumerable:!0,get:function(){return A}});var E=S(r(d[0])),z=S(r(d[1])),T=r(d[2]),_=r(d[3]),A=class{},F=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=t=>{this.top()?.push(t)},this.open=t=>{this.elements.push(t)},this.close=()=>{const t=this.elements.pop();if(!t)throw(0,T.stackOverFlow)();return t}}},q=class t extends A{constructor(t,e,s){super(),this.type=t,this.content=e,this.attrs=s}push(t,...e){this.content.push(t,...e)}pop(){return this.content.pop()}static create(e,s,i){return new t(e,s,i)}},C=(e=(0,z.default)("marks"),s=(0,z.default)("hasText"),i=(0,z.default)("maybeMerge"),a=(0,z.default)("matchTarget"),h=(0,z.default)("runNode"),l=(0,z.default)("closeNodeAndPush"),n=(0,z.default)("addNodeAndPush"),(t=class extends F{constructor(t){super(),Object.defineProperty(this,e,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:void 0}),Object.defineProperty(this,i,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),Object.defineProperty(this,h,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,n,{writable:!0,value:void 0}),(0,E.default)(this,e)[e]=_.Mark.none,(0,E.default)(this,s)[s]=t=>t.isText,(0,E.default)(this,i)[i]=(t,e)=>{if((0,E.default)(this,s)[s](t)&&(0,E.default)(this,s)[s](e)&&_.Mark.sameSet(t.marks,e.marks))return this.schema.text(t.text+e.text,t.marks)},(0,E.default)(this,a)[a]=t=>{const e=Object.values({...this.schema.nodes,...this.schema.marks}).find(e=>e.spec.parseMarkdown.match(t));if(!e)throw(0,T.parserMatchError)(t);return e},(0,E.default)(this,h)[h]=t=>{const e=(0,E.default)(this,a)[a](t);e.spec.parseMarkdown.runner(this,t,e)},this.injectRoot=(t,e,s)=>(this.openNode(e,s),this.next(t.children),this),this.openNode=(t,e)=>(this.open(q.create(t,[],e)),this),(0,E.default)(this,l)[l]=()=>{(0,E.default)(this,e)[e]=_.Mark.none;const t=this.close();return(0,E.default)(this,n)[n](t.type,t.attrs,t.content)},this.closeNode=()=>{try{(0,E.default)(this,l)[l]()}catch(t){console.error(t)}return this},(0,E.default)(this,n)[n]=(t,s,i)=>{const a=t.createAndFill(s,i,(0,E.default)(this,e)[e]);if(!a)throw(0,T.createNodeInParserFail)(t,s,i);return this.push(a),a},this.addNode=(t,e,s)=>{try{(0,E.default)(this,n)[n](t,e,s)}catch(t){console.error(t)}return this},this.openMark=(t,s)=>{const i=t.create(s);return(0,E.default)(this,e)[e]=i.addToSet((0,E.default)(this,e)[e]),this},this.closeMark=t=>((0,E.default)(this,e)[e]=t.removeFromSet((0,E.default)(this,e)[e]),this),this.addText=t=>{try{const s=this.top();if(!s)throw(0,T.stackOverFlow)();const a=s.pop(),h=this.schema.text(t,(0,E.default)(this,e)[e]);if(!a)return s.push(h),this;const l=(0,E.default)(this,i)[i](a,h);return l?(s.push(l),this):(s.push(a,h),this)}catch(t){return console.error(t),this}},this.build=()=>{let t;do{t=(0,E.default)(this,l)[l]()}while(this.size());return t},this.next=(t=[])=>([t].flat().forEach(t=>(0,E.default)(this,h)[h](t)),this),this.toDoc=()=>this.build(),this.run=(t,e)=>{const s=t.runSync(t.parse(e),e);return this.next(s),this},this.schema=t}}).create=(e,s)=>{const i=new t(e);return t=>(i.run(s,t),i.toDoc())},t),D=((u=class extends A{constructor(t,e,s,i={}){super(),this.type=t,this.children=e,this.value=s,this.props=i,this.push=(t,...e)=>{this.children||(this.children=[]),this.children.push(t,...e)},this.pop=()=>this.children?.pop()}}).create=(t,e,s,i={})=>new u(t,e,s,i),u),I=(c=(0,z.default)("openMarks"),f=(0,z.default)("matchTarget"),p=(0,z.default)("runProseNode"),v=(0,z.default)("runProseMark"),b=(0,z.default)("orderMarks"),y=(0,z.default)("closeEndedMarks"),k=(0,z.default)("runNode"),w=(0,z.default)("maybeMergeChildren"),P=(0,z.default)("createMarkdownNode"),O=(0,z.default)("moveSpaces"),j=(0,z.default)("closeNodeAndPush"),M=(0,z.default)("addNodeAndPush"),x=(0,z.default)("openMark"),N=(0,z.default)("closeMark"),(o=class extends F{constructor(t){super(),Object.defineProperty(this,c,{writable:!0,value:void 0}),Object.defineProperty(this,f,{writable:!0,value:void 0}),Object.defineProperty(this,p,{writable:!0,value:void 0}),Object.defineProperty(this,v,{writable:!0,value:void 0}),Object.defineProperty(this,b,{writable:!0,value:void 0}),Object.defineProperty(this,y,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),Object.defineProperty(this,w,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,j,{writable:!0,value:void 0}),Object.defineProperty(this,M,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:void 0}),Object.defineProperty(this,N,{writable:!0,value:void 0}),(0,E.default)(this,c)[c]=[],(0,E.default)(this,f)[f]=t=>{const e=Object.values({...this.schema.nodes,...this.schema.marks}).find(e=>e.spec.toMarkdown.match(t));if(!e)throw(0,T.serializerMatchError)(t.type);return e},(0,E.default)(this,p)[p]=t=>(0,E.default)(this,f)[f](t).spec.toMarkdown.runner(this,t),(0,E.default)(this,v)[v]=(t,e)=>(0,E.default)(this,f)[f](t).spec.toMarkdown.runner(this,t,e),(0,E.default)(this,b)[b]=t=>{const e=t=>t.type.spec.priority??50,s=[...t].sort((t,s)=>e(t)-e(s)),i=[];return(0,E.default)(this,c)[c].forEach(({mark:t})=>{const e=s.findIndex(e=>e.eq(t));e>=0&&i.push(...s.splice(e,1))}),i.concat(s)},(0,E.default)(this,y)[y]=t=>{const e=t?.marks;let s=0;for(;s<(0,E.default)(this,c)[c].length;){const{mark:t,spanning:i}=(0,E.default)(this,c)[c][s];if(!i||!e?.some(e=>e.eq(t)))break;s++}for(let t=(0,E.default)(this,c)[c].length-1;t>=s;t--)(0,E.default)(this,N)[N]((0,E.default)(this,c)[c][t].mark)},(0,E.default)(this,k)[k]=(t,e)=>{(0,E.default)(this,b)[b](t.marks).every(e=>!(0,E.default)(this,v)[v](e,t))&&(0,E.default)(this,p)[p](t),(0,E.default)(this,y)[y](e)},(0,E.default)(this,w)[w]=t=>{const{children:e}=t;return e?(t.children=e.reduce((t,e,s)=>{if(0===s)return[e];const i=t.at(-1);if(i&&i.isMark&&e.isMark){const{children:s,...a}=e,{children:h,...l}=i;if(e.type===i.type&&s&&h&&JSON.stringify(a)===JSON.stringify(l)){const e={...l,children:[...h,...s]};return t.slice(0,-1).concat((0,E.default)(this,w)[w](e))}}return t.concat(e)},[]),t):t},(0,E.default)(this,P)[P]=t=>{const e={...t.props,type:t.type};return t.children&&(e.children=t.children),t.value&&(e.value=t.value),e},this.openNode=(t,e,s)=>(this.open(D.create(t,void 0,e,s)),this),(0,E.default)(this,O)[O]=(t,e)=>{let s="",i="";const a=t.children;if(a){const t=a[0],e=a.at(-1);if(e&&"text"===e.type&&e.value.endsWith(" ")){const t=e.value,s=t.trimEnd();i=t.slice(s.length),e.value=s}if(t&&"text"===t.type&&t.value.startsWith(" ")){const e=t.value,i=e.trimStart();s=e.slice(0,e.length-i.length),t.value=i}}s.length&&(0,E.default)(this,M)[M]("text",void 0,s);const h=e();return i.length&&(0,E.default)(this,M)[M]("text",void 0,i),h},(0,E.default)(this,j)[j]=(t=!1)=>{const e=this.close(),s=()=>(0,E.default)(this,M)[M](e.type,e.children,e.value,e.props);return t?(0,E.default)(this,O)[O](e,s):s()},this.closeNode=()=>((0,E.default)(this,j)[j](),this),(0,E.default)(this,M)[M]=(t,e,s,i)=>{const a=D.create(t,e,s,i),h=(0,E.default)(this,w)[w]((0,E.default)(this,P)[P](a));return this.push(h),h},this.addNode=(t,e,s,i)=>((0,E.default)(this,M)[M](t,e,s,i),this),(0,E.default)(this,x)[x]=(t,e,s,i)=>(0,E.default)(this,c)[c].some(e=>e.mark.eq(t))?this:((0,E.default)(this,c)[c].push({mark:t,spanning:null==s}),this.openNode(e,s,{...i,isMark:!0})),(0,E.default)(this,N)[N]=t=>{let e=-1;for(let s=(0,E.default)(this,c)[c].length-1;s>=0;s--)if((0,E.default)(this,c)[c][s].mark.eq(t)){e=s;break}e<0||((0,E.default)(this,c)[c].splice(e,1),(0,E.default)(this,j)[j](!0))},this.withMark=(t,e,s,i)=>((0,E.default)(this,x)[x](t,e,s,i),this),this.closeMark=t=>((0,E.default)(this,N)[N](t),this),this.build=()=>{let t=null;do{t=(0,E.default)(this,j)[j]()}while(this.size());return t.children||(t.children=[]),t},this.next=t=>{return e=t,Object.prototype.hasOwnProperty.call(e,"size")?(t.forEach((e,s,i)=>{(0,E.default)(this,k)[k](e,t.maybeChild(i+1)??void 0)}),this):((0,E.default)(this,k)[k](t),this);var e},this.toString=t=>t.stringify(this.build()),this.run=t=>((0,E.default)(this,c)[c]=[],this.next(t),this),this.schema=t}}).create=(t,e)=>{const s=new o(t);return t=>(s.run(t),s.toString(e))},o)},2625,[1422,1423,2467,2617]);
164
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2626,[2627]);
165
+ __d(function(e,t,n,o,i,s,r){"use strict";Object.defineProperty(s,'__esModule',{value:!0}),Object.defineProperty(s,"Decoration",{enumerable:!0,get:function(){return $n}}),Object.defineProperty(s,"DecorationSet",{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(s,"EditorView",{enumerable:!0,get:function(){return Mo}}),Object.defineProperty(s,"__endComposition",{enumerable:!0,get:function(){return xo}}),Object.defineProperty(s,"__parseFromClipboard",{enumerable:!0,get:function(){return Co}});var l=t(r[0]),d=t(r[1]),a=t(r[2]);const c=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},h=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let f=null;const u=function(e,t,n){let o=f||(f=document.createRange());return o.setEnd(e,null==n?e.nodeValue.length:n),o.setStart(e,t||0),o},p=function(e,t,n,o){return n&&(g(e,t,n,o,-1)||g(e,t,n,o,1))},m=/^(img|br|input|textarea|hr)$/i;function g(e,t,n,o,i){for(var s;;){if(e==n&&t==o)return!0;if(t==(i<0?0:b(e))){let n=e.parentNode;if(!n||!y(n)||O(e)||m.test(e.nodeName)||"false"==e.contentEditable)return!1;t=c(e)+(i<0?0:1),e=n}else{if(!y(e))return!1;{let n=e.childNodes[t+(i<0?-1:0)];if(y(n)&&"false"==n.contentEditable){if(!(null===(s=n.pmViewDesc)||void 0===s?void 0:s.ignoreForSelection))return!1;t+=i}else e=n,t=i<0?b(e):0}}}}function b(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function y(e){return 1==e.nodeType}function v(e){return 3==e.nodeType}function w(e,t){return!!t&&e.contains(y(t)?t:t.parentNode)}function S(e,t){for(;;){if(v(e)&&t)return e;if(y(e)&&t>0){if("false"==e.contentEditable)return null;t=b(e=e.childNodes[t-1])}else{if(!e.parentNode||O(e))return null;t=c(e),e=e.parentNode}}}function D(e,t){for(;;){if(v(e)&&t<e.nodeValue.length)return e;if(y(e)&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||O(e))return null;t=c(e)+1,e=e.parentNode}}}function N(e,t,n){for(let o=0==t,i=t==b(e);o||i;){if(e==n)return!0;let t=c(e);if(!(e=e.parentNode))return!1;o=o&&0==t,i=i&&t==b(e)}}function O(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)}const C=function(e){return e.focusNode&&p(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function x(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function M(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function k(e,t,n){if(e.caretPositionFromPoint)try{let o=e.caretPositionFromPoint(t,n);if(o)return{node:o.offsetNode,offset:Math.min(b(o.offsetNode),o.offset)}}catch(e){}if(e.caretRangeFromPoint){let o=e.caretRangeFromPoint(t,n);if(o)return{node:o.startContainer,offset:Math.min(b(o.startContainer),o.startOffset)}}}const T="undefined"!=typeof navigator?navigator:null,P="undefined"!=typeof document?document:null,E=T&&T.userAgent||"",A=/Edge\/(\d+)/.exec(E),V=/MSIE \d/.exec(E),R=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(E),B=!!(V||R||A),F=V?document.documentMode:R?+R[1]:A?+A[1]:0,z=!B&&/gecko\/(\d+)/i.test(E);z&&(/Firefox\/(\d+)/.exec(E)||[0,0])[1];const L=!B&&/Chrome\/(\d+)/.exec(E),I=!!L,q=L?+L[1]:0,$=!B&&!!T&&/Apple Computer/.test(T.vendor),K=$&&(/Mobile\/\w+/.test(E)||!!T&&T.maxTouchPoints>2),W=K||!!T&&/Mac/.test(T.platform),H=!!T&&/Win/.test(T.platform),_=/Android \d/.test(E),U=!!P&&"webkitFontSmoothing"in P.documentElement.style,G=U?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function j(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}}function Y(e,t){return"number"==typeof e?e:e[t]}function X(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,o=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*o}}function J(e,t,n){if(!fe(t)&&0==t.left)return;let o=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let r=n||e.dom;r;){if(!y(r)){r=h(r);continue}let e=r==s.body,n=e?j(s):X(r),l=0,d=0;if(t.top<n.top+Y(o,"top")?d=-(n.top-t.top+Y(i,"top")):t.bottom>n.bottom-Y(o,"bottom")&&(d=t.bottom-t.top>n.bottom-n.top?t.top+Y(i,"top")-n.top:t.bottom-n.bottom+Y(i,"bottom")),t.left<n.left+Y(o,"left")?l=-(n.left-t.left+Y(i,"left")):t.right>n.right-Y(o,"right")&&(l=t.right-n.right+Y(i,"right")),l||d)if(e)s.defaultView.scrollBy(l,d);else{let e=r.scrollLeft,n=r.scrollTop;d&&(r.scrollTop+=d),l&&(r.scrollLeft+=l);let o=r.scrollLeft-e,i=r.scrollTop-n;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let a=e?"fixed":getComputedStyle(r).position;if(/^(fixed|sticky)$/.test(a))break;r="absolute"==a?r.offsetParent:h(r)}}function Q(e){let t,n,o=e.dom.getBoundingClientRect(),i=Math.max(0,o.top);for(let s=(o.left+o.right)/2,r=i+1;r<Math.min(innerHeight,o.bottom);r+=5){let o=e.root.elementFromPoint(s,r);if(!o||o==e.dom||!e.dom.contains(o))continue;let l=o.getBoundingClientRect();if(l.top>=i-20){t=o,n=l.top;break}}return{refDOM:t,refTop:n,stack:Z(e.dom)}}function Z(e){let t=[],n=e.ownerDocument;for(let o=e;o&&(t.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),e!=n);o=h(o));return t}function ee({refDOM:e,refTop:t,stack:n}){let o=e?e.getBoundingClientRect().top:0;te(n,0==o?0:o-t)}function te(e,t){for(let n=0;n<e.length;n++){let{dom:o,top:i,left:s}=e[n];o.scrollTop!=i+t&&(o.scrollTop=i+t),o.scrollLeft!=s&&(o.scrollLeft=s)}}let ne=null;function oe(e){if(e.setActive)return e.setActive();if(ne)return e.focus(ne);let t=Z(e);e.focus(null==ne?{get preventScroll(){return ne={preventScroll:!0},!0}}:void 0),ne||(ne=!1,te(t,0))}function ie(e,t){let n,o,i,s,r=2e8,l=0,d=t.top,a=t.top;for(let c=e.firstChild,h=0;c;c=c.nextSibling,h++){let e;if(y(c))e=c.getClientRects();else{if(!v(c))continue;e=u(c).getClientRects()}for(let f=0;f<e.length;f++){let u=e[f];if(u.top<=d&&u.bottom>=a){d=Math.max(u.bottom,d),a=Math.min(u.top,a);let e=u.left>t.left?u.left-t.left:u.right<t.left?t.left-u.right:0;if(e<r){n=c,r=e,o=e&&v(n)?{left:u.right<t.left?u.right:u.left,top:t.top}:t,y(c)&&e&&(l=h+(t.left>=(u.left+u.right)/2?1:0));continue}}else u.top>t.top&&!i&&u.left<=t.left&&u.right>=t.left&&(i=c,s={left:Math.max(u.left,Math.min(u.right,t.left)),top:u.top});!n&&(t.left>=u.right&&t.top>=u.top||t.left>=u.left&&t.top>=u.bottom)&&(l=h+1)}}return!n&&i&&(n=i,o=s,r=0),n&&v(n)?se(n,o):!n||r?{node:e,offset:l}:ie(n,o)}function se(e,t){let n,o=e.nodeValue.length,i=document.createRange();for(let s=0;s<o;s++){i.setEnd(e,s+1),i.setStart(e,s);let o=ue(i,1);if(o.top!=o.bottom&&re(t,o)){n={node:e,offset:s+(t.left>=(o.left+o.right)/2?1:0)};break}}return i.detach(),n||{node:e,offset:0}}function re(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function le(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function de(e,t,n){let{node:o,offset:i}=ie(t,n),s=-1;if(y(o)&&!o.firstChild){let e=o.getBoundingClientRect();s=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(o,i,s)}function ae(e,t,n,o){let i=-1;for(let n=t,s=!1;n!=e.dom;){let t,r=e.docView.nearestDesc(n,!0);if(!r)return null;if(y(r.dom)&&(r.node.isBlock&&r.parent||!r.contentDOM)&&((t=r.dom.getBoundingClientRect()).width||t.height)&&(r.node.isBlock&&r.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(r.dom.nodeName)&&(!s&&t.left>o.left||t.top>o.top?i=r.posBefore:(!s&&t.right<o.left||t.bottom<o.top)&&(i=r.posAfter),s=!0),!r.contentDOM&&i<0&&!r.node.isText)){return(r.node.isBlock?o.top<(t.top+t.bottom)/2:o.left<(t.left+t.right)/2)?r.posBefore:r.posAfter}n=r.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function ce(e,t,n){let o=e.childNodes.length;if(o&&n.top<n.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(t.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let n=e.childNodes[s];if(y(n)){let e=n.getClientRects();for(let o=0;o<e.length;o++){let i=e[o];if(re(t,i))return ce(n,t,i)}}if((s=(s+1)%o)==i)break}return e}function he(e,t){let n,o=e.dom.ownerDocument,i=0,s=k(o,t.left,t.top);s&&({node:n,offset:i}=s);let r,l=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!l||!e.dom.contains(l)){let n=e.dom.getBoundingClientRect();if(!re(t,n))return null;if(l=ce(e.dom,t,n),!l)return null}if($)for(let e=l;n&&e;e=h(e))e.draggable&&(n=void 0);if(l=le(l,t),n){if(z&&y(n)&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,o=n.childNodes[i];"IMG"==o.nodeName&&(e=o.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}let o;U&&i&&y(n)&&y(o=n.childNodes[i-1])&&"false"==o.contentEditable&&o.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&y(n.lastChild)&&t.top>n.lastChild.getBoundingClientRect().bottom?r=e.state.doc.content.size:0!=i&&y(n)&&"BR"==n.childNodes[i-1].nodeName||(r=ae(e,n,i,t))}null==r&&(r=de(e,l,t));let d=e.docView.nearestDesc(l,!0);return{pos:r,inside:d?d.posAtStart-d.border:-1}}function fe(e){return e.top<e.bottom||e.left<e.right}function ue(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(fe(e))return e}return Array.prototype.find.call(n,fe)||e.getBoundingClientRect()}const pe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function me(e,t,n){let{node:o,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),r=U||z;if(v(o)){if(!r||!pe.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){let e=i,t=i,s=n<0?1:-1;return n<0&&!i?(t++,s=-1):n>=0&&i==o.nodeValue.length?(e--,s=1):n<0?e--:t++,ge(ue(u(o,e,t),s),s<0)}{let e=ue(u(o,i,i),n);if(z&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let t=ue(u(o,i-1,i-1),-1);if(t.top==e.top){let n=ue(u(o,i,i+1),-1);if(n.top!=e.top)return ge(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==b(o))){let e=o.childNodes[i-1];if(y(e))return be(e.getBoundingClientRect(),!1)}if(null==s&&i<b(o)){let e=o.childNodes[i];if(y(e))return be(e.getBoundingClientRect(),!0)}return be(o.getBoundingClientRect(),n>=0)}if(null==s&&i&&(n<0||i==b(o))){let e=o.childNodes[i-1],t=v(e)?u(e,b(e)-(r?0:1)):!y(e)||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return ge(ue(t,1),!1)}if(null==s&&i<b(o)){let e=o.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?v(e)?u(e,0,r?0:1):y(e)?e:null:null;if(t)return ge(ue(t,-1),!0)}return ge(ue(v(o)?u(o):o,-n),n>=0)}function ge(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 be(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 ye(e,t,n){let o=e.state,i=e.root.activeElement;o!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{o!=t&&e.updateState(o),i!=e.dom&&i&&i.focus()}}function ve(e,t,n){let o=t.selection,i="up"==n?o.$from:o.$to;return ye(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 o=me(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(y(e))t=e.getClientRects();else{if(!v(e))continue;t=u(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?o.top-i.top>2*(i.bottom-o.top):i.bottom-o.bottom>2*(o.bottom-i.top)))return!1}}return!0})}const we=/[\u0590-\u08ac]/;function Se(e,t,n){let{$head:o}=t.selection;if(!o.parent.isTextblock)return!1;let i=o.parentOffset,s=!i,r=i==o.parent.content.size,l=e.domSelection();return l?we.test(o.parent.textContent)&&l.modify?ye(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:s,anchorOffset:r}=e.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",n,"character");let a=o.depth?e.docView.domAfterPos(o.before()):e.dom,{focusNode:c,focusOffset:h}=e.domSelectionRange(),f=c&&!w(a,c)||t==c&&i==h;try{l.collapse(s,r),t&&(t!=s||i!=r)&&l.extend&&l.extend(t,i)}catch(e){}return null!=d&&(l.caretBidiLevel=d),f}):"left"==n||"backward"==n?s:r:o.pos==o.start()||o.pos==o.end()}let De=null,Ne=null,Oe=!1;function Ce(e,t,n){return De==t&&Ne==n?Oe:(De=t,Ne=n,Oe="up"==n||"down"==n?ve(e,t,n):Se(e,t,n))}class xe{constructor(e,t,n,o){this.parent=e,this.children=t,this.dom=n,this.contentDOM=o,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let o=this.children[t];if(o==e)return n;n+=o.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){if(this.contentDOM&&w(this.contentDOM,e)){if(n<0){let n,o;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(o=n.pmViewDesc)||o.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(o)+o.size:this.posAtStart}{let n,o;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(o=n.pmViewDesc)||o.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(o):this.posAtEnd}}let o;if(e==this.dom&&this.contentDOM)o=t>c(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=!!(4&e.compareDocumentPosition(this.contentDOM));else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){o=!1;break}if(t.previousSibling)break}if(null==o&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){o=!0;break}if(t.nextSibling)break}}return(null==o?n>0:o)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,o=e;o;o=o.parentNode){let i,s=this.getDesc(o);if(s&&(!t||s.node)){if(!n||!(i=s.nodeDOM)||(y(i)?w(i,e):i==e))return s;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 o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let o=this.children[t],i=n+o.size;if(n==e&&i!=n){for(;!o.border&&o.children.length;)for(let e=0;e<o.children.length;e++){let t=o.children[e];if(t.size){o=t;break}}return o}if(e<i)return o.descAt(e-n-o.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,o=0;for(let t=0;n<this.children.length;n++){let i=t+this.children[n].size;if(i>e){o=e-t;break}t=i}if(o)return this.children[n].domFromPos(o-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof Ve||e instanceof Me&&e.side>=0))break}if(t<=0){let e,o=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,o=!1);return e&&t&&o&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?c(e.dom)+1:0}}{let e,o=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,o=!1);return e&&o&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?c(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 o=-1,i=-1;for(let s=n,r=0;;r++){let n=this.children[r],l=s+n.size;if(-1==o&&e<=l){let i=s+n.border;if(e>=i&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;for(let t=r;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){o=c(n.dom)+1;break}e-=n.size}-1==o&&(o=0)}if(o>-1&&(l>t||r==this.children.length-1)){t=l;for(let e=r+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=c(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}s=l}return{node:this.contentDOM,from:e,to:t,fromOffset:o,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(!y(t)||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,o=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let r=0,l=0;r<this.children.length;r++){let d=this.children[r],a=l+d.size;if(i>l&&s<a)return d.setSelection(e-l-d.border,t-l-d.border,n,o);l=a}let r=this.domFromPos(e,e?-1:1),l=t==e?r:this.domFromPos(t,t?-1:1),d=n.root.getSelection(),a=n.domSelectionRange(),h=!1;if((z||$)&&e==t){let{node:e,offset:t}=r;if(v(e)){if(h=!(!t||"\n"!=e.nodeValue[t-1]),h&&t==e.nodeValue.length)for(let t,n=e;n;n=n.parentNode){if(t=n.nextSibling){"BR"==t.nodeName&&(r=l={node:t.parentNode,offset:c(t)+1});break}let e=n.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];h=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(z&&a.focusNode&&a.focusNode!=l.node&&y(a.focusNode)){let e=a.focusNode.childNodes[a.focusOffset];e&&"false"==e.contentEditable&&(o=!0)}if(!(o||h&&$)&&p(r.node,r.offset,a.anchorNode,a.anchorOffset)&&p(l.node,l.offset,a.focusNode,a.focusOffset))return;let f=!1;if((d.extend||e==t)&&(!h||!z)){d.collapse(r.node,r.offset);try{e!=t&&d.extend(l.node,l.offset),f=!0}catch(e){}}if(!f){if(e>t){let e=r;r=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(r.node,r.offset),d.removeAllRanges(),d.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,o=0;o<this.children.length;o++){let i=this.children[o],s=n+i.size;if(n==s?e<=s&&t>=n:e<s&&t>n){let o=n+i.border,r=s-i.border;if(e>=o&&t<=r)return this.dirty=e==n||t==s?2:1,void(e!=o||t!=r||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-o,t-o):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=s}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 Me extends xe{constructor(e,t,n,o){let i,s=t.type.toDOM;if("function"==typeof s&&(s=s(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:o)),!t.type.spec.raw){let e=y(s)?s:document.createElement("span");e!=s&&e.appendChild(s),e.hasAttribute("contenteditable")||(e.contentEditable="false"),e.classList.add("ProseMirror-widget")}super(e,[],s,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 ke extends xe{constructor(e,t,n,o){super(e,[],t,null),this.textDOM=n,this.text=o}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 Te extends xe{constructor(e,t,n,o,i){super(e,[],n,o),this.mark=t,this.spec=i}static create(e,t,n,o){let i=o.nodeViews[t.type.name],s=i&&i(t,o,n);return s&&s.dom||(s=d.DOMSerializer.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new Te(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let o=Te.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;t<s&&(i=Xe(i,t,s,n)),e>0&&(i=Xe(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Pe extends xe{constructor(e,t,n,o,i,s,r){super(e,[],i,s),this.node=t,this.outerDeco=n,this.innerDeco=o,this.nodeDOM=r}static create(e,t,n,o,i,s){let r,l=i.nodeViews[t.type.name],a=l&&l(t,i,()=>r?r.parent?r.parent.posBeforeChild(r):void 0:s,n,o),c=a&&a.dom,h=a&&a.contentDOM;if(t.isText)if(c){if(!v(c))throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=d.DOMSerializer.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:h}=e)}h||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let f=c;return c=$e(c,n,t),a?r=new Re(e,t,n,o,c,h||null,f,a):t.isText?new Ae(e,t,n,o,c,f):new Pe(e,t,n,o,c,h||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>y(t)&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>d.Fragment.empty}}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Ke(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,r=i&&i.pos<0,l=new He(this,s&&s.node,e),a=this.node.inlineContent,c=a&&this.node.isBlock;Ge(this.node,this.innerDeco,(t,i,s)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!s&&l.syncToMarks(i==this.node.childCount?d.Mark.none:this.node.child(i).marks,n,e,i),l.placeWidget(t,e,o)},(t,s,d,h)=>{let f;l.syncToMarks(t.marks,n,e,h),c&&t.isAtom&&!t.isText&&l.addHackNode("IMG",l.top),l.findNodeMatch(t,s,d,h)||r&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(f=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(t,s,d,f,e)||l.updateNextNode(t,s,d,e,h,o)||l.addNode(t,s,d,e,o),o+=t.nodeSize,a&&(c=t.isAtom&&!t.isText)}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),Be(this.contentDOM,this.children,e),K&&je(this.dom))}localCompositionInfo(e,t){let{from:n,to:o}=e.state.selection;if(!(e.state.selection instanceof l.TextSelection)||n<t||o>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){let e=i.nodeValue,s=Ye(this.node.content,e,n-t,o-t);return s<0?null:{node:i,pos:s,text:e}}return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:o}){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 s=new ke(this,i,t,o);e.input.compositionNodes.push(s),this.children=Xe(this.children,n,n+o.length,e,s)}update(e,t,n,o){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,o),!0)}updateInner(e,t,n,o){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Ke(e,this.outerDeco))return;let t=!y(this.nodeDOM),n=this.dom;this.dom=Ie(this.dom,this.nodeDOM,Le(this.outerDeco,this.node,t),Le(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){y(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){y(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Ee(e,t,n,o,i){$e(o,t,e);let s=new Pe(void 0,e,t,n,o,o,o);return s.contentDOM&&s.updateChildren(i,0),s}class Ae extends Pe{constructor(e,t,n,o,i,s){super(e,t,n,o,i,null,s)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,o){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,o.trackWrites==this.nodeDOM&&(o.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 o=this.node.cut(e,t),i=document.createTextNode(o.text);return new Ae(this.parent,o,this.outerDeco,this.innerDeco,i,i)}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 Ve extends xe{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 Re extends Pe{constructor(e,t,n,o,i,s,r,l){super(e,t,n,o,i,s,r),this.spec=l}update(e,t,n,o){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,o),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,o){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,o)}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)}}function Be(e,t,n){let o=e.firstChild,i=!1;for(let s=0;s<t.length;s++){let r=t[s],l=r.dom;if(l.parentNode==e){for(;l!=o;)o=We(o),i=!0;o=o.nextSibling}else i=!0,e.insertBefore(l,o);if(r instanceof Te){let t=o?o.previousSibling:e.lastChild;Be(r.contentDOM,r.children,n),o=t?t.nextSibling:e.firstChild}}for(;o;)o=We(o),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Fe=function(e){e&&(this.nodeName=e)};Fe.prototype=Object.create(null);const ze=[new Fe];function Le(e,t,n){if(0==e.length)return ze;let o=n?ze[0]:new Fe,i=[o];for(let s=0;s<e.length;s++){let r=e[s].type.attrs;if(r){r.nodeName&&i.push(o=new Fe(r.nodeName));for(let e in r){let s=r[e];null!=s&&(n&&1==i.length&&i.push(o=new Fe(t.isInline?"span":"div")),"class"==e?o.class=(o.class?o.class+" ":"")+s:"style"==e?o.style=(o.style?o.style+";":"")+s:"nodeName"!=e&&(o[e]=s))}}}return i}function Ie(e,t,n,o){if(n==ze&&o==ze)return t;let i=t;for(let t=0;t<o.length;t++){let s=o[t],r=n[t];if(t){let t;r&&r.nodeName==s.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==s.nodeName||(t=document.createElement(s.nodeName),t.pmIsDeco=!0,t.appendChild(i),r=ze[0]),i=t}qe(i,r||ze[0],s)}return i}function qe(e,t,n){for(let o in t)"class"==o||"style"==o||"nodeName"==o||o in n||e.removeAttribute(o);for(let o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){let o=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<o.length;t++)-1==i.indexOf(o[t])&&e.classList.remove(o[t]);for(let t=0;t<i.length;t++)-1==o.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,o=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=o.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function $e(e,t,n){return Ie(e,e,ze,Le(t,n,!y(e)))}function Ke(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 We(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class He{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=_e(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,o){let i=0,s=this.stack.length>>1,r=Math.min(s,e.length);for(;i<r&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let i=-1,r=this.top.children.length;o<this.preMatch.index&&(r=Math.min(this.index+3,r));for(let t=this.index;t<r;t++){let n=this.top.children[t];if(n.matchesMark(e[s])&&!this.isLocked(n.dom)){i=t;break}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof Te&&3!=t.dirty&&t.mark.type==e[s].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[s])&&(t.mark=e[s],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let o=Te.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,o),this.top=o,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,o){let i,s=-1;if(o>=this.preMatch.index&&(i=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))s=this.top.children.indexOf(i,this.index);else for(let o=this.index,i=Math.min(this.top.children.length,o+5);o<i;o++){let i=this.top.children[o];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){s=o;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,n,o,i){let s=this.top.children[o];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,n,i)&&(this.destroyBetween(this.index,o),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,o,i,s){for(let r=this.index;r<this.top.children.length;r++){let l=this.top.children[r];if(l instanceof Pe){let d=this.preMatch.matched.get(l);if(null!=d&&d!=i)return!1;let a,c=l.dom,h=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&Ke(t,l.outerDeco));if(!h&&l.update(e,t,n,o))return this.destroyBetween(this.index,r),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!h&&(a=this.recreateWrapper(l,e,t,n,o,s)))return this.destroyBetween(this.index,r),this.top.children[this.index]=a,a.contentDOM&&(a.dirty=2,a.updateChildren(o,s+1),a.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,o,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Ke(n,e.outerDeco)||!o.eq(e.innerDeco))return null;let r=Pe.create(this.top,t,n,o,i,s);if(r.contentDOM){r.children=e.children,e.children=[];for(let e of r.children)e.parent=r}return e.destroy(),r}addNode(e,t,n,o,i){let s=Pe.create(this.top,e,t,n,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,n){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(!o||!o.matchesWidget(e)||e!=o.widget&&o.widget.type.toDOM.parentNode){let o=new Me(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Te;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Ae)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&(($||I)&&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 o=new Ve(this.top,[],n,null);t!=this.top?t.children.push(o):t.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||y(e)&&e.contains(this.lock.parentNode))}}function _e(e,t){let n=t,o=n.children.length,i=e.childCount,s=new Map,r=[];e:for(;i>0;){let l;for(;;)if(o){let e=n.children[o-1];if(!(e instanceof Te)){l=e,o--;break}n=e,o=e.children.length}else{if(n==t)break e;o=n.parent.children.indexOf(n),n=n.parent}let d=l.node;if(d){if(d!=e.child(i-1))break;--i,s.set(l,i),r.push(l)}}return{index:i,matched:s,matches:r.reverse()}}function Ue(e,t){return e.type.side-t.type.side}function Ge(e,t,n,o){let i=t.locals(e),s=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let r=e.child(n);o(r,i,t.forChild(s,r),n),s+=r.nodeSize}return}let r=0,l=[],d=null;for(let a=0;;){let c,h,f,u;for(;r<i.length&&i[r].to==s;){let e=i[r++];e.widget&&(c?(h||(h=[c])).push(e):c=e)}if(c)if(h){h.sort(Ue);for(let e=0;e<h.length;e++)n(h[e],a,!!d)}else n(c,a,!!d);if(d)u=-1,f=d,d=null;else{if(!(a<e.childCount))break;u=a,f=e.child(a++)}for(let e=0;e<l.length;e++)l[e].to<=s&&l.splice(e--,1);for(;r<i.length&&i[r].from<=s&&i[r].to>s;)l.push(i[r++]);let p=s+f.nodeSize;if(f.isText){let e=p;r<i.length&&i[r].from<e&&(e=i[r].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<p&&(d=f.cut(e-s),f=f.cut(0,e-s),p=e,u=-1)}else for(;r<i.length&&i[r].to<p;)r++;o(f,f.isInline&&!f.isLeaf?l.filter(e=>!e.inline):l.slice(),t.forChild(s,f),u),s=p}}function je(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}}function Ye(e,t,n,o){for(let i=0,s=0;i<e.childCount&&s<=o;){let r=e.child(i++),l=s;if(s+=r.nodeSize,!r.isText)continue;let d=r.text;for(;i<e.childCount;){let t=e.child(i++);if(s+=t.nodeSize,!t.isText)break;d+=t.text}if(s>=n){if(s>=o&&d.slice(o-t.length-l,o-l)==t)return o-t.length;let e=l<o?d.lastIndexOf(t,o-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==o&&d.length>=o+t.length-l&&d.slice(o-l,o-l+t.length)==t)return o}}return-1}function Xe(e,t,n,o,i){let s=[];for(let r=0,l=0;r<e.length;r++){let d=e[r],a=l,c=l+=d.size;a>=n||c<=t?s.push(d):(a<t&&s.push(d.slice(0,t-a,o)),i&&(s.push(i),i=void 0),c>n&&s.push(d.slice(n-a,d.size,o)))}return s}function Je(e,t=null){let n=e.domSelectionRange(),o=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),s=i&&0==i.size,r=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(r<0)return null;let d,a,c=o.resolve(r);if(C(n)){for(d=r;i&&!i.node;)i=i.parent;if(!(i&&i.node.isAtom&&l.NodeSelection.isSelectable(i.node)&&i.parent)||i.node.isInline&&N(n.focusNode,n.focusOffset,i.dom)){if(z&&"key"==t&&r>e.state.selection.to&&y(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if("visible"!=getComputedStyle(e).overflow){a=l.Selection.findFrom(o.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!y(e.parentNode))break}}else{let e=i.posBefore;a=new l.NodeSelection(r==e?c:o.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=r,i=r;for(let o=0;o<n.rangeCount;o++){let s=n.getRangeAt(o);t=Math.min(t,e.docView.posFromDOM(s.startContainer,s.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(s.endContainer,s.endOffset,-1))}if(t<0)return null;[d,r]=i==e.state.selection.anchor?[i,t]:[t,i],c=o.resolve(r)}else d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null}let h=o.resolve(d);if(!a){a=dt(e,h,c,"pointer"==t||e.state.selection.head<c.pos&&!s?1:-1)}return a}function Qe(e){return e.editable?e.hasFocus():ct(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Ze(e,t=!1){let n=e.state.selection;if(rt(e,n),!Qe(e))return;let o=e.input.mouseDown;if(!t&&I&&o){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&p(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&o.delaySelUpdate())return void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)st(e);else{let o,i,{anchor:s,head:r}=n;!et||n instanceof l.TextSelection||(n.$from.parent.inlineContent||(o=tt(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=tt(e,n.to))),e.docView.setSelection(s,r,e,t),et&&(o&&ot(o),i&&ot(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&it(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const et=$||I&&q<63;function tt(e,t){let{node:n,offset:o}=e.docView.domFromPos(t,0),i=o<n.childNodes.length?n.childNodes[o]:null,s=o?n.childNodes[o-1]:null;if($&&i&&"false"==i.contentEditable)return nt(i);if(!(i&&"false"!=i.contentEditable||s&&"false"!=s.contentEditable)){if(i)return nt(i);if(s)return nt(s)}}function nt(e){return e.contentEditable="true",$&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function ot(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function it(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),o=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==o&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{Qe(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")},20))})}function st(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,o="IMG"==n.nodeName;o?t.collapse(n.parentNode,c(n)+1):t.collapse(n,0),!o&&!e.state.selection.visible&&B&&F<=11&&(n.disabled=!0,n.disabled=!1)}function rt(e,t){if(t instanceof l.NodeSelection){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(lt(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else lt(e)}function lt(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function dt(e,t,n,o){return e.someProp("createSelectionBetween",o=>o(e,t,n))||l.TextSelection.between(t,n,o)}function at(e){return!(e.editable&&!e.hasFocus())&&ct(e)}function ct(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return w(e.dom,t.anchorNode)&&(e.editable||w(e.dom,t.focusNode))}catch(e){return!1}}function ht(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return p(t.node,t.offset,n.anchorNode,n.anchorOffset)}function ft(e,t){let{$anchor:n,$head:o}=e.selection,i=t>0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&l.Selection.findFrom(s,t)}function ut(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function pt(e,t,n){let o=e.state.selection;if(!(o instanceof l.TextSelection)){if(o instanceof l.NodeSelection&&o.node.isInline)return ut(e,new l.TextSelection(t>0?o.$to:o.$from));{let n=ft(e.state,t);return!!n&&ut(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=o,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return ut(e,new l.TextSelection(o.$anchor,s))}if(!o.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=ft(e.state,t);return!!(n&&n instanceof l.NodeSelection)&&ut(e,n)}if(!(W&&n.indexOf("m")>-1)){let n,i=o.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText)return!1;let r=t<0?i.pos-s.nodeSize:i.pos;return!!(s.isAtom||(n=e.docView.descAt(r))&&!n.contentDOM)&&(l.NodeSelection.isSelectable(s)?ut(e,new l.NodeSelection(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):ut(e,new l.TextSelection(e.state.doc.resolve(t<0?r:r+s.nodeSize))))}}function mt(e,t){let n=e.pmViewDesc;return n?0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName):y(e)&&"false"==e.contentEditable}function gt(e,t){return t<0?bt(e):yt(e)}function bt(e){let t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(!n)return;let i,s,r=!1;for(z&&y(n)&&o<b(n)&&mt(n.childNodes[o],-1)&&(r=!0);;)if(o>0){if(!y(n))break;let e=n.childNodes[o-1];if(mt(e,-1))i=n,s=--o;else{if(!v(e))break;n=e,o=n.nodeValue.length}}else{if(vt(n))break;{let t=n.previousSibling;for(;t&&mt(t,-1);)i=n.parentNode,s=c(t),t=t.previousSibling;if(t)n=t,o=b(n);else{if(n=n.parentNode,n==e.dom)break;o=0}}}r?Dt(e,n,o):i&&Dt(e,i,s)}function yt(e){let t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(!n)return;let i,s,r=b(n);for(;;)if(o<r){if(!y(n))break;if(!mt(n.childNodes[o],1))break;i=n,s=++o}else{if(vt(n))break;{let t=n.nextSibling;for(;t&&mt(t,1);)i=t.parentNode,s=c(t)+1,t=t.nextSibling;if(t)n=t,o=0,r=b(n);else{if(n=n.parentNode,n==e.dom)break;o=r=0}}}i&&Dt(e,i,s)}function vt(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function wt(e,t){for(;e&&t==e.childNodes.length&&!O(e);)t=c(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(v(n))return n;if(y(n)&&"false"==n.contentEditable)break;e=n,t=0}}function St(e,t){for(;e&&!t&&!O(e);)t=c(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(v(n))return n;if(y(n)&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}function Dt(e,t,n){if(!v(t)){let e,o;(o=wt(t,n))?(t=o,n=0):(e=St(t,n))&&(t=e,n=e.nodeValue.length)}let o=e.domSelection();if(!o)return;if(C(o)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),o.removeAllRanges(),o.addRange(e)}else o.extend&&o.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Ze(e)},50)}function Nt(e,t){let n=e.state.doc.resolve(t);if(!I&&!H&&n.parent.inlineContent){let o=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(n.left-o.left)>1)return n.left<o.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>o.top&&i<o.bottom&&Math.abs(n.left-o.left)>1)return n.left>o.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function Ot(e,t,n){let o=e.state.selection;if(o instanceof l.TextSelection&&!o.empty||n.indexOf("s")>-1)return!1;if(W&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ft(e.state,t);if(n&&n instanceof l.NodeSelection)return ut(e,n)}if(!i.parent.inlineContent){let n=t<0?i:s,r=o instanceof l.AllSelection?l.Selection.near(n,t):l.Selection.findFrom(n,t);return!!r&&ut(e,r)}return!1}function Ct(e,t){if(!(e.state.selection instanceof l.TextSelection))return!0;let{$head:n,$anchor:o,empty:i}=e.state.selection;if(!n.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=e.state.tr;return t<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),e.dispatch(o),!0}return!1}function xt(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Mt(e){if(!$||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&y(t)&&0==n&&t.firstChild&&y(t.firstChild)&&"false"==t.firstChild.contentEditable){let n=t.firstChild;xt(e,n,"true"),setTimeout(()=>xt(e,n,"false"),20)}return!1}function kt(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function Tt(e,t){let n=t.keyCode,o=kt(t);if(8==n||W&&72==n&&"c"==o)return Ct(e,-1)||gt(e,-1);if(46==n&&!t.shiftKey||W&&68==n&&"c"==o)return Ct(e,1)||gt(e,1);if(13==n||27==n)return!0;if(37==n||W&&66==n&&"c"==o){let t=37==n?"ltr"==Nt(e,e.state.selection.from)?-1:1:-1;return pt(e,t,o)||gt(e,t)}if(39==n||W&&70==n&&"c"==o){let t=39==n?"ltr"==Nt(e,e.state.selection.from)?1:-1:1;return pt(e,t,o)||gt(e,t)}return 38==n||W&&80==n&&"c"==o?Ot(e,-1,o)||gt(e,-1):40==n||W&&78==n&&"c"==o?Mt(e)||Ot(e,1,o)||gt(e,1):o==(W?"m":"c")&&(66==n||73==n||89==n||90==n)}function Pt(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:o,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&1==o.childCount&&1==o.firstChild.childCount;){i--,s--;let e=o.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),o=e.content}let r=e.someProp("clipboardSerializer")||d.DOMSerializer.fromSchema(e.state.schema),l=qt(),a=l.createElement("div");a.appendChild(r.serializeFragment(o,{document:l}));let c,h=a.firstChild,f=0;for(;h&&y(h)&&(c=It[h.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),f++}h=a.firstChild}return h&&y(h)&&h.setAttribute("data-pm-slice",`${i} ${s}${f?` -${f}`:""} ${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 Et(e,t,n,o,i){let s,r,l=i.parent.type.spec.code;if(!n&&!t)return null;let a=!!t&&(o||l||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,l||o,e)}),l)return r=new d.Slice(d.Fragment.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{r=t(r,e,!0)}),r;let n=e.someProp("clipboardTextParser",n=>n(t,i,o,e));if(n)r=n;else{let n=i.marks(),{schema:o}=e.state,r=d.DOMSerializer.fromSchema(o);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(r.serializeNode(o.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),s=Wt(n),U&&Ht(s);let c=s&&s.querySelector("[data-pm-slice]"),h=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let e=+h[3];e>0;e--){let e=s.firstChild;for(;e&&!y(e);)e=e.nextSibling;if(!e)break;s=e}if(!r){let t=e.someProp("clipboardParser")||e.someProp("domParser")||d.DOMParser.fromSchema(e.state.schema);r=t.parseSlice(s,{preserveWhitespace:!(!a&&!h),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||At.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(h)r=_t(Lt(r,+h[1],+h[2]),h[4]);else if(r=d.Slice.maxOpen(Vt(r.content,i),!0),r.openStart||r.openEnd){let e=0,t=0;for(let t=r.content.firstChild;e<r.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=r.content.lastChild;t<r.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);r=Lt(r,e,t)}return e.someProp("transformPasted",t=>{r=t(r,e,a)}),r}const At=/^(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 Vt(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let o,i=t.node(n).contentMatchAt(t.index(n)),s=[];if(e.forEach(e=>{if(!s)return;let t,n=i.findWrapping(e.type);if(!n)return s=null;if(t=s.length&&o.length&&Bt(n,o,e,s[s.length-1],0))s[s.length-1]=t;else{s.length&&(s[s.length-1]=Ft(s[s.length-1],o.length));let t=Rt(e,n);s.push(t),i=i.matchType(t.type),o=n}}),s)return d.Fragment.from(s)}return e}function Rt(e,t,n=0){for(let o=t.length-1;o>=n;o--)e=t[o].create(null,d.Fragment.from(e));return e}function Bt(e,t,n,o,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=Bt(e,t,n,o.lastChild,i+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(i==e.length-1?n.type:e[i+1]))return o.copy(o.content.append(d.Fragment.from(Rt(n,e,i+1))))}}function Ft(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,Ft(e.lastChild,t-1)),o=e.contentMatchAt(e.childCount).fillBefore(d.Fragment.empty,!0);return e.copy(n.append(o))}function zt(e,t,n,o,i,s){let r=t<0?e.firstChild:e.lastChild,l=r.content;return e.childCount>1&&(s=0),i<o-1&&(l=zt(l,t,n,o,i+1,s)),i>=n&&(l=t<0?r.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(r.contentMatchAt(r.childCount).fillBefore(d.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,r.copy(l))}function Lt(e,t,n){return t<e.openStart&&(e=new d.Slice(zt(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new d.Slice(zt(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const It={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function qt(){return document.implementation.createHTMLDocument("title")}let $t=null;function Kt(e){let t=window.trustedTypes;if(!t)return e;if(!$t){if($t=t.defaultPolicy)try{return $t.createHTML(e)}catch(e){}$t=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})}return $t.createHTML(e)}function Wt(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,o=qt(),i=o.body,s=/<([a-z][^>\s]+)/i.exec(e);if((n=s&&It[s[1].toLowerCase()])&&(e=n.map(e=>"<"+e+">").join("")+e+n.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=Kt(e),n)for(let e=0;e<n.length;e++)i=i.querySelector(n[e])||i;for(let e=0;e<o.styleSheets.length;e++){let t=o.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=i.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return i}function Ht(e){let t=e.querySelectorAll(I?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let o=t[n];1==o.childNodes.length&&"\xa0"==o.textContent&&o.parentNode&&o.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),o)}}function _t(e,t){if(!e.size)return e;let n,o=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:s,openEnd:r}=e;for(let e=n.length-2;e>=0;e-=2){let t=o.nodes[n[e]];if(!t||t.hasRequiredAttrs())break;try{i=d.Fragment.from(t.create(n[e+1],i))}catch(e){break}s++,r++}return new d.Slice(i,s,r)}const Ut={},Gt={},jt={touchstart:!0,touchmove:!0};class Yt{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 Xt(e){for(let t in Ut){let n=Ut[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!tn(e,t)||en(e,t)||!e.editable&&t.type in Gt||n(e,t)},jt[t]?{passive:!0}:void 0)}$&&e.dom.addEventListener("input",()=>null),Zt(e)}function Jt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Qt(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Zt(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>en(e,t))})}function en(e,t){return e.someProp("handleDOMEvents",n=>{let o=n[t.type];return!!o&&(o(e,t)||t.defaultPrevented)})}function tn(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}function nn(e,t){en(e,t)||!Ut[t.type]||!e.editable&&t.type in Gt||Ut[t.type](e,t)}function on(e){return{left:e.clientX,top:e.clientY}}function sn(e,t){let n=t.x-e.clientX,o=t.y-e.clientY;return n*n+o*o<100}function rn(e,t,n,o,i){if(-1==o)return!1;let s=e.state.doc.resolve(o);for(let o=s.depth+1;o>0;o--)if(e.someProp(t,t=>o>s.depth?t(e,n,s.nodeAfter,s.before(o),i,!0):t(e,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function ln(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let o=e.state.tr.setSelection(t);o.setMeta("pointer",!0),e.dispatch(o)}function dn(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),o=n.nodeAfter;return!!(o&&o.isAtom&&l.NodeSelection.isSelectable(o))&&(ln(e,new l.NodeSelection(n)),!0)}function an(e,t){if(-1==t)return!1;let n,o,i=e.state.selection;i instanceof l.NodeSelection&&(n=i.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(l.NodeSelection.isSelectable(t)){o=n&&i.$from.depth>0&&e>=i.$from.depth&&s.before(i.$from.depth+1)==i.$from.pos?s.before(i.$from.depth):s.before(e);break}}return null!=o&&(ln(e,l.NodeSelection.create(e.state.doc,o)),!0)}function cn(e,t,n,o,i){return rn(e,"handleClickOn",t,n,o)||e.someProp("handleClick",n=>n(e,t,o))||(i?an(e,n):dn(e,n))}function hn(e,t,n,o){return rn(e,"handleDoubleClickOn",t,n,o)||e.someProp("handleDoubleClick",n=>n(e,t,o))}function fn(e,t,n,o){return rn(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",n=>n(e,t,o))||un(e,n,o)}function un(e,t,n){if(0!=n.button)return!1;let o=pn(e,t,!0),i=e.state.doc;return!!o&&(ln(e,o),o instanceof l.TextSelection&&i.eq(e.state.doc)&&(e.input.mouseDown=new vn(e,o)),!0)}function pn(e,t,n){let o=e.state.doc;if(-1==t)return o.inlineContent?l.TextSelection.create(o,0,o.content.size):null;let i=o.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),s=i.before(e);if(t.inlineContent)return l.TextSelection.create(o,s+1,s+1+t.content.size);if(n&&l.NodeSelection.isSelectable(t))return l.NodeSelection.create(o,s)}return null}function mn(e){return xn(e)}Gt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!wn(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!_||!I||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!K||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",t=>t(e,n))||Tt(e,n)?n.preventDefault():Jt(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,x(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},Gt.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Gt.keypress=(e,t)=>{let n=t;if(wn(e)||!n.charCode||n.ctrlKey&&!n.altKey||W&&n.metaKey)return;if(e.someProp("handleKeyPress",t=>t(e,n)))return void n.preventDefault();let o=e.state.selection;if(!(o instanceof l.TextSelection&&o.$from.sameParent(o.$to))){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();/[\r\n]/.test(t)||e.someProp("handleTextInput",n=>n(e,o.$from.pos,o.$to.pos,t,i))||e.dispatch(i()),n.preventDefault()}};const gn=W?"metaKey":"ctrlKey";Ut.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let o=mn(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&sn(n,e.input.lastClick)&&!n[gn]&&e.input.lastClick.button==n.button&&("singleClick"==e.input.lastClick.type?s="doubleClick":"doubleClick"==e.input.lastClick.type&&(s="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let r=e.posAtCoords(on(n));r&&("singleClick"==s?e.input.mouseDown=new yn(e,r,n,!!o):("doubleClick"==s?hn:fn)(e,r.pos,r.inside,n)?n.preventDefault():Jt(e,"pointer"))};class bn{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){0==e.buttons&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class yn extends bn{constructor(e,t,n,o){let i,s;if(super(e),this.pos=t,this.event=n,this.flushed=o,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[gn],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,s=n.depth?n.before():0}const r=o?null:n.target,d=r?e.docView.nearestDesc(r,!0):null;this.target=d&&y(d.nodeDOM)?d.nodeDOM:null;let{selection:a}=e.state;0==n.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof l.NodeSelection&&a.from<=s&&a.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!z||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()),Jt(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||Ze(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(on(e))),this.updateAllowDefault(e),this.allowDefault||!t?Jt(this.view,"pointer"):cn(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||$&&this.mightDrag&&!this.mightDrag.node.isAtom||I&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ln(this.view,l.Selection.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):Jt(this.view,"pointer")}move(e){this.updateAllowDefault(e),Jt(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}}class vn extends bn{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),Jt(this.view,"pointer");let t=this.view.posAtCoords(on(e)),n=t&&pn(this.view,t.inside,!1);if(!n)return;let{doc:o}=this.view.state,i=this.startSelection,[s,r]=n.from<i.from?[i.to,n.from]:[i.from,n.to];ln(this.view,l.TextSelection.create(o,s,r))}}function wn(e,t){return!!e.composing||!!($&&Math.abs(Date.now()-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Ut.touchstart=e=>{e.input.lastTouch=Date.now(),mn(e),Jt(e,"pointer")},Ut.touchmove=e=>{e.input.lastTouch=Date.now(),Jt(e,"pointer")},Ut.contextmenu=e=>mn(e);const Sn=_?5e3:-1;function Dn(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!y(t)||n>=t.childNodes.length)return!1;let o=t.childNodes[n];return y(o)&&"false"==o.contentEditable}function Nn(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>xn(e),t))}function On(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Cn(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=S(t.focusNode,t.focusOffset),o=D(t.focusNode,t.focusOffset);if(n&&o&&n!=o){let t=o.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||o==i)return i;if(!t||!t.isText(o.nodeValue))return o;if(e.input.compositionNode==o){let e=n.pmViewDesc;if(e&&e.isText(n.nodeValue))return o}}return n||o}function xn(e,t=!1){if(!(_&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),On(e),t||e.docView&&e.docView.dirty){let n=Je(e),o=e.state.selection;return n&&!n.eq(o)?e.dispatch(e.state.tr.setSelection(n)):!e.markCursor&&!t||o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?e.updateState(e.state):e.dispatch(e.state.tr.deleteSelection()),!0}return!1}}function Mn(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 o=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),o.removeAllRanges(),o.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}Gt.compositionstart=Gt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof l.TextSelection&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||I&&H&&Dn(e)))e.markCursor=e.state.storedMarks||n.marks(),xn(e,!0),e.markCursor=null;else if(xn(e,!t.selection.empty),z&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,o=t.focusOffset;n&&y(n)&&0!=o;){let t=o<0?n.lastChild:n.childNodes[o-1];if(!t)break;if(v(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,o=-1}}e.input.composing=!0}Nn(e,Sn)},Gt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Nn(e,20))};const kn=B&&F<15||K&&G<604;function Tn(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}function Pn(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,o=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),o.parentNode&&o.parentNode.removeChild(o),n?En(e,o.value,null,i,t):En(e,o.textContent,o.innerHTML,i,t)},50)}function En(e,t,n,o,i){let s=Et(e,t,n,o,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,s||d.Slice.empty)))return!0;if(!s)return!1;let r=Tn(s),l=r?e.state.tr.replaceSelectionWith(r,o):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function An(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," "):""}Ut.copy=Gt.cut=(e,t)=>{let n=t,o=e.state.selection,i="cut"==n.type;if(o.empty)return;let s=kn?null:n.clipboardData,r=o.content(),{dom:l,text:d}=Pt(e,r);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",d)):Mn(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Gt.paste=(e,t)=>{let n=t;if(e.composing&&!_)return;let o=kn?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;o&&En(e,An(o),o.getData("text/html"),i,n)?n.preventDefault():Pn(e,n)};class Vn{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Rn=W?"altKey":"ctrlKey";function Bn(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t)}),null!=n?!n:!t[Rn]}function Fn(e,t,n){if(!t.dataTransfer)return;let o=e.posAtCoords(on(t));if(!o)return;let i=e.state.doc.resolve(o.pos),s=n&&n.slice;s?e.someProp("transformPasted",t=>{s=t(s,e,!1)}):s=Et(e,An(t.dataTransfer),kn?null:t.dataTransfer.getData("text/html"),!1,i);let r=!(!n||!Bn(e,t));if(e.someProp("handleDrop",n=>n(e,t,s||d.Slice.empty,r)))return void t.preventDefault();if(!s)return;t.preventDefault();let c=s?(0,a.dropPoint)(e.state.doc,i.pos,s):i.pos;null==c&&(c=i.pos);let h=e.state.tr;if(r){let{node:e}=n;e?e.replace(h):h.deleteSelection()}let f=h.mapping.map(c),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,p=h.doc;if(u?h.replaceRangeWith(f,f,s.content.firstChild):h.replaceRange(f,f,s),h.doc.eq(p))return;let m=h.doc.resolve(f);if(u&&l.NodeSelection.isSelectable(s.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(s.content.firstChild))h.setSelection(new l.NodeSelection(m));else{let t=h.mapping.map(c);h.mapping.maps[h.mapping.maps.length-1].forEach((e,n,o,i)=>t=i),h.setSelection(dt(e,m,h.doc.resolve(t)))}e.focus(),e.dispatch(h.setMeta("uiEvent","drop"))}Ut.dragstart=(e,t)=>{let n=t,o=e.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let i,s=e.state.selection,r=s.empty?null:e.posAtCoords(on(n));if(r&&r.pos>=s.from&&r.pos<=(s instanceof l.NodeSelection?s.to-1:s.to));else if(o&&o.mightDrag)i=l.NodeSelection.create(e.state.doc,o.mightDrag.pos);else if(n.target&&y(n.target)){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(i=l.NodeSelection.create(e.state.doc,t.posBefore))}let d=(i||e.state.selection).content(),{dom:a,text:c,slice:h}=Pt(e,d);(!n.dataTransfer.files.length||!I||q>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(kn?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",kn||n.dataTransfer.setData("text/plain",c),e.dragging=new Vn(h,Bn(e,n),i)},Ut.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},Gt.dragover=Gt.dragenter=(e,t)=>t.preventDefault(),Gt.drop=(e,t)=>{try{Fn(e,t,e.dragging)}finally{e.dragging=null}},Ut.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())&&Ze(e)},20))},Ut.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Ut.beforeinput=(e,t)=>{if(_&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,x(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)}};for(let e in Gt)Ut[e]=Gt[e];function zn(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 Ln{constructor(e,t){this.toDOM=e,this.spec=t||Wn,this.side=this.spec.side||0}map(e,t,n,o){let{pos:i,deleted:s}=e.mapResult(t.from+o,this.side<0?-1:1);return s?null:new $n(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Ln&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&zn(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class In{constructor(e,t){this.attrs=e,this.spec=t||Wn}map(e,t,n,o){let i=e.map(t.from+o,this.spec.inclusiveStart?-1:1)-n,s=e.map(t.to+o,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new $n(i,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof In&&zn(this.attrs,e.attrs)&&zn(this.spec,e.spec)}static is(e){return e.type instanceof In}destroy(){}}class qn{constructor(e,t){this.attrs=e,this.spec=t||Wn}map(e,t,n,o){let i=e.mapResult(t.from+o,1);if(i.deleted)return null;let s=e.mapResult(t.to+o,-1);return s.deleted||s.pos<=i.pos?null:new $n(i.pos-n,s.pos-n,this)}valid(e,t){let n,{index:o,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(o)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof qn&&zn(this.attrs,e.attrs)&&zn(this.spec,e.spec)}destroy(){}}class $n{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new $n(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 $n(e,e,new Ln(t,n))}static inline(e,t,n,o){return new $n(e,t,new In(n,o))}static node(e,t,n,o){return new $n(e,t,new qn(n,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof In}get widget(){return this.type instanceof Ln}}const Kn=[],Wn={};class Hn{constructor(e,t){this.local=e.length?e:Kn,this.children=t.length?t:Kn}static create(e,t){return t.length?Qn(t,e,0,Wn):_n}find(e,t,n){let o=[];return this.findInner(null==e?0:e,null==t?1e9:t,o,0,n),o}findInner(e,t,n,o,i){for(let s=0;s<this.local.length;s++){let r=this.local[s];r.from<=t&&r.to>=e&&(!i||i(r.spec))&&n.push(r.copy(r.from+o,r.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let r=this.children[s]+1;this.children[s+2].findInner(e-r,t-r,n,o+r,i)}}map(e,t,n){return this==_n||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Wn)}mapInner(e,t,n,o,i){let s;for(let r=0;r<this.local.length;r++){let l=this.local[r].map(e,n,o);l&&l.type.valid(t,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[r].spec)}return this.children.length?Gn(this.children,s||[],e,t,n,o,i):s?new Hn(s.sort(Zn),Kn):_n}add(e,t){return t.length?this==_n?Hn.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let o,i=0;e.forEach((e,s)=>{let r,l=s+n;if(r=Xn(t,e,l)){for(o||(o=this.children.slice());i<o.length&&o[i]<s;)i+=3;o[i]==s?o[i+2]=o[i+2].addInner(e,r,l+1):o.splice(i,0,s,s+e.nodeSize,Qn(r,e,l+1,Wn)),i+=3}});let s=jn(i?Jn(t):t,-n);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||s.splice(t--,1);return new Hn(s.length?this.local.concat(s).sort(Zn):this.local,o||this.children)}remove(e){return 0==e.length||this==_n?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,o=this.local;for(let o=0;o<n.length;o+=3){let i,s=n[o]+t,r=n[o+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>s&&t.to<r&&(e[n]=null,(i||(i=[])).push(t));if(!i)continue;n==this.children&&(n=this.children.slice());let l=n[o+2].removeInner(i,s+1);l!=_n?n[o+2]=l:(n.splice(o,3),o-=3)}if(o.length)for(let n,i=0;i<e.length;i++)if(n=e[i])for(let e=0;e<o.length;e++)o[e].eq(n,t)&&(o==this.local&&(o=this.local.slice()),o.splice(e--,1));return n==this.children&&o==this.local?this:o.length||n.length?new Hn(o,n):_n}forChild(e,t){if(this==_n)return this;if(t.isLeaf)return Hn.empty;let n,o;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,s=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<s&&t.to>i&&t.type instanceof In){let e=Math.max(i,t.from)-i,n=Math.min(s,t.to)-i;e<n&&(o||(o=[])).push(t.copy(e,n))}}if(o){let e=new Hn(o.sort(Zn),Kn);return n?new Un([e,n]):e}return n||_n}eq(e){if(this==e)return!0;if(!(e instanceof Hn)||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 eo(this.localsInner(e))}localsInner(e){if(this==_n)return Kn;if(e.inlineContent||!this.local.some(In.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof In||t.push(this.local[e]);return t}forEachSet(e){e(this)}}Hn.empty=new Hn([],[]),Hn.removeOverlap=eo;const _n=Hn.empty;class Un{constructor(e){this.members=e}map(e,t){const n=this.members.map(n=>n.map(e,t,Wn));return Un.from(n)}forChild(e,t){if(t.isLeaf)return Hn.empty;let n=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,t);i!=_n&&(i instanceof Un?n=n.concat(i.members):n.push(i))}return Un.from(n)}eq(e){if(!(e instanceof Un)||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 o=0;o<this.members.length;o++){let i=this.members[o].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?eo(n?t:t.sort(Zn)):Kn}static from(e){switch(e.length){case 0:return _n;case 1:return e[0];default:return new Un(e.every(e=>e instanceof Hn)?e:e.reduce((e,t)=>e.concat(t instanceof Hn?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Gn(e,t,n,o,i,s,r){let l=e.slice();for(let e=0,t=s;e<n.maps.length;e++){let o=0;n.maps[e].forEach((e,n,i,s)=>{let r=s-i-(n-e);for(let i=0;i<l.length;i+=3){let s=l[i+1];if(s<0||e>s+t-o)continue;let d=l[i]+t-o;n>=d?l[i+1]=e<=d?-2:-1:e>=t&&r&&(l[i]+=r,l[i+1]+=r)}o+=r}),t=n.maps[e].map(t,-1)}let d=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){d=!0,l[t+1]=-1;continue}let a=n.map(e[t]+s),c=a-i;if(c<0||c>=o.content.size){d=!0;continue}let h=n.map(e[t+1]+s,-1)-i,{index:f,offset:u}=o.content.findIndex(c),p=o.maybeChild(f);if(p&&u==c&&u+p.nodeSize==h){let o=l[t+2].mapInner(n,p,a+1,e[t]+s+1,r);o!=_n?(l[t]=c,l[t+1]=h,l[t+2]=o):(l[t+1]=-2,d=!0)}else d=!0}if(d){let d=Qn(Yn(l,e,t,n,i,s,r),o,0,r);t=d.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<d.children.length;e+=3){let n=d.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,d.children[e],d.children[e+1],d.children[e+2])}}return new Hn(t.sort(Zn),l)}function jn(e,t){if(!t||!e.length)return e;let n=[];for(let o=0;o<e.length;o++){let i=e[o];n.push(new $n(i.from+t,i.to+t,i.type))}return n}function Yn(e,t,n,o,i,s,r){function l(e,t){for(let s=0;s<e.local.length;s++){let l=e.local[s].map(o,i,t);l?n.push(l):r.onRemove&&r.onRemove(e.local[s].spec)}for(let n=0;n<e.children.length;n+=3)l(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)-1==e[n+1]&&l(e[n+2],t[n]+s+1);return n}function Xn(e,t,n){if(t.isLeaf)return null;let o=n+t.nodeSize,i=null;for(let t,s=0;s<e.length;s++)(t=e[s])&&t.from>n&&t.to<o&&((i||(i=[])).push(t),e[s]=null);return i}function Jn(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Qn(e,t,n,o){let i=[],s=!1;t.forEach((t,r)=>{let l=Xn(e,t,r+n);if(l){s=!0;let e=Qn(l,t,n+r+1,o);e!=_n&&i.push(r,r+t.nodeSize,e)}});let r=jn(s?Jn(e):e,-n).sort(Zn);for(let e=0;e<r.length;e++)r[e].type.valid(t,r[e])||(o.onRemove&&o.onRemove(r[e].spec),r.splice(e--,1));return r.length||i.length?new Hn(r,i):_n}function Zn(e,t){return e.from-t.from||e.to-t.to}function eo(e){let t=e;for(let n=0;n<t.length-1;n++){let o=t[n];if(o.from!=o.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from!=o.from){s.from<o.to&&(t==e&&(t=e.slice()),t[n]=o.copy(o.from,s.from),to(t,i,o.copy(s.from,o.to)));break}s.to!=o.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,o.to),to(t,i+1,s.copy(o.to,s.to)))}}return t}function to(e,t,n){for(;t<e.length&&Zn(n,e[t])>0;)t++;e.splice(t,0,n)}function no(e){let t=[];return e.someProp("decorations",n=>{let o=n(e.state);o&&o!=_n&&t.push(o)}),e.cursorWrapper&&t.push(Hn.create(e.state.doc,[e.cursorWrapper.deco])),Un.from(t)}const oo={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},io=B&&F<=11;class so{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 ro{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new so,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]);B&&F<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():$&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),io&&(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,oo)),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(at(this.view)){if(this.suppressingSelectionUpdates)return Ze(this.view);if(B&&F<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&p(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,n=new Set;for(let t=e.focusNode;t;t=h(t))n.add(t);for(let o=e.anchorNode;o;o=h(o))if(n.has(o)){t=o;break}let o=t&&this.view.docView.nearestDesc(t);return o&&o.ignoreMutation({type:"selection",target:v(t)?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&at(e)&&!this.ignoreSelectionChange(n),i=-1,s=-1,r=!1,d=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],d);n&&(i=i<0?n.from:Math.min(n.from,i),s=s<0?n.to:Math.max(n.to,s),n.typeOver&&(r=!0))}if(d.some(e=>"BR"==e.nodeName)&&(8==e.input.lastKeyCode||46==e.input.lastKeyCode||I&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>"childList"==e.type&&e.removedNodes.length))){for(let e of d)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&y(t);){if("false"==t.contentEditable){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(z&&d.length){let t=d.filter(e=>"BR"==e.nodeName);if(2==t.length){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let o of t){let t=o.parentNode;!t||"LI"!=t.nodeName||n&&uo(e,n)==t||o.remove()}}}let a=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&C(n)&&(a=Je(e))&&a.eq(l.Selection.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Ze(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),co(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,po(e,d)),this.handleDOMChange(i,s,r,d),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Ze(e),this.currentSelection.set(n))}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")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let o=e.addedNodes[n];t.push(o),v(o)&&(this.lastChangedTextNode=o)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let o=e.previousSibling,i=e.nextSibling;if(B&&F<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:s}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(o=n),(!s||Array.prototype.indexOf.call(e.addedNodes,s)<0)&&(i=s)}let s=o&&o.parentNode==e.target?c(o)+1:0,r=n.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?c(i):e.target.childNodes.length;return{from:r,to:n.localPosFromDOM(e.target,l,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 lo=new WeakMap,ao=!1;function co(e){if(!lo.has(e)&&(lo.set(e,null),-1!==['normal','nowrap','pre-line'].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=z,ao)return;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."),ao=!0}}function ho(e,t){let n=t.startContainer,o=t.startOffset,i=t.endContainer,s=t.endOffset,r=e.domAtPos(e.state.selection.anchor);return p(r.node,r.offset,i,s)&&([n,o,i,s]=[i,s,n,o]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}function fo(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ho(e,n)}let n;function o(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",o,!0),n?ho(e,n):null}function uo(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}function po(e,t){var n;let{focusNode:o,focusOffset:i}=e.domSelectionRange();for(let s of t)if("TR"==(null===(n=s.parentNode)||void 0===n?void 0:n.nodeName)){let t=s.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||!y(e)||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(s,n.firstChild),o==s&&e.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function mo(e,t,n,o){let i,{node:s,fromOffset:r,toOffset:l,from:a,to:c}=e.docView.parseRange(t,n),h=e.domSelectionRange(),f=h.anchorNode;if(f&&w(e.dom,f)&&(i=[{node:f,offset:h.anchorOffset}],C(h)||i.push({node:h.focusNode,offset:h.focusOffset})),I&&8===e.input.lastKeyCode)for(let e=l;e>r;e--){let t=s.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){l=e;break}if(!n||n.size)break}let u=e.state.doc,p=e.someProp("domParser")||d.DOMParser.fromSchema(e.state.schema),m=u.resolve(a),g=null,b=p.parse(s,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:r,to:l,preserveWhitespace:"pre"!=m.parent.type.whitespace||"full",findPositions:i,ruleFromNode:go(o),context:m});if(i&&null!=i[0].pos){let e=i[0].pos,t=i[1]&&i[1].pos;null==t&&(t=e),g={anchor:e+a,head:t+a}}return{doc:b,sel:g,from:a,to:c}}const go=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if("BR"==t.nodeName&&t.parentNode){if($&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(t.parentNode.lastChild==t||$&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},bo=/^(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 yo(e,t,n,o,i){let s=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=Je(e,t);if(n&&!e.state.selection.eq(n)){if(I&&_&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,x(13,"Enter"))))return;let o=e.state.tr.setSelection(n);"pointer"==t?o.setMeta("pointer",!0):"key"==t&&o.scrollIntoView(),s&&o.setMeta("composition",s),e.dispatch(o)}return}let r=e.state.doc.resolve(t),d=r.sharedDepth(n);t=r.before(d+1),n=e.state.doc.resolve(n).after(d+1);let a,c,h=e.state.selection,f=mo(e,t,n,i),u=e.state.doc,p=u.slice(f.from,f.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(a=e.state.selection.to,c="end"):(a=e.state.selection.from,c="start"),e.input.lastKeyCode=null;let m=Oo(p.content,f.doc.content,f.from,a,c);if(m&&e.input.domChangeCount++,(K&&e.input.lastIOSEnter>Date.now()-225||_)&&i.some(e=>y(e)&&!bo.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp("handleKeyDown",t=>t(e,x(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(!m){if(!(o&&h instanceof l.TextSelection&&!h.empty&&h.$head.sameParent(h.$anchor))||e.composing||f.sel&&f.sel.anchor!=f.sel.head){if(f.sel){let t=vo(e,e.state.doc,f.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);s&&n.setMeta("composition",s),e.dispatch(n)}}return}m={start:h.from,endA:h.to,endB:h.to}}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof l.TextSelection&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=f.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),B&&F<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>f.from&&" \xa0"==f.doc.textBetween(m.start-f.from-1,m.start-f.from+1)&&(m.start--,m.endA--,m.endB--);let g=f.doc.resolveNoCache(m.start-f.from),b=f.doc.resolveNoCache(m.endB-f.from),v=u.resolve(m.start),w=g.sameParent(b)&&g.parent.inlineContent&&v.end()>=m.endA;if((K&&e.input.lastIOSEnter>Date.now()-225&&(!w||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!w&&Do(f.doc,g.pos,b.pos))&&e.someProp("handleKeyDown",t=>t(e,x(13,"Enter"))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>m.start&&So(u,m.start,m.endA,g,b)&&e.someProp("handleKeyDown",t=>t(e,x(8,"Backspace"))))return void(_&&I&&e.domObserver.suppressSelectionUpdates());I&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),_&&!w&&g.start()!=b.start()&&0==b.parentOffset&&g.depth==b.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==m.endA&&(m.endB-=2,b=f.doc.resolveNoCache(m.endB-f.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,x(13,"Enter"))})},20));let S,D=m.start,N=m.endA,O=t=>{let n=t||e.state.tr.replace(D,N,f.doc.slice(m.start-f.from,m.endB-f.from));if(f.sel){let t=vo(e,n.doc,f.sel);t&&!(I&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==D||t.head==n.mapping.map(N)-1)||B&&t.empty&&t.head==D)&&n.setSelection(t)}return s&&n.setMeta("composition",s),n.scrollIntoView()};if(w)if(g.pos==b.pos){B&&F<=11&&0==g.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ze(e),20));let t=O(e.state.tr.delete(D,N)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=wo(g.parent.content.cut(g.parentOffset,b.parentOffset),v.parent.content.cut(v.parentOffset,m.endA-v.start())))){let t=O(e.state.tr);"add"==S.type?t.addMark(D,N,S.mark):t.removeMark(D,N,S.mark),e.dispatch(t)}else if(g.parent.child(g.index()).isText&&g.index()==b.index()-(b.textOffset?0:1)){let t=g.parent.textBetween(g.parentOffset,b.parentOffset),n=()=>O(e.state.tr.insertText(t,D,N));e.someProp("handleTextInput",o=>o(e,D,N,t,n))||e.dispatch(n())}else e.dispatch(O());else e.dispatch(O())}function vo(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:dt(e,t.resolve(n.anchor),t.resolve(n.head))}function wo(e,t){let n,o,i,s=e.firstChild.marks,r=t.firstChild.marks,l=s,a=r;for(let e=0;e<r.length;e++)l=r[e].removeFromSet(l);for(let e=0;e<s.length;e++)a=s[e].removeFromSet(a);if(1==l.length&&0==a.length)o=l[0],n="add",i=e=>e.mark(o.addToSet(e.marks));else{if(0!=l.length||1!=a.length)return null;o=a[0],n="remove",i=e=>e.mark(o.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(i(t.child(e)));if(d.Fragment.from(c).eq(e))return{mark:o,type:n}}function So(e,t,n,o,i){if(n-t<=i.pos-o.pos||No(o,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!o.parent.isTextblock){let e=s.nodeAfter;return null!=e&&n==t+e.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let r=e.resolve(No(s,!0,!0));return!(!r.parent.isTextblock||r.pos>n||No(r,!0,!1)<n)&&o.parent.content.cut(o.parentOffset).eq(r.parent.content)}function Do(e,t,n){let o=0,i=0;return e.nodesBetween(t,n,(e,s)=>{e.isTextblock&&s>=t&&s<n?o++:(e.isText?/\S/.test(e.text.slice(Math.max(0,t-s),Math.min(e.nodeSize,n-s))):e.isLeaf)&&i++}),0==i&&1==o}function No(e,t,n){let o=e.depth,i=t?e.end():e.pos;for(;o>0&&(t||e.indexAfter(o)==e.node(o).childCount);)o--,i++,t=!1;if(n){let t=e.node(o).maybeChild(e.indexAfter(o));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Oo(e,t,n,o,i){let s=e.findDiffStart(t,n),r=n+e.size,l=n+t.size;if(null==s)return null;let{a:d,b:a}=e.findDiffEnd(t,r,l);if("end"==i){o-=d+Math.max(0,s-Math.min(d,a))-s}if(d<s&&r<l){s-=o<=s&&o>=d?s-o:0,a=s+(a-d),d=s}else if(a<s){s-=o<=s&&o>=a?s-o:0,d=s+(d-a),a=s}return{start:s,endA:d,endB:a}}const Co=Et,xo=xn;class Mo{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 Yt,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ro),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=Po(this),To(this),this.nodeViews=Ao(this),this.docView=Ee(this.state.doc,ko(this),no(this),this.dom,this),this.domObserver=new ro(this,(e,t,n,o)=>yo(this,e,t,n,o)),this.domObserver.start(),Xt(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Zt(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ro),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(On(this),s=!0),this.state=e;let r=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(r||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ao(this);Vo(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(r||t.handleDOMEvents!=this._props.handleDOMEvents)&&Zt(this),this.editable=Po(this),To(this);let l=no(this),d=ko(this),a=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",c=i||!this.docView.matchesNode(e.doc,d,l);!c&&e.selection.eq(o.selection)||(s=!0);let h="preserve"==a&&s&&null==this.dom.style.overflowAnchor&&Q(this);if(s){this.domObserver.stop();let t=c&&(B||I)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&Eo(o.selection,e.selection);if(c){let n=I?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Cn(this)),!i&&this.docView.update(e.doc,d,l,this)||(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=Ee(e.doc,d,l,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}let n=this.input.mouseDown;t||!(n&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ht(this)&&n.delaySelUpdate())?Ze(this,t):(rt(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==a?this.dom.scrollTop=0:"to selection"==a?this.scrollToSelection():h&&ee(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&w(this.dom,e))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof l.NodeSelection){let t=this.docView.domAfterPos(this.state.selection.from);y(t)&&J(this,t.getBoundingClientRect(),e)}else J(this,this.coordsAtPos(this.state.selection.head,1),e);else;}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,o=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)o=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&&(o=e)}this.dragging=new Vn(e.slice,e.move,o<0?void 0:l.NodeSelection.create(this.state.doc,o))}someProp(e,t){let n,o=this._props&&this._props[e];if(null!=o&&(n=t?t(o):o))return n;for(let o=0;o<this.directPlugins.length;o++){let i=this.directPlugins[o].props[e];if(null!=i&&(n=t?t(i):i))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let s=i[o].props[e];if(null!=s&&(n=t?t(s):s))return n}}hasFocus(){if(B){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&&oe(this.dom),Ze(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 he(this,e)}coordsAtPos(e,t=1){return me(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 o=this.docView.posFromDOM(e,t,n);if(null==o)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,t){return Ce(this,t||this.state,e)}pasteHTML(e,t){return En(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return En(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return Pt(this,e)}destroy(){this.docView&&(Qt(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],no(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,f=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return nn(this,e)}domSelectionRange(){let e=!1!==this.dom.isConnected&&this.domSelection();return e?$&&11===this.root.nodeType&&M(this.dom.ownerDocument)==this.dom&&fo(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function ko(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"),[$n.node(0,e.state.doc.content.size,t)]}function To(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:$n.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Po(e){return!e.someProp("editable",t=>!1===t(e.state))}function Eo(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Ao(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 Vo(e,t){let n=0,o=0;for(let o in e){if(e[o]!=t[o])return!0;n++}for(let e in t)o++;return n!=o}function Ro(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}Mo.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},2627,[2616,2614,2613]);
166
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2628,[2629]);
167
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"history",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"historyKeymap",{enumerable:!0,get:function(){return p}}),Object.defineProperty(e,"historyProviderConfig",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"historyProviderPlugin",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"redoCommand",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"undoCommand",{enumerable:!0,get:function(){return s}});var t=r(d[0]),o=r(d[1]),n=r(d[2]);function u(t,o){return Object.assign(t,{meta:{package:"@milkdown/plugin-history",...o}}),t}var s=(0,n.$command)("Undo",()=>()=>o.undo);u(s,{displayName:"Command<undo>"});var y=(0,n.$command)("Redo",()=>()=>o.redo);u(y,{displayName:"Command<redo>"});var c=(0,n.$ctx)({},"historyProviderConfig");u(c,{displayName:"Ctx<historyProviderConfig>"});var l=(0,n.$prose)(t=>(0,o.history)(t.get(c.key)));u(l,{displayName:"Ctx<historyProviderPlugin>"});var p=(0,n.$useKeymap)("historyKeymap",{Undo:{shortcuts:"Mod-z",command:o=>{const n=o.get(t.commandsCtx);return()=>n.call(s.key)}},Redo:{shortcuts:["Mod-y","Shift-Mod-z"],command:o=>{const n=o.get(t.commandsCtx);return()=>n.call(y.key)}}});u(p.ctx,{displayName:"KeymapCtx<history>"}),u(p.shortcuts,{displayName:"Keymap<history>"});var f=[c,l,p,s,y].flat()},2629,[2465,2630,2633]);
168
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2630,[2631]);
169
+ __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"closeHistory",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"history",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"isHistoryTransaction",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"redo",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"redoDepth",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"redoNoScroll",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"undo",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"undoDepth",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"undoNoScroll",{enumerable:!0,get:function(){return D}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},i=r(d[1]),s=r(d[2]);class o{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,i,s=this.items.length;for(;;s--){if(this.items.get(s-1).selection){--s;break}}t&&(n=this.remapping(s,this.items.length),i=n.maps.length);let p,u,h=e.tr,c=[],f=[];return this.items.forEach((e,t)=>{if(!e.step)return n||(n=this.remapping(s,t+1),i=n.maps.length),i--,void f.push(e);if(n){f.push(new l(e.map));let t,s=e.step.map(n.slice(i));s&&h.maybeStep(s).doc&&(t=h.mapping.maps[h.mapping.maps.length-1],c.push(new l(t,void 0,void 0,c.length+f.length))),i--,t&&n.appendMap(t,i)}else h.maybeStep(e.step);return e.selection?(p=n?e.selection.map(n.slice(i)):e.selection,u=new o(this.items.slice(0,s).append(f.reverse().concat(c)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:u,transform:h,selection:p}}addTransform(e,t,n,i){let s=[],u=this.eventCount,c=this.items,f=!i&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let o,p=e.steps[n].invert(e.docs[n]),h=new l(e.mapping.maps[n],p,t);(o=f&&f.merge(h))&&(h=o,n?s.pop():c=c.slice(0,c.length-1)),s.push(h),t&&(u++,t=void 0),i||(f=h)}let v=u-n.depth;return v>h&&(c=p(c,v),u-=v),new o(c.append(s),u)}remapping(e,t){let n=new i.Mapping;return this.items.forEach((t,i)=>{let s=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,s)},e,t),n}addMaps(e){return 0==this.eventCount?this:new o(this.items.append(e.map(e=>new l(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;t=Math.min(this.items.length,t);let n=[],i=this.items.length-t,s=e.mapping,p=e.steps.length,u=this.eventCount;this.items.forEach(e=>{e.selection&&u--},i);let h=t;this.items.forEach(t=>{let i=s.getMirror(--h);if(null==i)return;p=Math.min(p,i);let o=s.maps[i];if(t.step){let p=e.steps[i].invert(e.docs[i]),c=t.selection&&t.selection.map(s.slice(h+1,i));c&&u++,n.push(new l(o,p,c))}else n.push(new l(o))},i);let c=[];for(let e=t;e<p;e++)c.push(new l(s.maps[e]));let f=this.items.slice(0,i).append(c).append(n),v=new o(f,u);return v.emptyItemCount()>500&&(v=v.compress(this.items.length-n.length)),v}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),i=t.maps.length,s=[],p=0;return this.items.forEach((n,o)=>{if(o>=e)s.push(n),n.selection&&p++;else if(n.step){let e=n.step.map(t.slice(i)),o=e&&e.getMap();if(i--,o&&t.appendMap(o,i),e){let u=n.selection&&n.selection.map(t.slice(i));u&&p++;let h,c=new l(o.invert(),e,u),f=s.length-1;(h=s.length&&s[f].merge(c))?s[f]=h:s.push(c)}}else n.map&&i--},this.items.length,0),new o(n.default.from(s.reverse()),p)}}function p(e,t){let n;return e.forEach((e,i)=>{if(e.selection&&0==t--)return n=i,!1}),e.slice(n)}o.empty=new o(n.default.empty,0);class l{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new l(t.getMap().invert(),t,this.selection)}}}class u{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const h=20;function c(e,t,n,i){let s,p=n.getMeta(O);if(p)return p.historyState;n.getMeta(P)&&(e=new u(e.done,e.undone,null,0,-1));let l=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(l&&l.getMeta(O))return l.getMeta(O).redo?new u(e.done.addTransform(n,void 0,i,C(t)),e.undone,v(n.mapping.maps),e.prevTime,e.prevComposition):new u(e.done,e.undone.addTransform(n,void 0,i,C(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||l&&!1===l.getMeta("addToHistory"))return(s=n.getMeta("rebased"))?new u(e.done.rebased(n,s),e.undone.rebased(n,s),y(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new u(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),y(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let s=n.getMeta("composition"),p=0==e.prevTime||!l&&e.prevComposition!=s&&(e.prevTime<(n.time||0)-i.newGroupDelay||!f(n,e.prevRanges)),h=l?y(e.prevRanges,n.mapping):v(n.mapping.maps);return new u(e.done.addTransform(n,p?t.selection.getBookmark():void 0,i,C(t)),o.empty,h,n.time,null==s?e.prevComposition:s)}}function f(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,i)=>{for(let s=0;s<t.length;s+=2)e<=t[s+1]&&i>=t[s]&&(n=!0)}),n}function v(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,i,s)=>t.push(i,s));return t}function y(e,t){if(!e)return null;let n=[];for(let i=0;i<e.length;i+=2){let s=t.map(e[i],1),o=t.map(e[i+1],-1);s<=o&&n.push(s,o)}return n}function w(e,t,n){let i=C(t),s=O.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,i);if(!o)return null;let p=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),s,i),h=new u(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(p).setMeta(O,{redo:n,historyState:h})}let b=!1,M=null;function C(e){let t=e.plugins;if(M!=t){b=!1,M=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){b=!0;break}}return b}function T(e){return e.setMeta(P,!0)}const O=new s.PluginKey("history"),P=new s.PluginKey("closeHistory");function E(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new s.Plugin({key:O,state:{init:()=>new u(o.empty,o.empty,null,0,-1),apply:(t,n,i)=>c(n,i,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,i="historyUndo"==n?S:"historyRedo"==n?k:null;return!(!i||!e.editable)&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function j(e,t){return(n,i)=>{let s=O.getState(n);if(!s||0==(e?s.undone:s.done).eventCount)return!1;if(i){let o=w(s,n,e);o&&i(t?o.scrollIntoView():o)}return!0}}const S=j(!1,!0),k=j(!0,!0),D=j(!1,!1),R=j(!0,!1);function _(e){let t=O.getState(e);return t?t.done.eventCount:0}function H(e){let t=O.getState(e);return t?t.undone.eventCount:0}function I(e){return null!=e.getMeta(O)}},2631,[2632,2613,2616]);
170
+ __d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=200,n=function(){};n.prototype.append=function(i){return i.length?(i=n.from(i),!this.length&&i||i.length<t&&this.leafAppend(i)||this.length<t&&i.leafPrepend(this)||this.appendInner(i)):this},n.prototype.prepend=function(t){return t.length?n.from(t).append(this):this},n.prototype.appendInner=function(t){return new h(this,t)},n.prototype.slice=function(t,i){return void 0===t&&(t=0),void 0===i&&(i=this.length),t>=i?n.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,i))},n.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},n.prototype.forEach=function(t,n,i){void 0===n&&(n=0),void 0===i&&(i=this.length),n<=i?this.forEachInner(t,n,i,0):this.forEachInvertedInner(t,n,i,0)},n.prototype.map=function(t,n,i){void 0===n&&(n=0),void 0===i&&(i=this.length);var h=[];return this.forEach(function(n,i){return h.push(t(n,i))},n,i),h},n.from=function(t){return t instanceof n?t:t&&t.length?new i(t):n.empty};var i=(function(n){function i(t){n.call(this),this.values=t}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var h={length:{configurable:!0},depth:{configurable:!0}};return i.prototype.flatten=function(){return this.values},i.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new i(this.values.slice(t,n))},i.prototype.getInner=function(t){return this.values[t]},i.prototype.forEachInner=function(t,n,i,h){for(var o=n;o<i;o++)if(!1===t(this.values[o],h+o))return!1},i.prototype.forEachInvertedInner=function(t,n,i,h){for(var o=n-1;o>=i;o--)if(!1===t(this.values[o],h+o))return!1},i.prototype.leafAppend=function(n){if(this.length+n.length<=t)return new i(this.values.concat(n.flatten()))},i.prototype.leafPrepend=function(n){if(this.length+n.length<=t)return new i(n.flatten().concat(this.values))},h.length.get=function(){return this.values.length},h.depth.get=function(){return 0},Object.defineProperties(i.prototype,h),i})(n);n.empty=new i([]);var h=(function(t){function n(n,i){t.call(this),this.left=n,this.right=i,this.length=n.length+i.length,this.depth=Math.max(n.depth,i.depth)+1}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},n.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},n.prototype.forEachInner=function(t,n,i,h){var o=this.left.length;return!(n<o&&!1===this.left.forEachInner(t,n,Math.min(i,o),h))&&(!(i>o&&!1===this.right.forEachInner(t,Math.max(n-o,0),Math.min(this.length,i)-o,h+o))&&void 0)},n.prototype.forEachInvertedInner=function(t,n,i,h){var o=this.left.length;return!(n>o&&!1===this.right.forEachInvertedInner(t,n-o,Math.max(i,o)-o,h+o))&&(!(i<o&&!1===this.left.forEachInvertedInner(t,Math.min(n,o),i,h))&&void 0)},n.prototype.sliceInner=function(t,n){if(0==t&&n==this.length)return this;var i=this.left.length;return n<=i?this.left.slice(t,n):t>=i?this.right.slice(t-i,n-i):this.left.slice(t,i).append(this.right.slice(0,n-i))},n.prototype.leafAppend=function(t){var i=this.right.leafAppend(t);if(i)return new n(this.left,i)},n.prototype.leafPrepend=function(t){var i=this.left.leafPrepend(t);if(i)return new n(i,this.right)},n.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new n(this.left,new n(this.right,t)):new n(this,t)},n})(n),o=n},2632,[]);
171
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"$command",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"$commandAsync",{enumerable:!0,get:function(){return x}}),Object.defineProperty(e,"$ctx",{enumerable:!0,get:function(){return M}}),Object.defineProperty(e,"$inputRule",{enumerable:!0,get:function(){return C}}),Object.defineProperty(e,"$inputRuleAsync",{enumerable:!0,get:function(){return w}}),Object.defineProperty(e,"$mark",{enumerable:!0,get:function(){return P}}),Object.defineProperty(e,"$markAsync",{enumerable:!0,get:function(){return j}}),Object.defineProperty(e,"$markAttr",{enumerable:!0,get:function(){return E}}),Object.defineProperty(e,"$markSchema",{enumerable:!0,get:function(){return N}}),Object.defineProperty(e,"$node",{enumerable:!0,get:function(){return k}}),Object.defineProperty(e,"$nodeAsync",{enumerable:!0,get:function(){return S}}),Object.defineProperty(e,"$nodeAttr",{enumerable:!0,get:function(){return K}}),Object.defineProperty(e,"$nodeSchema",{enumerable:!0,get:function(){return z}}),Object.defineProperty(e,"$pasteRule",{enumerable:!0,get:function(){return h}}),Object.defineProperty(e,"$pasteRuleAsync",{enumerable:!0,get:function(){return O}}),Object.defineProperty(e,"$prose",{enumerable:!0,get:function(){return R}}),Object.defineProperty(e,"$proseAsync",{enumerable:!0,get:function(){return $}}),Object.defineProperty(e,"$remark",{enumerable:!0,get:function(){return D}}),Object.defineProperty(e,"$shortcut",{enumerable:!0,get:function(){return T}}),Object.defineProperty(e,"$shortcutAsync",{enumerable:!0,get:function(){return V}}),Object.defineProperty(e,"$useKeymap",{enumerable:!0,get:function(){return I}}),Object.defineProperty(e,"$view",{enumerable:!0,get:function(){return v}}),Object.defineProperty(e,"$viewAsync",{enumerable:!0,get:function(){return A}}),Object.defineProperty(e,"addTimer",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"callCommand",{enumerable:!0,get:function(){return F}}),Object.defineProperty(e,"forceUpdate",{enumerable:!0,get:function(){return _}}),Object.defineProperty(e,"getHTML",{enumerable:!0,get:function(){return H}}),Object.defineProperty(e,"getMarkdown",{enumerable:!0,get:function(){return L}}),Object.defineProperty(e,"insert",{enumerable:!0,get:function(){return B}}),Object.defineProperty(e,"insertPos",{enumerable:!0,get:function(){return J}}),Object.defineProperty(e,"markdownToSlice",{enumerable:!0,get:function(){return G}}),Object.defineProperty(e,"nanoid",{enumerable:!0,get:function(){return f}}),Object.defineProperty(e,"outline",{enumerable:!0,get:function(){return U}}),Object.defineProperty(e,"pipe",{enumerable:!0,get:function(){return X}}),Object.defineProperty(e,"replaceAll",{enumerable:!0,get:function(){return W}}),Object.defineProperty(e,"replaceRange",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,"setAttr",{enumerable:!0,get:function(){return q}}),Object.defineProperty(e,"upsertById",{enumerable:!0,get:function(){return l}});var t=r(d[0]),n=r(d[1]),c=r(d[2]),o=r(d[3]),u=r(d[4]),s=r(d[5]),p=r(d[6]),f=(0,c.customAlphabet)("abcedfghicklmn",10);function l(t,n,c){const o=t.findIndex(([t])=>t===n);if(-1===o)return[...t,c];const u=t.slice();return u[o]=c,u}function y(t,c,o){const u=(0,n.createTimer)(o||f());let s=!1;const p=n=>(n.record(u),n.update(c,t=>t.concat(u)),async()=>{const o=await t(n,p,()=>{n.done(u),s=!0});return s||n.done(u),()=>{if(n.update(c,t=>t.filter(t=>t!==u)),n.clearTimer(u),o){const t=o();t&&"then"in t&&t.catch(console.error)}}});return p.timer=u,p}function b(n,c){const o=(0,t.createCmdKey)(n),u=s=>async()=>{u.key=o,await s.wait(t.CommandsReady);const p=c(s);return s.get(t.commandsCtx).create(o,p),u.run=c=>s.get(t.commandsCtx).call(n,c),()=>{s.get(t.commandsCtx).remove(o)}};return u}function x(n,c,o){const u=(0,t.createCmdKey)(n);return y(async(o,s)=>{await o.wait(t.CommandsReady);const p=await c(o);return o.get(t.commandsCtx).create(u,p),s.run=c=>o.get(t.commandsCtx).call(n,c),s.key=u,()=>{o.get(t.commandsCtx).remove(u)}},t.commandsTimerCtx,o)}function C(n){const c=o=>async()=>{await o.wait(t.SchemaReady);const u=n(o);return o.update(t.inputRulesCtx,t=>[...t,u]),c.inputRule=u,()=>{o.update(t.inputRulesCtx,t=>t.filter(t=>t!==u))}};return c}function w(n,c){return y(async(c,o)=>{await c.wait(t.SchemaReady);const u=await n(c);return c.update(t.inputRulesCtx,t=>[...t,u]),o.inputRule=u,()=>{c.update(t.inputRulesCtx,t=>t.filter(t=>t!==u))}},t.editorStateTimerCtx,c)}function h(n){const c=o=>async()=>{await o.wait(t.SchemaReady);const u=n(o);return o.update(t.pasteRulesCtx,t=>[...t,u]),c.pasteRule=u,()=>{o.update(t.pasteRulesCtx,t=>t.filter(t=>t!==u))}};return c}function O(n,c){return y(async(c,o)=>{await c.wait(t.SchemaReady);const u=await n(c);return c.update(t.pasteRulesCtx,t=>[...t,u]),o.pasteRule=u,()=>{c.update(t.pasteRulesCtx,t=>t.filter(t=>t!==u))}},t.pasteRulesTimerCtx,c)}function P(n,c){const u=o=>async()=>{const s=c(o);return o.update(t.marksCtx,t=>l(t,n,[n,s])),u.id=n,u.schema=s,()=>{o.update(t.marksCtx,t=>t.filter(([t])=>t!==n))}};return u.type=c=>{const u=c.get(t.schemaCtx).marks[n];if(!u)throw(0,o.missingMarkInSchema)(n);return u},u}function j(n,c,u){const s=y(async(o,u,s)=>{const p=await c(o);return o.update(t.marksCtx,t=>l(t,n,[n,p])),u.id=n,u.schema=p,s(),()=>{o.update(t.marksCtx,t=>t.filter(([t])=>t!==n))}},t.schemaTimerCtx,u);return s.type=c=>{const u=c.get(t.schemaCtx).marks[n];if(!u)throw(0,o.missingMarkInSchema)(n);return u},s}function k(n,c){const u=o=>async()=>{const s=c(o);return o.update(t.nodesCtx,t=>l(t,n,[n,s])),u.id=n,u.schema=s,()=>{o.update(t.nodesCtx,t=>t.filter(([t])=>t!==n))}};return u.type=c=>{const u=c.get(t.schemaCtx).nodes[n];if(!u)throw(0,o.missingNodeInSchema)(n);return u},u}function S(n,c,u){const s=y(async(o,u,s)=>{const p=await c(o);return o.update(t.nodesCtx,t=>l(t,n,[n,p])),u.id=n,u.schema=p,s(),()=>{o.update(t.nodesCtx,t=>t.filter(([t])=>t!==n))}},t.schemaTimerCtx,u);return s.type=c=>{const u=c.get(t.schemaCtx).nodes[n];if(!u)throw(0,o.missingNodeInSchema)(n);return u},s}function R(n){let c;const o=o=>async()=>(await o.wait(t.SchemaReady),c=n(o),o.update(t.prosePluginsCtx,t=>[...t,c]),()=>{o.update(t.prosePluginsCtx,t=>t.filter(t=>t!==c))});return o.plugin=()=>c,o.key=()=>c.spec.key,o}function $(n,c){let o;const u=y(async c=>(await c.wait(t.SchemaReady),o=await n(c),c.update(t.prosePluginsCtx,t=>[...t,o]),()=>{c.update(t.prosePluginsCtx,t=>t.filter(t=>t!==o))}),t.editorStateTimerCtx,c);return u.plugin=()=>o,u.key=()=>o.spec.key,u}function T(n){const c=o=>async()=>{await o.wait(t.KeymapReady);const u=o.get(t.keymapCtx),s=n(o),p=u.addObjectKeymap(s);return c.keymap=s,()=>{p()}};return c}function V(n,c){return y(async(c,o)=>{await c.wait(t.KeymapReady);const u=c.get(t.keymapCtx),s=await n(c),p=u.addObjectKeymap(s);return o.keymap=s,()=>{p()}},t.editorStateTimerCtx,c)}function v(n,c){const o=s=>async()=>{await s.wait(t.SchemaReady);const p=c(s);return n.type(s)instanceof u.NodeType?s.update(t.nodeViewCtx,t=>[...t,[n.id,p]]):s.update(t.markViewCtx,t=>[...t,[n.id,p]]),o.view=p,o.type=n,()=>{n.type(s)instanceof u.NodeType?s.update(t.nodeViewCtx,t=>t.filter(t=>t[0]!==n.id)):s.update(t.markViewCtx,t=>t.filter(t=>t[0]!==n.id))}};return o}function A(n,c,o){return y(async(o,s)=>{await o.wait(t.SchemaReady);const p=await c(o);return n.type(o)instanceof u.NodeType?o.update(t.nodeViewCtx,t=>[...t,[n.id,p]]):o.update(t.markViewCtx,t=>[...t,[n.id,p]]),s.view=p,s.type=n,()=>{n.type(o)instanceof u.NodeType?o.update(t.nodeViewCtx,t=>t.filter(t=>t[0]!==n.id)):o.update(t.markViewCtx,t=>t.filter(t=>t[0]!==n.id))}},t.editorViewTimerCtx,o)}function M(t,c){const o=(0,n.createSlice)(t,c),u=t=>(t.inject(o),()=>()=>{t.remove(o)});return u.key=o,u}function z(t,n){const c=M(n,t),o=k(t,t=>t.get(c.key)(t)),u=[c,o];return u.id=o.id,u.node=o,u.type=t=>o.type(t),u.ctx=c,u.key=c.key,u.extendSchema=c=>z(t,c(n)),u}function N(t,n){const c=M(n,t),o=P(t,t=>t.get(c.key)(t)),u=[c,o];return u.id=o.id,u.mark=o,u.type=t=>o.type(t),u.ctx=c,u.key=c.key,u.extendSchema=c=>N(t,c(n)),u}function I(t,n){const c=M(Object.fromEntries(Object.entries(n).map(([t,{shortcuts:n,priority:c}])=>[t,{shortcuts:n,priority:c}])),`${t}Keymap`),o=T(t=>{const o=t.get(c.key),u=Object.entries(n).flatMap(([t,{command:n}])=>{const c=o[t],u=[c.shortcuts].flat(),s=c.priority;return u.map(t=>[t,{key:t,onRun:n,priority:s}])});return Object.fromEntries(u)}),u=[c,o];return u.ctx=c,u.shortcuts=o,u.key=c.key,u.keymap=o.keymap,u}var K=(t,n=()=>({}))=>M(n,`${t}Attr`),E=(t,n=()=>({}))=>M(n,`${t}Attr`);function D(n,c,o){const u=M(o??{},n),s=n=>async()=>{await n.wait(t.InitReady);const o={plugin:c(n),options:n.get(u.key)};return n.update(t.remarkPluginsCtx,t=>[...t,o]),()=>{n.update(t.remarkPluginsCtx,t=>t.filter(t=>t!==o))}},p=[u,s];return p.id=n,p.plugin=s,p.options=u,p}function F(n,c){return o=>o.get(t.commandsCtx).call(n,c)}function _(){return n=>{const c=n.get(t.editorViewCtx),{tr:o}=c.state,u=Object.assign(Object.create(o),o).setTime(Date.now());return c.dispatch(u)}}function H(){return n=>{const c=document.createElement("div"),o=n.get(t.schemaCtx),s=n.get(t.editorViewCtx),p=u.DOMSerializer.fromSchema(o).serializeFragment(s.state.doc.content);return c.appendChild(p),c.innerHTML}}function L(n){return c=>{const o=c.get(t.editorViewCtx),u=c.get(t.schemaCtx),s=c.get(t.serializerCtx);if(!n)return s(o.state.doc);const p=o.state.doc.slice(n.from,n.to,!0),f=u.topNodeType.createAndFill(null,p.content);return f?s(f):(console.error("No document found"),"")}}function B(n,c=!1){return o=>{const p=o.get(t.editorViewCtx),f=o.get(t.parserCtx)(n);if(!f)return;if(!c){const t=p.state.selection.content();return p.dispatch(p.state.tr.replaceSelection(new u.Slice(f.content,t.openStart,t.openEnd)).scrollIntoView())}const l=o.get(t.schemaCtx),y=u.DOMSerializer.fromSchema(l).serializeFragment(f.content),b=u.DOMParser.fromSchema(l).parseSlice(y),x=(0,s.isTextOnlySlice)(b);x?p.dispatch(p.state.tr.replaceSelectionWith(x,!0)):p.dispatch(p.state.tr.replaceSelection(b))}}function U(){return n=>{const c=n.get(t.editorViewCtx),o=[];return c.state.doc.descendants(t=>{"heading"===t.type.name&&t.attrs.level&&o.push({text:t.textContent,level:t.attrs.level,id:t.attrs.id})}),o}}function W(n,c=!1){return o=>{const s=o.get(t.editorViewCtx),f=o.get(t.parserCtx)(n);if(!f)return;if(!c){const{state:t}=s;return s.dispatch(t.tr.replace(0,t.doc.content.size,new u.Slice(f.content,0,0)))}const l=o.get(t.schemaCtx),y=o.get(t.editorStateOptionsCtx)({schema:l,doc:f,plugins:o.get(t.prosePluginsCtx)}),b=p.EditorState.create(y);s.updateState(b)}}function q(n,c){return o=>{const u=o.get(t.editorViewCtx),{tr:s}=u.state,p=s.doc.nodeAt(n);if(!p)return;const f=c(p.attrs);return u.dispatch(s.setNodeMarkup(n,void 0,f))}}function G(n){return c=>{const o=c.get(t.parserCtx)(n),s=c.get(t.schemaCtx),p=u.DOMSerializer.fromSchema(s).serializeFragment(o.content);return u.DOMParser.fromSchema(s).parseSlice(p)}}function J(n,c,o=!1){return u=>{const s=G(n)(u),p=u.get(t.editorViewCtx),f=p.state.doc.resolve(c),l=p.state.doc.content.size,y=o?f.pos:f.after(f.depth-1),b=Math.min(Math.max(y,0),l);p.dispatch(p.state.tr.replace(y,b,s))}}function Q(n,c){return o=>{const u=o.get(t.editorViewCtx),s=G(n)(o);u.dispatch(u.state.tr.replace(c.from,c.to,s))}}var X=(...t)=>{const n=t.length;let c=n;for(;c--;)if("function"!=typeof t[c])throw new TypeError("Expected a function");return(...c)=>{let o=0,u=n?t[o](...c):c[0];for(;++o<n;)u=t[o](u);return u}}},2633,[2465,2466,2634,2467,2617,2618,2623]);
172
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"urlAlphabet",{enumerable:!0,get:function(){return t.urlAlphabet}}),Object.defineProperty(e,"random",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"customRandom",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"customAlphabet",{enumerable:!0,get:function(){return l}}),Object.defineProperty(e,"nanoid",{enumerable:!0,get:function(){return o}});var t=r(d[0]);let n=t=>crypto.getRandomValues(new Uint8Array(t)),u=(t,n,u)=>{let l=256-256%t.length;if(256===l){let l=t.length-1;return(o=n)=>{if(!o)return'';let f='';for(;;){let n=u(o),c=o;for(;c--;)if(f+=t[n[c]&l],f.length>=o)return f}}}let o=Math.ceil(409.6*n/l);return(f=n)=>{if(!f)return'';let c='';for(;;){let n=u(o),b=o;for(;b--;)if(n[b]<l&&(c+=t[n[b]%t.length],c.length>=f))return c}}},l=(t,l=21)=>u(t,0|l,n),o=(n=21)=>{let u='',l=crypto.getRandomValues(new Uint8Array(n|=0));for(;n--;)u+=t.urlAlphabet[63&l[n]];return u}},2634,[2635]);
173
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"urlAlphabet",{enumerable:!0,get:function(){return t}});let t='useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'},2635,[]);
174
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2636,[2637]);
175
+ __d(function(g,r,_i,a,_m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"addBlockTypeCommand",{enumerable:!0,get:function(){return ft}}),Object.defineProperty(_e,"blockContainerTypes",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_e,"blockquoteAttr",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(_e,"blockquoteKeymap",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(_e,"blockquoteSchema",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(_e,"bulletListAttr",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(_e,"bulletListKeymap",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(_e,"bulletListSchema",{enumerable:!0,get:function(){return qe}}),Object.defineProperty(_e,"clearTextInCurrentBlockCommand",{enumerable:!0,get:function(){return pt}}),Object.defineProperty(_e,"codeBlockAttr",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"codeBlockKeymap",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(_e,"codeBlockSchema",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(_e,"commands",{enumerable:!0,get:function(){return ht}}),Object.defineProperty(_e,"commonmark",{enumerable:!0,get:function(){return Tt}}),Object.defineProperty(_e,"createCodeBlockCommand",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(_e,"createCodeBlockInputRule",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(_e,"docSchema",{enumerable:!0,get:function(){return G}}),Object.defineProperty(_e,"downgradeHeadingCommand",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"emphasisAttr",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"emphasisKeymap",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"emphasisSchema",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"emphasisStarInputRule",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"emphasisUnderscoreInputRule",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"hardbreakAttr",{enumerable:!0,get:function(){return je}}),Object.defineProperty(_e,"hardbreakClearMarkPlugin",{enumerable:!0,get:function(){return Lt}}),Object.defineProperty(_e,"hardbreakFilterNodes",{enumerable:!0,get:function(){return $t}}),Object.defineProperty(_e,"hardbreakFilterPlugin",{enumerable:!0,get:function(){return St}}),Object.defineProperty(_e,"hardbreakKeymap",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(_e,"hardbreakSchema",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(_e,"headingAttr",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(_e,"headingIdGenerator",{enumerable:!0,get:function(){return se}}),Object.defineProperty(_e,"headingKeymap",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(_e,"headingSchema",{enumerable:!0,get:function(){return me}}),Object.defineProperty(_e,"hrAttr",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(_e,"hrSchema",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(_e,"htmlAttr",{enumerable:!0,get:function(){return it}}),Object.defineProperty(_e,"htmlSchema",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(_e,"imageAttr",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(_e,"imageSchema",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(_e,"inlineCodeAttr",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"inlineCodeInputRule",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"inlineCodeKeymap",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"inlineCodeSchema",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"inlineNodesCursorPlugin",{enumerable:!0,get:function(){return xt}}),Object.defineProperty(_e,"inputRules",{enumerable:!0,get:function(){return st}}),Object.defineProperty(_e,"insertHardbreakCommand",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(_e,"insertHrCommand",{enumerable:!0,get:function(){return De}}),Object.defineProperty(_e,"insertHrInputRule",{enumerable:!0,get:function(){return He}}),Object.defineProperty(_e,"insertImageCommand",{enumerable:!0,get:function(){return $e}}),Object.defineProperty(_e,"insertImageInputRule",{enumerable:!0,get:function(){return we}}),Object.defineProperty(_e,"isMarkSelectedCommand",{enumerable:!0,get:function(){return mt}}),Object.defineProperty(_e,"isNodeSelectedCommand",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(_e,"keymap",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(_e,"liftFirstListItemCommand",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(_e,"liftListItemCommand",{enumerable:!0,get:function(){return et}}),Object.defineProperty(_e,"linkAttr",{enumerable:!0,get:function(){return F}}),Object.defineProperty(_e,"linkSchema",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"listItemAttr",{enumerable:!0,get:function(){return Xe}}),Object.defineProperty(_e,"listItemKeymap",{enumerable:!0,get:function(){return at}}),Object.defineProperty(_e,"listItemSchema",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(_e,"markInputRules",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(_e,"orderedListAttr",{enumerable:!0,get:function(){return Ve}}),Object.defineProperty(_e,"orderedListKeymap",{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(_e,"orderedListSchema",{enumerable:!0,get:function(){return Ue}}),Object.defineProperty(_e,"paragraphAttr",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(_e,"paragraphKeymap",{enumerable:!0,get:function(){return le}}),Object.defineProperty(_e,"paragraphSchema",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(_e,"plugins",{enumerable:!0,get:function(){return At}}),Object.defineProperty(_e,"remarkAddOrderInListPlugin",{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(_e,"remarkHtmlTransformer",{enumerable:!0,get:function(){return Pt}}),Object.defineProperty(_e,"remarkInlineLinkPlugin",{enumerable:!0,get:function(){return Ct}}),Object.defineProperty(_e,"remarkLineBreak",{enumerable:!0,get:function(){return vt}}),Object.defineProperty(_e,"remarkMarker",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(_e,"remarkPreserveEmptyLinePlugin",{enumerable:!0,get:function(){return re}}),Object.defineProperty(_e,"sanitizeLinkHref",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"schema",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(_e,"selectTextNearPosCommand",{enumerable:!0,get:function(){return kt}}),Object.defineProperty(_e,"setBlockTypeCommand",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(_e,"sinkListItemCommand",{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(_e,"splitListItemCommand",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(_e,"strongAttr",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"strongInputRule",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"strongKeymap",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"strongSchema",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"syncHeadingIdPlugin",{enumerable:!0,get:function(){return wt}}),Object.defineProperty(_e,"syncListOrderPlugin",{enumerable:!0,get:function(){return jt}}),Object.defineProperty(_e,"textSchema",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(_e,"toggleEmphasisCommand",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"toggleInlineCodeCommand",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"toggleLinkCommand",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"toggleStrongCommand",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"turnIntoTextCommand",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"updateCodeBlockLanguageCommand",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(_e,"updateImageCommand",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"updateLinkCommand",{enumerable:!0,get:function(){return U}}),Object.defineProperty(_e,"wrapInBlockTypeCommand",{enumerable:!0,get:function(){return yt}}),Object.defineProperty(_e,"wrapInBlockquoteCommand",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"wrapInBlockquoteInputRule",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"wrapInBulletListCommand",{enumerable:!0,get:function(){return Fe}}),Object.defineProperty(_e,"wrapInBulletListInputRule",{enumerable:!0,get:function(){return We}}),Object.defineProperty(_e,"wrapInHeadingCommand",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"wrapInHeadingInputRule",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(_e,"wrapInOrderedListCommand",{enumerable:!0,get:function(){return Je}}),Object.defineProperty(_e,"wrapInOrderedListInputRule",{enumerable:!0,get:function(){return Ge}});var e,t=r(d[0]),n=r(d[1]),o=r(d[2]),i=r(d[3]),l=r(d[4]),s=r(d[5]),u=r(d[6]),m=r(d[7]),c=r(d[8]),p=r(d[9]),y=r(d[10]),f=r(d[11]),k=r(d[12]),h=(e=k)&&e.__esModule?e:{default:e},b=r(d[13]);function N(e){const t={...e};return t.position&&(t.position={start:{...t.position.start},end:{...t.position.end}}),delete t.children,t}var v=/^<br\s*\/?\s*>$/i;function C(e,t){if(!(t.childCount>=1&&"hardbreak"===t.lastChild?.type.name))return void e.next(t.content);const n=[];t.content.forEach((e,o,i)=>{i!==t.childCount-1&&n.push(e)}),e.next(l.Fragment.fromArray(n))}function I(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-commonmark",...t}}),e}var O=(0,i.$markAttr)("emphasis");I(O,{displayName:"Attr<emphasis>",group:"Emphasis"});var P=(0,i.$markSchema)("emphasis",e=>({attrs:{marker:{default:e.get(t.remarkStringifyOptionsCtx).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:e=>"italic"===e}],toDOM:t=>["em",e.get(O.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})}}}));I(P.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"}),I(P.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var M=(0,i.$command)("ToggleEmphasis",e=>()=>(0,o.toggleMark)(P.type(e)));I(M,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var x=(0,i.$inputRule)(e=>(0,n.markRule)(/(?:^|[^*])\*([^*]+)\*$/,P.type(e),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("*")?{}:{fullMatch:e.slice(1),start:t+1}}));I(x,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var L=(0,i.$inputRule)(e=>(0,n.markRule)(/\b_(?![_\s])(.*?[^_\s])_$/,P.type(e),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:e,start:t})=>e.startsWith("_")?{}:{fullMatch:e.slice(1),start:t+1}}));I(L,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var $=(0,i.$useKeymap)("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(M.key)}}});I($.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"}),I($.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var S=(0,i.$markAttr)("strong");I(S,{displayName:"Attr<strong>",group:"Strong"});var w=(0,i.$markSchema)("strong",e=>({attrs:{marker:{default:e.get(t.remarkStringifyOptionsCtx).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(S.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})}}}));I(w.mark,{displayName:"MarkSchema<strong>",group:"Strong"}),I(w.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var j=(0,i.$command)("ToggleStrong",e=>()=>(0,o.toggleMark)(w.type(e)));I(j,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var A=(0,i.$inputRule)(e=>(0,n.markRule)(/(?<![\w:/])(?:\*\*|__)([^*_]+?)(?:\*\*|__)(?![\w/])$/,w.type(e),{getAttr:e=>({marker:e[0].startsWith("*")?"*":"_"})}));I(A,{displayName:"InputRule<strong>",group:"Strong"});var T=(0,i.$useKeymap)("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(j.key)}}});I(T.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"}),I(T.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var R=(0,i.$markAttr)("inlineCode");I(R,{displayName:"Attr<inlineCode>",group:"InlineCode"});var B=(0,i.$markSchema)("inlineCode",e=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:t=>["code",e.get(R.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)}}));I(B.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"}),I(B.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var K=(0,i.$command)("ToggleInlineCode",e=>()=>(t,n)=>{const{selection:o,tr:i}=t;if(o.empty)return!1;const{from:l,to:s}=o;return t.doc.rangeHasMark(l,s,B.type(e))?(n?.(i.removeMark(l,s,B.type(e))),!0):(Object.keys(t.schema.marks).filter(e=>e!==B.type.name).map(e=>t.schema.marks[e]).forEach(e=>{i.removeMark(l,s,e)}),n?.(i.addMark(l,s,B.type(e).create())),!0)});I(K,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var H=(0,i.$inputRule)(e=>(0,n.markRule)(/(?:`)([^`]+)(?:`)$/,B.type(e)));I(H,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var D=(0,i.$useKeymap)("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(K.key)}}});I(D.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"}),I(D.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var E=new Set(["http:","https:","mailto:","tel:","ftp:"]);function _(e){return e<=32||e>=127&&e<=160||e>=8203&&e<=8205||8232===e||8233===e||65279===e}function q(e){let t="";for(const n of e)_(n.codePointAt(0)??0)||(t+=n);return t}function W(e){if("string"!=typeof e)return"";const t=e.trim();if(!t)return"";const n=q(t),o=/^([a-z][a-z0-9+.-]*):/i.exec(n)?.[1];return o?E.has(`${o.toLowerCase()}:`)?t:"":t}var F=(0,i.$markAttr)("link");I(F,{displayName:"Attr<link>",group:"Link"});var z=(0,i.$markSchema)("link",e=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,s.expectDomTypeError)(e);return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM:t=>["a",{...e.get(F.key)(t),...t.attrs,href:W(t.attrs.href)}],parseMarkdown:{match:e=>"link"===e.type,runner:(e,t,n)=>{const o=t.url,i=t.title;e.openMark(n,{href:o,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})}}}));I(z.mark,{displayName:"MarkSchema<link>",group:"Link"});var V=(0,i.$command)("ToggleLink",e=>(t={})=>(0,o.toggleMark)(z.type(e),t));I(V,{displayName:"Command<toggleLinkCommand>",group:"Link"});var U=(0,i.$command)("UpdateLink",e=>(t={})=>(n,o)=>{if(!o)return!1;let i,l=-1;const{selection:s}=n,{from:m,to:c}=s;if(n.doc.nodesBetween(m,m===c?c+1:c,(t,n)=>{if(z.type(e).isInSet(t.marks))return i=t,l=n,!1}),!i)return!1;const p=i.marks.find(({type:t})=>t===z.type(e));if(!p)return!1;const y=l,f=l+i.nodeSize,{tr:k}=n,h=z.type(e).create({...p.attrs,...t});return!!h&&(o(k.removeMark(y,f,p).addMark(y,f,h).setSelection(new u.TextSelection(k.selection.$anchor)).scrollIntoView()),!0)});I(U,{displayName:"Command<updateLinkCommand>",group:"Link"});var G=(0,i.$node)("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");const n=t.childCount>0?t.child(t.childCount-1):null,o="paragraph"===n?.type.name&&0===n.content.size?t.content.cut(0,t.content.size-n.nodeSize):t.content;e.next(o)}}}));I(G,{displayName:"NodeSchema<doc>",group:"Doc"});var J=Object.freeze(["root","blockquote","listItem","footnoteDefinition"]),Q=new Set(["paragraph","heading","tableCell","link","linkReference","emphasis","strong","delete","footnote"]),X=(0,i.$ctx)(J,"blockContainerTypes");I(X,{displayName:"Ctx<blockContainerTypes>",group:"Remark"});var Y=new Set;function Z(e){const t=e.isInjected(X.key)?e.get(X.key):J,n=new Set;for(const e of t)Q.has(e)?Y.has(e)||(Y.add(e),console.warn(`[milkdown/preset-commonmark] "${e}" holds phrasing content and cannot be a block container; it is ignored in blockContainerTypes.`)):n.add(e);return n}var ee=new Set(["paragraph","tableCell"]);function te(e,t){return(0,c.visitParents)(e,e=>{return"html"===e.type&&("string"==typeof(t=e.value)&&v.test(t.trim()));var t},(e,n)=>{const o=n[n.length-1];if(o)if(ee.has(o.type))1===o.children.length&&(o.children=[]);else if(t.has(o.type)){const t=e;return t.children=[],delete t.value,t.type="paragraph",c.SKIP}})}var re=(0,i.$remark)("remark-preserve-empty-line",e=>()=>t=>te(t,Z(e)));I(re.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"}),I(re.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var ne=(0,i.$nodeAttr)("paragraph");I(ne,{displayName:"Attr<paragraph>",group:"Paragraph"});var ae=(0,i.$nodeSchema)("paragraph",e=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:t=>["p",e.get(ne.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)=>{t.openNode("paragraph"),n.content&&0!==n.content.size||!oe(e)?C(t,n):t.addNode("html",void 0,"<br />"),t.closeNode()}}}));function oe(e){return e.isInjected(re.options.key)}I(ae.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"}),I(ae.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var ie=(0,i.$command)("TurnIntoText",e=>()=>(0,o.setBlockType)(ae.type(e)));I(ie,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var le=(0,i.$useKeymap)("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(ie.key)}}});I(le.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"}),I(le.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var de=Array(6).fill(0).map((e,t)=>t+1);var se=(0,i.$ctx)(function(e){return e.textContent.toLowerCase().trim().replace(/\s+/g,"-")},"headingIdGenerator");I(se,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var ue=(0,i.$nodeAttr)("heading");I(ue,{displayName:"Attr<heading>",group:"Heading"});var me=(0,i.$nodeSchema)("heading",e=>{const t=e.get(se.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:de.map(e=>({tag:`h${e}`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw(0,s.expectDomTypeError)(t);return{level:e,id:t.id}}})),toDOM:n=>[`h${n.attrs.level}`,{...e.get(ue.key)(n),id:n.attrs.id||t(n)},0],parseMarkdown:{match:({type:e})=>"heading"===e,runner:(e,t,n)=>{const o=t.depth;e.openNode(n,{level:o}),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}),C(e,t),e.closeNode()}}}});I(me.node,{displayName:"NodeSchema<heading>",group:"Heading"}),I(me.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var ce=(0,i.$inputRule)(e=>(0,m.textblockTypeInputRule)(/^(?<hashes>#+)\s$/,me.type(e),n=>{const o=n.groups?.hashes?.length||0,{$from:i}=e.get(t.editorViewCtx).state.selection,l=i.node();if("heading"===l.type.name){let e=Number(l.attrs.level)+Number(o);return e>6&&(e=6),{level:e}}return{level:o}}));I(ce,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var pe=(0,i.$command)("WrapInHeading",e=>t=>(t??=1,t<1?(0,o.setBlockType)(ae.type(e)):(0,o.setBlockType)(me.type(e),{level:t})));I(pe,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var ge=(0,i.$command)("DowngradeHeading",e=>()=>(t,n,i)=>{const{$from:l}=t.selection,s=l.node();if(s.type!==me.type(e)||!t.selection.empty||0!==l.parentOffset)return!1;const u=s.attrs.level-1;return u?(n?.(t.tr.setNodeMarkup(t.selection.$from.before(),void 0,{...s.attrs,level:u})),!0):(0,o.setBlockType)(ae.type(e))(t,n,i)});I(ge,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var ye=(0,i.$useKeymap)("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(pe.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(pe.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(pe.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(pe.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(pe.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(pe.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(ge.key)}}});I(ye.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"}),I(ye.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var fe=(0,i.$nodeAttr)("blockquote");I(fe,{displayName:"Attr<blockquote>",group:"Blockquote"});var ke=(0,i.$nodeSchema)("blockquote",e=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:t=>["blockquote",e.get(fe.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()}}}));I(ke.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"}),I(ke.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var he=(0,i.$inputRule)(e=>(0,m.wrappingInputRule)(/^\s*>\s$/,ke.type(e)));I(he,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var be=(0,i.$command)("WrapInBlockquote",e=>()=>(0,o.wrapIn)(ke.type(e)));I(be,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var Ne=(0,i.$useKeymap)("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(be.key)}}});I(Ne.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"}),I(Ne.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var ve=(0,i.$nodeAttr)("codeBlock",()=>({pre:{},code:{}}));I(ve,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var Ce=(0,i.$nodeSchema)("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(0,s.expectDomTypeError)(e);return{language:e.dataset.language}}}],toDOM:t=>{const n=e.get(ve.key)(t),o=t.attrs.language,i=o&&o.length>0?{"data-language":o}:void 0;return["pre",{...n.pre,...i},["code",n.code,0]]},parseMarkdown:{match:({type:e})=>"code"===e,runner:(e,t,n)=>{const o=t.lang??"",i=t.value;e.openNode(n,{language:o}),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})}}}));I(Ce.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"}),I(Ce.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var Ie=(0,i.$inputRule)(e=>(0,m.textblockTypeInputRule)(/^```(?<language>[a-z]*)?[\s\n]$/,Ce.type(e),e=>({language:e.groups?.language??""})));I(Ie,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var Oe=(0,i.$command)("CreateCodeBlock",e=>(t="")=>(0,o.setBlockType)(Ce.type(e),{language:t}));I(Oe,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"});var Pe=(0,i.$command)("UpdateCodeBlockLanguage",()=>({pos:e,language:t}={pos:-1,language:""})=>(n,o)=>e>=0&&(o?.(n.tr.setNodeAttribute(e,"language",t)),!0));I(Pe,{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var Me=(0,i.$useKeymap)("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(Oe.key)}}});I(Me.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"}),I(Me.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var xe=(0,i.$nodeAttr)("image");I(xe,{displayName:"Attr<image>",group:"Image"});var Le=(0,i.$nodeSchema)("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(0,s.expectDomTypeError)(e);return{src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",title:e.getAttribute("title")||e.getAttribute("alt")||""}}}],toDOM:t=>["img",{...e.get(xe.key)(t),...t.attrs}],parseMarkdown:{match:({type:e})=>"image"===e,runner:(e,t,n)=>{const o=t.url,i=t.alt,l=t.title;e.addNode(n,{src:o,alt:i,title:l})}},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})}}}));I(Le.node,{displayName:"NodeSchema<image>",group:"Image"}),I(Le.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var $e=(0,i.$command)("InsertImage",e=>(t={})=>(n,o)=>{if(!o)return!0;const{src:i="",alt:l="",title:s=""}=t,u=Le.type(e).create({src:i,alt:l,title:s});return!u||(o(n.tr.replaceSelectionWith(u).scrollIntoView()),!0)});I($e,{displayName:"Command<insertImageCommand>",group:"Image"});var Se=(0,i.$command)("UpdateImage",e=>(t={})=>(o,i)=>{const l=(0,n.findSelectedNodeOfType)(o.selection,Le.type(e));if(!l)return!1;const{node:s,pos:u}=l,m={...s.attrs},{src:c,alt:p,title:y}=t;return void 0!==c&&(m.src=c),void 0!==p&&(m.alt=p),void 0!==y&&(m.title=y),i?.(o.tr.setNodeMarkup(u,void 0,m).scrollIntoView()),!0});I(Se,{displayName:"Command<updateImageCommand>",group:"Image"});var we=(0,i.$inputRule)(e=>new m.InputRule(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(t,n,o,i)=>{const[l,s,u="",m]=n;return l?t.tr.replaceWith(o,i,Le.type(e).create({src:u,alt:s,title:m})):null}));I(we,{displayName:"InputRule<insertImageInputRule>",group:"Image"});var je=(0,i.$nodeAttr)("hardbreak",e=>({"data-type":"hardbreak","data-is-inline":e.attrs.isInline}));I(je,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var Ae=(0,i.$nodeSchema)("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(je.key)(t)," "]:["br",e.get(je.key)(t)],parseMarkdown:{match:({type:e})=>"break"===e,runner:(e,t,n)=>{e.addNode(n,{isInline:Boolean(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")}}}));I(Ae.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"}),I(Ae.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var Te=(0,i.$command)("InsertHardbreak",e=>()=>(t,n)=>{const{selection:o,tr:i}=t;if(!(o instanceof u.TextSelection))return!1;if(o.empty){const e=o.$from.node();if(e.childCount>0&&"hardbreak"===e.lastChild?.type.name)return n?.(i.replaceRangeWith(o.to-1,o.to,t.schema.node("paragraph")).setSelection(u.Selection.near(i.doc.resolve(o.to))).scrollIntoView()),!0}return n?.(i.setMeta("hardbreak",!0).replaceSelectionWith(Ae.type(e).create()).scrollIntoView()),!0});I(Te,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var Re=(0,i.$useKeymap)("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(Te.key)}}});I(Re.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"}),I(Re.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var Be=(0,i.$nodeAttr)("hr");I(Be,{displayName:"Attr<hr>",group:"Hr"});var Ke=(0,i.$nodeSchema)("hr",e=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:t=>["hr",e.get(Be.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")}}}));I(Ke.node,{displayName:"NodeSchema<hr>",group:"Hr"}),I(Ke.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var He=(0,i.$inputRule)(e=>new m.InputRule(/^(?:---|___\s|\*\*\*\s)$/,(t,n,o,i)=>{const{tr:l}=t;return n[0]&&l.replaceWith(o-1,i,Ke.type(e).create()),l}));I(He,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var De=(0,i.$command)("InsertHr",e=>()=>(t,n)=>{if(!n)return!0;const o=ae.node.type(e).create(),{tr:i,selection:l}=t,{from:s}=l,m=Ke.type(e).create();if(!m)return!0;const c=i.replaceSelectionWith(m).insert(s,o),p=u.Selection.findFrom(c.doc.resolve(s),1,!0);return!p||(n(c.setSelection(p).scrollIntoView()),!0)});I(De,{displayName:"Command<insertHrCommand>",group:"Hr"});var Ee=(0,i.$nodeAttr)("bulletList");I(Ee,{displayName:"Attr<bulletList>",group:"BulletList"});var qe=(0,i.$nodeSchema)("bullet_list",e=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,s.expectDomTypeError)(e);return{spread:"true"===e.dataset.spread}}}],toDOM:t=>["ul",{...e.get(Ee.key)(t),"data-spread":t.attrs.spread},0],parseMarkdown:{match:({type:e,ordered:t})=>"list"===e&&!t,runner:(e,t,n)=>{const o=t.spread??!1;e.openNode(n,{spread:o}).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()}}}));I(qe.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"}),I(qe.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var We=(0,i.$inputRule)(e=>(0,m.wrappingInputRule)(/^\s*([-+*])\s$/,qe.type(e)));I(We,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var Fe=(0,i.$command)("WrapInBulletList",e=>()=>(0,o.wrapIn)(qe.type(e)));I(Fe,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var ze=(0,i.$useKeymap)("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(Fe.key)}}});I(ze.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"}),I(ze.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var Ve=(0,i.$nodeAttr)("orderedList");I(Ve,{displayName:"Attr<orderedList>",group:"OrderedList"});var Ue=(0,i.$nodeSchema)("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(0,s.expectDomTypeError)(e);return{spread:"true"===e.dataset.spread,order:e.hasAttribute("start")?Number(e.getAttribute("start")):1}}}],toDOM:t=>["ol",{...e.get(Ve.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)=>{const o=t.spread??!0;e.openNode(n,{spread:o,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:t.attrs.spread}),e.next(t.content),e.closeNode()}}}));I(Ue.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"}),I(Ue.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var Ge=(0,i.$inputRule)(e=>(0,m.wrappingInputRule)(/^\s*(\d+)\.\s$/,Ue.type(e),e=>({order:Number(e[1])}),(e,t)=>t.childCount+t.attrs.order===Number(e[1])));I(Ge,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var Je=(0,i.$command)("WrapInOrderedList",e=>()=>(0,o.wrapIn)(Ue.type(e)));I(Je,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var Qe=(0,i.$useKeymap)("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(Je.key)}}});I(Qe.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"}),I(Qe.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var Xe=(0,i.$nodeAttr)("listItem");I(Xe,{displayName:"Attr<listItem>",group:"ListItem"});var Ye=(0,i.$nodeSchema)("list_item",e=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"\u2022",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,s.expectDomTypeError)(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:"true"===e.dataset.spread}}}],toDOM:t=>["li",{...e.get(Xe.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)=>{const o=null!=t.label?`${t.label}.`:"\u2022",i=null!=t.label?"ordered":"bullet",l=t.spread??!0;e.openNode(n,{label:o,listType:i,spread:l}),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()}}}));I(Ye.node,{displayName:"NodeSchema<listItem>",group:"ListItem"}),I(Ye.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var Ze=(0,i.$command)("SinkListItem",e=>()=>(0,p.sinkListItem)(Ye.type(e)));I(Ze,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var et=(0,i.$command)("LiftListItem",e=>()=>(0,p.liftListItem)(Ye.type(e)));I(et,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var tt=(0,i.$command)("SplitListItem",e=>()=>(0,p.splitListItem)(Ye.type(e)));function rt(e){return(t,n,i)=>{const{selection:l}=t;if(!(l instanceof u.TextSelection))return!1;const{empty:s,$from:m}=l;return!(!s||0!==m.parentOffset)&&(m.node(-1).type===Ye.type(e)&&(0,o.joinBackward)(t,n,i))}}I(tt,{displayName:"Command<splitListItemCommand>",group:"ListItem"});var nt=(0,i.$command)("LiftFirstListItem",e=>()=>rt(e));I(nt,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var at=(0,i.$useKeymap)("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(tt.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(Ze.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(et.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(nt.key)}}});I(at.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"}),I(at.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var ot=(0,i.$node)("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)}}}));I(ot,{displayName:"NodeSchema<text>",group:"Text"});var it=(0,i.$nodeAttr)("html");I(it,{displayName:"Attr<html>",group:"Html"});var lt=(0,i.$nodeSchema)("html",e=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:t=>{const n=document.createElement("span"),o={...e.get(it.key)(t),"data-value":t.attrs.value,"data-type":"html"};return n.textContent=t.attrs.value,["span",o,t.attrs.value]},parseDOM:[{tag:"span[data-type=\"html\"]",getAttrs:e=>({value:e.dataset.value??""})}],parseMarkdown:{match:({type:e})=>Boolean("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)}}}));I(lt.node,{displayName:"NodeSchema<html>",group:"Html"}),I(lt.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var dt=[G,ne,ae,se,ue,me,je,Ae,fe,ke,ve,Ce,Be,Ke,xe,Le,Ee,qe,Ve,Ue,Xe,Ye,O,P,S,w,R,B,F,z,it,lt,ot].flat(),st=[he,We,Ge,Ie,He,ce].flat(),ut=[x,L,H,A],mt=(0,i.$command)("IsMarkSelected",()=>e=>t=>{if(!e)return!1;const{doc:n,selection:o}=t;return n.rangeHasMark(o.from,o.to,e)}),ct=(0,i.$command)("IsNoteSelected",()=>e=>t=>!!e&&(0,n.findNodeInSelection)(t,e).hasNode),pt=(0,i.$command)("ClearTextInCurrentBlock",()=>()=>(e,t)=>{let n=e.tr;const{$from:o,$to:i}=n.selection,{pos:l}=o,{pos:s}=i,u=l-o.node().content.size;return!(u<0)&&(n=n.deleteRange(u,s),t?.(n),!0)}),gt=(0,i.$command)("SetBlockType",()=>e=>(t,n)=>{const{nodeType:o,attrs:i=null}=e??{};if(!o)return!1;const l=t.tr,{from:s,to:u}=l.selection;try{l.setBlockType(s,u,o,i)}catch{return!1}return n?.(l),!0}),yt=(0,i.$command)("WrapInBlockType",()=>e=>(t,n)=>{const{nodeType:o,attrs:i=null}=e??{};if(!o)return!1;let l=t.tr;try{const{$from:e,$to:t}=l.selection,n=e.blockRange(t),s=n&&(0,y.findWrapping)(n,o,i);if(!s)return!1;l=l.wrap(n,s)}catch{return!1}return n?.(l),!0}),ft=(0,i.$command)("AddBlockType",()=>e=>(t,n)=>{const{nodeType:o,attrs:i=null}=e??{};if(!o)return!1;const s=t.tr;try{const e=o instanceof l.Node?o:o.createAndFill(i);if(!e)return!1;s.replaceSelectionWith(e)}catch{return!1}return n?.(s),!0}),kt=(0,i.$command)("SelectTextNearPos",()=>e=>(t,n)=>{const{pos:o}=e??{};if(null==o)return!1;const i=t.tr;try{const e=t.doc.resolve((l=o,s=0,m=t.doc.content.size,Math.min(Math.max(l,s),m)));i.setSelection(u.TextSelection.near(e))}catch{return!1}var l,s,m;return n?.(i.scrollIntoView()),!0}),ht=[ie,be,pe,ge,Oe,Te,De,$e,Se,Je,Fe,Ze,tt,et,nt,M,K,j,V,U,mt,ct,pt,gt,yt,ft,kt],bt=[Ne,Me,Re,ye,at,Qe,ze,le,$,D,T].flat(),Nt=(0,i.$remark)("remarkAddOrderInList",()=>()=>e=>{(0,f.visit)(e,"list",e=>{if(e.ordered){const t=e.start??1;e.children.forEach((e,n)=>{e.label=n+t})}})});I(Nt.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"}),I(Nt.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var vt=(0,i.$remark)("remarkLineBreak",()=>()=>e=>{const t=/[\t ]*(?:\r?\n|\r)/g;(0,f.visit)(e,"text",(e,n,o)=>{if(!e.value||"string"!=typeof e.value)return;const i=[];let l=0;t.lastIndex=0;let s=t.exec(e.value);for(;s;){const n=s.index;l!==n&&i.push({type:"text",value:e.value.slice(l,n)}),i.push({type:"break",data:{isInline:!0}}),l=n+s[0].length,s=t.exec(e.value)}return i.length>0&&o&&"number"==typeof n?(l<e.value.length&&i.push({type:"text",value:e.value.slice(l)}),o.children.splice(n,1,...i),n+i.length):void 0})});I(vt.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"}),I(vt.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var Ct=(0,i.$remark)("remarkInlineLink",()=>h.default);I(Ct.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"}),I(Ct.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var It=e=>!!e.children,Ot=e=>"html"===e.type;var Pt=(0,i.$remark)("remarkHTMLTransformer",e=>()=>t=>{const n=Z(e);var o;o=(e,t,o)=>Ot(e)?(o&&n.has(o.type)&&(e.children=[N(e)],delete e.value,e.type="paragraph"),[e]):[e],(function e(t,n,i){if(It(t)){const n=[];for(let o=0,i=t.children.length;o<i;o++){const i=t.children[o];if(i){const l=e(i,o,t);if(l)for(let e=0,t=l.length;e<t;e++){const t=l[e];t&&n.push(t)}}}t.children=n}return o(t,n,i)})(t,0,null)[0]});I(Pt.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"}),I(Pt.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var Mt=(0,i.$remark)("remarkMarker",()=>()=>(e,t)=>{const n=e=>t.value.charAt(e.position.start.offset);(0,f.visit)(e,e=>["strong","emphasis"].includes(e.type),e=>{e.marker=n(e)})});I(Mt.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"}),I(Mt.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var xt=(0,i.$prose)(()=>{let e=!1;const t=new u.PluginKey("MILKDOWN_INLINE_NODES_CURSOR"),n=new u.Plugin({key:t,state:{init:()=>!1,apply(e){if(!e.selection.empty)return!1;const t=e.selection.$from,n=t.nodeBefore,o=t.nodeAfter;return!(!(n&&o&&n.isInline&&!n.isText&&o.isInline)||o.isText)}},props:{handleDOMEvents:{compositionend:(t,o)=>!!e&&(e=!1,requestAnimationFrame(()=>{if(n.getState(t.state)){const e=t.state.selection.from;o.preventDefault(),t.dispatch(t.state.tr.insertText(o.data||"",e))}}),!0),compositionstart:t=>(n.getState(t.state)&&(e=!0),!1),beforeinput:(t,o)=>{if(n.getState(t.state)&&o instanceof InputEvent&&o.data&&!e){const e=t.state.selection.from;return o.preventDefault(),t.dispatch(t.state.tr.insertText(o.data||"",e)),!0}return!1}},decorations(e){if(n.getState(e)){const t=e.selection.$from.pos,n=document.createElement("span"),o=b.Decoration.widget(t,n,{side:-1}),i=document.createElement("span"),l=b.Decoration.widget(t,i);return setTimeout(()=>{n.contentEditable="true",i.contentEditable="true"}),b.DecorationSet.create(e.doc,[o,l])}return b.DecorationSet.empty}}});return n});I(xt,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var Lt=(0,i.$prose)(e=>new u.Plugin({key:new u.PluginKey("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(t,n,o)=>{if(!t.length)return;const[i]=t;if(!i)return;const[l]=i.steps;if(i.getMeta("hardbreak")){if(!(l instanceof y.ReplaceStep))return;const{from:t}=l;return o.tr.setNodeMarkup(t,Ae.type(e),void 0,[])}if(l instanceof y.AddMarkStep){let t=o.tr;const{from:n,to:i}=l;return o.doc.nodesBetween(n,i,(n,o)=>{n.type===Ae.type(e)&&(t=t.setNodeMarkup(o,Ae.type(e),void 0,[]))}),t}}}));I(Lt,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var $t=(0,i.$ctx)(["table","code_block"],"hardbreakFilterNodes");I($t,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var St=(0,i.$prose)(e=>{const t=e.get($t.key);return new u.Plugin({key:new u.PluginKey("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(e,n)=>{const o=e.getMeta("hardbreak"),[i]=e.steps;if(o&&i){const{from:e}=i,o=n.doc.resolve(e);let l=o.depth,s=!0;for(;l>0;)t.includes(o.node(l).type.name)&&(s=!1),l--;return s}return!0}})});I(St,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var wt=(0,i.$prose)(e=>{const t=new u.PluginKey("MILKDOWN_HEADING_ID"),n=n=>{if(n.composing)return;const o=e.get(se.key),i=n.state.tr.setMeta("addToHistory",!1);let l=!1;const s={};n.state.doc.descendants((n,u)=>{if(n.type===me.type(e)){if(0===n.textContent.trim().length)return;const e=n.attrs;let m=o(n);s[m]?(s[m]+=1,m+=`-#${s[m]}`):s[m]=1,e.id!==m&&(l=!0,i.setMeta(t,!0).setNodeMarkup(u,void 0,{...e,id:m}))}}),l&&n.dispatch(i)};return new u.Plugin({key:t,view:e=>(n(e),{update:(e,t)=>{e.state.doc.eq(t.doc)||n(e)}})})});I(wt,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var jt=(0,i.$prose)(e=>new u.Plugin({key:new u.PluginKey("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:(t,n,o)=>{if(!o.selection||t.some(e=>!1===e.getMeta("addToHistory")||!e.isGeneric))return null;const i=Ue.type(e),l=qe.type(e),s=Ye.type(e),u=(e,t,n=1)=>{let o=!1;const i=`${t+n}.`;return e.label!==i&&(e.label=i,o=!0),o};let m=o.tr,c=!1;return o.doc.descendants((e,t,n,o)=>{if(e.type===l){const n=e.maybeChild(0);n?.type===s&&"ordered"===n.attrs.listType&&(c=!0,m.setNodeMarkup(t,i,{spread:!0}),e.descendants((e,t,n,o)=>{if(e.type===s){const n={...e.attrs};u(n,o)&&(m=m.setNodeMarkup(t,void 0,n))}return!1}))}else if(e.type===s&&n?.type===i){const i={...e.attrs};let l=!1;"ordered"!==i.listType&&(i.listType="ordered",l=!0),n?.maybeChild(0)&&(l=u(i,o,n?.attrs.order??1)),l&&(m=m.setNodeMarkup(t,void 0,i),c=!0)}}),c?m.setMeta("addToHistory",!1):null}}));I(jt,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var At=[Lt,$t,St,xt,X,Nt,Ct,vt,Pt,Mt,re,wt,jt].flat(),Tt=[dt,st,ut,ht,bt,At].flat()},2637,[2465,2618,2611,2633,2617,2467,2623,2624,2558,2638,2640,2556,2641,2626]);
176
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2638,[2639]);
177
+ __d(function(g,r,_i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"addListNodes",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"bulletList",{enumerable:!0,get:function(){return c}}),Object.defineProperty(_e,"liftListItem",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"listItem",{enumerable:!0,get:function(){return p}}),Object.defineProperty(_e,"orderedList",{enumerable:!0,get:function(){return d}}),Object.defineProperty(_e,"sinkListItem",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"splitListItem",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"splitListItemKeepMarks",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"wrapInList",{enumerable:!0,get:function(){return f}}),Object.defineProperty(_e,"wrapRangeInList",{enumerable:!0,get:function(){return y}});var e=r(_d[0]),t=r(_d[1]),n=r(_d[2]);const o=["ol",0],l=["ul",0],i=["li",0],d={attrs:{order:{default:1,validate:"number"}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1==e.attrs.order?o:["ol",{start:e.attrs.order},0]},c={parseDOM:[{tag:"ul"}],toDOM:()=>l},p={parseDOM:[{tag:"li"}],toDOM:()=>i,defining:!0};function u(e,t){let n={};for(let t in e)n[t]=e[t];for(let e in t)n[e]=t[e];return n}function s(e,t,n){return e.append({ordered_list:u(d,{content:"list_item+",group:n}),bullet_list:u(c,{content:"list_item+",group:n}),list_item:u(p,{content:t})})}function f(e,t=null){return function(n,o){let{$from:l,$to:i}=n.selection,d=l.blockRange(i);if(!d)return!1;let c=o?n.tr:null;return!!y(c,d,e,t)&&(o&&o(c.scrollIntoView()),!0)}}function y(n,o,l,i=null){let d=!1,c=o,p=o.$from.doc;if(o.depth>=2&&o.$from.node(o.depth-1).type.compatibleContent(l)&&0==o.startIndex){if(0==o.$from.index(o.depth-1))return!1;let e=p.resolve(o.start-2);c=new t.NodeRange(e,e,o.depth),o.endIndex<o.parent.childCount&&(o=new t.NodeRange(o.$from,p.resolve(o.$to.end(o.depth)),o.depth)),d=!0}let u=(0,e.findWrapping)(c,l,i,o);return!!u&&(n&&h(n,o,u,d,l),!0)}function h(n,o,l,i,d){let c=t.Fragment.empty;for(let e=l.length-1;e>=0;e--)c=t.Fragment.from(l[e].type.create(l[e].attrs,c));n.step(new e.ReplaceAroundStep(o.start-(i?2:0),o.end,o.start,o.end,new t.Slice(c,0,0),l.length,!0));let p=0;for(let e=0;e<l.length;e++)l[e].type==d&&(p=e+1);let u=l.length-p,s=o.start+l.length-(i?2:0),f=o.parent;for(let t=o.startIndex,l=o.endIndex,i=!0;t<l;t++,i=!1)!i&&(0,e.canSplit)(n.doc,s,u)&&(n.split(s,u),s+=2*u),s+=f.child(t).nodeSize;return n}function b(o,l){return function(i,d){let{$from:c,$to:p,node:u}=i.selection;if(u&&u.isBlock||c.depth<2||!c.sameParent(p))return!1;let s=c.node(-1);if(s.type!=o)return!1;if(0==c.parent.content.size&&c.node(-1).childCount==c.indexAfter(-1)){if(3==c.depth||c.node(-3).type!=o||c.index(-2)!=c.node(-2).childCount-1)return!1;if(d){let e=t.Fragment.empty,l=c.index(-1)?1:c.index(-2)?2:3;for(let n=c.depth-l;n>=c.depth-3;n--)e=t.Fragment.from(c.node(n).copy(e));let p=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3;e=e.append(t.Fragment.from(o.createAndFill()));let u=c.before(c.depth-(l-1)),s=i.tr.replace(u,c.after(-p),new t.Slice(e,4-l,0)),f=-1;s.doc.nodesBetween(u,s.doc.content.size,(e,t)=>{if(f>-1)return!1;e.isTextblock&&0==e.content.size&&(f=t+1)}),f>-1&&s.setSelection(n.Selection.near(s.doc.resolve(f))),d(s.scrollIntoView())}return!0}let f=p.pos==c.end()?s.contentMatchAt(0).defaultType:null,y=i.tr.delete(c.pos,p.pos),h=f?[l?{type:o,attrs:l}:null,{type:f}]:void 0;return!!(0,e.canSplit)(y.doc,c.pos,2,h)&&(d&&d(y.split(c.pos,2,h).scrollIntoView()),!0)}}function I(e,t){let n=b(e,t);return(e,t)=>n(e,t&&(n=>{let o=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();o&&n.ensureMarks(o),t(n)}))}function w(e){return function(t,n){let{$from:o,$to:l}=t.selection,i=o.blockRange(l,t=>t.childCount>0&&t.firstChild.type==e);return!!i&&(!n||(o.node(i.depth-1).type==e?x(t,n,e,i):F(t,n,i)))}}function x(n,o,l,i){let d=n.tr,c=i.end,p=i.$to.end(i.depth);c<p&&(d.step(new e.ReplaceAroundStep(c-1,p,c,p,new t.Slice(t.Fragment.from(l.create(null,i.parent.copy())),1,0),1,!0)),i=new t.NodeRange(d.doc.resolve(i.$from.pos),d.doc.resolve(p),i.depth));const u=(0,e.liftTarget)(i);if(null==u)return!1;d.lift(i,u);let s=d.doc.resolve(d.mapping.map(c,-1)-1);return(0,e.canJoin)(d.doc,s.pos)&&s.nodeBefore.type==s.nodeAfter.type&&d.join(s.pos),o(d.scrollIntoView()),!0}function F(n,o,l){let i=n.tr,d=l.parent;for(let e=l.end,t=l.endIndex-1,n=l.startIndex;t>n;t--)e-=d.child(t).nodeSize,i.delete(e-1,e+1);let c=i.doc.resolve(l.start),p=c.nodeAfter;if(i.mapping.map(l.end)!=l.start+c.nodeAfter.nodeSize)return!1;let u=0==l.startIndex,s=l.endIndex==d.childCount,f=c.node(-1),y=c.index(-1);if(!f.canReplace(y+(u?0:1),y+1,p.content.append(s?t.Fragment.empty:t.Fragment.from(d))))return!1;let h=c.pos,b=h+p.nodeSize;return i.step(new e.ReplaceAroundStep(h-(u?1:0),b+(s?1:0),h+1,b-1,new t.Slice((u?t.Fragment.empty:t.Fragment.from(d.copy(t.Fragment.empty))).append(s?t.Fragment.empty:t.Fragment.from(d.copy(t.Fragment.empty))),u?0:1,s?0:1),u?0:1)),o(i.scrollIntoView()),!0}function O(n){return function(o,l){let{$from:i,$to:d}=o.selection,c=i.blockRange(d,e=>e.childCount>0&&e.firstChild.type==n);if(!c)return!1;let p=c.startIndex;if(0==p)return!1;let u=c.parent,s=u.child(p-1);if(s.type!=n)return!1;if(l){let i=s.lastChild&&s.lastChild.type==u.type,d=t.Fragment.from(i?n.create():null),p=new t.Slice(t.Fragment.from(n.create(null,t.Fragment.from(u.type.create(null,d)))),i?3:1,0),f=c.start,y=c.end;l(o.tr.step(new e.ReplaceAroundStep(f-(i?3:1),y,f,y,p,1,!0)).scrollIntoView())}return!0}}},2639,[2613,2614,2616]);
178
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2640,[2613]);
179
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},2641,[2642]);
180
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return l}});var t=r(d[0]),n=r(d[1]);function l(){return function(l){const u=(0,t.definitions)(l);(0,n.visit)(l,function(t,l,f){if('definition'===t.type&&void 0!==f&&'number'==typeof l)return f.children.splice(l,1),[n.SKIP,l];if('imageReference'===t.type||'linkReference'===t.type){const c=u(t.identifier);if(c&&f&&'number'==typeof l)return f.children[l]='imageReference'===t.type?{type:'image',url:c.url,title:c.title,alt:t.alt}:{type:'link',url:c.url,title:c.title,children:t.children},[n.SKIP,l]}})}}},2642,[2643,2556]);
181
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"definitions",{enumerable:!0,get:function(){return n.definitions}});var n=r(d[0])},2643,[2644]);
182
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.definitions=function(o){const s=new Map;if(!o||!o.type)throw new Error('mdast-util-definitions expected node');return(0,t.visit)(o,'definition',function(t){const o=n(t.identifier);o&&!s.get(o)&&s.set(o,t)}),function(t){const o=n(t);return s.get(o)}};var t=r(d[0]);function n(t){return String(t||'').toUpperCase()}},2644,[2556]);
183
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2645,[2646]);
184
+ __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"addColAfterCommand",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(_e,"addColBeforeCommand",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(_e,"addRowAfterCommand",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(_e,"addRowBeforeCommand",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(_e,"addRowWithAlignment",{enumerable:!0,get:function(){return F}}),Object.defineProperty(_e,"autoInsertSpanPlugin",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"columnResizingPlugin",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"commands",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"createTable",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"deleteSelectedCellsCommand",{enumerable:!0,get:function(){return J}}),Object.defineProperty(_e,"exitTable",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"extendListItemSchemaForTask",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(_e,"footnoteDefinitionSchema",{enumerable:!0,get:function(){return de}}),Object.defineProperty(_e,"footnoteReferenceSchema",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"getAllCellsInTable",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"getCellsInCol",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"getCellsInRow",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"gfm",{enumerable:!0,get:function(){return Oe}}),Object.defineProperty(_e,"goToNextTableCellCommand",{enumerable:!0,get:function(){return K}}),Object.defineProperty(_e,"goToPrevTableCellCommand",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"inputRules",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"insertTableCommand",{enumerable:!0,get:function(){return G}}),Object.defineProperty(_e,"insertTableInputRule",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(_e,"keepTableAlignPlugin",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"keymap",{enumerable:!0,get:function(){return me}}),Object.defineProperty(_e,"markInputRules",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(_e,"moveColCommand",{enumerable:!0,get:function(){return V}}),Object.defineProperty(_e,"moveRowCommand",{enumerable:!0,get:function(){return W}}),Object.defineProperty(_e,"pasteRules",{enumerable:!0,get:function(){return be}}),Object.defineProperty(_e,"plugins",{enumerable:!0,get:function(){return we}}),Object.defineProperty(_e,"remarkGFMPlugin",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(_e,"schema",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(_e,"selectCol",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"selectColCommand",{enumerable:!0,get:function(){return U}}),Object.defineProperty(_e,"selectLine",{enumerable:!0,get:function(){return _}}),Object.defineProperty(_e,"selectRow",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"selectRowCommand",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"selectTable",{enumerable:!0,get:function(){return L}}),Object.defineProperty(_e,"selectTableCommand",{enumerable:!0,get:function(){return X}}),Object.defineProperty(_e,"setAlignCommand",{enumerable:!0,get:function(){return te}}),Object.defineProperty(_e,"strikethroughAttr",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"strikethroughInputRule",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"strikethroughKeymap",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"strikethroughSchema",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"tableCellSchema",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"tableEditingPlugin",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(_e,"tableHeaderRowSchema",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"tableHeaderSchema",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"tableKeymap",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(_e,"tablePasteRule",{enumerable:!0,get:function(){return re}}),Object.defineProperty(_e,"tableRowSchema",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"tableSchema",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"toggleStrikethroughCommand",{enumerable:!0,get:function(){return T}}),Object.defineProperty(_e,"wrapInTaskListInputRule",{enumerable:!0,get:function(){return se}});var e,t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),c=r(d[4]),i=r(d[5]),u=r(d[6]),s=r(d[7]),p=r(d[8]),f=r(d[9]),b=r(d[10]),h=r(d[11]),y=(e=h)&&e.__esModule?e:{default:e};function C(e,t){return Object.assign(e,{meta:{package:"@milkdown/preset-gfm",...t}}),e}var N=(0,l.$markAttr)("strike_through");C(N,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var k=(0,l.$markSchema)("strike_through",e=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>"line-through"===e}],toDOM:t=>["del",e.get(N.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")}}}));C(k.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"}),C(k.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var T=(0,l.$command)("ToggleStrikeThrough",e=>()=>(0,o.toggleMark)(k.type(e)));C(T,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var S=(0,l.$inputRule)(e=>(0,n.markRule)(/(?<![\w:/])(~{1,2})(.+?)\1(?!\w|\/)$/,k.type(e)));C(S,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var w=(0,l.$useKeymap)("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(T.key)}}});function P(e,t){const n=t.content.firstChild;if(1!==t.childCount||"paragraph"!==n?.type.name)return void e.next(t.content);const o=n.lastChild,l="hardbreak"===o?.type.name?n.content.cut(0,n.content.size-o.nodeSize):n.content;e.next(l)}C(w.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"}),C(w.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var v=(0,c.tableNodes)({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:e=>e.style.textAlign||"left",setDOMAttr:(e,t)=>{t.style=`text-align: ${e||"left"}`}}}}),O=(0,l.$nodeSchema)("table",()=>({...v.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:e=>"table"===e.type,runner:(e,t,n)=>{const o=t.align,l=t.children.map((e,t)=>({...e,align:o,isHeader:0===t}));e.openNode(n),e.next(l),e.closeNode()}},toMarkdown:{match:e=>"table"===e.type.name,runner:(e,t)=>{const n=t.content.firstChild?.content;if(!n)return;const o=[];n.forEach(e=>{o.push(e.attrs.alignment)}),e.openNode("table",void 0,{align:o}),e.next(t.content),e.closeNode()}}}));C(O.node,{displayName:"NodeSchema<table>",group:"Table"}),C(O.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var x=(0,l.$nodeSchema)("table_header_row",()=>({...v.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=>Boolean("tableRow"===e.type&&e.isHeader),runner:(e,t,n)=>{const o=t.align,l=t.children.map((e,n)=>({...e,align:o[n],isHeader:t.isHeader}));e.openNode(n),e.next(l),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())}}}));C(x.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"}),C(x.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var M=(0,l.$nodeSchema)("table_row",()=>({...v.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:e=>"tableRow"===e.type,runner:(e,t,n)=>{const o=t.align,l=t.children.map((e,t)=>({...e,align:o[t]}));e.openNode(n),e.next(l),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())}}}));C(M.node,{displayName:"NodeSchema<tableRow>",group:"Table"}),C(M.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var R=(0,l.$nodeSchema)("table_cell",()=>({...v.table_cell,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!e.isHeader,runner:(e,t,n)=>{const o=t.align;e.openNode(n,{alignment:o}).openNode(e.schema.nodes.paragraph).next(t.children).closeNode().closeNode()}},toMarkdown:{match:e=>"table_cell"===e.type.name,runner:(e,t)=>{e.openNode("tableCell"),P(e,t),e.closeNode()}}}));C(R.node,{displayName:"NodeSchema<tableCell>",group:"Table"}),C(R.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var j=(0,l.$nodeSchema)("table_header",()=>({...v.table_header,disableDropCursor:!0,parseMarkdown:{match:e=>"tableCell"===e.type&&!!e.isHeader,runner:(e,t,n)=>{const o=t.align;e.openNode(n,{alignment:o}),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"),P(e,t),e.closeNode()}}}));function A(e,t=3,n=3){const o=Array(n).fill(0).map(()=>R.type(e).createAndFill()),l=Array(n).fill(0).map(()=>j.type(e).createAndFill()),c=Array(t).fill(0).map((t,n)=>0===n?x.type(e).create(null,l):M.type(e).create(null,o));return O.type(e).create(null,c)}function $(e,t){const n=(0,c.findTable)(t.$from);if(!n)return;const o=c.TableMap.get(n.node);return(Array.isArray(e)?e:[e]).filter(e=>e>=0&&e<=o.width-1).flatMap(e=>o.cellsInRect({left:e,right:e+1,top:0,bottom:o.height}).map(e=>{const t=n.node.nodeAt(e),o=e+n.start;return{pos:o,start:o+1,node:t,depth:n.depth+2}}))}function I(e,t){const n=(0,c.findTable)(t.$from);if(!n)return;const o=c.TableMap.get(n.node);return(Array.isArray(e)?e:[e]).filter(e=>e>=0&&e<=o.height-1).flatMap(e=>o.cellsInRect({left:0,right:o.width,top:e,bottom:e+1}).map(e=>{const t=n.node.nodeAt(e),o=e+n.start;return{pos:o,start:o+1,node:t,depth:n.depth+2}}))}function _(e){return(t,o)=>l=>{o=o??l.selection.from;const i=l.doc.resolve(o),u=(0,n.findParentNodeClosestToPos)(e=>"table"===e.type.name)(i),s=u?{node:u.node,from:u.start}:void 0,p="row"===e;if(s){const e=c.TableMap.get(s.node);if(t>=0&&t<(p?e.height:e.width)){const o=e.positionAt(p?t:e.height-1,p?e.width-1:t,s.node),i=l.doc.resolve(s.from+o),u=p?c.CellSelection.rowSelection:c.CellSelection.colSelection,f=e.positionAt(p?t:0,p?0:t,s.node),b=l.doc.resolve(s.from+f);return(0,n.cloneTr)(l.setSelection(u(i,b)))}}return l}}C(j.node,{displayName:"NodeSchema<tableHeader>",group:"Table"}),C(j.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});var D=_("row"),E=_("col");function F(e,t,{map:n,tableStart:o,table:l},c){const i=Array(c).fill(0).reduce((e,t,n)=>e+l.child(n).nodeSize,o),u=Array(n.width).fill(0).map((t,o)=>{const c=l.nodeAt(n.map[o]);return R.type(e).createAndFill({alignment:c?.attrs.alignment})});return t.insert(i,M.type(e).create(null,u)),t}function H(e){const t=(0,c.findTable)(e.$from);if(!t)return;const n=c.TableMap.get(t.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(e=>{const n=t.node.nodeAt(e),o=e+t.start;return{pos:o,start:o+1,node:n}})}function L(e){const t=H(e.selection);if(t&&t[0]){const o=e.doc.resolve(t[0].pos),l=t[t.length-1];if(l){const t=e.doc.resolve(l.pos);return(0,n.cloneTr)(e.setSelection(new c.CellSelection(t,o)))}}return e}var B=(0,l.$command)("GoToPrevTableCell",()=>()=>(0,c.goToNextCell)(-1));C(B,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var K=(0,l.$command)("GoToNextTableCell",()=>()=>(0,c.goToNextCell)(1));C(K,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var z=(0,l.$command)("ExitTable",e=>()=>(t,o)=>{if(!(0,c.isInTable)(t))return!1;const{$head:l}=t.selection,s=(0,n.findParentNodeType)(l,O.type(e));if(!s)return!1;const{to:p}=s,f=t.tr.replaceWith(p,p,i.paragraphSchema.type(e).createAndFill());return f.setSelection(u.Selection.near(f.doc.resolve(p),1)).scrollIntoView(),o?.(f),!0});C(z,{displayName:"Command<breakTableCommand>",group:"Table"});var G=(0,l.$command)("InsertTable",e=>({row:t,col:n}={})=>(o,l)=>{const{selection:c,tr:i}=o,{from:s}=c,p=A(e,t,n),f=i.replaceSelectionWith(p),b=u.Selection.findFrom(f.doc.resolve(s),1,!0);return b&&f.setSelection(b),l?.(f),!0});C(G,{displayName:"Command<insertTableCommand>",group:"Table"});var W=(0,l.$command)("MoveRow",()=>({from:e,to:t,pos:n}={})=>(0,c.moveTableRow)({from:e??0,to:t??0,pos:n}));C(W,{displayName:"Command<moveRowCommand>",group:"Table"});var V=(0,l.$command)("MoveCol",()=>({from:e,to:t,pos:n}={})=>(0,c.moveTableColumn)({from:e??0,to:t??0,pos:n}));C(V,{displayName:"Command<moveColCommand>",group:"Table"});var q=(0,l.$command)("SelectRow",()=>(e={index:0})=>(t,n)=>{const{tr:o}=t,l=n?.(D(e.index,e.pos)(o));return Boolean(l)});C(q,{displayName:"Command<selectRowCommand>",group:"Table"});var U=(0,l.$command)("SelectCol",()=>(e={index:0})=>(t,n)=>{const{tr:o}=t,l=n?.(E(e.index,e.pos)(o));return Boolean(l)});C(U,{displayName:"Command<selectColCommand>",group:"Table"});var X=(0,l.$command)("SelectTable",()=>()=>(e,t)=>{const{tr:n}=e,o=t?.(L(n));return Boolean(o)});C(X,{displayName:"Command<selectTableCommand>",group:"Table"});var J=(0,l.$command)("DeleteSelectedCells",()=>()=>(e,t)=>{const{selection:n}=e;if(!(n instanceof c.CellSelection))return!1;const o=n.isRowSelection(),l=n.isColSelection();return o&&l?(0,c.deleteTable)(e,t):l?(0,c.deleteColumn)(e,t):(0,c.deleteRow)(e,t)});C(J,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var Q=(0,l.$command)("AddColBefore",()=>()=>c.addColumnBefore);C(Q,{displayName:"Command<addColBeforeCommand>",group:"Table"});var Y=(0,l.$command)("AddColAfter",()=>()=>c.addColumnAfter);C(Y,{displayName:"Command<addColAfterCommand>",group:"Table"});var Z=(0,l.$command)("AddRowBefore",e=>()=>(t,n)=>{if(!(0,c.isInTable)(t))return!1;if(n){const o=(0,c.selectedRect)(t);n(F(e,t.tr,o,o.top))}return!0});C(Z,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var ee=(0,l.$command)("AddRowAfter",e=>()=>(t,n)=>{if(!(0,c.isInTable)(t))return!1;if(n){const o=(0,c.selectedRect)(t);n(F(e,t.tr,o,o.bottom))}return!0});C(ee,{displayName:"Command<addRowAfterCommand>",group:"Table"});var te=(0,l.$command)("SetAlign",()=>(e="left")=>(0,c.setCellAttr)("alignment",e));C(te,{displayName:"Command<setAlignCommand>",group:"Table"});var ne=(0,l.$inputRule)(e=>new s.InputRule(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(t,n,o,l)=>{const c=t.doc.resolve(o);if(!c.node(-1).canReplaceWith(c.index(-1),c.indexAfter(-1),O.type(e)))return null;const i=A(e,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),s=t.tr.replaceRangeWith(o,l,i);return s.setSelection(u.TextSelection.create(s.doc,o+3)).scrollIntoView()}));C(ne,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var re=(0,l.$pasteRule)(e=>({run:(t,n,o)=>{if(o)return t;function l(t){const n=t.childCount,o=t.lastChild?.childCount??0;if(0===n||0===o)return i.paragraphSchema.type(e).create();const l=t.firstChild;if(!(o>0&&l&&0===l.childCount))return t;if(n>=3){const o=t.child(1),c=[];for(let t=0;t<o.childCount;t++){const n=o.child(t);c.push(j.type(e).create(n.attrs,n.content,n.marks))}const i=l.type.create(l.attrs,c),u=[];for(let e=2;e<n;e++)u.push(t.child(e));return t.type.create(t.attrs,[i,...u])}const c=Array(o).fill(0).map(()=>j.type(e).createAndFill()),u=new p.Slice(p.Fragment.from(c),0,0),s=l.replace(0,0,u);return t.replace(0,l.nodeSize,new p.Slice(p.Fragment.from(s),0,0))}function c(t){const n=M.type(e),o=[];let c=[],i=!1;function u(){if(0===c.length)return;const t=x.type(e).createAndFill(),n=O.type(e).create(null,[t,...c]);o.push(l(n)),c=[]}return t.forEach(e=>{e.type===n?(i=!0,c.push(e)):(u(),o.push(e))}),u(),i?p.Fragment.from(o):t}let u=(function t(n){let o=c(n),i=o!==n;const u=[];return o.forEach(n=>{if(n.type===O.type(e)){const e=l(n);e!==n&&(i=!0),u.push(e)}else if(n.childCount>0){const e=t(n.content);e!==n.content?(i=!0,u.push(n.copy(e))):u.push(n)}else u.push(n)}),i?p.Fragment.from(u):n})(t.content);return u=(function(t){const n=[],o=[];t.forEach(e=>o.push(e));for(let t=0;t<o.length;t++){const l=o[t],c=o[t+1];l.type===i.paragraphSchema.type(e)&&0===l.content.size&&c&&c.type===O.type(e)||n.push(l)}return n.length<o.length?p.Fragment.from(n):t})(u),new p.Slice(p.Fragment.from(u),t.openStart,t.openEnd)}}));C(re,{displayName:"PasteRule<table>",group:"Table"});var oe=(0,l.$useKeymap)("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(K.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(B.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:e=>{const n=e.get(t.commandsCtx);return()=>n.call(z.key)}}});C(oe.ctx,{displayName:"KeymapCtx<table>",group:"Table"}),C(oe.shortcuts,{displayName:"Keymap<table>",group:"Table"});var ae="footnote_definition",le="footnoteDefinition",de=(0,l.$nodeSchema)("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${ae}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,f.expectDomTypeError)(e);return{label:e.dataset.label}},contentElement:"dd"}],toDOM:e=>{const t=e.attrs.label;return["dl",{"data-label":t,"data-type":ae},["dt",t],["dd",0]]},parseMarkdown:{match:({type:e})=>e===le,runner:(e,t,n)=>{e.openNode(n,{label:t.label}).next(t.children).closeNode()}},toMarkdown:{match:e=>e.type.name===ae,runner:(e,t)=>{e.openNode(le,void 0,{label:t.attrs.label,identifier:t.attrs.label}).next(t.content).closeNode()}}}));C(de.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"}),C(de.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var ce="footnote_reference",ie=(0,l.$nodeSchema)("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${ce}"]`,getAttrs:e=>{if(!(e instanceof HTMLElement))throw(0,f.expectDomTypeError)(e);return{label:e.dataset.label}}}],toDOM:e=>{const t=e.attrs.label;return["sup",{"data-label":t,"data-type":ce},t]},parseMarkdown:{match:({type:e})=>"footnoteReference"===e,runner:(e,t,n)=>{e.addNode(n,{label:t.label})}},toMarkdown:{match:e=>e.type.name===ce,runner:(e,t)=>{e.addNode("footnoteReference",void 0,void 0,{label:t.attrs.label,identifier:t.attrs.label})}}}));C(ie.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"}),C(ie.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var ue=i.listItemSchema.extendSchema(e=>t=>{const 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(0,f.expectDomTypeError)(e);return{label:e.dataset.label,listType:e.dataset.listType,spread:"true"===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,o)=>{if(null==t.checked)return void n.parseMarkdown.runner(e,t,o);const l=null!=t.label?`${t.label}.`:"\u2022",c=null!=t.checked?Boolean(t.checked):null,i=null!=t.label?"ordered":"bullet",u=t.spread??!0;e.openNode(o,{label:l,listType:i,spread:u,checked:c}),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);const o=t.attrs.label,l=t.attrs.listType,c=t.attrs.spread,i=t.attrs.checked;e.openNode("listItem",void 0,{label:o,listType:l,spread:c,checked:i}),e.next(t.content),e.closeNode()}}}});C(ue.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"}),C(ue.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var se=(0,l.$inputRule)(()=>new s.InputRule(/^\[(?<checked>\s|x)\]\s$/,(e,t,n,o)=>{const l=e.doc.resolve(n);let c=0,i=l.node(c);for(;i&&"list_item"!==i.type.name;)c--,i=l.node(c);if(!i||null!=i.attrs.checked)return null;const u=Boolean("x"===t.groups?.checked),s=l.before(c),p=e.tr;return p.deleteRange(n,o).setNodeMarkup(s,void 0,{...i.attrs,checked:u}),p}));C(se,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var me=[w,oe].flat(),pe=[ne,se],fe=[S],be=[re],ge=(0,l.$prose)(()=>b.imeSpan);C(ge,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});var he=(0,l.$prose)(()=>(0,c.columnResizing)({}));C(he,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var ye=(0,l.$prose)(()=>(0,c.tableEditing)({allowTableNodeSelection:!0}));C(ye,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var Ce=(0,l.$remark)("remarkGFM",()=>y.default);C(Ce.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"}),C(Ce.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var Ne=new u.PluginKey("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function ke(e,t){let n=0;return t.forEach((t,o,l)=>{t===e&&(n=l)}),n}function Te(e,t){const n=e.content.findDiffStart(t.content);if(null==n)return null;const o=e.content.findDiffEnd(t.content);return o?{from:n,to:Math.max(o.b,n)}:null}var Se=(0,l.$prose)(()=>new u.Plugin({key:Ne,appendTransaction:(e,t,n)=>{if(t.doc===n.doc)return;const o=Te(t.doc,n.doc);if(!o)return;let l;const c=(e,t)=>{if("table_cell"!==e.type.name)return;const o=n.doc.resolve(t),c=o.node(o.depth),i=o.node(o.depth-1).firstChild;if(!i)return;const u=ke(e,c),s=i.maybeChild(u);if(!s)return;const p=s.attrs.alignment;p!==e.attrs.alignment&&(l||(l=n.tr),l.setNodeMarkup(t,void 0,{...e.attrs,alignment:p}))};return n.doc.nodesBetween(o.from,o.to,(e,t)=>"table"!==e.type.name||(n.doc.nodesBetween(t,t+e.nodeSize,c),!1)),l}}));C(Se,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var we=[Se,ge,Ce,ye].flat(),Pe=[ue,O,x,M,j,R,de,ie,N,k].flat(),ve=[K,B,z,G,W,V,q,U,X,J,Z,ee,Q,Y,te,T],Oe=[Pe,pe,be,fe,me,ve,we].flat()},2646,[2465,2618,2611,2633,2647,2637,2623,2624,2617,2467,2649,2650]);
185
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2647,[2648]);
186
+ __d(function(g,_r,_i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CellBookmark",{enumerable:!0,get:function(){return D}}),Object.defineProperty(_e,"CellSelection",{enumerable:!0,get:function(){return E}}),Object.defineProperty(_e,"ResizeState",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(_e,"TableMap",{enumerable:!0,get:function(){return s}}),Object.defineProperty(_e,"TableView",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(_e,"__clipCells",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(_e,"__insertCells",{enumerable:!0,get:function(){return Ke}}),Object.defineProperty(_e,"__pastedCells",{enumerable:!0,get:function(){return Te}}),Object.defineProperty(_e,"addColSpan",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"addColumn",{enumerable:!0,get:function(){return se}}),Object.defineProperty(_e,"addColumnAfter",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(_e,"addColumnBefore",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(_e,"addRow",{enumerable:!0,get:function(){return fe}}),Object.defineProperty(_e,"addRowAfter",{enumerable:!0,get:function(){return me}}),Object.defineProperty(_e,"addRowBefore",{enumerable:!0,get:function(){return he}}),Object.defineProperty(_e,"cellAround",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"cellNear",{enumerable:!0,get:function(){return $}}),Object.defineProperty(_e,"colCount",{enumerable:!0,get:function(){return j}}),Object.defineProperty(_e,"columnIsHeader",{enumerable:!0,get:function(){return k}}),Object.defineProperty(_e,"columnResizing",{enumerable:!0,get:function(){return rt}}),Object.defineProperty(_e,"columnResizingPluginKey",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(_e,"deleteCellSelection",{enumerable:!0,get:function(){return ke}}),Object.defineProperty(_e,"deleteColumn",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(_e,"deleteRow",{enumerable:!0,get:function(){return we}}),Object.defineProperty(_e,"deleteTable",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(_e,"findCell",{enumerable:!0,get:function(){return M}}),Object.defineProperty(_e,"findCellPos",{enumerable:!0,get:function(){return U}}),Object.defineProperty(_e,"findCellRange",{enumerable:!0,get:function(){return J}}),Object.defineProperty(_e,"findTable",{enumerable:!0,get:function(){return q}}),Object.defineProperty(_e,"fixTables",{enumerable:!0,get:function(){return B}}),Object.defineProperty(_e,"fixTablesKey",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"goToNextCell",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(_e,"handlePaste",{enumerable:!0,get:function(){return Ye}}),Object.defineProperty(_e,"inSameTable",{enumerable:!0,get:function(){return R}}),Object.defineProperty(_e,"isInTable",{enumerable:!0,get:function(){return S}}),Object.defineProperty(_e,"mergeCells",{enumerable:!0,get:function(){return ye}}),Object.defineProperty(_e,"moveCellForward",{enumerable:!0,get:function(){return P}}),Object.defineProperty(_e,"moveTableColumn",{enumerable:!0,get:function(){return De}}),Object.defineProperty(_e,"moveTableRow",{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(_e,"nextCell",{enumerable:!0,get:function(){return x}}),Object.defineProperty(_e,"pointsAtCell",{enumerable:!0,get:function(){return O}}),Object.defineProperty(_e,"removeColSpan",{enumerable:!0,get:function(){return z}}),Object.defineProperty(_e,"removeColumn",{enumerable:!0,get:function(){return de}}),Object.defineProperty(_e,"removeRow",{enumerable:!0,get:function(){return ge}}),Object.defineProperty(_e,"rowIsHeader",{enumerable:!0,get:function(){return pe}}),Object.defineProperty(_e,"selectedRect",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(_e,"selectionCell",{enumerable:!0,get:function(){return A}}),Object.defineProperty(_e,"setCellAttr",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(_e,"splitCell",{enumerable:!0,get:function(){return ve}}),Object.defineProperty(_e,"splitCellWithType",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(_e,"tableEditing",{enumerable:!0,get:function(){return bt}}),Object.defineProperty(_e,"tableEditingKey",{enumerable:!0,get:function(){return C}}),Object.defineProperty(_e,"tableNodeTypes",{enumerable:!0,get:function(){return b}}),Object.defineProperty(_e,"tableNodes",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"toggleHeader",{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(_e,"toggleHeaderCell",{enumerable:!0,get:function(){return je}}),Object.defineProperty(_e,"toggleHeaderColumn",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(_e,"toggleHeaderRow",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(_e,"updateColumnsOnResize",{enumerable:!0,get:function(){return nt}});var e=_r(_d[0]),t=_r(_d[1]),n=_r(_d[2]),o=_r(_d[3]),r=_r(_d[4]);let l,i;if("undefined"!=typeof WeakMap){let e=new WeakMap;l=t=>e.get(t),i=(t,n)=>(e.set(t,n),n)}else{const e=[],t=10;let n=0;l=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},i=(o,r)=>(n==t&&(n=0),e[n++]=o,e[n++]=r)}var s=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const o=t%this.width,r=t/this.width|0;let l=o+1,i=r+1;for(let e=1;l<this.width&&this.map[t+e]==n;e++)l++;for(let e=1;i<this.height&&this.map[t+this.width*e]==n;e++)i++;return{left:o,top:r,right:l,bottom:i}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:o,right:r,top:l,bottom:i}=this.findCell(e);return"horiz"==t?(n<0?0==o:r==this.width)?null:this.map[l*this.width+(n<0?o-1:r)]:(n<0?0==l:i==this.height)?null:this.map[o+this.width*(n<0?l-1:i)]}rectBetween(e,t){const{left:n,right:o,top:r,bottom:l}=this.findCell(e),{left:i,right:s,top:c,bottom:a}=this.findCell(t);return{left:Math.min(n,i),top:Math.min(r,c),right:Math.max(o,s),bottom:Math.max(l,a)}}cellsInRect(e){const t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let r=e.left;r<e.right;r++){const l=o*this.width+r,i=this.map[l];n[i]||(n[i]=!0,r==e.left&&r&&this.map[l-1]==i||o==e.top&&o&&this.map[l-this.width]==i||t.push(i))}return t}positionAt(e,t,n){for(let o=0,r=0;;o++){const l=r+n.child(o).nodeSize;if(o==e){let n=t+e*this.width;const o=(e+1)*this.width;for(;n<o&&this.map[n]<r;)n++;return n==o?l-1:this.map[n]}r=l}}static get(e){return l(e)||i(e,c(e))}};function c(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);const t=a(e),n=e.childCount,o=[];let r=0,l=null;const i=[];for(let e=0,r=t*n;e<r;e++)o[e]=0;for(let s=0,c=0;s<n;s++){const a=e.child(s);c++;for(let e=0;;e++){for(;r<o.length&&0!=o[r];)r++;if(e==a.childCount)break;const d=a.child(e),{colspan:u,rowspan:p,colwidth:f}=d.attrs;for(let e=0;e<p;e++){if(e+s>=n){(l||(l=[])).push({type:"overlong_rowspan",pos:c,n:p-e});break}const a=r+e*t;for(let e=0;e<u;e++){0==o[a+e]?o[a+e]=c:(l||(l=[])).push({type:"collision",row:s,pos:c,n:u-e});const n=f&&f[e];if(n){const o=(a+e)%t*2,r=i[o];null==r||r!=n&&1==i[o+1]?(i[o]=n,i[o+1]=1):r==n&&i[o+1]++}}}r+=u,c+=d.nodeSize}const d=(s+1)*t;let u=0;for(;r<d;)0==o[r++]&&u++;u&&(l||(l=[])).push({type:"missing",row:s,n:u}),c++}0!==t&&0!==n||(l||(l=[])).push({type:"zero_sized"});const c=new s(t,n,o,l);let u=!1;for(let e=0;!u&&e<i.length;e+=2)null!=i[e]&&i[e+1]<n&&(u=!0);return u&&d(c,i,e),c}function a(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){const r=e.child(o);let l=0;if(n)for(let t=0;t<o;t++){const n=e.child(t);for(let e=0;e<n.childCount;e++){const r=n.child(e);t+r.attrs.rowspan>o&&(l+=r.attrs.colspan)}}for(let e=0;e<r.childCount;e++){const t=r.child(e);l+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=l:t!=l&&(t=Math.max(t,l))}return t}function d(e,t,n){e.problems||(e.problems=[]);const o={};for(let r=0;r<e.map.length;r++){const l=e.map[r];if(o[l])continue;o[l]=!0;const i=n.nodeAt(l);if(!i)throw new RangeError(`No cell with offset ${l} found`);let s=null;const c=i.attrs;for(let n=0;n<c.colspan;n++){const o=t[(r+n)%e.width*2];null==o||c.colwidth&&c.colwidth[n]==o||((s||(s=u(c)))[n]=o)}s&&e.problems.unshift({type:"colwidth mismatch",pos:l,colwidth:s})}}function u(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function p(e,t){if("string"==typeof e)return{};const n=e.getAttribute("data-colwidth"),o=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map(e=>Number(e)):null,r=Number(e.getAttribute("colspan")||1),l={colspan:r,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:o&&o.length==r?o:null};for(const n in t){const o=t[n].getFromDOM,r=o&&o(e);null!=r&&(l[n]=r)}return l}function f(e,t){const n={};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(","));for(const o in t){const r=t[o].setDOMAttr;r&&r(e.attrs[o],n)}return n}function h(e){if(null!==e){if(!Array.isArray(e))throw new TypeError("colwidth must be null or an array");for(const t of e)if("number"!=typeof t)throw new TypeError("colwidth must be null or an array of numbers")}}function w(e){const t=e.cellAttributes||{},n={colspan:{default:1,validate:"number"},rowspan:{default:1,validate:"number"},colwidth:{default:null,validate:h}};for(const 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=>p(e,t)}],toDOM:e=>["td",f(e,t),0]},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:e=>p(e,t)}],toDOM:e=>["th",f(e,t),0]}}}function b(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const o=e.nodes[n],r=o.spec.tableRole;r&&(t[r]=o)}}return t}const C=new e.PluginKey("selectingCells");function y(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 v(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}function S(e){const 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 A(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&"cell"==t.node.type.spec.tableRole)return t.$anchor;const n=y(t.$head)||$(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function $(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const o=t.type.spec.tableRole;if("cell"==o||"header_cell"==o)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const o=t.type.spec.tableRole;if("cell"==o||"header_cell"==o)return e.doc.resolve(n-t.nodeSize)}}function O(e){return"row"==e.parent.type.spec.tableRole&&!!e.nodeAfter}function P(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function R(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function M(e){return s.get(e.node(-1)).findCell(e.pos-e.start(-1))}function j(e){return s.get(e.node(-1)).colCount(e.pos-e.start(-1))}function x(e,t,n){const o=e.node(-1),r=s.get(o),l=e.start(-1),i=r.nextCell(e.pos-l,t,n);return null==i?null:e.node(0).resolve(l+i)}function z(e,t,n=1){const o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(e=>e>0)||(o.colwidth=null)),o}function N(e,t,n=1){const o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let e=0;e<n;e++)o.colwidth.splice(t,0,0)}return o}function k(e,t,n){const o=b(t.type.schema).header_cell;for(let r=0;r<e.height;r++)if(t.nodeAt(e.map[n+r*e.width]).type!=o)return!1;return!0}var E=class n extends e.Selection{constructor(t,n=t){const o=t.node(-1),r=s.get(o),l=t.start(-1),i=r.rectBetween(t.pos-l,n.pos-l),c=t.node(0),a=r.cellsInRect(i).filter(e=>e!=n.pos-l);a.unshift(n.pos-l);const d=a.map(t=>{const n=o.nodeAt(t);if(!n)throw new RangeError(`No cell with offset ${t} found`);const r=l+t+1;return new e.SelectionRange(c.resolve(r),c.resolve(r+n.content.size))});super(d[0].$from,d[0].$to,d),this.$anchorCell=t,this.$headCell=n}map(t,o){const r=t.resolve(o.map(this.$anchorCell.pos)),l=t.resolve(o.map(this.$headCell.pos));if(O(r)&&O(l)&&R(r,l)){const e=this.$anchorCell.node(-1)!=r.node(-1);return e&&this.isRowSelection()?n.rowSelection(r,l):e&&this.isColSelection()?n.colSelection(r,l):new n(r,l)}return e.TextSelection.between(r,l)}content(){const e=this.$anchorCell.node(-1),n=s.get(e),o=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),l={},i=[];for(let o=r.top;o<r.bottom;o++){const s=[];for(let t=o*n.width+r.left,i=r.left;i<r.right;i++,t++){const o=n.map[t];if(l[o])continue;l[o]=!0;const i=n.findCell(o);let c=e.nodeAt(o);if(!c)throw new RangeError(`No cell with offset ${o} found`);const a=r.left-i.left,d=i.right-r.right;if(a>0||d>0){let e=c.attrs;if(a>0&&(e=z(e,0,a)),d>0&&(e=z(e,e.colspan-d,d)),i.left<r.left){if(c=c.type.createAndFill(e),!c)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(i.top<r.top||i.bottom>r.bottom){const e={...c.attrs,rowspan:Math.min(i.bottom,r.bottom)-Math.max(i.top,r.top)};c=i.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}s.push(c)}i.push(e.child(o).copy(t.Fragment.from(s)))}const c=this.isColSelection()&&this.isRowSelection()?e:i;return new t.Slice(t.Fragment.from(c),1,1)}replace(n,o=t.Slice.empty){const r=n.steps.length,l=this.ranges;for(let e=0;e<l.length;e++){const{$from:i,$to:s}=l[e],c=n.mapping.slice(r);n.replace(c.map(i.pos),c.map(s.pos),e?t.Slice.empty:o)}const i=e.Selection.findFrom(n.doc.resolve(n.mapping.slice(r).map(this.to)),-1);i&&n.setSelection(i)}replaceWith(e,n){this.replace(e,new t.Slice(t.Fragment.from(n),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),n=s.get(t),o=this.$anchorCell.start(-1),r=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let n=0;n<r.length;n++)e(t.nodeAt(r[n]),o+r[n])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,o)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const o=e.node(-1),r=s.get(o),l=e.start(-1),i=r.findCell(e.pos-l),c=r.findCell(t.pos-l),a=e.node(0);return i.top<=c.top?(i.top>0&&(e=a.resolve(l+r.map[i.left])),c.bottom<r.height&&(t=a.resolve(l+r.map[r.width*(r.height-1)+c.right-1]))):(c.top>0&&(t=a.resolve(l+r.map[c.left])),i.bottom<r.height&&(e=a.resolve(l+r.map[r.width*(r.height-1)+i.right-1]))),new n(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=s.get(e),n=this.$anchorCell.start(-1),o=t.colCount(this.$anchorCell.pos-n),r=t.colCount(this.$headCell.pos-n);if(Math.min(o,r)>0)return!1;const l=o+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,i)==t.width}eq(e){return e instanceof n&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const o=e.node(-1),r=s.get(o),l=e.start(-1),i=r.findCell(e.pos-l),c=r.findCell(t.pos-l),a=e.node(0);return i.left<=c.left?(i.left>0&&(e=a.resolve(l+r.map[i.top*r.width])),c.right<r.width&&(t=a.resolve(l+r.map[r.width*(c.top+1)-1]))):(c.left>0&&(t=a.resolve(l+r.map[c.top*r.width])),i.right<r.width&&(e=a.resolve(l+r.map[r.width*(i.top+1)-1]))),new n(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new n(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,o=t){return new n(e.resolve(t),e.resolve(o))}getBookmark(){return new D(this.$anchorCell.pos,this.$headCell.pos)}};E.prototype.visible=!1,e.Selection.jsonID("cell",E);var D=class t{constructor(e,t){this.anchor=e,this.head=t}map(e){return new t(e.map(this.anchor),e.map(this.head))}resolve(t){const n=t.resolve(this.anchor),o=t.resolve(this.head);return"row"==n.parent.type.spec.tableRole&&"row"==o.parent.type.spec.tableRole&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&R(n,o)?new E(n,o):e.Selection.near(o,1)}};function _(e){if(!(e.selection instanceof E))return null;const t=[];return e.selection.forEachCell((e,o)=>{t.push(n.Decoration.node(o,o+e.nodeSize,{class:"selectedCell"}))}),n.DecorationSet.create(e.doc,t)}function T({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,r=e.depth;for(;r>=0&&!(e.after(r+1)<e.end(r));r--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,o--);return n==o&&/row|table/.test(e.node(r).type.spec.tableRole)}function F({$from:e,$to:t}){let n,o;for(let t=e.depth;t>0;t--){const o=e.node(t);if("cell"===o.type.spec.tableRole||"header_cell"===o.type.spec.tableRole){n=o;break}}for(let e=t.depth;e>0;e--){const n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){o=n;break}}return n!==o&&0===t.parentOffset}function H(t,n,o){const r=(n||t).selection,l=(n||t).doc;let i,c;if(r instanceof e.NodeSelection&&(c=r.node.type.spec.tableRole)){if("cell"==c||"header_cell"==c)i=E.create(l,r.from);else if("row"==c){const e=l.resolve(r.from+1);i=E.rowSelection(e,e)}else if(!o){const e=s.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];i=E.create(l,t+1,n)}}else r instanceof e.TextSelection&&T(r)?i=e.TextSelection.create(l,r.from):r instanceof e.TextSelection&&F(r)&&(i=e.TextSelection.create(l,r.$from.start(),r.$from.end()));return i&&(n||(n=t.tr)).setSelection(i),n}const I=new e.PluginKey("fix-tables");function L(e,t,n,o){const r=e.childCount,l=t.childCount;e:for(let i=0,s=0;i<l;i++){const l=t.child(i);for(let t=s,o=Math.min(r,i+3);t<o;t++)if(e.child(t)==l){s=t+1,n+=l.nodeSize;continue e}o(l,n),s<r&&e.child(s).sameMarkup(l)?L(e.child(s),l,n+1,o):l.nodesBetween(0,l.content.size,o,n+1),n+=l.nodeSize}}function B(e,t){let n;const o=(t,o)=>{"table"==t.type.spec.tableRole&&(n=W(e,t,o,n))};return t?t.doc!=e.doc&&L(t.doc,e.doc,0,o):e.doc.descendants(o),n}function W(e,t,n,o){const r=s.get(t);if(!r.problems)return o;o||(o=e.tr);const l=[];for(let e=0;e<r.height;e++)l.push(0);for(let e=0;e<r.problems.length;e++){const i=r.problems[e];if("collision"==i.type){const e=t.nodeAt(i.pos);if(!e)continue;const r=e.attrs;for(let e=0;e<r.rowspan;e++)l[i.row+e]+=i.n;o.setNodeMarkup(o.mapping.map(n+1+i.pos),null,z(r,r.colspan-i.n,i.n))}else if("missing"==i.type)l[i.row]+=i.n;else if("overlong_rowspan"==i.type){const e=t.nodeAt(i.pos);if(!e)continue;o.setNodeMarkup(o.mapping.map(n+1+i.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-i.n})}else if("colwidth mismatch"==i.type){const e=t.nodeAt(i.pos);if(!e)continue;o.setNodeMarkup(o.mapping.map(n+1+i.pos),null,{...e.attrs,colwidth:i.colwidth})}else if("zero_sized"==i.type){const e=o.mapping.map(n);o.delete(e,e+t.nodeSize)}}let i,c;for(let e=0;e<l.length;e++)l[e]&&(null==i&&(i=e),c=e);for(let s=0,a=n+1;s<r.height;s++){const n=t.child(s),r=a+n.nodeSize,d=l[s];if(d>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);const l=[];for(let n=0;n<d;n++){const n=b(e.schema)[t].createAndFill();n&&l.push(n)}const u=0!=s&&i!=s-1||c!=s?r-1:a+1;o.insert(o.mapping.map(u),l)}a=r}return o.setMeta(I,{fixTables:!0})}function K(e){const t=s.get(e),n=[],o=t.height,r=t.width;for(let l=0;l<o;l++){const o=[];for(let n=0;n<r;n++){const i=l*r+n,s=t.map[i];if(l>0){const e=i-r;if(s===t.map[e]){o.push(null);continue}}if(n>0){const e=i-1;if(s===t.map[e]){o.push(null);continue}}o.push(e.nodeAt(s))}n.push(o)}return n}function V(e,t){const n=[],o=s.get(e),r=o.height,l=o.width;for(let i=0;i<r;i++){const r=e.child(i),s=[];for(let n=0;n<l;n++){const r=t[i][n];if(!r)continue;const l=o.map[i*o.width+n],c=e.nodeAt(l);if(!c)continue;const a=c.type.createChecked(r.attrs,r.content,r.marks);s.push(a)}const c=r.type.createChecked(r.attrs,s,r.marks);n.push(c)}return e.type.createChecked(e.attrs,n,e.marks)}function X(e,t,n,o){const r=t[0]>n[0]?-1:1,l=e.splice(t[0],t.length),i=l.length%2==0?1:0;let s;return s=-1===o&&1===r?n[0]-1:1===o&&-1===r?n[n.length-1]-i+1:-1===r?n[0]:n[n.length-1]-i,e.splice(s,0,...l),e}function q(e){return Y(e=>"table"===e.type.spec.tableRole,e)}function J(e,t,n){var o,r;if(null==t&&null==n&&e instanceof E)return[e.$anchorCell,e.$headCell];const l=null!==(o=null!=t?t:n)&&void 0!==o?o:e.anchor,i=null!==(r=null!=n?n:t)&&void 0!==r?r:e.head,s=e.$head.doc,c=U(s,l),a=U(s,i);return c&&a&&R(c,a)?[c,a]:null}function U(e,t){const n=e.resolve(t);return y(n)||$(n)}function Y(e,t){for(let n=t.depth;n>=0;n-=1){const o=t.node(n);if(e(o))return{node:o,pos:0===n?0:t.before(n),start:t.start(n),depth:n}}return null}function G(e,t){const n=q(t.$from);if(!n)return;const o=s.get(n.node);return e<0||e>o.width-1?void 0:o.cellsInRect({left:e,right:e+1,top:0,bottom:o.height}).map(e=>{const t=n.node.nodeAt(e),o=e+n.start;return{pos:o,start:o+1,node:t,depth:n.depth+2}})}function Q(e,t){const n=q(t.$from);if(!n)return;const o=s.get(n.node);return e<0||e>o.height-1?void 0:o.cellsInRect({left:0,right:o.width,top:e,bottom:e+1}).map(e=>{const t=n.node.nodeAt(e),o=e+n.start;return{pos:o,start:o+1,node:t,depth:n.depth+2}})}function Z(e,t,n=t){let o=t,r=n;for(let n=t;n>=0;n--){const t=G(n,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.colspan+n-1;t>=o&&(o=n),t>r&&(r=t)})}for(let n=t;n<=r;n++){const t=G(n,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.colspan+n-1;e.node.attrs.colspan>1&&t>r&&(r=t)})}const l=[];for(let t=o;t<=r;t++){const n=G(t,e.selection);n&&n.length>0&&l.push(t)}o=l[0],r=l[l.length-1];const i=G(o,e.selection),s=Q(0,e.selection);if(!i||!s)return;const c=e.doc.resolve(i[i.length-1].pos);let a;for(let t=r;t>=o;t--){const n=G(t,e.selection);if(n&&n.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){a=n[0];break}if(a)break}}return a?{$anchor:c,$head:e.doc.resolve(a.pos),indexes:l}:void 0}function ee(e,t,n=t){let o=t,r=n;for(let n=t;n>=0;n--){const t=Q(n,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.rowspan+n-1;t>=o&&(o=n),t>r&&(r=t)})}for(let n=t;n<=r;n++){const t=Q(n,e.selection);t&&t.forEach(e=>{const t=e.node.attrs.rowspan+n-1;e.node.attrs.rowspan>1&&t>r&&(r=t)})}const l=[];for(let t=o;t<=r;t++){const n=Q(t,e.selection);n&&n.length>0&&l.push(t)}o=l[0],r=l[l.length-1];const i=Q(o,e.selection),s=G(0,e.selection);if(!i||!s)return;const c=e.doc.resolve(i[i.length-1].pos);let a;for(let t=r;t>=o;t--){const n=Q(t,e.selection);if(n&&n.length>0){for(let e=s.length-1;e>=0;e--)if(s[e].pos===n[0].pos){a=n[0];break}if(a)break}}return a?{$anchor:c,$head:e.doc.resolve(a.pos),indexes:l}:void 0}function te(e){return e[0].map((t,n)=>e.map(e=>e[n]))}function ne(e){var t,n;const{tr:o,originIndex:r,targetIndex:l,select:i,pos:c}=e,a=q(o.doc.resolve(c));if(!a)return!1;const d=null===(t=Z(o,r))||void 0===t?void 0:t.indexes,u=null===(n=Z(o,l))||void 0===n?void 0:n.indexes;if(!d||!u)return!1;if(d.includes(l))return!1;const p=oe(a.node,d,u,0);if(o.replaceWith(a.pos,a.pos+a.node.nodeSize,p),!i)return!0;const f=s.get(p),h=a.start,w=l,b=f.positionAt(f.height-1,w,p),C=o.doc.resolve(h+b),y=f.positionAt(0,w,p),v=o.doc.resolve(h+y);return o.setSelection(E.colSelection(C,v)),!0}function oe(e,t,n,o){let r=te(K(e));return r=X(r,t,n,o),r=te(r),V(e,r)}function re(e){var t,n;const{tr:o,originIndex:r,targetIndex:l,select:i,pos:c}=e,a=q(o.doc.resolve(c));if(!a)return!1;const d=null===(t=ee(o,r))||void 0===t?void 0:t.indexes,u=null===(n=ee(o,l))||void 0===n?void 0:n.indexes;if(!d||!u)return!1;if(d.includes(l))return!1;const p=le(a.node,d,u,0);if(o.replaceWith(a.pos,a.pos+a.node.nodeSize,p),!i)return!0;const f=s.get(p),h=a.start,w=l,b=f.positionAt(w,f.width-1,p),C=o.doc.resolve(h+b),y=f.positionAt(w,0,p),v=o.doc.resolve(h+y);return o.setSelection(E.rowSelection(C,v)),!0}function le(e,t,n,o){let r=K(e);return r=X(r,t,n,o),V(e,r)}function ie(e){const t=e.selection,n=A(e),o=n.node(-1),r=n.start(-1),l=s.get(o);return{...t instanceof E?l.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r):l.findCell(n.pos-r),tableStart:r,map:l,table:o}}function se(e,{map:t,tableStart:n,table:o},r){let l=r>0?-1:0;k(t,o,r+l)&&(l=0==r||r==t.width?null:0);for(let i=0;i<t.height;i++){const s=i*t.width+r;if(r>0&&r<t.width&&t.map[s-1]==t.map[s]){const l=t.map[s],c=o.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,N(c.attrs,r-t.colCount(l))),i+=c.attrs.rowspan-1}else{const c=null==l?b(o.type.schema).cell:o.nodeAt(t.map[s+l]).type,a=t.positionAt(i,r,o);e.insert(e.mapping.map(n+a),c.createAndFill())}}return e}function ce(e,t){if(!S(e))return!1;if(t){const n=ie(e);t(se(e.tr,n,n.left))}return!0}function ae(e,t){if(!S(e))return!1;if(t){const n=ie(e);t(se(e.tr,n,n.right))}return!0}function de(e,{map:t,table:n,tableStart:o},r){const l=e.mapping.maps.length;for(let i=0;i<t.height;){const s=i*t.width+r,c=t.map[s],a=n.nodeAt(c),d=a.attrs;if(r>0&&t.map[s-1]==c||r<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(l).map(o+c),null,z(d,r-t.colCount(c)));else{const t=e.mapping.slice(l).map(o+c);e.delete(t,t+a.nodeSize)}i+=d.rowspan}}function ue(e,t){if(!S(e))return!1;if(t){const n=ie(e),o=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;de(o,n,e),e!=n.left;e--){const e=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!e)throw new RangeError("No table found");n.table=e,n.map=s.get(e)}t(o)}return!0}function pe(e,t,n){var o;const r=b(t.type.schema).header_cell;for(let l=0;l<e.width;l++)if((null===(o=t.nodeAt(e.map[l+n*e.width]))||void 0===o?void 0:o.type)!=r)return!1;return!0}function fe(e,{map:t,tableStart:n,table:o},r){let l=n;for(let e=0;e<r;e++)l+=o.child(e).nodeSize;const i=[];let s=r>0?-1:0;pe(t,o,r+s)&&(s=0==r||r==t.height?null:0);for(let l=0,a=t.width*r;l<t.width;l++,a++)if(r>0&&r<t.height&&t.map[a]==t.map[a-t.width]){const r=t.map[a],i=o.nodeAt(r).attrs;e.setNodeMarkup(n+r,null,{...i,rowspan:i.rowspan+1}),l+=i.colspan-1}else{var c;const e=null==s?b(o.type.schema).cell:null===(c=o.nodeAt(t.map[a+s*t.width]))||void 0===c?void 0:c.type,n=null==e?void 0:e.createAndFill();n&&i.push(n)}return e.insert(l,b(o.type.schema).row.create(null,i)),e}function he(e,t){if(!S(e))return!1;if(t){const n=ie(e);t(fe(e.tr,n,n.top))}return!0}function me(e,t){if(!S(e))return!1;if(t){const n=ie(e);t(fe(e.tr,n,n.bottom))}return!0}function ge(e,{map:t,table:n,tableStart:o},r){let l=0;for(let e=0;e<r;e++)l+=n.child(e).nodeSize;const i=l+n.child(r).nodeSize,s=e.mapping.maps.length;e.delete(l+o,i+o);const c=new Set;for(let l=0,i=r*t.width;l<t.width;l++,i++){const a=t.map[i];if(!c.has(a))if(c.add(a),r>0&&a==t.map[i-t.width]){const t=n.nodeAt(a).attrs;e.setNodeMarkup(e.mapping.slice(s).map(a+o),null,{...t,rowspan:t.rowspan-1}),l+=t.colspan-1}else if(r<t.height&&a==t.map[i+t.width]){const i=n.nodeAt(a),c=i.attrs,d=i.type.create({...c,rowspan:i.attrs.rowspan-1},i.content),u=t.positionAt(r+1,l,n);e.insert(e.mapping.slice(s).map(o+u),d),l+=c.colspan-1}}}function we(e,t){if(!S(e))return!1;if(t){const n=ie(e),o=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;ge(o,n,e),e!=n.top;e--){const e=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!e)throw new RangeError("No table found");n.table=e,n.map=s.get(n.table)}t(o)}return!0}function be(e){const t=e.content;return 1==t.childCount&&t.child(0).isTextblock&&0==t.child(0).childCount}function Ce({width:e,height:t,map:n},o){let r=o.top*e+o.left,l=r,i=(o.bottom-1)*e+o.left,s=r+(o.right-o.left-1);for(let t=o.top;t<o.bottom;t++){if(o.left>0&&n[l]==n[l-1]||o.right<e&&n[s]==n[s+1])return!0;l+=e,s+=e}for(let l=o.left;l<o.right;l++){if(o.top>0&&n[r]==n[r-e]||o.bottom<t&&n[i]==n[i+e])return!0;r++,i++}return!1}function ye(e,n){const o=e.selection;if(!(o instanceof E)||o.$anchorCell.pos==o.$headCell.pos)return!1;const r=ie(e),{map:l}=r;if(Ce(l,r))return!1;if(n){const o=e.tr,i={};let s,c,a=t.Fragment.empty;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){const n=l.map[e*l.width+t],d=r.table.nodeAt(n);if(!i[n]&&d)if(i[n]=!0,null==s)s=n,c=d;else{be(d)||(a=a.append(d.content));const e=o.mapping.map(n+r.tableStart);o.delete(e,e+d.nodeSize)}}if(null==s||null==c)return!0;if(o.setNodeMarkup(s+r.tableStart,null,{...N(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size>0){const e=s+1+c.content.size,t=be(c)?s+1:e;o.replaceWith(t+r.tableStart,e+r.tableStart,a)}o.setSelection(new E(o.doc.resolve(s+r.tableStart))),n(o)}return!0}function ve(e,t){const n=b(e.schema);return Se(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Se(e){return(t,n)=>{const o=t.selection;let r,l;if(o instanceof E){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;r=o.$anchorCell.nodeAfter,l=o.$anchorCell.pos}else{var i;if(r=v(o.$from),!r)return!1;l=null===(i=y(o.$from))||void 0===i?void 0:i.pos}if(null==r||null==l)return!1;if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(n){let i=r.attrs;const s=[],c=i.colwidth;i.rowspan>1&&(i={...i,rowspan:1}),i.colspan>1&&(i={...i,colspan:1});const a=ie(t),d=t.tr;for(let e=0;e<a.right-a.left;e++)s.push(c?{...i,colwidth:c&&c[e]?[c[e]]:null}:i);let u;for(let t=a.top;t<a.bottom;t++){let n=a.map.positionAt(t,a.left,a.table);t==a.top&&(n+=r.nodeSize);for(let o=a.left,l=0;o<a.right;o++,l++)o==a.left&&t==a.top||d.insert(u=d.mapping.map(n+a.tableStart,1),e({node:r,row:t,col:o}).createAndFill(s[l]))}d.setNodeMarkup(l,e({node:r,row:a.top,col:a.left}),s[0]),o instanceof E&&d.setSelection(new E(d.doc.resolve(o.$anchorCell.pos),u?d.doc.resolve(u):void 0)),n(d)}return!0}}function Ae(e,t){return function(n,o){if(!S(n))return!1;const r=A(n);if(r.nodeAfter.attrs[e]===t)return!1;if(o){const l=n.tr;n.selection instanceof E?n.selection.forEachCell((n,o)=>{n.attrs[e]!==t&&l.setNodeMarkup(o,null,{...n.attrs,[e]:t})}):l.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[e]:t}),o(l)}return!0}}function $e(e){return function(t,n){if(!S(t))return!1;if(n){const o=b(t.schema),r=ie(t),l=t.tr,i=r.map.cellsInRect("column"==e?{left:r.left,top:0,right:r.right,bottom:r.map.height}:"row"==e?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),s=i.map(e=>r.table.nodeAt(e));for(let e=0;e<i.length;e++)s[e].type==o.header_cell&&l.setNodeMarkup(r.tableStart+i[e],o.cell,s[e].attrs);if(0===l.steps.length)for(let e=0;e<i.length;e++)l.setNodeMarkup(r.tableStart+i[e],o.header_cell,s[e].attrs);n(l)}return!0}}function Oe(e,t,n){const o=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<o.length;e++){const r=t.table.nodeAt(o[e]);if(r&&r.type!==n.header_cell)return!1}return!0}function Pe(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?$e(e):function(t,n){if(!S(t))return!1;if(n){const o=b(t.schema),r=ie(t),l=t.tr,i=Oe("row",r,o),s=Oe("column",r,o),c=("column"===e?i:"row"===e&&s)?1:0,a="column"==e?{left:0,top:c,right:1,bottom:r.map.height}:"row"==e?{left:c,top:0,right:r.map.width,bottom:1}:r,d="column"==e?s?o.cell:o.header_cell:"row"==e?i?o.cell:o.header_cell:o.cell;r.map.cellsInRect(a).forEach(e=>{const t=e+r.tableStart,n=l.doc.nodeAt(t);n&&l.setNodeMarkup(t,d,n.attrs)}),n(l)}return!0}}const Re=Pe("row",{useDeprecatedLogic:!0}),Me=Pe("column",{useDeprecatedLogic:!0}),je=Pe("cell",{useDeprecatedLogic:!0});function xe(e,t){if(t<0){const t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){const o=e.node(-1).child(t),r=o.lastChild;if(r)return n-1-r.nodeSize;n-=o.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const t=e.node(-1);for(let n=e.indexAfter(-1),o=e.after();n<t.childCount;n++){const e=t.child(n);if(e.childCount)return o+1;o+=e.nodeSize}}return null}function ze(t){return function(n,o){if(!S(n))return!1;const r=xe(A(n),t);if(null==r)return!1;if(o){const t=n.doc.resolve(r);o(n.tr.setSelection(e.TextSelection.between(t,P(t))).scrollIntoView())}return!0}}function Ne(e,t){const n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if("table"==n.node(o).type.spec.tableRole)return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function ke(e,n){const o=e.selection;if(!(o instanceof E))return!1;if(n){const r=e.tr,l=b(e.schema).cell.createAndFill().content;o.forEachCell((e,n)=>{e.content.eq(l)||r.replace(r.mapping.map(n+1),r.mapping.map(n+e.nodeSize-1),new t.Slice(l,0,0))}),r.docChanged&&n(r)}return!0}function Ee(e){return(t,n)=>{const{from:o,to:r,select:l=!0,pos:i=t.selection.from}=e,s=t.tr;return!!re({tr:s,originIndex:o,targetIndex:r,select:l,pos:i})&&(null==n||n(s),!0)}}function De(e){return(t,n)=>{const{from:o,to:r,select:l=!0,pos:i=t.selection.from}=e,s=t.tr;return!!ne({tr:s,originIndex:o,targetIndex:r,select:l,pos:i})&&(null==n||n(s),!0)}}function Te(e){if(0===e.size)return null;let{content:n,openStart:o,openEnd:r}=e;for(;1==n.childCount&&(o>0&&r>0||"table"==n.child(0).type.spec.tableRole);)o--,r--,n=n.child(0).content;const l=n.child(0),i=l.type.spec.tableRole,s=l.type.schema,c=[];if("row"==i)for(let e=0;e<n.childCount;e++){let l=n.child(e).content;const i=e?0:Math.max(0,o-1),a=e<n.childCount-1?0:Math.max(0,r-1);(i||a)&&(l=He(b(s).row,new t.Slice(l,i,a)).content),c.push(l)}else{if("cell"!=i&&"header_cell"!=i)return null;c.push(o||r?He(b(s).row,new t.Slice(n,o,r)).content:n)}return Fe(s,c)}function Fe(e,n){const o=[];for(let e=0;e<n.length;e++){const t=n[e];for(let n=t.childCount-1;n>=0;n--){const{rowspan:r,colspan:l}=t.child(n).attrs;for(let t=e;t<e+r;t++)o[t]=(o[t]||0)+l}}let r=0;for(let e=0;e<o.length;e++)r=Math.max(r,o[e]);for(let l=0;l<o.length;l++)if(l>=n.length&&n.push(t.Fragment.empty),o[l]<r){const i=b(e).cell.createAndFill(),s=[];for(let e=o[l];e<r;e++)s.push(i);n[l]=n[l].append(t.Fragment.from(s))}return{height:n.length,width:r,rows:n}}function He(e,t){const n=e.createAndFill();return new r.Transform(n).replace(0,n.content.size,t).doc}function Ie({width:e,height:n,rows:o},r,l){if(e!=r){const n=[],l=[];for(let e=0;e<o.length;e++){const i=o[e],s=[];for(let t=n[e]||0,o=0;t<r;o++){let l=i.child(o%i.childCount);t+l.attrs.colspan>r&&(l=l.type.createChecked(z(l.attrs,l.attrs.colspan,t+l.attrs.colspan-r),l.content)),s.push(l),t+=l.attrs.colspan;for(let t=1;t<l.attrs.rowspan;t++)n[e+t]=(n[e+t]||0)+l.attrs.colspan}l.push(t.Fragment.from(s))}o=l,e=r}if(n!=l){const e=[];for(let r=0,i=0;r<l;r++,i++){const s=[],c=o[i%n];for(let e=0;e<c.childCount;e++){let t=c.child(e);r+t.attrs.rowspan>l&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,l-t.attrs.rowspan)},t.content)),s.push(t)}e.push(t.Fragment.from(s))}o=e,n=l}return{width:e,height:n,rows:o}}function Le(e,n,o,r,l,i,s){const c=b(e.doc.type.schema);let a,d;if(l>n.width)for(let t=0,i=0;t<n.height;t++){const u=o.child(t);i+=u.nodeSize;const p=[];let f;f=null==u.lastChild||u.lastChild.type==c.cell?a||(a=c.cell.createAndFill()):d||(d=c.header_cell.createAndFill());for(let e=n.width;e<l;e++)p.push(f);e.insert(e.mapping.slice(s).map(i-1+r),p)}if(i>n.height){const u=[];for(let e=0,t=(n.height-1)*n.width;e<Math.max(n.width,l);e++){const r=!(e>=n.width)&&o.nodeAt(n.map[t+e]).type==c.header_cell;u.push(r?d||(d=c.header_cell.createAndFill()):a||(a=c.cell.createAndFill()))}const p=c.row.create(null,t.Fragment.from(u)),f=[];for(let e=n.height;e<i;e++)f.push(p);e.insert(e.mapping.slice(s).map(r+o.nodeSize-2),f)}return!(!a&&!d)}function Be(e,t,n,o,r,l,i,s){if(0==i||i==t.height)return!1;let c=!1;for(let a=r;a<l;a++){const r=i*t.width+a,l=t.map[r];if(t.map[r-t.width]==l){c=!0;const r=n.nodeAt(l),{top:d,left:u}=t.findCell(l);e.setNodeMarkup(e.mapping.slice(s).map(l+o),null,{...r.attrs,rowspan:i-d}),e.insert(e.mapping.slice(s).map(t.positionAt(i,u,n)),r.type.createAndFill({...r.attrs,rowspan:d+r.attrs.rowspan-i})),a+=r.attrs.colspan-1}}return c}function We(e,t,n,o,r,l,i,s){if(0==i||i==t.width)return!1;let c=!1;for(let a=r;a<l;a++){const r=a*t.width+i,l=t.map[r];if(t.map[r-1]==l){c=!0;const r=n.nodeAt(l),d=t.colCount(l),u=e.mapping.slice(s).map(l+o);e.setNodeMarkup(u,null,z(r.attrs,i-d,r.attrs.colspan-(i-d))),e.insert(u+r.nodeSize,r.type.createAndFill(z(r.attrs,0,i-d))),a+=r.attrs.rowspan-1}}return c}function Ke(e,n,o,r,l){let i=o?e.doc.nodeAt(o-1):e.doc;if(!i)throw new Error("No table found");let c=s.get(i);const{top:a,left:d}=r,u=d+l.width,p=a+l.height,f=e.tr;let h=0;function w(){if(i=o?f.doc.nodeAt(o-1):f.doc,!i)throw new Error("No table found");c=s.get(i),h=f.mapping.maps.length}Le(f,c,i,o,u,p,h)&&w(),Be(f,c,i,o,d,u,a,h)&&w(),Be(f,c,i,o,d,u,p,h)&&w(),We(f,c,i,o,a,p,d,h)&&w(),We(f,c,i,o,a,p,u,h)&&w();for(let e=a;e<p;e++){const n=c.positionAt(e,d,i),r=c.positionAt(e,u,i);f.replace(f.mapping.slice(h).map(n+o),f.mapping.slice(h).map(r+o),new t.Slice(l.rows[e-a],0,0))}w(),f.setSelection(new E(f.doc.resolve(o+c.positionAt(a,d,i)),f.doc.resolve(o+c.positionAt(p-1,u-1,i)))),n(f)}const Ve=(0,o.keydownHandler)({ArrowLeft:qe("horiz",-1),ArrowRight:qe("horiz",1),ArrowUp:qe("vert",-1),ArrowDown:qe("vert",1),"Shift-ArrowLeft":Je("horiz",-1),"Shift-ArrowRight":Je("horiz",1),"Shift-ArrowUp":Je("vert",-1),"Shift-ArrowDown":Je("vert",1),Backspace:ke,"Mod-Backspace":ke,Delete:ke,"Mod-Delete":ke});function Xe(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function qe(t,n){return(o,r,l)=>{if(!l)return!1;const i=o.selection;if(i instanceof E)return Xe(o,r,e.Selection.near(i.$headCell,n));if("horiz"!=t&&!i.empty)return!1;const s=Qe(l,t,n);if(null==s)return!1;if("horiz"==t)return Xe(o,r,e.Selection.near(o.doc.resolve(i.head+n),n));{const l=o.doc.resolve(s),i=x(l,t,n);let c;return c=i?e.Selection.near(i,1):n<0?e.Selection.near(o.doc.resolve(l.before(-1)),-1):e.Selection.near(o.doc.resolve(l.after(-1)),1),Xe(o,r,c)}}}function Je(e,t){return(n,o,r)=>{if(!r)return!1;const l=n.selection;let i;if(l instanceof E)i=l;else{const o=Qe(r,e,t);if(null==o)return!1;i=new E(n.doc.resolve(o))}const s=x(i.$headCell,e,t);return!!s&&Xe(n,o,new E(i.$anchorCell,s))}}function Ue(e,t){const n=y(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new E(n))),!0)}function Ye(e,n,o){if(!S(e.state))return!1;let r=Te(o);const l=e.state.selection;if(l instanceof E){r||(r={width:1,height:1,rows:[t.Fragment.from(He(b(e.state.schema).cell,o))]});const n=l.$anchorCell.node(-1),i=l.$anchorCell.start(-1),c=s.get(n).rectBetween(l.$anchorCell.pos-i,l.$headCell.pos-i);return r=Ie(r,c.right-c.left,c.bottom-c.top),Ke(e.state,e.dispatch,i,c,r),!0}if(r){const t=A(e.state),n=t.start(-1);return Ke(e.state,e.dispatch,n,s.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function Ge(e,t){var n;if(0!=t.button)return;if(t.ctrlKey||t.metaKey)return;const o=Ze(e,t.target);let r;if(t.shiftKey&&e.state.selection instanceof E)l(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&null!=(r=y(e.state.selection.$anchor))&&(null===(n=et(e,t))||void 0===n?void 0:n.pos)!=r.pos)l(r,t),t.preventDefault();else if(!o)return;function l(t,n){let o=et(e,n);const r=null==C.getState(e.state);if(!o||!R(t,o)){if(!r)return;o=t}const l=new E(t,o);if(r||!e.state.selection.eq(l)){const n=e.state.tr.setSelection(l);r&&n.setMeta(C,t.pos),e.dispatch(n)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",s),null!=C.getState(e.state)&&e.dispatch(e.state.tr.setMeta(C,-1))}function s(n){const r=n,s=C.getState(e.state);let c;if(null!=s)c=e.state.doc.resolve(s);else if(Ze(e,r.target)!=o&&(c=et(e,t),!c))return i();c&&l(c,r)}e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",s)}function Qe(t,n,o){if(!(t.state.selection instanceof e.TextSelection))return null;const{$head:r}=t.state.selection;for(let e=r.depth-1;e>=0;e--){const l=r.node(e);if((o<0?r.index(e):r.indexAfter(e))!=(o<0?0:l.childCount))return null;if("cell"==l.type.spec.tableRole||"header_cell"==l.type.spec.tableRole){const l=r.before(e),i="vert"==n?o>0?"down":"up":o>0?"right":"left";return t.endOfTextblock(i)?l:null}}return null}function Ze(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t;return null}function et(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:r}=n;return o>=0&&y(e.state.doc.resolve(o))||y(e.state.doc.resolve(r))}var tt=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")),nt(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,nt(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}};function nt(e,t,n,o,r,l){let i=0,s=!0,c=t.firstChild;const a=e.firstChild;if(a){for(let e=0,n=0;e<a.childCount;e++){const{colspan:d,colwidth:u}=a.child(e).attrs;for(let e=0;e<d;e++,n++){const a=r==n?l:u&&u[e],d=a?a+"px":"";if(i+=a||o,a||(s=!1),c)c.style.width!=d&&(c.style.width=d),c=c.nextSibling;else{const e=document.createElement("col");e.style.width=d,t.appendChild(e)}}}for(;c;){var d;const e=c.nextSibling;null===(d=c.parentNode)||void 0===d||d.removeChild(c),c=e}s?(n.style.width=i+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=i+"px")}}const ot=new e.PluginKey("tableColumnResizing");function rt({handleWidth:t=5,cellMinWidth:n=25,defaultCellMinWidth:o=100,View:r=tt,lastColumnResizable:l=!0}={}){const i=new e.Plugin({key:ot,state:{init(e,t){var n;const l=null===(n=i.spec)||void 0===n||null===(n=n.props)||void 0===n?void 0:n.nodeViews,s=b(t.schema).table.name;return r&&l&&(l[s]=(e,t)=>new r(e,o,t)),new lt(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>{const t=ot.getState(e);return t&&t.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(e,n)=>{it(e,n,t,l)},mouseleave:e=>{st(e)},mousedown:(e,t)=>{ct(e,t,n,o)}},decorations:e=>{const t=ot.getState(e);if(t&&t.activeHandle>-1)return wt(e,t.activeHandle)},nodeViews:{}}});return i}var lt=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){const n=this,o=t.getMeta(ot);if(o&&null!=o.setHandle)return new e(o.setHandle,!1);if(o&&void 0!==o.setDragging)return new e(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let o=t.mapping.map(n.activeHandle,-1);return O(t.doc.resolve(o))||(o=-1),new e(o,n.dragging)}return n}};function it(e,t,n,o){if(!e.editable)return;const r=ot.getState(e.state);if(r&&!r.dragging){const l=dt(t.target);let i=-1;if(l){const{left:o,right:r}=l.getBoundingClientRect();t.clientX-o<=n?i=ut(e,t,"left",n):r-t.clientX<=n&&(i=ut(e,t,"right",n))}if(i!=r.activeHandle){if(!o&&-1!==i){const t=e.state.doc.resolve(i),n=t.node(-1),o=s.get(n),r=t.start(-1);if(o.colCount(t.pos-r)+t.nodeAfter.attrs.colspan-1==o.width-1)return}ft(e,i)}}}function st(e){if(!e.editable)return;const t=ot.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&ft(e,-1)}function ct(e,t,n,o){var r;if(!e.editable)return!1;const l=null!==(r=e.dom.ownerDocument.defaultView)&&void 0!==r?r:window,i=ot.getState(e.state);if(!i||-1==i.activeHandle||i.dragging)return!1;const s=e.state.doc.nodeAt(i.activeHandle),c=at(e,i.activeHandle,s.attrs);function a(t){l.removeEventListener("mouseup",a),l.removeEventListener("mousemove",d);const o=ot.getState(e.state);(null==o?void 0:o.dragging)&&(ht(e,o.activeHandle,pt(o.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ot,{setDragging:null})))}function d(t){if(!t.which)return a(t);const r=ot.getState(e.state);if(r&&r.dragging){const l=pt(r.dragging,t,n);mt(e,r.activeHandle,l,o)}}return e.dispatch(e.state.tr.setMeta(ot,{setDragging:{startX:t.clientX,startWidth:c}})),mt(e,i.activeHandle,c,o),l.addEventListener("mouseup",a),l.addEventListener("mousemove",d),t.preventDefault(),!0}function at(e,t,{colspan:n,colwidth:o}){const r=o&&o[o.length-1];if(r)return r;const l=e.domAtPos(t);let i=l.node.childNodes[l.offset].offsetWidth,s=n;if(o)for(let e=0;e<n;e++)o[e]&&(i-=o[e],s--);return i/s}function dt(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function ut(e,t,n,o){const r="right"==n?-o:o,l=e.posAtCoords({left:t.clientX+r,top:t.clientY});if(!l)return-1;const{pos:i}=l,c=y(e.state.doc.resolve(i));if(!c)return-1;if("right"==n)return c.pos;const a=s.get(c.node(-1)),d=c.start(-1),u=a.map.indexOf(c.pos-d);return u%a.width==0?-1:d+a.map[u-1]}function pt(e,t,n){const o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function ft(e,t){e.dispatch(e.state.tr.setMeta(ot,{setHandle:t}))}function ht(e,t,n){const o=e.state.doc.resolve(t),r=o.node(-1),l=s.get(r),i=o.start(-1),c=l.colCount(o.pos-i)+o.nodeAfter.attrs.colspan-1,a=e.state.tr;for(let e=0;e<l.height;e++){const t=e*l.width+c;if(e&&l.map[t]==l.map[t-l.width])continue;const o=l.map[t],s=r.nodeAt(o).attrs,d=1==s.colspan?0:c-l.colCount(o);if(s.colwidth&&s.colwidth[d]==n)continue;const u=s.colwidth?s.colwidth.slice():gt(s.colspan);u[d]=n,a.setNodeMarkup(i+o,null,{...s,colwidth:u})}a.docChanged&&e.dispatch(a)}function mt(e,t,n,o){const r=e.state.doc.resolve(t),l=r.node(-1),i=r.start(-1),c=s.get(l).colCount(r.pos-i)+r.nodeAfter.attrs.colspan-1;let a=e.domAtPos(r.start(-1)).node;for(;a&&"TABLE"!=a.nodeName;)a=a.parentNode;a&&nt(l,a.firstChild,a,o,c,n)}function gt(e){return Array(e).fill(0)}function wt(e,t){const o=[],r=e.doc.resolve(t),l=r.node(-1);if(!l)return n.DecorationSet.empty;const i=s.get(l),c=r.start(-1),a=i.colCount(r.pos-c)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<i.height;t++){const r=a+t*i.width;if(!(a!=i.width-1&&i.map[r]==i.map[r+1]||0!=t&&i.map[r]==i.map[r-i.width])){var d;const t=i.map[r],s=c+t+l.nodeAt(t).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",(null===(d=ot.getState(e))||void 0===d?void 0:d.dragging)&&o.push(n.Decoration.node(c+t,c+t+l.nodeAt(t).nodeSize,{class:"column-resize-dragging"})),o.push(n.Decoration.widget(s,a))}}return n.DecorationSet.create(e.doc,o)}function bt({allowTableNodeSelection:t=!1}={}){return new e.Plugin({key:C,state:{init:()=>null,apply(e,t){const n=e.getMeta(C);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;const{deleted:o,pos:r}=e.mapping.mapResult(t);return o?null:r}},props:{decorations:_,handleDOMEvents:{mousedown:Ge},createSelectionBetween:e=>null!=C.getState(e.state)?e.state.selection:null,handleTripleClick:Ue,handleKeyDown:Ve,handlePaste:Ye},appendTransaction:(e,n,o)=>H(o,B(o,n),t)})}},2648,[2616,2614,2627,2621,2613]);
187
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"imeSpan",{enumerable:!0,get:function(){return w}});var n=r(d[0]),t=r(d[1]),o="undefined"!=typeof navigator?navigator:null,s=o&&o.userAgent||"",c=/Edge\/(\d+)/.exec(s),u=/MSIE \d/.exec(s),p=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(s),f=!!!(u||p||c)&&!!o&&/Apple Computer/.test(o.vendor),l=new n.PluginKey("safari-ime-span"),v=!1,y={key:l,props:{decorations:function(n){const{$from:o,$to:s,to:c}=n.selection;if(v&&o.sameParent(s)){const o=t.Decoration.widget(c,P,{ignoreSelection:!0,key:"safari-ime-span"});return t.DecorationSet.create(n.doc,[o])}},handleDOMEvents:{compositionstart:()=>{v=!0},compositionend:()=>{v=!1}}}};function P(n){const t=n.dom.ownerDocument.createElement("span");return t.className="ProseMirror-safari-ime-span",t}var w=new n.Plugin(f?y:{key:l})},2649,[2616,2627]);
188
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u.default}});var e,t=r(d[0]),u=(e=t)&&e.__esModule?e:{default:e}},2650,[2651]);
189
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var n=r(d[0]),o=r(d[1]);const t={};function s(s){const u=s||t,f=this.data(),c=f.micromarkExtensions||(f.micromarkExtensions=[]),k=f.fromMarkdownExtensions||(f.fromMarkdownExtensions=[]),M=f.toMarkdownExtensions||(f.toMarkdownExtensions=[]);c.push((0,o.gfm)(u)),k.push((0,n.gfmFromMarkdown)()),M.push((0,n.gfmToMarkdown)(u))}},2651,[2652,2669]);
190
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmFromMarkdown",{enumerable:!0,get:function(){return n.gfmFromMarkdown}}),Object.defineProperty(e,"gfmToMarkdown",{enumerable:!0,get:function(){return n.gfmToMarkdown}});var n=r(d[0])},2652,[2653]);
191
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmFromMarkdown=function(){return[(0,o.gfmAutolinkLiteralFromMarkdown)(),(0,n.gfmFootnoteFromMarkdown)(),(0,t.gfmStrikethroughFromMarkdown)(),(0,k.gfmTableFromMarkdown)(),(0,f.gfmTaskListItemFromMarkdown)()]},e.gfmToMarkdown=function(M){return{extensions:[(0,o.gfmAutolinkLiteralToMarkdown)(),(0,n.gfmFootnoteToMarkdown)(M),(0,t.gfmStrikethroughToMarkdown)(),(0,k.gfmTableToMarkdown)(M),(0,f.gfmTaskListItemToMarkdown)()]}};var o=r(d[0]),n=r(d[1]),t=r(d[2]),k=r(d[3]),f=r(d[4])},2653,[2654,2660,2662,2664,2667]);
192
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmAutolinkLiteralFromMarkdown",{enumerable:!0,get:function(){return t.gfmAutolinkLiteralFromMarkdown}}),Object.defineProperty(e,"gfmAutolinkLiteralToMarkdown",{enumerable:!0,get:function(){return t.gfmAutolinkLiteralToMarkdown}});var t=r(d[0])},2654,[2655]);
193
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmAutolinkLiteralFromMarkdown=function(){return{transforms:[x],enter:{literalAutolink:s,literalAutolinkEmail:f,literalAutolinkHttp:f,literalAutolinkWww:f},exit:{literalAutolink:w,literalAutolinkEmail:p,literalAutolinkHttp:h,literalAutolinkWww:k}}},e.gfmAutolinkLiteralToMarkdown=function(){return{unsafe:[{character:'@',before:'[+\\-.\\w]',after:'[\\-.\\w]',inConstruct:c,notInConstruct:u},{character:'.',before:'[Ww]',after:'[\\-.\\w]',inConstruct:c,notInConstruct:u},{character:':',before:'[ps]',after:'\\/',inConstruct:c,notInConstruct:u}]}};var t=r(d[0]),n=r(d[1]),l=r(d[2]),o=r(d[3]);const c='phrasing',u=['autolink','link','image','label'];function s(t){this.enter({type:'link',title:null,url:'',children:[]},t)}function f(t){this.config.enter.autolinkProtocol.call(this,t)}function h(t){this.config.exit.autolinkProtocol.call(this,t)}function k(t){this.config.exit.data.call(this,t);const l=this.stack[this.stack.length-1];(0,n.ok)('link'===l.type),l.url='http://'+this.sliceSerialize(t)}function p(t){this.config.exit.autolinkEmail.call(this,t)}function w(t){this.exit(t)}function x(t){(0,o.findAndReplace)(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,A],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,y]],{ignore:['link','linkReference']})}function A(t,n,l,o,c){let u='';if(!v(c))return!1;if(/^w/i.test(n)&&(l=n+l,n='',u='http://'),!C(l))return!1;const s=_(l+o);if(!s[0])return!1;const f={type:'link',title:null,url:u+n+s[0],children:[{type:'text',value:n+s[0]}]};return s[1]?[f,{type:'text',value:s[1]}]:f}function y(t,n,l,o){return!(!v(o,!0)||/[-\d_]$/.test(l))&&{type:'link',title:null,url:'mailto:'+n+'@'+l,children:[{type:'text',value:n+'@'+l}]}}function C(t){const n=t.split('.');return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function _(n){const l=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!l)return[n,void 0];n=n.slice(0,l.index);let o=l[0],c=o.indexOf(')');const u=(0,t.ccount)(n,'(');let s=(0,t.ccount)(n,')');for(;-1!==c&&u>s;)n+=o.slice(0,c+1),o=o.slice(c+1),c=o.indexOf(')'),s++;return[n,o]}function v(t,n){const o=t.input.charCodeAt(t.index-1);return(0===t.index||(0,l.unicodeWhitespace)(o)||(0,l.unicodePunctuation)(o))&&(!n||47!==o)}},2655,[2656,2598,2483,2657]);
194
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ccount=function(t,n){const c=String(t);if('string'!=typeof n)throw new TypeError('Expected character');let o=0,f=c.indexOf(n);for(;-1!==f;)o++,f=c.indexOf(n,f+n.length);return o}},2656,[]);
195
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"findAndReplace",{enumerable:!0,get:function(){return n.findAndReplace}});var n=r(d[0])},2657,[2658]);
196
+ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.findAndReplace=function(e,t,n){const c=n||{},s=(0,u.convert)(c.ignore||[]),f=o(t);let p=-1;for(;++p<f.length;)(0,l.visitParents)(e,'text',h);function h(e,t){let n,l=-1;for(;++l<t.length;){const e=t[l],u=n?n.children:void 0;if(s(e,u?u.indexOf(e):void 0,n))return;n=e}if(n)return v(e,t)}function v(e,t){const n=t[t.length-1],l=f[p][0],u=f[p][1];let o=0;const c=n.children.indexOf(e);let s=!1,h=[];l.lastIndex=0;let v=l.exec(e.value);for(;v;){const n=v.index,c={index:v.index,input:v.input,stack:[...t,e]};let f=u(...v,c);if('string'==typeof f&&(f=f.length>0?{type:'text',value:f}:void 0),!1===f?l.lastIndex=n+1:(o!==n&&h.push({type:'text',value:e.value.slice(o,n)}),Array.isArray(f)?h.push(...f):f&&h.push(f),o=n+v[0].length,s=!0),!l.global)break;v=l.exec(e.value)}return s?(o<e.value.length&&h.push({type:'text',value:e.value.slice(o)}),n.children.splice(c,1,...h)):h=[e],c+h.length}};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},l=r(d[1]),u=r(d[2]);function o(e){const t=[];if(!Array.isArray(e))throw new TypeError('Expected find and replace tuple or list of tuples');const n=!e[0]||Array.isArray(e[0])?e:[e];let l=-1;for(;++l<n.length;){const e=n[l];t.push([c(e[0]),s(e[1])])}return t}function c(e){return'string'==typeof e?new RegExp((0,n.default)(e),'g'):e}function s(e){return'function'==typeof e?e:function(){return e}}},2658,[2659,2558,2537]);
197
+ __d(function(g,r,i,a,m,e,d){"use strict";function t(t){if('string'!=typeof t)throw new TypeError('Expected a string');return t.replace(/[|\\{}()[\]^$+*?.]/g,'\\$&').replace(/-/g,'\\x2d')}Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}})},2659,[]);
198
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmFootnoteFromMarkdown",{enumerable:!0,get:function(){return o.gfmFootnoteFromMarkdown}}),Object.defineProperty(e,"gfmFootnoteToMarkdown",{enumerable:!0,get:function(){return o.gfmFootnoteToMarkdown}});var o=r(d[0])},2660,[2661]);
199
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmFootnoteFromMarkdown=function(){return{enter:{gfmFootnoteCallString:o,gfmFootnoteCall:f,gfmFootnoteDefinitionLabelString:c,gfmFootnoteDefinition:s},exit:{gfmFootnoteCallString:l,gfmFootnoteCall:u,gfmFootnoteDefinitionLabelString:h,gfmFootnoteDefinition:b}}},e.gfmFootnoteToMarkdown=function(t){let n=!1;t&&t.firstLineBlank&&(n=!0);return{handlers:{footnoteDefinition:function(t,o,f,c){const s=f.createTracker(c);let l=s.move('[^');const u=f.enter('footnoteDefinition'),h=f.enter('label');l+=s.move(f.safe(f.associationId(t),{before:l,after:']'})),h(),l+=s.move(']:'),t.children&&t.children.length>0&&(s.shift(4),l+=s.move((n?'\n':' ')+f.indentLines(f.containerFlow(t,s.current()),n?v:F)));return u(),l},footnoteReference:k},unsafe:[{character:'[',inConstruct:['label','phrasing','reference']}]}};var t=r(d[0]),n=r(d[1]);function o(){this.buffer()}function f(t){this.enter({type:'footnoteReference',identifier:'',label:''},t)}function c(){this.buffer()}function s(t){this.enter({type:'footnoteDefinition',identifier:'',label:'',children:[]},t)}function l(o){const f=this.resume(),c=this.stack[this.stack.length-1];(0,t.ok)('footnoteReference'===c.type),c.identifier=(0,n.normalizeIdentifier)(this.sliceSerialize(o)).toLowerCase(),c.label=f}function u(t){this.exit(t)}function h(o){const f=this.resume(),c=this.stack[this.stack.length-1];(0,t.ok)('footnoteDefinition'===c.type),c.identifier=(0,n.normalizeIdentifier)(this.sliceSerialize(o)).toLowerCase(),c.label=f}function b(t){this.exit(t)}function k(t,n,o,f){const c=o.createTracker(f);let s=c.move('[^');const l=o.enter('footnoteReference'),u=o.enter('reference');return s+=c.move(o.safe(o.associationId(t),{after:']',before:s})),u(),l(),s+=c.move(']'),s}function F(t,n,o){return 0===n?t:v(t,n,o)}function v(t,n,o){return(o?'':' ')+t}k.peek=function(){return'['}},2661,[2598,2481]);
200
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmStrikethroughFromMarkdown",{enumerable:!0,get:function(){return t.gfmStrikethroughFromMarkdown}}),Object.defineProperty(e,"gfmStrikethroughToMarkdown",{enumerable:!0,get:function(){return t.gfmStrikethroughToMarkdown}});var t=r(d[0])},2662,[2663]);
201
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmStrikethroughFromMarkdown=function(){return{canContainEols:['delete'],enter:{strikethrough:n},exit:{strikethrough:o}}},e.gfmStrikethroughToMarkdown=function(){return{handlers:{delete:u},unsafe:[{character:'~',inConstruct:'phrasing',notInConstruct:t}]}};const t=['autolink','destinationLiteral','destinationRaw','reference','titleQuote','titleApostrophe'];function n(t){this.enter({type:'delete',children:[],position:void 0},t)}function o(t){this.exit(t)}function u(t,n,o,u){const s=o.createTracker(u),c=o.stack.includes('strikethrough')?'~':'~~',h=o.enter('strikethrough');let f=s.move(c);return f+=o.containerPhrasing(t,{...s.current(),before:f,after:'~'}),f+=s.move(c),h(),f}u.attention=function(){return{construct:'strikethrough',markers:['~'],sizes:[2,1]}},u.peek=function(){return'~'}},2663,[]);
202
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmTableFromMarkdown",{enumerable:!0,get:function(){return n.gfmTableFromMarkdown}}),Object.defineProperty(e,"gfmTableToMarkdown",{enumerable:!0,get:function(){return n.gfmTableToMarkdown}});var n=r(d[0])},2664,[2665]);
203
+ __d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmTableFromMarkdown=function(){return{enter:{table:c,tableData:b,tableHeader:b,tableRow:s},exit:{codeText:d,table:o,tableData:u,tableHeader:u,tableRow:u}}},e.gfmTableToMarkdown=function(t){const c=t||{},o=c.tableCellPadding,s=c.tablePipeAlign,u=c.stringLength,b=o?' ':'|';return{unsafe:[{character:'\r',inConstruct:'tableCell'},{character:'\n',inConstruct:'tableCell'},{atBreak:!0,character:'|',after:'[\t :-]'},{character:'|',inConstruct:'tableCell'},{atBreak:!0,character:':',after:'-'},{atBreak:!0,character:'-',after:'[:|-]'}],handlers:{inlineCode:function(t,n,c){let o=l.defaultHandlers.inlineCode(t,n,c);c.stack.includes('tableCell')&&(o=o.replace(/\|/g,'\\$&'));return o},table:function(t,n,l,c){return f(h(t,l,c),t.align)},tableCell:d,tableRow:function(t,n,l,c){const o=f([C(t,l,c)]);return o.slice(0,o.indexOf('\n'))}}};function d(t,n,l,c){const o=l.enter('tableCell'),s=l.enter('phrasing'),u=l.containerPhrasing(t,{...c,before:b,after:b});return s(),o(),u}function f(t,l){return(0,n.markdownTable)(t,{align:l,alignDelimiters:s,padding:o,stringLength:u})}function h(t,n,l){const c=t.children;let o=-1;const s=[],u=n.enter('table');for(;++o<c.length;)s[o]=C(c[o],n,l);return u(),s}function C(t,n,l){const c=t.children;let o=-1;const s=[],u=n.enter('tableRow');for(;++o<c.length;)s[o]=d(c[o],0,n,l);return u(),s}};var t=r(_d[0]),n=r(_d[1]),l=r(_d[2]);function c(n){const l=n._align;(0,t.ok)(l,'expected `_align` on table'),this.enter({type:'table',align:l.map(function(t){return'none'===t?null:t}),children:[]},n),this.data.inTable=!0}function o(t){this.exit(t),this.data.inTable=void 0}function s(t){this.enter({type:'tableRow',children:[]},t)}function u(t){this.exit(t)}function b(t){this.enter({type:'tableCell',children:[]},t)}function d(n){let l=this.resume();this.data.inTable&&(l=l.replace(/\\([\\|])/g,f));const c=this.stack[this.stack.length-1];(0,t.ok)('inlineCode'===c.type),c.value=l,this.exit(n)}function f(t,n){return'|'===n?n:t}},2665,[2598,2666,2533]);
204
+ __d(function(g,r,i,a,m,e,d){"use strict";function t(t){return t.length}function n(t){return null==t?'':String(t)}function l(t){const n='string'==typeof t?t.codePointAt(0):0;return 67===n||99===n?99:76===n||108===n?108:82===n||114===n?114:0}Object.defineProperty(e,'__esModule',{value:!0}),e.markdownTable=function(o,s){const c=s||{},p=(c.align||[]).concat(),h=c.stringLength||t,u=[],f=[],D=[],j=[];let _=0,b=-1;for(;++b<o.length;){const t=[],l=[];let s=-1;for(o[b].length>_&&(_=o[b].length);++s<o[b].length;){const p=n(o[b][s]);if(!1!==c.alignDelimiters){const t=h(p);l[s]=t,(void 0===j[s]||t>j[s])&&(j[s]=t)}t.push(p)}f[b]=t,D[b]=l}let y=-1;if('object'==typeof p&&'length'in p)for(;++y<_;)u[y]=l(p[y]);else{const t=l(p);for(;++y<_;)u[y]=t}y=-1;const S=[],v=[];for(;++y<_;){const t=u[y];let n='',l='';99===t?(n=':',l=':'):108===t?n=':':114===t&&(l=':');let o=!1===c.alignDelimiters?1:Math.max(1,j[y]-n.length-l.length);const s=n+'-'.repeat(o)+l;!1!==c.alignDelimiters&&(o=n.length+o+l.length,o>j[y]&&(j[y]=o),v[y]=o),S[y]=s}f.splice(1,0,S),D.splice(1,0,v),b=-1;const E=[];for(;++b<f.length;){const t=f[b],n=D[b];y=-1;const l=[];for(;++y<_;){const o=t[y]||'';let s='',p='';if(!1!==c.alignDelimiters){const t=j[y]-(n[y]||0),l=u[y];114===l?s=' '.repeat(t):99===l?t%2?(s=' '.repeat(t/2+.5),p=' '.repeat(t/2-.5)):(s=' '.repeat(t/2),p=s):p=' '.repeat(t)}!1===c.delimiterStart||y||l.push('|'),!1===c.padding||!1===c.alignDelimiters&&''===o||!1===c.delimiterStart&&!y||l.push(' '),!1!==c.alignDelimiters&&l.push(s),l.push(o),!1!==c.alignDelimiters&&l.push(p),!1!==c.padding&&l.push(' '),!1===c.delimiterEnd&&y===_-1||l.push('|')}E.push(!1===c.delimiterEnd?l.join('').replace(/ +$/,''):l.join(''))}return E.join('\n')}},2666,[]);
205
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmTaskListItemFromMarkdown",{enumerable:!0,get:function(){return t.gfmTaskListItemFromMarkdown}}),Object.defineProperty(e,"gfmTaskListItemToMarkdown",{enumerable:!0,get:function(){return t.gfmTaskListItemToMarkdown}});var t=r(d[0])},2667,[2668]);
206
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmTaskListItemFromMarkdown=function(){return{exit:{taskListCheckValueChecked:n,taskListCheckValueUnchecked:n,paragraph:c}}},e.gfmTaskListItemToMarkdown=function(){return{unsafe:[{atBreak:!0,character:'-',after:'[:|-]'}],handlers:{listItem:o}}};var t=r(d[0]),s=r(d[1]);function n(s){const n=this.stack[this.stack.length-2];(0,t.ok)('listItem'===n.type),n.checked='taskListCheckValueChecked'===s.type}function c(s){const n=this.stack[this.stack.length-2];if(n&&'listItem'===n.type&&'boolean'==typeof n.checked){const s=this.stack[this.stack.length-1];(0,t.ok)('paragraph'===s.type);const c=s.children[0];if(c&&'text'===c.type){const t=n.children;let o,h=-1;for(;++h<t.length;){const s=t[h];if('paragraph'===s.type){o=s;break}}o===s&&(c.value=c.value.slice(1),0===c.value.length?s.children.shift():s.position&&c.position&&'number'==typeof c.position.start.offset&&(c.position.start.column++,c.position.start.offset++,s.position.start=Object.assign({},c.position.start)))}}this.exit(s)}function o(t,n,c,o){const h=t.children[0],l='boolean'==typeof t.checked&&h&&'paragraph'===h.type,k='['+(t.checked?'x':' ')+'] ',p=c.createTracker(o);l&&p.move(k);let f=s.defaultHandlers.listItem(t,n,c,{...o,...p.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(t){return t+k})),f}},2668,[2598,2533]);
207
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfm=function(u){return(0,t.combineExtensions)([(0,n.gfmAutolinkLiteral)(),(0,o.gfmFootnote)(),(0,f.gfmStrikethrough)(u),(0,l.gfmTable)(),(0,s.gfmTaskListItem)()])},e.gfmHtml=function(H){return(0,t.combineHtmlExtensions)([(0,n.gfmAutolinkLiteralHtml)(),(0,o.gfmFootnoteHtml)(H),(0,f.gfmStrikethroughHtml)(),(0,l.gfmTableHtml)(),(0,u.gfmTagfilterHtml)(),(0,s.gfmTaskListItemHtml)()])};var t=r(d[0]),n=r(d[1]),o=r(d[2]),f=r(d[3]),l=r(d[4]),u=r(d[5]),s=r(d[6])},2669,[2478,2670,2673,2676,2679,2684,2686]);
208
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmAutolinkLiteral",{enumerable:!0,get:function(){return t.gfmAutolinkLiteral}}),Object.defineProperty(e,"gfmAutolinkLiteralHtml",{enumerable:!0,get:function(){return n.gfmAutolinkLiteralHtml}});var t=r(d[0]),n=r(d[1])},2670,[2671,2672]);
209
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmAutolinkLiteral=function(){return{text:k}};var n=r(d[0]);const t={tokenize:function(n,t,u){let o=0;return function t(l){if((87===l||119===l)&&o<3)return o++,n.consume(l),t;if(46===l&&3===o)return n.consume(l),c;return u(l)};function c(n){return null===n?u(n):t(n)}},partial:!0},u={tokenize:function(t,u,o){let l,s,f;return p;function p(u){return 46===u||95===u?t.check(c,h,k)(u):null===u||(0,n.markdownLineEndingOrSpace)(u)||(0,n.unicodeWhitespace)(u)||45!==u&&(0,n.unicodePunctuation)(u)?h(u):(f=!0,t.consume(u),p)}function k(n){return 95===n?l=!0:(s=l,l=void 0),t.consume(n),p}function h(n){return s||l||!f?o(n):u(n)}},partial:!0},o={tokenize:function(t,u){let o=0,l=0;return s;function s(p){return 40===p?(o++,t.consume(p),s):41===p&&l<o?f(p):33===p||34===p||38===p||39===p||41===p||42===p||44===p||46===p||58===p||59===p||60===p||63===p||93===p||95===p||126===p?t.check(c,u,f)(p):null===p||(0,n.markdownLineEndingOrSpace)(p)||(0,n.unicodeWhitespace)(p)?u(p):(t.consume(p),s)}function f(n){return 41===n&&l++,t.consume(n),s}},partial:!0},c={tokenize:function(t,u,o){return c;function c(f){return 33===f||34===f||39===f||41===f||42===f||44===f||46===f||58===f||59===f||63===f||95===f||126===f?(t.consume(f),c):38===f?(t.consume(f),s):93===f?(t.consume(f),l):60===f||null===f||(0,n.markdownLineEndingOrSpace)(f)||(0,n.unicodeWhitespace)(f)?u(f):o(f)}function l(t){return null===t||40===t||91===t||(0,n.markdownLineEndingOrSpace)(t)||(0,n.unicodeWhitespace)(t)?u(t):c(t)}function s(t){return(0,n.asciiAlpha)(t)?f(t):o(t)}function f(u){return 59===u?(t.consume(u),c):(0,n.asciiAlpha)(u)?(t.consume(u),f):o(u)}},partial:!0},l={tokenize:function(t,u,o){return function(n){return t.consume(n),c};function c(t){return(0,n.asciiAlphanumeric)(t)?o(t):u(t)}},partial:!0},s={name:'wwwAutolink',tokenize:function(n,c,l){const s=this;return function(c){if(87!==c&&119!==c||!A.call(s,s.previous)||W(s.events))return l(c);return n.enter('literalAutolink'),n.enter('literalAutolinkWww'),n.check(t,n.attempt(u,n.attempt(o,f),l),l)(c)};function f(t){return n.exit('literalAutolinkWww'),n.exit('literalAutolink'),c(t)}},previous:A},f={name:'protocolAutolink',tokenize:function(t,c,l){const s=this;let f='',p=!1;return function(n){if((72===n||104===n)&&w.call(s,s.previous)&&!W(s.events))return t.enter('literalAutolink'),t.enter('literalAutolinkHttp'),f+=String.fromCodePoint(n),t.consume(n),k;return l(n)};function k(u){if((0,n.asciiAlpha)(u)&&f.length<5)return f+=String.fromCodePoint(u),t.consume(u),k;if(58===u){const n=f.toLowerCase();if('http'===n||'https'===n)return t.consume(u),h}return l(u)}function h(n){return 47===n?(t.consume(n),p?A:(p=!0,h)):l(n)}function A(c){return null===c||(0,n.asciiControl)(c)||(0,n.markdownLineEndingOrSpace)(c)||(0,n.unicodeWhitespace)(c)||(0,n.unicodePunctuation)(c)?l(c):t.attempt(u,t.attempt(o,v),l)(c)}function v(n){return t.exit('literalAutolinkHttp'),t.exit('literalAutolink'),c(n)}},previous:w},p={name:'emailAutolink',tokenize:function(t,u,o){const c=this;let s,f;return function(n){if(!L(n)||!v.call(c,c.previous)||W(c.events))return o(n);return t.enter('literalAutolink'),t.enter('literalAutolinkEmail'),p(n)};function p(n){return L(n)?(t.consume(n),p):64===n?(t.consume(n),k):o(n)}function k(u){return 46===u?t.check(l,A,h)(u):45===u||95===u||(0,n.asciiAlphanumeric)(u)?(f=!0,t.consume(u),k):A(u)}function h(n){return t.consume(n),s=!0,k}function A(l){return f&&s&&(0,n.asciiAlpha)(c.previous)?(t.exit('literalAutolinkEmail'),t.exit('literalAutolink'),u(l)):o(l)}},previous:v},k={};let h=48;for(;h<123;)k[h]=p,h++,58===h?h=65:91===h&&(h=97);function A(t){return null===t||40===t||42===t||95===t||91===t||93===t||126===t||(0,n.markdownLineEndingOrSpace)(t)}function w(t){return!(0,n.asciiAlpha)(t)}function v(n){return!(47===n||L(n))}function L(t){return 43===t||45===t||46===t||95===t||(0,n.asciiAlphanumeric)(t)}function W(n){let t=n.length,u=!1;for(;t--;){const o=n[t][1];if(('labelLink'===o.type||'labelImage'===o.type)&&!o._balanced){u=!0;break}if(o._gfmAutolinkLiteralWalkedInto){u=!1;break}}return n.length>0&&!u&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),u}k[43]=p,k[45]=p,k[46]=p,k[95]=p,k[72]=[p,f],k[104]=[p,f],k[87]=[p,s],k[119]=[p,s]},2671,[2483]);
210
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmAutolinkLiteralHtml=function(){return{exit:{literalAutolinkEmail:n,literalAutolinkHttp:o,literalAutolinkWww:l}}};var t=r(d[0]);function l(t){c.call(this,t,'http://')}function n(t){c.call(this,t,'mailto:')}function o(t){c.call(this,t)}function c(l,n){const o=this.sliceSerialize(l);this.tag('<a href="'+(0,t.sanitizeUri)((n||'')+o)+'">'),this.raw(this.encode(o)),this.tag('</a>')}},2672,[2482]);
211
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmFootnote",{enumerable:!0,get:function(){return t.gfmFootnote}}),Object.defineProperty(e,"gfmFootnoteHtml",{enumerable:!0,get:function(){return n.gfmFootnoteHtml}}),Object.defineProperty(e,"defaultBackLabel",{enumerable:!0,get:function(){return n.defaultBackLabel}});var t=r(d[0]),n=r(d[1])},2673,[2674,2675]);
212
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmFootnote=function(){return{document:{91:{name:'gfmFootnoteDefinition',tokenize:F,continuation:{tokenize:k},exit:p}},text:{91:{name:'gfmFootnoteCall',tokenize:u},93:{name:'gfmPotentialFootnoteCall',add:'after',tokenize:c,resolveTo:s}}}};var t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]);const f={tokenize:function(t,o,l){const f=this;return(0,n.factorySpace)(t,function(t){const n=f.events[f.events.length-1];return n&&'gfmFootnoteDefinitionIndent'===n[1].type&&4===n[2].sliceSerialize(n[1],!0).length?o(t):l(t)},'gfmFootnoteDefinitionIndent',5)},partial:!0};function c(t,n,o){const f=this;let c=f.events.length;const s=f.parser.gfmFootnotes||(f.parser.gfmFootnotes=[]);let u;for(;c--;){const t=f.events[c][1];if("labelImage"===t.type){u=t;break}if('gfmFootnoteCall'===t.type||"labelLink"===t.type||"label"===t.type||"image"===t.type||"link"===t.type)break}return function(c){if(!u||!u._balanced)return o(c);const F=(0,l.normalizeIdentifier)(f.sliceSerialize({start:u.end,end:f.now()}));if(94!==F.codePointAt(0)||!s.includes(F.slice(1)))return o(c);return t.enter('gfmFootnoteCallLabelMarker'),t.consume(c),t.exit('gfmFootnoteCallLabelMarker'),n(c)}}function s(t,n){let o,l=t.length;for(;l--;)if("labelImage"===t[l][1].type&&'enter'===t[l][0]){o=t[l][1];break}t[l+1][1].type="data",t[l+3][1].type='gfmFootnoteCallLabelMarker';const f={type:'gfmFootnoteCall',start:Object.assign({},t[l+3][1].start),end:Object.assign({},t[t.length-1][1].end)},c={type:'gfmFootnoteCallMarker',start:Object.assign({},t[l+3][1].end),end:Object.assign({},t[l+3][1].end)};c.end.column++,c.end.offset++,c.end._bufferIndex++;const s={type:'gfmFootnoteCallString',start:Object.assign({},c.end),end:Object.assign({},t[t.length-1][1].start)},u={type:"chunkString",contentType:'string',start:Object.assign({},s.start),end:Object.assign({},s.end)},F=[t[l+1],t[l+2],['enter',f,n],t[l+3],t[l+4],['enter',c,n],['exit',c,n],['enter',s,n],['enter',u,n],['exit',u,n],['exit',s,n],t[t.length-2],t[t.length-1],['exit',f,n]];return t.splice(l,t.length-l+1,...F),t}function u(t,n,f){const c=this,s=c.parser.gfmFootnotes||(c.parser.gfmFootnotes=[]);let u,F=0;return function(n){return t.enter('gfmFootnoteCall'),t.enter('gfmFootnoteCallLabelMarker'),t.consume(n),t.exit('gfmFootnoteCallLabelMarker'),k};function k(n){return 94!==n?f(n):(t.enter('gfmFootnoteCallMarker'),t.consume(n),t.exit('gfmFootnoteCallMarker'),t.enter('gfmFootnoteCallString'),t.enter('chunkString').contentType='string',p)}function p(k){if(F>999||93===k&&!u||null===k||91===k||(0,o.markdownLineEndingOrSpace)(k))return f(k);if(93===k){t.exit('chunkString');const o=t.exit('gfmFootnoteCallString');return s.includes((0,l.normalizeIdentifier)(c.sliceSerialize(o)))?(t.enter('gfmFootnoteCallLabelMarker'),t.consume(k),t.exit('gfmFootnoteCallLabelMarker'),t.exit('gfmFootnoteCall'),n):f(k)}return(0,o.markdownLineEndingOrSpace)(k)||(u=!0),F++,t.consume(k),92===k?b:p}function b(n){return 91===n||92===n||93===n?(t.consume(n),F++,p):p(n)}}function F(t,f,c){const s=this,u=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let F,k,p=0;return function(n){return t.enter('gfmFootnoteDefinition')._container=!0,t.enter('gfmFootnoteDefinitionLabel'),t.enter('gfmFootnoteDefinitionLabelMarker'),t.consume(n),t.exit('gfmFootnoteDefinitionLabelMarker'),b};function b(n){return 94===n?(t.enter('gfmFootnoteDefinitionMarker'),t.consume(n),t.exit('gfmFootnoteDefinitionMarker'),t.enter('gfmFootnoteDefinitionLabelString'),t.enter('chunkString').contentType='string',x):c(n)}function x(n){if(p>999||93===n&&!k||null===n||91===n||(0,o.markdownLineEndingOrSpace)(n))return c(n);if(93===n){t.exit('chunkString');const o=t.exit('gfmFootnoteDefinitionLabelString');return F=(0,l.normalizeIdentifier)(s.sliceSerialize(o)),t.enter('gfmFootnoteDefinitionLabelMarker'),t.consume(n),t.exit('gfmFootnoteDefinitionLabelMarker'),t.exit('gfmFootnoteDefinitionLabel'),L}return(0,o.markdownLineEndingOrSpace)(n)||(k=!0),p++,t.consume(n),92===n?h:x}function h(n){return 91===n||92===n||93===n?(t.consume(n),p++,x):x(n)}function L(o){return 58===o?(t.enter('definitionMarker'),t.consume(o),t.exit('definitionMarker'),u.includes(F)||u.push(F),(0,n.factorySpace)(t,y,'gfmFootnoteDefinitionWhitespace')):c(o)}function y(t){return f(t)}}function k(n,o,l){return n.check(t.blankLine,o,n.attempt(f,o,l))}function p(t){t.exit('gfmFootnoteDefinition')}},2674,[2490,2486,2483,2481]);
213
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.defaultBackLabel=l,e.gfmFootnoteHtml=function(f){const h=f||s,c=h.label||'Footnotes',u=h.labelTagName||'h2',b=null===h.labelAttributes||void 0===h.labelAttributes?'class="sr-only"':h.labelAttributes,D=h.backLabel||l,F=null===h.clobberPrefix||void 0===h.clobberPrefix?'user-content-':h.clobberPrefix;return{enter:{gfmFootnoteDefinition(){this.getData('tightStack').push(!1)},gfmFootnoteDefinitionLabelString(){this.buffer()},gfmFootnoteCallString(){this.buffer()}},exit:{gfmFootnoteDefinition(){let t=this.getData('gfmFootnoteDefinitions');const o=this.getData('gfmFootnoteDefinitionStack'),s=this.getData('tightStack'),l=o.pop(),f=this.resume();t||this.setData('gfmFootnoteDefinitions',t={}),n.call(t,l)||(t[l]=f),s.pop(),this.setData('slurpOneLineEnding',!0),this.setData('lastWasTag')},gfmFootnoteDefinitionLabelString(o){let n=this.getData('gfmFootnoteDefinitionStack');n||this.setData('gfmFootnoteDefinitionStack',n=[]),n.push((0,t.normalizeIdentifier)(this.sliceSerialize(o))),this.resume(),this.buffer()},gfmFootnoteCallString(n){let s=this.getData('gfmFootnoteCallOrder'),l=this.getData('gfmFootnoteCallCounts');const f=(0,t.normalizeIdentifier)(this.sliceSerialize(n));let h;this.resume(),s||this.setData('gfmFootnoteCallOrder',s=[]),l||this.setData('gfmFootnoteCallCounts',l={});const c=s.indexOf(f),u=(0,o.sanitizeUri)(f.toLowerCase());-1===c?(s.push(f),l[f]=1,h=s.length):(l[f]++,h=c+1);const b=l[f];this.tag('<sup><a href="#'+F+'fn-'+u+'" id="'+F+'fnref-'+u+(b>1?'-'+b:'')+'" data-footnote-ref="" aria-describedby="footnote-label">'+String(h)+'</a></sup>')},null(){const t=this.getData('gfmFootnoteCallOrder')||[],n=this.getData('gfmFootnoteCallCounts')||{},s=this.getData('gfmFootnoteDefinitions')||{};let l=-1;for(t.length>0&&(this.lineEndingIfNeeded(),this.tag('<section data-footnotes="" class="footnotes"><'+u+' id="footnote-label"'+(b?' '+b:'')+'>'),this.raw(this.encode(c)),this.tag('</'+u+'>'),this.lineEndingIfNeeded(),this.tag('<ol>'));++l<t.length;){const f=t[l],h=(0,o.sanitizeUri)(f.toLowerCase());let c=0;const u=[];for(;++c<=n[f];)u.push('<a href="#'+F+'fnref-'+h+(c>1?'-'+c:'')+'" data-footnote-backref="" aria-label="'+this.encode('string'==typeof D?D:D(l,c))+'" class="data-footnote-backref">\u21a9'+(c>1?'<sup>'+c+'</sup>':'')+'</a>');const b=u.join(' ');let p=!1;this.lineEndingIfNeeded(),this.tag('<li id="'+F+'fn-'+h+'">'),this.lineEndingIfNeeded(),this.tag(s[f].replace(/<\/p>(?:\r?\n|\r)?$/,function(t){return p=!0,' '+b+t})),p||(this.lineEndingIfNeeded(),this.tag(b)),this.lineEndingIfNeeded(),this.tag('</li>')}t.length>0&&(this.lineEndingIfNeeded(),this.tag('</ol>'),this.lineEndingIfNeeded(),this.tag('</section>'))}}}};var t=r(d[0]),o=r(d[1]);const n={}.hasOwnProperty,s={};function l(t,o){return'Back to reference '+(t+1)+(o>1?'-'+o:'')}},2675,[2481,2482]);
214
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmStrikethroughHtml",{enumerable:!0,get:function(){return t.gfmStrikethroughHtml}}),Object.defineProperty(e,"gfmStrikethrough",{enumerable:!0,get:function(){return u.gfmStrikethrough}});var t=r(d[0]),u=r(d[1])},2676,[2677,2678]);
215
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmStrikethroughHtml=function(){return{enter:{strikethrough(){this.tag('<del>')}},exit:{strikethrough(){this.tag('</del>')}}}}},2677,[]);
216
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmStrikethrough=function(o){let u=(o||{}).singleTilde;const c={name:'strikethrough',tokenize:function(t,s,o){const c=this.previous,l=this.events;let h=0;return f;function f(n){return 126===c&&"characterEscape"!==l[l.length-1][1].type?o(n):(t.enter('strikethroughSequenceTemporary'),p(n))}function p(l){const f=(0,n.classifyCharacter)(c);if(126===l)return h>1?o(l):(t.consume(l),h++,p);if(h<2&&!u)return o(l);const y=t.exit('strikethroughSequenceTemporary'),k=(0,n.classifyCharacter)(l);return y._open=!k||2===k&&Boolean(f),y._close=!f||2===f&&Boolean(k),s(l)}},resolveAll:function(n,o){let u=-1;for(;++u<n.length;)if('enter'===n[u][0]&&'strikethroughSequenceTemporary'===n[u][1].type&&n[u][1]._close){let c=u;for(;c--;)if('exit'===n[c][0]&&'strikethroughSequenceTemporary'===n[c][1].type&&n[c][1]._open&&n[u][1].end.offset-n[u][1].start.offset===n[c][1].end.offset-n[c][1].start.offset){n[u][1].type='strikethroughSequence',n[c][1].type='strikethroughSequence';const l={type:'strikethrough',start:Object.assign({},n[c][1].start),end:Object.assign({},n[u][1].end)},h={type:'strikethroughText',start:Object.assign({},n[c][1].end),end:Object.assign({},n[u][1].start)},f=[['enter',l,o],['enter',n[c][1],o],['exit',n[c][1],o],['enter',h,o]],p=o.parser.constructs.insideSpan.null;p&&(0,t.splice)(f,f.length,0,(0,s.resolveAll)(p,n.slice(c+1,u),o)),(0,t.splice)(f,f.length,0,[['exit',h,o],['enter',n[u][1],o],['exit',n[u][1],o],['exit',l,o]]),(0,t.splice)(n,c-1,u-c+3,f),u=c+f.length-2;break}}u=-1;for(;++u<n.length;)'strikethroughSequenceTemporary'===n[u][1].type&&(n[u][1].type="data");return n}};null==u&&(u=!0);return{text:{126:c},insideSpan:{null:[c]},attentionMarkers:{null:[126]}}};var t=r(d[0]),n=r(d[1]),s=r(d[2])},2678,[2477,2492,2493]);
217
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmTableHtml",{enumerable:!0,get:function(){return t.gfmTableHtml}}),Object.defineProperty(e,"gfmTable",{enumerable:!0,get:function(){return n.gfmTable}});var t=r(d[0]),n=r(d[1])},2679,[2680,2681]);
218
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmTableHtml=function(){return{enter:{table(t){const n=t._align;this.lineEndingIfNeeded(),this.tag('<table>'),this.setData('tableAlign',n)},tableBody(){this.tag('<tbody>')},tableData(){const n=this.getData('tableAlign'),l=this.getData('tableColumn'),s=t[n[l]];void 0===s?this.buffer():(this.lineEndingIfNeeded(),this.tag('<td'+s+'>'))},tableHead(){this.lineEndingIfNeeded(),this.tag('<thead>')},tableHeader(){const n=this.getData('tableAlign'),l=this.getData('tableColumn'),s=t[n[l]];this.lineEndingIfNeeded(),this.tag('<th'+s+'>')},tableRow(){this.setData('tableColumn',0),this.lineEndingIfNeeded(),this.tag('<tr>')}},exit:{codeTextData(t){let l=this.sliceSerialize(t);this.getData('tableAlign')&&(l=l.replace(/\\([\\|])/g,n)),this.raw(this.encode(l))},table(){this.setData('tableAlign'),this.setData('slurpAllLineEndings'),this.lineEndingIfNeeded(),this.tag('</table>')},tableBody(){this.lineEndingIfNeeded(),this.tag('</tbody>')},tableData(){const t=this.getData('tableAlign'),n=this.getData('tableColumn');n in t?(this.tag('</td>'),this.setData('tableColumn',n+1)):this.resume()},tableHead(){this.lineEndingIfNeeded(),this.tag('</thead>')},tableHeader(){const t=this.getData('tableColumn');this.tag('</th>'),this.setData('tableColumn',t+1)},tableRow(){const n=this.getData('tableAlign');let l=this.getData('tableColumn');for(;l<n.length;)this.lineEndingIfNeeded(),this.tag('<td'+t[n[l]]+'></td>'),l++;this.setData('tableColumn',l),this.lineEndingIfNeeded(),this.tag('</tr>')}}}};const t={none:'',left:' align="left"',right:' align="right"',center:' align="center"'};function n(t,n){return'|'===n?n:t}},2680,[]);
219
+ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmTable=function(){return{flow:{null:{name:'table',tokenize:o,resolveAll:c}}}};var t=r(d[0]),n=r(d[1]),a=r(d[2]),l=r(d[3]);function o(a,l,o){const c=this;let s,u=0,b=0;return function(t){let n=c.events.length-1;for(;n>-1;){const{type:t}=c.events[n][1];if("lineEnding"!==t&&"linePrefix"!==t)break;n--}const a=n>-1?c.events[n][1].type:null,l='tableHead'===a||'tableRow'===a?C:p;if(l===C&&c.parser.lazy[c.now().line])return o(t);return l(t)};function p(t){return a.enter('tableHead'),a.enter('tableRow'),f(t)}function f(t){return 124===t||(s=!0,b+=1),v(t)}function v(l){return null===l?o(l):(0,n.markdownLineEnding)(l)?b>1?(b=0,c.interrupt=!0,a.exit('tableRow'),a.enter("lineEnding"),a.consume(l),a.exit("lineEnding"),D):o(l):(0,n.markdownSpace)(l)?(0,t.factorySpace)(a,v,"whitespace")(l):(b+=1,s&&(s=!1,u+=1),124===l?(a.enter('tableCellDivider'),a.consume(l),a.exit('tableCellDivider'),s=!0,v):(a.enter("data"),y(l)))}function y(t){return null===t||124===t||(0,n.markdownLineEndingOrSpace)(t)?(a.exit("data"),v(t)):(a.consume(t),92===t?w:y)}function w(t){return 92===t||124===t?(a.consume(t),y):y(t)}function D(l){return c.interrupt=!1,c.parser.lazy[c.now().line]?o(l):(a.enter('tableDelimiterRow'),s=!1,(0,n.markdownSpace)(l)?(0,t.factorySpace)(a,x,"linePrefix",c.parser.constructs.disable.null.includes('codeIndented')?void 0:4)(l):x(l))}function x(t){return 45===t||58===t?O(t):124===t?(s=!0,a.enter('tableCellDivider'),a.consume(t),a.exit('tableCellDivider'),k):E(t)}function k(l){return(0,n.markdownSpace)(l)?(0,t.factorySpace)(a,O,"whitespace")(l):O(l)}function O(t){return 58===t?(b+=1,s=!0,a.enter('tableDelimiterMarker'),a.consume(t),a.exit('tableDelimiterMarker'),j):45===t?(b+=1,j(t)):null===t||(0,n.markdownLineEnding)(t)?h(t):E(t)}function j(t){return 45===t?(a.enter('tableDelimiterFiller'),R(t)):E(t)}function R(t){return 45===t?(a.consume(t),R):58===t?(s=!0,a.exit('tableDelimiterFiller'),a.enter('tableDelimiterMarker'),a.consume(t),a.exit('tableDelimiterMarker'),S):(a.exit('tableDelimiterFiller'),S(t))}function S(l){return(0,n.markdownSpace)(l)?(0,t.factorySpace)(a,h,"whitespace")(l):h(l)}function h(t){return 124===t?x(t):(null===t||(0,n.markdownLineEnding)(t))&&s&&u===b?(a.exit('tableDelimiterRow'),a.exit('tableHead'),l(t)):E(t)}function E(t){return o(t)}function C(t){return a.enter('tableRow'),M(t)}function M(o){return 124===o?(a.enter('tableCellDivider'),a.consume(o),a.exit('tableCellDivider'),M):null===o||(0,n.markdownLineEnding)(o)?(a.exit('tableRow'),l(o)):(0,n.markdownSpace)(o)?(0,t.factorySpace)(a,M,"whitespace")(o):(a.enter("data"),H(o))}function H(t){return null===t||124===t||(0,n.markdownLineEndingOrSpace)(t)?(a.exit("data"),M(t)):(a.consume(t),92===t?L:H)}function L(t){return 92===t||124===t?(a.consume(t),H):H(t)}}function c(t,n){let o,c,b,p=-1,f=!0,v=0,y=[0,0,0,0],w=[0,0,0,0],D=!1,x=0;const k=new a.EditMap;for(;++p<t.length;){const a=t[p],l=a[1];'enter'===a[0]?'tableHead'===l.type?(D=!1,0!==x&&(u(k,n,x,o,c),c=void 0,x=0),o={type:'table',start:Object.assign({},l.start),end:Object.assign({},l.end)},k.add(p,0,[['enter',o,n]])):'tableRow'===l.type||'tableDelimiterRow'===l.type?(f=!0,b=void 0,y=[0,0,0,0],w=[0,p+1,0,0],D&&(D=!1,c={type:'tableBody',start:Object.assign({},l.start),end:Object.assign({},l.end)},k.add(p,0,[['enter',c,n]])),v='tableDelimiterRow'===l.type?2:c?3:1):!v||"data"!==l.type&&'tableDelimiterMarker'!==l.type&&'tableDelimiterFiller'!==l.type?'tableCellDivider'===l.type&&(f?f=!1:(0!==y[1]&&(w[0]=w[1],b=s(k,n,y,v,void 0,b)),y=w,w=[y[1],p,0,0])):(f=!1,0===w[2]&&(0!==y[1]&&(w[0]=w[1],b=s(k,n,y,v,void 0,b),y=[0,0,0,0]),w[2]=p)):'tableHead'===l.type?(D=!0,x=p):'tableRow'===l.type||'tableDelimiterRow'===l.type?(x=p,0!==y[1]?(w[0]=w[1],b=s(k,n,y,v,p,b)):0!==w[1]&&(b=s(k,n,w,v,p,b)),v=0):!v||"data"!==l.type&&'tableDelimiterMarker'!==l.type&&'tableDelimiterFiller'!==l.type||(w[3]=p)}for(0!==x&&u(k,n,x,o,c),k.consume(n.events),p=-1;++p<n.events.length;){const t=n.events[p];'enter'===t[0]&&'table'===t[1].type&&(t[1]._align=(0,l.gfmTableAlign)(n.events,p))}return t}function s(t,n,a,l,o,c){const s=1===l?'tableHeader':2===l?'tableDelimiter':'tableData';0!==a[0]&&(c.end=Object.assign({},b(n.events,a[0])),t.add(a[0],0,[['exit',c,n]]));const u=b(n.events,a[1]);if(c={type:s,start:Object.assign({},u),end:Object.assign({},u)},t.add(a[1],0,[['enter',c,n]]),0!==a[2]){const o=b(n.events,a[2]),c=b(n.events,a[3]),s={type:"tableContent",start:Object.assign({},o),end:Object.assign({},c)};if(t.add(a[2],0,[['enter',s,n]]),2!==l){const l=n.events[a[2]],o=n.events[a[3]];if(l[1].end=Object.assign({},o[1].end),l[1].type="chunkText",l[1].contentType="text",a[3]>a[2]+1){const n=a[2]+1,l=a[3]-a[2]-1;t.add(n,l,[])}}t.add(a[3]+1,0,[['exit',s,n]])}return void 0!==o&&(c.end=Object.assign({},b(n.events,o)),t.add(o,0,[['exit',c,n]]),c=void 0),c}function u(t,n,a,l,o){const c=[],s=b(n.events,a);o&&(o.end=Object.assign({},s),c.push(['exit',o,n])),l.end=Object.assign({},s),c.push(['exit',l,n]),t.add(a+1,0,c)}function b(t,n){const a=t[n],l='enter'===a[0]?'start':'end';return a[1][l]}},2681,[2486,2483,2682,2683]);
220
+ __d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"EditMap",{enumerable:!0,get:function(){return t}});class t{constructor(){this.map=[],this.index=new Map}add(t,s,h){n(this,t,s,h)}consume(t){if(this.map.sort(function(t,n){return t[0]-n[0]}),0===this.map.length)return;let n=this.map.length;const s=[];for(;n>0;)n-=1,s.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];s.push(t.slice()),t.length=0;let h=s.pop();for(;h;){for(const n of h)t.push(n);h=s.pop()}this.map.length=0,this.index.clear()}}function n(t,n,s,h){if(0===s&&0===h.length)return;const p=t.index.get(n);if(p)return p[1]+=s,void p[2].push(...h);const o=[n,s,h];t.map.push(o),t.index.set(n,o)}},2682,[]);
221
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmTableAlign=function(t,l){let n=!1;const o=[];for(;l<t.length;){const f=t[l];if(n){if('enter'===f[0])'tableContent'===f[1].type&&o.push('tableDelimiterMarker'===t[l+1][1].type?'left':'none');else if('tableContent'===f[1].type){if('tableDelimiterMarker'===t[l-1][1].type){const t=o.length-1;o[t]='left'===o[t]?'center':'right'}}else if('tableDelimiterRow'===f[1].type)break}else'enter'===f[0]&&'tableDelimiterRow'===f[1].type&&(n=!0);l+=1}return o}},2683,[]);
222
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmTagfilterHtml",{enumerable:!0,get:function(){return t.gfmTagfilterHtml}});var t=r(d[0])},2684,[2685]);
223
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmTagfilterHtml=function(){return{exit:{htmlFlowData(l){n.call(this,l,t)},htmlTextData(t){n.call(this,t,l)}}}};const t=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|title|textarea|xmp)(?=[\t\n\f\r />])/gi,l=new RegExp('^'+t.source,'i');function n(t,l){let n=this.sliceSerialize(t);this.options.allowDangerousHtml&&(n=n.replace(l,'&lt;$1$2')),this.raw(this.encode(n))}},2685,[]);
224
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"gfmTaskListItemHtml",{enumerable:!0,get:function(){return t.gfmTaskListItemHtml}}),Object.defineProperty(e,"gfmTaskListItem",{enumerable:!0,get:function(){return n.gfmTaskListItem}});var t=r(d[0]),n=r(d[1])},2686,[2687,2688]);
225
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmTaskListItemHtml=function(){return{enter:{taskListCheck(){this.tag('<input type="checkbox" disabled="" ')}},exit:{taskListCheck(){this.tag('/>')},taskListCheckValueChecked(){this.tag('checked="" ')}}}}},2687,[]);
226
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.gfmTaskListItem=function(){return{text:{91:c}}};var t=r(d[0]),n=r(d[1]);const c={name:'tasklistCheck',tokenize:function(t,c,k){const u=this;return function(n){if(null!==u.previous||!u._gfmTasklistFirstContentOfListItem)return k(n);return t.enter('taskListCheck'),t.enter('taskListCheckMarker'),t.consume(n),t.exit('taskListCheckMarker'),o};function o(c){return(0,n.markdownLineEndingOrSpace)(c)?(t.enter('taskListCheckValueUnchecked'),t.consume(c),t.exit('taskListCheckValueUnchecked'),h):88===c||120===c?(t.enter('taskListCheckValueChecked'),t.consume(c),t.exit('taskListCheckValueChecked'),h):k(c)}function h(n){return 93===n?(t.enter('taskListCheckMarker'),t.consume(n),t.exit('taskListCheckMarker'),t.exit('taskListCheck'),f):k(n)}function f(u){return(0,n.markdownLineEnding)(u)?c(u):(0,n.markdownSpace)(u)?t.check({tokenize:s},c,k)(u):k(u)}}};function s(n,c,s){return(0,t.factorySpace)(n,function(t){return null===t?s(t):c(t)},"whitespace")}},2688,[2486,2483]);
227
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2689,[2623]);
228
+ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0});var t=r(d[0]);Object.keys(t).forEach(function(n){'default'===n||Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})},2690,[2633]);