epx-frame 4.0.11 → 4.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/lib/0.js +3 -0
  2. package/lib/1.js +1 -1
  3. package/lib/14.js +1 -0
  4. package/lib/2.js +1 -1
  5. package/lib/21.js +1 -0
  6. package/lib/3.css +22 -0
  7. package/lib/3.js +1 -0
  8. package/lib/89.css +378 -0
  9. package/lib/89.js +1 -29041
  10. package/lib/97.css +6 -0
  11. package/lib/97.js +1 -0
  12. package/lib/98.css +2 -0
  13. package/lib/98.js +25 -0
  14. package/lib/99.js +1 -0
  15. package/lib/add-form-item.3fe727a6.js +2 -0
  16. package/lib/add-form-item.css +2 -0
  17. package/lib/add-form.3fe727a6.js +19 -0
  18. package/lib/add-form.css +6 -0
  19. package/lib/ai_bg.png +0 -0
  20. package/lib/alert.3fe727a6.js +2 -0
  21. package/lib/alert.css +4 -0
  22. package/lib/app-index.3fe727a6.js +2 -0
  23. package/lib/app-index.css +2 -0
  24. package/lib/app-nav.3fe727a6.js +2 -0
  25. package/lib/app-nav.css +4 -0
  26. package/lib/app-tabs.3fe727a6.js +2 -0
  27. package/lib/app-tabs.css +2 -0
  28. package/lib/apply-form.3fe727a6.js +19 -0
  29. package/lib/apply-form.css +6 -0
  30. package/lib/apply_bg.png +0 -0
  31. package/lib/approval-index-page.3fe727a6.js +2 -0
  32. package/lib/approval-index-page.css +2 -0
  33. package/lib/approval-index.3fe727a6.js +2 -0
  34. package/lib/approval-index.css +2 -0
  35. package/lib/base-page.3fe727a6.js +2 -0
  36. package/lib/base-page.css +2 -0
  37. package/lib/bgimg.jpg +0 -0
  38. package/lib/button.3fe727a6.js +2 -0
  39. package/lib/button.css +2 -0
  40. package/lib/card-form-item.3fe727a6.js +2 -0
  41. package/lib/card-form-item.css +4 -0
  42. package/lib/card.3fe727a6.js +2 -0
  43. package/lib/card.css +2 -0
  44. package/lib/category-list.3fe727a6.js +26 -0
  45. package/lib/category-list.css +10 -0
  46. package/lib/chart.3fe727a6.js +9 -0
  47. package/lib/chart.css +8 -0
  48. package/lib/check-history.3fe727a6.js +2 -0
  49. package/lib/check-history.css +2 -0
  50. package/lib/color-picker.3fe727a6.js +25 -0
  51. package/lib/color-picker.css +2 -0
  52. package/lib/component.3fe727a6.js +1 -0
  53. package/lib/config-page.3fe727a6.js +2 -0
  54. package/lib/contacts.3fe727a6.js +2 -0
  55. package/lib/contacts.css +4 -0
  56. package/lib/create_market_system.png +0 -0
  57. package/lib/create_system.png +0 -0
  58. package/lib/dashboard.3fe727a6.js +2 -0
  59. package/lib/dashboard.css +12 -0
  60. package/lib/edit-entity-list.3fe727a6.js +26 -0
  61. package/lib/edit-entity-list.css +10 -0
  62. package/lib/element-icons.ttf +0 -0
  63. package/lib/element-icons.woff +0 -0
  64. package/lib/entity-add-page.3fe727a6.js +2 -0
  65. package/lib/entity-add-page.css +2 -0
  66. package/lib/entity-apply-page.3fe727a6.js +2 -0
  67. package/lib/entity-apply-page.css +2 -0
  68. package/lib/entity-card-list.3fe727a6.js +26 -0
  69. package/lib/entity-card-list.css +10 -0
  70. package/lib/entity-list-find-page.3fe727a6.js +2 -0
  71. package/lib/entity-list-find-page.css +2 -0
  72. package/lib/entity-list-find.3fe727a6.js +26 -0
  73. package/lib/entity-list-find.css +10 -0
  74. package/lib/entity-list-page.3fe727a6.js +2 -0
  75. package/lib/entity-list-page.css +2 -0
  76. package/lib/entity-list.3fe727a6.js +26 -0
  77. package/lib/entity-list.css +8 -0
  78. package/lib/entity-no-submit-sub-list.3fe727a6.js +26 -0
  79. package/lib/entity-no-submit-sub-list.css +10 -0
  80. package/lib/entity-sub-grid.3fe727a6.js +2 -0
  81. package/lib/entity-sub-grid.css +4 -0
  82. package/lib/entity-sub-list.3fe727a6.js +26 -0
  83. package/lib/entity-sub-list.css +10 -0
  84. package/lib/entity-tree-find-page.3fe727a6.js +2 -0
  85. package/lib/entity-tree-find-page.css +2 -0
  86. package/lib/entity-tree-find.3fe727a6.js +2 -0
  87. package/lib/entity-tree-find.css +2 -0
  88. package/lib/export-file.3fe727a6.js +9 -0
  89. package/lib/export.3fe727a6.js +9 -0
  90. package/lib/export.css +2 -0
  91. package/lib/flow-num.3fe727a6.js +2 -0
  92. package/lib/flow-num.css +2 -0
  93. package/lib/footer.3fe727a6.js +1 -0
  94. package/lib/footer.css +2 -0
  95. package/lib/form-item.3fe727a6.js +19 -0
  96. package/lib/form-item.css +46 -0
  97. package/lib/form.3fe727a6.js +2 -0
  98. package/lib/form.css +2 -0
  99. package/lib/formula.3fe727a6.js +2 -0
  100. package/lib/formula.css +2 -0
  101. package/lib/gauge.3fe727a6.js +2 -0
  102. package/lib/gauge.css +4 -0
  103. package/lib/grid.3fe727a6.js +2 -0
  104. package/lib/grid.css +4 -0
  105. package/lib/hall_banner.png +0 -0
  106. package/lib/header.3fe727a6.js +2 -0
  107. package/lib/header.css +2 -0
  108. package/lib/hr.png +0 -0
  109. package/lib/icon.3fe727a6.js +1 -0
  110. package/lib/icon.css +2 -0
  111. package/lib/iframe.3fe727a6.js +2 -0
  112. package/lib/iframe.css +2 -0
  113. package/lib/image.3fe727a6.js +2 -0
  114. package/lib/import-file.3fe727a6.js +9 -0
  115. package/lib/import.3fe727a6.js +9 -0
  116. package/lib/import.css +2 -0
  117. package/lib/index.3fe727a6.js +343 -0
  118. package/lib/index.css +357 -0
  119. package/lib/layout.3fe727a6.js +2 -0
  120. package/lib/layout.css +6 -0
  121. package/lib/list.3fe727a6.js +2 -0
  122. package/lib/list.css +4 -0
  123. package/lib/load-page.3fe727a6.js +2 -0
  124. package/lib/login.jpg +0 -0
  125. package/lib/m-entity-add-page.3fe727a6.js +2 -0
  126. package/lib/m-entity-add-page.css +2 -0
  127. package/lib/m-entity-dept-find.3fe727a6.js +9 -0
  128. package/lib/m-entity-dept-find.css +2 -0
  129. package/lib/m-entity-list-find.3fe727a6.js +2 -0
  130. package/lib/m-entity-list-find.css +6 -0
  131. package/lib/m-entity-list.3fe727a6.js +2 -0
  132. package/lib/m-entity-list.css +2 -0
  133. package/lib/m-entity-no-submit-sub-list.3fe727a6.js +2 -0
  134. package/lib/m-entity-no-submit-sub-list.css +2 -0
  135. package/lib/m-entity-tree-find.3fe727a6.js +2 -0
  136. package/lib/m-entity-tree-find.css +2 -0
  137. package/lib/m-entity-user-find.3fe727a6.js +9 -0
  138. package/lib/m-entity-user-find.css +2 -0
  139. package/lib/m_hall_banner.png +0 -0
  140. package/lib/manifest.json +241 -0
  141. package/lib/menu-index.3fe727a6.js +1 -0
  142. package/lib/menu-index.css +2 -0
  143. package/lib/menu.3fe727a6.js +1 -0
  144. package/lib/menu.css +6 -0
  145. package/lib/mine.3fe727a6.js +2 -0
  146. package/lib/mine.css +2 -0
  147. package/lib/mlogin.png +0 -0
  148. package/lib/module-index-page.3fe727a6.js +2 -0
  149. package/lib/module-index-page.css +4 -0
  150. package/lib/module-list-page.3fe727a6.js +2 -0
  151. package/lib/module-list-page.css +2 -0
  152. package/lib/module-list.3fe727a6.js +2 -0
  153. package/lib/module-list.css +6 -0
  154. package/lib/module-tabs-page.3fe727a6.js +2 -0
  155. package/lib/module-tabs-page.css +4 -0
  156. package/lib/nav-add-form.3fe727a6.js +19 -0
  157. package/lib/nav-add-form.css +8 -0
  158. package/lib/num.3fe727a6.js +2 -0
  159. package/lib/num.css +6 -0
  160. package/lib/org-chart.3fe727a6.js +2 -0
  161. package/lib/org-chart.css +2 -0
  162. package/lib/page-help.3fe727a6.js +2 -0
  163. package/lib/page-help.css +2 -0
  164. package/lib/page-tabs.3fe727a6.js +2 -0
  165. package/lib/page-tabs.css +2 -0
  166. package/lib/page.3fe727a6.js +2 -0
  167. package/lib/page.css +2 -0
  168. package/lib/progress-chart.3fe727a6.js +2 -0
  169. package/lib/progress-chart.css +2 -0
  170. package/lib/progress.3fe727a6.js +2 -0
  171. package/lib/progress.css +2 -0
  172. package/lib/report-chart.3fe727a6.js +2 -0
  173. package/lib/report-chart.css +12 -0
  174. package/lib/report-html.3fe727a6.js +2 -0
  175. package/lib/report-html.css +2 -0
  176. package/lib/report-preview.3fe727a6.js +2 -0
  177. package/lib/report-preview.css +2 -0
  178. package/lib/role_select.png +0 -0
  179. package/lib/router-view.3fe727a6.js +1 -0
  180. package/lib/router-view.css +2 -0
  181. package/lib/scope.3fe727a6.js +9 -0
  182. package/lib/scope.css +6 -0
  183. package/lib/search.3fe727a6.js +2 -0
  184. package/lib/search.css +12 -0
  185. package/lib/snapshot-history.png +0 -0
  186. package/lib/snapshot-manual.png +0 -0
  187. package/lib/snapshot-realtime.png +0 -0
  188. package/lib/staff.png +0 -0
  189. package/lib/step-item.3fe727a6.js +2 -0
  190. package/lib/step-item.css +2 -0
  191. package/lib/step.3fe727a6.js +2 -0
  192. package/lib/step.css +2 -0
  193. package/lib/tab-bar.3fe727a6.js +1 -0
  194. package/lib/tab-bar.css +2 -0
  195. package/lib/tag.3fe727a6.js +2 -0
  196. package/lib/tag.css +2 -0
  197. package/lib/task-list-page.3fe727a6.js +2 -0
  198. package/lib/task-list-page.css +2 -0
  199. package/lib/task-list.3fe727a6.js +26 -0
  200. package/lib/task-list.css +16 -0
  201. package/lib/text-editor.3fe727a6.js +2 -0
  202. package/lib/text-editor.css +2 -0
  203. package/lib/text.3fe727a6.js +2 -0
  204. package/lib/text.css +2 -0
  205. package/lib/title.3fe727a6.js +2 -0
  206. package/lib/title.css +2 -0
  207. package/lib/visual-config-page.3fe727a6.js +9 -0
  208. package/lib/visual-config-page.css +73 -0
  209. package/package.json +1 -1
package/lib/97.js ADDED
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[97],{1004:function(e,t,n){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=r||i||o,s=l&&(r?document.documentMode||6:+(o||i)[1]),a=!o&&/WebKit\//.test(e),c=a&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\/(\d+)/.exec(e),f=u&&+u[1],h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),p=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),g=/PhantomJS/.test(e),m=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=m||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=m||/Mac/.test(t),w=/\bCrOS\b/.test(e),x=/win/i.test(t),C=h&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(h=!1,a=!0);var k=b&&(c||h&&(null==C||C<12.11)),S=n||l&&s>=9;function L(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var T,M=function(e,t){var n=e.className,r=L(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return A(e).appendChild(t)}function N(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"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 D(e,t,n,r){var i=N(e,t,n,r);return i.setAttribute("role","presentation"),i}function H(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 W(e){var t;try{t=e.activeElement}catch(n){t=e.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function F(e,t){var n=e.className;L(t).test(n)||(e.className+=(n?" ":"")+t)}function P(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!L(n[r]).test(t)&&(t+=" "+n[r]);return t}T=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var E=function(e){e.select()};function I(e){return e.display.wrapper.ownerDocument}function z(e){return I(e).defaultView}function R(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function j(e,t,n,r,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return l+(t-o);l+=s-o,l+=n-l%n,o=s+1}}m?E=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(E=function(e){try{e.select()}catch(e){}});var V=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function G(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var U={toString:function(){return"CodeMirror.Pass"}},K={scroll:!1},_={origin:"*mouse"},$={origin:"+move"};function X(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||i+l>=t)return r+Math.min(l,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var Y=[""];function q(e){for(;Y.length<=e;)Y.push(Z(Y)+" ");return Y[e]}function Z(e){return e[e.length-1]}function Q(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function J(){}function ee(e,t){var n;return Object.create?n=Object.create(e):(J.prototype=e,n=new J),t&&B(t,n),n}var te=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ne(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||te.test(e))}function re(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ne(e))||t.test(e):ne(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var oe=/[\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]/;function le(e){return e.charCodeAt(0)>=768&&oe.test(e)}function se(e,t,n){for(;(n<0?t>0:t<e.length)&&le(e.charAt(t));)t+=n;return t}function ae(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var ce=null;function ue(e,t,n){var r;ce=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"==n?r=i:ce=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:ce=i)}return null!=r?r:ce}var fe=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,s){var a="ltr"==s?"L":"R";if(0==l.length||"ltr"==s&&!e.test(l))return!1;for(var c,u=l.length,f=[],h=0;h<u;++h)f.push((c=l.charCodeAt(h))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var d=0,p=a;d<u;++d){var g=f[d];"m"==g?f[d]=p:p=g}for(var m=0,v=a;m<u;++m){var y=f[m];"1"==y&&"r"==v?f[m]="n":n.test(y)&&(v=y,"r"==y&&(f[m]="R"))}for(var b=1,w=f[0];b<u-1;++b){var x=f[b];"+"==x&&"1"==w&&"1"==f[b+1]?f[b]="1":","!=x||w!=f[b+1]||"1"!=w&&"n"!=w||(f[b]=w),w=x}for(var C=0;C<u;++C){var k=f[C];if(","==k)f[C]="N";else if("%"==k){var S=void 0;for(S=C+1;S<u&&"%"==f[S];++S);for(var L=C&&"!"==f[C-1]||S<u&&"1"==f[S]?"1":"N",T=C;T<S;++T)f[T]=L;C=S-1}}for(var M=0,A=a;M<u;++M){var O=f[M];"L"==A&&"1"==O?f[M]="L":n.test(O)&&(A=O)}for(var N=0;N<u;++N)if(t.test(f[N])){var D=void 0;for(D=N+1;D<u&&t.test(f[D]);++D);for(var H="L"==(N?f[N-1]:a),W=H==("L"==(D<u?f[D]:a))?H?"L":"R":a,F=N;F<D;++F)f[F]=W;N=D-1}for(var P,E=[],I=0;I<u;)if(r.test(f[I])){var z=I;for(++I;I<u&&r.test(f[I]);++I);E.push(new o(0,z,I))}else{var R=I,B=E.length,j="rtl"==s?1:0;for(++I;I<u&&"L"!=f[I];++I);for(var V=R;V<I;)if(i.test(f[V])){R<V&&(E.splice(B,0,new o(1,R,V)),B+=j);var G=V;for(++V;V<I&&i.test(f[V]);++V);E.splice(B,0,new o(2,G,V)),B+=j,R=V}else++V;R<I&&E.splice(B,0,new o(1,R,I))}return"ltr"==s&&(1==E[0].level&&(P=l.match(/^\s+/))&&(E[0].from=P[0].length,E.unshift(new o(0,0,P[0].length))),1==Z(E).level&&(P=l.match(/\s+$/))&&(Z(E).to-=P[0].length,E.push(new o(0,u-P[0].length,u)))),"rtl"==s?E.reverse():E}}();function he(e,t){var n=e.order;return null==n&&(n=e.order=fe(e.text,t)),n}var de=[],pe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||de).concat(n)}};function ge(e,t){return e._handlers&&e._handlers[t]||de}function me(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=G(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function ve(e,t){var n=ge(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function ye(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ve(e,n||t.type,e,t),Se(t)||t.codemirrorIgnore}function be(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==G(n,t[r])&&n.push(t[r])}function we(e,t){return ge(e,t).length>0}function xe(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){me(this,e,t)}}function Ce(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Le(e){Ce(e),ke(e)}function Te(e){return e.target||e.srcElement}function Me(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Ae,Oe,Ne=function(){if(l&&s<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function De(e){if(null==Ae){var t=N("span","​");O(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ae=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&s<8))}var n=Ae?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function He(e){if(null!=Oe)return Oe;var t=O(e,document.createTextNode("AخA")),n=T(t,0,1).getBoundingClientRect(),r=T(t,1,2).getBoundingClientRect();return A(e),!(!n||n.left==n.right)&&(Oe=r.right-n.right<3)}var We,Fe=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){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?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Pe=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)},Ee="oncopy"in(We=N("div"))||(We.setAttribute("oncopy","return;"),"function"==typeof We.oncopy),Ie=null,ze={},Re={};function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ze[e]=t}function je(e){if("string"==typeof e&&Re.hasOwnProperty(e))e=Re[e];else if(e&&"string"==typeof e.name&&Re.hasOwnProperty(e.name)){var t=Re[e.name];"string"==typeof t&&(t={name:t}),(e=ee(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return je("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return je("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Ve(e,t){t=je(t);var n=ze[t.name];if(!n)return Ve(e,"text/plain");var r=n(e,t);if(Ge.hasOwnProperty(t.name)){var i=Ge[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var Ge={};function Ue(e,t){B(t,Ge.hasOwnProperty(e)?Ge[e]:Ge[e]={})}function Ke(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function _e(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function $e(e,t,n){return!e.startState||e.startState(t,n)}var Xe=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Ye(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 n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function qe(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function Ze(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function Qe(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Je(e){if(null==e.parent)return null;for(var t=e.parent,n=G(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function et(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l].height;if(t<s)break;t-=s}return n+l}function tt(e,t){return t>=e.first&&t<e.first+e.size}function nt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function rt(e,t,n){if(void 0===n&&(n=null),!(this instanceof rt))return new rt(e,t,n);this.line=e,this.ch=t,this.sticky=n}function it(e,t){return e.line-t.line||e.ch-t.ch}function ot(e,t){return e.sticky==t.sticky&&0==it(e,t)}function lt(e){return rt(e.line,e.ch)}function st(e,t){return it(e,t)<0?t:e}function at(e,t){return it(e,t)<0?e:t}function ct(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ut(e,t){if(t.line<e.first)return rt(e.first,0);var n=e.first+e.size-1;return t.line>n?rt(n,Ye(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?rt(e.line,t):n<0?rt(e.line,0):e}(t,Ye(e,t.line).text.length)}function ft(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ut(e,t[r]);return n}Xe.prototype.eol=function(){return this.pos>=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xe.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},Xe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=j(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return j(this.string,null,this.tabSize)-(this.lineStart?j(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ht=function(e,t){this.state=e,this.lookAhead=t},dt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function pt(e,t,n,r){var i=[e.state.modeGen],o={};kt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var l=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],a=1,c=0;n.state=!0,kt(e,t.text,s.mode,n,(function(e,t){for(var n=a;c<e;){var r=i[a];r>e&&i.splice(a,1,e,i[a+1],r),a+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,a-n,e,"overlay "+t),a=n+2;else for(;n<a;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=l,n.baseTokens=null,n.baseTokenPos=1},a=0;a<e.state.overlays.length;++a)s(a);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function gt(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=mt(e,Je(t)),i=t.text.length>e.options.maxHighlightLength&&Ke(e.doc.mode,r.state),o=pt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function mt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new dt(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=o.first)return o.first;var a=Ye(o,s-1),c=a.stateAfter;if(c&&(!n||s+(c instanceof ht?c.lookAhead:0)<=o.modeFrontier))return s;var u=j(a.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),l=o>r.first&&Ye(r,o-1).stateAfter,s=l?dt.fromSaved(r,l,o):new dt(r,$e(r.mode),o);return r.iter(o,t,(function(n){vt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function vt(e,t,n,r){var i=e.doc.mode,o=new Xe(t,e.options.tabSize,n);for(o.start=o.pos=r||0,""==t&&yt(i,n.state);!o.eol();)bt(i,o,n.state),o.start=o.pos}function yt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=_e(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function bt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=_e(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}dt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},dt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},dt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},dt.fromSaved=function(e,t,n){return t instanceof ht?new dt(e,Ke(e.mode,t.state),n,t.lookAhead):new dt(e,Ke(e.mode,t),n)},dt.prototype.save=function(e){var t=!1!==e?Ke(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ht(t,this.maxLookAhead):t};var wt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xt(e,t,n,r){var i,o,l=e.doc,s=l.mode,a=Ye(l,(t=ut(l,t)).line),c=mt(e,t.line,n),u=new Xe(a.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,i=bt(s,u,c.state),r&&o.push(new wt(u,i,Ke(l.mode,c.state)));return r?o:new wt(u,i,c.state)}function Ct(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function kt(e,t,n,r,i,o,l){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var a,c=0,u=null,f=new Xe(t,e.options.tabSize,r),h=e.options.addModeClass&&[null];for(""==t&&Ct(yt(n,r.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(s=!1,l&&vt(e,t,r,f.pos),f.pos=t.length,a=null):a=Ct(bt(n,f,r.state,h),o),h){var d=h[0].name;d&&(a="m-"+(a?d+" "+a:d))}if(!s||u!=a){for(;c<f.start;)i(c=Math.min(f.start,c+5e3),u);u=a}f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e3);i(p,u),c=p}}var St=!1,Lt=!1;function Tt(e,t,n){this.marker=e,this.from=t,this.to=n}function Mt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function At(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Ot(e,t){if(t.full)return null;var n=tt(e,t.from.line)&&Ye(e,t.from.line).markedSpans,r=tt(e,t.to.line)&&Ye(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,l=0==it(t.from,t.to),s=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t)||o.from==t&&"bookmark"==l.type&&(!n||!o.marker.insertLeft)){var s=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Tt(l,o.from,s?null:o.to))}}return r}(n,i,l),a=function(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker;if(null==o.to||(l.inclusiveRight?o.to>=t:o.to>t)||o.from==t&&"bookmark"==l.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Tt(l,s?null:o.from-t,null==o.to?null:o.to-t))}}return r}(r,o,l),c=1==t.text.length,u=Z(t.text).length+(c?i:0);if(s)for(var f=0;f<s.length;++f){var h=s[f];if(null==h.to){var d=Mt(a,h.marker);d?c&&(h.to=null==d.to?null:d.to+u):h.to=i}}if(a)for(var p=0;p<a.length;++p){var g=a[p];null!=g.to&&(g.to+=u),null==g.from?Mt(s,g.marker)||(g.from=u,c&&(s||(s=[])).push(g)):(g.from+=u,c&&(s||(s=[])).push(g))}s&&(s=Nt(s)),a&&a!=s&&(a=Nt(a));var m=[s];if(!c){var v,y=t.text.length-2;if(y>0&&s)for(var b=0;b<s.length;++b)null==s[b].to&&(v||(v=[])).push(new Tt(s[b].marker,null,null));for(var w=0;w<y;++w)m.push(v);m.push(a)}return m}function Nt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Dt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Ht(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Wt(e){return e.inclusiveLeft?-1:0}function Ft(e){return e.inclusiveRight?1:0}function Pt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=it(r.from,i.from)||Wt(e)-Wt(t);if(o)return-o;var l=it(r.to,i.to)||Ft(e)-Ft(t);return l||t.id-e.id}function Et(e,t){var n,r=Lt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||Pt(n,i.marker)<0)&&(n=i.marker);return n}function It(e){return Et(e,!0)}function zt(e){return Et(e,!1)}function Rt(e,t){var n,r=Lt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Pt(n,o.marker)<0)&&(n=o.marker)}return n}function Bt(e,t,n,r,i){var o=Ye(e,t),l=Lt&&o.markedSpans;if(l)for(var s=0;s<l.length;++s){var a=l[s];if(a.marker.collapsed){var c=a.marker.find(0),u=it(c.from,n)||Wt(a.marker)-Wt(i),f=it(c.to,r)||Ft(a.marker)-Ft(i);if(!(u>=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?it(c.to,n)>=0:it(c.to,n)>0)||u>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?it(c.from,r)<=0:it(c.from,r)<0)))return!0}}}function jt(e){for(var t;t=It(e);)e=t.find(-1,!0).line;return e}function Vt(e,t){var n=Ye(e,t),r=jt(n);return n==r?t:Je(r)}function Gt(e,t){if(t>e.lastLine())return t;var n,r=Ye(e,t);if(!Ut(e,r))return t;for(;n=zt(r);)r=n.find(1,!0).line;return Je(r)+1}function Ut(e,t){var n=Lt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Kt(e,t,r))return!0}}function Kt(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return Kt(e,r.line,Mt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Kt(e,t,i))return!0}function _t(e){for(var t=0,n=(e=jt(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(var l=0;l<o.children.length;++l){var s=o.children[l];if(s==n)break;t+=s.height}return t}function $t(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=It(r);){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}for(r=e;t=zt(r);){var o=t.find(0,!0);n-=r.text.length-o.from.ch,n+=(r=o.to.line).text.length-o.to.ch}return n}function Xt(e){var t=e.display,n=e.doc;t.maxLine=Ye(n,n.first),t.maxLineLength=$t(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=$t(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var Yt=function(e,t,n){this.text=e,Ht(this,t),this.height=n?n(this):1};function qt(e){e.parent=null,Dt(e)}Yt.prototype.lineNo=function(){return Je(this)},xe(Yt);var Zt={},Qt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Qt:Zt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function en(e,t){var n=D("span",null,null,a?"padding-right: .1px":null),r={pre:D("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;r.pos=0,r.addToken=nn,He(e.display.measure)&&(l=he(o,e.doc.direction))&&(r.addToken=rn(r.addToken,l)),r.map=[],ln(o,r,gt(e,o,t!=e.display.externalMeasured&&Je(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=P(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=P(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(De(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(a){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=P(r.pre.className,r.textClass||"")),r}function tn(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function nn(e,t,n,r,i,o,a){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}(t,e.trailingSpace):t,f=e.cm.state.specialChars,h=!1;if(f.test(t)){c=document.createDocumentFragment();for(var d=0;;){f.lastIndex=d;var p=f.exec(t),g=p?p.index-d:t.length-d;if(g){var m=document.createTextNode(u.slice(d,d+g));l&&s<9?c.appendChild(N("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break;d+=g+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=c.appendChild(N("span",q(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=c.appendChild(N("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((v=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),l&&s<9?c.appendChild(N("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),l&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||h||o||a){var w=n||"";r&&(w+=r),i&&(w+=i);var x=N("span",[c],w,o);if(a)for(var C in a)a.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,a[C]);return e.content.appendChild(x)}e.content.appendChild(c)}}function rn(e,t){return function(n,r,i,o,l,s,a){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var f=void 0,h=0;h<t.length&&!((f=t[h]).to>c&&f.from<=c);h++);if(f.to>=u)return e(n,r,i,o,l,s,a);e(n,r.slice(0,f.to-c),i,o,null,s,a),o=null,r=r.slice(f.to-c),c=f.to}}}function on(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function ln(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,s,a,c,u,f,h,d=i.length,p=0,g=1,m="",v=0;;){if(v==p){a=c=u=s="",h=null,f=null,v=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==p&&C.widgetNode)y.push(C);else if(x.from<=p&&(null==x.to||x.to>p||C.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),C.className&&(a+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==p&&(u+=" "+C.startStyle),C.endStyle&&x.to==v&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((h||(h={})).title=C.title),C.attributes)for(var k in C.attributes)(h||(h={}))[k]=C.attributes[k];C.collapsed&&(!f||Pt(f.marker,C)<0)&&(f=x)}else x.from>p&&v>x.from&&(v=x.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(c+=" "+b[S]);if(!f||f.from==p)for(var L=0;L<y.length;++L)on(t,0,y[L]);if(f&&(f.from||0)==p){if(on(t,(null==f.to?d+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=d)break;for(var T=Math.min(d,v);;){if(m){var M=p+m.length;if(!f){var A=M>T?m.slice(0,T-p):m;t.addToken(t,A,l?l+a:a,u,p+A.length==v?c:"",s,h)}if(M>=T){m=m.slice(T-p),p=T;break}p=M,u=""}m=i.slice(o,o=n[g++]),l=Jt(n[g++],t.cm.options)}}else for(var O=1;O<n.length;O+=2)t.addToken(t,i.slice(o,o=n[O]),Jt(n[O+1],t.cm.options))}function sn(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=zt(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}(t),this.size=this.rest?Je(Z(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function an(e,t,n){for(var r,i=[],o=t;o<n;o=r){var l=new sn(e.doc,Ye(e.doc,o),o);r=o+l.size,i.push(l)}return i}var cn=null,un=null;function fn(e,t){var n=ge(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);cn?r=cn.delayedCallbacks:un?r=un:(r=un=[],setTimeout(hn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},l=0;l<n.length;++l)o(l)}}function hn(){var e=un;un=null;for(var t=0;t<e.length;++t)e[t]()}function dn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?mn(e,t):"gutter"==o?yn(e,t,n,r):"class"==o?vn(e,t):"widget"==o&&bn(e,t,r)}t.changes=null}function pn(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),l&&s<8&&(e.node.style.zIndex=2)),e.node}function gn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):en(e,t)}function mn(e,t){var n=t.text.className,r=gn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,vn(e,t)):n&&(t.text.className=n)}function vn(e,t){!function(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=pn(t);t.background=r.insertBefore(N("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?pn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function yn(e,t,n,r){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 i=pn(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=pn(t),s=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(N("div",nt(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var a=0;a<e.display.gutterSpecs.length;++a){var c=e.display.gutterSpecs[a].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(N("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function bn(e,t,n){t.alignable&&(t.alignable=null);for(var r=L("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);xn(e,t,n)}function wn(e,t,n,r){var i=gn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),vn(e,t),yn(e,t,n,r),xn(e,t,r),t.node}function xn(e,t,n){if(Cn(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Cn(e,t.rest[r],t,n,!1)}function Cn(e,t,n,r,i){if(t.widgets)for(var o=pn(n),l=0,s=t.widgets;l<s.length;++l){var a=s[l],c=N("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));a.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),kn(a,c,n,r),e.display.input.setUneditable(c),i&&a.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),fn(a,"redraw")}}function kn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Sn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!H(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),O(t.display.measure,N("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Ln(e,t){for(var n=Te(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Tn(e){return e.lineSpace.offsetTop}function Mn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function An(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,N("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function On(e){return 50-e.display.nativeBarWidth}function Nn(e){return e.display.scroller.clientWidth-On(e)-e.display.barWidth}function Dn(e){return e.display.scroller.clientHeight-On(e)-e.display.barHeight}function Hn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(Je(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Wn(e,t,n,r){return En(e,Pn(e,t),n,r)}function Fn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[dr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Pn(e,t){var n=Je(t),r=Fn(e,n);r&&!r.text?r=null:r&&r.changes&&(dn(e,r,n,ar(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var n=Je(t=jt(t)),r=e.display.externalMeasured=new sn(e.doc,t,n);r.lineN=n;var i=r.built=en(e,r);return r.text=i.pre,O(e.display.lineMeasure,i.pre),r}(e,t));var i=Hn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function En(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,i=r&&Nn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var a=l[s],c=l[s+1];Math.abs(a.bottom-c.bottom)>2&&o.push((a.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Rn(t.map,n,r),a=o.node,c=o.start,u=o.end,f=o.collapse;if(3==a.nodeType){for(var h=0;h<4;h++){for(;c&&le(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u<o.coverEnd&&le(t.line.text.charAt(o.coverStart+u));)++u;if((i=l&&s<9&&0==c&&u==o.coverEnd-o.coverStart?a.parentNode.getBoundingClientRect():Bn(T(a,c,u).getClientRects(),r)).left||i.right||0==c)break;u=c,c-=1,f="right"}l&&s<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ie)return Ie;var t=O(e,N("span","x")),n=t.getBoundingClientRect(),r=T(t,0,1).getBoundingClientRect();return Ie=Math.abs(n.left-r.left)>1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var d;c>0&&(f=r="right"),i=e.options.lineWrapping&&(d=a.getClientRects()).length>1?d["right"==r?d.length-1:0]:a.getBoundingClientRect()}if(l&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=a.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+sr(e.display),top:p.top,bottom:p.bottom}:zn}for(var g=i.top-t.rect.top,m=i.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights,b=0;b<y.length-1&&!(v<y[b]);b++);var w=b?y[b-1]:0,x=y[b],C={left:("right"==f?i.right:i.left)-t.rect.left,right:("left"==f?i.left:i.right)-t.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=m),C}(e,t,n,r)).bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var In,zn={left:0,right:0,top:0,bottom:0};function Rn(e,t,n){for(var r,i,o,l,s,a,c=0;c<e.length;c+=3)if(s=e[c],a=e[c+1],t<s?(i=0,o=1,l="left"):t<a?o=1+(i=t-s):(c==e.length-3||t==a&&e[c+3]>t)&&(i=(o=a-s)-1,t>=a&&(l="right")),null!=i){if(r=e[c+2],s==a&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],l="left";if("right"==n&&i==a-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],l="right";break}return{node:r,start:i,end:o,collapse:l,coverStart:s,coverEnd:a}}function Bn(e,t){var n=zn;if("left"==t)for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function jn(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 Vn(e){e.display.externalMeasure=null,A(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)jn(e.display.view[t])}function Gn(e){Vn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Un(e){return u&&v?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Kn(e){return u&&v?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function _n(e){var t=jt(e).widgets,n=0;if(t)for(var r=0;r<t.length;++r)t[r].above&&(n+=Sn(t[r]));return n}function $n(e,t,n,r,i){if(!i){var o=_n(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var l=_t(t);if("local"==r?l+=Tn(e.display):l-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+("window"==r?0:Kn(I(e)));var a=s.left+("window"==r?0:Un(I(e)));n.left+=a,n.right+=a}return n.top+=l,n.bottom+=l,n}function Xn(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=Un(I(e)),i-=Kn(I(e));else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:r-l.left,top:i-l.top}}function Yn(e,t,n,r,i){return r||(r=Ye(e.doc,t.line)),$n(e,r,Wn(e,r,t.ch,i),n)}function qn(e,t,n,r,i,o){function l(t,l){var s=En(e,i,t,l?"right":"left",o);return l?s.left=s.right:s.right=s.left,$n(e,r,s,n)}r=r||Ye(e.doc,t.line),i||(i=Pn(e,r));var s=he(r,e.doc.direction),a=t.ch,c=t.sticky;if(a>=r.text.length?(a=r.text.length,c="before"):a<=0&&(a=0,c="after"),!s)return l("before"==c?a-1:a,"before"==c);function u(e,t,n){return l(n?e-1:e,1==s[t].level!=n)}var f=ue(s,a,c),h=ce,d=u(a,f,"before"==c);return null!=h&&(d.other=u(a,h,"before"!=c)),d}function Zn(e,t){var n=0;t=ut(e.doc,t),e.options.lineWrapping||(n=sr(e.display)*t.ch);var r=Ye(e.doc,t.line),i=_t(r)+Tn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Qn(e,t,n,r,i){var o=rt(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Jn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Qn(r.first,0,null,-1,-1);var i=et(r,n),o=r.first+r.size-1;if(i>o)return Qn(r.first+r.size-1,Ye(r,o).text.length,null,1,1);t<0&&(t=0);for(var l=Ye(r,i);;){var s=rr(e,l,i,t,n),a=Rt(l,s.ch+(s.xRel>0||s.outside>0?1:0));if(!a)return s;var c=a.find(1);if(c.line==i)return c;l=Ye(r,i=c.line)}}function er(e,t,n,r){r-=_n(t);var i=t.text.length,o=ae((function(t){return En(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=ae((function(t){return En(e,n,t).top>r}),o,i)}}function tr(e,t,n,r){return n||(n=Pn(e,t)),er(e,t,n,$n(e,t,En(e,n,r),"line").top)}function nr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function rr(e,t,n,r,i){i-=_t(t);var o=Pn(e,t),l=_n(t),s=0,a=t.text.length,c=!0,u=he(t,e.doc.direction);if(u){var f=(e.options.lineWrapping?or:ir)(e,t,n,o,u,r,i);s=(c=1!=f.level)?f.from:f.to-1,a=c?f.to:f.from-1}var h,d,p=null,g=null,m=ae((function(t){var n=En(e,o,t);return n.top+=l,n.bottom+=l,!!nr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,g=n),!0)}),s,a),v=!1;if(g){var y=r-g.left<g.right-r,b=y==c;m=p+(b?0:1),d=b?"after":"before",h=y?g.left:g.right}else{c||m!=a&&m!=s||m++,d=0==m?"after":m==t.text.length?"before":En(e,o,m-(c?1:0)).bottom+l<=i==c?"after":"before";var w=qn(e,rt(n,m,d),"line",t,o);h=w.left,v=i<w.top?-1:i>=w.bottom?1:0}return Qn(n,m=se(t.text,m,1),d,v,r-h)}function ir(e,t,n,r,i,o,l){var s=ae((function(s){var a=i[s],c=1!=a.level;return nr(qn(e,rt(n,c?a.to:a.from,c?"before":"after"),"line",t,r),o,l,!0)}),0,i.length-1),a=i[s];if(s>0){var c=1!=a.level,u=qn(e,rt(n,c?a.from:a.to,c?"after":"before"),"line",t,r);nr(u,o,l,!0)&&u.top>l&&(a=i[s-1])}return a}function or(e,t,n,r,i,o,l){var s=er(e,t,r,l),a=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,f=null,h=0;h<i.length;h++){var d=i[h];if(!(d.from>=c||d.to<=a)){var p=En(e,r,1!=d.level?Math.min(c,d.to)-1:Math.max(a,d.from)).right,g=p<o?o-p+1e9:p-o;(!u||f>g)&&(u=d,f=g)}}return u||(u=i[i.length-1]),u.from<a&&(u={from:a,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function lr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==In){In=N("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)In.appendChild(document.createTextNode("x")),In.appendChild(N("br"));In.appendChild(document.createTextNode("x"))}O(e.measure,In);var n=In.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),A(e.measure),n||1}function sr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),n=N("pre",[t],"CodeMirror-line-like");O(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ar(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var s=e.display.gutterSpecs[l].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:cr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function cr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ur(e){var t=lr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/sr(e.display)-3);return function(i){if(Ut(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 n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function fr(e){var t=e.doc,n=ur(e);t.iter((function(e){var t=n(e);t!=e.height&&Qe(e,t)}))}function hr(e,t,n,r){var i=e.display;if(!n&&"true"==Te(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(e){return null}var a,c=Jn(e,o,l);if(r&&c.xRel>0&&(a=Ye(e.doc,c.line).text).length==c.ch){var u=j(a,a.length,e.options.tabSize)-a.length;c=rt(c.line,Math.max(0,Math.round((o-An(e.display).left)/sr(e.display))-u))}return c}function dr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function pr(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Lt&&Vt(e.doc,t)<i.viewTo&&mr(e);else if(n<=i.viewFrom)Lt&&Gt(e.doc,n+r)>i.viewFrom?mr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)mr(e);else if(t<=i.viewFrom){var o=vr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):mr(e)}else if(n>=i.viewTo){var l=vr(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):mr(e)}else{var s=vr(e,t,t,-1),a=vr(e,n,n+r,1);s&&a?(i.view=i.view.slice(0,s.index).concat(an(e,s.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=r):mr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function gr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[dr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==G(l,n)&&l.push(n)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vr(e,t,n,r){var i,o=dr(e,t),l=e.display.view;if(!Lt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,a=0;a<o;a++)s+=l[a].size;if(s!=t){if(r>0){if(o==l.length-1)return null;i=s+l[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Vt(e.doc,n)!=n;){if(o==(r<0?0:l.length-1))return null;n+=r*l[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function yr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function br(e){e.display.input.showSelection(e.display.input.prepareSelection())}function wr(e,t){void 0===t&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var a=n.sel.ranges[s];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var c=a.empty();if(l){var u=l(e,a);u&&xr(e,u,i)}else(c||e.options.showCursorWhenSelecting)&&xr(e,a.head,i);c||kr(e,a,o)}}return r}function xr(e,t,n){var r=qn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(N("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=Yn(e,t,"div",null,null),l=o.right-o.left;i.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Cr(e,t){return e.top-t.top||e.left-t.left}function kr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),l=An(e.display),s=l.left,a=Math.max(r.sizerWidth,Nn(e)-r.sizer.offsetLeft)-l.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?a-e:n)+"px;\n height: "+(r-t)+"px"))}function f(t,n,r){var o,l,f=Ye(i,t),h=f.text.length;function d(n,r){return Yn(e,rt(t,n),"div",f,r)}function p(t,n,r){var i=tr(e,f,null,t),o="ltr"==n==("after"==r)?"left":"right";return d("after"==r?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var g=he(f,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(g,n||0,null==r?h:r,(function(e,t,i,f){var m="ltr"==i,v=d(e,m?"left":"right"),y=d(t-1,m?"right":"left"),b=null==n&&0==e,w=null==r&&t==h,x=0==f,C=!g||f==g.length-1;if(y.top-v.top<=3){var k=(c?w:b)&&C,S=(c?b:w)&&x?s:(m?v:y).left,L=k?a:(m?y:v).right;u(S,v.top,L-S,v.bottom)}else{var T,M,A,O;m?(T=c&&b&&x?s:v.left,M=c?a:p(e,i,"before"),A=c?s:p(t,i,"after"),O=c&&w&&C?a:y.right):(T=c?p(e,i,"before"):s,M=!c&&b&&x?a:v.right,A=!c&&w&&C?s:y.left,O=c?p(t,i,"after"):a),u(T,v.top,M-T,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(A,y.top,O-A,y.bottom)}(!o||Cr(v,o)<0)&&(o=v),Cr(y,o)<0&&(o=y),(!l||Cr(v,l)<0)&&(l=v),Cr(y,l)<0&&(l=y)})),{start:o,end:l}}var h=t.from(),d=t.to();if(h.line==d.line)f(h.line,h.ch,d.ch);else{var p=Ye(i,h.line),g=Ye(i,d.line),m=jt(p)==jt(g),v=f(h.line,h.ch,m?p.text.length+1:null).end,y=f(d.line,m?0:null,d.ch).start;m&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(o)}function Sr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||Ar(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Lr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Mr(e))}function Tr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Ar(e))}),100)}function Mr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,F(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),a&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Sr(e))}function Ar(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(e,"blur",e,t),e.state.focused=!1,M(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Or(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var c=t.view[a],u=e.options.lineWrapping,f=void 0,h=0;if(!c.hidden){if(i+=c.line.height,l&&s<8){var d=c.node.offsetTop+c.node.offsetHeight;f=d-n,n=d}else{var p=c.node.getBoundingClientRect();f=p.bottom-p.top,!u&&c.text.firstChild&&(h=c.text.firstChild.getBoundingClientRect().right-p.left-1)}var g=c.line.height-f;if((g>.005||g<-.005)&&(i<r&&(o-=g),Qe(c.line,f),Nr(c.line),c.rest))for(var m=0;m<c.rest.length;m++)Nr(c.rest[m]);if(h>e.display.sizerWidth){var v=Math.ceil(h/sr(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function Nr(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Dr(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Tn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=et(t,r),l=et(t,i);if(n&&n.ensure){var s=n.ensure.from.line,a=n.ensure.to.line;s<o?(o=s,l=et(t,_t(Ye(t,s))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=l&&(o=et(t,_t(Ye(t,a))-e.wrapper.clientHeight),l=a)}return{from:o,to:Math.max(l,o+1)}}function Hr(e,t){var n=e.display,r=lr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Dn(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Mn(n),a=t.top<r,c=t.bottom>s-r;if(t.top<i)l.scrollTop=a?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(l.scrollTop=u)}var f=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-f,d=Nn(e)-n.gutters.offsetWidth,p=t.right-t.left>d;return p&&(t.right=t.left+d),t.left<10?l.scrollLeft=0:t.left<h?l.scrollLeft=Math.max(0,t.left+f-(p?0:10)):t.right>d+h-3&&(l.scrollLeft=t.right+(p?0:10)-d),l}function Wr(e,t){null!=t&&(Er(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Fr(e){Er(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pr(e,t,n){null==t&&null==n||Er(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Er(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Ir(e,Zn(e,t.from),Zn(e,t.to),t.margin))}function Ir(e,t,n,r){var i=Hr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Pr(e,i.scrollLeft,i.scrollTop)}function zr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||hi(e,{top:t}),Rr(e,t,!0),n&&hi(e),li(e,100))}function Rr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Br(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,gi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function jr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Mn(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?n:0,docHeight:r,scrollHeight:r+On(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Vr=function(e,t,n){this.cm=n;var r=this.vert=N("div",[N("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=N("div",[N("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),pe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),pe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,l&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Vr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r: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==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Vr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Vr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Vr.prototype.zeroWidthHack=function(){var e=b&&!p?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new V,this.disableVert=new V},Vr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,r)}))},Vr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Gr=function(){};function Ur(e,t){t||(t=jr(e));var n=e.display.barWidth,r=e.display.barHeight;Kr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Or(e),Kr(e,jr(e)),n=e.display.barWidth,r=e.display.barHeight}function Kr(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Gr.prototype.update=function(){return{bottom:0,right:0}},Gr.prototype.setScrollLeft=function(){},Gr.prototype.setScrollTop=function(){},Gr.prototype.clear=function(){};var _r={native:Vr,null:Gr};function $r(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new _r[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Br(e,t):zr(e,t)}),e),e.display.scrollbars.addClass&&F(e.display.wrapper,e.display.scrollbars.addClass)}var Xr=0;function Yr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Xr,markArrays:null},t=e.curOp,cn?cn.ops.push(t):t.ownsGroup=cn={ops:[t],delayedCallbacks:[]}}function qr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{cn=null,t(n)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,n=0;n<t.length;n++)Zr(t[n]);for(var r=0;r<t.length;r++)Qr(t[r]);for(var i=0;i<t.length;i++)Jr(t[i]);for(var o=0;o<t.length;o++)ei(t[o]);for(var l=0;l<t.length;l++)ti(t[l])}(e)}))}function Zr(e){var t=e.cm,n=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=On(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=On(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&Xt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ai(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qr(e){e.updatedDisplay=e.mustUpdate&&ui(e.cm,e.update)}function Jr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Or(t),e.barMeasure=jr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Wn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+On(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Nn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ei(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Br(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==W(I(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ur(t,e.barMeasure),e.updatedDisplay&&pi(t,e.barMeasure),e.selectionChanged&&Sr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Lr(e.cm)}function ti(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&fi(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&Rr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Br(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ye(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!g){var l=N("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Tn(e.display))+"px;\n height: "+(t.bottom-t.top+On(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?rt(t.line,t.ch+1,"before"):t,t=t.ch?rt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,s=qn(e,t),a=n&&n!=t?qn(e,n):s,c=Hr(e,i={left:Math.min(s.left,a.left),top:Math.min(s.top,a.top)-r,right:Math.max(s.left,a.left),bottom:Math.max(s.bottom,a.bottom)+r}),u=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=c.scrollTop&&(zr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=c.scrollLeft&&(Br(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}(t,ut(r,e.scrollToPos.from),ut(r,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||ve(i[l],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&ve(o[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ve(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ni(e,t){if(e.curOp)return t();Yr(e);try{return t()}finally{qr(e)}}function ri(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Yr(e);try{return t.apply(e,arguments)}finally{qr(e)}}}function ii(e){return function(){if(this.curOp)return e.apply(this,arguments);Yr(this);try{return e.apply(this,arguments)}finally{qr(this)}}}function oi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Yr(t);try{return e.apply(this,arguments)}finally{qr(t)}}}function li(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,R(si,e))}function si(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=mt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var l=o.styles,s=o.text.length>e.options.maxHighlightLength?Ke(t.mode,r.state):null,a=pt(e,o,r,!0);s&&(r.state=s),o.styles=a.styles;var c=o.styleClasses,u=a.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!f&&h<l.length;++h)f=l[h]!=o.styles[h];f&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&vt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return li(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ni(e,(function(){for(var t=0;t<i.length;t++)gr(e,i[t],"text")}))}}var ai=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Dr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Nn(e),this.force=n,this.dims=ar(e),this.events=[]};function ci(e){if(e.hasFocus())return null;var t=W(I(e));if(!t||!H(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=z(e).getSelection();r.anchorNode&&r.extend&&H(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ui(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return mr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==yr(e))return!1;mi(e)&&(mr(e),t.dims=ar(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),Lt&&(o=Vt(e.doc,o),l=Gt(e.doc,l));var s=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=an(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=an(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(dr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(an(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,dr(e,n)))),r.viewTo=n}(e,o,l),n.viewOffset=_t(Ye(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=yr(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=ci(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,l=o.firstChild;function s(t){var n=t.nextSibling;return a&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,f=0;f<c.length;f++){var h=c[f];if(h.hidden);else if(h.node&&h.node.parentNode==o){for(;l!=h.node;)l=s(l);var d=i&&null!=t&&t<=u&&h.lineNumber;h.changes&&(G(h.changes,"gutter")>-1&&(d=!1),dn(e,h,u,n)),d&&(A(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(nt(e.options,u)))),l=h.node.nextSibling}else{var p=wn(e,h,u,n);o.insertBefore(p,l)}u+=h.size}for(;l;)l=s(l)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=W(e.activeElt.ownerDocument)&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&H(document.body,e.anchorNode)&&H(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}(u),A(n.cursorDiv),A(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,li(e,400)),n.updateLineNumbers=null,!0}function fi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Nn(e))r&&(t.visible=Dr(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Mn(e.display)-Dn(e),n.top)}),t.visible=Dr(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ui(e,t))break;Or(e);var i=jr(e);br(e),Ur(e,i),pi(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 hi(e,t){var n=new ai(e,t);if(ui(e,n)){Or(e),fi(e,n);var r=jr(e);br(e),Ur(e,r),pi(e,r),n.finish()}}function di(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",fn(e,"gutterChanged",e)}function pi(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+On(e)+"px"}function gi(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=cr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&(n[l].gutter&&(n[l].gutter.style.left=o),n[l].gutterBackground&&(n[l].gutterBackground.style.left=o));var s=n[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function mi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=nt(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(N("div",[N("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-l)+1,r.lineNumWidth=r.lineNumInnerWidth+l,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",di(e.display),!0}return!1}function vi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],l=null;if("string"!=typeof o&&(l=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:l})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function yi(e){var t=e.gutters,n=e.gutterSpecs;A(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,l=i.style,s=t.appendChild(N("div",null,"CodeMirror-gutter "+o));l&&(s.style.cssText=l),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",di(e)}function bi(e){yi(e.display),pr(e),gi(e)}function wi(e,t,r,i){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=D("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=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=N("div",[c],null,"position: relative"),o.sizer=N("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=N("div",null,null,"position: absolute; height: 50px; 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"),u&&f>=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),l&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),a||n&&y||(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,o.gutterSpecs=vi(i.gutters,i.lineNumbers),yi(o),r.init(o)}ai.prototype.signal=function(e,t){we(e,t)&&this.events.push(arguments)},ai.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ve.apply(null,this.events[e])};var xi=0,Ci=null;function ki(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function Si(e){var t=ki(e);return t.x*=Ci,t.y*=Ci,t}function Li(e,t){u&&102==f&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var r=ki(t),i=r.x,o=r.y,l=Ci;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,l=1);var s=e.display,c=s.scroller,d=c.scrollWidth>c.clientWidth,p=c.scrollHeight>c.clientHeight;if(i&&d||o&&p){if(o&&b&&a)e:for(var g=t.target,m=s.view;g!=c;g=g.parentNode)for(var v=0;v<m.length;v++)if(m[v].node==g){e.display.currentWheelTarget=g;break e}if(i&&!n&&!h&&null!=l)return o&&p&&zr(e,Math.max(0,c.scrollTop+o*l)),Br(e,Math.max(0,c.scrollLeft+i*l)),(!o||o&&p)&&Ce(t),void(s.wheelStartX=null);if(o&&null!=l){var y=o*l,w=e.doc.scrollTop,x=w+s.wrapper.clientHeight;y<0?w=Math.max(0,w+y-50):x=Math.min(e.doc.height,x+y+50),hi(e,{top:w,bottom:x})}xi<20&&0!==t.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=c.scrollLeft,s.wheelStartY=c.scrollTop,s.wheelDX=i,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var e=c.scrollLeft-s.wheelStartX,t=c.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(Ci=(Ci*xi+n)/(xi+1),++xi)}}),200)):(s.wheelDX+=i,s.wheelDY+=o))}}l?Ci=-.53:n?Ci=15:u?Ci=-.7:d&&(Ci=-1/3);var Ti=function(e,t){this.ranges=e,this.primIndex=t};Ti.prototype.primary=function(){return this.ranges[this.primIndex]},Ti.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!ot(n.anchor,r.anchor)||!ot(n.head,r.head))return!1}return!0},Ti.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Mi(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new Ti(e,this.primIndex)},Ti.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ti.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(it(t,r.from())>=0&&it(e,r.to())<=0)return n}return-1};var Mi=function(e,t){this.anchor=e,this.head=t};function Ai(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return it(e.from(),t.from())})),n=G(t,i);for(var o=1;o<t.length;o++){var l=t[o],s=t[o-1],a=it(s.to(),l.from());if(r&&!l.empty()?a>0:a>=0){var c=at(s.from(),l.from()),u=st(s.to(),l.to()),f=s.empty()?l.from()==l.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new Mi(f?u:c,f?c:u))}}return new Ti(t,n)}function Oi(e,t){return new Ti([new Mi(e,t||e)],0)}function Ni(e){return e.text?rt(e.from.line+e.text.length-1,Z(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Di(e,t){if(it(e,t.from)<0)return e;if(it(e,t.to)<=0)return Ni(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ni(t).ch-t.to.ch),rt(n,r)}function Hi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Mi(Di(i.anchor,t),Di(i.head,t)))}return Ai(e.cm,n,e.sel.primIndex)}function Wi(e,t,n){return e.line==t.line?rt(n.line,e.ch-t.ch+n.ch):rt(n.line+(e.line-t.line),e.ch)}function Fi(e){e.doc.mode=Ve(e.options,e.doc.modeOption),Pi(e)}function Pi(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,li(e,100),e.state.modeGen++,e.curOp&&pr(e)}function Ei(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Z(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ii(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){!function(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Dt(e),Ht(e,n);var i=r?r(e):1;i!=e.height&&Qe(e,i)}(e,n,i,r),fn(e,"change",e,t)}function l(e,t){for(var n=[],o=e;o<t;++o)n.push(new Yt(c[o],i(o),r));return n}var s=t.from,a=t.to,c=t.text,u=Ye(e,s.line),f=Ye(e,a.line),h=Z(c),d=i(c.length-1),p=a.line-s.line;if(t.full)e.insert(0,l(0,c.length)),e.remove(c.length,e.size-c.length);else if(Ei(e,t)){var g=l(0,c.length-1);o(f,f.text,d),p&&e.remove(s.line,p),g.length&&e.insert(s.line,g)}else if(u==f)if(1==c.length)o(u,u.text.slice(0,s.ch)+h+u.text.slice(a.ch),d);else{var m=l(1,c.length-1);m.push(new Yt(h+u.text.slice(a.ch),d,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,m)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+f.text.slice(a.ch),i(0)),e.remove(s.line+1,p);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(f,h+f.text.slice(a.ch),d);var v=l(1,c.length-1);p>1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}fn(e,"change",e,t)}function zi(e,t,n){!function e(r,i,o){if(r.linked)for(var l=0;l<r.linked.length;++l){var s=r.linked[l];if(s.doc!=i){var a=o&&s.sharedHist;n&&!a||(t(s.doc,a),e(s.doc,r,a))}}}(e,null,!0)}function Ri(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,fr(e),Fi(e),Bi(e),e.options.direction=t.direction,e.options.lineWrapping||Xt(e),e.options.mode=t.modeOption,pr(e)}function Bi(e){("rtl"==e.doc.direction?F:M)(e.display.lineDiv,"CodeMirror-rtl")}function ji(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Vi(e,t){var n={from:lt(t.from),to:Ni(t),text:qe(e,t.from,t.to)};return $i(e,n,t.from.line,t.to.line+1),zi(e,(function(e){return $i(e,n,t.from.line,t.to.line+1)}),!0),n}function Gi(e){for(;e.length&&Z(e).ranges;)e.pop()}function Ui(e,t,n,r){var i=e.history;i.undone.length=0;var o,l,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Gi(e.done),Z(e.done)):e.done.length&&!Z(e.done).ranges?Z(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Z(e.done)):void 0}(i,i.lastOp==r)))l=Z(o.changes),0==it(t.from,t.to)&&0==it(t.from,l.to)?l.to=Ni(t):o.changes.push(Vi(e,t));else{var a=Z(i.done);for(a&&a.ranges||_i(e.sel,i.done),o={changes:[Vi(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(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||ve(e,"historyAdded")}function Ki(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Z(i.done),t))?i.done[i.done.length-1]=t:_i(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Gi(i.undone)}function _i(e,t){var n=Z(t);n&&n.ranges&&n.equals(e)||t.push(e)}function $i(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Xi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Yi(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Xi(n[i]));return r}(e,t),r=Ot(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],c=0;c<o.length;++c)if(o[c].marker==a.marker)continue e;o.push(a)}else l&&(n[i]=l)}return n}function qi(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?Ti.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];r.push({changes:s});for(var a=0;a<l.length;++a){var c=l[a],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var f in c)(u=f.match(/^spans_(\d+)$/))&&G(t,Number(u[1]))>-1&&(Z(s)[f]=c[f],delete c[f])}}}return r}function Zi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=it(t,i)<0;o!=it(n,i)<0?(i=t,t=n):o!=it(t,n)<0&&(t=n)}return new Mi(i,t)}return new Mi(n||t,t)}function Qi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),ro(e,new Ti([Zi(e.sel.primary(),t,n,i)],0),r)}function Ji(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Zi(e.sel.ranges[o],t[o],null,i);ro(e,Ai(e.cm,r,e.sel.primIndex),n)}function eo(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,ro(e,Ai(e.cm,i,e.sel.primIndex),r)}function to(e,t,n,r){ro(e,Oi(t,n),r)}function no(e,t,n){var r=e.history.done,i=Z(r);i&&i.ranges?(r[r.length-1]=t,io(e,t,n)):ro(e,t,n)}function ro(e,t,n){io(e,t,n),Ki(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function io(e,t,n){(we(e,"beforeSelectionChange")||e.cm&&we(e.cm,"beforeSelectionChange"))&&(t=function(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Mi(ut(e,t[n].anchor),ut(e,t[n].head))},origin:n&&n.origin};return ve(e,"beforeSelectionChange",e,r),e.cm&&ve(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ai(e.cm,r.ranges,r.ranges.length-1):t}(e,t,n));var r=n&&n.bias||(it(t.primary().head,e.sel.primary().head)<0?-1:1);oo(e,so(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||Fr(e.cm)}function oo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,be(e.cm)),fn(e,"cursorActivity",e))}function lo(e){oo(e,so(e,e.sel,null,!1))}function so(e,t,n,r){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=co(e,l.anchor,s&&s.anchor,n,r),c=l.head==l.anchor?a:co(e,l.head,s&&s.head,n,r);(i||a!=l.anchor||c!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Mi(a,c))}return i?Ai(e.cm,i,t.primIndex):t}function ao(e,t,n,r,i){var o=Ye(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker,c="selectLeft"in a?!a.selectLeft:a.inclusiveLeft,u="selectRight"in a?!a.selectRight:a.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(ve(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!a.atomic)continue;if(n){var f=a.find(r<0?1:-1),h=void 0;if((r<0?u:c)&&(f=uo(e,f,-r,f&&f.line==t.line?o:null)),f&&f.line==t.line&&(h=it(f,n))&&(r<0?h<0:h>0))return ao(e,f,t,r,i)}var d=a.find(r<0?-1:1);return(r<0?c:u)&&(d=uo(e,d,r,d.line==t.line?o:null)),d?ao(e,d,t,r,i):null}}return t}function co(e,t,n,r,i){var o=r||1,l=ao(e,t,n,o,i)||!i&&ao(e,t,n,o,!0)||ao(e,t,n,-o,i)||!i&&ao(e,t,n,-o,!0);return l||(e.cantEdit=!0,rt(e.first,0))}function uo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ut(e,rt(t.line-1)):null:n>0&&t.ch==(r||Ye(e,t.line)).text.length?t.line<e.first+e.size-1?rt(t.line+1,0):null:new rt(t.line,t.ch+n)}function fo(e){e.setSelection(rt(e.firstLine(),0),rt(e.lastLine()),K)}function ho(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=ut(e,t)),n&&(r.to=ut(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),ve(e,"beforeChange",e,r),e.cm&&ve(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function po(e,t,n){if(e.cm){if(!e.cm.curOp)return ri(e.cm,po)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"))||(t=ho(e,t,!0))){var r=St&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=G(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],s=l.find(0),a=0;a<i.length;++a){var c=i[a];if(!(it(c.to,s.from)<0||it(c.from,s.to)>0)){var u=[a,1],f=it(c.from,s.from),h=it(c.to,s.to);(f<0||!l.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(h>0||!l.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),a+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)go(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else go(e,t)}}function go(e,t){if(1!=t.text.length||""!=t.text[0]||0!=it(t.from,t.to)){var n=Hi(e,t);Ui(e,t,n,e.cm?e.cm.curOp.id:NaN),yo(e,t,n,Ot(e,t));var r=[];zi(e,(function(e,n){n||-1!=G(r,e.history)||(Co(e.history,t),r.push(e.history)),yo(e,t,null,Ot(e,t))}))}}function mo(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,l=e.sel,s="undo"==t?o.done:o.undone,a="undo"==t?o.undone:o.done,c=0;c<s.length&&(i=s[c],n?!i.ranges||i.equals(e.sel):i.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=s.pop()).ranges){if(r)return void s.push(i);break}if(_i(i,a),n&&!i.equals(e.sel))return void ro(e,i,{clearRedo:!1});l=i}var u=[];_i(l,a),a.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=we(e,"beforeChange")||e.cm&&we(e.cm,"beforeChange"),h=function(n){var r=i.changes[n];if(r.origin=t,f&&!ho(e,r,!1))return s.length=0,{};u.push(Vi(e,r));var o=n?Hi(e,r):Z(s);yo(e,r,o,Yi(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:Ni(r)});var l=[];zi(e,(function(e,t){t||-1!=G(l,e.history)||(Co(e.history,r),l.push(e.history)),yo(e,r,null,Yi(e,r))}))},d=i.changes.length-1;d>=0;--d){var p=h(d);if(p)return p.v}}}}function vo(e,t){if(0!=t&&(e.first+=t,e.sel=new Ti(Q(e.sel.ranges,(function(e){return new Mi(rt(e.anchor.line+t,e.anchor.ch),rt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){pr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)gr(e.cm,r,"gutter")}}function yo(e,t,n,r){if(e.cm&&!e.cm.curOp)return ri(e.cm,yo)(e,t,n,r);if(t.to.line<e.first)vo(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);vo(e,i),t={from:rt(e.first,0),to:rt(t.to.line+i,t.to.ch),text:[Z(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:rt(o,Ye(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qe(e,t.from,t.to),n||(n=Hi(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,l=t.to,s=!1,a=o.line;e.options.lineWrapping||(a=Je(jt(Ye(r,o.line))),r.iter(a,l.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&be(e),Ii(r,t,n,ur(e)),e.options.lineWrapping||(r.iter(a,o.line+t.text.length,(function(e){var t=$t(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=Ye(e,r).stateAfter;if(i&&(!(i instanceof ht)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}(r,o.line),li(e,400);var c=t.text.length-(l.line-o.line)-1;t.full?pr(e):o.line!=l.line||1!=t.text.length||Ei(e.doc,t)?pr(e,o.line,l.line+1,c):gr(e,o.line,"text");var u=we(e,"changes"),f=we(e,"change");if(f||u){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&fn(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}(e.cm,t,r):Ii(e,t,r),io(e,n,K),e.cantEdit&&co(e,rt(e.firstLine(),0))&&(e.cantEdit=!1)}}function bo(e,t,n,r,i){var o;r||(r=n),it(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),po(e,{from:n,to:r,text:t,origin:i})}function wo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function xo(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)wo(o.ranges[s].anchor,t,n,r),wo(o.ranges[s].head,t,n,r)}else{for(var a=0;a<o.changes.length;++a){var c=o.changes[a];if(n<c.from.line)c.from=rt(c.from.line+r,c.from.ch),c.to=rt(c.to.line+r,c.to.ch);else if(t<=c.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function Co(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;xo(e.done,n,r,i),xo(e.undone,n,r,i)}function ko(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Ye(e,ct(e,t)):i=Je(t),null==i?null:(r(o,i)&&e.cm&&gr(e.cm,i,n),o)}function So(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function Lo(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Mi.prototype.from=function(){return at(this.anchor,this.head)},Mi.prototype.to=function(){return st(this.anchor,this.head)},Mi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},So.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,qt(i),fn(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},Lo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),l=r.height;if(r.removeInner(e,o),this.height-=l-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof So))){var s=[];this.collapse(s),this.children=[new So(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,s=l;s<i.lines.length;){var a=new So(i.lines.slice(s,s+=25));i.height-=a.height,this.children.splice(++r,0,a),a.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new Lo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=G(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var r=new Lo(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var To=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function Mo(e,t,n){_t(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Wr(e,n)}To.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Je(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Sn(this);Qe(n,Math.max(0,n.height-o)),e&&(ni(e,(function(){Mo(e,n,-o),gr(e,r,"widget")})),fn(e,"lineWidgetCleared",e,this,r))}},To.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Sn(this)-t;i&&(Ut(this.doc,r)||Qe(r,r.height+i),n&&ni(n,(function(){n.curOp.forceUpdate=!0,Mo(n,r,i),fn(n,"lineWidgetChanged",n,e,Je(r))})))},xe(To);var Ao=0,Oo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ao};function No(e,t,n,r,i){if(r&&r.shared)return function(e,t,n,r,i){(r=B(r)).shared=!1;var o=[No(e,t,n,r,i)],l=o[0],s=r.widgetNode;return zi(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(No(e,ut(e,t),ut(e,n),r,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;l=Z(o)})),new Do(o,l)}(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ri(e.cm,No)(e,t,n,r,i);var o=new Oo(e,i),l=it(t,n);if(r&&B(r,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Bt(e,t.line,t,n,o)||t.line!=n.line&&Bt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lt=!0}o.addToHistory&&Ui(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,a=t.line,c=e.cm;if(e.iter(a,n.line+1,(function(r){c&&o.collapsed&&!c.options.lineWrapping&&jt(r)==c.display.maxLine&&(s=!0),o.collapsed&&a!=t.line&&Qe(r,0),function(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}(r,new Tt(o,a==t.line?t.ch:null,a==n.line?n.ch:null),e.cm&&e.cm.curOp),++a})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ut(e,t)&&Qe(t,0)})),o.clearOnEnter&&pe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(St=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ao,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)pr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)gr(c,u,"text");o.atomic&&lo(c.doc),fn(c,"markerAdded",c,o)}return o}Oo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Yr(e),we(this,"clear")){var n=this.find();n&&fn(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=Mt(l.markedSpans,this);e&&!this.collapsed?gr(e,Je(l),"text"):e&&(null!=s.to&&(i=Je(l)),null!=s.from&&(r=Je(l))),l.markedSpans=At(l.markedSpans,s),null==s.from&&this.collapsed&&!Ut(this.doc,l)&&e&&Qe(l,lr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var a=0;a<this.lines.length;++a){var c=jt(this.lines[a]),u=$t(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&pr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&lo(e.doc)),e&&fn(e,"markerCleared",e,this,r,i),t&&qr(e),this.parent&&this.parent.clear()}},Oo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Mt(o.markedSpans,this);if(null!=l.from&&(n=rt(t?o:Je(o),l.from),-1==e))return n;if(null!=l.to&&(r=rt(t?o:Je(o),l.to),1==e))return r}return n&&{from:n,to:r}},Oo.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&ni(r,(function(){var i=t.line,o=Je(t.line),l=Fn(r,o);if(l&&(jn(l),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ut(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var a=Sn(n)-s;a&&Qe(i,i.height+a)}fn(r,"markerChanged",r,e)}))},Oo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=G(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Oo.prototype.detachLine=function(e){if(this.lines.splice(G(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},xe(Oo);var Do=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ho(e){return e.findMarks(rt(e.first,0),e.clipPos(rt(e.lastLine())),(function(e){return e.parent}))}function Wo(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];zi(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==G(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}Do.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();fn(this,"clear")}},Do.prototype.find=function(e,t){return this.primary.find(e,t)},xe(Do);var Fo=0,Po=function(e,t,n,r,i){if(!(this instanceof Po))return new Po(e,t,n,r,i);null==n&&(n=0),Lo.call(this,[new So([new Yt("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=rt(n,0);this.sel=Oi(o),this.history=new ji(null),this.id=++Fo,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Ii(this,{from:o,to:o,text:e}),ro(this,Oi(o),K)};Po.prototype=ee(Lo.prototype,{constructor:Po,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Ze(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:oi((function(e){var t=rt(this.first,0),n=this.first+this.size-1;po(this,{from:t,to:rt(n,Ye(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Pr(this.cm,0,0),ro(this,Oi(t),K)})),replaceRange:function(e,t,n,r){bo(this,e,t=ut(this,t),n=n?ut(this,n):t,r)},getRange:function(e,t,n){var r=qe(this,ut(this,e),ut(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(tt(this,e))return Ye(this,e)},getLineNumber:function(e){return Je(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ye(this,e)),jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ut(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:oi((function(e,t,n){to(this,ut(this,"number"==typeof e?rt(e,t||0):e),null,n)})),setSelection:oi((function(e,t,n){to(this,ut(this,e),ut(this,t||e),n)})),extendSelection:oi((function(e,t,n){Qi(this,ut(this,e),t&&ut(this,t),n)})),extendSelections:oi((function(e,t){Ji(this,ft(this,e),t)})),extendSelectionsBy:oi((function(e,t){Ji(this,ft(this,Q(this.sel.ranges,e)),t)})),setSelections:oi((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Mi(ut(this,e[i].anchor),ut(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ro(this,Ai(this.cm,r,t),n)}})),addSelection:oi((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Mi(ut(this,e),ut(this,t||e))),ro(this,Ai(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=qe(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=qe(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:oi((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&function(e,t,n){for(var r=[],i=rt(e.first,0),o=i,l=0;l<t.length;l++){var s=t[l],a=Wi(s.from,i,o),c=Wi(Ni(s),i,o);if(i=s.to,o=c,"around"==n){var u=e.sel.ranges[l],f=it(u.head,u.anchor)<0;r[l]=new Mi(f?c:a,f?a:c)}else r[l]=new Mi(a,a)}return new Ti(r,e.sel.primIndex)}(this,r,t),a=r.length-1;a>=0;a--)po(this,r[a]);s?no(this,s):this.cm&&Fr(this.cm)})),undo:oi((function(){mo(this,"undo")})),redo:oi((function(){mo(this,"redo")})),undoSelection:oi((function(){mo(this,"undo",!0)})),redoSelection:oi((function(){mo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ji(this.history),zi(this,(function(t){return t.history=e.history}),!0)},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:qi(this.history.done),undone:qi(this.history.undone)}},setHistory:function(e){var t=this.history=new ji(this.history);t.done=qi(e.done.slice(0),null,!0),t.undone=qi(e.undone.slice(0),null,!0)},setGutterMarker:oi((function(e,t,n){return ko(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&ie(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:oi((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&ko(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,ie(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!tt(this,e))return null;if(t=e,!(e=Ye(this,e)))return null}else if(null==(t=Je(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:oi((function(e,t,n){return ko(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(L(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:oi((function(e,t,n){return ko(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(L(n));if(!o)return!1;var l=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0}))})),addLineWidget:oi((function(e,t,n){return function(e,t,n,r){var i=new To(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),ko(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Ut(e,t)){var r=_t(t)<e.scrollTop;Qe(t,t.height+Sn(i)),r&&Wr(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&fn(o,"lineWidgetAdded",o,i,"number"==typeof t?t:Je(t)),i}(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return No(this,ut(this,e),ut(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return No(this,e=ut(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Ye(this,(e=ut(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(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,n){e=ut(this,e),t=ut(this,t);var r=[],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||n&&!n(a.marker)||r.push(a.marker.parent||a.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),ut(this,rt(n,t))},indexFromPos:function(e){var t=(e=ut(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Po(Ze(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,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Po(Ze(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(it(o,l)){var s=No(e,o,l,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}(r,Ho(this)),r},unlinkDoc:function(e){if(e instanceof Dl&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Wo(Ho(this));break}if(e.history==this.history){var n=[e.id];zi(e,(function(e){return n.push(e.id)}),!0),e.history=new ji(null),e.history.done=qi(this.history.done,n),e.history.undone=qi(this.history.undone,n)}},iterLinkedDocs:function(e){zi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Fe(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:oi((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&ni(t=this.cm,(function(){Bi(t),pr(t)})))}))}),Po.prototype.eachLine=Po.prototype.iter;var Eo=0;function Io(e){var t=this;if(zo(t),!ye(t,e)&&!Ln(t.display,e)){Ce(e),l&&(Eo=+new Date);var n=hr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,a=function(){++s==i&&ri(t,(function(){var e={from:n=ut(t.doc,n),to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};po(t.doc,e),no(t.doc,Oi(ut(t.doc,n),ut(t.doc,Ni(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==G(t.options.allowDropFileTypes,e.type))a();else{var r=new FileReader;r.onerror=function(){return a()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),a()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var f=e.dataTransfer.getData("Text");if(f){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),io(t.doc,Oi(n,n)),h)for(var d=0;d<h.length;++d)bo(t.doc,"",h[d].anchor,h[d].head,"drag");t.replaceSelection(f,"around","paste"),t.display.input.focus()}}catch(e){}}}}function zo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ro(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Bo=!1;function jo(){var e;Bo||(pe(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ro(Vo)}),100))})),pe(window,"blur",(function(){return Ro(Ar)})),Bo=!0)}function Vo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Go={3:"Pause",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:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Uo=0;Uo<10;Uo++)Go[Uo+48]=Go[Uo+96]=String(Uo);for(var Ko=65;Ko<=90;Ko++)Go[Ko]=String.fromCharCode(Ko);for(var _o=1;_o<=12;_o++)Go[_o+111]=Go[_o+63235]="F"+_o;var $o={};function Xo(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Yo(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=Q(n.split(" "),Xo),o=0;o<i.length;o++){var l=void 0,s=void 0;o==i.length-1?(s=i.join(" "),l=r):(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[n]}for(var c in t)e[c]=t[c];return e}function qo(e,t,n,r){var i=(t=el(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return qo(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=qo(e,t.fallthrough[o],n,r);if(l)return l}}}function Zo(e){var t="string"==typeof e?e:Go[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Qo(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(k?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(k?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function Jo(e,t){if(h&&34==e.keyCode&&e.char)return!1;var n=Go[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Qo(n,e,t))}function el(e){return"string"==typeof e?$o[e]:e}function tl(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&it(o.from,Z(r).to)<=0;){var l=r.pop();if(it(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}ni(e,(function(){for(var t=r.length-1;t>=0;t--)bo(e.doc,"",r[t].from,r[t].to,"+delete");Fr(e)}))}function nl(e,t,n){var r=se(e.text,t+n,n);return r<0||r>e.text.length?null:r}function rl(e,t,n){var r=nl(e,t.ch,n);return null==r?null:new rt(t.line,r,n<0?"after":"before")}function il(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=he(n,t.doc.direction);if(o){var l,s=i<0?Z(o):o[0],a=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=Pn(t,n);l=i<0?n.text.length-1:0;var u=En(t,c,l).top;l=ae((function(e){return En(t,c,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,l),"before"==a&&(l=nl(n,l,1))}else l=i<0?s.to:s.from;return new rt(r,l,a)}}return new rt(r,i<0?n.text.length:0,i<0?"before":"after")}$o.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"},$o.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"},$o.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},$o.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"]},$o.default=b?$o.macDefault:$o.pcDefault;var ol={selectAll:fo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),K)},killLine:function(e){return tl(e,(function(t){if(t.empty()){var n=Ye(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:rt(t.head.line+1,0)}:{from:t.head,to:rt(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return tl(e,(function(t){return{from:rt(t.from().line,0),to:ut(e.doc,rt(t.to().line+1,0))}}))},delLineLeft:function(e){return tl(e,(function(e){return{from:rt(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return tl(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return tl(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},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(rt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(rt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ll(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return sl(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var n=Ye(e.doc,t),r=function(e){for(var t;t=zt(e);)e=t.find(1,!0).line;return e}(n);return r!=n&&(t=Je(r)),il(!0,e,n,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),$)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),$)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?sl(e,t.head):r}),$)},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,"codepoint")},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=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),l=j(e.getLine(o.line),o.ch,r);t.push(q(r-l%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ni(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=Ye(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new rt(i.line,i.ch-1)),i.ch>0)i=new rt(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),rt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Ye(e.doc,i.line-1).text;l&&(i=new rt(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),rt(i.line-1,l.length-1),i,"+transpose"))}n.push(new Mi(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return ni(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Fr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ll(e,t){var n=Ye(e.doc,t),r=jt(n);return r!=n&&(t=Je(r)),il(!0,e,r,t,1)}function sl(e,t){var n=ll(e,t.line),r=Ye(e.doc,n.line),i=he(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),l=t.line==n.line&&t.ch<=o&&t.ch;return rt(n.line,l?0:o,n.sticky)}return n}function al(e,t,n){if("string"==typeof t&&!(t=ol[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=U}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}var cl=new V;function ul(e,t,n,r){var i=e.state.keySeq;if(i){if(Zo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:cl.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),fl(e,i+" "+t,n,r))return!0}return fl(e,t,n,r)}function fl(e,t,n,r){var i=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=qo(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&qo(t,e.options.extraKeys,n,e)||qo(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&fn(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(Ce(n),Sr(e)),!!i}function hl(e,t){var n=Jo(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ul(e,"Shift-"+n,t,(function(t){return al(e,t,!0)}))||ul(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return al(e,t)})):ul(e,n,t,(function(t){return al(e,t)})))}var dl=null;function pl(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=W(I(t)),ye(t,e)))){l&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=hl(t,e);h&&(dl=i?r:null,i||88!=r||Ee||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(M(t,"CodeMirror-crosshair"),me(document,"keyup",n),me(document,"mouseover",n))}F(t,"CodeMirror-crosshair"),pe(document,"keyup",n),pe(document,"mouseover",n)}(t)}}function gl(e){16==e.keyCode&&(this.doc.sel.shift=!1),ye(this,e)}function ml(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Ln(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(h&&n==dl)return dl=null,void Ce(e);if(!h||e.which&&!(e.which<10)||!hl(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(function(e,t,n){return ul(e,"'"+n+"'",t,(function(t){return al(e,t,!0)}))}(t,e,i)||t.display.input.onKeyPress(e))}}}var vl,yl,bl=function(e,t,n){this.time=e,this.pos=t,this.button=n};function wl(e){var t=this,n=t.display;if(!(ye(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,Ln(n,e))a||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!kl(t,e)){var r=hr(t,e),i=Me(e),o=r?function(e,t){var n=+new Date;return yl&&yl.compare(n,e,t)?(vl=yl=null,"triple"):vl&&vl.compare(n,e,t)?(yl=new bl(n,e,t),vl=null,"double"):(vl=new bl(n,e,t),yl=null,"single")}(r,i):"single";z(t).focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),ul(e,Qo(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,(function(t){if("string"==typeof t&&(t=ol[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=U}finally{e.state.suppressEdits=!1}return r}))}(t,i,r,o,e)||(1==i?r?function(e,t,n,r){l?setTimeout(R(Lr,e),0):e.curOp.focus=W(I(e));var i,o=function(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=w?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey)),i}(e,n,r),c=e.doc.sel;e.options.dragDrop&&Ne&&!e.isReadOnly()&&"single"==n&&(i=c.contains(t))>-1&&(it((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(it(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,c=ri(e,(function(t){a&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Tr(e)),me(i.wrapper.ownerDocument,"mouseup",c),me(i.wrapper.ownerDocument,"mousemove",u),me(i.scroller,"dragstart",f),me(i.scroller,"drop",c),o||(Ce(t),r.addNew||Qi(e.doc,n,null,null,r.extend),a&&!d||l&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};a&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,pe(i.wrapper.ownerDocument,"mouseup",c),pe(i.wrapper.ownerDocument,"mousemove",u),pe(i.scroller,"dragstart",f),pe(i.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(e,r,t,o):function(e,t,n,r){l&&Tr(e);var i=e.display,o=e.doc;Ce(t);var s,a,c=o.sel,u=c.ranges;if(r.addNew&&!r.extend?(a=o.sel.contains(n),s=a>-1?u[a]:new Mi(n,n)):(s=o.sel.primary(),a=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new Mi(n,n)),n=hr(e,t,!0,!0),a=-1;else{var f=xl(e,n,r.unit);s=r.extend?Zi(s,f.anchor,f.head,r.extend):f}r.addNew?-1==a?(a=u.length,ro(o,Ai(e,u.concat([s]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==r.unit&&!r.extend?(ro(o,Ai(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):eo(o,a,s,_):(a=0,ro(o,new Ti([s],0),_),c=o.sel);var h=n;function d(t){if(0!=it(h,t))if(h=t,"rectangle"==r.unit){for(var i=[],l=e.options.tabSize,u=j(Ye(o,n.line).text,n.ch,l),f=j(Ye(o,t.line).text,t.ch,l),d=Math.min(u,f),p=Math.max(u,f),g=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));g<=m;g++){var v=Ye(o,g).text,y=X(v,d,l);d==p?i.push(new Mi(rt(g,y),rt(g,y))):v.length>y&&i.push(new Mi(rt(g,y),rt(g,X(v,p,l))))}i.length||i.push(new Mi(n,n)),ro(o,Ai(e,c.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=xl(e,t,r.unit),C=w.anchor;it(x.anchor,C)>0?(b=x.head,C=at(w.from(),x.anchor)):(b=x.anchor,C=st(w.to(),x.head));var k=c.ranges.slice(0);k[a]=function(e,t){var n=t.anchor,r=t.head,i=Ye(e.doc,n.line);if(0==it(n,r)&&n.sticky==r.sticky)return t;var o=he(i);if(!o)return t;var l=ue(o,n.ch,n.sticky),s=o[l];if(s.from!=n.ch&&s.to!=n.ch)return t;var a,c=l+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)a=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ue(o,r.ch,r.sticky),f=u-l||(r.ch-n.ch)*(1==s.level?-1:1);a=u==c-1||u==c?f<0:f>0}var h=o[c+(a?-1:0)],d=a==(1==h.level),p=d?h.from:h.to,g=d?"after":"before";return n.ch==p&&n.sticky==g?t:new Mi(new rt(n.line,p,g),r)}(e,new Mi(ut(o,C),b)),ro(o,Ai(e,k,a),_)}}var p=i.wrapper.getBoundingClientRect(),g=0;function m(t){e.state.selectingText=!1,g=1/0,t&&(Ce(t),i.input.focus()),me(i.wrapper.ownerDocument,"mousemove",v),me(i.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var v=ri(e,(function(t){0!==t.buttons&&Me(t)?function t(n){var l=++g,s=hr(e,n,!0,"rectangle"==r.unit);if(s)if(0!=it(s,h)){e.curOp.focus=W(I(e)),d(s);var a=Dr(i,o);(s.line>=a.to||s.line<a.from)&&setTimeout(ri(e,(function(){g==l&&t(n)})),150)}else{var c=n.clientY<p.top?-20:n.clientY>p.bottom?20:0;c&&setTimeout(ri(e,(function(){g==l&&(i.scroller.scrollTop+=c,t(n))})),50)}}(t):m(t)})),y=ri(e,m);e.state.selectingText=y,pe(i.wrapper.ownerDocument,"mousemove",v),pe(i.wrapper.ownerDocument,"mouseup",y)}(e,r,t,o)}(t,r,o,e):Te(e)==n.scroller&&Ce(e):2==i?(r&&Qi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(S?t.display.input.onContextMenu(e):Tr(t)))}}function xl(e,t,n){if("char"==n)return new Mi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Mi(rt(t.line,0),ut(e.doc,rt(t.line+1,0)));var r=n(e,t);return new Mi(r.from,r.to)}function Cl(e,t,n,r){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(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ce(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(o>s.bottom||!we(e,n))return Se(t);o-=s.top-l.viewOffset;for(var a=0;a<e.display.gutterSpecs.length;++a){var c=l.gutters.childNodes[a];if(c&&c.getBoundingClientRect().right>=i)return ve(e,n,e,et(e.doc,o),e.display.gutterSpecs[a].className,t),Se(t)}}function kl(e,t){return Cl(e,t,"gutterClick",!0)}function Sl(e,t){Ln(e.display,t)||function(e,t){return!!we(e,"gutterContextMenu")&&Cl(e,t,"gutterContextMenu",!1)}(e,t)||ye(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function Ll(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gn(e)}bl.prototype.compare=function(e,t,n){return this.time+400>e&&0==it(t,this.pos)&&n==this.button};var Tl={toString:function(){return"CodeMirror.Init"}},Ml={},Al={};function Ol(e,t,n){if(!t!=!(n&&n!=Tl)){var r=e.display.dragFunctions,i=t?pe:me;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Nl(e){e.options.lineWrapping?(F(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(M(e.display.wrapper,"CodeMirror-wrap"),Xt(e)),fr(e),pr(e),Gn(e),setTimeout((function(){return Ur(e)}),100)}function Dl(e,t){var n=this;if(!(this instanceof Dl))return new Dl(e,t);this.options=t=t?B(t):{},B(Ml,t,!1);var r=t.value;"string"==typeof r?r=new Po(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Dl.inputStyles[t.inputStyle](this),o=this.display=new wi(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,Ll(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$r(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 V,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),l&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;pe(t.scroller,"mousedown",ri(e,wl)),pe(t.scroller,"dblclick",l&&s<11?ri(e,(function(t){if(!ye(e,t)){var n=hr(e,t);if(n&&!kl(e,t)&&!Ln(e.display,t)){Ce(t);var r=e.findWordAt(n);Qi(e.doc,r.anchor,r.head)}}})):function(t){return ye(e,t)||Ce(t)}),pe(t.scroller,"contextmenu",(function(t){return Sl(e,t)})),pe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Sl(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}pe(t.scroller,"touchstart",(function(i){if(!ye(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!kl(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!Ln(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var l,s=e.coordsChar(t.activeTouch,"page");l=!r.prev||o(r,r.prev)?new Mi(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new Mi(rt(s.line,0),ut(e.doc,rt(s.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Ce(n)}i()})),pe(t.scroller,"touchcancel",i),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(zr(e,t.scroller.scrollTop),Br(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return Li(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return Li(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ye(e,t)||Le(t)},over:function(t){ye(e,t)||(function(e,t){var n=hr(e,t);if(n){var r=document.createDocumentFragment();xr(e,n,r),e.display.dragCursor||(e.display.dragCursor=N("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,r)}}(e,t),Le(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Eo<100))Le(t);else if(!ye(e,t)&&!Ln(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=N("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),h&&n.parentNode.removeChild(n)}}(e,t)},drop:ri(e,Io),leave:function(t){ye(e,t)||zo(e)}};var a=t.input.getField();pe(a,"keyup",(function(t){return gl.call(e,t)})),pe(a,"keydown",ri(e,pl)),pe(a,"keypress",ri(e,ml)),pe(a,"focus",(function(t){return Mr(e,t)})),pe(a,"blur",(function(t){return Ar(e,t)}))}(this),jo(),Yr(this),this.curOp.forceUpdate=!0,Ri(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Mr(n)}),20):Ar(this),Al)Al.hasOwnProperty(c)&&Al[c](this,t[c],Tl);mi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Hl.length;++u)Hl[u](this);qr(this),a&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Dl.defaults=Ml,Dl.optionHandlers=Al;var Hl=[];function Wl(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=mt(e,t).state:n="prev");var l=e.options.tabSize,s=Ye(o,t),a=j(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==U||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?j(Ye(o,t-1).text,null,l):0:"add"==n?c=a+e.options.indentUnit:"subtract"==n?c=a-e.options.indentUnit:"number"==typeof n&&(c=a+n),c=Math.max(0,c);var f="",h=0;if(e.options.indentWithTabs)for(var d=Math.floor(c/l);d;--d)h+=l,f+="\t";if(h<c&&(f+=q(c-h)),f!=u)return bo(o,f,rt(t,0),rt(t,u.length),"+input"),s.stateAfter=null,!0;for(var p=0;p<o.sel.ranges.length;p++){var g=o.sel.ranges[p];if(g.head.line==t&&g.head.ch<u.length){var m=rt(t,u.length);eo(o,p,new Mi(m,m));break}}}Dl.defineInitHook=function(e){return Hl.push(e)};var Fl=null;function Pl(e){Fl=e}function El(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var l=+new Date-200,s="paste"==i||e.state.pasteIncoming>l,a=Fe(t),c=null;if(s&&r.ranges.length>1)if(Fl&&Fl.text.join("\n")==t){if(r.ranges.length%Fl.text.length==0){c=[];for(var u=0;u<Fl.text.length;u++)c.push(o.splitLines(Fl.text[u]))}}else a.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=Q(a,(function(e){return[e]})));for(var f=e.curOp.updateInput,h=r.ranges.length-1;h>=0;h--){var d=r.ranges[h],p=d.from(),g=d.to();d.empty()&&(n&&n>0?p=rt(p.line,p.ch-n):e.state.overwrite&&!s?g=rt(g.line,Math.min(Ye(o,g.line).text.length,g.ch+Z(a).length)):s&&Fl&&Fl.lineWise&&Fl.text.join("\n")==a.join("\n")&&(p=g=rt(p.line,0)));var m={from:p,to:g,text:c?c[h%c.length]:a,origin:i||(s?"paste":e.state.cutIncoming>l?"cut":"+input")};po(e.doc,m),fn(e,"inputRead",e,m)}t&&!s&&zl(e,t),Fr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=f),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Il(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||ni(t,(function(){return El(t,n,0,null,"paste")})),!0}function zl(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-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=Wl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Ye(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Wl(e,i.head.line,"smart"));l&&fn(e,"electricInput",e,i.head.line)}}}function Rl(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:rt(i,0),head:rt(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Bl(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function jl(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return a?e.style.width="1000px":e.setAttribute("wrap","off"),m&&(e.style.border="1px solid black"),t}function Vl(e,t,n,r,i){var o=t,l=n,s=Ye(e,t.line),a=i&&"rtl"==e.direction?-n:n;function c(o){var l,c;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))l=null;else{var f=n>0?u>=55296&&u<56320:u>=56320&&u<57343;l=new rt(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(f?2:1))),-n)}}else l=i?function(e,t,n,r){var i=he(t,e.doc.direction);if(!i)return rl(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ue(i,n.ch,n.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(r>0?l.to>n.ch:l.from<n.ch))return rl(t,n,r);var s,a=function(e,n){return nl(t,e instanceof rt?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||Pn(e,t),tr(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?a(n,-1):n.ch);if("rtl"==e.doc.direction||1==l.level){var f=1==l.level==r<0,h=a(n,f?1:-1);if(null!=h&&(f?h<=l.to&&h<=u.end:h>=l.from&&h>=u.begin)){var d=f?"before":"after";return new rt(n.line,h,d)}}var p=function(e,t,r){for(var o=function(e,t){return t?new rt(n.line,a(e,1),"before"):new rt(n.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],s=t>0==(1!=l.level),c=s?r.begin:a(r.end,-1);if(l.from<=c&&c<l.to)return o(c,s);if(c=s?l.from:a(l.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},g=p(o+r,r,u);if(g)return g;var m=r>0?u.end:a(u.begin,-1);return null==m||r>0&&m==t.text.length||!(g=p(r>0?0:i.length-1,r,c(m)))?null:g}(e.cm,s,t,n):rl(s,t,n);if(null==l){if(o||(c=t.line+a)<e.first||c>=e.first+e.size||(t=new rt(c,t.ch,t.sticky),!(s=Ye(e,c))))return!1;t=il(i,e.cm,s,t.line,a)}else t=l;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,f="group"==r,h=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||c(!d);d=!1){var p=s.text.charAt(t.ch)||"\n",g=re(p,h)?"w":f&&"\n"==p?"n":!f||/\s/.test(p)?null:"p";if(!f||d||g||(g="s"),u&&u!=g){n<0&&(n=1,c(),t.sticky="after");break}if(g&&(u=g),n>0&&!c(!d))break}var m=co(e,t,o,l,!0);return ot(o,m)&&(m.hitSide=!0),m}function Gl(e,t,n,r){var i,o,l=e.doc,s=t.left;if("page"==r){var a=Math.min(e.display.wrapper.clientHeight,z(e).innerHeight||l(e).documentElement.clientHeight),c=Math.max(a-.5*lr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Jn(e,s,i)).outside;){if(n<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*n}return o}var Ul=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Kl(e,t){var n=Fn(e,t.line);if(!n||n.hidden)return null;var r=Ye(e.doc,t.line),i=Hn(n,r,t.line),o=he(r,e.doc.direction),l="left";o&&(l=ue(o,t.ch)%2?"right":"left");var s=Rn(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function _l(e,t){return t&&(e.bad=!0),e}function $l(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return _l(e.clipPos(rt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Xl(o,t,n)}}function Xl(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!H(r,t))return _l(rt(Je(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?Z(e.rest):e.line;return _l(rt(Je(o),o.text.length),i)}var l=3==t.nodeType?t:null,s=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,n&&(n=l.nodeValue.length));s.parentNode!=r;)s=s.parentNode;var a=e.measure,c=a.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?a.map:c[i],l=0;l<o.length;l+=3){var s=o[l+2];if(s==t||s==n){var u=Je(i<0?e.line:e.rest[i]),f=o[l]+r;return(r<0||s!=t)&&(f=o[l+(r?1:0)]),rt(u,f)}}}var f=u(l,s,n);if(f)return _l(f,i);for(var h=s.nextSibling,d=l?l.nodeValue.length-n:0;h;h=h.nextSibling){if(f=u(h,h.firstChild,0))return _l(rt(f.line,f.ch-d),i);d+=h.textContent.length}for(var p=s.previousSibling,g=n;p;p=p.previousSibling){if(f=u(p,p.firstChild,-1))return _l(rt(f.line,f.ch+g),i);g+=p.textContent.length}}Ul.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function l(e){if(o(e)&&!ye(r,e)){if(r.somethingSelected())Pl({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Rl(r);Pl({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,K),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var l=Fl.text.join("\n");if(e.clipboardData.setData("Text",l),e.clipboardData.getData("Text")==l)return void e.preventDefault()}var s=jl(),a=s.firstChild;Bl(a),r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),a.value=Fl.text.join("\n");var c=W(i.ownerDocument);E(a),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==i&&n.showPrimarySelection()}),50)}}i.contentEditable=!0,Bl(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),pe(i,"paste",(function(e){!o(e)||ye(r,e)||Il(e,r)||s<=11&&setTimeout(ri(r,(function(){return t.updateFromDOM()})),20)})),pe(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),pe(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),pe(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),pe(i,"touchstart",(function(){return n.forceCompositionEnd()})),pe(i,"input",(function(){t.composing||t.readFromDOMSoon()})),pe(i,"copy",l),pe(i,"cut",l)},Ul.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ul.prototype.prepareSelection=function(){var e=wr(this.cm,!1);return e.focus=W(this.div.ownerDocument)==this.div,e},Ul.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ul.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ul.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=$l(t,e.anchorNode,e.anchorOffset),s=$l(t,e.focusNode,e.focusOffset);if(!l||l.bad||!s||s.bad||0!=it(at(l,s),i)||0!=it(st(l,s),o)){var a=t.display.view,c=i.line>=t.display.viewFrom&&Kl(t,i)||{node:a[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&Kl(t,o);if(!u){var f=a[a.length-1].measure,h=f.maps?f.maps[f.maps.length-1]:f.map;u={node:h[h.length-1],offset:h[h.length-2]-h[h.length-3]}}if(c&&u){var d,p=e.rangeCount&&e.getRangeAt(0);try{d=T(c.node,c.offset,u.offset,u.node)}catch(e){}d&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),d.collapsed||(e.removeAllRanges(),e.addRange(d))):(e.removeAllRanges(),e.addRange(d)),p&&null==e.anchorNode?e.addRange(p):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Ul.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)},Ul.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Ul.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ul.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return H(this.div,t)},Ul.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&W(this.div.ownerDocument)==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ul.prototype.blur=function(){this.div.blur()},Ul.prototype.getField=function(){return this.div},Ul.prototype.supportsTouch=function(){return!0},Ul.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):ni(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}))},Ul.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ul.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=$l(t,e.anchorNode,e.anchorOffset),r=$l(t,e.focusNode,e.focusOffset);n&&r&&ni(t,(function(){ro(t.doc,Oi(n,r),K),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},Ul.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),l=o.from(),s=o.to();if(0==l.ch&&l.line>r.firstLine()&&(l=rt(l.line-1,Ye(r.doc,l.line-1).length)),s.ch==Ye(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=rt(s.line+1,0)),l.line<i.viewFrom||s.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=dr(r,l.line))?(t=Je(i.view[0].line),n=i.view[0].node):(t=Je(i.view[e].line),n=i.view[e-1].node.nextSibling);var a,c,u=dr(r,s.line);if(u==i.view.length-1?(a=i.viewTo-1,c=i.lineDiv.lastChild):(a=Je(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var f=r.doc.splitLines(function(e,t,n,r,i){var o="",l=!1,s=e.doc.lineSeparator(),a=!1;function c(){l&&(o+=s,a&&(o+=s),l=a=!1)}function u(e){e&&(c(),o+=e)}function f(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,h=t.getAttribute("cm-marker");if(h){var d=e.findMarks(rt(r,0),rt(i+1,0),(m=+h,function(e){return e.id==m}));return void(d.length&&(o=d[0].find(0))&&u(qe(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&c();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(a=!0),p&&(l=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;f(t),t!=n;)t=t.nextSibling,a=!1;return o}(r,n,c,t,a)),h=qe(r.doc,rt(t,0),rt(a,Ye(r.doc,a).text.length));f.length>1&&h.length>1;)if(Z(f)==Z(h))f.pop(),h.pop(),a--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),t++}for(var d=0,p=0,g=f[0],m=h[0],v=Math.min(g.length,m.length);d<v&&g.charCodeAt(d)==m.charCodeAt(d);)++d;for(var y=Z(f),b=Z(h),w=Math.min(y.length-(1==f.length?d:0),b.length-(1==h.length?d:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==h.length&&t==l.line)for(;d&&d>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)d--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(d).replace(/\u200b+$/,"");var x=rt(t,d),C=rt(a,h.length?Z(h).length-p:0);return f.length>1||f[0]||it(x,C)?(bo(r.doc,f,x,C,"+input"),!0):void 0},Ul.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ul.prototype.reset=function(){this.forceCompositionEnd()},Ul.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ul.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))},Ul.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ni(this.cm,(function(){return pr(e.cm)}))},Ul.prototype.setUneditable=function(e){e.contentEditable="false"},Ul.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ri(this.cm,El)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ul.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ul.prototype.onContextMenu=function(){},Ul.prototype.resetPosition=function(){},Ul.prototype.needsContentAttribute=!0;var Yl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null,this.resetting=!1};Yl.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ye(r,e)){if(r.somethingSelected())Pl({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Rl(r);Pl({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,K):(n.prevInput="",i.value=t.text.join("\n"),E(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),pe(i,"input",(function(){l&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(i,"paste",(function(e){ye(r,e)||Il(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pe(i,"cut",o),pe(i,"copy",o),pe(e.scroller,"paste",(function(t){if(!Ln(e,t)&&!ye(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),pe(e.lineSpace,"selectstart",(function(t){Ln(e,t)||Ce(t)})),pe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},Yl.prototype.createField=function(e){this.wrapper=jl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Bl(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Yl.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Yl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=wr(e);if(e.options.moveInputWithCursor){var i=qn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return r},Yl.prototype.showSelection=function(e){var t=this.cm.display;O(t.cursorDiv,e.cursors),O(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Yl.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&E(this.textarea),l&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",l&&s>=9&&(this.hasSelection=null));this.resetting=!1}},Yl.prototype.getField=function(){return this.textarea},Yl.prototype.supportsTouch=function(){return!1},Yl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||W(this.textarea.ownerDocument)!=this.textarea))try{this.textarea.focus()}catch(e){}},Yl.prototype.blur=function(){this.textarea.blur()},Yl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Yl.prototype.receivedFocus=function(){this.slowPoll()},Yl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},Yl.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},Yl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Pe(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(l&&s>=9&&this.hasSelection===i||b&&/[\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||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var a=0,c=Math.min(r.length,i.length);a<c&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return ni(t,(function(){El(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.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},Yl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Yl.prototype.onKeyPress=function(){l&&s>=9&&(this.hasSelection=null),this.fastPoll()},Yl.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=hr(n,e),c=r.scroller.scrollTop;if(o&&!h){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ri(n,ro)(n.doc,Oi(o),K);var u,f=i.style.cssText,d=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(l?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",a&&(u=i.ownerDocument.defaultView.scrollY),r.input.focus(),a&&i.ownerDocument.defaultView.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),l&&s>=9&&m(),S){Le(e);var g=function(){me(window,"mouseup",g),setTimeout(v,20)};pe(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=f,l&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!l||l&&s<9)&&m();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ri(n,fo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},Yl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},Yl.prototype.setUneditable=function(){},Yl.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Tl&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Tl,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Fi(e)}),!0),n("indentUnit",2,Fi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Pi(e),Gn(e),pr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=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,n.push(rt(r,o))}r++}));for(var i=n.length-1;i>=0;i--)bo(e.doc,t,n[i],rt(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Tl&&e.refresh()})),n("specialCharPlaceholder",tn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ll(e),bi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=el(t),i=n!=Tl&&el(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Nl,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=vi(t,e.options.lineNumbers),bi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?cr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Ur(e)}),!0),n("scrollbarStyle","native",(function(e){$r(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=vi(e.options.gutters,t),bi(e)}),!0),n("firstLineNumber",1,bi,!0),n("lineNumberFormatter",(function(e){return e}),bi,!0),n("showCursorWhenSelecting",!1,br,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Ar(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ol),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,br,!0),n("singleCursorHeightPerLine",!0,br,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Pi,!0),n("addModeClass",!1,Pi,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Pi,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Dl),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){z(this).focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ri(this,t[e])(this,n,i),ve(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"](el(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:ii((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,pr(this)})),removeOverlay:ii((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void pr(this)}})),indentLine:ii((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),tt(this.doc,e)&&Wl(this,e,t,n)})),indentSelection:ii((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Wl(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Fr(this));else{var o=i.from(),l=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var a=s;a<n;++a)Wl(this,a,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&eo(this.doc,r,new Mi(o,c[r].to()),K)}}})),getTokenAt:function(e,t){return xt(this,e,t)},getLineTokens:function(e,t){return xt(this,rt(e),t,!0)},getTokenTypeAt:function(e){e=ut(this.doc,e);var t,n=gt(this,Ye(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]<o)){t=n[2*l+2];break}r=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 n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var s=i[o[t][l]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var a=0;a<i._global.length;a++){var c=i._global[a];c.pred(o,this)&&-1==G(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return mt(this,(e=ct(n,null==e?n.first+n.size-1:e))+1,t).state},cursorCoords:function(e,t){var n=this.doc.sel.primary();return qn(this,null==e?n.head:"object"==typeof e?ut(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Yn(this,ut(this.doc,e),t||"page")},coordsChar:function(e,t){return Jn(this,(e=Xn(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Xn(this,{top:e,left:0},t||"page").top,et(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,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),r=Ye(this.doc,e)}else r=e;return $n(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-_t(r):0)},defaultTextHeight:function(){return lr(this.display)},defaultCharWidth:function(){return sr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,l,s,a=this.display,c=(e=qn(this,ut(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var f=Math.max(a.wrapper.clientHeight,this.doc.height),h=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(c=e.bottom),u+t.offsetWidth>h&&(u=h-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,l={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=Hr(o,l)).scrollTop&&zr(o,s.scrollTop),null!=s.scrollLeft&&Br(o,s.scrollLeft))},triggerOnKeyDown:ii(pl),triggerOnKeyPress:ii(ml),triggerOnKeyUp:gl,triggerOnMouseDown:ii(wl),execCommand:function(e){if(ol.hasOwnProperty(e))return ol[e].call(null,this)},triggerElectric:ii((function(e){zl(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ut(this.doc,e),l=0;l<t&&!(o=Vl(this.doc,o,i,n,r)).hitSide;++l);return o},moveH:ii((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?Vl(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),$)})),deleteH:ii((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):tl(this,(function(n){var i=Vl(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var l=ut(this.doc,e),s=0;s<t;++s){var a=qn(this,l,"div");if(null==o?o=a.left:a.left=o,(l=Gl(this,a,i,n)).hitSide)break}return l},moveV:ii((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(l){if(o)return e<0?l.from():l.to();var s=qn(n,l.head,"div");null!=l.goalColumn&&(s.left=l.goalColumn),i.push(s.left);var a=Gl(n,s,e,t);return"page"==t&&l==r.sel.primary()&&Wr(n,Yn(n,a,"div").top-s.top),a}),$),i.length)for(var l=0;l<r.sel.ranges.length;l++)r.sel.ranges[l].goalColumn=i[l]})),findWordAt:function(e){var t=Ye(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!n?++r:--n;for(var o=t.charAt(n),l=re(o,i)?function(e){return re(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!re(e)};n>0&&l(t.charAt(n-1));)--n;for(;r<t.length&&l(t.charAt(r));)++r}return new Mi(rt(e.line,n),rt(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?F(this.display.cursorDiv,"CodeMirror-overwrite"):M(this.display.cursorDiv,"CodeMirror-overwrite"),ve(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==W(I(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:ii((function(e,t){Pr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-On(this)-this.display.barHeight,width:e.scrollWidth-On(this)-this.display.barWidth,clientHeight:Dn(this),clientWidth:Nn(this)}},scrollIntoView:ii((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:rt(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?function(e,t){Er(e),e.curOp.scrollToPos=t}(this,e):Ir(this,e.from,e.to,e.margin)})),setSize:ii((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Vn(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){gr(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,ve(this,"refresh",this)})),operation:function(e){return ni(this,e)},startOperation:function(){return Yr(this)},endOperation:function(){return qr(this)},refresh:ii((function(){var e=this.display.cachedTextHeight;pr(this),this.curOp.forceUpdate=!0,Gn(this),Pr(this,this.doc.scrollLeft,this.doc.scrollTop),di(this.display),(null==e||Math.abs(e-lr(this.display))>.5||this.options.lineWrapping)&&fr(this),ve(this,"refresh",this)})),swapDoc:ii((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Ri(this,e),Gn(this),this.display.input.reset(),Pr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,fn(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},xe(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Dl);var ql="iter insert remove copy getEditor constructor".split(" ");for(var Zl in Po.prototype)Po.prototype.hasOwnProperty(Zl)&&G(ql,Zl)<0&&(Dl.prototype[Zl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Po.prototype[Zl]));return xe(Po),Dl.inputStyles={textarea:Yl,contenteditable:Ul},Dl.defineMode=function(e){Dl.defaults.mode||"null"==e||(Dl.defaults.mode=e),Be.apply(this,arguments)},Dl.defineMIME=function(e,t){Re[e]=t},Dl.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Dl.defineMIME("text/plain","null"),Dl.defineExtension=function(e,t){Dl.prototype[e]=t},Dl.defineDocExtension=function(e,t){Po.prototype[e]=t},Dl.fromTextArea=function(e,t){if((t=t?B(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=W(e.ownerDocument);t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(me(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Dl((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=me,e.on=pe,e.wheelEventPixels=Si,e.Doc=Po,e.splitLines=Fe,e.countColumn=j,e.findColumn=X,e.isWordChar=ne,e.Pass=U,e.signal=ve,e.Line=Yt,e.changeEnd=Ni,e.scrollbarModel=_r,e.Pos=rt,e.cmpPos=it,e.modes=ze,e.mimeModes=Re,e.resolveMode=je,e.getMode=Ve,e.modeExtensions=Ge,e.extendMode=Ue,e.copyState=Ke,e.startState=$e,e.innerMode=_e,e.commands=ol,e.keyMap=$o,e.keyName=Jo,e.isModifierKey=Zo,e.lookupKey=qo,e.normalizeKeyMap=Yo,e.StringStream=Xe,e.SharedTextMarker=Do,e.TextMarker=Oo,e.LineWidget=To,e.e_preventDefault=Ce,e.e_stopPropagation=ke,e.e_stop=Le,e.addClass=F,e.contains=H,e.rmClass=M,e.keyNames=Go}(Dl),Dl.version="5.65.12",Dl}()},1064:function(e,t,n){!function(e){"use strict";function t(t,n,i,o){if(i&&i.call){var l=i;i=null}else l=r(t,i,"rangeFinder");"number"==typeof n&&(n=e.Pos(n,0));var s=r(t,i,"minFoldSize");function a(e){var r=l(t,n);if(!r||r.to.line-r.from.line<s)return null;if("fold"===o)return r;for(var i=t.findMarksAt(r.from),a=0;a<i.length;++a)if(i[a].__isFold){if(!e)return null;r.cleared=!0,i[a].clear()}return r}var c=a(!0);if(r(t,i,"scanUp"))for(;!c&&n.line>t.firstLine();)n=e.Pos(n.line-1,0),c=a(!1);if(c&&!c.cleared&&"unfold"!==o){var u=function(e,t,n){var i=r(e,t,"widget");if("function"==typeof i&&(i=i(n.from,n.to)),"string"==typeof i){var o=document.createTextNode(i);(i=document.createElement("span")).appendChild(o),i.className="CodeMirror-foldmarker"}else i&&(i=i.cloneNode(!0));return i}(t,i,c);e.on(u,"mousedown",(function(t){f.clear(),e.e_preventDefault(t)}));var f=t.markText(c.from,c.to,{replacedWith:u,clearOnEnter:r(t,i,"clearOnEnter"),__isFold:!0});f.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,c.from,c.to)}}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),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(),{scanUp:!1},"unfold")},e.commands.foldAll=function(t){t.operation((function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),{scanUp:!1},"fold")}))},e.commands.unfoldAll=function(t){t.operation((function(){for(var n=t.firstLine(),r=t.lastLine();n<=r;n++)t.foldCode(e.Pos(n,0),{scanUp:!1},"unfold")}))},e.registerHelper("fold","combine",(function(){var e=Array.prototype.slice.call(arguments,0);return function(t,n){for(var r=0;r<e.length;++r){var i=e[r](t,n);if(i)return i}}})),e.registerHelper("fold","auto",(function(e,t){for(var n=e.getHelpers(t,"fold"),r=0;r<n.length;r++){var i=n[r](e,t);if(i)return i}}));var n={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};function r(e,t,r){if(t&&void 0!==t[r])return t[r];var i=e.options.foldOptions;return i&&void 0!==i[r]?i[r]:n[r]}e.defineOption("foldOptions",null),e.defineExtension("foldOption",(function(e,t){return r(this,e,t)}))}(n(1004))},1158:function(e,t,n){!function(e){"use strict";function t(e,t){if(this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length,this.options.updateOnCursorActivity){var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}}e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",(function(n){n=function(e,t,n){var r=e.options.hintOptions,i={};for(var o in a)i[o]=a[o];if(r)for(var o in r)void 0!==r[o]&&(i[o]=r[o]);if(n)for(var o in n)void 0!==n[o]&&(i[o]=n[o]);return i.hint.resolve&&(i.hint=i.hint.resolve(e,t)),i}(this,this.getCursor("start"),n);var r=this.listSelections();if(!(r.length>1)){if(this.somethingSelected()){if(!n.hint.supportsSelection)return;for(var i=0;i<r.length;i++)if(r[i].head.line!=r[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var o=this.state.completionActive=new t(this,n);o.options.hint&&(e.signal(this,"startCompletion",this),o.update(!0))}})),e.defineExtension("closeHint",(function(){this.state.completionActive&&this.state.completionActive.close()}));var n=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},r=window.cancelAnimationFrame||clearTimeout;function i(e){return"string"==typeof e?e:e.text}function o(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function l(t,n){this.id="cm-complete-"+Math.floor(Math.random(1e6)),this.completion=t,this.data=n,this.picked=!1;var r=this,l=t.cm,s=l.getInputField().ownerDocument,a=s.defaultView||s.parentWindow,c=this.hints=s.createElement("ul");c.setAttribute("role","listbox"),c.setAttribute("aria-expanded","true"),c.id=this.id;var u=t.cm.options.theme;c.className="CodeMirror-hints "+u,this.selectedHint=n.selectedHint||0;for(var f=n.list,h=0;h<f.length;++h){var d=c.appendChild(s.createElement("li")),p=f[h],g="CodeMirror-hint"+(h!=this.selectedHint?"":" CodeMirror-hint-active");null!=p.className&&(g=p.className+" "+g),d.className=g,h==this.selectedHint&&d.setAttribute("aria-selected","true"),d.id=this.id+"-"+h,d.setAttribute("role","option"),p.render?p.render(d,n,p):d.appendChild(s.createTextNode(p.displayText||i(p))),d.hintId=h}var m=t.options.container||s.body,v=l.cursorCoords(t.options.alignWithWord?n.from:null),y=v.left,b=v.bottom,w=!0,x=0,C=0;if(m!==s.body){var k=-1!==["absolute","relative","fixed"].indexOf(a.getComputedStyle(m).position)?m:m.offsetParent,S=k.getBoundingClientRect(),L=s.body.getBoundingClientRect();x=S.left-L.left-k.scrollLeft,C=S.top-L.top-k.scrollTop}c.style.left=y-x+"px",c.style.top=b-C+"px";var T=a.innerWidth||Math.max(s.body.offsetWidth,s.documentElement.offsetWidth),M=a.innerHeight||Math.max(s.body.offsetHeight,s.documentElement.offsetHeight);m.appendChild(c),l.getInputField().setAttribute("aria-autocomplete","list"),l.getInputField().setAttribute("aria-owns",this.id),l.getInputField().setAttribute("aria-activedescendant",this.id+"-"+this.selectedHint);var A,O=t.options.moveOnOverlap?c.getBoundingClientRect():new DOMRect,N=!!t.options.paddingForScrollbar&&c.scrollHeight>c.clientHeight+1;if(setTimeout((function(){A=l.getScrollInfo()})),O.bottom-M>0){var D=O.bottom-O.top,H=O.top-(v.bottom-v.top)-2;M-O.top<H?(D>H&&(c.style.height=(D=H)+"px"),c.style.top=(b=v.top-D)+C+"px",w=!1):c.style.height=M-O.top-2+"px"}var W,F=O.right-T;if(N&&(F+=l.display.nativeBarWidth),F>0&&(O.right-O.left>T&&(c.style.width=T-5+"px",F-=O.right-O.left-T),c.style.left=(y=Math.max(v.left-F-x,0))+"px"),N)for(var P=c.firstChild;P;P=P.nextSibling)P.style.paddingRight=l.display.nativeBarWidth+"px";l.addKeyMap(this.keyMap=function(e,t){var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(n["Ctrl-P"]=function(){t.moveFocus(-1)},n["Ctrl-N"]=function(){t.moveFocus(1)});var r=e.options.customKeys,i=r?{}:n;function o(e,r){var o;o="string"!=typeof r?function(e){return r(e,t)}:n.hasOwnProperty(r)?n[r]:r,i[e]=o}if(r)for(var l in r)r.hasOwnProperty(l)&&o(l,r[l]);var s=e.options.extraKeys;if(s)for(var l in s)s.hasOwnProperty(l)&&o(l,s[l]);return i}(t,{moveFocus:function(e,t){r.changeActive(r.selectedHint+e,t)},setFocus:function(e){r.changeActive(e)},menuSize:function(){return r.screenAmount()},length:f.length,close:function(){t.close()},pick:function(){r.pick()},data:n})),t.options.closeOnUnfocus&&(l.on("blur",this.onBlur=function(){W=setTimeout((function(){t.close()}),100)}),l.on("focus",this.onFocus=function(){clearTimeout(W)})),l.on("scroll",this.onScroll=function(){var e=l.getScrollInfo(),n=l.getWrapperElement().getBoundingClientRect();A||(A=l.getScrollInfo());var r=b+A.top-e.top,i=r-(a.pageYOffset||(s.documentElement||s.body).scrollTop);if(w||(i+=c.offsetHeight),i<=n.top||i>=n.bottom)return t.close();c.style.top=r+"px",c.style.left=y+A.left-e.left+"px"}),e.on(c,"dblclick",(function(e){var t=o(c,e.target||e.srcElement);t&&null!=t.hintId&&(r.changeActive(t.hintId),r.pick())})),e.on(c,"click",(function(e){var n=o(c,e.target||e.srcElement);n&&null!=n.hintId&&(r.changeActive(n.hintId),t.options.completeOnSingleClick&&r.pick())})),e.on(c,"mousedown",(function(){setTimeout((function(){l.focus()}),20)}));var E=this.getSelectedHintRange();return 0===E.from&&0===E.to||this.scrollToActive(),e.signal(n,"select",f[this.selectedHint],c.childNodes[this.selectedHint]),!0}function s(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],o=this;this.cm.operation((function(){r.hint?r.hint(o.cm,t,r):o.cm.replaceRange(i(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),o.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(r(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch<e.ch||this.cm.somethingSelected()||!t.ch||this.options.closeCharacters.test(i.charAt(t.ch-1)))this.close();else{var o=this;this.debounce=n((function(){o.update()})),this.widget&&this.widget.disable()}},update:function(e){if(null!=this.tick){var t=this,n=++this.tick;s(this.options.hint,this.cm,this.options,(function(r){t.tick==n&&t.finishUpdate(r,e)}))}},finishUpdate:function(t,n){this.data&&e.signal(this.data,"update");var r=this.widget&&this.widget.picked||n&&this.options.completeSingle;this.widget&&this.widget.close(),this.data=t,t&&t.list.length&&(r&&1==t.list.length?this.pick(t,0):(this.widget=new l(this,t),e.signal(t,"shown")))}},l.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm.getInputField();e.removeAttribute("aria-activedescendant"),e.removeAttribute("aria-owns");var t=this.completion.cm;this.completion.options.closeOnUnfocus&&(t.off("blur",this.onBlur),t.off("focus",this.onFocus)),t.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,n){if(t>=this.data.list.length?t=n?this.data.list.length-1:0:t<0&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var r=this.hints.childNodes[this.selectedHint];r&&(r.className=r.className.replace(" CodeMirror-hint-active",""),r.removeAttribute("aria-selected")),(r=this.hints.childNodes[this.selectedHint=t]).className+=" CodeMirror-hint-active",r.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",r.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],r)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTop<this.hints.scrollTop?this.hints.scrollTop=t.offsetTop-r.offsetTop:n.offsetTop+n.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:function(t,n){var r,i=t.getHelpers(n,"hint");if(i.length){var o=function(e,t,n){var r=function(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r<t.length;r++)t[r].supportsSelection&&n.push(t[r]);return n}(e,i);!function i(o){if(o==r.length)return t(null);s(r[o],e,n,(function(e){e&&e.list.length>0?t(e):i(o+1)}))}(0)};return o.async=!0,o.supportsSelection=!0,o}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),l=e.Pos(i.line,o.start),s=i;o.start<i.ch&&/\w/.test(o.string.charAt(i.ch-o.start-1))?r=o.string.substr(0,i.ch-o.start):(r="",l=i);for(var a=[],c=0;c<n.words.length;c++){var u=n.words[c];u.slice(0,r.length)==r&&a.push(u)}if(a.length)return{list:a,from:l,to:s}})),e.commands.autocomplete=e.showHint;var a={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(n(1004))},1159:function(e,t,n){"use strict";n.r(t)},1160:function(e,t,n){"use strict";n.r(t)},1161:function(e,t,n){!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var s=e.getLineHandle(t.line),a=t.ch-1,c=o&&o.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=i(o),f=!c&&a>=0&&u.test(s.text.charAt(a))&&r[s.text.charAt(a)]||u.test(s.text.charAt(a+1))&&r[s.text.charAt(++a)];if(!f)return null;var h=">"==f.charAt(1)?1:-1;if(o&&o.strict&&h>0!=(a==t.ch))return null;var d=e.getTokenTypeAt(n(t.line,a+1)),p=l(e,n(t.line,a+(h>0?1:0)),h,d,o);return null==p?null:{from:n(t.line,a),to:p&&p.pos,match:p&&p.ch==f.charAt(0),forward:h>0}}function l(e,t,o,l,s){for(var a=s&&s.maxScanLineLength||1e4,c=s&&s.maxScanLines||1e3,u=[],f=i(s),h=o>0?Math.min(t.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-c),d=t.line;d!=h;d+=o){var p=e.getLine(d);if(p){var g=o>0?0:p.length-1,m=o>0?p.length:-1;if(!(p.length>a))for(d==t.line&&(g=t.ch-(o<0?1:0));g!=m;g+=o){var v=p.charAt(g);if(f.test(v)&&(void 0===l||(e.getTokenTypeAt(n(d,g+1))||"")==(l||""))){var y=r[v];if(y&&">"==y.charAt(1)==o>0)u.push(v);else{if(!u.length)return{pos:n(d,g),ch:v};u.pop()}}}}}return d-o!=(o>0?e.lastLine():e.firstLine())&&null}function s(e,r,i){for(var l=e.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,a=[],c=e.listSelections(),u=0;u<c.length;u++){var f=c[u].empty()&&o(e,c[u].head,i);if(f&&(f.match||!1!==s)&&e.getLine(f.from.line).length<=l){var h=f.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(e.markText(f.from,n(f.from.line,f.from.ch+1),{className:h})),f.to&&e.getLine(f.to.line).length<=l&&a.push(e.markText(f.to,n(f.to.line,f.to.ch+1),{className:h}))}}if(a.length){t&&e.state.focused&&e.focus();var d=function(){e.operation((function(){for(var e=0;e<a.length;e++)a[e].clear()}))};if(!r)return d;setTimeout(d,800)}}function a(e){e.operation((function(){e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null),e.state.matchBrackets.currentlyHighlighted=s(e,!1,e.state.matchBrackets)}))}function c(e){e.state.matchBrackets&&e.state.matchBrackets.currentlyHighlighted&&(e.state.matchBrackets.currentlyHighlighted(),e.state.matchBrackets.currentlyHighlighted=null)}e.defineOption("matchBrackets",!1,(function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",a),t.off("focus",a),t.off("blur",c),c(t)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",a),t.on("focus",a),t.on("blur",c))})),e.defineExtension("matchBrackets",(function(){s(this,!0)})),e.defineExtension("findMatchingBracket",(function(e,t,n){return(n||"boolean"==typeof t)&&(n?(n.strict=t,t=n):t=t?{strict:!0}:null),o(this,e,t)})),e.defineExtension("scanForBracket",(function(e,t,n,r){return l(this,e,t,n,r)}))}(n(1004))},1162:function(e,t,n){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,l){l&&l!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:function(t){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),l=t.listSelections(),a=0;a<l.length;a++){if(!l[a].empty())return e.Pass;var u=c(t,l[a].head);if(!u||o.indexOf(u)%2!=0)return e.Pass}for(a=l.length-1;a>=0;a--){var f=l[a].head;t.replaceRange("",n(f.line,f.ch-1),n(f.line,f.ch+1),"+delete")}},Enter:function(t){var n=s(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),l=0;l<o.length;l++){if(!o[l].empty())return e.Pass;var u=c(t,o[l].head);if(!u||i.indexOf(u)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),a(t,-1),o=t.listSelections();for(var n=0;n<o.length;n++){var r=o[n].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}}))}};function o(e){for(var t=0;t<e.length;t++){var n=e.charAt(t),r="'"+n+"'";i[r]||(i[r]=l(n))}}function l(t){return function(i){return function(t,i){var o=s(t);if(!o||t.getOption("disableInput"))return e.Pass;var l=r(o,"pairs"),c=l.indexOf(i);if(-1==c)return e.Pass;for(var f,h=r(o,"closeBefore"),d=r(o,"triples"),p=l.charAt(c+1)==i,g=t.listSelections(),m=c%2==0,v=0;v<g.length;v++){var y,b=g[v],w=b.head,x=t.getRange(w,n(w.line,w.ch+1));if(m&&!b.empty())y="surround";else if(!p&&m||x!=i)if(p&&w.ch>1&&d.indexOf(i)>=0&&t.getRange(n(w.line,w.ch-2),w)==i+i){if(w.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(w.line,w.ch-2))))return e.Pass;y="addFour"}else if(p){var C=0==w.ch?" ":t.getRange(n(w.line,w.ch-1),w);if(e.isWordChar(x)||C==i||e.isWordChar(C))return e.Pass;y="both"}else{if(!m||!(0===x.length||/\s/.test(x)||h.indexOf(x)>-1))return e.Pass;y="both"}else y=p&&u(t,w)?"both":d.indexOf(i)>=0&&t.getRange(w,n(w.line,w.ch+3))==i+i+i?"skipThree":"skip";if(f){if(f!=y)return e.Pass}else f=y}var k=c%2?l.charAt(c-1):i,S=c%2?i:l.charAt(c+1);t.operation((function(){if("skip"==f)a(t,1);else if("skipThree"==f)a(t,3);else if("surround"==f){for(var r=t.getSelections(),i=0;i<r.length;i++)r[i]=k+r[i]+S;for(t.replaceSelections(r,"around"),r=t.listSelections().slice(),i=0;i<r.length;i++)r[i]=(o=r[i],l=void 0,l=e.cmpPos(o.anchor,o.head)>0,{anchor:new n(o.anchor.line,o.anchor.ch+(l?-1:1)),head:new n(o.head.line,o.head.ch+(l?1:-1))});t.setSelections(r)}else"both"==f?(t.replaceSelection(k+S,null),t.triggerElectric(k+S),a(t,-1)):"addFour"==f&&(t.replaceSelection(k+k+k+k,"before"),a(t,1));var o,l}))}(i,t)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function a(e,t){for(var n=[],r=e.listSelections(),i=0,o=0;o<r.length;o++){var l=r[o];l.head==e.getCursor()&&(i=o);var s=l.head.ch||t>0?{line:l.head.line,ch:l.head.ch+t}:{line:l.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function c(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function u(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}(n(1004))},1163:function(e,t){function n(t){return e.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},1166:function(e,t,n){!function(e){"use strict";e.defineOption("foldGutter",!1,(function(t,r,i){var o;i&&i!=e.Init&&(t.clearGutter(t.state.foldGutter.options.gutter),t.state.foldGutter=null,t.off("gutterClick",a),t.off("changes",u),t.off("viewportChange",f),t.off("fold",h),t.off("unfold",h),t.off("swapDoc",u),t.off("optionChange",c)),r&&(t.state.foldGutter=new n((!0===(o=r)&&(o={}),null==o.gutter&&(o.gutter="CodeMirror-foldgutter"),null==o.indicatorOpen&&(o.indicatorOpen="CodeMirror-foldgutter-open"),null==o.indicatorFolded&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o)),s(t),t.on("gutterClick",a),t.on("changes",u),t.on("viewportChange",f),t.on("fold",h),t.on("unfold",h),t.on("swapDoc",u),t.on("optionChange",c))}));var t=e.Pos;function n(e){this.options=e,this.from=this.to=0}function r(e,n){for(var r=e.findMarks(t(n,0),t(n+1,0)),i=0;i<r.length;++i)if(r[i].__isFold){var o=r[i].find(-1);if(o&&o.line===n)return r[i]}}function i(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function o(e,n,o){var s=e.state.foldGutter.options,a=n-1,c=e.foldOption(s,"minFoldSize"),u=e.foldOption(s,"rangeFinder"),f="string"==typeof s.indicatorFolded&&l(s.indicatorFolded),h="string"==typeof s.indicatorOpen&&l(s.indicatorOpen);e.eachLine(n,o,(function(n){++a;var o=null,l=n.gutterMarkers;if(l&&(l=l[s.gutter]),r(e,a)){if(f&&l&&f.test(l.className))return;o=i(s.indicatorFolded)}else{var d=t(a,0),p=u&&u(e,d);if(p&&p.to.line-p.from.line>=c){if(h&&l&&h.test(l.className))return;o=i(s.indicatorOpen)}}(o||l)&&e.setGutterMarker(n,s.gutter,o)}))}function l(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){o(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function a(e,n,i){var o=e.state.foldGutter;if(o){var l=o.options;if(i==l.gutter){var s=r(e,n);s?s.clear():e.foldCode(t(n,0),l)}}}function c(e,t){"mode"==t&&u(e)}function u(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),n.foldOnChangeTimeSpan||600)}}function f(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?s(e):e.operation((function(){n.from<t.from&&(o(e,n.from,t.from),t.from=n.from),n.to>t.to&&(o(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function h(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r<n.to&&o(e,r,r+1)}}}(n(1004),n(1064))},1167:function(e,t,n){"use strict";n.r(t)},1168:function(e,t,n){!function(e){"use strict";function t(t){return function(n,r){var i=r.line,o=n.getLine(i);function l(t){for(var l,s=r.ch,a=0;;){var c=s<=0?-1:o.lastIndexOf(t[0],s-1);if(-1!=c){if(1==a&&c<r.ch)break;if(l=n.getTokenTypeAt(e.Pos(i,c+1)),!/^(comment|string)/.test(l))return{ch:c+1,tokenType:l,pair:t};s=c-1}else{if(1==a)break;a=1,s=o.length}}}function s(t){var r,o,l=1,s=n.lastLine(),a=t.ch;e:for(var c=i;c<=s;++c)for(var u=n.getLine(c),f=c==i?a:0;;){var h=u.indexOf(t.pair[0],f),d=u.indexOf(t.pair[1],f);if(h<0&&(h=u.length),d<0&&(d=u.length),(f=Math.min(h,d))==u.length)break;if(n.getTokenTypeAt(e.Pos(c,f+1))==t.tokenType)if(f==h)++l;else if(!--l){r=c,o=f;break e}++f}return null==r||i==r?null:{from:e.Pos(i,a),to:e.Pos(r,o)}}for(var a=[],c=0;c<t.length;c++){var u=l(t[c]);u&&a.push(u)}for(a.sort((function(e,t){return e.ch-t.ch})),c=0;c<a.length;c++){var f=s(a[c]);if(f)return f}return null}}e.registerHelper("fold","brace",t([["{","}"],["[","]"]])),e.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]])),e.registerHelper("fold","import",(function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var l=t.getLine(i).indexOf(";");if(-1!=l)return{startCh:r.end,end:e.Pos(i,l)}}}var i,o=n.line,l=r(o);if(!l||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=l.end;;){var a=r(s.line+1);if(null==a)break;s=a.end}return{from:t.clipPos(e.Pos(o,l.startCh+1)),to:s}})),e.registerHelper("fold","include",(function(t,n){function r(n){if(n<t.firstLine()||n>t.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var l=i;null!=r(l+1);)++l;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(l))}}))}(n(1004))},1169:function(e,t,n){!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,o=t.indentUnit,l=n.statementIndent,s=n.jsonld,a=n.json||s,c=!1!==n.trackScope,u=n.typescript,f=n.wordCharacters||/[\w$\xa1-\uffff]/,h=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),l={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,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:o,typeof:o,instanceof:o,true:l,false:l,null:l,undefined:l,NaN:l,Infinity:l,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function g(e,t,n){return r=e,i=n,t}function m(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,i=!1;if(s&&"@"==e.peek()&&e.match(p))return t.tokenize=m,g("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(t.tokenize=m),g("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return g("number","number");if("."==r&&e.match(".."))return g("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return g(r);if("="==r&&e.eat(">"))return g("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return g("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),g("number","number");if("/"==r)return e.eat("*")?(t.tokenize=v,v(e,t)):e.eat("/")?(e.skipToEnd(),g("comment","comment")):Qe(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),g("regexp","string-2")):(e.eat("="),g("operator","operator",e.current()));if("`"==r)return t.tokenize=y,y(e,t);if("#"==r&&"!"==e.peek())return e.skipToEnd(),g("meta","meta");if("#"==r&&e.eatWhile(f))return g("variable","property");if("<"==r&&e.match("!--")||"-"==r&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),g("comment","comment");if(d.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-|&?]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),"?"==r&&e.eat(".")?g("."):g("operator","operator",e.current());if(f.test(r)){e.eatWhile(f);var i=e.current();if("."!=t.lastType){if(h.propertyIsEnumerable(i)){var o=h[i];return g(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return g("async","keyword",i)}return g("variable","variable",i)}}function v(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=m;break}r="*"==n}return g("comment","comment")}function y(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=m;break}r=!r&&"\\"==n}return g("quasi","string-2",e.current())}function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,l=n-1;l>=0;--l){var s=e.string.charAt(l),a="([{}])".indexOf(s);if(a>=0&&a<3){if(!i){++l;break}if(0==--i){"("==s&&(o=!0);break}}else if(a>=3&&a<6)++i;else if(f.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--l){if(0==l)return;if(e.string.charAt(l-1)==s&&"\\"!=e.string.charAt(l-2)){l--;break}}else if(o&&!i){++l;break}}o&&!i&&(t.fatArrowAt=l)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function x(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function C(e,t){if(!c)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function k(e,t,n,r,i){var o=e.cc;for(S.state=e,S.stream=i,S.marked=null,S.cc=o,S.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():a?j:R)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return S.marked?S.marked:"variable"==n&&C(e,r)?"variable-2":t}}var S={state:null,column:null,marked:null,cc:null};function L(){for(var e=arguments.length-1;e>=0;e--)S.cc.push(arguments[e])}function T(){return L.apply(null,arguments),!0}function M(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function A(e){var t=S.state;if(S.marked="def",c){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,n){if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new N(r,n.vars,!0):null}return M(t,n.vars)?n:new N(n.prev,new D(t,n.vars),!1)}return null}(e,t.context);if(null!=r)return void(t.context=r)}else if(!M(e,t.localVars))return void(t.localVars=new D(e,t.localVars));n.globalVars&&!M(e,t.globalVars)&&(t.globalVars=new D(e,t.globalVars))}}function O(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function N(e,t,n){this.prev=e,this.vars=t,this.block=n}function D(e,t){this.name=e,this.next=t}var H=new D("this",new D("arguments",null));function W(){S.state.context=new N(S.state.context,S.state.localVars,!1),S.state.localVars=H}function F(){S.state.context=new N(S.state.context,S.state.localVars,!0),S.state.localVars=null}function P(){S.state.localVars=S.state.context.vars,S.state.context=S.state.context.prev}function E(e,t){var n=function(){var n=S.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new x(r,S.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function I(){var e=S.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function z(e){return function t(n){return n==e?T():";"==e||"}"==n||")"==n||"]"==n?L():T(t)}}function R(e,t){return"var"==e?T(E("vardef",t),ke,z(";"),I):"keyword a"==e?T(E("form"),G,R,I):"keyword b"==e?T(E("form"),R,I):"keyword d"==e?S.stream.match(/^\s*$/,!1)?T():T(E("stat"),K,z(";"),I):"debugger"==e?T(z(";")):"{"==e?T(E("}"),F,se,I,P):";"==e?T():"if"==e?("else"==S.state.lexical.info&&S.state.cc[S.state.cc.length-1]==I&&S.state.cc.pop()(),T(E("form"),G,R,I,Oe)):"function"==e?T(We):"for"==e?T(E("form"),F,Ne,R,P,I):"class"==e||u&&"interface"==t?(S.marked="keyword",T(E("form","class"==e?e:t),ze,I)):"variable"==e?u&&"declare"==t?(S.marked="keyword",T(R)):u&&("module"==t||"enum"==t||"type"==t)&&S.stream.match(/^\s*\w/,!1)?(S.marked="keyword","enum"==t?T(qe):"type"==t?T(Pe,z("operator"),he,z(";")):T(E("form"),Se,z("{"),E("}"),se,I,I)):u&&"namespace"==t?(S.marked="keyword",T(E("form"),j,R,I)):u&&"abstract"==t?(S.marked="keyword",T(R)):T(E("stat"),ee):"switch"==e?T(E("form"),G,z("{"),E("}","switch"),F,se,I,I,P):"case"==e?T(j,z(":")):"default"==e?T(z(":")):"catch"==e?T(E("form"),W,B,R,I,P):"export"==e?T(E("stat"),Ve,I):"import"==e?T(E("stat"),Ue,I):"async"==e?T(R):"@"==t?T(j,R):L(E("stat"),j,z(";"),I)}function B(e){if("("==e)return T(Ee,z(")"))}function j(e,t){return U(e,t,!1)}function V(e,t){return U(e,t,!0)}function G(e){return"("!=e?L():T(E(")"),K,z(")"),I)}function U(e,t,n){if(S.state.fatArrowAt==S.stream.start){var r=n?Z:q;if("("==e)return T(W,E(")"),oe(Ee,")"),I,z("=>"),r,P);if("variable"==e)return L(W,Se,z("=>"),r,P)}var i=n?$:_;return w.hasOwnProperty(e)?T(i):"function"==e?T(We,i):"class"==e||u&&"interface"==t?(S.marked="keyword",T(E("form"),Ie,I)):"keyword c"==e||"async"==e?T(n?V:j):"("==e?T(E(")"),K,z(")"),I,i):"operator"==e||"spread"==e?T(n?V:j):"["==e?T(E("]"),Ye,I,i):"{"==e?le(ne,"}",null,i):"quasi"==e?L(X,i):"new"==e?T(function(e){return function(t){return"."==t?T(e?J:Q):"variable"==t&&u?T(we,e?$:_):L(e?V:j)}}(n)):T()}function K(e){return e.match(/[;\}\)\],]/)?L():L(j)}function _(e,t){return","==e?T(K):$(e,t,!1)}function $(e,t,n){var r=0==n?_:$,i=0==n?j:V;return"=>"==e?T(W,n?Z:q,P):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?T(r):u&&"<"==t&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?T(E(">"),oe(he,">"),I,r):"?"==t?T(j,z(":"),i):T(i):"quasi"==e?L(X,r):";"!=e?"("==e?le(V,")","call",r):"."==e?T(te,r):"["==e?T(E("]"),K,z("]"),I,r):u&&"as"==t?(S.marked="keyword",T(he,r)):"regexp"==e?(S.state.lastType=S.marked="operator",S.stream.backUp(S.stream.pos-S.stream.start-1),T(i)):void 0:void 0}function X(e,t){return"quasi"!=e?L():"${"!=t.slice(t.length-2)?T(X):T(K,Y)}function Y(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,T(X)}function q(e){return b(S.stream,S.state),L("{"==e?R:j)}function Z(e){return b(S.stream,S.state),L("{"==e?R:V)}function Q(e,t){if("target"==t)return S.marked="keyword",T(_)}function J(e,t){if("target"==t)return S.marked="keyword",T($)}function ee(e){return":"==e?T(I,R):L(_,z(";"),I)}function te(e){if("variable"==e)return S.marked="property",T()}function ne(e,t){return"async"==e?(S.marked="property",T(ne)):"variable"==e||"keyword"==S.style?(S.marked="property","get"==t||"set"==t?T(re):(u&&S.state.fatArrowAt==S.stream.start&&(n=S.stream.match(/^\s*:\s*/,!1))&&(S.state.fatArrowAt=S.stream.pos+n[0].length),T(ie))):"number"==e||"string"==e?(S.marked=s?"property":S.style+" property",T(ie)):"jsonld-keyword"==e?T(ie):u&&O(t)?(S.marked="keyword",T(ne)):"["==e?T(j,ae,z("]"),ie):"spread"==e?T(V,ie):"*"==t?(S.marked="keyword",T(ne)):":"==e?L(ie):void 0;var n}function re(e){return"variable"!=e?L(ie):(S.marked="property",T(We))}function ie(e){return":"==e?T(V):"("==e?L(We):void 0}function oe(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var l=S.state.lexical;return"call"==l.info&&(l.pos=(l.pos||0)+1),T((function(n,r){return n==t||r==t?L():L(e)}),r)}return i==t||o==t?T():n&&n.indexOf(";")>-1?L(e):T(z(t))}return function(n,i){return n==t||i==t?T():L(e,r)}}function le(e,t,n){for(var r=3;r<arguments.length;r++)S.cc.push(arguments[r]);return T(E(t,n),oe(e,t),I)}function se(e){return"}"==e?T():L(R,se)}function ae(e,t){if(u){if(":"==e)return T(he);if("?"==t)return T(ae)}}function ce(e,t){if(u&&(":"==e||"in"==t))return T(he)}function ue(e){if(u&&":"==e)return S.stream.match(/^\s*\w+\s+is\b/,!1)?T(j,fe,he):T(he)}function fe(e,t){if("is"==t)return S.marked="keyword",T()}function he(e,t){return"keyof"==t||"typeof"==t||"infer"==t||"readonly"==t?(S.marked="keyword",T("typeof"==t?V:he)):"variable"==e||"void"==t?(S.marked="type",T(be)):"|"==t||"&"==t?T(he):"string"==e||"number"==e||"atom"==e?T(be):"["==e?T(E("]"),oe(he,"]",","),I,be):"{"==e?T(E("}"),pe,I,be):"("==e?T(oe(ye,")"),de,be):"<"==e?T(oe(he,">"),he):"quasi"==e?L(me,be):void 0}function de(e){if("=>"==e)return T(he)}function pe(e){return e.match(/[\}\)\]]/)?T():","==e||";"==e?T(pe):L(ge,pe)}function ge(e,t){return"variable"==e||"keyword"==S.style?(S.marked="property",T(ge)):"?"==t||"number"==e||"string"==e?T(ge):":"==e?T(he):"["==e?T(z("variable"),ce,z("]"),ge):"("==e?L(Fe,ge):e.match(/[;\}\)\],]/)?void 0:T()}function me(e,t){return"quasi"!=e?L():"${"!=t.slice(t.length-2)?T(me):T(he,ve)}function ve(e){if("}"==e)return S.marked="string-2",S.state.tokenize=y,T(me)}function ye(e,t){return"variable"==e&&S.stream.match(/^\s*[?:]/,!1)||"?"==t?T(ye):":"==e?T(he):"spread"==e?T(ye):L(he)}function be(e,t){return"<"==t?T(E(">"),oe(he,">"),I,be):"|"==t||"."==e||"&"==t?T(he):"["==e?T(he,z("]"),be):"extends"==t||"implements"==t?(S.marked="keyword",T(he)):"?"==t?T(he,z(":"),he):void 0}function we(e,t){if("<"==t)return T(E(">"),oe(he,">"),I,be)}function xe(){return L(he,Ce)}function Ce(e,t){if("="==t)return T(he)}function ke(e,t){return"enum"==t?(S.marked="keyword",T(qe)):L(Se,ae,Me,Ae)}function Se(e,t){return u&&O(t)?(S.marked="keyword",T(Se)):"variable"==e?(A(t),T()):"spread"==e?T(Se):"["==e?le(Te,"]"):"{"==e?le(Le,"}"):void 0}function Le(e,t){return"variable"!=e||S.stream.match(/^\s*:/,!1)?("variable"==e&&(S.marked="property"),"spread"==e?T(Se):"}"==e?L():"["==e?T(j,z("]"),z(":"),Le):T(z(":"),Se,Me)):(A(t),T(Me))}function Te(){return L(Se,Me)}function Me(e,t){if("="==t)return T(V)}function Ae(e){if(","==e)return T(ke)}function Oe(e,t){if("keyword b"==e&&"else"==t)return T(E("form","else"),R,I)}function Ne(e,t){return"await"==t?T(Ne):"("==e?T(E(")"),De,I):void 0}function De(e){return"var"==e?T(ke,He):"variable"==e?T(He):L(He)}function He(e,t){return")"==e?T():";"==e?T(He):"in"==t||"of"==t?(S.marked="keyword",T(j,He)):L(j,He)}function We(e,t){return"*"==t?(S.marked="keyword",T(We)):"variable"==e?(A(t),T(We)):"("==e?T(W,E(")"),oe(Ee,")"),I,ue,R,P):u&&"<"==t?T(E(">"),oe(xe,">"),I,We):void 0}function Fe(e,t){return"*"==t?(S.marked="keyword",T(Fe)):"variable"==e?(A(t),T(Fe)):"("==e?T(W,E(")"),oe(Ee,")"),I,ue,P):u&&"<"==t?T(E(">"),oe(xe,">"),I,Fe):void 0}function Pe(e,t){return"keyword"==e||"variable"==e?(S.marked="type",T(Pe)):"<"==t?T(E(">"),oe(xe,">"),I):void 0}function Ee(e,t){return"@"==t&&T(j,Ee),"spread"==e?T(Ee):u&&O(t)?(S.marked="keyword",T(Ee)):u&&"this"==e?T(ae,Me):L(Se,ae,Me)}function Ie(e,t){return"variable"==e?ze(e,t):Re(e,t)}function ze(e,t){if("variable"==e)return A(t),T(Re)}function Re(e,t){return"<"==t?T(E(">"),oe(xe,">"),I,Re):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(S.marked="keyword"),T(u?he:j,Re)):"{"==e?T(E("}"),Be,I):void 0}function Be(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&O(t))&&S.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1)?(S.marked="keyword",T(Be)):"variable"==e||"keyword"==S.style?(S.marked="property",T(je,Be)):"number"==e||"string"==e?T(je,Be):"["==e?T(j,ae,z("]"),je,Be):"*"==t?(S.marked="keyword",T(Be)):u&&"("==e?L(Fe,Be):";"==e||","==e?T(Be):"}"==e?T():"@"==t?T(j,Be):void 0}function je(e,t){if("!"==t)return T(je);if("?"==t)return T(je);if(":"==e)return T(he,Me);if("="==t)return T(V);var n=S.state.lexical.prev;return L(n&&"interface"==n.info?Fe:We)}function Ve(e,t){return"*"==t?(S.marked="keyword",T(Xe,z(";"))):"default"==t?(S.marked="keyword",T(j,z(";"))):"{"==e?T(oe(Ge,"}"),Xe,z(";")):L(R)}function Ge(e,t){return"as"==t?(S.marked="keyword",T(z("variable"))):"variable"==e?L(V,Ge):void 0}function Ue(e){return"string"==e?T():"("==e?L(j):"."==e?L(_):L(Ke,_e,Xe)}function Ke(e,t){return"{"==e?le(Ke,"}"):("variable"==e&&A(t),"*"==t&&(S.marked="keyword"),T($e))}function _e(e){if(","==e)return T(Ke,_e)}function $e(e,t){if("as"==t)return S.marked="keyword",T(Ke)}function Xe(e,t){if("from"==t)return S.marked="keyword",T(j)}function Ye(e){return"]"==e?T():L(oe(V,"]"))}function qe(){return L(E("form"),Se,z("{"),E("}"),oe(Ze,"}"),I,I)}function Ze(){return L(Se,Me)}function Qe(e,t,n){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return W.lex=F.lex=!0,P.lex=!0,I.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new x((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new N(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=v&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",k(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==v||t.tokenize==y)return e.Pass;if(t.tokenize!=m)return 0;var i,s=r&&r.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==I)a=a.prev;else if(u!=Oe&&u!=P)break}for(;("stat"==a.type||"form"==a.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==_||i==$)&&!/^[,\.=+\-*:?[\(]/.test(r));)a=a.prev;l&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var f=a.type,h=s==f;return"vardef"==f?a.indented+("operator"==t.lastType||","==t.lastType?a.info.length+1:0):"form"==f&&"{"==s?a.indented:"form"==f?a.indented+o:"stat"==f?a.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?l||o:0):"switch"!=a.info||h||0==n.doubleIndentSwitch?a.align?a.column+(h?0:1):a.indented+(h?0:o):a.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:a?null:"/*",blockCommentEnd:a?null:"*/",blockCommentContinue:a?null:" * ",lineComment:a?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:a?"json":"javascript",jsonldMode:s,jsonMode:a,expressionAllowed:Qe,skipExpression:function(t){k(t,"atom","atom","true",new e.StringStream("",2,null))}}})),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/manifest+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})}(n(1004))},1421:function(e,t,n){!function(e){var t=e.Pos;function n(e,t){for(var n=0,r=e.length;n<r;++n)t(e[n])}function r(n,r,i,o){var l=n.getCursor(),s=i(n,l);if(!/\b(?:string|comment)\b/.test(s.type)){var a=e.innerMode(n.getMode(),s.state);if("json"!==a.mode.helperType){s.state=a.state,/^[\w$_]*$/.test(s.string)?s.end>l.ch&&(s.end=l.ch,s.string=s.string.slice(0,l.ch-s.start)):s={start:l.ch,end:l.ch,string:"",state:s.state,type:"."==s.string?"property":null};for(var c=s;"property"==c.type;){if("."!=(c=i(n,t(l.line,c.start))).string)return;if(c=i(n,t(l.line,c.start)),!f)var f=[];f.push(c)}return{list:u(s,f,r,o),from:t(l.line,s.start),to:t(l.line,s.end)}}}}function i(e,t){var n=e.getTokenAt(t);return t.ch==n.start+1&&"."==n.string.charAt(0)?(n.end=n.start,n.string=".",n.type="property"):/^\.[\w$_]*$/.test(n.string)&&(n.type="property",n.start++,n.string=n.string.replace(/\./,"")),n}e.registerHelper("hint","javascript",(function(e,t){return r(e,a,(function(e,t){return e.getTokenAt(t)}),t)})),e.registerHelper("hint","coffeescript",(function(e,t){return r(e,c,i,t)}));var o="charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight toUpperCase toLowerCase split concat match replace search".split(" "),l="length concat join splice push pop shift unshift slice reverse sort indexOf lastIndexOf every some filter forEach map reduce reduceRight ".split(" "),s="prototype apply call bind".split(" "),a="break case catch class const continue debugger default delete do else export extends false finally for function if in import instanceof new null return super switch this throw true try typeof var void while with yield".split(" "),c="and break catch class continue delete do else extends false finally for if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes".split(" ");function u(e,t,r,i){var a=[],c=e.string,u=i&&i.globalScope||window;function f(e){0!=e.lastIndexOf(c,0)||function(e,t){if(!Array.prototype.indexOf){for(var n=e.length;n--;)if(e[n]===t)return!0;return!1}return-1!=e.indexOf(t)}(a,e)||a.push(e)}function h(e){"string"==typeof e?n(o,f):e instanceof Array?n(l,f):e instanceof Function&&n(s,f),function(e,t){if(Object.getOwnPropertyNames&&Object.getPrototypeOf)for(var n=e;n;n=Object.getPrototypeOf(n))Object.getOwnPropertyNames(n).forEach(t);else for(var r in e)t(r)}(e,f)}if(t&&t.length){var d,p=t.pop();for(p.type&&0===p.type.indexOf("variable")?(i&&i.additionalContext&&(d=i.additionalContext[p.string]),i&&!1===i.useGlobalScope||(d=d||u[p.string])):"string"==p.type?d="":"atom"==p.type?d=1:"function"==p.type&&(null==u.jQuery||"$"!=p.string&&"jQuery"!=p.string||"function"!=typeof u.jQuery?null!=u._&&"_"==p.string&&"function"==typeof u._&&(d=u._()):d=u.jQuery());null!=d&&t.length;)d=d[t.pop().string];null!=d&&h(d)}else{for(var g=e.state.localVars;g;g=g.next)f(g.name);for(var m=e.state.context;m;m=m.prev)for(g=m.vars;g;g=g.next)f(g.name);for(g=e.state.globalVars;g;g=g.next)f(g.name);if(i&&null!=i.additionalContext)for(var v in i.additionalContext)f(v);i&&!1===i.useGlobalScope||h(u),n(r,f)}return a}}(n(1004))},203:function(e,t,n){"use strict";var r=n(8),i=n(138),o=n(9),l=n(34),s=n(72),a=n(17),c=n(30),u=n(49),f=n(144),h=n(139);i("match",(function(e,t,n){return[function(t){var n=c(this),i=l(t)?void 0:u(t,e);return i?r(i,t,n):new RegExp(t)[e](a(n))},function(e){var r=o(this),i=a(e),l=n(t,r,i);if(l.done)return l.value;if(!r.global)return h(r,i);var c=r.unicode;r.lastIndex=0;for(var u,d=[],p=0;null!==(u=h(r,i));){var g=a(u[0]);d[p]=g,""===g&&(r.lastIndex=f(i,s(r.lastIndex),c)),p++}return 0===p?null:d}]}))}}]);