@aquera/nile-elements 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/README.md +11 -0
  2. package/demo/nxtgen-dark.css +2 -2
  3. package/dist/{index-ccff99d6.esm.js → index-0fe57384.esm.js} +1 -1
  4. package/dist/index-f6944844.cjs.js +2 -0
  5. package/dist/{index-e43755f5.cjs.js.map → index-f6944844.cjs.js.map} +1 -1
  6. package/dist/index.cjs.js +1 -1
  7. package/dist/index.esm.js +1 -1
  8. package/dist/index.js +1127 -741
  9. package/dist/nile-code-editor/extensionSetup.cjs.js +1 -1
  10. package/dist/nile-code-editor/extensionSetup.esm.js +1 -1
  11. package/dist/nile-code-editor/index.cjs.js +1 -1
  12. package/dist/nile-code-editor/index.esm.js +1 -1
  13. package/dist/nile-code-editor/nile-code-editor.cjs.js +2 -2
  14. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  15. package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
  16. package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
  17. package/dist/nile-code-editor/nile-code-editor.css.esm.js +2 -2
  18. package/dist/nile-code-editor/nile-code-editor.esm.js +4 -4
  19. package/dist/nile-code-editor/theme.cjs.js +1 -1
  20. package/dist/nile-code-editor/theme.cjs.js.map +1 -1
  21. package/dist/nile-code-editor/theme.esm.js +1 -1
  22. package/dist/nile-combobox/nile-combobox.css.cjs.js +1 -1
  23. package/dist/nile-combobox/nile-combobox.css.cjs.js.map +1 -1
  24. package/dist/nile-combobox/nile-combobox.css.esm.js +1 -1
  25. package/dist/nile-detail/nile-detail.css.cjs.js +1 -1
  26. package/dist/nile-detail/nile-detail.css.cjs.js.map +1 -1
  27. package/dist/nile-detail/nile-detail.css.esm.js +1 -1
  28. package/dist/nile-side-bar-footer/nile-side-bar-footer.css.cjs.js +1 -1
  29. package/dist/nile-side-bar-footer/nile-side-bar-footer.css.cjs.js.map +1 -1
  30. package/dist/nile-side-bar-footer/nile-side-bar-footer.css.esm.js +3 -3
  31. package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js +1 -1
  32. package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.cjs.js.map +1 -1
  33. package/dist/nile-side-bar-footer-item/nile-side-bar-footer-item.css.esm.js +13 -7
  34. package/dist/nile-timestamp-builder/index.cjs.js +2 -0
  35. package/dist/nile-timestamp-builder/index.cjs.js.map +1 -0
  36. package/dist/nile-timestamp-builder/index.esm.js +1 -0
  37. package/dist/nile-timestamp-builder/nile-timestamp-builder-utils.cjs.js +2 -0
  38. package/dist/nile-timestamp-builder/nile-timestamp-builder-utils.cjs.js.map +1 -0
  39. package/dist/nile-timestamp-builder/nile-timestamp-builder-utils.esm.js +1 -0
  40. package/dist/nile-timestamp-builder/nile-timestamp-builder.cjs.js +2 -0
  41. package/dist/nile-timestamp-builder/nile-timestamp-builder.cjs.js.map +1 -0
  42. package/dist/nile-timestamp-builder/nile-timestamp-builder.css.cjs.js +2 -0
  43. package/dist/nile-timestamp-builder/nile-timestamp-builder.css.cjs.js.map +1 -0
  44. package/dist/nile-timestamp-builder/nile-timestamp-builder.css.esm.js +195 -0
  45. package/dist/nile-timestamp-builder/nile-timestamp-builder.esm.js +154 -0
  46. package/dist/nile-timestamp-builder/timezones.cjs.js +2 -0
  47. package/dist/nile-timestamp-builder/timezones.cjs.js.map +1 -0
  48. package/dist/nile-timestamp-builder/timezones.esm.js +1 -0
  49. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js +1 -1
  50. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.cjs.js.map +1 -1
  51. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js +1 -1
  52. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.cjs.js.map +1 -1
  53. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.css.esm.js +91 -58
  54. package/dist/nile-wysiwyg-editor/nile-wysiwyg-editor.esm.js +1 -1
  55. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js +1 -1
  56. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.cjs.js.map +1 -1
  57. package/dist/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.esm.js +19 -19
  58. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js +1 -1
  59. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.cjs.js.map +1 -1
  60. package/dist/nile-wysiwyg-editor/ui/bookmark-panel.esm.js +14 -14
  61. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js +1 -1
  62. package/dist/nile-wysiwyg-editor/ui/bubble-menu.cjs.js.map +1 -1
  63. package/dist/nile-wysiwyg-editor/ui/bubble-menu.esm.js +13 -13
  64. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js +1 -1
  65. package/dist/nile-wysiwyg-editor/ui/code-block-menu.cjs.js.map +1 -1
  66. package/dist/nile-wysiwyg-editor/ui/code-block-menu.esm.js +12 -12
  67. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js +1 -1
  68. package/dist/nile-wysiwyg-editor/ui/embed-menu.cjs.js.map +1 -1
  69. package/dist/nile-wysiwyg-editor/ui/embed-menu.esm.js +10 -10
  70. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js +1 -1
  71. package/dist/nile-wysiwyg-editor/ui/embed-panel.cjs.js.map +1 -1
  72. package/dist/nile-wysiwyg-editor/ui/embed-panel.esm.js +4 -4
  73. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js +1 -1
  74. package/dist/nile-wysiwyg-editor/ui/emoji-picker.cjs.js.map +1 -1
  75. package/dist/nile-wysiwyg-editor/ui/emoji-picker.esm.js +11 -11
  76. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js +1 -1
  77. package/dist/nile-wysiwyg-editor/ui/find-replace.cjs.js.map +1 -1
  78. package/dist/nile-wysiwyg-editor/ui/find-replace.esm.js +9 -9
  79. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js +1 -1
  80. package/dist/nile-wysiwyg-editor/ui/image-menu.cjs.js.map +1 -1
  81. package/dist/nile-wysiwyg-editor/ui/image-menu.esm.js +11 -11
  82. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js +1 -1
  83. package/dist/nile-wysiwyg-editor/ui/image-panel.cjs.js.map +1 -1
  84. package/dist/nile-wysiwyg-editor/ui/image-panel.esm.js +6 -6
  85. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js +1 -1
  86. package/dist/nile-wysiwyg-editor/ui/insert-menu.cjs.js.map +1 -1
  87. package/dist/nile-wysiwyg-editor/ui/insert-menu.esm.js +14 -14
  88. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js +1 -1
  89. package/dist/nile-wysiwyg-editor/ui/link-editor.cjs.js.map +1 -1
  90. package/dist/nile-wysiwyg-editor/ui/link-editor.esm.js +16 -16
  91. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js +1 -1
  92. package/dist/nile-wysiwyg-editor/ui/markdown-panel.cjs.js.map +1 -1
  93. package/dist/nile-wysiwyg-editor/ui/markdown-panel.esm.js +8 -8
  94. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js +1 -1
  95. package/dist/nile-wysiwyg-editor/ui/math-panel.cjs.js.map +1 -1
  96. package/dist/nile-wysiwyg-editor/ui/math-panel.esm.js +4 -4
  97. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js +1 -1
  98. package/dist/nile-wysiwyg-editor/ui/shortcut-help.cjs.js.map +1 -1
  99. package/dist/nile-wysiwyg-editor/ui/shortcut-help.esm.js +16 -16
  100. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js +1 -1
  101. package/dist/nile-wysiwyg-editor/ui/source-view.cjs.js.map +1 -1
  102. package/dist/nile-wysiwyg-editor/ui/source-view.esm.js +29 -29
  103. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js +1 -1
  104. package/dist/nile-wysiwyg-editor/ui/special-chars.cjs.js.map +1 -1
  105. package/dist/nile-wysiwyg-editor/ui/special-chars.esm.js +8 -8
  106. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js +1 -1
  107. package/dist/nile-wysiwyg-editor/ui/suggest-list.cjs.js.map +1 -1
  108. package/dist/nile-wysiwyg-editor/ui/suggest-list.esm.js +9 -9
  109. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js +1 -1
  110. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.cjs.js.map +1 -1
  111. package/dist/nile-wysiwyg-editor/ui/table-grid-picker.esm.js +23 -23
  112. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js +1 -1
  113. package/dist/nile-wysiwyg-editor/ui/table-menu.cjs.js.map +1 -1
  114. package/dist/nile-wysiwyg-editor/ui/table-menu.esm.js +7 -7
  115. package/dist/src/index.d.ts +1 -0
  116. package/dist/src/index.js +1 -0
  117. package/dist/src/index.js.map +1 -1
  118. package/dist/src/nile-code-editor/nile-code-editor.css.js +2 -2
  119. package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  120. package/dist/src/nile-code-editor/nile-code-editor.d.ts +15 -0
  121. package/dist/src/nile-code-editor/nile-code-editor.js +65 -6
  122. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  123. package/dist/src/nile-code-editor/theme.d.ts +6 -117
  124. package/dist/src/nile-code-editor/theme.js +100 -147
  125. package/dist/src/nile-code-editor/theme.js.map +1 -1
  126. package/dist/src/nile-combobox/nile-combobox.css.js +1 -1
  127. package/dist/src/nile-combobox/nile-combobox.css.js.map +1 -1
  128. package/dist/src/nile-detail/nile-detail.css.js +1 -1
  129. package/dist/src/nile-detail/nile-detail.css.js.map +1 -1
  130. package/dist/src/nile-side-bar-footer/nile-side-bar-footer.css.js +3 -3
  131. package/dist/src/nile-side-bar-footer/nile-side-bar-footer.css.js.map +1 -1
  132. package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js +11 -5
  133. package/dist/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.js.map +1 -1
  134. package/dist/src/nile-timestamp-builder/index.d.ts +1 -0
  135. package/dist/src/nile-timestamp-builder/index.js +2 -0
  136. package/dist/src/nile-timestamp-builder/index.js.map +1 -0
  137. package/dist/src/nile-timestamp-builder/nile-timestamp-builder-utils.d.ts +54 -0
  138. package/dist/src/nile-timestamp-builder/nile-timestamp-builder-utils.js +254 -0
  139. package/dist/src/nile-timestamp-builder/nile-timestamp-builder-utils.js.map +1 -0
  140. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.css.d.ts +7 -0
  141. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.css.js +203 -0
  142. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.css.js.map +1 -0
  143. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.d.ts +94 -0
  144. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.js +578 -0
  145. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.js.map +1 -0
  146. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.test.d.ts +1 -0
  147. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.test.js +890 -0
  148. package/dist/src/nile-timestamp-builder/nile-timestamp-builder.test.js.map +1 -0
  149. package/dist/src/nile-timestamp-builder/timezones.d.ts +8 -0
  150. package/dist/src/nile-timestamp-builder/timezones.js +357 -0
  151. package/dist/src/nile-timestamp-builder/timezones.js.map +1 -0
  152. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js +91 -58
  153. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.js.map +1 -1
  154. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.d.ts +2 -1
  155. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js +23 -1
  156. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-editor.js.map +1 -1
  157. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js +19 -19
  158. package/dist/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.js.map +1 -1
  159. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js +10 -10
  160. package/dist/src/nile-wysiwyg-editor/ui/bookmark-panel.js.map +1 -1
  161. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js +7 -7
  162. package/dist/src/nile-wysiwyg-editor/ui/bubble-menu.js.map +1 -1
  163. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js +5 -5
  164. package/dist/src/nile-wysiwyg-editor/ui/code-block-menu.js.map +1 -1
  165. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js +6 -6
  166. package/dist/src/nile-wysiwyg-editor/ui/embed-menu.js.map +1 -1
  167. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js +4 -4
  168. package/dist/src/nile-wysiwyg-editor/ui/embed-panel.js.map +1 -1
  169. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js +6 -6
  170. package/dist/src/nile-wysiwyg-editor/ui/emoji-picker.js.map +1 -1
  171. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js +7 -7
  172. package/dist/src/nile-wysiwyg-editor/ui/find-replace.js.map +1 -1
  173. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js +6 -6
  174. package/dist/src/nile-wysiwyg-editor/ui/image-menu.js.map +1 -1
  175. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js +6 -6
  176. package/dist/src/nile-wysiwyg-editor/ui/image-panel.js.map +1 -1
  177. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js +7 -7
  178. package/dist/src/nile-wysiwyg-editor/ui/insert-menu.js.map +1 -1
  179. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js +9 -9
  180. package/dist/src/nile-wysiwyg-editor/ui/link-editor.js.map +1 -1
  181. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js +8 -8
  182. package/dist/src/nile-wysiwyg-editor/ui/markdown-panel.js.map +1 -1
  183. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js +4 -4
  184. package/dist/src/nile-wysiwyg-editor/ui/math-panel.js.map +1 -1
  185. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js +9 -9
  186. package/dist/src/nile-wysiwyg-editor/ui/shortcut-help.js.map +1 -1
  187. package/dist/src/nile-wysiwyg-editor/ui/source-view.js +24 -24
  188. package/dist/src/nile-wysiwyg-editor/ui/source-view.js.map +1 -1
  189. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js +4 -4
  190. package/dist/src/nile-wysiwyg-editor/ui/special-chars.js.map +1 -1
  191. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js +7 -7
  192. package/dist/src/nile-wysiwyg-editor/ui/suggest-list.js.map +1 -1
  193. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js +16 -16
  194. package/dist/src/nile-wysiwyg-editor/ui/table-grid-picker.js.map +1 -1
  195. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js +4 -4
  196. package/dist/src/nile-wysiwyg-editor/ui/table-menu.js.map +1 -1
  197. package/dist/src/version.js +2 -2
  198. package/dist/src/version.js.map +1 -1
  199. package/dist/tsconfig.tsbuildinfo +1 -1
  200. package/package.json +1 -1
  201. package/src/index.ts +1 -0
  202. package/src/nile-code-editor/nile-code-editor.css.ts +2 -2
  203. package/src/nile-code-editor/nile-code-editor.ts +68 -5
  204. package/src/nile-code-editor/theme.ts +129 -162
  205. package/src/nile-combobox/nile-combobox.css.ts +1 -1
  206. package/src/nile-detail/nile-detail.css.ts +1 -1
  207. package/src/nile-side-bar-footer/nile-side-bar-footer.css.ts +3 -3
  208. package/src/nile-side-bar-footer-item/nile-side-bar-footer-item.css.ts +11 -5
  209. package/src/nile-timestamp-builder/index.ts +1 -0
  210. package/src/nile-timestamp-builder/nile-timestamp-builder-utils.ts +321 -0
  211. package/src/nile-timestamp-builder/nile-timestamp-builder.css.ts +204 -0
  212. package/src/nile-timestamp-builder/nile-timestamp-builder.test.ts +1089 -0
  213. package/src/nile-timestamp-builder/nile-timestamp-builder.ts +625 -0
  214. package/src/nile-timestamp-builder/timezones.ts +356 -0
  215. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.css.ts +91 -58
  216. package/src/nile-wysiwyg-editor/nile-wysiwyg-editor.ts +21 -1
  217. package/src/nile-wysiwyg-editor/nile-wysiwyg-toolbar/nile-wysiwyg-toolbar.css.ts +19 -19
  218. package/src/nile-wysiwyg-editor/ui/bookmark-panel.ts +10 -10
  219. package/src/nile-wysiwyg-editor/ui/bubble-menu.ts +7 -7
  220. package/src/nile-wysiwyg-editor/ui/code-block-menu.ts +5 -5
  221. package/src/nile-wysiwyg-editor/ui/embed-menu.ts +6 -6
  222. package/src/nile-wysiwyg-editor/ui/embed-panel.ts +4 -4
  223. package/src/nile-wysiwyg-editor/ui/emoji-picker.ts +6 -6
  224. package/src/nile-wysiwyg-editor/ui/find-replace.ts +7 -7
  225. package/src/nile-wysiwyg-editor/ui/image-menu.ts +6 -6
  226. package/src/nile-wysiwyg-editor/ui/image-panel.ts +6 -6
  227. package/src/nile-wysiwyg-editor/ui/insert-menu.ts +7 -7
  228. package/src/nile-wysiwyg-editor/ui/link-editor.ts +9 -9
  229. package/src/nile-wysiwyg-editor/ui/markdown-panel.ts +8 -8
  230. package/src/nile-wysiwyg-editor/ui/math-panel.ts +4 -4
  231. package/src/nile-wysiwyg-editor/ui/shortcut-help.ts +9 -9
  232. package/src/nile-wysiwyg-editor/ui/source-view.ts +24 -24
  233. package/src/nile-wysiwyg-editor/ui/special-chars.ts +4 -4
  234. package/src/nile-wysiwyg-editor/ui/suggest-list.ts +7 -7
  235. package/src/nile-wysiwyg-editor/ui/table-grid-picker.ts +16 -16
  236. package/src/nile-wysiwyg-editor/ui/table-menu.ts +4 -4
  237. package/vscode-html-custom-data.json +94 -2
  238. package/dist/index-e43755f5.cjs.js +0 -2
@@ -0,0 +1,2 @@
1
+ System.register(["./index-178e1e57.cjs.js"],function(_export,_context){"use strict";var t,e,i,s,r,p,g,m,v,k,M,y,D,E,R,T,z,H,P,W,q,V,K,_,X,Y,Q,Z,et,it,st,rt,nt,ot,ut,ft,at,ct,dt,pt,gt,mt,wt,bt,vt,St,Ct,At,Dt,Rt,Bt,It,Lt,jt,zt,Pt,$t,qt,Xt,Yt,Qt,Zt,te,ee,pe,ge,me,Se,Oe,Ce,De,Te,Be,Ie,Ne,Le,je,ze,He,Pe,$e,We,qe,Fe,Ve,Je,Ge,Ye,ei,ii,si,ri,ni,hi,ui,fi,ai,ci,pi,gi,mi,wi,vi,ki,Mi,yi,_i64,_arr,_t53,_e58,_i65,Si,Oi,Ai,Ti,Ni,Li,ji,zi,Hi,Pi,$i,Wi,qi,Fi,Vi,Ji,Gi,Ui,Ki,Xi,Yi,Qi,Zi,ts,es,is,ss,rs,ns,hs,os,fs,as,cs,ds,gs,Es,Rs,Bs,Is,js,Ps,$s,Ws,Fs,Vs,Js,Gs,Xs,Zs,tr,er,ir,nr,hr,ur,fr,ar,dr,pr,gr,mr,wr,br,kr,Mr,yr,xr,Or,Cr,Er,Rr,Tr,Br,Lr,jr,Hr,Pr,$r,Wr,qr,Fr,Jr,Gr,Ur,Kr,Yr,Qr,Zr,tn,en,rn,hn,ln,on,an,cn,dn,gn,bn,vn,Mn,yn,On,An,Dn,En,Rn,Tn,Bn,Ln,jn,zn,Hn,Pn,$n,qn,Fn,Vn,Gn,Un,Kn,Xn,th,eh,sh,rh,lh,oh,uh,ah,ch,dh,ph,gh,mh,wh,bh,Mh,yh,Sh,Oh,Ah,Dh,Eh,Rh,Th,Bh,Nh,jh,Ph,$h,Wh,qh,Fh,Vh,Jh,Uh,Xh,Yh,Zh,tl,el,il,sl,rl,nl,hl,ll,ol,ul,fl,al,cl,gl,ml,vl,kl,yl,xl,Ol,Dl,El,Rl,Tl,Il,Ll,jl,zl,Wl,ql,Gl,Ul,Kl,_l,Yl,Ql,eo,io,so,ro,no,ho,lo,oo,uo,fo,ao,co,po,go,mo,wo,bo,_t231,_e208,vo,ko,yo,xo,Oo,Ao,Do,Eo,To,Bo,Io,No,Lo,jo,zo,Ho,qo,Fo,Uo,Yo,tu,eu,hu,lu,uu,pu,gu,mu,vu,ku,Mu,yu,Su,Ou,Cu,Au,Ru,Tu,Bu,Iu,Nu,Lu,ju,zu,Pu,$u,qu,Uu,Ku,_u,Xu,Yu,_i180,_arr2,_arr2$_i,_t249,_e222;function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread();}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r);}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r);}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n103=0,F=function F(){};return{s:F,n:function n(){return _n103>=r.length?{done:!0}:{done:!1,value:r[_n103++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _callSuper(t,o,e){return o=_getPrototypeOf(o),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],_getPrototypeOf(t).constructor):o.apply(t,e));}function _possibleConstructorReturn(t,e){if(e&&("object"==_typeof(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t);}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e;}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}function _superPropGet(t,o,e,r){var p=_get(_getPrototypeOf(1&r?t.prototype:t),o,e);return 2&r&&"function"==typeof p?function(t){return p.apply(e,t);}:p;}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var p=_superPropBase(e,t);if(p){var n=Object.getOwnPropertyDescriptor(p,t);return n.get?n.get.call(arguments.length<3?e:r):n.value;}},_get.apply(null,arguments);}function _superPropBase(t,o){for(;!{}.hasOwnProperty.call(t,o)&&null!==(t=_getPrototypeOf(t)););return t;}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t);},_getPrototypeOf(t);}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e);}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t;},_setPrototypeOf(t,e);}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o;}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o;},_typeof(o);}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t["return"]&&(u=t["return"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}function _arrayWithHoles(r){if(Array.isArray(r))return r;}function _classCallCheck(a,n){if(!(a instanceof n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o);}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+"";}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}function n(t){if(t<768)return!1;for(var _e2=0,_i2=s.length;;){var _n2=_e2+_i2>>1;if(t<s[_n2])_i2=_n2;else{if(!(t>=r[_n2]))return!0;_e2=_n2+1;}if(_e2==_i2)return!1;}}function h(t){return t>=127462&&t<=127487;}function l(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return(i?o:u)(t,e,s);}function o(t,e,i){if(e==t.length)return e;e&&a(t.charCodeAt(e))&&c(t.charCodeAt(e-1))&&e--;var s=f(t,e);for(e+=d(s);e<t.length;){var _r2=f(t,e);if(8205==s||8205==_r2||i&&n(_r2))e+=d(_r2),s=_r2;else{if(!h(_r2))break;{var _i4=0,_s2=e-2;for(;_s2>=0&&h(f(t,_s2));)_i4++,_s2-=2;if(_i4%2==0)break;e+=2;}}}return e;}function u(t,e,i){for(;e>0;){var _s3=o(t,e-2,i);if(_s3<e)return _s3;e--;}return 0;}function f(t,e){var i=t.charCodeAt(e);if(!c(i)||e+1==t.length)return i;var s=t.charCodeAt(e+1);return a(s)?s-56320+(i-55296<<10)+65536:i;}function a(t){return t>=56320&&t<57344;}function c(t){return t>=55296&&t<56320;}function d(t){return t<65536?1:2;}function w(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1e9;for(var _r12=0,_n10=0,_h8=!0;_n10<t.length&&_r12<=s;_n10++){var _l8=t[_n10],_o4=_r12+_l8.length;_o4>=i&&(_o4>s&&(_l8=_l8.slice(0,s-_r12)),_r12<i&&(_l8=_l8.slice(i-_r12)),_h8?(e[e.length-1]+=_l8,_h8=!1):e.push(_l8)),_r12=_o4+1;}return e;}function b(t,e,i){return w(t,[""],e,i);}function x(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))];}function S(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;return l(t,e,i,s);}function O(t,e){var i=t.charCodeAt(e);if(!(s=i,s>=55296&&s<56320&&e+1!=t.length))return i;var s;var r=t.charCodeAt(e+1);return function(t){return t>=56320&&t<57344;}(r)?r-56320+(i-55296<<10)+65536:i;}function C(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)));}function A(t){return t<65536?1:2;}function B(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;if(0==e&&i<=0)return;var r=t.length-2;r>=0&&i<=0&&i==t[r+1]?t[r]+=e:r>=0&&0==e&&0==t[r]?t[r+1]+=i:s?(t[r]+=e,t[r+1]+=i):t.push(e,i);}function I(t,e,i){if(0==i.length)return;var s=e.length-2>>1;if(s<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<s;)t.push(p.empty);t.push(i);}}function N(t,e,i){var s=t.inserted;for(var _r20=0,_n17=0,_h14=0;_h14<t.sections.length;){var _l12=t.sections[_h14++],_o7=t.sections[_h14++];if(_o7<0)_r20+=_l12,_n17+=_l12;else{var _u3=_r20,_f2=_n17,_a2=p.empty;for(;_u3+=_l12,_f2+=_o7,_o7&&s&&(_a2=_a2.append(s[_h14-2>>1])),!(i||_h14==t.sections.length||t.sections[_h14+1]<0);)_l12=t.sections[_h14++],_o7=t.sections[_h14++];e(_r20,_u3,_n17,_f2,_a2),_r20=_u3,_n17=_f2;}}}function L(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var r=[],n=s?[]:null,h=new z(t),l=new z(e);for(var _t8=-1;;){if(h.done&&l.len||l.done&&h.len)throw new Error("Mismatched change set lengths");if(-1==h.ins&&-1==l.ins){var _t9=Math.min(h.len,l.len);B(r,_t9,-1),h.forward(_t9),l.forward(_t9);}else if(l.ins>=0&&(h.ins<0||_t8==h.i||0==h.off&&(l.len<h.len||l.len==h.len&&!i))){var _e19=l.len;for(B(r,l.ins,-1);_e19;){var _i14=Math.min(h.len,_e19);h.ins>=0&&_t8<h.i&&h.len<=_i14&&(B(r,0,h.ins),n&&I(n,r,h.text),_t8=h.i),h.forward(_i14),_e19-=_i14;}l.next();}else{if(!(h.ins>=0)){if(h.done&&l.done)return n?T.createSet(r,n):R.create(r);throw new Error("Mismatched change set lengths");}{var _e20=0,_i15=h.len;for(;_i15;)if(-1==l.ins){var _t10=Math.min(_i15,l.len);_e20+=_t10,_i15-=_t10,l.forward(_t10);}else{if(!(0==l.ins&&l.len<_i15))break;_i15-=l.len,l.next();}B(r,_e20,_t8<h.i?h.ins:0),n&&_t8<h.i&&I(n,r,h.text),_t8=h.i,h.forward(h.len-_i15);}}}}function j(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=[],r=i?[]:null,n=new z(t),h=new z(e);for(var _t11=!1;;){if(n.done&&h.done)return r?T.createSet(s,r):R.create(s);if(0==n.ins)B(s,n.len,0,_t11),n.next();else if(0!=h.len||h.done){if(n.done||h.done)throw new Error("Mismatched change set lengths");{var _e21=Math.min(n.len2,h.len),_i16=s.length;if(-1==n.ins){var _i17=-1==h.ins?-1:h.off?0:h.ins;B(s,_e21,_i17,_t11),r&&_i17&&I(r,s,h.text);}else-1==h.ins?(B(s,n.off?0:n.len,_e21,_t11),r&&I(r,s,n.textBit(_e21))):(B(s,n.off?0:n.len,h.off?0:h.ins,_t11),r&&!h.off&&I(r,s,h.text));_t11=(n.ins>_e21||h.ins>=0&&h.len>_e21)&&(_t11||s.length>_i16),n.forward2(_e21),h.forward(_e21);}}else B(s,0,h.ins,_t11),r&&I(r,s,h.text),h.next();}}function $(t,e){var _iterator11=_createForOfIteratorHelper(t.ranges),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var _i21=_step11.value;if(_i21.to>e)throw new RangeError("Selection points outside of document");}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}}function F(t,e){return t==e||t.length==e.length&&t.every(function(t,i){return t===e[i];});}function J(t,e,i){if(t.length!=e.length)return!1;for(var _s16=0;_s16<t.length;_s16++)if(!i(t[_s16],e[_s16]))return!1;return!0;}function G(t,e){var i=!1;var _iterator13=_createForOfIteratorHelper(e),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var _s17=_step13.value;1&ht(t,_s17)&&(i=!0);}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}return i;}function U(t,e,i){var s=i.map(function(e){return t[e.id];}),r=i.map(function(t){return t.type;}),n=s.filter(function(t){return!(1&t);}),h=t[e.id]>>1;function l(t){var i=[];for(var _e23=0;_e23<s.length;_e23++){var _n19=lt(t,s[_e23]);if(2==r[_e23]){var _iterator14=_createForOfIteratorHelper(_n19),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var _t12=_step14.value;i.push(_t12);}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}else i.push(_n19);}return e.combine(i);}return{create:function create(t){var _iterator15=_createForOfIteratorHelper(s),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var _e24=_step15.value;ht(t,_e24);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return t.values[h]=l(t),1;},update:function update(t,i){if(!G(t,n))return 0;var s=l(t);return e.compare(s,t.values[h])?0:(t.values[h]=s,1);},reconfigure:function reconfigure(t,r){var n=G(t,s),o=r.config.facets[e.id],u=r.facet(e);if(o&&!n&&F(i,o))return t.values[h]=u,0;var f=l(t);return e.compare(f,u)?(t.values[h]=u,0):(t.values[h]=f,1);}};}function tt(t){return function(e){return new it(e,t);};}function ht(t,e){if(1&e)return 2;var i=e>>1,s=t.status[i];if(4==s)throw new Error("Cyclic dependency between fields and/or facets");if(2&s)return s;t.status[i]=4;var r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r;}function lt(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1];}function kt(t,e){var i=[];for(var _s21=0,_r24=0;;){var _n20=void 0,_h16=void 0;if(_s21<t.length&&(_r24==e.length||e[_r24]>=t[_s21]))_n20=t[_s21++],_h16=t[_s21++];else{if(!(_r24<e.length))return i;_n20=e[_r24++],_h16=e[_r24++];}!i.length||i[i.length-1]<_n20?i.push(_n20,_h16):i[i.length-1]<_h16&&(i[i.length-1]=_h16);}}function Mt(t,e,i){var s;var r,n,h;return i?(r=e.changes,n=T.empty(e.changes.length),h=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),n=t.changes.mapDesc(e.changes,!0),h=t.changes.compose(r)),{changes:h,selection:e.selection?e.selection.map(n):null===(s=t.selection)||void 0===s?void 0:s.map(r),effects:bt.mapEffects(t.effects,r).concat(bt.mapEffects(e.effects,n)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView};}function yt(t,e,i){var s=e.selection,r=Ot(e.annotations);return e.userEvent&&(r=r.concat(vt.userEvent.of(e.userEvent))),{changes:e.changes instanceof T?e.changes:T.of(e.changes||[],i,t.facet(ft)),selection:s&&(s instanceof P?s:P.single(s.anchor,s.head)),effects:Ot(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView};}function xt(t,e,i){var s=yt(t,e.length?e[0]:{},t.doc.length);e.length&&!1===e[0].filter&&(i=!1);for(var _r25=1;_r25<e.length;_r25++){!1===e[_r25].filter&&(i=!1);var _n21=!!e[_r25].sequential;s=Mt(s,yt(t,e[_r25],_n21?s.changes.newLength:t.doc.length),_n21);}var r=vt.create(t,s.changes,s.selection,s.effects,s.annotations,s.scrollIntoView);return function(t){var e=t.startState,i=e.facet(dt),s=t;for(var _r26=i.length-1;_r26>=0;_r26--){var _n22=i[_r26](t);_n22&&Object.keys(_n22).length&&(s=Mt(s,yt(e,_n22,t.changes.newLength),!0));}return s==t?t:vt.create(e,t.changes,t.selection,s.effects,s.annotations,s.scrollIntoView);}(i?function(t){var e=t.startState,i=!0;var _iterator21=_createForOfIteratorHelper(e.facet(at)),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _s23=_step21.value;var _e30=_s23(t);if(!1===_e30){i=!1;break;}Array.isArray(_e30)&&(i=!0===i?_e30:kt(i,_e30));}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}if(!0!==i){var _s22,_r27;if(!1===i)_r27=t.changes.invertedDesc,_s22=T.empty(e.doc.length);else{var _e29=t.changes.filter(i);_s22=_e29.changes,_r27=_e29.filtered.mapDesc(_e29.changes).invertedDesc;}t=vt.create(e,_s22,t.selection&&t.selection.map(_r27),bt.mapEffects(t.effects,_r27),t.annotations,t.scrollIntoView);}var s=e.facet(ct);for(var _i25=s.length-1;_i25>=0;_i25--){var _r28=s[_i25](t);t=_r28 instanceof vt?_r28:Array.isArray(_r28)&&1==_r28.length&&_r28[0]instanceof vt?_r28[0]:xt(e,Ot(_r28),!1);}return t;}(r):r);}function Ot(t){return null==t?St:Array.isArray(t)?t:[t];}function Et(t){return function(e){if(!/\S/.test(e))return Ct.Space;if(function(t){if(Dt)return Dt.test(t);for(var _e31=0;_e31<t.length;_e31++){var _i26=t[_e31];if(/\w/.test(_i26)||_i26>"€"&&(_i26.toUpperCase()!=_i26.toLowerCase()||At.test(_i26)))return!0;}return!1;}(e))return Ct.Word;for(var _i27=0;_i27<t.length;_i27++)if(e.indexOf(t[_i27])>-1)return Ct.Word;return Ct.Other;};}function Tt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var s={};var _iterator26=_createForOfIteratorHelper(t),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _e35=_step26.value;for(var _i31=0,_Object$keys=Object.keys(_e35);_i31<_Object$keys.length;_i31++){var _t21=_Object$keys[_i31];var _r31=_e35[_t21],_n25=s[_t21];if(void 0===_n25)s[_t21]=_r31;else if(_n25===_r31||void 0===_r31);else{if(!Object.hasOwnProperty.call(i,_t21))throw new Error("Config merge conflict for field "+_t21);s[_t21]=i[_t21](_n25,_r31);}}}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}for(var _t20 in e)void 0===s[_t20]&&(s[_t20]=e[_t20]);return s;}function Nt(t,e){return t.from-e.from||t.value.startSide-e.value.startSide;}function Ht(t,e,i){var s=new Map();var _iterator29=_createForOfIteratorHelper(t),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _e38=_step29.value;for(var _t26=0;_t26<_e38.chunk.length;_t26++)_e38.chunk[_t26].maxPoint<=0&&s.set(_e38.chunk[_t26],_e38.chunkPos[_t26]);}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}var r=new Set();var _iterator30=_createForOfIteratorHelper(e),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _t27=_step30.value;for(var _e39=0;_e39<_t27.chunk.length;_e39++){var _n30=s.get(_t27.chunk[_e39]);null==_n30||(i?i.mapPos(_n30):_n30)!=_t27.chunkPos[_e39]||(null==i?void 0:i.touchesRange(_n30,_n30+_t27.chunk[_e39].length))||r.add(_t27.chunk[_e39]);}}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}return r;}function Wt(t,e){for(var _i38=t[e];;){var _s31=1+(e<<1);if(_s31>=t.length)break;var _r38=t[_s31];if(_s31+1<t.length&&_r38.compare(t[_s31+1])>=0&&(_r38=t[_s31+1],_s31++),_i38.compare(_r38)<0)break;t[_s31]=_i38,t[e]=_r38,e=_s31;}}function Ft(t,e,i,s,r,n){t["goto"](e),i["goto"](s);var h=s+r,l=s,o=s-e;for(;;){var _e43=t.to+o-i.to,_s33=_e43||t.endSide-i.endSide,_r39=_s33<0?t.to+o:i.to,_u6=Math.min(_r39,h);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))&&Vt(t.activeForPoint(t.to),i.activeForPoint(i.to))||n.comparePoint(l,_u6,t.point,i.point):_u6>l&&!Vt(t.active,i.active)&&n.compareRange(l,_u6,t.active,i.active),_r39>h)break;(_e43||t.openEnd!=i.openEnd)&&n.boundChange&&n.boundChange(_r39),l=_r39,_s33<=0&&t.next(),_s33>=0&&i.next();}}function Vt(t,e){if(t.length!=e.length)return!1;for(var _i41=0;_i41<t.length;_i41++)if(t[_i41]!=e[_i41]&&!t[_i41].eq(e[_i41]))return!1;return!0;}function Jt(t,e){for(var _i42=e,_s34=t.length-1;_i42<_s34;_i42++)t[_i42]=t[_i42+1];t.pop();}function Gt(t,e,i){for(var _i43=t.length-1;_i43>=e;_i43--)t[_i43+1]=t[_i43];t[e]=i;}function Ut(t,e){var i=-1,s=1e9;for(var _r40=0;_r40<e.length;_r40++)(e[_r40]-s||t[_r40].endSide-t[i].endSide)<0&&(i=_r40,s=e[_r40]);return i;}function Kt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var s=0;for(var _r41=0;_r41<i&&_r41<t.length;)9==t.charCodeAt(_r41)?(s+=e-s%e,_r41++):(s++,_r41=S(t,_r41));return s;}function _t(t,e,i,s){for(var _s35=0,_r42=0;;){if(_r42>=e)return _s35;if(_s35==t.length)break;_r42+=9==t.charCodeAt(_s35)?i-_r42%i:1,_s35=S(t,_s35);}return!0===s?-1:t.length;}function ie(t){var e;return e=11==t.nodeType?t.getSelection?t:t.ownerDocument:t,e.getSelection();}function se(t,e){return!!e&&(t==e||t.contains(1!=e.nodeType?e.parentNode:e));}function re(t,e){if(!e.anchorNode)return!1;try{return se(t,e.anchorNode);}catch(t){return!1;}}function ne(t){return 3==t.nodeType?be(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[];}function he(t,e,i,s){return!!i&&(ue(t,e,i,s,-1)||ue(t,e,i,s,1));}function le(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e;}function oe(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName);}function ue(t,e,i,s,r){for(;;){if(t==i&&e==s)return!0;if(e==(r<0?0:fe(t))){if("DIV"==t.nodeName)return!1;var _i46=t.parentNode;if(!_i46||1!=_i46.nodeType)return!1;e=le(t)+(r<0?0:1),t=_i46;}else{if(1!=t.nodeType)return!1;if(1==(t=t.childNodes[e+(r<0?-1:0)]).nodeType&&"false"==t.contentEditable)return!1;e=r<0?fe(t):0;}}}function fe(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length;}function ae(t,e){var i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom};}function ce(t){var e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight};}function de(t,e){var i=e.width/t.offsetWidth,s=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(s>.995&&s<1.005||!isFinite(s)||Math.abs(e.height-t.offsetHeight)<1)&&(s=1),{scaleX:i,scaleY:s};}function we(t){if(t.setActive)return t.setActive();if(me)return t.focus(me);var e=[];for(var _i47=t;_i47&&(e.push(_i47,_i47.scrollTop,_i47.scrollLeft),_i47!=_i47.ownerDocument);_i47=_i47.parentNode);if(t.focus(null==me?{get preventScroll(){return me={preventScroll:!0},!0;}}:void 0),!me){me=!1;for(var _t35=0;_t35<e.length;){var _i48=e[_t35++],_s36=e[_t35++],_r43=e[_t35++];_i48.scrollTop!=_s36&&(_i48.scrollTop=_s36),_i48.scrollLeft!=_r43&&(_i48.scrollLeft=_r43);}}}function be(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e;var s=ge||(ge=document.createRange());return s.setEnd(t,i),s.setStart(t,e),s;}function ve(t,e,i,s){var _s37;var r={key:e,code:e,keyCode:i,which:i,cancelable:!0};s&&(_s37=s,r.altKey=_s37.altKey,r.ctrlKey=_s37.ctrlKey,r.shiftKey=_s37.shiftKey,r.metaKey=_s37.metaKey,_s37);var n=new KeyboardEvent("keydown",r);n.synthetic=!0,t.dispatchEvent(n);var h=new KeyboardEvent("keyup",r);return h.synthetic=!0,t.dispatchEvent(h),n.defaultPrevented||h.defaultPrevented;}function ke(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0]);}function Me(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4);}function ye(t,e){for(var _i49=t,_s38=e;;){if(3==_i49.nodeType&&_s38>0)return{node:_i49,offset:_s38};if(1==_i49.nodeType&&_s38>0){if("false"==_i49.contentEditable)return null;_i49=_i49.childNodes[_s38-1],_s38=fe(_i49);}else{if(!_i49.parentNode||oe(_i49))return null;_s38=le(_i49),_i49=_i49.parentNode;}}}function xe(t,e){for(var _i50=t,_s39=e;;){if(3==_i50.nodeType&&_s39<_i50.nodeValue.length)return{node:_i50,offset:_s39};if(1==_i50.nodeType&&_s39<_i50.childNodes.length){if("false"==_i50.contentEditable)return null;_i50=_i50.childNodes[_s39],_s39=0;}else{if(!_i50.parentNode||oe(_i50))return null;_s39=le(_i50)+1,_i50=_i50.parentNode;}}}function Ae(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e;}function Ee(t,e,i,s,r,n,h,l,o){var u=t.children,f=u.length?u[e]:null,a=n.length?n[n.length-1]:null,c=a?a.breakAfter:h;if(!(e==s&&f&&!h&&!c&&n.length<2&&f.merge(i,r,n.length?a:null,0==i,l,o))){if(s<u.length){var _t42=u[s];_t42&&(r<_t42.length||_t42.breakAfter&&(null==a?void 0:a.breakAfter))?(e==s&&(_t42=_t42.split(r),r=0),!c&&a&&_t42.merge(0,r,a,!0,0,o)?n[n.length-1]=_t42:((r||_t42.children.length&&!_t42.children[0].length)&&_t42.merge(0,r,null,!1,0,o),n.push(_t42))):(null==_t42?void 0:_t42.breakAfter)&&(a?a.breakAfter=1:h=1),s++;}for(f&&(f.breakAfter=h,i>0&&(!h&&n.length&&f.merge(i,f.length,n[0],!1,l,0)?f.breakAfter=n.shift().breakAfter:(i<f.length||f.children.length&&0==f.children[f.children.length-1].length)&&f.merge(i,f.length,null,!1,l,0),e++));e<s&&n.length;)if(u[s-1].become(n[n.length-1]))s--,n.pop(),o=n.length?0:l;else{if(!u[e].become(n[0]))break;e++,n.shift(),l=n.length?0:o;}!n.length&&e&&s<u.length&&!u[e-1].breakAfter&&u[s].merge(0,0,u[e-1],!1,l,o)&&e--,(e<s||n.length)&&t.replaceChildren(e,s,n);}}function Re(t,e,i,s,r,n){var h=t.childCursor(),_h$findPos=h.findPos(i,1),l=_h$findPos.i,o=_h$findPos.off,_h$findPos2=h.findPos(e,-1),u=_h$findPos2.i,f=_h$findPos2.off,a=e-i;var _iterator37=_createForOfIteratorHelper(s),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var _t43=_step37.value;a+=_t43.length;}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}t.length+=a,Ee(t,u,f,l,o,s,0,r,n);}function Ue(t,e){var i=t.dom,s=t.children,r=0;for(var _t47=0;r<s.length;r++){var _n35=s[r],_h23=_t47+_n35.length;if(!(_h23==_t47&&_n35.getSide()<=0)){if(e>_t47&&e<_h23&&_n35.dom.parentNode==i)return _n35.domAtPos(e-_t47);if(e<=_t47)break;_t47=_h23;}}for(var _t48=r;_t48>0;_t48--){var _e54=s[_t48-1];if(_e54.dom.parentNode==i)return _e54.domAtPos(_e54.length);}for(var _t49=r;_t49<s.length;_t49++){var _e55=s[_t49];if(_e55.dom.parentNode==i)return _e55.domAtPos(0);}return new Se(i,0);}function Ke(t,e,i){var s,r=t.children;i>0&&e instanceof Ve&&r.length&&(s=r[r.length-1])instanceof Ve&&s.mark.eq(e.mark)?Ke(s,e.children[0],i-1):(r.push(e),e.setParent(t)),t.length+=e.length;}function _e(t,e,i){var s=null,r=-1,n=null,h=-1;!function t(e,l){for(var _o11=0,_u8=0;_o11<e.children.length&&_u8<=l;_o11++){var _f5=e.children[_o11],_a4=_u8+_f5.length;_a4>=l&&(_f5.children.length?t(_f5,l-_u8):(!n||n.isHidden&&i>0)&&(_a4>l||_u8==_a4&&_f5.getSide()>0)?(n=_f5,h=l-_u8):(_u8<l||_u8==_a4&&_f5.getSide()<0&&!_f5.isHidden)&&(s=_f5,r=l-_u8)),_u8=_a4;}}(t,e);var l=(i<0?s:n)||s||n;return l?l.coordsAt(Math.max(0,l==s?r:h),i):function(t){var e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();var i=ne(e);return i[i.length-1]||null;}(t);}function Xe(t,e){for(var _i56 in t)"class"==_i56&&e["class"]?e["class"]+=" "+t["class"]:"style"==_i56&&e.style?e.style+=";"+t.style:e[_i56]=t[_i56];return e;}function Qe(t,e,i){if(t==e)return!0;t||(t=Ye),e||(e=Ye);var s=Object.keys(t),r=Object.keys(e);if(s.length-(i&&s.indexOf(i)>-1?1:0)!=r.length-(i&&r.indexOf(i)>-1?1:0))return!1;for(var _i57=0,_s44=s;_i57<_s44.length;_i57++){var _n36=_s44[_i57];if(_n36!=i&&(-1==r.indexOf(_n36)||t[_n36]!==e[_n36]))return!1;}return!0;}function Ze(t,e,i){var s=!1;if(e)for(var _r45 in e)i&&_r45 in i||(s=!0,"style"==_r45?t.style.cssText="":t.removeAttribute(_r45));if(i)for(var _r46 in i)e&&e[_r46]==i[_r46]||(s=!0,"style"==_r46?t.style.cssText=i[_r46]:t.setAttribute(_r46,i[_r46]));return s;}function ti(t){var e=Object.create(null);for(var _i58=0;_i58<t.attributes.length;_i58++){var _s45=t.attributes[_i58];e[_s45.name]=_s45.value;}return e;}function li(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var i=t.inclusiveStart,s=t.inclusiveEnd;return null==i&&(i=t.inclusive),null==s&&(s=t.inclusive),{start:null!=i?i:e,end:null!=s?s:e};}function oi(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=i.length-1;r>=0&&i[r]+s>=t?i[r]=Math.max(i[r],e):i.push(t,e);}function di(t,e){var _iterator41=_createForOfIteratorHelper(e),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _i62=_step41.value;t=new Ve(_i62,[t],t.length);}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}return t;}function bi(t){var e=[];for(var _i63=0;_i63<t.length;_i63++)e.push(1<<+t[_i63]);return e;}function xi(t){return t<=247?vi[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?ki[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1;}function Ci(t,e){if(t.length!=e.length)return!1;for(var _i66=0;_i66<t.length;_i66++){var _s51=t[_i66],_r49=e[_i66];if(_s51.from!=_r49.from||_s51.to!=_r49.to||_s51.direction!=_r49.direction||!Ci(_s51.inner,_r49.inner))return!1;}return!0;}function Di(t,e,i,s,r,n,h){var l=s%2?2:1;if(s%2==r%2)for(var _o13=e,_u10=0;_o13<i;){var _e59=!0,_f6=!1;if(_u10==n.length||_o13<n[_u10].from){var _t54=Ai[_o13];_t54!=l&&(_e59=!1,_f6=16==_t54);}var _a5=_e59||1!=l?null:[],_c2=_e59?s:s+1,_d=_o13;t:for(;;)if(_u10<n.length&&_d==n[_u10].from){if(_f6)break t;var _p3=n[_u10];if(!_e59)for(var _t55=_p3.to,_e60=_u10+1;;){if(_t55==i)break t;if(!(_e60<n.length&&n[_e60].from==_t55)){if(Ai[_t55]==l)break t;break;}_t55=n[_e60++].to;}if(_u10++,_a5)_a5.push(_p3);else{_p3.from>_o13&&h.push(new Oi(_o13,_p3.from,_c2)),Ei(t,_p3.direction==mi!=!(_c2%2)?s+1:s,r,_p3.inner,_p3.from,_p3.to,h),_o13=_p3.to;}_d=_p3.to;}else{if(_d==i||(_e59?Ai[_d]!=l:Ai[_d]==l))break;_d++;}_a5?Di(t,_o13,_d,s+1,r,_a5,h):_o13<_d&&h.push(new Oi(_o13,_d,_c2)),_o13=_d;}else for(var _o14=i,_u11=n.length;_o14>e;){var _i67=!0,_f7=!1;if(!_u11||_o14>n[_u11-1].to){var _t56=Ai[_o14-1];_t56!=l&&(_i67=!1,_f7=16==_t56);}var _a6=_i67||1!=l?null:[],_c3=_i67?s:s+1,_d2=_o14;t:for(;;)if(_u11&&_d2==n[_u11-1].to){if(_f7)break t;var _p4=n[--_u11];if(!_i67)for(var _t57=_p4.from,_i68=_u11;;){if(_t57==e)break t;if(!_i68||n[_i68-1].to!=_t57){if(Ai[_t57-1]==l)break t;break;}_t57=n[--_i68].from;}if(_a6)_a6.push(_p4);else{_p4.to<_o14&&h.push(new Oi(_p4.to,_o14,_c3)),Ei(t,_p4.direction==mi!=!(_c3%2)?s+1:s,r,_p4.inner,_p4.from,_p4.to,h),_o14=_p4.from;}_d2=_p4.from;}else{if(_d2==e||(_i67?Ai[_d2-1]!=l:Ai[_d2-1]==l))break;_d2--;}_a6?Di(t,_d2,_o14,s+1,r,_a6,h):_d2<_o14&&h.push(new Oi(_d2,_o14,_c3)),_o14=_d2;}}function Ei(t,e,i,s,r,n,h){var l=e%2?2:1;!function(t,e,i,s,r){for(var _n41=0;_n41<=s.length;_n41++){var _h25=_n41?s[_n41-1].to:e,_l20=_n41<s.length?s[_n41].from:i,_o15=_n41?256:r;for(var _e61=_h25,_i69=_o15,_s52=_o15;_e61<_l20;_e61++){var _r50=xi(t.charCodeAt(_e61));512==_r50?_r50=_i69:8==_r50&&4==_s52&&(_r50=16),Ai[_e61]=4==_r50?2:_r50,7&_r50&&(_s52=_r50),_i69=_r50;}for(var _t58=_h25,_e62=_o15,_s53=_o15;_t58<_l20;_t58++){var _r51=Ai[_t58];if(128==_r51)_t58<_l20-1&&_e62==Ai[_t58+1]&&24&_e62?_r51=Ai[_t58]=_e62:Ai[_t58]=256;else if(64==_r51){var _r52=_t58+1;for(;_r52<_l20&&64==Ai[_r52];)_r52++;var _n42=_t58&&8==_e62||_r52<i&&8==Ai[_r52]?1==_s53?1:8:256;for(var _e63=_t58;_e63<_r52;_e63++)Ai[_e63]=_n42;_t58=_r52-1;}else 8==_r51&&1==_s53&&(Ai[_t58]=1);_e62=_r51,7&_r51&&(_s53=_r51);}}}(t,r,n,s,l),function(t,e,i,s,r){var n=1==r?2:1;for(var _h26=0,_l21=0,_o16=0;_h26<=s.length;_h26++){var _u12=_h26?s[_h26-1].to:e,_f8=_h26<s.length?s[_h26].from:i;for(var _e64,_i70,_s54,_h27=_u12;_h27<_f8;_h27++)if(_i70=Mi[_e64=t.charCodeAt(_h27)]){if(_i70<0){for(var _t59=_l21-3;_t59>=0;_t59-=3)if(yi[_t59+1]==-_i70){var _e65=yi[_t59+2],_i71=2&_e65?r:4&_e65?1&_e65?n:r:0;_i71&&(Ai[_h27]=Ai[yi[_t59]]=_i71),_l21=_t59;break;}}else{if(189==yi.length)break;yi[_l21++]=_h27,yi[_l21++]=_e64,yi[_l21++]=_o16;}}else if(2==(_s54=Ai[_h27])||1==_s54){var _t60=_s54==r;_o16=_t60?0:1;for(var _e66=_l21-3;_e66>=0;_e66-=3){var _i72=yi[_e66+2];if(2&_i72)break;if(_t60)yi[_e66+2]|=2;else{if(4&_i72)break;yi[_e66+2]|=4;}}}}}(t,r,n,s,l),function(t,e,i,s){for(var _r53=0,_n43=s;_r53<=i.length;_r53++){var _h28=_r53?i[_r53-1].to:t,_l22=_r53<i.length?i[_r53].from:e;for(var _o17=_h28;_o17<_l22;){var _h29=Ai[_o17];if(256==_h29){var _h30=_o17+1;for(;;)if(_h30==_l22){if(_r53==i.length)break;_h30=i[_r53++].to,_l22=_r53<i.length?i[_r53].from:e;}else{if(256!=Ai[_h30])break;_h30++;}var _u13=1==_n43,_f9=_u13==(1==(_h30<e?Ai[_h30]:s))?_u13?1:2:s;for(var _e67=_h30,_s55=_r53,_n44=_s55?i[_s55-1].to:t;_e67>_o17;)_e67==_n44&&(_e67=i[--_s55].from,_n44=_s55?i[_s55-1].to:t),Ai[--_e67]=_f9;_o17=_h30;}else _n43=_h29,_o17++;}}}(r,n,s,l),Di(t,r,n,e,i,s,h);}function Ri(t){return[new Oi(0,t,0)];}function Bi(t,e,i,s,r){var n;var h=s.head-t.from,l=Oi.find(e,h,null!==(n=s.bidiLevel)&&void 0!==n?n:-1,s.assoc),o=e[l],u=o.side(r,i);if(h==u){var _t61=l+=r?1:-1;if(_t61<0||_t61>=e.length)return null;o=e[l=_t61],h=o.side(!r,i),u=o.side(r,i);}var f=S(t.text,h,o.forward(r,i));(f<o.from||f>o.to)&&(f=u),Ti=t.text.slice(Math.min(h,f),Math.max(h,f));var a=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return a&&f==u&&a.level+(r?0:1)<o.level?P.cursor(a.side(!r,i)+t.from,a.forward(r,i)?1:-1,a.level):P.cursor(f+t.from,o.forward(r,i)?-1:1,o.level);}function Ii(t,e,i){for(var _s56=e;_s56<i;_s56++){var _e68=xi(t.charCodeAt(_s56));if(1==_e68)return mi;if(2==_e68||4==_e68)return wi;}return mi;}function _i(t,e,i){var s=t.facet(zi);s.length?s[0](e):window.onerror?window.onerror(String(e),i,void 0,void 0,e):i?console.error(i+":",e):console.error(e);}function ls(t,e){var i=t.state.facet(hs);if(!i.length)return i;var s=i.map(function(e){return e instanceof Function?e(t):e;}),r=[];return jt.spans(s,e.from,e.to,{point:function point(){},span:function span(t,i,s,n){var h=t-e.from,l=i-e.from,o=r;for(var _t63=s.length-1;_t63>=0;_t63--,n--){var _i73=void 0,_r54=s[_t63].spec.bidiIsolate;if(null==_r54&&(_r54=Ii(e.text,h,l)),n>0&&o.length&&(_i73=o[o.length-1]).to==h&&_i73.direction==_r54)_i73.to=l,o=_i73.inner;else{var _t64={from:h,to:l,direction:_r54,inner:[]};o.push(_t64),o=_t64.inner;}}}}),r;}function us(t){var e=0,i=0,s=0,r=0;var _iterator42=_createForOfIteratorHelper(t.state.facet(os)),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var _n45=_step42.value;var _h31=_n45(t);_h31&&(null!=_h31.left&&(e=Math.max(e,_h31.left)),null!=_h31.right&&(i=Math.max(i,_h31.right)),null!=_h31.top&&(s=Math.max(s,_h31.top)),null!=_h31.bottom&&(r=Math.max(r,_h31.bottom)));}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}return{left:e,right:i,top:s,bottom:r};}function ps(t,e){var i=t.observer.selectionRange;if(!i.focusNode)return null;var s=ye(i.focusNode,i.focusOffset),r=xe(i.focusNode,i.focusOffset),n=s||r;if(r&&s&&r.node!=s.node){var _e87=Ce.get(r.node);if(!_e87||_e87 instanceof Fe&&_e87.text!=r.node.nodeValue)n=r;else if(t.docView.lastCompositionAfterCursor){var _t84=Ce.get(s.node);!_t84||_t84 instanceof Fe&&_t84.text!=s.node.nodeValue||(n=r);}}if(t.docView.lastCompositionAfterCursor=n!=s,!n)return null;var h=e-n.offset;return{from:h,to:h+n.node.nodeValue.length,node:n.node};}function ms(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right);}function ws(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom);}function bs(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1;}function vs(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t;}function ks(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t;}function Ms(t,e,i){var s,r,n,h,l,o,u,f,a=!1;for(var _c6=t.firstChild;_c6;_c6=_c6.nextSibling){var _t85=ne(_c6);for(var _d5=0;_d5<_t85.length;_d5++){var _p7=_t85[_d5];r&&bs(r,_p7)&&(_p7=vs(ks(_p7,r.bottom),r.top));var _g3=ms(e,_p7),_m3=ws(i,_p7);if(0==_g3&&0==_m3)return 3==_c6.nodeType?ys(_c6,e,i):Ms(_c6,e,i);if(!s||h>_m3||h==_m3&&n>_g3){s=_c6,r=_p7,n=_g3,h=_m3;var _l27=_m3?i<_p7.top?-1:1:_g3?e<_p7.left?-1:1:0;a=!_l27||(_l27>0?_d5<_t85.length-1:_d5>0);}0==_g3?i>_p7.bottom&&(!u||u.bottom<_p7.bottom)?(l=_c6,u=_p7):i<_p7.top&&(!f||f.top>_p7.top)&&(o=_c6,f=_p7):u&&bs(u,_p7)?u=ks(u,_p7.bottom):f&&bs(f,_p7)&&(f=vs(f,_p7.top));}}if(u&&u.bottom>=i?(s=l,r=u):f&&f.top<=i&&(s=o,r=f),!s)return{node:t,offset:0};var c=Math.max(r.left,Math.min(r.right,e));return 3==s.nodeType?ys(s,c,i):a&&"false"!=s.contentEditable?Ms(s,c,i):{node:t,offset:Array.prototype.indexOf.call(t.childNodes,s)+(e>=(r.left+r.right)/2?1:0)};}function ys(t,e,i){var s=t.nodeValue.length,r=-1,n=1e9,h=0;for(var _l28=0;_l28<s;_l28++){var _s68=be(t,_l28,_l28+1).getClientRects();for(var _o22=0;_o22<_s68.length;_o22++){var _u17=_s68[_o22];if(_u17.top==_u17.bottom)continue;h||(h=e-_u17.left);var _f13=(_u17.top>i?_u17.top-i:i-_u17.bottom)-1;if(_u17.left-1<=e&&_u17.right+1>=e&&_f13<n){var _i80=e>=(_u17.left+_u17.right)/2,_s69=_i80;if(qe.chrome||qe.gecko){be(t,_l28).getBoundingClientRect().left==_u17.right&&(_s69=!_i80);}if(_f13<=0)return{node:t,offset:_l28+(_s69?1:0)};r=_l28+(_s69?1:0),n=_f13;}}}return{node:t,offset:r>-1?r:h>0?t.nodeValue.length:0};}function xs(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;var r,n;var h,l=t.contentDOM.getBoundingClientRect(),o=l.top+t.viewState.paddingTop,u=t.viewState.docHeight,f=e.x,a=e.y,c=a-o;if(c<0)return 0;if(c>u)return t.state.doc.length;for(var _e88=t.viewState.heightOracle.textHeight/2,_r59=!1;h=t.elementAtHeight(c),h.type!=ii.Text;)for(;c=s>0?h.bottom+_e88:h.top-_e88,!(c>=0&&c<=u);){if(_r59)return i?null:0;_r59=!0,s=-s;}a=o+c;var d=h.from;if(d<t.viewport.from)return 0==t.viewport.from?0:i?null:Ss(t,l,h,f,a);if(d>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:Ss(t,l,h,f,a);var p=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:p,m=g.elementFromPoint(f,a);m&&!t.contentDOM.contains(m)&&(m=null),m||(f=Math.max(l.left+1,Math.min(l.right-1,f)),m=g.elementFromPoint(f,a),m&&!t.contentDOM.contains(m)&&(m=null));var w,b=-1;if(m&&0!=(null===(r=t.docView.nearest(m))||void 0===r?void 0:r.isEditable)){if(p.caretPositionFromPoint){var _t87;var _t86=p.caretPositionFromPoint(f,a);_t86&&(_t87=_t86,w=_t87.offsetNode,b=_t87.offset,_t87);}else if(p.caretRangeFromPoint){var _e89=p.caretRangeFromPoint(f,a);_e89&&(w=_e89.startContainer,b=_e89.startOffset,(!t.contentDOM.contains(w)||qe.safari&&function(t,e,i){var s;if(3!=t.nodeType||e!=(s=t.nodeValue.length))return!1;for(var _e90=t.nextSibling;_e90;_e90=_e90.nextSibling)if(1!=_e90.nodeType||"BR"!=_e90.nodeName)return!1;return be(t,s-1,s).getBoundingClientRect().left>i;}(w,b,f)||qe.chrome&&function(t,e,i){if(0!=e)return!1;for(var _e91=t;;){var _t88=_e91.parentNode;if(!_t88||1!=_t88.nodeType||_t88.firstChild!=_e91)return!1;if(_t88.classList.contains("cm-line"))break;_e91=_t88;}var s=1==t.nodeType?t.getBoundingClientRect():be(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-s.left>5;}(w,b,f))&&(w=void 0));}w&&(b=Math.min(fe(w),b));}if(!w||!t.docView.dom.contains(w)){var _e92=ui.find(t.docView,d);if(!_e92)return c>h.top+h.height/2?h.to:h.from;var _Ms=Ms(_e92.dom,f,a);w=_Ms.node;b=_Ms.offset;}var v=t.docView.nearest(w);if(!v)return null;if(v.isWidget&&1==(null===(n=v.dom)||void 0===n?void 0:n.nodeType)){var _t89=v.dom.getBoundingClientRect();return e.y<_t89.top||e.y<=_t89.bottom&&e.x<=(_t89.left+_t89.right)/2?v.posAtStart:v.posAtEnd;}return v.localPosFromDOM(w,b)+v.posAtStart;}function Ss(t,e,i,s,r){var n=Math.round((s-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>1.5*t.defaultLineHeight){var _e93=t.viewState.heightOracle.textHeight;n+=Math.floor((r-i.top-.5*(t.defaultLineHeight-_e93))/_e93)*t.viewState.heightOracle.lineLength;}var h=t.state.sliceDoc(i.from,i.to);return i.from+_t(h,n,t.state.tabSize);}function Os(t,e){var i=t.lineBlockAt(e);if(Array.isArray(i.type)){var _iterator50=_createForOfIteratorHelper(i.type),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var _t90=_step50.value;if(_t90.to>e||_t90.to==e&&(_t90.to==i.to||_t90.type==ii.Text))return _t90;}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}}return i;}function Cs(t,e,i,s){var r=t.state.doc.lineAt(e.head),n=t.bidiSpans(r),h=t.textDirectionAt(r.from);for(var _l29=e,_o23=null;;){var _e94=Bi(r,n,h,_l29,i),_u18=Ti;if(!_e94){if(r.number==(i?t.state.doc.lines:1))return _l29;_u18="\n",r=t.state.doc.line(r.number+(i?1:-1)),n=t.bidiSpans(r),_e94=t.visualLineSide(r,!i);}if(_o23){if(!_o23(_u18))return _l29;}else{if(!s)return _e94;_o23=s(_u18);}_l29=_e94;}}function As(t,e,i){var _loop5=function _loop5(){var s=0;var _iterator51=_createForOfIteratorHelper(t),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _r60=_step51.value;_r60.between(e-1,e+1,function(t,r,n){if(e>t&&e<r){var _n53=s||i||(e-t<r-e?-1:1);e=_n53<0?t:r,s=_n53;}});}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}if(!s)return{v:e};},_ret;for(;;){_ret=_loop5();if(_ret)return _ret.v;}}function Ds(t,e,i){var s=As(t.state.facet(ns).map(function(e){return e(t);}),i.from,e.head>i.from?-1:1);return s==i.from?i:P.cursor(s,s<i.from?1:-1);}function Ts(t,e,i){for(;;){if(!e||i<fe(e))return!1;if(e==t)return!0;i=le(e)+1,e=e.parentNode;}}function Ns(t,e){var i,s=e.newSel,r=t.state.selection.main,n=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){var _e$bounds=e.bounds,_s73=_e$bounds.from,_h38=_e$bounds.to,_l31=r.from,_o24=null;(8===n||qe.android&&e.text.length<_h38-_s73)&&(_l31=r.to,_o24="end");var _u19=function(t,e,i,s){var r=Math.min(t.length,e.length),n=0;for(;n<r&&t.charCodeAt(n)==e.charCodeAt(n);)n++;if(n==r&&t.length==e.length)return null;var h=t.length,l=e.length;for(;h>0&&l>0&&t.charCodeAt(h-1)==e.charCodeAt(l-1);)h--,l--;if("end"==s){i-=h+Math.max(0,n-Math.min(h,l))-n;}if(h<n&&t.length<e.length){n-=i<=n&&i>=h?n-i:0,l=n+(l-h),h=n;}else if(l<n){n-=i<=n&&i>=l?n-i:0,h=n+(h-l),l=n;}return{from:n,toA:h,toB:l};}(t.state.doc.sliceString(_s73,_h38,Es),e.text,_l31-_s73,_o24);_u19&&(qe.chrome&&13==n&&_u19.toB==_u19.from+2&&e.text.slice(_u19.from,_u19.toB)==Es+Es&&_u19.toB--,i={from:_s73+_u19.from,to:_s73+_u19.toA,insert:p.of(e.text.slice(_u19.from,_u19.toB).split(Es))});}else s&&(!t.hasFocus&&t.state.facet(Xi)||s.main.eq(r))&&(s=null);if(!i&&!s)return!1;if(!i&&e.typeOver&&!r.empty&&s&&s.main.empty?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,r.to)}:(qe.mac||qe.android)&&i&&i.from==i.to&&i.from==r.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==t.contentDOM.getAttribute("autocorrect")?(s&&2==i.insert.length&&(s=P.single(s.main.anchor-1,s.main.head-1)),i={from:i.from,to:i.to,insert:p.of([i.insert.toString().replace("."," ")])}):i&&i.from>=r.from&&i.to<=r.to&&(i.from!=r.from||i.to!=r.to)&&r.to-r.from-(i.to-i.from)<=4?i={from:r.from,to:r.to,insert:t.state.doc.slice(r.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,r.to))}:qe.chrome&&i&&i.from==i.to&&i.from==r.head&&"\n "==i.insert.toString()&&t.lineWrapping&&(s&&(s=P.single(s.main.anchor-1,s.main.head-1)),i={from:r.from,to:r.to,insert:p.of([" "])}),i)return Ls(t,i,s,n);if(s&&!s.main.eq(r)){var _e99=!1,_i87="select";return t.inputState.lastSelectionTime>Date.now()-50&&("select"==t.inputState.lastSelectionOrigin&&(_e99=!0),_i87=t.inputState.lastSelectionOrigin),t.dispatch({selection:s,scrollIntoView:_e99,userEvent:_i87}),!0;}return!1;}function Ls(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;if(qe.ios&&t.inputState.flushIOSKey(e))return!0;var r=t.state.selection.main;if(qe.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&" "==t.state.sliceDoc(e.from,r.from))&&1==e.insert.length&&2==e.insert.lines&&ve(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&0==e.insert.length||8==s&&e.insert.length<e.to-e.from&&e.to>r.head)&&ve(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&0==e.insert.length&&ve(t.contentDOM,"Delete",46)))return!0;var n,h=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;var l=function l(){return n||(n=function(t,e,i){var s,r=t.state,n=r.selection.main;if(e.from>=n.from&&e.to<=n.to&&e.to-e.from>=(n.to-n.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){var _i88=n.from<e.from?r.sliceDoc(n.from,e.from):"",_h39=n.to>e.to?r.sliceDoc(e.to,n.to):"";s=r.replaceSelection(t.state.toText(_i88+e.insert.sliceString(0,void 0,t.state.lineBreak)+_h39));}else{var _h40=r.changes(e),_l32=i&&i.main.to<=_h40.newLength?i.main:void 0;if(r.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=n.to&&e.to>=n.to-10){var _o25,_u20=t.state.sliceDoc(e.from,e.to),_f14=i&&ps(t,i.main.head);if(_f14){var _t93=e.insert.length-(e.to-e.from);_o25={from:_f14.from,to:_f14.to-_t93};}else _o25=t.state.doc.lineAt(n.head);var _a9=n.to-e.to,_c7=n.to-n.from;s=r.changeByRange(function(i){if(i.from==n.from&&i.to==n.to)return{changes:_h40,range:_l32||i.map(_h40)};var s=i.to-_a9,f=s-_u20.length;if(i.to-i.from!=_c7||t.state.sliceDoc(f,s)!=_u20||i.to>=_o25.from&&i.from<=_o25.to)return{range:i};var d=r.changes({from:f,to:s,insert:e.insert}),p=i.to-n.to;return{changes:d,range:_l32?P.range(Math.max(0,_l32.anchor+p),Math.max(0,_l32.head+p)):i.map(d)};});}else s={changes:_h40,selection:_l32&&r.selection.replaceRange(_l32)};}var h="input.type";(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,h+=".compose",t.inputState.compositionFirstChange&&(h+=".start",t.inputState.compositionFirstChange=!1));return r.update(s,{userEvent:h,scrollIntoView:!0});}(t,e,i));};return t.state.facet(Pi).some(function(i){return i(t,e.from,e.to,h,l);})||t.dispatch(l()),!0;}function zs(t,e){return function(i,s){try{return e.call(t,s,i);}catch(t){_i(i.state,t);}};}function Hs(t){var e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]});}var _iterator58=_createForOfIteratorHelper(t),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var _e100=_step58.value;var _t100=_e100.spec;if(_t100&&_t100.domEventHandlers)for(var _s75 in _t100.domEventHandlers){var _r65=_t100.domEventHandlers[_s75];_r65&&i(_s75).handlers.push(zs(_e100.value,_r65));}if(_t100&&_t100.domEventObservers)for(var _s76 in _t100.domEventObservers){var _r66=_t100.domEventObservers[_s76];_r66&&i(_s76).observers.push(zs(_e100.value,_r66));}}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}for(var _t98 in Vs)i(_t98).handlers.push(Vs[_t98]);for(var _t99 in Js)i(_t99).observers.push(Js[_t99]);return e;}function qs(t){return .7*Math.max(0,t)+8;}function Us(t,e,i){var _iterator59=_createForOfIteratorHelper(t.facet(e)),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var _s78=_step59.value;i=_s78(i,t);}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}return i;}function Ks(t,e){e=Us(t.state,Wi,e);var i,s=t.state,r=1,n=s.toText(e),h=n.lines==s.selection.ranges.length;if(null!=nr&&s.selection.ranges.every(function(t){return t.empty;})&&nr==n.toString()){var _t104=-1;i=s.changeByRange(function(i){var l=s.doc.lineAt(i.from);if(l.from==_t104)return{range:i};_t104=l.from;var o=s.toText((h?n.line(r++).text:e)+s.lineBreak);return{changes:{from:l.from,insert:o},range:P.cursor(i.from+o.length)};});}else i=h?s.changeByRange(function(t){var e=n.line(r++);return{changes:{from:t.from,to:t.to,insert:e.text},range:P.cursor(t.from+e.length)};}):s.replaceSelection(n);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0});}function _s(t,e,i,s){if(1==s)return P.cursor(e,i);if(2==s)return function(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var s=t.charCategorizer(e),r=t.doc.lineAt(e),n=e-r.from;if(0==r.length)return P.cursor(e);0==n?i=1:n==r.length&&(i=-1);var h=n,l=n;i<0?h=S(r.text,n,!1):l=S(r.text,n);var o=s(r.text.slice(h,l));for(;h>0;){var _t105=S(r.text,h,!1);if(s(r.text.slice(_t105,h))!=o)break;h=_t105;}for(;l<r.length;){var _t106=S(r.text,l);if(s(r.text.slice(l,_t106))!=o)break;l=_t106;}return P.range(h+r.from,l+r.from);}(t.state,e,i);{var _i92=ui.find(t.docView,e),_s79=t.state.doc.lineAt(_i92?_i92.posAtEnd:e),_r69=_i92?_i92.posAtStart:_s79.from,_n58=_i92?_i92.posAtEnd:_s79.to;return _n58<t.state.doc.length&&_n58==_s79.to&&_n58++,P.range(_r69,_n58);}}function Ys(t,e,i,s){var r=ui.find(t.docView,e);if(!r)return 1;var n=e-r.posAtStart;if(0==n)return 1;if(n==r.length)return-1;var h=r.coordsAt(n,-1);if(h&&Xs(i,s,h))return-1;var l=r.coordsAt(n,1);return l&&Xs(i,s,l)?1:h&&h.bottom>=s?-1:1;}function Qs(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:i,bias:Ys(t,i,e.clientX,e.clientY)};}function sr(t){if(!Zs)return t.detail;var e=tr,i=ir;return tr=t,ir=Date.now(),er=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(er+1)%3:1;}function rr(t,e,i,s){if(!(i=Us(t.state,Wi,i)))return;var r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.inputState.draggedContent,h=s&&n&&function(t,e){var i=t.state.facet(Li);return i.length?i[0](e):qe.mac?!e.altKey:!e.ctrlKey;}(t,e)?{from:n.from,to:n.to}:null,l={from:r,insert:i},o=t.state.changes(h?[h,l]:l);t.focus(),t.dispatch({changes:o,selection:{anchor:o.mapPos(r,-1),head:o.mapPos(r,1)},userEvent:h?"move.drop":"input.drop"}),t.inputState.draggedContent=null;}function lr(t,e){var i=[];var _iterator63=_createForOfIteratorHelper(t.facet($i)),_step63;try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){var _s87=_step63.value;var _r75=_s87(t,e);_r75&&i.push(_r75);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}return i?t.update({effects:i,annotations:hr.of(!0)}):null;}function or(t){setTimeout(function(){var e=t.hasFocus;if(e!=t.inputState.notifiedFocused){var _i95=lr(t.state,e);_i95?t.dispatch(_i95):t.update([]);}},10);}function cr(){ar=!1;}function vr(t,e){return t==e?t:(t.constructor!=e.constructor&&(ar=!0),e);}function Sr(t,e){var i,s;null==t[e]&&(i=t[e-1])instanceof yr&&(s=t[e+1])instanceof yr&&t.splice(e-1,3,new yr(i.length+1+s.length));}function Ar(t,e){var i=t.getBoundingClientRect(),s=t.ownerDocument,r=s.defaultView||window,n=Math.max(0,i.left),h=Math.min(r.innerWidth,i.right),l=Math.max(0,i.top),o=Math.min(r.innerHeight,i.bottom);for(var _e114=t.parentNode;_e114&&_e114!=s.body;)if(1==_e114.nodeType){var _i102=_e114,_s94=window.getComputedStyle(_i102);if((_i102.scrollHeight>_i102.clientHeight||_i102.scrollWidth>_i102.clientWidth)&&"visible"!=_s94.overflow){var _s95=_i102.getBoundingClientRect();n=Math.max(n,_s95.left),h=Math.min(h,_s95.right),l=Math.max(l,_s95.top),o=Math.min(_e114==t.parentNode?r.innerHeight:o,_s95.bottom);}_e114="absolute"==_s94.position||"fixed"==_s94.position?_i102.offsetParent:_i102.parentNode;}else{if(11!=_e114.nodeType)break;_e114=_e114.host;}return{left:n-i.left,right:Math.max(n,h)-i.left,top:l-(i.top+e),bottom:Math.max(l,o)-(i.top+e)};}function Dr(t,e){var i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)};}function Ir(_ref10,i){var t=_ref10.total,e=_ref10.ranges;if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;var s=Math.floor(t*i);for(var _t124=0;;_t124++){var _e$_t=e[_t124],_i115=_e$_t.from,_r84=_e$_t.to,_n70=_r84-_i115;if(s<=_n70)return _i115+s;s-=_n70;}}function Nr(t,e){var i=0;var _iterator71=_createForOfIteratorHelper(t.ranges),_step71;try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){var _step71$value=_step71.value,_s99=_step71$value.from,_r85=_step71$value.to;if(e<=_r85){i+=e-_s99;break;}i+=_r85-_s99;}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}return i/t.total;}function zr(t,e){if(1==e.scale)return t;var i=e.toDOM(t.top),s=e.toDOM(t.bottom);return new gr(t.from,t.length,i,s-i,Array.isArray(t._content)?t._content.map(function(t){return zr(t,e);}):t._content);}function Vr(t,e,i){return new Zt(e,{finish:function finish(e){return /&/.test(e)?e.replace(/&\w*/,function(e){if("&"==e)return t;if(!i||!i[e])throw new RangeError("Unsupported selector: ".concat(e));return i[e];}):t+" "+e;}});}function _r(t,e,i){for(;e;){var _s103=Ce.get(e);if(_s103&&_s103.parent==t)return _s103;var _r89=e.parentNode;e=_r89!=t.dom?_r89:i>0?e.nextSibling:e.previousSibling;}return null;}function Xr(t,e){var _ref12;var i=e.startContainer,s=e.startOffset,r=e.endContainer,n=e.endOffset,h=t.docView.domAtPos(t.state.selection.main.anchor);return he(h.node,h.offset,r,n)&&(_ref12=[r,n,i,s],i=_ref12[0],s=_ref12[1],r=_ref12[2],n=_ref12[3],_ref12),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:n};}function sn(t,e,i){for(var _s110=t.state.facet(e),_r94=_s110.length-1;_r94>=0;_r94--){var _e137=_s110[_r94],_n74="function"==typeof _e137?_e137(t):_e137;_n74&&Xe(_n74,i);}return i;}function nn(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==i&&e.shiftKey&&(t="Shift-"+t),t;}function un(t){var e=t.facet(ln),i=on.get(e);return i||on.set(e,i=function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:rn;var i=Object.create(null),s=Object.create(null),r=function r(t,e){var i=s[t];if(null==i)s[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix");},n=function n(t,s,_n75,h,l){var o,u;var f=i[t]||(i[t]=Object.create(null)),a=s.split(/ (?!$)/).map(function(t){return function(t,e){var i=t.split(/-(?!$)/);var s,r,n,h,l=i[i.length-1];"Space"==l&&(l=" ");for(var _t154=0;_t154<i.length-1;++_t154){var _l41=i[_t154];if(/^(cmd|meta|m)$/i.test(_l41))h=!0;else if(/^a(lt)?$/i.test(_l41))s=!0;else if(/^(c|ctrl|control)$/i.test(_l41))r=!0;else if(/^s(hift)?$/i.test(_l41))n=!0;else{if(!/^mod$/i.test(_l41))throw new Error("Unrecognized modifier name: "+_l41);"mac"==e?h=!0:r=!0;}}return s&&(l="Alt-"+l),r&&(l="Ctrl-"+l),h&&(l="Meta-"+l),n&&(l="Shift-"+l),l;}(t,e);});var _loop8=function _loop8(){var i=a.slice(0,_e138).join(" ");r(i,!0),f[i]||(f[i]={preventDefault:!0,stopPropagation:!1,run:[function(e){var s=an={view:e,prefix:i,scope:t};return setTimeout(function(){an==s&&(an=null);},cn),!0;}]});};for(var _e138=1;_e138<a.length;_e138++){_loop8();}var c=a.join(" ");r(c,!1);var d=f[c]||(f[c]={preventDefault:!1,stopPropagation:!1,run:(null===(u=null===(o=f._any)||void 0===o?void 0:o.run)||void 0===u?void 0:u.slice())||[]});_n75&&d.run.push(_n75),h&&(d.preventDefault=!0),l&&(d.stopPropagation=!0);};var _iterator97=_createForOfIteratorHelper(t),_step97;try{for(_iterator97.s();!(_step97=_iterator97.n()).done;){var _s111=_step97.value;var _t155=_s111.scope?_s111.scope.split(" "):["editor"];if(_s111.any){var _iterator98=_createForOfIteratorHelper(_t155),_step98;try{var _loop9=function _loop9(){var e=_step98.value;var t=i[e]||(i[e]=Object.create(null));t._any||(t._any={preventDefault:!1,stopPropagation:!1,run:[]});var r=_s111.any;for(var _e139 in t)t[_e139].run.push(function(t){return r(t,dn);});};for(_iterator98.s();!(_step98=_iterator98.n()).done;){_loop9();}}catch(err){_iterator98.e(err);}finally{_iterator98.f();}}var _r95=_s111[e]||_s111.key;if(_r95){var _iterator99=_createForOfIteratorHelper(_t155),_step99;try{for(_iterator99.s();!(_step99=_iterator99.n()).done;){var _e140=_step99.value;n(_e140,_r95,_s111.run,_s111.preventDefault,_s111.stopPropagation),_s111.shift&&n(_e140,"Shift-"+_r95,_s111.shift,_s111.preventDefault,_s111.stopPropagation);}}catch(err){_iterator99.e(err);}finally{_iterator99.f();}}}}catch(err){_iterator97.e(err);}finally{_iterator97.f();}return i;}(e.reduce(function(t,e){return t.concat(e);},[]))),i;}function fn(t,e,i){return pn(un(t.state),e,t,i);}function pn(s,r,n,h){dn=r;var l=t(r),o=A(O(l,0))==l.length&&" "!=l,u="",f=!1,a=!1,c=!1;an&&an.view==n&&an.scope==h&&(u=an.prefix+" ",Ws.indexOf(r.keyCode)<0&&(a=!0,an=null));var d,p,g=new Set(),m=function m(t){if(t){var _iterator100=_createForOfIteratorHelper(t.run),_step100;try{for(_iterator100.s();!(_step100=_iterator100.n()).done;){var _e141=_step100.value;if(!g.has(_e141)&&(g.add(_e141),_e141(n)))return t.stopPropagation&&(c=!0),!0;}}catch(err){_iterator100.e(err);}finally{_iterator100.f();}t.preventDefault&&(t.stopPropagation&&(c=!0),a=!0);}return!1;},w=s[h];return w&&(m(w[u+nn(l,r,!o)])?f=!0:o&&(r.altKey||r.metaKey||r.ctrlKey)&&!(qe.windows&&r.ctrlKey&&r.altKey)&&(d=e[r.keyCode])&&d!=l?(m(w[u+nn(d,r,!0)])||r.shiftKey&&(p=i[r.keyCode])!=l&&p!=d&&m(w[u+nn(p,r,!1)]))&&(f=!0):o&&r.shiftKey&&m(w[u+nn(l,r,!0)])&&(f=!0),!f&&m(w._any)&&(f=!0)),a&&(f=!0),f&&c&&r.stopPropagation(),dn=null,f;}function mn(t){var e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==gi.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY};}function wn(t,e,i,s){var r=t.coordsAtPos(e,2*i);if(!r)return s;var n=t.dom.getBoundingClientRect(),h=(r.top+r.bottom)/2,l=t.posAtCoords({x:n.left+1,y:h}),o=t.posAtCoords({x:n.right-1,y:h});return null==l||null==o?s:{from:Math.max(s.from,Math.min(l,o)),to:Math.min(s.to,Math.max(l,o))};}function kn(t){return[Zi.define(function(e){return new bn(e,t);}),vn.of(t)];}function xn(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[yn.of(t),On,An,En,Vi.of(!0)];}function Sn(t){return t.startState.facet(yn)!=t.state.facet(yn);}function Cn(t,e){e.style.animationDuration=t.facet(yn).cursorBlinkRate+"ms";}function In(){return[Tn,Bn];}function Nn(t,e,i,s,r){e.lastIndex=0;for(var _n78,_h49=t.iterRange(i,s),_l43=i;!_h49.next().done;_l43+=_h49.value.length)if(!_h49.lineBreak)for(;_n78=e.exec(_h49.value);)r(_l43+_n78.index,_n78);}function Wn(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[$n.of(t),qn||(qn=Zi.fromClass(/*#__PURE__*/function(){function _class2(t){_classCallCheck(this,_class2);this.view=t,this.decorations=si.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet($n)),this.decorations=this.decorator.createDeco(t);}return _createClass(_class2,[{key:"makeDecorator",value:function makeDecorator(t){var _this56=this;return new Ln({regexp:t.specialChars,decoration:function decoration(e,i,s){var r=i.state.doc,n=O(e[0],0);if(9==n){var _t158=r.lineAt(s),_e148=i.state.tabSize,_n80=Kt(_t158.text,_e148,s-_t158.from);return si.replace({widget:new Vn((_e148-_n80%_e148)*_this56.view.defaultCharacterWidth/_this56.view.scaleX)});}return _this56.decorationCache[n]||(_this56.decorationCache[n]=si.replace({widget:new Fn(t,n)}));},boundary:t.replaceTabs?void 0:/[^]/});}},{key:"update",value:function update(t){var e=t.state.facet($n);t.startState.facet($n)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations);}}]);}(),{decorations:function decorations(t){return t.decorations;}}))];}function Jn(){return Un;}function _n(t){return Zi.fromClass(/*#__PURE__*/function(){function _class4(e){_classCallCheck(this,_class4);this.view=e,this.placeholder=t?si.set([si.widget({widget:new Kn(t),side:1}).range(0)]):si.none;}return _createClass(_class4,[{key:"decorations",get:function get(){return this.view.state.doc.length?si.none:this.placeholder;}}]);}(),{decorations:function decorations(t){return t.decorations;}});}function Yn(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),s=t.state.doc.lineAt(i),r=i-s.from,n=r>Xn?-1:r==s.length?function(t,e){var i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1;}(t,e.clientX):Kt(s.text,t.state.tabSize,i-s.from);return{line:s.number,col:n,off:r};}function Qn(t,e){var i=Yn(t,e),s=t.state.selection;return i?{update:function update(t){if(t.docChanged){var _e149=t.changes.mapPos(t.startState.doc.line(i.line).from),_r104=t.state.doc.lineAt(_e149);i={line:_r104.number,col:i.col,off:Math.min(i.off,_r104.length)},s=s.map(t.changes);}},get:function get(e,r,n){var h=Yn(t,e);if(!h)return s;var l=function(t,e,i){var s=Math.min(e.line,i.line),r=Math.max(e.line,i.line),n=[];if(e.off>Xn||i.off>Xn||e.col<0||i.col<0){var _h50=Math.min(e.off,i.off),_l45=Math.max(e.off,i.off);for(var _e150=s;_e150<=r;_e150++){var _i130=t.doc.line(_e150);_i130.length<=_l45&&n.push(P.range(_i130.from+_h50,_i130.to+_l45));}}else{var _h51=Math.min(e.col,i.col),_l46=Math.max(e.col,i.col);for(var _e151=s;_e151<=r;_e151++){var _i131=t.doc.line(_e151),_s120=_t(_i131.text,_h51,t.tabSize,!0);if(_s120<0)n.push(P.cursor(_i131.to));else{var _e152=_t(_i131.text,_l46,t.tabSize);n.push(P.range(_i131.from+_s120,_i131.from+_e152));}}}return n;}(t.state,i,h);return l.length?n?P.create(l.concat(s.ranges)):P.create(l):s;}}:null;}function Zn(t){var e=(null==t?void 0:t.eventFilter)||function(t){return t.altKey&&0==t.button;};return Qr.mouseSelectionStyle.of(function(t,i){return e(i)?Qn(t,i):null;});}function ih(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _th=_slicedToArray(th[t.key||"Alt"],2),e=_th[0],i=_th[1],s=Zi.fromClass(/*#__PURE__*/function(){function _class5(t){_classCallCheck(this,_class5);this.view=t,this.isDown=!1;}return _createClass(_class5,[{key:"set",value:function set(t){this.isDown!=t&&(this.isDown=t,this.view.update([]));}}]);}(),{eventObservers:{keydown:function keydown(t){this.set(t.keyCode==e||i(t));},keyup:function keyup(t){t.keyCode!=e&&i(t)||this.set(!1);},mousemove:function mousemove(t){this.set(i(t));}}});return[s,Qr.contentAttributes.of(function(t){var e;return(null===(e=t.plugin(s))||void 0===e?void 0:e.isDown)?eh:null;})];}function nh(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return lh.of(t);}function hh(t){var e=t.win;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth};}function fh(t,e){var i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px");}function vh(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=bt.define(),s=_.define({create:function create(){return[];},update:function update(t,s){if(t.length&&(e.hideOnChange&&(s.docChanged||s.selection)?t=[]:e.hideOn&&(t=t.filter(function(t){return!e.hideOn(s,t);})),s.docChanged)){var _e163=[];var _iterator123=_createForOfIteratorHelper(t),_step123;try{for(_iterator123.s();!(_step123=_iterator123.n()).done;){var _i136=_step123.value;var _t171=s.changes.mapPos(_i136.pos,-1,E.TrackDel);if(null!=_t171){var _r106=Object.assign(Object.create(null),_i136);_r106.pos=_t171,null!=_r106.end&&(_r106.end=s.changes.mapPos(_r106.end)),_e163.push(_r106);}}}catch(err){_iterator123.e(err);}finally{_iterator123.f();}t=_e163;}var _iterator124=_createForOfIteratorHelper(s.effects),_step124;try{for(_iterator124.s();!(_step124=_iterator124.n()).done;){var _e164=_step124.value;_e164.is(i)&&(t=_e164.value),_e164.is(Mh)&&(t=[]);}}catch(err){_iterator124.e(err);}finally{_iterator124.f();}return t;},provide:function provide(t){return ph.from(t);}});return{active:s,extension:[s,Zi.define(function(r){return new wh(r,t,s,i,e.hoverTime||300);}),mh]};}function kh(t,e){var i=t.plugin(uh);if(!i)return null;var s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s];}function xh(t,e){var i=t.plugin(Sh),s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null;}function Ch(t){var e=t.nextSibling;return t.remove(),e;}function Ih(t){return[Lh(),Bh.of(Object.assign(Object.assign({},Th),t))];}function Lh(t){var e=[jh];return t&&!1===t.fixed&&e.push(Nh.of(!0)),e;}function zh(t){return Array.isArray(t)?t:[t];}function Hh(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next();}function Gh(t,e){return t.state.facet(Vh).formatNumber(e,t.state);}function Kh(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[Vh.of(t),Lh(),Uh];}function _h(t){var e=9;for(;e<t;)e=10*e+9;return e;}function Qh(){return Yh;}function dl(t,e,i,s){switch(t){case-2:return i<e;case-1:return s>=e&&i<e;case 0:return i<e&&s>e;case 1:return i<=e&&s>e;case 2:return s>e;case 4:return!0;}}function pl(t,e,i,s){for(var r;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){var _e191=!s&&t instanceof ml&&t.index<0?null:t.parent;if(!_e191)return t;t=_e191;}var n=s?0:ul.IgnoreOverlays;if(s)for(var _s136=t,_h59=_s136.parent;_h59;_s136=_h59,_h59=_s136.parent)_s136 instanceof ml&&_s136.index<0&&(null===(r=_h59.enter(e,i,n))||void 0===r?void 0:r.from)!=_s136.from&&(t=_h59);for(;;){var _s137=t.enter(e,i,n);if(!_s137)return t;t=_s137;}}function wl(t,e,i,s){var r=t.cursor(),n=[];if(!r.firstChild())return n;if(null!=i)for(var _t205=!1;!_t205;)if(_t205=r.type.is(i),!r.nextSibling())return n;for(;;){if(null!=s&&r.type.is(s))return n;if(r.type.is(e)&&n.push(r.node),!r.nextSibling())return null==s?n:[];}}function bl(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.length-1;for(var _s138=t;i>=0;_s138=_s138.parent){if(!_s138)return!1;if(!_s138.type.isAnonymous){if(e[i]&&e[i]!=_s138.name)return!1;i--;}}return!0;}function Ml(t){if(!t.length)return null;var e=0,i=t[0];for(var _s139=1;_s139<t.length;_s139++){var _r119=t[_s139];(_r119.from>i.from||_r119.to<i.to)&&(i=_r119,e=_s139);}var s=i instanceof ml&&i.index<0?null:i.parent,r=t.slice();return s?r[e]=s:r.splice(e,1),new yl(r,i);}function Sl(t){return t.children.some(function(t){return t instanceof cl||!t.type.isAnonymous||Sl(t);});}function Cl(t,e){if(!t.isAnonymous||e instanceof cl||e.type!=t)return 1;var i=Ol.get(e);if(null==i){i=1;var _iterator156=_createForOfIteratorHelper(e.children),_step156;try{for(_iterator156.s();!(_step156=_iterator156.n()).done;){var _s144=_step156.value;if(_s144.type!=t||!(_s144 instanceof fl)){i=1;break;}i+=Cl(t,_s144);}}catch(err){_iterator156.e(err);}finally{_iterator156.f();}Ol.set(e,i);}return i;}function Al(t,e,i,s,r,n,h,l,o){var u=0;for(var _i157=s;_i157<r;_i157++)u+=Cl(t,e[_i157]);var f=Math.ceil(1.5*u/8),a=[],c=[];return function e(i,s,r,h,l){for(var _u28=r;_u28<h;){var _r123=_u28,_d9=s[_u28],_p9=Cl(t,i[_u28]);for(_u28++;_u28<h;_u28++){var _e193=Cl(t,i[_u28]);if(_p9+_e193>=f)break;_p9+=_e193;}if(_u28==_r123+1){if(_p9>f){var _t211=i[_r123];e(_t211.children,_t211.positions,0,_t211.children.length,s[_r123]+l);continue;}a.push(i[_r123]);}else{var _e194=s[_u28-1]+i[_u28-1].length-_d9;a.push(Al(t,i,s,_r123,_u28,_d9,_e194,null,o));}c.push(_d9+l-n);}}(e,i,s,r,0),(l||o)(a,c,h);}function Bl(t){return function(e,i,s,r){return new zl(e,t,i,s,r);};}function Nl(t){if(!t.length||t.some(function(t){return t.from>=t.to;}))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t));}function Hl(t,e,i){var _iterator160=_createForOfIteratorHelper(t),_step160;try{for(_iterator160.s();!(_step160=_iterator160.n()).done;){var _s145=_step160.value;if(_s145.from>=i)break;if(_s145.to>e)return _s145.from<=e&&_s145.to>=i?2:1;}}catch(err){_iterator160.e(err);}finally{_iterator160.f();}return 0;}function Pl(t,e,i,s,r,n){if(e<i){var _h65=t.buffer[e+1];s.push(t.slice(e,i,_h65)),r.push(_h65-n);}}function $l(t){var e=t.node,i=[],s=e.context.buffer;do{i.push(t.index),t.parent();}while(!t.tree);var r=t.tree,n=r.children.indexOf(s),h=r.children[n],l=h.buffer,o=[n];r.children[n]=function t(s,r,n,u,f,a){var c=i[a],d=[],p=[];Pl(h,s,c,d,p,u);var g=l[c+1],m=l[c+2];o.push(d.length);var w=a?t(c+4,l[c+3],h.set.types[l[c]],g,m-g,a-1):e.toTree();return d.push(w),p.push(g-u),Pl(h,l[c+3],r,d,p,u),new fl(n,d,p,f);}(0,l.length,nl.none,0,h.length,i.length-1);for(var _i161=0,_o38=o;_i161<_o38.length;_i161++){var _e198=_o38[_i161];var _i162=t.tree.children[_e198],_s146=t.tree.positions[_e198];t["yield"](new ml(_i162,_s146+t.from,_e198,t._tree));}}function Fl(t,e){var i=null,s=e;for(var _r126=1,_n96=0;_r126<t.length;_r126++){var _h66=t[_r126-1].to,_l58=t[_r126].from;for(;_n96<s.length;_n96++){var _t222=s[_n96];if(_t222.from>=_l58)break;_t222.to<=_h66||(i||(s=i=e.slice()),_t222.from<_h66?(i[_n96]=new el(_t222.from,_h66),_t222.to>_l58&&i.splice(_n96+1,0,new el(_l58,_t222.to))):_t222.to>_l58?i[_n96--]=new el(_l58,_t222.to):i.splice(_n96--,1));}}return s;}function Vl(t,e,i,s){var r=0,n=0,h=!1,l=!1,o=-1e9,u=[];for(;;){var _f22=r==t.length?1e9:h?t[r].to:t[r].from,_a16=n==e.length?1e9:l?e[n].to:e[n].from;if(h!=l){var _t223=Math.max(o,i),_e202=Math.min(_f22,_a16,s);_t223<_e202&&u.push(new el(_t223,_e202));}if(o=Math.min(_f22,_a16),1e9==o)break;_f22==o&&(h?(h=!1,r++):h=!0),_a16==o&&(l?(l=!1,n++):l=!0);}return u;}function Jl(t,e){var i=[];var _iterator161=_createForOfIteratorHelper(t),_step161;try{var _loop14=function _loop14(){var _step161$value=_step161.value,s=_step161$value.pos,r=_step161$value.mount,n=_step161$value.frag;var t=s+(r.overlay?r.overlay[0].from:0),h=t+r.tree.length,l=Math.max(n.from,t),o=Math.min(n.to,h);if(r.overlay){var _h67=Vl(e,r.overlay.map(function(t){return new el(t.from+s,t.to+s);}),l,o);for(var _e203=0,_s147=l;;_e203++){var _l59=_e203==_h67.length,_u30=_l59?o:_h67[_e203].from;if(_u30>_s147&&i.push(new El(_s147,_u30,r.tree,-t,n.from>=_s147||n.openStart,n.to<=_u30||n.openEnd)),_l59)break;_s147=_h67[_e203].to;}}else i.push(new El(l,o,r.tree,-t,n.from>=t||n.openStart,n.to<=h||n.openEnd));};for(_iterator161.s();!(_step161=_iterator161.n()).done;){_loop14();}}catch(err){_iterator161.e(err);}finally{_iterator161.f();}return i;}function Xl(t){var e=Object.create(null);for(var _i166 in t){var _s149=t[_i166];Array.isArray(_s149)||(_s149=[_s149]);var _iterator167=_createForOfIteratorHelper(_i166.split(" ")),_step167;try{for(_iterator167.s();!(_step167=_iterator167.n()).done;){var _t227=_step167.value;if(_t227){var _i167=[],_r128=2,_n97=_t227;for(var _e206=0;;){if("..."==_n97&&_e206>0&&_e206+3==_t227.length){_r128=1;break;}var _s150=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(_n97);if(!_s150)throw new RangeError("Invalid path: "+_t227);if(_i167.push("*"==_s150[0]?"":'"'==_s150[0][0]?JSON.parse(_s150[0]):_s150[0]),_e206+=_s150[0].length,_e206==_t227.length)break;var _h68=_t227[_e206++];if(_e206==_t227.length&&"!"==_h68){_r128=0;break;}if("/"!=_h68)throw new RangeError("Invalid path: "+_t227);_n97=_t227.slice(_e206);}var _h69=_i167.length-1,_l60=_i167[_h69];if(!_l60)throw new RangeError("Invalid path: "+_t227);var _o39=new Ql(_s149,_r128,_h69>0?_i167.slice(0,_h69):null);e[_l60]=_o39.sort(e[_l60]);}}}catch(err){_iterator167.e(err);}finally{_iterator167.f();}}return Yl.add(e);}function Zl(t,e){var i=Object.create(null);var _iterator168=_createForOfIteratorHelper(t),_step168;try{for(_iterator168.s();!(_step168=_iterator168.n()).done;){var _e207=_step168.value;if(Array.isArray(_e207.tag)){var _iterator171=_createForOfIteratorHelper(_e207.tag),_step171;try{for(_iterator171.s();!(_step171=_iterator171.n()).done;){var _t229=_step171.value;i[_t229.id]=_e207["class"];}}catch(err){_iterator171.e(err);}finally{_iterator171.f();}}else i[_e207.tag.id]=_e207["class"];}}catch(err){_iterator168.e(err);}finally{_iterator168.f();}var _ref17=e||{},s=_ref17.scope,_ref17$all=_ref17.all,r=_ref17$all===void 0?null:_ref17$all;return{style:function style(t){var e=r;var _iterator169=_createForOfIteratorHelper(t),_step169;try{for(_iterator169.s();!(_step169=_iterator169.n()).done;){var _s151=_step169.value;var _iterator170=_createForOfIteratorHelper(_s151.set),_step170;try{for(_iterator170.s();!(_step170=_iterator170.n()).done;){var _t228=_step170.value;var _s152=i[_t228.id];if(_s152){e=e?e+" "+_s152:_s152;break;}}}catch(err){_iterator170.e(err);}finally{_iterator170.f();}}}catch(err){_iterator169.e(err);}finally{_iterator169.f();}return e;},scope:s};}function to(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:t.length;var n=new eo(s,Array.isArray(e)?e:[e],i);n.highlightRange(t.cursor(),s,r,"",n.highlighters),n.flush(r);}function Mo(t){return q.define({combine:t?function(e){return e.concat(t);}:void 0});}function So(t,e,i){var s=t.facet(Lo),r=Co(t).topNode;if(!s||s.allowsNesting)for(var _t234=r;_t234;_t234=_t234.enter(e,i,ul.ExcludeBuffers))_t234.type.isTop&&(r=_t234);return r;}function Co(t){var e=t.field(xo.state,!1);return e?e.tree:fl.empty;}function Ro(t,e,i){return El.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}]);}function Po(t){var e=t.facet(Ho);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length;}function $o(t,e){var i="",s=t.tabSize,r=t.facet(Ho)[0];if("\t"==r){for(;e>=s;)i+="\t",e-=s;r=" ";}for(var _t237=0;_t237<e;_t237++)i+=r;return i;}function Wo(t,e){t instanceof Rt&&(t=new qo(t));var _iterator178=_createForOfIteratorHelper(t.state.facet(zo)),_step178;try{for(_iterator178.s();!(_step178=_iterator178.n()).done;){var _i172=_step178.value;var _s158=_i172(t,e);if(void 0!==_s158)return _s158;}}catch(err){_iterator178.e(err);}finally{_iterator178.f();}var i=Co(t.state);return i.length>=e?function(t,e,i){var s=e.resolveStack(i),r=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(r!=s.node){var _t238=[];for(var _e215=r;_e215&&(_e215.from!=s.node.from||_e215.type!=s.node.type);_e215=_e215.parent)_t238.push(_e215);for(var _e216=_t238.length-1;_e216>=0;_e216--)s={node:_t238[_e216],next:s};}return Vo(s,t,i);}(t,i,e):null;}function Vo(t,e,i){for(var _s159=t;_s159;_s159=_s159.next){var _t240=Jo(_s159.node);if(_t240)return _t240(Uo.create(e,i,_s159));}return 0;}function Jo(t){var e=t.type.prop(Fo);if(e)return e;var i,s=t.firstChild;if(s&&(i=s.type.prop(il.closedBy))){var _e217=t.lastChild,_s160=_e217&&i.indexOf(_e217.name)>-1;return function(t){return Xo(t,!0,1,void 0,_s160&&!function(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak;}(t)?_e217.from:void 0);};}return null==t.parent?Go:null;}function Go(){return 0;}function Ko(t,e){for(var _i174=e;_i174;_i174=_i174.parent)if(t==_i174)return!0;return!1;}function _o(_ref18){var t=_ref18.closing,_ref18$align=_ref18.align,e=_ref18$align===void 0?!0:_ref18$align,_ref18$units=_ref18.units,i=_ref18$units===void 0?1:_ref18$units;return function(s){return Xo(s,e,i,t);};}function Xo(t,e,i,s,r){var n=t.textAfter,h=n.match(/^\s*/)[0].length,l=s&&n.slice(h,h+s.length)==s||r==t.pos+h,o=e?function(t){var e=t.node,i=e.childAfter(e.from),s=e.lastChild;if(!i)return null;var r=t.options.simulateBreak,n=t.state.doc.lineAt(i.from),h=null==r||r<=n.from?n.to:Math.min(n.to,r);for(var _t241=i.to;;){var _r131=e.childAfter(_t241);if(!_r131||_r131==s)return null;if(!_r131.type.isSkipped){if(_r131.from>=h)return null;var _t242=/^ */.exec(n.text.slice(i.to-n.from))[0].length;return{from:i.from,to:i.to+_t242};}_t241=_r131.to;}}(t):null;return o?l?t.column(o.from):t.column(o.to):t.baseIndent+(l?0:t.unit*i);}function Qo(){var _ref19=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=_ref19.except,_ref19$units=_ref19.units,e=_ref19$units===void 0?1:_ref19$units;return function(i){var s=t&&t.test(i.textAfter);return i.baseIndent+(s?0:e*i.unit);};}function Zo(){return Rt.transactionFilter.of(function(t){if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;var e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;var i=t.newDoc,s=t.newSelection.main.head,r=i.lineAt(s);if(s>r.from+200)return t;var n=i.sliceString(r.from,s);if(!e.some(function(t){return t.test(n);}))return t;var h=t.state,l=-1,o=[];var _iterator179=_createForOfIteratorHelper(h.selection.ranges),_step179;try{for(_iterator179.s();!(_step179=_iterator179.n()).done;){var _t243=_step179.value.head;var _e218=h.doc.lineAt(_t243);if(_e218.from==l)continue;l=_e218.from;var _i175=Wo(h,_e218.from);if(null==_i175)continue;var _s161=/^\s*/.exec(_e218.text)[0],_r132=$o(h,_i175);_s161!=_r132&&o.push({from:_e218.from,to:_e218.from+_s161.length,insert:_r132});}}catch(err){_iterator179.e(err);}finally{_iterator179.f();}return o.length?[t,{changes:o,sequential:!0}]:t;});}function iu(t){var e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null;}function su(t){var e=t.lastChild;return e&&e.to==t.to&&e.type.isError;}function ru(t,e,i){var _iterator180=_createForOfIteratorHelper(t.facet(tu)),_step180;try{for(_iterator180.s();!(_step180=_iterator180.n()).done;){var _s163=_step180.value;var _r133=_s163(t,e,i);if(_r133)return _r133;}}catch(err){_iterator180.e(err);}finally{_iterator180.f();}return function(t,e,i){var s=Co(t);if(s.length<i)return null;var r=null;for(var _n99=s.resolveStack(i,1);_n99;_n99=_n99.next){var _h70=_n99.node;if(_h70.to<=i||_h70.from>i)continue;if(r&&_h70.from<e)break;var _l61=_h70.type.prop(eu);if(_l61&&(_h70.to<s.length-50||s.length==t.doc.length||!su(_h70))){var _s162=_l61(_h70,t);_s162&&_s162.from<=i&&_s162.from>=e&&_s162.to>i&&(r=_s162);}}return r;}(t,e,i);}function nu(t,e){var i=e.mapPos(t.from,1),s=e.mapPos(t.to,-1);return i>=s?void 0:{from:i,to:s};}function ou(t){var e=[];var _iterator181=_createForOfIteratorHelper(t.state.selection.ranges),_step181;try{var _loop15=function _loop15(){var i=_step181.value.head;e.some(function(t){return t.from<=i&&t.to>=i;})||e.push(t.lineBlockAt(i));};for(_iterator181.s();!(_step181=_iterator181.n()).done;){_loop15();}}catch(err){_iterator181.e(err);}finally{_iterator181.f();}return e;}function fu(t,e,i){var s;var r=null;return null===(s=t.field(uu,!1))||void 0===s||s.between(e,i,function(t,e){(!r||r.from>t)&&(r={from:t,to:e});}),r;}function au(t,e,i){var s=!1;return t.between(e,e,function(t,r){t==e&&r==i&&(s=!0);}),s;}function cu(t,e){return t.field(uu,!1)?e:e.concat(bt.appendConfig.of(wu()));}function du(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var s=t.state.doc.lineAt(e.from).number,r=t.state.doc.lineAt(e.to).number;return Qr.announce.of("".concat(t.state.phrase(i?"Folded lines":"Unfolded lines")," ").concat(s," ").concat(t.state.phrase("to")," ").concat(r,"."));}function wu(t){var e=[uu,Su];return t&&e.push(mu.of(t)),e;}function bu(t,e){var i=t.state,s=i.facet(mu),r=function r(e){var i=t.lineBlockAt(t.posAtDOM(e.target)),s=fu(t.state,i.from,i.to);s&&t.dispatch({effects:lu.of(s)}),e.preventDefault();};if(s.placeholderDOM)return s.placeholderDOM(t,r,e);var n=document.createElement("span");return n.textContent=s.placeholderText,n.setAttribute("aria-label",i.phrase("folded code")),n.title=i.phrase("unfold"),n.className="cm-foldPlaceholder",n.onclick=r,n;}function xu(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=Object.assign(Object.assign({},Mu),t),i=new yu(e,!0),s=new yu(e,!1),r=Zi.fromClass(/*#__PURE__*/function(){function _class13(t){_classCallCheck(this,_class13);this.from=t.viewport.from,this.markers=this.buildMarkers(t);}return _createClass(_class13,[{key:"update",value:function update(t){(t.docChanged||t.viewportChanged||t.startState.facet(Lo)!=t.state.facet(Lo)||t.startState.field(uu,!1)!=t.state.field(uu,!1)||Co(t.startState)!=Co(t.state)||e.foldingChanged(t))&&(this.markers=this.buildMarkers(t.view));}},{key:"buildMarkers",value:function buildMarkers(t){var e=new zt();var _iterator185=_createForOfIteratorHelper(t.viewportLineBlocks),_step185;try{for(_iterator185.s();!(_step185=_iterator185.n()).done;){var _r137=_step185.value;var _n101=fu(t.state,_r137.from,_r137.to)?s:ru(t.state,_r137.from,_r137.to)?i:null;_n101&&e.add(_r137.from,_r137.from,_n101);}}catch(err){_iterator185.e(err);}finally{_iterator185.f();}return e.finish();}}]);}()),n=e.domEventHandlers;return[r,Ih({"class":"cm-foldGutter",markers:function markers(t){var e;return(null===(e=t.plugin(r))||void 0===e?void 0:e.markers)||jt.empty;},initialSpacer:function initialSpacer(){return new yu(e,!1);},domEventHandlers:Object.assign(Object.assign({},n),{click:function click(t,e,i){if(n.click&&n.click(t,e,i))return!0;var s=fu(t.state,e.from,e.to);if(s)return t.dispatch({effects:lu.of(s)}),!0;var r=ru(t.state,e.from,e.to);return!!r&&(t.dispatch({effects:hu.of(r)}),!0);}})}),wu()];}function Du(t){var e=t.facet(Cu);return e.length?e:t.facet(Au);}function Eu(t,e){var i,s=[Tu];return t instanceof Ou&&(t.module&&s.push(Qr.styleModule.of(t.module)),i=t.themeType),(null==e?void 0:e.fallback)?s.push(Au.of(t)):i?s.push(Cu.computeN([Qr.darkTheme],function(e){return e.facet(Qr.darkTheme)==("dark"==i)?[t]:[];})):s.push(Cu.of(t)),s;}function Hu(t){var e=[],i=t.matched?ju:zu;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e;}function Wu(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[Lu.of(t),$u];}function Fu(t,e,i){var s=t.prop(e<0?il.openedBy:il.closedBy);if(s)return s;if(1==t.name.length){var _s170=i.indexOf(t.name);if(_s170>-1&&_s170%2==(e<0?1:0))return[i[_s170+e]];}return null;}function Vu(t){var e=t.type.prop(qu);return e?e(t.node):t;}function Ju(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var r=s.maxScanDistance||1e4,n=s.brackets||Nu,h=Co(t),l=h.resolveInner(e,i);for(var _s171=l;_s171;_s171=_s171.parent){var _r140=Fu(_s171.type,i,n);if(_r140&&_s171.from<_s171.to){var _h71=Vu(_s171);if(_h71&&(i>0?e>=_h71.from&&e<_h71.to:e>_h71.from&&e<=_h71.to))return Gu(t,e,i,_s171,_h71,_r140,n);}}return function(t,e,i,s,r,n,h){var l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),o=h.indexOf(l);if(o<0||o%2==0!=i>0)return null;var u={from:i<0?e-1:e,to:i>0?e+1:e},f=t.doc.iterRange(e,i>0?t.doc.length:0),a=0;for(var _t245=0;!f.next().done&&_t245<=n;){var _n102=f.value;i<0&&(_t245+=_n102.length);var _l62=e+_t245*i;for(var _t246=i>0?0:_n102.length-1,_e220=i>0?_n102.length:-1;_t246!=_e220;_t246+=i){var _e221=h.indexOf(_n102[_t246]);if(!(_e221<0||s.resolveInner(_l62+_t246,1).type!=r))if(_e221%2==0==i>0)a++;else{if(1==a)return{start:u,end:{from:_l62+_t246,to:_l62+_t246+1},matched:_e221>>1==o>>1};a--;}}i>0&&(_t245+=_n102.length);}return f.done?{start:u,matched:!1}:null;}(t,e,i,h,l.type,r,n);}function Gu(t,e,i,s,r,n,h){var l=s.parent,o={from:r.from,to:r.to},u=0,f=null==l?void 0:l.cursor();if(f&&(i<0?f.childBefore(s.from):f.childAfter(s.to)))do{if(i<0?f.to<=s.from:f.from>=s.to){if(0==u&&n.indexOf(f.type.name)>-1&&f.from<f.to){var _t247=Vu(f);return{start:o,end:_t247?{from:_t247.from,to:_t247.to}:void 0,matched:!0};}if(Fu(f.type,i,h))u++;else if(Fu(f.type,-i,h)){if(0==u){var _t248=Vu(f);return{start:o,end:_t248&&_t248.from<_t248.to?{from:_t248.from,to:_t248.to}:void 0,matched:!1};}u--;}}}while(i<0?f.prevSibling():f.nextSibling());return{start:o,matched:!1};}function Qu(t,e){_u.indexOf(t)>-1||(_u.push(t),console.warn(e));}function Zu(t,e){var i=[];var _iterator188=_createForOfIteratorHelper(e.split(" ")),_step188;try{for(_iterator188.s();!(_step188=_iterator188.n()).done;){var _s172=_step188.value;var _e223=[];var _iterator189=_createForOfIteratorHelper(_s172.split(".")),_step189;try{for(_iterator189.s();!(_step189=_iterator189.n()).done;){var _i181=_step189.value;var _s173=t[_i181]||bo[_i181];_s173?"function"==typeof _s173?_e223.length?_e223=_e223.map(_s173):Qu(_i181,"Modifier ".concat(_i181," used at start of tag")):_e223.length?Qu(_i181,"Tag ".concat(_i181," used as modifier")):_e223=Array.isArray(_s173)?_s173:[_s173]:Qu(_i181,"Unknown highlighting tag ".concat(_i181));}}catch(err){_iterator189.e(err);}finally{_iterator189.f();}var _iterator190=_createForOfIteratorHelper(_e223),_step190;try{for(_iterator190.s();!(_step190=_iterator190.n()).done;){var _t250=_step190.value;i.push(_t250);}}catch(err){_iterator190.e(err);}finally{_iterator190.f();}}}catch(err){_iterator188.e(err);}finally{_iterator188.f();}if(!i.length)return 0;var s=e.replace(/ /g,"_"),r=s+" "+i.map(function(t){return t.id;}),n=Xu[r];if(n)return n.id;var h=Xu[r]=nl.define({id:Ku.length,name:s,props:[Xl(_defineProperty({},s,i))]});return Ku.push(h),h.id;}_export({$:Zn,B:kh,K:vh,O:Qh,Q:Wn,U:xu,X:xn,Y:In,Z:Zo,_:Wu,a0:ih,a1:Jn,a8:Xl,ab:Qo,ad:_o,af:iu,ai:Mo,ak:Bl,an:Kh,ao:_n,aq:Eu,ar:nh,c:Tt,e:Kt,g:Wo,i:$o,j:Po,k:S,m:Ju,n:O,o:A,p:xh,r:C,s:Co,w:fn,z:_i,a7:void 0});return{setters:[function(_index008CjsJs){t=_index008CjsJs.k;e=_index008CjsJs.b;i=_index008CjsJs.s;}],execute:function execute(){s=[],r=[];(function(){var t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(function(t){return t?parseInt(t,36):1;});for(var _e3=0,_i3=0;_e3<t.length;_e3++)(_e3%2?r:s).push(_i3+=t[_e3]);})();_export("f",p=/*#__PURE__*/function(){function p(){_classCallCheck(this,p);}return _createClass(p,[{key:"lineAt",value:function lineAt(t){if(t<0||t>this.length)throw new RangeError("Invalid position ".concat(t," in document of length ").concat(this.length));return this.lineInner(t,!1,1,0);}},{key:"line",value:function line(t){if(t<1||t>this.lines)throw new RangeError("Invalid line number ".concat(t," in ").concat(this.lines,"-line document"));return this.lineInner(t,!0,1,0);}},{key:"replace",value:function replace(t,e,i){var _x=x(this,t,e);var _x2=_slicedToArray(_x,2);t=_x2[0];e=_x2[1];var s=[];return this.decompose(0,t,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(e,this.length,s,1),m.from(s,this.length-(e-t)+i.length);}},{key:"append",value:function append(t){return this.replace(this.length,this.length,t);}},{key:"slice",value:function slice(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var _x3=x(this,t,e);var _x4=_slicedToArray(_x3,2);t=_x4[0];e=_x4[1];var i=[];return this.decompose(t,e,i,0),m.from(i,e-t);}},{key:"eq",value:function eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;var e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),s=new v(this),r=new v(t);for(var _t2=e,_n3=e;;){if(s.next(_t2),r.next(_t2),_t2=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(_n3+=s.value.length,s.done||_n3>=i)return!0;}}},{key:"iter",value:function iter(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return new v(this,t);}},{key:"iterRange",value:function iterRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;return new k(this,t,e);}},{key:"iterLines",value:function iterLines(t,e){var i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);var _s4=this.line(t).from;i=this.iterRange(_s4,Math.max(_s4,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to));}return new M(i);}},{key:"toString",value:function toString(){return this.sliceString(0);}},{key:"toJSON",value:function toJSON(){var t=[];return this.flatten(t),t;}}],[{key:"of",value:function of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new g(t):m.from(g.split(t,[])):p.empty;}}]);}());g=/*#__PURE__*/function(_p){function g(t){var _this;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(t){var e=-1;var _iterator=_createForOfIteratorHelper(t),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _i5=_step.value;e+=_i5.length+1;}}catch(err){_iterator.e(err);}finally{_iterator.f();}return e;}(t);_classCallCheck(this,g);_this=_callSuper(this,g),_this.text=t,_this.length=e;return _this;}_inherits(g,_p);return _createClass(g,[{key:"lines",get:function get(){return this.text.length;}},{key:"children",get:function get(){return null;}},{key:"lineInner",value:function lineInner(t,e,i,s){for(var _r3=0;;_r3++){var _n4=this.text[_r3],_h2=s+_n4.length;if((e?i:_h2)>=t)return new y(s,_h2,i,_n4);s=_h2+1,i++;}}},{key:"decompose",value:function decompose(t,e,i,s){var r=t<=0&&e>=this.length?this:new g(b(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(1&s){var _t3=i.pop(),_e4=w(r.text,_t3.text.slice(),0,r.length);if(_e4.length<=32)i.push(new g(_e4,_t3.length+r.length));else{var _t4=_e4.length>>1;i.push(new g(_e4.slice(0,_t4)),new g(_e4.slice(_t4)));}}else i.push(r);}},{key:"replace",value:function replace(t,e,i){if(!(i instanceof g))return _superPropGet(g,"replace",this,3)([t,e,i]);var _x5=x(this,t,e);var _x6=_slicedToArray(_x5,2);t=_x6[0];e=_x6[1];var s=w(this.text,w(i.text,b(this.text,0,t)),e),r=this.length+i.length-(e-t);return s.length<=32?new g(s,r):m.from(g.split(s,[]),r);}},{key:"sliceString",value:function sliceString(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\n";var _x7=x(this,t,e);var _x8=_slicedToArray(_x7,2);t=_x8[0];e=_x8[1];var s="";for(var _r4=0,_n5=0;_r4<=e&&_n5<this.text.length;_n5++){var _h3=this.text[_n5],_l2=_r4+_h3.length;_r4>t&&_n5&&(s+=i),t<_l2&&e>_r4&&(s+=_h3.slice(Math.max(0,t-_r4),e-_r4)),_r4=_l2+1;}return s;}},{key:"flatten",value:function flatten(t){var _iterator2=_createForOfIteratorHelper(this.text),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _e5=_step2.value;t.push(_e5);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}}},{key:"scanIdentical",value:function scanIdentical(){return 0;}}],[{key:"split",value:function split(t,e){var i=[],s=-1;var _iterator3=_createForOfIteratorHelper(t),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _r5=_step3.value;i.push(_r5),s+=_r5.length+1,32==i.length&&(e.push(new g(i,s)),i=[],s=-1);}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}return s>-1&&e.push(new g(i,s)),e;}}]);}(p);m=/*#__PURE__*/function(_p2){function m(t,e){var _this2;_classCallCheck(this,m);_this2=_callSuper(this,m),_this2.children=t,_this2.length=e,_this2.lines=0;var _iterator4=_createForOfIteratorHelper(t),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _e6=_step4.value;_this2.lines+=_e6.lines;}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}return _this2;}_inherits(m,_p2);return _createClass(m,[{key:"lineInner",value:function lineInner(t,e,i,s){for(var _r6=0;;_r6++){var _n6=this.children[_r6],_h4=s+_n6.length,_l3=i+_n6.lines-1;if((e?_l3:_h4)>=t)return _n6.lineInner(t,e,i,s);s=_h4+1,i=_l3+1;}}},{key:"decompose",value:function decompose(t,e,i,s){for(var _r7=0,_n7=0;_n7<=e&&_r7<this.children.length;_r7++){var _h5=this.children[_r7],_l4=_n7+_h5.length;if(t<=_l4&&e>=_n7){var _r8=s&((_n7<=t?1:0)|(_l4>=e?2:0));_n7>=t&&_l4<=e&&!_r8?i.push(_h5):_h5.decompose(t-_n7,e-_n7,i,_r8);}_n7=_l4+1;}}},{key:"replace",value:function replace(t,e,i){var _x9,_x10;if(_x9=x(this,t,e),_x10=_slicedToArray(_x9,2),t=_x10[0],e=_x10[1],i.lines<this.lines)for(var _s5=0,_r9=0;_s5<this.children.length;_s5++){var _n8=this.children[_s5],_h6=_r9+_n8.length;if(t>=_r9&&e<=_h6){var _l5=_n8.replace(t-_r9,e-_r9,i),_o2=this.lines-_n8.lines+_l5.lines;if(_l5.lines<_o2>>4&&_l5.lines>_o2>>6){var _r10=this.children.slice();return _r10[_s5]=_l5,new m(_r10,this.length-(e-t)+i.length);}return _superPropGet(m,"replace",this,3)([_r9,_h6,_l5]);}_r9=_h6+1;}return _superPropGet(m,"replace",this,3)([t,e,i]);}},{key:"sliceString",value:function sliceString(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\n";var _x11=x(this,t,e);var _x12=_slicedToArray(_x11,2);t=_x12[0];e=_x12[1];var s="";for(var _r11=0,_n9=0;_r11<this.children.length&&_n9<=e;_r11++){var _h7=this.children[_r11],_l6=_n9+_h7.length;_n9>t&&_r11&&(s+=i),t<_l6&&e>_n9&&(s+=_h7.sliceString(t-_n9,e-_n9,i)),_n9=_l6+1;}return s;}},{key:"flatten",value:function flatten(t){var _iterator5=_createForOfIteratorHelper(this.children),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _e7=_step5.value;_e7.flatten(t);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}}},{key:"scanIdentical",value:function scanIdentical(t,e){if(!(t instanceof m))return 0;var i=0,_ref=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1],_ref2=_slicedToArray(_ref,4),s=_ref2[0],r=_ref2[1],n=_ref2[2],h=_ref2[3];for(;;s+=e,r+=e){if(s==n||r==h)return i;var _l7=this.children[s],_o3=t.children[r];if(_l7!=_o3)return i+_l7.scanIdentical(_o3,e);i+=_l7.length+1;}}}],[{key:"from",value:function from(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.reduce(function(t,e){return t+e.length+1;},-1);var i=0;var _iterator6=_createForOfIteratorHelper(t),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _e10=_step6.value;i+=_e10.lines;}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}if(i<32){var _i6=[];var _iterator7=_createForOfIteratorHelper(t),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _e8=_step7.value;_e8.flatten(_i6);}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}return new g(_i6,e);}var s=Math.max(32,i>>5),r=s<<1,n=s>>1,h=[],l=0,o=-1,u=[];function f(t){var e;if(t.lines>r&&t instanceof m){var _iterator8=_createForOfIteratorHelper(t.children),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _e9=_step8.value;f(_e9);}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}else t.lines>n&&(l>n||!l)?(a(),h.push(t)):t instanceof g&&l&&(e=u[u.length-1])instanceof g&&t.lines+e.lines<=32?(l+=t.lines,o+=t.length+1,u[u.length-1]=new g(e.text.concat(t.text),e.length+1+t.length)):(l+t.lines>s&&a(),l+=t.lines,o+=t.length+1,u.push(t));}function a(){0!=l&&(h.push(1==u.length?u[0]:m.from(u,o)),o=-1,l=u.length=0);}var _iterator9=_createForOfIteratorHelper(t),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _e11=_step9.value;f(_e11);}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}return a(),1==h.length?h[0]:new m(h,e);}}]);}(p);p.empty=new g([""],0);v=/*#__PURE__*/function(){function v(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,v);this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof g?t.text.length:t.children.length)<<1];}return _createClass(v,[{key:"nextInner",value:function nextInner(t,e){for(this.done=this.lineBreak=!1;;){var _i7=this.nodes.length-1,_s6=this.nodes[_i7],_r13=this.offsets[_i7],_n11=_r13>>1,_h9=_s6 instanceof g?_s6.text.length:_s6.children.length;if(_n11==(e>0?_h9:0)){if(0==_i7)return this.done=!0,this.value="",this;e>0&&this.offsets[_i7-1]++,this.nodes.pop(),this.offsets.pop();}else if((1&_r13)==(e>0?0:1)){if(this.offsets[_i7]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--;}else if(_s6 instanceof g){var _r14=_s6.text[_n11+(e<0?-1:0)];if(this.offsets[_i7]+=e,_r14.length>Math.max(0,t))return this.value=0==t?_r14:e>0?_r14.slice(t):_r14.slice(0,_r14.length-t),this;t-=_r14.length;}else{var _r15=_s6.children[_n11+(e<0?-1:0)];t>_r15.length?(t-=_r15.length,this.offsets[_i7]+=e):(e<0&&this.offsets[_i7]--,this.nodes.push(_r15),this.offsets.push(e>0?1:(_r15 instanceof g?_r15.text.length:_r15.children.length)<<1));}}}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir);}}]);}();k=/*#__PURE__*/function(){function k(t,e,i){_classCallCheck(this,k);this.value="",this.done=!1,this.cursor=new v(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i);}return _createClass(k,[{key:"nextInner",value:function nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);var i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;var _this$cursor$next=this.cursor.next(t),s=_this$cursor$next.value;return this.pos+=(s.length+t)*e,this.value=s.length<=i?s:e<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this;}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir);}},{key:"lineBreak",get:function get(){return this.cursor.lineBreak&&""!=this.value;}}]);}();M=/*#__PURE__*/function(){function M(t){_classCallCheck(this,M);this.inner=t,this.afterBreak=!0,this.value="",this.done=!1;}return _createClass(M,[{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var _this$inner$next=this.inner.next(t),e=_this$inner$next.done,i=_this$inner$next.lineBreak,s=_this$inner$next.value;return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this;}},{key:"lineBreak",get:function get(){return!1;}}]);}();"undefined"!=typeof Symbol&&(p.prototype[Symbol.iterator]=function(){return this.iter();},v.prototype[Symbol.iterator]=k.prototype[Symbol.iterator]=M.prototype[Symbol.iterator]=function(){return this;});y=/*#__PURE__*/function(){function y(t,e,i,s){_classCallCheck(this,y);this.from=t,this.to=e,this.number=i,this.text=s;}return _createClass(y,[{key:"length",get:function get(){return this.to-this.from;}}]);}();D=/\r\n?|\n/;_export("M",E=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t;}(E||_export("M",E={})));_export("a",R=/*#__PURE__*/function(){function R(t){_classCallCheck(this,R);this.sections=t;}return _createClass(R,[{key:"length",get:function get(){var t=0;for(var _e12=0;_e12<this.sections.length;_e12+=2)t+=this.sections[_e12];return t;}},{key:"newLength",get:function get(){var t=0;for(var _e13=0;_e13<this.sections.length;_e13+=2){var _i8=this.sections[_e13+1];t+=_i8<0?this.sections[_e13]:_i8;}return t;}},{key:"empty",get:function get(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0;}},{key:"iterGaps",value:function iterGaps(t){for(var _e14=0,_i9=0,_s7=0;_e14<this.sections.length;){var _r16=this.sections[_e14++],_n12=this.sections[_e14++];_n12<0?(t(_i9,_s7,_r16),_s7+=_r16):_s7+=_n12,_i9+=_r16;}}},{key:"iterChangedRanges",value:function iterChangedRanges(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;N(this,t,e);}},{key:"invertedDesc",get:function get(){var t=[];for(var _e15=0;_e15<this.sections.length;){var _i10=this.sections[_e15++],_s8=this.sections[_e15++];_s8<0?t.push(_i10,_s8):t.push(_s8,_i10);}return new R(t);}},{key:"composeDesc",value:function composeDesc(t){return this.empty?t:t.empty?this:j(this,t);}},{key:"mapDesc",value:function mapDesc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return t.empty?this:L(this,t,e);}},{key:"mapPos",value:function mapPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:E.Simple;var s=0,r=0;for(var _n13=0;_n13<this.sections.length;){var _h10=this.sections[_n13++],_l9=this.sections[_n13++],_o5=s+_h10;if(_l9<0){if(_o5>t)return r+(t-s);r+=_h10;}else{if(i!=E.Simple&&_o5>=t&&(i==E.TrackDel&&s<t&&_o5>t||i==E.TrackBefore&&s<t||i==E.TrackAfter&&_o5>t))return null;if(_o5>t||_o5==t&&e<0&&!_h10)return t==s||e<0?r:r+_l9;r+=_l9;}s=_o5;}if(t>s)throw new RangeError("Position ".concat(t," is out of range for changeset of length ").concat(s));return r;}},{key:"touchesRange",value:function touchesRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;for(var _i11=0,_s9=0;_i11<this.sections.length&&_s9<=e;){var _r17=_s9+this.sections[_i11++];if(this.sections[_i11++]>=0&&_s9<=e&&_r17>=t)return!(_s9<t&&_r17>e)||"cover";_s9=_r17;}return!1;}},{key:"toString",value:function toString(){var t="";for(var _e16=0;_e16<this.sections.length;){var _i12=this.sections[_e16++],_s10=this.sections[_e16++];t+=(t?" ":"")+_i12+(_s10>=0?":"+_s10:"");}return t;}},{key:"toJSON",value:function toJSON(){return this.sections;}}],[{key:"fromJSON",value:function fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(function(t){return"number"!=typeof t;}))throw new RangeError("Invalid JSON representation of ChangeDesc");return new R(t);}},{key:"create",value:function create(t){return new R(t);}}]);}());_export("C",T=/*#__PURE__*/function(_R){function T(t,e){var _this3;_classCallCheck(this,T);_this3=_callSuper(this,T,[t]),_this3.inserted=e;return _this3;}_inherits(T,_R);return _createClass(T,[{key:"apply",value:function apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return N(this,function(e,i,s,r,n){return t=t.replace(s,s+(i-e),n);},!1),t;}},{key:"mapDesc",value:function mapDesc(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return L(this,t,e,!0);}},{key:"invert",value:function invert(t){var e=this.sections.slice(),i=[];for(var _s11=0,_r18=0;_s11<e.length;_s11+=2){var _n14=e[_s11],_h11=e[_s11+1];if(_h11>=0){e[_s11]=_h11,e[_s11+1]=_n14;var _l10=_s11>>1;for(;i.length<_l10;)i.push(p.empty);i.push(_n14?t.slice(_r18,_r18+_n14):p.empty);}_r18+=_n14;}return new T(e,i);}},{key:"compose",value:function compose(t){return this.empty?t:t.empty?this:j(this,t,!0);}},{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return t.empty?this:L(this,t,e,!0);}},{key:"iterChanges",value:function iterChanges(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;N(this,t,e);}},{key:"desc",get:function get(){return R.create(this.sections);}},{key:"filter",value:function filter(t){var e=[],i=[],s=[],r=new z(this);t:for(var _n15=0,_h12=0;;){var _l11=_n15==t.length?1e9:t[_n15++];for(;_h12<_l11||_h12==_l11&&0==r.len;){if(r.done)break t;var _t5=Math.min(r.len,_l11-_h12);B(s,_t5,-1);var _n16=-1==r.ins?-1:0==r.off?r.ins:0;B(e,_t5,_n16),_n16>0&&I(i,e,r.text),r.forward(_t5),_h12+=_t5;}var _o6=t[_n15++];for(;_h12<_o6;){if(r.done)break t;var _t6=Math.min(r.len,_o6-_h12);B(e,_t6,-1),B(s,_t6,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(_t6),_h12+=_t6;}}return{changes:new T(e,i),filtered:R.create(s)};}},{key:"toJSON",value:function toJSON(){var t=[];for(var _e17=0;_e17<this.sections.length;_e17+=2){var _i13=this.sections[_e17],_s12=this.sections[_e17+1];_s12<0?t.push(_i13):0==_s12?t.push([_i13]):t.push([_i13].concat(this.inserted[_e17>>1].toJSON()));}return t;}}],[{key:"of",value:function of(t,e,i){var s=[],r=[],n=0,h=null;function l(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;if(!t&&!s.length)return;n<e&&B(s,e-n,-1);var i=new T(s,r);h=h?h.compose(i.map(h)):i,s=[],r=[],n=0;}return function t(o){if(Array.isArray(o)){var _iterator10=_createForOfIteratorHelper(o),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _e18=_step10.value;t(_e18);}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}else if(o instanceof T){if(o.length!=e)throw new RangeError("Mismatched change set length (got ".concat(o.length,", expected ").concat(e,")"));l(),h=h?h.compose(o.map(h)):o;}else{var _t7=o.from,_o$to=o.to,_h13=_o$to===void 0?_t7:_o$to,_u2=o.insert;if(_t7>_h13||_t7<0||_h13>e)throw new RangeError("Invalid change range ".concat(_t7," to ").concat(_h13," (in doc of length ").concat(e,")"));var _f=_u2?"string"==typeof _u2?p.of(_u2.split(i||D)):_u2:p.empty,_a=_f.length;if(_t7==_h13&&0==_a)return;_t7<n&&l(),_t7>n&&B(s,_t7-n,-1),B(s,_h13-_t7,_a),I(r,s,_f),n=_h13;}}(t),l(!h),h;}},{key:"empty",value:function empty(t){return new T(t?[t,-1]:[],[]);}},{key:"fromJSON",value:function fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");var e=[],i=[];for(var _s13=0;_s13<t.length;_s13++){var _r19=t[_s13];if("number"==typeof _r19)e.push(_r19,-1);else{if(!Array.isArray(_r19)||"number"!=typeof _r19[0]||_r19.some(function(t,e){return e&&"string"!=typeof t;}))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==_r19.length)e.push(_r19[0],0);else{for(;i.length<_s13;)i.push(p.empty);i[_s13]=p.of(_r19.slice(1)),e.push(_r19[0],i[_s13].length);}}}return new T(e,i);}},{key:"createSet",value:function createSet(t,e){return new T(t,e);}}]);}(R));z=/*#__PURE__*/function(){function z(t){_classCallCheck(this,z);this.set=t,this.i=0,this.next();}return _createClass(z,[{key:"next",value:function next(){var t=this.set.sections;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0;}},{key:"done",get:function get(){return-2==this.ins;}},{key:"len2",get:function get(){return this.ins<0?this.len:this.ins;}},{key:"text",get:function get(){var t=this.set.inserted,e=this.i-2>>1;return e>=t.length?p.empty:t[e];}},{key:"textBit",value:function textBit(t){var e=this.set.inserted,i=this.i-2>>1;return i>=e.length&&!t?p.empty:e[i].slice(this.off,null==t?void 0:this.off+t);}},{key:"forward",value:function forward(t){t==this.len?this.next():(this.len-=t,this.off+=t);}},{key:"forward2",value:function forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t);}}]);}();H=/*#__PURE__*/function(){function H(t,e,i){_classCallCheck(this,H);this.from=t,this.to=e,this.flags=i;}return _createClass(H,[{key:"anchor",get:function get(){return 32&this.flags?this.to:this.from;}},{key:"head",get:function get(){return 32&this.flags?this.from:this.to;}},{key:"empty",get:function get(){return this.from==this.to;}},{key:"assoc",get:function get(){return 8&this.flags?-1:16&this.flags?1:0;}},{key:"bidiLevel",get:function get(){var t=7&this.flags;return 7==t?null:t;}},{key:"goalColumn",get:function get(){var t=this.flags>>6;return 16777215==t?void 0:t;}},{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var i,s;return this.empty?i=s=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),s=t.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new H(i,s,this.flags);}},{key:"extend",value:function extend(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(t<=this.anchor&&e>=this.anchor)return P.range(t,e);var i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return P.range(this.anchor,i);}},{key:"eq",value:function eq(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc);}},{key:"toJSON",value:function toJSON(){return{anchor:this.anchor,head:this.head};}}],[{key:"fromJSON",value:function fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return P.range(t.anchor,t.head);}},{key:"create",value:function create(t,e,i){return new H(t,e,i);}}]);}();_export("b",P=/*#__PURE__*/function(){function P(t,e){_classCallCheck(this,P);this.ranges=t,this.mainIndex=e;}return _createClass(P,[{key:"map",value:function map(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;return t.empty?this:P.create(this.ranges.map(function(i){return i.map(t,e);}),this.mainIndex);}},{key:"eq",value:function eq(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(var _i18=0;_i18<this.ranges.length;_i18++)if(!this.ranges[_i18].eq(t.ranges[_i18],e))return!1;return!0;}},{key:"main",get:function get(){return this.ranges[this.mainIndex];}},{key:"asSingle",value:function asSingle(){return 1==this.ranges.length?this:new P([this.main],0);}},{key:"addRange",value:function addRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return P.create([t].concat(this.ranges),e?0:this.mainIndex+1);}},{key:"replaceRange",value:function replaceRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.mainIndex;var i=this.ranges.slice();return i[e]=t,P.create(i,this.mainIndex);}},{key:"toJSON",value:function toJSON(){return{ranges:this.ranges.map(function(t){return t.toJSON();}),main:this.mainIndex};}}],[{key:"fromJSON",value:function fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new P(t.ranges.map(function(t){return H.fromJSON(t);}),t.main);}},{key:"single",value:function single(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;return new P([P.range(t,e)],0);}},{key:"create",value:function create(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(0==t.length)throw new RangeError("A selection needs at least one range");for(var _i19=0,_s14=0;_s14<t.length;_s14++){var _r21=t[_s14];if(_r21.empty?_r21.from<=_i19:_r21.from<_i19)return P.normalized(t.slice(),e);_i19=_r21.to;}return new P(t,e);}},{key:"cursor",value:function cursor(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2?arguments[2]:undefined;var s=arguments.length>3?arguments[3]:undefined;return H.create(t,t,(0==e?0:e<0?8:16)|(null==i?7:Math.min(6,i))|(null!=s?s:16777215)<<6);}},{key:"range",value:function range(t,e,i,s){var r=(null!=i?i:16777215)<<6|(null==s?7:Math.min(6,s));return e<t?H.create(e,t,48|r):H.create(t,e,(e>t?8:0)|r);}},{key:"normalized",value:function normalized(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=t[e];t.sort(function(t,e){return t.from-e.from;}),e=t.indexOf(i);for(var _i20=1;_i20<t.length;_i20++){var _s15=t[_i20],_r22=t[_i20-1];if(_s15.empty?_s15.from<=_r22.to:_s15.from<_r22.to){var _n18=_r22.from,_h15=Math.max(_s15.to,_r22.to);_i20<=e&&e--,t.splice(--_i20,2,_s15.anchor>_s15.head?P.range(_h15,_n18):P.range(_n18,_h15));}}return new P(t,e);}}]);}());W=0;_export("F",q=/*#__PURE__*/function(){function q(t,e,i,s,r){_classCallCheck(this,q);this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=s,this.id=W++,this["default"]=t([]),this.extensions="function"==typeof r?r(this):r;}return _createClass(q,[{key:"reader",get:function get(){return this;}},{key:"of",value:function of(t){return new V([],this,0,t);}},{key:"compute",value:function compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new V(t,this,1,e);}},{key:"computeN",value:function computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new V(t,this,2,e);}},{key:"from",value:function from(t,e){return e||(e=function e(t){return t;}),this.compute([t],function(i){return e(i.field(t));});}}],[{key:"define",value:function define(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new q(t.combine||function(t){return t;},t.compareInput||function(t,e){return t===e;},t.compare||(t.combine?function(t,e){return t===e;}:F),!!t["static"],t.enables);}}]);}());V=/*#__PURE__*/function(){function V(t,e,i,s){_classCallCheck(this,V);this.dependencies=t,this.facet=e,this.type=i,this.value=s,this.id=W++;}return _createClass(V,[{key:"dynamicSlot",value:function dynamicSlot(t){var _this4=this;var e;var i=this.value,s=this.facet.compareInput,r=this.id,n=t[r]>>1,h=2==this.type,l=!1,o=!1,u=[];var _iterator12=_createForOfIteratorHelper(this.dependencies),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var _i22=_step12.value;"doc"==_i22?l=!0:"selection"==_i22?o=!0:1&(null!==(e=t[_i22.id])&&void 0!==e?e:1)||u.push(t[_i22.id]);}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}return{create:function create(t){return t.values[n]=i(t),1;},update:function update(t,e){if(l&&e.docChanged||o&&(e.docChanged||e.selection)||G(t,u)){var _e22=i(t);if(h?!J(_e22,t.values[n],s):!s(_e22,t.values[n]))return t.values[n]=_e22,1;}return 0;},reconfigure:function reconfigure(t,e){var l,o=e.config.address[r];if(null!=o){var _r23=lt(e,o);if(_this4.dependencies.every(function(i){return i instanceof q?e.facet(i)===t.facet(i):!(i instanceof _)||e.field(i,!1)==t.field(i,!1);})||(h?J(l=i(t),_r23,s):s(l=i(t),_r23)))return t.values[n]=_r23,0;}else l=i(t);return t.values[n]=l,1;}};}}]);}();K=q.define({"static":!0});_export("S",_=/*#__PURE__*/function(){function _(t,e,i,s,r){_classCallCheck(this,_);this.id=t,this.createF=e,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0;}return _createClass(_,[{key:"create",value:function create(t){var _this5=this;var e=t.facet(K).find(function(t){return t.field==_this5;});return((null==e?void 0:e.create)||this.createF)(t);}},{key:"slot",value:function slot(t){var _this6=this;var e=t[this.id]>>1;return{create:function create(t){return t.values[e]=_this6.create(t),1;},update:function update(t,i){var s=t.values[e],r=_this6.updateF(s,i);return _this6.compareF(s,r)?0:(t.values[e]=r,1);},reconfigure:function reconfigure(t,i){var s,r=t.facet(K),n=i.facet(K);return(s=r.find(function(t){return t.field==_this6;}))&&s!=n.find(function(t){return t.field==_this6;})?(t.values[e]=s.create(t),1):null!=i.config.address[_this6.id]?(t.values[e]=i.field(_this6),0):(t.values[e]=_this6.create(t),1);}};}},{key:"init",value:function init(t){return[this,K.of({field:this,create:t})];}},{key:"extension",get:function get(){return this;}}],[{key:"define",value:function define(t){var e=new _(W++,t.create,t.update,t.compare||function(t,e){return t===e;},t);return t.provide&&(e.provides=t.provide(e)),e;}}]);}());X=4,Y=3,Q=2,Z=1;_export("P",et={highest:tt(0),high:tt(Z),"default":tt(Q),low:tt(Y),lowest:tt(X)});it=/*#__PURE__*/_createClass(function it(t,e){_classCallCheck(this,it);this.inner=t,this.prec=e;});_export("am",st=/*#__PURE__*/function(){function st(){_classCallCheck(this,st);}return _createClass(st,[{key:"of",value:function of(t){return new rt(this,t);}},{key:"reconfigure",value:function reconfigure(t){return st.reconfigure.of({compartment:this,extension:t});}},{key:"get",value:function get(t){return t.config.compartments.get(this);}}]);}());rt=/*#__PURE__*/_createClass(function rt(t,e){_classCallCheck(this,rt);this.compartment=t,this.inner=e;});nt=/*#__PURE__*/function(){function nt(t,e,i,s,r,n){_classCallCheck(this,nt);for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=n,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0);}return _createClass(nt,[{key:"staticFacet",value:function staticFacet(t){var e=this.address[t.id];return null==e?t["default"]:this.staticValues[e>>1];}}],[{key:"resolve",value:function resolve(t,e,i){var s=[],r=Object.create(null),n=new Map();var _iterator16=_createForOfIteratorHelper(function(t,e,i){var s=[[],[],[],[],[]],r=new Map();function n(t,h){var l=r.get(t);if(null!=l){if(l<=h)return;var _e25=s[l].indexOf(t);_e25>-1&&s[l].splice(_e25,1),t instanceof rt&&i["delete"](t.compartment);}if(r.set(t,h),Array.isArray(t)){var _iterator17=_createForOfIteratorHelper(t),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _e26=_step17.value;n(_e26,h);}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}}else if(t instanceof rt){if(i.has(t.compartment))throw new RangeError("Duplicate use of compartment in extensions");var _s19=e.get(t.compartment)||t.inner;i.set(t.compartment,_s19),n(_s19,h);}else if(t instanceof it)n(t.inner,t.prec);else if(t instanceof _)s[h].push(t),t.provides&&n(t.provides,h);else if(t instanceof V)s[h].push(t),t.facet.extensions&&n(t.facet.extensions,Q);else{var _e27=t.extension;if(!_e27)throw new Error("Unrecognized extension value in extension set (".concat(t,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));n(_e27,h);}}return n(t,Q),s.reduce(function(t,e){return t.concat(e);});}(t,e,n)),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var _i24=_step16.value;_i24 instanceof _?s.push(_i24):(r[_i24.facet.id]||(r[_i24.facet.id]=[])).push(_i24);}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}var h=Object.create(null),l=[],o=[];var _loop=function _loop(){var t=_s18[_i23];h[t.id]=o.length<<1,o.push(function(e){return t.slot(e);});};for(var _i23=0,_s18=s;_i23<_s18.length;_i23++){_loop();}var u=null==i?void 0:i.config.facets;var _loop2=function _loop2(){var e=r[_t13],s=e[0].facet,n=u&&u[_t13]||[];if(e.every(function(t){return 0==t.type;})){if(h[s.id]=l.length<<1|1,F(n,e))l.push(i.facet(s));else{var _t14=s.combine(e.map(function(t){return t.value;}));l.push(i&&s.compare(_t14,i.facet(s))?i.facet(s):_t14);}}else{var _iterator18=_createForOfIteratorHelper(e),_step18;try{var _loop3=function _loop3(){var t=_step18.value;0==t.type?(h[t.id]=l.length<<1|1,l.push(t.value)):(h[t.id]=o.length<<1,o.push(function(e){return t.dynamicSlot(e);}));};for(_iterator18.s();!(_step18=_iterator18.n()).done;){_loop3();}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}h[s.id]=o.length<<1,o.push(function(t){return U(t,s,e);});}};for(var _t13 in r){_loop2();}var f=o.map(function(t){return t(h);});return new nt(t,n,f,h,l,r);}}]);}();ot=q.define(),ut=q.define({combine:function combine(t){return t.some(function(t){return t;});},"static":!0}),ft=q.define({combine:function combine(t){return t.length?t[0]:void 0;},"static":!0}),at=q.define(),ct=q.define(),dt=q.define(),pt=q.define({combine:function combine(t){return!!t.length&&t[0];}});_export("A",gt=/*#__PURE__*/function(){function gt(t,e){_classCallCheck(this,gt);this.type=t,this.value=e;}return _createClass(gt,null,[{key:"define",value:function define(){return new mt();}}]);}());mt=/*#__PURE__*/function(){function mt(){_classCallCheck(this,mt);}return _createClass(mt,[{key:"of",value:function of(t){return new gt(this,t);}}]);}();wt=/*#__PURE__*/function(){function wt(t){_classCallCheck(this,wt);this.map=t;}return _createClass(wt,[{key:"of",value:function of(t){return new bt(this,t);}}]);}();_export("d",bt=/*#__PURE__*/function(){function bt(t,e){_classCallCheck(this,bt);this.type=t,this.value=e;}return _createClass(bt,[{key:"map",value:function map(t){var e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new bt(this.type,e);}},{key:"is",value:function is(t){return this.type==t;}}],[{key:"define",value:function define(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new wt(t.map||function(t){return t;});}},{key:"mapEffects",value:function mapEffects(t,e){if(!t.length)return t;var i=[];var _iterator19=_createForOfIteratorHelper(t),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var _s20=_step19.value;var _t15=_s20.map(e);_t15&&i.push(_t15);}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}return i;}}]);}());bt.reconfigure=bt.define(),bt.appendConfig=bt.define();_export("T",vt=/*#__PURE__*/function(){function vt(t,e,i,s,r,n){_classCallCheck(this,vt);this.startState=t,this.changes=e,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=n,this._doc=null,this._state=null,i&&$(i,e.newLength),r.some(function(t){return t.type==vt.time;})||(this.annotations=r.concat(vt.time.of(Date.now())));}return _createClass(vt,[{key:"newDoc",get:function get(){return this._doc||(this._doc=this.changes.apply(this.startState.doc));}},{key:"newSelection",get:function get(){return this.selection||this.startState.selection.map(this.changes);}},{key:"state",get:function get(){return this._state||this.startState.applyTransaction(this),this._state;}},{key:"annotation",value:function annotation(t){var _iterator20=_createForOfIteratorHelper(this.annotations),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var _e28=_step20.value;if(_e28.type==t)return _e28.value;}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}}},{key:"docChanged",get:function get(){return!this.changes.empty;}},{key:"reconfigured",get:function get(){return this.startState.config!=this.state.config;}},{key:"isUserEvent",value:function isUserEvent(t){var e=this.annotation(vt.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]));}}],[{key:"create",value:function create(t,e,i,s,r,n){return new vt(t,e,i,s,r,n);}}]);}());vt.time=gt.define(),vt.userEvent=gt.define(),vt.addToHistory=gt.define(),vt.remote=gt.define();St=[];_export("q",Ct=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t;}(Ct||_export("q",Ct={})));At=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{Dt=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u");}catch(t){}_export("v",Rt=/*#__PURE__*/function(){function Rt(t,e,i,s,r,n){_classCallCheck(this,Rt);this.config=t,this.doc=e,this.selection=i,this.values=s,this.status=t.statusTemplate.slice(),this.computeSlot=r,n&&(n._state=this);for(var _t16=0;_t16<this.config.dynamicSlots.length;_t16++)ht(this,_t16<<1);this.computeSlot=null;}return _createClass(Rt,[{key:"field",value:function field(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var i=this.config.address[t.id];if(null!=i)return ht(this,i),lt(this,i);if(e)throw new RangeError("Field is not present in this state");}},{key:"update",value:function update(){for(var _len=arguments.length,t=new Array(_len),_key=0;_key<_len;_key++){t[_key]=arguments[_key];}return xt(this,t,!0);}},{key:"applyTransaction",value:function applyTransaction(t){var _this7=this;var e,i=this.config,_i28=i,s=_i28.base,r=_i28.compartments;var _iterator22=_createForOfIteratorHelper(t.effects),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var _e32=_step22.value;_e32.is(st.reconfigure)?(i&&(r=new Map(),i.compartments.forEach(function(t,e){return r.set(e,t);}),i=null),r.set(_e32.value.compartment,_e32.value.extension)):_e32.is(bt.reconfigure)?(i=null,s=_e32.value):_e32.is(bt.appendConfig)&&(i=null,s=Ot(s).concat(_e32.value));}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}if(i)e=t.startState.values.slice();else{i=nt.resolve(s,r,this),e=new Rt(i,this.doc,this.selection,i.dynamicSlots.map(function(){return null;}),function(t,e){return e.reconfigure(t,_this7);},null).values;}var n=t.startState.facet(ut)?t.newSelection:t.newSelection.asSingle();new Rt(i,t.newDoc,n,e,function(e,i){return i.update(e,t);},t);}},{key:"replaceSelection",value:function replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(function(e){return{changes:{from:e.from,to:e.to,insert:t},range:P.cursor(e.from+t.length)};});}},{key:"changeByRange",value:function changeByRange(t){var e=this.selection,i=t(e.ranges[0]),s=this.changes(i.changes),r=[i.range],n=Ot(i.effects);for(var _i29=1;_i29<e.ranges.length;_i29++){var _h17=t(e.ranges[_i29]),_l13=this.changes(_h17.changes),_o8=_l13.map(s);for(var _t17=0;_t17<_i29;_t17++)r[_t17]=r[_t17].map(_o8);var _u4=s.mapDesc(_l13,!0);r.push(_h17.range.map(_u4)),s=s.compose(_o8),n=bt.mapEffects(n,_o8).concat(bt.mapEffects(Ot(_h17.effects),_u4));}return{changes:s,selection:P.create(r,e.mainIndex),effects:n};}},{key:"changes",value:function changes(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return t instanceof T?t:T.of(t,this.doc.length,this.facet(Rt.lineSeparator));}},{key:"toText",value:function toText(t){return p.of(t.split(this.facet(Rt.lineSeparator)||D));}},{key:"sliceDoc",value:function sliceDoc(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.doc.length;return this.doc.sliceString(t,e,this.lineBreak);}},{key:"facet",value:function facet(t){var e=this.config.address[t.id];return null==e?t["default"]:(ht(this,e),lt(this,e));}},{key:"toJSON",value:function toJSON(t){var e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(var _i30 in t){var _s24=t[_i30];_s24 instanceof _&&null!=this.config.address[_s24.id]&&(e[_i30]=_s24.spec.toJSON(this.field(t[_i30]),this));}return e;}},{key:"tabSize",get:function get(){return this.facet(Rt.tabSize);}},{key:"lineBreak",get:function get(){return this.facet(Rt.lineSeparator)||"\n";}},{key:"readOnly",get:function get(){return this.facet(pt);}},{key:"phrase",value:function phrase(t){for(var _len2=arguments.length,e=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){e[_key2-1]=arguments[_key2];}var _iterator23=_createForOfIteratorHelper(this.facet(Rt.phrases)),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _e33=_step23.value;if(Object.prototype.hasOwnProperty.call(_e33,t)){t=_e33[t];break;}}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return e.length&&(t=t.replace(/\$(\$|\d*)/g,function(t,i){if("$"==i)return"$";var s=+(i||1);return!s||s>e.length?t:e[s-1];})),t;}},{key:"languageDataAt",value:function languageDataAt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var s=[];var _iterator24=_createForOfIteratorHelper(this.facet(ot)),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _r29=_step24.value;var _iterator25=_createForOfIteratorHelper(_r29(this,e,i)),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _n23=_step25.value;Object.prototype.hasOwnProperty.call(_n23,t)&&s.push(_n23[t]);}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}return s;}},{key:"charCategorizer",value:function charCategorizer(t){return Et(this.languageDataAt("wordChars",t).join(""));}},{key:"wordAt",value:function wordAt(t){var _this$doc$lineAt=this.doc.lineAt(t),e=_this$doc$lineAt.text,i=_this$doc$lineAt.from,s=_this$doc$lineAt.length,r=this.charCategorizer(t),n=t-i,h=t-i;for(;n>0;){var _t18=S(e,n,!1);if(r(e.slice(_t18,n))!=Ct.Word)break;n=_t18;}for(;h<s;){var _t19=S(e,h);if(r(e.slice(h,_t19))!=Ct.Word)break;h=_t19;}return n==h?null:P.range(n+i,h+i);}}],[{key:"fromJSON",value:function fromJSON(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var i=arguments.length>2?arguments[2]:undefined;if(!t||"string"!=typeof t.doc)throw new RangeError("Invalid JSON representation for EditorState");var s=[];if(i){var _loop4=function _loop4(){if(Object.prototype.hasOwnProperty.call(t,_e34)){var _r30=i[_e34],_n24=t[_e34];s.push(_r30.init(function(t){return _r30.spec.fromJSON(_n24,t);}));}};for(var _e34 in i){_loop4();}}return Rt.create({doc:t.doc,selection:P.fromJSON(t.selection),extensions:e.extensions?s.concat([e.extensions]):s});}},{key:"create",value:function create(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=nt.resolve(t.extensions||[],new Map()),i=t.doc instanceof p?t.doc:p.of((t.doc||"").split(e.staticFacet(Rt.lineSeparator)||D)),s=t.selection?t.selection instanceof P?t.selection:P.single(t.selection.anchor,t.selection.head):P.single(0);return $(s,i.length),e.staticFacet(ut)||(s=s.asSingle()),new Rt(e,i,s,e.dynamicSlots.map(function(){return null;}),function(t,e){return e.create(t);},null);}}]);}());Rt.allowMultipleSelections=ut,Rt.tabSize=q.define({combine:function combine(t){return t.length?t[0]:4;}}),Rt.lineSeparator=ft,Rt.readOnly=pt,Rt.phrases=q.define({compare:function compare(t,e){var i=Object.keys(t),s=Object.keys(e);return i.length==s.length&&i.every(function(i){return t[i]==e[i];});}}),Rt.languageData=ot,Rt.changeFilter=at,Rt.transactionFilter=ct,Rt.transactionExtender=dt,st.reconfigure=bt.define();_export("G",Bt=/*#__PURE__*/function(){function Bt(){_classCallCheck(this,Bt);}return _createClass(Bt,[{key:"eq",value:function eq(t){return this==t;}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;return It.create(t,e,this);}}]);}());Bt.prototype.startSide=Bt.prototype.endSide=0,Bt.prototype.point=!1,Bt.prototype.mapMode=E.TrackDel;It=/*#__PURE__*/function(){function t(_t22,e,i){_classCallCheck(this,t);this.from=_t22,this.to=e,this.value=i;}return _createClass(t,null,[{key:"create",value:function create(e,i,s){return new t(e,i,s);}}]);}();Lt=/*#__PURE__*/function(){function Lt(t,e,i,s){_classCallCheck(this,Lt);this.from=t,this.to=e,this.value=i,this.maxPoint=s;}return _createClass(Lt,[{key:"length",get:function get(){return this.to[this.to.length-1];}},{key:"findIndex",value:function findIndex(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var r=i?this.to:this.from;for(var _n26=s,_h18=r.length;;){if(_n26==_h18)return _n26;var _s25=_n26+_h18>>1,_l14=r[_s25]-t||(i?this.value[_s25].endSide:this.value[_s25].startSide)-e;if(_s25==_n26)return _l14>=0?_n26:_h18;_l14>=0?_h18=_s25:_n26=_s25+1;}}},{key:"between",value:function between(t,e,i,s){for(var _r32=this.findIndex(e,-1e9,!0),_n27=this.findIndex(i,1e9,!1,_r32);_r32<_n27;_r32++)if(!1===s(this.from[_r32]+t,this.to[_r32]+t,this.value[_r32]))return!1;}},{key:"map",value:function map(t,e){var i=[],s=[],r=[],n=-1,h=-1;for(var _l15=0;_l15<this.value.length;_l15++){var _o9=void 0,_u5=void 0,_f3=this.value[_l15],_a3=this.from[_l15]+t,_c=this.to[_l15]+t;if(_a3==_c){var _t23=e.mapPos(_a3,_f3.startSide,_f3.mapMode);if(null==_t23)continue;if(_o9=_u5=_t23,_f3.startSide!=_f3.endSide&&(_u5=e.mapPos(_a3,_f3.endSide),_u5<_o9))continue;}else if(_o9=e.mapPos(_a3,_f3.startSide),_u5=e.mapPos(_c,_f3.endSide),_o9>_u5||_o9==_u5&&_f3.startSide>0&&_f3.endSide<=0)continue;(_u5-_o9||_f3.endSide-_f3.startSide)<0||(n<0&&(n=_o9),_f3.point&&(h=Math.max(h,_u5-_o9)),i.push(_f3),s.push(_o9-n),r.push(_u5-n));}return{mapped:i.length?new Lt(s,r,i,h):null,pos:n};}}]);}();_export("J",jt=/*#__PURE__*/function(){function jt(t,e,i,s){_classCallCheck(this,jt);this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=s;}return _createClass(jt,[{key:"length",get:function get(){var t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length);}},{key:"size",get:function get(){if(this.isEmpty)return 0;var t=this.nextLayer.size;var _iterator27=_createForOfIteratorHelper(this.chunk),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var _e36=_step27.value;t+=_e36.value.length;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return t;}},{key:"chunkEnd",value:function chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length;}},{key:"update",value:function update(t){var _t$add=t.add,e=_t$add===void 0?[]:_t$add,_t$sort=t.sort,i=_t$sort===void 0?!1:_t$sort,_t$filterFrom=t.filterFrom,s=_t$filterFrom===void 0?0:_t$filterFrom,_t$filterTo=t.filterTo,r=_t$filterTo===void 0?this.length:_t$filterTo,n=t.filter;if(0==e.length&&!n)return this;if(i&&(e=e.slice().sort(Nt)),this.isEmpty)return e.length?jt.of(e):this;var h=new Pt(this,null,-1)["goto"](0),l=0,o=[],u=new zt();for(;h.value||l<e.length;)if(l<e.length&&(h.from-e[l].from||h.startSide-e[l].value.startSide)>=0){var _t24=e[l++];u.addInner(_t24.from,_t24.to,_t24.value)||o.push(_t24);}else 1==h.rangeIndex&&h.chunkIndex<this.chunk.length&&(l==e.length||this.chunkEnd(h.chunkIndex)<e[l].from)&&(!n||s>this.chunkEnd(h.chunkIndex)||r<this.chunkPos[h.chunkIndex])&&u.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!n||s>h.to||r<h.from||n(h.from,h.to,h.value))&&(u.addInner(h.from,h.to,h.value)||o.push(It.create(h.from,h.to,h.value))),h.next());return u.finishInner(this.nextLayer.isEmpty&&!o.length?jt.empty:this.nextLayer.update({add:o,filter:n,filterFrom:s,filterTo:r}));}},{key:"map",value:function map(t){if(t.empty||this.isEmpty)return this;var e=[],i=[],s=-1;for(var _r33=0;_r33<this.chunk.length;_r33++){var _n28=this.chunkPos[_r33],_h19=this.chunk[_r33],_l16=t.touchesRange(_n28,_n28+_h19.length);if(!1===_l16)s=Math.max(s,_h19.maxPoint),e.push(_h19),i.push(t.mapPos(_n28));else if(!0===_l16){var _h19$map=_h19.map(_n28,t),_r34=_h19$map.mapped,_l17=_h19$map.pos;_r34&&(s=Math.max(s,_r34.maxPoint),e.push(_r34),i.push(_l17));}}var r=this.nextLayer.map(t);return 0==e.length?r:new jt(i,e,r||jt.empty,s);}},{key:"between",value:function between(t,e,i){if(!this.isEmpty){for(var _s26=0;_s26<this.chunk.length;_s26++){var _r35=this.chunkPos[_s26],_n29=this.chunk[_s26];if(e>=_r35&&t<=_r35+_n29.length&&!1===_n29.between(_r35,t-_r35,e-_r35,i))return;}this.nextLayer.between(t,e,i);}}},{key:"iter",value:function iter(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return $t.from([this])["goto"](t);}},{key:"isEmpty",get:function get(){return this.nextLayer==this;}}],[{key:"create",value:function create(t,e,i,s){return new jt(t,e,i,s);}},{key:"iter",value:function iter(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return $t.from(t)["goto"](e);}},{key:"compare",value:function compare(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;var n=t.filter(function(t){return t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r;}),h=e.filter(function(t){return t.maxPoint>0||!t.isEmpty&&t.maxPoint>=r;}),l=Ht(n,h,i),o=new qt(n,l,r),u=new qt(h,l,r);i.iterGaps(function(t,e,i){return Ft(o,t,u,e,i,s);}),i.empty&&0==i.length&&Ft(o,0,u,0,0,s);}},{key:"eq",value:function eq(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=arguments.length>3?arguments[3]:undefined;null==s&&(s=999999999);var r=t.filter(function(t){return!t.isEmpty&&e.indexOf(t)<0;}),n=e.filter(function(e){return!e.isEmpty&&t.indexOf(e)<0;});if(r.length!=n.length)return!1;if(!r.length)return!0;var h=Ht(r,n),l=new qt(r,h,0)["goto"](i),o=new qt(n,h,0)["goto"](i);for(;;){if(l.to!=o.to||!Vt(l.active,o.active)||l.point&&(!o.point||!l.point.eq(o.point)))return!1;if(l.to>s)return!0;l.next(),o.next();}}},{key:"spans",value:function spans(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;var n=new qt(t,null,r)["goto"](e),h=e,l=n.openStart;for(;;){var _t25=Math.min(n.to,i);if(n.point){var _i32=n.activeForPoint(n.to),_r36=n.pointFrom<e?_i32.length+1:n.point.startSide<0?_i32.length:Math.min(_i32.length,l);s.point(h,_t25,n.point,_i32,_r36,n.pointRank),l=Math.min(n.openEnd(_t25),_i32.length);}else _t25>h&&(s.span(h,_t25,n.active,l),l=n.openEnd(_t25));if(n.to>i)return l+(n.point&&n.to>i?1:0);h=n.to,n.next();}}},{key:"of",value:function of(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var i=new zt();var _iterator28=_createForOfIteratorHelper(t instanceof It?[t]:e?function(t){if(t.length>1)for(var _e37=t[0],_i33=1;_i33<t.length;_i33++){var _s27=t[_i33];if(Nt(_e37,_s27)>0)return t.slice().sort(Nt);_e37=_s27;}return t;}(t):t),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var _s28=_step28.value;i.add(_s28.from,_s28.to,_s28.value);}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}return i.finish();}},{key:"join",value:function join(t){if(!t.length)return jt.empty;var e=t[t.length-1];for(var _i34=t.length-2;_i34>=0;_i34--)for(var _s29=t[_i34];_s29!=jt.empty;_s29=_s29.nextLayer)e=new jt(_s29.chunkPos,_s29.chunk,e,Math.max(_s29.maxPoint,e.maxPoint));return e;}}]);}());jt.empty=new jt([],[],null,-1),jt.empty.nextLayer=jt.empty;_export("R",zt=/*#__PURE__*/function(){function zt(){_classCallCheck(this,zt);this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null;}return _createClass(zt,[{key:"finishChunk",value:function finishChunk(t){this.chunks.push(new Lt(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[]);}},{key:"add",value:function add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new zt())).add(t,e,i);}},{key:"addInner",value:function addInner(t,e,i){var s=t-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(s<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0);}},{key:"addChunk",value:function addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0;}},{key:"finish",value:function finish(){return this.finishInner(jt.empty);}},{key:"finishInner",value:function finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;var e=jt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e;}}]);}());Pt=/*#__PURE__*/function(){function Pt(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,Pt);this.layer=t,this.skip=e,this.minPoint=i,this.rank=s;}return _createClass(Pt,[{key:"startSide",get:function get(){return this.value?this.value.startSide:0;}},{key:"endSide",get:function get(){return this.value?this.value.endSide:0;}},{key:"goto",value:function _goto(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this;}},{key:"gotoInner",value:function gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){var _e40=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(_e40)||this.layer.chunkEnd(this.chunkIndex)<t||_e40.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1;}if(this.chunkIndex<this.layer.chunk.length){var _s30=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<_s30)&&this.setRangeIndex(_s30);}this.next();}},{key:"forward",value:function forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0);}},{key:"next",value:function next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break;}{var _t28=this.layer.chunkPos[this.chunkIndex],_e41=this.layer.chunk[this.chunkIndex],_i35=_t28+_e41.from[this.rangeIndex];if(this.from=_i35,this.to=_t28+_e41.to[this.rangeIndex],this.value=_e41.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break;}}}},{key:"setRangeIndex",value:function setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0;}else this.rangeIndex=t;}},{key:"nextChunk",value:function nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next();}},{key:"compare",value:function compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide;}}]);}();$t=/*#__PURE__*/function(){function $t(t){_classCallCheck(this,$t);this.heap=t;}return _createClass($t,[{key:"startSide",get:function get(){return this.value?this.value.startSide:0;}},{key:"goto",value:function _goto2(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;var _iterator31=_createForOfIteratorHelper(this.heap),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _i36=_step31.value;_i36["goto"](t,e);}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}for(var _t29=this.heap.length>>1;_t29>=0;_t29--)Wt(this.heap,_t29);return this.next(),this;}},{key:"forward",value:function forward(t,e){var _iterator32=_createForOfIteratorHelper(this.heap),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _i37=_step32.value;_i37.forward(t,e);}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}for(var _t30=this.heap.length>>1;_t30>=0;_t30--)Wt(this.heap,_t30);(this.to-t||this.value.endSide-e)<0&&this.next();}},{key:"next",value:function next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var _t31=this.heap[0];this.from=_t31.from,this.to=_t31.to,this.value=_t31.value,this.rank=_t31.rank,_t31.value&&_t31.next(),Wt(this.heap,0);}}}],[{key:"from",value:function from(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var s=[];for(var _r37=0;_r37<t.length;_r37++)for(var _n31=t[_r37];!_n31.isEmpty;_n31=_n31.nextLayer)_n31.maxPoint>=i&&s.push(new Pt(_n31,e,i,_r37));return 1==s.length?s[0]:new $t(s);}}]);}();qt=/*#__PURE__*/function(){function qt(t,e,i){_classCallCheck(this,qt);this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=$t.from(t,e,i);}return _createClass(qt,[{key:"goto",value:function _goto3(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1e9;return this.cursor["goto"](t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this;}},{key:"forward",value:function forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e);}},{key:"removeActive",value:function removeActive(t){Jt(this.active,t),Jt(this.activeTo,t),Jt(this.activeRank,t),this.minActive=Ut(this.active,this.activeTo);}},{key:"addActive",value:function addActive(t){var e=0,_this$cursor=this.cursor,i=_this$cursor.value,s=_this$cursor.to,r=_this$cursor.rank;for(;e<this.activeRank.length&&(r-this.activeRank[e]||s-this.activeTo[e])>0;)e++;Gt(this.active,e,i),Gt(this.activeTo,e,s),Gt(this.activeRank,e,r),t&&Gt(t,e,this.cursor.from),this.minActive=Ut(this.active,this.activeTo);}},{key:"next",value:function next(){var t=this.to,e=this.point;this.point=null;var i=this.openStart<0?[]:null;for(;;){var _s32=this.minActive;if(_s32>-1&&(this.activeTo[_s32]-this.cursor.from||this.active[_s32].endSide-this.cursor.startSide)<0){if(this.activeTo[_s32]>t){this.to=this.activeTo[_s32],this.endSide=this.active[_s32].endSide;break;}this.removeActive(_s32),i&&Jt(i,_s32);}else{if(!this.cursor.value){this.to=this.endSide=1e9;break;}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break;}{var _t32=this.cursor.value;if(_t32.point){if(!(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)){this.point=_t32,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=_t32.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break;}this.cursor.next();}else this.addActive(i),this.cursor.next();}}}if(i){this.openStart=0;for(var _e42=i.length-1;_e42>=0&&i[_e42]<t;_e42--)this.openStart++;}}},{key:"activeForPoint",value:function activeForPoint(t){if(!this.active.length)return this.active;var e=[];for(var _i39=this.active.length-1;_i39>=0&&!(this.activeRank[_i39]<this.pointRank);_i39--)(this.activeTo[_i39]>t||this.activeTo[_i39]==t&&this.active[_i39].endSide>=this.point.endSide)&&e.push(this.active[_i39]);return e.reverse();}},{key:"openEnd",value:function openEnd(t){var e=0;for(var _i40=this.activeTo.length-1;_i40>=0&&this.activeTo[_i40]>t;_i40--)e++;return e;}}]);}();Xt="undefined"==typeof Symbol?"__ͼ":Symbol["for"]("ͼ"),Yt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};Zt=/*#__PURE__*/function(){function Zt(t,e){_classCallCheck(this,Zt);this.rules=[];var _ref3=e||{},i=_ref3.finish;function s(t){return /^@/.test(t)?[t]:t.split(/,\s*/);}function r(t,e,n,h){var l=[],o=/^@(\w+)\b/.exec(t[0]),u=o&&"keyframes"==o[1];if(o&&null==e)return n.push(t[0]+";");for(var _i44 in e){var _h20=e[_i44];if(/&/.test(_i44))r(_i44.split(/,\s*/).map(function(e){return t.map(function(t){return e.replace(/&/,t);});}).reduce(function(t,e){return t.concat(e);}),_h20,n);else if(_h20&&"object"==_typeof(_h20)){if(!o)throw new RangeError("The value of a property ("+_i44+") should be a primitive value.");r(s(_i44),_h20,l,u);}else null!=_h20&&l.push(_i44.replace(/_.*/,"").replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase();})+": "+_h20+";");}(l.length||u)&&n.push((!i||o||h?t:t.map(i)).join(", ")+" {"+l.join(" ")+"}");}for(var _e44 in t)r(s(_e44),t[_e44],this.rules);}return _createClass(Zt,[{key:"getRules",value:function getRules(){return this.rules.join("\n");}}],[{key:"newName",value:function newName(){var t=Qt[Xt]||1;return Qt[Xt]=t+1,"ͼ"+t.toString(36);}},{key:"mount",value:function mount(t,e,i){var s=t[Yt],r=i&&i.nonce;s?r&&s.setNonce(r):s=new ee(t,r),s.mount(Array.isArray(e)?e:[e],t);}}]);}();te=new Map();ee=/*#__PURE__*/function(){function ee(t,e){_classCallCheck(this,ee);var i=t.ownerDocument||t,s=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&s.CSSStyleSheet){var _e45=te.get(i);if(_e45)return t[Yt]=_e45;this.sheet=new s.CSSStyleSheet(),te.set(i,this);}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Yt]=this;}return _createClass(ee,[{key:"mount",value:function mount(t,e){var i=this.sheet,s=0,r=0;for(var _e46=0;_e46<t.length;_e46++){var _n32=t[_e46],_h21=this.modules.indexOf(_n32);if(_h21<r&&_h21>-1&&(this.modules.splice(_h21,1),r--,_h21=-1),-1==_h21){if(this.modules.splice(r++,0,_n32),i)for(var _t33=0;_t33<_n32.rules.length;_t33++)i.insertRule(_n32.rules[_t33],s++);}else{for(;r<_h21;)s+=this.modules[r++].rules.length;s+=_n32.rules.length,r++;}}if(i)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet].concat(_toConsumableArray(e.adoptedStyleSheets)));else{var _t34="";for(var _e47=0;_e47<this.modules.length;_e47++)_t34+=this.modules[_e47].getRules()+"\n";this.styleTag.textContent=_t34;var _i45=e.head||e;this.styleTag.parentNode!=_i45&&_i45.insertBefore(this.styleTag,_i45.firstChild);}}},{key:"setNonce",value:function setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t);}}]);}();pe=/*#__PURE__*/function(){function pe(){_classCallCheck(this,pe);this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}return _createClass(pe,[{key:"eq",value:function eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset;}},{key:"setRange",value:function setRange(t){var e=t.anchorNode,i=t.focusNode;this.set(e,Math.min(t.anchorOffset,e?fe(e):0),i,Math.min(t.focusOffset,i?fe(i):0));}},{key:"set",value:function set(t,e,i,s){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=s;}}]);}();me=null;Se=/*#__PURE__*/function(){function Se(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;_classCallCheck(this,Se);this.node=t,this.offset=e,this.precise=i;}return _createClass(Se,null,[{key:"before",value:function before(t,e){return new Se(t.parentNode,le(t),e);}},{key:"after",value:function after(t,e){return new Se(t.parentNode,le(t)+1,e);}}]);}();Oe=[];Ce=/*#__PURE__*/function(){function Ce(){_classCallCheck(this,Ce);this.parent=null,this.dom=null,this.flags=2;}return _createClass(Ce,[{key:"overrideDOMText",get:function get(){return null;}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBefore(this):0;}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.length;}},{key:"posBefore",value:function posBefore(t){var e=this.posAtStart;var _iterator33=_createForOfIteratorHelper(this.children),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var _i51=_step33.value;if(_i51==t)return e;e+=_i51.length+_i51.breakAfter;}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}throw new RangeError("Invalid child in posBefore");}},{key:"posAfter",value:function posAfter(t){return this.posBefore(t)+t.length;}},{key:"sync",value:function sync(t,e){if(2&this.flags){var _i52,_s40=this.dom,_r44=null;var _iterator34=_createForOfIteratorHelper(this.children),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _n33=_step34.value;if(7&_n33.flags){if(!_n33.dom&&(_i52=_r44?_r44.nextSibling:_s40.firstChild)){var _t36=Ce.get(_i52);(!_t36||!_t36.parent&&_t36.canReuseDOM(_n33))&&_n33.reuseDOM(_i52);}_n33.sync(t,e),_n33.flags&=-8;}if(_i52=_r44?_r44.nextSibling:_s40.firstChild,e&&!e.written&&e.node==_s40&&_i52!=_n33.dom&&(e.written=!0),_n33.dom.parentNode==_s40)for(;_i52&&_i52!=_n33.dom;)_i52=Ae(_i52);else _s40.insertBefore(_n33.dom,_i52);_r44=_n33.dom;}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}for(_i52=_r44?_r44.nextSibling:_s40.firstChild,_i52&&e&&e.node==_s40&&(e.written=!0);_i52;)_i52=Ae(_i52);}else if(1&this.flags){var _iterator35=_createForOfIteratorHelper(this.children),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _i53=_step35.value;7&_i53.flags&&(_i53.sync(t,e),_i53.flags&=-8);}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}}}},{key:"reuseDOM",value:function reuseDOM(t){}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e){var i;if(t==this.dom)i=this.dom.childNodes[e];else{var _s41=0==fe(t)?0:0==e?-1:1;for(;;){var _e48=t.parentNode;if(_e48==this.dom)break;0==_s41&&_e48.firstChild!=_e48.lastChild&&(_s41=t==_e48.firstChild?-1:1),t=_e48;}i=_s41<0?t:t.nextSibling;}if(i==this.dom.firstChild)return 0;for(;i&&!Ce.get(i);)i=i.nextSibling;if(!i)return this.length;for(var _t37=0,_e49=0;;_t37++){var _s42=this.children[_t37];if(_s42.dom==i)return _e49;_e49+=_s42.length+_s42.breakAfter;}}},{key:"domBoundsAround",value:function domBoundsAround(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=-1,r=-1,n=-1,h=-1;for(var _l18=0,_o10=i,_u7=i;_l18<this.children.length;_l18++){var _i54=this.children[_l18],_f4=_o10+_i54.length;if(_o10<t&&_f4>e)return _i54.domBoundsAround(t,e,_o10);if(_f4>=t&&-1==s&&(s=_l18,r=_o10),_o10>e&&_i54.dom.parentNode==this.dom){n=_l18,h=_u7;break;}_u7=_f4,_o10=_f4+_i54.breakAfter;}return{from:r,to:h<0?i+this.length:h,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:n<this.children.length&&n>=0?this.children[n].dom:null};}},{key:"markDirty",value:function markDirty(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;this.flags|=2,this.markParentsDirty(t);}},{key:"markParentsDirty",value:function markParentsDirty(t){for(var _e50=this.parent;_e50;_e50=_e50.parent){if(t&&(_e50.flags|=2),1&_e50.flags)return;_e50.flags|=1,t=!1;}}},{key:"setParent",value:function setParent(t){this.parent!=t&&(this.parent=t,7&this.flags&&this.markParentsDirty(!0));}},{key:"setDOM",value:function setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this);}},{key:"rootView",get:function get(){for(var _t38=this;;){var _e51=_t38.parent;if(!_e51)return _t38;_t38=_e51;}}},{key:"replaceChildren",value:function replaceChildren(t,e){var _this$children;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Oe;this.markDirty();for(var _s43=t;_s43<e;_s43++){var _t39=this.children[_s43];_t39.parent==this&&i.indexOf(_t39)<0&&_t39.destroy();}i.length<250?(_this$children=this.children).splice.apply(_this$children,[t,e-t].concat(_toConsumableArray(i))):this.children=[].concat(this.children.slice(0,t),i,this.children.slice(e));for(var _t40=0;_t40<i.length;_t40++)i[_t40].setParent(this);}},{key:"ignoreMutation",value:function ignoreMutation(t){return!1;}},{key:"ignoreEvent",value:function ignoreEvent(t){return!1;}},{key:"childCursor",value:function childCursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;return new De(this.children,t,this.children.length);}},{key:"childPos",value:function childPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this.childCursor().findPos(t,e);}},{key:"toString",value:function toString(){var t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+("Text"==t?this.text:this.length)+"]":"")+(this.breakAfter?"#":"");}},{key:"isEditable",get:function get(){return!0;}},{key:"isWidget",get:function get(){return!1;}},{key:"isHidden",get:function get(){return!1;}},{key:"merge",value:function merge(t,e,i,s,r,n){return!1;}},{key:"become",value:function become(t){return!1;}},{key:"canReuseDOM",value:function canReuseDOM(t){return t.constructor==this.constructor&&!(8&(this.flags|t.flags));}},{key:"getSide",value:function getSide(){return 0;}},{key:"destroy",value:function destroy(){var _iterator36=_createForOfIteratorHelper(this.children),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _t41=_step36.value;_t41.parent==this&&_t41.destroy();}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}this.parent=null;}}],[{key:"get",value:function get(t){return t.cmView;}}]);}();Ce.prototype.breakAfter=0;De=/*#__PURE__*/function(){function De(t,e,i){_classCallCheck(this,De);this.children=t,this.pos=e,this.i=i,this.off=0;}return _createClass(De,[{key:"findPos",value:function findPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;for(;;){if(t>this.pos||t==this.pos&&(e>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;var _i55=this.children[--this.i];this.pos-=_i55.length+_i55.breakAfter;}}}]);}();Te="undefined"!=typeof navigator?navigator:{userAgent:"",vendor:"",platform:""},Be="undefined"!=typeof document?document:{documentElement:{style:{}}};Ie=/Edge\/(\d+)/.exec(Te.userAgent),Ne=/MSIE \d/.test(Te.userAgent),Le=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Te.userAgent),je=!!(Ne||Le||Ie),ze=!je&&/gecko\/(\d+)/i.test(Te.userAgent),He=!je&&/Chrome\/(\d+)/.exec(Te.userAgent),Pe="webkitFontSmoothing"in Be.documentElement.style,$e=!je&&/Apple Computer/.test(Te.vendor),We=$e&&(/Mobile\/\w+/.test(Te.userAgent)||Te.maxTouchPoints>2);qe={mac:We||/Mac/.test(Te.platform),windows:/Win/.test(Te.platform),linux:/Linux|X11/.test(Te.platform),ie:je,ie_version:Ne?Be.documentMode||6:Le?+Le[1]:Ie?+Ie[1]:0,gecko:ze,gecko_version:ze?+(/Firefox\/(\d+)/.exec(Te.userAgent)||[0,0])[1]:0,chrome:!!He,chrome_version:He?+He[1]:0,ios:We,android:/Android\b/.test(Te.userAgent),webkit:Pe,safari:$e,webkit_version:Pe?+(/\bAppleWebKit\/(\d+)/.exec(Te.userAgent)||[0,0])[1]:0,tabSize:null!=Be.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};Fe=/*#__PURE__*/function(_Ce){function Fe(t){var _this8;_classCallCheck(this,Fe);_this8=_callSuper(this,Fe),_this8.text=t;return _this8;}_inherits(Fe,_Ce);return _createClass(Fe,[{key:"length",get:function get(){return this.text.length;}},{key:"createDOM",value:function createDOM(t){this.setDOM(t||document.createTextNode(this.text));}},{key:"sync",value:function sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text);}},{key:"reuseDOM",value:function reuseDOM(t){3==t.nodeType&&this.createDOM(t);}},{key:"merge",value:function merge(t,e,i){return!(8&this.flags||i&&(!(i instanceof Fe)||this.length-(e-t)+i.length>256||8&i.flags))&&(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0);}},{key:"split",value:function split(t){var e=new Fe(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=8&this.flags,e;}},{key:"localPosFromDOM",value:function localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0;}},{key:"domAtPos",value:function domAtPos(t){return new Se(this.dom,t);}},{key:"domBoundsAround",value:function domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling};}},{key:"coordsAt",value:function coordsAt(t,e){return function(t,e,i){var s=t.nodeValue.length;e>s&&(e=s);var r=e,n=e,h=0;0==e&&i<0||e==s&&i>=0?qe.chrome||qe.gecko||(e?(r--,h=1):n<s&&(n++,h=-1)):i<0?r--:n<s&&n++;var l=be(t,r,n).getClientRects();if(!l.length)return null;var o=l[(h?h<0:i>=0)?0:l.length-1];qe.safari&&!h&&0==o.width&&(o=Array.prototype.find.call(l,function(t){return t.width;})||o);return h?ae(o,h<0):o||null;}(this.dom,t,e);}}]);}(Ce);Ve=/*#__PURE__*/function(_Ce2){function Ve(t){var _this9;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_classCallCheck(this,Ve);_this9=_callSuper(this,Ve),_this9.mark=t,_this9.children=e,_this9.length=i;var _iterator38=_createForOfIteratorHelper(e),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _t44=_step38.value;_t44.setParent(_this9);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return _this9;}_inherits(Ve,_Ce2);return _createClass(Ve,[{key:"setAttrs",value:function setAttrs(t){if(ke(t),this.mark["class"]&&(t.className=this.mark["class"]),this.mark.attrs)for(var _e52 in this.mark.attrs)t.setAttribute(_e52,this.mark.attrs[_e52]);return t;}},{key:"canReuseDOM",value:function canReuseDOM(t){return _superPropGet(Ve,"canReuseDOM",this,3)([t])&&!(8&(this.flags|t.flags));}},{key:"reuseDOM",value:function reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6);}},{key:"sync",value:function sync(t,e){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),_superPropGet(Ve,"sync",this,3)([t,e]);}},{key:"merge",value:function merge(t,e,i,s,r,n){return(!i||!(!(i instanceof Ve&&i.mark.eq(this.mark))||t&&r<=0||e<this.length&&n<=0))&&(Re(this,t,e,i?i.children.slice():[],r-1,n-1),this.markDirty(),!0);}},{key:"split",value:function split(t){var e=[],i=0,s=-1,r=0;var _iterator39=_createForOfIteratorHelper(this.children),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _n34=_step39.value;var _h22=i+_n34.length;_h22>t&&e.push(i<t?_n34.split(t-i):_n34),s<0&&i>=t&&(s=r),i=_h22,r++;}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}var n=this.length-t;return this.length=t,s>-1&&(this.children.length=s,this.markDirty()),new Ve(this.mark,e,n);}},{key:"domAtPos",value:function domAtPos(t){return Ue(this,t);}},{key:"coordsAt",value:function coordsAt(t,e){return _e(this,t,e);}}]);}(Ce);Je=/*#__PURE__*/function(_Ce3){function Je(t,e,i){var _this10;_classCallCheck(this,Je);_this10=_callSuper(this,Je),_this10.widget=t,_this10.length=e,_this10.side=i,_this10.prevWidget=null;return _this10;}_inherits(Je,_Ce3);return _createClass(Je,[{key:"split",value:function split(t){var e=Je.create(this.widget,this.length-t,this.side);return this.length-=t,e;}},{key:"sync",value:function sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"));}},{key:"getSide",value:function getSide(){return this.side;}},{key:"merge",value:function merge(t,e,i,s,r,n){return!(i&&(!(i instanceof Je&&this.widget.compare(i.widget))||t>0&&r<=0||e<this.length&&n<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0);}},{key:"become",value:function become(t){return t instanceof Je&&t.side==this.side&&this.widget.constructor==t.widget.constructor&&(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return this.widget.ignoreEvent(t);}},{key:"overrideDOMText",get:function get(){if(0==this.length)return p.empty;var t=this;for(;t.parent;)t=t.parent;var _t45=t,e=_t45.view,i=e&&e.state.doc,s=this.posAtStart;return i?i.slice(s,s+this.length):p.empty;}},{key:"domAtPos",value:function domAtPos(t){return(this.length?0==t:this.side>0)?Se.before(this.dom):Se.after(this.dom,t==this.length);}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(t,e){var i=this.widget.coordsAt(this.dom,t,e);if(i)return i;var s=this.dom.getClientRects(),r=null;if(!s.length)return null;var n=this.side?this.side<0:t>0;for(var _e53=n?s.length-1:0;r=s[_e53],!(t>0?0==_e53:_e53==s.length-1||r.top<r.bottom);_e53+=n?-1:1);return ae(r,!n);}},{key:"isEditable",get:function get(){return!1;}},{key:"isWidget",get:function get(){return!0;}},{key:"isHidden",get:function get(){return this.widget.isHidden;}},{key:"destroy",value:function destroy(){_superPropGet(Je,"destroy",this,3)([]),this.dom&&this.widget.destroy(this.dom);}}],[{key:"create",value:function create(t,e,i){return new Je(t,e,i);}}]);}(Ce);Ge=/*#__PURE__*/function(_Ce4){function Ge(t){var _this11;_classCallCheck(this,Ge);_this11=_callSuper(this,Ge),_this11.side=t;return _this11;}_inherits(Ge,_Ce4);return _createClass(Ge,[{key:"length",get:function get(){return 0;}},{key:"merge",value:function merge(){return!1;}},{key:"become",value:function become(t){return t instanceof Ge&&t.side==this.side;}},{key:"split",value:function split(){return new Ge(this.side);}},{key:"sync",value:function sync(){if(!this.dom){var _t46=document.createElement("img");_t46.className="cm-widgetBuffer",_t46.setAttribute("aria-hidden","true"),this.setDOM(_t46);}}},{key:"getSide",value:function getSide(){return this.side;}},{key:"domAtPos",value:function domAtPos(t){return this.side>0?Se.before(this.dom):Se.after(this.dom);}},{key:"localPosFromDOM",value:function localPosFromDOM(){return 0;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(t){return this.dom.getBoundingClientRect();}},{key:"overrideDOMText",get:function get(){return p.empty;}},{key:"isHidden",get:function get(){return!0;}}]);}(Ce);Fe.prototype.children=Je.prototype.children=Ge.prototype.children=Oe;Ye=Object.create(null);_export("W",ei=/*#__PURE__*/function(){function ei(){_classCallCheck(this,ei);}return _createClass(ei,[{key:"eq",value:function eq(t){return!1;}},{key:"updateDOM",value:function updateDOM(t,e){return!1;}},{key:"compare",value:function compare(t){return this==t||this.constructor==t.constructor&&this.eq(t);}},{key:"estimatedHeight",get:function get(){return-1;}},{key:"lineBreaks",get:function get(){return 0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return!0;}},{key:"coordsAt",value:function coordsAt(t,e,i){return null;}},{key:"isHidden",get:function get(){return!1;}},{key:"editable",get:function get(){return!1;}},{key:"destroy",value:function destroy(t){}}]);}());ii=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t;}(ii||(ii={}));_export("l",si=/*#__PURE__*/function(_Bt){function si(t,e,i,s){var _this12;_classCallCheck(this,si);_this12=_callSuper(this,si),_this12.startSide=t,_this12.endSide=e,_this12.widget=i,_this12.spec=s;return _this12;}_inherits(si,_Bt);return _createClass(si,[{key:"heightRelevant",get:function get(){return!1;}},{key:"hasHeight",value:function hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1;}}],[{key:"mark",value:function mark(t){return new ri(t);}},{key:"widget",value:function widget(t){var e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new hi(t,e,e,i,t.widget||null,!1);}},{key:"replace",value:function replace(t){var e,i,s=!!t.block;if(t.isBlockGap)e=-5e8,i=4e8;else{var _li=li(t,s),_r47=_li.start,_n37=_li.end;e=(_r47?s?-3e8:-1:5e8)-1,i=1+(_n37?s?2e8:1:-6e8);}return new hi(t,e,i,s,t.widget||null,!0);}},{key:"line",value:function line(t){return new ni(t);}},{key:"set",value:function set(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return jt.of(t,e);}}]);}(Bt));si.none=jt.empty;ri=/*#__PURE__*/function(_si){function ri(t){var _this13;_classCallCheck(this,ri);var _li2=li(t),e=_li2.start,i=_li2.end;_this13=_callSuper(this,ri,[e?-1:5e8,i?1:-6e8,null,t]),_this13.tagName=t.tagName||"span",_this13["class"]=t["class"]||"",_this13.attrs=t.attributes||null;return _this13;}_inherits(ri,_si);return _createClass(ri,[{key:"eq",value:function eq(t){var e,i;return this==t||t instanceof ri&&this.tagName==t.tagName&&(this["class"]||(null===(e=this.attrs)||void 0===e?void 0:e["class"]))==(t["class"]||(null===(i=t.attrs)||void 0===i?void 0:i["class"]))&&Qe(this.attrs,t.attrs,"class");}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(t>=e)throw new RangeError("Mark decorations may not be empty");return _superPropGet(ri,"range",this,3)([t,e]);}}]);}(si);ri.prototype.point=!1;ni=/*#__PURE__*/function(_si2){function ni(t){_classCallCheck(this,ni);return _callSuper(this,ni,[-2e8,-2e8,null,t]);}_inherits(ni,_si2);return _createClass(ni,[{key:"eq",value:function eq(t){return t instanceof ni&&this.spec["class"]==t.spec["class"]&&Qe(this.spec.attributes,t.spec.attributes);}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return _superPropGet(ni,"range",this,3)([t,e]);}}]);}(si);ni.prototype.mapMode=E.TrackBefore,ni.prototype.point=!0;hi=/*#__PURE__*/function(_si3){function hi(t,e,i,s,r,n){var _this14;_classCallCheck(this,hi);_this14=_callSuper(this,hi,[e,i,r,t]),_this14.block=s,_this14.isReplace=n,_this14.mapMode=s?e<=0?E.TrackBefore:E.TrackAfter:E.TrackDel;return _this14;}_inherits(hi,_si3);return _createClass(hi,[{key:"type",get:function get(){return this.startSide!=this.endSide?ii.WidgetRange:this.startSide<=0?ii.WidgetBefore:ii.WidgetAfter;}},{key:"heightRelevant",get:function get(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0);}},{key:"eq",value:function eq(t){return t instanceof hi&&(e=this.widget,i=t.widget,e==i||!!(e&&i&&e.compare(i)))&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide;var e,i;}},{key:"range",value:function range(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return _superPropGet(hi,"range",this,3)([t,e]);}}]);}(si);hi.prototype.point=!0;ui=/*#__PURE__*/function(_Ce5){function ui(){var _this15;_classCallCheck(this,ui);_this15=_callSuper(this,ui,arguments),_this15.children=[],_this15.length=0,_this15.prevAttrs=void 0,_this15.attrs=null,_this15.breakAfter=0;return _this15;}_inherits(ui,_Ce5);return _createClass(ui,[{key:"merge",value:function merge(t,e,i,s,r,n){if(i){if(!(i instanceof ui))return!1;this.dom||i.transferDOM(this);}return s&&this.setDeco(i?i.attrs:null),Re(this,t,e,i?i.children.slice():[],r,n),!0;}},{key:"split",value:function split(t){var e=new ui();if(e.breakAfter=this.breakAfter,0==this.length)return e;var _this$childPos=this.childPos(t),i=_this$childPos.i,s=_this$childPos.off;s&&(e.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(var _t50=i;_t50<this.children.length;_t50++)e.append(this.children[_t50],0);for(;i>0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e;}},{key:"transferDOM",value:function transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null);}},{key:"setDeco",value:function setDeco(t){Qe(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t);}},{key:"append",value:function append(t,e){Ke(this,t,e);}},{key:"addLineDeco",value:function addLineDeco(t){var e=t.spec.attributes,i=t.spec["class"];e&&(this.attrs=Xe(e,this.attrs||{})),i&&(this.attrs=Xe({"class":i},this.attrs||{}));}},{key:"domAtPos",value:function domAtPos(t){return Ue(this,t);}},{key:"reuseDOM",value:function reuseDOM(t){"DIV"==t.nodeName&&(this.setDOM(t),this.flags|=6);}},{key:"sync",value:function sync(t,e){var i;this.dom?4&this.flags&&(ke(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(Ze(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),_superPropGet(ui,"sync",this,3)([t,e]);var s=this.dom.lastChild;for(;s&&Ce.get(s)instanceof Ve;)s=s.lastChild;if(!(s&&this.length&&("BR"==s.nodeName||0!=(null===(i=Ce.get(s))||void 0===i?void 0:i.isEditable)||qe.ios&&this.children.some(function(t){return t instanceof Fe;})))){var _t51=document.createElement("BR");_t51.cmIgnore=!0,this.dom.appendChild(_t51);}}},{key:"measureTextSize",value:function measureTextSize(){if(0==this.children.length||this.length>20)return null;var t,e=0;var _iterator40=_createForOfIteratorHelper(this.children),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _i59=_step40.value;if(!(_i59 instanceof Fe)||/[^ -~]/.test(_i59.text))return null;var _s46=ne(_i59.dom);if(1!=_s46.length)return null;e+=_s46[0].width,t=_s46[0].height;}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null;}},{key:"coordsAt",value:function coordsAt(t,e){var i=_e(this,t,e);if(!this.children.length&&i&&this.parent){var _t52=this.parent.view.viewState.heightOracle,_e56=i.bottom-i.top;if(Math.abs(_e56-_t52.lineHeight)<2&&_t52.textHeight<_e56){var _s47=(_e56-_t52.textHeight)/2;return{top:i.top+_s47,bottom:i.bottom-_s47,left:i.left,right:i.left};}}return i;}},{key:"become",value:function become(t){return t instanceof ui&&0==this.children.length&&0==t.children.length&&Qe(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter;}},{key:"covers",value:function covers(){return!0;}}],[{key:"find",value:function find(t,e){for(var _i60=0,_s48=0;_i60<t.children.length;_i60++){var _r48=t.children[_i60],_n38=_s48+_r48.length;if(_n38>=e){if(_r48 instanceof ui)return _r48;if(_n38>e)break;}_s48=_n38+_r48.breakAfter;}return null;}}]);}(Ce);fi=/*#__PURE__*/function(_Ce6){function fi(t,e,i){var _this16;_classCallCheck(this,fi);_this16=_callSuper(this,fi),_this16.widget=t,_this16.length=e,_this16.deco=i,_this16.breakAfter=0,_this16.prevWidget=null;return _this16;}_inherits(fi,_Ce6);return _createClass(fi,[{key:"merge",value:function merge(t,e,i,s,r,n){return!(i&&(!(i instanceof fi&&this.widget.compare(i.widget))||t>0&&r<=0||e<this.length&&n<=0))&&(this.length=t+(i?i.length:0)+(this.length-e),!0);}},{key:"domAtPos",value:function domAtPos(t){return 0==t?Se.before(this.dom):Se.after(this.dom,t==this.length);}},{key:"split",value:function split(t){var e=this.length-t;this.length=t;var i=new fi(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i;}},{key:"children",get:function get(){return Oe;}},{key:"sync",value:function sync(t){this.dom&&this.widget.updateDOM(this.dom,t)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"));}},{key:"overrideDOMText",get:function get(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):p.empty;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"become",value:function become(t){return t instanceof fi&&t.widget.constructor==this.widget.constructor&&(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0);}},{key:"ignoreMutation",value:function ignoreMutation(){return!0;}},{key:"ignoreEvent",value:function ignoreEvent(t){return this.widget.ignoreEvent(t);}},{key:"isEditable",get:function get(){return!1;}},{key:"isWidget",get:function get(){return!0;}},{key:"coordsAt",value:function coordsAt(t,e){var i=this.widget.coordsAt(this.dom,t,e);return i||(this.widget instanceof ai?null:ae(this.dom.getBoundingClientRect(),this.length?0==t:e<=0));}},{key:"destroy",value:function destroy(){_superPropGet(fi,"destroy",this,3)([]),this.dom&&this.widget.destroy(this.dom);}},{key:"covers",value:function covers(t){var _this$deco=this.deco,e=_this$deco.startSide,i=_this$deco.endSide;return e!=i&&(t<0?e<0:i>0);}}]);}(Ce);ai=/*#__PURE__*/function(_ei){function ai(t){var _this17;_classCallCheck(this,ai);_this17=_callSuper(this,ai),_this17.height=t;return _this17;}_inherits(ai,_ei);return _createClass(ai,[{key:"toDOM",value:function toDOM(){var t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t;}},{key:"eq",value:function eq(t){return t.height==this.height;}},{key:"updateDOM",value:function updateDOM(t){return t.style.height=this.height+"px",!0;}},{key:"editable",get:function get(){return!0;}},{key:"estimatedHeight",get:function get(){return this.height;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei);ci=/*#__PURE__*/function(){function ci(t,e,i,s){_classCallCheck(this,ci);this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=t.iter(),this.skip=e;}return _createClass(ci,[{key:"posCovered",value:function posCovered(){if(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;var t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof fi&&t.deco.endSide<0);}},{key:"getLine",value:function getLine(){return this.curLine||(this.content.push(this.curLine=new ui()),this.atCursorPos=!0),this.curLine;}},{key:"flushBuffer",value:function flushBuffer(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.bufferMarks;this.pendingBuffer&&(this.curLine.append(di(new Ge(-1),t),t.length),this.pendingBuffer=0);}},{key:"addBlockWidget",value:function addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t);}},{key:"finish",value:function finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||t&&this.content.length&&this.content[this.content.length-1]instanceof fi||this.getLine();}},{key:"buildText",value:function buildText(t,e,i){for(;t>0;){if(this.textOff==this.text.length){var _this$cursor$next2=this.cursor.next(this.skip),_e57=_this$cursor$next2.value,_i61=_this$cursor$next2.lineBreak,_s49=_this$cursor$next2.done;if(this.skip=0,_s49)throw new Error("Ran out of text content when drawing inline views");if(_i61){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue;}this.text=_e57,this.textOff=0;}var _s50=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(di(new Fe(this.text.slice(this.textOff,this.textOff+_s50)),e),i),this.atCursorPos=!0,this.textOff+=_s50,t-=_s50,i=0;}}},{key:"span",value:function span(t,e,i,s){this.buildText(e-t,i,s),this.pos=e,this.openStart<0&&(this.openStart=s);}},{key:"point",value:function point(t,e,i,s,r,n){if(this.disallowBlockEffectsFor[n]&&i instanceof hi){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins");}var h=e-t;if(i instanceof hi){if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new fi(i.widget||pi.block,h,i));else{var _n39=Je.create(i.widget||pi.inline,h,h?0:i.startSide),_l19=this.atCursorPos&&!_n39.isEditable&&r<=s.length&&(t<e||i.startSide>0),_o12=!_n39.isEditable&&(t<e||r>s.length||i.startSide<=0),_u9=this.getLine();2!=this.pendingBuffer||_l19||_n39.isEditable||(this.pendingBuffer=0),this.flushBuffer(s),_l19&&(_u9.append(di(new Ge(1),s),r),r=s.length+Math.max(0,r-s.length)),_u9.append(di(_n39,s),r),this.atCursorPos=_o12,this.pendingBuffer=_o12?t<e||r>s.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice());}}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);h&&(this.textOff+h<=this.text.length?this.textOff+=h:(this.skip+=h-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=e),this.openStart<0&&(this.openStart=r);}}],[{key:"build",value:function build(t,e,i,s,r){var n=new ci(t,e,i,r);return n.openEnd=jt.spans(s,e,i,n),n.openStart<0&&(n.openStart=n.openEnd),n.finish(n.openEnd),n;}}]);}();pi=/*#__PURE__*/function(_ei2){function pi(t){var _this18;_classCallCheck(this,pi);_this18=_callSuper(this,pi),_this18.tag=t;return _this18;}_inherits(pi,_ei2);return _createClass(pi,[{key:"eq",value:function eq(t){return t.tag==this.tag;}},{key:"toDOM",value:function toDOM(){return document.createElement(this.tag);}},{key:"updateDOM",value:function updateDOM(t){return t.nodeName.toLowerCase()==this.tag;}},{key:"isHidden",get:function get(){return!0;}}]);}(ei);pi.inline=new pi("span"),pi.block=new pi("div");_export("D",gi=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t;}(gi||_export("D",gi={})));mi=gi.LTR,wi=gi.RTL;vi=bi("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ki=bi("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Mi=Object.create(null),yi=[];for(_i64=0,_arr=["()","[]","{}"];_i64<_arr.length;_i64++){_t53=_arr[_i64];_e58=_t53.charCodeAt(0),_i65=_t53.charCodeAt(1);Mi[_e58]=_i65,Mi[_i65]=-_e58;}Si=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;Oi=/*#__PURE__*/function(){function Oi(t,e,i){_classCallCheck(this,Oi);this.from=t,this.to=e,this.level=i;}return _createClass(Oi,[{key:"dir",get:function get(){return this.level%2?wi:mi;}},{key:"side",value:function side(t,e){return this.dir==e==t?this.to:this.from;}},{key:"forward",value:function forward(t,e){return t==(this.dir==e);}}],[{key:"find",value:function find(t,e,i,s){var r=-1;for(var _n40=0;_n40<t.length;_n40++){var _h24=t[_n40];if(_h24.from<=e&&_h24.to>=e){if(_h24.level==i)return _n40;(r<0||(0!=s?s<0?_h24.from<e:_h24.to>e:t[r].level>_h24.level))&&(r=_n40);}}if(r<0)throw new RangeError("Index out of range");return r;}}]);}();Ai=[];Ti="";Ni=q.define(),Li=q.define(),ji=q.define(),zi=q.define(),Hi=q.define(),Pi=q.define(),$i=q.define(),Wi=q.define(),qi=q.define(),Fi=q.define({combine:function combine(t){return t.some(function(t){return t;});}}),Vi=q.define({combine:function combine(t){return t.some(function(t){return t;});}}),Ji=q.define();Gi=/*#__PURE__*/function(){function Gi(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"nearest";var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"nearest";var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:5;var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:5;var n=arguments.length>5&&arguments[5]!==undefined?arguments[5]:!1;_classCallCheck(this,Gi);this.range=t,this.y=e,this.x=i,this.yMargin=s,this.xMargin=r,this.isSnapshot=n;}return _createClass(Gi,[{key:"map",value:function map(t){return t.empty?this:new Gi(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot);}},{key:"clip",value:function clip(t){return this.range.to<=t.doc.length?this:new Gi(P.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot);}}]);}();Ui=bt.define({map:function map(t,e){return t.map(e);}}),Ki=bt.define();Xi=q.define({combine:function combine(t){return!t.length||t[0];}});Yi=0;Qi=q.define();_export("V",Zi=/*#__PURE__*/function(){function Zi(t,e,i,s,r){_classCallCheck(this,Zi);this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=s,this.extension=r(this);}return _createClass(Zi,null,[{key:"define",value:function define(t,e){var _ref4=e||{},i=_ref4.eventHandlers,s=_ref4.eventObservers,r=_ref4.provide,n=_ref4.decorations;return new Zi(Yi++,t,i,s,function(t){var e=[Qi.of(t)];return n&&e.push(ss.of(function(e){var i=e.plugin(t);return i?n(i):si.none;})),r&&e.push(r(t)),e;});}},{key:"fromClass",value:function fromClass(t,e){return Zi.define(function(e){return new t(e);},e);}}]);}());ts=/*#__PURE__*/function(){function ts(t){_classCallCheck(this,ts);this.spec=t,this.mustUpdate=null,this.value=null;}return _createClass(ts,[{key:"update",value:function update(t){if(this.value){if(this.mustUpdate){var _t62=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(_t62);}catch(e){if(_i(_t62.state,e,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy();}catch(t){}this.deactivate();}}}else if(this.spec)try{this.value=this.spec.create(t);}catch(e){_i(t.state,e,"CodeMirror plugin crashed"),this.deactivate();}return this;}},{key:"destroy",value:function destroy(t){var e;if(null===(e=this.value)||void 0===e?void 0:e.destroy)try{this.value.destroy();}catch(e){_i(t.state,e,"CodeMirror plugin crashed");}}},{key:"deactivate",value:function deactivate(){this.spec=this.value=null;}}]);}();es=q.define(),is=q.define(),ss=q.define(),rs=q.define(),ns=q.define(),hs=q.define();os=q.define();fs=q.define();as=/*#__PURE__*/function(){function as(t,e,i,s){_classCallCheck(this,as);this.fromA=t,this.toA=e,this.fromB=i,this.toB=s;}return _createClass(as,[{key:"join",value:function join(t){return new as(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB));}},{key:"addToSet",value:function addToSet(t){var e=t.length,i=this;for(;e>0;e--){var _s57=t[e-1];if(!(_s57.fromA>i.toA)){if(_s57.toA<i.fromA)break;i=i.join(_s57),t.splice(e-1,1);}}return t.splice(e,0,i),t;}}],[{key:"extendWithRanges",value:function extendWithRanges(t,e){if(0==e.length)return t;var i=[];for(var _s58=0,_r55=0,_n46=0,_h32=0;;_s58++){var _l23=_s58==t.length?null:t[_s58],_o18=_n46-_h32,_u14=_l23?_l23.fromB:1e9;for(;_r55<e.length&&e[_r55]<_u14;){var _t65=e[_r55],_s59=e[_r55+1],_n47=Math.max(_h32,_t65),_l24=Math.min(_u14,_s59);if(_n47<=_l24&&new as(_n47+_o18,_l24+_o18,_n47,_l24).addToSet(i),_s59>_u14)break;_r55+=2;}if(!_l23)return i;new as(_l23.fromA,_l23.toA,_l23.fromB,_l23.toB).addToSet(i),_n46=_l23.toA,_h32=_l23.toB;}}}]);}();cs=/*#__PURE__*/function(){function cs(t,e,i){_classCallCheck(this,cs);this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=T.empty(this.startState.doc.length);var _iterator43=_createForOfIteratorHelper(i),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var _t66=_step43.value;this.changes=this.changes.compose(_t66.changes);}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}var s=[];this.changes.iterChangedRanges(function(t,e,i,r){return s.push(new as(t,e,i,r));}),this.changedRanges=s;}return _createClass(cs,[{key:"viewportChanged",get:function get(){return(4&this.flags)>0;}},{key:"viewportMoved",get:function get(){return(8&this.flags)>0;}},{key:"heightChanged",get:function get(){return(2&this.flags)>0;}},{key:"geometryChanged",get:function get(){return this.docChanged||(18&this.flags)>0;}},{key:"focusChanged",get:function get(){return(1&this.flags)>0;}},{key:"docChanged",get:function get(){return!this.changes.empty;}},{key:"selectionSet",get:function get(){return this.transactions.some(function(t){return t.selection;});}},{key:"empty",get:function get(){return 0==this.flags&&0==this.transactions.length;}}],[{key:"create",value:function create(t,e,i){return new cs(t,e,i);}}]);}();ds=/*#__PURE__*/function(_Ce7){function ds(t){var _this19;_classCallCheck(this,ds);_this19=_callSuper(this,ds),_this19.view=t,_this19.decorations=[],_this19.dynamicDecorationMap=[!1],_this19.domChanged=null,_this19.hasComposition=null,_this19.markedForComposition=new Set(),_this19.editContextFormatting=si.none,_this19.lastCompositionAfterCursor=!1,_this19.minWidth=0,_this19.minWidthFrom=0,_this19.minWidthTo=0,_this19.impreciseAnchor=null,_this19.impreciseHead=null,_this19.forceSelection=!1,_this19.lastUpdate=Date.now(),_this19.setDOM(t.contentDOM),_this19.children=[new ui()],_this19.children[0].setParent(_assertThisInitialized(_this19)),_this19.updateDeco(),_this19.updateInner([new as(0,0,0,t.state.doc.length)],0,null);return _this19;}_inherits(ds,_Ce7);return _createClass(ds,[{key:"length",get:function get(){return this.view.state.doc.length;}},{key:"update",value:function update(t){var _this20=this;var e;var i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(function(_ref5){var t=_ref5.fromA,e=_ref5.toA;return e<_this20.minWidthFrom||t>_this20.minWidthTo;})?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);var s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&((null===(e=this.domChanged)||void 0===e?void 0:e.newSel)?s=this.domChanged.newSel.head:function(t,e){var i=!1;e&&t.iterChangedRanges(function(t,s){t<e.to&&s>e.from&&(i=!0);});return i;}(t.changes,this.hasComposition)||t.selectionSet||(s=t.state.selection.main.head));var r=s>-1?function(t,e,i){var s=ps(t,i);if(!s)return null;var r=s.node,n=s.from,h=s.to,l=r.nodeValue;if(/[\n\r]/.test(l))return null;if(t.state.doc.sliceString(s.from,s.to)!=l)return null;var o=e.invertedDesc,u=new as(o.mapPos(n),o.mapPos(h),n,h),f=[];for(var _e69=r.parentNode;;_e69=_e69.parentNode){var _i74=Ce.get(_e69);if(_i74 instanceof Ve)f.push({node:_e69,deco:_i74.mark});else{if(_i74 instanceof ui||"DIV"==_e69.nodeName&&_e69.parentNode==t.contentDOM)return{range:u,text:r,marks:f,line:_e69};if(_e69==t.contentDOM)return null;f.push({node:_e69,deco:new ri({inclusive:!0,attributes:ti(_e69),tagName:_e69.tagName.toLowerCase()})});}}}(this.view,t.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();var _this$hasComposition=this.hasComposition,_e70=_this$hasComposition.from,_s60=_this$hasComposition.to;i=new as(_e70,_s60,t.changes.mapPos(_e70,-1),t.changes.mapPos(_s60,1)).addToSet(i.slice());}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(qe.ie||qe.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);var n=function(t,e,i){var s=new gs();return jt.compare(t,e,i,s),s.changes;}(this.decorations,this.updateDeco(),t.changes);return i=as.extendWithRanges(i,n),!!(7&this.flags||0!=i.length)&&(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0);}},{key:"updateInner",value:function updateInner(t,e,i){var _this21=this;this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);var s=this.view.observer;s.ignore(function(){_this21.dom.style.height=_this21.view.viewState.contentHeight/_this21.view.scaleY+"px",_this21.dom.style.flexBasis=_this21.minWidth?_this21.minWidth+"px":"";var t=qe.chrome||qe.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;_this21.sync(_this21.view,t),_this21.flags&=-8,t&&(t.written||s.selectionRange.focusNode!=t.node)&&(_this21.forceSelection=!0),_this21.dom.style.height="";}),this.markedForComposition.forEach(function(t){return t.flags&=-9;});var r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length){var _iterator44=_createForOfIteratorHelper(this.children),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var _t67=_step44.value;_t67 instanceof fi&&_t67.widget instanceof ai&&r.push(_t67.dom);}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}s.updateGaps(r);}},{key:"updateChildren",value:function updateChildren(t,e,i){var s=i?i.range.addToSet(t.slice()):t,r=this.childCursor(e);for(var _t68=s.length-1;;_t68--){var _e71=_t68>=0?s[_t68]:null;if(!_e71)break;var _n48=void 0,_h33=void 0,_l25=void 0,_o19=void 0,_u15=_e71.fromA,_f10=_e71.toA,_a7=_e71.fromB,_c4=_e71.toB;if(i&&i.range.fromB<_c4&&i.range.toB>_a7){var _t69=ci.build(this.view.state.doc,_a7,i.range.fromB,this.decorations,this.dynamicDecorationMap),_e72=ci.build(this.view.state.doc,i.range.toB,_c4,this.decorations,this.dynamicDecorationMap);_h33=_t69.breakAtStart,_l25=_t69.openStart,_o19=_e72.openEnd;var _s61=this.compositionView(i);_e72.breakAtStart?_s61.breakAfter=1:_e72.content.length&&_s61.merge(_s61.length,_s61.length,_e72.content[0],!1,_e72.openStart,0)&&(_s61.breakAfter=_e72.content[0].breakAfter,_e72.content.shift()),_t69.content.length&&_s61.merge(0,0,_t69.content[_t69.content.length-1],!0,0,_t69.openEnd)&&_t69.content.pop(),_n48=_t69.content.concat(_s61).concat(_e72.content);}else{var _ci$build=ci.build(this.view.state.doc,_a7,_c4,this.decorations,this.dynamicDecorationMap);_n48=_ci$build.content;_h33=_ci$build.breakAtStart;_l25=_ci$build.openStart;_o19=_ci$build.openEnd;}var _r$findPos=r.findPos(_f10,1),_d3=_r$findPos.i,_p5=_r$findPos.off,_r$findPos2=r.findPos(_u15,-1),_g=_r$findPos2.i,_m=_r$findPos2.off;Ee(this,_g,_m,_d3,_p5,_n48,_h33,_l25,_o19);}i&&this.fixCompositionDOM(i);}},{key:"updateEditContextFormatting",value:function updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);var _iterator45=_createForOfIteratorHelper(t.transactions),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var _e73=_step45.value;var _iterator46=_createForOfIteratorHelper(_e73.effects),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var _t70=_step46.value;_t70.is(Ki)&&(this.editContextFormatting=_t70.value);}}catch(err){_iterator46.e(err);}finally{_iterator46.f();}}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}},{key:"compositionView",value:function compositionView(t){var e=new Fe(t.text.nodeValue);e.flags|=8;var _iterator47=_createForOfIteratorHelper(t.marks),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var _i75=_step47.value.deco;e=new Ve(_i75,[e],e.length);}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}var i=new ui();return i.append(e,0),i;}},{key:"fixCompositionDOM",value:function fixCompositionDOM(t){var _this22=this;var e=function e(t,_e74){_e74.flags|=8|(_e74.children.some(function(t){return 7&t.flags;})?1:0),_this22.markedForComposition.add(_e74);var i=Ce.get(t);i&&i!=_e74&&(i.dom=null),_e74.setDOM(t);},i=this.childPos(t.range.fromB,1),s=this.children[i.i];e(t.line,s);for(var _r56=t.marks.length-1;_r56>=-1;_r56--)i=s.childPos(i.off,1),s=s.children[i.i],e(_r56>=0?t.marks[_r56].node:t.text,s);}},{key:"updateSelection",value:function updateSelection(){var _this23=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;!t&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();var i=this.view.root.activeElement,s=i==this.dom,r=!s&&!(this.view.state.facet(Xi)||this.dom.tabIndex>-1)&&re(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||e||r))return;var n=this.forceSelection;this.forceSelection=!1;var h=this.view.state.selection.main,l=this.moveToLine(this.domAtPos(h.anchor)),o=h.empty?l:this.moveToLine(this.domAtPos(h.head));if(qe.gecko&&h.empty&&!this.hasComposition&&1==(u=l).node.nodeType&&u.node.firstChild&&(0==u.offset||"false"==u.node.childNodes[u.offset-1].contentEditable)&&(u.offset==u.node.childNodes.length||"false"==u.node.childNodes[u.offset].contentEditable)){var _t71=document.createTextNode("");this.view.observer.ignore(function(){return l.node.insertBefore(_t71,l.node.childNodes[l.offset]||null);}),l=o=new Se(_t71,0),n=!0;}var u;var f=this.view.observer.selectionRange;!n&&f.focusNode&&(he(l.node,l.offset,f.anchorNode,f.anchorOffset)&&he(o.node,o.offset,f.focusNode,f.focusOffset)||this.suppressWidgetCursorChange(f,h))||(this.view.observer.ignore(function(){qe.android&&qe.chrome&&_this23.dom.contains(f.focusNode)&&function(t,e){for(var _i76=t;_i76&&_i76!=e;_i76=_i76.assignedSlot||_i76.parentNode)if(1==_i76.nodeType&&"false"==_i76.contentEditable)return!0;return!1;}(f.focusNode,_this23.dom)&&(_this23.dom.blur(),_this23.dom.focus({preventScroll:!0}));var t=ie(_this23.view.root);if(t){if(h.empty){if(qe.gecko){var _t72=(e=l.node,s=l.offset,1!=e.nodeType?0:(s&&"false"==e.childNodes[s-1].contentEditable?1:0)|(s<e.childNodes.length&&"false"==e.childNodes[s].contentEditable?2:0));if(_t72&&3!=_t72){var _e75=(1==_t72?ye:xe)(l.node,l.offset);_e75&&(l=new Se(_e75.node,_e75.offset));}}t.collapse(l.node,l.offset),null!=h.bidiLevel&&void 0!==t.caretBidiLevel&&(t.caretBidiLevel=h.bidiLevel);}else if(t.extend){t.collapse(l.node,l.offset);try{t.extend(o.node,o.offset);}catch(t){}}else{var _ref6;var _e76=document.createRange();h.anchor>h.head&&(_ref6=[o,l],l=_ref6[0],o=_ref6[1],_ref6),_e76.setEnd(o.node,o.offset),_e76.setStart(l.node,l.offset),t.removeAllRanges(),t.addRange(_e76);}}else;var e,s;r&&_this23.view.root.activeElement==_this23.dom&&(_this23.dom.blur(),i&&i.focus());}),this.view.observer.setSelectionRange(l,o)),this.impreciseAnchor=l.precise?null:new Se(f.anchorNode,f.anchorOffset),this.impreciseHead=o.precise?null:new Se(f.focusNode,f.focusOffset);}},{key:"suppressWidgetCursorChange",value:function suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&he(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head;}},{key:"enforceCursorAssoc",value:function enforceCursorAssoc(){if(this.hasComposition)return;var t=this.view,e=t.state.selection.main,i=ie(t.root),_t$observer$selection=t.observer.selectionRange,s=_t$observer$selection.anchorNode,r=_t$observer$selection.anchorOffset;if(!(i&&e.empty&&e.assoc&&i.modify))return;var n=ui.find(this,e.head);if(!n)return;var h=n.posAtStart;if(e.head==h||e.head==h+n.length)return;var l=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(!l||!o||l.bottom>o.top)return;var u=this.domAtPos(e.head+e.assoc);i.collapse(u.node,u.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();var f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(s,r);}},{key:"moveToLine",value:function moveToLine(t){var e,i=this.dom;if(t.node!=i)return t;for(var _s62=t.offset;!e&&_s62<i.childNodes.length;_s62++){var _t73=Ce.get(i.childNodes[_s62]);_t73 instanceof ui&&(e=_t73.domAtPos(0));}for(var _s63=t.offset-1;!e&&_s63>=0;_s63--){var _t74=Ce.get(i.childNodes[_s63]);_t74 instanceof ui&&(e=_t74.domAtPos(_t74.length));}return e?new Se(e.node,e.offset,!0):t;}},{key:"nearest",value:function nearest(t){for(var _e77=t;_e77;){var _t75=Ce.get(_e77);if(_t75&&_t75.rootView==this)return _t75;_e77=_e77.parentNode;}return null;}},{key:"posFromDOM",value:function posFromDOM(t,e){var i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart;}},{key:"domAtPos",value:function domAtPos(t){var _this$childCursor$fin=this.childCursor().findPos(t,-1),e=_this$childCursor$fin.i,i=_this$childCursor$fin.off;for(;e<this.children.length-1;){var _t76=this.children[e];if(i<_t76.length||_t76 instanceof ui)break;e++,i=0;}return this.children[e].domAtPos(i);}},{key:"coordsAt",value:function coordsAt(t,e){var i=null,s=0;for(var _r57=this.length,_n49=this.children.length-1;_n49>=0;_n49--){var _h34=this.children[_n49],_l26=_r57-_h34.breakAfter,_o20=_l26-_h34.length;if(_l26<t)break;if(_o20<=t&&(_o20<t||_h34.covers(-1))&&(_l26>t||_h34.covers(1))&&(!i||_h34 instanceof ui&&!(i instanceof ui&&e>=0)))i=_h34,s=_o20;else if(i&&_o20==t&&_l26==t&&_h34 instanceof fi&&Math.abs(e)<2){if(_h34.deco.startSide<0)break;_n49&&(i=null);}_r57=_o20;}return i?i.coordsAt(t-s,e):null;}},{key:"coordsForChar",value:function coordsForChar(t){var _this$childPos2=this.childPos(t,1),e=_this$childPos2.i,i=_this$childPos2.off,s=this.children[e];if(!(s instanceof ui))return null;for(;s.children.length;){var _s$childPos=s.childPos(i,1),_t77=_s$childPos.i,_e78=_s$childPos.off;for(;;_t77++){if(_t77==s.children.length)return null;if((s=s.children[_t77]).length)break;}i=_e78;}if(!(s instanceof Fe))return null;var r=S(s.text,i);if(r==i)return null;var n=be(s.dom,i,r).getClientRects();for(var _t78=0;_t78<n.length;_t78++){var _e79=n[_t78];if(_t78==n.length-1||_e79.top<_e79.bottom&&_e79.left<_e79.right)return _e79;}return null;}},{key:"measureVisibleLineHeights",value:function measureVisibleLineHeights(t){var e=[],i=t.from,s=t.to,r=this.view.contentDOM.clientWidth,n=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,h=-1,l=this.view.textDirection==gi.LTR;for(var _t79=0,_o21=0;_o21<this.children.length;_o21++){var _u16=this.children[_o21],_f11=_t79+_u16.length;if(_f11>s)break;if(_t79>=i){var _i77=_u16.dom.getBoundingClientRect();if(e.push(_i77.height),n){var _e80=_u16.dom.lastChild,_s64=_e80?ne(_e80):[];if(_s64.length){var _e81=_s64[_s64.length-1],_n50=l?_e81.right-_i77.left:_i77.right-_e81.left;_n50>h&&(h=_n50,this.minWidth=r,this.minWidthFrom=_t79,this.minWidthTo=_f11);}}}_t79=_f11+_u16.breakAfter;}return e;}},{key:"textDirectionAt",value:function textDirectionAt(t){var _this$childPos3=this.childPos(t,1),e=_this$childPos3.i;return"rtl"==getComputedStyle(this.children[e].dom).direction?gi.RTL:gi.LTR;}},{key:"measureTextSize",value:function measureTextSize(){var _this24=this;var _iterator48=_createForOfIteratorHelper(this.children),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var _t80=_step48.value;if(_t80 instanceof ui){var _e82=_t80.measureTextSize();if(_e82)return _e82;}}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}var t,e,i,s=document.createElement("div");return s.className="cm-line",s.style.width="99999px",s.style.position="absolute",s.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(function(){_this24.dom.appendChild(s);var r=ne(s.firstChild)[0];t=s.getBoundingClientRect().height,e=r?r.width/27:7,i=r?r.height:t,s.remove();}),{lineHeight:t,charWidth:e,textHeight:i};}},{key:"childCursor",value:function childCursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;var e=this.children.length;return e&&(t-=this.children[--e].length),new De(this.children,t,e);}},{key:"computeBlockGapDeco",value:function computeBlockGapDeco(){var t=[],e=this.view.viewState;for(var _i78=0,_s65=0;;_s65++){var _r58=_s65==e.viewports.length?null:e.viewports[_s65],_n51=_r58?_r58.from-1:this.length;if(_n51>_i78){var _s66=(e.lineBlockAt(_n51).bottom-e.lineBlockAt(_i78).top)/this.view.scaleY;t.push(si.replace({widget:new ai(_s66),block:!0,inclusive:!0,isBlockGap:!0}).range(_i78,_n51));}if(!_r58)break;_i78=_r58.to+1;}return si.set(t);}},{key:"updateDeco",value:function updateDeco(){var _this25=this;var t=1,e=this.view.state.facet(ss).map(function(e){return(_this25.dynamicDecorationMap[t++]="function"==typeof e)?e(_this25.view):e;}),i=!1,s=this.view.state.facet(rs).map(function(t,e){var s="function"==typeof t;return s&&(i=!0),s?t(_this25.view):t;});for(s.length&&(this.dynamicDecorationMap[t++]=i,e.push(jt.join(s))),this.decorations=[this.editContextFormatting].concat(_toConsumableArray(e),[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]);t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations;}},{key:"scrollIntoView",value:function scrollIntoView(t){if(t.isSnapshot){var _e83=this.view.viewState.lineBlockAt(t.range.head);return this.view.scrollDOM.scrollTop=_e83.top-t.yMargin,void(this.view.scrollDOM.scrollLeft=t.xMargin);}var _iterator49=_createForOfIteratorHelper(this.view.state.facet(Ji)),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _e86=_step49.value;try{if(_e86(this.view,t.range,t))return!0;}catch(t){_i(this.view.state,t,"scroll handler");}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}var e,i=t.range,s=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1);if(!s)return;!i.empty&&(e=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(s={left:Math.min(s.left,e.left),top:Math.min(s.top,e.top),right:Math.max(s.right,e.right),bottom:Math.max(s.bottom,e.bottom)});var r=us(this.view),n={left:s.left-r.left,top:s.top-r.top,right:s.right+r.right,bottom:s.bottom+r.bottom},_this$view$scrollDOM=this.view.scrollDOM,h=_this$view$scrollDOM.offsetWidth,l=_this$view$scrollDOM.offsetHeight;!function(t,e,i,s,r,n,h,l){var o=t.ownerDocument,u=o.defaultView||window;for(var _f12=t,_a8=!1;_f12&&!_a8;)if(1==_f12.nodeType){var _t81=void 0,_c5=_f12==o.body,_d4=1,_p6=1;if(_c5)_t81=ce(u);else{var _de;if(/^(fixed|sticky)$/.test(getComputedStyle(_f12).position)&&(_a8=!0),_f12.scrollHeight<=_f12.clientHeight&&_f12.scrollWidth<=_f12.clientWidth){_f12=_f12.assignedSlot||_f12.parentNode;continue;}var _e84=_f12.getBoundingClientRect();_de=de(_f12,_e84),_d4=_de.scaleX,_p6=_de.scaleY,_t81={left:_e84.left,right:_e84.left+_f12.clientWidth*_d4,top:_e84.top,bottom:_e84.top+_f12.clientHeight*_p6};}var _g2=0,_m2=0;if("nearest"==r)e.top<_t81.top?(_m2=-(_t81.top-e.top+h),i>0&&e.bottom>_t81.bottom+_m2&&(_m2=e.bottom-_t81.bottom+_m2+h)):e.bottom>_t81.bottom&&(_m2=e.bottom-_t81.bottom+h,i<0&&e.top-_m2<_t81.top&&(_m2=-(_t81.top+_m2-e.top+h)));else{var _s67=e.bottom-e.top,_n52=_t81.bottom-_t81.top;_m2=("center"==r&&_s67<=_n52?e.top+_s67/2-_n52/2:"start"==r||"center"==r&&i<0?e.top-h:e.bottom-_n52+h)-_t81.top;}if("nearest"==s?e.left<_t81.left?(_g2=-(_t81.left-e.left+n),i>0&&e.right>_t81.right+_g2&&(_g2=e.right-_t81.right+_g2+n)):e.right>_t81.right&&(_g2=e.right-_t81.right+n,i<0&&e.left<_t81.left+_g2&&(_g2=-(_t81.left+_g2-e.left+n))):_g2=("center"==s?e.left+(e.right-e.left)/2-(_t81.right-_t81.left)/2:"start"==s==l?e.left-n:e.right-(_t81.right-_t81.left)+n)-_t81.left,_g2||_m2)if(_c5)u.scrollBy(_g2,_m2);else{var _t82=0,_i79=0;if(_m2){var _t83=_f12.scrollTop;_f12.scrollTop+=_m2/_p6,_i79=(_f12.scrollTop-_t83)*_p6;}if(_g2){var _e85=_f12.scrollLeft;_f12.scrollLeft+=_g2/_d4,_t82=(_f12.scrollLeft-_e85)*_d4;}e={left:e.left-_t82,top:e.top-_i79,right:e.right-_t82,bottom:e.bottom-_i79},_t82&&Math.abs(_t82-_g2)<1&&(s="nearest"),_i79&&Math.abs(_i79-_m2)<1&&(r="nearest");}if(_c5)break;_f12=_f12.assignedSlot||_f12.parentNode;}else{if(11!=_f12.nodeType)break;_f12=_f12.host;}}(this.view.scrollDOM,n,i.head<i.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,h),-h),Math.max(Math.min(t.yMargin,l),-l),this.view.textDirection==gi.LTR);}}]);}(Ce);gs=/*#__PURE__*/function(){function gs(){_classCallCheck(this,gs);this.changes=[];}return _createClass(gs,[{key:"compareRange",value:function compareRange(t,e){oi(t,e,this.changes);}},{key:"comparePoint",value:function comparePoint(t,e){oi(t,e,this.changes);}},{key:"boundChange",value:function boundChange(t){oi(t,t,this.changes);}}]);}();Es="￿";Rs=/*#__PURE__*/function(){function Rs(t,e){_classCallCheck(this,Rs);this.points=t,this.text="",this.lineSeparator=e.facet(Rt.lineSeparator);}return _createClass(Rs,[{key:"append",value:function append(t){this.text+=t;}},{key:"lineBreak",value:function lineBreak(){this.text+=Es;}},{key:"readRange",value:function readRange(t,e){if(!t)return this;var i=t.parentNode;for(var _s70=t;;){this.findPointBefore(i,_s70);var _t91=this.text.length;this.readNode(_s70);var _r61=_s70.nextSibling;if(_r61==e)break;var _n54=Ce.get(_s70),_h35=Ce.get(_r61);(_n54&&_h35?_n54.breakAfter:(_n54?_n54.breakAfter:oe(_s70))||oe(_r61)&&("BR"!=_s70.nodeName||_s70.cmIgnore)&&this.text.length>_t91)&&this.lineBreak(),_s70=_r61;}return this.findPointBefore(i,e),this;}},{key:"readTextNode",value:function readTextNode(t){var e=t.nodeValue;var _iterator52=_createForOfIteratorHelper(this.points),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var _i82=_step52.value;_i82.node==t&&(_i82.pos=this.text.length+Math.min(_i82.offset,e.length));}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}for(var _i81=0,_s71=this.lineSeparator?null:/\r\n?|\n/g;;){var _r62=void 0,_n55=-1,_h36=1;if(this.lineSeparator?(_n55=e.indexOf(this.lineSeparator,_i81),_h36=this.lineSeparator.length):(_r62=_s71.exec(e))&&(_n55=_r62.index,_h36=_r62[0].length),this.append(e.slice(_i81,_n55<0?e.length:_n55)),_n55<0)break;if(this.lineBreak(),_h36>1){var _iterator53=_createForOfIteratorHelper(this.points),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var _e95=_step53.value;_e95.node==t&&_e95.pos>this.text.length&&(_e95.pos-=_h36-1);}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}}_i81=_n55+_h36;}}},{key:"readNode",value:function readNode(t){if(t.cmIgnore)return;var e=Ce.get(t),i=e&&e.overrideDOMText;if(null!=i){this.findPointInside(t,i.length);for(var _t92=i.iter();!_t92.next().done;)_t92.lineBreak?this.lineBreak():this.append(_t92.value);}else 3==t.nodeType?this.readTextNode(t):"BR"==t.nodeName?t.nextSibling&&this.lineBreak():1==t.nodeType&&this.readRange(t.firstChild,null);}},{key:"findPointBefore",value:function findPointBefore(t,e){var _iterator54=_createForOfIteratorHelper(this.points),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var _i83=_step54.value;_i83.node==t&&t.childNodes[_i83.offset]==e&&(_i83.pos=this.text.length);}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}}},{key:"findPointInside",value:function findPointInside(t,e){var _iterator55=_createForOfIteratorHelper(this.points),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _i84=_step55.value;(3==t.nodeType?_i84.node==t:t.contains(_i84.node))&&(_i84.pos=this.text.length+(Ts(t,_i84.node,_i84.offset)?e:0));}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}}}]);}();Bs=/*#__PURE__*/_createClass(function Bs(t,e){_classCallCheck(this,Bs);this.node=t,this.offset=e,this.pos=-1;});Is=/*#__PURE__*/_createClass(function Is(t,e,i,s){_classCallCheck(this,Is);this.typeOver=s,this.bounds=null,this.text="",this.domChanged=e>-1;var _t$docView=t.docView,r=_t$docView.impreciseHead,n=_t$docView.impreciseAnchor;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){var _e96=r||n?[]:function(t){var e=[];if(t.root.activeElement!=t.contentDOM)return e;var _t$observer$selection2=t.observer.selectionRange,i=_t$observer$selection2.anchorNode,s=_t$observer$selection2.anchorOffset,r=_t$observer$selection2.focusNode,n=_t$observer$selection2.focusOffset;i&&(e.push(new Bs(i,s)),r==i&&n==s||e.push(new Bs(r,n)));return e;}(t),_i85=new Rs(_e96,t.state);_i85.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=_i85.text,this.newSel=function(t,e){if(0==t.length)return null;var i=t[0].pos,s=2==t.length?t[1].pos:i;return i>-1&&s>-1?P.single(i+e,s+e):null;}(_e96,this.bounds.from);}else{var _e97=t.observer.selectionRange,_i86=r&&r.node==_e97.focusNode&&r.offset==_e97.focusOffset||!se(t.contentDOM,_e97.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(_e97.focusNode,_e97.focusOffset),_s72=n&&n.node==_e97.anchorNode&&n.offset==_e97.anchorOffset||!se(t.contentDOM,_e97.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(_e97.anchorNode,_e97.anchorOffset),_h37=t.viewport;if((qe.ios||qe.chrome)&&t.state.selection.main.empty&&_i86!=_s72&&(_h37.from>0||_h37.to<t.state.doc.length)){var _e98=Math.min(_i86,_s72),_r63=Math.max(_i86,_s72),_n56=_h37.from-_e98,_l30=_h37.to-_r63;0!=_n56&&1!=_n56&&0!=_e98||0!=_l30&&-1!=_l30&&_r63!=t.state.doc.length||(_i86=0,_s72=t.state.doc.length);}this.newSel=P.single(_s72,_i86);}});js=/*#__PURE__*/function(){function js(t){_classCallCheck(this,js);this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=t.hasFocus,qe.safari&&t.contentDOM.addEventListener("input",function(){return null;}),qe.gecko&&function(t){ur.has(t)||(ur.add(t),t.addEventListener("copy",function(){}),t.addEventListener("cut",function(){}));}(t.contentDOM.ownerDocument);}return _createClass(js,[{key:"setSelectionOrigin",value:function setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now();}},{key:"handleEvent",value:function handleEvent(t){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var _i89,_s74=e.target;_s74!=t.contentDOM;_s74=_s74.parentNode)if(!_s74||11==_s74.nodeType||(_i89=Ce.get(_s74))&&_i89.ignoreEvent(e))return!1;return!0;})(this.view,t)&&!this.ignoreDuringComposition(t)&&("keydown"==t.type&&this.keydown(t)||this.runHandlers(t.type,t));}},{key:"runHandlers",value:function runHandlers(t,e){var i=this.handlers[t];if(i){var _iterator56=_createForOfIteratorHelper(i.observers),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var _t94=_step56.value;_t94(this.view,e);}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}var _iterator57=_createForOfIteratorHelper(i.handlers),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _t95=_step57.value;if(e.defaultPrevented)break;if(_t95(this.view,e)){e.preventDefault();break;}}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}}}},{key:"ensureHandlers",value:function ensureHandlers(t){var e=Hs(t),i=this.handlers,s=this.view.contentDOM;for(var _t96 in e)if("scroll"!=_t96){var _r64=!e[_t96].handlers.length,_n57=i[_t96];_n57&&_r64!=!_n57.handlers.length&&(s.removeEventListener(_t96,this.handleEvent),_n57=null),_n57||s.addEventListener(_t96,this.handleEvent,{passive:_r64});}for(var _t97 in i)"scroll"==_t97||e[_t97]||s.removeEventListener(_t97,this.handleEvent);this.handlers=e;}},{key:"keydown",value:function keydown(t){var _this26=this;if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&27!=t.keyCode&&Ws.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),qe.android&&qe.chrome&&!t.synthetic&&(13==t.keyCode||8==t.keyCode))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;var e;return!qe.ios||t.synthetic||t.altKey||t.metaKey||!((e=Ps.find(function(e){return e.keyCode==t.keyCode;}))&&!t.ctrlKey||$s.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(229!=t.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=e||t,setTimeout(function(){return _this26.flushIOSKey();},250),!0);}},{key:"flushIOSKey",value:function flushIOSKey(t){var e=this.pendingIOSKey;return!!e&&!("Enter"==e.key&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString()))&&(this.pendingIOSKey=void 0,ve(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0));}},{key:"ignoreDuringComposition",value:function ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(qe.safari&&!qe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0));}},{key:"startMouseSelection",value:function startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t;}},{key:"update",value:function update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0);}},{key:"destroy",value:function destroy(){this.mouseSelection&&this.mouseSelection.destroy();}}]);}();Ps=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$s="dthko",Ws=[16,17,18,20,91,92,224,225];Fs=/*#__PURE__*/function(){function Fs(t,e,i,s){_classCallCheck(this,Fs);this.view=t,this.startEvent=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=function(t){var e,i,s=t.ownerDocument;for(var _r67=t.parentNode;_r67&&!(_r67==s.body||e&&i);)if(1==_r67.nodeType)!i&&_r67.scrollHeight>_r67.clientHeight&&(i=_r67),!e&&_r67.scrollWidth>_r67.clientWidth&&(e=_r67),_r67=_r67.assignedSlot||_r67.parentNode;else{if(11!=_r67.nodeType)break;_r67=_r67.host;}return{x:e,y:i};}(t.contentDOM),this.atoms=t.state.facet(ns).map(function(e){return e(t);});var r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(Rt.allowMultipleSelections)&&function(t,e){var i=t.state.facet(Ni);return i.length?i[0](e):qe.mac?e.metaKey:e.ctrlKey;}(t,e),this.dragging=!(!function(t,e){var i=t.state.selection.main;if(i.empty)return!1;var s=ie(t.root);if(!s||0==s.rangeCount)return!0;var r=s.getRangeAt(0).getClientRects();for(var _t101=0;_t101<r.length;_t101++){var _i90=r[_t101];if(_i90.left<=e.clientX&&_i90.right>=e.clientX&&_i90.top<=e.clientY&&_i90.bottom>=e.clientY)return!0;}return!1;}(t,e)||1!=sr(e))&&null;}return _createClass(Fs,[{key:"start",value:function start(t){!1===this.dragging&&this.select(t);}},{key:"move",value:function move(t){var _this$scrollParents$x,_this$scrollParents$y;if(0==t.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(e=this.startEvent,i=t,Math.max(Math.abs(e.clientX-i.clientX),Math.abs(e.clientY-i.clientY))<10))return;var e,i;this.select(this.lastEvent=t);var s=0,r=0,n=0,h=0,l=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&(_this$scrollParents$x=this.scrollParents.x.getBoundingClientRect(),n=_this$scrollParents$x.left,l=_this$scrollParents$x.right,_this$scrollParents$x),this.scrollParents.y&&(_this$scrollParents$y=this.scrollParents.y.getBoundingClientRect(),h=_this$scrollParents$y.top,o=_this$scrollParents$y.bottom,_this$scrollParents$y);var u=us(this.view);t.clientX-u.left<=n+6?s=-qs(n-t.clientX):t.clientX+u.right>=l-6&&(s=qs(t.clientX-l)),t.clientY-u.top<=h+6?r=-qs(h-t.clientY):t.clientY+u.bottom>=o-6&&(r=qs(t.clientY-o)),this.setScrollSpeed(s,r);}},{key:"up",value:function up(t){null==this.dragging&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy();}},{key:"destroy",value:function destroy(){this.setScrollSpeed(0,0);var t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null;}},{key:"setScrollSpeed",value:function setScrollSpeed(t,e){var _this27=this;this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(function(){return _this27.scroll();},50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1);}},{key:"scroll",value:function scroll(){var _this$scrollSpeed=this.scrollSpeed,t=_this$scrollSpeed.x,e=_this$scrollSpeed.y;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),!1===this.dragging&&this.select(this.lastEvent);}},{key:"skipAtoms",value:function skipAtoms(t){var e=null;for(var _i91=0;_i91<t.ranges.length;_i91++){var _s77=t.ranges[_i91],_r68=null;if(_s77.empty){var _t102=As(this.atoms,_s77.from,0);_t102!=_s77.from&&(_r68=P.cursor(_t102,-1));}else{var _t103=As(this.atoms,_s77.from,-1),_e101=As(this.atoms,_s77.to,1);_t103==_s77.from&&_e101==_s77.to||(_r68=P.range(_s77.from==_s77.anchor?_t103:_e101,_s77.from==_s77.head?_t103:_e101));}_r68&&(e||(e=t.ranges.slice()),e[_i91]=_r68);}return e?P.create(e,t.mainIndex):t;}},{key:"select",value:function select(t){var e=this.view,i=this.skipAtoms(this.style.get(t,this.extend,this.multiple));!this.mustSelect&&i.eq(e.state.selection,!1===this.dragging)||this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1;}},{key:"update",value:function update(t){var _this28=this;t.transactions.some(function(t){return t.isUserEvent("input.type");})?this.destroy():this.style.update(t)&&setTimeout(function(){return _this28.select(_this28.lastEvent);},20);}}]);}();Vs=Object.create(null),Js=Object.create(null),Gs=qe.ie&&qe.ie_version<15||qe.ios&&qe.webkit_version<604;Js.scroll=function(t){t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft;},Vs.keydown=function(t,e){return t.inputState.setSelectionOrigin("select"),27==e.keyCode&&0!=t.inputState.tabFocusMode&&(t.inputState.tabFocusMode=Date.now()+2e3),!1;},Js.touchstart=function(t,e){t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer");},Js.touchmove=function(t){t.inputState.setSelectionOrigin("select.pointer");},Vs.mousedown=function(t,e){if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;var i=null;var _iterator60=_createForOfIteratorHelper(t.state.facet(ji)),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var _s82=_step60.value;if(i=_s82(t,e),i)break;}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}if(i||0!=e.button||(i=function(t,e){var i=Qs(t,e),s=sr(e),r=t.state.selection;return{update:function update(t){t.docChanged&&(i.pos=t.changes.mapPos(i.pos),r=r.map(t.changes));},get:function get(e,n,h){var l,o=Qs(t,e),u=_s(t,o.pos,o.bias,s);if(i.pos!=o.pos&&!n){var _e102=_s(t,i.pos,i.bias,s),_r70=Math.min(_e102.from,u.from),_n59=Math.max(_e102.to,u.to);u=_r70<u.from?P.range(_r70,_n59):P.range(_n59,_r70);}return n?r.replaceRange(r.main.extend(u.from,u.to)):h&&1==s&&r.ranges.length>1&&(l=function(t,e){for(var _i93=0;_i93<t.ranges.length;_i93++){var _t$ranges$_i=t.ranges[_i93],_s80=_t$ranges$_i.from,_r71=_t$ranges$_i.to;if(_s80<=e&&_r71>=e)return P.create(t.ranges.slice(0,_i93).concat(t.ranges.slice(_i93+1)),t.mainIndex==_i93?0:t.mainIndex-(t.mainIndex>_i93?1:0));}return null;}(r,o.pos))?l:h?r.addRange(u):P.create([u]);}};}(t,e)),i){var _s81=!t.hasFocus;t.inputState.startMouseSelection(new Fs(t,e,i,_s81)),_s81&&t.observer.ignore(function(){we(t.contentDOM);var e=t.root.activeElement;e&&!e.contains(t.contentDOM)&&e.blur();});var _r72=t.inputState.mouseSelection;if(_r72)return _r72.start(e),!1===_r72.dragging;}return!1;};Xs=function Xs(t,e,i){return e>=i.top&&e<=i.bottom&&t>=i.left&&t<=i.right;};Zs=qe.ie&&qe.ie_version<=11;tr=null,er=0,ir=0;Vs.dragstart=function(t,e){var i=t.state.selection.main;if(e.target.draggable){var _s83=t.docView.nearest(e.target);if(_s83&&_s83.isWidget){var _t107=_s83.posAtStart,_e103=_t107+_s83.length;(_t107>=i.to||_e103<=i.from)&&(i=P.range(_t107,_e103));}}var s=t.inputState;return s.mouseSelection&&(s.mouseSelection.dragging=!0),s.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",Us(t.state,qi,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1;},Vs.dragend=function(t){return t.inputState.draggedContent=null,!1;},Vs.drop=function(t,e){if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;var i=e.dataTransfer.files;if(i&&i.length){var _s84=Array(i.length),_r73=0,_n60=function _n60(){++_r73==i.length&&rr(t,e,_s84.filter(function(t){return null!=t;}).join(t.state.lineBreak),!1);};var _loop6=function _loop6(_t108){var e=new FileReader();e.onerror=_n60,e.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(e.result)||(_s84[_t108]=e.result),_n60();},e.readAsText(i[_t108]);};for(var _t108=0;_t108<i.length;_t108++){_loop6(_t108);}return!0;}{var _i94=e.dataTransfer.getData("Text");if(_i94)return rr(t,e,_i94,!0),!0;}return!1;},Vs.paste=function(t,e){if(t.state.readOnly)return!0;t.observer.flush();var i=Gs?null:e.clipboardData;return i?(Ks(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(function(t){var e=t.dom.parentNode;if(!e)return;var i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(function(){t.focus(),i.remove(),Ks(t,i.value);},50);}(t),!1);};nr=null;Vs.copy=Vs.cut=function(t,e){var _ref7=function(t){var e=[],i=[],s=!1;var _iterator61=_createForOfIteratorHelper(t.selection.ranges),_step61;try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){var _s86=_step61.value;_s86.empty||(e.push(t.sliceDoc(_s86.from,_s86.to)),i.push(_s86));}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}if(!e.length){var _r74=-1;var _iterator62=_createForOfIteratorHelper(t.selection.ranges),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var _s85=_step62.value.from;var _n61=t.doc.lineAt(_s85);_n61.number>_r74&&(e.push(_n61.text),i.push({from:_n61.from,to:Math.min(t.doc.length,_n61.to+1)})),_r74=_n61.number;}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}s=!0;}return{text:Us(t,qi,e.join(t.lineBreak)),ranges:i,linewise:s};}(t.state),i=_ref7.text,s=_ref7.ranges,r=_ref7.linewise;if(!i&&!r)return!1;nr=r?i:null,"cut"!=e.type||t.state.readOnly||t.dispatch({changes:s,scrollIntoView:!0,userEvent:"delete.cut"});var n=Gs?null:e.clipboardData;return n?(n.clearData(),n.setData("text/plain",i),!0):(function(t,e){var i=t.dom.parentNode;if(!i)return;var s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px",s.value=e,s.focus(),s.selectionEnd=e.length,s.selectionStart=0,setTimeout(function(){s.remove(),t.focus();},50);}(t,i),!1);};hr=gt.define();Js.focus=function(t){t.inputState.lastFocusTime=Date.now(),t.scrollDOM.scrollTop||!t.inputState.lastScrollTop&&!t.inputState.lastScrollLeft||(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),or(t);},Js.blur=function(t){t.observer.clearSelectionRange(),or(t);},Js.compositionstart=Js.compositionupdate=function(t){t.observer.editContext||(null==t.inputState.compositionFirstChange&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0));},Js.compositionend=function(t){t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,qe.chrome&&qe.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(function(){return t.observer.flush();}):setTimeout(function(){t.inputState.composing<0&&t.docView.hasComposition&&t.update([]);},50));},Js.contextmenu=function(t){t.inputState.lastContextMenu=Date.now();},Vs.beforeinput=function(t,e){var i,s;if("insertReplacementText"==e.inputType&&t.observer.editContext){var _s88=null===(i=e.dataTransfer)||void 0===i?void 0:i.getData("text/plain"),_r76=e.getTargetRanges();if(_s88&&_r76.length){var _e104=_r76[0],_i96=t.posAtDOM(_e104.startContainer,_e104.startOffset),_n62=t.posAtDOM(_e104.endContainer,_e104.endOffset);return Ls(t,{from:_i96,to:_n62,insert:t.state.toText(_s88)},null),!0;}}var r;if(qe.chrome&&qe.android&&(r=Ps.find(function(t){return t.inputType==e.inputType;}))&&(t.observer.delayAndroidKey(r.key,r.keyCode),"Backspace"==r.key||"Delete"==r.key)){var _e105=(null===(s=window.visualViewport)||void 0===s?void 0:s.height)||0;setTimeout(function(){var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>_e105+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus());},100);}return qe.ios&&"deleteContentForward"==e.inputType&&t.observer.flushSoon(),qe.safari&&"insertText"==e.inputType&&t.inputState.composing>=0&&setTimeout(function(){return Js.compositionend(t,e);},20),!1;};ur=new Set();fr=["pre-wrap","normal","pre-line","break-spaces"];ar=!1;dr=/*#__PURE__*/function(){function dr(t){_classCallCheck(this,dr);this.lineWrapping=t,this.doc=p.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30;}return _createClass(dr,[{key:"heightForGap",value:function heightForGap(t,e){var i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i;}},{key:"heightForLine",value:function heightForLine(t){if(!this.lineWrapping)return this.lineHeight;return(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight;}},{key:"setDoc",value:function setDoc(t){return this.doc=t,this;}},{key:"mustRefreshForWrapping",value:function mustRefreshForWrapping(t){return fr.indexOf(t)>-1!=this.lineWrapping;}},{key:"mustRefreshForHeights",value:function mustRefreshForHeights(t){var e=!1;for(var _i97=0;_i97<t.length;_i97++){var _s89=t[_i97];_s89<0?_i97++:this.heightSamples[Math.floor(10*_s89)]||(e=!0,this.heightSamples[Math.floor(10*_s89)]=!0);}return e;}},{key:"refresh",value:function refresh(t,e,i,s,r,n){var h=fr.indexOf(t)>-1,l=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=h;if(this.lineWrapping=h,this.lineHeight=e,this.charWidth=i,this.textHeight=s,this.lineLength=r,l){this.heightSamples={};for(var _t109=0;_t109<n.length;_t109++){var _e106=n[_t109];_e106<0?_t109++:this.heightSamples[Math.floor(10*_e106)]=!0;}}return l;}}]);}();pr=/*#__PURE__*/function(){function pr(t,e){_classCallCheck(this,pr);this.from=t,this.heights=e,this.index=0;}return _createClass(pr,[{key:"more",get:function get(){return this.index<this.heights.length;}}]);}();gr=/*#__PURE__*/function(){function gr(t,e,i,s,r){_classCallCheck(this,gr);this.from=t,this.length=e,this.top=i,this.height=s,this._content=r;}return _createClass(gr,[{key:"type",get:function get(){return"number"==typeof this._content?ii.Text:Array.isArray(this._content)?this._content:this._content.type;}},{key:"to",get:function get(){return this.from+this.length;}},{key:"bottom",get:function get(){return this.top+this.height;}},{key:"widget",get:function get(){return this._content instanceof hi?this._content.widget:null;}},{key:"widgetLineBreaks",get:function get(){return"number"==typeof this._content?this._content:0;}},{key:"join",value:function join(t){var e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new gr(this.from,this.length+t.length,this.top,this.height+t.height,e);}}]);}();mr=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t;}(mr||(mr={}));wr=.001;br=/*#__PURE__*/function(){function br(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:2;_classCallCheck(this,br);this.length=t,this.height=e,this.flags=i;}return _createClass(br,[{key:"outdated",get:function get(){return(2&this.flags)>0;},set:function set(t){this.flags=(t?2:0)|-3&this.flags;}},{key:"setHeight",value:function setHeight(t){this.height!=t&&(Math.abs(this.height-t)>wr&&(ar=!0),this.height=t);}},{key:"replace",value:function replace(t,e,i){return br.of(i);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){e.push(this);}},{key:"decomposeRight",value:function decomposeRight(t,e){e.push(this);}},{key:"applyChanges",value:function applyChanges(t,e,i,s){var r=this,n=i.doc;for(var _h41=s.length-1;_h41>=0;_h41--){var _s$_h=s[_h41],_l33=_s$_h.fromA,_o26=_s$_h.toA,_u21=_s$_h.fromB,_f15=_s$_h.toB,_a10=r.lineAt(_l33,mr.ByPosNoHeight,i.setDoc(e),0,0),_c8=_a10.to>=_o26?_a10:r.lineAt(_o26,mr.ByPosNoHeight,i,0,0);for(_f15+=_c8.to-_o26,_o26=_c8.to;_h41>0&&_a10.from<=s[_h41-1].toA;)_l33=s[_h41-1].fromA,_u21=s[_h41-1].fromB,_h41--,_l33<_a10.from&&(_a10=r.lineAt(_l33,mr.ByPosNoHeight,i,0,0));_u21+=_a10.from-_l33,_l33=_a10.from;var _d6=Or.build(i.setDoc(n),t,_u21,_f15);r=vr(r,r.replace(_l33,_o26,_d6));}return r.updateHeight(i,0);}}],[{key:"empty",value:function empty(){return new Mr(0,0);}},{key:"of",value:function of(t){if(1==t.length)return t[0];var e=0,i=t.length,s=0,r=0;for(;;)if(e==i){if(s>2*r){var _r77=t[e-1];_r77["break"]?t.splice(--e,1,_r77.left,null,_r77.right):t.splice(--e,1,_r77.left,_r77.right),i+=1+_r77["break"],s-=_r77.size;}else{if(!(r>2*s))break;{var _e107=t[i];_e107["break"]?t.splice(i,1,_e107.left,null,_e107.right):t.splice(i,1,_e107.left,_e107.right),i+=2+_e107["break"],r-=_e107.size;}}}else if(s<r){var _i98=t[e++];_i98&&(s+=_i98.size);}else{var _e108=t[--i];_e108&&(r+=_e108.size);}var n=0;return null==t[e-1]?(n=1,e--):null==t[e]&&(n=1,i++),new xr(br.of(t.slice(0,e)),n,br.of(t.slice(i)));}}]);}();br.prototype.size=1;kr=/*#__PURE__*/function(_br){function kr(t,e,i){var _this29;_classCallCheck(this,kr);_this29=_callSuper(this,kr,[t,e]),_this29.deco=i;return _this29;}_inherits(kr,_br);return _createClass(kr,[{key:"blockAt",value:function blockAt(t,e,i,s){return new gr(s,this.length,i,this.height,this.deco||0);}},{key:"lineAt",value:function lineAt(t,e,i,s,r){return this.blockAt(0,i,s,r);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){t<=r+this.length&&e>=r&&n(this.blockAt(0,i,s,r));}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;return s&&s.from<=e&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this;}},{key:"toString",value:function toString(){return"block(".concat(this.length,")");}}]);}(br);Mr=/*#__PURE__*/function(_kr){function Mr(t,e){var _this30;_classCallCheck(this,Mr);_this30=_callSuper(this,Mr,[t,e,null]),_this30.collapsed=0,_this30.widgetHeight=0,_this30.breaks=0;return _this30;}_inherits(Mr,_kr);return _createClass(Mr,[{key:"blockAt",value:function blockAt(t,e,i,s){return new gr(s,this.length,i,this.height,this.breaks);}},{key:"replace",value:function replace(t,e,i){var s=i[0];return 1==i.length&&(s instanceof Mr||s instanceof yr&&4&s.flags)&&Math.abs(this.length-s.length)<10?(s instanceof yr?s=new Mr(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):br.of(i);}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;return s&&s.from<=e&&s.more?this.setHeight(s.heights[s.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this;}},{key:"toString",value:function toString(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")");}}]);}(kr);yr=/*#__PURE__*/function(_br2){function yr(t){_classCallCheck(this,yr);return _callSuper(this,yr,[t,0]);}_inherits(yr,_br2);return _createClass(yr,[{key:"heightMetrics",value:function heightMetrics(t,e){var i,s=t.doc.lineAt(e).number,r=t.doc.lineAt(e+this.length).number,n=r-s+1,h=0;if(t.lineWrapping){var _e109=Math.min(this.height,t.lineHeight*n);i=_e109/n,this.length>n+1&&(h=(this.height-_e109)/(this.length-n-1));}else i=this.height/n;return{firstLine:s,lastLine:r,perLine:i,perChar:h};}},{key:"blockAt",value:function blockAt(t,e,i,s){var _this$heightMetrics=this.heightMetrics(e,s),r=_this$heightMetrics.firstLine,n=_this$heightMetrics.lastLine,h=_this$heightMetrics.perLine,l=_this$heightMetrics.perChar;if(e.lineWrapping){var _r78=s+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length)),_n63=e.doc.lineAt(_r78),_o27=h+_n63.length*l,_u22=Math.max(i,t-_o27/2);return new gr(_n63.from,_n63.length,_u22,_o27,0);}{var _s90=Math.max(0,Math.min(n-r,Math.floor((t-i)/h))),_e$doc$line=e.doc.line(r+_s90),_l34=_e$doc$line.from,_o28=_e$doc$line.length;return new gr(_l34,_o28,i+h*_s90,h,0);}}},{key:"lineAt",value:function lineAt(t,e,i,s,r){if(e==mr.ByHeight)return this.blockAt(t,i,s,r);if(e==mr.ByPosNoHeight){var _i$doc$lineAt=i.doc.lineAt(t),_e110=_i$doc$lineAt.from,_s91=_i$doc$lineAt.to;return new gr(_e110,_s91-_e110,0,0,0);}var _this$heightMetrics2=this.heightMetrics(i,r),n=_this$heightMetrics2.firstLine,h=_this$heightMetrics2.perLine,l=_this$heightMetrics2.perChar,o=i.doc.lineAt(t),u=h+o.length*l,f=o.number-n,a=s+h*f+l*(o.from-r-f);return new gr(o.from,o.length,Math.max(s,Math.min(a,s+this.height-u)),u,0);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){t=Math.max(t,r),e=Math.min(e,r+this.length);var _this$heightMetrics3=this.heightMetrics(i,r),h=_this$heightMetrics3.firstLine,l=_this$heightMetrics3.perLine,o=_this$heightMetrics3.perChar;for(var _u23=t,_f16=s;_u23<=e;){var _e111=i.doc.lineAt(_u23);if(_u23==t){var _i99=_e111.number-h;_f16+=l*_i99+o*(t-r-_i99);}var _s92=l+o*_e111.length;n(new gr(_e111.from,_e111.length,_f16,_s92,0)),_f16+=_s92,_u23=_e111.to+1;}}},{key:"replace",value:function replace(t,e,i){var s=this.length-e;if(s>0){var _t110=i[i.length-1];_t110 instanceof yr?i[i.length-1]=new yr(_t110.length+s):i.push(null,new yr(s-1));}if(t>0){var _e112=i[0];_e112 instanceof yr?i[0]=new yr(t+_e112.length):i.unshift(new yr(t-1),null);}return br.of(i);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){e.push(new yr(t-1),null);}},{key:"decomposeRight",value:function decomposeRight(t,e){e.push(null,new yr(this.length-t-1));}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;var r=e+this.length;if(s&&s.from<=e+this.length&&s.more){var _i100=[],_n64=Math.max(e,s.from),_h42=-1;for(s.from>e&&_i100.push(new yr(s.from-e-1).updateHeight(t,e));_n64<=r&&s.more;){var _e113=t.doc.lineAt(_n64).length;_i100.length&&_i100.push(null);var _r79=s.heights[s.index++];-1==_h42?_h42=_r79:Math.abs(_r79-_h42)>=wr&&(_h42=-2);var _l35=new Mr(_e113,_r79);_l35.outdated=!1,_i100.push(_l35),_n64+=_e113+1;}_n64<=r&&_i100.push(null,new yr(r-_n64).updateHeight(t,_n64));var _l36=br.of(_i100);return(_h42<0||Math.abs(_l36.height-this.height)>=wr||Math.abs(_h42-this.heightMetrics(t,e).perLine)>=wr)&&(ar=!0),vr(this,_l36);}return(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1),this;}},{key:"toString",value:function toString(){return"gap(".concat(this.length,")");}}]);}(br);xr=/*#__PURE__*/function(_br3){function xr(t,e,i){var _this31;_classCallCheck(this,xr);_this31=_callSuper(this,xr,[t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)]),_this31.left=t,_this31.right=i,_this31.size=t.size+i.size;return _this31;}_inherits(xr,_br3);return _createClass(xr,[{key:"break",get:function get(){return 1&this.flags;}},{key:"blockAt",value:function blockAt(t,e,i,s){var r=i+this.left.height;return t<r?this.left.blockAt(t,e,i,s):this.right.blockAt(t,e,r,s+this.left.length+this["break"]);}},{key:"lineAt",value:function lineAt(t,e,i,s,r){var n=s+this.left.height,h=r+this.left.length+this["break"],l=e==mr.ByHeight?t<n:t<h,o=l?this.left.lineAt(t,e,i,s,r):this.right.lineAt(t,e,i,n,h);if(this["break"]||(l?o.to<h:o.from>h))return o;var u=e==mr.ByPosNoHeight?mr.ByPosNoHeight:mr.ByPos;return l?o.join(this.right.lineAt(h,u,i,n,h)):this.left.lineAt(h,u,i,s,r).join(o);}},{key:"forEachLine",value:function forEachLine(t,e,i,s,r,n){var h=s+this.left.height,l=r+this.left.length+this["break"];if(this["break"])t<l&&this.left.forEachLine(t,e,i,s,r,n),e>=l&&this.right.forEachLine(t,e,i,h,l,n);else{var _o29=this.lineAt(l,mr.ByPos,i,s,r);t<_o29.from&&this.left.forEachLine(t,_o29.from-1,i,s,r,n),_o29.to>=t&&_o29.from<=e&&n(_o29),e>_o29.to&&this.right.forEachLine(_o29.to+1,e,i,h,l,n);}}},{key:"replace",value:function replace(t,e,i){var s=this.left.length+this["break"];if(e<s)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));var r=[];t>0&&this.decomposeLeft(t,r);var n=r.length;var _iterator64=_createForOfIteratorHelper(i),_step64;try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){var _t112=_step64.value;r.push(_t112);}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}if(t>0&&Sr(r,n-1),e<this.length){var _t111=r.length;this.decomposeRight(e,r),Sr(r,_t111);}return br.of(r);}},{key:"decomposeLeft",value:function decomposeLeft(t,e){var i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this["break"]&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e);}},{key:"decomposeRight",value:function decomposeRight(t,e){var i=this.left.length,s=i+this["break"];if(t>=s)return this.right.decomposeRight(t-s,e);t<i&&this.left.decomposeRight(t,e),this["break"]&&t<s&&e.push(null),e.push(this.right);}},{key:"balanced",value:function balanced(t,e){return t.size>2*e.size||e.size>2*t.size?br.of(this["break"]?[t,null,e]:[t,e]):(this.left=vr(this.left,t),this.right=vr(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this["break"]+e.length,this);}},{key:"updateHeight",value:function updateHeight(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=arguments.length>3?arguments[3]:undefined;var r=this.left,n=this.right,h=e+r.length+this["break"],l=null;return s&&s.from<=e+r.length&&s.more?l=r=r.updateHeight(t,e,i,s):r.updateHeight(t,e,i),s&&s.from<=h+n.length&&s.more?l=n=n.updateHeight(t,h,i,s):n.updateHeight(t,h,i),l?this.balanced(r,n):(this.height=this.left.height+this.right.height,this.outdated=!1,this);}},{key:"toString",value:function toString(){return this.left+(this["break"]?" ":"-")+this.right;}}]);}(br);Or=/*#__PURE__*/function(){function Or(t,e){_classCallCheck(this,Or);this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t;}return _createClass(Or,[{key:"isCovered",get:function get(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering;}},{key:"span",value:function span(t,e){if(this.lineStart>-1){var _t113=Math.min(e,this.lineEnd),_i101=this.nodes[this.nodes.length-1];_i101 instanceof Mr?_i101.length+=_t113-this.pos:(_t113>this.pos||!this.isCovered)&&this.nodes.push(new Mr(_t113-this.pos,-1)),this.writtenTo=_t113,e>_t113&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1);}this.pos=e;}},{key:"point",value:function point(t,e,i){if(t<e||i.heightRelevant){var _s93=i.widget?i.widget.estimatedHeight:0,_r80=i.widget?i.widget.lineBreaks:0;_s93<0&&(_s93=this.oracle.lineHeight);var _n65=e-t;i.block?this.addBlock(new kr(_n65,_s93,i)):(_n65||_r80||_s93>=5)&&this.addLineDeco(_s93,_r80,_n65);}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to);}},{key:"enterLine",value:function enterLine(){if(this.lineStart>-1)return;var _this$oracle$doc$line=this.oracle.doc.lineAt(this.pos),t=_this$oracle$doc$line.from,e=_this$oracle$doc$line.to;this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||null==this.nodes[this.nodes.length-1])&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new Mr(this.pos-t,-1)),this.writtenTo=this.pos;}},{key:"blankContent",value:function blankContent(t,e){var i=new yr(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i;}},{key:"ensureLine",value:function ensureLine(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof Mr)return t;var e=new Mr(0,-1);return this.nodes.push(e),e;}},{key:"addBlock",value:function addBlock(t){this.enterLine();var e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t);}},{key:"addLineDeco",value:function addLineDeco(t,e,i){var s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,t),s.breaks+=e,this.writtenTo=this.pos=this.pos+i;}},{key:"finish",value:function finish(t){var e=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||e instanceof Mr||this.isCovered?(this.writtenTo<this.pos||null==e)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos)):this.nodes.push(new Mr(0,-1));var i=t;var _iterator65=_createForOfIteratorHelper(this.nodes),_step65;try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){var _t114=_step65.value;_t114 instanceof Mr&&_t114.updateHeight(this.oracle,i),i+=_t114?_t114.length:1;}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}return this.nodes;}}],[{key:"build",value:function build(t,e,i,s){var r=new Or(i,t);return jt.spans(e,i,s,r,0),r.finish(i);}}]);}();Cr=/*#__PURE__*/function(){function Cr(){_classCallCheck(this,Cr);this.changes=[];}return _createClass(Cr,[{key:"compareRange",value:function compareRange(){}},{key:"comparePoint",value:function comparePoint(t,e,i,s){(t<e||i&&i.heightRelevant||s&&s.heightRelevant)&&oi(t,e,this.changes,5);}}]);}();Er=/*#__PURE__*/function(){function Er(t,e,i,s){_classCallCheck(this,Er);this.from=t,this.to=e,this.size=i,this.displaySize=s;}return _createClass(Er,[{key:"draw",value:function draw(t,e){return si.replace({widget:new Rr(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to);}}],[{key:"same",value:function same(t,e){if(t.length!=e.length)return!1;for(var _i103=0;_i103<t.length;_i103++){var _s96=t[_i103],_r81=e[_i103];if(_s96.from!=_r81.from||_s96.to!=_r81.to||_s96.size!=_r81.size)return!1;}return!0;}}]);}();Rr=/*#__PURE__*/function(_ei3){function Rr(t,e){var _this32;_classCallCheck(this,Rr);_this32=_callSuper(this,Rr),_this32.size=t,_this32.vertical=e;return _this32;}_inherits(Rr,_ei3);return _createClass(Rr,[{key:"eq",value:function eq(t){return t.size==this.size&&t.vertical==this.vertical;}},{key:"toDOM",value:function toDOM(){var t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t;}},{key:"estimatedHeight",get:function get(){return this.vertical?this.size:-1;}}]);}(ei);Tr=/*#__PURE__*/function(){function Tr(t){var _this33=this;_classCallCheck(this,Tr);this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Lr,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=gi.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;var e=t.facet(is).some(function(t){return"function"!=typeof t&&"cm-lineWrapping"==t["class"];});this.heightOracle=new dr(e),this.stateDeco=t.facet(ss).filter(function(t){return"function"!=typeof t;}),this.heightMap=br.empty().applyChanges(this.stateDeco,p.empty,this.heightOracle.setDoc(t.doc),[new as(0,0,0,t.doc.length)]);for(var _t115=0;_t115<2&&(this.viewport=this.getViewport(0,null),this.updateForViewport());_t115++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=si.set(this.lineGaps.map(function(t){return t.draw(_this33,!1);})),this.computeVisibleRanges();}return _createClass(Tr,[{key:"updateForViewport",value:function updateForViewport(){var _this34=this;var t=[this.viewport],e=this.state.selection.main;var _loop7=function _loop7(){var s=_i104?e.head:e.anchor;if(!t.some(function(_ref8){var t=_ref8.from,e=_ref8.to;return s>=t&&s<=e;})){var _this34$lineBlockAt=_this34.lineBlockAt(s),_e115=_this34$lineBlockAt.from,_i105=_this34$lineBlockAt.to;t.push(new Br(_e115,_i105));}};for(var _i104=0;_i104<=1;_i104++){_loop7();}return this.viewports=t.sort(function(t,e){return t.from-e.from;}),this.updateScaler();}},{key:"updateScaler",value:function updateScaler(){var t=this.scaler;return this.scaler=this.heightMap.height<=7e6?Lr:new jr(this.heightOracle,this.heightMap,this.viewports),t.eq(this.scaler)?0:2;}},{key:"updateViewportLines",value:function updateViewportLines(){var _this35=this;this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,function(t){_this35.viewportLines.push(zr(t,_this35.scaler));});}},{key:"update",value:function update(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;this.state=t.state;var i=this.stateDeco;this.stateDeco=this.state.facet(ss).filter(function(t){return"function"!=typeof t;});var s=t.changedRanges,r=as.extendWithRanges(s,function(t,e,i){var s=new Cr();return jt.compare(t,e,i,s,0),s.changes;}(i,this.stateDeco,t?t.changes:T.empty(this.state.doc.length))),n=this.heightMap.height,h=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);cr(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=n||ar)&&(t.flags|=2),h?(this.scrollAnchorPos=t.changes.mapPos(h.from,-1),this.scrollAnchorHeight=h.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);var l=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<l.from||e.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,e));var o=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,t.flags|=this.updateForViewport(),(o||!t.changes.empty||2&t.flags)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(t.changes),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Vi)&&(this.mustEnforceCursorAssoc=!0);}},{key:"measure",value:function measure(t){var e=t.contentDOM,i=window.getComputedStyle(e),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?gi.RTL:gi.LTR;var n=this.heightOracle.mustRefreshForWrapping(r),h=e.getBoundingClientRect(),l=n||this.mustMeasureContent||this.contentDOMHeight!=h.height;this.contentDOMHeight=h.height,this.mustMeasureContent=!1;var o=0,u=0;if(h.width&&h.height){var _de2=de(e,h),_t116=_de2.scaleX,_i106=_de2.scaleY;(_t116>.005&&Math.abs(this.scaleX-_t116)>.005||_i106>.005&&Math.abs(this.scaleY-_i106)>.005)&&(this.scaleX=_t116,this.scaleY=_i106,o|=16,n=l=!0);}var f=(parseInt(i.paddingTop)||0)*this.scaleY,a=(parseInt(i.paddingBottom)||0)*this.scaleY;this.paddingTop==f&&this.paddingBottom==a||(this.paddingTop=f,this.paddingBottom=a,o|=18),this.editorWidth!=t.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=t.scrollDOM.clientWidth,o|=16);var c=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=c&&(this.scrollAnchorHeight=-1,this.scrollTop=c),this.scrolledToBottom=Me(t.scrollDOM);var d=(this.printing?Dr:Ar)(e,this.paddingTop),g=d.top-this.pixelViewport.top,m=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;var w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(l=!0)),!this.inView&&!this.scrollTarget&&!function(t){var e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0;}(t.dom))return 0;var b=h.width;if(this.contentDOMWidth==b&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=h.width,this.editorHeight=t.scrollDOM.clientHeight,o|=16),l){var _e116=t.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(_e116)&&(n=!0),n||s.lineWrapping&&Math.abs(b-this.contentDOMWidth)>s.charWidth){var _t$docView$measureTex=t.docView.measureTextSize(),_i107=_t$docView$measureTex.lineHeight,_h43=_t$docView$measureTex.charWidth,_l37=_t$docView$measureTex.textHeight;n=_i107>0&&s.refresh(r,_i107,_h43,_l37,b/_h43,_e116),n&&(t.docView.minWidth=0,o|=16);}g>0&&m>0?u=Math.max(g,m):g<0&&m<0&&(u=Math.min(g,m)),cr();var _iterator66=_createForOfIteratorHelper(this.viewports),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var _i108=_step66.value;var _r82=_i108.from==this.viewport.from?_e116:t.docView.measureVisibleLineHeights(_i108);this.heightMap=(n?br.empty().applyChanges(this.stateDeco,p.empty,this.heightOracle,[new as(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(s,0,n,new pr(_i108.from,_r82));}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}ar&&(o|=2);}var v=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return v&&(2&o&&(o|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),o|=this.updateForViewport()),(2&o||v)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(n?[]:this.lineGaps,t)),o|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),o;}},{key:"visibleTop",get:function get(){return this.scaler.fromDOM(this.pixelViewport.top);}},{key:"visibleBottom",get:function get(){return this.scaler.fromDOM(this.pixelViewport.bottom);}},{key:"getViewport",value:function getViewport(t,e){var i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),s=this.heightMap,r=this.heightOracle,n=this.visibleTop,h=this.visibleBottom,l=new Br(s.lineAt(n-1e3*i,mr.ByHeight,r,0,0).from,s.lineAt(h+1e3*(1-i),mr.ByHeight,r,0,0).to);if(e){var _t117=e.range.head;if(_t117<l.from||_t117>l.to){var _i109,_n66=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),_h44=s.lineAt(_t117,mr.ByPos,r,0,0);_i109="center"==e.y?(_h44.top+_h44.bottom)/2-_n66/2:"start"==e.y||"nearest"==e.y&&_t117<l.from?_h44.top:_h44.bottom-_n66,l=new Br(s.lineAt(_i109-500,mr.ByHeight,r,0,0).from,s.lineAt(_i109+_n66+500,mr.ByHeight,r,0,0).to);}}return l;}},{key:"mapViewport",value:function mapViewport(t,e){var i=e.mapPos(t.from,-1),s=e.mapPos(t.to,1);return new Br(this.heightMap.lineAt(i,mr.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,mr.ByPos,this.heightOracle,0,0).to);}},{key:"viewportIsAppropriate",value:function viewportIsAppropriate(_ref9){var t=_ref9.from,e=_ref9.to;var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(!this.inView)return!0;var _this$heightMap$lineA=this.heightMap.lineAt(t,mr.ByPos,this.heightOracle,0,0),s=_this$heightMap$lineA.top,_this$heightMap$lineA2=this.heightMap.lineAt(e,mr.ByPos,this.heightOracle,0,0),r=_this$heightMap$lineA2.bottom,n=this.visibleTop,h=this.visibleBottom;return(0==t||s<=n-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=h+Math.max(10,Math.min(i,250)))&&s>n-2e3&&r<h+2e3;}},{key:"mapLineGaps",value:function mapLineGaps(t,e){if(!t.length||e.empty)return t;var i=[];var _iterator67=_createForOfIteratorHelper(t),_step67;try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){var _s97=_step67.value;e.touchesRange(_s97.from,_s97.to)||i.push(new Er(e.mapPos(_s97.from),e.mapPos(_s97.to),_s97.size,_s97.displaySize));}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}return i;}},{key:"ensureLineGaps",value:function ensureLineGaps(t,e){var _this36=this;var i=this.heightOracle.lineWrapping,s=i?1e4:2e3,r=s>>1,n=s<<1;if(this.defaultTextDirection!=gi.LTR&&!i)return[];var h=[],_l38=function l(s,n,o,u){if(n-s<r)return;var f=_this36.state.selection.main,a=[f.from];f.empty||a.push(f.to);for(var _i110=0,_a11=a;_i110<_a11.length;_i110++){var _t118=_a11[_i110];if(_t118>s&&_t118<n)return _l38(s,_t118-10,o,u),void _l38(_t118+10,n,o,u);}var c=function(t,e){var _iterator68=_createForOfIteratorHelper(t),_step68;try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){var _i111=_step68.value;if(e(_i111))return _i111;}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}return;}(t,function(t){return t.from>=o.from&&t.to<=o.to&&Math.abs(t.from-s)<r&&Math.abs(t.to-n)<r&&!a.some(function(e){return t.from<e&&t.to>e;});});if(!c){if(n<o.to&&e&&i&&e.visibleRanges.some(function(t){return t.from<=n&&t.to>=n;})){var _t119=e.moveToLineBoundary(P.cursor(n),!1,!0).head;_t119>s&&(n=_t119);}var _t120=_this36.gapSize(o,s,n,u);c=new Er(s,n,_t120,i||_t120<2e6?_t120:2e6);}h.push(c);},o=function o(e){if(e.length<n||e.type!=ii.Text)return;var r=function(t,e,i){var s=[],r=t,n=0;jt.spans(i,t,e,{span:function span(){},point:function point(t,e){t>r&&(s.push({from:r,to:t}),n+=t-r),r=e;}},20),r<e&&(s.push({from:r,to:e}),n+=e-r);return{total:n,ranges:s};}(e.from,e.to,_this36.stateDeco);if(r.total<n)return;var h,o,u=_this36.scrollTarget?_this36.scrollTarget.range.head:null;if(i){var _t121,_i112,_n67=s/_this36.heightOracle.lineLength*_this36.heightOracle.lineHeight;if(null!=u){var _s98=Nr(r,u),_h45=((_this36.visibleBottom-_this36.visibleTop)/2+_n67)/e.height;_t121=_s98-_h45,_i112=_s98+_h45;}else _t121=(_this36.visibleTop-e.top-_n67)/e.height,_i112=(_this36.visibleBottom-e.top+_n67)/e.height;h=Ir(r,_t121),o=Ir(r,_i112);}else{var _i113=r.total*_this36.heightOracle.charWidth,_n68=s*_this36.heightOracle.charWidth,_l39=0;if(_i113>2e6){var _iterator69=_createForOfIteratorHelper(t),_step69;try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){var _i114=_step69.value;_i114.from>=e.from&&_i114.from<e.to&&_i114.size!=_i114.displaySize&&_i114.from*_this36.heightOracle.charWidth+_l39<_this36.pixelViewport.left&&(_l39=_i114.size-_i114.displaySize);}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}}var _f17,_a12,_c9=_this36.pixelViewport.left+_l39,_d7=_this36.pixelViewport.right+_l39;if(null!=u){var _t122=Nr(r,u),_e117=((_d7-_c9)/2+_n68)/_i113;_f17=_t122-_e117,_a12=_t122+_e117;}else _f17=(_c9-_n68)/_i113,_a12=(_d7+_n68)/_i113;h=Ir(r,_f17),o=Ir(r,_a12);}h>e.from&&_l38(e.from,h,e,r),o<e.to&&_l38(o,e.to,e,r);};var _iterator70=_createForOfIteratorHelper(this.viewportLines),_step70;try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){var _t123=_step70.value;Array.isArray(_t123.type)?_t123.type.forEach(o):o(_t123);}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}return h;}},{key:"gapSize",value:function gapSize(t,e,i,s){var r=Nr(s,i)-Nr(s,e);return this.heightOracle.lineWrapping?t.height*r:s.total*this.heightOracle.charWidth*r;}},{key:"updateLineGaps",value:function updateLineGaps(t){var _this37=this;Er.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=si.set(t.map(function(t){return t.draw(_this37,_this37.heightOracle.lineWrapping);})));}},{key:"computeVisibleRanges",value:function computeVisibleRanges(t){var e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));var i=[];jt.spans(e,this.viewport.from,this.viewport.to,{span:function span(t,e){i.push({from:t,to:e});},point:function point(){}},20);var s=0;if(i.length!=this.visibleRanges.length)s=12;else for(var _e118=0;_e118<i.length&&!(8&s);_e118++){var _r83=this.visibleRanges[_e118],_n69=i[_e118];_r83.from==_n69.from&&_r83.to==_n69.to||(s|=4,t&&t.mapPos(_r83.from,-1)==_n69.from&&t.mapPos(_r83.to,1)==_n69.to||(s|=8));}return this.visibleRanges=i,s;}},{key:"lineBlockAt",value:function lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(function(e){return e.from<=t&&e.to>=t;})||zr(this.heightMap.lineAt(t,mr.ByPos,this.heightOracle,0,0),this.scaler);}},{key:"lineBlockAtHeight",value:function lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(function(e){return e.top<=t&&e.bottom>=t;})||zr(this.heightMap.lineAt(this.scaler.fromDOM(t),mr.ByHeight,this.heightOracle,0,0),this.scaler);}},{key:"scrollAnchorAt",value:function scrollAnchorAt(t){var e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0];}},{key:"elementAtHeight",value:function elementAtHeight(t){return zr(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler);}},{key:"docHeight",get:function get(){return this.scaler.toDOM(this.heightMap.height);}},{key:"contentHeight",get:function get(){return this.docHeight+this.paddingTop+this.paddingBottom;}}]);}();Br=/*#__PURE__*/_createClass(function Br(t,e){_classCallCheck(this,Br);this.from=t,this.to=e;});Lr={toDOM:function toDOM(t){return t;},fromDOM:function fromDOM(t){return t;},scale:1,eq:function eq(t){return t==this;}};jr=/*#__PURE__*/function(){function jr(t,e,i){_classCallCheck(this,jr);var s=0,r=0,n=0;this.viewports=i.map(function(_ref11){var i=_ref11.from,r=_ref11.to;var n=e.lineAt(i,mr.ByPos,t,0,0).top,h=e.lineAt(r,mr.ByPos,t,0,0).bottom;return s+=h-n,{from:i,to:r,top:n,bottom:h,domTop:0,domBottom:0};}),this.scale=(7e6-s)/(e.height-s);var _iterator72=_createForOfIteratorHelper(this.viewports),_step72;try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){var _t125=_step72.value;_t125.domTop=n+(_t125.top-r)*this.scale,n=_t125.domBottom=_t125.domTop+(_t125.bottom-_t125.top),r=_t125.bottom;}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}}return _createClass(jr,[{key:"toDOM",value:function toDOM(t){for(var _e119=0,_i116=0,_s100=0;;_e119++){var _r86=_e119<this.viewports.length?this.viewports[_e119]:null;if(!_r86||t<_r86.top)return _s100+(t-_i116)*this.scale;if(t<=_r86.bottom)return _r86.domTop+(t-_r86.top);_i116=_r86.bottom,_s100=_r86.domBottom;}}},{key:"fromDOM",value:function fromDOM(t){for(var _e120=0,_i117=0,_s101=0;;_e120++){var _r87=_e120<this.viewports.length?this.viewports[_e120]:null;if(!_r87||t<_r87.domTop)return _i117+(t-_s101)/this.scale;if(t<=_r87.domBottom)return _r87.top+(t-_r87.domTop);_i117=_r87.bottom,_s101=_r87.domBottom;}}},{key:"eq",value:function eq(t){return t instanceof jr&&this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every(function(e,i){return e.from==t.viewports[i].from&&e.to==t.viewports[i].to;});}}]);}();Hr=q.define({combine:function combine(t){return t.join(" ");}}),Pr=q.define({combine:function combine(t){return t.indexOf(!0)>-1;}}),$r=Zt.newName(),Wr=Zt.newName(),qr=Zt.newName(),Fr={"&light":"."+Wr,"&dark":"."+qr};Jr=Vr("."+$r,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:'url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>\')',backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Fr),Gr={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Ur=qe.ie&&qe.ie_version<=11;Kr=/*#__PURE__*/function(){function Kr(t){var _this38=this;_classCallCheck(this,Kr);this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new pe(),this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(function(e){var _iterator73=_createForOfIteratorHelper(e),_step73;try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){var _t126=_step73.value;_this38.queue.push(_t126);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}(qe.ie&&qe.ie_version<=11||qe.ios&&t.composing)&&e.some(function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length;})?_this38.flushSoon():_this38.flush();}),!window.EditContext||!1===t.constructor.EDIT_CONTEXT||qe.chrome&&qe.chrome_version<126||(this.editContext=new Yr(t),t.state.facet(Xi)&&(t.contentDOM.editContext=this.editContext.editContext)),Ur&&(this.onCharData=function(t){_this38.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),_this38.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver(function(){var t;(null===(t=_this38.view.docView)||void 0===t?void 0:t.lastUpdate)<Date.now()-75&&_this38.onResize();}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(function(t){_this38.parentCheck<0&&(_this38.parentCheck=setTimeout(_this38.listenForScroll.bind(_this38),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=_this38.intersecting&&(_this38.intersecting=!_this38.intersecting,_this38.intersecting!=_this38.view.inView&&_this38.onScrollChanged(document.createEvent("Event")));},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(function(t){t.length>0&&t[t.length-1].intersectionRatio>0&&_this38.onScrollChanged(document.createEvent("Event"));},{})),this.listenForScroll(),this.readSelectionRange();}return _createClass(Kr,[{key:"onScrollChanged",value:function onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure();}},{key:"onScroll",value:function onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t);}},{key:"onResize",value:function onResize(){var _this39=this;this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(function(){_this39.resizeTimeout=-1,_this39.view.requestMeasure();},50));}},{key:"onPrint",value:function onPrint(t){var _this40=this;("change"!=t.type&&t.type||t.matches)&&(this.view.viewState.printing=!0,this.view.measure(),setTimeout(function(){_this40.view.viewState.printing=!1,_this40.view.requestMeasure();},500));}},{key:"updateGaps",value:function updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(function(e,i){return e!=t[i];}))){this.gapIntersection.disconnect();var _iterator74=_createForOfIteratorHelper(t),_step74;try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){var _e121=_step74.value;this.gapIntersection.observe(_e121);}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}this.gaps=t;}}},{key:"onSelectionChange",value:function onSelectionChange(t){var e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;var i=this.view,s=this.selectionRange;if(i.state.facet(Xi)?i.root.activeElement!=this.dom:!re(this.dom,s))return;var r=s.anchorNode&&i.docView.nearest(s.anchorNode);r&&r.ignoreEvent(t)?e||(this.selectionChanged=!1):(qe.ie&&qe.ie_version<=11||qe.android&&qe.chrome)&&!i.state.selection.main.empty&&s.focusNode&&he(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1);}},{key:"readSelectionRange",value:function readSelectionRange(){var t=this.view,e=ie(t.root);if(!e)return!1;var i=qe.safari&&11==t.root.nodeType&&t.root.activeElement==this.dom&&function(t,e){if(e.getComposedRanges){var _i118=e.getComposedRanges(t.root)[0];if(_i118)return Xr(t,_i118);}var i=null;function s(t){t.preventDefault(),t.stopImmediatePropagation(),i=t.getTargetRanges()[0];}return t.contentDOM.addEventListener("beforeinput",s,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",s,!0),i?Xr(t,i):null;}(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;var s=re(this.dom,i);return s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&function(t,e){var i=e.focusNode,s=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=s)return!1;for(s=Math.min(s,fe(i));;)if(s){if(1!=i.nodeType)return!1;var _t127=i.childNodes[s-1];"false"==_t127.contentEditable?s--:(i=_t127,s=fe(i));}else{if(i==t)return!0;s=le(i),i=i.parentNode;}}(this.dom,i)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(i),s&&(this.selectionChanged=!0),!0);}},{key:"setSelectionRange",value:function setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1;}},{key:"clearSelectionRange",value:function clearSelectionRange(){this.selectionRange.set(null,0,null,0);}},{key:"listenForScroll",value:function listenForScroll(){this.parentCheck=-1;var t=0,e=null;for(var _i119=this.dom;_i119;)if(1==_i119.nodeType)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==_i119?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(_i119),_i119=_i119.assignedSlot||_i119.parentNode;else{if(11!=_i119.nodeType)break;_i119=_i119.host;}if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){var _iterator75=_createForOfIteratorHelper(this.scrollTargets),_step75;try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){var _t128=_step75.value;_t128.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}var _iterator76=_createForOfIteratorHelper(this.scrollTargets=e),_step76;try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){var _t129=_step76.value;_t129.addEventListener("scroll",this.onScroll);}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}}}},{key:"ignore",value:function ignore(t){if(!this.active)return t();try{return this.stop(),t();}finally{this.start(),this.clear();}}},{key:"start",value:function start(){this.active||(this.observer.observe(this.dom,Gr),Ur&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0);}},{key:"stop",value:function stop(){this.active&&(this.active=!1,this.observer.disconnect(),Ur&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData));}},{key:"clear",value:function clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1;}},{key:"delayAndroidKey",value:function delayAndroidKey(t,e){var _this41=this;var i;if(!this.delayedAndroidKey){var _t130=function _t130(){var t=_this41.delayedAndroidKey;if(t){_this41.clearDelayedAndroidKey(),_this41.view.inputState.lastKeyCode=t.keyCode,_this41.view.inputState.lastKeyTime=Date.now(),!_this41.flush()&&t.force&&ve(_this41.dom,t.key,t.keyCode);}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(_t130);}this.delayedAndroidKey&&"Enter"!=t||(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(null===(i=this.delayedAndroidKey)||void 0===i?void 0:i.force)});}},{key:"clearDelayedAndroidKey",value:function clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1;}},{key:"flushSoon",value:function flushSoon(){var _this42=this;this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(function(){_this42.delayedFlush=-1,_this42.flush();}));}},{key:"forceFlush",value:function forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush();}},{key:"pendingRecords",value:function pendingRecords(){var _iterator77=_createForOfIteratorHelper(this.observer.takeRecords()),_step77;try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){var _t131=_step77.value;this.queue.push(_t131);}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}return this.queue;}},{key:"processRecords",value:function processRecords(){var t=this.pendingRecords();t.length&&(this.queue=[]);var e=-1,i=-1,s=!1;var _iterator78=_createForOfIteratorHelper(t),_step78;try{for(_iterator78.s();!(_step78=_iterator78.n()).done;){var _t133;var _r88=_step78.value;var _t132=this.readMutation(_r88);_t132&&(_t132.typeOver&&(s=!0),-1==e?(_t133=_t132,e=_t133.from,i=_t133.to,_t133):(e=Math.min(_t132.from,e),i=Math.max(_t132.to,i)));}}catch(err){_iterator78.e(err);}finally{_iterator78.f();}return{from:e,to:i,typeOver:s};}},{key:"readChange",value:function readChange(){var _this$processRecords=this.processRecords(),t=_this$processRecords.from,e=_this$processRecords.to,i=_this$processRecords.typeOver,s=this.selectionChanged&&re(this.dom,this.selectionRange);if(t<0&&!s)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;var r=new Is(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r;}},{key:"flush",value:function flush(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();var e=this.readChange();if(!e)return this.view.requestMeasure(),!1;var i=this.view.state,s=Ns(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s;}},{key:"readMutation",value:function readMutation(t){var e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty("attributes"==t.type),"attributes"==t.type&&(e.flags|=4),"childList"==t.type){var _i120=_r(e,t.previousSibling||t.target.previousSibling,-1),_s102=_r(e,t.nextSibling||t.target.nextSibling,1);return{from:_i120?e.posAfter(_i120):e.posAtStart,to:_s102?e.posBefore(_s102):e.posAtEnd,typeOver:!1};}return"characterData"==t.type?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null;}},{key:"setWindow",value:function setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win));}},{key:"addWindowListeners",value:function addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange);}},{key:"removeWindowListeners",value:function removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange);}},{key:"update",value:function update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(Xi)!=t.state.facet(Xi)&&(t.view.contentDOM.editContext=t.state.facet(Xi)?this.editContext.editContext:null));}},{key:"destroy",value:function destroy(){var t,e,i;this.stop(),null===(t=this.intersection)||void 0===t||t.disconnect(),null===(e=this.gapIntersection)||void 0===e||e.disconnect(),null===(i=this.resizeScroll)||void 0===i||i.disconnect();var _iterator79=_createForOfIteratorHelper(this.scrollTargets),_step79;try{for(_iterator79.s();!(_step79=_iterator79.n()).done;){var _t134=_step79.value;_t134.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator79.e(err);}finally{_iterator79.f();}this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy());}}]);}();Yr=/*#__PURE__*/function(){function Yr(t){var _this43=this;_classCallCheck(this,Yr);this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(t.state);var e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=function(e){var i=t.state.selection.main,s=i.anchor,r=i.head,n=_this43.toEditorPos(e.updateRangeStart),h=_this43.toEditorPos(e.updateRangeEnd);t.inputState.composing>=0&&!_this43.composing&&(_this43.composing={contextBase:e.updateRangeStart,editorBase:n,drifted:!1});var l={from:n,to:h,insert:p.of(e.text.split("\n"))};if(l.from==_this43.from&&s<_this43.from?l.from=s:l.to==_this43.to&&s>_this43.to&&(l.to=s),l.from!=l.to||l.insert.length){if((qe.mac||qe.android)&&l.from==r-1&&/^\. ?$/.test(e.text)&&"off"==t.contentDOM.getAttribute("autocorrect")&&(l={from:n,to:h,insert:p.of([e.text.replace("."," ")])}),_this43.pendingContextChange=l,!t.state.readOnly){var _i121=_this43.to-_this43.from+(l.to-l.from+l.insert.length);Ls(t,l,P.single(_this43.toEditorPos(e.selectionStart,_i121),_this43.toEditorPos(e.selectionEnd,_i121)));}_this43.pendingContextChange&&(_this43.revertPending(t.state),_this43.setSelection(t.state));}else{var _s104=P.single(_this43.toEditorPos(e.selectionStart),_this43.toEditorPos(e.selectionEnd));_s104.main.eq(i)||t.dispatch({selection:_s104,userEvent:"select"});}},this.handlers.characterboundsupdate=function(i){var s=[],r=null;for(var _e122=_this43.toEditorPos(i.rangeStart),_n71=_this43.toEditorPos(i.rangeEnd);_e122<_n71;_e122++){var _i122=t.coordsForChar(_e122);r=_i122&&new DOMRect(_i122.left,_i122.top,_i122.right-_i122.left,_i122.bottom-_i122.top)||r||new DOMRect(),s.push(r);}e.updateCharacterBounds(i.rangeStart,s);},this.handlers.textformatupdate=function(e){var i=[];var _iterator80=_createForOfIteratorHelper(e.getTextFormats()),_step80;try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){var _t135=_step80.value;var _e123=_t135.underlineStyle,_s105=_t135.underlineThickness;if("None"!=_e123&&"None"!=_s105){var _r90=_this43.toEditorPos(_t135.rangeStart),_n72=_this43.toEditorPos(_t135.rangeEnd);if(_r90<_n72){var _t136="text-decoration: underline ".concat("Dashed"==_e123?"dashed ":"Squiggle"==_e123?"wavy ":"").concat("Thin"==_s105?1:2,"px");i.push(si.mark({attributes:{style:_t136}}).range(_r90,_n72));}}}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}t.dispatch({effects:Ki.of(si.set(i))});},this.handlers.compositionstart=function(){t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0);},this.handlers.compositionend=function(){if(t.inputState.composing=-1,t.inputState.compositionFirstChange=null,_this43.composing){var _e124=_this43.composing.drifted;_this43.composing=null,_e124&&_this43.reset(t.state);}};for(var _t137 in this.handlers)e.addEventListener(_t137,this.handlers[_t137]);this.measureReq={read:function read(t){_this43.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());var e=ie(t.root);e&&e.rangeCount&&_this43.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect());}};}return _createClass(Yr,[{key:"applyEdits",value:function applyEdits(t){var _this44=this;var e=0,i=!1,s=this.pendingContextChange;return t.changes.iterChanges(function(r,n,h,l,o){if(i)return;var u=o.length-(n-r);if(s&&n>=s.to){if(s.from==r&&s.to==n&&s.insert.eq(o))return s=_this44.pendingContextChange=null,e+=u,void(_this44.to+=u);s=null,_this44.revertPending(t.state);}if(r+=e,(n+=e)<=_this44.from)_this44.from+=u,_this44.to+=u;else if(r<_this44.to){if(r<_this44.from||n>_this44.to||_this44.to-_this44.from+o.length>3e4)return void(i=!0);_this44.editContext.updateText(_this44.toContextPos(r),_this44.toContextPos(n),o.toString()),_this44.to+=u;}e+=u;}),s&&!i&&this.revertPending(t.state),!i;}},{key:"update",value:function update(t){var _this45=this;var e=this.pendingContextChange;this.composing&&(this.composing.drifted||t.transactions.some(function(t){return!t.isUserEvent("input.type")&&t.changes.touchesRange(_this45.from,_this45.to);}))?(this.composing.drifted=!0,this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)):this.applyEdits(t)&&this.rangeIsValid(t.state)?(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state):(this.pendingContextChange=null,this.reset(t.state)),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq);}},{key:"resetRange",value:function resetRange(t){var e=t.selection.main.head;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4);}},{key:"reset",value:function reset(t){this.resetRange(t),this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to)),this.setSelection(t);}},{key:"revertPending",value:function revertPending(t){var e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to));}},{key:"setSelection",value:function setSelection(t){var e=t.selection.main,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),s=this.toContextPos(e.head);this.editContext.selectionStart==i&&this.editContext.selectionEnd==s||this.editContext.updateSelection(i,s);}},{key:"rangeIsValid",value:function rangeIsValid(t){var e=t.selection.main.head;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>3e4);}},{key:"toEditorPos",value:function toEditorPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.to-this.from;t=Math.min(t,e);var i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from;}},{key:"toContextPos",value:function toContextPos(t){var e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from;}},{key:"destroy",value:function destroy(){for(var _t138 in this.handlers)this.editContext.removeEventListener(_t138,this.handlers[_t138]);}}]);}();_export("E",Qr=/*#__PURE__*/function(){function Qr(){var _this46=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Qr);var e;this.plugins=[],this.pluginMap=new Map(),this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),t.parent&&t.parent.appendChild(this.dom);var i=t.dispatch;this.dispatchTransactions=t.dispatchTransactions||i&&function(t){return t.forEach(function(t){return i(t,_this46);});}||function(t){return _this46.update(t);},this.dispatch=this.dispatch.bind(this),this._root=t.root||function(t){for(;t;){if(t&&(9==t.nodeType||11==t.nodeType&&t.host))return t;t=t.assignedSlot||t.parentNode;}return null;}(t.parent)||document,this.viewState=new Tr(t.state||Rt.create(t)),t.scrollTo&&t.scrollTo.is(Ui)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Qi).map(function(t){return new ts(t);});var _iterator81=_createForOfIteratorHelper(this.plugins),_step81;try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){var _t139=_step81.value;_t139.update(this);}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}this.observer=new Kr(this),this.inputState=new js(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ds(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),(null===(e=document.fonts)||void 0===e?void 0:e.ready)&&document.fonts.ready.then(function(){return _this46.requestMeasure();});}return _createClass(Qr,[{key:"state",get:function get(){return this.viewState.state;}},{key:"viewport",get:function get(){return this.viewState.viewport;}},{key:"visibleRanges",get:function get(){return this.viewState.visibleRanges;}},{key:"inView",get:function get(){return this.viewState.inView;}},{key:"composing",get:function get(){return this.inputState.composing>0;}},{key:"compositionStarted",get:function get(){return this.inputState.composing>=0;}},{key:"root",get:function get(){return this._root;}},{key:"win",get:function get(){return this.dom.ownerDocument.defaultView||window;}},{key:"dispatch",value:function dispatch(){var _this$state;for(var _len3=arguments.length,t=new Array(_len3),_key3=0;_key3<_len3;_key3++){t[_key3]=arguments[_key3];}var e=1==t.length&&t[0]instanceof vt?t:1==t.length&&Array.isArray(t[0])?t[0]:[(_this$state=this.state).update.apply(_this$state,t)];this.dispatchTransactions(e,this);}},{key:"update",value:function update(t){var _this47=this;if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var e,i=!1,s=!1,r=this.state;var _iterator82=_createForOfIteratorHelper(t),_step82;try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){var _e126=_step82.value;if(_e126.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=_e126.state;}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}if(this.destroyed)return void(this.viewState.state=r);var n=this.hasFocus,h=0,l=null;t.some(function(t){return t.annotation(hr);})?(this.inputState.notifiedFocused=n,h=1):n!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=n,l=lr(r,n),l||(h=1));var o=this.observer.delayedAndroidKey,u=null;if(o?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(u=null)):this.observer.clear(),r.facet(Rt.phrases)!=this.state.facet(Rt.phrases))return this.setState(r);e=cs.create(this,r,t),e.flags|=h;var f=this.viewState.scrollTarget;try{this.updateState=2;var _iterator83=_createForOfIteratorHelper(t),_step83;try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){var _e125=_step83.value;if(f&&(f=f.map(_e125.changes)),_e125.scrollIntoView){var _t140=_e125.state.selection.main;f=new Gi(_t140.empty?_t140:P.cursor(_t140.head,_t140.head>_t140.anchor?-1:1));}var _iterator84=_createForOfIteratorHelper(_e125.effects),_step84;try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){var _t141=_step84.value;_t141.is(Ui)&&(f=_t141.value.clip(this.state));}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}this.viewState.update(e,f),this.bidiCache=en.update(this.bidiCache,e.changes),e.empty||(this.updatePlugins(e),this.inputState.update(e)),i=this.docView.update(e),this.state.facet(fs)!=this.styleModules&&this.mountStyles(),s=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(i,t.some(function(t){return t.isUserEvent("select.pointer");}));}finally{this.updateState=0;}if(e.startState.facet(Hr)!=e.state.facet(Hr)&&(this.viewState.mustMeasureContent=!0),(i||s||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!e.empty){var _iterator85=_createForOfIteratorHelper(this.state.facet(Hi)),_step85;try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){var _t142=_step85.value;try{_t142(e);}catch(t){_i(this.state,t,"update listener");}}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}}(l||u)&&Promise.resolve().then(function(){l&&_this47.state==l.startState&&_this47.dispatch(l),u&&!Ns(_this47,u)&&o.force&&ve(_this47.contentDOM,o.key,o.keyCode);});}},{key:"setState",value:function setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=t);this.updateState=2;var e=this.hasFocus;try{var _iterator86=_createForOfIteratorHelper(this.plugins),_step86;try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){var _t143=_step86.value;_t143.destroy(this);}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}this.viewState=new Tr(t),this.plugins=t.facet(Qi).map(function(t){return new ts(t);}),this.pluginMap.clear();var _iterator87=_createForOfIteratorHelper(this.plugins),_step87;try{for(_iterator87.s();!(_step87=_iterator87.n()).done;){var _t144=_step87.value;_t144.update(this);}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}this.docView.destroy(),this.docView=new ds(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[];}finally{this.updateState=0;}e&&this.focus(),this.requestMeasure();}},{key:"updatePlugins",value:function updatePlugins(t){var e=t.startState.facet(Qi),i=t.state.facet(Qi);if(e!=i){var _s106=[];var _iterator88=_createForOfIteratorHelper(i),_step88;try{for(_iterator88.s();!(_step88=_iterator88.n()).done;){var _r91=_step88.value;var _i123=e.indexOf(_r91);if(_i123<0)_s106.push(new ts(_r91));else{var _e127=this.plugins[_i123];_e127.mustUpdate=t,_s106.push(_e127);}}}catch(err){_iterator88.e(err);}finally{_iterator88.f();}var _iterator89=_createForOfIteratorHelper(this.plugins),_step89;try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){var _e128=_step89.value;_e128.mustUpdate!=t&&_e128.destroy(this);}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}this.plugins=_s106,this.pluginMap.clear();}else{var _iterator90=_createForOfIteratorHelper(this.plugins),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var _e129=_step90.value;_e129.mustUpdate=t;}}catch(err){_iterator90.e(err);}finally{_iterator90.f();}}for(var _t145=0;_t145<this.plugins.length;_t145++)this.plugins[_t145].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins);}},{key:"docViewUpdate",value:function docViewUpdate(){var _iterator91=_createForOfIteratorHelper(this.plugins),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var _t146=_step91.value;var _e130=_t146.value;if(_e130&&_e130.docViewUpdate)try{_e130.docViewUpdate(this);}catch(t){_i(this.state,t,"doc view update listener");}}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}}},{key:"measure",value:function measure(){var _this48=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,t&&this.observer.forceFlush();var e=null,i=this.scrollDOM,s=i.scrollTop*this.scaleY,_this$viewState=this.viewState,r=_this$viewState.scrollAnchorPos,n=_this$viewState.scrollAnchorHeight;Math.abs(s-this.viewState.scrollTop)>1&&(n=-1),this.viewState.scrollAnchorHeight=-1;try{for(var _t147=0;;_t147++){var _ref13;if(n<0)if(Me(i))r=-1,n=this.viewState.heightMap.height;else{var _t148=this.viewState.scrollAnchorAt(s);r=_t148.from,n=_t148.top;}this.updateState=1;var _h46=this.viewState.measure(this);if(!_h46&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(_t147>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break;}var _l40=[];4&_h46||(_ref13=[_l40,this.measureRequests],this.measureRequests=_ref13[0],_l40=_ref13[1],_ref13);var _o30=_l40.map(function(t){try{return t.read(_this48);}catch(t){return _i(_this48.state,t),tn;}}),_u24=cs.create(this,this.state,[]),_f18=!1;_u24.flags|=_h46,e?e.flags|=_h46:e=_u24,this.updateState=2,_u24.empty||(this.updatePlugins(_u24),this.inputState.update(_u24),this.updateAttrs(),_f18=this.docView.update(_u24),_f18&&this.docViewUpdate());for(var _t149=0;_t149<_l40.length;_t149++)if(_o30[_t149]!=tn)try{var _e131=_l40[_t149];_e131.write&&_e131.write(_o30[_t149],this);}catch(t){_i(this.state,t);}if(_f18&&this.docView.updateSelection(!0),!_u24.viewportChanged&&0==this.measureRequests.length){if(this.viewState.editorHeight){if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,n=-1;continue;}{var _t150=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-n;if(_t150>1||_t150<-1){s+=_t150,i.scrollTop=s/this.scaleY,n=-1;continue;}}}break;}}}finally{this.updateState=0,this.measureScheduled=-1;}if(e&&!e.empty){var _iterator92=_createForOfIteratorHelper(this.state.facet(Hi)),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _t151=_step92.value;_t151(e);}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}}},{key:"themeClasses",get:function get(){return $r+" "+(this.state.facet(Pr)?qr:Wr)+" "+this.state.facet(Hr);}},{key:"updateAttrs",value:function updateAttrs(){var _this49=this;var t=sn(this,es,{"class":"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Xi)?"true":"false","class":"cm-content",style:"".concat(qe.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),sn(this,is,e);var i=this.observer.ignore(function(){var i=Ze(_this49.contentDOM,_this49.contentAttrs,e),s=Ze(_this49.dom,_this49.editorAttrs,t);return i||s;});return this.editorAttrs=t,this.contentAttrs=e,i;}},{key:"showAnnouncements",value:function showAnnouncements(t){var e=!0;var _iterator93=_createForOfIteratorHelper(t),_step93;try{for(_iterator93.s();!(_step93=_iterator93.n()).done;){var _i124=_step93.value;var _iterator94=_createForOfIteratorHelper(_i124.effects),_step94;try{for(_iterator94.s();!(_step94=_iterator94.n()).done;){var _t152=_step94.value;if(_t152.is(Qr.announce)){e&&(this.announceDOM.textContent=""),e=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=_t152.value;}}}catch(err){_iterator94.e(err);}finally{_iterator94.f();}}}catch(err){_iterator93.e(err);}finally{_iterator93.f();}}},{key:"mountStyles",value:function mountStyles(){this.styleModules=this.state.facet(fs);var t=this.state.facet(Qr.cspNonce);Zt.mount(this.root,this.styleModules.concat(Jr).reverse(),t?{nonce:t}:void 0);}},{key:"readMeasured",value:function readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1);}},{key:"requestMeasure",value:function requestMeasure(t){var _this50=this;if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(function(){return _this50.measure();})),t){if(this.measureRequests.indexOf(t)>-1)return;if(null!=t.key)for(var _e132=0;_e132<this.measureRequests.length;_e132++)if(this.measureRequests[_e132].key===t.key)return void(this.measureRequests[_e132]=t);this.measureRequests.push(t);}}},{key:"plugin",value:function plugin(t){var e=this.pluginMap.get(t);return(void 0===e||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find(function(e){return e.spec==t;})||null),e&&e.update(this).value;}},{key:"documentTop",get:function get(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop;}},{key:"documentPadding",get:function get(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom};}},{key:"scaleX",get:function get(){return this.viewState.scaleX;}},{key:"scaleY",get:function get(){return this.viewState.scaleY;}},{key:"elementAtHeight",value:function elementAtHeight(t){return this.readMeasured(),this.viewState.elementAtHeight(t);}},{key:"lineBlockAtHeight",value:function lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t);}},{key:"viewportLineBlocks",get:function get(){return this.viewState.viewportLines;}},{key:"lineBlockAt",value:function lineBlockAt(t){return this.viewState.lineBlockAt(t);}},{key:"contentHeight",get:function get(){return this.viewState.contentHeight;}},{key:"moveByChar",value:function moveByChar(t,e,i){return Ds(this,t,Cs(this,t,e,i));}},{key:"moveByGroup",value:function moveByGroup(t,e){var _this51=this;return Ds(this,t,Cs(this,t,e,function(e){return function(t,e,i){var s=t.state.charCategorizer(e),r=s(i);return function(t){var e=s(t);return r==Ct.Space&&(r=e),r==e;};}(_this51,t.head,e);}));}},{key:"visualLineSide",value:function visualLineSide(t,e){var i=this.bidiSpans(t),s=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return P.cursor(r.side(e,s)+t.from,r.forward(!e,s)?1:-1);}},{key:"moveToLineBoundary",value:function moveToLineBoundary(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;return function(t,e,i,s){var r=Os(t,e.head),n=s&&r.type==ii.Text&&(t.lineWrapping||r.widgetLineBreaks)?t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(n){var _e133=t.dom.getBoundingClientRect(),_s107=t.textDirectionAt(r.from),_h47=t.posAtCoords({x:i==(_s107==gi.LTR)?_e133.right-1:_e133.left+1,y:(n.top+n.bottom)/2});if(null!=_h47)return P.cursor(_h47,i?-1:1);}return P.cursor(i?r.to:r.from,i?-1:1);}(this,t,e,i);}},{key:"moveVertically",value:function moveVertically(t,e,i){return Ds(this,t,function(t,e,i,s){var r=e.head,n=i?1:-1;if(r==(i?t.state.doc.length:0))return P.cursor(r,e.assoc);var h,l=e.goalColumn,o=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(r,e.assoc||-1),f=t.documentTop;if(u)null==l&&(l=u.left-o.left),h=n<0?u.top:u.bottom;else{var _e134=t.viewState.lineBlockAt(r);null==l&&(l=Math.min(o.right-o.left,t.defaultCharacterWidth*(r-_e134.from))),h=(n<0?_e134.top:_e134.bottom)+f;}var a=o.left+l,c=null!=s?s:t.viewState.heightOracle.textHeight>>1;for(var _e135=0;;_e135+=10){var _i125=h+(c+_e135)*n,_s108=xs(t,{x:a,y:_i125},!1,n);if(_i125<o.top||_i125>o.bottom||(n<0?_s108<r:_s108>r)){var _e136=t.docView.coordsForChar(_s108),_r92=!_e136||_i125<_e136.top?-1:1;return P.cursor(_s108,_r92,void 0,l);}}}(this,t,e,i));}},{key:"domAtPos",value:function domAtPos(t){return this.docView.domAtPos(t);}},{key:"posAtDOM",value:function posAtDOM(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.docView.posFromDOM(t,e);}},{key:"posAtCoords",value:function posAtCoords(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return this.readMeasured(),xs(this,t,e);}},{key:"coordsAtPos",value:function coordsAtPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;this.readMeasured();var i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;var s=this.state.doc.lineAt(t),r=this.bidiSpans(s);return ae(i,r[Oi.find(r,t-s.from,-1,e)].dir==gi.LTR==e>0);}},{key:"coordsForChar",value:function coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t);}},{key:"defaultCharacterWidth",get:function get(){return this.viewState.heightOracle.charWidth;}},{key:"defaultLineHeight",get:function get(){return this.viewState.heightOracle.lineHeight;}},{key:"textDirection",get:function get(){return this.viewState.defaultTextDirection;}},{key:"textDirectionAt",value:function textDirectionAt(t){return!this.state.facet(Fi)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t));}},{key:"lineWrapping",get:function get(){return this.viewState.heightOracle.lineWrapping;}},{key:"bidiSpans",value:function bidiSpans(t){if(t.length>Zr)return Ri(t.length);var e,i=this.textDirectionAt(t.from);var _iterator95=_createForOfIteratorHelper(this.bidiCache),_step95;try{for(_iterator95.s();!(_step95=_iterator95.n()).done;){var _s109=_step95.value;if(_s109.from==t.from&&_s109.dir==i&&(_s109.fresh||Ci(_s109.isolates,e=ls(this,t))))return _s109.order;}}catch(err){_iterator95.e(err);}finally{_iterator95.f();}e||(e=ls(this,t));var s=function(t,e,i){if(!t)return[new Oi(0,0,e==wi?1:0)];if(e==mi&&!i.length&&!Si.test(t))return Ri(t.length);if(i.length)for(;t.length>Ai.length;)Ai[Ai.length]=256;var s=[],r=e==mi?0:1;return Ei(t,r,r,i,0,t.length,s),s;}(t.text,i,e);return this.bidiCache.push(new en(t.from,t.to,i,e,!0,s)),s;}},{key:"hasFocus",get:function get(){var t;return(this.dom.ownerDocument.hasFocus()||qe.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM;}},{key:"focus",value:function focus(){var _this52=this;this.observer.ignore(function(){we(_this52.contentDOM),_this52.docView.updateSelection();});}},{key:"setRoot",value:function setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((9==t.nodeType?t:t.ownerDocument).defaultView||window),this.mountStyles());}},{key:"destroy",value:function destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();var _iterator96=_createForOfIteratorHelper(this.plugins),_step96;try{for(_iterator96.s();!(_step96=_iterator96.n()).done;){var _t153=_step96.value;_t153.destroy(this);}}catch(err){_iterator96.e(err);}finally{_iterator96.f();}this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0;}},{key:"scrollSnapshot",value:function scrollSnapshot(){var _this$scrollDOM=this.scrollDOM,t=_this$scrollDOM.scrollTop,e=_this$scrollDOM.scrollLeft,i=this.viewState.scrollAnchorAt(t);return Ui.of(new Gi(P.cursor(i.from),"start","start",i.top-t,e,!0));}},{key:"setTabFocusMode",value:function setTabFocusMode(t){null==t?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:"boolean"==typeof t?this.inputState.tabFocusMode=t?0:-1:0!=this.inputState.tabFocusMode&&(this.inputState.tabFocusMode=Date.now()+t);}}],[{key:"scrollIntoView",value:function scrollIntoView(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return Ui.of(new Gi("number"==typeof t?P.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin));}},{key:"domEventHandlers",value:function domEventHandlers(t){return Zi.define(function(){return{};},{eventHandlers:t});}},{key:"domEventObservers",value:function domEventObservers(t){return Zi.define(function(){return{};},{eventObservers:t});}},{key:"theme",value:function theme(t,e){var i=Zt.newName(),s=[Hr.of(i),fs.of(Vr(".".concat(i),t))];return e&&e.dark&&s.push(Pr.of(!0)),s;}},{key:"baseTheme",value:function baseTheme(t){return et.lowest(fs.of(Vr("."+$r,t,Fr)));}},{key:"findFromDOM",value:function findFromDOM(t){var e;var i=t.querySelector(".cm-content"),s=i&&Ce.get(i)||Ce.get(t);return(null===(e=null==s?void 0:s.rootView)||void 0===e?void 0:e.view)||null;}}]);}());Qr.styleModule=fs,Qr.inputHandler=Pi,Qr.clipboardInputFilter=Wi,Qr.clipboardOutputFilter=qi,Qr.scrollHandler=Ji,Qr.focusChangeEffect=$i,Qr.perLineTextDirection=Fi,Qr.exceptionSink=zi,Qr.updateListener=Hi,Qr.editable=Xi,Qr.mouseSelectionStyle=ji,Qr.dragMovesSelection=Li,Qr.clickAddsSelectionRange=Ni,Qr.decorations=ss,Qr.outerDecorations=rs,Qr.atomicRanges=ns,Qr.bidiIsolatedRanges=hs,Qr.scrollMargins=os,Qr.darkTheme=Pr,Qr.cspNonce=q.define({combine:function combine(t){return t.length?t[0]:"";}}),Qr.contentAttributes=is,Qr.editorAttributes=es,Qr.lineWrapping=Qr.contentAttributes.of({"class":"cm-lineWrapping"}),Qr.announce=bt.define();Zr=4096,tn={};en=/*#__PURE__*/function(){function en(t,e,i,s,r,n){_classCallCheck(this,en);this.from=t,this.to=e,this.dir=i,this.isolates=s,this.fresh=r,this.order=n;}return _createClass(en,null,[{key:"update",value:function update(t,e){if(e.empty&&!t.some(function(t){return t.fresh;}))return t;var i=[],s=t.length?t[t.length-1].dir:gi.LTR;for(var _r93=Math.max(0,t.length-10);_r93<t.length;_r93++){var _n73=t[_r93];_n73.dir!=s||e.touchesRange(_n73.from,_n73.to)||i.push(new en(e.mapPos(_n73.from,1),e.mapPos(_n73.to,-1),_n73.dir,_n73.isolates,!1,_n73.order));}return i;}}]);}();rn=qe.mac?"mac":qe.windows?"win":qe.linux?"linux":"key";hn=et["default"](Qr.domEventHandlers({keydown:function keydown(t,e){return pn(un(e.state),t,e,"editor");}})),_export("x",ln=q.define({enables:hn})),on=new WeakMap();an=null;cn=4e3;dn=null;gn=/*#__PURE__*/function(){function gn(t,e,i,s,r){_classCallCheck(this,gn);this.className=t,this.left=e,this.top=i,this.width=s,this.height=r;}return _createClass(gn,[{key:"draw",value:function draw(){var t=document.createElement("div");return t.className=this.className,this.adjust(t),t;}},{key:"update",value:function update(t,e){return e.className==this.className&&(this.adjust(t),!0);}},{key:"adjust",value:function adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",null!=this.width&&(t.style.width=this.width+"px"),t.style.height=this.height+"px";}},{key:"eq",value:function eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className;}}],[{key:"forRange",value:function forRange(t,e,i){if(i.empty){var _s112=t.coordsAtPos(i.head,i.assoc||1);if(!_s112)return[];var _r96=mn(t);return[new gn(e,_s112.left-_r96.left,_s112.top-_r96.top,null,_s112.bottom-_s112.top)];}return function(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];var s=Math.max(i.from,t.viewport.from),r=Math.min(i.to,t.viewport.to),n=t.textDirection==gi.LTR,h=t.contentDOM,l=h.getBoundingClientRect(),o=mn(t),u=h.querySelector(".cm-line"),f=u&&window.getComputedStyle(u),a=l.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0),c=l.right-(f?parseInt(f.paddingRight):0),d=Os(t,s),p=Os(t,r),g=d.type==ii.Text?d:null,m=p.type==ii.Text?p:null;g&&(t.lineWrapping||d.widgetLineBreaks)&&(g=wn(t,s,1,g));m&&(t.lineWrapping||p.widgetLineBreaks)&&(m=wn(t,r,-1,m));if(g&&m&&g.from==m.from&&g.to==m.to)return b(v(i.from,i.to,g));{var _e142=g?v(i.from,null,g):k(d,!1),_s113=m?v(null,i.to,m):k(p,!0),_r97=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&_e142.bottom+t.defaultLineHeight/2<_s113.top?_r97.push(w(a,_e142.bottom,c,_s113.top)):_e142.bottom<_s113.top&&t.elementAtHeight((_e142.bottom+_s113.top)/2).type==ii.Text&&(_e142.bottom=_s113.top=(_e142.bottom+_s113.top)/2),b(_e142).concat(_r97).concat(b(_s113));}function w(t,i,s,r){return new gn(e,t-o.left,i-o.top,s-t,r-i);}function b(_ref14){var t=_ref14.top,e=_ref14.bottom,i=_ref14.horizontal;var s=[];for(var _r98=0;_r98<i.length;_r98+=2)s.push(w(i[_r98],t,i[_r98+1],e));return s;}function v(e,i,s){var r=1e9,h=-1e9,l=[];function o(e,i,o,u,f){var d=t.coordsAtPos(e,e==s.to?-2:2),p=t.coordsAtPos(o,o==s.from?2:-2);d&&p&&(r=Math.min(d.top,p.top,r),h=Math.max(d.bottom,p.bottom,h),f==gi.LTR?l.push(n&&i?a:d.left,n&&u?c:p.right):l.push(!n&&u?a:p.left,!n&&i?c:d.right));}var u=null!=e?e:s.from,f=null!=i?i:s.to;var _iterator101=_createForOfIteratorHelper(t.visibleRanges),_step101;try{for(_iterator101.s();!(_step101=_iterator101.n()).done;){var _s114=_step101.value;if(_s114.to>u&&_s114.from<f)for(var _r99=Math.max(_s114.from,u),_n76=Math.min(_s114.to,f);;){var _s115=t.state.doc.lineAt(_r99);var _iterator102=_createForOfIteratorHelper(t.bidiSpans(_s115)),_step102;try{for(_iterator102.s();!(_step102=_iterator102.n()).done;){var _h48=_step102.value;var _t156=_h48.from+_s115.from,_l42=_h48.to+_s115.from;if(_t156>=_n76)break;_l42>_r99&&o(Math.max(_t156,_r99),null==e&&_t156<=u,Math.min(_l42,_n76),null==i&&_l42>=f,_h48.dir);}}catch(err){_iterator102.e(err);}finally{_iterator102.f();}if(_r99=_s115.to+1,_r99>=_n76)break;}}}catch(err){_iterator101.e(err);}finally{_iterator101.f();}return 0==l.length&&o(u,null==e,f,null==i,t.textDirection),{top:r,bottom:h,horizontal:l};}function k(t,e){var i=l.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]};}}(t,e,i);}}]);}();bn=/*#__PURE__*/function(){function bn(t,e){_classCallCheck(this,bn);this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e["class"]&&this.dom.classList.add(e["class"]),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t);}return _createClass(bn,[{key:"update",value:function update(t){t.startState.facet(vn)!=t.state.facet(vn)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq));}},{key:"docViewUpdate",value:function docViewUpdate(t){!1!==this.layer.updateOnDocViewUpdate&&t.requestMeasure(this.measureReq);}},{key:"setOrder",value:function setOrder(t){var e=0,i=t.facet(vn);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e);}},{key:"measure",value:function measure(){return this.layer.markers(this.view);}},{key:"scale",value:function scale(){var _this$view=this.view,t=_this$view.scaleX,e=_this$view.scaleY;t==this.scaleX&&e==this.scaleY||(this.scaleX=t,this.scaleY=e,this.dom.style.transform="scale(".concat(1/t,", ").concat(1/e,")"));}},{key:"draw",value:function draw(t){var _this53=this;if(t.length!=this.drawn.length||t.some(function(t,e){return i=t,s=_this53.drawn[e],!(i.constructor==s.constructor&&i.eq(s));var i,s;})){var _e143=this.dom.firstChild,_i126=0;var _iterator103=_createForOfIteratorHelper(t),_step103;try{for(_iterator103.s();!(_step103=_iterator103.n()).done;){var _s116=_step103.value;_s116.update&&_e143&&_s116.constructor&&this.drawn[_i126].constructor&&_s116.update(_e143,this.drawn[_i126])?(_e143=_e143.nextSibling,_i126++):this.dom.insertBefore(_s116.draw(),_e143);}}catch(err){_iterator103.e(err);}finally{_iterator103.f();}for(;_e143;){var _t157=_e143.nextSibling;_e143.remove(),_e143=_t157;}this.drawn=t;}}},{key:"destroy",value:function destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove();}}]);}();vn=q.define();Mn=!(qe.ios&&qe.webkit&&qe.webkit_version<534),yn=q.define({combine:function combine(t){return Tt(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:function cursorBlinkRate(t,e){return Math.min(t,e);},drawRangeCursor:function drawRangeCursor(t,e){return t||e;}});}});On=kn({above:!0,markers:function markers(t){var e=t.state,i=e.facet(yn),s=[];var _iterator104=_createForOfIteratorHelper(e.selection.ranges),_step104;try{for(_iterator104.s();!(_step104=_iterator104.n()).done;){var _r100=_step104.value;var _n77=_r100==e.selection.main;if(_r100.empty?!_n77||Mn:i.drawRangeCursor){var _e144=_n77?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",_i127=_r100.empty?_r100:P.cursor(_r100.head,_r100.head>_r100.anchor?-1:1);var _iterator105=_createForOfIteratorHelper(gn.forRange(t,_e144,_i127)),_step105;try{for(_iterator105.s();!(_step105=_iterator105.n()).done;){var _r101=_step105.value;s.push(_r101);}}catch(err){_iterator105.e(err);}finally{_iterator105.f();}}}}catch(err){_iterator104.e(err);}finally{_iterator104.f();}return s;},update:function update(t,e){t.transactions.some(function(t){return t.selection;})&&(e.style.animationName="cm-blink"==e.style.animationName?"cm-blink2":"cm-blink");var i=Sn(t);return i&&Cn(t.state,e),t.docChanged||t.selectionSet||i;},mount:function mount(t,e){Cn(e.state,t);},"class":"cm-cursorLayer"});An=kn({above:!1,markers:function markers(t){return t.state.selection.ranges.map(function(e){return e.empty?[]:gn.forRange(t,"cm-selectionBackground",e);}).reduce(function(t,e){return t.concat(e);});},update:function update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Sn(t);},"class":"cm-selectionLayer"}),Dn={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Mn&&(Dn[".cm-line"].caretColor=Dn[".cm-content"].caretColor="transparent !important");En=et.highest(Qr.theme(Dn)),Rn=bt.define({map:function map(t,e){return null==t?null:e.mapPos(t);}}),Tn=_.define({create:function create(){return null;},update:function update(t,e){return null!=t&&(t=e.changes.mapPos(t)),e.effects.reduce(function(t,e){return e.is(Rn)?e.value:t;},t);}}),Bn=Zi.fromClass(/*#__PURE__*/function(){function _class(t){_classCallCheck(this,_class);this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)};}return _createClass(_class,[{key:"update",value:function update(t){var e;var i=t.state.field(Tn);null==i?null!=this.cursor&&(null===(e=this.cursor)||void 0===e||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Tn)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq));}},{key:"readPos",value:function readPos(){var t=this.view,e=t.state.field(Tn),i=null!=e&&t.coordsAtPos(e);if(!i)return null;var s=t.scrollDOM.getBoundingClientRect();return{left:i.left-s.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-s.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top};}},{key:"drawCursor",value:function drawCursor(t){if(this.cursor){var _this$view2=this.view,_e145=_this$view2.scaleX,_i128=_this$view2.scaleY;t?(this.cursor.style.left=t.left/_e145+"px",this.cursor.style.top=t.top/_i128+"px",this.cursor.style.height=t.height/_i128+"px"):this.cursor.style.left="-100000px";}}},{key:"destroy",value:function destroy(){this.cursor&&this.cursor.remove();}},{key:"setDropPos",value:function setDropPos(t){this.view.state.field(Tn)!=t&&this.view.dispatch({effects:Rn.of(t)});}}]);}(),{eventObservers:{dragover:function dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}));},dragleave:function dragleave(t){t.target!=this.view.contentDOM&&this.view.contentDOM.contains(t.relatedTarget)||this.setDropPos(null);},dragend:function dragend(){this.setDropPos(null);},drop:function drop(){this.setDropPos(null);}}});Ln=/*#__PURE__*/function(){function Ln(t){_classCallCheck(this,Ln);var e=t.regexp,i=t.decoration,s=t.decorate,r=t.boundary,_t$maxLength=t.maxLength,n=_t$maxLength===void 0?1e3:_t$maxLength;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,s)this.addMatch=function(t,e,i,r){return s(r,i,i+t[0].length,t,e);};else if("function"==typeof i)this.addMatch=function(t,e,s,r){var n=i(t,e,s);n&&r(s,s+t[0].length,n);};else{if(!i)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=function(t,e,s,r){return r(s,s+t[0].length,i);};}this.boundary=r,this.maxLength=n;}return _createClass(Ln,[{key:"createDeco",value:function createDeco(t){var _this54=this;var e=new zt(),i=e.add.bind(e);var _iterator106=_createForOfIteratorHelper(function(t,e){var i=t.visibleRanges;if(1==i.length&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;var s=[];var _iterator107=_createForOfIteratorHelper(i),_step107;try{for(_iterator107.s();!(_step107=_iterator107.n()).done;){var _step107$value=_step107.value,_r102=_step107$value.from,_n79=_step107$value.to;_r102=Math.max(t.state.doc.lineAt(_r102).from,_r102-e),_n79=Math.min(t.state.doc.lineAt(_n79).to,_n79+e),s.length&&s[s.length-1].to>=_r102?s[s.length-1].to=_n79:s.push({from:_r102,to:_n79});}}catch(err){_iterator107.e(err);}finally{_iterator107.f();}return s;}(t,this.maxLength)),_step106;try{for(_iterator106.s();!(_step106=_iterator106.n()).done;){var _step106$value=_step106.value,_e146=_step106$value.from,_s117=_step106$value.to;Nn(t.state.doc,this.regexp,_e146,_s117,function(e,s){return _this54.addMatch(s,t,e,i);});}}catch(err){_iterator106.e(err);}finally{_iterator106.f();}return e.finish();}},{key:"updateDeco",value:function updateDeco(t,e){var i=1e9,s=-1;return t.docChanged&&t.changes.iterChanges(function(e,r,n,h){h>=t.view.viewport.from&&n<=t.view.viewport.to&&(i=Math.min(n,i),s=Math.max(h,s));}),t.viewportMoved||s-i>1e3?this.createDeco(t.view):s>-1?this.updateRange(t.view,e.map(t.changes),i,s):e;}},{key:"updateRange",value:function updateRange(t,e,i,s){var _this55=this;var _iterator108=_createForOfIteratorHelper(t.visibleRanges),_step108;try{var _loop10=function _loop10(){var r=_step108.value;var n=Math.max(r.from,i),h=Math.min(r.to,s);if(h>n){var _i129=t.state.doc.lineAt(n),_s118=_i129.to<h?t.state.doc.lineAt(h):_i129,_l44=Math.max(r.from,_i129.from),_o31=Math.min(r.to,_s118.to);if(_this55.boundary){for(;n>_i129.from;n--)if(_this55.boundary.test(_i129.text[n-1-_i129.from])){_l44=n;break;}for(;h<_s118.to;h++)if(_this55.boundary.test(_s118.text[h-_s118.from])){_o31=h;break;}}var _u25,_f19=[],_a13=function _a13(t,e,i){return _f19.push(i.range(t,e));};if(_i129==_s118)for(_this55.regexp.lastIndex=_l44-_i129.from;(_u25=_this55.regexp.exec(_i129.text))&&_u25.index<_o31-_i129.from;)_this55.addMatch(_u25,t,_u25.index+_i129.from,_a13);else Nn(t.state.doc,_this55.regexp,_l44,_o31,function(e,i){return _this55.addMatch(i,t,e,_a13);});e=e.update({filterFrom:_l44,filterTo:_o31,filter:function filter(t,e){return t<_l44||e>_o31;},add:_f19});}};for(_iterator108.s();!(_step108=_iterator108.n()).done;){_loop10();}}catch(err){_iterator108.e(err);}finally{_iterator108.f();}return e;}}]);}();jn=null!=/x/.unicode?"gu":"g",zn=new RegExp("[\0-\b\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]",jn),Hn={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};Pn=null;$n=q.define({combine:function combine(t){var e=Tt(t,{render:null,specialChars:zn,addSpecialChars:null});return(e.replaceTabs=!function(){var t;if(null==Pn&&"undefined"!=typeof document&&document.body){var _e147=document.body.style;Pn=null!=(null!==(t=_e147.tabSize)&&void 0!==t?t:_e147.MozTabSize);}return Pn||!1;}())&&(e.specialChars=new RegExp("\t|"+e.specialChars.source,jn)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,jn)),e;}});qn=null;Fn=/*#__PURE__*/function(_ei4){function Fn(t,e){var _this57;_classCallCheck(this,Fn);_this57=_callSuper(this,Fn),_this57.options=t,_this57.code=e;return _this57;}_inherits(Fn,_ei4);return _createClass(Fn,[{key:"eq",value:function eq(t){return t.code==this.code;}},{key:"toDOM",value:function toDOM(t){var e=(i=this.code)>=32?"•":10==i?"␤":String.fromCharCode(9216+i);var i;var s=t.state.phrase("Control character")+" "+(Hn[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,s,e);if(r)return r;var n=document.createElement("span");return n.textContent=e,n.title=s,n.setAttribute("aria-label",s),n.className="cm-specialChar",n;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei);Vn=/*#__PURE__*/function(_ei5){function Vn(t){var _this58;_classCallCheck(this,Vn);_this58=_callSuper(this,Vn),_this58.width=t;return _this58;}_inherits(Vn,_ei5);return _createClass(Vn,[{key:"eq",value:function eq(t){return t.width==this.width;}},{key:"toDOM",value:function toDOM(){var t=document.createElement("span");return t.textContent="\t",t.className="cm-tab",t.style.width=this.width+"px",t;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei);Gn=si.line({"class":"cm-activeLine"}),Un=Zi.fromClass(/*#__PURE__*/function(){function _class3(t){_classCallCheck(this,_class3);this.decorations=this.getDeco(t);}return _createClass(_class3,[{key:"update",value:function update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view));}},{key:"getDeco",value:function getDeco(t){var e=-1,i=[];var _iterator109=_createForOfIteratorHelper(t.state.selection.ranges),_step109;try{for(_iterator109.s();!(_step109=_iterator109.n()).done;){var _s119=_step109.value;var _r103=t.lineBlockAt(_s119.head);_r103.from>e&&(i.push(Gn.range(_r103.from)),e=_r103.from);}}catch(err){_iterator109.e(err);}finally{_iterator109.f();}return si.set(i);}}]);}(),{decorations:function decorations(t){return t.decorations;}});Kn=/*#__PURE__*/function(_ei6){function Kn(t){var _this59;_classCallCheck(this,Kn);_this59=_callSuper(this,Kn),_this59.content=t;return _this59;}_inherits(Kn,_ei6);return _createClass(Kn,[{key:"toDOM",value:function toDOM(t){var e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):"function"==typeof this.content?this.content(t):this.content.cloneNode(!0)),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e;}},{key:"coordsAt",value:function coordsAt(t){var e=t.firstChild?ne(t.firstChild):[];if(!e.length)return null;var i=window.getComputedStyle(t.parentNode),s=ae(e[0],"rtl"!=i.direction),r=parseInt(i.lineHeight);return s.bottom-s.top>1.5*r?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s;}},{key:"ignoreEvent",value:function ignoreEvent(){return!1;}}]);}(ei);Xn=2e3;th={Alt:[18,function(t){return!!t.altKey;}],Control:[17,function(t){return!!t.ctrlKey;}],Shift:[16,function(t){return!!t.shiftKey;}],Meta:[91,function(t){return!!t.metaKey;}]},eh={style:"cursor: crosshair"};sh="-10000px";rh=/*#__PURE__*/function(){function rh(t,e,i,s){_classCallCheck(this,rh);this.facet=e,this.createTooltipView=i,this.removeTooltipView=s,this.input=t.state.facet(e),this.tooltips=this.input.filter(function(t){return t;});var r=null;this.tooltipViews=this.tooltips.map(function(t){return r=i(t,r);});}return _createClass(rh,[{key:"update",value:function update(t,e){var i;var s=t.state.facet(this.facet),r=s.filter(function(t){return t;});if(s===this.input){var _iterator110=_createForOfIteratorHelper(this.tooltipViews),_step110;try{for(_iterator110.s();!(_step110=_iterator110.n()).done;){var _e153=_step110.value;_e153.update&&_e153.update(t);}}catch(err){_iterator110.e(err);}finally{_iterator110.f();}return!1;}var n=[],h=e?[]:null;for(var _i132=0;_i132<r.length;_i132++){var _s121=r[_i132],_l47=-1;if(_s121){for(var _t159=0;_t159<this.tooltips.length;_t159++){var _e154=this.tooltips[_t159];_e154&&_e154.create==_s121.create&&(_l47=_t159);}if(_l47<0)n[_i132]=this.createTooltipView(_s121,_i132?n[_i132-1]:null),h&&(h[_i132]=!!_s121.above);else{var _s122=n[_i132]=this.tooltipViews[_l47];h&&(h[_i132]=e[_l47]),_s122.update&&_s122.update(t);}}}var _iterator111=_createForOfIteratorHelper(this.tooltipViews),_step111;try{for(_iterator111.s();!(_step111=_iterator111.n()).done;){var _t160=_step111.value;n.indexOf(_t160)<0&&(this.removeTooltipView(_t160),null===(i=_t160.destroy)||void 0===i||i.call(_t160));}}catch(err){_iterator111.e(err);}finally{_iterator111.f();}return e&&(h.forEach(function(t,i){return e[i]=t;}),e.length=h.length),this.input=s,this.tooltips=r,this.tooltipViews=n,!0;}}]);}();lh=q.define({combine:function combine(t){var e,i,s;return{position:qe.ios?"absolute":(null===(e=t.find(function(t){return t.position;}))||void 0===e?void 0:e.position)||"fixed",parent:(null===(i=t.find(function(t){return t.parent;}))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(s=t.find(function(t){return t.tooltipSpace;}))||void 0===s?void 0:s.tooltipSpace)||hh};}}),oh=new WeakMap(),uh=Zi.fromClass(/*#__PURE__*/function(){function _class6(t){var _this60=this;_classCallCheck(this,_class6);this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;var e=t.state.facet(lh);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver="function"==typeof ResizeObserver?new ResizeObserver(function(){return _this60.measureSoon();}):null,this.manager=new rh(t,dh,function(t,e){return _this60.createTooltip(t,e);},function(t){_this60.resizeObserver&&_this60.resizeObserver.unobserve(t.dom),t.dom.remove();}),this.above=this.manager.tooltips.map(function(t){return!!t.above;}),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver(function(t){Date.now()>_this60.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&_this60.measureSoon();},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure();}return _createClass(_class6,[{key:"createContainer",value:function createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom;}},{key:"observeIntersection",value:function observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();var _iterator112=_createForOfIteratorHelper(this.manager.tooltipViews),_step112;try{for(_iterator112.s();!(_step112=_iterator112.n()).done;){var _t161=_step112.value;this.intersectionObserver.observe(_t161.dom);}}catch(err){_iterator112.e(err);}finally{_iterator112.f();}}}},{key:"measureSoon",value:function measureSoon(){var _this61=this;this.measureTimeout<0&&(this.measureTimeout=setTimeout(function(){_this61.measureTimeout=-1,_this61.maybeMeasure();},50));}},{key:"update",value:function update(t){t.transactions.length&&(this.lastTransaction=Date.now());var e=this.manager.update(t,this.above);e&&this.observeIntersection();var i=e||t.geometryChanged,s=t.state.facet(lh);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;var _iterator113=_createForOfIteratorHelper(this.manager.tooltipViews),_step113;try{for(_iterator113.s();!(_step113=_iterator113.n()).done;){var _t162=_step113.value;_t162.dom.style.position=this.position;}}catch(err){_iterator113.e(err);}finally{_iterator113.f();}i=!0;}if(s.parent!=this.parent){this.parent&&this.container.remove(),this.parent=s.parent,this.createContainer();var _iterator114=_createForOfIteratorHelper(this.manager.tooltipViews),_step114;try{for(_iterator114.s();!(_step114=_iterator114.n()).done;){var _t163=_step114.value;this.container.appendChild(_t163.dom);}}catch(err){_iterator114.e(err);}finally{_iterator114.f();}i=!0;}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure();}},{key:"createTooltip",value:function createTooltip(t,e){var i=t.create(this.view),s=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){var _t164=document.createElement("div");_t164.className="cm-tooltip-arrow",i.dom.appendChild(_t164);}return i.dom.style.position=this.position,i.dom.style.top=sh,i.dom.style.left="0px",this.container.insertBefore(i.dom,s),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i;}},{key:"destroy",value:function destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);var _iterator115=_createForOfIteratorHelper(this.manager.tooltipViews),_step115;try{for(_iterator115.s();!(_step115=_iterator115.n()).done;){var _e155=_step115.value;_e155.dom.remove(),null===(t=_e155.destroy)||void 0===t||t.call(_e155);}}catch(err){_iterator115.e(err);}finally{_iterator115.f();}this.parent&&this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(i=this.intersectionObserver)||void 0===i||i.disconnect(),clearTimeout(this.measureTimeout);}},{key:"readMeasure",value:function readMeasure(){var _this62=this;var t=1,e=1,i=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){var _t165=this.manager.tooltipViews[0].dom;if(qe.gecko)i=_t165.offsetParent!=this.container.ownerDocument.body;else if(_t165.style.top==sh&&"0px"==_t165.style.left){var _e156=_t165.getBoundingClientRect();i=Math.abs(_e156.top+1e4)>1||Math.abs(_e156.left)>1;}}if(i||"absolute"==this.position)if(this.parent){var _i133=this.parent.getBoundingClientRect();_i133.width&&_i133.height&&(t=_i133.width/this.parent.offsetWidth,e=_i133.height/this.parent.offsetHeight);}else{var _this$view$viewState=this.view.viewState;t=_this$view$viewState.scaleX;e=_this$view$viewState.scaleY;}var s=this.view.scrollDOM.getBoundingClientRect(),r=us(this.view);return{visible:{left:s.left+r.left,top:s.top+r.top,right:s.right-r.right,bottom:s.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(function(t,e){var i=_this62.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):_this62.view.coordsAtPos(t.pos);}),size:this.manager.tooltipViews.map(function(_ref15){var t=_ref15.dom;return t.getBoundingClientRect();}),space:this.view.state.facet(lh).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i};}},{key:"writeMeasure",value:function writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";var _iterator116=_createForOfIteratorHelper(this.manager.tooltipViews),_step116;try{for(_iterator116.s();!(_step116=_iterator116.n()).done;){var _t166=_step116.value;_t166.dom.style.position="absolute";}}catch(err){_iterator116.e(err);}finally{_iterator116.f();}}var i=t.visible,s=t.space,r=t.scaleX,n=t.scaleY,h=[];for(var _l48=0;_l48<this.manager.tooltips.length;_l48++){var _o32=this.manager.tooltips[_l48],_u26=this.manager.tooltipViews[_l48],_f20=_u26.dom,_a14=t.pos[_l48],_c10=t.size[_l48];if(!_a14||!1!==_o32.clip&&(_a14.bottom<=Math.max(i.top,s.top)||_a14.top>=Math.min(i.bottom,s.bottom)||_a14.right<Math.max(i.left,s.left)-.1||_a14.left>Math.min(i.right,s.right)+.1)){_f20.style.top=sh;continue;}var _d8=_o32.arrow?_u26.dom.querySelector(".cm-tooltip-arrow"):null,_p8=_d8?7:0,_g4=_c10.right-_c10.left,_m4=null!==(e=oh.get(_u26))&&void 0!==e?e:_c10.bottom-_c10.top,_w=_u26.offset||ch,_b=this.view.textDirection==gi.LTR,_v=_c10.width>s.right-s.left?_b?s.left:s.right-_c10.width:_b?Math.max(s.left,Math.min(_a14.left-(_d8?14:0)+_w.x,s.right-_g4)):Math.min(Math.max(s.left,_a14.left-_g4+(_d8?14:0)-_w.x),s.right-_g4),_k=this.above[_l48];!_o32.strictSide&&(_k?_a14.top-_m4-_p8-_w.y<s.top:_a14.bottom+_m4+_p8+_w.y>s.bottom)&&_k==s.bottom-_a14.bottom>_a14.top-s.top&&(_k=this.above[_l48]=!_k);var _M=(_k?_a14.top-s.top:s.bottom-_a14.bottom)-_p8;if(_M<_m4&&!1!==_u26.resize){if(_M<this.view.defaultLineHeight){_f20.style.top=sh;continue;}oh.set(_u26,_m4),_f20.style.height=(_m4=_M)/n+"px";}else _f20.style.height&&(_f20.style.height="");var _y=_k?_a14.top-_m4-_p8-_w.y:_a14.bottom+_p8+_w.y,_x13=_v+_g4;if(!0!==_u26.overlap){var _iterator117=_createForOfIteratorHelper(h),_step117;try{for(_iterator117.s();!(_step117=_iterator117.n()).done;){var _t167=_step117.value;_t167.left<_x13&&_t167.right>_v&&_t167.top<_y+_m4&&_t167.bottom>_y&&(_y=_k?_t167.top-_m4-2-_p8:_t167.bottom+_p8+2);}}catch(err){_iterator117.e(err);}finally{_iterator117.f();}}if("absolute"==this.position?(_f20.style.top=(_y-t.parent.top)/n+"px",fh(_f20,(_v-t.parent.left)/r)):(_f20.style.top=_y/n+"px",fh(_f20,_v/r)),_d8){var _t168=_a14.left+(_b?_w.x:-_w.x)-(_v+14-7);_d8.style.left=_t168/r+"px";}!0!==_u26.overlap&&h.push({left:_v,top:_y,right:_x13,bottom:_y+_m4}),_f20.classList.toggle("cm-tooltip-above",_k),_f20.classList.toggle("cm-tooltip-below",!_k),_u26.positioned&&_u26.positioned(t.space);}}},{key:"maybeMeasure",value:function maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView))){var _iterator118=_createForOfIteratorHelper(this.manager.tooltipViews),_step118;try{for(_iterator118.s();!(_step118=_iterator118.n()).done;){var _t169=_step118.value;_t169.dom.style.top=sh;}}catch(err){_iterator118.e(err);}finally{_iterator118.f();}}}}]);}(),{eventObservers:{scroll:function scroll(){this.maybeMeasure();}}});ah=Qr.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ch={x:0,y:0},_export("y",dh=q.define({enables:[uh,ah]})),ph=q.define({combine:function combine(t){return t.reduce(function(t,e){return t.concat(e);},[]);}});gh=/*#__PURE__*/function(){function gh(t){var _this63=this;_classCallCheck(this,gh);this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new rh(t,ph,function(t,e){return _this63.createHostedView(t,e);},function(t){return t.dom.remove();});}return _createClass(gh,[{key:"createHostedView",value:function createHostedView(t,e){var i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i;}},{key:"mount",value:function mount(t){var _iterator119=_createForOfIteratorHelper(this.manager.tooltipViews),_step119;try{for(_iterator119.s();!(_step119=_iterator119.n()).done;){var _e157=_step119.value;_e157.mount&&_e157.mount(t);}}catch(err){_iterator119.e(err);}finally{_iterator119.f();}this.mounted=!0;}},{key:"positioned",value:function positioned(t){var _iterator120=_createForOfIteratorHelper(this.manager.tooltipViews),_step120;try{for(_iterator120.s();!(_step120=_iterator120.n()).done;){var _e158=_step120.value;_e158.positioned&&_e158.positioned(t);}}catch(err){_iterator120.e(err);}finally{_iterator120.f();}}},{key:"update",value:function update(t){this.manager.update(t);}},{key:"destroy",value:function destroy(){var t;var _iterator121=_createForOfIteratorHelper(this.manager.tooltipViews),_step121;try{for(_iterator121.s();!(_step121=_iterator121.n()).done;){var _e159=_step121.value;null===(t=_e159.destroy)||void 0===t||t.call(_e159);}}catch(err){_iterator121.e(err);}finally{_iterator121.f();}}},{key:"passProp",value:function passProp(t){var e;var _iterator122=_createForOfIteratorHelper(this.manager.tooltipViews),_step122;try{for(_iterator122.s();!(_step122=_iterator122.n()).done;){var _i134=_step122.value;var _s123=_i134[t];if(void 0!==_s123)if(void 0===e)e=_s123;else if(e!==_s123)return;}}catch(err){_iterator122.e(err);}finally{_iterator122.f();}return e;}},{key:"offset",get:function get(){return this.passProp("offset");}},{key:"getCoords",get:function get(){return this.passProp("getCoords");}},{key:"overlap",get:function get(){return this.passProp("overlap");}},{key:"resize",get:function get(){return this.passProp("resize");}}],[{key:"create",value:function create(t){return new gh(t);}}]);}();mh=dh.compute([ph],function(t){var e=t.facet(ph);return 0===e.length?null:{pos:Math.min.apply(Math,_toConsumableArray(e.map(function(t){return t.pos;}))),end:Math.max.apply(Math,_toConsumableArray(e.map(function(t){var e;return null!==(e=t.end)&&void 0!==e?e:t.pos;}))),create:gh.create,above:e[0].above,arrow:e.some(function(t){return t.arrow;})};});wh=/*#__PURE__*/function(){function wh(t,e,i,s,r){_classCallCheck(this,wh);this.view=t,this.source=e,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this));}return _createClass(wh,[{key:"update",value:function update(){var _this64=this;this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(function(){return _this64.startHover();},20));}},{key:"active",get:function get(){return this.view.state.field(this.field);}},{key:"checkHover",value:function checkHover(){if(this.hoverTimeout=-1,this.active.length)return;var t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover();}},{key:"startHover",value:function startHover(){var _this65=this;clearTimeout(this.restartTimeout);var t=this.view,e=this.lastMove,i=t.docView.nearest(e.target);if(!i)return;var s,r=1;if(i instanceof Je)s=i.posAtStart;else{if(s=t.posAtCoords(e),null==s)return;var _i135=t.coordsAtPos(s);if(!_i135||e.y<_i135.top||e.y>_i135.bottom||e.x<_i135.left-t.defaultCharacterWidth||e.x>_i135.right+t.defaultCharacterWidth)return;var _n81=t.bidiSpans(t.state.doc.lineAt(s)).find(function(t){return t.from<=s&&t.to>=s;}),_h52=_n81&&_n81.dir==gi.RTL?-1:1;r=e.x<_i135.left?-_h52:_h52;}var n=this.source(t,s,r);if(null==n?void 0:n.then){var _e160=this.pending={pos:s};n.then(function(i){_this65.pending==_e160&&(_this65.pending=null,!i||Array.isArray(i)&&!i.length||t.dispatch({effects:_this65.setHover.of(Array.isArray(i)?i:[i])}));},function(e){return _i(t.state,e,"hover tooltip");});}else!n||Array.isArray(n)&&!n.length||t.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])});}},{key:"tooltip",get:function get(){var t=this.view.plugin(uh),e=t?t.manager.tooltips.findIndex(function(t){return t.create==gh.create;}):-1;return e>-1?t.manager.tooltipViews[e]:null;}},{key:"mousemove",value:function mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));var s=this.active,r=this.tooltip;if(s.length&&r&&!function(t,e){var i,_t$getBoundingClientR=t.getBoundingClientRect(),s=_t$getBoundingClientR.left,r=_t$getBoundingClientR.right,n=_t$getBoundingClientR.top,h=_t$getBoundingClientR.bottom;if(i=t.querySelector(".cm-tooltip-arrow")){var _t170=i.getBoundingClientRect();n=Math.min(_t170.top,n),h=Math.max(_t170.bottom,h);}return e.clientX>=s-bh&&e.clientX<=r+bh&&e.clientY>=n-bh&&e.clientY<=h+bh;}(r.dom,t)||this.pending){var _ref16=s[0]||this.pending,_r105=_ref16.pos,_n82=null!==(i=null===(e=s[0])||void 0===e?void 0:e.end)&&void 0!==i?i:_r105;(_r105==_n82?this.view.posAtCoords(this.lastMove)==_r105:function(t,e,i,s,r){var n=t.scrollDOM.getBoundingClientRect(),h=t.documentTop+t.documentPadding.top+t.contentHeight;if(n.left>s||n.right<s||n.top>r||Math.min(n.bottom,h)<r)return!1;var l=t.posAtCoords({x:s,y:r},!1);return l>=e&&l<=i;}(this.view,_r105,_n82,t.clientX,t.clientY))||(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null);}}},{key:"mouseleave",value:function mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;var e=this.active;if(e.length){var _e161=this.tooltip;_e161&&_e161.dom.contains(t.relatedTarget)?this.watchTooltipLeave(_e161.dom):this.view.dispatch({effects:this.setHover.of([])});}}},{key:"watchTooltipLeave",value:function watchTooltipLeave(t){var _this66=this;var _e162=function e(i){t.removeEventListener("mouseleave",_e162),_this66.active.length&&!_this66.view.dom.contains(i.relatedTarget)&&_this66.view.dispatch({effects:_this66.setHover.of([])});};t.addEventListener("mouseleave",_e162);}},{key:"destroy",value:function destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove);}}]);}();bh=4;Mh=bt.define(),yh=q.define({combine:function combine(t){var e,i;var _iterator125=_createForOfIteratorHelper(t),_step125;try{for(_iterator125.s();!(_step125=_iterator125.n()).done;){var _s124=_step125.value;e=e||_s124.topContainer,i=i||_s124.bottomContainer;}}catch(err){_iterator125.e(err);}finally{_iterator125.f();}return{topContainer:e,bottomContainer:i};}});Sh=Zi.fromClass(/*#__PURE__*/function(){function _class7(t){_classCallCheck(this,_class7);this.input=t.state.facet(Ah),this.specs=this.input.filter(function(t){return t;}),this.panels=this.specs.map(function(e){return e(t);});var e=t.state.facet(yh);this.top=new Oh(t,!0,e.topContainer),this.bottom=new Oh(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(function(t){return t.top;})),this.bottom.sync(this.panels.filter(function(t){return!t.top;}));var _iterator126=_createForOfIteratorHelper(this.panels),_step126;try{for(_iterator126.s();!(_step126=_iterator126.n()).done;){var _t172=_step126.value;_t172.dom.classList.add("cm-panel"),_t172.mount&&_t172.mount();}}catch(err){_iterator126.e(err);}finally{_iterator126.f();}}return _createClass(_class7,[{key:"update",value:function update(t){var e=t.state.facet(yh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Oh(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Oh(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var i=t.state.facet(Ah);if(i!=this.input){var _e165=i.filter(function(t){return t;}),_s125=[],_r107=[],_n83=[],_h53=[];var _iterator127=_createForOfIteratorHelper(_e165),_step127;try{for(_iterator127.s();!(_step127=_iterator127.n()).done;){var _i138=_step127.value;var _e166=void 0,_l49=this.specs.indexOf(_i138);_l49<0?(_e166=_i138(t.view),_h53.push(_e166)):(_e166=this.panels[_l49],_e166.update&&_e166.update(t)),_s125.push(_e166),(_e166.top?_r107:_n83).push(_e166);}}catch(err){_iterator127.e(err);}finally{_iterator127.f();}this.specs=_e165,this.panels=_s125,this.top.sync(_r107),this.bottom.sync(_n83);for(var _i137=0,_h54=_h53;_i137<_h54.length;_i137++){var _t173=_h54[_i137];_t173.dom.classList.add("cm-panel"),_t173.mount&&_t173.mount();}}else{var _iterator128=_createForOfIteratorHelper(this.panels),_step128;try{for(_iterator128.s();!(_step128=_iterator128.n()).done;){var _e167=_step128.value;_e167.update&&_e167.update(t);}}catch(err){_iterator128.e(err);}finally{_iterator128.f();}}}},{key:"destroy",value:function destroy(){this.top.sync([]),this.bottom.sync([]);}}]);}(),{provide:function provide(t){return Qr.scrollMargins.of(function(e){var i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()};});}});Oh=/*#__PURE__*/function(){function Oh(t,e,i){_classCallCheck(this,Oh);this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses();}return _createClass(Oh,[{key:"sync",value:function sync(t){var _iterator129=_createForOfIteratorHelper(this.panels),_step129;try{for(_iterator129.s();!(_step129=_iterator129.n()).done;){var _e168=_step129.value;_e168.destroy&&t.indexOf(_e168)<0&&_e168.destroy();}}catch(err){_iterator129.e(err);}finally{_iterator129.f();}this.panels=t,this.syncDOM();}},{key:"syncDOM",value:function syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";var _t174=this.container||this.view.dom;_t174.insertBefore(this.dom,this.top?_t174.firstChild:null);}var t=this.dom.firstChild;var _iterator130=_createForOfIteratorHelper(this.panels),_step130;try{for(_iterator130.s();!(_step130=_iterator130.n()).done;){var _e169=_step130.value;if(_e169.dom.parentNode==this.dom){for(;t!=_e169.dom;)t=Ch(t);t=t.nextSibling;}else this.dom.insertBefore(_e169.dom,t);}}catch(err){_iterator130.e(err);}finally{_iterator130.f();}for(;t;)t=Ch(t);}},{key:"scrollMargin",value:function scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top);}},{key:"syncClasses",value:function syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){var _iterator131=_createForOfIteratorHelper(this.classes.split(" ")),_step131;try{for(_iterator131.s();!(_step131=_iterator131.n()).done;){var _t175=_step131.value;_t175&&this.container.classList.remove(_t175);}}catch(err){_iterator131.e(err);}finally{_iterator131.f();}var _iterator132=_createForOfIteratorHelper((this.classes=this.view.themeClasses).split(" ")),_step132;try{for(_iterator132.s();!(_step132=_iterator132.n()).done;){var _t176=_step132.value;_t176&&this.container.classList.add(_t176);}}catch(err){_iterator132.e(err);}finally{_iterator132.f();}}}}]);}();_export("u",Ah=q.define({enables:Sh}));Dh=/*#__PURE__*/function(_Bt2){function Dh(){_classCallCheck(this,Dh);return _callSuper(this,Dh,arguments);}_inherits(Dh,_Bt2);return _createClass(Dh,[{key:"compare",value:function compare(t){return this==t||this.constructor==t.constructor&&this.eq(t);}},{key:"eq",value:function eq(t){return!1;}},{key:"destroy",value:function destroy(t){}}]);}(Bt);Dh.prototype.elementClass="",Dh.prototype.toDOM=void 0,Dh.prototype.mapMode=E.TrackBefore,Dh.prototype.startSide=Dh.prototype.endSide=-1,Dh.prototype.point=!0;Eh=q.define(),Rh=q.define(),Th={"class":"",renderEmptyElements:!1,elementStyle:"",markers:function markers(){return jt.empty;},lineMarker:function lineMarker(){return null;},widgetMarker:function widgetMarker(){return null;},lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Bh=q.define();Nh=q.define({combine:function combine(t){return t.some(function(t){return t;});}});jh=Zi.fromClass(/*#__PURE__*/function(){function _class8(t){_classCallCheck(this,_class8);this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Bh).map(function(e){return new $h(t,e);});var _iterator133=_createForOfIteratorHelper(this.gutters),_step133;try{for(_iterator133.s();!(_step133=_iterator133.n()).done;){var _t177=_step133.value;this.dom.appendChild(_t177.dom);}}catch(err){_iterator133.e(err);}finally{_iterator133.f();}this.fixed=!t.state.facet(Nh),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM);}return _createClass(_class8,[{key:"update",value:function update(t){if(this.updateGutters(t)){var _e170=this.prevViewport,_i139=t.view.viewport,_s126=Math.min(_e170.to,_i139.to)-Math.max(_e170.from,_i139.from);this.syncGutters(_s126<.8*(_i139.to-_i139.from));}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(Nh)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport;}},{key:"syncGutters",value:function syncGutters(t){var _this67=this;var e=this.dom.nextSibling;t&&this.dom.remove();var i=jt.iter(this.view.state.facet(Eh),this.view.viewport.from),s=[],r=this.gutters.map(function(t){return new Ph(t,_this67.view.viewport,-_this67.view.documentPadding.top);});var _iterator134=_createForOfIteratorHelper(this.view.viewportLineBlocks),_step134;try{for(_iterator134.s();!(_step134=_iterator134.n()).done;){var _t178=_step134.value;if(s.length&&(s=[]),Array.isArray(_t178.type)){var _e171=!0;var _iterator136=_createForOfIteratorHelper(_t178.type),_step136;try{for(_iterator136.s();!(_step136=_iterator136.n()).done;){var _n84=_step136.value;if(_n84.type==ii.Text&&_e171){Hh(i,s,_n84.from);var _iterator137=_createForOfIteratorHelper(r),_step137;try{for(_iterator137.s();!(_step137=_iterator137.n()).done;){var _t179=_step137.value;_t179.line(this.view,_n84,s);}}catch(err){_iterator137.e(err);}finally{_iterator137.f();}_e171=!1;}else if(_n84.widget){var _iterator138=_createForOfIteratorHelper(r),_step138;try{for(_iterator138.s();!(_step138=_iterator138.n()).done;){var _t180=_step138.value;_t180.widget(this.view,_n84);}}catch(err){_iterator138.e(err);}finally{_iterator138.f();}}}}catch(err){_iterator136.e(err);}finally{_iterator136.f();}}else if(_t178.type==ii.Text){Hh(i,s,_t178.from);var _iterator139=_createForOfIteratorHelper(r),_step139;try{for(_iterator139.s();!(_step139=_iterator139.n()).done;){var _e172=_step139.value;_e172.line(this.view,_t178,s);}}catch(err){_iterator139.e(err);}finally{_iterator139.f();}}else if(_t178.widget){var _iterator140=_createForOfIteratorHelper(r),_step140;try{for(_iterator140.s();!(_step140=_iterator140.n()).done;){var _e173=_step140.value;_e173.widget(this.view,_t178);}}catch(err){_iterator140.e(err);}finally{_iterator140.f();}}}}catch(err){_iterator134.e(err);}finally{_iterator134.f();}var _iterator135=_createForOfIteratorHelper(r),_step135;try{for(_iterator135.s();!(_step135=_iterator135.n()).done;){var _t181=_step135.value;_t181.finish();}}catch(err){_iterator135.e(err);}finally{_iterator135.f();}t&&this.view.scrollDOM.insertBefore(this.dom,e);}},{key:"updateGutters",value:function updateGutters(t){var e=t.startState.facet(Bh),i=t.state.facet(Bh),s=t.docChanged||t.heightChanged||t.viewportChanged||!jt.eq(t.startState.facet(Eh),t.state.facet(Eh),t.view.viewport.from,t.view.viewport.to);if(e==i){var _iterator141=_createForOfIteratorHelper(this.gutters),_step141;try{for(_iterator141.s();!(_step141=_iterator141.n()).done;){var _e174=_step141.value;_e174.update(t)&&(s=!0);}}catch(err){_iterator141.e(err);}finally{_iterator141.f();}}else{s=!0;var _r108=[];var _iterator142=_createForOfIteratorHelper(i),_step142;try{for(_iterator142.s();!(_step142=_iterator142.n()).done;){var _s127=_step142.value;var _i141=e.indexOf(_s127);_i141<0?_r108.push(new $h(this.view,_s127)):(this.gutters[_i141].update(t),_r108.push(this.gutters[_i141]));}}catch(err){_iterator142.e(err);}finally{_iterator142.f();}var _iterator143=_createForOfIteratorHelper(this.gutters),_step143;try{for(_iterator143.s();!(_step143=_iterator143.n()).done;){var _t183=_step143.value;_t183.dom.remove(),_r108.indexOf(_t183)<0&&_t183.destroy();}}catch(err){_iterator143.e(err);}finally{_iterator143.f();}for(var _i140=0,_r109=_r108;_i140<_r109.length;_i140++){var _t182=_r109[_i140];this.dom.appendChild(_t182.dom);}this.gutters=_r108;}return s;}},{key:"destroy",value:function destroy(){var _iterator144=_createForOfIteratorHelper(this.gutters),_step144;try{for(_iterator144.s();!(_step144=_iterator144.n()).done;){var _t184=_step144.value;_t184.destroy();}}catch(err){_iterator144.e(err);}finally{_iterator144.f();}this.dom.remove();}}]);}(),{provide:function provide(t){return Qr.scrollMargins.of(function(e){var i=e.plugin(t);return i&&0!=i.gutters.length&&i.fixed?e.textDirection==gi.LTR?{left:i.dom.offsetWidth*e.scaleX}:{right:i.dom.offsetWidth*e.scaleX}:null;});}});Ph=/*#__PURE__*/function(){function Ph(t,e,i){_classCallCheck(this,Ph);this.gutter=t,this.height=i,this.i=0,this.cursor=jt.iter(t.markers,e.from);}return _createClass(Ph,[{key:"addElement",value:function addElement(t,e,i){var s=this.gutter,r=(e.top-this.height)/t.scaleY,n=e.height/t.scaleY;if(this.i==s.elements.length){var _e175=new Wh(t,n,r,i);s.elements.push(_e175),s.dom.appendChild(_e175.dom);}else s.elements[this.i].update(t,n,r,i);this.height=e.bottom,this.i++;}},{key:"line",value:function line(t,e,i){var s=[];Hh(this.cursor,s,e.from),i.length&&(s=s.concat(i));var r=this.gutter.config.lineMarker(t,e,s);r&&s.unshift(r);var n=this.gutter;(0!=s.length||n.config.renderEmptyElements)&&this.addElement(t,e,s);}},{key:"widget",value:function widget(t,e){var i=this.gutter.config.widgetMarker(t,e.widget,e),s=i?[i]:null;var _iterator145=_createForOfIteratorHelper(t.state.facet(Rh)),_step145;try{for(_iterator145.s();!(_step145=_iterator145.n()).done;){var _i142=_step145.value;var _r110=_i142(t,e.widget,e);_r110&&(s||(s=[])).push(_r110);}}catch(err){_iterator145.e(err);}finally{_iterator145.f();}s&&this.addElement(t,e,s);}},{key:"finish",value:function finish(){var t=this.gutter;for(;t.elements.length>this.i;){var _e176=t.elements.pop();t.dom.removeChild(_e176.dom),_e176.destroy();}}}]);}();$h=/*#__PURE__*/function(){function $h(t,e){var _this68=this;_classCallCheck(this,$h);this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config["class"]?" "+this.config["class"]:"");var _loop11=function _loop11(_i143){_this68.dom.addEventListener(_i143,function(s){var r,n=s.target;if(n!=_this68.dom&&_this68.dom.contains(n)){for(;n.parentNode!=_this68.dom;)n=n.parentNode;var _t185=n.getBoundingClientRect();r=(_t185.top+_t185.bottom)/2;}else r=s.clientY;var h=t.lineBlockAtHeight(r-t.documentTop);e.domEventHandlers[_i143](t,h,s)&&s.preventDefault();});};for(var _i143 in e.domEventHandlers){_loop11(_i143);}this.markers=zh(e.markers(t)),e.initialSpacer&&(this.spacer=new Wh(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none");}return _createClass($h,[{key:"update",value:function update(t){var e=this.markers;if(this.markers=zh(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){var _e177=this.config.updateSpacer(this.spacer.markers[0],t);_e177!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[_e177]);}var i=t.view.viewport;return!jt.eq(this.markers,e,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(t);}},{key:"destroy",value:function destroy(){var _iterator146=_createForOfIteratorHelper(this.elements),_step146;try{for(_iterator146.s();!(_step146=_iterator146.n()).done;){var _t186=_step146.value;_t186.destroy();}}catch(err){_iterator146.e(err);}finally{_iterator146.f();}}}]);}();Wh=/*#__PURE__*/function(){function Wh(t,e,i,s){_classCallCheck(this,Wh);this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,s);}return _createClass(Wh,[{key:"update",value:function update(t,e,i,s){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(t,e){if(t.length!=e.length)return!1;for(var _i144=0;_i144<t.length;_i144++)if(!t[_i144].compare(e[_i144]))return!1;return!0;}(this.markers,s)||this.setMarkers(t,s);}},{key:"setMarkers",value:function setMarkers(t,e){var i="cm-gutterElement",s=this.dom.firstChild;for(var _r111=0,_n85=0;;){var _h55=_n85,_l50=_r111<e.length?e[_r111++]:null,_o33=!1;if(_l50){var _t187=_l50.elementClass;_t187&&(i+=" "+_t187);for(var _t188=_n85;_t188<this.markers.length;_t188++)if(this.markers[_t188].compare(_l50)){_h55=_t188,_o33=!0;break;}}else _h55=this.markers.length;for(;_n85<_h55;){var _t189=this.markers[_n85++];if(_t189.toDOM){_t189.destroy(s);var _e178=s.nextSibling;s.remove(),s=_e178;}}if(!_l50)break;_l50.toDOM&&(_o33?s=s.nextSibling:this.dom.insertBefore(_l50.toDOM(t),s)),_o33&&_n85++;}this.dom.className=i,this.markers=e;}},{key:"destroy",value:function destroy(){this.setMarkers(null,[]);}}]);}();qh=q.define(),Fh=q.define(),Vh=q.define({combine:function combine(t){return Tt(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function domEventHandlers(t,e){var i=Object.assign({},t);var _loop12=function _loop12(){var s=i[_t190],r=e[_t190];i[_t190]=s?function(t,e,i){return s(t,e,i)||r(t,e,i);}:r;};for(var _t190 in e){_loop12();}return i;}});}});Jh=/*#__PURE__*/function(_Dh){function Jh(t){var _this69;_classCallCheck(this,Jh);_this69=_callSuper(this,Jh),_this69.number=t;return _this69;}_inherits(Jh,_Dh);return _createClass(Jh,[{key:"eq",value:function eq(t){return this.number==t.number;}},{key:"toDOM",value:function toDOM(){return document.createTextNode(this.number);}}]);}(Dh);Uh=Bh.compute([Vh],function(t){return{"class":"cm-lineNumbers",renderEmptyElements:!1,markers:function markers(t){return t.state.facet(qh);},lineMarker:function lineMarker(t,e,i){return i.some(function(t){return t.toDOM;})?null:new Jh(Gh(t,t.state.doc.lineAt(e.from).number));},widgetMarker:function widgetMarker(t,e,i){var _iterator147=_createForOfIteratorHelper(t.state.facet(Fh)),_step147;try{for(_iterator147.s();!(_step147=_iterator147.n()).done;){var _s128=_step147.value;var _r112=_s128(t,e,i);if(_r112)return _r112;}}catch(err){_iterator147.e(err);}finally{_iterator147.f();}return null;},lineMarkerChange:function lineMarkerChange(t){return t.startState.facet(Vh)!=t.state.facet(Vh);},initialSpacer:function initialSpacer(t){return new Jh(Gh(t,_h(t.state.doc.lines)));},updateSpacer:function updateSpacer(t,e){var i=Gh(e.view,_h(e.view.state.doc.lines));return i==t.number?t:new Jh(i);},domEventHandlers:t.facet(Vh).domEventHandlers};});Xh=new(/*#__PURE__*/function(_Dh2){function _class9(){var _this70;_classCallCheck(this,_class9);_this70=_callSuper(this,_class9,arguments),_this70.elementClass="cm-activeLineGutter";return _this70;}_inherits(_class9,_Dh2);return _createClass(_class9);}(Dh))(),Yh=Eh.compute(["selection"],function(t){var e=[],i=-1;var _iterator148=_createForOfIteratorHelper(t.selection.ranges),_step148;try{for(_iterator148.s();!(_step148=_iterator148.n()).done;){var _s129=_step148.value;var _r113=t.doc.lineAt(_s129.head).from;_r113>i&&(i=_r113,e.push(Xh.range(_r113)));}}catch(err){_iterator148.e(err);}finally{_iterator148.f();}return jt.of(e);});_export("a5",Zh=1024);tl=0;el=/*#__PURE__*/_createClass(function el(t,e){_classCallCheck(this,el);this.from=t,this.to=e;});_export("N",il=/*#__PURE__*/function(){function il(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,il);this.id=tl++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||function(){throw new Error("This node type doesn't define a deserialize function");};}return _createClass(il,[{key:"add",value:function add(t){var _this71=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof t&&(t=nl.match(t)),function(e){var i=t(e);return void 0===i?null:[_this71,i];};}}]);}());il.closedBy=new il({deserialize:function deserialize(t){return t.split(" ");}}),il.openedBy=new il({deserialize:function deserialize(t){return t.split(" ");}}),il.group=new il({deserialize:function deserialize(t){return t.split(" ");}}),il.isolate=new il({deserialize:function deserialize(t){if(t&&"rtl"!=t&&"ltr"!=t&&"auto"!=t)throw new RangeError("Invalid value for isolate: "+t);return t||"auto";}}),il.contextHash=new il({perNode:!0}),il.lookAhead=new il({perNode:!0}),il.mounted=new il({perNode:!0});sl=/*#__PURE__*/function(){function sl(t,e,i){_classCallCheck(this,sl);this.tree=t,this.overlay=e,this.parser=i;}return _createClass(sl,null,[{key:"get",value:function get(t){return t&&t.props&&t.props[il.mounted.id];}}]);}();rl=Object.create(null);_export("a4",nl=/*#__PURE__*/function(){function nl(t,e,i){var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,nl);this.name=t,this.props=e,this.id=i,this.flags=s;}return _createClass(nl,[{key:"prop",value:function prop(t){return this.props[t.id];}},{key:"isTop",get:function get(){return(1&this.flags)>0;}},{key:"isSkipped",get:function get(){return(2&this.flags)>0;}},{key:"isError",get:function get(){return(4&this.flags)>0;}},{key:"isAnonymous",get:function get(){return(8&this.flags)>0;}},{key:"is",value:function is(t){if("string"==typeof t){if(this.name==t)return!0;var _e179=this.prop(il.group);return!!_e179&&_e179.indexOf(t)>-1;}return this.id==t;}}],[{key:"define",value:function define(t){var e=t.props&&t.props.length?Object.create(null):rl,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),s=new nl(t.name||"",e,t.id,i);if(t.props){var _iterator149=_createForOfIteratorHelper(t.props),_step149;try{for(_iterator149.s();!(_step149=_iterator149.n()).done;){var _i145=_step149.value;if(Array.isArray(_i145)||(_i145=_i145(s)),_i145){if(_i145[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[_i145[0].id]=_i145[1];}}}catch(err){_iterator149.e(err);}finally{_iterator149.f();}}return s;}},{key:"match",value:function match(t){var e=Object.create(null);for(var _i146 in t){var _iterator150=_createForOfIteratorHelper(_i146.split(" ")),_step150;try{for(_iterator150.s();!(_step150=_iterator150.n()).done;){var _s130=_step150.value;e[_s130]=t[_i146];}}catch(err){_iterator150.e(err);}finally{_iterator150.f();}}return function(t){for(var _i147=t.prop(il.group),_s131=-1;_s131<(_i147?_i147.length:0);_s131++){var _r114=e[_s131<0?t.name:_i147[_s131]];if(_r114)return _r114;}};}}]);}());nl.none=new nl("",Object.create(null),0,8);_export("a3",hl=/*#__PURE__*/function(){function hl(t){_classCallCheck(this,hl);this.types=t;for(var _e180=0;_e180<t.length;_e180++)if(t[_e180].id!=_e180)throw new RangeError("Node type ids should correspond to array positions when creating a node set");}return _createClass(hl,[{key:"extend",value:function extend(){var e=[];for(var _len4=arguments.length,t=new Array(_len4),_key4=0;_key4<_len4;_key4++){t[_key4]=arguments[_key4];}var _iterator151=_createForOfIteratorHelper(this.types),_step151;try{for(_iterator151.s();!(_step151=_iterator151.n()).done;){var _i148=_step151.value;var _s132=null;var _iterator152=_createForOfIteratorHelper(t),_step152;try{for(_iterator152.s();!(_step152=_iterator152.n()).done;){var _e181=_step152.value;var _t191=_e181(_i148);_t191&&(_s132||(_s132=Object.assign({},_i148.props)),_s132[_t191[0].id]=_t191[1]);}}catch(err){_iterator152.e(err);}finally{_iterator152.f();}e.push(_s132?new nl(_i148.name,_s132,_i148.id,_i148.flags):_i148);}}catch(err){_iterator151.e(err);}finally{_iterator151.f();}return new hl(e);}}]);}());ll=new WeakMap(),ol=new WeakMap();!function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays";}(ul||_export("a7",ul={}));_export("a6",fl=/*#__PURE__*/function(){function fl(t,e,i,s,r){_classCallCheck(this,fl);if(this.type=t,this.children=e,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);var _iterator153=_createForOfIteratorHelper(r),_step153;try{for(_iterator153.s();!(_step153=_iterator153.n()).done;){var _step153$value=_slicedToArray(_step153.value,2),_t192=_step153$value[0],_e182=_step153$value[1];this.props["number"==typeof _t192?_t192:_t192.id]=_e182;}}catch(err){_iterator153.e(err);}finally{_iterator153.f();}}}return _createClass(fl,[{key:"toString",value:function toString(){var t=sl.get(this);if(t&&!t.overlay)return t.tree.toString();var e="";var _iterator154=_createForOfIteratorHelper(this.children),_step154;try{for(_iterator154.s();!(_step154=_iterator154.n()).done;){var _t193=_step154.value;var _i149=_t193.toString();_i149&&(e&&(e+=","),e+=_i149);}}catch(err){_iterator154.e(err);}finally{_iterator154.f();}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e;}},{key:"cursor",value:function cursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return new xl(this.topNode,t);}},{key:"cursorAt",value:function cursorAt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s=ll.get(this)||this.topNode,r=new xl(s);return r.moveTo(t,e),ll.set(this,r._tree),r;}},{key:"topNode",get:function get(){return new ml(this,0,0,null);}},{key:"resolve",value:function resolve(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=pl(ll.get(this)||this.topNode,t,e,!1);return ll.set(this,i),i;}},{key:"resolveInner",value:function resolveInner(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var i=pl(ol.get(this)||this.topNode,t,e,!0);return ol.set(this,i),i;}},{key:"resolveStack",value:function resolveStack(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return function(t,e,i){var s=t.resolveInner(e,i),r=null;for(var _t194=s instanceof ml?s:s.context.parent;_t194;_t194=_t194.parent)if(_t194.index<0){var _n86=_t194.parent;(r||(r=[s])).push(_n86.resolve(e,i)),_t194=_n86;}else{var _n87=sl.get(_t194.tree);if(_n87&&_n87.overlay&&_n87.overlay[0].from<=e&&_n87.overlay[_n87.overlay.length-1].to>=e){var _h56=new ml(_n87.tree,_n87.overlay[0].from+_t194.from,-1,_t194);(r||(r=[s])).push(pl(_h56,e,i,!1));}}return r?Ml(r):s;}(this,t,e);}},{key:"iterate",value:function iterate(t){var e=t.enter,i=t.leave,_t$from=t.from,s=_t$from===void 0?0:_t$from,_t$to=t.to,r=_t$to===void 0?this.length:_t$to,n=t.mode||0,h=(n&ul.IncludeAnonymous)>0;for(var _t195=this.cursor(n|ul.IncludeAnonymous);;){var _n88=!1;if(_t195.from<=r&&_t195.to>=s&&(!h&&_t195.type.isAnonymous||!1!==e(_t195))){if(_t195.firstChild())continue;_n88=!0;}for(;_n88&&i&&(h||!_t195.type.isAnonymous)&&i(_t195),!_t195.nextSibling();){if(!_t195.parent())return;_n88=!0;}}}},{key:"prop",value:function prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t);}},{key:"propValues",get:function get(){var t=[];if(this.props)for(var _e183 in this.props)t.push([+_e183,this.props[_e183]]);return t;}},{key:"balance",value:function balance(){var _this72=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return this.children.length<=8?this:Al(nl.none,this.children,this.positions,0,this.children.length,0,this.length,function(t,e,i){return new fl(_this72.type,t,e,i,_this72.propValues);},t.makeTree||function(t,e,i){return new fl(nl.none,t,e,i);});}}],[{key:"build",value:function build(t){return function(t){var e;var i=t.buffer,s=t.nodeSet,_t$maxBufferLength=t.maxBufferLength,r=_t$maxBufferLength===void 0?Zh:_t$maxBufferLength,_t$reused=t.reused,n=_t$reused===void 0?[]:_t$reused,_t$minRepeatType=t.minRepeatType,h=_t$minRepeatType===void 0?s.types.length:_t$minRepeatType,l=Array.isArray(i)?new al(i,i.length):i,o=s.types,u=0,f=0;function a(t,e,i,b,v,k){var M=l.id,y=l.start,x=l.end,S=l.size,O=f,C=u;for(;S<0;){if(l.next(),-1==S){var _e184=n[M];return i.push(_e184),void b.push(y-t);}if(-3==S)return void(u=M);if(-4==S)return void(f=M);throw new RangeError("Unrecognized record size: ".concat(S));}var A,D,E=o[M],R=y-t;if(x-y<=r&&(D=m(l.pos-e,v))){var _e185=new Uint16Array(D.size-D.skip),_i150=l.pos-D.size,_r115=_e185.length;for(;l.pos>_i150;)_r115=w(D.start,_e185,_r115);A=new cl(_e185,x-D.start,s),R=D.start-t;}else{var _t196=l.pos-S;l.next();var _e186=[],_i151=[],_s133=M>=h?M:-1,_n89=0,_o34=x;for(;l.pos>_t196;)_s133>=0&&l.id==_s133&&l.size>=0?(l.end<=_o34-r&&(p(_e186,_i151,y,_n89,l.end,_o34,_s133,O,C),_n89=_e186.length,_o34=l.end),l.next()):k>2500?c(y,_t196,_e186,_i151):a(y,_t196,_e186,_i151,_s133,k+1);if(_s133>=0&&_n89>0&&_n89<_e186.length&&p(_e186,_i151,y,_n89,y,_o34,_s133,O,C),_e186.reverse(),_i151.reverse(),_s133>-1&&_n89>0){var _t197=d(E,C);A=Al(E,_e186,_i151,0,_e186.length,0,x-y,_t197,_t197);}else A=g(E,_e186,_i151,x-y,O-x,C);}i.push(A),b.push(R);}function c(t,e,i,n){var h=[],o=0,u=-1;for(;l.pos>e;){var _t198=l.id,_e187=l.start,_i152=l.end,_s134=l.size;if(_s134>4)l.next();else{if(u>-1&&_e187<u)break;u<0&&(u=_i152-r),h.push(_t198,_e187,_i152),o++,l.next();}}if(o){var _e188=new Uint16Array(4*o),_r116=h[h.length-2];for(var _t199=h.length-3,_i153=0;_t199>=0;_t199-=3)_e188[_i153++]=h[_t199],_e188[_i153++]=h[_t199+1]-_r116,_e188[_i153++]=h[_t199+2]-_r116,_e188[_i153++]=_i153;i.push(new cl(_e188,h[2]-_r116,s)),n.push(_r116-t);}}function d(t,e){return function(i,s,r){var n,h,l=0,o=i.length-1;if(o>=0&&(n=i[o])instanceof fl){if(!o&&n.type==t&&n.length==r)return n;(h=n.prop(il.lookAhead))&&(l=s[o]+n.length+h);}return g(t,i,s,r,l,e);};}function p(t,e,i,r,n,h,l,o,u){var f=[],a=[];for(;t.length>r;)f.push(t.pop()),a.push(e.pop()+i-n);t.push(g(s.types[l],f,a,h-n,o-h,u)),e.push(n-i);}function g(t,e,i,s,r,n,h){if(n){var _t200=[il.contextHash,n];h=h?[_t200].concat(h):[_t200];}if(r>25){var _t201=[il.lookAhead,r];h=h?[_t201].concat(h):[_t201];}return new fl(t,e,i,s,h);}function m(t,e){var i=l.fork(),s=0,n=0,o=0,u=i.end-r,f={size:0,start:0,skip:0};t:for(var _r117=i.pos-t;i.pos>_r117;){var _t202=i.size;if(i.id==e&&_t202>=0){f.size=s,f.start=n,f.skip=o,o+=4,s+=4,i.next();continue;}var _l51=i.pos-_t202;if(_t202<0||_l51<_r117||i.start<u)break;var _a15=i.id>=h?4:0,_c11=i.start;for(i.next();i.pos>_l51;){if(i.size<0){if(-3!=i.size)break t;_a15+=4;}else i.id>=h&&(_a15+=4);i.next();}n=_c11,s+=_t202,o+=_a15;}return(e<0||s==t)&&(f.size=s,f.start=n,f.skip=o),f.size>4?f:void 0;}function w(t,e,i){var s=l.id,r=l.start,n=l.end,o=l.size;if(l.next(),o>=0&&s<h){var _h57=i;if(o>4){var _s135=l.pos-(o-4);for(;l.pos>_s135;)i=w(t,e,i);}e[--i]=_h57,e[--i]=n-t,e[--i]=r-t,e[--i]=s;}else-3==o?u=s:-4==o&&(f=s);return i;}var b=[],v=[];for(;l.pos>0;)a(t.start||0,t.bufferStart||0,b,v,-1,0);var k=null!==(e=t.length)&&void 0!==e?e:b.length?v[0]+b[0].length:0;return new fl(o[t.topID],b.reverse(),v.reverse(),k);}(t);}}]);}());fl.empty=new fl(nl.none,[],[],0);al=/*#__PURE__*/function(){function al(t,e){_classCallCheck(this,al);this.buffer=t,this.index=e;}return _createClass(al,[{key:"id",get:function get(){return this.buffer[this.index-4];}},{key:"start",get:function get(){return this.buffer[this.index-3];}},{key:"end",get:function get(){return this.buffer[this.index-2];}},{key:"size",get:function get(){return this.buffer[this.index-1];}},{key:"pos",get:function get(){return this.index;}},{key:"next",value:function next(){this.index-=4;}},{key:"fork",value:function fork(){return new al(this.buffer,this.index);}}]);}();cl=/*#__PURE__*/function(){function cl(t,e,i){_classCallCheck(this,cl);this.buffer=t,this.length=e,this.set=i;}return _createClass(cl,[{key:"type",get:function get(){return nl.none;}},{key:"toString",value:function toString(){var t=[];for(var _e189=0;_e189<this.buffer.length;)t.push(this.childString(_e189)),_e189=this.buffer[_e189+3];return t.join(",");}},{key:"childString",value:function childString(t){var e=this.buffer[t],i=this.buffer[t+3],s=this.set.types[e],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),i==(t+=4))return r;var n=[];for(;t<i;)n.push(this.childString(t)),t=this.buffer[t+3];return r+"("+n.join(",")+")";}},{key:"findChild",value:function findChild(t,e,i,s,r){var n=this.buffer,h=-1;for(var _l52=t;_l52!=e&&!(dl(r,s,n[_l52+1],n[_l52+2])&&(h=_l52,i>0));_l52=n[_l52+3]);return h;}},{key:"slice",value:function slice(t,e,i){var s=this.buffer,r=new Uint16Array(e-t),n=0;for(var _h58=t,_l53=0;_h58<e;){r[_l53++]=s[_h58++],r[_l53++]=s[_h58++]-i;var _e190=r[_l53++]=s[_h58++]-i;r[_l53++]=s[_h58++]-t,n=Math.max(n,_e190);}return new cl(r,n,this.set);}}]);}();gl=/*#__PURE__*/function(){function gl(){_classCallCheck(this,gl);}return _createClass(gl,[{key:"cursor",value:function cursor(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return new xl(this,t);}},{key:"getChild",value:function getChild(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var s=wl(this,t,e,i);return s.length?s[0]:null;}},{key:"getChildren",value:function getChildren(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return wl(this,t,e,i);}},{key:"resolve",value:function resolve(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return pl(this,t,e,!1);}},{key:"resolveInner",value:function resolveInner(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return pl(this,t,e,!0);}},{key:"matchContext",value:function matchContext(t){return bl(this.parent,t);}},{key:"enterUnfinishedNodesBefore",value:function enterUnfinishedNodesBefore(t){var e=this.childBefore(t),i=this;for(;e;){var _t203=e.lastChild;if(!_t203||_t203.to!=e.to)break;_t203.type.isError&&_t203.from==_t203.to?(i=e,e=_t203.prevSibling):e=_t203;}return i;}},{key:"node",get:function get(){return this;}},{key:"next",get:function get(){return this.parent;}}]);}();ml=/*#__PURE__*/function(_gl){function ml(t,e,i,s){var _this73;_classCallCheck(this,ml);_this73=_callSuper(this,ml),_this73._tree=t,_this73.from=e,_this73.index=i,_this73._parent=s;return _this73;}_inherits(ml,_gl);return _createClass(ml,[{key:"type",get:function get(){return this._tree.type;}},{key:"name",get:function get(){return this._tree.type.name;}},{key:"to",get:function get(){return this.from+this._tree.length;}},{key:"nextChild",value:function nextChild(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;for(var _n90=this;;){for(var _n90$_tree=_n90._tree,_h60=_n90$_tree.children,_l54=_n90$_tree.positions,_o35=e>0?_h60.length:-1;t!=_o35;t+=e){var _o36=_h60[t],_u27=_l54[t]+_n90.from;if(dl(s,i,_u27,_u27+_o36.length))if(_o36 instanceof cl){if(r&ul.ExcludeBuffers)continue;var _h61=_o36.findChild(0,_o36.buffer.length,e,i-_u27,s);if(_h61>-1)return new kl(new vl(_n90,_o36,t,_u27),null,_h61);}else if(r&ul.IncludeAnonymous||!_o36.type.isAnonymous||Sl(_o36)){var _h62=void 0;if(!(r&ul.IgnoreMounts)&&(_h62=sl.get(_o36))&&!_h62.overlay)return new ml(_h62.tree,_u27,t,_n90);var _l55=new ml(_o36,_u27,t,_n90);return r&ul.IncludeAnonymous||!_l55.type.isAnonymous?_l55:_l55.nextChild(e<0?_o36.children.length-1:0,e,i,s);}}if(r&ul.IncludeAnonymous||!_n90.type.isAnonymous)return null;if(t=_n90.index>=0?_n90.index+e:e<0?-1:_n90._parent._tree.children.length,_n90=_n90._parent,!_n90)return null;}}},{key:"firstChild",get:function get(){return this.nextChild(0,1,0,4);}},{key:"lastChild",get:function get(){return this.nextChild(this._tree.children.length-1,-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.nextChild(0,1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var s;if(!(i&ul.IgnoreOverlays)&&(s=sl.get(this._tree))&&s.overlay){var _i154=t-this.from;var _iterator155=_createForOfIteratorHelper(s.overlay),_step155;try{for(_iterator155.s();!(_step155=_iterator155.n()).done;){var _step155$value=_step155.value,_t204=_step155$value.from,_r118=_step155$value.to;if((e>0?_t204<=_i154:_t204<_i154)&&(e<0?_r118>=_i154:_r118>_i154))return new ml(s.tree,s.overlay[0].from+this.from,-1,this);}}catch(err){_iterator155.e(err);}finally{_iterator155.f();}}return this.nextChild(0,1,t,e,i);}},{key:"nextSignificantParent",value:function nextSignificantParent(){var t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t;}},{key:"parent",get:function get(){return this._parent?this._parent.nextSignificantParent():null;}},{key:"nextSibling",get:function get(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null;}},{key:"prevSibling",get:function get(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null;}},{key:"tree",get:function get(){return this._tree;}},{key:"toTree",value:function toTree(){return this._tree;}},{key:"toString",value:function toString(){return this._tree.toString();}}]);}(gl);vl=/*#__PURE__*/_createClass(function vl(t,e,i,s){_classCallCheck(this,vl);this.parent=t,this.buffer=e,this.index=i,this.start=s;});kl=/*#__PURE__*/function(_gl2){function kl(t,e,i){var _this74;_classCallCheck(this,kl);_this74=_callSuper(this,kl),_this74.context=t,_this74._parent=e,_this74.index=i,_this74.type=t.buffer.set.types[t.buffer.buffer[i]];return _this74;}_inherits(kl,_gl2);return _createClass(kl,[{key:"name",get:function get(){return this.type.name;}},{key:"from",get:function get(){return this.context.start+this.context.buffer.buffer[this.index+1];}},{key:"to",get:function get(){return this.context.start+this.context.buffer.buffer[this.index+2];}},{key:"child",value:function child(t,e,i){var s=this.context.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new kl(this.context,this,r);}},{key:"firstChild",get:function get(){return this.child(1,0,4);}},{key:"lastChild",get:function get(){return this.child(-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.child(1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.child(-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(i&ul.ExcludeBuffers)return null;var s=this.context.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new kl(this.context,this,r);}},{key:"parent",get:function get(){return this._parent||this.context.parent.nextSignificantParent();}},{key:"externalSibling",value:function externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4);}},{key:"nextSibling",get:function get(){var t=this.context.buffer,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new kl(this.context,this._parent,e):this.externalSibling(1);}},{key:"prevSibling",get:function get(){var t=this.context.buffer,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new kl(this.context,this._parent,t.findChild(e,this.index,-1,0,4));}},{key:"tree",get:function get(){return null;}},{key:"toTree",value:function toTree(){var t=[],e=[],i=this.context.buffer,s=this.index+4,r=i.buffer[this.index+3];if(r>s){var _n91=i.buffer[this.index+1];t.push(i.slice(s,r,_n91)),e.push(0);}return new fl(this.type,t,e,this.to-this.from);}},{key:"toString",value:function toString(){return this.context.buffer.childString(this.index);}}]);}(gl);yl=/*#__PURE__*/function(){function yl(t,e){_classCallCheck(this,yl);this.heads=t,this.node=e;}return _createClass(yl,[{key:"next",get:function get(){return Ml(this.heads);}}]);}();xl=/*#__PURE__*/function(){function xl(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;_classCallCheck(this,xl);if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof ml)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(var _e192=t._parent;_e192;_e192=_e192._parent)this.stack.unshift(_e192.index);this.bufferNode=t,this.yieldBuf(t.index);}}return _createClass(xl,[{key:"name",get:function get(){return this.type.name;}},{key:"yieldNode",value:function yieldNode(t){return!!t&&(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0);}},{key:"yieldBuf",value:function yieldBuf(t,e){this.index=t;var _this$buffer=this.buffer,i=_this$buffer.start,s=_this$buffer.buffer;return this.type=e||s.set.types[s.buffer[t]],this.from=i+s.buffer[t+1],this.to=i+s.buffer[t+2],!0;}},{key:"yield",value:function _yield(t){return!!t&&(t instanceof ml?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)));}},{key:"toString",value:function toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString();}},{key:"enterChild",value:function enterChild(t,e,i){if(!this.buffer)return this["yield"](this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));var s=this.buffer.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],t,e-this.buffer.start,i);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r));}},{key:"firstChild",value:function firstChild(){return this.enterChild(1,0,4);}},{key:"lastChild",value:function lastChild(){return this.enterChild(-1,0,4);}},{key:"childAfter",value:function childAfter(t){return this.enterChild(1,t,2);}},{key:"childBefore",value:function childBefore(t){return this.enterChild(-1,t,-2);}},{key:"enter",value:function enter(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:this.mode;return this.buffer?!(i&ul.ExcludeBuffers)&&this.enterChild(1,t,e):this["yield"](this._tree.enter(t,e,i));}},{key:"parent",value:function parent(){if(!this.buffer)return this.yieldNode(this.mode&ul.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var t=this.mode&ul.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t);}},{key:"sibling",value:function sibling(t){if(!this.buffer)return!!this._tree._parent&&this["yield"](this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode));var e=this.buffer.buffer,i=this.stack.length-1;if(t<0){var _t206=i<0?0:this.stack[i]+4;if(this.index!=_t206)return this.yieldBuf(e.findChild(_t206,this.index,-1,0,4));}else{var _t207=e.buffer[this.index+3];if(_t207<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(_t207);}return i<0&&this["yield"](this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode));}},{key:"nextSibling",value:function nextSibling(){return this.sibling(1);}},{key:"prevSibling",value:function prevSibling(){return this.sibling(-1);}},{key:"atLastNode",value:function atLastNode(t){var e,i,s=this.buffer;if(s){if(t>0){if(this.index<s.buffer.buffer.length)return!1;}else for(var _t208=0;_t208<this.index;_t208++)if(s.buffer.buffer[_t208+3]<this.index)return!1;e=s.index;i=s.parent;}else{var _this$_tree=this._tree;e=_this$_tree.index;i=_this$_tree._parent;}for(;i;_i155=i,e=_i155.index,i=_i155._parent,_i155){var _i155;if(e>-1)for(var _s140=e+t,_r120=t<0?-1:i._tree.children.length;_s140!=_r120;_s140+=t){var _t209=i._tree.children[_s140];if(this.mode&ul.IncludeAnonymous||_t209 instanceof cl||!_t209.type.isAnonymous||Sl(_t209))return!1;}}return!0;}},{key:"move",value:function move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1;}}},{key:"next",value:function next(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.move(1,t);}},{key:"prev",value:function prev(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!0;return this.move(-1,t);}},{key:"moveTo",value:function moveTo(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this;}},{key:"node",get:function get(){if(!this.buffer)return this._tree;var t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(var _s141=this.index,_r121=this.stack.length;_r121>=0;){for(var _n92=t;_n92;_n92=_n92._parent)if(_n92.index==_s141){if(_s141==this.index)return _n92;e=_n92,i=_r121+1;break t;}_s141=this.stack[--_r121];}for(var _t210=i;_t210<this.stack.length;_t210++)e=new kl(this.buffer,e,this.stack[_t210]);return this.bufferNode=new kl(this.buffer,e,this.index);}},{key:"tree",get:function get(){return this.buffer?null:this._tree._tree;}},{key:"iterate",value:function iterate(t,e){for(var _i156=0;;){var _s142=!1;if(this.type.isAnonymous||!1!==t(this)){if(this.firstChild()){_i156++;continue;}this.type.isAnonymous||(_s142=!0);}for(;;){if(_s142&&e&&e(this),_s142=this.type.isAnonymous,!_i156)return;if(this.nextSibling())break;this.parent(),_i156--,_s142=!0;}}}},{key:"matchContext",value:function matchContext(t){if(!this.buffer)return bl(this.node.parent,t);var e=this.buffer.buffer,i=e.set.types;for(var _s143=t.length-1,_r122=this.stack.length-1;_s143>=0;_r122--){if(_r122<0)return bl(this._tree,t,_s143);var _n93=i[e.buffer[this.stack[_r122]]];if(!_n93.isAnonymous){if(t[_s143]&&t[_s143]!=_n93.name)return!1;_s143--;}}return!0;}}]);}();Ol=new WeakMap();_export("aj",Dl=/*#__PURE__*/function(){function Dl(){_classCallCheck(this,Dl);this.map=new WeakMap();}return _createClass(Dl,[{key:"setBuffer",value:function setBuffer(t,e,i){var s=this.map.get(t);s||this.map.set(t,s=new Map()),s.set(e,i);}},{key:"getBuffer",value:function getBuffer(t,e){var i=this.map.get(t);return i&&i.get(e);}},{key:"set",value:function set(t,e){t instanceof kl?this.setBuffer(t.context.buffer,t.index,e):t instanceof ml&&this.map.set(t.tree,e);}},{key:"get",value:function get(t){return t instanceof kl?this.getBuffer(t.context.buffer,t.index):t instanceof ml?this.map.get(t.tree):void 0;}},{key:"cursorSet",value:function cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e);}},{key:"cursorGet",value:function cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree);}}]);}());El=/*#__PURE__*/function(){function El(t,e,i,s){var r=arguments.length>4&&arguments[4]!==undefined?arguments[4]:!1;var n=arguments.length>5&&arguments[5]!==undefined?arguments[5]:!1;_classCallCheck(this,El);this.from=t,this.to=e,this.tree=i,this.offset=s,this.open=(r?1:0)|(n?2:0);}return _createClass(El,[{key:"openStart",get:function get(){return(1&this.open)>0;}},{key:"openEnd",get:function get(){return(2&this.open)>0;}}],[{key:"addTree",value:function addTree(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var s=[new El(0,t.length,t,0,!1,i)];var _iterator157=_createForOfIteratorHelper(e),_step157;try{for(_iterator157.s();!(_step157=_iterator157.n()).done;){var _i158=_step157.value;_i158.to>t.length&&s.push(_i158);}}catch(err){_iterator157.e(err);}finally{_iterator157.f();}return s;}},{key:"applyChanges",value:function applyChanges(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:128;if(!e.length)return t;var s=[],r=1,n=t.length?t[0]:null;for(var _h63=0,_l56=0,_o37=0;;_h63++){var _u29=_h63<e.length?e[_h63]:null,_f21=_u29?_u29.fromA:1e9;if(_f21-_l56>=i)for(;n&&n.from<_f21;){var _e195=n;if(_l56>=_e195.from||_f21<=_e195.to||_o37){var _t212=Math.max(_e195.from,_l56)-_o37,_i159=Math.min(_e195.to,_f21)-_o37;_e195=_t212>=_i159?null:new El(_t212,_i159,_e195.tree,_e195.offset+_o37,_h63>0,!!_u29);}if(_e195&&s.push(_e195),n.to>_f21)break;n=r<t.length?t[r++]:null;}if(!_u29)break;_l56=_u29.toA,_o37=_u29.toA-_u29.toB;}return s;}}]);}();_export("a2",Rl=/*#__PURE__*/function(){function Rl(){_classCallCheck(this,Rl);}return _createClass(Rl,[{key:"startParse",value:function startParse(t,e,i){return"string"==typeof t&&(t=new Tl(t)),i=i?i.length?i.map(function(t){return new el(t.from,t.to);}):[new el(0,0)]:[new el(0,t.length)],this.createParse(t,e||[],i);}},{key:"parse",value:function parse(t,e,i){var s=this.startParse(t,e,i);for(;;){var _t213=s.advance();if(_t213)return _t213;}}}]);}());Tl=/*#__PURE__*/function(){function Tl(t){_classCallCheck(this,Tl);this.string=t;}return _createClass(Tl,[{key:"length",get:function get(){return this.string.length;}},{key:"chunk",value:function chunk(t){return this.string.slice(t);}},{key:"lineChunks",get:function get(){return!1;}},{key:"read",value:function read(t,e){return this.string.slice(t,e);}}]);}();Il=/*#__PURE__*/_createClass(function Il(t,e,i,s,r){_classCallCheck(this,Il);this.parser=t,this.parse=e,this.overlay=i,this.target=s,this.from=r;});Ll=/*#__PURE__*/_createClass(function Ll(t,e,i,s,r,n,h){_classCallCheck(this,Ll);this.parser=t,this.predicate=e,this.mounts=i,this.index=s,this.start=r,this.target=n,this.prev=h,this.depth=0,this.ranges=[];});jl=new il({perNode:!0});zl=/*#__PURE__*/function(){function zl(t,e,i,s,r){_classCallCheck(this,zl);this.nest=e,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=t;}return _createClass(zl,[{key:"advance",value:function advance(){if(this.baseParse){var _t214=this.baseParse.advance();if(!_t214)return null;if(this.baseParse=null,this.baseTree=_t214,this.startInner(),null!=this.stoppedAt){var _iterator158=_createForOfIteratorHelper(this.inner),_step158;try{for(_iterator158.s();!(_step158=_iterator158.n()).done;){var _t215=_step158.value;_t215.parse.stopAt(this.stoppedAt);}}catch(err){_iterator158.e(err);}finally{_iterator158.f();}}}if(this.innerDone==this.inner.length){var _t216=this.baseTree;return null!=this.stoppedAt&&(_t216=new fl(_t216.type,_t216.children,_t216.positions,_t216.length,_t216.propValues.concat([[jl,this.stoppedAt]]))),_t216;}var t=this.inner[this.innerDone],e=t.parse.advance();if(e){this.innerDone++;var _i160=Object.assign(Object.create(null),t.target.props);_i160[il.mounted.id]=new sl(e,t.overlay,t.parser),t.target.props=_i160;}return null;}},{key:"parsedPos",get:function get(){if(this.baseParse)return 0;var t=this.input.length;for(var _e196=this.innerDone;_e196<this.inner.length;_e196++)this.inner[_e196].from<t&&(t=Math.min(t,this.inner[_e196].parse.parsedPos));return t;}},{key:"stopAt",value:function stopAt(t){if(this.stoppedAt=t,this.baseParse)this.baseParse.stopAt(t);else for(var _e197=this.innerDone;_e197<this.inner.length;_e197++)this.inner[_e197].parse.stopAt(t);}},{key:"startInner",value:function startInner(){var t=new ql(this.fragments),e=null,i=null,s=new xl(new ml(this.baseTree,this.ranges[0].from,0,null),ul.IncludeAnonymous|ul.IgnoreMounts);t:for(var _r124,_n94;;){var _h64=void 0,_l57=!0;if(null!=this.stoppedAt&&s.from>=this.stoppedAt)_l57=!1;else if(t.hasNode(s)){if(e){var _t217=e.mounts.find(function(t){return t.frag.from<=s.from&&t.frag.to>=s.to&&t.mount.overlay;});if(_t217){var _iterator159=_createForOfIteratorHelper(_t217.mount.overlay),_step159;try{var _loop13=function _loop13(){var i=_step159.value;var r=i.from+_t217.pos,n=i.to+_t217.pos;r>=s.from&&n<=s.to&&!e.ranges.some(function(t){return t.from<n&&t.to>r;})&&e.ranges.push({from:r,to:n});};for(_iterator159.s();!(_step159=_iterator159.n()).done;){_loop13();}}catch(err){_iterator159.e(err);}finally{_iterator159.f();}}}_l57=!1;}else if(i&&(_n94=Hl(i.ranges,s.from,s.to)))_l57=2!=_n94;else if(!s.type.isAnonymous&&(_r124=this.nest(s,this.input))&&(s.from<s.to||!_r124.overlay)){s.tree||$l(s);var _n95=t.findMounts(s.from,_r124.parser);if("function"==typeof _r124.overlay)e=new Ll(_r124.parser,_r124.overlay,_n95,this.inner.length,s.from,s.tree,e);else{var _t218=Fl(this.ranges,_r124.overlay||(s.from<s.to?[new el(s.from,s.to)]:[]));_t218.length&&Nl(_t218),!_t218.length&&_r124.overlay||this.inner.push(new Il(_r124.parser,_t218.length?_r124.parser.startParse(this.input,Jl(_n95,_t218),_t218):_r124.parser.startParse(""),_r124.overlay?_r124.overlay.map(function(t){return new el(t.from-s.from,t.to-s.from);}):null,s.tree,_t218.length?_t218[0].from:s.from)),_r124.overlay?_t218.length&&(i={ranges:_t218,depth:0,prev:i}):_l57=!1;}}else if(e&&(_h64=e.predicate(s))&&(!0===_h64&&(_h64=new el(s.from,s.to)),_h64.from<_h64.to)){var _t219=e.ranges.length-1;_t219>=0&&e.ranges[_t219].to==_h64.from?e.ranges[_t219]={from:e.ranges[_t219].from,to:_h64.to}:e.ranges.push(_h64);}if(_l57&&s.firstChild())e&&e.depth++,i&&i.depth++;else for(;!s.nextSibling();){if(!s.parent())break t;if(e&&! --e.depth){var _t220=Fl(this.ranges,e.ranges);_t220.length&&(Nl(_t220),this.inner.splice(e.index,0,new Il(e.parser,e.parser.startParse(this.input,Jl(e.mounts,_t220),_t220),e.ranges.map(function(t){return new el(t.from-e.start,t.to-e.start);}),e.target,_t220[0].from))),e=e.prev;}i&&! --i.depth&&(i=i.prev);}}}}]);}();Wl=/*#__PURE__*/function(){function Wl(t,e){_classCallCheck(this,Wl);this.offset=e,this.done=!1,this.cursor=t.cursor(ul.IncludeAnonymous|ul.IgnoreMounts);}return _createClass(Wl,[{key:"moveTo",value:function moveTo(t){var e=this.cursor,i=t-this.offset;for(;!this.done&&e.from<i;)e.to>=t&&e.enter(i,1,ul.IgnoreOverlays|ul.ExcludeBuffers)||e.next(!1)||(this.done=!0);}},{key:"hasNode",value:function hasNode(t){if(this.moveTo(t.from),!this.done&&this.cursor.from+this.offset==t.from&&this.cursor.tree)for(var _e199=this.cursor.tree;;){if(_e199==t.tree)return!0;if(!(_e199.children.length&&0==_e199.positions[0]&&_e199.children[0]instanceof fl))break;_e199=_e199.children[0];}return!1;}}]);}();ql=/*#__PURE__*/function(){function ql(t){_classCallCheck(this,ql);var e;if(this.fragments=t,this.curTo=0,this.fragI=0,t.length){var _i163=this.curFrag=t[0];this.curTo=null!==(e=_i163.tree.prop(jl))&&void 0!==e?e:_i163.to,this.inner=new Wl(_i163.tree,-_i163.offset);}else this.curFrag=this.inner=null;}return _createClass(ql,[{key:"hasNode",value:function hasNode(t){for(;this.curFrag&&t.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=t.from&&this.curTo>=t.to&&this.inner.hasNode(t);}},{key:"nextFrag",value:function nextFrag(){var t;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{var _e200=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(t=_e200.tree.prop(jl))&&void 0!==t?t:_e200.to,this.inner=new Wl(_e200.tree,-_e200.offset);}}},{key:"findMounts",value:function findMounts(t,e){var i;var s=[];if(this.inner){this.inner.cursor.moveTo(t,1);for(var _t221=this.inner.cursor.node;_t221;_t221=_t221.parent){var _r125=null===(i=_t221.tree)||void 0===i?void 0:i.prop(il.mounted);if(_r125&&_r125.parser==e)for(var _e201=this.fragI;_e201<this.fragments.length;_e201++){var _i164=this.fragments[_e201];if(_i164.from>=_t221.to)break;_i164.tree==this.curFrag.tree&&s.push({frag:_i164,pos:_t221.from-_i164.offset,mount:_r125});}}}return s;}}]);}();Gl=0;Ul=/*#__PURE__*/function(){function Ul(t,e,i,s){_classCallCheck(this,Ul);this.name=t,this.set=e,this.base=i,this.modified=s,this.id=Gl++;}return _createClass(Ul,[{key:"toString",value:function toString(){var t=this.name;var _iterator162=_createForOfIteratorHelper(this.modified),_step162;try{for(_iterator162.s();!(_step162=_iterator162.n()).done;){var _e204=_step162.value;_e204.name&&(t="".concat(_e204.name,"(").concat(t,")"));}}catch(err){_iterator162.e(err);}finally{_iterator162.f();}return t;}}],[{key:"define",value:function define(t,e){var i="string"==typeof t?t:"?";if(t instanceof Ul&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");var s=new Ul(i,[],null,[]);if(s.set.push(s),e){var _iterator163=_createForOfIteratorHelper(e.set),_step163;try{for(_iterator163.s();!(_step163=_iterator163.n()).done;){var _t224=_step163.value;s.set.push(_t224);}}catch(err){_iterator163.e(err);}finally{_iterator163.f();}}return s;}},{key:"defineModifier",value:function defineModifier(t){var e=new _l(t);return function(t){return t.modified.indexOf(e)>-1?t:_l.get(t.base||t,t.modified.concat(e).sort(function(t,e){return t.id-e.id;}));};}}]);}();Kl=0;_l=/*#__PURE__*/function(){function _l(t){_classCallCheck(this,_l);this.name=t,this.instances=[],this.id=Kl++;}return _createClass(_l,null,[{key:"get",value:function get(t,e){if(!e.length)return t;var i=e[0].instances.find(function(i){return i.base==t&&(s=e,r=i.modified,s.length==r.length&&s.every(function(t,e){return t==r[e];}));var s,r;});if(i)return i;var s=[],r=new Ul(t.name,s,t,e);var _iterator164=_createForOfIteratorHelper(e),_step164;try{for(_iterator164.s();!(_step164=_iterator164.n()).done;){var _t225=_step164.value;_t225.instances.push(r);}}catch(err){_iterator164.e(err);}finally{_iterator164.f();}var n=function(t){var e=[[]];for(var _i165=0;_i165<t.length;_i165++)for(var _s148=0,_r127=e.length;_s148<_r127;_s148++)e.push(e[_s148].concat(t[_i165]));return e.sort(function(t,e){return e.length-t.length;});}(e);var _iterator165=_createForOfIteratorHelper(t.set),_step165;try{for(_iterator165.s();!(_step165=_iterator165.n()).done;){var _e205=_step165.value;if(!_e205.modified.length){var _iterator166=_createForOfIteratorHelper(n),_step166;try{for(_iterator166.s();!(_step166=_iterator166.n()).done;){var _t226=_step166.value;s.push(_l.get(_e205,_t226));}}catch(err){_iterator166.e(err);}finally{_iterator166.f();}}}}catch(err){_iterator165.e(err);}finally{_iterator165.f();}return r;}}]);}();Yl=new il();Ql=/*#__PURE__*/function(){function Ql(t,e,i,s){_classCallCheck(this,Ql);this.tags=t,this.mode=e,this.context=i,this.next=s;}return _createClass(Ql,[{key:"opaque",get:function get(){return 0==this.mode;}},{key:"inherit",get:function get(){return 1==this.mode;}},{key:"sort",value:function sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t);}},{key:"depth",get:function get(){return this.context?this.context.length:0;}}]);}();Ql.empty=new Ql([],2,null);eo=/*#__PURE__*/function(){function eo(t,e,i){_classCallCheck(this,eo);this.at=t,this.highlighters=e,this.span=i,this["class"]="";}return _createClass(eo,[{key:"startSpan",value:function startSpan(t,e){e!=this["class"]&&(this.flush(t),t>this.at&&(this.at=t),this["class"]=e);}},{key:"flush",value:function flush(t){t>this.at&&this["class"]&&this.span(this.at,t,this["class"]);}},{key:"highlightRange",value:function highlightRange(t,e,i,s,r){var n=t.type,h=t.from,l=t.to;if(h>=i||l<=e)return;n.isTop&&(r=this.highlighters.filter(function(t){return!t.scope||t.scope(n);}));var o=s,u=function(t){var e=t.type.prop(Yl);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null;}(t)||Ql.empty,f=function(t,e){var i=null;var _iterator172=_createForOfIteratorHelper(t),_step172;try{for(_iterator172.s();!(_step172=_iterator172.n()).done;){var _s153=_step172.value;var _t230=_s153.style(e);_t230&&(i=i?i+" "+_t230:_t230);}}catch(err){_iterator172.e(err);}finally{_iterator172.f();}return i;}(r,u.tags);if(f&&(o&&(o+=" "),o+=f,1==u.mode&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(e,h),o),u.opaque)return;var a=t.tree&&t.tree.prop(il.mounted);if(a&&a.overlay){var _n98=t.node.enter(a.overlay[0].from+h,1),_u31=this.highlighters.filter(function(t){return!t.scope||t.scope(a.tree.type);}),_f23=t.firstChild();for(var _c12=0,_d10=h;;_c12++){var _p10=_c12<a.overlay.length?a.overlay[_c12]:null,_g5=_p10?_p10.from+h:l,_m5=Math.max(e,_d10),_w2=Math.min(i,_g5);if(_m5<_w2&&_f23)for(;t.from<_w2&&(this.highlightRange(t,_m5,_w2,s,r),this.startSpan(Math.min(_w2,t.to),o),!(t.to>=_g5)&&t.nextSibling()););if(!_p10||_g5>i)break;_d10=_p10.to+h,_d10>e&&(this.highlightRange(_n98.cursor(),Math.max(e,_p10.from+h),Math.min(i,_d10),"",_u31),this.startSpan(Math.min(i,_d10),o));}_f23&&t.parent();}else if(t.firstChild()){a&&(s="");do{if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,s,r),this.startSpan(Math.min(i,t.to),o);}}while(t.nextSibling());t.parent();}}}]);}();io=Ul.define,so=io(),ro=io(),no=io(ro),ho=io(ro),lo=io(),oo=io(lo),uo=io(lo),fo=io(),ao=io(fo),co=io(),po=io(),go=io(),mo=io(go),wo=io(),_export("t",bo={comment:so,lineComment:io(so),blockComment:io(so),docComment:io(so),name:ro,variableName:io(ro),typeName:no,tagName:io(no),propertyName:ho,attributeName:io(ho),className:io(ro),labelName:io(ro),namespace:io(ro),macroName:io(ro),literal:lo,string:oo,docString:io(oo),character:io(oo),attributeValue:io(oo),number:uo,integer:io(uo),"float":io(uo),bool:io(lo),regexp:io(lo),escape:io(lo),color:io(lo),url:io(lo),keyword:co,self:io(co),"null":io(co),atom:io(co),unit:io(co),modifier:io(co),operatorKeyword:io(co),controlKeyword:io(co),definitionKeyword:io(co),moduleKeyword:io(co),operator:po,derefOperator:io(po),arithmeticOperator:io(po),logicOperator:io(po),bitwiseOperator:io(po),compareOperator:io(po),updateOperator:io(po),definitionOperator:io(po),typeOperator:io(po),controlOperator:io(po),punctuation:go,separator:io(go),bracket:mo,angleBracket:io(mo),squareBracket:io(mo),paren:io(mo),brace:io(mo),content:fo,heading:ao,heading1:io(ao),heading2:io(ao),heading3:io(ao),heading4:io(ao),heading5:io(ao),heading6:io(ao),contentSeparator:io(fo),list:io(fo),quote:io(fo),emphasis:io(fo),strong:io(fo),link:io(fo),monospace:io(fo),strikethrough:io(fo),inserted:io(),deleted:io(),changed:io(),invalid:io(),meta:wo,documentMeta:io(wo),annotation:io(wo),processingInstruction:io(wo),definition:Ul.defineModifier("definition"),constant:Ul.defineModifier("constant"),"function":Ul.defineModifier("function"),standard:Ul.defineModifier("standard"),local:Ul.defineModifier("local"),special:Ul.defineModifier("special")});for(_t231 in bo){_e208=bo[_t231];_e208 instanceof Ul&&(_e208.name=_t231);}Zl([{tag:bo.link,"class":"tok-link"},{tag:bo.heading,"class":"tok-heading"},{tag:bo.emphasis,"class":"tok-emphasis"},{tag:bo.strong,"class":"tok-strong"},{tag:bo.keyword,"class":"tok-keyword"},{tag:bo.atom,"class":"tok-atom"},{tag:bo.bool,"class":"tok-bool"},{tag:bo.url,"class":"tok-url"},{tag:bo.labelName,"class":"tok-labelName"},{tag:bo.inserted,"class":"tok-inserted"},{tag:bo.deleted,"class":"tok-deleted"},{tag:bo.literal,"class":"tok-literal"},{tag:bo.string,"class":"tok-string"},{tag:bo.number,"class":"tok-number"},{tag:[bo.regexp,bo.escape,bo.special(bo.string)],"class":"tok-string2"},{tag:bo.variableName,"class":"tok-variableName"},{tag:bo.local(bo.variableName),"class":"tok-variableName tok-local"},{tag:bo.definition(bo.variableName),"class":"tok-variableName tok-definition"},{tag:bo.special(bo.variableName),"class":"tok-variableName2"},{tag:bo.definition(bo.propertyName),"class":"tok-propertyName tok-definition"},{tag:bo.typeName,"class":"tok-typeName"},{tag:bo.namespace,"class":"tok-namespace"},{tag:bo.className,"class":"tok-className"},{tag:bo.macroName,"class":"tok-macroName"},{tag:bo.propertyName,"class":"tok-propertyName"},{tag:bo.operator,"class":"tok-operator"},{tag:bo.comment,"class":"tok-comment"},{tag:bo.meta,"class":"tok-meta"},{tag:bo.invalid,"class":"tok-invalid"},{tag:bo.punctuation,"class":"tok-punctuation"}]);ko=new il();_export("ah",yo=new il());xo=/*#__PURE__*/function(){function xo(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var s=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";_classCallCheck(this,xo);this.data=t,this.name=s,Rt.prototype.hasOwnProperty("tree")||Object.defineProperty(Rt.prototype,"tree",{get:function get(){return Co(this);}}),this.parser=e,this.extension=[Lo.of(this),Rt.languageData.of(function(t,e,i){var s=So(t,e,i),r=s.type.prop(ko);if(!r)return[];var n=t.facet(r),h=s.type.prop(yo);if(h){var _r129=s.resolve(e-s.from,i);var _iterator173=_createForOfIteratorHelper(h),_step173;try{for(_iterator173.s();!(_step173=_iterator173.n()).done;){var _e209=_step173.value;if(_e209.test(_r129,t)){var _i168=t.facet(_e209.facet);return"replace"==_e209.type?_i168:_i168.concat(n);}}}catch(err){_iterator173.e(err);}finally{_iterator173.f();}}return n;})].concat(i);}return _createClass(xo,[{key:"isActiveAt",value:function isActiveAt(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;return So(t,e,i).type.prop(ko)==this.data;}},{key:"findRegions",value:function findRegions(t){var _this75=this;var e=t.facet(Lo);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];var i=[],_s154=function s(t,e){if(t.prop(ko)==_this75.data)return void i.push({from:e,to:e+t.length});var r=t.prop(il.mounted);if(r){if(r.tree.prop(ko)==_this75.data){if(r.overlay){var _iterator174=_createForOfIteratorHelper(r.overlay),_step174;try{for(_iterator174.s();!(_step174=_iterator174.n()).done;){var _t232=_step174.value;i.push({from:_t232.from+e,to:_t232.to+e});}}catch(err){_iterator174.e(err);}finally{_iterator174.f();}}else i.push({from:e,to:e+t.length});return;}if(r.overlay){var _t233=i.length;if(_s154(r.tree,r.overlay[0].from+e),i.length>_t233)return;}}for(var _i169=0;_i169<t.children.length;_i169++){var _r130=t.children[_i169];_r130 instanceof fl&&_s154(_r130,t.positions[_i169]+e);}};return _s154(Co(t),0),i;}},{key:"allowsNesting",get:function get(){return!0;}}]);}();xo.setState=bt.define();_export("a9",Oo=/*#__PURE__*/function(_xo){function Oo(t,e,i){var _this76;_classCallCheck(this,Oo);_this76=_callSuper(this,Oo,[t,e,[],i]),_this76.parser=e;return _this76;}_inherits(Oo,_xo);return _createClass(Oo,[{key:"configure",value:function configure(t,e){return new Oo(this.data,this.parser.configure(t),e||this.name);}},{key:"allowsNesting",get:function get(){return this.parser.hasWrappers();}}],[{key:"define",value:function define(t){var e=Mo(t.languageData);return new Oo(e,t.parser.configure({props:[ko.add(function(t){return t.isTop?e:void 0;})]}),t.name);}}]);}(xo));Ao=/*#__PURE__*/function(){function Ao(t){_classCallCheck(this,Ao);this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter();}return _createClass(Ao,[{key:"length",get:function get(){return this.doc.length;}},{key:"syncTo",value:function syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length;}},{key:"chunk",value:function chunk(t){return this.syncTo(t),this.string;}},{key:"lineChunks",get:function get(){return!0;}},{key:"read",value:function read(t,e){var i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i);}}]);}();Do=null;Eo=/*#__PURE__*/function(){function Eo(t,e){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var s=arguments.length>3?arguments[3]:undefined;var r=arguments.length>4?arguments[4]:undefined;var n=arguments.length>5?arguments[5]:undefined;var h=arguments.length>6?arguments[6]:undefined;var l=arguments.length>7?arguments[7]:undefined;_classCallCheck(this,Eo);this.parser=t,this.state=e,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=n,this.skipped=h,this.scheduleOn=l,this.parse=null,this.tempSkipped=[];}return _createClass(Eo,[{key:"startParse",value:function startParse(){return this.parser.startParse(new Ao(this.state.doc),this.fragments);}},{key:"work",value:function work(t,e){var _this77=this;return null!=e&&e>=this.state.doc.length&&(e=void 0),this.tree!=fl.empty&&this.isDone(null!=e?e:this.state.doc.length)?(this.takeTree(),!0):this.withContext(function(){var i;if("number"==typeof t){var _e210=Date.now()+t;t=function t(){return Date.now()>_e210;};}for(_this77.parse||(_this77.parse=_this77.startParse()),null!=e&&(null==_this77.parse.stoppedAt||_this77.parse.stoppedAt>e)&&e<_this77.state.doc.length&&_this77.parse.stopAt(e);;){var _s155=_this77.parse.advance();if(_s155){if(_this77.fragments=_this77.withoutTempSkipped(El.addTree(_s155,_this77.fragments,null!=_this77.parse.stoppedAt)),_this77.treeLen=null!==(i=_this77.parse.stoppedAt)&&void 0!==i?i:_this77.state.doc.length,_this77.tree=_s155,_this77.parse=null,!(_this77.treeLen<(null!=e?e:_this77.state.doc.length)))return!0;_this77.parse=_this77.startParse();}if(t())return!1;}});}},{key:"takeTree",value:function takeTree(){var _this78=this;var t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(function(){for(;!(e=_this78.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(El.addTree(this.tree,this.fragments,!0)),this.parse=null);}},{key:"withContext",value:function withContext(t){var e=Do;Do=this;try{return t();}finally{Do=e;}}},{key:"withoutTempSkipped",value:function withoutTempSkipped(t){for(var _e211;_e211=this.tempSkipped.pop();)t=Ro(t,_e211.from,_e211.to);return t;}},{key:"changes",value:function changes(t,e){var i=this.fragments,s=this.tree,r=this.treeLen,n=this.viewport,h=this.skipped;if(this.takeTree(),!t.empty){var _e212=[];if(t.iterChangedRanges(function(t,i,s,r){return _e212.push({fromA:t,toA:i,fromB:s,toB:r});}),i=El.applyChanges(i,_e212),s=fl.empty,r=0,n={from:t.mapPos(n.from,-1),to:t.mapPos(n.to,1)},this.skipped.length){h=[];var _iterator175=_createForOfIteratorHelper(this.skipped),_step175;try{for(_iterator175.s();!(_step175=_iterator175.n()).done;){var _e213=_step175.value;var _i170=t.mapPos(_e213.from,1),_s156=t.mapPos(_e213.to,-1);_i170<_s156&&h.push({from:_i170,to:_s156});}}catch(err){_iterator175.e(err);}finally{_iterator175.f();}}}return new Eo(this.parser,e,i,s,r,n,h,this.scheduleOn);}},{key:"updateViewport",value:function updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;var e=this.skipped.length;for(var _e214=0;_e214<this.skipped.length;_e214++){var _this$skipped$_e=this.skipped[_e214],_i171=_this$skipped$_e.from,_s157=_this$skipped$_e.to;_i171<t.to&&_s157>t.from&&(this.fragments=Ro(this.fragments,_i171,_s157),this.skipped.splice(_e214--,1));}return!(this.skipped.length>=e)&&(this.reset(),!0);}},{key:"reset",value:function reset(){this.parse&&(this.takeTree(),this.parse=null);}},{key:"skipUntilInView",value:function skipUntilInView(t,e){this.skipped.push({from:t,to:e});}},{key:"isDone",value:function isDone(t){t=Math.min(t,this.state.doc.length);var e=this.fragments;return this.treeLen>=t&&e.length&&0==e[0].from&&e[0].to>=t;}}],[{key:"create",value:function create(t,e,i){return new Eo(t,e,[],fl.empty,0,i,[],null);}},{key:"getSkippingParser",value:function getSkippingParser(t){return new(/*#__PURE__*/function(_Rl){function _class10(){_classCallCheck(this,_class10);return _callSuper(this,_class10,arguments);}_inherits(_class10,_Rl);return _createClass(_class10,[{key:"createParse",value:function createParse(e,i,s){var r=s[0].from,n=s[s.length-1].to;return{parsedPos:r,advance:function advance(){var e=Do;if(e){var _iterator176=_createForOfIteratorHelper(s),_step176;try{for(_iterator176.s();!(_step176=_iterator176.n()).done;){var _t235=_step176.value;e.tempSkipped.push(_t235);}}catch(err){_iterator176.e(err);}finally{_iterator176.f();}t&&(e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t);}return this.parsedPos=n,new fl(nl.none,[],[],n-r);},stoppedAt:null,stopAt:function stopAt(){}};}}]);}(Rl))();}},{key:"get",value:function get(){return Do;}}]);}();To=/*#__PURE__*/function(){function To(t){_classCallCheck(this,To);this.context=t,this.tree=t.tree;}return _createClass(To,[{key:"apply",value:function apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;var e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new To(e);}}],[{key:"init",value:function init(t){var e=Math.min(3e3,t.doc.length),i=Eo.create(t.facet(Lo).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new To(i);}}]);}();xo.state=_.define({create:To.init,update:function update(t,e){var _iterator177=_createForOfIteratorHelper(e.effects),_step177;try{for(_iterator177.s();!(_step177=_iterator177.n()).done;){var _t236=_step177.value;if(_t236.is(xo.setState))return _t236.value;}}catch(err){_iterator177.e(err);}finally{_iterator177.f();}return e.startState.facet(Lo)!=e.state.facet(Lo)?To.init(e.state):t.apply(e);}});Bo=function Bo(t){var e=setTimeout(function(){return t();},500);return function(){return clearTimeout(e);};};"undefined"!=typeof requestIdleCallback&&(Bo=function Bo(t){var e=-1,i=setTimeout(function(){e=requestIdleCallback(t,{timeout:400});},100);return function(){return e<0?clearTimeout(i):cancelIdleCallback(e);};});Io="undefined"!=typeof navigator&&(null===(vo=navigator.scheduling)||void 0===vo?void 0:vo.isInputPending)?function(){return navigator.scheduling.isInputPending();}:null,No=Zi.fromClass(/*#__PURE__*/function(){function _class11(t){_classCallCheck(this,_class11);this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork();}return _createClass(_class11,[{key:"update",value:function update(t){var e=this.view.state.field(xo.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e);}},{key:"scheduleWork",value:function scheduleWork(){if(this.working)return;var t=this.view.state,e=t.field(xo.state);e.tree==e.context.tree&&e.context.isDone(t.doc.length)||(this.working=Bo(this.work));}},{key:"work",value:function work(t){this.working=null;var e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;var _this$view3=this.view,i=_this$view3.state,s=_this$view3.viewport.to,r=i.field(xo.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;var n=Date.now()+Math.min(this.chunkBudget,100,t&&!Io?Math.max(25,t.timeRemaining()-5):1e9),h=r.context.treeLen<s&&i.doc.length>s+1e3,l=r.context.work(function(){return Io&&Io()||Date.now()>n;},s+(h?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:xo.setState.of(new To(r.context))})),this.chunkBudget>0&&(!l||h)&&this.scheduleWork(),this.checkAsyncSchedule(r.context);}},{key:"checkAsyncSchedule",value:function checkAsyncSchedule(t){var _this79=this;t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(function(){return _this79.scheduleWork();})["catch"](function(t){return _i(_this79.view.state,t);}).then(function(){return _this79.workScheduled--;}),t.scheduleOn=null);}},{key:"destroy",value:function destroy(){this.working&&this.working();}},{key:"isWorking",value:function isWorking(){return!!(this.working||this.workScheduled>0);}}]);}(),{eventHandlers:{focus:function focus(){this.scheduleWork();}}}),Lo=q.define({combine:function combine(t){return t.length?t[0]:null;},enables:function enables(t){return[xo.state,No,Qr.contentAttributes.compute([t],function(e){var i=e.facet(t);return i&&i.name?{"data-language":i.name}:{};})];}});_export("ag",jo=/*#__PURE__*/_createClass(function jo(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];_classCallCheck(this,jo);this.language=t,this.support=e,this.extension=[t,e];}));zo=q.define(),_export("h",Ho=q.define({combine:function combine(t){if(!t.length)return" ";var e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(function(t){return t!=e[0];}))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e;}}));_export("I",qo=/*#__PURE__*/function(){function qo(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,qo);this.state=t,this.options=e,this.unit=Po(t);}return _createClass(qo,[{key:"lineAt",value:function lineAt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var i=this.state.doc.lineAt(t),_this$options=this.options,s=_this$options.simulateBreak,r=_this$options.simulateDoubleBreak;return null!=s&&s>=i.from&&s<=i.to?r&&s==t?{text:"",from:t}:(e<0?s<t:s<=t)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i;}},{key:"textAfterPos",value:function textAfterPos(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";var _this$lineAt=this.lineAt(t,e),i=_this$lineAt.text,s=_this$lineAt.from;return i.slice(t-s,Math.min(i.length,t+100-s));}},{key:"column",value:function column(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _this$lineAt2=this.lineAt(t,e),i=_this$lineAt2.text,s=_this$lineAt2.from,r=this.countColumn(i,t-s),n=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return n>-1&&(r+=n-this.countColumn(i,i.search(/\S|$/))),r;}},{key:"countColumn",value:function countColumn(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t.length;return Kt(t,this.state.tabSize,e);}},{key:"lineIndent",value:function lineIndent(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _this$lineAt3=this.lineAt(t,e),i=_this$lineAt3.text,s=_this$lineAt3.from,r=this.options.overrideIndentation;if(r){var _t239=r(s);if(_t239>-1)return _t239;}return this.countColumn(i,i.search(/\S|$/));}},{key:"simulatedBreak",get:function get(){return this.options.simulateBreak||null;}}]);}());_export("aa",Fo=new il());Uo=/*#__PURE__*/function(_qo){function Uo(t,e,i){var _this80;_classCallCheck(this,Uo);_this80=_callSuper(this,Uo,[t.state,t.options]),_this80.base=t,_this80.pos=e,_this80.context=i;return _this80;}_inherits(Uo,_qo);return _createClass(Uo,[{key:"node",get:function get(){return this.context.node;}},{key:"textAfter",get:function get(){return this.textAfterPos(this.pos);}},{key:"baseIndent",get:function get(){return this.baseIndentFor(this.node);}},{key:"baseIndentFor",value:function baseIndentFor(t){var e=this.state.doc.lineAt(t.from);for(;;){var _i173=t.resolve(e.from);for(;_i173.parent&&_i173.parent.from==_i173.from;)_i173=_i173.parent;if(Ko(_i173,t))break;e=this.state.doc.lineAt(_i173.from);}return this.lineIndent(e.from);}},{key:"continue",value:function _continue(){return Vo(this.context.next,this.base,this.pos);}}],[{key:"create",value:function create(t,e,i){return new Uo(t,e,i);}}]);}(qo);_export("ac",Yo=function Yo(t){return t.baseIndent;});tu=q.define(),_export("ae",eu=new il());hu=bt.define({map:nu}),lu=bt.define({map:nu});uu=_.define({create:function create(){return si.none;},update:function update(t,e){t=t.map(e.changes);var _iterator182=_createForOfIteratorHelper(e.effects),_step182;try{var _loop16=function _loop16(){var i=_step182.value;if(i.is(hu)&&!au(t,i.value.from,i.value.to)){var _e$state$facet=e.state.facet(mu),_s165=_e$state$facet.preparePlaceholder,_r134=_s165?si.replace({widget:new ku(_s165(e.state,i.value))}):vu;t=t.update({add:[_r134.range(i.value.from,i.value.to)]});}else i.is(lu)&&(t=t.update({filter:function filter(t,e){return i.value.from!=t||i.value.to!=e;},filterFrom:i.value.from,filterTo:i.value.to}));};for(_iterator182.s();!(_step182=_iterator182.n()).done;){_loop16();}}catch(err){_iterator182.e(err);}finally{_iterator182.f();}if(e.selection){var _i176=!1,_s164=e.selection.main.head;t.between(_s164,_s164,function(t,e){t<_s164&&e>_s164&&(_i176=!0);}),_i176&&(t=t.update({filterFrom:_s164,filterTo:_s164,filter:function filter(t,e){return e<=_s164||t>=_s164;}}));}return t;},provide:function provide(t){return Qr.decorations.from(t);},toJSON:function toJSON(t,e){var i=[];return t.between(0,e.doc.length,function(t,e){i.push(t,e);}),i;},fromJSON:function fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");var e=[];for(var _i177=0;_i177<t.length;){var _s166=t[_i177++],_r135=t[_i177++];if("number"!=typeof _s166||"number"!=typeof _r135)throw new RangeError("Invalid JSON for fold state");e.push(vu.range(_s166,_r135));}return si.set(e,!0);}});_export("L",pu=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:function run(t){var _iterator183=_createForOfIteratorHelper(ou(t)),_step183;try{for(_iterator183.s();!(_step183=_iterator183.n()).done;){var _e219=_step183.value;var _i178=ru(t.state,_e219.from,_e219.to);if(_i178)return t.dispatch({effects:cu(t.state,[hu.of(_i178),du(t,_i178)])}),!0;}}catch(err){_iterator183.e(err);}finally{_iterator183.f();}return!1;}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:function run(t){if(!t.state.field(uu,!1))return!1;var e=[];var _iterator184=_createForOfIteratorHelper(ou(t)),_step184;try{for(_iterator184.s();!(_step184=_iterator184.n()).done;){var _i179=_step184.value;var _s167=fu(t.state,_i179.from,_i179.to);_s167&&e.push(lu.of(_s167),du(t,_s167,!1));}}catch(err){_iterator184.e(err);}finally{_iterator184.f();}return e.length&&t.dispatch({effects:e}),e.length>0;}},{key:"Ctrl-Alt-[",run:function run(t){var e=t.state,i=[];for(var _s168=0;_s168<e.doc.length;){var _r136=t.lineBlockAt(_s168),_n100=ru(e,_r136.from,_r136.to);_n100&&i.push(hu.of(_n100)),_s168=(_n100?t.lineBlockAt(_n100.to):_r136).to+1;}return i.length&&t.dispatch({effects:cu(t.state,i)}),!!i.length;}},{key:"Ctrl-Alt-]",run:function run(t){var e=t.state.field(uu,!1);if(!e||!e.size)return!1;var i=[];return e.between(0,t.state.doc.length,function(t,e){i.push(lu.of({from:t,to:e}));}),t.dispatch({effects:i}),!0;}}]),gu={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},mu=q.define({combine:function combine(t){return Tt(t,gu);}});vu=si.replace({widget:new(/*#__PURE__*/function(_ei7){function _class12(){_classCallCheck(this,_class12);return _callSuper(this,_class12,arguments);}_inherits(_class12,_ei7);return _createClass(_class12,[{key:"toDOM",value:function toDOM(t){return bu(t,null);}}]);}(ei))()});ku=/*#__PURE__*/function(_ei8){function ku(t){var _this81;_classCallCheck(this,ku);_this81=_callSuper(this,ku),_this81.value=t;return _this81;}_inherits(ku,_ei8);return _createClass(ku,[{key:"eq",value:function eq(t){return this.value==t.value;}},{key:"toDOM",value:function toDOM(t){return bu(t,this.value);}}]);}(ei);Mu={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:function foldingChanged(){return!1;}};yu=/*#__PURE__*/function(_Dh3){function yu(t,e){var _this82;_classCallCheck(this,yu);_this82=_callSuper(this,yu),_this82.config=t,_this82.open=e;return _this82;}_inherits(yu,_Dh3);return _createClass(yu,[{key:"eq",value:function eq(t){return this.config==t.config&&this.open==t.open;}},{key:"toDOM",value:function toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);var e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e;}}]);}(Dh);Su=Qr.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});_export("H",Ou=/*#__PURE__*/function(){function Ou(t,e){_classCallCheck(this,Ou);var i;function s(t){var e=Zt.newName();return(i||(i=Object.create(null)))["."+e]=t,e;}this.specs=t;var r="string"==typeof e.all?e.all:e.all?s(e.all):void 0,n=e.scope;this.scope=n instanceof xo?function(t){return t.prop(ko)==n.data;}:n?function(t){return t==n;}:void 0,this.style=Zl(t.map(function(t){return{tag:t.tag,"class":t["class"]||s(Object.assign({},t,{tag:null}))};}),{all:r}).style,this.module=i?new Zt(i):null,this.themeType=e.themeType;}return _createClass(Ou,null,[{key:"define",value:function define(t,e){return new Ou(t,e||{});}}]);}());Cu=q.define(),Au=q.define({combine:function combine(t){return t.length?[t[0]]:null;}});Ru=/*#__PURE__*/function(){function Ru(t){_classCallCheck(this,Ru);this.markCache=Object.create(null),this.tree=Co(t.state),this.decorations=this.buildDeco(t,Du(t.state)),this.decoratedTo=t.viewport.to;}return _createClass(Ru,[{key:"update",value:function update(t){var e=Co(t.state),i=Du(t.state),s=i!=Du(t.startState),r=t.view.viewport,n=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!s&&e.type==this.tree.type&&n>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=n):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to);}},{key:"buildDeco",value:function buildDeco(t,e){var _this83=this;if(!e||!this.tree.length)return si.none;var i=new zt();var _iterator186=_createForOfIteratorHelper(t.visibleRanges),_step186;try{for(_iterator186.s();!(_step186=_iterator186.n()).done;){var _step186$value=_step186.value,_s169=_step186$value.from,_r138=_step186$value.to;to(this.tree,e,function(t,e,s){i.add(t,e,_this83.markCache[s]||(_this83.markCache[s]=si.mark({"class":s})));},_s169,_r138);}}catch(err){_iterator186.e(err);}finally{_iterator186.f();}return i.finish();}}]);}();Tu=et.high(Zi.fromClass(Ru,{decorations:function decorations(t){return t.decorations;}})),_export("ap",Bu=Ou.define([{tag:bo.meta,color:"#404740"},{tag:bo.link,textDecoration:"underline"},{tag:bo.heading,textDecoration:"underline",fontWeight:"bold"},{tag:bo.emphasis,fontStyle:"italic"},{tag:bo.strong,fontWeight:"bold"},{tag:bo.strikethrough,textDecoration:"line-through"},{tag:bo.keyword,color:"#708"},{tag:[bo.atom,bo.bool,bo.url,bo.contentSeparator,bo.labelName],color:"#219"},{tag:[bo.literal,bo.inserted],color:"#164"},{tag:[bo.string,bo.deleted],color:"#a11"},{tag:[bo.regexp,bo.escape,bo.special(bo.string)],color:"#e40"},{tag:bo.definition(bo.variableName),color:"#00f"},{tag:bo.local(bo.variableName),color:"#30a"},{tag:[bo.typeName,bo.namespace],color:"#085"},{tag:bo.className,color:"#167"},{tag:[bo.special(bo.variableName),bo.macroName],color:"#256"},{tag:bo.definition(bo.propertyName),color:"#00c"},{tag:bo.comment,color:"#940"},{tag:bo.invalid,color:"#f00"}])),Iu=Qr.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Nu="()[]{}",Lu=q.define({combine:function combine(t){return Tt(t,{afterCursor:!0,brackets:Nu,maxScanDistance:1e4,renderMatch:Hu});}}),ju=si.mark({"class":"cm-matchingBracket"}),zu=si.mark({"class":"cm-nonmatchingBracket"});Pu=_.define({create:function create(){return si.none;},update:function update(t,e){if(!e.docChanged&&!e.selection)return t;var i=[],s=e.state.facet(Lu);var _iterator187=_createForOfIteratorHelper(e.state.selection.ranges),_step187;try{for(_iterator187.s();!(_step187=_iterator187.n()).done;){var _t244=_step187.value;if(!_t244.empty)continue;var _r139=Ju(e.state,_t244.head,-1,s)||_t244.head>0&&Ju(e.state,_t244.head-1,1,s)||s.afterCursor&&(Ju(e.state,_t244.head,1,s)||_t244.head<e.state.doc.length&&Ju(e.state,_t244.head+1,-1,s));_r139&&(i=i.concat(s.renderMatch(_r139,e.state)));}}catch(err){_iterator187.e(err);}finally{_iterator187.f();}return si.set(i,!0);},provide:function provide(t){return Qr.decorations.from(t);}}),$u=[Pu,Iu];_export("al",qu=new il());Uu=Object.create(null),Ku=[nl.none],_u=[],Xu=Object.create(null),Yu=Object.create(null);for(_i180=0,_arr2=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];_i180<_arr2.length;_i180++){_arr2$_i=_slicedToArray(_arr2[_i180],2),_t249=_arr2$_i[0],_e222=_arr2$_i[1];Yu[_t249]=Zu(Uu,_e222);}gi.RTL,gi.LTR;}};});
2
+ //# sourceMappingURL=index-f6944844.cjs.js.map