From 00c3b32e2db200a2f42396ac7f8381704ec97268 Mon Sep 17 00:00:00 2001 From: Paweł Bernaciak Date: Fri, 10 Feb 2023 16:19:46 +0100 Subject: Initial Commit --- CoreWiki/wwwroot/lib/simplemde/simplemde.min.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CoreWiki/wwwroot/lib/simplemde/simplemde.min.js (limited to 'CoreWiki/wwwroot/lib/simplemde/simplemde.min.js') diff --git a/CoreWiki/wwwroot/lib/simplemde/simplemde.min.js b/CoreWiki/wwwroot/lib/simplemde/simplemde.min.js new file mode 100644 index 0000000..3ee148a --- /dev/null +++ b/CoreWiki/wwwroot/lib/simplemde/simplemde.min.js @@ -0,0 +1,7 @@ +/** + * simplemde v1.11.2 + * Copyright Next Step Webs, Inc. + * @link https://github.com/NextStepWebs/simplemde-markdown-editor + * @license MIT + */ +!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this;t.SimpleMDE=n()}}(function(){var n;return function t(n,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!n[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};n[f][0].call(s.exports,function(t){var i=n[f][1][t];return u(i?i:t)},s,s.exports,t,n,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;fn;++n)u[n]=t[n],r[t.charCodeAt(n)]=n;r["-".charCodeAt(0)]=62;r["_".charCodeAt(0)]=63}function e(n){var t,s,h,i,o,u,e=n.length,f;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");for(o="="===n[e-2]?2:"="===n[e-1]?1:0,u=new c(3*e/4-o),h=o>0?e-4:e,f=0,t=0,s=0;h>t;t+=4,s+=3)i=r[n.charCodeAt(t)]<<18|r[n.charCodeAt(t+1)]<<12|r[n.charCodeAt(t+2)]<<6|r[n.charCodeAt(t+3)],u[f++]=i>>16&255,u[f++]=i>>8&255,u[f++]=255&i;return 2===o?(i=r[n.charCodeAt(t)]<<2|r[n.charCodeAt(t+1)]>>4,u[f++]=255&i):1===o&&(i=r[n.charCodeAt(t)]<<10|r[n.charCodeAt(t+1)]<<4|r[n.charCodeAt(t+2)]>>2,u[f++]=i>>8&255,u[f++]=255&i),u}function o(n){return u[n>>18&63]+u[n>>12&63]+u[n>>6&63]+u[63&n]}function s(n,t,i){for(var u,f=[],r=t;i>r;r+=3)u=(n[r]<<16)+(n[r+1]<<8)+n[r+2],f.push(o(u));return f.join("")}function h(n){for(var i,r=n.length,e=r%3,t="",o=[],h=16383,f=0,c=r-e;c>f;f+=h)o.push(s(n,f,f+h>c?c:f+h));return 1===e?(i=n[r-1],t+=u[i>>2],t+=u[i<<4&63],t+="=="):2===e&&(i=(n[r-2]<<8)+n[r-1],t+=u[i>>10],t+=u[i>>4&63],t+=u[i<<2&63],t+="="),o.push(t),o.join("")}i.toByteArray=e;i.fromByteArray=h;var u=[],r=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array;f()},{}],2:[function(){},{}],3:[function(n,t,i){(function(t){"use strict";function ct(){try{var n=new Uint8Array(1);return n.foo=function(){return 42},42===n.foo()&&"function"==typeof n.subarray&&0===n.subarray(1,1).byteLength}catch(t){return!1}}function s(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function e(n,t){if(s()=t?e(n,t):void 0!==i?"string"==typeof r?e(n,t).fill(i,r):e(n,t).fill(i):e(n,t)}function v(n,t){if(g(t),n=e(n,0>t?0:0|p(t)),!r.TYPED_ARRAY_SUPPORT)for(var i=0;t>i;i++)n[i]=0;return n}function at(n,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!r.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var u=0|nt(t,i);return n=e(n,u),n.write(t,i),n}function y(n,t){var r=0|p(t.length),i;for(n=e(n,r),i=0;r>i;i+=1)n[i]=255&t[i];return n}function vt(n,t,i,u){if(t.byteLength,0>i||t.byteLength=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|n}function pt(n){return+n!=n&&(n=0),r.alloc(+n)}function nt(n,t){var i,u;if(r.isBuffer(n))return n.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;if("string"!=typeof n&&(n=""+n),i=n.length,0===i)return 0;for(u=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return i;case"utf8":case"utf-8":case void 0:return l(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return ot(n).length;default:if(u)return l(n).length;t=(""+t).toLowerCase();u=!0}}function wt(n,t,i){var r=!1;if(((void 0===t||0>t)&&(t=0),t>this.length)||((void 0===i||i>this.length)&&(i=this.length),0>=i)||(i>>>=0,t>>>=0,t>=i))return"";for(n||(n="utf8");;)switch(n){case"hex":return fi(this,t,i);case"utf8":case"utf-8":return rt(this,t,i);case"ascii":return ri(this,t,i);case"binary":return ui(this,t,i);case"base64":return ti(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ei(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase();r=!0}}function w(n,t,i){var r=n[t];n[t]=n[i];n[i]=r}function tt(n,t,i,r){function o(n,t){return 1===e?n[t]:n.readUInt16BE(t*e)}var e=1,s=n.length,h=t.length,u,f;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(n.length<2||t.length<2)return-1;e=2;s/=2;h/=2;i/=2}for(u=-1,f=0;s>i+f;f++)if(o(n,i+f)===o(t,-1===u?0:f-u)){if(-1===u&&(u=f),f-u+1===h)return(i+u)*e}else-1!==u&&(f-=f-u),u=-1;return-1}function bt(n,t,i,r){var f,e,u,o;if(i=Number(i)||0,f=n.length-i,r?(r=Number(r),r>f&&(r=f)):r=f,e=t.length,e%2!=0)throw new Error("Invalid hex string");for(r>e/2&&(r=e/2),u=0;r>u;u++){if(o=parseInt(t.substr(2*u,2),16),isNaN(o))return u;n[i+u]=o}return u}function kt(n,t,i,r){return a(l(t,n.length-i),n,i,r)}function it(n,t,i,r){return a(ci(t),n,i,r)}function dt(n,t,i,r){return it(n,t,i,r)}function gt(n,t,i,r){return a(ot(t),n,i,r)}function ni(n,t,i,r){return a(li(t,n.length-i),n,i,r)}function ti(n,t,i){return 0===t&&i===n.length?b.fromByteArray(n):b.fromByteArray(n.slice(t,i))}function rt(n,t,i){var h,f,e,s,l,u;for(i=Math.min(n.length,i),h=[],f=t;i>f;){var o=n[f],r=null,c=o>239?4:o>223?3:o>191?2:1;if(i>=f+c)switch(c){case 1:128>o&&(r=o);break;case 2:e=n[f+1];128==(192&e)&&(u=(31&o)<<6|63&e,u>127&&(r=u));break;case 3:e=n[f+1];s=n[f+2];128==(192&e)&&128==(192&s)&&(u=(15&o)<<12|(63&e)<<6|63&s,u>2047&&(55296>u||u>57343)&&(r=u));break;case 4:e=n[f+1];s=n[f+2];l=n[f+3];128==(192&e)&&128==(192&s)&&128==(192&l)&&(u=(15&o)<<18|(63&e)<<12|(63&s)<<6|63&l,u>65535&&1114112>u&&(r=u))}null===r?(r=65533,c=1):r>65535&&(r-=65536,h.push(r>>>10&1023|55296),r=56320|1023&r);h.push(r);f+=c}return ii(h)}function ii(n){var r=n.length,i,t;if(k>=r)return String.fromCharCode.apply(String,n);for(i="",t=0;r>t;)i+=String.fromCharCode.apply(String,n.slice(t,t+=k));return i}function ri(n,t,i){var u="",r;for(i=Math.min(n.length,i),r=t;i>r;r++)u+=String.fromCharCode(127&n[r]);return u}function ui(n,t,i){var u="",r;for(i=Math.min(n.length,i),r=t;i>r;r++)u+=String.fromCharCode(n[r]);return u}function fi(n,t,i){var f=n.length,u,r;for((!t||0>t)&&(t=0),(!i||0>i||i>f)&&(i=f),u="",r=t;i>r;r++)u+=hi(n[r]);return u}function ei(n,t,i){for(var u=n.slice(t,i),f="",r=0;rn)throw new RangeError("offset is not uint");if(n+t>i)throw new RangeError("Trying to access beyond buffer length");}function f(n,t,i,u,f,e){if(!r.isBuffer(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||e>t)throw new RangeError('"value" argument is out of bounds');if(i+u>n.length)throw new RangeError("Index out of range");}function h(n,t,i,r){0>t&&(t=65535+t+1);for(var u=0,f=Math.min(n.length-i,2);f>u;u++)n[i+u]=(t&255<<8*(r?u:1-u))>>>8*(r?u:1-u)}function c(n,t,i,r){0>t&&(t=4294967295+t+1);for(var u=0,f=Math.min(n.length-i,4);f>u;u++)n[i+u]=t>>>8*(r?u:3-u)&255}function ut(n,t,i,r){if(i+r>n.length)throw new RangeError("Index out of range");if(0>i)throw new RangeError("Index out of range");}function ft(n,t,i,r,u){return u||ut(n,t,i,4,34028234663852886e22,-34028234663852886e22),o.write(n,t,i,r,23,4),i+4}function et(n,t,i,r,u){return u||ut(n,t,i,8,17976931348623157e292,-17976931348623157e292),o.write(n,t,i,r,52,8),i+8}function oi(n){if(n=si(n).replace(ht,""),n.length<2)return"";for(;n.length%4!=0;)n+="=";return n}function si(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function hi(n){return 16>n?"0"+n.toString(16):n.toString(16)}function l(n,t){t=t||1/0;for(var i,e=n.length,u=null,r=[],f=0;e>f;f++){if(i=n.charCodeAt(f),i>55295&&57344>i){if(!u){if(i>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(f+1===e){(t-=3)>-1&&r.push(239,191,189);continue}u=i;continue}if(56320>i){(t-=3)>-1&&r.push(239,191,189);u=i;continue}i=(u-55296<<10|i-56320)+65536}else u&&(t-=3)>-1&&r.push(239,191,189);if(u=null,128>i){if((t-=1)<0)break;r.push(i)}else if(2048>i){if((t-=2)<0)break;r.push(i>>6|192,63&i|128)}else if(65536>i){if((t-=3)<0)break;r.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(1114112>i))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return r}function ci(n){for(var i=[],t=0;t>8,e=i%256,r.push(e),r.push(f);return r}function ot(n){return b.toByteArray(oi(n))}function a(n,t,i,r){for(var u=0;r>u&&!(u+i>=t.length||u>=n.length);u++)t[u+i]=n[u];return u}function ai(n){return n!==n}var b=n("base64-js"),o=n("ieee754"),st=n("isarray"),k,ht;i.Buffer=r;i.SlowBuffer=pt;i.INSPECT_MAX_BYTES=50;r.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:ct();i.kMaxLength=s();r.poolSize=8192;r._augment=function(n){return n.__proto__=r.prototype,n};r.from=function(n,t,i){return d(null,n,t,i)};r.TYPED_ARRAY_SUPPORT&&(r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0}));r.alloc=function(n,t,i){return lt(null,n,t,i)};r.allocUnsafe=function(n){return v(null,n)};r.allocUnsafeSlow=function(n){return v(null,n)};r.isBuffer=function(n){return!(null==n||!n._isBuffer)};r.compare=function(n,t){if(!r.isBuffer(n)||!r.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(n===t)return 0;for(var u=n.length,f=t.length,i=0,e=Math.min(u,f);e>i;++i)if(n[i]!==t[i]){u=n[i];f=t[i];break}return f>u?-1:u>f?1:0};r.isEncoding=function(n){switch(String(n).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}};r.concat=function(n,t){var i,f,e,u;if(!st(n))throw new TypeError('"list" argument must be an Array of Buffers');if(0===n.length)return r.alloc(0);if(void 0===t)for(t=0,i=0;in;n+=2)w(this,n,n+1);return this};r.prototype.swap32=function(){var t=this.length,n;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(n=0;t>n;n+=4)w(this,n,n+3),w(this,n+1,n+2);return this};r.prototype.toString=function(){var n=0|this.length;return 0===n?"":0===arguments.length?rt(this,0,n):wt.apply(this,arguments)};r.prototype.equals=function(n){if(!r.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:0===r.compare(this,n)};r.prototype.inspect=function(){var n="",t=i.INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(n+=" ... ")),""};r.prototype.compare=function(n,t,i,u,f){if(!r.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=n?n.length:0),void 0===u&&(u=0),void 0===f&&(f=this.length),0>t||i>n.length||0>u||f>this.length)throw new RangeError("out of range index");if(u>=f&&t>=i)return 0;if(u>=f)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,u>>>=0,f>>>=0,this===n)return 0;for(var o=f-u,s=i-t,l=Math.min(o,s),h=this.slice(u,f),c=n.slice(t,i),e=0;l>e;++e)if(h[e]!==c[e]){o=h[e];s=c[e];break}return s>o?-1:o>s?1:0};r.prototype.indexOf=function(n,t,i){if(("string"==typeof t?(i=t,t=0):t>2147483647?t=2147483647:-2147483648>t&&(t=-2147483648),t>>=0,0===this.length)||t>=this.length)return-1;if(0>t&&(t=Math.max(this.length+t,0)),"string"==typeof n&&(n=r.from(n,i)),r.isBuffer(n))return 0===n.length?-1:tt(this,n,t,i);if("number"==typeof n)return r.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,n,t):tt(this,[n],t,i);throw new TypeError("val must be string, number or Buffer");};r.prototype.includes=function(n,t,i){return-1!==this.indexOf(n,t,i)};r.prototype.write=function(n,t,i,r){var u,f;if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t;isFinite(i)?(i=0|i,void 0===r&&(r="utf8")):(r=i,i=void 0)}if(u=this.length-t,(void 0===i||i>u)&&(i=u),n.length>0&&(0>i||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");for(r||(r="utf8"),f=!1;;)switch(r){case"hex":return bt(this,n,t,i);case"utf8":case"utf-8":return kt(this,n,t,i);case"ascii":return it(this,n,t,i);case"binary":return dt(this,n,t,i);case"base64":return gt(this,n,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ni(this,n,t,i);default:if(f)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();f=!0}};r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};k=4096;r.prototype.slice=function(n,t){var i=this.length,u,e,f;if(n=~~n,t=void 0===t?i:~~t,0>n?(n+=i,0>n&&(n=0)):n>i&&(n=i),0>t?(t+=i,0>t&&(t=0)):t>i&&(t=i),n>t&&(t=n),r.TYPED_ARRAY_SUPPORT)u=this.subarray(n,t),u.__proto__=r.prototype;else for(e=t-n,u=new r(e,void 0),f=0;e>f;f++)u[f]=this[f+n];return u};r.prototype.readUIntLE=function(n,t,i){n=0|n;t=0|t;i||u(n,t,this.length);for(var r=this[n],f=1,e=0;++e0&&(f*=256);)r+=this[n+--t]*f;return r};r.prototype.readUInt8=function(n,t){return t||u(n,1,this.length),this[n]};r.prototype.readUInt16LE=function(n,t){return t||u(n,2,this.length),this[n]|this[n+1]<<8};r.prototype.readUInt16BE=function(n,t){return t||u(n,2,this.length),this[n]<<8|this[n+1]};r.prototype.readUInt32LE=function(n,t){return t||u(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+16777216*this[n+3]};r.prototype.readUInt32BE=function(n,t){return t||u(n,4,this.length),16777216*this[n]+(this[n+1]<<16|this[n+2]<<8|this[n+3])};r.prototype.readIntLE=function(n,t,i){n=0|n;t=0|t;i||u(n,t,this.length);for(var r=this[n],f=1,e=0;++e=f&&(r-=Math.pow(2,8*t)),r};r.prototype.readIntBE=function(n,t,i){n=0|n;t=0|t;i||u(n,t,this.length);for(var e=t,r=1,f=this[n+--e];e>0&&(r*=256);)f+=this[n+--e]*r;return r*=128,f>=r&&(f-=Math.pow(2,8*t)),f};r.prototype.readInt8=function(n,t){return t||u(n,1,this.length),128&this[n]?-1*(256-this[n]):this[n]};r.prototype.readInt16LE=function(n,t){t||u(n,2,this.length);var i=this[n]|this[n+1]<<8;return 32768&i?4294901760|i:i};r.prototype.readInt16BE=function(n,t){t||u(n,2,this.length);var i=this[n+1]|this[n]<<8;return 32768&i?4294901760|i:i};r.prototype.readInt32LE=function(n,t){return t||u(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24};r.prototype.readInt32BE=function(n,t){return t||u(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]};r.prototype.readFloatLE=function(n,t){return t||u(n,4,this.length),o.read(this,n,!0,23,4)};r.prototype.readFloatBE=function(n,t){return t||u(n,4,this.length),o.read(this,n,!1,23,4)};r.prototype.readDoubleLE=function(n,t){return t||u(n,8,this.length),o.read(this,n,!0,52,8)};r.prototype.readDoubleBE=function(n,t){return t||u(n,8,this.length),o.read(this,n,!1,52,8)};r.prototype.writeUIntLE=function(n,t,i,r){var o,u,e;for((n=+n,t=0|t,i=0|i,r)||(o=Math.pow(2,8*i)-1,f(this,n,t,i,o,0)),u=1,e=0,this[t]=255&n;++e=0&&(e*=256);)this[t+u]=n/e&255;return t+i};r.prototype.writeUInt8=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,1,255,0),r.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[t]=255&n,t+1};r.prototype.writeUInt16LE=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8):h(this,n,t,!0),t+2};r.prototype.writeUInt16BE=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[t]=n>>>8,this[t+1]=255&n):h(this,n,t,!1),t+2};r.prototype.writeUInt32LE=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t+3]=n>>>24,this[t+2]=n>>>16,this[t+1]=n>>>8,this[t]=255&n):c(this,n,t,!0),t+4};r.prototype.writeUInt32BE=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[t]=n>>>24,this[t+1]=n>>>16,this[t+2]=n>>>8,this[t+3]=255&n):c(this,n,t,!1),t+4};r.prototype.writeIntLE=function(n,t,i,r){var u;(n=+n,t=0|t,r)||(u=Math.pow(2,8*i-1),f(this,n,t,i,u-1,-u));var e=0,s=1,o=0;for(this[t]=255&n;++en&&0===o&&0!==this[t+e-1]&&(o=1),this[t+e]=(n/s>>0)-o&255;return t+i};r.prototype.writeIntBE=function(n,t,i,r){var e;(n=+n,t=0|t,r)||(e=Math.pow(2,8*i-1),f(this,n,t,i,e-1,-e));var u=i-1,s=1,o=0;for(this[t+u]=255&n;--u>=0&&(s*=256);)0>n&&0===o&&0!==this[t+u+1]&&(o=1),this[t+u]=(n/s>>0)-o&255;return t+i};r.prototype.writeInt8=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,1,127,-128),r.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),0>n&&(n=255+n+1),this[t]=255&n,t+1};r.prototype.writeInt16LE=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8):h(this,n,t,!0),t+2};r.prototype.writeInt16BE=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[t]=n>>>8,this[t+1]=255&n):h(this,n,t,!1),t+2};r.prototype.writeInt32LE=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8,this[t+2]=n>>>16,this[t+3]=n>>>24):c(this,n,t,!0),t+4};r.prototype.writeInt32BE=function(n,t,i){return n=+n,t=0|t,i||f(this,n,t,4,2147483647,-2147483648),0>n&&(n=4294967295+n+1),r.TYPED_ARRAY_SUPPORT?(this[t]=n>>>24,this[t+1]=n>>>16,this[t+2]=n>>>8,this[t+3]=255&n):c(this,n,t,!1),t+4};r.prototype.writeFloatLE=function(n,t,i){return ft(this,n,t,!0,i)};r.prototype.writeFloatBE=function(n,t,i){return ft(this,n,t,!1,i)};r.prototype.writeDoubleLE=function(n,t,i){return et(this,n,t,!0,i)};r.prototype.writeDoubleBE=function(n,t,i){return et(this,n,t,!1,i)};r.prototype.copy=function(n,t,i,u){if((i||(i=0),u||0===u||(u=this.length),t>=n.length&&(t=n.length),t||(t=0),u>0&&i>u&&(u=i),u===i)||0===n.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>i||i>=this.length)throw new RangeError("sourceStart out of bounds");if(0>u)throw new RangeError("sourceEnd out of bounds");u>this.length&&(u=this.length);n.length-ti&&u>t)for(f=e-1;f>=0;f--)n[f+t]=this[f+i];else if(1e3>e||!r.TYPED_ARRAY_SUPPORT)for(f=0;e>f;f++)n[f+t]=this[f+i];else Uint8Array.prototype.set.call(n,this.subarray(i,i+e),t);return e};r.prototype.fill=function(n,t,i,u){var e,f,o,s;if("string"==typeof n){if(("string"==typeof t?(u=t,t=0,i=this.length):"string"==typeof i&&(u=i,i=this.length),1===n.length)&&(e=n.charCodeAt(0),256>e&&(n=e)),void 0!==u&&"string"!=typeof u)throw new TypeError("encoding must be a string");if("string"==typeof u&&!r.isEncoding(u))throw new TypeError("Unknown encoding: "+u);}else"number"==typeof n&&(n=255&n);if(0>t||this.length=i)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,n||(n=0),"number"==typeof n)for(f=t;i>f;f++)this[f]=n;else for(o=r.isBuffer(n)?n:l(new r(n,u).toString()),s=o.length,f=0;i-t>f;f++)this[f+t]=o[f%s];return this};ht=/[^+\/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(n,t){"use strict";function i(n){return n=n||{},"function"!=typeof n.codeMirrorInstance||"function"!=typeof n.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 n.codeMirrorInstance.defineMode("spell-checker",function(t){var u,f;i.aff_loading||(i.aff_loading=!0,u=new XMLHttpRequest,u.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),u.onload=function(){4===u.readyState&&200===u.status&&(i.aff_data=u.responseText,i.num_loaded++,2==i.num_loaded&&(i.typo=new r("en_US",i.aff_data,i.dic_data,{platform:"any"})))},u.send(null));i.dic_loading||(i.dic_loading=!0,f=new XMLHttpRequest,f.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),f.onload=function(){4===f.readyState&&200===f.status&&(i.dic_data=f.responseText,i.num_loaded++,2==i.num_loaded&&(i.typo=new r("en_US",i.aff_data,i.dic_data,{platform:"any"})))},f.send(null));var e='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',o={token:function(n){var t=n.peek(),r="";if(e.includes(t))return n.next(),null;for(;null!=(t=n.peek())&&!e.includes(t);)r+=t,n.next();return i.typo&&!i.typo.check(r)?"spell-error":null}},s=n.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return n.codeMirrorInstance.overlayMode(s,o,!0)}))}var r=n("typo-js");i.num_loaded=0;i.aff_loading=!1;i.dic_loading=!1;i.aff_data="";i.dic_data="";i.typo;t.exports=i},{"typo-js":18}],5:[function(t,i,r){!function(u){"object"==typeof r&&"object"==typeof i?u(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n(["../../lib/codemirror"],u):u(CodeMirror)}(function(n){"use strict";function t(n){var t=n.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 i(n){var i=n.getWrapperElement(),t;i.className=i.className.replace(/\s*CodeMirror-fullscreen\b/,"");document.documentElement.style.overflow="";t=n.state.fullScreenRestore;i.style.width=t.width;i.style.height=t.height;window.scrollTo(t.scrollLeft,t.scrollTop);n.refresh()}n.defineOption("fullScreen",!1,function(r,u,f){f==n.Init&&(f=!1);!f!=!u&&(u?t(r):i(r))})})},{"../../lib/codemirror":10}],6:[function(t,i,r){!function(u){"object"==typeof r&&"object"==typeof i?u(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n(["../../lib/codemirror"],u):u(CodeMirror)}(function(n){function i(n){n.state.placeholder&&(n.state.placeholder.parentNode.removeChild(n.state.placeholder),n.state.placeholder=null)}function u(n){var t,r;i(n);t=n.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible";t.className="CodeMirror-placeholder";r=n.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r));t.appendChild(r);n.display.lineSpace.insertBefore(t,n.display.lineSpace.firstChild)}function r(n){f(n)&&u(n)}function t(n){var t=n.getWrapperElement(),r=f(n);t.className=t.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":"");r?u(n):i(n)}function f(n){return 1===n.lineCount()&&""===n.getLine(0)}n.defineOption("placeholder","",function(u,f,e){var s=e&&e!=n.Init,o;f&&!s?(u.on("blur",r),u.on("change",t),u.on("swapDoc",t),t(u)):!f&&s&&(u.off("blur",r),u.off("change",t),u.off("swapDoc",t),i(u),o=u.getWrapperElement(),o.className=o.className.replace(" CodeMirror-empty",""));f&&!u.hasFocus()&&r(u)})})},{"../../lib/codemirror":10}],7:[function(t,i,r){!function(u){"object"==typeof r&&"object"==typeof i?u(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n(["../../lib/codemirror"],u):u(CodeMirror)}(function(n){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,i=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;n.commands.newlineAndIndentContinueMarkdownList=function(u){if(u.getOption("disableInput"))return n.Pass;for(var s=u.listSelections(),h=[],e=0;e")>=0?f[2]:parseInt(f[3],10)+1+f[4];h[e]="\n"+y+w+p}}u.replaceSelections(h)}})},{"../../lib/codemirror":10}],8:[function(t,i,r){!function(u){"object"==typeof r&&"object"==typeof i?u(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n(["../../lib/codemirror"],u):u(CodeMirror)}(function(n){"use strict";n.overlayMode=function(t,i,r){return{startState:function(){return{base:n.startState(t),overlay:n.startState(i),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:n.copyState(t,r.base),overlay:n.copyState(i,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(n,u){return(n!=u.streamSeen||Math.min(u.basePos,u.overlayPos)=r.line,y=c?r:s(o,0),l=n.markText(v,y,{className:a});if(null==f?h.push(l):h.splice(f++,0,l),c)break;e=o}}function r(n){for(var t=n.state.markedSelection,i=0;i1)return f(n);var h=n.getCursor("start"),c=n.getCursor("end"),e=n.state.markedSelection;if(!e.length)return i(n,h,c);if(o=e[0].find(),s=e[e.length-1].find(),!o||!s||c.line-h.line=0||t(c,o.from)<=0)return f(n);for(;t(h,o.from)>0;)e.shift().clear(),o=e[0].find();for(t(h,o.from)<0&&(o.to.line-h.line0&&(c.line-s.from.linea&&setTimeout(function(){o.display.input.reset(!0)},20);yb(this);wd();lr(this);this.curOp.forceUpdate=!0;ay(this,r);i.autofocus&&!lf||o.hasFocus()?setTimeout(sf(sh,this),20):du(this);for(f in iu)iu.hasOwnProperty(f)&&iu[f](this,i[f],vp);for(nl(this),i.finishInit&&i.finishInit(this),e=0;ea&&(u.gutters.style.zIndex=-1,u.scroller.style.paddingRight=0);w||ci&&lf||(u.scroller.draggable=!0);n&&(n.appendChild?n.appendChild(u.wrapper):n(u.wrapper));u.viewFrom=u.viewTo=t.first;u.reportedViewFrom=u.reportedViewTo=t.first;u.view=[];u.renderedView=null;u.externalMeasured=null;u.viewOffset=0;u.lastWrapHeight=u.lastWrapWidth=0;u.updateLineNumbers=null;u.nativeBarWidth=u.barHeight=u.barWidth=0;u.scrollbarsClipped=!1;u.lineNumWidth=u.lineNumInnerWidth=u.lineNumChars=null;u.alignWidgets=!1;u.cachedCharWidth=u.cachedTextHeight=u.cachedPaddingH=null;u.maxLine=null;u.maxLineLength=0;u.maxLineChanged=!1;u.wheelDX=u.wheelDY=u.wheelStartX=u.wheelStartY=null;u.shift=!1;u.selForContextMenu=null;u.activeTouch=null;r.init(u)}function ns(n){n.doc.mode=t.getMode(n.options,n.doc.modeOption);ou(n)}function ou(n){n.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null);n.styles&&(n.styles=null)});n.doc.frontier=n.doc.first;yu(n,100);n.state.modeGen++;n.curOp&&tt(n)}function ow(n){n.options.lineWrapping?(ne(n.display.wrapper,"CodeMirror-wrap"),n.display.sizer.style.minWidth="",n.display.sizerWidth=null):(gf(n.display.wrapper,"CodeMirror-wrap"),rs(n));ts(n);tt(n);wu(n);setTimeout(function(){sr(n)},100)}function wc(n){var t=yi(n.display),i=n.options.lineWrapping,r=i&&Math.max(5,n.display.scroller.clientWidth/bu(n.display)-3);return function(u){var e,f;if(bi(n.doc,u))return 0;if(e=0,u.widgets)for(f=0;ft.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}function us(n){var t=d(n.gutters,"CodeMirror-linenumbers");-1==t&&n.lineNumbers?n.gutters=n.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!n.lineNumbers&&(n.gutters=n.gutters.slice(0),n.gutters.splice(t,1))}function hu(n){var t=n.display,i=t.gutters.offsetWidth,r=Math.round(n.doc.height+th(n.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:n.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+wt(n)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}function fs(n,t,r){this.cm=r;var f=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n(f);n(e);u(f,"scroll",function(){f.clientHeight&&t(f.scrollTop,"vertical")});u(e,"scroll",function(){e.clientWidth&&t(e.scrollLeft,"horizontal")});this.checkedZeroWidth=!1;s&&8>a&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function es(){}function dc(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&gf(n.display.wrapper,n.display.scrollbars.addClass));n.display.scrollbars=new t.scrollbarModel[n.options.scrollbarStyle](function(t){n.display.wrapper.insertBefore(t,n.display.scrollbarFiller);u(t,"mousedown",function(){n.state.focused&&setTimeout(function(){n.display.input.focus()},0)});t.setAttribute("cm-not-content","true")},function(t,i){"horizontal"==i?vr(n,t):ku(n,t)},n);n.display.scrollbars.addClass&&ne(n.display.wrapper,n.display.scrollbars.addClass)}function sr(n,t){var i,r,u;for(t||(t=hu(n)),i=n.display.barWidth,r=n.display.barHeight,gc(n,t),u=0;4>u&&i!=n.display.barWidth||r!=n.display.barHeight;u++)i!=n.display.barWidth&&n.options.lineWrapping&&ue(n),gc(n,hu(n)),i=n.display.barWidth,r=n.display.barHeight}function gc(n,t){var i=n.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px";i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px";i.heightForcer.style.borderBottom=r.bottom+"px solid transparent";r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="";r.bottom&&n.options.coverGutterNextToScrollbar&&n.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}function os(n,t,i){var f=i&&null!=i.top?Math.max(0,i.top):n.scroller.scrollTop,o,s;f=Math.floor(f-le(n));var h=i&&null!=i.bottom?i.bottom:f+n.wrapper.clientHeight,u=gi(t,f),e=gi(t,h);return i&&i.ensure&&(o=i.ensure.from.line,s=i.ensure.to.line,u>o?(u=o,e=gi(t,ei(r(t,o))+n.wrapper.clientHeight)):Math.min(s,t.lastLine())>=e&&(u=gi(t,ei(r(t,s))-n.wrapper.clientHeight),e=s)),{from:u,to:Math.max(e,u+1)}}function ss(n){var t=n.display,r=t.view,u,f;if(t.alignWidgets||t.gutters.firstChild&&n.options.fixedGutter){for(var e=cs(t)-t.scroller.scrollLeft+n.doc.scrollLeft,s=t.gutters.offsetWidth,o=e+"px",i=0;i=i.viewFrom&&t.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==ba(n))return!1;nl(n)&&(hi(n),t.dims=ys(n));var c=o.first+o.size,u=Math.max(t.visible.from-n.options.viewportMargin,o.first),f=Math.min(c,t.visible.to+n.options.viewportMargin);return(i.viewFromf&&i.viewTo-f<20&&(f=Math.min(c,i.viewTo)),li&&(u=vh(n.doc,u),f=ny(n.doc,f)),h=u!=i.viewFrom||f!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth,vb(n,u,f),i.viewOffset=ei(r(n.doc,i.viewFrom)),n.display.mover.style.top=i.viewOffset+"px",s=ba(n),!h&&0==s&&!t.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))?!1:(e=dt(),s>4&&(i.lineDiv.style.display="none"),hw(n,i.updateLineNumbers,t.dims),s>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,e&&dt()!=e&&e.offsetHeight&&e.focus(),tr(i.cursorDiv),tr(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,h&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,yu(n,400)),i.updateLineNumbers=null,!0)}function tl(n,t){for(var u,i=t.viewport,r=!0;(r&&n.options.lineWrapping&&t.oldDisplayWidth!=vi(n)||(i&&null!=i.top&&(i={top:Math.min(n.doc.height+th(n.display)-ih(n),i.top)}),t.visible=os(n.display,n.doc,i),!(t.visible.from>=n.display.viewFrom&&t.visible.to<=n.display.viewTo)))&&ls(n,t);r=!1)ue(n),u=hu(n),vu(n),sr(n,u),vs(n,u);t.signal(n,"update",n);n.display.viewFrom==n.display.reportedViewFrom&&n.display.viewTo==n.display.reportedViewTo||(t.signal(n,"viewportChange",n,n.display.viewFrom,n.display.viewTo),n.display.reportedViewFrom=n.display.viewFrom,n.display.reportedViewTo=n.display.viewTo)}function as(n,t){var i=new re(n,t),r;ls(n,i)&&(ue(n),tl(n,i),r=hu(n),vu(n),sr(n,r),vs(n,r),i.finish())}function vs(n,t){n.display.sizer.style.minHeight=t.docHeight+"px";n.display.heightForcer.style.top=t.docHeight+"px";n.display.gutters.style.height=t.docHeight+n.display.barHeight+wt(n)+"px"}function ue(n){for(var i,t,e,o,h,u,r=n.display,c=r.lineDiv.offsetTop,f=0;fa?(e=t.node.offsetTop+t.node.offsetHeight,i=e-c,c=e):(o=t.node.getBoundingClientRect(),i=o.bottom-o.top),h=t.line.height-i,2>i&&(i=yi(r)),(h>.001||-.001>h)&&(kt(t.line,i),il(t.line),t.rest)))for(u=0;u=t&&r.lineNumber;r.changes&&(d(r.changes,"gutter")>-1&&(h=!1),rl(n,r,f,i));h&&(tr(r.lineNumber),r.lineNumber.appendChild(document.createTextNode(hs(n.options,f))));u=r.node.nextSibling}else a=vw(n,r,f,i),o.insertBefore(a,u);f+=r.size}for(;u;)u=c(u)}function rl(n,t,i,r){for(var u,f=0;fa&&(n.node.style.zIndex=2)),n.node}function cw(n){var t=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass,r;(t&&(t+=" CodeMirror-linebackground"),n.background)?t?n.background.className=t:(n.background.parentNode.removeChild(n.background),n.background=null):t&&(r=cu(n),n.background=r.insertBefore(i("div",null,t),r.firstChild))}function ul(n,t){var i=n.display.externalMeasured;return i&&i.line==t.line?(n.display.externalMeasured=null,t.measure=i.measure,i.built):hy(n,t)}function lw(n,t){var r=t.text.className,i=ul(n,t);t.text==t.node&&(t.node=i.pre);t.text.parentNode.replaceChild(i.pre,t.text);t.text=i.pre;i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,ps(t)):r&&(t.text.className=r)}function ps(n){cw(n);n.line.wrapClass?cu(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var t=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=t||""}function fl(n,t,r,u){var f,s,e,h,o,c;if((t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass)&&(s=cu(t),t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px; width: "+u.gutterTotalWidth+"px"),s.insertBefore(t.gutterBackground,t.text)),f=t.line.gutterMarkers,(n.options.lineNumbers||f)&&(s=cu(t),e=t.gutter=i("div",null,"CodeMirror-gutter-wrapper","left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px"),n.display.input.setUneditable(e),s.insertBefore(e,t.text),t.line.gutterClass&&(e.className+=" "+t.line.gutterClass),!n.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(t.lineNumber=e.appendChild(i("div",hs(n.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+n.display.lineNumInnerWidth+"px"))),f))for(h=0;h1)if(it&&it.text.join("\n")==i){if(f.ranges.length%it.text.length==0)for(s=[],o=0;o=0;o--){var p=f.ranges[o],c=p.from(),l=p.to();p.empty()&&(u&&u>0?c=n(c.line,c.ch-u):t.state.overwrite&&!v?l=n(l.line,Math.min(r(a,l.line).text.length,l.ch+h(y).length)):it&&it.lineWise&&it.text.join("\n")==i&&(c=l=n(c.line,0)));b=t.curOp.updateInput;w={from:c,to:l,text:s?s[o%s.length]:y,origin:e||(v?"paste":t.state.cutIncoming?"cut":"+input")};yr(t.doc,w);ut(t,"inputRead",t,w)}i&&!v&&cl(t,i);wr(t);t.curOp.updateInput=b;t.curOp.typing=!0;t.state.pasteIncoming=t.state.cutIncoming=!1}function hl(n,t){var i=n.clipboardData&&n.clipboardData.getData("text/plain");if(i)return(n.preventDefault(),t.isReadOnly()||t.options.disableInput||et(t,function(){oe(t,i,0,null,"paste")}),!0)}function cl(n,t){var e,u,i,f,o,s;if(n.options.electricChars&&n.options.smartIndent)for(e=n.doc.sel,u=e.ranges.length-1;u>=0;u--)if(i=e.ranges[u],!(i.head.ch>100||u&&e.ranges[u-1].head.line==i.head.line)){if(f=n.getModeAt(i.head),o=!1,f.electricChars){for(s=0;s-1){o=nf(n,i.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(r(n.doc,i.head.line).text.slice(0,i.head.ch))&&(o=nf(n,i.head.line,"smart"));o&&ut(n,"electricInput",n,i.head.line)}}function ll(t){for(var u,i,f=[],e=[],r=0;rf?b.map:w[f],e=0;ef?t.line:t.rest[f]),h=o[e]+u,(0>u||s!=i)&&(h=o[e+(u?1:0)]),n(l,h)}var v=t.text.firstChild,a=!1,p,e,o,f,l,s;if(!i||!go(v,i))return hr(n(c(t.line),0),!0);if(i==v&&(a=!0,i=v.childNodes[r],r=0,!i))return p=t.rest?h(t.rest):t.line,hr(n(c(p),p.text.length),a);for(e=3==i.nodeType?i:null,o=i,e||1!=i.childNodes.length||3!=i.firstChild.nodeType||(e=i.firstChild,r&&(r=e.nodeValue.length));o.parentNode!=v;)o=o.parentNode;var b=t.measure,w=b.maps,u=y(e,o,r);if(u)return hr(u,a);for(f=o.nextSibling,s=e?e.nodeValue.length-r:0;f;f=f.nextSibling){if(u=y(f,f.firstChild,0))return hr(n(u.line,u.ch-s),a);s+=f.textContent.length}for(l=o.previousSibling,s=r;l;l=l.previousSibling){if(u=y(l,l.firstChild,-1))return hr(n(u.line,u.ch+s),a);s+=f.textContent.length}}function ww(t,i,r,u,f){function c(n){return function(t){return t.id==n}}function s(i){var r,a,v,y,l,p;if(1==i.nodeType){if(r=i.getAttribute("cm-text"),null!=r)return""==r&&(r=i.textContent.replace(/\u200b/g,"")),void(e+=r);if(v=i.getAttribute("cm-marker"),v)return y=t.findMarks(n(u,0),n(f+1,0),c(+v)),void(y.length&&(a=y[0].find())&&(e+=di(t.doc,a.from,a.to).join(h)));if("false"==i.getAttribute("contenteditable"))return;for(l=0;l=0){var f=ee(r.from(),u.from()),o=fe(r.to(),u.to()),s=r.empty()?u.from()==u.head:r.from()==r.head;t>=i&&--t;n.splice(--i,2,new l(s?o:f,s?f:o))}return new ti(n,t)}function ii(n,t){return new ti([new l(n,t||n)],0)}function pl(n,t){return Math.max(n.first,Math.min(t,n.first+n.size-1))}function o(t,i){if(i.lineu?n(u,r(t,u).text.length):bw(i,r(t,i.line).text.length)}function bw(t,i){var r=t.ch;return null==r||r>i?n(t.line,i):0>r?n(t.line,0):t}function lu(n,t){return t>=n.first&&t=t.ch:h.to>t.ch))){if(f&&(p(o,"beforeCursorEnter"),o.explicitlyCleared)){if(c.markedSpans){--a;continue}break}if(!o.atomic)continue;return i&&(s=o.find(0>u?1:-1),(0>u?o.inclusiveRight:o.inclusiveLeft)&&(s=ia(n,s,-u,s&&s.line==t.line?c:null)),s&&s.line==t.line&&(v=e(s,i))&&(0>u?0>v:v>0))?cr(n,s,t,u,f):(l=o.find(0>u?-1:1),(0>u?o.inclusiveLeft:o.inclusiveRight)&&(l=ia(n,l,u,l.line==t.line?c:null)),l?cr(n,l,t,u,f):null)}return t}function gs(t,i,r,u,f){var e=u||1,o=cr(t,i,r,e,f)||!f&&cr(t,i,r,e,!0)||cr(t,i,r,-e,f)||!f&&cr(t,i,r,-e,!0);return o?o:(t.cantEdit=!0,n(t.first,0))}function ia(t,i,u,f){return 0>u&&0==i.ch?i.line>t.first?o(t,n(i.line-1)):null:u>0&&i.ch==(f||r(t,i.line)).text.length?i.line=n.display.viewTo||i.to().linet&&(t=0);t=Math.round(t);u=Math.round(u);w.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+n+"px; top: "+t+"px; width: "+(null==r?k-n:r)+"px; height: "+(u-t)+"px"))}function a(i,u,f){function l(r,u){return eh(t,n(i,r),"div",c,u)}var e,s,c=r(v,i),a=c.text.length;return ng(lt(c),u||0,null==f?a:f,function(n,t,i){var r,v,y,c=l(n,"left"),p;n==t?(r=c,v=y=c.left):((r=l(t-1,"right"),"rtl"==i)&&(p=c,c=r,r=p),v=c.left,y=r.right);null==u&&0==n&&(v=h);r.top-c.top>3&&(o(v,c.top,null,c.bottom),v=h,c.bottoms.bottom||r.bottom==s.bottom&&r.right>s.right)&&(s=r);h+1>v&&(v=h);o(v,r.top,y-v,r.bottom)}),{start:e,end:s}}var p=t.display,v=t.doc,w=document.createDocumentFragment(),b=fa(t.display),h=b.left,k=Math.max(p.sizerWidth,vi(t)-p.sizer.offsetLeft)-b.right,c=u.from(),l=u.to();if(c.line==l.line)a(c.line,c.ch,l.ch);else{var d=r(v,c.line),g=r(v,l.line),y=bt(d)==bt(g),e=a(c.line,c.ch,y?d.text.length+1:null).end,s=a(l.line,y?0:null,l.ch).start;y&&(e.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},n.options.cursorBlinkRate):n.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden"))}function yu(n,t){n.doc.mode.startState&&n.doc.frontier=n.display.viewTo)){var u=+new Date+n.options.workTime,i=oi(t.mode,pu(n,t.frontier)),r=[];t.iter(t.frontier,Math.min(t.first+t.size,n.display.viewTo+500),function(f){var o,e,c,s;if(t.frontier>=n.display.viewFrom){var h=f.styles,l=f.text.length>n.options.maxHighlightLength,a=ey(n,f,l?oi(t.mode,i):i,!0);for(f.styles=a.styles,o=f.styleClasses,e=a.classes,e?f.styleClasses=e:o&&(f.styleClasses=null),c=!h||h.length!=f.styles.length||o!=e&&(!o||!e||o.bgClass!=e.bgClass||o.textClass!=e.textClass),s=0;!c&&su?(yu(n,n.options.workDelay),!0):void 0});r.length&&et(n,function(){for(var t=0;tc;--u){if(u<=f.first)return f.first;if(o=r(f,u-1),o.stateAfter&&(!i||u<=f.frontier))return u;s=pt(o.text,null,n.options.tabSize);(null==e||h>s)&&(e=u-1,h=s)}return e}function pu(n,t,i){var f=n.doc,o=n.display,u,e;return f.mode.startState?(u=nb(n,t,i),e=u>f.first&&r(f,u-1).stateAfter,e=e?oi(f.mode,e):yp(f.mode),f.iter(u,t,function(i){wh(n,i.text,e);var r=u==t-1||u%5==0||u>=o.viewFrom&&u2&&e.push((o.bottom+s.top)/2-i.top);e.push(i.bottom-i.top)}}function ea(n,t,i){var r;if(n.line==t)return{map:n.measure.map,cache:n.measure.cache};for(r=0;ri)return{map:n.measure.maps[r],cache:n.measure.caches[r],before:!0}}function ib(n,t){var r,i,u;return t=bt(t),r=c(t),i=n.display.externalMeasured=new wa(n.doc,t,r),i.lineN=r,u=i.built=hy(n,i),i.text=u.pre,ot(n.display.lineMeasure,u.pre),i}function oa(n,t,i,r){return sa(n,uh(n,t),i,r)}function rh(n,t){if(t>=n.display.viewFrom&&t=i.lineN&&tt?(u=0,h=1,o="left"):f>t?(u=t-e,h=u+1):(r==n.length-3||t==f&&n[r+3]>t)&&(h=f-e,u=h-1,t>=f&&(o="right")),null!=u){if(s=n[r+2],e==f&&i==(s.insertLeft?"left":"right")&&(o=i),"left"==i&&0==u)for(;r&&n[r-2]==n[r-3]&&n[r-1].insertLeft;)s=n[(r-=3)+2],o="left";if("right"==i&&u==f-e)for(;ro;o++){for(;f&&hf(t.line.text.charAt(e.coverStart+f));)--f;for(;e.coverStart+ca&&0==f&&c==e.coverEnd-e.coverStart?u=h.parentNode.getBoundingClientRect():s&&n.options.lineWrapping?(l=er(h,f,c).getClientRects(),u=l.length?l["right"==r?l.length-1:0]:sc):u=er(h,f,c).getBoundingClientRect()||sc,u.left||u.right||0==f)break;c=f;f-=1;y="right"}s&&11>a&&(u=ub(n.display.measure,u))}else f>0&&(y=r="right"),u=n.options.lineWrapping&&(l=h.getClientRects()).length>1?l["right"==r?l.length-1:0]:h.getBoundingClientRect();s&&9>a&&!f&&(!u||!u.left&&!u.right)&&(v=h.parentNode.getClientRects()[0],u=v?{left:v.left,right:v.left+bu(n.display),top:v.top,bottom:v.bottom}:sc);for(var b=u.top-t.rect.top,k=u.bottom-t.rect.top,d=(b+k)/2,p=t.view.measure.heights,o=0;oi.from?h(n-1):h(n,r)}var o,s,a,c;return(u=u||r(n.doc,t.line),f||(f=uh(n,u)),o=lt(u),s=t.ch,!o)?h(s):(a=lo(o,s),c=l(s,a),null!=te&&(c.other=l(s,te)),c)}function pa(n,t){var i=0,t=o(n.doc,t),u,f;return n.options.lineWrapping||(i=bu(n.display)*t.ch),u=r(n.doc,t.line),f=ei(u)+le(n.display),{left:i,right:i,top:f,bottom:f+u.height}}function ae(t,i,r,u){var f=n(t,i);return f.xRel=u,r&&(f.outside=!0),f}function oh(n,t,i){var u=n.doc,f,s,e;if(i+=n.display.viewOffset,0>i)return ae(u.first,0,!0,-1);if(f=gi(u,i),s=u.first+u.size-1,f>s)return ae(u.first+u.size-1,r(u,s).text.length,!0,1);for(0>t&&(t=0),e=r(u,f);;){var o=fb(n,e,f,t,i),h=rf(e),l=h&&h.find(0,!0);if(!h||!(o.ch>l.from.ch||o.ch==l.from.ch&&o.xRel>0))return o;f=c(e=l.to.line)}}function fb(t,i,r,u,f){function p(u){var f=ri(t,n(r,u),"line",i,rt);return h=!0,g>f.bottom?f.left-nt:gl)return ae(r,o,b,1);for(;;){if(tt?o==e||o==ec(i,e,1):1>=o-e){for(c=v>u||l-u>=u-v?e:o,k=u-(c==e?v:l);hf(i.text.charAt(c));)++c;return ae(r,c,c==e?it:b,-1>k?-1:k>1?1:0)}if(a=Math.ceil(w/2),s=e+a,tt)for(s=e,d=0;a>d;++d)s=ec(i,s,1);y=p(s);y>u?(o=s,l=y,(b=h)&&(l+=1e3),w=a):(e=s,v=y,it=h,w-=a)}}function yi(n){var r,t;if(null!=n.cachedTextHeight)return n.cachedTextHeight;if(null==rr){for(rr=i("pre"),r=0;49>r;++r)rr.appendChild(document.createTextNode("x")),rr.appendChild(i("br"));rr.appendChild(document.createTextNode("x"))}return ot(n.measure,rr),t=rr.offsetHeight/50,t>3&&(n.cachedTextHeight=t),tr(n.measure),t||1}function bu(n){var r,f,u,t;return null!=n.cachedCharWidth?n.cachedCharWidth:(r=i("span","xxxxxxxxxx"),f=i("pre",[r]),ot(n.measure,f),u=r.getBoundingClientRect(),t=(u.right-u.left)/10,t>2&&(n.cachedCharWidth=t),t||10)}function lr(n){n.curOp={cm:n,viewChanged:!1,startHeight:n.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:++hg};tu?tu.ops.push(n.curOp):n.curOp.ownsGroup=tu={ops:[n.curOp],delayedCallbacks:[]}}function eb(n){var u=n.delayedCallbacks,i=0,r,t;do{for(;i=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping;n.update=n.mustUpdate&&new re(t,n.mustUpdate&&{top:n.scrollTop,ensure:n.scrollToPos},n.forceUpdate)}function hb(n){n.updatedDisplay=n.mustUpdate&&ls(n.cm,n.update)}function cb(n){var t=n.cm,i=t.display;n.updatedDisplay&&ue(t);n.barMeasure=hu(t);i.maxLineChanged&&!t.options.lineWrapping&&(n.adjustWidthTo=oa(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=n.adjustWidthTo,n.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+n.adjustWidthTo+wt(t)+t.display.barWidth),n.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+n.adjustWidthTo-vi(t)));(n.updatedDisplay||n.selectionChanged)&&(n.preparedSelection=i.input.prepareSelection(n.focus))}function lb(n){var t=n.cm,i;null!=n.adjustWidthTo&&(t.display.sizer.style.minWidth=n.adjustWidthTo+"px",n.maxScrollLeftu;u=o)e=new wa(n.doc,r(n.doc,u),u),o=u+e.size,f.push(e);return f}function tt(n,t,i,r){var u,f,o,s,e;null==t&&(t=n.doc.first);null==i&&(i=n.doc.first+n.doc.size);r||(r=0);u=n.display;(r&&it)&&(u.updateLineNumbers=t),n.curOp.viewChanged=!0,t>=u.viewTo)?li&&vh(n.doc,t)u.viewFrom?hi(n):(u.viewFrom+=r,u.viewTo+=r):t<=u.viewFrom&&i>=u.viewTo?hi(n):t<=u.viewFrom?(f=ye(n,i,i+r,1),f?(u.view=u.view.slice(f.index),u.viewFrom=f.lineN,u.viewTo+=r):hi(n)):i>=u.viewTo?(f=ye(n,t,t,-1),f?(u.view=u.view.slice(0,f.index),u.viewTo=f.lineN):hi(n)):(o=ye(n,t,t,-1),s=ye(n,i,i+r,1),o&&s?(u.view=u.view.slice(0,o.index).concat(ve(n,o.lineN,s.lineN)).concat(u.view.slice(s.index)),u.viewTo+=r):hi(n));e=u.externalMeasured;e&&(i=u.lineN&&t=r.viewTo)||(f=r.view[pi(n,t)],null!=f.node&&(e=f.changes||(f.changes=[]),-1==d(e,i)&&e.push(i)))}function hi(n){n.display.viewFrom=n.display.viewTo=n.doc.first;n.display.view=[];n.display.viewOffset=0}function pi(n,t){if(t>=n.display.viewTo||(t-=n.display.viewFrom,0>t))return null;for(var r=n.display.view,i=0;it)return i}function ye(n,t,i,r){var o,u=pi(n,t),f=n.display.view,s,e;if(!li||i==n.doc.first+n.doc.size)return{index:u,lineN:i};for(s=0,e=n.display.viewFrom;u>s;s++)e+=f[s].size;if(e!=t){if(r>0){if(u==f.length-1)return null;o=e+f[u].size-t;u++}else o=e-t;t+=o;i+=o}for(;vh(n.doc,i)!=i;){if(u==(0>r?0:f.length-1))return null;i+=r*f[u-(0>r?1:0)].size;u+=r}return{index:u,lineN:i}}function vb(n,t,i){var r=n.display,u=r.view;0==u.length||t>=r.viewTo||i<=r.viewFrom?(r.view=ve(n,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=ve(n,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,pi(n,i))));r.viewTo=i}function ba(n){for(var t,r=n.display.view,u=0,i=0;i400}var i=t.display,c,f,r;u(i.scroller,"mousedown",v(t,bb));s&&11>a?u(i.scroller,"dblclick",v(t,function(n){var i,r;y(t,n)||(i=wi(t,n),!i||da(t,n)||fi(t.display,n)||(nt(n),r=t.findWordAt(i),he(t.doc,r.anchor,r.head)))})):u(i.scroller,"dblclick",function(n){y(t,n)||nt(n)});oc||u(i.scroller,"contextmenu",function(n){fv(t,n)});f={end:0};u(i.scroller,"touchstart",function(n){if(!y(t,n)&&!w(n)){clearTimeout(c);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-f.end<=300?f:null};1==n.touches.length&&(i.activeTouch.left=n.touches[0].pageX,i.activeTouch.top=n.touches[0].pageY)}});u(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)});u(i.scroller,"touchend",function(r){var u=i.activeTouch,s,f;u&&!fi(i,r)&&null!=u.left&&!u.moved&&new Date-u.start<300&&(f=t.coordsChar(i.activeTouch,"page"),s=!u.prev||h(u,u.prev)?new l(f,f):!u.prev.prev||h(u,u.prev.prev)?t.findWordAt(f):new l(n(f.line,0),o(t.doc,n(f.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),nt(r));e()});u(i.scroller,"touchcancel",e);u(i.scroller,"scroll",function(){i.scroller.clientHeight&&(ku(t,i.scroller.scrollTop),vr(t,i.scroller.scrollLeft,!0),p(t,"scroll",t))});u(i.scroller,"mousewheel",function(n){nv(t,n)});u(i.scroller,"DOMMouseScroll",function(n){nv(t,n)});u(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0});i.dragFunctions={enter:function(n){y(t,n)||bo(n)},over:function(n){y(t,n)||(ik(t,n),bo(n))},start:function(n){tk(t,n)},drop:v(t,nk),leave:function(n){y(t,n)||ga(t)}};r=i.input.getField();u(r,"keyup",function(n){rv.call(t,n)});u(r,"keydown",v(t,iv));u(r,"keypress",v(t,uv));u(r,"focus",sf(sh,t));u(r,"blur",sf(du,t))}function pb(n,i,r){var o=r&&r!=t.Init,f,e;!i!=!o&&(f=n.display.dragFunctions,e=i?u:gt,e(n.display.scroller,"dragstart",f.start),e(n.display.scroller,"dragenter",f.enter),e(n.display.scroller,"dragover",f.over),e(n.display.scroller,"dragleave",f.leave),e(n.display.scroller,"drop",f.drop))}function wb(n){var t=n.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,n.setSize())}function fi(n,t){for(var i=nc(t);i!=n.wrapper;i=i.parentNode)if(!i||1==i.nodeType&&"true"==i.getAttribute("cm-ignore-events")||i.parentNode==n.sizer&&i!=n.mover)return!0}function wi(t,i,u,f){var a=t.display,s,c,h,o,e,l;if(!u&&"true"==nc(i).getAttribute("cm-not-content"))return null;h=a.lineSpace.getBoundingClientRect();try{s=i.clientX-h.left;c=i.clientY-h.top}catch(i){return null}return e=oh(t,s,c),f&&1==e.xRel&&(o=r(t.doc,e.line).text).length==e.ch&&(l=pt(o,o.length,t.options.tabSize)-o.length,e=n(e.line,Math.max(0,Math.round((s-fa(t.display).left)/bu(t.display))-l))),e}function bb(n){var t=this,i=t.display,r;if(!(y(t,n)||i.activeTouch&&i.input.supportsTouch())){if(i.shift=n.shiftKey,fi(i,n))return void(w||(i.scroller.draggable=!1,setTimeout(function(){i.scroller.draggable=!0},100)));if(!da(t,n)){r=wi(t,n);switch(window.focus(),dy(n)){case 1:t.state.selectingText?t.state.selectingText(n):r?kb(t,n,r):nc(n)==i.scroller&&nt(n);break;case 2:w&&(t.state.lastMiddleDown=+new Date);r&&he(t.doc,r);setTimeout(function(){i.input.focus()},20);nt(n);break;case 3:oc?fv(t,n):ek(t)}}}}function kb(n,t,i){var r,u,f,o,h;s?setTimeout(sf(sl,n),0):n.curOp.focus=dt();u=+new Date;vo&&vo.time>u-400&&0==e(vo.pos,i)?r="triple":ao&&ao.time>u-400&&0==e(ao.pos,i)?(r="double",vo={time:u,pos:i}):(r="single",ao={time:u,pos:i});o=n.doc.sel;h=yt?t.metaKey:t.ctrlKey;n.options.dragDrop&&bg&&!n.isReadOnly()&&"single"==r&&(f=o.contains(i))>-1&&(e((f=o.ranges[f]).from(),i)<0||i.xRel>0)&&(e(f.to(),i)>0||i.xRel<0)?db(n,t,i,h):gb(n,t,i,r,h)}function db(n,t,i,r){var f=n.display,o=+new Date,e=v(n,function(u){w&&(f.scroller.draggable=!1);n.state.draggingText=!1;gt(document,"mouseup",e);gt(f.scroller,"drop",e);Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)<10&&(nt(u),!r&&+new Date-200=h;h++)d=r(c,h).text,p=tw(d,ft,k),ft==et?u.push(new l(n(h,p),n(h,p))):d.length>p&&u.push(new l(n(h,p),n(h,tw(d,et,k))));u.length||u.push(new l(f,f));b(c,ct(w.ranges.slice(0,a).concat(u),a),{origin:"*mouse",scroll:!1});t.scrollIntoView(i)}else{var nt=y,g=nt.anchor,tt=i;"single"!=s&&(v="double"==s?t.findWordAt(i):new l(n(i.line,0),o(c,n(i.line+1,0))),e(v.anchor,g)>0?(tt=v.head,g=ee(nt.from(),v.anchor)):(tt=v.anchor,g=fe(nt.to(),v.head)));u=w.ranges.slice(0);u[a]=new l(o(c,g),tt);b(c,ct(u,a),ac)}}function it(n){var f=++tt,i=wi(t,n,!0,"rect"==s),r,u;i&&(0!=e(i,rt)?(t.curOp.focus=dt(),st(i),r=os(k,c),(i.line>=r.to||i.lineet.bottom?20:0,u&&setTimeout(v(t,function(){tt==f&&(k.scroller.scrollTop+=u,it(n))}),50)))}function ft(n){t.state.selectingText=!1;tt=1/0;nt(n);k.input.focus();gt(document,"mousemove",ot);gt(document,"mouseup",ut);c.history.lastSelOrigin=null}var k=t.display,c=t.doc,y,a,w,p,d,g;nt(i);w=c.sel;p=w.ranges;(h&&!i.shiftKey?(a=c.sel.contains(f),y=a>-1?p[a]:new l(f,f)):(y=c.sel.primary(),a=c.sel.primIndex),og?i.shiftKey&&i.metaKey:i.altKey)?(s="rect",h||(y=new l(f,f)),f=wi(t,i,!0,!0),a=-1):"double"==s?(d=t.findWordAt(f),y=t.display.shift||c.extend?au(c,y,d.anchor,d.head):d):"triple"==s?(g=new l(n(f.line,0),o(c,n(f.line+1,0))),y=t.display.shift||c.extend?au(c,y,g.anchor,g.head):g):y=au(c,y,f);h?-1==a?(a=p.length,b(c,ct(p.concat([y]),a),{scroll:!1,origin:"*mouse"})):p.length>1&&p[a].empty()&&"single"==s&&!i.shiftKey?(b(c,ct(p.slice(0,a).concat(p.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),w=c.sel):ds(c,a,y,ac):(a=0,b(c,new ti([y],0),ac),w=c.sel);var rt=f,et=k.wrapper.getBoundingClientRect(),tt=0,ot=v(t,function(n){dy(n)?it(n):ft(n)}),ut=v(t,ft);t.state.selectingText=ut;u(document,"mousemove",ot);u(document,"mouseup",ut)}function ka(n,t,i,r){var o,f,e,s,u,h,c,l;try{o=t.clientX;f=t.clientY}catch(t){return!1}if(o>=Math.floor(n.display.gutters.getBoundingClientRect().right))return!1;if(r&&nt(t),e=n.display,s=e.lineDiv.getBoundingClientRect(),f>s.bottom||!ht(n,i))return gh(t);for(f-=s.top-e.viewOffset,u=0;u=o)return c=gi(n.doc,f),l=n.options.gutters[u],p(n,i,n,c,l,t),gh(t)}function da(n,t){return ka(n,t,"gutterClick",!0)}function nk(n){var t=this,i,u,f,e,r;if((ga(t),!y(t,n)&&!fi(t.display,n))&&(nt(n),s&&(ap=+new Date),i=wi(t,n,!0),u=n.dataTransfer.files,i&&!t.isReadOnly()))if(u&&u.length&&window.FileReader&&window.File)for(var h=u.length,f=Array(h),c=0,l=function(n,r){if(!t.options.allowDropFileTypes||-1!=d(t.options.allowDropFileTypes,n.type)){var u=new FileReader;u.onload=v(t,function(){var n=u.result,e;(/[\x00-\x08\x0e-\x1f]{2}/.test(n)&&(n=""),f[r]=n,++c==h)&&(i=o(t.doc,i),e={from:i,to:i,text:t.doc.splitLines(f.join(t.doc.lineSeparator())),origin:"paste"},yr(t.doc,e),dl(t.doc,ii(i,ur(e))))});u.readAsText(n)}},r=0;h>r;++r)l(u[r],r);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1)return t.state.draggingText(n),void setTimeout(function(){t.display.input.focus()},20);try{if(f=n.dataTransfer.getData("Text"),f){if(!t.state.draggingText||(yt?n.altKey:n.ctrlKey)||(e=t.listSelections()),ce(t.doc,ii(i,i)),e)for(r=0;rr.clientWidth,h=r.scrollHeight>r.clientHeight,f,c,o;if(e&&y||u&&h){if(u&&yt&&w)n:for(f=t.target,c=i.view;f!=r;f=f.parentNode)for(o=0;ol?s=Math.max(0,s+l-50):a=Math.min(n.doc.height,a+l+50);as(n,{top:s,bottom:a})}20>yo&&(null==i.wheelStartX?(i.wheelStartX=r.scrollLeft,i.wheelStartY=r.scrollTop,i.wheelDX=e,i.wheelDY=u,setTimeout(function(){if(null!=i.wheelStartX){var n=r.scrollLeft-i.wheelStartX,t=r.scrollTop-i.wheelStartY,u=t&&i.wheelDY&&t/i.wheelDY||n&&i.wheelDX&&n/i.wheelDX;i.wheelStartX=i.wheelStartY=null;u&&(st=(st*yo+u)/(yo+1),++yo)}},200)):(i.wheelDX+=e,i.wheelDY+=u))}}function pe(n,t,i){if("string"==typeof t&&(t=af[t],!t))return!1;n.display.input.ensurePolled();var u=n.display.shift,r=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0);i&&(n.display.shift=!1);r=t(n)!=nw}finally{n.display.shift=u;n.state.suppressEdits=!1}return r}function rk(n,t,i){for(var u,r=0;ra&&27==n.keyCode&&(n.returnValue=!1),i=n.keyCode,t.display.shift=16==i||n.shiftKey,r=tv(t,n),vt&&(cc=r?i:null,!r&&88==i&&!uw&&(yt?n.metaKey:n.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||fk(t))}function fk(n){function t(n){18!=n.keyCode&&n.altKey||(gf(i,"CodeMirror-crosshair"),gt(document,"keyup",t),gt(document,"mouseover",t))}var i=n.display.lineDiv;ne(i,"CodeMirror-crosshair");u(document,"keyup",t);u(document,"mouseover",t)}function rv(n){16==n.keyCode&&(this.doc.sel.shift=!1);y(this,n)}function uv(n){var t=this,i,r,u;if(!(fi(t.display,n)||y(t,n)||n.ctrlKey&&!n.altKey||yt&&n.metaKey)){if(i=n.keyCode,r=n.charCode,vt&&i==cc)return cc=null,void nt(n);vt&&(!n.which||n.which<10)&&tv(t,n)||(u=String.fromCharCode(null==r?i:r),uk(t,n,u)||t.display.input.onKeyPress(n))}}function ek(n){n.state.delayingBlurEvent=!0;setTimeout(function(){n.state.delayingBlurEvent&&(n.state.delayingBlurEvent=!1,du(n))},100)}function sh(n){n.state.delayingBlurEvent&&(n.state.delayingBlurEvent=!1);"nocursor"!=n.options.readOnly&&(n.state.focused||(p(n,"focus",n),n.state.focused=!0,ne(n.display.wrapper,"CodeMirror-focused"),n.curOp||n.display.selForContextMenu==n.doc.sel||(n.display.input.reset(),w&&setTimeout(function(){n.display.input.reset(!0)},20)),n.display.input.receivedFocus()),nh(n))}function du(n){n.state.delayingBlurEvent||(n.state.focused&&(p(n,"blur",n),n.state.focused=!1,gf(n.display.wrapper,"CodeMirror-focused")),clearInterval(n.display.blinker),setTimeout(function(){n.state.focused||(n.display.shift=!1)},150))}function fv(n,t){fi(n.display,t)||ok(n,t)||y(n,t,"contextmenu")||n.display.input.onContextMenu(t)}function ok(n,t){return ht(n,"gutterContextMenu")?ka(n,t,"gutterContextMenu",!1):!1}function ev(t,i){if(e(t,i.from)<0)return t;if(e(t,i.to)<=0)return ur(i);var u=t.line+i.text.length-(i.to.line-i.from.line)-1,r=t.ch;return t.line==i.to.line&&(r+=ur(i).ch-i.to.ch),n(u,r)}function hh(n,t){for(var u,r=[],i=0;i=0;--r)hv(n,{from:u[r].from,to:u[r].to,text:r?[""]:t.text});else hv(n,t)}function hv(n,t){var i,r;(1!=t.text.length||""!=t.text[0]||0!=e(t.from,t.to))&&(i=hh(n,t),yy(n,t,i,n.cm?n.cm.curOp.id:NaN),gu(n,t,i,ah(n,t)),r=[],ki(n,function(n,i){i||-1!=d(r,n.history)||(ky(n.history,t),r.push(n.history));gu(n,t,null,ah(n,t))}))}function be(n,t,i){var c,v,f,u,y,l;if(!n.cm||!n.cm.state.suppressEdits){for(var r,e=n.history,a=n.sel,o="undo"==t?e.done:e.undone,s="undo"==t?e.undone:e.done,f=0;f=0;--f){if(u=r.changes[f],u.origin=t,v&&!sv(n,u,!1))return void(o.length=0);c.push(dh(n,u));y=f?hh(n,u):h(o);gu(n,u,y,yv(n,u));!f&&n.cm&&n.cm.scrollIntoView({from:u.from,to:ur(u)});l=[];ki(n,function(n,t){t||-1!=d(l,n.history)||(ky(n.history,u),l.push(n.history));gu(n,u,null,yv(n,u))})}}}}function cv(t,i){if(0!=i&&(t.first+=i,t.sel=new ti(oo(t.sel.ranges,function(t){return new l(n(t.anchor.line+i,t.anchor.ch),n(t.head.line+i,t.head.ch))}),t.sel.primIndex),t.cm)){tt(t.cm,t.first,t.first-i,i);for(var u=t.cm.display,r=u.viewFrom;rt.lastLine()||(i.from.linee&&(i={from:i.from,to:n(e,r(t,e).text.length),text:[i.text[0]],origin:i.origin}),i.removed=di(t,i.from,i.to),u||(u=hh(t,i)),t.cm?hk(t.cm,i,f):bh(t,i,f),ce(t,u,ni))}function hk(n,t,i){var f=n.doc,e=n.display,u=t.from,o=t.to,s=!1,h=u.line,y,l,a,v;n.options.lineWrapping||(h=c(bt(r(f,u.line))),f.iter(h,o.line+1,function(n){if(n==e.maxLine)return(s=!0,!0)}));f.sel.contains(t.from,t.to)>-1&&gy(n);bh(f,t,i,wc(n));n.options.lineWrapping||(f.iter(h,u.line+t.text.length,function(n){var t=ie(n);t>e.maxLineLength&&(e.maxLine=n,e.maxLineLength=t,e.maxLineChanged=!0,s=!1)}),s&&(n.curOp.updateMaxLine=!0));f.frontier=Math.min(f.frontier,u.line);yu(n,400);y=t.text.length-(o.line-u.line)-1;t.full?tt(n):u.line!=o.line||1!=t.text.length||ly(n.doc,t)?tt(n,u.line,o.line+1,y):ui(n,u.line,"text");l=ht(n,"changes");a=ht(n,"change");(a||l)&&(v={from:u,to:o,text:t.text,removed:t.removed,origin:t.origin},a&&ut(n,"change",n,v),l&&(n.curOp.changeObjs||(n.curOp.changeObjs=[])).push(v));n.display.selForContextMenu=null}function pr(n,t,i,r,u){if(r||(r=i),e(r,i)<0){var f=r;r=i;i=f}"string"==typeof t&&(t=n.splitLines(t));yr(n,{from:i,to:r,text:t,origin:u})}function ck(n,t){var u;if(!y(n,"scrollCursorIntoView")){var f=n.display,e=f.sizer.getBoundingClientRect(),r=null;(t.top+e.top<0?r=!0:t.bottom+e.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null==r||eg)||(u=i("div","​",null,"position: absolute; top: "+(t.top-f.viewOffset-le(n.display))+"px; height: "+(t.bottom-t.top+wt(n)+f.barHeight)+"px; left: "+t.left+"px; width: 2px;"),n.display.lineSpace.appendChild(u),u.scrollIntoView(r),n.display.lineSpace.removeChild(u))}}function lk(n,t,i,r){var o;for(null==r&&(r=0),o=0;5>o;o++){var s=!1,u=ri(n,t),f=i&&i!=t?ri(n,i):u,e=ke(n,Math.min(u.left,f.left),Math.min(u.top,f.top)-r,Math.max(u.left,f.left),Math.max(u.bottom,f.bottom)+r),h=n.doc.scrollTop,c=n.doc.scrollLeft;if(null!=e.scrollTop&&(ku(n,e.scrollTop),Math.abs(n.doc.scrollTop-h)>1&&(s=!0)),null!=e.scrollLeft&&(vr(n,e.scrollLeft),Math.abs(n.doc.scrollLeft-c)>1&&(s=!0)),!s)break}return u}function ak(n,t,i,r,u){var f=ke(n,t,i,r,u);null!=f.scrollTop&&ku(n,f.scrollTop);null!=f.scrollLeft&&vr(n,f.scrollLeft)}function ke(n,t,i,r,u){var e=n.display,a=yi(n.display),c;0>i&&(i=0);var h=n.curOp&&null!=n.curOp.scrollTop?n.curOp.scrollTop:e.scroller.scrollTop,o=ih(n),f={};u-i>o&&(u=i+o);var v=n.doc.height+th(e),p=a>i,w=u>v-a;h>i?f.scrollTop=p?0:i:u>h+o&&(c=Math.min(i,(w?v:u)-o),c!=h&&(f.scrollTop=c));var y=n.curOp&&null!=n.curOp.scrollLeft?n.curOp.scrollLeft:e.scroller.scrollLeft,s=vi(n)-(n.options.fixedGutter?e.gutters.offsetWidth:0),l=r-t>s;return l&&(r=t+s),10>t?f.scrollLeft=0:y>t?f.scrollLeft=Math.max(0,t-(l?0:10)):r>s+y-3&&(f.scrollLeft=r+(l?0:10)-s),f}function ch(n,t,i){null==t&&null==i||de(n);null!=t&&(n.curOp.scrollLeft=(null==n.curOp.scrollLeft?n.doc.scrollLeft:n.curOp.scrollLeft)+t);null!=i&&(n.curOp.scrollTop=(null==n.curOp.scrollTop?n.doc.scrollTop:n.curOp.scrollTop)+i)}function wr(t){de(t);var i=t.getCursor(),r=i,u=i;t.options.lineWrapping||(r=i.ch?n(i.line,i.ch-1):i,u=n(i.line,i.ch+1));t.curOp.scrollToPos={from:r,to:u,margin:t.options.cursorScrollMargin,isCursor:!0}}function de(n){var t=n.curOp.scrollToPos;if(t){n.curOp.scrollToPos=null;var i=pa(n,t.from),r=pa(n,t.to),u=ke(n,Math.min(i.left,r.left),Math.min(i.top,r.top)-t.margin,Math.max(i.right,r.right),Math.max(i.bottom,r.bottom)+t.margin);n.scrollTo(u.scrollLeft,u.scrollTop)}}function nf(t,i,u,f){var b,o=t.doc,e,a,v,h,w,c;null==u&&(u="add");"smart"==u&&(o.mode.indent?b=pu(t,i):u="prev");var y=t.options.tabSize,s=r(o,i),p=pt(s.text,null,y);if(s.stateAfter&&(s.stateAfter=null),a=s.text.match(/^\s*/)[0],f||/\S/.test(s.text)){if("smart"==u&&(e=o.mode.indent(b,s.text.slice(a.length),s.text),e==nw||e>150)){if(!f)return;u="prev"}}else e=0,u="not";if("prev"==u?e=i>o.first?pt(r(o,i-1).text,null,y):0:"add"==u?e=p+t.options.indentUnit:"subtract"==u?e=p-t.options.indentUnit:"number"==typeof u&&(e=p+u),e=Math.max(0,e),v="",c=0,t.options.indentWithTabs)for(h=Math.floor(e/y);h;--h)c+=y,v+="\t";if(e>c&&(v+=tc(e-c)),v!=a)return pr(o,v,n(i,0),n(i,a.length),"+input"),s.stateAfter=null,!0;for(h=0;h=0;t--)pr(n.doc,"",i[t].from,i[t].to,"+delete");wr(n)})}function lh(t,i,u,f,o){function k(){var n=a+u;return n=t.first+t.size?!1:(a=n,l=r(t,n))}function h(n){var t=(o?ec:fp)(l,c,u,!0);if(null==t){if(n||!k())return!1;c=o?(0>u?co:ho)(l):0>u?l.text.length:0}else c=t;return!0}var a=i.line,c=i.ch,d=u,l=r(t,a),y,s,p;if("char"==f)h();else if("column"==f)h(!0);else if("word"==f||"group"==f)for(var w=null,b="group"==f,g=t.cm&&t.cm.getHelper(i,"wordChars"),v=!0;!(0>u)||h(!v);v=!1){if(y=l.text.charAt(c)||"\n",s=so(y,g)?"w":b&&"\n"==y?"n":!b||/\s/.test(y)?null:"p",!b||v||s||(s="s"),w&&w!=s){0>u&&(u=1,h());break}if(s&&(w=s),u>0&&!h(!v))break}return p=gs(t,n(a,c),i,d,!0),e(i,p)||(p.hitSide=!0),p}function lv(n,t,i,r){var u,o=n.doc,s=t.left,e,f;for("page"==r?(e=Math.min(n.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=t.top+i*(e-(0>i?1.5:.5)*yi(n.display))):"line"==r&&(u=i>0?t.bottom+3:t.top-3);;){if(f=oh(n,s,u),!f.outside)break;if(0>i?0>=u:u>=o.height){f.hitSide=!0;break}u+=5*i}return f}function f(n,i,r,u){t.defaults[n]=i;r&&(iu[n]=u?function(n,t,i){i!=vp&&r(n,t,i)}:r)}function vk(n){for(var t,u,f,e,o,i=n.split(/-(?!$)/),n=i[i.length-1],r=0;r0||0==a&&s.clearWhenEmpty!==!1)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=i("span",[s.replacedWith],"CodeMirror-widget"),f.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),f.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(gv(n,t.line,t,r,s)||t.line!=r.line&&gv(n,r.line,t,r,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");li=!0}if(s.addToHistory&&yy(n,{from:t,to:r,origin:"markText"},n.sel,NaN),c=t.line,h=n.cm,n.iter(c,r.line+1,function(n){h&&s.collapsed&&!h.options.lineWrapping&&bt(n)==h.display.maxLine&&(y=!0);s.collapsed&&c!=t.line&&kt(n,0);kk(n,new to(s,c==t.line?t.ch:null,c==r.line?r.ch:null));++c}),s.collapsed&&n.iter(t.line,r.line+1,function(t){bi(n,t)&&kt(t,0)}),s.clearOnEnter&&u(s,"beforeCursorEnter",function(){s.clear()}),s.readOnly&&(lp=!0,(n.history.done.length||n.history.undone.length)&&n.clearHistory()),s.collapsed&&(s.id=++wo,s.atomic=!0),h){if(y&&(h.curOp.updateMaxLine=!0),s.collapsed)tt(h,t.line,r.line+1);else if(s.className||s.title||s.startStyle||s.endStyle||s.css)for(l=t.line;l<=r.line;l++)ui(h,l,"text");s.atomic&&na(h.doc);ut(h,"markerAdded",h,s)}return s}function yk(n,t,i,r,u){r=at(r);r.shared=!1;var f=[kr(n,t,i,r,u)],e=f[0],s=r.widgetNode;return ki(n,function(n){s&&(r.widgetNode=s.cloneNode(!0));f.push(kr(n,o(n,t),o(n,i),r,u));for(var c=0;c=t:r.to>t),(e||(e=[])).push(new to(f,r.from,o?null:r.to)))}return e}function gk(n,t,i){var e,u,o;if(n)for(u=0;u=t:r.to>t);(s||r.from==t&&"bookmark"==f.type&&(!i||r.marker.insertLeft))&&(o=null==r.from||(f.inclusiveLeft?r.from<=t:r.from0&&i)for(u=0;uu;++u)a.push(w);a.push(o)}return a}function vv(n){for(var i,t=0;t0)){var c=[s,1],a=e(u.from,o.from),v=e(u.to,o.to);(0>a||!l.inclusiveLeft&&!a)&&c.push({from:u.from,to:o.from});(v>0||!l.inclusiveRight&&!v)&&c.push({from:o.to,to:u.to});f.splice.apply(f,c);s+=c.length-1}return f}function pv(n){var i=n.markedSpans,t;if(i){for(t=0;t=0&&0>=a||0>=c&&a>=0)&&(0>=c&&(o.marker.inclusiveRight&&f.inclusiveLeft?e(s.to,i)>=0:e(s.to,i)>0)||c>=0&&(o.marker.inclusiveRight&&f.inclusiveLeft?e(s.from,u)<=0:e(s.from,u)<0)))return!0}}function bt(n){for(var t;t=dv(n);)n=t.find(-1,!0).line;return n}function td(n){for(var i,t;i=rf(n);)n=i.find(1,!0).line,(t||(t=[])).push(n);return t}function vh(n,t){var i=r(n,t),u=bt(i);return i==u?t:c(u)}function ny(n,t){if(t>n.lastLine())return t;var u,i=r(n,t);if(!bi(n,i))return t;for(;u=rf(i);)i=u.find(1,!0).line;return c(i)+1}function bi(n,t){var u=li&&t.markedSpans,i,r;if(u)for(r=0;rf;f++)if(u&&(u[0]=t.innerMode(n,r).mode),e=n.token(i,r),i.pos>i.start)return e;throw new Error("Mode "+n.name+" failed to advance stream.");}function uy(n,t,i,u){function c(n){return{start:f.start,end:f.pos,string:f.current(),type:l||null,state:n?oi(e.mode,h):h}}var l,e=n.doc,a=e.mode;t=o(e,t);var s,v=r(e,t.line),h=pu(n,t.line,i),f=new yf(v.text,n.options.tabSize);for(u&&(s=[]);(u||f.posn.options.maxHighlightLength?(c=!1,e&&wh(n,t,r,o.pos),o.pos=t.length,s=null):s=iy(ph(i,o,r,v),f),v)&&(a=v[0].name,a&&(s="m-"+(s?a+" "+s:a))),!c||l!=s){for(;hh;)r=u[f],r>n&&u.splice(f,1,n,u[f+1],r),f+=2,h=Math.min(n,r);if(t)if(s.opaque)u.splice(i,f-i,n,"cm-overlay "+t),f=i+2;else for(;f>i;i+=2)e=u[i+1],u[i+1]=(e?e+" ":"")+"cm-overlay "+t},e)}return{styles:u,classes:e.bgClass||e.textClass?e:null}}function oy(n,t,i){if(!t.styles||t.styles[0]!=n.state.modeGen){var r=pu(n,c(t)),u=ey(n,t,t.text.length>n.options.maxHighlightLength?oi(n.doc.mode,r):r);t.stateAfter=r;t.styles=u.styles;u.classes?t.styleClasses=u.classes:t.styleClasses&&(t.styleClasses=null);i===n.doc.frontier&&n.doc.frontier++}return t.styles}function wh(n,t,i,r){var f=n.doc.mode,u=new yf(t,n.options.tabSize);for(u.start=u.pos=r||0,""==t&&ry(f,i);!u.eol();)ph(f,u,i),u.start=u.pos}function sy(n,t){if(!n||/^\s*$/.test(n))return null;var i=t.addModeClass?wp:pp;return i[n]||(i[n]=n.replace(/\S+/g,"cm-$&"))}function hy(n,t){var o=i("span",null,null,w?"padding-right: .1px":null),r={pre:i("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:n,splitSpaces:(s||w)&&n.getOption("lineWrapping")},f,h,u,l,e;for(t.measure={},f=0;f<=(t.rest?t.rest.length:0);f++)u=f?t.rest[f-1]:t.line,r.pos=0,r.addToken=ed,dd(n.display.measure)&&(h=lt(u))&&(r.addToken=sd(r.addToken,h)),r.map=[],l=t!=n.display.externalMeasured&&c(u),hd(u,r,oy(n,u,l)),u.styleClasses&&(u.styleClasses.bgClass&&(r.bgClass=ic(u.styleClasses.bgClass,r.bgClass||"")),u.styleClasses.textClass&&(r.textClass=ic(u.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(kd(n.display.measure))),0==f?(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 w&&(e=r.content.lastChild,(/\bcm-tab\b/.test(e.className)||e.querySelector&&e.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")),p(n,"renderLine",n,t.line,r.pre),r.pre.className&&(r.textClass=ic(r.pre.className,r.textClass||"")),r}function fd(n){var t=i("span","•","cm-invalidchar");return t.title="\\u"+n.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function ed(n,t,r,u,f,e,o){var v,l,y,h,c,p,b;if(t){var k=n.splitSpaces?t.replace(/ {3,}/g,od):t,w=n.cm.state.specialChars,d=!1;if(w.test(t))for(c=document.createDocumentFragment(),v=0;;){if(w.lastIndex=v,l=w.exec(t),y=l?l.index-v:t.length-v,y&&(h=document.createTextNode(k.slice(v,v+y)),s&&9>a?c.appendChild(i("span",[h])):c.appendChild(h),n.map.push(n.pos,n.pos+y,h),n.col+=y,n.pos+=y),!l)break;if(v+=y+1,"\t"==l[0]){var g=n.cm.options.tabSize,nt=g-n.col%g,h=c.appendChild(i("span",tc(nt),"cm-tab"));h.setAttribute("role","presentation");h.setAttribute("cm-text","\t");n.col+=nt}else"\r"==l[0]||"\n"==l[0]?(h=c.appendChild(i("span","\r"==l[0]?"␍":"␤","cm-invalidchar")),h.setAttribute("cm-text",l[0]),n.col+=1):(h=n.cm.options.specialCharPlaceholder(l[0]),h.setAttribute("cm-text",l[0]),s&&9>a?c.appendChild(i("span",[h])):c.appendChild(h),n.col+=1);n.map.push(n.pos,n.pos+1,h);n.pos++}else n.col+=t.length,c=document.createTextNode(k),n.map.push(n.pos,n.pos+t.length,c),s&&9>a&&(d=!0),n.pos+=t.length;if(r||u||f||d||o)return p=r||"",u&&(p+=u),f&&(p+=f),b=i("span",[c],p,o),e&&(b.title=e),n.content.appendChild(b);n.content.appendChild(c)}}function od(n){for(var i=" ",t=0;th&&c.from<=h)break;if(c.to>=a)return n(i,r,u,f,e,o,s);n(i,r.slice(0,c.to-h),u,f,null,o,s);f=null;r=r.slice(c.to-h);h=c.to}}}function cy(n,t,i,r){var u=!r&&i.widgetNode;u&&n.map.push(n.pos,n.pos+t,u);!r&&n.cm.display.input.needsContentAttribute&&(u||(u=n.content.appendChild(document.createElement("span"))),u.setAttribute("cm-marker",i.id));u&&(n.cm.display.input.setUneditable(u),n.content.appendChild(u));n.pos+=t}function hd(n,t,i){var nt=n.markedSpans,tt=n.text,y=0,l,d,u,f,o,a,g,ut,h;if(nt)for(var it,v,p,w,b,k,e,rt=tt.length,r=0,h=1,c="",s=0;;){if(s==r){for(p=w=b=k=v="",e=null,s=1/0,d=[],o=0;or||f.collapsed&&u.to==r&&u.from==r)?(null!=u.to&&u.to!=r&&s>u.to&&(s=u.to,w=""),f.className&&(p+=" "+f.className),f.css&&(v=(v?v+";":"")+f.css),f.startStyle&&u.from==r&&(b+=" "+f.startStyle),f.endStyle&&u.to==s&&(l||(l=[])).push(f.endStyle,u.to),f.title&&!k&&(k=f.title),f.collapsed&&(!e||bv(e.marker,f)<0)&&(e=u)):u.from>r&&s>u.from&&(s=u.from);if(l)for(o=0;o=rt)break;for(a=Math.min(rt,s);;){if(c){if(g=r+c.length,e||(ut=g>a?c.slice(0,a-r):c,t.addToken(t,ut,it?it+p:p,b,r+ut.length==s?w:"",k,v)),g>=a){c=c.slice(a-r);r=a;break}r=g;b=""}c=tt.slice(y,y=i[h++]);it=sy(i[h++],t.cm.options)}}else for(h=1;hi;++i)r.push(new fu(f[i],v(i),u));return r}var e=t.from,l=t.to,f=t.text,o=r(n,e.line),a=r(n,l.line),b=h(f),w=v(f.length-1),y=l.line-e.line,s;t.full?(n.insert(0,p(0,f.length)),n.remove(f.length,n.size-f.length)):ly(n,t)?(s=p(0,f.length-1),c(a,a.text,w),y&&n.remove(e.line,y),s.length&&n.insert(e.line,s)):o==a?1==f.length?c(o,o.text.slice(0,e.ch)+b+o.text.slice(l.ch),w):(s=p(1,f.length-1),s.push(new fu(b+o.text.slice(l.ch),w,u)),c(o,o.text.slice(0,e.ch)+f[0],v(0)),n.insert(e.line+1,s)):1==f.length?(c(o,o.text.slice(0,e.ch)+f[0]+a.text.slice(l.ch),v(0)),n.remove(e.line+1,y)):(c(o,o.text.slice(0,e.ch)+f[0],v(0)),c(a,b+a.text.slice(l.ch),w),s=p(1,f.length-1),y>1&&n.remove(e.line+1,y-1),n.insert(e.line+1,s));ut(n,"change",n,t)}function ff(n){this.lines=n;this.parent=null;for(var t=0,i=0;tt||t>=n.size)throw new Error("There is no line "+(t+n.first)+" in the document.");for(i=n;!i.lines;)for(r=0;;++r){if(u=i.children[r],f=u.chunkSize(),f>t){i=u;break}t-=f}return i.lines[t]}function di(n,t,i){var u=[],r=t.line;return n.iter(t.line,i.line+1,function(n){var f=n.text;r==i.line&&(f=f.slice(0,i.ch));r==t.line&&(f=f.slice(t.ch));u.push(f);++r}),u}function kh(n,t,i){var r=[];return n.iter(t,i,function(n){r.push(n.text)}),r}function kt(n,t){var r=t-n.height,i;if(r)for(i=n;i;i=i.parent)i.height+=r}function c(n){var r;if(null==n.parent)return null;for(var i=n.parent,u=d(i.lines,n),t=i.parent;t;i=t,t=t.parent)for(r=0;t.children[r]!=i;++r)u+=t.children[r].chunkSize();return u+i.first}function gi(n,t){var u=n.first,r,f,i,o,e;n:do{for(i=0;it){n=r;continue n}t-=f;u+=r.chunkSize()}return u}while(!n.lines);for(i=0;it)break;t-=e}return u+i}function ei(n){var f,r,t,e;n=bt(n);for(var u=0,i=n.parent,t=0;t1&&!n.done[n.done.length-2].ranges?(n.done.pop(),h(n.done)):void 0}function yy(n,t,i,r){var u=n.history,f,s,o,c;if(u.undone.length=0,s=+new Date,(u.lastOp==r||u.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&n.cm&&u.lastModTime>s-n.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(f=cd(u,u.lastOp==r)))o=h(f.changes),0==e(t.from,t.to)&&0==e(t.from,o.to)?o.to=ur(t):f.changes.push(dh(n,t));else for(c=h(u.done),c&&c.ranges||fo(n.sel,u.done),f={changes:[dh(n,t)],generation:u.generation},u.done.push(f);u.done.length>u.undoDepth;)u.done.shift(),u.done[0].ranges||u.done.shift();u.done.push(i);u.generation=++u.maxGeneration;u.lastModTime=u.lastSelTime=s;u.lastOp=u.lastSelOp=r;u.lastOrigin=u.lastSelOrigin=t.origin;o||p(n,"historyAdded")}function ld(n,t,i,r){var u=t.charAt(0);return"*"==u||"+"==u&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-n.history.lastSelTime<=(n.cm?n.cm.options.historyEventDelay:500)}function ad(n,t,i,r){var u=n.history,f=r&&r.origin;i==u.lastSelOp||f&&u.lastSelOrigin==f&&(u.lastModTime==u.lastSelTime&&u.lastOrigin==f||ld(n,f,h(u.done),t))?u.done[u.done.length-1]=t:fo(t,u.done);u.lastSelTime=+new Date;u.lastSelOrigin=f;u.lastSelOp=i;r&&r.clearRedo!==!1&&vy(u.undone)}function fo(n,t){var i=h(t);i&&i.ranges&&i.equals(n)||t.push(n)}function py(n,t,i,r){var u=t["spans_"+n.id],f=0;n.iter(Math.max(n.first,i),Math.min(n.first+n.size,r),function(i){i.markedSpans&&((u||(u=t["spans_"+n.id]={}))[f]=i.markedSpans);++f})}function vd(n){if(!n)return null;for(var t,i=0;i-1&&(h(s)[f]=r[f],delete r[f]);return o}function wy(n,t,i,r){i0?r.slice():dp:r||dp}function ut(n,t){function e(n){return function(){n.apply(null,f)}}var u=eo(n,t,!1),i,f,r;if(u.length)for(f=Array.prototype.slice.call(arguments,2),tu?i=tu.delayedCallbacks:kf?i=kf:(i=kf=[],setTimeout(pd,0)),r=0;r0}function gr(n){n.prototype.on=function(n,t){u(this,n,t)};n.prototype.off=function(n,t){gt(this,n,t)}}function nr(){this.id=null}function tc(n){for(;ko.length<=n;)ko.push(h(ko)+" ");return ko[n]}function h(n){return n[n.length-1]}function d(n,t){for(var i=0;i-1&&iw(n)?!0:t.test(n):iw(n)}function tp(n){for(var t in n)if(n.hasOwnProperty(t)&&n[t])return!1;return!0}function hf(n){return n.charCodeAt(0)>=768&&wg.test(n)}function i(n,t,i,r){var u=document.createElement(n),f;if(i&&(u.className=i),r&&(u.style.cssText=r),"string"==typeof t)u.appendChild(document.createTextNode(t));else if(t)for(f=0;f0;--t)n.removeChild(n.firstChild);return n}function ot(n,t){return tr(n).appendChild(t)}function dt(){for(var n=document.activeElement;n&&n.root&&n.root.activeElement;)n=n.root.activeElement;return n}function cf(n){return new RegExp("(^|\\s)"+n+"(?:$|\\s)\\s*")}function ic(n,t){for(var r=n.split(" "),i=0;i2&&!(s&&8>a))),r=vc?i("span","​"):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px"),r.setAttribute("cm-text",""),r}function dd(n){var i,t,r;return null!=yc?yc:(i=ot(n,document.createTextNode("AخA")),t=er(i,0,1).getBoundingClientRect(),!t||t.left==t.right)?!1:(r=er(i,1,2).getBoundingClientRect(),yc=r.right-t.right<3)}function gd(n){if(null!=pc)return pc;var t=ot(n,i("span","x")),r=t.getBoundingClientRect(),u=er(t,0,1).getBoundingClientRect();return pc=Math.abs(r.left-u.left)>1}function ng(n,t,i,r){var e,f,u;if(!n)return r(t,i,"ltr");for(e=!1,f=0;ft||t==i&&u.to==t)&&(r(Math.max(u.from,t),Math.min(u.to,i),1==u.level?"rtl":"ltr"),e=!0);e||r(t,i,"ltr")}function rc(n){return n.level%2?n.to:n.from}function uc(n){return n.level%2?n.from:n.to}function ho(n){var t=lt(n);return t?rc(t[0]):0}function co(n){var t=lt(n);return t?uc(h(t)):n.text.length}function rp(t,i){var e=r(t.doc,i),u=bt(e),f,o;return u!=e&&(i=c(u)),f=lt(u),o=f?f[0].level%2?co(u):ho(u):0,n(i,o)}function tg(t,i){for(var e,f,o,u=r(t.doc,i);e=rf(u);)u=e.find(1,!0).line,i=null;return f=lt(u),o=f?f[0].level%2?ho(u):co(u):u.text.length,n(null==i?c(u):i,o)}function up(t,i){var u=rp(t,i.line),e=r(t.doc,u.line),o=lt(e),f,s;return!o||0==o[0].level?(f=Math.max(0,e.text.search(/\S/)),s=i.line==u.line&&i.ch<=f&&i.ch,n(u.line,s?0:f)):u}function ig(n,t,i){var r=n[0].level;return t==r?!0:i==r?!1:i>t}function lo(n,t){var u,r,i;for(te=null,r=0;rt)return r;if(i.from==t||i.to==t){if(null!=u)return ig(n,i.level,n[u].level)?(i.from!=i.to&&(te=u),r):(i.from!=i.to&&(te=r),u);u=r}}return u}function fc(n,t,i,r){if(!r)return t+i;do t+=i;while(t>0&&hf(n.text.charAt(t)));return t}function ec(n,t,i,r){var e=lt(n);if(!e)return fp(n,t,i,r);for(var o=lo(e,t),u=e[o],f=fc(n,t,u.level%2?-i:i,r);;){if(f>u.from&&f0==u.level%2?u.to:u.from);if(u=e[o+=i],!u)return null;f=i>0==u.level%2?fc(n,u.to,-1,r):fc(n,u.from,1,r)}}function fp(n,t,i,r){var u=t+i;if(r)for(;u>0&&hf(n.text.charAt(u));)u+=i;return 0>u||u>n.text.length?null:u}var ft=navigator.userAgent,ep=navigator.platform,ci=/gecko\/\d/i.test(ft),op=/MSIE \d/.test(ft),sp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ft),s=op||sp,a=s&&(op?document.documentMode||6:sp[1]),w=/WebKit\//.test(ft),rg=w&&/Qt\/\d+\.\d+/.test(ft),ug=/Chrome\//.test(ft),vt=/Opera\//.test(ft),hp=/Apple Computer/.test(navigator.vendor),fg=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ft),eg=/PhantomJS/.test(ft),nu=/AppleWebKit/.test(ft)&&/Mobile\/\w+/.test(ft),lf=nu||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ft),yt=nu||/Mac/.test(ep),og=/\bCrOS\b/.test(ft),sg=/win/i.test(ep),ir=vt&&ft.match(/Version\/(\d*\.\d*)/),hc,lc,ru,uu,po,fr,oi,yp,af,si,yf,ai,wo,pf,wf,fu,pp,wp,bp,rt,kp,bf,go,te,fw;ir&&(ir=Number(ir[1]));ir&&ir>=15&&(vt=!1,w=!0);var cp=yt&&(rg||vt&&(null==ir||12.11>ir)),oc=ci||s&&a>=9,lp=!1,li=!1;fs.prototype=at({update:function(n){var i=n.scrollWidth>n.clientWidth+1,r=n.scrollHeight>n.clientHeight+1,t=n.nativeBarWidth,u,f;return r?(this.vert.style.display="block",this.vert.style.bottom=i?t+"px":"0",u=n.viewHeight-(i?t:0),this.vert.firstChild.style.height=Math.max(0,n.scrollHeight-n.clientHeight+u)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),i?(this.horiz.style.display="block",this.horiz.style.right=r?t+"px":"0",this.horiz.style.left=n.barLeft+"px",f=n.viewWidth-n.barLeft-(r?t:0),this.horiz.firstChild.style.width=n.scrollWidth-n.clientWidth+f+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&n.clientHeight>0&&(0==t&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?t:0,bottom:i?t:0}},setScrollLeft:function(n){this.horiz.scrollLeft!=n&&(this.horiz.scrollLeft=n);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(n){this.vert.scrollTop!=n&&(this.vert.scrollTop=n);this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var n=yt&&!fg?"12px":"18px";this.horiz.style.height=this.vert.style.width=n;this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new nr;this.disableVert=new nr},enableZeroWidthBar:function(n,t){function i(){var r=n.getBoundingClientRect(),u=document.elementFromPoint(r.left+1,r.bottom-1);u!=n?n.style.pointerEvents="none":t.set(1e3,i)}n.style.pointerEvents="auto";t.set(1e3,i)},clear:function(){var n=this.horiz.parentNode;n.removeChild(this.horiz);n.removeChild(this.vert)}},fs.prototype);es.prototype=at({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},es.prototype);t.scrollbarModel={"native":fs,"null":es};re.prototype.signal=function(n,t){ht(n,t)&&this.events.push(arguments)};re.prototype.finish=function(){for(var n=0;n=9&&t.hasSelection&&(t.hasSelection=null);t.poll()});u(r,"paste",function(n){y(i,n)||hl(n,i)||(i.state.pasteIncoming=!0,t.fastPoll())});u(r,"cut",f);u(r,"copy",f);u(n.scroller,"paste",function(r){fi(n,r)||y(i,r)||(i.state.pasteIncoming=!0,t.focus())});u(n.lineSpace,"selectstart",function(t){fi(n,t)||nt(t)});u(r,"compositionstart",function(){var n=i.getCursor("from");t.composing&&t.composing.range.clear();t.composing={start:n,range:i.markText(n,i.getCursor("to"),{className:"CodeMirror-composing"})}});u(r,"compositionend",function(){t.composing&&(t.poll(),t.composing.range.clear(),t.composing=null)})},prepareSelection:function(){var n=this.cm,t=n.display,e=n.doc,i=ra(n);if(n.options.moveInputWithCursor){var r=ri(n,e.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+f.top-u.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+f.left-u.left))}return i},showSelection:function(n){var i=this.cm,t=i.display;ot(t.cursorDiv,n.cursors);ot(t.selectionDiv,n.selection);null!=n.teTop&&(this.wrapper.style.top=n.teTop+"px",this.wrapper.style.left=n.teLeft+"px")},reset:function(n){var i,f,t,e,r,u;this.contextMenuPending||(t=this.cm,e=t.doc,t.somethingSelected()?(this.prevInput="",r=e.sel.primary(),i=uw&&(r.to().line-r.from().line>100||(f=t.getSelection()).length>1e3),u=i?"-":f||t.getSelection(),this.textarea.value=u,t.state.focused&&eu(this.textarea),s&&a>=9&&(this.hasSelection=u)):n||(this.prevInput=this.textarea.value="",s&&a>=9&&(this.hasSelection=null)),this.inaccurateSelection=i)},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!lf||dt()!=this.textarea))try{this.textarea.focus()}catch(n){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var n=this;n.pollingFast||n.polling.set(this.cm.options.pollInterval,function(){n.poll();n.cm.state.focused&&n.slowPoll()})},fastPoll:function(){function t(){var r=n.poll();r||i?(n.pollingFast=!1,n.slowPoll()):(i=!0,n.polling.set(60,t))}var i=!1,n=this;n.pollingFast=!0;n.polling.set(20,t)},poll:function(){var n=this.cm,f=this.textarea,r=this.prevInput,t,e,u,o,i;if(this.contextMenuPending||!n.state.focused||dg(f)&&!r&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq||(t=f.value,t==r&&!n.somethingSelected()))return!1;if(s&&a>=9&&this.hasSelection===t||yt&&/[\uf700-\uf7ff]/.test(t))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu&&(e=t.charCodeAt(0),8203!=e||r||(r="​"),8666==e))return this.reset(),this.cm.execCommand("undo");for(u=0,o=Math.min(r.length,t.length);o>u&&r.charCodeAt(u)==t.charCodeAt(u);)++u;return i=this,et(n,function(){oe(n,t.slice(u),r.length-u,null,i.composing?"*compose":null);t.length>1e3||t.indexOf("\n")>-1?f.value=i.prevInput="":i.prevInput=t;i.composing&&(i.composing.range.clear(),i.composing.range=n.markText(i.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){s&&a>=9&&(this.hasSelection=null);this.fastPoll()},onContextMenu:function(n){function c(){if(null!=i.selectionStart){var n=t.somethingSelected(),u="​"+(n?i.value:"");i.value="⇚";i.value=u;f.prevInput=n?"":"​";i.selectionStart=1;i.selectionEnd=u.length;r.selForContextMenu=t.doc.sel}}function l(){if(f.contextMenuPending=!1,f.wrapper.style.cssText=k,i.style.cssText=p,s&&9>a&&r.scrollbars.setScrollTop(r.scroller.scrollTop=g),null!=i.selectionStart){(!s||s&&9>a)&&c();var u=0,n=function(){r.selForContextMenu==t.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==f.prevInput?v(t,af.selectAll)(t):u++<10?r.detectingSelectAll=setTimeout(n,500):r.input.reset()};r.detectingSelectAll=setTimeout(n,200)}}var f=this,t=f.cm,r=t.display,i=f.textarea,e=wi(t,n),g=r.scroller.scrollTop,y,p,k,o,d,h;e&&!vt&&(y=t.options.resetSelectionOnContextMenu,y&&-1==t.doc.sel.contains(e)&&v(t,b)(t.doc,ii(e),ni),p=i.style.cssText,k=f.wrapper.style.cssText,f.wrapper.style.cssText="position: absolute",o=f.wrapper.getBoundingClientRect(),(i.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(n.clientY-o.top-5)+"px; left: "+(n.clientX-o.left-5)+"px; z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",w)&&(d=window.scrollY),(r.input.focus(),w&&window.scrollTo(null,d),r.input.reset(),t.somethingSelected()||(i.value=f.prevInput=" "),f.contextMenuPending=!0,r.selForContextMenu=t.doc.sel,clearTimeout(r.detectingSelectAll),s&&a>=9&&c(),oc)?(bo(n),h=function(){gt(window,"mouseup",h);setTimeout(l,20)},u(window,"mouseup",h)):setTimeout(l,50))},readOnlyChanged:function(n){n||this.reset()},setUneditable:of,needsContentAttribute:!1},bs.prototype);ks.prototype=at({init:function(t){function e(n){var r,t,u,f;if(!y(i,n)){if(i.somethingSelected())it={lineWise:!1,text:i.getSelections()},"cut"==n.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;r=ll(i);it={lineWise:!0,text:r.text};"cut"==n.type&&i.operation(function(){i.setSelections(r.ranges,0,ni);i.replaceSelection("",null,"cut")})}n.clipboardData&&!nu?(n.preventDefault(),n.clipboardData.clearData(),n.clipboardData.setData("text/plain",it.text.join("\n"))):(t=vl(),u=t.firstChild,i.display.lineSpace.insertBefore(t,i.display.lineSpace.firstChild),u.value=it.text.join("\n"),f=document.activeElement,eu(u),setTimeout(function(){i.display.lineSpace.removeChild(t);f.focus()},50))}}var r=this,i=r.cm,f=r.div=t.lineDiv;al(f);u(f,"paste",function(n){y(i,n)||hl(n,i)});u(f,"compositionstart",function(t){var u=t.data;if(r.composing={sel:i.doc.sel,data:u,startData:u},u){var f=i.doc.sel.primary(),o=i.getLine(f.head.line),e=o.indexOf(u,Math.max(0,f.head.ch-u.length));e>-1&&e<=f.head.ch&&(r.composing.sel=ii(n(f.head.line,e),n(f.head.line,e+u.length)))}});u(f,"compositionupdate",function(n){r.composing.data=n.data});u(f,"compositionend",function(n){var t=r.composing;t&&(n.data==t.startData||/\u200b/.test(n.data)||(t.data=n.data),setTimeout(function(){t.handled||r.applyComposition(t);r.composing==t&&(r.composing=null)},50))});u(f,"touchstart",function(){r.forceCompositionEnd()});u(f,"input",function(){r.composing||!i.isReadOnly()&&r.pollContent()||et(r.cm,function(){tt(i)})});u(f,"copy",e);u(f,"cut",e)},prepareSelection:function(){var n=ra(this.cm,!1);return n.focus=this.cm.state.focused,n},showSelection:function(n,t){n&&this.cm.display.view.length&&((n.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(n))},showPrimarySelection:function(){var n=window.getSelection(),o=this.cm.doc.sel.primary(),s=se(this.cm,n.anchorNode,n.anchorOffset),h=se(this.cm,n.focusNode,n.focusOffset),t,r,c,l,u,i,f;if((!s||s.bad||!h||h.bad||0!=e(ee(s,h),o.from())||0!=e(fe(s,h),o.to()))&&(t=yl(this.cm,o.from()),r=yl(this.cm,o.to()),t||r)){c=this.cm.display.view;l=n.rangeCount&&n.getRangeAt(0);t?r||(u=c[c.length-1].measure,i=u.maps?u.maps[u.maps.length-1]:u.map,r={node:i[i.length-1],offset:i[i.length-2]-i[i.length-3]}):t={node:c[0].measure.map[2],offset:0};try{f=er(t.node,t.offset,r.offset,r.node)}catch(a){}f&&(!ci&&this.cm.state.focused?(n.collapse(t.node,t.offset),f.collapsed||n.addRange(f)):(n.removeAllRanges(),n.addRange(f)),l&&null==n.anchorNode?n.addRange(l):ci&&this.startGracePeriod());this.rememberSelection()}},startGracePeriod:function(){var n=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){n.gracePeriod=!1;n.selectionChanged()&&n.cm.operation(function(){n.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(n){ot(this.cm.display.cursorDiv,n.cursors);ot(this.cm.display.selectionDiv,n.selection)},rememberSelection:function(){var n=window.getSelection();this.lastAnchorNode=n.anchorNode;this.lastAnchorOffset=n.anchorOffset;this.lastFocusNode=n.focusNode;this.lastFocusOffset=n.focusOffset},selectionInEditor:function(){var n=window.getSelection(),t;return n.rangeCount?(t=n.getRangeAt(0).commonAncestorContainer,go(this.div,t)):!1},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(){function t(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,t))}var n=this;this.selectionInEditor()?this.pollSelection():et(this.cm,function(){n.cm.curOp.selectionChanged=!0});this.polling.set(this.cm.options.pollInterval,t)},selectionChanged:function(){var n=window.getSelection();return n.anchorNode!=this.lastAnchorNode||n.anchorOffset!=this.lastAnchorOffset||n.focusNode!=this.lastFocusNode||n.focusOffset!=this.lastFocusOffset},pollSelection:function(){var t,n,i,r;this.composing||this.gracePeriod||!this.selectionChanged()||(t=window.getSelection(),n=this.cm,this.rememberSelection(),i=se(n,t.anchorNode,t.anchorOffset),r=se(n,t.focusNode,t.focusOffset),i&&r&&et(n,function(){b(n.doc,ii(i,r),ni);(i.bad||r.bad)&&(n.curOp.selectionChanged=!0)}))},pollContent:function(){var f=this.cm,i=f.display,tt=f.doc.sel.primary(),p=tt.from(),it=tt.to(),w,l,b,y,s,k,t,u,g,nt;if(p.linei.viewTo-1)return!1;for(p.line==i.viewFrom||0==(w=pi(f,p.line))?(l=c(i.view[0].line),b=i.view[0].node):(l=c(i.view[w].line),b=i.view[w-1].node.nextSibling),y=pi(f,it.line),y==i.view.length-1?(s=i.viewTo-1,k=i.lineDiv.lastChild):(s=c(i.view[y+1].line)-1,k=i.view[y+1].node.previousSibling),t=f.doc.splitLines(ww(f,b,k,l,s)),u=di(f.doc,n(l,0),n(s,r(f.doc,s).text.length));t.length>1&&u.length>1;)if(h(t)==h(u))t.pop(),u.pop(),s--;else{if(t[0]!=u[0])break;t.shift();u.shift();l++}for(var o=0,a=0,rt=t[0],ut=u[0],ft=Math.min(rt.length,ut.length);ft>o&&rt.charCodeAt(o)==ut.charCodeAt(o);)++o;for(var v=h(t),d=h(u),et=Math.min(v.length-(1==t.length?o:0),d.length-(1==u.length?o:0));et>a&&v.charCodeAt(v.length-a-1)==d.charCodeAt(d.length-a-1);)++a;return t[t.length-1]=v.slice(0,v.length-a),t[0]=t[0].slice(o),g=n(l,o),nt=n(s,u.length?h(u).length-a:0),t.length>1||t[0]||e(g,nt)?(pr(f.doc,t,g,nt,"+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(n){this.cm.isReadOnly()?v(this.cm,tt)(this.cm):n.data&&n.data!=n.startData&&v(this.cm,oe)(this.cm,n.data,0,n.sel)},setUneditable:function(n){n.contentEditable="false"},onKeyPress:function(n){n.preventDefault();this.cm.isReadOnly()||v(this.cm,oe)(this.cm,String.fromCharCode(null==n.charCode?n.keyCode:n.charCode),0)},readOnlyChanged:function(n){this.div.contentEditable=String("nocursor"!=n)},onContextMenu:of,resetPosition:of,needsContentAttribute:!0},ks.prototype);t.inputStyles={textarea:bs,contenteditable:ks};ti.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(n){var t,i,r;if(n==this)return!0;if(n.primIndex!=this.primIndex||n.ranges.length!=this.ranges.length)return!1;for(t=0;t=0&&e(n,r.to())<=0)return i;return-1}};l.prototype={from:function(){return ee(this.anchor,this.head)},to:function(){return fe(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var rr,ao,vo,sc={left:0,right:0,top:0,bottom:0},tu=null,hg=0,ap=0,yo=0,st=null;s?st=-.53:ci?st=15:ug?st=-.7:hp&&(st=-1/3);hc=function(n){var i=n.wheelDeltaX,t=n.wheelDeltaY;return null==i&&n.detail&&n.axis==n.HORIZONTAL_AXIS&&(i=n.detail),null==t&&n.detail&&n.axis==n.VERTICAL_AXIS?t=n.detail:null==t&&(t=n.wheelDelta),{x:i,y:t}};t.wheelEventPixels=function(n){var t=hc(n);return t.x*=st,t.y*=st,t};var cg=new nr,cc=null,ur=t.changeEnd=function(t){return t.text?n(t.from.line+t.text.length-1,h(t.text).length+(1==t.text.length?t.from.ch:0)):t.to};t.prototype={constructor:t,focus:function(){window.focus();this.display.input.focus()},setOption:function(n,t){var i=this.options,r=i[n];i[n]==t&&"mode"!=n||(i[n]=t,iu.hasOwnProperty(n)&&v(this,iu[n])(this,t,r))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,t){this.state.keyMaps[t?"push":"unshift"](no(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,t=0;tr&&(nf(this,i.head.line,n,!0),r=i.head.line,t==this.doc.sel.primIndex&&wr(this));else{var o=i.from(),s=i.to(),h=Math.max(r,o.line);for(r=Math.min(this.lastLine(),s.line-(s.ch?0:1))+1,u=h;r>u;++u)nf(this,u,n);f=this.doc.sel.ranges;0==o.ch&&e.length==f.length&&f[t].from().ch>0&&ds(this.doc,t,new l(o,f[t].to()),ni)}}),getTokenAt:function(n,t){return uy(this,n,t)},getLineTokens:function(t,i){return uy(this,n(t),i,!0)},getTokenTypeAt:function(n){var t,f;n=o(this.doc,n);var i,u=oy(this,r(this.doc,n.line)),s=0,h=(u.length-1)/2,e=n.ch;if(0==e)i=u[2];else for(;;)if(t=s+h>>1,(t?u[2*t-1]:0)>=e)h=t;else{if(!(u[2*t+1]f?i:0==f?null:i.slice(0,f-1)},getModeAt:function(n){var i=this.doc.mode;return i.innerMode?t.innerMode(i,this.getTokenAt(n).state).mode:i},getHelper:function(n,t){return this.getHelpers(n,t)[0]},getHelpers:function(n,t){var u=[],r,i,o,f,e;if(!fr.hasOwnProperty(t))return u;if(r=fr[t],i=this.getModeAt(n),"string"==typeof i[t])r[i[t]]&&u.push(r[i[t]]);else if(i[t])for(f=0;fu&&(n=u,f=!0),i=r(this.doc,n)):i=n,fh(this,i,{top:0,left:0},t||"page").top+(f?this.doc.height-ei(i):0)},defaultTextHeight:function(){return yi(this.display)},defaultCharWidth:function(){return bu(this.display)},setGutterMarker:k(function(n,t,i){return ge(this.doc,n,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&tp(r)&&(n.gutterMarkers=null),!0})}),clearGutter:k(function(n){var t=this,i=t.doc,r=i.first;i.iter(function(i){i.gutterMarkers&&i.gutterMarkers[n]&&(i.gutterMarkers[n]=null,ui(t,r,"gutter"),tp(i.gutterMarkers)&&(i.gutterMarkers=null));++r})}),lineInfo:function(n){var t;if("number"==typeof n){if(!lu(this.doc,n)||(t=n,n=r(this.doc,n),!n))return null}else if(t=c(n),null==t)return null;return{line:t,handle:n,text:n.text,gutterMarkers:n.gutterMarkers,textClass:n.textClass,bgClass:n.bgClass,wrapClass:n.wrapClass,widgets:n.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,t,i,r,u){var s=this.display,e,f,h,c;n=ri(this,o(this.doc,n));e=n.bottom;f=n.left;(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t),"over"==r)?e=n.top:("above"==r||"near"==r)&&(h=Math.max(s.wrapper.clientHeight,this.doc.height),c=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth),("above"==r||n.bottom+t.offsetHeight>h)&&n.top>t.offsetHeight?e=n.top-t.offsetHeight:n.bottom+t.offsetHeight<=h&&(e=n.bottom),f+t.offsetWidth>c&&(f=c-t.offsetWidth));t.style.top=e+"px";t.style.left=t.style.right="";"right"==u?(f=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==u?f=0:"middle"==u&&(f=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=f+"px");i&&ak(this,f,e,f+t.offsetWidth,e+t.offsetHeight)},triggerOnKeyDown:k(iv),triggerOnKeyPress:k(uv),triggerOnKeyUp:rv,execCommand:function(n){if(af.hasOwnProperty(n))return af[n].call(null,this)},triggerElectric:k(function(n){cl(this,n)}),findPosH:function(n,t,i,r){var e=1,f,u;for(0>t&&(e=-1,t=-t),f=0,u=o(this.doc,n);t>f&&(u=lh(this.doc,u,e,i,r),!u.hitSide);++f);return u},moveH:k(function(n,t){var i=this;i.extendSelectionsBy(function(r){return i.display.shift||i.doc.extend||r.empty()?lh(i.doc,r.head,n,t,i.options.rtlMoveVisually):0>n?r.from():r.to()},df)}),deleteH:k(function(n,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):br(this,function(r){var u=lh(i,r.head,n,t,!1);return 0>n?{from:u,to:r.head}:{from:r.head,to:u}})}),findPosV:function(n,t,i,r){var h=1,e=r,s,u,f;for(0>t&&(h=-1,t=-t),s=0,u=o(this.doc,n);t>s;++s)if(f=ri(this,u,"div"),null==e?e=f.left:f.left=e,u=lv(this,f,h,i),u.hitSide)break;return u},moveV:k(function(n,t){var r=this,i=this.doc,f=[],e=!r.display.shift&&!i.extend&&i.sel.somethingSelected(),u;if(i.extendSelectionsBy(function(u){var o,s;return e?0>n?u.from():u.to():(o=ri(r,u.head,"div"),null!=u.goalColumn&&(o.left=u.goalColumn),f.push(o.left),s=lv(r,o,n,t),"page"==t&&u==i.sel.primary()&&ch(r,null,eh(r,s,"div").top-o.top),s)},df),f.length)for(u=0;u0&&s(u.charAt(i-1));)--i;for(;f.5)&&ts(this);p(this,"refresh",this)}),swapDoc:k(function(n){var t=this.doc;return t.cm=null,ay(this,n),wu(this),this.display.input.reset(),this.scrollTo(n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,ut(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}};gr(t);var lg=t.defaults={},iu=t.optionHandlers={},vp=t.Init={toString:function(){return"CodeMirror.Init"}};f("value","",function(n,t){n.setValue(t)},!0);f("mode",null,function(n,t){n.doc.modeOption=t;ns(n)},!0);f("indentUnit",2,ns,!0);f("indentWithTabs",!1);f("smartIndent",!0);f("tabSize",4,function(n){ou(n);wu(n);tt(n)},!0);f("lineSeparator",null,function(t,i){var r,f,u;if(t.doc.lineSep=i,i)for(r=[],f=t.doc.first,t.doc.iter(function(t){for(var u,e=0;;){if(u=t.text.indexOf(i,e),-1==u)break;e=u+i.length;r.push(n(f,u))}f++}),u=r.length-1;u>=0;u--)pr(t.doc,i,r[u],n(r[u].line,r[u].ch+i.length))});f("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(n,i,r){n.state.specialChars=new RegExp(i.source+(i.test("\t")?"":"|\t"),"g");r!=t.Init&&n.refresh()});f("specialCharPlaceholder",fd,function(n){n.refresh()},!0);f("electricChars",!0);f("inputStyle",lf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor");},!0);f("rtlMoveVisually",!sg);f("wholeLineUpdateBefore",!0);f("theme","default",function(n){bc(n);su(n)},!0);f("keyMap","default",function(n,i,r){var f=no(i),u=r!=t.Init&&no(r);u&&u.detach&&u.detach(n,f);f.attach&&f.attach(n,u||null)});f("extraKeys",null);f("lineWrapping",!1,ow,!0);f("gutters",[],function(n){us(n.options);su(n)},!0);f("fixedGutter",!0,function(n,t){n.display.gutters.style.left=t?cs(n.display)+"px":"0";n.refresh()},!0);f("coverGutterNextToScrollbar",!1,function(n){sr(n)},!0);f("scrollbarStyle","native",function(n){dc(n);sr(n);n.display.scrollbars.setScrollTop(n.doc.scrollTop);n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0);f("lineNumbers",!1,function(n){us(n.options);su(n)},!0);f("firstLineNumber",1,su,!0);f("lineNumberFormatter",function(n){return n},su,!0);f("showCursorWhenSelecting",!1,vu,!0);f("resetSelectionOnContextMenu",!0);f("lineWiseCopyCut",!0);f("readOnly",!1,function(n,t){"nocursor"==t?(du(n),n.display.input.blur(),n.display.disabled=!0):n.display.disabled=!1;n.display.input.readOnlyChanged(t)});f("disableInput",!1,function(n,t){t||n.display.input.reset()},!0);f("dragDrop",!0,pb);f("allowDropFileTypes",null);f("cursorBlinkRate",530);f("cursorScrollMargin",0);f("cursorHeight",1,vu,!0);f("singleCursorHeightPerLine",!0,vu,!0);f("workTime",100);f("workDelay",100);f("flattenSpans",!0,ou,!0);f("addModeClass",!1,ou,!0);f("pollInterval",100);f("undoDepth",200,function(n,t){n.doc.history.undoDepth=t});f("historyEventDelay",1250);f("viewportMargin",10,function(n){n.refresh()},!0);f("maxHighlightLength",1e4,ou,!0);f("moveInputWithCursor",!0,function(n,t){t||n.display.input.resetPosition()});f("tabindex",null,function(n,t){n.display.input.getField().tabIndex=t||""});f("autofocus",null);lc=t.modes={};ru=t.mimeModes={};t.defineMode=function(n,i){t.defaults.mode||"null"==n||(t.defaults.mode=n);arguments.length>2&&(i.dependencies=Array.prototype.slice.call(arguments,2));lc[n]=i};t.defineMIME=function(n,t){ru[n]=t};t.resolveMode=function(n){if("string"==typeof n&&ru.hasOwnProperty(n))n=ru[n];else if(n&&"string"==typeof n.name&&ru.hasOwnProperty(n.name)){var i=ru[n.name];"string"==typeof i&&(i={name:i});n=np(i,n);n.name=i.name}else if("string"==typeof n&&/^[\w\-]+\/[\w\-]+\+xml$/.test(n))return t.resolveMode("application/xml");return"string"==typeof n?{name:n}:n||{name:"null"}};t.getMode=function(n,i){var i=t.resolveMode(i),e=lc[i.name],u,f,r;if(!e)return t.getMode(n,"text/plain");if(u=e(n,i),uu.hasOwnProperty(i.name)){f=uu[i.name];for(r in f)f.hasOwnProperty(r)&&(u.hasOwnProperty(r)&&(u["_"+r]=u[r]),u[r]=f[r])}if(u.name=i.name,i.helperType&&(u.helperType=i.helperType),i.modeProps)for(r in i.modeProps)u[r]=i.modeProps[r];return u};t.defineMode("null",function(){return{token:function(n){n.skipToEnd()}}});t.defineMIME("text/plain","null");uu=t.modeExtensions={};t.extendMode=function(n,t){var i=uu.hasOwnProperty(n)?uu[n]:uu[n]={};at(t,i)};t.defineExtension=function(n,i){t.prototype[n]=i};t.defineDocExtension=function(n,t){rt.prototype[n]=t};t.defineOption=f;po=[];t.defineInitHook=function(n){po.push(n)};fr=t.helpers={};t.registerHelper=function(n,i,r){fr.hasOwnProperty(n)||(fr[n]=t[n]={_global:[]});fr[n][i]=r};t.registerGlobalHelper=function(n,i,r,u){t.registerHelper(n,i,u);fr[n]._global.push({pred:r,val:u})};oi=t.copyState=function(n,t){var r,u,i;if(t===!0)return t;if(n.copyState)return n.copyState(t);r={};for(u in t)i=t[u],i instanceof Array&&(i=i.concat([])),r[u]=i;return r};yp=t.startState=function(n,t,i){return n.startState?n.startState(t,i):!0};t.innerMode=function(n,t){for(;n.innerMode;){var i=n.innerMode(t);if(!i||i.mode==n)break;t=i.state;n=i.mode}return i||{mode:n,state:t}};af=t.commands={selectAll:function(t){t.setSelection(n(t.firstLine(),0),n(t.lastLine()),ni)},singleSelection:function(n){n.setSelection(n.getCursor("anchor"),n.getCursor("head"),ni)},killLine:function(t){br(t,function(i){if(i.empty()){var u=r(t.doc,i.head.line).text.length;return i.head.ch==u&&i.head.line0)?(i=new n(i.line,i.ch+1),t.replaceRange(u.charAt(i.ch-1)+u.charAt(i.ch-2),n(i.line,i.ch-2),i,"+transpose")):i.line>t.doc.first&&(f=r(t.doc,i.line-1).text,f&&t.replaceRange(u.charAt(0)+t.doc.lineSeparator()+f.charAt(f.length-1),n(i.line-1,f.length-1),n(i.line,1),"+transpose"))),s.push(new l(i,i));t.setSelections(s)})},newlineAndIndent:function(n){et(n,function(){for(var i,r=n.listSelections().length,t=0;r>t;t++)i=n.listSelections()[t],n.replaceRange(n.doc.lineSeparator(),i.anchor,i.head,"+input"),n.indentLine(i.from().line+1,null,!0);wr(n)})},openLine:function(n){n.replaceSelection("\n","start")},toggleOverwrite:function(n){n.toggleOverwrite()}};si=t.keyMap={};si.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"};si.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"};si.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"};si.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"]};si["default"]=yt?si.macDefault:si.pcDefault;t.normalizeKeyMap=function(n){var f={},t,o,i,r,e,u,s,h;for(t in n)if(n.hasOwnProperty(t)){if(o=n[t],/^(name|fallthrough|(de|at)tach)$/.test(t))continue;if("..."==o){delete n[t];continue}for(i=oo(t.split(" "),vk),r=0;r=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var n=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>n},skipToEnd:function(){this.pos=this.string.length},skipTo:function(n){var t=this.string.indexOf(n,this.pos);if(t>-1)return(this.pos=t,!0)},backUp:function(n){this.pos-=n},column:function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)):(u=function(n){return i?n.toLowerCase():n},f=this.string.substr(this.pos,n.length),u(f)==u(n)?(t!==!1&&(this.pos+=n.length),!0):void 0)},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(n,t){this.lineStart+=n;try{return t()}finally{this.lineStart-=n}}};wo=0;ai=t.TextMarker=function(n,t){this.lines=[];this.type=t;this.doc=n;this.id=++wo};gr(ai);ai.prototype.clear=function(){var n,f,u,t,r,i,o,s;if(!this.explicitlyCleared){n=this.doc.cm;f=n&&!n.curOp;(f&&lr(n),ht(this,"clear"))&&(u=this.find(),u&&ut(this,"clear",u.from,u.to));for(var e=null,h=null,i=0;in.display.maxLineLength&&(n.display.maxLine=o,n.display.maxLineLength=s,n.display.maxLineChanged=!0);null!=e&&n&&this.collapsed&&tt(n,e,h+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,n&&na(n.doc));n&&ut(n,"markerCleared",n,this);f&&ar(n);this.parent&&this.parent.clear()}};ai.prototype.find=function(t,i){var f,o,e,r,u;for(null==t&&"bookmark"==this.type&&(t=1),e=0;ei;++i)r=this.lines[i],this.height-=r.height,ud(r),ut(r,"delete");this.lines.splice(n,t)},collapse:function(n){n.push.apply(n,this.lines)},insertInner:function(n,t,i){this.height+=i;this.lines=this.lines.slice(0,n).concat(t).concat(this.lines.slice(n));for(var r=0;rn;++n)if(i(this.lines[n]))return!0}};ef.prototype={chunkSize:function(){return this.size},removeInner:function(n,t){var r,i,u,f,o,e;for(this.size-=t,r=0;rn){if(f=Math.min(t,u-n),o=i.height,i.removeInner(n,f),this.height-=o-i.height,u==f&&(this.children.splice(r--,1),i.parent=null),0==(t-=f))break;n=0}else n-=u;this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ff))&&(e=[],this.collapse(e),this.children=[new ff(e)],this.children[0].parent=this)},collapse:function(n){for(var t=0;t=n){if(r.insertInner(n,t,i),r.lines&&r.lines.length>50){for(s=r.lines.length%25+25,f=s;f10);n.parent.maybeSpill()}},iterN:function(n,t,i){for(var f,u,e,r=0;rn){if(e=Math.min(t,u-n),f.iterN(n,e,i))return!0;if(0==(t-=e))break;n=0}else n-=u}};bp=0;rt=t.Doc=function(t,i,r,u){if(!(this instanceof rt))return new rt(t,i,r,u);null==r&&(r=0);ef.call(this,[new ff([new fu("",null)])]);this.first=r;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.frontier=r;var f=n(r,0);this.sel=ii(f);this.history=new uo(null);this.id=++bp;this.modeOption=i;this.lineSep=u;this.extend=!1;"string"==typeof t&&(t=this.splitLines(t));bh(this,{from:f,to:f,text:t});b(this,ii(f),ni)};rt.prototype=np(ef.prototype,{constructor:rt,iter:function(n,t,i){i?this.iterN(n-this.first,t-n,i):this.iterN(this.first,this.first+this.size,n)},insert:function(n,t){for(var r=0,i=0;i=0;r--)yr(this,u[r]);e?dl(this,e):this.cm&&wr(this.cm)}),undo:g(function(){be(this,"undo")}),redo:g(function(){be(this,"redo")}),undoSelection:g(function(){be(this,"undo",!0)}),redoSelection:g(function(){be(this,"redo",!0)}),setExtending:function(n){this.extend=n},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,i=0,r=0,n=0;n=n.ch)&&f.push(t.marker.parent||t.marker);return f},findMarks:function(n,t,i){n=o(this,n);t=o(this,t);var u=[],r=n.line;return this.iter(n.line,t.line+1,function(f){var s=f.markedSpans,o,e;if(s)for(o=0;o=e.to||null==e.from&&r!=n.line||null!=e.from&&r==t.line&&e.from>=t.ch||i&&!i(e.marker)||u.push(e.marker.parent||e.marker);++r}),u},getAllMarks:function(){var n=[];return this.iter(function(t){var r=t.markedSpans,i;if(r)for(i=0;it?(i=t,!0):(t-=f,void++r)}),o(this,n(r,i))},indexFromPos:function(n){var t,i;return(n=o(this,n),t=n.ch,n.linei&&(i=n.from),null!=n.to&&n.too||o>=t)return e+(t-f);e+=o-f;e+=i-e%i;f=o+1}},tw=t.findColumn=function(n,t,i){for(var f,e,r=0,u=0;;){if(f=n.indexOf("\t",r),-1==f&&(f=n.length),e=f-r,f==n.length||u+e>=t)return r+Math.min(e,t-u);if(u+=f-r,u+=i-u%i,r=f+1,u>=t)return r}},ko=[""],eu=function(n){n.select()};nu?eu=function(n){n.selectionStart=0;n.selectionEnd=n.value.length}:s&&(eu=function(n){try{n.select()}catch(t){}});var er,pg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,iw=t.isWordChar=function(n){return/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||pg.test(n))},wg=/[\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]/;er=document.createRange?function(n,t,i,r){var u=document.createRange();return u.setEnd(r||n,i),u.setStart(n,t),u}:function(n,t,i){var r=document.body.createTextRange();try{r.moveToElementText(n.parentNode)}catch(u){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};go=t.contains=function(n,t){if(3==t.nodeType&&(t=t.parentNode),n.contains)return n.contains(t);do if(11==t.nodeType&&(t=t.host),t==n)return!0;while(t=t.parentNode)};s&&11>a&&(dt=function(){try{return document.activeElement}catch(n){return document.body}});var vc,yc,gf=t.rmClass=function(n,t){var r=n.className,i=cf(t).exec(r),u;i&&(u=r.slice(i.index+i[0].length),n.className=r.slice(0,i.index)+(u?i[1]+u:""))},ne=t.addClass=function(n,t){var i=n.className;cf(t).test(i)||(n.className+=(i?" ":"")+t)},rw=!1,bg=function(){if(s&&9>a)return!1;var n=i("div");return"draggable"in n||"dragDrop"in n}(),kg=t.splitLines=3!="\n\nb".split(/\n/).length?function(n){for(var t,r,u,i=0,f=[],e=n.length;e>=i;)t=n.indexOf("\n",i),-1==t&&(t=n.length),r=n.slice(i,"\r"==n.charAt(t-1)?t-1:t),u=r.indexOf("\r"),-1!=u?(f.push(r.slice(0,u)),i+=u+1):(f.push(r),i=t+1);return f}:function(n){return n.split(/\r\n?|\n/)},dg=window.getSelection?function(n){try{return n.selectionStart!=n.selectionEnd}catch(t){return!1}}:function(n){try{var t=n.ownerDocument.selection.createRange()}catch(i){}return t&&t.parentElement()==n?0!=t.compareEndPoints("StartToEnd",t):!1},uw=function(){var n=i("div");return"oncopy"in n?!0:(n.setAttribute("oncopy","return;"),"function"==typeof n.oncopy)}(),pc=null,or=t.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"};return!function(){for(var n=0;10>n;n++)or[n+48]=or[n+96]=String(n);for(n=65;90>=n;n++)or[n]=String.fromCharCode(n);for(n=1;12>=n;n++)or[n+111]=or[n+63235]="F"+n}(),fw=function(){function e(n){return 247>=n?o.charAt(n):n>=1424&&1524>=n?"R":n>=1536&&1773>=n?s.charAt(n-1536):n>=1774&&2220>=n?"r":n>=8192&&8203>=n?"w":8204==n?"b":"L"}function n(n,t,i){this.level=n;this.from=t;this.to=i}var o="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",s="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",c=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,r=/[LRr]/,u=/[Lb1n]/,f=/[1n]/,t="L";return function(o){var b,tt,d,v,w,g,a,s,it,k,nt,y,rt;if(!c.test(o))return!1;for(var v,p=o.length,l=[],s=0;p>s;++s)l.push(v=e(o.charCodeAt(s)));for(s=0,b=t;p>s;++s)v=l[s],"m"==v?l[s]=b:b=v;for(s=0,d=t;p>s;++s)v=l[s],"1"==v&&"r"==d?l[s]="n":r.test(v)&&(d=v,"r"==v&&(l[s]="R"));for(s=1,b=l[0];p-1>s;++s)v=l[s],"+"==v&&"1"==b&&"1"==l[s+1]?l[s]="1":","!=v||b!=l[s+1]||"1"!=b&&"n"!=b||(l[s]=b),b=v;for(s=0;p>s;++s)if(v=l[s],","==v)l[s]="N";else if("%"==v){for(w=s+1;p>w&&"%"==l[w];++w);for(tt=s&&"!"==l[s-1]||p>w&&"1"==l[w]?"1":"N",y=s;w>y;++y)l[y]=tt;s=w-1}for(s=0,d=t;p>s;++s)v=l[s],"L"==d&&"1"==v?l[s]="L":r.test(v)&&(d=v);for(s=0;p>s;++s)if(i.test(l[s])){for(w=s+1;p>w&&i.test(l[w]);++w);for(var ut="L"==(s?l[s-1]:t),ft="L"==(p>w?l[w]:t),tt=ut||ft?"L":"R",y=s;w>y;++y)l[y]=tt;s=w-1}for(a=[],s=0;p>s;)if(u.test(l[s])){for(it=s,++s;p>s&&u.test(l[s]);++s);a.push(new n(0,it,s))}else{for(k=s,nt=a.length,++s;p>s&&"L"!=l[s];++s);for(y=k;s>y;)if(f.test(l[y])){for(y>k&&a.splice(nt,0,new n(1,k,y)),rt=y,++y;s>y&&f.test(l[y]);++y);a.splice(nt,0,new n(2,rt,y));k=y}else++y;s>k&&a.splice(nt,0,new n(1,k,s))}return 1==a[0].level&&(g=o.match(/^\s+/))&&(a[0].from=g[0].length,a.unshift(new n(0,0,g[0].length))),1==h(a).level&&(g=o.match(/\s+$/))&&(h(a).to-=g[0].length,a.push(new n(0,p-g[0].length,p))),2==a[0].level&&a.unshift(new n(1,a[0].to,a[0].to)),a[0].level!=h(a).level&&a.push(new n(a[0].level,p,p)),a}}(),t.version="5.15.2",t})},{}],11:[function(t,i,r){!function(u){"object"==typeof r&&"object"==typeof i?u(t("../../lib/codemirror"),t("../markdown/markdown"),t("../../addon/mode/overlay")):"function"==typeof n&&n.amd?n(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],u):u(CodeMirror)}(function(n){"use strict";var t=/^((?:(?: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;n.defineMode("gfm",function(i,r){function o(n){return n.code=!1,null}var f=0,s={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(n){return{code:n.code,codeBlock:n.codeBlock,ateSpace:n.ateSpace}},token:function(n,i){var e,u;return(i.combineTokens=null,i.codeBlock)?n.match(/^```+/)?(i.codeBlock=!1,null):(n.skipToEnd(),null):(n.sol()&&(i.code=!1),n.sol()&&n.match(/^```+/))?(n.skipToEnd(),i.codeBlock=!0,null):"`"===n.peek()?(n.next(),e=n.pos,n.eatWhile("`"),u=1+n.pos-e,i.code?u===f&&(i.code=!1):(f=u,i.code=!0),null):i.code?(n.next(),null):n.eatSpace()?(i.ateSpace=!0,null):(n.sol()||i.ateSpace)&&(i.ateSpace=!1,r.gitHubSpice!==!1)&&(n.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)||n.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))?(i.combineTokens=!0,"link"):n.match(t)&&"]("!=n.string.slice(n.start-2,n.start)&&(0==n.start||/\W/.test(n.string.charAt(n.start-1)))?(i.combineTokens=!0,"link"):(n.next(),null)},blankLine:o},u={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var e in r)u[e]=r[e];return u.name="markdown",n.overlayMode(n.getMode(i,u),s)},"markdown");n.defineMIME("text/x-gfm","gfm")})},{"../../addon/mode/overlay":8,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(t,i,r){!function(u){"object"==typeof r&&"object"==typeof i?u(t("../../lib/codemirror"),t("../xml/xml"),t("../meta")):"function"==typeof n&&n.amd?n(["../../lib/codemirror","../xml/xml","../meta"],u):u(CodeMirror)}(function(n){"use strict";n.defineMode("markdown",function(t,i){function g(i){var r,u;return n.findModeByName&&(r=n.findModeByName(i),r&&(i=r.mime||r.mimes[0])),u=n.getMode(t,i),"null"==u.name?null:u}function h(n,t,i){return t.f=t.inline=i,i(n,t)}function nt(n,t,i){return t.f=t.block=i,i(n,t)}function c(n){return!n||!/\S/.test(n.string)}function a(n){return n.linkTitle=!1,n.em=!1,n.strong=!1,n.strikethrough=!1,n.quote=0,n.indentedCode=!1,p&&n.f==l&&(n.f=f,n.block=o),n.trailingSpace=0,n.trailingSpaceNewLine=!1,n.prevLine=n.thisLine,n.thisLine=null,null}function o(t,f){var a=t.sol(),s=f.list!==!1,l=f.indentedCode,e,o;if(f.indentedCode=!1,s&&(f.indentationDiff>=0?(f.indentationDiff<4&&(f.indentation-=f.indentationDiff),f.list=null):f.list=f.indentation>0?null:!1),e=null,f.indentationDiff>=4)return t.skipToEnd(),l||c(f.prevLine)?(f.indentation-=4,f.indentedCode=!0,u.code):null;if(t.eatSpace())return null;if((e=t.match(ht))&&e[1].length<=6)return f.header=e[1].length,i.highlightFormatting&&(f.formatting="header"),f.f=f.inline,r(f);if(!(c(f.prevLine)||f.quote||s||l)&&(e=t.match(ct)))return f.header="="==e[0].charAt(0)?1:2,i.highlightFormatting&&(f.formatting="header"),f.f=f.inline,r(f);if(t.eat(">"))return f.quote=a?1:f.quote+1,i.highlightFormatting&&(f.formatting="quote"),t.eatSpace(),r(f);if("["===t.peek())return h(t,f,ft);if(t.match(st,!0))return f.hr=!0,u.hr;if((c(f.prevLine)||s)&&(t.match(w,!1)||t.match(b,!1))){for(o=null,t.match(w,!0)?o="ul":(t.match(b,!0),o="ol"),f.indentation=t.column()+t.current().length,f.list=!0;f.listStack&&t.column()")>-1)&&(i.f=f,i.block=o,i.htmlState=null)),u}function tt(n,t){return t.fencedChars&&n.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=it,null):t.localMode?t.localMode.token(n,t.localState):(n.skipToEnd(),u.code)}function it(n,t){n.match(t.fencedChars);t.block=o;t.f=f;t.fencedChars=null;i.highlightFormatting&&(t.formatting="code-block");t.code=1;var u=r(t);return t.code=0,u}function r(n){var t=[],r,f;if(n.formatting)for(t.push(u.formatting),"string"==typeof n.formatting&&(n.formatting=[n.formatting]),r=0;r=n.quote?t.push(u.formatting+"-"+n.formatting[r]+"-"+n.quote):t.push("error"));return n.taskOpen?(t.push("meta"),t.length?t.join(" "):null):n.taskClosed?(t.push("property"),t.length?t.join(" "):null):((n.linkHref?t.push(u.linkHref,"url"):(n.strong&&t.push(u.strong),n.em&&t.push(u.em),n.strikethrough&&t.push(u.strikethrough),n.linkText&&t.push(u.linkText),n.code&&t.push(u.code)),n.header&&t.push(u.header,u.header+"-"+n.header),n.quote&&(t.push(u.quote),!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=n.quote?t.push(u.quote+"-"+n.quote):t.push(u.quote+"-"+i.maxBlockquoteDepth)),n.list!==!1)&&(f=(n.listStack.length-1)%3,f?1===f?t.push(u.list2):t.push(u.list3):t.push(u.list1)),n.trailingSpaceNewLine?t.push("trailing-space-new-line"):n.trailingSpace&&t.push("trailing-space-"+(n.trailingSpace%2?"a":"b")),t.length?t.join(" "):null)}function rt(n,t){if(n.match(lt,!0))return r(t)}function f(t,f){var tt=f.text(t,f),it,rt,o,c,ut,ft,a,p,s,w,et,b,d,g,h;if("undefined"!=typeof tt)return tt;if(f.list)return f.list=null,r(f);if(f.taskList)return it="x"!==t.match(k,!0)[1],it?f.taskOpen=!0:f.taskClosed=!0,i.highlightFormatting&&(f.formatting="task"),f.taskList=!1,r(f);if(f.taskOpen=!1,f.taskClosed=!1,f.header&&t.match(/^#+$/,!0))return i.highlightFormatting&&(f.formatting="header"),r(f);if(rt=t.sol(),o=t.next(),f.linkTitle&&(f.linkTitle=!1,c=o,"("===o&&(c=")"),c=(c+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),ut="^\\s*(?:[^"+c+"\\\\]+|\\\\\\\\|\\\\.)"+c,t.match(new RegExp(ut),!0)))return u.linkHref;if("`"===o)return(ft=f.formatting,i.highlightFormatting&&(f.formatting="code"),t.eatWhile("`"),a=t.current().length,0==f.code)?(f.code=a,r(f)):a==f.code?(h=r(f),f.code=0,h):(f.formatting=ft,r(f));if(f.code)return r(f);if("\\"===o&&(t.next(),i.highlightFormatting))return s=r(f),p=u.formatting+"-escape",s?s+" "+p:p;if("!"===o&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),f.inline=f.f=y,u.image;if("["===o&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1))return f.linkText=!0,i.highlightFormatting&&(f.formatting="link"),r(f);if("]"===o&&f.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1))return i.highlightFormatting&&(f.formatting="link"),s=r(f),f.linkText=!1,f.inline=f.f=y,s;if("<"===o&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return f.f=f.inline=v,i.highlightFormatting&&(f.formatting="link"),s=r(f),s?s+=" ":s="",s+u.linkInline;if("<"===o&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return f.f=f.inline=v,i.highlightFormatting&&(f.formatting="link"),s=r(f),s?s+=" ":s="",s+u.linkEmail;if("<"===o&&t.match(/^(!--|\w)/,!1))return w=t.string.indexOf(">",t.pos),-1!=w&&(et=t.string.substring(t.start,w),/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(et)&&(f.md_inside=!0)),t.backUp(1),f.htmlState=n.startState(e),nt(t,f,l);if("<"===o&&t.match(/^\/\w*?>/))return f.md_inside=!1,"tag";if(b=!1,!i.underscoresBreakWords&&"_"===o&&"_"!==t.peek()&&t.match(/(\w)/,!1)&&(d=t.pos-2,d>=0&&(g=t.string.charAt(d),"_"!==g&&g.match(/(\w)/,!1)&&(b=!0))),"*"!==o&&("_"!==o||b)){if(" "===o&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return r(f);t.backUp(1)}}else if(!rt||" "!==t.peek()){if(f.strong===o&&t.eat(o))return i.highlightFormatting&&(f.formatting="strong"),h=r(f),f.strong=!1,h;if(!f.strong&&t.eat(o))return f.strong=o,i.highlightFormatting&&(f.formatting="strong"),r(f);if(f.em===o)return i.highlightFormatting&&(f.formatting="em"),h=r(f),f.em=!1,h;if(!f.em)return f.em=o,i.highlightFormatting&&(f.formatting="em"),r(f)}if(i.strikethrough)if("~"===o&&t.eatWhile(o)){if(f.strikethrough)return i.highlightFormatting&&(f.formatting="strikethrough"),h=r(f),f.strikethrough=!1,h;if(t.match(/^[^\s]/,!1))return f.strikethrough=!0,i.highlightFormatting&&(f.formatting="strikethrough"),r(f)}else if(" "===o&&t.match(/^~~/,!0)){if(" "===t.peek())return r(f);t.backUp(2)}return" "===o&&(t.match(/ +$/,!1)?f.trailingSpace++:f.trailingSpace&&(f.trailingSpaceNewLine=!0)),r(f)}function v(n,t){var o=n.next(),e;return">"===o?(t.f=t.inline=f,i.highlightFormatting&&(t.formatting="link"),e=r(t),e?e+=" ":e="",e+u.linkInline):(n.match(/^[^>]+/,!0),u.linkInline)}function y(n,t){if(n.eatSpace())return null;var u=n.next();return"("===u||"["===u?(t.f=t.inline=ut("("===u?")":"]",0),i.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,r(t)):"error"}function ut(n){return function(t,u){var o=t.next(),e;return o===n?(u.f=u.inline=f,i.highlightFormatting&&(u.formatting="link-string"),e=r(u),u.linkHref=!1,e):(t.match(vt[n]),u.linkHref=!0,r(u))}}function ft(n,t){return n.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=et,n.next(),i.highlightFormatting&&(t.formatting="link"),t.linkText=!0,r(t)):h(n,t,f)}function et(n,t){if(n.match(/^\]:/,!0)){t.f=t.inline=ot;i.highlightFormatting&&(t.formatting="link");var f=r(t);return t.linkText=!1,f}return n.match(/^([^\]\\]|\\.)+/,!0),u.linkText}function ot(n,t){return n.eatSpace()?null:(n.match(/^[^\s]+/,!0),void 0===n.peek()?t.linkTitle=!0:n.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=f,u.linkHref+" url")}var e=n.getMode(t,"text/html"),p="null"==e.name,u,s;void 0===i.highlightFormatting&&(i.highlightFormatting=!1);void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0);void 0===i.underscoresBreakWords&&(i.underscoresBreakWords=!0);void 0===i.taskLists&&(i.taskLists=!1);void 0===i.strikethrough&&(i.strikethrough=!1);void 0===i.tokenTypeOverrides&&(i.tokenTypeOverrides={});u={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(s in u)u.hasOwnProperty(s)&&i.tokenTypeOverrides[s]&&(u[s]=i.tokenTypeOverrides[s]);var st=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^[*\-+]\s+/,b=/^[0-9]+([.)])\s+/,k=/^\[(x| )\](?=\s)/,ht=i.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ct=/^ *(?:\={1,}|-{1,})\s*$/,lt=/^[^#!\[\]*_\\<>` "'(~]+/,at=new RegExp("^("+(i.fencedCodeBlocks===!0?"~~~+|```+":i.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),vt={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},d={startState:function(){return{f:o,prevLine:null,thisLine:null,block:o,htmlState:null,indentation:0,inline:f,text:rt,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&n.copyState(e,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?n.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(n,t){var i,r;if(t.formatting=!1,n!=t.thisLine){if(i=t.header||t.hr,t.header=0,t.hr=!1,n.match(/^\s*$/,!0)||i){if(a(t),!i)return null;t.prevLine=null}if(t.prevLine=t.thisLine,t.thisLine=n,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block,r=n.match(/^\s*/,!0)[0].replace(/\t/g," ").length,t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(n,t)},innerMode:function(n){return n.block==l?{state:n.htmlState,mode:e}:n.localState?{state:n.localState,mode:n.localMode}:{state:n,mode:d}},blankLine:a,getType:r,fold:"markdown"};return d},"xml");n.defineMIME("text/x-markdown","markdown")})},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(t,i,r){!function(u){"object"==typeof r&&"object"==typeof i?u(t("../lib/codemirror")):"function"==typeof n&&n.amd?n(["../lib/codemirror"],u):u(CodeMirror)}(function(n){"use strict";var t,i;for(n.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"]}],t=0;t-1&&t.substring(u+1,t.length),f?n.findModeByExtension(f):void 0};n.findModeByName=function(t){var r,i,u;for(t=t.toLowerCase(),r=0;r")):null:n.match("--")?i(v("comment","-->")):n.match("DOCTYPE",!0,!0)?(n.eatWhile(/[\w\._\-]/),i(y(1))):null:n.eat("?")?(n.eatWhile(/[\w\._\-]/),t.tokenize=v("meta","?>"),"meta"):(c=n.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket"):"&"==r?(u=n.eat("#")?n.eat("x")?n.eatWhile(/[a-fA-F\d]/)&&n.eat(";"):n.eatWhile(/[\d]/)&&n.eat(";"):n.eatWhile(/[\w\.\-:]/)&&n.eat(";"),u?"atom":"error"):(n.eatWhile(/[^&<]/),null)}function a(n,t){var i=n.next(),r;return">"==i||"/"==i&&n.eat(">")?(t.tokenize=o,c=">"==i?"endTag":"selfcloseTag","tag bracket"):"="==i?(c="equals",null):"<"==i?(t.tokenize=o,t.state=l,t.tagName=t.tagStart=null,r=t.tokenize(n,t),r?r+" tag error":"tag error"):/[\'\"]/.test(i)?(t.tokenize=rt(i),t.stringStartCol=n.column(),t.tokenize(n,t)):(n.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function rt(n){var t=function(t,i){for(;!t.eol();)if(t.next()==n){i.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function v(n,t){return function(i,r){for(;!i.eol();){if(i.match(t)){r.tokenize=o;break}i.next()}return n}}function y(n){return function(t,i){for(var r;null!=(r=t.next());){if("<"==r)return i.tokenize=y(n+1),i.tokenize(t,i);if(">"==r){if(1==n){i.tokenize=o;break}return i.tokenize=y(n-1),i.tokenize(t,i)}}return"meta"}}function ut(n,t,i){this.prev=n.context;this.tagName=t;this.indent=n.indented;this.startOfLine=i;(f.doNotIndent.hasOwnProperty(t)||n.context&&n.context.noIndent)&&(this.noIndent=!0)}function p(n){n.context&&(n.context=n.context.prev)}function k(n,t){for(var i;;){if(!n.context)return;if(i=n.context.tagName,!f.contextGrabbers.hasOwnProperty(i)||!f.contextGrabbers[i].hasOwnProperty(t))return;p(n)}}function l(n,t,i){return"openTag"==n?(i.tagStart=t.column(),d):"closeTag"==n?ft:l}function d(n,t,i){return"word"==n?(i.tagName=t.current(),e="tag",s):(e="error",d)}function ft(n,t,i){if("word"==n){var r=t.current();return i.context&&i.context.tagName!=r&&f.implicitlyClosed.hasOwnProperty(i.context.tagName)&&p(i),i.context&&i.context.tagName==r||f.matchClosing===!1?(e="tag",w):(e="tag error",g)}return e="error",g}function w(n,t,i){return"endTag"!=n?(e="error",w):(p(i),l)}function g(n,t,i){return e="error",w(n,t,i)}function s(n,t,i){if("word"==n)return e="attribute",et;if("endTag"==n||"selfcloseTag"==n){var r=i.tagName,u=i.tagStart;return i.tagName=i.tagStart=null,"selfcloseTag"==n||f.autoSelfClosers.hasOwnProperty(r)?k(i,r):(k(i,r),i.context=new ut(i,r,u==i.indented)),l}return e="error",s}function et(n,t,i){return"equals"==n?nt:(f.allowMissing||(e="error"),s(n,t,i))}function nt(n,t,i){return"string"==n?tt:"word"==n&&f.allowUnquoted?(e="string",s):(e="error",s(n,t,i))}function tt(n,t,i){return"string"==n?tt:s(n,t,i)}var b=r.indentUnit,f={},it=u.htmlMode?t:i,h,c,e;for(h in it)f[h]=it[h];for(h in u)f[h]=u[h];return o.isInText=!0,{startState:function(n){var t={tokenize:o,state:l,indented:n||0,tagName:null,tagStart:null,context:null};return null!=n&&(t.baseIndent=n),t},token:function(n,t){if(!t.tagName&&n.sol()&&(t.indented=n.indentation()),n.eatSpace())return null;c=null;var i=t.tokenize(n,t);return(i||c)&&"comment"!=i&&(e=null,t.state=t.state(c||i,n,t),e&&(i="error"==e?i+" error":e)),i},indent:function(t,i,r){var u=t.context,e,s;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+b;if(u&&u.noIndent)return n.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return f.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+b*(f.multilineTagIndentFactor||1);if(f.alignCDATA&&/$/,blockCommentStart:"",configuration:f.htmlMode?"html":"xml",helperType:f.htmlMode?"html":"xml",skipAttribute:function(n){n.state==nt&&(n.state=s)}}});n.defineMIME("text/xml","xml");n.defineMIME("application/xml","xml");n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":10}],15:[function(n,t,i){i.read=function(n,t,i,r,u){var f,o,l=8*u-r-1,a=(1<>1,e=-7,s=i?u-1:0,c=i?-1:1,h=n[t+s];for(s+=c,f=h&(1<<-e)-1,h>>=-e,e+=l;e>0;f=256*f+n[t+s],s+=c,e-=8);for(o=f&(1<<-e)-1,f>>=-e,e+=r;e>0;o=256*o+n[t+s],s+=c,e-=8);if(0===f)f=1-v;else{if(f===a)return o?NaN:(h?-1:1)*(1/0);o+=Math.pow(2,r);f-=v}return(h?-1:1)*o*Math.pow(2,f-r)};i.write=function(n,t,i,r,u,f){var e,o,s,l=8*f-u-1,a=(1<>1,y=23===u?Math.pow(2,-24)-Math.pow(2,-77):0,c=r?0:f-1,v=r?1:-1,p=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,e=a):(e=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-e))<1&&(e--,s*=2),t+=e+h>=1?y/s:y*Math.pow(2,1-h),t*s>=2&&(e++,s/=2),e+h>=a?(o=0,e=a):e+h>=1?(o=(t*s-1)*Math.pow(2,u),e+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,u),e=0));u>=8;n[i+c]=255&o,c+=v,o/=256,u-=8);for(e=e<0;n[i+c]=255&e,c+=v,e/=256,l-=8);n[i+c-v]|=128*p}},{}],16:[function(n,t){var i={}.toString;t.exports=Array.isArray||function(n){return"[object Array]"==i.call(n)}},{}],17:[function(t,i,r){(function(t){(function(){function a(n){this.tokens=[];this.tokens.links={};this.options=n||e.defaults;this.rules=t.normal;this.options.gfm&&(this.rules=this.options.tables?t.tables:t.gfm)}function c(n,t){if(this.options=t||e.defaults,this.links=n,this.rules=u.normal,this.renderer=this.options.renderer||new f,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?u.breaks:u.gfm:this.options.pedantic&&(this.rules=u.pedantic)}function f(n){this.options=n||{}}function h(n){this.tokens=[];this.token=null;this.options=n||e.defaults;this.options.renderer=this.options.renderer||new f;this.renderer=this.options.renderer;this.renderer.options=this.options}function o(n,t){return n.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function y(n){return n.replace(/&([#\w]+);/g,function(n,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function s(n,t){return n=n.source,t=t||"",function i(r,u){return r?(u=u.source||u,u=u.replace(/(^|[^\[])\^/g,"$1"),n=n.replace(r,u),i):new RegExp(n,t)}}function v(){}function l(n){for(var t,i,r=1;rAn error occured:<\/p>
"+o(v.message+"",!0)+"<\/pre>";throw v;}}var t={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:v,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:v,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:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:v,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/},u;t.bullet=/(?:[*+-]|\d+\.)/;t.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;t.item=s(t.item,"gm")(/bull/g,t.bullet)();t.list=s(t.list)(/bull/g,t.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+t.def.source+")")();t.blockquote=s(t.blockquote)("def",t.def)();t._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";t.html=s(t.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,t._tag)();t.paragraph=s(t.paragraph)("hr",t.hr)("heading",t.heading)("lheading",t.lheading)("blockquote",t.blockquote)("tag","<"+t._tag)("def",t.def)();t.normal=l({},t);t.gfm=l({},t.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/});t.gfm.paragraph=s(t.paragraph)("(?!","(?!"+t.gfm.fences.source.replace("\\1","\\2")+"|"+t.list.source.replace("\\1","\\3")+"|")();t.tables=l({},t.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});a.rules=t;a.lex=function(n,t){var i=new a(t);return i.lex(n)};a.prototype.lex=function(n){return n=n.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(n,!0)};a.prototype.token=function(n,i,r){for(var s,h,u,c,l,f,a,e,o,n=n.replace(/^ +$/gm,"");n;)if((u=this.rules.newline.exec(n))&&(n=n.substring(u[0].length),u[0].length>1&&this.tokens.push({type:"space"})),u=this.rules.code.exec(n))n=n.substring(u[0].length),u=u[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?u:u.replace(/\n+$/,"")});else if(u=this.rules.fences.exec(n))n=n.substring(u[0].length),this.tokens.push({type:"code",lang:u[2],text:u[3]||""});else if(u=this.rules.heading.exec(n))n=n.substring(u[0].length),this.tokens.push({type:"heading",depth:u[1].length,text:u[2]});else if(i&&(u=this.rules.nptable.exec(n))){for(n=n.substring(u[0].length),f={type:"table",header:u[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:u[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:u[3].replace(/\n$/,"").split("\n")},e=0;e ?/gm,""),this.token(u,i,!0),this.tokens.push({type:"blockquote_end"});else if(u=this.rules.list.exec(n)){for(n=n.substring(u[0].length),c=u[2],this.tokens.push({type:"list_start",ordered:c.length>1}),u=u[0].match(this.rules.item),s=!1,o=u.length,e=0;o>e;e++)f=u[e],a=f.length,f=f.replace(/^ *([*+-]|\d+\.) +/,""),~f.indexOf("\n ")&&(a-=f.length,f=this.options.pedantic?f.replace(/^ {1,4}/gm,""):f.replace(new RegExp("^ {1,"+a+"}","gm"),"")),this.options.smartLists&&e!==o-1&&(l=t.bullet.exec(u[e+1])[0],c===l||c.length>1&&l.length>1||(n=u.slice(e+1).join("\n")+n,e=o-1)),h=s||/\n\n(?!\s*$)/.test(f),e!==o-1&&(s="\n"===f.charAt(f.length-1),h||(h=s)),this.tokens.push({type:h?"loose_item_start":"list_item_start"}),this.token(f,!1,r),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(u=this.rules.html.exec(n))n=n.substring(u[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===u[1]||"script"===u[1]||"style"===u[1]),text:u[0]});else if(!r&&i&&(u=this.rules.def.exec(n)))n=n.substring(u[0].length),this.tokens.links[u[1].toLowerCase()]={href:u[2],title:u[3]};else if(i&&(u=this.rules.table.exec(n))){for(n=n.substring(u[0].length),f={type:"table",header:u[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:u[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:u[3].replace(/(?: *\| *)?\n$/,"").split("\n")},e=0;e])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:v,tag:/^|^<\/?\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:v,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/;u.link=s(u.link)("inside",u._inside)("href",u._href)();u.reflink=s(u.reflink)("inside",u._inside)();u.normal=l({},u);u.pedantic=l({},u.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});u.gfm=l({},u.normal,{escape:s(u.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(u.text)("]|","~]|")("|","|https?://|")()});u.breaks=l({},u.gfm,{br:s(u.br)("{2,}","*")(),text:s(u.gfm.text)("{2,}","*")()});c.rules=u;c.output=function(n,t,i){var r=new c(t,i);return r.output(n)};c.prototype.output=function(n){for(var u,r,f,t,i="";n;)if(t=this.rules.escape.exec(n))n=n.substring(t[0].length),i+=t[1];else if(t=this.rules.autolink.exec(n))n=n.substring(t[0].length),"@"===t[2]?(r=":"===t[1].charAt(6)?this.mangle(t[1].substring(7)):this.mangle(t[1]),f=this.mangle("mailto:")+r):(r=o(t[1]),f=r),i+=this.renderer.link(f,null,r);else if(!this.inLink&&(t=this.rules.url.exec(n)))n=n.substring(t[0].length),r=o(t[1]),f=r,i+=this.renderer.link(f,null,r);else if(t=this.rules.tag.exec(n))!this.inLink&&/^/i.test(t[0])&&(this.inLink=!1),n=n.substring(t[0].length),i+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):o(t[0]):t[0];else if(t=this.rules.link.exec(n))n=n.substring(t[0].length),this.inLink=!0,i+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if((t=this.rules.reflink.exec(n))||(t=this.rules.nolink.exec(n))){if(n=n.substring(t[0].length),u=(t[2]||t[1]).replace(/\s+/g," "),u=this.links[u.toLowerCase()],!u||!u.href){i+=t[0].charAt(0);n=t[0].substring(1)+n;continue}this.inLink=!0;i+=this.outputLink(t,u);this.inLink=!1}else if(t=this.rules.strong.exec(n))n=n.substring(t[0].length),i+=this.renderer.strong(this.output(t[2]||t[1]));else if(t=this.rules.em.exec(n))n=n.substring(t[0].length),i+=this.renderer.em(this.output(t[2]||t[1]));else if(t=this.rules.code.exec(n))n=n.substring(t[0].length),i+=this.renderer.codespan(o(t[2],!0));else if(t=this.rules.br.exec(n))n=n.substring(t[0].length),i+=this.renderer.br();else if(t=this.rules.del.exec(n))n=n.substring(t[0].length),i+=this.renderer.del(this.output(t[1]));else if(t=this.rules.text.exec(n))n=n.substring(t[0].length),i+=this.renderer.text(o(this.smartypants(t[0])));else if(n)throw new Error("Infinite loop on byte: "+n.charCodeAt(0));return i};c.prototype.outputLink=function(n,t){var i=o(t.href),r=t.title?o(t.title):null;return"!"!==n[0].charAt(0)?this.renderer.link(i,r,this.output(n[1])):this.renderer.image(i,r,o(n[1]))};c.prototype.smartypants=function(n){return this.options.smartypants?n.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):n};c.prototype.mangle=function(n){if(!this.options.mangle)return n;for(var t,r="",u=n.length,i=0;u>i;i++)t=n.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),r+="&#"+t+";";return r};f.prototype.code=function(n,t,i){if(this.options.highlight){var r=this.options.highlight(n,t);null!=r&&r!==n&&(i=!0,n=r)}return t?'
'+(i?n:o(n,!0))+"\n<\/code><\/pre>\n":"
"+(i?n:o(n,!0))+"\n<\/code><\/pre>"};f.prototype.blockquote=function(n){return"
\n"+n+"<\/blockquote>\n"};f.prototype.html=function(n){return n};f.prototype.heading=function(n,t,i){return"'+n+"<\/h"+t+">\n"};f.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"};f.prototype.list=function(n,t){var i=t?"ol":"ul";return"<"+i+">\n"+n+"<\/"+i+">\n"};f.prototype.listitem=function(n){return"
  • "+n+"<\/li>\n"};f.prototype.paragraph=function(n){return"

    "+n+"<\/p>\n"};f.prototype.table=function(n,t){return"\n\n"+n+"<\/thead>\n\n"+t+"<\/tbody>\n<\/table>\n"};f.prototype.tablerow=function(n){return"\n"+n+"<\/tr>\n"};f.prototype.tablecell=function(n,t){var i=t.header?"th":"td",r=t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">";return r+n+"<\/"+i+">\n"};f.prototype.strong=function(n){return""+n+"<\/strong>"};f.prototype.em=function(n){return""+n+"<\/em>"};f.prototype.codespan=function(n){return""+n+"<\/code>"};f.prototype.br=function(){return this.options.xhtml?"
    ":"
    "};f.prototype.del=function(n){return""+n+"<\/del>"};f.prototype.link=function(n,t,i){var r,u;if(this.options.sanitize){try{r=decodeURIComponent(y(n)).replace(/[^\w:]/g,"").toLowerCase()}catch(f){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}return u='"+i+"<\/a>")};f.prototype.image=function(n,t,i){var r=''+i+'":">")};f.prototype.text=function(n){return n};h.parse=function(n,t,i){var r=new h(t,i);return r.parse(n)};h.prototype.parse=function(n){this.inline=new c(n.links,this.options,this.renderer);this.tokens=n.reverse();for(var t="";this.next();)t+=this.tok();return t};h.prototype.next=function(){return this.token=this.tokens.pop()};h.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};h.prototype.parseText=function(){for(var n=this.token.text;"text"===this.peek().type;)n+="\n"+this.next().text;return this.inline.output(n)};h.prototype.tok=function(){var t,u,i,s,r,f,e,n,o;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(f="",n="",i="",t=0;tf;f++)for(var c=this.compoundRules[f],e=0,l=c.length;l>e;e++)this.compoundRuleCodes[c[e]]=[];"ONLYINCOMPOUND"in this.flags&&(this.compoundRuleCodes[this.flags.ONLYINCOMPOUND]=[]);this.dictionaryTable=this._parseDIC(i);for(f in this.compoundRuleCodes)0==this.compoundRuleCodes[f].length&&delete this.compoundRuleCodes[f];for(f=0,o=this.compoundRules.length;o>f;f++){for(var a=this.compoundRules[f],v="",e=0,l=a.length;l>e;e++)s=a[e],v+=s in this.compoundRuleCodes?"("+this.compoundRuleCodes[s].join("|")+")":s;this.compoundRules[f]=new RegExp(v,"i")}}return this};u.prototype={load:function(n){for(var t in n)this[t]=n[t];return this},_readFile:function(t,r){var u,f;if(r||(r="utf8"),"undefined"!=typeof XMLHttpRequest)return u=new XMLHttpRequest,u.open("GET",t,!1),u.overrideMimeType&&u.overrideMimeType("text/plain; charset="+r),u.send(null),u.responseText;if("undefined"!=typeof n){f=n("fs");try{if(f.existsSync(t)){var o=f.statSync(t),s=f.openSync(t,"r"),e=new i(o.size);return f.readSync(s,e,0,e.length,null),e.toString(r,0,e.length)}console.log("Path "+t+" does not exist.")}catch(h){return console.log(h),""}}},_parseAFF:function(n){var v={},e,i;n=this._removeAffixComments(n);for(var s=n.split("\n"),t=0,k=s.length;k>t;t++){var e=s[t],u=e.split(/\s+/),r=u[0];if("PFX"==r||"SFX"==r){for(var d=u[1],g=u[2],h=parseInt(u[3],10),y=[],f=t+1,p=t+1+h;p>f;f++){var e=s[f],i=e.split(/\s+/),c=i[2],w=i[3].split("/"),l=w[0];"0"===l&&(l="");var b=this.parseRuleCodes(w[1]),a=i[4],o={};o.add=l;b.length>0&&(o.continuationClasses=b);"."!==a&&(o.match="SFX"===r?new RegExp(a+"$"):new RegExp("^"+a));"0"!=c&&(o.remove="SFX"===r?new RegExp(c+"$"):c);y.push(o)}v[d]={type:r,combineable:"Y"==g,entries:y};t+=h}else if("COMPOUNDRULE"===r){for(var h=parseInt(u[1],10),f=t+1,p=t+1+h;p>f;f++)e=s[f],i=e.split(/\s+/),this.compoundRules.push(i[1]);t+=h}else"REP"===r?(i=e.split(/\s+/),3===i.length&&this.replacementTable.push([i[1],i[2]])):this.flags[r]=u[1]}return v},_removeAffixComments:function(n){return n=n.replace(/#.*$/gm,""),n=n.replace(/^\s\s*/m,"").replace(/\s\s*$/m,""),n=n.replace(/\n{2,}/g,"\n"),n=n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(n){function e(n,t){n in i&&"object"==typeof i[n]||(i[n]=[]);i[n].push(t)}var t,r,a,s,u,y,h,k,f,g;n=this._removeDicComments(n);for(var w=n.split("\n"),i={},c=1,nt=w.length;nt>c;c++){var tt=w[c],l=tt.split("/",2),o=l[0];if(l.length>1)for(t=this.parseRuleCodes(l[1]),("NEEDAFFIX"in this.flags)&&-1!=t.indexOf(this.flags.NEEDAFFIX)||e(o,t),r=0,a=t.length;a>r;r++){if(s=t[r],u=this.rules[s],u)for(var b=this._applyRule(o,u),v=0,it=b.length;it>v;v++)if(y=b[v],e(y,[]),u.combineable)for(h=r+1;a>h;h++)if(k=t[h],f=this.rules[k],f&&f.combineable&&u.type!=f.type)for(var d=this._applyRule(y,f),p=0,rt=d.length;rt>p;p++)g=d[p],e(g,[]);s in this.compoundRuleCodes&&this.compoundRuleCodes[s].push(o)}else e(o.trim(),[])}return i},_removeDicComments:function(n){return n.replace(/^\t.*$/gm,"")},parseRuleCodes:function(n){if(!n)return[];if(!("FLAG"in this.flags))return n.split("");if("long"===this.flags.FLAG){for(var i=[],t=0,r=n.length;r>t;t+=2)i.push(n.substr(t,2));return i}if("num"===this.flags.FLAG)return textCode.split(",")},_applyRule:function(n,t){for(var i,r,f,h,o,s=t.entries,u=[],e=0,c=s.length;c>e;e++)if(i=s[e],(!i.match||n.match(i.match))&&(r=n,i.remove&&(r=r.replace(i.remove,"")),"SFX"===t.type?r+=i.add:r=i.add+r,u.push(r),"continuationClasses"in i))for(f=0,h=i.continuationClasses.length;h>f;f++)o=this.rules[i.continuationClasses[f]],o&&(u=u.concat(this._applyRule(r,o)));return u},check:function(n){var t=n.replace(/^\s\s*/,"").replace(/\s\s*$/,""),r,i;if(this.checkExact(t))return!0;if(t.toUpperCase()===t){if(r=t[0]+t.substring(1).toLowerCase(),this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r))return!0}if(i=t.toLowerCase(),i!==t){if(this.hasFlag(i,"KEEPCASE"))return!1;if(this.checkExact(i))return!0}return!1},checkExact:function(n){var i=this.dictionaryTable[n],t,r;if("undefined"==typeof i){if("COMPOUNDMIN"in this.flags&&n.length>=this.flags.COMPOUNDMIN)for(t=0,r=this.compoundRules.length;r>t;t++)if(n.match(this.compoundRules[t]))return!0;return!1}if("object"==typeof i){for(t=0,r=i.length;r>t;t++)if(!this.hasFlag(n,"ONLYINCOMPOUND",i[t]))return!0;return!1}},hasFlag:function(n,t,i){if(t in this.flags){if("undefined"==typeof i)var i=Array.prototype.concat.apply([],this.dictionaryTable[n]);if(i&&-1!==i.indexOf(this.flags[t]))return!0}return!1},alphabet:"",suggest:function(n,t){function e(n){for(var t,e,h,u=[],c=0,y=n.length;y>c;c++){for(var s=n[c],f=[],r=0,o=s.length+1;o>r;r++)f.push([s.substring(0,r),s.substring(r,s.length)]);for(var a=[],r=0,o=f.length;o>r;r++)t=f[r],t[1]&&a.push(t[0]+t[1].substring(1));for(var v=[],r=0,o=f.length;o>r;r++)t=f[r],t[1].length>1&&v.push(t[0]+t[1][1]+t[1][0]+t[1].substring(2));for(var l=[],r=0,o=f.length;o>r;r++)if(t=f[r],t[1])for(e=0,h=i.alphabet.length;h>e;e++)l.push(t[0]+i.alphabet[e]+t[1].substring(1));for(var r=0,o=f.length;o>r;r++)if(t=f[r],t[1])for(e=0,h=i.alphabet.length;h>e;e++)l.push(t[0]+i.alphabet[e]+t[1]);u=u.concat(a);u=u.concat(v);u=u.concat(l);u=u.concat([])}return u}function o(n){for(var r=[],t=0;tr;r++)s[r]in f?f[s[r]]+=1:f[s[r]]=1;u=[];for(r in f)u.push([r,f[r]]);u.sort(a).reverse();for(var l=[],r=0,c=Math.min(t,u.length);c>r;r++)i.hasFlag(u[r][0],"NOSUGGEST")||l.push(u[r][0]);return l}var r,s,u,f,i;if(t||(t=5),this.check(n))return[];for(r=0,s=this.replacementTable.length;s>r;r++)if(u=this.replacementTable[r],-1!==n.indexOf(u[0])&&(f=n.replace(u[0],u[1]),this.check(f)))return[f];return i=this,i.alphabet="abcdefghijklmnopqrstuvwxyz",h(n)}};"undefined"!=typeof t&&(t.exports=u)}).call(this,n("buffer").Buffer,"/node_modules/typo-js")},{buffer:3,fs:2}],19:[function(n){var t=n("codemirror");t.commands.tabAndIndentMarkdownList=function(n){var i=n.listSelections(),r=i[0].head,u=n.getStateAfter(r.line),f=u.list!==!1,t;if(f)return void n.execCommand("indentMore");n.options.indentWithTabs?n.execCommand("insertTab"):(t=Array(n.options.tabSize+1).join(" "),n.replaceSelection(t))};t.commands.shiftTabAndUnindentMarkdownList=function(n){var i=n.listSelections(),r=i[0].head,u=n.getStateAfter(r.line),f=u.list!==!1,t;if(f)return void n.execCommand("indentLess");n.options.indentWithTabs?n.execCommand("insertTab"):(t=Array(n.options.tabSize+1).join(" "),n.replaceSelection(t))}},{codemirror:10}],20:[function(n,t){"use strict";function vt(n){return kt?n.replace("Ctrl","Cmd"):n.replace("Cmd","Ctrl")}function gt(n,t,i){n=n||{};var r=document.createElement("a");return t=void 0==t?!0:t,n.title&&t&&(r.title=ti(n.title,n.action,i),kt&&(r.title=r.title.replace("Ctrl","⌘"),r.title=r.title.replace("Alt","⌥"))),r.tabIndex=-1,r.className=n.className,r}function ni(){var n=document.createElement("i");return n.className="separator",n.innerHTML="|",n}function ti(n,t,i){var r,u=n;return t&&(r=fi(t),i[r]&&(u+=" ("+vt(i[r])+")")),u}function r(n,t){var u;if(t=t||n.getCursor("start"),u=n.getTokenAt(t),!u.type)return{};for(var i,e,o=u.type.split(" "),r={},f=0;f=0&&(o=t.getLineHandle(r),!s(o));r--);tt=t.getTokenAt({line:r,ch:1});d=a(tt).fencedChars;s(t.getLineHandle(i.line))?(c="",l=i.line):s(t.getLineHandle(i.line-1))?(c="",l=i.line-1):(c=d+"\n",l=i.line);s(t.getLineHandle(u.line))?(v="",h=u.line,0===u.ch&&(h+=1)):0!==u.ch&&s(t.getLineHandle(u.line+1))?(v="",h=u.line+1):(v=d+"\n",h=u.line+1);0===u.ch&&(h-=1);t.operation(function(){t.replaceRange(v,{line:h,ch:0},{line:h+(v?0:1),ch:0});t.replaceRange(c,{line:l,ch:0},{line:l+(c?0:1),ch:0})});t.setSelection({line:l+(c?1:0),ch:0},{line:h+(c?1:-1),ch:0});t.focus()}else{if(y=i.line,s(t.getLineHandle(i.line))&&("fenced"===p(t,i.line+1)?(r=i.line,y=i.line+1):(f=i.line,y=i.line-1)),void 0===r)for(r=y;r>=0&&(o=t.getLineHandle(r),!s(o));r--);if(void 0===f)for(w=t.lineCount(),f=y;w>f&&(o=t.getLineHandle(f),!s(o));f++);t.operation(function(){t.replaceRange("",{line:r,ch:0},{line:r+1,ch:0});t.replaceRange("",{line:f-1,ch:0},{line:f,ch:0})});t.focus()}else if("indented"===k){if(i.line!==u.line||i.ch!==u.ch)r=i.line,f=u.line,0===u.ch&&f--;else{for(r=i.line;r>=0;r--)if(o=t.getLineHandle(r),!o.text.match(/^\s*$/)&&"indented"!==p(t,r,o)){r+=1;break}for(w=t.lineCount(),f=i.line;w>f;f++)if(o=t.getLineHandle(f),!o.text.match(/^\s*$/)&&"indented"!==p(t,f,o)){f-=1;break}}var it=t.getLineHandle(f+1),rt=it&&t.getTokenAt({line:f+1,ch:it.text.length-1}),ht=rt&&a(rt).indentedCode;for(ht&&t.replaceRange("\n",{line:f+1,ch:0}),b=r;f>=b;b++)t.indentLine(b,"subtract");t.focus()}else ut=i.line===u.line&&i.ch===u.ch&&0===i.ch,ft=i.line!==u.line,ut||ft?et(t,i,u,ot):e(t,!1,["`","`"])}function y(n){var t=n.codemirror;ct(t,"quote")}function o(n){var t=n.codemirror;s(t,"smaller")}function p(n){var t=n.codemirror;s(t,"bigger")}function w(n){var t=n.codemirror;s(t,void 0,1)}function b(n){var t=n.codemirror;s(t,void 0,2)}function k(n){var t=n.codemirror;s(t,void 0,3)}function d(n){var t=n.codemirror;ct(t,"unordered-list")}function g(n){var t=n.codemirror;ct(t,"ordered-list")}function nt(n){var t=n.codemirror;ii(t)}function tt(n){var u=n.codemirror,f=r(u),t=n.options,i="http://";return t.promptURLs&&(i=prompt(t.promptTexts.link),!i)?!1:void e(u,f.link,t.insertTexts.link,i)}function it(n){var u=n.codemirror,f=r(u),t=n.options,i="http://";return t.promptURLs&&(i=prompt(t.promptTexts.image),!i)?!1:void e(u,f.image,t.insertTexts.image,i)}function rt(n){var t=n.codemirror,i=r(t),u=n.options;e(t,i.table,u.insertTexts.table)}function ut(n){var t=n.codemirror,i=r(t),u=n.options;e(t,i.image,u.insertTexts.horizontalRule)}function ft(n){var t=n.codemirror;t.undo();t.focus()}function et(n){var t=n.codemirror;t.redo();t.focus()}function f(n){var t=n.codemirror,r=t.getWrapperElement(),i=r.nextSibling,e=n.toolbarElements["side-by-side"],h=!1,f,o,s,c;/editor-preview-active-side/.test(i.className)?(i.className=i.className.replace(/\s*editor-preview-active-side\s*/g,""),e.className=e.className.replace(/\s*active\s*/g,""),r.className=r.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||u(n);i.className+=" editor-preview-active-side"},1),e.className+=" active",r.className+=" CodeMirror-sided",h=!0);f=r.lastChild;/editor-preview-active/.test(f.className)&&(f.className=f.className.replace(/\s*editor-preview-active\s*/g,""),o=n.toolbarElements.preview,s=r.previousSibling,o.className=o.className.replace(/\s*active\s*/g,""),s.className=s.className.replace(/\s*disabled-for-preview*/g,""));c=function(){i.innerHTML=n.options.previewRender(n.value(),i)};t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=c);h?(i.innerHTML=n.options.previewRender(n.value(),i),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction);t.refresh()}function ot(n){var e=n.codemirror,r=e.getWrapperElement(),u=r.previousSibling,i=n.options.toolbar?n.toolbarElements.preview:!1,t=r.lastChild,o;t&&/editor-preview/.test(t.className)||(t=document.createElement("div"),t.className="editor-preview",r.appendChild(t));/editor-preview-active/.test(t.className)?(t.className=t.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),u.className=u.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){t.className+=" editor-preview-active"},1),i&&(i.className+=" active",u.className+=" disabled-for-preview"));t.innerHTML=n.options.previewRender(n.value(),t);o=e.getWrapperElement().nextSibling;/editor-preview-active-side/.test(o.className)&&f(n)}function e(n,t,i,r){if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className)){var f,e=i[0],o=i[1],u=n.getCursor("start"),s=n.getCursor("end");r&&(o=o.replace("#url#",r));t?(f=n.getLine(u.line),e=f.slice(0,u.ch),o=f.slice(u.ch),n.replaceRange(e+o,{line:u.line,ch:0})):(f=n.getSelection(),n.replaceSelection(e+f+o),u.ch+=e.length,u!==s&&(s.ch+=e.length));n.setSelection(u,s);n.focus()}}function s(n,t,i){if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className)){for(var u=n.getCursor("start"),f=n.getCursor("end"),r=u.line;r<=f.line;r++)!function(r){var u=n.getLine(r),f=u.search(/[^#]/);u=void 0!==t?0>=f?"bigger"==t?"###### "+u:"# "+u:6==f&&"smaller"==t?u.substr(7):1==f&&"bigger"==t?u.substr(2):"bigger"==t?u.substr(1):"#"+u:1==i?0>=f?"# "+u:f==i?u.substr(f+1):"# "+u.substr(f+1):2==i?0>=f?"## "+u:f==i?u.substr(f+1):"## "+u.substr(f+1):0>=f?"### "+u:f==i?u.substr(f+1):"### "+u.substr(f+1);n.replaceRange(u,{line:r,ch:0},{line:r,ch:99999999999999})}(r);n.focus()}}function ct(n,t){if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className)){for(var u=r(n),f=n.getCursor("start"),e=n.getCursor("end"),o={quote:/^(\s*)\>\s+/,"unordered-list":/^(\s*)(\*|\-|\+)\s+/,"ordered-list":/^(\s*)\d+\.\s+/},s={quote:"> ","unordered-list":"* ","ordered-list":"1. "},i=f.line;i<=e.line;i++)!function(i){var r=n.getLine(i);r=u[t]?r.replace(o[t],"$1"):s[t]+r;n.replaceRange(r,{line:i,ch:0},{line:i,ch:99999999999999})}(i);n.focus()}}function lt(n,t,i,u){if(!/editor-preview-active/.test(n.codemirror.getWrapperElement().lastChild.className)){u="undefined"==typeof u?i:u;var f,o=n.codemirror,l=r(o),s=i,h=u,e=o.getCursor("start"),c=o.getCursor("end");l[t]?(f=o.getLine(e.line),s=f.slice(0,e.ch),h=f.slice(e.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),h=h.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),h=h.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),h=h.replace(/(\*\*|~~)/,"")),o.replaceRange(s+h,{line:e.line,ch:0},{line:e.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(e.ch-=2,e!==c&&(c.ch-=2)):"italic"==t&&(e.ch-=1,e!==c&&(c.ch-=1))):(f=o.getSelection(),"bold"==t?(f=f.split("**").join(""),f=f.split("__").join("")):"italic"==t?(f=f.split("*").join(""),f=f.split("_").join("")):"strikethrough"==t&&(f=f.split("~~").join("")),o.replaceSelection(s+f+h),e.ch+=i.length,c.ch=e.ch+f.length);o.setSelection(e,c);o.focus()}}function ii(n){if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className))for(var i,r=n.getCursor("start"),u=n.getCursor("end"),t=r.line;t<=u.line;t++)i=n.getLine(t),i=i.replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),n.replaceRange(i,{line:t,ch:0},{line:t,ch:99999999999999})}function yt(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]instanceof Array?t[i].concat(n[i]instanceof Array?n[i]:[]):null!==t[i]&&"object"==typeof t[i]&&t[i].constructor===Object?yt(n[i]||{},t[i]):t[i]);return n}function st(n){for(var t=1;t=19968?i[t].length:1;return r}function i(n){var r,u,i,f,t;if(n=n||{},n.parent=this,r=!0,n.autoDownloadFontAwesome===!1&&(r=!1),n.autoDownloadFontAwesome!==!0)for(u=document.styleSheets,i=0;i-1&&(r=!1);if(r&&(f=document.createElement("link"),f.rel="stylesheet",f.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(f)),n.element)this.element=n.element;else if(null===n.element)return void console.log("SimpleMDE: Error. No element was found.");if(void 0===n.toolbar){n.toolbar=[];for(t in h)h.hasOwnProperty(t)&&(-1!=t.indexOf("separator-")&&n.toolbar.push("|"),(h[t]["default"]===!0||n.showIcons&&n.showIcons.constructor===Array&&-1!=n.showIcons.indexOf(t))&&n.toolbar.push(t))}n.hasOwnProperty("status")||(n.status=["autosave","lines","words","cursor"]);n.previewRender||(n.previewRender=function(n){return this.parent.markdown(n)});n.parsingConfig=st({highlightFormatting:!0},n.parsingConfig||{});n.insertTexts=st({},oi,n.insertTexts||{});n.promptTexts=si;n.blockStyles=st({},hi,n.blockStyles||{});n.shortcuts=st({},ui,n.shortcuts||{});void 0!=n.autosave&&void 0!=n.autosave.unique_id&&""!=n.autosave.unique_id&&(n.autosave.uniqueId=n.autosave.unique_id);this.options=n;this.render();!n.initialValue||this.options.autosave&&this.options.autosave.foundSavedValue===!0||this.value(n.initialValue)}function wt(){if("object"!=typeof localStorage)return!1;try{localStorage.setItem("smde_localStorage",1);localStorage.removeItem("smde_localStorage")}catch(n){return!1}return!0}var bt=n("codemirror");n("codemirror/addon/edit/continuelist.js");n("./codemirror/tablist");n("codemirror/addon/display/fullscreen.js");n("codemirror/mode/markdown/markdown.js");n("codemirror/addon/mode/overlay.js");n("codemirror/addon/display/placeholder.js");n("codemirror/addon/selection/mark-selection.js");n("codemirror/mode/gfm/gfm.js");n("codemirror/mode/xml/xml.js");var ri=n("codemirror-spell-checker"),at=n("marked"),kt=/Mac/.test(navigator.platform),ht={toggleBold:c,toggleItalic:l,drawLink:tt,toggleHeadingSmaller:o,toggleHeadingBigger:p,drawImage:it,toggleBlockquote:y,toggleOrderedList:g,toggleUnorderedList:d,toggleCodeBlock:v,togglePreview:ot,toggleStrikethrough:a,toggleHeading1:w,toggleHeading2:b,toggleHeading3:k,cleanBlock:nt,drawTable:rt,drawHorizontalRule:ut,undo:ft,redo:et,toggleSideBySide:f,toggleFullScreen:u},ui={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"},fi=function(n){for(var t in ht)if(ht[t]===n)return t;return null},ei=function(){var n=!1;return function(t){(/(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(t)||/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(t.substr(0,4)))&&(n=!0)}(navigator.userAgent||navigator.vendor||window.opera),n},dt="",h={bold:{name:"bold",action:c,className:"fa fa-bold",title:"Bold","default":!0},italic:{name:"italic",action:l,className:"fa fa-italic",title:"Italic","default":!0},strikethrough:{name:"strikethrough",action:a,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:o,className:"fa fa-header",title:"Heading","default":!0},"heading-smaller":{name:"heading-smaller",action:o,className:"fa fa-header fa-header-x fa-header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:p,className:"fa fa-header fa-header-x fa-header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:w,className:"fa fa-header fa-header-x fa-header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:b,className:"fa fa-header fa-header-x fa-header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:k,className:"fa fa-header fa-header-x fa-header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:v,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:y,className:"fa fa-quote-left",title:"Quote","default":!0},"unordered-list":{name:"unordered-list",action:d,className:"fa fa-list-ul",title:"Generic List","default":!0},"ordered-list":{name:"ordered-list",action:g,className:"fa fa-list-ol",title:"Numbered List","default":!0},"clean-block":{name:"clean-block",action:nt,className:"fa fa-eraser fa-clean-block",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:tt,className:"fa fa-link",title:"Create Link","default":!0},image:{name:"image",action:it,className:"fa fa-picture-o",title:"Insert Image","default":!0},table:{name:"table",action:rt,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:ut,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:ot,className:"fa fa-eye no-disable",title:"Toggle Preview","default":!0},"side-by-side":{name:"side-by-side",action:f,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:ft,className:"fa fa-undo no-disable",title:"Undo"},redo:{name:"redo",action:et,className:"fa fa-repeat no-disable",title:"Redo"}},oi={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"]},si={link:"URL for the link:",image:"URL of the image:"},hi={bold:"**",code:"```",italic:"*"};i.prototype.markdown=function(n){if(at){var t={};return t.breaks=this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?!1:!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0&&window.hljs&&(t.highlight=function(n){return window.hljs.highlightAuto(n).value}),at.setOptions(t),at(n)}};i.prototype.render=function(n){var e,r,o,s,h;if(n||(n=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==n){this.element=n;var t=this.options,f=this,i={};for(e in t.shortcuts)null!==t.shortcuts[e]&&null!==ht[e]&&!function(n){i[vt(t.shortcuts[n])]=function(){ht[n](f)}}(e);if(i.Enter="newlineAndIndentContinueMarkdownList",i.Tab="tabAndIndentMarkdownList",i["Shift-Tab"]="shiftTabAndUnindentMarkdownList",i.Esc=function(n){n.getOption("fullScreen")&&u(f)},document.addEventListener("keydown",function(n){n=n||window.event;27==n.keyCode&&f.codemirror.getOption("fullScreen")&&u(f)},!1),t.spellChecker!==!1?(r="spell-checker",o=t.parsingConfig,o.name="gfm",o.gitHubSpice=!1,ri({codeMirrorInstance:bt})):(r=t.parsingConfig,r.name="gfm",r.gitHubSpice=!1),this.codemirror=bt.fromTextArea(n,{mode:r,backdrop:o,theme:"paper",tabSize:void 0!=t.tabSize?t.tabSize:2,indentUnit:void 0!=t.tabSize?t.tabSize:2,indentWithTabs:t.indentWithTabs!==!1,lineNumbers:!1,autofocus:t.autofocus===!0,extraKeys:i,lineWrapping:t.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||n.getAttribute("placeholder")||"",styleSelectedText:void 0!=t.styleSelectedText?t.styleSelectedText:!0}),t.forceSync===!0){s=this.codemirror;s.on("change",function(){s.save()})}this.gui={};t.toolbar!==!1&&(this.gui.toolbar=this.createToolbar());t.status!==!1&&(this.gui.statusbar=this.createStatusbar());void 0!=t.autosave&&t.autosave.enabled===!0&&this.autosave();this.gui.sideBySide=this.createSideBySide();this._rendered=this.element;h=this.codemirror;setTimeout(function(){h.refresh()}.bind(h),0)}};i.prototype.autosave=function(){var n,t;if(wt()){if(n=this,void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to use the autosave feature");if(null!=n.element.form&&void 0!=n.element.form&&n.element.form.addEventListener("submit",function(){localStorage.removeItem("smde_"+n.options.autosave.uniqueId)}),this.options.autosave.loaded!==!0&&("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,n.value()),t=document.getElementById("autosaved"),null!=t&&void 0!=t&&""!=t){var u=new Date,f=u.getHours(),i=u.getMinutes(),e="am",r=f;r>=12&&(r=f-12,e="pm");0==r&&(r=12);i=10>i?"0"+i:i;t.innerHTML="Autosaved: "+r+":"+i+" "+e}this.autosaveTimeoutId=setTimeout(function(){n.autosave()},this.options.autosave.delay||1e4)}else console.log("SimpleMDE: localStorage not available, cannot autosave")};i.prototype.clearAutosavedValue=function(){if(wt()){if(void 0==this.options.autosave||void 0==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("SimpleMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("SimpleMDE: localStorage not available, cannot autosave")};i.prototype.createSideBySide=function(){var t=this.codemirror,u=t.getWrapperElement(),n=u.nextSibling,i,r;return n&&/editor-preview-side/.test(n.className)||(n=document.createElement("div"),n.className="editor-preview-side",u.parentNode.insertBefore(n,u.nextSibling)),i=!1,r=!1,t.on("scroll",function(t){if(i)return void(i=!1);r=!0;var u=t.getScrollInfo().height-t.getScrollInfo().clientHeight,f=parseFloat(t.getScrollInfo().top)/u,e=(n.scrollHeight-n.clientHeight)*f;n.scrollTop=e}),n.onscroll=function(){if(r)return void(r=!1);i=!0;var u=n.scrollHeight-n.clientHeight,f=parseFloat(n.scrollTop)/u,e=(t.getScrollInfo().height-t.getScrollInfo().clientHeight)*f;t.scrollTo(0,e)},n};i.prototype.createToolbar=function(n){var t,u,i,f,s,e,o,c;if(n=n||this.options.toolbar,n&&0!==n.length){for(t=0;t