@surething/cockpit 1.0.266 → 1.0.268

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 (691) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +4 -3
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/cockpit-build.json +1 -1
  5. package/.next-prod/prerender-manifest.json +4 -4
  6. package/.next-prod/routes-manifest.json +6 -0
  7. package/.next-prod/server/app/_global-error/page.js +2 -2
  8. package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
  9. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next-prod/server/app/_global-error.html +1 -1
  11. package/.next-prod/server/app/_global-error.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  15. package/.next-prod/server/app/_not-found/page.js +1 -1
  16. package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
  17. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/.next-prod/server/app/_not-found.html +2 -2
  19. package/.next-prod/server/app/_not-found.rsc +3 -3
  20. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
  21. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
  22. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  23. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  24. package/.next-prod/server/app/api/agent/test/route.js +1 -1
  25. package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -1
  26. package/.next-prod/server/app/api/bash/route.js +1 -1
  27. package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
  28. package/.next-prod/server/app/api/chat/codex/route.js +1 -1
  29. package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
  30. package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
  31. package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
  32. package/.next-prod/server/app/api/chat/glm/route.js +1 -1
  33. package/.next-prod/server/app/api/chat/glm/route.js.nft.json +1 -1
  34. package/.next-prod/server/app/api/chat/kimi/route.js +1 -1
  35. package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
  36. package/.next-prod/server/app/api/chat/ollama/route.js +1 -1
  37. package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
  38. package/.next-prod/server/app/api/chat/route.js +1 -1
  39. package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
  40. package/.next-prod/server/app/api/chat/stop/route.js +1 -1
  41. package/.next-prod/server/app/api/chat/stop/route.js.nft.json +1 -1
  42. package/.next-prod/server/app/api/claude-stats/route.js +1 -1
  43. package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
  44. package/.next-prod/server/app/api/commands/route.js +1 -1
  45. package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
  46. package/.next-prod/server/app/api/comments/route.js +1 -1
  47. package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
  48. package/.next-prod/server/app/api/db/columns/route.js +1 -1
  49. package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
  50. package/.next-prod/server/app/api/db/connect/route.js +2 -2
  51. package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
  52. package/.next-prod/server/app/api/db/disconnect/route.js +1 -1
  53. package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
  54. package/.next-prod/server/app/api/db/export/route.js +1 -1
  55. package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
  56. package/.next-prod/server/app/api/db/query/route.js +1 -1
  57. package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
  58. package/.next-prod/server/app/api/db/schemas/route.js +2 -2
  59. package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
  60. package/.next-prod/server/app/api/deepseek/balance/route.js +1 -1
  61. package/.next-prod/server/app/api/deepseek/balance/route.js.nft.json +1 -1
  62. package/.next-prod/server/app/api/deepseek/credentials/route.js +1 -1
  63. package/.next-prod/server/app/api/deepseek/credentials/route.js.nft.json +1 -1
  64. package/.next-prod/server/app/api/deepseek/models/route.js +1 -1
  65. package/.next-prod/server/app/api/deepseek/models/route.js.nft.json +1 -1
  66. package/.next-prod/server/app/api/dev/spans/route.js +1 -1
  67. package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -1
  68. package/.next-prod/server/app/api/extension/version/route.js +1 -1
  69. package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
  70. package/.next-prod/server/app/api/file/route.js +1 -1
  71. package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
  72. package/.next-prod/server/app/api/files/blame/route.js +1 -1
  73. package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
  74. package/.next-prod/server/app/api/files/clipboard/route.js +1 -1
  75. package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
  76. package/.next-prod/server/app/api/files/copy/route.js +1 -1
  77. package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
  78. package/.next-prod/server/app/api/files/delete/route.js +1 -1
  79. package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
  80. package/.next-prod/server/app/api/files/expanded/route.js +1 -1
  81. package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
  82. package/.next-prod/server/app/api/files/index/route.js +1 -1
  83. package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
  84. package/.next-prod/server/app/api/files/init/route.js +1 -1
  85. package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
  86. package/.next-prod/server/app/api/files/paste/route.js +1 -1
  87. package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
  88. package/.next-prod/server/app/api/files/read/route.js +1 -1
  89. package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
  90. package/.next-prod/server/app/api/files/readdir/route.js +1 -1
  91. package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
  92. package/.next-prod/server/app/api/files/recent/route.js +1 -1
  93. package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
  94. package/.next-prod/server/app/api/files/save/route.js +1 -1
  95. package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
  96. package/.next-prod/server/app/api/files/search/route.js +1 -1
  97. package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
  98. package/.next-prod/server/app/api/files/stat/route.js +1 -1
  99. package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
  100. package/.next-prod/server/app/api/files/text/route.js +1 -1
  101. package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
  102. package/.next-prod/server/app/api/git/blob/route.js +1 -1
  103. package/.next-prod/server/app/api/git/blob/route.js.nft.json +1 -1
  104. package/.next-prod/server/app/api/git/branch-diff/route.js +1 -1
  105. package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
  106. package/.next-prod/server/app/api/git/branches/route.js +1 -1
  107. package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
  108. package/.next-prod/server/app/api/git/commit-diff/route.js +1 -1
  109. package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
  110. package/.next-prod/server/app/api/git/commits/route.js +1 -1
  111. package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
  112. package/.next-prod/server/app/api/git/current-branch/route.js +1 -1
  113. package/.next-prod/server/app/api/git/current-branch/route.js.nft.json +1 -1
  114. package/.next-prod/server/app/api/git/diff/route.js +1 -1
  115. package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
  116. package/.next-prod/server/app/api/git/discard/route.js +1 -1
  117. package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
  118. package/.next-prod/server/app/api/git/stage/route.js +1 -1
  119. package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
  120. package/.next-prod/server/app/api/git/status/route.js +1 -1
  121. package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
  122. package/.next-prod/server/app/api/git/unstage/route.js +1 -1
  123. package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
  124. package/.next-prod/server/app/api/git/worktree/route.js +1 -1
  125. package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
  126. package/.next-prod/server/app/api/glm/credentials/route.js +1 -1
  127. package/.next-prod/server/app/api/glm/credentials/route.js.nft.json +1 -1
  128. package/.next-prod/server/app/api/glm/models/route.js +1 -1
  129. package/.next-prod/server/app/api/glm/models/route.js.nft.json +1 -1
  130. package/.next-prod/server/app/api/glm/usage/route.js +1 -1
  131. package/.next-prod/server/app/api/glm/usage/route.js.nft.json +1 -1
  132. package/.next-prod/server/app/api/global-state/route.js +1 -1
  133. package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
  134. package/.next-prod/server/app/api/health/route.js +1 -1
  135. package/.next-prod/server/app/api/health/route.js.nft.json +1 -1
  136. package/.next-prod/server/app/api/html-apps/[id]/route.js +1 -1
  137. package/.next-prod/server/app/api/html-apps/[id]/route.js.nft.json +1 -1
  138. package/.next-prod/server/app/api/html-apps/route.js +1 -1
  139. package/.next-prod/server/app/api/html-apps/route.js.nft.json +1 -1
  140. package/.next-prod/server/app/api/jupyter/load/route.js +1 -1
  141. package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
  142. package/.next-prod/server/app/api/jupyter/save/route.js +1 -1
  143. package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
  144. package/.next-prod/server/app/api/jupyter/shutdown/route.js +1 -1
  145. package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
  146. package/.next-prod/server/app/api/kimi/credentials/route.js +1 -1
  147. package/.next-prod/server/app/api/kimi/credentials/route.js.nft.json +1 -1
  148. package/.next-prod/server/app/api/kimi/models/route.js +1 -1
  149. package/.next-prod/server/app/api/kimi/models/route.js.nft.json +1 -1
  150. package/.next-prod/server/app/api/kimi/usage/route.js +1 -1
  151. package/.next-prod/server/app/api/kimi/usage/route.js.nft.json +1 -1
  152. package/.next-prod/server/app/api/lsp/definition/route.js +1 -1
  153. package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
  154. package/.next-prod/server/app/api/lsp/hover/route.js +1 -1
  155. package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
  156. package/.next-prod/server/app/api/lsp/references/route.js +1 -1
  157. package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
  158. package/.next-prod/server/app/api/lsp/status/route.js +1 -1
  159. package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
  160. package/.next-prod/server/app/api/lsp/warmup/route.js +1 -1
  161. package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
  162. package/.next-prod/server/app/api/mysql/columns/route.js +1 -1
  163. package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
  164. package/.next-prod/server/app/api/mysql/connect/route.js +1 -1
  165. package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
  166. package/.next-prod/server/app/api/mysql/disconnect/route.js +1 -1
  167. package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
  168. package/.next-prod/server/app/api/mysql/export/route.js +1 -1
  169. package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
  170. package/.next-prod/server/app/api/mysql/query/route.js +1 -1
  171. package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
  172. package/.next-prod/server/app/api/mysql/schemas/route.js +2 -2
  173. package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
  174. package/.next-prod/server/app/api/neo4j/connect/route.js +1 -1
  175. package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
  176. package/.next-prod/server/app/api/neo4j/disconnect/route.js +1 -1
  177. package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
  178. package/.next-prod/server/app/api/neo4j/query/route.js +1 -1
  179. package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
  180. package/.next-prod/server/app/api/neo4j/schema/route.js +1 -1
  181. package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
  182. package/.next-prod/server/app/api/note/route.js +1 -1
  183. package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
  184. package/.next-prod/server/app/api/ollama/config/route.js +1 -1
  185. package/.next-prod/server/app/api/ollama/config/route.js.nft.json +1 -1
  186. package/.next-prod/server/app/api/ollama/models/route.js +1 -1
  187. package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
  188. package/.next-prod/server/app/api/ollama/start/route.js +1 -1
  189. package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
  190. package/.next-prod/server/app/api/open-cursor/route.js +1 -1
  191. package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
  192. package/.next-prod/server/app/api/open-vscode/route.js +1 -1
  193. package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
  194. package/.next-prod/server/app/api/pick-folder/route.js +1 -1
  195. package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
  196. package/.next-prod/server/app/api/pinned-sessions/route.js +1 -1
  197. package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
  198. package/.next-prod/server/app/api/project-settings/route.js +1 -1
  199. package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
  200. package/.next-prod/server/app/api/project-state/route.js +2 -2
  201. package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
  202. package/.next-prod/server/app/api/projectGraph/affected/route.js +1 -1
  203. package/.next-prod/server/app/api/projectGraph/affected/route.js.nft.json +1 -1
  204. package/.next-prod/server/app/api/projectGraph/callees/route.js +1 -1
  205. package/.next-prod/server/app/api/projectGraph/callees/route.js.nft.json +1 -1
  206. package/.next-prod/server/app/api/projectGraph/callers/route.js +1 -1
  207. package/.next-prod/server/app/api/projectGraph/callers/route.js.nft.json +1 -1
  208. package/.next-prod/server/app/api/projectGraph/coedit/route.js +1 -1
  209. package/.next-prod/server/app/api/projectGraph/coedit/route.js.nft.json +1 -1
  210. package/.next-prod/server/app/api/projectGraph/context/route.js +1 -1
  211. package/.next-prod/server/app/api/projectGraph/context/route.js.nft.json +1 -1
  212. package/.next-prod/server/app/api/projectGraph/file/route.js +1 -1
  213. package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
  214. package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
  215. package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
  216. package/.next-prod/server/app/api/projectGraph/impact/route.js +1 -1
  217. package/.next-prod/server/app/api/projectGraph/impact/route.js.nft.json +1 -1
  218. package/.next-prod/server/app/api/projectGraph/related/route.js +1 -1
  219. package/.next-prod/server/app/api/projectGraph/related/route.js.nft.json +1 -1
  220. package/.next-prod/server/app/api/projectGraph/risk/route.js +1 -1
  221. package/.next-prod/server/app/api/projectGraph/risk/route.js.nft.json +1 -1
  222. package/.next-prod/server/app/api/projectGraph/search/route.js +1 -1
  223. package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
  224. package/.next-prod/server/app/api/projects/route.js +1 -1
  225. package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
  226. package/.next-prod/server/app/api/prompts/config/route.js +1 -1
  227. package/.next-prod/server/app/api/prompts/config/route.js.nft.json +1 -1
  228. package/.next-prod/server/app/api/push/public-key/route.js +1 -1
  229. package/.next-prod/server/app/api/push/public-key/route.js.nft.json +1 -1
  230. package/.next-prod/server/app/api/push/subscribe/route.js +1 -1
  231. package/.next-prod/server/app/api/push/subscribe/route.js.nft.json +1 -1
  232. package/.next-prod/server/app/api/push/unsubscribe/route.js +1 -1
  233. package/.next-prod/server/app/api/push/unsubscribe/route.js.nft.json +1 -1
  234. package/.next-prod/server/app/api/redis/command/route.js +1 -1
  235. package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
  236. package/.next-prod/server/app/api/redis/connect/route.js +1 -1
  237. package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
  238. package/.next-prod/server/app/api/redis/delete/route.js +1 -1
  239. package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
  240. package/.next-prod/server/app/api/redis/disconnect/route.js +1 -1
  241. package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
  242. package/.next-prod/server/app/api/redis/get/route.js +1 -1
  243. package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
  244. package/.next-prod/server/app/api/redis/keys/route.js +1 -1
  245. package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
  246. package/.next-prod/server/app/api/redis/set/route.js +1 -1
  247. package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
  248. package/.next-prod/server/app/api/restart/route.js +1 -1
  249. package/.next-prod/server/app/api/restart/route.js.nft.json +1 -1
  250. package/.next-prod/server/app/api/review/[id]/comments/route.js +1 -1
  251. package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
  252. package/.next-prod/server/app/api/review/[id]/replies/route.js +1 -1
  253. package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
  254. package/.next-prod/server/app/api/review/[id]/route.js +1 -1
  255. package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
  256. package/.next-prod/server/app/api/review/identify/route.js +1 -1
  257. package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
  258. package/.next-prod/server/app/api/review/order/route.js +1 -1
  259. package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
  260. package/.next-prod/server/app/api/review/route.js +1 -1
  261. package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
  262. package/.next-prod/server/app/api/review/share-info/route.js +1 -1
  263. package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
  264. package/.next-prod/server/app/api/review/users/route.js +1 -1
  265. package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
  266. package/.next-prod/server/app/api/scheduled-tasks/route.js +2 -2
  267. package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
  268. package/.next-prod/server/app/api/services/config/route.js +1 -1
  269. package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
  270. package/.next-prod/server/app/api/services/scripts/route.js +1 -1
  271. package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
  272. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js +1 -1
  273. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
  274. package/.next-prod/server/app/api/session/[sessionId]/history/route.js +1 -1
  275. package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
  276. package/.next-prod/server/app/api/session-by-path/route.js +1 -1
  277. package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
  278. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js +1 -1
  279. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
  280. package/.next-prod/server/app/api/sessions/projects/route.js +1 -1
  281. package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
  282. package/.next-prod/server/app/api/sessions/route.js +1 -1
  283. package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
  284. package/.next-prod/server/app/api/settings/route.js +1 -1
  285. package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
  286. package/.next-prod/server/app/api/shutdown/route.js +1 -1
  287. package/.next-prod/server/app/api/shutdown/route.js.nft.json +1 -1
  288. package/.next-prod/server/app/api/skills/[id]/route.js +1 -1
  289. package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
  290. package/.next-prod/server/app/api/skills/content/route.js +1 -1
  291. package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
  292. package/.next-prod/server/app/api/skills/route.js +1 -1
  293. package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
  294. package/.next-prod/server/app/api/snapshots/blob/route.js +1 -0
  295. package/.next-prod/server/app/api/snapshots/blob/route.js.nft.json +1 -0
  296. package/.next-prod/server/app/api/snapshots/blob/route_client-reference-manifest.js +1 -0
  297. package/.next-prod/server/app/api/snapshots/diff/route.js +1 -1
  298. package/.next-prod/server/app/api/snapshots/diff/route.js.nft.json +1 -1
  299. package/.next-prod/server/app/api/snapshots/route.js +1 -1
  300. package/.next-prod/server/app/api/snapshots/route.js.nft.json +1 -1
  301. package/.next-prod/server/app/api/terminal/aliases/route.js +1 -1
  302. package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
  303. package/.next-prod/server/app/api/terminal/autocomplete/route.js +1 -1
  304. package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
  305. package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
  306. package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
  307. package/.next-prod/server/app/api/terminal/env/route.js +1 -1
  308. package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
  309. package/.next-prod/server/app/api/terminal/history/route.js +1 -1
  310. package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
  311. package/.next-prod/server/app/api/update/route.js +1 -1
  312. package/.next-prod/server/app/api/update/route.js.nft.json +1 -1
  313. package/.next-prod/server/app/api/update-state/route.js +1 -1
  314. package/.next-prod/server/app/api/update-state/route.js.nft.json +1 -1
  315. package/.next-prod/server/app/api/version/route.js +1 -1
  316. package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
  317. package/.next-prod/server/app/apps/[...path]/route.js +1 -1
  318. package/.next-prod/server/app/apps/[...path]/route.js.nft.json +1 -1
  319. package/.next-prod/server/app/favicon.ico/route.js +1 -1
  320. package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
  321. package/.next-prod/server/app/m/page.js +1 -1
  322. package/.next-prod/server/app/m/page.js.nft.json +1 -1
  323. package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
  324. package/.next-prod/server/app/manifest.webmanifest/route.js +2 -2
  325. package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  326. package/.next-prod/server/app/page.js +1 -1
  327. package/.next-prod/server/app/page.js.nft.json +1 -1
  328. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  329. package/.next-prod/server/app/project/page.js +1 -1
  330. package/.next-prod/server/app/project/page.js.nft.json +1 -1
  331. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  332. package/.next-prod/server/app/review/[id]/page.js +1 -1
  333. package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
  334. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  335. package/.next-prod/server/app-paths-manifest.json +4 -3
  336. package/.next-prod/server/chunks/2493.js +3 -3
  337. package/.next-prod/server/chunks/3286.js +3 -3
  338. package/.next-prod/server/chunks/{3641.js → 3583.js} +1 -1
  339. package/.next-prod/server/chunks/4949.js +1 -0
  340. package/.next-prod/server/chunks/516.js +1 -1
  341. package/.next-prod/server/chunks/5750.js +14 -14
  342. package/.next-prod/server/chunks/6548.js +1 -1
  343. package/.next-prod/server/chunks/7184.js +4 -4
  344. package/.next-prod/server/chunks/816.js +1 -1
  345. package/.next-prod/server/chunks/9312.js +1 -1
  346. package/.next-prod/server/chunks/9352.js +1 -1
  347. package/.next-prod/server/chunks/9830.js +1 -1
  348. package/.next-prod/server/middleware-build-manifest.js +1 -1
  349. package/.next-prod/server/pages/404.html +2 -2
  350. package/.next-prod/server/pages/500.html +1 -1
  351. package/.next-prod/server/server-reference-manifest.json +1 -1
  352. package/.next-prod/static/MM6vZhLQFwtUo_vz7BSfe/_buildManifest.js +1 -0
  353. package/.next-prod/static/chunks/33372-a2d65ba0d112fc24.js +35 -0
  354. package/.next-prod/static/chunks/46784-24ed72109d7c318b.js +716 -0
  355. package/.next-prod/static/chunks/{5504-583edbefcb22ed17.js → 87834-dfec736663e6aac2.js} +2 -2
  356. package/.next-prod/static/chunks/96911-08609dc685108dcc.js +15 -0
  357. package/.next-prod/static/chunks/app/_global-error/{page-c1a2c7e62ce669f7.js → page-db8b43ac5e6e9ac5.js} +1 -1
  358. package/.next-prod/static/chunks/app/api/agent/test/{route-c1a2c7e62ce669f7.js → route-db8b43ac5e6e9ac5.js} +1 -1
  359. package/.next-prod/static/chunks/app/api/bash/{route-c1a2c7e62ce669f7.js → route-db8b43ac5e6e9ac5.js} +1 -1
  360. package/.next-prod/static/chunks/app/api/chat/codex/{route-c1a2c7e62ce669f7.js → route-db8b43ac5e6e9ac5.js} +1 -1
  361. package/.next-prod/static/chunks/app/api/chat/deepseek/route-db8b43ac5e6e9ac5.js +1 -0
  362. package/.next-prod/static/chunks/app/api/chat/glm/route-db8b43ac5e6e9ac5.js +1 -0
  363. package/.next-prod/static/chunks/app/api/chat/kimi/route-db8b43ac5e6e9ac5.js +1 -0
  364. package/.next-prod/static/chunks/app/api/chat/ollama/route-db8b43ac5e6e9ac5.js +1 -0
  365. package/.next-prod/static/chunks/app/api/chat/route-db8b43ac5e6e9ac5.js +1 -0
  366. package/.next-prod/static/chunks/app/api/chat/stop/route-db8b43ac5e6e9ac5.js +1 -0
  367. package/.next-prod/static/chunks/app/api/claude-stats/route-db8b43ac5e6e9ac5.js +1 -0
  368. package/.next-prod/static/chunks/app/api/commands/route-db8b43ac5e6e9ac5.js +1 -0
  369. package/.next-prod/static/chunks/app/api/comments/route-db8b43ac5e6e9ac5.js +1 -0
  370. package/.next-prod/static/chunks/app/api/db/columns/route-db8b43ac5e6e9ac5.js +1 -0
  371. package/.next-prod/static/chunks/app/api/db/connect/route-db8b43ac5e6e9ac5.js +1 -0
  372. package/.next-prod/static/chunks/app/api/db/disconnect/route-db8b43ac5e6e9ac5.js +1 -0
  373. package/.next-prod/static/chunks/app/api/db/export/route-db8b43ac5e6e9ac5.js +1 -0
  374. package/.next-prod/static/chunks/app/api/db/query/route-db8b43ac5e6e9ac5.js +1 -0
  375. package/.next-prod/static/chunks/app/api/db/schemas/route-db8b43ac5e6e9ac5.js +1 -0
  376. package/.next-prod/static/chunks/app/api/deepseek/balance/route-db8b43ac5e6e9ac5.js +1 -0
  377. package/.next-prod/static/chunks/app/api/deepseek/credentials/route-db8b43ac5e6e9ac5.js +1 -0
  378. package/.next-prod/static/chunks/app/api/deepseek/models/route-db8b43ac5e6e9ac5.js +1 -0
  379. package/.next-prod/static/chunks/app/api/dev/spans/route-db8b43ac5e6e9ac5.js +1 -0
  380. package/.next-prod/static/chunks/app/api/extension/version/route-db8b43ac5e6e9ac5.js +1 -0
  381. package/.next-prod/static/chunks/app/api/file/route-db8b43ac5e6e9ac5.js +1 -0
  382. package/.next-prod/static/chunks/app/api/files/blame/route-db8b43ac5e6e9ac5.js +1 -0
  383. package/.next-prod/static/chunks/app/api/files/clipboard/route-db8b43ac5e6e9ac5.js +1 -0
  384. package/.next-prod/static/chunks/app/api/files/copy/route-db8b43ac5e6e9ac5.js +1 -0
  385. package/.next-prod/static/chunks/app/api/files/delete/route-db8b43ac5e6e9ac5.js +1 -0
  386. package/.next-prod/static/chunks/app/api/files/expanded/route-db8b43ac5e6e9ac5.js +1 -0
  387. package/.next-prod/static/chunks/app/api/files/index/route-db8b43ac5e6e9ac5.js +1 -0
  388. package/.next-prod/static/chunks/app/api/files/init/route-db8b43ac5e6e9ac5.js +1 -0
  389. package/.next-prod/static/chunks/app/api/files/paste/route-db8b43ac5e6e9ac5.js +1 -0
  390. package/.next-prod/static/chunks/app/api/files/read/route-db8b43ac5e6e9ac5.js +1 -0
  391. package/.next-prod/static/chunks/app/api/files/readdir/route-db8b43ac5e6e9ac5.js +1 -0
  392. package/.next-prod/static/chunks/app/api/files/recent/route-db8b43ac5e6e9ac5.js +1 -0
  393. package/.next-prod/static/chunks/app/api/files/save/route-db8b43ac5e6e9ac5.js +1 -0
  394. package/.next-prod/static/chunks/app/api/files/search/route-db8b43ac5e6e9ac5.js +1 -0
  395. package/.next-prod/static/chunks/app/api/files/stat/route-db8b43ac5e6e9ac5.js +1 -0
  396. package/.next-prod/static/chunks/app/api/files/text/route-db8b43ac5e6e9ac5.js +1 -0
  397. package/.next-prod/static/chunks/app/api/git/blob/route-db8b43ac5e6e9ac5.js +1 -0
  398. package/.next-prod/static/chunks/app/api/git/branch-diff/route-db8b43ac5e6e9ac5.js +1 -0
  399. package/.next-prod/static/chunks/app/api/git/branches/route-db8b43ac5e6e9ac5.js +1 -0
  400. package/.next-prod/static/chunks/app/api/git/commit-diff/route-db8b43ac5e6e9ac5.js +1 -0
  401. package/.next-prod/static/chunks/app/api/git/commits/route-db8b43ac5e6e9ac5.js +1 -0
  402. package/.next-prod/static/chunks/app/api/git/current-branch/route-db8b43ac5e6e9ac5.js +1 -0
  403. package/.next-prod/static/chunks/app/api/git/diff/route-db8b43ac5e6e9ac5.js +1 -0
  404. package/.next-prod/static/chunks/app/api/git/discard/route-db8b43ac5e6e9ac5.js +1 -0
  405. package/.next-prod/static/chunks/app/api/git/stage/route-db8b43ac5e6e9ac5.js +1 -0
  406. package/.next-prod/static/chunks/app/api/git/status/route-db8b43ac5e6e9ac5.js +1 -0
  407. package/.next-prod/static/chunks/app/api/git/unstage/route-db8b43ac5e6e9ac5.js +1 -0
  408. package/.next-prod/static/chunks/app/api/git/worktree/route-db8b43ac5e6e9ac5.js +1 -0
  409. package/.next-prod/static/chunks/app/api/glm/credentials/route-db8b43ac5e6e9ac5.js +1 -0
  410. package/.next-prod/static/chunks/app/api/glm/models/route-db8b43ac5e6e9ac5.js +1 -0
  411. package/.next-prod/static/chunks/app/api/glm/usage/route-db8b43ac5e6e9ac5.js +1 -0
  412. package/.next-prod/static/chunks/app/api/global-state/route-db8b43ac5e6e9ac5.js +1 -0
  413. package/.next-prod/static/chunks/app/api/health/route-db8b43ac5e6e9ac5.js +1 -0
  414. package/.next-prod/static/chunks/app/api/html-apps/[id]/route-db8b43ac5e6e9ac5.js +1 -0
  415. package/.next-prod/static/chunks/app/api/html-apps/route-db8b43ac5e6e9ac5.js +1 -0
  416. package/.next-prod/static/chunks/app/api/jupyter/load/route-db8b43ac5e6e9ac5.js +1 -0
  417. package/.next-prod/static/chunks/app/api/jupyter/save/route-db8b43ac5e6e9ac5.js +1 -0
  418. package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-db8b43ac5e6e9ac5.js +1 -0
  419. package/.next-prod/static/chunks/app/api/kimi/credentials/route-db8b43ac5e6e9ac5.js +1 -0
  420. package/.next-prod/static/chunks/app/api/kimi/models/route-db8b43ac5e6e9ac5.js +1 -0
  421. package/.next-prod/static/chunks/app/api/kimi/usage/route-db8b43ac5e6e9ac5.js +1 -0
  422. package/.next-prod/static/chunks/app/api/lsp/definition/route-db8b43ac5e6e9ac5.js +1 -0
  423. package/.next-prod/static/chunks/app/api/lsp/hover/route-db8b43ac5e6e9ac5.js +1 -0
  424. package/.next-prod/static/chunks/app/api/lsp/references/route-db8b43ac5e6e9ac5.js +1 -0
  425. package/.next-prod/static/chunks/app/api/lsp/status/route-db8b43ac5e6e9ac5.js +1 -0
  426. package/.next-prod/static/chunks/app/api/lsp/warmup/route-db8b43ac5e6e9ac5.js +1 -0
  427. package/.next-prod/static/chunks/app/api/mysql/columns/route-db8b43ac5e6e9ac5.js +1 -0
  428. package/.next-prod/static/chunks/app/api/mysql/connect/route-db8b43ac5e6e9ac5.js +1 -0
  429. package/.next-prod/static/chunks/app/api/mysql/disconnect/route-db8b43ac5e6e9ac5.js +1 -0
  430. package/.next-prod/static/chunks/app/api/mysql/export/route-db8b43ac5e6e9ac5.js +1 -0
  431. package/.next-prod/static/chunks/app/api/mysql/query/route-db8b43ac5e6e9ac5.js +1 -0
  432. package/.next-prod/static/chunks/app/api/mysql/schemas/route-db8b43ac5e6e9ac5.js +1 -0
  433. package/.next-prod/static/chunks/app/api/neo4j/connect/route-db8b43ac5e6e9ac5.js +1 -0
  434. package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-db8b43ac5e6e9ac5.js +1 -0
  435. package/.next-prod/static/chunks/app/api/neo4j/query/route-db8b43ac5e6e9ac5.js +1 -0
  436. package/.next-prod/static/chunks/app/api/neo4j/schema/route-db8b43ac5e6e9ac5.js +1 -0
  437. package/.next-prod/static/chunks/app/api/note/route-db8b43ac5e6e9ac5.js +1 -0
  438. package/.next-prod/static/chunks/app/api/ollama/config/route-db8b43ac5e6e9ac5.js +1 -0
  439. package/.next-prod/static/chunks/app/api/ollama/models/route-db8b43ac5e6e9ac5.js +1 -0
  440. package/.next-prod/static/chunks/app/api/ollama/start/route-db8b43ac5e6e9ac5.js +1 -0
  441. package/.next-prod/static/chunks/app/api/open-cursor/route-db8b43ac5e6e9ac5.js +1 -0
  442. package/.next-prod/static/chunks/app/api/open-vscode/route-db8b43ac5e6e9ac5.js +1 -0
  443. package/.next-prod/static/chunks/app/api/pick-folder/route-db8b43ac5e6e9ac5.js +1 -0
  444. package/.next-prod/static/chunks/app/api/pinned-sessions/route-db8b43ac5e6e9ac5.js +1 -0
  445. package/.next-prod/static/chunks/app/api/project-settings/route-db8b43ac5e6e9ac5.js +1 -0
  446. package/.next-prod/static/chunks/app/api/project-state/route-db8b43ac5e6e9ac5.js +1 -0
  447. package/.next-prod/static/chunks/app/api/projectGraph/affected/route-db8b43ac5e6e9ac5.js +1 -0
  448. package/.next-prod/static/chunks/app/api/projectGraph/callees/route-db8b43ac5e6e9ac5.js +1 -0
  449. package/.next-prod/static/chunks/app/api/projectGraph/callers/route-db8b43ac5e6e9ac5.js +1 -0
  450. package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-db8b43ac5e6e9ac5.js +1 -0
  451. package/.next-prod/static/chunks/app/api/projectGraph/context/route-db8b43ac5e6e9ac5.js +1 -0
  452. package/.next-prod/static/chunks/app/api/projectGraph/file/route-db8b43ac5e6e9ac5.js +1 -0
  453. package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-db8b43ac5e6e9ac5.js +1 -0
  454. package/.next-prod/static/chunks/app/api/projectGraph/impact/route-db8b43ac5e6e9ac5.js +1 -0
  455. package/.next-prod/static/chunks/app/api/projectGraph/related/route-db8b43ac5e6e9ac5.js +1 -0
  456. package/.next-prod/static/chunks/app/api/projectGraph/risk/route-db8b43ac5e6e9ac5.js +1 -0
  457. package/.next-prod/static/chunks/app/api/projectGraph/search/route-db8b43ac5e6e9ac5.js +1 -0
  458. package/.next-prod/static/chunks/app/api/projects/route-db8b43ac5e6e9ac5.js +1 -0
  459. package/.next-prod/static/chunks/app/api/prompts/config/route-db8b43ac5e6e9ac5.js +1 -0
  460. package/.next-prod/static/chunks/app/api/push/public-key/route-db8b43ac5e6e9ac5.js +1 -0
  461. package/.next-prod/static/chunks/app/api/push/subscribe/route-db8b43ac5e6e9ac5.js +1 -0
  462. package/.next-prod/static/chunks/app/api/push/unsubscribe/route-db8b43ac5e6e9ac5.js +1 -0
  463. package/.next-prod/static/chunks/app/api/redis/command/route-db8b43ac5e6e9ac5.js +1 -0
  464. package/.next-prod/static/chunks/app/api/redis/connect/route-db8b43ac5e6e9ac5.js +1 -0
  465. package/.next-prod/static/chunks/app/api/redis/delete/route-db8b43ac5e6e9ac5.js +1 -0
  466. package/.next-prod/static/chunks/app/api/redis/disconnect/route-db8b43ac5e6e9ac5.js +1 -0
  467. package/.next-prod/static/chunks/app/api/redis/get/route-db8b43ac5e6e9ac5.js +1 -0
  468. package/.next-prod/static/chunks/app/api/redis/keys/route-db8b43ac5e6e9ac5.js +1 -0
  469. package/.next-prod/static/chunks/app/api/redis/set/route-db8b43ac5e6e9ac5.js +1 -0
  470. package/.next-prod/static/chunks/app/api/restart/route-db8b43ac5e6e9ac5.js +1 -0
  471. package/.next-prod/static/chunks/app/api/review/[id]/comments/route-db8b43ac5e6e9ac5.js +1 -0
  472. package/.next-prod/static/chunks/app/api/review/[id]/replies/route-db8b43ac5e6e9ac5.js +1 -0
  473. package/.next-prod/static/chunks/app/api/review/[id]/route-db8b43ac5e6e9ac5.js +1 -0
  474. package/.next-prod/static/chunks/app/api/review/identify/route-db8b43ac5e6e9ac5.js +1 -0
  475. package/.next-prod/static/chunks/app/api/review/order/route-db8b43ac5e6e9ac5.js +1 -0
  476. package/.next-prod/static/chunks/app/api/review/route-db8b43ac5e6e9ac5.js +1 -0
  477. package/.next-prod/static/chunks/app/api/review/share-info/route-db8b43ac5e6e9ac5.js +1 -0
  478. package/.next-prod/static/chunks/app/api/review/users/route-db8b43ac5e6e9ac5.js +1 -0
  479. package/.next-prod/static/chunks/app/api/scheduled-tasks/route-db8b43ac5e6e9ac5.js +1 -0
  480. package/.next-prod/static/chunks/app/api/services/config/route-db8b43ac5e6e9ac5.js +1 -0
  481. package/.next-prod/static/chunks/app/api/services/scripts/route-db8b43ac5e6e9ac5.js +1 -0
  482. package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-db8b43ac5e6e9ac5.js +1 -0
  483. package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-db8b43ac5e6e9ac5.js +1 -0
  484. package/.next-prod/static/chunks/app/api/session-by-path/route-db8b43ac5e6e9ac5.js +1 -0
  485. package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-db8b43ac5e6e9ac5.js +1 -0
  486. package/.next-prod/static/chunks/app/api/sessions/projects/route-db8b43ac5e6e9ac5.js +1 -0
  487. package/.next-prod/static/chunks/app/api/sessions/route-db8b43ac5e6e9ac5.js +1 -0
  488. package/.next-prod/static/chunks/app/api/settings/route-db8b43ac5e6e9ac5.js +1 -0
  489. package/.next-prod/static/chunks/app/api/shutdown/route-db8b43ac5e6e9ac5.js +1 -0
  490. package/.next-prod/static/chunks/app/api/skills/[id]/route-db8b43ac5e6e9ac5.js +1 -0
  491. package/.next-prod/static/chunks/app/api/skills/content/route-db8b43ac5e6e9ac5.js +1 -0
  492. package/.next-prod/static/chunks/app/api/skills/route-db8b43ac5e6e9ac5.js +1 -0
  493. package/.next-prod/static/chunks/app/api/snapshots/blob/route-db8b43ac5e6e9ac5.js +1 -0
  494. package/.next-prod/static/chunks/app/api/snapshots/diff/route-db8b43ac5e6e9ac5.js +1 -0
  495. package/.next-prod/static/chunks/app/api/snapshots/route-db8b43ac5e6e9ac5.js +1 -0
  496. package/.next-prod/static/chunks/app/api/terminal/aliases/route-db8b43ac5e6e9ac5.js +1 -0
  497. package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-db8b43ac5e6e9ac5.js +1 -0
  498. package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-db8b43ac5e6e9ac5.js +1 -0
  499. package/.next-prod/static/chunks/app/api/terminal/env/route-db8b43ac5e6e9ac5.js +1 -0
  500. package/.next-prod/static/chunks/app/api/terminal/history/route-db8b43ac5e6e9ac5.js +1 -0
  501. package/.next-prod/static/chunks/app/api/update/route-db8b43ac5e6e9ac5.js +1 -0
  502. package/.next-prod/static/chunks/app/api/update-state/route-db8b43ac5e6e9ac5.js +1 -0
  503. package/.next-prod/static/chunks/app/api/version/route-db8b43ac5e6e9ac5.js +1 -0
  504. package/.next-prod/static/chunks/app/apps/[...path]/route-db8b43ac5e6e9ac5.js +1 -0
  505. package/.next-prod/static/chunks/app/{layout-60f41d682cd860e9.js → layout-9585d7901d2a6c15.js} +1 -1
  506. package/.next-prod/static/chunks/app/m/{page-7eabf179a8b13f49.js → page-69cf611ceae66f33.js} +1 -1
  507. package/.next-prod/static/chunks/app/manifest.webmanifest/route-db8b43ac5e6e9ac5.js +1 -0
  508. package/.next-prod/static/chunks/app/page-340e8a5ca67a0dad.js +1 -0
  509. package/.next-prod/static/chunks/app/project/page-340e8a5ca67a0dad.js +1 -0
  510. package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-db8b43ac5e6e9ac5.js +1 -0
  511. package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-db8b43ac5e6e9ac5.js +1 -0
  512. package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-db8b43ac5e6e9ac5.js +1 -0
  513. package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-db8b43ac5e6e9ac5.js +1 -0
  514. package/.next-prod/static/css/303e8ac791ff3d31.css +1 -0
  515. package/.next-prod/trace +15 -14
  516. package/.next-prod/trace-build +1 -1
  517. package/.next-prod/types/app/api/snapshots/blob/route.ts +353 -0
  518. package/.next-prod/types/routes.d.ts +2 -1
  519. package/.next-prod/types/validator.ts +9 -0
  520. package/bin/cock-service.mjs +10 -8
  521. package/bin/cock.mjs +8 -6
  522. package/bin/postinstall.mjs +9 -8
  523. package/bin/updater.mjs +64 -26
  524. package/dist/{chunk-FBAFMLUC.mjs → chunk-6EMR3NZV.mjs} +9 -5
  525. package/dist/{chunk-ZE2JXL6E.mjs → chunk-ETYX2YQF.mjs} +141 -59
  526. package/dist/{chunk-H6AI4XJC.mjs → chunk-SGUW2QJI.mjs} +1 -1
  527. package/dist/httpApi.mjs +2 -2
  528. package/dist/scheduledTasks.mjs +187 -37
  529. package/dist/{server-HRP33LCV.mjs → server-C6LPAKPM.mjs} +2 -2
  530. package/dist/wsServer.mjs +8 -4
  531. package/package.json +6 -5
  532. package/public/html-lib/json-viewer.js +12 -12
  533. package/scripts/agentBinaries.mjs +86 -0
  534. package/.next-prod/server/chunks/9281.js +0 -1
  535. package/.next-prod/static/YOIsQRqVhYPuRyXlhwhoY/_buildManifest.js +0 -1
  536. package/.next-prod/static/chunks/33940-9631b513c48757f4.js +0 -35
  537. package/.next-prod/static/chunks/46784-031e2d50dc5f9fba.js +0 -716
  538. package/.next-prod/static/chunks/72353-f1aaa693ddc49568.js +0 -15
  539. package/.next-prod/static/chunks/app/api/chat/deepseek/route-c1a2c7e62ce669f7.js +0 -1
  540. package/.next-prod/static/chunks/app/api/chat/glm/route-c1a2c7e62ce669f7.js +0 -1
  541. package/.next-prod/static/chunks/app/api/chat/kimi/route-c1a2c7e62ce669f7.js +0 -1
  542. package/.next-prod/static/chunks/app/api/chat/ollama/route-c1a2c7e62ce669f7.js +0 -1
  543. package/.next-prod/static/chunks/app/api/chat/route-c1a2c7e62ce669f7.js +0 -1
  544. package/.next-prod/static/chunks/app/api/chat/stop/route-c1a2c7e62ce669f7.js +0 -1
  545. package/.next-prod/static/chunks/app/api/claude-stats/route-c1a2c7e62ce669f7.js +0 -1
  546. package/.next-prod/static/chunks/app/api/commands/route-c1a2c7e62ce669f7.js +0 -1
  547. package/.next-prod/static/chunks/app/api/comments/route-c1a2c7e62ce669f7.js +0 -1
  548. package/.next-prod/static/chunks/app/api/db/columns/route-c1a2c7e62ce669f7.js +0 -1
  549. package/.next-prod/static/chunks/app/api/db/connect/route-c1a2c7e62ce669f7.js +0 -1
  550. package/.next-prod/static/chunks/app/api/db/disconnect/route-c1a2c7e62ce669f7.js +0 -1
  551. package/.next-prod/static/chunks/app/api/db/export/route-c1a2c7e62ce669f7.js +0 -1
  552. package/.next-prod/static/chunks/app/api/db/query/route-c1a2c7e62ce669f7.js +0 -1
  553. package/.next-prod/static/chunks/app/api/db/schemas/route-c1a2c7e62ce669f7.js +0 -1
  554. package/.next-prod/static/chunks/app/api/deepseek/balance/route-c1a2c7e62ce669f7.js +0 -1
  555. package/.next-prod/static/chunks/app/api/deepseek/credentials/route-c1a2c7e62ce669f7.js +0 -1
  556. package/.next-prod/static/chunks/app/api/deepseek/models/route-c1a2c7e62ce669f7.js +0 -1
  557. package/.next-prod/static/chunks/app/api/dev/spans/route-c1a2c7e62ce669f7.js +0 -1
  558. package/.next-prod/static/chunks/app/api/extension/version/route-c1a2c7e62ce669f7.js +0 -1
  559. package/.next-prod/static/chunks/app/api/file/route-c1a2c7e62ce669f7.js +0 -1
  560. package/.next-prod/static/chunks/app/api/files/blame/route-c1a2c7e62ce669f7.js +0 -1
  561. package/.next-prod/static/chunks/app/api/files/clipboard/route-c1a2c7e62ce669f7.js +0 -1
  562. package/.next-prod/static/chunks/app/api/files/copy/route-c1a2c7e62ce669f7.js +0 -1
  563. package/.next-prod/static/chunks/app/api/files/delete/route-c1a2c7e62ce669f7.js +0 -1
  564. package/.next-prod/static/chunks/app/api/files/expanded/route-c1a2c7e62ce669f7.js +0 -1
  565. package/.next-prod/static/chunks/app/api/files/index/route-c1a2c7e62ce669f7.js +0 -1
  566. package/.next-prod/static/chunks/app/api/files/init/route-c1a2c7e62ce669f7.js +0 -1
  567. package/.next-prod/static/chunks/app/api/files/paste/route-c1a2c7e62ce669f7.js +0 -1
  568. package/.next-prod/static/chunks/app/api/files/read/route-c1a2c7e62ce669f7.js +0 -1
  569. package/.next-prod/static/chunks/app/api/files/readdir/route-c1a2c7e62ce669f7.js +0 -1
  570. package/.next-prod/static/chunks/app/api/files/recent/route-c1a2c7e62ce669f7.js +0 -1
  571. package/.next-prod/static/chunks/app/api/files/save/route-c1a2c7e62ce669f7.js +0 -1
  572. package/.next-prod/static/chunks/app/api/files/search/route-c1a2c7e62ce669f7.js +0 -1
  573. package/.next-prod/static/chunks/app/api/files/stat/route-c1a2c7e62ce669f7.js +0 -1
  574. package/.next-prod/static/chunks/app/api/files/text/route-c1a2c7e62ce669f7.js +0 -1
  575. package/.next-prod/static/chunks/app/api/git/blob/route-c1a2c7e62ce669f7.js +0 -1
  576. package/.next-prod/static/chunks/app/api/git/branch-diff/route-c1a2c7e62ce669f7.js +0 -1
  577. package/.next-prod/static/chunks/app/api/git/branches/route-c1a2c7e62ce669f7.js +0 -1
  578. package/.next-prod/static/chunks/app/api/git/commit-diff/route-c1a2c7e62ce669f7.js +0 -1
  579. package/.next-prod/static/chunks/app/api/git/commits/route-c1a2c7e62ce669f7.js +0 -1
  580. package/.next-prod/static/chunks/app/api/git/current-branch/route-c1a2c7e62ce669f7.js +0 -1
  581. package/.next-prod/static/chunks/app/api/git/diff/route-c1a2c7e62ce669f7.js +0 -1
  582. package/.next-prod/static/chunks/app/api/git/discard/route-c1a2c7e62ce669f7.js +0 -1
  583. package/.next-prod/static/chunks/app/api/git/stage/route-c1a2c7e62ce669f7.js +0 -1
  584. package/.next-prod/static/chunks/app/api/git/status/route-c1a2c7e62ce669f7.js +0 -1
  585. package/.next-prod/static/chunks/app/api/git/unstage/route-c1a2c7e62ce669f7.js +0 -1
  586. package/.next-prod/static/chunks/app/api/git/worktree/route-c1a2c7e62ce669f7.js +0 -1
  587. package/.next-prod/static/chunks/app/api/glm/credentials/route-c1a2c7e62ce669f7.js +0 -1
  588. package/.next-prod/static/chunks/app/api/glm/models/route-c1a2c7e62ce669f7.js +0 -1
  589. package/.next-prod/static/chunks/app/api/glm/usage/route-c1a2c7e62ce669f7.js +0 -1
  590. package/.next-prod/static/chunks/app/api/global-state/route-c1a2c7e62ce669f7.js +0 -1
  591. package/.next-prod/static/chunks/app/api/health/route-c1a2c7e62ce669f7.js +0 -1
  592. package/.next-prod/static/chunks/app/api/html-apps/[id]/route-c1a2c7e62ce669f7.js +0 -1
  593. package/.next-prod/static/chunks/app/api/html-apps/route-c1a2c7e62ce669f7.js +0 -1
  594. package/.next-prod/static/chunks/app/api/jupyter/load/route-c1a2c7e62ce669f7.js +0 -1
  595. package/.next-prod/static/chunks/app/api/jupyter/save/route-c1a2c7e62ce669f7.js +0 -1
  596. package/.next-prod/static/chunks/app/api/jupyter/shutdown/route-c1a2c7e62ce669f7.js +0 -1
  597. package/.next-prod/static/chunks/app/api/kimi/credentials/route-c1a2c7e62ce669f7.js +0 -1
  598. package/.next-prod/static/chunks/app/api/kimi/models/route-c1a2c7e62ce669f7.js +0 -1
  599. package/.next-prod/static/chunks/app/api/kimi/usage/route-c1a2c7e62ce669f7.js +0 -1
  600. package/.next-prod/static/chunks/app/api/lsp/definition/route-c1a2c7e62ce669f7.js +0 -1
  601. package/.next-prod/static/chunks/app/api/lsp/hover/route-c1a2c7e62ce669f7.js +0 -1
  602. package/.next-prod/static/chunks/app/api/lsp/references/route-c1a2c7e62ce669f7.js +0 -1
  603. package/.next-prod/static/chunks/app/api/lsp/status/route-c1a2c7e62ce669f7.js +0 -1
  604. package/.next-prod/static/chunks/app/api/lsp/warmup/route-c1a2c7e62ce669f7.js +0 -1
  605. package/.next-prod/static/chunks/app/api/mysql/columns/route-c1a2c7e62ce669f7.js +0 -1
  606. package/.next-prod/static/chunks/app/api/mysql/connect/route-c1a2c7e62ce669f7.js +0 -1
  607. package/.next-prod/static/chunks/app/api/mysql/disconnect/route-c1a2c7e62ce669f7.js +0 -1
  608. package/.next-prod/static/chunks/app/api/mysql/export/route-c1a2c7e62ce669f7.js +0 -1
  609. package/.next-prod/static/chunks/app/api/mysql/query/route-c1a2c7e62ce669f7.js +0 -1
  610. package/.next-prod/static/chunks/app/api/mysql/schemas/route-c1a2c7e62ce669f7.js +0 -1
  611. package/.next-prod/static/chunks/app/api/neo4j/connect/route-c1a2c7e62ce669f7.js +0 -1
  612. package/.next-prod/static/chunks/app/api/neo4j/disconnect/route-c1a2c7e62ce669f7.js +0 -1
  613. package/.next-prod/static/chunks/app/api/neo4j/query/route-c1a2c7e62ce669f7.js +0 -1
  614. package/.next-prod/static/chunks/app/api/neo4j/schema/route-c1a2c7e62ce669f7.js +0 -1
  615. package/.next-prod/static/chunks/app/api/note/route-c1a2c7e62ce669f7.js +0 -1
  616. package/.next-prod/static/chunks/app/api/ollama/config/route-c1a2c7e62ce669f7.js +0 -1
  617. package/.next-prod/static/chunks/app/api/ollama/models/route-c1a2c7e62ce669f7.js +0 -1
  618. package/.next-prod/static/chunks/app/api/ollama/start/route-c1a2c7e62ce669f7.js +0 -1
  619. package/.next-prod/static/chunks/app/api/open-cursor/route-c1a2c7e62ce669f7.js +0 -1
  620. package/.next-prod/static/chunks/app/api/open-vscode/route-c1a2c7e62ce669f7.js +0 -1
  621. package/.next-prod/static/chunks/app/api/pick-folder/route-c1a2c7e62ce669f7.js +0 -1
  622. package/.next-prod/static/chunks/app/api/pinned-sessions/route-c1a2c7e62ce669f7.js +0 -1
  623. package/.next-prod/static/chunks/app/api/project-settings/route-c1a2c7e62ce669f7.js +0 -1
  624. package/.next-prod/static/chunks/app/api/project-state/route-c1a2c7e62ce669f7.js +0 -1
  625. package/.next-prod/static/chunks/app/api/projectGraph/affected/route-c1a2c7e62ce669f7.js +0 -1
  626. package/.next-prod/static/chunks/app/api/projectGraph/callees/route-c1a2c7e62ce669f7.js +0 -1
  627. package/.next-prod/static/chunks/app/api/projectGraph/callers/route-c1a2c7e62ce669f7.js +0 -1
  628. package/.next-prod/static/chunks/app/api/projectGraph/coedit/route-c1a2c7e62ce669f7.js +0 -1
  629. package/.next-prod/static/chunks/app/api/projectGraph/context/route-c1a2c7e62ce669f7.js +0 -1
  630. package/.next-prod/static/chunks/app/api/projectGraph/file/route-c1a2c7e62ce669f7.js +0 -1
  631. package/.next-prod/static/chunks/app/api/projectGraph/file-functions/route-c1a2c7e62ce669f7.js +0 -1
  632. package/.next-prod/static/chunks/app/api/projectGraph/impact/route-c1a2c7e62ce669f7.js +0 -1
  633. package/.next-prod/static/chunks/app/api/projectGraph/related/route-c1a2c7e62ce669f7.js +0 -1
  634. package/.next-prod/static/chunks/app/api/projectGraph/risk/route-c1a2c7e62ce669f7.js +0 -1
  635. package/.next-prod/static/chunks/app/api/projectGraph/search/route-c1a2c7e62ce669f7.js +0 -1
  636. package/.next-prod/static/chunks/app/api/projects/route-c1a2c7e62ce669f7.js +0 -1
  637. package/.next-prod/static/chunks/app/api/prompts/config/route-c1a2c7e62ce669f7.js +0 -1
  638. package/.next-prod/static/chunks/app/api/push/public-key/route-c1a2c7e62ce669f7.js +0 -1
  639. package/.next-prod/static/chunks/app/api/push/subscribe/route-c1a2c7e62ce669f7.js +0 -1
  640. package/.next-prod/static/chunks/app/api/push/unsubscribe/route-c1a2c7e62ce669f7.js +0 -1
  641. package/.next-prod/static/chunks/app/api/redis/command/route-c1a2c7e62ce669f7.js +0 -1
  642. package/.next-prod/static/chunks/app/api/redis/connect/route-c1a2c7e62ce669f7.js +0 -1
  643. package/.next-prod/static/chunks/app/api/redis/delete/route-c1a2c7e62ce669f7.js +0 -1
  644. package/.next-prod/static/chunks/app/api/redis/disconnect/route-c1a2c7e62ce669f7.js +0 -1
  645. package/.next-prod/static/chunks/app/api/redis/get/route-c1a2c7e62ce669f7.js +0 -1
  646. package/.next-prod/static/chunks/app/api/redis/keys/route-c1a2c7e62ce669f7.js +0 -1
  647. package/.next-prod/static/chunks/app/api/redis/set/route-c1a2c7e62ce669f7.js +0 -1
  648. package/.next-prod/static/chunks/app/api/restart/route-c1a2c7e62ce669f7.js +0 -1
  649. package/.next-prod/static/chunks/app/api/review/[id]/comments/route-c1a2c7e62ce669f7.js +0 -1
  650. package/.next-prod/static/chunks/app/api/review/[id]/replies/route-c1a2c7e62ce669f7.js +0 -1
  651. package/.next-prod/static/chunks/app/api/review/[id]/route-c1a2c7e62ce669f7.js +0 -1
  652. package/.next-prod/static/chunks/app/api/review/identify/route-c1a2c7e62ce669f7.js +0 -1
  653. package/.next-prod/static/chunks/app/api/review/order/route-c1a2c7e62ce669f7.js +0 -1
  654. package/.next-prod/static/chunks/app/api/review/route-c1a2c7e62ce669f7.js +0 -1
  655. package/.next-prod/static/chunks/app/api/review/share-info/route-c1a2c7e62ce669f7.js +0 -1
  656. package/.next-prod/static/chunks/app/api/review/users/route-c1a2c7e62ce669f7.js +0 -1
  657. package/.next-prod/static/chunks/app/api/scheduled-tasks/route-c1a2c7e62ce669f7.js +0 -1
  658. package/.next-prod/static/chunks/app/api/services/config/route-c1a2c7e62ce669f7.js +0 -1
  659. package/.next-prod/static/chunks/app/api/services/scripts/route-c1a2c7e62ce669f7.js +0 -1
  660. package/.next-prod/static/chunks/app/api/session/[sessionId]/fork/route-c1a2c7e62ce669f7.js +0 -1
  661. package/.next-prod/static/chunks/app/api/session/[sessionId]/history/route-c1a2c7e62ce669f7.js +0 -1
  662. package/.next-prod/static/chunks/app/api/session-by-path/route-c1a2c7e62ce669f7.js +0 -1
  663. package/.next-prod/static/chunks/app/api/sessions/projects/[encodedPath]/route-c1a2c7e62ce669f7.js +0 -1
  664. package/.next-prod/static/chunks/app/api/sessions/projects/route-c1a2c7e62ce669f7.js +0 -1
  665. package/.next-prod/static/chunks/app/api/sessions/route-c1a2c7e62ce669f7.js +0 -1
  666. package/.next-prod/static/chunks/app/api/settings/route-c1a2c7e62ce669f7.js +0 -1
  667. package/.next-prod/static/chunks/app/api/shutdown/route-c1a2c7e62ce669f7.js +0 -1
  668. package/.next-prod/static/chunks/app/api/skills/[id]/route-c1a2c7e62ce669f7.js +0 -1
  669. package/.next-prod/static/chunks/app/api/skills/content/route-c1a2c7e62ce669f7.js +0 -1
  670. package/.next-prod/static/chunks/app/api/skills/route-c1a2c7e62ce669f7.js +0 -1
  671. package/.next-prod/static/chunks/app/api/snapshots/diff/route-c1a2c7e62ce669f7.js +0 -1
  672. package/.next-prod/static/chunks/app/api/snapshots/route-c1a2c7e62ce669f7.js +0 -1
  673. package/.next-prod/static/chunks/app/api/terminal/aliases/route-c1a2c7e62ce669f7.js +0 -1
  674. package/.next-prod/static/chunks/app/api/terminal/autocomplete/route-c1a2c7e62ce669f7.js +0 -1
  675. package/.next-prod/static/chunks/app/api/terminal/bubble-order/route-c1a2c7e62ce669f7.js +0 -1
  676. package/.next-prod/static/chunks/app/api/terminal/env/route-c1a2c7e62ce669f7.js +0 -1
  677. package/.next-prod/static/chunks/app/api/terminal/history/route-c1a2c7e62ce669f7.js +0 -1
  678. package/.next-prod/static/chunks/app/api/update/route-c1a2c7e62ce669f7.js +0 -1
  679. package/.next-prod/static/chunks/app/api/update-state/route-c1a2c7e62ce669f7.js +0 -1
  680. package/.next-prod/static/chunks/app/api/version/route-c1a2c7e62ce669f7.js +0 -1
  681. package/.next-prod/static/chunks/app/apps/[...path]/route-c1a2c7e62ce669f7.js +0 -1
  682. package/.next-prod/static/chunks/app/manifest.webmanifest/route-c1a2c7e62ce669f7.js +0 -1
  683. package/.next-prod/static/chunks/app/page-e83cd7365efbf878.js +0 -1
  684. package/.next-prod/static/chunks/app/project/page-e83cd7365efbf878.js +0 -1
  685. package/.next-prod/static/chunks/next/dist/client/components/builtin/app-error-c1a2c7e62ce669f7.js +0 -1
  686. package/.next-prod/static/chunks/next/dist/client/components/builtin/forbidden-c1a2c7e62ce669f7.js +0 -1
  687. package/.next-prod/static/chunks/next/dist/client/components/builtin/not-found-c1a2c7e62ce669f7.js +0 -1
  688. package/.next-prod/static/chunks/next/dist/client/components/builtin/unauthorized-c1a2c7e62ce669f7.js +0 -1
  689. package/.next-prod/static/css/45835d91c2519c62.css +0 -1
  690. package/scripts/claudeBinary.mjs +0 -38
  691. /package/.next-prod/static/{YOIsQRqVhYPuRyXlhwhoY → MM6vZhLQFwtUo_vz7BSfe}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5504],{5989:(r,n,i)=>{"use strict";let s,o;i.d(n,{XI:()=>ts,nA:()=>e0,A0:()=>e1,Hj:()=>e2});var l=i(82159),a=i(76865),u=i(27050),c=i(63197),h=i(12894),d=i(8242);if("u">typeof WeakMap){let r=new WeakMap;s=n=>r.get(n),o=(n,i)=>(r.set(n,i),i)}else{let r=[],n=10,i=0;s=n=>{for(let i=0;i<r.length;i+=2)if(r[i]==n)return r[i+1]},o=(s,o)=>(i==n&&(i=0),r[i++]=s,r[i++]=o)}var p=class{constructor(r,n,i,s){this.width=r,this.height=n,this.map=i,this.problems=s}findCell(r){for(let n=0;n<this.map.length;n++){let i=this.map[n];if(i!=r)continue;let s=n%this.width,o=n/this.width|0,l=s+1,a=o+1;for(let r=1;l<this.width&&this.map[n+r]==i;r++)l++;for(let r=1;a<this.height&&this.map[n+this.width*r]==i;r++)a++;return{left:s,top:o,right:l,bottom:a}}throw RangeError(`No cell with offset ${r} found`)}colCount(r){for(let n=0;n<this.map.length;n++)if(this.map[n]==r)return n%this.width;throw RangeError(`No cell with offset ${r} found`)}nextCell(r,n,i){let{left:s,right:o,top:l,bottom:a}=this.findCell(r);return"horiz"==n?(i<0?0==s:o==this.width)?null:this.map[l*this.width+(i<0?s-1:o)]:(i<0?0==l:a==this.height)?null:this.map[s+this.width*(i<0?l-1:a)]}rectBetween(r,n){let{left:i,right:s,top:o,bottom:l}=this.findCell(r),{left:a,right:u,top:c,bottom:h}=this.findCell(n);return{left:Math.min(i,a),top:Math.min(o,c),right:Math.max(s,u),bottom:Math.max(l,h)}}cellsInRect(r){let n=[],i={};for(let s=r.top;s<r.bottom;s++)for(let o=r.left;o<r.right;o++){let l=s*this.width+o,a=this.map[l];!i[a]&&(i[a]=!0,o==r.left&&o&&this.map[l-1]==a||s==r.top&&s&&this.map[l-this.width]==a||n.push(a))}return n}positionAt(r,n,i){for(let s=0,o=0;;s++){let l=o+i.child(s).nodeSize;if(s==r){let i=n+r*this.width,s=(r+1)*this.width;for(;i<s&&this.map[i]<o;)i++;return i==s?l-1:this.map[i]}o=l}}static get(r){return s(r)||o(r,f(r))}};function f(r){if("table"!=r.type.spec.tableRole)throw RangeError("Not a table node: "+r.type.name);let n=m(r),i=r.childCount,s=[],o=0,l=null,a=[];for(let r=0,o=n*i;r<o;r++)s[r]=0;for(let u=0,c=0;u<i;u++){let h=r.child(u);c++;for(let r=0;;r++){for(;o<s.length&&0!=s[o];)o++;if(r==h.childCount)break;let d=h.child(r),{colspan:p,rowspan:f,colwidth:m}=d.attrs;for(let r=0;r<f;r++){if(r+u>=i){(l||(l=[])).push({type:"overlong_rowspan",pos:c,n:f-r});break}let h=o+r*n;for(let r=0;r<p;r++){0==s[h+r]?s[h+r]=c:(l||(l=[])).push({type:"collision",row:u,pos:c,n:p-r});let i=m&&m[r];if(i){let s=(h+r)%n*2,o=a[s];null==o||o!=i&&1==a[s+1]?(a[s]=i,a[s+1]=1):o==i&&a[s+1]++}}}o+=p,c+=d.nodeSize}let d=(u+1)*n,p=0;for(;o<d;)0==s[o++]&&p++;p&&(l||(l=[])).push({type:"missing",row:u,n:p}),c++}(0===n||0===i)&&(l||(l=[])).push({type:"zero_sized"});let u=new p(n,i,s,l),c=!1;for(let r=0;!c&&r<a.length;r+=2)null!=a[r]&&a[r+1]<i&&(c=!0);return c&&g(u,a,r),u}function m(r){let n=-1,i=!1;for(let s=0;s<r.childCount;s++){let o=r.child(s),l=0;if(i)for(let n=0;n<s;n++){let i=r.child(n);for(let r=0;r<i.childCount;r++){let o=i.child(r);n+o.attrs.rowspan>s&&(l+=o.attrs.colspan)}}for(let r=0;r<o.childCount;r++){let n=o.child(r);l+=n.attrs.colspan,n.attrs.rowspan>1&&(i=!0)}-1==n?n=l:n!=l&&(n=Math.max(n,l))}return n}function g(r,n,i){r.problems||(r.problems=[]);let s={};for(let o=0;o<r.map.length;o++){let l=r.map[o];if(s[l])continue;s[l]=!0;let a=i.nodeAt(l);if(!a)throw RangeError(`No cell with offset ${l} found`);let u=null,c=a.attrs;for(let i=0;i<c.colspan;i++){let s=n[(o+i)%r.width*2];null==s||c.colwidth&&c.colwidth[i]==s||((u||(u=_(c)))[i]=s)}u&&r.problems.unshift({type:"colwidth mismatch",pos:l,colwidth:u})}}function _(r){if(r.colwidth)return r.colwidth.slice();let n=[];for(let i=0;i<r.colspan;i++)n.push(0);return n}function y(r){let n=r.cached.tableNodeTypes;if(!n)for(let i in n=r.cached.tableNodeTypes={},r.nodes){let s=r.nodes[i],o=s.spec.tableRole;o&&(n[o]=s)}return n}let k=new a.hs("selectingCells");function b(r){for(let n=r.depth-1;n>0;n--)if("row"==r.node(n).type.spec.tableRole)return r.node(0).resolve(r.before(n+1));return null}function w(r){for(let n=r.depth;n>0;n--){let i=r.node(n).type.spec.tableRole;if("cell"===i||"header_cell"===i)return r.node(n)}return null}function x(r){let n=r.selection.$head;for(let r=n.depth;r>0;r--)if("row"==n.node(r).type.spec.tableRole)return!0;return!1}function v(r){let n=r.selection;if("$anchorCell"in n&&n.$anchorCell)return n.$anchorCell.pos>n.$headCell.pos?n.$anchorCell:n.$headCell;if("node"in n&&n.node&&"cell"==n.node.type.spec.tableRole)return n.$anchor;let i=b(n.$head)||C(n.$head);if(i)return i;throw RangeError(`No cell found around position ${n.head}`)}function C(r){for(let n=r.nodeAfter,i=r.pos;n;n=n.firstChild,i++){let s=n.type.spec.tableRole;if("cell"==s||"header_cell"==s)return r.doc.resolve(i)}for(let n=r.nodeBefore,i=r.pos;n;n=n.lastChild,i--){let s=n.type.spec.tableRole;if("cell"==s||"header_cell"==s)return r.doc.resolve(i-n.nodeSize)}}function A(r){return"row"==r.parent.type.spec.tableRole&&!!r.nodeAfter}function E(r){return r.node(0).resolve(r.pos+r.nodeAfter.nodeSize)}function S(r,n){return r.depth==n.depth&&r.pos>=n.start(-1)&&r.pos<=n.end(-1)}function M(r,n,i){let s=r.node(-1),o=p.get(s),l=r.start(-1),a=o.nextCell(r.pos-l,n,i);return null==a?null:r.node(0).resolve(l+a)}function T(r,n,i=1){let s={...r,colspan:r.colspan-i};return s.colwidth&&(s.colwidth=s.colwidth.slice(),s.colwidth.splice(n,i),s.colwidth.some(r=>r>0)||(s.colwidth=null)),s}function D(r,n,i=1){let s={...r,colspan:r.colspan+i};if(s.colwidth){s.colwidth=s.colwidth.slice();for(let r=0;r<i;r++)s.colwidth.splice(n,0,0)}return s}function F(r,n,i){let s=y(n.type.schema).header_cell;for(let o=0;o<r.height;o++)if(n.nodeAt(r.map[i+o*r.width]).type!=s)return!1;return!0}var I=class r extends a.LN{constructor(r,n=r){const i=r.node(-1),s=p.get(i),o=r.start(-1),l=s.rectBetween(r.pos-o,n.pos-o),u=r.node(0),c=s.cellsInRect(l).filter(r=>r!=n.pos-o);c.unshift(n.pos-o);const h=c.map(r=>{let n=i.nodeAt(r);if(!n)throw RangeError(`No cell with offset ${r} found`);let s=o+r+1;return new a.yn(u.resolve(s),u.resolve(s+n.content.size))});super(h[0].$from,h[0].$to,h),this.$anchorCell=r,this.$headCell=n}map(n,i){let s=n.resolve(i.map(this.$anchorCell.pos)),o=n.resolve(i.map(this.$headCell.pos));if(A(s)&&A(o)&&S(s,o)){let n=this.$anchorCell.node(-1)!=s.node(-1);return n&&this.isRowSelection()?r.rowSelection(s,o):n&&this.isColSelection()?r.colSelection(s,o):new r(s,o)}return a.U3.between(s,o)}content(){let r=this.$anchorCell.node(-1),n=p.get(r),i=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),o={},l=[];for(let i=s.top;i<s.bottom;i++){let a=[];for(let l=i*n.width+s.left,u=s.left;u<s.right;u++,l++){let i=n.map[l];if(o[i])continue;o[i]=!0;let u=n.findCell(i),c=r.nodeAt(i);if(!c)throw RangeError(`No cell with offset ${i} found`);let h=s.left-u.left,d=u.right-s.right;if(h>0||d>0){let r=c.attrs;if(h>0&&(r=T(r,0,h)),d>0&&(r=T(r,r.colspan-d,d)),u.left<s.left){if(!(c=c.type.createAndFill(r)))throw RangeError(`Could not create cell with attrs ${JSON.stringify(r)}`)}else c=c.type.create(r,c.content)}if(u.top<s.top||u.bottom>s.bottom){let r={...c.attrs,rowspan:Math.min(u.bottom,s.bottom)-Math.max(u.top,s.top)};c=u.top<s.top?c.type.createAndFill(r):c.type.create(r,c.content)}a.push(c)}l.push(r.child(i).copy(u.FK.from(a)))}let a=this.isColSelection()&&this.isRowSelection()?r:l;return new u.Ji(u.FK.from(a),1,1)}replace(r,n=u.Ji.empty){let i=r.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:l,$to:a}=s[o],c=r.mapping.slice(i);r.replace(c.map(l.pos),c.map(a.pos),o?u.Ji.empty:n)}let o=a.LN.findFrom(r.doc.resolve(r.mapping.slice(i).map(this.to)),-1);o&&r.setSelection(o)}replaceWith(r,n){this.replace(r,new u.Ji(u.FK.from(n),0,0))}forEachCell(r){let n=this.$anchorCell.node(-1),i=p.get(n),s=this.$anchorCell.start(-1),o=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-s,this.$headCell.pos-s));for(let i=0;i<o.length;i++)r(n.nodeAt(o[i]),s+o[i])}isColSelection(){let r=this.$anchorCell.index(-1),n=this.$headCell.index(-1);return!(Math.min(r,n)>0)&&Math.max(r+this.$anchorCell.nodeAfter.attrs.rowspan,n+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(n,i=n){let s=n.node(-1),o=p.get(s),l=n.start(-1),a=o.findCell(n.pos-l),u=o.findCell(i.pos-l),c=n.node(0);return a.top<=u.top?(a.top>0&&(n=c.resolve(l+o.map[a.left])),u.bottom<o.height&&(i=c.resolve(l+o.map[o.width*(o.height-1)+u.right-1]))):(u.top>0&&(i=c.resolve(l+o.map[u.left])),a.bottom<o.height&&(n=c.resolve(l+o.map[o.width*(o.height-1)+a.right-1]))),new r(n,i)}isRowSelection(){let r=this.$anchorCell.node(-1),n=p.get(r),i=this.$anchorCell.start(-1),s=n.colCount(this.$anchorCell.pos-i),o=n.colCount(this.$headCell.pos-i);return!(Math.min(s,o)>0)&&Math.max(s+this.$anchorCell.nodeAfter.attrs.colspan,o+this.$headCell.nodeAfter.attrs.colspan)==n.width}eq(n){return n instanceof r&&n.$anchorCell.pos==this.$anchorCell.pos&&n.$headCell.pos==this.$headCell.pos}static rowSelection(n,i=n){let s=n.node(-1),o=p.get(s),l=n.start(-1),a=o.findCell(n.pos-l),u=o.findCell(i.pos-l),c=n.node(0);return a.left<=u.left?(a.left>0&&(n=c.resolve(l+o.map[a.top*o.width])),u.right<o.width&&(i=c.resolve(l+o.map[o.width*(u.top+1)-1]))):(u.left>0&&(i=c.resolve(l+o.map[u.top*o.width])),a.right<o.width&&(n=c.resolve(l+o.map[o.width*(a.top+1)-1]))),new r(n,i)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(n,i){return new r(n.resolve(i.anchor),n.resolve(i.head))}static create(n,i,s=i){return new r(n.resolve(i),n.resolve(s))}getBookmark(){return new L(this.$anchorCell.pos,this.$headCell.pos)}};I.prototype.visible=!1,a.LN.jsonID("cell",I);var L=class r{constructor(r,n){this.anchor=r,this.head=n}map(n){return new r(n.map(this.anchor),n.map(this.head))}resolve(r){let n=r.resolve(this.anchor),i=r.resolve(this.head);return"row"==n.parent.type.spec.tableRole&&"row"==i.parent.type.spec.tableRole&&n.index()<n.parent.childCount&&i.index()<i.parent.childCount&&S(n,i)?new I(n,i):a.LN.near(i,1)}};function R(r){if(!(r.selection instanceof I))return null;let n=[];return r.selection.forEachCell((r,i)=>{n.push(c.NZ.node(i,i+r.nodeSize,{class:"selectedCell"}))}),c.zF.create(r.doc,n)}function N({$from:r,$to:n}){if(r.pos==n.pos||r.pos<n.pos-6)return!1;let i=r.pos,s=n.pos,o=r.depth;for(;o>=0&&!(r.after(o+1)<r.end(o));o--,i++);for(let r=n.depth;r>=0&&!(n.before(r+1)>n.start(r));r--,s--);return i==s&&/row|table/.test(r.node(o).type.spec.tableRole)}function O({$from:r,$to:n}){let i,s;for(let n=r.depth;n>0;n--){let s=r.node(n);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){i=s;break}}for(let r=n.depth;r>0;r--){let i=n.node(r);if("cell"===i.type.spec.tableRole||"header_cell"===i.type.spec.tableRole){s=i;break}}return i!==s&&0===n.parentOffset}function z(r,n,i){let s,o,l=(n||r).selection,u=(n||r).doc;if(l instanceof a.nh&&(o=l.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)s=I.create(u,l.from);else if("row"==o){let r=u.resolve(l.from+1);s=I.rowSelection(r,r)}else if(!i){let r=p.get(l.node),n=l.from+1,i=n+r.map[r.width*r.height-1];s=I.create(u,n+1,i)}}else l instanceof a.U3&&N(l)?s=a.U3.create(u,l.from):l instanceof a.U3&&O(l)&&(s=a.U3.create(u,l.$from.start(),l.$from.end()));return s&&(n||(n=r.tr)).setSelection(s),n}let P=new a.hs("fix-tables");function $(r,n,i,s){let o=r.childCount,l=n.childCount;e:for(let a=0,u=0;a<l;a++){let l=n.child(a);for(let n=u,s=Math.min(o,a+3);n<s;n++)if(r.child(n)==l){u=n+1,i+=l.nodeSize;continue e}s(l,i),u<o&&r.child(u).sameMarkup(l)?$(r.child(u),l,i+1,s):l.nodesBetween(0,l.content.size,s,i+1),i+=l.nodeSize}}function B(r,n){let i,s=(n,s)=>{"table"==n.type.spec.tableRole&&(i=q(r,n,s,i))};return n?n.doc!=r.doc&&$(n.doc,r.doc,0,s):r.doc.descendants(s),i}function q(r,n,i,s){let o,l,a=p.get(n);if(!a.problems)return s;s||(s=r.tr);let u=[];for(let r=0;r<a.height;r++)u.push(0);for(let r=0;r<a.problems.length;r++){let o=a.problems[r];if("collision"==o.type){let r=n.nodeAt(o.pos);if(!r)continue;let l=r.attrs;for(let r=0;r<l.rowspan;r++)u[o.row+r]+=o.n;s.setNodeMarkup(s.mapping.map(i+1+o.pos),null,T(l,l.colspan-o.n,o.n))}else if("missing"==o.type)u[o.row]+=o.n;else if("overlong_rowspan"==o.type){let r=n.nodeAt(o.pos);if(!r)continue;s.setNodeMarkup(s.mapping.map(i+1+o.pos),null,{...r.attrs,rowspan:r.attrs.rowspan-o.n})}else if("colwidth mismatch"==o.type){let r=n.nodeAt(o.pos);if(!r)continue;s.setNodeMarkup(s.mapping.map(i+1+o.pos),null,{...r.attrs,colwidth:o.colwidth})}else if("zero_sized"==o.type){let r=s.mapping.map(i);s.delete(r,r+n.nodeSize)}}for(let r=0;r<u.length;r++)u[r]&&(null==o&&(o=r),l=r);for(let c=0,h=i+1;c<a.height;c++){let i=n.child(c),a=h+i.nodeSize,d=u[c];if(d>0){let n="cell";i.firstChild&&(n=i.firstChild.type.spec.tableRole);let u=[];for(let i=0;i<d;i++){let i=y(r.schema)[n].createAndFill();i&&u.push(i)}let p=(0==c||o==c-1)&&l==c?h+1:a-1;s.insert(s.mapping.map(p),u)}h=a}return s.setMeta(P,{fixTables:!0})}function j(r){let n=r.selection,i=v(r),s=i.node(-1),o=i.start(-1),l=p.get(s);return{...n instanceof I?l.rectBetween(n.$anchorCell.pos-o,n.$headCell.pos-o):l.findCell(i.pos-o),tableStart:o,map:l,table:s}}function H(r,{map:n,tableStart:i,table:s},o){let l=o>0?-1:0;F(n,s,o+l)&&(l=0==o||o==n.width?null:0);for(let a=0;a<n.height;a++){let u=a*n.width+o;if(o>0&&o<n.width&&n.map[u-1]==n.map[u]){let l=n.map[u],c=s.nodeAt(l);r.setNodeMarkup(r.mapping.map(i+l),null,D(c.attrs,o-n.colCount(l))),a+=c.attrs.rowspan-1}else{let c=null==l?y(s.type.schema).cell:s.nodeAt(n.map[u+l]).type,h=n.positionAt(a,o,s);r.insert(r.mapping.map(i+h),c.createAndFill())}}return r}function V(r,n){if(!x(r))return!1;if(n){let i=j(r);n(H(r.tr,i,i.left))}return!0}function U(r,n){if(!x(r))return!1;if(n){let i=j(r);n(H(r.tr,i,i.right))}return!0}function W(r,{map:n,table:i,tableStart:s},o){let l=r.mapping.maps.length;for(let a=0;a<n.height;){let u=a*n.width+o,c=n.map[u],h=i.nodeAt(c),d=h.attrs;if(o>0&&n.map[u-1]==c||o<n.width-1&&n.map[u+1]==c)r.setNodeMarkup(r.mapping.slice(l).map(s+c),null,T(d,o-n.colCount(c)));else{let n=r.mapping.slice(l).map(s+c);r.delete(n,n+h.nodeSize)}a+=d.rowspan}}function J(r,n){if(!x(r))return!1;if(n){let i=j(r),s=r.tr;if(0==i.left&&i.right==i.map.width)return!1;for(let r=i.right-1;W(s,i,r),r!=i.left;r--){let r=i.tableStart?s.doc.nodeAt(i.tableStart-1):s.doc;if(!r)throw RangeError("No table found");i.table=r,i.map=p.get(r)}n(s)}return!0}function K(r,n,i){var s;let o=y(n.type.schema).header_cell;for(let l=0;l<r.width;l++)if((null==(s=n.nodeAt(r.map[l+i*r.width]))?void 0:s.type)!=o)return!1;return!0}function G(r,{map:n,tableStart:i,table:s},o){let l=i;for(let r=0;r<o;r++)l+=s.child(r).nodeSize;let a=[],u=o>0?-1:0;K(n,s,o+u)&&(u=0==o||o==n.height?null:0);for(let l=0,h=n.width*o;l<n.width;l++,h++)if(o>0&&o<n.height&&n.map[h]==n.map[h-n.width]){let o=n.map[h],a=s.nodeAt(o).attrs;r.setNodeMarkup(i+o,null,{...a,rowspan:a.rowspan+1}),l+=a.colspan-1}else{var c;let r=null==u?y(s.type.schema).cell:null==(c=s.nodeAt(n.map[h+u*n.width]))?void 0:c.type,i=null==r?void 0:r.createAndFill();i&&a.push(i)}return r.insert(l,y(s.type.schema).row.create(null,a)),r}function Z(r,n){if(!x(r))return!1;if(n){let i=j(r);n(G(r.tr,i,i.top))}return!0}function X(r,n){if(!x(r))return!1;if(n){let i=j(r);n(G(r.tr,i,i.bottom))}return!0}function Y(r,{map:n,table:i,tableStart:s},o){let l=0;for(let r=0;r<o;r++)l+=i.child(r).nodeSize;let a=l+i.child(o).nodeSize,u=r.mapping.maps.length;r.delete(l+s,a+s);let c=new Set;for(let l=0,a=o*n.width;l<n.width;l++,a++){let h=n.map[a];if(!c.has(h)){if(c.add(h),o>0&&h==n.map[a-n.width]){let n=i.nodeAt(h).attrs;r.setNodeMarkup(r.mapping.slice(u).map(h+s),null,{...n,rowspan:n.rowspan-1}),l+=n.colspan-1}else if(o<n.height&&h==n.map[a+n.width]){let a=i.nodeAt(h),c=a.attrs,d=a.type.create({...c,rowspan:a.attrs.rowspan-1},a.content),p=n.positionAt(o+1,l,i);r.insert(r.mapping.slice(u).map(s+p),d),l+=c.colspan-1}}}}function Q(r,n){if(!x(r))return!1;if(n){let i=j(r),s=r.tr;if(0==i.top&&i.bottom==i.map.height)return!1;for(let r=i.bottom-1;Y(s,i,r),r!=i.top;r--){let r=i.tableStart?s.doc.nodeAt(i.tableStart-1):s.doc;if(!r)throw RangeError("No table found");i.table=r,i.map=p.get(i.table)}n(s)}return!0}function ee(r){let n=r.content;return 1==n.childCount&&n.child(0).isTextblock&&0==n.child(0).childCount}function et({width:r,height:n,map:i},s){let o=s.top*r+s.left,l=o,a=(s.bottom-1)*r+s.left,u=o+(s.right-s.left-1);for(let n=s.top;n<s.bottom;n++){if(s.left>0&&i[l]==i[l-1]||s.right<r&&i[u]==i[u+1])return!0;l+=r,u+=r}for(let l=s.left;l<s.right;l++){if(s.top>0&&i[o]==i[o-r]||s.bottom<n&&i[a]==i[a+r])return!0;o++,a++}return!1}function er(r,n){let i=r.selection;if(!(i instanceof I)||i.$anchorCell.pos==i.$headCell.pos)return!1;let s=j(r),{map:o}=s;if(et(o,s))return!1;if(n){let i,l,a=r.tr,c={},h=u.FK.empty;for(let r=s.top;r<s.bottom;r++)for(let n=s.left;n<s.right;n++){let u=o.map[r*o.width+n],d=s.table.nodeAt(u);if(!c[u]&&d)if(c[u]=!0,null==i)i=u,l=d;else{ee(d)||(h=h.append(d.content));let r=a.mapping.map(u+s.tableStart);a.delete(r,r+d.nodeSize)}}if(null==i||null==l)return!0;if(a.setNodeMarkup(i+s.tableStart,null,{...D(l.attrs,l.attrs.colspan,s.right-s.left-l.attrs.colspan),rowspan:s.bottom-s.top}),h.size>0){let r=i+1+l.content.size,n=ee(l)?i+1:r;a.replaceWith(n+s.tableStart,r+s.tableStart,h)}a.setSelection(new I(a.doc.resolve(i+s.tableStart))),n(a)}return!0}function en(r,n){let i=y(r.schema);return ei(({node:r})=>i[r.type.spec.tableRole])(r,n)}function ei(r){return(n,i)=>{let s,o,l=n.selection;if(l instanceof I){if(l.$anchorCell.pos!=l.$headCell.pos)return!1;s=l.$anchorCell.nodeAfter,o=l.$anchorCell.pos}else{var a;if(!(s=w(l.$from)))return!1;o=null==(a=b(l.$from))?void 0:a.pos}if(null==s||null==o||1==s.attrs.colspan&&1==s.attrs.rowspan)return!1;if(i){let a,u=s.attrs,c=[],h=u.colwidth;u.rowspan>1&&(u={...u,rowspan:1}),u.colspan>1&&(u={...u,colspan:1});let d=j(n),p=n.tr;for(let r=0;r<d.right-d.left;r++)c.push(h?{...u,colwidth:h&&h[r]?[h[r]]:null}:u);for(let n=d.top;n<d.bottom;n++){let i=d.map.positionAt(n,d.left,d.table);n==d.top&&(i+=s.nodeSize);for(let o=d.left,l=0;o<d.right;o++,l++)(o!=d.left||n!=d.top)&&p.insert(a=p.mapping.map(i+d.tableStart,1),r({node:s,row:n,col:o}).createAndFill(c[l]))}p.setNodeMarkup(o,r({node:s,row:d.top,col:d.left}),c[0]),l instanceof I&&p.setSelection(new I(p.doc.resolve(l.$anchorCell.pos),a?p.doc.resolve(a):void 0)),i(p)}return!0}}function es(r,n){return function(i,s){if(!x(i))return!1;let o=v(i);if(o.nodeAfter.attrs[r]===n)return!1;if(s){let l=i.tr;i.selection instanceof I?i.selection.forEachCell((i,s)=>{i.attrs[r]!==n&&l.setNodeMarkup(s,null,{...i.attrs,[r]:n})}):l.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[r]:n}),s(l)}return!0}}function eo(r){return function(n,i){if(!x(n))return!1;if(i){let s=y(n.schema),o=j(n),l=n.tr,a=o.map.cellsInRect("column"==r?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==r?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),u=a.map(r=>o.table.nodeAt(r));for(let r=0;r<a.length;r++)u[r].type==s.header_cell&&l.setNodeMarkup(o.tableStart+a[r],s.cell,u[r].attrs);if(0===l.steps.length)for(let r=0;r<a.length;r++)l.setNodeMarkup(o.tableStart+a[r],s.header_cell,u[r].attrs);i(l)}return!0}}function el(r,n,i){let s=n.map.cellsInRect({left:0,top:0,right:"row"==r?n.map.width:1,bottom:"column"==r?n.map.height:1});for(let r=0;r<s.length;r++){let o=n.table.nodeAt(s[r]);if(o&&o.type!==i.header_cell)return!1}return!0}function ea(r,n){return(n=n||{useDeprecatedLogic:!1}).useDeprecatedLogic?eo(r):function(n,i){if(!x(n))return!1;if(i){let s=y(n.schema),o=j(n),l=n.tr,a=el("row",o,s),u=el("column",o,s),c=+("column"===r?!!a:"row"===r&&!!u),h="column"==r?{left:0,top:c,right:1,bottom:o.map.height}:"row"==r?{left:c,top:0,right:o.map.width,bottom:1}:o,d="column"==r?u?s.cell:s.header_cell:"row"==r?a?s.cell:s.header_cell:s.cell;o.map.cellsInRect(h).forEach(r=>{let n=r+o.tableStart,i=l.doc.nodeAt(n);i&&l.setNodeMarkup(n,d,i.attrs)}),i(l)}return!0}}ea("row",{useDeprecatedLogic:!0}),ea("column",{useDeprecatedLogic:!0});let eu=ea("cell",{useDeprecatedLogic:!0});function ec(r,n){if(n<0){let n=r.nodeBefore;if(n)return r.pos-n.nodeSize;for(let n=r.index(-1)-1,i=r.before();n>=0;n--){let s=r.node(-1).child(n),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(r.index()<r.parent.childCount-1)return r.pos+r.nodeAfter.nodeSize;let n=r.node(-1);for(let i=r.indexAfter(-1),s=r.after();i<n.childCount;i++){let r=n.child(i);if(r.childCount)return s+1;s+=r.nodeSize}}return null}function eh(r){return function(n,i){if(!x(n))return!1;let s=ec(v(n),r);if(null==s)return!1;if(i){let r=n.doc.resolve(s);i(n.tr.setSelection(a.U3.between(r,E(r))).scrollIntoView())}return!0}}function ed(r,n){let i=r.selection.$anchor;for(let s=i.depth;s>0;s--)if("table"==i.node(s).type.spec.tableRole)return n&&n(r.tr.delete(i.before(s),i.after(s)).scrollIntoView()),!0;return!1}function ep(r,n){let i=r.selection;if(!(i instanceof I))return!1;if(n){let s=r.tr,o=y(r.schema).cell.createAndFill().content;i.forEachCell((r,n)=>{r.content.eq(o)||s.replace(s.mapping.map(n+1),s.mapping.map(n+r.nodeSize-1),new u.Ji(o,0,0))}),s.docChanged&&n(s)}return!0}function ef(r){if(0===r.size)return null;let{content:n,openStart:i,openEnd:s}=r;for(;1==n.childCount&&(i>0&&s>0||"table"==n.child(0).type.spec.tableRole);)i--,s--,n=n.child(0).content;let o=n.child(0),l=o.type.spec.tableRole,a=o.type.schema,c=[];if("row"==l)for(let r=0;r<n.childCount;r++){let o=n.child(r).content,l=r?0:Math.max(0,i-1),h=r<n.childCount-1?0:Math.max(0,s-1);(l||h)&&(o=eg(y(a).row,new u.Ji(o,l,h)).content),c.push(o)}else{if("cell"!=l&&"header_cell"!=l)return null;c.push(i||s?eg(y(a).row,new u.Ji(n,i,s)).content:n)}return em(a,c)}function em(r,n){let i=[];for(let r=0;r<n.length;r++){let s=n[r];for(let n=s.childCount-1;n>=0;n--){let{rowspan:o,colspan:l}=s.child(n).attrs;for(let n=r;n<r+o;n++)i[n]=(i[n]||0)+l}}let s=0;for(let r=0;r<i.length;r++)s=Math.max(s,i[r]);for(let o=0;o<i.length;o++)if(o>=n.length&&n.push(u.FK.empty),i[o]<s){let l=y(r).cell.createAndFill(),a=[];for(let r=i[o];r<s;r++)a.push(l);n[o]=n[o].append(u.FK.from(a))}return{height:n.length,width:s,rows:n}}function eg(r,n){let i=r.createAndFill();return new d.dL(i).replace(0,i.content.size,n).doc}function e_({width:r,height:n,rows:i},s,o){if(r!=s){let n=[],o=[];for(let r=0;r<i.length;r++){let l=i[r],a=[];for(let i=n[r]||0,o=0;i<s;o++){let u=l.child(o%l.childCount);i+u.attrs.colspan>s&&(u=u.type.createChecked(T(u.attrs,u.attrs.colspan,i+u.attrs.colspan-s),u.content)),a.push(u),i+=u.attrs.colspan;for(let i=1;i<u.attrs.rowspan;i++)n[r+i]=(n[r+i]||0)+u.attrs.colspan}o.push(u.FK.from(a))}i=o,r=s}if(n!=o){let r=[];for(let s=0,l=0;s<o;s++,l++){let a=[],c=i[l%n];for(let r=0;r<c.childCount;r++){let n=c.child(r);s+n.attrs.rowspan>o&&(n=n.type.create({...n.attrs,rowspan:Math.max(1,o-n.attrs.rowspan)},n.content)),a.push(n)}r.push(u.FK.from(a))}i=r,n=o}return{width:r,height:n,rows:i}}function ey(r,n,i,s,o,l,a){let c,h,d=y(r.doc.type.schema);if(o>n.width)for(let l=0,u=0;l<n.height;l++){let p,f=i.child(l);u+=f.nodeSize;let m=[];p=null==f.lastChild||f.lastChild.type==d.cell?c||(c=d.cell.createAndFill()):h||(h=d.header_cell.createAndFill());for(let r=n.width;r<o;r++)m.push(p);r.insert(r.mapping.slice(a).map(u-1+s),m)}if(l>n.height){let p=[];for(let r=0,s=(n.height-1)*n.width;r<Math.max(n.width,o);r++){let o=!(r>=n.width)&&i.nodeAt(n.map[s+r]).type==d.header_cell;p.push(o?h||(h=d.header_cell.createAndFill()):c||(c=d.cell.createAndFill()))}let f=d.row.create(null,u.FK.from(p)),m=[];for(let r=n.height;r<l;r++)m.push(f);r.insert(r.mapping.slice(a).map(s+i.nodeSize-2),m)}return!!(c||h)}function ek(r,n,i,s,o,l,a,u){if(0==a||a==n.height)return!1;let c=!1;for(let h=o;h<l;h++){let o=a*n.width+h,l=n.map[o];if(n.map[o-n.width]==l){c=!0;let o=i.nodeAt(l),{top:d,left:p}=n.findCell(l);r.setNodeMarkup(r.mapping.slice(u).map(l+s),null,{...o.attrs,rowspan:a-d}),r.insert(r.mapping.slice(u).map(n.positionAt(a,p,i)),o.type.createAndFill({...o.attrs,rowspan:d+o.attrs.rowspan-a})),h+=o.attrs.colspan-1}}return c}function eb(r,n,i,s,o,l,a,u){if(0==a||a==n.width)return!1;let c=!1;for(let h=o;h<l;h++){let o=h*n.width+a,l=n.map[o];if(n.map[o-1]==l){c=!0;let o=i.nodeAt(l),d=n.colCount(l),p=r.mapping.slice(u).map(l+s);r.setNodeMarkup(p,null,T(o.attrs,a-d,o.attrs.colspan-(a-d))),r.insert(p+o.nodeSize,o.type.createAndFill(T(o.attrs,0,a-d))),h+=o.attrs.rowspan-1}}return c}function ew(r,n,i,s,o){let l=i?r.doc.nodeAt(i-1):r.doc;if(!l)throw Error("No table found");let a=p.get(l),{top:c,left:h}=s,d=h+o.width,f=c+o.height,m=r.tr,g=0;function _(){if(!(l=i?m.doc.nodeAt(i-1):m.doc))throw Error("No table found");a=p.get(l),g=m.mapping.maps.length}ey(m,a,l,i,d,f,0)&&_(),ek(m,a,l,i,h,d,c,g)&&_(),ek(m,a,l,i,h,d,f,g)&&_(),eb(m,a,l,i,c,f,h,g)&&_(),eb(m,a,l,i,c,f,d,g)&&_();for(let r=c;r<f;r++){let n=a.positionAt(r,h,l),s=a.positionAt(r,d,l);m.replace(m.mapping.slice(g).map(n+i),m.mapping.slice(g).map(s+i),new u.Ji(o.rows[r-c],0,0))}_(),m.setSelection(new I(m.doc.resolve(i+a.positionAt(c,h,l)),m.doc.resolve(i+a.positionAt(f-1,d-1,l)))),n(m)}let ex=(0,h.K)({ArrowLeft:eC("horiz",-1),ArrowRight:eC("horiz",1),ArrowUp:eC("vert",-1),ArrowDown:eC("vert",1),"Shift-ArrowLeft":eA("horiz",-1),"Shift-ArrowRight":eA("horiz",1),"Shift-ArrowUp":eA("vert",-1),"Shift-ArrowDown":eA("vert",1),Backspace:ep,"Mod-Backspace":ep,Delete:ep,"Mod-Delete":ep});function ev(r,n,i){return!i.eq(r.selection)&&(n&&n(r.tr.setSelection(i).scrollIntoView()),!0)}function eC(r,n){return(i,s,o)=>{if(!o)return!1;let l=i.selection;if(l instanceof I)return ev(i,s,a.LN.near(l.$headCell,n));if("horiz"!=r&&!l.empty)return!1;let u=eT(o,r,n);if(null==u)return!1;if("horiz"==r)return ev(i,s,a.LN.near(i.doc.resolve(l.head+n),n));{let o,l=i.doc.resolve(u),c=M(l,r,n);return o=c?a.LN.near(c,1):n<0?a.LN.near(i.doc.resolve(l.before(-1)),-1):a.LN.near(i.doc.resolve(l.after(-1)),1),ev(i,s,o)}}}function eA(r,n){return(i,s,o)=>{let l;if(!o)return!1;let a=i.selection;if(a instanceof I)l=a;else{let s=eT(o,r,n);if(null==s)return!1;l=new I(i.doc.resolve(s))}let u=M(l.$headCell,r,n);return!!u&&ev(i,s,new I(l.$anchorCell,u))}}function eE(r,n){let i=b(r.state.doc.resolve(n));return!!i&&(r.dispatch(r.state.tr.setSelection(new I(i))),!0)}function eS(r,n,i){if(!x(r.state))return!1;let s=ef(i),o=r.state.selection;if(o instanceof I){s||(s={width:1,height:1,rows:[u.FK.from(eg(y(r.state.schema).cell,i))]});let n=o.$anchorCell.node(-1),l=o.$anchorCell.start(-1),a=p.get(n).rectBetween(o.$anchorCell.pos-l,o.$headCell.pos-l);return s=e_(s,a.right-a.left,a.bottom-a.top),ew(r.state,r.dispatch,l,a,s),!0}if(!s)return!1;{let n=v(r.state),i=n.start(-1);return ew(r.state,r.dispatch,i,p.get(n.node(-1)).findCell(n.pos-i),s),!0}}function eM(r,n){var i;let s;if(0!=n.button||n.ctrlKey||n.metaKey)return;let o=eD(r,n.target);if(n.shiftKey&&r.state.selection instanceof I)l(r.state.selection.$anchorCell,n),n.preventDefault();else if(n.shiftKey&&o&&null!=(s=b(r.state.selection.$anchor))&&(null==(i=eF(r,n))?void 0:i.pos)!=s.pos)l(s,n),n.preventDefault();else if(!o)return;function l(n,i){let s=eF(r,i),o=null==k.getState(r.state);if(!s||!S(n,s))if(!o)return;else s=n;let l=new I(n,s);if(o||!r.state.selection.eq(l)){let i=r.state.tr.setSelection(l);o&&i.setMeta(k,n.pos),r.dispatch(i)}}function a(){r.root.removeEventListener("mouseup",a),r.root.removeEventListener("dragstart",a),r.root.removeEventListener("mousemove",u),null!=k.getState(r.state)&&r.dispatch(r.state.tr.setMeta(k,-1))}function u(i){let s,u=i,c=k.getState(r.state);if(null!=c)s=r.state.doc.resolve(c);else if(eD(r,u.target)!=o&&!(s=eF(r,n)))return a();s&&l(s,u)}r.root.addEventListener("mouseup",a),r.root.addEventListener("dragstart",a),r.root.addEventListener("mousemove",u)}function eT(r,n,i){if(!(r.state.selection instanceof a.U3))return null;let{$head:s}=r.state.selection;for(let o=s.depth-1;o>=0;o--){let l=s.node(o);if((i<0?s.index(o):s.indexAfter(o))!=(i<0?0:l.childCount))break;if("cell"==l.type.spec.tableRole||"header_cell"==l.type.spec.tableRole){let l=s.before(o),a="vert"==n?i>0?"down":"up":i>0?"right":"left";return r.endOfTextblock(a)?l:null}}return null}function eD(r,n){for(;n&&n!=r.dom;n=n.parentNode)if("TD"==n.nodeName||"TH"==n.nodeName)return n;return null}function eF(r,n){let i=r.posAtCoords({left:n.clientX,top:n.clientY});if(!i)return null;let{inside:s,pos:o}=i;return s>=0&&b(r.state.doc.resolve(s))||b(r.state.doc.resolve(o))}var eI=class{constructor(r,n){this.node=r,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),eL(r,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(r){return r.type==this.node.type&&(this.node=r,eL(r,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(r){return"attributes"==r.type&&(r.target==this.table||this.colgroup.contains(r.target))}};function eL(r,n,i,s,o,l){let a=0,u=!0,c=n.firstChild,h=r.firstChild;if(h){for(let r=0,i=0;r<h.childCount;r++){let{colspan:d,colwidth:p}=h.child(r).attrs;for(let r=0;r<d;r++,i++){let h=o==i?l:p&&p[r],d=h?h+"px":"";if(a+=h||s,h||(u=!1),c)c.style.width!=d&&(c.style.width=d),c=c.nextSibling;else{let r=document.createElement("col");r.style.width=d,n.appendChild(r)}}}for(;c;){var d;let r=c.nextSibling;null==(d=c.parentNode)||d.removeChild(c),c=r}u?(i.style.width=a+"px",i.style.minWidth=""):(i.style.width="",i.style.minWidth=a+"px")}}let eR=new a.hs("tableColumnResizing");function eN({handleWidth:r=5,cellMinWidth:n=25,defaultCellMinWidth:i=100,View:s=eI,lastColumnResizable:o=!0}={}){let l=new a.k_({key:eR,state:{init(r,n){var o;let a=null==(o=l.spec)||null==(o=o.props)?void 0:o.nodeViews,u=y(n.schema).table.name;return s&&a&&(a[u]=(r,n)=>new s(r,i,n)),new eO(-1,!1)},apply:(r,n)=>n.apply(r)},props:{attributes:r=>{let n=eR.getState(r);return n&&n.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(n,i)=>{ez(n,i,r,o)},mouseleave:r=>{eP(r)},mousedown:(r,s)=>{e$(r,s,n,i)}},decorations:r=>{let n=eR.getState(r);if(n&&n.activeHandle>-1)return eK(r,n.activeHandle)},nodeViews:{}}});return l}var eO=class r{constructor(r,n){this.activeHandle=r,this.dragging=n}apply(n){let i=this,s=n.getMeta(eR);if(s&&null!=s.setHandle)return new r(s.setHandle,!1);if(s&&void 0!==s.setDragging)return new r(i.activeHandle,s.setDragging);if(i.activeHandle>-1&&n.docChanged){let s=n.mapping.map(i.activeHandle,-1);return A(n.doc.resolve(s))||(s=-1),new r(s,i.dragging)}return i}};function ez(r,n,i,s){if(!r.editable)return;let o=eR.getState(r.state);if(o&&!o.dragging){let l=eq(n.target),a=-1;if(l){let{left:s,right:o}=l.getBoundingClientRect();n.clientX-s<=i?a=ej(r,n,"left",i):o-n.clientX<=i&&(a=ej(r,n,"right",i))}if(a!=o.activeHandle){if(!s&&-1!==a){let n=r.state.doc.resolve(a),i=n.node(-1),s=p.get(i),o=n.start(-1);if(s.colCount(n.pos-o)+n.nodeAfter.attrs.colspan-1==s.width-1)return}eV(r,a)}}}function eP(r){if(!r.editable)return;let n=eR.getState(r.state);n&&n.activeHandle>-1&&!n.dragging&&eV(r,-1)}function e$(r,n,i,s){var o;if(!r.editable)return!1;let l=null!=(o=r.dom.ownerDocument.defaultView)?o:window,a=eR.getState(r.state);if(!a||-1==a.activeHandle||a.dragging)return!1;let u=r.state.doc.nodeAt(a.activeHandle),c=eB(r,a.activeHandle,u.attrs);function h(n){l.removeEventListener("mouseup",h),l.removeEventListener("mousemove",d);let s=eR.getState(r.state);(null==s?void 0:s.dragging)&&(eU(r,s.activeHandle,eH(s.dragging,n,i)),r.dispatch(r.state.tr.setMeta(eR,{setDragging:null})))}function d(n){if(!n.which)return h(n);let o=eR.getState(r.state);if(o&&o.dragging){let l=eH(o.dragging,n,i);eW(r,o.activeHandle,l,s)}}return r.dispatch(r.state.tr.setMeta(eR,{setDragging:{startX:n.clientX,startWidth:c}})),eW(r,a.activeHandle,c,s),l.addEventListener("mouseup",h),l.addEventListener("mousemove",d),n.preventDefault(),!0}function eB(r,n,{colspan:i,colwidth:s}){let o=s&&s[s.length-1];if(o)return o;let l=r.domAtPos(n),a=l.node.childNodes[l.offset].offsetWidth,u=i;if(s)for(let r=0;r<i;r++)s[r]&&(a-=s[r],u--);return a/u}function eq(r){for(;r&&"TD"!=r.nodeName&&"TH"!=r.nodeName;)r=r.classList&&r.classList.contains("ProseMirror")?null:r.parentNode;return r}function ej(r,n,i,s){let o="right"==i?-s:s,l=r.posAtCoords({left:n.clientX+o,top:n.clientY});if(!l)return -1;let{pos:a}=l,u=b(r.state.doc.resolve(a));if(!u)return -1;if("right"==i)return u.pos;let c=p.get(u.node(-1)),h=u.start(-1),d=c.map.indexOf(u.pos-h);return d%c.width==0?-1:h+c.map[d-1]}function eH(r,n,i){let s=n.clientX-r.startX;return Math.max(i,r.startWidth+s)}function eV(r,n){r.dispatch(r.state.tr.setMeta(eR,{setHandle:n}))}function eU(r,n,i){let s=r.state.doc.resolve(n),o=s.node(-1),l=p.get(o),a=s.start(-1),u=l.colCount(s.pos-a)+s.nodeAfter.attrs.colspan-1,c=r.state.tr;for(let r=0;r<l.height;r++){let n=r*l.width+u;if(r&&l.map[n]==l.map[n-l.width])continue;let s=l.map[n],h=o.nodeAt(s).attrs,d=1==h.colspan?0:u-l.colCount(s);if(h.colwidth&&h.colwidth[d]==i)continue;let p=h.colwidth?h.colwidth.slice():eJ(h.colspan);p[d]=i,c.setNodeMarkup(a+s,null,{...h,colwidth:p})}c.docChanged&&r.dispatch(c)}function eW(r,n,i,s){let o=r.state.doc.resolve(n),l=o.node(-1),a=o.start(-1),u=p.get(l).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,c=r.domAtPos(o.start(-1)).node;for(;c&&"TABLE"!=c.nodeName;)c=c.parentNode;c&&eL(l,c.firstChild,c,s,u,i)}function eJ(r){return Array(r).fill(0)}function eK(r,n){let i=[],s=r.doc.resolve(n),o=s.node(-1);if(!o)return c.zF.empty;let l=p.get(o),a=s.start(-1),u=l.colCount(s.pos-a)+s.nodeAfter.attrs.colspan-1;for(let n=0;n<l.height;n++){let s=u+n*l.width;if((u==l.width-1||l.map[s]!=l.map[s+1])&&(0==n||l.map[s]!=l.map[s-l.width])){var h;let n=l.map[s],u=a+n+o.nodeAt(n).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",(null==(h=eR.getState(r))?void 0:h.dragging)&&i.push(c.NZ.node(a+n,a+n+o.nodeAt(n).nodeSize,{class:"column-resize-dragging"})),i.push(c.NZ.widget(u,d))}}return c.zF.create(r.doc,i)}function eG({allowTableNodeSelection:r=!1}={}){return new a.k_({key:k,state:{init:()=>null,apply(r,n){let i=r.getMeta(k);if(null!=i)return -1==i?null:i;if(null==n||!r.docChanged)return n;let{deleted:s,pos:o}=r.mapping.mapResult(n);return s?null:o}},props:{decorations:R,handleDOMEvents:{mousedown:eM},createSelectionBetween:r=>null!=k.getState(r.state)?r.state.selection:null,handleTripleClick:eE,handleKeyDown:ex,handlePaste:eS},appendTransaction:(n,i,s)=>z(s,B(s,i),r)})}function eZ(r){return"left"===r||"right"===r||"center"===r?r:null}function eX(r){let n=(r.style.textAlign||"").trim().toLowerCase(),i=(r.getAttribute("align")||"").trim().toLowerCase();return eZ(n||i)}function eY(r){return eZ(null==r?void 0:r.align)}function eQ(){return{default:null,parseHTML:r=>eX(r),renderHTML:r=>r.align?{style:`text-align: ${r.align}`}:{}}}var e0=l.bP.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:r=>{var n,i;let s=r.getAttribute("colwidth"),o=s?s.split(",").map(r=>parseInt(r,10)):null;if(!o){let s=null==(n=r.closest("table"))?void 0:n.querySelectorAll("colgroup > col"),o=Array.from((null==(i=r.parentElement)?void 0:i.children)||[]).indexOf(r);if(o&&o>-1&&s&&s[o]){let r=s[o].getAttribute("width");return r?[parseInt(r,10)]:null}}return o}},align:eQ()}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:r}){return["td",(0,l.KV)(this.options.HTMLAttributes,r),0]}}),e1=l.bP.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:r=>{let n=r.getAttribute("colwidth");return n?n.split(",").map(r=>parseInt(r,10)):null}},align:eQ()}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:r}){return["th",(0,l.KV)(this.options.HTMLAttributes,r),0]}}),e2=l.bP.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:r}){return["tr",(0,l.KV)(this.options.HTMLAttributes,r),0]}});function e3(r,n){return n?["width",`${Math.max(n,r)}px`]:["min-width",`${r}px`]}function e5(r,n,i,s,o,l){var a;let u=0,c=!0,h=n.firstChild,d=r.firstChild;if(null!==d)for(let r=0,i=0;r<d.childCount;r+=1){let{colspan:a,colwidth:p}=d.child(r).attrs;for(let r=0;r<a;r+=1,i+=1){let a=o===i?l:p&&p[r],d=a?`${a}px`:"";if(u+=a||s,a||(c=!1),h){if(h.style.width!==d){let[r,n]=e3(s,a);h.style.setProperty(r,n)}h=h.nextSibling}else{let r=document.createElement("col"),[i,o]=e3(s,a);r.style.setProperty(i,o),n.appendChild(r)}}}for(;h;){let r=h.nextSibling;null==(a=h.parentNode)||a.removeChild(h),h=r}let p=r.attrs.style&&"string"==typeof r.attrs.style&&/\bwidth\s*:/i.test(r.attrs.style);c&&!p?(i.style.width=`${u}px`,i.style.minWidth=""):(i.style.width="",i.style.minWidth=`${u}px`)}var e4=class{constructor(r,n){this.node=r,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),r.attrs.style&&(this.table.style.cssText=r.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),e5(r,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(r){return r.type===this.node.type&&(this.node=r,e5(r,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(r){let n=r.target,i=this.dom.contains(n),s=this.contentDOM.contains(n);return!!i&&!s&&("attributes"===r.type||"childList"===r.type||"characterData"===r.type)}};function e6(r,n,i,s){let o=0,l=!0,a=[],u=r.firstChild;if(!u)return{};for(let r=0,c=0;r<u.childCount;r+=1){let{colspan:h,colwidth:d}=u.child(r).attrs;for(let r=0;r<h;r+=1,c+=1){let u=i===c?s:d&&d[r];o+=u||n,u||(l=!1);let[h,p]=e3(n,u);a.push(["col",{style:`${h}: ${p}`}])}}return{colgroup:["colgroup",{},...a],tableWidth:l?`${o}px`:"",tableMinWidth:l?"":`${o}px`}}function e8(r,n){return n?r.createChecked(null,n):r.createAndFill()}function e9(r){if(r.cached.tableNodeTypes)return r.cached.tableNodeTypes;let n={};return Object.keys(r.nodes).forEach(i=>{let s=r.nodes[i];s.spec.tableRole&&(n[s.spec.tableRole]=s)}),r.cached.tableNodeTypes=n,n}function e7(r,n,i,s,o){let l=e9(r),a=[],u=[];for(let r=0;r<i;r+=1){let r=e8(l.cell,o);if(r&&u.push(r),s){let r=e8(l.header_cell,o);r&&a.push(r)}}let c=[];for(let r=0;r<n;r+=1)c.push(l.row.createChecked(null,s&&0===r?a:u));return l.table.createChecked(null,c)}function te(r){return r instanceof I}var tt=({editor:r})=>{let{selection:n}=r.state;if(!te(n))return!1;let i=0,s=(0,l.eL)(n.ranges[0].$from,r=>"table"===r.type.name);return null==s||s.node.descendants(r=>{if("table"===r.type.name)return!1;["tableCell","tableHeader"].includes(r.type.name)&&(i+=1)}),i===n.ranges.length&&(r.commands.deleteTable(),!0)},tr="\x1f";function tn(r){return(r||"").replace(/\s+/g," ").trim()}var ti=function(r,n,i={}){var s;let o=null!=(s=i.cellLineSeparator)?s:tr;if(!r||!r.content||0===r.content.length)return"";let l=[];r.content.forEach(r=>{let i=[];r.content&&r.content.forEach(r=>{let s="",l=tn(s=r.content&&Array.isArray(r.content)&&r.content.length>1?r.content.map(r=>n.renderChildren(r)).join(o):r.content?n.renderChildren(r.content):""),a="tableHeader"===r.type,u=eY(r.attrs);i.push({text:l,isHeader:a,align:u})}),l.push(i)});let a=l.reduce((r,n)=>Math.max(r,n.length),0);if(0===a)return"";let u=Array(a).fill(0);l.forEach(r=>{var n;for(let i=0;i<a;i+=1){let s=((null==(n=r[i])?void 0:n.text)||"").length;s>u[i]&&(u[i]=s),u[i]<3&&(u[i]=3)}});let c=(r,n)=>r+" ".repeat(Math.max(0,n-r.length)),h=l[0],d=h.some(r=>r.isHeader),p=Array(a).fill(null);l.forEach(r=>{var n;for(let i=0;i<a;i+=1)!p[i]&&(null==(n=r[i])?void 0:n.align)&&(p[i]=r[i].align)});let f="\n",m=Array(a).fill(0).map((r,n)=>d&&h[n]&&h[n].text||"");return f+=`| ${m.map((r,n)=>c(r,u[n])).join(" | ")} |
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87834],{5989:(r,n,i)=>{"use strict";let s,o;i.d(n,{XI:()=>ts,nA:()=>e0,A0:()=>e1,Hj:()=>e2});var l=i(82159),a=i(76865),u=i(27050),c=i(63197),h=i(12894),d=i(8242);if("u">typeof WeakMap){let r=new WeakMap;s=n=>r.get(n),o=(n,i)=>(r.set(n,i),i)}else{let r=[],n=10,i=0;s=n=>{for(let i=0;i<r.length;i+=2)if(r[i]==n)return r[i+1]},o=(s,o)=>(i==n&&(i=0),r[i++]=s,r[i++]=o)}var p=class{constructor(r,n,i,s){this.width=r,this.height=n,this.map=i,this.problems=s}findCell(r){for(let n=0;n<this.map.length;n++){let i=this.map[n];if(i!=r)continue;let s=n%this.width,o=n/this.width|0,l=s+1,a=o+1;for(let r=1;l<this.width&&this.map[n+r]==i;r++)l++;for(let r=1;a<this.height&&this.map[n+this.width*r]==i;r++)a++;return{left:s,top:o,right:l,bottom:a}}throw RangeError(`No cell with offset ${r} found`)}colCount(r){for(let n=0;n<this.map.length;n++)if(this.map[n]==r)return n%this.width;throw RangeError(`No cell with offset ${r} found`)}nextCell(r,n,i){let{left:s,right:o,top:l,bottom:a}=this.findCell(r);return"horiz"==n?(i<0?0==s:o==this.width)?null:this.map[l*this.width+(i<0?s-1:o)]:(i<0?0==l:a==this.height)?null:this.map[s+this.width*(i<0?l-1:a)]}rectBetween(r,n){let{left:i,right:s,top:o,bottom:l}=this.findCell(r),{left:a,right:u,top:c,bottom:h}=this.findCell(n);return{left:Math.min(i,a),top:Math.min(o,c),right:Math.max(s,u),bottom:Math.max(l,h)}}cellsInRect(r){let n=[],i={};for(let s=r.top;s<r.bottom;s++)for(let o=r.left;o<r.right;o++){let l=s*this.width+o,a=this.map[l];!i[a]&&(i[a]=!0,o==r.left&&o&&this.map[l-1]==a||s==r.top&&s&&this.map[l-this.width]==a||n.push(a))}return n}positionAt(r,n,i){for(let s=0,o=0;;s++){let l=o+i.child(s).nodeSize;if(s==r){let i=n+r*this.width,s=(r+1)*this.width;for(;i<s&&this.map[i]<o;)i++;return i==s?l-1:this.map[i]}o=l}}static get(r){return s(r)||o(r,f(r))}};function f(r){if("table"!=r.type.spec.tableRole)throw RangeError("Not a table node: "+r.type.name);let n=m(r),i=r.childCount,s=[],o=0,l=null,a=[];for(let r=0,o=n*i;r<o;r++)s[r]=0;for(let u=0,c=0;u<i;u++){let h=r.child(u);c++;for(let r=0;;r++){for(;o<s.length&&0!=s[o];)o++;if(r==h.childCount)break;let d=h.child(r),{colspan:p,rowspan:f,colwidth:m}=d.attrs;for(let r=0;r<f;r++){if(r+u>=i){(l||(l=[])).push({type:"overlong_rowspan",pos:c,n:f-r});break}let h=o+r*n;for(let r=0;r<p;r++){0==s[h+r]?s[h+r]=c:(l||(l=[])).push({type:"collision",row:u,pos:c,n:p-r});let i=m&&m[r];if(i){let s=(h+r)%n*2,o=a[s];null==o||o!=i&&1==a[s+1]?(a[s]=i,a[s+1]=1):o==i&&a[s+1]++}}}o+=p,c+=d.nodeSize}let d=(u+1)*n,p=0;for(;o<d;)0==s[o++]&&p++;p&&(l||(l=[])).push({type:"missing",row:u,n:p}),c++}(0===n||0===i)&&(l||(l=[])).push({type:"zero_sized"});let u=new p(n,i,s,l),c=!1;for(let r=0;!c&&r<a.length;r+=2)null!=a[r]&&a[r+1]<i&&(c=!0);return c&&g(u,a,r),u}function m(r){let n=-1,i=!1;for(let s=0;s<r.childCount;s++){let o=r.child(s),l=0;if(i)for(let n=0;n<s;n++){let i=r.child(n);for(let r=0;r<i.childCount;r++){let o=i.child(r);n+o.attrs.rowspan>s&&(l+=o.attrs.colspan)}}for(let r=0;r<o.childCount;r++){let n=o.child(r);l+=n.attrs.colspan,n.attrs.rowspan>1&&(i=!0)}-1==n?n=l:n!=l&&(n=Math.max(n,l))}return n}function g(r,n,i){r.problems||(r.problems=[]);let s={};for(let o=0;o<r.map.length;o++){let l=r.map[o];if(s[l])continue;s[l]=!0;let a=i.nodeAt(l);if(!a)throw RangeError(`No cell with offset ${l} found`);let u=null,c=a.attrs;for(let i=0;i<c.colspan;i++){let s=n[(o+i)%r.width*2];null==s||c.colwidth&&c.colwidth[i]==s||((u||(u=_(c)))[i]=s)}u&&r.problems.unshift({type:"colwidth mismatch",pos:l,colwidth:u})}}function _(r){if(r.colwidth)return r.colwidth.slice();let n=[];for(let i=0;i<r.colspan;i++)n.push(0);return n}function y(r){let n=r.cached.tableNodeTypes;if(!n)for(let i in n=r.cached.tableNodeTypes={},r.nodes){let s=r.nodes[i],o=s.spec.tableRole;o&&(n[o]=s)}return n}let k=new a.hs("selectingCells");function b(r){for(let n=r.depth-1;n>0;n--)if("row"==r.node(n).type.spec.tableRole)return r.node(0).resolve(r.before(n+1));return null}function w(r){for(let n=r.depth;n>0;n--){let i=r.node(n).type.spec.tableRole;if("cell"===i||"header_cell"===i)return r.node(n)}return null}function x(r){let n=r.selection.$head;for(let r=n.depth;r>0;r--)if("row"==n.node(r).type.spec.tableRole)return!0;return!1}function v(r){let n=r.selection;if("$anchorCell"in n&&n.$anchorCell)return n.$anchorCell.pos>n.$headCell.pos?n.$anchorCell:n.$headCell;if("node"in n&&n.node&&"cell"==n.node.type.spec.tableRole)return n.$anchor;let i=b(n.$head)||C(n.$head);if(i)return i;throw RangeError(`No cell found around position ${n.head}`)}function C(r){for(let n=r.nodeAfter,i=r.pos;n;n=n.firstChild,i++){let s=n.type.spec.tableRole;if("cell"==s||"header_cell"==s)return r.doc.resolve(i)}for(let n=r.nodeBefore,i=r.pos;n;n=n.lastChild,i--){let s=n.type.spec.tableRole;if("cell"==s||"header_cell"==s)return r.doc.resolve(i-n.nodeSize)}}function A(r){return"row"==r.parent.type.spec.tableRole&&!!r.nodeAfter}function E(r){return r.node(0).resolve(r.pos+r.nodeAfter.nodeSize)}function S(r,n){return r.depth==n.depth&&r.pos>=n.start(-1)&&r.pos<=n.end(-1)}function M(r,n,i){let s=r.node(-1),o=p.get(s),l=r.start(-1),a=o.nextCell(r.pos-l,n,i);return null==a?null:r.node(0).resolve(l+a)}function T(r,n,i=1){let s={...r,colspan:r.colspan-i};return s.colwidth&&(s.colwidth=s.colwidth.slice(),s.colwidth.splice(n,i),s.colwidth.some(r=>r>0)||(s.colwidth=null)),s}function D(r,n,i=1){let s={...r,colspan:r.colspan+i};if(s.colwidth){s.colwidth=s.colwidth.slice();for(let r=0;r<i;r++)s.colwidth.splice(n,0,0)}return s}function F(r,n,i){let s=y(n.type.schema).header_cell;for(let o=0;o<r.height;o++)if(n.nodeAt(r.map[i+o*r.width]).type!=s)return!1;return!0}var I=class r extends a.LN{constructor(r,n=r){const i=r.node(-1),s=p.get(i),o=r.start(-1),l=s.rectBetween(r.pos-o,n.pos-o),u=r.node(0),c=s.cellsInRect(l).filter(r=>r!=n.pos-o);c.unshift(n.pos-o);const h=c.map(r=>{let n=i.nodeAt(r);if(!n)throw RangeError(`No cell with offset ${r} found`);let s=o+r+1;return new a.yn(u.resolve(s),u.resolve(s+n.content.size))});super(h[0].$from,h[0].$to,h),this.$anchorCell=r,this.$headCell=n}map(n,i){let s=n.resolve(i.map(this.$anchorCell.pos)),o=n.resolve(i.map(this.$headCell.pos));if(A(s)&&A(o)&&S(s,o)){let n=this.$anchorCell.node(-1)!=s.node(-1);return n&&this.isRowSelection()?r.rowSelection(s,o):n&&this.isColSelection()?r.colSelection(s,o):new r(s,o)}return a.U3.between(s,o)}content(){let r=this.$anchorCell.node(-1),n=p.get(r),i=this.$anchorCell.start(-1),s=n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),o={},l=[];for(let i=s.top;i<s.bottom;i++){let a=[];for(let l=i*n.width+s.left,u=s.left;u<s.right;u++,l++){let i=n.map[l];if(o[i])continue;o[i]=!0;let u=n.findCell(i),c=r.nodeAt(i);if(!c)throw RangeError(`No cell with offset ${i} found`);let h=s.left-u.left,d=u.right-s.right;if(h>0||d>0){let r=c.attrs;if(h>0&&(r=T(r,0,h)),d>0&&(r=T(r,r.colspan-d,d)),u.left<s.left){if(!(c=c.type.createAndFill(r)))throw RangeError(`Could not create cell with attrs ${JSON.stringify(r)}`)}else c=c.type.create(r,c.content)}if(u.top<s.top||u.bottom>s.bottom){let r={...c.attrs,rowspan:Math.min(u.bottom,s.bottom)-Math.max(u.top,s.top)};c=u.top<s.top?c.type.createAndFill(r):c.type.create(r,c.content)}a.push(c)}l.push(r.child(i).copy(u.FK.from(a)))}let a=this.isColSelection()&&this.isRowSelection()?r:l;return new u.Ji(u.FK.from(a),1,1)}replace(r,n=u.Ji.empty){let i=r.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:l,$to:a}=s[o],c=r.mapping.slice(i);r.replace(c.map(l.pos),c.map(a.pos),o?u.Ji.empty:n)}let o=a.LN.findFrom(r.doc.resolve(r.mapping.slice(i).map(this.to)),-1);o&&r.setSelection(o)}replaceWith(r,n){this.replace(r,new u.Ji(u.FK.from(n),0,0))}forEachCell(r){let n=this.$anchorCell.node(-1),i=p.get(n),s=this.$anchorCell.start(-1),o=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-s,this.$headCell.pos-s));for(let i=0;i<o.length;i++)r(n.nodeAt(o[i]),s+o[i])}isColSelection(){let r=this.$anchorCell.index(-1),n=this.$headCell.index(-1);return!(Math.min(r,n)>0)&&Math.max(r+this.$anchorCell.nodeAfter.attrs.rowspan,n+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(n,i=n){let s=n.node(-1),o=p.get(s),l=n.start(-1),a=o.findCell(n.pos-l),u=o.findCell(i.pos-l),c=n.node(0);return a.top<=u.top?(a.top>0&&(n=c.resolve(l+o.map[a.left])),u.bottom<o.height&&(i=c.resolve(l+o.map[o.width*(o.height-1)+u.right-1]))):(u.top>0&&(i=c.resolve(l+o.map[u.left])),a.bottom<o.height&&(n=c.resolve(l+o.map[o.width*(o.height-1)+a.right-1]))),new r(n,i)}isRowSelection(){let r=this.$anchorCell.node(-1),n=p.get(r),i=this.$anchorCell.start(-1),s=n.colCount(this.$anchorCell.pos-i),o=n.colCount(this.$headCell.pos-i);return!(Math.min(s,o)>0)&&Math.max(s+this.$anchorCell.nodeAfter.attrs.colspan,o+this.$headCell.nodeAfter.attrs.colspan)==n.width}eq(n){return n instanceof r&&n.$anchorCell.pos==this.$anchorCell.pos&&n.$headCell.pos==this.$headCell.pos}static rowSelection(n,i=n){let s=n.node(-1),o=p.get(s),l=n.start(-1),a=o.findCell(n.pos-l),u=o.findCell(i.pos-l),c=n.node(0);return a.left<=u.left?(a.left>0&&(n=c.resolve(l+o.map[a.top*o.width])),u.right<o.width&&(i=c.resolve(l+o.map[o.width*(u.top+1)-1]))):(u.left>0&&(i=c.resolve(l+o.map[u.top*o.width])),a.right<o.width&&(n=c.resolve(l+o.map[o.width*(a.top+1)-1]))),new r(n,i)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(n,i){return new r(n.resolve(i.anchor),n.resolve(i.head))}static create(n,i,s=i){return new r(n.resolve(i),n.resolve(s))}getBookmark(){return new L(this.$anchorCell.pos,this.$headCell.pos)}};I.prototype.visible=!1,a.LN.jsonID("cell",I);var L=class r{constructor(r,n){this.anchor=r,this.head=n}map(n){return new r(n.map(this.anchor),n.map(this.head))}resolve(r){let n=r.resolve(this.anchor),i=r.resolve(this.head);return"row"==n.parent.type.spec.tableRole&&"row"==i.parent.type.spec.tableRole&&n.index()<n.parent.childCount&&i.index()<i.parent.childCount&&S(n,i)?new I(n,i):a.LN.near(i,1)}};function R(r){if(!(r.selection instanceof I))return null;let n=[];return r.selection.forEachCell((r,i)=>{n.push(c.NZ.node(i,i+r.nodeSize,{class:"selectedCell"}))}),c.zF.create(r.doc,n)}function N({$from:r,$to:n}){if(r.pos==n.pos||r.pos<n.pos-6)return!1;let i=r.pos,s=n.pos,o=r.depth;for(;o>=0&&!(r.after(o+1)<r.end(o));o--,i++);for(let r=n.depth;r>=0&&!(n.before(r+1)>n.start(r));r--,s--);return i==s&&/row|table/.test(r.node(o).type.spec.tableRole)}function O({$from:r,$to:n}){let i,s;for(let n=r.depth;n>0;n--){let s=r.node(n);if("cell"===s.type.spec.tableRole||"header_cell"===s.type.spec.tableRole){i=s;break}}for(let r=n.depth;r>0;r--){let i=n.node(r);if("cell"===i.type.spec.tableRole||"header_cell"===i.type.spec.tableRole){s=i;break}}return i!==s&&0===n.parentOffset}function z(r,n,i){let s,o,l=(n||r).selection,u=(n||r).doc;if(l instanceof a.nh&&(o=l.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)s=I.create(u,l.from);else if("row"==o){let r=u.resolve(l.from+1);s=I.rowSelection(r,r)}else if(!i){let r=p.get(l.node),n=l.from+1,i=n+r.map[r.width*r.height-1];s=I.create(u,n+1,i)}}else l instanceof a.U3&&N(l)?s=a.U3.create(u,l.from):l instanceof a.U3&&O(l)&&(s=a.U3.create(u,l.$from.start(),l.$from.end()));return s&&(n||(n=r.tr)).setSelection(s),n}let P=new a.hs("fix-tables");function $(r,n,i,s){let o=r.childCount,l=n.childCount;e:for(let a=0,u=0;a<l;a++){let l=n.child(a);for(let n=u,s=Math.min(o,a+3);n<s;n++)if(r.child(n)==l){u=n+1,i+=l.nodeSize;continue e}s(l,i),u<o&&r.child(u).sameMarkup(l)?$(r.child(u),l,i+1,s):l.nodesBetween(0,l.content.size,s,i+1),i+=l.nodeSize}}function B(r,n){let i,s=(n,s)=>{"table"==n.type.spec.tableRole&&(i=q(r,n,s,i))};return n?n.doc!=r.doc&&$(n.doc,r.doc,0,s):r.doc.descendants(s),i}function q(r,n,i,s){let o,l,a=p.get(n);if(!a.problems)return s;s||(s=r.tr);let u=[];for(let r=0;r<a.height;r++)u.push(0);for(let r=0;r<a.problems.length;r++){let o=a.problems[r];if("collision"==o.type){let r=n.nodeAt(o.pos);if(!r)continue;let l=r.attrs;for(let r=0;r<l.rowspan;r++)u[o.row+r]+=o.n;s.setNodeMarkup(s.mapping.map(i+1+o.pos),null,T(l,l.colspan-o.n,o.n))}else if("missing"==o.type)u[o.row]+=o.n;else if("overlong_rowspan"==o.type){let r=n.nodeAt(o.pos);if(!r)continue;s.setNodeMarkup(s.mapping.map(i+1+o.pos),null,{...r.attrs,rowspan:r.attrs.rowspan-o.n})}else if("colwidth mismatch"==o.type){let r=n.nodeAt(o.pos);if(!r)continue;s.setNodeMarkup(s.mapping.map(i+1+o.pos),null,{...r.attrs,colwidth:o.colwidth})}else if("zero_sized"==o.type){let r=s.mapping.map(i);s.delete(r,r+n.nodeSize)}}for(let r=0;r<u.length;r++)u[r]&&(null==o&&(o=r),l=r);for(let c=0,h=i+1;c<a.height;c++){let i=n.child(c),a=h+i.nodeSize,d=u[c];if(d>0){let n="cell";i.firstChild&&(n=i.firstChild.type.spec.tableRole);let u=[];for(let i=0;i<d;i++){let i=y(r.schema)[n].createAndFill();i&&u.push(i)}let p=(0==c||o==c-1)&&l==c?h+1:a-1;s.insert(s.mapping.map(p),u)}h=a}return s.setMeta(P,{fixTables:!0})}function j(r){let n=r.selection,i=v(r),s=i.node(-1),o=i.start(-1),l=p.get(s);return{...n instanceof I?l.rectBetween(n.$anchorCell.pos-o,n.$headCell.pos-o):l.findCell(i.pos-o),tableStart:o,map:l,table:s}}function H(r,{map:n,tableStart:i,table:s},o){let l=o>0?-1:0;F(n,s,o+l)&&(l=0==o||o==n.width?null:0);for(let a=0;a<n.height;a++){let u=a*n.width+o;if(o>0&&o<n.width&&n.map[u-1]==n.map[u]){let l=n.map[u],c=s.nodeAt(l);r.setNodeMarkup(r.mapping.map(i+l),null,D(c.attrs,o-n.colCount(l))),a+=c.attrs.rowspan-1}else{let c=null==l?y(s.type.schema).cell:s.nodeAt(n.map[u+l]).type,h=n.positionAt(a,o,s);r.insert(r.mapping.map(i+h),c.createAndFill())}}return r}function V(r,n){if(!x(r))return!1;if(n){let i=j(r);n(H(r.tr,i,i.left))}return!0}function U(r,n){if(!x(r))return!1;if(n){let i=j(r);n(H(r.tr,i,i.right))}return!0}function W(r,{map:n,table:i,tableStart:s},o){let l=r.mapping.maps.length;for(let a=0;a<n.height;){let u=a*n.width+o,c=n.map[u],h=i.nodeAt(c),d=h.attrs;if(o>0&&n.map[u-1]==c||o<n.width-1&&n.map[u+1]==c)r.setNodeMarkup(r.mapping.slice(l).map(s+c),null,T(d,o-n.colCount(c)));else{let n=r.mapping.slice(l).map(s+c);r.delete(n,n+h.nodeSize)}a+=d.rowspan}}function J(r,n){if(!x(r))return!1;if(n){let i=j(r),s=r.tr;if(0==i.left&&i.right==i.map.width)return!1;for(let r=i.right-1;W(s,i,r),r!=i.left;r--){let r=i.tableStart?s.doc.nodeAt(i.tableStart-1):s.doc;if(!r)throw RangeError("No table found");i.table=r,i.map=p.get(r)}n(s)}return!0}function K(r,n,i){var s;let o=y(n.type.schema).header_cell;for(let l=0;l<r.width;l++)if((null==(s=n.nodeAt(r.map[l+i*r.width]))?void 0:s.type)!=o)return!1;return!0}function G(r,{map:n,tableStart:i,table:s},o){let l=i;for(let r=0;r<o;r++)l+=s.child(r).nodeSize;let a=[],u=o>0?-1:0;K(n,s,o+u)&&(u=0==o||o==n.height?null:0);for(let l=0,h=n.width*o;l<n.width;l++,h++)if(o>0&&o<n.height&&n.map[h]==n.map[h-n.width]){let o=n.map[h],a=s.nodeAt(o).attrs;r.setNodeMarkup(i+o,null,{...a,rowspan:a.rowspan+1}),l+=a.colspan-1}else{var c;let r=null==u?y(s.type.schema).cell:null==(c=s.nodeAt(n.map[h+u*n.width]))?void 0:c.type,i=null==r?void 0:r.createAndFill();i&&a.push(i)}return r.insert(l,y(s.type.schema).row.create(null,a)),r}function Z(r,n){if(!x(r))return!1;if(n){let i=j(r);n(G(r.tr,i,i.top))}return!0}function X(r,n){if(!x(r))return!1;if(n){let i=j(r);n(G(r.tr,i,i.bottom))}return!0}function Y(r,{map:n,table:i,tableStart:s},o){let l=0;for(let r=0;r<o;r++)l+=i.child(r).nodeSize;let a=l+i.child(o).nodeSize,u=r.mapping.maps.length;r.delete(l+s,a+s);let c=new Set;for(let l=0,a=o*n.width;l<n.width;l++,a++){let h=n.map[a];if(!c.has(h)){if(c.add(h),o>0&&h==n.map[a-n.width]){let n=i.nodeAt(h).attrs;r.setNodeMarkup(r.mapping.slice(u).map(h+s),null,{...n,rowspan:n.rowspan-1}),l+=n.colspan-1}else if(o<n.height&&h==n.map[a+n.width]){let a=i.nodeAt(h),c=a.attrs,d=a.type.create({...c,rowspan:a.attrs.rowspan-1},a.content),p=n.positionAt(o+1,l,i);r.insert(r.mapping.slice(u).map(s+p),d),l+=c.colspan-1}}}}function Q(r,n){if(!x(r))return!1;if(n){let i=j(r),s=r.tr;if(0==i.top&&i.bottom==i.map.height)return!1;for(let r=i.bottom-1;Y(s,i,r),r!=i.top;r--){let r=i.tableStart?s.doc.nodeAt(i.tableStart-1):s.doc;if(!r)throw RangeError("No table found");i.table=r,i.map=p.get(i.table)}n(s)}return!0}function ee(r){let n=r.content;return 1==n.childCount&&n.child(0).isTextblock&&0==n.child(0).childCount}function et({width:r,height:n,map:i},s){let o=s.top*r+s.left,l=o,a=(s.bottom-1)*r+s.left,u=o+(s.right-s.left-1);for(let n=s.top;n<s.bottom;n++){if(s.left>0&&i[l]==i[l-1]||s.right<r&&i[u]==i[u+1])return!0;l+=r,u+=r}for(let l=s.left;l<s.right;l++){if(s.top>0&&i[o]==i[o-r]||s.bottom<n&&i[a]==i[a+r])return!0;o++,a++}return!1}function er(r,n){let i=r.selection;if(!(i instanceof I)||i.$anchorCell.pos==i.$headCell.pos)return!1;let s=j(r),{map:o}=s;if(et(o,s))return!1;if(n){let i,l,a=r.tr,c={},h=u.FK.empty;for(let r=s.top;r<s.bottom;r++)for(let n=s.left;n<s.right;n++){let u=o.map[r*o.width+n],d=s.table.nodeAt(u);if(!c[u]&&d)if(c[u]=!0,null==i)i=u,l=d;else{ee(d)||(h=h.append(d.content));let r=a.mapping.map(u+s.tableStart);a.delete(r,r+d.nodeSize)}}if(null==i||null==l)return!0;if(a.setNodeMarkup(i+s.tableStart,null,{...D(l.attrs,l.attrs.colspan,s.right-s.left-l.attrs.colspan),rowspan:s.bottom-s.top}),h.size>0){let r=i+1+l.content.size,n=ee(l)?i+1:r;a.replaceWith(n+s.tableStart,r+s.tableStart,h)}a.setSelection(new I(a.doc.resolve(i+s.tableStart))),n(a)}return!0}function en(r,n){let i=y(r.schema);return ei(({node:r})=>i[r.type.spec.tableRole])(r,n)}function ei(r){return(n,i)=>{let s,o,l=n.selection;if(l instanceof I){if(l.$anchorCell.pos!=l.$headCell.pos)return!1;s=l.$anchorCell.nodeAfter,o=l.$anchorCell.pos}else{var a;if(!(s=w(l.$from)))return!1;o=null==(a=b(l.$from))?void 0:a.pos}if(null==s||null==o||1==s.attrs.colspan&&1==s.attrs.rowspan)return!1;if(i){let a,u=s.attrs,c=[],h=u.colwidth;u.rowspan>1&&(u={...u,rowspan:1}),u.colspan>1&&(u={...u,colspan:1});let d=j(n),p=n.tr;for(let r=0;r<d.right-d.left;r++)c.push(h?{...u,colwidth:h&&h[r]?[h[r]]:null}:u);for(let n=d.top;n<d.bottom;n++){let i=d.map.positionAt(n,d.left,d.table);n==d.top&&(i+=s.nodeSize);for(let o=d.left,l=0;o<d.right;o++,l++)(o!=d.left||n!=d.top)&&p.insert(a=p.mapping.map(i+d.tableStart,1),r({node:s,row:n,col:o}).createAndFill(c[l]))}p.setNodeMarkup(o,r({node:s,row:d.top,col:d.left}),c[0]),l instanceof I&&p.setSelection(new I(p.doc.resolve(l.$anchorCell.pos),a?p.doc.resolve(a):void 0)),i(p)}return!0}}function es(r,n){return function(i,s){if(!x(i))return!1;let o=v(i);if(o.nodeAfter.attrs[r]===n)return!1;if(s){let l=i.tr;i.selection instanceof I?i.selection.forEachCell((i,s)=>{i.attrs[r]!==n&&l.setNodeMarkup(s,null,{...i.attrs,[r]:n})}):l.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[r]:n}),s(l)}return!0}}function eo(r){return function(n,i){if(!x(n))return!1;if(i){let s=y(n.schema),o=j(n),l=n.tr,a=o.map.cellsInRect("column"==r?{left:o.left,top:0,right:o.right,bottom:o.map.height}:"row"==r?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),u=a.map(r=>o.table.nodeAt(r));for(let r=0;r<a.length;r++)u[r].type==s.header_cell&&l.setNodeMarkup(o.tableStart+a[r],s.cell,u[r].attrs);if(0===l.steps.length)for(let r=0;r<a.length;r++)l.setNodeMarkup(o.tableStart+a[r],s.header_cell,u[r].attrs);i(l)}return!0}}function el(r,n,i){let s=n.map.cellsInRect({left:0,top:0,right:"row"==r?n.map.width:1,bottom:"column"==r?n.map.height:1});for(let r=0;r<s.length;r++){let o=n.table.nodeAt(s[r]);if(o&&o.type!==i.header_cell)return!1}return!0}function ea(r,n){return(n=n||{useDeprecatedLogic:!1}).useDeprecatedLogic?eo(r):function(n,i){if(!x(n))return!1;if(i){let s=y(n.schema),o=j(n),l=n.tr,a=el("row",o,s),u=el("column",o,s),c=+("column"===r?!!a:"row"===r&&!!u),h="column"==r?{left:0,top:c,right:1,bottom:o.map.height}:"row"==r?{left:c,top:0,right:o.map.width,bottom:1}:o,d="column"==r?u?s.cell:s.header_cell:"row"==r?a?s.cell:s.header_cell:s.cell;o.map.cellsInRect(h).forEach(r=>{let n=r+o.tableStart,i=l.doc.nodeAt(n);i&&l.setNodeMarkup(n,d,i.attrs)}),i(l)}return!0}}ea("row",{useDeprecatedLogic:!0}),ea("column",{useDeprecatedLogic:!0});let eu=ea("cell",{useDeprecatedLogic:!0});function ec(r,n){if(n<0){let n=r.nodeBefore;if(n)return r.pos-n.nodeSize;for(let n=r.index(-1)-1,i=r.before();n>=0;n--){let s=r.node(-1).child(n),o=s.lastChild;if(o)return i-1-o.nodeSize;i-=s.nodeSize}}else{if(r.index()<r.parent.childCount-1)return r.pos+r.nodeAfter.nodeSize;let n=r.node(-1);for(let i=r.indexAfter(-1),s=r.after();i<n.childCount;i++){let r=n.child(i);if(r.childCount)return s+1;s+=r.nodeSize}}return null}function eh(r){return function(n,i){if(!x(n))return!1;let s=ec(v(n),r);if(null==s)return!1;if(i){let r=n.doc.resolve(s);i(n.tr.setSelection(a.U3.between(r,E(r))).scrollIntoView())}return!0}}function ed(r,n){let i=r.selection.$anchor;for(let s=i.depth;s>0;s--)if("table"==i.node(s).type.spec.tableRole)return n&&n(r.tr.delete(i.before(s),i.after(s)).scrollIntoView()),!0;return!1}function ep(r,n){let i=r.selection;if(!(i instanceof I))return!1;if(n){let s=r.tr,o=y(r.schema).cell.createAndFill().content;i.forEachCell((r,n)=>{r.content.eq(o)||s.replace(s.mapping.map(n+1),s.mapping.map(n+r.nodeSize-1),new u.Ji(o,0,0))}),s.docChanged&&n(s)}return!0}function ef(r){if(0===r.size)return null;let{content:n,openStart:i,openEnd:s}=r;for(;1==n.childCount&&(i>0&&s>0||"table"==n.child(0).type.spec.tableRole);)i--,s--,n=n.child(0).content;let o=n.child(0),l=o.type.spec.tableRole,a=o.type.schema,c=[];if("row"==l)for(let r=0;r<n.childCount;r++){let o=n.child(r).content,l=r?0:Math.max(0,i-1),h=r<n.childCount-1?0:Math.max(0,s-1);(l||h)&&(o=eg(y(a).row,new u.Ji(o,l,h)).content),c.push(o)}else{if("cell"!=l&&"header_cell"!=l)return null;c.push(i||s?eg(y(a).row,new u.Ji(n,i,s)).content:n)}return em(a,c)}function em(r,n){let i=[];for(let r=0;r<n.length;r++){let s=n[r];for(let n=s.childCount-1;n>=0;n--){let{rowspan:o,colspan:l}=s.child(n).attrs;for(let n=r;n<r+o;n++)i[n]=(i[n]||0)+l}}let s=0;for(let r=0;r<i.length;r++)s=Math.max(s,i[r]);for(let o=0;o<i.length;o++)if(o>=n.length&&n.push(u.FK.empty),i[o]<s){let l=y(r).cell.createAndFill(),a=[];for(let r=i[o];r<s;r++)a.push(l);n[o]=n[o].append(u.FK.from(a))}return{height:n.length,width:s,rows:n}}function eg(r,n){let i=r.createAndFill();return new d.dL(i).replace(0,i.content.size,n).doc}function e_({width:r,height:n,rows:i},s,o){if(r!=s){let n=[],o=[];for(let r=0;r<i.length;r++){let l=i[r],a=[];for(let i=n[r]||0,o=0;i<s;o++){let u=l.child(o%l.childCount);i+u.attrs.colspan>s&&(u=u.type.createChecked(T(u.attrs,u.attrs.colspan,i+u.attrs.colspan-s),u.content)),a.push(u),i+=u.attrs.colspan;for(let i=1;i<u.attrs.rowspan;i++)n[r+i]=(n[r+i]||0)+u.attrs.colspan}o.push(u.FK.from(a))}i=o,r=s}if(n!=o){let r=[];for(let s=0,l=0;s<o;s++,l++){let a=[],c=i[l%n];for(let r=0;r<c.childCount;r++){let n=c.child(r);s+n.attrs.rowspan>o&&(n=n.type.create({...n.attrs,rowspan:Math.max(1,o-n.attrs.rowspan)},n.content)),a.push(n)}r.push(u.FK.from(a))}i=r,n=o}return{width:r,height:n,rows:i}}function ey(r,n,i,s,o,l,a){let c,h,d=y(r.doc.type.schema);if(o>n.width)for(let l=0,u=0;l<n.height;l++){let p,f=i.child(l);u+=f.nodeSize;let m=[];p=null==f.lastChild||f.lastChild.type==d.cell?c||(c=d.cell.createAndFill()):h||(h=d.header_cell.createAndFill());for(let r=n.width;r<o;r++)m.push(p);r.insert(r.mapping.slice(a).map(u-1+s),m)}if(l>n.height){let p=[];for(let r=0,s=(n.height-1)*n.width;r<Math.max(n.width,o);r++){let o=!(r>=n.width)&&i.nodeAt(n.map[s+r]).type==d.header_cell;p.push(o?h||(h=d.header_cell.createAndFill()):c||(c=d.cell.createAndFill()))}let f=d.row.create(null,u.FK.from(p)),m=[];for(let r=n.height;r<l;r++)m.push(f);r.insert(r.mapping.slice(a).map(s+i.nodeSize-2),m)}return!!(c||h)}function ek(r,n,i,s,o,l,a,u){if(0==a||a==n.height)return!1;let c=!1;for(let h=o;h<l;h++){let o=a*n.width+h,l=n.map[o];if(n.map[o-n.width]==l){c=!0;let o=i.nodeAt(l),{top:d,left:p}=n.findCell(l);r.setNodeMarkup(r.mapping.slice(u).map(l+s),null,{...o.attrs,rowspan:a-d}),r.insert(r.mapping.slice(u).map(n.positionAt(a,p,i)),o.type.createAndFill({...o.attrs,rowspan:d+o.attrs.rowspan-a})),h+=o.attrs.colspan-1}}return c}function eb(r,n,i,s,o,l,a,u){if(0==a||a==n.width)return!1;let c=!1;for(let h=o;h<l;h++){let o=h*n.width+a,l=n.map[o];if(n.map[o-1]==l){c=!0;let o=i.nodeAt(l),d=n.colCount(l),p=r.mapping.slice(u).map(l+s);r.setNodeMarkup(p,null,T(o.attrs,a-d,o.attrs.colspan-(a-d))),r.insert(p+o.nodeSize,o.type.createAndFill(T(o.attrs,0,a-d))),h+=o.attrs.rowspan-1}}return c}function ew(r,n,i,s,o){let l=i?r.doc.nodeAt(i-1):r.doc;if(!l)throw Error("No table found");let a=p.get(l),{top:c,left:h}=s,d=h+o.width,f=c+o.height,m=r.tr,g=0;function _(){if(!(l=i?m.doc.nodeAt(i-1):m.doc))throw Error("No table found");a=p.get(l),g=m.mapping.maps.length}ey(m,a,l,i,d,f,0)&&_(),ek(m,a,l,i,h,d,c,g)&&_(),ek(m,a,l,i,h,d,f,g)&&_(),eb(m,a,l,i,c,f,h,g)&&_(),eb(m,a,l,i,c,f,d,g)&&_();for(let r=c;r<f;r++){let n=a.positionAt(r,h,l),s=a.positionAt(r,d,l);m.replace(m.mapping.slice(g).map(n+i),m.mapping.slice(g).map(s+i),new u.Ji(o.rows[r-c],0,0))}_(),m.setSelection(new I(m.doc.resolve(i+a.positionAt(c,h,l)),m.doc.resolve(i+a.positionAt(f-1,d-1,l)))),n(m)}let ex=(0,h.K)({ArrowLeft:eC("horiz",-1),ArrowRight:eC("horiz",1),ArrowUp:eC("vert",-1),ArrowDown:eC("vert",1),"Shift-ArrowLeft":eA("horiz",-1),"Shift-ArrowRight":eA("horiz",1),"Shift-ArrowUp":eA("vert",-1),"Shift-ArrowDown":eA("vert",1),Backspace:ep,"Mod-Backspace":ep,Delete:ep,"Mod-Delete":ep});function ev(r,n,i){return!i.eq(r.selection)&&(n&&n(r.tr.setSelection(i).scrollIntoView()),!0)}function eC(r,n){return(i,s,o)=>{if(!o)return!1;let l=i.selection;if(l instanceof I)return ev(i,s,a.LN.near(l.$headCell,n));if("horiz"!=r&&!l.empty)return!1;let u=eT(o,r,n);if(null==u)return!1;if("horiz"==r)return ev(i,s,a.LN.near(i.doc.resolve(l.head+n),n));{let o,l=i.doc.resolve(u),c=M(l,r,n);return o=c?a.LN.near(c,1):n<0?a.LN.near(i.doc.resolve(l.before(-1)),-1):a.LN.near(i.doc.resolve(l.after(-1)),1),ev(i,s,o)}}}function eA(r,n){return(i,s,o)=>{let l;if(!o)return!1;let a=i.selection;if(a instanceof I)l=a;else{let s=eT(o,r,n);if(null==s)return!1;l=new I(i.doc.resolve(s))}let u=M(l.$headCell,r,n);return!!u&&ev(i,s,new I(l.$anchorCell,u))}}function eE(r,n){let i=b(r.state.doc.resolve(n));return!!i&&(r.dispatch(r.state.tr.setSelection(new I(i))),!0)}function eS(r,n,i){if(!x(r.state))return!1;let s=ef(i),o=r.state.selection;if(o instanceof I){s||(s={width:1,height:1,rows:[u.FK.from(eg(y(r.state.schema).cell,i))]});let n=o.$anchorCell.node(-1),l=o.$anchorCell.start(-1),a=p.get(n).rectBetween(o.$anchorCell.pos-l,o.$headCell.pos-l);return s=e_(s,a.right-a.left,a.bottom-a.top),ew(r.state,r.dispatch,l,a,s),!0}if(!s)return!1;{let n=v(r.state),i=n.start(-1);return ew(r.state,r.dispatch,i,p.get(n.node(-1)).findCell(n.pos-i),s),!0}}function eM(r,n){var i;let s;if(0!=n.button||n.ctrlKey||n.metaKey)return;let o=eD(r,n.target);if(n.shiftKey&&r.state.selection instanceof I)l(r.state.selection.$anchorCell,n),n.preventDefault();else if(n.shiftKey&&o&&null!=(s=b(r.state.selection.$anchor))&&(null==(i=eF(r,n))?void 0:i.pos)!=s.pos)l(s,n),n.preventDefault();else if(!o)return;function l(n,i){let s=eF(r,i),o=null==k.getState(r.state);if(!s||!S(n,s))if(!o)return;else s=n;let l=new I(n,s);if(o||!r.state.selection.eq(l)){let i=r.state.tr.setSelection(l);o&&i.setMeta(k,n.pos),r.dispatch(i)}}function a(){r.root.removeEventListener("mouseup",a),r.root.removeEventListener("dragstart",a),r.root.removeEventListener("mousemove",u),null!=k.getState(r.state)&&r.dispatch(r.state.tr.setMeta(k,-1))}function u(i){let s,u=i,c=k.getState(r.state);if(null!=c)s=r.state.doc.resolve(c);else if(eD(r,u.target)!=o&&!(s=eF(r,n)))return a();s&&l(s,u)}r.root.addEventListener("mouseup",a),r.root.addEventListener("dragstart",a),r.root.addEventListener("mousemove",u)}function eT(r,n,i){if(!(r.state.selection instanceof a.U3))return null;let{$head:s}=r.state.selection;for(let o=s.depth-1;o>=0;o--){let l=s.node(o);if((i<0?s.index(o):s.indexAfter(o))!=(i<0?0:l.childCount))break;if("cell"==l.type.spec.tableRole||"header_cell"==l.type.spec.tableRole){let l=s.before(o),a="vert"==n?i>0?"down":"up":i>0?"right":"left";return r.endOfTextblock(a)?l:null}}return null}function eD(r,n){for(;n&&n!=r.dom;n=n.parentNode)if("TD"==n.nodeName||"TH"==n.nodeName)return n;return null}function eF(r,n){let i=r.posAtCoords({left:n.clientX,top:n.clientY});if(!i)return null;let{inside:s,pos:o}=i;return s>=0&&b(r.state.doc.resolve(s))||b(r.state.doc.resolve(o))}var eI=class{constructor(r,n){this.node=r,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),eL(r,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(r){return r.type==this.node.type&&(this.node=r,eL(r,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(r){return"attributes"==r.type&&(r.target==this.table||this.colgroup.contains(r.target))}};function eL(r,n,i,s,o,l){let a=0,u=!0,c=n.firstChild,h=r.firstChild;if(h){for(let r=0,i=0;r<h.childCount;r++){let{colspan:d,colwidth:p}=h.child(r).attrs;for(let r=0;r<d;r++,i++){let h=o==i?l:p&&p[r],d=h?h+"px":"";if(a+=h||s,h||(u=!1),c)c.style.width!=d&&(c.style.width=d),c=c.nextSibling;else{let r=document.createElement("col");r.style.width=d,n.appendChild(r)}}}for(;c;){var d;let r=c.nextSibling;null==(d=c.parentNode)||d.removeChild(c),c=r}u?(i.style.width=a+"px",i.style.minWidth=""):(i.style.width="",i.style.minWidth=a+"px")}}let eR=new a.hs("tableColumnResizing");function eN({handleWidth:r=5,cellMinWidth:n=25,defaultCellMinWidth:i=100,View:s=eI,lastColumnResizable:o=!0}={}){let l=new a.k_({key:eR,state:{init(r,n){var o;let a=null==(o=l.spec)||null==(o=o.props)?void 0:o.nodeViews,u=y(n.schema).table.name;return s&&a&&(a[u]=(r,n)=>new s(r,i,n)),new eO(-1,!1)},apply:(r,n)=>n.apply(r)},props:{attributes:r=>{let n=eR.getState(r);return n&&n.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(n,i)=>{ez(n,i,r,o)},mouseleave:r=>{eP(r)},mousedown:(r,s)=>{e$(r,s,n,i)}},decorations:r=>{let n=eR.getState(r);if(n&&n.activeHandle>-1)return eK(r,n.activeHandle)},nodeViews:{}}});return l}var eO=class r{constructor(r,n){this.activeHandle=r,this.dragging=n}apply(n){let i=this,s=n.getMeta(eR);if(s&&null!=s.setHandle)return new r(s.setHandle,!1);if(s&&void 0!==s.setDragging)return new r(i.activeHandle,s.setDragging);if(i.activeHandle>-1&&n.docChanged){let s=n.mapping.map(i.activeHandle,-1);return A(n.doc.resolve(s))||(s=-1),new r(s,i.dragging)}return i}};function ez(r,n,i,s){if(!r.editable)return;let o=eR.getState(r.state);if(o&&!o.dragging){let l=eq(n.target),a=-1;if(l){let{left:s,right:o}=l.getBoundingClientRect();n.clientX-s<=i?a=ej(r,n,"left",i):o-n.clientX<=i&&(a=ej(r,n,"right",i))}if(a!=o.activeHandle){if(!s&&-1!==a){let n=r.state.doc.resolve(a),i=n.node(-1),s=p.get(i),o=n.start(-1);if(s.colCount(n.pos-o)+n.nodeAfter.attrs.colspan-1==s.width-1)return}eV(r,a)}}}function eP(r){if(!r.editable)return;let n=eR.getState(r.state);n&&n.activeHandle>-1&&!n.dragging&&eV(r,-1)}function e$(r,n,i,s){var o;if(!r.editable)return!1;let l=null!=(o=r.dom.ownerDocument.defaultView)?o:window,a=eR.getState(r.state);if(!a||-1==a.activeHandle||a.dragging)return!1;let u=r.state.doc.nodeAt(a.activeHandle),c=eB(r,a.activeHandle,u.attrs);function h(n){l.removeEventListener("mouseup",h),l.removeEventListener("mousemove",d);let s=eR.getState(r.state);(null==s?void 0:s.dragging)&&(eU(r,s.activeHandle,eH(s.dragging,n,i)),r.dispatch(r.state.tr.setMeta(eR,{setDragging:null})))}function d(n){if(!n.which)return h(n);let o=eR.getState(r.state);if(o&&o.dragging){let l=eH(o.dragging,n,i);eW(r,o.activeHandle,l,s)}}return r.dispatch(r.state.tr.setMeta(eR,{setDragging:{startX:n.clientX,startWidth:c}})),eW(r,a.activeHandle,c,s),l.addEventListener("mouseup",h),l.addEventListener("mousemove",d),n.preventDefault(),!0}function eB(r,n,{colspan:i,colwidth:s}){let o=s&&s[s.length-1];if(o)return o;let l=r.domAtPos(n),a=l.node.childNodes[l.offset].offsetWidth,u=i;if(s)for(let r=0;r<i;r++)s[r]&&(a-=s[r],u--);return a/u}function eq(r){for(;r&&"TD"!=r.nodeName&&"TH"!=r.nodeName;)r=r.classList&&r.classList.contains("ProseMirror")?null:r.parentNode;return r}function ej(r,n,i,s){let o="right"==i?-s:s,l=r.posAtCoords({left:n.clientX+o,top:n.clientY});if(!l)return -1;let{pos:a}=l,u=b(r.state.doc.resolve(a));if(!u)return -1;if("right"==i)return u.pos;let c=p.get(u.node(-1)),h=u.start(-1),d=c.map.indexOf(u.pos-h);return d%c.width==0?-1:h+c.map[d-1]}function eH(r,n,i){let s=n.clientX-r.startX;return Math.max(i,r.startWidth+s)}function eV(r,n){r.dispatch(r.state.tr.setMeta(eR,{setHandle:n}))}function eU(r,n,i){let s=r.state.doc.resolve(n),o=s.node(-1),l=p.get(o),a=s.start(-1),u=l.colCount(s.pos-a)+s.nodeAfter.attrs.colspan-1,c=r.state.tr;for(let r=0;r<l.height;r++){let n=r*l.width+u;if(r&&l.map[n]==l.map[n-l.width])continue;let s=l.map[n],h=o.nodeAt(s).attrs,d=1==h.colspan?0:u-l.colCount(s);if(h.colwidth&&h.colwidth[d]==i)continue;let p=h.colwidth?h.colwidth.slice():eJ(h.colspan);p[d]=i,c.setNodeMarkup(a+s,null,{...h,colwidth:p})}c.docChanged&&r.dispatch(c)}function eW(r,n,i,s){let o=r.state.doc.resolve(n),l=o.node(-1),a=o.start(-1),u=p.get(l).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,c=r.domAtPos(o.start(-1)).node;for(;c&&"TABLE"!=c.nodeName;)c=c.parentNode;c&&eL(l,c.firstChild,c,s,u,i)}function eJ(r){return Array(r).fill(0)}function eK(r,n){let i=[],s=r.doc.resolve(n),o=s.node(-1);if(!o)return c.zF.empty;let l=p.get(o),a=s.start(-1),u=l.colCount(s.pos-a)+s.nodeAfter.attrs.colspan-1;for(let n=0;n<l.height;n++){let s=u+n*l.width;if((u==l.width-1||l.map[s]!=l.map[s+1])&&(0==n||l.map[s]!=l.map[s-l.width])){var h;let n=l.map[s],u=a+n+o.nodeAt(n).nodeSize-1,d=document.createElement("div");d.className="column-resize-handle",(null==(h=eR.getState(r))?void 0:h.dragging)&&i.push(c.NZ.node(a+n,a+n+o.nodeAt(n).nodeSize,{class:"column-resize-dragging"})),i.push(c.NZ.widget(u,d))}}return c.zF.create(r.doc,i)}function eG({allowTableNodeSelection:r=!1}={}){return new a.k_({key:k,state:{init:()=>null,apply(r,n){let i=r.getMeta(k);if(null!=i)return -1==i?null:i;if(null==n||!r.docChanged)return n;let{deleted:s,pos:o}=r.mapping.mapResult(n);return s?null:o}},props:{decorations:R,handleDOMEvents:{mousedown:eM},createSelectionBetween:r=>null!=k.getState(r.state)?r.state.selection:null,handleTripleClick:eE,handleKeyDown:ex,handlePaste:eS},appendTransaction:(n,i,s)=>z(s,B(s,i),r)})}function eZ(r){return"left"===r||"right"===r||"center"===r?r:null}function eX(r){let n=(r.style.textAlign||"").trim().toLowerCase(),i=(r.getAttribute("align")||"").trim().toLowerCase();return eZ(n||i)}function eY(r){return eZ(null==r?void 0:r.align)}function eQ(){return{default:null,parseHTML:r=>eX(r),renderHTML:r=>r.align?{style:`text-align: ${r.align}`}:{}}}var e0=l.bP.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:r=>{var n,i;let s=r.getAttribute("colwidth"),o=s?s.split(",").map(r=>parseInt(r,10)):null;if(!o){let s=null==(n=r.closest("table"))?void 0:n.querySelectorAll("colgroup > col"),o=Array.from((null==(i=r.parentElement)?void 0:i.children)||[]).indexOf(r);if(o&&o>-1&&s&&s[o]){let r=s[o].getAttribute("width");return r?[parseInt(r,10)]:null}}return o}},align:eQ()}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML({HTMLAttributes:r}){return["td",(0,l.KV)(this.options.HTMLAttributes,r),0]}}),e1=l.bP.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:r=>{let n=r.getAttribute("colwidth");return n?n.split(",").map(r=>parseInt(r,10)):null}},align:eQ()}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:r}){return["th",(0,l.KV)(this.options.HTMLAttributes,r),0]}}),e2=l.bP.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:r}){return["tr",(0,l.KV)(this.options.HTMLAttributes,r),0]}});function e3(r,n){return n?["width",`${Math.max(n,r)}px`]:["min-width",`${r}px`]}function e5(r,n,i,s,o,l){var a;let u=0,c=!0,h=n.firstChild,d=r.firstChild;if(null!==d)for(let r=0,i=0;r<d.childCount;r+=1){let{colspan:a,colwidth:p}=d.child(r).attrs;for(let r=0;r<a;r+=1,i+=1){let a=o===i?l:p&&p[r],d=a?`${a}px`:"";if(u+=a||s,a||(c=!1),h){if(h.style.width!==d){let[r,n]=e3(s,a);h.style.setProperty(r,n)}h=h.nextSibling}else{let r=document.createElement("col"),[i,o]=e3(s,a);r.style.setProperty(i,o),n.appendChild(r)}}}for(;h;){let r=h.nextSibling;null==(a=h.parentNode)||a.removeChild(h),h=r}let p=r.attrs.style&&"string"==typeof r.attrs.style&&/\bwidth\s*:/i.test(r.attrs.style);c&&!p?(i.style.width=`${u}px`,i.style.minWidth=""):(i.style.width="",i.style.minWidth=`${u}px`)}var e4=class{constructor(r,n){this.node=r,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),r.attrs.style&&(this.table.style.cssText=r.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),e5(r,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(r){return r.type===this.node.type&&(this.node=r,e5(r,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(r){let n=r.target,i=this.dom.contains(n),s=this.contentDOM.contains(n);return!!i&&!s&&("attributes"===r.type||"childList"===r.type||"characterData"===r.type)}};function e6(r,n,i,s){let o=0,l=!0,a=[],u=r.firstChild;if(!u)return{};for(let r=0,c=0;r<u.childCount;r+=1){let{colspan:h,colwidth:d}=u.child(r).attrs;for(let r=0;r<h;r+=1,c+=1){let u=i===c?s:d&&d[r];o+=u||n,u||(l=!1);let[h,p]=e3(n,u);a.push(["col",{style:`${h}: ${p}`}])}}return{colgroup:["colgroup",{},...a],tableWidth:l?`${o}px`:"",tableMinWidth:l?"":`${o}px`}}function e8(r,n){return n?r.createChecked(null,n):r.createAndFill()}function e9(r){if(r.cached.tableNodeTypes)return r.cached.tableNodeTypes;let n={};return Object.keys(r.nodes).forEach(i=>{let s=r.nodes[i];s.spec.tableRole&&(n[s.spec.tableRole]=s)}),r.cached.tableNodeTypes=n,n}function e7(r,n,i,s,o){let l=e9(r),a=[],u=[];for(let r=0;r<i;r+=1){let r=e8(l.cell,o);if(r&&u.push(r),s){let r=e8(l.header_cell,o);r&&a.push(r)}}let c=[];for(let r=0;r<n;r+=1)c.push(l.row.createChecked(null,s&&0===r?a:u));return l.table.createChecked(null,c)}function te(r){return r instanceof I}var tt=({editor:r})=>{let{selection:n}=r.state;if(!te(n))return!1;let i=0,s=(0,l.eL)(n.ranges[0].$from,r=>"table"===r.type.name);return null==s||s.node.descendants(r=>{if("table"===r.type.name)return!1;["tableCell","tableHeader"].includes(r.type.name)&&(i+=1)}),i===n.ranges.length&&(r.commands.deleteTable(),!0)},tr="\x1f";function tn(r){return(r||"").replace(/\s+/g," ").trim()}var ti=function(r,n,i={}){var s;let o=null!=(s=i.cellLineSeparator)?s:tr;if(!r||!r.content||0===r.content.length)return"";let l=[];r.content.forEach(r=>{let i=[];r.content&&r.content.forEach(r=>{let s="",l=tn(s=r.content&&Array.isArray(r.content)&&r.content.length>1?r.content.map(r=>n.renderChildren(r)).join(o):r.content?n.renderChildren(r.content):""),a="tableHeader"===r.type,u=eY(r.attrs);i.push({text:l,isHeader:a,align:u})}),l.push(i)});let a=l.reduce((r,n)=>Math.max(r,n.length),0);if(0===a)return"";let u=Array(a).fill(0);l.forEach(r=>{var n;for(let i=0;i<a;i+=1){let s=((null==(n=r[i])?void 0:n.text)||"").length;s>u[i]&&(u[i]=s),u[i]<3&&(u[i]=3)}});let c=(r,n)=>r+" ".repeat(Math.max(0,n-r.length)),h=l[0],d=h.some(r=>r.isHeader),p=Array(a).fill(null);l.forEach(r=>{var n;for(let i=0;i<a;i+=1)!p[i]&&(null==(n=r[i])?void 0:n.align)&&(p[i]=r[i].align)});let f="\n",m=Array(a).fill(0).map((r,n)=>d&&h[n]&&h[n].text||"");return f+=`| ${m.map((r,n)=>c(r,u[n])).join(" | ")} |
2
2
  | ${u.map((r,n)=>{let i=Math.max(3,r),s=p[n];return"left"===s?`:${"-".repeat(i)}`:"right"===s?`${"-".repeat(i)}:`:"center"===s?`:${"-".repeat(i)}:`:"-".repeat(i)}).join(" | ")} |
3
3
  `,(d?l.slice(1):l).forEach(r=>{f+=`| ${Array(a).fill(0).map((n,i)=>c(r[i]&&r[i].text||"",u[i])).join(" | ")} |
4
4
  `}),f},ts=l.bP.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:e4,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML({node:r,HTMLAttributes:n}){let{colgroup:i,tableWidth:s,tableMinWidth:o}=e6(r,this.options.cellMinWidth),a=n.style;function u(){return a||(s?`width: ${s}`:`min-width: ${o}`)}let c=["table",(0,l.KV)(this.options.HTMLAttributes,n,{style:u()}),i,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},c]:c},parseMarkdown:(r,n)=>{let i=[],s=Array.isArray(r.align)?r.align:[];if(r.header){let o=[];r.header.forEach((r,i)=>{var l;let a=eZ(null!=(l=s[i])?l:r.align),u=a?{align:a}:{};o.push(n.createNode("tableHeader",u,[{type:"paragraph",content:n.parseInline(r.tokens)}]))}),i.push(n.createNode("tableRow",{},o))}return r.rows&&r.rows.forEach(r=>{let o=[];r.forEach((r,i)=>{var l;let a=eZ(null!=(l=s[i])?l:r.align),u=a?{align:a}:{};o.push(n.createNode("tableCell",u,[{type:"paragraph",content:n.parseInline(r.tokens)}]))}),i.push(n.createNode("tableRow",{},o))}),n.createNode("table",void 0,i)},renderMarkdown:(r,n)=>ti(r,n),addCommands:()=>({insertTable:({rows:r=3,cols:n=3,withHeaderRow:i=!0}={})=>({tr:s,dispatch:o,editor:l})=>{let u=e7(l.schema,r,n,i);if(o){let r=s.selection.from+1;s.replaceSelectionWith(u).scrollIntoView().setSelection(a.U3.near(s.doc.resolve(r)))}return!0},addColumnBefore:()=>({state:r,dispatch:n})=>V(r,n),addColumnAfter:()=>({state:r,dispatch:n})=>U(r,n),deleteColumn:()=>({state:r,dispatch:n})=>J(r,n),addRowBefore:()=>({state:r,dispatch:n})=>Z(r,n),addRowAfter:()=>({state:r,dispatch:n})=>X(r,n),deleteRow:()=>({state:r,dispatch:n})=>Q(r,n),deleteTable:()=>({state:r,dispatch:n})=>ed(r,n),mergeCells:()=>({state:r,dispatch:n})=>er(r,n),splitCell:()=>({state:r,dispatch:n})=>en(r,n),toggleHeaderColumn:()=>({state:r,dispatch:n})=>ea("column")(r,n),toggleHeaderRow:()=>({state:r,dispatch:n})=>ea("row")(r,n),toggleHeaderCell:()=>({state:r,dispatch:n})=>eu(r,n),mergeOrSplit:()=>({state:r,dispatch:n})=>!!er(r,n)||en(r,n),setCellAttribute:(r,n)=>({state:i,dispatch:s})=>es(r,n)(i,s),goToNextCell:()=>({state:r,dispatch:n})=>eh(1)(r,n),goToPreviousCell:()=>({state:r,dispatch:n})=>eh(-1)(r,n),fixTables:()=>({state:r,dispatch:n})=>(n&&B(r),!0),setCellSelection:r=>({tr:n,dispatch:i})=>{if(i){let i=I.create(n.doc,r.anchorCell,r.headCell);n.setSelection(i)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:tt,"Mod-Backspace":tt,Delete:tt,"Mod-Delete":tt}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[eN({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],eG({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(r){let n={name:r.name,options:r.options,storage:r.storage};return{tableRole:(0,l.gk)((0,l.iI)(r,"tableRole",n))}}});l.YY.create({name:"tableKit",addExtensions(){let r=[];return!1!==this.options.table&&r.push(ts.configure(this.options.table)),!1!==this.options.tableCell&&r.push(e0.configure(this.options.tableCell)),!1!==this.options.tableHeader&&r.push(e1.configure(this.options.tableHeader)),!1!==this.options.tableRow&&r.push(e2.configure(this.options.tableRow)),r}})},6268:(r,n,i)=>{"use strict";i.d(n,{A:()=>s.A0});var s=i(5989)},8242:(r,n,i)=>{"use strict";i.d(n,{$L:()=>ee,Ln:()=>E,N0:()=>Z,Um:()=>Q,Wg:()=>S,X9:()=>_,Ys:()=>v,dL:()=>ey,jP:()=>L,n9:()=>J,oM:()=>N,zy:()=>U});var s=i(27050);let o=65535,l=65536;function a(r,n){return r+n*l}function u(r){return r&o}function c(r){return(r-(r&o))/l}let h=1,d=2,p=4,f=8;class m{constructor(r,n,i){this.pos=r,this.delInfo=n,this.recover=i}get deleted(){return(this.delInfo&f)>0}get deletedBefore(){return(this.delInfo&(h|p))>0}get deletedAfter(){return(this.delInfo&(d|p))>0}get deletedAcross(){return(this.delInfo&p)>0}}class g{constructor(r,n=!1){if(this.ranges=r,this.inverted=n,!r.length&&g.empty)return g.empty}recover(r){let n=0,i=u(r);if(!this.inverted)for(let r=0;r<i;r++)n+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*i]+n+c(r)}mapResult(r,n=1){return this._map(r,n,!1)}map(r,n=1){return this._map(r,n,!0)}_map(r,n,i){let s=0,o=this.inverted?2:1,l=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?s:0);if(c>r)break;let g=this.ranges[u+o],_=this.ranges[u+l],y=c+g;if(r<=y){let o=g?r==c?-1:r==y?1:n:n,l=c+s+(o<0?0:_);if(i)return l;let k=r==(n<0?c:y)?null:a(u/3,r-c),b=r==c?d:r==y?h:p;return(n<0?r!=c:r!=y)&&(b|=f),new m(l,b,k)}s+=_-g}return i?r+s:new m(r+s,0,null)}touches(r,n){let i=0,s=u(n),o=this.inverted?2:1,l=this.inverted?1:2;for(let n=0;n<this.ranges.length;n+=3){let a=this.ranges[n]-(this.inverted?i:0);if(a>r)break;let u=this.ranges[n+o];if(r<=a+u&&n==3*s)return!0;i+=this.ranges[n+l]-u}return!1}forEach(r){let n=this.inverted?2:1,i=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let l=this.ranges[s],a=l-(this.inverted?o:0),u=l+(this.inverted?0:o),c=this.ranges[s+n],h=this.ranges[s+i];r(a,a+c,u,u+h),o+=h-c}}invert(){return new g(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(r){return 0==r?g.empty:new g(r<0?[0,-r,0]:[0,0,r])}}g.empty=new g([]);class _{constructor(r,n,i=0,s=r?r.length:0){this.mirror=n,this.from=i,this.to=s,this._maps=r||[],this.ownData=!(r||n)}get maps(){return this._maps}slice(r=0,n=this.maps.length){return new _(this._maps,this.mirror,r,n)}appendMap(r,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(r),null!=n&&this.setMirror(this._maps.length-1,n)}appendMapping(r){for(let n=0,i=this._maps.length;n<r._maps.length;n++){let s=r.getMirror(n);this.appendMap(r._maps[n],null!=s&&s<n?i+s:void 0)}}getMirror(r){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==r)return this.mirror[n+(n%2?-1:1)]}}setMirror(r,n){this.mirror||(this.mirror=[]),this.mirror.push(r,n)}appendMappingInverted(r){for(let n=r.maps.length-1,i=this._maps.length+r._maps.length;n>=0;n--){let s=r.getMirror(n);this.appendMap(r._maps[n].invert(),null!=s&&s>n?i-s-1:void 0)}}invert(){let r=new _;return r.appendMappingInverted(this),r}map(r,n=1){if(this.mirror)return this._map(r,n,!0);for(let i=this.from;i<this.to;i++)r=this._maps[i].map(r,n);return r}mapResult(r,n=1){return this._map(r,n,!1)}_map(r,n,i){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i].mapResult(r,n);if(null!=o.recover){let n=this.getMirror(i);if(null!=n&&n>i&&n<this.to){i=n,r=this._maps[n].recover(o.recover);continue}}s|=o.delInfo,r=o.pos}return i?r:new m(r,s,null)}}let y=Object.create(null);class k{getMap(){return g.empty}merge(r){return null}static fromJSON(r,n){if(!n||!n.stepType)throw RangeError("Invalid input for Step.fromJSON");let i=y[n.stepType];if(!i)throw RangeError(`No step type ${n.stepType} defined`);return i.fromJSON(r,n)}static jsonID(r,n){if(r in y)throw RangeError("Duplicate use of step JSON ID "+r);return y[r]=n,n.prototype.jsonID=r,n}}class b{constructor(r,n){this.doc=r,this.failed=n}static ok(r){return new b(r,null)}static fail(r){return new b(null,r)}static fromReplace(r,n,i,o){try{return b.ok(r.replace(n,i,o))}catch(r){if(r instanceof s.vI)return b.fail(r.message);throw r}}}function w(r,n,i){let o=[];for(let s=0;s<r.childCount;s++){let l=r.child(s);l.content.size&&(l=l.copy(w(l.content,n,l))),l.isInline&&(l=n(l,i,s)),o.push(l)}return s.FK.fromArray(o)}class x extends k{constructor(r,n,i){super(),this.from=r,this.to=n,this.mark=i}apply(r){let n=r.slice(this.from,this.to),i=r.resolve(this.from),o=i.node(i.sharedDepth(this.to)),l=new s.Ji(w(n.content,(r,n)=>r.isAtom&&n.type.allowsMarkType(this.mark.type)?r.mark(this.mark.addToSet(r.marks)):r,o),n.openStart,n.openEnd);return b.fromReplace(r,this.from,this.to,l)}invert(){return new v(this.from,this.to,this.mark)}map(r){let n=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new x(n.pos,i.pos,this.mark)}merge(r){return r instanceof x&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from?new x(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(r,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new x(n.from,n.to,r.markFromJSON(n.mark))}}k.jsonID("addMark",x);class v extends k{constructor(r,n,i){super(),this.from=r,this.to=n,this.mark=i}apply(r){let n=r.slice(this.from,this.to),i=new s.Ji(w(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),r),n.openStart,n.openEnd);return b.fromReplace(r,this.from,this.to,i)}invert(){return new x(this.from,this.to,this.mark)}map(r){let n=r.mapResult(this.from,1),i=r.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new v(n.pos,i.pos,this.mark)}merge(r){return r instanceof v&&r.mark.eq(this.mark)&&this.from<=r.to&&this.to>=r.from?new v(Math.min(this.from,r.from),Math.max(this.to,r.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(r,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new v(n.from,n.to,r.markFromJSON(n.mark))}}k.jsonID("removeMark",v);class C extends k{constructor(r,n){super(),this.pos=r,this.mark=n}apply(r){let n=r.nodeAt(this.pos);if(!n)return b.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return b.fromReplace(r,this.pos,this.pos+1,new s.Ji(s.FK.from(i),0,+!n.isLeaf))}invert(r){let n=r.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new C(this.pos,n.marks[i]);return new C(this.pos,this.mark)}}return new A(this.pos,this.mark)}map(r){let n=r.mapResult(this.pos,1);return n.deletedAfter?null:new C(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(r,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new C(n.pos,r.markFromJSON(n.mark))}}k.jsonID("addNodeMark",C);class A extends k{constructor(r,n){super(),this.pos=r,this.mark=n}apply(r){let n=r.nodeAt(this.pos);if(!n)return b.fail("No node at mark step's position");let i=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return b.fromReplace(r,this.pos,this.pos+1,new s.Ji(s.FK.from(i),0,+!n.isLeaf))}invert(r){let n=r.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new C(this.pos,this.mark):this}map(r){let n=r.mapResult(this.pos,1);return n.deletedAfter?null:new A(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(r,n){if("number"!=typeof n.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new A(n.pos,r.markFromJSON(n.mark))}}k.jsonID("removeNodeMark",A);class E extends k{constructor(r,n,i,s=!1){super(),this.from=r,this.to=n,this.slice=i,this.structure=s}apply(r){return this.structure&&M(r,this.from,this.to)?b.fail("Structure replace would overwrite content"):b.fromReplace(r,this.from,this.to,this.slice)}getMap(){return new g([this.from,this.to-this.from,this.slice.size])}invert(r){return new E(this.from,this.from+this.slice.size,r.slice(this.from,this.to))}map(r){let n=r.mapResult(this.to,-1),i=this.from==this.to&&E.MAP_BIAS<0?n:r.mapResult(this.from,1);return i.deletedAcross&&n.deletedAcross?null:new E(i.pos,Math.max(i.pos,n.pos),this.slice,this.structure)}merge(r){if(!(r instanceof E)||r.structure||this.structure)return null;if(this.from+this.slice.size!=r.from||this.slice.openEnd||r.slice.openStart)if(r.to!=this.from||this.slice.openStart||r.slice.openEnd)return null;else{let n=this.slice.size+r.slice.size==0?s.Ji.empty:new s.Ji(r.slice.content.append(this.slice.content),r.slice.openStart,this.slice.openEnd);return new E(r.from,this.to,n,this.structure)}{let n=this.slice.size+r.slice.size==0?s.Ji.empty:new s.Ji(this.slice.content.append(r.slice.content),this.slice.openStart,r.slice.openEnd);return new E(this.from,this.to+(r.to-r.from),n,this.structure)}}toJSON(){let r={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r}static fromJSON(r,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new E(n.from,n.to,s.Ji.fromJSON(r,n.slice),!!n.structure)}}E.MAP_BIAS=1,k.jsonID("replace",E);class S extends k{constructor(r,n,i,s,o,l,a=!1){super(),this.from=r,this.to=n,this.gapFrom=i,this.gapTo=s,this.slice=o,this.insert=l,this.structure=a}apply(r){if(this.structure&&(M(r,this.from,this.gapFrom)||M(r,this.gapTo,this.to)))return b.fail("Structure gap-replace would overwrite content");let n=r.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return b.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,n.content);return i?b.fromReplace(r,this.from,this.to,i):b.fail("Content does not fit in gap")}getMap(){return new g([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(r){let n=this.gapTo-this.gapFrom;return new S(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,r.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(r){let n=r.mapResult(this.from,1),i=r.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:r.map(this.gapFrom,-1),o=this.to==this.gapTo?i.pos:r.map(this.gapTo,1);return n.deletedAcross&&i.deletedAcross||s<n.pos||o>i.pos?null:new S(n.pos,i.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let r={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(r.slice=this.slice.toJSON()),this.structure&&(r.structure=!0),r}static fromJSON(r,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new S(n.from,n.to,n.gapFrom,n.gapTo,s.Ji.fromJSON(r,n.slice),n.insert,!!n.structure)}}function M(r,n,i){let s=r.resolve(n),o=i-n,l=s.depth;for(;o>0&&l>0&&s.indexAfter(l)==s.node(l).childCount;)l--,o--;if(o>0){let r=s.node(l).maybeChild(s.indexAfter(l));for(;o>0;){if(!r||r.isLeaf)return!0;r=r.firstChild,o--}}return!1}function T(r,n,i,s){let o,l,a=[],u=[];r.doc.nodesBetween(n,i,(r,c,h)=>{if(!r.isInline)return;let d=r.marks;if(!s.isInSet(d)&&h.type.allowsMarkType(s.type)){let h=Math.max(c,n),p=Math.min(c+r.nodeSize,i),f=s.addToSet(d);for(let r=0;r<d.length;r++)d[r].isInSet(f)||(o&&o.to==h&&o.mark.eq(d[r])?o.to=p:a.push(o=new v(h,p,d[r])));l&&l.to==h?l.to=p:u.push(l=new x(h,p,s))}}),a.forEach(n=>r.step(n)),u.forEach(n=>r.step(n))}function D(r,n,i,o){let l=[],a=0;r.doc.nodesBetween(n,i,(r,u)=>{if(!r.isInline)return;a++;let c=null;if(o instanceof s.sX){let n=r.marks,i;for(;i=o.isInSet(n);)(c||(c=[])).push(i),n=i.removeFromSet(n)}else o?o.isInSet(r.marks)&&(c=[o]):c=r.marks;if(c&&c.length){let s=Math.min(u+r.nodeSize,i);for(let r=0;r<c.length;r++){let i=c[r],o;for(let r=0;r<l.length;r++){let n=l[r];n.step==a-1&&i.eq(l[r].style)&&(o=n)}o?(o.to=s,o.step=a):l.push({style:i,from:Math.max(u,n),to:s,step:a})}}}),l.forEach(n=>r.step(new v(n.from,n.to,n.style)))}function F(r,n,i,o=i.contentMatch,l=!0){let a=r.doc.nodeAt(n),u=[],c=n+1;for(let n=0;n<a.childCount;n++){let h=a.child(n),d=c+h.nodeSize,p=o.matchType(h.type);if(p){o=p;for(let n=0;n<h.marks.length;n++)i.allowsMarkType(h.marks[n].type)||r.step(new v(c,d,h.marks[n]));if(l&&h.isText&&"pre"!=i.whitespace){let r,n=/\r?\n|\r/g,o;for(;r=n.exec(h.text);)o||(o=new s.Ji(s.FK.from(i.schema.text(" ",i.allowedMarks(h.marks))),0,0)),u.push(new E(c+r.index,c+r.index+r[0].length,o))}}else u.push(new E(c,d,s.Ji.empty));c=d}if(!o.validEnd){let n=o.fillBefore(s.FK.empty,!0);r.replace(c,c,new s.Ji(n,0,0))}for(let n=u.length-1;n>=0;n--)r.step(u[n])}function I(r,n,i){return(0==n||r.canReplace(n,r.childCount))&&(i==r.childCount||r.canReplace(0,i))}function L(r){let n=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let i=r.depth,s=0,o=0;;--i){let l=r.$from.node(i),a=r.$from.index(i)+s,u=r.$to.indexAfter(i)-o;if(i<r.depth&&l.canReplace(a,u,n))return i;if(0==i||l.type.spec.isolating||!I(l,a,u))break;a&&(s=1),u<l.childCount&&(o=1)}return null}function R(r,n,i){let{$from:o,$to:l,depth:a}=n,u=o.before(a+1),c=l.after(a+1),h=u,d=c,p=s.FK.empty,f=0;for(let r=a,n=!1;r>i;r--)n||o.index(r)>0?(n=!0,p=s.FK.from(o.node(r).copy(p)),f++):h--;let m=s.FK.empty,g=0;for(let r=a,n=!1;r>i;r--)n||l.after(r+1)<l.end(r)?(n=!0,m=s.FK.from(l.node(r).copy(m)),g++):d++;r.step(new S(h,d,u,c,new s.Ji(p.append(m),f,g),p.size-f,!0))}function N(r,n,i=null,s=r){let o=z(r,n),l=o&&P(s,n);return l?o.map(O).concat({type:n,attrs:i}).concat(l.map(O)):null}function O(r){return{type:r,attrs:null}}function z(r,n){let{parent:i,startIndex:s,endIndex:o}=r,l=i.contentMatchAt(s).findWrapping(n);if(!l)return null;let a=l.length?l[0]:n;return i.canReplaceWith(s,o,a)?l:null}function P(r,n){let{parent:i,startIndex:s,endIndex:o}=r,l=i.child(s),a=n.contentMatch.findWrapping(l.type);if(!a)return null;let u=(a.length?a[a.length-1]:n).contentMatch;for(let r=s;u&&r<o;r++)u=u.matchType(i.child(r).type);return u&&u.validEnd?a:null}function $(r,n,i){let o=s.FK.empty;for(let r=i.length-1;r>=0;r--){if(o.size){let n=i[r].type.contentMatch.matchFragment(o);if(!n||!n.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=s.FK.from(i[r].type.create(i[r].attrs,o))}let l=n.start,a=n.end;r.step(new S(l,a,l,a,new s.Ji(o,0,0),i.length,!0))}function B(r,n,i,o,l){if(!o.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let a=r.steps.length;r.doc.nodesBetween(n,i,(n,i)=>{let u="function"==typeof l?l(n):l;if(n.isTextblock&&!n.hasMarkup(o,u)&&H(r.doc,r.mapping.slice(a).map(i),o)){let l=null;if(o.schema.linebreakReplacement){let r="pre"==o.whitespace,n=!!o.contentMatch.matchType(o.schema.linebreakReplacement);r&&!n?l=!1:!r&&n&&(l=!0)}!1===l&&j(r,n,i,a),F(r,r.mapping.slice(a).map(i,1),o,void 0,null===l);let c=r.mapping.slice(a),h=c.map(i,1),d=c.map(i+n.nodeSize,1);return r.step(new S(h,d,h+1,d-1,new s.Ji(s.FK.from(o.create(u,null,n.marks)),0,0),1,!0)),!0===l&&q(r,n,i,a),!1}})}function q(r,n,i,s){n.forEach((o,l)=>{if(o.isText){let a,u=/\r?\n|\r/g;for(;a=u.exec(o.text);){let o=r.mapping.slice(s).map(i+1+l+a.index);r.replaceWith(o,o+1,n.type.schema.linebreakReplacement.create())}}})}function j(r,n,i,s){n.forEach((o,l)=>{if(o.type==o.type.schema.linebreakReplacement){let o=r.mapping.slice(s).map(i+1+l);r.replaceWith(o,o+1,n.type.schema.text("\n"))}})}function H(r,n,i){let s=r.resolve(n),o=s.index();return s.parent.canReplaceWith(o,o+1,i)}function V(r,n,i,o,l){let a=r.doc.nodeAt(n);if(!a)throw RangeError("No node at given position");i||(i=a.type);let u=i.create(o,null,l||a.marks);if(a.isLeaf)return r.replaceWith(n,n+a.nodeSize,u);if(!i.validContent(a.content))throw RangeError("Invalid content for node type "+i.name);r.step(new S(n,n+a.nodeSize,n+1,n+a.nodeSize-1,new s.Ji(s.FK.from(u),0,0),1,!0))}function U(r,n,i=1,s){let o=r.resolve(n),l=o.depth-i,a=s&&s[s.length-1]||o.parent;if(l<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let r=o.depth-1,n=i-2;r>l;r--,n--){let i=o.node(r),l=o.index(r);if(i.type.spec.isolating)return!1;let a=i.content.cutByIndex(l,i.childCount),u=s&&s[n+1];u&&(a=a.replaceChild(0,u.type.create(u.attrs)));let c=s&&s[n]||i;if(!i.canReplace(l+1,i.childCount)||!c.type.validContent(a))return!1}let u=o.indexAfter(l),c=s&&s[0];return o.node(l).canReplaceWith(u,u,c?c.type:o.node(l+1).type)}function W(r,n,i=1,o){let l=r.doc.resolve(n),a=s.FK.empty,u=s.FK.empty;for(let r=l.depth,n=l.depth-i,c=i-1;r>n;r--,c--){a=s.FK.from(l.node(r).copy(a));let n=o&&o[c];u=s.FK.from(n?n.type.create(n.attrs,u):l.node(r).copy(u))}r.step(new E(n,n,new s.Ji(a.append(u),i,i),!0))}function J(r,n){let i=r.resolve(n),s=i.index();return G(i.nodeBefore,i.nodeAfter)&&i.parent.canReplace(s,s+1)}function K(r,n){n.content.size||r.type.compatibleContent(n.type);let i=r.contentMatchAt(r.childCount),{linebreakReplacement:s}=r.type.schema;for(let o=0;o<n.childCount;o++){let l=n.child(o),a=l.type==s?r.type.schema.nodes.text:l.type;if(!(i=i.matchType(a))||!r.type.allowsMarks(l.marks))return!1}return i.validEnd}function G(r,n){return!!(r&&n&&!r.isLeaf&&K(r,n))}function Z(r,n,i=-1){let s=r.resolve(n);for(let r=s.depth;;r--){let o,l,a=s.index(r);if(r==s.depth?(o=s.nodeBefore,l=s.nodeAfter):i>0?(o=s.node(r+1),a++,l=s.node(r).maybeChild(a)):(o=s.node(r).maybeChild(a-1),l=s.node(r+1)),o&&!o.isTextblock&&G(o,l)&&s.node(r).canReplace(a,a+1))return n;if(0==r)break;n=i<0?s.before(r):s.after(r)}}function X(r,n,i){let o=null,{linebreakReplacement:l}=r.doc.type.schema,a=r.doc.resolve(n-i),u=a.node().type;if(l&&u.inlineContent){let r="pre"==u.whitespace,n=!!u.contentMatch.matchType(l);r&&!n?o=!1:!r&&n&&(o=!0)}let c=r.steps.length;if(!1===o){let s=r.doc.resolve(n+i);j(r,s.node(),s.before(),c)}u.inlineContent&&F(r,n+i-1,u,a.node().contentMatchAt(a.index()),null==o);let h=r.mapping.slice(c),d=h.map(n-i);if(r.step(new E(d,h.map(n+i,-1),s.Ji.empty,!0)),!0===o){let n=r.doc.resolve(d);q(r,n.node(),n.before(),r.steps.length)}return r}function Y(r,n,i){let s=r.resolve(n);if(s.parent.canReplaceWith(s.index(),s.index(),i))return n;if(0==s.parentOffset)for(let r=s.depth-1;r>=0;r--){let n=s.index(r);if(s.node(r).canReplaceWith(n,n,i))return s.before(r+1);if(n>0)return null}if(s.parentOffset==s.parent.content.size)for(let r=s.depth-1;r>=0;r--){let n=s.indexAfter(r);if(s.node(r).canReplaceWith(n,n,i))return s.after(r+1);if(n<s.node(r).childCount)break}return null}function Q(r,n,i){let s=r.resolve(n);if(!i.content.size)return n;let o=i.content;for(let r=0;r<i.openStart;r++)o=o.firstChild.content;for(let r=1;r<=(0==i.openStart&&i.size?2:1);r++)for(let n=s.depth;n>=0;n--){let i=n==s.depth?0:s.pos<=(s.start(n+1)+s.end(n+1))/2?-1:1,l=s.index(n)+ +(i>0),a=s.node(n),u=!1;if(1==r)u=a.canReplace(l,l,o);else{let r=a.contentMatchAt(l).findWrapping(o.firstChild.type);u=r&&a.canReplaceWith(l,l,r[0])}if(u)return 0==i?s.pos:i<0?s.before(n+1):s.after(n+1)}return null}function ee(r,n,i=n,o=s.Ji.empty){if(n==i&&!o.size)return null;let l=r.resolve(n),a=r.resolve(i);return et(l,a,o)?new E(n,i,o):new er(l,a,o).fit()}function et(r,n,i){return!i.openStart&&!i.openEnd&&r.start()==n.start()&&r.parent.canReplace(r.index(),n.index(),i.content)}k.jsonID("replaceAround",S);class er{constructor(r,n,i){this.$from=r,this.$to=n,this.unplaced=i,this.frontier=[],this.placed=s.FK.empty;for(let n=0;n<=r.depth;n++){let i=r.node(n);this.frontier.push({type:i.type,match:i.contentMatchAt(r.indexAfter(n))})}for(let n=r.depth;n>0;n--)this.placed=s.FK.from(r.node(n).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let r=this.findFittable();r?this.placeNodes(r):this.openMore()||this.dropNode()}let r=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(r<0?this.$to:i.doc.resolve(r));if(!o)return null;let l=this.placed,a=i.depth,u=o.depth;for(;a&&u&&1==l.childCount;)l=l.firstChild.content,a--,u--;let c=new s.Ji(l,a,u);return r>-1?new S(i.pos,r,this.$to.pos,this.$to.end(),c,n):c.size||i.pos!=this.$to.pos?new E(i.pos,o.pos,c):null}findFittable(){let r=this.unplaced.openStart;for(let n=this.unplaced.content,i=0,s=this.unplaced.openEnd;i<r;i++){let o=n.firstChild;if(n.childCount>1&&(s=0),o.type.spec.isolating&&s<=i){r=i;break}n=o.content}for(let n=1;n<=2;n++)for(let i=1==n?r:this.unplaced.openStart;i>=0;i--){let r,o=null,l=(r=i?(o=es(this.unplaced.content,i-1).firstChild).content:this.unplaced.content).firstChild;for(let r=this.depth;r>=0;r--){let{type:a,match:u}=this.frontier[r],c,h=null;if(1==n&&(l?u.matchType(l.type)||(h=u.fillBefore(s.FK.from(l),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:i,frontierDepth:r,parent:o,inject:h};if(2==n&&l&&(c=u.findWrapping(l.type)))return{sliceDepth:i,frontierDepth:r,parent:o,wrap:c};if(o&&u.matchType(o.type))break}}}openMore(){let{content:r,openStart:n,openEnd:i}=this.unplaced,o=es(r,n);return!!o.childCount&&!o.firstChild.isLeaf&&(this.unplaced=new s.Ji(r,n+1,Math.max(i,o.size+n>=r.size-i?n+1:0)),!0)}dropNode(){let{content:r,openStart:n,openEnd:i}=this.unplaced,o=es(r,n);if(o.childCount<=1&&n>0){let l=r.size-n<=n+o.size;this.unplaced=new s.Ji(en(r,n-1,1),n-1,l?n-1:i)}else this.unplaced=new s.Ji(en(r,n,1),n,i)}placeNodes({sliceDepth:r,frontierDepth:n,parent:i,inject:o,wrap:l}){for(;this.depth>n;)this.closeFrontierNode();if(l)for(let r=0;r<l.length;r++)this.openFrontierNode(l[r]);let a=this.unplaced,u=i?i.content:a.content,c=a.openStart-r,h=0,d=[],{match:p,type:f}=this.frontier[n];if(o){for(let r=0;r<o.childCount;r++)d.push(o.child(r));p=p.matchFragment(o)}let m=u.size+r-(a.content.size-a.openEnd);for(;h<u.childCount;){let r=u.child(h),n=p.matchType(r.type);if(!n)break;(++h>1||0==c||r.content.size)&&(p=n,d.push(eo(r.mark(f.allowedMarks(r.marks)),1==h?c:0,h==u.childCount?m:-1)))}let g=h==u.childCount;g||(m=-1),this.placed=ei(this.placed,n,s.FK.from(d)),this.frontier[n].match=p,g&&m<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let r=0,n=u;r<m;r++){let r=n.lastChild;this.frontier.push({type:r.type,match:r.contentMatchAt(r.childCount)}),n=r.content}this.unplaced=g?0==r?s.Ji.empty:new s.Ji(en(a.content,r-1,1),r-1,m<0?a.openEnd:r-1):new s.Ji(en(a.content,r,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let r=this.frontier[this.depth],n;if(!r.type.isTextblock||!el(this.$to,this.$to.depth,r.type,r.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return -1;let{depth:i}=this.$to,s=this.$to.after(i);for(;i>1&&s==this.$to.end(--i);)++s;return s}findCloseLevel(r){t:for(let n=Math.min(this.depth,r.depth);n>=0;n--){let{match:i,type:s}=this.frontier[n],o=n<r.depth&&r.end(n+1)==r.pos+(r.depth-(n+1)),l=el(r,n,s,i,o);if(l){for(let i=n-1;i>=0;i--){let{match:n,type:s}=this.frontier[i],o=el(r,i,s,n,!0);if(!o||o.childCount)continue t}return{depth:n,fit:l,move:o?r.doc.resolve(r.after(n+1)):r}}}}close(r){let n=this.findCloseLevel(r);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ei(this.placed,n.depth,n.fit)),r=n.move;for(let i=n.depth+1;i<=r.depth;i++){let n=r.node(i),s=n.type.contentMatch.fillBefore(n.content,!0,r.index(i));this.openFrontierNode(n.type,n.attrs,s)}return r}openFrontierNode(r,n=null,i){let o=this.frontier[this.depth];o.match=o.match.matchType(r),this.placed=ei(this.placed,this.depth,s.FK.from(r.create(n,i))),this.frontier.push({type:r,match:r.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(s.FK.empty,!0);r.childCount&&(this.placed=ei(this.placed,this.frontier.length,r))}}function en(r,n,i){return 0==n?r.cutByIndex(i,r.childCount):r.replaceChild(0,r.firstChild.copy(en(r.firstChild.content,n-1,i)))}function ei(r,n,i){return 0==n?r.append(i):r.replaceChild(r.childCount-1,r.lastChild.copy(ei(r.lastChild.content,n-1,i)))}function es(r,n){for(let i=0;i<n;i++)r=r.firstChild.content;return r}function eo(r,n,i){if(n<=0)return r;let o=r.content;return n>1&&(o=o.replaceChild(0,eo(o.firstChild,n-1,1==o.childCount?i-1:0))),n>0&&(o=r.type.contentMatch.fillBefore(o).append(o),i<=0&&(o=o.append(r.type.contentMatch.matchFragment(o).fillBefore(s.FK.empty,!0)))),r.copy(o)}function el(r,n,i,s,o){let l=r.node(n),a=o?r.indexAfter(n):r.index(n);if(a==l.childCount&&!i.compatibleContent(l.type))return null;let u=s.fillBefore(l.content,!0,a);return u&&!ea(i,l.content,a)?u:null}function ea(r,n,i){for(let s=i;s<n.childCount;s++)if(!r.allowsMarks(n.child(s).marks))return!0;return!1}function eu(r){return r.spec.defining||r.spec.definingForContent}function ec(r,n,i,o){if(!o.size)return r.deleteRange(n,i);let l=r.doc.resolve(n),a=r.doc.resolve(i);if(et(l,a,o))return r.step(new E(n,i,o));let u=ef(l,a);0==u[u.length-1]&&u.pop();let c=-(l.depth+1);u.unshift(c);for(let r=l.depth,n=l.pos-1;r>0;r--,n--){let i=l.node(r).type.spec;if(i.defining||i.definingAsContext||i.isolating)break;u.indexOf(r)>-1?c=r:l.before(r)==n&&u.splice(1,0,-r)}let h=u.indexOf(c),d=[],p=o.openStart;for(let r=o.content,n=0;;n++){let i=r.firstChild;if(d.push(i),n==o.openStart)break;r=i.content}for(let r=p-1;r>=0;r--){let n=d[r],i=eu(n.type);if(i&&!n.sameMarkup(l.node(Math.abs(c)-1)))p=r;else if(i||!n.type.isTextblock)break}for(let n=o.openStart;n>=0;n--){let c=(n+p+1)%(o.openStart+1),f=d[c];if(f)for(let n=0;n<u.length;n++){let d=u[(n+h)%u.length],p=!0;d<0&&(p=!1,d=-d);let m=l.node(d-1),g=l.index(d-1);if(m.canReplaceWith(g,g,f.type,f.marks))return r.replace(l.before(d),p?a.after(d):i,new s.Ji(eh(o.content,0,o.openStart,c),c,o.openEnd))}}let f=r.steps.length;for(let s=u.length-1;s>=0&&(r.replace(n,i,o),!(r.steps.length>f));s--){let r=u[s];r<0||(n=l.before(r),i=a.after(r))}}function eh(r,n,i,o,l){if(n<i){let s=r.firstChild;r=r.replaceChild(0,s.copy(eh(s.content,n+1,i,o,s)))}if(n>o){let n=l.contentMatchAt(0),i=n.fillBefore(r).append(r);r=i.append(n.matchFragment(i).fillBefore(s.FK.empty,!0))}return r}function ed(r,n,i,o){if(!o.isInline&&n==i&&r.doc.resolve(n).parent.content.size){let s=Y(r.doc,n,o.type);null!=s&&(n=i=s)}r.replaceRange(n,i,new s.Ji(s.FK.from(o),0,0))}function ep(r,n,i){let s=r.doc.resolve(n),o=r.doc.resolve(i);if(s.parent.isTextblock&&o.parent.isTextblock&&s.start()!=o.start()&&0==s.parentOffset&&0==o.parentOffset){let l=s.sharedDepth(i),a=!1;for(let r=s.depth;r>l;r--)s.node(r).type.spec.isolating&&(a=!0);for(let r=o.depth;r>l;r--)o.node(r).type.spec.isolating&&(a=!0);if(!a){for(let r=s.depth;r>0&&n==s.start(r);r--)n=s.before(r);for(let r=o.depth;r>0&&i==o.start(r);r--)i=o.before(r);s=r.doc.resolve(n),o=r.doc.resolve(i)}}let l=ef(s,o);for(let n=0;n<l.length;n++){let i=l[n],a=n==l.length-1;if(a&&0==i||s.node(i).type.contentMatch.validEnd)return r.delete(s.start(i),o.end(i));if(i>0&&(a||s.node(i-1).canReplace(s.index(i-1),o.indexAfter(i-1))))return r.delete(s.before(i),o.after(i))}for(let l=1;l<=s.depth&&l<=o.depth;l++)if(n-s.start(l)==s.depth-l&&i>s.end(l)&&o.end(l)-i!=o.depth-l&&s.start(l-1)==o.start(l-1)&&s.node(l-1).canReplace(s.index(l-1),o.index(l-1)))return r.delete(s.before(l),i);r.delete(n,i)}function ef(r,n){let i=[],s=Math.min(r.depth,n.depth);for(let o=s;o>=0;o--){let s=r.start(o);if(s<r.pos-(r.depth-o)||n.end(o)>n.pos+(n.depth-o)||r.node(o).type.spec.isolating||n.node(o).type.spec.isolating)break;(s==n.start(o)||o==r.depth&&o==n.depth&&r.parent.inlineContent&&n.parent.inlineContent&&o&&n.start(o-1)==s-1)&&i.push(o)}return i}class em extends k{constructor(r,n,i){super(),this.pos=r,this.attr=n,this.value=i}apply(r){let n=r.nodeAt(this.pos);if(!n)return b.fail("No node at attribute step's position");let i=Object.create(null);for(let r in n.attrs)i[r]=n.attrs[r];i[this.attr]=this.value;let o=n.type.create(i,null,n.marks);return b.fromReplace(r,this.pos,this.pos+1,new s.Ji(s.FK.from(o),0,+!n.isLeaf))}getMap(){return g.empty}invert(r){return new em(this.pos,this.attr,r.nodeAt(this.pos).attrs[this.attr])}map(r){let n=r.mapResult(this.pos,1);return n.deletedAfter?null:new em(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(r,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new em(n.pos,n.attr,n.value)}}k.jsonID("attr",em);class eg extends k{constructor(r,n){super(),this.attr=r,this.value=n}apply(r){let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let i=r.type.create(n,r.content,r.marks);return b.ok(i)}getMap(){return g.empty}invert(r){return new eg(this.attr,r.attrs[this.attr])}map(r){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(r,n){if("string"!=typeof n.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new eg(n.attr,n.value)}}k.jsonID("docAttr",eg);let e_=class extends Error{};(e_=function r(n){let i=Error.call(this,n);return i.__proto__=r.prototype,i}).prototype=Object.create(Error.prototype),e_.prototype.constructor=e_,e_.prototype.name="TransformError";class ey{constructor(r){this.doc=r,this.steps=[],this.docs=[],this.mapping=new _}get before(){return this.docs.length?this.docs[0]:this.doc}step(r){let n=this.maybeStep(r);if(n.failed)throw new e_(n.failed);return this}maybeStep(r){let n=r.apply(this.doc);return n.failed||this.addStep(r,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let r=1e9,n=-1e9;for(let i=0;i<this.mapping.maps.length;i++){let s=this.mapping.maps[i];i&&(r=s.map(r,1),n=s.map(n,-1)),s.forEach((i,s,o,l)=>{r=Math.min(r,o),n=Math.max(n,l)})}return 1e9==r?null:{from:r,to:n}}addStep(r,n){this.docs.push(this.doc),this.steps.push(r),this.mapping.appendMap(r.getMap()),this.doc=n}replace(r,n=r,i=s.Ji.empty){let o=ee(this.doc,r,n,i);return o&&this.step(o),this}replaceWith(r,n,i){return this.replace(r,n,new s.Ji(s.FK.from(i),0,0))}delete(r,n){return this.replace(r,n,s.Ji.empty)}insert(r,n){return this.replaceWith(r,r,n)}replaceRange(r,n,i){return ec(this,r,n,i),this}replaceRangeWith(r,n,i){return ed(this,r,n,i),this}deleteRange(r,n){return ep(this,r,n),this}lift(r,n){return R(this,r,n),this}join(r,n=1){return X(this,r,n),this}wrap(r,n){return $(this,r,n),this}setBlockType(r,n=r,i,s=null){return B(this,r,n,i,s),this}setNodeMarkup(r,n,i=null,s){return V(this,r,n,i,s),this}setNodeAttribute(r,n,i){return this.step(new em(r,n,i)),this}setDocAttribute(r,n){return this.step(new eg(r,n)),this}addNodeMark(r,n){return this.step(new C(r,n)),this}removeNodeMark(r,n){let i=this.doc.nodeAt(r);if(!i)throw RangeError("No node at position "+r);if(n instanceof s.CU)n.isInSet(i.marks)&&this.step(new A(r,n));else{let s=i.marks,o,l=[];for(;o=n.isInSet(s);)l.push(new A(r,o)),s=o.removeFromSet(s);for(let r=l.length-1;r>=0;r--)this.step(l[r])}return this}split(r,n=1,i){return W(this,r,n,i),this}addMark(r,n,i){return T(this,r,n,i),this}removeMark(r,n,i){return D(this,r,n,i),this}clearIncompatible(r,n,i){return F(this,r,n,i),this}}},10762:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],l=(0,s.A)("terminal",o)},12894:(r,n,i)=>{"use strict";i.d(n,{K:()=>k,w:()=>y});for(var s={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:"'"},o={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},l="u">typeof navigator&&/Mac/.test(navigator.platform),a="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),u=0;u<10;u++)s[48+u]=s[96+u]=String(u);for(var u=1;u<=24;u++)s[u+111]="F"+u;for(var u=65;u<=90;u++)s[u]=String.fromCharCode(u+32),o[u]=String.fromCharCode(u);for(var c in s)o.hasOwnProperty(c)||(o[c]=s[c]);function h(r){var n=!(l&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||a&&r.shiftKey&&r.key&&1==r.key.length||"Unidentified"==r.key)&&r.key||(r.shiftKey?o:s)[r.keyCode]||r.key||"Unidentified";return"Esc"==n&&(n="Escape"),"Del"==n&&(n="Delete"),"Left"==n&&(n="ArrowLeft"),"Up"==n&&(n="ArrowUp"),"Right"==n&&(n="ArrowRight"),"Down"==n&&(n="ArrowDown"),n}var d=i(76865);let p="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),f="u">typeof navigator&&/Win/.test(navigator.platform);function m(r){let n,i,s,o,l=r.split(/-(?!$)/),a=l[l.length-1];"Space"==a&&(a=" ");for(let r=0;r<l.length-1;r++){let a=l[r];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))n=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else if(/^s(hift)?$/i.test(a))s=!0;else if(/^mod$/i.test(a))p?o=!0:i=!0;else throw Error("Unrecognized modifier name: "+a)}return n&&(a="Alt-"+a),i&&(a="Ctrl-"+a),o&&(a="Meta-"+a),s&&(a="Shift-"+a),a}function g(r){let n=Object.create(null);for(let i in r)n[m(i)]=r[i];return n}function _(r,n,i=!0){return n.altKey&&(r="Alt-"+r),n.ctrlKey&&(r="Ctrl-"+r),n.metaKey&&(r="Meta-"+r),i&&n.shiftKey&&(r="Shift-"+r),r}function y(r){return new d.k_({props:{handleKeyDown:k(r)}})}function k(r){let n=g(r);return function(r,i){let o=h(i),l,a=n[_(o,i)];if(a&&a(r.state,r.dispatch,r))return!0;if(1==o.length&&" "!=o){if(i.shiftKey){let s=n[_(o,i,!1)];if(s&&s(r.state,r.dispatch,r))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(f&&i.ctrlKey&&i.altKey)&&(l=s[i.keyCode])&&l!=o){let s=n[_(l,i)];if(s&&s(r.state,r.dispatch,r))return!0}}return!1}}},13439:(r,n,i)=>{"use strict";i.d(n,{$Z:()=>ep,hG:()=>ew});var s=i(12115),o=i(47650),l=i(8039),a=i(95155),u=i(82159);let{getOwnPropertyNames:c,getOwnPropertySymbols:h}=Object,{hasOwnProperty:d}=Object.prototype;function p(r,n){return function(i,s,o){return r(i,s,o)&&n(i,s,o)}}function f(r){return function(n,i,s){if(!n||!i||"object"!=typeof n||"object"!=typeof i)return r(n,i,s);let{cache:o}=s,l=o.get(n),a=o.get(i);if(l&&a)return l===i&&a===n;o.set(n,i),o.set(i,n);let u=r(n,i,s);return o.delete(n),o.delete(i),u}}function m(r){return null!=r?r[Symbol.toStringTag]:void 0}function g(r){return c(r).concat(h(r))}let _=Object.hasOwn||((r,n)=>d.call(r,n));function y(r,n){return r===n||!r&&!n&&r!=r&&n!=n}let k="__v",b="__o",w="_owner",{getOwnPropertyDescriptor:x,keys:v}=Object;function C(r,n){return r.byteLength===n.byteLength&&z(new Uint8Array(r),new Uint8Array(n))}function A(r,n,i){let s=r.length;if(n.length!==s)return!1;for(;s-- >0;)if(!i.equals(r[s],n[s],s,s,r,n,i))return!1;return!0}function E(r,n){return r.byteLength===n.byteLength&&z(new Uint8Array(r.buffer,r.byteOffset,r.byteLength),new Uint8Array(n.buffer,n.byteOffset,n.byteLength))}function S(r,n){return y(r.getTime(),n.getTime())}function M(r,n){return r.name===n.name&&r.message===n.message&&r.cause===n.cause&&r.stack===n.stack}function T(r,n){return r===n}function D(r,n,i){let s,o,l=r.size;if(l!==n.size)return!1;if(!l)return!0;let a=Array(l),u=r.entries(),c=0;for(;(s=u.next())&&!s.done;){let l=n.entries(),u=!1,h=0;for(;(o=l.next())&&!o.done;){if(a[h]){h++;continue}let l=s.value,d=o.value;if(i.equals(l[0],d[0],c,h,r,n,i)&&i.equals(l[1],d[1],l[0],d[0],r,n,i)){u=a[h]=!0;break}h++}if(!u)return!1;c++}return!0}let F=y;function I(r,n,i){let s=v(r),o=s.length;if(v(n).length!==o)return!1;for(;o-- >0;)if(!$(r,n,i,s[o]))return!1;return!0}function L(r,n,i){let s,o,l,a=g(r),u=a.length;if(g(n).length!==u)return!1;for(;u-- >0;)if(!$(r,n,i,s=a[u])||(o=x(r,s),l=x(n,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function R(r,n){return y(r.valueOf(),n.valueOf())}function N(r,n){return r.source===n.source&&r.flags===n.flags}function O(r,n,i){let s,o,l=r.size;if(l!==n.size)return!1;if(!l)return!0;let a=Array(l),u=r.values();for(;(s=u.next())&&!s.done;){let l=n.values(),u=!1,c=0;for(;(o=l.next())&&!o.done;){if(!a[c]&&i.equals(s.value,o.value,s.value,o.value,r,n,i)){u=a[c]=!0;break}c++}if(!u)return!1}return!0}function z(r,n){let i=r.byteLength;if(n.byteLength!==i||r.byteOffset!==n.byteOffset)return!1;for(;i-- >0;)if(r[i]!==n[i])return!1;return!0}function P(r,n){return r.hostname===n.hostname&&r.pathname===n.pathname&&r.protocol===n.protocol&&r.port===n.port&&r.hash===n.hash&&r.username===n.username&&r.password===n.password}function $(r,n,i,s){return(s===w||s===b||s===k)&&(!!r.$$typeof||!!n.$$typeof)||_(n,s)&&i.equals(r[s],n[s],s,s,r,n,i)}let B="[object ArrayBuffer]",q="[object Arguments]",j="[object Boolean]",H="[object DataView]",V="[object Date]",U="[object Error]",W="[object Map]",J="[object Number]",K="[object Object]",G="[object RegExp]",Z="[object Set]",X="[object String]",Y={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Q="[object URL]",ee=Object.prototype.toString;function et({areArrayBuffersEqual:r,areArraysEqual:n,areDataViewsEqual:i,areDatesEqual:s,areErrorsEqual:o,areFunctionsEqual:l,areMapsEqual:a,areNumbersEqual:u,areObjectsEqual:c,arePrimitiveWrappersEqual:h,areRegExpsEqual:d,areSetsEqual:p,areTypedArraysEqual:f,areUrlsEqual:g,unknownTagComparators:_}){return function(y,k,b){if(y===k)return!0;if(null==y||null==k)return!1;let w=typeof y;if(w!==typeof k)return!1;if("object"!==w)return"number"===w?u(y,k,b):"function"===w&&l(y,k,b);let x=y.constructor;if(x!==k.constructor)return!1;if(x===Object)return c(y,k,b);if(Array.isArray(y))return n(y,k,b);if(x===Date)return s(y,k,b);if(x===RegExp)return d(y,k,b);if(x===Map)return a(y,k,b);if(x===Set)return p(y,k,b);let v=ee.call(y);if(v===V)return s(y,k,b);if(v===G)return d(y,k,b);if(v===W)return a(y,k,b);if(v===Z)return p(y,k,b);if(v===K)return"function"!=typeof y.then&&"function"!=typeof k.then&&c(y,k,b);if(v===Q)return g(y,k,b);if(v===U)return o(y,k,b);if(v===q)return c(y,k,b);if(Y[v])return f(y,k,b);if(v===B)return r(y,k,b);if(v===H)return i(y,k,b);if(v===j||v===J||v===X)return h(y,k,b);if(_){let r=_[v];if(!r){let n=m(y);n&&(r=_[n])}if(r)return r(y,k,b)}return!1}}function er({circular:r,createCustomConfig:n,strict:i}){let s={areArrayBuffersEqual:C,areArraysEqual:i?L:A,areDataViewsEqual:E,areDatesEqual:S,areErrorsEqual:M,areFunctionsEqual:T,areMapsEqual:i?p(D,L):D,areNumbersEqual:F,areObjectsEqual:i?L:I,arePrimitiveWrappersEqual:R,areRegExpsEqual:N,areSetsEqual:i?p(O,L):O,areTypedArraysEqual:i?p(z,L):z,areUrlsEqual:P,unknownTagComparators:void 0};if(n&&(s=Object.assign({},s,n(s))),r){let r=f(s.areArraysEqual),n=f(s.areMapsEqual),i=f(s.areObjectsEqual),o=f(s.areSetsEqual);s=Object.assign({},s,{areArraysEqual:r,areMapsEqual:n,areObjectsEqual:i,areSetsEqual:o})}return s}function en(r){return function(n,i,s,o,l,a,u){return r(n,i,u)}}function ei({circular:r,comparator:n,createState:i,equals:s,strict:o}){if(i)return function(l,a){let{cache:u=r?new WeakMap:void 0,meta:c}=i();return n(l,a,{cache:u,equals:s,meta:c,strict:o})};if(r)return function(r,i){return n(r,i,{cache:new WeakMap,equals:s,meta:void 0,strict:o})};let l={cache:void 0,equals:s,meta:void 0,strict:o};return function(r,i){return n(r,i,l)}}let es=eo();function eo(r={}){let{circular:n=!1,createInternalComparator:i,createState:s,strict:o=!1}=r,l=et(er(r)),a=i?i(l):en(l);return ei({circular:n,comparator:l,createState:s,equals:a,strict:o})}eo({strict:!0}),eo({circular:!0}),eo({circular:!0,strict:!0}),eo({createInternalComparator:()=>y}),eo({strict:!0,createInternalComparator:()=>y}),eo({circular:!0,createInternalComparator:()=>y}),eo({circular:!0,createInternalComparator:()=>y,strict:!0});var el=i(94577),ea=(...r)=>n=>{r.forEach(r=>{"function"==typeof r?r(n):r&&(r.current=n)})},eu=({contentComponent:r})=>{let n=(0,l.useSyncExternalStore)(r.subscribe,r.getSnapshot,r.getServerSnapshot);return(0,a.jsx)(a.Fragment,{children:Object.values(n)})};function ec(){let r=new Set,n={};return{subscribe:n=>(r.add(n),()=>{r.delete(n)}),getSnapshot:()=>n,getServerSnapshot:()=>n,setRenderer(i,s){n={...n,[i]:o.createPortal(s.reactElement,s.element,i)},r.forEach(r=>r())},removeRenderer(i){let s={...n};delete s[i],n=s,r.forEach(r=>r())}}}var eh=class extends s.Component{constructor(r){super(r),this.editorContentRef=s.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var r;let n=this.props.editor;if(n&&!n.isDestroyed&&(null==(r=n.view.dom)?void 0:r.parentNode)){if(n.contentComponent)return;let r=this.editorContentRef.current;r.append(...n.view.dom.parentNode.childNodes),n.setOptions({element:r}),n.contentComponent=ec(),n.createNodeViews(),n.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var r;let n=this.props.editor;if(n){n.isEditorContentInitialized=!1,n.isDestroyed||n.view.setProps({nodeViews:{}}),n.contentComponent=null;try{if(!(null==(r=n.view.dom)?void 0:r.parentNode))return;let i=document.createElement("div");i.append(...n.view.dom.parentNode.childNodes),n.setOptions({element:i})}catch{}}}render(){let{editor:r,innerRef:n,...i}=this.props;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:ea(n,this.editorContentRef),...i}),(null==r?void 0:r.contentComponent)&&(0,a.jsx)(eu,{contentComponent:r.contentComponent})]})}},ed=(0,s.forwardRef)((r,n)=>{let i=s.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[r.editor]);return s.createElement(eh,{key:i,innerRef:n,...r})}),ep=s.memo(ed),ef="u">typeof window?s.useLayoutEffect:s.useEffect,em=class{constructor(r){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=r,this.lastSnapshot={editor:r,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(r){return this.subscribers.add(r),()=>{this.subscribers.delete(r)}}watch(r){if(this.editor=r,this.editor){let r=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",r),()=>{n.off("transaction",r)}}}};function eg(r){var n;let[i]=(0,s.useState)(()=>new em(r.editor)),o=(0,el.useSyncExternalStoreWithSelector)(i.subscribe,i.getSnapshot,i.getServerSnapshot,r.selector,null!=(n=r.equalityFn)?n:es);return ef(()=>i.watch(r.editor),[r.editor,i]),(0,s.useDebugValue)(o),o}var e_=!1,ey="u"<typeof window,ek=ey||!!("u">typeof window&&window.next),eb=class r{constructor(r){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=r,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(r){this.editor=r,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){if(void 0===this.options.current.immediatelyRender){if(ey||ek){if(e_)throw Error("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches.");return null}return this.createEditor()}if(this.options.current.immediatelyRender&&ey&&e_)throw Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){let r={...this.options.current,onBeforeCreate:(...r)=>{var n,i;return null==(i=(n=this.options.current).onBeforeCreate)?void 0:i.call(n,...r)},onBlur:(...r)=>{var n,i;return null==(i=(n=this.options.current).onBlur)?void 0:i.call(n,...r)},onCreate:(...r)=>{var n,i;return null==(i=(n=this.options.current).onCreate)?void 0:i.call(n,...r)},onDestroy:(...r)=>{var n,i;return null==(i=(n=this.options.current).onDestroy)?void 0:i.call(n,...r)},onFocus:(...r)=>{var n,i;return null==(i=(n=this.options.current).onFocus)?void 0:i.call(n,...r)},onSelectionUpdate:(...r)=>{var n,i;return null==(i=(n=this.options.current).onSelectionUpdate)?void 0:i.call(n,...r)},onTransaction:(...r)=>{var n,i;return null==(i=(n=this.options.current).onTransaction)?void 0:i.call(n,...r)},onUpdate:(...r)=>{var n,i;return null==(i=(n=this.options.current).onUpdate)?void 0:i.call(n,...r)},onContentError:(...r)=>{var n,i;return null==(i=(n=this.options.current).onContentError)?void 0:i.call(n,...r)},onDrop:(...r)=>{var n,i;return null==(i=(n=this.options.current).onDrop)?void 0:i.call(n,...r)},onPaste:(...r)=>{var n,i;return null==(i=(n=this.options.current).onPaste)?void 0:i.call(n,...r)},onDelete:(...r)=>{var n,i;return null==(i=(n=this.options.current).onDelete)?void 0:i.call(n,...r)}};return new u.KE(r)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(r){return this.subscriptions.add(r),()=>{this.subscriptions.delete(r)}}static compareOptions(r,n){return Object.keys(r).every(i=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(i)||("extensions"===i&&r.extensions&&n.extensions?r.extensions.length===n.extensions.length&&r.extensions.every((r,i)=>{var s;return r===(null==(s=n.extensions)?void 0:s[i])}):r[i]===n[i]))}onRender(n){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===n.length?r.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(n),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(r){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=r;return}if(this.previousDeps.length===r.length&&this.previousDeps.every((n,i)=>n===r[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=r}scheduleDestroy(){let r=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===r){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===r&&this.setEditor(null))},1)}};function ew(r={},n=[]){let i=(0,s.useRef)(r);i.current=r;let[o]=(0,s.useState)(()=>new eb(i)),a=(0,l.useSyncExternalStore)(o.subscribe,o.getEditor,o.getServerSnapshot);return(0,s.useDebugValue)(a),(0,s.useEffect)(o.onRender(n)),eg({editor:a,selector:({transactionNumber:n})=>!1===r.shouldRerenderOnTransaction||void 0===r.shouldRerenderOnTransaction?null:r.immediatelyRender&&0===n?0:n+1}),a}var ex=(0,s.createContext)({editor:null});ex.Consumer;var ev=(0,s.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),eC=()=>(0,s.useContext)(ev);s.forwardRef((r,n)=>{let{onDragStart:i}=eC(),s=r.as||"div";return(0,a.jsx)(s,{...r,ref:n,"data-node-view-wrapper":"",onDragStart:i,style:{whiteSpace:"normal",...r.style}})}),s.createContext({markViewContentRef:()=>{}}),u.Db,u.Yv;var eA=(0,s.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});eA.displayName="TiptapContext";var eE=()=>(0,s.useContext)(eA);function eS({editor:r,instance:n,children:i}){let o=null!=r?r:n;if(!o)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let l=(0,s.useMemo)(()=>({editor:o}),[o]),u=(0,s.useMemo)(()=>({editor:o}),[o]);return(0,a.jsx)(ex.Provider,{value:u,children:(0,a.jsx)(eA.Provider,{value:l,children:i})})}function eM({...r}){let{editor:n}=eE();return(0,a.jsx)(ep,{editor:n,...r})}eS.displayName="Tiptap",eM.displayName="Tiptap.Content",Object.assign(eS,{Content:eM})},14066:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{TM:()=>Language,iX:()=>Parser});var C,TRANSFER_BUFFER,LANGUAGE_VERSION,MIN_COMPATIBLE_VERSION,process=__webpack_require__(41463),__defProp=Object.defineProperty,__name=(r,n)=>__defProp(r,"name",{value:n,configurable:!0}),Edit=class{static{__name(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:r,oldEndIndex:n,newEndIndex:i,startPosition:s,oldEndPosition:o,newEndPosition:l}){this.startIndex=r>>>0,this.oldEndIndex=n>>>0,this.newEndIndex=i>>>0,this.startPosition=s,this.oldEndPosition=o,this.newEndPosition=l}editPoint(r,n){let i=n,s={...r};if(n>=this.oldEndIndex){i=this.newEndIndex+(n-this.oldEndIndex);let o=r.row;s.row=this.newEndPosition.row+(r.row-this.oldEndPosition.row),s.column=o===this.oldEndPosition.row?this.newEndPosition.column+(r.column-this.oldEndPosition.column):r.column}else n>this.startIndex&&(i=this.newEndIndex,s.row=this.newEndPosition.row,s.column=this.newEndPosition.column);return{point:s,index:i}}editRange(r){let n={startIndex:r.startIndex,startPosition:{...r.startPosition},endIndex:r.endIndex,endPosition:{...r.endPosition}};return r.endIndex>=this.oldEndIndex?r.endIndex!==Number.MAX_SAFE_INTEGER&&(n.endIndex=this.newEndIndex+(r.endIndex-this.oldEndIndex),n.endPosition={row:this.newEndPosition.row+(r.endPosition.row-this.oldEndPosition.row),column:r.endPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(r.endPosition.column-this.oldEndPosition.column):r.endPosition.column},n.endIndex<this.newEndIndex&&(n.endIndex=Number.MAX_SAFE_INTEGER,n.endPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):r.endIndex>this.startIndex&&(n.endIndex=this.startIndex,n.endPosition={...this.startPosition}),r.startIndex>=this.oldEndIndex?(n.startIndex=this.newEndIndex+(r.startIndex-this.oldEndIndex),n.startPosition={row:this.newEndPosition.row+(r.startPosition.row-this.oldEndPosition.row),column:r.startPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(r.startPosition.column-this.oldEndPosition.column):r.startPosition.column},n.startIndex<this.newEndIndex&&(n.startIndex=Number.MAX_SAFE_INTEGER,n.startPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):r.startIndex>this.startIndex&&(n.startIndex=this.startIndex,n.startPosition={...this.startPosition}),n}},SIZE_OF_SHORT=2,SIZE_OF_INT=4,SIZE_OF_CURSOR=4*SIZE_OF_INT,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},INTERNAL=Symbol("INTERNAL");function assertInternal(r){if(r!==INTERNAL)throw Error("Illegal constructor")}function isPoint(r){return!!r&&"number"==typeof r.row&&"number"==typeof r.column}function setModule(r){C=r}__name(assertInternal,"assertInternal"),__name(isPoint,"isPoint"),__name(setModule,"setModule");var LookaheadIterator=class{static{__name(this,"LookaheadIterator")}0=0;language;constructor(r,n,i){assertInternal(r),this[0]=n,this.language=i}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(r,n){return!!C._ts_lookahead_iterator_reset(this[0],r[0],n)&&(this.language=r,!0)}resetState(r){return!!C._ts_lookahead_iterator_reset_state(this[0],r)}[Symbol.iterator](){return{next:__name(()=>C._ts_lookahead_iterator_next(this[0])?{done:!1,value:this.currentType}:{done:!0,value:""},"next")}}};function getText(r,n,i,s){let o=i-n,l=r.textCallback(n,s);if(l){for(n+=l.length;n<i;){let i=r.textCallback(n,s);if(i&&i.length>0)n+=i.length,l+=i;else break}n>i&&(l=l.slice(0,o))}return l??""}__name(getText,"getText");var Tree=class _Tree{static{__name(this,"Tree")}0=0;textCallback;language;constructor(r,n,i,s){assertInternal(r),this[0]=n,this.language=i,this.textCallback=s}copy(){return new _Tree(INTERNAL,C._ts_tree_copy(this[0]),this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}rootNodeWithOffset(r,n){let i=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(i,r,"i32"),marshalPoint(i+SIZE_OF_INT,n),C._ts_tree_root_node_with_offset_wasm(this[0]),unmarshalNode(this)}edit(r){marshalEdit(r),C._ts_tree_edit_wasm(this[0])}walk(){return this.rootNode.walk()}getChangedRanges(r){if(!(r instanceof _Tree))throw TypeError("Argument must be a Tree");C._ts_tree_get_changed_ranges_wasm(this[0],r[0]);let n=C.getValue(TRANSFER_BUFFER,"i32"),i=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),s=Array(n);if(n>0){let r=i;for(let i=0;i<n;i++)s[i]=unmarshalRange(r),r+=SIZE_OF_RANGE;C._free(i)}return s}getIncludedRanges(){C._ts_tree_included_ranges_wasm(this[0]);let r=C.getValue(TRANSFER_BUFFER,"i32"),n=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),i=Array(r);if(r>0){let s=n;for(let n=0;n<r;n++)i[n]=unmarshalRange(s),s+=SIZE_OF_RANGE;C._free(n)}return i}},TreeCursor=class _TreeCursor{static{__name(this,"TreeCursor")}0=0;1=0;2=0;3=0;tree;constructor(r,n){assertInternal(r),this.tree=n,unmarshalTreeCursor(this)}copy(){let r=new _TreeCursor(INTERNAL,this.tree);return C._ts_tree_cursor_copy_wasm(this.tree[0]),unmarshalTreeCursor(r),r}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}get currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}get currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return marshalTreeCursor(this),C._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),1===C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])}get nodeIsMissing(){return marshalTreeCursor(this),1===C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])}get nodeText(){marshalTreeCursor(this);let r=C._ts_tree_cursor_start_index_wasm(this.tree[0]),n=C._ts_tree_cursor_end_index_wasm(this.tree[0]);C._ts_tree_cursor_start_position_wasm(this.tree[0]);let i=unmarshalPoint(TRANSFER_BUFFER);return getText(this.tree,r,n,i)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){marshalTreeCursor(this);let r=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===r}gotoLastChild(){marshalTreeCursor(this);let r=C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===r}gotoParent(){marshalTreeCursor(this);let r=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===r}gotoNextSibling(){marshalTreeCursor(this);let r=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===r}gotoPreviousSibling(){marshalTreeCursor(this);let r=C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===r}gotoDescendant(r){marshalTreeCursor(this),C._ts_tree_cursor_goto_descendant_wasm(this.tree[0],r),unmarshalTreeCursor(this)}gotoFirstChildForIndex(r){marshalTreeCursor(this),C.setValue(TRANSFER_BUFFER+SIZE_OF_CURSOR,r,"i32");let n=C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===n}gotoFirstChildForPosition(r){marshalTreeCursor(this),marshalPoint(TRANSFER_BUFFER+SIZE_OF_CURSOR,r);let n=C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return unmarshalTreeCursor(this),1===n}reset(r){marshalNode(r),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this)}resetTo(r){marshalTreeCursor(this,TRANSFER_BUFFER),marshalTreeCursor(r,TRANSFER_BUFFER+SIZE_OF_CURSOR),C._ts_tree_cursor_reset_to_wasm(this.tree[0],r.tree[0]),unmarshalTreeCursor(this)}},Node=class{static{__name(this,"Node")}0=0;_children;_namedChildren;constructor(r,{id:n,tree:i,startIndex:s,startPosition:o,other:l}){assertInternal(r),this[0]=l,this.id=n,this.tree=i,this.startIndex=s,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return marshalNode(this),C._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get isNamed(){return marshalNode(this),1===C._ts_node_is_named_wasm(this.tree[0])}get isExtra(){return marshalNode(this),1===C._ts_node_is_extra_wasm(this.tree[0])}get isError(){return marshalNode(this),1===C._ts_node_is_error_wasm(this.tree[0])}get isMissing(){return marshalNode(this),1===C._ts_node_is_missing_wasm(this.tree[0])}get hasChanges(){return marshalNode(this),1===C._ts_node_has_changes_wasm(this.tree[0])}get hasError(){return marshalNode(this),1===C._ts_node_has_error_wasm(this.tree[0])}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get text(){return getText(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return marshalNode(this),C._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return marshalNode(this),C._ts_node_next_parse_state_wasm(this.tree[0])}equals(r){return this.tree===r.tree&&this.id===r.id}child(r){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],r),unmarshalNode(this.tree)}namedChild(r){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],r),unmarshalNode(this.tree)}childForFieldId(r){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],r),unmarshalNode(this.tree)}childForFieldName(r){let n=this.tree.language.fields.indexOf(r);return -1!==n?this.childForFieldId(n):null}fieldNameForChild(r){marshalNode(this);let n=C._ts_node_field_name_for_child_wasm(this.tree[0],r);return n?C.AsciiToString(n):null}fieldNameForNamedChild(r){marshalNode(this);let n=C._ts_node_field_name_for_named_child_wasm(this.tree[0],r);return n?C.AsciiToString(n):null}childrenForFieldName(r){let n=this.tree.language.fields.indexOf(r);return -1!==n&&0!==n?this.childrenForFieldId(n):[]}childrenForFieldId(r){marshalNode(this),C._ts_node_children_by_field_id_wasm(this.tree[0],r);let n=C.getValue(TRANSFER_BUFFER,"i32"),i=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),s=Array(n);if(n>0){let r=i;for(let i=0;i<n;i++)s[i]=unmarshalNode(this.tree,r),r+=SIZE_OF_NODE;C._free(i)}return s}firstChildForIndex(r){marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(n,r,"i32"),C._ts_node_first_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}firstNamedChildForIndex(r){marshalNode(this);let n=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(n,r,"i32"),C._ts_node_first_named_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);let r=C.getValue(TRANSFER_BUFFER,"i32"),n=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._children=Array(r),r>0){let i=n;for(let n=0;n<r;n++)this._children[n]=unmarshalNode(this.tree,i),i+=SIZE_OF_NODE;C._free(n)}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);let r=C.getValue(TRANSFER_BUFFER,"i32"),n=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._namedChildren=Array(r),r>0){let i=n;for(let n=0;n<r;n++)this._namedChildren[n]=unmarshalNode(this.tree,i),i+=SIZE_OF_NODE;C._free(n)}}return this._namedChildren}descendantsOfType(r,n=ZERO_POINT,i=ZERO_POINT){Array.isArray(r)||(r=[r]);let s=[],o=this.tree.language.types;for(let n of r)"ERROR"==n&&s.push(65535);for(let n=0,i=o.length;n<i;n++)r.includes(o[n])&&s.push(n);let l=C._malloc(SIZE_OF_INT*s.length);for(let r=0,n=s.length;r<n;r++)C.setValue(l+r*SIZE_OF_INT,s[r],"i32");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],l,s.length,n.row,n.column,i.row,i.column);let a=C.getValue(TRANSFER_BUFFER,"i32"),u=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),c=Array(a);if(a>0){let r=u;for(let n=0;n<a;n++)c[n]=unmarshalNode(this.tree,r),r+=SIZE_OF_NODE}return C._free(u),C._free(l),c}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get descendantCount(){return marshalNode(this),C._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}childWithDescendant(r){return marshalNode(this),marshalNode(r,1),C._ts_node_child_with_descendant_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(r,n=r){if("number"!=typeof r||"number"!=typeof n)throw Error("Arguments must be numbers");marshalNode(this);let i=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(i,r,"i32"),C.setValue(i+SIZE_OF_INT,n,"i32"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(r,n=r){if("number"!=typeof r||"number"!=typeof n)throw Error("Arguments must be numbers");marshalNode(this);let i=TRANSFER_BUFFER+SIZE_OF_NODE;return C.setValue(i,r,"i32"),C.setValue(i+SIZE_OF_INT,n,"i32"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(r,n=r){if(!isPoint(r)||!isPoint(n))throw Error("Arguments must be {row, column} objects");marshalNode(this);let i=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(i,r),marshalPoint(i+SIZE_OF_POINT,n),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(r,n=r){if(!isPoint(r)||!isPoint(n))throw Error("Arguments must be {row, column} objects");marshalNode(this);let i=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint(i,r),marshalPoint(i+SIZE_OF_POINT,n),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}edit(r){if(this.startIndex>=r.oldEndIndex){let n,i;this.startIndex=r.newEndIndex+(this.startIndex-r.oldEndIndex),this.startPosition.row>r.oldEndPosition.row?(n=this.startPosition.row-r.oldEndPosition.row,i=this.startPosition.column):(n=0,i=this.startPosition.column,this.startPosition.column>=r.oldEndPosition.column&&(i=this.startPosition.column-r.oldEndPosition.column)),n>0?(this.startPosition.row+=n,this.startPosition.column=i):this.startPosition.column+=i}else this.startIndex>r.startIndex&&(this.startIndex=r.newEndIndex,this.startPosition.row=r.newEndPosition.row,this.startPosition.column=r.newEndPosition.column)}toString(){marshalNode(this);let r=C._ts_node_to_string_wasm(this.tree[0]),n=C.AsciiToString(r);return C._free(r),n}};function unmarshalCaptures(r,n,i,s,o){for(let l=0,a=o.length;l<a;l++){let a=C.getValue(i,"i32"),u=unmarshalNode(n,i+=SIZE_OF_INT);i+=SIZE_OF_NODE,o[l]={patternIndex:s,name:r.captureNames[a],node:u}}return i}function marshalNode(r,n=0){let i=TRANSFER_BUFFER+n*SIZE_OF_NODE;C.setValue(i,r.id,"i32"),i+=SIZE_OF_INT,C.setValue(i,r.startIndex,"i32"),i+=SIZE_OF_INT,C.setValue(i,r.startPosition.row,"i32"),i+=SIZE_OF_INT,C.setValue(i,r.startPosition.column,"i32"),i+=SIZE_OF_INT,C.setValue(i,r[0],"i32")}function unmarshalNode(r,n=TRANSFER_BUFFER){let i=C.getValue(n,"i32");if(n+=SIZE_OF_INT,0===i)return null;let s=C.getValue(n,"i32");n+=SIZE_OF_INT;let o=C.getValue(n,"i32");n+=SIZE_OF_INT;let l=C.getValue(n,"i32");return n+=SIZE_OF_INT,new Node(INTERNAL,{id:i,tree:r,startIndex:s,startPosition:{row:o,column:l},other:C.getValue(n,"i32")})}function marshalTreeCursor(r,n=TRANSFER_BUFFER){C.setValue(n+0*SIZE_OF_INT,r[0],"i32"),C.setValue(n+ +SIZE_OF_INT,r[1],"i32"),C.setValue(n+2*SIZE_OF_INT,r[2],"i32"),C.setValue(n+3*SIZE_OF_INT,r[3],"i32")}function unmarshalTreeCursor(r){r[0]=C.getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),r[1]=C.getValue(TRANSFER_BUFFER+ +SIZE_OF_INT,"i32"),r[2]=C.getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),r[3]=C.getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,"i32")}function marshalPoint(r,n){C.setValue(r,n.row,"i32"),C.setValue(r+SIZE_OF_INT,n.column,"i32")}function unmarshalPoint(r){return{row:C.getValue(r,"i32")>>>0,column:C.getValue(r+SIZE_OF_INT,"i32")>>>0}}function marshalRange(r,n){marshalPoint(r,n.startPosition),marshalPoint(r+=SIZE_OF_POINT,n.endPosition),r+=SIZE_OF_POINT,C.setValue(r,n.startIndex,"i32"),r+=SIZE_OF_INT,C.setValue(r,n.endIndex,"i32")}function unmarshalRange(r){let n={};return n.startPosition=unmarshalPoint(r),n.endPosition=unmarshalPoint(r+=SIZE_OF_POINT),r+=SIZE_OF_POINT,n.startIndex=C.getValue(r,"i32")>>>0,r+=SIZE_OF_INT,n.endIndex=C.getValue(r,"i32")>>>0,n}function marshalEdit(r,n=TRANSFER_BUFFER){marshalPoint(n,r.startPosition),marshalPoint(n+=SIZE_OF_POINT,r.oldEndPosition),marshalPoint(n+=SIZE_OF_POINT,r.newEndPosition),n+=SIZE_OF_POINT,C.setValue(n,r.startIndex,"i32"),n+=SIZE_OF_INT,C.setValue(n,r.oldEndIndex,"i32"),n+=SIZE_OF_INT,C.setValue(n,r.newEndIndex,"i32")}function unmarshalLanguageMetadata(r){let n=C.getValue(r,"i32");return{major_version:n,minor_version:C.getValue(r+=SIZE_OF_INT,"i32"),patch_version:C.getValue(r+=SIZE_OF_INT,"i32")}}__name(unmarshalCaptures,"unmarshalCaptures"),__name(marshalNode,"marshalNode"),__name(unmarshalNode,"unmarshalNode"),__name(marshalTreeCursor,"marshalTreeCursor"),__name(unmarshalTreeCursor,"unmarshalTreeCursor"),__name(marshalPoint,"marshalPoint"),__name(unmarshalPoint,"unmarshalPoint"),__name(marshalRange,"marshalRange"),__name(unmarshalRange,"unmarshalRange"),__name(marshalEdit,"marshalEdit"),__name(unmarshalLanguageMetadata,"unmarshalLanguageMetadata");var LANGUAGE_FUNCTION_REGEX=/^tree_sitter_\w+$/,Language=class _Language{static{__name(this,"Language")}0=0;types;fields;constructor(r,n){assertInternal(r),this[0]=n,this.types=Array(C._ts_language_symbol_count(this[0]));for(let r=0,n=this.types.length;r<n;r++)2>C._ts_language_symbol_type(this[0],r)&&(this.types[r]=C.UTF8ToString(C._ts_language_symbol_name(this[0],r)));this.fields=Array(C._ts_language_field_count(this[0])+1);for(let r=0,n=this.fields.length;r<n;r++){const n=C._ts_language_field_name_for_id(this[0],r);0!==n?this.fields[r]=C.UTF8ToString(n):this.fields[r]=null}}get name(){let r=C._ts_language_name(this[0]);return 0===r?null:C.UTF8ToString(r)}get abiVersion(){return C._ts_language_abi_version(this[0])}get metadata(){return(C._ts_language_metadata_wasm(this[0]),0===C.getValue(TRANSFER_BUFFER,"i32"))?null:unmarshalLanguageMetadata(TRANSFER_BUFFER+SIZE_OF_INT)}get fieldCount(){return this.fields.length-1}get stateCount(){return C._ts_language_state_count(this[0])}fieldIdForName(r){let n=this.fields.indexOf(r);return -1!==n?n:null}fieldNameForId(r){return this.fields[r]??null}idForNodeType(r,n){let i=C.lengthBytesUTF8(r),s=C._malloc(i+1);C.stringToUTF8(r,s,i+1);let o=C._ts_language_symbol_for_name(this[0],s,i,+!!n);return C._free(s),o||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(r){let n=C._ts_language_symbol_name(this[0],r);return n?C.UTF8ToString(n):null}nodeTypeIsNamed(r){return!!C._ts_language_type_is_named_wasm(this[0],r)}nodeTypeIsVisible(r){return!!C._ts_language_type_is_visible_wasm(this[0],r)}get supertypes(){C._ts_language_supertypes_wasm(this[0]);let r=C.getValue(TRANSFER_BUFFER,"i32"),n=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),i=Array(r);if(r>0){let s=n;for(let n=0;n<r;n++)i[n]=C.getValue(s,"i16"),s+=SIZE_OF_SHORT}return i}subtypes(r){C._ts_language_subtypes_wasm(this[0],r);let n=C.getValue(TRANSFER_BUFFER,"i32"),i=C.getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),s=Array(n);if(n>0){let r=i;for(let i=0;i<n;i++)s[i]=C.getValue(r,"i16"),r+=SIZE_OF_SHORT}return s}nextState(r,n){return C._ts_language_next_state(this[0],r,n)}lookaheadIterator(r){let n=C._ts_lookahead_iterator_new(this[0],r);return n?new LookaheadIterator(INTERNAL,n,this):null}static async load(r){let n;if(r instanceof Uint8Array)n=r;else if(globalThis.process?.versions.node){let i=await __webpack_require__.e(80480).then(__webpack_require__.t.bind(__webpack_require__,80480,19));n=await i.readFile(r)}else{let i=await fetch(r);if(!i.ok){let r=await i.text();throw Error(`Language.load failed with status ${i.status}.
@@ -9,7 +9,7 @@ ${JSON.stringify(s,null,2)}`),Error("Language.load failed: no language function
9
9
  `},eZ.image=function(r,n,i,s,o){let l=r[n];return l.attrs[l.attrIndex("alt")][1]=o.renderInlineAsText(l.children,i,s),o.renderToken(r,n,i)},eZ.hardbreak=function(r,n,i){return i.xhtmlOut?"<br />\n":"<br>\n"},eZ.softbreak=function(r,n,i){return i.breaks?i.xhtmlOut?"<br />\n":"<br>\n":"\n"},eZ.text=function(r,n){return eN(r[n].content)},eZ.html_block=function(r,n){return r[n].content},eZ.html_inline=function(r,n){return r[n].content},eX.prototype.renderAttrs=function(r){let n,i,s;if(!r.attrs)return"";for(n=0,s="",i=r.attrs.length;n<i;n++)s+=" "+eN(r.attrs[n][0])+'="'+eN(r.attrs[n][1])+'"';return s},eX.prototype.renderToken=function(r,n,i){let s=r[n],o="";if(s.hidden)return"";s.block&&-1!==s.nesting&&n&&r[n-1].hidden&&(o+="\n"),o+=(-1===s.nesting?"</":"<")+s.tag,o+=this.renderAttrs(s),0===s.nesting&&i.xhtmlOut&&(o+=" /");let l=!1;if(s.block&&(l=!0,1===s.nesting&&n+1<r.length)){let i=r[n+1];"inline"===i.type||i.hidden?l=!1:-1===i.nesting&&i.tag===s.tag&&(l=!1)}return o+(l?">\n":">")},eX.prototype.renderInline=function(r,n,i){let s="",o=this.rules;for(let l=0,a=r.length;l<a;l++){let a=r[l].type;void 0!==o[a]?s+=o[a](r,l,n,i,this):s+=this.renderToken(r,l,n)}return s},eX.prototype.renderInlineAsText=function(r,n,i){let s="";for(let o=0,l=r.length;o<l;o++)switch(r[o].type){case"text":case"html_inline":case"html_block":s+=r[o].content;break;case"image":s+=this.renderInlineAsText(r[o].children,n,i);break;case"softbreak":case"hardbreak":s+="\n"}return s},eX.prototype.render=function(r,n,i){let s="",o=this.rules;for(let l=0,a=r.length;l<a;l++){let a=r[l].type;"inline"===a?s+=this.renderInline(r[l].children,n,i):void 0!==o[a]?s+=o[a](r,l,n,i,this):s+=this.renderToken(r,l,n,i)}return s};let eY=eX;function eQ(){this.__rules__=[],this.__cache__=null}eQ.prototype.__find__=function(r){for(let n=0;n<this.__rules__.length;n++)if(this.__rules__[n].name===r)return n;return -1},eQ.prototype.__compile__=function(){let r=this,n=[""];r.__rules__.forEach(function(r){r.enabled&&r.alt.forEach(function(r){0>n.indexOf(r)&&n.push(r)})}),r.__cache__={},n.forEach(function(n){r.__cache__[n]=[],r.__rules__.forEach(function(i){!i.enabled||n&&0>i.alt.indexOf(n)||r.__cache__[n].push(i.fn)})})},eQ.prototype.at=function(r,n,i){let s=this.__find__(r),o=i||{};if(-1===s)throw Error("Parser rule not found: "+r);this.__rules__[s].fn=n,this.__rules__[s].alt=o.alt||[],this.__cache__=null},eQ.prototype.before=function(r,n,i,s){let o=this.__find__(r),l=s||{};if(-1===o)throw Error("Parser rule not found: "+r);this.__rules__.splice(o,0,{name:n,enabled:!0,fn:i,alt:l.alt||[]}),this.__cache__=null},eQ.prototype.after=function(r,n,i,s){let o=this.__find__(r),l=s||{};if(-1===o)throw Error("Parser rule not found: "+r);this.__rules__.splice(o+1,0,{name:n,enabled:!0,fn:i,alt:l.alt||[]}),this.__cache__=null},eQ.prototype.push=function(r,n,i){let s=i||{};this.__rules__.push({name:r,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},eQ.prototype.enable=function(r,n){Array.isArray(r)||(r=[r]);let i=[];return r.forEach(function(r){let s=this.__find__(r);if(s<0){if(n)return;throw Error("Rules manager: invalid rule name "+r)}this.__rules__[s].enabled=!0,i.push(r)},this),this.__cache__=null,i},eQ.prototype.enableOnly=function(r,n){Array.isArray(r)||(r=[r]),this.__rules__.forEach(function(r){r.enabled=!1}),this.enable(r,n)},eQ.prototype.disable=function(r,n){Array.isArray(r)||(r=[r]);let i=[];return r.forEach(function(r){let s=this.__find__(r);if(s<0){if(n)return;throw Error("Rules manager: invalid rule name "+r)}this.__rules__[s].enabled=!1,i.push(r)},this),this.__cache__=null,i},eQ.prototype.getRules=function(r){return null===this.__cache__&&this.__compile__(),this.__cache__[r]||[]};let e0=eQ;function e1(r,n,i){this.type=r,this.tag=n,this.attrs=null,this.map=null,this.nesting=i,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}e1.prototype.attrIndex=function(r){if(!this.attrs)return -1;let n=this.attrs;for(let i=0,s=n.length;i<s;i++)if(n[i][0]===r)return i;return -1},e1.prototype.attrPush=function(r){this.attrs?this.attrs.push(r):this.attrs=[r]},e1.prototype.attrSet=function(r,n){let i=this.attrIndex(r),s=[r,n];i<0?this.attrPush(s):this.attrs[i]=s},e1.prototype.attrGet=function(r){let n=this.attrIndex(r),i=null;return n>=0&&(i=this.attrs[n][1]),i},e1.prototype.attrJoin=function(r,n){let i=this.attrIndex(r);i<0?this.attrPush([r,n]):this.attrs[i][1]=this.attrs[i][1]+" "+n};let e2=e1;function e3(r,n,i){this.src=r,this.env=i,this.tokens=[],this.inlineMode=!1,this.md=n}e3.prototype.Token=e2;let e5=e3,e4=/\r\n?|\n/g,e6=/\0/g;function e8(r){return/^<a[>\s]/i.test(r)}function e9(r){return/^<\/a\s*>/i.test(r)}let e7=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,te=/\((c|tm|r)\)/i,tt=/\((c|tm|r)\)/ig,tr={c:"\xa9",r:"\xae",tm:"™"};function tn(r,n){return tr[n.toLowerCase()]}function ti(r){let n=0;for(let i=r.length-1;i>=0;i--){let s=r[i];"text"!==s.type||n||(s.content=s.content.replace(tt,tn)),"link_open"===s.type&&"auto"===s.info&&n--,"link_close"===s.type&&"auto"===s.info&&n++}}function ts(r){let n=0;for(let i=r.length-1;i>=0;i--){let s=r[i];"text"===s.type&&!n&&e7.test(s.content)&&(s.content=s.content.replace(/\+-/g,"\xb1").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),"link_open"===s.type&&"auto"===s.info&&n--,"link_close"===s.type&&"auto"===s.info&&n++}}let to=/['"]/,tl=/['"]/g,ta="’";function tu(r,n,i,s){r[n]||(r[n]=[]),r[n].push({pos:i,ch:s})}function tc(r,n){let i="",s=0;n.sort((r,n)=>r.pos-n.pos);for(let o=0;o<n.length;o++){let l=n[o];i+=r.slice(s,l.pos)+l.ch,s=l.pos+1}return i+r.slice(s)}function th(r,n){let i,s=[],o={};for(let l=0;l<r.length;l++){let a=r[l],u=r[l].level;for(i=s.length-1;i>=0&&!(s[i].level<=u);i--);if(s.length=i+1,"text"!==a.type)continue;let c=a.content,h=0,d=c.length;r:for(;h<d;){tl.lastIndex=h;let a=tl.exec(c);if(!a)break;let p=!0,f=!0;h=a.index+1;let m="'"===a[0],g=32;if(a.index-1>=0)g=c.charCodeAt(a.index-1);else for(i=l-1;i>=0&&"softbreak"!==r[i].type&&"hardbreak"!==r[i].type;i--)if(r[i].content){g=r[i].content.charCodeAt(r[i].content.length-1);break}let _=32;if(h<d)_=c.charCodeAt(h);else for(i=l+1;i<r.length&&"softbreak"!==r[i].type&&"hardbreak"!==r[i].type;i++)if(r[i].content){_=r[i].content.charCodeAt(0);break}let y=ej(g)||eq(g),k=ej(_)||eq(_),b=e$(g),w=e$(_);if(w?p=!1:k&&!(b||y)&&(p=!1),b?f=!1:y&&!(w||k)&&(f=!1),34===_&&'"'===a[0]&&g>=48&&g<=57&&(f=p=!1),p&&f&&(p=y,f=k),!p&&!f){m&&tu(o,l,a.index,ta);continue}if(f)for(i=s.length-1;i>=0;i--){let r=s[i];if(s[i].level<u)break;if(r.single===m&&s[i].level===u){let u,c;r=s[i],m?(u=n.md.options.quotes[2],c=n.md.options.quotes[3]):(u=n.md.options.quotes[0],c=n.md.options.quotes[1]),tu(o,l,a.index,c),tu(o,r.token,r.pos,u),s.length=i;continue r}}p?s.push({token:l,pos:a.index,single:m,level:u}):f&&m&&tu(o,l,a.index,ta)}}Object.keys(o).forEach(function(n){r[n].content=tc(r[n].content,o[n])})}let td=[["normalize",function(r){let n;n=(n=r.src.replace(e4,"\n")).replace(e6,"�"),r.src=n}],["block",function(r){let n;r.inlineMode?((n=new r.Token("inline","",0)).content=r.src,n.map=[0,1],n.children=[],r.tokens.push(n)):r.md.block.parse(r.src,r.md,r.env,r.tokens)}],["inline",function(r){let n=r.tokens;for(let i=0,s=n.length;i<s;i++){let s=n[i];"inline"===s.type&&r.md.inline.parse(s.content,r.md,r.env,s.children)}}],["linkify",function(r){let n=r.tokens;if(r.md.options.linkify)for(let i=0,s=n.length;i<s;i++){if("inline"!==n[i].type||!r.md.linkify.pretest(n[i].content))continue;let s=n[i].children,o=0;for(let l=s.length-1;l>=0;l--){let a=s[l];if("link_close"===a.type){for(l--;s[l].level!==a.level&&"link_open"!==s[l].type;)l--;continue}if("html_inline"===a.type&&(e8(a.content)&&o>0&&o--,e9(a.content)&&o++),!(o>0)&&"text"===a.type&&r.md.linkify.test(a.content)){let o=a.content,u=r.md.linkify.match(o),c=[],h=a.level,d=0;u.length>0&&0===u[0].index&&l>0&&"text_special"===s[l-1].type&&(u=u.slice(1));for(let n=0;n<u.length;n++){let i=u[n].url,s=r.md.normalizeLink(i);if(!r.md.validateLink(s))continue;let l=u[n].text;l=u[n].schema?"mailto:"!==u[n].schema||/^mailto:/i.test(l)?r.md.normalizeLinkText(l):r.md.normalizeLinkText("mailto:"+l).replace(/^mailto:/,""):r.md.normalizeLinkText("http://"+l).replace(/^http:\/\//,"");let a=u[n].index;if(a>d){let n=new r.Token("text","",0);n.content=o.slice(d,a),n.level=h,c.push(n)}let p=new r.Token("link_open","a",1);p.attrs=[["href",s]],p.level=h++,p.markup="linkify",p.info="auto",c.push(p);let f=new r.Token("text","",0);f.content=l,f.level=h,c.push(f);let m=new r.Token("link_close","a",-1);m.level=--h,m.markup="linkify",m.info="auto",c.push(m),d=u[n].lastIndex}if(d<o.length){let n=new r.Token("text","",0);n.content=o.slice(d),n.level=h,c.push(n)}n[i].children=s=ew(s,l,c)}}}}],["replacements",function(r){let n;if(r.md.options.typographer)for(n=r.tokens.length-1;n>=0;n--)"inline"===r.tokens[n].type&&(te.test(r.tokens[n].content)&&ti(r.tokens[n].children),e7.test(r.tokens[n].content)&&ts(r.tokens[n].children))}],["smartquotes",function(r){if(r.md.options.typographer)for(let n=r.tokens.length-1;n>=0;n--)"inline"===r.tokens[n].type&&to.test(r.tokens[n].content)&&th(r.tokens[n].children,r)}],["text_join",function(r){let n,i,s=r.tokens,o=s.length;for(let r=0;r<o;r++){if("inline"!==s[r].type)continue;let o=s[r].children,l=o.length;for(n=0;n<l;n++)"text_special"===o[n].type&&(o[n].type="text");for(n=i=0;n<l;n++)"text"===o[n].type&&n+1<l&&"text"===o[n+1].type?o[n+1].content=o[n].content+o[n+1].content:(n!==i&&(o[i]=o[n]),i++);n!==i&&(o.length=i)}}]];function tp(){this.ruler=new e0;for(let r=0;r<td.length;r++)this.ruler.push(td[r][0],td[r][1])}tp.prototype.process=function(r){let n=this.ruler.getRules("");for(let i=0,s=n.length;i<s;i++)n[i](r)},tp.prototype.State=e5;let tf=tp;function tm(r,n,i,s){this.src=r,this.md=n,this.env=i,this.tokens=s,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;let o=this.src;for(let r=0,n=0,i=0,s=0,l=o.length,a=!1;n<l;n++){let u=o.charCodeAt(n);if(!a)if(eP(u)){i++,9===u?s+=4-s%4:s++;continue}else a=!0;(10===u||n===l-1)&&(10!==u&&n++,this.bMarks.push(r),this.eMarks.push(n),this.tShift.push(i),this.sCount.push(s),this.bsCount.push(0),a=!1,i=0,s=0,r=n+1)}this.bMarks.push(o.length),this.eMarks.push(o.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}tm.prototype.push=function(r,n,i){let s=new e2(r,n,i);return s.block=!0,i<0&&this.level--,s.level=this.level,i>0&&this.level++,this.tokens.push(s),s},tm.prototype.isEmpty=function(r){return this.bMarks[r]+this.tShift[r]>=this.eMarks[r]},tm.prototype.skipEmptyLines=function(r){for(let n=this.lineMax;r<n&&!(this.bMarks[r]+this.tShift[r]<this.eMarks[r]);r++);return r},tm.prototype.skipSpaces=function(r){for(let n=this.src.length;r<n&&eP(this.src.charCodeAt(r));r++);return r},tm.prototype.skipSpacesBack=function(r,n){if(r<=n)return r;for(;r>n;)if(!eP(this.src.charCodeAt(--r)))return r+1;return r},tm.prototype.skipChars=function(r,n){for(let i=this.src.length;r<i&&this.src.charCodeAt(r)===n;r++);return r},tm.prototype.skipCharsBack=function(r,n,i){if(r<=i)return r;for(;r>i;)if(n!==this.src.charCodeAt(--r))return r+1;return r},tm.prototype.getLines=function(r,n,i,s){if(r>=n)return"";let o=Array(n-r);for(let l=0,a=r;a<n;a++,l++){let r,u=0,c=this.bMarks[a],h=c;for(r=a+1<n||s?this.eMarks[a]+1:this.eMarks[a];h<r&&u<i;){let r=this.src.charCodeAt(h);if(eP(r))9===r?u+=4-(u+this.bsCount[a])%4:u++;else if(h-c<this.tShift[a])u++;else break;h++}u>i?o[l]=Array(u-i+1).join(" ")+this.src.slice(h,r):o[l]=this.src.slice(h,r)}return o.join("")},tm.prototype.Token=e2;let tg=tm,t_=65536;function ty(r,n){let i=r.bMarks[n]+r.tShift[n],s=r.eMarks[n];return r.src.slice(i,s)}function tk(r){let n=[],i=r.length,s=0,o=r.charCodeAt(s),l=!1,a=0,u="";for(;s<i;)124===o&&(l?(u+=r.substring(a,s-1),a=s):(n.push(u+r.substring(a,s)),u="",a=s+1)),l=92===o,s++,o=r.charCodeAt(s);return n.push(u+r.substring(a)),n}function tb(r,n,i,s){let o;if(n+2>i)return!1;let l=n+1;if(r.sCount[l]<r.blkIndent||r.sCount[l]-r.blkIndent>=4)return!1;let a=r.bMarks[l]+r.tShift[l];if(a>=r.eMarks[l])return!1;let u=r.src.charCodeAt(a++);if(124!==u&&45!==u&&58!==u||a>=r.eMarks[l])return!1;let c=r.src.charCodeAt(a++);if(124!==c&&45!==c&&58!==c&&!eP(c)||45===u&&eP(c))return!1;for(;a<r.eMarks[l];){let n=r.src.charCodeAt(a);if(124!==n&&45!==n&&58!==n&&!eP(n))return!1;a++}let h=ty(r,n+1),d=h.split("|"),p=[];for(let r=0;r<d.length;r++){let n=d[r].trim();if(!n)if(0===r||r===d.length-1)continue;else return!1;if(!/^:?-+:?$/.test(n))return!1;58===n.charCodeAt(n.length-1)?p.push(58===n.charCodeAt(0)?"center":"right"):58===n.charCodeAt(0)?p.push("left"):p.push("")}if(-1===(h=ty(r,n).trim()).indexOf("|")||r.sCount[n]-r.blkIndent>=4)return!1;(d=tk(h)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop();let f=d.length;if(0===f||f!==p.length)return!1;if(s)return!0;let m=r.parentType;r.parentType="table";let g=r.md.block.ruler.getRules("blockquote"),_=r.push("table_open","table",1),y=[n,0];_.map=y,r.push("thead_open","thead",1).map=[n,n+1],r.push("tr_open","tr",1).map=[n,n+1];for(let n=0;n<d.length;n++){let i=r.push("th_open","th",1);p[n]&&(i.attrs=[["style","text-align:"+p[n]]]);let s=r.push("inline","",0);s.content=d[n].trim(),s.children=[],r.push("th_close","th",-1)}r.push("tr_close","tr",-1),r.push("thead_close","thead",-1);let k=0;for(l=n+2;l<i&&!(r.sCount[l]<r.blkIndent);l++){let s=!1;for(let n=0,o=g.length;n<o;n++)if(g[n](r,l,i,!0)){s=!0;break}if(s||!(h=ty(r,l).trim())||r.sCount[l]-r.blkIndent>=4||((d=tk(h)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),(k+=f-d.length)>t_))break;l===n+2&&(r.push("tbody_open","tbody",1).map=o=[n+2,0]),r.push("tr_open","tr",1).map=[l,l+1];for(let n=0;n<f;n++){let i=r.push("td_open","td",1);p[n]&&(i.attrs=[["style","text-align:"+p[n]]]);let s=r.push("inline","",0);s.content=d[n]?d[n].trim():"",s.children=[],r.push("td_close","td",-1)}r.push("tr_close","tr",-1)}return o&&(r.push("tbody_close","tbody",-1),o[1]=l),r.push("table_close","table",-1),y[1]=l,r.parentType=m,r.line=l,!0}function tw(r,n,i){if(r.sCount[n]-r.blkIndent<4)return!1;let s=n+1,o=s;for(;s<i;){if(r.isEmpty(s)){s++;continue}if(r.sCount[s]-r.blkIndent>=4){o=++s;continue}break}r.line=o;let l=r.push("code_block","code",0);return l.content=r.getLines(n,o,4+r.blkIndent,!1)+"\n",l.map=[n,r.line],!0}function tx(r,n,i,s){let o=r.bMarks[n]+r.tShift[n],l=r.eMarks[n];if(r.sCount[n]-r.blkIndent>=4||o+3>l)return!1;let a=r.src.charCodeAt(o);if(126!==a&&96!==a)return!1;let u=o,c=(o=r.skipChars(o,a))-u;if(c<3)return!1;let h=r.src.slice(u,o),d=r.src.slice(o,l);if(96===a&&d.indexOf(String.fromCharCode(a))>=0)return!1;if(s)return!0;let p=n,f=!1;for(;!(++p>=i)&&(!((o=u=r.bMarks[p]+r.tShift[p])<(l=r.eMarks[p]))||!(r.sCount[p]<r.blkIndent));){;if(!(r.src.charCodeAt(o)!==a||r.sCount[p]-r.blkIndent>=4||(o=r.skipChars(o,a))-u<c)&&!((o=r.skipSpaces(o))<l)){f=!0;break}}c=r.sCount[n],r.line=p+ +!!f;let m=r.push("fence","code",0);return m.info=d,m.content=r.getLines(n+1,p,c,!0),m.markup=h,m.map=[n,r.line],!0}function tv(r,n,i,s){let o,l=r.bMarks[n]+r.tShift[n],a=r.eMarks[n],u=r.lineMax;if(r.sCount[n]-r.blkIndent>=4||62!==r.src.charCodeAt(l))return!1;if(s)return!0;let c=[],h=[],d=[],p=[],f=r.md.block.ruler.getRules("blockquote"),m=r.parentType;r.parentType="blockquote";let g=!1;for(o=n;o<i;o++){let n=r.sCount[o]<r.blkIndent;if((l=r.bMarks[o]+r.tShift[o])>=(a=r.eMarks[o]))break;if(62===r.src.charCodeAt(l++)&&!n){let n,i,s=r.sCount[o]+1;32===r.src.charCodeAt(l)?(l++,s++,i=!1,n=!0):9===r.src.charCodeAt(l)?(n=!0,(r.bsCount[o]+s)%4==3?(l++,s++,i=!1):i=!0):n=!1;let u=s;for(c.push(r.bMarks[o]),r.bMarks[o]=l;l<a;){let n=r.src.charCodeAt(l);if(eP(n))9===n?u+=4-(u+r.bsCount[o]+ +!!i)%4:u++;else break;l++}g=l>=a,h.push(r.bsCount[o]),r.bsCount[o]=r.sCount[o]+1+ +!!n,d.push(r.sCount[o]),r.sCount[o]=u-s,p.push(r.tShift[o]),r.tShift[o]=l-r.bMarks[o];continue}if(g)break;let s=!1;for(let n=0,l=f.length;n<l;n++)if(f[n](r,o,i,!0)){s=!0;break}if(s){r.lineMax=o,0!==r.blkIndent&&(c.push(r.bMarks[o]),h.push(r.bsCount[o]),p.push(r.tShift[o]),d.push(r.sCount[o]),r.sCount[o]-=r.blkIndent);break}c.push(r.bMarks[o]),h.push(r.bsCount[o]),p.push(r.tShift[o]),d.push(r.sCount[o]),r.sCount[o]=-1}let _=r.blkIndent;r.blkIndent=0;let y=r.push("blockquote_open","blockquote",1);y.markup=">";let k=[n,0];y.map=k,r.md.block.tokenize(r,n,o),r.push("blockquote_close","blockquote",-1).markup=">",r.lineMax=u,r.parentType=m,k[1]=r.line;for(let i=0;i<p.length;i++)r.bMarks[i+n]=c[i],r.tShift[i+n]=p[i],r.sCount[i+n]=d[i],r.bsCount[i+n]=h[i];return r.blkIndent=_,!0}function tC(r,n,i,s){let o=r.eMarks[n];if(r.sCount[n]-r.blkIndent>=4)return!1;let l=r.bMarks[n]+r.tShift[n],a=r.src.charCodeAt(l++);if(42!==a&&45!==a&&95!==a)return!1;let u=1;for(;l<o;){let n=r.src.charCodeAt(l++);if(n!==a&&!eP(n))return!1;n===a&&u++}if(u<3)return!1;if(s)return!0;r.line=n+1;let c=r.push("hr","hr",0);return c.map=[n,r.line],c.markup=Array(u+1).join(String.fromCharCode(a)),!0}function tA(r,n){let i=r.eMarks[n],s=r.bMarks[n]+r.tShift[n],o=r.src.charCodeAt(s++);return 42!==o&&45!==o&&43!==o||s<i&&!eP(r.src.charCodeAt(s))?-1:s}function tE(r,n){let i=r.bMarks[n]+r.tShift[n],s=r.eMarks[n],o=i;if(o+1>=s)return -1;let l=r.src.charCodeAt(o++);if(l<48||l>57)return -1;for(;;){if(o>=s)return -1;if((l=r.src.charCodeAt(o++))>=48&&l<=57){if(o-i>=10)return -1;continue}if(41===l||46===l)break;return -1}return o<s&&!eP(l=r.src.charCodeAt(o))?-1:o}function tS(r,n){let i=r.level+2;for(let s=n+2,o=r.tokens.length-2;s<o;s++)r.tokens[s].level===i&&"paragraph_open"===r.tokens[s].type&&(r.tokens[s+2].hidden=!0,r.tokens[s].hidden=!0,s+=2)}function tM(r,n,i,s){let o,l,a,u,c,h,d,p=n,f=!0;if(r.sCount[p]-r.blkIndent>=4||r.listIndent>=0&&r.sCount[p]-r.listIndent>=4&&r.sCount[p]<r.blkIndent)return!1;let m=!1;if(s&&"paragraph"===r.parentType&&r.sCount[p]>=r.blkIndent&&(m=!0),(d=tE(r,p))>=0){if(c=!0,a=r.bMarks[p]+r.tShift[p],h=Number(r.src.slice(a,d-1)),m&&1!==h)return!1}else{if(!((d=tA(r,p))>=0))return!1;c=!1}if(m&&r.skipSpaces(d)>=r.eMarks[p])return!1;if(s)return!0;let g=r.src.charCodeAt(d-1),_=r.tokens.length;c?(u=r.push("ordered_list_open","ol",1),1!==h&&(u.attrs=[["start",h]])):u=r.push("bullet_list_open","ul",1);let y=[p,0];u.map=y,u.markup=String.fromCharCode(g);let k=!1,b=r.md.block.ruler.getRules("list"),w=r.parentType;for(r.parentType="list";p<i;){let n;l=d,o=r.eMarks[p];let s=r.sCount[p]+d-(r.bMarks[p]+r.tShift[p]),h=s;for(;l<o;){let n=r.src.charCodeAt(l);if(9===n)h+=4-(h+r.bsCount[p])%4;else if(32===n)h++;else break;l++}let m=l;(n=m>=o?1:h-s)>4&&(n=1);let _=s+n;(u=r.push("list_item_open","li",1)).markup=String.fromCharCode(g);let y=[p,0];u.map=y,c&&(u.info=r.src.slice(a,d-1));let w=r.tight,x=r.tShift[p],v=r.sCount[p],C=r.listIndent;if(r.listIndent=r.blkIndent,r.blkIndent=_,r.tight=!0,r.tShift[p]=m-r.bMarks[p],r.sCount[p]=h,m>=o&&r.isEmpty(p+1)?r.line=Math.min(r.line+2,i):r.md.block.tokenize(r,p,i,!0),(!r.tight||k)&&(f=!1),k=r.line-p>1&&r.isEmpty(r.line-1),r.blkIndent=r.listIndent,r.listIndent=C,r.tShift[p]=x,r.sCount[p]=v,r.tight=w,(u=r.push("list_item_close","li",-1)).markup=String.fromCharCode(g),p=r.line,y[1]=p,p>=i||r.sCount[p]<r.blkIndent||r.sCount[p]-r.blkIndent>=4)break;let A=!1;for(let n=0,s=b.length;n<s;n++)if(b[n](r,p,i,!0)){A=!0;break}if(A)break;if(c){if((d=tE(r,p))<0)break;a=r.bMarks[p]+r.tShift[p]}else if((d=tA(r,p))<0)break;if(g!==r.src.charCodeAt(d-1))break}return(u=c?r.push("ordered_list_close","ol",-1):r.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(g),y[1]=p,r.line=p,r.parentType=w,f&&tS(r,_),!0}function tT(r,n,i,s){let o,l=r.bMarks[n]+r.tShift[n],a=r.eMarks[n],u=n+1;if(r.sCount[n]-r.blkIndent>=4||91!==r.src.charCodeAt(l))return!1;function c(n){let i=r.lineMax;if(n>=i||r.isEmpty(n))return null;let s=!1;if(r.sCount[n]-r.blkIndent>3&&(s=!0),r.sCount[n]<0&&(s=!0),!s){let s=r.md.block.ruler.getRules("reference"),o=r.parentType;r.parentType="reference";let l=!1;for(let o=0,a=s.length;o<a;o++)if(s[o](r,n,i,!0)){l=!0;break}if(r.parentType=o,l)return null}let o=r.bMarks[n]+r.tShift[n],l=r.eMarks[n];return r.src.slice(o,l+1)}let h=r.src.slice(l,a+1);a=h.length;let d=-1;for(l=1;l<a;l++){let r=h.charCodeAt(l);if(91===r)return!1;if(93===r){d=l;break}if(10===r){let r=c(u);null!==r&&(h+=r,a=h.length,u++)}else if(92===r&&++l<a&&10===h.charCodeAt(l)){let r=c(u);null!==r&&(h+=r,a=h.length,u++)}}if(d<0||58!==h.charCodeAt(d+1))return!1;for(l=d+2;l<a;l++){let r=h.charCodeAt(l);if(10===r){let r=c(u);null!==r&&(h+=r,a=h.length,u++)}else if(eP(r));else break}let p=r.md.helpers.parseLinkDestination(h,l,a);if(!p.ok)return!1;let f=r.md.normalizeLink(p.str);if(!r.md.validateLink(f))return!1;let m=l=p.pos,g=u,_=l;for(;l<a;l++){let r=h.charCodeAt(l);if(10===r){let r=c(u);null!==r&&(h+=r,a=h.length,u++)}else if(eP(r));else break}let y=r.md.helpers.parseLinkTitle(h,l,a);for(;y.can_continue;){let n=c(u);if(null===n)break;h+=n,l=a,a=h.length,u++,y=r.md.helpers.parseLinkTitle(h,l,a,y)}for(l<a&&_!==l&&y.ok?(o=y.str,l=y.pos):(o="",l=m,u=g);l<a&&eP(h.charCodeAt(l));)l++;if(l<a&&10!==h.charCodeAt(l)&&o)for(o="",l=m,u=g;l<a&&eP(h.charCodeAt(l));)l++;if(l<a&&10!==h.charCodeAt(l))return!1;let k=eH(h.slice(1,d));return!!k&&(!!s||(void 0===r.env.references&&(r.env.references={}),void 0===r.env.references[k]&&(r.env.references[k]={title:o,href:f}),r.line=u,!0))}let tD=["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"],tF="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",tI="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",tL=RegExp("^(?:"+tF+"|"+tI+"|\x3c!---?>|\x3c!--(?:[^-]|-[^-]|--[^>])*--\x3e|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),tR=RegExp("^(?:"+tF+"|"+tI+")"),tN=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp("^</?("+tD.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[RegExp(tR.source+"\\s*$"),/^$/,!1]],tO=[["table",tb,["paragraph","reference"]],["code",tw],["fence",tx,["paragraph","reference","blockquote","list"]],["blockquote",tv,["paragraph","reference","blockquote","list"]],["hr",tC,["paragraph","reference","blockquote","list"]],["list",tM,["paragraph","reference","blockquote"]],["reference",tT],["html_block",function(r,n,i,s){let o=r.bMarks[n]+r.tShift[n],l=r.eMarks[n];if(r.sCount[n]-r.blkIndent>=4||!r.md.options.html||60!==r.src.charCodeAt(o))return!1;let a=r.src.slice(o,l),u=0;for(;u<tN.length&&!tN[u][0].test(a);u++);if(u===tN.length)return!1;if(s)return tN[u][2];let c=n+1,h=tN[u][1].test("");if(!tN[u][1].test(a)){for(;c<i&&(!(r.sCount[c]<r.blkIndent)||!h&&r.isEmpty(c));c++)if(o=r.bMarks[c]+r.tShift[c],l=r.eMarks[c],a=r.src.slice(o,l),tN[u][1].test(a)){0!==a.length&&c++;break}}r.line=c;let d=r.push("html_block","",0);return d.map=[n,c],d.content=r.getLines(n,c,r.blkIndent,!0),!0},["paragraph","reference","blockquote"]],["heading",function(r,n,i,s){let o=r.bMarks[n]+r.tShift[n],l=r.eMarks[n];if(r.sCount[n]-r.blkIndent>=4)return!1;let a=r.src.charCodeAt(o);if(35!==a||o>=l)return!1;let u=1;for(a=r.src.charCodeAt(++o);35===a&&o<l&&u<=6;)u++,a=r.src.charCodeAt(++o);if(u>6||o<l&&!eP(a))return!1;if(s)return!0;l=r.skipSpacesBack(l,o);let c=r.skipCharsBack(l,35,o);c>o&&eP(r.src.charCodeAt(c-1))&&(l=c),r.line=n+1;let h=r.push("heading_open","h"+String(u),1);h.markup="########".slice(0,u),h.map=[n,r.line];let d=r.push("inline","",0);return d.content=eU(r.src.slice(o,l)),d.map=[n,r.line],d.children=[],r.push("heading_close","h"+String(u),-1).markup="########".slice(0,u),!0},["paragraph","reference","blockquote"]],["lheading",function(r,n,i){let s,o=r.md.block.ruler.getRules("paragraph");if(r.sCount[n]-r.blkIndent>=4)return!1;let l=r.parentType;r.parentType="paragraph";let a=0,u=n+1;for(;u<i&&!r.isEmpty(u);u++){if(r.sCount[u]-r.blkIndent>3)continue;if(r.sCount[u]>=r.blkIndent){let n=r.bMarks[u]+r.tShift[u],i=r.eMarks[u];if(n<i&&(45===(s=r.src.charCodeAt(n))||61===s)&&(n=r.skipChars(n,s),(n=r.skipSpaces(n))>=i)){a=61===s?1:2;break}}if(r.sCount[u]<0)continue;let n=!1;for(let s=0,l=o.length;s<l;s++)if(o[s](r,u,i,!0)){n=!0;break}if(n)break}if(!a)return r.parentType=l,!1;let c=eU(r.getLines(n,u,r.blkIndent,!1));r.line=u+1;let h=r.push("heading_open","h"+String(a),1);h.markup=String.fromCharCode(s),h.map=[n,r.line];let d=r.push("inline","",0);return d.content=c,d.map=[n,r.line-1],d.children=[],r.push("heading_close","h"+String(a),-1).markup=String.fromCharCode(s),r.parentType=l,!0}],["paragraph",function(r,n,i){let s=r.md.block.ruler.getRules("paragraph"),o=r.parentType,l=n+1;for(r.parentType="paragraph";l<i&&!r.isEmpty(l);l++){if(r.sCount[l]-r.blkIndent>3||r.sCount[l]<0)continue;let n=!1;for(let o=0,a=s.length;o<a;o++)if(s[o](r,l,i,!0)){n=!0;break}if(n)break}let a=eU(r.getLines(n,l,r.blkIndent,!1));r.line=l,r.push("paragraph_open","p",1).map=[n,r.line];let u=r.push("inline","",0);return u.content=a,u.map=[n,r.line],u.children=[],r.push("paragraph_close","p",-1),r.parentType=o,!0}]];function tz(){this.ruler=new e0;for(let r=0;r<tO.length;r++)this.ruler.push(tO[r][0],tO[r][1],{alt:(tO[r][2]||[]).slice()})}tz.prototype.tokenize=function(r,n,i){let s=this.ruler.getRules(""),o=s.length,l=r.md.options.maxNesting,a=n,u=!1;for(;a<i&&(r.line=a=r.skipEmptyLines(a),!(a>=i)&&!(r.sCount[a]<r.blkIndent));){if(r.level>=l){r.line=i;break}let n=r.line,c=!1;for(let l=0;l<o;l++)if(c=s[l](r,a,i,!1)){if(n>=r.line)throw Error("block rule didn't increment state.line");break}if(!c)throw Error("none of the block rules matched");r.tight=!u,r.isEmpty(r.line-1)&&(u=!0),(a=r.line)<i&&r.isEmpty(a)&&(u=!0,r.line=++a)}},tz.prototype.parse=function(r,n,i,s){if(!r)return;let o=new this.State(r,n,i,s);this.tokenize(o,o.line,o.lineMax)},tz.prototype.State=tg;let tP=tz;function t$(r,n,i,s){this.src=r,this.env=i,this.md=n,this.tokens=s,this.tokens_meta=Array(s.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}t$.prototype.pushPending=function(){let r=new e2("text","",0);return r.content=this.pending,r.level=this.pendingLevel,this.tokens.push(r),this.pending="",r},t$.prototype.push=function(r,n,i){this.pending&&this.pushPending();let s=new e2(r,n,i),o=null;return i<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),s.level=this.level,i>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(s),this.tokens_meta.push(o),s},t$.prototype.scanDelims=function(r,n){let i,s=this.posMax,o=this.src.charCodeAt(r);if(0===r)i=32;else if(1===r)(63488&(i=this.src.charCodeAt(0)))==55296&&(i=65533);else if((64512&(i=this.src.charCodeAt(r-1)))==56320){let n=this.src.charCodeAt(r-2);i=(64512&n)==55296?65536+(n-55296<<10)+(i-56320):65533}else(64512&i)==55296&&(i=65533);let l=r;for(;l<s&&this.src.charCodeAt(l)===o;)l++;let a=l-r,u=l<s?this.src.charCodeAt(l):32;if((64512&u)==55296){let r=this.src.charCodeAt(l+1);u=(64512&r)==56320?65536+(u-55296<<10)+(r-56320):65533}else(64512&u)==56320&&(u=65533);let c=ej(i)||eq(i),h=ej(u)||eq(u),d=e$(i),p=e$(u),f=!p&&(!h||d||c),m=!d&&(!c||p||h);return{can_open:f&&(n||!m||c),can_close:m&&(n||!f||h),length:a}},t$.prototype.Token=e2;let tB=t$;function tq(r){switch(r){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function tj(r,n){let i=r.pos;for(;i<r.posMax&&!tq(r.src.charCodeAt(i));)i++;return i!==r.pos&&(n||(r.pending+=r.src.slice(r.pos,i)),r.pos=i,!0)}let tH=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function tV(r,n){if(!r.md.options.linkify||r.linkLevel>0)return!1;let i=r.pos;if(i+3>r.posMax||58!==r.src.charCodeAt(i)||47!==r.src.charCodeAt(i+1)||47!==r.src.charCodeAt(i+2))return!1;let s=r.pending.match(tH);if(!s)return!1;let o=s[1],l=r.md.linkify.matchAtStart(r.src.slice(i-o.length));if(!l)return!1;let a=l.url;if(a.length<=o.length)return!1;let u=a.length;for(;u>0&&42===a.charCodeAt(u-1);)u--;u!==a.length&&(a=a.slice(0,u));let c=r.md.normalizeLink(a);if(!r.md.validateLink(c))return!1;if(!n){r.pending=r.pending.slice(0,-o.length);let n=r.push("link_open","a",1);n.attrs=[["href",c]],n.markup="linkify",n.info="auto",r.push("text","",0).content=r.md.normalizeLinkText(a);let i=r.push("link_close","a",-1);i.markup="linkify",i.info="auto"}return r.pos+=a.length-o.length,!0}function tU(r,n){let i=r.pos;if(10!==r.src.charCodeAt(i))return!1;let s=r.pending.length-1,o=r.posMax;if(!n)if(s>=0&&32===r.pending.charCodeAt(s))if(s>=1&&32===r.pending.charCodeAt(s-1)){let n=s-1;for(;n>=1&&32===r.pending.charCodeAt(n-1);)n--;r.pending=r.pending.slice(0,n),r.push("hardbreak","br",0)}else r.pending=r.pending.slice(0,-1),r.push("softbreak","br",0);else r.push("softbreak","br",0);for(i++;i<o&&eP(r.src.charCodeAt(i));)i++;return r.pos=i,!0}let tW=[];for(let r=0;r<256;r++)tW.push(0);function tJ(r,n){let i,s=[],o=n.length;for(let l=0;l<o;l++){let o=n[l];if(126!==o.marker||-1===o.end)continue;let a=n[o.end];(i=r.tokens[o.token]).type="s_open",i.tag="s",i.nesting=1,i.markup="~~",i.content="",(i=r.tokens[a.token]).type="s_close",i.tag="s",i.nesting=-1,i.markup="~~",i.content="","text"===r.tokens[a.token-1].type&&"~"===r.tokens[a.token-1].content&&s.push(a.token-1)}for(;s.length;){let n=s.pop(),o=n+1;for(;o<r.tokens.length&&"s_close"===r.tokens[o].type;)o++;n!==--o&&(i=r.tokens[o],r.tokens[o]=r.tokens[n],r.tokens[n]=i)}}function tK(r,n){let i=n.length;for(let s=i-1;s>=0;s--){let i=n[s];if(95!==i.marker&&42!==i.marker||-1===i.end)continue;let o=n[i.end],l=s>0&&n[s-1].end===i.end+1&&n[s-1].marker===i.marker&&n[s-1].token===i.token-1&&n[i.end+1].token===o.token+1,a=String.fromCharCode(i.marker),u=r.tokens[i.token];u.type=l?"strong_open":"em_open",u.tag=l?"strong":"em",u.nesting=1,u.markup=l?a+a:a,u.content="";let c=r.tokens[o.token];c.type=l?"strong_close":"em_close",c.tag=l?"strong":"em",c.nesting=-1,c.markup=l?a+a:a,c.content="",l&&(r.tokens[n[s-1].token].content="",r.tokens[n[i.end+1].token].content="",s--)}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(r){tW[r.charCodeAt(0)]=1});let tG=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,tZ=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function tX(r){return/^<a[>\s]/i.test(r)}function tY(r){return/^<\/a\s*>/i.test(r)}function tQ(r){let n=32|r;return n>=97&&n<=122}let t0=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,t1=/^&([a-z][a-z0-9]{1,31});/i;function t2(r){let n={},i=r.length;if(!i)return;let s=0,o=-2,l=[];for(let a=0;a<i;a++){let i=r[a];if(l.push(0),(r[s].marker!==i.marker||o!==i.token-1)&&(s=a),o=i.token,i.length=i.length||0,!i.close)continue;n.hasOwnProperty(i.marker)||(n[i.marker]=[-1,-1,-1,-1,-1,-1]);let u=n[i.marker][3*!!i.open+i.length%3],c=s-l[s]-1,h=c;for(;c>u;c-=l[c]+1){let n=r[c];if(n.marker===i.marker&&n.open&&n.end<0){let s=!1;if((n.close||i.open)&&(n.length+i.length)%3==0&&(n.length%3!=0||i.length%3!=0)&&(s=!0),!s){let s=c>0&&!r[c-1].open?l[c-1]+1:0;l[a]=a-c+s,l[c]=s,i.open=!1,n.end=a,n.close=!1,h=-1,o=-2;break}}}-1!==h&&(n[i.marker][3*!!i.open+(i.length||0)%3]=h)}}let t3=[["text",tj],["linkify",tV],["newline",tU],["escape",function(r,n){let i=r.pos,s=r.posMax;if(92!==r.src.charCodeAt(i)||++i>=s)return!1;let o=r.src.charCodeAt(i);if(10===o){for(n||r.push("hardbreak","br",0),i++;i<s&&eP(o=r.src.charCodeAt(i));)i++;return r.pos=i,!0}let l=r.src[i];if(o>=55296&&o<=56319&&i+1<s){let n=r.src.charCodeAt(i+1);n>=56320&&n<=57343&&(l+=r.src[i+1],i++)}let a="\\"+l;if(!n){let n=r.push("text_special","",0);o<256&&0!==tW[o]?n.content=l:n.content=a,n.markup=a,n.info="escape"}return r.pos=i+1,!0}],["backticks",function(r,n){let i,s=r.pos;if(96!==r.src.charCodeAt(s))return!1;let o=s;s++;let l=r.posMax;for(;s<l&&96===r.src.charCodeAt(s);)s++;let a=r.src.slice(o,s),u=a.length;if(r.backticksScanned&&(r.backticks[u]||0)<=o)return n||(r.pending+=a),r.pos+=u,!0;let c=s;for(;-1!==(i=r.src.indexOf("`",c));){for(c=i+1;c<l&&96===r.src.charCodeAt(c);)c++;let o=c-i;if(o===u){if(!n){let n=r.push("code_inline","code",0);n.markup=a,n.content=r.src.slice(s,i).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return r.pos=c,!0}r.backticks[o]=i}return r.backticksScanned=!0,n||(r.pending+=a),r.pos+=u,!0}],["strikethrough",function(r,n){let i,s=r.pos,o=r.src.charCodeAt(s);if(n||126!==o)return!1;let l=r.scanDelims(r.pos,!0),a=l.length,u=String.fromCharCode(o);if(a<2)return!1;a%2&&((i=r.push("text","",0)).content=u,a--);for(let n=0;n<a;n+=2)(i=r.push("text","",0)).content=u+u,r.delimiters.push({marker:o,length:0,token:r.tokens.length-1,end:-1,open:l.can_open,close:l.can_close});return r.pos+=l.length,!0}],["emphasis",function(r,n){let i=r.pos,s=r.src.charCodeAt(i);if(n||95!==s&&42!==s)return!1;let o=r.scanDelims(r.pos,42===s);for(let n=0;n<o.length;n++)r.push("text","",0).content=String.fromCharCode(s),r.delimiters.push({marker:s,length:o.length,token:r.tokens.length-1,end:-1,open:o.can_open,close:o.can_close});return r.pos+=o.length,!0}],["link",function r(r,n){let i,s,o,l,a="",u="",c=r.pos,h=!0;if(91!==r.src.charCodeAt(r.pos))return!1;let d=r.pos,p=r.posMax,f=r.pos+1,m=r.md.helpers.parseLinkLabel(r,r.pos,!0);if(m<0)return!1;let g=m+1;if(g<p&&40===r.src.charCodeAt(g)){for(h=!1,g++;g<p&&(eP(i=r.src.charCodeAt(g))||10===i);g++);if(g>=p)return!1;if(c=g,(o=r.md.helpers.parseLinkDestination(r.src,g,r.posMax)).ok){for(a=r.md.normalizeLink(o.str),r.md.validateLink(a)?g=o.pos:a="",c=g;g<p&&(eP(i=r.src.charCodeAt(g))||10===i);g++);if(o=r.md.helpers.parseLinkTitle(r.src,g,r.posMax),g<p&&c!==g&&o.ok)for(u=o.str,g=o.pos;g<p&&(eP(i=r.src.charCodeAt(g))||10===i);g++);}(g>=p||41!==r.src.charCodeAt(g))&&(h=!0),g++}if(h){if(void 0===r.env.references)return!1;if(g<p&&91===r.src.charCodeAt(g)?(c=g+1,(g=r.md.helpers.parseLinkLabel(r,g))>=0?s=r.src.slice(c,g++):g=m+1):g=m+1,s||(s=r.src.slice(f,m)),!(l=r.env.references[eH(s)]))return r.pos=d,!1;a=l.href,u=l.title}if(!n){r.pos=f,r.posMax=m;let n=r.push("link_open","a",1),i=[["href",a]];n.attrs=i,u&&i.push(["title",u]),r.linkLevel++,r.md.inline.tokenize(r),r.linkLevel--,r.push("link_close","a",-1)}return r.pos=g,r.posMax=p,!0}],["image",function r(r,n){let i,s,o,l,a,u,c,h,d="",p=r.pos,f=r.posMax;if(33!==r.src.charCodeAt(r.pos)||91!==r.src.charCodeAt(r.pos+1))return!1;let m=r.pos+2,g=r.md.helpers.parseLinkLabel(r,r.pos+1,!1);if(g<0)return!1;if((l=g+1)<f&&40===r.src.charCodeAt(l)){for(l++;l<f&&(eP(i=r.src.charCodeAt(l))||10===i);l++);if(l>=f)return!1;for(h=l,(u=r.md.helpers.parseLinkDestination(r.src,l,r.posMax)).ok&&(d=r.md.normalizeLink(u.str),r.md.validateLink(d)?l=u.pos:d=""),h=l;l<f&&(eP(i=r.src.charCodeAt(l))||10===i);l++);if(u=r.md.helpers.parseLinkTitle(r.src,l,r.posMax),l<f&&h!==l&&u.ok)for(c=u.str,l=u.pos;l<f&&(eP(i=r.src.charCodeAt(l))||10===i);l++);else c="";if(l>=f||41!==r.src.charCodeAt(l))return r.pos=p,!1;l++}else{if(void 0===r.env.references)return!1;if(l<f&&91===r.src.charCodeAt(l)?(h=l+1,(l=r.md.helpers.parseLinkLabel(r,l))>=0?o=r.src.slice(h,l++):l=g+1):l=g+1,o||(o=r.src.slice(m,g)),!(a=r.env.references[eH(o)]))return r.pos=p,!1;d=a.href,c=a.title}if(!n){s=r.src.slice(m,g);let n=[];r.md.inline.parse(s,r.md,r.env,n);let i=r.push("image","img",0),o=[["src",d],["alt",""]];i.attrs=o,i.children=n,i.content=s,c&&o.push(["title",c])}return r.pos=l,r.posMax=f,!0}],["autolink",function r(r,n){let i=r.pos;if(60!==r.src.charCodeAt(i))return!1;let s=r.pos,o=r.posMax;for(;;){if(++i>=o)return!1;let n=r.src.charCodeAt(i);if(60===n)return!1;if(62===n)break}let l=r.src.slice(s+1,i);if(tZ.test(l)){let i=r.md.normalizeLink(l);if(!r.md.validateLink(i))return!1;if(!n){let n=r.push("link_open","a",1);n.attrs=[["href",i]],n.markup="autolink",n.info="auto",r.push("text","",0).content=r.md.normalizeLinkText(l);let s=r.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return r.pos+=l.length+2,!0}if(tG.test(l)){let i=r.md.normalizeLink("mailto:"+l);if(!r.md.validateLink(i))return!1;if(!n){let n=r.push("link_open","a",1);n.attrs=[["href",i]],n.markup="autolink",n.info="auto",r.push("text","",0).content=r.md.normalizeLinkText(l);let s=r.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return r.pos+=l.length+2,!0}return!1}],["html_inline",function r(r,n){if(!r.md.options.html)return!1;let i=r.posMax,s=r.pos;if(60!==r.src.charCodeAt(s)||s+2>=i)return!1;let o=r.src.charCodeAt(s+1);if(33!==o&&63!==o&&47!==o&&!tQ(o))return!1;let l=r.src.slice(s).match(tL);if(!l)return!1;if(!n){let n=r.push("html_inline","",0);n.content=l[0],tX(n.content)&&r.linkLevel++,tY(n.content)&&r.linkLevel--}return r.pos+=l[0].length,!0}],["entity",function r(r,n){let i=r.pos,s=r.posMax;if(38!==r.src.charCodeAt(i)||i+1>=s)return!1;if(35===r.src.charCodeAt(i+1)){let s=r.src.slice(i).match(t0);if(s){if(!n){let n="x"===s[1][0].toLowerCase()?parseInt(s[1].slice(1),16):parseInt(s[1],10),i=r.push("text_special","",0);i.content=ex(n)?ev(n):ev(65533),i.markup=s[0],i.info="entity"}return r.pos+=s[0].length,!0}}else{let s=r.src.slice(i).match(t1);if(s){let i=ep(s[0]);if(i!==s[0]){if(!n){let n=r.push("text_special","",0);n.content=i,n.markup=s[0],n.info="entity"}return r.pos+=s[0].length,!0}}}return!1}]],t5=[["balance_pairs",function r(r){let n=r.tokens_meta,i=r.tokens_meta.length;t2(r.delimiters);for(let r=0;r<i;r++)n[r]&&n[r].delimiters&&t2(n[r].delimiters)}],["strikethrough",function(r){let n=r.tokens_meta,i=r.tokens_meta.length;tJ(r,r.delimiters);for(let s=0;s<i;s++)n[s]&&n[s].delimiters&&tJ(r,n[s].delimiters)}],["emphasis",function(r){let n=r.tokens_meta,i=r.tokens_meta.length;tK(r,r.delimiters);for(let s=0;s<i;s++)n[s]&&n[s].delimiters&&tK(r,n[s].delimiters)}],["fragments_join",function r(r){let n,i,s=0,o=r.tokens,l=r.tokens.length;for(n=i=0;n<l;n++)o[n].nesting<0&&s--,o[n].level=s,o[n].nesting>0&&s++,"text"===o[n].type&&n+1<l&&"text"===o[n+1].type?o[n+1].content=o[n].content+o[n+1].content:(n!==i&&(o[i]=o[n]),i++);n!==i&&(o.length=i)}]];function t4(){this.ruler=new e0;for(let r=0;r<t3.length;r++)this.ruler.push(t3[r][0],t3[r][1]);this.ruler2=new e0;for(let r=0;r<t5.length;r++)this.ruler2.push(t5[r][0],t5[r][1])}t4.prototype.skipToken=function(r){let n=r.pos,i=this.ruler.getRules(""),s=i.length,o=r.md.options.maxNesting,l=r.cache;if(void 0!==l[n]){r.pos=l[n];return}let a=!1;if(r.level<o){for(let o=0;o<s;o++)if(r.level++,a=i[o](r,!0),r.level--,a){if(n>=r.pos)throw Error("inline rule didn't increment state.pos");break}}else r.pos=r.posMax;!a&&r.pos++,l[n]=r.pos},t4.prototype.tokenize=function(r){let n=this.ruler.getRules(""),i=n.length,s=r.posMax,o=r.md.options.maxNesting;for(;r.pos<s;){let l=r.pos,a=!1;if(r.level<o){for(let s=0;s<i;s++)if(a=n[s](r,!1)){if(l>=r.pos)throw Error("inline rule didn't increment state.pos");break}}if(a){if(r.pos>=s)break;continue}r.pending+=r.src[r.pos++]}r.pending&&r.pushPending()},t4.prototype.parse=function(r,n,i,s){let o=new this.State(r,n,i,s);this.tokenize(o);let l=this.ruler2.getRules(""),a=l.length;for(let r=0;r<a;r++)l[r](o)},t4.prototype.State=tB;let t6=t4;function t8(r){let n={};r=r||{},n.src_Any=K.source,n.src_Cc=G.source,n.src_Z=X.source,n.src_P=W.source,n.src_ZPCc=[n.src_Z,n.src_P,n.src_Cc].join("|"),n.src_ZCc=[n.src_Z,n.src_Cc].join("|");let i="[><|]";return n.src_pseudo_letter="(?:(?!"+i+"|"+n.src_ZPCc+")"+n.src_Any+")",n.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",n.src_auth="(?:(?:(?!"+n.src_ZCc+"|[@/\\[\\]()]).)+@)?",n.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",n.src_host_terminator="(?=$|"+i+"|"+n.src_ZPCc+")(?!"+(r["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+n.src_ZPCc+"))",n.src_path="(?:[/?#](?:(?!"+n.src_ZCc+"|"+i+"|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+n.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+n.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+n.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+n.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+n.src_ZCc+"|[']).)+\\'|\\'(?="+n.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+n.src_ZCc+"|[.]|$)|"+(r["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+n.src_ZCc+"|$)|;(?!"+n.src_ZCc+"|$)|\\!+(?!"+n.src_ZCc+"|[!]|$)|\\?(?!"+n.src_ZCc+"|[?]|$))+|\\/)?",n.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',n.src_xn="xn--[a-z0-9\\-]{1,59}",n.src_domain_root="(?:"+n.src_xn+"|"+n.src_pseudo_letter+"{1,63})",n.src_domain="(?:"+n.src_xn+"|(?:"+n.src_pseudo_letter+")|(?:"+n.src_pseudo_letter+"(?:-|"+n.src_pseudo_letter+"){0,61}"+n.src_pseudo_letter+"))",n.src_host="(?:(?:(?:(?:"+n.src_domain+")\\.)*"+n.src_domain+"))",n.tpl_host_fuzzy="(?:"+n.src_ip4+"|(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%)))",n.tpl_host_no_ip_fuzzy="(?:(?:(?:"+n.src_domain+")\\.)+(?:%TLDS%))",n.src_host_strict=n.src_host+n.src_host_terminator,n.tpl_host_fuzzy_strict=n.tpl_host_fuzzy+n.src_host_terminator,n.src_host_port_strict=n.src_host+n.src_port+n.src_host_terminator,n.tpl_host_port_fuzzy_strict=n.tpl_host_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_port_no_ip_fuzzy_strict=n.tpl_host_no_ip_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+n.src_ZPCc+"|>|$))",n.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+n.src_ZCc+")("+n.src_email_name+"@"+n.tpl_host_fuzzy_strict+")",n.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_fuzzy_strict+n.src_path+")",n.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+n.src_ZPCc+"))((?![$+<=>^`||])"+n.tpl_host_port_no_ip_fuzzy_strict+n.src_path+")",n}function t9(r){let n=Array.prototype.slice.call(arguments,1);return n.forEach(function(n){n&&Object.keys(n).forEach(function(i){r[i]=n[i]})}),r}function t7(r){return Object.prototype.toString.call(r)}function re(r){return"[object String]"===t7(r)}function rt(r){return"[object Object]"===t7(r)}function rr(r){return"[object RegExp]"===t7(r)}function rn(r){return"[object Function]"===t7(r)}function ri(r){return r.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}let rs={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ro(r){return Object.keys(r||{}).reduce(function(r,n){return r||rs.hasOwnProperty(n)},!1)}let rl={"http:":{validate:function(r,n,i){let s=r.slice(n);return(i.re.http||(i.re.http=RegExp("^\\/\\/"+i.re.src_auth+i.re.src_host_port_strict+i.re.src_path,"i")),i.re.http.test(s))?s.match(i.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(r,n,i){let s=r.slice(n);return(i.re.no_http||(i.re.no_http=RegExp("^"+i.re.src_auth+"(?:localhost|(?:(?:"+i.re.src_domain+")\\.)+"+i.re.src_domain_root+")"+i.re.src_port+i.re.src_host_terminator+i.re.src_path,"i")),i.re.no_http.test(s))?n>=3&&":"===r[n-3]||n>=3&&"/"===r[n-3]?0:s.match(i.re.no_http)[0].length:0}},"mailto:":{validate:function(r,n,i){let s=r.slice(n);return(i.re.mailto||(i.re.mailto=RegExp("^"+i.re.src_email_name+"@"+i.re.src_host_strict,"i")),i.re.mailto.test(s))?s.match(i.re.mailto)[0].length:0}}},ra="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",ru="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function rc(r){return function(n,i){let s=n.slice(i);return r.test(s)?s.match(r)[0].length:0}}function rh(){return function(r,n){n.normalize(r)}}function rd(r){let n=r.re=t8(r.__opts__),i=r.__tlds__.slice();function s(r){return r.replace("%TLDS%",n.src_tlds)}r.onCompile(),r.__tlds_replaced__||i.push(ra),i.push(n.src_xn),n.src_tlds=i.join("|"),n.email_fuzzy=RegExp(s(n.tpl_email_fuzzy),"i"),n.email_fuzzy_global=RegExp(s(n.tpl_email_fuzzy),"ig"),n.link_fuzzy=RegExp(s(n.tpl_link_fuzzy),"i"),n.link_fuzzy_global=RegExp(s(n.tpl_link_fuzzy),"ig"),n.link_no_ip_fuzzy=RegExp(s(n.tpl_link_no_ip_fuzzy),"i"),n.link_no_ip_fuzzy_global=RegExp(s(n.tpl_link_no_ip_fuzzy),"ig"),n.host_fuzzy_test=RegExp(s(n.tpl_host_fuzzy_test),"i");let o=[];function l(r,n){throw Error('(LinkifyIt) Invalid schema "'+r+'": '+n)}r.__compiled__={},Object.keys(r.__schemas__).forEach(function(n){let i=r.__schemas__[n];if(null===i)return;let s={validate:null,link:null};if(r.__compiled__[n]=s,rt(i)){rr(i.validate)?s.validate=rc(i.validate):rn(i.validate)?s.validate=i.validate:l(n,i),rn(i.normalize)?s.normalize=i.normalize:i.normalize?l(n,i):s.normalize=rh();return}re(i)?o.push(n):l(n,i)}),o.forEach(function(n){r.__compiled__[r.__schemas__[n]]&&(r.__compiled__[n].validate=r.__compiled__[r.__schemas__[n]].validate,r.__compiled__[n].normalize=r.__compiled__[r.__schemas__[n]].normalize)}),r.__compiled__[""]={validate:null,normalize:rh()};let a=Object.keys(r.__compiled__).filter(function(n){return n.length>0&&r.__compiled__[n]}).map(ri).join("|");r.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+n.src_ZPCc+"))("+a+")","i"),r.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+n.src_ZPCc+"))("+a+")","ig"),r.re.schema_at_start=RegExp("^"+r.re.schema_search.source,"i"),r.re.pretest=RegExp("("+r.re.schema_test.source+")|("+r.re.host_fuzzy_test.source+")|@","i")}function rp(r,n,i,s){let o=r.slice(i,s);this.schema=n.toLowerCase(),this.index=i,this.lastIndex=s,this.raw=o,this.text=o,this.url=o}function rf(r,n){if(!(this instanceof rf))return new rf(r,n);!n&&ro(r)&&(n=r,r={}),this.__opts__=t9({},rs,n),this.__schemas__=t9({},rl,r),this.__compiled__={},this.__tlds__=ru,this.__tlds_replaced__=!1,this.re={},rd(this)}rf.prototype.add=function(r,n){return this.__schemas__[r]=n,rd(this),this},rf.prototype.set=function(r){return this.__opts__=t9(this.__opts__,r),this},rf.prototype.test=function(r){let n,i;if(!r.length)return!1;if(this.re.schema_test.test(r)){for((i=this.re.schema_search).lastIndex=0;null!==(n=i.exec(r));)if(this.testSchemaAt(r,n[2],i.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&r.search(this.re.host_fuzzy_test)>=0&&null!==r.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&r.indexOf("@")>=0&&null!==r.match(this.re.email_fuzzy))},rf.prototype.pretest=function(r){return this.re.pretest.test(r)},rf.prototype.testSchemaAt=function(r,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(r,i,this):0},rf.prototype.match=function(r){let n,i,s,o=[],l=[],a=[],u=[];function c(r,n){return r?n?r.index!==n.index?r.index<n.index?r:n:r.lastIndex>=n.lastIndex?r:n:r:n}if(!r.length)return null;if(this.re.schema_test.test(r))for((s=this.re.schema_search).lastIndex=0;null!==(n=s.exec(r));)(i=this.testSchemaAt(r,n[2],s.lastIndex))&&l.push({schema:n[2],index:n.index+n[1].length,lastIndex:n.index+n[0].length+i});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for((s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global).lastIndex=0;null!==(n=s.exec(r));)a.push({schema:"",index:n.index+n[1].length,lastIndex:n.index+n[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for((s=this.re.email_fuzzy_global).lastIndex=0;null!==(n=s.exec(r));)u.push({schema:"mailto:",index:n.index+n[1].length,lastIndex:n.index+n[0].length});let h=[0,0,0],d=0;for(;;){let n=[l[h[0]],u[h[1]],a[h[2]]],i=c(c(n[0],n[1]),n[2]);if(!i)break;if(i===n[0]?h[0]++:i===n[1]?h[1]++:h[2]++,i.index<d)continue;let s=new rp(r,i.schema,i.index,i.lastIndex);this.__compiled__[s.schema].normalize(s,this),o.push(s),d=i.lastIndex}return o.length?o:null},rf.prototype.matchAtStart=function(r){if(!r.length)return null;let n=this.re.schema_at_start.exec(r);if(!n)return null;let i=this.testSchemaAt(r,n[2],n[0].length);if(!i)return null;let s=new rp(r,n[2],n.index+n[1].length,n.index+n[0].length+i);return this.__compiled__[s.schema].normalize(s,this),s},rf.prototype.tlds=function(r,n){return(r=Array.isArray(r)?r:[r],n)?this.__tlds__=this.__tlds__.concat(r).sort().filter(function(r,n,i){return r!==i[n-1]}).reverse():(this.__tlds__=r.slice(),this.__tlds_replaced__=!0),rd(this),this},rf.prototype.normalize=function(r){r.schema||(r.url="http://"+r.url),"mailto:"!==r.schema||/^mailto:/i.test(r.url)||(r.url="mailto:"+r.url)},rf.prototype.onCompile=function(){};let rm=rf,rg=0x7fffffff,r_=36,ry=1,rk=26,rb=38,rw=700,rx=72,rv=128,rC="-",rA=/^xn--/,rE=/[^\0-\x7F]/,rS=/[\x2E\u3002\uFF0E\uFF61]/g,rM={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},rT=35,rD=Math.floor,rF=String.fromCharCode;function rI(r){throw RangeError(rM[r])}function rL(r,n){let i=[],s=r.length;for(;s--;)i[s]=n(r[s]);return i}function rR(r,n){let i=r.split("@"),s="";return i.length>1&&(s=i[0]+"@",r=i[1]),s+rL((r=r.replace(rS,".")).split("."),n).join(".")}function rN(r){let n=[],i=0,s=r.length;for(;i<s;){let o=r.charCodeAt(i++);if(o>=55296&&o<=56319&&i<s){let s=r.charCodeAt(i++);(64512&s)==56320?n.push(((1023&o)<<10)+(1023&s)+65536):(n.push(o),i--)}else n.push(o)}return n}let rO=function(r){return r>=48&&r<58?26+(r-48):r>=65&&r<91?r-65:r>=97&&r<123?r-97:r_},rz=function(r,n){return r+22+75*(r<26)-((0!=n)<<5)},rP=function(r,n,i){let s=0;for(r=i?rD(r/rw):r>>1,r+=rD(r/n);r>rT*rk>>1;s+=r_)r=rD(r/rT);return rD(s+(rT+1)*r/(r+rb))},r$=function(r){let n=[],i=r.length,s=0,o=rv,l=rx,a=r.lastIndexOf(rC);a<0&&(a=0);for(let i=0;i<a;++i)r.charCodeAt(i)>=128&&rI("not-basic"),n.push(r.charCodeAt(i));for(let u=a>0?a+1:0;u<i;){let a=s;for(let n=1,o=r_;;o+=r_){u>=i&&rI("invalid-input");let a=rO(r.charCodeAt(u++));a>=r_&&rI("invalid-input"),a>rD((rg-s)/n)&&rI("overflow"),s+=a*n;let c=o<=l?ry:o>=l+rk?rk:o-l;if(a<c)break;let h=r_-c;n>rD(rg/h)&&rI("overflow"),n*=h}let c=n.length+1;l=rP(s-a,c,0==a),rD(s/c)>rg-o&&rI("overflow"),o+=rD(s/c),s%=c,n.splice(s++,0,o)}return String.fromCodePoint(...n)},rB=function(r){let n=[],i=(r=rN(r)).length,s=rv,o=0,l=rx;for(let i of r)i<128&&n.push(rF(i));let a=n.length,u=a;for(a&&n.push(rC);u<i;){let i=rg;for(let n of r)n>=s&&n<i&&(i=n);let c=u+1;for(let h of(i-s>rD((rg-o)/c)&&rI("overflow"),o+=(i-s)*c,s=i,r))if(h<s&&++o>rg&&rI("overflow"),h===s){let r=o;for(let i=r_;;i+=r_){let s=i<=l?ry:i>=l+rk?rk:i-l;if(r<s)break;let o=r-s,a=r_-s;n.push(rF(rz(s+o%a,0))),r=rD(o/a)}n.push(rF(rz(r,0))),l=rP(o,c,u===a),o=0,++u}++o,++s}return n.join("")},rq=function(r){return rR(r,function(r){return rE.test(r)?"xn--"+rB(r):r})},rj=function(r){return rR(r,function(r){return rA.test(r)?r$(r.slice(4).toLowerCase()):r})},rH={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},rV=/^(vbscript|javascript|file|data):/,rU=/^data:image\/(gif|png|jpeg|webp);/;function rW(r){let n=r.trim().toLowerCase();return!rV.test(n)||rU.test(n)}let rJ=["http:","https:","mailto:"];function rK(r){let n=U(r,!0);if(n.hostname&&(!n.protocol||rJ.indexOf(n.protocol)>=0))try{n.hostname=rq(n.hostname)}catch(r){}return F(I(n))}function rG(r){let n=U(r,!0);if(n.hostname&&(!n.protocol||rJ.indexOf(n.protocol)>=0))try{n.hostname=rj(n.hostname)}catch(r){}return S(I(n),S.defaultChars+"%")}function rZ(r,n){if(!(this instanceof rZ))return new rZ(r,n);n||e_(r)||(n=r||{},r="default"),this.inline=new t6,this.block=new tP,this.core=new tf,this.renderer=new eY,this.linkify=new rm,this.validateLink=rW,this.normalizeLink=rK,this.normalizeLinkText=rG,this.utils=b,this.helpers=eb({},w),this.options={},this.configure(r),n&&this.set(n)}rZ.prototype.set=function(r){return eb(this.options,r),this},rZ.prototype.configure=function(r){let n=this;if(e_(r)){let n=r;if(!(r=rH[n]))throw Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!r)throw Error("Wrong `markdown-it` preset, can't be empty");return r.options&&n.set(r.options),r.components&&Object.keys(r.components).forEach(function(i){r.components[i].rules&&n[i].ruler.enableOnly(r.components[i].rules),r.components[i].rules2&&n[i].ruler2.enableOnly(r.components[i].rules2)}),this},rZ.prototype.enable=function(r,n){let i=[];Array.isArray(r)||(r=[r]),["core","block","inline"].forEach(function(n){i=i.concat(this[n].ruler.enable(r,!0))},this),i=i.concat(this.inline.ruler2.enable(r,!0));let s=r.filter(function(r){return 0>i.indexOf(r)});if(s.length&&!n)throw Error("MarkdownIt. Failed to enable unknown rule(s): "+s);return this},rZ.prototype.disable=function(r,n){let i=[];Array.isArray(r)||(r=[r]),["core","block","inline"].forEach(function(n){i=i.concat(this[n].ruler.disable(r,!0))},this),i=i.concat(this.inline.ruler2.disable(r,!0));let s=r.filter(function(r){return 0>i.indexOf(r)});if(s.length&&!n)throw Error("MarkdownIt. Failed to disable unknown rule(s): "+s);return this},rZ.prototype.use=function(r){let n=[this].concat(Array.prototype.slice.call(arguments,1));return r.apply(r,n),this},rZ.prototype.parse=function(r,n){if("string"!=typeof r)throw Error("Input data should be a String");let i=new this.core.State(r,this,n);return this.core.process(i),i.tokens},rZ.prototype.render=function(r,n){return n=n||{},this.renderer.render(this.parse(r,n),this.options,n)},rZ.prototype.parseInline=function(r,n){let i=new this.core.State(r,this,n);return i.inlineMode=!0,this.core.process(i),i.tokens},rZ.prototype.renderInline=function(r,n){return n=n||{},this.renderer.render(this.parseInline(r,n),this.options,n)};let rX=rZ,rY=new v.Sj({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["div",["hr"]]},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:r=>["h"+r.attrs.level,0]},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:r=>({params:r.getAttribute("data-params")||""})}],toDOM:r=>["pre",r.attrs.params?{"data-params":r.attrs.params}:{},["code",0]]},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs:r=>({order:r.hasAttribute("start")?+r.getAttribute("start"):1,tight:r.hasAttribute("data-tight")})}],toDOM:r=>["ol",{start:1==r.attrs.order?null:r.attrs.order,"data-tight":r.attrs.tight?"true":null},0]},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:r=>({tight:r.hasAttribute("data-tight")})}],toDOM:r=>["ul",{"data-tight":r.attrs.tight?"true":null},0]},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:r=>({src:r.getAttribute("src"),title:r.getAttribute("title"),alt:r.getAttribute("alt")})}],toDOM:r=>["img",r.attrs]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:r=>"em"==r.type.name}],toDOM:()=>["em"]},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:r=>"normal"!=r.style.fontWeight&&null},{style:"font-weight=400",clearMark:r=>"strong"==r.type.name},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}],toDOM:()=>["strong"]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:r=>({href:r.getAttribute("href"),title:r.getAttribute("title")})}],toDOM:r=>["a",r.attrs]},code:{code:!0,parseDOM:[{tag:"code"}],toDOM:()=>["code"]}}});function rQ(r,n){if(r.isText&&n.isText&&v.CU.sameSet(r.marks,n.marks))return r.withText(r.text+n.text)}class r0{constructor(r,n){this.schema=r,this.tokenHandlers=n,this.stack=[{type:r.topNodeType,attrs:null,content:[],marks:v.CU.none}]}top(){return this.stack[this.stack.length-1]}push(r){this.stack.length&&this.top().content.push(r)}addText(r){if(!r)return;let n=this.top(),i=n.content,s=i[i.length-1],o=this.schema.text(r,n.marks),l;s&&(l=rQ(s,o))?i[i.length-1]=l:i.push(o)}openMark(r){let n=this.top();n.marks=r.addToSet(n.marks)}closeMark(r){let n=this.top();n.marks=r.removeFromSet(n.marks)}parseTokens(r){for(let n=0;n<r.length;n++){let i=r[n],s=this.tokenHandlers[i.type];if(!s)throw Error("Token type `"+i.type+"` not supported by Markdown parser");s(this,i,r,n)}}addNode(r,n,i){let s=this.top(),o=r.createAndFill(n,i,s?s.marks:[]);return o?(this.push(o),o):null}openNode(r,n){this.stack.push({type:r,attrs:n,content:[],marks:v.CU.none})}closeNode(){let r=this.stack.pop();return this.addNode(r.type,r.attrs,r.content)}}function r1(r,n,i,s){return r.getAttrs?r.getAttrs(n,i,s):r.attrs instanceof Function?r.attrs(n):r.attrs}function r2(r,n){return r.noCloseToken||"code_inline"==n||"code_block"==n||"fence"==n}function r3(r){return"\n"==r[r.length-1]?r.slice(0,r.length-1):r}function r5(){}function r4(r,n){let i=Object.create(null);for(let s in n){let o=n[s];if(o.block){let n=r.nodeType(o.block);r2(o,s)?i[s]=(r,i,s,l)=>{r.openNode(n,r1(o,i,s,l)),r.addText(r3(i.content)),r.closeNode()}:(i[s+"_open"]=(r,i,s,l)=>r.openNode(n,r1(o,i,s,l)),i[s+"_close"]=r=>r.closeNode())}else if(o.node){let n=r.nodeType(o.node);i[s]=(r,i,s,l)=>r.addNode(n,r1(o,i,s,l))}else if(o.mark){let n=r.marks[o.mark];r2(o,s)?i[s]=(r,i,s,l)=>{r.openMark(n.create(r1(o,i,s,l))),r.addText(r3(i.content)),r.closeMark(n)}:(i[s+"_open"]=(r,i,s,l)=>r.openMark(n.create(r1(o,i,s,l))),i[s+"_close"]=r=>r.closeMark(n))}else if(o.ignore)r2(o,s)?i[s]=r5:(i[s+"_open"]=r5,i[s+"_close"]=r5);else throw RangeError("Unrecognized parsing spec "+JSON.stringify(o))}return i.text=(r,n)=>r.addText(n.content),i.inline=(r,n)=>r.parseTokens(n.children),i.softbreak=i.softbreak||(r=>r.addText(" ")),i}class r6{constructor(r,n,i){this.schema=r,this.tokenizer=n,this.tokens=i,this.tokenHandlers=r4(r,i)}parse(r,n={}){let i=new r0(this.schema,this.tokenHandlers),s;i.parseTokens(this.tokenizer.parse(r,n));do s=i.closeNode();while(i.stack.length);return s||this.schema.topNodeType.createAndFill()}}function r8(r,n){for(;++n<r.length;)if("list_item_open"!=r[n].type)return r[n].hidden;return!1}new r6(rY,rX("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(r,n,i)=>({tight:r8(n,i)})},ordered_list:{block:"ordered_list",getAttrs:(r,n,i)=>({order:+r.attrGet("start")||1,tight:r8(n,i)})},heading:{block:"heading",getAttrs:r=>({level:+r.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:r=>({params:r.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:r=>({src:r.attrGet("src"),title:r.attrGet("title")||null,alt:r.children[0]&&r.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:r=>({href:r.attrGet("href"),title:r.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});let r9={open:"",close:"",mixable:!0};class r7{constructor(r,n,i={}){this.nodes=r,this.marks=n,this.options=i}serialize(r,n={}){n=Object.assign({},this.options,n);let i=new nn(this.nodes,this.marks,n);return i.renderContent(r),i.out}}let ne=new r7({blockquote(r,n){r.wrapBlock("> ",null,n,()=>r.renderContent(n))},code_block(r,n){let i=n.textContent.match(/`{3,}/gm),s=i?i.sort().slice(-1)[0]+"`":"```";r.write(s+(n.attrs.params||"")+"\n"),r.text(n.textContent,!1),r.write("\n"),r.write(s),r.closeBlock(n)},heading(r,n){r.write(r.repeat("#",n.attrs.level)+" "),r.renderInline(n,!1),r.closeBlock(n)},horizontal_rule(r,n){r.write(n.attrs.markup||"---"),r.closeBlock(n)},bullet_list(r,n){r.renderList(n," ",()=>(n.attrs.bullet||"*")+" ")},ordered_list(r,n){let i=n.attrs.order||1,s=String(i+n.childCount-1).length,o=r.repeat(" ",s+2);r.renderList(n,o,n=>{let o=String(i+n);return r.repeat(" ",s-o.length)+o+". "})},list_item(r,n){r.renderContent(n)},paragraph(r,n){r.renderInline(n),r.closeBlock(n)},image(r,n){r.write("!["+r.esc(n.attrs.alt||"")+"]("+n.attrs.src.replace(/[\(\)]/g,"\\$&")+(n.attrs.title?' "'+n.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(r,n,i,s){for(let o=s+1;o<i.childCount;o++)if(i.child(o).type!=n.type)return void r.write("\\\n")},text(r,n){r.text(n.text,!r.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open:(r,n,i,s)=>(r.inAutolink=nr(n,i,s),r.inAutolink?"<":"["),close(r,n,i,s){let{inAutolink:o}=r;return r.inAutolink=void 0,o?">":"]("+n.attrs.href.replace(/[\(\)"]/g,"\\$&")+(n.attrs.title?` "${n.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open:(r,n,i,s)=>nt(i.child(s),-1),close:(r,n,i,s)=>nt(i.child(s-1),1),escape:!1}});function nt(r,n){let i=/`+/g,s,o=0;if(r.isText)for(;s=i.exec(r.text);)o=Math.max(o,s[0].length);let l=o>0&&n>0?" `":"`";for(let r=0;r<o;r++)l+="`";return o>0&&n<0&&(l+=" "),l}function nr(r,n,i){if(r.attrs.title||!/^\w+:/.test(r.attrs.href))return!1;let s=n.child(i);return!!s.isText&&s.text==r.attrs.href&&s.marks[s.marks.length-1]==r&&(i==n.childCount-1||!r.isInSet(n.child(i+1).marks))}class nn{constructor(r,n,i){this.nodes=r,this.marks=n,this.options=i,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,void 0===this.options.tightLists&&(this.options.tightLists=!1),void 0===this.options.hardBreakNodeName&&(this.options.hardBreakNodeName="hard_break")}flushClose(r=2){if(this.closed){if(this.atBlank()||(this.out+="\n"),r>1){let n=this.delim,i=/\s+$/.exec(n);i&&(n=n.slice(0,n.length-i[0].length));for(let i=1;i<r;i++)this.out+=n+"\n"}this.closed=null}}getMark(r){let n=this.marks[r];if(!n){if(!1!==this.options.strict)throw Error(`Mark type \`${r}\` not supported by Markdown renderer`);n=r9}return n}wrapBlock(r,n,i,s){let o=this.delim;this.write(null!=n?n:r),this.delim+=r,s(),this.delim=o,this.closeBlock(i)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+="\n")}write(r){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),r&&(this.out+=r)}closeBlock(r){this.closed=r}text(r,n=!0){let i=r.split("\n");for(let r=0;r<i.length;r++)this.write(),!n&&"["==i[r][0]&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(i[r],this.atBlockStart):i[r],r!=i.length-1&&(this.out+="\n")}render(r,n,i){if(this.nodes[r.type.name])this.nodes[r.type.name](this,r,n,i);else if(!1!==this.options.strict)throw Error("Token type `"+r.type.name+"` not supported by Markdown renderer");else!r.type.isLeaf&&(r.type.inlineContent?this.renderInline(r):this.renderContent(r),r.isBlock&&this.closeBlock(r))}renderContent(r){r.forEach((n,i,s)=>this.render(n,r,s))}renderInline(r,n=!0){this.atBlockStart=n;let i=[],s="",o=(n,o,l)=>{let a=n?n.marks:[];n&&n.type.name===this.options.hardBreakNodeName&&(a=a.filter(n=>{if(l+1==r.childCount)return!1;let i=r.child(l+1);return n.isInSet(i.marks)&&(!i.isText||/\S/.test(i.text))}));let u=s;if(s="",n&&n.isText&&a.some(r=>{let n=this.getMark(r.type.name);return n&&n.expelEnclosingWhitespace&&!r.isInSet(i)})){let[r,s,o]=/^(\s*)(.*)$/m.exec(n.text);s&&(u+=s,(n=o?n.withText(o):null)||(a=i))}if(n&&n.isText&&a.some(n=>{let i=this.getMark(n.type.name);return i&&i.expelEnclosingWhitespace&&!this.isMarkAhead(r,l+1,n)})){let[r,o,l]=/^(.*?)(\s*)$/m.exec(n.text);l&&(s=l,(n=o?n.withText(o):null)||(a=i))}let c=a.length?a[a.length-1]:null,h=c&&!1===this.getMark(c.type.name).escape,d=a.length-!!h;e:for(let r=0;r<d;r++){let n=a[r];if(!this.getMark(n.type.name).mixable)break;for(let s=0;s<i.length;s++){let o=i[s];if(!this.getMark(o.type.name).mixable)break;if(n.eq(o)){r>s?a=a.slice(0,s).concat(n).concat(a.slice(s,r)).concat(a.slice(r+1,d)):s>r&&(a=a.slice(0,r).concat(a.slice(r+1,s)).concat(n).concat(a.slice(s,d)));continue e}}}let p=0;for(;p<Math.min(i.length,d)&&a[p].eq(i[p]);)++p;for(;p<i.length;)this.text(this.markString(i.pop(),!1,r,l),!1);if(u&&this.text(u),n){for(;i.length<d;){let n=a[i.length];i.push(n),this.text(this.markString(n,!0,r,l),!1),this.atBlockStart=!1}h&&n.isText?this.text(this.markString(c,!0,r,l)+n.text+this.markString(c,!1,r,l+1),!1):this.render(n,r,l),this.atBlockStart=!1}(null==n?void 0:n.isText)&&n.nodeSize>0&&(this.atBlockStart=!1)};r.forEach(o),o(null,0,r.childCount),this.atBlockStart=!1}renderList(r,n,i){this.closed&&this.closed.type==r.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let s=void 0!==r.attrs.tight?r.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=s,r.forEach((o,l,a)=>{a&&s&&this.flushClose(1),this.wrapBlock(n,i(a),r,()=>this.render(o,r,a))}),this.inTightList=o}esc(r,n=!1){return r=r.replace(/[`*\\~\[\]_]/g,(n,i)=>"_"==n&&i>0&&i+1<r.length&&r[i-1].match(/\w/)&&r[i+1].match(/\w/)?n:"\\"+n),n&&(r=r.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(r=r.replace(this.options.escapeExtraCharacters,"\\$&")),r}quote(r){let n=-1==r.indexOf('"')?'""':-1==r.indexOf("'")?"''":"()";return n[0]+r+n[1]}repeat(r,n){let i="";for(let s=0;s<n;s++)i+=r;return i}markString(r,n,i,s){let o=this.getMark(r.type.name),l=n?o.open:o.close;return"string"==typeof l?l:l(this,r,i,s)}getEnclosingWhitespace(r){return{leading:(r.match(/^(\s+)/)||[void 0])[0],trailing:(r.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(r,n,i){for(;;n++){if(n>=r.childCount)return!1;let s=r.child(n);if(s.type.name!=this.options.hardBreakNodeName)return i.isInSet(s.marks);n++}}}var ni=i(65915),ns=i(76865),no=Object.defineProperty,nl=(r,n,i)=>n in r?no(r,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[n]=i,na=(r,n,i)=>(nl(r,"symbol"!=typeof n?n+"":n,i),i);let nu=x.YY.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:r=>"true"===r.getAttribute("data-tight")||!r.querySelector("p"),renderHTML:r=>({class:r.tight?this.options.tightClass:null,"data-tight":r.tight?"true":null})}}}]},addCommands(){var r=this;return{toggleTight:function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return i=>{let{editor:s,commands:o}=i;function l(r){if(!s.isActive(r))return!1;let i=s.getAttributes(r);return o.updateAttributes(r,{tight:null!=n?n:!(null!=i&&i.tight)})}return r.options.listTypes.some(r=>l(r))}}}}}),nc=rX();function nh(r,n){return nc.inline.State.prototype.scanDelims.call({src:r,posMax:r.length}),new nc.inline.State(r,null,null,[]).scanDelims(n,!0)}function nd(r,n,i,s){let o=r.substring(0,i)+r.substring(i+n.length);return o.substring(0,i+s)+n+o.substring(i+s)}function np(r,n,i,s){let o=i,l=r;for(;o<s&&!nh(l,o).can_open;)l=nd(l,n,o,1),o++;return{text:l,from:o,to:s}}function nf(r,n,i,s){let o=s,l=r;for(;o>i&&!nh(l,o).can_close;)l=nd(l,n,o,-1),o--;return{text:l,from:i,to:o}}function nm(r,n,i,s){let o={text:r,from:i,to:s};return(o=nf((o=np(o.text,n,o.from,o.to)).text,n,o.from,o.to)).to-o.from<n.length+1&&(o.text=o.text.substring(0,o.from)+o.text.substring(o.to+n.length)),o.text}class ng extends nn{constructor(r,n,i){super(r,n,null!=i?i:{}),na(this,"inTable",!1),this.inlines=[]}render(r,n,i){super.render(r,n,i);let s=this.inlines[this.inlines.length-1];if(null!=s&&s.start&&null!=s&&s.end){let{delimiter:r,start:n,end:i}=this.normalizeInline(s);this.out=nm(this.out,r,n,i),this.inlines.pop()}}markString(r,n,i,s){let o=this.marks[r.type.name];if(o.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:o.open});else{let r=this.inlines.pop();this.inlines.push({...r,end:this.out.length})}return super.markString(r,n,i,s)}normalizeInline(r){let{start:n,end:i}=r;for(;this.out.charAt(n).match(/\s/);)n++;return{...r,start:n}}}let n_=x.CU.create({name:"markdownHTMLMark",addStorage:()=>({markdown:{serialize:{open(r,n){var i,s;return this.editor.storage.markdown.options.html?null!=(i=null==(s=ny(n))?void 0:s[0])?i:"":(console.warn(`Tiptap Markdown: "${n.type.name}" mark is only available in html mode`),"")},close(r,n){var i,s;return this.editor.storage.markdown.options.html&&null!=(i=null==(s=ny(n))?void 0:s[1])?i:""}},parse:{}}})});function ny(r){let n=r.type.schema,i=n.text(" ",[r]),s=(0,x.su)(v.FK.from(i),n).match(/^(<.*?>) (<\/.*?>)$/);return s?[s[1],s[2]]:null}function nk(r){let n=`<body>${r}</body>`;return new window.DOMParser().parseFromString(n,"text/html").body}function nb(r){return null==r?void 0:r.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function nw(r){let n=r.parentElement,i=n.cloneNode();for(;n.firstChild&&n.firstChild!==r;)i.appendChild(n.firstChild);i.childNodes.length>0&&n.parentElement.insertBefore(i,n),n.parentElement.insertBefore(r,n),0===n.childNodes.length&&n.remove()}function nx(r){let n=r.parentNode;for(;r.firstChild;)n.insertBefore(r.firstChild,r);n.removeChild(r)}let nv=x.bP.create({name:"markdownHTMLNode",addStorage:()=>({markdown:{serialize(r,n,i){this.editor.storage.markdown.options.html?r.write(nC(n,i)):(console.warn(`Tiptap Markdown: "${n.type.name}" node is only available in html mode`),r.write(`[${n.type.name}]`)),n.isBlock&&r.closeBlock(n)},parse:{}}})});function nC(r,n){let i=r.type.schema,s=(0,x.su)(v.FK.from(r),i);return r.isBlock&&(n instanceof v.FK||n.type.name===i.topNodeType.name)?nA(s):s}function nA(r){let n=nk(r).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
10
10
  ${n.innerHTML}
11
11
  `:`
12
- `,n.outerHTML}let nE=x.bP.create({name:"blockquote"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.blockquote,parse:{}}})}),nS=x.bP.create({name:"bulletList"}).extend({addStorage:()=>({markdown:{serialize(r,n){return r.renderList(n," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}})}),nM=x.bP.create({name:"codeBlock"}).extend({addStorage:()=>({markdown:{serialize(r,n){r.write("```"+(n.attrs.language||"")+"\n"),r.text(n.textContent,!1),r.ensureNewLine(),r.write("```"),r.closeBlock(n)},parse:{setup(r){var n;r.set({langPrefix:null!=(n=this.options.languageClassPrefix)?n:"language-"})},updateDOM(r){r.innerHTML=r.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}})}),nT=x.bP.create({name:"hardBreak"}).extend({addStorage:()=>({markdown:{serialize(r,n,i,s){for(let o=s+1;o<i.childCount;o++)if(i.child(o).type!=n.type)return void r.write(r.inTable?nv.storage.markdown.serialize.call(this,r,n,i):"\\\n")},parse:{}}})}),nD=x.bP.create({name:"heading"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.heading,parse:{}}})}),nF=x.bP.create({name:"horizontalRule"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.horizontal_rule,parse:{}}})}),nI=x.bP.create({name:"image"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.image,parse:{}}})}),nL=x.bP.create({name:"listItem"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.list_item,parse:{}}})});function nR(r,n,i){let s=0;for(;i-s>0&&n.child(i-s-1).type.name===r.type.name;s++);return s}let nN=x.bP.create({name:"orderedList"}).extend({addStorage:()=>({markdown:{serialize(r,n,i,s){let o=n.attrs.start||1,l=String(o+n.childCount-1).length,a=r.repeat(" ",l+2),u=nR(n,i,s)%2?") ":". ";r.renderList(n,a,n=>{let i=String(o+n);return r.repeat(" ",l-i.length)+i+u})},parse:{}}})}),nO=x.bP.create({name:"paragraph"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.paragraph,parse:{}}})});function nz(r){var n,i;return null!=(n=null==r||null==(i=r.content)?void 0:i.content)?n:[]}let nP=x.bP.create({name:"table"}).extend({addStorage:()=>({markdown:{serialize(r,n,i){nB(n)?(r.inTable=!0,n.forEach((n,i,s)=>{if(r.write("| "),n.forEach((n,i,s)=>{s&&r.write(" | ");let o=n.firstChild;o.textContent.trim()&&r.renderInline(o)}),r.write(" |"),r.ensureNewLine(),!s){let i=Array.from({length:n.childCount}).map(()=>"---").join(" | ");r.write(`| ${i} |`),r.ensureNewLine()}}),r.closeBlock(n),r.inTable=!1):nv.storage.markdown.serialize.call(this,r,n,i)},parse:{}}})});function n$(r){return r.attrs.colspan>1||r.attrs.rowspan>1}function nB(r){let n=nz(r),i=n[0],s=n.slice(1);return!(nz(i).some(r=>"tableHeader"!==r.type.name||n$(r)||r.childCount>1)||s.some(r=>nz(r).some(r=>"tableHeader"===r.type.name||n$(r)||r.childCount>1)))}let nq=x.bP.create({name:"taskItem"}).extend({addStorage:()=>({markdown:{serialize(r,n){let i=n.attrs.checked?"[x]":"[ ]";r.write(`${i} `),r.renderContent(n)},parse:{updateDOM(r){[...r.querySelectorAll(".task-list-item")].forEach(r=>{let n=r.querySelector("input");r.setAttribute("data-type","taskItem"),n&&(r.setAttribute("data-checked",n.checked),n.remove())})}}}})}),nj=x.bP.create({name:"taskList"}).extend({addStorage:()=>({markdown:{serialize:nS.storage.markdown.serialize,parse:{setup(r){r.use(ni)},updateDOM(r){[...r.querySelectorAll(".contains-task-list")].forEach(r=>{r.setAttribute("data-type","taskList")})}}}})}),nH=[nE,nS,nM,nT,nD,nF,nv,nI,nL,nN,nO,nP,nq,nj,x.bP.create({name:"text"}).extend({addStorage:()=>({markdown:{serialize(r,n){r.text(nb(n.text))},parse:{}}})}),x.CU.create({name:"bold"}).extend({addStorage:()=>({markdown:{serialize:ne.marks.strong,parse:{}}})}),x.CU.create({name:"code"}).extend({addStorage:()=>({markdown:{serialize:ne.marks.code,parse:{}}})}),n_,x.CU.create({name:"italic"}).extend({addStorage:()=>({markdown:{serialize:ne.marks.em,parse:{}}})}),x.CU.create({name:"link"}).extend({addStorage:()=>({markdown:{serialize:ne.marks.link,parse:{}}})}),x.CU.create({name:"strike"}).extend({addStorage:()=>({markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}})})];function nV(r){var n,i;let s=null==(n=r.storage)?void 0:n.markdown,o=null==(i=nH.find(n=>n.name===r.name))?void 0:i.storage.markdown;return s||o?{...o,...s}:null}class nU{constructor(r){na(this,"editor",null),this.editor=r}serialize(r){let n=new ng(this.nodes,this.marks,{hardBreakNodeName:nT.name});return n.renderContent(r),n.out}get nodes(){var r;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(r=>[r,this.serializeNode(nv)])),...Object.fromEntries(null!=(r=this.editor.extensionManager.extensions.filter(r=>"node"===r.type&&this.serializeNode(r)).map(r=>[r.name,this.serializeNode(r)]))?r:[])}}get marks(){var r;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(r=>[r,this.serializeMark(n_)])),...Object.fromEntries(null!=(r=this.editor.extensionManager.extensions.filter(r=>"mark"===r.type&&this.serializeMark(r)).map(r=>[r.name,this.serializeMark(r)]))?r:[])}}serializeNode(r){var n;return null==(n=nV(r))||null==(n=n.serialize)?void 0:n.bind({editor:this.editor,options:r.options})}serializeMark(r){var n;let i=null==(n=nV(r))?void 0:n.serialize;return i?{...i,open:"function"==typeof i.open?i.open.bind({editor:this.editor,options:r.options}):i.open,close:"function"==typeof i.close?i.close.bind({editor:this.editor,options:r.options}):i.close}:null}}class nW{constructor(r,n){na(this,"editor",null),na(this,"md",null);let{html:i,linkify:s,breaks:o}=n;this.editor=r,this.md=this.withPatchedRenderer(rX({html:i,linkify:s,breaks:o}))}parse(r){let{inline:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof r){this.editor.extensionManager.extensions.forEach(r=>{var n;return null==(n=nV(r))||null==(n=n.parse)||null==(n=n.setup)?void 0:n.call({editor:this.editor,options:r.options},this.md)});let i=nk(this.md.render(r));return this.editor.extensionManager.extensions.forEach(r=>{var n;return null==(n=nV(r))||null==(n=n.parse)||null==(n=n.updateDOM)?void 0:n.call({editor:this.editor,options:r.options},i)}),this.normalizeDOM(i,{inline:n,content:r}),i.innerHTML}return r}normalizeDOM(r,n){let{inline:i,content:s}=n;return this.normalizeBlocks(r),r.querySelectorAll("*").forEach(r=>{var n;(null==(n=r.nextSibling)?void 0:n.nodeType)!==Node.TEXT_NODE||r.closest("pre")||(r.nextSibling.textContent=r.nextSibling.textContent.replace(/^\n/,""))}),i&&this.normalizeInline(r,s),r}normalizeBlocks(r){let n=Object.values(this.editor.schema.nodes).filter(r=>r.isBlock).map(r=>{var n;return null==(n=r.spec.parseDOM)?void 0:n.map(r=>r.tag)}).flat().filter(Boolean).join(",");n&&[...r.querySelectorAll(n)].forEach(r=>{r.parentElement.matches("p")&&nw(r)})}normalizeInline(r,n){var i,s,o,l,a;if(null!=(i=r.firstElementChild)&&i.matches("p")){let i=r.firstElementChild,{nextElementSibling:u}=i,c=null!=(s=null==(o=n.match(/^\s+/))?void 0:o[0])?s:"",h=u?"":null!=(l=null==(a=n.match(/\s+$/))?void 0:a[0])?l:"";if(n.match(/^\n\n/)){i.innerHTML=`${i.innerHTML}${h}`;return}nx(i),r.innerHTML=`${c}${r.innerHTML}${h}`}}withPatchedRenderer(r){let n=r=>function(){let n=r(...arguments);return"\n"===n?n:"\n"===n[n.length-1]?n.slice(0,-1):n};return r.renderer.rules.hardbreak=n(r.renderer.rules.hardbreak),r.renderer.rules.softbreak=n(r.renderer.rules.softbreak),r.renderer.rules.fence=n(r.renderer.rules.fence),r.renderer.rules.code_block=n(r.renderer.rules.code_block),r.renderer.renderToken=n(r.renderer.renderToken.bind(r.renderer)),r}}let nJ=x.YY.create({name:"markdownClipboard",addOptions:()=>({transformPastedText:!1,transformCopiedText:!1}),addProseMirrorPlugins(){return[new ns.k_({key:new ns.hs("markdownClipboard"),props:{clipboardTextParser:(r,n,i)=>{if(i||!this.options.transformPastedText)return null;let s=this.editor.storage.markdown.parser.parse(r,{inline:!0});return v.S4.fromSchema(this.editor.schema).parseSlice(nk(s),{preserveWhitespace:!0,context:n})},clipboardTextSerializer:r=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(r.content):null}})]}}),nK=x.YY.create({name:"markdown",priority:50,addOptions:()=>({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}),addCommands(){let r=x.XO.Commands.config.addCommands();return{setContent:(n,i)=>s=>r.setContent(s.editor.storage.markdown.parser.parse(n),i)(s),insertContentAt:(n,i,s)=>o=>r.insertContentAt(n,o.editor.storage.markdown.parser.parse(i,{inline:!0}),s)(o)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new nW(this.editor,this.options),serializer:new nU(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage:()=>({}),addExtensions(){return[nu.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),nJ.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}})},27050:(r,n,i)=>{"use strict";function s(r){this.content=r}i.d(n,{S4:()=>eu,ZF:()=>ev,FK:()=>u,CU:()=>p,sX:()=>ei,bP:()=>R,u$:()=>I,vI:()=>f,Sj:()=>es,Ji:()=>m}),s.prototype={constructor:s,find:function(r){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===r)return n;return -1},get:function(r){var n=this.find(r);return -1==n?void 0:this.content[n+1]},update:function(r,n,i){var o=i&&i!=r?this.remove(i):this,l=o.find(r),a=o.content.slice();return -1==l?a.push(i||r,n):(a[l+1]=n,i&&(a[l]=i)),new s(a)},remove:function(r){var n=this.find(r);if(-1==n)return this;var i=this.content.slice();return i.splice(n,2),new s(i)},addToStart:function(r,n){return new s([r,n].concat(this.remove(r).content))},addToEnd:function(r,n){var i=this.remove(r).content.slice();return i.push(r,n),new s(i)},addBefore:function(r,n,i){var o=this.remove(n),l=o.content.slice(),a=o.find(r);return l.splice(-1==a?l.length:a,0,n,i),new s(l)},forEach:function(r){for(var n=0;n<this.content.length;n+=2)r(this.content[n],this.content[n+1])},prepend:function(r){return(r=s.from(r)).size?new s(r.content.concat(this.subtract(r).content)):this},append:function(r){return(r=s.from(r)).size?new s(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var n=this;r=s.from(r);for(var i=0;i<r.content.length;i+=2)n=n.remove(r.content[i]);return n},toObject:function(){var r={};return this.forEach(function(n,i){r[n]=i}),r},get size(){return this.content.length>>1}},s.from=function(r){if(r instanceof s)return r;var n=[];if(r)for(var i in r)n.push(i,r[i]);return new s(n)};let o=s;function l(r,n,i){for(let s=0;;s++){if(s==r.childCount||s==n.childCount)return r.childCount==n.childCount?null:i;let o=r.child(s),a=n.child(s);if(o==a){i+=o.nodeSize;continue}if(!o.sameMarkup(a))return i;if(o.isText&&o.text!=a.text){for(let r=0;o.text[r]==a.text[r];r++)i++;return i}if(o.content.size||a.content.size){let r=l(o.content,a.content,i+1);if(null!=r)return r}i+=o.nodeSize}}function a(r,n,i,s){for(let o=r.childCount,l=n.childCount;;){if(0==o||0==l)return o==l?null:{a:i,b:s};let u=r.child(--o),c=n.child(--l),h=u.nodeSize;if(u==c){i-=h,s-=h;continue}if(!u.sameMarkup(c))return{a:i,b:s};if(u.isText&&u.text!=c.text){let r=0,n=Math.min(u.text.length,c.text.length);for(;r<n&&u.text[u.text.length-r-1]==c.text[c.text.length-r-1];)r++,i--,s--;return{a:i,b:s}}if(u.content.size||c.content.size){let r=a(u.content,c.content,i-1,s-1);if(r)return r}i-=h,s-=h}}class u{constructor(r,n){if(this.content=r,this.size=n||0,null==n)for(let n=0;n<r.length;n++)this.size+=r[n].nodeSize}nodesBetween(r,n,i,s=0,o){for(let l=0,a=0;a<n;l++){let u=this.content[l],c=a+u.nodeSize;if(c>r&&!1!==i(u,s+a,o||null,l)&&u.content.size){let o=a+1;u.nodesBetween(Math.max(0,r-o),Math.min(u.content.size,n-o),i,s+o)}a=c}}descendants(r){this.nodesBetween(0,this.size,r)}textBetween(r,n,i,s){let o="",l=!0;return this.nodesBetween(r,n,(a,u)=>{let c=a.isText?a.text.slice(Math.max(r,u)-u,n-u):a.isLeaf?s?"function"==typeof s?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&i&&(l?l=!1:o+=i),o+=c},0),o}append(r){if(!r.size)return this;if(!this.size)return r;let n=this.lastChild,i=r.firstChild,s=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(i)&&(s[s.length-1]=n.withText(n.text+i.text),o=1);o<r.content.length;o++)s.push(r.content[o]);return new u(s,this.size+r.size)}cut(r,n=this.size){if(0==r&&n==this.size)return this;let i=[],s=0;if(n>r)for(let o=0,l=0;l<n;o++){let a=this.content[o],u=l+a.nodeSize;u>r&&((l<r||u>n)&&(a=a.isText?a.cut(Math.max(0,r-l),Math.min(a.text.length,n-l)):a.cut(Math.max(0,r-l-1),Math.min(a.content.size,n-l-1))),i.push(a),s+=a.nodeSize),l=u}return new u(i,s)}cutByIndex(r,n){return r==n?u.empty:0==r&&n==this.content.length?this:new u(this.content.slice(r,n))}replaceChild(r,n){let i=this.content[r];if(i==n)return this;let s=this.content.slice(),o=this.size+n.nodeSize-i.nodeSize;return s[r]=n,new u(s,o)}addToStart(r){return new u([r].concat(this.content),this.size+r.nodeSize)}addToEnd(r){return new u(this.content.concat(r),this.size+r.nodeSize)}eq(r){if(this.content.length!=r.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(r.content[n]))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(r){let n=this.content[r];if(!n)throw RangeError("Index "+r+" out of range for "+this);return n}maybeChild(r){return this.content[r]||null}forEach(r){for(let n=0,i=0;n<this.content.length;n++){let s=this.content[n];r(s,i,n),i+=s.nodeSize}}findDiffStart(r,n=0){return l(this,r,n)}findDiffEnd(r,n=this.size,i=r.size){return a(this,r,n,i)}findIndex(r){if(0==r)return h(0,r);if(r==this.size)return h(this.content.length,r);if(r>this.size||r<0)throw RangeError(`Position ${r} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=i+this.child(n).nodeSize;if(s>=r){if(s==r)return h(n+1,s);return h(n,i)}i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(r=>r.toJSON()):null}static fromJSON(r,n){if(!n)return u.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new u(n.map(r.nodeFromJSON))}static fromArray(r){if(!r.length)return u.empty;let n,i=0;for(let s=0;s<r.length;s++){let o=r[s];i+=o.nodeSize,s&&o.isText&&r[s-1].sameMarkup(o)?(n||(n=r.slice(0,s)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new u(n||r,i)}static from(r){if(!r)return u.empty;if(r instanceof u)return r;if(Array.isArray(r))return this.fromArray(r);if(r.attrs)return new u([r],r.nodeSize);throw RangeError("Can not convert "+r+" to a Fragment"+(r.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}u.empty=new u([],0);let c={index:0,offset:0};function h(r,n){return c.index=r,c.offset=n,c}function d(r,n){if(r===n)return!0;if(!(r&&"object"==typeof r)||!(n&&"object"==typeof n))return!1;let i=Array.isArray(r);if(Array.isArray(n)!=i)return!1;if(i){if(r.length!=n.length)return!1;for(let i=0;i<r.length;i++)if(!d(r[i],n[i]))return!1}else{for(let i in r)if(!(i in n)||!d(r[i],n[i]))return!1;for(let i in n)if(!(i in r))return!1}return!0}class p{constructor(r,n){this.type=r,this.attrs=n}addToSet(r){let n,i=!1;for(let s=0;s<r.length;s++){let o=r[s];if(this.eq(o))return r;if(this.type.excludes(o.type))n||(n=r.slice(0,s));else{if(o.type.excludes(this.type))return r;!i&&o.type.rank>this.type.rank&&(n||(n=r.slice(0,s)),n.push(this),i=!0),n&&n.push(o)}}return n||(n=r.slice()),i||n.push(this),n}removeFromSet(r){for(let n=0;n<r.length;n++)if(this.eq(r[n]))return r.slice(0,n).concat(r.slice(n+1));return r}isInSet(r){for(let n=0;n<r.length;n++)if(this.eq(r[n]))return!0;return!1}eq(r){return this==r||this.type==r.type&&d(this.attrs,r.attrs)}toJSON(){let r={type:this.type.name};for(let n in this.attrs){r.attrs=this.attrs;break}return r}static fromJSON(r,n){if(!n)throw RangeError("Invalid input for Mark.fromJSON");let i=r.marks[n.type];if(!i)throw RangeError(`There is no mark type ${n.type} in this schema`);let s=i.create(n.attrs);return i.checkAttrs(s.attrs),s}static sameSet(r,n){if(r==n)return!0;if(r.length!=n.length)return!1;for(let i=0;i<r.length;i++)if(!r[i].eq(n[i]))return!1;return!0}static setFrom(r){if(!r||Array.isArray(r)&&0==r.length)return p.none;if(r instanceof p)return[r];let n=r.slice();return n.sort((r,n)=>r.type.rank-n.type.rank),n}}p.none=[];class f extends Error{}class m{constructor(r,n,i){this.content=r,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(r,n){let i=_(this.content,r+this.openStart,n);return i&&new m(i,this.openStart,this.openEnd)}removeBetween(r,n){return new m(g(this.content,r+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(r){return this.content.eq(r.content)&&this.openStart==r.openStart&&this.openEnd==r.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let r={content:this.content.toJSON()};return this.openStart>0&&(r.openStart=this.openStart),this.openEnd>0&&(r.openEnd=this.openEnd),r}static fromJSON(r,n){if(!n)return m.empty;let i=n.openStart||0,s=n.openEnd||0;if("number"!=typeof i||"number"!=typeof s)throw RangeError("Invalid input for Slice.fromJSON");return new m(u.fromJSON(r,n.content),i,s)}static maxOpen(r,n=!0){let i=0,s=0;for(let s=r.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let i=r.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new m(r,i,s)}}function g(r,n,i){let{index:s,offset:o}=r.findIndex(n),l=r.maybeChild(s),{index:a,offset:u}=r.findIndex(i);if(o==n||l.isText){if(u!=i&&!r.child(a).isText)throw RangeError("Removing non-flat range");return r.cut(0,n).append(r.cut(i))}if(s!=a)throw RangeError("Removing non-flat range");return r.replaceChild(s,l.copy(g(l.content,n-o-1,i-o-1)))}function _(r,n,i,s){let{index:o,offset:l}=r.findIndex(n),a=r.maybeChild(o);if(l==n||a.isText)return s&&!s.canReplace(o,o,i)?null:r.cut(0,n).append(i).append(r.cut(n));let u=_(a.content,n-l-1,i,a);return u&&r.replaceChild(o,a.copy(u))}function y(r,n,i){if(i.openStart>r.depth)throw new f("Inserted content deeper than insertion position");if(r.depth-i.openStart!=n.depth-i.openEnd)throw new f("Inconsistent open depths");return k(r,n,i,0)}function k(r,n,i,s){let o=r.index(s),l=r.node(s);if(o==n.index(s)&&s<r.depth-i.openStart){let a=k(r,n,i,s+1);return l.copy(l.content.replaceChild(o,a))}if(!i.content.size)return C(l,E(r,n,s));if(i.openStart||i.openEnd||r.depth!=s||n.depth!=s){let{start:o,end:a}=S(i,r);return C(l,A(r,o,a,n,s))}{let s=r.parent,o=s.content;return C(s,o.cut(0,r.parentOffset).append(i.content).append(o.cut(n.parentOffset)))}}function b(r,n){if(!n.type.compatibleContent(r.type))throw new f("Cannot join "+n.type.name+" onto "+r.type.name)}function w(r,n,i){let s=r.node(i);return b(s,n.node(i)),s}function x(r,n){let i=n.length-1;i>=0&&r.isText&&r.sameMarkup(n[i])?n[i]=r.withText(n[i].text+r.text):n.push(r)}function v(r,n,i,s){let o=(n||r).node(i),l=0,a=n?n.index(i):o.childCount;r&&(l=r.index(i),r.depth>i?l++:r.textOffset&&(x(r.nodeAfter,s),l++));for(let r=l;r<a;r++)x(o.child(r),s);n&&n.depth==i&&n.textOffset&&x(n.nodeBefore,s)}function C(r,n){return r.type.checkContent(n),r.copy(n)}function A(r,n,i,s,o){let l=r.depth>o&&w(r,n,o+1),a=s.depth>o&&w(i,s,o+1),c=[];return v(null,r,o,c),l&&a&&n.index(o)==i.index(o)?(b(l,a),x(C(l,A(r,n,i,s,o+1)),c)):(l&&x(C(l,E(r,n,o+1)),c),v(n,i,o,c),a&&x(C(a,E(i,s,o+1)),c)),v(s,null,o,c),new u(c)}function E(r,n,i){let s=[];return v(null,r,i,s),r.depth>i&&x(C(w(r,n,i+1),E(r,n,i+1)),s),v(n,null,i,s),new u(s)}function S(r,n){let i=n.depth-r.openStart,s=n.node(i).copy(r.content);for(let r=i-1;r>=0;r--)s=n.node(r).copy(u.from(s));return{start:s.resolveNoCache(r.openStart+i),end:s.resolveNoCache(s.content.size-r.openEnd-i)}}m.empty=new m(u.empty,0,0);class M{constructor(r,n,i){this.pos=r,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(r){return null==r?this.depth:r<0?this.depth+r:r}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(r){return this.path[3*this.resolveDepth(r)]}index(r){return this.path[3*this.resolveDepth(r)+1]}indexAfter(r){return r=this.resolveDepth(r),this.index(r)+(r!=this.depth||this.textOffset?1:0)}start(r){return 0==(r=this.resolveDepth(r))?0:this.path[3*r-1]+1}end(r){return r=this.resolveDepth(r),this.start(r)+this.node(r).content.size}before(r){if(!(r=this.resolveDepth(r)))throw RangeError("There is no position before the top-level node");return r==this.depth+1?this.pos:this.path[3*r-1]}after(r){if(!(r=this.resolveDepth(r)))throw RangeError("There is no position after the top-level node");return r==this.depth+1?this.pos:this.path[3*r-1]+this.path[3*r].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let r=this.parent,n=this.index(this.depth);if(n==r.childCount)return null;let i=this.pos-this.path[this.path.length-1],s=r.child(n);return i?r.child(n).cut(i):s}get nodeBefore(){let r=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(r).cut(0,n):0==r?null:this.parent.child(r-1)}posAtIndex(r,n){n=this.resolveDepth(n);let i=this.path[3*n],s=0==n?0:this.path[3*n-1]+1;for(let n=0;n<r;n++)s+=i.child(n).nodeSize;return s}marks(){let r=this.parent,n=this.index();if(0==r.content.size)return p.none;if(this.textOffset)return r.child(n).marks;let i=r.maybeChild(n-1),s=r.maybeChild(n);if(!i){let r=i;i=s,s=r}let o=i.marks;for(var l=0;l<o.length;l++)!1!==o[l].type.spec.inclusive||s&&o[l].isInSet(s.marks)||(o=o[l--].removeFromSet(o));return o}marksAcross(r){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,s=r.parent.maybeChild(r.index());for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||s&&i[o].isInSet(s.marks)||(i=i[o--].removeFromSet(i));return i}sharedDepth(r){for(let n=this.depth;n>0;n--)if(this.start(n)<=r&&this.end(n)>=r)return n;return 0}blockRange(r=this,n){if(r.pos<this.pos)return r.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==r.pos?1:0);i>=0;i--)if(r.pos<=this.end(i)&&(!n||n(this.node(i))))return new I(this,r,i);return null}sameParent(r){return this.pos-this.parentOffset==r.pos-r.parentOffset}max(r){return r.pos>this.pos?r:this}min(r){return r.pos<this.pos?r:this}toString(){let r="";for(let n=1;n<=this.depth;n++)r+=(r?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return r+":"+this.parentOffset}static resolve(r,n){if(!(n>=0&&n<=r.content.size))throw RangeError("Position "+n+" out of range");let i=[],s=0,o=n;for(let n=r;;){let{index:r,offset:l}=n.content.findIndex(o),a=o-l;if(i.push(n,r,s+l),!a||(n=n.child(r)).isText)break;o=a-1,s+=l+1}return new M(n,i,o)}static resolveCached(r,n){let i=F.get(r);if(i)for(let r=0;r<i.elts.length;r++){let s=i.elts[r];if(s.pos==n)return s}else F.set(r,i=new T);let s=i.elts[i.i]=M.resolve(r,n);return i.i=(i.i+1)%D,s}}class T{constructor(){this.elts=[],this.i=0}}let D=12,F=new WeakMap;class I{constructor(r,n,i){this.$from=r,this.$to=n,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let L=Object.create(null);class R{constructor(r,n,i,s=p.none){this.type=r,this.attrs=n,this.marks=s,this.content=i||u.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(r){return this.content.child(r)}maybeChild(r){return this.content.maybeChild(r)}forEach(r){this.content.forEach(r)}nodesBetween(r,n,i,s=0){this.content.nodesBetween(r,n,i,s,this)}descendants(r){this.nodesBetween(0,this.content.size,r)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(r,n,i,s){return this.content.textBetween(r,n,i,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(r){return this==r||this.sameMarkup(r)&&this.content.eq(r.content)}sameMarkup(r){return this.hasMarkup(r.type,r.attrs,r.marks)}hasMarkup(r,n,i){return this.type==r&&d(this.attrs,n||r.defaultAttrs||L)&&p.sameSet(this.marks,i||p.none)}copy(r=null){return r==this.content?this:new R(this.type,this.attrs,r,this.marks)}mark(r){return r==this.marks?this:new R(this.type,this.attrs,this.content,r)}cut(r,n=this.content.size){return 0==r&&n==this.content.size?this:this.copy(this.content.cut(r,n))}slice(r,n=this.content.size,i=!1){if(r==n)return m.empty;let s=this.resolve(r),o=this.resolve(n),l=i?0:s.sharedDepth(n),a=s.start(l);return new m(s.node(l).content.cut(s.pos-a,o.pos-a),s.depth-l,o.depth-l)}replace(r,n,i){return y(this.resolve(r),this.resolve(n),i)}nodeAt(r){for(let n=this;;){let{index:i,offset:s}=n.content.findIndex(r);if(!(n=n.maybeChild(i)))return null;if(s==r||n.isText)return n;r-=s+1}}childAfter(r){let{index:n,offset:i}=this.content.findIndex(r);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(r){if(0==r)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(r);if(i<r)return{node:this.content.child(n),index:n,offset:i};let s=this.content.child(n-1);return{node:s,index:n-1,offset:i-s.nodeSize}}resolve(r){return M.resolveCached(this,r)}resolveNoCache(r){return M.resolve(this,r)}rangeHasMark(r,n,i){let s=!1;return n>r&&this.nodesBetween(r,n,r=>(i.isInSet(r.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let r=this.type.name;return this.content.size&&(r+="("+this.content.toStringInner()+")"),O(this.marks,r)}contentMatchAt(r){let n=this.type.contentMatch.matchFragment(this.content,0,r);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(r,n,i=u.empty,s=0,o=i.childCount){let l=this.contentMatchAt(r).matchFragment(i,s,o),a=l&&l.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let r=s;r<o;r++)if(!this.type.allowsMarks(i.child(r).marks))return!1;return!0}canReplaceWith(r,n,i,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(r).matchType(i),l=o&&o.matchFragment(this.content,n);return!!l&&l.validEnd}canAppend(r){return r.content.size?this.canReplace(this.childCount,this.childCount,r.content):this.type.compatibleContent(r.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let r=p.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),r=i.addToSet(r)}if(!p.sameSet(r,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let r={type:this.type.name};for(let n in this.attrs){r.attrs=this.attrs;break}return this.content.size&&(r.content=this.content.toJSON()),this.marks.length&&(r.marks=this.marks.map(r=>r.toJSON())),r}static fromJSON(r,n){let i;if(!n)throw RangeError("Invalid input for Node.fromJSON");if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(r.markFromJSON)}if("text"==n.type){if("string"!=typeof n.text)throw RangeError("Invalid text node in JSON");return r.text(n.text,i)}let s=u.fromJSON(r,n.content),o=r.nodeType(n.type).create(n.attrs,s,i);return o.type.checkAttrs(o.attrs),o}}R.prototype.text=void 0;class N extends R{constructor(r,n,i,s){if(super(r,n,null,s),!i)throw RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):O(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(r,n){return this.text.slice(r,n)}get nodeSize(){return this.text.length}mark(r){return r==this.marks?this:new N(this.type,this.attrs,this.text,r)}withText(r){return r==this.text?this:new N(this.type,this.attrs,r,this.marks)}cut(r=0,n=this.text.length){return 0==r&&n==this.text.length?this:this.withText(this.text.slice(r,n))}eq(r){return this.sameMarkup(r)&&this.text==r.text}toJSON(){let r=super.toJSON();return r.text=this.text,r}}function O(r,n){for(let i=r.length-1;i>=0;i--)n=r[i].type.name+"("+n+")";return n}class z{constructor(r){this.validEnd=r,this.next=[],this.wrapCache=[]}static parse(r,n){let i=new P(r,n);if(null==i.next)return z.empty;let s=$(i);i.next&&i.err("Unexpected trailing text");let o=G(W(s));return Z(o,i),o}matchType(r){for(let n=0;n<this.next.length;n++)if(this.next[n].type==r)return this.next[n].next;return null}matchFragment(r,n=0,i=r.childCount){let s=this;for(let o=n;s&&o<i;o++)s=s.matchType(r.child(o).type);return s}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let r=0;r<this.next.length;r++){let{type:n}=this.next[r];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(r){for(let n=0;n<this.next.length;n++)for(let i=0;i<r.next.length;i++)if(this.next[n].type==r.next[i].type)return!0;return!1}fillBefore(r,n=!1,i=0){let s=[this];function o(l,a){let c=l.matchFragment(r,i);if(c&&(!n||c.validEnd))return u.from(a.map(r=>r.createAndFill()));for(let r=0;r<l.next.length;r++){let{type:n,next:i}=l.next[r];if(!(n.isText||n.hasRequiredAttrs())&&-1==s.indexOf(i)){s.push(i);let r=o(i,a.concat(n));if(r)return r}}return null}return o(this,[])}findWrapping(r){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==r)return this.wrapCache[n+1];let n=this.computeWrapping(r);return this.wrapCache.push(r,n),n}computeWrapping(r){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let s=i.shift(),o=s.match;if(o.matchType(r)){let r=[];for(let n=s;n.type;n=n.via)r.push(n.type);return r.reverse()}for(let r=0;r<o.next.length;r++){let{type:l,next:a}=o.next[r];l.isLeaf||l.hasRequiredAttrs()||l.name in n||s.type&&!a.validEnd||(i.push({match:l.contentMatch,type:l,via:s}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(r){if(r>=this.next.length)throw RangeError(`There's no ${r}th edge in this content match`);return this.next[r]}toString(){let r=[];function n(i){r.push(i);for(let s=0;s<i.next.length;s++)-1==r.indexOf(i.next[s].next)&&n(i.next[s].next)}return n(this),r.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let i=0;i<n.next.length;i++)s+=(i?", ":"")+n.next[i].type.name+"->"+r.indexOf(n.next[i].next);return s}).join("\n")}}z.empty=new z(!0);class P{constructor(r,n){this.string=r,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=r.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(r){return this.next==r&&(this.pos++||!0)}err(r){throw SyntaxError(r+" (in content expression '"+this.string+"')")}}function $(r){let n=[];do n.push(B(r));while(r.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function B(r){let n=[];do n.push(q(r));while(r.next&&")"!=r.next&&"|"!=r.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function q(r){let n=U(r);for(;;)if(r.eat("+"))n={type:"plus",expr:n};else if(r.eat("*"))n={type:"star",expr:n};else if(r.eat("?"))n={type:"opt",expr:n};else if(r.eat("{"))n=H(r,n);else break;return n}function j(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let n=Number(r.next);return r.pos++,n}function H(r,n){let i=j(r),s=i;return r.eat(",")&&(s="}"!=r.next?j(r):-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:i,max:s,expr:n}}function V(r,n){let i=r.nodeTypes,s=i[n];if(s)return[s];let o=[];for(let r in i){let s=i[r];s.isInGroup(n)&&o.push(s)}return 0==o.length&&r.err("No node type or group '"+n+"' found"),o}function U(r){if(r.eat("(")){let n=$(r);return r.eat(")")||r.err("Missing closing paren"),n}if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let n=V(r,r.next).map(n=>(null==r.inline?r.inline=n.isInline:r.inline!=n.isInline&&r.err("Mixing inline and block content"),{type:"name",value:n}));return r.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}}function W(r){let n=[[]];return o(l(r,0),i()),n;function i(){return n.push([])-1}function s(r,i,s){let o={term:s,to:i};return n[r].push(o),o}function o(r,n){r.forEach(r=>r.to=n)}function l(r,n){if("choice"==r.type)return r.exprs.reduce((r,i)=>r.concat(l(i,n)),[]);if("seq"==r.type)for(let s=0;;s++){let a=l(r.exprs[s],n);if(s==r.exprs.length-1)return a;o(a,n=i())}else if("star"==r.type){let a=i();return s(n,a),o(l(r.expr,a),a),[s(a)]}else if("plus"==r.type){let a=i();return o(l(r.expr,n),a),o(l(r.expr,a),a),[s(a)]}else if("opt"==r.type)return[s(n)].concat(l(r.expr,n));else if("range"==r.type){let a=n;for(let n=0;n<r.min;n++){let n=i();o(l(r.expr,a),n),a=n}if(-1==r.max)o(l(r.expr,a),a);else for(let n=r.min;n<r.max;n++){let n=i();s(a,n),o(l(r.expr,a),n),a=n}return[s(a)]}else if("name"==r.type)return[s(n,void 0,r.value)];else throw Error("Unknown expr type")}}function J(r,n){return n-r}function K(r,n){let i=[];return s(n),i.sort(J);function s(n){let o=r[n];if(1==o.length&&!o[0].term)return s(o[0].to);i.push(n);for(let r=0;r<o.length;r++){let{term:n,to:l}=o[r];n||-1!=i.indexOf(l)||s(l)}}}function G(r){let n=Object.create(null);return i(K(r,0));function i(s){let o=[];s.forEach(n=>{r[n].forEach(({term:n,to:i})=>{let s;if(n){for(let r=0;r<o.length;r++)o[r][0]==n&&(s=o[r][1]);K(r,i).forEach(r=>{s||o.push([n,s=[]]),-1==s.indexOf(r)&&s.push(r)})}})});let l=n[s.join(",")]=new z(s.indexOf(r.length-1)>-1);for(let r=0;r<o.length;r++){let s=o[r][1].sort(J);l.next.push({type:o[r][0],next:n[s.join(",")]||i(s)})}return l}}function Z(r,n){for(let i=0,s=[r];i<s.length;i++){let r=s[i],o=!r.validEnd,l=[];for(let n=0;n<r.next.length;n++){let{type:i,next:a}=r.next[n];l.push(i.name),o&&!(i.isText||i.hasRequiredAttrs())&&(o=!1),-1==s.indexOf(a)&&s.push(a)}o&&n.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function X(r){let n=Object.create(null);for(let i in r){let s=r[i];if(!s.hasDefault)return null;n[i]=s.default}return n}function Y(r,n){let i=Object.create(null);for(let s in r){let o=n&&n[s];if(void 0===o){let n=r[s];if(n.hasDefault)o=n.default;else throw RangeError("No value supplied for attribute "+s)}i[s]=o}return i}function Q(r,n,i,s){for(let s in n)if(!(s in r))throw RangeError(`Unsupported attribute ${s} for ${i} of type ${s}`);for(let i in r){let s=r[i];s.validate&&s.validate(n[i])}}function ee(r,n){let i=Object.create(null);if(n)for(let s in n)i[s]=new en(r,s,n[s]);return i}class et{constructor(r,n,i){this.name=r,this.schema=n,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=ee(r,i.attrs),this.defaultAttrs=X(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==r),this.isText="text"==r}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==z.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(r){return this.groups.indexOf(r)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let r in this.attrs)if(this.attrs[r].isRequired)return!0;return!1}compatibleContent(r){return this==r||this.contentMatch.compatible(r.contentMatch)}computeAttrs(r){return!r&&this.defaultAttrs?this.defaultAttrs:Y(this.attrs,r)}create(r=null,n,i){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new R(this,this.computeAttrs(r),u.from(n),p.setFrom(i))}createChecked(r=null,n,i){return n=u.from(n),this.checkContent(n),new R(this,this.computeAttrs(r),n,p.setFrom(i))}createAndFill(r=null,n,i){if(r=this.computeAttrs(r),(n=u.from(n)).size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let s=this.contentMatch.matchFragment(n),o=s&&s.fillBefore(u.empty,!0);return o?new R(this,r,n.append(o),p.setFrom(i)):null}validContent(r){let n=this.contentMatch.matchFragment(r);if(!n||!n.validEnd)return!1;for(let n=0;n<r.childCount;n++)if(!this.allowsMarks(r.child(n).marks))return!1;return!0}checkContent(r){if(!this.validContent(r))throw RangeError(`Invalid content for node ${this.name}: ${r.toString().slice(0,50)}`)}checkAttrs(r){Q(this.attrs,r,"node",this.name)}allowsMarkType(r){return null==this.markSet||this.markSet.indexOf(r)>-1}allowsMarks(r){if(null==this.markSet)return!0;for(let n=0;n<r.length;n++)if(!this.allowsMarkType(r[n].type))return!1;return!0}allowedMarks(r){let n;if(null==this.markSet)return r;for(let i=0;i<r.length;i++)this.allowsMarkType(r[i].type)?n&&n.push(r[i]):n||(n=r.slice(0,i));return n?n.length?n:p.none:r}static compile(r,n){let i=Object.create(null);r.forEach((r,s)=>i[r]=new et(r,n,s));let s=n.spec.topNode||"doc";if(!i[s])throw RangeError("Schema is missing its top node type ('"+s+"')");if(!i.text)throw RangeError("Every schema needs a 'text' type");for(let r in i.text.attrs)throw RangeError("The text node type should not have attributes");return i}}function er(r,n,i){let s=i.split("|");return i=>{let o=null===i?"null":typeof i;if(0>s.indexOf(o))throw RangeError(`Expected value of type ${s} for attribute ${n} on type ${r}, got ${o}`)}}class en{constructor(r,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate="string"==typeof i.validate?er(r,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class ei{constructor(r,n,i,s){this.name=r,this.rank=n,this.schema=i,this.spec=s,this.attrs=ee(r,s.attrs),this.excluded=null;let o=X(this.attrs);this.instance=o?new p(this,o):null}create(r=null){return!r&&this.instance?this.instance:new p(this,Y(this.attrs,r))}static compile(r,n){let i=Object.create(null),s=0;return r.forEach((r,o)=>i[r]=new ei(r,s++,n,o)),i}removeFromSet(r){for(var n=0;n<r.length;n++)r[n].type==this&&(r=r.slice(0,n).concat(r.slice(n+1)),n--);return r}isInSet(r){for(let n=0;n<r.length;n++)if(r[n].type==this)return r[n]}checkAttrs(r){Q(this.attrs,r,"mark",this.name)}excludes(r){return this.excluded.indexOf(r)>-1}}class es{constructor(r){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in r)n[i]=r[i];n.nodes=o.from(r.nodes),n.marks=o.from(r.marks||{}),this.nodes=et.compile(this.spec.nodes,this),this.marks=ei.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw RangeError(r+" can not be both a node and a mark");let n=this.nodes[r],s=n.spec.content||"",o=n.spec.marks;if(n.contentMatch=i[s]||(i[s]=z.parse(s,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!n.isInline||!n.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=n}n.markSet="_"==o?null:o?eo(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let r in this.marks){let n=this.marks[r],i=n.spec.excludes;n.excluded=null==i?[n]:""==i?[]:eo(this,i.split(" "))}this.nodeFromJSON=r=>R.fromJSON(this,r),this.markFromJSON=r=>p.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(r,n=null,i,s){if("string"==typeof r)r=this.nodeType(r);else if(r instanceof et){if(r.schema!=this)throw RangeError("Node type from different schema used ("+r.name+")")}else throw RangeError("Invalid node type: "+r);return r.createChecked(n,i,s)}text(r,n){let i=this.nodes.text;return new N(i,i.defaultAttrs,r,p.setFrom(n))}mark(r,n){return"string"==typeof r&&(r=this.marks[r]),r.create(n)}nodeType(r){let n=this.nodes[r];if(!n)throw RangeError("Unknown node type: "+r);return n}}function eo(r,n){let i=[];for(let s=0;s<n.length;s++){let o=n[s],l=r.marks[o],a=l;if(l)i.push(l);else for(let n in r.marks){let s=r.marks[n];("_"==o||s.spec.group&&s.spec.group.split(" ").indexOf(o)>-1)&&i.push(a=s)}if(!a)throw SyntaxError("Unknown mark type: '"+n[s]+"'")}return i}function el(r){return null!=r.tag}function ea(r){return null!=r.style}class eu{constructor(r,n){this.schema=r,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(r=>{if(el(r))this.tags.push(r);else if(ea(r)){let n=/[^=]*/.exec(r.style)[0];0>i.indexOf(n)&&i.push(n),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let i=r.nodes[n.node];return i.contentMatch.matchType(i)})}parse(r,n={}){let i=new ey(this,n,!1);return i.addAll(r,p.none,n.from,n.to),i.finish()}parseSlice(r,n={}){let i=new ey(this,n,!0);return i.addAll(r,p.none,n.from,n.to),m.maxOpen(i.finish())}matchTag(r,n,i){for(let s=i?this.tags.indexOf(i)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(eb(r,i.tag)&&(void 0===i.namespace||r.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let n=i.getAttrs(r);if(!1===n)continue;i.attrs=n||void 0}return i}}}matchStyle(r,n,i,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(0==l.indexOf(r)&&(!s.context||i.matchesContext(s.context))&&(!(l.length>r.length)||61==l.charCodeAt(r.length)&&l.slice(r.length+1)==n)){if(s.getAttrs){let r=s.getAttrs(n);if(!1===r)continue;s.attrs=r||void 0}return s}}}static schemaRules(r){let n=[];function i(r){let i=null==r.priority?50:r.priority,s=0;for(;s<n.length;s++){let r=n[s];if((null==r.priority?50:r.priority)<i)break}n.splice(s,0,r)}for(let n in r.marks){let s=r.marks[n].spec.parseDOM;s&&s.forEach(r=>{i(r=ew(r)),r.mark||r.ignore||r.clearMark||(r.mark=n)})}for(let n in r.nodes){let s=r.nodes[n].spec.parseDOM;s&&s.forEach(r=>{i(r=ew(r)),r.node||r.ignore||r.mark||(r.node=n)})}return n}static fromSchema(r){return r.cached.domParser||(r.cached.domParser=new eu(r,eu.schemaRules(r)))}}let ec={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},eh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ed={ol:!0,ul:!0},ep=1,ef=2,em=4;function eg(r,n,i){return null!=n?(n?ep:0)|("full"===n?ef:0):r&&"pre"==r.whitespace?ep|ef:i&~em}class e_{constructor(r,n,i,s,o,l){this.type=r,this.attrs=n,this.marks=i,this.solid=s,this.options=l,this.content=[],this.activeMarks=p.none,this.match=o||(l&em?null:r.contentMatch)}findWrapping(r){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(u.from(r));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(r.type))?(this.match=n,i):null}}return this.match.findWrapping(r.type)}finish(r){if(!(this.options&ep)){let r=this.content[this.content.length-1],n;if(r&&r.isText&&(n=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==n[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-n[0].length))}}let n=u.from(this.content);return!r&&this.match&&(n=n.append(this.match.fillBefore(u.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(r){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:r.parentNode&&!ec.hasOwnProperty(r.parentNode.nodeName.toLowerCase())}}class ey{constructor(r,n,i){this.parser=r,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let s=n.topNode,o,l=eg(null,n.preserveWhitespace,0)|(i?em:0);o=s?new e_(s.type,s.attrs,p.none,!0,n.topMatch||s.type.contentMatch,l):i?new e_(null,null,p.none,!0,null,l):new e_(r.schema.topNodeType,null,p.none,!0,null,l),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(r,n){3==r.nodeType?this.addTextNode(r,n):1==r.nodeType&&this.addElement(r,n)}addTextNode(r,n){let i=r.nodeValue,s=this.top,o=s.options&ef?"full":this.localPreserveWS||(s.options&ep)>0,{schema:l}=this.parser;if("full"===o||s.inlineContext(r)||/[^ \t\r\n\u000c]/.test(i)){if(o)if("full"===o)i=i.replace(/\r\n?/g,"\n");else if(l.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(l.linebreakReplacement.create())){let r=i.split(/\r?\n|\r/);for(let i=0;i<r.length;i++)i&&this.insertNode(l.linebreakReplacement.create(),n,!0),r[i]&&this.insertNode(l.text(r[i]),n,!/\S/.test(r[i]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let n=s.content[s.content.length-1],o=r.previousSibling;(!n||o&&"BR"==o.nodeName||n.isText&&/[ \t\r\n\u000c]$/.test(n.text))&&(i=i.slice(1))}i&&this.insertNode(l.text(i),n,!/\S/.test(i)),this.findInText(r)}else this.findInside(r)}addElement(r,n,i){let s=this.localPreserveWS,o=this.top;("PRE"==r.tagName||/pre/.test(r.style&&r.style.whiteSpace))&&(this.localPreserveWS=!0);let l=r.nodeName.toLowerCase(),a;ed.hasOwnProperty(l)&&this.parser.normalizeLists&&ek(r);let u=this.options.ruleFromNode&&this.options.ruleFromNode(r)||(a=this.parser.matchTag(r,this,i));n:if(u?u.ignore:eh.hasOwnProperty(l))this.findInside(r),this.ignoreFallback(r,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(r=u.skip);let i,s=this.needsBlock;if(ec.hasOwnProperty(l))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),i=!0,o.type||(this.needsBlock=!0);else if(!r.firstChild){this.leafFallback(r,n);break n}let a=u&&u.skip?n:this.readStyles(r,n);a&&this.addAll(r,a),i&&this.sync(o),this.needsBlock=s}else{let i=this.readStyles(r,n);i&&this.addElementByRule(r,u,i,!1===u.consuming?a:void 0)}this.localPreserveWS=s}leafFallback(r,n){"BR"==r.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(r.ownerDocument.createTextNode("\n"),n)}ignoreFallback(r,n){"BR"!=r.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(r,n){let i=r.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let s=this.parser.matchedStyles[r],o=i.getPropertyValue(s);if(o)for(let r;;){let i=this.parser.matchStyle(s,o,this,r);if(!i)break;if(i.ignore)return null;if(n=i.clearMark?n.filter(r=>!i.clearMark(r)):n.concat(this.parser.schema.marks[i.mark].create(i.attrs)),!1===i.consuming)r=i;else break}}return n}addElementByRule(r,n,i,s){let o,l;if(n.node)if((l=this.parser.schema.nodes[n.node]).isLeaf)this.insertNode(l.create(n.attrs),i,"BR"==r.nodeName)||this.leafFallback(r,i);else{let r=this.enter(l,n.attrs||null,i,n.preserveWhitespace);r&&(o=!0,i=r)}else{let r=this.parser.schema.marks[n.mark];i=i.concat(r.create(n.attrs))}let a=this.top;if(l&&l.isLeaf)this.findInside(r);else if(s)this.addElement(r,i,s);else if(n.getContent)this.findInside(r),n.getContent(r,this.parser.schema).forEach(r=>this.insertNode(r,i,!1));else{let s=r;"string"==typeof n.contentElement?s=r.querySelector(n.contentElement):"function"==typeof n.contentElement?s=n.contentElement(r):n.contentElement&&(s=n.contentElement),this.findAround(r,s,!0),this.addAll(s,i),this.findAround(r,s,!1)}o&&this.sync(a)&&this.open--}addAll(r,n,i,s){let o=i||0;for(let l=i?r.childNodes[i]:r.firstChild,a=null==s?null:r.childNodes[s];l!=a;l=l.nextSibling,++o)this.findAtPoint(r,o),this.addDOM(l,n);this.findAtPoint(r,o)}findPlace(r,n,i){let s,o;for(let n=this.open,l=0;n>=0;n--){let a=this.nodes[n],u=a.findWrapping(r);if(u&&(!s||s.length>u.length+l)&&(s=u,o=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!s)return null;this.sync(o);for(let r=0;r<s.length;r++)n=this.enterInner(s[r],null,n,!1);return n}insertNode(r,n,i){if(r.isInline&&this.needsBlock&&!this.top.type){let r=this.textblockFromContext();r&&(n=this.enterInner(r,null,n))}let s=this.findPlace(r,n,i);if(s){this.closeExtra();let n=this.top;n.match&&(n.match=n.match.matchType(r.type));let i=p.none;for(let o of s.concat(r.marks))(n.type?n.type.allowsMarkType(o.type):ex(o.type,r.type))&&(i=o.addToSet(i));return n.content.push(r.mark(i)),!0}return!1}enter(r,n,i,s){let o=this.findPlace(r.create(n),i,!1);return o&&(o=this.enterInner(r,n,i,!0,s)),o}enterInner(r,n,i,s=!1,o){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(r);let a=eg(r,o,l.options);l.options&em&&0==l.content.length&&(a|=em);let u=p.none;return i=i.filter(n=>(l.type?!l.type.allowsMarkType(n.type):!ex(n.type,r))||(u=n.addToSet(u),!1)),this.nodes.push(new e_(r,n,u,s,null,a)),this.open++,i}closeExtra(r=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(r));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(r){for(let n=this.open;n>=0;n--)if(this.nodes[n]==r)return this.open=n,!0;else this.localPreserveWS&&(this.nodes[n].options|=ep);return!1}get currentPos(){this.closeExtra();let r=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let n=i.length-1;n>=0;n--)r+=i[n].nodeSize;n&&r++}return r}findAtPoint(r,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==r&&this.find[i].offset==n&&(this.find[i].pos=this.currentPos)}findInside(r){if(this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==r.nodeType&&r.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(r,n,i){if(r!=n&&this.find)for(let s=0;s<this.find.length;s++)null==this.find[s].pos&&1==r.nodeType&&r.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(i?2:4)&&(this.find[s].pos=this.currentPos)}findInText(r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==r&&(this.find[n].pos=this.currentPos-(r.nodeValue.length-this.find[n].offset))}matchesContext(r){if(r.indexOf("|")>-1)return r.split(/\s*\|\s*/).some(this.matchesContext,this);let n=r.split("/"),i=this.options.context,s=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),o=-(i?i.depth+1:0)+ +!s,l=(r,a)=>{for(;r>=0;r--){let u=n[r];if(""==u){if(r==n.length-1||0==r)continue;for(;a>=o;a--)if(l(r-1,a))return!0;return!1}{let r=a>0||0==a&&s?this.nodes[a].type:i&&a>=o?i.node(a-o).type:null;if(!r||r.name!=u&&!r.isInGroup(u))return!1;a--}}return!0};return l(n.length-1,this.open)}textblockFromContext(){let r=this.options.context;if(r)for(let n=r.depth;n>=0;n--){let i=r.node(n).contentMatchAt(r.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function ek(r){for(let n=r.firstChild,i=null;n;n=n.nextSibling){let r=1==n.nodeType?n.nodeName.toLowerCase():null;r&&ed.hasOwnProperty(r)&&i?(i.appendChild(n),n=i):"li"==r?i=n:r&&(i=null)}}function eb(r,n){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,n)}function ew(r){let n={};for(let i in r)n[i]=r[i];return n}function ex(r,n){let i=n.schema.nodes;for(let s in i){let o=i[s];if(!o.allowsMarkType(r))continue;let l=[],a=r=>{l.push(r);for(let i=0;i<r.edgeCount;i++){let{type:s,next:o}=r.edge(i);if(s==n||0>l.indexOf(o)&&a(o))return!0}};if(a(o.contentMatch))return!0}}class ev{constructor(r,n){this.nodes=r,this.marks=n}serializeFragment(r,n={},i){i||(i=eA(n).createDocumentFragment());let s=i,o=[];return r.forEach(r=>{if(o.length||r.marks.length){let i=0,l=0;for(;i<o.length&&l<r.marks.length;){let n=r.marks[l];if(!this.marks[n.type.name]){l++;continue}if(!n.eq(o[i][0])||!1===n.type.spec.spanning)break;i++,l++}for(;i<o.length;)s=o.pop()[1];for(;l<r.marks.length;){let i=r.marks[l++],a=this.serializeMark(i,r.isInline,n);a&&(o.push([i,s]),s.appendChild(a.dom),s=a.contentDOM||a.dom)}}s.appendChild(this.serializeNodeInner(r,n))}),i}serializeNodeInner(r,n){let{dom:i,contentDOM:s}=eT(eA(n),this.nodes[r.type.name](r),null,r.attrs);if(s){if(r.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(r.content,n,s)}return i}serializeNode(r,n={}){let i=this.serializeNodeInner(r,n);for(let s=r.marks.length-1;s>=0;s--){let o=this.serializeMark(r.marks[s],r.isInline,n);o&&((o.contentDOM||o.dom).appendChild(i),i=o.dom)}return i}serializeMark(r,n,i={}){let s=this.marks[r.type.name];return s&&eT(eA(i),s(r,n),null,r.attrs)}static renderSpec(r,n,i=null,s){return eT(r,n,i,s)}static fromSchema(r){return r.cached.domSerializer||(r.cached.domSerializer=new ev(this.nodesFromSchema(r),this.marksFromSchema(r)))}static nodesFromSchema(r){let n=eC(r.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(r){return eC(r.marks)}}function eC(r){let n={};for(let i in r){let s=r[i].spec.toDOM;s&&(n[i]=s)}return n}function eA(r){return r.document||window.document}let eE=new WeakMap;function eS(r){let n=eE.get(r);return void 0===n&&eE.set(r,n=eM(r)),n}function eM(r){let n=null;function i(r){if(r&&"object"==typeof r)if(Array.isArray(r))if("string"==typeof r[0])n||(n=[]),n.push(r);else for(let n=0;n<r.length;n++)i(r[n]);else for(let n in r)i(r[n])}return i(r),n}function eT(r,n,i,s){let o;if("string"==typeof n)return{dom:r.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;let l=n[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(s&&(a=eS(s))&&a.indexOf(n)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let u=l.indexOf(" ");u>0&&(i=l.slice(0,u),l=l.slice(u+1));let c=i?r.createElementNS(i,l):r.createElement(l),h=n[1],d=1;if(h&&"object"==typeof h&&null==h.nodeType&&!Array.isArray(h)){for(let r in d=2,h)if(null!=h[r]){let n=r.indexOf(" ");n>0?c.setAttributeNS(r.slice(0,n),r.slice(n+1),h[r]):"style"==r&&c.style?c.style.cssText=h[r]:c.setAttribute(r,h[r])}}for(let l=d;l<n.length;l++){let a=n[l];if(0===a){if(l<n.length-1||l>d)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:n,contentDOM:l}=eT(r,a,i,s);if(c.appendChild(n),l){if(o)throw RangeError("Multiple content holes");o=l}}}return{dom:c,contentDOM:o}}},31794:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],l=(0,s.A)("heading-1",o)},37595:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],l=(0,s.A)("layout-grid",o)},42080:(r,n,i)=>{"use strict";i.d(n,{$B:()=>p,Sd:()=>l,T2:()=>c});var s=i(8242),o=i(27050);function l(r,n=null){return function(i,s){let{$from:o,$to:l}=i.selection,u=o.blockRange(l);if(!u)return!1;let c=s?i.tr:null;return!!a(c,u,r,n)&&(s&&s(c.scrollIntoView()),!0)}}function a(r,n,i,l=null){let c=!1,h=n,d=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(i)&&0==n.startIndex){if(0==n.$from.index(n.depth-1))return!1;let r=d.resolve(n.start-2);h=new o.u$(r,r,n.depth),n.endIndex<n.parent.childCount&&(n=new o.u$(n.$from,d.resolve(n.$to.end(n.depth)),n.depth)),c=!0}let p=(0,s.oM)(h,i,l,n);return!!p&&(r&&u(r,n,p,c,i),!0)}function u(r,n,i,l,a){let u=o.FK.empty;for(let r=i.length-1;r>=0;r--)u=o.FK.from(i[r].type.create(i[r].attrs,u));r.step(new s.Wg(n.start-2*!!l,n.end,n.start,n.end,new o.Ji(u,0,0),i.length,!0));let c=0;for(let r=0;r<i.length;r++)i[r].type==a&&(c=r+1);let h=i.length-c,d=n.start+i.length-2*!!l,p=n.parent;for(let i=n.startIndex,o=n.endIndex,l=!0;i<o;i++,l=!1)!l&&(0,s.zy)(r.doc,d,h)&&(r.split(d,h),d+=2*h),d+=p.child(i).nodeSize;return r}function c(r){return function(n,i){let{$from:s,$to:o}=n.selection,l=s.blockRange(o,n=>n.childCount>0&&n.firstChild.type==r);return!!l&&(!i||(s.node(l.depth-1).type==r?h(n,i,r,l):d(n,i,l)))}}function h(r,n,i,l){let a=r.tr,u=l.end,c=l.$to.end(l.depth);u<c&&(a.step(new s.Wg(u-1,c,u,c,new o.Ji(o.FK.from(i.create(null,l.parent.copy())),1,0),1,!0)),l=new o.u$(a.doc.resolve(l.$from.pos),a.doc.resolve(c),l.depth));let h=(0,s.jP)(l);if(null==h)return!1;a.lift(l,h);let d=a.doc.resolve(a.mapping.map(u,-1)-1);return(0,s.n9)(a.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&a.join(d.pos),n(a.scrollIntoView()),!0}function d(r,n,i){let l=r.tr,a=i.parent;for(let r=i.end,n=i.endIndex-1,s=i.startIndex;n>s;n--)r-=a.child(n).nodeSize,l.delete(r-1,r+1);let u=l.doc.resolve(i.start),c=u.nodeAfter;if(l.mapping.map(i.end)!=i.start+u.nodeAfter.nodeSize)return!1;let h=0==i.startIndex,d=i.endIndex==a.childCount,p=u.node(-1),f=u.index(-1);if(!p.canReplace(f+ +!h,f+1,c.content.append(d?o.FK.empty:o.FK.from(a))))return!1;let m=u.pos,g=m+c.nodeSize;return l.step(new s.Wg(m-!!h,g+ +!!d,m+1,g-1,new o.Ji((h?o.FK.empty:o.FK.from(a.copy(o.FK.empty))).append(d?o.FK.empty:o.FK.from(a.copy(o.FK.empty))),+!h,+!d),+!h)),n(l.scrollIntoView()),!0}function p(r){return function(n,i){let{$from:l,$to:a}=n.selection,u=l.blockRange(a,n=>n.childCount>0&&n.firstChild.type==r);if(!u)return!1;let c=u.startIndex;if(0==c)return!1;let h=u.parent,d=h.child(c-1);if(d.type!=r)return!1;if(i){let l=d.lastChild&&d.lastChild.type==h.type,a=o.FK.from(l?r.create():null),c=new o.Ji(o.FK.from(r.create(null,o.FK.from(h.type.create(null,a)))),l?3:1,0),p=u.start,f=u.end;i(n.tr.step(new s.Wg(p-(l?3:1),f,p,f,c,1,!0)).scrollIntoView())}return!0}}},42790:(r,n,i)=>{"use strict";i.d(n,{v:()=>h});var s,o,l,a,u,c=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};(s=o||(o={}))[s.EOS=0]="EOS",s[s.Text=1]="Text",s[s.Incomplete=2]="Incomplete",s[s.ESC=3]="ESC",s[s.Unknown=4]="Unknown",s[s.SGR=5]="SGR",s[s.OSCURL=6]="OSCURL";class h{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(r){this._use_classes=r}get use_classes(){return this._use_classes}set url_allowlist(r){this._url_allowlist=r}get url_allowlist(){return this._url_allowlist}set escape_html(r){this._escape_html=r}get escape_html(){return this._escape_html}set boldStyle(r){this._boldStyle=r}get boldStyle(){return this._boldStyle}set faintStyle(r){this._faintStyle=r}get faintStyle(){return this._faintStyle}set italicStyle(r){this._italicStyle=r}get italicStyle(){return this._italicStyle}set underlineStyle(r){this._underlineStyle=r}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(r=>{r.forEach(r=>{this.palette_256.push(r)})});let r=[0,95,135,175,215,255];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let s=0;s<6;++s){let o={rgb:[r[n],r[i],r[s]],class_name:"truecolor"};this.palette_256.push(o)}let n=8;for(let r=0;r<24;++r,n+=10){let r={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(r)}}escape_txt_for_html(r){return this._escape_html?r.replace(/[&<>"']/gm,r=>"&"===r?"&amp;":"<"===r?"&lt;":">"===r?"&gt;":'"'===r?"&quot;":"'"===r?"&#x27;":void 0):r}append_buffer(r){var n=this._buffer+r;this._buffer=n}get_next_packet(){var r={kind:o.EOS,text:"",url:""},n=this._buffer.length;if(0==n)return r;var i=this._buffer.indexOf("\x1b");if(-1==i)return r.kind=o.Text,r.text=this._buffer,this._buffer="",r;if(i>0)return r.kind=o.Text,r.text=this._buffer.slice(0,i),this._buffer=this._buffer.slice(i),r;if(0==i){if(n<3)return r.kind=o.Incomplete,r;var s=this._buffer.charAt(1);if("["!=s&&"]"!=s&&"("!=s)return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;if("["==s){this._csi_regex||(this._csi_regex=d(l||(l=c(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \x1b[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \x1b[ # CSI\n [ -~]* # anything legal\n ([\0-\x1f:]) # anything illegal\n )\n "],["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]))));let n=this._buffer.match(this._csi_regex);if(null===n)return r.kind=o.Incomplete,r;if(n[4])return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;""!=n[1]||"m"!=n[3]?r.kind=o.Unknown:r.kind=o.SGR,r.text=n[2];var h=n[0].length;return this._buffer=this._buffer.slice(h),r}if("]"==s){if(n<4)return r.kind=o.Incomplete,r;if("8"!=this._buffer.charAt(2)||";"!=this._buffer.charAt(3))return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;this._osc_st||(this._osc_st=p(a||(a=c(["\n (?: # legal sequence\n (\x1b\\) # ESC | # alternate\n (\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-\x06] # anything illegal\n | # alternate\n [\b-\x1a] # anything illegal\n | # alternate\n [\x1c-\x1f] # anything illegal\n )\n "],["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "])))),this._osc_st.lastIndex=0;{let n=this._osc_st.exec(this._buffer);if(null===n)return r.kind=o.Incomplete,r;if(n[3])return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r}{let n=this._osc_st.exec(this._buffer);if(null===n)return r.kind=o.Incomplete,r;if(n[3])return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r}this._osc_regex||(this._osc_regex=d(u||(u=c(["\n ^ # beginning of line\n #\n \x1b]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\x1b\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n \x1b]8;; # OSC Hyperlink End\n (?: # ST\n (?:\x1b\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n "],["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]))));let i=this._buffer.match(this._osc_regex);if(null===i)return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;r.kind=o.OSCURL,r.url=i[1],r.text=i[2];var h=i[0].length;return this._buffer=this._buffer.slice(h),r}if("("==s)return r.kind=o.Unknown,this._buffer=this._buffer.slice(3),r}}ansi_to_html(r){this.append_buffer(r);for(var n=[];;){var i=this.get_next_packet();if(i.kind==o.EOS||i.kind==o.Incomplete)break;i.kind!=o.ESC&&i.kind!=o.Unknown&&(i.kind==o.Text?n.push(this.transform_to_html(this.with_state(i))):i.kind==o.SGR?this.process_ansi(i):i.kind==o.OSCURL&&n.push(this.process_hyperlink(i)))}return n.join("")}with_state(r){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:r.text}}process_ansi(r){let n=r.text.split(";");for(;n.length>0;){let r=parseInt(n.shift(),10);if(isNaN(r)||0===r)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(1===r)this.bold=!0;else if(2===r)this.faint=!0;else if(3===r)this.italic=!0;else if(4===r)this.underline=!0;else if(21===r)this.bold=!1;else if(22===r)this.faint=!1,this.bold=!1;else if(23===r)this.italic=!1;else if(24===r)this.underline=!1;else if(39===r)this.fg=null;else if(49===r)this.bg=null;else if(r>=30&&r<38)this.fg=this.ansi_colors[0][r-30];else if(r>=40&&r<48)this.bg=this.ansi_colors[0][r-40];else if(r>=90&&r<98)this.fg=this.ansi_colors[1][r-90];else if(r>=100&&r<108)this.bg=this.ansi_colors[1][r-100];else if((38===r||48===r)&&n.length>0){let i=38===r,s=n.shift();if("5"===s&&n.length>0){let r=parseInt(n.shift(),10);r>=0&&r<=255&&(i?this.fg=this.palette_256[r]:this.bg=this.palette_256[r])}if("2"===s&&n.length>2){let r=parseInt(n.shift(),10),s=parseInt(n.shift(),10),o=parseInt(n.shift(),10);if(r>=0&&r<=255&&s>=0&&s<=255&&o>=0&&o<=255){let n={rgb:[r,s,o],class_name:"truecolor"};i?this.fg=n:this.bg=n}}}}}transform_to_html(r){let n=r.text;if(0===n.length||(n=this.escape_txt_for_html(n),!r.bold&&!r.italic&&!r.faint&&!r.underline&&null===r.fg&&null===r.bg))return n;let i=[],s=[],o=r.fg,l=r.bg;r.bold&&i.push(this._boldStyle),r.faint&&i.push(this._faintStyle),r.italic&&i.push(this._italicStyle),r.underline&&i.push(this._underlineStyle),this._use_classes?(o&&("truecolor"!==o.class_name?s.push(`${o.class_name}-fg`):i.push(`color:rgb(${o.rgb.join(",")})`)),l&&("truecolor"!==l.class_name?s.push(`${l.class_name}-bg`):i.push(`background-color:rgb(${l.rgb.join(",")})`))):(o&&i.push(`color:rgb(${o.rgb.join(",")})`),l&&i.push(`background-color:rgb(${l.rgb})`));let a="",u="";return s.length&&(a=` class="${s.join(" ")}"`),i.length&&(u=` style="${i.join(";")}"`),`<span${u}${a}>${n}</span>`}process_hyperlink(r){let n=r.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(r.url)}">${this.escape_txt_for_html(r.text)}</a>`}}function d(r){let n=r.raw[0],i=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;return new RegExp(n.replace(i,""))}function p(r){let n=r.raw[0],i=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;return RegExp(n.replace(i,""),"g")}},43203:(r,n,i)=>{"use strict";i.d(n,{n:()=>s.nA});var s=i(5989)},43561:(r,n,i)=>{"use strict";i.d(n,{A:()=>s});var s=i(62678).Or},44695:(r,n,i)=>{"use strict";i.d(n,{L:()=>s.L2});var s=i(82150)},45916:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],l=(0,s.A)("text-align-start",o)},48368:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],l=(0,s.A)("file-text",o)},48434:(r,n,i)=>{"use strict";i.d(n,{_:()=>s._0});var s=i(82150)},49387:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],l=(0,s.A)("pencil",o)},49698:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]],l=(0,s.A)("variable",o)},50538:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],l=(0,s.A)("history",o)},51914:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],l=(0,s.A)("plus",o)},52475:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],l=(0,s.A)("code",o)},52740:(r,n,i)=>{"use strict";i.d(n,{A:()=>l,D:()=>o});var s=i(82159),o=s.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:n}){let i=this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0];return[`h${i}`,(0,s.KV)(this.options.HTMLAttributes,n),0]},parseMarkdown:(r,n)=>n.createNode("heading",{level:r.depth||1},n.parseInline(r.tokens||[])),renderMarkdown:(r,n)=>{var i;let s=(null==(i=r.attrs)?void 0:i.level)?parseInt(r.attrs.level,10):1,o="#".repeat(s);return r.content?`${o} ${n.renderChildren(r.content)}`:""},addCommands(){return{setHeading:r=>({commands:n})=>!!this.options.levels.includes(r.level)&&n.setNode(this.name,r),toggleHeading:r=>({commands:n})=>!!this.options.levels.includes(r.level)&&n.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return this.options.levels.reduce((r,n)=>({...r,...{[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}}),{})},addInputRules(){return this.options.levels.map(r=>(0,s.JJ)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}}),l=o},53961:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],l=(0,s.A)("zap",o)},58940:(r,n,i)=>{"use strict";i.d(n,{A:()=>j});var s=i(82159),o=(r,n)=>{if("slot"===r)return 0;if(r instanceof Function)return r(n);let{children:i,...s}=null!=n?n:{};if("svg"===r)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[r,s,i]},l=/^\s*>\s$/,a=s.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:r}){return o("blockquote",{...(0,s.KV)(this.options.HTMLAttributes,r),children:o("slot",{})})},parseMarkdown:(r,n)=>{var i;let s=null!=(i=n.parseBlockChildren)?i:n.parseChildren;return n.createNode("blockquote",void 0,s(r.tokens||[]))},renderMarkdown:(r,n)=>{if(!r.content)return"";let i=">",s=[];return r.content.forEach((r,o)=>{var l,a;let u=(null!=(a=null==(l=n.renderChild)?void 0:l.call(n,r,o))?a:n.renderChildren([r])).split("\n").map(r=>""===r.trim()?i:`${i} ${r}`);s.push(u.join("\n"))}),s.join(`
12
+ `,n.outerHTML}let nE=x.bP.create({name:"blockquote"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.blockquote,parse:{}}})}),nS=x.bP.create({name:"bulletList"}).extend({addStorage:()=>({markdown:{serialize(r,n){return r.renderList(n," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}})}),nM=x.bP.create({name:"codeBlock"}).extend({addStorage:()=>({markdown:{serialize(r,n){r.write("```"+(n.attrs.language||"")+"\n"),r.text(n.textContent,!1),r.ensureNewLine(),r.write("```"),r.closeBlock(n)},parse:{setup(r){var n;r.set({langPrefix:null!=(n=this.options.languageClassPrefix)?n:"language-"})},updateDOM(r){r.innerHTML=r.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}})}),nT=x.bP.create({name:"hardBreak"}).extend({addStorage:()=>({markdown:{serialize(r,n,i,s){for(let o=s+1;o<i.childCount;o++)if(i.child(o).type!=n.type)return void r.write(r.inTable?nv.storage.markdown.serialize.call(this,r,n,i):"\\\n")},parse:{}}})}),nD=x.bP.create({name:"heading"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.heading,parse:{}}})}),nF=x.bP.create({name:"horizontalRule"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.horizontal_rule,parse:{}}})}),nI=x.bP.create({name:"image"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.image,parse:{}}})}),nL=x.bP.create({name:"listItem"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.list_item,parse:{}}})});function nR(r,n,i){let s=0;for(;i-s>0&&n.child(i-s-1).type.name===r.type.name;s++);return s}let nN=x.bP.create({name:"orderedList"}).extend({addStorage:()=>({markdown:{serialize(r,n,i,s){let o=n.attrs.start||1,l=String(o+n.childCount-1).length,a=r.repeat(" ",l+2),u=nR(n,i,s)%2?") ":". ";r.renderList(n,a,n=>{let i=String(o+n);return r.repeat(" ",l-i.length)+i+u})},parse:{}}})}),nO=x.bP.create({name:"paragraph"}).extend({addStorage:()=>({markdown:{serialize:ne.nodes.paragraph,parse:{}}})});function nz(r){var n,i;return null!=(n=null==r||null==(i=r.content)?void 0:i.content)?n:[]}let nP=x.bP.create({name:"table"}).extend({addStorage:()=>({markdown:{serialize(r,n,i){nB(n)?(r.inTable=!0,n.forEach((n,i,s)=>{if(r.write("| "),n.forEach((n,i,s)=>{s&&r.write(" | ");let o=n.firstChild;o.textContent.trim()&&r.renderInline(o)}),r.write(" |"),r.ensureNewLine(),!s){let i=Array.from({length:n.childCount}).map(()=>"---").join(" | ");r.write(`| ${i} |`),r.ensureNewLine()}}),r.closeBlock(n),r.inTable=!1):nv.storage.markdown.serialize.call(this,r,n,i)},parse:{}}})});function n$(r){return r.attrs.colspan>1||r.attrs.rowspan>1}function nB(r){let n=nz(r),i=n[0],s=n.slice(1);return!(nz(i).some(r=>"tableHeader"!==r.type.name||n$(r)||r.childCount>1)||s.some(r=>nz(r).some(r=>"tableHeader"===r.type.name||n$(r)||r.childCount>1)))}let nq=x.bP.create({name:"taskItem"}).extend({addStorage:()=>({markdown:{serialize(r,n){let i=n.attrs.checked?"[x]":"[ ]";r.write(`${i} `),r.renderContent(n)},parse:{updateDOM(r){[...r.querySelectorAll(".task-list-item")].forEach(r=>{let n=r.querySelector("input");r.setAttribute("data-type","taskItem"),n&&(r.setAttribute("data-checked",n.checked),n.remove())})}}}})}),nj=x.bP.create({name:"taskList"}).extend({addStorage:()=>({markdown:{serialize:nS.storage.markdown.serialize,parse:{setup(r){r.use(ni)},updateDOM(r){[...r.querySelectorAll(".contains-task-list")].forEach(r=>{r.setAttribute("data-type","taskList")})}}}})}),nH=[nE,nS,nM,nT,nD,nF,nv,nI,nL,nN,nO,nP,nq,nj,x.bP.create({name:"text"}).extend({addStorage:()=>({markdown:{serialize(r,n){r.text(nb(n.text))},parse:{}}})}),x.CU.create({name:"bold"}).extend({addStorage:()=>({markdown:{serialize:ne.marks.strong,parse:{}}})}),x.CU.create({name:"code"}).extend({addStorage:()=>({markdown:{serialize:ne.marks.code,parse:{}}})}),n_,x.CU.create({name:"italic"}).extend({addStorage:()=>({markdown:{serialize:ne.marks.em,parse:{}}})}),x.CU.create({name:"link"}).extend({addStorage:()=>({markdown:{serialize:ne.marks.link,parse:{}}})}),x.CU.create({name:"strike"}).extend({addStorage:()=>({markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}})})];function nV(r){var n,i;let s=null==(n=r.storage)?void 0:n.markdown,o=null==(i=nH.find(n=>n.name===r.name))?void 0:i.storage.markdown;return s||o?{...o,...s}:null}class nU{constructor(r){na(this,"editor",null),this.editor=r}serialize(r){let n=new ng(this.nodes,this.marks,{hardBreakNodeName:nT.name});return n.renderContent(r),n.out}get nodes(){var r;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(r=>[r,this.serializeNode(nv)])),...Object.fromEntries(null!=(r=this.editor.extensionManager.extensions.filter(r=>"node"===r.type&&this.serializeNode(r)).map(r=>[r.name,this.serializeNode(r)]))?r:[])}}get marks(){var r;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(r=>[r,this.serializeMark(n_)])),...Object.fromEntries(null!=(r=this.editor.extensionManager.extensions.filter(r=>"mark"===r.type&&this.serializeMark(r)).map(r=>[r.name,this.serializeMark(r)]))?r:[])}}serializeNode(r){var n;return null==(n=nV(r))||null==(n=n.serialize)?void 0:n.bind({editor:this.editor,options:r.options})}serializeMark(r){var n;let i=null==(n=nV(r))?void 0:n.serialize;return i?{...i,open:"function"==typeof i.open?i.open.bind({editor:this.editor,options:r.options}):i.open,close:"function"==typeof i.close?i.close.bind({editor:this.editor,options:r.options}):i.close}:null}}class nW{constructor(r,n){na(this,"editor",null),na(this,"md",null);let{html:i,linkify:s,breaks:o}=n;this.editor=r,this.md=this.withPatchedRenderer(rX({html:i,linkify:s,breaks:o}))}parse(r){let{inline:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"==typeof r){this.editor.extensionManager.extensions.forEach(r=>{var n;return null==(n=nV(r))||null==(n=n.parse)||null==(n=n.setup)?void 0:n.call({editor:this.editor,options:r.options},this.md)});let i=nk(this.md.render(r));return this.editor.extensionManager.extensions.forEach(r=>{var n;return null==(n=nV(r))||null==(n=n.parse)||null==(n=n.updateDOM)?void 0:n.call({editor:this.editor,options:r.options},i)}),this.normalizeDOM(i,{inline:n,content:r}),i.innerHTML}return r}normalizeDOM(r,n){let{inline:i,content:s}=n;return this.normalizeBlocks(r),r.querySelectorAll("*").forEach(r=>{var n;(null==(n=r.nextSibling)?void 0:n.nodeType)!==Node.TEXT_NODE||r.closest("pre")||(r.nextSibling.textContent=r.nextSibling.textContent.replace(/^\n/,""))}),i&&this.normalizeInline(r,s),r}normalizeBlocks(r){let n=Object.values(this.editor.schema.nodes).filter(r=>r.isBlock).map(r=>{var n;return null==(n=r.spec.parseDOM)?void 0:n.map(r=>r.tag)}).flat().filter(Boolean).join(",");n&&[...r.querySelectorAll(n)].forEach(r=>{r.parentElement.matches("p")&&nw(r)})}normalizeInline(r,n){var i,s,o,l,a;if(null!=(i=r.firstElementChild)&&i.matches("p")){let i=r.firstElementChild,{nextElementSibling:u}=i,c=null!=(s=null==(o=n.match(/^\s+/))?void 0:o[0])?s:"",h=u?"":null!=(l=null==(a=n.match(/\s+$/))?void 0:a[0])?l:"";if(n.match(/^\n\n/)){i.innerHTML=`${i.innerHTML}${h}`;return}nx(i),r.innerHTML=`${c}${r.innerHTML}${h}`}}withPatchedRenderer(r){let n=r=>function(){let n=r(...arguments);return"\n"===n?n:"\n"===n[n.length-1]?n.slice(0,-1):n};return r.renderer.rules.hardbreak=n(r.renderer.rules.hardbreak),r.renderer.rules.softbreak=n(r.renderer.rules.softbreak),r.renderer.rules.fence=n(r.renderer.rules.fence),r.renderer.rules.code_block=n(r.renderer.rules.code_block),r.renderer.renderToken=n(r.renderer.renderToken.bind(r.renderer)),r}}let nJ=x.YY.create({name:"markdownClipboard",addOptions:()=>({transformPastedText:!1,transformCopiedText:!1}),addProseMirrorPlugins(){return[new ns.k_({key:new ns.hs("markdownClipboard"),props:{clipboardTextParser:(r,n,i)=>{if(i||!this.options.transformPastedText)return null;let s=this.editor.storage.markdown.parser.parse(r,{inline:!0});return v.S4.fromSchema(this.editor.schema).parseSlice(nk(s),{preserveWhitespace:!0,context:n})},clipboardTextSerializer:r=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(r.content):null}})]}}),nK=x.YY.create({name:"markdown",priority:50,addOptions:()=>({html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}),addCommands(){let r=x.XO.Commands.config.addCommands();return{setContent:(n,i)=>s=>r.setContent(s.editor.storage.markdown.parser.parse(n),i)(s),insertContentAt:(n,i,s)=>o=>r.insertContentAt(n,o.editor.storage.markdown.parser.parse(i,{inline:!0}),s)(o)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new nW(this.editor,this.options),serializer:new nU(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage:()=>({}),addExtensions(){return[nu.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),nJ.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}})},27050:(r,n,i)=>{"use strict";function s(r){this.content=r}i.d(n,{S4:()=>eu,ZF:()=>ev,FK:()=>u,CU:()=>p,sX:()=>ei,bP:()=>R,u$:()=>I,vI:()=>f,Sj:()=>es,Ji:()=>m}),s.prototype={constructor:s,find:function(r){for(var n=0;n<this.content.length;n+=2)if(this.content[n]===r)return n;return -1},get:function(r){var n=this.find(r);return -1==n?void 0:this.content[n+1]},update:function(r,n,i){var o=i&&i!=r?this.remove(i):this,l=o.find(r),a=o.content.slice();return -1==l?a.push(i||r,n):(a[l+1]=n,i&&(a[l]=i)),new s(a)},remove:function(r){var n=this.find(r);if(-1==n)return this;var i=this.content.slice();return i.splice(n,2),new s(i)},addToStart:function(r,n){return new s([r,n].concat(this.remove(r).content))},addToEnd:function(r,n){var i=this.remove(r).content.slice();return i.push(r,n),new s(i)},addBefore:function(r,n,i){var o=this.remove(n),l=o.content.slice(),a=o.find(r);return l.splice(-1==a?l.length:a,0,n,i),new s(l)},forEach:function(r){for(var n=0;n<this.content.length;n+=2)r(this.content[n],this.content[n+1])},prepend:function(r){return(r=s.from(r)).size?new s(r.content.concat(this.subtract(r).content)):this},append:function(r){return(r=s.from(r)).size?new s(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var n=this;r=s.from(r);for(var i=0;i<r.content.length;i+=2)n=n.remove(r.content[i]);return n},toObject:function(){var r={};return this.forEach(function(n,i){r[n]=i}),r},get size(){return this.content.length>>1}},s.from=function(r){if(r instanceof s)return r;var n=[];if(r)for(var i in r)n.push(i,r[i]);return new s(n)};let o=s;function l(r,n,i){for(let s=0;;s++){if(s==r.childCount||s==n.childCount)return r.childCount==n.childCount?null:i;let o=r.child(s),a=n.child(s);if(o==a){i+=o.nodeSize;continue}if(!o.sameMarkup(a))return i;if(o.isText&&o.text!=a.text){for(let r=0;o.text[r]==a.text[r];r++)i++;return i}if(o.content.size||a.content.size){let r=l(o.content,a.content,i+1);if(null!=r)return r}i+=o.nodeSize}}function a(r,n,i,s){for(let o=r.childCount,l=n.childCount;;){if(0==o||0==l)return o==l?null:{a:i,b:s};let u=r.child(--o),c=n.child(--l),h=u.nodeSize;if(u==c){i-=h,s-=h;continue}if(!u.sameMarkup(c))return{a:i,b:s};if(u.isText&&u.text!=c.text){let r=0,n=Math.min(u.text.length,c.text.length);for(;r<n&&u.text[u.text.length-r-1]==c.text[c.text.length-r-1];)r++,i--,s--;return{a:i,b:s}}if(u.content.size||c.content.size){let r=a(u.content,c.content,i-1,s-1);if(r)return r}i-=h,s-=h}}class u{constructor(r,n){if(this.content=r,this.size=n||0,null==n)for(let n=0;n<r.length;n++)this.size+=r[n].nodeSize}nodesBetween(r,n,i,s=0,o){for(let l=0,a=0;a<n;l++){let u=this.content[l],c=a+u.nodeSize;if(c>r&&!1!==i(u,s+a,o||null,l)&&u.content.size){let o=a+1;u.nodesBetween(Math.max(0,r-o),Math.min(u.content.size,n-o),i,s+o)}a=c}}descendants(r){this.nodesBetween(0,this.size,r)}textBetween(r,n,i,s){let o="",l=!0;return this.nodesBetween(r,n,(a,u)=>{let c=a.isText?a.text.slice(Math.max(r,u)-u,n-u):a.isLeaf?s?"function"==typeof s?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&i&&(l?l=!1:o+=i),o+=c},0),o}append(r){if(!r.size)return this;if(!this.size)return r;let n=this.lastChild,i=r.firstChild,s=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(i)&&(s[s.length-1]=n.withText(n.text+i.text),o=1);o<r.content.length;o++)s.push(r.content[o]);return new u(s,this.size+r.size)}cut(r,n=this.size){if(0==r&&n==this.size)return this;let i=[],s=0;if(n>r)for(let o=0,l=0;l<n;o++){let a=this.content[o],u=l+a.nodeSize;u>r&&((l<r||u>n)&&(a=a.isText?a.cut(Math.max(0,r-l),Math.min(a.text.length,n-l)):a.cut(Math.max(0,r-l-1),Math.min(a.content.size,n-l-1))),i.push(a),s+=a.nodeSize),l=u}return new u(i,s)}cutByIndex(r,n){return r==n?u.empty:0==r&&n==this.content.length?this:new u(this.content.slice(r,n))}replaceChild(r,n){let i=this.content[r];if(i==n)return this;let s=this.content.slice(),o=this.size+n.nodeSize-i.nodeSize;return s[r]=n,new u(s,o)}addToStart(r){return new u([r].concat(this.content),this.size+r.nodeSize)}addToEnd(r){return new u(this.content.concat(r),this.size+r.nodeSize)}eq(r){if(this.content.length!=r.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(r.content[n]))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(r){let n=this.content[r];if(!n)throw RangeError("Index "+r+" out of range for "+this);return n}maybeChild(r){return this.content[r]||null}forEach(r){for(let n=0,i=0;n<this.content.length;n++){let s=this.content[n];r(s,i,n),i+=s.nodeSize}}findDiffStart(r,n=0){return l(this,r,n)}findDiffEnd(r,n=this.size,i=r.size){return a(this,r,n,i)}findIndex(r){if(0==r)return h(0,r);if(r==this.size)return h(this.content.length,r);if(r>this.size||r<0)throw RangeError(`Position ${r} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=i+this.child(n).nodeSize;if(s>=r){if(s==r)return h(n+1,s);return h(n,i)}i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(r=>r.toJSON()):null}static fromJSON(r,n){if(!n)return u.empty;if(!Array.isArray(n))throw RangeError("Invalid input for Fragment.fromJSON");return new u(n.map(r.nodeFromJSON))}static fromArray(r){if(!r.length)return u.empty;let n,i=0;for(let s=0;s<r.length;s++){let o=r[s];i+=o.nodeSize,s&&o.isText&&r[s-1].sameMarkup(o)?(n||(n=r.slice(0,s)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new u(n||r,i)}static from(r){if(!r)return u.empty;if(r instanceof u)return r;if(Array.isArray(r))return this.fromArray(r);if(r.attrs)return new u([r],r.nodeSize);throw RangeError("Can not convert "+r+" to a Fragment"+(r.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}u.empty=new u([],0);let c={index:0,offset:0};function h(r,n){return c.index=r,c.offset=n,c}function d(r,n){if(r===n)return!0;if(!(r&&"object"==typeof r)||!(n&&"object"==typeof n))return!1;let i=Array.isArray(r);if(Array.isArray(n)!=i)return!1;if(i){if(r.length!=n.length)return!1;for(let i=0;i<r.length;i++)if(!d(r[i],n[i]))return!1}else{for(let i in r)if(!(i in n)||!d(r[i],n[i]))return!1;for(let i in n)if(!(i in r))return!1}return!0}class p{constructor(r,n){this.type=r,this.attrs=n}addToSet(r){let n,i=!1;for(let s=0;s<r.length;s++){let o=r[s];if(this.eq(o))return r;if(this.type.excludes(o.type))n||(n=r.slice(0,s));else{if(o.type.excludes(this.type))return r;!i&&o.type.rank>this.type.rank&&(n||(n=r.slice(0,s)),n.push(this),i=!0),n&&n.push(o)}}return n||(n=r.slice()),i||n.push(this),n}removeFromSet(r){for(let n=0;n<r.length;n++)if(this.eq(r[n]))return r.slice(0,n).concat(r.slice(n+1));return r}isInSet(r){for(let n=0;n<r.length;n++)if(this.eq(r[n]))return!0;return!1}eq(r){return this==r||this.type==r.type&&d(this.attrs,r.attrs)}toJSON(){let r={type:this.type.name};for(let n in this.attrs){r.attrs=this.attrs;break}return r}static fromJSON(r,n){if(!n)throw RangeError("Invalid input for Mark.fromJSON");let i=r.marks[n.type];if(!i)throw RangeError(`There is no mark type ${n.type} in this schema`);let s=i.create(n.attrs);return i.checkAttrs(s.attrs),s}static sameSet(r,n){if(r==n)return!0;if(r.length!=n.length)return!1;for(let i=0;i<r.length;i++)if(!r[i].eq(n[i]))return!1;return!0}static setFrom(r){if(!r||Array.isArray(r)&&0==r.length)return p.none;if(r instanceof p)return[r];let n=r.slice();return n.sort((r,n)=>r.type.rank-n.type.rank),n}}p.none=[];class f extends Error{}class m{constructor(r,n,i){this.content=r,this.openStart=n,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(r,n){let i=_(this.content,r+this.openStart,n);return i&&new m(i,this.openStart,this.openEnd)}removeBetween(r,n){return new m(g(this.content,r+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(r){return this.content.eq(r.content)&&this.openStart==r.openStart&&this.openEnd==r.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let r={content:this.content.toJSON()};return this.openStart>0&&(r.openStart=this.openStart),this.openEnd>0&&(r.openEnd=this.openEnd),r}static fromJSON(r,n){if(!n)return m.empty;let i=n.openStart||0,s=n.openEnd||0;if("number"!=typeof i||"number"!=typeof s)throw RangeError("Invalid input for Slice.fromJSON");return new m(u.fromJSON(r,n.content),i,s)}static maxOpen(r,n=!0){let i=0,s=0;for(let s=r.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)i++;for(let i=r.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new m(r,i,s)}}function g(r,n,i){let{index:s,offset:o}=r.findIndex(n),l=r.maybeChild(s),{index:a,offset:u}=r.findIndex(i);if(o==n||l.isText){if(u!=i&&!r.child(a).isText)throw RangeError("Removing non-flat range");return r.cut(0,n).append(r.cut(i))}if(s!=a)throw RangeError("Removing non-flat range");return r.replaceChild(s,l.copy(g(l.content,n-o-1,i-o-1)))}function _(r,n,i,s){let{index:o,offset:l}=r.findIndex(n),a=r.maybeChild(o);if(l==n||a.isText)return s&&!s.canReplace(o,o,i)?null:r.cut(0,n).append(i).append(r.cut(n));let u=_(a.content,n-l-1,i,a);return u&&r.replaceChild(o,a.copy(u))}function y(r,n,i){if(i.openStart>r.depth)throw new f("Inserted content deeper than insertion position");if(r.depth-i.openStart!=n.depth-i.openEnd)throw new f("Inconsistent open depths");return k(r,n,i,0)}function k(r,n,i,s){let o=r.index(s),l=r.node(s);if(o==n.index(s)&&s<r.depth-i.openStart){let a=k(r,n,i,s+1);return l.copy(l.content.replaceChild(o,a))}if(!i.content.size)return C(l,E(r,n,s));if(i.openStart||i.openEnd||r.depth!=s||n.depth!=s){let{start:o,end:a}=S(i,r);return C(l,A(r,o,a,n,s))}{let s=r.parent,o=s.content;return C(s,o.cut(0,r.parentOffset).append(i.content).append(o.cut(n.parentOffset)))}}function b(r,n){if(!n.type.compatibleContent(r.type))throw new f("Cannot join "+n.type.name+" onto "+r.type.name)}function w(r,n,i){let s=r.node(i);return b(s,n.node(i)),s}function x(r,n){let i=n.length-1;i>=0&&r.isText&&r.sameMarkup(n[i])?n[i]=r.withText(n[i].text+r.text):n.push(r)}function v(r,n,i,s){let o=(n||r).node(i),l=0,a=n?n.index(i):o.childCount;r&&(l=r.index(i),r.depth>i?l++:r.textOffset&&(x(r.nodeAfter,s),l++));for(let r=l;r<a;r++)x(o.child(r),s);n&&n.depth==i&&n.textOffset&&x(n.nodeBefore,s)}function C(r,n){return r.type.checkContent(n),r.copy(n)}function A(r,n,i,s,o){let l=r.depth>o&&w(r,n,o+1),a=s.depth>o&&w(i,s,o+1),c=[];return v(null,r,o,c),l&&a&&n.index(o)==i.index(o)?(b(l,a),x(C(l,A(r,n,i,s,o+1)),c)):(l&&x(C(l,E(r,n,o+1)),c),v(n,i,o,c),a&&x(C(a,E(i,s,o+1)),c)),v(s,null,o,c),new u(c)}function E(r,n,i){let s=[];return v(null,r,i,s),r.depth>i&&x(C(w(r,n,i+1),E(r,n,i+1)),s),v(n,null,i,s),new u(s)}function S(r,n){let i=n.depth-r.openStart,s=n.node(i).copy(r.content);for(let r=i-1;r>=0;r--)s=n.node(r).copy(u.from(s));return{start:s.resolveNoCache(r.openStart+i),end:s.resolveNoCache(s.content.size-r.openEnd-i)}}m.empty=new m(u.empty,0,0);class M{constructor(r,n,i){this.pos=r,this.path=n,this.parentOffset=i,this.depth=n.length/3-1}resolveDepth(r){return null==r?this.depth:r<0?this.depth+r:r}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(r){return this.path[3*this.resolveDepth(r)]}index(r){return this.path[3*this.resolveDepth(r)+1]}indexAfter(r){return r=this.resolveDepth(r),this.index(r)+(r!=this.depth||this.textOffset?1:0)}start(r){return 0==(r=this.resolveDepth(r))?0:this.path[3*r-1]+1}end(r){return r=this.resolveDepth(r),this.start(r)+this.node(r).content.size}before(r){if(!(r=this.resolveDepth(r)))throw RangeError("There is no position before the top-level node");return r==this.depth+1?this.pos:this.path[3*r-1]}after(r){if(!(r=this.resolveDepth(r)))throw RangeError("There is no position after the top-level node");return r==this.depth+1?this.pos:this.path[3*r-1]+this.path[3*r].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let r=this.parent,n=this.index(this.depth);if(n==r.childCount)return null;let i=this.pos-this.path[this.path.length-1],s=r.child(n);return i?r.child(n).cut(i):s}get nodeBefore(){let r=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(r).cut(0,n):0==r?null:this.parent.child(r-1)}posAtIndex(r,n){n=this.resolveDepth(n);let i=this.path[3*n],s=0==n?0:this.path[3*n-1]+1;for(let n=0;n<r;n++)s+=i.child(n).nodeSize;return s}marks(){let r=this.parent,n=this.index();if(0==r.content.size)return p.none;if(this.textOffset)return r.child(n).marks;let i=r.maybeChild(n-1),s=r.maybeChild(n);if(!i){let r=i;i=s,s=r}let o=i.marks;for(var l=0;l<o.length;l++)!1!==o[l].type.spec.inclusive||s&&o[l].isInSet(s.marks)||(o=o[l--].removeFromSet(o));return o}marksAcross(r){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let i=n.marks,s=r.parent.maybeChild(r.index());for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||s&&i[o].isInSet(s.marks)||(i=i[o--].removeFromSet(i));return i}sharedDepth(r){for(let n=this.depth;n>0;n--)if(this.start(n)<=r&&this.end(n)>=r)return n;return 0}blockRange(r=this,n){if(r.pos<this.pos)return r.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==r.pos?1:0);i>=0;i--)if(r.pos<=this.end(i)&&(!n||n(this.node(i))))return new I(this,r,i);return null}sameParent(r){return this.pos-this.parentOffset==r.pos-r.parentOffset}max(r){return r.pos>this.pos?r:this}min(r){return r.pos<this.pos?r:this}toString(){let r="";for(let n=1;n<=this.depth;n++)r+=(r?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return r+":"+this.parentOffset}static resolve(r,n){if(!(n>=0&&n<=r.content.size))throw RangeError("Position "+n+" out of range");let i=[],s=0,o=n;for(let n=r;;){let{index:r,offset:l}=n.content.findIndex(o),a=o-l;if(i.push(n,r,s+l),!a||(n=n.child(r)).isText)break;o=a-1,s+=l+1}return new M(n,i,o)}static resolveCached(r,n){let i=F.get(r);if(i)for(let r=0;r<i.elts.length;r++){let s=i.elts[r];if(s.pos==n)return s}else F.set(r,i=new T);let s=i.elts[i.i]=M.resolve(r,n);return i.i=(i.i+1)%D,s}}class T{constructor(){this.elts=[],this.i=0}}let D=12,F=new WeakMap;class I{constructor(r,n,i){this.$from=r,this.$to=n,this.depth=i}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let L=Object.create(null);class R{constructor(r,n,i,s=p.none){this.type=r,this.attrs=n,this.marks=s,this.content=i||u.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(r){return this.content.child(r)}maybeChild(r){return this.content.maybeChild(r)}forEach(r){this.content.forEach(r)}nodesBetween(r,n,i,s=0){this.content.nodesBetween(r,n,i,s,this)}descendants(r){this.nodesBetween(0,this.content.size,r)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(r,n,i,s){return this.content.textBetween(r,n,i,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(r){return this==r||this.sameMarkup(r)&&this.content.eq(r.content)}sameMarkup(r){return this.hasMarkup(r.type,r.attrs,r.marks)}hasMarkup(r,n,i){return this.type==r&&d(this.attrs,n||r.defaultAttrs||L)&&p.sameSet(this.marks,i||p.none)}copy(r=null){return r==this.content?this:new R(this.type,this.attrs,r,this.marks)}mark(r){return r==this.marks?this:new R(this.type,this.attrs,this.content,r)}cut(r,n=this.content.size){return 0==r&&n==this.content.size?this:this.copy(this.content.cut(r,n))}slice(r,n=this.content.size,i=!1){if(r==n)return m.empty;let s=this.resolve(r),o=this.resolve(n),l=i?0:s.sharedDepth(n),a=s.start(l);return new m(s.node(l).content.cut(s.pos-a,o.pos-a),s.depth-l,o.depth-l)}replace(r,n,i){return y(this.resolve(r),this.resolve(n),i)}nodeAt(r){for(let n=this;;){let{index:i,offset:s}=n.content.findIndex(r);if(!(n=n.maybeChild(i)))return null;if(s==r||n.isText)return n;r-=s+1}}childAfter(r){let{index:n,offset:i}=this.content.findIndex(r);return{node:this.content.maybeChild(n),index:n,offset:i}}childBefore(r){if(0==r)return{node:null,index:0,offset:0};let{index:n,offset:i}=this.content.findIndex(r);if(i<r)return{node:this.content.child(n),index:n,offset:i};let s=this.content.child(n-1);return{node:s,index:n-1,offset:i-s.nodeSize}}resolve(r){return M.resolveCached(this,r)}resolveNoCache(r){return M.resolve(this,r)}rangeHasMark(r,n,i){let s=!1;return n>r&&this.nodesBetween(r,n,r=>(i.isInSet(r.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let r=this.type.name;return this.content.size&&(r+="("+this.content.toStringInner()+")"),O(this.marks,r)}contentMatchAt(r){let n=this.type.contentMatch.matchFragment(this.content,0,r);if(!n)throw Error("Called contentMatchAt on a node with invalid content");return n}canReplace(r,n,i=u.empty,s=0,o=i.childCount){let l=this.contentMatchAt(r).matchFragment(i,s,o),a=l&&l.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let r=s;r<o;r++)if(!this.type.allowsMarks(i.child(r).marks))return!1;return!0}canReplaceWith(r,n,i,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(r).matchType(i),l=o&&o.matchFragment(this.content,n);return!!l&&l.validEnd}canAppend(r){return r.content.size?this.canReplace(this.childCount,this.childCount,r.content):this.type.compatibleContent(r.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let r=p.none;for(let n=0;n<this.marks.length;n++){let i=this.marks[n];i.type.checkAttrs(i.attrs),r=i.addToSet(r)}if(!p.sameSet(r,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let r={type:this.type.name};for(let n in this.attrs){r.attrs=this.attrs;break}return this.content.size&&(r.content=this.content.toJSON()),this.marks.length&&(r.marks=this.marks.map(r=>r.toJSON())),r}static fromJSON(r,n){let i;if(!n)throw RangeError("Invalid input for Node.fromJSON");if(n.marks){if(!Array.isArray(n.marks))throw RangeError("Invalid mark data for Node.fromJSON");i=n.marks.map(r.markFromJSON)}if("text"==n.type){if("string"!=typeof n.text)throw RangeError("Invalid text node in JSON");return r.text(n.text,i)}let s=u.fromJSON(r,n.content),o=r.nodeType(n.type).create(n.attrs,s,i);return o.type.checkAttrs(o.attrs),o}}R.prototype.text=void 0;class N extends R{constructor(r,n,i,s){if(super(r,n,null,s),!i)throw RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):O(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(r,n){return this.text.slice(r,n)}get nodeSize(){return this.text.length}mark(r){return r==this.marks?this:new N(this.type,this.attrs,this.text,r)}withText(r){return r==this.text?this:new N(this.type,this.attrs,r,this.marks)}cut(r=0,n=this.text.length){return 0==r&&n==this.text.length?this:this.withText(this.text.slice(r,n))}eq(r){return this.sameMarkup(r)&&this.text==r.text}toJSON(){let r=super.toJSON();return r.text=this.text,r}}function O(r,n){for(let i=r.length-1;i>=0;i--)n=r[i].type.name+"("+n+")";return n}class z{constructor(r){this.validEnd=r,this.next=[],this.wrapCache=[]}static parse(r,n){let i=new P(r,n);if(null==i.next)return z.empty;let s=$(i);i.next&&i.err("Unexpected trailing text");let o=G(W(s));return Z(o,i),o}matchType(r){for(let n=0;n<this.next.length;n++)if(this.next[n].type==r)return this.next[n].next;return null}matchFragment(r,n=0,i=r.childCount){let s=this;for(let o=n;s&&o<i;o++)s=s.matchType(r.child(o).type);return s}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let r=0;r<this.next.length;r++){let{type:n}=this.next[r];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(r){for(let n=0;n<this.next.length;n++)for(let i=0;i<r.next.length;i++)if(this.next[n].type==r.next[i].type)return!0;return!1}fillBefore(r,n=!1,i=0){let s=[this];function o(l,a){let c=l.matchFragment(r,i);if(c&&(!n||c.validEnd))return u.from(a.map(r=>r.createAndFill()));for(let r=0;r<l.next.length;r++){let{type:n,next:i}=l.next[r];if(!(n.isText||n.hasRequiredAttrs())&&-1==s.indexOf(i)){s.push(i);let r=o(i,a.concat(n));if(r)return r}}return null}return o(this,[])}findWrapping(r){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==r)return this.wrapCache[n+1];let n=this.computeWrapping(r);return this.wrapCache.push(r,n),n}computeWrapping(r){let n=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let s=i.shift(),o=s.match;if(o.matchType(r)){let r=[];for(let n=s;n.type;n=n.via)r.push(n.type);return r.reverse()}for(let r=0;r<o.next.length;r++){let{type:l,next:a}=o.next[r];l.isLeaf||l.hasRequiredAttrs()||l.name in n||s.type&&!a.validEnd||(i.push({match:l.contentMatch,type:l,via:s}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(r){if(r>=this.next.length)throw RangeError(`There's no ${r}th edge in this content match`);return this.next[r]}toString(){let r=[];function n(i){r.push(i);for(let s=0;s<i.next.length;s++)-1==r.indexOf(i.next[s].next)&&n(i.next[s].next)}return n(this),r.map((n,i)=>{let s=i+(n.validEnd?"*":" ")+" ";for(let i=0;i<n.next.length;i++)s+=(i?", ":"")+n.next[i].type.name+"->"+r.indexOf(n.next[i].next);return s}).join("\n")}}z.empty=new z(!0);class P{constructor(r,n){this.string=r,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=r.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(r){return this.next==r&&(this.pos++||!0)}err(r){throw SyntaxError(r+" (in content expression '"+this.string+"')")}}function $(r){let n=[];do n.push(B(r));while(r.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}function B(r){let n=[];do n.push(q(r));while(r.next&&")"!=r.next&&"|"!=r.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}function q(r){let n=U(r);for(;;)if(r.eat("+"))n={type:"plus",expr:n};else if(r.eat("*"))n={type:"star",expr:n};else if(r.eat("?"))n={type:"opt",expr:n};else if(r.eat("{"))n=H(r,n);else break;return n}function j(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let n=Number(r.next);return r.pos++,n}function H(r,n){let i=j(r),s=i;return r.eat(",")&&(s="}"!=r.next?j(r):-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:i,max:s,expr:n}}function V(r,n){let i=r.nodeTypes,s=i[n];if(s)return[s];let o=[];for(let r in i){let s=i[r];s.isInGroup(n)&&o.push(s)}return 0==o.length&&r.err("No node type or group '"+n+"' found"),o}function U(r){if(r.eat("(")){let n=$(r);return r.eat(")")||r.err("Missing closing paren"),n}if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let n=V(r,r.next).map(n=>(null==r.inline?r.inline=n.isInline:r.inline!=n.isInline&&r.err("Mixing inline and block content"),{type:"name",value:n}));return r.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}}function W(r){let n=[[]];return o(l(r,0),i()),n;function i(){return n.push([])-1}function s(r,i,s){let o={term:s,to:i};return n[r].push(o),o}function o(r,n){r.forEach(r=>r.to=n)}function l(r,n){if("choice"==r.type)return r.exprs.reduce((r,i)=>r.concat(l(i,n)),[]);if("seq"==r.type)for(let s=0;;s++){let a=l(r.exprs[s],n);if(s==r.exprs.length-1)return a;o(a,n=i())}else if("star"==r.type){let a=i();return s(n,a),o(l(r.expr,a),a),[s(a)]}else if("plus"==r.type){let a=i();return o(l(r.expr,n),a),o(l(r.expr,a),a),[s(a)]}else if("opt"==r.type)return[s(n)].concat(l(r.expr,n));else if("range"==r.type){let a=n;for(let n=0;n<r.min;n++){let n=i();o(l(r.expr,a),n),a=n}if(-1==r.max)o(l(r.expr,a),a);else for(let n=r.min;n<r.max;n++){let n=i();s(a,n),o(l(r.expr,a),n),a=n}return[s(a)]}else if("name"==r.type)return[s(n,void 0,r.value)];else throw Error("Unknown expr type")}}function J(r,n){return n-r}function K(r,n){let i=[];return s(n),i.sort(J);function s(n){let o=r[n];if(1==o.length&&!o[0].term)return s(o[0].to);i.push(n);for(let r=0;r<o.length;r++){let{term:n,to:l}=o[r];n||-1!=i.indexOf(l)||s(l)}}}function G(r){let n=Object.create(null);return i(K(r,0));function i(s){let o=[];s.forEach(n=>{r[n].forEach(({term:n,to:i})=>{let s;if(n){for(let r=0;r<o.length;r++)o[r][0]==n&&(s=o[r][1]);K(r,i).forEach(r=>{s||o.push([n,s=[]]),-1==s.indexOf(r)&&s.push(r)})}})});let l=n[s.join(",")]=new z(s.indexOf(r.length-1)>-1);for(let r=0;r<o.length;r++){let s=o[r][1].sort(J);l.next.push({type:o[r][0],next:n[s.join(",")]||i(s)})}return l}}function Z(r,n){for(let i=0,s=[r];i<s.length;i++){let r=s[i],o=!r.validEnd,l=[];for(let n=0;n<r.next.length;n++){let{type:i,next:a}=r.next[n];l.push(i.name),o&&!(i.isText||i.hasRequiredAttrs())&&(o=!1),-1==s.indexOf(a)&&s.push(a)}o&&n.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function X(r){let n=Object.create(null);for(let i in r){let s=r[i];if(!s.hasDefault)return null;n[i]=s.default}return n}function Y(r,n){let i=Object.create(null);for(let s in r){let o=n&&n[s];if(void 0===o){let n=r[s];if(n.hasDefault)o=n.default;else throw RangeError("No value supplied for attribute "+s)}i[s]=o}return i}function Q(r,n,i,s){for(let s in n)if(!(s in r))throw RangeError(`Unsupported attribute ${s} for ${i} of type ${s}`);for(let i in r){let s=r[i];s.validate&&s.validate(n[i])}}function ee(r,n){let i=Object.create(null);if(n)for(let s in n)i[s]=new en(r,s,n[s]);return i}class et{constructor(r,n,i){this.name=r,this.schema=n,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=ee(r,i.attrs),this.defaultAttrs=X(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||"text"==r),this.isText="text"==r}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==z.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(r){return this.groups.indexOf(r)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let r in this.attrs)if(this.attrs[r].isRequired)return!0;return!1}compatibleContent(r){return this==r||this.contentMatch.compatible(r.contentMatch)}computeAttrs(r){return!r&&this.defaultAttrs?this.defaultAttrs:Y(this.attrs,r)}create(r=null,n,i){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new R(this,this.computeAttrs(r),u.from(n),p.setFrom(i))}createChecked(r=null,n,i){return n=u.from(n),this.checkContent(n),new R(this,this.computeAttrs(r),n,p.setFrom(i))}createAndFill(r=null,n,i){if(r=this.computeAttrs(r),(n=u.from(n)).size){let r=this.contentMatch.fillBefore(n);if(!r)return null;n=r.append(n)}let s=this.contentMatch.matchFragment(n),o=s&&s.fillBefore(u.empty,!0);return o?new R(this,r,n.append(o),p.setFrom(i)):null}validContent(r){let n=this.contentMatch.matchFragment(r);if(!n||!n.validEnd)return!1;for(let n=0;n<r.childCount;n++)if(!this.allowsMarks(r.child(n).marks))return!1;return!0}checkContent(r){if(!this.validContent(r))throw RangeError(`Invalid content for node ${this.name}: ${r.toString().slice(0,50)}`)}checkAttrs(r){Q(this.attrs,r,"node",this.name)}allowsMarkType(r){return null==this.markSet||this.markSet.indexOf(r)>-1}allowsMarks(r){if(null==this.markSet)return!0;for(let n=0;n<r.length;n++)if(!this.allowsMarkType(r[n].type))return!1;return!0}allowedMarks(r){let n;if(null==this.markSet)return r;for(let i=0;i<r.length;i++)this.allowsMarkType(r[i].type)?n&&n.push(r[i]):n||(n=r.slice(0,i));return n?n.length?n:p.none:r}static compile(r,n){let i=Object.create(null);r.forEach((r,s)=>i[r]=new et(r,n,s));let s=n.spec.topNode||"doc";if(!i[s])throw RangeError("Schema is missing its top node type ('"+s+"')");if(!i.text)throw RangeError("Every schema needs a 'text' type");for(let r in i.text.attrs)throw RangeError("The text node type should not have attributes");return i}}function er(r,n,i){let s=i.split("|");return i=>{let o=null===i?"null":typeof i;if(0>s.indexOf(o))throw RangeError(`Expected value of type ${s} for attribute ${n} on type ${r}, got ${o}`)}}class en{constructor(r,n,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate="string"==typeof i.validate?er(r,n,i.validate):i.validate}get isRequired(){return!this.hasDefault}}class ei{constructor(r,n,i,s){this.name=r,this.rank=n,this.schema=i,this.spec=s,this.attrs=ee(r,s.attrs),this.excluded=null;let o=X(this.attrs);this.instance=o?new p(this,o):null}create(r=null){return!r&&this.instance?this.instance:new p(this,Y(this.attrs,r))}static compile(r,n){let i=Object.create(null),s=0;return r.forEach((r,o)=>i[r]=new ei(r,s++,n,o)),i}removeFromSet(r){for(var n=0;n<r.length;n++)r[n].type==this&&(r=r.slice(0,n).concat(r.slice(n+1)),n--);return r}isInSet(r){for(let n=0;n<r.length;n++)if(r[n].type==this)return r[n]}checkAttrs(r){Q(this.attrs,r,"mark",this.name)}excludes(r){return this.excluded.indexOf(r)>-1}}class es{constructor(r){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in r)n[i]=r[i];n.nodes=o.from(r.nodes),n.marks=o.from(r.marks||{}),this.nodes=et.compile(this.spec.nodes,this),this.marks=ei.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw RangeError(r+" can not be both a node and a mark");let n=this.nodes[r],s=n.spec.content||"",o=n.spec.marks;if(n.contentMatch=i[s]||(i[s]=z.parse(s,this.nodes)),n.inlineContent=n.contentMatch.inlineContent,n.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!n.isInline||!n.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=n}n.markSet="_"==o?null:o?eo(this,o.split(" ")):""!=o&&n.inlineContent?null:[]}for(let r in this.marks){let n=this.marks[r],i=n.spec.excludes;n.excluded=null==i?[n]:""==i?[]:eo(this,i.split(" "))}this.nodeFromJSON=r=>R.fromJSON(this,r),this.markFromJSON=r=>p.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(r,n=null,i,s){if("string"==typeof r)r=this.nodeType(r);else if(r instanceof et){if(r.schema!=this)throw RangeError("Node type from different schema used ("+r.name+")")}else throw RangeError("Invalid node type: "+r);return r.createChecked(n,i,s)}text(r,n){let i=this.nodes.text;return new N(i,i.defaultAttrs,r,p.setFrom(n))}mark(r,n){return"string"==typeof r&&(r=this.marks[r]),r.create(n)}nodeType(r){let n=this.nodes[r];if(!n)throw RangeError("Unknown node type: "+r);return n}}function eo(r,n){let i=[];for(let s=0;s<n.length;s++){let o=n[s],l=r.marks[o],a=l;if(l)i.push(l);else for(let n in r.marks){let s=r.marks[n];("_"==o||s.spec.group&&s.spec.group.split(" ").indexOf(o)>-1)&&i.push(a=s)}if(!a)throw SyntaxError("Unknown mark type: '"+n[s]+"'")}return i}function el(r){return null!=r.tag}function ea(r){return null!=r.style}class eu{constructor(r,n){this.schema=r,this.rules=n,this.tags=[],this.styles=[];let i=this.matchedStyles=[];n.forEach(r=>{if(el(r))this.tags.push(r);else if(ea(r)){let n=/[^=]*/.exec(r.style)[0];0>i.indexOf(n)&&i.push(n),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let i=r.nodes[n.node];return i.contentMatch.matchType(i)})}parse(r,n={}){let i=new ey(this,n,!1);return i.addAll(r,p.none,n.from,n.to),i.finish()}parseSlice(r,n={}){let i=new ey(this,n,!0);return i.addAll(r,p.none,n.from,n.to),m.maxOpen(i.finish())}matchTag(r,n,i){for(let s=i?this.tags.indexOf(i)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(eb(r,i.tag)&&(void 0===i.namespace||r.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let n=i.getAttrs(r);if(!1===n)continue;i.attrs=n||void 0}return i}}}matchStyle(r,n,i,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let s=this.styles[o],l=s.style;if(0==l.indexOf(r)&&(!s.context||i.matchesContext(s.context))&&(!(l.length>r.length)||61==l.charCodeAt(r.length)&&l.slice(r.length+1)==n)){if(s.getAttrs){let r=s.getAttrs(n);if(!1===r)continue;s.attrs=r||void 0}return s}}}static schemaRules(r){let n=[];function i(r){let i=null==r.priority?50:r.priority,s=0;for(;s<n.length;s++){let r=n[s];if((null==r.priority?50:r.priority)<i)break}n.splice(s,0,r)}for(let n in r.marks){let s=r.marks[n].spec.parseDOM;s&&s.forEach(r=>{i(r=ew(r)),r.mark||r.ignore||r.clearMark||(r.mark=n)})}for(let n in r.nodes){let s=r.nodes[n].spec.parseDOM;s&&s.forEach(r=>{i(r=ew(r)),r.node||r.ignore||r.mark||(r.node=n)})}return n}static fromSchema(r){return r.cached.domParser||(r.cached.domParser=new eu(r,eu.schemaRules(r)))}}let ec={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},eh={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ed={ol:!0,ul:!0},ep=1,ef=2,em=4;function eg(r,n,i){return null!=n?(n?ep:0)|("full"===n?ef:0):r&&"pre"==r.whitespace?ep|ef:i&~em}class e_{constructor(r,n,i,s,o,l){this.type=r,this.attrs=n,this.marks=i,this.solid=s,this.options=l,this.content=[],this.activeMarks=p.none,this.match=o||(l&em?null:r.contentMatch)}findWrapping(r){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(u.from(r));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(r.type))?(this.match=n,i):null}}return this.match.findWrapping(r.type)}finish(r){if(!(this.options&ep)){let r=this.content[this.content.length-1],n;if(r&&r.isText&&(n=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==n[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-n[0].length))}}let n=u.from(this.content);return!r&&this.match&&(n=n.append(this.match.fillBefore(u.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(r){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:r.parentNode&&!ec.hasOwnProperty(r.parentNode.nodeName.toLowerCase())}}class ey{constructor(r,n,i){this.parser=r,this.options=n,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let s=n.topNode,o,l=eg(null,n.preserveWhitespace,0)|(i?em:0);o=s?new e_(s.type,s.attrs,p.none,!0,n.topMatch||s.type.contentMatch,l):i?new e_(null,null,p.none,!0,null,l):new e_(r.schema.topNodeType,null,p.none,!0,null,l),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(r,n){3==r.nodeType?this.addTextNode(r,n):1==r.nodeType&&this.addElement(r,n)}addTextNode(r,n){let i=r.nodeValue,s=this.top,o=s.options&ef?"full":this.localPreserveWS||(s.options&ep)>0,{schema:l}=this.parser;if("full"===o||s.inlineContext(r)||/[^ \t\r\n\u000c]/.test(i)){if(o)if("full"===o)i=i.replace(/\r\n?/g,"\n");else if(l.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(l.linebreakReplacement.create())){let r=i.split(/\r?\n|\r/);for(let i=0;i<r.length;i++)i&&this.insertNode(l.linebreakReplacement.create(),n,!0),r[i]&&this.insertNode(l.text(r[i]),n,!/\S/.test(r[i]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let n=s.content[s.content.length-1],o=r.previousSibling;(!n||o&&"BR"==o.nodeName||n.isText&&/[ \t\r\n\u000c]$/.test(n.text))&&(i=i.slice(1))}i&&this.insertNode(l.text(i),n,!/\S/.test(i)),this.findInText(r)}else this.findInside(r)}addElement(r,n,i){let s=this.localPreserveWS,o=this.top;("PRE"==r.tagName||/pre/.test(r.style&&r.style.whiteSpace))&&(this.localPreserveWS=!0);let l=r.nodeName.toLowerCase(),a;ed.hasOwnProperty(l)&&this.parser.normalizeLists&&ek(r);let u=this.options.ruleFromNode&&this.options.ruleFromNode(r)||(a=this.parser.matchTag(r,this,i));n:if(u?u.ignore:eh.hasOwnProperty(l))this.findInside(r),this.ignoreFallback(r,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(r=u.skip);let i,s=this.needsBlock;if(ec.hasOwnProperty(l))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),i=!0,o.type||(this.needsBlock=!0);else if(!r.firstChild){this.leafFallback(r,n);break n}let a=u&&u.skip?n:this.readStyles(r,n);a&&this.addAll(r,a),i&&this.sync(o),this.needsBlock=s}else{let i=this.readStyles(r,n);i&&this.addElementByRule(r,u,i,!1===u.consuming?a:void 0)}this.localPreserveWS=s}leafFallback(r,n){"BR"==r.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(r.ownerDocument.createTextNode("\n"),n)}ignoreFallback(r,n){"BR"!=r.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(r,n){let i=r.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let s=this.parser.matchedStyles[r],o=i.getPropertyValue(s);if(o)for(let r;;){let i=this.parser.matchStyle(s,o,this,r);if(!i)break;if(i.ignore)return null;if(n=i.clearMark?n.filter(r=>!i.clearMark(r)):n.concat(this.parser.schema.marks[i.mark].create(i.attrs)),!1===i.consuming)r=i;else break}}return n}addElementByRule(r,n,i,s){let o,l;if(n.node)if((l=this.parser.schema.nodes[n.node]).isLeaf)this.insertNode(l.create(n.attrs),i,"BR"==r.nodeName)||this.leafFallback(r,i);else{let r=this.enter(l,n.attrs||null,i,n.preserveWhitespace);r&&(o=!0,i=r)}else{let r=this.parser.schema.marks[n.mark];i=i.concat(r.create(n.attrs))}let a=this.top;if(l&&l.isLeaf)this.findInside(r);else if(s)this.addElement(r,i,s);else if(n.getContent)this.findInside(r),n.getContent(r,this.parser.schema).forEach(r=>this.insertNode(r,i,!1));else{let s=r;"string"==typeof n.contentElement?s=r.querySelector(n.contentElement):"function"==typeof n.contentElement?s=n.contentElement(r):n.contentElement&&(s=n.contentElement),this.findAround(r,s,!0),this.addAll(s,i),this.findAround(r,s,!1)}o&&this.sync(a)&&this.open--}addAll(r,n,i,s){let o=i||0;for(let l=i?r.childNodes[i]:r.firstChild,a=null==s?null:r.childNodes[s];l!=a;l=l.nextSibling,++o)this.findAtPoint(r,o),this.addDOM(l,n);this.findAtPoint(r,o)}findPlace(r,n,i){let s,o;for(let n=this.open,l=0;n>=0;n--){let a=this.nodes[n],u=a.findWrapping(r);if(u&&(!s||s.length>u.length+l)&&(s=u,o=a,!u.length))break;if(a.solid){if(i)break;l+=2}}if(!s)return null;this.sync(o);for(let r=0;r<s.length;r++)n=this.enterInner(s[r],null,n,!1);return n}insertNode(r,n,i){if(r.isInline&&this.needsBlock&&!this.top.type){let r=this.textblockFromContext();r&&(n=this.enterInner(r,null,n))}let s=this.findPlace(r,n,i);if(s){this.closeExtra();let n=this.top;n.match&&(n.match=n.match.matchType(r.type));let i=p.none;for(let o of s.concat(r.marks))(n.type?n.type.allowsMarkType(o.type):ex(o.type,r.type))&&(i=o.addToSet(i));return n.content.push(r.mark(i)),!0}return!1}enter(r,n,i,s){let o=this.findPlace(r.create(n),i,!1);return o&&(o=this.enterInner(r,n,i,!0,s)),o}enterInner(r,n,i,s=!1,o){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(r);let a=eg(r,o,l.options);l.options&em&&0==l.content.length&&(a|=em);let u=p.none;return i=i.filter(n=>(l.type?!l.type.allowsMarkType(n.type):!ex(n.type,r))||(u=n.addToSet(u),!1)),this.nodes.push(new e_(r,n,u,s,null,a)),this.open++,i}closeExtra(r=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(r));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(r){for(let n=this.open;n>=0;n--)if(this.nodes[n]==r)return this.open=n,!0;else this.localPreserveWS&&(this.nodes[n].options|=ep);return!1}get currentPos(){this.closeExtra();let r=0;for(let n=this.open;n>=0;n--){let i=this.nodes[n].content;for(let n=i.length-1;n>=0;n--)r+=i[n].nodeSize;n&&r++}return r}findAtPoint(r,n){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==r&&this.find[i].offset==n&&(this.find[i].pos=this.currentPos)}findInside(r){if(this.find)for(let n=0;n<this.find.length;n++)null==this.find[n].pos&&1==r.nodeType&&r.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(r,n,i){if(r!=n&&this.find)for(let s=0;s<this.find.length;s++)null==this.find[s].pos&&1==r.nodeType&&r.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(i?2:4)&&(this.find[s].pos=this.currentPos)}findInText(r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==r&&(this.find[n].pos=this.currentPos-(r.nodeValue.length-this.find[n].offset))}matchesContext(r){if(r.indexOf("|")>-1)return r.split(/\s*\|\s*/).some(this.matchesContext,this);let n=r.split("/"),i=this.options.context,s=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),o=-(i?i.depth+1:0)+ +!s,l=(r,a)=>{for(;r>=0;r--){let u=n[r];if(""==u){if(r==n.length-1||0==r)continue;for(;a>=o;a--)if(l(r-1,a))return!0;return!1}{let r=a>0||0==a&&s?this.nodes[a].type:i&&a>=o?i.node(a-o).type:null;if(!r||r.name!=u&&!r.isInGroup(u))return!1;a--}}return!0};return l(n.length-1,this.open)}textblockFromContext(){let r=this.options.context;if(r)for(let n=r.depth;n>=0;n--){let i=r.node(n).contentMatchAt(r.indexAfter(n)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function ek(r){for(let n=r.firstChild,i=null;n;n=n.nextSibling){let r=1==n.nodeType?n.nodeName.toLowerCase():null;r&&ed.hasOwnProperty(r)&&i?(i.appendChild(n),n=i):"li"==r?i=n:r&&(i=null)}}function eb(r,n){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,n)}function ew(r){let n={};for(let i in r)n[i]=r[i];return n}function ex(r,n){let i=n.schema.nodes;for(let s in i){let o=i[s];if(!o.allowsMarkType(r))continue;let l=[],a=r=>{l.push(r);for(let i=0;i<r.edgeCount;i++){let{type:s,next:o}=r.edge(i);if(s==n||0>l.indexOf(o)&&a(o))return!0}};if(a(o.contentMatch))return!0}}class ev{constructor(r,n){this.nodes=r,this.marks=n}serializeFragment(r,n={},i){i||(i=eA(n).createDocumentFragment());let s=i,o=[];return r.forEach(r=>{if(o.length||r.marks.length){let i=0,l=0;for(;i<o.length&&l<r.marks.length;){let n=r.marks[l];if(!this.marks[n.type.name]){l++;continue}if(!n.eq(o[i][0])||!1===n.type.spec.spanning)break;i++,l++}for(;i<o.length;)s=o.pop()[1];for(;l<r.marks.length;){let i=r.marks[l++],a=this.serializeMark(i,r.isInline,n);a&&(o.push([i,s]),s.appendChild(a.dom),s=a.contentDOM||a.dom)}}s.appendChild(this.serializeNodeInner(r,n))}),i}serializeNodeInner(r,n){let{dom:i,contentDOM:s}=eT(eA(n),this.nodes[r.type.name](r),null,r.attrs);if(s){if(r.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(r.content,n,s)}return i}serializeNode(r,n={}){let i=this.serializeNodeInner(r,n);for(let s=r.marks.length-1;s>=0;s--){let o=this.serializeMark(r.marks[s],r.isInline,n);o&&((o.contentDOM||o.dom).appendChild(i),i=o.dom)}return i}serializeMark(r,n,i={}){let s=this.marks[r.type.name];return s&&eT(eA(i),s(r,n),null,r.attrs)}static renderSpec(r,n,i=null,s){return eT(r,n,i,s)}static fromSchema(r){return r.cached.domSerializer||(r.cached.domSerializer=new ev(this.nodesFromSchema(r),this.marksFromSchema(r)))}static nodesFromSchema(r){let n=eC(r.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(r){return eC(r.marks)}}function eC(r){let n={};for(let i in r){let s=r[i].spec.toDOM;s&&(n[i]=s)}return n}function eA(r){return r.document||window.document}let eE=new WeakMap;function eS(r){let n=eE.get(r);return void 0===n&&eE.set(r,n=eM(r)),n}function eM(r){let n=null;function i(r){if(r&&"object"==typeof r)if(Array.isArray(r))if("string"==typeof r[0])n||(n=[]),n.push(r);else for(let n=0;n<r.length;n++)i(r[n]);else for(let n in r)i(r[n])}return i(r),n}function eT(r,n,i,s){let o;if("string"==typeof n)return{dom:r.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;let l=n[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(s&&(a=eS(s))&&a.indexOf(n)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let u=l.indexOf(" ");u>0&&(i=l.slice(0,u),l=l.slice(u+1));let c=i?r.createElementNS(i,l):r.createElement(l),h=n[1],d=1;if(h&&"object"==typeof h&&null==h.nodeType&&!Array.isArray(h)){for(let r in d=2,h)if(null!=h[r]){let n=r.indexOf(" ");n>0?c.setAttributeNS(r.slice(0,n),r.slice(n+1),h[r]):"style"==r&&c.style?c.style.cssText=h[r]:c.setAttribute(r,h[r])}}for(let l=d;l<n.length;l++){let a=n[l];if(0===a){if(l<n.length-1||l>d)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:n,contentDOM:l}=eT(r,a,i,s);if(c.appendChild(n),l){if(o)throw RangeError("Multiple content holes");o=l}}}return{dom:c,contentDOM:o}}},31794:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]],l=(0,s.A)("heading-1",o)},36351:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M12 20h-1a2 2 0 0 1-2-2 2 2 0 0 1-2 2H6",key:"1528k5"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M6 4h1a2 2 0 0 1 2 2 2 2 0 0 1 2-2h1",key:"1mj8rg"}],["path",{d:"M9 6v12",key:"velyjx"}]],l=(0,s.A)("text-cursor-input",o)},37595:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],l=(0,s.A)("layout-grid",o)},42080:(r,n,i)=>{"use strict";i.d(n,{$B:()=>p,Sd:()=>l,T2:()=>c});var s=i(8242),o=i(27050);function l(r,n=null){return function(i,s){let{$from:o,$to:l}=i.selection,u=o.blockRange(l);if(!u)return!1;let c=s?i.tr:null;return!!a(c,u,r,n)&&(s&&s(c.scrollIntoView()),!0)}}function a(r,n,i,l=null){let c=!1,h=n,d=n.$from.doc;if(n.depth>=2&&n.$from.node(n.depth-1).type.compatibleContent(i)&&0==n.startIndex){if(0==n.$from.index(n.depth-1))return!1;let r=d.resolve(n.start-2);h=new o.u$(r,r,n.depth),n.endIndex<n.parent.childCount&&(n=new o.u$(n.$from,d.resolve(n.$to.end(n.depth)),n.depth)),c=!0}let p=(0,s.oM)(h,i,l,n);return!!p&&(r&&u(r,n,p,c,i),!0)}function u(r,n,i,l,a){let u=o.FK.empty;for(let r=i.length-1;r>=0;r--)u=o.FK.from(i[r].type.create(i[r].attrs,u));r.step(new s.Wg(n.start-2*!!l,n.end,n.start,n.end,new o.Ji(u,0,0),i.length,!0));let c=0;for(let r=0;r<i.length;r++)i[r].type==a&&(c=r+1);let h=i.length-c,d=n.start+i.length-2*!!l,p=n.parent;for(let i=n.startIndex,o=n.endIndex,l=!0;i<o;i++,l=!1)!l&&(0,s.zy)(r.doc,d,h)&&(r.split(d,h),d+=2*h),d+=p.child(i).nodeSize;return r}function c(r){return function(n,i){let{$from:s,$to:o}=n.selection,l=s.blockRange(o,n=>n.childCount>0&&n.firstChild.type==r);return!!l&&(!i||(s.node(l.depth-1).type==r?h(n,i,r,l):d(n,i,l)))}}function h(r,n,i,l){let a=r.tr,u=l.end,c=l.$to.end(l.depth);u<c&&(a.step(new s.Wg(u-1,c,u,c,new o.Ji(o.FK.from(i.create(null,l.parent.copy())),1,0),1,!0)),l=new o.u$(a.doc.resolve(l.$from.pos),a.doc.resolve(c),l.depth));let h=(0,s.jP)(l);if(null==h)return!1;a.lift(l,h);let d=a.doc.resolve(a.mapping.map(u,-1)-1);return(0,s.n9)(a.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&a.join(d.pos),n(a.scrollIntoView()),!0}function d(r,n,i){let l=r.tr,a=i.parent;for(let r=i.end,n=i.endIndex-1,s=i.startIndex;n>s;n--)r-=a.child(n).nodeSize,l.delete(r-1,r+1);let u=l.doc.resolve(i.start),c=u.nodeAfter;if(l.mapping.map(i.end)!=i.start+u.nodeAfter.nodeSize)return!1;let h=0==i.startIndex,d=i.endIndex==a.childCount,p=u.node(-1),f=u.index(-1);if(!p.canReplace(f+ +!h,f+1,c.content.append(d?o.FK.empty:o.FK.from(a))))return!1;let m=u.pos,g=m+c.nodeSize;return l.step(new s.Wg(m-!!h,g+ +!!d,m+1,g-1,new o.Ji((h?o.FK.empty:o.FK.from(a.copy(o.FK.empty))).append(d?o.FK.empty:o.FK.from(a.copy(o.FK.empty))),+!h,+!d),+!h)),n(l.scrollIntoView()),!0}function p(r){return function(n,i){let{$from:l,$to:a}=n.selection,u=l.blockRange(a,n=>n.childCount>0&&n.firstChild.type==r);if(!u)return!1;let c=u.startIndex;if(0==c)return!1;let h=u.parent,d=h.child(c-1);if(d.type!=r)return!1;if(i){let l=d.lastChild&&d.lastChild.type==h.type,a=o.FK.from(l?r.create():null),c=new o.Ji(o.FK.from(r.create(null,o.FK.from(h.type.create(null,a)))),l?3:1,0),p=u.start,f=u.end;i(n.tr.step(new s.Wg(p-(l?3:1),f,p,f,c,1,!0)).scrollIntoView())}return!0}}},42790:(r,n,i)=>{"use strict";i.d(n,{v:()=>h});var s,o,l,a,u,c=function(r,n){return Object.defineProperty?Object.defineProperty(r,"raw",{value:n}):r.raw=n,r};(s=o||(o={}))[s.EOS=0]="EOS",s[s.Text=1]="Text",s[s.Incomplete=2]="Incomplete",s[s.ESC=3]="ESC",s[s.Unknown=4]="Unknown",s[s.SGR=5]="SGR",s[s.OSCURL=6]="OSCURL";class h{constructor(){this.VERSION="6.0.6",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_allowlist={http:1,https:1},this._escape_html=!0,this.boldStyle="font-weight:bold",this.faintStyle="opacity:0.7",this.italicStyle="font-style:italic",this.underlineStyle="text-decoration:underline"}set use_classes(r){this._use_classes=r}get use_classes(){return this._use_classes}set url_allowlist(r){this._url_allowlist=r}get url_allowlist(){return this._url_allowlist}set escape_html(r){this._escape_html=r}get escape_html(){return this._escape_html}set boldStyle(r){this._boldStyle=r}get boldStyle(){return this._boldStyle}set faintStyle(r){this._faintStyle=r}get faintStyle(){return this._faintStyle}set italicStyle(r){this._italicStyle=r}get italicStyle(){return this._italicStyle}set underlineStyle(r){this._underlineStyle=r}get underlineStyle(){return this._underlineStyle}setup_palettes(){this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(r=>{r.forEach(r=>{this.palette_256.push(r)})});let r=[0,95,135,175,215,255];for(let n=0;n<6;++n)for(let i=0;i<6;++i)for(let s=0;s<6;++s){let o={rgb:[r[n],r[i],r[s]],class_name:"truecolor"};this.palette_256.push(o)}let n=8;for(let r=0;r<24;++r,n+=10){let r={rgb:[n,n,n],class_name:"truecolor"};this.palette_256.push(r)}}escape_txt_for_html(r){return this._escape_html?r.replace(/[&<>"']/gm,r=>"&"===r?"&amp;":"<"===r?"&lt;":">"===r?"&gt;":'"'===r?"&quot;":"'"===r?"&#x27;":void 0):r}append_buffer(r){var n=this._buffer+r;this._buffer=n}get_next_packet(){var r={kind:o.EOS,text:"",url:""},n=this._buffer.length;if(0==n)return r;var i=this._buffer.indexOf("\x1b");if(-1==i)return r.kind=o.Text,r.text=this._buffer,this._buffer="",r;if(i>0)return r.kind=o.Text,r.text=this._buffer.slice(0,i),this._buffer=this._buffer.slice(i),r;if(0==i){if(n<3)return r.kind=o.Incomplete,r;var s=this._buffer.charAt(1);if("["!=s&&"]"!=s&&"("!=s)return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;if("["==s){this._csi_regex||(this._csi_regex=d(l||(l=c(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \x1b[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \x1b[ # CSI\n [ -~]* # anything legal\n ([\0-\x1f:]) # anything illegal\n )\n "],["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]))));let n=this._buffer.match(this._csi_regex);if(null===n)return r.kind=o.Incomplete,r;if(n[4])return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;""!=n[1]||"m"!=n[3]?r.kind=o.Unknown:r.kind=o.SGR,r.text=n[2];var h=n[0].length;return this._buffer=this._buffer.slice(h),r}if("]"==s){if(n<4)return r.kind=o.Incomplete,r;if("8"!=this._buffer.charAt(2)||";"!=this._buffer.charAt(3))return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;this._osc_st||(this._osc_st=p(a||(a=c(["\n (?: # legal sequence\n (\x1b\\) # ESC | # alternate\n (\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-\x06] # anything illegal\n | # alternate\n [\b-\x1a] # anything illegal\n | # alternate\n [\x1c-\x1f] # anything illegal\n )\n "],["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "])))),this._osc_st.lastIndex=0;{let n=this._osc_st.exec(this._buffer);if(null===n)return r.kind=o.Incomplete,r;if(n[3])return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r}{let n=this._osc_st.exec(this._buffer);if(null===n)return r.kind=o.Incomplete,r;if(n[3])return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r}this._osc_regex||(this._osc_regex=d(u||(u=c(["\n ^ # beginning of line\n #\n \x1b]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\x1b\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n \x1b]8;; # OSC Hyperlink End\n (?: # ST\n (?:\x1b\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n "],["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]))));let i=this._buffer.match(this._osc_regex);if(null===i)return r.kind=o.ESC,r.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),r;r.kind=o.OSCURL,r.url=i[1],r.text=i[2];var h=i[0].length;return this._buffer=this._buffer.slice(h),r}if("("==s)return r.kind=o.Unknown,this._buffer=this._buffer.slice(3),r}}ansi_to_html(r){this.append_buffer(r);for(var n=[];;){var i=this.get_next_packet();if(i.kind==o.EOS||i.kind==o.Incomplete)break;i.kind!=o.ESC&&i.kind!=o.Unknown&&(i.kind==o.Text?n.push(this.transform_to_html(this.with_state(i))):i.kind==o.SGR?this.process_ansi(i):i.kind==o.OSCURL&&n.push(this.process_hyperlink(i)))}return n.join("")}with_state(r){return{bold:this.bold,faint:this.faint,italic:this.italic,underline:this.underline,fg:this.fg,bg:this.bg,text:r.text}}process_ansi(r){let n=r.text.split(";");for(;n.length>0;){let r=parseInt(n.shift(),10);if(isNaN(r)||0===r)this.fg=null,this.bg=null,this.bold=!1,this.faint=!1,this.italic=!1,this.underline=!1;else if(1===r)this.bold=!0;else if(2===r)this.faint=!0;else if(3===r)this.italic=!0;else if(4===r)this.underline=!0;else if(21===r)this.bold=!1;else if(22===r)this.faint=!1,this.bold=!1;else if(23===r)this.italic=!1;else if(24===r)this.underline=!1;else if(39===r)this.fg=null;else if(49===r)this.bg=null;else if(r>=30&&r<38)this.fg=this.ansi_colors[0][r-30];else if(r>=40&&r<48)this.bg=this.ansi_colors[0][r-40];else if(r>=90&&r<98)this.fg=this.ansi_colors[1][r-90];else if(r>=100&&r<108)this.bg=this.ansi_colors[1][r-100];else if((38===r||48===r)&&n.length>0){let i=38===r,s=n.shift();if("5"===s&&n.length>0){let r=parseInt(n.shift(),10);r>=0&&r<=255&&(i?this.fg=this.palette_256[r]:this.bg=this.palette_256[r])}if("2"===s&&n.length>2){let r=parseInt(n.shift(),10),s=parseInt(n.shift(),10),o=parseInt(n.shift(),10);if(r>=0&&r<=255&&s>=0&&s<=255&&o>=0&&o<=255){let n={rgb:[r,s,o],class_name:"truecolor"};i?this.fg=n:this.bg=n}}}}}transform_to_html(r){let n=r.text;if(0===n.length||(n=this.escape_txt_for_html(n),!r.bold&&!r.italic&&!r.faint&&!r.underline&&null===r.fg&&null===r.bg))return n;let i=[],s=[],o=r.fg,l=r.bg;r.bold&&i.push(this._boldStyle),r.faint&&i.push(this._faintStyle),r.italic&&i.push(this._italicStyle),r.underline&&i.push(this._underlineStyle),this._use_classes?(o&&("truecolor"!==o.class_name?s.push(`${o.class_name}-fg`):i.push(`color:rgb(${o.rgb.join(",")})`)),l&&("truecolor"!==l.class_name?s.push(`${l.class_name}-bg`):i.push(`background-color:rgb(${l.rgb.join(",")})`))):(o&&i.push(`color:rgb(${o.rgb.join(",")})`),l&&i.push(`background-color:rgb(${l.rgb})`));let a="",u="";return s.length&&(a=` class="${s.join(" ")}"`),i.length&&(u=` style="${i.join(";")}"`),`<span${u}${a}>${n}</span>`}process_hyperlink(r){let n=r.url.split(":");return n.length<1||!this._url_allowlist[n[0]]?"":`<a href="${this.escape_txt_for_html(r.url)}">${this.escape_txt_for_html(r.text)}</a>`}}function d(r){let n=r.raw[0],i=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;return new RegExp(n.replace(i,""))}function p(r){let n=r.raw[0],i=/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm;return RegExp(n.replace(i,""),"g")}},43203:(r,n,i)=>{"use strict";i.d(n,{n:()=>s.nA});var s=i(5989)},43561:(r,n,i)=>{"use strict";i.d(n,{A:()=>s});var s=i(62678).Or},44695:(r,n,i)=>{"use strict";i.d(n,{L:()=>s.L2});var s=i(82150)},45916:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],l=(0,s.A)("text-align-start",o)},48368:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],l=(0,s.A)("file-text",o)},48434:(r,n,i)=>{"use strict";i.d(n,{_:()=>s._0});var s=i(82150)},49387:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],l=(0,s.A)("pencil",o)},49698:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]],l=(0,s.A)("variable",o)},50538:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],l=(0,s.A)("history",o)},51914:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],l=(0,s.A)("plus",o)},52475:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],l=(0,s.A)("code",o)},52740:(r,n,i)=>{"use strict";i.d(n,{A:()=>l,D:()=>o});var s=i(82159),o=s.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:n}){let i=this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0];return[`h${i}`,(0,s.KV)(this.options.HTMLAttributes,n),0]},parseMarkdown:(r,n)=>n.createNode("heading",{level:r.depth||1},n.parseInline(r.tokens||[])),renderMarkdown:(r,n)=>{var i;let s=(null==(i=r.attrs)?void 0:i.level)?parseInt(r.attrs.level,10):1,o="#".repeat(s);return r.content?`${o} ${n.renderChildren(r.content)}`:""},addCommands(){return{setHeading:r=>({commands:n})=>!!this.options.levels.includes(r.level)&&n.setNode(this.name,r),toggleHeading:r=>({commands:n})=>!!this.options.levels.includes(r.level)&&n.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return this.options.levels.reduce((r,n)=>({...r,...{[`Mod-Alt-${n}`]:()=>this.editor.commands.toggleHeading({level:n})}}),{})},addInputRules(){return this.options.levels.map(r=>(0,s.JJ)({find:RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}}),l=o},53961:(r,n,i)=>{"use strict";i.d(n,{A:()=>l});var s=i(90425);let o=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],l=(0,s.A)("zap",o)},58940:(r,n,i)=>{"use strict";i.d(n,{A:()=>j});var s=i(82159),o=(r,n)=>{if("slot"===r)return 0;if(r instanceof Function)return r(n);let{children:i,...s}=null!=n?n:{};if("svg"===r)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[r,s,i]},l=/^\s*>\s$/,a=s.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:r}){return o("blockquote",{...(0,s.KV)(this.options.HTMLAttributes,r),children:o("slot",{})})},parseMarkdown:(r,n)=>{var i;let s=null!=(i=n.parseBlockChildren)?i:n.parseChildren;return n.createNode("blockquote",void 0,s(r.tokens||[]))},renderMarkdown:(r,n)=>{if(!r.content)return"";let i=">",s=[];return r.content.forEach((r,o)=>{var l,a;let u=(null!=(a=null==(l=n.renderChild)?void 0:l.call(n,r,o))?a:n.renderChildren([r])).split("\n").map(r=>""===r.trim()?i:`${i} ${r}`);s.push(u.join("\n"))}),s.join(`
13
13
  ${i}
14
14
  `)},addCommands(){return{setBlockquote:()=>({commands:r})=>r.wrapIn(this.name),toggleBlockquote:()=>({commands:r})=>r.toggleWrap(this.name),unsetBlockquote:()=>({commands:r})=>r.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,s.tG)({find:l,type:this.type})]}}),u=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,c=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,h=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,d=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,p=s.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>"normal"!==r.style.fontWeight&&null},{style:"font-weight=400",clearMark:r=>r.type.name===this.name},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return o("strong",{...(0,s.KV)(this.options.HTMLAttributes,r),children:o("slot",{})})},markdownTokenName:"strong",parseMarkdown:(r,n)=>n.applyMark("bold",n.parseInline(r.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(r,n)=>`**${n.renderChildren(r)}**`,addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,s.OX)({find:u,type:this.type}),(0,s.OX)({find:h,type:this.type})]},addPasteRules(){return[(0,s.Zc)({find:c,type:this.type}),(0,s.Zc)({find:d,type:this.type})]}}),f=/(^|[^`])`([^`]+)`(?!`)$/,m=/(^|[^`])`([^`]+)`(?!`)/g,g=s.CU.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:r}){return["code",(0,s.KV)(this.options.HTMLAttributes,r),0]},markdownTokenName:"codespan",parseMarkdown:(r,n)=>n.applyMark("code",[{type:"text",text:r.text||""}]),renderMarkdown:(r,n)=>r.content?`\`${n.renderChildren(r.content)}\``:"",addCommands(){return{setCode:()=>({commands:r})=>r.setMark(this.name),toggleCode:()=>({commands:r})=>r.toggleMark(this.name),unsetCode:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,s.OX)({find:f,type:this.type})]},addPasteRules(){return[(0,s.Zc)({find:m,type:this.type})]}}),_=i(76865),y=4,k=/^```([a-z]+)?[\s\n]$/,b=/^~~~([a-z]+)?[\s\n]$/,w=s.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:y,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:r=>{var n;let{languageClassPrefix:i}=this.options;if(!i)return null;let s=[...(null==(n=r.firstElementChild)?void 0:n.classList)||[]].filter(r=>r.startsWith(i)).map(r=>r.replace(i,""))[0];return s||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:r,HTMLAttributes:n}){return["pre",(0,s.KV)(this.options.HTMLAttributes,n),["code",{class:r.attrs.language?this.options.languageClassPrefix+r.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(r,n)=>{var i,s;return(null==(i=r.raw)?void 0:i.startsWith("```"))===!1&&(null==(s=r.raw)?void 0:s.startsWith("~~~"))===!1&&"indented"!==r.codeBlockStyle?[]:n.createNode("codeBlock",{language:r.lang||null},r.text?[n.createTextNode(r.text)]:[])},renderMarkdown:(r,n)=>{var i;let s=(null==(i=r.attrs)?void 0:i.language)||"";return r.content?[`\`\`\`${s}`,n.renderChildren(r.content),"```"].join("\n"):`\`\`\`${s}
15
15