text: !function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=609)}({17:function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=function(e,t){var r=e[1]||"",n=e[3];if(!n)return r;if(t&&"function"==typeof btoa){var i=(l=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */"),o=n.sources.map(function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"});return[r].concat(o).concat([i]).join("\n")}var l;return[r].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(n[o]=!0)}for(i=0;i<e.length;i++){var l=e[i];"number"==typeof l[0]&&n[l[0]]||(r&&!l[2]?l[2]=r:r&&(l[2]="("+l[2]+") and ("+r+")"),t.push(l))}},t}},18:function(e,t){var r={},n=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},i=n(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),o=n(function(){return document.head||document.getElementsByTagName("head")[0]}),l=null,a=0,s=[];function u(e,t){for(var n=0;n<e.length;n++){var i=e[n],o=r[i.id];if(o){o.refs++;for(var l=0;l<o.parts.length;l++)o.parts[l](i.parts[l]);for(;l<i.parts.length;l++)o.parts.push(p(i.parts[l],t))}else{var a=[];for(l=0;l<i.parts.length;l++)a.push(p(i.parts[l],t));r[i.id]={id:i.id,refs:1,parts:a}}}}function c(e){for(var t=[],r={},n=0;n<e.length;n++){var i=e[n],o=i[0],l={css:i[1],media:i[2],sourceMap:i[3]};r[o]?r[o].parts.push(l):t.push(r[o]={id:o,parts:[l]})}return t}function f(e,t){var r=o(),n=s[s.length-1];if("top"===e.insertAt)n?n.nextSibling?r.insertBefore(t,n.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),s.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");r.appendChild(t)}}function d(e){e.parentNode.removeChild(e);var t=s.indexOf(e);t>=0&&s.splice(t,1)}function h(e){var t=document.createElement("style");return t.type="text/css",f(e,t),t}function p(e,t){var r,n,i;if(t.singleton){var o=a++;r=l||(l=h(t)),n=v.bind(null,r,o,!1),i=v.bind(null,r,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return t.rel="stylesheet",f(e,t),t}(t),n=b.bind(null,r),i=function(){d(r),r.href&&URL.revokeObjectURL(r.href)}):(r=h(t),n=y.bind(null,r),i=function(){d(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");void 0===(t=t||{}).singleton&&(t.singleton=i()),void 0===t.insertAt&&(t.insertAt="bottom");var n=c(e);return u(n,t),function(e){for(var i=[],o=0;o<n.length;o++){var l=n[o];(a=r[l.id]).refs--,i.push(a)}e&&u(c(e),t);for(o=0;o<i.length;o++){var a;if(0===(a=i[o]).refs){for(var s=0;s<a.parts.length;s++)a.parts[s]();delete r[a.id]}}}};var g,m=(g=[],function(e,t){return g[e]=t,g.filter(Boolean).join("\n")});function v(e,t,r,n){var i=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=m(t,i);else{var o=document.createTextNode(i),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(o,l[t]):e.appendChild(o)}}function y(e,t){var r=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function b(e,t){var r=t.css,n=t.sourceMap;n&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var i=new Blob([r],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}},209:function(e,t,r){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),n=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),l=n||i||o,a=l&&(n?document.documentMode||6:+(o||i)[1]),s=!o&&/WebKit\//.test(e),u=s&&/Qt\/\d+\.\d+/.test(e),c=!o&&/Chrome\//.test(e),f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),b=/\bCrOS\b/.test(e),w=/win/i.test(t),x=f&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(f=!1,s=!0);var C=y&&(u||f&&(null==x||x<12.11)),k=r||l&&a>=9;function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var M,L=function(e,t){var r=e.className,n=S(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return T(e).appendChild(t)}function N(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function A(e,t,r,n){var i=N(e,t,r,n);return i.setAttribute("role","presentation"),i}function D(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(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var r=e.className;S(t).test(r)||(e.className+=(r?" ":"")+t)}function E(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!S(r[n]).test(t)&&(t+=" "+r[n]);return t}M=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var z=function(e){e.select()};function P(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function F(e,t,r){for(var n in t||(t={}),e)!e.hasOwnProperty(n)||!1===r&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function R(e,t,r,n,i){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=n||0,l=i||0;;){var a=e.indexOf("\t",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=r-l%r,o=a+1}}g?z=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:l&&(z=function(e){try{e.select()}catch(e){}});var I=function(){this.id=null};function B(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}I.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var j=30,U={toString:function(){return"CodeMirror.Pass"}},V={scroll:!1},_={origin:"*mouse"},G={origin:"+move"};function $(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);-1==o&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,n=o+1,(i+=r-i%r)>=t)return n}}var K=[""];function X(e){for(;K.length<=e;)K.push(q(K)+" ");return K[e]}function q(e){return e[e.length-1]}function Y(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Z(){}function J(e,t){var r;return Object.create?r=Object.create(e):(Z.prototype=e,r=new Z),t&&F(t,r),r}var Q=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Q.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ne=/[\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 ie(e){return e.charCodeAt(0)>=768&&ne.test(e)}function oe(e,t,r){for(;(r<0?t>0:t<e.length)&&ie(e.charAt(t));)t+=r;return t}function le(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function ae(e,t,n){var i=this;this.input=n,i.scrollbarFiller=N("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=N("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=A("div",null,"CodeMirror-code"),i.selectionDiv=N("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=N("div",null,"CodeMirror-cursors"),i.measure=N("div",null,"CodeMirror-measure"),i.lineMeasure=N("div",null,"CodeMirror-measure"),i.lineSpace=A("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=A("div",[i.lineSpace],"CodeMirror-lines");i.mover=N("div",[o],null,"position: relative"),i.sizer=N("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=N("div",null,null,"position: absolute; height: "+j+"px; width: 1px;"),i.gutters=N("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=N("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=N("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),l&&a<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),s||r&&v||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,n.init(i)}function se(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function ue(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function ce(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function fe(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function de(e){if(null==e.parent)return null;for(var t=e.parent,r=B(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function he(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l].height;if(t<a)break;t-=a}return r+l}function pe(e,t){return t>=e.first&&t<e.first+e.size}function ge(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function me(e,t,r){if(void 0===r&&(r=null),!(this instanceof me))return new me(e,t,r);this.line=e,this.ch=t,this.sticky=r}function ve(e,t){return e.line-t.line||e.ch-t.ch}function ye(e,t){return e.sticky==t.sticky&&0==ve(e,t)}function be(e){return me(e.line,e.ch)}function we(e,t){return ve(e,t)<0?t:e}function xe(e,t){return ve(e,t)<0?e:t}function Ce(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ke(e,t){if(t.line<e.first)return me(e.first,0);var r=e.first+e.size-1;return t.line>r?me(r,se(e,r).text.length):function(e,t){var r=e.ch;return null==r||r>t?me(e.line,t):r<0?me(e.line,0):e}(t,se(e,t.line).text.length)}function Se(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ke(e,t[n]);return r}var Me=!1,Le=!1;function Te(e,t,r){this.marker=e,this.from=t,this.to=r}function Oe(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Ne(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Ae(e,t){if(t.full)return null;var r=pe(e,t.from.line)&&se(e,t.from.line).markedSpans,n=pe(e,t.to.line)&&se(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=0==ve(t.from,t.to),a=function(e,t,r){var n;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&&(!r||!o.marker.insertLeft)){var a=null==o.to||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Te(l,o.from,a?null:o.to))}}return n}(r,i,l),s=function(e,t,r){var n;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&&(!r||o.marker.insertLeft)){var a=null==o.from||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Te(l,a?null:o.from-t,null==o.to?null:o.to-t))}}return n}(n,o,l),u=1==t.text.length,c=q(t.text).length+(u?i:0);if(a)for(var f=0;f<a.length;++f){var d=a[f];if(null==d.to){var h=Oe(s,d.marker);h?u&&(d.to=null==h.to?null:h.to+c):d.to=i}}if(s)for(var p=0;p<s.length;++p){var g=s[p];null!=g.to&&(g.to+=c),null==g.from?Oe(a,g.marker)||(g.from=c,u&&(a||(a=[])).push(g)):(g.from+=c,u&&(a||(a=[])).push(g))}a&&(a=De(a)),s&&s!=a&&(s=De(s));var m=[a];if(!u){var v,y=t.text.length-2;if(y>0&&a)for(var b=0;b<a.length;++b)null==a[b].to&&(v||(v=[])).push(new Te(a[b].marker,null,null));for(var w=0;w<y;++w)m.push(v);m.push(s)}return m}function De(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function We(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function He(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Ee(e){return e.inclusiveLeft?-1:0}function ze(e){return e.inclusiveRight?1:0}function Pe(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=ve(n.from,i.from)||Ee(e)-Ee(t);if(o)return-o;var l=ve(n.to,i.to)||ze(e)-ze(t);return l||t.id-e.id}function Fe(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)(i=n[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||Pe(r,i.marker)<0)&&(r=i.marker);return r}function Re(e){return Fe(e,!0)}function Ie(e){return Fe(e,!1)}function Be(e,t){var r,n=Le&&e.markedSpans;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Pe(r,o.marker)<0)&&(r=o.marker)}return r}function je(e,t,r,n,i){var o=se(e,t),l=Le&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(s.marker.collapsed){var u=s.marker.find(0),c=ve(u.from,r)||Ee(s.marker)-Ee(i),f=ve(u.to,n)||ze(s.marker)-ze(i);if(!(c>=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ve(u.to,r)>=0:ve(u.to,r)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ve(u.from,n)<=0:ve(u.from,n)<0)))return!0}}}function Ue(e){for(var t;t=Re(e);)e=t.find(-1,!0).line;return e}function Ve(e,t){var r=se(e,t),n=Ue(r);return r==n?t:de(n)}function _e(e,t){if(t>e.lastLine())return t;var r,n=se(e,t);if(!Ge(e,n))return t;for(;r=Ie(n);)n=r.find(1,!0).line;return de(n)+1}function Ge(e,t){var r=Le&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&$e(e,t,n))return!0}}function $e(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return $e(e,n.line,Oe(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if((i=t.markedSpans[o]).marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&$e(e,t,i))return!0}function Ke(e){for(var t=0,r=(e=Ue(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;o=(r=o).parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==r)break;t+=a.height}return t}function Xe(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Re(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=Ie(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,r+=(n=o.to.line).text.length-o.to.ch}return r}function qe(e){var t=e.display,r=e.doc;t.maxLine=se(r,r.first),t.maxLineLength=Xe(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=Xe(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var Ye=null;function Ze(e,t,r){var n;Ye=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:Ye=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Ye=i)}return null!=n?n:Ye}var Je=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,i=/[LRr]/,o=/[Lb1n]/,l=/[1n]/;function a(e,t,r){this.level=e,this.from=t,this.to=r}return function(s,u){var c="ltr"==u?"L":"R";if(0==s.length||"ltr"==u&&!r.test(s))return!1;for(var f,d=s.length,h=[],p=0;p<d;++p)h.push((f=s.charCodeAt(p))<=247?e.charAt(f):1424<=f&&f<=1524?"R":1536<=f&&f<=1785?t.charAt(f-1536):1774<=f&&f<=2220?"r":8192<=f&&f<=8203?"w":8204==f?"b":"L");for(var g=0,m=c;g<d;++g){var v=h[g];"m"==v?h[g]=m:m=v}for(var y=0,b=c;y<d;++y){var w=h[y];"1"==w&&"r"==b?h[y]="n":i.test(w)&&(b=w,"r"==w&&(h[y]="R"))}for(var x=1,C=h[0];x<d-1;++x){var k=h[x];"+"==k&&"1"==C&&"1"==h[x+1]?h[x]="1":","!=k||C!=h[x+1]||"1"!=C&&"n"!=C||(h[x]=C),C=k}for(var S=0;S<d;++S){var M=h[S];if(","==M)h[S]="N";else if("%"==M){var L=void 0;for(L=S+1;L<d&&"%"==h[L];++L);for(var T=S&&"!"==h[S-1]||L<d&&"1"==h[L]?"1":"N",O=S;O<L;++O)h[O]=T;S=L-1}}for(var N=0,A=c;N<d;++N){var D=h[N];"L"==A&&"1"==D?h[N]="L":i.test(D)&&(A=D)}for(var W=0;W<d;++W)if(n.test(h[W])){var H=void 0;for(H=W+1;H<d&&n.test(h[H]);++H);for(var E="L"==(W?h[W-1]:c),z=E==("L"==(H<d?h[H]:c))?E?"L":"R":c,P=W;P<H;++P)h[P]=z;W=H-1}for(var F,R=[],I=0;I<d;)if(o.test(h[I])){var B=I;for(++I;I<d&&o.test(h[I]);++I);R.push(new a(0,B,I))}else{var j=I,U=R.length;for(++I;I<d&&"L"!=h[I];++I);for(var V=j;V<I;)if(l.test(h[V])){j<V&&R.splice(U,0,new a(1,j,V));var _=V;for(++V;V<I&&l.test(h[V]);++V);R.splice(U,0,new a(2,_,V)),j=V}else++V;j<I&&R.splice(U,0,new a(1,j,I))}return"ltr"==u&&(1==R[0].level&&(F=s.match(/^\s+/))&&(R[0].from=F[0].length,R.unshift(new a(0,0,F[0].length))),1==q(R).level&&(F=s.match(/\s+$/))&&(q(R).to-=F[0].length,R.push(new a(0,d-F[0].length,d)))),"rtl"==u?R.reverse():R}}();function Qe(e,t){var r=e.order;return null==r&&(r=e.order=Je(e.text,t)),r}var et=[],tt=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||et).concat(r)}};function rt(e,t){return e._handlers&&e._handlers[t]||et}function nt(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=B(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function it(e,t){var r=rt(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ot(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),it(e,r||t.type,e,t),ft(t)||t.codemirrorIgnore}function lt(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==B(r,t[n])&&r.push(t[n])}function at(e,t){return rt(e,t).length>0}function st(e){e.prototype.on=function(e,t){tt(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function ut(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ct(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ft(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function dt(e){ut(e),ct(e)}function ht(e){return e.target||e.srcElement}function pt(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var gt,mt,vt=function(){if(l&&a<9)return!1;var e=N("div");return"draggable"in e||"dragDrop"in e}();function yt(e){if(null==gt){var t=N("span","​");O(e,N("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(gt=t.offsetWidth<=1&&t.offsetHeight>2&&!(l&&a<8))}var r=gt?N("span","​"):N("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function bt(e){if(null!=mt)return mt;var t=O(e,document.createTextNode("AخA")),r=M(t,0,1).getBoundingClientRect(),n=M(t,1,2).getBoundingClientRect();return T(e),!(!r||r.left==r.right)&&(mt=n.right-r.right<3)}var wt,xt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Ct=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)},kt="oncopy"in(wt=N("div"))||(wt.setAttribute("oncopy","return;"),"function"==typeof wt.oncopy),St=null,Mt={},Lt={};function Tt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Mt[e]=t}function Ot(e){if("string"==typeof e&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&"string"==typeof e.name&&Lt.hasOwnProperty(e.name)){var t=Lt[e.name];"string"==typeof t&&(t={name:t}),(e=J(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ot("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ot("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Nt(e,t){t=Ot(t);var r=Mt[t.name];if(!r)return Nt(e,"text/plain");var n=r(e,t);if(At.hasOwnProperty(t.name)){var i=At[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var At={};function Dt(e,t){F(t,At.hasOwnProperty(e)?At[e]:At[e]={})}function Wt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ht(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Et(e,t,r){return!e.startState||e.startState(t,r)}var zt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};zt.prototype.eol=function(){return this.pos>=this.string.length},zt.prototype.sol=function(){return this.pos==this.lineStart},zt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},zt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},zt.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},zt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},zt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},zt.prototype.skipToEnd=function(){this.pos=this.string.length},zt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},zt.prototype.backUp=function(e){this.pos-=e},zt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=R(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},zt.prototype.indentation=function(){return R(this.string,null,this.tabSize)-(this.lineStart?R(this.string,this.lineStart,this.tabSize):0)},zt.prototype.match=function(e,t,r){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},zt.prototype.current=function(){return this.string.slice(this.start,this.pos)},zt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},zt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},zt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Pt=function(e,t){this.state=e,this.lookAhead=t},Ft=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};function Rt(e,t,r,n){var i=[e.state.modeGen],o={};Kt(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var l=r.state,a=function(n){r.baseTokens=i;var a=e.state.overlays[n],s=1,u=0;r.state=!0,Kt(e,t.text,a.mode,r,function(e,t){for(var r=s;u<e;){var n=i[s];n>e&&i.splice(s,1,e,i[s+1],n),s+=2,u=Math.min(e,n)}if(t)if(a.opaque)i.splice(r,s-r,e,"overlay "+t),s=r+2;else for(;r<s;r+=2){var o=i[r+1];i[r+1]=(o?o+" ":"")+"overlay "+t}},o),r.state=l,r.baseTokens=null,r.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function It(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Bt(e,de(t)),i=t.text.length>e.options.maxHighlightLength&&Wt(e.doc.mode,n.state),o=Rt(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Bt(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new Ft(n,!0,t);var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=se(o,a-1),u=s.stateAfter;if(u&&(!r||a+(u instanceof Pt?u.lookAhead:0)<=o.modeFrontier))return a;var c=R(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=a-1,n=c)}return i}(e,t,r),l=o>n.first&&se(n,o-1).stateAfter,a=l?Ft.fromSaved(n,l,o):new Ft(n,Et(n.mode),o);return n.iter(o,t,function(r){jt(e,r.text,a);var n=a.line;r.stateAfter=n==t-1||n%5==0||n>=i.viewFrom&&n<i.viewTo?a.save():null,a.nextLine()}),r&&(n.modeFrontier=a.line),a}function jt(e,t,r,n){var i=e.doc.mode,o=new zt(t,e.options.tabSize,r);for(o.start=o.pos=n||0,""==t&&Ut(i,r.state);!o.eol();)Vt(i,o,r.state),o.start=o.pos}function Ut(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ht(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function Vt(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ht(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}Ft.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ft.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}},Ft.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ft.fromSaved=function(e,t,r){return t instanceof Pt?new Ft(e,Wt(e.mode,t.state),r,t.lookAhead):new Ft(e,Wt(e.mode,t),r)},Ft.prototype.save=function(e){var t=!1!==e?Wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Pt(t,this.maxLookAhead):t};var _t=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Gt(e,t,r,n){var i,o,l=e.doc,a=l.mode,s=se(l,(t=ke(l,t)).line),u=Bt(e,t.line,r),c=new zt(s.text,e.options.tabSize,u);for(n&&(o=[]);(n||c.pos<t.ch)&&!c.eol();)c.start=c.pos,i=Vt(a,c,u.state),n&&o.push(new _t(c,i,Wt(l.mode,u.state)));return n?o:new _t(c,i,u.state)}function $t(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Kt(e,t,r,n,i,o,l){var a=r.flattenSpans;null==a&&(a=e.options.flattenSpans);var s,u=0,c=null,f=new zt(t,e.options.tabSize,n),d=e.options.addModeClass&&[null];for(""==t&&$t(Ut(r,n.state),o);!f.eol();){if(f.pos>e.options.maxHighlightLength?(a=!1,l&&jt(e,t,n,f.pos),f.pos=t.length,s=null):s=$t(Vt(r,f,n.state,d),o),d){var h=d[0].name;h&&(s="m-"+(s?h+" "+s:h))}if(!a||c!=s){for(;u<f.start;)i(u=Math.min(f.start,u+5e3),c);c=s}f.start=f.pos}for(;u<f.pos;){var p=Math.min(f.pos,u+5e3);i(p,c),u=p}}var Xt=function(e,t,r){this.text=e,He(this,t),this.height=r?r(this):1};function qt(e){e.parent=null,We(e)}Xt.prototype.lineNo=function(){return de(this)},st(Xt);var Yt={},Zt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Zt:Yt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Qt(e,t){var r=A("span",null,null,s?"padding-right: .1px":null),n={pre:A("pre",[r],"CodeMirror-line"),content:r,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;n.pos=0,n.addToken=tr,bt(e.display.measure)&&(l=Qe(o,e.doc.direction))&&(n.addToken=rr(n.addToken,l)),n.map=[],ir(o,n,It(e,o,t!=e.display.externalMeasured&&de(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=E(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=E(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(yt(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var a=n.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return it(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=E(n.pre.className,n.textClass||"")),n}function er(e){var t=N("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function tr(e,t,r,n,i,o,s){if(t){var u,c=e.splitSpaces?function(e,t){if(e.length>1&&!/  /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}(t,e.trailingSpace):t,f=e.cm.state.specialChars,d=!1;if(f.test(t)){u=document.createDocumentFragment();for(var h=0;;){f.lastIndex=h;var p=f.exec(t),g=p?p.index-h:t.length-h;if(g){var m=document.createTextNode(c.slice(h,h+g));l&&a<9?u.appendChild(N("span",[m])):u.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!p)break;h+=g+1;var v=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,b=y-e.col%y;(v=u.appendChild(N("span",X(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=u.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&&a<9?u.appendChild(N("span",[v])):u.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,u=document.createTextNode(c),e.map.push(e.pos,e.pos+t.length,u),l&&a<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==c.charCodeAt(t.length-1),r||n||i||d||o){var w=r||"";n&&(w+=n),i&&(w+=i);var x=N("span",[u],w,o);if(s)for(var C in s)s.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,s[C]);return e.content.appendChild(x)}e.content.appendChild(u)}}function rr(e,t){return function(r,n,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,c=u+n.length;;){for(var f=void 0,d=0;d<t.length&&!((f=t[d]).to>u&&f.from<=u);d++);if(f.to>=c)return e(r,n,i,o,l,a,s);e(r,n.slice(0,f.to-u),i,o,null,a,s),o=null,n=n.slice(f.to-u),u=f.to}}}function nr(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function ir(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,a,s,u,c,f,d,h=i.length,p=0,g=1,m="",v=0;;){if(v==p){s=u=c=a="",d=null,f=null,v=1/0;for(var y=[],b=void 0,w=0;w<n.length;++w){var x=n[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,u=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==v&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var k in C.attributes)(d||(d={}))[k]=C.attributes[k];C.collapsed&&(!f||Pe(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&&(u+=" "+b[S]);if(!f||f.from==p)for(var M=0;M<y.length;++M)nr(t,0,y[M]);if(f&&(f.from||0)==p){if(nr(t,(null==f.to?h+1:f.to)-p,f.marker,null==f.from),null==f.to)return;f.to==p&&(f=!1)}}if(p>=h)break;for(var L=Math.min(h,v);;){if(m){var T=p+m.length;if(!f){var O=T>L?m.slice(0,L-p):m;t.addToken(t,O,l?l+s:s,c,p+O.length==v?u:"",a,d)}if(T>=L){m=m.slice(L-p),p=L;break}p=T,c=""}m=i.slice(o,o=r[g++]),l=Jt(r[g++],t.cm.options)}}else for(var N=1;N<r.length;N+=2)t.addToken(t,i.slice(o,o=r[N]),Jt(r[N+1],t.cm.options))}function or(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Ie(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}(t),this.size=this.rest?de(q(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ge(e,t)}function lr(e,t,r){for(var n,i=[],o=t;o<r;o=n){var l=new or(e.doc,se(e.doc,o),o);n=o+l.size,i.push(l)}return i}var ar=null,sr=null;function ur(e,t){var r=rt(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);ar?n=ar.delayedCallbacks:sr?n=sr:(n=sr=[],setTimeout(cr,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},l=0;l<r.length;++l)o(l)}}function cr(){var e=sr;sr=null;for(var t=0;t<e.length;++t)e[t]()}function fr(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?pr(e,t):"gutter"==o?mr(e,t,r,n):"class"==o?gr(e,t):"widget"==o&&vr(e,t,n)}t.changes=null}function dr(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&&a<8&&(e.node.style.zIndex=2)),e.node}function hr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Qt(e,t)}function pr(e,t){var r=t.text.className,n=hr(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,gr(e,t)):r&&(t.text.className=r)}function gr(e,t){!function(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=dr(t);t.background=n.insertBefore(N("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?dr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function mr(e,t,r,n){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=dr(t);t.gutterBackground=N("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.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=dr(t),a=t.gutter=N("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(N("div",ge(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.options.gutters.length;++s){var u=e.options.gutters[s],c=o.hasOwnProperty(u)&&o[u];c&&a.appendChild(N("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function vr(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n);br(e,t,r)}function yr(e,t,r,n){var i=hr(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),gr(e,t),mr(e,t,r,n),br(e,t,n),t.node}function br(e,t,r){if(wr(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)wr(e,t.rest[n],t,r,!1)}function wr(e,t,r,n,i){if(t.widgets)for(var o=dr(r),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=N("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),xr(s,u,r,n),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),ur(s,"redraw")}}function xr(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Cr(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),O(t.display.measure,N("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function kr(e,t){for(var r=ht(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return!0}function Sr(e){return e.lineSpace.offsetTop}function Mr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,N("pre","x")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function Tr(e){return j-e.display.nativeBarWidth}function Or(e){return e.display.scroller.clientWidth-Tr(e)-e.display.barWidth}function Nr(e){return e.display.scroller.clientHeight-Tr(e)-e.display.barHeight}function Ar(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(de(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Dr(e,t,r,n){return Er(e,Hr(e,t),r,n)}function Wr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[dn(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Hr(e,t){var r=de(t),n=Wr(e,r);n&&!n.text?n=null:n&&n.changes&&(fr(e,n,r,an(e)),e.curOp.forceUpdate=!0),n||(n=function(e,t){var r=de(t=Ue(t)),n=e.display.externalMeasured=new or(e.doc,t,r);n.lineN=r;var i=n.built=Qt(e,n);return n.text=i.pre,O(e.display.lineMeasure,i.pre),n}(e,t));var i=Ar(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Er(e,t,r,n,i){t.before&&(r=-1);var o,s=r+(n||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var n=e.options.lineWrapping,i=n&&Or(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,n){var i,o=Fr(t.map,r,n),s=o.node,u=o.start,c=o.end,f=o.collapse;if(3==s.nodeType){for(var d=0;d<4;d++){for(;u&&ie(t.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c<o.coverEnd&&ie(t.line.text.charAt(o.coverStart+c));)++c;if((i=l&&a<9&&0==u&&c==o.coverEnd-o.coverStart?s.parentNode.getBoundingClientRect():Rr(M(s,u,c).getClientRects(),n)).left||i.right||0==u)break;c=u,u-=1,f="right"}l&&a<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=St)return St;var t=O(e,N("span","x")),r=t.getBoundingClientRect(),n=M(t,0,1).getBoundingClientRect();return St=Math.abs(r.left-n.left)>1}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}(e.display.measure,i))}else{var h;u>0&&(f=n="right"),i=e.options.lineWrapping&&(h=s.getClientRects()).length>1?h["right"==n?h.length-1:0]:s.getBoundingClientRect()}if(l&&a<9&&!u&&(!i||!i.left&&!i.right)){var p=s.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+ln(e.display),top:p.top,bottom:p.bottom}:Pr}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,r,n)).bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var zr,Pr={left:0,right:0,top:0,bottom:0};function Fr(e,t,r){for(var n,i,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(i=0,o=1,l="left"):t<s?o=1+(i=t-a):(u==e.length-3||t==s&&e[u+3]>t)&&(i=(o=s-a)-1,t>=s&&(l="right")),null!=i){if(n=e[u+2],a==s&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[2+(u-=3)],l="left";if("right"==r&&i==s-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function Rr(e,t){var r=Pr;if("left"==t)for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Ir(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 Br(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ir(e.display.view[t])}function jr(e){Br(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ur(){return c&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Vr(){return c&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function _r(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Cr(e.widgets[r]));return t}function Gr(e,t,r,n,i){if(!i){var o=_r(t);r.top+=o,r.bottom+=o}if("line"==n)return r;n||(n="local");var l=Ke(t);if("local"==n?l+=Sr(e.display):l-=e.display.viewOffset,"page"==n||"window"==n){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+("window"==n?0:Vr());var s=a.left+("window"==n?0:Ur());r.left+=s,r.right+=s}return r.top+=l,r.bottom+=l,r}function $r(e,t,r){if("div"==r)return t;var n=t.left,i=t.top;if("page"==r)n-=Ur(),i-=Vr();else if("local"==r||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function Kr(e,t,r,n,i){return n||(n=se(e.doc,t.line)),Gr(e,n,Dr(e,n,t.ch,i),r)}function Xr(e,t,r,n,i,o){function l(t,l){var a=Er(e,i,t,l?"right":"left",o);return l?a.left=a.right:a.right=a.left,Gr(e,n,a,r)}n=n||se(e.doc,t.line),i||(i=Hr(e,n));var a=Qe(n,e.doc.direction),s=t.ch,u=t.sticky;if(s>=n.text.length?(s=n.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l("before"==u?s-1:s,"before"==u);function c(e,t,r){return l(r?e-1:e,1==a[t].level!=r)}var f=Ze(a,s,u),d=Ye,h=c(s,f,"before"==u);return null!=d&&(h.other=c(s,d,"before"!=u)),h}function qr(e,t){var r=0;t=ke(e.doc,t),e.options.lineWrapping||(r=ln(e.display)*t.ch);var n=se(e.doc,t.line),i=Ke(n)+Sr(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Yr(e,t,r,n,i){var o=me(e,t,r);return o.xRel=i,n&&(o.outside=!0),o}function Zr(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return Yr(n.first,0,null,!0,-1);var i=he(n,r),o=n.first+n.size-1;if(i>o)return Yr(n.first+n.size-1,se(n,o).text.length,null,!0,1);t<0&&(t=0);for(var l=se(n,i);;){var a=tn(e,l,i,t,r),s=Be(l,a.ch+(a.xRel>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=se(n,i=u.line)}}function Jr(e,t,r,n){n-=_r(t);var i=t.text.length,o=le(function(t){return Er(e,r,t-1).bottom<=n},i,0);return{begin:o,end:i=le(function(t){return Er(e,r,t).top>n},o,i)}}function Qr(e,t,r,n){return r||(r=Hr(e,t)),Jr(e,t,r,Gr(e,t,Er(e,r,n),"line").top)}function en(e,t,r,n){return!(e.bottom<=r)&&(e.top>r||(n?e.left:e.right)>t)}function tn(e,t,r,n,i){i-=Ke(t);var o=Hr(e,t),l=_r(t),a=0,s=t.text.length,u=!0,c=Qe(t,e.doc.direction);if(c){var f=(e.options.lineWrapping?nn:rn)(e,t,r,o,c,n,i);a=(u=1!=f.level)?f.from:f.to-1,s=u?f.to:f.from-1}var d,h,p=null,g=null,m=le(function(t){var r=Er(e,o,t);return r.top+=l,r.bottom+=l,!!en(r,n,i,!1)&&(r.top<=i&&r.left<=n&&(p=t,g=r),!0)},a,s),v=!1;if(g){var y=n-g.left<g.right-n,b=y==u;m=p+(b?0:1),h=b?"after":"before",d=y?g.left:g.right}else{u||m!=s&&m!=a||m++,h=0==m?"after":m==t.text.length?"before":Er(e,o,m-(u?1:0)).bottom+l<=i==u?"after":"before";var w=Xr(e,me(r,m,h),"line",t,o);d=w.left,v=i<w.top||i>=w.bottom}return Yr(r,m=oe(t.text,m,1),h,v,n-d)}function rn(e,t,r,n,i,o,l){var a=le(function(a){var s=i[a],u=1!=s.level;return en(Xr(e,me(r,u?s.to:s.from,u?"before":"after"),"line",t,n),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=1!=s.level,c=Xr(e,me(r,u?s.from:s.to,u?"after":"before"),"line",t,n);en(c,o,l,!0)&&c.top>l&&(s=i[a-1])}return s}function nn(e,t,r,n,i,o,l){var a=Jr(e,t,n,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var c=null,f=null,d=0;d<i.length;d++){var h=i[d];if(!(h.from>=u||h.to<=s)){var p=Er(e,n,1!=h.level?Math.min(u,h.to)-1:Math.max(s,h.from)).right,g=p<o?o-p+1e9:p-o;(!c||f>g)&&(c=h,f=g)}}return c||(c=i[i.length-1]),c.from<s&&(c={from:s,to:c.to,level:c.level}),c.to>u&&(c={from:c.from,to:u,level:c.level}),c}function on(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==zr){zr=N("pre");for(var t=0;t<49;++t)zr.appendChild(document.createTextNode("x")),zr.appendChild(N("br"));zr.appendChild(document.createTextNode("x"))}O(e.measure,zr);var r=zr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),T(e.measure),r||1}function ln(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=N("span","xxxxxxxxxx"),r=N("pre",[t]);O(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function an(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:sn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function sn(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function un(e){var t=on(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/ln(e.display)-3);return function(i){if(Ge(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function cn(e){var t=e.doc,r=un(e);t.iter(function(e){var t=r(e);t!=e.height&&fe(e,t)})}function fn(e,t,r,n){var i=e.display;if(!r&&"true"==ht(t).getAttribute("cm-not-content"))return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch(t){return null}var s,u=Zr(e,o,l);if(n&&1==u.xRel&&(s=se(e.doc,u.line).text).length==u.ch){var c=R(s,s.length,e.options.tabSize)-s.length;u=me(u.line,Math.max(0,Math.round((o-Lr(e.display).left)/ln(e.display))-c))}return u}function dn(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if((t-=r[n].size)<0)return n}function hn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function pn(e,t){void 0===t&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(t||l!=r.sel.primIndex){var a=r.sel.ranges[l];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var s=a.empty();(s||e.options.showCursorWhenSelecting)&&gn(e,a.head,i),s||vn(e,a,o)}}return n}function gn(e,t,r){var n=Xr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(N("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(N("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function mn(e,t){return e.top-t.top||e.left-t.left}function vn(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),l=Lr(e.display),a=l.left,s=Math.max(n.sizerWidth,Or(e)-n.sizer.offsetLeft)-l.right,u="ltr"==i.direction;function c(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(N("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==r?s-e:r)+"px;\n                             height: "+(n-t)+"px"))}function f(t,r,n){var o,l,f=se(i,t),d=f.text.length;function h(r,n){return Kr(e,me(t,r),"div",f,n)}function p(t,r,n){var i=Qr(e,f,null,t),o="ltr"==r==("after"==n)?"left":"right";return h("after"==n?i.begin:i.end-(/\s/.test(f.text.charAt(i.end-1))?2:1),o)[o]}var g=Qe(f,i.direction);return function(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}(g,r||0,null==n?d:n,function(e,t,i,f){var m="ltr"==i,v=h(e,m?"left":"right"),y=h(t-1,m?"right":"left"),b=null==r&&0==e,w=null==n&&t==d,x=0==f,C=!g||f==g.length-1;if(y.top-v.top<=3){var k=(u?w:b)&&C,S=(u?b:w)&&x?a:(m?v:y).left,M=k?s:(m?y:v).right;c(S,v.top,M-S,v.bottom)}else{var L,T,O,N;m?(L=u&&b&&x?a:v.left,T=u?s:p(e,i,"before"),O=u?a:p(t,i,"after"),N=u&&w&&C?s:y.right):(L=u?p(e,i,"before"):a,T=!u&&b&&x?s:v.right,O=!u&&w&&C?a:y.left,N=u?p(t,i,"after"):s),c(L,v.top,T-L,v.bottom),v.bottom<y.top&&c(a,v.bottom,null,y.top),c(O,y.top,N-O,y.bottom)}(!o||mn(v,o)<0)&&(o=v),mn(y,o)<0&&(o=y),(!l||mn(v,l)<0)&&(l=v),mn(y,l)<0&&(l=y)}),{start:o,end:l}}var d=t.from(),h=t.to();if(d.line==h.line)f(d.line,d.ch,h.ch);else{var p=se(i,d.line),g=se(i,h.line),m=Ue(p)==Ue(g),v=f(d.line,d.ch,m?p.text.length+1:null).end,y=f(h.line,m?0:null,h.ch).start;m&&(v.top<y.top-2?(c(v.right,v.top,null,v.bottom),c(a,y.top,y.left,y.bottom)):c(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&c(a,v.bottom,null,y.top)}r.appendChild(o)}function yn(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function bn(e){e.state.focused||(e.display.input.focus(),xn(e))}function wn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Cn(e))},100)}function xn(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(it(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),s&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),yn(e))}function Cn(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function kn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,s=void 0,u=0;if(!i.hidden){if(l&&a<8){var c=i.node.offsetTop+i.node.offsetHeight;s=c-r,r=c}else{var f=i.node.getBoundingClientRect();s=f.bottom-f.top,!o&&i.text.firstChild&&(u=i.text.firstChild.getBoundingClientRect().right-f.left-1)}var d=i.line.height-s;if(s<2&&(s=on(t)),(d>.005||d<-.005)&&(fe(i.line,s),Sn(i.line),i.rest))for(var h=0;h<i.rest.length;h++)Sn(i.rest[h]);if(u>e.display.sizerWidth){var p=Math.ceil(u/ln(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Sn(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Mn(e,t,r){var n=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Sr(e));var i=r&&null!=r.bottom?r.bottom:n+e.wrapper.clientHeight,o=he(t,n),l=he(t,i);if(r&&r.ensure){var a=r.ensure.from.line,s=r.ensure.to.line;a<o?(o=a,l=he(t,Ke(se(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=he(t,Ke(se(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function Ln(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=sn(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var a=r[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Tn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=ge(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(N("div",[N("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",di(e),!0}return!1}function On(e,t){var r=e.display,n=on(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Nr(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Mr(r),s=t.top<n,u=t.bottom>a-n;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var c=Math.min(t.top,(u?a:t.bottom)-o);c!=i&&(l.scrollTop=c)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,d=Or(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>d;return h&&(t.right=t.left+d),t.left<10?l.scrollLeft=0:t.left<f?l.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>d+f-3&&(l.scrollLeft=t.right+(h?0:10)-d),l}function Nn(e,t){null!=t&&(Wn(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function An(e){Wn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dn(e,t,r){null==t&&null==r||Wn(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Wn(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Hn(e,qr(e,t.from),qr(e,t.to),t.margin))}function Hn(e,t,r,n){var i=On(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Dn(e,i.scrollLeft,i.scrollTop)}function En(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||fi(e,{top:t}),zn(e,t,!0),r&&fi(e),li(e,100))}function zn(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),(e.display.scroller.scrollTop!=t||r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Pn(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n||(e.doc.scrollLeft=t,Ln(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fn(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Mr(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Tr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Rn=function(e,t,r){this.cm=r;var n=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");n.tabIndex=i.tabIndex=-1,e(n),e(i),tt(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),tt(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,l&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Rn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Rn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Rn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Rn.prototype.zeroWidthHack=function(){var e=y&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new I,this.disableVert=new I},Rn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,function n(){var i=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,n)})},Rn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var In=function(){};function Bn(e,t){t||(t=Fn(e));var r=e.display.barWidth,n=e.display.barHeight;jn(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&kn(e),jn(e,Fn(e)),r=e.display.barWidth,n=e.display.barHeight}function jn(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}In.prototype.update=function(){return{bottom:0,right:0}},In.prototype.setScrollLeft=function(){},In.prototype.setScrollTop=function(){},In.prototype.clear=function(){};var Un={native:Rn,null:In};function Vn(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Un[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),tt(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){"horizontal"==r?Pn(e,t):En(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var _n=0;function Gn(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:++_n},t=e.curOp,ar?ar.ops.push(t):t.ownsGroup=ar={ops:[t],delayedCallbacks:[]}}function $n(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}(r)}finally{ar=null,t(r)}}(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,r=0;r<t.length;r++)Kn(t[r]);for(var n=0;n<t.length;n++)(i=t[n]).updatedDisplay=i.mustUpdate&&ui(i.cm,i.update);for(var i,o=0;o<t.length;o++)Xn(t[o]);for(var l=0;l<t.length;l++)qn(t[l]);for(var a=0;a<t.length;a++)Yn(t[a])}(e)})}function Kn(e){var t=e.cm,r=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=Tr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Tr(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&qe(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new si(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Xn(e){var t=e.cm,r=t.display;e.updatedDisplay&&kn(t),e.barMeasure=Fn(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Dr(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Tr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Or(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function qn(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Pn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==W();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Bn(t,e.barMeasure),e.updatedDisplay&&hi(t,e.barMeasure),e.selectionChanged&&yn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&bn(e.cm)}function Yn(e){var t=e.cm,r=t.display,n=t.doc;e.updatedDisplay&&ci(t,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null!=e.scrollTop&&zn(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Pn(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ot(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=N("div","​",null,"position: absolute;\n                         top: "+(t.top-r.viewOffset-Sr(e.display))+"px;\n                         height: "+(t.bottom-t.top+Tr(e)+r.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,r,n){var i;null==n&&(n=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?me(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?me(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,a=Xr(e,t),s=r&&r!=t?Xr(e,r):a,u=On(e,i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-n,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+n}),c=e.doc.scrollTop,f=e.doc.scrollLeft;if(null!=u.scrollTop&&(En(e,u.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(l=!0)),null!=u.scrollLeft&&(Pn(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-f)>1&&(l=!0)),!l)break}return i}(t,ke(n,e.scrollToPos.from),ke(n,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var l=0;l<i.length;++l)i[l].lines.length||it(i[l],"hide");if(o)for(var a=0;a<o.length;++a)o[a].lines.length&&it(o[a],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&it(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Zn(e,t){if(e.curOp)return t();Gn(e);try{return t()}finally{$n(e)}}function Jn(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Gn(e);try{return t.apply(e,arguments)}finally{$n(e)}}}function Qn(e){return function(){if(this.curOp)return e.apply(this,arguments);Gn(this);try{return e.apply(this,arguments)}finally{$n(this)}}}function ei(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Gn(t);try{return e.apply(this,arguments)}finally{$n(t)}}}function ti(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Le&&Ve(e.doc,t)<i.viewTo&&ni(e);else if(r<=i.viewFrom)Le&&_e(e.doc,r+n)>i.viewFrom?ni(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)ni(e);else if(t<=i.viewFrom){var o=ii(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):ni(e)}else if(r>=i.viewTo){var l=ii(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):ni(e)}else{var a=ii(e,t,t,-1),s=ii(e,r,r+n,1);a&&s?(i.view=i.view.slice(0,a.index).concat(lr(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):ni(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function ri(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[dn(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);-1==B(l,r)&&l.push(r)}}}function ni(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ii(e,t,r,n){var i,o=dn(e,t),l=e.display.view;if(!Le||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var a=e.display.viewFrom,s=0;s<o;s++)a+=l[s].size;if(a!=t){if(n>0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;Ve(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function oi(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];i.hidden||i.node&&!i.changes||++r}return r}function li(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,P(ai,e))}function ai(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Bt(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(n.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?Wt(t.mode,n.state):null,s=Rt(e,o,n,!0);a&&(n.state=a),o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),d=0;!f&&d<l.length;++d)f=l[d]!=o.styles[d];f&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&jt(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return li(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Zn(e,function(){for(var t=0;t<i.length;t++)ri(e,i[t],"text")})}}var si=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Mn(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Or(e),this.force=r,this.dims=an(e),this.events=[]};function ui(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return ni(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==oi(e))return!1;Tn(e)&&(ni(e),t.dims=an(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Le&&(o=Ve(e.doc,o),l=_e(e.doc,l));var a=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;!function(e,t,r){var n=e.display;0==n.view.length||t>=n.viewTo||r<=n.viewFrom?(n.view=lr(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=lr(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(dn(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(lr(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,dn(e,r)))),n.viewTo=r}(e,o,l),r.viewOffset=Ke(se(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=oi(e);if(!a&&0==u&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var c=function(e){if(e.hasFocus())return null;var t=W();if(!t||!D(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&D(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}(e);return u>4&&(r.lineDiv.style.display="none"),function(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function a(t){var r=t.nextSibling;return s&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var u=n.view,c=n.viewFrom,f=0;f<u.length;f++){var d=u[f];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;l!=d.node;)l=a(l);var h=i&&null!=t&&t<=c&&d.lineNumber;d.changes&&(B(d.changes,"gutter")>-1&&(h=!1),fr(e,d,c,r)),h&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(ge(e.options,c)))),l=d.node.nextSibling}else{var p=yr(e,d,c,r);o.insertBefore(p,l)}c+=d.size}for(;l;)l=a(l)}(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(e){if(e&&e.activeElt&&e.activeElt!=W()&&(e.activeElt.focus(),e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}(c),T(r.cursorDiv),T(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,a&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,li(e,400)),r.updateLineNumbers=null,!0}function ci(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Or(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Mr(e.display)-Nr(e),r.top)}),t.visible=Mn(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&ui(e,t);n=!1){kn(e);var i=Fn(e);hn(e),Bn(e,i),hi(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 fi(e,t){var r=new si(e,t);if(ui(e,r)){kn(e),ci(e,r);var n=Fn(e);hn(e),Bn(e,n),hi(e,n),r.finish()}}function di(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function hi(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+Tr(e)+"px"}function pi(e){var t=e.display.gutters,r=e.options.gutters;T(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(N("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&(e.display.lineGutter=o,o.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",di(e)}function gi(e){var t=B(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}si.prototype.signal=function(e,t){at(e,t)&&this.events.push(arguments)},si.prototype.finish=function(){for(var e=0;e<this.events.length;e++)it.apply(null,this.events[e])};var mi=0,vi=null;function yi(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function bi(e){var t=yi(e);return t.x*=vi,t.y*=vi,t}function wi(e,t){var n=yi(t),i=n.x,o=n.y,l=e.display,a=l.scroller,u=a.scrollWidth>a.clientWidth,c=a.scrollHeight>a.clientHeight;if(i&&u||o&&c){if(o&&y&&s)e:for(var d=t.target,h=l.view;d!=a;d=d.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==d){e.display.currentWheelTarget=d;break e}if(i&&!r&&!f&&null!=vi)return o&&c&&En(e,Math.max(0,a.scrollTop+o*vi)),Pn(e,Math.max(0,a.scrollLeft+i*vi)),(!o||o&&c)&&ut(t),void(l.wheelStartX=null);if(o&&null!=vi){var g=o*vi,m=e.doc.scrollTop,v=m+l.wrapper.clientHeight;g<0?m=Math.max(0,m+g-50):v=Math.min(e.doc.height,v+g+50),fi(e,{top:m,bottom:v})}mi<20&&(null==l.wheelStartX?(l.wheelStartX=a.scrollLeft,l.wheelStartY=a.scrollTop,l.wheelDX=i,l.wheelDY=o,setTimeout(function(){if(null!=l.wheelStartX){var e=a.scrollLeft-l.wheelStartX,t=a.scrollTop-l.wheelStartY,r=t&&l.wheelDY&&t/l.wheelDY||e&&l.wheelDX&&e/l.wheelDX;l.wheelStartX=l.wheelStartY=null,r&&(vi=(vi*mi+r)/(mi+1),++mi)}},200)):(l.wheelDX+=i,l.wheelDY+=o))}}l?vi=-.53:r?vi=15:c?vi=-.7:d&&(vi=-1/3);var xi=function(e,t){this.ranges=e,this.primIndex=t};xi.prototype.primary=function(){return this.ranges[this.primIndex]},xi.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 r=this.ranges[t],n=e.ranges[t];if(!ye(r.anchor,n.anchor)||!ye(r.head,n.head))return!1}return!0},xi.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ci(be(this.ranges[t].anchor),be(this.ranges[t].head));return new xi(e,this.primIndex)},xi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},xi.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(ve(t,n.from())>=0&&ve(e,n.to())<=0)return r}return-1};var Ci=function(e,t){this.anchor=e,this.head=t};function ki(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(e,t){return ve(e.from(),t.from())}),r=B(t,i);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=ve(a.to(),l.from());if(n&&!l.empty()?s>0:s>=0){var u=xe(a.from(),l.from()),c=we(a.to(),l.to()),f=a.empty()?l.from()==l.head:a.from()==a.head;o<=r&&--r,t.splice(--o,2,new Ci(f?c:u,f?u:c))}}return new xi(t,r)}function Si(e,t){return new xi([new Ci(e,t||e)],0)}function Mi(e){return e.text?me(e.from.line+e.text.length-1,q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Li(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return Mi(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Mi(t).ch-t.to.ch),me(r,n)}function Ti(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new Ci(Li(i.anchor,t),Li(i.head,t)))}return ki(e.cm,r,e.sel.primIndex)}function Oi(e,t,r){return e.line==t.line?me(r.line,e.ch-t.ch+r.ch):me(r.line+(e.line-t.line),e.ch)}function Ni(e){e.doc.mode=Nt(e.options,e.doc.modeOption),Ai(e)}function Ai(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&&ti(e)}function Di(e,t){return 0==t.from.ch&&0==t.to.ch&&""==q(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Wi(e,t,r,n){function i(e){return r?r[e]:null}function o(e,r,i){!function(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),We(e),He(e,r);var i=n?n(e):1;i!=e.height&&fe(e,i)}(e,r,i,n),ur(e,"change",e,t)}function l(e,t){for(var r=[],o=e;o<t;++o)r.push(new Xt(u[o],i(o),n));return r}var a=t.from,s=t.to,u=t.text,c=se(e,a.line),f=se(e,s.line),d=q(u),h=i(u.length-1),p=s.line-a.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(Di(e,t)){var g=l(0,u.length-1);o(f,f.text,h),p&&e.remove(a.line,p),g.length&&e.insert(a.line,g)}else if(c==f)if(1==u.length)o(c,c.text.slice(0,a.ch)+d+c.text.slice(s.ch),h);else{var m=l(1,u.length-1);m.push(new Xt(d+c.text.slice(s.ch),h,n)),o(c,c.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,m)}else if(1==u.length)o(c,c.text.slice(0,a.ch)+u[0]+f.text.slice(s.ch),i(0)),e.remove(a.line+1,p);else{o(c,c.text.slice(0,a.ch)+u[0],i(0)),o(f,d+f.text.slice(s.ch),h);var v=l(1,u.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,v)}ur(e,"change",e,t)}function Hi(e,t,r){!function e(n,i,o){if(n.linked)for(var l=0;l<n.linked.length;++l){var a=n.linked[l];if(a.doc!=i){var s=o&&a.sharedHist;r&&!s||(t(a.doc,s),e(a.doc,n,s))}}}(e,null,!0)}function Ei(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,cn(e),Ni(e),zi(e),e.options.lineWrapping||qe(e),e.options.mode=t.modeOption,ti(e)}function zi(e){("rtl"==e.doc.direction?H:L)(e.display.lineDiv,"CodeMirror-rtl")}function Pi(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Fi(e,t){var r={from:be(t.from),to:Mi(t),text:ue(e,t.from,t.to)};return Ui(e,r,t.from.line,t.to.line+1),Hi(e,function(e){return Ui(e,r,t.from.line,t.to.line+1)},!0),r}function Ri(e){for(;e.length&&q(e).ranges;)e.pop()}function Ii(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,a=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Ri(e.done),q(e.done)):e.done.length&&!q(e.done).ranges?q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),q(e.done)):void 0}(i,i.lastOp==n)))l=q(o.changes),0==ve(t.from,t.to)&&0==ve(t.from,l.to)?l.to=Mi(t):o.changes.push(Fi(e,t));else{var s=q(i.done);for(s&&s.ranges||ji(e.sel,i.done),o={changes:[Fi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||it(e,"historyAdded")}function Bi(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,q(i.done),t))?i.done[i.done.length-1]=t:ji(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&!1!==n.clearRedo&&Ri(i.undone)}function ji(e,t){var r=q(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Ui(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function Vi(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function _i(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(Vi(r[i]));return n}(e,t),n=Ae(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l)e:for(var a=0;a<l.length;++a){for(var s=l[a],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}else l&&(r[i]=l)}return r}function Gi(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)n.push(r?xi.prototype.deepCopy.call(o):o);else{var l=o.changes,a=[];n.push({changes:a});for(var s=0;s<l.length;++s){var u=l[s],c=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var f in u)(c=f.match(/^spans_(\d+)$/))&&B(t,Number(c[1]))>-1&&(q(a)[f]=u[f],delete u[f])}}}return n}function $i(e,t,r,n){if(n){var i=e.anchor;if(r){var o=ve(t,i)<0;o!=ve(r,i)<0?(i=t,t=r):o!=ve(t,r)<0&&(t=r)}return new Ci(i,t)}return new Ci(r||t,t)}function Ki(e,t,r,n,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ji(e,new xi([$i(e.sel.primary(),t,r,i)],0),n)}function Xi(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=$i(e.sel.ranges[o],t[o],null,i);Ji(e,ki(e.cm,n,e.sel.primIndex),r)}function qi(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Ji(e,ki(e.cm,i,e.sel.primIndex),n)}function Yi(e,t,r,n){Ji(e,Si(t,r),n)}function Zi(e,t,r){var n=e.history.done,i=q(n);i&&i.ranges?(n[n.length-1]=t,Qi(e,t,r)):Ji(e,t,r)}function Ji(e,t,r){Qi(e,t,r),Bi(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Qi(e,t,r){(at(e,"beforeSelectionChange")||e.cm&&at(e.cm,"beforeSelectionChange"))&&(t=function(e,t,r){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var r=0;r<t.length;r++)this.ranges[r]=new Ci(ke(e,t[r].anchor),ke(e,t[r].head))},origin:r&&r.origin};return it(e,"beforeSelectionChange",e,n),e.cm&&it(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?ki(e.cm,n.ranges,n.ranges.length-1):t}(e,t,r));var n=r&&r.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1);eo(e,ro(e,t,n,!0)),r&&!1===r.scroll||!e.cm||An(e.cm)}function eo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,lt(e.cm)),ur(e,"cursorActivity",e))}function to(e){eo(e,ro(e,e.sel,null,!1))}function ro(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=io(e,l.anchor,a&&a.anchor,r,n),u=io(e,l.head,a&&a.head,r,n);(i||s!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Ci(s,u))}return i?ki(e.cm,i,t.primIndex):t}function no(e,t,r,n,i){var o=se(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker;if((null==a.from||(s.inclusiveLeft?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(s.inclusiveRight?a.to>=t.ch:a.to>t.ch))){if(i&&(it(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(r){var u=s.find(n<0?1:-1),c=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(u=oo(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=ve(u,r))&&(n<0?c<0:c>0))return no(e,u,t,n,i)}var f=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(f=oo(e,f,n,f.line==t.line?o:null)),f?no(e,f,t,n,i):null}}return t}function io(e,t,r,n,i){var o=n||1,l=no(e,t,r,o,i)||!i&&no(e,t,r,o,!0)||no(e,t,r,-o,i)||!i&&no(e,t,r,-o,!0);return l||(e.cantEdit=!0,me(e.first,0))}function oo(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?ke(e,me(t.line-1)):null:r>0&&t.ch==(n||se(e,t.line)).text.length?t.line<e.first+e.size-1?me(t.line+1,0):null:new me(t.line,t.ch+r)}function lo(e){e.setSelection(me(e.firstLine(),0),me(e.lastLine()),V)}function ao(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(t,r,i,o){t&&(n.from=ke(e,t)),r&&(n.to=ke(e,r)),i&&(n.text=i),void 0!==o&&(n.origin=o)}),it(e,"beforeChange",e,n),e.cm&&it(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function so(e,t,r){if(e.cm){if(!e.cm.curOp)return Jn(e.cm,so)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(at(e,"beforeChange")||e.cm&&at(e.cm,"beforeChange"))||(t=ao(e,t,!0))){var n=Me&&!r&&function(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&-1!=B(n,r)||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(ve(u.to,a.from)<0||ve(u.from,a.to)>0)){var c=[s,1],f=ve(u.from,a.from),d=ve(u.to,a.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:a.from}),(d>0||!l.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),s+=c.length-3}}return i}(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)uo(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else uo(e,t)}}function uo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ve(t.from,t.to)){var r=Ti(e,t);Ii(e,t,r,e.cm?e.cm.curOp.id:NaN),ho(e,t,r,Ae(e,t));var n=[];Hi(e,function(e,r){r||-1!=B(n,e.history)||(vo(e.history,t),n.push(e.history)),ho(e,t,null,Ae(e,t))})}}function co(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!n||r){for(var i,o=e.history,l=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u<a.length&&(i=a[u],r?!i.ranges||i.equals(e.sel):i.ranges);u++);if(u!=a.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(i=a.pop()).ranges){if(n)return void a.push(i);break}if(ji(i,s),r&&!i.equals(e.sel))return void Ji(e,i,{clearRedo:!1});l=i}var c=[];ji(l,s),s.push({changes:c,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var f=at(e,"beforeChange")||e.cm&&at(e.cm,"beforeChange"),d=function(r){var n=i.changes[r];if(n.origin=t,f&&!ao(e,n,!1))return a.length=0,{};c.push(Fi(e,n));var o=r?Ti(e,n):q(a);ho(e,n,o,_i(e,n)),!r&&e.cm&&e.cm.scrollIntoView({from:n.from,to:Mi(n)});var l=[];Hi(e,function(e,t){t||-1!=B(l,e.history)||(vo(e.history,n),l.push(e.history)),ho(e,n,null,_i(e,n))})},h=i.changes.length-1;h>=0;--h){var p=d(h);if(p)return p.v}}}}function fo(e,t){if(0!=t&&(e.first+=t,e.sel=new xi(Y(e.sel.ranges,function(e){return new Ci(me(e.anchor.line+t,e.anchor.ch),me(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){ti(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)ri(e.cm,n,"gutter")}}function ho(e,t,r,n){if(e.cm&&!e.cm.curOp)return Jn(e.cm,ho)(e,t,r,n);if(t.to.line<e.first)fo(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);fo(e,i),t={from:me(e.first,0),to:me(t.to.line+i,t.to.ch),text:[q(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:me(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ue(e,t.from,t.to),r||(r=Ti(e,t)),e.cm?function(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=de(Ue(se(n,o.line))),n.iter(s,l.line+1,function(e){if(e==i.maxLine)return a=!0,!0})),n.sel.contains(t.from,t.to)>-1&&lt(e),Wi(n,t,r,un(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=Xe(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=se(e,n).stateAfter;if(i&&(!(i instanceof Pt)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(n,o.line),li(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?ti(e):o.line!=l.line||1!=t.text.length||Di(e.doc,t)?ti(e,o.line,l.line+1,u):ri(e,o.line,"text");var c=at(e,"changes"),f=at(e,"change");if(f||c){var d={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&ur(e,"change",e,d),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,n):Wi(e,t,n),Qi(e,r,V)}}function po(e,t,r,n,i){var o;n||(n=r),ve(n,r)<0&&(r=(o=[n,r])[0],n=o[1]),"string"==typeof t&&(t=e.splitLines(t)),so(e,{from:r,to:n,text:t,origin:i})}function go(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function mo(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var a=0;a<o.ranges.length;a++)go(o.ranges[a].anchor,t,r,n),go(o.ranges[a].head,t,r,n)}else{for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(r<u.from.line)u.from=me(u.from.line+n,u.from.ch),u.to=me(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function vo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;mo(e.done,r,n,i),mo(e.undone,r,n,i)}function yo(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=se(e,Ce(e,t)):i=de(t),null==i?null:(n(o,i)&&e.cm&&ri(e.cm,i,r),o)}function bo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function wo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}Ci.prototype.from=function(){return xe(this.anchor,this.head)},Ci.prototype.to=function(){return we(this.anchor,this.head)},Ci.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},bo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,qt(i),ur(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}},wo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var o=Math.min(t,i-e),l=n.height;if(n.removeInner(e,o),this.height-=l-n.height,i==o&&(this.children.splice(r--,1),n.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof bo))){var a=[];this.collapse(a),this.children=[new bo(a)],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,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,a=l;a<i.lines.length;){var s=new bo(i.lines.slice(a,a+=25));i.height-=s.height,this.children.splice(++n,0,s),s.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 wo(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var r=B(e.parent.children,e);e.parent.children.splice(r+1,0,t)}else{var n=new wo(e.children);n.parent=e,e.children=[n,t],e=n}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,r))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var xo=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};function Co(e,t,r){Ke(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Nn(e,r)}xo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=de(r);if(null!=n&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var o=Cr(this);fe(r,Math.max(0,r.height-o)),e&&(Zn(e,function(){Co(e,r,-o),ri(e,n,"widget")}),ur(e,"lineWidgetCleared",e,this,n))}},xo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Cr(this)-t;i&&(Ge(this.doc,n)||fe(n,n.height+i),r&&Zn(r,function(){r.curOp.forceUpdate=!0,Co(r,n,i),ur(r,"lineWidgetChanged",r,e,de(n))}))},st(xo);var ko=0,So=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ko};function Mo(e,t,r,n,i){if(n&&n.shared)return function(e,t,r,n,i){(n=F(n)).shared=!1;var o=[Mo(e,t,r,n,i)],l=o[0],a=n.widgetNode;return Hi(e,function(e){a&&(n.widgetNode=a.cloneNode(!0)),o.push(Mo(e,ke(e,t),ke(e,r),n,i));for(var s=0;s<e.linked.length;++s)if(e.linked[s].isParent)return;l=q(o)}),new Lo(o,l)}(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Jn(e.cm,Mo)(e,t,r,n,i);var o=new So(e,i),l=ve(t,r);if(n&&F(n,o,!1),l>0||0==l&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(je(e,t.line,t,r,o)||t.line!=r.line&&je(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le=!0}o.addToHistory&&Ii(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var a,s=t.line,u=e.cm;if(e.iter(s,r.line+1,function(e){u&&o.collapsed&&!u.options.lineWrapping&&Ue(e)==u.display.maxLine&&(a=!0),o.collapsed&&s!=t.line&&fe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Te(o,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),o.collapsed&&e.iter(t.line,r.line+1,function(t){Ge(e,t)&&fe(t,0)}),o.clearOnEnter&&tt(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Me=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ko,o.atomic=!0),u){if(a&&(u.curOp.updateMaxLine=!0),o.collapsed)ti(u,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=t.line;c<=r.line;c++)ri(u,c,"text");o.atomic&&to(u.doc),ur(u,"markerAdded",u,o)}return o}So.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Gn(e),at(this,"clear")){var r=this.find();r&&ur(this,"clear",r.from,r.to)}for(var n=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],a=Oe(l.markedSpans,this);e&&!this.collapsed?ri(e,de(l),"text"):e&&(null!=a.to&&(i=de(l)),null!=a.from&&(n=de(l))),l.markedSpans=Ne(l.markedSpans,a),null==a.from&&this.collapsed&&!Ge(this.doc,l)&&e&&fe(l,on(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var u=Ue(this.lines[s]),c=Xe(u);c>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&ti(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&to(e.doc)),e&&ur(e,"markerCleared",e,this,n,i),t&&$n(e),this.parent&&this.parent.clear()}},So.prototype.find=function(e,t){var r,n;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],l=Oe(o.markedSpans,this);if(null!=l.from&&(r=me(t?o:de(o),l.from),-1==e))return r;if(null!=l.to&&(n=me(t?o:de(o),l.to),1==e))return n}return r&&{from:r,to:n}},So.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;t&&n&&Zn(n,function(){var i=t.line,o=de(t.line),l=Wr(n,o);if(l&&(Ir(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ge(r.doc,i)&&null!=r.height){var a=r.height;r.height=null;var s=Cr(r)-a;s&&fe(i,i.height+s)}ur(n,"markerChanged",n,e)})},So.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=B(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},So.prototype.detachLine=function(e){if(this.lines.splice(B(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},st(So);var Lo=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function To(e){return e.findMarks(me(e.first,0),e.clipPos(me(e.lastLine())),function(e){return e.parent})}function Oo(e){for(var t=function(t){var r=e[t],n=[r.primary.doc];Hi(r.primary.doc,function(e){return n.push(e)});for(var i=0;i<r.markers.length;i++){var o=r.markers[i];-1==B(n,o.doc)&&(o.parent=null,r.markers.splice(i--,1))}},r=0;r<e.length;r++)t(r)}Lo.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ur(this,"clear")}},Lo.prototype.find=function(e,t){return this.primary.find(e,t)},st(Lo);var No=0,Ao=function(e,t,r,n,i){if(!(this instanceof Ao))return new Ao(e,t,r,n,i);null==r&&(r=0),wo.call(this,[new bo([new Xt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=me(r,0);this.sel=Si(o),this.history=new Pi(null),this.id=++No,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Wi(this,{from:o,to:o,text:e}),Ji(this,Si(o),V)};Ao.prototype=J(wo.prototype,{constructor:Ao,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ce(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ei(function(e){var t=me(this.first,0),r=this.first+this.size-1;so(this,{from:t,to:me(r,se(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Dn(this.cm,0,0),Ji(this,Si(t),V)}),replaceRange:function(e,t,r,n){po(this,e,t=ke(this,t),r=r?ke(this,r):t,n)},getRange:function(e,t,r){var n=ue(this,ke(this,e),ke(this,t));return!1===r?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(pe(this,e))return se(this,e)},getLineNumber:function(e){return de(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=se(this,e)),Ue(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ke(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:ei(function(e,t,r){Yi(this,ke(this,"number"==typeof e?me(e,t||0):e),null,r)}),setSelection:ei(function(e,t,r){Yi(this,ke(this,e),ke(this,t||e),r)}),extendSelection:ei(function(e,t,r){Ki(this,ke(this,e),t&&ke(this,t),r)}),extendSelections:ei(function(e,t){Xi(this,Se(this,e),t)}),extendSelectionsBy:ei(function(e,t){Xi(this,Se(this,Y(this.sel.ranges,e)),t)}),setSelections:ei(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new Ci(ke(this,e[i].anchor),ke(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Ji(this,ki(this.cm,n,t),r)}}),addSelection:ei(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new Ci(ke(this,e),ke(this,t||e))),Ji(this,ki(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t,r=this.sel.ranges,n=0;n<r.length;n++){var i=ue(this,r[n].from(),r[n].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=ue(this,r[n].from(),r[n].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:ei(function(e,t,r){for(var n=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];n[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:r}}for(var a=t&&"end"!=t&&function(e,t,r){for(var n=[],i=me(e.first,0),o=i,l=0;l<t.length;l++){var a=t[l],s=Oi(a.from,i,o),u=Oi(Mi(a),i,o);if(i=a.to,o=u,"around"==r){var c=e.sel.ranges[l],f=ve(c.head,c.anchor)<0;n[l]=new Ci(f?u:s,f?s:u)}else n[l]=new Ci(s,s)}return new xi(n,e.sel.primIndex)}(this,n,t),s=n.length-1;s>=0;s--)so(this,n[s]);a?Zi(this,a):this.cm&&An(this.cm)}),undo:ei(function(){co(this,"undo")}),redo:ei(function(){co(this,"redo")}),undoSelection:ei(function(){co(this,"undo",!0)}),redoSelection:ei(function(){co(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new Pi(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Gi(this.history.done),undone:Gi(this.history.undone)}},setHistory:function(e){var t=this.history=new Pi(this.history.maxGeneration);t.done=Gi(e.done.slice(0),null,!0),t.undone=Gi(e.undone.slice(0),null,!0)},setGutterMarker:ei(function(e,t,r){return yo(this,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=r,!r&&re(n)&&(e.gutterMarkers=null),!0})}),clearGutter:ei(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&yo(t,r,"gutter",function(){return r.gutterMarkers[e]=null,re(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!pe(this,e))return null;if(t=e,!(e=se(this,e)))return null}else if(null==(t=de(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:ei(function(e,t,r){return yo(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(S(r).test(e[n]))return!1;e[n]+=" "+r}else e[n]=r;return!0})}),removeLineClass:ei(function(e,t,r){return yo(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[n];if(!i)return!1;if(null==r)e[n]=null;else{var o=i.match(S(r));if(!o)return!1;var l=o.index+o[0].length;e[n]=i.slice(0,o.index)+(o.index&&l!=i.length?" ":"")+i.slice(l)||null}return!0})}),addLineWidget:ei(function(e,t,r){return function(e,t,r,n){var i=new xo(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),yo(e,t,"widget",function(t){var r=t.widgets||(t.widgets=[]);if(null==i.insertAt?r.push(i):r.splice(Math.min(r.length-1,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!Ge(e,t)){var n=Ke(t)<e.scrollTop;fe(t,t.height+Cr(i)),n&&Nn(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&ur(o,"lineWidgetAdded",o,i,"number"==typeof t?t:de(t)),i}(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Mo(this,ke(this,e),ke(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return Mo(this,e=ke(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=se(this,(e=ke(this,e)).line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ke(this,e),t=ke(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];null!=s.to&&i==e.line&&e.ch>=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)null!=r[n].from&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),ke(this,me(r,t))},indexFromPos:function(e){var t=(e=ke(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new Ao(ce(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var n=new Ao(ce(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(ve(o,l)){var a=Mo(e,o,l,n.primary,n.primary.type);n.markers.push(a),a.parent=n}}}(n,To(this)),n},unlinkDoc:function(e){if(e instanceof Tl&&(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),Oo(To(this));break}if(e.history==this.history){var r=[e.id];Hi(e,function(e){return r.push(e.id)},!0),e.history=new Pi(null),e.history.done=Gi(this.history.done,r),e.history.undone=Gi(this.history.undone,r)}},iterLinkedDocs:function(e){Hi(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):xt(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ei(function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Zn(t=this.cm,function(){zi(t),ti(t)}))})}),Ao.prototype.eachLine=Ao.prototype.iter;var Do=0;function Wo(e){var t=this;if(Ho(t),!ot(t,e)&&!kr(t.display,e)){ut(e),l&&(Do=+new Date);var r=fn(t,e,!0),n=e.dataTransfer.files;if(r&&!t.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),a=0,s=function(e,n){if(!t.options.allowDropFileTypes||-1!=B(t.options.allowDropFileTypes,e.type)){var l=new FileReader;l.onload=Jn(t,function(){var e=l.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[n]=e,++a==i){var s={from:r=ke(t.doc,r),to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};so(t.doc,s),Zi(t.doc,Si(r,Mi(s)))}}),l.readAsText(e)}},u=0;u<i;++u)s(n[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var c=e.dataTransfer.getData("Text");if(c){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),Qi(t.doc,Si(r,r)),f)for(var d=0;d<f.length;++d)po(t.doc,"",f[d].anchor,f[d].head,"drag");t.replaceSelection(c,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ho(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Eo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var t=0;t<r.length;t++)e(r[t])})}}var zo=!1;function Po(){var e;zo||(tt(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Eo(Fo)},100))}),tt(window,"blur",function(){return Eo(Cn)}),zo=!0)}function Fo(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ro={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:"/",127:"Delete",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Io=0;Io<10;Io++)Ro[Io+48]=Ro[Io+96]=String(Io);for(var Bo=65;Bo<=90;Bo++)Ro[Bo]=String.fromCharCode(Bo);for(var jo=1;jo<=12;jo++)Ro[jo+111]=Ro[jo+63235]="F"+jo;var Uo={};function Vo(e){var t,r,n,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var l=0;l<o.length-1;l++){var a=o[l];if(/^(cmd|meta|m)$/i.test(a))i=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))r=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);n=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function _o(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==n){delete e[r];continue}for(var i=Y(r.split(" "),Vo),o=0;o<i.length;o++){var l=void 0,a=void 0;o==i.length-1?(a=i.join(" "),l=n):(a=i.slice(0,o+1).join(" "),l="...");var s=t[a];if(s){if(s!=l)throw new Error("Inconsistent bindings for "+a)}else t[a]=l}delete e[r]}for(var u in t)e[u]=t[u];return e}function Go(e,t,r,n){var i=(t=qo(t)).call?t.call(e,n):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&r(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Go(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=Go(e,t.fallthrough[o],r,n);if(l)return l}}}function $o(e){var t="string"==typeof e?e:Ro[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ko(e,t,r){var n=e;return t.altKey&&"Alt"!=n&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=n&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Cmd"!=n&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=n&&(e="Shift-"+e),e}function Xo(e,t){if(f&&34==e.keyCode&&e.char)return!1;var r=Ro[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),Ko(r,e,t))}function qo(e){return"string"==typeof e?Uo[e]:e}function Yo(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&ve(o.from,q(n).to)<=0;){var l=n.pop();if(ve(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Zn(e,function(){for(var t=n.length-1;t>=0;t--)po(e.doc,"",n[t].from,n[t].to,"+delete");An(e)})}function Zo(e,t,r){var n=oe(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Jo(e,t,r){var n=Zo(e,t.ch,r);return null==n?null:new me(t.line,n,r<0?"after":"before")}function Qo(e,t,r,n,i){if(e){var o=Qe(r,t.doc.direction);if(o){var l,a=i<0?q(o):o[0],s=i<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var u=Hr(t,r);l=i<0?r.text.length-1:0;var c=Er(t,u,l).top;l=le(function(e){return Er(t,u,e).top==c},i<0==(1==a.level)?a.from:a.to-1,l),"before"==s&&(l=Zo(r,l,1))}else l=i<0?a.to:a.from;return new me(n,l,s)}}return new me(n,i<0?r.text.length:0,i<0?"before":"after")}Uo.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"},Uo.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"},Uo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Uo.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"]},Uo.default=y?Uo.macDefault:Uo.pcDefault;var el={selectAll:lo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),V)},killLine:function(e){return Yo(e,function(t){if(t.empty()){var r=se(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:me(t.head.line+1,0)}:{from:t.head,to:me(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Yo(e,function(t){return{from:me(t.from().line,0),to:ke(e.doc,me(t.to().line+1,0))}})},delLineLeft:function(e){return Yo(e,function(e){return{from:me(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Yo(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return Yo(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(me(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(me(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return tl(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return rl(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var r=se(e.doc,t),n=function(e){for(var t;t=Ie(e);)e=t.find(1,!0).line;return e}(r);return n!=r&&(t=de(n)),Qo(!0,e,r,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},G)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},G)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?rl(e,t.head):n},G)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=R(e.getLine(o.line),o.ch,n);t.push(X(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Zn(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,o=se(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new me(i.line,i.ch-1)),i.ch>0)i=new me(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),me(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=se(e.doc,i.line-1).text;l&&(i=new me(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),me(i.line-1,l.length-1),i,"+transpose"))}r.push(new Ci(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return Zn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);An(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function tl(e,t){var r=se(e.doc,t),n=Ue(r);return n!=r&&(t=de(n)),Qo(!0,e,n,t,1)}function rl(e,t){var r=tl(e,t.line),n=se(e.doc,r.line),i=Qe(n,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return me(r.line,l?0:o,r.sticky)}return r}function nl(e,t,r){if("string"==typeof t&&!(t=el[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=U}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}var il=new I;function ol(e,t,r,n){var i=e.state.keySeq;if(i){if($o(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:il.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ll(e,i+" "+t,r,n))return!0}return ll(e,t,r,n)}function ll(e,t,r,n){var i=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Go(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Go(t,e.options.extraKeys,r,e)||Go(t,e.options.keyMap,r,e)}(e,t,n);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&ur(e,"keyHandled",e,t,r),"handled"!=i&&"multi"!=i||(ut(r),yn(e)),!!i}function al(e,t){var r=Xo(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ol(e,"Shift-"+r,t,function(t){return nl(e,t,!0)})||ol(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return nl(e,t)}):ol(e,r,t,function(t){return nl(e,t)}))}var sl=null;function ul(e){var t=this;if(t.curOp.focus=W(),!ot(t,e)){l&&a<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=al(t,e);f&&(sl=n?r:null,!n&&88==r&&!kt&&(y?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function r(e){18!=e.keyCode&&e.altKey||(L(t,"CodeMirror-crosshair"),nt(document,"keyup",r),nt(document,"mouseover",r))}H(t,"CodeMirror-crosshair"),tt(document,"keyup",r),tt(document,"mouseover",r)}(t)}}function cl(e){16==e.keyCode&&(this.doc.sel.shift=!1),ot(this,e)}function fl(e){var t=this;if(!(kr(t.display,e)||ot(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(f&&r==sl)return sl=null,void ut(e);if(!f||e.which&&!(e.which<10)||!al(t,e)){var i=String.fromCharCode(null==n?r:n);"\b"!=i&&(function(e,t,r){return ol(e,"'"+r+"'",t,function(t){return nl(e,t,!0)})}(t,e,i)||t.display.input.onKeyPress(e))}}}var dl,hl,pl=function(e,t,r){this.time=e,this.pos=t,this.button=r};function gl(e){var t=this,r=t.display;if(!(ot(t,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,kr(r,e))s||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!yl(t,e)){var n=fn(t,e),i=pt(e),o=n?function(e,t){var r=+new Date;return hl&&hl.compare(r,e,t)?(dl=hl=null,"triple"):dl&&dl.compare(r,e,t)?(hl=new pl(r,e,t),dl=null,"double"):(dl=new pl(r,e,t),hl=null,"single")}(n,i):"single";window.focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),n&&function(e,t,r,n,i){var o="Click";return"double"==n?o="Double"+o:"triple"==n&&(o="Triple"+o),ol(e,Ko(o=(1==t?"Left":2==t?"Middle":"Right")+o,i),i,function(t){if("string"==typeof t&&(t=el[t]),!t)return!1;var n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n=t(e,r)!=U}finally{e.state.suppressEdits=!1}return n})}(t,i,n,o,e)||(1==i?n?function(e,t,r,n){l?setTimeout(P(bn,e),0):e.curOp.focus=W();var i,o=function(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(null==i.unit){var o=b?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),null==i.addNew&&(i.addNew=y?r.metaKey:r.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(y?r.altKey:r.ctrlKey)),i}(e,r,n),u=e.doc.sel;e.options.dragDrop&&vt&&!e.isReadOnly()&&"single"==r&&(i=u.contains(t))>-1&&(ve((i=u.ranges[i]).from(),t)<0||t.xRel>0)&&(ve(i.to(),t)>0||t.xRel<0)?function(e,t,r,n){var i=e.display,o=!1,u=Jn(e,function(t){s&&(i.scroller.draggable=!1),e.state.draggingText=!1,nt(i.wrapper.ownerDocument,"mouseup",u),nt(i.wrapper.ownerDocument,"mousemove",c),nt(i.scroller,"dragstart",f),nt(i.scroller,"drop",u),o||(ut(t),n.addNew||Ki(e.doc,r,null,null,n.extend),s||l&&9==a?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),c=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},f=function(){return o=!0};s&&(i.scroller.draggable=!0),e.state.draggingText=u,u.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),tt(i.wrapper.ownerDocument,"mouseup",u),tt(i.wrapper.ownerDocument,"mousemove",c),tt(i.scroller,"dragstart",f),tt(i.scroller,"drop",u),wn(e),setTimeout(function(){return i.input.focus()},20)}(e,n,t,o):function(e,t,r,n){var i=e.display,o=e.doc;ut(t);var l,a,s=o.sel,u=s.ranges;if(n.addNew&&!n.extend?(a=o.sel.contains(r),l=a>-1?u[a]:new Ci(r,r)):(l=o.sel.primary(),a=o.sel.primIndex),"rectangle"==n.unit)n.addNew||(l=new Ci(r,r)),r=fn(e,t,!0,!0),a=-1;else{var c=ml(e,r,n.unit);l=n.extend?$i(l,c.anchor,c.head,n.extend):c}n.addNew?-1==a?(a=u.length,Ji(o,ki(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&"char"==n.unit&&!n.extend?(Ji(o,ki(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):qi(o,a,l,_):(a=0,Ji(o,new xi([l],0),_),s=o.sel);var f=r;function d(t){if(0!=ve(f,t))if(f=t,"rectangle"==n.unit){for(var i=[],u=e.options.tabSize,c=R(se(o,r.line).text,r.ch,u),d=R(se(o,t.line).text,t.ch,u),h=Math.min(c,d),p=Math.max(c,d),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=se(o,g).text,y=$(v,h,u);h==p?i.push(new Ci(me(g,y),me(g,y))):v.length>y&&i.push(new Ci(me(g,y),me(g,$(v,p,u))))}i.length||i.push(new Ci(r,r)),Ji(o,ki(e,s.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=l,x=ml(e,t,n.unit),C=w.anchor;ve(x.anchor,C)>0?(b=x.head,C=xe(w.from(),x.anchor)):(b=x.anchor,C=we(w.to(),x.head));var k=s.ranges.slice(0);k[a]=function(e,t){var r=t.anchor,n=t.head,i=se(e.doc,r.line);if(0==ve(r,n)&&r.sticky==n.sticky)return t;var o=Qe(i);if(!o)return t;var l=Ze(o,r.ch,r.sticky),a=o[l];if(a.from!=r.ch&&a.to!=r.ch)return t;var s,u=l+(a.from==r.ch==(1!=a.level)?0:1);if(0==u||u==o.length)return t;if(n.line!=r.line)s=(n.line-r.line)*("ltr"==e.doc.direction?1:-1)>0;else{var c=Ze(o,n.ch,n.sticky),f=c-l||(n.ch-r.ch)*(1==a.level?-1:1);s=c==u-1||c==u?f<0:f>0}var d=o[u+(s?-1:0)],h=s==(1==d.level),p=h?d.from:d.to,g=h?"after":"before";return r.ch==p&&r.sticky==g?t:new Ci(new me(r.line,p,g),n)}(e,new Ci(ke(o,C),b)),Ji(o,ki(e,k,a),_)}}var h=i.wrapper.getBoundingClientRect(),p=0;function g(t){e.state.selectingText=!1,p=1/0,ut(t),i.input.focus(),nt(i.wrapper.ownerDocument,"mousemove",m),nt(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var m=Jn(e,function(t){0!==t.buttons&&pt(t)?function t(r){var l=++p,a=fn(e,r,!0,"rectangle"==n.unit);if(a)if(0!=ve(a,f)){e.curOp.focus=W(),d(a);var s=Mn(i,o);(a.line>=s.to||a.line<s.from)&&setTimeout(Jn(e,function(){p==l&&t(r)}),150)}else{var u=r.clientY<h.top?-20:r.clientY>h.bottom?20:0;u&&setTimeout(Jn(e,function(){p==l&&(i.scroller.scrollTop+=u,t(r))}),50)}}(t):g(t)}),v=Jn(e,g);e.state.selectingText=v,tt(i.wrapper.ownerDocument,"mousemove",m),tt(i.wrapper.ownerDocument,"mouseup",v)}(e,n,t,o)}(t,n,o,e):ht(e)==r.scroller&&ut(e):2==i?(n&&Ki(t.doc,n),setTimeout(function(){return r.input.focus()},20)):3==i&&(k?t.display.input.onContextMenu(e):wn(t)))}}function ml(e,t,r){if("char"==r)return new Ci(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new Ci(me(t.line,0),ke(e.doc,me(t.line+1,0)));var n=r(e,t);return new Ci(n.from,n.to)}function vl(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ut(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!at(e,r))return ft(t);o-=a.top-l.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var u=l.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i)return it(e,r,e,he(e.doc,o),e.options.gutters[s],t),ft(t)}}function yl(e,t){return vl(e,t,"gutterClick",!0)}function bl(e,t){kr(e.display,t)||function(e,t){return!!at(e,"gutterContextMenu")&&vl(e,t,"gutterContextMenu",!1)}(e,t)||ot(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function wl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),jr(e)}pl.prototype.compare=function(e,t,r){return this.time+400>e&&0==ve(t,this.pos)&&r==this.button};var xl={toString:function(){return"CodeMirror.Init"}},Cl={},kl={};function Sl(e){pi(e),ti(e),Ln(e)}function Ml(e,t,r){if(!t!=!(r&&r!=xl)){var n=e.display.dragFunctions,i=t?tt:nt;i(e.display.scroller,"dragstart",n.start),i(e.display.scroller,"dragenter",n.enter),i(e.display.scroller,"dragover",n.over),i(e.display.scroller,"dragleave",n.leave),i(e.display.scroller,"drop",n.drop)}}function Ll(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"CodeMirror-wrap"),qe(e)),cn(e),ti(e),jr(e),setTimeout(function(){return Bn(e)},100)}function Tl(e,t){var r=this;if(!(this instanceof Tl))return new Tl(e,t);this.options=t=t?F(t):{},F(Cl,t,!1),gi(t);var n=t.value;"string"==typeof n?n=new Ao(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Tl.inputStyles[t.inputStyle](this),o=this.display=new ae(e,n,i);for(var u in o.wrapper.CodeMirror=this,pi(this),wl(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Vn(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 I,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),l&&a<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;tt(t.scroller,"mousedown",Jn(e,gl)),tt(t.scroller,"dblclick",l&&a<11?Jn(e,function(t){if(!ot(e,t)){var r=fn(e,t);if(r&&!yl(e,t)&&!kr(e.display,t)){ut(t);var n=e.findWordAt(r);Ki(e.doc,n.anchor,n.head)}}}):function(t){return ot(e,t)||ut(t)}),tt(t.scroller,"contextmenu",function(t){return bl(e,t)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),(n=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return!0;var r=t.left-e.left,n=t.top-e.top;return r*r+n*n>400}tt(t.scroller,"touchstart",function(i){if(!ot(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!yl(e,i)){t.input.ensurePolled(),clearTimeout(r);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-n.end<=300?n:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),tt(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),tt(t.scroller,"touchend",function(r){var n=t.activeTouch;if(n&&!kr(t,r)&&null!=n.left&&!n.moved&&new Date-n.start<300){var l,a=e.coordsChar(t.activeTouch,"page");l=!n.prev||o(n,n.prev)?new Ci(a,a):!n.prev.prev||o(n,n.prev.prev)?e.findWordAt(a):new Ci(me(a.line,0),ke(e.doc,me(a.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),ut(r)}i()}),tt(t.scroller,"touchcancel",i),tt(t.scroller,"scroll",function(){t.scroller.clientHeight&&(En(e,t.scroller.scrollTop),Pn(e,t.scroller.scrollLeft,!0),it(e,"scroll",e))}),tt(t.scroller,"mousewheel",function(t){return wi(e,t)}),tt(t.scroller,"DOMMouseScroll",function(t){return wi(e,t)}),tt(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){ot(e,t)||dt(t)},over:function(t){ot(e,t)||(function(e,t){var r=fn(e,t);if(r){var n=document.createDocumentFragment();gn(e,r,n),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,n)}}(e,t),dt(t))},start:function(t){return function(e,t){if(l&&(!e.state.draggingText||+new Date-Do<100))dt(t);else if(!ot(e,t)&&!kr(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var r=N("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),f&&r.parentNode.removeChild(r)}}(e,t)},drop:Jn(e,Wo),leave:function(t){ot(e,t)||Ho(e)}};var s=t.input.getField();tt(s,"keyup",function(t){return cl.call(e,t)}),tt(s,"keydown",Jn(e,ul)),tt(s,"keypress",Jn(e,fl)),tt(s,"focus",function(t){return xn(e,t)}),tt(s,"blur",function(t){return Cn(e,t)})}(this),Po(),Gn(this),this.curOp.forceUpdate=!0,Ei(this,n),t.autofocus&&!v||this.hasFocus()?setTimeout(P(xn,this),20):Cn(this),kl)kl.hasOwnProperty(u)&&kl[u](r,t[u],xl);Tn(this),t.finishInit&&t.finishInit(this);for(var c=0;c<Ol.length;++c)Ol[c](r);$n(this),s&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}Tl.defaults=Cl,Tl.optionHandlers=kl;var Ol=[];function Nl(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=Bt(e,t).state:r="prev");var l=e.options.tabSize,a=se(o,t),s=R(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u,c=a.text.match(/^\s*/)[0];if(n||/\S/.test(a.text)){if("smart"==r&&((u=o.mode.indent(i,a.text.slice(c.length),a.text))==U||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?R(se(o,t-1).text,null,l):0:"add"==r?u=s+e.options.indentUnit:"subtract"==r?u=s-e.options.indentUnit:"number"==typeof r&&(u=s+r),u=Math.max(0,u);var f="",d=0;if(e.options.indentWithTabs)for(var h=Math.floor(u/l);h;--h)d+=l,f+="\t";if(d<u&&(f+=X(u-d)),f!=c)return po(o,f,me(t,0),me(t,c.length),"+input"),a.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<c.length){var m=me(t,c.length);qi(o,p,new Ci(m,m));break}}}Tl.defineInitHook=function(e){return Ol.push(e)};var Al=null;function Dl(e){Al=e}function Wl(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=e.state.pasteIncoming||"paste"==i,a=xt(t),s=null;if(l&&n.ranges.length>1)if(Al&&Al.text.join("\n")==t){if(n.ranges.length%Al.text.length==0){s=[];for(var u=0;u<Al.text.length;u++)s.push(o.splitLines(Al.text[u]))}}else a.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(s=Y(a,function(e){return[e]}));for(var c=e.curOp.updateInput,f=n.ranges.length-1;f>=0;f--){var d=n.ranges[f],h=d.from(),p=d.to();d.empty()&&(r&&r>0?h=me(h.line,h.ch-r):e.state.overwrite&&!l?p=me(p.line,Math.min(se(o,p.line).text.length,p.ch+q(a).length)):l&&Al&&Al.lineWise&&Al.text.join("\n")==t&&(h=p=me(h.line,0)));var g={from:h,to:p,text:s?s[f%s.length]:a,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};so(e.doc,g),ur(e,"inputRead",e,g)}t&&!l&&El(e,t),An(e),e.curOp.updateInput<2&&(e.curOp.updateInput=c),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Hl(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Zn(t,function(){return Wl(t,r,0,null,"paste")}),!0}function El(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=Nl(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Nl(e,i.head.line,"smart"));l&&ur(e,"electricInput",e,i.head.line)}}}function zl(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:me(i,0),head:me(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Pl(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function Fl(){var e=N("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=N("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return s?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Pl(e),t}function Rl(e,t,r,n,i){var o=t,l=r,a=se(e,t.line);function s(n){var o,l;if(null==(o=i?function(e,t,r,n){var i=Qe(t,e.doc.direction);if(!i)return Jo(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=Ze(i,r.ch,r.sticky),l=i[o];if("ltr"==e.doc.direction&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return Jo(t,r,n);var a,s=function(e,r){return Zo(t,e instanceof me?e.ch:e,r)},u=function(r){return e.options.lineWrapping?(a=a||Hr(e,t),Qr(e,t,a,r)):{begin:0,end:t.text.length}},c=u("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==l.level){var f=1==l.level==n<0,d=s(r,f?1:-1);if(null!=d&&(f?d<=l.to&&d<=c.end:d>=l.from&&d>=c.begin)){var h=f?"before":"after";return new me(r.line,d,h)}}var p=function(e,t,n){for(var o=function(e,t){return t?new me(r.line,s(e,1),"before"):new me(r.line,e,"after")};e>=0&&e<i.length;e+=t){var l=i[e],a=t>0==(1!=l.level),u=a?n.begin:s(n.end,-1);if(l.from<=u&&u<l.to)return o(u,a);if(u=a?l.from:s(l.to,-1),n.begin<=u&&u<n.end)return o(u,a)}},g=p(o+n,n,c);if(g)return g;var m=n>0?c.end:s(c.begin,-1);return null==m||n>0&&m==t.text.length||!(g=p(n>0?0:i.length-1,n,u(m)))?null:g}(e.cm,a,t,r):Jo(a,t,r))){if(n||(l=t.line+r)<e.first||l>=e.first+e.size||(t=new me(l,t.ch,t.sticky),!(a=se(e,l))))return!1;t=Qo(i,e.cm,a,t.line,r)}else t=o;return!0}if("char"==n)s();else if("column"==n)s(!0);else if("word"==n||"group"==n)for(var u=null,c="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(r<0)||s(!d);d=!1){var h=a.text.charAt(t.ch)||"\n",p=te(h,f)?"w":c&&"\n"==h?"n":!c||/\s/.test(h)?null:"p";if(!c||d||p||(p="s"),u&&u!=p){r<0&&(r=1,s(),t.sticky="after");break}if(p&&(u=p),r>0&&!s(!d))break}var g=io(e,t,o,l,!0);return ye(o,g)&&(g.hitSide=!0),g}function Il(e,t,r,n){var i,o,l=e.doc,a=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(s-.5*on(e.display),3);i=(r>0?t.bottom:t.top)+r*u}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(;(o=Zr(e,a,i)).outside;){if(r<0?i<=0:i>=l.height){o.hitSide=!0;break}i+=5*r}return o}var Bl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function jl(e,t){var r=Wr(e,t.line);if(!r||r.hidden)return null;var n=se(e.doc,t.line),i=Ar(r,n,t.line),o=Qe(n,e.doc.direction),l="left";o&&(l=Ze(o,t.ch)%2?"right":"left");var a=Fr(i.map,t.ch,l);return a.offset="right"==a.collapse?a.end:a.start,a}function Ul(e,t){return t&&(e.bad=!0),e}function Vl(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Ul(e.clipPos(me(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return _l(o,t,r)}}function _l(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!D(n,t))return Ul(me(de(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?q(e.rest):e.line;return Ul(me(de(o),o.text.length),i)}var l=3==t.nodeType?t:null,a=t;for(l||1!=t.childNodes.length||3!=t.firstChild.nodeType||(l=t.firstChild,r&&(r=l.nodeValue.length));a.parentNode!=n;)a=a.parentNode;var s=e.measure,u=s.maps;function c(t,r,n){for(var i=-1;i<(u?u.length:0);i++)for(var o=i<0?s.map:u[i],l=0;l<o.length;l+=3){var a=o[l+2];if(a==t||a==r){var c=de(i<0?e.line:e.rest[i]),f=o[l]+n;return(n<0||a!=t)&&(f=o[l+(n?1:0)]),me(c,f)}}}var f=c(l,a,r);if(f)return Ul(f,i);for(var d=a.nextSibling,h=l?l.nodeValue.length-r:0;d;d=d.nextSibling){if(f=c(d,d.firstChild,0))return Ul(me(f.line,f.ch-h),i);h+=d.textContent.length}for(var p=a.previousSibling,g=r;p;p=p.previousSibling){if(f=c(p,p.firstChild,-1))return Ul(me(f.line,f.ch+g),i);g+=p.textContent.length}}Bl.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;function o(e){if(!ot(n,e)){if(n.somethingSelected())Dl({lineWise:!1,text:n.getSelections()}),"cut"==e.type&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var t=zl(n);Dl({lineWise:!0,text:t.text}),"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,V),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=Al.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var l=Fl(),a=l.firstChild;n.display.lineSpace.insertBefore(l,n.display.lineSpace.firstChild),a.value=Al.text.join("\n");var s=document.activeElement;z(a),setTimeout(function(){n.display.lineSpace.removeChild(l),s.focus(),s==i&&r.showPrimarySelection()},50)}}Pl(i,n.options.spellcheck),tt(i,"paste",function(e){ot(n,e)||Hl(e,n)||a<=11&&setTimeout(Jn(n,function(){return t.updateFromDOM()}),20)}),tt(i,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),tt(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),tt(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),tt(i,"touchstart",function(){return r.forceCompositionEnd()}),tt(i,"input",function(){t.composing||t.readFromDOMSoon()}),tt(i,"copy",o),tt(i,"cut",o)},Bl.prototype.prepareSelection=function(){var e=pn(this.cm,!1);return e.focus=this.cm.state.focused,e},Bl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Bl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Bl.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),i=n.from(),o=n.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var l=Vl(t,e.anchorNode,e.anchorOffset),a=Vl(t,e.focusNode,e.focusOffset);if(!l||l.bad||!a||a.bad||0!=ve(xe(l,a),i)||0!=ve(we(l,a),o)){var s=t.display.view,u=i.line>=t.display.viewFrom&&jl(t,i)||{node:s[0].measure.map[2],offset:0},c=o.line<t.display.viewTo&&jl(t,o);if(!c){var f=s[s.length-1].measure,d=f.maps?f.maps[f.maps.length-1]:f.map;c={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(u&&c){var h,p=e.rangeCount&&e.getRangeAt(0);try{h=M(u.node,u.offset,c.offset,c.node)}catch(e){}h&&(!r&&t.state.focused?(e.collapse(u.node,u.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),p&&null==e.anchorNode?e.addRange(p):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},Bl.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)},Bl.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Bl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Bl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},Bl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},Bl.prototype.blur=function(){this.div.blur()},Bl.prototype.getField=function(){return this.div},Bl.prototype.supportsTouch=function(){return!0},Bl.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Zn(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},Bl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Bl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(m&&c&&this.cm.options.gutters.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 r=Vl(t,e.anchorNode,e.anchorOffset),n=Vl(t,e.focusNode,e.focusOffset);r&&n&&Zn(t,function(){Ji(t.doc,Si(r,n),V),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Bl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,n=this.cm,i=n.display,o=n.doc.sel.primary(),l=o.from(),a=o.to();if(0==l.ch&&l.line>n.firstLine()&&(l=me(l.line-1,se(n.doc,l.line-1).length)),a.ch==se(n.doc,a.line).text.length&&a.line<n.lastLine()&&(a=me(a.line+1,0)),l.line<i.viewFrom||a.line>i.viewTo-1)return!1;l.line==i.viewFrom||0==(e=dn(n,l.line))?(t=de(i.view[0].line),r=i.view[0].node):(t=de(i.view[e].line),r=i.view[e-1].node.nextSibling);var s,u,c=dn(n,a.line);if(c==i.view.length-1?(s=i.viewTo-1,u=i.lineDiv.lastChild):(s=de(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!r)return!1;for(var f=n.doc.splitLines(function(e,t,r,n,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(){l&&(o+=a,s&&(o+=a),l=s=!1)}function c(e){e&&(u(),o+=e)}function f(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void c(r);var o,d=t.getAttribute("cm-marker");if(d){var h=e.findMarks(me(n,0),me(i+1,0),(m=+d,function(e){return e.id==m}));return void(h.length&&(o=h[0].find(0))&&c(ue(e.doc,o.from,o.to).join(a)))}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&&u();for(var g=0;g<t.childNodes.length;g++)f(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(s=!0),p&&(l=!0)}else 3==t.nodeType&&c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;f(t),t!=r;)t=t.nextSibling,s=!1;return o}(n,r,u,t,s)),d=ue(n.doc,me(t,0),me(s,se(n.doc,s).text.length));f.length>1&&d.length>1;)if(q(f)==q(d))f.pop(),d.pop(),s--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),t++}for(var h=0,p=0,g=f[0],m=d[0],v=Math.min(g.length,m.length);h<v&&g.charCodeAt(h)==m.charCodeAt(h);)++h;for(var y=q(f),b=q(d),w=Math.min(y.length-(1==f.length?h:0),b.length-(1==d.length?h:0));p<w&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)++p;if(1==f.length&&1==d.length&&t==l.line)for(;h&&h>l.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;f[f.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),f[0]=f[0].slice(h).replace(/\u200b+$/,"");var x=me(t,h),C=me(s,d.length?q(d).length-p:0);return f.length>1||f[0]||ve(x,C)?(po(n.doc,f,x,C,"+input"),!0):void 0},Bl.prototype.ensurePolled=function(){this.forceCompositionEnd()},Bl.prototype.reset=function(){this.forceCompositionEnd()},Bl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Bl.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))},Bl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Zn(this.cm,function(){return ti(e.cm)})},Bl.prototype.setUneditable=function(e){e.contentEditable="false"},Bl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Jn(this.cm,Wl)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Bl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Bl.prototype.onContextMenu=function(){},Bl.prototype.resetPosition=function(){},Bl.prototype.needsContentAttribute=!0;var Gl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};Gl.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ot(n,e)){if(n.somethingSelected())Dl({lineWise:!1,text:n.getSelections()});else{if(!n.options.lineWiseCopyCut)return;var t=zl(n);Dl({lineWise:!0,text:t.text}),"cut"==e.type?n.setSelections(t.ranges,null,V):(r.prevInput="",i.value=t.text.join("\n"),z(i))}"cut"==e.type&&(n.state.cutIncoming=!0)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),tt(i,"input",function(){l&&a>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),tt(i,"paste",function(e){ot(n,e)||Hl(e,n)||(n.state.pasteIncoming=!0,r.fastPoll())}),tt(i,"cut",o),tt(i,"copy",o),tt(e.scroller,"paste",function(t){kr(e,t)||ot(n,t)||(n.state.pasteIncoming=!0,r.focus())}),tt(e.lineSpace,"selectstart",function(t){kr(e,t)||ut(t)}),tt(i,"compositionstart",function(){var e=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),tt(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},Gl.prototype.createField=function(e){this.wrapper=Fl(),this.textarea=this.wrapper.firstChild},Gl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=pn(e);if(e.options.moveInputWithCursor){var i=Xr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},Gl.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")},Gl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&z(this.textarea),l&&a>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",l&&a>=9&&(this.hasSelection=null))}},Gl.prototype.getField=function(){return this.textarea},Gl.prototype.supportsTouch=function(){return!1},Gl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},Gl.prototype.blur=function(){this.textarea.blur()},Gl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Gl.prototype.receivedFocus=function(){this.slowPoll()},Gl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Gl.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))})},Gl.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ct(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(l&&a>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var s=0,u=Math.min(n.length,i.length);s<u&&n.charCodeAt(s)==i.charCodeAt(s);)++s;return Zn(t,function(){Wl(t,i.slice(s),n.length-s,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Gl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Gl.prototype.onKeyPress=function(){l&&a>=9&&(this.hasSelection=null),this.fastPoll()},Gl.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=fn(r,e),u=n.scroller.scrollTop;if(o&&!f){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(o)&&Jn(r,Ji)(r.doc,Si(o),V);var c,d=i.style.cssText,h=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);",s&&(c=window.scrollY),n.input.focus(),s&&window.scrollTo(null,c),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll),l&&a>=9&&m(),k){dt(e);var g=function(){nt(window,"mouseup",g),setTimeout(v,20)};tt(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var e=r.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,n.selForContextMenu=r.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=d,l&&a<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=u),null!=i.selectionStart)){(!l||l&&a<9)&&m();var e=0,o=function(){n.selForContextMenu==r.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Jn(r,lo)(r):e++<10?n.detectingSelectAll=setTimeout(o,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(o,200)}}},Gl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},Gl.prototype.setUneditable=function(){},Gl.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function r(r,n,i,o){e.defaults[r]=n,i&&(t[r]=o?function(e,t,r){r!=xl&&i(e,t,r)}:i)}e.defineOption=r,e.Init=xl,r("value","",function(e,t){return e.setValue(t)},!0),r("mode",null,function(e,t){e.doc.modeOption=t,Ni(e)},!0),r("indentUnit",2,Ni,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(e){Ai(e),jr(e),ti(e)},!0),r("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,r.push(me(n,o))}n++});for(var i=r.length-1;i>=0;i--)po(e.doc,t,r[i],me(r[i].line,r[i].ch+t.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=xl&&e.refresh()}),r("specialCharPlaceholder",er,function(e){return e.refresh()},!0),r("electricChars",!0),r("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),r("rtlMoveVisually",!w),r("wholeLineUpdateBefore",!0),r("theme","default",function(e){wl(e),Sl(e)},!0),r("keyMap","default",function(e,t,r){var n=qo(t),i=r!=xl&&qo(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Ll,!0),r("gutters",[],function(e){gi(e.options),Sl(e)},!0),r("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?sn(e.display)+"px":"0",e.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(e){return Bn(e)},!0),r("scrollbarStyle","native",function(e){Vn(e),Bn(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),r("lineNumbers",!1,function(e){gi(e.options),Sl(e)},!0),r("firstLineNumber",1,Sl,!0),r("lineNumberFormatter",function(e){return e},Sl,!0),r("showCursorWhenSelecting",!1,hn,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(e,t){"nocursor"==t&&(Cn(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),r("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),r("dragDrop",!0,Ml),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,hn,!0),r("singleCursorHeightPerLine",!0,hn,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Ai,!0),r("addModeClass",!1,Ai,!0),r("pollInterval",100),r("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),r("historyEventDelay",1250),r("viewportMargin",10,function(e){return e.refresh()},!0),r("maxHighlightLength",1e4,Ai,!0),r("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),r("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),r("autofocus",null),r("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),r("phrases",null)}(Tl),function(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,r){var n=this.options,i=n[e];n[e]==r&&"mode"!=e||(n[e]=r,t.hasOwnProperty(e)&&Jn(this,t[e])(this,r,i),it(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"](qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Qn(function(t,r){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}(this.state.overlays,{mode:n,modeSpec:t,opaque:r&&r.opaque,priority:r&&r.priority||0},function(e){return e.priority}),this.state.modeGen++,ti(this)}),removeOverlay:Qn(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var n=t[r].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(r,1),this.state.modeGen++,void ti(this)}}),indentLine:Qn(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),pe(this.doc,e)&&Nl(this,e,t,r)}),indentSelection:Qn(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++){var i=t[n];if(i.empty())i.head.line>r&&(Nl(this,i.head.line,e,!0),r=i.head.line,n==this.doc.sel.primIndex&&An(this));else{var o=i.from(),l=i.to(),a=Math.max(r,o.line);r=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1;for(var s=a;s<r;++s)Nl(this,s,e);var u=this.doc.sel.ranges;0==o.ch&&t.length==u.length&&u[n].from().ch>0&&qi(this.doc,n,new Ci(o,u[n].to()),V)}}}),getTokenAt:function(e,t){return Gt(this,e,t)},getLineTokens:function(e,t){return Gt(this,me(e),t,!0)},getTokenTypeAt:function(e){e=ke(this.doc,e);var t,r=It(this,se(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]<o)){t=r[2*l+2];break}n=l+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var r=this.doc.mode;return r.innerMode?e.innerMode(r,this.getTokenAt(t).state).mode:r},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!r.hasOwnProperty(t))return n;var i=r[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&n.push(i[o[t]]);else if(o[t])for(var l=0;l<o[t].length;l++){var a=i[o[t][l]];a&&n.push(a)}else o.helperType&&i[o.helperType]?n.push(i[o.helperType]):i[o.name]&&n.push(i[o.name]);for(var s=0;s<i._global.length;s++){var u=i._global[s];u.pred(o,this)&&-1==B(n,u.val)&&n.push(u.val)}return n},getStateAfter:function(e,t){var r=this.doc;return Bt(this,(e=Ce(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Xr(this,null==e?r.head:"object"==typeof e?ke(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Kr(this,ke(this.doc,e),t||"page")},coordsChar:function(e,t){return Zr(this,(e=$r(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=$r(this,{top:e,left:0},t||"page").top,he(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),n=se(this.doc,e)}else n=e;return Gr(this,n,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-Ke(n):0)},defaultTextHeight:function(){return on(this.display)},defaultCharWidth:function(){return ln(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,l,a,s=this.display,u=(e=Xr(this,ke(this.doc,e))).bottom,c=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==n)u=e.top;else if("above"==n||"near"==n){var f=Math.max(s.wrapper.clientHeight,this.doc.height),d=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>f)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=f&&(u=e.bottom),c+t.offsetWidth>d&&(c=d-t.offsetWidth)}t.style.top=u+"px",t.style.left=t.style.right="","right"==i?(c=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(o=this,l={left:c,top:u,right:c+t.offsetWidth,bottom:u+t.offsetHeight},null!=(a=On(o,l)).scrollTop&&En(o,a.scrollTop),null!=a.scrollLeft&&Pn(o,a.scrollLeft))},triggerOnKeyDown:Qn(ul),triggerOnKeyPress:Qn(fl),triggerOnKeyUp:cl,triggerOnMouseDown:Qn(gl),execCommand:function(e){if(el.hasOwnProperty(e))return el[e].call(null,this)},triggerElectric:Qn(function(e){El(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);for(var o=ke(this.doc,e),l=0;l<t&&!(o=Rl(this.doc,o,i,r,n)).hitSide;++l);return o},moveH:Qn(function(e,t){var r=this;this.extendSelectionsBy(function(n){return r.display.shift||r.doc.extend||n.empty()?Rl(r.doc,n.head,e,t,r.options.rtlMoveVisually):e<0?n.from():n.to()},G)}),deleteH:Qn(function(e,t){var r=this.doc.sel,n=this.doc;r.somethingSelected()?n.replaceSelection("",null,"+delete"):Yo(this,function(r){var i=Rl(n,r.head,e,t,!1);return e<0?{from:i,to:r.head}:{from:r.head,to:i}})}),findPosV:function(e,t,r,n){var i=1,o=n;t<0&&(i=-1,t=-t);for(var l=ke(this.doc,e),a=0;a<t;++a){var s=Xr(this,l,"div");if(null==o?o=s.left:s.left=o,(l=Il(this,s,i,r)).hitSide)break}return l},moveV:Qn(function(e,t){var r=this,n=this.doc,i=[],o=!this.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(l){if(o)return e<0?l.from():l.to();var a=Xr(r,l.head,"div");null!=l.goalColumn&&(a.left=l.goalColumn),i.push(a.left);var s=Il(r,a,e,t);return"page"==t&&l==n.sel.primary()&&Nn(r,Kr(r,s,"div").top-a.top),s},G),i.length)for(var l=0;l<n.sel.ranges.length;l++)n.sel.ranges[l].goalColumn=i[l]}),findWordAt:function(e){var t=se(this.doc,e.line).text,r=e.ch,n=e.ch;if(t){var i=this.getHelper(e,"wordChars");"before"!=e.sticky&&n!=t.length||!r?++n:--r;for(var o=t.charAt(r),l=te(o,i)?function(e){return te(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};r>0&&l(t.charAt(r-1));)--r;for(;n<t.length&&l(t.charAt(n));)++n}return new Ci(me(e.line,r),me(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):L(this.display.cursorDiv,"CodeMirror-overwrite"),it(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Qn(function(e,t){Dn(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Tr(this)-this.display.barHeight,width:e.scrollWidth-Tr(this)-this.display.barWidth,clientHeight:Nr(this),clientWidth:Or(this)}},scrollIntoView:Qn(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:me(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){Wn(e),e.curOp.scrollToPos=t}(this,e):Hn(this,e.from,e.to,e.margin)}),setSize:Qn(function(e,t){var r=this,n=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=n(e)),null!=t&&(this.display.wrapper.style.height=n(t)),this.options.lineWrapping&&Br(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){ri(r,i,"widget");break}++i}),this.curOp.forceUpdate=!0,it(this,"refresh",this)}),operation:function(e){return Zn(this,e)},startOperation:function(){return Gn(this)},endOperation:function(){return $n(this)},refresh:Qn(function(){var e=this.display.cachedTextHeight;ti(this),this.curOp.forceUpdate=!0,jr(this),Dn(this,this.doc.scrollLeft,this.doc.scrollTop),di(this),(null==e||Math.abs(e-on(this.display))>.5)&&cn(this),it(this,"refresh",this)}),swapDoc:Qn(function(e){var t=this.doc;return t.cm=null,Ei(this,e),jr(this),this.display.input.reset(),Dn(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ur(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}},st(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}(Tl);var $l="iter insert remove copy getEditor constructor".split(" ");for(var Kl in Ao.prototype)Ao.prototype.hasOwnProperty(Kl)&&B($l,Kl)<0&&(Tl.prototype[Kl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ao.prototype[Kl]));return st(Ao),Tl.inputStyles={textarea:Gl,contenteditable:Bl},Tl.defineMode=function(e){Tl.defaults.mode||"null"==e||(Tl.defaults.mode=e),Tt.apply(this,arguments)},Tl.defineMIME=function(e,t){Lt[e]=t},Tl.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Tl.defineMIME("text/plain","null"),Tl.defineExtension=function(e,t){Tl.prototype[e]=t},Tl.defineDocExtension=function(e,t){Ao.prototype[e]=t},Tl.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var r=W();t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body}function n(){e.value=a.getValue()}var i;if(e.form&&(tt(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch(e){}}t.finishInit=function(t){t.save=n,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,n(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(nt(e.form,"submit",n),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var a=Tl(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a},function(e){e.off=nt,e.on=tt,e.wheelEventPixels=bi,e.Doc=Ao,e.splitLines=xt,e.countColumn=R,e.findColumn=$,e.isWordChar=ee,e.Pass=U,e.signal=it,e.Line=Xt,e.changeEnd=Mi,e.scrollbarModel=Un,e.Pos=me,e.cmpPos=ve,e.modes=Mt,e.mimeModes=Lt,e.resolveMode=Ot,e.getMode=Nt,e.modeExtensions=At,e.extendMode=Dt,e.copyState=Wt,e.startState=Et,e.innerMode=Ht,e.commands=el,e.keyMap=Uo,e.keyName=Xo,e.isModifierKey=$o,e.lookupKey=Go,e.normalizeKeyMap=_o,e.StringStream=zt,e.SharedTextMarker=Lo,e.TextMarker=So,e.LineWidget=xo,e.e_preventDefault=ut,e.e_stopPropagation=ct,e.e_stop=dt,e.addClass=H,e.contains=D,e.rmClass=L,e.keyNames=Ro}(Tl),Tl.version="5.42.2",Tl}()},269:function(e,t,r){var n=r(270);"string"==typeof n&&(n=[[e.i,n,""]]);r(18)(n,{});n.locals&&(e.exports=n.locals)},270:function(e,t,r){(e.exports=r(17)(!1)).push([e.i,"/* BASICS */\n\n.CodeMirror {\n  /* Set height, width, borders, and global font properties here */\n  font-family: monospace;\n  height: 300px;\n  color: black;\n  direction: ltr;\n}\n\n/* PADDING */\n\n.CodeMirror-lines {\n  padding: 4px 0; /* Vertical padding around content */\n}\n.CodeMirror pre {\n  padding: 0 4px; /* Horizontal padding of content */\n}\n\n.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n  background-color: white; /* The little square between H and V scrollbars */\n}\n\n/* GUTTER */\n\n.CodeMirror-gutters {\n  border-right: 1px solid #ddd;\n  background-color: #f7f7f7;\n  white-space: nowrap;\n}\n.CodeMirror-linenumbers {}\n.CodeMirror-linenumber {\n  padding: 0 3px 0 5px;\n  min-width: 20px;\n  text-align: right;\n  color: #999;\n  white-space: nowrap;\n}\n\n.CodeMirror-guttermarker { color: black; }\n.CodeMirror-guttermarker-subtle { color: #999; }\n\n/* CURSOR */\n\n.CodeMirror-cursor {\n  border-left: 1px solid black;\n  border-right: none;\n  width: 0;\n}\n/* Shown when moving in bi-directional text */\n.CodeMirror div.CodeMirror-secondarycursor {\n  border-left: 1px solid silver;\n}\n.cm-fat-cursor .CodeMirror-cursor {\n  width: auto;\n  border: 0 !important;\n  background: #7e7;\n}\n.cm-fat-cursor div.CodeMirror-cursors {\n  z-index: 1;\n}\n.cm-fat-cursor-mark {\n  background-color: rgba(20, 255, 20, 0.5);\n  -webkit-animation: blink 1.06s steps(1) infinite;\n  -moz-animation: blink 1.06s steps(1) infinite;\n  animation: blink 1.06s steps(1) infinite;\n}\n.cm-animate-fat-cursor {\n  width: auto;\n  border: 0;\n  -webkit-animation: blink 1.06s steps(1) infinite;\n  -moz-animation: blink 1.06s steps(1) infinite;\n  animation: blink 1.06s steps(1) infinite;\n  background-color: #7e7;\n}\n@-moz-keyframes blink {\n  0% {}\n  50% { background-color: transparent; }\n  100% {}\n}\n@-webkit-keyframes blink {\n  0% {}\n  50% { background-color: transparent; }\n  100% {}\n}\n@keyframes blink {\n  0% {}\n  50% { background-color: transparent; }\n  100% {}\n}\n\n/* Can style cursor different in overwrite (non-insert) mode */\n.CodeMirror-overwrite .CodeMirror-cursor {}\n\n.cm-tab { display: inline-block; text-decoration: inherit; }\n\n.CodeMirror-rulers {\n  position: absolute;\n  left: 0; right: 0; top: -50px; bottom: -20px;\n  overflow: hidden;\n}\n.CodeMirror-ruler {\n  border-left: 1px solid #ccc;\n  top: 0; bottom: 0;\n  position: absolute;\n}\n\n/* DEFAULT THEME */\n\n.cm-s-default .cm-header {color: blue;}\n.cm-s-default .cm-quote {color: #090;}\n.cm-negative {color: #d44;}\n.cm-positive {color: #292;}\n.cm-header, .cm-strong {font-weight: bold;}\n.cm-em {font-style: italic;}\n.cm-link {text-decoration: underline;}\n.cm-strikethrough {text-decoration: line-through;}\n\n.cm-s-default .cm-keyword {color: #708;}\n.cm-s-default .cm-atom {color: #219;}\n.cm-s-default .cm-number {color: #164;}\n.cm-s-default .cm-def {color: #00f;}\n.cm-s-default .cm-variable,\n.cm-s-default .cm-punctuation,\n.cm-s-default .cm-property,\n.cm-s-default .cm-operator {}\n.cm-s-default .cm-variable-2 {color: #05a;}\n.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}\n.cm-s-default .cm-comment {color: #a50;}\n.cm-s-default .cm-string {color: #a11;}\n.cm-s-default .cm-string-2 {color: #f50;}\n.cm-s-default .cm-meta {color: #555;}\n.cm-s-default .cm-qualifier {color: #555;}\n.cm-s-default .cm-builtin {color: #30a;}\n.cm-s-default .cm-bracket {color: #997;}\n.cm-s-default .cm-tag {color: #170;}\n.cm-s-default .cm-attribute {color: #00c;}\n.cm-s-default .cm-hr {color: #999;}\n.cm-s-default .cm-link {color: #00c;}\n\n.cm-s-default .cm-error {color: #f00;}\n.cm-invalidchar {color: #f00;}\n\n.CodeMirror-composing { border-bottom: 2px solid; }\n\n/* Default styles for common addons */\n\ndiv.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}\ndiv.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}\n.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }\n.CodeMirror-activeline-background {background: #e8f2ff;}\n\n/* STOP */\n\n/* The rest of this file contains styles related to the mechanics of\n   the editor. You probably shouldn't touch them. */\n\n.CodeMirror {\n  position: relative;\n  overflow: hidden;\n  background: white;\n}\n\n.CodeMirror-scroll {\n  overflow: scroll !important; /* Things will break if this is overridden */\n  /* 30px is the magic margin used to hide the element's real scrollbars */\n  /* See overflow: hidden in .CodeMirror */\n  margin-bottom: -30px; margin-right: -30px;\n  padding-bottom: 30px;\n  height: 100%;\n  outline: none; /* Prevent dragging from highlighting the element */\n  position: relative;\n}\n.CodeMirror-sizer {\n  position: relative;\n  border-right: 30px solid transparent;\n}\n\n/* The fake, visible scrollbars. Used to force redraw during scrolling\n   before actual scrolling happens, thus preventing shaking and\n   flickering artifacts. */\n.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {\n  position: absolute;\n  z-index: 6;\n  display: none;\n}\n.CodeMirror-vscrollbar {\n  right: 0; top: 0;\n  overflow-x: hidden;\n  overflow-y: scroll;\n}\n.CodeMirror-hscrollbar {\n  bottom: 0; left: 0;\n  overflow-y: hidden;\n  overflow-x: scroll;\n}\n.CodeMirror-scrollbar-filler {\n  right: 0; bottom: 0;\n}\n.CodeMirror-gutter-filler {\n  left: 0; bottom: 0;\n}\n\n.CodeMirror-gutters {\n  position: absolute; left: 0; top: 0;\n  min-height: 100%;\n  z-index: 3;\n}\n.CodeMirror-gutter {\n  white-space: normal;\n  height: 100%;\n  display: inline-block;\n  vertical-align: top;\n  margin-bottom: -30px;\n}\n.CodeMirror-gutter-wrapper {\n  position: absolute;\n  z-index: 4;\n  background: none !important;\n  border: none !important;\n}\n.CodeMirror-gutter-background {\n  position: absolute;\n  top: 0; bottom: 0;\n  z-index: 4;\n}\n.CodeMirror-gutter-elt {\n  position: absolute;\n  cursor: default;\n  z-index: 4;\n}\n.CodeMirror-gutter-wrapper ::selection { background-color: transparent }\n.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }\n\n.CodeMirror-lines {\n  cursor: text;\n  min-height: 1px; /* prevents collapsing before first draw */\n}\n.CodeMirror pre {\n  /* Reset some styles that the rest of the page might have set */\n  -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;\n  border-width: 0;\n  background: transparent;\n  font-family: inherit;\n  font-size: inherit;\n  margin: 0;\n  white-space: pre;\n  word-wrap: normal;\n  line-height: inherit;\n  color: inherit;\n  z-index: 2;\n  position: relative;\n  overflow: visible;\n  -webkit-tap-highlight-color: transparent;\n  -webkit-font-variant-ligatures: contextual;\n  font-variant-ligatures: contextual;\n}\n.CodeMirror-wrap pre {\n  word-wrap: break-word;\n  white-space: pre-wrap;\n  word-break: normal;\n}\n\n.CodeMirror-linebackground {\n  position: absolute;\n  left: 0; right: 0; top: 0; bottom: 0;\n  z-index: 0;\n}\n\n.CodeMirror-linewidget {\n  position: relative;\n  z-index: 2;\n  padding: 0.1px; /* Force widget margins to stay inside of the container */\n}\n\n.CodeMirror-widget {}\n\n.CodeMirror-rtl pre { direction: rtl; }\n\n.CodeMirror-code {\n  outline: none;\n}\n\n/* Force content-box sizing for the elements where we expect it */\n.CodeMirror-scroll,\n.CodeMirror-sizer,\n.CodeMirror-gutter,\n.CodeMirror-gutters,\n.CodeMirror-linenumber {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n}\n\n.CodeMirror-measure {\n  position: absolute;\n  width: 100%;\n  height: 0;\n  overflow: hidden;\n  visibility: hidden;\n}\n\n.CodeMirror-cursor {\n  position: absolute;\n  pointer-events: none;\n}\n.CodeMirror-measure pre { position: static; }\n\ndiv.CodeMirror-cursors {\n  visibility: hidden;\n  position: relative;\n  z-index: 3;\n}\ndiv.CodeMirror-dragcursors {\n  visibility: visible;\n}\n\n.CodeMirror-focused div.CodeMirror-cursors {\n  visibility: visible;\n}\n\n.CodeMirror-selected { background: #d9d9d9; }\n.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }\n.CodeMirror-crosshair { cursor: crosshair; }\n.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }\n.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }\n\n.cm-searching {\n  background-color: #ffa;\n  background-color: rgba(255, 255, 0, .4);\n}\n\n/* Used to force a border model for a node */\n.cm-force-border { padding-right: .1px; }\n\n@media print {\n  /* Hide the cursor when printing */\n  .CodeMirror div.CodeMirror-cursors {\n    visibility: hidden;\n  }\n}\n\n/* See issue #2901 */\n.cm-tab-wrap-hack:after { content: ''; }\n\n/* Help users use markselection to safely style text background */\nspan.CodeMirror-selectedtext { background: none; }\n",""])},4:function(e,t,r){"use strict";function n(){return window.__u_id_++,"_u_r_id__"+window.__u_id_}function i(e){if(e&&401===e.status)bootbox.alert("权限不足，不能进行此操作.");else if(e&&e.responseText){var t=e.responseText,r=JSON.parse(t);bootbox.dialog({title:"服务端错误",message:"<span style='color: red'>"+r.errorMsg+"</span>",buttons:[{label:"查看错误堆栈",callback:function(){var e=window.open("error-stack.html","_blank");$(e).load(function(){var e=$(this.document.body);e.css({"font-size":"13px"}),e.empty(),e.append(r.stack)})}}]})}else bootbox.alert("<span style='color: red'>服务端出错</span>")}Object.defineProperty(t,"__esModule",{value:!0}),t.generateId=n,t.pathId=function(e){if(_fullpath_map.has(e))return _fullpath_map.get(e);var t=n();return _fullpath_map.set(e,t),t},t.copyCellData=function(e,t){$.ajax({url:window._server+"/common/parseCellData",type:"POST",data:{type:e,xml:t}})},t.pasteCellData=function(e,t){$.ajax({url:window._server+"/common/loadCellData",type:"POST",data:{type:e},success:function(e){e?t(e):bootbox.alert("当前没有数据可供粘贴！")},error:function(e){i(e)}})},t.handleError=i,t.nextIFrameId=function(){return window.iframe_id_++,"_iframe"+window.iframe_id_},t.getParameter=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),r=window.location.search.substr(1).match(t);return null!=r?r[2]:null},t.ajaxSave=function(e,t,r){$.ajax({type:"POST",url:e,data:t,success:function(e){r(e)},error:function(e){i(e)}})},t.formatDate=function(e,t){"number"==typeof e&&(e=new Date(e));if("string"==typeof e)return e;var r={"M+":e.getMonth()+1,"d+":e.getDate(),"H+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length)));for(var n in r)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?r[n]:("00"+r[n]).substr((""+r[n]).length)));return t},t.escapeXml=function(e){return e.replace(/[<>&"]/g,function(e){return{"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"}[e]})},window.iframe_id_=1,window.__u_id_=0,window._fullpath_map=new Map},609:function(e,t,r){"use strict";var n,i=r(4),o=r(209),l=(n=o)&&n.__esModule?n:{default:n};r(610),r(269),$(document).ready(function(){var e=$("#container"),t=$('<div style="height: 40px;">');e.append(t);var r=$('<button type="button" class="btn btn-default">单条数据</button>'),n=$('<button type="button" class="btn btn-default">多条数据</button>');t.append(r),t.append(n);var o=$('<button type="button" class="btn btn-default">格式化</button>');t.append(o);var a=$('<button type="button" class="btn btn-danger" style="margin-left: 5px"><i class="glyphicon glyphicon-flash"></i> 提交数据</button>');t.append(a);var s=$('<table border="0" style="width: 100%"></table>');e.append(s);var u=$("<tr></tr>"),c=$('<td style="width: 50%;vertical-align: top"></td>'),f=$('<td style="width: 50%;vertical-align: top"></td>');s.append(u),u.append(c),u.append(f);var d=$('<textarea rows="50" class="form-control" style="width: 100%;font-size: 13px"></textarea>');c.append(d);var h=l.default.fromTextArea(d.get(0),{lineNumbers:!0,mode:"javascript"});h.setValue(JSON.stringify(window.jsonData,null,4)),o.click(function(){var e=h.getValue(),t=JSON.parse(e);h.setValue(JSON.stringify(t,null,4))}),r.click(function(){h.setValue(JSON.stringify(window.jsonData,null,4))}),n.click(function(){var e=JSON.stringify(window.jsonData,null,4),t='{"data":['+e+","+e+"]}";h.setValue(t),bootbox.alert("默认添加两条数据，如需要更多条，可按给出格式添加!")});var p=$('<textarea rows="100" class="form-control" style="width: 99%;font-size: 13px;margin-left: 5px"></textarea>');f.append(p),a.click(function(){$.ajax({url:window.restUrl,data:h.getValue(),type:"POST",beforeSend:function(e){window.restSecurity&&(e.setRequestHeader("Username",window.restUsername),e.setRequestHeader("Password",window.restPassword))},success:function(e){var t=JSON.stringify(e,null,4);p.val(t)},error:function(e){(0,i.handleError)(e)}})})})},610:function(e,t,r){!function(e){"use strict";e.defineMode("javascript",function(t,r){var n,i,o=t.indentUnit,l=r.statementIndent,a=r.jsonld,s=r.json||a,u=r.typescript,c=r.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("keyword d"),o=e("operator"),l={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in: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:n,export:e("export"),import:e("import"),extends:n,await:n}}(),d=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e,t,r){return n=e,i=r,t}function g(e,t){var r,n=e.next();if('"'==n||"'"==n)return t.tokenize=(r=n,function(e,t){var n,i=!1;if(a&&"@"==e.peek()&&e.match(h))return t.tokenize=g,p("jsonld-keyword","meta");for(;null!=(n=e.next())&&(n!=r||i);)i=!i&&"\\"==n;return i||(t.tokenize=g),p("string","string")}),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return p("number","number");if("."==n&&e.match(".."))return p("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return p(n);if("="==n&&e.eat(">"))return p("=>","operator");if("0"==n&&e.match(/^(?:x[\da-f]+|o[0-7]+|b[01]+)n?/i))return p("number","number");if(/\d/.test(n))return e.match(/^\d*(?:n|(?:\.\d*)?(?:[eE][+\-]?\d+)?)?/),p("number","number");if("/"==n)return e.eat("*")?(t.tokenize=m,m(e,t)):e.eat("/")?(e.skipToEnd(),p("comment","comment")):Ke(e,t,1)?(function(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),p("regexp","string-2")):(e.eat("="),p("operator","operator",e.current()));if("`"==n)return t.tokenize=v,v(e,t);if("#"==n)return e.skipToEnd(),p("error","error");if(d.test(n))return">"==n&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=n&&"="!=n||e.eat("="):/[<>*+\-]/.test(n)&&(e.eat(n),">"==n&&e.eat(n))),p("operator","operator",e.current());if(c.test(n)){e.eatWhile(c);var i=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(i)){var o=f[i];return p(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return p("async","keyword",i)}return p("variable","variable",i)}}function m(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=g;break}n="*"==r}return p("comment","comment")}function v(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=g;break}n=!n&&"\\"==r}return p("quasi","string-2",e.current())}var y="([{}])";function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(u){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,l=r-1;l>=0;--l){var a=e.string.charAt(l),s=y.indexOf(a);if(s>=0&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(c.test(a))o=!0;else{if(/["'\/]/.test(a))return;if(o&&!i){++l;break}}}o&&!i&&(t.fatArrowAt=l)}}var w={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function x(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function C(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(r=n.vars;r;r=r.next)if(r.name==t)return!0}var k={state:null,column:null,marked:null,cc:null};function S(){for(var e=arguments.length-1;e>=0;e--)k.cc.push(arguments[e])}function M(){return S.apply(null,arguments),!0}function L(e,t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}function T(e){var t=k.state;if(k.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var n=function e(t,r){if(r){if(r.block){var n=e(t,r.prev);return n?n==r.prev?r:new N(n,r.vars,!0):null}return L(t,r.vars)?r:new N(r.prev,new A(t,r.vars),!1)}return null}(e,t.context);if(null!=n)return void(t.context=n)}else if(!L(e,t.localVars))return void(t.localVars=new A(e,t.localVars));r.globalVars&&!L(e,t.globalVars)&&(t.globalVars=new A(e,t.globalVars))}function O(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function N(e,t,r){this.prev=e,this.vars=t,this.block=r}function A(e,t){this.name=e,this.next=t}var D=new A("this",new A("arguments",null));function W(){k.state.context=new N(k.state.context,k.state.localVars,!1),k.state.localVars=D}function H(){k.state.context=new N(k.state.context,k.state.localVars,!0),k.state.localVars=null}function E(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function z(e,t){var r=function(){var r=k.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new x(n,k.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function P(){var e=k.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function F(e){return function t(r){return r==e?M():";"==e||"}"==r||")"==r||"]"==r?S():M(t)}}function R(e,t){return"var"==e?M(z("vardef",t),ye,F(";"),P):"keyword a"==e?M(z("form"),U,R,P):"keyword b"==e?M(z("form"),R,P):"keyword d"==e?k.stream.match(/^\s*$/,!1)?M():M(z("stat"),_,F(";"),P):"debugger"==e?M(F(";")):"{"==e?M(z("}"),H,le,P,E):";"==e?M():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==P&&k.state.cc.pop()(),M(z("form"),U,R,P,Se)):"function"==e?M(Ae):"for"==e?M(z("form"),Me,R,P):"class"==e||u&&"interface"==t?(k.marked="keyword",M(z("form"),He,P)):"variable"==e?u&&"declare"==t?(k.marked="keyword",M(R)):u&&("module"==t||"enum"==t||"type"==t)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==t?M(Ge):"type"==t?M(ce,F("operator"),ce,F(";")):M(z("form"),be,F("{"),z("}"),le,P,P)):u&&"namespace"==t?(k.marked="keyword",M(z("form"),B,le,P)):u&&"abstract"==t?(k.marked="keyword",M(R)):M(z("stat"),Q):"switch"==e?M(z("form"),U,F("{"),z("}","switch"),H,le,P,P,E):"case"==e?M(B,F(":")):"default"==e?M(F(":")):"catch"==e?M(z("form"),W,I,R,P,E):"export"==e?M(z("stat"),Fe,P):"import"==e?M(z("stat"),Ie,P):"async"==e?M(R):"@"==t?M(B,R):S(z("stat"),B,F(";"),P)}function I(e){if("("==e)return M(De,F(")"))}function B(e,t){return V(e,t,!1)}function j(e,t){return V(e,t,!0)}function U(e){return"("!=e?S():M(z(")"),B,F(")"),P)}function V(e,t,r){if(k.state.fatArrowAt==k.stream.start){var n=r?Y:q;if("("==e)return M(W,z(")"),ie(De,")"),P,F("=>"),n,E);if("variable"==e)return S(W,be,F("=>"),n,E)}var i=r?$:G;return w.hasOwnProperty(e)?M(i):"function"==e?M(Ae,i):"class"==e||u&&"interface"==t?(k.marked="keyword",M(z("form"),We,P)):"keyword c"==e||"async"==e?M(r?j:B):"("==e?M(z(")"),_,F(")"),P,i):"operator"==e||"spread"==e?M(r?j:B):"["==e?M(z("]"),_e,P,i):"{"==e?oe(te,"}",null,i):"quasi"==e?S(K,i):"new"==e?M(function(e){return function(t){return"."==t?M(e?J:Z):"variable"==t&&u?M(ge,e?$:G):S(e?j:B)}}(r)):"import"==e?M(B):M()}function _(e){return e.match(/[;\}\)\],]/)?S():S(B)}function G(e,t){return","==e?M(B):$(e,t,!1)}function $(e,t,r){var n=0==r?G:$,i=0==r?B:j;return"=>"==e?M(W,r?Y:q,E):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?M(n):u&&"<"==t&&k.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?M(z(">"),ie(ce,">"),P,n):"?"==t?M(B,F(":"),i):M(i):"quasi"==e?S(K,n):";"!=e?"("==e?oe(j,")","call",n):"."==e?M(ee,n):"["==e?M(z("]"),_,F("]"),P,n):u&&"as"==t?(k.marked="keyword",M(ce,n)):"regexp"==e?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),M(i)):void 0:void 0}function K(e,t){return"quasi"!=e?S():"${"!=t.slice(t.length-2)?M(K):M(B,X)}function X(e){if("}"==e)return k.marked="string-2",k.state.tokenize=v,M(K)}function q(e){return b(k.stream,k.state),S("{"==e?R:B)}function Y(e){return b(k.stream,k.state),S("{"==e?R:j)}function Z(e,t){if("target"==t)return k.marked="keyword",M(G)}function J(e,t){if("target"==t)return k.marked="keyword",M($)}function Q(e){return":"==e?M(P,R):S(G,F(";"),P)}function ee(e){if("variable"==e)return k.marked="property",M()}function te(e,t){return"async"==e?(k.marked="property",M(te)):"variable"==e||"keyword"==k.style?(k.marked="property","get"==t||"set"==t?M(re):(u&&k.state.fatArrowAt==k.stream.start&&(r=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+r[0].length),M(ne))):"number"==e||"string"==e?(k.marked=a?"property":k.style+" property",M(ne)):"jsonld-keyword"==e?M(ne):u&&O(t)?(k.marked="keyword",M(te)):"["==e?M(B,ae,F("]"),ne):"spread"==e?M(j,ne):"*"==t?(k.marked="keyword",M(te)):":"==e?S(ne):void 0;var r}function re(e){return"variable"!=e?S(ne):(k.marked="property",M(Ae))}function ne(e){return":"==e?M(j):"("==e?S(Ae):void 0}function ie(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var l=k.state.lexical;return"call"==l.info&&(l.pos=(l.pos||0)+1),M(function(r,n){return r==t||n==t?S():S(e)},n)}return i==t||o==t?M():M(F(t))}return function(r,i){return r==t||i==t?M():S(e,n)}}function oe(e,t,r){for(var n=3;n<arguments.length;n++)k.cc.push(arguments[n]);return M(z(t,r),ie(e,t),P)}function le(e){return"}"==e?M():S(R,le)}function ae(e,t){if(u){if(":"==e)return M(ce);if("?"==t)return M(ae)}}function se(e){if(u&&":"==e)return k.stream.match(/^\s*\w+\s+is\b/,!1)?M(B,ue,ce):M(ce)}function ue(e,t){if("is"==t)return k.marked="keyword",M()}function ce(e,t){return"keyof"==t||"typeof"==t?(k.marked="keyword",M("keyof"==t?ce:j)):"variable"==e||"void"==t?(k.marked="type",M(pe)):"string"==e||"number"==e||"atom"==e?M(pe):"["==e?M(z("]"),ie(ce,"]",","),P,pe):"{"==e?M(z("}"),ie(de,"}",",;"),P,pe):"("==e?M(ie(he,")"),fe):"<"==e?M(ie(ce,">"),ce):void 0}function fe(e){if("=>"==e)return M(ce)}function de(e,t){return"variable"==e||"keyword"==k.style?(k.marked="property",M(de)):"?"==t?M(de):":"==e?M(ce):"["==e?M(B,ae,F("]"),de):void 0}function he(e,t){return"variable"==e&&k.stream.match(/^\s*[?:]/,!1)||"?"==t?M(he):":"==e?M(ce):S(ce)}function pe(e,t){return"<"==t?M(z(">"),ie(ce,">"),P,pe):"|"==t||"."==e||"&"==t?M(ce):"["==e?M(F("]"),pe):"extends"==t||"implements"==t?(k.marked="keyword",M(ce)):void 0}function ge(e,t){if("<"==t)return M(z(">"),ie(ce,">"),P,pe)}function me(){return S(ce,ve)}function ve(e,t){if("="==t)return M(ce)}function ye(e,t){return"enum"==t?(k.marked="keyword",M(Ge)):S(be,ae,Ce,ke)}function be(e,t){return u&&O(t)?(k.marked="keyword",M(be)):"variable"==e?(T(t),M()):"spread"==e?M(be):"["==e?oe(xe,"]"):"{"==e?oe(we,"}"):void 0}function we(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),"spread"==e?M(be):"}"==e?S():"["==e?M(B,F("]"),F(":"),we):M(F(":"),be,Ce)):(T(t),M(Ce))}function xe(){return S(be,Ce)}function Ce(e,t){if("="==t)return M(j)}function ke(e){if(","==e)return M(ye)}function Se(e,t){if("keyword b"==e&&"else"==t)return M(z("form","else"),R,P)}function Me(e,t){return"await"==t?M(Me):"("==e?M(z(")"),Le,F(")"),P):void 0}function Le(e){return"var"==e?M(ye,F(";"),Oe):";"==e?M(Oe):"variable"==e?M(Te):S(B,F(";"),Oe)}function Te(e,t){return"in"==t||"of"==t?(k.marked="keyword",M(B)):M(G,Oe)}function Oe(e,t){return";"==e?M(Ne):"in"==t||"of"==t?(k.marked="keyword",M(B)):S(B,F(";"),Ne)}function Ne(e){")"!=e&&M(B)}function Ae(e,t){return"*"==t?(k.marked="keyword",M(Ae)):"variable"==e?(T(t),M(Ae)):"("==e?M(W,z(")"),ie(De,")"),P,se,R,E):u&&"<"==t?M(z(">"),ie(me,">"),P,Ae):void 0}function De(e,t){return"@"==t&&M(B,De),"spread"==e?M(De):u&&O(t)?(k.marked="keyword",M(De)):S(be,ae,Ce)}function We(e,t){return"variable"==e?He(e,t):Ee(e,t)}function He(e,t){if("variable"==e)return T(t),M(Ee)}function Ee(e,t){return"<"==t?M(z(">"),ie(me,">"),P,Ee):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(k.marked="keyword"),M(u?ce:B,Ee)):"{"==e?M(z("}"),ze,P):void 0}function ze(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&O(t))&&k.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",M(ze)):"variable"==e||"keyword"==k.style?(k.marked="property",M(u?Pe:Ae,ze)):"["==e?M(B,ae,F("]"),u?Pe:Ae,ze):"*"==t?(k.marked="keyword",M(ze)):";"==e?M(ze):"}"==e?M():"@"==t?M(B,ze):void 0}function Pe(e,t){return"?"==t?M(Pe):":"==e?M(ce,Ce):"="==t?M(j):S(Ae)}function Fe(e,t){return"*"==t?(k.marked="keyword",M(Ve,F(";"))):"default"==t?(k.marked="keyword",M(B,F(";"))):"{"==e?M(ie(Re,"}"),Ve,F(";")):S(R)}function Re(e,t){return"as"==t?(k.marked="keyword",M(F("variable"))):"variable"==e?S(j,Re):void 0}function Ie(e){return"string"==e?M():"("==e?S(B):S(Be,je,Ve)}function Be(e,t){return"{"==e?oe(Be,"}"):("variable"==e&&T(t),"*"==t&&(k.marked="keyword"),M(Ue))}function je(e){if(","==e)return M(Be,je)}function Ue(e,t){if("as"==t)return k.marked="keyword",M(Be)}function Ve(e,t){if("from"==t)return k.marked="keyword",M(B)}function _e(e){return"]"==e?M():S(ie(j,"]"))}function Ge(){return S(z("form"),be,F("{"),z("}"),ie($e,"}"),P,P)}function $e(){return S(be,Ce)}function Ke(e,t,r){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}return E.lex=!0,P.lex=!0,{startState:function(e){var t={tokenize:g,lastType:"sof",cc:[],lexical:new x((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&new N(null,null,!1),indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=m&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==n?r:(t.lastType="operator"!=n||"++"!=i&&"--"!=i?n:"incdec",function(e,t,r,n,i){var o=e.cc;for(k.state=e,k.stream=i,k.marked=null,k.cc=o,k.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():s?B:R)(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return k.marked?k.marked:"variable"==r&&C(e,n)?"variable-2":t}}(t,r,n,i,e))},indent:function(t,n){if(t.tokenize==m)return e.Pass;if(t.tokenize!=g)return 0;var i,a=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==P)s=s.prev;else if(c!=Se)break}for(;("stat"==s.type||"form"==s.type)&&("}"==a||(i=t.cc[t.cc.length-1])&&(i==G||i==$)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev;l&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var f=s.type,h=a==f;return"vardef"==f?s.indented+("operator"==t.lastType||","==t.lastType?s.info.length+1:0):"form"==f&&"{"==a?s.indented:"form"==f?s.indented+o:"stat"==f?s.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,n)?l||o:0):"switch"!=s.info||h||0==r.doubleIndentSwitch?s.align?s.column+(h?0:1):s.indented+(h?0:o):s.indented+(/^(?:case|default)\b/.test(n)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:s?null:"/*",blockCommentEnd:s?null:"*/",blockCommentContinue:s?null:" * ",lineComment:s?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:s?"json":"javascript",jsonldMode:a,jsonMode:s,expressionAllowed:Ke,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=B&&t!=j||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(r(209))}});