aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/simplemde.js
blob: bdc6f547c4d06116073818c79f507d2b2f4ada43 (plain) (blame)
1
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).SimpleMDE=e()}(function(){return function r(i,o,l){function s(n,e){if(!o[n]){if(!i[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(a)return a(n,!0);t=new Error("Cannot find module '"+n+"'");throw t.code="MODULE_NOT_FOUND",t}t=o[n]={exports:{}};i[n][0].call(t.exports,function(e){var t=i[n][1][e];return s(t||e)},t,t.exports,r,i,o,l)}return o[n].exports}for(var a="function"==typeof require&&require,e=0;e<l.length;e++)s(l[e]);return s}({1:[function(e,t,n){"use strict";function c(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(u[(r=r)>>18&63]+u[r>>12&63]+u[r>>6&63]+u[63&r]);return i.join("")}n.toByteArray=function(e){var t,n,r,i,o=e.length;if(0<o%4)throw new Error("Invalid string. Length must be a multiple of 4");r="="===e[o-2]?2:"="===e[o-1]?1:0,i=new h(3*o/4-r),t=0<r?o-4:o;for(var l=0,s=0;s<t;s+=4,0)n=a[e.charCodeAt(s)]<<18|a[e.charCodeAt(s+1)]<<12|a[e.charCodeAt(s+2)]<<6|a[e.charCodeAt(s+3)],i[l++]=n>>16&255,i[l++]=n>>8&255,i[l++]=255&n;return 2==r?(n=a[e.charCodeAt(s)]<<2|a[e.charCodeAt(s+1)]>>4,i[l++]=255&n):1==r&&(n=a[e.charCodeAt(s)]<<10|a[e.charCodeAt(s+1)]<<4|a[e.charCodeAt(s+2)]>>2,i[l++]=n>>8&255,i[l++]=255&n),i},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i="",o=[],l=16383,s=0,a=n-r;s<a;s+=l)o.push(c(e,s,a<s+l?a:s+l));return 1==r?(t=e[n-1],i+=u[t>>2],i+=u[t<<4&63],i+="=="):2==r&&(t=(e[n-2]<<8)+e[n-1],i+=u[t>>10],i+=u[t>>4&63],i+=u[t<<2&63],i+="="),o.push(i),o.join("")};var u=[],a=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array;!function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)u[t]=e[t],a[e.charCodeAt(t)]=t;a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63}()},{}],2:[function(e,t,n){},{}],3:[function(O,e,I){(function(e){"use strict";function n(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=h.prototype:(null===e&&(e=new h(t)),e.length=t),e}function h(e,t,n){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(e,t,n);if("number"!=typeof e)return r(this,e,t,n);if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}function r(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r),h.TYPED_ARRAY_SUPPORT?(e=t).__proto__=h.prototype:e=s(e,t),e}(e,t,n,r):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!h.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|c(t,n);return(e=i(e,r)).write(t,n),e}(e,t,n):function(e,t){if(h.isBuffer(t)){var n=0|a(t.length);return 0===(e=i(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?i(e,0):s(e,t);if("Buffer"===t.type&&N(t.data))return s(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number')}function l(e,t){if(o(t),e=i(e,t<0?0:0|a(t)),!h.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;n++)e[n]=0;return e}function s(e,t){var n=0|a(t.length);e=i(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function a(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function c(e,t){if(h.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return S(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return C(e).length;default:if(r)return S(e).length;t=(""+t).toLowerCase(),r=!0}}function t(e,t,n){var r,i,o,l=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||r<n)&&(n=r);for(var i="",o=t;o<n;o++)i+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[o]);return i}(this,t,n);case"utf8":case"utf-8":return m(this,t,n);case"ascii":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;i++)r+=String.fromCharCode(127&e[i]);return r}(this,t,n);case"binary":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;i++)r+=String.fromCharCode(e[i]);return r}(this,t,n);case"base64":return r=this,o=n,0===(i=t)&&o===r.length?T.fromByteArray(r):T.fromByteArray(r.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,t,n);default:if(l)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),l=!0}}function u(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function d(e,t,n,r){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;l/=o=2,s/=2,n/=2}for(var a=-1,c=0;n+c<l;c++)if(i(e,n+c)===i(t,-1===a?0:c-a)){if(-1===a&&(a=c),c-a+1===s)return(n+a)*o}else-1!==a&&(c-=c-a),a=-1;return-1}function f(e,t,n,r){return L(function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function p(e,t,n,r){return L(function(e,t){for(var n,r,i=[],o=0;o<e.length&&!((t-=2)<0);o++)r=e.charCodeAt(o),n=r>>8,r=r%256,i.push(r),i.push(n);return i}(t,e.length-n),e,n,r)}function m(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,l,s,a,c=e[i],u=null,h=239<c?4:223<c?3:191<c?2:1;if(i+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(o=e[i+1]))&&(127<(a=(31&c)<<6|63&o)&&(u=a));break;case 3:o=e[i+1],l=e[i+2],128==(192&o)&&128==(192&l)&&(2047<(a=(15&c)<<12|(63&o)<<6|63&l)&&(a<55296||57343<a)&&(u=a));break;case 4:o=e[i+1],l=e[i+2],s=e[i+3],128==(192&o)&&128==(192&l)&&128==(192&s)&&(65535<(a=(15&c)<<18|(63&o)<<12|(63&l)<<6|63&s)&&a<1114112&&(u=a))}null===u?(u=65533,h=1):65535<u&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=h}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=A));return n}(r)}function g(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(n<e+t)throw new RangeError("Trying to access beyond buffer length")}function v(e,t,n,r,i,o){if(!h.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<t||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function y(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;i++)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function x(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;i++)e[n+i]=t>>>8*(r?i:3-i)&255}function b(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function w(e,t,n,r,i){return i||b(e,0,n,4),M.write(e,t,n,r,23,4),n+4}function k(e,t,n,r,i){return i||b(e,0,n,8),M.write(e,t,n,r,52,8),n+8}function S(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],l=0;l<r;l++){if(55295<(n=e.charCodeAt(l))&&n<57344){if(!i){if(56319<n){-1<(t-=3)&&o.push(239,191,189);continue}if(l+1===r){-1<(t-=3)&&o.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(t-=3)&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(t-=3)&&o.push(239,191,189);if(i=null,n<128){if(--t<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function C(e){return T.toByteArray(function(e){if((e=((t=e).trim?t.trim():t.replace(/^\s+|\s+$/g,"")).replace(E,"")).length<2)return"";for(var t;e.length%4!=0;)e+="=";return e}(e))}function L(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);i++)t[i+n]=e[i];return i}var T=O("base64-js"),M=O("ieee754"),N=O("isarray");I.Buffer=h,I.SlowBuffer=function(e){return+e!=e&&(e=0),h.alloc(+e)},I.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),I.kMaxLength=n(),h.poolSize=8192,h._augment=function(e){return e.__proto__=h.prototype,e},h.from=function(e,t,n){return r(null,e,t,n)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(e,t,n){return r=null,t=t,n=n,o(e=e),!(e<=0)&&void 0!==t?"string"==typeof n?i(r,e).fill(t,n):i(r,e).fill(t):i(r,e);var r},h.allocUnsafe=function(e){return l(null,e)},h.allocUnsafeSlow=function(e){return l(null,e)},h.isBuffer=function(e){return!(null==e||!e._isBuffer)},h.compare=function(e,t){if(!h.isBuffer(e)||!h.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},h.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(e,t){if(!N(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return h.alloc(0);if(void 0===t)for(i=t=0;i<e.length;i++)t+=e[i].length;for(var n=h.allocUnsafe(t),r=0,i=0;i<e.length;i++){var o=e[i];if(!h.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},h.byteLength=c,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)u(this,t,t+1);return this},h.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)u(this,t,t+3),u(this,t+1,t+2);return this},h.prototype.toString=function(){var e=0|this.length;return 0==e?"":0===arguments.length?m(this,0,e):t.apply(this,arguments)},h.prototype.equals=function(e){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===h.compare(this,e)},h.prototype.inspect=function(){var e="",t=I.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},h.prototype.compare=function(e,t,n,r,i){if(!h.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=t)return 0;if(i<=r)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),l=(n>>>=0)-(t>>>=0),s=Math.min(o,l),a=this.slice(r,i),c=e.slice(t,n),u=0;u<s;++u)if(a[u]!==c[u]){o=a[u],l=c[u];break}return o<l?-1:l<o?1:0},h.prototype.indexOf=function(e,t,n){if("string"==typeof t?(n=t,t=0):2147483647<t?t=2147483647:t<-2147483648&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(t<0&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:d(this,e,t,n);if("number"==typeof e)return h.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):d(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},h.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},h.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||i<n)&&(n=i),0<e.length&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o,l,s,a=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var i=e.length-n;if(r?i<(r=Number(r))&&(r=i):r=i,(i=t.length)%2!=0)throw new Error("Invalid hex string");i/2<r&&(r=i/2);for(var o=0;o<r;o++){var l=parseInt(t.substr(2*o,2),16);if(isNaN(l))return o;e[n+o]=l}return o}(this,e,t,n);case"utf8":case"utf-8":return l=t,s=n,L(S(e,(o=this).length-l),o,l,s);case"ascii":case"binary":return f(this,e,t,n);case"base64":return o=this,l=t,s=n,L(C(e),o,l,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;h.prototype.slice=function(e,t){var n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),t<e&&(t=e),h.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=h.prototype;else for(var r=t-e,i=new h(r,void 0),o=0;o<r;o++)i[o]=this[o+e];return i},h.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||g(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},h.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||g(e,t,this.length);for(var r=this[e+--t],i=1;0<t&&(i*=256);)r+=this[e+--t]*i;return r},h.prototype.readUInt8=function(e,t){return t||g(e,1,this.length),this[e]},h.prototype.readUInt16LE=function(e,t){return t||g(e,2,this.length),this[e]|this[e+1]<<8},h.prototype.readUInt16BE=function(e,t){return t||g(e,2,this.length),this[e]<<8|this[e+1]},h.prototype.readUInt32LE=function(e,t){return t||g(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},h.prototype.readUInt32BE=function(e,t){return t||g(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},h.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||g(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return(i*=128)<=r&&(r-=Math.pow(2,8*t)),r},h.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||g(e,t,this.length);for(var r=t,i=1,o=this[e+--r];0<r&&(i*=256);)o+=this[e+--r]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*t)),o},h.prototype.readInt8=function(e,t){return t||g(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){t||g(e,2,this.length);e=this[e]|this[e+1]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt16BE=function(e,t){t||g(e,2,this.length);e=this[e+1]|this[e]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt32LE=function(e,t){return t||g(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},h.prototype.readInt32BE=function(e,t){return t||g(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},h.prototype.readFloatLE=function(e,t){return t||g(e,4,this.length),M.read(this,e,!0,23,4)},h.prototype.readFloatBE=function(e,t){return t||g(e,4,this.length),M.read(this,e,!1,23,4)},h.prototype.readDoubleLE=function(e,t){return t||g(e,8,this.length),M.read(this,e,!0,52,8)},h.prototype.readDoubleBE=function(e,t){return t||g(e,8,this.length),M.read(this,e,!1,52,8)},h.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||v(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},h.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||v(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;0<=--i&&(o*=256);)this[t+i]=e/o&255;return t+n},h.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,1,255,0),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},h.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):y(this,e,t,!0),t+2},h.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):y(this,e,t,!1),t+2},h.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):x(this,e,t,!0),t+4},h.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},h.prototype.writeIntLE=function(e,t,n,r){e=+e,t|=0,r||v(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var i=0,o=1,l=0;for(this[t]=255&e;++i<n&&(o*=256);)e<0&&0===l&&0!==this[t+i-1]&&(l=1),this[t+i]=(e/o>>0)-l&255;return t+n},h.prototype.writeIntBE=function(e,t,n,r){e=+e,t|=0,r||v(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var i=n-1,o=1,l=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/o>>0)-l&255;return t+n},h.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,1,127,-128),h.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},h.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):y(this,e,t,!0),t+2},h.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):y(this,e,t,!1),t+2},h.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):x(this,e,t,!0),t+4},h.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||v(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),h.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):x(this,e,t,!1),t+4},h.prototype.writeFloatLE=function(e,t,n){return w(this,e,t,!0,n)},h.prototype.writeFloatBE=function(e,t,n){return w(this,e,t,!1,n)},h.prototype.writeDoubleLE=function(e,t,n){return k(this,e,t,!0,n)},h.prototype.writeDoubleBE=function(e,t,n){return k(this,e,t,!1,n)},h.prototype.copy=function(e,t,n,r){if(n=n||0,r||0===r||(r=this.length),t>=e.length&&(t=e.length),t=t||0,0<r&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;0<=i;i--)e[i+t]=this[i+n];else if(o<1e3||!h.TYPED_ARRAY_SUPPORT)for(i=0;i<o;i++)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},h.prototype.fill=function(e,t,n,r){if("string"==typeof e){var i;if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length&&(i=e.charCodeAt(0))<256&&(e=i),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!h.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(e=e||0))for(s=t;s<n;s++)this[s]=e;else for(var o=h.isBuffer(e)?e:S(new h(e,r).toString()),l=o.length,s=0;s<n-t;s++)this[s+t]=o[s%l];return this};var E=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":1,ieee754:15,isarray:16}],4:[function(e,t,n){"use strict";function l(o){return"function"!=typeof(o=o||{}).codeMirrorInstance||"function"!=typeof o.codeMirrorInstance.defineMode?void console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`"):(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),void o.codeMirrorInstance.defineMode("spell-checker",function(e){var t,n;l.aff_loading||(l.aff_loading=!0,(t=new XMLHttpRequest).open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),t.onload=function(){4===t.readyState&&200===t.status&&(l.aff_data=t.responseText,l.num_loaded++,2==l.num_loaded&&(l.typo=new s("en_US",l.aff_data,l.dic_data,{platform:"any"})))},t.send(null)),l.dic_loading||(l.dic_loading=!0,(n=new XMLHttpRequest).open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),n.onload=function(){4===n.readyState&&200===n.status&&(l.dic_data=n.responseText,l.num_loaded++,2==l.num_loaded&&(l.typo=new s("en_US",l.aff_data,l.dic_data,{platform:"any"})))},n.send(null));var r='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',i={token:function(e){var t=e.peek(),n="";if(r.includes(t))return e.next(),null;for(;null!=(t=e.peek())&&!r.includes(t);)n+=t,e.next();return l.typo&&!l.typo.check(n)?"spell-error":null}},e=o.codeMirrorInstance.getMode(e,e.backdrop||"text/plain");return o.codeMirrorInstance.overlayMode(e,i,!0)}))}var s=e("typo-js");l.num_loaded=0,l.aff_loading=!1,l.dic_loading=!1,l.aff_data="",l.dic_data="",l.typo,t.exports=l},{"typo-js":18}],5:[function(e,t,n){(function(r){"use strict";r.defineOption("fullScreen",!1,function(e,t,n){n==r.Init&&(n=!1),!n!=!t&&(t?(t=(n=e).getWrapperElement(),n.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",n.refresh()):function(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}(e))})})("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],6:[function(e,t,n){(function(r){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 n=e.getOption("placeholder");"string"==typeof n&&(n=document.createTextNode(n)),t.appendChild(n),e.display.lineSpace.insertBefore(t,e.display.lineSpace.firstChild)}function l(e){a(e)&&o(e)}function s(e){var t=e.getWrapperElement(),n=a(e);t.className=t.className.replace(" CodeMirror-empty","")+(n?" CodeMirror-empty":""),(n?o:i)(e)}function a(e){return 1===e.lineCount()&&""===e.getLine(0)}r.defineOption("placeholder","",function(e,t,n){n=n&&n!=r.Init;t&&!n?(e.on("blur",l),e.on("change",s),e.on("swapDoc",s),s(e)):!t&&n&&(e.off("blur",l),e.off("change",s),e.off("swapDoc",s),i(e),(n=e.getWrapperElement()).className=n.className.replace(" CodeMirror-empty","")),t&&!e.hasFocus()&&l(e)})})("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],7:[function(e,t,n){(function(c){"use strict";var u=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,h=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,d=/[*+-]\s/;c.commands.newlineAndIndentContinueMarkdownList=function(e){if(e.getOption("disableInput"))return c.Pass;for(var t=e.listSelections(),n=[],r=0;r<t.length;r++){var i=t[r].head,o=e.getStateAfter(i.line),l=!1!==o.list,s=0!==o.quote,a=e.getLine(i.line),o=u.exec(a);if(!t[r].empty()||!l&&!s||!o)return void e.execCommand("newlineAndIndent");h.test(a)?(e.replaceRange("",{line:i.line,ch:0},{line:i.line,ch:i.ch+1}),n[r]="\n"):(a=o[1],i=o[5],o=d.test(o[2])||0<=o[2].indexOf(">")?o[2]:parseInt(o[3],10)+1+o[4],n[r]="\n"+a+o+i)}e.replaceSelections(n)}})("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],8:[function(e,t,n){(function(t){"use strict";t.overlayMode=function(n,r,i){return{startState:function(){return{base:t.startState(n),overlay:t.startState(r),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(e){return{base:t.copyState(n,e.base),overlay:t.copyState(r,e.overlay),basePos:e.basePos,baseCur:null,overlayPos:e.overlayPos,overlayCur:null}},token:function(e,t){return(e!=t.streamSeen||Math.min(t.basePos,t.overlayPos)<e.start)&&(t.streamSeen=e,t.basePos=t.overlayPos=e.start),e.start==t.basePos&&(t.baseCur=n.token(e,t.base),t.basePos=e.pos),e.start==t.overlayPos&&(e.pos=e.start,t.overlayCur=r.token(e,t.overlay),t.overlayPos=e.pos),e.pos=Math.min(t.basePos,t.overlayPos),null==t.overlayCur?t.baseCur:null!=t.baseCur&&t.overlay.combineTokens||i&&null==t.overlay.combineTokens?t.baseCur+" "+t.overlayCur:t.overlayCur},indent:n.indent&&function(e,t){return n.indent(e.base,t)},electricChars:n.electricChars,innerMode:function(e){return{state:e.base,mode:n}},blankLine:function(e){n.blankLine&&n.blankLine(e.base),r.blankLine&&r.blankLine(e.overlay)}}}})("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],9:[function(e,t,n){(function(r){"use strict";function i(e){e.operation(function(){!function(e){if(!e.somethingSelected())return s(e),0;if(1<e.listSelections().length)return a(e),0;var t=e.getCursor("start"),n=e.getCursor("end"),r=e.state.markedSelection;if(!r.length)return l(e,t,n),0;var i=r[0].find(),o=r[r.length-1].find();if(!i||!o||n.line-t.line<h||0<=f(t,o.to)||f(n,i.from)<=0)return a(e),0;for(;0<f(t,i.from);)r.shift().clear(),i=r[0].find();for(f(t,i.from)<0&&(i.to.line-t.line<h?(r.shift().clear(),l(e,t,i.to,0)):l(e,t,i.from,0));f(n,o.to)<0;)r.pop().clear(),o=r[r.length-1].find();0<f(n,o.to)&&(n.line-o.from.line<h?(r.pop().clear(),l(e,o.from,n)):l(e,o.to,n))}(e)})}function o(e){e.state.markedSelection.length&&e.operation(function(){s(e)})}function l(e,t,n,r){if(0!=f(t,n))for(var i=e.state.markedSelection,o=e.state.markedSelectionStyle,l=t.line;;){var s=l==t.line?t:d(l,0),a=l+h,c=a>=n.line,u=c?n:d(a,0),u=e.markText(s,u,{className:o});if(null==r?i.push(u):i.splice(r++,0,u),c)break;l=a}}function s(e){for(var t=e.state.markedSelection,n=0;n<t.length;++n)t[n].clear();t.length=0}function a(e){s(e);for(var t=e.listSelections(),n=0;n<t.length;n++)l(e,t[n].from(),t[n].to())}r.defineOption("styleSelectedText",!1,function(e,t,n){n=n&&n!=r.Init;t&&!n?(e.state.markedSelection=[],e.state.markedSelectionStyle="string"==typeof t?t:"CodeMirror-selectedtext",a(e),e.on("cursorActivity",i),e.on("change",o)):!t&&n&&(e.off("cursorActivity",i),e.off("change",o),s(e),e.state.markedSelection=e.state.markedSelectionStyle=null)});var h=8,d=r.Pos,f=r.cmpPos})("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],10:[function(e,t,n){!function(e){"object"==typeof n&&"object"==typeof t?t.exports=e():(this||window).CodeMirror=e()}(function(){"use strict";function a(e,t){if(!(this instanceof a))return new a(e,t);this.options=t=t?Mr(t):{},Mr(Oi,t,!1),h(t);var n=t.value;"string"==typeof n&&(n=new to(n,t.mode,null,t.lineSeparator)),this.doc=n;var r=new a.inputStyles[t.inputStyle](this),r=this.display=new s(e,n,r);u(r.wrapper.CodeMirror=this),c(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!ai&&r.input.focus(),g(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 br,keySeq:null,specialChars:null};var i,o=this;for(i in ei&&ti<11&&setTimeout(function(){o.display.input.reset(!0)},20),function(i){function r(){l.activeTouch&&(n=setTimeout(function(){l.activeTouch=null},1e3),(s=l.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return 1;var n=t.left-e.left,e=t.top-e.top;return 400<n*n+e*e}var l=i.display;so(l.scroller,"mousedown",ot(i,xt)),so(l.scroller,"dblclick",ei&&ti<11?ot(i,function(e){var t;gr(i,e)||(!(t=yt(i,e))||wt(i,e)||vt(i.display,e)||(io(e),t=i.findWordAt(t),ue(i.doc,t.anchor,t.head)))}):function(e){gr(i,e)||io(e)}),di||so(l.scroller,"contextmenu",function(e){Dt(i,e)});var n,s={end:0};so(l.scroller,"touchstart",function(e){var t;gr(i,e)||function(e){if(1==e.touches.length){e=e.touches[0];return e.radiusX<=1&&e.radiusY<=1}}(e)||(clearTimeout(n),t=+new Date,l.activeTouch={start:t,moved:!1,prev:t-s.end<=300?s:null},1==e.touches.length&&(l.activeTouch.left=e.touches[0].pageX,l.activeTouch.top=e.touches[0].pageY))}),so(l.scroller,"touchmove",function(){l.activeTouch&&(l.activeTouch.moved=!0)}),so(l.scroller,"touchend",function(e){var t,n=l.activeTouch;n&&!vt(l,e)&&null!=n.left&&!n.moved&&new Date-n.start<300&&(t=i.coordsChar(l.activeTouch,"page"),t=!n.prev||o(n,n.prev)?new ne(t,t):!n.prev.prev||o(n,n.prev.prev)?i.findWordAt(t):new ne(mi(t.line,0),le(i.doc,mi(t.line+1,0))),i.setSelection(t.anchor,t.head),i.focus(),io(e)),r()}),so(l.scroller,"touchcancel",r),so(l.scroller,"scroll",function(){l.scroller.clientHeight&&(Ct(i,l.scroller.scrollTop),Lt(i,l.scroller.scrollLeft,!0),uo(i,"scroll",i))}),so(l.scroller,"mousewheel",function(e){Tt(i,e)}),so(l.scroller,"DOMMouseScroll",function(e){Tt(i,e)}),so(l.wrapper,"scroll",function(){l.wrapper.scrollTop=l.wrapper.scrollLeft=0}),l.dragFunctions={enter:function(e){gr(i,e)||lo(e)},over:function(e){var t,n,r;gr(i,e)||((r=yt(t=i,n=e))&&(n=document.createDocumentFragment(),Le(t,r,n),t.display.dragCursor||(t.display.dragCursor=Ir("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),t.display.lineSpace.insertBefore(t.display.dragCursor,t.display.cursorDiv)),Pr(t.display.dragCursor,n)),lo(e))},start:function(e){var t,n;t=i,n=e,ei&&(!t.state.draggingText||+new Date-Ci<100)?lo(n):gr(t,n)||vt(t.display,n)||(n.dataTransfer.setData("Text",t.getSelection()),n.dataTransfer.effectAllowed="copyMove",!n.dataTransfer.setDragImage||ii)||((e=Ir("img",null,null,"position: fixed; left: 0; top: 0;")).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ri&&(e.width=e.height=1,t.display.wrapper.appendChild(e),e._top=e.offsetTop),n.dataTransfer.setDragImage(e,0,0),ri&&e.parentNode.removeChild(e))},drop:ot(i,kt),leave:function(e){gr(i,e)||St(i)}};var e=l.input.getField();so(e,"keyup",function(e){Ot.call(i,e)}),so(e,"keydown",ot(i,Et)),so(e,"keypress",ot(i,It)),so(e,"focus",Nr(Rt,i)),so(e,"blur",Nr(Pt,i))}(this),Oo||(function(){var e;so(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Br(gt)},100))}),so(window,"blur",function(){Br(Pt)})}(),Oo=!0),nt(this),this.curOp.forceUpdate=!0,Gn(this,n),t.autofocus&&!ai||o.hasFocus()?setTimeout(Nr(Rt,this),20):Pt(this),Ii)Ii.hasOwnProperty(i)&&Ii[i](this,t[i],Ri);w(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Wi.length;++l)Wi[l](this);rt(this),ni&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(r.lineDiv).textRendering&&(r.lineDiv.style.textRendering="auto")}function s(e,t,n){var r=this;this.input=n,r.scrollbarFiller=Ir("div",null,"CodeMirror-scrollbar-filler"),r.scrollbarFiller.setAttribute("cm-not-content","true"),r.gutterFiller=Ir("div",null,"CodeMirror-gutter-filler"),r.gutterFiller.setAttribute("cm-not-content","true"),r.lineDiv=Ir("div",null,"CodeMirror-code"),r.selectionDiv=Ir("div",null,null,"position: relative; z-index: 1"),r.cursorDiv=Ir("div",null,"CodeMirror-cursors"),r.measure=Ir("div",null,"CodeMirror-measure"),r.lineMeasure=Ir("div",null,"CodeMirror-measure"),r.lineSpace=Ir("div",[r.measure,r.lineMeasure,r.selectionDiv,r.cursorDiv,r.lineDiv],null,"position: relative; outline: none"),r.mover=Ir("div",[Ir("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=Ir("div",[r.mover],"CodeMirror-sizer"),r.sizerWidth=null,r.heightForcer=Ir("div",null,null,"position: absolute; height: "+fo+"px; width: 1px;"),r.gutters=Ir("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=Ir("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=Ir("div",[r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),ei&&ti<8&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),ni||Zr&&ai||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(e){e.doc.mode=a.getMode(e.options,e.doc.modeOption),t(e)}function t(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Me(e,100),e.state.modeGen++,e.curOp&&ut(e)}function f(r){var i=et(r.display),o=r.options.lineWrapping,l=o&&Math.max(5,r.display.scroller.clientWidth/tt(r.display)-3);return function(e){if(Cn(r.doc,e))return 0;var t=0;if(e.widgets)for(var n=0;n<e.widgets.length;n++)e.widgets[n].height&&(t+=e.widgets[n].height);return o?t+(Math.ceil(e.text.length/l)||1)*i:t+i}}function r(e){var t=e.doc,n=f(e);t.iter(function(e){var t=n(e);t!=e.height&&Kn(e,t)})}function c(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),qe(e)}function i(e){u(e),ut(e),setTimeout(function(){x(e)},20)}function u(e){var t=e.display.gutters,n=e.options.gutters;Rr(t);for(var r=0;r<n.length;++r){var i=n[r],o=t.appendChild(Ir("div",null,"CodeMirror-gutter "+i));"CodeMirror-linenumbers"==i&&((e.display.lineGutter=o).style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",l(e)}function l(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function p(e){if(0==e.height)return 0;for(var t,n=e.text.length,r=e;t=yn(r);){r=(i=t.find(0,!0)).from.line;n+=i.from.ch-i.to.ch}for(r=e;t=xn(r);){var i=t.find(0,!0);n-=r.text.length-i.from.ch,n+=(r=i.to.line).text.length-i.to.ch}return n}function o(e){var n=e.display,e=e.doc;n.maxLine=Yn(e,e.first),n.maxLineLength=p(n.maxLine),n.maxLineChanged=!0,e.iter(function(e){var t=p(e);t>n.maxLineLength&&(n.maxLineLength=t,n.maxLine=e)})}function h(e){var t=Sr(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 d(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Oe(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Re(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function e(e,t,n){this.cm=n;var r=this.vert=Ir("div",[Ir("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Ir("div",[Ir("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),so(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),so(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,ei&&ti<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function m(){}function g(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&Ao(n.display.wrapper,n.display.scrollbars.addClass)),n.display.scrollbars=new a.scrollbarModel[n.options.scrollbarStyle](function(e){n.display.wrapper.insertBefore(e,n.display.scrollbarFiller),so(e,"mousedown",function(){n.state.focused&&setTimeout(function(){n.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,t){("horizontal"==t?Lt:Ct)(n,e)},n),n.display.scrollbars.addClass&&Eo(n.display.wrapper,n.display.scrollbars.addClass)}function v(e,t){t=t||d(e);var n=e.display.barWidth,r=e.display.barHeight;y(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&A(e),y(e,d(e)),n=e.display.barWidth,r=e.display.barHeight}function y(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function b(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop,r=Math.floor(r-Ee(e)),i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=Zn(t,r),r=Zn(t,i);return n&&n.ensure&&(i=n.ensure.from.line,n=n.ensure.to.line,i<o?r=Zn(t,Jn(Yn(t,o=i))+e.wrapper.clientHeight):Math.min(n,t.lastLine())>=r&&(o=Zn(t,Jn(Yn(t,n))-e.wrapper.clientHeight),r=n)),{from:o,to:Math.max(r,o+1)}}function x(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=S(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",l=0;l<n.length;l++)if(!n[l].hidden){e.options.fixedGutter&&n[l].gutter&&(n[l].gutter.style.left=o);var s=n[l].alignable;if(s)for(var a=0;a<s.length;a++)s[a].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function w(e){if(e.options.lineNumbers){var t=e.doc,n=k(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Ir("div",[Ir("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),t=i.firstChild.offsetWidth,i=i.offsetWidth-t;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(t,r.lineGutter.offsetWidth-i)+1,r.lineNumWidth=r.lineNumInnerWidth+i,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",l(e),1}}}function k(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function S(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function C(e,t,n){var r=e.display;this.viewport=t,this.visible=b(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Pe(e),this.force=n,this.dims=O(e),this.events=[]}function L(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return dt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==mt(e))return!1;w(e)&&(dt(e),t.dims=O(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>l&&n.viewTo-l<20&&(l=Math.min(i,n.viewTo)),pi&&(o=kn(e.doc,o),l=Sn(e.doc,l));var s=o!=n.viewFrom||l!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;r=o,i=l,0==(l=(o=e).display).view.length||r>=l.viewTo||i<=l.viewFrom?(l.view=ct(o,r,i),l.viewFrom=r):(l.viewFrom>r?l.view=ct(o,r,l.viewFrom).concat(l.view):l.viewFrom<r&&(l.view=l.view.slice(ft(o,r))),l.viewFrom=r,l.viewTo<i?l.view=l.view.concat(ct(o,l.viewTo,i)):l.viewTo>i&&(l.view=l.view.slice(0,ft(o,i)))),l.viewTo=i,n.viewOffset=Jn(Yn(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";l=mt(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;i=Dr();return 4<l&&(n.lineDiv.style.display="none"),function(n,e,t){function r(e){var t=e.nextSibling;return ni&&ci&&n.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),t}for(var i=n.display,o=n.options.lineNumbers,l=i.lineDiv,s=l.firstChild,a=i.view,c=i.viewFrom,u=0;u<a.length;u++){var h=a[u];if(!h.hidden)if(h.node&&h.node.parentNode==l){for(;s!=h.node;)s=r(s);var d=o&&null!=e&&e<=c&&h.lineNumber;h.changes&&(-1<Sr(h.changes,"gutter")&&(d=!1),I(n,h,c,t)),d&&(Rr(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(k(n.options,c)))),s=h.node.nextSibling}else{d=function(e,t,n,r){var i=P(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),D(t),H(e,t,n,r),W(e,t,r),t.node}(n,h,c,t);l.insertBefore(d,s)}c+=h.size}for(;s;)s=r(s)}(e,n.updateLineNumbers,t.dims),4<l&&(n.lineDiv.style.display=""),n.renderedView=n.view,i&&Dr()!=i&&i.offsetHeight&&i.focus(),Rr(n.cursorDiv),Rr(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Me(e,400)),!(n.updateLineNumbers=null)}function T(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Pe(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Oe(e.display)-De(e),n.top)}),t.visible=b(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&L(e,t);r=!1){A(e);var i=d(e);Se(e),v(e,i),N(e,i)}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 M(e,t){var n=new C(e,t);L(e,n)&&(A(e),T(e,n),t=d(e),Se(e),v(e,t),N(e,t),n.finish())}function N(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+Re(e)+"px"}function A(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var i,o,l=t.view[r];if(!l.hidden){ei&&ti<8?(o=(i=l.node.offsetTop+l.node.offsetHeight)-n,n=i):o=(s=l.node.getBoundingClientRect()).bottom-s.top;var s=l.line.height-o;if(o<2&&(o=et(t)),(.001<s||s<-.001)&&(Kn(l.line,o),E(l.line),l.rest))for(var a=0;a<l.rest.length;a++)E(l.rest[a])}}}function E(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function O(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)n[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[l]]=o.clientWidth;return{fixedPos:S(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function I(e,t,n,r){for(var i,o,l,s=0;s<t.changes.length;s++){var a=t.changes[s];"text"==a?(i=e,l=void 0,l=(o=t).text.className,i=P(i,o),o.text==o.node&&(o.node=i.pre),o.text.parentNode.replaceChild(i.pre,o.text),o.text=i.pre,i.bgClass!=o.bgClass||i.textClass!=o.textClass?(o.bgClass=i.bgClass,o.textClass=i.textClass,D(o)):l&&(o.text.className=l)):"gutter"==a?H(e,t,n,r):"class"==a?D(t):"widget"==a&&function(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild;r;r=i){var i=r.nextSibling;"CodeMirror-linewidget"==r.className&&t.node.removeChild(r)}W(e,t,n)}(e,t,r)}t.changes=null}function R(e){return e.node==e.text&&(e.node=Ir("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),ei&&ti<8&&(e.node.style.zIndex=2)),e.node}function P(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Hn(e,t)}function D(e){var t,n;(n=(t=e).bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass)&&(n+=" CodeMirror-linebackground"),t.background?n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null):n&&(r=R(t),t.background=r.insertBefore(Ir("div",null,n),r.firstChild)),e.line.wrapClass?R(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var r=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=r||""}function H(e,t,n,r){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass&&(o=R(t),t.gutterBackground=Ir("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),o.insertBefore(t.gutterBackground,t.text));var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=R(t),l=t.gutter=Ir("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.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(Ir("div",k(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var s=0;s<e.options.gutters.length;++s){var a=e.options.gutters[s],c=i.hasOwnProperty(a)&&i[a];c&&l.appendChild(Ir("div",[c],"CodeMirror-gutter-elt","left: "+r.gutterLeft[a]+"px; width: "+r.gutterWidth[a]+"px"))}}}function W(e,t,n){if(B(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)B(e,t.rest[r],t,n,!1)}function B(e,t,n,r,i){if(t.widgets)for(var o=R(n),l=0,s=t.widgets;l<s.length;++l){var a=s[l],c=Ir("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),h=c,d=n,f=r,(u=a).noHScroll&&((d.alignable||(d.alignable=[])).push(h),d=f.wrapperWidth,h.style.left=f.fixedPos+"px",u.coverGutter||(d-=f.gutterTotalWidth,h.style.paddingLeft=f.gutterTotalWidth+"px"),h.style.width=d+"px"),u.coverGutter&&(h.style.zIndex=5,h.style.position="relative",u.noHScroll||(h.style.marginLeft=-f.gutterTotalWidth+"px")),e.display.input.setUneditable(c),i&&a.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),pr(a,"redraw")}var u,h,d,f}function _(e){return mi(e.line,e.ch)}function F(e,t){return gi(e,t)<0?t:e}function z(e,t){return gi(e,t)<0?e:t}function j(e){e.state.focused||(e.display.input.focus(),Rt(e))}function U(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r=r||o.sel;var l=e.state.pasteIncoming||"paste"==i,s=o.splitLines(t),a=null;if(l&&1<r.ranges.length)if(vi&&vi.text.join("\n")==t){if(r.ranges.length%vi.text.length==0){a=[];for(var c=0;c<vi.text.length;c++)a.push(o.splitLines(vi.text[c]))}}else s.length==r.ranges.length&&(a=Cr(s,function(e){return[e]}));for(c=r.ranges.length-1;0<=c;c--){var u=r.ranges[c],h=u.from(),d=u.to();u.empty()&&(n&&0<n?h=mi(h.line,h.ch-n):e.state.overwrite&&!l?d=mi(d.line,Math.min(Yn(o,d.line).text.length,d.ch+kr(s).length)):vi&&vi.lineWise&&vi.text.join("\n")==t&&(h=d=mi(h.line,0)));var f=e.curOp.updateInput,d={from:h,to:d,text:a?a[c%a.length]:s,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};Ft(e.doc,d),pr(e,"inputRead",e,d)}t&&!l&&G(e,t),Vt(e),e.curOp.updateInput=f,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function q(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||it(t,function(){U(t,n,0,null,"paste")}),1)}function G(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;0<=r;r--){var i=n.ranges[r];if(!(100<i.head.ch||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(-1<t.indexOf(o.electricChars.charAt(s))){l=Xt(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Yn(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Xt(e,i.head.line,"smart"));l&&pr(e,"electricInput",e,i.head.line)}}}function Y(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,i={anchor:mi(i,0),head:mi(i+1,0)};n.push(i),t.push(e.getRange(i.anchor,i.head))}return{text:t,ranges:n}}function $(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function V(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new br,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function K(){var e=Ir("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Ir("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return ni?e.style.width="1000px":e.setAttribute("wrap","off"),si&&(e.style.border="1px solid black"),$(e),t}function X(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new br,this.gracePeriod=!1}function Z(e,t){var n=Be(e,t.line);if(!n||n.hidden)return null;var r=Yn(e.doc,t.line),e=He(n,r,t.line),n=Qn(r),r="left";n&&(r=Gr(n,t.ch)%2?"right":"left");r=ze(e.map,t.ch,r);return r.offset="right"==r.collapse?r.end:r.start,r}function J(e,t){return t&&(e.bad=!0),e}function Q(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return J(e.clipPos(mi(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return function(c,e,t){function n(e,t,n){for(var r=-1;r<(h?h.length:0);r++)for(var i=r<0?u.map:h[r],o=0;o<i.length;o+=3){var l=i[o+2];if(l==e||l==t){var s=Xn(r<0?c.line:c.rest[r]),a=i[o]+n;return(n<0||l!=e)&&(a=i[o+(n?1:0)]),mi(s,a)}}}var r=c.text.firstChild,i=!1;if(!e||!To(r,e))return J(mi(Xn(c.line),0),!0);if(e==r&&(i=!0,e=r.childNodes[t],t=0,!e)){var o=c.rest?kr(c.rest):c.line;return J(mi(Xn(o),o.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!=r;)l=l.parentNode;var u=c.measure,h=u.maps,s=n(o,l,t);if(s)return J(s,i);for(var a=l.nextSibling,d=o?o.nodeValue.length-t:0;a;a=a.nextSibling){if(s=n(a,a.firstChild,0))return J(mi(s.line,s.ch-d),i);d+=a.textContent.length}for(var f=l.previousSibling,d=t;f;f=f.previousSibling){if(s=n(f,f.firstChild,-1))return J(mi(s.line,s.ch+d),i);d+=a.textContent.length}}(o,t,n)}}function ee(l,e,t,s,a){for(var c="",u=!1,h=l.doc.lineSeparator();function e(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),c+=n,0;if(n=t.getAttribute("cm-marker"))return(n=l.findMarks(mi(s,0),mi(a+1,0),(o=+n,function(e){return e.id==o}))).length&&(i=n[0].find())&&(c+=$n(l.doc,i.from,i.to).join(h)),0;if("false"!=t.getAttribute("contenteditable")){for(var r=0;r<t.childNodes.length;r++)e(t.childNodes[r]);/^(pre|div|p)$/i.test(t.nodeName)&&(u=!0)}}else{var i;3!=t.nodeType||(i=t.nodeValue)&&(u&&(c+=h,u=!1),c+=i)}var o}(e),e!=t;)e=e.nextSibling;return c}function te(e,t){this.ranges=e,this.primIndex=t}function ne(e,t){this.anchor=e,this.head=t}function re(e,t){var n=e[t];e.sort(function(e,t){return gi(e.from(),t.from())}),t=Sr(e,n);for(var r=1;r<e.length;r++){var i,o,l=e[r],s=e[r-1];0<=gi(s.to(),l.from())&&(i=z(s.from(),l.from()),o=F(s.to(),l.to()),s=s.empty()?l.from()==l.head:s.from()==s.head,r<=t&&--t,e.splice(--r,2,new ne(s?o:i,s?i:o)))}return new te(e,t)}function ie(e,t){return new te([new ne(e,t||e)],0)}function oe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function le(e,t){if(t.line<e.first)return mi(e.first,0);var n=e.first+e.size-1;return t.line>n?mi(n,Yn(e,n).text.length):(e=Yn(e,(n=t).line).text.length,null==(t=n.ch)||e<t?mi(n.line,e):t<0?mi(n.line,0):n)}function se(e,t){return t>=e.first&&t<e.first+e.size}function ae(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=le(e,t[r]);return n}function ce(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){e=t.anchor;return r&&((t=gi(n,e)<0)!=gi(r,e)<0?(e=n,n=r):t!=gi(n,r)<0&&(n=r)),new ne(e,n)}return new ne(r||n,n)}function ue(e,t,n,r){me(e,new te([ce(e,e.sel.primary(),t,n)],0),r)}function he(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=ce(e,e.sel.ranges[i],t[i],null);me(e,re(r,e.sel.primIndex),n)}function de(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,me(e,re(i,e.sel.primIndex),r)}function fe(e,t,n,r){me(e,ie(t,n),r)}function pe(e,t,n){var r=e.history.done,i=kr(r);i&&i.ranges?ge(e,r[r.length-1]=t,n):me(e,t,n)}function me(e,t,n){var r,i,o;ge(e,t,n),i=(r=e).sel,o=e.cm?e.cm.curOp.id:NaN,t=n,e=r.history,n=t&&t.origin,o==e.lastSelOp||n&&e.lastSelOrigin==n&&(e.lastModTime==e.lastSelTime&&e.lastOrigin==n||function(e,t,n,r){t=t.charAt(0);return"*"==t||"+"==t&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(r,n,kr(e.done),i))?e.done[e.done.length-1]=i:ir(i,e.done),e.lastSelTime=+new Date,e.lastSelOrigin=n,e.lastSelOp=o,t&&!1!==t.clearRedo&&nr(e.undone)}function ge(e,t,n){var r,i;(yr(e,"beforeSelectionChange")||e.cm&&yr(e.cm,"beforeSelectionChange"))&&(r=e,i=n,i={ranges:(o=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new ne(le(r,e[t].anchor),le(r,e[t].head))},origin:i&&i.origin},uo(r,"beforeSelectionChange",r,i),r.cm&&uo(r.cm,"beforeSelectionChange",r.cm,i),t=i.ranges!=o.ranges?re(i.ranges,i.ranges.length-1):o);var o=n&&n.bias||(gi(t.primary().head,e.sel.primary().head)<0?-1:1);ve(e,xe(e,t,o,!0)),n&&!1===n.scroll||!e.cm||Vt(e.cm)}function ve(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,vr(e.cm)),pr(e,"cursorActivity",e))}function ye(e){ve(e,xe(e,e.sel,null,!1))}function xe(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],a=we(e,l.anchor,s&&s.anchor,n,r),s=we(e,l.head,s&&s.head,n,r);!i&&a==l.anchor&&s==l.head||((i=i||t.ranges.slice(0,o))[o]=new ne(a,s))}return i?re(i,t.primIndex):t}function be(e,t,n,r,i){var o=Yn(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var s=o.markedSpans[l],a=s.marker;if((null==s.from||(a.inclusiveLeft?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(a.inclusiveRight?s.to>=t.ch:s.to>t.ch))){if(i&&(uo(a,"beforeCursorEnter"),a.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(a.atomic){if(n){var c,u=a.find(r<0?1:-1);if((r<0?a.inclusiveRight:a.inclusiveLeft)&&(u=ke(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=gi(u,n))&&(r<0?c<0:0<c))return be(e,u,t,r,i)}u=a.find(r<0?-1:1);return(r<0?a.inclusiveLeft:a.inclusiveRight)&&(u=ke(e,u,r,u.line==t.line?o:null)),u?be(e,u,t,r,i):null}}}return t}function we(e,t,n,r,i){r=r||1,r=be(e,t,n,r,i)||!i&&be(e,t,n,r,!0)||be(e,t,n,-r,i)||!i&&be(e,t,n,-r,!0);return r||(e.cantEdit=!0,mi(e.first,0))}function ke(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?le(e,mi(t.line-1)):null:0<n&&t.ch==(r||Yn(e,t.line)).text.length?t.line<e.first+e.size-1?mi(t.line+1,0):null:new mi(t.line,t.ch+n)}function Se(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Ce(e,t){for(var n,r,i=e.doc,o={},l=o.cursors=document.createDocumentFragment(),s=o.selection=document.createDocumentFragment(),a=0;a<i.sel.ranges.length;a++)!1===t&&a==i.sel.primIndex||(n=i.sel.ranges[a]).from().line>=e.display.viewTo||n.to().line<e.display.viewFrom||(((r=n.empty())||e.options.showCursorWhenSelecting)&&Le(e,n.head,l),r||function(i,e,t){function f(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),l.appendChild(Ir("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?m-e:n)+"px; height: "+(r-t)+"px"))}function n(n,s,a){function c(e,t){return Ke(i,mi(n,e),"div",r,t)}var u,h,r=Yn(o,n),d=r.text.length;return function(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<n&&l.to>t||t==n&&l.to==t)&&(r(Math.max(l.from,t),Math.min(l.to,n),1==l.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}(Qn(r),s||0,null==a?d:a,function(e,t,n){var r,i,o,l=c(e,"left");e==t?r=i=(o=l).left:(o=c(t-1,"right"),"rtl"==n&&(n=l,l=o,o=n),r=l.left,i=o.right),null==s&&0==e&&(r=p),3<o.top-l.top&&(f(r,l.top,null,l.bottom),r=p,l.bottom<o.top&&f(r,l.bottom,null,o.top)),null==a&&t==d&&(i=m),(!u||l.top<u.top||l.top==u.top&&l.left<u.left)&&(u=l),(!h||o.bottom>h.bottom||o.bottom==h.bottom&&o.right>h.right)&&(h=o),r<p+1&&(r=p),f(r,o.top,i-r,o.bottom)}),{start:u,end:h}}var r=i.display,o=i.doc,l=document.createDocumentFragment(),s=Ie(i.display),p=s.left,m=Math.max(r.sizerWidth,Pe(i)-r.sizer.offsetLeft)-s.right,a=e.from(),r=e.to();a.line==r.line?n(a.line,a.ch,r.ch):(s=Yn(o,a.line),e=Yn(o,r.line),e=wn(s)==wn(e),s=n(a.line,a.ch,e?s.text.length+1:null).end,r=n(r.line,e?0:null,r.ch).start,e&&(s.top<r.top-2?(f(s.right,s.top,null,s.bottom),f(p,r.top,r.left,r.bottom)):f(s.right,s.top,r.left-s.right,s.bottom)),s.bottom<r.top&&f(p,s.bottom,null,r.top)),t.appendChild(l)}(e,n,s));return o}function Le(e,t,n){var r=Xe(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),t=n.appendChild(Ir("div"," ","CodeMirror-cursor"));t.style.left=r.left+"px",t.style.top=r.top+"px",t.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other&&((n=n.appendChild(Ir("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"))).style.display="",n.style.left=r.other.left+"px",n.style.top=r.other.top+"px",n.style.height=.85*(r.other.bottom-r.other.top)+"px")}function Te(e){var t,n;e.state.focused&&(t=e.display,clearInterval(t.blinker),n=!0,t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden"))}function Me(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Nr(Ne,e))}function Ne(s){var a,c,u,h=s.doc;h.frontier<h.first&&(h.frontier=h.first),h.frontier>=s.display.viewTo||(a=+new Date+s.options.workTime,c=_i(h.mode,Ae(s,h.frontier)),u=[],h.iter(h.frontier,Math.min(h.first+h.size,s.display.viewTo+500),function(e){if(h.frontier>=s.display.viewFrom){var t=e.styles,n=e.text.length>s.options.maxHighlightLength,r=In(s,e,n?_i(h.mode,c):c,!0);e.styles=r.styles;var i=e.styleClasses,r=r.classes;r?e.styleClasses=r:i&&(e.styleClasses=null);for(var o=!t||t.length!=e.styles.length||i!=r&&(!i||!r||i.bgClass!=r.bgClass||i.textClass!=r.textClass),l=0;!o&&l<t.length;++l)o=t[l]!=e.styles[l];o&&u.push(h.frontier),e.stateAfter=n?c:_i(h.mode,c)}else e.text.length<=s.options.maxHighlightLength&&Pn(s,e.text,c),e.stateAfter=h.frontier%5==0?_i(h.mode,c):null;return++h.frontier,+new Date>a?(Me(s,s.options.workDelay),!0):void 0}),u.length&&it(s,function(){for(var e=0;e<u.length;e++)ht(s,u[e],"text")}))}function Ae(n,r,e){var i=n.doc,o=n.display;if(!i.mode.startState)return!0;var l=function(e,t,n){for(var r,i,o=e.doc,l=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;l<s;--s){if(s<=o.first)return o.first;var a=Yn(o,s-1);if(a.stateAfter&&(!n||s<=o.frontier))return s;a=yo(a.text,null,e.options.tabSize);(null==i||a<r)&&(i=s-1,r=a)}return i}(n,r,e),s=(s=l>i.first&&Yn(i,l-1).stateAfter)?_i(i.mode,s):Fi(i.mode);return i.iter(l,r,function(e){Pn(n,e.text,s);var t=l==r-1||l%5==0||l>=o.viewFrom&&l<o.viewTo;e.stateAfter=t?_i(i.mode,s):null,++l}),e&&(i.frontier=l),s}function Ee(e){return e.lineSpace.offsetTop}function Oe(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ie(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Pr(e.measure,Ir("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 Re(e){return fo-e.display.nativeBarWidth}function Pe(e){return e.display.scroller.clientWidth-Re(e)-e.display.barWidth}function De(e){return e.display.scroller.clientHeight-Re(e)-e.display.barHeight}function He(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(r=0;r<e.rest.length;r++)if(Xn(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function We(e,t,n,r){return Fe(e,_e(e,t),n,r)}function Be(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ft(e,t)];e=e.display.externalMeasured;return e&&t>=e.lineN&&t<e.lineN+e.size?e:void 0}function _e(e,t){var n,r,i=Xn(t),o=Be(e,i);o&&!o.text?o=null:o&&o.changes&&(I(e,o,i,O(e)),e.curOp.forceUpdate=!0),o||(n=e,e=Xn(r=wn(r=t)),(r=n.display.externalMeasured=new at(n.doc,r,e)).lineN=e,e=r.built=Hn(n,r),r.text=e.pre,Pr(n.display.lineMeasure,e.pre),o=r);i=He(o,t,i);return{line:t,view:o,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Fe(e,t,n,r,i){t.before&&(n=-1);var o,l=n+(r||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,n){var r=e.options.lineWrapping,e=r&&Pe(e);if(!t.measure.heights||r&&t.measure.width!=e){var i=t.measure.heights=[];if(r){t.measure.width=e;for(var o=t.text.firstChild.getClientRects(),l=0;l<o.length-1;l++){var s=o[l],a=o[l+1];2<Math.abs(s.bottom-a.bottom)&&i.push((s.bottom+a.top)/2-n.top)}}i.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=ze(t.map,n,r),l=o.node,s=o.start,a=o.end,c=o.collapse;if(3==l.nodeType){for(var u,h=0;h<4;h++){for(;s&&Or(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+a<o.coverEnd&&Or(t.line.text.charAt(o.coverStart+a));)++a;if((i=ei&&ti<9&&0==s&&a==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():ei&&e.options.lineWrapping?(u=Lo(l,s,a).getClientRects()).length?u["right"==r?u.length-1:0]:wi:Lo(l,s,a).getBoundingClientRect()||wi).left||i.right||0==s)break;a=s,--s,c="right"}ei&&ti<11&&(i=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ho)return Ho;var t=Pr(e,Ir("span","x")),e=t.getBoundingClientRect(),t=Lo(t,0,1).getBoundingClientRect();return Ho=1<Math.abs(e.left-t.left)}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,e=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*e,bottom:t.bottom*e}}(e.display.measure,i))}else 0<s&&(c=r="right"),i=e.options.lineWrapping&&1<(u=l.getClientRects()).length?u["right"==r?u.length-1:0]:l.getBoundingClientRect();!(ei&&ti<9)||s||i&&(i.left||i.right)||(g=l.parentNode.getClientRects()[0],i=g?{left:g.left,right:g.left+tt(e.display),top:g.top,bottom:g.bottom}:wi);for(var d=i.top-t.rect.top,f=i.bottom-t.rect.top,p=(d+f)/2,m=t.view.measure.heights,h=0;h<m.length-1&&!(p<m[h]);h++);var n=h?m[h-1]:0,g=m[h],g={left:("right"==c?i.right:i.left)-t.rect.left,right:("left"==c?i.left:i.right)-t.rect.left,top:n,bottom:g};return i.left||i.right||(g.bogus=!0),e.options.singleCursorHeightPerLine||(g.rtop=d,g.rbottom=f),g}(e,t,n,r)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function ze(e,t,n){for(var r,i,o,l,s=0;s<e.length;s+=3){var a=e[s],c=e[s+1];if(t<a?(i=0,o=1,l="left"):t<c?o=(i=t-a)+1:(s==e.length-3||t==c&&e[s+3]>t)&&(i=(o=c-a)-1,c<=t&&(l="right")),null!=i){if(r=e[s+2],a==c&&n==(r.insertLeft?"left":"right")&&(l=n),"left"==n&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)r=e[2+(s-=3)],l="left";if("right"==n&&i==c-a)for(;s<e.length-3&&e[s+3]==e[s+4]&&!e[s+5].insertLeft;)r=e[(s+=3)+2],l="right";break}}return{node:r,start:i,end:o,collapse:l,coverStart:a,coverEnd:c}}function je(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 Ue(e){e.display.externalMeasure=null,Rr(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)je(e.display.view[t])}function qe(e){Ue(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ge(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ye(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function $e(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i){var o;t.widgets[i].above&&(o=Tn(t.widgets[i]),n.top+=o,n.bottom+=o)}if("line"==r)return n;r=r||"local";var l=Jn(t);return"local"==r?l+=Ee(e.display):l-=e.display.viewOffset,"page"!=r&&"window"!=r||(l+=(e=e.display.lineSpace.getBoundingClientRect()).top+("window"==r?0:Ye()),r=e.left+("window"==r?0:Ge()),n.left+=r,n.right+=r),n.top+=l,n.bottom+=l,n}function Ve(e,t,n){if("div"==n)return t;var r=t.left,t=t.top;"page"==n?(r-=Ge(),t-=Ye()):"local"!=n&&n||(r+=(n=e.display.sizer.getBoundingClientRect()).left,t+=n.top);e=e.display.lineSpace.getBoundingClientRect();return{left:r-e.left,top:t-e.top}}function Ke(e,t,n,r,i){return $e(e,r=r||Yn(e.doc,t.line),We(e,r,t.ch,i),n)}function Xe(n,e,r,i,o,l){function s(e,t){e=Fe(n,o,e,t?"right":"left",l);return t?e.left=e.right:e.right=e.left,$e(n,i,e,r)}function t(e,t){var n=a[t],r=n.level%2;return e==_r(n)&&t&&n.level<a[t-1].level?(e=Fr(n=a[--t])-(n.level%2?0:1),r=!0):e==Fr(n)&&t<a.length-1&&n.level<a[t+1].level&&(e=_r(n=a[++t])-n.level%2,r=!1),r&&e==n.to&&e>n.from?s(e-1):s(e,r)}i=i||Yn(n.doc,e.line),o=o||_e(n,i);var a=Qn(i),c=e.ch;if(!a)return s(c);e=t(c,Gr(a,c));return null!=Bo&&(e.other=t(c,Bo)),e}function Ze(e,t){var n=0,t=le(e.doc,t);e.options.lineWrapping||(n=tt(e.display)*t.ch);t=Yn(e.doc,t.line),e=Jn(t)+Ee(e.display);return{left:n,right:n,top:e,bottom:e+t.height}}function Je(e,t,n,r){t=mi(e,t);return t.xRel=r,n&&(t.outside=!0),t}function Qe(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Je(r.first,0,!0,-1);var i=Zn(r,n),o=r.first+r.size-1;if(o<i)return Je(r.first+r.size-1,Yn(r,o).text.length,!0,1);t<0&&(t=0);for(var l=Yn(r,i);;){var s=function(t,n,r,e,i){function o(e){e=Xe(t,mi(r,e),"line",n,c);return s=!0,l>e.bottom?e.left-a:l<e.top?e.left+a:(s=!1,e.left)}var l=i-Jn(n),s=!1,a=2*t.display.wrapper.clientWidth,c=_e(t,n),u=Qn(n),h=n.text.length,d=zr(n),f=jr(n),p=o(d),m=s,g=o(f),v=s;if(g<e)return Je(r,f,v,1);for(;;){if(u?f==d||f==$r(n,d,1):f-d<=1){for(var y=e<p||e-p<=g-e?d:f,x=e-(y==d?p:g);Or(n.text.charAt(y));)++y;return Je(r,y,y==d?m:v,x<-1?-1:1<x?1:0)}var b=Math.ceil(h/2),w=d+b;if(u){w=d;for(var k=0;k<b;++k)w=$r(n,w,1)}x=o(w);e<x?(f=w,g=x,(v=s)&&(g+=1e3),h=b):(d=w,p=x,m=s,h-=b)}}(e,l,i,t,n),a=xn(l),c=a&&a.find(0,!0);if(!a||!(s.ch>c.from.ch||s.ch==c.from.ch&&0<s.xRel))return s;i=Xn(l=c.to.line)}}function et(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==yi){yi=Ir("pre");for(var t=0;t<49;++t)yi.appendChild(document.createTextNode("x")),yi.appendChild(Ir("br"));yi.appendChild(document.createTextNode("x"))}Pr(e.measure,yi);var n=yi.offsetHeight/50;return 3<n&&(e.cachedTextHeight=n),Rr(e.measure),n||1}function tt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Ir("span","xxxxxxxxxx"),n=Ir("pre",[t]);Pr(e.measure,n);t=t.getBoundingClientRect(),t=(t.right-t.left)/10;return 2<t&&(e.cachedCharWidth=t),t||10}function nt(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:++Si},ki?ki.ops.push(e.curOp):e.curOp.ownsGroup=ki={ops:[e.curOp],delayedCallbacks:[]}}function rt(e){var n=e.curOp.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}(n)}finally{ki=null;for(var t=0;t<n.ops.length;t++)n.ops[t].cm.curOp=null;!function(){for(var e=n.ops,t=0;t<e.length;t++)!function(e){var t=e.cm,n=t.display;(function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Re(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Re(e)+"px",t.scrollbarsClipped=!0)})(t),e.updateMaxLine&&o(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new C(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}(e[t]);for(t=0;t<e.length;t++)!function(e){e.updatedDisplay=e.mustUpdate&&L(e.cm,e.update)}(e[t]);for(t=0;t<e.length;t++)!function(e){var t=e.cm,n=t.display;e.updatedDisplay&&A(t),e.barMeasure=d(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=We(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Re(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Pe(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}(e[t]);for(t=0;t<e.length;t++)!function(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Lt(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Dr()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),!e.updatedDisplay&&e.startHeight==t.doc.height||v(t,e.barMeasure),e.updatedDisplay&&N(t,e.barMeasure),e.selectionChanged&&Te(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&j(e.cm)}(e[t]);for(t=0;t<e.length;t++)!function(e){var t,n=e.cm,r=n.display,i=n.doc;e.updatedDisplay&&T(n,e.update),null==r.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(r.wheelStartX=r.wheelStartY=null),null==e.scrollTop||r.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(i.scrollTop=Math.max(0,Math.min(r.scroller.scrollHeight-r.scroller.clientHeight,e.scrollTop)),r.scrollbars.setScrollTop(i.scrollTop),r.scroller.scrollTop=i.scrollTop),null==e.scrollLeft||r.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(i.scrollLeft=Math.max(0,Math.min(r.scroller.scrollWidth-r.scroller.clientWidth,e.scrollLeft)),r.scrollbars.setScrollLeft(i.scrollLeft),r.scroller.scrollLeft=i.scrollLeft,x(n)),e.scrollToPos&&(t=function(e,t,n,r){null==r&&(r=0);for(var i=0;i<5;i++){var o=!1,l=Xe(e,t),s=n&&n!=t?Xe(e,n):l,a=Yt(e,Math.min(l.left,s.left),Math.min(l.top,s.top)-r,Math.max(l.left,s.left),Math.max(l.bottom,s.bottom)+r),c=e.doc.scrollTop,s=e.doc.scrollLeft;if(null!=a.scrollTop&&(Ct(e,a.scrollTop),1<Math.abs(e.doc.scrollTop-c)&&(o=!0)),null!=a.scrollLeft&&(Lt(e,a.scrollLeft),1<Math.abs(e.doc.scrollLeft-s)&&(o=!0)),!o)break}return l}(n,le(i,e.scrollToPos.from),le(i,e.scrollToPos.to),e.scrollToPos.margin),e.scrollToPos.isCursor&&n.state.focused&&function(e,t){var n,r,i;gr(e,"scrollCursorIntoView")||(n=e.display,r=n.sizer.getBoundingClientRect(),i=null,t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null==i||li||(t=Ir("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Ee(e.display))+"px; height: "+(t.bottom-t.top+Re(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;"),e.display.lineSpace.appendChild(t),t.scrollIntoView(i),e.display.lineSpace.removeChild(t)))}(n,t));var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||uo(o[s],"hide");if(l)for(s=0;s<l.length;++s)l[s].lines.length&&uo(l[s],"unhide");r.wrapper.offsetHeight&&(i.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&uo(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}(e[t])}()}}function it(e,t){if(e.curOp)return t();nt(e);try{return t()}finally{rt(e)}}function ot(e,t){return function(){if(e.curOp)return t.apply(e,arguments);nt(e);try{return t.apply(e,arguments)}finally{rt(e)}}}function lt(e){return function(){if(this.curOp)return e.apply(this,arguments);nt(this);try{return e.apply(this,arguments)}finally{rt(this)}}}function st(t){return function(){var e=this.cm;if(!e||e.curOp)return t.apply(this,arguments);nt(e);try{return t.apply(this,arguments)}finally{rt(e)}}}function at(e,t,n){this.line=t,this.rest=function(e){for(var t,n;t=xn(e);)e=t.find(1,!0).line,(n=n||[]).push(e);return n}(t),this.size=this.rest?Xn(kr(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Cn(e,t)}function ct(e,t,n){for(var r=[],i=t;i<n;i=l){var o=new at(e.doc,Yn(e.doc,i),i),l=i+o.size;r.push(o)}return r}function ut(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r=r||0;var i,o,l=e.display;r&&n<l.viewTo&&(null==l.updateLineNumbers||l.updateLineNumbers>t)&&(l.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=l.viewTo?pi&&kn(e.doc,t)<l.viewTo&&dt(e):n<=l.viewFrom?pi&&Sn(e.doc,n+r)>l.viewFrom?dt(e):(l.viewFrom+=r,l.viewTo+=r):t<=l.viewFrom&&n>=l.viewTo?dt(e):t<=l.viewFrom?(o=pt(e,n,n+r,1))?(l.view=l.view.slice(o.index),l.viewFrom=o.lineN,l.viewTo+=r):dt(e):n>=l.viewTo?(o=pt(e,t,t,-1))?(l.view=l.view.slice(0,o.index),l.viewTo=o.lineN):dt(e):(i=pt(e,t,t,-1),o=pt(e,n,n+r,1),i&&o?(l.view=l.view.slice(0,i.index).concat(ct(e,i.lineN,o.lineN)).concat(l.view.slice(o.index)),l.viewTo+=r):dt(e));e=l.externalMeasured;e&&(n<e.lineN?e.lineN+=r:t<e.lineN+e.size&&(l.externalMeasured=null))}function ht(e,t,n){e.curOp.viewChanged=!0;var r,i=e.display,o=e.display.externalMeasured;o&&t>=o.lineN&&t<o.lineN+o.size&&(i.externalMeasured=null),t<i.viewFrom||t>=i.viewTo||null==(r=i.view[ft(e,t)]).node||-1==Sr(r=r.changes||(r.changes=[]),n)&&r.push(n)}function dt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ft(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if((t-=n[r].size)<0)return r}function pt(e,t,n,r){var i,o=ft(e,t),l=e.display.view;if(!pi||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=0,a=e.display.viewFrom;s<o;s++)a+=l[s].size;if(a!=t){if(0<r){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,n+=i}for(;kn(e.doc,n)!=n;){if(o==(r<0?0:l.length-1))return null;n+=r*l[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function mt(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function gt(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 vt(e,t){for(var n=hr(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return 1}function yt(e,t,n,r){var i=e.display;if(!n&&"true"==hr(t).getAttribute("cm-not-content"))return null;var o,l,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,l=t.clientY-s.top}catch(t){return null}var a,i=Qe(e,o,l);return r&&1==i.xRel&&(a=Yn(e.doc,i.line).text).length==i.ch&&(a=yo(a,a.length,e.options.tabSize)-a.length,i=mi(i.line,Math.max(0,Math.round((o-Ie(e.display).left)/tt(e.display))-a))),i}function xt(e){var t,n=this,r=n.display;if(!(gr(n,e)||r.activeTouch&&r.input.supportsTouch()))if(r.shift=e.shiftKey,vt(r,e))ni||(r.scroller.draggable=!1,setTimeout(function(){r.scroller.draggable=!0},100));else if(!wt(n,e)){var i=yt(n,e);switch(window.focus(),dr(e)){case 1:n.state.selectingText?n.state.selectingText(e):i?function(e,t,n){ei?setTimeout(Nr(j,e),0):e.curOp.focus=Dr();var r,i=+new Date;bi&&bi.time>i-400&&0==gi(bi.pos,n)?r="triple":xi&&xi.time>i-400&&0==gi(xi.pos,n)?(r="double",bi={time:i,pos:n}):(r="single",xi={time:i,pos:n});var o,l=e.doc.sel,i=ci?t.metaKey:t.ctrlKey;e.options.dragDrop&&Io&&!e.isReadOnly()&&"single"==r&&-1<(o=l.contains(n))&&(gi((o=l.ranges[o]).from(),n)<0||0<n.xRel)&&(0<gi(o.to(),n)||n.xRel<0)?function(t,n,r,i){var o=t.display,l=+new Date,s=ot(t,function(e){ni&&(o.scroller.draggable=!1),t.state.draggingText=!1,co(document,"mouseup",s),co(o.scroller,"drop",s),Math.abs(n.clientX-e.clientX)+Math.abs(n.clientY-e.clientY)<10&&(io(e),!i&&+new Date-200<l&&ue(t.doc,r),ni||ei&&9==ti?setTimeout(function(){document.body.focus(),o.input.focus()},20):o.input.focus())});ni&&(o.scroller.draggable=!0),t.state.draggingText=s,o.scroller.dragDrop&&o.scroller.dragDrop(),so(document,"mouseup",s),so(o.scroller,"drop",s)}(e,t,n,i):function(d,e,f,p,t){function o(e){var t,n,r=++a,i=yt(d,e,!0,"rect"==p);i&&(0!=gi(i,x)?(d.curOp.focus=Dr(),function(e){if(0!=gi(x,e))if(x=e,"rect"==p){for(var t=[],n=d.options.tabSize,r=yo(Yn(m,f.line).text,f.ch,n),i=yo(Yn(m,e.line).text,e.ch,n),o=Math.min(r,i),l=Math.max(r,i),s=Math.min(f.line,e.line),a=Math.min(d.lastLine(),Math.max(f.line,e.line));s<=a;s++){var c=Yn(m,s).text,u=xo(c,o,n);o==l?t.push(new ne(mi(s,u),mi(s,u))):c.length>u&&t.push(new ne(mi(s,u),mi(s,xo(c,l,n))))}t.length||t.push(new ne(f,f)),me(m,re(y.ranges.slice(0,v).concat(t),v),{origin:"*mouse",scroll:!1}),d.scrollIntoView(e)}else{var h=g,r=h.anchor,i=e;"single"!=p&&(e="double"==p?d.findWordAt(e):new ne(mi(e.line,0),le(m,mi(e.line+1,0))),r=0<gi(e.anchor,r)?(i=e.head,z(h.from(),e.anchor)):(i=e.anchor,F(h.to(),e.head))),(t=y.ranges.slice(0))[v]=new ne(le(m,r),i),me(m,re(t,v),go)}}(i),t=b(l,m),(i.line>=t.to||i.line<t.from)&&setTimeout(ot(d,function(){a==r&&o(e)}),150)):(n=e.clientY<s.top?-20:e.clientY>s.bottom?20:0)&&setTimeout(ot(d,function(){a==r&&(l.scroller.scrollTop+=n,o(e))}),50))}function n(e){d.state.selectingText=!1,a=1/0,io(e),l.input.focus(),co(document,"mousemove",c),co(document,"mouseup",u),m.history.lastSelOrigin=null}var l=d.display,m=d.doc;io(e);var g,v,r,y=m.sel,i=y.ranges;t&&!e.shiftKey?(v=m.sel.contains(f),g=-1<v?i[v]:new ne(f,f)):(g=m.sel.primary(),v=m.sel.primIndex),(ui?e.shiftKey&&e.metaKey:e.altKey)?(p="rect",t||(g=new ne(f,f)),f=yt(d,e,!0,!0),v=-1):g="double"==p?(r=d.findWordAt(f),d.display.shift||m.extend?ce(m,g,r.anchor,r.head):r):"triple"==p?(r=new ne(mi(f.line,0),le(m,mi(f.line+1,0))),d.display.shift||m.extend?ce(m,g,r.anchor,r.head):r):ce(m,g,f),t?-1==v?(v=i.length,me(m,re(i.concat([g]),v),{scroll:!1,origin:"*mouse"})):1<i.length&&i[v].empty()&&"single"==p&&!e.shiftKey?(me(m,re(i.slice(0,v).concat(i.slice(v+1)),0),{scroll:!1,origin:"*mouse"}),y=m.sel):de(m,v,g,go):(me(m,new te([g],v=0),go),y=m.sel);var x=f,s=l.wrapper.getBoundingClientRect(),a=0,c=ot(d,function(e){(dr(e)?o:n)(e)}),u=ot(d,n);d.state.selectingText=u,so(document,"mousemove",c),so(document,"mouseup",u)}(e,t,n,r,i)}(n,e,i):hr(e)==r.scroller&&io(e);break;case 2:ni&&(n.state.lastMiddleDown=+new Date),i&&ue(n.doc,i),setTimeout(function(){r.input.focus()},20),io(e);break;case 3:di?Dt(n,e):((t=n).state.delayingBlurEvent=!0,setTimeout(function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,Pt(t))},100))}}}function bt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&io(t);var l=e.display,r=l.lineDiv.getBoundingClientRect();if(o>r.bottom||!yr(e,n))return ur(t);o-=r.top-l.viewOffset;for(var s=0;s<e.options.gutters.length;++s){var a=l.gutters.childNodes[s];if(a&&a.getBoundingClientRect().right>=i){var c=Zn(e.doc,o),a=e.options.gutters[s];return uo(e,n,e,c,a,t),ur(t)}}}function wt(e,t){return bt(e,t,"gutterClick",!0)}function kt(e){var r=this;if(St(r),!gr(r,e)&&!vt(r.display,e)){io(e),ei&&(Ci=+new Date);var t,i=yt(r,e,!0),n=e.dataTransfer.files;if(i&&!r.isReadOnly())if(n&&n.length&&window.FileReader&&window.File)for(var o=n.length,l=Array(o),s=0,a=0;a<o;++a)!function(e,t){var n;r.options.allowDropFileTypes&&-1==Sr(r.options.allowDropFileTypes,e.type)||((n=new FileReader).onload=ot(r,function(){var e=n.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),l[t]=e,++s==o&&(e={from:i=le(r.doc,i),to:i,text:r.doc.splitLines(l.join(r.doc.lineSeparator())),origin:"paste"},Ft(r.doc,e),pe(r.doc,ie(i,Ei(e))))}),n.readAsText(e))}(n[a],a);else{if(r.state.draggingText&&-1<r.doc.sel.contains(i))return r.state.draggingText(e),void setTimeout(function(){r.display.input.focus()},20);try{if(l=e.dataTransfer.getData("Text")){if(r.state.draggingText&&!(ci?e.altKey:e.ctrlKey)&&(t=r.listSelections()),ge(r.doc,ie(i,i)),t)for(a=0;a<t.length;++a)Gt(r.doc,"",t[a].anchor,t[a].head,"drag");r.replaceSelection(l,"around","paste"),r.display.input.focus()}}catch(e){}}}}function St(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ct(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Zr||M(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Zr&&M(e),Me(e,100))}function Lt(e,t,n){(n?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,x(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Tt(e,t){var n=Mi(t),r=n.x,i=n.y,o=e.display,l=o.scroller,s=l.scrollWidth>l.clientWidth,a=l.scrollHeight>l.clientHeight;if(r&&s||i&&a){if(i&&ci&&ni)e:for(var c=t.target,u=o.view;c!=l;c=c.parentNode)for(var h=0;h<u.length;h++)if(u[h].node==c){e.display.currentWheelTarget=c;break e}if(r&&!Zr&&!ri&&null!=Ti)return i&&a&&Ct(e,Math.max(0,Math.min(l.scrollTop+i*Ti,l.scrollHeight-l.clientHeight))),Lt(e,Math.max(0,Math.min(l.scrollLeft+r*Ti,l.scrollWidth-l.clientWidth))),(!i||i&&a)&&io(t),o.wheelStartX=null;i&&null!=Ti&&(n=i*Ti,a=(s=e.doc.scrollTop)+o.wrapper.clientHeight,n<0?s=Math.max(0,s+n-50):a=Math.min(e.doc.height,a+n+50),M(e,{top:s,bottom:a})),Li<20&&(null==o.wheelStartX?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){var e,t;null!=o.wheelStartX&&(t=l.scrollLeft-o.wheelStartX,t=(e=l.scrollTop-o.wheelStartY)&&o.wheelDY&&e/o.wheelDY||t&&o.wheelDX&&t/o.wheelDX,o.wheelStartX=o.wheelStartY=null,t&&(Ti=(Ti*Li+t)/(Li+1),++Li))},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function Mt(e,t,n){if("string"==typeof t&&!(t=zi[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=po}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Nt(e,t,n,r){var i=e.state.keySeq;if(i){if(qi(t))return"handled";Ni.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}r=function(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Ui(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Ui(t,e.options.extraKeys,n,e)||Ui(t,e.options.keyMap,n,e)}(e,t,r);return"multi"==r&&(e.state.keySeq=t),"handled"==r&&pr(e,"keyHandled",e,t,n),"handled"!=r&&"multi"!=r||(io(n),Te(e)),i&&!r&&/\'$/.test(t)?(io(n),!0):!!r}function At(t,e){var n=Gi(e,!0);return!!n&&(e.shiftKey&&!t.state.keySeq?Nt(t,"Shift-"+n,e,function(e){return Mt(t,e,!0)})||Nt(t,n,e,function(e){return("string"==typeof e?/^go[A-Z]/.test(e):e.motion)?Mt(t,e):void 0}):Nt(t,n,e,function(e){return Mt(t,e)}))}function Et(e){var t,n,r,i=this;function o(e){18!=e.keyCode&&e.altKey||(Ao(r,"CodeMirror-crosshair"),co(document,"keyup",o),co(document,"mouseover",o))}i.curOp.focus=Dr(),gr(i,e)||(ei&&ti<11&&27==e.keyCode&&(e.returnValue=!1),t=e.keyCode,i.display.shift=16==t||e.shiftKey,n=At(i,e),ri&&(Ai=n?t:null,!n&&88==t&&!Do&&(ci?e.metaKey:e.ctrlKey)&&i.replaceSelection("",null,"cut")),18!=t||/\bCodeMirror-crosshair\b/.test(i.display.lineDiv.className)||(r=i.display.lineDiv,Eo(r,"CodeMirror-crosshair"),so(document,"keyup",o),so(document,"mouseover",o)))}function Ot(e){16==e.keyCode&&(this.doc.sel.shift=!1),gr(this,e)}function It(e){var t,n=this;if(!(vt(n.display,e)||gr(n,e)||e.ctrlKey&&!e.altKey||ci&&e.metaKey)){var r=e.keyCode,i=e.charCode;if(ri&&r==Ai)return Ai=null,void io(e);ri&&(!e.which||e.which<10)&&At(n,e)||(i=String.fromCharCode(null==i?r:i),Nt(t=n,"'"+i+"'",e,function(e){return Mt(t,e,!0)})||n.display.input.onKeyPress(e))}}function Rt(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(uo(e,"focus",e),e.state.focused=!0,Eo(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),ni&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Te(e))}function Pt(e){e.state.delayingBlurEvent||(e.state.focused&&(uo(e,"blur",e),e.state.focused=!1,Ao(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Dt(e,t){var n,r;vt(e.display,t)||(r=t,!!yr(n=e,"gutterContextMenu")&&bt(n,r,"gutterContextMenu",!1))||gr(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function Ht(e,t){if(gi(e,t.from)<0)return e;if(gi(e,t.to)<=0)return Ei(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ei(t).ch-t.to.ch),mi(n,r)}function Wt(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new ne(Ht(i.anchor,t),Ht(i.head,t)))}return re(n,e.sel.primIndex)}function Bt(e,t,n){return e.line==t.line?mi(n.line,e.ch-t.ch+n.ch):mi(n.line+(e.line-t.line),e.ch)}function _t(i,e,t){e={canceled:!1,from:e.from,to:e.to,text:e.text,origin:e.origin,cancel:function(){this.canceled=!0}};return t&&(e.update=function(e,t,n,r){e&&(this.from=le(i,e)),t&&(this.to=le(i,t)),n&&(this.text=n),void 0!==r&&(this.origin=r)}),uo(i,"beforeChange",i,e),i.cm&&uo(i.cm,"beforeChange",i.cm,e),e.canceled?null:{from:e.from,to:e.to,text:e.text,origin:e.origin}}function Ft(e,t,n){if(e.cm){if(!e.cm.curOp)return ot(e.cm,Ft)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(yr(e,"beforeChange")||e.cm&&yr(e.cm,"beforeChange"))||(t=_t(e,t,!0))){var r=fi&&!n&&function(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=Sr(r,n)||(r=r||[]).push(n)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var l=r[o],s=l.find(0),a=0;a<i.length;++a){var c,u,h,d=i[a];gi(d.to,s.from)<0||0<gi(d.from,s.to)||(c=[a,1],u=gi(d.from,s.from),h=gi(d.to,s.to),(u<0||!l.inclusiveLeft&&!u)&&c.push({from:d.from,to:s.from}),(0<h||!l.inclusiveRight&&!h)&&c.push({from:s.to,to:d.to}),i.splice.apply(i,c),a+=c.length-1)}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;0<=i;--i)zt(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else zt(e,t)}}function zt(e,n){var t,r;1==n.text.length&&""==n.text[0]&&0==gi(n.from,n.to)||(t=Wt(e,n),rr(e,n,t,e.cm?e.cm.curOp.id:NaN),qt(e,n,t,cn(e,n)),r=[],qn(e,function(e,t){t||-1!=Sr(r,e.history)||(cr(e.history,n),r.push(e.history)),qt(e,n,null,cn(e,n))}))}function jt(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,a=0;a<l.length&&(r=l[a],n?!r.ranges||r.equals(e.sel):r.ranges);a++);if(a!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;(r=l.pop()).ranges;){if(ir(r,s),n&&!r.equals(e.sel))return me(e,r,{clearRedo:!1}),0;o=r}var c=[];ir(o,s),s.push({changes:c,generation:i.generation}),i.generation=r.generation||++i.maxGeneration;for(var u=yr(e,"beforeChange")||e.cm&&yr(e.cm,"beforeChange"),a=r.changes.length-1;0<=a;--a){var h=r.changes[a];if(h.origin=t,u&&!_t(e,h,!1))return l.length=0;c.push(tr(e,h));var d=a?Wt(e,h):kr(l);qt(e,h,d,hn(e,h)),!a&&e.cm&&e.cm.scrollIntoView({from:h.from,to:Ei(h)});var f=[];qn(e,function(e,t){t||-1!=Sr(f,e.history)||(cr(e.history,h),f.push(e.history)),qt(e,h,null,hn(e,h))})}}}}function Ut(e,t){if(0!=t&&(e.first+=t,e.sel=new te(Cr(e.sel.ranges,function(e){return new ne(mi(e.anchor.line+t,e.anchor.ch),mi(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){ut(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)ht(e.cm,r,"gutter")}}function qt(e,t,n,r){if(e.cm&&!e.cm.curOp)return ot(e.cm,qt)(e,t,n,r);var i,o,l,s,a,c,u,h,d;t.to.line<e.first?Ut(e,t.text.length-1-(t.to.line-t.from.line)):t.from.line>e.lastLine()||(t.from.line<e.first&&(Ut(e,u=t.text.length-1-(e.first-t.from.line)),t={from:mi(e.first,0),to:mi(t.to.line+u,t.to.ch),text:[kr(t.text)],origin:t.origin}),d=e.lastLine(),t.to.line>d&&(t={from:t.from,to:mi(d,Yn(e,d).text.length),text:[t.text[0]],origin:t.origin}),t.removed=$n(e,t.from,t.to),n=n||Wt(e,t),e.cm?(i=e.cm,o=t,l=r,s=i.doc,a=i.display,c=o.from,u=o.to,h=!1,d=c.line,i.options.lineWrapping||(d=Xn(wn(Yn(s,c.line))),s.iter(d,u.line+1,function(e){return e==a.maxLine?h=!0:void 0})),-1<s.sel.contains(o.from,o.to)&&vr(i),zn(s,o,l,f(i)),i.options.lineWrapping||(s.iter(d,c.line+o.text.length,function(e){var t=p(e);t>a.maxLineLength&&(a.maxLine=e,a.maxLineLength=t,a.maxLineChanged=!0,h=!1)}),h&&(i.curOp.updateMaxLine=!0)),s.frontier=Math.min(s.frontier,c.line),Me(i,400),d=o.text.length-(u.line-c.line)-1,o.full?ut(i):c.line!=u.line||1!=o.text.length||Fn(i.doc,o)?ut(i,c.line,u.line+1,d):ht(i,c.line,"text"),s=yr(i,"changes"),((d=yr(i,"change"))||s)&&(o={from:c,to:u,text:o.text,removed:o.removed,origin:o.origin},d&&pr(i,"change",i,o),s&&(i.curOp.changeObjs||(i.curOp.changeObjs=[])).push(o)),i.display.selForContextMenu=null):zn(e,t,r),ge(e,n,mo))}function Gt(e,t,n,r,i){var o;gi(r=r||n,n)<0&&(o=r,r=n,n=o),"string"==typeof t&&(t=e.splitLines(t)),Ft(e,{from:n,to:r,text:t,origin:i})}function Yt(e,t,n,r,i){var o=e.display,l=et(e.display);n<0&&(n=0);var s=(e.curOp&&null!=e.curOp.scrollTop?e.curOp:o.scroller).scrollTop,a=De(e),c={};a<i-n&&(i=n+a);var u=e.doc.height+Oe(o),h=n<l,l=u-l<i;n<s?c.scrollTop=h?0:n:s+a<i&&((d=Math.min(n,(l?u:i)-a))!=s&&(c.scrollTop=d));var d=(e.curOp&&null!=e.curOp.scrollLeft?e.curOp:o.scroller).scrollLeft,e=Pe(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),o=e<r-t;return o&&(r=t+e),t<10?c.scrollLeft=0:t<d?c.scrollLeft=Math.max(0,t-(o?0:10)):e+d-3<r&&(c.scrollLeft=r+(o?0:10)-e),c}function $t(e,t,n){null==t&&null==n||Kt(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc:e.curOp).scrollLeft+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc:e.curOp).scrollTop+n)}function Vt(e){Kt(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?mi(t.line,t.ch-1):t,r=mi(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Kt(e){var t,n,r=e.curOp.scrollToPos;r&&(e.curOp.scrollToPos=null,t=Ze(e,r.from),n=Ze(e,r.to),r=Yt(e,Math.min(t.left,n.left),Math.min(t.top,n.top)-r.margin,Math.max(t.right,n.right),Math.max(t.bottom,n.bottom)+r.margin),e.scrollTo(r.scrollLeft,r.scrollTop))}function Xt(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Ae(e,t):n="prev");var l=e.options.tabSize,s=Yn(o,t),a=yo(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==po||150<c)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?yo(Yn(o,t-1).text,null,l):0:"add"==n?c=a+e.options.indentUnit:"subtract"==n?c=a-e.options.indentUnit:"number"==typeof n&&(c=a+n),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/l);f;--f)d+=l,h+="\t";if(d<c&&(h+=wr(c-d)),h!=u)return Gt(o,h,mi(t,0),mi(t,u.length),"+input"),!(s.stateAfter=null);for(f=0;f<o.sel.ranges.length;f++){var p=o.sel.ranges[f];if(p.head.line==t&&p.head.ch<u.length){de(o,f,new ne(d=mi(t,u.length),d));break}}}function Zt(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=Yn(e,oe(e,t)):i=Xn(t),null==i?null:(r(o,i)&&e.cm&&ht(e.cm,i,n),o)}function Jt(t,e){for(var n=t.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=e(n[i]);r.length&&gi(o.from,kr(r).to)<=0;){var l=r.pop();if(gi(l.from,o.from)<0){o.from=l.from;break}}r.push(o)}it(t,function(){for(var e=r.length-1;0<=e;e--)Gt(t.doc,"",r[e].from,r[e].to,"+delete");Vt(t)})}function Qt(n,e,r,t,i){function o(e){var t=(i?$r:Vr)(c,s,r,!0);if(null==t){if(e||((e=l+r)<n.first||e>=n.first+n.size||!(c=Yn(n,l=e))))return;s=i?(r<0?jr:zr)(c):r<0?c.text.length:0}else s=t;return 1}var l=e.line,s=e.ch,a=r,c=Yn(n,l);if("char"==t)o();else if("column"==t)o(!0);else if("word"==t||"group"==t)for(var u=null,h="group"==t,d=n.cm&&n.cm.getHelper(e,"wordChars"),f=!0;!(r<0)||o(!f);f=!1){var p=c.text.charAt(s)||"\n",p=Ar(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||p||(p="s"),u&&u!=p){r<0&&(r=1,o());break}if(p&&(u=p),0<r&&!o(!f))break}a=we(n,mi(l,s),e,a,!0);return gi(e,a)||(a.hitSide=!0),a}function en(e,t,n,r){var i,o,l=e.doc,s=t.left;for("page"==r?(i=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),o=t.top+n*(i-(n<0?1.5:.5)*et(e.display))):"line"==r&&(o=0<n?t.bottom+3:t.top-3);;){var a=Qe(e,s,o);if(!a.outside)break;if(n<0?o<=0:o>=l.height){a.hitSide=!0;break}o+=5*n}return a}function tn(e,t,r,n){a.defaults[e]=t,r&&(Ii[e]=n?function(e,t,n){n!=Ri&&r(e,t,n)}:r)}function nn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],l=0;l<o.length-1;l++){var s=o[l];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function rn(e){return"string"==typeof e?ji[e]:e}function on(t,n,r,e,i){if(e&&e.shared)return function(e,n,r,i,o){(i=Mr(i)).shared=!1;var l=[on(e,n,r,i,o)],s=l[0],a=i.widgetNode;return qn(e,function(e){a&&(i.widgetNode=a.cloneNode(!0)),l.push(on(e,le(e,n),le(e,r),i,o));for(var t=0;t<e.linked.length;++t)if(e.linked[t].isParent)return;s=kr(l)}),new Ki(l,s)}(t,n,r,e,i);if(t.cm&&!t.cm.curOp)return ot(t.cm,on)(t,n,r,e,i);var o=new Vi(t,i),i=gi(n,r);if(e&&Mr(e,o,!1),0<i||0==i&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Ir("span",[o.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(bn(t,n.line,n,r,o)||n.line!=r.line&&bn(t,r.line,n,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");pi=!0}o.addToHistory&&rr(t,{from:n,to:r,origin:"markText"},t.sel,NaN);var l,s=n.line,a=t.cm;if(t.iter(s,r.line+1,function(e){var t;a&&o.collapsed&&!a.options.lineWrapping&&wn(e)==a.display.maxLine&&(l=!0),o.collapsed&&s!=n.line&&Kn(e,0),t=e,e=new sn(o,s==n.line?n.ch:null,s==r.line?r.ch:null),t.markedSpans=t.markedSpans?t.markedSpans.concat([e]):[e],e.marker.attachLine(t),++s}),o.collapsed&&t.iter(n.line,r.line+1,function(e){Cn(t,e)&&Kn(e,0)}),o.clearOnEnter&&so(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(fi=!0,(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++$i,o.atomic=!0),a){if(l&&(a.curOp.updateMaxLine=!0),o.collapsed)ut(a,n.line,r.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=n.line;c<=r.line;c++)ht(a,c,"text");o.atomic&&ye(a.doc),pr(a,"markerAdded",a,o)}return o}function ln(e){return e.findMarks(mi(e.first,0),e.clipPos(mi(e.lastLine())),function(e){return e.parent})}function sn(e,t,n){this.marker=e,this.from=t,this.to=n}function an(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function cn(e,t){if(t.full)return null;var n=se(e,t.from.line)&&Yn(e,t.from.line).markedSpans,r=se(e,t.to.line)&&Yn(e,t.to.line).markedSpans;if(!n&&!r)return null;var i,o,l=t.from.ch,s=t.to.ch,e=0==gi(t.from,t.to),a=function(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o,l=e[i],s=l.marker;!(null==l.from||(s.inclusiveLeft?l.from<=t:l.from<t))&&(l.from!=t||"bookmark"!=s.type||n&&l.marker.insertLeft)||(o=null==l.to||(s.inclusiveRight?l.to>=t:l.to>t),(r=r||[]).push(new sn(s,l.from,o?null:l.to)))}return r}(n,l,e),c=function(e,t,n){if(e)for(var r,i=0;i<e.length;++i){var o,l=e[i],s=l.marker;!(null==l.to||(s.inclusiveRight?l.to>=t:l.to>t))&&(l.from!=t||"bookmark"!=s.type||n&&!l.marker.insertLeft)||(o=null==l.from||(s.inclusiveLeft?l.from<=t:l.from<t),(r=r||[]).push(new sn(s,o?null:l.from-t,null==l.to?null:l.to-t)))}return r}(r,s,e),u=1==t.text.length,h=kr(t.text).length+(u?l:0);if(a)for(var d=0;d<a.length;++d)null==(i=a[d]).to&&((o=an(c,i.marker))?u&&(i.to=null==o.to?null:o.to+h):i.to=l);if(c)for(d=0;d<c.length;++d)null!=(i=c[d]).to&&(i.to+=h),null==i.from?(o=an(a,i.marker))||(i.from=h,u&&(a=a||[]).push(i)):(i.from+=h,u&&(a=a||[]).push(i));a=a&&un(a),c&&c!=a&&(c=un(c));var f=[a];if(!u){var p,m=t.text.length-2;if(0<m&&a)for(d=0;d<a.length;++d)null==a[d].to&&(p=p||[]).push(new sn(a[d].marker,null,null));for(d=0;d<m;++d)f.push(p);f.push(c)}return f}function un(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function hn(e,t){var n=function(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(function(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t=t||e.slice(0,n):t&&t.push(e[n]);return t?t.length?t:null:e}(n[r]));return i}(e,t),r=cn(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],l=r[i];if(o&&l)e:for(var s=0;s<l.length;++s){for(var a=l[s],c=0;c<o.length;++c)if(o[c].marker==a.marker)continue e;o.push(a)}else l&&(n[i]=l)}return n}function dn(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function fn(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function pn(e){return e.inclusiveLeft?-1:0}function mn(e){return e.inclusiveRight?1:0}function gn(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),n=gi(r.from,i.from)||pn(e)-pn(t);if(n)return-n;i=gi(r.to,i.to)||mn(e)-mn(t);return i||t.id-e.id}function vn(e,t){var n,r=pi&&e.markedSpans;if(r)for(var i,o=0;o<r.length;++o)(i=r[o]).marker.collapsed&&null==(t?i.from:i.to)&&(!n||gn(n,i.marker)<0)&&(n=i.marker);return n}function yn(e){return vn(e,!0)}function xn(e){return vn(e,!1)}function bn(e,t,n,r,i){var t=Yn(e,t),o=pi&&t.markedSpans;if(o)for(var l=0;l<o.length;++l){var s=o[l];if(s.marker.collapsed){var a=s.marker.find(0),c=gi(a.from,n)||pn(s.marker)-pn(i),u=gi(a.to,r)||mn(s.marker)-mn(i);if(!(0<=c&&u<=0||c<=0&&0<=u)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?0<=gi(a.to,n):0<gi(a.to,n))||0<=c&&(s.marker.inclusiveRight&&i.inclusiveLeft?gi(a.from,r)<=0:gi(a.from,r)<0)))return 1}}}function wn(e){for(var t;t=yn(e);)e=t.find(-1,!0).line;return e}function kn(e,t){var n=Yn(e,t),e=wn(n);return n==e?t:Xn(e)}function Sn(e,t){if(t>e.lastLine())return t;var n,r=Yn(e,t);if(!Cn(e,r))return t;for(;n=xn(r);)r=n.find(1,!0).line;return Xn(r)+1}function Cn(e,t){var n=pi&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i)if((r=n[i]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&function e(t,n,r){if(null==r.to){var i=r.marker.find(1,!0);return e(t,i.line,an(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==n.text.length)return!0;for(var o,l=0;l<n.markedSpans.length;++l)if(o=n.markedSpans[l],o.marker.collapsed&&!o.marker.widgetNode&&o.from==r.to&&(null==o.to||o.to!=r.from)&&(o.marker.inclusiveLeft||r.marker.inclusiveRight)&&e(t,n,o))return!0}(e,t,r))return!0}}function Ln(e,t,n){Jn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&$t(e,null,n)}function Tn(e){if(null!=e.height)return e.height;var t,n=e.doc.cm;return n?(To(document.body,e.node)||(t="position: relative;",e.coverGutter&&(t+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(t+="width: "+n.display.wrapper.clientWidth+"px;"),Pr(n.display.measure,Ir("div",[e.node],null,t))),e.height=e.node.parentNode.offsetHeight):0}function Mn(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Nn(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){t=a.innerMode(e,t);return t.mode.blankLine?t.mode.blankLine(t.state):void 0}}function An(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=a.innerMode(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function En(e,t,n,r){function i(e){return{start:h.start,end:h.pos,string:h.current(),type:o||null,state:e?_i(l.mode,u):u}}var o,l=e.doc,s=l.mode;t=le(l,t);var a,c=Yn(l,t.line),u=Ae(e,t.line,n),h=new Yi(c.text,e.options.tabSize);for(r&&(a=[]);(r||h.pos<t.ch)&&!h.eol();)h.start=h.pos,o=An(s,h,u),r&&a.push(i(!0));return r?a:i()}function On(e,t,n,r,i,o,l){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var a=0,c=null,u=new Yi(t,e.options.tabSize),h=e.options.addModeClass&&[null];for(""==t&&Mn(Nn(n,r),o);!u.eol();){var d,f=u.pos>e.options.maxHighlightLength?(s=!1,l&&Pn(e,t,r,u.pos),u.pos=t.length,null):Mn(An(n,u,r,h),o);if(h&&(d=h[0].name)&&(f="m-"+(f?d+" "+f:d)),!s||c!=f){for(;a<u.start;)i(a=Math.min(u.start,a+5e4),c);c=f}u.start=u.pos}for(;a<u.pos;){var p=Math.min(u.pos,a+5e4);i(p,c),a=p}}function In(e,t,n,r){var o=[e.state.modeGen],i={};On(e,t.text,e.doc.mode,n,function(e,t){o.push(e,t)},i,r);for(var l=0;l<e.state.overlays.length;++l){var s=e.state.overlays[l],a=1,c=0;On(e,t.text,s.mode,!0,function(e,t){for(var n=a;c<e;){var r=o[a];e<r&&o.splice(a,1,e,o[a+1],r),a+=2,c=Math.min(e,r)}if(t)if(s.opaque)o.splice(n,a-n,e,"cm-overlay "+t),a=n+2;else for(;n<a;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"cm-overlay "+t}},i)}return{styles:o,classes:i.bgClass||i.textClass?i:null}}function Rn(e,t,n){var r,i;return t.styles&&t.styles[0]==e.state.modeGen||(r=Ae(e,Xn(t)),i=In(e,t,t.text.length>e.options.maxHighlightLength?_i(e.doc.mode,r):r),t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++),t.styles}function Pn(e,t,n,r){var i=e.doc.mode,o=new Yi(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Nn(i,n);!o.eol();)An(i,o,n),o.start=o.pos}function Dn(e,t){if(!e||/^\s*$/.test(e))return null;t=t.addModeClass?Qi:Ji;return t[e]||(t[e]=e.replace(/\S+/g,"cm-$&"))}function Hn(e,t){var n=Ir("span",null,null,ni?"padding-right: .1px":null),r={pre:Ir("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(ei||ni)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,l=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Wn,function(e){if(null!=No)return No;var t=Pr(e,document.createTextNode("AخA")),e=Lo(t,0,1).getBoundingClientRect();if(!e||e.left==e.right)return!1;t=Lo(t,1,2).getBoundingClientRect();return No=t.right-e.right<3}(e.display.measure)&&(o=Qn(l))&&(r.addToken=function(h,d){return function(e,t,n,r,i,o,l){n=n?n+" cm-force-border":"cm-force-border";for(var s=e.pos,a=s+t.length;;){for(var c=0;c<d.length;c++){var u=d[c];if(u.to>s&&u.from<=s)break}if(u.to>=a)return h(e,t,n,r,i,o,l);h(e,t.slice(0,u.to-s),n,r,null,o,l),r=null,t=t.slice(u.to-s),s=u.to}}}(r.addToken,o)),r.map=[],function(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var l,s,a,c,u,h,d,f=i.length,p=0,m=1,g="",v=0;;){if(v==p){a=c=u=h=s="",d=null,v=1/0;for(var y,x=[],b=0;b<r.length;++b){var w=r[b],k=w.marker;"bookmark"==k.type&&w.from==p&&k.widgetNode?x.push(k):w.from<=p&&(null==w.to||w.to>p||k.collapsed&&w.to==p&&w.from==p)?(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(a+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(y=y||[]).push(k.endStyle,w.to),k.title&&!h&&(h=k.title),k.collapsed&&(!d||gn(d.marker,k)<0)&&(d=w)):w.from>p&&v>w.from&&(v=w.from)}if(y)for(b=0;b<y.length;b+=2)y[b+1]==v&&(c+=" "+y[b]);if(!d||d.from==p)for(b=0;b<x.length;++b)_n(t,0,x[b]);if(d&&(d.from||0)==p){if(_n(t,(null==d.to?f+1:d.to)-p,d.marker,null==d.from),null==d.to)return;d.to==p&&(d=!1)}}if(f<=p)break;for(var S=Math.min(f,v);;){if(g){var C,L=p+g.length;if(d||(C=S<L?g.slice(0,S-p):g,t.addToken(t,C,l?l+a:a,u,p+C.length==v?c:"",h,s)),S<=L){g=g.slice(S-p),p=S;break}p=L,u=""}g=i.slice(o,o=n[m++]),l=Dn(n[m++],t.cm.options)}}else for(m=1;m<n.length;m+=2)t.addToken(t,i.slice(o,o=n[m]),Dn(n[m+1],t.cm.options))}(l,r,Rn(e,l,t!=e.display.externalMeasured&&Xn(l))),l.styleClasses&&(l.styleClasses.bgClass&&(r.bgClass=Wr(l.styleClasses.bgClass,r.bgClass||"")),l.styleClasses.textClass&&(r.textClass=Wr(l.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(function(e){null==Mo&&(t=Ir("span","​"),Pr(e,Ir("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Mo=t.offsetWidth<=1&&2<t.offsetHeight&&!(ei&&ti<8)));var t=Mo?Ir("span","​"):Ir("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return t.setAttribute("cm-text",""),t}(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return ni&&(n=r.content.lastChild,(/\bcm-tab\b/.test(n.className)||n.querySelector&&n.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")),uo(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Wr(r.pre.className,r.textClass||"")),r}function Wn(e,t,n,r,i,o,l){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,Bn):t,a=e.cm.state.specialChars,c=!1;if(a.test(t))for(var u=document.createDocumentFragment(),h=0;;){a.lastIndex=h;var d,f=a.exec(t),p=f?f.index-h:t.length-h;if(p&&(d=document.createTextNode(s.slice(h,h+p)),ei&&ti<9?u.appendChild(Ir("span",[d])):u.appendChild(d),e.map.push(e.pos,e.pos+p,d),e.col+=p,e.pos+=p),!f)break;h+=1+p,"\t"==f[0]?(p=(p=e.cm.options.tabSize)-e.col%p,(d=u.appendChild(Ir("span",wr(p),"cm-tab"))).setAttribute("role","presentation"),d.setAttribute("cm-text","\t"),e.col+=p):("\r"==f[0]||"\n"==f[0]?(d=u.appendChild(Ir("span","\r"==f[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",f[0]):((d=e.cm.options.specialCharPlaceholder(f[0])).setAttribute("cm-text",f[0]),ei&&ti<9?u.appendChild(Ir("span",[d])):u.appendChild(d)),e.col+=1),e.map.push(e.pos,e.pos+1,d),e.pos++}else{e.col+=t.length;u=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,u),ei&&ti<9&&(c=!0),e.pos+=t.length}if(n||r||i||c||l){n=n||"";r&&(n+=r),i&&(n+=i);l=Ir("span",[u],n,l);return o&&(l.title=o),e.content.appendChild(l)}e.content.appendChild(u)}}function Bn(e){for(var t=" ",n=0;n<e.length-2;++n)t+=" ";return t+" "}function _n(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i=i||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",n.id),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t}function Fn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==kr(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function zn(e,o,t,l){function i(e){return t?t[e]:null}function n(e,t,n){var r,i;r=t,i=n,t=l,(n=e).text=r,n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null),null!=n.order&&(n.order=null),dn(n),fn(n,i),(t=t?t(n):1)!=n.height&&Kn(n,t),pr(e,"change",e,o)}function r(e,t){for(var n=e,r=[];n<t;++n)r.push(new Zi(u[n],i(n),l));return r}var s,a=o.from,c=o.to,u=o.text,h=Yn(e,a.line),d=Yn(e,c.line),f=kr(u),p=i(u.length-1),m=c.line-a.line;o.full?(e.insert(0,r(0,u.length)),e.remove(u.length,e.size-u.length)):Fn(e,o)?(s=r(0,u.length-1),n(d,d.text,p),m&&e.remove(a.line,m),s.length&&e.insert(a.line,s)):h==d?1==u.length?n(h,h.text.slice(0,a.ch)+f+h.text.slice(c.ch),p):((s=r(1,u.length-1)).push(new Zi(f+h.text.slice(c.ch),p,l)),n(h,h.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,s)):1==u.length?(n(h,h.text.slice(0,a.ch)+u[0]+d.text.slice(c.ch),i(0)),e.remove(a.line+1,m)):(n(h,h.text.slice(0,a.ch)+u[0],i(0)),n(d,f+d.text.slice(c.ch),p),s=r(1,u.length-1),1<m&&e.remove(a.line+1,m-1),e.insert(a.line+1,s)),pr(e,"change",e,o)}function jn(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Un(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function qn(e,s,a){!function e(t,n,r){if(t.linked)for(var i=0;i<t.linked.length;++i){var o,l=t.linked[i];l.doc!=n&&(o=r&&l.sharedHist,a&&!o||(s(l.doc,o),e(l.doc,t,o)))}}(e,null,!0)}function Gn(e,t){if(t.cm)throw new Error("This document is already in use.");r((e.doc=t).cm=e),n(e),e.options.lineWrapping||o(e),e.options.mode=t.modeOption,ut(e)}function Yn(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function $n(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){e=e.text;i==n.line&&(e=e.slice(0,n.ch)),i==t.line&&(e=e.slice(t.ch)),r.push(e),++i}),r}function Vn(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function Kn(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Xn(e){if(null==e.parent)return null;for(var t=e.parent,n=Sr(t.lines,e),r=t.parent;r;r=(t=r).parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function Zn(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(r=0;r<e.lines.length;++r){var l=e.lines[r].height;if(t<l)break;t-=l}return n+r}function Jn(e){for(var t=0,n=(e=wn(e)).parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;o=(n=o).parent)for(r=0;r<o.children.length;++r){var l=o.children[r];if(l==n)break;t+=l.height}return t}function Qn(e){var t=e.order;return null==t&&(t=e.order=Yo(e.text)),t}function er(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function tr(e,t){var n={from:_(t.from),to:Ei(t),text:$n(e,t.from,t.to)};return or(e,n,t.from.line,t.to.line+1),qn(e,function(e){or(e,n,t.from.line,t.to.line+1)},!0),n}function nr(e){for(;e.length;){if(!kr(e).ranges)break;e.pop()}}function rr(e,t,n,r){var i=e.history;i.undone.length=0;var o,l=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>l-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=(a=i).lastOp==r?(nr(a.done),kr(a.done)):a.done.length&&!kr(a.done).ranges?kr(a.done):1<a.done.length&&!a.done[a.done.length-2].ranges?(a.done.pop(),kr(a.done)):void 0)){var s=kr(o.changes);0==gi(t.from,t.to)&&0==gi(t.from,s.to)?s.to=Ei(t):o.changes.push(tr(e,t))}else{var a=kr(i.done);for(a&&a.ranges||ir(e.sel,i.done),o={changes:[tr(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||uo(e,"historyAdded")}function ir(e,t){var n=kr(t);n&&n.ranges&&n.equals(e)||t.push(e)}function or(t,n,e,r){var i=n["spans_"+t.id],o=0;t.iter(Math.max(t.first,e),Math.min(t.first+t.size,r),function(e){e.markedSpans&&((i=i||(n["spans_"+t.id]={}))[o]=e.markedSpans),++o})}function lr(e,t,n){for(var r=0,i=[];r<e.length;++r){var o=e[r];if(o.ranges)i.push(n?te.prototype.deepCopy.call(o):o);else{var l=o.changes,s=[];i.push({changes:s});for(var a=0;a<l.length;++a){var c,u=l[a];if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var h in u)(c=h.match(/^spans_(\d+)$/))&&-1<Sr(t,Number(c[1]))&&(kr(s)[h]=u[h],delete u[h])}}}return i}function sr(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ar(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||((o=e[i]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)sr(o.ranges[s].anchor,t,n,r),sr(o.ranges[s].head,t,n,r)}else{for(s=0;s<o.changes.length;++s){var a=o.changes[s];if(n<a.from.line)a.from=mi(a.from.line+r,a.from.ch),a.to=mi(a.to.line+r,a.to.ch);else if(t<=a.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}}function cr(e,t){var n=t.from.line,r=t.to.line,t=t.text.length-(r-n)-1;ar(e.done,n,r,t),ar(e.undone,n,r,t)}function ur(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function hr(e){return e.target||e.srcElement}function dr(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ci&&e.ctrlKey&&1==t&&(t=3),t}function fr(e,t,n){t=e._handlers&&e._handlers[t];return n?t&&0<t.length?t.slice():ao:t||ao}function pr(e,t){var n=fr(e,t,!1);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);ki?r=ki.delayedCallbacks:ho?r=ho:(r=ho=[],setTimeout(mr,0));for(var o=0;o<n.length;++o)r.push(function(e){return function(){e.apply(null,i)}}(n[o]))}}function mr(){var e=ho;ho=null;for(var t=0;t<e.length;++t)e[t]()}function gr(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),uo(e,n||t.type,e,t),ur(t)||t.codemirrorIgnore}function vr(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==Sr(n,t[r])&&n.push(t[r])}function yr(e,t){return 0<fr(e,t).length}function xr(e){e.prototype.on=function(e,t){so(this,e,t)},e.prototype.off=function(e,t){co(this,e,t)}}function br(){this.id=null}function wr(e){for(;bo.length<=e;)bo.push(kr(bo)+" ");return bo[e]}function kr(e){return e[e.length-1]}function Sr(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function Cr(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function Lr(){}function Tr(e,t){e=Object.create?Object.create(e):(Lr.prototype=e,new Lr);return t&&Mr(t,e),e}function Mr(e,t,n){for(var r in t=t||{},e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function Nr(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Ar(e,t){return t?!!(-1<t.source.indexOf("\\w")&&So(e))||t.test(e):So(e)}function Er(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return;return 1}function Or(e){return 768<=e.charCodeAt(0)&&Co.test(e)}function Ir(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Rr(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function Pr(e,t){return Rr(e).appendChild(t)}function Dr(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Hr(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Wr(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Hr(n[r]).test(t)&&(t+=" "+n[r]);return t}function Br(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function _r(e){return e.level%2?e.to:e.from}function Fr(e){return e.level%2?e.from:e.to}function zr(e){e=Qn(e);return e?_r(e[0]):0}function jr(e){var t=Qn(e);return t?Fr(kr(t)):e.text.length}function Ur(e,t){var n=Yn(e.doc,t),e=wn(n);e!=n&&(t=Xn(e));n=Qn(e),e=n?(n[0].level%2?jr:zr)(e):0;return mi(t,e)}function qr(e,t){var n=Ur(e,t.line),r=Yn(e.doc,n.line),e=Qn(r);if(e&&0!=e[0].level)return n;r=Math.max(0,r.text.search(/\S/)),t=t.line==n.line&&t.ch<=r&&t.ch;return mi(n.line,t?0:r)}function Gr(e,t){Bo=null;for(var n,r,i,o,l=0;l<e.length;++l){var s=e[l];if(s.from<t&&s.to>t)return l;if(s.from==t||s.to==t){if(null!=n)return r=e,i=s.level,o=e[n].level,r=r[0].level,i==r||o!=r&&i<o?(s.from!=s.to&&(Bo=n),l):(s.from!=s.to&&(Bo=l),n);n=l}}return n}function Yr(e,t,n,r){if(!r)return t+n;for(;t+=n,0<t&&Or(e.text.charAt(t)););return t}function $r(e,t,n,r){var i=Qn(e);if(!i)return Vr(e,t,n,r);for(var o=Gr(i,t),l=i[o],s=Yr(e,t,l.level%2?-n:n,r);;){if(s>l.from&&s<l.to)return s;if(s==l.from||s==l.to)return Gr(i,s)==o?s:0<n==(l=i[o+=n]).level%2?l.to:l.from;if(!(l=i[o+=n]))return null;s=0<n==l.level%2?Yr(e,l.to,-1,r):Yr(e,l.from,1,r)}}function Vr(e,t,n,r){var i=t+n;if(r)for(;0<i&&Or(e.text.charAt(i));)i+=n;return i<0||i>e.text.length?null:i}var Kr=navigator.userAgent,Xr=navigator.platform,Zr=/gecko\/\d/i.test(Kr),Jr=/MSIE \d/.test(Kr),Qr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kr),ei=Jr||Qr,ti=ei&&(Jr?document.documentMode||6:Qr[1]),ni=/WebKit\//.test(Kr),Jr=ni&&/Qt\/\d+\.\d+/.test(Kr),Qr=/Chrome\//.test(Kr),ri=/Opera\//.test(Kr),ii=/Apple Computer/.test(navigator.vendor),oi=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Kr),li=/PhantomJS/.test(Kr),si=/AppleWebKit/.test(Kr)&&/Mobile\/\w+/.test(Kr),ai=si||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Kr),ci=si||/Mac/.test(Xr),ui=/\bCrOS\b/.test(Kr),Xr=/win/i.test(Xr),Kr=ri&&Kr.match(/Version\/(\d*\.\d*)/);(Kr=Kr&&Number(Kr[1]))&&15<=Kr&&(ni=!(ri=!1));var hi=ci&&(Jr||ri&&(null==Kr||Kr<12.11)),di=Zr||ei&&9<=ti,fi=!1,pi=!1;e.prototype=Mr({update:function(e){var t,n=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;return r?(this.vert.style.display="block",this.vert.style.bottom=n?i+"px":"0",t=e.viewHeight-(n?i:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),n?(this.horiz.style.display="block",this.horiz.style.right=r?i+"px":"0",this.horiz.style.left=e.barLeft+"px",t=e.viewWidth-e.barLeft-(r?i:0),this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+t+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0<e.clientHeight&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?i:0,bottom:n?i:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=ci&&!oi?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new br,this.disableVert=new br},enableZeroWidthBar:function(n,r){n.style.pointerEvents="auto",r.set(1e3,function e(){var t=n.getBoundingClientRect();document.elementFromPoint(t.left+1,t.bottom-1)!=n?n.style.pointerEvents="none":r.set(1e3,e)})},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},e.prototype),m.prototype=Mr({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},m.prototype),a.scrollbarModel={native:e,null:m},C.prototype.signal=function(e,t){yr(e,t)&&this.events.push(arguments)},C.prototype.finish=function(){for(var e=0;e<this.events.length;e++)uo.apply(null,this.events[e])};var mi=a.Pos=function(e,t){return this instanceof mi?(this.line=e,void(this.ch=t)):new mi(e,t)},gi=a.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},vi=null;V.prototype=Mr({init:function(t){function e(e){if(!gr(r,e)){if(r.somethingSelected())vi={lineWise:!1,text:r.getSelections()},n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,o.value=vi.text.join("\n"),wo(o));else{if(!r.options.lineWiseCopyCut)return;var t=Y(r);vi={lineWise:!0,text:t.text},"cut"==e.type?r.setSelections(t.ranges,null,mo):(n.prevInput="",o.value=t.text.join("\n"),wo(o))}"cut"==e.type&&(r.state.cutIncoming=!0)}}var n=this,r=this.cm,i=this.wrapper=K(),o=this.textarea=i.firstChild;t.wrapper.insertBefore(i,t.wrapper.firstChild),si&&(o.style.width="0px"),so(o,"input",function(){ei&&9<=ti&&n.hasSelection&&(n.hasSelection=null),n.poll()}),so(o,"paste",function(e){gr(r,e)||q(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),so(o,"cut",e),so(o,"copy",e),so(t.scroller,"paste",function(e){vt(t,e)||gr(r,e)||(r.state.pasteIncoming=!0,n.focus())}),so(t.lineSpace,"selectstart",function(e){vt(t,e)||io(e)}),so(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),so(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e,t=this.cm,n=t.display,r=t.doc,i=Ce(t);return t.options.moveInputWithCursor&&(e=Xe(t,r.sel.primary().head,"div"),t=n.wrapper.getBoundingClientRect(),r=n.lineDiv.getBoundingClientRect(),i.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,e.top+r.top-t.top)),i.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,e.left+r.left-t.left))),i},showSelection:function(e){var t=this.cm.display;Pr(t.cursorDiv,e.cursors),Pr(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){var t,n,r,i;this.contextMenuPending||(n=(t=this.cm).doc,t.somethingSelected()?(this.prevInput="",r=n.sel.primary(),i=(r=Do&&(100<r.to().line-r.from().line||1e3<(i=t.getSelection()).length))?"-":i||t.getSelection(),this.textarea.value=i,t.state.focused&&wo(this.textarea),ei&&9<=ti&&(this.hasSelection=i)):e||(this.prevInput=this.textarea.value="",ei&&9<=ti&&(this.hasSelection=null)),this.inaccurateSelection=r)},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!ai||Dr()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,function e(){n.poll()||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))})},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||Po(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(ei&&9<=ti&&this.hasSelection===r||ci&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,l=Math.min(n.length,r.length);o<l&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var s=this;return it(e,function(){U(e,r.slice(o),n.length-o,null,s.composing?"*compose":null),1e3<r.length||-1<r.indexOf("\n")?t.value=s.prevInput="":s.prevInput=r,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){ei&&9<=ti&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function n(){var e,t;null!=u.selectionStart&&(t="​"+((e=a.somethingSelected())?u.value:""),u.value="⇚",u.value=t,s.prevInput=e?"":"​",u.selectionStart=1,u.selectionEnd=t.length,c.selForContextMenu=a.doc.sel)}function t(){var e,t;s.contextMenuPending=!1,s.wrapper.style.cssText=i,u.style.cssText=r,ei&&ti<9&&c.scrollbars.setScrollTop(c.scroller.scrollTop=d),null!=u.selectionStart&&((!ei||ei&&ti<9)&&n(),e=0,t=function(){c.selForContextMenu==a.doc.sel&&0==u.selectionStart&&0<u.selectionEnd&&"​"==s.prevInput?ot(a,zi.selectAll)(a):e++<10?c.detectingSelectAll=setTimeout(t,500):c.input.reset()},c.detectingSelectAll=setTimeout(t,200))}var r,i,o,l,s=this,a=s.cm,c=a.display,u=s.textarea,h=yt(a,e),d=c.scroller.scrollTop;h&&!ri&&(a.options.resetSelectionOnContextMenu&&-1==a.doc.sel.contains(h)&&ot(a,me)(a.doc,ie(h),mo),r=u.style.cssText,i=s.wrapper.style.cssText,s.wrapper.style.cssText="position: absolute",h=s.wrapper.getBoundingClientRect(),u.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px; z-index: 1000; background: "+(ei?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",ni&&(o=window.scrollY),c.input.focus(),ni&&window.scrollTo(null,o),c.input.reset(),a.somethingSelected()||(u.value=s.prevInput=" "),s.contextMenuPending=!0,c.selForContextMenu=a.doc.sel,clearTimeout(c.detectingSelectAll),ei&&9<=ti&&n(),di?(lo(e),l=function(){co(window,"mouseup",l),setTimeout(t,20)},so(window,"mouseup",l)):setTimeout(t,50))},readOnlyChanged:function(e){e||this.reset()},setUneditable:Lr,needsContentAttribute:!1},V.prototype),X.prototype=Mr({init:function(e){function t(e){if(!gr(i,e)){if(i.somethingSelected())vi={lineWise:!1,text:i.getSelections()},"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Y(i);vi={lineWise:!0,text:t.text},"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,mo),i.replaceSelection("",null,"cut")})}var n,r;e.clipboardData&&!si?(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",vi.text.join("\n"))):(e=(n=K()).firstChild,i.display.lineSpace.insertBefore(n,i.display.lineSpace.firstChild),e.value=vi.text.join("\n"),r=document.activeElement,wo(e),setTimeout(function(){i.display.lineSpace.removeChild(n),r.focus()},50))}}var r=this,i=r.cm,e=r.div=e.lineDiv;$(e),so(e,"paste",function(e){gr(i,e)||q(e,i)}),so(e,"compositionstart",function(e){var t,n=e.data;r.composing={sel:i.doc.sel,data:n,startData:n},n&&(t=i.doc.sel.primary(),-1<(e=i.getLine(t.head.line).indexOf(n,Math.max(0,t.head.ch-n.length)))&&e<=t.head.ch&&(r.composing.sel=ie(mi(t.head.line,e),mi(t.head.line,e+n.length))))}),so(e,"compositionupdate",function(e){r.composing.data=e.data}),so(e,"compositionend",function(e){var t=r.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||r.applyComposition(t),r.composing==t&&(r.composing=null)},50))}),so(e,"touchstart",function(){r.forceCompositionEnd()}),so(e,"input",function(){r.composing||!i.isReadOnly()&&r.pollContent()||it(r.cm,function(){ut(i)})}),so(e,"copy",t),so(e,"cut",t)},prepareSelection:function(){var e=Ce(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=Q(this.cm,e.anchorNode,e.anchorOffset),r=Q(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=gi(z(n,r),t.from())||0!=gi(F(n,r),t.to())){var i=Z(this.cm,t.from()),o=Z(this.cm,t.to());if(i||o){n=this.cm.display.view,r=e.rangeCount&&e.getRangeAt(0);i?o||(o={node:(t=(t=n[n.length-1].measure).maps?t.maps[t.maps.length-1]:t.map)[t.length-1],offset:t[t.length-2]-t[t.length-3]}):i={node:n[0].measure.map[2],offset:0};try{var l=Lo(i.node,i.offset,o.offset,o.node)}catch(e){}l&&(!Zr&&this.cm.state.focused?(e.collapse(i.node,i.offset),l.collapsed||e.addRange(l)):(e.removeAllRanges(),e.addRange(l)),r&&null==e.anchorNode?e.addRange(r):Zr&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Pr(this.cm.display.cursorDiv,e.cursors),Pr(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;e=e.getRangeAt(0).commonAncestorContainer;return To(this.div,e)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){var t=this;this.selectionInEditor()?this.pollSelection():it(this.cm,function(){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))})},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){var e,t,n,r;this.composing||this.gracePeriod||!this.selectionChanged()||(e=window.getSelection(),t=this.cm,this.rememberSelection(),n=Q(t,e.anchorNode,e.anchorOffset),r=Q(t,e.focusNode,e.focusOffset),n&&r&&it(t,function(){me(t.doc,ie(n,r),mo),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))},pollContent:function(){var e,t=this.cm,n=t.display,r=t.doc.sel.primary(),i=r.from(),r=r.to();if(i.line<n.viewFrom||r.line>n.viewTo-1)return!1;g=i.line==n.viewFrom||0==(g=ft(t,i.line))?(e=Xn(n.view[0].line),n.view[0].node):(e=Xn(n.view[g].line),n.view[g-1].node.nextSibling);var o,r=ft(t,r.line);r=r==n.view.length-1?(o=n.viewTo-1,n.lineDiv.lastChild):(o=Xn(n.view[r+1].line)-1,n.view[r+1].node.previousSibling);for(var l=t.doc.splitLines(ee(t,g,r,e,o)),s=$n(t.doc,mi(e,0),mi(o,Yn(t.doc,o).text.length));1<l.length&&1<s.length;)if(kr(l)==kr(s))l.pop(),s.pop(),o--;else{if(l[0]!=s[0])break;l.shift(),s.shift(),e++}for(var a=0,c=0,u=l[0],h=s[0],d=Math.min(u.length,h.length);a<d&&u.charCodeAt(a)==h.charCodeAt(a);)++a;for(var f=kr(l),p=kr(s),m=Math.min(f.length-(1==l.length?a:0),p.length-(1==s.length?a:0));c<m&&f.charCodeAt(f.length-c-1)==p.charCodeAt(p.length-c-1);)++c;l[l.length-1]=f.slice(0,f.length-c),l[0]=l[0].slice(a);var g=mi(e,a),r=mi(o,s.length?kr(s).length-c:0);return 1<l.length||l[0]||gi(g,r)?(Gt(t.doc,l,g,r,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?ot(this.cm,ut)(this.cm):e.data&&e.data!=e.startData&&ot(this.cm,U)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||ot(this.cm,U)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Lr,resetPosition:Lr,needsContentAttribute:!0},X.prototype),a.inputStyles={textarea:V,contenteditable:X},te.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(0!=gi(n.anchor,r.anchor)||0!=gi(n.head,r.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ne(_(this.ranges[t].anchor),_(this.ranges[t].head));return new te(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t=t||e;for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(0<=gi(t,r.from())&&gi(e,r.to())<=0)return n}return-1}},ne.prototype={from:function(){return z(this.anchor,this.head)},to:function(){return F(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var yi,xi,bi,wi={left:0,right:0,top:0,bottom:0},ki=null,Si=0,Ci=0,Li=0,Ti=null;ei?Ti=-.53:Zr?Ti=15:Qr?Ti=-.7:ii&&(Ti=-1/3);var Mi=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};a.wheelEventPixels=function(e){e=Mi(e);return e.x*=Ti,e.y*=Ti,e};var Ni=new br,Ai=null,Ei=a.changeEnd=function(e){return e.text?mi(e.from.line+e.text.length-1,kr(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};a.prototype={constructor:a,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,Ii.hasOwnProperty(e)&&ot(this,Ii[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](rn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:lt(function(e,t){var n=e.token?e:a.getMode(this.options,e);if(n.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:n,modeSpec:e,opaque:t&&t.opaque}),this.state.modeGen++,ut(this)}),removeOverlay:lt(function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void ut(this)}}),indentLine:lt(function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),se(this.doc,e)&&Xt(this,e,t,n)}),indentSelection:lt(function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(Xt(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Vt(this));else{for(var o=i.from(),l=i.to(),i=Math.max(n,o.line),n=Math.min(this.lastLine(),l.line-(l.ch?0:1))+1,s=i;s<n;++s)Xt(this,s,e);i=this.doc.sel.ranges;0==o.ch&&t.length==i.length&&0<i[r].from().ch&&de(this.doc,r,new ne(o,i[r].to()),mo)}}}),getTokenAt:function(e,t){return En(this,e,t)},getLineTokens:function(e,t){return En(this,mi(e),t,!0)},getTokenTypeAt:function(e){e=le(this.doc,e);var t,n=Rn(this,Yn(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var l=r+i>>1;if((l?n[2*l-1]:0)>=o)i=l;else{if(!(n[2*l+1]<o)){t=n[2*l+2];break}r=1+l}}e=t?t.indexOf("cm-overlay "):-1;return e<0?t:0==e?null:t.slice(0,e-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?a.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!Bi.hasOwnProperty(t))return n;var r=Bi[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;o<i[t].length;o++){var l=r[i[t][o]];l&&n.push(l)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(o=0;o<r._global.length;o++){var s=r._global[o];s.pred(i,this)&&-1==Sr(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(e,t){var n=this.doc;return Ae(this,(e=oe(n,null==e?n.first+n.size-1:e))+1,t)},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Xe(this,null==e?n.head:"object"==typeof e?le(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Ke(this,le(this.doc,e),t||"page")},coordsChar:function(e,t){return Qe(this,(e=Ve(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Ve(this,{top:e,left:0},t||"page").top,Zn(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n,r=!1,e="number"==typeof e?(n=this.doc.first+this.doc.size-1,e<this.doc.first?e=this.doc.first:n<e&&(e=n,r=!0),Yn(this.doc,e)):e;return $e(this,e,{top:0,left:0},t||"page").top+(r?this.doc.height-Jn(e):0)},defaultTextHeight:function(){return et(this.display)},defaultCharWidth:function(){return tt(this.display)},setGutterMarker:lt(function(e,n,r){return Zt(this.doc,e,"gutter",function(e){var t=e.gutterMarkers||(e.gutterMarkers={});return!(t[n]=r)&&Er(t)&&(e.gutterMarkers=null),1})}),clearGutter:lt(function(t){var n=this,e=n.doc,r=e.first;e.iter(function(e){e.gutterMarkers&&e.gutterMarkers[t]&&(e.gutterMarkers[t]=null,ht(n,r,"gutter"),Er(e.gutterMarkers)&&(e.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!se(this.doc,e))return null;var t=e;if(!(e=Yn(this.doc,e)))return null}else if(null==(t=Xn(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}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,l,s=this.display,a=(e=Xe(this,le(this.doc,e))).bottom,c=e.left;t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r?a=e.top:"above"!=r&&"near"!=r||(o=Math.max(s.wrapper.clientHeight,this.doc.height),l=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth),("above"==r||e.bottom+t.offsetHeight>o)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=o&&(a=e.bottom),c+t.offsetWidth>l&&(c=l-t.offsetWidth)),t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(c=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?c=0:"middle"==i&&(c=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=c+"px"),n&&(i=this,s=a,c=(n=c)+t.offsetWidth,t=a+t.offsetHeight,null!=(t=Yt(i,n,s,c,t)).scrollTop&&Ct(i,t.scrollTop),null!=t.scrollLeft&&Lt(i,t.scrollLeft))},triggerOnKeyDown:lt(Et),triggerOnKeyPress:lt(It),triggerOnKeyUp:Ot,execCommand:function(e){return zi.hasOwnProperty(e)?zi[e].call(null,this):void 0},triggerElectric:lt(function(e){G(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=0,l=le(this.doc,e);o<t&&!(l=Qt(this.doc,l,i,n,r)).hitSide;++o);return l},moveH:lt(function(t,n){var r=this;r.extendSelectionsBy(function(e){return r.display.shift||r.doc.extend||e.empty()?Qt(r.doc,e.head,t,n,r.options.rtlMoveVisually):t<0?e.from():e.to()},vo)}),deleteH:lt(function(n,r){var e=this.doc.sel,i=this.doc;e.somethingSelected()?i.replaceSelection("",null,"+delete"):Jt(this,function(e){var t=Qt(i,e.head,n,r,!1);return n<0?{from:t,to:e.head}:{from:e.head,to:t}})}),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var l=0,s=le(this.doc,e);l<t;++l){var a=Xe(this,s,"div");if(null==o?o=a.left:a.left=o,(s=en(this,a,i,n)).hitSide)break}return s},moveV:lt(function(r,i){var o=this,l=this.doc,s=[],a=!o.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(e){if(a)return r<0?e.from():e.to();var t=Xe(o,e.head,"div");null!=e.goalColumn&&(t.left=e.goalColumn),s.push(t.left);var n=en(o,t,r,i);return"page"==i&&e==l.sel.primary()&&$t(o,null,Ke(o,n,"div").top-t.top),n},vo),s.length)for(var e=0;e<l.sel.ranges.length;e++)l.sel.ranges[e].goalColumn=s[e]}),findWordAt:function(e){var t=Yn(this.doc,e.line).text,n=e.ch,r=e.ch;if(t){var i=this.getHelper(e,"wordChars");(e.xRel<0||r==t.length)&&n?--n:++r;for(var o=t.charAt(n),l=Ar(o,i)?function(e){return Ar(e,i)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Ar(e)};0<n&&l(t.charAt(n-1));)--n;for(;r<t.length&&l(t.charAt(r));)++r}return new ne(mi(e.line,n),mi(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||(((this.state.overwrite=!this.state.overwrite)?Eo:Ao)(this.display.cursorDiv,"CodeMirror-overwrite"),uo(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Dr()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:lt(function(e,t){null==e&&null==t||Kt(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-Re(this)-this.display.barHeight,width:e.scrollWidth-Re(this)-this.display.barWidth,clientHeight:De(this),clientWidth:Pe(this)}},scrollIntoView:lt(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:mi(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?(Kt(this),this.curOp.scrollToPos=e):(e=Yt(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin),this.scrollTo(e.scrollLeft,e.scrollTop))}),setSize:lt(function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var r=this;null!=e&&(r.display.wrapper.style.width=n(e)),null!=t&&(r.display.wrapper.style.height=n(t)),r.options.lineWrapping&&Ue(this);var i=r.display.viewFrom;r.doc.iter(i,r.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){ht(r,i,"widget");break}++i}),r.curOp.forceUpdate=!0,uo(r,"refresh",this)}),operation:function(e){return it(this,e)},refresh:lt(function(){var e=this.display.cachedTextHeight;ut(this),this.curOp.forceUpdate=!0,qe(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),l(this),(null==e||.5<Math.abs(e-et(this.display)))&&r(this),uo(this,"refresh",this)}),swapDoc:lt(function(e){var t=this.doc;return t.cm=null,Gn(this,e),qe(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,pr(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}},xr(a);var Oi=a.defaults={},Ii=a.optionHandlers={},Ri=a.Init={toString:function(){return"CodeMirror.Init"}};tn("value","",function(e,t){e.setValue(t)},!0),tn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),tn("indentUnit",2,n,!0),tn("indentWithTabs",!1),tn("smartIndent",!0),tn("tabSize",4,function(e){t(e),qe(e),ut(e)},!0),tn("lineSeparator",null,function(e,r){if(e.doc.lineSep=r){var i=[],o=e.doc.first;e.doc.iter(function(e){for(var t=0;;){var n=e.text.indexOf(r,t);if(-1==n)break;t=n+r.length,i.push(mi(o,n))}o++});for(var t=i.length-1;0<=t;t--)Gt(e.doc,r,i[t],mi(i[t].line,i[t].ch+r.length))}}),tn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=a.Init&&e.refresh()}),tn("specialCharPlaceholder",function(e){var t=Ir("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t},function(e){e.refresh()},!0),tn("electricChars",!0),tn("inputStyle",ai?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),tn("rtlMoveVisually",!Xr),tn("wholeLineUpdateBefore",!0),tn("theme","default",function(e){c(e),i(e)},!0),tn("keyMap","default",function(e,t,n){t=rn(t),n=n!=a.Init&&rn(n);n&&n.detach&&n.detach(e,t),t.attach&&t.attach(e,n||null)}),tn("extraKeys",null),tn("lineWrapping",!1,function(e){e.options.lineWrapping?(Eo(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ao(e.display.wrapper,"CodeMirror-wrap"),o(e)),r(e),ut(e),qe(e),setTimeout(function(){v(e)},100)},!0),tn("gutters",[],function(e){h(e.options),i(e)},!0),tn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?S(e.display)+"px":"0",e.refresh()},!0),tn("coverGutterNextToScrollbar",!1,function(e){v(e)},!0),tn("scrollbarStyle","native",function(e){g(e),v(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),tn("lineNumbers",!1,function(e){h(e.options),i(e)},!0),tn("firstLineNumber",1,i,!0),tn("lineNumberFormatter",function(e){return e},i,!0),tn("showCursorWhenSelecting",!1,Se,!0),tn("resetSelectionOnContextMenu",!0),tn("lineWiseCopyCut",!0),tn("readOnly",!1,function(e,t){"nocursor"==t?(Pt(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),tn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),tn("dragDrop",!0,function(e,t,n){!t!=!(n&&n!=a.Init)&&(n=e.display.dragFunctions,(t=t?so:co)(e.display.scroller,"dragstart",n.start),t(e.display.scroller,"dragenter",n.enter),t(e.display.scroller,"dragover",n.over),t(e.display.scroller,"dragleave",n.leave),t(e.display.scroller,"drop",n.drop))}),tn("allowDropFileTypes",null),tn("cursorBlinkRate",530),tn("cursorScrollMargin",0),tn("cursorHeight",1,Se,!0),tn("singleCursorHeightPerLine",!0,Se,!0),tn("workTime",100),tn("workDelay",100),tn("flattenSpans",!0,t,!0),tn("addModeClass",!1,t,!0),tn("pollInterval",100),tn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),tn("historyEventDelay",1250),tn("viewportMargin",10,function(e){e.refresh()},!0),tn("maxHighlightLength",1e4,t,!0),tn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),tn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),tn("autofocus",null);var Pi=a.modes={},Di=a.mimeModes={};a.defineMode=function(e,t){a.defaults.mode||"null"==e||(a.defaults.mode=e),2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pi[e]=t},a.defineMIME=function(e,t){Di[e]=t},a.resolveMode=function(e){if("string"==typeof e&&Di.hasOwnProperty(e))e=Di[e];else if(e&&"string"==typeof e.name&&Di.hasOwnProperty(e.name)){var t=Di[e.name];"string"==typeof t&&(t={name:t}),(e=Tr(t,e)).name=t.name}else if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return a.resolveMode("application/xml");return"string"==typeof e?{name:e}:e||{name:"null"}},a.getMode=function(e,t){var t=a.resolveMode(t),n=Pi[t.name];if(!n)return a.getMode(e,"text/plain");var r=n(e,t);if(Hi.hasOwnProperty(t.name)){var i=Hi[t.name];for(o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r},a.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),a.defineMIME("text/plain","null");var Hi=a.modeExtensions={};a.extendMode=function(e,t){Mr(t,Hi.hasOwnProperty(e)?Hi[e]:Hi[e]={})},a.defineExtension=function(e,t){a.prototype[e]=t},a.defineDocExtension=function(e,t){to.prototype[e]=t},a.defineOption=tn;var Wi=[];a.defineInitHook=function(e){Wi.push(e)};var Bi=a.helpers={};a.registerHelper=function(e,t,n){Bi.hasOwnProperty(e)||(Bi[e]=a[e]={_global:[]}),Bi[e][t]=n},a.registerGlobalHelper=function(e,t,n,r){a.registerHelper(e,t,r),Bi[e]._global.push({pred:n,val:r})};var _i=a.copyState=function(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n,r={};for(n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r},Fi=a.startState=function(e,t,n){return!e.startState||e.startState(t,n)};a.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var zi=a.commands={selectAll:function(e){e.setSelection(mi(e.firstLine(),0),mi(e.lastLine()),mo)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),mo)},killLine:function(n){Jt(n,function(e){if(e.empty()){var t=Yn(n.doc,e.head.line).text.length;return e.head.ch==t&&e.head.line<n.lastLine()?{from:e.head,to:mi(e.head.line+1,0)}:{from:e.head,to:mi(e.head.line,t)}}return{from:e.from(),to:e.to()}})},deleteLine:function(t){Jt(t,function(e){return{from:mi(e.from().line,0),to:le(t.doc,mi(e.to().line+1,0))}})},delLineLeft:function(e){Jt(e,function(e){return{from:mi(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(n){Jt(n,function(e){var t=n.charCoords(e.head,"div").top+5;return{from:n.coordsChar({left:0,top:t},"div"),to:e.from()}})},delWrappedLineRight:function(n){Jt(n,function(e){var t=n.charCoords(e.head,"div").top+5,t=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div");return{from:e.from(),to:t}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(mi(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(mi(e.lastLine()))},goLineStart:function(t){t.extendSelectionsBy(function(e){return Ur(t,e.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(t){t.extendSelectionsBy(function(e){return qr(t,e.head)},{origin:"+move",bias:1})},goLineEnd:function(t){t.extendSelectionsBy(function(e){return function(e,t){for(var n,r=Yn(e.doc,t);n=xn(r);)r=n.find(1,!0).line,t=null;return e=(e=Qn(r))?(e[0].level%2?zr:jr)(r):r.text.length,mi(null==t?Xn(r):t,e)}(t,e.head.line)},{origin:"+move",bias:-1})},goLineRight:function(t){t.extendSelectionsBy(function(e){e=t.charCoords(e.head,"div").top+5;return t.coordsChar({left:t.display.lineDiv.offsetWidth+100,top:e},"div")},vo)},goLineLeft:function(t){t.extendSelectionsBy(function(e){e=t.charCoords(e.head,"div").top+5;return t.coordsChar({left:0,top:e},"div")},vo)},goLineLeftSmart:function(n){n.extendSelectionsBy(function(e){var t=n.charCoords(e.head,"div").top+5,t=n.coordsChar({left:0,top:t},"div");return t.ch<n.getLine(t.line).search(/\S/)?qr(n,e.head):t},vo)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),o=yo(e.getLine(o.line),o.ch,r);t.push(wr(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(l){it(l,function(){for(var e=l.listSelections(),t=[],n=0;n<e.length;n++){var r,i=e[n].head,o=Yn(l.doc,i.line).text;o&&(i.ch==o.length&&(i=new mi(i.line,i.ch-1)),0<i.ch?(i=new mi(i.line,i.ch+1),l.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),mi(i.line,i.ch-2),i,"+transpose")):i.line>l.doc.first&&((r=Yn(l.doc,i.line-1).text)&&l.replaceRange(o.charAt(0)+l.doc.lineSeparator()+r.charAt(r.length-1),mi(i.line-1,r.length-1),mi(i.line,1),"+transpose"))),t.push(new ne(i,i))}l.setSelections(t)})},newlineAndIndent:function(r){it(r,function(){for(var e=r.listSelections().length,t=0;t<e;t++){var n=r.listSelections()[t];r.replaceRange(r.doc.lineSeparator(),n.anchor,n.head,"+input"),r.indentLine(n.from().line+1,null,!0)}Vt(r)})},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},ji=a.keyMap={};ji.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"},ji.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"},ji.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"},ji.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"]},ji.default=ci?ji.macDefault:ji.pcDefault,a.normalizeKeyMap=function(e){var t,n,r={};for(t in e)if(e.hasOwnProperty(t)){var i=e[t];if(/^(name|fallthrough|(de|at)tach)$/.test(t))continue;if("..."==i){delete e[t];continue}for(var o=Cr(t.split(" "),nn),l=0;l<o.length;l++){var s,a=l==o.length-1?(s=o.join(" "),i):(s=o.slice(0,l+1).join(" "),"..."),c=r[s];if(c){if(c!=a)throw new Error("Inconsistent bindings for "+s)}else r[s]=a}delete e[t]}for(n in r)e[n]=r[n];return e};var Ui=a.lookupKey=function(e,t,n,r){var i=(t=rn(t)).call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ui(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var l=Ui(e,t.fallthrough[o],n,r);if(l)return l}}},qi=a.isModifierKey=function(e){e="string"==typeof e?e:Wo[e.keyCode];return"Ctrl"==e||"Alt"==e||"Shift"==e||"Mod"==e},Gi=a.keyName=function(e,t){if(ri&&34==e.keyCode&&e.char)return!1;var n=Wo[e.keyCode],r=n;return null!=r&&!e.altGraphKey&&(e.altKey&&"Alt"!=n&&(r="Alt-"+r),(hi?e.metaKey:e.ctrlKey)&&"Ctrl"!=n&&(r="Ctrl-"+r),(hi?e.ctrlKey:e.metaKey)&&"Cmd"!=n&&(r="Cmd-"+r),!t&&e.shiftKey&&"Shift"!=n&&(r="Shift-"+r),r)};a.fromTextArea=function(t,e){function n(){t.value=s.getValue()}var r;if((e=e?Mr(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus&&(r=Dr(),e.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body),t.form&&(so(t.form,"submit",n),!e.leaveSubmitMethodAlone)){var i=t.form,o=i.submit;try{var l=i.submit=function(){n(),i.submit=o,i.submit(),i.submit=l}}catch(e){}}e.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(co(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=o))}},t.style.display="none";var s=a(function(e){t.parentNode.insertBefore(e,t.nextSibling)},e);return s};var Yi=a.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Yi.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.pos<this.string.length?this.string.charAt(this.pos++):void 0},eat:function(e){var t=this.string.charAt(this.pos);return("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))?(++this.pos,t):void 0},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){e=this.string.indexOf(e,this.pos);return-1<e?(this.pos=e,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=yo(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?yo(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return yo(this.string,null,this.tabSize)-(this.lineStart?yo(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&0<r.index?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}r=function(e){return n?e.toLowerCase():e};return r(this.string.substr(this.pos,e.length))==r(e)?(!1!==t&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var $i=0,Vi=a.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++$i};xr(Vi),Vi.prototype.clear=function(){if(!this.explicitlyCleared){var e,t=this.doc.cm,n=t&&!t.curOp;n&&nt(t),yr(this,"clear")&&(e=this.find())&&pr(this,"clear",e.from,e.to);for(var r=null,i=null,o=0;o<this.lines.length;++o){var l=this.lines[o],s=an(l.markedSpans,this);t&&!this.collapsed?ht(t,Xn(l),"text"):t&&(null!=s.to&&(i=Xn(l)),null!=s.from&&(r=Xn(l))),l.markedSpans=function(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n=n||[]).push(e[r]);return n}(l.markedSpans,s),null==s.from&&this.collapsed&&!Cn(this.doc,l)&&t&&Kn(l,et(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(o=0;o<this.lines.length;++o){var a=wn(this.lines[o]),c=p(a);c>t.display.maxLineLength&&(t.display.maxLine=a,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&ut(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&ye(t.doc)),t&&pr(t,"markerCleared",t,this),n&&rt(t),this.parent&&this.parent.clear()}},Vi.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],l=an(o.markedSpans,this);if(null!=l.from&&(n=mi(t?o:Xn(o),l.from),-1==e))return n;if(null!=l.to&&(r=mi(t?o:Xn(o),l.to),1==e))return r}return n&&{from:n,to:r}},Vi.prototype.changed=function(){var n=this.find(-1,!0),r=this,i=this.doc.cm;n&&i&&it(i,function(){var e=n.line,t=Xn(n.line),t=Be(i,t);t&&(je(t),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,Cn(r.doc,e)||null==r.height||(t=r.height,r.height=null,(t=Tn(r)-t)&&Kn(e,e.height+t))})},Vi.prototype.attachLine=function(e){var t;!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers&&-1!=Sr(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)),this.lines.push(e)},Vi.prototype.detachLine=function(e){this.lines.splice(Sr(this.lines,e),1),!this.lines.length&&this.doc.cm&&((e=this.doc.cm.curOp).maybeHiddenMarkers||(e.maybeHiddenMarkers=[])).push(this)};var $i=0,Ki=a.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};xr(Ki),Ki.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();pr(this,"clear")}},Ki.prototype.find=function(e,t){return this.primary.find(e,t)};var Xi=a.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};xr(Xi),Xi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Xn(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Tn(this);Kn(n,Math.max(0,n.height-o)),e&&it(e,function(){Ln(e,n,-o),ht(e,r,"widget")})}},Xi.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=Tn(this)-e;r&&(Kn(n,n.height+r),t&&it(t,function(){t.curOp.forceUpdate=!0,Ln(t,n,r)}))};var Zi=a.Line=function(e,t,n){this.text=e,fn(this,t),this.height=n?n(this):1};xr(Zi),Zi.prototype.lineNo=function(){return Xn(this)};var Ji={},Qi={};jn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n,r=e,i=e+t;r<i;++r){var o=this.lines[r];this.height-=o.height,(n=o).parent=null,dn(n),pr(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},Un.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n,r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e),s=i.height;if(i.removeInner(e,l),this.height-=s-i.height,o==l&&(this.children.splice(r--,1),i.parent=null),0==(t-=l))break;e=0}else e-=o}this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof jn))&&(n=[],this.collapse(n),this.children=[new jn(n)],this.children[0].parent=this)},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&50<i.lines.length){for(var l=i.lines.length%25+25,s=l;s<i.lines.length;){var a=new jn(i.lines.slice(s,s+=25));i.height-=a.height,this.children.splice(++r,0,a),a.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t,n=new Un(e.children.splice(e.children.length-5,5))}while(e.parent?(e.size-=n.size,e.height-=n.height,t=Sr(e.parent.children,e),e.parent.children.splice(t+1,0,n)):(((t=new Un(e.children)).parent=e).children=[t,n],e=t),n.parent=e.parent,10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e);if(i.iterN(e,l,n))return!0;if(0==(t-=l))break;e=0}else e-=o}}};var eo=0,to=a.Doc=function(e,t,n,r){if(!(this instanceof to))return new to(e,t,n,r);null==n&&(n=0),Un.call(this,[new jn([new Zi("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;n=mi(n,0);this.sel=ie(n),this.history=new er(null),this.id=++eo,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),zn(this,{from:n,to:n,text:e}),me(this,ie(n),mo)};to.prototype=Tr(Un.prototype,{constructor:to,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Vn(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:st(function(e){var t=mi(this.first,0),n=this.first+this.size-1;Ft(this,{from:t,to:mi(n,Yn(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),me(this,ie(t))}),replaceRange:function(e,t,n,r){Gt(this,e,t=le(this,t),n=n?le(this,n):t,r)},getRange:function(e,t,n){t=$n(this,le(this,e),le(this,t));return!1===n?t:t.join(n||this.lineSeparator())},getLine:function(e){e=this.getLineHandle(e);return e&&e.text},getLineHandle:function(e){return se(this,e)?Yn(this,e):void 0},getLineNumber:Xn,getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Yn(this,e)),wn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return le(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:st(function(e,t,n){fe(this,le(this,"number"==typeof e?mi(e,t||0):e),null,n)}),setSelection:st(function(e,t,n){fe(this,le(this,e),le(this,t||e),n)}),extendSelection:st(function(e,t,n){ue(this,le(this,e),t&&le(this,t),n)}),extendSelections:st(function(e,t){he(this,ae(this,e),t)}),extendSelectionsBy:st(function(e,t){he(this,ae(this,Cr(this.sel.ranges,e)),t)}),setSelections:st(function(e,t,n){if(e.length){for(var r=0,i=[];r<e.length;r++)i[r]=new ne(le(this,e[r].anchor),le(this,e[r].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),me(this,re(i,t),n)}}),addSelection:st(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new ne(le(this,e),le(this,t||e))),me(this,re(r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n=0;n<t.length;n++)var r=$n(this,t[n].from(),t[n].to()),i=i?i.concat(r):r;return!1===e?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=$n(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:st(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var l=i.ranges[o];r[o]={from:l.from(),to:l.to(),text:this.splitLines(e[o]),origin:n}}for(t=t&&"end"!=t&&function(e,t,n){for(var r=[],i=c=mi(e.first,0),o=0;o<t.length;o++){var l=t[o],s=Bt(l.from,c,i),a=Bt(Ei(l),c,i),c=l.to,i=a;"around"==n?(l=e.sel.ranges[o],l=gi(l.head,l.anchor)<0,r[o]=new ne(l?a:s,l?s:a)):r[o]=new ne(s,s)}return new te(r,e.sel.primIndex)}(this,r,t),o=r.length-1;0<=o;o--)Ft(this,r[o]);t?pe(this,t):this.cm&&Vt(this.cm)}),undo:st(function(){jt(this,"undo")}),redo:st(function(){jt(this,"redo")}),undoSelection:st(function(){jt(this,"undo",!0)}),redoSelection:st(function(){jt(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new er(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:lr(this.history.done),undone:lr(this.history.undone)}},setHistory:function(e){var t=this.history=new er(this.history.maxGeneration);t.done=lr(e.done.slice(0),null,!0),t.undone=lr(e.undone.slice(0),null,!0)},addLineClass:st(function(e,n,r){return Zt(this,e,"gutter"==n?"gutter":"class",function(e){var t="text"==n?"textClass":"background"==n?"bgClass":"gutter"==n?"gutterClass":"wrapClass";if(e[t]){if(Hr(r).test(e[t]))return;e[t]+=" "+r}else e[t]=r;return 1})}),removeLineClass:st(function(e,o,l){return Zt(this,e,"gutter"==o?"gutter":"class",function(e){var t="text"==o?"textClass":"background"==o?"bgClass":"gutter"==o?"gutterClass":"wrapClass",n=e[t];if(n){if(null==l)e[t]=null;else{var r=n.match(Hr(l));if(!r)return;var i=r.index+r[0].length;e[t]=n.slice(0,r.index)+(r.index&&i!=n.length?" ":"")+n.slice(i)||null}return 1}})}),addLineWidget:st(function(e,t,n){return e=e,i=new Xi(r=this,t,n),(o=r.cm)&&i.noHScroll&&(o.display.alignWidgets=!0),Zt(r,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&&!Cn(r,e)&&(t=Jn(e)<r.scrollTop,Kn(e,e.height+Tn(i)),t&&$t(o,null,i.height),o.curOp.forceUpdate=!0),1}),i;var r,i,o}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return on(this,le(this,e),le(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){t={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return on(this,e=le(this,e),e,t,"bookmark")},findMarksAt:function(e){var t=[],n=Yn(this,(e=le(this,e)).line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(i,o,l){i=le(this,i),o=le(this,o);var s=[],a=i.line;return this.iter(i.line,o.line+1,function(e){var t=e.markedSpans;if(t)for(var n=0;n<t.length;n++){var r=t[n];null!=r.to&&a==i.line&&i.ch>=r.to||null==r.from&&a!=i.line||null!=r.from&&a==o.line&&r.from>=o.ch||l&&!l(r.marker)||s.push(r.marker.parent||r.marker)}++a}),s},getAllMarks:function(){var r=[];return this.iter(function(e){var t=e.markedSpans;if(t)for(var n=0;n<t.length;++n)null!=t[n].from&&r.push(t[n].marker)}),r},posFromIndex:function(t){var n,r=this.first,i=this.lineSeparator().length;return this.iter(function(e){e=e.text.length+i;return t<e?(n=t,!0):(t-=e,void++r)}),le(this,mi(r,n))},indexFromPos:function(e){var t=(e=le(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new to(Vn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e=e||{};var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);t=new to(Vn(this,t,n),e.mode||this.modeOption,t,this.lineSep);return 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}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),i=e.clipPos(i.to);gi(o,i)&&(i=on(e,o,i,r.primary,r.primary.type),r.markers.push(i),i.parent=r)}}(t,ln(this)),t},unlinkDoc:function(e){if(e instanceof a&&(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),function(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];qn(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==Sr(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}}}(ln(this));break}var n;e.history==this.history&&(n=[e.id],qn(e,function(e){n.push(e.id)},!0),e.history=new er(null),e.history.done=lr(this.history.done,n),e.history.undone=lr(this.history.undone,n))},iterLinkedDocs:function(e){qn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ro(e)},lineSeparator:function(){return this.lineSep||"\n"}}),to.prototype.eachLine=to.prototype.iter;var no,ro="iter insert remove copy getEditor constructor".split(" ");for(no in to.prototype)to.prototype.hasOwnProperty(no)&&Sr(ro,no)<0&&(a.prototype[no]=function(e){return function(){return e.apply(this.doc,arguments)}}(to.prototype[no]));xr(to);var io=a.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},oo=a.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},lo=a.e_stop=function(e){io(e),oo(e)},so=a.on=function(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):((e=e._handlers||(e._handlers={}))[t]||(e[t]=[])).push(n)},ao=[],co=a.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else for(var r=fr(e,t,!1),i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}},uo=a.signal=function(e,t){var n=fr(e,t,!0);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)},ho=null,fo=30,po=a.Pass={toString:function(){return"CodeMirror.Pass"}},mo={scroll:!1},go={origin:"*mouse"},vo={origin:"+move"};br.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var yo=a.countColumn=function(e,t,n,r,i){null!=t||-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=r||0,l=i||0;;){var s=e.indexOf("\t",o);if(s<0||t<=s)return l+(t-o);l+=s-o,l+=n-l%n,o=s+1}},xo=a.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var l=o-r;if(o==e.length||t<=i+l)return r+Math.min(l,t-i);if(i+=o-r,r=o+1,t<=(i+=n-i%n))return r}},bo=[""],wo=function(e){e.select()};si?wo=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:ei&&(wo=function(e){try{e.select()}catch(e){}});var ko=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,So=a.isWordChar=function(e){return/\w/.test(e)||"€"<e&&(e.toUpperCase()!=e.toLowerCase()||ko.test(e))},Co=/[\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]/,Lo=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r},To=a.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)};ei&&ti<11&&(Dr=function(){try{return document.activeElement}catch(e){return document.body}});var Mo,No,Ao=a.rmClass=function(e,t){var n=e.className,r=Hr(t).exec(n);r&&(t=n.slice(r.index+r[0].length),e.className=n.slice(0,r.index)+(t?r[1]+t:""))},Eo=a.addClass=function(e,t){var n=e.className;Hr(t).test(n)||(e.className+=(n?" ":"")+t)},Oo=!1,Io=function(){if(ei&&ti<9)return!1;var e=Ir("div");return"draggable"in e||"dragDrop"in e}(),Ro=a.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),l=o.indexOf("\r");-1!=l?(n.push(o.slice(0,l)),t+=l+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Po=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Do="oncopy"in(Xr=Ir("div"))||(Xr.setAttribute("oncopy","return;"),"function"==typeof Xr.oncopy),Ho=null,Wo=a.keyNames={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"};!function(){for(var e=0;e<10;e++)Wo[e+48]=Wo[e+96]=String(e);for(e=65;e<=90;e++)Wo[e]=String.fromCharCode(e);for(e=1;e<=12;e++)Wo[e+111]=Wo[e+63235]="F"+e}();var Bo,_o,Fo,zo,jo,Uo,qo,Go,Yo=(_o="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",Fo="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",zo=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,jo=/[stwN]/,Uo=/[LRr]/,qo=/[Lb1n]/,Go=/[1n]/,function(e){if(!zo.test(e))return!1;for(var t,n=e.length,r=[],i=0;i<n;++i)r.push(u=(t=e.charCodeAt(i))<=247?_o.charAt(t):1424<=t&&t<=1524?"R":1536<=t&&t<=1773?Fo.charAt(t-1536):1774<=t&&t<=2220?"r":8192<=t&&t<=8203?"w":8204==t?"b":"L");for(var i=0,o="L";i<n;++i)"m"==(u=r[i])?r[i]=o:o=u;for(var i=0,l="L";i<n;++i)"1"==(u=r[i])&&"r"==l?r[i]="n":Uo.test(u)&&("r"==(l=u)&&(r[i]="R"));for(i=1,o=r[0];i<n-1;++i)"+"==(u=r[i])&&"1"==o&&"1"==r[i+1]?r[i]="1":","!=u||o!=r[i+1]||"1"!=o&&"n"!=o||(r[i]=o),o=u;for(i=0;i<n;++i)if(","==(u=r[i]))r[i]="N";else if("%"==u){for(var s=i+1;s<n&&"%"==r[s];++s);for(var a=i&&"!"==r[i-1]||s<n&&"1"==r[s]?"1":"N",c=i;c<s;++c)r[c]=a;i=s-1}for(i=0,l="L";i<n;++i){var u=r[i];"L"==l&&"1"==u?r[i]="L":Uo.test(u)&&(l=u)}for(i=0;i<n;++i)if(jo.test(r[i])){for(s=i+1;s<n&&jo.test(r[s]);++s);for(var h="L"==(i?r[i-1]:"L"),d="L"==(s<n?r[s]:"L"),a=h||d?"L":"R",c=i;c<s;++c)r[c]=a;i=s-1}for(var f,p=[],i=0;i<n;)if(qo.test(r[i])){var m=i;for(++i;i<n&&qo.test(r[i]);++i);p.push(new $o(0,m,i))}else{var g=i,v=p.length;for(++i;i<n&&"L"!=r[i];++i);for(c=g;c<i;)if(Go.test(r[c])){g<c&&p.splice(v,0,new $o(1,g,c));var y=c;for(++c;c<i&&Go.test(r[c]);++c);p.splice(v,0,new $o(2,y,c)),g=c}else++c;g<i&&p.splice(v,0,new $o(1,g,i))}return 1==p[0].level&&(f=e.match(/^\s+/))&&(p[0].from=f[0].length,p.unshift(new $o(0,0,f[0].length))),1==kr(p).level&&(f=e.match(/\s+$/))&&(kr(p).to-=f[0].length,p.push(new $o(0,n-f[0].length,n))),2==p[0].level&&p.unshift(new $o(1,p[0].to,p[0].to)),p[0].level!=kr(p).level&&p.push(new $o(p[0].level,n,n)),p});function $o(e,t,n){this.level=e,this.from=t,this.to=n}return a.version="5.15.2",a})},{}],11:[function(e,t,n){var r;r=function(l){"use strict";var s=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;l.defineMode("gfm",function(e,r){var t,i=0,n={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```+/)?t.codeBlock=!1:e.skipToEnd(),null;if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var n=e.pos;e.eatWhile("`");n=1+e.pos-n;return t.code?n===i&&(t.code=!1):(i=n,t.code=!0),null}if(t.code)return e.next(),null;if(e.eatSpace())return t.ateSpace=!0,null;if((e.sol()||t.ateSpace)&&(t.ateSpace=!1)!==r.gitHubSpice){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return t.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return t.combineTokens=!0,"link"}return e.match(s)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(t.combineTokens=!0,"link"):(e.next(),null)},blankLine:function(e){return e.code=!1,null}},o={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(t in r)o[t]=r[t];return o.name="markdown",l.overlayMode(l.getMode(e,o),n)},"markdown"),l.defineMIME("text/x-gfm","gfm")},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../markdown/markdown"),e("../../addon/mode/overlay")):r(CodeMirror)},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(e,t,n){var r;r=function(O){"use strict";O.defineMode("markdown",function(s,u){function a(e,t,n){return(t.f=t.inline=n)(e,t)}function c(e){return!e||!/\S/.test(e.string)}function r(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,x&&e.f==h&&(e.f=o,e.block=i),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null}function i(e,t){var n=e.sol(),r=!1!==t.list,i=t.indentedCode;t.indentedCode=!1,r&&(0<=t.indentationDiff?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):0<t.indentation?t.list=null:t.list=!1);var o=null;if(4<=t.indentationDiff)return e.skipToEnd(),i||c(t.prevLine)?(t.indentation-=4,t.indentedCode=!0,b.code):null;if(e.eatSpace())return null;if((o=e.match(L))&&o[1].length<=6)return t.header=o[1].length,u.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(!(c(t.prevLine)||t.quote||r||i)&&(o=e.match(T)))return t.header="="==o[0].charAt(0)?1:2,u.highlightFormatting&&(t.formatting="header"),t.f=t.inline,f(t);if(e.eat(">"))return t.quote=n?1:t.quote+1,u.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),f(t);if("["===e.peek())return a(e,t,g);if(e.match(w,!0))return t.hr=!0,b.hr;if(!c(t.prevLine)&&!r||!e.match(k,!1)&&!e.match(S,!1))return u.fencedCodeBlocks&&(o=e.match(N,!0))?(t.fencedChars=o[1],t.localMode=(l=o[2],!O.findModeByName||(o=O.findModeByName(l))&&(l=o.mime||o.mimes[0]),"null"==(l=O.getMode(s,l)).name?null:l),t.localMode&&(t.localState=O.startState(t.localMode)),t.f=t.block=d,u.highlightFormatting&&(t.formatting="code-block"),t.code=-1,f(t)):a(e,t,t.inline);var l=null,l=e.match(k,!0)?"ul":(e.match(S,!0),"ol");for(t.indentation=e.column()+e.current().length,t.list=!0;t.listStack&&e.column()<t.listStack[t.listStack.length-1];)t.listStack.pop();return t.listStack.push(t.indentation),u.taskLists&&e.match(C,!1)&&(t.taskList=!0),t.f=t.inline,u.highlightFormatting&&(t.formatting=["list","list-"+l]),f(t)}function h(e,t){var n,r=y.token(e,t.htmlState);return x||("xml"==(n=O.innerMode(y,t.htmlState)).mode.name&&null===n.state.tagStart&&!n.state.context&&n.state.tokenize.isInText||t.md_inside&&-1<e.current().indexOf(">"))&&(t.f=o,t.block=i,t.htmlState=null),r}function d(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=n,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),b.code)}function n(e,t){e.match(t.fencedChars),t.block=i,t.f=o,t.fencedChars=null,u.highlightFormatting&&(t.formatting="code-block"),t.code=1;e=f(t);return t.code=0,e}function f(e){var t,n=[];if(e.formatting){n.push(b.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)n.push(b.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&n.push(b.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!u.maxBlockquoteDepth||u.maxBlockquoteDepth>=e.quote?n.push(b.formatting+"-"+e.formatting[r]+"-"+e.quote):n.push("error"))}return e.taskOpen?n.push("meta"):e.taskClosed?n.push("property"):(e.linkHref?n.push(b.linkHref,"url"):(e.strong&&n.push(b.strong),e.em&&n.push(b.em),e.strikethrough&&n.push(b.strikethrough),e.linkText&&n.push(b.linkText),e.code&&n.push(b.code)),e.header&&n.push(b.header,b.header+"-"+e.header),e.quote&&(n.push(b.quote),!u.maxBlockquoteDepth||u.maxBlockquoteDepth>=e.quote?n.push(b.quote+"-"+e.quote):n.push(b.quote+"-"+u.maxBlockquoteDepth)),!1!==e.list&&((t=(e.listStack.length-1)%3)?1==t?n.push(b.list2):n.push(b.list3):n.push(b.list1)),e.trailingSpaceNewLine?n.push("trailing-space-new-line"):e.trailingSpace&&n.push("trailing-space-"+(e.trailingSpace%2?"a":"b"))),n.length?n.join(" "):null}function e(e,t){return e.match(M,!0)?f(t):void 0}function o(e,t){var n=t.text(e,t);if(void 0!==n)return n;if(t.list)return t.list=null,f(t);if(t.taskList)return"x"!==e.match(C,!0)[1]?t.taskOpen=!0:t.taskClosed=!0,u.highlightFormatting&&(t.formatting="task"),t.taskList=!1,f(t);if(t.taskOpen=!1,t.taskClosed=!1,t.header&&e.match(/^#+$/,!0))return u.highlightFormatting&&(t.formatting="header"),f(t);var r=e.sol(),i=e.next();if(t.linkTitle){t.linkTitle=!1;n="("===i?")":i,n="^\\s*(?:[^"+(n=(n+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+n;if(e.match(new RegExp(n),!0))return b.linkHref}if("`"===i){var o=t.formatting;u.highlightFormatting&&(t.formatting="code"),e.eatWhile("`");var l=e.current().length;if(0==t.code)return t.code=l,f(t);if(l!=t.code)return t.formatting=o,f(t);l=f(t);return t.code=0,l}if(t.code)return f(t);if("\\"===i&&(e.next(),u.highlightFormatting)){var s=f(t),o=b.formatting+"-escape";return s?s+" "+o:o}if("!"===i&&e.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return e.match(/\[[^\]]*\]/),t.inline=t.f=m,b.image;if("["===i&&e.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1))return t.linkText=!0,u.highlightFormatting&&(t.formatting="link"),f(t);if("]"===i&&t.linkText&&e.match(/\(.*?\)| ?\[.*?\]/,!1)){u.highlightFormatting&&(t.formatting="link");var s=f(t);return t.linkText=!1,t.inline=t.f=m,s}if("<"===i&&e.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return t.f=t.inline=p,u.highlightFormatting&&(t.formatting="link"),(s=f(t))?s+=" ":s="",s+b.linkInline;if("<"===i&&e.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return t.f=t.inline=p,u.highlightFormatting&&(t.formatting="link"),(s=f(t))?s+=" ":s="",s+b.linkEmail;if("<"===i&&e.match(/^(!--|\w)/,!1)){s=e.string.indexOf(">",e.pos);return-1!=s&&(a=e.string.substring(e.start,s),/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(a)&&(t.md_inside=!0)),e.backUp(1),t.htmlState=O.startState(y),c=e,s=h,((a=t).f=a.block=s)(c,a)}if("<"===i&&e.match(/^\/\w*?>/))return t.md_inside=!1,"tag";var a,c=!1;if(u.underscoresBreakWords||"_"!==i||"_"===e.peek()||!e.match(/(\w)/,!1)||0<=(a=e.pos-2)&&("_"!==(a=e.string.charAt(a))&&a.match(/(\w)/,!1)&&(c=!0)),"*"===i||"_"===i&&!c){if(!r||" "!==e.peek()){if(t.strong===i&&e.eat(i)){u.highlightFormatting&&(t.formatting="strong");l=f(t);return t.strong=!1,l}if(!t.strong&&e.eat(i))return t.strong=i,u.highlightFormatting&&(t.formatting="strong"),f(t);if(t.em===i){u.highlightFormatting&&(t.formatting="em");l=f(t);return t.em=!1,l}if(!t.em)return t.em=i,u.highlightFormatting&&(t.formatting="em"),f(t)}}else if(" "===i&&(e.eat("*")||e.eat("_"))){if(" "===e.peek())return f(t);e.backUp(1)}if(u.strikethrough)if("~"===i&&e.eatWhile(i)){if(t.strikethrough){u.highlightFormatting&&(t.formatting="strikethrough");l=f(t);return t.strikethrough=!1,l}if(e.match(/^[^\s]/,!1))return t.strikethrough=!0,u.highlightFormatting&&(t.formatting="strikethrough"),f(t)}else if(" "===i&&e.match(/^~~/,!0)){if(" "===e.peek())return f(t);e.backUp(2)}return" "===i&&(e.match(/ +$/,!1)?t.trailingSpace++:t.trailingSpace&&(t.trailingSpaceNewLine=!0)),f(t)}function p(e,t){if(">"!==e.next())return e.match(/^[^>]+/,!0),b.linkInline;t.f=t.inline=o,u.highlightFormatting&&(t.formatting="link");t=f(t);return t?t+=" ":t="",t+b.linkInline}function m(e,t){if(e.eatSpace())return null;var n,e=e.next();return"("===e||"["===e?(t.f=t.inline=(n="("===e?")":"]",function(e,t){if(e.next()!==n)return e.match(A[n]),t.linkHref=!0,f(t);t.f=t.inline=o,u.highlightFormatting&&(t.formatting="link-string");e=f(t);return t.linkHref=!1,e}),u.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,f(t)):"error"}function g(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=l,e.next(),u.highlightFormatting&&(t.formatting="link"),t.linkText=!0,f(t)):a(e,t,o)}function l(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=v,u.highlightFormatting&&(t.formatting="link");var n=f(t);return t.linkText=!1,n}return e.match(/^([^\]\\]|\\.)+/,!0),b.linkText}function v(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=o,b.linkHref+" url")}var y=O.getMode(s,"text/html"),x="null"==y.name;void 0===u.highlightFormatting&&(u.highlightFormatting=!1),void 0===u.maxBlockquoteDepth&&(u.maxBlockquoteDepth=0),void 0===u.underscoresBreakWords&&(u.underscoresBreakWords=!0),void 0===u.taskLists&&(u.taskLists=!1),void 0===u.strikethrough&&(u.strikethrough=!1),void 0===u.tokenTypeOverrides&&(u.tokenTypeOverrides={});var t,b={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(t in b)b.hasOwnProperty(t)&&u.tokenTypeOverrides[t]&&(b[t]=u.tokenTypeOverrides[t]);var w=/^([*\-_])(?:\s*\1){2,}\s*$/,k=/^[*\-+]\s+/,S=/^[0-9]+([.)])\s+/,C=/^\[(x| )\](?=\s)/,L=u.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ *(?:\={1,}|-{1,})\s*$/,M=/^[^#!\[\]*_\\<>` "'(~]+/,N=new RegExp("^("+(!0===u.fencedCodeBlocks?"~~~+|```+":u.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},E={startState:function(){return{f:i,prevLine:null,thisLine:null,block:i,htmlState:null,indentation:0,inline:o,text:e,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(e){return{f:e.f,prevLine:e.prevLine,thisLine:e.thisLine,block:e.block,htmlState:e.htmlState&&O.copyState(y,e.htmlState),indentation:e.indentation,localMode:e.localMode,localState:e.localMode?O.copyState(e.localMode,e.localState):null,inline:e.inline,text:e.text,formatting:!1,linkTitle:e.linkTitle,code:e.code,em:e.em,strong:e.strong,strikethrough:e.strikethrough,header:e.header,hr:e.hr,taskList:e.taskList,list:e.list,listStack:e.listStack.slice(0),quote:e.quote,indentedCode:e.indentedCode,trailingSpace:e.trailingSpace,trailingSpaceNewLine:e.trailingSpaceNewLine,md_inside:e.md_inside,fencedChars:e.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(r(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;n=e.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length;if(t.indentationDiff=Math.min(n-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,0<n)return null}return t.f(e,t)},innerMode:function(e){return e.block==h?{state:e.htmlState,mode:y}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:E}},blankLine:r,getType:f,fold:"markdown"};return E},"xml"),O.defineMIME("text/x-markdown","markdown")},"object"==typeof n&&"object"==typeof t?r(e("../../lib/codemirror"),e("../xml/xml"),e("../meta")):r(CodeMirror)},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(e,t,n){(function(i){"use strict";i.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var e=0;e<i.modeInfo.length;e++){var t=i.modeInfo[e];t.mimes&&(t.mime=t.mimes[0])}i.findModeByMIME=function(e){e=e.toLowerCase();for(var t=0;t<i.modeInfo.length;t++){var n=i.modeInfo[t];if(n.mime==e)return n;if(n.mimes)for(var r=0;r<n.mimes.length;r++)if(n.mimes[r]==e)return n}},i.findModeByExtension=function(e){for(var t=0;t<i.modeInfo.length;t++){var n=i.modeInfo[t];if(n.ext)for(var r=0;r<n.ext.length;r++)if(n.ext[r]==e)return n}},i.findModeByFileName=function(e){for(var t=0;t<i.modeInfo.length;t++){var n=i.modeInfo[t];if(n.file&&n.file.test(e))return n}var r=e.lastIndexOf("."),r=-1<r&&e.substring(r+1,e.length);return r?i.findModeByExtension(r):void 0},i.findModeByName=function(e){e=e.toLowerCase();for(var t=0;t<i.modeInfo.length;t++){var n=i.modeInfo[t];if(n.name.toLowerCase()==e)return n;if(n.alias)for(var r=0;r<n.alias.length;r++)if(n.alias[r].toLowerCase()==e)return n}}})("object"==typeof n&&"object"==typeof t?e("../lib/codemirror"):CodeMirror)},{"../lib/codemirror":10}],14:[function(e,t,n){(function(S){"use strict";var C={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};S.defineMode("xml",function(e,t){function l(t,n){function e(e){return(n.tokenize=e)(t,n)}var r=t.next();return"<"==r?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 r(i){return function(e,t){for(var n;null!=(n=e.next());){if("<"==n)return t.tokenize=r(i+1),t.tokenize(e,t);if(">"==n){if(1!=i)return t.tokenize=r(i-1),t.tokenize(e,t);t.tokenize=l;break}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),n.tokenize=i("meta","?>"),"meta"):(y=t.eat("/")?"closeTag":"openTag",n.tokenize=s,"tag bracket"):"&"!=r?(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 s(e,t){var n,r=e.next();if(">"==r||"/"==r&&e.eat(">"))return t.tokenize=l,y=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return y="equals",null;if("<"!=r)return/[\'\"]/.test(r)?(t.tokenize=(n=r,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()==n){t.tokenize=s;break}return"string"}}function i(n,r){return function(e,t){for(;!e.eol();){if(e.match(r)){t.tokenize=l;break}e.next()}return n}}function o(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(w.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function r(e){e.context&&(e.context=e.context.prev)}function a(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!w.contextGrabbers.hasOwnProperty(n)||!w.contextGrabbers[n].hasOwnProperty(t))return;r(e)}}function c(e,t,n){return"openTag"==e?(n.tagStart=t.column(),u):"closeTag"==e?h:c}function u(e,t,n){return"word"==e?(n.tagName=t.current(),x="tag",p):(x="error",u)}function h(e,t,n){if("word"!=e)return x="error",f;t=t.current();return n.context&&n.context.tagName!=t&&w.implicitlyClosed.hasOwnProperty(n.context.tagName)&&r(n),n.context&&n.context.tagName==t||!1===w.matchClosing?(x="tag",d):(x="tag error",f)}function d(e,t,n){return"endTag"!=e?(x="error",d):(r(n),c)}function f(e,t,n){return x="error",d(e,0,n)}function p(e,t,n){if("word"==e)return x="attribute",m;if("endTag"!=e&&"selfcloseTag"!=e)return x="error",p;var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||w.autoSelfClosers.hasOwnProperty(r)?a(n,r):(a(n,r),n.context=new o(n,r,i==n.indented)),c}function m(e,t,n){return"equals"==e?g:(w.allowMissing||(x="error"),p(e,0,n))}function g(e,t,n){return"string"==e?v:"word"==e&&w.allowUnquoted?(x="string",p):(x="error",p(e,0,n))}function v(e,t,n){return"string"==e?v:p(e,0,n)}var n,y,x,b=e.indentUnit,w={},k=t.htmlMode?C:L;for(n in k)w[n]=k[n];for(n in t)w[n]=t[n];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 n=t.tokenize(e,t);return(n||y)&&"comment"!=n&&(x=null,t.state=t.state(y||n,e,t),x&&(n="error"==x?n+" error":x)),n},indent:function(e,t,n){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+b;if(r&&r.noIndent)return S.Pass;if(e.tokenize!=s&&e.tokenize!=l)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==w.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+b*(w.multilineTagIndentFactor||1);if(w.alignCDATA&&/<!\[CDATA\[/.test(t))return 0;var i=t&&/^<(\/)?([\w_:\.-]*)/.exec(t);if(i&&i[1])for(;r;){if(r.tagName==i[2]){r=r.prev;break}if(!w.implicitlyClosed.hasOwnProperty(r.tagName))break;r=r.prev}else if(i)for(;r;){var o=w.contextGrabbers[r.tagName];if(!o||!o.hasOwnProperty(i[2]))break;r=r.prev}for(;r&&r.prev&&!r.startOfLine;)r=r.prev;return r?r.indent+b:e.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:w.htmlMode?"html":"xml",helperType:w.htmlMode?"html":"xml",skipAttribute:function(e){e.state==g&&(e.state=p)}}}),S.defineMIME("text/xml","xml"),S.defineMIME("application/xml","xml"),S.mimeModes.hasOwnProperty("text/html")||S.defineMIME("text/html",{name:"xml",htmlMode:!0})})("object"==typeof n&&"object"==typeof t?e("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],15:[function(e,t,n){n.read=function(e,t,n,r,i){var o,l,s=8*i-r-1,a=(1<<s)-1,c=a>>1,u=-7,h=n?i-1:0,d=n?-1:1,n=e[t+h];for(h+=d,o=n&(1<<-u)-1,n>>=-u,u+=s;0<u;o=256*o+e[t+h],h+=d,u-=8);for(l=o&(1<<-u)-1,o>>=-u,u+=r;0<u;l=256*l+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===a)return l?NaN:1/0*(n?-1:1);l+=Math.pow(2,r),o-=c}return(n?-1:1)*l*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var l,s,a=8*o-i-1,c=(1<<a)-1,u=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,f=r?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,l=c):(l=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-l))<1&&(l--,r*=2),2<=(t+=1<=l+u?h/r:h*Math.pow(2,1-u))*r&&(l++,r/=2),c<=l+u?(s=0,l=c):1<=l+u?(s=(t*r-1)*Math.pow(2,i),l+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),l=0));8<=i;e[n+d]=255&s,d+=f,s/=256,i-=8);for(l=l<<i|s,a+=i;0<a;e[n+d]=255&l,d+=f,l/=256,a-=8);e[n+d-f]|=128*o}},{}],16:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],17:[function(e,o,l){(function(e){(function(){function a(e){this.tokens=[],this.tokens.links={},this.options=e||d.defaults,this.rules=f.normal,this.options.gfm&&(this.options.tables?this.rules=f.tables:this.rules=f.gfm)}function r(e,t){if(this.options=t||d.defaults,this.links=e,this.rules=i.normal,this.renderer=this.options.renderer||new n,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=i.breaks:this.rules=i.gfm:this.options.pedantic&&(this.rules=i.pedantic)}function n(e){this.options=e||{}}function c(e){this.tokens=[],this.token=null,this.options=e||d.defaults,this.options.renderer=this.options.renderer||new n,this.renderer=this.options.renderer,this.renderer.options=this.options}function u(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function e(r,i){return r=r.source,i=i||"",function e(t,n){return t?(n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),r=r.replace(t,n),e):new RegExp(r,i)}}function t(){}function h(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function d(e,n,r){if(r||"function"==typeof n){r||(r=n,n=null);var i,o,l=(n=h({},d.defaults,n||{})).highlight,t=0;try{i=a.lex(e,n)}catch(e){return r(e)}o=i.length;function s(t){if(t)return n.highlight=l,r(t);var e;try{e=c.parse(i,n)}catch(e){t=e}return n.highlight=l,t?r(t):r(null,e)}if(!l||l.length<3)return s();if(delete n.highlight,!o)return s();for(;t<i.length;t++)!function(n){"code"!==n.type?--o||s():l(n.text,n.lang,function(e,t){return e?s(e):null==t||t===n.text?--o||s():(n.text=t,n.escaped=!0,void(--o||s()))})}(i[t])}else try{return n=n&&h({},d.defaults,n),c.parse(a.lex(e,n),n)}catch(e){if(e.message+="\nPlease report this to https://github.com/chjj/marked.",(n||d.defaults).silent)return"<p>An error occured:</p><pre>"+u(e.message+"",!0)+"</pre>";throw e}}var f={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:t,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:t,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:t,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};f.item=e(f.item,"gm")(/bull/g,f.bullet)(),f.list=e(f.list)(/bull/g,f.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+f.def.source+")")(),f.blockquote=e(f.blockquote)("def",f.def)(),f._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",f.html=e(f.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,f._tag)(),f.paragraph=e(f.paragraph)("hr",f.hr)("heading",f.heading)("lheading",f.lheading)("blockquote",f.blockquote)("tag","<"+f._tag)("def",f.def)(),f.normal=h({},f),f.gfm=h({},f.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),f.gfm.paragraph=e(f.paragraph)("(?!","(?!"+f.gfm.fences.source.replace("\\1","\\2")+"|"+f.list.source.replace("\\1","\\3")+"|")(),f.tables=h({},f.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),a.rules=f,a.lex=function(e,t){return new a(t).lex(e)},a.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},a.prototype.token=function(e,t,n){for(var r,i,o,l,s,a,c,u,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),1<i[0].length&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),s={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},c=0;c<s.align.length;c++)/^ *-+: *$/.test(s.align[c])?s.align[c]="right":/^ *:-+: *$/.test(s.align[c])?s.align[c]="center":/^ *:-+ *$/.test(s.align[c])?s.align[c]="left":s.align[c]=null;for(c=0;c<s.cells.length;c++)s.cells[c]=s.cells[c].split(/ *\| */);this.tokens.push(s)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),o=i[2],this.tokens.push({type:"list_start",ordered:1<o.length}),r=!1,u=(i=i[0].match(this.rules.item)).length,c=0;c<u;c++)a=(s=i[c]).length,~(s=s.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(a-=s.length,s=this.options.pedantic?s.replace(/^ {1,4}/gm,""):s.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&c!==u-1&&(o===(l=f.bullet.exec(i[c+1])[0])||1<o.length&&1<l.length||(e=i.slice(c+1).join("\n")+e,c=u-1)),l=r||/\n\n(?!\s*$)/.test(s),c!==u-1&&(r="\n"===s.charAt(s.length-1),l=l||r),this.tokens.push({type:l?"loose_item_start":"list_item_start"}),this.token(s,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),s={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c<s.align.length;c++)/^ *-+: *$/.test(s.align[c])?s.align[c]="right":/^ *:-+: *$/.test(s.align[c])?s.align[c]="center":/^ *:-+ *$/.test(s.align[c])?s.align[c]="left":s.align[c]=null;for(c=0;c<s.cells.length;c++)s.cells[c]=s.cells[c].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(s)}else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var i={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:t,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:t,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,_href:/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};i.link=e(i.link)("inside",i._inside)("href",i._href)(),i.reflink=e(i.reflink)("inside",i._inside)(),i.normal=h({},i),i.pedantic=h({},i.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),i.gfm=h({},i.normal,{escape:e(i.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:e(i.text)("]|","~]|")("|","|https?://|")()}),i.breaks=h({},i.gfm,{br:e(i.br)("{2,}","*")(),text:e(i.gfm.text)("{2,}","*")()}),r.rules=i,r.output=function(e,t,n){return new r(t,n).output(e)},r.prototype.output=function(e){for(var t,n,r,i,o="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),o+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),r="@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),this.mangle("mailto:")+n):n=u(i[1]),o+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(i[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),o+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):u(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,o+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),o+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),o+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),o+=this.renderer.codespan(u(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),o+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),o+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),o+=this.renderer.text(u(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),r=n=u(i[1]),o+=this.renderer.link(r,null,n);return o},r.prototype.outputLink=function(e,t){var n=u(t.href),t=t.title?u(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,t,this.output(e[1])):this.renderer.image(n,t,u(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i<r;i++)t=e.charCodeAt(i),.5<Math.random()&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},n.prototype.code=function(e,t,n){var r;return!this.options.highlight||null!=(r=this.options.highlight(e,t))&&r!==e&&(n=!0,e=r),t?'<pre><code class="'+this.options.langPrefix+u(t,!0)+'">'+(n?e:u(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:u(e,!0))+"\n</code></pre>"},n.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},n.prototype.html=function(e){return e},n.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},n.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},n.prototype.list=function(e,t){t=t?"ol":"ul";return"<"+t+">\n"+e+"</"+t+">\n"},n.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},n.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},n.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},n.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},n.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},n.prototype.strong=function(e){return"<strong>"+e+"</strong>"},n.prototype.em=function(e){return"<em>"+e+"</em>"},n.prototype.codespan=function(e){return"<code>"+e+"</code>"},n.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},n.prototype.del=function(e){return"<del>"+e+"</del>"},n.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(e.replace(/&([#\w]+);/g,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var i='<a href="'+e+'"';return t&&(i+=' title="'+t+'"'),i+">"+n+"</a>"},n.prototype.image=function(e,t,n){n='<img src="'+e+'" alt="'+n+'"';return t&&(n+=' title="'+t+'"'),n+(this.options.xhtml?"/>":">")},n.prototype.text=function(e){return e},c.parse=function(e,t,n){return new c(t).parse(e)},c.prototype.parse=function(e){this.inline=new r(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},c.prototype.next=function(){return this.token=this.tokens.pop()},c.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},c.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},c.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":for(var e,t,n="",r="",i="",o=0;o<this.token.header.length;o++)this.token.align[o],i+=this.renderer.tablecell(this.inline.output(this.token.header[o]),{header:!0,align:this.token.align[o]});for(n+=this.renderer.tablerow(i),o=0;o<this.token.cells.length;o++){for(e=this.token.cells[o],i="",t=0;t<e.length;t++)i+=this.renderer.tablecell(this.inline.output(e[t]),{header:!1,align:this.token.align[t]});r+=this.renderer.tablerow(i)}return this.renderer.table(n,r);case"blockquote_start":for(r="";"blockquote_end"!==this.next().type;)r+=this.tok();return this.renderer.blockquote(r);case"list_start":for(var r="",l=this.token.ordered;"list_end"!==this.next().type;)r+=this.tok();return this.renderer.list(r,l);case"list_item_start":for(r="";"list_item_end"!==this.next().type;)r+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(r);case"loose_item_start":for(r="";"list_item_end"!==this.next().type;)r+=this.tok();return this.renderer.listitem(r);case"html":l=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(l);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},t.exec=t,d.options=d.setOptions=function(e){return h(d.defaults,e),d},d.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new n,xhtml:!1},d.Parser=c,d.parser=c.parse,d.Renderer=n,d.Lexer=a,d.lexer=a.lex,d.InlineLexer=r,d.inlineLexer=r.output,d.parse=d,void 0!==o&&"object"==typeof l?o.exports=d:this.marked=d}).call(function(){return this||("undefined"!=typeof window?window:e)}())}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],18:[function(s,t,e){(function(l,d){"use strict";function e(e,t,n,r){if(r=r||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=r.flags||{},e){this.dictionary=e,n="undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(t=t||this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".aff")),n||this._readFile(chrome.extension.getURL("lib/typo/dictionaries/"+e+"/"+e+".dic"))):(r=r.dictionaryPath||(void 0!==d?d+"/dictionaries":"./dictionaries"),t=t||this._readFile(r+"/"+e+"/"+e+".aff"),n||this._readFile(r+"/"+e+"/"+e+".dic")),this.rules=this._parseAFF(t),this.compoundRuleCodes={};for(var i=0,o=this.compoundRules.length;i<o;i++)for(var l=this.compoundRules[i],s=0,a=l.length;s<a;s++)this.compoundRuleCodes[l[s]]=[];for(i in"ONLYINCOMPOUND"in this.flags&&(this.compoundRuleCodes[this.flags.ONLYINCOMPOUND]=[]),this.dictionaryTable=this._parseDIC(n),this.compoundRuleCodes)0==this.compoundRuleCodes[i].length&&delete this.compoundRuleCodes[i];for(i=0,o=this.compoundRules.length;i<o;i++){for(var c=this.compoundRules[i],u="",s=0,a=c.length;s<a;s++){var h=c[s];u+=h in this.compoundRuleCodes?"("+this.compoundRuleCodes[h].join("|")+")":h}this.compoundRules[i]=new RegExp(u,"i")}}return this}e.prototype={load:function(e){for(var t in e)this[t]=e[t];return this},_readFile:function(e,t){if(t=t||"utf8","undefined"!=typeof XMLHttpRequest){var n=new XMLHttpRequest;return n.open("GET",e,!1),n.overrideMimeType&&n.overrideMimeType("text/plain; charset="+t),n.send(null),n.responseText}if(void 0!==s){var r=s("fs");try{if(r.existsSync(e)){var i=r.statSync(e),o=r.openSync(e,"r"),i=new l(i.size);return r.readSync(o,i,0,i.length,null),i.toString(t,0,i.length)}console.log("Path "+e+" does not exist.")}catch(e){return console.log(e),""}}},_parseAFF:function(e){for(var t={},n=(e=this._removeAffixComments(e)).split("\n"),r=0,i=n.length;r<i;r++){var o=(y=n[r]).split(/\s+/),l=o[0];if("PFX"==l||"SFX"==l){for(var s=o[1],a=o[2],c=[],u=r+1,h=r+1+(v=parseInt(o[3],10));u<h;u++){var d=(x=(y=n[u]).split(/\s+/))[2],f=x[3].split("/"),p=f[0];"0"===p&&(p="");var m=this.parseRuleCodes(f[1]),g=x[4],f={};f.add=p,0<m.length&&(f.continuationClasses=m),"."!==g&&(f.match="SFX"===l?new RegExp(g+"$"):new RegExp("^"+g)),"0"!=d&&(f.remove="SFX"===l?new RegExp(d+"$"):d),c.push(f)}t[s]={type:l,combineable:"Y"==a,entries:c},r+=v}else if("COMPOUNDRULE"===l){for(var v,u=r+1,h=r+1+(v=parseInt(o[1],10));u<h;u++){var y,x=(y=n[u]).split(/\s+/);this.compoundRules.push(x[1])}r+=v}else"REP"===l?3===(x=y.split(/\s+/)).length&&this.replacementTable.push([x[1],x[2]]):this.flags[l]=o[1]}return t},_removeAffixComments:function(e){return(e=(e=(e=e.replace(/#.*$/gm,"")).replace(/^\s\s*/m,"").replace(/\s\s*$/m,"")).replace(/\n{2,}/g,"\n")).replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(e){function t(e,t){e in r&&"object"==typeof r[e]||(r[e]=[]),r[e].push(t)}for(var n=(e=this._removeDicComments(e)).split("\n"),r={},i=1,o=n.length;i<o;i++){var l=n[i].split("/",2),s=l[0];if(1<l.length){var a=this.parseRuleCodes(l[1]);"NEEDAFFIX"in this.flags&&-1!=a.indexOf(this.flags.NEEDAFFIX)||t(s,a);for(var c=0,u=a.length;c<u;c++){var h=a[c],d=this.rules[h];if(d)for(var f=this._applyRule(s,d),p=0,m=f.length;p<m;p++){var g=f[p];if(t(g,[]),d.combineable)for(var v=c+1;v<u;v++){var y=a[v],y=this.rules[y];if(y&&y.combineable&&d.type!=y.type)for(var x=this._applyRule(g,y),b=0,w=x.length;b<w;b++)t(x[b],[])}}h in this.compoundRuleCodes&&this.compoundRuleCodes[h].push(s)}}else t(s.trim(),[])}return r},_removeDicComments:function(e){return e.replace(/^\t.*$/gm,"")},parseRuleCodes:function(e){if(!e)return[];if(!("FLAG"in this.flags))return e.split("");if("long"!==this.flags.FLAG)return"num"===this.flags.FLAG?textCode.split(","):void 0;for(var t=[],n=0,r=e.length;n<r;n+=2)t.push(e.substr(n,2));return t},_applyRule:function(e,t){for(var n=t.entries,r=[],i=0,o=n.length;i<o;i++){var l=n[i];if(!l.match||e.match(l.match)){var s=e;if(l.remove&&(s=s.replace(l.remove,"")),"SFX"===t.type?s+=l.add:s=l.add+s,r.push(s),"continuationClasses"in l)for(var a=0,c=l.continuationClasses.length;a<c;a++){var u=this.rules[l.continuationClasses[a]];u&&(r=r.concat(this._applyRule(s,u)))}}}return r},check:function(e){e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(e))return!0;if(e.toUpperCase()===e){var t=e[0]+e.substring(1).toLowerCase();if(this.hasFlag(t,"KEEPCASE"))return!1;if(this.checkExact(t))return!0}t=e.toLowerCase();if(t!==e){if(this.hasFlag(t,"KEEPCASE"))return!1;if(this.checkExact(t))return!0}return!1},checkExact:function(e){var t=this.dictionaryTable[e];if(void 0===t){if("COMPOUNDMIN"in this.flags&&e.length>=this.flags.COMPOUNDMIN)for(var n=0,r=this.compoundRules.length;n<r;n++)if(e.match(this.compoundRules[n]))return!0;return!1}if("object"==typeof t){for(n=0,r=t.length;n<r;n++)if(!this.hasFlag(e,"ONLYINCOMPOUND",t[n]))return!0;return!1}},hasFlag:function(e,t,n){if(t in this.flags&&(void 0===n&&(n=Array.prototype.concat.apply([],this.dictionaryTable[e])),n&&-1!==n.indexOf(this.flags[t])))return!0;return!1},alphabet:"",suggest:function(e,a){function c(e){for(var t=[],n=0,r=e.length;n<r;n++){for(var i=e[n],o=[],l=0,s=i.length+1;l<s;l++)o.push([i.substring(0,l),i.substring(l,i.length)]);for(var a=[],l=0,s=o.length;l<s;l++)(f=o[l])[1]&&a.push(f[0]+f[1].substring(1));for(var c=[],l=0,s=o.length;l<s;l++)1<(f=o[l])[1].length&&c.push(f[0]+f[1][1]+f[1][0]+f[1].substring(2));for(var u=[],l=0,s=o.length;l<s;l++)if((f=o[l])[1])for(var h=0,d=p.alphabet.length;h<d;h++)u.push(f[0]+p.alphabet[h]+f[1].substring(1));for(var f,l=0,s=o.length;l<s;l++)if((f=o[l])[1])for(h=0,d=p.alphabet.length;h<d;h++)u.push(f[0]+p.alphabet[h]+f[1]);t=(t=(t=(t=t.concat(a)).concat(c)).concat(u)).concat([])}return t}function u(e){for(var t=[],n=0;n<e.length;n++)p.check(e[n])&&t.push(e[n]);return t}if(a=a||5,this.check(e))return[];for(var t=0,n=this.replacementTable.length;t<n;t++){var r=this.replacementTable[t];if(-1!==e.indexOf(r[0])){r=e.replace(r[0],r[1]);if(this.check(r))return[r]}}var p=this;return p.alphabet="abcdefghijklmnopqrstuvwxyz",function(e){for(var t=c([e]),e=c(t),n=u(t).concat(u(e)),r={},i=0,o=n.length;i<o;i++)n[i]in r?r[n[i]]+=1:r[n[i]]=1;var l=[];for(i in r)l.push([i,r[i]]);l.sort(function(e,t){return e[1]<t[1]?-1:1}).reverse();for(var s=[],i=0,o=Math.min(a,l.length);i<o;i++)p.hasFlag(l[i][0],"NOSUGGEST")||s.push(l[i][0]);return s}(e)}},void 0!==t&&(t.exports=e)}).call(this,s("buffer").Buffer,"/node_modules/typo-js")},{buffer:3,fs:2}],19:[function(e,t,n){e=e("codemirror");e.commands.tabAndIndentMarkdownList=function(e){var t=e.listSelections()[0].head;!1!==e.getStateAfter(t.line).list?e.execCommand("indentMore"):e.options.indentWithTabs?e.execCommand("insertTab"):(t=Array(e.options.tabSize+1).join(" "),e.replaceSelection(t))},e.commands.shiftTabAndUnindentMarkdownList=function(e){var t=e.listSelections()[0].head;!1!==e.getStateAfter(t.line).list?e.execCommand("indentLess"):e.options.indentWithTabs?e.execCommand("insertTab"):(t=Array(e.options.tabSize+1).join(" "),e.replaceSelection(t))}},{codemirror:10}],20:[function(e,t,n){"use strict";function c(e){return _?e.replace("Ctrl","Cmd"):e.replace("Cmd","Ctrl")}function h(e,t,n){e=e||{};var r,i=document.createElement("a");return t=null==t||t,e.title&&t&&(i.title=(r=e.title,t=e.action,n=n,t&&(t=j(t),n[t]&&(r+=" ("+c(n[t])+")")),r),_&&(i.title=i.title.replace("Ctrl","⌘"),i.title=i.title.replace("Alt","⌥"))),i.tabIndex=-1,i.className=e.className,i}function d(e,t){t=t||e.getCursor("start");var n=e.getTokenAt(t);if(!n.type)return{};for(var r,i,o=n.type.split(" "),l={},s=0;s<o.length;s++)"strong"===(r=o[s])?l.bold=!0:"variable-2"===r?(i=e.getLine(t.line),/^\s*\d+\.\s/.test(i)?l["ordered-list"]=!0:l["unordered-list"]=!0):"atom"===r?l.quote=!0:"em"===r?l.italic=!0:"quote"===r?l.quote=!0:"strikethrough"===r?l.strikethrough=!0:"comment"===r?l.code=!0:"link"===r?l.link=!0:"tag"===r?l.image=!0:r.match(/^header(\-[1-6])?$/)&&(l[r.replace("header","heading")]=!0);return l}function u(e){var t=e.codemirror;t.setOption("fullScreen",!t.getOption("fullScreen")),t.getOption("fullScreen")?(U=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=U;var n=t.getWrapperElement();/fullscreen/.test(n.previousSibling.className)?n.previousSibling.className=n.previousSibling.className.replace(/\s*fullscreen\b/,""):n.previousSibling.className+=" fullscreen";n=e.toolbarElements.fullscreen;/active/.test(n.className)?n.className=n.className.replace(/\s*active\s*/g,""):n.className+=" active";t=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(t.className)&&T(e)}function r(e){O(e,"bold",e.options.blockStyles.bold)}function i(e){O(e,"italic",e.options.blockStyles.italic)}function o(e){O(e,"strikethrough","~~")}function l(e){function o(e){if("object"!=typeof e)throw"fencing_line() takes a 'line' object (not a line number, or line text).  Got: "+typeof e+": "+e;return e.styles&&e.styles[2]&&-1!==e.styles[2].indexOf("formatting-code-block")}function l(e){return e.state.base.base||e.state.base}function t(e,t,n,r,i){n=n||e.getLineHandle(t),r=r||e.getTokenAt({line:t,ch:1}),i=i||!!n.text&&e.getTokenAt({line:t,ch:n.text.length-1});t=r.type?r.type.split(" "):[];return i&&l(i).indentedCode?"indented":-1!==t.indexOf("comment")&&(l(r).fencedChars||l(i).fencedChars||o(n)?"fenced":"single")}var n,r,i,s,a,c,u,h,d,f,p,m=e.options.blockStyles.code,g=e.codemirror,v=g.getCursor("start"),y=g.getCursor("end"),x=g.getTokenAt({line:v.line,ch:v.ch||1}),b=g.getLineHandle(v.line),w=t(g,v.line,b,x);if("single"===w){e=b.text.slice(0,v.ch).replace("`",""),x=b.text.slice(v.ch).replace("`","");g.replaceRange(e+x,{line:v.line,ch:0},{line:v.line,ch:99999999999999}),v.ch--,v!==y&&y.ch--,g.setSelection(v,y),g.focus()}else if("fenced"===w)if(v.line!==y.line||v.ch!==y.ch){for(n=v.line;0<=n&&!o(b=g.getLineHandle(n));n--);var k,S,C,L=l(g.getTokenAt({line:n,ch:1})).fencedChars,T=o(g.getLineHandle(v.line))?(k="",v.line):o(g.getLineHandle(v.line-1))?(k="",v.line-1):(k=L+"\n",v.line);o(g.getLineHandle(y.line))?(S="",C=y.line,0===y.ch&&(C+=1)):C=(S=0!==y.ch&&o(g.getLineHandle(y.line+1))?"":L+"\n",y.line+1),0===y.ch&&--C,g.operation(function(){g.replaceRange(S,{line:C,ch:0},{line:C+(S?0:1),ch:0}),g.replaceRange(k,{line:T,ch:0},{line:T+(k?0:1),ch:0})}),g.setSelection({line:T+(k?1:0),ch:0},{line:C+(k?1:-1),ch:0}),g.focus()}else{L=v.line;if(o(g.getLineHandle(v.line))&&(L="fenced"===t(g,v.line+1)?(n=v.line,v.line+1):(r=v.line,v.line-1)),void 0===n)for(n=L;0<=n&&!o(b=g.getLineHandle(n));n--);if(void 0===r)for(i=g.lineCount(),r=L;r<i&&!o(b=g.getLineHandle(r));r++);g.operation(function(){g.replaceRange("",{line:n,ch:0},{line:n+1,ch:0}),g.replaceRange("",{line:r-1,ch:0},{line:r,ch:0})}),g.focus()}else if("indented"===w){if(v.line!==y.line||v.ch!==y.ch)n=v.line,r=y.line,0===y.ch&&r--;else{for(n=v.line;0<=n;n--)if(!(b=g.getLineHandle(n)).text.match(/^\s*$/)&&"indented"!==t(g,n,b)){n+=1;break}for(i=g.lineCount(),r=v.line;r<i;r++)if(!(b=g.getLineHandle(r)).text.match(/^\s*$/)&&"indented"!==t(g,r,b)){--r;break}}var M=g.getLineHandle(r+1),N=M&&g.getTokenAt({line:r+1,ch:M.text.length-1});N&&l(N).indentedCode&&g.replaceRange("\n",{line:r+1,ch:0});for(var A=n;A<=r;A++)g.indentLine(A,"subtract");g.focus()}else{M=v.line===y.line&&v.ch===y.ch&&0===v.ch,N=v.line!==y.line;M||N?(s=g,c=y,u=m,h=(a=v).line+1,d=c.line+1,f=a.line!==c.line,p=u+"\n",a="\n"+u,f&&d++,f&&0===c.ch&&(a=u+"\n",d--),E(s,!1,[p,a]),s.setSelection({line:h,ch:0},{line:d,ch:0})):E(g,!1,["`","`"])}}function s(e){A(e.codemirror,"quote")}function a(e){N(e.codemirror,"smaller")}function f(e){N(e.codemirror,"bigger")}function p(e){N(e.codemirror,void 0,1)}function m(e){N(e.codemirror,void 0,2)}function g(e){N(e.codemirror,void 0,3)}function v(e){A(e.codemirror,"unordered-list")}function y(e){A(e.codemirror,"ordered-list")}function x(e){!function(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(var t,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=(t=e.getLine(i)).replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}(e.codemirror)}function b(e){var t=e.codemirror,n=d(t),r=e.options,e="http://";return!(r.promptURLs&&!(e=prompt(r.promptTexts.link)))&&void E(t,n.link,r.insertTexts.link,e)}function w(e){var t=e.codemirror,n=d(t),r=e.options,e="http://";return!(r.promptURLs&&!(e=prompt(r.promptTexts.image)))&&void E(t,n.image,r.insertTexts.image,e)}function k(e){var t=e.codemirror,n=d(t),e=e.options;E(t,n.table,e.insertTexts.table)}function S(e){var t=e.codemirror,n=d(t),e=e.options;E(t,n.image,e.insertTexts.horizontalRule)}function C(e){e=e.codemirror;e.undo(),e.focus()}function L(e){e=e.codemirror;e.redo(),e.focus()}function T(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.nextSibling,i=e.toolbarElements["side-by-side"],o=!1;/editor-preview-active-side/.test(r.className)?(r.className=r.className.replace(/\s*editor-preview-active-side\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||u(e),r.className+=" editor-preview-active-side"},1),i.className+=" active",n.className+=" CodeMirror-sided",o=!0);i=n.lastChild;/editor-preview-active/.test(i.className)&&(i.className=i.className.replace(/\s*editor-preview-active\s*/g,""),i=e.toolbarElements.preview,n=n.previousSibling,i.className=i.className.replace(/\s*active\s*/g,""),n.className=n.className.replace(/\s*disabled-for-preview*/g,""));t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=function(){r.innerHTML=e.options.previewRender(e.value(),r)}),o?(r.innerHTML=e.options.previewRender(e.value(),r),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction),t.refresh()}function M(e){var t=e.codemirror,n=t.getWrapperElement(),r=n.previousSibling,i=!!e.options.toolbar&&e.toolbarElements.preview,o=n.lastChild;o&&/editor-preview/.test(o.className)||((o=document.createElement("div")).className="editor-preview",n.appendChild(o)),/editor-preview-active/.test(o.className)?(o.className=o.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){o.className+=" editor-preview-active"},1),i&&(i.className+=" active",r.className+=" disabled-for-preview")),o.innerHTML=e.options.previewRender(e.value(),o);t=t.getWrapperElement().nextSibling;/editor-preview-active-side/.test(t.className)&&T(e)}function E(e,t,n,r){var i,o,l,s;/editor-preview-active/.test(e.getWrapperElement().lastChild.className)||(o=n[0],l=n[1],s=e.getCursor("start"),n=e.getCursor("end"),r&&(l=l.replace("#url#",r)),t?(o=(i=e.getLine(s.line)).slice(0,s.ch),l=i.slice(s.ch),e.replaceRange(o+l,{line:s.line,ch:0})):(i=e.getSelection(),e.replaceSelection(o+i+l),s.ch+=o.length,s!==n&&(n.ch+=o.length)),e.setSelection(s,n),e.focus())}function N(e,t,n){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var r=e.getCursor("start"),i=e.getCursor("end"),o=r.line;o<=i.line;o++)l=o,a=s=void 0,s=(a=e.getLine(l)).search(/[^#]/),a=void 0!==t?s<=0?"bigger"==t?"###### "+a:"# "+a:6==s&&"smaller"==t?a.substr(7):1==s&&"bigger"==t?a.substr(2):"bigger"==t?a.substr(1):"#"+a:1==n?s<=0?"# "+a:s==n?a.substr(s+1):"# "+a.substr(s+1):2==n?s<=0?"## "+a:s==n?a.substr(s+1):"## "+a.substr(s+1):s<=0?"### "+a:s==n?a.substr(s+1):"### "+a.substr(s+1),e.replaceRange(a,{line:l,ch:0},{line:l,ch:99999999999999});e.focus()}var l,s,a}function A(e,t){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className)){for(var n=d(e),r=e.getCursor("start"),i=e.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},l={quote:"> ","unordered-list":"* ","ordered-list":"1. "},s=r.line;s<=i.line;s++)a=s,c=c=void 0,c=e.getLine(a),c=n[t]?c.replace(o[t],"$1"):l[t]+c,e.replaceRange(c,{line:a,ch:0},{line:a,ch:99999999999999});e.focus()}var a,c}function O(e,t,n,r){var i,o,l,s,a;/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)||(r=void 0===r?n:r,l=d(o=e.codemirror),s=n,a=r,e=o.getCursor("start"),r=o.getCursor("end"),l[t]?(s=(i=o.getLine(e.line)).slice(0,e.ch),a=i.slice(e.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),a=a.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),a=a.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),a=a.replace(/(\*\*|~~)/,"")),o.replaceRange(s+a,{line:e.line,ch:0},{line:e.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(e.ch-=2,e!==r&&(r.ch-=2)):"italic"==t&&(--e.ch,e!==r&&--r.ch)):(i=o.getSelection(),"bold"==t?i=(i=i.split("**").join("")).split("__").join(""):"italic"==t?i=(i=i.split("*").join("")).split("_").join(""):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+a),e.ch+=n.length,r.ch=e.ch+i.length),o.setSelection(e,r),o.focus())}function I(e){for(var t=1;t<arguments.length;t++)e=function e(t,n){for(var r in n)n.hasOwnProperty(r)&&(n[r]instanceof Array?t[r]=n[r].concat(t[r]instanceof Array?t[r]:[]):null!==n[r]&&"object"==typeof n[r]&&n[r].constructor===Object?t[r]=e(t[r]||{},n[r]):t[r]=n[r]);return t}(e,arguments[t]);return e}function R(e){var t=e.match(/[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g),n=0;if(null===t)return n;for(var r=0;r<t.length;r++)n+=19968<=t[r].charCodeAt(0)?t[r].length:1;return n}function P(e){(e=e||{}).parent=this;var t,n=!0;if(!1===e.autoDownloadFontAwesome&&(n=!1),!0!==e.autoDownloadFontAwesome)for(var r=document.styleSheets,i=0;i<r.length;i++)r[i].href&&-1<r[i].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")&&(n=!1);if(n&&((t=document.createElement("link")).rel="stylesheet",t.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(t)),e.element)this.element=e.element;else if(null===e.element)return void console.log("SimpleMDE: Error. No element was found.");if(void 0===e.toolbar)for(var o in e.toolbar=[],q)q.hasOwnProperty(o)&&(-1!=o.indexOf("separator-")&&e.toolbar.push("|"),(!0===q[o].default||e.showIcons&&e.showIcons.constructor===Array&&-1!=e.showIcons.indexOf(o))&&e.toolbar.push(o));e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){return this.parent.markdown(e)}),e.parsingConfig=I({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=I({},G,e.insertTexts||{}),e.promptTexts=Y,e.blockStyles=I({},$,e.blockStyles||{}),e.shortcuts=I({},z,e.shortcuts||{}),null!=e.autosave&&null!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&!0===this.options.autosave.foundSavedValue||this.value(e.initialValue)}function D(){if("object"==typeof localStorage){try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return}return 1}}var H=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js");var W=e("codemirror-spell-checker"),B=e("marked"),_=/Mac/.test(navigator.platform),F={toggleBold:r,toggleItalic:i,drawLink:b,toggleHeadingSmaller:a,toggleHeadingBigger:f,drawImage:w,toggleBlockquote:s,toggleOrderedList:y,toggleUnorderedList:v,toggleCodeBlock:l,togglePreview:M,toggleStrikethrough:o,toggleHeading1:p,toggleHeading2:m,toggleHeading3:g,cleanBlock:x,drawTable:k,drawHorizontalRule:S,undo:C,redo:L,toggleSideBySide:T,toggleFullScreen:u},z={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},j=function(e){for(var t in F)if(F[t]===e)return t;return null},U="",q={bold:{name:"bold",action:r,className:"fa fa-bold",title:"Bold",default:!0},italic:{name:"italic",action:i,className:"fa fa-italic",title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:o,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:a,className:"fa fa-header",title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:a,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:f,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:p,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:m,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:g,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:l,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:s,className:"fa fa-quote-left",title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:v,className:"fa fa-list-ul",title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:y,className:"fa fa-list-ol",title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:x,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:b,className:"fa fa-link",title:"Create Link",default:!0},image:{name:"image",action:w,className:"fa fa-picture-o",title:"Insert Image",default:!0},table:{name:"table",action:k,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:S,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:M,className:"fa fa-eye no-disable",title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:T,className:"fa fa-columns no-disable no-mobile",title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:u,className:"fa fa-arrows-alt no-disable no-mobile",title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://simplemde.com/markdown-guide",className:"fa fa-question-circle",title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:C,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:L,className:"fa fa-repeat no-disable",title:"Redo"}},G={link:["[","](#url#)"],image:["![](","#url#)"],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text     | Text     | Text     |\n\n"],horizontalRule:["","\n\n-----\n\n"]},Y={link:"URL for the link:",image:"URL of the image:"},$={bold:"**",code:"```",italic:"*"};P.prototype.markdown=function(e){if(B){var t={};return this.options&&this.options.renderingConfig&&!1===this.options.renderingConfig.singleLineBreaks?t.breaks=!1:t.breaks=!0,this.options&&this.options.renderingConfig&&!0===this.options.renderingConfig.codeSyntaxHighlighting&&window.hljs&&(t.highlight=function(e){return window.hljs.highlightAuto(e).value}),B.setOptions(t),B(e)}},P.prototype.render=function(e){if(e=e||(this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==e){this.element=e;var t,n,r,i,o=this.options,l=this,s={};for(t in o.shortcuts)null!==o.shortcuts[t]&&null!==F[t]&&function(e){s[c(o.shortcuts[e])]=function(){F[e](l)}}(t);s.Enter="newlineAndIndentContinueMarkdownList",s.Tab="tabAndIndentMarkdownList",s["Shift-Tab"]="shiftTabAndUnindentMarkdownList",s.Esc=function(e){e.getOption("fullScreen")&&u(l)},document.addEventListener("keydown",function(e){27==(e=e||window.event).keyCode&&l.codemirror.getOption("fullScreen")&&u(l)},!1),!1!==o.spellChecker?(n="spell-checker",(r=o.parsingConfig).name="gfm",r.gitHubSpice=!1,W({codeMirrorInstance:H})):((n=o.parsingConfig).name="gfm",n.gitHubSpice=!1),this.codemirror=H.fromTextArea(e,{mode:n,backdrop:r,theme:"paper",tabSize:null!=o.tabSize?o.tabSize:2,indentUnit:null!=o.tabSize?o.tabSize:2,indentWithTabs:!1!==o.indentWithTabs,lineNumbers:!1,autofocus:!0===o.autofocus,extraKeys:s,lineWrapping:!1!==o.lineWrapping,allowDropFileTypes:["text/plain"],placeholder:o.placeholder||e.getAttribute("placeholder")||"",styleSelectedText:null==o.styleSelectedText||o.styleSelectedText}),!0===o.forceSync&&(i=this.codemirror).on("change",function(){i.save()}),!(this.gui={})!==o.toolbar&&(this.gui.toolbar=this.createToolbar()),!1!==o.status&&(this.gui.statusbar=this.createStatusbar()),null!=o.autosave&&!0===o.autosave.enabled&&this.autosave(),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element;var a=this.codemirror;setTimeout(function(){a.refresh()}.bind(a),0)}},P.prototype.autosave=function(){var e,t,n,r,i,o;D()?null!=(e=this).options.autosave.uniqueId&&""!=this.options.autosave.uniqueId?(null!=e.element.form&&null!=e.element.form&&e.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+e.options.autosave.uniqueId)}),!0!==this.options.autosave.loaded&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),localStorage.setItem("smde_"+this.options.autosave.uniqueId,e.value()),null!=(t=document.getElementById("autosaved"))&&null!=t&&""!=t&&(i="am",12<=(o=n=(r=new Date).getHours())&&(o=n-12,i="pm"),0==o&&(o=12),r=(r=r.getMinutes())<10?"0"+r:r,t.innerHTML="Autosaved: "+o+":"+r+" "+i),this.autosaveTimeoutId=setTimeout(function(){e.autosave()},this.options.autosave.delay||1e4)):console.log("SimpleMDE: You must set a uniqueId to use the autosave feature"):console.log("SimpleMDE: localStorage not available, cannot autosave")},P.prototype.clearAutosavedValue=function(){D()?null!=this.options.autosave&&null!=this.options.autosave.uniqueId&&""!=this.options.autosave.uniqueId?localStorage.removeItem("smde_"+this.options.autosave.uniqueId):console.log("SimpleMDE: You must set a uniqueId to clear the autosave value"):console.log("SimpleMDE: localStorage not available, cannot autosave")},P.prototype.createSideBySide=function(){var t=this.codemirror,e=t.getWrapperElement(),n=e.nextSibling;n&&/editor-preview-side/.test(n.className)||((n=document.createElement("div")).className="editor-preview-side",e.parentNode.insertBefore(n,e.nextSibling));var r=!1,i=!1;return t.on("scroll",function(e){var t;r?r=!1:(i=!0,t=e.getScrollInfo().height-e.getScrollInfo().clientHeight,t=parseFloat(e.getScrollInfo().top)/t,t=(n.scrollHeight-n.clientHeight)*t,n.scrollTop=t)}),n.onscroll=function(){var e;i?i=!1:(r=!0,e=n.scrollHeight-n.clientHeight,e=parseFloat(n.scrollTop)/e,e=(t.getScrollInfo().height-t.getScrollInfo().clientHeight)*e,t.scrollTo(0,e))},n},P.prototype.createToolbar=function(e){if((e=e||this.options.toolbar)&&0!==e.length){for(var t=0;t<e.length;t++)null!=q[e[t]]&&(e[t]=q[e[t]]);var n=document.createElement("div");n.className="editor-toolbar";var r=this,i={};for(r.toolbar=e,t=0;t<e.length;t++)if(("guide"!=e[t].name||!1!==r.options.toolbarGuideIcon)&&!(r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[t].name)||("fullscreen"==e[t].name||"side-by-side"==e[t].name)&&(u=c=void 0,u=!1,c=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(c)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(c.substr(0,4)))&&(u=!0),u))){if("|"===e[t]){for(var o=!1,l=t+1;l<e.length;l++)"|"===e[l]||r.options.hideIcons&&-1!=r.options.hideIcons.indexOf(e[l].name)||(o=!0);if(!o)continue}!function(t){var e="|"===t?((e=document.createElement("i")).className="separator",e.innerHTML="|",e):h(t,r.options.toolbarTips,r.options.shortcuts);t.action&&("function"==typeof t.action?e.onclick=function(e){e.preventDefault(),t.action(r)}:"string"==typeof t.action&&(e.href=t.action,e.target="_blank")),i[t.name||t]=e,n.appendChild(e)}(e[t])}r.toolbarElements=i;var s=this.codemirror;s.on("cursorActivity",function(){var e,t,n,r=d(s);for(e in i)t=e,n=void 0,n=i[t],r[t]?n.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(n.className=n.className.replace(/\s*active\s*/g,""))});var a=s.getWrapperElement();return a.parentNode.insertBefore(n,a),n}var c,u},P.prototype.createStatusbar=function(e){e=e||this.options.status;var t=this.options,n=this.codemirror;if(e&&0!==e.length){for(var r,i,o,l=[],s=0;s<e.length;s++)i=r=void 0,"object"==typeof e[s]?l.push({className:e[s].className,defaultValue:e[s].defaultValue,onUpdate:e[s].onUpdate}):("words"===(o=e[s])?(i=function(e){e.innerHTML=R(n.getValue())},r=function(e){e.innerHTML=R(n.getValue())}):"lines"===o?(i=function(e){e.innerHTML=n.lineCount()},r=function(e){e.innerHTML=n.lineCount()}):"cursor"===o?(i=function(e){e.innerHTML="0:0"},r=function(e){var t=n.getCursor();e.innerHTML=t.line+":"+t.ch}):"autosave"===o&&(i=function(e){null!=t.autosave&&!0===t.autosave.enabled&&e.setAttribute("id","autosaved")}),l.push({className:o,defaultValue:i,onUpdate:r}));var a=document.createElement("div");for(a.className="editor-statusbar",s=0;s<l.length;s++){var c=l[s],u=document.createElement("span");u.className=c.className,"function"==typeof c.defaultValue&&c.defaultValue(u),"function"==typeof c.onUpdate&&this.codemirror.on("update",function(e,t){return function(){t.onUpdate(e)}}(u,c)),a.appendChild(u)}var h=this.codemirror.getWrapperElement();return h.parentNode.insertBefore(a,h.nextSibling),a}},P.prototype.value=function(e){return void 0===e?this.codemirror.getValue():(this.codemirror.getDoc().setValue(e),this)},P.toggleBold=r,P.toggleItalic=i,P.toggleStrikethrough=o,P.toggleBlockquote=s,P.toggleHeadingSmaller=a,P.toggleHeadingBigger=f,P.toggleHeading1=p,P.toggleHeading2=m,P.toggleHeading3=g,P.toggleCodeBlock=l,P.toggleUnorderedList=v,P.toggleOrderedList=y,P.cleanBlock=x,P.drawLink=b,P.drawImage=w,P.drawTable=k,P.drawHorizontalRule=S,P.undo=C,P.redo=L,P.togglePreview=M,P.toggleSideBySide=T,P.toggleFullScreen=u,P.prototype.toggleBold=function(){r(this)},P.prototype.toggleItalic=function(){i(this)},P.prototype.toggleStrikethrough=function(){o(this)},P.prototype.toggleBlockquote=function(){s(this)},P.prototype.toggleHeadingSmaller=function(){a(this)},P.prototype.toggleHeadingBigger=function(){f(this)},P.prototype.toggleHeading1=function(){p(this)},P.prototype.toggleHeading2=function(){m(this)},P.prototype.toggleHeading3=function(){g(this)},P.prototype.toggleCodeBlock=function(){l(this)},P.prototype.toggleUnorderedList=function(){v(this)},P.prototype.toggleOrderedList=function(){y(this)},P.prototype.cleanBlock=function(){x(this)},P.prototype.drawLink=function(){b(this)},P.prototype.drawImage=function(){w(this)},P.prototype.drawTable=function(){k(this)},P.prototype.drawHorizontalRule=function(){S(this)},P.prototype.undo=function(){C(this)},P.prototype.redo=function(){L(this)},P.prototype.togglePreview=function(){M(this)},P.prototype.toggleSideBySide=function(){T(this)},P.prototype.toggleFullScreen=function(){u(this)},P.prototype.isPreviewActive=function(){var e=this.codemirror.getWrapperElement().lastChild;return/editor-preview-active/.test(e.className)},P.prototype.isSideBySideActive=function(){var e=this.codemirror.getWrapperElement().nextSibling;return/editor-preview-active-side/.test(e.className)},P.prototype.isFullscreenActive=function(){return this.codemirror.getOption("fullScreen")},P.prototype.getState=function(){return d(this.codemirror)},P.prototype.toTextArea=function(){var e=this.codemirror,t=e.getWrapperElement();t.parentNode&&(this.gui.toolbar&&t.parentNode.removeChild(this.gui.toolbar),this.gui.statusbar&&t.parentNode.removeChild(this.gui.statusbar),this.gui.sideBySide&&t.parentNode.removeChild(this.gui.sideBySide)),e.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},t.exports=P},{"./codemirror/tablist":19,codemirror:10,"codemirror-spell-checker":4,"codemirror/addon/display/fullscreen.js":5,"codemirror/addon/display/placeholder.js":6,"codemirror/addon/edit/continuelist.js":7,"codemirror/addon/mode/overlay.js":8,"codemirror/addon/selection/mark-selection.js":9,"codemirror/mode/gfm/gfm.js":11,"codemirror/mode/markdown/markdown.js":12,"codemirror/mode/xml/xml.js":14,marked:17}]},{},[20])(20)});