@mndrk/agx 2.0.42 → 2.0.44

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 (1161) hide show
  1. package/cloud-runtime/standalone/.linear-token.json +4 -0
  2. package/cloud-runtime/standalone/.next/BUILD_ID +1 -1
  3. package/cloud-runtime/standalone/.next/app-path-routes-manifest.json +10 -2
  4. package/cloud-runtime/standalone/.next/build-manifest.json +8 -8
  5. package/cloud-runtime/standalone/.next/prerender-manifest.json +3 -3
  6. package/cloud-runtime/standalone/.next/routes-manifest.json +64 -16
  7. package/cloud-runtime/standalone/.next/server/app/_global-error/page/build-manifest.json +6 -6
  8. package/cloud-runtime/standalone/.next/server/app/_global-error/page.js +2 -2
  9. package/cloud-runtime/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/cloud-runtime/standalone/.next/server/app/_global-error.html +2 -2
  11. package/cloud-runtime/standalone/.next/server/app/_global-error.rsc +7 -7
  12. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  13. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  14. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  15. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  16. package/cloud-runtime/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/cloud-runtime/standalone/.next/server/app/_not-found/page/build-manifest.json +6 -6
  18. package/cloud-runtime/standalone/.next/server/app/_not-found/page.js +2 -2
  19. package/cloud-runtime/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/cloud-runtime/standalone/.next/server/app/_not-found.html +2 -2
  21. package/cloud-runtime/standalone/.next/server/app/_not-found.rsc +12 -12
  22. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
  23. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +3 -3
  24. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
  25. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  26. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  27. package/cloud-runtime/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  28. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page/build-manifest.json +6 -6
  29. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page.js +2 -2
  30. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page.js.nft.json +1 -1
  31. package/cloud-runtime/standalone/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  32. package/cloud-runtime/standalone/.next/server/app/agents/page/build-manifest.json +6 -6
  33. package/cloud-runtime/standalone/.next/server/app/agents/page.js +2 -2
  34. package/cloud-runtime/standalone/.next/server/app/agents/page.js.nft.json +1 -1
  35. package/cloud-runtime/standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  36. package/cloud-runtime/standalone/.next/server/app/agents.html +2 -2
  37. package/cloud-runtime/standalone/.next/server/app/agents.rsc +14 -14
  38. package/cloud-runtime/standalone/.next/server/app/agents.segments/_full.segment.rsc +14 -14
  39. package/cloud-runtime/standalone/.next/server/app/agents.segments/_head.segment.rsc +3 -3
  40. package/cloud-runtime/standalone/.next/server/app/agents.segments/_index.segment.rsc +8 -8
  41. package/cloud-runtime/standalone/.next/server/app/agents.segments/_tree.segment.rsc +2 -2
  42. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +4 -4
  43. package/cloud-runtime/standalone/.next/server/app/agents.segments/agents.segment.rsc +3 -3
  44. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/pull/route.js +2 -2
  45. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/route.js +6 -4
  46. package/cloud-runtime/standalone/.next/server/app/api/agent-specs/route.js.nft.json +1 -1
  47. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/messages/route.js +2 -2
  48. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/profile/route.js +7 -5
  49. package/cloud-runtime/standalone/.next/server/app/api/agents/[id]/profile/route.js.nft.json +1 -1
  50. package/cloud-runtime/standalone/.next/server/app/api/agents/export/route.js +6 -4
  51. package/cloud-runtime/standalone/.next/server/app/api/agents/export/route.js.nft.json +1 -1
  52. package/cloud-runtime/standalone/.next/server/app/api/attachments/[id]/route.js +2 -2
  53. package/cloud-runtime/standalone/.next/server/app/api/audit/route.js +2 -2
  54. package/cloud-runtime/standalone/.next/server/app/api/automations/create/route.js +9 -6
  55. package/cloud-runtime/standalone/.next/server/app/api/automations/create/route.js.nft.json +1 -1
  56. package/cloud-runtime/standalone/.next/server/app/api/automations/route.js +5 -3
  57. package/cloud-runtime/standalone/.next/server/app/api/automations/route.js.nft.json +1 -1
  58. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js +10 -7
  59. package/cloud-runtime/standalone/.next/server/app/api/chat/route.js.nft.json +1 -1
  60. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/route.js +2 -2
  61. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js +3 -3
  62. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/[id]/signal/route.js.nft.json +1 -1
  63. package/cloud-runtime/standalone/.next/server/app/api/chat-runs/route.js +2 -2
  64. package/cloud-runtime/standalone/.next/server/app/api/daemon/route.js +2 -2
  65. package/cloud-runtime/standalone/.next/server/app/api/domains/[id]/route.js +2 -2
  66. package/cloud-runtime/standalone/.next/server/app/api/file-read/route.js +2 -2
  67. package/cloud-runtime/standalone/.next/server/app/api/file-search/route.js +2 -2
  68. package/cloud-runtime/standalone/.next/server/app/api/file-search/route.js.nft.json +1 -1
  69. package/cloud-runtime/standalone/.next/server/app/api/filesystem/browse/route.js +2 -2
  70. package/cloud-runtime/standalone/.next/server/app/api/filesystem/pick-folder/route.js +3 -3
  71. package/cloud-runtime/standalone/.next/server/app/api/filesystem/pick-folder/route.js.nft.json +1 -1
  72. package/cloud-runtime/standalone/.next/server/app/api/graphs/[graphId]/nodes/[nodeId]/route.js +5 -2
  73. package/cloud-runtime/standalone/.next/server/app/api/graphs/[graphId]/nodes/[nodeId]/route.js.nft.json +1 -1
  74. package/cloud-runtime/standalone/.next/server/app/api/health/route.js +7 -5
  75. package/cloud-runtime/standalone/.next/server/app/api/health/route.js.nft.json +1 -1
  76. package/cloud-runtime/standalone/.next/server/app/api/history/route.js +2 -2
  77. package/cloud-runtime/standalone/.next/server/app/api/history/status/route.js +2 -2
  78. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js +6 -4
  79. package/cloud-runtime/standalone/.next/server/app/api/knowledge-notes/route.js.nft.json +1 -1
  80. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js +7 -5
  81. package/cloud-runtime/standalone/.next/server/app/api/learnings/route.js.nft.json +1 -1
  82. package/cloud-runtime/standalone/.next/server/app/api/linear/auth/route/app-paths-manifest.json +3 -0
  83. package/cloud-runtime/standalone/.next/server/app/api/linear/auth/route.js +7 -0
  84. package/cloud-runtime/standalone/.next/server/app/api/linear/auth/route.js.nft.json +1 -0
  85. package/cloud-runtime/standalone/.next/server/app/api/linear/auth/route_client-reference-manifest.js +2 -0
  86. package/cloud-runtime/standalone/.next/server/app/api/linear/callback/route/app-paths-manifest.json +3 -0
  87. package/cloud-runtime/standalone/.next/server/app/api/linear/callback/route.js +7 -0
  88. package/cloud-runtime/standalone/.next/server/app/api/linear/callback/route.js.nft.json +1 -0
  89. package/cloud-runtime/standalone/.next/server/app/api/linear/callback/route_client-reference-manifest.js +2 -0
  90. package/cloud-runtime/standalone/.next/server/app/api/linear/cycles/route/app-paths-manifest.json +3 -0
  91. package/cloud-runtime/standalone/.next/server/app/api/linear/cycles/route/build-manifest.json +11 -0
  92. package/cloud-runtime/standalone/.next/server/app/api/linear/cycles/route/server-reference-manifest.json +4 -0
  93. package/cloud-runtime/standalone/.next/server/app/api/linear/cycles/route.js +7 -0
  94. package/cloud-runtime/standalone/.next/server/app/api/linear/cycles/route.js.map +5 -0
  95. package/cloud-runtime/standalone/.next/server/app/api/linear/cycles/route.js.nft.json +1 -0
  96. package/cloud-runtime/standalone/.next/server/app/api/linear/cycles/route_client-reference-manifest.js +2 -0
  97. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route/app-paths-manifest.json +3 -0
  98. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route/build-manifest.json +11 -0
  99. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route/server-reference-manifest.json +4 -0
  100. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route.js +7 -0
  101. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route.js.map +5 -0
  102. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route.js.nft.json +1 -0
  103. package/cloud-runtime/standalone/.next/server/app/api/linear/issues/route_client-reference-manifest.js +2 -0
  104. package/cloud-runtime/standalone/.next/server/app/api/linear/mcp-setup/route/app-paths-manifest.json +3 -0
  105. package/cloud-runtime/standalone/.next/server/app/api/linear/mcp-setup/route/build-manifest.json +11 -0
  106. package/cloud-runtime/standalone/.next/server/app/api/linear/mcp-setup/route/server-reference-manifest.json +4 -0
  107. package/cloud-runtime/standalone/.next/server/app/api/linear/mcp-setup/route.js +8 -0
  108. package/cloud-runtime/standalone/.next/server/app/api/linear/mcp-setup/route.js.map +5 -0
  109. package/cloud-runtime/standalone/.next/server/app/api/linear/mcp-setup/route.js.nft.json +1 -0
  110. package/cloud-runtime/standalone/.next/server/app/api/linear/mcp-setup/route_client-reference-manifest.js +2 -0
  111. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/[id]/route/app-paths-manifest.json +3 -0
  112. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/[id]/route/build-manifest.json +11 -0
  113. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/[id]/route/server-reference-manifest.json +4 -0
  114. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/[id]/route.js +7 -0
  115. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/[id]/route.js.map +5 -0
  116. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/[id]/route.js.nft.json +1 -0
  117. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/[id]/route_client-reference-manifest.js +2 -0
  118. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/route/app-paths-manifest.json +3 -0
  119. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/route/build-manifest.json +11 -0
  120. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/route/server-reference-manifest.json +4 -0
  121. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/route.js +7 -0
  122. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/route.js.map +5 -0
  123. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/route.js.nft.json +1 -0
  124. package/cloud-runtime/standalone/.next/server/app/api/linear/runs/route_client-reference-manifest.js +2 -0
  125. package/cloud-runtime/standalone/.next/server/app/api/linear/status/route/app-paths-manifest.json +3 -0
  126. package/cloud-runtime/standalone/.next/server/app/api/linear/status/route/build-manifest.json +11 -0
  127. package/cloud-runtime/standalone/.next/server/app/api/linear/status/route/server-reference-manifest.json +4 -0
  128. package/cloud-runtime/standalone/.next/server/app/api/linear/status/route.js +7 -0
  129. package/cloud-runtime/standalone/.next/server/app/api/linear/status/route.js.map +5 -0
  130. package/cloud-runtime/standalone/.next/server/app/api/linear/status/route.js.nft.json +1 -0
  131. package/cloud-runtime/standalone/.next/server/app/api/linear/status/route_client-reference-manifest.js +2 -0
  132. package/cloud-runtime/standalone/.next/server/app/api/linear/token/route/app-paths-manifest.json +3 -0
  133. package/cloud-runtime/standalone/.next/server/app/api/linear/token/route/build-manifest.json +11 -0
  134. package/cloud-runtime/standalone/.next/server/app/api/linear/token/route/server-reference-manifest.json +4 -0
  135. package/cloud-runtime/standalone/.next/server/app/api/linear/token/route.js +7 -0
  136. package/cloud-runtime/standalone/.next/server/app/api/linear/token/route.js.map +5 -0
  137. package/cloud-runtime/standalone/.next/server/app/api/linear/token/route.js.nft.json +1 -0
  138. package/cloud-runtime/standalone/.next/server/app/api/linear/token/route_client-reference-manifest.js +2 -0
  139. package/cloud-runtime/standalone/.next/server/app/api/logs/route.js +2 -2
  140. package/cloud-runtime/standalone/.next/server/app/api/logs/stream/route.js +2 -2
  141. package/cloud-runtime/standalone/.next/server/app/api/memories/route.js +2 -2
  142. package/cloud-runtime/standalone/.next/server/app/api/messages/[id]/route.js +2 -2
  143. package/cloud-runtime/standalone/.next/server/app/api/migrate/teams-to-projects/route.js +2 -2
  144. package/cloud-runtime/standalone/.next/server/app/api/migrate/workspaces-to-projects/route.js +2 -2
  145. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route.js +3 -3
  146. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route.js.nft.json +1 -1
  147. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route.js +3 -3
  148. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route.js.nft.json +1 -1
  149. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js +7 -5
  150. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/start/route.js.nft.json +1 -1
  151. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js +7 -5
  152. package/cloud-runtime/standalone/.next/server/app/api/orchestrator/tasks/[taskId]/status/route.js.nft.json +1 -1
  153. package/cloud-runtime/standalone/.next/server/app/api/participants/route.js +7 -5
  154. package/cloud-runtime/standalone/.next/server/app/api/participants/route.js.nft.json +1 -1
  155. package/cloud-runtime/standalone/.next/server/app/api/processes/route.js +2 -2
  156. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js +7 -5
  157. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/agents/route.js.nft.json +1 -1
  158. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js +7 -5
  159. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v1/route.js.nft.json +1 -1
  160. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js +7 -5
  161. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/migrate-v2/route.js.nft.json +1 -1
  162. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js +5 -3
  163. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/route.js.nft.json +1 -1
  164. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js +7 -5
  165. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/skills/route.js.nft.json +1 -1
  166. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js +7 -5
  167. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/threads/route.js.nft.json +1 -1
  168. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js +7 -5
  169. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/variables/route.js.nft.json +1 -1
  170. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js +7 -5
  171. package/cloud-runtime/standalone/.next/server/app/api/projects/route.js.nft.json +1 -1
  172. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/cancel/route.js +7 -5
  173. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/cancel/route.js.nft.json +1 -1
  174. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/route.js +8 -6
  175. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/route.js.nft.json +1 -1
  176. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/runs/route.js +7 -5
  177. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/[id]/runs/route.js.nft.json +1 -1
  178. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/agents/route.js +7 -5
  179. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/agents/route.js.nft.json +1 -1
  180. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/poll/route.js +9 -6
  181. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/poll/route.js.nft.json +1 -1
  182. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/route.js +8 -6
  183. package/cloud-runtime/standalone/.next/server/app/api/prompt-jobs/route.js.nft.json +1 -1
  184. package/cloud-runtime/standalone/.next/server/app/api/providers/route.js +3 -3
  185. package/cloud-runtime/standalone/.next/server/app/api/providers/route.js.nft.json +1 -1
  186. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js +7 -5
  187. package/cloud-runtime/standalone/.next/server/app/api/queue/complete/route.js.nft.json +1 -1
  188. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js +9 -7
  189. package/cloud-runtime/standalone/.next/server/app/api/queue/route.js.nft.json +1 -1
  190. package/cloud-runtime/standalone/.next/server/app/api/reactions/route.js +2 -2
  191. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js +7 -5
  192. package/cloud-runtime/standalone/.next/server/app/api/schedules/debug/route.js.nft.json +1 -1
  193. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js +7 -5
  194. package/cloud-runtime/standalone/.next/server/app/api/schedules/poll/route.js.nft.json +1 -1
  195. package/cloud-runtime/standalone/.next/server/app/api/schedules/route.js +9 -6
  196. package/cloud-runtime/standalone/.next/server/app/api/schedules/route.js.nft.json +1 -1
  197. package/cloud-runtime/standalone/.next/server/app/api/search/route.js +2 -2
  198. package/cloud-runtime/standalone/.next/server/app/api/skills/assign/route.js +1 -1
  199. package/cloud-runtime/standalone/.next/server/app/api/skills/assign/route.js.nft.json +1 -1
  200. package/cloud-runtime/standalone/.next/server/app/api/skills/available/route.js +3 -3
  201. package/cloud-runtime/standalone/.next/server/app/api/skills/available/route.js.nft.json +1 -1
  202. package/cloud-runtime/standalone/.next/server/app/api/skills/detail/route.js +3 -3
  203. package/cloud-runtime/standalone/.next/server/app/api/skills/detail/route.js.nft.json +1 -1
  204. package/cloud-runtime/standalone/.next/server/app/api/skills/history/route.js +3 -3
  205. package/cloud-runtime/standalone/.next/server/app/api/skills/history/route.js.nft.json +1 -1
  206. package/cloud-runtime/standalone/.next/server/app/api/skills/learn/route.js +3 -3
  207. package/cloud-runtime/standalone/.next/server/app/api/skills/learn/route.js.nft.json +1 -1
  208. package/cloud-runtime/standalone/.next/server/app/api/skills/route.js +3 -3
  209. package/cloud-runtime/standalone/.next/server/app/api/skills/route.js.nft.json +1 -1
  210. package/cloud-runtime/standalone/.next/server/app/api/skills/unlearn/route.js +1 -1
  211. package/cloud-runtime/standalone/.next/server/app/api/skills/unlearn/route.js.nft.json +1 -1
  212. package/cloud-runtime/standalone/.next/server/app/api/status/route.js +3 -3
  213. package/cloud-runtime/standalone/.next/server/app/api/status/route.js.nft.json +1 -1
  214. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js +7 -5
  215. package/cloud-runtime/standalone/.next/server/app/api/summarize/route.js.nft.json +1 -1
  216. package/cloud-runtime/standalone/.next/server/app/api/system/db-status/route.js +2 -2
  217. package/cloud-runtime/standalone/.next/server/app/api/task-drafts/route.js +2 -2
  218. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js +6 -4
  219. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js.nft.json +1 -1
  220. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js +8 -6
  221. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/comments/route.js.nft.json +1 -1
  222. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js +7 -5
  223. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/costs/route.js.nft.json +1 -1
  224. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js +8 -6
  225. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/dependencies/route.js.nft.json +1 -1
  226. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js +8 -5
  227. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/events/route.js.nft.json +1 -1
  228. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js +9 -6
  229. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/history/route.js.nft.json +1 -1
  230. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js +9 -6
  231. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/metrics/route.js.nft.json +1 -1
  232. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/pause/route.js +2 -2
  233. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js +12 -8
  234. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/replan/route.js.nft.json +1 -1
  235. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js +7 -5
  236. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/restart/route.js.nft.json +1 -1
  237. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js +7 -5
  238. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/resume/route.js.nft.json +1 -1
  239. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js +11 -7
  240. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/rollback/route.js.nft.json +1 -1
  241. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js +13 -9
  242. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/route.js.nft.json +1 -1
  243. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js +11 -8
  244. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/schedule/route.js.nft.json +1 -1
  245. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js +7 -5
  246. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/start/route.js.nft.json +1 -1
  247. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js +3 -1
  248. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/graph/stop/route.js.nft.json +1 -1
  249. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/heartbeat/route.js +2 -2
  250. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js +7 -5
  251. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/history/route.js.nft.json +1 -1
  252. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js +9 -6
  253. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/route.js.nft.json +1 -1
  254. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/logs/stream/route.js +2 -2
  255. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js +5 -3
  256. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/comments/route.js.nft.json +1 -1
  257. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js +11 -8
  258. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/complete/route.js.nft.json +1 -1
  259. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js +11 -8
  260. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/fail/route.js.nft.json +1 -1
  261. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js +11 -8
  262. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/resume/route.js.nft.json +1 -1
  263. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js +11 -8
  264. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/start/route.js.nft.json +1 -1
  265. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js +11 -8
  266. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/stop/route.js.nft.json +1 -1
  267. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js +12 -9
  268. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/nodes/[nodeId]/verify/route.js.nft.json +1 -1
  269. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js +9 -6
  270. package/cloud-runtime/standalone/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
  271. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js +7 -5
  272. package/cloud-runtime/standalone/.next/server/app/api/tasks/assign-orphans/route.js.nft.json +1 -1
  273. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js +7 -5
  274. package/cloud-runtime/standalone/.next/server/app/api/tasks/extract/route.js.nft.json +1 -1
  275. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js +11 -8
  276. package/cloud-runtime/standalone/.next/server/app/api/tasks/route.js.nft.json +1 -1
  277. package/cloud-runtime/standalone/.next/server/app/api/tasks/stream/route.js +2 -2
  278. package/cloud-runtime/standalone/.next/server/app/api/thread-export/route.js +2 -2
  279. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js +6 -5
  280. package/cloud-runtime/standalone/.next/server/app/api/threads/knowledge/route.js.nft.json +1 -1
  281. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js +6 -5
  282. package/cloud-runtime/standalone/.next/server/app/api/threads/route.js.nft.json +1 -1
  283. package/cloud-runtime/standalone/.next/server/app/api/upload/[id]/route.js +2 -2
  284. package/cloud-runtime/standalone/.next/server/app/api/upload/route.js +2 -2
  285. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js +7 -5
  286. package/cloud-runtime/standalone/.next/server/app/api/user-settings/route.js.nft.json +1 -1
  287. package/cloud-runtime/standalone/.next/server/app/api/userPreferences/route.js +2 -2
  288. package/cloud-runtime/standalone/.next/server/app/automations/page/build-manifest.json +6 -6
  289. package/cloud-runtime/standalone/.next/server/app/automations/page/react-loadable-manifest.json +11 -3
  290. package/cloud-runtime/standalone/.next/server/app/automations/page.js +2 -2
  291. package/cloud-runtime/standalone/.next/server/app/automations/page.js.nft.json +1 -1
  292. package/cloud-runtime/standalone/.next/server/app/automations/page_client-reference-manifest.js +1 -1
  293. package/cloud-runtime/standalone/.next/server/app/automations.html +2 -2
  294. package/cloud-runtime/standalone/.next/server/app/automations.rsc +15 -15
  295. package/cloud-runtime/standalone/.next/server/app/automations.segments/_full.segment.rsc +15 -15
  296. package/cloud-runtime/standalone/.next/server/app/automations.segments/_head.segment.rsc +3 -3
  297. package/cloud-runtime/standalone/.next/server/app/automations.segments/_index.segment.rsc +8 -8
  298. package/cloud-runtime/standalone/.next/server/app/automations.segments/_tree.segment.rsc +3 -3
  299. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations/__PAGE__.segment.rsc +5 -5
  300. package/cloud-runtime/standalone/.next/server/app/automations.segments/automations.segment.rsc +3 -3
  301. package/cloud-runtime/standalone/.next/server/app/board/page/build-manifest.json +6 -6
  302. package/cloud-runtime/standalone/.next/server/app/board/page.js +2 -2
  303. package/cloud-runtime/standalone/.next/server/app/board/page_client-reference-manifest.js +1 -1
  304. package/cloud-runtime/standalone/.next/server/app/board.html +2 -2
  305. package/cloud-runtime/standalone/.next/server/app/board.rsc +12 -12
  306. package/cloud-runtime/standalone/.next/server/app/board.segments/_full.segment.rsc +12 -12
  307. package/cloud-runtime/standalone/.next/server/app/board.segments/_head.segment.rsc +3 -3
  308. package/cloud-runtime/standalone/.next/server/app/board.segments/_index.segment.rsc +8 -8
  309. package/cloud-runtime/standalone/.next/server/app/board.segments/_tree.segment.rsc +2 -2
  310. package/cloud-runtime/standalone/.next/server/app/board.segments/board/__PAGE__.segment.rsc +2 -2
  311. package/cloud-runtime/standalone/.next/server/app/board.segments/board.segment.rsc +3 -3
  312. package/cloud-runtime/standalone/.next/server/app/execution-graph/page/build-manifest.json +6 -6
  313. package/cloud-runtime/standalone/.next/server/app/execution-graph/page.js +2 -2
  314. package/cloud-runtime/standalone/.next/server/app/execution-graph/page.js.nft.json +1 -1
  315. package/cloud-runtime/standalone/.next/server/app/execution-graph/page_client-reference-manifest.js +1 -1
  316. package/cloud-runtime/standalone/.next/server/app/execution-graph.html +2 -2
  317. package/cloud-runtime/standalone/.next/server/app/execution-graph.rsc +14 -14
  318. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_full.segment.rsc +14 -14
  319. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_head.segment.rsc +3 -3
  320. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_index.segment.rsc +8 -8
  321. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/_tree.segment.rsc +2 -2
  322. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph/__PAGE__.segment.rsc +4 -4
  323. package/cloud-runtime/standalone/.next/server/app/execution-graph.segments/execution-graph.segment.rsc +3 -3
  324. package/cloud-runtime/standalone/.next/server/app/index.html +2 -2
  325. package/cloud-runtime/standalone/.next/server/app/index.rsc +15 -15
  326. package/cloud-runtime/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  327. package/cloud-runtime/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  328. package/cloud-runtime/standalone/.next/server/app/index.segments/_head.segment.rsc +3 -3
  329. package/cloud-runtime/standalone/.next/server/app/index.segments/_index.segment.rsc +8 -8
  330. package/cloud-runtime/standalone/.next/server/app/index.segments/_tree.segment.rsc +4 -4
  331. package/cloud-runtime/standalone/.next/server/app/page/build-manifest.json +6 -6
  332. package/cloud-runtime/standalone/.next/server/app/page.js +2 -2
  333. package/cloud-runtime/standalone/.next/server/app/page.js.nft.json +1 -1
  334. package/cloud-runtime/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  335. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/automations/page/build-manifest.json +6 -6
  336. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/automations/page/react-loadable-manifest.json +11 -3
  337. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/automations/page.js +2 -2
  338. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/automations/page.js.nft.json +1 -1
  339. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/automations/page_client-reference-manifest.js +1 -1
  340. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page/build-manifest.json +6 -6
  341. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page.js +2 -2
  342. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page.js.nft.json +1 -1
  343. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/graph/[taskId]/page_client-reference-manifest.js +1 -1
  344. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page/build-manifest.json +6 -6
  345. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page.js +2 -2
  346. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page.js.nft.json +1 -1
  347. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/knowledge/page_client-reference-manifest.js +1 -1
  348. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page/app-paths-manifest.json +3 -0
  349. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page/build-manifest.json +18 -0
  350. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page/next-font-manifest.json +11 -0
  351. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page/react-loadable-manifest.json +10 -0
  352. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page/server-reference-manifest.json +4 -0
  353. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page.js +16 -0
  354. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page.js.map +5 -0
  355. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page.js.nft.json +1 -0
  356. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/linear/page_client-reference-manifest.js +2 -0
  357. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page/build-manifest.json +6 -6
  358. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page.js +2 -2
  359. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page.js.nft.json +1 -1
  360. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  361. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page/build-manifest.json +6 -6
  362. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page.js +2 -2
  363. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page.js.nft.json +1 -1
  364. package/cloud-runtime/standalone/.next/server/app/projects/[slug]/thread/[threadId]/page_client-reference-manifest.js +1 -1
  365. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page/build-manifest.json +6 -6
  366. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page.js +2 -2
  367. package/cloud-runtime/standalone/.next/server/app/projects/orphans/page_client-reference-manifest.js +1 -1
  368. package/cloud-runtime/standalone/.next/server/app/projects/orphans.html +2 -2
  369. package/cloud-runtime/standalone/.next/server/app/projects/orphans.rsc +14 -14
  370. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_full.segment.rsc +14 -14
  371. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_head.segment.rsc +3 -3
  372. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_index.segment.rsc +8 -8
  373. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/_tree.segment.rsc +2 -2
  374. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans/__PAGE__.segment.rsc +4 -4
  375. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects/orphans.segment.rsc +3 -3
  376. package/cloud-runtime/standalone/.next/server/app/projects/orphans.segments/projects.segment.rsc +3 -3
  377. package/cloud-runtime/standalone/.next/server/app/projects/page/build-manifest.json +6 -6
  378. package/cloud-runtime/standalone/.next/server/app/projects/page.js +2 -2
  379. package/cloud-runtime/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  380. package/cloud-runtime/standalone/.next/server/app/projects.html +2 -2
  381. package/cloud-runtime/standalone/.next/server/app/projects.rsc +14 -14
  382. package/cloud-runtime/standalone/.next/server/app/projects.segments/_full.segment.rsc +14 -14
  383. package/cloud-runtime/standalone/.next/server/app/projects.segments/_head.segment.rsc +3 -3
  384. package/cloud-runtime/standalone/.next/server/app/projects.segments/_index.segment.rsc +8 -8
  385. package/cloud-runtime/standalone/.next/server/app/projects.segments/_tree.segment.rsc +2 -2
  386. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects/__PAGE__.segment.rsc +4 -4
  387. package/cloud-runtime/standalone/.next/server/app/projects.segments/projects.segment.rsc +3 -3
  388. package/cloud-runtime/standalone/.next/server/app/settings/page/build-manifest.json +6 -6
  389. package/cloud-runtime/standalone/.next/server/app/settings/page.js +2 -2
  390. package/cloud-runtime/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  391. package/cloud-runtime/standalone/.next/server/app/settings.html +2 -2
  392. package/cloud-runtime/standalone/.next/server/app/settings.rsc +14 -14
  393. package/cloud-runtime/standalone/.next/server/app/settings.segments/_full.segment.rsc +14 -14
  394. package/cloud-runtime/standalone/.next/server/app/settings.segments/_head.segment.rsc +3 -3
  395. package/cloud-runtime/standalone/.next/server/app/settings.segments/_index.segment.rsc +8 -8
  396. package/cloud-runtime/standalone/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
  397. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  398. package/cloud-runtime/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  399. package/cloud-runtime/standalone/.next/server/app/skills/page/build-manifest.json +6 -6
  400. package/cloud-runtime/standalone/.next/server/app/skills/page.js +2 -2
  401. package/cloud-runtime/standalone/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  402. package/cloud-runtime/standalone/.next/server/app/skills.html +2 -2
  403. package/cloud-runtime/standalone/.next/server/app/skills.rsc +14 -14
  404. package/cloud-runtime/standalone/.next/server/app/skills.segments/_full.segment.rsc +14 -14
  405. package/cloud-runtime/standalone/.next/server/app/skills.segments/_head.segment.rsc +3 -3
  406. package/cloud-runtime/standalone/.next/server/app/skills.segments/_index.segment.rsc +8 -8
  407. package/cloud-runtime/standalone/.next/server/app/skills.segments/_tree.segment.rsc +2 -2
  408. package/cloud-runtime/standalone/.next/server/app/skills.segments/skills/__PAGE__.segment.rsc +4 -4
  409. package/cloud-runtime/standalone/.next/server/app/skills.segments/skills.segment.rsc +3 -3
  410. package/cloud-runtime/standalone/.next/server/app/status/page/build-manifest.json +6 -6
  411. package/cloud-runtime/standalone/.next/server/app/status/page.js +2 -2
  412. package/cloud-runtime/standalone/.next/server/app/status/page_client-reference-manifest.js +1 -1
  413. package/cloud-runtime/standalone/.next/server/app/status.html +2 -2
  414. package/cloud-runtime/standalone/.next/server/app/status.rsc +14 -14
  415. package/cloud-runtime/standalone/.next/server/app/status.segments/_full.segment.rsc +14 -14
  416. package/cloud-runtime/standalone/.next/server/app/status.segments/_head.segment.rsc +3 -3
  417. package/cloud-runtime/standalone/.next/server/app/status.segments/_index.segment.rsc +8 -8
  418. package/cloud-runtime/standalone/.next/server/app/status.segments/_tree.segment.rsc +2 -2
  419. package/cloud-runtime/standalone/.next/server/app/status.segments/status/__PAGE__.segment.rsc +4 -4
  420. package/cloud-runtime/standalone/.next/server/app/status.segments/status.segment.rsc +3 -3
  421. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page/build-manifest.json +6 -6
  422. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page.js +2 -2
  423. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page.js.nft.json +1 -1
  424. package/cloud-runtime/standalone/.next/server/app/thread/[id]/page_client-reference-manifest.js +1 -1
  425. package/cloud-runtime/standalone/.next/server/app/welcome/page/build-manifest.json +6 -6
  426. package/cloud-runtime/standalone/.next/server/app/welcome/page.js +2 -2
  427. package/cloud-runtime/standalone/.next/server/app/welcome/page.js.nft.json +1 -1
  428. package/cloud-runtime/standalone/.next/server/app/welcome/page_client-reference-manifest.js +1 -1
  429. package/cloud-runtime/standalone/.next/server/app/welcome.html +2 -2
  430. package/cloud-runtime/standalone/.next/server/app/welcome.rsc +14 -14
  431. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_full.segment.rsc +14 -14
  432. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_head.segment.rsc +3 -3
  433. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_index.segment.rsc +8 -8
  434. package/cloud-runtime/standalone/.next/server/app/welcome.segments/_tree.segment.rsc +2 -2
  435. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome/__PAGE__.segment.rsc +4 -4
  436. package/cloud-runtime/standalone/.next/server/app/welcome.segments/welcome.segment.rsc +3 -3
  437. package/cloud-runtime/standalone/.next/server/app-paths-manifest.json +10 -2
  438. package/cloud-runtime/standalone/.next/server/chunks/[externals]__29a2424c._.js +3 -0
  439. package/cloud-runtime/standalone/.next/server/chunks/[externals]__64355ed1._.js +1 -1
  440. package/cloud-runtime/standalone/.next/server/chunks/[externals]__d6ed3021._.js +3 -0
  441. package/cloud-runtime/standalone/.next/server/chunks/[externals]_node:child_process_261e8bca._.js +1 -1
  442. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0281ad06._.js +49 -0
  443. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0284ea89._.js +13 -0
  444. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__04c806f4._.js +3 -0
  445. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__05243927._.js +29 -0
  446. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0c3dd73b._.js +2 -2
  447. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0c4807d1._.js +49 -0
  448. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0cc3f3b7._.js +2 -2
  449. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0f6532d7._.js +93 -0
  450. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1017e012._.js +1 -1
  451. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__13fe776f._.js +3 -0
  452. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1b96352c._.js +1 -1
  453. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1be9b30e._.js +3 -0
  454. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1dce6c15._.js +1 -1
  455. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__22b7bf38._.js +3 -0
  456. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__255b11f2._.js +1 -1
  457. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__26817611._.js +1 -1
  458. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__28524c6a._.js +3 -0
  459. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__294fceef._.js +1 -1
  460. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2d15af44._.js +3 -0
  461. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2d776aa6._.js +3 -0
  462. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__314d5c41._.js +1 -1
  463. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__349d67e7._.js +61 -0
  464. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__34efe92e._.js +15 -0
  465. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__352dad6d._.js +1 -1
  466. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__42804c1d._.js +110 -0
  467. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__44ef900b._.js +49 -0
  468. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4559476d._.js +49 -0
  469. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__45a50de9._.js +3 -0
  470. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__46947325._.js +1 -1
  471. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__46ad8e50._.js +49 -0
  472. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4700e1b3._.js +80 -0
  473. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__49c04b15._.js +49 -0
  474. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4a4265e0._.js +2 -2
  475. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4c2d07e0._.js +3 -0
  476. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4c5c536d._.js +2 -2
  477. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4c89c60a._.js +93 -0
  478. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__509b1dd2._.js +13 -0
  479. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__50ddd3ce._.js +1 -1
  480. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__529a6e1c._.js +2 -2
  481. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5650bac3._.js +1 -1
  482. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__56dbe1a4._.js +39 -0
  483. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5a042505._.js +15 -0
  484. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5a1fd688._.js +1 -1
  485. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5d359afa._.js +21 -18
  486. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5e5eb809._.js +61 -0
  487. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__5fbc700c._.js +25 -0
  488. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__621dcb4a._.js +1 -1
  489. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__628d686b._.js +1 -1
  490. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6db132e9._.js +1 -1
  491. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6dbe939c._.js +49 -0
  492. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__6fe5a96f._.js +80 -0
  493. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__73b17f49._.js +3 -0
  494. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__74a37ca4._.js +13 -0
  495. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__76290829._.js +29 -0
  496. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__76658fd6._.js +15 -0
  497. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7c94b104._.js +2 -2
  498. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7cade6c6._.js +6 -0
  499. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__7d4fa0fd._.js +3 -0
  500. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__889996dd._.js +49 -0
  501. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8a35d73b._.js +80 -0
  502. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8b5fd676._.js +3 -0
  503. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8c7d1318._.js +13 -0
  504. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__91b51f33._.js +8 -0
  505. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__92924218._.js +2 -2
  506. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__94bd7f65._.js +1 -1
  507. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9746d1f5._.js +2 -2
  508. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__98d58423._.js +3 -0
  509. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9b69f93e._.js +2 -2
  510. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9d3a2caa._.js +134 -0
  511. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a1e62918._.js +1 -1
  512. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a2e17f69._.js +3 -0
  513. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ac9b93fd._.js +48 -0
  514. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ad4cb055._.js +3 -0
  515. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ad6d6402._.js +29 -0
  516. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__af7a73fd._.js +1 -1
  517. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__b8f4e4a3._.js +1 -1
  518. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bacb0193._.js +7 -0
  519. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bd11b2ad._.js +1 -1
  520. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c0919d7d._.js +101 -0
  521. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c1b28690._.js +49 -0
  522. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c4ea4921._.js +1 -1
  523. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c4ed5d83._.js +2 -2
  524. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c5025f86._.js +66 -0
  525. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c695a5f2._.js +2 -2
  526. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c77efd85._.js +8 -0
  527. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c9550a93._.js +39 -0
  528. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__cb5c7680._.js +1 -1
  529. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__cf6082be._.js +49 -0
  530. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d2ac93f2._.js +13 -0
  531. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d3945cae._.js +15 -0
  532. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d57e800e._.js +2 -2
  533. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d8b615bf._.js +2 -2
  534. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d9bd6334._.js +1 -1
  535. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__d9f2041b._.js +34 -0
  536. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__db469f1b._.js +1 -1
  537. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__dc542063._.js +2 -2
  538. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__dd1cb250._.js +49 -0
  539. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__de2a1e43._.js +1 -1
  540. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__dffa5183._.js +29 -0
  541. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e0994be2._.js +3 -0
  542. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e20922e8._.js +13 -0
  543. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e3ecfd17._.js +2 -2
  544. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e4f01b5c._.js +97 -0
  545. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__e5bad635._.js +44 -0
  546. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f168c6dc._.js +14 -14
  547. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f21849ad._.js +39 -0
  548. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f536cd2f._.js +1 -1
  549. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f9f7f2df._.js +2 -2
  550. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fb1f7e58._.js +39 -0
  551. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fdb21d1b._.js +1 -1
  552. package/cloud-runtime/standalone/.next/server/chunks/_0a767dfe._.js +1 -1
  553. package/cloud-runtime/standalone/.next/server/chunks/_110bf46e._.js +6 -0
  554. package/cloud-runtime/standalone/.next/server/chunks/_22fe5fd2._.js +1 -1
  555. package/cloud-runtime/standalone/.next/server/chunks/_2a5aeb76._.js +3 -0
  556. package/cloud-runtime/standalone/.next/server/chunks/_2f3e5ac1._.js +1 -1
  557. package/cloud-runtime/standalone/.next/server/chunks/_4689976f._.js +6 -0
  558. package/cloud-runtime/standalone/.next/server/chunks/_5462a047._.js +1 -1
  559. package/cloud-runtime/standalone/.next/server/chunks/_65fd2525._.js +10 -0
  560. package/cloud-runtime/standalone/.next/server/chunks/_682c9d81._.js +6 -0
  561. package/cloud-runtime/standalone/.next/server/chunks/_7011db4f._.js +1 -1
  562. package/cloud-runtime/standalone/.next/server/chunks/_9b10087f._.js +8 -0
  563. package/cloud-runtime/standalone/.next/server/chunks/_9dea7192._.js +10 -0
  564. package/cloud-runtime/standalone/.next/server/chunks/_a32a5cdd._.js +6 -0
  565. package/cloud-runtime/standalone/.next/server/chunks/_a877d34f._.js +1 -1
  566. package/cloud-runtime/standalone/.next/server/chunks/_af7bd752._.js +3 -0
  567. package/cloud-runtime/standalone/.next/server/chunks/_b0524599._.js +3 -0
  568. package/cloud-runtime/standalone/.next/server/chunks/_c31ca6ab._.js +1 -1
  569. package/cloud-runtime/standalone/.next/server/chunks/_c3c28282._.js +3 -0
  570. package/cloud-runtime/standalone/.next/server/chunks/_c965f7b3._.js +1 -1
  571. package/cloud-runtime/standalone/.next/server/chunks/_d2ea7d84._.js +3 -0
  572. package/cloud-runtime/standalone/.next/server/chunks/_e469c080._.js +10 -0
  573. package/cloud-runtime/standalone/.next/server/chunks/_ee99a36b._.js +1 -1
  574. package/cloud-runtime/standalone/.next/server/chunks/_fe32a267._.js +3 -0
  575. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_agent-specs_pull_route_actions_33fd1f01.js +1 -1
  576. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_agent-specs_route_actions_3c4fd7d4.js +1 -1
  577. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_agents_[id]_profile_route_actions_e8d70dac.js +1 -1
  578. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_agents_export_route_actions_cc761823.js +1 -1
  579. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_attachments_[id]_route_actions_28040395.js +1 -1
  580. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_audit_route_actions_9d92fa80.js +1 -1
  581. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_automations_create_route_actions_ffb767ae.js +1 -1
  582. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_automations_route_actions_0112e2f7.js +1 -1
  583. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_chat-runs_[id]_route_actions_033ac330.js +1 -1
  584. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_chat-runs_route_actions_0c8cd01c.js +1 -1
  585. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_chat_route_actions_ac0c75e3.js +1 -1
  586. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_daemon_route_actions_89f9619f.js +1 -1
  587. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_domains_[id]_route_actions_36310215.js +1 -1
  588. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_domains_route_actions_8d8cc0aa.js +1 -1
  589. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_file-read_route_actions_a562d24d.js +1 -1
  590. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_file-search_route_actions_8af77a20.js +1 -1
  591. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_filesystem_browse_route_actions_8e268170.js +1 -1
  592. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_filesystem_pick-folder_route_actions_162664ff.js +1 -1
  593. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_health_route_actions_da3433c4.js +1 -1
  594. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_history_route_actions_f1813cd2.js +1 -1
  595. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_knowledge-notes_route_actions_0ddf6109.js +1 -1
  596. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_learnings_route_actions_c32db009.js +1 -1
  597. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_auth_route_actions_6bba0ae0.js +3 -0
  598. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_callback_route_actions_0fc8695c.js +3 -0
  599. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_cycles_route_actions_9cbb85fe.js +3 -0
  600. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_issues_route_actions_8f12f3b7.js +3 -0
  601. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_mcp-setup_route_actions_a11b04f4.js +3 -0
  602. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_runs_[id]_route_actions_5c46cc4e.js +3 -0
  603. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_runs_route_actions_a99753a8.js +3 -0
  604. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_status_route_actions_e43f376f.js +3 -0
  605. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_linear_token_route_actions_510583b8.js +3 -0
  606. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_logs_route_actions_30a87f47.js +1 -1
  607. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_logs_stream_route_actions_92bf6397.js +1 -1
  608. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_memories_route_actions_f0712914.js +1 -1
  609. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_messages_[id]_route_actions_3ca634d2.js +1 -1
  610. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_participants_route_actions_2bae2919.js +1 -1
  611. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_processes_route_actions_93e6bd01.js +1 -1
  612. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_projects_[id]_agents_route_actions_62a7e8e5.js +1 -1
  613. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_projects_[id]_migrate-v1_route_actions_e28a058d.js +1 -1
  614. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_projects_[id]_migrate-v2_route_actions_0cfff9eb.js +1 -1
  615. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_projects_[id]_route_actions_6fd2e5a5.js +1 -1
  616. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_projects_[id]_skills_route_actions_90fdd1e6.js +1 -1
  617. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_projects_[id]_threads_route_actions_88ac9ddb.js +1 -1
  618. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_projects_[id]_variables_route_actions_e646c8d9.js +1 -1
  619. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_prompt-jobs_[id]_cancel_route_actions_fbd5be89.js +1 -1
  620. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_prompt-jobs_[id]_route_actions_774a2e21.js +1 -1
  621. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_prompt-jobs_[id]_runs_route_actions_6e59ee83.js +1 -1
  622. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_prompt-jobs_agents_route_actions_399e1f19.js +1 -1
  623. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_prompt-jobs_poll_route_actions_23fbbfa1.js +1 -1
  624. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_prompt-jobs_route_actions_acf03860.js +1 -1
  625. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_providers_route_actions_5388b373.js +1 -1
  626. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_queue_complete_route_actions_1350a2ac.js +1 -1
  627. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_queue_route_actions_1e9c9b6f.js +1 -1
  628. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_reactions_route_actions_e075d50e.js +1 -1
  629. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_schedules_debug_route_actions_61c03e5e.js +1 -1
  630. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_schedules_poll_route_actions_dfc6ace4.js +1 -1
  631. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_schedules_route_actions_f5db3d09.js +1 -1
  632. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_search_route_actions_4244da48.js +1 -1
  633. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_skills_assign_route_actions_15267be8.js +1 -1
  634. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_skills_available_route_actions_24023111.js +1 -1
  635. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_skills_detail_route_actions_1148baef.js +1 -1
  636. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_skills_history_route_actions_5e5c4757.js +1 -1
  637. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_skills_learn_route_actions_d3a37d25.js +1 -1
  638. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_skills_route_actions_780e175f.js +1 -1
  639. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_skills_unlearn_route_actions_3dfee433.js +1 -1
  640. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_status_route_actions_d551bce0.js +1 -1
  641. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_summarize_route_actions_3e77989a.js +1 -1
  642. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_system_db-status_route_actions_0f864710.js +1 -1
  643. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_task-drafts_route_actions_3b90bec5.js +1 -1
  644. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_comments_route_actions_71745d03.js +1 -1
  645. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_costs_route_actions_e20adc3f.js +1 -1
  646. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_dependencies_route_actions_b85eaa7f.js +1 -1
  647. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_events_route_actions_3e2c7edc.js +1 -1
  648. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_history_route_actions_debb26dc.js +1 -1
  649. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_metrics_route_actions_a82052ba.js +1 -1
  650. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_pause_route_actions_1341b4e1.js +1 -1
  651. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_replan_route_actions_0d67ebea.js +1 -1
  652. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_restart_route_actions_bbd1883b.js +1 -1
  653. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_resume_route_actions_745fbaa8.js +1 -1
  654. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_rollback_route_actions_77968f37.js +1 -1
  655. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_route_actions_766df5f7.js +1 -1
  656. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_schedule_route_actions_943bcc22.js +1 -1
  657. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_start_route_actions_1d7e784a.js +1 -1
  658. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_graph_stop_route_actions_5f5d6ff0.js +1 -1
  659. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_heartbeat_route_actions_28915a39.js +1 -1
  660. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_history_route_actions_7ecd517e.js +1 -1
  661. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_logs_route_actions_e1a486bd.js +1 -1
  662. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_logs_stream_route_actions_ed381b79.js +1 -1
  663. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_[id]_route_actions_8de83605.js +1 -1
  664. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_extract_route_actions_2651c393.js +1 -1
  665. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_route_actions_84c37746.js +1 -1
  666. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_tasks_stream_route_actions_37a289da.js +1 -1
  667. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_thread-export_route_actions_26354edd.js +1 -1
  668. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_thread-repos_route_actions_e95d24ee.js +1 -1
  669. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_threads_knowledge_route_actions_c139bcf7.js +1 -1
  670. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_threads_route_actions_f9ea97f2.js +1 -1
  671. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_upload_[id]_route_actions_d9c30458.js +1 -1
  672. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_upload_route_actions_f15ed185.js +1 -1
  673. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_user-settings_route_actions_553a1208.js +1 -1
  674. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_userPreferences_route_actions_178deeb3.js +1 -1
  675. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_migrate_workspaces-to-projects_route_actions_cb1e42e0.js +1 -1
  676. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_orchestrator_tasks_[taskId]_cancel_route_actions_8b9cd080.js +1 -1
  677. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_orchestrator_tasks_[taskId]_signal_route_actions_5a3d8250.js +1 -1
  678. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_orchestrator_tasks_[taskId]_start_route_actions_08f1c94e.js +1 -1
  679. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_orchestrator_tasks_[taskId]_status_route_actions_4062630f.js +1 -1
  680. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_tasks_[id]_nodes_[nodeId]_complete_route_actions_c44e3cb4.js +1 -1
  681. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_tasks_[id]_nodes_[nodeId]_fail_route_actions_7ff931bc.js +1 -1
  682. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_tasks_[id]_nodes_[nodeId]_resume_route_actions_a9f01d21.js +1 -1
  683. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_tasks_[id]_nodes_[nodeId]_stop_route_actions_dbea30a3.js +1 -1
  684. package/cloud-runtime/standalone/.next/server/chunks/ce889_server_app_api_tasks_[id]_nodes_[nodeId]_verify_route_actions_ff371970.js +1 -1
  685. package/cloud-runtime/standalone/.next/server/chunks/lib_2492d514._.js +11 -37
  686. package/cloud-runtime/standalone/.next/server/chunks/lib_3c080873._.js +34 -0
  687. package/cloud-runtime/standalone/.next/server/chunks/lib_70cd6b4a._.js +80 -0
  688. package/cloud-runtime/standalone/.next/server/chunks/lib_7f7835f1._.js +68 -0
  689. package/cloud-runtime/standalone/.next/server/chunks/lib_88726721._.js +79 -0
  690. package/cloud-runtime/standalone/.next/server/chunks/lib_98ae187c._.js +34 -0
  691. package/cloud-runtime/standalone/.next/server/chunks/lib_9f439b27._.js +25 -0
  692. package/cloud-runtime/standalone/.next/server/chunks/lib_check-node-version_ts_ef89bf83._.js +1 -1
  693. package/cloud-runtime/standalone/.next/server/chunks/lib_db_ts_e06c6085._.js +1 -1
  694. package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_2e721df2._.js +3 -3
  695. package/cloud-runtime/standalone/.next/server/chunks/lib_history-store_ts_74d1c060._.js +3 -3
  696. package/cloud-runtime/standalone/.next/server/chunks/lib_orchestrator_chat-processor_ts_4c335719._.js +4 -4
  697. package/cloud-runtime/standalone/.next/server/chunks/lib_sqlite-query-adapter_ts_3ea4d849._.js +5 -5
  698. package/cloud-runtime/standalone/.next/server/chunks/lib_sqlite-query-adapter_ts_b0b1a9b2._.js +5 -5
  699. package/cloud-runtime/standalone/.next/server/chunks/lib_vault-store_ts_3718ff79._.js +34 -0
  700. package/cloud-runtime/standalone/.next/server/chunks/node_modules_18a495c8._.js +3 -0
  701. package/cloud-runtime/standalone/.next/server/chunks/node_modules_4223ed10._.js +3 -0
  702. package/cloud-runtime/standalone/.next/server/chunks/node_modules_ccc242ec._.js +4 -0
  703. package/cloud-runtime/standalone/.next/server/chunks/node_modules_d2858615._.js +3 -0
  704. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_1402a1da._.js +3 -3
  705. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0f808fa3.js +1 -1
  706. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_19315704.js +2 -2
  707. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_2aaf71c8.js +1 -1
  708. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_2bdede98.js +1 -1
  709. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_371d0bff.js +15 -15
  710. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_3d31fed0.js +1 -1
  711. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_57a073eb.js +1 -1
  712. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_63e89275.js +1 -1
  713. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_84e28f38.js +1 -1
  714. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_9aff0990.js +3 -0
  715. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_cc6c687d.js +1 -1
  716. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_dcaa7800.js +3 -0
  717. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_def8bfbe.js +2 -2
  718. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_e0cc2bbf.js +1 -1
  719. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_fce9bc95.js +3 -0
  720. package/cloud-runtime/standalone/.next/server/chunks/node_modules_zod_v4_classic_external_fa90cebf.js +3 -3
  721. package/cloud-runtime/standalone/.next/server/chunks/src_graph_12d46a92._.js +3 -0
  722. package/cloud-runtime/standalone/.next/server/chunks/src_graph_138dc200._.js +59 -0
  723. package/cloud-runtime/standalone/.next/server/chunks/src_graph_914bb19c._.js +59 -0
  724. package/cloud-runtime/standalone/.next/server/chunks/src_graph_api-route-utils_ts_b7225a0e._.js +1 -1
  725. package/cloud-runtime/standalone/.next/server/chunks/src_graph_executor_ts_55c06268._.js +3 -3
  726. package/cloud-runtime/standalone/.next/server/chunks/src_graph_executor_ts_a8bc8d58._.js +3 -3
  727. package/cloud-runtime/standalone/.next/server/chunks/src_graph_scheduler_ts_d7b7497d._.js +57 -0
  728. package/cloud-runtime/standalone/.next/server/chunks/src_graph_state-machine_ts_ae1de66e._.js +1 -1
  729. package/cloud-runtime/standalone/.next/server/chunks/src_graph_store_ts_d6588a77._.js +56 -0
  730. package/cloud-runtime/standalone/.next/server/chunks/src_graph_validate_ts_a06b9fab._.js +1 -1
  731. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__0497a547._.js +2 -2
  732. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__056cdf7d._.js +1 -1
  733. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__11e33b9b._.js +1 -1
  734. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__139838ab._.js +3 -0
  735. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__19cd257e._.js +1 -1
  736. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__26d669c2._.js +1 -1
  737. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__351b2cc6._.js +1 -1
  738. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__35f9b4a6._.js +3 -0
  739. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__38071250._.js +1 -1
  740. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__43a0398d._.js +3 -0
  741. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__4ebf5947._.js +1 -1
  742. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__5ffa2883._.js +1 -1
  743. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__67d5f883._.js +1 -1
  744. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__6e83bf83._.js +1 -1
  745. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__71b6d8a9._.js +3 -0
  746. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__7d279e62._.js +3 -0
  747. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__7e7d6790._.js +3 -0
  748. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__8fe8b9dd._.js +1 -1
  749. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__a0a1cb74._.js +1 -1
  750. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__a42e4555._.js +3 -0
  751. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__a667191a._.js +1 -1
  752. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__aa28d46f._.js +1 -1
  753. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__b6598a70._.js +3 -0
  754. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__ba4308c3._.js +3 -0
  755. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__bb149a22._.js +3 -0
  756. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__bd4d5430._.js +1 -1
  757. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__bde5bc78._.js +1 -1
  758. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__cde88183._.js +1 -1
  759. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__d36dd8bc._.js +1 -1
  760. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__dac5ab29._.js +1 -1
  761. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__e0c64529._.js +1 -1
  762. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__e87ba2b0._.js +1 -1
  763. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__f2c3b7ab._.js +3 -0
  764. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__f62d412e._.js +1 -1
  765. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__f63d6594._.js +1 -1
  766. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__fbd1aaff._.js +1 -1
  767. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__febbd0b8._.js +1 -1
  768. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__ff22a10e._.js +1 -1
  769. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__ffbc2e98._.js +2 -2
  770. package/cloud-runtime/standalone/.next/server/chunks/ssr/_02c78cac._.js +2 -2
  771. package/cloud-runtime/standalone/.next/server/chunks/ssr/_05c8a494._.js +1 -1
  772. package/cloud-runtime/standalone/.next/server/chunks/ssr/_087a5b2b._.js +3 -0
  773. package/cloud-runtime/standalone/.next/server/chunks/ssr/_0b36c9d6._.js +2 -2
  774. package/cloud-runtime/standalone/.next/server/chunks/ssr/_0ff7c687._.js +3 -3
  775. package/cloud-runtime/standalone/.next/server/chunks/ssr/_0ffd2660._.js +2 -2
  776. package/cloud-runtime/standalone/.next/server/chunks/ssr/_11ce4c04._.js +95 -0
  777. package/cloud-runtime/standalone/.next/server/chunks/ssr/_173da79d._.js +2 -2
  778. package/cloud-runtime/standalone/.next/server/chunks/ssr/_1c58ab2d._.js +2 -2
  779. package/cloud-runtime/standalone/.next/server/chunks/ssr/_1e5aee62._.js +3 -0
  780. package/cloud-runtime/standalone/.next/server/chunks/ssr/_222af282._.js +2 -2
  781. package/cloud-runtime/standalone/.next/server/chunks/ssr/_22e99a52._.js +3 -0
  782. package/cloud-runtime/standalone/.next/server/chunks/ssr/_23f5fddc._.js +1 -1
  783. package/cloud-runtime/standalone/.next/server/chunks/ssr/_24feb541._.js +2 -2
  784. package/cloud-runtime/standalone/.next/server/chunks/ssr/_260b10ce._.js +3 -0
  785. package/cloud-runtime/standalone/.next/server/chunks/ssr/_3aa32c11._.js +2 -2
  786. package/cloud-runtime/standalone/.next/server/chunks/ssr/_43472af3._.js +1 -1
  787. package/cloud-runtime/standalone/.next/server/chunks/ssr/_45f91a8f._.js +3 -0
  788. package/cloud-runtime/standalone/.next/server/chunks/ssr/_47e9a061._.js +3 -3
  789. package/cloud-runtime/standalone/.next/server/chunks/ssr/_4bfdfb14._.js +1 -1
  790. package/cloud-runtime/standalone/.next/server/chunks/ssr/_4d4ba84b._.js +2 -2
  791. package/cloud-runtime/standalone/.next/server/chunks/ssr/_50d04b8f._.js +2 -2
  792. package/cloud-runtime/standalone/.next/server/chunks/ssr/_52fe115d._.js +1 -1
  793. package/cloud-runtime/standalone/.next/server/chunks/ssr/_547b6462._.js +2 -2
  794. package/cloud-runtime/standalone/.next/server/chunks/ssr/_629dc55c._.js +2 -2
  795. package/cloud-runtime/standalone/.next/server/chunks/ssr/_69164b06._.js +95 -0
  796. package/cloud-runtime/standalone/.next/server/chunks/ssr/_84a166cb._.js +3 -0
  797. package/cloud-runtime/standalone/.next/server/chunks/ssr/_93914ecd._.js +2 -2
  798. package/cloud-runtime/standalone/.next/server/chunks/ssr/_95434d70._.js +3 -0
  799. package/cloud-runtime/standalone/.next/server/chunks/ssr/_a10eb951._.js +2 -2
  800. package/cloud-runtime/standalone/.next/server/chunks/ssr/_a1b966f7._.js +1 -1
  801. package/cloud-runtime/standalone/.next/server/chunks/ssr/_aa5b4886._.js +8 -0
  802. package/cloud-runtime/standalone/.next/server/chunks/ssr/_ae20456d._.js +2 -2
  803. package/cloud-runtime/standalone/.next/server/chunks/ssr/_cb4d8a23._.js +2 -2
  804. package/cloud-runtime/standalone/.next/server/chunks/ssr/_cee3cf86._.js +95 -0
  805. package/cloud-runtime/standalone/.next/server/chunks/ssr/_dc2072e7._.js +4 -0
  806. package/cloud-runtime/standalone/.next/server/chunks/ssr/_e04b4053._.js +2 -2
  807. package/cloud-runtime/standalone/.next/server/chunks/ssr/_e1769638._.js +3 -3
  808. package/cloud-runtime/standalone/.next/server/chunks/ssr/_f1465cc8._.js +2 -2
  809. package/cloud-runtime/standalone/.next/server/chunks/ssr/_f2a7beb1._.js +2 -2
  810. package/cloud-runtime/standalone/.next/server/chunks/ssr/_fb404ac0._.js +3 -0
  811. package/cloud-runtime/standalone/.next/server/chunks/ssr/_fc1aaf9e._.js +2 -2
  812. package/cloud-runtime/standalone/.next/server/chunks/ssr/_fd0dda03._.js +2 -2
  813. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_75761787.js +1 -1
  814. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_554ec2bf.js +1 -1
  815. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_agents_[id]_page_actions_45703105.js +1 -1
  816. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_agents_page_actions_2bceb931.js +1 -1
  817. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_automations_page_actions_415dbaa9.js +1 -1
  818. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_board_page_actions_469e0e61.js +1 -1
  819. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_execution-graph_page_actions_3eceb5c1.js +1 -1
  820. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_page_actions_39d4fc33.js +1 -1
  821. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_projects_[slug]_automations_page_actions_9371bc66.js +1 -1
  822. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_projects_[slug]_graph_[taskId]_page_actions_c1473d77.js +1 -1
  823. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_projects_[slug]_knowledge_page_actions_1037c40a.js +1 -1
  824. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_projects_[slug]_linear_page_actions_0a8dc487.js +3 -0
  825. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_projects_orphans_page_actions_6f398ff8.js +1 -1
  826. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_projects_page_actions_42ca3f3e.js +1 -1
  827. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_settings_page_actions_840229cd.js +1 -1
  828. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_status_page_actions_39bbdbbf.js +1 -1
  829. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_thread_[id]_page_actions_94774546.js +1 -1
  830. package/cloud-runtime/standalone/.next/server/chunks/ssr/_next-internal_server_app_welcome_page_actions_e32fb27e.js +1 -1
  831. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_agents_[id]_page_tsx_9c49d8c8._.js +1 -1
  832. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_agents_layout_tsx_b9360330._.js +1 -1
  833. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_agents_page_tsx_f5f08ed8._.js +1 -1
  834. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_execution-graph_page_tsx_f854185a._.js +2 -2
  835. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_global-error_tsx_9170b7a0._.js +1 -1
  836. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_graph_[taskId]_page_tsx_d8b1d582._.js +2 -2
  837. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_knowledge_page_tsx_e2a55cbd._.js +1 -1
  838. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_layout_tsx_67c9550a._.js +1 -1
  839. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_projects_[slug]_linear_page_tsx_971a6ba7._.js +39 -0
  840. package/cloud-runtime/standalone/.next/server/chunks/ssr/ce889_server_app_projects_[slug]_thread_[threadId]_page_actions_660a8857.js +1 -1
  841. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_PromptJobBoard_tsx_f83f722f._.js +8 -0
  842. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_chat-ui_bfeda794._.js +6 -6
  843. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_graph_graph-derived_ts_2b94148f._.js +1 -1
  844. package/cloud-runtime/standalone/.next/server/chunks/ssr/components_thread_WorkspaceSidebar_tsx_e660301b._.js +1 -1
  845. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_@dnd-kit_core_dist_core_esm_57071f37.js +1 -1
  846. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_f76a24fb._.js +1 -1
  847. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_e8bdedc5._.js +3 -0
  848. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_03ec2107._.js +2 -2
  849. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_174ae28d._.js +3 -3
  850. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_4b63a0e1._.js +1 -1
  851. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_61a87db9._.js +1 -1
  852. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_9774470f._.js +1 -1
  853. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_45780354.js +1 -1
  854. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_15817684.js +1 -1
  855. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_61c49327.js +2 -2
  856. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_dist_esm_eedfc1fd._.js +2 -2
  857. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_next_f2865b38._.js +2 -2
  858. package/cloud-runtime/standalone/.next/server/edge/chunks/[root-of-the-server]__9491d0b8._.js +2 -2
  859. package/cloud-runtime/standalone/.next/server/edge/chunks/_52aa5b93._.js +1 -1
  860. package/cloud-runtime/standalone/.next/server/edge/chunks/node_modules_next_dist_esm_build_templates_edge-wrapper_3b93bb62.js +1 -1
  861. package/cloud-runtime/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_405b82a5.js +1 -1
  862. package/cloud-runtime/standalone/.next/server/edge/chunks/turbopack-node_modules_next_dist_esm_build_templates_edge-wrapper_cd32efca.js +1 -1
  863. package/cloud-runtime/standalone/.next/server/functions-config-manifest.json +9 -2
  864. package/cloud-runtime/standalone/.next/server/instrumentation.js +2 -2
  865. package/cloud-runtime/standalone/.next/server/middleware-build-manifest.js +6 -6
  866. package/cloud-runtime/standalone/.next/server/middleware-manifest.json +5 -5
  867. package/cloud-runtime/standalone/.next/server/next-font-manifest.js +1 -1
  868. package/cloud-runtime/standalone/.next/server/next-font-manifest.json +4 -0
  869. package/cloud-runtime/standalone/.next/server/pages/404.html +2 -2
  870. package/cloud-runtime/standalone/.next/server/pages/500.html +2 -2
  871. package/cloud-runtime/standalone/.next/server/server-reference-manifest.js +1 -1
  872. package/cloud-runtime/standalone/.next/server/server-reference-manifest.json +1 -1
  873. package/cloud-runtime/standalone/.next/static/chunks/0010f3df27ae53b8.js +1 -0
  874. package/cloud-runtime/standalone/.next/static/chunks/012b9216c9932478.js +1 -0
  875. package/cloud-runtime/standalone/.next/static/chunks/{8304e8487aa74059.css → 06003b84da346995.css} +0 -1
  876. package/cloud-runtime/standalone/.next/static/chunks/081fcf3ea160ca2d.js +1 -0
  877. package/cloud-runtime/standalone/.next/static/chunks/09c637be82a06122.js +1 -0
  878. package/cloud-runtime/standalone/.next/static/chunks/0c5b9fe15dda4972.js +1 -0
  879. package/cloud-runtime/standalone/.next/static/chunks/0fe219bd73492107.js +5 -0
  880. package/cloud-runtime/standalone/.next/static/chunks/14922fd23cdc223b.js +1 -0
  881. package/cloud-runtime/standalone/.next/static/chunks/1d8496cecfe9a523.js +1 -0
  882. package/cloud-runtime/standalone/.next/static/chunks/1fa91c34c99502bf.js +1 -0
  883. package/cloud-runtime/standalone/.next/static/chunks/2375e3fd2a9b8844.js +2 -0
  884. package/cloud-runtime/standalone/.next/static/chunks/2618f9566e3788e4.js +1 -0
  885. package/cloud-runtime/standalone/.next/static/chunks/2a9c83f8211196e0.js +1 -0
  886. package/cloud-runtime/standalone/.next/static/chunks/2ac8e643e539b81e.js +1 -0
  887. package/cloud-runtime/standalone/.next/static/chunks/2dbfd095c1e1d01f.js +1 -0
  888. package/cloud-runtime/standalone/.next/static/chunks/2e471cd7ac5cd8fb.js +6 -0
  889. package/cloud-runtime/standalone/.next/static/chunks/335f551791affdd1.js +1 -0
  890. package/cloud-runtime/standalone/.next/static/chunks/34dd491bc4ce9561.js +1 -0
  891. package/cloud-runtime/standalone/.next/static/chunks/360fde144fd22461.js +1 -0
  892. package/cloud-runtime/standalone/.next/static/chunks/416cf5039e669b5d.js +1 -0
  893. package/cloud-runtime/standalone/.next/static/chunks/657c261f623752de.js +1 -0
  894. package/cloud-runtime/standalone/.next/static/chunks/66769c2bf128027d.js +1 -0
  895. package/cloud-runtime/standalone/.next/static/chunks/68586017f55137e8.js +1 -0
  896. package/cloud-runtime/standalone/.next/static/chunks/73e3194f06db260e.js +1 -0
  897. package/cloud-runtime/standalone/.next/static/chunks/76229fb555232113.js +3 -0
  898. package/cloud-runtime/standalone/.next/static/chunks/797fcb0710da3be2.js +4 -0
  899. package/cloud-runtime/standalone/.next/static/chunks/818fb0f154cee2c5.js +1 -0
  900. package/cloud-runtime/standalone/.next/static/chunks/8b40d0636a2ba3b0.js +28 -0
  901. package/cloud-runtime/standalone/.next/static/chunks/8fc3ed1915e0659b.js +88 -0
  902. package/cloud-runtime/standalone/.next/static/chunks/95b85b1cb6868d27.js +1 -0
  903. package/cloud-runtime/standalone/.next/static/chunks/961311cbebbffb6d.js +1 -0
  904. package/cloud-runtime/standalone/.next/static/chunks/963060cf6e72339b.js +6 -0
  905. package/cloud-runtime/standalone/.next/static/chunks/966278eaefc0aa32.js +1 -0
  906. package/cloud-runtime/standalone/.next/static/chunks/a2a98ae5d4a3e5e3.js +2 -0
  907. package/cloud-runtime/standalone/.next/static/chunks/a72fbac84e32f665.js +1 -0
  908. package/cloud-runtime/standalone/.next/static/chunks/aa4d86855d0a3a55.js +1 -0
  909. package/cloud-runtime/standalone/.next/static/chunks/ab74849aeb87503e.js +5 -0
  910. package/cloud-runtime/standalone/.next/static/chunks/b553dba1f51e709b.js +16 -0
  911. package/cloud-runtime/standalone/.next/static/chunks/b93f49b29a473a1d.js +6 -0
  912. package/cloud-runtime/standalone/.next/static/chunks/c3784233f00e1ff5.js +12 -0
  913. package/cloud-runtime/standalone/.next/static/chunks/c48afb0a7fd0423c.js +28 -0
  914. package/cloud-runtime/standalone/.next/static/chunks/{2d1d138d8ea3234c.css → c5661b1d4c5abd6a.css} +1 -0
  915. package/cloud-runtime/standalone/.next/static/chunks/cb6301624094c91e.js +1 -0
  916. package/cloud-runtime/standalone/.next/static/chunks/{787436fad75f5bc6.js → ccaf68956da192f8.js} +2 -2
  917. package/cloud-runtime/standalone/.next/static/chunks/d522224ad5c8d724.css +1 -0
  918. package/cloud-runtime/standalone/.next/static/chunks/d96012bcfc98706a.js +1 -0
  919. package/cloud-runtime/standalone/.next/static/chunks/da12f313213a5615.js +1 -0
  920. package/cloud-runtime/standalone/.next/static/chunks/de271f8f22d293b4.js +1 -0
  921. package/cloud-runtime/standalone/.next/static/chunks/e2fa3c18dd56dc25.js +1 -0
  922. package/cloud-runtime/standalone/.next/static/chunks/e910386016ceacad.js +37 -0
  923. package/cloud-runtime/standalone/.next/static/chunks/f2fe77583374541b.js +1 -0
  924. package/cloud-runtime/standalone/.next/static/chunks/f8cfa030ea3cb3c3.js +1 -0
  925. package/cloud-runtime/standalone/.next/static/chunks/turbopack-0ace1f53f3e3cf46.js +4 -0
  926. package/cloud-runtime/standalone/README.md +37 -5
  927. package/cloud-runtime/standalone/app/api/automations/route.ts +64 -17
  928. package/cloud-runtime/standalone/app/api/chat/route.ts +29 -3
  929. package/cloud-runtime/standalone/app/api/linear/auth/route.ts +14 -0
  930. package/cloud-runtime/standalone/app/api/linear/callback/route.ts +43 -0
  931. package/cloud-runtime/standalone/app/api/linear/cycles/route.ts +22 -0
  932. package/cloud-runtime/standalone/app/api/linear/issues/route.ts +66 -0
  933. package/cloud-runtime/standalone/app/api/linear/mcp-setup/route.ts +181 -0
  934. package/cloud-runtime/standalone/app/api/linear/runs/[id]/route.ts +81 -0
  935. package/cloud-runtime/standalone/app/api/linear/runs/route.ts +91 -0
  936. package/cloud-runtime/standalone/app/api/linear/status/route.ts +38 -0
  937. package/cloud-runtime/standalone/app/api/linear/token/route.ts +59 -0
  938. package/cloud-runtime/standalone/app/api/prompt-jobs/route.ts +1 -1
  939. package/cloud-runtime/standalone/app/api/providers/route.ts +1 -14
  940. package/cloud-runtime/standalone/app/api/status/route.ts +6 -14
  941. package/cloud-runtime/standalone/app/projects/[slug]/knowledge/page.tsx +3 -181
  942. package/cloud-runtime/standalone/app/projects/[slug]/layout.tsx +2 -1
  943. package/cloud-runtime/standalone/app/projects/[slug]/linear/page.tsx +26 -0
  944. package/cloud-runtime/standalone/components/LinearBoard.tsx +1321 -0
  945. package/cloud-runtime/standalone/components/LinearSetup.tsx +239 -0
  946. package/cloud-runtime/standalone/components/ProjectModal.tsx +15 -3
  947. package/cloud-runtime/standalone/components/PromptJobBoard.tsx +367 -87
  948. package/cloud-runtime/standalone/components/chat-ui/ChatContainer.tsx +27 -14
  949. package/cloud-runtime/standalone/components/chat-ui/Composer.tsx +23 -5
  950. package/cloud-runtime/standalone/components/thread/WorkspaceSidebar.tsx +53 -48
  951. package/cloud-runtime/standalone/docs/superpowers/plans/2026-04-07-linear-integration.md +1352 -0
  952. package/cloud-runtime/standalone/hooks/useGroupChat.ts +4 -1
  953. package/cloud-runtime/standalone/hooks/useLinearConnection.ts +128 -0
  954. package/cloud-runtime/standalone/hooks/useLinearIssues.ts +78 -0
  955. package/cloud-runtime/standalone/hooks/useLinearRuns.ts +137 -0
  956. package/cloud-runtime/standalone/hooks/useProjectResources.ts +0 -50
  957. package/cloud-runtime/standalone/lib/chat/composer-routing.ts +128 -0
  958. package/cloud-runtime/standalone/lib/cli-runner.ts +15 -15
  959. package/cloud-runtime/standalone/lib/db.ts +32 -46
  960. package/cloud-runtime/standalone/lib/knowledge-notes.ts +6 -242
  961. package/cloud-runtime/standalone/lib/knowledge-store.ts +8 -211
  962. package/cloud-runtime/standalone/lib/linear-client.ts +276 -0
  963. package/cloud-runtime/standalone/lib/linear-execution-prompt.ts +153 -0
  964. package/cloud-runtime/standalone/lib/linear-run-store.ts +374 -0
  965. package/cloud-runtime/standalone/lib/repo-knowledge.ts +46 -125
  966. package/cloud-runtime/standalone/lib/shell-env.ts +71 -0
  967. package/cloud-runtime/standalone/lib/task-context.ts +3 -13
  968. package/cloud-runtime/standalone/lib/thread-knowledge.ts +2 -11
  969. package/cloud-runtime/standalone/lib/vault-store.ts +2067 -0
  970. package/cloud-runtime/standalone/mcp/README.md +22 -11
  971. package/cloud-runtime/standalone/package-lock.json +7 -0
  972. package/cloud-runtime/standalone/package.json +3 -0
  973. package/cloud-runtime/standalone/planning/automation-frontmatter-migration-spec.md +710 -0
  974. package/cloud-runtime/standalone/scripts/backfill-automations-frontmatter.ts +145 -0
  975. package/cloud-runtime/standalone/scripts/migrate-vault.ts +13 -0
  976. package/cloud-runtime/standalone/src/automations/adapters.ts +219 -0
  977. package/cloud-runtime/standalone/src/automations/index.ts +7 -0
  978. package/cloud-runtime/standalone/src/automations/parser.ts +33 -0
  979. package/cloud-runtime/standalone/src/automations/repository.ts +440 -0
  980. package/cloud-runtime/standalone/src/automations/serializer.ts +94 -0
  981. package/cloud-runtime/standalone/src/automations/state.ts +166 -0
  982. package/cloud-runtime/standalone/src/automations/types.ts +134 -0
  983. package/cloud-runtime/standalone/src/automations/validation.ts +337 -0
  984. package/cloud-runtime/standalone/src/graph/schedule-runner.ts +45 -7
  985. package/cloud-runtime/standalone/src/graph/store.ts +174 -5
  986. package/cloud-runtime/standalone/src/prompt-scheduler/store.ts +522 -162
  987. package/cloud-runtime/standalone/src/prompt-scheduler/types.ts +1 -0
  988. package/cloud-runtime/standalone/state/automations/.state/24a6a5db-3b14-49c4-841f-29f10f015fbb.json +8 -0
  989. package/cloud-runtime/standalone/state/automations/active/24a6a5db-3b14-49c4-841f-29f10f015fbb.md +17 -0
  990. package/cloud-runtime/standalone/tsconfig.tsbuildinfo +1 -1
  991. package/cloud-runtime/standalone/worker/index.js +4547 -366
  992. package/package.json +1 -1
  993. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route/app-paths-manifest.json +0 -3
  994. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route.js +0 -9
  995. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route.js.nft.json +0 -1
  996. package/cloud-runtime/standalone/.next/server/app/api/projects/[id]/memory/route_client-reference-manifest.js +0 -2
  997. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route/app-paths-manifest.json +0 -3
  998. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route.js +0 -8
  999. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route.js.nft.json +0 -1
  1000. package/cloud-runtime/standalone/.next/server/app/api/repos/[id]/knowledge/route_client-reference-manifest.js +0 -2
  1001. package/cloud-runtime/standalone/.next/server/chunks/[externals]__bc6c7111._.js +0 -3
  1002. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__01cd082e._.js +0 -13
  1003. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__0936925d._.js +0 -3
  1004. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__09ca81e1._.js +0 -101
  1005. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1ac3236d._.js +0 -25
  1006. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1b0bb735._.js +0 -15
  1007. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__1c86bf6e._.js +0 -48
  1008. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__20c58b41._.js +0 -46
  1009. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2126c763._.js +0 -42
  1010. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__236c35bb._.js +0 -51
  1011. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__277ed37d._.js +0 -3
  1012. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__2f06f568._.js +0 -46
  1013. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__30bd0c87._.js +0 -13
  1014. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__374cd94c._.js +0 -42
  1015. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3785024c._.js +0 -80
  1016. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__379604d4._.js +0 -13
  1017. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3c8f1de6._.js +0 -15
  1018. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__3d0df5a8._.js +0 -8
  1019. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4014ed70._.js +0 -51
  1020. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__42fcb81c._.js +0 -52
  1021. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4a3cd6ac._.js +0 -13
  1022. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__4e522535._.js +0 -6
  1023. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__50c24784._.js +0 -3
  1024. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__59d1cdd8._.js +0 -3
  1025. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__644e6285._.js +0 -112
  1026. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__65755104._.js +0 -7
  1027. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__73c20995._.js +0 -15
  1028. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8125bbc3._.js +0 -63
  1029. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__85275b88._.js +0 -3
  1030. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__89666394._.js +0 -8
  1031. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8c0fb154._.js +0 -13
  1032. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__8f5cac13._.js +0 -46
  1033. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__91b22098._.js +0 -8
  1034. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__96ae701e._.js +0 -3
  1035. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__98ce983b._.js +0 -3
  1036. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9a9fd39f._.js +0 -44
  1037. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__9ad4e385._.js +0 -3
  1038. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a01ddd0b._.js +0 -46
  1039. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a099c992._.js +0 -58
  1040. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__a9b949c3._.js +0 -7
  1041. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bd43017b._.js +0 -3
  1042. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__bf6fb108._.js +0 -80
  1043. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c0a18648._.js +0 -80
  1044. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c122c54a._.js +0 -75
  1045. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c5b8ceb7._.js +0 -3
  1046. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__c8b49077._.js +0 -79
  1047. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__dec3e1b7._.js +0 -30
  1048. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f1147a4a._.js +0 -15
  1049. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f5597fea._.js +0 -13
  1050. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__f8c94cb3._.js +0 -8
  1051. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fa79d53f._.js +0 -46
  1052. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fb14cd4a._.js +0 -3
  1053. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fc27a898._.js +0 -158
  1054. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fce2cdce._.js +0 -3
  1055. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__fcf0b40a._.js +0 -3
  1056. package/cloud-runtime/standalone/.next/server/chunks/[root-of-the-server]__ffb21023._.js +0 -80
  1057. package/cloud-runtime/standalone/.next/server/chunks/_05fa3b89._.js +0 -46
  1058. package/cloud-runtime/standalone/.next/server/chunks/_4190f170._.js +0 -46
  1059. package/cloud-runtime/standalone/.next/server/chunks/_42e9c8d5._.js +0 -46
  1060. package/cloud-runtime/standalone/.next/server/chunks/_5ca51127._.js +0 -54
  1061. package/cloud-runtime/standalone/.next/server/chunks/_5fd6af5d._.js +0 -57
  1062. package/cloud-runtime/standalone/.next/server/chunks/_6519418b._.js +0 -59
  1063. package/cloud-runtime/standalone/.next/server/chunks/_6bb93816._.js +0 -6
  1064. package/cloud-runtime/standalone/.next/server/chunks/_6bc1b3e1._.js +0 -59
  1065. package/cloud-runtime/standalone/.next/server/chunks/_862895c0._.js +0 -57
  1066. package/cloud-runtime/standalone/.next/server/chunks/_8b9fde82._.js +0 -97
  1067. package/cloud-runtime/standalone/.next/server/chunks/_95ac98db._.js +0 -49
  1068. package/cloud-runtime/standalone/.next/server/chunks/_994414cd._.js +0 -54
  1069. package/cloud-runtime/standalone/.next/server/chunks/_99b78daf._.js +0 -46
  1070. package/cloud-runtime/standalone/.next/server/chunks/_affbdbb0._.js +0 -46
  1071. package/cloud-runtime/standalone/.next/server/chunks/_d22934ab._.js +0 -97
  1072. package/cloud-runtime/standalone/.next/server/chunks/_efc73784._.js +0 -46
  1073. package/cloud-runtime/standalone/.next/server/chunks/_fba13a4a._.js +0 -6
  1074. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_projects_[id]_memory_route_actions_f0c255ef.js +0 -3
  1075. package/cloud-runtime/standalone/.next/server/chunks/_next-internal_server_app_api_repos_[id]_knowledge_route_actions_993fe4e5.js +0 -3
  1076. package/cloud-runtime/standalone/.next/server/chunks/lib_281e5787._.js +0 -16
  1077. package/cloud-runtime/standalone/.next/server/chunks/lib_63067e21._.js +0 -16
  1078. package/cloud-runtime/standalone/.next/server/chunks/lib_87c06aeb._.js +0 -25
  1079. package/cloud-runtime/standalone/.next/server/chunks/lib_a5adca60._.js +0 -64
  1080. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_7f8022ab.js +0 -3
  1081. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_8ec90680.js +0 -3
  1082. package/cloud-runtime/standalone/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_a590fcd6.js +0 -3
  1083. package/cloud-runtime/standalone/.next/server/chunks/src_graph_14067235._.js +0 -46
  1084. package/cloud-runtime/standalone/.next/server/chunks/src_graph_b63e2d39._.js +0 -46
  1085. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__096c39a3._.js +0 -3
  1086. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__47caef59._.js +0 -3
  1087. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__8b4e7816._.js +0 -3
  1088. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__a37fb1c3._.js +0 -3
  1089. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__a456581d._.js +0 -3
  1090. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__d74022f1._.js +0 -3
  1091. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__ea035cd9._.js +0 -3
  1092. package/cloud-runtime/standalone/.next/server/chunks/ssr/[root-of-the-server]__fca7df40._.js +0 -3
  1093. package/cloud-runtime/standalone/.next/server/chunks/ssr/_0c5c111f._.js +0 -3
  1094. package/cloud-runtime/standalone/.next/server/chunks/ssr/_23656a95._.js +0 -3
  1095. package/cloud-runtime/standalone/.next/server/chunks/ssr/_27a789b3._.js +0 -3
  1096. package/cloud-runtime/standalone/.next/server/chunks/ssr/_36b413cc._.js +0 -3
  1097. package/cloud-runtime/standalone/.next/server/chunks/ssr/_46e00a9b._.js +0 -95
  1098. package/cloud-runtime/standalone/.next/server/chunks/ssr/_478f4991._.js +0 -3
  1099. package/cloud-runtime/standalone/.next/server/chunks/ssr/_547f19ec._.js +0 -3
  1100. package/cloud-runtime/standalone/.next/server/chunks/ssr/_85ca101b._.js +0 -8
  1101. package/cloud-runtime/standalone/.next/server/chunks/ssr/_9e07dcac._.js +0 -95
  1102. package/cloud-runtime/standalone/.next/server/chunks/ssr/_a68d8f62._.js +0 -3
  1103. package/cloud-runtime/standalone/.next/server/chunks/ssr/_a80e12c8._.js +0 -3
  1104. package/cloud-runtime/standalone/.next/server/chunks/ssr/_b1e1ef71._.js +0 -95
  1105. package/cloud-runtime/standalone/.next/server/chunks/ssr/_e1349560._.js +0 -3
  1106. package/cloud-runtime/standalone/.next/server/chunks/ssr/app_welcome_page_tsx_6c79bc59._.js +0 -3
  1107. package/cloud-runtime/standalone/.next/server/chunks/ssr/node_modules_lucide-react_dist_esm_b82e03da._.js +0 -3
  1108. package/cloud-runtime/standalone/.next/static/chunks/01428247f94115a6.js +0 -1
  1109. package/cloud-runtime/standalone/.next/static/chunks/06cf0ed16bf8aa70.js +0 -28
  1110. package/cloud-runtime/standalone/.next/static/chunks/0bd6498bda341889.js +0 -1
  1111. package/cloud-runtime/standalone/.next/static/chunks/0ec92a111fe969fd.css +0 -1
  1112. package/cloud-runtime/standalone/.next/static/chunks/19dd745b663fdffa.js +0 -1
  1113. package/cloud-runtime/standalone/.next/static/chunks/1a3298f21d1040e9.js +0 -4
  1114. package/cloud-runtime/standalone/.next/static/chunks/1c8583feefee0765.js +0 -1
  1115. package/cloud-runtime/standalone/.next/static/chunks/1e3dede69b464364.js +0 -1
  1116. package/cloud-runtime/standalone/.next/static/chunks/238a28856e739dc9.js +0 -2
  1117. package/cloud-runtime/standalone/.next/static/chunks/24772e179852c73e.js +0 -1
  1118. package/cloud-runtime/standalone/.next/static/chunks/2deeba875ec50761.js +0 -1
  1119. package/cloud-runtime/standalone/.next/static/chunks/2e011469003993e9.js +0 -28
  1120. package/cloud-runtime/standalone/.next/static/chunks/31a4164e40ca71e5.js +0 -6
  1121. package/cloud-runtime/standalone/.next/static/chunks/3a55441b018d52e4.js +0 -1
  1122. package/cloud-runtime/standalone/.next/static/chunks/3c202e89da05d9b9.js +0 -1
  1123. package/cloud-runtime/standalone/.next/static/chunks/3c72becf6dff5597.js +0 -1
  1124. package/cloud-runtime/standalone/.next/static/chunks/44dafb5e85578e12.js +0 -16
  1125. package/cloud-runtime/standalone/.next/static/chunks/48e332ac3e9ed56c.js +0 -1
  1126. package/cloud-runtime/standalone/.next/static/chunks/5c0819dcc4bfec85.js +0 -1
  1127. package/cloud-runtime/standalone/.next/static/chunks/5d52c79d9812d06e.js +0 -1
  1128. package/cloud-runtime/standalone/.next/static/chunks/617db51b7444f818.js +0 -1
  1129. package/cloud-runtime/standalone/.next/static/chunks/673bb6094cea9ded.js +0 -1
  1130. package/cloud-runtime/standalone/.next/static/chunks/687d09973325dcf8.js +0 -1
  1131. package/cloud-runtime/standalone/.next/static/chunks/76a50c4abceb3362.js +0 -12
  1132. package/cloud-runtime/standalone/.next/static/chunks/8a4684388ca0f6de.js +0 -7
  1133. package/cloud-runtime/standalone/.next/static/chunks/9f236cc9572783b9.js +0 -93
  1134. package/cloud-runtime/standalone/.next/static/chunks/a9aaec85125f69b1.js +0 -1
  1135. package/cloud-runtime/standalone/.next/static/chunks/ac9a7d8cf17b5d75.js +0 -1
  1136. package/cloud-runtime/standalone/.next/static/chunks/b4c29a62f9255268.js +0 -1
  1137. package/cloud-runtime/standalone/.next/static/chunks/b6bbe747d2b0dddb.js +0 -1
  1138. package/cloud-runtime/standalone/.next/static/chunks/badc6258750e247d.js +0 -1
  1139. package/cloud-runtime/standalone/.next/static/chunks/bc3cad3c821b169b.js +0 -2
  1140. package/cloud-runtime/standalone/.next/static/chunks/bf2bb1662353aff5.js +0 -1
  1141. package/cloud-runtime/standalone/.next/static/chunks/c1fb885eed94aa8c.js +0 -1
  1142. package/cloud-runtime/standalone/.next/static/chunks/c653186036e56204.js +0 -1
  1143. package/cloud-runtime/standalone/.next/static/chunks/cb5581d868e78205.js +0 -1
  1144. package/cloud-runtime/standalone/.next/static/chunks/cbdeb17a36b99000.js +0 -1
  1145. package/cloud-runtime/standalone/.next/static/chunks/d5cc62984dc4205c.js +0 -1
  1146. package/cloud-runtime/standalone/.next/static/chunks/d78cc7d749043fef.js +0 -1
  1147. package/cloud-runtime/standalone/.next/static/chunks/da2b00558cf32f37.js +0 -1
  1148. package/cloud-runtime/standalone/.next/static/chunks/ee5f1457fbc593e1.js +0 -1
  1149. package/cloud-runtime/standalone/.next/static/chunks/ff1a16fafef87110.js +0 -1
  1150. package/cloud-runtime/standalone/.next/static/chunks/turbopack-e1d640f2fbe4fa5e.js +0 -4
  1151. package/cloud-runtime/standalone/app/api/projects/[id]/memory/route.ts +0 -81
  1152. package/cloud-runtime/standalone/app/api/repos/[id]/knowledge/route.ts +0 -98
  1153. /package/cloud-runtime/standalone/.next/server/app/api/{projects/[id]/memory → linear/auth}/route/build-manifest.json +0 -0
  1154. /package/cloud-runtime/standalone/.next/server/app/api/{projects/[id]/memory → linear/auth}/route/server-reference-manifest.json +0 -0
  1155. /package/cloud-runtime/standalone/.next/server/app/api/{projects/[id]/memory → linear/auth}/route.js.map +0 -0
  1156. /package/cloud-runtime/standalone/.next/server/app/api/{repos/[id]/knowledge → linear/callback}/route/build-manifest.json +0 -0
  1157. /package/cloud-runtime/standalone/.next/server/app/api/{repos/[id]/knowledge → linear/callback}/route/server-reference-manifest.json +0 -0
  1158. /package/cloud-runtime/standalone/.next/server/app/api/{repos/[id]/knowledge → linear/callback}/route.js.map +0 -0
  1159. /package/cloud-runtime/standalone/.next/static/{PH4cjH9B7XiWyHWYdevbx → 1ixi4WIJBgIPp7LJeYeKs}/_buildManifest.js +0 -0
  1160. /package/cloud-runtime/standalone/.next/static/{PH4cjH9B7XiWyHWYdevbx → 1ixi4WIJBgIPp7LJeYeKs}/_clientMiddlewareManifest.json +0 -0
  1161. /package/cloud-runtime/standalone/.next/static/{PH4cjH9B7XiWyHWYdevbx → 1ixi4WIJBgIPp7LJeYeKs}/_ssgManifest.js +0 -0
@@ -0,0 +1,88 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,494499,428762,827121,742612,946806,10552,963612,256378,555841,e=>{"use strict";e.i(247167);var t=e.i(271645),n=e.i(174080),r=e.i(802239),i=e.i(843476);function o(e){this.content=e}o.prototype={constructor:o,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return -1},get:function(e){var t=this.find(e);return -1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),s=r.content.slice();return -1==i?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new o(s)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new o(n)},addToStart:function(e,t){return new o([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new o(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(-1==s?i.length:s,0,t,n),new o(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=o.from(e)).size?new o(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=o.from(e)).size?new o(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=o.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},o.from=function(e){if(e instanceof o)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new o(t)};class s{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let l=this.content[o],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,i||null,o)&&l.content.size){let i=s+1;l.nodesBetween(Math.max(0,e-i),Math.min(l.content.size,t-i),n,r+i)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=a},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new s(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=l}return new s(n,r)}cutByIndex(e,t){return e==t?s.empty:0==e&&t==this.content.length?this:new s(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new s(r,i)}addToStart(e){return new s([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new s(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let o=t.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){for(let e=0;o.text[e]==s.text[e];e++)r++;return r}if(o.content.size||s.content.size){let t=e(o.content,s.content,r+1);if(null!=t)return t}r+=o.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let o=t.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let l=t.child(--o),a=n.child(--s),d=l.nodeSize;if(l==a){r-=d,i-=d;continue}if(!l.sameMarkup(a))return{a:r,b:i};if(l.isText&&l.text!=a.text){let e=0,t=Math.min(l.text.length,a.text.length);for(;e<t&&l.text[l.text.length-e-1]==a.text[a.text.length-e-1];)e++,r--,i--;return{a:r,b:i}}if(l.content.size||a.content.size){let t=e(l.content,a.content,r-1,i-1);if(t)return t}r-=d,i-=d}}(this,e,t,n)}findIndex(e){if(0==e)return a(0,e);if(e==this.size)return a(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return a(t+1,r);return a(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return s.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new s(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return s.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new s(t||e,n)}static from(e){if(!e)return s.empty;if(e instanceof s)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new s([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}s.empty=new s([],0);let l={index:0,offset:0};function a(e,t){return l.index=e,l.offset=t,l}function d(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!d(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!d(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class c{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&d(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return c.none;if(e instanceof c)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}c.none=[];class h extends Error{}class p{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,i){let{index:o,offset:s}=t.findIndex(n),l=t.maybeChild(o);if(s==n||l.isText)return i&&!i.canReplace(o,o,r)?null:t.cut(0,n).append(r).append(t.cut(n));let a=e(l.content,n-s-1,r,l);return a&&t.replaceChild(o,l.copy(a))}(this.content,e+this.openStart,t);return n&&new p(n,this.openStart,this.openEnd)}removeBetween(e,t){return new p(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),s=t.maybeChild(i),{index:l,offset:a}=t.findIndex(r);if(o==n||s.isText){if(a!=r&&!t.child(l).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(i!=l)throw RangeError("Removing non-flat range");return t.replaceChild(i,s.copy(e(s.content,n-o-1,r-o-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return p.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new p(s.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new p(e,n,r)}}function u(e,t){if(!t.type.compatibleContent(e.type))throw new h("Cannot join "+t.type.name+" onto "+e.type.name)}function f(e,t,n){let r=e.node(n);return u(r,t.node(n)),r}function m(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function g(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(m(e.nodeAfter,r),o++));for(let e=o;e<s;e++)m(i.child(e),r);t&&t.depth==n&&t.textOffset&&m(t.nodeBefore,r)}function y(e,t){return e.type.checkContent(t),e.copy(t)}function b(e,t,n){let r=[];return g(null,e,n,r),e.depth>n&&m(y(f(e,t,n+1),b(e,t,n+1)),r),g(t,null,n,r),new s(r)}p.empty=new p(s.empty,0,0);class k{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return c.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new S(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s||(t=t.child(e)).isText)break;i=s-1,r+=o+1}return new k(t,n,i)}static resolveCached(e,t){let n=x.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else x.set(e,n=new v);let r=n.elts[n.i]=k.resolve(e,t);return n.i=(n.i+1)%w,r}}class v{constructor(){this.elts=[],this.i=0}}let w=12,x=new WeakMap;class S{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}let M=Object.create(null);class C{constructor(e,t,n,r=c.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||s.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&d(this.attrs,t||e.defaultAttrs||M)&&c.sameSet(this.marks,n||c.none)}copy(e=null){return e==this.content?this:new C(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new C(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return p.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o);return new p(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o)}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new h("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new h("Inconsistent open depths");return function e(t,n,r,i){let o=t.index(i),l=t.node(i);if(o==n.index(i)&&i<t.depth-r.openStart){let s=e(t,n,r,i+1);return l.copy(l.content.replaceChild(o,s))}if(!r.content.size)return y(l,b(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:o}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(s.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return y(l,function e(t,n,r,i,o){let l=t.depth>o&&f(t,n,o+1),a=i.depth>o&&f(r,i,o+1),d=[];return g(null,t,o,d),l&&a&&n.index(o)==r.index(o)?(u(l,a),m(y(l,e(t,n,r,i,o+1)),d)):(l&&m(y(l,b(t,n,o+1)),d),g(n,r,o,d),a&&m(y(a,b(r,i,o+1)),d)),g(i,null,o,d),new s(d)}(t,e,o,n,i))}{let e=t.parent,i=e.content;return y(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)))}}(r,i,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return k.resolveCached(this,e)}resolveNoCache(e){return k.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),O(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=s.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=c.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!c.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=s.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}}C.prototype.text=void 0;class T extends C{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):O(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new T(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new T(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function O(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class E{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,i=new N(e,t);if(null==i.next)return E.empty;let o=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=A(e),r=n;return e.eat(",")&&(r="}"!=e.next?A(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next)return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"))return 1==n.length?n[0]:{type:"choice",exprs:n}}(i);i.next&&i.err("Unexpected trailing text");let s=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}else if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}else if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}else if("opt"==t.type)return[r(o)].concat(e(t.expr,o));else if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}else if("name"==t.type)return[r(o,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}}(o),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);R(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let o=r[t.join(",")]=new E(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(D);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)})}return o}(R(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,l){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return s.from(l.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,l.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r}).join("\n")}}E.empty=new E(!0);class N{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')")}}function A(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function D(e,t){return t-e}function R(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(D)}function I(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function L(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function P(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function z(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new $(e,r,t[r]);return n}class B{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=z(e,n.attrs),this.defaultAttrs=I(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==E.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:L(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new C(this,this.computeAttrs(e),s.from(t),c.setFrom(n))}createChecked(e=null,t,n){return t=s.from(t),this.checkContent(t),new C(this,this.computeAttrs(e),t,c.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=s.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(s.empty,!0);return i?new C(this,e,t.append(i),c.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){P(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:c.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new B(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class ${constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class j{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=z(e,r.attrs),this.excluded=null;let i=I(this.attrs);this.instance=i?new c(this,i):null}create(e=null){return!e&&this.instance?this.instance:new c(this,L(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new j(e,r++,t,i)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){P(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class V{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=o.from(e.nodes),t.marks=o.from(e.marks||{}),this.nodes=B.compile(this.spec.nodes,this),this.marks=j.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=E.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t}t.markSet="_"==i?null:i?F(this,i.split(" ")):""!=i&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:F(this,n.split(" "))}this.nodeFromJSON=e=>C.fromJSON(this,e),this.markFromJSON=e=>c.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof B){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new T(n,n.defaultAttrs,e,c.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t}}function F(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class H{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new J(this,t,!1);return n.addAll(e,c.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new J(this,t,!0);return n.addAll(e,c.none,t.from,t.to),p.maxOpen(n.finish())}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(0==o.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=G(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=G(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new H(e,H.schemaRules(e)))}}let q={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},W={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_={ol:!0,ul:!0};function K(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class U{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=c.none,this.match=i||(4&o?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(s.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=s.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(s.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!q.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class J{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,o=K(null,t.preserveWhitespace,0)|4*!!n;i=r?new U(r.type,r.attrs,c.none,!0,t.topMatch||r.type.contentMatch,o):n?new U(null,null,c.none,!0,null,o):new U(e.schema.topNodeType,null,c.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:o}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.text(e[n]),t,!/\S/.test(e[n]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;_.hasOwnProperty(o)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&_.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:W.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(q.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=l&&l.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,o;if(t.node)if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(s)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+o)&&(r=l,i=s,!l.length))break;if(s.solid){if(n)break;o+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=c.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Y(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=K(e,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let l=c.none;return n=n.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!Y(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new U(e,t,l,r,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,o=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}}function G(e){let t={};for(let n in e)t[n]=e[n];return t}function Y(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&s(i))return!0}};if(s(i.contentMatch))return!0}}class Q{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Z(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=et(Z(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&et(Z(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return et(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Q(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=X(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return X(e.marks)}}function X(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Z(e){return e.document||window.document}let ee=new WeakMap;function et(e,t,n,r){let i,o,s;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let l=t[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(o=ee.get(r))&&ee.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),o=s)),a=o)&&a.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let d=l.indexOf(" ");d>0&&(n=l.slice(0,d),l=l.slice(d+1));let c=n?e.createElementNS(n,l):e.createElement(l),h=t[1],p=1;if(h&&"object"==typeof h&&null==h.nodeType&&!Array.isArray(h)){for(let e in p=2,h)if(null!=h[e]){let t=e.indexOf(" ");t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),h[e]):"style"==e&&c.style?c.style.cssText=h[e]:c.setAttribute(e,h[e])}}for(let o=p;o<t.length;o++){let s=t[o];if(0===s){if(o<t.length-1||o>p)throw RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:t,contentDOM:o}=et(e,s,n,r);if(c.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o}}}return{dom:c,contentDOM:i}}e.s(["DOMParser",()=>H,"DOMSerializer",()=>Q,"Fragment",()=>s,"Mark",()=>c,"MarkType",()=>j,"Node",()=>C,"NodeRange",()=>S,"ReplaceError",()=>h,"Schema",()=>V,"Slice",()=>p],428762);class en{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class er{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&er.empty)return er.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[s+i],d=this.ranges[s+o],c=l+a;if(e<=c){let i=a?e==l?-1:e==c?1:t:t,o=l+r+(i<0?0:d);if(n)return o;let h=e==(t<0?l:c)?null:s/3+(e-l)*65536,p=e==l?2:e==c?1:4;return(t<0?e!=l:e!=c)&&(p|=8),new en(o,p,h)}r+=d-a}return n?e+r:new en(e+r,0,null)}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+i];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+o]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),l=o+(this.inverted?0:i),a=this.ranges[r+t],d=this.ranges[r+n];e(s,s+a,l,l+d),i+=d-a}}invert(){return new er(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?er.empty:new er(e<0?[0,-e,0]:[0,0,e])}}er.empty=new er([]);class ei{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new ei(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new ei;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new en(e,r,null)}}let eo=Object.create(null);class es{getMap(){return er.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=eo[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eo)throw RangeError("Duplicate use of step JSON ID "+e);return eo[e]=t,t.prototype.jsonID=e,t}}class el{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new el(e,null)}static fail(e){return new el(null,e)}static fromReplace(e,t,n,r){try{return el.ok(e.replace(t,n,r))}catch(e){if(e instanceof h)return el.fail(e.message);throw e}}}function ea(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(ea(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return s.fromArray(r)}class ed extends es{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new p(ea(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return el.fromReplace(e,this.from,this.to,i)}invert(){return new ec(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new ed(t.pos,n.pos,this.mark)}merge(e){return e instanceof ed&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ed(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new ed(t.from,t.to,e.markFromJSON(t.mark))}}es.jsonID("addMark",ed);class ec extends es{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new p(ea(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return el.fromReplace(e,this.from,this.to,n)}invert(){return new ed(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new ec(t.pos,n.pos,this.mark)}merge(e){return e instanceof ec&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ec(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ec(t.from,t.to,e.markFromJSON(t.mark))}}es.jsonID("removeMark",ec);class eh extends es{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return el.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return el.fromReplace(e,this.pos,this.pos+1,new p(s.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new eh(this.pos,t.marks[n]);return new eh(this.pos,this.mark)}}return new ep(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eh(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new eh(t.pos,e.markFromJSON(t.mark))}}es.jsonID("addNodeMark",eh);class ep extends es{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return el.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return el.fromReplace(e,this.pos,this.pos+1,new p(s.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new eh(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ep(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ep(t.pos,e.markFromJSON(t.mark))}}es.jsonID("removeNodeMark",ep);class eu extends es{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&em(e,this.from,this.to)?el.fail("Structure replace would overwrite content"):el.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new er([this.from,this.to-this.from,this.slice.size])}invert(e){return new eu(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new eu(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof eu)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?p.empty:new p(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new eu(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?p.empty:new p(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new eu(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new eu(t.from,t.to,p.fromJSON(e,t.slice),!!t.structure)}}es.jsonID("replace",eu);class ef extends es{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(em(e,this.from,this.gapFrom)||em(e,this.gapTo,this.to)))return el.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return el.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?el.fromReplace(e,this.from,this.to,n):el.fail("Content does not fit in gap")}getMap(){return new er([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ef(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new ef(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ef(t.from,t.to,t.gapFrom,t.gapTo,p.fromJSON(e,t.slice),t.insert,!!t.structure)}}function em(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function eg(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),l=[],a=t+1;for(let t=0;t<o.childCount;t++){let d=o.child(t),c=a+d.nodeSize,h=r.matchType(d.type);if(h){r=h;for(let t=0;t<d.marks.length;t++)n.allowsMarkType(d.marks[t].type)||e.step(new ec(a,c,d.marks[t]));if(i&&d.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(d.text);)r||(r=new p(s.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),l.push(new eu(a+e.index,a+e.index+e[0].length,r))}}else l.push(new eu(a,c,p.empty));a=c}if(!r.validEnd){let t=r.fillBefore(s.empty,!0);e.replace(a,a,new p(t,0,0))}for(let t=l.length-1;t>=0;t--)e.step(l[t])}function ey(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+r,l=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(s,l,t))return n;if(0==n||o.type.spec.isolating||!((0==s||o.canReplace(s,o.childCount))&&(l==o.childCount||o.canReplace(0,l))))break;s&&(r=1),l<o.childCount&&(i=1)}return null}function eb(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<i;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return o?i.map(ek).concat({type:t,attrs:n}).concat(o.map(ek)):null}function ek(e){return{type:e,attrs:null}}function ev(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function ew(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"))}})}function ex(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!a.type.validContent(s))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function eS(e,t){let n=e.resolve(t),r=n.index();return eM(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eM(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}function eC(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,o,s=r.index(e);if(e==r.depth?(i=r.nodeBefore,o=r.nodeAfter):n>0?(i=r.node(e+1),s++,o=r.node(e).maybeChild(s)):(i=r.node(e).maybeChild(s-1),o=r.node(e+1)),i&&!i.isTextblock&&eM(i,o)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function eT(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);l=e&&s.canReplaceWith(o,o,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function eO(e,t,n=t,r=p.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return eE(i,o,r)?new eu(t,n,r):new eN(i,o,r).fit()}function eE(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}es.jsonID("replaceAround",ef);class eN{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=s.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=s.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let l=new p(i,o,s);return e>-1?new ef(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new eu(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=eR(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:o,match:l}=this.frontier[i],a,d=null;if(1==t&&(r?l.matchType(r.type)||(d=l.fillBefore(s.from(r),!1)):e&&o.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:d};if(2==t&&r&&(a=l.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:a};if(e&&l.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=eR(e,t);return!!r.childCount&&!r.firstChild.isLeaf&&(this.unplaced=new p(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=eR(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new p(eA(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new p(eA(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let o=this.unplaced,l=n?n.content:o.content,a=o.openStart-e,d=0,c=[],{match:h,type:u}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));h=h.matchFragment(r)}let f=l.size+e-(o.content.size-o.openEnd);for(;d<l.childCount;){let e=l.child(d),t=h.matchType(e.type);if(!t)break;(++d>1||0==a||e.content.size)&&(h=t,c.push(function e(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,e(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(s.empty,!0)))),t.copy(i)}(e.mark(u.allowedMarks(e.marks)),1==d?a:0,d==l.childCount?f:-1)))}let m=d==l.childCount;m||(f=-1),this.placed=eD(this.placed,t,s.from(c)),this.frontier[t].match=h,m&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=l;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=m?0==e?p.empty:new p(eA(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new p(eA(o.content,e,d),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!eI(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return -1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=eI(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=eI(e,n,r,t,!0);if(!i||i.childCount)continue t}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=eD(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=eD(this.placed,this.depth,s.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(s.empty,!0);e.childCount&&(this.placed=eD(this.placed,this.frontier.length,e))}}function eA(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(eA(e.firstChild.content,t-1,n)))}function eD(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(eD(e.lastChild.content,t-1,n)))}function eR(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function eI(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?l:null}function eL(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}class eP extends es{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return el.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return el.fromReplace(e,this.pos,this.pos+1,new p(s.from(r),0,+!t.isLeaf))}getMap(){return er.empty}invert(e){return new eP(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eP(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new eP(t.pos,t.attr,t.value)}}es.jsonID("attr",eP);class ez extends es{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return el.ok(n)}getMap(){return er.empty}invert(e){return new ez(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new ez(t.attr,t.value)}}es.jsonID("docAttr",ez);let eB=class extends Error{};(eB=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),eB.prototype.constructor=eB,eB.prototype.name="TransformError";class e${constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ei}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new eB(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,o)=>{e=Math.min(e,i),t=Math.max(t,o)})}return 1e9==e?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=p.empty){let r=eO(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new p(s.from(n),0,0))}delete(e,t){return this.replace(e,t,p.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(eE(i,o,r))return e.step(new eu(t,n,r));let l=eL(i,o);0==l[l.length-1]&&l.pop();let a=-(i.depth+1);l.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;l.indexOf(e)>-1?a=e:i.before(e)==t&&l.splice(1,0,-e)}let d=l.indexOf(a),c=[],h=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=h-1;e>=0;e--){var u;let t=c[e],n=(u=t.type).spec.defining||u.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(a)-1)))h=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let a=(t+h+1)%(r.openStart+1),u=c[a];if(u)for(let t=0;t<l.length;t++){let c=l[(t+d)%l.length],h=!0;c<0&&(h=!1,c=-c);let f=i.node(c-1),m=i.index(c-1);if(f.canReplaceWith(m,m,u.type,u.marks))return e.replace(i.before(c),h?o.after(c):n,new p(function e(t,n,r,i,o){if(n<r){let o=t.firstChild;t=t.replaceChild(0,o.copy(e(o.content,n+1,r,i,o)))}if(n>i){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(s.empty,!0))}return t}(r.content,0,r.openStart,a),a,r.openEnd))}}let f=e.steps.length;for(let s=l.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>f));s--){let e=l[s];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var r=e,i=t;if(!n.isInline&&r==i&&this.doc.resolve(r).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break}return null}(this.doc,r,n.type);null!=e&&(r=i=e)}return this.replaceRange(r,i,new p(s.from(n),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=eL(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:r,$to:i,depth:o}=t,l=r.before(o+1),a=i.after(o+1),d=l,c=a,h=s.empty,u=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,h=s.from(r.node(e).copy(h)),u++):d--;let f=s.empty,m=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=s.from(i.node(e).copy(f)),m++):c++;e.step(new ef(d,c,l,a,new p(h.append(f),u,m),h.size-u,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);ew(e,r.node(),r.before(),l)}s.inlineContent&&eg(e,t+n-1,s,o.node().contentMatchAt(o.index()),null==r);let a=e.mapping.slice(l),d=a.map(t-n);if(e.step(new eu(d,a.map(t+n,-1),p.empty,!0)),!0===r){let t=e.doc.resolve(d);ev(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let r=s.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=s.from(n[e].type.create(n[e].attrs,r))}let i=t.start,o=t.end;e.step(new ef(i,o,i,o,new p(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){var i=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let o=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var l,a,d;let c,h,u="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,u)&&(l=i.doc,a=i.mapping.slice(o).map(t),d=n,h=(c=l.resolve(a)).index(),c.parent.canReplaceWith(h,h+1,d))){let r=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&ew(i,e,t,o),eg(i,i.mapping.slice(o).map(t,1),n,void 0,null===r);let l=i.mapping.slice(o),a=l.map(t,1),d=l.map(t+e.nodeSize,1);return i.step(new ef(a,d,a+1,d-1,new p(s.from(n.create(u,null,e.marks)),0,0),1,!0)),!0===r&&ev(i,e,t,o),!1}}),this}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw RangeError("No node at given position");n||(n=o.type);let l=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,l);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);e.step(new ef(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new p(s.from(l),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new eP(e,t,n)),this}setDocAttribute(e,t){return this.step(new ez(e,t)),this}addNodeMark(e,t){return this.step(new eh(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof c)t.isInSet(n.marks)&&this.step(new ep(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new ep(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e])}return this}split(e,t=1,n){return!function(e,t,n=1,r){let i=e.doc.resolve(t),o=s.empty,l=s.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=s.from(i.node(e).copy(o));let t=r&&r[a];l=s.from(t?t.type.create(t.attrs,l):i.node(e).copy(l))}e.step(new eu(t,t,new p(o.append(l),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let i,o,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(e,t,(r,a,d)=>{if(!r.isInline)return;let c=r.marks;if(!n.isInSet(c)&&d.type.allowsMarkType(n.type)){let d=Math.max(a,e),h=Math.min(a+r.nodeSize,t),p=n.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(p)||(i&&i.to==d&&i.mark.eq(c[e])?i.to=h:s.push(i=new ec(d,h,c[e])));o&&o.to==d?o.to=h:l.push(o=new ed(d,h,n))}}),s.forEach(e=>r.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,t,n){var r;let i,o;return r=this,i=[],o=0,r.doc.nodesBetween(e,t,(r,s)=>{if(!r.isInline)return;o++;let l=null;if(n instanceof j){let e=r.marks,t;for(;t=n.isInSet(e);)(l||(l=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(r.marks)&&(l=[n]):l=r.marks;if(l&&l.length){let n=Math.min(s+r.nodeSize,t);for(let t=0;t<l.length;t++){let r=l[t],a;for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&r.eq(i[e].style)&&(a=t)}a?(a.to=n,a.step=o):i.push({style:r,from:Math.max(s,e),to:n,step:o})}}}),i.forEach(e=>r.step(new ec(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return eg(this,e,t,n),this}}let ej=Object.create(null);class eV{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new eF(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=p.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:l,$to:a}=o[s],d=e.mapping.slice(i);e.replaceRange(d.map(l.pos),d.map(a.pos),s?p.empty:t),0==s&&eQ(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],l=e.mapping.slice(n),a=l.map(o.pos),d=l.map(s.pos);i?e.deleteRange(a,d):(e.replaceRangeWith(a,d,t),eQ(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new eW(e):eY(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?eY(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):eY(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new eJ(e.node(0))}static atStart(e){return eY(e,e,0,0,1)||new eJ(e)}static atEnd(e){return eY(e,e,e.content.size,e.childCount,-1)||new eJ(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=ej[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ej)throw RangeError("Duplicate use of selection JSON ID "+e);return ej[e]=t,t.prototype.jsonID=e,t}getBookmark(){return eW.between(this.$anchor,this.$head).getBookmark()}}eV.prototype.visible=!0;class eF{constructor(e,t){this.$from=e,this.$to=t}}let eH=!1;function eq(e){eH||e.parent.inlineContent||(eH=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class eW extends eV{constructor(e,t=e){eq(e),eq(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return eV.near(n);let r=e.resolve(t.map(this.anchor));return new eW(r.parent.inlineContent?r:n,n)}replace(e,t=p.empty){if(super.replace(e,t),t==p.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof eW&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new e_(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new eW(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=eV.findFrom(t,n,!0)||eV.findFrom(t,-n,!0);if(!e)return eV.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(eV.findFrom(e,-n,!0)||eV.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new eW(e,t)}}eV.jsonID("text",eW);class e_{constructor(e,t){this.anchor=e,this.head=t}map(e){return new e_(e.map(this.anchor),e.map(this.head))}resolve(e){return eW.between(e.resolve(this.anchor),e.resolve(this.head))}}class eK extends eV{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?eV.near(i):new eK(i)}content(){return new p(s.from(this.node),0,0)}eq(e){return e instanceof eK&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new eU(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new eK(e.resolve(t.anchor))}static create(e,t){return new eK(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}eK.prototype.visible=!1,eV.jsonID("node",eK);class eU{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new e_(n,n):new eU(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&eK.isSelectable(n)?new eK(t):eV.near(t)}}class eJ extends eV{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=p.empty){if(t==p.empty){e.delete(0,e.doc.content.size);let t=eV.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new eJ(e)}map(e){return new eJ(e)}eq(e){return e instanceof eJ}getBookmark(){return eG}}eV.jsonID("all",eJ);let eG={map(){return this},resolve:e=>new eJ(e)};function eY(e,t,n,r,i,o=!1){if(t.inlineContent)return eW.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&eK.isSelectable(r))return eK.create(e,n-(i<0?r.nodeSize:0))}else{let t=eY(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function eQ(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof eu||o instanceof ef)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i)}),e.setSelection(eV.near(e.doc.resolve(r),n)))}class eX extends e${constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return c.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||c.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(eV.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function eZ(e,t){return t&&e?e.bind(t):e}class e0{constructor(e,t,n){this.name=e,this.init=eZ(t.init,n),this.apply=eZ(t.apply,n)}}let e1=[new e0("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new e0("selection",{init:(e,t)=>e.selection||eV.atStart(t.doc),apply:e=>e.selection}),new e0("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new e0("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class e2{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=e1.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new e0(e.key,e.spec.state,e))})}}class e3{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let l=r?r[o].n:0,a=r?r[o].state:this,d=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(d&&n.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(d),n=n.applyInner(d),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new e3(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new eX(this)}static create(e){let t=new e2(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new e3(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new e2(this.schema,e.plugins),n=t.fields,r=new e3(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new e2(e.schema,e.plugins),i=new e3(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=C.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=eV.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){i[r.name]=l.fromJSON.call(s,e,t[o],i);return}}i[r.name]=r.init(e,i)}}),i}}class e5{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o}return r}(e.props,this,this.props),this.key=e.key?e.key.key:e6("plugin")}getState(e){return e[this.key]}}let e4=Object.create(null);function e6(e){return e in e4?e+"$"+ ++e4[e]:(e4[e]=0,e+"$")}class e9{constructor(e="key"){this.key=e6(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}e.s(["AllSelection",()=>eJ,"EditorState",()=>e3,"NodeSelection",()=>eK,"Plugin",()=>e5,"PluginKey",()=>e9,"Selection",()=>eV,"SelectionRange",()=>eF,"TextSelection",()=>eW],827121);let e8=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function e7(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let te=(e,t,n)=>{let r=e7(e,n);if(!r)return!1;let i=ti(r);if(!i){let n=r.blockRange(),i=n&&ey(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(tf(e,i,t,-1))return!0;if(0==r.parent.content.size&&(tn(o,"end")||eK.isSelectable(o)))for(let n=r.depth;;n--){let s=eO(e.doc,r.before(n),r.after(n),p.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(tn(o,"end")?eV.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):eK.create(n.doc,i.pos-o.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)};function tt(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let o=t.nodeAfter,s=t.pos+1;for(;!o.isTextblock;s++){if(o.type.spec.isolating)return!1;let e=o.firstChild;if(!e)return!1;o=e}let l=eO(e.doc,i,s,p.empty);if(!l||l.from!=i||l instanceof eu&&l.slice.size>=s-i)return!1;if(n){let t=e.tr.step(l);t.setSelection(eW.create(t.doc,i)),n(t.scrollIntoView())}return!0}function tn(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let tr=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=ti(r)}let s=o&&o.nodeBefore;return!!s&&!!eK.isSelectable(s)&&(t&&t(e.tr.setSelection(eK.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function ti(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function to(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let ts=(e,t,n)=>{let r=to(e,n);if(!r)return!1;let i=ta(r);if(!i)return!1;let o=i.nodeAfter;if(tf(e,i,t,1))return!0;if(0==r.parent.content.size&&(tn(o,"start")||eK.isSelectable(o))){let n=eO(e.doc,r.before(),r.after(),p.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(tn(o,"start")?eV.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):eK.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},tl=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=ta(r)}let s=o&&o.nodeAfter;return!!s&&!!eK.isSelectable(s)&&(t&&t(e.tr.setSelection(eK.create(e.doc,o.pos)).scrollIntoView()),!0)};function ta(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}let td=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function tc(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let th=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=tc(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(eV.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},tp=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof eJ||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=tc(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(eW.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},tu=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ex(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ey(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function tf(e,t,n,r){let i,o,l,a=t.nodeBefore,d=t.nodeAfter,c,h,u=a.type.spec.isolating||d.type.spec.isolating;if(!u&&(i=t.nodeBefore,o=t.nodeAfter,l=t.index(),i&&o&&i.type.compatibleContent(o.type)&&(!i.content.size&&t.parent.canReplace(l-1,l)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(l,l+1)&&!!(o.isTextblock||eS(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let f=!u&&t.parent.canReplace(t.index(),t.index()+1);if(f&&(c=(h=a.contentMatchAt(a.childCount)).findWrapping(d.type))&&h.matchType(c[0]||d.type).validEnd){if(n){let r=t.pos+d.nodeSize,i=s.empty;for(let e=c.length-1;e>=0;e--)i=s.from(c[e].create(null,i));i=s.from(a.copy(i));let o=e.tr.step(new ef(t.pos-1,r,t.pos,r,new p(i,1,0),c.length,!0)),l=o.doc.resolve(r+2*c.length);l.nodeAfter&&l.nodeAfter.type==a.type&&eS(o.doc,l.pos)&&o.join(l.pos),n(o.scrollIntoView())}return!0}let m=d.type.spec.isolating||r>0&&u?null:eV.findFrom(t,1),g=m&&m.$from.blockRange(m.$to),y=g&&ey(g);if(null!=y&&y>=t.depth)return n&&n(e.tr.lift(g,y).scrollIntoView()),!0;if(f&&tn(d,"start",!0)&&tn(a,"end")){let r=a,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=d,l=1;for(;!o.isTextblock;o=o.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=s.empty;for(let e=i.length-1;e>=0;e--)r=s.from(i[e].copy(r));n(e.tr.step(new ef(t.pos-i.length,t.pos+d.nodeSize,t.pos+l,t.pos+d.nodeSize-l,new p(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function tm(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(eW.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}let tg=tm(-1),ty=tm(1);function tb(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t)}r(i.scrollIntoView())}return!0}}function tk(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let tv=tk(e8,te,tr),tw=tk(e8,ts,tl),tx={Enter:tk(td,tp,tu,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof eK&&e.selection.node.isBlock)return!!n.parentOffset&&!!ex(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i=[],o,s,l=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;l=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),s=tc(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));i.unshift(t||(l&&s?{type:s}:null)),o=e;break}if(1==e)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof eW||e.selection instanceof eJ)&&d.deleteSelection();let c=d.mapping.map(n.pos),h=ex(d.doc,c,i.length,i);if(h||(i[0]=s?{type:s}:null,h=ex(d.doc,c,i.length,i)),!h)return!1;if(d.split(c,i.length,i),!l&&a&&n.node(o).type!=s){let e=d.mapping.map(n.before(o)),t=d.doc.resolve(e);s&&n.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&d.setNodeMarkup(d.mapping.map(n.before(o)),s)}return t&&t(d.scrollIntoView()),!0}),"Mod-Enter":th,Backspace:tv,"Mod-Backspace":tv,"Shift-Backspace":tv,Delete:tw,"Mod-Delete":tw,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new eJ(e.doc))),!0)},tS={"Ctrl-h":tx.Backspace,"Alt-Backspace":tx["Mod-Backspace"],"Ctrl-d":tx.Delete,"Ctrl-Alt-Backspace":tx["Mod-Delete"],"Alt-Delete":tx["Mod-Delete"],"Alt-d":tx["Mod-Delete"],"Ctrl-a":tg,"Ctrl-e":ty};for(let e in tx)tS[e]=tx[e];"u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&os.platform&&os.platform(),e.s([],742612),e.s([],946806);let tM=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},tC=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},tT=null,tO=function(e,t,n){let r=tT||(tT=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},tE=function(){tT=null},tN=function(e,t,n,r){return n&&(tD(e,t,n,r,-1)||tD(e,t,n,r,1))},tA=/^(img|br|input|textarea|hr)$/i;function tD(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:tR(e))){let n=e.parentNode;if(!n||1!=n.nodeType||tI(e)||tA.test(e.nodeName)||"false"==e.contentEditable)return!1;t=tM(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(i<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(o=n.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;else e=n,t=i<0?tR(e):0}}}function tR(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function tI(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}let tL=function(e){return e.focusNode&&tN(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function tP(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let tz="u">typeof navigator?navigator:null,tB="u">typeof document?document:null,t$=tz&&tz.userAgent||"",tj=/Edge\/(\d+)/.exec(t$),tV=/MSIE \d/.exec(t$),tF=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t$),tH=!!(tV||tF||tj),tq=tV?document.documentMode:tF?+tF[1]:tj?+tj[1]:0,tW=!tH&&/gecko\/(\d+)/i.test(t$);tW&&(/Firefox\/(\d+)/.exec(t$)||[0,0])[1];let t_=!tH&&/Chrome\/(\d+)/.exec(t$),tK=!!t_,tU=t_?+t_[1]:0,tJ=!tH&&!!tz&&/Apple Computer/.test(tz.vendor),tG=tJ&&(/Mobile\/\w+/.test(t$)||!!tz&&tz.maxTouchPoints>2),tY=tG||!!tz&&/Mac/.test(tz.platform),tQ=!!tz&&/Win/.test(tz.platform),tX=/Android \d/.test(t$),tZ=!!tB&&"webkitFontSmoothing"in tB.documentElement.style,t0=tZ?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function t1(e,t){return"number"==typeof e?e:e[t]}function t2(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=tC(s);continue}let e=s,n=e==o.body,l=n?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}(o):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}(e),a=0,d=0;if(t.top<l.top+t1(r,"top")?d=-(l.top-t.top+t1(i,"top")):t.bottom>l.bottom-t1(r,"bottom")&&(d=t.bottom-t.top>l.bottom-l.top?t.top+t1(i,"top")-l.top:t.bottom-l.bottom+t1(i,"bottom")),t.left<l.left+t1(r,"left")?a=-(l.left-t.left+t1(i,"left")):t.right>l.right-t1(r,"right")&&(a=t.right-l.right+t1(i,"right")),a||d)if(n)o.defaultView.scrollBy(a,d);else{let n=e.scrollLeft,r=e.scrollTop;d&&(e.scrollTop+=d),a&&(e.scrollLeft+=a);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}let c=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(c))break;s="absolute"==c?s.offsetParent:tC(s)}}function t3(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=tC(r));return t}function t5(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let t4=null;function t6(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function t9(e){return e.top<e.bottom||e.left<e.right}function t8(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(t9(e))return e}return Array.prototype.find.call(n,t9)||e.getBoundingClientRect()}let t7=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ne(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=tZ||tW;if(3==r.nodeType)if(s&&(t7.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=t8(tO(r,i,i),n);if(tW&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=t8(tO(r,i-1,i-1),-1);if(t.top==e.top){let n=t8(tO(r,i,i+1),-1);if(n.top!=e.top)return nt(n,n.left<t.left)}}return e}else{let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,nt(t8(tO(r,e,t),o),o<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==tR(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return nn(e.getBoundingClientRect(),!1)}if(null==o&&i<tR(r)){let e=r.childNodes[i];if(1==e.nodeType)return nn(e.getBoundingClientRect(),!0)}return nn(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==tR(r))){let e=r.childNodes[i-1],t=3==e.nodeType?tO(e,tR(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return nt(t8(t,1),!1)}if(null==o&&i<tR(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?tO(e,0,+!s):1==e.nodeType?e:null:null;if(t)return nt(t8(t,-1),!0)}return nt(t8(3==r.nodeType?tO(r):r,-n),n>=0)}function nt(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function nn(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function nr(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}let ni=/[\u0590-\u08ac]/,no=null,ns=null,nl=!1;class na{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){let r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>tM(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),o;if(i&&(!t||i.node))if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return i;else n=!1}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],o=t+i.size;if(o>e||i instanceof nm){r=e-t;break}t=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof nd&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?tM(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?tM(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],l=o+n.size;if(-1==r&&e<=l){let i=o+n.border;if(e>=i&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=tM(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=tM(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],d=l+a.size;if(i>l&&o<d)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=d}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),d=n.domSelectionRange(),c=!1;if((tW||tJ)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if((c=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(s=l={node:n.parentNode,offset:tM(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];c=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(tW&&d.focusNode&&d.focusNode!=l.node&&1==d.focusNode.nodeType){let e=d.focusNode.childNodes[d.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||c&&tJ)&&tN(s.node,s.offset,d.anchorNode,d.anchorOffset)&&tN(l.node,l.offset,d.focusNode,d.focusOffset))return;let h=!1;if((a.extend||e==t)&&!(c&&tW)){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),h=!0}catch(e){}}if(!h){if(e>t){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s){this.dirty=e==n||t==o?2:1,e==r&&t==s&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class nd extends na{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class nc extends na{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class nh extends na{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=Q.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new nh(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=nh.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=nT(i,t,o,n)),e>0&&(i=nT(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class np extends na{constructor(e,t,n,r,i,o,s,l,a){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,o){let s=i.nodeViews[t.type.name],l,a=s&&s(t,i,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:o,n,r),d=a&&a.dom,c=a&&a.contentDOM;if(t.isText)if(d){if(3!=d.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else d=document.createTextNode(t.text);else if(!d){let e=Q.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:d,contentDOM:c}=e)}c||t.isText||"BR"==d.nodeName||(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let h=d;return(d=nw(d,n,t),a)?l=new ng(e,t,n,r,d,c||null,h,a,i,o+1):t.isText?new nf(e,t,n,r,d,h,i):new np(e,t,n,r,d,c||null,h,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>s.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&nx(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new nM(this,o&&o.node,e);(function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,l=[],a=null;for(let d=0;;){let c,h,p,u;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(c?(h||(h=[c])).push(e):c=e)}if(c)if(h){h.sort(nC);for(let e=0;e<h.length;e++)n(h[e],d,!!a)}else n(c,d,!!a);if(a)u=-1,p=a,a=null;else if(d<e.childCount)u=d,p=e.child(d++);else break;for(let e=0;e<l.length;e++)l[e].to<=o&&l.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)l.push(i[s++]);let f=o+p.nodeSize;if(p.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=p.cut(e-o),p=p.cut(0,e-o),f=e,u=-1)}else for(;s<i.length&&i[s].to<f;)s++;let m=p.isInline&&!p.isLeaf?l.filter(e=>!e.inline):l.slice();r(p,m,t.forChild(o,p),u),o=f}})(this.node,this.innerDeco,(t,i,o)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!o&&l.syncToMarks(i==this.node.childCount?c.none:this.node.child(i).marks,n,e,i),l.placeWidget(t,e,r)},(t,o,a,d)=>{let c;l.syncToMarks(t.marks,n,e,d),l.findNodeMatch(t,o,a,d)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(t,o,a,c,e)||l.updateNextNode(t,o,a,e,d,r)||l.addNode(t,o,a,e,r),r+=t.nodeSize}),l.syncToMarks([],n,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),function e(t,n,r){let i=t.firstChild,o=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=i;)i=nS(i),o=!0;i=i.nextSibling}else o=!0,t.insertBefore(a,i);if(l instanceof nh){let n=i?i.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),i=n?n.nextSibling:t.firstChild}}for(;i;)i=nS(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),tG&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof eW)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,o=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),l=o;if(o+=s.nodeSize,!s.isText)continue;let a=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;a+=t.text}if(o>=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return -1}(this.node.content,e,n-t,r-t);return o<0?null:{node:i,pos:o,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new nc(this,i,t,r);e.input.compositionNodes.push(o),this.children=nT(this.children,n,n+r.length,e,o)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(nx(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=nv(this.dom,this.nodeDOM,nk(this.outerDeco,this.node,t),nk(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function nu(e,t,n,r,i){nw(r,t,e);let o=new np(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class nf extends np{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new nf(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class nm extends na{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class ng extends np{constructor(e,t,n,r,i,o,s,l,a,d){super(e,t,n,r,i,o,s,a,d),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let ny=function(e){e&&(this.nodeName=e)};ny.prototype=Object.create(null);let nb=[new ny];function nk(e,t,n){if(0==e.length)return nb;let r=n?nb[0]:new ny,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s)for(let e in s.nodeName&&i.push(r=new ny(s.nodeName)),s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new ny(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}return i}function nv(e,t,n,r){if(n==nb&&r==nb)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),s=nb[0]),i=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}(i,s||nb[0],o)}return i}function nw(e,t,n){return nv(e,e,nb,nk(t,n,1!=e.nodeType))}function nx(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function nS(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class nM{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];n:for(;i>0;){let l;for(;;)if(r){let e=n.children[r-1];if(e instanceof nh)n=e,r=e.children.length;else{l=e,r--;break}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let a=l.node;if(a){if(a!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=nh.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return -1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return -1}e=t}}updateNextNode(e,t,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof np){let a=this.preMatch.matched.get(l);if(null!=a&&a!=i)return!1;let d=l.dom,c,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&nx(t,l.outerDeco));if(!h&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(l,e,t,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(r,o+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!nx(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=np.create(this.top,t,n,r,i,o);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,i){let o=np.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new nd(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof nh;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof nf)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((tJ||tK)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new nm(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function nC(e,t){return e.type.side-t.type.side}function nT(e,t,n,r,i){let o=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],d=l,c=l+=a.size;d>=n||c<=t?o.push(a):(d<t&&o.push(a.slice(0,t-d,r)),i&&(o.push(i),i=void 0),c>n&&o.push(a.slice(n-d,a.size,r)))}return o}function nO(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,d;if(tL(n)){for(a=s;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&eK.isSelectable(e)&&i.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,i=t==tR(e);r||i;){if(e==n)return!0;let t=tM(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==tR(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;d=new eK(s==e?l:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,i=s;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(o.endContainer,o.endOffset,-1))}if(t<0)return null;[a,s]=i==e.state.selection.anchor?[i,t]:[t,i],l=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let c=r.resolve(a);if(!d){let n="pointer"==t||e.state.selection.head<l.pos&&!o?1:-1;d=nz(e,c,l,n)}return d}function nE(e){return e.editable?e.hasFocus():n$(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function nN(e,t=!1){let n=e.state.selection;if(nL(e,n),nE(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&tK){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&tN(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,tM(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&tH&&tq<=11&&(n.disabled=!0,n.disabled=!1)}(e);else{var r;let i,o,s,l,{anchor:a,head:d}=n,c,h;nA&&!(n instanceof eW)&&(n.$from.parent.inlineContent||(c=nD(e,n.from)),n.empty||n.$from.parent.inlineContent||(h=nD(e,n.to))),e.docView.setSelection(a,d,e,t),nA&&(c&&nI(c),h&&nI(h)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((i=(r=e).dom.ownerDocument).removeEventListener("selectionchange",r.input.hideSelectionGuard),s=(o=r.domSelectionRange()).anchorNode,l=o.anchorOffset,i.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(o.anchorNode!=s||o.anchorOffset!=l)&&(i.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!nE(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let nA=tJ||tK&&tU<63;function nD(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(tJ&&i&&"false"==i.contentEditable)return nR(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return nR(i);else if(o)return nR(o)}}function nR(e){return e.contentEditable="true",tJ&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function nI(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nL(e,t){if(t instanceof eK){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(nP(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else nP(e)}function nP(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nz(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||eW.between(t,n,r)}function nB(e){return(!e.editable||!!e.hasFocus())&&n$(e)}function n$(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function nj(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&eV.findFrom(o,t)}function nV(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function nF(e,t,n){let r=e.state.selection;if(r instanceof eW){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return nV(e,new eW(r.$anchor,o))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=nj(e.state,t);return!!n&&n instanceof eK&&nV(e,n)}else if(!(tY&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,o;if(!i||i.isText)return!1;let s=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(o=e.docView.descAt(s))&&!o.contentDOM)&&(eK.isSelectable(i)?nV(e,new eK(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):!!tZ&&nV(e,new eW(e.state.doc.resolve(t<0?s:s+i.nodeSize))))}}else{if(r instanceof eK&&r.node.isInline)return nV(e,new eW(t>0?r.$to:r.$from));let n=nj(e.state,t);return!!n&&nV(e,n)}}function nH(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function nq(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function nW(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(tW&&1==n.nodeType&&r<nH(n)&&nq(n.childNodes[r],-1)&&(s=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(nq(e,-1))i=n,o=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(n_(n))break;else{let t=n.previousSibling;for(;t&&nq(t,-1);)i=n.parentNode,o=tM(t),t=t.previousSibling;if(t)r=nH(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}s?nK(e,n,r):i&&nK(e,i,o)}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s=nH(i);for(;;)if(o<s){if(1!=i.nodeType)break;if(nq(i.childNodes[o],1))t=i,n=++o;else break}else if(n_(i))break;else{let r=i.nextSibling;for(;r&&nq(r,1);)t=r.parentNode,n=tM(r)+1,r=r.nextSibling;if(r)o=0,s=nH(i=r);else{if((i=i.parentNode)==e.dom)break;o=s=0}}t&&nK(e,t,n)}(e)}function n_(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function nK(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!tI(e);)t=tM(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!tI(e);)t=tM(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(tL(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&nN(e)},50)}function nU(e,t){let n=e.state.doc.resolve(t);if(!(tK||tQ)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function nJ(e,t,n){let r=e.state.selection;if(r instanceof eW&&!r.empty||n.indexOf("s")>-1||tY&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=nj(e.state,t);if(n&&n instanceof eK)return nV(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof eJ?eV.near(n,t):eV.findFrom(n,t);return!!s&&nV(e,s)}return!1}function nG(e,t){if(!(e.state.selection instanceof eW))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function nY(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function nQ(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Q.fromSchema(e.state.schema),l=n4(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let d=a.firstChild,c,h=0;for(;d&&1==d.nodeType&&(c=n3[d.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=l.createElement(c[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),h++}d=a.firstChild}return d&&1==d.nodeType&&d.setAttribute("data-pm-slice",`${i} ${o}${h?` -${h}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function nX(e,t,n,r,i){let o,l,a=i.parent.type.spec.code;if(!n&&!t)return null;let d=!!t&&(r||a||!n);if(d){if(e.someProp("transformPastedText",n=>{t=n(t,a||r,e)}),a)return l=new p(s.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{l=t(l,e,!0)}),l;let n=e.someProp("clipboardTextParser",n=>n(t,i,r,e));if(n)l=n;else{let n=i.marks(),{schema:r}=e.state,s=Q.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),o=function(e){var t;let n,r=/^(\s*<meta [^>]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let i=n4().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e),s;if((s=o&&n3[o[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),i.innerHTML=(t=e,(n=window.trustedTypes)?(n6||(n6=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),n6.createHTML(t)):t),s)for(let e=0;e<s.length;e++)i=i.querySelector(s[e])||i;return i}(n),tZ&&function(e){let t=e.querySelectorAll(tK?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let c=o&&o.querySelector("[data-pm-slice]"),h=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let e=+h[3];e>0;e--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||H.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(d||h),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||nZ.test(e.parentNode.nodeName)?null:{ignore:!0}})),h)l=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:l}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=s.from(t.create(r[e+1],i)),o++,l++}return new p(i,o,l)}(n2(l,+h[1],+h[2]),h[4]);else if((l=p.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,o=[];if(e.forEach(e=>{if(!o)return;let t=r.findWrapping(e.type),n;if(!t)return o=null;if(n=o.length&&i.length&&function e(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let l=e(t,n,r,i.lastChild,o+1);if(l)return i.copy(i.content.replaceChild(i.childCount-1,l));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(s.from(n0(r,t,o+1))))}}(t,i,e,o[o.length-1],0))o[o.length-1]=n;else{o.length&&(o[o.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(s.empty,!0);return t.copy(r.append(i))}(o[o.length-1],i.length));let n=n0(e,t);o.push(n),r=r.matchType(n.type),i=t}}),o)return s.from(o)}return e}(l.content,i),!0)).openStart||l.openEnd){let e=0,t=0;for(let t=l.content.firstChild;e<l.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=l.content.lastChild;t<l.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);l=n2(l,e,t)}return e.someProp("transformPasted",t=>{l=t(l,e,d)}),l}let nZ=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function n0(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,s.from(e));return e}function n1(e,t,n,r,i,o){let l=t<0?e.firstChild:e.lastChild,a=l.content;return e.childCount>1&&(o=0),i<r-1&&(a=n1(a,t,n,r,i+1,o)),i>=n&&(a=t<0?l.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(l.contentMatchAt(l.childCount).fillBefore(s.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(a))}function n2(e,t,n){return t<e.openStart&&(e=new p(n1(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new p(n1(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let n3={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},n5=null;function n4(){return n5||(n5=document.implementation.createHTMLDocument("title"))}let n6=null,n9={},n8={},n7={touchstart:!0,touchmove:!0};class re{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function rt(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function rn(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>rr(e,t))})}function rr(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function ri(e){return{left:e.clientX,top:e.clientY}}function ro(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1}function rs(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}n8.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!rd(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!tX||!tK||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!tG||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||tY&&72==r&&"c"==i)return nG(e,-1)||nW(e,-1);if(46==r&&!t.shiftKey||tY&&68==r&&"c"==i)return nG(e,1)||nW(e,1);if(13==r||27==r)return!0;if(37==r||tY&&66==r&&"c"==i){let t=37==r?"ltr"==nU(e,e.state.selection.from)?-1:1:-1;return nF(e,t,i)||nW(e,t)}if(39==r||tY&&70==r&&"c"==i){let t=39==r?"ltr"==nU(e,e.state.selection.from)?1:-1:1;return nF(e,t,i)||nW(e,t)}else if(38==r||tY&&80==r&&"c"==i)return nJ(e,-1,i)||nW(e,-1);else if(40==r||tY&&78==r&&"c"==i)return function(e){if(!tJ||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;nY(e,n,"true"),setTimeout(()=>nY(e,n,"false"),20)}return!1}(e)||nJ(e,1,i)||nW(e,1);else if(i==(tY?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():rt(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,tP(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},n8.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},n8.keypress=(e,t)=>{if(rd(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||tY&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof eW)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault()}};let rl=tY?"metaKey":"ctrlKey";n9.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let o=ru(e),s=Date.now(),l="singleClick";s-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[rl]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?l="doubleClick":"doubleClick"==e.input.lastClick.type&&(l="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:l,button:t.button};let a=e.posAtCoords(ri(t));a&&("singleClick"==l?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new ra(e,a,t,!!o)):("doubleClick"==l?function(e,t,n,r){return ro(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return ro(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(rs(e,eW.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),o=i.before(t);if(n.inlineContent)rs(e,eW.create(r,o+1,o+1+n.content.size),"pointer");else{if(!eK.isSelectable(n))continue;rs(e,eK.create(r,o),"pointer")}return!0}}(e,n,r)})(e,a.pos,a.inside,t)?t.preventDefault():rt(e,"pointer"))};class ra{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[rl],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.nodeDOM.nodeType?l.nodeDOM:null;let{selection:a}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||a instanceof eK&&a.from<=o&&a.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&tW&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),rt(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>nN(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(ri(e))),this.updateAllowDefault(e),this.allowDefault||!t)rt(this.view,"pointer");else{var n,r,i,o;(n=this.view,r=t.pos,i=t.inside,o=this.selectNode,ro(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(o?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof eK&&(r=n.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(eK.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(e);break}}return null!=i&&(rs(e,eK.create(e.state.doc,i),"pointer"),!0)}(n,i):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&eK.isSelectable(r))&&(rs(e,new eK(n),"pointer"),!0)}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||tJ&&this.mightDrag&&!this.mightDrag.node.isAtom||tK&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(rs(this.view,eV.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):rt(this.view,"pointer")}}move(e){this.updateAllowDefault(e),rt(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function rd(e,t){return!!e.composing||!!(tJ&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}n9.touchstart=e=>{e.input.lastTouch=Date.now(),ru(e),rt(e,"pointer")},n9.touchmove=e=>{e.input.lastTouch=Date.now(),rt(e,"pointer")},n9.contextmenu=e=>ru(e);let rc=tX?5e3:-1;function rh(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ru(e),t))}function rp(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ru(e,t=!1){if(!tX||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),rp(e),t||e.docView&&e.docView.dirty){let n=nO(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}n8.compositionstart=n8.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof eW&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||tK&&tQ&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||1!=t.nodeType||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return 1==r.nodeType&&"false"==r.contentEditable}(e)))e.markCursor=e.state.storedMarks||n.marks(),ru(e,!0),e.markCursor=null;else if(ru(e,!t.selection.empty),tW&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}rh(e,rc)},n8.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,rh(e,20))};let rf=tH&&tq<15||tG&&t0<604;function rm(e,t,n,r,i){let o=nX(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||p.empty)))return!0;if(!o)return!1;let s=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function rg(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}n9.copy=n8.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=rf?null:t.clipboardData,{dom:o,text:s}=nQ(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",s)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},n8.paste=(e,t)=>{if(e.composing&&!tX)return;let n=rf?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&rm(e,rg(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?rm(e,r.value,null,i,t):rm(e,r.textContent,r.innerHTML,i,t)},50)}(e,t)};class ry{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let rb=tY?"altKey":"ctrlKey";function rk(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[rb]}for(let e in n9.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(ri(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof eK?i.to-1:i.to));else if(r&&r.mightDrag)n=eK.create(e.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=eK.create(e.state.doc,r.posBefore))}let s=(n||e.state.selection).content(),{dom:l,text:a,slice:d}=nQ(e,s);t.dataTransfer.files.length&&tK&&!(tU>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(rf?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",rf||t.dataTransfer.setData("text/plain",a),e.dragging=new ry(d,rk(e,t),n)},n9.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},n8.dragover=n8.dragenter=(e,t)=>t.preventDefault(),n8.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(ri(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1)}):o=nX(e,rg(t.dataTransfer),rf?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&rk(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||p.empty,s)))return t.preventDefault();if(!o)return;t.preventDefault();let l=o?eT(e.state.doc,i.pos,o):i.pos;null==l&&(l=i.pos);let a=e.state.tr;if(s){let{node:e}=n;e?e.replace(a):a.deleteSelection()}let d=a.mapping.map(l),c=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,h=a.doc;if(c?a.replaceRangeWith(d,d,o.content.firstChild):a.replaceRange(d,d,o),a.doc.eq(h))return;let u=a.doc.resolve(d);if(c&&eK.isSelectable(o.content.firstChild)&&u.nodeAfter&&u.nodeAfter.sameMarkup(o.content.firstChild))a.setSelection(new eK(u));else{let t=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),a.setSelection(nz(e,u,a.doc.resolve(t)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))}(e,t,e.dragging)}finally{e.dragging=null}},n9.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&nN(e)},20))},n9.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},n9.beforeinput=(e,t)=>{if(tK&&tX&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,tP(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}},n8)n9[e]=n8[e];function rv(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class rw{constructor(e,t){this.toDOM=e,this.spec=t||rT,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new rM(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof rw&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&rv(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class rx{constructor(e,t){this.attrs=e,this.spec=t||rT}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new rM(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof rx&&rv(this.attrs,e.attrs)&&rv(this.spec,e.spec)}static is(e){return e.type instanceof rx}destroy(){}}class rS{constructor(e,t){this.attrs=e,this.spec=t||rT}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new rM(i.pos-n,o.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(e){return this==e||e instanceof rS&&rv(this.attrs,e.attrs)&&rv(this.spec,e.spec)}destroy(){}}class rM{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new rM(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new rM(e,e,new rw(t,n))}static inline(e,t,n,r){return new rM(e,t,new rx(n,r))}static node(e,t,n,r){return new rM(e,t,new rS(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof rx}get widget(){return this.type instanceof rw}}let rC=[],rT={};class rO{constructor(e,t){this.local=e.length?e:rC,this.children=t.length?t:rC}static create(e,t){return t.length?rI(t,e,0,rT):rE}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==rE||0==e.maps.length?this:this.mapInner(e,t,0,0,n||rT)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(o||(o=[])).push(l):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let l=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let s=o-i-(n-e);for(let i=0;i<l.length;i+=3){let o=l[i+1];if(o<0||e>o+t-r)continue;let a=l[i]+t-r;n>=a?l[i+1]=e<=a?-2:-1:e>=t&&s&&(l[i]+=s,l[i+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let d=n.map(e[t]+o),c=d-i;if(c<0||c>=r.content.size){a=!0;continue}let h=n.map(e[t+1]+o,-1)-i,{index:p,offset:u}=r.content.findIndex(c),f=r.maybeChild(p);if(f&&u==c&&u+f.nodeSize==h){let r=l[t+2].mapInner(n,f,d+1,e[t]+o+1,s);r!=rE?(l[t]=c,l[t+1]=h,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=rI(function(e,t,n,r,i,o,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(r,i,o);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1)}(e[l+2],t[l]+o+1);return n}(l,e,t,n,i,o,s),r,0,s);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new rO(t.sort(rL),l)}(this.children,o||[],e,t,n,r,i):o?new rO(o.sort(rL),rC):rE}add(e,t){return t.length?this==rE?rO.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let s=o+n,l;if(l=rD(t,e,s)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,l,s+1):r.splice(i,0,o,o+e.nodeSize,rI(l,e,s+1,rT)),i+=3}});let o=rA(i?rR(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new rO(o.length?this.local.concat(o).sort(rL):this.local,r||this.children)}remove(e){return 0==e.length||this==rE?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,o=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<s&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(i,o+1);l!=rE?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new rO(r,n):rE}forChild(e,t){let n,r;if(this==rE)return this;if(t.isLeaf)return rO.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let i=e+1,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof rx){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new rO(r.sort(rL),rC);return n?new rN([e,n]):e}return n||rE}eq(e){if(this==e)return!0;if(!(e instanceof rO)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return rP(this.localsInner(e))}localsInner(e){if(this==rE)return rC;if(e.inlineContent||!this.local.some(rx.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof rx||t.push(this.local[e]);return t}forEachSet(e){e(this)}}rO.empty=new rO([],[]),rO.removeOverlap=rP;let rE=rO.empty;class rN{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,rT));return rN.from(n)}forChild(e,t){if(t.isLeaf)return rO.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=rE&&(i instanceof rN?n=n.concat(i.members):n.push(i))}return rN.from(n)}eq(e){if(!(e instanceof rN)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?rP(n?t:t.sort(rL)):rC}static from(e){switch(e.length){case 0:return rE;case 1:return e[0];default:return new rN(e.every(e=>e instanceof rO)?e:e.reduce((e,t)=>e.concat(t instanceof rO?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function rA(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new rM(i.from+t,i.to+t,i.type))}return n}function rD(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i}function rR(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function rI(e,t,n,r){let i=[],o=!1;t.forEach((t,s)=>{let l=rD(e,t,s+n);if(l){o=!0;let e=rI(l,t,n+s+1,r);e!=rE&&i.push(s,s+t.nodeSize,e)}});let s=rA(o?rR(e):e,-n).sort(rL);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new rO(s,i):rE}function rL(e,t){return e.from-t.from||e.to-t.to}function rP(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),rz(t,i+1,o.copy(r.to,o.to)));continue}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),rz(t,i,r.copy(o.from,r.to)));break}}return t}function rz(e,t,n){for(;t<e.length&&rL(n,e[t])>0;)t++;e.splice(t,0,n)}function rB(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=rE&&t.push(r)}),e.cursorWrapper&&t.push(rO.create(e.state.doc,[e.cursorWrapper.deco])),rN.from(t)}let r$={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},rj=tH&&tq<=11;class rV{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class rF{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rV,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);tH&&tq<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():tJ&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),rj&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,r$)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(nB(this.view)){if(this.suppressingSelectionUpdates)return nN(this.view);if(tH&&tq<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&tN(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=tC(n))t.add(n);for(let r=e.anchorNode;r;r=tC(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:3==n.nodeType?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&nB(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],a);t&&(o=o<0?t.from:Math.min(t.from,o),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(l=!0))}if(tW&&a.length){let e=a.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}(t,n)!=e)&&r.remove()}}}else if((tK||tJ)&&a.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode)){for(let e of a)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;t&&1==t.nodeType&&"false"==t.contentEditable&&e.parentNode.removeChild(e)}}let d=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&tL(r)&&(d=nO(t))&&d.eq(eV.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,nN(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),e=t,!rH.has(e)&&(rH.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=tW,rq||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),rq=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(n=o.parentNode)?void 0:n.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||1!=e.nodeType||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i)}else o.parentNode.removeChild(o)}}(t,a)),this.handleDOMChange(o,s,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||nN(t),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(tH&&tq<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o)}let o=r&&r.parentNode==e.target?tM(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),l=i&&i.parentNode==e.target?tM(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let rH=new WeakMap,rq=!1;function rW(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return tN(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function r_(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(tJ&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||tJ&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let rK=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function rU(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:nz(e,t.resolve(n.anchor),t.resolve(n.head))}function rJ(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function rG(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class rY{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new re,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(r1),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rZ(this),rX(this),this.nodeViews=r0(this),this.docView=nu(this.state.doc,rQ(this),rB(this),this.dom,this),this.domObserver=new rF(this,(e,t,n,r)=>(function(e,t,n,r,i){let o,l,a,d=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=nO(e,t);if(n&&!e.state.selection.eq(n)){if(tK&&tX&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,tP(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),d&&r.setMeta("composition",d),e.dispatch(r)}return}let c=e.state.doc.resolve(t),h=c.sharedDepth(n);t=c.before(h+1),n=e.state.doc.resolve(n).after(h+1);let p=e.state.selection,u=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),d=e.domSelectionRange(),c=d.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:d.anchorOffset}],tL(d)||r.push({node:d.focusNode,offset:d.focusOffset})),tK&&8===e.input.lastKeyCode)for(let e=s;e>o;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let h=e.state.doc,p=e.someProp("domParser")||H.fromSchema(e.state.schema),u=h.resolve(l),f=null,m=p.parse(i,{topNode:u.parent,topMatch:u.parent.contentMatchAt(u.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=u.parent.type.whitespace||"full",findPositions:r,ruleFromNode:r_,context:u});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,n),f=e.state.doc,m=f.slice(u.from,u.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(o=e.state.selection.to,l="end"):(o=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let g=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i){let e=Math.max(0,o-Math.min(s,l));r-=s+e-o}if(s<o&&e.size<t.size){let e=r<=o&&r>=s?o-r:0;(o-=e)&&o<t.size&&rG(t.textBetween(o-1,o+1))&&(o+=e?1:-1),l=o+(l-s),s=o}else if(l<o){let t=r<=o&&r>=l?o-r:0;(o-=t)&&o<e.size&&rG(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-l),l=o}return{start:o,endA:s,endB:l}}(m.content,u.doc.content,u.from,o,l);if(g&&e.input.domChangeCount++,(tG&&e.input.lastIOSEnter>Date.now()-225||tX)&&i.some(e=>1==e.nodeType&&!rK.test(e.nodeName))&&(!g||g.endA>=g.endB)&&e.someProp("handleKeyDown",t=>t(e,tP(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!g)if(r&&p instanceof eW&&!p.empty&&p.$head.sameParent(p.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))g={start:p.from,endA:p.to,endB:p.to};else{if(u.sel){let t=rU(e,e.state.doc,u.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);d&&n.setMeta("composition",d),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&g.start==g.endB&&e.state.selection instanceof eW&&(g.start>e.state.selection.from&&g.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?g.start=e.state.selection.from:g.endA<e.state.selection.to&&g.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(g.endB+=e.state.selection.to-g.endA,g.endA=e.state.selection.to)),tH&&tq<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>u.from&&"  "==u.doc.textBetween(g.start-u.from-1,g.start-u.from+1)&&(g.start--,g.endA--,g.endB--);let y=u.doc.resolveNoCache(g.start-u.from),b=u.doc.resolveNoCache(g.endB-u.from),k=f.resolve(g.start),v=y.sameParent(b)&&y.parent.inlineContent&&k.end()>=g.endA;if((tG&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!v&&y.pos<u.doc.content.size&&(!y.sameParent(b)||!y.parent.inlineContent)&&y.pos<b.pos&&!/\S/.test(u.doc.textBetween(y.pos,b.pos,"","")))&&e.someProp("handleKeyDown",t=>t(e,tP(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>g.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||rJ(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(rJ(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||rJ(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(f,g.start,g.endA,y,b)&&e.someProp("handleKeyDown",t=>t(e,tP(8,"Backspace")))){tX&&tK&&e.domObserver.suppressSelectionUpdates();return}tK&&g.endB==g.start&&(e.input.lastChromeDelete=Date.now()),tX&&!v&&y.start()!=b.start()&&0==b.parentOffset&&y.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==g.endA&&(g.endB-=2,b=u.doc.resolveNoCache(g.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,tP(13,"Enter"))})},20));let w=g.start,x=g.endA,S=t=>{let n=t||e.state.tr.replace(w,x,u.doc.slice(g.start-u.from,g.endB-u.from));if(u.sel){let t=rU(e,n.doc,u.sel);t&&!(tK&&e.composing&&t.empty&&(g.start!=g.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==w||t.head==n.mapping.map(x)-1)||tH&&t.empty&&t.head==w)&&n.setSelection(t)}return d&&n.setMeta("composition",d),n.scrollIntoView()};if(v)if(y.pos==b.pos){tH&&tq<=11&&0==y.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>nN(e),20));let t=S(e.state.tr.delete(w,x)),n=f.resolve(g.start).marksAcross(f.resolve(g.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(g.endA==g.endB&&(a=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,l,a,d;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)o=n[e].removeFromSet(o);if(1==i.length&&0==o.length)a=i[0],l="add",d=e=>e.mark(a.addToSet(e.marks));else{if(0!=i.length||1!=o.length)return null;a=o[0],l="remove",d=e=>e.mark(a.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(d(t.child(e)));if(s.from(c).eq(e))return{mark:a,type:l}}(y.parent.content.cut(y.parentOffset,b.parentOffset),k.parent.content.cut(k.parentOffset,g.endA-k.start())))){let t=S(e.state.tr);"add"==a.type?t.addMark(w,x,a.mark):t.removeMark(w,x,a.mark),e.dispatch(t)}else if(y.parent.child(y.index()).isText&&y.index()==b.index()-!b.textOffset){let t=y.parent.textBetween(y.parentOffset,b.parentOffset),n=()=>S(e.state.tr.insertText(t,w,x));e.someProp("handleTextInput",r=>r(e,w,x,t,n))||e.dispatch(n())}else e.dispatch(S());else e.dispatch(S())})(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in n9){let n=n9[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||rr(e,t)||!e.editable&&t.type in n8||n(e,t)},n7[t]?{passive:!0}:void 0)}tJ&&e.dom.addEventListener("input",()=>null),rn(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&rn(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(r1),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,r,i;let o=this.state,s=!1,l=!1;e.storedMarks&&this.composing&&(rp(this),l=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=r0(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&rn(this),this.editable=rZ(this),rX(this);let d=rB(this),c=rQ(this),h=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",p=s||!this.docView.matchesNode(e.doc,c,d);(p||!e.selection.eq(o.selection))&&(l=!0);let u="preserve"==h&&l&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=i-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:t3(e.dom)}}(this);if(l){let t,n,l;this.domObserver.stop();let a=p&&(tH||tK)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(r=o.selection,i=e.selection,l=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(l)!=i.$anchor.start(l));if(p){let t=tK?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=tR(e=e.childNodes[t-1])}else{if(!e.parentNode||tI(e))return null;t=tM(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||tI(e))return null;t=tM(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}(this)),(s||!this.docView.update(e.doc,c,d,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=nu(e.doc,c,d,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(a=!0)}a||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),tN(t.node,t.offset,n.anchorNode,n.anchorOffset)))?nN(this,a):(nL(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),(null==(n=this.dragging)?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"reset"==h?this.dom.scrollTop=0:"to selection"==h?this.scrollToSelection():u&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;t5(n,0==r?0:r-t)}(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof eK){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&t2(this,t.getBoundingClientRect(),e)}else t2(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new ry(e.slice,e.move,r<0?void 0:eK.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let o=i[n].props[e];if(null!=o&&(r=t?t(o):o))return r}}hasFocus(){if(tH){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(t4)return e.focus(t4);let t=t3(e);e.focus(null==t4?{get preventScroll(){return t4={preventScroll:!0},!0}}:void 0),t4||(t4=!1,t5(t,0))}(this.dom),nN(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return function(e,t){var n;let r,i,o=e.dom.ownerDocument,s,l=0,a=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(tR(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(tR(r.startContainer),r.startOffset)}}}(o,t.left,t.top);a&&({node:s,offset:l}=a);let d=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!d||!e.dom.contains(1!=d.nodeType?d.parentNode:d)){let n=e.dom.getBoundingClientRect();if(!t6(t,n)||!(d=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),s=o;;){let r=t.childNodes[s];if(1==r.nodeType){let t=r.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(t6(n,o))return e(r,n,o)}}if((s=(s+1)%i)==o)break}return t}(e.dom,t,n)))return null}if(tJ)for(let e=d;s&&e;e=tC(e))e.draggable&&(s=void 0);if(d=(r=(n=d).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(tW&&1==s.nodeType&&(l=Math.min(l,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[l],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&l++}tZ&&l&&1==s.nodeType&&1==(n=s.childNodes[l-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&l--,s==e.dom&&l==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>s.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:(0==l||1!=s.nodeType||"BR"!=s.childNodes[l-1].nodeName)&&(i=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&s.left>r.left||s.top>r.top?i=t.posBefore:(!o&&s.right<r.left||s.bottom<r.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,s,l,t))}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,o,s=2e8,l,a=0,d=n.top,c=n.top;for(let e=t.firstChild,h=0;e;e=e.nextSibling,h++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=tO(e).getClientRects()}for(let p=0;p<t.length;p++){let u=t[p];if(u.top<=d&&u.bottom>=c){d=Math.max(u.bottom,d),c=Math.min(u.top,c);let t=u.left>n.left?u.left-n.left:u.right<n.left?n.left-u.right:0;if(t<s){o=e,s=t,l=t&&3==o.nodeType?{left:u.right<n.left?u.right:u.left,top:n.top}:n,1==e.nodeType&&t&&(a=h+ +(n.left>=(u.left+u.right)/2));continue}}else u.top>n.top&&!r&&u.left<=n.left&&u.right>=n.left&&(r=e,i={left:Math.max(u.left,Math.min(u.right,n.left)),top:u.top});!o&&(n.left>=u.right&&n.top>=u.top||n.left>=u.left&&n.top>=u.bottom)&&(a=h+1)}}return(!o&&r&&(o=r,l=i,s=0),o&&3==o.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=t8(r,1);if(n.top!=n.bottom&&t6(t,n)){i={node:e,offset:o+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}(o,l):!o||s&&1==o.nodeType?{node:t,offset:a}:e(o,l)}(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,d,t));let c=e.docView.nearestDesc(d,!0);return{pos:i,inside:c?c.posAtStart-c.border:-1}}(this,e)}coordsAtPos(e,t=1){return ne(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,i;return no==t&&ns==n?nl:(no=t,ns=n,nl="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,nr(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=ne(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=tO(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=i==r.parent.content.size,s=e.domSelection();return s?ni.test(r.parent.textContent)&&s.modify?nr(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let d=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:c,focusOffset:h}=e.domSelectionRange(),p=c&&!d.contains(1==c.nodeType?c:c.parentNode)||t==c&&i==h;try{s.collapse(o,l),t&&(t!=o||i!=l)&&s.extend&&s.extend(t,i)}catch(e){}return null!=a&&(s.caretBidiLevel=a),p}):"left"==n||"backward"==n?!i:o:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return rm(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return rm(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return nQ(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rB(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,tE()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!rr(this,e)&&n9[e.type]&&(this.editable||!(e.type in n8))&&n9[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?tJ&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return rW(e,n)}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?rW(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function rQ(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[rM.node(0,e.state.doc.content.size,t)]}function rX(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:rM.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function rZ(e){return!e.someProp("editable",t=>!1===t(e.state))}function r0(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function r1(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}rY.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var r2={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:"'"},r3={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},r5="u">typeof navigator&&/Mac/.test(navigator.platform),r4="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),r6=0;r6<10;r6++)r2[48+r6]=r2[96+r6]=String(r6);for(var r6=1;r6<=24;r6++)r2[r6+111]="F"+r6;for(var r6=65;r6<=90;r6++)r2[r6]=String.fromCharCode(r6+32),r3[r6]=String.fromCharCode(r6);for(var r9 in r2)r3.hasOwnProperty(r9)||(r3[r9]=r2[r9]);let r8="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),r7="u">typeof navigator&&/Win/.test(navigator.platform);function ie(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function it(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))r8?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=e[n];return t}(e);return function(e,n){var r;let i=("Esc"==(r=!(r5&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||r4&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?r3:r2)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),o,s=t[ie(i,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[ie(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(r7&&n.ctrlKey&&n.altKey)&&(o=r2[n.keyCode])&&o!=i){let r=t[ie(o,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var ir=Object.defineProperty,ii=(e,t)=>{for(var n in t)ir(e,n,{get:t[n],enumerable:!0})};function io(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}var is=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(o);return i.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s=[],l=!!e,a=e||i.tr,d=()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(a),s.every(e=>!0===e)),c={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(a,t),i=n(...e)(r);return s.push(i),c}])),run:d};return c}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:o}=r,s={tr:e,editor:r,view:o,state:io({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(s)]))}};return s}},il={};ii(il,{blur:()=>ia,clearContent:()=>id,clearNodes:()=>ic,command:()=>ih,createParagraphNear:()=>ip,cut:()=>iu,deleteCurrentNode:()=>im,deleteNode:()=>iy,deleteRange:()=>ib,deleteSelection:()=>ik,enter:()=>iv,exitCode:()=>iw,extendMarkRange:()=>iE,first:()=>iN,focus:()=>iP,forEach:()=>iz,insertContent:()=>iB,insertContentAt:()=>iF,joinBackward:()=>iW,joinDown:()=>iq,joinForward:()=>i_,joinItemBackward:()=>iK,joinItemForward:()=>iU,joinTextblockBackward:()=>iJ,joinTextblockForward:()=>iG,joinUp:()=>iH,keyboardShortcut:()=>iQ,lift:()=>iZ,liftEmptyBlock:()=>i0,liftListItem:()=>i1,newlineInCode:()=>i2,resetAttributes:()=>i4,scrollIntoView:()=>i6,selectAll:()=>i9,selectNodeBackward:()=>i8,selectNodeForward:()=>i7,selectParentNode:()=>oe,selectTextblockEnd:()=>ot,selectTextblockStart:()=>on,setContent:()=>oi,setMark:()=>oH,setMeta:()=>oq,setNode:()=>oW,setNodeSelection:()=>o_,setTextDirection:()=>oK,setTextSelection:()=>oU,sinkListItem:()=>oJ,splitBlock:()=>oY,splitListItem:()=>oQ,toggleList:()=>o0,toggleMark:()=>o1,toggleNode:()=>o2,toggleWrap:()=>o3,undoInputRule:()=>o5,unsetAllMarks:()=>o4,unsetMark:()=>o6,unsetTextDirection:()=>o9,updateAttributes:()=>o8,wrapIn:()=>o7,wrapInList:()=>se});var ia=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),id=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),ic=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return!n||(i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,o=r.resolve(i.map(n)),s=r.resolve(i.map(n+e.nodeSize)),l=o.blockRange(s);if(!l)return;let a=ey(l);if(e.type.isTextblock){let{defaultType:e}=o.parent.contentMatchAt(o.index());t.setNodeMarkup(l.start,e)}(a||0===a)&&t.lift(l,a)})}),!0)},ih=e=>t=>e(t),ip=()=>({state:e,dispatch:t})=>tp(e,t),iu=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new eW(r.doc.resolve(Math.max(s-1,0)))),!0},im=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;n-=1)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function ig(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var iy=e=>({tr:t,state:n,dispatch:r})=>{let i=ig(e,n.schema),o=t.selection.$anchor;for(let e=o.depth;e>0;e-=1)if(o.node(e).type===i){if(r){let n=o.before(e),r=o.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},ib=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},ik=()=>({state:e,dispatch:t})=>e8(e,t),iv=()=>({commands:e})=>e.keyboardShortcut("Enter"),iw=()=>({state:e,dispatch:t})=>th(e,t);function ix(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function iS(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:ix(t[r])?t[r].test(e[r]):t[r]===e[r])}function iM(e,t,n={}){return e.find(e=>e.type===t&&iS(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function iC(e,t,n={}){return!!iM(e,t,n)}function iT(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if(i.node&&i.node.marks.some(e=>e.type===t)||(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(e=>e.type===t)||(n=n||(null==(r=i.node.marks[0])?void 0:r.attrs),!iM([...i.node.marks],t,n)))return;let o=i.index,s=e.start()+i.offset,l=o+1,a=s+i.node.nodeSize;for(;o>0&&iC([...e.parent.child(o-1).marks],t,n);)o-=1,s-=e.parent.child(o).nodeSize;for(;l<e.parent.childCount&&iC([...e.parent.child(l).marks],t,n);)a+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function iO(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var iE=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=iO(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:d,to:c}=l;if(i){let e=iT(a,o,t);if(e&&e.from<=d&&e.to>=c){let t=eW.create(s,e.from,e.to);n.setSelection(t)}}return!0},iN=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function iA(e){return e instanceof eW}function iD(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function iR(e,t=null){if(!t)return null;let n=eV.atStart(e),r=eV.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let i=n.from,o=r.to;return"all"===t?eW.create(e,iD(0,i,o),iD(e.content.size,i,o)):eW.create(e,iD(t,i,o),iD(t,i,o))}function iI(){return"Android"===navigator.platform||/android/i.test(navigator.userAgent)}function iL(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var iP=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};let s=()=>{(iL()||iI())&&r.dom.focus(),"u">typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!iL()&&!iI()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&null===e||!1===e)return!0}catch{return!1}if(o&&null===e&&!iA(n.state.selection))return s(),!0;let l=iR(i.doc,e)||n.state.selection,a=n.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},iz=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),iB=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),i$=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&i$(r)}return e};function ij(e){if("u"<typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return i$(new window.DOMParser().parseFromString(t,"text/html").body)}function iV(e,t,n){if(e instanceof C||e instanceof s)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,i="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return s.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error("[tiptap error]: Invalid JSON content",{cause:r});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",r),iV("",t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i="",o=new V({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:e=>(r=!0,i="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?H.fromSchema(o).parseSlice(ij(e),n.parseOptions):H.fromSchema(o).parse(ij(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${i}`)})}let r=H.fromSchema(t);return n.slice?r.parseSlice(ij(e),n.parseOptions).content:r.parse(ij(e),n.parseOptions)}return iV("",t,n)}var iF=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var l;if(i){let i,a;n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let d=e=>{o.emit("contentError",{editor:o,error:e,disableCollaboration:()=>{"collaboration"in o.storage&&"object"==typeof o.storage.collaboration&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{iV(t,o.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(e){d(e)}try{i=iV(t,o.schema,{parseOptions:c,errorOnInvalidContent:null!=(l=n.errorOnInvalidContent)?l:o.options.enableContentCheck})}catch(e){return d(e),!1}let{from:h,to:p}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},u=!0,f=!0;if((!("type"in i)?i:[i]).forEach(e=>{e.check(),u=!!u&&e.isText&&0===e.marks.length,f=!!f&&e.isBlock}),h===p&&f){let{parent:e}=r.doc.resolve(h);!e.isTextblock||e.type.spec.code||e.childCount||(h-=1,p+=1)}if(u){if(Array.isArray(t))a=t.map(e=>e.text||"").join("");else if(t instanceof s){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),a=e}else a="object"==typeof t&&t&&t.text?t.text:t;r.insertText(a,h,p)}else{a=i;let e=r.doc.resolve(h),t=e.node(),n=0===e.parentOffset,o=t.isText||t.isTextblock,s=t.content.size>0;n&&o&&s&&(h=Math.max(0,h-1)),r.replaceWith(h,p,a)}n.updateSelection&&function(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof eu||i instanceof ef))return;let o=e.mapping.maps[r],s=0;o.forEach((e,t,n,r)=>{0===s&&(s=r)}),e.setSelection(eV.near(e.doc.resolve(s),-1))}(r,r.steps.length-1,0),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:a}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:a})}return!0},iH=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r=n instanceof eK,i;if(r){if(n.node.isTextblock||!eS(e.doc,n.from))return!1;i=n.from}else if(null==(i=eC(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(eK.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0})(e,t),iq=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r;if(n instanceof eK){if(n.node.isTextblock||!eS(e.doc,n.to))return!1;r=n.to}else if(null==(r=eC(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0})(e,t),iW=()=>({state:e,dispatch:t})=>te(e,t),i_=()=>({state:e,dispatch:t})=>ts(e,t),iK=()=>({state:e,dispatch:t,tr:n})=>{try{let r=eC(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},iU=()=>({state:e,dispatch:t,tr:n})=>{try{let r=eC(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},iJ=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=e7(e,n);if(!r)return!1;let i=ti(r);return!!i&&tt(e,i,t)})(e,t),iG=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=to(e,n);if(!r)return!1;let i=ta(r);return!!i&&tt(e,i,t)})(e,t);function iY(){return"u">typeof navigator&&/Mac/.test(navigator.platform)}var iQ=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let o=(function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"===s&&(s=" ");for(let e=0;e<o.length-1;e+=1){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))iL()||iY()?i=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),i&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=o.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function iX(e,t,n={}){let{from:r,to:i,empty:o}=e.selection,s=t?ig(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);l.push({node:e,from:n,to:o})});let a=i-r,d=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>iS(e.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((e,t)=>e+t.to-t.from,0)>=a}var iZ=(e,t={})=>({state:n,dispatch:r})=>{let i=ig(e,n.schema);return!!iX(n,i,t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&ey(i);return null!=o&&(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)})(n,r)},i0=()=>({state:e,dispatch:t})=>tu(e,t),i1=e=>({state:t,dispatch:n})=>{var r;return(r=ig(e,t.schema),function(e,t){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,e=>e.childCount>0&&e.firstChild.type==r);return!!o&&(!t||(n.node(o.depth-1).type==r?function(e,t,n,r){let i=e.tr,o=r.end,l=r.$to.end(r.depth);o<l&&(i.step(new ef(o-1,l,o,l,new p(s.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new S(i.doc.resolve(r.$from.pos),i.doc.resolve(l),r.depth));let a=ey(r);if(null==a)return!1;i.lift(r,a);let d=i.doc.resolve(i.mapping.map(o,-1)-1);return eS(i.doc,d.pos)&&d.nodeBefore.type==d.nodeAfter.type&&i.join(d.pos),t(i.scrollIntoView()),!0}(e,t,r,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),l=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,d=n.endIndex==i.childCount,c=o.node(-1),h=o.index(-1);if(!c.canReplace(h+ +!a,h+1,l.content.append(d?s.empty:s.from(i))))return!1;let u=o.pos,f=u+l.nodeSize;return r.step(new ef(u-!!a,f+ +!!d,u+1,f-1,new p((a?s.empty:s.from(i.copy(s.empty))).append(d?s.empty:s.from(i.copy(s.empty))),+!a,+!d),+!a)),t(r.scrollIntoView()),!0}(e,t,o)))})(t,n)},i2=()=>({state:e,dispatch:t})=>td(e,t);function i3(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function i5(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var i4=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=i3("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(o=ig(e,r.schema)),"mark"===l&&(s=iO(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{o&&o===e.type&&(a=!0,i&&n.setNodeMarkup(r,void 0,i5(e.attrs,t))),s&&e.marks.length&&e.marks.forEach(o=>{s===o.type&&(a=!0,i&&n.addMark(r,r+e.nodeSize,s.create(i5(o.attrs,t))))})})}),a},i6=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),i9=()=>({tr:e,dispatch:t})=>{if(t){let t=new eJ(e.doc);e.setSelection(t)}return!0},i8=()=>({state:e,dispatch:t})=>tr(e,t),i7=()=>({state:e,dispatch:t})=>tl(e,t),oe=()=>({state:e,dispatch:t})=>((e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return 0!=o&&(i=n.before(o),t&&t(e.tr.setSelection(eK.create(e.doc,i))),!0)})(e,t),ot=()=>({state:e,dispatch:t})=>ty(e,t),on=()=>({state:e,dispatch:t})=>tg(e,t);function or(e,t,n={},r={}){return iV(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var oi=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{let{doc:a}=o;if("full"!==r.preserveWhitespace){let l=or(e,i.schema,r,{errorOnInvalidContent:null!=t?t:i.options.enableContentCheck});return s&&o.replaceWith(0,a.content.size,l).setMeta("preventUpdate",!n),!0}return s&&o.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:i.options.enableContentCheck})};function oo(e,t){let n=iO(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{s.push(...e.marks)});let l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function ol(e,t){let n=new e$(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function oa(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function od(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function oc(e,t,n){return void 0===e.config[t]&&e.parent?oc(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?oc(e.parent,t,n):null}):e.config[t]}function oh(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=oc(e,"addExtensions",t);return n?[e,...oh(n())]:e}).flat(10)}function op(e,t){let n=Q.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function ou(e){return"function"==typeof e}function of(e,t,...n){return ou(e)?t?e.bind(t)(...n):e(...n):e}function om(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function og(e){let t=[],{nodeExtensions:n,markExtensions:r}=om(e),i=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:i},r=oc(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...o,...r}})})})})}),i.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=oc(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let i={...o,...r};"function"==typeof(null==i?void 0:i.default)&&(i.default=i.default()),(null==i?void 0:i.isRequired)&&(null==i?void 0:i.default)===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function oy(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],i=n[e]?n[e].split(" "):[],o=r.filter(e=>!i.includes(e));n[e]=[...i,...o].join(" ")}else if("style"===e){let r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],i=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],o=new Map;i.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());o.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());o.set(t,n)}),n[e]=Array.from(o.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function ob(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>oy(e,t),{})}function ok(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let i=t.reduce((e,t)=>{var r;let i=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==i?e:{...e,[t.name]:i}},{});return{...r,...i}}}}function ov(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function ow(e){var t,n;let r={};return!(null==(t=null==e?void 0:e.attribute)?void 0:t.isRequired)&&"default"in((null==e?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(null==(n=null==e?void 0:e.attribute)?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function ox(e){return e.sort((e,t)=>{let n=oc(e,"priority")||100,r=oc(t,"priority")||100;return n>r?-1:+(n<r)})}function oS(e){var t;let n=ox(oh(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}function oM(e,t,n){let{from:r,to:i}=t,{blockSeparator:o="\n\n",textSerializers:s={}}=n||{},l="";return e.nodesBetween(r,i,(e,n,a,d)=>{var c;e.isBlock&&n>r&&(l+=o);let h=null==s?void 0:s[e.type.name];if(h)return a&&(l+=h({node:e,pos:n,parent:a,index:d,range:t})),!1;e.isText&&(l+=null==(c=null==e?void 0:e.text)?void 0:c.slice(Math.max(r,n)-n,i-n))}),l}function oC(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function oT(e,t){let n=i3("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){let n=ig(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,e=>{o.push(e)});let s=o.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}(e,t):"mark"===n?oo(e,t):{}}function oO(e){let t,{mapping:n,steps:r}=e,i=[];return n.maps.forEach((e,t)=>{let o=[];if(e.ranges.length)e.forEach((e,t)=>{o.push({from:e,to:t})});else{let{from:e,to:n}=r[t];if(void 0===e||void 0===n)return;o.push({from:e,to:n})}o.forEach(({from:e,to:r})=>{let o=n.slice(t).map(e,-1),s=n.slice(t).map(r),l=n.invert().map(o,-1),a=n.invert().map(s);i.push({oldRange:{from:l,to:a},newRange:{from:o,to:s}})})}),1===(t=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(i)).length?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function oE(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=iT(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var oN=(e,t,n,r=20)=>{let i=e.doc.resolve(n),o=r,s=null;for(;o>0&&null===s;){let e=i.node(o);(null==e?void 0:e.type.name)===t?s=e:o-=1}return[s,o]};function oA(e,t){return t.nodes[e]||t.marks[e]||null}function oD(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return!!r&&r.attribute.keepOnSplit}))}function oR(e,t,n={}){let{empty:r,ranges:i}=e.selection,o=t?iO(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!o||o.name===e.type.name).find(e=>iS(e.attrs,n,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),o=Math.min(i,t+e.nodeSize);s+=o-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:o})))})}),0===s)return!1;let a=l.filter(e=>!o||o.name===e.mark.type.name).filter(e=>iS(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),d=l.filter(e=>!o||e.mark.type!==o&&e.mark.type.excludes(o)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+d:a)>=s}var oI=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=od(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos},oL=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos};function oP(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function oz(e,t){let{nodeExtensions:n}=om(t),r=n.find(t=>t.name===e);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=of(oc(r,"group",i));return"string"==typeof o&&o.split(" ").includes("list")}function oB(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(oB(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function o$(e){return e instanceof eK}var oj=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function oV(e,t){let n=t.mapping.mapResult(e.position);return{position:new oj(n.pos),mapResult:n}}function oF(e){return new oj(e)}var oH=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:o}=n,{empty:s,ranges:l}=o,a=iO(e,r.schema);if(i)if(s){let e=oo(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{let i=e.$from.pos,o=e.$to.pos;r.doc.nodesBetween(i,o,(e,r)=>{let s=Math.max(r,i),l=Math.min(r+e.nodeSize,o);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){var r;let{selection:i}=t,o=null;if(iA(i)&&(o=i.$cursor),o){let t=null!=(r=e.storedMarks)?r:o.marks();return o.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:s}=i;return s.some(({$from:t,$to:r})=>{let i=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),o=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&o}return!i}),i})}(r,n,a)},oq=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),oW=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let o,s=ig(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock)?i().command(({commands:e})=>!!tb(s,{...o,...t})(n)||e.clearNodes()).command(({state:e})=>tb(s,{...o,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},o_=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=iD(e,0,n.content.size),i=eK.create(n,r);t.setSelection(i)}return!0},oK=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o,s,{selection:l}=r;return"number"==typeof t?(o=t,s=t):t&&"from"in t&&"to"in t?(o=t.from,s=t.to):(o=l.from,s=l.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},oU=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}="number"==typeof e?{from:e,to:e}:e,o=eW.atStart(n).from,s=eW.atEnd(n).to,l=iD(r,o,s),a=iD(i,o,s),d=eW.create(n,l,a);t.setSelection(d)}return!0},oJ=e=>({state:t,dispatch:n})=>{var r;return(r=ig(e,t.schema),function(e,t){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,e=>e.childCount>0&&e.firstChild.type==r);if(!o)return!1;let l=o.startIndex;if(0==l)return!1;let a=o.parent,d=a.child(l-1);if(d.type!=r)return!1;if(t){let n=d.lastChild&&d.lastChild.type==a.type,i=s.from(n?r.create():null),l=new p(s.from(r.create(null,s.from(a.type.create(null,i)))),n?3:1,0),c=o.start,h=o.end;t(e.tr.step(new ef(c-(n?3:1),h,c,h,l,1,!0)).scrollIntoView())}return!0})(t,n)};function oG(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var oY=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:o,doc:s}=t,{$from:l,$to:a}=o,d=oD(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(o instanceof eK&&o.node.isBlock)return!!l.parentOffset&&!!ex(s,l.pos)&&(r&&(e&&oG(n,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let c=a.parentOffset===a.parent.content.size,h=0===l.depth?void 0:function(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1))),p=c&&h?[{type:h,attrs:d}]:void 0,u=ex(t.doc,t.mapping.map(l.pos),1,p);if(!p&&!u&&ex(t.doc,t.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(u=!0,p=h?[{type:h,attrs:d}]:void 0),r){if(u&&(o instanceof eW&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,p),h&&!c&&!l.parentOffset&&l.parent.type!==h)){let e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,h)&&t.setNodeMarkup(t.mapping.map(l.before()),h)}e&&oG(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return u},oQ=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var l;let a=ig(e,r.schema),{$from:d,$to:c}=r.selection,h=r.selection.node;if(h&&h.isBlock||d.depth<2||!d.sameParent(c))return!1;let u=d.node(-1);if(u.type!==a)return!1;let f=o.extensionManager.attributes;if(0===d.parent.content.size&&d.node(-1).childCount===d.indexAfter(-1)){if(2===d.depth||d.node(-3).type!==a||d.index(-2)!==d.node(-2).childCount-1)return!1;if(i){let e=s.empty,r=d.index(-1)?1:d.index(-2)?2:3;for(let t=d.depth-r;t>=d.depth-3;t-=1)e=s.from(d.node(t).copy(e));let i=d.indexAfter(-1)<d.node(-2).childCount?1:d.indexAfter(-2)<d.node(-3).childCount?2:3,o={...oD(f,d.node().type.name,d.node().attrs),...t},c=(null==(l=a.contentMatch.defaultType)?void 0:l.createAndFill(o))||void 0;e=e.append(s.from(a.createAndFill(null,c)||void 0));let h=d.before(d.depth-(r-1));n.replace(h,d.after(-i),new p(e,4-r,0));let u=-1;n.doc.nodesBetween(h,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&0===e.content.size&&(u=t+1)}),u>-1&&n.setSelection(eW.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let m=c.pos===d.end()?u.contentMatchAt(0).defaultType:null,g={...oD(f,u.type.name,u.attrs),...t},y={...oD(f,d.node().type.name,d.node().attrs),...t};n.delete(d.pos,c.pos);let b=m?[{type:a,attrs:g},{type:m,attrs:y}]:[{type:a,attrs:g}];if(!ex(n.doc,d.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:s}=o.extensionManager,l=t||e.$to.parentOffset&&e.$from.marks();if(n.split(d.pos,2,b).scrollIntoView(),!l||!i)return!0;let a=l.filter(e=>s.includes(e.type.name));n.ensureMarks(a)}return!0},oX=(e,t)=>{let n=od(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&eS(e.doc,n.pos))||(e.join(n.pos),!0)},oZ=(e,t)=>{let n=od(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let i=e.doc.nodeAt(r);return!(n.node.type===(null==i?void 0:i.type)&&eS(e.doc,r))||(e.join(r),!0)},o0=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:d,can:c})=>{let{extensions:h,splittableMarks:p}=i.extensionManager,u=ig(e,s.schema),f=ig(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,k=y.blockRange(b),v=g||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;let w=od(e=>oz(e.type.name,h))(m);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===u)return d.liftListItem(f);if(oz(w.node.type.name,h)&&u.validContent(w.node.content)&&l)return a().command(()=>(o.setNodeMarkup(w.pos,u),!0)).command(()=>oX(o,u)).command(()=>oZ(o,u)).run()}return n&&v&&l?a().command(()=>{let e=c().wrapInList(u,r),t=v.filter(e=>p.includes(e.type.name));return o.ensureMarks(t),!!e||d.clearNodes()}).wrapInList(u,r).command(()=>oX(o,u)).command(()=>oZ(o,u)).run():a().command(()=>!!c().wrapInList(u,r)||d.clearNodes()).wrapInList(u,r).command(()=>oX(o,u)).command(()=>oZ(o,u)).run()},o1=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=n,s=iO(e,r.schema);return oR(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},o2=(e,t,n={})=>({state:r,commands:i})=>{let o,s=ig(e,r.schema),l=ig(t,r.schema),a=iX(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),a)?i.setNode(l,o):i.setNode(s,{...o,...n})},o3=(e,t={})=>({state:n,commands:r})=>{let i=ig(e,n.schema);return iX(n,i,t)?r.lift(i):r.wrapIn(i,t)},o5=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i,o=n[r];if(o.spec.isInputRules&&(i=o.getState(e))){if(t){let t=e.tr,n=i.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(i.text){let n=t.doc.resolve(i.from).marks();t.replaceWith(i.from,i.to,e.schema.text(i.text,n))}else t.delete(i.from,i.to)}return!0}}return!1},o4=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return!!r||(t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},o6=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=iO(e,r.schema),{$from:d,empty:c,ranges:h}=l;if(!i)return!0;if(c&&s){let{from:e,to:t}=l,r=null==(o=d.marks().find(e=>e.type===a))?void 0:o.attrs,i=iT(d,a,r);i&&(e=i.from,t=i.to),n.removeMark(e,t,a)}else h.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},o9=e=>({tr:t,state:n,dispatch:r})=>{let i,o,{selection:s}=n;return"number"==typeof e?(i=e,o=e):e&&"from"in e&&"to"in e?(i=e.from,o=e.to):(i=s.from,o=s.to),r&&t.doc.nodesBetween(i,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},o8=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null,l=i3("string"==typeof e?e:e.name,r.schema);if(!l)return!1;"node"===l&&(o=ig(e,r.schema)),"mark"===l&&(s=iO(e,r.schema));let a=!1;return n.selection.ranges.forEach(e=>{let l,d,c,h,p=e.$from.pos,u=e.$to.pos;n.selection.empty?r.doc.nodesBetween(p,u,(e,t)=>{o&&o===e.type&&(a=!0,c=Math.max(t,p),h=Math.min(t+e.nodeSize,u),l=t,d=e)}):r.doc.nodesBetween(p,u,(e,r)=>{r<p&&o&&o===e.type&&(a=!0,c=Math.max(r,p),h=Math.min(r+e.nodeSize,u),l=r,d=e),r>=p&&r<=u&&(o&&o===e.type&&(a=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),s&&e.marks.length&&e.marks.forEach(o=>{if(s===o.type&&(a=!0,i)){let i=Math.max(r,p),l=Math.min(r+e.nodeSize,u);n.addMark(i,l,s.create({...o.attrs,...t}))}}))}),d&&(void 0!==l&&i&&n.setNodeMarkup(l,void 0,{...d.attrs,...t}),s&&d.marks.length&&d.marks.forEach(e=>{s===e.type&&i&&n.addMark(c,h,s.create({...e.attrs,...t}))}))}),a},o7=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&eb(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}})(ig(e,n.schema),t)(n,r),se=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,l=i.blockRange(o);if(!l)return!1;let a=r?n.tr:null;return!!function(e,t,n,r=null){let i=!1,o=t,l=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=l.resolve(t.start-2);o=new S(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new S(t.$from,l.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let a=eb(o,n,r,t);return!!a&&(e&&function(e,t,n,r,i){let o=s.empty;for(let e=n.length-1;e>=0;e--)o=s.from(n[e].type.create(n[e].attrs,o));e.step(new ef(t.start-2*!!r,t.end,t.start,t.end,new p(o,0,0),n.length,!0));let l=0;for(let e=0;e<n.length;e++)n[e].type==i&&(l=e+1);let a=n.length-l,d=t.start+n.length-2*!!r,c=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&ex(e.doc,d,a)&&(e.split(d,a),d+=2*a),d+=c.child(n).nodeSize}(e,t,a,i,n),!0)}(a,l,e,t)&&(r&&r(a.scrollIntoView()),!0)}})(ig(e,n.schema),t)(n,r),st=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},sn=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=null==(t=e.undoable)||t}};function sr(e){var t;let{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;let d=a.state.doc.resolve(r);if(d.parent.type.spec.code||(null==(t=d.nodeBefore||d.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let c=!1,h=((e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,o)=>{var s,l;let a=(null==(l=(s=e.type.spec).toText)?void 0:l.call(s,{node:e,pos:t,parent:i,index:o}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(d)+o;return s.forEach(e=>{if(c)return;let t=((e,t)=>{if(ix(t))return t.exec(e);let n=t(e);if(!n)return null;let r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r})(h,e.find);if(!t)return;let s=a.state.tr,d=io({state:a.state,transaction:s}),p={from:r-(t[0].length-o.length),to:i},{commands:u,chain:f,can:m}=new is({editor:n,state:d});null!==e.handler({state:d,range:p,match:t,commands:u,chain:f,can:m})&&s.steps.length&&(e.undoable&&s.setMeta(l,{transform:s,from:r,to:i,text:o}),a.dispatch(s),c=!0)}),c}function si(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var so=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...of(oc(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...of(oc(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return si(t)&&si(n)&&Object.keys(n).forEach(i=>{si(n[i])&&si(t[i])?r[i]=e(t[i],n[i]):r[i]=n[i]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},ss=class e extends so{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let o=i.find(e=>(null==e?void 0:e.type.name)===t.name);return o&&n.removeStoredMark(o),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},sl=class{constructor(e){this.find=e.find,this.handler=e.handler}},sa=null,sd=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=oS(e),this.schema=function(e,t){var n;let r=og(e),{nodeExtensions:i,markExtensions:o}=om(e),s=null==(n=i.find(e=>oc(e,"topNode")))?void 0:n.name;return new V({topNode:s,nodes:Object.fromEntries(i.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=ov({...e.reduce((e,t)=>{let r=oc(t,"extendNodeSchema",o);return{...e,...r?r(n):{}}},{}),content:of(oc(n,"content",o)),marks:of(oc(n,"marks",o)),group:of(oc(n,"group",o)),inline:of(oc(n,"inline",o)),atom:of(oc(n,"atom",o)),selectable:of(oc(n,"selectable",o)),draggable:of(oc(n,"draggable",o)),code:of(oc(n,"code",o)),whitespace:of(oc(n,"whitespace",o)),linebreakReplacement:of(oc(n,"linebreakReplacement",o)),defining:of(oc(n,"defining",o)),isolating:of(oc(n,"isolating",o)),attrs:Object.fromEntries(i.map(ow))}),l=of(oc(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>ok(e,i)));let a=oc(n,"renderHTML",o);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:ob(e,i)}));let d=oc(n,"renderText",o);return d&&(s.toText=d),[n.name,s]})),marks:Object.fromEntries(o.map(n=>{let i=r.filter(e=>e.type===n.name),o={name:n.name,options:n.options,storage:n.storage,editor:t},s=ov({...e.reduce((e,t)=>{let r=oc(t,"extendMarkSchema",o);return{...e,...r?r(n):{}}},{}),inclusive:of(oc(n,"inclusive",o)),excludes:of(oc(n,"excludes",o)),group:of(oc(n,"group",o)),spanning:of(oc(n,"spanning",o)),code:of(oc(n,"code",o)),attrs:Object.fromEntries(i.map(ow))}),l=of(oc(n,"parseHTML",o));l&&(s.parseDOM=l.map(e=>ok(e,i)));let a=oc(n,"renderHTML",o);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:ob(e,i)})),[n.name,s]}))})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:oA(t.name,this.schema)},r=oc(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this;return ox([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:oA(t.name,this.schema)},r=[],i=oc(t,"addKeyboardShortcuts",n),o={};if("mark"===t.type&&oc(t,"exitable",n)&&(o.ArrowRight=()=>ss.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));o={...o,...t}}let l=new e5({props:{handleKeyDown:it(o)}});r.push(l);let a=oc(t,"addInputRules",n);if(oP(t,e.options.enableInputRules)&&a){let t=a();if(t&&t.length){let n=function(e){let{editor:t,rules:n}=e,r=new e5({state:{init:()=>null,apply(e,i,o){let l=e.getMeta(r);if(l)return l;let a=e.getMeta("applyInputRules");return a&&setTimeout(()=>{let{text:e}=a;"string"==typeof e||(e=op(s.from(e),o.schema));let{from:i}=a,l=i+e.length;sr({editor:t,from:i,to:l,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput:(e,i,o,s)=>sr({editor:t,from:i,to:o,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&sr({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if("Enter"!==i.key)return!1;let{$cursor:o}=e.state.selection;return!!o&&sr({editor:t,from:o.pos,to:o.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let d=oc(t,"addPasteRules",n);if(oP(t,e.options.enablePasteRules)&&d){let t=d();if(t&&t.length){let n=function(e){let t,{editor:n,rules:r}=e,i=null,o=!1,l=!1,a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let d=({state:e,from:r,to:i,rule:o,pasteEvt:s})=>{let l=e.tr;if(function(e){let{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:d,can:c}=new is({editor:t,state:n}),h=[];return n.doc.nodesBetween(r,i,(e,t)=>{var p,u,f,m,g;if((null==(u=null==(p=e.type)?void 0:p.spec)?void 0:u.code)||!(e.isText||e.isTextblock||e.isInline))return;let y=null!=(g=null!=(m=null==(f=e.content)?void 0:f.size)?m:e.nodeSize)?g:0,b=Math.max(r,t),k=Math.min(i,t+y);b>=k||((e,t,n)=>{if(ix(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n}):[]})(e.isText?e.text||"":e.textBetween(b-t,k-t,void 0,""),o.find,s).forEach(e=>{if(void 0===e.index)return;let t=b+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=o.handler({state:n,range:i,match:e,commands:a,chain:d,can:c,pasteEvent:s,dropEvent:l});h.push(p)})}),h.every(e=>null!==e)}({editor:n,state:io({state:e,transaction:l}),from:Math.max(r-1,0),to:i.b-1,rule:o,pasteEvent:s,dropEvent:t})&&l.steps.length){try{t="u">typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return a="u">typeof ClipboardEvent?new ClipboardEvent("paste"):null,l}};return r.map(e=>new e5({view(e){let t=t=>{var r;(i=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(sa=n)},r=()=>{sa&&(sa=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(l=i===e.dom.parentElement,t=n,!l){let e=sa;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return a=t,o=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let i=t[0],c="paste"===i.getMeta("uiEvent")&&!o,h="drop"===i.getMeta("uiEvent")&&!l,p=i.getMeta("applyPasteRules"),u=!!p;if(!c&&!h&&!u)return;if(u){var f,m;let t,{text:n}=p;"string"==typeof n||(n=op(s.from(n),r.schema));let{from:i}=p,o=i+n.length;return d({rule:e,state:r,from:i,to:{b:o},pasteEvt:(f=n,null==(m=(t=new ClipboardEvent("paste",{clipboardData:new DataTransfer})).clipboardData)||m.setData("text/html",f),t)})}let g=n.doc.content.findDiffStart(r.doc.content),y=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof g&&y&&g!==y.b)return d({rule:e,state:r,from:g,to:y,pasteEvt:a})}}))}({editor:e,rules:t});r.push(...n)}}let c=oc(t,"addProseMirrorPlugins",n);if(c){let e=c();r.push(...e)}return r})}get attributes(){return og(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=om(this.extensions);return Object.fromEntries(t.filter(e=>!!oc(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:ig(t.name,this.schema)},i=oc(t,"addNodeView",r);if(!i)return[];let o=i();return o?[t.name,(r,i,s,l,a)=>{let d=ob(r,n);return o({node:r,view:i,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:d})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return ox([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:oA(n.name,this.schema)},i=oc(n,"dispatchTransaction",r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}get markViews(){let{editor:e}=this,{markExtensions:t}=om(this.extensions);return Object.fromEntries(t.filter(e=>!!oc(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:iO(t.name,this.schema)},i=oc(t,"addMarkView",r);return i?[t.name,(r,o,s)=>{let l=ob(r,n);return i()({mark:r,view:o,inline:s,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{sV(r,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t;let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:oA(e.name,this.schema)};"mark"===e.type&&(null==(t=of(oc(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=oc(e,"onBeforeCreate",n),i=oc(e,"onCreate",n),o=oc(e,"onUpdate",n),s=oc(e,"onSelectionUpdate",n),l=oc(e,"onTransaction",n),a=oc(e,"onFocus",n),d=oc(e,"onBlur",n),c=oc(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),o&&this.editor.on("update",o),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),a&&this.editor.on("focus",a),d&&this.editor.on("blur",d),c&&this.editor.on("destroy",c)})}};sd.resolve=oS,sd.sort=ox,sd.flatten=oh;var sc={};ii(sc,{ClipboardTextSerializer:()=>sp,Commands:()=>su,Delete:()=>sf,Drop:()=>sm,Editable:()=>sg,FocusEvents:()=>sb,Keymap:()=>sk,Paste:()=>sv,Tabindex:()=>sw,TextDirection:()=>sx,focusEventsPluginKey:()=>sy});var sh=class e extends so{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},sp=sh.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new e5({key:new e9("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(e=>e.$from.pos)),l=Math.max(...o.map(e=>e.$to.pos)),a=oC(n);return oM(r,{from:s,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),su=sh.create({name:"commands",addCommands:()=>({...il})}),sf=sh.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;let o=()=>{var n,r,i,o;if(null!=(o=null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:i.call(r,e))?o:e.getMeta("y-sync$"))return;let s=ol(e.before,[e,...t]);oO(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let i=r+n.nodeSize-2,o=t.oldRange.from<=r&&i<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:i,newFrom:s.mapping.map(r),newTo:s.mapping.map(i),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:s})})});let l=s.mapping;s.steps.forEach((t,n)=>{var r,i;if(t instanceof ec){let o=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),d=l.invert().map(o,-1),c=l.invert().map(a),h=null==(r=s.doc.nodeAt(o-1))?void 0:r.marks.some(e=>e.eq(t.mark)),p=null==(i=s.doc.nodeAt(a))?void 0:i.marks.some(e=>e.eq(t.mark));this.editor.emit("delete",{type:"mark",mark:t.mark,from:t.from,to:t.to,deletedRange:{from:d,to:c},newRange:{from:o,to:a},partial:!!(p||h),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(i=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||i?setTimeout(o,0):o()}}),sm=sh.create({name:"drop",addProseMirrorPlugins(){return[new e5({key:new e9("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),sg=sh.create({name:"editable",addProseMirrorPlugins(){return[new e5({key:new e9("editable"),props:{editable:()=>this.editor.options.editable}})]}}),sy=new e9("focusEvents"),sb=sh.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new e5({key:sy,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),sk=sh.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:o}=n,{pos:s,parent:l}=o,a=o.parent.isTextblock&&s>0?t.doc.resolve(s-1):o,d=a.parent.type.spec.isolating,c=o.pos-o.parentOffset,h=d&&1===a.parent.childCount?c===o.pos:eV.atStart(r).from===s;return!!i&&!!l.type.isTextblock&&!l.textContent.length&&!!h&&(!h||"paragraph"!==o.parent.type.name)&&e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...n},i={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return iL()||iY()?i:r},addProseMirrorPlugins(){return[new e5({key:new e9("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta("composition")))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=t.selection,a=eV.atStart(t.doc).from,d=eV.atEnd(t.doc).to;if(o||s!==a||l!==d||!oB(n.doc))return;let c=n.tr,h=io({state:n,transaction:c}),{commands:p}=new is({editor:this.editor,state:h});if(p.clearNodes(),c.steps.length)return c}})]}}),sv=sh.create({name:"paste",addProseMirrorPlugins(){return[new e5({key:new e9("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),sw=sh.create({name:"tabindex",addProseMirrorPlugins(){return[new e5({key:new e9("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),sx=sh.create({name:"textDirection",addOptions:()=>({direction:void 0}),addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=om(this.extensions);return[{types:e.filter(e=>"text"!==e.name).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute("dir");return t&&("ltr"===t||"rtl"===t||"auto"===t)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new e5({key:new e9("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),sS=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+ +!this.node.isText}get parent(){if(0===this.depth)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=n.isInline,l=this.pos+r+ +!o;if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;let a=this.resolvedPos.doc.resolve(l);if(!i&&!s&&a.depth<=this.depth)return;let d=new e(a,this.editor,i,i||s?n:null);i&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||0===this.children.length)return r;let i=Object.keys(t);return this.children.forEach(o=>{n&&r.length>0||(o.node.type.name===e&&i.every(e=>t[e]===o.node.attrs[e])&&r.push(o),n&&r.length>0||(r=r.concat(o.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},sM=`.ProseMirror {
2
+ position: relative;
3
+ }
4
+
5
+ .ProseMirror {
6
+ word-wrap: break-word;
7
+ white-space: pre-wrap;
8
+ white-space: break-spaces;
9
+ -webkit-font-variant-ligatures: none;
10
+ font-variant-ligatures: none;
11
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
12
+ }
13
+
14
+ .ProseMirror [contenteditable="false"] {
15
+ white-space: normal;
16
+ }
17
+
18
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
19
+ white-space: pre-wrap;
20
+ }
21
+
22
+ .ProseMirror pre {
23
+ white-space: pre-wrap;
24
+ }
25
+
26
+ img.ProseMirror-separator {
27
+ display: inline !important;
28
+ border: none !important;
29
+ margin: 0 !important;
30
+ width: 0 !important;
31
+ height: 0 !important;
32
+ }
33
+
34
+ .ProseMirror-gapcursor {
35
+ display: none;
36
+ pointer-events: none;
37
+ position: absolute;
38
+ margin: 0;
39
+ }
40
+
41
+ .ProseMirror-gapcursor:after {
42
+ content: "";
43
+ display: block;
44
+ position: absolute;
45
+ top: -2px;
46
+ width: 20px;
47
+ border-top: 1px solid black;
48
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
49
+ }
50
+
51
+ @keyframes ProseMirror-cursor-blink {
52
+ to {
53
+ visibility: hidden;
54
+ }
55
+ }
56
+
57
+ .ProseMirror-hideselection *::selection {
58
+ background: transparent;
59
+ }
60
+
61
+ .ProseMirror-hideselection *::-moz-selection {
62
+ background: transparent;
63
+ }
64
+
65
+ .ProseMirror-hideselection * {
66
+ caret-color: transparent;
67
+ }
68
+
69
+ .ProseMirror-focused .ProseMirror-gapcursor {
70
+ display: block;
71
+ }`,sC=class extends st{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"u">typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:oV,createMappablePosition:oF},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=iR(t,this.options.autofocus);this.editorState=e3.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("u"<typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(!1!==this.options.autofocus&&null!==this.options.autofocus&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{"function"==typeof this.css.remove?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"u">typeof document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}(sM,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=ou(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t="string"==typeof e?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[sg,sp.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),su,sb,sk,sw,sm,sv,sf,sx.configure({direction:this.options.textDirection})].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new sd(n,this)}createCommandManager(){this.commandManager=new is({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=or(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=or(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r;this.editorView=new rY(e,{...t,attributes:{role:"textbox",...null==t?void 0:t.attributes},dispatchTransaction:i,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==s?void 0:s.getMeta("focus"),a=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||o.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return oT(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return iX(e,null,n)||oR(e,null,n);let r=i3(t,e.schema);return"node"===r?iX(e,t,n):"mark"===r&&oR(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return op(this.state.doc.content,this.schema)}getText(e){var t,n;let r,{blockSeparator:i="\n\n",textSerializers:o={}}=e||{};return t=this.state.doc,n={blockSeparator:i,textSerializers:{...oC(this.schema),...o}},r={from:0,to:t.content.size},oM(t,r,n)}get isEmpty(){return oB(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){return new sS(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function sT(e){return new sn({find:e.find,handler:({state:t,range:n,match:r})=>{let i=of(e.getAttributes,void 0,r);if(!1===i||null===i)return null;let{tr:o}=t,s=r[r.length-1],l=r[0];if(s){let r=l.search(/\S/),a=n.from+l.indexOf(s),d=a+s.length;if(oE(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>a).length)return null;d<n.to&&o.delete(d,n.to),a>n.from&&o.delete(n.from+r,a);let c=n.from+r+s.length;o.addMark(n.from+r,c,e.type.create(i||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function sO(e){return new sn({find:e.find,handler:({state:t,range:n,match:r})=>{let i=of(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from,l=n.to,a=e.type.create(i);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>l?e=l:l=e+r[1].length;let t=r[0][r[0].length-1];o.insertText(t,s+r[0].length-1),o.replaceWith(e,l,a)}else if(r[0]){let t=e.type.isInline?s:s-1;o.insert(t,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()},undoable:e.undoable})}function sE(e){return new sn({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),o=of(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})}function sN(e){return new sn({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let o=of(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&eb(l,e.type,o);if(!a)return null;if(s.wrap(l,a),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,o=r||n.$to.parentOffset&&n.$from.marks();if(o){let e=o.filter(e=>i.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";i().updateAttributes(t,o).run()}let d=s.doc.resolve(n.from-1).nodeBefore;d&&d.type===e.type&&eS(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,d))&&s.join(n.from-1)},undoable:e.undoable})}function sA(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof eK){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;i-=1}return!1}function sD(e){if(!(null==e?void 0:e.trim()))return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(" "));let o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(t.id=o[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{var i;let o=n[parseInt((null==(i=r.match(/__QUOTED_(\d+)__/))?void 0:i[1])||"0",10)];o&&(t[e]=o.slice(1,-1))});let s=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return s&&s.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function sR(e){if(!e||0===Object.keys(e).length)return"";let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{"class"!==e&&"id"!==e&&(!0===n?t.push(e):!1!==n&&null!=n&&t.push(`${e}="${String(n)}"`))}),t.join(" ")}function sI(e){let{nodeName:t,name:n,parseAttributes:r=sD,serializeAttributes:i=sR,defaultAttributes:o={},requiredAttributes:s=[],allowedAttributes:l}=e,a=n||t;return{parseMarkdown:(e,n)=>{let r={...o,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${a}(?:\\s|$)`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,i){let o=RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),l=e.match(o);if(!l)return;let d=r(l[1]||"");if(!s.find(e=>!(e in d)))return{type:t,raw:l[0],attributes:d}}},renderMarkdown:e=>{let t=i((e=>{if(!l)return e;let t={};return l.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),n=t?` {${t}}`:"";return`:::${a}${n} :::`}}}function sL(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=sD,serializeAttributes:o=sR,defaultAttributes:s={},content:l="block",allowedAttributes:a}=e,d=n||t;return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i="string"==typeof t?[{type:"text",text:t}]:t}else i="block"===l?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let o={...s,...e.attributes};return n.createNode(t,o,i)},markdownTokenizer:{name:t,level:"block",start(e){var t;let n=RegExp(`^:::${d}`,"m"),r=null==(t=e.match(n))?void 0:t.index;return void 0!==r?r:-1},tokenize(e,n,r){var o;let s=RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),a=e.match(s);if(!a)return;let[c,h=""]=a,p=i(h),u=1,f=c.length,m="",g=/^:::([\w-]*)(\s.*)?/gm,y=e.slice(f);for(g.lastIndex=0;;){let n=g.exec(y);if(null===n)break;let i=n.index,s=n[1];if(null==(o=n[2])||!o.endsWith(":::")){if(s)u+=1;else if(0==(u-=1)){let o=y.slice(0,i);m=o.trim();let s=e.slice(0,f+i+n[0].length),a=[];if(m)if("block"===l)for((a=r.blockTokens(o)).forEach(e=>{e.text&&(!e.tokens||0===e.tokens.length)&&(e.tokens=r.inlineTokens(e.text))});a.length>0;){let e=a[a.length-1];if("paragraph"!==e.type||e.text&&""!==e.text.trim())break;a.pop()}else a=r.inlineTokens(m);return{type:t,raw:s,attributes:p,content:m,tokens:a}}}}}},renderMarkdown:(e,t)=>{let n=o((e=>{if(!a)return e;let t={};return a.forEach(n=>{n in e&&(t[n]=e[n])}),t})(e.attrs||{})),r=n?` {${n}}`:"",i=t.renderChildren(e.content||[],"\n\n");return`:::${d}${r}
72
+
73
+ ${i}
74
+
75
+ :::`}}}function sP(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;null!==r;){let[,i,o,s]=r;t[i]=o||s,r=n.exec(e)}return t}function sz(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}="${t}"`).join(" ")}function sB(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=sP,serializeAttributes:o=sz,defaultAttributes:s={},selfClosing:l=!1,allowedAttributes:a}=e,d=n||t,c=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(e,n)=>{let i={...s,...e.attributes};if(l)return n.createNode(t,i);let o=r?r(e):e.content||"";return o?n.createNode(t,i,[n.createTextNode(o)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:"inline",start(e){let t=l?RegExp(`\\[${c}\\s*[^\\]]*\\]`):RegExp(`\\[${c}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${c}\\]`),n=e.match(t),r=null==n?void 0:n.index;return void 0!==r?r:-1},tokenize(e,n,r){let o=l?RegExp(`^\\[${c}\\s*([^\\]]*)\\]`):RegExp(`^\\[${c}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${c}\\]`),s=e.match(o);if(!s)return;let a="",d="";if(l){let[,e]=s;d=e}else{let[,e,t]=s;d=e,a=t||""}let h=i(d.trim());return{type:t,raw:s[0],content:a.trim(),attributes:h}}},renderMarkdown:e=>{let t="";r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>"text"===e.type).map(e=>e.text).join(""));let n=o((e=>{if(!a)return e;let t={};return a.forEach(n=>{let r="string"==typeof n?n:n.name,i="string"==typeof n?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(void 0!==i&&n===i)return;t[r]=n}}),t})(e.attrs||{})),i=n?` ${n}`:"";return l?`[${d}${i}]`:`[${d}${i}]${t}[/${d}]`}}}function s$(e,t,n){var r,i,o,s;let l=e.split("\n"),a=[],d="",c=0,h=t.baseIndentSize||2;for(;c<l.length;){let e,p=l[c],u=p.match(t.itemPattern);if(!u)if(a.length>0)break;else{if(""!==p.trim())return;c+=1,d=`${d}${p}
76
+ `;continue}let f=t.extractItemData(u),{indentLevel:m,mainContent:g}=f;d=`${d}${p}
77
+ `;let y=[g];for(c+=1;c<l.length;){let e=l[c];if(""===e.trim()){let t=l.slice(c+1).findIndex(e=>""!==e.trim());if(-1===t)break;if(((null==(i=null==(r=l[c+1+t].match(/^(\s*)/))?void 0:r[1])?void 0:i.length)||0)>m){y.push(e),d=`${d}${e}
78
+ `,c+=1;continue}break}if(((null==(s=null==(o=e.match(/^(\s*)/))?void 0:o[1])?void 0:s.length)||0)>m)y.push(e),d=`${d}${e}
79
+ `,c+=1;else break}let b=y.slice(1);if(b.length>0){let r=b.map(e=>e.slice(m+h)).join("\n");r.trim()&&(e=t.customNestedParser?t.customNestedParser(r):n.blockTokens(r))}let k=t.createToken(f,e);a.push(k)}if(0!==a.length)return{items:a,raw:d}}function sj(e,t,n,r){if(!e||!Array.isArray(e.content))return"";let i="function"==typeof n?n(r):n,[o,...s]=e.content,l=t.renderChildren([o]),a=[`${i}${l}`];return s&&s.length>0&&s.forEach(e=>{let n=t.renderChildren([e]);if(n){let e=n.split("\n").map(e=>e?t.indent(e):"").join("\n");a.push(e)}}),a.join("\n")}function sV(e,t,n={}){let{state:r}=t,{doc:i,tr:o}=r;i.descendants((t,r)=>{let i=o.mapping.map(r),s=o.mapping.map(r)+t.nodeSize,l=null;if(t.marks.forEach(t=>{if(t!==e)return!1;l=t}),!l)return;let a=!1;if(Object.keys(n).forEach(e=>{n[e]!==l.attrs[e]&&(a=!0)}),a){let t=e.type.create({...e.attrs,...n});o.removeMark(i,s,e.type),o.addMark(i,s,t)}}),o.docChanged&&t.view.dispatch(o)}ii({},{createAtomBlockMarkdownSpec:()=>sI,createBlockMarkdownSpec:()=>sL,createInlineMarkdownSpec:()=>sB,parseAttributes:()=>sD,parseIndentedBlocks:()=>s$,renderNestedMarkdownContent:()=>sj,serializeAttributes:()=>sR});var sF=class{constructor(e,t,n){this.component=e,this.editor=t.editor,this.options={...n},this.mark=t.mark,this.HTMLAttributes=t.HTMLAttributes}get dom(){return this.editor.view.dom}get contentDOM(){return null}updateAttributes(e,t){sV(t||this.mark,this.editor,e)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(iL()||iI())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}},sH=class e extends so{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},sq=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,r,i,o,s,l;let{view:a}=this.editor,d=e.target,c=3===d.nodeType?null==(t=d.parentElement)?void 0:t.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||(null==(n=this.contentDOM)?void 0:n.contains(d))||!c)return;let h=0,p=0;if(this.dom!==c){let t=this.dom.getBoundingClientRect(),n=c.getBoundingClientRect(),l=null!=(i=e.offsetX)?i:null==(r=e.nativeEvent)?void 0:r.offsetX,a=null!=(s=e.offsetY)?s:null==(o=e.nativeEvent)?void 0:o.offsetY;h=n.x-t.x+l,p=n.y-t.y+a}let u=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();u.style.width=`${Math.round(e.width)}px`,u.style.height=`${Math.round(e.height)}px`,u.style.boxSizing="border-box",u.style.pointerEvents="none"}catch{}let f=null;try{(f=document.createElement("div")).style.position="absolute",f.style.top="-9999px",f.style.left="-9999px",f.style.pointerEvents="none",f.appendChild(u),document.body.appendChild(f),null==(l=e.dataTransfer)||l.setDragImage(u,h,p)}finally{f&&setTimeout(()=>{try{null==f||f.remove()}catch{}},0)}let m=this.getPos();if("number"!=typeof m)return;let g=eK.create(a.state.doc,m),y=a.state.tr.setSelection(g);a.dispatch(y)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});let n=e.target;if(!(this.dom.contains(n)&&!(null==(t=this.contentDOM)?void 0:t.contains(n))))return!1;let r=e.type.startsWith("drag"),i="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!i&&!r)return!0;let{isEditable:o}=this.editor,{isDragging:s}=this,l=!!this.node.type.spec.draggable,a=eK.isSelectable(this.node),d="copy"===e.type,c="paste"===e.type,h="cut"===e.type,p="mousedown"===e.type;if(!l&&a&&r&&e.target===this.dom&&e.preventDefault(),l&&r&&!s&&e.target===this.dom)return e.preventDefault(),!1;if(l&&o&&!s&&p){let e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!s&&!i&&!d&&!c&&!h&&(!p||!a)}ignoreMutation(e){return!this.dom||!this.contentDOM||("function"==typeof this.options.ignoreMutation?this.options.ignoreMutation({mutation:e}):!!this.node.isLeaf||!!this.node.isAtom||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(iL()||iI())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)))}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return"number"==typeof n&&(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){let e=this.getPos();if("number"!=typeof e)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function sW(e){return new sl({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let o=of(e.getAttributes,void 0,r,i);if(!1===o||null===o)return null;let{tr:s}=t,l=r[r.length-1],a=r[0],d=n.to;if(l){let r=a.search(/\S/),i=n.from+a.indexOf(l),c=i+l.length;if(oE(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>i).length)return null;c<n.to&&s.delete(c,n.to),i>n.from&&s.delete(n.from+r,i),d=n.from+r+l.length,s.addMark(n.from+r,d,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}e.s(["Editor",()=>sC,"Extension",()=>sh,"Mark",()=>ss,"MarkView",()=>sF,"Node",()=>sH,"NodeView",()=>sq,"callOrReturn",()=>of,"canInsertNode",()=>sA,"combineTransactionSteps",()=>ol,"extensions",()=>sc,"findChildrenInRange",()=>oa,"getAttributes",()=>oT,"getChangedRanges",()=>oO,"getExtensionField",()=>oc,"getHTMLFromFragment",()=>op,"getMarksBetween",()=>oE,"getNodeAtPosition",()=>oN,"getNodeType",()=>ig,"getRenderedAttributes",()=>ob,"isAtEndOfNode",()=>oI,"isAtStartOfNode",()=>oL,"isNodeActive",()=>iX,"isNodeEmpty",()=>oB,"isNodeSelection",()=>o$,"markInputRule",()=>sT,"markPasteRule",()=>sW,"mergeAttributes",()=>oy,"nodeInputRule",()=>sO,"parseIndentedBlocks",()=>s$,"renderNestedMarkdownContent",()=>sj,"textblockTypeInputRule",()=>sE,"wrappingInputRule",()=>sN],10552);let{getOwnPropertyNames:s_,getOwnPropertySymbols:sK}=Object,{hasOwnProperty:sU}=Object.prototype;function sJ(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function sG(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);let{cache:i}=r,o=i.get(t),s=i.get(n);if(o&&s)return o===n&&s===t;i.set(t,n),i.set(n,t);let l=e(t,n,r);return i.delete(t),i.delete(n),l}}function sY(e){return s_(e).concat(sK(e))}let sQ=Object.hasOwn||((e,t)=>sU.call(e,t));function sX(e,t){return e===t||!e&&!t&&e!=e&&t!=t}let{getOwnPropertyDescriptor:sZ,keys:s0}=Object;function s1(e,t){return e.byteLength===t.byteLength&&lr(new Uint8Array(e),new Uint8Array(t))}function s2(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function s3(e,t){return e.byteLength===t.byteLength&&lr(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function s5(e,t){return sX(e.getTime(),t.getTime())}function s4(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function s6(e,t){return e===t}function s9(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),l=e.entries(),a=0;for(;(r=l.next())&&!r.done;){let o=t.entries(),l=!1,d=0;for(;(i=o.next())&&!i.done;){if(s[d]){d++;continue}let o=r.value,c=i.value;if(n.equals(o[0],c[0],a,d,e,t,n)&&n.equals(o[1],c[1],o[0],c[0],e,t,n)){l=s[d]=!0;break}d++}if(!l)return!1;a++}return!0}function s8(e,t,n){let r=s0(e),i=r.length;if(s0(t).length!==i)return!1;for(;i-- >0;)if(!lo(e,t,n,r[i]))return!1;return!0}function s7(e,t,n){let r,i,o,s=sY(e),l=s.length;if(sY(t).length!==l)return!1;for(;l-- >0;)if(!lo(e,t,n,r=s[l])||(i=sZ(e,r),o=sZ(t,r),(i||o)&&(!i||!o||i.configurable!==o.configurable||i.enumerable!==o.enumerable||i.writable!==o.writable)))return!1;return!0}function le(e,t){return sX(e.valueOf(),t.valueOf())}function lt(e,t){return e.source===t.source&&e.flags===t.flags}function ln(e,t,n){let r,i,o=e.size;if(o!==t.size)return!1;if(!o)return!0;let s=Array(o),l=e.values();for(;(r=l.next())&&!r.done;){let o=t.values(),l=!1,a=0;for(;(i=o.next())&&!i.done;){if(!s[a]&&n.equals(r.value,i.value,r.value,i.value,e,t,n)){l=s[a]=!0;break}a++}if(!l)return!1}return!0}function lr(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function li(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function lo(e,t,n,r){return("_owner"===r||"__o"===r||"__v"===r)&&(!!e.$$typeof||!!t.$$typeof)||sQ(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}let ls={"[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},ll=Object.prototype.toString,la=ld();function ld(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,o=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:d,areRegExpsEqual:c,areSetsEqual:h,areTypedArraysEqual:p,areUrlsEqual:u,unknownTagComparators:f}){return function(m,g,y){if(m===g)return!0;if(null==m||null==g)return!1;let b=typeof m;if(b!==typeof g)return!1;if("object"!==b)return"number"===b?l(m,g,y):"function"===b&&o(m,g,y);let k=m.constructor;if(k!==g.constructor)return!1;if(k===Object)return a(m,g,y);if(Array.isArray(m))return t(m,g,y);if(k===Date)return r(m,g,y);if(k===RegExp)return c(m,g,y);if(k===Map)return s(m,g,y);if(k===Set)return h(m,g,y);let v=ll.call(m);if("[object Date]"===v)return r(m,g,y);if("[object RegExp]"===v)return c(m,g,y);if("[object Map]"===v)return s(m,g,y);if("[object Set]"===v)return h(m,g,y);if("[object Object]"===v)return"function"!=typeof m.then&&"function"!=typeof g.then&&a(m,g,y);if("[object URL]"===v)return u(m,g,y);if("[object Error]"===v)return i(m,g,y);if("[object Arguments]"===v)return a(m,g,y);if(ls[v])return p(m,g,y);if("[object ArrayBuffer]"===v)return e(m,g,y);if("[object DataView]"===v)return n(m,g,y);if("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)return d(m,g,y);if(f){let e=f[v];if(!e){let t=null!=m?m[Symbol.toStringTag]:void 0;t&&(e=f[t])}if(e)return e(m,g,y)}return!1}}(function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:s1,areArraysEqual:n?s7:s2,areDataViewsEqual:s3,areDatesEqual:s5,areErrorsEqual:s4,areFunctionsEqual:s6,areMapsEqual:n?sJ(s9,s7):s9,areNumbersEqual:sX,areObjectsEqual:n?s7:s8,arePrimitiveWrappersEqual:le,areRegExpsEqual:lt,areSetsEqual:n?sJ(ln,s7):ln,areTypedArraysEqual:n?sJ(lr,s7):lr,areUrlsEqual:li,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=sG(r.areArraysEqual),t=sG(r.areMapsEqual),n=sG(r.areObjectsEqual),i=sG(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}(e)),s=n?n(o):function(e,t,n,r,i,s,l){return o(e,t,l)};return function({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(o,s){let{cache:l=e?new WeakMap:void 0,meta:a}=n();return t(o,s,{cache:l,equals:r,meta:a,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let o={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,o)}}({circular:t,comparator:o,createState:r,equals:s,strict:i})}ld({strict:!0}),ld({circular:!0}),ld({circular:!0,strict:!0}),ld({createInternalComparator:()=>sX}),ld({strict:!0,createInternalComparator:()=>sX}),ld({circular:!0,createInternalComparator:()=>sX}),ld({circular:!0,createInternalComparator:()=>sX,strict:!0});var lc=e.i(430224),lh=({contentComponent:e})=>{let t=(0,r.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,i.jsx)(i.Fragment,{children:Object.values(t)})},lp=class extends t.default.Component{constructor(e){var n;super(e),this.editorContentRef=t.default.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(n=e.editor)?void 0:n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;let t=this.props.editor;if(t&&!t.isDestroyed&&(null==(e=t.view.dom)?void 0:e.parentNode)){let e,r;if(t.contentComponent)return;let i=this.editorContentRef.current;i.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:i}),e=new Set,r={},t.contentComponent={subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>r,getServerSnapshot:()=>r,setRenderer(t,i){r={...r,[t]:n.default.createPortal(i.reactElement,i.element,t)},e.forEach(e=>e())},removeRenderer(t){let n={...r};delete n[t],r=n,e.forEach(e=>e())}},this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;let t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!(null==(e=t.view.dom)?void 0:e.parentNode))return;let n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,i.jsx)(lh,{contentComponent:e.contentComponent})]})}},lu=(0,t.forwardRef)((e,n)=>{let r=t.default.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return t.default.createElement(lp,{key:r,innerRef:n,...e})}),lf=t.default.memo(lu),lm="u">typeof window?t.useLayoutEffect:t.useEffect,lg=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,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(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},ly="u"<typeof window,lb=ly||!!("u">typeof window&&window.next),lk=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,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(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?ly||lb?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender)?this.createEditor():null}createEditor(){return new sC({...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>!!["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function lv(e={},n=[]){let i=(0,t.useRef)(e);i.current=e;let[o]=(0,t.useState)(()=>new lk(i)),s=(0,r.useSyncExternalStore)(o.subscribe,o.getEditor,o.getServerSnapshot);return(0,t.useDebugValue)(s),(0,t.useEffect)(o.onRender(n)),!function(e){var n;let[r]=(0,t.useState)(()=>new lg(e.editor)),i=(0,lc.useSyncExternalStoreWithSelector)(r.subscribe,r.getSnapshot,r.getServerSnapshot,e.selector,null!=(n=e.equalityFn)?n:la);lm(()=>r.watch(e.editor),[e.editor,r]),(0,t.useDebugValue)(i)}({editor:s,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),s}var lw=(0,t.createContext)({editor:null});lw.Consumer;var lx=(0,t.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});t.default.forwardRef((e,n)=>{let{onDragStart:r}=(0,t.useContext)(lx),o=e.as||"div";return(0,i.jsx)(o,{...e,ref:n,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...e.style}})}),t.default.createContext({markViewContentRef:()=>{}});var lS=(0,t.createContext)({get editor(){throw Error("useTiptap must be used within a <Tiptap> provider")}});function lM({editor:e,instance:n,children:r}){let o=null!=e?e:n;if(!o)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let s=(0,t.useMemo)(()=>({editor:o}),[o]),l=(0,t.useMemo)(()=>({editor:o}),[o]);return(0,i.jsx)(lw.Provider,{value:l,children:(0,i.jsx)(lS.Provider,{value:s,children:r})})}function lC({...e}){let{editor:n}=(0,t.useContext)(lS);return(0,i.jsx)(lf,{editor:n,...e})}lS.displayName="TiptapContext",lM.displayName="Tiptap",lC.displayName="Tiptap.Content",Object.assign(lM,{Content:lC}),e.s(["EditorContent",()=>lf,"useEditor",()=>lv],494499);var lT=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},lO=/^\s*>\s$/,lE=sH.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return lT("blockquote",{...oy(this.options.HTMLAttributes,e),children:lT("slot",{})})},parseMarkdown:(e,t)=>t.createNode("blockquote",void 0,t.parseChildren(e.tokens||[])),renderMarkdown:(e,t)=>{if(!e.content)return"";let n=[];return e.content.forEach(e=>{let r=t.renderChildren([e]).split("\n").map(e=>""===e.trim()?">":`> ${e}`);n.push(r.join("\n"))}),n.join(`
80
+ >
81
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[sN({find:lO,type:this.type})]}}),lN=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,lA=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,lD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,lR=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,lI=ss.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return lT("strong",{...oy(this.options.HTMLAttributes,e),children:lT("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[sT({find:lN,type:this.type}),sT({find:lD,type:this.type})]},addPasteRules(){return[sW({find:lA,type:this.type}),sW({find:lR,type:this.type})]}}),lL=/(^|[^`])`([^`]+)`(?!`)$/,lP=/(^|[^`])`([^`]+)`(?!`)/g,lz=ss.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",oy(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[sT({find:lL,type:this.type})]},addPasteRules(){return[sW({find:lP,type:this.type})]}}),lB=/^```([a-z]+)?[\s\n]$/,l$=/^~~~([a-z]+)?[\s\n]$/,lj=sH.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;if(!n)return null;let r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",oy(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n;return(null==(n=e.raw)?void 0:n.startsWith("```"))===!1&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.language)||"";return e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${r}
82
+
83
+ \`\`\``},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;if(o.parent.type!==this.type)return!1;let l=" ".repeat(n);return s?e.commands.insertContent(l):e.commands.command(({tr:e})=>{let{from:t,to:n}=i,o=r.doc.textBetween(t,n,"\n","\n").split("\n").map(e=>l+e).join("\n");return e.replaceWith(t,n,r.schema.text(o)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=null!=(t=this.options.tabSize)?t:4,{state:r}=e,{selection:i}=r,{$from:o,empty:s}=i;return o.parent.type===this.type&&(s?e.commands.command(({tr:e})=>{var t;let{pos:i}=o,s=o.start(),l=o.end(),a=r.doc.textBetween(s,l,"\n","\n").split("\n"),d=0,c=0,h=i-s;for(let e=0;e<a.length;e+=1){if(c+a[e].length>=h){d=e;break}c+=a[e].length+1}let p=Math.min(((null==(t=a[d].match(/^ */))?void 0:t[0])||"").length,n);if(0===p)return!0;let u=s;for(let e=0;e<d;e+=1)u+=a[e].length+1;return e.delete(u,u+p),i-u<=p&&e.setSelection(eW.create(e.doc,u)),!0}):e.commands.command(({tr:e})=>{let{from:t,to:o}=i,s=r.doc.textBetween(t,o,"\n","\n").split("\n").map(e=>{var t;let r=Math.min(((null==(t=e.match(/^ */))?void 0:t[0])||"").length,n);return e.slice(r)}).join("\n");return e.replaceWith(t,o,r.schema.text(s)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!o&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let s=i.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(eV.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[sE({find:lB,type:this.type,getAttributes:e=>({language:e[1]})}),sE({find:l$,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new e5({key:new e9("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;let{tr:s,schema:l}=e.state,a=l.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(eW.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),lV=sH.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n\n"):""}),lF=sH.create({name:"hardBreak",markdownTokenName:"br",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",oy(this.options.HTMLAttributes,e)]},renderText:()=>"\n",renderMarkdown:()=>`
84
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,l=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&o){let t=l.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),lH=sH.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,oy(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.level)?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,...{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}}),{})},addInputRules(){return this.options.levels.map(e=>sE({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),lq=sH.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",oy(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!sA(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return o$(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(eW.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(eK.create(t.doc,n.pos)):t.setSelection(eW.create(t.doc,n.pos));else{let i=e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType,o=null==i?void 0:i.create();o&&(t.insert(r,o),t.setSelection(eW.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[sO({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lW=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,l_=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,lK=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,lU=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,lJ=ss.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",oy(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[sT({find:lW,type:this.type}),sT({find:lK,type:this.type})]},addPasteRules(){return[sW({find:l_,type:this.type}),sW({find:lU,type:this.type})]}});let lG="numeric",lY="ascii",lQ="alpha",lX="asciinumeric",lZ="alphanumeric",l0="domain",l1="emoji",l2="whitespace";function l3(e,t,n){for(let r in t[lG]&&(t[lX]=!0,t[lZ]=!0),t[lY]&&(t[lX]=!0,t[lQ]=!0),t[lX]&&(t[lZ]=!0),t[lQ]&&(t[lZ]=!0),t[lZ]&&(t[l0]=!0),t[l1]&&(t[l0]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function l5(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}l5.groups={},l5.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){let i;return r=r||l5.groups,t&&t.j?i=t:(i=new l5(t),n&&r&&l3(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,o=e.length;if(!o)return i;for(let t=0;t<o-1;t++)i=i.tt(e[t]);return i.tt(e[o-1],t,n,r)},tt(e,t,n,r){if(r=r||l5.groups,t&&t.j)return this.j[e]=t,t;let i,o=this.go(e);return o?(Object.assign((i=new l5).j,o.j),i.jr.push.apply(i.jr,o.jr),i.jd=o.jd,i.t=o.t):i=new l5,t&&(r&&(i.t&&"string"==typeof i.t?l3(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(i.t,r),n),r):n&&l3(t,n,r)),i.t=t),this.j[e]=i,i}};let l4=(e,t,n,r,i)=>e.ta(t,n,r,i),l6=(e,t,n,r,i)=>e.tr(t,n,r,i),l9=(e,t,n,r,i)=>e.ts(t,n,r,i),l8=(e,t,n,r,i)=>e.tt(t,n,r,i),l7="WORD",ae="UWORD",at="ASCIINUMERICAL",an="ALPHANUMERICAL",ar="LOCALHOST",ai="UTLD",ao="SCHEME",as="SLASH_SCHEME",al="OPENBRACE",aa="CLOSEBRACE",ad="OPENBRACKET",ac="CLOSEBRACKET",ah="OPENPAREN",ap="CLOSEPAREN",au="OPENANGLEBRACKET",af="CLOSEANGLEBRACKET",am="FULLWIDTHLEFTPAREN",ag="FULLWIDTHRIGHTPAREN",ay="LEFTCORNERBRACKET",ab="RIGHTCORNERBRACKET",ak="LEFTWHITECORNERBRACKET",av="RIGHTWHITECORNERBRACKET",aw="FULLWIDTHLESSTHAN",ax="FULLWIDTHGREATERTHAN",aS="AMPERSAND",aM="APOSTROPHE",aC="ASTERISK",aT="BACKSLASH",aO="BACKTICK",aE="CARET",aN="COLON",aA="COMMA",aD="DOLLAR",aR="EQUALS",aI="EXCLAMATION",aL="HYPHEN",aP="PERCENT",az="PIPE",aB="PLUS",a$="POUND",aj="QUERY",aV="QUOTE",aF="FULLWIDTHMIDDLEDOT",aH="SEMI",aq="SLASH",aW="TILDE",a_="UNDERSCORE",aK="EMOJI";var aU=Object.freeze({__proto__:null,ALPHANUMERICAL:an,AMPERSAND:aS,APOSTROPHE:aM,ASCIINUMERICAL:at,ASTERISK:aC,AT:"AT",BACKSLASH:aT,BACKTICK:aO,CARET:aE,CLOSEANGLEBRACKET:af,CLOSEBRACE:aa,CLOSEBRACKET:ac,CLOSEPAREN:ap,COLON:aN,COMMA:aA,DOLLAR:aD,DOT:"DOT",EMOJI:aK,EQUALS:aR,EXCLAMATION:aI,FULLWIDTHGREATERTHAN:ax,FULLWIDTHLEFTPAREN:am,FULLWIDTHLESSTHAN:aw,FULLWIDTHMIDDLEDOT:aF,FULLWIDTHRIGHTPAREN:ag,HYPHEN:aL,LEFTCORNERBRACKET:ay,LEFTWHITECORNERBRACKET:ak,LOCALHOST:ar,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:au,OPENBRACE:al,OPENBRACKET:ad,OPENPAREN:ah,PERCENT:aP,PIPE:az,PLUS:aB,POUND:a$,QUERY:aj,QUOTE:aV,RIGHTCORNERBRACKET:ab,RIGHTWHITECORNERBRACKET:av,SCHEME:ao,SEMI:aH,SLASH:aq,SLASH_SCHEME:as,SYM:"SYM",TILDE:aW,TLD:"TLD",UNDERSCORE:a_,UTLD:ai,UWORD:ae,WORD:l7,WS:"WS"});let aJ=/[a-z]/,aG=/\p{L}/u,aY=/\p{Emoji}/u,aQ=/\d/,aX=/\s/,aZ=null,a0=null;function a1(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let i,o=e.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],o=0,s=0;for(;s<r;){let l=e,a=null,d=0,c=null,h=-1,p=-1;for(;s<r&&(a=l.go(n[s]));)(l=a).accepts()?(h=0,p=0,c=l):h>=0&&(h+=n[s].length,p++),d+=n[s].length,o+=n[s].length,s++;o-=h,s-=p,d-=h,i.push({t:c.t,v:t.slice(o-d,o),s:o-d,e:o})}return i}function a2(e,t,n,r,i){let o,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?o=e.j[s]:((o=new l5(r)).jr=i.slice(),e.j[s]=o),e=o}return(o=new l5(n)).jr=i.slice(),e.j[t[s-1]]=o,o}function a3(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;"0123456789".indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}let a5={defaultProtocol:"http",events:null,format:a6,formatHref:a6,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function a4(e,t=null){let n=Object.assign({},a5);e&&(n=Object.assign(n,e instanceof a4?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}function a6(e){return e}function a9(e,t){this.t="token",this.v=e,this.tk=t}function a8(e,t){class n extends a9{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}a4.prototype={o:a5,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,i=this.o[e];return i&&("object"==typeof i?"function"==typeof(i=n.t in i?i[n.t]:a5[e])&&r&&(i=i(t,n)):"function"==typeof i&&r&&(i=i(t,n.t,n))),i},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}},a9.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=a5.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),i=this.toFormattedString(e),o={},s=e.get("className",t,this),l=e.get("target",t,this),a=e.get("rel",t,this),d=e.getObj("attributes",t,this),c=e.getObj("events",t,this);return o.href=n,s&&(o.class=s),l&&(o.target=l),a&&(o.rel=a),d&&Object.assign(o,d),{tagName:r,attributes:o,content:i,eventListeners:c}}};let a7=a8("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),de=a8("text"),dt=a8("nl"),dn=a8("url",{isLink:!0,toHref(e=a5.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==ar&&e[1].t===aN}}),dr=e=>new l5(e);function di(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}let ds="u">typeof console&&console&&console.warn||(()=>{}),dl={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function da(e,t=!1){if(dl.initialized&&ds(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
85
+ 1. Must only contain digits, lowercase ASCII letters or "-"
86
+ 2. Cannot start or end with "-"
87
+ 3. "-" cannot repeat`);dl.customSchemes.push([e,t])}function dd(e){return dl.initialized||function(){dl.scanner=function(e=[]){let t={};l5.groups=t;let n=new l5;null==aZ&&(aZ=a3("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==a0&&(a0=a3("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),l8(n,"'",aM),l8(n,"{",al),l8(n,"}",aa),l8(n,"[",ad),l8(n,"]",ac),l8(n,"(",ah),l8(n,")",ap),l8(n,"<",au),l8(n,">",af),l8(n,"(",am),l8(n,")",ag),l8(n,"「",ay),l8(n,"」",ab),l8(n,"『",ak),l8(n,"』",av),l8(n,"<",aw),l8(n,">",ax),l8(n,"&",aS),l8(n,"*",aC),l8(n,"@","AT"),l8(n,"`",aO),l8(n,"^",aE),l8(n,":",aN),l8(n,",",aA),l8(n,"$",aD),l8(n,".","DOT"),l8(n,"=",aR),l8(n,"!",aI),l8(n,"-",aL),l8(n,"%",aP),l8(n,"|",az),l8(n,"+",aB),l8(n,"#",a$),l8(n,"?",aj),l8(n,'"',aV),l8(n,"/",aq),l8(n,";",aH),l8(n,"~",aW),l8(n,"_",a_),l8(n,"\\",aT),l8(n,"・",aF);let r=l6(n,aQ,"NUM",{[lG]:!0});l6(r,aQ,r);let i=l6(r,aJ,at,{[lX]:!0}),o=l6(r,aG,an,{[lZ]:!0}),s=l6(n,aJ,l7,{[lY]:!0});l6(s,aQ,i),l6(s,aJ,s),l6(i,aQ,i),l6(i,aJ,i);let l=l6(n,aG,ae,{[lQ]:!0});l6(l,aJ),l6(l,aQ,o),l6(l,aG,l),l6(o,aQ,o),l6(o,aJ),l6(o,aG,o);let a=l8(n,"\n","NL",{[l2]:!0}),d=l8(n,"\r","WS",{[l2]:!0}),c=l6(n,aX,"WS",{[l2]:!0});l8(n,"",c),l8(d,"\n",a),l8(d,"",c),l6(d,aX,c),l8(c,"\r"),l8(c,"\n"),l6(c,aX,c),l8(c,"",c);let h=l6(n,aY,aK,{[l1]:!0});l8(h,"#"),l6(h,aY,h),l8(h,"️",h);let p=l8(h,"‍");l8(p,"#"),l6(p,aY,h);let u=[[aJ,s],[aQ,i]],f=[[aJ,null],[aG,l],[aQ,o]];for(let e=0;e<aZ.length;e++)a2(n,aZ[e],"TLD",l7,u);for(let e=0;e<a0.length;e++)a2(n,a0[e],ai,ae,f);l3("TLD",{tld:!0,ascii:!0},t),l3(ai,{utld:!0,alpha:!0},t),a2(n,"file",ao,l7,u),a2(n,"mailto",ao,l7,u),a2(n,"http",as,l7,u),a2(n,"https",as,l7,u),a2(n,"ftp",as,l7,u),a2(n,"ftps",as,l7,u),l3(ao,{scheme:!0,ascii:!0},t),l3(as,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?i[l0]=!0:aJ.test(r)?aQ.test(r)?i[lX]=!0:i[lY]=!0:i[lG]=!0,l9(n,r,r,i)}return l9(n,"localhost",ar,{ascii:!0}),n.jd=new l5("SYM"),{start:n,tokens:Object.assign({groups:t},aU)}}(dl.customSchemes);for(let e=0;e<dl.tokenQueue.length;e++)dl.tokenQueue[e][1]({scanner:dl.scanner});dl.parser=function({groups:e}){let t=e.domain.concat([aS,aC,"AT",aT,aO,aE,aD,aR,aL,"NUM",aP,az,aB,a$,aq,"SYM",aW,a_]),n=[aM,aN,aA,"DOT",aI,aP,aj,aV,aH,au,af,al,aa,ac,ad,ah,ap,am,ag,ay,ab,ak,av,aw,ax],r=[aS,aM,aC,aT,aO,aE,aD,aR,aL,al,aa,aP,az,aB,a$,aj,aq,"SYM",aW,a_],i=dr(),o=l8(i,aW);l4(o,r,o),l4(o,e.domain,o);let s=dr(),l=dr(),a=dr();l4(i,e.domain,s),l4(i,e.scheme,l),l4(i,e.slashscheme,a),l4(s,r,o),l4(s,e.domain,s);let d=l8(s,"AT");l8(o,"AT",d),l8(l,"AT",d),l8(a,"AT",d);let c=l8(o,"DOT");l4(c,r,o),l4(c,e.domain,o);let h=dr();l4(d,e.domain,h),l4(h,e.domain,h);let p=l8(h,"DOT");l4(p,e.domain,h);let u=dr(a7);l4(p,e.tld,u),l4(p,e.utld,u),l8(d,ar,u);let f=l8(h,aL);l8(f,aL,f),l4(f,e.domain,h),l4(u,e.domain,h),l8(u,"DOT",p),l8(u,aL,f),l4(l8(u,aN),e.numeric,a7);let m=l8(s,aL),g=l8(s,"DOT");l8(m,aL,m),l4(m,e.domain,s),l4(g,r,o),l4(g,e.domain,s);let y=dr(dn);l4(g,e.tld,y),l4(g,e.utld,y),l4(y,e.domain,s),l4(y,r,o),l8(y,"DOT",g),l8(y,aL,m),l8(y,"AT",d);let b=l8(y,aN),k=dr(dn);l4(b,e.numeric,k);let v=dr(dn),w=dr();l4(v,t,v),l4(v,n,w),l4(w,t,v),l4(w,n,w),l8(y,aq,v),l8(k,aq,v);let x=l8(l,aN),S=l8(a,aN),M=l8(S,aq),C=l8(M,aq);l4(l,e.domain,s),l8(l,"DOT",g),l8(l,aL,m),l4(a,e.domain,s),l8(a,"DOT",g),l8(a,aL,m),l4(x,e.domain,v),l8(x,aq,v),l8(x,aj,v),l4(C,e.domain,v),l4(C,t,v),l8(C,aq,v);let T=[[al,aa],[ad,ac],[ah,ap],[au,af],[am,ag],[ay,ab],[ak,av],[aw,ax]];for(let e=0;e<T.length;e++){let[r,i]=T[e],o=l8(v,r);l8(w,r,o),l8(o,i,v);let s=dr(dn);l4(o,t,s);let l=dr();l4(o,n),l4(s,t,s),l4(s,n,l),l4(l,t,s),l4(l,n,l),l8(s,i,v),l8(l,i,v)}return l8(i,ar,y),l8(i,"NL",dt),{start:i,tokens:aU}}(dl.scanner.tokens);for(let e=0;e<dl.pluginQueue.length;e++)dl.pluginQueue[e][1]({scanner:dl.scanner,parser:dl.parser});dl.initialized=!0}(),function(e,t,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let l=e,a=null,d=null,c=0,h=null,p=-1;for(;i<r&&!(a=l.go(n[i].t));)s.push(n[i++]);for(;i<r&&(d=a||l.go(n[i].t));)a=null,(l=d).accepts()?(p=0,h=l):p>=0&&p++,i++,c++;if(p<0)(i-=c)<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(di(de,t,s)),s=[]),i-=p,c-=p;let e=h.t,r=n.slice(i-c,i);o.push(di(e,t,r))}}return s.length>0&&o.push(di(de,t,s)),o}(dl.parser.start,e,a1(dl.scanner.start,e))}function dc(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new a4(n),i=dd(e),o=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&o.push(n.toFormattedObject(r))}return o}dd.scan=a1;var dh="[\0-   ᠎ -\u2029  ]",dp=new RegExp(dh),du=RegExp(`${dh}$`),df=RegExp(dh,"g");function dm(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(df,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var dg=ss.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"==typeof e?da(e):da(e.scheme,e.optionalSlashes)})},onDestroy(){l5.groups={},dl.scanner=null,dl.parser=null,dl.tokenQueue=[],dl.pluginQueue=[],dl.customSchemes=[],dl.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!dm(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;let r=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!/^\d{1,3}(\.\d{1,3}){3}$/.test(r)&&!!/\./.test(r)}}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!dm(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!dm(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",oy(this.options.HTMLAttributes,e),0]:["a",oy(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,o;let s=null!=(r=null==(n=e.attrs)?void 0:n.href)?r:"",l=null!=(o=null==(i=e.attrs)?void 0:i.title)?o:"",a=t.renderChildren(e);return l?`[${a}](${s} "${l}")`:`[${a}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!dm(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!dm(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[sW({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=dc(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!dm(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let r=[],{protocols:i,defaultProtocol:o}=this.options;return this.options.autolink&&r.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!dm(e,i),protocols:i,defaultProtocol:o}),shouldAutoLink:this.options.shouldAutoLink},new e5({key:new e9("autolink"),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),o=t.some(e=>e.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r;if(oO(ol(n.doc,[...t])).forEach(({newRange:t})=>{let n,i,o=oa(r.doc,t,e=>e.isTextblock);if(o.length>1)n=o[0],i=r.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(o.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!du.test(e))return;n=o[0],i=r.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&i){let t=i.split(dp).filter(Boolean);if(t.length<=0)return!1;let o=t[t.length-1],l=n.pos+i.lastIndexOf(o);if(!o)return!1;let a=dd(o).map(t=>t.toObject(e.defaultProtocol));if(!(1===a.length?a[0].isLink:3===a.length&&!!a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;a.filter(e=>e.isLink).map(e=>({...e,from:l+e.start+1,to:l+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{oE(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),s.steps.length)return s}}))),r.push((t={type:this.type,editor:this.editor,openOnClick:"whenNotEditable"===this.options.openOnClick||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection},new e5({key:new e9("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(0!==r.button||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let e=r.target;if(!e)return!1;let n=t.editor.view.dom;(s=e.closest("a"))&&!n.contains(s)&&(s=null)}if(!s)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){let n=oT(e.state,t.type.name),r=null!=(i=s.href)?i:n.href,a=null!=(o=s.target)?o:n.target;r&&(window.open(r,a),l=!0)}return l}}}))),this.options.linkOnPaste&&r.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink},new e5({key:new e9("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{shouldAutoLink:i}=n,{state:o}=e,{selection:s}=o,{empty:l}=s;if(l)return!1;let a="";r.content.forEach(e=>{a+=e.textContent});let d=dc(a,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!!a&&!!d&&(void 0===i||!!i(d.value))&&n.editor.commands.setMark(n.type,{href:d.href})}}}))),r}});e.s(["Link",()=>dg,"default",()=>dg],963612);var dy=Object.defineProperty,db="textStyle",dk=/^\s*([-+*])\s$/,dv=sH.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",oy(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>"list"!==e.type||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(db)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=sN({find:dk,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=sN({find:dk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(db),editor:this.editor})),[e]}}),dw=sH.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",oy(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{if("list_item"!==e.type)return[];let n=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>"paragraph"===e.type))n=t.parseChildren(e.tokens);else{let r=e.tokens[0];if(r&&"text"===r.type&&r.tokens&&r.tokens.length>0){if(n=[{type:"paragraph",content:t.parseInline(r.tokens)}],e.tokens.length>1){let r=e.tokens.slice(1),i=t.parseChildren(r);n.push(...i)}}else n=t.parseChildren(e.tokens)}return 0===n.length&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(e,t,n)=>sj(e,t,e=>{var t,n;if("bulletList"===e.parentType)return"- ";if("orderedList"===e.parentType){let r=(null==(n=null==(t=e.meta)?void 0:t.parentAttrs)?void 0:n.start)||1;return`${r+e.index}. `}return"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),dx={},dS={findListItemPos:()=>dC,getNextListDepth:()=>dT,handleBackspace:()=>dA,handleDelete:()=>dI,hasListBefore:()=>dO,hasListItemAfter:()=>dL,hasListItemBefore:()=>dE,listItemHasSubList:()=>dN,nextListIsDeeper:()=>dD,nextListIsHigher:()=>dR};for(var dM in dS)dy(dx,dM,{get:dS[dM],enumerable:!0});var dC=(e,t)=>{let{$from:n}=t.selection,r=ig(e,t.schema),i=n.depth,o=n.pos,s=null;for(;i>0&&null===s;)n.node(i).type===r?s=i:(i-=1,o-=1);return null===s?null:{$pos:t.doc.resolve(o),depth:s}},dT=(e,t)=>{let n=dC(e,t);if(!n)return!1;let[,r]=oN(t,e,n.$pos.pos+4);return r},dO=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),o=e.doc.resolve(i).node();return!!o&&!!n.includes(o.type.name)},dE=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return 0!==i.index()&&(null==(n=i.nodeBefore)?void 0:n.type.name)===e},dN=(e,t,n)=>{if(!n)return!1;let r=ig(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},dA=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!iX(e.state,t)&&dO(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let o=i.at(-1);if(!o)return!1;let s=e.state.doc.resolve(r.start()+o.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!iX(e.state,t)||!oL(e.state))return!1;let r=dC(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=dN(t,e.state,i);return dE(t,e.state)&&!o?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},dD=(e,t)=>{let n=dT(e,t),r=dC(e,t);return!!r&&!!n&&n>r.depth},dR=(e,t)=>{let n=dT(e,t),r=dC(e,t);return!!r&&!!n&&n<r.depth},dI=(e,t)=>{if(!iX(e.state,t)||!oI(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!(!n.empty&&r.sameParent(i))&&(dD(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():dR(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},dL=(e,t)=>{var n;let{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return i.index()!==i.parent.childCount-1&&(null==(n=i.nodeAfter)?void 0:n.type.name)===e},dP=sh.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&dI(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&dI(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&dA(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&dA(e,n,r)&&(t=!0)}),t}}}}),dz=/^(\s*)(\d+)\.\s+(.*)$/,dB=/^\s/,d$="textStyle",dj=/^(\d+)\.\s$/,dV=sH.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",oy(this.options.HTMLAttributes,n),0]:["ol",oy(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{var n;if("list"!==e.type||!e.ordered)return[];let r=e.start||1,i=e.items?(n=e.items,n.map(e=>{if("list_item"!==e.type)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if("paragraph"===e.type||"list"===e.type||"blockquote"===e.type||"code"===e.type)n.push(...t.parseChildren([e]));else if("text"===e.type&&e.tokens){let r=t.parseChildren([e]);n.push({type:"paragraph",content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:"listItem",content:n}})):[];return 1!==r?{type:"orderedList",attrs:{start:r},content:i}:{type:"orderedList",content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/),n=null==t?void 0:t.index;return void 0!==n?n:-1},tokenize:(e,t,n)=>{var r;let i=e.split("\n"),[o,s]=function(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],o=i.match(dz);if(!o)break;let[,s,l,a]=o,d=s.length,c=a,h=n+1,p=[i];for(;h<e.length;){let t=e[h];if(t.match(dz))break;if(""===t.trim())p.push(t),c+="\n",h+=1;else if(t.match(dB))p.push(t),c+=`
88
+ ${t.slice(d+2)}`,h+=1;else break}t.push({indent:d,number:parseInt(l,10),content:c.trim(),raw:p.join("\n")}),r=h,n=h}return[t,r]}(i);if(0===o.length)return;let l=function e(t,n,r){var i;let o=[],s=0;for(;s<t.length;){let l=t[s];if(l.indent===n){let a=l.content.split("\n"),d=(null==(i=a[0])?void 0:i.trim())||"",c=[];d&&c.push({type:"paragraph",raw:d,tokens:r.inlineTokens(d)});let h=a.slice(1).join("\n").trim();if(h){let e=r.blockTokens(h);c.push(...e)}let p=s+1,u=[];for(;p<t.length&&t[p].indent>n;)u.push(t[p]),p+=1;if(u.length>0){let t=Math.min(...u.map(e=>e.indent)),n=e(u,t,r);c.push({type:"list",ordered:!0,start:u[0].number,items:n,raw:u.map(e=>e.raw).join("\n")})}o.push({type:"list_item",raw:l.raw,tokens:c}),s=p}else s+=1}return o}(o,0,n);if(0!==l.length)return{type:"list",ordered:!0,start:(null==(r=o[0])?void 0:r.number)||1,items:l,raw:i.slice(0,s).join("\n")}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(d$)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=sN({find:dj,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=sN({find:dj,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(d$)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),dF=/^\s*(\[([( |x])?\])\s$/,dH=sH.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",oy(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;let r=(null==(n=e.attrs)?void 0:n.checked)?"x":" ";return sj(e,t,`- [${r}] `)},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),d=e=>{var t,n;l.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};d(e),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",e=>e.preventDefault()),l.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:i}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:i}),!0}).run(),r.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,i)||(l.checked=!l.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,o.append(l,s),i.append(o,a),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let c=new Set(Object.keys(t));return{dom:i,contentDOM:a,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,d(e);let t=ob(e,r.extensionManager.attributes),n=new Set(Object.keys(t)),o=this.options.HTMLAttributes;return c.forEach(e=>{n.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(t).forEach(([e,t])=>{null==t?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),c=n,!0}}}},addInputRules(){return[sN({find:dF,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),dq=sH.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",oy(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,"\n"):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;let n=null==(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))?void 0:t.index;return void 0!==n?n:-1},tokenize(e,t,n){let r=e=>{let t=s$(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:"taskList",raw:t.raw,items:t.items}]:n.blockTokens(e)},i=s$(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:"x"===e[3].toLowerCase()}),createToken:(e,t)=>({type:"taskItem",raw:"",mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});sh.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(dv.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(dw.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(dP.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(dV.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(dH.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(dq.configure(this.options.taskList)),e}});var dW="&nbsp;",d_=sH.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",oy(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(1===n.length&&"image"===n[0].type)return t.parseChildren([n[0]]);let r=t.parseInline(n);return 1===r.length&&"text"===r[0].type&&(r[0].text===dW||" "===r[0].text)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t)=>{if(!e)return"";let n=Array.isArray(e.content)?e.content:[];return 0===n.length?dW:t.renderChildren(n)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),dK=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,dU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,dJ=ss.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",oy(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[sT({find:dK,type:this.type})]},addPasteRules(){return[sW({find:dU,type:this.type})]}}),dG=sH.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),dY=ss.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",oy(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>`++${t.renderChildren(e)}++`,markdownTokenizer:{name:"underline",level:"inline",start:e=>e.indexOf("++"),tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});class dQ{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,i,o=this.editorView.dom,s=o.getBoundingClientRect(),l=s.width/o.offsetWidth,a=s.height/o.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),o=e?r.bottom:r.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*a;i={left:r.left,right:r.right,top:o-s,bottom:o+s}}}}if(!i){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*l;i={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let d=this.editorView.dom.offsetParent;if(!this.element&&(this.element=d.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),d&&(d!=document.body||"static"!=getComputedStyle(d).position)){let n=d.getBoundingClientRect(),r=n.width/d.offsetWidth,i=n.height/d.offsetHeight;e=n.left-d.scrollLeft*r,t=n.top-d.scrollTop*i}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(i.left-e)/l+"px",this.element.style.top=(i.top-t)/a+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=eT(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class dX extends eV{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return dX.valid(n)?new dX(n):eV.near(n)}content(){return p.empty}eq(e){return e instanceof dX&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new dX(e.resolve(t.pos))}getBookmark(){return new dZ(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||d0(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||d0(e.type))return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){r:for(;;){if(!n&&dX.valid(e))return e;let r=e.pos,i=null;for(let n=e.depth;;n--){let o=e.node(n);if(t>0?e.indexAfter(n)<o.childCount:e.index(n)>0){i=o.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(dX.valid(s))return s}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!eK.isSelectable(i)){e=e.doc.resolve(r+i.nodeSize*t),n=!1;continue r}break}i=o,r+=t;let s=e.doc.resolve(r);if(dX.valid(s))return s}return null}}}dX.prototype.visible=!1,dX.findFrom=dX.findGapCursorFrom,eV.jsonID("gapcursor",dX);class dZ{constructor(e){this.pos=e}map(e){return new dZ(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return dX.valid(t)?new dX(t):eV.near(t)}}function d0(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}let d1=it({ArrowLeft:d2("horiz",-1),ArrowRight:d2("horiz",1),ArrowUp:d2("vert",-1),ArrowDown:d2("vert",1)});function d2(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,i){let o=e.selection,s=t>0?o.$to:o.$from,l=o.empty;if(o instanceof eW){if(!i.endOfTextblock(n)||0==s.depth)return!1;l=!1,s=e.doc.resolve(t>0?s.after():s.before())}let a=dX.findGapCursorFrom(s,t,l);return!!a&&(r&&r(e.tr.setSelection(new dX(a))),!0)}}function d3(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!dX.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&eK.isSelectable(e.state.doc.nodeAt(i.inside)))&&(e.dispatch(e.state.tr.setSelection(new dX(r))),!0)}function d5(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof dX))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=s.empty;for(let e=r.length-1;e>=0;e--)i=s.from(r[e].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new p(i,0,0));return o.setSelection(eW.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function d4(e){if(!(e.selection instanceof dX))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",rO.create(e.doc,[rM.widget(e.selection.head,t,{key:"gapcursor"})])}var d6=function(){};d6.prototype.append=function(e){return e.length?(e=d6.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},d6.prototype.prepend=function(e){return e.length?d6.from(e).append(this):this},d6.prototype.appendInner=function(e){return new d8(this,e)},d6.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?d6.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},d6.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},d6.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},d6.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},d6.from=function(e){return e instanceof d6?e:e&&e.length?new d9(e):d6.empty};var d9=function(e){function t(t){e.call(this),this.values=t}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(d6);d6.empty=new d9([]);var d8=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(d6);class d7{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let l=e.tr,a=[],d=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,d.push(e);return}if(n){d.push(new ce(e.map));let t=e.step.map(n.slice(r)),i;t&&l.maybeStep(t).doc&&(i=l.mapping.maps[l.mapping.maps.length-1],a.push(new ce(i,void 0,void 0,a.length+d.length))),r--,i&&n.appendMap(i,r)}else l.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,o=new d7(this.items.slice(0,s).append(d.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:o,transform:l,selection:i}}addTransform(e,t,n,r){var i,o;let s,l=[],a=this.eventCount,d=this.items,c=!r&&d.length?d.get(d.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),o=new ce(e.mapping.maps[n],i,t),s;(s=c&&c.merge(o))&&(o=s,n?l.pop():d=d.slice(0,d.length-1)),l.push(o),t&&(a++,t=void 0),r||(c=o)}let h=a-n.depth;return h>cn&&(i=d,o=h,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1}),d=i.slice(s),a-=h),new d7(d.append(l),a)}remapping(e,t){let n=new ei;return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(e){return 0==this.eventCount?this:new d7(this.items.append(e.map(e=>new ce(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let l=t;this.items.forEach(t=>{let r=i.getMirror(--l);if(null==r)return;o=Math.min(o,r);let a=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),d=t.selection&&t.selection.map(i.slice(l+1,r));d&&s++,n.push(new ce(a,o,d))}else n.push(new ce(a))},r);let a=[];for(let e=t;e<o;e++)a.push(new ce(i.maps[e]));let d=new d7(this.items.slice(0,r).append(a).append(n),s);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-n.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=o.selection&&o.selection.map(t.slice(n));l&&i++;let a=new ce(s.invert(),e,l),d,c=r.length-1;(d=r.length&&r[c].merge(a))?r[c]=d:r.push(a)}}else o.map&&n--},this.items.length,0),new d7(d6.from(r.reverse()),i)}}d7.empty=new d7(d6.empty,0);class ce{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ce(t.getMap().invert(),t,this.selection)}}}class ct{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}let cn=20;function cr(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function ci(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let co=!1,cs=null;function cl(e){let t=e.plugins;if(cs!=t){co=!1,cs=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){co=!0;break}}return co}let ca=new e9("history"),cd=new e9("closeHistory");function cc(e,t){return(n,r)=>{let i=ca.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=cl(t),i=ca.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),a=new ct(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(s).setMeta(ca,{redo:n,historyState:a})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}let ch=cc(!1,!0),cp=cc(!0,!0);cc(!1,!1),cc(!0,!1),sh.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new e5({key:new e9("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(null==i||0===i){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,o-i);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta("paste"))return!1;let o=e.selection.$head.pos;return e.deleteRange(o-(i-n),o),!(this.storage.characters({node:e.doc})>n)}})]}});var cu=sh.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new e5({view:t=>new dQ(t,e)})}(this.options)]}});sh.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new e5({key:new e9("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return rO.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;s+=1}});let l=0;return e.descendants((e,t)=>!e.isText&&!!(i>=t&&i<=t+e.nodeSize-1)&&((l+=1,"deepest"===this.options.mode&&s-l>0||"shallowest"===this.options.mode&&l>1)?"deepest"===this.options.mode:void o.push(rM.node(t,t+e.nodeSize,{class:this.options.className})))),rO.create(e,o)}}})]}});var cf=sh.create({name:"gapCursor",addProseMirrorPlugins:()=>[new e5({props:{decorations:d4,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&dX.valid(n)?new dX(n):null,handleClick:d3,handleKeyDown:d1,handleDOMEvents:{beforeinput:d5}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=of(oc(e,"allowGapCursor",n)))?t:null}}}),cm="placeholder",cg=sh.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:cm,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${this.options.dataAttribute.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}`:`data-${cm}`;return[new e5({key:new e9("placeholder"),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,o=[];if(!r)return null;let s=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,l=!t.isLeaf&&oB(t);if((r||!this.options.showOnlyCurrent)&&l){let i=[this.options.emptyNodeClass];s&&i.push(this.options.emptyEditorClass);let l=rM.node(n,n+t.nodeSize,{class:i.join(" "),[e]:"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});o.push(l)}return this.options.includeChildren}),rO.create(t,o)}}})]}});function cy({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}sh.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new e5({key:new e9("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||o$(n.selection)||e.view.dragging?null:rO.create(n.doc,[rM.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var cb=sh.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var e;let t=new e9(this.name),n=this.options.node||(null==(e=this.editor.schema.topNodeType.contentMatch.defaultType)?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(n).includes(e.name));return[new e5({key:t,appendTransaction:(e,r,i)=>{let{doc:o,tr:s,schema:l}=i,a=t.getState(i),d=o.content.size,c=l.nodes[n];if(a)return s.insert(d,c.create())},state:{init:(e,t)=>!cy({node:t.tr.doc.lastChild,types:r}),apply:(e,t)=>!e.docChanged||e.getMeta("__uniqueIDTransaction")?t:!cy({node:e.doc.lastChild,types:r})}})]}}),ck=sh.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>ch(e,t),redo:()=>({state:e,dispatch:t})=>cp(e,t)}),addProseMirrorPlugins(){return[function(e={}){return new e5({key:ca,state:{init:()=>new ct(d7.empty,d7.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let i=n.getMeta(ca),o;if(i)return i.historyState;n.getMeta(cd)&&(e=new ct(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(ca))if(s.getMeta(ca).redo)return new ct(e.done.addTransform(n,void 0,r,cl(t)),e.undone,cr(n.mapping.maps),e.prevTime,e.prevComposition);else return new ct(e.done,e.undone.addTransform(n,void 0,r,cl(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new ct(e.done.rebased(n,o),e.undone.rebased(n,o),ci(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new ct(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),ci(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}(n,e.prevRanges)),l=s?ci(e.prevRanges,n.mapping):cr(n.mapping.maps);return new ct(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,cl(t)),d7.empty,l,n.time,null==i?e.prevComposition:i)}})(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?ch:"historyRedo"==n?cp:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),cv=sh.create({name:"starterKit",addExtensions(){var e,t,n,r;let i=[];return!1!==this.options.bold&&i.push(lI.configure(this.options.bold)),!1!==this.options.blockquote&&i.push(lE.configure(this.options.blockquote)),!1!==this.options.bulletList&&i.push(dv.configure(this.options.bulletList)),!1!==this.options.code&&i.push(lz.configure(this.options.code)),!1!==this.options.codeBlock&&i.push(lj.configure(this.options.codeBlock)),!1!==this.options.document&&i.push(lV.configure(this.options.document)),!1!==this.options.dropcursor&&i.push(cu.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&i.push(cf.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&i.push(lF.configure(this.options.hardBreak)),!1!==this.options.heading&&i.push(lH.configure(this.options.heading)),!1!==this.options.undoRedo&&i.push(ck.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&i.push(lq.configure(this.options.horizontalRule)),!1!==this.options.italic&&i.push(lJ.configure(this.options.italic)),!1!==this.options.listItem&&i.push(dw.configure(this.options.listItem)),!1!==this.options.listKeymap&&i.push(dP.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&i.push(dg.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&i.push(dV.configure(this.options.orderedList)),!1!==this.options.paragraph&&i.push(d_.configure(this.options.paragraph)),!1!==this.options.strike&&i.push(dJ.configure(this.options.strike)),!1!==this.options.text&&i.push(dG.configure(this.options.text)),!1!==this.options.underline&&i.push(dY.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&i.push(cb.configure(null==(r=this.options)?void 0:r.trailingNode)),i}});e.s(["default",()=>cv],256378),e.s(["default",()=>cg],555841)}]);