integral 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (761) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +105 -0
  4. data/Rakefile +22 -0
  5. data/app/assets/images/integral/backend/data-unavailable.png +0 -0
  6. data/app/assets/images/integral/backend/logo.png +0 -0
  7. data/app/assets/images/integral/defaults/no_image_available.jpg +0 -0
  8. data/app/assets/images/integral/defaults/user_avatar.jpg +0 -0
  9. data/app/assets/images/integral/image-not-set.png +0 -0
  10. data/app/assets/images/integral/posts-hero-banner.jpg +0 -0
  11. data/app/assets/javascripts/ckeditor/loader.js.erb +6 -0
  12. data/app/assets/javascripts/ckeditor/my_config.js.erb +154 -0
  13. data/app/assets/javascripts/ckeditor/my_contents.sass +22 -0
  14. data/app/assets/javascripts/ckeditor/my_javascript.js +12 -0
  15. data/app/assets/javascripts/ckeditor/my_styles.js +5 -0
  16. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/az.js +8 -0
  17. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/bg.js +8 -0
  18. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ca.js +8 -0
  19. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/cs.js +8 -0
  20. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/da.js +8 -0
  21. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/de-ch.js +8 -0
  22. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/de.js +8 -0
  23. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/el.js +8 -0
  24. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/en-au.js +8 -0
  25. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/en.js +8 -0
  26. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/eo.js +8 -0
  27. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/es-mx.js +8 -0
  28. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/es.js +8 -0
  29. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/eu.js +8 -0
  30. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/fr.js +8 -0
  31. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/gl.js +8 -0
  32. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/hr.js +8 -0
  33. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/hu.js +8 -0
  34. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/it.js +8 -0
  35. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ja.js +8 -0
  36. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/km.js +8 -0
  37. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ko.js +8 -0
  38. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ku.js +8 -0
  39. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/mk.js +8 -0
  40. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/nb.js +8 -0
  41. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/nl.js +8 -0
  42. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/oc.js +8 -0
  43. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pl.js +8 -0
  44. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pt-br.js +8 -0
  45. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/pt.js +8 -0
  46. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ro.js +8 -0
  47. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ru.js +8 -0
  48. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sk.js +8 -0
  49. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sq.js +8 -0
  50. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/sv.js +8 -0
  51. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/tr.js +8 -0
  52. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/ug.js +8 -0
  53. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/uk.js +8 -0
  54. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/vi.js +8 -0
  55. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/zh-cn.js +8 -0
  56. data/app/assets/javascripts/ckeditor/plugins/autoembed/lang/zh.js +8 -0
  57. data/app/assets/javascripts/ckeditor/plugins/autoembed/plugin.js +218 -0
  58. data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +232 -0
  59. data/app/assets/javascripts/ckeditor/plugins/autogrow/samples/autogrow.html +102 -0
  60. data/app/assets/javascripts/ckeditor/plugins/autolink/plugin.js +69 -0
  61. data/app/assets/javascripts/ckeditor/plugins/codemirror/css/codemirror.min.css +1 -0
  62. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/autocomplete.png +0 -0
  63. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/autoformat.png +0 -0
  64. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/commentselectedrange.png +0 -0
  65. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/searchcode.png +0 -0
  66. data/app/assets/javascripts/ckeditor/plugins/codemirror/icons/uncommentselectedrange.png +0 -0
  67. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/beautify.min.js +2 -0
  68. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.min.js +2 -0
  69. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.addons.search.min.js +1 -0
  70. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.min.js +6 -0
  71. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcode.min.js +1 -0
  72. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.bbcodemixed.min.js +1 -0
  73. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.htmlmixed.min.js +2 -0
  74. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.javascript.min.js +1 -0
  75. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.php.min.js +3 -0
  76. data/app/assets/javascripts/ckeditor/plugins/codemirror/js/codemirror.mode.twig.min.js +1 -0
  77. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/af.js +12 -0
  78. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ar.js +12 -0
  79. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bg.js +12 -0
  80. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bn.js +12 -0
  81. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/bs.js +12 -0
  82. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ca.js +12 -0
  83. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/cs.js +12 -0
  84. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/cy.js +12 -0
  85. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/da.js +12 -0
  86. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/de.js +12 -0
  87. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/el.js +12 -0
  88. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-au.js +12 -0
  89. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-ca.js +12 -0
  90. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en-gb.js +12 -0
  91. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/en.js +12 -0
  92. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/eo.js +12 -0
  93. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/es.js +12 -0
  94. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/et.js +12 -0
  95. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/eu.js +12 -0
  96. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fa.js +12 -0
  97. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fi.js +12 -0
  98. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fo.js +12 -0
  99. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fr-ca.js +12 -0
  100. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/fr.js +12 -0
  101. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/gl.js +12 -0
  102. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/gu.js +12 -0
  103. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/he.js +12 -0
  104. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hi.js +12 -0
  105. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hr.js +12 -0
  106. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/hu.js +12 -0
  107. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/is.js +12 -0
  108. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/it.js +12 -0
  109. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ja.js +12 -0
  110. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ka.js +12 -0
  111. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/km.js +12 -0
  112. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ko.js +12 -0
  113. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ku.js +12 -0
  114. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/lt.js +12 -0
  115. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/lv.js +12 -0
  116. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/mk.js +12 -0
  117. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/mn.js +12 -0
  118. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ms.js +12 -0
  119. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/nb.js +12 -0
  120. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/nl.js +12 -0
  121. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/no.js +12 -0
  122. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pl.js +12 -0
  123. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pt-br.js +12 -0
  124. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/pt.js +12 -0
  125. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ro.js +12 -0
  126. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ru.js +12 -0
  127. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sk.js +12 -0
  128. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sl.js +12 -0
  129. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sr-latn.js +12 -0
  130. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sr.js +12 -0
  131. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/sv.js +12 -0
  132. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/th.js +12 -0
  133. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/tr.js +12 -0
  134. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/ug.js +12 -0
  135. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/uk.js +12 -0
  136. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/vi.js +12 -0
  137. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/zh-cn.js +12 -0
  138. data/app/assets/javascripts/ckeditor/plugins/codemirror/lang/zh.js +12 -0
  139. data/app/assets/javascripts/ckeditor/plugins/codemirror/plugin.js +1311 -0
  140. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-day.css +41 -0
  141. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/3024-night.css +39 -0
  142. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/abcdef.css +32 -0
  143. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance-mobile.css +5 -0
  144. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ambiance.css +74 -0
  145. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-dark.css +38 -0
  146. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/base16-light.css +38 -0
  147. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/bespin.css +34 -0
  148. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/blackboard.css +32 -0
  149. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/cobalt.css +25 -0
  150. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/colorforth.css +33 -0
  151. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/dracula.css +40 -0
  152. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-dark.css +35 -0
  153. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/duotone-light.css +36 -0
  154. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/eclipse.css +23 -0
  155. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/elegant.css +13 -0
  156. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/erlang-dark.css +34 -0
  157. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/hopscotch.css +34 -0
  158. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/icecoder.css +43 -0
  159. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/isotope.css +34 -0
  160. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/lesser-dark.css +47 -0
  161. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/liquibyte.css +95 -0
  162. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/material.css +53 -0
  163. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/mbo.css +37 -0
  164. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/mdn-like.css +46 -0
  165. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/midnight.css +43 -0
  166. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/monokai.css +36 -0
  167. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/neat.css +12 -0
  168. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/neo.css +43 -0
  169. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/night.css +27 -0
  170. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/panda-syntax.css +85 -0
  171. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-dark.css +38 -0
  172. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/paraiso-light.css +38 -0
  173. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/pastel-on-dark.css +52 -0
  174. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/railscasts.css +34 -0
  175. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/rubyblue.css +25 -0
  176. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/seti.css +44 -0
  177. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/solarized.css +168 -0
  178. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/the-matrix.css +30 -0
  179. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-bright.css +35 -0
  180. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/tomorrow-night-eighties.css +38 -0
  181. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/ttcn.css +64 -0
  182. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/twilight.css +32 -0
  183. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/vibrant-ink.css +34 -0
  184. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-dark.css +53 -0
  185. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/xq-light.css +43 -0
  186. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/yeti.css +44 -0
  187. data/app/assets/javascripts/ckeditor/plugins/codemirror/theme/zenburn.css +37 -0
  188. data/app/assets/javascripts/ckeditor/plugins/embed/icons/embed.png +0 -0
  189. data/app/assets/javascripts/ckeditor/plugins/embed/icons/hidpi/embed.png +0 -0
  190. data/app/assets/javascripts/ckeditor/plugins/embed/plugin.js +105 -0
  191. data/app/assets/javascripts/ckeditor/plugins/embedbase/dialogs/embedbase.js +99 -0
  192. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/az.js +15 -0
  193. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/bg.js +15 -0
  194. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ca.js +15 -0
  195. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/cs.js +15 -0
  196. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/da.js +15 -0
  197. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/de-ch.js +15 -0
  198. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/de.js +15 -0
  199. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/en-au.js +15 -0
  200. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/en.js +15 -0
  201. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/eo.js +15 -0
  202. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/es-mx.js +15 -0
  203. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/es.js +15 -0
  204. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/eu.js +15 -0
  205. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/fr.js +15 -0
  206. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/gl.js +15 -0
  207. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/hr.js +15 -0
  208. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/hu.js +15 -0
  209. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/id.js +15 -0
  210. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/it.js +15 -0
  211. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ja.js +15 -0
  212. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ko.js +15 -0
  213. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ku.js +15 -0
  214. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/nb.js +15 -0
  215. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/nl.js +15 -0
  216. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/oc.js +15 -0
  217. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pl.js +15 -0
  218. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pt-br.js +15 -0
  219. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/pt.js +15 -0
  220. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ro.js +15 -0
  221. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ru.js +15 -0
  222. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sk.js +15 -0
  223. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sq.js +15 -0
  224. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/sv.js +15 -0
  225. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/tr.js +15 -0
  226. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/ug.js +15 -0
  227. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/uk.js +15 -0
  228. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/zh-cn.js +15 -0
  229. data/app/assets/javascripts/ckeditor/plugins/embedbase/lang/zh.js +15 -0
  230. data/app/assets/javascripts/ckeditor/plugins/embedbase/plugin.js +652 -0
  231. data/app/assets/javascripts/ckeditor/plugins/embedjs/plugin.js +110 -0
  232. data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/dnd.html +172 -0
  233. data/app/assets/javascripts/ckeditor/plugins/lineutils/dev/magicfinger.html +285 -0
  234. data/app/assets/javascripts/ckeditor/plugins/lineutils/plugin.js +1018 -0
  235. data/app/assets/javascripts/ckeditor/plugins/notification/lang/cs.js +7 -0
  236. data/app/assets/javascripts/ckeditor/plugins/notification/lang/da.js +7 -0
  237. data/app/assets/javascripts/ckeditor/plugins/notification/lang/de-ch.js +7 -0
  238. data/app/assets/javascripts/ckeditor/plugins/notification/lang/de.js +7 -0
  239. data/app/assets/javascripts/ckeditor/plugins/notification/lang/en.js +7 -0
  240. data/app/assets/javascripts/ckeditor/plugins/notification/lang/eo.js +7 -0
  241. data/app/assets/javascripts/ckeditor/plugins/notification/lang/eu.js +7 -0
  242. data/app/assets/javascripts/ckeditor/plugins/notification/lang/fr.js +7 -0
  243. data/app/assets/javascripts/ckeditor/plugins/notification/lang/gl.js +7 -0
  244. data/app/assets/javascripts/ckeditor/plugins/notification/lang/id.js +7 -0
  245. data/app/assets/javascripts/ckeditor/plugins/notification/lang/it.js +7 -0
  246. data/app/assets/javascripts/ckeditor/plugins/notification/lang/km.js +7 -0
  247. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ko.js +7 -0
  248. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ku.js +7 -0
  249. data/app/assets/javascripts/ckeditor/plugins/notification/lang/nb.js +7 -0
  250. data/app/assets/javascripts/ckeditor/plugins/notification/lang/nl.js +7 -0
  251. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pl.js +7 -0
  252. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt-br.js +7 -0
  253. data/app/assets/javascripts/ckeditor/plugins/notification/lang/pt.js +7 -0
  254. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ru.js +7 -0
  255. data/app/assets/javascripts/ckeditor/plugins/notification/lang/sv.js +7 -0
  256. data/app/assets/javascripts/ckeditor/plugins/notification/lang/tr.js +7 -0
  257. data/app/assets/javascripts/ckeditor/plugins/notification/lang/ug.js +7 -0
  258. data/app/assets/javascripts/ckeditor/plugins/notification/lang/uk.js +7 -0
  259. data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh-cn.js +7 -0
  260. data/app/assets/javascripts/ckeditor/plugins/notification/lang/zh.js +7 -0
  261. data/app/assets/javascripts/ckeditor/plugins/notification/plugin.js +923 -0
  262. data/app/assets/javascripts/ckeditor/plugins/notificationaggregator/plugin.js +548 -0
  263. data/app/assets/javascripts/ckeditor/plugins/placeholder/dev/placeholder.html +60 -0
  264. data/app/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +49 -0
  265. data/app/assets/javascripts/ckeditor/plugins/placeholder/icons/hidpi/placeholder.png +0 -0
  266. data/app/assets/javascripts/ckeditor/plugins/placeholder/icons/placeholder.png +0 -0
  267. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/af.js +12 -0
  268. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ar.js +12 -0
  269. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/az.js +12 -0
  270. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/bg.js +12 -0
  271. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ca.js +12 -0
  272. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cs.js +12 -0
  273. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/cy.js +12 -0
  274. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/da.js +12 -0
  275. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de-ch.js +12 -0
  276. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/de.js +12 -0
  277. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/el.js +12 -0
  278. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en-gb.js +12 -0
  279. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +12 -0
  280. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eo.js +12 -0
  281. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es-mx.js +12 -0
  282. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/es.js +12 -0
  283. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/et.js +12 -0
  284. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/eu.js +12 -0
  285. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fa.js +12 -0
  286. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fi.js +12 -0
  287. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr-ca.js +12 -0
  288. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/fr.js +12 -0
  289. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/gl.js +12 -0
  290. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +12 -0
  291. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hr.js +12 -0
  292. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/hu.js +12 -0
  293. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/id.js +12 -0
  294. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/it.js +12 -0
  295. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ja.js +12 -0
  296. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/km.js +12 -0
  297. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ko.js +12 -0
  298. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ku.js +12 -0
  299. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/lv.js +12 -0
  300. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nb.js +12 -0
  301. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/nl.js +12 -0
  302. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/no.js +12 -0
  303. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/oc.js +12 -0
  304. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pl.js +12 -0
  305. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt-br.js +12 -0
  306. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/pt.js +12 -0
  307. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ru.js +12 -0
  308. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/si.js +12 -0
  309. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sk.js +12 -0
  310. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sl.js +12 -0
  311. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sq.js +12 -0
  312. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/sv.js +12 -0
  313. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/th.js +12 -0
  314. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tr.js +12 -0
  315. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/tt.js +12 -0
  316. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/ug.js +12 -0
  317. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/uk.js +12 -0
  318. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/vi.js +12 -0
  319. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh-cn.js +12 -0
  320. data/app/assets/javascripts/ckeditor/plugins/placeholder/lang/zh.js +12 -0
  321. data/app/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +99 -0
  322. data/app/assets/javascripts/ckeditor/plugins/placeholder/samples/placeholder.html +75 -0
  323. data/app/assets/javascripts/ckeditor/plugins/strinsert/README.md +76 -0
  324. data/app/assets/javascripts/ckeditor/plugins/strinsert/bower.json +16 -0
  325. data/app/assets/javascripts/ckeditor/plugins/strinsert/plugin.js +107 -0
  326. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/contents.css +23 -0
  327. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/sample.jpg +0 -0
  328. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/contents.css +36 -0
  329. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js +51 -0
  330. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/icons/simplebox.png +0 -0
  331. data/app/assets/javascripts/ckeditor/plugins/widget/dev/assets/simplebox/plugin.js +114 -0
  332. data/app/assets/javascripts/ckeditor/plugins/widget/dev/console.js +131 -0
  333. data/app/assets/javascripts/ckeditor/plugins/widget/dev/nestedwidgets.html +134 -0
  334. data/app/assets/javascripts/ckeditor/plugins/widget/dev/widgetstyles.html +144 -0
  335. data/app/assets/javascripts/ckeditor/plugins/widget/images/handle.png +0 -0
  336. data/app/assets/javascripts/ckeditor/plugins/widget/lang/af.js +8 -0
  337. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ar.js +8 -0
  338. data/app/assets/javascripts/ckeditor/plugins/widget/lang/az.js +8 -0
  339. data/app/assets/javascripts/ckeditor/plugins/widget/lang/bg.js +8 -0
  340. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ca.js +8 -0
  341. data/app/assets/javascripts/ckeditor/plugins/widget/lang/cs.js +8 -0
  342. data/app/assets/javascripts/ckeditor/plugins/widget/lang/cy.js +8 -0
  343. data/app/assets/javascripts/ckeditor/plugins/widget/lang/da.js +8 -0
  344. data/app/assets/javascripts/ckeditor/plugins/widget/lang/de-ch.js +8 -0
  345. data/app/assets/javascripts/ckeditor/plugins/widget/lang/de.js +8 -0
  346. data/app/assets/javascripts/ckeditor/plugins/widget/lang/el.js +8 -0
  347. data/app/assets/javascripts/ckeditor/plugins/widget/lang/en-gb.js +8 -0
  348. data/app/assets/javascripts/ckeditor/plugins/widget/lang/en.js +8 -0
  349. data/app/assets/javascripts/ckeditor/plugins/widget/lang/eo.js +8 -0
  350. data/app/assets/javascripts/ckeditor/plugins/widget/lang/es-mx.js +8 -0
  351. data/app/assets/javascripts/ckeditor/plugins/widget/lang/es.js +8 -0
  352. data/app/assets/javascripts/ckeditor/plugins/widget/lang/eu.js +8 -0
  353. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fa.js +8 -0
  354. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fi.js +8 -0
  355. data/app/assets/javascripts/ckeditor/plugins/widget/lang/fr.js +8 -0
  356. data/app/assets/javascripts/ckeditor/plugins/widget/lang/gl.js +8 -0
  357. data/app/assets/javascripts/ckeditor/plugins/widget/lang/he.js +8 -0
  358. data/app/assets/javascripts/ckeditor/plugins/widget/lang/hr.js +8 -0
  359. data/app/assets/javascripts/ckeditor/plugins/widget/lang/hu.js +8 -0
  360. data/app/assets/javascripts/ckeditor/plugins/widget/lang/id.js +8 -0
  361. data/app/assets/javascripts/ckeditor/plugins/widget/lang/it.js +8 -0
  362. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ja.js +8 -0
  363. data/app/assets/javascripts/ckeditor/plugins/widget/lang/km.js +8 -0
  364. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ko.js +8 -0
  365. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ku.js +8 -0
  366. data/app/assets/javascripts/ckeditor/plugins/widget/lang/lv.js +8 -0
  367. data/app/assets/javascripts/ckeditor/plugins/widget/lang/nb.js +8 -0
  368. data/app/assets/javascripts/ckeditor/plugins/widget/lang/nl.js +8 -0
  369. data/app/assets/javascripts/ckeditor/plugins/widget/lang/no.js +8 -0
  370. data/app/assets/javascripts/ckeditor/plugins/widget/lang/oc.js +8 -0
  371. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pl.js +8 -0
  372. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt-br.js +8 -0
  373. data/app/assets/javascripts/ckeditor/plugins/widget/lang/pt.js +8 -0
  374. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ru.js +8 -0
  375. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sk.js +8 -0
  376. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sl.js +8 -0
  377. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sq.js +8 -0
  378. data/app/assets/javascripts/ckeditor/plugins/widget/lang/sv.js +8 -0
  379. data/app/assets/javascripts/ckeditor/plugins/widget/lang/tr.js +8 -0
  380. data/app/assets/javascripts/ckeditor/plugins/widget/lang/tt.js +8 -0
  381. data/app/assets/javascripts/ckeditor/plugins/widget/lang/ug.js +8 -0
  382. data/app/assets/javascripts/ckeditor/plugins/widget/lang/uk.js +8 -0
  383. data/app/assets/javascripts/ckeditor/plugins/widget/lang/vi.js +8 -0
  384. data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh-cn.js +8 -0
  385. data/app/assets/javascripts/ckeditor/plugins/widget/lang/zh.js +8 -0
  386. data/app/assets/javascripts/ckeditor/plugins/widget/plugin.js +4147 -0
  387. data/app/assets/javascripts/ckeditor/plugins/widgetselection/plugin.js +366 -0
  388. data/app/assets/javascripts/ckeditor/plugins/wordcount/css/wordcount.css +3 -0
  389. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ar.js +11 -0
  390. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ca.js +13 -0
  391. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/da.js +13 -0
  392. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/de.js +13 -0
  393. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/el.js +13 -0
  394. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/en.js +13 -0
  395. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/es.js +13 -0
  396. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fi.js +14 -0
  397. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/fr.js +11 -0
  398. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/he.js +13 -0
  399. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/hr.js +13 -0
  400. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/it.js +14 -0
  401. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ja.js +14 -0
  402. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/jp.js +13 -0
  403. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/nl.js +13 -0
  404. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/no.js +10 -0
  405. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pl.js +13 -0
  406. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt-br.js +13 -0
  407. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/pt.js +9 -0
  408. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/ru.js +13 -0
  409. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/sv.js +13 -0
  410. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/tr.js +13 -0
  411. data/app/assets/javascripts/ckeditor/plugins/wordcount/lang/zh-cn.js +13 -0
  412. data/app/assets/javascripts/ckeditor/plugins/wordcount/plugin.js +407 -0
  413. data/app/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcount.html +61 -0
  414. data/app/assets/javascripts/ckeditor/plugins/wordcount/samples/wordcountWithMaxCount.html +110 -0
  415. data/app/assets/javascripts/integral/backend.js +268 -0
  416. data/app/assets/javascripts/integral/backend/extensions.js +1 -0
  417. data/app/assets/javascripts/integral/backend/support/Chart.bundle.min.js +10 -0
  418. data/app/assets/javascripts/integral/frontend.js +60 -0
  419. data/app/assets/javascripts/integral/support/character_counter.js +67 -0
  420. data/app/assets/javascripts/integral/support/chart_manager.coffee +145 -0
  421. data/app/assets/javascripts/integral/support/click_to_copy.coffee +28 -0
  422. data/app/assets/javascripts/integral/support/confirm_modal.coffee +58 -0
  423. data/app/assets/javascripts/integral/support/date_picker.coffee +83 -0
  424. data/app/assets/javascripts/integral/support/date_picker/picker.date.js +1435 -0
  425. data/app/assets/javascripts/integral/support/date_picker/picker.js +1132 -0
  426. data/app/assets/javascripts/integral/support/gallery.coffee +82 -0
  427. data/app/assets/javascripts/integral/support/google_analytics.coffee +23 -0
  428. data/app/assets/javascripts/integral/support/grid.coffee +92 -0
  429. data/app/assets/javascripts/integral/support/header_anchors.coffee +22 -0
  430. data/app/assets/javascripts/integral/support/image-preview.coffee +14 -0
  431. data/app/assets/javascripts/integral/support/image_selector.coffee +43 -0
  432. data/app/assets/javascripts/integral/support/image_uploader.coffee +59 -0
  433. data/app/assets/javascripts/integral/support/lib/html.sortable.js +691 -0
  434. data/app/assets/javascripts/integral/support/lib/jquery.are-you-sure.js +231 -0
  435. data/app/assets/javascripts/integral/support/lib/jquery_form.js +11 -0
  436. data/app/assets/javascripts/integral/support/lib/js.cookie.js +165 -0
  437. data/app/assets/javascripts/integral/support/lib/materialize-tags.js +758 -0
  438. data/app/assets/javascripts/integral/support/lib/materialize.clockpicker.js +699 -0
  439. data/app/assets/javascripts/integral/support/lib/swiper.js +7719 -0
  440. data/app/assets/javascripts/integral/support/lib/typeahead.js +2451 -0
  441. data/app/assets/javascripts/integral/support/lib/underscore.js +6 -0
  442. data/app/assets/javascripts/integral/support/list.coffee +71 -0
  443. data/app/assets/javascripts/integral/support/list_item.coffee +249 -0
  444. data/app/assets/javascripts/integral/support/notification_manager.coffee +17 -0
  445. data/app/assets/javascripts/integral/support/record_selector.coffee +161 -0
  446. data/app/assets/javascripts/integral/support/remote_form.coffee +87 -0
  447. data/app/assets/javascripts/integral/support/responsive_swiper.coffee +26 -0
  448. data/app/assets/javascripts/integral/support/scroll_to_top.coffee +17 -0
  449. data/app/assets/javascripts/integral/support/slug_generator.coffee +49 -0
  450. data/app/assets/stylesheets/errors.css +1834 -0
  451. data/app/assets/stylesheets/integral/backend.sass +66 -0
  452. data/app/assets/stylesheets/integral/backend/_foundation_settings.scss +867 -0
  453. data/app/assets/stylesheets/integral/backend/dashboard-layout.scss +491 -0
  454. data/app/assets/stylesheets/integral/backend/devise.sass +40 -0
  455. data/app/assets/stylesheets/integral/backend/foundation_and_overrides.scss +56 -0
  456. data/app/assets/stylesheets/integral/backend/materialize-tags.sass +70 -0
  457. data/app/assets/stylesheets/integral/backend/notifications.sass +43 -0
  458. data/app/assets/stylesheets/integral/backend/overrides.sass +1 -0
  459. data/app/assets/stylesheets/integral/backend/shared.sass +770 -0
  460. data/app/assets/stylesheets/integral/emails.scss +19 -0
  461. data/app/assets/stylesheets/integral/emails/colors.sass +3 -0
  462. data/app/assets/stylesheets/integral/frontend.sass +26 -0
  463. data/app/assets/stylesheets/integral/frontend/_foundation_settings.scss +863 -0
  464. data/app/assets/stylesheets/integral/frontend/blog.sass +263 -0
  465. data/app/assets/stylesheets/integral/frontend/demo.sass +158 -0
  466. data/app/assets/stylesheets/integral/frontend/foundation_and_overrides.scss +56 -0
  467. data/app/assets/stylesheets/integral/frontend/layout.sass +66 -0
  468. data/app/assets/stylesheets/integral/frontend/overrides.sass +1 -0
  469. data/app/assets/stylesheets/integral/frontend/share_modal.sass +25 -0
  470. data/app/assets/stylesheets/integral/frontend/shared.sass +73 -0
  471. data/app/assets/stylesheets/integral/support/date-picker.scss +16 -0
  472. data/app/assets/stylesheets/integral/support/date_picker/_default.date.scss +452 -0
  473. data/app/assets/stylesheets/integral/support/date_picker/_default.scss +201 -0
  474. data/app/assets/stylesheets/integral/support/date_picker/_default.time.scss +125 -0
  475. data/app/assets/stylesheets/integral/support/date_picker/materialize_clockpicker.sass +220 -0
  476. data/app/assets/stylesheets/integral/support/gallery.sass +54 -0
  477. data/app/assets/stylesheets/integral/support/media-query-indicator.sass +25 -0
  478. data/app/assets/stylesheets/integral/support/mixins.sass +29 -0
  479. data/app/assets/stylesheets/integral/support/scroll-to-top.sass +19 -0
  480. data/app/assets/stylesheets/integral/support/swiper.css +618 -0
  481. data/app/assets/stylesheets/integral/wysiwyg.sass +13 -0
  482. data/app/controllers/integral/application_controller.rb +130 -0
  483. data/app/controllers/integral/backend/activities_controller.rb +55 -0
  484. data/app/controllers/integral/backend/base_controller.rb +123 -0
  485. data/app/controllers/integral/backend/images_controller.rb +120 -0
  486. data/app/controllers/integral/backend/lists_controller.rb +138 -0
  487. data/app/controllers/integral/backend/pages_controller.rb +142 -0
  488. data/app/controllers/integral/backend/posts_controller.rb +132 -0
  489. data/app/controllers/integral/backend/settings_controller.rb +53 -0
  490. data/app/controllers/integral/backend/static_pages_controller.rb +10 -0
  491. data/app/controllers/integral/backend/users_controller.rb +130 -0
  492. data/app/controllers/integral/blog_controller.rb +19 -0
  493. data/app/controllers/integral/contact_controller.rb +36 -0
  494. data/app/controllers/integral/pages_controller.rb +45 -0
  495. data/app/controllers/integral/posts_controller.rb +71 -0
  496. data/app/controllers/integral/tags_controller.rb +38 -0
  497. data/app/decorators/integral/image_decorator.rb +16 -0
  498. data/app/decorators/integral/list_decorator.rb +21 -0
  499. data/app/decorators/integral/page_decorator.rb +26 -0
  500. data/app/decorators/integral/post_decorator.rb +63 -0
  501. data/app/decorators/integral/user_decorator.rb +21 -0
  502. data/app/decorators/integral/version_decorator.rb +57 -0
  503. data/app/helpers/integral/application_helper.rb +52 -0
  504. data/app/helpers/integral/backend/base_helper.rb +72 -0
  505. data/app/helpers/integral/blog_helper.rb +26 -0
  506. data/app/helpers/integral/gallery_helper.rb +36 -0
  507. data/app/helpers/integral/mail_helper.rb +16 -0
  508. data/app/helpers/integral/social_helper.rb +123 -0
  509. data/app/helpers/integral/support_helper.rb +60 -0
  510. data/app/jobs/integral/application_job.rb +10 -0
  511. data/app/jobs/integral/newsletter_signup_job.rb +28 -0
  512. data/app/mailers/integral/contact_mailer.rb +56 -0
  513. data/app/models/ckeditor/asset.rb +8 -0
  514. data/app/models/ckeditor/attachment_file.rb +9 -0
  515. data/app/models/ckeditor/picture.rb +21 -0
  516. data/app/models/integral/application_record.rb +6 -0
  517. data/app/models/integral/basic.rb +11 -0
  518. data/app/models/integral/enquiry.rb +46 -0
  519. data/app/models/integral/image.rb +67 -0
  520. data/app/models/integral/image_version.rb +8 -0
  521. data/app/models/integral/link.rb +11 -0
  522. data/app/models/integral/list.rb +69 -0
  523. data/app/models/integral/list_item.rb +89 -0
  524. data/app/models/integral/list_version.rb +8 -0
  525. data/app/models/integral/newsletter_signup.rb +22 -0
  526. data/app/models/integral/object.rb +30 -0
  527. data/app/models/integral/page.rb +153 -0
  528. data/app/models/integral/page_version.rb +8 -0
  529. data/app/models/integral/post.rb +149 -0
  530. data/app/models/integral/post_version.rb +8 -0
  531. data/app/models/integral/post_viewing.rb +19 -0
  532. data/app/models/integral/role.rb +14 -0
  533. data/app/models/integral/role_assignment.rb +7 -0
  534. data/app/models/integral/settings.rb +5 -0
  535. data/app/models/integral/user.rb +59 -0
  536. data/app/models/integral/user_version.rb +8 -0
  537. data/app/models/integral/version.rb +31 -0
  538. data/app/models/paper_trail/version.rb +9 -0
  539. data/app/policies/integral/base_policy.rb +50 -0
  540. data/app/policies/integral/image_policy.rb +14 -0
  541. data/app/policies/integral/list_policy.rb +9 -0
  542. data/app/policies/integral/page_policy.rb +45 -0
  543. data/app/policies/integral/post_policy.rb +9 -0
  544. data/app/policies/integral/settings_policy.rb +17 -0
  545. data/app/policies/integral/user_policy.rb +17 -0
  546. data/app/policies/integral/version_policy.rb +19 -0
  547. data/app/uploaders/ckeditor_attachment_file_uploader.rb +34 -0
  548. data/app/uploaders/ckeditor_picture_uploader.rb +55 -0
  549. data/app/uploaders/integral/avatar_uploader.rb +9 -0
  550. data/app/uploaders/integral/image_uploader.rb +114 -0
  551. data/app/views/devise/invitations/edit.haml +17 -0
  552. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  553. data/app/views/devise/mailer/invitation_instructions.html.erb +13 -0
  554. data/app/views/devise/mailer/invitation_instructions.text.erb +12 -0
  555. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  556. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  557. data/app/views/devise/passwords/edit.haml +17 -0
  558. data/app/views/devise/passwords/new.haml +12 -0
  559. data/app/views/devise/sessions/new.haml +18 -0
  560. data/app/views/devise/shared/_links.html.erb +25 -0
  561. data/app/views/integral/backend/activities/_grid.haml +23 -0
  562. data/app/views/integral/backend/activities/index.haml +15 -0
  563. data/app/views/integral/backend/activities/shared/_grid.haml +20 -0
  564. data/app/views/integral/backend/activities/shared/_listing.haml +14 -0
  565. data/app/views/integral/backend/activities/shared/_log.haml +56 -0
  566. data/app/views/integral/backend/activities/show.haml +18 -0
  567. data/app/views/integral/backend/images/_create_modal.haml +17 -0
  568. data/app/views/integral/backend/images/_form.haml +41 -0
  569. data/app/views/integral/backend/images/_grid.haml +16 -0
  570. data/app/views/integral/backend/images/edit.haml +3 -0
  571. data/app/views/integral/backend/images/index.haml +18 -0
  572. data/app/views/integral/backend/images/new.haml +1 -0
  573. data/app/views/integral/backend/lists/_child_fields.haml +26 -0
  574. data/app/views/integral/backend/lists/_form.haml +25 -0
  575. data/app/views/integral/backend/lists/_grid.haml +16 -0
  576. data/app/views/integral/backend/lists/_item_container.haml +26 -0
  577. data/app/views/integral/backend/lists/_item_modal.haml +46 -0
  578. data/app/views/integral/backend/lists/_list_item_fields.haml +26 -0
  579. data/app/views/integral/backend/lists/_manager.haml +14 -0
  580. data/app/views/integral/backend/lists/edit.haml +2 -0
  581. data/app/views/integral/backend/lists/index.haml +18 -0
  582. data/app/views/integral/backend/lists/new.haml +1 -0
  583. data/app/views/integral/backend/lists/show.haml +26 -0
  584. data/app/views/integral/backend/pages/_form.haml +52 -0
  585. data/app/views/integral/backend/pages/_grid.haml +21 -0
  586. data/app/views/integral/backend/pages/activities.haml +2 -0
  587. data/app/views/integral/backend/pages/activity.haml +1 -0
  588. data/app/views/integral/backend/pages/edit.html.haml +15 -0
  589. data/app/views/integral/backend/pages/index.haml +22 -0
  590. data/app/views/integral/backend/pages/new.haml +2 -0
  591. data/app/views/integral/backend/posts/_form.haml +57 -0
  592. data/app/views/integral/backend/posts/_grid.haml +25 -0
  593. data/app/views/integral/backend/posts/activities.haml +3 -0
  594. data/app/views/integral/backend/posts/activity.haml +1 -0
  595. data/app/views/integral/backend/posts/edit.haml +16 -0
  596. data/app/views/integral/backend/posts/index.haml +20 -0
  597. data/app/views/integral/backend/posts/new.haml +2 -0
  598. data/app/views/integral/backend/settings/_input.haml +4 -0
  599. data/app/views/integral/backend/settings/_section.haml +11 -0
  600. data/app/views/integral/backend/settings/index.haml +10 -0
  601. data/app/views/integral/backend/settings/sections/_general.haml +12 -0
  602. data/app/views/integral/backend/settings/sections/_lists.haml +4 -0
  603. data/app/views/integral/backend/settings/sections/_seo.haml +8 -0
  604. data/app/views/integral/backend/settings/sections/_social.haml +16 -0
  605. data/app/views/integral/backend/shared/_breadcrumbs.haml +9 -0
  606. data/app/views/integral/backend/shared/_empty_grid.haml +7 -0
  607. data/app/views/integral/backend/shared/_grid.haml +18 -0
  608. data/app/views/integral/backend/shared/_image_preview.haml +23 -0
  609. data/app/views/integral/backend/shared/_image_selector.haml +4 -0
  610. data/app/views/integral/backend/shared/_pagination.haml +1 -0
  611. data/app/views/integral/backend/shared/cards/_at_a_glance.haml +5 -0
  612. data/app/views/integral/backend/shared/cards/_welcome.haml +29 -0
  613. data/app/views/integral/backend/shared/graphs/_donut.haml +5 -0
  614. data/app/views/integral/backend/shared/graphs/_line.haml +5 -0
  615. data/app/views/integral/backend/shared/graphs/_no_data_available.haml +2 -0
  616. data/app/views/integral/backend/shared/record_selector/_collection.haml +13 -0
  617. data/app/views/integral/backend/shared/record_selector/_modal.haml +42 -0
  618. data/app/views/integral/backend/shared/record_selector/_record.haml +6 -0
  619. data/app/views/integral/backend/static_pages/_card.haml +24 -0
  620. data/app/views/integral/backend/static_pages/dashboard.haml +20 -0
  621. data/app/views/integral/backend/users/_form.haml +58 -0
  622. data/app/views/integral/backend/users/_grid.haml +19 -0
  623. data/app/views/integral/backend/users/edit.haml +3 -0
  624. data/app/views/integral/backend/users/index.haml +18 -0
  625. data/app/views/integral/backend/users/new.haml +2 -0
  626. data/app/views/integral/backend/users/show.haml +36 -0
  627. data/app/views/integral/contact_mailer/auto_reply.html.haml +16 -0
  628. data/app/views/integral/contact_mailer/auto_reply.text.erb +15 -0
  629. data/app/views/integral/contact_mailer/forward_enquiry.haml +12 -0
  630. data/app/views/integral/contact_mailer/forward_enquiry.text.erb +9 -0
  631. data/app/views/integral/pages/_demo.haml +188 -0
  632. data/app/views/integral/pages/templates/default.haml +6 -0
  633. data/app/views/integral/posts/_item.haml +16 -0
  634. data/app/views/integral/posts/index.haml +6 -0
  635. data/app/views/integral/posts/templates/default.haml +38 -0
  636. data/app/views/integral/shared/_blog_layout.haml +15 -0
  637. data/app/views/integral/shared/_blog_sidebar.haml +49 -0
  638. data/app/views/integral/shared/_breadcrumbs.haml +5 -0
  639. data/app/views/integral/shared/_media_query_indicator.haml +2 -0
  640. data/app/views/integral/shared/_scroll_to_top.haml +3 -0
  641. data/app/views/integral/shared/_share_modal.haml +20 -0
  642. data/app/views/integral/shared/_social_list_items.haml +41 -0
  643. data/app/views/integral/shared/_swiper_layout.haml +20 -0
  644. data/app/views/integral/shared/gallery/_placeholder.haml +7 -0
  645. data/app/views/integral/shared/gallery/_slide.haml +5 -0
  646. data/app/views/integral/shared/gallery/_thumb_slide.haml +2 -0
  647. data/app/views/integral/shared/gallery/gallery.haml +7 -0
  648. data/app/views/integral/tags/index.haml +6 -0
  649. data/app/views/integral/tags/show.haml +6 -0
  650. data/app/views/layouts/error.haml +12 -0
  651. data/app/views/layouts/integral/backend.html.haml +93 -0
  652. data/app/views/layouts/integral/backend/_create_dropdown.haml +30 -0
  653. data/app/views/layouts/integral/backend/_head.html.haml +17 -0
  654. data/app/views/layouts/integral/backend/_main_menu_items.haml +91 -0
  655. data/app/views/layouts/integral/frontend.html.haml +36 -0
  656. data/app/views/layouts/integral/frontend/_admin_bar.haml +25 -0
  657. data/app/views/layouts/integral/frontend/_footer.haml +23 -0
  658. data/app/views/layouts/integral/frontend/_header.haml +12 -0
  659. data/app/views/layouts/integral/login.haml +8 -0
  660. data/app/views/layouts/integral/mailer.html.inky-haml +17 -0
  661. data/app/views/layouts/integral/mailer/_footer.html.inky-haml +11 -0
  662. data/app/views/layouts/integral/mailer/_header.html.inky-haml +7 -0
  663. data/config/initializers/acts_as_taggable_on.rb +6 -0
  664. data/config/initializers/ckeditor.rb +51 -0
  665. data/config/initializers/client_side_validations.rb +20 -0
  666. data/config/initializers/compression.rb +46 -0
  667. data/config/initializers/devise.rb +308 -0
  668. data/config/initializers/extensions/ckeditor.rb +31 -0
  669. data/config/initializers/friendly_id.rb +88 -0
  670. data/config/initializers/gaffe.rb +3 -0
  671. data/config/initializers/simple_form.rb +169 -0
  672. data/config/initializers/simple_form/length_component.rb +36 -0
  673. data/config/locales/devise.en.yml +60 -0
  674. data/config/locales/devise_invitable.en.yml +31 -0
  675. data/config/locales/en.yml +477 -0
  676. data/config/locales/simple_form.en.yml +31 -0
  677. data/config/routes.rb +3 -0
  678. data/db/migrate/20160129021044_devise_create_integral_users.rb +42 -0
  679. data/db/migrate/20160130051535_add_name_and_avatar_to_users.rb +6 -0
  680. data/db/migrate/20160201003936_add_roles.rb +13 -0
  681. data/db/migrate/20160302071241_create_integral_images.rb +13 -0
  682. data/db/migrate/20160311092506_create_ckeditor_assets.rb +26 -0
  683. data/db/migrate/20160318004136_create_integral_pages.rb +12 -0
  684. data/db/migrate/20160513033619_create_integral_posts.rb +12 -0
  685. data/db/migrate/20160514063048_add_slug_column_to_post.rb +6 -0
  686. data/db/migrate/20160516084702_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +31 -0
  687. data/db/migrate/20160516084703_add_missing_unique_indices.acts_as_taggable_on_engine.rb +20 -0
  688. data/db/migrate/20160516084704_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
  689. data/db/migrate/20160516084705_add_missing_taggable_index.acts_as_taggable_on_engine.rb +10 -0
  690. data/db/migrate/20160516084706_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +10 -0
  691. data/db/migrate/20160519005736_add_image_to_posts.rb +5 -0
  692. data/db/migrate/20160519053329_create_friendly_id_slugs.rb +15 -0
  693. data/db/migrate/20160610021858_add_view_count_to_posts.rb +5 -0
  694. data/db/migrate/20160613035508_add_drafting_to_posts.rb +6 -0
  695. data/db/migrate/20160628050006_create_integral_post_viewings.rb +10 -0
  696. data/db/migrate/20160718011218_add_locale_to_integral_users.rb +5 -0
  697. data/db/migrate/20160722100113_devise_invitable_add_to_integral_users.rb +23 -0
  698. data/db/migrate/20160809115906_add_drafting_to_pages.rb +5 -0
  699. data/db/migrate/20160909124940_add_deleted_at_to_objects.rb +15 -0
  700. data/db/migrate/20161014175823_create_lists.rb +31 -0
  701. data/db/migrate/20161102094859_create_settings.rb +18 -0
  702. data/db/migrate/20170215012231_add_templates_to_pages.rb +5 -0
  703. data/db/migrate/20170425091312_add_image_processing_fields.rb +7 -0
  704. data/db/migrate/20170516033523_add_timestamps_to_lists.rb +6 -0
  705. data/db/migrate/20170608131624_add_file_size_to_images.rb +5 -0
  706. data/db/migrate/20170801182434_add_parent_to_pages.rb +5 -0
  707. data/db/migrate/20170922201940_add_image_id_to_posts.rb +9 -0
  708. data/db/migrate/20171008193414_create_post_versions.rb +21 -0
  709. data/db/migrate/20171030215146_create_page_versions.rb +20 -0
  710. data/db/migrate/20171030215154_create_user_versions.rb +20 -0
  711. data/db/migrate/20171030215202_create_list_versions.rb +20 -0
  712. data/db/migrate/20171123155010_create_integral_enquiries.rb +13 -0
  713. data/db/migrate/20171127141132_add_deleted_at_to_lists.rb +6 -0
  714. data/db/migrate/20171230213848_add_image_to_pages.rb +6 -0
  715. data/db/migrate/20180202010010_add_lock_version_to_integral_objects.rb +9 -0
  716. data/db/migrate/20180202010020_create_image_versions.rb +20 -0
  717. data/db/migrate/20180207174914_add_fields_to_lists.rb +7 -0
  718. data/db/migrate/20180223232512_create_integral_newsletter_signups.rb +11 -0
  719. data/db/migrate/20180306204912_add_admin_to_integral_users.rb +5 -0
  720. data/db/migrate/20180326224500_add_processed_to_enquiries_and_newsletters.rb +6 -0
  721. data/db/migrate/20180509101917_add_context_to_enquiries.rb +6 -0
  722. data/db/migrate/20180920030236_update_posts_and_pages_null.rb +6 -0
  723. data/db/migrate/20181011234446_add_preview_image_to_posts.rb +6 -0
  724. data/db/seeds.rb +53 -0
  725. data/lib/generators/integral/install_generator.rb +19 -0
  726. data/lib/generators/templates/app.yml +24 -0
  727. data/lib/generators/templates/carrierwave.rb +35 -0
  728. data/lib/generators/templates/carrierwave_backgrounder.rb +11 -0
  729. data/lib/generators/templates/integral.rb +129 -0
  730. data/lib/generators/templates/sitemap.rb +41 -0
  731. data/lib/integral.rb +155 -0
  732. data/lib/integral/acts_as_listable.rb +45 -0
  733. data/lib/integral/button_link_renderer.rb +54 -0
  734. data/lib/integral/chart_renderer/base.rb +80 -0
  735. data/lib/integral/chart_renderer/donut.rb +21 -0
  736. data/lib/integral/chart_renderer/line.rb +24 -0
  737. data/lib/integral/content_renderer.rb +78 -0
  738. data/lib/integral/engine.rb +124 -0
  739. data/lib/integral/foundation_builder.rb +33 -0
  740. data/lib/integral/google_tag_manager.rb +33 -0
  741. data/lib/integral/grids/activities_grid.rb +37 -0
  742. data/lib/integral/grids/images_grid.rb +21 -0
  743. data/lib/integral/grids/lists_grid.rb +21 -0
  744. data/lib/integral/grids/pages_grid.rb +27 -0
  745. data/lib/integral/grids/posts_grid.rb +32 -0
  746. data/lib/integral/grids/users_grid.rb +22 -0
  747. data/lib/integral/list_item_renderer.rb +204 -0
  748. data/lib/integral/list_renderer.rb +91 -0
  749. data/lib/integral/middleware/page_router.rb +84 -0
  750. data/lib/integral/partial_list_item_renderer.rb +40 -0
  751. data/lib/integral/router.rb +106 -0
  752. data/lib/integral/slack_bot.rb +45 -0
  753. data/lib/integral/swiper_list_renderer.rb +30 -0
  754. data/lib/integral/version.rb +5 -0
  755. data/lib/integral/widgets/recent_posts.rb +41 -0
  756. data/lib/integral/widgets/swiper_list.rb +40 -0
  757. data/lib/tasks/integral_tasks.rake +57 -0
  758. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  759. data/spec/factories.rb +114 -0
  760. data/spec/support/image.jpg +0 -0
  761. metadata +1734 -0
@@ -0,0 +1,232 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or http://ckeditor.com/license
4
+ */
5
+
6
+ /**
7
+ * @fileOverview The Auto Grow plugin.
8
+ */
9
+
10
+ 'use strict';
11
+
12
+ ( function() {
13
+ CKEDITOR.plugins.add( 'autogrow', {
14
+ init: function( editor ) {
15
+ // This feature is available only for themed ui instance.
16
+ if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE )
17
+ return;
18
+
19
+ editor.on( 'instanceReady', function() {
20
+ // Simply set auto height with div wysiwyg.
21
+ if ( editor.editable().isInline() )
22
+ editor.ui.space( 'contents' ).setStyle( 'height', 'auto' );
23
+ // For classic (`iframe`-based) wysiwyg we need to resize the editor.
24
+ else
25
+ initIframeAutogrow( editor );
26
+ } );
27
+ }
28
+ } );
29
+
30
+ function initIframeAutogrow( editor ) {
31
+ var lastHeight,
32
+ doc,
33
+ markerContainer,
34
+ scrollable,
35
+ marker,
36
+ configBottomSpace = editor.config.autoGrow_bottomSpace || 0,
37
+ configMinHeight = editor.config.autoGrow_minHeight !== undefined ? editor.config.autoGrow_minHeight : 200,
38
+ configMaxHeight = editor.config.autoGrow_maxHeight || Infinity,
39
+ maxHeightIsUnlimited = !editor.config.autoGrow_maxHeight;
40
+
41
+ editor.addCommand( 'autogrow', {
42
+ exec: resizeEditor,
43
+ modes: { wysiwyg: 1 },
44
+ readOnly: 1,
45
+ canUndo: false,
46
+ editorFocus: false
47
+ } );
48
+
49
+ var eventsList = { contentDom: 1, key: 1, selectionChange: 1, insertElement: 1, mode: 1 };
50
+ for ( var eventName in eventsList ) {
51
+ editor.on( eventName, function( evt ) {
52
+ // Some time is required for insertHtml, and it gives other events better performance as well.
53
+ if ( evt.editor.mode == 'wysiwyg' ) {
54
+ setTimeout( function() {
55
+ if ( isNotResizable() ) {
56
+ lastHeight = null;
57
+ return;
58
+ }
59
+
60
+ resizeEditor();
61
+
62
+ // Second pass to make correction upon the first resize, e.g. scrollbar.
63
+ // If height is unlimited vertical scrollbar was removed in the first
64
+ // resizeEditor() call, so we don't need the second pass.
65
+ if ( !maxHeightIsUnlimited )
66
+ resizeEditor();
67
+ }, 100 );
68
+ }
69
+ } );
70
+ }
71
+
72
+ // Coordinate with the "maximize" plugin. (#9311)
73
+ editor.on( 'afterCommandExec', function( evt ) {
74
+ if ( evt.data.name == 'maximize' && evt.editor.mode == 'wysiwyg' ) {
75
+ if ( evt.data.command.state == CKEDITOR.TRISTATE_ON )
76
+ scrollable.removeStyle( 'overflow-y' );
77
+ else
78
+ resizeEditor();
79
+ }
80
+ } );
81
+
82
+ editor.on( 'contentDom', refreshCache );
83
+
84
+ refreshCache();
85
+
86
+ if ( editor.config.autoGrow_onStartup && editor.editable().isVisible() ) {
87
+ editor.execCommand( 'autogrow' );
88
+ }
89
+
90
+ function refreshCache() {
91
+ doc = editor.document;
92
+ markerContainer = doc[ CKEDITOR.env.ie ? 'getBody' : 'getDocumentElement' ]();
93
+
94
+ // Quirks mode overflows body, standards overflows document element.
95
+ scrollable = CKEDITOR.env.quirks ? doc.getBody() : doc.getDocumentElement();
96
+
97
+ // Reset scrollable body height and min-height css values.
98
+ // While set by outside code it may break resizing. (#14620)
99
+ var body = CKEDITOR.env.quirks ? scrollable : scrollable.findOne( 'body' );
100
+ if ( body ) {
101
+ body.setStyle( 'height', 'auto' );
102
+ body.setStyle( 'min-height', CKEDITOR.env.safari ? '0%' : 'auto' ); // Safari does not support 'min-height: auto'.
103
+ }
104
+
105
+ marker = CKEDITOR.dom.element.createFromHtml(
106
+ '<span style="margin:0;padding:0;border:0;clear:both;width:1px;height:1px;display:block;">' +
107
+ ( CKEDITOR.env.webkit ? '&nbsp;' : '' ) +
108
+ '</span>',
109
+ doc );
110
+ }
111
+
112
+ function isNotResizable() {
113
+ var maximizeCommand = editor.getCommand( 'maximize' );
114
+
115
+ return (
116
+ !editor.window ||
117
+ // Disable autogrow when the editor is maximized. (#6339)
118
+ maximizeCommand && maximizeCommand.state == CKEDITOR.TRISTATE_ON
119
+ );
120
+ }
121
+
122
+ // Actual content height, figured out by appending check the last element's document position.
123
+ function contentHeight() {
124
+ // Append a temporary marker element.
125
+ markerContainer.append( marker );
126
+ var height = marker.getDocumentPosition( doc ).y + marker.$.offsetHeight;
127
+ marker.remove();
128
+
129
+ return height;
130
+ }
131
+
132
+ function resizeEditor() {
133
+ // Hide scroll because we won't need it at all.
134
+ // Thanks to that we'll need only one resizeEditor() call per change.
135
+ if ( maxHeightIsUnlimited )
136
+ scrollable.setStyle( 'overflow-y', 'hidden' );
137
+
138
+ var currentHeight = editor.window.getViewPaneSize().height,
139
+ newHeight = contentHeight();
140
+
141
+ // Additional space specified by user.
142
+ newHeight += configBottomSpace;
143
+ newHeight = Math.max( newHeight, configMinHeight );
144
+ newHeight = Math.min( newHeight, configMaxHeight );
145
+
146
+ // #10196 Do not resize editor if new height is equal
147
+ // to the one set by previous resizeEditor() call.
148
+ if ( newHeight != currentHeight && lastHeight != newHeight ) {
149
+ newHeight = editor.fire( 'autoGrow', { currentHeight: currentHeight, newHeight: newHeight } ).newHeight;
150
+ editor.resize( editor.container.getStyle( 'width' ), newHeight, true );
151
+ lastHeight = newHeight;
152
+ }
153
+
154
+ if ( !maxHeightIsUnlimited ) {
155
+ if ( newHeight < configMaxHeight && scrollable.$.scrollHeight > scrollable.$.clientHeight )
156
+ scrollable.setStyle( 'overflow-y', 'hidden' );
157
+ else
158
+ scrollable.removeStyle( 'overflow-y' );
159
+ }
160
+ }
161
+ }
162
+ } )();
163
+
164
+ /**
165
+ * The minimum height that the editor can assume when adjusting to content by using the Auto Grow
166
+ * feature. This option accepts a value in pixels, without the unit (for example: `300`).
167
+ *
168
+ * Read more in the [documentation](#!/guide/dev_autogrow)
169
+ * and see the [SDK sample](http://sdk.ckeditor.com/samples/autogrow.html).
170
+ *
171
+ * config.autoGrow_minHeight = 300;
172
+ *
173
+ * @since 3.4
174
+ * @cfg {Number} [autoGrow_minHeight=200]
175
+ * @member CKEDITOR.config
176
+ */
177
+
178
+ /**
179
+ * The maximum height that the editor can assume when adjusting to content by using the Auto Grow
180
+ * feature. This option accepts a value in pixels, without the unit (for example: `600`).
181
+ * Zero (`0`) means that the maximum height is not limited and the editor will expand infinitely.
182
+ *
183
+ * Read more in the [documentation](#!/guide/dev_autogrow)
184
+ * and see the [SDK sample](http://sdk.ckeditor.com/samples/autogrow.html).
185
+ *
186
+ * config.autoGrow_maxHeight = 400;
187
+ *
188
+ * @since 3.4
189
+ * @cfg {Number} [autoGrow_maxHeight=0]
190
+ * @member CKEDITOR.config
191
+ */
192
+
193
+ /**
194
+ * Whether automatic editor height adjustment brought by the Auto Grow feature should happen on
195
+ * editor creation.
196
+ *
197
+ * Read more in the [documentation](#!/guide/dev_autogrow)
198
+ * and see the [SDK sample](http://sdk.ckeditor.com/samples/autogrow.html).
199
+ *
200
+ * config.autoGrow_onStartup = true;
201
+ *
202
+ * @since 3.6.2
203
+ * @cfg {Boolean} [autoGrow_onStartup=false]
204
+ * @member CKEDITOR.config
205
+ */
206
+
207
+ /**
208
+ * Extra vertical space to be added between the content and the editor bottom bar when adjusting
209
+ * editor height to content by using the Auto Grow feature. This option accepts a value in pixels,
210
+ * without the unit (for example: `50`).
211
+ *
212
+ * Read more in the [documentation](#!/guide/dev_autogrow)
213
+ * and see the [SDK sample](http://sdk.ckeditor.com/samples/autogrow.html).
214
+ *
215
+ * config.autoGrow_bottomSpace = 50;
216
+ *
217
+ * @since 3.6.2
218
+ * @cfg {Number} [autoGrow_bottomSpace=0]
219
+ * @member CKEDITOR.config
220
+ */
221
+
222
+ /**
223
+ * Fired when the Auto Grow plugin is about to change the size of the editor.
224
+ *
225
+ * @event autogrow
226
+ * @member CKEDITOR.editor
227
+ * @param {CKEDITOR.editor} editor This editor instance.
228
+ * @param data
229
+ * @param {Number} data.currentHeight The current editor height (before resizing).
230
+ * @param {Number} data.newHeight The new editor height (after resizing). It can be changed
231
+ * to achieve a different height value to be used instead.
232
+ */
@@ -0,0 +1,102 @@
1
+ <!DOCTYPE html>
2
+ <!--
3
+ Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
4
+ For licensing, see LICENSE.md or http://ckeditor.com/license
5
+ -->
6
+ <html>
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <title>AutoGrow Plugin &mdash; CKEditor Sample</title>
10
+ <script src="../../../ckeditor.js"></script>
11
+ <link rel="stylesheet" href="../../../samples/old/sample.css">
12
+ <meta name="ckeditor-sample-name" content="AutoGrow plugin">
13
+ <meta name="ckeditor-sample-group" content="Plugins">
14
+ <meta name="ckeditor-sample-description" content="Using the AutoGrow plugin in order to make the editor grow to fit the size of its content.">
15
+ </head>
16
+ <body>
17
+ <h1 class="samples">
18
+ <a href="../../../samples/old/index.html">CKEditor Samples</a> &raquo; Using AutoGrow Plugin
19
+ </h1>
20
+ <div class="warning deprecated">
21
+ This sample is not maintained anymore. Check out its <a href="http://sdk.ckeditor.com/samples/autogrow.html">brand new version in CKEditor SDK</a>.
22
+ </div>
23
+ <div class="description">
24
+ <p>
25
+ This sample shows how to configure CKEditor instances to use the
26
+ <strong>AutoGrow</strong> (<code>autogrow</code>) plugin that lets the editor window expand
27
+ and shrink depending on the amount and size of content entered in the editing area.
28
+ </p>
29
+ <p>
30
+ In its default implementation the <strong>AutoGrow feature</strong> can expand the
31
+ CKEditor window infinitely in order to avoid introducing scrollbars to the editing area.
32
+ </p>
33
+ <p>
34
+ It is also possible to set a maximum height for the editor window. Once CKEditor
35
+ editing area reaches the value in pixels specified in the
36
+ <code><a class="samples" href="http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-autoGrow_maxHeight">autoGrow_maxHeight</a></code>
37
+ configuration setting, scrollbars will be added and the editor window will no longer expand.
38
+ </p>
39
+ <p>
40
+ To add a CKEditor instance using the <code>autogrow</code> plugin and its
41
+ <code>autoGrow_maxHeight</code> attribute, insert the following JavaScript call to your code:
42
+ </p>
43
+ <pre class="samples">
44
+ CKEDITOR.replace( '<em>textarea_id</em>', {
45
+ <strong>extraPlugins: 'autogrow',</strong>
46
+ autoGrow_maxHeight: 800,
47
+
48
+ // Remove the Resize plugin as it does not make sense to use it in conjunction with the AutoGrow plugin.
49
+ removePlugins: 'resize'
50
+ });</pre>
51
+ <p>
52
+ Note that <code><em>textarea_id</em></code> in the code above is the <code>id</code> attribute of
53
+ the <code>&lt;textarea&gt;</code> element to be replaced with CKEditor. The maximum height should
54
+ be given in pixels.
55
+ </p>
56
+ </div>
57
+ <form action="../../../samples/sample_posteddata.php" method="post">
58
+ <p>
59
+ <label for="editor1">
60
+ CKEditor using the <code>autogrow</code> plugin with its default configuration:
61
+ </label>
62
+ <textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
63
+ <script>
64
+
65
+ CKEDITOR.replace( 'editor1', {
66
+ extraPlugins: 'autogrow',
67
+ removePlugins: 'resize'
68
+ });
69
+
70
+ </script>
71
+ </p>
72
+ <p>
73
+ <label for="editor2">
74
+ CKEditor using the <code>autogrow</code> plugin with maximum height set to 400 pixels:
75
+ </label>
76
+ <textarea cols="80" id="editor2" name="editor2" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://ckeditor.com/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
77
+ <script>
78
+
79
+ CKEDITOR.replace( 'editor2', {
80
+ extraPlugins: 'autogrow',
81
+ autoGrow_maxHeight: 400,
82
+ removePlugins: 'resize'
83
+ });
84
+
85
+ </script>
86
+ </p>
87
+ <p>
88
+ <input type="submit" value="Submit">
89
+ </p>
90
+ </form>
91
+ <div id="footer">
92
+ <hr>
93
+ <p>
94
+ CKEditor - The text editor for the Internet - <a class="samples" href="http://ckeditor.com/">http://ckeditor.com</a>
95
+ </p>
96
+ <p id="copy">
97
+ Copyright &copy; 2003-2016, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico
98
+ Knabben. All rights reserved.
99
+ </p>
100
+ </div>
101
+ </body>
102
+ </html>
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+
6
+ ( function() {
7
+ 'use strict';
8
+
9
+ // Regex by Imme Emosol.
10
+ var validUrlRegex = /^(https?|ftp):\/\/(-\.)?([^\s\/?\.#]+\.?)+(\/[^\s]*)?[^\s\.,]$/ig,
11
+ // Regex by (https://www.w3.org/TR/html5/forms.html#valid-e-mail-address).
12
+ validEmailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/g,
13
+ doubleQuoteRegex = /"/g;
14
+
15
+ CKEDITOR.plugins.add( 'autolink', {
16
+ requires: 'clipboard',
17
+
18
+ init: function( editor ) {
19
+ editor.on( 'paste', function( evt ) {
20
+ var data = evt.data.dataValue;
21
+
22
+ if ( evt.data.dataTransfer.getTransferType( editor ) == CKEDITOR.DATA_TRANSFER_INTERNAL ) {
23
+ return;
24
+ }
25
+
26
+ // If we found "<" it means that most likely there's some tag and we don't want to touch it.
27
+ if ( data.indexOf( '<' ) > -1 ) {
28
+ return;
29
+ }
30
+
31
+ // Create valid email links (#1761).
32
+ if ( data.match( validEmailRegex ) ) {
33
+ data = data.replace( validEmailRegex, '<a href="mailto:' + data.replace( doubleQuoteRegex, '%22' ) + '">$&</a>' );
34
+ data = tryToEncodeLink( data );
35
+ } else {
36
+ // https://dev.ckeditor.com/ticket/13419
37
+ data = data.replace( validUrlRegex , '<a href="' + data.replace( doubleQuoteRegex, '%22' ) + '">$&</a>' );
38
+ }
39
+
40
+ // If link was discovered, change the type to 'html'. This is important e.g. when pasting plain text in Chrome
41
+ // where real type is correctly recognized.
42
+ if ( data != evt.data.dataValue ) {
43
+ evt.data.type = 'html';
44
+ }
45
+
46
+ evt.data.dataValue = data;
47
+ } );
48
+
49
+ function tryToEncodeLink( data ) {
50
+ // If enabled use link plugin to encode email link.
51
+ if ( editor.plugins.link ) {
52
+ var link = CKEDITOR.dom.element.createFromHtml( data ),
53
+ linkData = CKEDITOR.plugins.link.parseLinkAttributes( editor, link ),
54
+ attributes = CKEDITOR.plugins.link.getLinkAttributes( editor, linkData );
55
+
56
+ if ( !CKEDITOR.tools.isEmpty( attributes.set ) ) {
57
+ link.setAttributes( attributes.set );
58
+ }
59
+
60
+ if ( attributes.removed.length ) {
61
+ link.removeAttributes( attributes.removed );
62
+ }
63
+ return link.getOuterHtml();
64
+ }
65
+ return data;
66
+ }
67
+ }
68
+ } );
69
+ } )();
@@ -0,0 +1 @@
1
+ .CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:0;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor-mark{background-color:rgba(20,255,20,0.5);-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:0}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0}.CodeMirror{font:13px/1.4em monospace;text-align:left}.CodeMirror .activeline{background:#e8f2ff}.CodeMirror .CodeMirror-foldmarker{color:blue;-ms-text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;-webkit-text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-matchingtag{background:#ff9600;background:rgba(255,150,0,0.3)}.searchCodeButton span,.autoFormat span,.CommentSelectedRange span,.UncommentSelectedRange span{width:16px;height:16px;margin-left:6px}.searchCodeButton span{background:url("../icons/searchcode.png") no-repeat}.autoFormat span{background:url("../icons/autoformat.png") no-repeat}.CommentSelectedRange span{background:url("../icons/commentselectedrange.png") no-repeat}.UncommentSelectedRange span{background:url("../icons/uncommentselectedrange.png") no-repeat}.cke_reset_all .CodeMirror-scroll *{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.cke_reset_all .cm-s-cobalt *,.cke_reset_all .cm-s-erlang-dark *,.cke_reset_all .cm-s-lesser-dark *,.cke_reset_all .cm-s-monokai *,.cke_reset_all .cm-s-night *,.cke_reset_all .cm-s-rubyblue *,.cke_reset_all .cm-s-twilight *,.cke_reset_all .cm-s-xq-dark *,.cke_reset_all .cm-s-base16-dark *,.cke_reset_all .cm-s-3024-night *,.cke_reset_all .cm-s-the-matrix *,.cke_reset_all .cm-s-paraiso-dark *,.cke_reset_all .cm-s-paraiso-light *{color:inherit;font:inherit}.cm-s-cobalt .CodeMirror-selected{background:#b36539!important}.cm-s-erlang-dark .CodeMirror-selected{background:#b36539!important}.cm-s-lesser-dark .CodeMirror-selected{background:#45443b!important}.cm-s-monokai .CodeMirror-selected{background:#49483e!important}.cm-s-night .CodeMirror-selected{background:#447!important}.cm-s-rubyblue .CodeMirror-selected{background:#38566f!important}.cm-s-twilight .CodeMirror-selected{background:#323232!important}.cm-s-xq-dark .CodeMirror-selected{background:#a8f!important}.cm-s-the-matrix .CodeMirror-selected{background:#494949!important}.cm-s-mbo .CodeMirror-selected{background:#716c62!important}.cm-s-blackboard .activeline,.cm-s-cobalt .activeline,.cm-s-erlang-dark .activeline,.cm-s-lesser-dark .activeline,.cm-s-monokai .activeline,.cm-s-night .activeline,.cm-s-rubyblue .activeline,.cm-s-vibrant-ink .activeline,.cm-s-xq-dark .activeline,.cm-s-base16-dark .activeline,.cm-s-3024-night .activeline,.cm-s-paraiso-light .activeline,.cm-s-paraiso-dark .activeline,.cm-s-pastel-on-dark .activeline{background:#757575}.cm-s-pastel-on-dark .activeline{background:#404040}.cm-s-mbo .activeline{background:#716c62}.cm-s-twilight .activeline{background:#494949}.cm-s-the-matrix .activeline{background:#060}.CodeMirror-focused .cm-matchhighlight{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);background-position:bottom;background-repeat:repeat-x}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px #000;-ms-box-shadow:2px 3px 5px #000;box-shadow:2px 3px 5px #000;border-radius:3px;border:1px solid silver;background:white;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;max-width:19em;overflow:hidden;white-space:pre;color:black;cursor:pointer}.CodeMirror-hint-active{background:#08f;color:white}.cm-trailingspace{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==);background-position:bottom left;background-repeat:repeat-x}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:0;outline:0;background:transparent;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px,#b9f -1px -1px 2px,#b9f 1px -1px 2px,#b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:"\25BE"}.CodeMirror-foldgutter-folded:after{content:"\25B8"}
@@ -0,0 +1,2 @@
1
+ !function(){function t(t,e){for(var n=0;n<e.length;n+=1)if(e[n]===t)return!0;return!1}function e(t){return t.replace(/^\s+|\s+$/g,"")}function n(t){return t.replace(/^\s+/g,"")}function i(t,e){"use strict";return new r(t,e).beautify()}function r(i,r){"use strict";function s(t,e){var n=0;return t&&(n=t.indentation_level,!z.just_added_newline()&&t.line_indent_level>n&&(n=t.line_indent_level)),{mode:e,parent:t,last_text:t?t.last_text:"",last_word:t?t.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,if_block:!1,else_block:!1,do_block:!1,do_while:!1,in_case_statement:!1,in_case:!1,case_body:!1,indentation_level:n,line_indent_level:t?t.line_indent_level:n,start_line_index:z.get_line_number(),ternary_depth:0}}function h(t){var e=t.newlines;if(et.keep_array_indentation&&x(q.mode))for(n=0;n<e;n+=1)p(n>0);else if(et.max_preserve_newlines&&e>et.max_preserve_newlines&&(e=et.max_preserve_newlines),et.preserve_newlines&&t.newlines>1){p();for(var n=1;n<e;n+=1)p(!0)}F=t,tt[F.type]()}function c(t){t=t.replace(/\x0d/g,"");for(var e=[],n=t.indexOf("\n");-1!==n;)e.push(t.substring(0,n)),t=t.substring(n+1),n=t.indexOf("\n");return t.length&&e.push(t),e}function u(t){if(t=void 0!==t&&t,!z.just_added_newline())if(et.preserve_newlines&&F.wanted_newline||t)p(!1,!0);else if(et.wrap_line_length){var e=z.current_line.get_character_count()+F.text.length+(z.space_before_token?1:0);e>=et.wrap_line_length&&p(!1,!0)}}function p(t,e){if(!e&&";"!==q.last_text&&","!==q.last_text&&"="!==q.last_text&&"TK_OPERATOR"!==$)for(;q.mode===l.Statement&&!q.if_block&&!q.do_block;)K();z.add_new_line(t)&&(q.multiline_frame=!0)}function f(){z.just_added_newline()&&(et.keep_array_indentation&&x(q.mode)&&F.wanted_newline?(z.current_line.push(F.whitespace_before),z.space_before_token=!1):z.set_indent(q.indentation_level)&&(q.line_indent_level=q.indentation_level))}function d(t){if(z.raw)return void z.add_raw_token(F);et.comma_first&&"TK_COMMA"===$&&z.just_added_newline()&&","===z.previous_line.last()&&(z.previous_line.pop(),f(),z.add_token(","),z.space_before_token=!0),t=t||F.text,f(),z.add_token(t)}function T(){q.indentation_level+=1}function E(){q.indentation_level>0&&(!q.parent||q.indentation_level>q.parent.indentation_level)&&(q.indentation_level-=1)}function g(t){q?(Z.push(q),H=q):H=s(null,t),q=s(H,t)}function x(t){return t===l.ArrayLiteral}function b(e){return t(e,[l.Expression,l.ForInitializer,l.Conditional])}function K(){Z.length>0&&(H=q,q=Z.pop(),H.mode===l.Statement&&z.remove_redundant_indentation(H))}function w(){return q.parent.mode===l.ObjectLiteral&&q.mode===l.Statement&&(":"===q.last_text&&0===q.ternary_depth||"TK_RESERVED"===$&&t(q.last_text,["get","set"]))}function R(){return!!("TK_RESERVED"===$&&t(q.last_text,["var","let","const"])&&"TK_WORD"===F.type||"TK_RESERVED"===$&&"do"===q.last_text||"TK_RESERVED"===$&&"return"===q.last_text&&!F.wanted_newline||"TK_RESERVED"===$&&"else"===q.last_text&&("TK_RESERVED"!==F.type||"if"!==F.text)||"TK_END_EXPR"===$&&(H.mode===l.ForInitializer||H.mode===l.Conditional)||"TK_WORD"===$&&q.mode===l.BlockStatement&&!q.in_case&&"--"!==F.text&&"++"!==F.text&&"function"!==Q&&"TK_WORD"!==F.type&&"TK_RESERVED"!==F.type||q.mode===l.ObjectLiteral&&(":"===q.last_text&&0===q.ternary_depth||"TK_RESERVED"===$&&t(q.last_text,["get","set"])))&&(g(l.Statement),T(),"TK_RESERVED"===$&&t(q.last_text,["var","let","const"])&&"TK_WORD"===F.type&&(q.declaration_statement=!0),w()||u("TK_RESERVED"===F.type&&t(F.text,["do","for","if","while"])),!0)}function m(t,n){for(var i=0;i<t.length;i++){if(e(t[i]).charAt(0)!==n)return!1}return!0}function y(t,e){for(var n,i=0,r=t.length;i<r;i++)if((n=t[i])&&0!==n.indexOf(e))return!1;return!0}function v(e){return t(e,["case","return","do","if","throw","else"])}function A(t){var e=G+(t||0);return e<0||e>=nt.length?null:nt[e]}function k(){R();var e=l.Expression;if("["===F.text){if("TK_WORD"===$||")"===q.last_text)return"TK_RESERVED"===$&&t(q.last_text,X.line_starters)&&(z.space_before_token=!0),g(e),d(),T(),void(et.space_in_paren&&(z.space_before_token=!0));e=l.ArrayLiteral,x(q.mode)&&("["!==q.last_text&&(","!==q.last_text||"]"!==Q&&"}"!==Q)||et.keep_array_indentation||p())}else"TK_RESERVED"===$&&"for"===q.last_text?e=l.ForInitializer:"TK_RESERVED"===$&&t(q.last_text,["if","while"])&&(e=l.Conditional);";"===q.last_text||"TK_START_BLOCK"===$?p():"TK_END_EXPR"===$||"TK_START_EXPR"===$||"TK_END_BLOCK"===$||"."===q.last_text?u(F.wanted_newline):"TK_RESERVED"===$&&"("===F.text||"TK_WORD"===$||"TK_OPERATOR"===$?"TK_RESERVED"===$&&("function"===q.last_word||"typeof"===q.last_word)||"*"===q.last_text&&"function"===Q?et.space_after_anon_function&&(z.space_before_token=!0):"TK_RESERVED"!==$||!t(q.last_text,X.line_starters)&&"catch"!==q.last_text||et.space_before_conditional&&(z.space_before_token=!0):z.space_before_token=!0,"("===F.text&&"TK_RESERVED"===$&&"await"===q.last_word&&(z.space_before_token=!0),"("===F.text&&("TK_EQUALS"!==$&&"TK_OPERATOR"!==$||w()||u()),g(e),d(),et.space_in_paren&&(z.space_before_token=!0),T()}function S(){for(;q.mode===l.Statement;)K();q.multiline_frame&&u("]"===F.text&&x(q.mode)&&!et.keep_array_indentation),et.space_in_paren&&("TK_START_EXPR"!==$||et.space_in_empty_paren?z.space_before_token=!0:(z.trim(),z.space_before_token=!1)),"]"===F.text&&et.keep_array_indentation?(d(),K()):(K(),d()),z.remove_redundant_indentation(H),q.do_while&&H.mode===l.Conditional&&(H.mode=l.Expression,q.do_block=!1,q.do_while=!1)}function O(){var e=A(1),n=A(2);g(n&&(":"===n.text&&t(e.type,["TK_STRING","TK_WORD","TK_RESERVED"])||t(e.text,["get","set"])&&t(n.type,["TK_WORD","TK_RESERVED"]))?t(Q,["class","interface"])?l.BlockStatement:l.ObjectLiteral:l.BlockStatement);var i=!e.comments_before.length&&"}"===e.text,r=i&&"function"===q.last_word&&"TK_END_EXPR"===$;"expand"===et.brace_style||"none"===et.brace_style&&F.wanted_newline?"TK_OPERATOR"!==$&&(r||"TK_EQUALS"===$||"TK_RESERVED"===$&&v(q.last_text)&&"else"!==q.last_text)?z.space_before_token=!0:p(!1,!0):"TK_OPERATOR"!==$&&"TK_START_EXPR"!==$?"TK_START_BLOCK"===$?p():z.space_before_token=!0:x(H.mode)&&","===q.last_text&&("}"===Q?z.space_before_token=!0:p()),d(),T()}function N(){for(;q.mode===l.Statement;)K();var t="TK_START_BLOCK"===$;"expand"===et.brace_style?t||p():t||(x(q.mode)&&et.keep_array_indentation?(et.keep_array_indentation=!1,p(),et.keep_array_indentation=!0):p()),K(),d()}function D(){if("TK_RESERVED"===F.type&&q.mode!==l.ObjectLiteral&&t(F.text,["set","get"])&&(F.type="TK_WORD"),"TK_RESERVED"===F.type&&q.mode===l.ObjectLiteral){":"==A(1).text&&(F.type="TK_WORD")}if(R()||!F.wanted_newline||b(q.mode)||"TK_OPERATOR"===$&&"--"!==q.last_text&&"++"!==q.last_text||"TK_EQUALS"===$||!et.preserve_newlines&&"TK_RESERVED"===$&&t(q.last_text,["var","let","const","set","get"])||p(),q.do_block&&!q.do_while){if("TK_RESERVED"===F.type&&"while"===F.text)return z.space_before_token=!0,d(),z.space_before_token=!0,void(q.do_while=!0);p(),q.do_block=!1}if(q.if_block)if(q.else_block||"TK_RESERVED"!==F.type||"else"!==F.text){for(;q.mode===l.Statement;)K();q.if_block=!1,q.else_block=!1}else q.else_block=!0;if("TK_RESERVED"===F.type&&("case"===F.text||"default"===F.text&&q.in_case_statement))return p(),(q.case_body||et.jslint_happy)&&(E(),q.case_body=!1),d(),q.in_case=!0,void(q.in_case_statement=!0);if("TK_RESERVED"===F.type&&"function"===F.text&&((t(q.last_text,["}",";"])||z.just_added_newline()&&!t(q.last_text,["[","{",":","=",","]))&&(z.just_added_blankline()||F.comments_before.length||(p(),p(!0))),"TK_RESERVED"===$||"TK_WORD"===$?"TK_RESERVED"===$&&t(q.last_text,["get","set","new","return","export","async"])?z.space_before_token=!0:"TK_RESERVED"===$&&"default"===q.last_text&&"export"===Q?z.space_before_token=!0:p():"TK_OPERATOR"===$||"="===q.last_text?z.space_before_token=!0:(q.multiline_frame||!b(q.mode)&&!x(q.mode))&&p()),"TK_COMMA"!==$&&"TK_START_EXPR"!==$&&"TK_EQUALS"!==$&&"TK_OPERATOR"!==$||w()||u(),"TK_RESERVED"===F.type&&t(F.text,["function","get","set"]))return d(),void(q.last_word=F.text);if(J="NONE","TK_END_BLOCK"===$?"TK_RESERVED"===F.type&&t(F.text,["else","catch","finally"])?"expand"===et.brace_style||"end-expand"===et.brace_style||"none"===et.brace_style&&F.wanted_newline?J="NEWLINE":(J="SPACE",z.space_before_token=!0):J="NEWLINE":"TK_SEMICOLON"===$&&q.mode===l.BlockStatement?J="NEWLINE":"TK_SEMICOLON"===$&&b(q.mode)?J="SPACE":"TK_STRING"===$?J="NEWLINE":"TK_RESERVED"===$||"TK_WORD"===$||"*"===q.last_text&&"function"===Q?J="SPACE":"TK_START_BLOCK"===$?J="NEWLINE":"TK_END_EXPR"===$&&(z.space_before_token=!0,J="NEWLINE"),"TK_RESERVED"===F.type&&t(F.text,X.line_starters)&&")"!==q.last_text&&(J="else"===q.last_text||"export"===q.last_text?"SPACE":"NEWLINE"),"TK_RESERVED"===F.type&&t(F.text,["else","catch","finally"]))if("TK_END_BLOCK"!==$||"expand"===et.brace_style||"end-expand"===et.brace_style||"none"===et.brace_style&&F.wanted_newline)p();else{z.trim(!0);var e=z.current_line;"}"!==e.last()&&p(),z.space_before_token=!0}else"NEWLINE"===J?"TK_RESERVED"===$&&v(q.last_text)?z.space_before_token=!0:"TK_END_EXPR"!==$?"TK_START_EXPR"===$&&"TK_RESERVED"===F.type&&t(F.text,["var","let","const"])||":"===q.last_text||("TK_RESERVED"===F.type&&"if"===F.text&&"else"===q.last_text?z.space_before_token=!0:p()):"TK_RESERVED"===F.type&&t(F.text,X.line_starters)&&")"!==q.last_text&&p():q.multiline_frame&&x(q.mode)&&","===q.last_text&&"}"===Q?p():"SPACE"===J&&(z.space_before_token=!0);d(),q.last_word=F.text,"TK_RESERVED"===F.type&&"do"===F.text&&(q.do_block=!0),"TK_RESERVED"===F.type&&"if"===F.text&&(q.if_block=!0)}function C(){for(R()&&(z.space_before_token=!1);q.mode===l.Statement&&!q.if_block&&!q.do_block;)K();d()}function L(){R()?z.space_before_token=!0:"TK_RESERVED"===$||"TK_WORD"===$?z.space_before_token=!0:"TK_COMMA"===$||"TK_START_EXPR"===$||"TK_EQUALS"===$||"TK_OPERATOR"===$?w()||u():p(),d()}function I(){R(),q.declaration_statement&&(q.declaration_assignment=!0),z.space_before_token=!0,d(),z.space_before_token=!0}function j(){if(q.declaration_statement)return b(q.parent.mode)&&(q.declaration_assignment=!1),d(),void(q.declaration_assignment?(q.declaration_assignment=!1,p(!1,!0)):(z.space_before_token=!0,et.comma_first&&u()));d(),q.mode===l.ObjectLiteral||q.mode===l.Statement&&q.parent.mode===l.ObjectLiteral?(q.mode===l.Statement&&K(),p()):(z.space_before_token=!0,et.comma_first&&u())}function V(){if(R(),"TK_RESERVED"===$&&v(q.last_text))return z.space_before_token=!0,void d();if("*"===F.text&&"TK_DOT"===$)return void d();if(":"===F.text&&q.in_case)return q.case_body=!0,T(),d(),p(),void(q.in_case=!1);if("::"===F.text)return void d();"TK_OPERATOR"===$&&u();var e=!0,n=!0;t(F.text,["--","++","!","~"])||t(F.text,["-","+"])&&(t($,["TK_START_BLOCK","TK_START_EXPR","TK_EQUALS","TK_OPERATOR"])||t(q.last_text,X.line_starters)||","===q.last_text)?(e=!1,n=!1,!F.wanted_newline||"--"!==F.text&&"++"!==F.text||p(!1,!0),";"===q.last_text&&b(q.mode)&&(e=!0),"TK_RESERVED"===$?e=!0:"TK_END_EXPR"===$?e=!("]"===q.last_text&&("--"===F.text||"++"===F.text)):"TK_OPERATOR"===$&&(e=t(F.text,["--","-","++","+"])&&t(q.last_text,["--","-","++","+"]),t(F.text,["+","-"])&&t(q.last_text,["--","++"])&&(n=!0)),q.mode!==l.BlockStatement&&q.mode!==l.Statement||"{"!==q.last_text&&";"!==q.last_text||p()):":"===F.text?0===q.ternary_depth?e=!1:q.ternary_depth-=1:"?"===F.text?q.ternary_depth+=1:"*"===F.text&&"TK_RESERVED"===$&&"function"===q.last_text&&(e=!1,n=!1),z.space_before_token=z.space_before_token||e,d(),z.space_before_token=n}function P(){if(z.raw)return z.add_raw_token(F),void(F.directives&&"end"===F.directives.preserve&&(et.test_output_raw||(z.raw=!1)));if(F.directives)return p(!1,!0),d(),"start"===F.directives.preserve&&(z.raw=!0),void p(!1,!0);if(!o.newline.test(F.text)&&!F.wanted_newline)return z.space_before_token=!0,d(),void(z.space_before_token=!0);var t,e=c(F.text),i=!1,r=!1,s=F.whitespace_before,_=s.length;for(p(!1,!0),e.length>1&&(m(e.slice(1),"*")?i=!0:y(e.slice(1),s)&&(r=!0)),d(e[0]),t=1;t<e.length;t++)p(!1,!0),i?d(" "+n(e[t])):r&&e[t].length>_?d(e[t].substring(_)):z.add_token(e[t]);p(!1,!0)}function M(){F.wanted_newline?p(!1,!0):z.trim(!0),z.space_before_token=!0,d(),p(!1,!0)}function B(){R(),"TK_RESERVED"===$&&v(q.last_text)?z.space_before_token=!0:u(")"===q.last_text&&et.break_chained_methods),d()}function U(){d(),"\n"===F.text[F.text.length-1]&&p()}function W(){for(;q.mode===l.Statement;)K()}var z,G,X,F,$,Q,Y,q,H,Z,J,tt,et,nt=[],it="";for(tt={TK_START_EXPR:k,TK_END_EXPR:S,TK_START_BLOCK:O,TK_END_BLOCK:N,TK_WORD:D,TK_RESERVED:D,TK_SEMICOLON:C,TK_STRING:L,TK_EQUALS:I,TK_OPERATOR:V,TK_COMMA:j,TK_BLOCK_COMMENT:P,TK_COMMENT:M,TK_DOT:B,TK_UNKNOWN:U,TK_EOF:W},r=r||{},et={},void 0!==r.braces_on_own_line&&(et.brace_style=r.braces_on_own_line?"expand":"collapse"),et.brace_style=r.brace_style?r.brace_style:et.brace_style?et.brace_style:"collapse","expand-strict"===et.brace_style&&(et.brace_style="expand"),et.indent_size=r.indent_size?parseInt(r.indent_size,10):4,et.indent_char=r.indent_char?r.indent_char:" ",et.eol=r.eol?r.eol:"\n",et.preserve_newlines=void 0===r.preserve_newlines||r.preserve_newlines,et.break_chained_methods=void 0!==r.break_chained_methods&&r.break_chained_methods,et.max_preserve_newlines=void 0===r.max_preserve_newlines?0:parseInt(r.max_preserve_newlines,10),et.space_in_paren=void 0!==r.space_in_paren&&r.space_in_paren,et.space_in_empty_paren=void 0!==r.space_in_empty_paren&&r.space_in_empty_paren,et.jslint_happy=void 0!==r.jslint_happy&&r.jslint_happy,et.space_after_anon_function=void 0!==r.space_after_anon_function&&r.space_after_anon_function,et.keep_array_indentation=void 0!==r.keep_array_indentation&&r.keep_array_indentation,et.space_before_conditional=void 0===r.space_before_conditional||r.space_before_conditional,et.unescape_strings=void 0!==r.unescape_strings&&r.unescape_strings,et.wrap_line_length=void 0===r.wrap_line_length?0:parseInt(r.wrap_line_length,10),et.e4x=void 0!==r.e4x&&r.e4x,et.end_with_newline=void 0!==r.end_with_newline&&r.end_with_newline,et.comma_first=void 0!==r.comma_first&&r.comma_first,et.test_output_raw=void 0!==r.test_output_raw&&r.test_output_raw,et.jslint_happy&&(et.space_after_anon_function=!0),r.indent_with_tabs&&(et.indent_char="\t",et.indent_size=1),et.eol=et.eol.replace(/\\r/,"\r").replace(/\\n/,"\n"),Y="";et.indent_size>0;)Y+=et.indent_char,et.indent_size-=1;var rt=0;if(i&&i.length){for(;" "===i.charAt(rt)||"\t"===i.charAt(rt);)it+=i.charAt(rt),rt+=1;i=i.substring(rt)}$="TK_START_BLOCK",Q="",z=new _(Y,it),z.raw=et.test_output_raw,Z=[],g(l.BlockStatement),this.beautify=function(){var t,e;for(X=new a(i,et,Y),nt=X.tokenize(),G=0;t=A();){for(var n=0;n<t.comments_before.length;n++)h(t.comments_before[n]);h(t),Q=q.last_text,$=t.type,q.last_text=t.text,G+=1}return e=z.get_code(),et.end_with_newline&&(e+="\n"),"\n"!=et.eol&&(e=e.replace(/[\n]/g,et.eol)),e}}function s(t){var e=0,n=-1,i=[],r=!0;this.set_indent=function(i){e=t.baseIndentLength+i*t.indent_length,n=i},this.get_character_count=function(){return e},this.is_empty=function(){return r},this.last=function(){return this._empty?null:i[i.length-1]},this.push=function(t){i.push(t),e+=t.length,r=!1},this.pop=function(){var t=null;return r||(t=i.pop(),e-=t.length,r=0===i.length),t},this.remove_indent=function(){n>0&&(n-=1,e-=t.indent_length)},this.trim=function(){for(;" "===this.last();){i.pop();e-=1}r=0===i.length},this.toString=function(){var e="";return this._empty||(n>=0&&(e=t.indent_cache[n]),e+=i.join("")),e}}function _(t,e){e=e||"",this.indent_cache=[e],this.baseIndentLength=e.length,this.indent_length=t.length,this.raw=!1;var n=[];this.baseIndentString=e,this.indent_string=t,this.previous_line=null,this.current_line=null,this.space_before_token=!1,this.add_outputline=function(){this.previous_line=this.current_line,this.current_line=new s(this),n.push(this.current_line)},this.add_outputline(),this.get_line_number=function(){return n.length},this.add_new_line=function(t){return(1!==this.get_line_number()||!this.just_added_newline())&&(!(!t&&this.just_added_newline())&&(this.raw||this.add_outputline(),!0))},this.get_code=function(){return n.join("\n").replace(/[\r\n\t ]+$/,"")},this.set_indent=function(t){if(n.length>1){for(;t>=this.indent_cache.length;)this.indent_cache.push(this.indent_cache[this.indent_cache.length-1]+this.indent_string);return this.current_line.set_indent(t),!0}return this.current_line.set_indent(0),!1},this.add_raw_token=function(t){for(var e=0;e<t.newlines;e++)this.add_outputline();this.current_line.push(t.whitespace_before),this.current_line.push(t.text),this.space_before_token=!1},this.add_token=function(t){this.add_space_before_token(),this.current_line.push(t)},this.add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&this.current_line.push(" "),this.space_before_token=!1},this.remove_redundant_indentation=function(t){if(!t.multiline_frame&&t.mode!==l.ForInitializer&&t.mode!==l.Conditional)for(var e=t.start_line_index,i=n.length;e<i;)n[e].remove_indent(),e++},this.trim=function(i){for(i=void 0!==i&&i,this.current_line.trim(t,e);i&&n.length>1&&this.current_line.is_empty();)n.pop(),this.current_line=n[n.length-1],this.current_line.trim();this.previous_line=n.length>1?n[n.length-2]:null},this.just_added_newline=function(){return this.current_line.is_empty()},this.just_added_blankline=function(){if(this.just_added_newline()){if(1===n.length)return!0;return n[n.length-2].is_empty()}return!1}}function a(n,i,r){function s(t){if(!t.match(R))return null;var e={};m.lastIndex=0;for(var n=m.exec(t);n;)e[n[1]]=n[2],n=m.exec(t);return e}function _(){var r,_=[];if(f=0,d="",g>=x)return["","TK_EOF"];var R;R=E.length?E[E.length-1]:new h("TK_START_BLOCK","{");var m=n.charAt(g);for(g+=1;t(m,l);){if(o.newline.test(m)?"\n"===m&&"\r"===n.charAt(g-2)||(f+=1,_=[]):_.push(m),g>=x)return["","TK_EOF"];m=n.charAt(g),g+=1}if(_.length&&(d=_.join("")),c.test(m)){var A=!0,k=!0,S=c;for("0"===m&&g<x&&/[Xx]/.test(n.charAt(g))?(A=!1,k=!1,m+=n.charAt(g),g+=1,S=u):(m="",g-=1);g<x&&S.test(n.charAt(g));)m+=n.charAt(g),g+=1,A&&g<x&&"."===n.charAt(g)&&(m+=n.charAt(g),g+=1,A=!1),k&&g<x&&/[Ee]/.test(n.charAt(g))&&(m+=n.charAt(g),g+=1,g<x&&/[+-]/.test(n.charAt(g))&&(m+=n.charAt(g),g+=1),k=!1,A=!1);return[m,"TK_WORD"]}if(o.isIdentifierStart(n.charCodeAt(g-1))){if(g<x)for(;o.isIdentifierChar(n.charCodeAt(g))&&(m+=n.charAt(g),(g+=1)!==x););return"TK_DOT"===R.type||"TK_RESERVED"===R.type&&t(R.text,["set","get"])||!t(m,b)?[m,"TK_WORD"]:"in"===m?[m,"TK_OPERATOR"]:[m,"TK_RESERVED"]}if("("===m||"["===m)return[m,"TK_START_EXPR"];if(")"===m||"]"===m)return[m,"TK_END_EXPR"];if("{"===m)return[m,"TK_START_BLOCK"];if("}"===m)return[m,"TK_END_BLOCK"];if(";"===m)return[m,"TK_SEMICOLON"];if("/"===m){var O="";if("*"===n.charAt(g)){g+=1,K.lastIndex=g;var N=K.exec(n);O="/*"+N[0],g+=N[0].length;var D=s(O);return D&&"start"===D.ignore&&(y.lastIndex=g,N=y.exec(n),O+=N[0],g+=N[0].length),O=O.replace(o.lineBreak,"\n"),[O,"TK_BLOCK_COMMENT",D]}if("/"===n.charAt(g)){g+=1,w.lastIndex=g;var N=w.exec(n);return O="//"+N[0],g+=N[0].length,[O,"TK_COMMENT"]}}if("`"===m||"'"===m||'"'===m||("/"===m||i.e4x&&"<"===m&&n.slice(g-1).match(/^<([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/))&&("TK_RESERVED"===R.type&&t(R.text,["return","case","throw","else","do","typeof","yield"])||"TK_END_EXPR"===R.type&&")"===R.text&&R.parent&&"TK_RESERVED"===R.parent.type&&t(R.parent.text,["if","while","for"])||t(R.type,["TK_COMMENT","TK_START_EXPR","TK_START_BLOCK","TK_END_BLOCK","TK_OPERATOR","TK_EQUALS","TK_EOF","TK_SEMICOLON","TK_COMMA"]))){var C=m,L=!1,I=!1;if(r=m,"/"===C)for(var j=!1;g<x&&(L||j||n.charAt(g)!==C)&&!o.newline.test(n.charAt(g));)r+=n.charAt(g),L?L=!1:(L="\\"===n.charAt(g),"["===n.charAt(g)?j=!0:"]"===n.charAt(g)&&(j=!1)),g+=1;else if(i.e4x&&"<"===C){var V=/<(\/?)([-a-zA-Z:0-9_.]+|{[^{}]*}|!\[CDATA\[[\s\S]*?\]\])(\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{.*?}))*\s*(\/?)\s*>/g,P=n.slice(g-1),M=V.exec(P);if(M&&0===M.index){for(var B=M[2],U=0;M;){var W=!!M[1],z=M[2],G=!!M[M.length-1]||"![CDATA["===z.slice(0,8);if(z!==B||G||(W?--U:++U),U<=0)break;M=V.exec(P)}var X=M?M.index+M[0].length:P.length;return P=P.slice(0,X),g+=X-1,P=P.replace(o.lineBreak,"\n"),[P,"TK_STRING"]}}else for(;g<x&&(L||n.charAt(g)!==C&&("`"===C||!o.newline.test(n.charAt(g))));)(L||"`"===C)&&o.newline.test(n.charAt(g))?("\r"===n.charAt(g)&&"\n"===n.charAt(g+1)&&(g+=1),r+="\n"):r+=n.charAt(g),L?("x"!==n.charAt(g)&&"u"!==n.charAt(g)||(I=!0),L=!1):L="\\"===n.charAt(g),g+=1;if(I&&i.unescape_strings&&(r=a(r)),g<x&&n.charAt(g)===C&&(r+=C,g+=1,"/"===C))for(;g<x&&o.isIdentifierStart(n.charCodeAt(g));)r+=n.charAt(g),g+=1;return[r,"TK_STRING"]}if("#"===m){if(0===E.length&&"!"===n.charAt(g)){for(r=m;g<x&&"\n"!==m;)m=n.charAt(g),r+=m,g+=1;return[e(r)+"\n","TK_UNKNOWN"]}var F="#";if(g<x&&c.test(n.charAt(g))){do{m=n.charAt(g),F+=m,g+=1}while(g<x&&"#"!==m&&"="!==m);return"#"===m||("["===n.charAt(g)&&"]"===n.charAt(g+1)?(F+="[]",g+=2):"{"===n.charAt(g)&&"}"===n.charAt(g+1)&&(F+="{}",g+=2)),[F,"TK_WORD"]}}if("<"===m&&("?"===n.charAt(g)||"%"===n.charAt(g))){v.lastIndex=g-1;var $=v.exec(n);if($)return m=$[0],g+=m.length-1,m=m.replace(o.lineBreak,"\n"),[m,"TK_STRING"]}if("<"===m&&"\x3c!--"===n.substring(g-1,g+3)){for(g+=3,m="\x3c!--";!o.newline.test(n.charAt(g))&&g<x;)m+=n.charAt(g),g++;return T=!0,[m,"TK_COMMENT"]}if("-"===m&&T&&"--\x3e"===n.substring(g-1,g+2))return T=!1,g+=2,["--\x3e","TK_COMMENT"];if("."===m)return[m,"TK_DOT"];if(t(m,p)){for(;g<x&&t(m+n.charAt(g),p)&&(m+=n.charAt(g),!((g+=1)>=x)););return","===m?[m,"TK_COMMA"]:"="===m?[m,"TK_EQUALS"]:[m,"TK_OPERATOR"]}return[m,"TK_UNKNOWN"]}function a(t){for(var e,n=!1,i="",r=0,s="",_=0;n||r<t.length;)if(e=t.charAt(r),r++,n){if(n=!1,"x"===e)s=t.substr(r,2),r+=2;else{if("u"!==e){i+="\\"+e;continue}s=t.substr(r,4),r+=4}if(!s.match(/^[0123456789abcdefABCDEF]+$/))return t;if((_=parseInt(s,16))>=0&&_<32){i+="x"===e?"\\x"+s:"\\u"+s;continue}if(34===_||39===_||92===_)i+="\\"+String.fromCharCode(_);else{if("x"===e&&_>126&&_<=255)return t;i+=String.fromCharCode(_)}}else"\\"===e?n=!0:i+=e;return i}var l="\n\r\t ".split(""),c=/[0-9]/,u=/[0123456789abcdefABCDEF]/,p="+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! ~ , : ? ^ ^= |= :: => <%= <% %> <?= <? ?>".split(" ");this.line_starters="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(",");var f,d,T,E,g,x,b=this.line_starters.concat(["do","in","else","get","set","new","catch","finally","typeof","yield","async","await"]),K=/([\s\S]*?)((?:\*\/)|$)/g,w=/([^\n\r\u2028\u2029]*)/g,R=/\/\* beautify( \w+[:]\w+)+ \*\//g,m=/ (\w+)[:](\w+)/g,y=/([\s\S]*?)((?:\/\*\sbeautify\signore:end\s\*\/)|$)/g,v=/((<\?php|<\?=)[\s\S]*?\?>)|(<%[\s\S]*?%>)/g;this.tokenize=function(){x=n.length,g=0,T=!1,E=[];for(var t,e,i,r=null,s=[],a=[];!e||"TK_EOF"!==e.type;){for(i=_(),t=new h(i[1],i[0],f,d);"TK_COMMENT"===t.type||"TK_BLOCK_COMMENT"===t.type||"TK_UNKNOWN"===t.type;)"TK_BLOCK_COMMENT"===t.type&&(t.directives=i[2]),a.push(t),i=_(),t=new h(i[1],i[0],f,d);a.length&&(t.comments_before=a,a=[]),"TK_START_BLOCK"===t.type||"TK_START_EXPR"===t.type?(t.parent=e,s.push(r),r=t):("TK_END_BLOCK"===t.type||"TK_END_EXPR"===t.type)&&r&&("]"===t.text&&"["===r.text||")"===t.text&&"("===r.text||"}"===t.text&&"{"===r.text)&&(t.parent=r.parent,r=s.pop()),E.push(t),e=t}return E}}var o={};!function(t){var e="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",n=new RegExp("["+e+"]"),i=new RegExp("["+e+"̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‌‍‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]");t.newline=/[\n\r\u2028\u2029]/,t.lineBreak=/\r\n|[\n\r\u2028\u2029]/g,t.isIdentifierStart=function(t){return t<65?36===t:t<91||(t<97?95===t:t<123||t>=170&&n.test(String.fromCharCode(t)))},t.isIdentifierChar=function(t){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||t>=170&&i.test(String.fromCharCode(t))))}}(o);var l={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"},h=function(t,e,n,i,r,s){this.type=t,this.text=e,this.comments_before=[],this.newlines=n||0,this.wanted_newline=n>0,this.whitespace_before=i||"",this.parent=null,this.directives=null};"function"==typeof define&&define.amd?define("beautify.js",[],function(){return{js_beautify:i}}):"undefined"!=typeof exports?exports.js_beautify=i:"undefined"!=typeof window?window.js_beautify=i:"undefined"!=typeof global&&(global.js_beautify=i)}(),function(){function t(t){return t.replace(/^\s+/g,"")}function e(t){return t.replace(/\s+$/g,"")}function n(n,i,r,s){function _(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.newlines=0,this.indent_content=o,this.Utils={whitespace:"\n\r\t ".split(""),single_token:"br,input,link,meta,source,!doctype,basefont,base,area,hr,wbr,param,img,isindex,embed".split(","),extra_liners:b,in_array:function(t,e){for(var n=0;n<e.length;n++)if(t===e[n])return!0;return!1}},this.is_whitespace=function(t){for(;0<t.length;t++)if(!this.Utils.in_array(t.charAt(0),this.Utils.whitespace))return!1;return!0},this.traverse_whitespace=function(){var t="";if(t=this.input.charAt(this.pos),this.Utils.in_array(t,this.Utils.whitespace)){for(this.newlines=0;this.Utils.in_array(t,this.Utils.whitespace);)f&&"\n"===t&&this.newlines<=d&&(this.newlines+=1),this.pos++,t=this.input.charAt(this.pos);return!0}return!1},this.space_or_wrap=function(t){this.line_char_count>=this.wrap_line_length?(this.print_newline(!1,t),this.print_indentation(t)):(this.line_char_count++,t.push(" "))},this.get_content=function(){for(var t="",e=[];"<"!==this.input.charAt(this.pos);){if(this.pos>=this.input.length)return e.length?e.join(""):["","TK_EOF"];if(this.traverse_whitespace())this.space_or_wrap(e);else{if(T){var n=this.input.substr(this.pos,3);if("{{#"===n||"{{/"===n)break;if("{{!"===n)return[this.get_tag(),"TK_TAG_HANDLEBARS_COMMENT"];if("{{"===this.input.substr(this.pos,2)&&"{{else}}"===this.get_tag(!0))break}t=this.input.charAt(this.pos),this.pos++,this.line_char_count++,e.push(t)}}return e.length?e.join(""):""},this.get_contents_to=function(t){if(this.pos===this.input.length)return["","TK_EOF"];var e="",n=new RegExp("</"+t+"\\s*>","igm");n.lastIndex=this.pos;var i=n.exec(this.input),r=i?i.index:this.input.length;return this.pos<r&&(e=this.input.substring(this.pos,r),this.pos=r),e},this.record_tag=function(t){this.tags[t+"count"]?(this.tags[t+"count"]++,this.tags[t+this.tags[t+"count"]]=this.indent_level):(this.tags[t+"count"]=1,this.tags[t+this.tags[t+"count"]]=this.indent_level),this.tags[t+this.tags[t+"count"]+"parent"]=this.tags.parent,this.tags.parent=t+this.tags[t+"count"]},this.retrieve_tag=function(t){if(this.tags[t+"count"]){for(var e=this.tags.parent;e&&t+this.tags[t+"count"]!==e;)e=this.tags[e+"parent"];e&&(this.indent_level=this.tags[t+this.tags[t+"count"]],this.tags.parent=this.tags[e+"parent"]),delete this.tags[t+this.tags[t+"count"]+"parent"],delete this.tags[t+this.tags[t+"count"]],1===this.tags[t+"count"]?delete this.tags[t+"count"]:this.tags[t+"count"]--}},this.indent_to_tag=function(t){if(this.tags[t+"count"]){for(var e=this.tags.parent;e&&t+this.tags[t+"count"]!==e;)e=this.tags[e+"parent"];e&&(this.indent_level=this.tags[t+this.tags[t+"count"]])}},this.get_tag=function(t){var e,n,i="",r=[],s="",_=!1,a=!0,o=this.pos,l=this.line_char_count;t=void 0!==t&&t;do{if(this.pos>=this.input.length)return t&&(this.pos=o,this.line_char_count=l),r.length?r.join(""):["","TK_EOF"];if(i=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(i,this.Utils.whitespace))_=!0;else{if("'"!==i&&'"'!==i||(i+=this.get_unformatted(i),_=!0),"="===i&&(_=!1),r.length&&"="!==r[r.length-1]&&">"!==i&&_){if(this.space_or_wrap(r),_=!1,!a&&"force"===E&&"/"!==i){this.print_newline(!0,r),this.print_indentation(r);for(var c=0;c<g;c++)r.push(h)}for(var u=0;u<r.length;u++)if(" "===r[u]){a=!1;break}}if(T&&"<"===n&&i+this.input.charAt(this.pos)==="{{"&&(i+=this.get_unformatted("}}"),r.length&&" "!==r[r.length-1]&&"<"!==r[r.length-1]&&(i=" "+i),_=!0),"<"!==i||n||(e=this.pos-1,n="<"),T&&!n&&r.length>=2&&"{"===r[r.length-1]&&"{"===r[r.length-2]&&(e="#"===i||"/"===i||"!"===i?this.pos-3:this.pos-2,n="{"),this.line_char_count++,r.push(i),r[1]&&("!"===r[1]||"?"===r[1]||"%"===r[1])){r=[this.get_comment(e)];break}if(T&&r[1]&&"{"===r[1]&&r[2]&&"!"===r[2]){r=[this.get_comment(e)];break}if(T&&"{"===n&&r.length>2&&"}"===r[r.length-2]&&"}"===r[r.length-1])break}}while(">"!==i);var f,d,x=r.join("");f=-1!==x.indexOf(" ")?x.indexOf(" "):"{"===x.charAt(0)?x.indexOf("}"):x.indexOf(">"),d="<"!==x.charAt(0)&&T?"#"===x.charAt(2)?3:2:1;var b=x.substring(d,f).toLowerCase();return"/"===x.charAt(x.length-2)||this.Utils.in_array(b,this.Utils.single_token)?t||(this.tag_type="SINGLE"):T&&"{"===x.charAt(0)&&"else"===b?t||(this.indent_to_tag("if"),this.tag_type="HANDLEBARS_ELSE",this.indent_content=!0,this.traverse_whitespace()):this.is_unformatted(b,p)?(s=this.get_unformatted("</"+b+">",x),r.push(s),this.pos-1,this.tag_type="SINGLE"):"script"===b&&(-1===x.search("type")||x.search("type")>-1&&x.search(/\b(text|application)\/(x-)?(javascript|ecmascript|jscript|livescript)/)>-1)?t||(this.record_tag(b),this.tag_type="SCRIPT"):"style"===b&&(-1===x.search("type")||x.search("type")>-1&&x.search("text/css")>-1)?t||(this.record_tag(b),this.tag_type="STYLE"):"!"===b.charAt(0)?t||(this.tag_type="SINGLE",this.traverse_whitespace()):t||("/"===b.charAt(0)?(this.retrieve_tag(b.substring(1)),this.tag_type="END"):(this.record_tag(b),"html"!==b.toLowerCase()&&(this.indent_content=!0),this.tag_type="START"),this.traverse_whitespace()&&this.space_or_wrap(r),this.Utils.in_array(b,this.Utils.extra_liners)&&(this.print_newline(!1,this.output),this.output.length&&"\n"!==this.output[this.output.length-2]&&this.print_newline(!0,this.output))),t&&(this.pos=o,this.line_char_count=l),r.join("")},this.get_comment=function(t){var e="",n=">",i=!1;for(this.pos=t,input_char=this.input.charAt(this.pos),this.pos++;this.pos<=this.input.length&&(e+=input_char,e.charAt(e.length-1)!==n.charAt(n.length-1)||-1===e.indexOf(n));)!i&&e.length<10&&(0===e.indexOf("<![if")?(n="<![endif]>",i=!0):0===e.indexOf("<![cdata[")?(n="]]>",i=!0):0===e.indexOf("<![")?(n="]>",i=!0):0===e.indexOf("\x3c!--")?(n="--\x3e",i=!0):0===e.indexOf("{{!")?(n="}}",i=!0):0===e.indexOf("<?")?(n="?>",i=!0):0===e.indexOf("<%")&&(n="%>",i=!0)),input_char=this.input.charAt(this.pos),this.pos++;return e},this.get_unformatted=function(t,e){
2
+ if(e&&-1!==e.toLowerCase().indexOf(t))return"";var n="",i="",r=0,s=!0;do{if(this.pos>=this.input.length)return i;if(n=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(n,this.Utils.whitespace)){if(!s){this.line_char_count--;continue}if("\n"===n||"\r"===n){i+="\n",this.line_char_count=0;continue}}i+=n,this.line_char_count++,s=!0,T&&"{"===n&&i.length&&"{"===i.charAt(i.length-2)&&(i+=this.get_unformatted("}}"),r=i.length)}while(-1===i.toLowerCase().indexOf(t,r));return i},this.get_token=function(){var t;if("TK_TAG_SCRIPT"===this.last_token||"TK_TAG_STYLE"===this.last_token){var e=this.last_token.substr(7);return t=this.get_contents_to(e),"string"!=typeof t?t:[t,"TK_"+e]}if("CONTENT"===this.current_mode)return t=this.get_content(),"string"!=typeof t?t:[t,"TK_CONTENT"];if("TAG"===this.current_mode){if("string"!=typeof(t=this.get_tag()))return t;return[t,"TK_TAG_"+this.tag_type]}},this.get_full_indent=function(t){return t=this.indent_level+t||0,t<1?"":Array(t+1).join(this.indent_string)},this.is_unformatted=function(t,e){if(!this.Utils.in_array(t,e))return!1;if("a"!==t.toLowerCase()||!this.Utils.in_array("a",e))return!0;var n=this.get_tag(!0),i=(n||"").match(/^\s*<\s*\/?([a-z]*)\s*[^>]*>\s*$/);return!(i&&!this.Utils.in_array(i,e))},this.printer=function(n,i,r,s,_){this.input=n||"",this.input=this.input.replace(/\r\n|[\r\u2028\u2029]/g,"\n"),this.output=[],this.indent_character=i,this.indent_string="",this.indent_size=r,this.brace_style=_,this.indent_level=0,this.wrap_line_length=s,this.line_char_count=0;for(var a=0;a<this.indent_size;a++)this.indent_string+=this.indent_character;this.print_newline=function(t,n){this.line_char_count=0,n&&n.length&&(t||"\n"!==n[n.length-1])&&("\n"!==n[n.length-1]&&(n[n.length-1]=e(n[n.length-1])),n.push("\n"))},this.print_indentation=function(t){for(var e=0;e<this.indent_level;e++)t.push(this.indent_string),this.line_char_count+=this.indent_string.length},this.print_token=function(e){this.is_whitespace(e)&&!this.output.length||((e||""!==e)&&this.output.length&&"\n"===this.output[this.output.length-1]&&(this.print_indentation(this.output),e=t(e)),this.print_token_raw(e))},this.print_token_raw=function(t){this.newlines>0&&(t=e(t)),t&&""!==t&&(t.length>1&&"\n"===t.charAt(t.length-1)?(this.output.push(t.slice(0,-1)),this.print_newline(!1,this.output)):this.output.push(t));for(var n=0;n<this.newlines;n++)this.print_newline(n>0,this.output);this.newlines=0},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}var a,o,l,h,c,u,p,f,d,T,E,g,x,b,K;for(i=i||{},void 0!==i.wrap_line_length&&0!==parseInt(i.wrap_line_length,10)||void 0===i.max_char||0===parseInt(i.max_char,10)||(i.wrap_line_length=i.max_char),o=void 0!==i.indent_inner_html&&i.indent_inner_html,l=void 0===i.indent_size?4:parseInt(i.indent_size,10),h=void 0===i.indent_char?" ":i.indent_char,u=void 0===i.brace_style?"collapse":i.brace_style,c=0===parseInt(i.wrap_line_length,10)?32786:parseInt(i.wrap_line_length||250,10),p=i.unformatted||["a","span","img","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"],f=void 0===i.preserve_newlines||i.preserve_newlines,d=f?isNaN(parseInt(i.max_preserve_newlines,10))?32786:parseInt(i.max_preserve_newlines,10):0,T=void 0!==i.indent_handlebars&&i.indent_handlebars,E=void 0===i.wrap_attributes?"auto":i.wrap_attributes,g=void 0===i.wrap_attributes_indent_size?l:parseInt(i.wrap_attributes_indent_size,10)||l,x=void 0!==i.end_with_newline&&i.end_with_newline,b="object"==typeof i.extra_liners&&i.extra_liners?i.extra_liners.concat():"string"==typeof i.extra_liners?i.extra_liners.split(","):"head,body,/html".split(","),K=i.eol?i.eol:"\n",i.indent_with_tabs&&(h="\t",l=1),K=K.replace(/\\r/,"\r").replace(/\\n/,"\n"),a=new _,a.printer(n,h,l,c,u);;){var w=a.get_token();if(a.token_text=w[0],a.token_type=w[1],"TK_EOF"===a.token_type)break;switch(a.token_type){case"TK_TAG_START":a.print_newline(!1,a.output),a.print_token(a.token_text),a.indent_content&&(a.indent(),a.indent_content=!1),a.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":a.print_newline(!1,a.output),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_END":if("TK_CONTENT"===a.last_token&&""===a.last_text){var R=a.token_text.match(/\w+/)[0],m=null;a.output.length&&(m=a.output[a.output.length-1].match(/(?:<|{{#)\s*(\w+)/)),(null===m||m[1]!==R&&!a.Utils.in_array(m[1],p))&&a.print_newline(!1,a.output)}a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var y=a.token_text.match(/^\s*<([a-z-]+)/i);y&&a.Utils.in_array(y[1],p)||a.print_newline(!1,a.output),a.print_token(a.token_text),a.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_ELSE":a.print_token(a.token_text),a.indent_content&&(a.indent(),a.indent_content=!1),a.current_mode="CONTENT";break;case"TK_TAG_HANDLEBARS_COMMENT":case"TK_CONTENT":a.print_token(a.token_text),a.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(""!==a.token_text){a.print_newline(!1,a.output);var v,A=a.token_text,k=1;"TK_SCRIPT"===a.token_type?v="function"==typeof r&&r:"TK_STYLE"===a.token_type&&(v="function"==typeof s&&s),"keep"===i.indent_scripts?k=0:"separate"===i.indent_scripts&&(k=-a.indent_level);var S=a.get_full_indent(k);if(v){var O=function(){this.eol="\n"};O.prototype=i;var N=new O;A=v(A.replace(/^\s*/,S),N)}else{var D=A.match(/^\s*/)[0],C=D.match(/[^\n\r]*$/)[0].split(a.indent_string).length-1,L=a.get_full_indent(k-C);A=A.replace(/^\s*/,S).replace(/\r\n|\r|\n/g,"\n"+L).replace(/\s+$/,"")}A&&(a.print_token_raw(A),a.print_newline(!0,a.output))}a.current_mode="TAG";break;default:""!==a.token_text&&a.print_token(a.token_text)}a.last_token=a.token_type,a.last_text=a.token_text}var I=a.output.join("").replace(/[\r\n\t ]+$/,"");return x&&(I+="\n"),"\n"!=K&&(I=I.replace(/[\n]/g,K)),I}if("function"==typeof define&&define.amd)define("beautify-html.js",["require","./beautify","./beautify-css"],function(t){var e=t("./beautify"),i=t("./beautify-css");return{html_beautify:function(t,r){return n(t,r,e.js_beautify,i.css_beautify)}}});else if("undefined"!=typeof exports){var i=require("./beautify.js"),r=require("./beautify-css.js");exports.html_beautify=function(t,e){return n(t,e,i.js_beautify,r.css_beautify)}}else"undefined"!=typeof window?window.html_beautify=function(t,e){return n(t,e,window.js_beautify,window.css_beautify)}:"undefined"!=typeof global&&(global.html_beautify=function(t,e){return n(t,e,global.js_beautify,global.css_beautify)})}(),function(t){"function"==typeof t.define&&(t.define("beautify",["beautify.js"],function(t){return t}),t.define("beautify-css",[],function(){return{css_beautify:void 0}}),t.define("beautifyModule",["beautify","beautify-html.js"],function(e,n){t.js_beautify=e.js_beautify,t.html_beautify=n.html_beautify}))}(this);
@@ -0,0 +1,2 @@
1
+ !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/comment/continuecomment.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var i,o=t.listSelections(),r=[],a=0;a<o.length;a++){var l=o[a].head;if(!/\bcomment\b/.test(t.getTokenTypeAt(l)))return e.Pass;var s=t.getModeAt(l);if(i){if(i!=s)return e.Pass}else i=s;var c=null;if(i.blockCommentStart&&i.blockCommentContinue){var f,u=t.getLine(l.line).slice(0,l.ch),d=u.lastIndexOf(i.blockCommentEnd);if(-1!=d&&d==l.ch-i.blockCommentEnd.length);else if((f=u.lastIndexOf(i.blockCommentStart))>-1&&f>d){if(c=u.slice(0,f),/\S/.test(c)){c="";for(var h=0;h<f;++h)c+=" "}}else(f=u.indexOf(i.blockCommentContinue))>-1&&!/\S/.test(u.slice(0,f))&&(c=u.slice(0,f));null!=c&&(c+=i.blockCommentContinue)}if(null==c&&i.lineComment&&n(t)){var u=t.getLine(l.line),f=u.indexOf(i.lineComment);f>-1&&(c=u.slice(0,f),/\S/.test(c)?c=null:c+=i.lineComment+u.slice(f+i.lineComment.length).match(/^\s*/)[0])}if(null==c)return e.Pass;r[a]="\n"+c}t.operation(function(){for(var e=o.length-1;e>=0;e--)t.replaceRange(r[e],o[e].from(),o[e].to(),"+insert")})}function n(e){var t=e.getOption("continueComments");return!t||"object"!=typeof t||!1!==t.continueLineComment}e.defineOption("continueComments",null,function(n,i,o){if(o&&o!=e.Init&&n.removeKeyMap("continueComment"),i){var r="Enter";"string"==typeof i?r=i:"object"==typeof i&&i.key&&(r=i.key);var a={name:"continueComment"};a[r]=t,n.addKeyMap(a)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/edit/closebrackets.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:d[t]}function n(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),o="'"+n+"'";m[o]||(m[o]=i(n))}}function i(e){return function(t){return s(t,e)}}function o(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function r(n){var i=o(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var r=t(i,"pairs"),a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var s=f(n,a[l].head);if(!s||r.indexOf(s)%2!=0)return e.Pass}for(var l=a.length-1;l>=0;l--){var c=a[l].head;n.replaceRange("",h(c.line,c.ch-1),h(c.line,c.ch+1),"+delete")}}function a(n){var i=o(n),r=i&&t(i,"explode");if(!r||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),l=0;l<a.length;l++){if(!a[l].empty())return e.Pass;var s=f(n,a[l].head);if(!s||r.indexOf(s)%2!=0)return e.Pass}n.operation(function(){var e=n.lineSeparator()||"\n";n.replaceSelection(e+e,null),n.execCommand("goCharLeft"),a=n.listSelections();for(var t=0;t<a.length;t++){var i=a[t].head.line;n.indentLine(i,null,!0),n.indentLine(i+1,null,!0)}})}function l(t){var n=e.cmpPos(t.anchor,t.head)>0;return{anchor:new h(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new h(t.head.line,t.head.ch+(n?1:-1))}}function s(n,i){var r=o(n);if(!r||n.getOption("disableInput"))return e.Pass;var a=t(r,"pairs"),s=a.indexOf(i);if(-1==s)return e.Pass;for(var f,d=t(r,"triples"),m=a.charAt(s+1)==i,g=n.listSelections(),p=s%2==0,v=0;v<g.length;v++){var b,x=g[v],y=x.head,C=n.getRange(y,h(y.line,y.ch+1));if(p&&!x.empty())b="surround";else if(!m&&p||C!=i)if(m&&y.ch>1&&d.indexOf(i)>=0&&n.getRange(h(y.line,y.ch-2),y)==i+i&&(y.ch<=2||n.getRange(h(y.line,y.ch-3),h(y.line,y.ch-2))!=i))b="addFour";else if(m){var k=0==y.ch?" ":n.getRange(h(y.line,y.ch-1),y);if(e.isWordChar(C)||k==i||e.isWordChar(k))return e.Pass;b="both"}else{if(!p||n.getLine(y.line).length!=y.ch&&!c(C,a)&&!/\s/.test(C))return e.Pass;b="both"}else b=m&&u(n,y)?"both":d.indexOf(i)>=0&&n.getRange(y,h(y.line,y.ch+3))==i+i+i?"skipThree":"skip";if(f){if(f!=b)return e.Pass}else f=b}var L=s%2?a.charAt(s-1):i,S=s%2?i:a.charAt(s+1);n.operation(function(){if("skip"==f)n.execCommand("goCharRight");else if("skipThree"==f)for(var e=0;e<3;e++)n.execCommand("goCharRight");else if("surround"==f){for(var t=n.getSelections(),e=0;e<t.length;e++)t[e]=L+t[e]+S;n.replaceSelections(t,"around"),t=n.listSelections().slice();for(var e=0;e<t.length;e++)t[e]=l(t[e]);n.setSelections(t)}else"both"==f?(n.replaceSelection(L+S,null),n.triggerElectric(L+S),n.execCommand("goCharLeft")):"addFour"==f&&(n.replaceSelection(L+L+L+L,"before"),n.execCommand("goCharRight"))})}function c(e,t){var n=t.lastIndexOf(e);return n>-1&&n%2==1}function f(e,t){var n=e.getRange(h(t.line,t.ch-1),h(t.line,t.ch+1));return 2==n.length?n:null}function u(e,t){var n=e.getTokenAt(h(t.line,t.ch+1));return/\bstring/.test(n.type)&&n.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}var d={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},h=e.Pos;e.defineOption("autoCloseBrackets",!1,function(i,o,r){r&&r!=e.Init&&(i.removeKeyMap(m),i.state.closeBrackets=null),o&&(n(t(o,"pairs")),i.state.closeBrackets=o,i.addKeyMap(m))});var m={Backspace:r,Enter:a};n(d.pairs+"`")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/fold/xml-fold",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}function n(e,t,n,i){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=i?Math.max(i.from,e.firstLine()):e.firstLine(),this.max=i?Math.min(i.to-1,e.lastLine()):e.lastLine()}function i(e,t){var n=e.cm.getTokenTypeAt(d(e.line,t));return n&&/\btag\b/.test(n)}function o(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function r(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(o(e))continue;return}{if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t+1}}}function l(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(r(e))continue;return}if(i(e,t+1)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function s(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(o(e))continue;return}{if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(r(e))continue;return}{if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t}}}function f(e,t){for(var n=[];;){var i,o=s(e),r=e.line,l=e.ch-(o?o[0].length:0);if(!o||!(i=a(e)))return;if("selfClose"!=i)if(o[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==o[2]){n.length=c;break}if(c<0&&(!t||t==o[2]))return{tag:o[2],from:d(r,l),to:d(e.line,e.ch)}}else n.push(o[2])}}function u(e,t){for(var n=[];;){var i=c(e);if(!i)return;if("selfClose"!=i){var o=e.line,r=e.ch,a=l(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var s=n.length-1;s>=0;--s)if(n[s]==a[2]){n.length=s;break}if(s<0&&(!t||t==a[2]))return{tag:a[2],from:d(e.line,e.ch),to:d(o,r)}}}else l(e)}}var d=e.Pos,h="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",m=new RegExp("<(/?)(["+h+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");e.registerHelper("fold","xml",function(e,t){for(var i=new n(e,t.line,0);;){var o,r=s(i);if(!r||i.line!=t.line||!(o=a(i)))return;if(!r[1]&&"selfClose"!=o){var l=d(i.line,i.ch),c=f(i,r[2]);return c&&{from:l,to:c.from}}}}),e.findMatchingTag=function(e,i,o){var r=new n(e,i.line,i.ch,o);if(-1!=r.text.indexOf(">")||-1!=r.text.indexOf("<")){var s=a(r),c=s&&d(r.line,r.ch),h=s&&l(r);if(s&&h&&!(t(r,i)>0)){var m={from:d(r.line,r.ch),to:c,tag:h[2]};return"selfClose"==s?{open:m,close:null,at:"open"}:h[1]?{open:u(r,h[2]),close:m,at:"close"}:(r=new n(e,c.line,c.ch,o),{open:m,close:f(r,h[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,i,o){for(var r=new n(e,t.line,t.ch,i);;){var a=u(r,o);if(!a)break;var l=new n(e,t.line,t.ch,i),s=f(l,a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,i,o){return f(new n(e,t.line,t.ch,o?{from:0,to:o}:null),i)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define("addon/edit/closetag.js",["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),i=[],s=t.getOption("autoCloseTags"),c=0;c<n.length;c++){if(!n[c].empty())return e.Pass;var f=n[c].head,u=t.getTokenAt(f),d=e.innerMode(t.getMode(),u.state),h=d.state;if("xml"!=d.mode.name||!h.tagName)return e.Pass;var m="html"==d.mode.configuration,g="object"==typeof s&&s.dontCloseTags||m&&a,p="object"==typeof s&&s.indentTags||m&&l,v=h.tagName;u.end>f.ch&&(v=v.slice(0,v.length-u.end+f.ch));var b=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=f.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==h.type||u.string.indexOf("/")==u.string.length-1||g&&o(g,b)>-1||r(t,v,f,h,!0))return e.Pass;var x=p&&o(p,b)>-1;i[c]={indent:x,text:">"+(x?"\n\n":"")+"</"+v+">",newPos:x?e.Pos(f.line+1,0):e.Pos(f.line,f.ch+1)}}for(var y="object"==typeof s&&s.dontIndentOnAutoClose,c=n.length-1;c>=0;c--){var C=i[c];t.replaceRange(C.text,n[c].head,n[c].anchor,"+insert");var k=t.listSelections().slice(0);k[c]={head:C.newPos,anchor:C.newPos},t.setSelections(k),!y&&C.indent&&(t.indentLine(C.newPos.line,null,!0),t.indentLine(C.newPos.line+1,null,!0))}}function n(t,n){for(var i=t.listSelections(),o=[],a=n?"/":"</",l=t.getOption("autoCloseTags"),s="object"==typeof l&&l.dontIndentOnSlash,c=0;c<i.length;c++){if(!i[c].empty())return e.Pass;var f=i[c].head,u=t.getTokenAt(f),d=e.innerMode(t.getMode(),u.state),h=d.state;if(n&&("string"==u.type||"<"!=u.string.charAt(0)||u.start!=f.ch-1))return e.Pass;var m;if("xml"!=d.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==d.mode.name)m=a+"script";else{if("htmlmixed"!=t.getMode().name||"css"!=d.mode.name)return e.Pass;m=a+"style"}else{if(!h.context||!h.context.tagName||r(t,h.context.tagName,f,h))return e.Pass;m=a+h.context.tagName}">"!=t.getLine(f.line).charAt(u.end)&&(m+=">"),o[c]=m}if(t.replaceSelections(o),i=t.listSelections(),!s)for(var c=0;c<i.length;c++)(c==i.length-1||i[c].head.line<i[c+1].head.line)&&t.indentLine(i[c].head.line)}function i(t){return t.getOption("disableInput")?e.Pass:n(t,!0)}function o(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;++n)if(e[n]==t)return n;return-1}function r(t,n,i,o,r){if(!e.scanForClosingTag)return!1;var a=Math.min(t.lastLine()+1,i.line+500),l=e.scanForClosingTag(t,i,null,a);if(!l||l.tag!=n)return!1;for(var s=o.context,c=r?1:0;s&&s.tagName==n;s=s.prev)++c;i=l.to;for(var f=1;f<c;f++){var u=e.scanForClosingTag(t,i,null,a);if(!u||u.tag!=n)return!1;i=u.to}return!0}e.defineOption("autoCloseTags",!1,function(n,o,r){if(r!=e.Init&&r&&n.removeKeyMap("autoCloseTags"),o){var a={name:"autoCloseTags"};("object"!=typeof o||o.whenClosing)&&(a["'/'"]=function(e){return i(e)}),("object"!=typeof o||o.whenOpening)&&(a["'>'"]=function(e){return t(e)}),n.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],l=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/edit/matchbrackets.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i){var o=e.getLineHandle(t.line),r=t.ch-1,s=i&&i.afterCursor;null==s&&(s=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var c=!s&&r>=0&&l[o.text.charAt(r)]||l[o.text.charAt(++r)];if(!c)return null;var f=">"==c.charAt(1)?1:-1;if(i&&i.strict&&f>0!=(r==t.ch))return null;var u=e.getTokenTypeAt(a(t.line,r+1)),d=n(e,a(t.line,r+(f>0?1:0)),f,u||null,i);return null==d?null:{from:a(t.line,r),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:f>0}}function n(e,t,n,i,o){for(var r=o&&o.maxScanLineLength||1e4,s=o&&o.maxScanLines||1e3,c=[],f=o&&o.bracketRegex?o.bracketRegex:/[(){}[\]]/,u=n>0?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),d=t.line;d!=u;d+=n){var h=e.getLine(d);if(h){var m=n>0?0:h.length-1,g=n>0?h.length:-1;if(!(h.length>r))for(d==t.line&&(m=t.ch-(n<0?1:0));m!=g;m+=n){var p=h.charAt(m);if(f.test(p)&&(void 0===i||e.getTokenTypeAt(a(d,m+1))==i)){var v=l[p];if(">"==v.charAt(1)==n>0)c.push(p);else{if(!c.length)return{pos:a(d,m),ch:p};c.pop()}}}}}return d-n!=(n>0?e.lastLine():e.firstLine())&&null}function i(e,n,i){for(var o=e.state.matchBrackets.maxHighlightLineLength||1e3,l=[],s=e.listSelections(),c=0;c<s.length;c++){var f=s[c].empty()&&t(e,s[c].head,i);if(f&&e.getLine(f.from.line).length<=o){var u=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";l.push(e.markText(f.from,a(f.from.line,f.from.ch+1),{className:u})),f.to&&e.getLine(f.to.line).length<=o&&l.push(e.markText(f.to,a(f.to.line,f.to.ch+1),{className:u}))}}if(l.length){r&&e.state.focused&&e.focus();var d=function(){e.operation(function(){for(var e=0;e<l.length;e++)l[e].clear()})};if(!n)return d;setTimeout(d,800)}}function o(e){e.operation(function(){s&&(s(),s=null),s=i(e,!1,e.state.matchBrackets)})}var r=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),a=e.Pos,l={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},s=null;e.defineOption("matchBrackets",!1,function(t,n,i){i&&i!=e.Init&&(t.off("cursorActivity",o),s&&(s(),s=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",o))}),e.defineExtension("matchBrackets",function(){i(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,i){return(i||"boolean"==typeof n)&&(i?(i.strict=n,n=i):n=n?{strict:!0}:null),t(this,e,n)}),e.defineExtension("scanForBracket",function(e,t,i,o){return n(this,e,t,i,o)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define("addon/edit/matchtags.js",["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation(function(){if(t(n),!n.somethingSelected()){var i=n.getCursor(),o=n.getViewport();o.from=Math.min(o.from,i.line),o.to=Math.max(i.line+1,o.to);var r=e.findMatchingTag(n,i,o);if(r){if(n.state.matchBothTags){var a="open"==r.at?r.open:r.close;a&&(n.state.tagHit=n.markText(a.from,a.to,{className:"CodeMirror-matchingtag"}))}var l="close"==r.at?r.open:r.close;l?n.state.tagOther=n.markText(l.from,l.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}})}function i(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,function(o,r,a){a&&a!=e.Init&&(o.off("cursorActivity",n),o.off("viewportChange",i),t(o)),r&&(o.state.matchBothTags="object"==typeof r&&r.bothTags,o.on("cursorActivity",n),o.on("viewportChange",i),n(o))}),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var i="close"==n.at?n.open:n.close;i&&t.extendSelection(i.to,i.from)}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/edit/trailingspace.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineOption("showTrailingSpace",!1,function(t,n,i){i==e.Init&&(i=!1),i&&!n?t.removeOverlay("trailingspace"):!i&&n&&t.addOverlay({token:function(e){for(var t=e.string.length,n=t;n&&/\s/.test(e.string.charAt(n-1));--n);return n>e.pos?(e.pos=n,null):(e.pos=t,"trailingspace")},name:"trailingspace"})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/fold/foldcode",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,o,r,a){function l(e){var n=s(t,o);if(!n||n.to.line-n.from.line<c)return null;for(var i=t.findMarksAt(n.from),r=0;r<i.length;++r)if(i[r].__isFold&&"fold"!==a){if(!e)return null;n.cleared=!0,i[r].clear()}return n}if(r&&r.call){var s=r;r=null}else var s=i(t,r,"rangeFinder");"number"==typeof o&&(o=e.Pos(o,0));var c=i(t,r,"minFoldSize"),f=l(!0);if(i(t,r,"scanUp"))for(;!f&&o.line>t.firstLine();)o=e.Pos(o.line-1,0),f=l(!1);if(f&&!f.cleared&&"unfold"!==a){var u=n(t,r);e.on(u,"mousedown",function(t){d.clear(),e.e_preventDefault(t)});var d=t.markText(f.from,f.to,{replacedWith:u,clearOnEnter:i(t,r,"clearOnEnter"),__isFold:!0});d.on("clear",function(n,i){e.signal(t,"unfold",t,n,i)}),e.signal(t,"fold",t,f.from,f.to)}}function n(e,t){var n=i(e,t,"widget");if("string"==typeof n){var o=document.createTextNode(n);n=document.createElement("span"),n.appendChild(o),n.className="CodeMirror-foldmarker"}else n&&(n=n.cloneNode(!0));return n}function i(e,t,n){if(t&&void 0!==t[n])return t[n];var i=e.options.foldOptions;return i&&void 0!==i[n]?i[n]:o[n]}e.newFoldFunction=function(e,n){return function(i,o){t(i,o,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,i){t(this,e,n,i)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;n<t.length;++n)if(t[n].__isFold)return!0}),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation(function(){for(var n=t.firstLine(),i=t.lastLine();n<=i;n++)t.foldCode(e.Pos(n,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var n=t.firstLine(),i=t.lastLine();n<=i;n++)t.foldCode(e.Pos(n,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var i=0;i<e.length;++i){var o=e[i](t,n);if(o)return o}}}),e.registerHelper("fold","auto",function(e,t){for(var n=e.getHelpers(t,"fold"),i=0;i<n.length;i++){var o=n[i](e,t);if(o)return o}});var o={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};e.defineOption("foldOptions",null),e.defineExtension("foldOption",function(e,t){return i(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define("addon/fold/foldgutter.js",["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return!0===e&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function i(e,t){for(var n=e.findMarks(u(t,0),u(t+1,0)),i=0;i<n.length;++i)if(n[i].__isFold&&n[i].find().from.line==t)return n[i]}function o(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function r(e,t,n){var r=e.state.foldGutter.options,a=t,l=e.foldOption(r,"minFoldSize"),s=e.foldOption(r,"rangeFinder");e.eachLine(t,n,function(t){var n=null;if(i(e,a))n=o(r.indicatorFolded);else{var c=u(a,0),f=s&&s(e,c);f&&f.to.line-f.from.line>=l&&(n=o(r.indicatorOpen))}e.setGutterMarker(t,r.gutter,n),++a})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){r(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function l(e,t,n){var o=e.state.foldGutter;if(o){var r=o.options;if(n==r.gutter){var a=i(e,t);a?a.clear():e.foldCode(u(t,0),r.rangeFinder)}}}function s(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){n.from<t.from&&(r(e,n.from,t.from),t.from=n.from),n.to>t.to&&(r(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function f(e,t){var n=e.state.foldGutter;if(n){var i=t.line;i>=n.from&&i<n.to&&r(e,i,i+1)}}e.defineOption("foldGutter",!1,function(i,o,r){r&&r!=e.Init&&(i.clearGutter(i.state.foldGutter.options.gutter),i.state.foldGutter=null,i.off("gutterClick",l),i.off("change",s),i.off("viewportChange",c),i.off("fold",f),i.off("unfold",f),i.off("swapDoc",s)),o&&(i.state.foldGutter=new t(n(o)),a(i),i.on("gutterClick",l),i.on("change",s),i.on("viewportChange",c),i.on("fold",f),i.on("unfold",f),i.on("swapDoc",s))});var u=e.Pos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/fold/brace-fold.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("fold","brace",function(t,n){function i(i){for(var l=n.ch,s=0;;){var c=l<=0?-1:a.lastIndexOf(i,l-1);if(-1!=c){if(1==s&&c<n.ch)break;if(o=t.getTokenTypeAt(e.Pos(r,c+1)),!/^(comment|string)/.test(o))return c+1;l=c-1}else{if(1==s)break;s=1,l=a.length}}}var o,r=n.line,a=t.getLine(r),l="{",s="}",c=i("{");if(null==c&&(l="[",s="]",c=i("[")),null!=c){var f,u,d=1,h=t.lastLine();e:for(var m=r;m<=h;++m)for(var g=t.getLine(m),p=m==r?c:0;;){var v=g.indexOf(l,p),b=g.indexOf(s,p);if(v<0&&(v=g.length),b<0&&(b=g.length),(p=Math.min(v,b))==g.length)break;if(t.getTokenTypeAt(e.Pos(m,p+1))==o)if(p==v)++d;else if(!--d){f=m,u=p;break e}++p}if(null!=f&&(r!=f||u!=c))return{from:e.Pos(r,c),to:e.Pos(f,u)}}}),e.registerHelper("fold","import",function(t,n){function i(n){if(n<t.firstLine()||n>t.lastLine())return null;var i=t.getTokenAt(e.Pos(n,1));if(/\S/.test(i.string)||(i=t.getTokenAt(e.Pos(n,i.end+1))),"keyword"!=i.type||"import"!=i.string)return null;for(var o=n,r=Math.min(t.lastLine(),n+10);o<=r;++o){var a=t.getLine(o),l=a.indexOf(";");if(-1!=l)return{startCh:i.end,end:e.Pos(o,l)}}}var o,r=n.line,a=i(r);if(!a||i(r-1)||(o=i(r-2))&&o.end.line==r-1)return null;for(var l=a.end;;){var s=i(l.line+1);if(null==s)break;l=s.end}return{from:t.clipPos(e.Pos(r,a.startCh+1)),to:l}}),e.registerHelper("fold","include",function(t,n){function i(n){if(n<t.firstLine()||n>t.lastLine())return null;var i=t.getTokenAt(e.Pos(n,1));return/\S/.test(i.string)||(i=t.getTokenAt(e.Pos(n,i.end+1))),"meta"==i.type&&"#include"==i.string.slice(0,8)?i.start+8:void 0}var o=n.line,r=i(o);if(null==r||null!=i(o-1))return null;for(var a=o;;){if(null==i(a+1))break;++a}return{from:e.Pos(o,r+1),to:t.clipPos(e.Pos(a))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/fold/comment-fold.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,n){var i=t.getModeAt(n),o=i.blockCommentStart,r=i.blockCommentEnd;if(o&&r){for(var a,l=n.line,s=t.getLine(l),c=n.ch,f=0;;){var u=c<=0?-1:s.lastIndexOf(o,c-1);if(-1!=u){if(1==f&&u<n.ch)return;if(/comment/.test(t.getTokenTypeAt(e.Pos(l,u+1)))&&(0==u||s.slice(u-r.length,u)==r||!/comment/.test(t.getTokenTypeAt(e.Pos(l,u))))){a=u+o.length;break}c=u-1}else{if(1==f)return;f=1,c=s.length}}var d,h,m=1,g=t.lastLine();e:for(var p=l;p<=g;++p)for(var v=t.getLine(p),b=p==l?a:0;;){var x=v.indexOf(o,b),y=v.indexOf(r,b);if(x<0&&(x=v.length),y<0&&(y=v.length),(b=Math.min(x,y))==v.length)break;if(b==x)++m;else if(!--m){d=p,h=b;break e}++b}if(null!=d&&(l!=d||h!=a))return{from:e.Pos(l,a),to:e.Pos(d,h)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/fold/indent-fold.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n){var i=t.getLine(n),o=i.search(/\S/);return-1==o||/\bcomment\b/.test(t.getTokenTypeAt(e.Pos(n,o+1)))?-1:e.countColumn(i,null,t.getOption("tabSize"))}e.registerHelper("fold","indent",function(n,i){var o=t(n,i.line);if(!(o<0)){for(var r=null,a=i.line+1,l=n.lastLine();a<=l;++a){var s=t(n,a);if(-1==s);else{if(!(s>o))break;r=a}}return r?{from:e.Pos(i.line,n.getLine(i.line).length),to:e.Pos(r,n.getLine(r).length)}:void 0}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/format/autoFormatAll.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineExtension("autoFormatAll",function(t,n){function i(){c+="\n",u=!0,++f}for(var o=this,r=o.getMode(),a=o.getRange(t,n).split("\n"),l=e.copyState(r,o.getTokenAt(t).state),s=o.getOption("tabSize"),c="",f=0,u=0==t.ch,d=0;d<a.length;++d){for(var h=new e.StringStream(a[d],s);!h.eol();){var m=e.innerMode(r,l),g=r.token(h,l),p=h.current();h.start=h.pos,u&&!/\S/.test(p)||(c+=p,u=!1),!u&&m.mode.newlineAfterToken&&m.mode.newlineAfterToken(g,p,h.string.slice(h.pos)||a[d+1]||"",m.state)&&i()}!h.pos&&r.blankLine&&r.blankLine(l),!u&&d<a.length-1&&i()}o.operation(function(){o.replaceRange(c,t,n);for(var e=t.line+1,i=t.line+f;e<=i;++e)o.indentLine(e,"smart");o.setCursor({line:0,ch:0})})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/format/formatting.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){for(var t=[/for\s*?\((.*?)\)/g,/&#?[a-z0-9]+;[\s\S]/g,/\"(.*?)((\")|$)/g,/\/\*(.*?)(\*\/|$)/g,/^\/\/.*/g],n=[],i=0;i<t.length;i++)for(var o=0;o<e.length;){var r=e.substr(o).match(t[i]);if(null==r)break;n.push({start:o+r.index,end:o+r.index+r[0].length}),o+=r.index+Math.max(1,r[0].length)}return n.sort(function(e,t){return e.start-t.start}),n}e.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,t){return/^[;{}]$/.test(t)}}),e.extendMode("javascript",{commentStart:"/*",commentEnd:"*/",wordWrapChars:[";","\\{","\\}"],autoFormatLineBreaks:function(e){var n=0,i=this.jsonMode?function(e){return e.replace(/([,{])/g,"$1\n").replace(/}/g,"\n}")}:function(e){return e.replace(/(;|\{|\})([^\r\n;])/g,"$1\n$2")},o=t(e),r="";if(null!=o){for(var a=0;a<o.length;a++)o[a].start>n&&(r+=i(e.substring(n,o[a].start)),n=o[a].start),o[a].start<=n&&o[a].end>=n&&(r+=e.substring(n,o[a].end),n=o[a].end);n<e.length&&(r+=i(e.substr(n)))}else r=i(e);return r.replace(/^\n*|\n*$/,"")}});e.extendMode("xml",{commentStart:"\x3c!--",commentEnd:"--\x3e",noBreak:!1,noBreakEmpty:null,tagType:"",tagName:"",isXML:!1,newlineAfterToken:function(e,t,n,i){var o="a|b|bdi|bdo|big|center|cite|del|em|font|i|img|ins|s|small|span|strike|strong|sub|sup|u",r="label|li|option|textarea|title|"+o,a=!1,l=null,s="";if(this.isXML="xml"==this.configuration,"comment"==e||/<!--/.test(n))return!1;if("tag"==e){if(0==t.indexOf("<")&&0==!t.indexOf("</")){this.tagType="open",l=t.match(/^<\s*?([\w]+?)$/i),this.tagName=null!=l?l[1]:"";var s=this.tagName.toLowerCase();-1!=("|"+r+"|").indexOf("|"+s+"|")&&(this.noBreak=!0)}if(0==t.indexOf(">")&&"open"==this.tagType){this.tagType="";var c=this.isXML?"[^<]*?":"";return RegExp("^"+c+"</s*?"+this.tagName+"s*?>","i").test(n)?(this.noBreak=!1,this.isXML||(this.tagName=""),!1):(a=this.noBreak,this.noBreak=!1,!a)}if(0==t.indexOf("</")&&(this.tagType="close",l=t.match(/^<\/\s*?([\w]+?)$/i),null!=l&&(s=l[1].toLowerCase()),-1!=("|"+o+"|").indexOf("|"+s+"|")&&(this.noBreak=!0)),0==t.indexOf(">")&&"close"==this.tagType)return this.tagType="",0==n.indexOf("<")&&(l=n.match(/^<\/?\s*?([\w]+?)(\s|>)/i),s=null!=l?l[1].toLowerCase():"",-1==("|"+r+"|").indexOf("|"+s+"|"))?(this.noBreak=!1,!0):(a=this.noBreak,this.noBreak=!1,!a)}return 0==n.indexOf("<")&&(this.noBreak=!1,this.isXML&&""!=this.tagName?(this.tagName="",!1):(l=n.match(/^<\/?\s*?([\w]+?)(\s|>)/i),s=null!=l?l[1].toLowerCase():"",-1==("|"+r+"|").indexOf("|"+s+"|")))}}),e.defineExtension("commentRange",function(t,n,i){var o=this,r=e.innerMode(o.getMode(),o.getTokenAt(n).state).mode;o.operation(function(){if(t)o.replaceRange(r.commentEnd,i),o.replaceRange(r.commentStart,n),o.setSelection(n,{line:i.line,ch:i.ch+r.commentStart.length+r.commentEnd.length}),n.line==i.line&&n.ch==i.ch&&o.setCursor(n.line,n.ch+r.commentStart.length);else{var e=o.getRange(n,i),a=e.indexOf(r.commentStart),l=e.lastIndexOf(r.commentEnd);a>-1&&l>-1&&l>a&&(e=e.substr(0,a)+e.substring(a+r.commentStart.length,l)+e.substr(l+r.commentEnd.length)),o.replaceRange(e,n,i),o.setSelection(n,{line:i.line,ch:i.ch-r.commentStart.length-r.commentEnd.length})}})}),e.defineExtension("autoIndentRange",function(e,t){var n=this;this.operation(function(){for(var i=e.line;i<=t.line;i++)n.indentLine(i,"smart")})}),e.defineExtension("autoFormatRange",function(t,n){function i(){c+="\n",u=!0,++f}for(var o=this,r=o.getMode(),a=o.getRange(t,n).split("\n"),l=e.copyState(r,o.getTokenAt(t).state),s=o.getOption("tabSize"),c="",f=0,u=0==t.ch,d=0;d<a.length;++d){for(var h=new e.StringStream(a[d],s);!h.eol();){var m=e.innerMode(r,l),g=r.token(h,l),p=h.current();h.start=h.pos,u&&!/\S/.test(p)||(c+=p,u=!1),!u&&m.mode.newlineAfterToken&&m.mode.newlineAfterToken(g,p,h.string.slice(h.pos)||a[d+1]||"",m.state)&&i()}!h.pos&&r.blankLine&&r.blankLine(l),!u&&d<a.length-1&&i()}o.operation(function(){o.replaceRange(c,t,n);for(var e=t.line+1,i=t.line+f;e<=i;++e)o.indentLine(e,"smart");o.setSelection(t,o.getCursor(!1))})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/selection/active-line.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",r),e.removeLineClass(e.state.activeLines[t],"background",a),e.removeLineClass(e.state.activeLines[t],"gutter",l)}function n(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function i(e,i){for(var o=[],s=0;s<i.length;s++){var c=i[s],f=e.getOption("styleActiveLine");if("object"==typeof f&&f.nonEmpty?c.anchor.line==c.head.line:c.empty()){var u=e.getLineHandleVisualStart(c.head.line);o[o.length-1]!=u&&o.push(u)}}n(e.state.activeLines,o)||e.operation(function(){t(e);for(var n=0;n<o.length;n++)e.addLineClass(o[n],"wrap",r),e.addLineClass(o[n],"background",a),e.addLineClass(o[n],"gutter",l);e.state.activeLines=o})}function o(e,t){i(e,t.ranges)}var r="CodeMirror-activeline",a="CodeMirror-activeline-background",l="CodeMirror-activeline-gutter";e.defineOption("styleActiveLine",!1,function(n,r,a){var l=a!=e.Init&&a;r!=l&&(l&&(n.off("beforeSelectionChange",o),t(n),delete n.state.activeLines),r&&(n.state.activeLines=[],i(n,n.listSelections()),n.on("beforeSelectionChange",o)))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/search/searchcursor",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.flags;return null!=t?t:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function n(e){
2
+ return e.global?e:new RegExp(e.source,t(e)+"g")}function i(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function o(e,t,i){t=n(t);for(var o=i.line,r=i.ch,a=e.lastLine();o<=a;o++,r=0){t.lastIndex=r;var l=e.getLine(o),s=t.exec(l);if(s)return{from:g(o,s.index),to:g(o,s.index+s[0].length),match:s}}}function r(e,t,r){if(!i(t))return o(e,t,r);t=n(t);for(var a,l=1,s=r.line,c=e.lastLine();s<=c;){for(var f=0;f<l;f++){var u=e.getLine(s++);a=null==a?u:a+"\n"+u}l*=2,t.lastIndex=r.ch;var d=t.exec(a);if(d){var h=a.slice(0,d.index).split("\n"),m=d[0].split("\n"),p=r.line+h.length-1,v=h[h.length-1].length;return{from:g(p,v),to:g(p+m.length-1,1==m.length?v+m[0].length:m[m.length-1].length),match:d}}}}function a(e,t){for(var n,i=0;;){t.lastIndex=i;var o=t.exec(e);if(!o)return n;if(n=o,(i=n.index+(n[0].length||1))==e.length)return n}}function l(e,t,i){t=n(t);for(var o=i.line,r=i.ch,l=e.firstLine();o>=l;o--,r=-1){var s=e.getLine(o);r>-1&&(s=s.slice(0,r));var c=a(s,t);if(c)return{from:g(o,c.index),to:g(o,c.index+c[0].length),match:c}}}function s(e,t,i){t=n(t);for(var o,r=1,l=i.line,s=e.firstLine();l>=s;){for(var c=0;c<r;c++){var f=e.getLine(l--);o=null==o?f.slice(0,i.ch):f+"\n"+o}r*=2;var u=a(o,t);if(u){var d=o.slice(0,u.index).split("\n"),h=u[0].split("\n"),m=l+d.length,p=d[d.length-1].length;return{from:g(m,p),to:g(m+h.length-1,1==h.length?p+h[0].length:h[h.length-1].length),match:u}}}}function c(e,t,n,i){if(e.length==t.length)return n;for(var o=0,r=n+Math.max(0,e.length-t.length);;){if(o==r)return o;var a=o+r>>1,l=i(e.slice(0,a)).length;if(l==n)return a;l>n?r=a:o=a+1}}function f(e,t,n,i){if(!t.length)return null;var o=i?h:m,r=o(t).split(/\r|\n\r?/);e:for(var a=n.line,l=n.ch,s=e.lastLine()+1-r.length;a<=s;a++,l=0){var f=e.getLine(a).slice(l),u=o(f);if(1==r.length){var d=u.indexOf(r[0]);if(-1==d)continue e;var n=c(f,u,d,o)+l;return{from:g(a,c(f,u,d,o)+l),to:g(a,c(f,u,d+r[0].length,o)+l)}}var p=u.length-r[0].length;if(u.slice(p)==r[0]){for(var v=1;v<r.length-1;v++)if(o(e.getLine(a+v))!=r[v])continue e;var b=e.getLine(a+r.length-1),x=o(b),y=r[r.length-1];if(x.slice(0,y.length)==y)return{from:g(a,c(f,u,p,o)+l),to:g(a+r.length-1,c(b,x,y.length,o))}}}}function u(e,t,n,i){if(!t.length)return null;var o=i?h:m,r=o(t).split(/\r|\n\r?/);e:for(var a=n.line,l=n.ch,s=e.firstLine()-1+r.length;a>=s;a--,l=-1){var f=e.getLine(a);l>-1&&(f=f.slice(0,l));var u=o(f);if(1==r.length){var d=u.lastIndexOf(r[0]);if(-1==d)continue e;return{from:g(a,c(f,u,d,o)),to:g(a,c(f,u,d+r[0].length,o))}}var p=r[r.length-1];if(u.slice(0,p.length)==p){for(var v=1,n=a-r.length+1;v<r.length-1;v++)if(o(e.getLine(n+v))!=r[v])continue e;var b=e.getLine(a+1-r.length),x=o(b);if(x.slice(x.length-r[0].length)==r[0])return{from:g(a+1-r.length,c(b,x,b.length-r[0].length,o)),to:g(a,c(f,u,p.length,o))}}}}function d(e,t,i,a){this.atOccurrence=!1,this.doc=e,i=i?e.clipPos(i):g(0,0),this.pos={from:i,to:i};var c;"object"==typeof a?c=a.caseFold:(c=a,a=null),"string"==typeof t?(null==c&&(c=!1),this.matches=function(n,i){return(n?u:f)(e,t,i,c)}):(t=n(t),a&&!1===a.multiline?this.matches=function(n,i){return(n?l:o)(e,t,i)}:this.matches=function(n,i){return(n?s:r)(e,t,i)})}var h,m,g=e.Pos;String.prototype.normalize?(h=function(e){return e.normalize("NFD").toLowerCase()},m=function(e){return e.normalize("NFD")}):(h=function(e){return e.toLowerCase()},m=function(e){return e}),d.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(t){for(var n=this.matches(t,this.doc.clipPos(t?this.pos.from:this.pos.to));n&&0==e.cmpPos(n.from,n.to);)t?n.from.ch?n.from=g(n.from.line,n.from.ch-1):n=n.from.line==this.doc.firstLine()?null:this.matches(t,this.doc.clipPos(g(n.from.line-1))):n.to.ch<this.doc.getLine(n.to.line).length?n.to=g(n.to.line,n.to.ch+1):n=n.to.line==this.doc.lastLine()?null:this.matches(t,g(n.to.line+1,0));if(n)return this.pos=n,this.atOccurrence=!0,this.pos.match||!0;var i=g(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:i,to:i},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=g(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,t,n){return new d(this.doc,e,t,n)}),e.defineDocExtension("getSearchCursor",function(e,t,n){return new d(this,e,t,n)}),e.defineExtension("selectMatches",function(t,n){for(var i=[],o=this.getSearchCursor(t,this.getCursor("from"),n);o.findNext()&&!(e.cmpPos(o.to(),this.getCursor("to"))>0);)i.push({anchor:o.from(),head:o.to()});i.length&&this.setSelections(i,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/scroll/annotatescrollbar",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function n(e){clearTimeout(i.doRedraw),i.doRedraw=setTimeout(function(){i.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var i=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(i.doUpdate),i.doUpdate=setTimeout(function(){i.computeScale()&&n(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),!1!==t.listenForChanges&&e.on("change",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){function t(e,t){return s!=e.line&&(s=e.line,c=n.getLineHandle(s)),c.widgets&&c.widgets.length||a&&c.height>l?n.charCoords(e,"local")[t?"top":"bottom"]:n.heightAtLine(c,"local")+(t?0:c.height)}!1!==e&&this.computeScale();var n=this.cm,i=this.hScale,o=document.createDocumentFragment(),r=this.annotations,a=n.getOption("lineWrapping"),l=a&&1.5*n.defaultTextHeight(),s=null,c=null,f=n.lastLine();if(n.display.barWidth)for(var u,d=0;d<r.length;d++){var h=r[d];if(!(h.to.line>f)){for(var m=u||t(h.from,!0)*i,g=t(h.to,!1)*i;d<r.length-1&&!(r[d+1].to.line>f)&&!((u=t(r[d+1].from,!0)*i)>g+.9);)h=r[++d],g=t(h.to,!1)*i;if(g!=m){var p=Math.max(g-m,3),v=o.appendChild(document.createElement("div"));v.style.cssText="position: absolute; right: 0px; width: "+Math.max(n.display.barWidth-1,2)+"px; top: "+(m+this.buttonHeight)+"px; height: "+p+"px",v.className=this.options.className,h.id&&v.setAttribute("annotation-id",h.id)}}}this.div.textContent="",this.div.appendChild(o)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define("addon/search/matchesonscrollbar",["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,i){this.cm=e,this.options=i;var o={listenForChanges:!1};for(var r in i)o[r]=i[r];o.className||(o.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(o),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function n(e,t,n){return e<=t?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,i){return"string"==typeof i&&(i={className:i}),i||(i={}),new t(this,e,n,i)});t.prototype.findMatches=function(){if(this.gap){for(var t=0;t<this.matches.length;t++){var n=this.matches[t];if(n.from.line>=this.gap.to)break;n.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var i=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold),o=this.options&&this.options.maxMatches||1e3;i.findNext();){var n={from:i.from(),to:i.to()};if(n.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var i=t.from.line,o=e.changeEnd(t).line,r=o-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,i,r),t.from.line),this.gap.to=Math.max(n(this.gap.to,i,r),t.from.line)):this.gap={from:t.from.line,to:o+1},r)for(var a=0;a<this.matches.length;a++){var l=this.matches[a],s=n(l.from.line,i,r);s!=l.from.line&&(l.from=e.Pos(s,l.from.ch));var c=n(l.to.line,i,r);c!=l.to.line&&(l.to=e.Pos(c,l.to.ch))}clearTimeout(this.update);var f=this;this.update=setTimeout(function(){f.updateAfterChange()},250)},t.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},t.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./matchesonscrollbar")):"function"==typeof define&&define.amd?define("addon/search/match-highlighter.js",["../../lib/codemirror","./matchesonscrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options={};for(var t in u)this.options[t]=(e&&e.hasOwnProperty(t)?e:u)[t];this.overlay=this.timeout=null,this.matchesonscroll=null,this.active=!1}function n(e){var t=e.state.matchHighlighter;(t.active||e.hasFocus())&&o(e,t)}function i(e){var t=e.state.matchHighlighter;t.active||(t.active=!0,o(e,t))}function o(e,t){clearTimeout(t.timeout),t.timeout=setTimeout(function(){l(e)},t.options.delay)}function r(e,t,n,i){var o=e.state.matchHighlighter;if(e.addOverlay(o.overlay=f(t,n,i)),o.options.annotateScrollbar&&e.showMatchesOnScrollbar){var r=n?new RegExp("\\b"+t+"\\b"):t;o.matchesonscroll=e.showMatchesOnScrollbar(r,!1,{className:"CodeMirror-selection-highlight-scrollbar"})}}function a(e){var t=e.state.matchHighlighter;t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null,t.matchesonscroll&&(t.matchesonscroll.clear(),t.matchesonscroll=null))}function l(e){e.operation(function(){var t=e.state.matchHighlighter;if(a(e),!e.somethingSelected()&&t.options.showToken){for(var n=!0===t.options.showToken?/[\w$]/:t.options.showToken,i=e.getCursor(),o=e.getLine(i.line),l=i.ch,c=l;l&&n.test(o.charAt(l-1));)--l;for(;c<o.length&&n.test(o.charAt(c));)++c;return void(l<c&&r(e,o.slice(l,c),n,t.options.style))}var f=e.getCursor("from"),u=e.getCursor("to");if(f.line==u.line&&(!t.options.wordsOnly||s(e,f,u))){var d=e.getRange(f,u);t.options.trim&&(d=d.replace(/^\s+|\s+$/g,"")),d.length>=t.options.minChars&&r(e,d,!1,t.options.style)}})}function s(e,t,n){if(null!==e.getRange(t,n).match(/^\w+$/)){if(t.ch>0){var i={line:t.line,ch:t.ch-1},o=e.getRange(i,t);if(null===o.match(/\W/))return!1}if(n.ch<e.getLine(t.line).length){var i={line:n.line,ch:n.ch+1},o=e.getRange(n,i);if(null===o.match(/\W/))return!1}return!0}return!1}function c(e,t){return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}function f(e,t,n){return{token:function(i){if(i.match(e)&&(!t||c(i,t)))return n;i.next(),i.skipTo(e.charAt(0))||i.skipToEnd()}}}var u={style:"matchhighlight",minChars:2,delay:100,wordsOnly:!1,annotateScrollbar:!1,showToken:!1,trim:!0};e.defineOption("highlightSelectionMatches",!1,function(o,r,s){if(s&&s!=e.Init&&(a(o),clearTimeout(o.state.matchHighlighter.timeout),o.state.matchHighlighter=null,o.off("cursorActivity",n),o.off("focus",i)),r){var c=o.state.matchHighlighter=new t(r);o.hasFocus()?(c.active=!0,l(o)):o.on("focus",i),o.on("cursorActivity",n)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/mode/multiplex.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(t){function n(e,t,n,i){if("string"==typeof t){var o=e.indexOf(t,n);return i&&o>-1?o+t.length:o}var r=t.exec(n?e.slice(n):e);return r?r.index+n+(i?r[0].length:0):-1}var i=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(o,r){if(r.innerActive){var a=r.innerActive,l=o.string;if(!a.close&&o.sol())return r.innerActive=r.inner=null,this.token(o,r);var s=a.close?n(l,a.close,o.pos,a.parseDelimiters):-1;if(s==o.pos&&!a.parseDelimiters)return o.match(a.close),r.innerActive=r.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";s>-1&&(o.string=l.slice(0,s));var c=a.mode.token(o,r.inner);return s>-1&&(o.string=l),s==o.pos&&a.parseDelimiters&&(r.innerActive=r.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var f=1/0,l=o.string,u=0;u<i.length;++u){var d=i[u],s=n(l,d.open,o.pos);if(s==o.pos)return d.parseDelimiters||o.match(d.open),r.innerActive=d,r.inner=e.startState(d.mode,t.indent?t.indent(r.outer,""):0),d.delimStyle&&d.delimStyle+" "+d.delimStyle+"-open";-1!=s&&s<f&&(f=s)}f!=1/0&&(o.string=l.slice(0,f));var h=t.token(o,r.outer);return f!=1/0&&(o.string=l),h},indent:function(n,i){var o=n.innerActive?n.innerActive.mode:t;return o.indent?o.indent(n.innerActive?n.inner:n.outer,i):e.Pass},blankLine:function(n){var o=n.innerActive?n.innerActive.mode:t;if(o.blankLine&&o.blankLine(n.innerActive?n.inner:n.outer),n.innerActive)"\n"===n.innerActive.close&&(n.innerActive=n.inner=null);else for(var r=0;r<i.length;++r){var a=i[r];"\n"===a.open&&(n.innerActive=a,n.inner=e.startState(a.mode,o.indent?o.indent(n.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"function"==typeof e.define&&e.define("addons",["addon/comment/continuecomment.js","addon/edit/closebrackets.js","addon/edit/closetag.js","addon/edit/matchbrackets.js","addon/edit/matchtags.js","addon/edit/trailingspace.js","addon/fold/foldgutter.js","addon/fold/brace-fold.js","addon/fold/comment-fold.js","addon/fold/indent-fold.js","addon/format/autoFormatAll.js","addon/format/formatting.js","addon/selection/active-line.js","addon/search/match-highlighter.js","addon/mode/multiplex.js"],function(){})}(this);
@@ -0,0 +1 @@
1
+ !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/search/searchcursor",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function n(e){var n=e.flags;return null!=n?n:(e.ignoreCase?"i":"")+(e.global?"g":"")+(e.multiline?"m":"")}function t(e){return e.global?e:new RegExp(e.source,n(e)+"g")}function o(e){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source)}function r(e,n,o){n=t(n);for(var r=o.line,i=o.ch,s=e.lastLine();r<=s;r++,i=0){n.lastIndex=i;var c=e.getLine(r),l=n.exec(c);if(l)return{from:g(r,l.index),to:g(r,l.index+l[0].length),match:l}}}function i(e,n,i){if(!o(n))return r(e,n,i);n=t(n);for(var s,c=1,l=i.line,a=e.lastLine();l<=a;){for(var u=0;u<c;u++){var f=e.getLine(l++);s=null==s?f:s+"\n"+f}c*=2,n.lastIndex=i.ch;var h=n.exec(s);if(h){var d=s.slice(0,h.index).split("\n"),p=h[0].split("\n"),m=i.line+d.length-1,v=d[d.length-1].length;return{from:g(m,v),to:g(m+p.length-1,1==p.length?v+p[0].length:p[p.length-1].length),match:h}}}}function s(e,n){for(var t,o=0;;){n.lastIndex=o;var r=n.exec(e);if(!r)return t;if(t=r,(o=t.index+(t[0].length||1))==e.length)return t}}function c(e,n,o){n=t(n);for(var r=o.line,i=o.ch,c=e.firstLine();r>=c;r--,i=-1){var l=e.getLine(r);i>-1&&(l=l.slice(0,i));var a=s(l,n);if(a)return{from:g(r,a.index),to:g(r,a.index+a[0].length),match:a}}}function l(e,n,o){n=t(n);for(var r,i=1,c=o.line,l=e.firstLine();c>=l;){for(var a=0;a<i;a++){var u=e.getLine(c--);r=null==r?u.slice(0,o.ch):u+"\n"+r}i*=2;var f=s(r,n);if(f){var h=r.slice(0,f.index).split("\n"),d=f[0].split("\n"),p=c+h.length,m=h[h.length-1].length;return{from:g(p,m),to:g(p+d.length-1,1==d.length?m+d[0].length:d[d.length-1].length),match:f}}}}function a(e,n,t,o){if(e.length==n.length)return t;for(var r=0,i=t+Math.max(0,e.length-n.length);;){if(r==i)return r;var s=r+i>>1,c=o(e.slice(0,s)).length;if(c==t)return s;c>t?i=s:r=s+1}}function u(e,n,t,o){if(!n.length)return null;var r=o?d:p,i=r(n).split(/\r|\n\r?/);e:for(var s=t.line,c=t.ch,l=e.lastLine()+1-i.length;s<=l;s++,c=0){var u=e.getLine(s).slice(c),f=r(u);if(1==i.length){var h=f.indexOf(i[0]);if(-1==h)continue e;var t=a(u,f,h,r)+c;return{from:g(s,a(u,f,h,r)+c),to:g(s,a(u,f,h+i[0].length,r)+c)}}var m=f.length-i[0].length;if(f.slice(m)==i[0]){for(var v=1;v<i.length-1;v++)if(r(e.getLine(s+v))!=i[v])continue e;var y=e.getLine(s+i.length-1),x=r(y),C=i[i.length-1];if(x.slice(0,C.length)==C)return{from:g(s,a(u,f,m,r)+c),to:g(s+i.length-1,a(y,x,C.length,r))}}}}function f(e,n,t,o){if(!n.length)return null;var r=o?d:p,i=r(n).split(/\r|\n\r?/);e:for(var s=t.line,c=t.ch,l=e.firstLine()-1+i.length;s>=l;s--,c=-1){var u=e.getLine(s);c>-1&&(u=u.slice(0,c));var f=r(u);if(1==i.length){var h=f.lastIndexOf(i[0]);if(-1==h)continue e;return{from:g(s,a(u,f,h,r)),to:g(s,a(u,f,h+i[0].length,r))}}var m=i[i.length-1];if(f.slice(0,m.length)==m){for(var v=1,t=s-i.length+1;v<i.length-1;v++)if(r(e.getLine(t+v))!=i[v])continue e;var y=e.getLine(s+1-i.length),x=r(y);if(x.slice(x.length-i[0].length)==i[0])return{from:g(s+1-i.length,a(y,x,y.length-i[0].length,r)),to:g(s,a(u,f,m.length,r))}}}}function h(e,n,o,s){this.atOccurrence=!1,this.doc=e,o=o?e.clipPos(o):g(0,0),this.pos={from:o,to:o};var a;"object"==typeof s?a=s.caseFold:(a=s,s=null),"string"==typeof n?(null==a&&(a=!1),this.matches=function(t,o){return(t?f:u)(e,n,o,a)}):(n=t(n),s&&!1===s.multiline?this.matches=function(t,o){return(t?c:r)(e,n,o)}:this.matches=function(t,o){return(t?l:i)(e,n,o)})}var d,p,g=e.Pos;String.prototype.normalize?(d=function(e){return e.normalize("NFD").toLowerCase()},p=function(e){return e.normalize("NFD")}):(d=function(e){return e.toLowerCase()},p=function(e){return e}),h.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(n){for(var t=this.matches(n,this.doc.clipPos(n?this.pos.from:this.pos.to));t&&0==e.cmpPos(t.from,t.to);)n?t.from.ch?t.from=g(t.from.line,t.from.ch-1):t=t.from.line==this.doc.firstLine()?null:this.matches(n,this.doc.clipPos(g(t.from.line-1))):t.to.ch<this.doc.getLine(t.to.line).length?t.to=g(t.to.line,t.to.ch+1):t=t.to.line==this.doc.lastLine()?null:this.matches(n,g(t.to.line+1,0));if(t)return this.pos=t,this.atOccurrence=!0,this.pos.match||!0;var o=g(n?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,t){if(this.atOccurrence){var o=e.splitLines(n);this.doc.replaceRange(o,this.pos.from,this.pos.to,t),this.pos.to=g(this.pos.from.line+o.length-1,o[o.length-1].length+(1==o.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,t){return new h(this.doc,e,n,t)}),e.defineDocExtension("getSearchCursor",function(e,n,t){return new h(this,e,n,t)}),e.defineExtension("selectMatches",function(n,t){for(var o=[],r=this.getSearchCursor(n,this.getCursor("from"),t);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)o.push({anchor:r.from(),head:r.to()});o.length&&this.setSelections(o,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/dialog/dialog",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,n,t){var o,r=e.getWrapperElement();return o=r.appendChild(document.createElement("div")),o.className=t?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?o.innerHTML=n:o.appendChild(n),o}function t(e,n){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=n}e.defineExtension("openDialog",function(o,r,i){function s(e){if("string"==typeof e)f.value=e;else{if(a)return;a=!0,l.parentNode.removeChild(l),u.focus(),i.onClose&&i.onClose(l)}}i||(i={}),t(this,null);var c,l=n(this,o,i.bottom),a=!1,u=this,f=l.getElementsByTagName("input")[0];return f?(f.focus(),i.value&&(f.value=i.value,!1!==i.selectValueOnOpen&&f.select()),i.onInput&&e.on(f,"input",function(e){i.onInput(e,f.value,s)}),i.onKeyUp&&e.on(f,"keyup",function(e){i.onKeyUp(e,f.value,s)}),e.on(f,"keydown",function(n){i&&i.onKeyDown&&i.onKeyDown(n,f.value,s)||((27==n.keyCode||!1!==i.closeOnEnter&&13==n.keyCode)&&(f.blur(),e.e_stop(n),s()),13==n.keyCode&&r(f.value,n))}),!1!==i.closeOnBlur&&e.on(f,"blur",s)):(c=l.getElementsByTagName("button")[0])&&(e.on(c,"click",function(){s(),u.focus()}),!1!==i.closeOnBlur&&e.on(c,"blur",s),c.focus()),s}),e.defineExtension("openConfirm",function(o,r,i){function s(){a||(a=!0,c.parentNode.removeChild(c),u.focus())}t(this,null);var c=n(this,o,i&&i.bottom),l=c.getElementsByTagName("button"),a=!1,u=this,f=1;l[0].focus();for(var h=0;h<l.length;++h){var d=l[h];!function(n){e.on(d,"click",function(t){e.e_preventDefault(t),s(),n&&n(u)})}(r[h]),e.on(d,"blur",function(){--f,setTimeout(function(){f<=0&&s()},200)}),e.on(d,"focus",function(){++f})}}),e.defineExtension("openNotification",function(o,r){function i(){l||(l=!0,clearTimeout(s),c.parentNode.removeChild(c))}t(this,i);var s,c=n(this,o,r&&r.bottom),l=!1,a=r&&void 0!==r.duration?r.duration:5e3;return e.on(c,"click",function(n){e.e_preventDefault(n),i()}),a&&(s=setTimeout(i,a)),i})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define("addon/search/search.js",["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function n(e,n){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),n?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(n){e.lastIndex=n.pos;var t=e.exec(n.string);if(t&&t.index==n.pos)return n.pos+=t[0].length||1,"searching";t?n.pos=t.index:n.skipToEnd()}}}function t(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function o(e){return e.state.search||(e.state.search=new t)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function i(e,n,t){return e.getSearchCursor(n,t,{caseFold:r(n),multiline:!0})}function s(e,n,t,o,r){e.openDialog(n,o,{value:t,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(e)},onKeyDown:r})}function c(e,n,t,o,r){e.openDialog?e.openDialog(n,r,{value:o,selectValueOnOpen:!0}):r(prompt(t,o))}function l(e,n,t,o){e.openConfirm?e.openConfirm(n,o):confirm(t)&&o[0]()}function a(e){return e.replace(/\\(.)/g,function(e,n){return"n"==n?"\n":"r"==n?"\r":n})}function u(e){var n=e.match(/^\/(.*)\/([a-z]*)$/);if(n)try{e=new RegExp(n[1],-1==n[2].indexOf("i")?"":"i")}catch(e){}else e=a(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function f(e,t,o){t.queryText=o,t.query=u(o),e.removeOverlay(t.overlay,r(t.query)),t.overlay=n(t.query,r(t.query)),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(t.query,r(t.query)))}function h(n,t,r,i){var l=o(n);if(l.query)return d(n,t);var a=n.getSelection()||l.lastQuery;if(a instanceof RegExp&&"x^"==a.source&&(a=null),r&&n.openDialog){var u=null,h=function(t,o){e.e_stop(o),t&&(t!=l.queryText&&(f(n,l,t),l.posFrom=l.posTo=n.getCursor()),u&&(u.style.opacity=1),d(n,o.shiftKey,function(e,t){var o;t.line<3&&document.querySelector&&(o=n.display.wrapper.querySelector(".CodeMirror-dialog"))&&o.getBoundingClientRect().bottom-4>n.cursorCoords(t,"window").top&&((u=o).style.opacity=.4)}))};s(n,v,a,h,function(t,r){var i=e.keyName(t),s=n.getOption("extraKeys"),c=s&&s[i]||e.keyMap[n.getOption("keyMap")][i];"findNext"==c||"findPrev"==c||"findPersistentNext"==c||"findPersistentPrev"==c?(e.e_stop(t),f(n,o(n),r),n.execCommand(c)):"find"!=c&&"findPersistent"!=c||(e.e_stop(t),h(r,t))}),i&&a&&(f(n,l,a),d(n,t))}else c(n,v,"Search for:",a,function(e){e&&!l.query&&n.operation(function(){f(n,l,e),l.posFrom=l.posTo=n.getCursor(),d(n,t)})})}function d(n,t,r){n.operation(function(){var s=o(n),c=i(n,s.query,t?s.posFrom:s.posTo);(c.find(t)||(c=i(n,s.query,t?e.Pos(n.lastLine()):e.Pos(n.firstLine(),0)),c.find(t)))&&(n.setSelection(c.from(),c.to()),n.scrollIntoView({from:c.from(),to:c.to()},20),s.posFrom=c.from(),s.posTo=c.to(),r&&r(c.from(),c.to()))})}function p(e){e.operation(function(){var n=o(e);n.lastQuery=n.query,n.query&&(n.query=n.queryText=null,e.removeOverlay(n.overlay),n.annotate&&(n.annotate.clear(),n.annotate=null))})}function g(e,n,t){e.operation(function(){for(var o=i(e,n);o.findNext();)if("string"!=typeof n){var r=e.getRange(o.from(),o.to()).match(n);o.replace(t.replace(/\$(\d)/g,function(e,n){return r[n]}))}else o.replace(t)})}function m(e,n){if(!e.getOption("readOnly")){var t=e.getSelection()||o(e).lastQuery,r='<span class="CodeMirror-search-label">'+(n?"Replace all:":"Replace:")+"</span>";c(e,r+y,r,t,function(t){t&&(t=u(t),c(e,x,"Replace with:","",function(o){if(o=a(o),n)g(e,t,o);else{p(e);var r=i(e,t,e.getCursor("from")),s=function(){var n,a=r.from();!(n=r.findNext())&&(r=i(e,t),!(n=r.findNext())||a&&r.from().line==a.line&&r.from().ch==a.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),l(e,C,"Replace?",[function(){c(n)},s,function(){g(e,t,o)}]))},c=function(e){r.replace("string"==typeof t?o:o.replace(/\$(\d)/g,function(n,t){return e[t]})),s()};s()}}))})}}var v='<span class="CodeMirror-search-label">Search:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',y=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',x='<span class="CodeMirror-search-label">With:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',C='<span class="CodeMirror-search-label">Replace?</span> <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>';e.commands.find=function(e){p(e),h(e)},e.commands.findPersistent=function(e){p(e),h(e,!1,!0)},e.commands.findPersistentNext=function(e){h(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){h(e,!0,!0,!0)},e.commands.findNext=h,e.commands.findPrev=function(e){h(e,!0)},e.commands.clearSearch=p,e.commands.replace=m,e.commands.replaceAll=function(e){m(e,!0)}}),function(e){"function"==typeof e.define&&e.define("addonSearch",["addon/search/search.js"],function(){})}(this);
@@ -0,0 +1,6 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("codemirror.js",t):e.CodeMirror=t()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function i(e,t,r,i){var o=n(e,t,r,i);return o.setAttribute("role","presentation"),o}function o(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function l(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function s(t,r){var n=t.className;e(r).test(n)||(t.className+=(n?" ":"")+r)}function a(t,r){for(var n=t.split(" "),i=0;i<n.length;i++)n[i]&&!e(n[i]).test(r)&&(r+=" "+n[i]);return r}function u(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function c(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function f(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=r-l%r,o=s+1}}function h(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function d(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Yl.length<=e;)Yl.push(g(Yl)+" ");return Yl[e]}function g(e){return e[e.length-1]}function v(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function m(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function y(){}function b(e,t){var r;return Object.create?r=Object.create(e):(y.prototype=e,r=new y),t&&c(t,r),r}function w(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||_l.test(e))}function x(e,t){return t?!!(t.source.indexOf("\\w")>-1&&w(e))||t.test(e):w(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function S(e){return e.charCodeAt(0)>=768&&ql.test(e)}function L(e,t,r){for(;(r<0?t>0:t<e.length)&&S(e.charAt(t));)t+=r;return t}function k(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function T(e,t,r){var o=this;this.input=r,o.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=i("div",null,"CodeMirror-code"),o.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=n("div",null,"CodeMirror-cursors"),o.measure=n("div",null,"CodeMirror-measure"),o.lineMeasure=n("div",null,"CodeMirror-measure"),o.lineSpace=i("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=i("div",[o.lineSpace],"CodeMirror-lines");o.mover=n("div",[l],null,"position: relative"),o.sizer=n("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=n("div",null,null,"position: absolute; height: "+Ul+"px; width: 1px;"),o.gutters=n("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=n("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=n("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),yl&&bl<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),wl||pl&&Ol||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,r.init(o)}function M(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function N(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function O(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function A(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function W(e){if(null==e.parent)return null;for(var t=e.parent,r=h(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function D(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l],a=s.height;if(t<a)break;t-=a}return r+l}function H(e,t){return t>=e.first&&t<e.first+e.size}function F(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function P(e,t,r){if(void 0===r&&(r=null),!(this instanceof P))return new P(e,t,r);this.line=e,this.ch=t,this.sticky=r}function E(e,t){return e.line-t.line||e.ch-t.ch}function z(e,t){return e.sticky==t.sticky&&0==E(e,t)}function I(e){return P(e.line,e.ch)}function R(e,t){return E(e,t)<0?t:e}function B(e,t){return E(e,t)<0?e:t}function G(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function U(e,t){if(t.line<e.first)return P(e.first,0);var r=e.first+e.size-1;return t.line>r?P(r,M(e,r).text.length):V(t,M(e,t.line).text.length)}function V(e,t){var r=e.ch;return null==r||r>t?P(e.line,t):r<0?P(e.line,0):e}function K(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=U(e,t[n]);return r}function j(){$l=!0}function X(){Zl=!0}function Y(e,t,r){this.marker=e,this.from=t,this.to=r}function _(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function q(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function $(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Z(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==l.type&&(!r||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Y(l,o.from,a?null:o.to))}}return n}function Q(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Y(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return n}function J(e,t){if(t.full)return null;var r=H(e,t.from.line)&&M(e,t.from.line).markedSpans,n=H(e,t.to.line)&&M(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==E(t.from,t.to),s=Z(r,i,l),a=Q(n,o,l),u=1==t.text.length,c=g(t.text).length+(u?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=_(a,h.marker);d?u&&(h.to=null==d.to?null:d.to+c):h.to=i}}if(a)for(var p=0;p<a.length;++p){var v=a[p];if(null!=v.to&&(v.to+=c),null==v.from){var m=_(s,v.marker);m||(v.from=c,u&&(s||(s=[])).push(v))}else v.from+=c,u&&(s||(s=[])).push(v)}s&&(s=ee(s)),a&&a!=s&&(a=ee(a));var y=[s];if(!u){var b,w=t.text.length-2;if(w>0&&s)for(var x=0;x<s.length;++x)null==s[x].to&&(b||(b=[])).push(new Y(s[x].marker,null,null));for(var C=0;C<w;++C)y.push(b);y.push(a)}return y}function ee(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function te(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=h(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],s=l.find(0),a=0;a<i.length;++a){var u=i[a];if(!(E(u.to,s.from)<0||E(u.from,s.to)>0)){var c=[a,1],f=E(u.from,s.from),d=E(u.to,s.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:s.from}),(d>0||!l.inclusiveRight&&!d)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),a+=c.length-3}}return i}function re(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function ne(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function ie(e){return e.inclusiveLeft?-1:0}function oe(e){return e.inclusiveRight?1:0}function le(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=E(n.from,i.from)||ie(e)-ie(t);if(o)return-o;var l=E(n.to,i.to)||oe(e)-oe(t);return l||t.id-e.id}function se(e,t){var r,n=Zl&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||le(r,i.marker)<0)&&(r=i.marker);return r}function ae(e){return se(e,!0)}function ue(e){return se(e,!1)}function ce(e,t,r,n,i){var o=M(e,t),l=Zl&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var u=a.marker.find(0),c=E(u.from,r)||ie(a.marker)-ie(i),f=E(u.to,n)||oe(a.marker)-oe(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?E(u.to,r)>=0:E(u.to,r)>0)||c>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?E(u.from,n)<=0:E(u.from,n)<0)))return!0}}}function fe(e){for(var t;t=ae(e);)e=t.find(-1,!0).line;return e}function he(e){for(var t;t=ue(e);)e=t.find(1,!0).line;return e}function de(e){for(var t,r;t=ue(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function pe(e,t){var r=M(e,t),n=fe(r);return r==n?t:W(n)}function ge(e,t){if(t>e.lastLine())return t;var r,n=M(e,t);if(!ve(e,n))return t;for(;r=ue(n);)n=r.find(1,!0).line;return W(n)+1}function ve(e,t){var r=Zl&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&me(e,t,n))return!0}}function me(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return me(e,n.line,_(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&me(e,t,i))return!0}function ye(e){e=fe(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==r)break;t+=s.height}return t}function be(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=ae(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=ue(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function we(e){var t=e.display,r=e.doc;t.maxLine=M(r,r.first),t.maxLineLength=be(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=be(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function xe(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}function Ce(e,t,r){var n;Ql=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Ql=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Ql=i)}return null!=n?n:Ql}function Se(e,t){var r=e.order;return null==r&&(r=e.order=Jl(e.text,t)),r}function Le(e,t){return e._handlers&&e._handlers[t]||es}function ke(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=h(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Te(e,t){var r=Le(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Me(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Te(e,r||t.type,e,t),He(t)||t.codemirrorIgnore}function Ne(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==h(r,t[n])&&r.push(t[n])}function Oe(e,t){return Le(e,t).length>0}function Ae(e){e.prototype.on=function(e,t){ts(this,e,t)},e.prototype.off=function(e,t){ke(this,e,t)}}function We(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function De(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function He(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Fe(e){We(e),De(e)}function Pe(e){return e.target||e.srcElement}function Ee(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),Al&&e.ctrlKey&&1==t&&(t=3),t}function ze(e){if(null==Bl){var t=n("span","​");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Bl=t.offsetWidth<=1&&t.offsetHeight>2&&!(yl&&bl<8))}var i=Bl?n("span","​"):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Ie(e){if(null!=Gl)return Gl;var n=r(e,document.createTextNode("AخA")),i=Fl(n,0,1).getBoundingClientRect(),o=Fl(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Gl=o.right-i.right<3)}function Re(e){if(null!=ls)return ls;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=Fl(t,0,1).getBoundingClientRect();return ls=Math.abs(i.left-o.left)>1}function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ss[e]=t}function Ge(e,t){as[e]=t}function Ue(e){if("string"==typeof e&&as.hasOwnProperty(e))e=as[e];else if(e&&"string"==typeof e.name&&as.hasOwnProperty(e.name)){var t=as[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ue("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ue("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ve(e,t){t=Ue(t);var r=ss[t.name];if(!r)return Ve(e,"text/plain");var n=r(e,t);if(us.hasOwnProperty(t.name)){var i=us[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}function Ke(e,t){c(t,us.hasOwnProperty(e)?us[e]:us[e]={})}function je(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Xe(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ye(e,t,r){return!e.startState||e.startState(t,r)}function _e(e,t,r,n){var i=[e.state.modeGen],o={};rt(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var l=r.state,s=0;s<e.state.overlays.length;++s)!function(n){r.baseTokens=i;var s=e.state.overlays[n],a=1,u=0;r.state=!0,rt(e,t.text,s.mode,r,function(e,t){for(var r=a;u<e;){var n=i[a];n>e&&i.splice(a,1,e,i[a+1],n),a+=2,u=Math.min(e,n)}if(t)if(s.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}},o),r.state=l,r.baseTokens=null,r.baseTokenPos=1}(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function qe(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=$e(e,W(t)),i=t.text.length>e.options.maxHighlightLength&&je(e.doc.mode,n.state),o=_e(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function $e(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new hs(n,!0,t);var o=nt(e,t,r),l=o>n.first&&M(n,o-1).stateAfter,s=l?hs.fromSaved(n,l,o):new hs(n,Ye(n.mode),o);return n.iter(o,t,function(r){Ze(e,r.text,s);var n=s.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?s.save():null,s.nextLine()}),r&&(n.modeFrontier=s.line),s}function Ze(e,t,r,n){var i=e.doc.mode,o=new cs(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&Qe(i,r.state);!o.eol();)Je(i,o,r.state),o.start=o.pos}function Qe(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Xe(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Je(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Xe(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function et(e,t,r,n){var i,o=e.doc,l=o.mode;t=U(o,t);var s,a=M(o,t.line),u=$e(e,t.line,r),c=new cs(a.text,e.options.tabSize,u);for(n&&(s=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Je(l,c,u.state),n&&s.push(new ds(c,i,je(o.mode,u.state)));return n?s:new ds(c,i,u.state)}function tt(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function rt(e,t,r,n,i,o,l){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,u=0,c=null,f=new cs(t,e.options.tabSize,n),h=e.options.addModeClass&&[null];for(""==t&&tt(Qe(r,n.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,l&&Ze(e,t,n,f.pos),f.pos=t.length,a=null):a=tt(Je(r,f,n.state,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||c!=a){for(;u<f.start;)u=Math.min(f.start,u+5e3),i(u,c);c=a}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}function nt(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=M(o,s-1),u=a.stateAfter;if(u&&(!r||s+(u instanceof fs?u.lookAhead:0)<=o.modeFrontier))return s;var c=f(a.text,null,e.options.tabSize);(null==i||n>c)&&(i=s-1,n=c)}return i}function it(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=M(e,n).stateAfter;if(i&&(!(i instanceof fs)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}function ot(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),re(e),ne(e,r);var i=n?n(e):1;i!=e.height&&A(e,i)}function lt(e){e.parent=null,re(e)}function st(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?ms:vs;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function at(e,t){var r=i("span",null,null,wl?"padding-right: .1px":null),n={pre:i("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(yl||wl)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,s=void 0;n.pos=0,n.addToken=ct,Ie(e.display.measure)&&(s=Se(l,e.doc.direction))&&(n.addToken=ht(n.addToken,s)),n.map=[];pt(l,n,qe(e,l,t!=e.display.externalMeasured&&W(l))),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=a(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=a(l.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(ze(e.display.measure))),0==o?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(wl){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Te(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=a(n.pre.className,n.textClass||"")),n}function ut(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ct(e,t,r,i,o,l,s){if(t){var a,u=e.splitSpaces?ft(t,e.trailingSpace):t,c=e.cm.state.specialChars,f=!1;if(c.test(t)){a=document.createDocumentFragment();for(var h=0;;){c.lastIndex=h;var d=c.exec(t),g=d?d.index-h:t.length-h;if(g){var v=document.createTextNode(u.slice(h,h+g));yl&&bl<9?a.appendChild(n("span",[v])):a.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!d)break;h+=g+1;var m=void 0;if("\t"==d[0]){var y=e.cm.options.tabSize,b=y-e.col%y;m=a.appendChild(n("span",p(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==d[0]||"\n"==d[0]?(m=a.appendChild(n("span","\r"==d[0]?"␍":"␤","cm-invalidchar")),m.setAttribute("cm-text",d[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(d[0]),m.setAttribute("cm-text",d[0]),yl&&bl<9?a.appendChild(n("span",[m])):a.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,a=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,a),yl&&bl<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||i||o||f||s){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[a],w,s);return l&&(x.title=l),e.content.appendChild(x)}e.content.appendChild(a)}}function ft(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function ht(e,t){return function(r,n,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var f=void 0,h=0;h<t.length&&(f=t[h],!(f.to>u&&f.from<=u));h++);if(f.to>=c)return e(r,n,i,o,l,s,a);e(r,n.slice(0,f.to-u),i,o,null,s,a),o=null,n=n.slice(f.to-u),u=f.to}}}function dt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function pt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,s,a,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){a=u=c=f=s="",h=null,m=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[w],C=x.marker;"bookmark"==C.type&&x.from==p&&C.widgetNode?y.push(C):x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&!f&&(f=C.title),C.collapsed&&(!h||le(h.marker,C)<0)&&(h=x)):x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==m&&(u+=" "+b[S]);if(!h||h.from==p)for(var L=0;L<y.length;++L)dt(t,0,y[L]);if(h&&(h.from||0)==p){if(dt(t,(null==h.to?d+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=d)break;for(var k=Math.min(d,m);;){if(v){var T=p+v.length;if(!h){var M=T>k?v.slice(0,k-p):v;t.addToken(t,M,l?l+a:a,c,p+M.length==m?u:"",f,s)}if(T>=k){v=v.slice(k-p),p=k;break}p=T,c=""}v=i.slice(o,o=r[g++]),l=st(r[g++],t.cm.options)}}else for(var N=1;N<r.length;N+=2)t.addToken(t,i.slice(o,o=r[N]),st(r[N+1],t.cm.options))}function gt(e,t,r){this.line=t,this.rest=de(t),this.size=this.rest?W(g(this.rest))-r+1:1,this.node=this.text=null,this.hidden=ve(e,t)}function vt(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new gt(e.doc,M(e.doc,o),o);n=o+l.size,i.push(l)}return i}function mt(e){ys?ys.ops.push(e):e.ownsGroup=ys={ops:[e],delayedCallbacks:[]}}function yt(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function bt(e,t){var r=e.ownsGroup;if(r)try{yt(r)}finally{ys=null,t(r)}}function wt(e,t){var r=Le(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);ys?n=ys.delayedCallbacks:bs?n=bs:(n=bs=[],setTimeout(xt,0));for(var o=0;o<r.length;++o)!function(e){n.push(function(){return r[e].apply(null,i)})}(o)}}function xt(){var e=bs;bs=null;for(var t=0;t<e.length;++t)e[t]()}function Ct(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Tt(e,t):"gutter"==o?Nt(e,t,r,n):"class"==o?Mt(e,t):"widget"==o&&Ot(e,t,n)}t.changes=null}function St(e){return e.node==e.text&&(e.node=n("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),yl&&bl<8&&(e.node.style.zIndex=2)),e.node}function Lt(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var i=St(t);t.background=i.insertBefore(n("div",null,r),i.firstChild),e.display.input.setUneditable(t.background)}}function kt(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):at(e,t)}function Tt(e,t){var r=t.text.className,n=kt(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Mt(e,t)):r&&(t.text.className=r)}function Mt(e,t){Lt(e,t),t.line.wrapClass?St(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Nt(e,t,r,i){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var o=St(t);t.gutterBackground=n("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),o.insertBefore(t.gutterBackground,t.text)}var l=t.line.gutterMarkers;if(e.options.lineNumbers||l){var s=St(t),a=t.gutter=n("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),s.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||l&&l["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(n("div",F(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),l)for(var u=0;u<e.options.gutters.length;++u){var c=e.options.gutters[u],f=l.hasOwnProperty(c)&&l[c];f&&a.appendChild(n("div",[f],"CodeMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function Ot(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);Wt(e,t,r)}function At(e,t,r,n){var i=kt(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Mt(e,t),Nt(e,t,r,n),Wt(e,t,n),t.node}function Wt(e,t,r){if(Dt(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Dt(e,t.rest[n],t,r,!1)}function Dt(e,t,r,i,o){if(t.widgets)for(var l=St(r),s=0,a=t.widgets;s<a.length;++s){var u=a[s],c=n("div",[u.node],"CodeMirror-linewidget");u.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Ht(u,c,r,i),e.display.input.setUneditable(c),o&&u.above?l.insertBefore(c,r.gutter||r.text):l.appendChild(c),wt(u,"redraw")}}function Ht(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Ft(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!o(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),r(t.display.measure,n("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Pt(e,t){for(var r=Pe(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Et(e){return e.lineSpace.offsetTop}function zt(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function It(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=r(e.measure,n("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,o={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(o.left)||isNaN(o.right)||(e.cachedPaddingH=o),o}function Rt(e){return Ul-e.display.nativeBarWidth}function Bt(e){return e.display.scroller.clientWidth-Rt(e)-e.display.barWidth}function Gt(e){return e.display.scroller.clientHeight-Rt(e)-e.display.barHeight}function Ut(e,t,r){var n=e.options.lineWrapping,i=n&&Bt(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],u=l[s+1];Math.abs(a.bottom-u.bottom)>2&&o.push((a.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Vt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(W(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Kt(e,t){t=fe(t);var n=W(t),i=e.display.externalMeasured=new gt(e.doc,t,n);i.lineN=n;var o=i.built=at(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function jt(e,t,r,n){return _t(e,Yt(e,t),r,n)}function Xt(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[kr(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Yt(e,t){var r=W(t),n=Xt(e,r);n&&!n.text?n=null:n&&n.changes&&(Ct(e,n,r,wr(e)),e.curOp.forceUpdate=!0),n||(n=Kt(e,t));var i=Vt(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function _t(e,t,r,n,i){t.before&&(r=-1);var o,l=r+(n||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ut(e,t.view,t.rect),t.hasHeights=!0),o=Zt(e,t,r,n),o.bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function qt(e,t,r){for(var n,i,o,l,s,a,u=0;u<e.length;u+=3)if(s=e[u],a=e[u+1],t<s?(i=0,o=1,l="left"):t<a?(i=t-s,o=i+1):(u==e.length-3||t==a&&e[u+3]>t)&&(o=a-s,i=o-1,t>=a&&(l="right")),null!=i){if(n=e[u+2],s==a&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],l="left";if("right"==r&&i==a-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function $t(e,t){var r=ws;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Zt(e,t,r,n){
2
+ var i,o=qt(t.map,r,n),l=o.node,s=o.start,a=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;c<4;c++){for(;s&&S(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a<o.coverEnd&&S(t.line.text.charAt(o.coverStart+a));)++a;if(i=yl&&bl<9&&0==s&&a==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():$t(Fl(l,s,a).getClientRects(),n),i.left||i.right||0==s)break;a=s,s-=1,u="right"}yl&&bl<11&&(i=Qt(e.display.measure,i))}else{s>0&&(u=n="right");var f;i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(yl&&bl<9&&!s&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+br(e.display),top:h.top,bottom:h.bottom}:ws}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,m=0;m<v.length-1&&!(g<v[m]);m++);var y=m?v[m-1]:0,b=v[m],w={left:("right"==u?i.right:i.left)-t.rect.left,right:("left"==u?i.left:i.right)-t.rect.left,top:y,bottom:b};return i.left||i.right||(w.bogus=!0),e.options.singleCursorHeightPerLine||(w.rtop=d,w.rbottom=p),w}function Qt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Re(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function Jt(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function er(e){e.display.externalMeasure=null,t(e.display.lineMeasure);for(var r=0;r<e.display.view.length;r++)Jt(e.display.view[r])}function tr(e){er(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function rr(){return Cl&&Nl?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function nr(){return Cl&&Nl?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ir(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Ft(e.widgets[r]));return t}function or(e,t,r,n,i){if(!i){var o=ir(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=ye(t);if("local"==n?l+=Et(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==n?0:nr());var a=s.left+("window"==n?0:rr());r.left+=a,r.right+=a}return r.top+=l,r.bottom+=l,r}function lr(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=rr(),i-=nr();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function sr(e,t,r,n,i){return n||(n=M(e.doc,t.line)),or(e,n,jt(e,n,t.ch,i),r)}function ar(e,t,r,n,i,o){function l(t,l){var s=_t(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,or(e,n,s,r)}function s(e,t,r){var n=a[t],i=1==n.level;return l(r?e-1:e,i!=r)}n=n||M(e.doc,t.line),i||(i=Yt(e,n));var a=Se(n,e.doc.direction),u=t.ch,c=t.sticky;if(u>=n.text.length?(u=n.text.length,c="before"):u<=0&&(u=0,c="after"),!a)return l("before"==c?u-1:u,"before"==c);var f=Ce(a,u,c),h=Ql,d=s(u,f,"before"==c);return null!=h&&(d.other=s(u,h,"before"!=c)),d}function ur(e,t){var r=0;t=U(e.doc,t),e.options.lineWrapping||(r=br(e.display)*t.ch);var n=M(e.doc,t.line),i=ye(n)+Et(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function cr(e,t,r,n,i){var o=P(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function fr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return cr(n.first,0,null,!0,-1);var i=D(n,r),o=n.first+n.size-1;if(i>o)return cr(n.first+n.size-1,M(n,o).text.length,null,!0,1);t<0&&(t=0);for(var l=M(n,i);;){var s=gr(e,l,i,t,r),a=ue(l),u=a&&a.find(0,!0);if(!a||!(s.ch>u.from.ch||s.ch==u.from.ch&&s.xRel>0))return s;i=W(l=u.to.line)}}function hr(e,t,r,n){n-=ir(t);var i=t.text.length,o=k(function(t){return _t(e,r,t-1).bottom<=n},i,0);return i=k(function(t){return _t(e,r,t).top>n},o,i),{begin:o,end:i}}function dr(e,t,r,n){return r||(r=Yt(e,t)),hr(e,t,r,or(e,t,_t(e,r,n),"line").top)}function pr(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function gr(e,t,r,n,i){i-=ye(t);var o=Yt(e,t),l=ir(t),s=0,a=t.text.length,u=!0,c=Se(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?mr:vr)(e,t,r,o,c,n,i);u=1!=f.level,s=u?f.from:f.to-1,a=u?f.to:f.from-1}var h,d,p=null,g=null,v=k(function(t){var r=_t(e,o,t);return r.top+=l,r.bottom+=l,!!pr(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)},s,a),m=!1;if(g){var y=n-g.left<g.right-n,b=y==u;v=p+(b?0:1),d=b?"after":"before",h=y?g.left:g.right}else{u||v!=a&&v!=s||v++,d=0==v?"after":v==t.text.length?"before":_t(e,o,v-(u?1:0)).bottom+l<=i==u?"after":"before";var w=ar(e,P(r,v,d),"line",t,o);h=w.left,m=i<w.top||i>=w.bottom}return v=L(t.text,v,1),cr(r,v,d,m,n-h)}function vr(e,t,r,n,i,o,l){var s=k(function(s){var a=i[s],u=1!=a.level;return pr(ar(e,P(r,u?a.to:a.from,u?"before":"after"),"line",t,n),o,l,!0)},0,i.length-1),a=i[s];if(s>0){var u=1!=a.level,c=ar(e,P(r,u?a.from:a.to,u?"after":"before"),"line",t,n);pr(c,o,l,!0)&&c.top>l&&(a=i[s-1])}return a}function mr(e,t,r,n,i,o,l){var s=hr(e,t,n,l),a=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=u||d.to<=a)){var p=1!=d.level,g=_t(e,n,p?Math.min(u,d.to)-1:Math.max(a,d.from)).right,v=g<o?o-g+1e9:g-o;(!c||f>v)&&(c=d,f=v)}}return c||(c=i[i.length-1]),c.from<a&&(c={from:a,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function yr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==gs){gs=n("pre");for(var i=0;i<49;++i)gs.appendChild(document.createTextNode("x")),gs.appendChild(n("br"));gs.appendChild(document.createTextNode("x"))}r(e.measure,gs);var o=gs.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function br(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),l=(o.right-o.left)/10;return l>2&&(e.cachedCharWidth=l),l||10}function wr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:xr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function xr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Cr(e){var t=yr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/br(e.display)-3);return function(i){if(ve(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function Sr(e){var t=e.doc,r=Cr(e);t.iter(function(e){var t=r(e);t!=e.height&&A(e,t)})}function Lr(e,t,r,n){var i=e.display;if(!r&&"true"==Pe(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,u=fr(e,o,l);if(n&&1==u.xRel&&(a=M(e.doc,u.line).text).length==u.ch){var c=f(a,a.length,e.options.tabSize)-a.length;u=P(u.line,Math.max(0,Math.round((o-It(e.display).left)/br(e.display))-c))}return u}function kr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function Tr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Mr(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var s=r.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var a=s.empty();(a||e.options.showCursorWhenSelecting)&&Nr(e,s.head,i),a||Ar(e,s,o)}}return n}function Nr(e,t,r){var i=ar(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(n("div"," ","CodeMirror-cursor"));if(o.style.left=i.left+"px",o.style.top=i.top+"px",o.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var l=r.appendChild(n("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=i.other.left+"px",l.style.top=i.other.top+"px",l.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function Or(e,t){return e.top-t.top||e.left-t.left}function Ar(e,t,r){function i(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),a.appendChild(n("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?f-e:r)+"px;\n height: "+(i-t)+"px"))}function o(t,r,n){function o(r,n){return sr(e,P(t,r),"div",d,n)}function l(t,r,n){var i=dr(e,d,null,t),l="ltr"==r==("after"==n)?"left":"right";return o("after"==n?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1),l)[l]}var a,u,d=M(s,t),p=d.text.length,g=Se(d,s.direction);return xe(g,r||0,null==n?p:n,function(e,t,s,d){var v="ltr"==s,m=o(e,v?"left":"right"),y=o(t-1,v?"right":"left"),b=null==r&&0==e,w=null==n&&t==p,x=0==d,C=!g||d==g.length-1;if(y.top-m.top<=3){var S=(h?b:w)&&x,L=(h?w:b)&&C,k=S?c:(v?m:y).left,T=L?f:(v?y:m).right;i(k,m.top,T-k,m.bottom)}else{var M,N,O,A;v?(M=h&&b&&x?c:m.left,N=h?f:l(e,s,"before"),O=h?c:l(t,s,"after"),A=h&&w&&C?f:y.right):(M=h?l(e,s,"before"):c,N=!h&&b&&x?f:m.right,O=!h&&w&&C?c:y.left,A=h?l(t,s,"after"):f),i(M,m.top,N-M,m.bottom),m.bottom<y.top&&i(c,m.bottom,null,y.top),i(O,y.top,A-O,y.bottom)}(!a||Or(m,a)<0)&&(a=m),Or(y,a)<0&&(a=y),(!u||Or(m,u)<0)&&(u=m),Or(y,u)<0&&(u=y)}),{start:a,end:u}}var l=e.display,s=e.doc,a=document.createDocumentFragment(),u=It(e.display),c=u.left,f=Math.max(l.sizerWidth,Bt(e)-l.sizer.offsetLeft)-u.right,h="ltr"==s.direction,d=t.from(),p=t.to();if(d.line==p.line)o(d.line,d.ch,p.ch);else{var g=M(s,d.line),v=M(s,p.line),m=fe(g)==fe(v),y=o(d.line,d.ch,m?g.text.length+1:null).end,b=o(p.line,m?0:null,p.ch).start;m&&(y.top<b.top-2?(i(y.right,y.top,null,y.bottom),i(c,b.top,b.left,b.bottom)):i(y.right,y.top,b.left-y.right,y.bottom)),y.bottom<b.top&&i(c,y.bottom,null,b.top)}r.appendChild(a)}function Wr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Dr(e){e.state.focused||(e.display.input.focus(),Fr(e))}function Hr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Pr(e))},100)}function Fr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Te(e,"focus",e,t),e.state.focused=!0,s(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),wl&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wr(e))}function Pr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Te(e,"blur",e,t),e.state.focused=!1,zl(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Er(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=void 0;if(!i.hidden){if(yl&&bl<8){var l=i.node.offsetTop+i.node.offsetHeight;o=l-r,r=l}else{var s=i.node.getBoundingClientRect();o=s.bottom-s.top}var a=i.line.height-o;if(o<2&&(o=yr(t)),(a>.005||a<-.005)&&(A(i.line,o),zr(i.line),i.rest))for(var u=0;u<i.rest.length;u++)zr(i.rest[u])}}}function zr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Ir(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Et(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=D(t,n),l=D(t,i);if(r&&r.ensure){var s=r.ensure.from.line,a=r.ensure.to.line;s<o?(o=s,l=D(t,ye(M(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=D(t,ye(M(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function Rr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=xr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var s=r[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Br(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=F(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var o=i.measure.appendChild(n("div",[n("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),l=o.firstChild.offsetWidth,s=o.offsetWidth-l;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(l,i.lineGutter.offsetWidth-s)+1,i.lineNumWidth=i.lineNumInnerWidth+s,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Dn(e),!0}return!1}function Gr(e,t){if(!Me(e,"scrollCursorIntoView")){var r=e.display,i=r.sizer.getBoundingClientRect(),o=null;if(t.top+i.top<0?o=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!Tl){var l=n("div","​",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Et(e.display))+"px;\n height: "+(t.bottom-t.top+Rt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(o),e.display.lineSpace.removeChild(l)}}}function Ur(e,t,r,n){null==n&&(n=0);var i;e.options.lineWrapping||t!=r||(t=t.ch?P(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,r="before"==t.sticky?P(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,s=ar(e,t),a=r&&r!=t?ar(e,r):s;i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-n,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+n};var u=Kr(e,i),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(Zr(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(Jr(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}function Vr(e,t){var r=Kr(e,t);null!=r.scrollTop&&Zr(e,r.scrollTop),null!=r.scrollLeft&&Jr(e,r.scrollLeft)}function Kr(e,t){var r=e.display,n=yr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Gt(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+zt(r),a=t.top<n,u=t.bottom>s-n;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?s:t.bottom)-o);c!=i&&(l.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,h=Bt(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),d=t.right-t.left>h;return d&&(t.right=t.left+h),t.left<10?l.scrollLeft=0:t.left<f?l.scrollLeft=Math.max(0,t.left-(d?0:10)):t.right>h+f-3&&(l.scrollLeft=t.right+(d?0:10)-h),l}function jr(e,t){null!=t&&(qr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Xr(e){qr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Yr(e,t,r){null==t&&null==r||qr(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function _r(e,t){qr(e),e.curOp.scrollToPos=t}function qr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;$r(e,ur(e,t.from),ur(e,t.to),t.margin)}}function $r(e,t,r,n){var i=Kr(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Yr(e,i.scrollLeft,i.scrollTop)}function Zr(e,t){Math.abs(e.doc.scrollTop-t)<2||(pl||An(e,{top:t}),Qr(e,t,!0),pl&&An(e),Sn(e,100))}function Qr(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Jr(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Rr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function en(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+zt(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Rt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function tn(e,t){t||(t=en(e));var r=e.display.barWidth,n=e.display.barHeight;rn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Er(e),rn(e,en(e)),r=e.display.barWidth,n=e.display.barHeight}function rn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function nn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&zl(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ss[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ts(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Jr(e,t):Zr(e,t)},e),e.display.scrollbars.addClass&&s(e.display.wrapper,e.display.scrollbars.addClass)}function on(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ls},mt(e.curOp)}function ln(e){bt(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;sn(e)})}function sn(e){for(var t=e.ops,r=0;r<t.length;r++)an(t[r]);for(var n=0;n<t.length;n++)un(t[n]);for(var i=0;i<t.length;i++)cn(t[i]);for(var o=0;o<t.length;o++)fn(t[o]);for(var l=0;l<t.length;l++)hn(t[l])}function an(e){var t=e.cm,r=t.display;kn(t),e.updateMaxLine&&we(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ks(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function un(e){e.updatedDisplay=e.mustUpdate&&Nn(e.cm,e.update)}function cn(e){var t=e.cm,r=t.display;e.updatedDisplay&&Er(t),e.barMeasure=en(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=jt(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Rt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Bt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function fn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Jr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==l();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&tn(t,e.barMeasure),e.updatedDisplay&&Hn(t,e.barMeasure),e.selectionChanged&&Wr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&Dr(e.cm)}function hn(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&On(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&Qr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Jr(t,e.scrollLeft,!0,!0),e.scrollToPos){Gr(t,Ur(t,U(n,e.scrollToPos.from),U(n,e.scrollToPos.to),e.scrollToPos.margin))}var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||Te(i[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&Te(o[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Te(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function dn(e,t){if(e.curOp)return t();on(e);try{return t()}finally{ln(e)}}function pn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);on(e);try{return t.apply(e,arguments)}finally{ln(e)}}}function gn(e){return function(){if(this.curOp)return e.apply(this,arguments);on(this);try{return e.apply(this,arguments)}finally{ln(this)}}}function vn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);on(t);try{return e.apply(this,arguments)}finally{ln(t)}}}function mn(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Zl&&pe(e.doc,t)<i.viewTo&&bn(e);else if(r<=i.viewFrom)Zl&&ge(e.doc,r+n)>i.viewFrom?bn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)bn(e);else if(t<=i.viewFrom){var o=wn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):bn(e)}else if(r>=i.viewTo){var l=wn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):bn(e)}else{var s=wn(e,t,t,-1),a=wn(e,r,r+n,1);s&&a?(i.view=i.view.slice(0,s.index).concat(vt(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=n):bn(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function yn(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[kr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==h(l,r)&&l.push(r)}}}function bn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function wn(e,t,r,n){var i,o=kr(e,t),l=e.display.view;if(!Zl||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(n>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,r+=i}for(;pe(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function xn(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=vt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=vt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(kr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(vt(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,kr(e,r)))),n.viewTo=r}function Cn(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function Sn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,u(Ln,e))}function Ln(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=$e(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(n.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?je(t.mode,n.state):null,a=_e(e,o,n,!0);s&&(n.state=s),o.styles=a.styles;var u=o.styleClasses,c=a.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!f&&h<l.length;++h)f=l[h]!=o.styles[h];f&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Ze(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return Sn(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&dn(e,function(){for(var t=0;t<i.length;t++)yn(e,i[t],"text")})}}function kn(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Rt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Rt(e)+"px",t.scrollbarsClipped=!0)}function Tn(e){if(e.hasFocus())return null;var t=l();if(!t||!o(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&o(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function Mn(e){if(e&&e.activeElt&&e.activeElt!=l()&&(e.activeElt.focus(),e.anchorNode&&o(document.body,e.anchorNode)&&o(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function Nn(e,r){var n=e.display,i=e.doc;if(r.editorIsHidden)return bn(e),!1;if(!r.force&&r.visible.from>=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Cn(e))return!1;Br(e)&&(bn(e),r.dims=wr(e));var o=i.first+i.size,l=Math.max(r.visible.from-e.options.viewportMargin,i.first),s=Math.min(o,r.visible.to+e.options.viewportMargin);n.viewFrom<l&&l-n.viewFrom<20&&(l=Math.max(i.first,n.viewFrom)),n.viewTo>s&&n.viewTo-s<20&&(s=Math.min(o,n.viewTo)),Zl&&(l=pe(e.doc,l),s=ge(e.doc,s));var a=l!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;xn(e,l,s),n.viewOffset=ye(M(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=Cn(e);if(!a&&0==u&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Tn(e);return u>4&&(n.lineDiv.style.display="none"),Wn(e,n.updateLineNumbers,r.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Mn(c),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,a&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,Sn(e,400)),n.updateLineNumbers=null,!0}function On(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Bt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+zt(e.display)-Gt(e),r.top)}),t.visible=Ir(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Nn(e,t);n=!1){Er(e);var i=en(e);Tr(e),tn(e,i),Hn(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function An(e,t){var r=new ks(e,t);if(Nn(e,r)){Er(e),On(e,r);var n=en(e);Tr(e),tn(e,n),Hn(e,n),r.finish()}}function Wn(e,r,n){function i(t){var r=t.nextSibling;return wl&&Al&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,l=e.options.lineNumbers,s=o.lineDiv,a=s.firstChild,u=o.view,c=o.viewFrom,f=0;f<u.length;f++){var d=u[f];if(d.hidden);else if(d.node&&d.node.parentNode==s){for(;a!=d.node;)a=i(a);var p=l&&null!=r&&r<=c&&d.lineNumber;d.changes&&(h(d.changes,"gutter")>-1&&(p=!1),Ct(e,d,c,n)),p&&(t(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(F(e.options,c)))),a=d.node.nextSibling}else{var g=At(e,d,c,n);s.insertBefore(g,a)}c+=d.size}for(;a;)a=i(a)}function Dn(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Hn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Rt(e)+"px"}function Fn(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o<i.length;++o){var l=i[o],s=r.appendChild(n("div",null,"CodeMirror-gutter "+l));"CodeMirror-linenumbers"==l&&(e.display.lineGutter=s,s.style.width=(e.display.lineNumWidth||1)+"px")}r.style.display=o?"":"none",Dn(e)}function Pn(e){var t=h(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function En(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function zn(e){var t=En(e);return t.x*=Ms,t.y*=Ms,t}function In(e,t){var r=En(t),n=r.x,i=r.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,a=l.scrollHeight>l.clientHeight;if(n&&s||i&&a){if(i&&Al&&wl)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var f=0;f<c.length;f++)if(c[f].node==u){e.display.currentWheelTarget=u;break e}if(n&&!pl&&!Sl&&null!=Ms)return i&&a&&Zr(e,Math.max(0,l.scrollTop+i*Ms)),Jr(e,Math.max(0,l.scrollLeft+n*Ms)),(!i||i&&a)&&We(t),void(o.wheelStartX=null);if(i&&null!=Ms){var h=i*Ms,d=e.doc.scrollTop,p=d+o.wrapper.clientHeight;h<0?d=Math.max(0,d+h-50):p=Math.min(e.doc.height,p+h+50),An(e,{top:d,bottom:p})}Ts<20&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=l.scrollLeft-o.wheelStartX,t=l.scrollTop-o.wheelStartY,r=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,r&&(Ms=(Ms*Ts+r)/(Ts+1),++Ts)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}function Rn(e,t){var r=e[t];e.sort(function(e,t){return E(e.from(),t.from())}),t=h(e,r);for(var n=1;n<e.length;n++){var i=e[n],o=e[n-1];if(E(o.to(),i.from())>=0){var l=B(o.from(),i.from()),s=R(o.to(),i.to()),a=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new Os(a?s:l,a?l:s))}}return new Ns(e,t)}function Bn(e,t){return new Ns([new Os(e,t||e)],0)}function Gn(e){return e.text?P(e.from.line+e.text.length-1,g(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Un(e,t){if(E(e,t.from)<0)return e;if(E(e,t.to)<=0)return Gn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Gn(t).ch-t.to.ch),P(r,n)}function Vn(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Os(Un(i.anchor,t),Un(i.head,t)))}return Rn(r,e.sel.primIndex)}function Kn(e,t,r){return e.line==t.line?P(r.line,e.ch-t.ch+r.ch):P(r.line+(e.line-t.line),e.ch)}function jn(e,t,r){for(var n=[],i=P(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Kn(s.from,i,o),u=Kn(Gn(s),i,o);if(i=s.to,o=u,"around"==r){var c=e.sel.ranges[l],f=E(c.head,c.anchor)<0;n[l]=new Os(f?u:a,f?a:u)}else n[l]=new Os(a,a)}return new Ns(n,e.sel.primIndex)}function Xn(e){e.doc.mode=Ve(e.options,e.doc.modeOption),Yn(e)}function Yn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),
3
+ e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Sn(e,100),e.state.modeGen++,e.curOp&&mn(e)}function _n(e,t){return 0==t.from.ch&&0==t.to.ch&&""==g(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function qn(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){ot(e,r,i,n),wt(e,"change",e,t)}function l(e,t){for(var r=[],o=e;o<t;++o)r.push(new ps(u[o],i(o),n));return r}var s=t.from,a=t.to,u=t.text,c=M(e,s.line),f=M(e,a.line),h=g(u),d=i(u.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(_n(e,t)){var v=l(0,u.length-1);o(f,f.text,d),p&&e.remove(s.line,p),v.length&&e.insert(s.line,v)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,s.ch)+h+c.text.slice(a.ch),d);else{var m=l(1,u.length-1);m.push(new ps(h+c.text.slice(a.ch),d,n)),o(c,c.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,m)}else if(1==u.length)o(c,c.text.slice(0,s.ch)+u[0]+f.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(c,c.text.slice(0,s.ch)+u[0],i(0)),o(f,h+f.text.slice(a.ch),d);var y=l(1,u.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,y)}wt(e,"change",e,t)}function $n(e,t,r){function n(e,i,o){if(e.linked)for(var l=0;l<e.linked.length;++l){var s=e.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;r&&!a||(t(s.doc,a),n(s.doc,e,a))}}}n(e,null,!0)}function Zn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Sr(e),Xn(e),Qn(e),e.options.lineWrapping||we(e),e.options.mode=t.modeOption,mn(e)}function Qn(e){("rtl"==e.doc.direction?s:zl)(e.display.lineDiv,"CodeMirror-rtl")}function Jn(e){dn(e,function(){Qn(e),mn(e)})}function ei(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function ti(e,t){var r={from:I(t.from),to:Gn(t),text:N(e,t.from,t.to)};return ai(e,r,t.from.line,t.to.line+1),$n(e,function(e){return ai(e,r,t.from.line,t.to.line+1)},!0),r}function ri(e){for(;e.length;){if(!g(e).ranges)break;e.pop()}}function ni(e,t){return t?(ri(e.done),g(e.done)):e.done.length&&!g(e.done).ranges?g(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),g(e.done)):void 0}function ii(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ni(i,i.lastOp==n)))l=g(o.changes),0==E(t.from,t.to)&&0==E(t.from,l.to)?l.to=Gn(t):o.changes.push(ti(e,t));else{var a=g(i.done);for(a&&a.ranges||si(e.sel,i.done),o={changes:[ti(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||Te(e,"historyAdded")}function oi(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function li(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||oi(e,o,g(i.done),t))?i.done[i.done.length-1]=t:si(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&ri(i.undone)}function si(e,t){var r=g(t);r&&r.ranges&&r.equals(e)||t.push(e)}function ai(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function ui(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ci(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(ui(r[i]));return n}function fi(e,t){var r=ci(e,t),n=J(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],u=0;u<o.length;++u)if(o[u].marker==a.marker)continue e;o.push(a)}else l&&(r[i]=l)}return r}function hi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?Ns.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];n.push({changes:s});for(var a=0;a<l.length;++a){var u=l[a],c=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&h(t,Number(c[1]))>-1&&(g(s)[f]=u[f],delete u[f])}}}return n}function di(e,t,r,n){if(n){var i=e.anchor;if(r){var o=E(t,i)<0;o!=E(r,i)<0?(i=t,t=r):o!=E(t,r)<0&&(t=r)}return new Os(i,t)}return new Os(r||t,t)}function pi(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),wi(e,new Ns([di(e.sel.primary(),t,r,i)],0),n)}function gi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=di(e.sel.ranges[o],t[o],null,i);wi(e,Rn(n,e.sel.primIndex),r)}function vi(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,wi(e,Rn(i,e.sel.primIndex),n)}function mi(e,t,r,n){wi(e,Bn(t,r),n)}function yi(e,t,r){var n={ranges:t.ranges,update:function(t){var r=this;this.ranges=[];for(var n=0;n<t.length;n++)r.ranges[n]=new Os(U(e,t[n].anchor),U(e,t[n].head))},origin:r&&r.origin};return Te(e,"beforeSelectionChange",e,n),e.cm&&Te(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Rn(n.ranges,n.ranges.length-1):t}function bi(e,t,r){var n=e.history.done,i=g(n);i&&i.ranges?(n[n.length-1]=t,xi(e,t,r)):wi(e,t,r)}function wi(e,t,r){xi(e,t,r),li(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function xi(e,t,r){(Oe(e,"beforeSelectionChange")||e.cm&&Oe(e.cm,"beforeSelectionChange"))&&(t=yi(e,t,r)),Ci(e,Li(e,t,r&&r.bias||(E(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),r&&!1===r.scroll||!e.cm||Xr(e.cm)}function Ci(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Ne(e.cm)),wt(e,"cursorActivity",e))}function Si(e){Ci(e,Li(e,e.sel,null,!1))}function Li(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=Ti(e,l.anchor,s&&s.anchor,r,n),u=Ti(e,l.head,s&&s.head,r,n);(i||a!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Os(a,u))}return i?Rn(i,t.primIndex):t}function ki(e,t,r,n,i){var o=M(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker;if((null==s.from||(a.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(a.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(Te(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(r){var u=a.find(n<0?1:-1),c=void 0;if((n<0?a.inclusiveRight:a.inclusiveLeft)&&(u=Mi(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=E(u,r))&&(n<0?c<0:c>0))return ki(e,u,t,n,i)}var f=a.find(n<0?-1:1);return(n<0?a.inclusiveLeft:a.inclusiveRight)&&(f=Mi(e,f,n,f.line==t.line?o:null)),f?ki(e,f,t,n,i):null}}return t}function Ti(e,t,r,n,i){var o=n||1,l=ki(e,t,r,o,i)||!i&&ki(e,t,r,o,!0)||ki(e,t,r,-o,i)||!i&&ki(e,t,r,-o,!0);return l||(e.cantEdit=!0,P(e.first,0))}function Mi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?U(e,P(t.line-1)):null:r>0&&t.ch==(n||M(e,t.line)).text.length?t.line<e.first+e.size-1?P(t.line+1,0):null:new P(t.line,t.ch+r)}function Ni(e){e.setSelection(P(e.firstLine(),0),P(e.lastLine()),Kl)}function Oi(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=U(e,t)),r&&(n.to=U(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),Te(e,"beforeChange",e,n),e.cm&&Te(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Ai(e,t,r){if(e.cm){if(!e.cm.curOp)return pn(e.cm,Ai)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Oe(e,"beforeChange")||e.cm&&Oe(e.cm,"beforeChange"))||(t=Oi(e,t,!0))){var n=$l&&!r&&te(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Wi(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Wi(e,t)}}function Wi(e,t){if(1!=t.text.length||""!=t.text[0]||0!=E(t.from,t.to)){var r=Vn(e,t);ii(e,t,r,e.cm?e.cm.curOp.id:NaN),Fi(e,t,r,J(e,t));var n=[];$n(e,function(e,r){r||-1!=h(n,e.history)||(Ri(e.history,t),n.push(e.history)),Fi(e,t,null,J(e,t))})}}function Di(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a<l.length&&(n=l[a],r?!n.ranges||n.equals(e.sel):n.ranges);a++);if(a!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;n=l.pop(),n.ranges;){if(si(n,s),r&&!n.equals(e.sel))return void wi(e,n,{clearRedo:!1});o=n}var u=[];si(o,s),s.push({changes:u,generation:i.generation}),i.generation=n.generation||++i.maxGeneration;for(var c=Oe(e,"beforeChange")||e.cm&&Oe(e.cm,"beforeChange"),f=n.changes.length-1;f>=0;--f){var d=function(r){var i=n.changes[r];if(i.origin=t,c&&!Oi(e,i,!1))return l.length=0,{};u.push(ti(e,i));var o=r?Vn(e,i):g(l);Fi(e,i,o,fi(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Gn(i)});var s=[];$n(e,function(e,t){t||-1!=h(s,e.history)||(Ri(e.history,i),s.push(e.history)),Fi(e,i,null,fi(e,i))})}(f);if(d)return d.v}}}}function Hi(e,t){if(0!=t&&(e.first+=t,e.sel=new Ns(v(e.sel.ranges,function(e){return new Os(P(e.anchor.line+t,e.anchor.ch),P(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){mn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)yn(e.cm,n,"gutter")}}function Fi(e,t,r,n){if(e.cm&&!e.cm.curOp)return pn(e.cm,Fi)(e,t,r,n);if(t.to.line<e.first)return void Hi(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Hi(e,i),t={from:P(e.first,0),to:P(t.to.line+i,t.to.ch),text:[g(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:P(o,M(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=N(e,t.from,t.to),r||(r=Vn(e,t)),e.cm?Pi(e.cm,t,n):qn(e,t,n),xi(e,r,Kl)}}function Pi(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=W(fe(M(n,o.line))),n.iter(a,l.line+1,function(e){if(e==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ne(e),qn(n,t,r,Cr(e)),e.options.lineWrapping||(n.iter(a,o.line+t.text.length,function(e){var t=be(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),it(n,o.line),Sn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?mn(e):o.line!=l.line||1!=t.text.length||_n(e.doc,t)?mn(e,o.line,l.line+1,u):yn(e,o.line,"text");var c=Oe(e,"changes"),f=Oe(e,"change");if(f||c){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&wt(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Ei(e,t,r,n,i){if(n||(n=r),E(n,r)<0){var o;o=[n,r],r=o[0],n=o[1]}"string"==typeof t&&(t=e.splitLines(t)),Ai(e,{from:r,to:n,text:t,origin:i})}function zi(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Ii(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)zi(o.ranges[s].anchor,t,r,n),zi(o.ranges[s].head,t,r,n)}else{for(var a=0;a<o.changes.length;++a){var u=o.changes[a];if(r<u.from.line)u.from=P(u.from.line+n,u.from.ch),u.to=P(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function Ri(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Ii(e.done,r,n,i),Ii(e.undone,r,n,i)}function Bi(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=M(e,G(e,t)):i=W(t),null==i?null:(n(o,i)&&e.cm&&yn(e.cm,i,r),o)}function Gi(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r}function Ui(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null}function Vi(e,t,r){ye(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&jr(e,r)}function Ki(e,t,r,n){var i=new As(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Bi(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ve(e,t)){var n=ye(t)<e.scrollTop;A(t,t.height+Ft(i)),n&&jr(o,i.height),o.curOp.forceUpdate=!0}return!0}),wt(o,"lineWidgetAdded",o,i,"number"==typeof t?t:W(t)),i}function ji(e,t,r,n,o){if(n&&n.shared)return Xi(e,t,r,n,o);if(e.cm&&!e.cm.curOp)return pn(e.cm,ji)(e,t,r,n,o);var l=new Ds(e,o),s=E(t,r);if(n&&c(n,l,!1),s>0||0==s&&!1!==l.clearWhenEmpty)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=i("span",[l.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ce(e,t.line,t,r,l)||t.line!=r.line&&ce(e,r.line,t,r,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");X()}l.addToHistory&&ii(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var a,u=t.line,f=e.cm;if(e.iter(u,r.line+1,function(e){f&&l.collapsed&&!f.options.lineWrapping&&fe(e)==f.display.maxLine&&(a=!0),l.collapsed&&u!=t.line&&A(e,0),$(e,new Y(l,u==t.line?t.ch:null,u==r.line?r.ch:null)),++u}),l.collapsed&&e.iter(t.line,r.line+1,function(t){ve(e,t)&&A(t,0)}),l.clearOnEnter&&ts(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(j(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++Ws,l.atomic=!0),f){if(a&&(f.curOp.updateMaxLine=!0),l.collapsed)mn(f,t.line,r.line+1);else if(l.className||l.title||l.startStyle||l.endStyle||l.css)for(var h=t.line;h<=r.line;h++)yn(f,h,"text");l.atomic&&Si(f.doc),wt(f,"markerAdded",f,l)}return l}function Xi(e,t,r,n,i){n=c(n),n.shared=!1;var o=[ji(e,t,r,n,i)],l=o[0],s=n.widgetNode;return $n(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),o.push(ji(e,U(e,t),U(e,r),n,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=g(o)}),new Hs(o,l)}function Yi(e){return e.findMarks(P(e.first,0),e.clipPos(P(e.lastLine())),function(e){return e.parent})}function _i(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(E(o,l)){var s=ji(e,o,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function qi(e){for(var t=0;t<e.length;t++)!function(t){var r=e[t],n=[r.primary.doc];$n(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==h(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}}(t)}function $i(e){var t=this;if(Ji(t),!Me(t,e)&&!Pt(t.display,e)){We(e),yl&&(Es=+new Date);var r=Lr(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,s=0;s<i;++s)!function(e,n){if(!t.options.allowDropFileTypes||-1!=h(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=pn(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++l==i){r=U(t.doc,r);var a={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Ai(t.doc,a),bi(t.doc,Bn(r,Gn(a)))}}),s.readAsText(e)}}(n[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var a=e.dataTransfer.getData("Text");if(a){var u;if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),xi(t.doc,Bn(r,r)),u)for(var c=0;c<u.length;++c)Ei(t.doc,"",u[c].anchor,u[c].head,"drag");t.replaceSelection(a,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Zi(e,t){if(yl&&(!e.state.draggingText||+new Date-Es<100))return void Fe(t);if(!Me(e,t)&&!Pt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Ll)){var r=n("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Sl&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),Sl&&r.parentNode.removeChild(r)}}function Qi(e,t){var i=Lr(e,t);if(i){var o=document.createDocumentFragment();Nr(e,i,o),e.display.dragCursor||(e.display.dragCursor=n("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),r(e.display.dragCursor,o)}}function Ji(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function eo(e){if(document.getElementsByClassName)for(var t=document.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function to(){zs||(ro(),zs=!0)}function ro(){var e;ts(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,eo(no)},100))}),ts(window,"blur",function(){return eo(Pr)})}function no(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function io(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,l=0;l<t.length-1;l++){var s=t[l];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function oo(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=v(r.split(" "),io),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,o+1).join(" "),l="...");var a=t[s];if(a){if(a!=l)throw new Error("Inconsistent bindings for "+s)}else t[s]=l}delete e[r]}for(var u in t)e[u]=t[u];return e}function lo(e,t,r,n){t=co(t);var i=t.call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return lo(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=lo(e,t.fallthrough[o],r,n);if(l)return l}}}function so(e){var t="string"==typeof e?e:Is[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function ao(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(Pl?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(Pl?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function uo(e,t){if(Sl&&34==e.keyCode&&e.char)return!1;var r=Is[e.keyCode];return null!=r&&!e.altGraphKey&&ao(r,e,t)}function co(e){return"string"==typeof e?Us[e]:e}function fo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&E(o.from,g(n).to)<=0;){var l=n.pop();if(E(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}dn(e,function(){for(var t=n.length-1;t>=0;t--)Ei(e.doc,"",n[t].from,n[t].to,"+delete");Xr(e)})}function ho(e,t,r){var n=L(e.text,t+r,r);return n<0||n>e.text.length?null:n}function po(e,t,r){var n=ho(e,t.ch,r);return null==n?null:new P(t.line,n,r<0?"after":"before")}function go(e,t,r,n,i){if(e){var o=Se(r,t.doc.direction);if(o){var l,s=i<0?g(o):o[0],a=i<0==(1==s.level),u=a?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Yt(t,r);l=i<0?r.text.length-1:0;var f=_t(t,c,l).top;l=k(function(e){return _t(t,c,e).top==f},i<0==(1==s.level)?s.from:s.to-1,l),"before"==u&&(l=ho(r,l,1))}else l=i<0?s.to:s.from;return new P(n,l,u)}}return new P(n,i<0?r.text.length:0,i<0?"before":"after")}function vo(e,t,r,n){var i=Se(t,e.doc.direction);if(!i)return po(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=Ce(i,r.ch,r.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return po(t,r,n);var s,a=function(e,r){return ho(t,e instanceof P?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(s=s||Yt(e,t),dr(e,t,s,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?a(r,-1):r.ch);if("rtl"==e.doc.direction||1==l.level){var f=1==l.level==n<0,h=a(r,f?1:-1);if(null!=h&&(f?h<=l.to&&h<=c.end:h>=l.from&&h>=c.begin)){var d=f?"before":"after";return new P(r.line,h,d)}}var p=function(e,t,n){for(var o=function(e,t){return t?new P(r.line,a(e,1),"before"):new P(r.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),u=s?n.begin:a(n.end,-1);if(l.from<=u&&u<l.to)return o(u,s);if(u=s?l.from:a(l.to,-1),n.begin<=u&&u<n.end)return o(u,s)}},g=p(o+n,n,c);if(g)return g;var v=n>0?c.end:a(c.begin,-1);return null==v||n>0&&v==t.text.length||!(g=p(n>0?0:i.length-1,n,u(v)))?null:g}function mo(e,t){var r=M(e.doc,t),n=fe(r);return n!=r&&(t=W(n)),go(!0,e,n,t,1)}function yo(e,t){var r=M(e.doc,t),n=he(r);return n!=r&&(t=W(n)),go(!0,e,r,t,-1)}function bo(e,t){var r=mo(e,t.line),n=M(e.doc,r.line),i=Se(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return P(r.line,l?0:o,r.sticky)}return r}function wo(e,t,r){if("string"==typeof t&&!(t=Vs[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=Vl}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function xo(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=lo(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&lo(t,e.options.extraKeys,r,e)||lo(t,e.options.keyMap,r,e)}function Co(e,t,r,n){var i=e.state.keySeq;if(i){if(so(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Ks.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),So(e,i+" "+t,r,n))return!0}return So(e,t,r,n)}function So(e,t,r,n){var i=xo(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&wt(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(We(r),Wr(e)),!!i}function Lo(e,t){var r=uo(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?Co(e,"Shift-"+r,t,function(t){return wo(e,t,!0)})||Co(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return wo(e,t)}):Co(e,r,t,function(t){return wo(e,t)}))}function ko(e,t,r){return Co(e,"'"+r+"'",t,function(t){return wo(e,t,!0)})}function To(e){var t=this;if(t.curOp.focus=l(),!Me(t,e)){yl&&bl<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=Lo(t,e);Sl&&(js=n?r:null,!n&&88==r&&!os&&(Al?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||Mo(t)}}function Mo(e){function t(e){18!=e.keyCode&&e.altKey||(zl(r,"CodeMirror-crosshair"),ke(document,"keyup",t),ke(document,"mouseover",t))}var r=e.display.lineDiv;s(r,"CodeMirror-crosshair"),ts(document,"keyup",t),ts(document,"mouseover",t)}function No(e){16==e.keyCode&&(this.doc.sel.shift=!1),Me(this,e)}function Oo(e){var t=this;if(!(Pt(t.display,e)||Me(t,e)||e.ctrlKey&&!e.altKey||Al&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(Sl&&r==js)return js=null,void We(e);if(!Sl||e.which&&!(e.which<10)||!Lo(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(ko(t,e,i)||t.display.input.onKeyPress(e))}}}function Ao(e,t){var r=+new Date;return _s&&_s.compare(r,e,t)?(Ys=_s=null,"triple"):Ys&&Ys.compare(r,e,t)?(_s=new Xs(r,e,t),Ys=null,"double"):(Ys=new Xs(r,e,t),_s=null,"single")}function Wo(e){var t=this,r=t.display;if(!(Me(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,Pt(r,e))return void(wl||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100)));if(!Bo(t,e)){var n=Lr(t,e),i=Ee(e),o=n?Ao(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&Do(t,i,n,o,e)||(1==i?n?Fo(t,n,o,e):Pe(e)==r.scroller&&We(e):2==i?(n&&pi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):3==i&&(El?Go(t,e):Hr(t)))}}}function Do(e,t,r,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),o=(1==t?"Left":2==t?"Middle":"Right")+o,Co(e,ao(o,i),i,function(t){if("string"==typeof t&&(t=Vs[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=Vl}finally{e.state.suppressEdits=!1}return n})}function Ho(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=Wl?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),null==i.addNew&&(i.addNew=Al?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(Al?r.altKey:r.ctrlKey)),i}function Fo(e,t,r,n){yl?setTimeout(u(Dr,e),0):e.curOp.focus=l();var i,o=Ho(e,r,n),s=e.doc.sel;e.options.dragDrop&&rs&&!e.isReadOnly()&&"single"==r&&(i=s.contains(t))>-1&&(E((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(E(i.to(),t)>0||t.xRel<0)?Po(e,n,t,o):zo(e,n,t,o)}function Po(e,t,r,n){var i=e.display,o=!1,l=pn(e,function(t){wl&&(i.scroller.draggable=!1),e.state.draggingText=!1,ke(document,"mouseup",l),ke(document,"mousemove",s),ke(i.scroller,"dragstart",a),ke(i.scroller,"drop",l),o||(We(t),n.addNew||pi(e.doc,r,null,null,n.extend),wl||yl&&9==bl?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())}),s=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},a=function(){return o=!0};wl&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),ts(document,"mouseup",l),ts(document,"mousemove",s),ts(i.scroller,"dragstart",a),ts(i.scroller,"drop",l),Hr(e),setTimeout(function(){return i.input.focus()},20)}function Eo(e,t,r){if("char"==r)return new Os(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Os(P(t.line,0),U(e.doc,P(t.line+1,0)));var n=r(e,t);return new Os(n.from,n.to)}function zo(e,t,r,n){function i(t){if(0!=E(m,t))if(m=t,"rectangle"==n.unit){for(var i=[],o=e.options.tabSize,l=f(M(u,r.line).text,r.ch,o),s=f(M(u,t.line).text,t.ch,o),a=Math.min(l,s),g=Math.max(l,s),v=Math.min(r.line,t.line),y=Math.min(e.lastLine(),Math.max(r.line,t.line));v<=y;v++){var b=M(u,v).text,w=d(b,a,o);a==g?i.push(new Os(P(v,w),P(v,w))):b.length>w&&i.push(new Os(P(v,w),P(v,d(b,g,o))))}i.length||i.push(new Os(r,r)),wi(u,Rn(p.ranges.slice(0,h).concat(i),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x,C=c,S=Eo(e,t,n.unit),L=C.anchor;E(S.anchor,L)>0?(x=S.head,L=B(C.from(),S.anchor)):(x=S.anchor,L=R(C.to(),S.head));var k=p.ranges.slice(0);k[h]=Io(e,new Os(U(u,L),x)),wi(u,Rn(k,h),jl)}}function o(t){var r=++b,s=Lr(e,t,!0,"rectangle"==n.unit);if(s)if(0!=E(s,m)){e.curOp.focus=l(),i(s);var c=Ir(a,u);(s.line>=c.to||s.line<c.from)&&setTimeout(pn(e,function(){b==r&&o(t)}),150)}else{var f=t.clientY<y.top?-20:t.clientY>y.bottom?20:0;f&&setTimeout(pn(e,function(){b==r&&(a.scroller.scrollTop+=f,o(t))}),50)}}function s(t){e.state.selectingText=!1,b=1/0,We(t),a.input.focus(),ke(document,"mousemove",w),ke(document,"mouseup",x),u.history.lastSelOrigin=null}var a=e.display,u=e.doc;We(t);var c,h,p=u.sel,g=p.ranges;if(n.addNew&&!n.extend?(h=u.sel.contains(r),c=h>-1?g[h]:new Os(r,r)):(c=u.sel.primary(),h=u.sel.primIndex),"rectangle"==n.unit)n.addNew||(c=new Os(r,r)),r=Lr(e,t,!0,!0),h=-1;else{var v=Eo(e,r,n.unit);c=n.extend?di(c,v.anchor,v.head,n.extend):v}n.addNew?-1==h?(h=g.length,wi(u,Rn(g.concat([c]),h),{scroll:!1,origin:"*mouse"})):g.length>1&&g[h].empty()&&"char"==n.unit&&!n.extend?(wi(u,Rn(g.slice(0,h).concat(g.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),p=u.sel):vi(u,h,c,jl):(h=0,wi(u,new Ns([c],0),jl),p=u.sel);var m=r,y=a.wrapper.getBoundingClientRect(),b=0,w=pn(e,function(e){Ee(e)?o(e):s(e)}),x=pn(e,s);e.state.selectingText=x,ts(document,"mousemove",w),ts(document,"mouseup",x)}function Io(e,t){var r=t.anchor,n=t.head,i=M(e.doc,r.line);if(0==E(r,n)&&r.sticky==n.sticky)return t;var o=Se(i);if(!o)return t;var l=Ce(o,r.ch,r.sticky),s=o[l];if(s.from!=r.ch&&s.to!=r.ch)return t;var a=l+(s.from==r.ch==(1!=s.level)?0:1);if(0==a||a==o.length)return t;var u;if(n.line!=r.line)u=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=Ce(o,n.ch,n.sticky),f=c-l||(n.ch-r.ch)*(1==s.level?-1:1);u=c==a-1||c==a?f<0:f>0}var h=o[a+(u?-1:0)],d=u==(1==h.level),p=d?h.from:h.to,g=d?"after":"before";return r.ch==p&&r.sticky==g?t:new Os(new P(r.line,p,g),n)}function Ro(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&We(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!Oe(e,r))return He(t);o-=s.top-l.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var u=l.gutters.childNodes[a];if(u&&u.getBoundingClientRect().right>=i){return Te(e,r,e,D(e.doc,o),e.options.gutters[a],t),He(t)}}}function Bo(e,t){return Ro(e,t,"gutterClick",!0)}function Go(e,t){Pt(e.display,t)||Uo(e,t)||Me(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function Uo(e,t){return!!Oe(e,"gutterContextMenu")&&Ro(e,t,"gutterContextMenu",!1)}function Vo(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),tr(e)}function Ko(e){Fn(e),mn(e),Rr(e)}function jo(e,t,r){if(!t!=!(r&&r!=qs)){var n=e.display.dragFunctions,i=t?ts:ke;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Xo(e){e.options.lineWrapping?(s(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(zl(e.display.wrapper,"CodeMirror-wrap"),we(e)),Sr(e),mn(e),tr(e),setTimeout(function(){return tn(e)},100)}function Yo(e,t){var r=this;if(!(this instanceof Yo))return new Yo(e,t);this.options=t=t?c(t):{},c($s,t,!1),Pn(t);var n=t.value;"string"==typeof n&&(n=new Ps(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i=new Yo.inputStyles[t.inputStyle](this),o=this.display=new T(e,n,i);o.wrapper.CodeMirror=this,Fn(this),Vo(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),nn(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Rl,keySeq:null,specialChars:null},t.autofocus&&!Ol&&o.input.focus(),yl&&bl<11&&setTimeout(function(){return r.display.input.reset(!0)},20),_o(this),to(),on(this),this.curOp.forceUpdate=!0,Zn(this,n),t.autofocus&&!Ol||this.hasFocus()?setTimeout(u(Fr,this),20):Pr(this);for(var l in Zs)Zs.hasOwnProperty(l)&&Zs[l](r,t[l],qs);Br(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Qs.length;++s)Qs[s](r);ln(this),wl&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function _o(e){function t(){i.activeTouch&&(o=setTimeout(function(){return i.activeTouch=null},1e3),l=i.activeTouch,l.end=+new Date)}function r(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}var i=e.display;ts(i.scroller,"mousedown",pn(e,Wo)),yl&&bl<11?ts(i.scroller,"dblclick",pn(e,function(t){if(!Me(e,t)){var r=Lr(e,t);if(r&&!Bo(e,t)&&!Pt(e.display,t)){We(t);var n=e.findWordAt(r);pi(e.doc,n.anchor,n.head)}}})):ts(i.scroller,"dblclick",function(t){return Me(e,t)||We(t)}),El||ts(i.scroller,"contextmenu",function(t){return Go(e,t)});var o,l={end:0};ts(i.scroller,"touchstart",function(t){if(!Me(e,t)&&!r(t)&&!Bo(e,t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-l.end<=300?l:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),ts(i.scroller,"touchmove",function(){
4
+ i.activeTouch&&(i.activeTouch.moved=!0)}),ts(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!Pt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,s=e.coordsChar(i.activeTouch,"page");l=!o.prev||n(o,o.prev)?new Os(s,s):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(s):new Os(P(s.line,0),U(e.doc,P(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),We(r)}t()}),ts(i.scroller,"touchcancel",t),ts(i.scroller,"scroll",function(){i.scroller.clientHeight&&(Zr(e,i.scroller.scrollTop),Jr(e,i.scroller.scrollLeft,!0),Te(e,"scroll",e))}),ts(i.scroller,"mousewheel",function(t){return In(e,t)}),ts(i.scroller,"DOMMouseScroll",function(t){return In(e,t)}),ts(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Me(e,t)||Fe(t)},over:function(t){Me(e,t)||(Qi(e,t),Fe(t))},start:function(t){return Zi(e,t)},drop:pn(e,$i),leave:function(t){Me(e,t)||Ji(e)}};var s=i.input.getField();ts(s,"keyup",function(t){return No.call(e,t)}),ts(s,"keydown",pn(e,To)),ts(s,"keypress",pn(e,Oo)),ts(s,"focus",function(t){return Fr(e,t)}),ts(s,"blur",function(t){return Pr(e,t)})}function qo(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=$e(e,t).state:r="prev");var l=e.options.tabSize,s=M(o,t),a=f(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==r&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==Vl||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?f(M(o,t-1).text,null,l):0:"add"==r?u=a+e.options.indentUnit:"subtract"==r?u=a-e.options.indentUnit:"number"==typeof r&&(u=a+r),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var g=Math.floor(u/l);g;--g)d+=l,h+="\t";if(d<u&&(h+=p(u-d)),h!=c)return Ei(o,h,P(t,0),P(t,c.length),"+input"),s.stateAfter=null,!0;for(var v=0;v<o.sel.ranges.length;v++){var m=o.sel.ranges[v];if(m.head.line==t&&m.head.ch<c.length){var y=P(t,c.length);vi(o,v,new Os(y,y));break}}}function $o(e){Js=e}function Zo(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=e.state.pasteIncoming||"paste"==i,s=ns(t),a=null;if(l&&n.ranges.length>1)if(Js&&Js.text.join("\n")==t){if(n.ranges.length%Js.text.length==0){a=[];for(var u=0;u<Js.text.length;u++)a.push(o.splitLines(Js.text[u]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(a=v(s,function(e){return[e]}));for(var c,f=n.ranges.length-1;f>=0;f--){var h=n.ranges[f],d=h.from(),p=h.to();h.empty()&&(r&&r>0?d=P(d.line,d.ch-r):e.state.overwrite&&!l?p=P(p.line,Math.min(M(o,p.line).text.length,p.ch+g(s).length)):Js&&Js.lineWise&&Js.text.join("\n")==t&&(d=p=P(d.line,0))),c=e.curOp.updateInput;var m={from:d,to:p,text:a?a[f%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Ai(e.doc,m),wt(e,"inputRead",e,m)}t&&!l&&Jo(e,t),Xr(e),e.curOp.updateInput=c,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Qo(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||dn(t,function(){return Zo(t,r,0,null,"paste")}),!0}function Jo(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){l=qo(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(M(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=qo(e,i.head.line,"smart"));l&&wt(e,"electricInput",e,i.head.line)}}}function el(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:P(i,0),head:P(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function tl(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function rl(){var e=n("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=n("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return wl?e.style.width="1000px":e.setAttribute("wrap","off"),Ml&&(e.style.border="1px solid black"),tl(e),t}function nl(e,t,r,n,i){function o(){var n=t.line+r;return!(n<e.first||n>=e.first+e.size)&&(t=new P(n,t.ch,t.sticky),u=M(e,n))}function l(n){var l;if(null==(l=i?vo(e.cm,u,t,r):po(u,t,r))){if(n||!o())return!1;t=go(i,e.cm,u,t.line,r)}else t=l;return!0}var s=t,a=r,u=M(e,t.line);if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var c=null,f="group"==n,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||l(!d);d=!1){var p=u.text.charAt(t.ch)||"\n",g=x(p,h)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||d||g||(g="s"),c&&c!=g){r<0&&(r=1,l(),t.sticky="after");break}if(g&&(c=g),r>0&&!l(!d))break}var v=Ti(e,t,s,a,!0);return z(s,v)&&(v.hitSide=!0),v}function il(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),a=Math.max(s-.5*yr(e.display),3);i=(r>0?t.bottom:t.top)+r*a}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var u;u=fr(e,l,i),u.outside;){if(r<0?i<=0:i>=o.height){u.hitSide=!0;break}i+=5*r}return u}function ol(e,t){var r=Xt(e,t.line);if(!r||r.hidden)return null;var n=M(e.doc,t.line),i=Vt(r,n,t.line),o=Se(n,e.doc.direction),l="left";if(o){l=Ce(o,t.ch)%2?"right":"left"}var s=qt(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function ll(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function sl(e,t){return t&&(e.bad=!0),e}function al(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(){c&&(u+=f,c=!1)}function s(e){e&&(l(),u+=e)}function a(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void s(r||t.textContent.replace(/\u200b/g,""));var u,h=t.getAttribute("cm-marker");if(h){var d=e.findMarks(P(n,0),P(i+1,0),o(+h));return void(d.length&&(u=d[0].find(0))&&s(N(e.doc,u.from,u.to).join(f)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p)$/i.test(t.nodeName);p&&l();for(var g=0;g<t.childNodes.length;g++)a(t.childNodes[g]);p&&(c=!0)}else 3==t.nodeType&&s(t.nodeValue)}for(var u="",c=!1,f=e.doc.lineSeparator();a(t),t!=r;)t=t.nextSibling;return u}function ul(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return sl(e.clipPos(P(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return cl(o,t,r)}}function cl(e,t,r){function n(t,r,n){for(var i=-1;i<(f?f.length:0);i++)for(var o=i<0?c.map:f[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==r){var a=W(i<0?e.line:e.rest[i]),u=o[l]+n;return(n<0||s!=t)&&(u=o[l+(n?1:0)]),P(a,u)}}}var i=e.text.firstChild,l=!1;if(!t||!o(i,t))return sl(P(W(e.line),0),!0);if(t==i&&(l=!0,t=i.childNodes[r],r=0,!t)){var s=e.rest?g(e.rest):e.line;return sl(P(W(s),s.text.length),l)}var a=3==t.nodeType?t:null,u=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r&&(r=a.nodeValue.length));u.parentNode!=i;)u=u.parentNode;var c=e.measure,f=c.maps,h=n(a,u,r);if(h)return sl(h,l);for(var d=u.nextSibling,p=a?a.nodeValue.length-r:0;d;d=d.nextSibling){if(h=n(d,d.firstChild,0))return sl(P(h.line,h.ch-p),l);p+=d.textContent.length}for(var v=u.previousSibling,m=r;v;v=v.previousSibling){if(h=n(v,v.firstChild,-1))return sl(P(h.line,h.ch+m),l);m+=v.textContent.length}}function fl(e,t){function r(){e.value=a.getValue()}if(t=t?c(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=l();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}var i;if(e.form&&(ts(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var s=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=s}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(ke(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var a=Yo(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a}var hl=navigator.userAgent,dl=navigator.platform,pl=/gecko\/\d/i.test(hl),gl=/MSIE \d/.test(hl),vl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hl),ml=/Edge\/(\d+)/.exec(hl),yl=gl||vl||ml,bl=yl&&(gl?document.documentMode||6:+(ml||vl)[1]),wl=!ml&&/WebKit\//.test(hl),xl=wl&&/Qt\/\d+\.\d+/.test(hl),Cl=!ml&&/Chrome\//.test(hl),Sl=/Opera\//.test(hl),Ll=/Apple Computer/.test(navigator.vendor),kl=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(hl),Tl=/PhantomJS/.test(hl),Ml=!ml&&/AppleWebKit/.test(hl)&&/Mobile\/\w+/.test(hl),Nl=/Android/.test(hl),Ol=Ml||Nl||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(hl),Al=Ml||/Mac/.test(dl),Wl=/\bCrOS\b/.test(hl),Dl=/win/i.test(dl),Hl=Sl&&hl.match(/Version\/(\d*\.\d*)/);Hl&&(Hl=Number(Hl[1])),Hl&&Hl>=15&&(Sl=!1,wl=!0);var Fl,Pl=Al&&(xl||Sl&&(null==Hl||Hl<12.11)),El=pl||yl&&bl>=9,zl=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};Fl=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var Il=function(e){e.select()};Ml?Il=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:yl&&(Il=function(e){try{e.select()}catch(e){}});var Rl=function(){this.id=null};Rl.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Bl,Gl,Ul=30,Vl={toString:function(){return"CodeMirror.Pass"}},Kl={scroll:!1},jl={origin:"*mouse"},Xl={origin:"+move"},Yl=[""],_l=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,ql=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,$l=!1,Zl=!1,Ql=null,Jl=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,s=/[Lb1n]/,a=/[1n]/;return function(r,n){var u="ltr"==n?"L":"R";if(0==r.length||"ltr"==n&&!i.test(r))return!1;for(var c=r.length,f=[],h=0;h<c;++h)f.push(e(r.charCodeAt(h)));for(var d=0,p=u;d<c;++d){var v=f[d];"m"==v?f[d]=p:p=v}for(var m=0,y=u;m<c;++m){var b=f[m];"1"==b&&"r"==y?f[m]="n":l.test(b)&&(y=b,"r"==b&&(f[m]="R"))}for(var w=1,x=f[0];w<c-1;++w){var C=f[w];"+"==C&&"1"==x&&"1"==f[w+1]?f[w]="1":","!=C||x!=f[w+1]||"1"!=x&&"n"!=x||(f[w]=x),x=C}for(var S=0;S<c;++S){var L=f[S];if(","==L)f[S]="N";else if("%"==L){var k=void 0;for(k=S+1;k<c&&"%"==f[k];++k);for(var T=S&&"!"==f[S-1]||k<c&&"1"==f[k]?"1":"N",M=S;M<k;++M)f[M]=T;S=k-1}}for(var N=0,O=u;N<c;++N){var A=f[N];"L"==O&&"1"==A?f[N]="L":l.test(A)&&(O=A)}for(var W=0;W<c;++W)if(o.test(f[W])){var D=void 0;for(D=W+1;D<c&&o.test(f[D]);++D);for(var H="L"==(W?f[W-1]:u),F="L"==(D<c?f[D]:u),P=H==F?H?"L":"R":u,E=W;E<D;++E)f[E]=P;W=D-1}for(var z,I=[],R=0;R<c;)if(s.test(f[R])){var B=R;for(++R;R<c&&s.test(f[R]);++R);I.push(new t(0,B,R))}else{var G=R,U=I.length;for(++R;R<c&&"L"!=f[R];++R);for(var V=G;V<R;)if(a.test(f[V])){G<V&&I.splice(U,0,new t(1,G,V));var K=V;for(++V;V<R&&a.test(f[V]);++V);I.splice(U,0,new t(2,K,V)),G=V}else++V;G<R&&I.splice(U,0,new t(1,G,R))}return"ltr"==n&&(1==I[0].level&&(z=r.match(/^\s+/))&&(I[0].from=z[0].length,I.unshift(new t(0,0,z[0].length))),1==g(I).level&&(z=r.match(/\s+$/))&&(g(I).to-=z[0].length,I.push(new t(0,c-z[0].length,c)))),"rtl"==n?I.reverse():I}}(),es=[],ts=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||es).concat(r)}},rs=function(){if(yl&&bl<9)return!1;var e=n("div");return"draggable"in e||"dragDrop"in e}(),ns=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},is=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},os=function(){var e=n("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ls=null,ss={},as={},us={},cs=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};cs.prototype.eol=function(){return this.pos>=this.string.length},cs.prototype.sol=function(){return this.pos==this.lineStart},cs.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},cs.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},cs.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},cs.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},cs.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},cs.prototype.skipToEnd=function(){this.pos=this.string.length},cs.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},cs.prototype.backUp=function(e){this.pos-=e},cs.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=f(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?f(this.string,this.lineStart,this.tabSize):0)},cs.prototype.indentation=function(){return f(this.string,null,this.tabSize)-(this.lineStart?f(this.string,this.lineStart,this.tabSize):0)},cs.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},cs.prototype.current=function(){return this.string.slice(this.start,this.pos)},cs.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},cs.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},cs.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var fs=function(e,t){this.state=e,this.lookAhead=t},hs=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};hs.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},hs.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)t.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},hs.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},hs.fromSaved=function(e,t,r){return t instanceof fs?new hs(e,je(e.mode,t.state),r,t.lookAhead):new hs(e,je(e.mode,t),r)},hs.prototype.save=function(e){var t=!1!==e?je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fs(t,this.maxLookAhead):t};var ds=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r},ps=function(e,t,r){this.text=e,ne(this,t),this.height=r?r(this):1};ps.prototype.lineNo=function(){return W(this)},Ae(ps);var gs,vs={},ms={},ys=null,bs=null,ws={left:0,right:0,top:0,bottom:0},xs=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),ts(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),ts(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,yl&&bl<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};xs.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},xs.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},xs.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},xs.prototype.zeroWidthHack=function(){var e=Al&&!kl?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Rl,this.disableVert=new Rl},xs.prototype.enableZeroWidthBar=function(e,t,r){function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},xs.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Cs=function(){};Cs.prototype.update=function(){return{bottom:0,right:0}},Cs.prototype.setScrollLeft=function(){},Cs.prototype.setScrollTop=function(){},Cs.prototype.clear=function(){};var Ss={native:xs,null:Cs},Ls=0,ks=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Ir(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Bt(e),this.force=r,this.dims=wr(e),this.events=[]};ks.prototype.signal=function(e,t){Oe(e,t)&&this.events.push(arguments)},ks.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)Te.apply(null,e.events[t])};var Ts=0,Ms=null;yl?Ms=-.53:pl?Ms=15:Cl?Ms=-.7:Ll&&(Ms=-1/3);var Ns=function(e,t){this.ranges=e,this.primIndex=t};Ns.prototype.primary=function(){return this.ranges[this.primIndex]},Ns.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(!z(n.anchor,i.anchor)||!z(n.head,i.head))return!1}return!0},Ns.prototype.deepCopy=function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new Os(I(e.ranges[r].anchor),I(e.ranges[r].head));return new Ns(t,this.primIndex)},Ns.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},Ns.prototype.contains=function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(E(t,i.from())>=0&&E(e,i.to())<=0)return n}return-1};var Os=function(e,t){this.anchor=e,this.head=t};Os.prototype.from=function(){return B(this.anchor,this.head)},Os.prototype.to=function(){return R(this.anchor,this.head)},Os.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},Gi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,lt(o),wt(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},iterN:function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0}},Ui.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e),s=i.height;if(i.removeInner(e,l),r.height-=s-i.height,o==l&&(r.children.splice(n--,1),i.parent=null),0==(t-=l))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Gi))){var a=[];this.collapse(a),this.children=[new Gi(a)],this.children[0].parent=this}},collapse:function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},insertInner:function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],l=o.chunkSize();if(e<=l){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var s=o.lines.length%25+25,a=s;a<o.lines.length;){var u=new Gi(o.lines.slice(a,a+=25));o.height-=u.height,n.children.splice(++i,0,u),u.parent=n}o.lines=o.lines.slice(0,s),n.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Ui(t);if(e.parent){e.size-=r.size,e.height-=r.height;var n=h(e.parent.children,e);e.parent.children.splice(n+1,0,r)}else{var i=new Ui(e.children);i.parent=e,e.children=[i,r],e=i}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],l=o.chunkSize();if(e<l){var s=Math.min(t,l-e);if(o.iterN(e,s,r))return!0;if(0==(t-=s))break;e=0}else e-=l}}};var As=function(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t};As.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=W(n);if(null!=i&&r){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var l=Ft(this);A(n,Math.max(0,n.height-l)),t&&(dn(t,function(){Vi(t,n,-l),yn(t,i,"widget")}),wt(t,"lineWidgetCleared",t,this,i))}},As.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Ft(this)-t;i&&(A(n,n.height+i),r&&dn(r,function(){r.curOp.forceUpdate=!0,Vi(r,n,i),wt(r,"lineWidgetChanged",r,e,W(n))}))},Ae(As);var Ws=0,Ds=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ws};Ds.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&on(t),Oe(this,"clear")){var n=this.find();n&&wt(this,"clear",n.from,n.to)}for(var i=null,o=null,l=0;l<this.lines.length;++l){var s=e.lines[l],a=_(s.markedSpans,e);t&&!e.collapsed?yn(t,W(s),"text"):t&&(null!=a.to&&(o=W(s)),null!=a.from&&(i=W(s))),s.markedSpans=q(s.markedSpans,a),null==a.from&&e.collapsed&&!ve(e.doc,s)&&t&&A(s,yr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var c=fe(e.lines[u]),f=be(c);f>t.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=f,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&mn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Si(t.doc)),t&&wt(t,"markerCleared",t,this,i,o),r&&ln(t),this.parent&&this.parent.clear()}},Ds.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var l=r.lines[o],s=_(l.markedSpans,r);if(null!=s.from&&(n=P(t?l:W(l),s.from),-1==e))return n;if(null!=s.to&&(i=P(t?l:W(l),s.to),1==e))return i}return n&&{from:n,to:i}},Ds.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&dn(n,function(){var i=t.line,o=W(t.line),l=Xt(n,o);if(l&&(Jt(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ve(r.doc,i)&&null!=r.height){var s=r.height;r.height=null;var a=Ft(r)-s;a&&A(i,i.height+a)}wt(n,"markerChanged",n,e)})},Ds.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=h(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ds.prototype.detachLine=function(e){if(this.lines.splice(h(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Ae(Ds);var Hs=function(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r};Hs.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();wt(this,"clear")}},Hs.prototype.find=function(e,t){return this.primary.find(e,t)},Ae(Hs);var Fs=0,Ps=function(e,t,r,n,i){if(!(this instanceof Ps))return new Ps(e,t,r,n,i);null==r&&(r=0),Ui.call(this,[new Gi([new ps("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=P(r,0);this.sel=Bn(o),this.history=new ei(null),this.id=++Fs,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),qn(this,{from:o,to:o,text:e}),wi(this,Bn(o),Kl)};Ps.prototype=b(Ui.prototype,{constructor:Ps,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=O(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:vn(function(e){var t=P(this.first,0),r=this.first+this.size-1;Ai(this,{from:t,to:P(r,M(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Yr(this.cm,0,0),wi(this,Bn(t),Kl)}),replaceRange:function(e,t,r,n){t=U(this,t),r=r?U(this,r):t,Ei(this,e,t,r,n)},getRange:function(e,t,r){var n=N(this,U(this,e),U(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(H(this,e))return M(this,e)},getLineNumber:function(e){return W(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=M(this,e)),fe(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return U(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:vn(function(e,t,r){mi(this,U(this,"number"==typeof e?P(e,t||0):e),null,r)}),setSelection:vn(function(e,t,r){mi(this,U(this,e),U(this,t||e),r)}),extendSelection:vn(function(e,t,r){pi(this,U(this,e),t&&U(this,t),r)}),extendSelections:vn(function(e,t){gi(this,K(this,e),t)}),extendSelectionsBy:vn(function(e,t){gi(this,K(this,v(this.sel.ranges,e)),t)}),setSelections:vn(function(e,t,r){var n=this;if(e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new Os(U(n,e[o].anchor),U(n,e[o].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),wi(this,Rn(i,t),r)}}),addSelection:vn(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Os(U(this,e),U(this,t||e))),wi(this,Rn(n,n.length-1),r)}),getSelection:function(e){for(var t,r=this,n=this.sel.ranges,i=0;i<n.length;i++){var o=N(r,n[i].from(),n[i].to());t=t?t.concat(o):o}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=N(t,n[i].from(),n[i].to());!1!==e&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:vn(function(e,t,r){for(var n=this,i=[],o=this.sel,l=0;l<o.ranges.length;l++){var s=o.ranges[l];i[l]={from:s.from(),to:s.to(),text:n.splitLines(e[l]),origin:r}}for(var a=t&&"end"!=t&&jn(this,i,t),u=i.length-1;u>=0;u--)Ai(n,i[u]);a?bi(this,a):this.cm&&Xr(this.cm)}),undo:vn(function(){Di(this,"undo")}),redo:vn(function(){Di(this,"redo")}),undoSelection:vn(function(){Di(this,"undo",!0)}),redoSelection:vn(function(){Di(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){
5
+ this.history=new ei(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:hi(this.history.done),undone:hi(this.history.undone)}},setHistory:function(e){var t=this.history=new ei(this.history.maxGeneration);t.done=hi(e.done.slice(0),null,!0),t.undone=hi(e.undone.slice(0),null,!0)},setGutterMarker:vn(function(e,t,r){return Bi(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&C(n)&&(e.gutterMarkers=null),!0})}),clearGutter:vn(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Bi(t,r,"gutter",function(){return r.gutterMarkers[e]=null,C(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!H(this,e))return null;if(t=e,!(e=M(this,e)))return null}else if(null==(t=W(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:vn(function(t,r,n){return Bi(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(t[i]){if(e(n).test(t[i]))return!1;t[i]+=" "+n}else t[i]=n;return!0})}),removeLineClass:vn(function(t,r,n){return Bi(this,t,"gutter"==r?"gutter":"class",function(t){var i="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass",o=t[i];if(!o)return!1;if(null==n)t[i]=null;else{var l=o.match(e(n));if(!l)return!1;var s=l.index+l[0].length;t[i]=o.slice(0,l.index)+(l.index&&s!=o.length?" ":"")+o.slice(s)||null}return!0})}),addLineWidget:vn(function(e,t,r){return Ki(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return ji(this,U(this,e),U(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=U(this,e),ji(this,e,e,r,"bookmark")},findMarksAt:function(e){e=U(this,e);var t=[],r=M(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=U(this,e),t=U(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var s=0;s<l.length;s++){var a=l[s];null!=a.to&&i==e.line&&e.ch>=a.to||null==a.from&&i!=e.line||null!=a.from&&i==t.line&&a.from>=t.ch||r&&!r(a.marker)||n.push(a.marker.parent||a.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),U(this,P(r,t))},indexFromPos:function(e){e=U(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new Ps(O(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Ps(O(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],_i(n,Yi(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof Yo&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),qi(Yi(t));break}}if(e.history==this.history){var i=[e.id];$n(e,function(e){return i.push(e.id)},!0),e.history=new ei(null),e.history.done=hi(this.history.done,i),e.history.undone=hi(this.history.undone,i)}},iterLinkedDocs:function(e){$n(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ns(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:vn(function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Jn(this.cm))})}),Ps.prototype.eachLine=Ps.prototype.iter;for(var Es=0,zs=!1,Is={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Rs=0;Rs<10;Rs++)Is[Rs+48]=Is[Rs+96]=String(Rs);for(var Bs=65;Bs<=90;Bs++)Is[Bs]=String.fromCharCode(Bs);for(var Gs=1;Gs<=12;Gs++)Is[Gs+111]=Is[Gs+63235]="F"+Gs;var Us={};Us.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Us.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Us.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Us.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Us.default=Al?Us.macDefault:Us.pcDefault;var Vs={selectAll:Ni,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Kl)},killLine:function(e){return fo(e,function(t){if(t.empty()){var r=M(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:P(t.head.line+1,0)}:{from:t.head,to:P(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return fo(e,function(t){return{from:P(t.from().line,0),to:U(e.doc,P(t.to().line+1,0))}})},delLineLeft:function(e){return fo(e,function(e){return{from:P(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return fo(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return fo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(P(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(P(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return mo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return bo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return yo(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Xl)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Xl)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?bo(e,t.head):n},Xl)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=f(e.getLine(o.line),o.ch,n);t.push(p(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return dn(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=M(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new P(i.line,i.ch-1)),i.ch>0)i=new P(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),P(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=M(e.doc,i.line-1).text;l&&(i=new P(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),P(i.line-1,l.length-1),i,"+transpose"))}r.push(new Os(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return dn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);Xr(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Ks=new Rl,js=null,Xs=function(e,t,r){this.time=e,this.pos=t,this.button=r};Xs.prototype.compare=function(e,t,r){return this.time+400>e&&0==E(t,this.pos)&&r==this.button};var Ys,_s,qs={toString:function(){return"CodeMirror.Init"}},$s={},Zs={};Yo.defaults=$s,Yo.optionHandlers=Zs;var Qs=[];Yo.defineInitHook=function(e){return Qs.push(e)};var Js=null,ea=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Rl,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ea.prototype.init=function(e){function t(e){if(!Me(i,e)){if(i.somethingSelected())$o({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=el(i);$o({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,Kl),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=Js.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var l=rl(),s=l.firstChild;i.display.lineSpace.insertBefore(l,i.display.lineSpace.firstChild),s.value=Js.text.join("\n");var a=document.activeElement;Il(s),setTimeout(function(){i.display.lineSpace.removeChild(l),a.focus(),a==o&&n.showPrimarySelection()},50)}}var r=this,n=this,i=n.cm,o=n.div=e.lineDiv;tl(o,i.options.spellcheck),ts(o,"paste",function(e){Me(i,e)||Qo(e,i)||bl<=11&&setTimeout(pn(i,function(){return r.updateFromDOM()}),20)}),ts(o,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),ts(o,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),ts(o,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),ts(o,"touchstart",function(){return n.forceCompositionEnd()}),ts(o,"input",function(){r.composing||r.readFromDOMSoon()}),ts(o,"copy",t),ts(o,"cut",t)},ea.prototype.prepareSelection=function(){var e=Mr(this.cm,!1);return e.focus=this.cm.state.focused,e},ea.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ea.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom)return void e.removeAllRanges();var o=ul(t,e.anchorNode,e.anchorOffset),l=ul(t,e.focusNode,e.focusOffset);if(!o||o.bad||!l||l.bad||0!=E(B(o,l),n)||0!=E(R(o,l),i)){var s=t.display.view,a=n.line>=t.display.viewFrom&&ol(t,n)||{node:s[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&ol(t,i);if(!u){var c=s[s.length-1].measure,f=c.maps?c.maps[c.maps.length-1]:c.map;u={node:f[f.length-1],offset:f[f.length-2]-f[f.length-3]}}if(!a||!u)return void e.removeAllRanges();var h,d=e.rangeCount&&e.getRangeAt(0);try{h=Fl(a.node,a.offset,u.offset,u.node)}catch(e){}h&&(!pl&&t.state.focused?(e.collapse(a.node,a.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),d&&null==e.anchorNode?e.addRange(d):pl&&this.startGracePeriod()),this.rememberSelection()}},ea.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},ea.prototype.showMultipleSelections=function(e){r(this.cm.display.cursorDiv,e.cursors),r(this.cm.display.selectionDiv,e.selection)},ea.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ea.prototype.selectionInEditor=function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return o(this.div,t)},ea.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ea.prototype.blur=function(){this.div.blur()},ea.prototype.getField=function(){return this.div},ea.prototype.supportsTouch=function(){return!0},ea.prototype.receivedFocus=function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():dn(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},ea.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ea.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;if(Nl&&Cl&&this.cm.options.gutters.length&&ll(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var r=ul(t,e.anchorNode,e.anchorOffset),n=ul(t,e.focusNode,e.focusOffset);r&&n&&dn(t,function(){wi(t.doc,Bn(r,n),Kl),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},ea.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(0==n.ch&&n.line>e.firstLine()&&(n=P(n.line-1,M(e.doc,n.line-1).length)),i.ch==M(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=P(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,l,s;n.line==t.viewFrom||0==(o=kr(e,n.line))?(l=W(t.view[0].line),s=t.view[0].node):(l=W(t.view[o].line),s=t.view[o-1].node.nextSibling);var a,u,c=kr(e,i.line);if(c==t.view.length-1?(a=t.viewTo-1,u=t.lineDiv.lastChild):(a=W(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!s)return!1;for(var f=e.doc.splitLines(al(e,s,u,l,a)),h=N(e.doc,P(l,0),P(a,M(e.doc,a).text.length));f.length>1&&h.length>1;)if(g(f)==g(h))f.pop(),h.pop(),a--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),l++}for(var d=0,p=0,v=f[0],m=h[0],y=Math.min(v.length,m.length);d<y&&v.charCodeAt(d)==m.charCodeAt(d);)++d;for(var b=g(f),w=g(h),x=Math.min(b.length-(1==f.length?d:0),w.length-(1==h.length?d:0));p<x&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)++p;if(1==f.length&&1==h.length&&l==n.line)for(;d&&d>n.ch&&b.charCodeAt(b.length-p-1)==w.charCodeAt(w.length-p-1);)d--,p++;f[f.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var C=P(l,d),S=P(a,h.length?g(h).length-p:0);return f.length>1||f[0]||E(C,S)?(Ei(e.doc,f,C,S,"+input"),!0):void 0},ea.prototype.ensurePolled=function(){this.forceCompositionEnd()},ea.prototype.reset=function(){this.forceCompositionEnd()},ea.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ea.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},ea.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||dn(this.cm,function(){return mn(e.cm)})},ea.prototype.setUneditable=function(e){e.contentEditable="false"},ea.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||pn(this.cm,Zo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ea.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ea.prototype.onContextMenu=function(){},ea.prototype.resetPosition=function(){},ea.prototype.needsContentAttribute=!0;var ta=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Rl,this.hasSelection=!1,this.composing=null};ta.prototype.init=function(e){function t(e){if(!Me(i,e)){if(i.somethingSelected())$o({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=el(i);$o({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Kl):(n.prevInput="",l.value=t.text.join("\n"),Il(l))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=rl(),l=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),Ml&&(l.style.width="0px"),ts(l,"input",function(){yl&&bl>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),ts(l,"paste",function(e){Me(i,e)||Qo(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),ts(l,"cut",t),ts(l,"copy",t),ts(e.scroller,"paste",function(t){Pt(e,t)||Me(i,t)||(i.state.pasteIncoming=!0,n.focus())}),ts(e.lineSpace,"selectstart",function(t){Pt(e,t)||We(t)}),ts(l,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),ts(l,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},ta.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Mr(e);if(e.options.moveInputWithCursor){var i=ar(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},ta.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ta.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&Il(this.textarea),yl&&bl>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",yl&&bl>=9&&(this.hasSelection=null))}},ta.prototype.getField=function(){return this.textarea},ta.prototype.supportsTouch=function(){return!1},ta.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!Ol||l()!=this.textarea))try{this.textarea.focus()}catch(e){}},ta.prototype.blur=function(){this.textarea.blur()},ta.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ta.prototype.receivedFocus=function(){this.slowPoll()},ta.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ta.prototype.fastPoll=function(){function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},ta.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||is(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(yl&&bl>=9&&this.hasSelection===i||Al&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(n.length,i.length);l<s&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return dn(t,function(){Zo(t,i.slice(l),n.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ta.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ta.prototype.onKeyPress=function(){yl&&bl>=9&&(this.hasSelection=null),this.fastPoll()},ta.prototype.onContextMenu=function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t="​"+(e?l.value:"");l.value="⇚",l.value=t,n.prevInput=e?"":"​",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=c,l.style.cssText=u,yl&&bl<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=a),null!=l.selectionStart){(!yl||yl&&bl<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&"​"==n.prevInput?pn(i,Ni)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):(o.selForContextMenu=null,o.input.reset())};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,s=Lr(i,e),a=o.scroller.scrollTop;if(s&&!Sl){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(s)&&pn(i,wi)(i.doc,Bn(s),Kl);var u=l.style.cssText,c=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var f=n.wrapper.getBoundingClientRect();l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-f.top-5)+"px; left: "+(e.clientX-f.left-5)+"px;\n z-index: 1000; background: "+(yl?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var h;if(wl&&(h=window.scrollY),o.input.focus(),wl&&window.scrollTo(null,h),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),yl&&bl>=9&&t(),El){Fe(e);var d=function(){ke(window,"mouseup",d),setTimeout(r,20)};ts(window,"mouseup",d)}else setTimeout(r,50)}},ta.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},ta.prototype.setUneditable=function(){},ta.prototype.needsContentAttribute=!1,function(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=qs&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=qs,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Xn(e)},!0),t("indentUnit",2,Xn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Yn(e),tr(e),mn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(P(n,o))}n++});for(var i=r.length-1;i>=0;i--)Ei(e.doc,t,r[i],P(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=qs&&e.refresh()}),t("specialCharPlaceholder",ut,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",Ol?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!Dl),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){Vo(e),Ko(e)},!0),t("keyMap","default",function(e,t,r){var n=co(t),i=r!=qs&&co(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("configureMouse",null),t("lineWrapping",!1,Xo,!0),t("gutters",[],function(e){Pn(e.options),Ko(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?xr(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return tn(e)},!0),t("scrollbarStyle","native",function(e){nn(e),tn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){Pn(e.options),Ko(e)},!0),t("firstLineNumber",1,Ko,!0),t("lineNumberFormatter",function(e){return e},Ko,!0),t("showCursorWhenSelecting",!1,Tr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("pasteLinesPerSelection",!0),t("readOnly",!1,function(e,t){"nocursor"==t&&(Pr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,jo),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,Tr,!0),t("singleCursorHeightPerLine",!0,Tr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Yn,!0),t("addModeClass",!1,Yn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Yn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null),t("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0)}(Yo),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&pn(this,t[e])(this,r,i),Te(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](co(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:gn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");m(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,mn(this)}),removeOverlay:gn(function(e){for(var t=this,r=this.state.overlays,n=0;n<r.length;++n){var i=r[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return r.splice(n,1),t.state.modeGen++,void mn(t)}}),indentLine:gn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),H(this.doc,e)&&qo(this,e,t,r)}),indentSelection:gn(function(e){for(var t=this,r=this.doc.sel.ranges,n=-1,i=0;i<r.length;i++){var o=r[i];if(o.empty())o.head.line>n&&(qo(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Xr(t));else{var l=o.from(),s=o.to(),a=Math.max(n,l.line);n=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1;for(var u=a;u<n;++u)qo(t,u,e);var c=t.doc.sel.ranges;0==l.ch&&r.length==c.length&&c[i].from().ch>0&&vi(t.doc,i,new Os(l,c[i].to()),Kl)}}}),getTokenAt:function(e,t){return et(this,e,t)},getLineTokens:function(e,t){return et(this,P(e),t,!0)},getTokenTypeAt:function(e){e=U(this.doc,e);var t,r=qe(this,M(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=this,i=[];if(!r.hasOwnProperty(t))return i;var o=r[t],l=this.getModeAt(e);if("string"==typeof l[t])o[l[t]]&&i.push(o[l[t]]);else if(l[t])for(var s=0;s<l[t].length;s++){var a=o[l[t][s]];a&&i.push(a)}else l.helperType&&o[l.helperType]?i.push(o[l.helperType]):o[l.name]&&i.push(o[l.name]);for(var u=0;u<o._global.length;u++){var c=o._global[u];c.pred(l,n)&&-1==h(i,c.val)&&i.push(c.val)}return i},getStateAfter:function(e,t){var r=this.doc;return e=G(r,null==e?r.first+r.size-1:e),$e(this,e+1,t).state},cursorCoords:function(e,t){
6
+ var r,n=this.doc.sel.primary();return r=null==e?n.head:"object"==typeof e?U(this.doc,e):e?n.from():n.to(),ar(this,r,t||"page")},charCoords:function(e,t){return sr(this,U(this.doc,e),t||"page")},coordsChar:function(e,t){return e=lr(this,e,t||"page"),fr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=lr(this,{top:e,left:0},t||"page").top,D(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=M(this.doc,e)}else n=e;return or(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ye(n):0)},defaultTextHeight:function(){return yr(this.display)},defaultCharWidth:function(){return br(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=ar(this,U(this.doc,e));var l=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var a=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(l=e.bottom),s+t.offsetWidth>u&&(s=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),r&&Vr(this,{left:s,top:l,right:s+t.offsetWidth,bottom:l+t.offsetHeight})},triggerOnKeyDown:gn(To),triggerOnKeyPress:gn(Oo),triggerOnKeyUp:No,triggerOnMouseDown:gn(Wo),execCommand:function(e){if(Vs.hasOwnProperty(e))return Vs[e].call(null,this)},triggerElectric:gn(function(e){Jo(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var l=U(this.doc,e),s=0;s<t&&(l=nl(i.doc,l,o,r,n),!l.hitSide);++s);return l},moveH:gn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?nl(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},Xl)}),deleteH:gn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):fo(this,function(r){var i=nl(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=this,o=1,l=n;t<0&&(o=-1,t=-t);for(var s=U(this.doc,e),a=0;a<t;++a){var u=ar(i,s,"div");if(null==l?l=u.left:u.left=l,s=il(i,u,o,r),s.hitSide)break}return s},moveV:gn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return e<0?l.from():l.to();var s=ar(r,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=il(r,s,e,t);return"page"==t&&l==n.sel.primary()&&jr(r,sr(r,a,"div").top-s.top),a},Xl),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=this.doc,r=M(t,e.line).text,n=e.ch,i=e.ch;if(r){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=r.length||!n?++i:--n;for(var l=r.charAt(n),s=x(l,o)?function(e){return x(e,o)}:/\s/.test(l)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!x(e)};n>0&&s(r.charAt(n-1));)--n;for(;i<r.length&&s(r.charAt(i));)++i}return new Os(P(e.line,n),P(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?s(this.display.cursorDiv,"CodeMirror-overwrite"):zl(this.display.cursorDiv,"CodeMirror-overwrite"),Te(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==l()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:gn(function(e,t){Yr(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Rt(this)-this.display.barHeight,width:e.scrollWidth-Rt(this)-this.display.barWidth,clientHeight:Gt(this),clientWidth:Bt(this)}},scrollIntoView:gn(function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:P(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?_r(this,e):$r(this,e.from,e.to,e.margin)}),setSize:gn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&er(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){yn(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,Te(this,"refresh",this)}),operation:function(e){return dn(this,e)},startOperation:function(){return on(this)},endOperation:function(){return ln(this)},refresh:gn(function(){var e=this.display.cachedTextHeight;mn(this),this.curOp.forceUpdate=!0,tr(this),Yr(this,this.doc.scrollLeft,this.doc.scrollTop),Dn(this),(null==e||Math.abs(e-yr(this.display))>.5)&&Sr(this),Te(this,"refresh",this)}),swapDoc:gn(function(e){var t=this.doc;return t.cm=null,Zn(this,e),tr(this),this.display.input.reset(),Yr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,wt(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ae(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Yo);var ra="iter insert remove copy getEditor constructor".split(" ");for(var na in Ps.prototype)Ps.prototype.hasOwnProperty(na)&&h(ra,na)<0&&(Yo.prototype[na]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ps.prototype[na]));return Ae(Ps),Yo.inputStyles={textarea:ta,contenteditable:ea},Yo.defineMode=function(e){Yo.defaults.mode||"null"==e||(Yo.defaults.mode=e),Be.apply(this,arguments)},Yo.defineMIME=Ge,Yo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Yo.defineMIME("text/plain","null"),Yo.defineExtension=function(e,t){Yo.prototype[e]=t},Yo.defineDocExtension=function(e,t){Ps.prototype[e]=t},Yo.fromTextArea=fl,function(e){e.off=ke,e.on=ts,e.wheelEventPixels=zn,e.Doc=Ps,e.splitLines=ns,e.countColumn=f,e.findColumn=d,e.isWordChar=w,e.Pass=Vl,e.signal=Te,e.Line=ps,e.changeEnd=Gn,e.scrollbarModel=Ss,e.Pos=P,e.cmpPos=E,e.modes=ss,e.mimeModes=as,e.resolveMode=Ue,e.getMode=Ve,e.modeExtensions=us,e.extendMode=Ke,e.copyState=je,e.startState=Ye,e.innerMode=Xe,e.commands=Vs,e.keyMap=Us,e.keyName=uo,e.isModifierKey=so,e.lookupKey=lo,e.normalizeKeyMap=oo,e.StringStream=cs,e.SharedTextMarker=Hs,e.TextMarker=Ds,e.LineWidget=As,e.e_preventDefault=We,e.e_stopPropagation=De,e.e_stop=Fe,e.addClass=s,e.contains=o,e.rmClass=zl,e.keyNames=Is}(Yo),Yo.version="5.33.0",Yo}),function(e){"function"==typeof e.define&&e.define("core",["codemirror.js"],function(t){e.CodeMirror=t})}(this);
@@ -0,0 +1 @@
1
+ CodeMirror.defineMode("bbcode",function(b){var e,a,g;e={bbCodeTags:"b i u s img quote code list table tr td size color url",bbCodeUnaryTags:"* :-) hr cut"};if(b.hasOwnProperty("bbCodeTags")){e.bbCodeTags=b.bbCodeTags}if(b.hasOwnProperty("bbCodeUnaryTags")){e.bbCodeUnaryTags=b.bbCodeUnaryTags}var f={cont:function(i,h){g=h;return i},escapeRegEx:function(h){return h.replace(/([\:\-\)\(\*\+\?\[\]])/g,"\\$1")}};var d={validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/,tags:new RegExp("(?:"+f.escapeRegEx(e.bbCodeTags).split(" ").join("|")+")"),unaryTags:new RegExp("(?:"+f.escapeRegEx(e.bbCodeUnaryTags).split(" ").join("|")+")")};var c={tokenizer:function(i,h){if(i.eatSpace()){return null}if(i.match("[",true)){h.tokenize=c.bbcode;return f.cont("tag","startTag")}i.next();return null},inAttribute:function(h){return function(k,i){var l=null;var j=null;while(!k.eol()){j=k.peek();if(k.next()==h&&l!=="\\"){i.tokenize=c.bbcode;break}l=j}return"string"}},bbcode:function(k,i){if(a=k.match("]",true)){i.tokenize=c.tokenizer;return f.cont("tag",null)}if(k.match("[",true)){return f.cont("tag","startTag")}var h=k.next();if(d.stringChar.test(h)){i.tokenize=c.inAttribute(h);return f.cont("string","string")}else{if(/\d/.test(h)){k.eatWhile(/\d/);return f.cont("number","number")}else{if(i.last=="whitespace"){k.eatWhile(d.validIdentifier);return f.cont("attribute","modifier")}if(i.last=="property"){k.eatWhile(d.validIdentifier);return f.cont("property",null)}else{if(/\s/.test(h)){g="whitespace";return null}}var j="";if(h!="/"){j+=h}var l=null;while(l=k.eat(d.validIdentifier)){j+=l}if(d.unaryTags.test(j)){return f.cont("atom","atom")}if(d.tags.test(j)){return f.cont("keyword","keyword")}if(/\s/.test(h)){return null}return f.cont("tag","tag")}}}};return{startState:function(){return{tokenize:c.tokenizer,mode:"bbcode",last:null}},token:function(j,i){var h=i.tokenize(j,i);i.last=g;return h},electricChars:""}});CodeMirror.defineMIME("text/x-bbcode","bbcode");
@@ -0,0 +1 @@
1
+ (function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){var b={autoSelfClosers:{area:true,base:true,br:true,col:true,command:true,embed:true,frame:true,hr:true,img:true,input:true,keygen:true,link:true,meta:true,param:true,source:true,track:true,wbr:true,menuitem:true},implicitlyClosed:{dd:true,li:true,optgroup:true,option:true,p:true,rp:true,rt:true,tbody:true,td:true,tfoot:true,th:true,tr:true},contextGrabbers:{dd:{dd:true,dt:true},dt:{dd:true,dt:true},li:{li:true},option:{option:true,optgroup:true},optgroup:{optgroup:true},p:{address:true,article:true,aside:true,blockquote:true,dir:true,div:true,dl:true,fieldset:true,footer:true,form:true,h1:true,h2:true,h3:true,h4:true,h5:true,h6:true,header:true,hgroup:true,hr:true,menu:true,nav:true,ol:true,p:true,pre:true,section:true,table:true,ul:true},rp:{rp:true,rt:true},rt:{rp:true,rt:true},tbody:{tbody:true,tfoot:true},td:{td:true,th:true},tfoot:{tbody:true},th:{td:true,th:true},thead:{tbody:true,tfoot:true},tr:{tr:true}},doNotIndent:{pre:true},allowUnquoted:true,allowMissing:true,caseFold:true};var c={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:false,allowMissing:false,allowMissingTagName:false,caseFold:false};a.defineMode("xml",function(m,y){var r=m.indentUnit;var z={};var l=y.htmlMode?b:c;for(var f in l){z[f]=l[f]}for(var f in y){z[f]=y[f]}var g,h;function p(G,F){function D(H){F.tokenize=H;return H(G,F)}var E=G.next();if(E=="<"){if(G.eat("!")){if(G.eat("[")){if(G.match("CDATA[")){return D(x("atom","]]>"))}else{return null}}else{if(G.match("--")){return D(x("comment","-->"))}else{if(G.match("DOCTYPE",true,true)){G.eatWhile(/[\w\._\-]/);return D(A(1))}else{return null}}}}else{if(G.eat("?")){G.eatWhile(/[\w\._\-]/);F.tokenize=x("meta","?>");return"meta"}else{g=G.eat("/")?"closeTag":"openTag";F.tokenize=o;return"tag bracket"}}}else{if(E=="&"){var C;if(G.eat("#")){if(G.eat("x")){C=G.eatWhile(/[a-fA-F\d]/)&&G.eat(";")}else{C=G.eatWhile(/[\d]/)&&G.eat(";")}}else{C=G.eatWhile(/[\w\.\-:]/)&&G.eat(";")}return C?"atom":"error"}else{G.eatWhile(/[^&<]/);return null}}}p.isInText=true;function o(F,E){var D=F.next();if(D==">"||(D=="/"&&F.eat(">"))){E.tokenize=p;g=D==">"?"endTag":"selfcloseTag";return"tag bracket"}else{if(D=="="){g="equals";return null}else{if(D=="<"){E.tokenize=p;E.state=n;E.tagName=E.tagStart=null;var C=E.tokenize(F,E);return C?C+" tag error":"tag error"}else{if(/[\'\"]/.test(D)){E.tokenize=k(D);E.stringStartCol=F.column();return E.tokenize(F,E)}else{F.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/);return"word"}}}}}function k(C){var D=function(F,E){while(!F.eol()){if(F.next()==C){E.tokenize=o;break}}return"string"};D.isInAttribute=true;return D}function x(D,C){return function(F,E){while(!F.eol()){if(F.match(C)){E.tokenize=p;break}F.next()}return D}}function A(C){return function(F,E){var D;while((D=F.next())!=null){if(D=="<"){E.tokenize=A(C+1);return E.tokenize(F,E)}else{if(D==">"){if(C==1){E.tokenize=p;break}else{E.tokenize=A(C-1);return E.tokenize(F,E)}}}}return"meta"}}function t(D,C,E){this.prev=D.context;this.tagName=C;this.indent=D.indented;this.startOfLine=E;if(z.doNotIndent.hasOwnProperty(C)||(D.context&&D.context.noIndent)){this.noIndent=true}}function w(C){if(C.context){C.context=C.context.prev}}function s(E,D){var C;while(true){if(!E.context){return}C=E.context.tagName;if(!z.contextGrabbers.hasOwnProperty(C)||!z.contextGrabbers[C].hasOwnProperty(D)){return}w(E)}}function n(C,E,D){if(C=="openTag"){D.tagStart=E.column();return d}else{if(C=="closeTag"){return v}else{return n}}}function d(C,E,D){if(C=="word"){D.tagName=E.current();h="tag";return e}else{if(z.allowMissingTagName&&C=="endTag"){h="tag bracket";return e(C,E,D)}else{h="error";return d}}}function v(D,F,E){if(D=="word"){var C=F.current();if(E.context&&E.context.tagName!=C&&z.implicitlyClosed.hasOwnProperty(E.context.tagName)){w(E)}if((E.context&&E.context.tagName==C)||z.matchClosing===false){h="tag";return u}else{h="tag error";return B}}else{if(z.allowMissingTagName&&D=="endTag"){h="tag bracket";return u(D,F,E)}else{h="error";return B}}}function u(D,C,E){if(D!="endTag"){h="error";return u}w(E);return n}function B(C,E,D){h="error";return u(C,E,D)}function e(F,D,G){if(F=="word"){h="attribute";return j}else{if(F=="endTag"||F=="selfcloseTag"){var E=G.tagName,C=G.tagStart;G.tagName=G.tagStart=null;if(F=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(E)){s(G,E)}else{s(G,E);G.context=new t(G,E,C==G.indented)}return n}}h="error";return e}function j(C,E,D){if(C=="equals"){return q}if(!z.allowMissing){h="error"}return e(C,E,D)}function q(C,E,D){if(C=="string"){return i}if(C=="word"&&z.allowUnquoted){h="string";return e}h="error";return e(C,E,D)}function i(C,E,D){if(C=="string"){return i}return e(C,E,D)}return{startState:function(C){var D={tokenize:p,state:n,indented:C||0,tagName:null,tagStart:null,context:null};if(C!=null){D.baseIndent=C}return D},token:function(E,D){if(!D.tagName&&E.sol()){D.indented=E.indentation()}if(E.eatSpace()){return null}g=null;var C=D.tokenize(E,D);if((C||g)&&C!="comment"){h=null;D.state=D.state(g||C,E,D);if(h){C=h=="error"?C+" error":h}}return C},indent:function(H,D,G){var F=H.context;if(H.tokenize.isInAttribute){if(H.tagStart==H.indented){return H.stringStartCol+1}else{return H.indented+r}}if(F&&F.noIndent){return a.Pass}if(H.tokenize!=o&&H.tokenize!=p){return G?G.match(/^(\s*)/)[0].length:0}if(H.tagName){if(z.multilineTagIndentPastTag!==false){return H.tagStart+H.tagName.length+2}else{return H.tagStart+r*(z.multilineTagIndentFactor||1)}}if(z.alignCDATA&&/<!\[CDATA\[/.test(D)){return 0}var C=D&&/^<(\/)?([\w_:\.-]*)/.exec(D);if(C&&C[1]){while(F){if(F.tagName==C[2]){F=F.prev;break}else{if(z.implicitlyClosed.hasOwnProperty(F.tagName)){F=F.prev}else{break}}}}else{if(C){while(F){var E=z.contextGrabbers[F.tagName];if(E&&E.hasOwnProperty(C[2])){F=F.prev}else{break}}}}while(F&&F.prev&&!F.startOfLine){F=F.prev}if(F){return F.indent+r}else{return H.baseIndent||0}},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:z.htmlMode?"html":"xml",helperType:z.htmlMode?"html":"xml",skipAttribute:function(C){if(C.state==q){C.state=e}}}});a.defineMIME("text/xml","xml");a.defineMIME("application/xml","xml");if(!a.mimeModes.hasOwnProperty("text/html")){a.defineMIME("text/html",{name:"xml",htmlMode:true})}});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(a){a.defineMode("javascript",function(ak,aw){var o=ak.indentUnit;var E=aw.statementIndent;var aM=aw.jsonld;var D=aw.json||aM;var g=aw.typescript;var aH=aw.wordCharacters||/[\w$\xa1-\uffff]/;var aF=function(){function aZ(a3){return{type:a3,style:"keyword"}}var aW=aZ("keyword a"),a2=aZ("keyword b"),a1=aZ("keyword c"),a0=aZ("keyword d");var aX=aZ("operator"),aY={type:"atom",style:"atom"};return{"if":aZ("if"),"while":aW,"with":aW,"else":a2,"do":a2,"try":a2,"finally":a2,"return":a0,"break":a0,"continue":a0,"new":aZ("new"),"delete":a1,"void":a1,"throw":a1,"debugger":aZ("debugger"),"var":aZ("var"),"const":aZ("var"),let:aZ("var"),"function":aZ("function"),"catch":aZ("catch"),"for":aZ("for"),"switch":aZ("switch"),"case":aZ("case"),"default":aZ("default"),"in":aX,"typeof":aX,"instanceof":aX,"true":aY,"false":aY,"null":aY,"undefined":aY,"NaN":aY,"Infinity":aY,"this":aZ("this"),"class":aZ("class"),"super":aZ("atom"),yield:a1,"export":aZ("export"),"import":aZ("import"),"extends":a1,await:a1}}();var W=/[+\-*&%=<>!?|~^@]/;var aE=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function J(aZ){var aX=false,aW,aY=false;while((aW=aZ.next())!=null){if(!aX){if(aW=="/"&&!aY){return}if(aW=="["){aY=true}else{if(aY&&aW=="]"){aY=false}}}aX=!aX&&aW=="\\"}}var ab,K;function R(aY,aX,aW){ab=aY;K=aW;return aX}function ad(a0,aY){var aW=a0.next();if(aW=='"'||aW=="'"){aY.tokenize=aa(aW);return aY.tokenize(a0,aY)}else{if(aW=="."&&a0.match(/^\d+(?:[eE][+\-]?\d+)?/)){return R("number","number")}else{if(aW=="."&&a0.match("..")){return R("spread","meta")}else{if(/[\[\]{}\(\),;\:\.]/.test(aW)){return R(aW)}else{if(aW=="="&&a0.eat(">")){return R("=>","operator")}else{if(aW=="0"&&a0.eat(/x/i)){a0.eatWhile(/[\da-f]/i);return R("number","number")}else{if(aW=="0"&&a0.eat(/o/i)){a0.eatWhile(/[0-7]/i);return R("number","number")}else{if(aW=="0"&&a0.eat(/b/i)){a0.eatWhile(/[01]/i);return R("number","number")}else{if(/\d/.test(aW)){a0.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);return R("number","number")}else{if(aW=="/"){if(a0.eat("*")){aY.tokenize=aL;return aL(a0,aY)}else{if(a0.eat("/")){a0.skipToEnd();return R("comment","comment")}else{if(aT(a0,aY,1)){J(a0);a0.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);return R("regexp","string-2")}else{a0.eat("=");return R("operator","operator",a0.current())}}}}else{if(aW=="`"){aY.tokenize=aO;return aO(a0,aY)}else{if(aW=="#"){a0.skipToEnd();return R("error","error")}else{if(W.test(aW)){if(aW!=">"||!aY.lexical||aY.lexical.type!=">"){if(a0.eat("=")){if(aW=="!"||aW=="="){a0.eat("=")}}else{if(/[<>*+\-]/.test(aW)){a0.eat(aW);if(aW==">"){a0.eat(aW)}}}}return R("operator","operator",a0.current())}else{if(aH.test(aW)){a0.eatWhile(aH);var aZ=a0.current();if(aY.lastType!="."){if(aF.propertyIsEnumerable(aZ)){var aX=aF[aZ];return R(aX.type,aX.style,aZ)}if(aZ=="async"&&a0.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,false)){return R("async","keyword",aZ)}}return R("variable","variable",aZ)}}}}}}}}}}}}}}}function aa(aW){return function(a0,aY){var aZ=false,aX;if(aM&&a0.peek()=="@"&&a0.match(aE)){aY.tokenize=ad;return R("jsonld-keyword","meta")}while((aX=a0.next())!=null){if(aX==aW&&!aZ){break}aZ=!aZ&&aX=="\\"}if(!aZ){aY.tokenize=ad}return R("string","string")}}function aL(aZ,aY){var aW=false,aX;while(aX=aZ.next()){if(aX=="/"&&aW){aY.tokenize=ad;break}aW=(aX=="*")}return R("comment","comment")}function aO(aZ,aX){var aY=false,aW;while((aW=aZ.next())!=null){if(!aY&&(aW=="`"||aW=="$"&&aZ.eat("{"))){aX.tokenize=ad;break}aY=!aY&&aW=="\\"}return R("quasi","string-2",aZ.current())}var p="([{}])";function aJ(a4,aY){if(aY.fatArrowAt){aY.fatArrowAt=null}var a3=a4.string.indexOf("=>",a4.start);if(a3<0){return}if(g){var a0=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(a4.string.slice(a4.start,a3));if(a0){a3=a0.index}}var a1=0,aZ=false;for(var a2=a3-1;a2>=0;--a2){var aW=a4.string.charAt(a2);var aX=p.indexOf(aW);if(aX>=0&&aX<3){if(!a1){++a2;break}if(--a1==0){if(aW=="("){aZ=true}break}}else{if(aX>=3&&aX<6){++a1}else{if(aH.test(aW)){aZ=true}else{if(/["'\/]/.test(aW)){return}else{if(aZ&&!a1){++a2;break}}}}}}if(aZ&&!a1){aY.fatArrowAt=a2}}var b={atom:true,number:true,variable:true,string:true,regexp:true,"this":true,"jsonld-keyword":true};function P(a1,aX,aW,a0,aY,aZ){this.indented=a1;this.column=aX;this.type=aW;this.prev=aY;this.info=aZ;if(a0!=null){this.align=a0}}function w(aZ,aY){for(var aX=aZ.localVars;aX;aX=aX.next){if(aX.name==aY){return true}}for(var aW=aZ.context;aW;aW=aW.prev){for(var aX=aW.vars;aX;aX=aX.next){if(aX.name==aY){return true}}}}function f(a0,aX,aW,aZ,a1){var a2=a0.cc;I.state=a0;I.stream=a1;I.marked=null,I.cc=a2;I.style=aX;if(!a0.lexical.hasOwnProperty("align")){a0.lexical.align=true}while(true){var aY=a2.length?a2.pop():D?aA:aS;if(aY(aW,aZ)){while(a2.length&&a2[a2.length-1].lex){a2.pop()()}if(I.marked){return I.marked}if(aW=="variable"&&w(a0,aZ)){return"variable-2"}return aX}}}var I={state:null,column:null,marked:null,cc:null};function al(){for(var aW=arguments.length-1;aW>=0;aW--){I.cc.push(arguments[aW])}}function aq(){al.apply(null,arguments);return true}function aI(aX){function aW(a0){for(var aZ=a0;aZ;aZ=aZ.next){if(aZ.name==aX){return true}}return false}var aY=I.state;I.marked="def";if(aY.context){if(aW(aY.localVars)){return}aY.localVars={name:aX,next:aY.localVars}}else{if(aW(aY.globalVars)){return}if(aw.globalVars){aY.globalVars={name:aX,next:aY.globalVars}}}}function ax(aW){return aW=="public"||aW=="private"||aW=="protected"||aW=="abstract"||aW=="readonly"}var u={name:"this",next:{name:"arguments"}};function A(){I.state.context={prev:I.state.context,vars:I.state.localVars};I.state.localVars=u}function B(){I.state.localVars=I.state.context.vars;I.state.context=I.state.context.prev}function aQ(aX,aY){var aW=function(){var a1=I.state,aZ=a1.indented;if(a1.lexical.type=="stat"){aZ=a1.lexical.indented}else{for(var a0=a1.lexical;a0&&a0.type==")"&&a0.align;a0=a0.prev){aZ=a0.indented}}a1.lexical=new P(aZ,I.stream.column(),aX,null,a1.lexical,aY)};aW.lex=true;return aW}function h(){var aW=I.state;if(aW.lexical.prev){if(aW.lexical.type==")"){aW.indented=aW.lexical.indented}aW.lexical=aW.lexical.prev}}h.lex=true;function v(aW){function aX(aY){if(aY==aW){return aq()}else{if(aW==";"){return al()}else{return aq(aX)}}}return aX}function aS(aW,aX){if(aW=="var"){return aq(aQ("vardef",aX.length),c,v(";"),h)}if(aW=="keyword a"){return aq(aQ("form"),aB,aS,h)}if(aW=="keyword b"){return aq(aQ("form"),aS,h)}if(aW=="keyword d"){return I.stream.match(/^\s*$/,false)?aq():aq(aQ("stat"),av,v(";"),h)}if(aW=="debugger"){return aq(v(";"))}if(aW=="{"){return aq(aQ("}"),C,h)}if(aW==";"){return aq()}if(aW=="if"){if(I.state.lexical.info=="else"&&I.state.cc[I.state.cc.length-1]==h){I.state.cc.pop()()}return aq(aQ("form"),aB,aS,h,d)}if(aW=="function"){return aq(S)}if(aW=="for"){return aq(aQ("form"),y,aS,h)}if(aW=="class"||(g&&aX=="interface")){I.marked="keyword";return aq(aQ("form"),ag,h)}if(aW=="variable"){if(g&&aX=="type"){I.marked="keyword";return aq(j,v("operator"),j,v(";"))}else{if(g&&aX=="declare"){I.marked="keyword";return aq(aS)}else{if(g&&(aX=="module"||aX=="enum")&&I.stream.match(/^\s*\w/,false)){I.marked="keyword";return aq(aQ("form"),i,v("{"),aQ("}"),C,h,h)}else{if(g&&aX=="namespace"){I.marked="keyword";return aq(aQ("form"),aA,C,h)}else{return aq(aQ("stat"),aU)}}}}}if(aW=="switch"){return aq(aQ("form"),aB,v("{"),aQ("}","switch"),C,h,h)}if(aW=="case"){return aq(aA,v(":"))}if(aW=="default"){return aq(v(":"))}if(aW=="catch"){return aq(aQ("form"),A,v("("),ap,v(")"),aS,h,B)}if(aW=="export"){return aq(aQ("stat"),aR,h)}if(aW=="import"){return aq(aQ("stat"),ar,h)}if(aW=="async"){return aq(aS)}if(aX=="@"){return aq(aA,aS)}return al(aQ("stat"),aA,v(";"),h)}function aA(aW,aX){return aj(aW,aX,false)}function aP(aW,aX){return aj(aW,aX,true)}function aB(aW){if(aW!="("){return al()}return aq(aQ(")"),aA,v(")"),h)}function aj(aX,aY,a0){if(I.state.fatArrowAt==I.stream.start){var aW=a0?T:ah;if(aX=="("){return aq(A,aQ(")"),aG(ap,")"),h,v("=>"),aW,B)}else{if(aX=="variable"){return al(A,i,v("=>"),aW,B)}}}var aZ=a0?k:am;if(b.hasOwnProperty(aX)){return aq(aZ)}if(aX=="function"){return aq(S,aZ)}if(aX=="class"||(g&&aY=="interface")){I.marked="keyword";return aq(aQ("form"),N,h)}if(aX=="keyword c"||aX=="async"){return aq(a0?aP:aA)}if(aX=="("){return aq(aQ(")"),av,v(")"),h,aZ)}if(aX=="operator"||aX=="spread"){return aq(a0?aP:aA)}if(aX=="["){return aq(aQ("]"),q,h,aZ)}if(aX=="{"){return aK(x,"}",null,aZ)}if(aX=="quasi"){return al(X,aZ)}if(aX=="new"){return aq(M(a0))}return aq()}function av(aW){if(aW.match(/[;\}\)\],]/)){return al()}return al(aA)}function am(aW,aX){if(aW==","){return aq(aA)}return k(aW,aX,false)}function k(aW,aY,a0){var aX=a0==false?am:k;var aZ=a0==false?aA:aP;if(aW=="=>"){return aq(A,a0?T:ah,B)}if(aW=="operator"){if(/\+\+|--/.test(aY)||g&&aY=="!"){return aq(aX)}if(g&&aY=="<"&&I.stream.match(/^([^>]|<.*?>)*>\s*\(/,false)){return aq(aQ(">"),aG(j,">"),h,aX)}if(aY=="?"){return aq(aA,v(":"),aZ)}return aq(aZ)}if(aW=="quasi"){return al(X,aX)}if(aW==";"){return}if(aW=="("){return aK(aP,")","call",aX)}if(aW=="."){return aq(ay,aX)}if(aW=="["){return aq(aQ("]"),av,v("]"),h,aX)}if(g&&aY=="as"){I.marked="keyword";return aq(j,aX)}if(aW=="regexp"){I.state.lastType=I.marked="operator";I.stream.backUp(I.stream.pos-I.stream.start-1);return aq(aZ)}}function X(aW,aX){if(aW!="quasi"){return al()}if(aX.slice(aX.length-2)!="${"){return aq(X)}return aq(aA,t)}function t(aW){if(aW=="}"){I.marked="string-2";I.state.tokenize=aO;return aq(X)}}function ah(aW){aJ(I.stream,I.state);return al(aW=="{"?aS:aA)}function T(aW){aJ(I.stream,I.state);return al(aW=="{"?aS:aP)}function M(aW){return function(aX){if(aX=="."){return aq(aW?r:af)}else{if(aX=="variable"&&g){return aq(e,aW?k:am)}else{return al(aW?aP:aA)}}}}function af(aW,aX){if(aX=="target"){I.marked="keyword";return aq(am)}}function r(aW,aX){if(aX=="target"){I.marked="keyword";return aq(k)}}function aU(aW){if(aW==":"){return aq(h,aS)}return al(am,v(";"),h)}function ay(aW){if(aW=="variable"){I.marked="property";return aq()}}function x(aX,aY){if(aX=="async"){I.marked="property";return aq(x)}else{if(aX=="variable"||I.style=="keyword"){I.marked="property";if(aY=="get"||aY=="set"){return aq(O)}var aW;if(g&&I.state.fatArrowAt==I.stream.start&&(aW=I.stream.match(/^\s*:\s*/,false))){I.state.fatArrowAt=I.stream.pos+aW[0].length}return aq(Q)}else{if(aX=="number"||aX=="string"){I.marked=aM?"property":(I.style+" property");return aq(Q)}else{if(aX=="jsonld-keyword"){return aq(Q)}else{if(g&&ax(aY)){I.marked="keyword";return aq(x)}else{if(aX=="["){return aq(aA,ac,v("]"),Q)}else{if(aX=="spread"){return aq(aP,Q)}else{if(aY=="*"){I.marked="keyword";return aq(x)}else{if(aX==":"){return al(Q)}}}}}}}}}}function O(aW){if(aW!="variable"){return al(Q)}I.marked="property";return aq(S)}function Q(aW){if(aW==":"){return aq(aP)}if(aW=="("){return al(S)}}function aG(aZ,aW,aX){function aY(a1,a2){if(aX?aX.indexOf(a1)>-1:a1==","){var a0=I.state.lexical;if(a0.info=="call"){a0.pos=(a0.pos||0)+1}return aq(function(a3,a4){if(a3==aW||a4==aW){return al()}return al(aZ)},aY)}if(a1==aW||a2==aW){return aq()}return aq(v(aW))}return function(a0,a1){if(a0==aW||a1==aW){return aq()}return al(aZ,aY)}}function aK(aZ,aW,aY){for(var aX=3;aX<arguments.length;aX++){I.cc.push(arguments[aX])}return aq(aQ(aW,aY),aG(aZ,aW),h)}function C(aW){if(aW=="}"){return aq()}return al(aS,C)}function ac(aW,aX){if(g){if(aW==":"){return aq(j)}if(aX=="?"){return aq(ac)}}}function U(aW){if(g&&aW==":"){if(I.stream.match(/^\s*\w+\s+is\b/,false)){return aq(aA,Y,j)}else{return aq(j)}}}function Y(aW,aX){if(aX=="is"){I.marked="keyword";return aq()}}function j(aW,aX){if(aW=="variable"||aX=="void"){if(aX=="keyof"){I.marked="keyword";return aq(j)}else{I.marked="type";return aq(L)}}if(aW=="string"||aW=="number"||aW=="atom"){return aq(L)}if(aW=="["){return aq(aQ("]"),aG(j,"]",","),h,L)}if(aW=="{"){return aq(aQ("}"),aG(az,"}",",;"),h,L)}if(aW=="("){return aq(aG(an,")"),Z)}}function Z(aW){if(aW=="=>"){return aq(j)}}function az(aW,aX){if(aW=="variable"||I.style=="keyword"){I.marked="property";return aq(az)}else{if(aX=="?"){return aq(az)}else{if(aW==":"){return aq(j)}else{if(aW=="["){return aq(aA,ac,v("]"),az)}}}}}function an(aW){if(aW=="variable"){return aq(an)}else{if(aW==":"){return aq(j)}}}function L(aW,aX){if(aX=="<"){return aq(aQ(">"),aG(j,">"),h,L)}if(aX=="|"||aW=="."){return aq(j)}if(aW=="["){return aq(v("]"),L)}if(aX=="extends"||aX=="implements"){I.marked="keyword";return aq(j)}}function e(aW,aX){if(aX=="<"){return aq(aQ(">"),aG(j,">"),h,L)}}function n(){return al(j,ae)}function ae(aW,aX){if(aX=="="){return aq(j)}}function c(){return al(i,ac,ao,ai)}function i(aW,aX){if(g&&ax(aX)){I.marked="keyword";return aq(i)}if(aW=="variable"){aI(aX);return aq()}if(aW=="spread"){return aq(i)}if(aW=="["){return aK(i,"]")}if(aW=="{"){return aK(aN,"}")}}function aN(aW,aX){if(aW=="variable"&&!I.stream.match(/^\s*:/,false)){aI(aX);return aq(ao)}if(aW=="variable"){I.marked="property"}if(aW=="spread"){return aq(i)}if(aW=="}"){return al()}return aq(v(":"),i,ao)}function ao(aW,aX){if(aX=="="){return aq(aP)}}function ai(aW){if(aW==","){return aq(c)}}function d(aW,aX){if(aW=="keyword b"&&aX=="else"){return aq(aQ("form","else"),aS,h)}}function y(aW){if(aW=="("){return aq(aQ(")"),H,v(")"),h)}}function H(aW){if(aW=="var"){return aq(c,v(";"),G)}if(aW==";"){return aq(G)}if(aW=="variable"){return aq(z)}return al(aA,v(";"),G)}function z(aW,aX){if(aX=="in"||aX=="of"){I.marked="keyword";return aq(aA)}return aq(am,G)}function G(aW,aX){if(aW==";"){return aq(F)}if(aX=="in"||aX=="of"){I.marked="keyword";return aq(aA)}return al(aA,v(";"),F)}function F(aW){if(aW!=")"){aq(aA)}}function S(aW,aX){if(aX=="*"){I.marked="keyword";return aq(S)}if(aW=="variable"){aI(aX);return aq(S)}if(aW=="("){return aq(A,aQ(")"),aG(ap,")"),h,U,aS,B)}if(g&&aX=="<"){return aq(aQ(">"),aG(n,">"),h,S)}}function ap(aW,aX){if(aX=="@"){aq(aA,ap)}if(aW=="spread"){return aq(ap)}if(g&&ax(aX)){I.marked="keyword";return aq(ap)}return al(i,ac,ao)}function N(aW,aX){if(aW=="variable"){return ag(aW,aX)}return V(aW,aX)}function ag(aW,aX){if(aW=="variable"){aI(aX);return aq(V)}}function V(aW,aX){if(aX=="<"){return aq(aQ(">"),aG(n,">"),h,V)}if(aX=="extends"||aX=="implements"||(g&&aW==",")){return aq(g?j:aA,V)}if(aW=="{"){return aq(aQ("}"),s,h)}}function s(aW,aX){if(aW=="async"||(aW=="variable"&&(aX=="static"||aX=="get"||aX=="set"||(g&&ax(aX)))&&I.stream.match(/^\s+[\w$\xa1-\uffff]/,false))){I.marked="keyword";return aq(s)}if(aW=="variable"||I.style=="keyword"){I.marked="property";return aq(g?aV:S,s)}if(aW=="["){return aq(aA,ac,v("]"),g?aV:S,s)}if(aX=="*"){I.marked="keyword";return aq(s)}if(aW==";"){return aq(s)}if(aW=="}"){return aq()}if(aX=="@"){return aq(aA,s)}}function aV(aW,aX){if(aX=="?"){return aq(aV)}if(aW==":"){return aq(j,ao)}if(aX=="="){return aq(aP)}return al(S)}function aR(aW,aX){if(aX=="*"){I.marked="keyword";return aq(au,v(";"))}if(aX=="default"){I.marked="keyword";return aq(aA,v(";"))}if(aW=="{"){return aq(aG(at,"}"),au,v(";"))}return al(aS)}function at(aW,aX){if(aX=="as"){I.marked="keyword";return aq(v("variable"))}if(aW=="variable"){return al(aP,at)}}function ar(aW){if(aW=="string"){return aq()}return al(aD,m,au)}function aD(aW,aX){if(aW=="{"){return aK(aD,"}")}if(aW=="variable"){aI(aX)}if(aX=="*"){I.marked="keyword"}return aq(l)}function m(aW){if(aW==","){return aq(aD,m)}}function l(aW,aX){if(aX=="as"){I.marked="keyword";return aq(aD)}}function au(aW,aX){if(aX=="from"){I.marked="keyword";return aq(aA)}}function q(aW){if(aW=="]"){return aq()}return al(aG(aP,"]"))}function aC(aX,aW){return aX.lastType=="operator"||aX.lastType==","||W.test(aW.charAt(0))||/[,.]/.test(aW.charAt(0))}function aT(aY,aX,aW){return aX.tokenize==ad&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(aX.lastType)||(aX.lastType=="quasi"&&/\{\s*$/.test(aY.string.slice(0,aY.pos-(aW||0))))}return{startState:function(aX){var aW={tokenize:ad,lastType:"sof",cc:[],lexical:new P((aX||0)-o,0,"block",false),localVars:aw.localVars,context:aw.localVars&&{vars:aw.localVars},indented:aX||0};if(aw.globalVars&&typeof aw.globalVars=="object"){aW.globalVars=aw.globalVars}return aW},token:function(aY,aX){if(aY.sol()){if(!aX.lexical.hasOwnProperty("align")){aX.lexical.align=false}aX.indented=aY.indentation();aJ(aY,aX)}if(aX.tokenize!=aL&&aY.eatSpace()){return null}var aW=aX.tokenize(aY,aX);if(ab=="comment"){return aW}aX.lastType=ab=="operator"&&(K=="++"||K=="--")?"incdec":ab;return f(aX,aW,ab,K,aY)},indent:function(aW,aZ){if(aW.tokenize==aL){return a.Pass}if(aW.tokenize!=ad){return 0}var a3=aZ&&aZ.charAt(0),a4=aW.lexical,a2;if(!/^\s*else\b/.test(aZ)){for(var aY=aW.cc.length-1;aY>=0;--aY){var a0=aW.cc[aY];if(a0==h){a4=a4.prev}else{if(a0!=d){break}}}}while((a4.type=="stat"||a4.type=="form")&&(a3=="}"||((a2=aW.cc[aW.cc.length-1])&&(a2==am||a2==k)&&!/^[,\.=+\-*:?[\(]/.test(aZ)))){a4=a4.prev}if(E&&a4.type==")"&&a4.prev.type=="stat"){a4=a4.prev}var a1=a4.type,aX=a3==a1;if(a1=="vardef"){return a4.indented+(aW.lastType=="operator"||aW.lastType==","?a4.info+1:0)}else{if(a1=="form"&&a3=="{"){return a4.indented}else{if(a1=="form"){return a4.indented+o}else{if(a1=="stat"){return a4.indented+(aC(aW,aZ)?E||o:0)}else{if(a4.info=="switch"&&!aX&&aw.doubleIndentSwitch!=false){return a4.indented+(/^(?:case|default)\b/.test(aZ)?o:2*o)}else{if(a4.align){return a4.column+(aX?0:1)}else{return a4.indented+(aX?0:o)}}}}}}},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:D?null:"/*",blockCommentEnd:D?null:"*/",blockCommentContinue:D?null:" * ",lineComment:D?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:D?"json":"javascript",jsonldMode:aM,jsonMode:D,expressionAllowed:aT,skipExpression:function(aW){var aX=aW.cc[aW.cc.length-1];if(aX==aA||aX==aP){aW.cc.pop()}}}});a.registerHelper("wordChars","javascript",/[\w$]/);a.defineMIME("text/javascript","javascript");a.defineMIME("text/ecmascript","javascript");a.defineMIME("application/javascript","javascript");a.defineMIME("application/x-javascript","javascript");a.defineMIME("application/ecmascript","javascript");a.defineMIME("application/json",{name:"javascript",json:true});a.defineMIME("application/x-json",{name:"javascript",json:true});a.defineMIME("application/ld+json",{name:"javascript",jsonld:true});a.defineMIME("text/typescript",{name:"javascript",typescript:true});a.defineMIME("application/typescript",{name:"javascript",typescript:true})});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror"],a)}else{a(CodeMirror)}}})(function(r){r.defineMode("css",function(Z,J){var D=J.inline;if(!J.propertyKeywords){J=r.resolveMode("text/css")}var Q=Z.indentUnit,A=J.tokenHooks,y=J.documentTypes||{},Y=J.mediaTypes||{},L=J.mediaFeatures||{},P=J.mediaValueKeywords||{},I=J.propertyKeywords||{},B=J.nonStandardPropertyKeywords||{},E=J.fontProperties||{},X=J.counterDescriptors||{},O=J.colorKeywords||{},T=J.valueKeywords||{},M=J.allowNested,S=J.lineComment,V=J.supportsAtComponent===true;var C,N;function aa(ad,ae){C=ae;return ad}function ac(ag,af){var ae=ag.next();if(A[ae]){var ad=A[ae](ag,af);if(ad!==false){return ad}}if(ae=="@"){ag.eatWhile(/[\w\\\-]/);return aa("def",ag.current())}else{if(ae=="="||(ae=="~"||ae=="|")&&ag.eat("=")){return aa(null,"compare")}else{if(ae=='"'||ae=="'"){af.tokenize=K(ae);return af.tokenize(ag,af)}else{if(ae=="#"){ag.eatWhile(/[\w\\\-]/);return aa("atom","hash")}else{if(ae=="!"){ag.match(/^\s*\w*/);return aa("keyword","important")}else{if(/\d/.test(ae)||ae=="."&&ag.eat(/\d/)){ag.eatWhile(/[\w.%]/);return aa("number","unit")}else{if(ae==="-"){if(/[\d.]/.test(ag.peek())){ag.eatWhile(/[\w.%]/);return aa("number","unit")}else{if(ag.match(/^-[\w\\\-]+/)){ag.eatWhile(/[\w\\\-]/);if(ag.match(/^\s*:/,false)){return aa("variable-2","variable-definition")}return aa("variable-2","variable")}else{if(ag.match(/^\w+-/)){return aa("meta","meta")}}}}else{if(/[,+>*\/]/.test(ae)){return aa(null,"select-op")}else{if(ae=="."&&ag.match(/^-?[_a-z][_a-z0-9-]*/i)){return aa("qualifier","qualifier")}else{if(/[:;{}\[\]\(\)]/.test(ae)){return aa(null,ae)}else{if(((ae=="u"||ae=="U")&&ag.match(/rl(-prefix)?\(/i))||((ae=="d"||ae=="D")&&ag.match("omain(",true,true))||((ae=="r"||ae=="R")&&ag.match("egexp(",true,true))){ag.backUp(1);af.tokenize=ab;return aa("property","word")}else{if(/[\w\\\-]/.test(ae)){ag.eatWhile(/[\w\\\-]/);return aa("property","word")}else{return aa(null,null)}}}}}}}}}}}}}function K(ad){return function(ah,af){var ag=false,ae;while((ae=ah.next())!=null){if(ae==ad&&!ag){if(ad==")"){ah.backUp(1)}break}ag=!ag&&ae=="\\"}if(ae==ad||!ag&&ad!=")"){af.tokenize=null}return aa("string","string")}}function ab(ae,ad){ae.next();if(!ae.match(/\s*[\"\')]/,false)){ad.tokenize=K(")")}else{ad.tokenize=null}return aa(null,"(")}function R(ae,ad,af){this.type=ae;this.indent=ad;this.prev=af}function G(af,ag,ae,ad){af.context=new R(ae,ag.indentation()+(ad===false?0:Q),af.context);return ae}function U(ad){if(ad.context.prev){ad.context=ad.context.prev}return ad.context.type}function z(ad,af,ae){return F[ae.context.type](ad,af,ae)}function W(ae,ag,af,ah){for(var ad=ah||1;ad>0;ad--){af.context=af.context.prev}return z(ae,ag,af)}function H(ae){var ad=ae.current().toLowerCase();if(T.hasOwnProperty(ad)){N="atom"}else{if(O.hasOwnProperty(ad)){N="keyword"}else{N="variable"}}}var F={};F.top=function(ad,af,ae){if(ad=="{"){return G(ae,af,"block")}else{if(ad=="}"&&ae.context.prev){return U(ae)}else{if(V&&/@component/i.test(ad)){return G(ae,af,"atComponentBlock")}else{if(/^@(-moz-)?document$/i.test(ad)){return G(ae,af,"documentTypes")}else{if(/^@(media|supports|(-moz-)?document|import)$/i.test(ad)){return G(ae,af,"atBlock")}else{if(/^@(font-face|counter-style)/i.test(ad)){ae.stateArg=ad;return"restricted_atBlock_before"}else{if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(ad)){return"keyframes"}else{if(ad&&ad.charAt(0)=="@"){return G(ae,af,"at")}else{if(ad=="hash"){N="builtin"}else{if(ad=="word"){N="tag"}else{if(ad=="variable-definition"){return"maybeprop"}else{if(ad=="interpolation"){return G(ae,af,"interpolation")}else{if(ad==":"){return"pseudo"}else{if(M&&ad=="("){return G(ae,af,"parens")}}}}}}}}}}}}}}return ae.context.type};F.block=function(ad,ag,ae){if(ad=="word"){var af=ag.current().toLowerCase();if(I.hasOwnProperty(af)){N="property";return"maybeprop"}else{if(B.hasOwnProperty(af)){N="string-2";return"maybeprop"}else{if(M){N=ag.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{N+=" error";return"maybeprop"}}}}else{if(ad=="meta"){return"block"}else{if(!M&&(ad=="hash"||ad=="qualifier")){N="error";return"block"}else{return F.top(ad,ag,ae)}}}};F.maybeprop=function(ad,af,ae){if(ad==":"){return G(ae,af,"prop")}return z(ad,af,ae)};F.prop=function(ad,af,ae){if(ad==";"){return U(ae)}if(ad=="{"&&M){return G(ae,af,"propBlock")}if(ad=="}"||ad=="{"){return W(ad,af,ae)}if(ad=="("){return G(ae,af,"parens")}if(ad=="hash"&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(af.current())){N+=" error"}else{if(ad=="word"){H(af)}else{if(ad=="interpolation"){return G(ae,af,"interpolation")}}}return"prop"};F.propBlock=function(ae,ad,af){if(ae=="}"){return U(af)}if(ae=="word"){N="property";return"maybeprop"}return af.context.type};F.parens=function(ad,af,ae){if(ad=="{"||ad=="}"){return W(ad,af,ae)}if(ad==")"){return U(ae)}if(ad=="("){return G(ae,af,"parens")}if(ad=="interpolation"){return G(ae,af,"interpolation")}if(ad=="word"){H(af)}return"parens"};F.pseudo=function(ad,af,ae){if(ad=="meta"){return"pseudo"}if(ad=="word"){N="variable-3";return ae.context.type}return z(ad,af,ae)};F.documentTypes=function(ad,af,ae){if(ad=="word"&&y.hasOwnProperty(af.current())){N="tag";return ae.context.type}else{return F.atBlock(ad,af,ae)}};F.atBlock=function(ad,ag,ae){if(ad=="("){return G(ae,ag,"atBlock_parens")}if(ad=="}"||ad==";"){return W(ad,ag,ae)}if(ad=="{"){return U(ae)&&G(ae,ag,M?"block":"top")}if(ad=="interpolation"){return G(ae,ag,"interpolation")}if(ad=="word"){var af=ag.current().toLowerCase();if(af=="only"||af=="not"||af=="and"||af=="or"){N="keyword"}else{if(Y.hasOwnProperty(af)){N="attribute"}else{if(L.hasOwnProperty(af)){N="property"}else{if(P.hasOwnProperty(af)){N="keyword"}else{if(I.hasOwnProperty(af)){N="property"}else{if(B.hasOwnProperty(af)){N="string-2"}else{if(T.hasOwnProperty(af)){N="atom"}else{if(O.hasOwnProperty(af)){N="keyword"}else{N="error"}}}}}}}}}return ae.context.type};F.atComponentBlock=function(ad,af,ae){if(ad=="}"){return W(ad,af,ae)}if(ad=="{"){return U(ae)&&G(ae,af,M?"block":"top",false)}if(ad=="word"){N="error"}return ae.context.type};F.atBlock_parens=function(ad,af,ae){if(ad==")"){return U(ae)}if(ad=="{"||ad=="}"){return W(ad,af,ae,2)}return F.atBlock(ad,af,ae)};F.restricted_atBlock_before=function(ad,af,ae){if(ad=="{"){return G(ae,af,"restricted_atBlock")}if(ad=="word"&&ae.stateArg=="@counter-style"){N="variable";return"restricted_atBlock_before"}return z(ad,af,ae)};F.restricted_atBlock=function(ad,af,ae){if(ad=="}"){ae.stateArg=null;return U(ae)}if(ad=="word"){if((ae.stateArg=="@font-face"&&!E.hasOwnProperty(af.current().toLowerCase()))||(ae.stateArg=="@counter-style"&&!X.hasOwnProperty(af.current().toLowerCase()))){N="error"}else{N="property"}return"maybeprop"}return"restricted_atBlock"};F.keyframes=function(ad,af,ae){if(ad=="word"){N="variable";return"keyframes"}if(ad=="{"){return G(ae,af,"top")}return z(ad,af,ae)};F.at=function(ad,af,ae){if(ad==";"){return U(ae)}if(ad=="{"||ad=="}"){return W(ad,af,ae)}if(ad=="word"){N="tag"}else{if(ad=="hash"){N="builtin"}}return"at"};F.interpolation=function(ad,af,ae){if(ad=="}"){return U(ae)}if(ad=="{"||ad==";"){return W(ad,af,ae)}if(ad=="word"){N="variable"}else{if(ad!="variable"&&ad!="("&&ad!=")"){N="error"}}return"interpolation"};return{startState:function(ad){return{tokenize:null,state:D?"block":"top",stateArg:null,context:new R(D?"block":"top",ad||0,null)}},token:function(af,ae){if(!ae.tokenize&&af.eatSpace()){return null}var ad=(ae.tokenize||ac)(af,ae);if(ad&&typeof ad=="object"){C=ad[1];ad=ad[0]}N=ad;if(C!="comment"){ae.state=F[ae.state](C,af,ae)}return N},indent:function(ah,af){var ae=ah.context,ag=af&&af.charAt(0);var ad=ae.indent;if(ae.type=="prop"&&(ag=="}"||ag==")")){ae=ae.prev}if(ae.prev){if(ag=="}"&&(ae.type=="block"||ae.type=="top"||ae.type=="interpolation"||ae.type=="restricted_atBlock")){ae=ae.prev;ad=ae.indent}else{if(ag==")"&&(ae.type=="parens"||ae.type=="atBlock_parens")||ag=="{"&&(ae.type=="at"||ae.type=="atBlock")){ad=Math.max(0,ae.indent-Q)}}}return ad},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:S,fold:"brace"}});function g(A){var z={};for(var y=0;y<A.length;++y){z[A[y].toLowerCase()]=true}return z}var k=["domain","regexp","url","url-prefix"],a=g(k);var b=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],v=g(b);var x=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],i=g(x);var l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],p=g(l);var d=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],h=g(d);var n=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],e=g(n);var t=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],f=g(t);var q=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],u=g(q);var c=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],m=g(c);var j=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],s=g(j);var o=k.concat(b).concat(x).concat(l).concat(d).concat(n).concat(c).concat(j);r.registerHelper("hintWords","css",o);function w(B,A){var y=false,z;while((z=B.next())!=null){if(y&&z=="/"){A.tokenize=null;break}y=(z=="*")}return["comment","comment"]}r.defineMIME("text/css",{documentTypes:a,mediaTypes:v,mediaFeatures:i,mediaValueKeywords:p,propertyKeywords:h,nonStandardPropertyKeywords:e,fontProperties:f,counterDescriptors:u,colorKeywords:m,valueKeywords:s,tokenHooks:{"/":function(z,y){if(!z.eat("*")){return false}y.tokenize=w;return w(z,y)}},name:"css"});r.defineMIME("text/x-scss",{mediaTypes:v,mediaFeatures:i,mediaValueKeywords:p,propertyKeywords:h,nonStandardPropertyKeywords:e,colorKeywords:m,valueKeywords:s,fontProperties:f,allowNested:true,lineComment:"//",tokenHooks:{"/":function(z,y){if(z.eat("/")){z.skipToEnd();return["comment","comment"]}else{if(z.eat("*")){y.tokenize=w;return w(z,y)}else{return["operator","operator"]}}},":":function(y){if(y.match(/\s*\{/,false)){return[null,null]}return false},"$":function(y){y.match(/^[\w-]+/);if(y.match(/^\s*:/,false)){return["variable-2","variable-definition"]}return["variable-2","variable"]},"#":function(y){if(!y.eat("{")){return false}return[null,"interpolation"]}},name:"css",helperType:"scss"});r.defineMIME("text/x-less",{mediaTypes:v,mediaFeatures:i,mediaValueKeywords:p,propertyKeywords:h,nonStandardPropertyKeywords:e,colorKeywords:m,valueKeywords:s,fontProperties:f,allowNested:true,lineComment:"//",tokenHooks:{"/":function(z,y){if(z.eat("/")){z.skipToEnd();return["comment","comment"]}else{if(z.eat("*")){y.tokenize=w;return w(z,y)}else{return["operator","operator"]}}},"@":function(y){if(y.eat("{")){return[null,"interpolation"]}if(y.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,false)){return false}y.eatWhile(/[\w\\\-]/);if(y.match(/^\s*:/,false)){return["variable-2","variable-definition"]}return["variable-2","variable"]},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"});r.defineMIME("text/x-gss",{documentTypes:a,mediaTypes:v,mediaFeatures:i,propertyKeywords:h,nonStandardPropertyKeywords:e,fontProperties:f,counterDescriptors:u,colorKeywords:m,valueKeywords:s,supportsAtComponent:true,tokenHooks:{"/":function(z,y){if(!z.eat("*")){return false}y.tokenize=w;return w(z,y)}},name:"css",helperType:"gss"})});(function(a){if(typeof exports=="object"&&typeof module=="object"){a(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css"))}else{if(typeof define=="function"&&define.amd){define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],a)}else{a(CodeMirror)}}})(function(d){var g={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function f(n,j,k){var m=n.current(),l=m.search(j);if(l>-1){n.backUp(m.length-l)}else{if(m.match(/<\/?$/)){n.backUp(m.length);if(!n.match(j,false)){n.match(m)}}}return k}var e={};function c(j){var k=e[j];if(k){return k}return e[j]=new RegExp("\\s+"+j+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function a(l,j){var k=l.match(c(j));return k?/^\s*(.*?)\s*$/.exec(k[2])[1]:""}function i(k,j){return new RegExp((j?"^":"")+"</s*"+k+"s*>","i")}function h(o,n){for(var j in o){var k=n[j]||(n[j]=[]);var m=o[j];for(var l=m.length-1;l>=0;l--){k.unshift(m[l])}}}function b(l,m){for(var k=0;k<l.length;k++){var j=l[k];if(!j[0]||j[1].test(a(m,j[0]))){return j[2]}}}d.defineMode("htmlmixed",function(k,o){var q=d.getMode(k,{name:"xml",htmlMode:true,multilineTagIndentFactor:o.multilineTagIndentFactor,multilineTagIndentPastTag:o.multilineTagIndentPastTag});var j={};var p=o&&o.tags,n=o&&o.scriptTypes;h(g,j);if(p){h(p,j)}if(n){for(var m=n.length-1;m>=0;m--){j.script.unshift(["type",n[m].matches,n[m].mode])}}function l(z,r){var s=q.token(z,r.htmlState),A=/\btag\b/.test(s),u;if(A&&!/[<>\s\/]/.test(z.current())&&(u=r.htmlState.tagName&&r.htmlState.tagName.toLowerCase())&&j.hasOwnProperty(u)){r.inTag=u+" "}else{if(r.inTag&&A&&/>$/.test(z.current())){var t=/^([\S]+) (.*)/.exec(r.inTag);r.inTag=null;var y=z.current()==">"&&b(j[t[1]],t[2]);var x=d.getMode(k,y);var w=i(t[1],true),v=i(t[1],false);r.token=function(C,B){if(C.match(w,false)){B.token=l;B.localState=B.localMode=null;return null}return f(C,v,B.localMode.token(C,B.localState))};r.localMode=x;r.localState=d.startState(x,q.indent(r.htmlState,""))}else{if(r.inTag){r.inTag+=z.current();if(z.eol()){r.inTag+=" "}}}}return s}return{startState:function(){var r=d.startState(q);return{token:l,inTag:null,localMode:null,localState:null,htmlState:r}},copyState:function(s){var r;if(s.localState){r=d.copyState(s.localMode,s.localState)}return{token:s.token,inTag:s.inTag,localMode:s.localMode,localState:r,htmlState:d.copyState(q,s.htmlState)}},token:function(s,r){return r.token(s,r)},indent:function(t,s,r){if(!t.localMode||/^\s*<\//.test(s)){return q.indent(t.htmlState,s)}else{if(t.localMode.indent){return t.localMode.indent(t.localState,s,r)}else{return d.Pass}}},innerMode:function(r){return{state:r.localState||r.htmlState,mode:r.localMode||q}}}},"xml","javascript","css");d.defineMIME("text/html","htmlmixed")});CodeMirror.defineMode("bbcodemixed",function(c){var f,e,g,d,h=CodeMirror.getMode(c,"htmlmixed"),b=CodeMirror.getMode(c,"bbcode"),f={bbCodeLiteral:"literal"};if(c.hasOwnProperty("bbCodeLiteral")){f.bbCodeLiteral=c.bbCodeLiteral}function a(i){return i.replace(/([\[\]\.\-\+\<\>\?\:\(\)\{\}])/g,"\\$1")}e={hasLeftDelimeter:/.*\[/,htmlHasLeftDelimeter:/[^\<\>]*\[/,literalOpen:new RegExp(a("["+f.bbCodeLiteral+"]")),literalClose:new RegExp(a("[/"+f.bbCodeLiteral+"]"))};g={chain:function(j,i,k){i.tokenize=k;return k(j,i)},cleanChain:function(j,i,k){i.tokenize=null;i.localState=null;i.localMode=null;return(typeof k=="string")?(k?k:null):k(j,i)},maybeBackup:function(o,j,k){j=a(j);var n=o.current();var l=n.search(j),i;if(l>-1){o.backUp(n.length-l)}else{if(i=n.match(/<\/?$/)){o.backUp(n.length);if(!o.match(j,false)){o.match(n[0])}}}return k}};d={html:function(j,i){if(!i.inLiteral&&j.match(e.htmlHasLeftDelimeter,false)&&i.htmlMixedState.htmlState.tagName===null){i.tokenize=d.bbcode;i.localMode=b;i.localState=b.startState(h.indent(i.htmlMixedState,""));return g.maybeBackup(j,"[",b.token(j,i.localState))}else{if(!i.inLiteral&&j.match("[",false)){i.tokenize=d.bbcode;i.localMode=b;i.localState=b.startState(h.indent(i.htmlMixedState,""));return g.maybeBackup(j,"[",b.token(j,i.localState))}}return h.token(j,i.htmlMixedState)},bbcode:function(j,i){if(j.match("]",false)){j.eat("]");i.tokenize=d.html;i.localMode=h;i.localState=i.htmlMixedState;return"tag"}return g.maybeBackup(j,"]",b.token(j,i.localState))},inBlock:function(j,i){return function(l,k){while(!l.eol()){if(l.match(i)){g.cleanChain(l,k,"");break}l.next()}return j}}};return{startState:function(){var i=h.startState();return{token:d.html,localMode:null,localState:null,htmlMixedState:i,tokenize:null,inLiteral:false}},copyState:function(k){var j=null,i=(k.tokenize||k.token);if(k.localState){j=CodeMirror.copyState((i!=d.html?b:h),k.localState)}return{token:k.token,tokenize:k.tokenize,localMode:k.localMode,localState:j,htmlMixedState:CodeMirror.copyState(h,k.htmlMixedState),inLiteral:k.inLiteral}},token:function(k,j){if(k.match("[",false)){if(!j.inLiteral&&k.match(e.literalOpen,true)){j.inLiteral=true;return"keyword"}else{if(j.inLiteral&&k.match(e.literalClose,true)){j.inLiteral=false;return"keyword"}}}if(j.inLiteral&&j.localState!=j.htmlMixedState){j.tokenize=d.html;j.localMode=h;j.localState=j.htmlMixedState}var i=(j.tokenize||j.token)(k,j);return i},indent:function(j,i){if(j.localMode==b||(j.inLiteral&&!j.localMode)||e.hasLeftDelimeter.test(i)){return CodeMirror.Pass}return h.indent(j.htmlMixedState,i)},innerMode:function(i){return{state:i.localState||i.htmlMixedState,mode:i.localMode||h}}}},"xml","javascript","css");CodeMirror.defineMIME("text/x-bbcode","bbcodemixed");
@@ -0,0 +1,2 @@
1
+ !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("mode/xml/xml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},r={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",function(n,o){function a(e,t){function r(r){return t.tokenize=r,r(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?r(s("atom","]]>")):null:e.match("--")?r(s("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),r(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=s("meta","?>"),"meta"):(S=e.eat("/")?"closeTag":"openTag",t.tokenize=i,"tag bracket");if("&"==n){var o;return o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),o?"atom":"error"}return e.eatWhile(/[^&<]/),null}function i(e,t){var r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=a,S=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return S="equals",null;if("<"==r){t.tokenize=a,t.state=m,t.tagName=t.tagStart=null;var n=t.tokenize(e,t);return n?n+" tag error":"tag error"}return/[\'\"]/.test(r)?(t.tokenize=l(r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(e){var t=function(t,r){for(;!t.eol();)if(t.next()==e){r.tokenize=i;break}return"string"};return t.isInAttribute=!0,t}function s(e,t){return function(r,n){for(;!r.eol();){if(r.match(t)){n.tokenize=a;break}r.next()}return e}}function c(e){return function(t,r){for(var n;null!=(n=t.next());){if("<"==n)return r.tokenize=c(e+1),r.tokenize(t,r);if(">"==n){if(1==e){r.tokenize=a;break}return r.tokenize=c(e-1),r.tokenize(t,r)}}return"meta"}}function d(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(M.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function u(e){e.context&&(e.context=e.context.prev)}function p(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!M.contextGrabbers.hasOwnProperty(r)||!M.contextGrabbers[r].hasOwnProperty(t))return;u(e)}}function m(e,t,r){return"openTag"==e?(r.tagStart=t.column(),f):"closeTag"==e?h:m}function f(e,t,r){return"word"==e?(r.tagName=t.current(),T="tag",y):M.allowMissingTagName&&"endTag"==e?(T="tag bracket",y(e,t,r)):(T="error",f)}function h(e,t,r){if("word"==e){var n=t.current();return r.context&&r.context.tagName!=n&&M.implicitlyClosed.hasOwnProperty(r.context.tagName)&&u(r),r.context&&r.context.tagName==n||!1===M.matchClosing?(T="tag",g):(T="tag error",b)}return M.allowMissingTagName&&"endTag"==e?(T="tag bracket",g(e,t,r)):(T="error",b)}function g(e,t,r){return"endTag"!=e?(T="error",g):(u(r),m)}function b(e,t,r){return T="error",g(e,t,r)}function y(e,t,r){if("word"==e)return T="attribute",k;if("endTag"==e||"selfcloseTag"==e){var n=r.tagName,o=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||M.autoSelfClosers.hasOwnProperty(n)?p(r,n):(p(r,n),r.context=new d(r,n,o==r.indented)),m}return T="error",y}function k(e,t,r){return"equals"==e?v:(M.allowMissing||(T="error"),y(e,t,r))}function v(e,t,r){return"string"==e?w:"word"==e&&M.allowUnquoted?(T="string",y):(T="error",y(e,t,r))}function w(e,t,r){return"string"==e?w:y(e,t,r)}var x=n.indentUnit,M={},z=o.htmlMode?t:r;for(var j in z)M[j]=z[j];for(var j in o)M[j]=o[j];var S,T;return a.isInText=!0,{startState:function(e){var t={tokenize:a,state:m,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;S=null;var r=t.tokenize(e,t);return(r||S)&&"comment"!=r&&(T=null,t.state=t.state(S||r,e,t),T&&(r="error"==T?r+" error":T)),r},indent:function(t,r,n){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+x;if(o&&o.noIndent)return e.Pass;if(t.tokenize!=i&&t.tokenize!=a)return n?n.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==M.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+x*(M.multilineTagIndentFactor||1);if(M.alignCDATA&&/<!\[CDATA\[/.test(r))return 0;var l=r&&/^<(\/)?([\w_:\.-]*)/.exec(r);if(l&&l[1])for(;o;){if(o.tagName==l[2]){o=o.prev;break}if(!M.implicitlyClosed.hasOwnProperty(o.tagName))break;o=o.prev}else if(l)for(;o;){var s=M.contextGrabbers[o.tagName];if(!s||!s.hasOwnProperty(l[2]))break;o=o.prev}for(;o&&o.prev&&!o.startOfLine;)o=o.prev;return o?o.indent+x:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:M.htmlMode?"html":"xml",helperType:M.htmlMode?"html":"xml",skipAttribute:function(e){e.state==v&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("mode/javascript/javascript",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return qe=e,Pe=r,t}function a(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=i(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==r&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return o(r);if("="==r&&e.eat(">"))return o("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==r)return e.eat("*")?(t.tokenize=l,l(e,t)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):Ce(e,t,1)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eat("="),o("operator","operator",e.current()));if("`"==r)return t.tokenize=s,s(e,t);if("#"==r)return e.skipToEnd(),o("error","error");if(Be.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),o("operator","operator",e.current());if($e.test(r)){e.eatWhile($e);var a=e.current();if("."!=t.lastType){if(Ve.propertyIsEnumerable(a)){var c=Ve[a];return o(c.type,c.style,a)}if("async"==a&&e.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,!1))return o("async","keyword",a)}return o("variable","variable",a)}}function i(e){return function(t,r){var n,i=!1;if(Oe&&"@"==t.peek()&&t.match(We))return r.tokenize=a,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=a),o("string","string")}}function l(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=a;break}n="*"==r}return o("comment","comment")}function s(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Ke){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var o=0,a=!1,i=r-1;i>=0;--i){var l=e.string.charAt(i),s=_e.indexOf(l);if(s>=0&&s<3){if(!o){++i;break}if(0==--o){"("==l&&(a=!0);break}}else if(s>=3&&s<6)++o;else if($e.test(l))a=!0;else{if(/["'\/]/.test(l))return;if(a&&!o){++i;break}}}a&&!o&&(t.fatArrowAt=i)}}function d(e,t,r,n,o,a){this.indented=e,this.column=t,this.type=r,this.prev=o,this.info=a,null!=n&&(this.align=n)}function u(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function p(e,t,r,n,o){var a=e.cc;for(De.state=e,De.stream=o,De.marked=null,De.cc=a,De.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((a.length?a.pop():Ne?M:x)(r,n)){for(;a.length&&a[a.length-1].lex;)a.pop()();return De.marked?De.marked:"variable"==r&&u(e,n)?"variable-2":t}}}function m(){for(var e=arguments.length-1;e>=0;e--)De.cc.push(arguments[e])}function f(){return m.apply(null,arguments),!0}function h(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=De.state;if(De.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function g(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function b(){De.state.context={prev:De.state.context,vars:De.state.localVars},De.state.localVars=Fe}function y(){De.state.localVars=De.state.context.vars,De.state.context=De.state.context.prev}function k(e,t){var r=function(){var r=De.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var o=r.lexical;o&&")"==o.type&&o.align;o=o.prev)n=o.indented;r.lexical=new d(n,De.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function v(){var e=De.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function w(e){function t(r){return r==e?f():";"==e?m():f(t)}return t}function x(e,t){return"var"==e?f(k("vardef",t.length),re,w(";"),v):"keyword a"==e?f(k("form"),j,x,v):"keyword b"==e?f(k("form"),x,v):"keyword d"==e?De.stream.match(/^\s*$/,!1)?f():f(k("stat"),T,w(";"),v):"debugger"==e?f(w(";")):"{"==e?f(k("}"),F,v):";"==e?f():"if"==e?("else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==v&&De.state.cc.pop()(),f(k("form"),j,x,v,le)):"function"==e?f(me):"for"==e?f(k("form"),se,x,v):"class"==e||Ke&&"interface"==t?(De.marked="keyword",f(k("form"),ge,v)):"variable"==e?Ke&&"type"==t?(De.marked="keyword",f(R,w("operator"),R,w(";"))):Ke&&"declare"==t?(De.marked="keyword",f(x)):Ke&&("module"==t||"enum"==t)&&De.stream.match(/^\s*\w/,!1)?(De.marked="keyword",f(k("form"),ne,w("{"),k("}"),F,v,v)):Ke&&"namespace"==t?(De.marked="keyword",f(k("form"),M,F,v)):f(k("stat"),$):"switch"==e?f(k("form"),j,w("{"),k("}","switch"),F,v,v):"case"==e?f(M,w(":")):"default"==e?f(w(":")):"catch"==e?f(k("form"),b,w("("),fe,w(")"),x,v,y):"export"==e?f(k("stat"),ve,v):"import"==e?f(k("stat"),xe,v):"async"==e?f(x):"@"==t?f(M,x):m(k("stat"),M,w(";"),v)}function M(e,t){return S(e,t,!1)}function z(e,t){return S(e,t,!0)}function j(e){return"("!=e?m():f(k(")"),M,w(")"),v)}function S(e,t,r){if(De.state.fatArrowAt==De.stream.start){var n=r?E:I;if("("==e)return f(b,k(")"),L(fe,")"),v,w("=>"),n,y);if("variable"==e)return m(b,ne,w("=>"),n,y)}var o=r?C:A;return Le.hasOwnProperty(e)?f(o):"function"==e?f(me,o):"class"==e||Ke&&"interface"==t?(De.marked="keyword",f(k("form"),he,v)):"keyword c"==e||"async"==e?f(r?z:M):"("==e?f(k(")"),T,w(")"),v,o):"operator"==e||"spread"==e?f(r?z:M):"["==e?f(k("]"),Te,v,o):"{"==e?D(B,"}",null,o):"quasi"==e?m(q,o):"new"==e?f(O(r)):f()}function T(e){return e.match(/[;\}\)\],]/)?m():m(M)}function A(e,t){return","==e?f(M):C(e,t,!1)}function C(e,t,r){var n=0==r?A:C,o=0==r?M:z;return"=>"==e?f(b,r?E:I,y):"operator"==e?/\+\+|--/.test(t)||Ke&&"!"==t?f(n):Ke&&"<"==t&&De.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?f(k(">"),L(R,">"),v,n):"?"==t?f(M,w(":"),o):f(o):"quasi"==e?m(q,n):";"!=e?"("==e?D(z,")","call",n):"."==e?f(V,n):"["==e?f(k("]"),T,w("]"),v,n):Ke&&"as"==t?(De.marked="keyword",f(R,n)):"regexp"==e?(De.state.lastType=De.marked="operator",De.stream.backUp(De.stream.pos-De.stream.start-1),f(o)):void 0:void 0}function q(e,t){return"quasi"!=e?m():"${"!=t.slice(t.length-2)?f(q):f(M,P)}function P(e){if("}"==e)return De.marked="string-2",De.state.tokenize=s,f(q)}function I(e){return c(De.stream,De.state),m("{"==e?x:M)}function E(e){return c(De.stream,De.state),m("{"==e?x:z)}function O(e){return function(t){return"."==t?f(e?K:N):"variable"==t&&Ke?f(Q,e?C:A):m(e?z:M)}}function N(e,t){if("target"==t)return De.marked="keyword",f(A)}function K(e,t){if("target"==t)return De.marked="keyword",f(C)}function $(e){return":"==e?f(v,x):m(A,w(";"),v)}function V(e){if("variable"==e)return De.marked="property",f()}function B(e,t){if("async"==e)return De.marked="property",f(B);if("variable"==e||"keyword"==De.style){if(De.marked="property","get"==t||"set"==t)return f(W);var r;return Ke&&De.state.fatArrowAt==De.stream.start&&(r=De.stream.match(/^\s*:\s*/,!1))&&(De.state.fatArrowAt=De.stream.pos+r[0].length),f(_)}return"number"==e||"string"==e?(De.marked=Oe?"property":De.style+" property",f(_)):"jsonld-keyword"==e?f(_):Ke&&g(t)?(De.marked="keyword",f(B)):"["==e?f(M,U,w("]"),_):"spread"==e?f(z,_):"*"==t?(De.marked="keyword",f(B)):":"==e?m(_):void 0}function W(e){return"variable"!=e?m(_):(De.marked="property",f(me))}function _(e){return":"==e?f(z):"("==e?m(me):void 0}function L(e,t,r){function n(o,a){if(r?r.indexOf(o)>-1:","==o){var i=De.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),f(function(r,n){return r==t||n==t?m():m(e)},n)}return o==t||a==t?f():f(w(t))}return function(r,o){return r==t||o==t?f():m(e,n)}}function D(e,t,r){for(var n=3;n<arguments.length;n++)De.cc.push(arguments[n]);return f(k(t,r),L(e,t),v)}function F(e){return"}"==e?f():m(x,F)}function U(e,t){if(Ke){if(":"==e)return f(R);if("?"==t)return f(U)}}function H(e){if(Ke&&":"==e)return De.stream.match(/^\s*\w+\s+is\b/,!1)?f(M,G,R):f(R)}function G(e,t){if("is"==t)return De.marked="keyword",f()}function R(e,t){return"variable"==e||"void"==t?"keyof"==t?(De.marked="keyword",f(R)):(De.marked="type",f(J)):"string"==e||"number"==e||"atom"==e?f(J):"["==e?f(k("]"),L(R,"]",","),v,J):"{"==e?f(k("}"),L(X,"}",",;"),v,J):"("==e?f(L(Z,")"),Y):void 0}function Y(e){if("=>"==e)return f(R)}function X(e,t){return"variable"==e||"keyword"==De.style?(De.marked="property",f(X)):"?"==t?f(X):":"==e?f(R):"["==e?f(M,U,w("]"),X):void 0}function Z(e){return"variable"==e?f(Z):":"==e?f(R):void 0}function J(e,t){return"<"==t?f(k(">"),L(R,">"),v,J):"|"==t||"."==e?f(R):"["==e?f(w("]"),J):"extends"==t||"implements"==t?(De.marked="keyword",f(R)):void 0}function Q(e,t){if("<"==t)return f(k(">"),L(R,">"),v,J)}function ee(){return m(R,te)}function te(e,t){if("="==t)return f(R)}function re(){return m(ne,U,ae,ie)}function ne(e,t){return Ke&&g(t)?(De.marked="keyword",f(ne)):"variable"==e?(h(t),f()):"spread"==e?f(ne):"["==e?D(ne,"]"):"{"==e?D(oe,"}"):void 0}function oe(e,t){return"variable"!=e||De.stream.match(/^\s*:/,!1)?("variable"==e&&(De.marked="property"),"spread"==e?f(ne):"}"==e?m():f(w(":"),ne,ae)):(h(t),f(ae))}function ae(e,t){if("="==t)return f(z)}function ie(e){if(","==e)return f(re)}function le(e,t){if("keyword b"==e&&"else"==t)return f(k("form","else"),x,v)}function se(e){if("("==e)return f(k(")"),ce,w(")"),v)}function ce(e){return"var"==e?f(re,w(";"),ue):";"==e?f(ue):"variable"==e?f(de):m(M,w(";"),ue)}function de(e,t){return"in"==t||"of"==t?(De.marked="keyword",f(M)):f(A,ue)}function ue(e,t){return";"==e?f(pe):"in"==t||"of"==t?(De.marked="keyword",f(M)):m(M,w(";"),pe)}function pe(e){")"!=e&&f(M)}function me(e,t){return"*"==t?(De.marked="keyword",f(me)):"variable"==e?(h(t),f(me)):"("==e?f(b,k(")"),L(fe,")"),v,H,x,y):Ke&&"<"==t?f(k(">"),L(ee,">"),v,me):void 0}function fe(e,t){return"@"==t&&f(M,fe),"spread"==e?f(fe):Ke&&g(t)?(De.marked="keyword",f(fe)):m(ne,U,ae)}function he(e,t){return"variable"==e?ge(e,t):be(e,t)}function ge(e,t){if("variable"==e)return h(t),f(be)}function be(e,t){return"<"==t?f(k(">"),L(ee,">"),v,be):"extends"==t||"implements"==t||Ke&&","==e?f(Ke?R:M,be):"{"==e?f(k("}"),ye,v):void 0}function ye(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||Ke&&g(t))&&De.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(De.marked="keyword",f(ye)):"variable"==e||"keyword"==De.style?(De.marked="property",f(Ke?ke:me,ye)):"["==e?f(M,U,w("]"),Ke?ke:me,ye):"*"==t?(De.marked="keyword",f(ye)):";"==e?f(ye):"}"==e?f():"@"==t?f(M,ye):void 0}function ke(e,t){return"?"==t?f(ke):":"==e?f(R,ae):"="==t?f(z):m(me)}function ve(e,t){return"*"==t?(De.marked="keyword",f(Se,w(";"))):"default"==t?(De.marked="keyword",f(M,w(";"))):"{"==e?f(L(we,"}"),Se,w(";")):m(x)}function we(e,t){return"as"==t?(De.marked="keyword",f(w("variable"))):"variable"==e?m(z,we):void 0}function xe(e){return"string"==e?f():m(Me,ze,Se)}function Me(e,t){return"{"==e?D(Me,"}"):("variable"==e&&h(t),"*"==t&&(De.marked="keyword"),f(je))}function ze(e){if(","==e)return f(Me,ze)}function je(e,t){if("as"==t)return De.marked="keyword",f(Me)}function Se(e,t){if("from"==t)return De.marked="keyword",f(M)}function Te(e){return"]"==e?f():m(L(z,"]"))}function Ae(e,t){return"operator"==e.lastType||","==e.lastType||Be.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function Ce(e,t,r){return t.tokenize==a&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}var qe,Pe,Ie=t.indentUnit,Ee=r.statementIndent,Oe=r.jsonld,Ne=r.json||Oe,Ke=r.typescript,$e=r.wordCharacters||/[\w$\xa1-\uffff]/,Ve=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),o=e("keyword d"),a=e("operator"),i={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:o,break:o,continue:o,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:i,false:i,null:i,undefined:i,NaN:i,Infinity:i,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),Be=/[+\-*&%=<>!?|~^@]/,We=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,_e="([{}])",Le={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},Fe={name:"this",next:{name:"arguments"}};return v.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new d((e||0)-Ie,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=l&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==qe?r:(t.lastType="operator"!=qe||"++"!=Pe&&"--"!=Pe?qe:"incdec",p(t,r,qe,Pe,e))},indent:function(t,n){if(t.tokenize==l)return e.Pass;if(t.tokenize!=a)return 0;var o,i=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var d=t.cc[c];if(d==v)s=s.prev;else if(d!=le)break}for(;("stat"==s.type||"form"==s.type)&&("}"==i||(o=t.cc[t.cc.length-1])&&(o==A||o==C)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;Ee&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var u=s.type,p=i==u;return"vardef"==u?s.indented+("operator"==t.lastType||","==t.lastType?s.info+1:0):"form"==u&&"{"==i?s.indented:"form"==u?s.indented+Ie:"stat"==u?s.indented+(Ae(t,n)?Ee||Ie:0):"switch"!=s.info||p||0==r.doubleIndentSwitch?s.align?s.column+(p?0:1):s.indented+(p?0:Ie):s.indented+(/^(?:case|default)\b/.test(n)?Ie:2*Ie)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ne?null:"/*",blockCommentEnd:Ne?null:"*/",blockCommentContinue:Ne?null:" * ",lineComment:Ne?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ne?"json":"javascript",jsonldMode:Oe,jsonMode:Ne,expressionAllowed:Ce,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=M&&t!=z||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("mode/css/css",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}e.defineMode("css",function(t,r){function n(e,t){return f=t,e}function o(e,t){var r=e.next();if(b[r]){var o=b[r](e,t);if(!1!==o)return o}return"@"==r?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?n(null,"compare"):'"'==r||"'"==r?(t.tokenize=a(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==r?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==r?/[,+>*\/]/.test(r)?n(null,"select-op"):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(r)?n(null,r):("u"==r||"U"==r)&&e.match(/rl(-prefix)?\(/i)||("d"==r||"D"==r)&&e.match("omain(",!0,!0)||("r"==r||"R"==r)&&e.match("egexp(",!0,!0)?(e.backUp(1),t.tokenize=i,n("property","word")):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function a(e){return function(t,r){for(var o,a=!1;null!=(o=t.next());){if(o==e&&!a){")"==e&&t.backUp(1);break}a=!a&&"\\"==o}return(o==e||!a&&")"!=e)&&(r.tokenize=null),n("string","string")}}function i(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=a(")"),n(null,"(")}function l(e,t,r){this.type=e,this.indent=t,this.prev=r}function s(e,t,r,n){return e.context=new l(r,t.indentation()+(!1===n?0:g),e.context),r}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function d(e,t,r){return P[r.context.type](e,t,r)}function u(e,t,r,n){for(var o=n||1;o>0;o--)r.context=r.context.prev;return d(e,t,r)}function p(e){var t=e.current().toLowerCase();h=T.hasOwnProperty(t)?"atom":S.hasOwnProperty(t)?"keyword":"variable"}var m=r.inline;r.propertyKeywords||(r=e.resolveMode("text/css"));var f,h,g=t.indentUnit,b=r.tokenHooks,y=r.documentTypes||{},k=r.mediaTypes||{},v=r.mediaFeatures||{},w=r.mediaValueKeywords||{},x=r.propertyKeywords||{},M=r.nonStandardPropertyKeywords||{},z=r.fontProperties||{},j=r.counterDescriptors||{},S=r.colorKeywords||{},T=r.valueKeywords||{},A=r.allowNested,C=r.lineComment,q=!0===r.supportsAtComponent,P={};return P.top=function(e,t,r){if("{"==e)return s(r,t,"block");if("}"==e&&r.context.prev)return c(r);if(q&&/@component/i.test(e))return s(r,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return s(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return s(r,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return s(r,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return s(r,t,"interpolation");if(":"==e)return"pseudo";if(A&&"("==e)return s(r,t,"parens")}return r.context.type},P.block=function(e,t,r){if("word"==e){var n=t.current().toLowerCase();return x.hasOwnProperty(n)?(h="property","maybeprop"):M.hasOwnProperty(n)?(h="string-2","maybeprop"):A?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")}return"meta"==e?"block":A||"hash"!=e&&"qualifier"!=e?P.top(e,t,r):(h="error","block")},P.maybeprop=function(e,t,r){return":"==e?s(r,t,"prop"):d(e,t,r)},P.prop=function(e,t,r){if(";"==e)return c(r);if("{"==e&&A)return s(r,t,"propBlock");if("}"==e||"{"==e)return u(e,t,r);if("("==e)return s(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)p(t);else if("interpolation"==e)return s(r,t,"interpolation")}else h+=" error";return"prop"},P.propBlock=function(e,t,r){return"}"==e?c(r):"word"==e?(h="property","maybeprop"):r.context.type},P.parens=function(e,t,r){return"{"==e||"}"==e?u(e,t,r):")"==e?c(r):"("==e?s(r,t,"parens"):"interpolation"==e?s(r,t,"interpolation"):("word"==e&&p(t),"parens")},P.pseudo=function(e,t,r){return"meta"==e?"pseudo":"word"==e?(h="variable-3",r.context.type):d(e,t,r)},P.documentTypes=function(e,t,r){return"word"==e&&y.hasOwnProperty(t.current())?(h="tag",r.context.type):P.atBlock(e,t,r)},P.atBlock=function(e,t,r){if("("==e)return s(r,t,"atBlock_parens");if("}"==e||";"==e)return u(e,t,r);if("{"==e)return c(r)&&s(r,t,A?"block":"top");if("interpolation"==e)return s(r,t,"interpolation");if("word"==e){var n=t.current().toLowerCase();h="only"==n||"not"==n||"and"==n||"or"==n?"keyword":k.hasOwnProperty(n)?"attribute":v.hasOwnProperty(n)?"property":w.hasOwnProperty(n)?"keyword":x.hasOwnProperty(n)?"property":M.hasOwnProperty(n)?"string-2":T.hasOwnProperty(n)?"atom":S.hasOwnProperty(n)?"keyword":"error"}return r.context.type},P.atComponentBlock=function(e,t,r){return"}"==e?u(e,t,r):"{"==e?c(r)&&s(r,t,A?"block":"top",!1):("word"==e&&(h="error"),r.context.type)},P.atBlock_parens=function(e,t,r){return")"==e?c(r):"{"==e||"}"==e?u(e,t,r,2):P.atBlock(e,t,r)},P.restricted_atBlock_before=function(e,t,r){return"{"==e?s(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(h="variable","restricted_atBlock_before"):d(e,t,r)},P.restricted_atBlock=function(e,t,r){return"}"==e?(r.stateArg=null,c(r)):"word"==e?(h="@font-face"==r.stateArg&&!z.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!j.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},P.keyframes=function(e,t,r){return"word"==e?(h="variable","keyframes"):"{"==e?s(r,t,"top"):d(e,t,r)},P.at=function(e,t,r){return";"==e?c(r):"{"==e||"}"==e?u(e,t,r):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},P.interpolation=function(e,t,r){return"}"==e?c(r):"{"==e||";"==e?u(e,t,r):("word"==e?h="variable":"variable"!=e&&"("!=e&&")"!=e&&(h="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:m?"block":"top",stateArg:null,context:new l(m?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||o)(e,t);return r&&"object"==typeof r&&(f=r[1],r=r[0]),h=r,"comment"!=f&&(t.state=P[t.state](f,e,t)),h},indent:function(e,t){var r=e.context,n=t&&t.charAt(0),o=r.indent;return"prop"!=r.type||"}"!=n&&")"!=n||(r=r.prev),r.prev&&("}"!=n||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"restricted_atBlock"!=r.type?(")"!=n||"parens"!=r.type&&"atBlock_parens"!=r.type)&&("{"!=n||"at"!=r.type&&"atBlock"!=r.type)||(o=Math.max(0,r.indent-g)):(r=r.prev,o=r.indent)),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:C,fold:"brace"}})
2
+ ;var n=["domain","regexp","url","url-prefix"],o=t(n),a=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],i=t(a),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],s=t(l),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],d=t(c),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],p=t(u),m=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],f=t(m),h=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(h),b=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(b),k=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],v=t(k),w=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],x=t(w),M=n.concat(a).concat(l).concat(c).concat(u).concat(m).concat(k).concat(w);e.registerHelper("hintWords","css",M),e.defineMIME("text/css",{documentTypes:o,mediaTypes:i,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:g,counterDescriptors:y,colorKeywords:v,valueKeywords:x,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:v,valueKeywords:x,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:s,mediaValueKeywords:d,propertyKeywords:p,nonStandardPropertyKeywords:f,colorKeywords:v,valueKeywords:x,fontProperties:g,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r,r(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:o,mediaTypes:i,mediaFeatures:s,propertyKeywords:p,nonStandardPropertyKeywords:f,fontProperties:g,counterDescriptors:y,colorKeywords:v,valueKeywords:x,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r,r(e,t))}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define("mode/htmlmixed/htmlmixed",["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r){var n=e.current(),o=n.search(t);return o>-1?e.backUp(n.length-o):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),r}function r(e){var t=s[e];return t||(s[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*"))}function n(e,t){var n=e.match(r(t));return n?/^\s*(.*?)\s*$/.exec(n[2])[1]:""}function o(e,t){return new RegExp((t?"^":"")+"</s*"+e+"s*>","i")}function a(e,t){for(var r in e)for(var n=t[r]||(t[r]=[]),o=e[r],a=o.length-1;a>=0;a--)n.unshift(o[a])}function i(e,t){for(var r=0;r<e.length;r++){var o=e[r];if(!o[0]||o[1].test(n(t,o[0])))return o[2]}}var l={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]},s={};e.defineMode("htmlmixed",function(r,n){function s(n,a){var l,u=c.token(n,a.htmlState),p=/\btag\b/.test(u);if(p&&!/[<>\s\/]/.test(n.current())&&(l=a.htmlState.tagName&&a.htmlState.tagName.toLowerCase())&&d.hasOwnProperty(l))a.inTag=l+" ";else if(a.inTag&&p&&/>$/.test(n.current())){var m=/^([\S]+) (.*)/.exec(a.inTag);a.inTag=null;var f=">"==n.current()&&i(d[m[1]],m[2]),h=e.getMode(r,f),g=o(m[1],!0),b=o(m[1],!1);a.token=function(e,r){return e.match(g,!1)?(r.token=s,r.localState=r.localMode=null,null):t(e,b,r.localMode.token(e,r.localState))},a.localMode=h,a.localState=e.startState(h,c.indent(a.htmlState,""))}else a.inTag&&(a.inTag+=n.current(),n.eol()&&(a.inTag+=" "));return u}var c=e.getMode(r,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),d={},u=n&&n.tags,p=n&&n.scriptTypes;if(a(l,d),u&&a(u,d),p)for(var m=p.length-1;m>=0;m--)d.script.unshift(["type",p[m].matches,p[m].mode]);return{startState:function(){return{token:s,inTag:null,localMode:null,localState:null,htmlState:e.startState(c)}},copyState:function(t){var r;return t.localState&&(r=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:r,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,r,n){return!t.localMode||/^\s*<\//.test(r)?c.indent(t.htmlState,r):t.localMode.indent?t.localMode.indent(t.localState,r,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("addon/mode/multiplex",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.multiplexingMode=function(t){function r(e,t,r,n){if("string"==typeof t){var o=e.indexOf(t,r);return n&&o>-1?o+t.length:o}var a=t.exec(r?e.slice(r):e);return a?a.index+r+(n?a[0].length:0):-1}var n=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(r){return{outer:e.copyState(t,r.outer),innerActive:r.innerActive,inner:r.innerActive&&e.copyState(r.innerActive.mode,r.inner)}},token:function(o,a){if(a.innerActive){var i=a.innerActive,l=o.string;if(!i.close&&o.sol())return a.innerActive=a.inner=null,this.token(o,a);var s=i.close?r(l,i.close,o.pos,i.parseDelimiters):-1;if(s==o.pos&&!i.parseDelimiters)return o.match(i.close),a.innerActive=a.inner=null,i.delimStyle&&i.delimStyle+" "+i.delimStyle+"-close";s>-1&&(o.string=l.slice(0,s));var c=i.mode.token(o,a.inner);return s>-1&&(o.string=l),s==o.pos&&i.parseDelimiters&&(a.innerActive=a.inner=null),i.innerStyle&&(c=c?c+" "+i.innerStyle:i.innerStyle),c}for(var d=1/0,l=o.string,u=0;u<n.length;++u){var p=n[u],s=r(l,p.open,o.pos);if(s==o.pos)return p.parseDelimiters||o.match(p.open),a.innerActive=p,a.inner=e.startState(p.mode,t.indent?t.indent(a.outer,""):0),p.delimStyle&&p.delimStyle+" "+p.delimStyle+"-open";-1!=s&&s<d&&(d=s)}d!=1/0&&(o.string=l.slice(0,d));var m=t.token(o,a.outer);return d!=1/0&&(o.string=l),m},indent:function(r,n){var o=r.innerActive?r.innerActive.mode:t;return o.indent?o.indent(r.innerActive?r.inner:r.outer,n):e.Pass},blankLine:function(r){var o=r.innerActive?r.innerActive.mode:t;if(o.blankLine&&o.blankLine(r.innerActive?r.inner:r.outer),r.innerActive)"\n"===r.innerActive.close&&(r.innerActive=r.inner=null);else for(var a=0;a<n.length;++a){var i=n[a];"\n"===i.open&&(r.innerActive=i,r.inner=e.startState(i.mode,o.indent?o.indent(r.outer,""):0))}},electricChars:t.electricChars,innerMode:function(e){return e.inner?{state:e.inner,mode:e.innerActive.mode}:{state:e.outer,mode:t}}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define("mode/htmlembedded/htmlembedded.js",["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(t,r){var n=r.closeComment||"--%>";return e.multiplexingMode(e.getMode(t,"htmlmixed"),{open:r.openComment||"<%--",close:n,delimStyle:"comment",mode:{token:function(e){return e.skipTo(n)||e.skipToEnd(),"comment"}}},{open:r.open||r.scriptStartRegex||"<%",close:r.close||r.scriptEndRegex||"%>",mode:e.getMode(t,r.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"function"==typeof define&&define("modeHtml",["mode/htmlembedded/htmlembedded.js"],function(){})}();
@@ -0,0 +1 @@
1
+ !function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("mode/javascript/javascript.js",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){function n(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function a(e,t,r){return Te=e,$e=r,t}function i(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=o(r),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return a("number","number");if("."==r&&e.match(".."))return a("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return a(r);if("="==r&&e.eat(">"))return a("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),a("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),a("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),a("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),a("number","number");if("/"==r)return e.eat("*")?(t.tokenize=c,c(e,t)):e.eat("/")?(e.skipToEnd(),a("comment","comment")):Ie(e,t,1)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),a("regexp","string-2")):(e.eat("="),a("operator","operator",e.current()));if("`"==r)return t.tokenize=s,s(e,t);if("#"==r)return e.skipToEnd(),a("error","error");if(Ue.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),a("operator","operator",e.current());if(We.test(r)){e.eatWhile(We);var i=e.current();if("."!=t.lastType){if(Ne.propertyIsEnumerable(i)){var u=Ne[i];return a(u.type,u.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\(\w]/,!1))return a("async","keyword",i)}return a("variable","variable",i)}}function o(e){return function(t,r){var n,o=!1;if(Oe&&"@"==t.peek()&&t.match(Be))return r.tokenize=i,a("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(r.tokenize=i),a("string","string")}}function c(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=i;break}n="*"==r}return a("comment","comment")}function s(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=i;break}n=!n&&"\\"==r}return a("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(Se){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var a=0,i=!1,o=r-1;o>=0;--o){var c=e.string.charAt(o),s=He.indexOf(c);if(s>=0&&s<3){if(!a){++o;break}if(0==--a){"("==c&&(i=!0);break}}else if(s>=3&&s<6)++a;else if(We.test(c))i=!0;else{if(/["'\/]/.test(c))return;if(i&&!a){++o;break}}}i&&!a&&(t.fatArrowAt=o)}}function f(e,t,r,n,a,i){this.indented=e,this.column=t,this.type=r,this.prev=a,this.info=i,null!=n&&(this.align=n)}function l(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function d(e,t,r,n,a){var i=e.cc;for(De.state=e,De.stream=a,De.marked=null,De.cc=i,De.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((i.length?i.pop():Pe?j:g)(r,n)){for(;i.length&&i[i.length-1].lex;)i.pop()();return De.marked?De.marked:"variable"==r&&l(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)De.cc.push(arguments[e])}function m(){return p.apply(null,arguments),!0}function v(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var n=De.state;if(De.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function k(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function y(){De.state.context={prev:De.state.context,vars:De.state.localVars},De.state.localVars=Fe}function b(){De.state.localVars=De.state.context.vars,De.state.context=De.state.context.prev}function w(e,t){var r=function(){var r=De.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var a=r.lexical;a&&")"==a.type&&a.align;a=a.prev)n=a.indented;r.lexical=new f(n,De.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function x(){var e=De.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function h(e){function t(r){return r==e?m():";"==e?p():m(t)}return t}function g(e,t){return"var"==e?m(w("vardef",t.length),re,h(";"),x):"keyword a"==e?m(w("form"),V,g,x):"keyword b"==e?m(w("form"),g,x):"keyword d"==e?De.stream.match(/^\s*$/,!1)?m():m(w("stat"),E,h(";"),x):"debugger"==e?m(h(";")):"{"==e?m(w("}"),F,x):";"==e?m():"if"==e?("else"==De.state.lexical.info&&De.state.cc[De.state.cc.length-1]==x&&De.state.cc.pop()(),m(w("form"),V,g,x,ce)):"function"==e?m(pe):"for"==e?m(w("form"),se,g,x):"class"==e||Se&&"interface"==t?(De.marked="keyword",m(w("form"),ke,x)):"variable"==e?Se&&"type"==t?(De.marked="keyword",m(Q,h("operator"),Q,h(";"))):Se&&"declare"==t?(De.marked="keyword",m(g)):Se&&("module"==t||"enum"==t)&&De.stream.match(/^\s*\w/,!1)?(De.marked="keyword",m(w("form"),ne,h("{"),w("}"),F,x,x)):Se&&"namespace"==t?(De.marked="keyword",m(w("form"),j,F,x)):m(w("stat"),W):"switch"==e?m(w("form"),V,h("{"),w("}","switch"),F,x,x):"case"==e?m(j,h(":")):"default"==e?m(h(":")):"catch"==e?m(w("form"),y,h("("),me,h(")"),g,x,b):"export"==e?m(w("stat"),xe,x):"import"==e?m(w("stat"),ge,x):"async"==e?m(g):"@"==t?m(j,g):p(w("stat"),j,h(";"),x)}function j(e,t){return A(e,t,!1)}function M(e,t){return A(e,t,!0)}function V(e){return"("!=e?p():m(w(")"),j,h(")"),x)}function A(e,t,r){if(De.state.fatArrowAt==De.stream.start){var n=r?q:C;if("("==e)return m(y,w(")"),J(me,")"),x,h("=>"),n,b);if("variable"==e)return p(y,ne,h("=>"),n,b)}var a=r?I:z;return Je.hasOwnProperty(e)?m(a):"function"==e?m(pe,a):"class"==e||Se&&"interface"==t?(De.marked="keyword",m(w("form"),ve,x)):"keyword c"==e||"async"==e?m(r?M:j):"("==e?m(w(")"),E,h(")"),x,a):"operator"==e||"spread"==e?m(r?M:j):"["==e?m(w("]"),Ee,x,a):"{"==e?D(U,"}",null,a):"quasi"==e?p(T,a):"new"==e?m(O(r)):m()}function E(e){return e.match(/[;\}\)\],]/)?p():p(j)}function z(e,t){return","==e?m(j):I(e,t,!1)}function I(e,t,r){var n=0==r?z:I,a=0==r?j:M;return"=>"==e?m(y,r?q:C,b):"operator"==e?/\+\+|--/.test(t)||Se&&"!"==t?m(n):Se&&"<"==t&&De.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?m(w(">"),J(Q,">"),x,n):"?"==t?m(j,h(":"),a):m(a):"quasi"==e?p(T,n):";"!=e?"("==e?D(M,")","call",n):"."==e?m(N,n):"["==e?m(w("]"),E,h("]"),x,n):Se&&"as"==t?(De.marked="keyword",m(Q,n)):"regexp"==e?(De.state.lastType=De.marked="operator",De.stream.backUp(De.stream.pos-De.stream.start-1),m(a)):void 0:void 0}function T(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?m(T):m(j,$)}function $(e){if("}"==e)return De.marked="string-2",De.state.tokenize=s,m(T)}function C(e){return u(De.stream,De.state),p("{"==e?g:j)}function q(e){return u(De.stream,De.state),p("{"==e?g:M)}function O(e){return function(t){return"."==t?m(e?S:P):"variable"==t&&Se?m(_,e?I:z):p(e?M:j)}}function P(e,t){if("target"==t)return De.marked="keyword",m(z)}function S(e,t){if("target"==t)return De.marked="keyword",m(I)}function W(e){return":"==e?m(x,g):p(z,h(";"),x)}function N(e){if("variable"==e)return De.marked="property",m()}function U(e,t){if("async"==e)return De.marked="property",m(U);if("variable"==e||"keyword"==De.style){if(De.marked="property","get"==t||"set"==t)return m(B);var r;return Se&&De.state.fatArrowAt==De.stream.start&&(r=De.stream.match(/^\s*:\s*/,!1))&&(De.state.fatArrowAt=De.stream.pos+r[0].length),m(H)}return"number"==e||"string"==e?(De.marked=Oe?"property":De.style+" property",m(H)):"jsonld-keyword"==e?m(H):Se&&k(t)?(De.marked="keyword",m(U)):"["==e?m(j,G,h("]"),H):"spread"==e?m(M,H):"*"==t?(De.marked="keyword",m(U)):":"==e?p(H):void 0}function B(e){return"variable"!=e?p(H):(De.marked="property",m(pe))}function H(e){return":"==e?m(M):"("==e?p(pe):void 0}function J(e,t,r){function n(a,i){if(r?r.indexOf(a)>-1:","==a){var o=De.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),m(function(r,n){return r==t||n==t?p():p(e)},n)}return a==t||i==t?m():m(h(t))}return function(r,a){return r==t||a==t?m():p(e,n)}}function D(e,t,r){for(var n=3;n<arguments.length;n++)De.cc.push(arguments[n]);return m(w(t,r),J(e,t),x)}function F(e){return"}"==e?m():p(g,F)}function G(e,t){if(Se){if(":"==e)return m(Q);if("?"==t)return m(G)}}function K(e){if(Se&&":"==e)return De.stream.match(/^\s*\w+\s+is\b/,!1)?m(j,L,Q):m(Q)}function L(e,t){if("is"==t)return De.marked="keyword",m()}function Q(e,t){return"variable"==e||"void"==t?"keyof"==t?(De.marked="keyword",m(Q)):(De.marked="type",m(Z)):"string"==e||"number"==e||"atom"==e?m(Z):"["==e?m(w("]"),J(Q,"]",","),x,Z):"{"==e?m(w("}"),J(X,"}",",;"),x,Z):"("==e?m(J(Y,")"),R):void 0}function R(e){if("=>"==e)return m(Q)}function X(e,t){return"variable"==e||"keyword"==De.style?(De.marked="property",m(X)):"?"==t?m(X):":"==e?m(Q):"["==e?m(j,G,h("]"),X):void 0}function Y(e){return"variable"==e?m(Y):":"==e?m(Q):void 0}function Z(e,t){return"<"==t?m(w(">"),J(Q,">"),x,Z):"|"==t||"."==e?m(Q):"["==e?m(h("]"),Z):"extends"==t||"implements"==t?(De.marked="keyword",m(Q)):void 0}function _(e,t){if("<"==t)return m(w(">"),J(Q,">"),x,Z)}function ee(){return p(Q,te)}function te(e,t){if("="==t)return m(Q)}function re(){return p(ne,G,ie,oe)}function ne(e,t){return Se&&k(t)?(De.marked="keyword",m(ne)):"variable"==e?(v(t),m()):"spread"==e?m(ne):"["==e?D(ne,"]"):"{"==e?D(ae,"}"):void 0}function ae(e,t){return"variable"!=e||De.stream.match(/^\s*:/,!1)?("variable"==e&&(De.marked="property"),"spread"==e?m(ne):"}"==e?p():m(h(":"),ne,ie)):(v(t),m(ie))}function ie(e,t){if("="==t)return m(M)}function oe(e){if(","==e)return m(re)}function ce(e,t){if("keyword b"==e&&"else"==t)return m(w("form","else"),g,x)}function se(e){if("("==e)return m(w(")"),ue,h(")"),x)}function ue(e){return"var"==e?m(re,h(";"),le):";"==e?m(le):"variable"==e?m(fe):p(j,h(";"),le)}function fe(e,t){return"in"==t||"of"==t?(De.marked="keyword",m(j)):m(z,le)}function le(e,t){return";"==e?m(de):"in"==t||"of"==t?(De.marked="keyword",m(j)):p(j,h(";"),de)}function de(e){")"!=e&&m(j)}function pe(e,t){return"*"==t?(De.marked="keyword",m(pe)):"variable"==e?(v(t),m(pe)):"("==e?m(y,w(")"),J(me,")"),x,K,g,b):Se&&"<"==t?m(w(">"),J(ee,">"),x,pe):void 0}function me(e,t){return"@"==t&&m(j,me),"spread"==e?m(me):Se&&k(t)?(De.marked="keyword",m(me)):p(ne,G,ie)}function ve(e,t){return"variable"==e?ke(e,t):ye(e,t)}function ke(e,t){if("variable"==e)return v(t),m(ye)}function ye(e,t){return"<"==t?m(w(">"),J(ee,">"),x,ye):"extends"==t||"implements"==t||Se&&","==e?m(Se?Q:j,ye):"{"==e?m(w("}"),be,x):void 0}function be(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||Se&&k(t))&&De.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(De.marked="keyword",m(be)):"variable"==e||"keyword"==De.style?(De.marked="property",m(Se?we:pe,be)):"["==e?m(j,G,h("]"),Se?we:pe,be):"*"==t?(De.marked="keyword",m(be)):";"==e?m(be):"}"==e?m():"@"==t?m(j,be):void 0}function we(e,t){return"?"==t?m(we):":"==e?m(Q,ie):"="==t?m(M):p(pe)}function xe(e,t){return"*"==t?(De.marked="keyword",m(Ae,h(";"))):"default"==t?(De.marked="keyword",m(j,h(";"))):"{"==e?m(J(he,"}"),Ae,h(";")):p(g)}function he(e,t){return"as"==t?(De.marked="keyword",m(h("variable"))):"variable"==e?p(M,he):void 0}function ge(e){return"string"==e?m():p(je,Me,Ae)}function je(e,t){return"{"==e?D(je,"}"):("variable"==e&&v(t),"*"==t&&(De.marked="keyword"),m(Ve))}function Me(e){if(","==e)return m(je,Me)}function Ve(e,t){if("as"==t)return De.marked="keyword",m(je)}function Ae(e,t){if("from"==t)return De.marked="keyword",m(j)}function Ee(e){return"]"==e?m():p(J(M,"]"))}function ze(e,t){return"operator"==e.lastType||","==e.lastType||Ue.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function Ie(e,t,r){return t.tokenize==i&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}var Te,$e,Ce=t.indentUnit,qe=r.statementIndent,Oe=r.jsonld,Pe=r.json||Oe,Se=r.typescript,We=r.wordCharacters||/[\w$\xa1-\uffff]/,Ne=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),a=e("keyword d"),i=e("operator"),o={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:a,break:a,continue:a,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}(),Ue=/[+\-*&%=<>!?|~^@]/,Be=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,He="([{}])",Je={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},De={state:null,column:null,marked:null,cc:null},Fe={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:i,lastType:"sof",cc:[],lexical:new f((e||0)-Ce,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=c&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Te?r:(t.lastType="operator"!=Te||"++"!=$e&&"--"!=$e?Te:"incdec",d(t,r,Te,$e,e))},indent:function(t,n){if(t.tokenize==c)return e.Pass;if(t.tokenize!=i)return 0;var a,o=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var f=t.cc[u];if(f==x)s=s.prev;else if(f!=ce)break}for(;("stat"==s.type||"form"==s.type)&&("}"==o||(a=t.cc[t.cc.length-1])&&(a==z||a==I)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;qe&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var l=s.type,d=o==l;return"vardef"==l?s.indented+("operator"==t.lastType||","==t.lastType?s.info+1:0):"form"==l&&"{"==o?s.indented:"form"==l?s.indented+Ce:"stat"==l?s.indented+(ze(t,n)?qe||Ce:0):"switch"!=s.info||d||0==r.doubleIndentSwitch?s.align?s.column+(d?0:1):s.indented+(d?0:Ce):s.indented+(/^(?:case|default)\b/.test(n)?Ce:2*Ce)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Pe?null:"/*",blockCommentEnd:Pe?null:"*/",blockCommentContinue:Pe?null:" * ",lineComment:Pe?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Pe?"json":"javascript",jsonldMode:Oe,jsonMode:Pe,expressionAllowed:Ie,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=j&&t!=M||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"function"==typeof e.define&&e.define("modeJs",["mode/javascript/javascript.js"],function(){})}(this);