%PDF- %PDF-
Direktori : /proc/1857783/root/var/www/cwg/wp-content/plugins/wp-grid-builder/admin/assets/js/ |
Current File : //proc/1857783/root/var/www/cwg/wp-content/plugins/wp-grid-builder/admin/assets/js/codemirror.js |
/*! * WP Grid Builder Plugin * * @package WP Grid Builder * @author Loïc Blascos * @link https://www.wpgridbuilder.com * @copyright 2019-2021 Loïc Blascos * */ "use strict";var $jscomp={scope:{},findInternal:function(e,t,r){for(var n=(e=e instanceof String?String(e):e).length,i=0;i<n;i++){var o=e[i];if(t.call(r,o,i,e))return{i:i,v:o}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,r){if(r.get||r.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[t]=r.value)},$jscomp.getGlobal=function(e){return("undefined"==typeof window||window!==e)&&"undefined"!=typeof global&&null!=global?global:e},$jscomp.global=$jscomp.getGlobal(this),$jscomp.polyfill=function(e,t,r,n){if(t){for(r=$jscomp.global,e=e.split("."),n=0;n<e.length-1;n++){var i=e[n];i in r||(r[i]={}),r=r[i]}(t=t(n=r[e=e[e.length-1]]))!=n&&null!=t&&$jscomp.defineProperty(r,e,{configurable:!0,writable:!0,value:t})}},$jscomp.polyfill("Array.prototype.find",function(e){return e||function(e,t){return $jscomp.findInternal(this,e,t).v}},"es6-impl","es3"),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.CodeMirror=t()}(this,function(){function a(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function A(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function O(e,t){return A(e).appendChild(t)}function W(e,t,r,n){if(e=document.createElement(e),r&&(e.className=r),n&&(e.style.cssText=n),"string"==typeof t)e.appendChild(document.createTextNode(t));else if(t)for(r=0;r<t.length;++r)e.appendChild(t[r]);return e}function z(e,t,r,n){return(e=W(e,t,r,n)).setAttribute("role","presentation"),e}function u(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if((t=11==t.nodeType?t.host:t)==e)return!0}while(t=t.parentNode)}function b(){var t;try{t=document.activeElement}catch(e){t=document.body||null}for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function o(e,t){var r=e.className;a(t).test(r)||(e.className+=(r?" ":"")+t)}function D(e,t){e=e.split(" ");for(var r=0;r<e.length;r++)e[r]&&!a(e[r]).test(t)&&(t+=" "+e[r]);return t}function s(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function c(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 w(e,t,r,n,i){for(null==t&&(-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length)),n=n||0,i=i||0;;){var o=e.indexOf("\t",n);if(o<0||t<=o)return i+(t-n);i+=o-n,i+=r-i%r,n=o+1}}function h(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function x(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n),l=(o=-1==o?e.length:o)-n;if(o==e.length||t<=i+l)return n+Math.min(l,t-i);if(i+=o-n,n=o+1,t<=(i+=r-i%r))return n}}function g(e){for(;Ii.length<=e;)Ii.push(p(Ii)+" ");return Ii[e]}function p(e){return e[e.length-1]}function f(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function r(){}function n(e,t){return e=Object.create?Object.create(e):(r.prototype=e,new r),t&&c(t,e),e}function i(e){return/\w/.test(e)||""<e&&(e.toUpperCase()!=e.toLowerCase()||Fi.test(e))}function m(e,t){return t?!!(-1<t.source.indexOf("\\w")&&i(e))||t.test(e):i(e)}function l(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return;return 1}function v(e){return 768<=e.charCodeAt(0)&&Bi.test(e)}function y(e,t,r){for(;(r<0?0<t:t<e.length)&&v(e.charAt(t));)t+=r;return t}function k(e,t,r){for(;;){if(Math.abs(t-r)<=1)return e(t)?t:r;var n=Math.floor((t+r)/2);e(n)?r=n:t=n}}function d(e,t,r){this.input=r,this.scrollbarFiller=W("div",null,"CodeMirror-scrollbar-filler"),this.scrollbarFiller.setAttribute("cm-not-content","true"),this.gutterFiller=W("div",null,"CodeMirror-gutter-filler"),this.gutterFiller.setAttribute("cm-not-content","true"),this.lineDiv=z("div",null,"CodeMirror-code"),this.selectionDiv=W("div",null,null,"position: relative; z-index: 1"),this.cursorDiv=W("div",null,"CodeMirror-cursors"),this.measure=W("div",null,"CodeMirror-measure"),this.lineMeasure=W("div",null,"CodeMirror-measure"),this.lineSpace=z("div",[this.measure,this.lineMeasure,this.selectionDiv,this.cursorDiv,this.lineDiv],null,"position: relative; outline: none");var n=z("div",[this.lineSpace],"CodeMirror-lines");this.mover=W("div",[n],null,"position: relative"),this.sizer=W("div",[this.mover],"CodeMirror-sizer"),this.sizerWidth=null,this.heightForcer=W("div",null,null,"position: absolute; height: 30px; width: 1px;"),this.gutters=W("div",null,"CodeMirror-gutters"),this.lineGutter=null,this.scroller=W("div",[this.sizer,this.heightForcer,this.gutters],"CodeMirror-scroll"),this.scroller.setAttribute("tabIndex","-1"),this.wrapper=W("div",[this.scrollbarFiller,this.gutterFiller,this.scroller],"CodeMirror"),ai&&si<8&&(this.gutters.style.zIndex=-1,this.scroller.style.paddingRight=0),ci||ni&&vi||(this.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(this.wrapper):e(this.wrapper)),this.reportedViewFrom=this.reportedViewTo=this.viewFrom=this.viewTo=t.first,this.view=[],this.externalMeasured=this.renderedView=null,this.lastWrapHeight=this.lastWrapWidth=this.viewOffset=0,this.updateLineNumbers=null,this.nativeBarWidth=this.barHeight=this.barWidth=0,this.scrollbarsClipped=!1,this.lineNumWidth=this.lineNumInnerWidth=this.lineNumChars=null,this.alignWidgets=!1,this.maxLine=this.cachedCharWidth=this.cachedTextHeight=this.cachedPaddingH=null,this.maxLineLength=0,this.maxLineChanged=!1,this.wheelDX=this.wheelDY=this.wheelStartX=this.wheelStartY=null,this.shift=!1,this.activeTouch=this.selForContextMenu=null,r.init(this)}function C(e,t){if((t-=e.first)<0||t>=e.size)throw Error("There is no line "+(t+e.first)+" in the document.");for(;!e.lines;)for(var r=0;;++r){var n=e.children[r],i=n.chunkSize();if(t<i){e=n;break}t-=i}return e.lines[t]}function S(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){e=e.text,i==r.line&&(e=e.slice(0,r.ch)),i==t.line&&(e=e.slice(t.ch)),n.push(e),++i}),n}function L(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function M(e,t){if(t-=e.height)for(;e;e=e.parent)e.height+=t}function H(e){if(null==e.parent)return null;var t=e.parent;e=h(t.lines,e);for(var r=t.parent;r;r=(t=r).parent)for(var n=0;r.children[n]!=t;++n)e+=r.children[n].chunkSize();return e+t.first}function T(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(n=0;n<e.lines.length&&!(t<(i=e.lines[n].height));++n)t-=i;return r+n}function N(e,t){return t>=e.first&&t<e.first+e.size}function P(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function E(e,t,r){return void 0===r&&(r=null),this instanceof E?(this.line=e,this.ch=t,void(this.sticky=r)):new E(e,t,r)}function I(e,t){return e.line-t.line||e.ch-t.ch}function F(e,t){return e.sticky==t.sticky&&0==I(e,t)}function B(e){return E(e.line,e.ch)}function R(e,t){return I(e,t)<0?t:e}function j(e,t){return I(e,t)<0?e:t}function V(e,t){if(t.line<e.first)return E(e.first,0);var r=e.first+e.size-1;return t.line>r?E(r,C(e,r).text.length):(e=C(e,t.line).text.length,null==(r=t.ch)||e<r?E(t.line,e):r<0?E(t.line,0):t)}function K(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=V(e,t[n]);return r}function G(e,t,r){this.marker=e,this.from=t,this.to=r}function U(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function q(e,t){if(t.full)return null;var r=N(e,t.from.line)&&C(e,t.from.line).markedSpans,n=N(e,t.to.line)&&C(e,t.to.line).markedSpans;if(!r&&!n)return null;e=t.from.ch;var i,o=t.to.ch,l=0==I(t.from,t.to);if(r)for(var a=0;a<r.length;++a){var s,c=r[a],u=c.marker;null!=c.from&&!(u.inclusiveLeft?c.from<=e:c.from<e)&&(c.from!=e||"bookmark"!=u.type||l&&c.marker.insertLeft)||(s=null==c.to||(u.inclusiveRight?c.to>=e:c.to>e),(i=i||[]).push(new G(u,c.from,s?null:c.to)))}var d,h,r=i;if(n)for(i=0;i<n.length;++i)c=(a=n[i]).marker,null!=a.to&&!(c.inclusiveRight?a.to>=o:a.to>o)&&(a.from!=o||"bookmark"!=c.type||l&&!a.marker.insertLeft)||(u=null==a.from||(c.inclusiveLeft?a.from<=o:a.from<o),(d=d||[]).push(new G(c,u?null:a.from-o,null==a.to?null:a.to-o)));if(n=1==t.text.length,o=p(t.text).length+(n?e:0),r)for(l=0;l<r.length;++l)null==(i=r[l]).to&&((a=U(d,i.marker))?n&&(i.to=null==a.to?null:a.to+o):i.to=e);if(d)for(e=0;e<d.length;++e)null!=(l=d[e]).to&&(l.to+=o),null==l.from?U(r,l.marker)||(l.from=o,n&&(r=r||[]).push(l)):(l.from+=o,n&&(r=r||[]).push(l));if(r=r&&_(r),d&&d!=r&&(d=_(d)),e=[r],!n){if(0<(t=t.text.length-2)&&r)for(n=0;n<r.length;++n)null==r[n].to&&(h=h||[]).push(new G(r[n].marker,null,null));for(r=0;r<t;++r)e.push(h);e.push(d)}return e}function _(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 $(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function X(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Y(e,t){if(0!=(r=e.lines.length-t.lines.length))return r;var r=e.find(),n=t.find(),i=I(r.from,n.from)||(e.inclusiveLeft?-1:0)-(t.inclusiveLeft?-1:0);return i?-i:(r=I(r.to,n.to)||(e.inclusiveRight?1:0)-(t.inclusiveRight?1:0))?r:t.id-e.id}function Z(e,t){var r;if(e=ji&&e.markedSpans)for(var n,i=0;i<e.length;++i)(n=e[i]).marker.collapsed&&null==(t?n.from:n.to)&&(!r||Y(r,n.marker)<0)&&(r=n.marker);return r}function Q(e,t,r,n,i){if(e=C(e,t),e=ji&&e.markedSpans)for(t=0;t<e.length;++t){var o=e[t];if(o.marker.collapsed){var l=o.marker.find(0),a=I(l.from,r)||(o.marker.inclusiveLeft?-1:0)-(i.inclusiveLeft?-1:0),s=I(l.to,n)||(o.marker.inclusiveRight?1:0)-(i.inclusiveRight?1:0);if(!(0<=a&&s<=0||a<=0&&0<=s)&&(a<=0&&(o.marker.inclusiveRight&&i.inclusiveLeft?0<=I(l.to,r):0<I(l.to,r))||0<=a&&(o.marker.inclusiveRight&&i.inclusiveLeft?I(l.from,n)<=0:I(l.from,n)<0)))return 1}}}function J(e){for(var t;t=Z(e,!0);)e=t.find(-1,!0).line;return e}function ee(e,t){var r=J(e=C(e,t));return e==r?t:H(r)}function te(e,t){if(t>e.lastLine())return t;var r=C(e,t);if(!re(e,r))return t;for(;e=Z(r,!1);)r=e.find(1,!0).line;return H(r)+1}function re(e,t){var r=ji&&t.markedSpans;if(r)for(var n,i=0;i<r.length;++i)if((n=r[i]).marker.collapsed&&(null==n.from||!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&function e(t,r,n){if(null==n.to)return r=n.marker.find(1,!0),e(t,r.line,U(r.line.markedSpans,n.marker));if(n.marker.inclusiveRight&&n.to==r.text.length)return!0;for(var i,o=0;o<r.markedSpans.length;++o)if(i=r.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&e(t,r,i))return!0}(e,t,n)))return!0}function ne(e){for(var t=0,r=(e=J(e)).parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(e=r.parent;e;e=(r=e).parent)for(n=0;n<e.children.length&&(i=e.children[n])!=r;++n)t+=i.height;return t}function ie(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=Z(n,!0);)n=(t=t.find(0,!0)).from.line,r+=t.from.ch-t.to.ch;for(n=e;t=Z(n,!1);)e=t.find(0,!0),r-=n.text.length-e.from.ch,r+=(n=e.to.line).text.length-e.to.ch;return r}function oe(e){var r=e.display;e=e.doc,r.maxLine=C(e,e.first),r.maxLineLength=ie(r.maxLine),r.maxLineChanged=!0,e.iter(function(e){var t=ie(e);t>r.maxLineLength&&(r.maxLineLength=t,r.maxLine=e)})}function le(e,t,r){var n;Vi=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:Vi=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:Vi=i)}return null!=n?n:Vi}function ae(e,t){var r=e.order;return r=null==r?e.order=Ki(e.text,t):r}function se(e,t,r){return(t=y(e.text,t+r,r))<0||t>e.text.length?null:t}function ce(e,t,r){return null==(e=se(e,t.ch,r))?null:new E(t.line,e,r<0?"after":"before")}function ue(e,t,r,n,i){if(e=e&&ae(r,t.doc.direction)){var o,l,a,s=i<0==(1==(e=i<0?p(e):e[0]).level)?"after":"before";return 0<e.level?(o=at(t,r),l=i<0?r.text.length-1:0,a=st(t,o,l).top,l=k(function(e){return st(t,o,e).top==a},i<0==(1==e.level)?e.from:e.to-1,l),"before"==s&&(l=se(r,l,1))):l=i<0?e.to:e.from,new E(n,l,s)}return new E(n,i<0?r.text.length:0,i<0?"before":"after")}function de(r,n,a,e){var s=ae(n,r.doc.direction);if(!s)return ce(n,a,e);a.ch>=n.text.length?(a.ch=n.text.length,a.sticky="before"):a.ch<=0&&(a.ch=0,a.sticky="after");var t=le(s,a.ch,a.sticky),i=s[t];if("ltr"==r.doc.direction&&0==i.level%2&&(0<e?i.to>a.ch:i.from<a.ch))return ce(n,a,e);function c(e,t){return se(n,e instanceof E?e.ch:e,t)}function o(e){if(!r.options.lineWrapping)return{begin:0,end:n.text.length};var t=l=l||at(r,n);return e=ft(r,n,st(r,t,e),"line").top,bt(r,n,t,e)}var l,u=o("before"==a.sticky?c(a,-1):a.ch);if("rtl"==r.doc.direction||1==i.level){var d=1==i.level==e<0,h=c(a,d?1:-1);if(null!=h&&(d?h<=i.to&&h<=u.end:h>=i.from&&h>=u.begin))return new E(a.line,h,d?"before":"after")}return(t=(i=function(e,t,r){for(var n=function(e,t){return t?new E(a.line,c(e,1),"before"):new E(a.line,e,"after")};0<=e&&e<s.length;e+=t){var i=s[e],o=0<t==(1!=i.level),l=o?r.begin:c(r.end,-1);if(i.from<=l&&l<i.to)return n(l,o);if(l=o?i.from:c(i.to,-1),r.begin<=l&&l<r.end)return n(l,o)}})(t+e,e,u))?t:null==(u=0<e?u.end:c(u.begin,-1))||0<e&&u==n.text.length||!(t=i(0<e?0:s.length-1,e,o(u)))?null:t}function he(e,t,r){var n;e.removeEventListener?e.removeEventListener(t,r,!1):e.detachEvent?e.detachEvent("on"+t,r):!(n=(e=e._handlers)&&e[t])||-1<(r=h(n,r))&&(e[t]=n.slice(0,r).concat(n.slice(r+1)))}function fe(e,t){var r=e._handlers&&e._handlers[t]||Gi;if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function pe(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),fe(e,r||t.type,e,t),ye(t)||t.codemirrorIgnore}function ge(e){var t=e._handlers&&e._handlers.cursorActivity;if(t){e=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]);for(var r=0;r<t.length;++r)-1==h(e,t[r])&&e.push(t[r])}}function me(e,t){return 0<(e._handlers&&e._handlers[t]||Gi).length}function e(e){e.prototype.on=function(e,t){Ui(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function ve(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function t(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ye(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function be(e){ve(e),t(e)}function we(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),t=yi&&e.ctrlKey&&1==t?3:t}function xe(e){if("string"==typeof e&&Qi.hasOwnProperty(e))e=Qi[e];else if(e&&"string"==typeof e.name&&Qi.hasOwnProperty(e.name)){var t=Qi[e.name];(e=n(t="string"==typeof t?{name:t}:t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return xe("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return xe("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function ke(e,t){t=xe(t);var r,n=Zi[t.name];if(!n)return ke(e,"text/plain");if(e=n(e,t),Ji.hasOwnProperty(t.name))for(r in n=Ji[t.name])n.hasOwnProperty(r)&&(e.hasOwnProperty(r)&&(e["_"+r]=e[r]),e[r]=n[r]);if(e.name=t.name,t.helperType&&(e.helperType=t.helperType),t.modeProps)for(var i in t.modeProps)e[i]=t.modeProps[i];return e}function Ce(e,t){c(t,e=Ji.hasOwnProperty(e)?Ji[e]:Ji[e]={})}function Se(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);for(var r in e={},t){var n=t[r];n instanceof Array&&(n=n.concat([])),e[r]=n}return e}function Le(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 Me(e,t,r){return!e.startState||e.startState(t,r)}function Te(t,r,e,n){var a=[t.state.modeGen],s={};for(Pe(t,r.text,t.doc.mode,e,function(e,t){return a.push(e,t)},s,n),e=function(e){var i=t.state.overlays[e],o=1,l=0;Pe(t,r.text,i.mode,!0,function(e,t){for(var r=o;l<e;){var n=a[o];e<n&&a.splice(o,1,e,a[o+1],n),o+=2,l=Math.min(e,n)}if(t)if(i.opaque)a.splice(r,o-r,e,"overlay "+t),o=r+2;else for(;r<o;r+=2)e=a[r+1],a[r+1]=(e?e+" ":"")+"overlay "+t},s)},n=0;n<t.state.overlays.length;++n)e(n);return{styles:a,classes:s.bgClass||s.textClass?s:null}}function Ne(e,t,r){var n,i;return t.styles&&t.styles[0]==e.state.modeGen||(n=Ae(e,H(t)),i=Te(e,t,t.text.length>e.options.maxHighlightLength?Se(e.doc.mode,n):n),t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++),t.styles}function Ae(t,r,e){var n=t.doc,i=t.display;if(!n.mode.startState)return!0;var o=function(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100);l<t;--t){if(t<=o.first)return o.first;var a=C(o,t-1);if(a.stateAfter&&(!r||t<=o.frontier))return t;a=w(a.text,null,e.options.tabSize),(null==i||a<n)&&(i=t-1,n=a)}return i}(t,r,e),l=(l=o>n.first&&C(n,o-1).stateAfter)?Se(n.mode,l):Me(n.mode);return n.iter(o,r,function(e){Oe(t,e.text,l),e.stateAfter=o==r-1||0==o%5||o>=i.viewFrom&&o<i.viewTo?Se(n.mode,l):null,++o}),e&&(n.frontier=o),l}function Oe(e,t,r,n){var i=e.doc.mode;for((e=new eo(t,e.options.tabSize)).start=e.pos=n||0,""==t&&We(i,r);!e.eol();)ze(i,e,r),e.start=e.pos}function We(e,t){return e.blankLine?e.blankLine(t):e.innerMode&&(e=Le(e,t)).mode.blankLine?e.mode.blankLine(e.state):void 0}function ze(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Le(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw Error("Mode "+e.name+" failed to advance stream.")}function De(e,t,r,n){function i(e){return{start:d.start,end:d.pos,string:d.current(),type:o||null,state:e?Se(l.mode,u):u}}var o,l=e.doc,a=l.mode;t=V(l,t);var s,c=C(l,t.line),u=Ae(e,t.line,r),d=new eo(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,o=ze(a,d,u),n&&s.push(i(!0));return n?s:i()}function He(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 Pe(e,t,r,n,i,o,l){var a=r.flattenSpans;null==a&&(a=e.options.flattenSpans);var s=0,c=null,u=new eo(t,e.options.tabSize),d=e.options.addModeClass&&[null];for(""==t&&He(We(r,n),o);!u.eol();){var h,f=u.pos>e.options.maxHighlightLength?(a=!1,l&&Oe(e,t,n,u.pos),u.pos=t.length,null):He(ze(r,u,n,d),o);if(d&&(h=d[0].name)&&(f="m-"+(f?h+" "+f:h)),!a||c!=f){for(;s<u.start;)i(s=Math.min(u.start,s+5e3),c);c=f}u.start=u.pos}for(;s<u.pos;)i(e=Math.min(u.pos,s+5e3),c),s=e}function Ee(e,t){return!e||/^\s*$/.test(e)?null:(t=t.addModeClass?oo:io)[e]||(t[e]=e.replace(/\S+/g,"cm-$&"))}function Ie(e,t){var r=z("span",null,null,ci?"padding-right: .1px":null),r={pre:z("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(ai||ci)&&e.getOption("lineWrapping")};t.measure={};for(var n,i,o=0;o<=(t.rest?t.rest.length:0);o++){var l,a,s=o?t.rest[o-1]:t.line,c=void 0;r.pos=0,r.addToken=Be,C=e.display.measure,(C=null!=Ti?Ti:(a=O(C,document.createTextNode("AخA")),l=Ci(a,0,1).getBoundingClientRect(),a=Ci(a,1,2).getBoundingClientRect(),A(C),!(!l||l.left==l.right)&&(Ti=a.right-l.right<3)))&&(c=ae(s,e.doc.direction))&&(r.addToken=function(d,h){return function(e,t,r,n,i,o,l){r=r?r+" cm-force-border":"cm-force-border";for(var a=e.pos,s=a+t.length;;){for(var c=void 0,u=0;u<h.length&&!((c=h[u]).to>a&&c.from<=a);u++);if(c.to>=s)return d(e,t,r,n,i,o,l);d(e,t.slice(0,c.to-a),r,n,null,o,l),n=null,t=t.slice(c.to-a),a=c.to}}}(r.addToken,c)),r.map=[];e:{var u=a=l=C=void 0,d=void 0,h=void 0,f=void 0,c=r,p=Ne(e,s,p=t!=e.display.externalMeasured&&H(s)),g=s.markedSpans,m=s.text,v=0;if(g)for(var y=m.length,b=0,w=1,x="",k=0;;){if(k==b){for(var d=u=a=l=h="",C=null,k=1/0,S=[],L=void 0,M=0;M<g.length;++M){var T=g[M],N=T.marker;"bookmark"==N.type&&T.from==b&&N.widgetNode?S.push(N):T.from<=b&&(null==T.to||T.to>b||N.collapsed&&T.to==b&&T.from==b)?(null!=T.to&&T.to!=b&&k>T.to&&(k=T.to,u=""),N.className&&(d+=" "+N.className),N.css&&(h=(h?h+";":"")+N.css),N.startStyle&&T.from==b&&(a+=" "+N.startStyle),N.endStyle&&T.to==k&&(L=L||[]).push(N.endStyle,T.to),N.title&&!l&&(l=N.title),N.collapsed&&(!C||Y(C.marker,N)<0)&&(C=T)):T.from>b&&k>T.from&&(k=T.from)}if(L)for(M=0;M<L.length;M+=2)L[M+1]==k&&(u+=" "+L[M]);if(!C||C.from==b)for(L=0;L<S.length;++L)Re(c,0,S[L]);if(C&&(C.from||0)==b){if(Re(c,(null==C.to?y+1:C.to)-b,C.marker,null==C.from),null==C.to)break e;C.to==b&&(C=!1)}}if(y<=b)break;for(S=Math.min(y,k);;){if(x){if(L=b+x.length,C||(M=S<L?x.slice(0,S-b):x,c.addToken(c,M,f?f+d:d,a,b+M.length==k?u:"",l,h)),S<=L){x=x.slice(S-b),b=S;break}b=L,a=""}x=m.slice(v,v=p[w++]),f=Ee(p[w++],c.cm.options)}}else for(C=1;C<p.length;C+=2)c.addToken(c,m.slice(v,v=p[C]),Ee(p[C+1],c.cm.options))}s.styleClasses&&(s.styleClasses.bgClass&&(r.bgClass=D(s.styleClasses.bgClass,r.bgClass||"")),s.styleClasses.textClass&&(r.textClass=D(s.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild((n=e.display.measure,i=void 0,null==Mi&&(i=W("span",""),O(n,W("span",[i,document.createTextNode("x")])),0!=n.firstChild.offsetHeight&&(Mi=i.offsetWidth<=1&&2<i.offsetHeight&&!(ai&&si<8))),(n=Mi?W("span",""):W("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")).setAttribute("cm-text",""),n))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return ci&&(o=r.content.lastChild,/\bcm-tab\b/.test(o.className)||o.querySelector&&o.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack"),fe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=D(r.pre.className,r.textClass||"")),r}function Fe(e){var t=W("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Be(e,t,r,n,i,o,l){if(t){if(e.splitSpaces)if(u=e.trailingSpace,1<t.length&&!/ /.test(t))u=t;else{for(var a="",s=0;s<t.length;s++){var c=t.charAt(s);a+=c=" "==c&&u&&(s==t.length-1||32==t.charCodeAt(s+1))?" ":c,u=" "==c}u=a}else u=t;if(a=u,c=!1,(s=e.cm.state.specialChars).test(t))for(var u=document.createDocumentFragment(),d=0;;){s.lastIndex=d;var h,f=s.exec(t),p=f?f.index-d:t.length-d;if(p&&(h=document.createTextNode(a.slice(d,d+p)),ai&&si<9?u.appendChild(W("span",[h])):u.appendChild(h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p),!f)break;d+=p+1,"\t"==f[0]?(f=e.cm.options.tabSize,f-=e.col%f,(p=u.appendChild(W("span",g(f),"cm-tab"))).setAttribute("role","presentation"),p.setAttribute("cm-text","\t"),e.col+=f):("\r"==f[0]||"\n"==f[0]?(p=u.appendChild(W("span","\r"==f[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",f[0]):((p=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),ai&&si<9?u.appendChild(W("span",[p])):u.appendChild(p)),e.col+=1),e.map.push(e.pos,e.pos+1,p),e.pos++}else e.col+=t.length,u=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,u),ai&&si<9&&(c=!0),e.pos+=t.length;if(e.trailingSpace=32==a.charCodeAt(t.length-1),r||n||i||c||l)return t=r||"",n&&(t+=n),i&&(t+=i),n=W("span",[u],t,l),o&&(n.title=o),e.content.appendChild(n);e.content.appendChild(u)}}function Re(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"))).setAttribute("cm-marker",r.id),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function je(e,t,r){for(var n,i=this.line=t;i=Z(i,!1);)i=i.find(1,!0).line,(n=n||[]).push(i);this.size=(this.rest=n)?H(p(this.rest))-r+1:1,this.node=this.text=null,this.hidden=re(e,t)}function Ve(e,t,r){for(var n=[],i=t;i<r;)i+=(t=new je(e.doc,C(e.doc,i),i)).size,n.push(t);return n}function Ke(e,t){var r=e._handlers&&e._handlers[t]||Gi;if(r.length){var n,i=Array.prototype.slice.call(arguments,2);lo?n=lo.delayedCallbacks:ao?n=ao:(n=ao=[],setTimeout(Ge,0));for(var o=0;o<r.length;++o)!function(e){n.push(function(){return r[e].apply(null,i)})}(o)}}function Ge(){var e=ao;ao=null;for(var t=0;t<e.length;++t)e[t]()}function Ue(e,t,r,n){for(var i=0;i<t.changes.length;i++)if("text"==(o=t.changes[i])){var o,l=t,a=l.text.className,s=_e(o=e,l);l.text==l.node&&(l.node=s.pre),l.text.parentNode.replaceChild(s.pre,l.text),l.text=s.pre,s.bgClass!=l.bgClass||s.textClass!=l.textClass?(l.bgClass=s.bgClass,l.textClass=s.textClass,$e(o,l)):a&&(l.text.className=a)}else if("gutter"==o)Xe(e,t,r,n);else if("class"==o)$e(e,t);else if("widget"==o){o=e,a=n,(l=t).alignable&&(l.alignable=null);for(var c,s=l.node.firstChild;s;s=c)c=s.nextSibling,"CodeMirror-linewidget"==s.className&&l.node.removeChild(s);Ye(o,l,a)}t.changes=null}function qe(e){return e.node==e.text&&(e.node=W("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),ai&&si<8&&(e.node.style.zIndex=2)),e.node}function _e(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Ie(e,t)}function $e(e,t){var r,n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;n&&(n+=" CodeMirror-linebackground"),t.background?n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null):n&&(r=qe(t),t.background=r.insertBefore(W("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)),t.line.wrapClass?qe(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className=""),t.text.className=(t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass)||""}function Xe(e,t,r,n){var i;if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass&&(i=qe(t),t.gutterBackground=W("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)),i=t.line.gutterMarkers,e.options.lineNumbers||i){var o=qe(t),l=t.gutter=W("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),o.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(W("div",P(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(t=0;t<e.options.gutters.length;++t)r=e.options.gutters[t],(o=i.hasOwnProperty(r)&&i[r])&&l.appendChild(W("div",[o],"CodeMirror-gutter-elt","left: "+n.gutterLeft[r]+"px; width: "+n.gutterWidth[r]+"px"))}}function Ye(e,t,r){if(Ze(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Ze(e,t.rest[n],t,r,!1)}function Ze(e,t,r,n,i){if(t.widgets){var o=qe(r),l=0;for(t=t.widgets;l<t.length;++l){var a=t[l],s=W("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||s.setAttribute("cm-ignore-events","true");var c,u=a,d=s,h=n;u.noHScroll&&((r.alignable||(r.alignable=[])).push(d),c=h.wrapperWidth,d.style.left=h.fixedPos+"px",u.coverGutter||(c-=h.gutterTotalWidth,d.style.paddingLeft=h.gutterTotalWidth+"px"),d.style.width=c+"px"),u.coverGutter&&(d.style.zIndex=5,d.style.position="relative",u.noHScroll||(d.style.marginLeft=-h.gutterTotalWidth+"px")),e.display.input.setUneditable(s),i&&a.above?o.insertBefore(s,r.gutter||r.text):o.appendChild(s),Ke(a,"redraw")}}}function Qe(e){if(null!=e.height)return e.height;var t,r=e.doc.cm;return r?(u(document.body,e.node)||(t="position: relative;",e.coverGutter&&(t+="margin-left: -"+r.display.gutters.offsetWidth+"px;"),e.noHScroll&&(t+="width: "+r.display.wrapper.clientWidth+"px;"),O(r.display.measure,W("div",[e.node],null,t))),e.height=e.node.parentNode.offsetHeight):0}function Je(e,t){for(t=t.target||t.srcElement;t!=e.wrapper;t=t.parentNode)if(!t||1==t.nodeType&&"true"==t.getAttribute("cm-ignore-events")||t.parentNode==e.sizer&&t!=e.mover)return!0}function et(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function tt(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=O(e.measure,W("pre","x")),t=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,t={left:parseInt(t.paddingLeft),right:parseInt(t.paddingRight)};return isNaN(t.left)||isNaN(t.right)||(e.cachedPaddingH=t),t}function rt(e){return 30-e.display.nativeBarWidth}function nt(e){return e.display.scroller.clientWidth-rt(e)-e.display.barWidth}function it(e){return e.display.scroller.clientHeight-rt(e)-e.display.barHeight}function ot(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(t=0;t<e.rest.length;t++)if(H(e.rest[t])>r)return{map:e.measure.maps[t],cache:e.measure.caches[t],before:!0}}function lt(e,t){return t>=e.display.viewFrom&&t<e.display.viewTo?e.display.view[Tt(e,t)]:(e=e.display.externalMeasured)&&t>=e.lineN&&t<e.lineN+e.size?e:void 0}function at(e,t){var r,n=H(t),i=lt(e,n);return i&&!i.text?i=null:i&&i.changes&&(Ue(e,i,n,kt(e)),e.curOp.forceUpdate=!0),i||(i=H(r=J(t)),(r=e.display.externalMeasured=new je(e.doc,r,i)).lineN=i,i=r.built=Ie(e,r),r.text=i.pre,O(e.display.lineMeasure,i.pre),i=r),{line:t,view:i,rect:null,map:(e=ot(i,t,n)).map,cache:e.cache,before:e.before,hasHeights:!1}}function st(e,t,r,n,i){var o,l=(r=t.before?-1:r)+(n||"");if(t.cache.hasOwnProperty(l))e=t.cache[l];else{if(t.rect||(t.rect=t.view.text.getBoundingClientRect()),!t.hasHeights){var a=t.view,s=t.rect,c=e.options.lineWrapping,u=c&&nt(e);if(!a.measure.heights||c&&a.measure.width!=u){var d=a.measure.heights=[];if(c)for(a.measure.width=u,a=a.text.firstChild.getClientRects(),c=0;c<a.length-1;c++){var u=a[c],h=a[c+1];2<Math.abs(u.bottom-h.bottom)&&d.push((u.bottom+h.top)/2-s.top)}d.push(s.bottom-s.top)}t.hasHeights=!0}if(n=(a=ct(t.map,r,d=n)).node,s=a.start,c=a.end,r=a.collapse,3==n.nodeType){for(var f=0;f<4;f++){for(;s&&v(t.line.text.charAt(a.coverStart+s));)--s;for(;a.coverStart+c<a.coverEnd&&v(t.line.text.charAt(a.coverStart+c));)++c;if(ai&&si<9&&0==s&&c==a.coverEnd-a.coverStart)o=n.parentNode.getBoundingClientRect();else{if(o=Ci(n,s,c).getClientRects(),c=so,"left"==d)for(u=0;u<o.length&&(c=o[u]).left==c.right;u++);else for(u=o.length-1;0<=u&&(c=o[u]).left==c.right;u--);o=c}if(o.left||o.right||0==s)break;c=s,--s,r="right"}ai&&si<11&&((f=!(f=!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI)?!(f=null!=Yi?Yi:(f=(d=O(e.display.measure,W("span","x"))).getBoundingClientRect(),d=Ci(d,0,1).getBoundingClientRect(),Yi=1<Math.abs(f.left-d.left))):f)||(f=screen.logicalXDPI/screen.deviceXDPI,d=screen.logicalYDPI/screen.deviceYDPI,o={left:o.left*f,right:o.right*f,top:o.top*d,bottom:o.bottom*d}))}else 0<s&&(r=d="right"),o=e.options.lineWrapping&&1<(f=n.getClientRects()).length?f["right"==d?f.length-1:0]:n.getBoundingClientRect();for(f=((n=(o=ai&&si<9&&!s&&(!o||!o.left&&!o.right)?(o=n.parentNode.getClientRects()[0])?{left:o.left,right:o.left+xt(e.display),top:o.top,bottom:o.bottom}:so:o).top-t.rect.top)+(s=o.bottom-t.rect.top))/2,d=t.view.measure.heights,a=0;a<d.length-1&&!(f<d[a]);a++);r={left:("right"==r?o.right:o.left)-t.rect.left,right:("left"==r?o.left:o.right)-t.rect.left,top:a?d[a-1]:0,bottom:d[a]},o.left||o.right||(r.bogus=!0),e.options.singleCursorHeightPerLine||(r.rtop=n,r.rbottom=s),(e=r).bogus||(t.cache[l]=e)}return{left:e.left,right:e.right,top:i?e.rtop:e.top,bottom:i?e.rbottom:e.bottom}}function ct(e,t,r){for(var n,i,o,l,a,s,c=0;c<e.length;c+=3)if(a=e[c],s=e[c+1],t<a?(i=0,o=1,l="left"):t<s?o=(i=t-a)+1:(c==e.length-3||t==s&&e[c+3]>t)&&(i=(o=s-a)-1,s<=t&&(l="right")),null!=i){if(n=e[c+2],a==s&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)n=e[2+(c-=3)],l="left";if("right"==r&&i==s-a)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)n=e[(c+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function ut(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 dt(e){e.display.externalMeasure=null,A(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)ut(e.display.view[t])}function ht(e){dt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ft(e,t,r,n,i){if(!i&&t.widgets)for(i=0;i<t.widgets.length;++i){var o;t.widgets[i].above&&(o=Qe(t.widgets[i]),r.top+=o,r.bottom+=o)}return"line"==n||(n=n||"local",t=ne(t),t="local"==n?t+e.display.lineSpace.offsetTop:t-e.display.viewOffset,"page"!=n&&"window"!=n||(t+=(e=e.display.lineSpace.getBoundingClientRect()).top+("window"==n?0:window.pageYOffset||(document.documentElement||document.body).scrollTop),n=e.left+("window"==n?0:window.pageXOffset||(document.documentElement||document.body).scrollLeft),r.left+=n,r.right+=n),r.top+=t,r.bottom+=t),r}function pt(e,t,r){if("div"==r)return t;var n=t.left;return t=t.top,"page"==r?(n-=window.pageXOffset||(document.documentElement||document.body).scrollLeft,t-=window.pageYOffset||(document.documentElement||document.body).scrollTop):"local"!=r&&r||(n+=(r=e.display.sizer.getBoundingClientRect()).left,t+=r.top),{left:n-(e=e.display.lineSpace.getBoundingClientRect()).left,top:t-e.top}}function gt(e,t,r,n,i){return n=n||C(e.doc,t.line),t=t.ch,ft(e,n,n=st(e,at(e,n),t,i),r)}function mt(r,e,n,i,o,l){function a(e,t){return e=st(r,o,e,t?"right":"left",l),t?e.left=e.right:e.right=e.left,ft(r,i,e,n)}function t(e,t,r){return a(r?e-1:e,0!=s[t].level%2!=r)}i=i||C(r.doc,e.line),o=o||at(r,i);var s=ae(i,r.doc.direction),c=e.ch;if(e=e.sticky,c>=i.text.length?(c=i.text.length,e="before"):c<=0&&(c=0,e="after"),!s)return a("before"==e?c-1:c,"before"==e);var u=le(s,c,e),d=Vi,u=t(c,u,"before"==e);return null!=d&&(u.other=t(c,d,"before"!=e)),u}function vt(e,t){var r=0;return t=V(e.doc,t),{left:r=!e.options.lineWrapping?xt(e.display)*t.ch:r,right:r,top:e=ne(t=C(e.doc,t.line))+e.display.lineSpace.offsetTop,bottom:e+t.height}}function yt(e,t,r){var n=e.doc;if((r+=e.display.viewOffset)<0)return(e=E(n.first,0,null)).xRel=-1,e.outside=!0,e;var i=T(n,r),o=n.first+n.size-1;if(o<i)return e=C(n,o).text.length,(e=E(n.first+n.size-1,e,null)).xRel=1,e.outside=!0,e;for(t<0&&(t=0),o=C(n,i);;){if(n=function(r,n,e,i,o){o-=ne(n);var t,l=0,a=n.text.length,s=at(r,n);if(ae(n,r.doc.direction)){r.options.lineWrapping&&(t=bt(r,n,s,o),l=t.begin,a=t.end),e=new E(e,l);var c=mt(r,e,"line",n,s).left;t=c<i?1:-1;var u,d=c-i;do{if(c=d,null==(e=de(r,n,u=e,t))||e.ch<l||a<=("before"==e.sticky?e.ch-1:e.ch)){e=u;break}}while(d=mt(r,e,"line",n,s).left-i,t<0!=d<0&&Math.abs(d)<=Math.abs(c));if(Math.abs(d)>Math.abs(c)){if(d<0==c<0)throw Error("Broke out of infinite loop in coordsCharInner");e=u}}else l=k(function(e){var t=ft(r,n,st(r,s,e),"line");return t.top>o?(a=Math.min(e,a),1):!(t.bottom<=o)&&(t.left>i||!(t.right<i)&&i-t.left<t.right-i)},l,a),l=y(n.text,l,1),e=new E(e,l,l==a?"before":"after");return l=mt(r,e,"line",n,s),(o<l.top||l.bottom<o)&&(e.outside=!0),e.xRel=i<l.left?-1:i>l.right?1:0,e}(e,o,i,t,r),o=(i=Z(o,!1))&&i.find(0,!0),!i||!(n.ch>o.from.ch||n.ch==o.from.ch&&0<n.xRel))return n;i=H(o=o.to.line)}}function bt(t,r,n,i){var e=r.text.length,o=k(function(e){return ft(t,r,st(t,n,e-1),"line").bottom<=i},e,0);return{begin:o,end:e=k(function(e){return ft(t,r,st(t,n,e),"line").top>i},o,e)}}function wt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==no){no=W("pre");for(var t=0;t<49;++t)no.appendChild(document.createTextNode("x")),no.appendChild(W("br"));no.appendChild(document.createTextNode("x"))}return O(e.measure,no),3<(t=no.offsetHeight/50)&&(e.cachedTextHeight=t),A(e.measure),t||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=W("span","xxxxxxxxxx"),r=W("pre",[t]);return O(e.measure,r),2<(t=((t=t.getBoundingClientRect()).right-t.left)/10)&&(e.cachedCharWidth=t),t||10}function kt(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:Ct(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function Ct(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function St(n){var i=wt(n.display),o=n.options.lineWrapping,l=o&&Math.max(5,n.display.scroller.clientWidth/xt(n.display)-3);return function(e){if(re(n.doc,e))return 0;var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;r++)e.widgets[r].height&&(t+=e.widgets[r].height);return o?t+(Math.ceil(e.text.length/l)||1)*i:t+i}}function Lt(e){var t=e.doc,r=St(e);t.iter(function(e){var t=r(e);t!=e.height&&M(e,t)})}function Mt(e,t,r,n){var i,o,l,a=e.display;if(!r&&"true"==(t.target||t.srcElement).getAttribute("cm-not-content"))return null;r=a.lineSpace.getBoundingClientRect();try{i=t.clientX-r.left,o=t.clientY-r.top}catch(e){return null}return t=yt(e,i,o),n&&1==t.xRel&&(l=C(e.doc,t.line).text).length==t.ch&&(n=w(l,l.length,e.options.tabSize)-l.length,t=E(t.line,Math.max(0,Math.round((i-tt(e.display).left)/xt(e.display))-n))),t}function Tt(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;e=e.display.view;for(var r=0;r<e.length;r++)if((t-=e[r].size)<0)return r}function Nt(e){e.display.input.showSelection(e.display.input.prepareSelection())}function At(e,t){for(var r,n,i=e.doc,o={},l=o.cursors=document.createDocumentFragment(),a=o.selection=document.createDocumentFragment(),s=0;s<i.sel.ranges.length;s++)!1===t&&s==i.sel.primIndex||(r=i.sel.ranges[s]).from().line>=e.display.viewTo||r.to().line<e.display.viewFrom||(((n=r.empty())||e.options.showCursorWhenSelecting)&&Ot(e,r.head,l),n||function(f,e,t){function p(e,t,r,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),o.appendChild(W("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==r?m-e:r)+"px;\n height: "+(n-t)+"px"))}function r(l,a,s){var c,u,d=C(i,l),h=d.text.length;return function(e,t,r,n){if(!e)return n(t,r,"ltr");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"),i=!0)}i||n(t,r,"ltr")}(ae(d,i.direction),a||0,null==s?h:s,function(e,t,r){var n,i,o=gt(f,E(l,e),"div",d,"left");e==t?r=i=(n=o).left:(n=gt(f,E(l,t-1),"div",d,"right"),"rtl"==r&&(r=o,o=n,n=r),r=o.left,i=n.right),null==a&&0==e&&(r=g),3<n.top-o.top&&(p(r,o.top,null,o.bottom),r=g,o.bottom<n.top&&p(r,o.bottom,null,n.top)),(!c||o.top<c.top||o.top==c.top&&o.left<c.left)&&(c=o),(!u||n.bottom>u.bottom||n.bottom==u.bottom&&n.right>u.right)&&(u=n),p(r=r<g+1?g:r,n.top,(i=null==s&&t==h?m:i)-r,n.bottom)}),{start:c,end:u}}var n=f.display,i=f.doc,o=document.createDocumentFragment(),g=(a=tt(f.display)).left,m=Math.max(n.sizerWidth,nt(f)-n.sizer.offsetLeft)-a.right,n=e.from();{var l,a;e=e.to(),n.line==e.line?r(n.line,n.ch,e.ch):(l=C(i,n.line),a=C(i,e.line),a=J(l)==J(a),n=r(n.line,n.ch,a?l.text.length+1:null).end,e=r(e.line,a?0:null,e.ch).start,a&&(n.top<e.top-2?(p(n.right,n.top,null,n.bottom),p(g,e.top,e.left,e.bottom)):p(n.right,n.top,e.left-n.right,n.bottom)),n.bottom<e.top&&p(g,n.bottom,null,e.top))}t.appendChild(o)}(e,r,a));return o}function Ot(e,t,r){t=mt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine);var n=r.appendChild(W("div"," ","CodeMirror-cursor"));n.style.left=t.left+"px",n.style.top=t.top+"px",n.style.height=Math.max(0,t.bottom-t.top)*e.options.cursorHeight+"px",t.other&&((e=r.appendChild(W("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"))).style.display="",e.style.left=t.other.left+"px",e.style.top=t.other.top+"px",e.style.height=.85*(t.other.bottom-t.other.top)+"px")}function Wt(e){var t,r;e.state.focused&&(t=e.display,clearInterval(t.blinker),r=!0,t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?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 zt(e){e.state.focused||(e.display.input.focus(),Dt(e))}function Dt(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(fe(e,"focus",e,t),e.state.focused=!0,o(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),ci&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Wt(e))}function Ht(e,t){e.state.delayingBlurEvent||(e.state.focused&&(fe(e,"blur",e,t),e.state.focused=!1,ki(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Pt(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=Ct(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 Et(e){if(e.options.lineNumbers){var t=e.doc,t=P(e.options,t.first+t.size-1),r=e.display;if(t.length!=r.lineNumChars){var n=(i=r.measure.appendChild(W("div",[W("div",t)],"CodeMirror-linenumber CodeMirror-gutter-elt"))).firstChild.offsetWidth,i=i.offsetWidth-n;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(n,r.lineGutter.offsetWidth-i)+1,r.lineNumWidth=r.lineNumInnerWidth+i,r.lineNumChars=r.lineNumInnerWidth?t.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",gr(e),1}}}function It(e){for(var t=(e=e.display).lineDiv.offsetTop,r=0;r<e.view.length;r++){var n,i,o=e.view[r];if(!o.hidden)if(ai&&si<8?(i=(n=o.node.offsetTop+o.node.offsetHeight)-t,t=n):i=(i=o.node.getBoundingClientRect()).bottom-i.top,n=o.line.height-i,i<2&&(i=wt(e)),(.001<n||n<-.001)&&(M(o.line,i),Ft(o.line),o.rest))for(i=0;i<o.rest.length;i++)Ft(o.rest[i])}}function Ft(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function Bt(e,t,r){var n,i=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop,i=Math.floor(i-e.lineSpace.offsetTop),o=r&&null!=r.bottom?r.bottom:i+e.wrapper.clientHeight,i=T(t,i),o=T(t,o);return r&&r.ensure&&(n=r.ensure.from.line,r=r.ensure.to.line,n<i?o=T(t,ne(C(t,i=n))+e.wrapper.clientHeight):Math.min(r,t.lastLine())>=o&&(i=T(t,ne(C(t,r))-e.wrapper.clientHeight),o=r)),{from:i,to:Math.max(o,i+1)}}function Rt(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,ni||pr(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),ni&&pr(e),ur(e,100))}function jt(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Pt(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Vt(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 Kt(e){return(e=Vt(e)).x*=uo,e.y*=uo,e}function Gt(e,t){var r=(n=Vt(t)).x,n=n.y,i=e.display,o=i.scroller,l=o.scrollWidth>o.clientWidth,a=o.scrollHeight>o.clientHeight;if(r&&l||n&&a){if(n&&yi&&ci){var l=t.target,s=i.view;e:for(;l!=o;l=l.parentNode)for(var c=0;c<s.length;c++)if(s[c].node==l){e.display.currentWheelTarget=l;break e}}!r||ni||di||null==uo?(n&&null!=uo&&(l=(a=e.doc.scrollTop)+i.wrapper.clientHeight,(t=n*uo)<0?a=Math.max(0,a+t-50):l=Math.min(e.doc.height,l+t+50),pr(e,{top:a,bottom:l})),co<20&&(null==i.wheelStartX?(i.wheelStartX=o.scrollLeft,i.wheelStartY=o.scrollTop,i.wheelDX=r,i.wheelDY=n,setTimeout(function(){var e,t;null!=i.wheelStartX&&(t=o.scrollLeft-i.wheelStartX,t=(e=o.scrollTop-i.wheelStartY)&&i.wheelDY&&e/i.wheelDY||t&&i.wheelDX&&t/i.wheelDX,i.wheelStartX=i.wheelStartY=null,t&&(uo=(uo*co+t)/(co+1),++co))},200)):(i.wheelDX+=r,i.wheelDY+=n))):(n&&a&&Rt(e,Math.max(0,Math.min(o.scrollTop+n*uo,o.scrollHeight-o.clientHeight))),jt(e,Math.max(0,Math.min(o.scrollLeft+r*uo,o.scrollWidth-o.clientWidth))),(!n||n&&a)&&ve(t),i.wheelStartX=null)}}function Ut(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+et(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+rt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function qt(e,t){t=t||Ut(e);var r=e.display.barWidth,n=e.display.barHeight;for(_t(e,t),t=0;t<4&&r!=e.display.barWidth||n!=e.display.barHeight;t++)r!=e.display.barWidth&&e.options.lineWrapping&&It(e),_t(e,Ut(e)),r=e.display.barWidth,n=e.display.barHeight}function _t(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}function $t(r){r.display.scrollbars&&(r.display.scrollbars.clear(),r.display.scrollbars.addClass&&ki(r.display.wrapper,r.display.scrollbars.addClass)),r.display.scrollbars=new ho[r.options.scrollbarStyle](function(e){r.display.wrapper.insertBefore(e,r.display.scrollbarFiller),Ui(e,"mousedown",function(){r.state.focused&&setTimeout(function(){return r.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?jt:Rt)(r,e)},r),r.display.scrollbars.addClass&&o(r.display.wrapper,r.display.scrollbars.addClass)}function Xt(e,t){var r=e.display,n=wt(e.display);t.top<0&&(t.top=0);var i=(e.curOp&&null!=e.curOp.scrollTop?e.curOp:r.scroller).scrollTop,o=it(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+et(r),s=t.top<n,n=t.bottom>a-n;return t.top<i?l.scrollTop=s?0:t.top:t.bottom>i+o&&((o=Math.min(t.top,(n?a:t.bottom)-o))!=i&&(l.scrollTop=o)),i=(e.curOp&&null!=e.curOp.scrollLeft?e.curOp:r.scroller).scrollLeft,e=nt(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),(r=t.right-t.left>e)&&(t.right=t.left+e),t.left<10?l.scrollLeft=0:t.left<i?l.scrollLeft=Math.max(0,t.left-(r?0:10)):t.right>e+i-3&&(l.scrollLeft=t.right+(r?0:10)-e),l}function Yt(e,t,r){null==t&&null==r||Qt(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc:e.curOp).scrollLeft+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc:e.curOp).scrollTop+r)}function Zt(e){Qt(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?E(t.line,t.ch-1):t,n=E(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin}}function Qt(e){var t,r,n=e.curOp.scrollToPos;n&&(e.curOp.scrollToPos=null,t=vt(e,n.from),r=vt(e,n.to),n=Xt(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n.margin,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n.margin}),e.scrollTo(n.scrollLeft,n.scrollTop))}function Jt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++fo},e=e.curOp,lo?lo.ops.push(e):e.ownsGroup=lo={ops:[e],delayedCallbacks:[]}}function er(e){!function(e,t){if(e=e.ownsGroup)try{var r=e.delayedCallbacks,n=0;do{for(;n<r.length;n++)r[n].call(null);for(var i=0;i<e.ops.length;i++){var o=e.ops[i];if(o.cursorActivityHandlers)for(;o.cursorActivityCalled<o.cursorActivityHandlers.length;)o.cursorActivityHandlers[o.cursorActivityCalled++].call(null,o.cm)}}while(n<r.length)}finally{lo=null,t(e)}}(e.curOp,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;for(e=e.ops,t=0;t<e.length;t++){var r=(i=(n=e[t]).cm).display;!(l=i.display).scrollbarsClipped&&l.scroller.offsetWidth&&(l.nativeBarWidth=l.scroller.offsetWidth-l.scroller.clientWidth,l.heightForcer.style.height=rt(i)+"px",l.sizer.style.marginBottom=-l.nativeBarWidth+"px",l.sizer.style.borderRightWidth=rt(i)+"px",l.scrollbarsClipped=!0),n.updateMaxLine&&oe(i),n.mustUpdate=n.viewChanged||n.forceUpdate||null!=n.scrollTop||n.scrollToPos&&(n.scrollToPos.from.line<r.viewFrom||n.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&i.options.lineWrapping,n.update=n.mustUpdate&&new po(i,n.mustUpdate&&{top:n.scrollTop,ensure:n.scrollToPos},n.forceUpdate)}for(t=0;t<e.length;t++)(n=e[t]).updatedDisplay=n.mustUpdate&&hr(n.cm,n.update);for(t=0;t<e.length;t++)r=(i=(n=e[t]).cm).display,n.updatedDisplay&&It(i),n.barMeasure=Ut(i),r.maxLineChanged&&!i.options.lineWrapping&&(l=r.maxLine.text.length,l=st(i,at(i,r.maxLine),l,void 0),n.adjustWidthTo=l.left+3,i.display.sizerWidth=n.adjustWidthTo,n.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+n.adjustWidthTo+rt(i)+i.display.barWidth),n.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+n.adjustWidthTo-nt(i))),(n.updatedDisplay||n.selectionChanged)&&(n.preparedSelection=r.input.prepareSelection(n.focus));for(t=0;t<e.length;t++)i=(n=e[t]).cm,null!=n.adjustWidthTo&&(i.display.sizer.style.minWidth=n.adjustWidthTo+"px",n.maxScrollLeft<i.doc.scrollLeft&&jt(i,Math.min(i.display.scroller.scrollLeft,n.maxScrollLeft),!0),i.display.maxLineChanged=!1),r=n.focus&&n.focus==b()&&(!document.hasFocus||document.hasFocus()),n.preparedSelection&&i.display.input.showSelection(n.preparedSelection,r),!n.updatedDisplay&&n.startHeight==i.doc.height||qt(i,n.barMeasure),n.updatedDisplay&&mr(i,n.barMeasure),n.selectionChanged&&Wt(i),i.state.focused&&n.updateInput&&i.display.input.reset(n.typing),r&&zt(n.cm);for(t=0;t<e.length;t++){var n,i,o=void 0,r=(i=(n=e[t]).cm).display,l=i.doc;if(n.updatedDisplay&&fr(i,n.update),null==r.wheelStartX||null==n.scrollTop&&null==n.scrollLeft&&!n.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==n.scrollTop||r.scroller.scrollTop==n.scrollTop&&!n.forceScroll||(l.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,n.scrollTop)),r.scrollbars.setScrollTop(l.scrollTop),r.scroller.scrollTop=l.scrollTop),null==n.scrollLeft||r.scroller.scrollLeft==n.scrollLeft&&!n.forceScroll||(l.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,n.scrollLeft)),r.scrollbars.setScrollLeft(l.scrollLeft),r.scroller.scrollLeft=l.scrollLeft,Pt(i)),n.scrollToPos){var a=V(l,n.scrollToPos.from),s=V(l,n.scrollToPos.to),c=n.scrollToPos.margin;null==c&&(c=0);for(var u=0;u<5;u++){var d=!1,o=mt(i,a),h=s&&s!=a?mt(i,s):o,h=Xt(i,o={left:Math.min(o.left,h.left),top:Math.min(o.top,h.top)-c,right:Math.max(o.left,h.left),bottom:Math.max(o.bottom,h.bottom)+c}),f=i.doc.scrollTop,p=i.doc.scrollLeft;if(null!=h.scrollTop&&(Rt(i,h.scrollTop),1<Math.abs(i.doc.scrollTop-f)&&(d=!0)),null!=h.scrollLeft&&(jt(i,h.scrollLeft),1<Math.abs(i.doc.scrollLeft-p)&&(d=!0)),!d)break}s=o,pe(i,"scrollCursorIntoView")||(u=(c=i.display).sizer.getBoundingClientRect(),a=null,s.top+u.top<0?a=!0:s.bottom+u.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),null==a||pi||(s=W("div","",null,"position: absolute;\n top: "+(s.top-c.viewOffset-i.display.lineSpace.offsetTop)+"px;\n height: "+(s.bottom-s.top+rt(i)+c.barHeight)+"px;\n left: "+s.left+"px; width: "+Math.max(2,s.right-s.left)+"px;"),i.display.lineSpace.appendChild(s),s.scrollIntoView(a),i.display.lineSpace.removeChild(s)))}if(s=n.maybeHiddenMarkers,a=n.maybeUnhiddenMarkers,s)for(c=0;c<s.length;++c)s[c].lines.length||fe(s[c],"hide");if(a)for(s=0;s<a.length;++s)a[s].lines.length&&fe(a[s],"unhide");r.wrapper.offsetHeight&&(l.scrollTop=i.display.scroller.scrollTop),n.changeObjs&&fe(i,"changes",i,n.changeObjs),n.update&&n.update.finish()}})}function tr(e,t){if(e.curOp)return t();Jt(e);try{return t()}finally{er(e)}}function rr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Jt(e);try{return t.apply(e,arguments)}finally{er(e)}}}function nr(e){return function(){if(this.curOp)return e.apply(this,arguments);Jt(this);try{return e.apply(this,arguments)}finally{er(this)}}}function ir(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);Jt(e);try{return t.apply(this,arguments)}finally{er(e)}}}function or(e,t,r,n){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size);var i,o,l=e.display;(n=n||0)&&r<l.viewTo&&(null==l.updateLineNumbers||l.updateLineNumbers>t)&&(l.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=l.viewTo?ji&&ee(e.doc,t)<l.viewTo&&ar(e):r<=l.viewFrom?ji&&te(e.doc,r+n)>l.viewFrom?ar(e):(l.viewFrom+=n,l.viewTo+=n):t<=l.viewFrom&&r>=l.viewTo?ar(e):t<=l.viewFrom?(i=sr(e,r,r+n,1))?(l.view=l.view.slice(i.index),l.viewFrom=i.lineN,l.viewTo+=n):ar(e):r>=l.viewTo?(i=sr(e,t,t,-1))?(l.view=l.view.slice(0,i.index),l.viewTo=i.lineN):ar(e):(i=sr(e,t,t,-1),o=sr(e,r,r+n,1),i&&o?(l.view=l.view.slice(0,i.index).concat(Ve(e,i.lineN,o.lineN)).concat(l.view.slice(o.index)),l.viewTo+=n):ar(e)),(e=l.externalMeasured)&&(r<e.lineN?e.lineN+=n:t<e.lineN+e.size&&(l.externalMeasured=null))}function lr(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo||(null==(e=n.view[Tt(e,t)]).node||-1==h(e=e.changes||(e.changes=[]),r)&&e.push(r))}function ar(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function sr(e,t,r,n){var i=Tt(e,t),o=e.display.view;if(!ji||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var l=e.display.viewFrom,a=0;a<i;a++)l+=o[a].size;if(l!=t){if(0<n){if(i==o.length-1)return null;t=l+o[i].size-t,i++}else t=l-t;r+=t}for(;ee(e.doc,r)!=r;){if(i==(n<0?0:o.length-1))return null;r+=n*o[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function cr(e){e=e.display.view;for(var t=0,r=0;r<e.length;r++){var n=e[r];n.hidden||n.node&&!n.changes||++t}return t}function ur(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,s(dr,e))}function dr(o){var l,a,s,c=o.doc;c.frontier<c.first&&(c.frontier=c.first),c.frontier>=o.display.viewTo||(l=+new Date+o.options.workTime,a=Se(c.mode,Ae(o,c.frontier)),s=[],c.iter(c.frontier,Math.min(c.first+c.size,o.display.viewTo+500),function(e){if(c.frontier>=o.display.viewFrom){var t=e.styles,r=e.text.length>o.options.maxHighlightLength,n=Te(o,e,r?Se(c.mode,a):a,!0);e.styles=n.styles;var i=e.styleClasses;for((n=n.classes)?e.styleClasses=n:i&&(e.styleClasses=null),i=!t||t.length!=e.styles.length||i!=n&&(!i||!n||i.bgClass!=n.bgClass||i.textClass!=n.textClass),n=0;!i&&n<t.length;++n)i=t[n]!=e.styles[n];i&&s.push(c.frontier),e.stateAfter=r?a:Se(c.mode,a)}else e.text.length<=o.options.maxHighlightLength&&Oe(o,e.text,a),e.stateAfter=0==c.frontier%5?Se(c.mode,a):null;if(++c.frontier,+new Date>l)return ur(o,o.options.workDelay),!0}),s.length&&tr(o,function(){for(var e=0;e<s.length;e++)lr(o,s[e],"text")}))}function hr(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return ar(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==cr(e))return!1;Et(e)&&(ar(e),t.dims=kt(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);return 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)),ji&&(o=ee(e.doc,o),l=te(e.doc,l)),n=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth,0==(i=e.display).view.length||o>=i.viewTo||l<=i.viewFrom?(i.view=Ve(e,o,l),i.viewFrom=o):(i.viewFrom>o?i.view=Ve(e,o,i.viewFrom).concat(i.view):i.viewFrom<o&&(i.view=i.view.slice(Tt(e,o))),i.viewFrom=o,i.viewTo<l?i.view=i.view.concat(Ve(e,i.viewTo,l)):i.viewTo>l&&(i.view=i.view.slice(0,Tt(e,l)))),i.viewTo=l,r.viewOffset=ne(C(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px",l=cr(e),!(!n&&0==l&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)||(o=b(),4<l&&(r.lineDiv.style.display="none"),function(r,e,t){function n(e){var t=e.nextSibling;return ci&&yi&&r.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var i=r.display,o=r.options.lineNumbers,l=i.lineDiv,a=l.firstChild,s=i.view,i=i.viewFrom,c=0;c<s.length;c++){var u=s[c];if(!u.hidden)if(u.node&&u.node.parentNode==l){for(;a!=u.node;)a=n(a);a=o&&null!=e&&e<=i&&u.lineNumber,u.changes&&(-1<h(u.changes,"gutter")&&(a=!1),Ue(r,u,i,t)),a&&(A(u.lineNumber),u.lineNumber.appendChild(document.createTextNode(P(r.options,i)))),a=u.node.nextSibling}else{var d=function(e,t,r,n){var i=_e(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),$e(e,t),Xe(e,t,r,n),Ye(e,t,n),t.node}(r,u,i,t);l.insertBefore(d,a)}i+=u.size}for(;a;)a=n(a)}(e,r.updateLineNumbers,t.dims),4<l&&(r.lineDiv.style.display=""),r.renderedView=r.view,o&&b()!=o&&o.offsetHeight&&o.focus(),A(r.cursorDiv),A(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,n&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ur(e,400)),r.updateLineNumbers=null))}function fr(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=nt(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+et(e.display)-it(e),r.top)}),t.visible=Bt(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&hr(e,t);n=!1)It(e),n=Ut(e),Nt(e),qt(e,n),mr(e,n);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 pr(e,t){var r;hr(e,t=new po(e,t))&&(It(e),fr(e,t),r=Ut(e),Nt(e),qt(e,r),mr(e,r),t.finish())}function gr(e){e.display.sizer.style.marginLeft=e.display.gutters.offsetWidth+"px"}function mr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+rt(e)+"px"}function vr(e){var t=e.display.gutters,r=e.options.gutters;A(t);for(var n=0;n<r.length;++n){var i=r[n],o=t.appendChild(W("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&((e.display.lineGutter=o).style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",gr(e)}function yr(e){var t=h(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):-1<t&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function br(e,t){t=e[t],e.sort(function(e,t){return I(e.from(),t.from())}),t=h(e,t);for(var r=1;r<e.length;r++){var n,i,o=e[r],l=e[r-1];0<=I(l.to(),o.from())&&(n=j(l.from(),o.from()),i=R(l.to(),o.to()),o=l.empty()?o.from()==o.head:l.from()==l.head,r<=t&&--t,e.splice(--r,2,new mo(o?i:n,o?n:i)))}return new go(e,t)}function wr(e,t){return new go([new mo(e,t||e)],0)}function xr(e){return e.text?E(e.from.line+e.text.length-1,p(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function kr(e,t){if(I(e,t.from)<0)return e;if(I(e,t.to)<=0)return xr(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+=xr(t).ch-t.to.ch),E(r,n)}function Cr(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new mo(kr(i.anchor,t),kr(i.head,t)))}return br(r,e.sel.primIndex)}function Sr(e,t,r){return e.line==t.line?E(r.line,e.ch-t.ch+r.ch):E(r.line+(e.line-t.line),e.ch)}function Lr(e){e.doc.mode=ke(e.options,e.doc.modeOption),Mr(e)}function Mr(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,ur(e,100),e.state.modeGen++,e.curOp&&or(e)}function Tr(e,t){return 0==t.from.ch&&0==t.to.ch&&""==p(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Nr(e,n,i,o){function t(e,t,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),$(e),X(e,r),(t=o?o(e):1)!=e.height&&M(e,t),Ke(e,"change",e,n)}function r(e,t){for(var r=[];e<t;++e)r.push(new ro(s[e],i?i[e]:null,o));return r}var l=n.from,a=n.to,s=n.text,c=C(e,l.line),u=C(e,a.line),d=p(s),h=i?i[s.length-1]:null,f=a.line-l.line;n.full?(e.insert(0,r(0,s.length)),e.remove(s.length,e.size-s.length)):Tr(e,n)?(a=r(0,s.length-1),t(u,u.text,h),f&&e.remove(l.line,f),a.length&&e.insert(l.line,a)):c==u?1==s.length?t(c,c.text.slice(0,l.ch)+d+c.text.slice(a.ch),h):((f=r(1,s.length-1)).push(new ro(d+c.text.slice(a.ch),h,o)),t(c,c.text.slice(0,l.ch)+s[0],i?i[0]:null),e.insert(l.line+1,f)):1==s.length?(t(c,c.text.slice(0,l.ch)+s[0]+u.text.slice(a.ch),i?i[0]:null),e.remove(l.line+1,f)):(t(c,c.text.slice(0,l.ch)+s[0],i?i[0]:null),t(u,d+u.text.slice(a.ch),h),h=r(1,s.length-1),1<f&&e.remove(l.line+1,f-1),e.insert(l.line+1,h)),Ke(e,"change",e,n)}function Ar(e,a,s){!function e(t,r,n){if(t.linked)for(var i=0;i<t.linked.length;++i){var o,l=t.linked[i];l.doc!=r&&(o=n&&l.sharedHist,s&&!o||(a(l.doc,o),e(l.doc,t,o)))}}(e,null,!0)}function Or(e,t){if(t.cm)throw Error("This document is already in use.");Lt((e.doc=t).cm=e),Lr(e),Wr(e),e.options.lineWrapping||oe(e),e.options.mode=t.modeOption,or(e)}function Wr(e){("rtl"==e.doc.direction?o:ki)(e.display.lineDiv,"CodeMirror-rtl")}function zr(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOrigin=this.lastSelOrigin=this.lastOp=this.lastSelOp=null,this.generation=this.maxGeneration=e||1}function Dr(e,t){var r={from:B(t.from),to:xr(t),text:S(e,t.from,t.to)};return Ir(e,r,t.from.line,t.to.line+1),Ar(e,function(e){return Ir(e,r,t.from.line,t.to.line+1),0},!0),r}function Hr(e){for(;e.length&&p(e).ranges;)e.pop()}function Pr(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,a,s=+new Date;if(a=(a=i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))?o=i.lastOp==n?(Hr(i.done),p(i.done)):i.done.length&&!p(i.done).ranges?p(i.done):1<i.done.length&&!i.done[i.done.length-2].ranges?(i.done.pop(),p(i.done)):void 0:a)l=p(o.changes),0==I(t.from,t.to)&&0==I(t.from,l.to)?l.to=xr(t):o.changes.push(Dr(e,t));else for((o=p(i.done))&&o.ranges||Er(e.sel,i.done),o={changes:[Dr(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift();i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||fe(e,"historyAdded")}function Er(e,t){var r=p(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Ir(t,r,e,n){var i=r["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,n),function(e){e.markedSpans&&((i=i||(r["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function Fr(e,t){var r;if(r=t["spans_"+e.id]){for(var n=[],i=0;i<t.text.length;++i)n.push(function(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}(r[i]));r=n}else r=null;if(e=q(e,t),!r)return e;if(!e)return r;for(t=0;t<r.length;++t)if(n=r[t],i=e[t],n&&i){var o=0;e:for(;o<i.length;++o){for(var l=i[o],a=0;a<n.length;++a)if(n[a].marker==l.marker)continue e;n.push(l)}}else i&&(r[t]=i);return r}function Br(e,t,r){for(var n=[],i=0;i<e.length;++i)if((o=e[i]).ranges)n.push(r?go.prototype.deepCopy.call(o):o);else{var o=o.changes,l=[];n.push({changes:l});for(var a=0;a<o.length;++a){var s,c=o[a];if(l.push({from:c.from,to:c.to,text:c.text}),t)for(var u in c)(s=u.match(/^spans_(\d+)$/))&&-1<h(t,Number(s[1]))&&(p(l)[u]=c[u],delete c[u])}}return n}function Rr(e,t,r,n){return e.cm&&e.cm.display.shift||e.extend?(e=t.anchor,n&&((t=I(r,e)<0)!=I(n,e)<0?(e=r,r=n):t!=I(r,n)<0&&(r=n)),new mo(e,r)):new mo(n||r,r)}function jr(e,t,r,n){Ur(e,new go([Rr(e,e.sel.primary(),t,r)],0),n)}function Vr(e,t,r){for(var n=[],i=0;i<e.sel.ranges.length;i++)n[i]=Rr(e,e.sel.ranges[i],t[i],null);Ur(e,t=br(n,e.sel.primIndex),r)}function Kr(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Ur(e,br(i,e.sel.primIndex),n)}function Gr(e,t,r){var n=e.history.done,i=p(n);i&&i.ranges?qr(e,n[n.length-1]=t,r):Ur(e,t,r)}function Ur(e,t,r){qr(e,t,r),t=e.sel;var n,i,o=e.cm?e.cm.curOp.id:NaN,l=e.history,a=r&&r.origin;(n=o==l.lastSelOp)||!(n=a&&l.lastSelOrigin==a)||(n=l.lastModTime==l.lastSelTime&&l.lastOrigin==a)||(n=p(l.done),n="*"==(i=a.charAt(0))||"+"==i&&n.ranges.length==t.ranges.length&&n.somethingSelected()==t.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)),n?l.done[l.done.length-1]=t:Er(t,l.done),l.lastSelTime=+new Date,l.lastSelOrigin=a,l.lastSelOp=o,r&&!1!==r.clearRedo&&Hr(l.undone)}function qr(e,t,r){var n,i;(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(n=e,i=r,i={ranges:(o=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new mo(V(n,e[t].anchor),V(n,e[t].head))},origin:i&&i.origin},fe(n,"beforeSelectionChange",n,i),n.cm&&fe(n.cm,"beforeSelectionChange",n.cm,i),t=i.ranges!=o.ranges?br(i.ranges,i.ranges.length-1):o);var o=r&&r.bias||(I(t.primary().head,e.sel.primary().head)<0?-1:1);_r(e,Xr(e,t,o,!0)),r&&!1===r.scroll||!e.cm||Zt(e.cm)}function _r(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,ge(e.cm)),Ke(e,"cursorActivity",e))}function $r(e){_r(e,Xr(e,e.sel,null,!1))}function Xr(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=Zr(e,l.anchor,a&&a.anchor,r,n),a=Zr(e,l.head,a&&a.head,r,n);!i&&s==l.anchor&&a==l.head||((i=i||t.ranges.slice(0,o))[o]=new mo(s,a))}return i?br(i,t.primIndex):t}function Yr(e,t,r,n,i){var o=C(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&&(fe(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(s.atomic)return r&&(l=s.find(n<0?1:-1),a=void 0,(l=(n<0?s.inclusiveRight:s.inclusiveLeft)?Qr(e,l,-n,l&&l.line==t.line?o:null):l)&&l.line==t.line&&(a=I(l,r))&&(n<0?a<0:0<a))?Yr(e,l,t,n,i):(r=s.find(n<0?-1:1),(r=(n<0?s.inclusiveLeft:s.inclusiveRight)?Qr(e,r,n,r.line==t.line?o:null):r)?Yr(e,r,t,n,i):null)}}return t}function Zr(e,t,r,n,i){return(t=Yr(e,t,r,n=n||1,i)||!i&&Yr(e,t,r,n,!0)||Yr(e,t,r,-n,i)||!i&&Yr(e,t,r,-n,!0))||(e.cantEdit=!0,E(e.first,0))}function Qr(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?V(e,E(t.line-1)):null:0<r&&t.ch==(n||C(e,t.line)).text.length?t.line<e.first+e.size-1?E(t.line+1,0):null:new E(t.line,t.ch+r)}function Jr(e){e.setSelection(E(e.firstLine(),0),E(e.lastLine()),Hi)}function en(i,e,t){var o={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){return o.canceled=!0}};return t&&(o.update=function(e,t,r,n){e&&(o.from=V(i,e)),t&&(o.to=V(i,t)),r&&(o.text=r),void 0!==n&&(o.origin=n)}),fe(i,"beforeChange",i,o),i.cm&&fe(i.cm,"beforeChange",i.cm,o),o.canceled?null:{from:o.from,to:o.to,text:o.text,origin:o.origin}}function tn(e,t,r){if(e.cm){if(!e.cm.curOp)return rr(e.cm,tn)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))||(t=en(e,t,!0)))if(r=Ri&&!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!=h(n,r)||(n=n||[]).push(r)}}),!n)return null;for(e=[{from:t,to:r}],t=0;t<n.length;++t)for(var i=(r=n[t]).find(0),o=0;o<e.length;++o){var l,a,s,c=e[o];I(c.to,i.from)<0||0<I(c.from,i.to)||(l=[o,1],a=I(c.from,i.from),s=I(c.to,i.to),(a<0||!r.inclusiveLeft&&!a)&&l.push({from:c.from,to:i.from}),(0<s||!r.inclusiveRight&&!s)&&l.push({from:i.to,to:c.to}),e.splice.apply(e,l),o+=l.length-3)}return e}(e,t.from,t.to))for(var n=r.length-1;0<=n;--n)rn(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text});else rn(e,t)}function rn(e,r){var t,n;1==r.text.length&&""==r.text[0]&&0==I(r.from,r.to)||(t=Cr(e,r),Pr(e,r,t,e.cm?e.cm.curOp.id:NaN),ln(e,r,t,q(e,r)),n=[],Ar(e,function(e,t){t||-1!=h(n,e.history)||(un(e.history,r),n.push(e.history)),ln(e,r,null,q(e,r))}))}function nn(i,o,e){if(!i.cm||!i.cm.state.suppressEdits||e){for(var l,t=i.history,r=i.sel,a="undo"==o?t.done:t.undone,n="undo"==o?t.undone:t.done,s=0;s<a.length&&(l=a[s],e?!l.ranges||l.equals(i.sel):l.ranges);s++);if(s!=a.length){for(t.lastOrigin=t.lastSelOrigin=null;(l=a.pop()).ranges;){if(Er(l,n),e&&!l.equals(i.sel))return Ur(i,l,{clearRedo:!1}),0;r=l}var c=[];Er(r,n),n.push({changes:c,generation:t.generation}),t.generation=l.generation||++t.maxGeneration;var u=me(i,"beforeChange")||i.cm&&me(i.cm,"beforeChange");for(e=function(e){var r=l.changes[e];if(r.origin=o,u&&!en(i,r,!1))return a.length=0,{};c.push(Dr(i,r));var t=e?Cr(i,r):p(a);ln(i,r,t,Fr(i,r)),!e&&i.cm&&i.cm.scrollIntoView({from:r.from,to:xr(r)});var n=[];Ar(i,function(e,t){t||-1!=h(n,e.history)||(un(e.history,r),n.push(e.history)),ln(e,r,null,Fr(e,r))})},t=l.changes.length-1;0<=t;--t)if(r=e(t))return r.v}}}function on(e,t){if(0!=t&&(e.first+=t,e.sel=new go(f(e.sel.ranges,function(e){return new mo(E(e.anchor.line+t,e.anchor.ch),E(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){or(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)lr(e.cm,n,"gutter")}}function ln(e,t,r,n){if(e.cm&&!e.cm.curOp)return rr(e.cm,ln)(e,t,r,n);var i,o,l,a,s,c,u,d,h;t.to.line<e.first?on(e,t.text.length-1-(t.to.line-t.from.line)):t.from.line>e.lastLine()||(t.from.line<e.first&&(on(e,h=t.text.length-1-(e.first-t.from.line)),t={from:E(e.first,0),to:E(t.to.line+h,t.to.ch),text:[p(t.text)],origin:t.origin}),h=e.lastLine(),(t=t.to.line>h?{from:t.from,to:E(h,C(e,h).text.length),text:[t.text[0]],origin:t.origin}:t).removed=S(e,t.from,t.to),r=r||Cr(e,t),e.cm?(i=e.cm,o=t,l=n,a=i.doc,s=i.display,c=o.from,u=o.to,d=!1,h=c.line,i.options.lineWrapping||(h=H(J(C(a,c.line))),a.iter(h,u.line+1,function(e){if(e==s.maxLine)return d=!0})),-1<a.sel.contains(o.from,o.to)&&ge(i),Nr(a,o,l,St(i)),i.options.lineWrapping||(a.iter(h,c.line+o.text.length,function(e){var t=ie(e);t>s.maxLineLength&&(s.maxLine=e,s.maxLineLength=t,s.maxLineChanged=!0,d=!1)}),d&&(i.curOp.updateMaxLine=!0)),a.frontier=Math.min(a.frontier,c.line),ur(i,400),l=o.text.length-(u.line-c.line)-1,o.full?or(i):c.line!=u.line||1!=o.text.length||Tr(i.doc,o)?or(i,c.line,u.line+1,l):lr(i,c.line,"text"),l=me(i,"changes"),((a=me(i,"change"))||l)&&(o={from:c,to:u,text:o.text,removed:o.removed,origin:o.origin},a&&Ke(i,"change",i,o),l&&(i.curOp.changeObjs||(i.curOp.changeObjs=[])).push(o)),i.display.selForContextMenu=null):Nr(e,t,n),qr(e,r,Hi))}function an(e,t,r,n,i){var o;I(n=n||r,r)<0&&(o=n,n=r,r=o),"string"==typeof t&&(t=e.splitLines(t)),tn(e,{from:r,to:n,text:t,origin:i})}function sn(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function cn(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges)for(o.copied||((o=e[i]=o.deepCopy()).copied=!0),l=0;l<o.ranges.length;l++)sn(o.ranges[l].anchor,t,r,n),sn(o.ranges[l].head,t,r,n);else{for(var a=0;a<o.changes.length;++a){var s=o.changes[a];if(r<s.from.line)s.from=E(s.from.line+n,s.from.ch),s.to=E(s.to.line+n,s.to.ch);else if(t<=s.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function un(e,t){var r=t.from.line,n=t.to.line;t=t.text.length-(n-r)-1,cn(e.done,r,n,t),cn(e.undone,r,n,t)}function dn(e,t,r,n){var i=t,o=t;return"number"==typeof t?o=C(e,Math.max(e.first,Math.min(t,e.first+e.size-1))):i=H(t),null==i?null:(n(o,i)&&e.cm&&lr(e.cm,i,r),o)}function hn(t,r,n,e,i){if(e&&e.shared)return function(e,r,n,i,o){(i=c(i)).shared=!1;var l=[hn(e,r,n,i,o)],a=l[0],s=i.widgetNode;return Ar(e,function(e){s&&(i.widgetNode=s.cloneNode(!0)),l.push(hn(e,V(e,r),V(e,n),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;a=p(l)}),new ko(l,a)}(t,r,n,e,i);if(t.cm&&!t.cm.curOp)return rr(t.cm,hn)(t,r,n,e,i);var o=new xo(t,i);if(i=I(r,n),e&&c(e,o,!1),0<i||0==i&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=z("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Q(t,r.line,r,n,o)||r.line!=n.line&&Q(t,n.line,r,n,o))throw Error("Inserting collapsed marker partially overlapping an existing one");ji=!0}o.addToHistory&&Pr(t,{from:r,to:n,origin:"markText"},t.sel,NaN);var l,a=r.line,s=t.cm;if(t.iter(a,n.line+1,function(e){s&&o.collapsed&&!s.options.lineWrapping&&J(e)==s.display.maxLine&&(l=!0),o.collapsed&&a!=r.line&&M(e,0);var t=new G(o,a==r.line?r.ch:null,a==n.line?n.ch:null);e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e),++a}),o.collapsed&&t.iter(r.line,n.line+1,function(e){re(t,e)&&M(e,0)}),o.clearOnEnter&&Ui(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Ri=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++wo,o.atomic=!0),s){if(l&&(s.curOp.updateMaxLine=!0),o.collapsed)or(s,r.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(e=r.line;e<=n.line;e++)lr(s,e,"text");o.atomic&&$r(s.doc),Ke(s,"markerAdded",s,o)}return o}function fn(e){return e.findMarks(E(e.first,0),e.clipPos(E(e.lastLine())),function(e){return e.parent})}function pn(i){for(var e=0;e<i.length;e++)!function(e){var t=[(e=i[e]).primary.doc];Ar(e.primary.doc,function(e){return t.push(e)});for(var r=0;r<e.markers.length;r++){var n=e.markers[r];-1==h(t,n.doc)&&(n.parent=null,e.markers.splice(r--,1))}}(e)}function gn(e){var n=this;if(mn(n),!pe(n,e)&&!Je(n.display,e)){ve(e),ai&&(Lo=+new Date);var i=Mt(n,e,!0),t=e.dataTransfer.files;if(i&&!n.isReadOnly())if(t&&t.length&&window.FileReader&&window.File)for(var o=t.length,l=Array(o),a=0,r=function(e,t){var r;n.options.allowDropFileTypes&&-1==h(n.options.allowDropFileTypes,e.type)||((r=new FileReader).onload=rr(n,function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),l[t]=e,++a==o&&(e={from:i=V(n.doc,i),to:i,text:n.doc.splitLines(l.join(n.doc.lineSeparator())),origin:"paste"},tn(n.doc,e),Gr(n.doc,wr(i,xr(e))))}),r.readAsText(e))},s=0;s<o;++s)r(t[s],s);else if(n.state.draggingText&&-1<n.doc.sel.contains(i))n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);else try{if(r=e.dataTransfer.getData("Text")){if(n.state.draggingText&&!n.state.draggingText.copy&&(s=n.listSelections()),qr(n.doc,wr(i,i)),s)for(t=0;t<s.length;++t)an(n.doc,"",s[t].anchor,s[t].head,"drag");n.replaceSelection(r,"around","paste"),n.display.input.focus()}}catch(e){}}}function mn(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function vn(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&e(n)}}function yn(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function bn(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,l=0;l<t.length-1;l++){var a=t[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else{if(!/^s(hift)?$/i.test(a))throw Error("Unrecognized modifier name: "+a);i=!0}}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),e=i?"Shift-"+e:e}function wn(e){var t,r,n={};for(t in e)if(e.hasOwnProperty(t)){var i=e[t];if(!/^(name|fallthrough|(de|at)tach)$/.test(t)){if("..."!=i)for(var o=f(t.split(" "),bn),l=0;l<o.length;l++){var a,s=l==o.length-1?(a=o.join(" "),i):(a=o.slice(0,l+1).join(" "),"..."),c=n[a];if(c){if(c!=s)throw Error("Inconsistent bindings for "+a)}else n[a]=s}delete e[t]}}for(r in n)e[r]=n[r];return e}function xn(e,t,r,n){var i=(t=Sn(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 xn(e,t.fallthrough,r,n);for(i=0;i<t.fallthrough.length;i++){var o=xn(e,t.fallthrough[i],r,n);if(o)return o}}}function kn(e){return"Ctrl"==(e="string"==typeof e?e:To[e.keyCode])||"Alt"==e||"Shift"==e||"Mod"==e}function Cn(e,t){if(di&&34==e.keyCode&&e.char)return!1;var r=To[e.keyCode],n=r;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=r&&(n="Alt-"+n),(wi?e.metaKey:e.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(wi?e.ctrlKey:e.metaKey)&&"Cmd"!=r&&(n="Cmd-"+n),n=!t&&e.shiftKey&&"Shift"!=r?"Shift-"+n:n)}function Sn(e){return"string"==typeof e?Wo[e]:e}function Ln(t,e){for(var r=t.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=e(r[i]);n.length&&I(o.from,p(n).to)<=0;){var l=n.pop();if(I(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}tr(t,function(){for(var e=n.length-1;0<=e;e--)an(t.doc,"",n[e].from,n[e].to,"+delete");Zt(t)})}function Mn(e,t){var r=C(e.doc,t),n=J(r);return ue(!0,e,n,t=n!=r?H(n):t,1)}function Tn(e,t){var r=Mn(e,t.line),n=C(e.doc,r.line);return(e=ae(n,e.doc.direction))&&0!=e[0].level?r:(n=Math.max(0,n.text.search(/\S/)),E(r.line,t.line==r.line&&t.ch<=n&&t.ch?0:n,r.sticky))}function Nn(e,t,r){if("string"==typeof t&&!(t=Ho[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)!=Di}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function An(e,t,r,n){var i=e.state.keySeq;if(i){if(kn(t))return"handled";Po.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}return"multi"==(n=function(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=xn(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&xn(t,e.options.extraKeys,r,e)||xn(t,e.options.keyMap,r,e)}(e,t,n))&&(e.state.keySeq=t),"handled"==n&&Ke(e,"keyHandled",e,t,r),"handled"!=n&&"multi"!=n||(ve(r),Wt(e)),i&&!n&&/\'$/.test(t)?(ve(r),!0):!!n}function On(t,e){var r=Cn(e,!0);return!!r&&(e.shiftKey&&!t.state.keySeq?An(t,"Shift-"+r,e,function(e){return Nn(t,e,!0)})||An(t,r,e,function(e){if("string"==typeof e?/^go[A-Z]/.test(e):e.motion)return Nn(t,e)}):An(t,r,e,function(e){return Nn(t,e)}))}function Wn(e){var t,r,n;function i(e){18!=e.keyCode&&e.altKey||(ki(n,"CodeMirror-crosshair"),he(document,"keyup",i),he(document,"mouseover",i))}this.curOp.focus=b(),pe(this,e)||(ai&&si<11&&27==e.keyCode&&(e.returnValue=!1),t=e.keyCode,this.display.shift=16==t||e.shiftKey,r=On(this,e),di&&(Eo=r?t:null,!r&&88==t&&!Xi&&(yi?e.metaKey:e.ctrlKey)&&this.replaceSelection("",null,"cut")),18!=t||/\bCodeMirror-crosshair\b/.test(this.display.lineDiv.className)||(o(n=this.display.lineDiv,"CodeMirror-crosshair"),Ui(document,"keyup",i),Ui(document,"mouseover",i)))}function zn(e){16==e.keyCode&&(this.doc.sel.shift=!1),pe(this,e)}function Dn(e){var t,r,n;Je(this.display,e)||pe(this,e)||e.ctrlKey&&!e.altKey||yi&&e.metaKey||(t=e.keyCode,r=e.charCode,di&&t==Eo?(Eo=null,ve(e)):di&&(!e.which||e.which<10)&&On(this,e)||("\b"==(t=String.fromCharCode(null==r?t:r))||An(n=this,"'"+t+"'",e,function(e){return Nn(n,e,!0)})||this.display.input.onKeyPress(e)))}function Hn(e){var t,r=this.display;if(!(pe(this,e)||r.activeTouch&&r.input.supportsTouch()))if(r.input.ensurePolled(),r.shift=e.shiftKey,Je(r,e))ci||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));else if(!Pn(this,e,"gutterClick",!0)){var n=Mt(this,e);switch(window.focus(),we(e)){case 1:this.state.selectingText?this.state.selectingText(e):n?function(e,t,r){ai?setTimeout(s(zt,e),0):e.curOp.focus=b();var n,i=+new Date;Do&&Do.time>i-400&&0==I(Do.pos,r)?n="triple":zo&&zo.time>i-400&&0==I(zo.pos,r)?(n="double",Do={time:i,pos:r}):(n="single",zo={time:i,pos:r});var o,i=e.doc.sel,l=yi?t.metaKey:t.ctrlKey;e.options.dragDrop&&qi&&!e.isReadOnly()&&"single"==n&&-1<(o=i.contains(r))&&(I((o=i.ranges[o]).from(),r)<0||0<r.xRel)&&(0<I(o.to(),r)||r.xRel<0)?function(t,r,n,i){var o=t.display,l=+new Date,a=rr(t,function(e){ci&&(o.scroller.draggable=!1),t.state.draggingText=!1,he(document,"mouseup",a),he(o.scroller,"drop",a),Math.abs(r.clientX-e.clientX)+Math.abs(r.clientY-e.clientY)<10&&(ve(e),!i&&+new Date-200<l&&jr(t.doc,n),ci||ai&&9==si?setTimeout(function(){document.body.focus(),o.input.focus()},20):o.input.focus())});ci&&(o.scroller.draggable=!0),(t.state.draggingText=a).copy=yi?r.altKey:r.ctrlKey,o.scroller.dragDrop&&o.scroller.dragDrop(),Ui(document,"mouseup",a),Ui(o.scroller,"drop",a)}(e,t,r,l):function(c,e,u,d,t){function o(e){var t,r,n=++s,i=Mt(c,e,!0,"rect"==d);i&&(0!=I(i,m)?(c.curOp.focus=b(),function(e){if(0!=I(m,e))if(m=e,"rect"==d){for(var t=[],r=c.options.tabSize,n=w(C(h,u.line).text,u.ch,r),i=w(C(h,e.line).text,e.ch,r),o=Math.min(n,i),n=Math.max(n,i),i=Math.min(u.line,e.line),l=Math.min(c.lastLine(),Math.max(u.line,e.line));i<=l;i++){var a=C(h,i).text,s=x(a,o,r);o==n?t.push(new mo(E(i,s),E(i,s))):a.length>s&&t.push(new mo(E(i,s),E(i,x(a,n,r))))}t.length||t.push(new mo(u,u)),Ur(h,br(g.ranges.slice(0,p).concat(t),p),{origin:"*mouse",scroll:!1}),c.scrollIntoView(e)}else t=(o=f).anchor,r=e,"single"!=d&&(t=0<I((e="double"==d?c.findWordAt(e):new mo(E(e.line,0),V(h,E(e.line+1,0)))).anchor,t)?(r=e.head,j(o.from(),e.anchor)):(r=e.anchor,R(o.to(),e.head))),(e=g.ranges.slice(0))[p]=new mo(V(h,t),r),Ur(h,br(e,p),Pi)}(i),t=Bt(l,h),(i.line>=t.to||i.line<t.from)&&setTimeout(rr(c,function(){s==n&&o(e)}),150)):(r=e.clientY<a.top?-20:e.clientY>a.bottom?20:0)&&setTimeout(rr(c,function(){s==n&&(l.scroller.scrollTop+=r,o(e))}),50))}function r(e){c.state.selectingText=!1,s=1/0,ve(e),l.input.focus(),he(document,"mousemove",v),he(document,"mouseup",y),h.history.lastSelOrigin=null}var l=c.display,h=c.doc;ve(e);var f,p,g=h.sel,n=g.ranges;{var i;t&&!e.shiftKey?(p=h.sel.contains(u),f=-1<p?n[p]:new mo(u,u)):(f=h.sel.primary(),p=h.sel.primIndex),(bi?e.shiftKey&&e.metaKey:e.altKey)?(d="rect",t||(f=new mo(u,u)),u=Mt(c,e,!0,!0),p=-1):f="double"==d?(i=c.findWordAt(u),c.display.shift||h.extend?Rr(h,f,i.anchor,i.head):i):"triple"==d?(i=new mo(E(u.line,0),V(h,E(u.line+1,0))),c.display.shift||h.extend?Rr(h,f,i.anchor,i.head):i):Rr(h,f,u)}t?-1==p?(p=n.length,Ur(h,br(n.concat([f]),p),{scroll:!1,origin:"*mouse"})):1<n.length&&n[p].empty()&&"single"==d&&!e.shiftKey?(Ur(h,br(n.slice(0,p).concat(n.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),g=h.sel):Kr(h,p,f,Pi):(Ur(h,new go([f],p=0),Pi),g=h.sel);var m=u,a=l.wrapper.getBoundingClientRect(),s=0,v=rr(c,function(e){(we(e)?o:r)(e)}),y=rr(c,r);c.state.selectingText=y,Ui(document,"mousemove",v),Ui(document,"mouseup",y)}(e,t,r,n,l)}(this,e,n):(e.target||e.srcElement)==r.scroller&&ve(e);break;case 2:ci&&(this.state.lastMiddleDown=+new Date),n&&jr(this.doc,n),setTimeout(function(){return r.input.focus()},20),ve(e);break;case 3:xi?En(this,e):((t=this).state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Ht(t))},100))}}}function Pn(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ve(t);var l=(n=e.display).lineDiv.getBoundingClientRect();if(o>l.bottom||!me(e,r))return ye(t);for(o-=l.top-n.viewOffset,l=0;l<e.options.gutters.length;++l){var a=n.gutters.childNodes[l];if(a&&a.getBoundingClientRect().right>=i)return fe(e,r,e,i=T(e.doc,o),e.options.gutters[l],t),ye(t)}}function En(e,t){var r;(r=!(r=Je(e.display,t))?!!me(e,"gutterContextMenu")&&Pn(e,t,"gutterContextMenu",!1):r)||pe(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function In(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ht(e)}function Fn(e){vr(e),or(e),Pt(e)}function Bn(e,t,r){!t!=!(r&&r!=Io)&&(r=e.display.dragFunctions,(t=t?Ui:he)(e.display.scroller,"dragstart",r.start),t(e.display.scroller,"dragenter",r.enter),t(e.display.scroller,"dragover",r.over),t(e.display.scroller,"dragleave",r.leave),t(e.display.scroller,"drop",r.drop))}function Rn(e){e.options.lineWrapping?(o(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ki(e.display.wrapper,"CodeMirror-wrap"),oe(e)),Lt(e),or(e),ht(e),setTimeout(function(){return qt(e)},100)}function jn(e,t){var r=this;if(!(this instanceof jn))return new jn(e,t);this.options=t=t?c(t):{},c(Fo,t,!1),yr(t);var n=t.value;"string"==typeof n&&(n=new So(n,t.mode,null,t.lineSeparator,t.direction)),this.doc=n;var i,o,l=new jn.inputStyles[t.inputStyle](this);for(o in vr((e=this.display=new d(e,n,l)).wrapper.CodeMirror=this),In(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),$t(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 Li,keySeq:null,specialChars:null},t.autofocus&&!vi&&e.input.focus(),ai&&si<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(n){function i(){l.activeTouch&&(r=setTimeout(function(){return l.activeTouch=null},1e3),(a=l.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return 1;var r=t.left-e.left;return 400<r*r+(e=t.top-e.top)*e}var l=n.display;Ui(l.scroller,"mousedown",rr(n,Hn)),Ui(l.scroller,"dblclick",ai&&si<11?rr(n,function(e){var t;pe(n,e)||(!(t=Mt(n,e))||Pn(n,e,"gutterClick",!0)||Je(n.display,e)||(ve(e),e=n.findWordAt(t),jr(n.doc,e.anchor,e.head)))}):function(e){return pe(n,e)||ve(e)}),xi||Ui(l.scroller,"contextmenu",function(e){return En(n,e)});var r,a={end:0};Ui(l.scroller,"touchstart",function(e){var t;(t=(t=!pe(n,e))?!(t=1==e.touches.length&&((t=e.touches[0]).radiusX<=1&&t.radiusY<=1)):t)&&(l.input.ensurePolled(),clearTimeout(r),t=+new Date,l.activeTouch={start:t,moved:!1,prev:t-a.end<=300?a:null},1==e.touches.length&&(l.activeTouch.left=e.touches[0].pageX,l.activeTouch.top=e.touches[0].pageY))}),Ui(l.scroller,"touchmove",function(){l.activeTouch&&(l.activeTouch.moved=!0)}),Ui(l.scroller,"touchend",function(e){var t,r=l.activeTouch;r&&!Je(l,e)&&null!=r.left&&!r.moved&&new Date-r.start<300&&(t=n.coordsChar(l.activeTouch,"page"),r=!r.prev||o(r,r.prev)?new mo(t,t):!r.prev.prev||o(r,r.prev.prev)?n.findWordAt(t):new mo(E(t.line,0),V(n.doc,E(t.line+1,0))),n.setSelection(r.anchor,r.head),n.focus(),ve(e)),i()}),Ui(l.scroller,"touchcancel",i),Ui(l.scroller,"scroll",function(){l.scroller.clientHeight&&(Rt(n,l.scroller.scrollTop),jt(n,l.scroller.scrollLeft,!0),fe(n,"scroll",n))}),Ui(l.scroller,"mousewheel",function(e){return Gt(n,e)}),Ui(l.scroller,"DOMMouseScroll",function(e){return Gt(n,e)}),Ui(l.wrapper,"scroll",function(){return l.wrapper.scrollTop=l.wrapper.scrollLeft=0}),l.dragFunctions={enter:function(e){pe(n,e)||be(e)},over:function(e){var t,r;pe(n,e)||((t=Mt(n,e))&&(r=document.createDocumentFragment(),Ot(n,t,r),n.display.dragCursor||(n.display.dragCursor=W("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),n.display.lineSpace.insertBefore(n.display.dragCursor,n.display.cursorDiv)),O(n.display.dragCursor,r)),be(e))},start:function(e){var t;ai&&(!n.state.draggingText||+new Date-Lo<100)?be(e):pe(n,e)||Je(n.display,e)||(e.dataTransfer.setData("Text",n.getSelection()),e.dataTransfer.effectAllowed="copyMove",!e.dataTransfer.setDragImage||hi)||((t=W("img",null,null,"position: fixed; left: 0; top: 0;")).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",di&&(t.width=t.height=1,n.display.wrapper.appendChild(t),t._top=t.offsetTop),e.dataTransfer.setDragImage(t,0,0),di&&t.parentNode.removeChild(t))},drop:rr(n,gn),leave:function(e){pe(n,e)||mn(n)}};var e=l.input.getField();Ui(e,"keyup",function(e){return zn.call(n,e)}),Ui(e,"keydown",rr(n,Wn)),Ui(e,"keypress",rr(n,Dn)),Ui(e,"focus",function(e){return Dt(n,e)}),Ui(e,"blur",function(e){return Ht(n,e)})}(this),Mo||(Ui(window,"resize",function(){null==i&&(i=setTimeout(function(){i=null,vn(yn)},100))}),Ui(window,"blur",function(){return vn(Ht)}),Mo=!0),Jt(this),this.curOp.forceUpdate=!0,Or(this,n),t.autofocus&&!vi||this.hasFocus()?setTimeout(s(Dt,this),20):Ht(this),Bo)Bo.hasOwnProperty(o)&&Bo[o](r,t[o],Io);for(Et(this),t.finishInit&&t.finishInit(this),n=0;n<Ro.length;++n)Ro[n](r);er(this),ci&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(e.lineDiv).textRendering&&(e.lineDiv.style.textRendering="auto")}function Vn(e,t,r,n){var i,o=e.doc;"smart"==(r=null==r?"add":r)&&(o.mode.indent?i=Ae(e,t):r="prev");var l=e.options.tabSize,a=C(o,t),s=w(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(n||/\S/.test(a.text)){if("smart"==r&&((c=o.mode.indent(i,a.text.slice(u.length),a.text))==Di||150<c)){if(!n)return;r="prev"}}else c=0,r="not";if("prev"==r?c=t>o.first?w(C(o,t-1).text,null,l):0:"add"==r?c=s+e.options.indentUnit:"subtract"==r?c=s-e.options.indentUnit:"number"==typeof r&&(c=s+r),c=Math.max(0,c),r="",n=0,e.options.indentWithTabs)for(e=Math.floor(c/l);e;--e)n+=l,r+="\t";if(n<c&&(r+=g(c-n)),r!=u)return an(o,r,E(t,0),E(t,u.length),"+input"),!(a.stateAfter=null);for(l=0;l<o.sel.ranges.length;l++)if((a=o.sel.ranges[l]).head.line==t&&a.head.ch<u.length){t=E(t,u.length),Kr(o,l,new mo(t,t));break}}function Kn(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=_i(t),s=null;if(l&&1<n.ranges.length)if(jo&&jo.text.join("\n")==t){if(0==n.ranges.length%jo.text.length)for(var s=[],c=0;c<jo.text.length;c++)s.push(o.splitLines(jo.text[c]))}else a.length==n.ranges.length&&(s=f(a,function(e){return[e]}));for(c=n.ranges.length-1;0<=c;c--){var u,d=(u=n.ranges[c]).from(),h=u.to();u.empty()&&(r&&0<r?d=E(d.line,d.ch-r):e.state.overwrite&&!l?h=E(h.line,Math.min(C(o,h.line).text.length,h.ch+p(a).length)):jo&&jo.lineWise&&jo.text.join("\n")==t&&(d=h=E(d.line,0))),u=e.curOp.updateInput,d={from:d,to:h,text:s?s[c%s.length]:a,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")},tn(e.doc,d),Ke(e,"inputRead",e,d)}t&&!l&&Un(e,t),Zt(e),e.curOp.updateInput=u,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Gn(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");return r&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||tr(t,function(){return Kn(t,r,0,null,"paste")}),1)}function Un(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;0<=n;n--){var i=r.ranges[n];if(!(100<i.head.ch||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(-1<t.indexOf(o.electricChars.charAt(a))){l=Vn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(C(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Vn(e,i.head.line,"smart"));l&&Ke(e,"electricInput",e,i.head.line)}}}function qn(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i={anchor:E(i=e.doc.sel.ranges[n].head.line,0),head:E(i+1,0)};r.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:r}}function _n(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function $n(){var e=W("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=W("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ci?e.style.width="1000px":e.setAttribute("wrap","off"),gi&&(e.style.border="1px solid black"),_n(e),t}function Xn(r,n,i,e,o){function t(e){var t=o?de(r.cm,s,n,i):ce(s,n,i);if(null==t){if(!(e=(e=!e)?!((e=n.line+i)<r.first||e>=r.first+r.size)&&(n=new E(e,n.ch,n.sticky),s=C(r,e)):e))return;n=ue(o,r.cm,s,n.line,i)}else n=t;return 1}var l=n,a=i,s=C(r,n.line);if("char"==e)t();else if("column"==e)t(!0);else if("word"==e||"group"==e){var c=null;e="group"==e;for(var u=r.cm&&r.cm.getHelper(n,"wordChars"),d=!0;!(i<0)||t(!d);d=!1){var h=m(h=s.text.charAt(n.ch)||"\n",u)?"w":e&&"\n"==h?"n":!e||/\s/.test(h)?null:"p";if(!e||d||h||(h="s"),c&&c!=h){i<0&&(i=1,t(),n.sticky="after");break}if(h&&(c=h),0<i&&!t(!d))break}}return F(l,a=Zr(r,n,l,a,!0))&&(a.hitSide=!0),a}function Yn(e,t,r,n){var i,o=e.doc,l=t.left;for("page"==n?(i=Math.max(Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight)-.5*wt(e.display),3),i=(0<r?t.bottom:t.top)+r*i):"line"==n&&(i=0<r?t.bottom+3:t.top-3);(t=yt(e,l,i)).outside;){if(r<0?i<=0:i>=o.height){t.hitSide=!0;break}i+=5*r}return t}function Zn(e,t){if(!(n=lt(e,t.line))||n.hidden)return null;var r=C(e.doc,t.line),n=ot(n,r,t.line);return e=ae(r,e.doc.direction),r="left",e&&(r=le(e,t.ch)%2?"right":"left"),(t=ct(n.map,t.ch,r)).offset="right"==t.collapse?t.end:t.start,t}function Qn(e,t){return t&&(e.bad=!0),e}function Jn(o,e,t,l,a){function s(e){e&&(u&&(c+=d,u=!1),c+=e)}for(var c="",u=!1,d=o.doc.lineSeparator();function e(t){if(1==t.nodeType){var r,n=t.getAttribute("cm-text");if(null!=n)s(n||t.textContent.replace(/\u200b/g,""));else if(n=t.getAttribute("cm-marker"))(t=o.findMarks(E(l,0),E(a+1,0),(i=+n,function(e){return e.id==i}))).length&&(r=t[0].find())&&s(S(o.doc,r.from,r.to).join(d));else if("false"!=t.getAttribute("contenteditable")){for((r=/^(pre|div|p)$/i.test(t.nodeName))&&u&&(c+=d,u=!1),n=0;n<t.childNodes.length;n++)e(t.childNodes[n]);r&&(u=!0)}}else 3==t.nodeType&&s(t.nodeValue);var i}(e),e!=t;)e=e.nextSibling;return c}function ei(e,t,r){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[r]))return Qn(e.clipPos(E(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 function(a,e,t){function r(e,t,r){for(var n=-1;n<(c?c.length:0);n++)for(var i=n<0?s.map:c[n],o=0;o<i.length;o+=3){var l=i[o+2];if(l==e||l==t)return t=H(n<0?a.line:a.rest[n]),n=i[o]+r,E(t,n=r<0||l!=e?i[o+(r?1:0)]:n)}}var n=a.text.firstChild,i=!1;if(!e||!u(n,e))return Qn(E(H(a.line),0),!0);if(e==n&&(i=!0,e=n.childNodes[t],t=0,!e))return Qn(E(H(t=a.rest?p(a.rest):a.line),t.text.length),i);var o=3==e.nodeType?e:null,l=e;for(o||1!=e.childNodes.length||3!=e.firstChild.nodeType||(o=e.firstChild,t=t&&o.nodeValue.length);l.parentNode!=n;)l=l.parentNode;var s=a.measure,c=s.maps;if(e=r(o,l,t))return Qn(e,i);for(n=l.nextSibling,o=o?o.nodeValue.length-t:0;n;n=n.nextSibling){if(e=r(n,n.firstChild,0))return Qn(E(e.line,e.ch-o),i);o+=n.textContent.length}for(l=l.previousSibling;l;l=l.previousSibling){if(e=r(l,l.firstChild,-1))return Qn(E(e.line,e.ch+t),i);t+=l.textContent.length}}(o,t,r)}}var ti=navigator.userAgent,ri=navigator.platform,ni=/gecko\/\d/i.test(ti),ii=/MSIE \d/.test(ti),oi=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ti),li=/Edge\/(\d+)/.exec(ti),ai=ii||oi||li,si=ai&&(ii?document.documentMode||6:+(li||oi)[1]),ci=!li&&/WebKit\//.test(ti),oi=ci&&/Qt\/\d+\.\d+/.test(ti),ui=!li&&/Chrome\//.test(ti),di=/Opera\//.test(ti),hi=/Apple Computer/.test(navigator.vendor),fi=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ti),pi=/PhantomJS/.test(ti),gi=!li&&/AppleWebKit/.test(ti)&&/Mobile\/\w+/.test(ti),mi=/Android/.test(ti),vi=gi||mi||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ti),yi=gi||/Mac/.test(ri),bi=/\bCrOS\b/.test(ti),ri=/win/i.test(ri),ti=di&&ti.match(/Version\/(\d*\.\d*)/);(ti=ti&&Number(ti[1]))&&15<=ti&&(ci=!(di=!1));var wi=yi&&(oi||di&&(null==ti||ti<12.11)),xi=ni||ai&&9<=si,ki=function(e,t){var r,n=e.className;(t=a(t).exec(n))&&(r=n.slice(t.index+t[0].length),e.className=n.slice(0,t.index)+(r?t[1]+r:""))},Ci=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},Si=function(e){e.select()};gi?Si=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:ai&&(Si=function(e){try{e.select()}catch(e){}});var Li=function(){this.id=null};Li.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Mi,Ti,Ni,Ai,Oi,Wi,zi,Di={toString:function(){return"CodeMirror.Pass"}},Hi={scroll:!1},Pi={origin:"*mouse"},Ei={origin:"+move"},Ii=[""],Fi=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Bi=/[\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]/,Ri=!1,ji=!1,Vi=null,Ki=(Ni=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,Ai=/[stwN]/,Oi=/[LRr]/,Wi=/[Lb1n]/,zi=/[1n]/,function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!Ni.test(e))return!1;for(var n,i=e.length,o=[],l=0;l<i;++l)o.push((n=e.charCodeAt(l))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L");for(var l=0,a=r;l<i;++l){var s=o[l];"m"==s?o[l]=a:a=s}for(l=0,a=r;l<i;++l)"1"==(s=o[l])&&"r"==a?o[l]="n":Oi.test(s)&&("r"==(a=s)&&(o[l]="R"));for(l=1,a=o[0];l<i-1;++l)"+"==(s=o[l])&&"1"==a&&"1"==o[l+1]?o[l]="1":","!=s||a!=o[l+1]||"1"!=a&&"n"!=a||(o[l]=a),a=s;for(l=0;l<i;++l)if(","==(a=o[l]))o[l]="N";else if("%"==a){for(a=l+1;a<i&&"%"==o[a];++a);for(s=l&&"!"==o[l-1]||a<i&&"1"==o[a]?"1":"N";l<a;++l)o[l]=s;l=a-1}for(l=0,a=r;l<i;++l)s=o[l],"L"==a&&"1"==s?o[l]="L":Oi.test(s)&&(a=s);for(a=0;a<i;++a)if(Ai.test(o[a])){for(l=a+1;l<i&&Ai.test(o[l]);++l);for(s=(s="L"==(a?o[a-1]:r))==("L"==(l<i?o[l]:r))?s?"L":"R":r;a<l;++a)o[a]=s;a=l-1}for(var c,r=[],l=0;l<i;)if(Wi.test(o[l])){for(a=l,++l;l<i&&Wi.test(o[l]);++l);r.push(new to(0,a,l))}else{var u=l,a=r.length;for(++l;l<i&&"L"!=o[l];++l);for(s=u;s<l;)if(zi.test(o[s])){for(u<s&&r.splice(a,0,new to(1,u,s)),u=s,++s;s<l&&zi.test(o[s]);++s);r.splice(a,0,new to(2,u,s)),u=s}else++s;u<l&&r.splice(a,0,new to(1,u,l))}return 1==r[0].level&&(c=e.match(/^\s+/))&&(r[0].from=c[0].length,r.unshift(new to(0,0,c[0].length))),1==p(r).level&&(c=e.match(/\s+$/))&&(p(r).to-=c[0].length,r.push(new to(0,i-c[0].length,i))),"rtl"==t?r.reverse():r}),Gi=[],Ui=function(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent("on"+t,r):(e=e._handlers||(e._handlers={}))[t]=(e[t]||Gi).concat(r)},qi=function(){if(ai&&si<9)return!1;var e=W("div");return"draggable"in e||"dragDrop"in e}(),_i=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/)},$i=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)},Xi="oncopy"in(oi=W("div"))||(oi.setAttribute("oncopy","return;"),"function"==typeof oi.oncopy),Yi=null,Zi={},Qi={},Ji={},eo=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lineStart=this.lastColumnPos=this.lastColumnValue=0};function to(e,t,r){this.level=e,this.from=t,this.to=r}eo.prototype.eol=function(){return this.pos>=this.string.length},eo.prototype.sol=function(){return this.pos==this.lineStart},eo.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},eo.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eo.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},eo.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eo.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},eo.prototype.skipToEnd=function(){this.pos=this.string.length},eo.prototype.skipTo=function(e){if(-1<(e=this.string.indexOf(e,this.pos)))return this.pos=e,!0},eo.prototype.backUp=function(e){this.pos-=e},eo.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=w(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?w(this.string,this.lineStart,this.tabSize):0)},eo.prototype.indentation=function(){return w(this.string,null,this.tabSize)-(this.lineStart?w(this.string,this.lineStart,this.tabSize):0)},eo.prototype.match=function(e,t,r){if("string"!=typeof e)return(e=this.string.slice(this.pos).match(e))&&0<e.index?null:(e&&!1!==t&&(this.pos+=e[0].length),e);function n(e){return r?e.toLowerCase():e}return n(this.string.substr(this.pos,e.length))==n(e)?(!1!==t&&(this.pos+=e.length),!0):void 0},eo.prototype.current=function(){return this.string.slice(this.start,this.pos)},eo.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};var ro=function(e,t,r){this.text=e,X(this,t),this.height=r?r(this):1};ro.prototype.lineNo=function(){return H(this)},e(ro);var no,io={},oo={},lo=null,ao=null,so={left:0,right:0,top:0,bottom:0},co=0,uo=null;ai?uo=-.53:ni?uo=15:ui?uo=-.7:hi&&(uo=-1/3);ti=function(e,t,r){this.cm=r;var n=this.vert=W("div",[W("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=W("div",[W("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(i),Ui(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ui(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ai&&si<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ti.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;return r?(this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0",this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+(e.viewHeight-(t?n:0)))+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),t?(this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px",this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+(e.viewWidth-e.barLeft-(r?n:0)))+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0<e.clientHeight&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},ti.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},ti.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},ti.prototype.zeroWidthHack=function(){this.horiz.style.height=this.vert.style.width=yi&&!fi?"12px":"18px",this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Li,this.disableVert=new Li},ti.prototype.enableZeroWidthBar=function(r,n){r.style.pointerEvents="auto",n.set(1e3,function e(){var t=r.getBoundingClientRect();document.elementFromPoint(t.left+1,t.bottom-1)!=r?r.style.pointerEvents="none":n.set(1e3,e)})},ti.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};oi=function(){};oi.prototype.update=function(){return{bottom:0,right:0}},oi.prototype.setScrollLeft=function(){},oi.prototype.setScrollTop=function(){},oi.prototype.clear=function(){};var ho={native:ti,null:oi},fo=0,po=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Bt(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=nt(e),this.force=r,this.dims=kt(e),this.events=[]};po.prototype.signal=function(e,t){me(e,t)&&this.events.push(arguments)},po.prototype.finish=function(){for(var e=0;e<this.events.length;e++)fe.apply(null,this.events[e])};var go=function(e,t){this.ranges=e,this.primIndex=t};go.prototype.primary=function(){return this.ranges[this.primIndex]},go.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(!F(r.anchor,n.anchor)||!F(r.head,n.head))return!1}return!0},go.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new mo(B(this.ranges[t].anchor),B(this.ranges[t].head));return new go(e,this.primIndex)},go.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},go.prototype.contains=function(e,t){t=t||e;for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(0<=I(t,n.from())&&I(e,n.to())<=0)return r}return-1};var mo=function(e,t){this.anchor=e,this.head=t};mo.prototype.from=function(){return j(this.anchor,this.head)},mo.prototype.to=function(){return R(this.anchor,this.head)},mo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function vo(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}vo.prototype.chunkSize=function(){return this.lines.length},vo.prototype.removeInner=function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height;var o=i;o.parent=null,$(o),Ke(i,"delete")}this.lines.splice(e,t)},vo.prototype.collapse=function(e){e.push.apply(e,this.lines)},vo.prototype.insertInner=function(e,t,r){for(this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e)),e=0;e<t.length;++e)t[e].parent=this},vo.prototype.iterN=function(e,t,r){for(t=e+t;e<t;++e)if(r(this.lines[e]))return!0};function yo(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n],t=t+i.chunkSize(),r=r+i.height;i.parent=this}this.size=t,this.height=r,this.parent=null}yo.prototype.chunkSize=function(){return this.size},yo.prototype.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}this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof vo))&&(this.collapse(e=[]),this.children=[new vo(e)],this.children[0].parent=this)},yo.prototype.collapse=function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},yo.prototype.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&&50<i.lines.length){for(t=e=i.lines.length%25+25;t<i.lines.length;)r=new vo(i.lines.slice(t,t+=25)),i.height-=r.height,this.children.splice(++n,0,r),r.parent=this;i.lines=i.lines.slice(0,e),this.maybeSpill()}break}e-=o}},yo.prototype.maybeSpill=function(){if(!(this.children.length<=10)){var e=this;do{var t,r=e.children.splice(e.children.length-5,5),r=new yo(r)}while(e.parent?(e.size-=r.size,e.height-=r.height,t=h(e.parent.children,e),e.parent.children.splice(t+1,0,r)):(((t=new yo(e.children)).parent=e).children=[t,r],e=t),r.parent=e.parent,10<e.children.length);e.parent.maybeSpill()}},yo.prototype.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){if(o=Math.min(t,o-e),i.iterN(e,o,r))return!0;if(0==(t-=o))break;e=0}else e-=o}};function bo(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t}bo.prototype.clear=function(){var t=this.doc.cm,e=this.line.widgets,r=this.line,n=H(r);if(null!=n&&e){for(var i=0;i<e.length;++i)e[i]==this&&e.splice(i--,1);e.length||(r.widgets=null);var o=Qe(this);M(r,Math.max(0,r.height-o)),t&&(tr(t,function(){var e=-o;ne(r)<(t.curOp&&t.curOp.scrollTop||t.doc.scrollTop)&&Yt(t,null,e),lr(t,n,"widget")}),Ke(t,"lineWidgetCleared",t,this,n))}},bo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Qe(this)-t;i&&(M(n,n.height+i),r&&tr(r,function(){r.curOp.forceUpdate=!0,ne(n)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)&&Yt(r,null,i),Ke(r,"lineWidgetChanged",r,e,H(n))}))},e(bo);var wo=0,xo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++wo};xo.prototype.clear=function(){if(!this.explicitlyCleared){var e,t=this.doc.cm,r=t&&!t.curOp;r&&Jt(t),me(this,"clear")&&(e=this.find())&&Ke(this,"clear",e.from,e.to);for(var n=e=null,i=0;i<this.lines.length;++i){var o=this.lines[i],l=U(o.markedSpans,this);t&&!this.collapsed?lr(t,H(o),"text"):t&&(null!=l.to&&(n=H(o)),null!=l.from&&(e=H(o)));for(var a=o,s=void 0,c=o.markedSpans,u=l,d=0;d<c.length;++d)c[d]!=u&&(s=s||[]).push(c[d]);a.markedSpans=s,null==l.from&&this.collapsed&&!re(this.doc,o)&&t&&M(o,wt(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(i=0;i<this.lines.length;++i)(l=ie(o=J(this.lines[i])))>t.display.maxLineLength&&(t.display.maxLine=o,t.display.maxLineLength=l,t.display.maxLineChanged=!0);null!=e&&t&&this.collapsed&&or(t,e,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&$r(t.doc)),t&&Ke(t,"markerCleared",t,this,e,n),r&&er(t),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var o=this.lines[i],l=U(o.markedSpans,this);if(null!=l.from&&(r=E(t?o:H(o),l.from),-1==e))return r;if(null!=l.to&&(n=E(t?o:H(o),l.to),1==e))return n}return r&&{from:r,to:n}},xo.prototype.changed=function(){var r=this,n=this.find(-1,!0),i=this,o=this.doc.cm;n&&o&&tr(o,function(){var e=n.line,t=H(n.line);(t=lt(o,t))&&(ut(t),o.curOp.selectionChanged=o.curOp.forceUpdate=!0),o.curOp.updateMaxLine=!0,re(i.doc,e)||null==i.height||(t=i.height,i.height=null,(t=Qe(i)-t)&&M(e,e.height+t)),Ke(o,"markerChanged",o,r)})},xo.prototype.attachLine=function(e){var t;!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers&&-1!=h(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)),this.lines.push(e)},xo.prototype.detachLine=function(e){this.lines.splice(h(this.lines,e),1),!this.lines.length&&this.doc.cm&&((e=this.doc.cm.curOp).maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)},e(xo);var ko=function(e,t){for(this.markers=e,this.primary=t,t=0;t<e.length;++t)e[t].parent=this};ko.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ke(this,"clear")}},ko.prototype.find=function(e,t){return this.primary.find(e,t)},e(ko);var Co=0,So=function(e,t,r,n,i){return this instanceof So?(null==r&&(r=0),yo.call(this,[new vo([new ro("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,r=E(this.frontier=r,0),this.sel=wr(r),this.history=new zr(null),this.id=++Co,this.modeOption=t,this.lineSep=n,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Nr(this,{from:r,to:r,text:e}),void Ur(this,wr(r),Hi)):new So(e,t,r,n,i)};So.prototype=n(yo.prototype,{constructor:So,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=L(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:ir(function(e){var t=E(this.first,0),r=this.first+this.size-1;tn(this,{from:t,to:E(r,C(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Ur(this,wr(t))}),replaceRange:function(e,t,r,n){an(this,e,t=V(this,t),r=r?V(this,r):t,n)},getRange:function(e,t,r){return e=S(this,V(this,e),V(this,t)),!1===r?e:e.join(r||this.lineSeparator())},getLine:function(e){return(e=this.getLineHandle(e))&&e.text},getLineHandle:function(e){if(N(this,e))return C(this,e)},getLineNumber:H,getLineHandleVisualStart:function(e){return J(e="number"==typeof e?C(this,e):e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return V(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:ir(function(e,t,r){Ur(this,wr(e=V(this,"number"==typeof e?E(e,t||0):e),null),r)}),setSelection:ir(function(e,t,r){Ur(this,wr(V(this,e),e=V(this,t||e)),r)}),extendSelection:ir(function(e,t,r){jr(this,V(this,e),t&&V(this,t),r)}),extendSelections:ir(function(e,t){Vr(this,K(this,e),t)}),extendSelectionsBy:ir(function(e,t){Vr(this,K(this,e=f(this.sel.ranges,e)),t)}),setSelections:ir(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new mo(V(this,e[i].anchor),V(this,e[i].head));Ur(this,br(n,t=null==t?Math.min(e.length-1,this.sel.primIndex):t),r)}}),addSelection:ir(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new mo(V(this,e),V(this,t||e))),Ur(this,br(n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r=0;r<t.length;r++)var n=S(this,t[r].from(),t[r].to()),i=i?i.concat(n):n;return!1===e?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=S(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:ir(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}}if(e=t&&"end"!=t){for(e=[],i=r=E(this.first,0),o=0;o<n.length;o++){var a=n[o],l=Sr(a.from,r,i),s=Sr(xr(a),r,i);r=a.to,i=s,"around"==t?(a=I((a=this.sel.ranges[o]).head,a.anchor)<0,e[o]=new mo(a?s:l,a?l:s)):e[o]=new mo(l,l)}e=new go(e,this.sel.primIndex)}for(t=e,e=n.length-1;0<=e;e--)tn(this,n[e]);t?Gr(this,t):this.cm&&Zt(this.cm)}),undo:ir(function(){nn(this,"undo")}),redo:ir(function(){nn(this,"redo")}),undoSelection:ir(function(){nn(this,"undo",!0)}),redoSelection:ir(function(){nn(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(n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new zr(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:Br(this.history.done),undone:Br(this.history.undone)}},setHistory:function(e){var t=this.history=new zr(this.history.maxGeneration);t.done=Br(e.done.slice(0),null,!0),t.undone=Br(e.undone.slice(0),null,!0)},setGutterMarker:ir(function(e,r,n){return dn(this,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[r]=n)&&l(t)&&(e.gutterMarkers=null),1})}),clearGutter:ir(function(t){var r=this;this.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&dn(r,e,"gutter",function(){return e.gutterMarkers[t]=null,l(e.gutterMarkers)&&(e.gutterMarkers=null),1})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!N(this,e))return null;if(!(e=C(this,t=e)))return null}else if(null==(t=H(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:ir(function(e,r,n){return dn(this,e,"gutter"==r?"gutter":"class",function(e){var t="text"==r?"textClass":"background"==r?"bgClass":"gutter"==r?"gutterClass":"wrapClass";if(e[t]){if(a(n).test(e[t]))return;e[t]+=" "+n}else e[t]=n;return 1})}),removeLineClass:ir(function(e,o,l){return dn(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",r=e[t];if(r){if(null==l)e[t]=null;else{var n=r.match(a(l));if(!n)return;var i=n.index+n[0].length;e[t]=r.slice(0,n.index)+(n.index&&i!=r.length?" ":"")+r.slice(i)||null}return 1}})}),addLineWidget:ir(function(e,t,r){return e=e,i=new bo(n=this,t,r),(o=n.cm)&&i.noHScroll&&(o.display.alignWidgets=!0),dn(n,e,"widget",function(e){var t=e.widgets||(e.widgets=[]);return null==i.insertAt?t.push(i):t.splice(Math.min(t.length-1,Math.max(0,i.insertAt)),0,i),i.line=e,o&&!re(n,e)&&(t=ne(e)<n.scrollTop,M(e,e.height+Qe(i)),t&&Yt(o,null,i.height),o.curOp.forceUpdate=!0),1}),Ke(o,"lineWidgetAdded",o,i,"number"==typeof e?e:H(e)),i;var n,i,o}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return hn(this,V(this,e),V(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){return t={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents},hn(this,e=V(this,e),e,t,"bookmark")},findMarksAt:function(e){var t=[],r=C(this,(e=V(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(n,i,o){n=V(this,n),i=V(this,i);var l=[],a=n.line;return this.iter(n.line,i.line+1,function(e){if(e=e.markedSpans)for(var t=0;t<e.length;t++){var r=e[t];null!=r.to&&a==n.line&&n.ch>=r.to||null==r.from&&a!=n.line||null!=r.from&&a==i.line&&r.from>=i.ch||o&&!o(r.marker)||l.push(r.marker.parent||r.marker)}++a}),l},getAllMarks:function(){var r=[];return this.iter(function(e){if(e=e.markedSpans)for(var t=0;t<e.length;++t)null!=e[t].from&&r.push(e[t].marker)}),r},posFromIndex:function(t){var r,n=this.first,i=this.lineSeparator().length;return this.iter(function(e){return e=e.text.length+i,t<e?(r=t,!0):(t-=e,void++n)}),V(this,E(n,r))},indexFromPos:function(e){var t=(e=V(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 So(L(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){var t=this.first,r=this.first+this.size;for(null!=(e=e||{}).from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to),t=new So(L(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction),e.sharedHist&&(t.history=this.history),(this.linked||(this.linked=[])).push({doc:t,sharedHist:e.sharedHist}),t.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],e=fn(this),r=0;r<e.length;r++){var n=e[r],i=n.find(),o=t.clipPos(i.from);I(o,i=t.clipPos(i.to))&&(o=hn(t,o,i,n.primary,n.primary.type),n.markers.push(o),o.parent=n)}return t},unlinkDoc:function(e){if(e instanceof jn&&(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),pn(fn(this));break}var r;e.history==this.history&&(r=[e.id],Ar(e,function(e){return r.push(e.id)},!0),e.history=new zr(null),e.history.done=Br(this.history.done,r),e.history.undone=Br(this.history.undone,r))},iterLinkedDocs:function(e){Ar(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):_i(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:ir(function(e){var t;(e="rtl"!=e?"ltr":e)!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&tr(t=this.cm,function(){Wr(t),or(t)}))})}),So.prototype.eachLine=So.prototype.iter;for(var Lo=0,Mo=!1,To={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},No=0;No<10;No++)To[No+48]=To[No+96]=String(No);for(var Ao=65;Ao<=90;Ao++)To[Ao]=String.fromCharCode(Ao);for(var Oo=1;Oo<=12;Oo++)To[Oo+111]=To[Oo+63235]="F"+Oo;var Wo={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"},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"},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"},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"]}};Wo.default=yi?Wo.macDefault:Wo.pcDefault;var zo,Do,Ho={selectAll:Jr,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Hi)},killLine:function(r){return Ln(r,function(e){if(e.empty()){var t=C(r.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<r.lastLine()?{from:e.head,to:E(e.head.line+1,0)}:{from:e.head,to:E(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){return Ln(t,function(e){return{from:E(e.from().line,0),to:V(t.doc,E(e.to().line+1,0))}})},delLineLeft:function(e){return Ln(e,function(e){return{from:E(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(r){return Ln(r,function(e){var t=r.charCoords(e.head,"div").top+5;return{from:r.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(r){return Ln(r,function(e){var t=r.charCoords(e.head,"div").top+5,t=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:t}})},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(E(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(E(e.lastLine()))},goLineStart:function(t){return t.extendSelectionsBy(function(e){return Mn(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){return t.extendSelectionsBy(function(e){return Tn(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(i){return i.extendSelectionsBy(function(e){e=e.head.line;for(var t,r=C(i.doc,e),n=r;t=Z(n,!1);)n=t.find(1,!0).line;return n!=r&&(e=H(n)),ue(!0,i,r,e,-1)},{origin:"+move",bias:-1})},goLineRight:function(t){return t.extendSelectionsBy(function(e){return e=t.charCoords(e.head,"div").top+5,t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:e},"div")},Ei)},goLineLeft:function(t){return t.extendSelectionsBy(function(e){return e=t.charCoords(e.head,"div").top+5,t.coordsChar({left:0,top:e},"div")},Ei)},goLineLeftSmart:function(r){return r.extendSelectionsBy(function(e){var t=r.charCoords(e.head,"div").top+5;return(t=r.coordsChar({left:0,top:t},"div")).ch<r.getLine(t.line).search(/\S/)?Tn(r,e.head):t},Ei)},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(),o=w(e.getLine(o.line),o.ch,n);t.push(g(n-o%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(l){return tr(l,function(){for(var e,t,r,n=l.listSelections(),i=[],o=0;o<n.length;o++)n[o].empty()&&(e=n[o].head,(t=C(l.doc,e.line).text)&&(0<(e=e.ch==t.length?new E(e.line,e.ch-1):e).ch?(e=new E(e.line,e.ch+1),l.replaceRange(t.charAt(e.ch-1)+t.charAt(e.ch-2),E(e.line,e.ch-2),e,"+transpose")):e.line>l.doc.first&&((r=C(l.doc,e.line-1).text)&&(e=new E(e.line,1),l.replaceRange(t.charAt(0)+l.doc.lineSeparator()+r.charAt(r.length-1),E(e.line-1,r.length-1),e,"+transpose")))),i.push(new mo(e,e)));l.setSelections(i)})},newlineAndIndent:function(r){return tr(r,function(){for(var e=r.listSelections(),t=e.length-1;0<=t;t--)r.replaceRange(r.doc.lineSeparator(),e[t].anchor,e[t].head,"+input");for(e=r.listSelections(),t=0;t<e.length;t++)r.indentLine(e[t].from().line,null,!0);Zt(r)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Po=new Li,Eo=null,Io={toString:function(){return"CodeMirror.Init"}},Fo={},Bo={};jn.defaults=Fo,jn.optionHandlers=Bo;var Ro=[];jn.defineInitHook=function(e){return Ro.push(e)};var jo=null,ti=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Li,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ti.prototype.init=function(e){function t(e){if(!pe(l,e)){if(l.somethingSelected())jo={lineWise:!1,text:l.getSelections()},"cut"==e.type&&l.replaceSelection("",null,"cut");else{if(!l.options.lineWiseCopyCut)return;var t=qn(l);jo={lineWise:!0,text:t.text},"cut"==e.type&&l.operation(function(){l.setSelections(t.ranges,0,Hi),l.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var r=jo.text.join("\n");if(e.clipboardData.setData("Text",r),e.clipboardData.getData("Text")==r)return void e.preventDefault()}var n=$n();e=n.firstChild,l.display.lineSpace.insertBefore(n,l.display.lineSpace.firstChild),e.value=jo.text.join("\n");var i=document.activeElement;Si(e),setTimeout(function(){l.display.lineSpace.removeChild(n),i.focus(),i==a&&o.showPrimarySelection()},50)}}var r=this,o=this,l=o.cm,a=o.div=e.lineDiv;_n(a,l.options.spellcheck),Ui(a,"paste",function(e){pe(l,e)||Gn(e,l)||si<=11&&setTimeout(rr(l,function(){return r.updateFromDOM()}),20)}),Ui(a,"compositionstart",function(e){r.composing={data:e.data,done:!1}}),Ui(a,"compositionupdate",function(e){r.composing||(r.composing={data:e.data,done:!1})}),Ui(a,"compositionend",function(e){r.composing&&(e.data!=r.composing.data&&r.readFromDOMSoon(),r.composing.done=!0)}),Ui(a,"touchstart",function(){return o.forceCompositionEnd()}),Ui(a,"input",function(){r.composing||r.readFromDOMSoon()}),Ui(a,"copy",t),Ui(a,"cut",t)},ti.prototype.prepareSelection=function(){var e=At(this.cm,!1);return e.focus=this.cm.state.focused,e},ti.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},ti.prototype.showPrimarySelection=function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=ei(this.cm,e.anchorNode,e.anchorOffset),n=ei(this.cm,e.focusNode,e.focusOffset);if(!r||r.bad||!n||n.bad||0!=I(j(r,n),t.from())||0!=I(R(r,n),t.to()))if(r=Zn(this.cm,t.from()),n=Zn(this.cm,t.to()),r||n){var i,o=this.cm.display.view,t=e.rangeCount&&e.getRangeAt(0);r?n||(n={node:(n=(n=o[o.length-1].measure).maps?n.maps[n.maps.length-1]:n.map)[n.length-1],offset:n[n.length-2]-n[n.length-3]}):r={node:o[0].measure.map[2],offset:0};try{i=Ci(r.node,r.offset,n.offset,n.node)}catch(e){}i&&(!ni&&this.cm.state.focused?(e.collapse(r.node,r.offset),i.collapsed||(e.removeAllRanges(),e.addRange(i))):(e.removeAllRanges(),e.addRange(i)),t&&null==e.anchorNode?e.addRange(t):ni&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()},ti.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)},ti.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},ti.prototype.rememberSelection=function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},ti.prototype.selectionInEditor=function(){var e=window.getSelection();return!!e.rangeCount&&(e=e.getRangeAt(0).commonAncestorContainer,u(this.div,e))},ti.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},ti.prototype.blur=function(){this.div.blur()},ti.prototype.getField=function(){return this.div},ti.prototype.supportsTouch=function(){return!0},ti.prototype.receivedFocus=function(){var t=this;this.selectionInEditor()?this.pollSelection():tr(this.cm,function(){return t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))})},ti.prototype.selectionChanged=function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},ti.prototype.pollSelection=function(){var e,t,r,n;null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()&&(e=window.getSelection(),t=this.cm,mi&&ui&&this.cm.options.gutters.length&&function(e){for(;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return 1}(e.anchorNode)?(this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus()):this.composing||(this.rememberSelection(),r=ei(t,e.anchorNode,e.anchorOffset),n=ei(t,e.focusNode,e.focusOffset),r&&n&&tr(t,function(){Ur(t.doc,wr(r,n),Hi),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})))},ti.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(0==n.ch&&n.line>e.firstLine()&&(n=E(n.line-1,C(e.doc,n.line-1).length)),i.ch==C(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=E(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o=n.line==t.viewFrom||0==(o=Tt(e,n.line))?(r=H(t.view[0].line),t.view[0].node):(r=H(t.view[o].line),t.view[o-1].node.nextSibling),t=(a=Tt(e,i.line))==t.view.length-1?(i=t.viewTo-1,t.lineDiv.lastChild):(i=H(t.view[a+1].line)-1,t.view[a+1].node.previousSibling);if(!o)return!1;for(t=e.doc.splitLines(Jn(e,o,t,r,i)),o=S(e.doc,E(r,0),E(i,C(e.doc,i).text.length));1<t.length&&1<o.length;)if(p(t)==p(o))t.pop(),o.pop(),i--;else{if(t[0]!=o[0])break;t.shift(),o.shift(),r++}for(var l=0,a=0,s=t[0],c=o[0],u=Math.min(s.length,c.length);l<u&&s.charCodeAt(l)==c.charCodeAt(l);)++l;for(s=p(t),c=p(o),u=Math.min(s.length-(1==t.length?l:0),c.length-(1==o.length?l:0));a<u&&s.charCodeAt(s.length-a-1)==c.charCodeAt(c.length-a-1);)++a;if(1==t.length&&1==o.length&&r==n.line)for(;l&&l>n.ch&&s.charCodeAt(s.length-a-1)==c.charCodeAt(c.length-a-1);)l--,a++;return t[t.length-1]=s.slice(0,s.length-a).replace(/^\u200b+/,""),t[0]=t[0].slice(l).replace(/\u200b+$/,""),n=E(r,l),r=E(i,o.length?p(o).length-a:0),1<t.length||t[0]||I(n,r)?(an(e.doc,t,n,r,"+input"),!0):void 0},ti.prototype.ensurePolled=function(){this.forceCompositionEnd()},ti.prototype.reset=function(){this.forceCompositionEnd()},ti.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},ti.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))},ti.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||tr(this.cm,function(){return or(e.cm)})},ti.prototype.setUneditable=function(e){e.contentEditable="false"},ti.prototype.onKeyPress=function(e){0!=e.charCode&&(e.preventDefault(),this.cm.isReadOnly()||rr(this.cm,Kn)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},ti.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},ti.prototype.onContextMenu=function(){},ti.prototype.resetPosition=function(){},ti.prototype.needsContentAttribute=!0;var Vo,Ko,Go,Uo,qo,oi=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Li,this.hasSelection=this.inaccurateSelection=!1,this.composing=null};function _o(e,t,n,r){Uo.defaults[e]=t,n&&(qo[e]=r?function(e,t,r){r!=Io&&n(e,t,r)}:n)}oi.prototype.init=function(t){function e(e){if(!pe(i,e)){if(i.somethingSelected())jo={lineWise:!1,text:i.getSelections()},n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,l.value=jo.text.join("\n"),Si(l));else{if(!i.options.lineWiseCopyCut)return;var t=qn(i);jo={lineWise:!0,text:t.text},"cut"==e.type?i.setSelections(t.ranges,null,Hi):(n.prevInput="",l.value=t.text.join("\n"),Si(l))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=$n(),l=this.textarea=o.firstChild;t.wrapper.insertBefore(o,t.wrapper.firstChild),gi&&(l.style.width="0px"),Ui(l,"input",function(){ai&&9<=si&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Ui(l,"paste",function(e){pe(i,e)||Gn(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Ui(l,"cut",e),Ui(l,"copy",e),Ui(t.scroller,"paste",function(e){Je(t,e)||pe(i,e)||(i.state.pasteIncoming=!0,n.focus())}),Ui(t.lineSpace,"selectstart",function(e){Je(t,e)||ve(e)}),Ui(l,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Ui(l,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},oi.prototype.prepareSelection=function(){var e,t=this.cm,r=t.display,n=t.doc,i=At(t);return t.options.moveInputWithCursor&&(t=mt(t,n.sel.primary().head,"div"),n=r.wrapper.getBoundingClientRect(),e=r.lineDiv.getBoundingClientRect(),i.teTop=Math.max(0,Math.min(r.wrapper.clientHeight-10,t.top+e.top-n.top)),i.teLeft=Math.max(0,Math.min(r.wrapper.clientWidth-10,t.left+e.left-n.left))),i},oi.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")},oi.prototype.reset=function(e){var t,r,n,i;this.contextMenuPending||(i=(n=this.cm).doc,n.somethingSelected()?(this.prevInput="",t=i.sel.primary(),r=(t=Xi&&(100<t.to().line-t.from().line||1e3<(r=n.getSelection()).length))?"-":r||n.getSelection(),this.textarea.value=r,n.state.focused&&Si(this.textarea),ai&&9<=si&&(this.hasSelection=r)):e||(this.prevInput=this.textarea.value="",ai&&9<=si&&(this.hasSelection=null)),this.inaccurateSelection=t)},oi.prototype.getField=function(){return this.textarea},oi.prototype.supportsTouch=function(){return!1},oi.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!vi||b()!=this.textarea))try{this.textarea.focus()}catch(e){}},oi.prototype.blur=function(){this.textarea.blur()},oi.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},oi.prototype.receivedFocus=function(){this.slowPoll()},oi.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},oi.prototype.fastPoll=function(){var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,function e(){r.poll()||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))})},oi.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||$i(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(ai&&9<=si&&this.hasSelection===i||yi&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu&&(8203!=(l=i.charCodeAt(0))||n||(n=""),8666==l))return this.reset(),this.cm.execCommand("undo");for(var o=0,l=Math.min(n.length,i.length);o<l&&n.charCodeAt(o)==i.charCodeAt(o);)++o;return tr(t,function(){Kn(t,i.slice(o),n.length-o,null,e.composing?"*compose":null),1e3<i.length||-1<i.indexOf("\n")?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},oi.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},oi.prototype.onKeyPress=function(){ai&&9<=si&&(this.hasSelection=null),this.fastPoll()},oi.prototype.onContextMenu=function(e){function r(){var e,t;null!=u.selectionStart&&(t=""+((e=s.somethingSelected())?u.value:""),u.value="⇚",u.value=t,a.prevInput=e?"":"",u.selectionStart=1,u.selectionEnd=t.length,c.selForContextMenu=s.doc.sel)}function t(){var e,t;a.contextMenuPending=!1,a.wrapper.style.cssText=i,u.style.cssText=n,ai&&si<9&&c.scrollbars.setScrollTop(c.scroller.scrollTop=h),null!=u.selectionStart&&((!ai||ai&&si<9)&&r(),e=0,t=function(){c.selForContextMenu==s.doc.sel&&0==u.selectionStart&&0<u.selectionEnd&&""==a.prevInput?rr(s,Jr)(s):e++<10?c.detectingSelectAll=setTimeout(t,500):(c.selForContextMenu=null,c.input.reset())},c.detectingSelectAll=setTimeout(t,200))}var n,i,o,l,a=this,s=a.cm,c=s.display,u=a.textarea,d=Mt(s,e),h=c.scroller.scrollTop;d&&!di&&(s.options.resetSelectionOnContextMenu&&-1==s.doc.sel.contains(d)&&rr(s,Ur)(s.doc,wr(d),Hi),n=u.style.cssText,i=a.wrapper.style.cssText,a.wrapper.style.cssText="position: absolute",d=a.wrapper.getBoundingClientRect(),u.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(ai?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",ci&&(o=window.scrollY),c.input.focus(),ci&&window.scrollTo(null,o),c.input.reset(),s.somethingSelected()||(u.value=a.prevInput=" "),a.contextMenuPending=!0,c.selForContextMenu=s.doc.sel,clearTimeout(c.detectingSelectAll),ai&&9<=si&&r(),xi?(be(e),l=function(){he(window,"mouseup",l),setTimeout(t,20)},Ui(window,"mouseup",l)):setTimeout(t,50))},oi.prototype.readOnlyChanged=function(e){e||this.reset()},oi.prototype.setUneditable=function(){},oi.prototype.needsContentAttribute=!1,qo=(Uo=jn).optionHandlers,Uo.defineOption=_o,Uo.Init=Io,_o("value","",function(e,t){return e.setValue(t)},!0),_o("mode",null,function(e,t){e.doc.modeOption=t,Lr(e)},!0),_o("indentUnit",2,Lr,!0),_o("indentWithTabs",!1),_o("smartIndent",!0),_o("tabSize",4,function(e){Mr(e),ht(e),or(e)},!0),_o("lineSeparator",null,function(e,n){if(e.doc.lineSep=n){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var r=e.text.indexOf(n,t);if(-1==r)break;t=r+n.length,i.push(E(o,r))}o++});for(var t=i.length-1;0<=t;t--)an(e.doc,n,i[t],E(i[t].line,i[t].ch+n.length))}}),_o("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!=Io&&e.refresh()}),_o("specialCharPlaceholder",Fe,function(e){return e.refresh()},!0),_o("electricChars",!0),_o("inputStyle",vi?"contenteditable":"textarea",function(){throw Error("inputStyle can not (yet) be changed in a running editor")},!0),_o("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),_o("rtlMoveVisually",!ri),_o("wholeLineUpdateBefore",!0),_o("theme","default",function(e){In(e),Fn(e)},!0),_o("keyMap","default",function(e,t,r){t=Sn(t),(r=r!=Io&&Sn(r))&&r.detach&&r.detach(e,t),t.attach&&t.attach(e,r||null)}),_o("extraKeys",null),_o("lineWrapping",!1,Rn,!0),_o("gutters",[],function(e){yr(e.options),Fn(e)},!0),_o("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?Ct(e.display)+"px":"0",e.refresh()},!0),_o("coverGutterNextToScrollbar",!1,function(e){return qt(e)},!0),_o("scrollbarStyle","native",function(e){$t(e),qt(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),_o("lineNumbers",!1,function(e){yr(e.options),Fn(e)},!0),_o("firstLineNumber",1,Fn,!0),_o("lineNumberFormatter",function(e){return e},Fn,!0),_o("showCursorWhenSelecting",!1,Nt,!0),_o("resetSelectionOnContextMenu",!0),_o("lineWiseCopyCut",!0),_o("readOnly",!1,function(e,t){"nocursor"==t?(Ht(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),_o("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),_o("dragDrop",!0,Bn),_o("allowDropFileTypes",null),_o("cursorBlinkRate",530),_o("cursorScrollMargin",0),_o("cursorHeight",1,Nt,!0),_o("singleCursorHeightPerLine",!0,Nt,!0),_o("workTime",100),_o("workDelay",100),_o("flattenSpans",!0,Mr,!0),_o("addModeClass",!1,Mr,!0),_o("pollInterval",100),_o("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),_o("historyEventDelay",1250),_o("viewportMargin",10,function(e){return e.refresh()},!0),_o("maxHighlightLength",1e4,Mr,!0),_o("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),_o("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),_o("autofocus",null),_o("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),Ko=(Vo=jn).optionHandlers,Go=Vo.helpers={},Vo.prototype={constructor:Vo,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,n=r[e];r[e]==t&&"mode"!=e||(r[e]=t,Ko.hasOwnProperty(e)&&rr(this,Ko[e])(this,t,n),fe(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"](Sn(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:nr(function(e,t){var r=e.token?e:Vo.getMode(this.options,e);if(r.startState)throw 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:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,or(this)}),removeOverlay:nr(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){t.splice(r,1),this.state.modeGen++,or(this);break}}}),indentLine:nr(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),N(this.doc,e)&&Vn(this,e,t,r)}),indentSelection:nr(function(e){for(var t=this.doc.sel.ranges,r=-1,n=0;n<t.length;n++)if((o=t[n]).empty())o.head.line>r&&(Vn(this,o.head.line,e,!0),r=o.head.line,n==this.doc.sel.primIndex&&Zt(this));else{for(var i=o.from(),o=o.to(),l=Math.max(r,i.line),r=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1,o=l;o<r;++o)Vn(this,o,e);o=this.doc.sel.ranges,0==i.ch&&t.length==o.length&&0<o[n].from().ch&&Kr(this.doc,n,new mo(i,o[n].to()),Hi)}}),getTokenAt:function(e,t){return De(this,e,t)},getLineTokens:function(e,t){return De(this,E(e),t,!0)},getTokenTypeAt:function(e){e=V(this.doc,e);var t=Ne(this,C(this.doc,e.line)),r=0,n=(t.length-1)/2;if(0==(e=e.ch))t=t[2];else for(;;){var i=r+n>>1;if((i?t[2*i-1]:0)>=e)n=i;else{if(!(t[2*i+1]<e)){t=t[2*i+2];break}r=1+i}}return(r=t?t.indexOf("overlay "):-1)<0?t:0==r?null:t.slice(0,r-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?Vo.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Go.hasOwnProperty(t))return r;var n=Go[t];if("string"==typeof(e=this.getModeAt(e))[t])n[e[t]]&&r.push(n[e[t]]);else if(e[t])for(var i=0;i<e[t].length;i++){var o=n[e[t][i]];o&&r.push(o)}else e.helperType&&n[e.helperType]?r.push(n[e.helperType]):n[e.name]&&r.push(n[e.name]);for(t=0;t<n._global.length;t++)(i=n._global[t]).pred(e,this)&&-1==h(r,i.val)&&r.push(i.val);return r},getStateAfter:function(e,t){var r=this.doc;return Ae(this,(e=Math.max(r.first,Math.min(null==e?r.first+r.size-1:e,r.first+r.size-1)))+1,t)},cursorCoords:function(e,t){var r=this.doc.sel.primary();return mt(this,e=null==e?r.head:"object"==typeof e?V(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return gt(this,V(this.doc,e),t||"page")},coordsChar:function(e,t){return yt(this,(e=pt(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=pt(this,{top:e,left:0},t||"page").top,T(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var n,i=!1;return"number"==typeof e&&(n=this.doc.first+this.doc.size-1,e<this.doc.first?e=this.doc.first:n<e&&(e=n,i=!0),e=C(this.doc,e)),ft(this,e,{top:0,left:0},t||"page",r||i).top+(i?this.doc.height-ne(e):0)},defaultTextHeight:function(){return wt(this.display)},defaultCharWidth:function(){return xt(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o,l,a=this.display,s=(e=mt(this,V(this.doc,e))).bottom,c=e.left;t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==n?s=e.top:"above"!=n&&"near"!=n||(o=Math.max(a.wrapper.clientHeight,this.doc.height),l=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth),("above"==n||e.bottom+t.offsetHeight>o)&&e.top>t.offsetHeight?s=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=o&&(s=e.bottom),c+t.offsetWidth>l&&(c=l-t.offsetWidth)),t.style.top=s+"px",t.style.left=t.style.right="","right"==i?(c=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),r&&(null!=(e=Xt(this,{left:c,top:s,right:c+t.offsetWidth,bottom:s+t.offsetHeight})).scrollTop&&Rt(this,e.scrollTop),null!=e.scrollLeft&&jt(this,e.scrollLeft))},triggerOnKeyDown:nr(Wn),triggerOnKeyPress:nr(Dn),triggerOnKeyUp:zn,execCommand:function(e){if(Ho.hasOwnProperty(e))return Ho[e].call(null,this)},triggerElectric:nr(function(e){Un(this,e)}),findPosH:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t),e=V(this.doc,e);for(var o=0;o<t&&!(e=Xn(this.doc,e,i,r,n)).hitSide;++o);return e},moveH:nr(function(t,r){var n=this;this.extendSelectionsBy(function(e){return n.display.shift||n.doc.extend||e.empty()?Xn(n.doc,e.head,t,r,n.options.rtlMoveVisually):t<0?e.from():e.to()},Ei)}),deleteH:nr(function(r,n){var i=this.doc;this.doc.sel.somethingSelected()?i.replaceSelection("",null,"+delete"):Ln(this,function(e){var t=Xn(i,e.head,r,n,!1);return r<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,r,n){var i=1;t<0&&(i=-1,t=-t);var o=V(this.doc,e);for(e=0;e<t&&(o=mt(this,o,"div"),null==n?n=o.left:o.left=n,!(o=Yn(this,o,i,r)).hitSide);++e);return o},moveV:nr(function(n,i){var o=this,l=this.doc,a=[],s=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(e){if(s)return n<0?e.from():e.to();var t=mt(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),a.push(t.left);var r=Yn(o,t,n,i);return"page"==i&&e==l.sel.primary()&&Yt(o,null,gt(o,r,"div").top-t.top),r},Ei),a.length)for(var e=0;e<l.sel.ranges.length;e++)l.sel.ranges[e].goalColumn=a[e]}),findWordAt:function(e){var t=C(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=m(o=t.charAt(r),i)?function(e){return m(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!m(e)};0<r&&o(t.charAt(r-1));)--r;for(;n<t.length&&o(t.charAt(n));)++n}return new mo(E(e.line,r),E(e.line,n))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||(((this.state.overwrite=!this.state.overwrite)?o:ki)(this.display.cursorDiv,"CodeMirror-overwrite"),fe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==b()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:nr(function(e,t){null==e&&null==t||Qt(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-rt(this)-this.display.barHeight,width:e.scrollWidth-rt(this)-this.display.barWidth,clientHeight:it(this),clientWidth:nt(this)}},scrollIntoView:nr(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:E(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?(Qt(this),this.curOp.scrollToPos=e):(e=Xt(this,{left:Math.min(e.from.left,e.to.left),top:Math.min(e.from.top,e.to.top)-e.margin,right:Math.max(e.from.right,e.to.right),bottom:Math.max(e.from.bottom,e.to.bottom)+e.margin}),this.scrollTo(e.scrollLeft,e.scrollTop))}),setSize:nr(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&dt(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){lr(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,fe(this,"refresh",this)}),operation:function(e){return tr(this,e)},refresh:nr(function(){var e=this.display.cachedTextHeight;or(this),this.curOp.forceUpdate=!0,ht(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),gr(this),(null==e||.5<Math.abs(e-wt(this.display)))&&Lt(this),fe(this,"refresh",this)}),swapDoc:nr(function(e){var t=this.doc;return t.cm=null,Or(this,e),ht(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Ke(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},e(Vo),Vo.registerHelper=function(e,t,r){Go.hasOwnProperty(e)||(Go[e]=Vo[e]={_global:[]}),Go[e][t]=r},Vo.registerGlobalHelper=function(e,t,r,n){Vo.registerHelper(e,t,n),Go[e]._global.push({pred:r,val:n})};var $o,Xo="iter insert remove copy getEditor constructor".split(" ");for($o in So.prototype)So.prototype.hasOwnProperty($o)&&h(Xo,$o)<0&&(jn.prototype[$o]=function(e){return function(){return e.apply(this.doc,arguments)}}(So.prototype[$o]));return e(So),jn.inputStyles={textarea:oi,contenteditable:ti},jn.defineMode=function(e){jn.defaults.mode||"null"==e||(jn.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Zi[e]=t}.apply(this,arguments)},jn.defineMIME=function(e,t){Qi[e]=t},jn.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jn.defineMIME("text/plain","null"),jn.defineExtension=function(e,t){jn.prototype[e]=t},jn.defineDocExtension=function(e,t){So.prototype[e]=t},jn.fromTextArea=function(t,e){function r(){t.value=a.getValue()}var n;if((e=e?c(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus&&(n=b(),e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body),t.form&&(Ui(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var i=t.form,o=i.submit;try{var l=i.submit=function(){r(),i.submit=o,i.submit(),i.submit=l}}catch(t){}}e.finishInit=function(e){e.save=r,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,r(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(he(t.form,"submit",r),"function"==typeof t.form.submit&&(t.form.submit=o))}},t.style.display="none";var a=jn(function(e){return t.parentNode.insertBefore(e,t.nextSibling)},e);return a},(ti=jn).off=he,ti.on=Ui,ti.wheelEventPixels=Kt,ti.Doc=So,ti.splitLines=_i,ti.countColumn=w,ti.findColumn=x,ti.isWordChar=i,ti.Pass=Di,ti.signal=fe,ti.Line=ro,ti.changeEnd=xr,ti.scrollbarModel=ho,ti.Pos=E,ti.cmpPos=I,ti.modes=Zi,ti.mimeModes=Qi,ti.resolveMode=xe,ti.getMode=ke,ti.modeExtensions=Ji,ti.extendMode=Ce,ti.copyState=Se,ti.startState=Me,ti.innerMode=Le,ti.commands=Ho,ti.keyMap=Wo,ti.keyName=Cn,ti.isModifierKey=kn,ti.lookupKey=xn,ti.normalizeKeyMap=wn,ti.StringStream=eo,ti.SharedTextMarker=ko,ti.TextMarker=xo,ti.LineWidget=bo,ti.e_preventDefault=ve,ti.e_stopPropagation=t,ti.e_stop=be,ti.addClass=o,ti.contains=u,ti.rmClass=ki,ti.keyNames=To,jn.version="5.25.0",jn}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(n){function l(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap","CodeMirror-activeline"),e.removeLineClass(e.state.activeLines[t],"background","CodeMirror-activeline-background"),e.removeLineClass(e.state.activeLines[t],"gutter","CodeMirror-activeline-gutter")}function i(t,e){for(var r=[],n=0;n<e.length;n++){var i=e[n],o=t.getOption("styleActiveLine");("object"==typeof o&&o.nonEmpty?i.anchor.line==i.head.line:i.empty())&&(i=t.getLineHandleVisualStart(i.head.line),r[r.length-1]!=i&&r.push(i))}!function(e,t){if(e.length==t.length){for(var r=0;r<e.length;r++)if(e[r]!=t[r])return;return 1}}(t.state.activeLines,r)&&t.operation(function(){l(t);for(var e=0;e<r.length;e++)t.addLineClass(r[e],"wrap","CodeMirror-activeline"),t.addLineClass(r[e],"background","CodeMirror-activeline-background"),t.addLineClass(r[e],"gutter","CodeMirror-activeline-gutter");t.state.activeLines=r})}function o(e,t){i(e,t.ranges)}n.defineOption("styleActiveLine",!1,function(e,t,r){t!=(r=r!=n.Init&&r)&&(r&&(e.off("beforeSelectionChange",o),l(e),delete e.state.activeLines),t&&(e.state.activeLines=[],i(e,e.listSelections()),e.on("beforeSelectionChange",o)))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(n){function c(e,t,r,n){var i=e.getLineHandle(t.line),o=t.ch-1;if(!(i=0<=o&&p[i.text.charAt(o)]||p[i.text.charAt(++o)]))return null;var l=">"==i.charAt(1)?1:-1;return r&&0<l!=(o==t.ch)?null:(r=e.getTokenTypeAt(f(t.line,o+1)),null==(e=a(e,f(t.line,o+(0<l?1:0)),l,r||null,n))?null:{from:f(t.line,o),to:e&&e.pos,match:e&&e.ch==i.charAt(0),forward:0<l})}function a(e,t,r,n,i){var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,a=[];i=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/;for(var l=0<r?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),s=t.line;s!=l;s+=r){var c=e.getLine(s);if(c){var u=0<r?0:c.length-1,d=0<r?c.length:-1;if(!(c.length>o))for(s==t.line&&(u=t.ch-(r<0?1:0));u!=d;u+=r){var h=c.charAt(u);if(i.test(h)&&(void 0===n||e.getTokenTypeAt(f(s,u+1))==n))if(">"==p[h].charAt(1)==0<r)a.push(h);else{if(!a.length)return{pos:f(s,u),ch:h};a.pop()}}}}return s-r!=(0<r?e.lastLine():e.firstLine())&&null}function t(e,t,r){for(var n=e.state.matchBrackets.maxHighlightLineLength||1e3,i=[],o=e.listSelections(),l=0;l<o.length;l++){var a,s=o[l].empty()&&c(e,o[l].head,!1,r);s&&e.getLine(s.from.line).length<=n&&(a=s.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket",i.push(e.markText(s.from,f(s.from.line,s.from.ch+1),{className:a})),s.to&&e.getLine(s.to.line).length<=n&&i.push(e.markText(s.to,f(s.to.line,s.to.ch+1),{className:a})))}if(i.length){if(u&&e.state.focused&&e.focus(),r=function(){e.operation(function(){for(var e=0;e<i.length;e++)i[e].clear()})},!t)return r;setTimeout(r,800)}}function i(e){e.operation(function(){o&&(o(),o=null),o=t(e,!1,e.state.matchBrackets)})}var u=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),f=n.Pos,p={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},o=null;n.defineOption("matchBrackets",!1,function(e,t,r){r&&r!=n.Init&&(e.off("cursorActivity",i),o&&(o(),o=null)),t&&(e.state.matchBrackets="object"==typeof t?t:{},e.on("cursorActivity",i))}),n.defineExtension("matchBrackets",function(){t(this,!0)}),n.defineExtension("findMatchingBracket",function(e,t,r){return c(this,e,t,r)}),n.defineExtension("scanForBracket",function(e,t,r,n){return a(this,e,t,r,n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(a){function n(e,t,r){function n(e){var t=a.wheelEventPixels(e)["horizontal"==l.orientation?"x":"y"],r=l.pos;l.moveTo(l.pos+t),l.pos!=r&&a.e_preventDefault(e)}this.orientation=t,this.scroll=r,this.screen=this.total=this.size=1,this.pos=0,this.node=document.createElement("div"),this.node.className=e+"-"+t,this.inner=this.node.appendChild(document.createElement("div"));var l=this;a.on(this.inner,"mousedown",function(e){function t(){a.off(document,"mousemove",r),a.off(document,"mouseup",t)}function r(e){if(1!=e.which)return t();l.moveTo(o+l.total/l.size*(e[n]-i))}var n,i,o;1==e.which&&(a.e_preventDefault(e),n="horizontal"==l.orientation?"pageX":"pageY",i=e[n],o=l.pos,a.on(document,"mousemove",r),a.on(document,"mouseup",t))}),a.on(this.node,"click",function(e){a.e_preventDefault(e);var t=l.inner.getBoundingClientRect();l.moveTo(l.pos+("horizontal"==l.orientation?e.clientX<t.left?-1:e.clientX>t.right?1:0:e.clientY<t.top?-1:e.clientY>t.bottom?1:0)*l.screen)}),a.on(this.node,"mousewheel",n),a.on(this.node,"DOMMouseScroll",n)}function r(e,t,r){this.addClass=e,this.horiz=new n(e,"horizontal",r),t(this.horiz.node),this.vert=new n(e,"vertical",r),t(this.vert.node),this.width=null}n.prototype.setPos=function(e,t){return(e=e<0?0:e)>this.total-this.screen&&(e=this.total-this.screen),!(!t&&e==this.pos)&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=this.size/this.total*e+"px",!0)},n.prototype.moveTo=function(e){this.setPos(e)&&this.scroll(e,this.orientation)},n.prototype.update=function(e,t,r){var n=this.screen!=t||this.total!=e||this.size!=r;n&&(this.screen=t,this.total=e,this.size=r),(e=this.size/this.total*this.screen)<10&&(this.size-=10-e,e=10),this.inner.style["horizontal"==this.orientation?"width":"height"]=e+"px",this.setPos(this.pos,n)},r.prototype.update=function(e){null==this.width&&(t=window.getComputedStyle?window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle)&&(this.width=parseInt(t.height));var t=this.width||0,r=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=n?"block":"none",this.horiz.node.style.display=r?"block":"none",n&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?t:0)),this.vert.node.style.bottom=r?t+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(n?t:0)-e.barLeft),this.horiz.node.style.right=n?t+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:n?t:0,bottom:r?t:0}},r.prototype.setScrollTop=function(e){this.vert.setPos(e)},r.prototype.setScrollLeft=function(e){this.horiz.setPos(e)},r.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},a.scrollbarModel.simple=function(e,t){return new r("CodeMirror-simplescroll",e,t)},a.scrollbarModel.overlay=function(e,t){return new r("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(N){function e(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}function r(e,t){for(var r,n=!1;null!=(r=e.next());){if(n&&"/"==r){t.tokenize=null;break}n="*"==r}return["comment","comment"]}N.defineMode("css",function(e,t){function i(e,t){return d=t,e}function o(i){return function(e,t){for(var r,n=!1;null!=(r=e.next());){if(r==i&&!n){")"==i&&e.backUp(1);break}n=!n&&"\\"==r}return r!=i&&(n||")"==i)||(t.tokenize=null),d="string"}}function l(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),d="(",null}function a(e,t,r){this.type=e,this.indent=t,this.prev=r}function n(e,t,r,n){return e.context=new a(r,t.indentation()+(!1===n?0:f),e.context),r}function s(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function c(e,t,r,n){for(n=n||1;0<n;n--)r.context=r.context.prev;return T[r.context.type](e,t,r)}function u(e){e=e.current().toLowerCase(),h=S.hasOwnProperty(e)?"atom":C.hasOwnProperty(e)?"keyword":"variable"}var r=t.inline;t.propertyKeywords||(t=N.resolveMode("text/css"));var d,h,f=e.indentUnit,p=t.tokenHooks,g=t.documentTypes||{},m=t.mediaTypes||{},v=t.mediaFeatures||{},y=t.mediaValueKeywords||{},b=t.propertyKeywords||{},w=t.nonStandardPropertyKeywords||{},x=t.fontProperties||{},k=t.counterDescriptors||{},C=t.colorKeywords||{},S=t.valueKeywords||{},L=t.allowNested,M=!0===t.supportsAtComponent,T={top:function(e,t,r){if("{"==e)return n(r,t,"block");if("}"==e&&r.context.prev)return s(r);if(M&&/@component/.test(e))return n(r,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return n(r,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return n(r,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return r.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return n(r,t,"at");if("hash"==e)h="builtin";else if("word"==e)h="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return n(r,t,"interpolation");if(":"==e)return"pseudo";if(L&&"("==e)return n(r,t,"parens")}return r.context.type},block:function(e,t,r){return"word"==e?(e=t.current().toLowerCase(),b.hasOwnProperty(e)?(h="property","maybeprop"):w.hasOwnProperty(e)?(h="string-2","maybeprop"):L?(h=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(h+=" error","maybeprop")):"meta"==e?"block":L||"hash"!=e&&"qualifier"!=e?T.top(e,t,r):(h="error","block")},maybeprop:function(e,t,r){return":"==e?n(r,t,"prop"):T[r.context.type](e,t,r)},prop:function(e,t,r){if(";"==e)return s(r);if("{"==e&&L)return n(r,t,"propBlock");if("}"==e||"{"==e)return c(e,t,r);if("("==e)return n(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)u(t);else if("interpolation"==e)return n(r,t,"interpolation")}else h+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?s(r):"word"==e?(h="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?c(e,t,r):")"==e?s(r):"("==e?n(r,t,"parens"):"interpolation"==e?n(r,t,"interpolation"):("word"==e&&u(t),"parens")},pseudo:function(e,t,r){return"meta"==e?"pseudo":"word"==e?(h="variable-3",r.context.type):T[r.context.type](e,t,r)},documentTypes:function(e,t,r){return"word"==e&&g.hasOwnProperty(t.current())?(h="tag",r.context.type):T.atBlock(e,t,r)},atBlock:function(e,t,r){return"("==e?n(r,t,"atBlock_parens"):"}"==e||";"==e?c(e,t,r):"{"==e?s(r)&&n(r,t,L?"block":"top"):"interpolation"==e?n(r,t,"interpolation"):("word"==e&&(e=t.current().toLowerCase(),h="only"==e||"not"==e||"and"==e||"or"==e?"keyword":m.hasOwnProperty(e)?"attribute":v.hasOwnProperty(e)?"property":y.hasOwnProperty(e)?"keyword":b.hasOwnProperty(e)?"property":w.hasOwnProperty(e)?"string-2":S.hasOwnProperty(e)?"atom":C.hasOwnProperty(e)?"keyword":"error"),r.context.type)},atComponentBlock:function(e,t,r){return"}"==e?c(e,t,r):"{"==e?s(r)&&n(r,t,L?"block":"top",!1):("word"==e&&(h="error"),r.context.type)},atBlock_parens:function(e,t,r){return")"==e?s(r):"{"==e||"}"==e?c(e,t,r,2):T.atBlock(e,t,r)},restricted_atBlock_before:function(e,t,r){return"{"==e?n(r,t,"restricted_atBlock"):"word"==e&&"@counter-style"==r.stateArg?(h="variable","restricted_atBlock_before"):T[r.context.type](e,t,r)},restricted_atBlock:function(e,t,r){return"}"==e?(r.stateArg=null,s(r)):"word"==e?(h="@font-face"==r.stateArg&&!x.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==r.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,r){return"word"==e?(h="variable","keyframes"):"{"==e?n(r,t,"top"):T[r.context.type](e,t,r)},at:function(e,t,r){return";"==e?s(r):"{"==e||"}"==e?c(e,t,r):("word"==e?h="tag":"hash"==e&&(h="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?s(r):"{"==e||";"==e?c(e,t,r):("word"==e?h="variable":"variable"!=e&&"("!=e&&")"!=e&&(h="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new a(r?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var r=(t.tokenize||function(e,t){var r=e.next();if(p[r]){var n=p[r](e,t);if(!1!==n)return n}return"@"==r?(e.eatWhile(/[\w\\\-]/),i("def",e.current())):"="==r||("~"==r||"|"==r)&&e.eat("=")?(d="compare",null):'"'==r||"'"==r?(t.tokenize=o(r),t.tokenize(e,t)):"#"==r?(e.eatWhile(/[\w\\\-]/),d="hash","atom"):"!"==r?(e.match(/^\s*\w*/),d="important","keyword"):/\d/.test(r)||"."==r&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),d="unit","number"):"-"===r?/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),d="unit","number"):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),d=e.match(/^\s*:/,!1)?"variable-definition":"variable","variable-2"):e.match(/^\w+-/)?d="meta":void 0:/[,+>*\/]/.test(r)?(d="select-op",null):"."==r&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?d="qualifier":/[:;{}\[\]\(\)]/.test(r)?i(null,r):"u"==r&&e.match(/rl(-prefix)?\(/)||"d"==r&&e.match("omain(")||"r"==r&&e.match("egexp(")?(e.backUp(1),t.tokenize=l,d="word","property"):/[\w\\\-]/.test(r)?(e.eatWhile(/[\w\\\-]/),d="word","property"):d=null})(e,t);return r&&"object"==typeof r&&(d=r[1],r=r[0]),h=r,t.state=T[t.state](d,e,t),h},indent:function(e,t){e=e.context,t=t&&t.charAt(0);var r=e.indent;return(e="prop"==e.type&&("}"==t||")"==t)?e.prev:e).prev&&("}"!=t||"block"!=e.type&&"top"!=e.type&&"interpolation"!=e.type&&"restricted_atBlock"!=e.type?(")"!=t||"parens"!=e.type&&"atBlock_parens"!=e.type)&&("{"!=t||"at"!=e.type&&"atBlock"!=e.type)||(r=Math.max(0,e.indent-f)):r=(e=e.prev).indent),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:t.lineComment,fold:"brace"}});var t=e(b=["domain","regexp","url","url-prefix"]),n="all aural braille handheld print projection screen tty tv embossed".split(" "),i=e(n),o="width min-width max-width height min-height max-height device-width min-device-width max-device-width device-height min-device-height max-device-height aspect-ratio min-aspect-ratio max-aspect-ratio device-aspect-ratio min-device-aspect-ratio max-device-aspect-ratio color min-color max-color color-index min-color-index max-color-index monochrome min-monochrome max-monochrome resolution min-resolution max-resolution scan grid orientation device-pixel-ratio min-device-pixel-ratio max-device-pixel-ratio pointer any-pointer hover any-hover".split(" "),l=e(o),a="landscape portrait none coarse fine on-demand hover interlace progressive".split(" "),s=e(a),c="align-content align-items align-self alignment-adjust alignment-baseline anchor-point animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function appearance azimuth backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size baseline-shift binding bleed bookmark-label bookmark-level bookmark-state bookmark-target border border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip color color-profile column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width columns content counter-increment counter-reset crop cue cue-after cue-before cursor direction display dominant-baseline drop-initial-after-adjust drop-initial-after-align drop-initial-before-adjust drop-initial-before-align drop-initial-size drop-initial-value elevation empty-cells fit fit-position flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float float-offset flow-from flow-into font font-feature-settings font-family font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-rows grid-column grid-column-end grid-column-gap grid-column-start grid-gap grid-row grid-row-end grid-row-gap grid-row-start grid-template grid-template-areas grid-template-columns grid-template-rows hanging-punctuation height hyphens icon image-orientation image-rendering image-resolution inline-box-align justify-content left letter-spacing line-break line-height line-stacking line-stacking-ruby line-stacking-shift line-stacking-strategy list-style list-style-image list-style-position list-style-type margin margin-bottom margin-left margin-right margin-top marks marquee-direction marquee-loop marquee-play-count marquee-speed marquee-style max-height max-width min-height min-width move-to nav-down nav-index nav-left nav-right nav-up object-fit object-position opacity order orphans outline outline-color outline-offset outline-style outline-width overflow overflow-style overflow-wrap overflow-x overflow-y padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside page-policy pause pause-after pause-before perspective perspective-origin pitch pitch-range play-during position presentation-level punctuation-trim quotes region-break-after region-break-before region-break-inside region-fragment rendering-intent resize rest rest-after rest-before richness right rotation rotation-point ruby-align ruby-overhang ruby-position ruby-span shape-image-threshold shape-inside shape-margin shape-outside size speak speak-as speak-header speak-numeral speak-punctuation speech-rate stress string-set tab-size table-layout target target-name target-new target-position text-align text-align-last text-decoration text-decoration-color text-decoration-line text-decoration-skip text-decoration-style text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-height text-indent text-justify text-outline text-overflow text-shadow text-size-adjust text-space-collapse text-transform text-underline-position text-wrap top transform transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi user-select vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-range voice-rate voice-stress voice-volume volume white-space widows width will-change word-break word-spacing word-wrap z-index clip-path clip-rule mask enable-background filter flood-color flood-opacity lighting-color stop-color stop-opacity pointer-events color-interpolation color-interpolation-filters color-rendering fill fill-opacity fill-rule image-rendering marker marker-end marker-mid marker-start shape-rendering stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-rendering baseline-shift dominant-baseline glyph-orientation-horizontal glyph-orientation-vertical text-anchor writing-mode".split(" "),u=e(c),d="scrollbar-arrow-color scrollbar-base-color scrollbar-dark-shadow-color scrollbar-face-color scrollbar-highlight-color scrollbar-shadow-color scrollbar-3d-light-color scrollbar-track-color shape-inside searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration zoom".split(" "),h=e(d),f=e("font-family src unicode-range font-variant font-feature-settings font-stretch font-weight font-style".split(" ")),p=e("additive-symbols fallback negative pad prefix range speak-as suffix symbols system".split(" ")),g="aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkturquoise darkviolet deeppink deepskyblue dimgray dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray grey green greenyellow honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightpink lightsalmon lightseagreen lightskyblue lightslategray lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen".split(" "),m=e(g),v="above absolute activeborder additive activecaption afar after-white-space ahead alias all all-scroll alphabetic alternate always amharic amharic-abegede antialiased appworkspace arabic-indic armenian asterisks attr auto auto-flow avoid avoid-column avoid-page avoid-region background backwards baseline below bidi-override binary bengali blink block block-axis bold bolder border border-box both bottom break break-all break-word bullets button button-bevel buttonface buttonhighlight buttonshadow buttontext calc cambodian capitalize caps-lock-indicator caption captiontext caret cell center checkbox circle cjk-decimal cjk-earthly-branch cjk-heavenly-stem cjk-ideographic clear clip close-quote col-resize collapse color color-burn color-dodge column column-reverse compact condensed contain content contents content-box context-menu continuous copy counter counters cover crop cross crosshair currentcolor cursive cyclic darken dashed decimal decimal-leading-zero default default-button dense destination-atop destination-in destination-out destination-over devanagari difference disc discard disclosure-closed disclosure-open document dot-dash dot-dot-dash dotted double down e-resize ease ease-in ease-in-out ease-out element ellipse ellipsis embed end ethiopic ethiopic-abegede ethiopic-abegede-am-et ethiopic-abegede-gez ethiopic-abegede-ti-er ethiopic-abegede-ti-et ethiopic-halehame-aa-er ethiopic-halehame-aa-et ethiopic-halehame-am-et ethiopic-halehame-gez ethiopic-halehame-om-et ethiopic-halehame-sid-et ethiopic-halehame-so-et ethiopic-halehame-ti-er ethiopic-halehame-ti-et ethiopic-halehame-tig ethiopic-numeric ew-resize exclusion expanded extends extra-condensed extra-expanded fantasy fast fill fixed flat flex flex-end flex-start footnotes forwards from geometricPrecision georgian graytext grid groove gujarati gurmukhi hand hangul hangul-consonant hard-light hebrew help hidden hide higher highlight highlighttext hiragana hiragana-iroha horizontal hsl hsla hue icon ignore inactiveborder inactivecaption inactivecaptiontext infinite infobackground infotext inherit initial inline inline-axis inline-block inline-flex inline-grid inline-table inset inside intrinsic invert italic japanese-formal japanese-informal justify kannada katakana katakana-iroha keep-all khmer korean-hangul-formal korean-hanja-formal korean-hanja-informal landscape lao large larger left level lighter lighten line-through linear linear-gradient lines list-item listbox listitem local logical loud lower lower-alpha lower-armenian lower-greek lower-hexadecimal lower-latin lower-norwegian lower-roman lowercase ltr luminosity malayalam match matrix matrix3d media-controls-background media-current-time-display media-fullscreen-button media-mute-button media-play-button media-return-to-realtime-button media-rewind-button media-seek-back-button media-seek-forward-button media-slider media-sliderthumb media-time-remaining-display media-volume-slider media-volume-slider-container media-volume-sliderthumb medium menu menulist menulist-button menulist-text menulist-textfield menutext message-box middle min-intrinsic mix mongolian monospace move multiple multiply myanmar n-resize narrower ne-resize nesw-resize no-close-quote no-drop no-open-quote no-repeat none normal not-allowed nowrap ns-resize numbers numeric nw-resize nwse-resize oblique octal opacity open-quote optimizeLegibility optimizeSpeed oriya oromo outset outside outside-shape overlay overline padding padding-box painted page paused persian perspective plus-darker plus-lighter pointer polygon portrait pre pre-line pre-wrap preserve-3d progress push-button radial-gradient radio read-only read-write read-write-plaintext-only rectangle region relative repeat repeating-linear-gradient repeating-radial-gradient repeat-x repeat-y reset reverse rgb rgba ridge right rotate rotate3d rotateX rotateY rotateZ round row row-resize row-reverse rtl run-in running s-resize sans-serif saturation scale scale3d scaleX scaleY scaleZ screen scroll scrollbar scroll-position se-resize searchfield searchfield-cancel-button searchfield-decoration searchfield-results-button searchfield-results-decoration semi-condensed semi-expanded separate serif show sidama simp-chinese-formal simp-chinese-informal single skew skewX skewY skip-white-space slide slider-horizontal slider-vertical sliderthumb-horizontal sliderthumb-vertical slow small small-caps small-caption smaller soft-light solid somali source-atop source-in source-out source-over space space-around space-between spell-out square square-button start static status-bar stretch stroke sub subpixel-antialiased super sw-resize symbolic symbols system-ui table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group tamil telugu text text-bottom text-top textarea textfield thai thick thin threeddarkshadow threedface threedhighlight threedlightshadow threedshadow tibetan tigre tigrinya-er tigrinya-er-abegede tigrinya-et tigrinya-et-abegede to top trad-chinese-formal trad-chinese-informal transform translate translate3d translateX translateY translateZ transparent ultra-condensed ultra-expanded underline unset up upper-alpha upper-armenian upper-greek upper-hexadecimal upper-latin upper-norwegian upper-roman uppercase urdu url var vertical vertical-text visible visibleFill visiblePainted visibleStroke visual w-resize wait wave wider window windowframe windowtext words wrap wrap-reverse x-large x-small xor xx-large xx-small".split(" "),y=e(v),b=b.concat(n).concat(o).concat(a).concat(c).concat(d).concat(g).concat(v);N.registerHelper("hintWords","css",b),N.defineMIME("text/css",{documentTypes:t,mediaTypes:i,mediaFeatures:l,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:f,counterDescriptors:p,colorKeywords:m,valueKeywords:y,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r)(e,t)}},name:"css"}),N.defineMIME("text/x-scss",{mediaTypes:i,mediaFeatures:l,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:m,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),N.defineMIME("text/x-less",{mediaTypes:i,mediaFeatures:l,mediaValueKeywords:s,propertyKeywords:u,nonStandardPropertyKeywords:h,colorKeywords:m,valueKeywords:y,fontProperties:f,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=r)(e,t):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),N.defineMIME("text/x-gss",{documentTypes:t,mediaTypes:i,mediaFeatures:l,propertyKeywords:u,nonStandardPropertyKeywords:h,fontProperties:f,counterDescriptors:p,colorKeywords:m,valueKeywords:y,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=r)(e,t)}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(We){function ze(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}We.defineMode("javascript",function(e,a){function o(e,t,r){return ve=e,ye=r,t}function s(e,t){var i,r=e.next();if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){var r,n=!1;if(xe&&"@"==e.peek()&&e.match(Te))return t.tokenize=s,o("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=s),o("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==r&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return o(r);if("="==r&&e.eat(">"))return o("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"!=r)return"`"==r?(t.tokenize=l)(e,t):"#"==r?(e.skipToEnd(),o("error","error")):Me.test(r)?(">"==r&&t.lexical&&">"==t.lexical.type||e.eatWhile(Me),o("operator","operator",e.current())):Se.test(r)?(e.eatWhile(Se),e=e.current(),(r=Le.propertyIsEnumerable(e)&&Le[e])&&"."!=t.lastType?o(r.type,r.style,e):o("variable","variable",e)):void 0;if(e.eat("*"))return(t.tokenize=c)(e,t);if(e.eat("/"))return e.skipToEnd(),o("comment","comment");if(ze(e,t,1)){e:for(var n=t=!1;null!=(r=e.next());){if(!t){if("/"==r&&!n)break e;"["==r?n=!0:n&&"]"==r&&(n=!1)}t=!t&&"\\"==r}return e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")}return e.eatWhile(Me),o("operator","operator",e.current())}function c(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=s;break}n="*"==r}return o("comment","comment")}function l(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=s;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function u(e,t){if(t.fatArrowAt&&(t.fatArrowAt=null),!((i=e.string.indexOf("=>",e.start))<0)){Ce&&(r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,i)))&&(i=r.index);for(var r=0,n=!1,i=i-1;0<=i;--i){var o=e.string.charAt(i),l="([{}])".indexOf(o);if(0<=l&&l<3){if(!r){++i;break}if(0==--r){"("==o&&(n=!0);break}}else if(3<=l&&l<6)++r;else if(Se.test(o))n=!0;else{if(/["'\/]/.test(o))return;if(n&&!r){++i;break}}}n&&!r&&(t.fatArrowAt=i)}}function d(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 h(){for(var e=arguments.length-1;0<=e;e--)Ae.cc.push(arguments[e])}function f(){return h.apply(null,arguments),!0}function r(t){function e(e){for(;e;e=e.next)if(e.name==t)return 1}var r=Ae.state;Ae.marked="def",r.context?e(r.localVars)||(r.localVars={name:t,next:r.localVars}):!e(r.globalVars)&&a.globalVars&&(r.globalVars={name:t,next:r.globalVars})}function p(){Ae.state.context={prev:Ae.state.context,vars:Ae.state.localVars},Ae.state.localVars=Oe}function g(){Ae.state.localVars=Ae.state.context.vars,Ae.state.context=Ae.state.context.prev}function m(n,i){function e(){var e=Ae.state,t=e.indented;if("stat"==e.lexical.type)t=e.lexical.indented;else for(var r=e.lexical;r&&")"==r.type&&r.align;r=r.prev)t=r.indented;e.lexical=new d(t,Ae.stream.column(),n,null,e.lexical,i)}return e.lex=!0,e}function v(){var e=Ae.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function y(r){return function e(t){return t==r?f():";"==r?h():f(e)}}function b(e,t){return"var"==e?f(m("vardef",t.length),U,y(";"),v):"keyword a"==e?f(m("form"),n,b,v):"keyword b"==e?f(m("form"),b,v):"{"==e?f(m("}"),F,v):";"==e?f():"if"==e?("else"==Ae.state.lexical.info&&Ae.state.cc[Ae.state.cc.length-1]==v&&Ae.state.cc.pop()(),f(m("form"),n,b,v,Y)):"function"==e?f(re):"for"==e?f(m("form"),Z,b,v):"variable"==e?f(m("stat"),W):"switch"==e?f(m("form"),n,m("}","switch"),y("{"),F,v,v):"case"==e?f(w,y(":")):"default"==e?f(y(":")):"catch"==e?f(m("form"),p,y("("),ne,y(")"),b,v,g):"class"==e?f(m("form"),oe,v):"export"==e?f(m("stat"),ce,v):"import"==e?f(m("stat"),de,v):"module"==e?f(m("form"),q,m("}"),y("{"),F,v,v):"type"==e?f(R,y("operator"),R,y(";")):"async"==e?f(b):h(m("stat"),w,y(";"),v)}function w(e){return t(e,!1)}function x(e){return t(e,!0)}function n(e){return"("!=e?h():f(m(")"),w,y(")"),v)}function t(e,t){if(Ae.state.fatArrowAt==Ae.stream.start){var r=t?N:T;if("("==e)return f(p,m(")"),E(q,")"),v,y("=>"),r,g);if("variable"==e)return h(p,q,y("=>"),r,g)}return r=t?S:C,Ne.hasOwnProperty(e)?f(r):"function"==e?f(re,r):"class"==e?f(m("form"),ie,v):"keyword c"==e||"async"==e?f(t?i:k):"("==e?f(m(")"),k,y(")"),v,r):"operator"==e||"spread"==e?f(t?x:w):"["==e?f(m("]"),me,v,r):"{"==e?I(D,"}",null,r):"quasi"==e?h(L,r):"new"==e?f((n=t,function(e){return"."==e?f(n?O:A):h(n?x:w)})):f();var n}function k(e){return e.match(/[;\}\)\],]/)?h():h(w)}function i(e){return e.match(/[;\}\)\],]/)?h():h(x)}function C(e,t){return","==e?f(w):S(e,t,!1)}function S(e,t,r){var n=0==r?C:S,i=0==r?w:x;return"=>"==e?f(p,r?N:T,g):"operator"==e?/\+\+|--/.test(t)?f(n):"?"==t?f(w,y(":"),i):f(i):"quasi"==e?h(L,n):";"!=e?"("==e?I(x,")","call",n):"."==e?f(z,n):"["==e?f(m("]"),k,y("]"),v,n):void 0:void 0}function L(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?f(L):f(w,M)}function M(e){if("}"==e)return Ae.marked="string-2",Ae.state.tokenize=l,f(L)}function T(e){return u(Ae.stream,Ae.state),h("{"==e?b:w)}function N(e){return u(Ae.stream,Ae.state),h("{"==e?b:x)}function A(e,t){if("target"==t)return Ae.marked="keyword",f(C)}function O(e,t){if("target"==t)return Ae.marked="keyword",f(S)}function W(e){return":"==e?f(v,b):h(C,y(";"),v)}function z(e){if("variable"==e)return Ae.marked="property",f()}function D(e,t){return"async"==e?(Ae.marked="property",f(D)):"variable"==e||"keyword"==Ae.style?(Ae.marked="property",f("get"==t||"set"==t?H:P)):"number"==e||"string"==e?(Ae.marked=xe?"property":Ae.style+" property",f(P)):"jsonld-keyword"==e?f(P):"modifier"==e?f(D):"["==e?f(w,y("]"),P):"spread"==e?f(w):":"==e?h(P):void 0}function H(e){return"variable"!=e?h(P):(Ae.marked="property",f(re))}function P(e){return":"==e?f(x):"("==e?h(re):void 0}function E(r,n,i){function o(e,t){return(i?-1<i.indexOf(e):","==e)?("call"==(e=Ae.state.lexical).info&&(e.pos=(e.pos||0)+1),f(function(e,t){return e==n||t==n?h():h(r)},o)):e==n||t==n?f():f(y(n))}return function(e,t){return e==n||t==n?f():h(r,o)}}function I(e,t,r){for(var n=3;n<arguments.length;n++)Ae.cc.push(arguments[n]);return f(m(t,r),E(e,t),v)}function F(e){return"}"==e?f():h(b,F)}function B(e,t){if(Ce)return":"==e?f(R):"?"==t?f(B):void 0}function R(e){return"variable"==e?(Ae.marked="variable-3",f(G)):"string"==e||"number"==e||"atom"==e?f(G):"{"==e?f(m("}"),E(V,"}",",;"),v):"("==e?f(E(K,")"),j):void 0}function j(e){if("=>"==e)return f(R)}function V(e,t){return"variable"==e||"keyword"==Ae.style?(Ae.marked="property",f(V)):"?"==t?f(V):":"==e?f(R):void 0}function K(e){return"variable"==e?f(K):":"==e?f(R):void 0}function G(e,t){return"<"==t?f(m(">"),E(R,">"),v,G):"|"==t||"."==e?f(R):"["==e?f(y("]"),G):void 0}function U(){return h(q,B,$,X)}function q(e,t){return"modifier"==e?f(q):"variable"==e?(r(t),f()):"spread"==e?f(q):"["==e?I(q,"]"):"{"==e?I(_,"}"):void 0}function _(e,t){return"variable"!=e||Ae.stream.match(/^\s*:/,!1)?("variable"==e&&(Ae.marked="property"),"spread"==e?f(q):"}"==e?h():f(y(":"),q,$)):(r(t),f($))}function $(e,t){if("="==t)return f(x)}function X(e){if(","==e)return f(U)}function Y(e,t){if("keyword b"==e&&"else"==t)return f(m("form","else"),b,v)}function Z(e){if("("==e)return f(m(")"),Q,y(")"),v)}function Q(e){return"var"==e?f(U,y(";"),ee):";"==e?f(ee):"variable"==e?f(J):h(w,y(";"),ee)}function J(e,t){return"in"==t||"of"==t?(Ae.marked="keyword",f(w)):f(C,ee)}function ee(e,t){return";"==e?f(te):"in"==t||"of"==t?(Ae.marked="keyword",f(w)):h(w,y(";"),te)}function te(e){")"!=e&&f(w)}function re(e,t){return"*"==t?(Ae.marked="keyword",f(re)):"variable"==e?(r(t),f(re)):"("==e?f(p,m(")"),E(ne,")"),v,B,b,g):void 0}function ne(e){return"spread"==e?f(ne):h(q,B,$)}function ie(e,t){return("variable"==e?oe:le)(e,t)}function oe(e,t){if("variable"==e)return r(t),f(le)}function le(e,t){return"<"==t?f(m(">"),E(R,">"),v,le):"extends"==t||"implements"==t||Ce&&","==e?f(Ce?R:w,le):"{"==e?f(m("}"),ae,v):void 0}function ae(e,t){return"variable"==e||"keyword"==Ae.style?("async"==t||"static"==t||"get"==t||"set"==t||Ce&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&Ae.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Ae.marked="keyword",f(ae)):(Ae.marked="property",f(Ce?se:re,ae)):"["==e?f(w,y("]"),Ce?se:re,ae):"*"==t?(Ae.marked="keyword",f(ae)):";"==e?f(ae):"}"==e?f():void 0}function se(e,t){return"?"==t?f(se):":"==e?f(R,$):"="==t?f(x):h(re)}function ce(e,t){return"*"==t?(Ae.marked="keyword",f(ge,y(";"))):"default"==t?(Ae.marked="keyword",f(w,y(";"))):"{"==e?f(E(ue,"}"),ge,y(";")):h(b)}function ue(e,t){return"as"==t?(Ae.marked="keyword",f(y("variable"))):"variable"==e?h(x,ue):void 0}function de(e){return"string"==e?f():h(he,fe,ge)}function he(e,t){return"{"==e?I(he,"}"):("variable"==e&&r(t),"*"==t&&(Ae.marked="keyword"),f(pe))}function fe(e){if(","==e)return f(he,fe)}function pe(e,t){if("as"==t)return Ae.marked="keyword",f(he)}function ge(e,t){if("from"==t)return Ae.marked="keyword",f(w)}function me(e){return"]"==e?f():h(E(x,"]"))}var ve,ye,be=e.indentUnit,we=a.statementIndent,xe=a.jsonld,ke=a.json||xe,Ce=a.typescript,Se=a.wordCharacters||/[\w$\xa1-\uffff]/,Le=function(){function e(e){return{type:e,style:"keyword"}}var t,r=e("keyword a"),n=e("keyword b"),i=e("keyword c"),o=e("operator"),l={type:"atom",style:"atom"},r={if:e("if"),while:r,with:r,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:i,throw:i,debugger:i,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:i,export:e("export"),import:e("import"),extends:i,await:i,async:e("async")};if(Ce)for(t in i={interface:e("class"),implements:i,namespace:i,module:e("module"),enum:e("module"),type:e("type"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:o,string:n={type:"variable",style:"variable-3"},number:n,boolean:n,any:n})r[t]=i[t];return r}(),Me=/[+\-*&%=<>!?|~^]/,Te=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ne={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ae={state:null,column:null,marked:null,cc:null},Oe={name:"this",next:{name:"arguments"}};return v.lex=!0,{startState:function(e){return e={tokenize:s,lastType:"sof",cc:[],lexical:new d((e||0)-be,0,"block",!1),localVars:a.localVars,context:a.localVars&&{vars:a.localVars},indented:e||0},a.globalVars&&"object"==typeof a.globalVars&&(e.globalVars=a.globalVars),e},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=c&&e.eatSpace())return null;var r=t.tokenize(e,t);if("comment"==ve)return r;t.lastType="operator"!=ve||"++"!=ye&&"--"!=ye?ve:"incdec";e:{var n=ve,i=ye,o=t.cc;for(Ae.state=t,Ae.stream=e,Ae.marked=null,Ae.cc=o,Ae.style=r,t.lexical.hasOwnProperty("align")||(t.lexical.align=!0);;)if((o.length?o.pop():ke?w:b)(n,i)){for(;o.length&&o[o.length-1].lex;)o.pop()();if(Ae.marked){r=Ae.marked;break e}if(e="variable"==n)t:{for(e=t.localVars;e;e=e.next)if(e.name==i){e=!0;break t}for(t=t.context;t;t=t.prev)for(e=t.vars;e;e=e.next)if(e.name==i){e=!0;break t}e=void 0}if(e){r="variable-2";break e}break e}}return r},indent:function(e,t){if(e.tokenize==c)return We.Pass;if(e.tokenize!=s)return 0;var r,n=t&&t.charAt(0),i=e.lexical;if(!/^\s*else\b/.test(t))for(var o=e.cc.length-1;0<=o;--o){var l=e.cc[o];if(l==v)i=i.prev;else if(l!=Y)break}for(;!("stat"!=i.type&&"form"!=i.type||"}"!=n&&(!(r=e.cc[e.cc.length-1])||r!=C&&r!=S||/^[,\.=+\-*:?[\(]/.test(t)));)i=i.prev;return o=n==(r=(i=we&&")"==i.type&&"stat"==i.prev.type?i.prev:i).type),"vardef"==r?i.indented+("operator"==e.lastType||","==e.lastType?i.info+1:0):"form"==r&&"{"==n?i.indented:"form"==r?i.indented+be:"stat"==r?(n=i.indented)+((e="operator"==e.lastType||","==e.lastType||Me.test(t.charAt(0))||/[,.]/.test(t.charAt(0)))?we||be:0):"switch"!=i.info||o||0==a.doubleIndentSwitch?i.align?i.column+(o?0:1):i.indented+(o?0:be):i.indented+(/^(?:case|default)\b/.test(t)?be:2*be)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:ke?null:"/*",blockCommentEnd:ke?null:"*/",lineComment:ke?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:ke?"json":"javascript",jsonldMode:xe,jsonMode:ke,expressionAllowed:ze,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=w&&t!=x||e.cc.pop()}}}),We.registerHelper("wordChars","javascript",/[\w$]/),We.defineMIME("text/javascript","javascript"),We.defineMIME("text/ecmascript","javascript"),We.defineMIME("application/javascript","javascript"),We.defineMIME("application/x-javascript","javascript"),We.defineMIME("application/ecmascript","javascript"),We.defineMIME("application/json",{name:"javascript",json:!0}),We.defineMIME("application/x-json",{name:"javascript",json:!0}),We.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),We.defineMIME("text/typescript",{name:"javascript",typescript:!0}),We.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(C){var S={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},L={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};C.defineMode("xml",function(e,t){function l(t,r){function e(e){return(r.tokenize=e)(t,r)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?e(i("atom","]]>")):null:t.match("--")?e(i("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),e(function n(i){return function(e,t){for(var r;null!=(r=e.next());){if("<"==r)return t.tokenize=n(i+1),t.tokenize(e,t);if(">"==r){if(1!=i)return t.tokenize=n(i-1),t.tokenize(e,t);t.tokenize=l;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),r.tokenize=i("meta","?>"),"meta"):(y=t.eat("/")?"closeTag":"openTag",r.tokenize=a,"tag bracket"):"&"!=n?(t.eatWhile(/[^&<]/),null):(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error"}function a(e,t){var r,n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=l,y=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return y="equals",null;if("<"!=n)return/[\'\"]/.test(n)?(t.tokenize=(r=n,i.isInAttribute=!0,i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word");t.tokenize=l,t.state=c,t.tagName=t.tagStart=null;t=t.tokenize(e,t);return t?t+" tag error":"tag error";function i(e,t){for(;!e.eol();)if(e.next()==r){t.tokenize=a;break}return"string"}}function i(r,n){return function(e,t){for(;!e.eol();){if(e.match(n)){t.tokenize=l;break}e.next()}return r}}function o(e,t,r){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=r,(x.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function n(e){e.context&&(e.context=e.context.prev)}function s(e,t){for(var r;;){if(!e.context)return;if(r=e.context.tagName,!x.contextGrabbers.hasOwnProperty(r)||!x.contextGrabbers[r].hasOwnProperty(t))return;n(e)}}function c(e,t,r){return"openTag"==e?(r.tagStart=t.column(),u):"closeTag"==e?d:c}function u(e,t,r){return"word"==e?(r.tagName=t.current(),b="tag",p):(b="error",u)}function d(e,t,r){if("word"!=e)return b="error",f;t=t.current();return r.context&&r.context.tagName!=t&&x.implicitlyClosed.hasOwnProperty(r.context.tagName)&&n(r),r.context&&r.context.tagName==t||!1===x.matchClosing?(b="tag",h):(b="tag error",f)}function h(e,t,r){return"endTag"!=e?(b="error",h):(n(r),c)}function f(e,t,r){return b="error",h(e,0,r)}function p(e,t,r){if("word"==e)return b="attribute",g;if("endTag"!=e&&"selfcloseTag"!=e)return b="error",p;var n=r.tagName,i=r.tagStart;return r.tagName=r.tagStart=null,"selfcloseTag"==e||x.autoSelfClosers.hasOwnProperty(n)?s(r,n):(s(r,n),r.context=new o(r,n,i==r.indented)),c}function g(e,t,r){return"equals"==e?m:(x.allowMissing||(b="error"),p(e,0,r))}function m(e,t,r){return"string"==e?v:"word"==e&&x.allowUnquoted?(b="string",p):(b="error",p(e,0,r))}function v(e,t,r){return"string"==e?v:p(e,0,r)}var r,y,b,w=e.indentUnit,x={},k=t.htmlMode?S:L;for(r in k)x[r]=k[r];for(r in t)x[r]=t[r];return l.isInText=!0,{startState:function(e){var t={tokenize:l,state:c,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;y=null;var r=t.tokenize(e,t);return(r||y)&&"comment"!=r&&(b=null,t.state=t.state(y||r,e,t),b&&(r="error"==b?r+" error":b)),r},indent:function(e,t,r){var n=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+w;if(n&&n.noIndent)return C.Pass;if(e.tokenize!=a&&e.tokenize!=l)return r?r.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==x.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+w*(x.multilineTagIndentFactor||1);if(x.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;n;){if(n.tagName==i[2]){n=n.prev;break}if(!x.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(i)for(;n;){var o=x.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(i[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+w:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:x.htmlMode?"html":"xml",helperType:x.htmlMode?"html":"xml",skipAttribute:function(e){e.state==m&&(e.state=p)}}}),C.defineMIME("text/xml","xml"),C.defineMIME("application/xml","xml"),C.mimeModes.hasOwnProperty("text/html")||C.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(n){function i(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function o(e){i(e);var t=e.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible",t.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),t.appendChild(r),e.display.lineSpace.insertBefore(t,e.display.lineSpace.firstChild)}function l(e){s(e)&&o(e)}function a(e){var t=e.getWrapperElement(),r=s(e);t.className=t.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),(r?o:i)(e)}function s(e){return 1===e.lineCount()&&""===e.getLine(0)}n.defineOption("placeholder","",function(e,t,r){r=r&&r!=n.Init,t&&!r?(e.on("blur",l),e.on("change",a),e.on("swapDoc",a),a(e)):!t&&r&&(e.off("blur",l),e.off("change",a),e.off("swapDoc",a),i(e),(r=e.getWrapperElement()).className=r.className.replace(" CodeMirror-empty","")),t&&!e.hasFocus()&&l(e)})});