PageSourceSearch

https://cuper.se/bundles/cuper-cup?v=MpQBfURS820KwIEBmdnc93hN_eGEoOwW-u578nf-Ry01

js cuper.se collected 2026-10-09 04:01:57 UTC 150,983 bytes, 8 lines download raw bytes

1
2/*! Bundled by LicensedBundler | www.nuget.org/packages/LicensedBundler/ | @MikeSmithDev mikesmithdev.com */
3!function(n){"use strict";var t=function(t,i){this.options=i;this.$element=n(t);this.$container=n("<div/>",{"class":"ms-container"});this.$selectableContainer=n("<div/>",{"class":"ms-selectable"});this.$selectionContainer=n("<div/>",{"class":"ms-selection"});this.$selectableUl=n("<ul/>",{"class":"ms-list",tabindex:"-1"});this.$selectionUl=n("<ul/>",{"class":"ms-list",tabindex:"-1"});this.scrollTo=0;this.elemsSelector="li:visible:not(.ms-optgroup-label,.ms-optgroup-container,."+i.disabledClass+")"};t.prototype={constructor:t,init:function(){var t=this,i=this.$element,r,u;if(i.next(".ms-container").length===0){i.css({position:"absolute",left:"-9999px"});i.attr("id",i.attr("id")?i.attr("id"):Math.ceil(Math.random()*1e3)+"multiselect");this.$container.attr("id","ms-"+i.attr("id"));this.$container.addClass(t.options.cssClass);i.find("option").each(function(){t.generateLisFromOption(this)});this.$selectionUl.find(".ms-optgroup-label").hide();t.options.selectableHeader&&t.$selectableContainer.append(t.options.selectableHeader);t.$selectableContainer.append(t.$selectableUl);t.options.selectableFooter&&t.$selectableContainer.append(t.options.selectableFooter);t.options.selectionHeader&&t.$selectionContainer.append(t.options.selectionHeader);t.$selectionContainer.append(t.$selectionUl);t.options.selectionFooter&&t.$selectionContainer.append(t.options.selectionFooter);t.$container.append(t.$selectableContainer);t.$container.append(t.$selectionContainer);i.after(t.$container);t.activeMouse(t.$selectableUl);t.activeKeyboard(t.$selectableUl);r=t.options.dblClick?"dblclick":"click";t.$selectableUl.on(r,".ms-elem-selectable",function(){t.select(n(this).data("ms-value"))});t.$selectionUl.on(r,".ms-elem-selection",function(){t.deselect(n(this).data("ms-value"))});t.activeMouse(t.$selectionUl);t.activeKeyboard(t.$selectionUl);i.on("focus",function(){t.$selectableUl.focus()})}u=i.find("option:selected").map(function(){return n(this).val()}).get();t.select(u,"init");typeof t.options.afterInit=="function"&&t.options.afterInit.call(this,this.$container)},generateLisFromOption:function(t,i){for(var e,o,a,v,r=this,d=r.$element,w="",h=n(t),y=0;y<t.attributes.length;y++)e=t.attributes[y],e.name!=="value"&&e.name!=="disabled"&&(w+=e.name+'="'+e.value+'" ');var s=n("<li "+w+"><span>"+r.escapeHTML(h.text())+"<\/span><\/li>"),c=s.clone(),p=h.val(),b=r.sanitize(p);if(s.data("ms-value",p).addClass("ms-elem-selectable").attr("id",b+"-selectable"),c.data("ms-value",p).addClass("ms-elem-selection").attr("id",b+"-selection").hide(),(h.prop("disabled")||d.prop("disabled"))&&(c.addClass(r.options.disabledClass),s.addClass(r.options.disabledClass)),o=h.parent("optgroup"),o.length>0){var k=o.attr("label"),l=r.sanitize(k),u=r.$selectableUl.find("#optgroup-selectable-"+l),f=r.$selectionUl.find("#optgroup-selection-"+l);if(u.length===0){if(a='<li class="ms-optgroup-container"><\/li>',v='<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+k+"<\/span><\/li><\/ul>",u=n(a),f=n(a),u.attr("id","optgroup-selectable-"+l),f.attr("id","optgroup-selection-"+l),u.append(n(v)),f.append(n(v)),r.options.selectableOptgroup){u.find(".ms-optgroup-label").on("click",function(){var t=o.children(":not(:selected, :disabled)").map(function(){return n(this).val()}).get();r.select(t)});f.find(".ms-optgroup-label").on("click",function(){var t=o.children(":selected:not(:disabled)").map(function(){return n(this).val()}).get();r.deselect(t)})}r.$selectableUl.append(u);r.$selectionUl.append(f)}i=i==undefined?u.find("ul").children().length:i+1;s.insertAt(i,u.children());c.insertAt(i,f.children())}else i=i==undefined?r.$selectableUl.children().length:i,s.insertAt(i,r.$selectableUl),c.insertAt(i,r.$selectionUl)},addOption:function(t){var i=this;t.value!==undefined&&t.value!==null&&(t=[t]);n.each(t,function(t,r){if(r.value!==undefined&&r.value!==null&&i.$element.find("option[value='"+r.value+"']").length===0){var u=n('<option value="'+r.value+'">'+r.text+"<\/option>"),t=parseInt(typeof r.index=="undefined"?i.$element.children().length:r.index),f=r.nested==undefined?i.$element:n("optgroup[label='"+r.nested+"']");u.insertAt(t,f);i.generateLisFromOption(u.get(0),t,r.nested)}})},escapeHTML:function(t){return n("<div>").text(t).html()},activeKeyboard:function(t){var i=this;t.on("focus",function(){n(this).addClass("ms-focus")}).on("blur",function(){n(this).removeClass("ms-focus")}).on("keydown",function(r){switch(r.which){case 40:case 38:r.preventDefault();r.stopPropagation();i.moveHighlight(n(this),r.which===38?-1:1);return;case 37:case 39:r.preventDefault();r.stopPropagation();i.switchList(t);return;case 9:if(i.$element.is("[tabindex]")){r.preventDefault();var u=parseInt(i.$element.attr("tabindex"),10);u=r.shiftKey?u-1:u+1;n('[tabindex="'+u+'"]').focus();return}r.shiftKey&&i.$element.trigger("focus")}if(n.inArray(r.which,i.options.keySelect)>-1){r.preventDefault();r.stopPropagation();i.selectHighlighted(t);return}})},moveHighlight:function(n,t){var r=n.find(this.elemsSelector),f=r.filter(".ms-hover"),i=null,c=r.first().outerHeight(),l=n.height(),a="#"+this.$container.prop("id"),o,u,e,s,h;r.removeClass("ms-hover");t===1?(i=f.nextAll(this.elemsSelector).first(),i.length===0&&(u=f.parent(),u.hasClass("ms-optgroup")?(e=u.parent(),o=e.next(":visible"),i=o.length>0?o.find(this.elemsSelector).first():r.first()):i=r.first())):t===-1&&(i=f.prevAll(this.elemsSelector).first(),i.length===0&&(u=f.parent(),u.hasClass("ms-optgroup")?(e=u.parent(),s=e.prev(":visible"),i=s.length>0?s.find(this.elemsSelector).last():r.last()):i=r.last()));i.length>0&&(i.addClass("ms-hover"),h=n.scrollTop()+i.position().top-l/2+c/2,n.scrollTop(h))},selectHighlighted:function(n){var i=n.find(this.elemsSelector),t=i.filter(".ms-hover").first();t.length>0&&(n.parent().hasClass("ms-selectable")?this.select(t.data("ms-value")):this.deselect(t.data("ms-value")),i.removeClass("ms-hover"))},switchList:function(n){n.blur();this.$container.find(this.elemsSelector).removeClass("ms-hover");n.parent().hasClass("ms-selectable")?this.$selectionUl.focus():this.$selectableUl.focu
3s()},activeMouse:function(){var t=this;n("body").on("mouseenter",t.elemsSelector,function(){n(this).parents(".ms-container").find(t.elemsSelector).removeClass("ms-hover");n(this).addClass("ms-hover")});n("body").on("mouseleave",t.elemsSelector,function(){n(this).parents(".ms-container").find(t.elemsSelector).removeClass("ms-hover")})},refresh:function(){this.destroy();this.$element.multiSelect(this.options)},destroy:function(){n("#ms-"+this.$element.attr("id")).remove();this.$element.css("position","").css("left","");this.$element.removeData("multiselect")},select:function(t,i){var o,h,u;typeof t=="string"&&(t=[t]);var r=this,c=this.$element,f=n.map(t,function(n){return r.sanitize(n)}),s=this.$selectableUl.find("#"+f.join("-selectable, #")+"-selectable").filter(":not(."+r.options.disabledClass+")"),e=this.$selectionUl.find("#"+f.join("-selection, #")+"-selection").filter(":not(."+r.options.disabledClass+")"),l=c.find("option:not(:disabled)").filter(function(){return n.inArray(this.value,t)>-1});i==="init"&&(s=this.$selectableUl.find("#"+f.join("-selectable, #")+"-selectable"),e=this.$selectionUl.find("#"+f.join("-selection, #")+"-selection"));s.length>0&&(s.addClass("ms-selected").hide(),e.addClass("ms-selected").show(),l.prop("selected",!0),r.$container.find(r.elemsSelector).removeClass("ms-hover"),o=r.$selectableUl.children(".ms-optgroup-container"),o.length>0?(o.each(function(){var t=n(this).find(".ms-elem-selectable");t.length===t.filter(".ms-selected").length&&n(this).find(".ms-optgroup-label").hide()}),h=r.$selectionUl.children(".ms-optgroup-container"),h.each(function(){var t=n(this).find(".ms-elem-selection");t.filter(".ms-selected").length>0&&n(this).find(".ms-optgroup-label").show()})):r.options.keepOrder&&i!=="init"&&(u=r.$selectionUl.find(".ms-selected"),u.length>1&&u.last().get(0)!=e.get(0)&&e.insertAfter(u.last())),i!=="init"&&(c.trigger("change"),typeof r.options.afterSelect=="function"&&r.options.afterSelect.call(this,t)))},deselect:function(t){var r,u;typeof t=="string"&&(t=[t]);var i=this,f=this.$element,e=n.map(t,function(n){return i.sanitize(n)}),s=this.$selectableUl.find("#"+e.join("-selectable, #")+"-selectable"),o=this.$selectionUl.find("#"+e.join("-selection, #")+"-selection").filter(".ms-selected").filter(":not(."+i.options.disabledClass+")"),h=f.find("option").filter(function(){return n.inArray(this.value,t)>-1});o.length>0&&(s.removeClass("ms-selected").show(),o.removeClass("ms-selected").hide(),h.prop("selected",!1),i.$container.find(i.elemsSelector).removeClass("ms-hover"),r=i.$selectableUl.children(".ms-optgroup-container"),r.length>0&&(r.each(function(){var t=n(this).find(".ms-elem-selectable");t.filter(":not(.ms-selected)").length>0&&n(this).find(".ms-optgroup-label").show()}),u=i.$selectionUl.children(".ms-optgroup-container"),u.each(function(){var t=n(this).find(".ms-elem-selection");t.filter(".ms-selected").length===0&&n(this).find(".ms-optgroup-label").hide()})),f.trigger("change"),typeof i.options.afterDeselect=="function"&&i.options.afterDeselect.call(this,t))},select_all:function(){var t=this.$element,r=t.val(),i;t.find('option:not(":disabled")').prop("selected",!0);this.$selectableUl.find(".ms-elem-selectable").filter(":not(."+this.options.disabledClass+")").addClass("ms-selected").hide();this.$selectionUl.find(".ms-optgroup-label").show();this.$selectableUl.find(".ms-optgroup-label").hide();this.$selectionUl.find(".ms-elem-selection").filter(":not(."+this.options.disabledClass+")").addClass("ms-selected").show();this.$selectionUl.focus();t.trigger("change");typeof this.options.afterSelect=="function"&&(i=n.grep(t.val(),function(t){return n.inArray(t,r)<0}),this.options.afterSelect.call(this,i))},deselect_all:function(){var n=this.$element,t=n.val();n.find("option").prop("selected",!1);this.$selectableUl.find(".ms-elem-selectable").removeClass("ms-selected").show();this.$selectionUl.find(".ms-optgroup-label").hide();this.$selectableUl.find(".ms-optgroup-label").show();this.$selectionUl.find(".ms-elem-selection").removeClass("ms-selected").hide();this.$selectableUl.focus();n.trigger("change");typeof this.options.afterDeselect=="function"&&this.options.afterDeselect.call(this,t)},sanitize:function(n){var t=0,i,u,r;if(n.length==0)return t;for(r=0,i=0,r=n.length;i<r;i++)u=n.charCodeAt(i),t=(t<<5)-t+u|0;return t}};n.fn.multiSelect=function(){var i=arguments[0],r=arguments;return this.each(function(){var f=n(this),u=f.data("multiselect"),e=n.extend({},n.fn.multiSelect.defaults,f.data(),typeof i=="object"&&i);u||f.data("multiselect",u=new t(this,e));typeof i=="string"?u[i](r[1]):u.init()})};n.fn.multiSelect.defaults={keySelect:[32],selectableOptgroup:!1,disabledClass:"disabled",dblClick:!1,keepOrder:!1,cssClass:""};n.fn.multiSelect.Constructor=t;n.fn.insertAt=function(n,t){return this.each(function(){n===0?t.prepend(this):t.children().eq(n-1).after(this)})}}(window.jQuery);/*!
4 * marked - a markdown parser
5 * Copyright (c) 2011-2013, Christopher Jeffrey. (MIT Licensed)
6 * https://github.com/chjj/marked
7 */
8(function(){function s(t){this.tokens=[];this.tokens.links={};this.options=t||i.defaults;this.rules=n.normal;this.options.gfm&&(this.rules=this.options.tables?n.tables:n.gfm)}function e(n,r){if(this.options=r||i.defaults,this.links=n,this.rules=t.normal,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?t.breaks:t.gfm:this.options.pedantic&&(this.rules=t.pedantic)}function u(n){this.tokens=[];this.token=null;this.options=n||i.defaults}function r(n,t){return n.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function f(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 h(){}function o(n){for(var r=1,t,i;r<arguments.length;r++){t=arguments[r];for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}function i(n,t,f){var e,h,c,a,l;if(f||typeof t=="function"){f||(f=t,t=null);t=o({},i.defaults,t||{});e=t.highlight;a=0;try{h=s.lex(n,t)}catch(v){return f(v)}if((c=h.length,l=function(){var i,n;try{i=u.parse(h,t)}catch(r){n=r}return t.highlight=e,n?f(n):f(null,i)},!e||e.length<3)||(delete t.highlight,!c))return l();for(;a<h.length;a++)(function(n){return n.type!=="code"?--c||l():e(n.text,n.lang,function(t,i){if(i==null||i===n.text)return--c||l(
8);n.text=i;n.escaped=!0;--c||l()})})(h[a]);return}try{return t&&(t=o({},i.defaults,t)),u.parse(s.lex(n,t),t)}catch(v){if(v.message+="\nPlease report this to https://github.com/chjj/marked.",(t||i.defaults).silent)return"<p>An error occured:<\/p><pre>"+r(v.message+"",!0)+"<\/pre>";throw v;}}var n={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:h,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:h,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:h,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/},t;n.bullet=/(?:[*+-]|\d+\.)/;n.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;n.item=f(n.item,"gm")(/bull/g,n.bullet)();n.list=f(n.list)(/bull/g,n.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)();n._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+(?!:/|@)\\b";n.html=f(n.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,n._tag)();n.paragraph=f(n.paragraph)("hr",n.hr)("heading",n.heading)("lheading",n.lheading)("blockquote",n.blockquote)("tag","<"+n._tag)("def",n.def)();n.normal=o({},n);n.gfm=o({},n.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});n.gfm.paragraph=f(n.paragraph)("(?!","(?!"+n.gfm.fences.source.replace("\\1","\\2")+"|"+n.list.source.replace("\\1","\\3")+"|")();n.tables=o({},n.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});s.rules=n;s.lex=function(n,t){var i=new s(t);return i.lex(n)};s.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)};s.prototype.token=function(t,i){for(var t=t.replace(/^ +$/gm,""),o,s,r,h,c,u,l,f,e;t;){if((r=this.rules.newline.exec(t))&&(t=t.substring(r[0].length),r[0].length>1&&this.tokens.push({type:"space"})),r=this.rules.code.exec(t)){t=t.substring(r[0].length);r=r[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:this.options.pedantic?r:r.replace(/\n+$/,"")});continue}if(r=this.rules.fences.exec(t)){t=t.substring(r[0].length);this.tokens.push({type:"code",lang:r[2],text:r[3]});continue}if(r=this.rules.heading.exec(t)){t=t.substring(r[0].length);this.tokens.push({type:"heading",depth:r[1].length,text:r[2]});continue}if(i&&(r=this.rules.nptable.exec(t))){for(t=t.substring(r[0].length),u={type:"table",header:r[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:r[3].replace(/\n$/,"").split("\n")},f=0;f<u.align.length;f++)u.align[f]=/^ *-+: *$/.test(u.align[f])?"right":/^ *:-+: *$/.test(u.align[f])?"center":/^ *:-+ *$/.test(u.align[f])?"left":null;for(f=0;f<u.cells.length;f++)u.cells[f]=u.cells[f].split(/ *\| */);this.tokens.push(u);continue}if(r=this.rules.lheading.exec(t)){t=t.substring(r[0].length);this.tokens.push({type:"heading",depth:r[2]==="="?1:2,text:r[1]});continue}if(r=this.rules.hr.exec(t)){t=t.substring(r[0].length);this.tokens.push({type:"hr"});continue}if(r=this.rules.blockquote.exec(t)){t=t.substring(r[0].length);this.tokens.push({type:"blockquote_start"});r=r[0].replace(/^ *> ?/gm,"");this.token(r,i);this.tokens.push({type:"blockquote_end"});continue}if(r=this.rules.list.exec(t)){for(t=t.substring(r[0].length),h=r[2],this.tokens.push({type:"list_start",ordered:h.length>1}),r=r[0].match(this.rules.item),o=!1,e=r.length,f=0;f<e;f++)u=r[f],l=u.length,u=u.replace(/^ *([*+-]|\d+\.) +/,""),~u.indexOf("\n ")&&(l-=u.length,u=this.options.pedantic?u.replace(/^ {1,4}/gm,""):u.replace(new RegExp("^ {1,"+l+"}","gm"),"")),this.options.smartLists&&f!==e-1&&(c=n.bullet.exec(r[f+1])[0],h===c||h.length>1&&c.length>1||(t=r.slice(f+1).join("\n")+t,f=e-1)),s=o||/\n\n(?!\s*$)/.test(u),f!==e-1&&(o=u.charAt(u.length-1)==="\n",s||(s=o)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(u,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"});continue}if(r=this.rules.html.exec(t)){t=t.substring(r[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:r[1]==="pre"||r[1]==="script"||r[1]==="style",text:r[0]});continue}if(i&&(r=this.rules.def.exec(t))){t=t.substring(r[0].length);this.tokens.links[r[1].toLowerCase()]={href:r[2],title:r[3]};continue}if(i&&(r=this.rules.table.exec(t))){for(t=t.substring(r[0].length),u={type:"table",header:r[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:r[3].replace(/(?: *\| *)?\n$/,"").split("\n")},f=0;f<u.align.length;f++)u.align[f]=/^ *-+: *$/.test(u.align[f])?"right":/^ *:-+: *$/.test(u.align[f])?"center":/^ *:-+ *$/.test(u.align[f])?"left":null;for(f=0;f<u.cells.length;f++)u.cells[f]=u.cells[f].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(u);continue}if(i&&(r=this.rules.paragraph.exec(t))){t=t.substring(r[0].length);this.tokens.push({type:"paragraph",text:r[1].charAt(r[1].length-1)==="\n"?r[1].slice(0,-1):r[1]});continue}if(r=this.rules.text.exec(t)){t=t.substring(r[0].length);this.tokens.push({type:"text",text:r[0]});continue}if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0));}return this.tokens};t={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:h,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:h,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};t._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;t._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;t.link=f(t.link)("inside",t._inside)("href",t._href)();t.reflink=f(t.reflink)("inside",t._inside)();t.normal=o({},t);t.pedantic=o({},t.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});t.gfm=o({},t.normal,{escape:f(t.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:f(t.text)("]|","~]|")("|","|https?://|")()});t.breaks=o({},t.gfm,{br:f(t.br)("{2,}","*")(),text:f(t.gfm.text)("{2,}","*")()});e.rules=t;e.output=function(n,t,i){var r=new e(t,i);return r.output(n)};e.prototype.output=function(n){for(var i="",f,u,e,t;n;){if(t=this.rules.escape.exec(n)){n=n.substring(t[0].length);i+=t[1];continue}if(t=this.rules.autolink.exec(n)){n=n.substring(t[0].length);t[2]==="@"?(u=t[1].charAt(6)===":"?this.mangle(t[1].substring(7)):this.mangle(t[1]),e=this.mangle("mailto:")+u):(u=r(t[1]),e=u);i+='<a href="'+e+'">'+u+"<\/a>";continue}if(t=this.rules.url.exec(n)){n=n.substring(t[0].length);u=r(t[1]);e=u;i+='<a href="'+e+'">'+u+"<\/a>";continue}if(t=this.rules.tag.exec(n)){n=n.substring(t[0].length);i+=this.options.sanitize?r(t[0]):t[0];continue}if(t=this.rules.link.exec(n)){n=n.substring(t[0].length);i+=this.outputLink(t,{href:t[2],title:t[3]});continue}if((t=this.rules.reflink.exec(n))||(t=this.rules.nolink.exec(n))){if(n=n.substring(t[0].length),f=(t[2]||t[1]).replace(/\s+/g," "),f=this.links[f.toLowerCase()],!f||!f.href){i+=t[0].charAt(0);n=t[0].substring(1)+n;continue}i+=this.outputLink(t,f);continue}if(t=this.rules.strong.exec(n)){n=n.substring(t[0].length);i+="<strong>"+this.output(t[2]||t[1])+"<\/strong>";continue}if(t=this.rules.em.exec(n)){n=n.substring(t[0].length);i+="<em>"+this.output(t[2]||t[1])+"<\/em>";continue}if(t=this.rules.code.exec(n)){n=n.substring(t[0].length);i+="<code>"+r(t[2],!0)+"<\/code>";continue}if(t=this.rules.br.exec(n)){n=n.substring(t[0].length);i+="<br>";continue}if(t=this.rules.del.exec(n)){n=n.substring(t[0].length);i+="<del>"+this.output(t[1])+"<\/del>";continue}if(t=this.rules.text.exec(n)){n=n.substring(t[0].length);i+=r(this.smartypants(t[0]));continue}if(n)throw new Error("Infinite loop on byte: "+n.charCodeAt(0));}return i};e.prototype.outputLink=function(n,t){return n[0].charAt(0)!=="!"?'<a href="'+r(t.href)+'"'+(t.title?' title="'+r(t.title)+'"':"")+">"+this.output(n[1])+"<\/a>":'<img src="'+r(t.href)+'" alt="'+r(n[1])+'"'+(t.title?' title="'+r(t.title)+'"':"")+">"};e.prototype.smartypants=function(n){return this.options.smartypants?n.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):n};e.prototype.mangle=function(n){for(var r="",u=n.length,i=0,t;i<u;i++)t=n.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),r+="&#"+t+";";return r};u.parse=function(n,t){var i=new u(t);return i.parse(n)};u.prototype.parse=function(n){this.inline=new e(n.links,this.options);this.tokens=n.reverse();for(var t="";this.next();)t+=this.tok();return t};u.prototype.next=function(){return this.token=this.tokens.pop()};u.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};u.prototype.parseText=function(){for(var n=this.token.text;this.peek().type==="text";)n+="\n"+this.next().text;return this.inline.output(n)};u.prototype.tok=function(){var u,o,t,f,s,i,e,n;switch(this.token.type){case"space":return"";case"hr":return"<hr>\n";case"heading":return"<h"+this.token.depth+' id="'+this.token.text.toLowerCase().replace(/[^\w]+/g,"-")+'">
8'+this.inline.output(this.token.text)+"<\/h"+this.token.depth+">\n";case"code":return this.options.highlight&&(u=this.options.highlight(this.token.text,this.token.lang),u!=null&&u!==this.token.text&&(this.token.escaped=!0,this.token.text=u)),this.token.escaped||(this.token.text=r(this.token.text,!0)),"<pre><code"+(this.token.lang?' class="'+this.options.langPrefix+this.token.lang+'"':"")+">"+this.token.text+"<\/code><\/pre>\n";case"table":for(n="",n+="<thead>\n<tr>\n",t=0;t<this.token.header.length;t++)o=this.inline.output(this.token.header[t]),n+="<th",this.token.align[t]&&(n+=' style="text-align:'+this.token.align[t]+'"'),n+=">"+o+"<\/th>\n";for(n+="<\/tr>\n<\/thead>\n",n+="<tbody>\n",t=0;t<this.token.cells.length;t++){for(f=this.token.cells[t],n+="<tr>\n",i=0;i<f.length;i++)s=this.inline.output(f[i]),n+="<td",this.token.align[i]&&(n+=' style="text-align:'+this.token.align[i]+'"'),n+=">"+s+"<\/td>\n";n+="<\/tr>\n"}return n+="<\/tbody>\n","<table>\n"+n+"<\/table>\n";case"blockquote_start":for(n="";this.next().type!=="blockquote_end";)n+=this.tok();return"<blockquote>\n"+n+"<\/blockquote>\n";case"list_start":for(e=this.token.ordered?"ol":"ul",n="";this.next().type!=="list_end";)n+=this.tok();return"<"+e+">\n"+n+"<\/"+e+">\n";case"list_item_start":for(n="";this.next().type!=="list_item_end";)n+=this.token.type==="text"?this.parseText():this.tok();return"<li>"+n+"<\/li>\n";case"loose_item_start":for(n="";this.next().type!=="list_item_end";)n+=this.tok();return"<li>"+n+"<\/li>\n";case"html":return!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;case"paragraph":return"<p>"+this.inline.output(this.token.text)+"<\/p>\n";case"text":return"<p>"+this.parseText()+"<\/p>\n"}};h.exec=h;i.options=i.setOptions=function(n){return o(i.defaults,n),i};i.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1};i.Parser=u;i.parser=u.parse;i.Lexer=s;i.lexer=s.lex;i.InlineLexer=e;i.inlineLexer=e.output;i.parse=i;typeof exports=="object"?module.exports=i:typeof define=="function"&&define.amd?define(function(){return i}):this.marked=i}).call(function(){return this||(typeof window!="undefined"?window:global)}());(function(n){function k(n){return b?n.replace("Ctrl","Cmd"):n.replace("Cmd","Ctrl")}function d(n,t){t=t||{};var i=document.createElement("a"),r=t.shortcut||h[n];return r&&(r=k(r),i.title=r,i.title=i.title.replace("Cmd","⌘"),b&&(i.title=i.title.replace("Alt","⌥"))),i.className=t.className||"icon-"+n,i}function rt(){return el=document.createElement("i"),el.className="separator",el.innerHTML="|",el}function r(n,t){var f,e,i,r,o,u;if(t=t||n.getCursor("start"),f=n.getTokenAt(t),!f.type)return{};for(e=f.type.split(" "),i={},u=0;u<e.length;u++)r=e[u],r==="strong"?i.bold=!0:r==="variable-2"?(o=n.getLine(t.line),/^\s*\d+\.\s/.test(o)?i["ordered-list"]=!0:i["unordered-list"]=!0):r==="atom"?i.quote=!0:r==="em"&&(i.italic=!0);return i}function c(n){var i=n.codemirror.getWrapperElement(),t=document,u=t.fullScreen||t.mozFullScreen||t.webkitFullScreen,f=function(){i.requestFullScreen?i.requestFullScreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullScreen&&i.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)},r=function(){t.cancelFullScreen?t.cancelFullScreen():t.mozCancelFullScreen?t.mozCancelFullScreen():t.webkitCancelFullScreen&&t.webkitCancelFullScreen()};u?r&&r():f()}function u(n){var t=n.codemirror,s=r(t),u,f="**",e="**",i=t.getCursor("start"),o=t.getCursor("end");s.bold?(u=t.getLine(i.line),f=u.slice(0,i.ch),e=u.slice(i.ch),f=f.replace(/^(.*)?(\*|\_){2}(\S+.*)?$/,"$1$3"),e=e.replace(/^(.*\S+)?(\*|\_){2}(\s+.*)?$/,"$1$3"),i.ch-=2,o.ch-=2,t.setLine(i.line,f+e)):(u=t.getSelection(),t.replaceSelection(f+u+e),i.ch+=2,o.ch+=2);t.setSelection(i,o);t.focus()}function f(n){var t=n.codemirror,s=r(t),u,f="*",e="*",i=t.getCursor("start"),o=t.getCursor("end");s.italic?(u=t.getLine(i.line),f=u.slice(0,i.ch),e=u.slice(i.ch),f=f.replace(/^(.*)?(\*|\_)(\S+.*)?$/,"$1$3"),e=e.replace(/^(.*\S+)?(\*|\_)(\s+.*)?$/,"$1$3"),i.ch-=1,o.ch-=1,t.setLine(i.line,f+e)):(u=t.getSelection(),t.replaceSelection(f+u+e),i.ch+=1,o.ch+=1);t.setSelection(i,o);t.focus()}function e(n){var t=n.codemirror;y(t,"quote")}function o(n){var t=n.codemirror;y(t,"unordered-list")}function s(n){var t=n.codemirror;y(t,"ordered-list")}function l(n){var t=n.codemirror,i=r(t);tt(t,i.link,"[","](http://)")}function a(n){var t=n.codemirror,i=r(t);tt(t,i.image,"![","](http://)")}function g(n){var t=n.codemirror;t.undo();t.focus()}function nt(n){var t=n.codemirror;t.redo();t.focus()}function v(n){var i=n.toolbar.preview,e=n.constructor.markdown,r=n.codemirror,u=r.getWrapperElement(),t=u.lastChild,f;/editor-preview/.test(t.className)||(t=document.createElement("div"),t.className="editor-preview",u.appendChild(t));/editor-preview-active/.test(t.className)?(t.className=t.className.replace(/\s*editor-preview-active\s*/g,""),i.className=i.className.replace(/\s*active\s*/g,"")):(setTimeout(function(){t.className+=" editor-preview-active"},1),i.className+=" active");f=r.getValue();t.innerHTML=e(f)}function tt(n,t,i,r){var f,u=n.getCursor("start"),e=n.getCursor("end");t?(f=n.getLine(u.line),i=f.slice(0,u.ch),r=f.slice(u.ch),n.setLine(u.line,i+r)):(f=n.getSelection(),n.replaceSelection(i+f+r),u.ch+=i.length,e.ch+=i.length);n.setSelection(u,e);n.focus()}function y(n,t){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.setLine(i,r)})(i);n.focus()}function ut(n){var i=n.match(/[a-zA-Z0-9_\u0392-\u03c9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g),r=0,t;if(i===null)return r;for(t=0;t<i.length;t++)r+=i[t].charCodeAt(0)>=19968?i[t].length:1;return r}function t(n){n=n||{};
8n.element&&(this.element=n.element);n.toolbar=n.toolbar||t.toolbar;n.hasOwnProperty("status")||(n.status=["lines","words","cursor"]);this.options=n;this.element&&this.render()}var i=function(){"use strict";function n(t,i){var r,o,e,u,s;if(!(this instanceof n))return new n(t,i);this.options=i=i||{};for(r in ue)!i.hasOwnProperty(r)&&ue.hasOwnProperty(r)&&(i[r]=ue[r]);ce(i);o=typeof i.value=="string"?0:i.value.first;e=this.display=gl(t,o);e.wrapper.CodeMirror=this;nh(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new ts};gs(this);i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");u=i.value;typeof u=="string"&&(u=new w(i.value,i.mode));f(this,pc)(this,u);l&&setTimeout(ut(pt,this,!0),20);ba(this);try{s=document.activeElement==e.input}catch(h){}s||i.autofocus&&!hl?setTimeout(ut(ti,this),20):fo(this);f(this,function(){var n,t;for(n in ei)ei.propertyIsEnumerable(n)&&ei[n](this,i[n],ls);for(t=0;t<fe.length;++t)fe[t](this)})()}function gl(n,t){var r={},u=r.input=i("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");return nt?u.style.width="1000px":u.setAttribute("wrap","off"),hu&&(u.style.border="1px solid black"),u.setAttribute("autocorrect","off"),u.setAttribute("autocapitalize","off"),u.setAttribute("spellcheck","false"),r.inputDiv=i("div",[u],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),r.scrollbarH=i("div",[i("div",null,null,"height: 1px")],"CodeMirror-hscrollbar"),r.scrollbarV=i("div",[i("div",null,null,"width: 1px")],"CodeMirror-vscrollbar"),r.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler"),r.gutterFiller=i("div",null,"CodeMirror-gutter-filler"),r.lineDiv=i("div",null,"CodeMirror-code"),r.selectionDiv=i("div",null,null,"position: relative; z-index: 1"),r.cursor=i("div"," ","CodeMirror-cursor"),r.otherCursor=i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"),r.measure=i("div",null,"CodeMirror-measure"),r.lineSpace=i("div",[r.measure,r.selectionDiv,r.lineDiv,r.cursor,r.otherCursor],null,"position: relative; outline: none"),r.mover=i("div",[i("div",[r.lineSpace],"CodeMirror-lines")],null,"position: relative"),r.sizer=i("div",[r.mover],"CodeMirror-sizer"),r.heightForcer=i("div",null,null,"position: absolute; height: "+si+"px; width: 1px;"),r.gutters=i("div",null,"CodeMirror-gutters"),r.lineGutter=null,r.scroller=i("div",[r.sizer,r.heightForcer,r.gutters],"CodeMirror-scroll"),r.scroller.setAttribute("tabIndex","-1"),r.wrapper=i("div",[r.inputDiv,r.scrollbarH,r.scrollbarV,r.scrollbarFiller,r.gutterFiller,r.scroller],"CodeMirror"),tr&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),n.appendChild?n.appendChild(r.wrapper):n(r.wrapper),hu&&(u.style.width="0px"),nt||(r.scroller.draggable=!0),ss?(r.inputDiv.style.height="1px",r.inputDiv.style.position="absolute"):tr&&(r.scrollbarH.style.minWidth=r.scrollbarV.style.minWidth="18px"),r.viewOffset=r.lastSizeC=0,r.showingFrom=r.showingTo=t,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.prevInput="",r.alignWidgets=!1,r.pollingFast=!1,r.poll=new ts,r.cachedCharWidth=r.cachedTextHeight=null,r.measureLineCache=[],r.measureLineCachePos=0,r.inaccurateSelection=!1,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r}function or(t){t.doc.mode=n.getMode(t.options,t.doc.modeOption);t.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null);n.styles&&(n.styles=null)});t.doc.frontier=t.doc.first;hr(t,100);t.state.modeGen++;t.curOp&&a(t)}function na(n){n.options.lineWrapping?(n.display.wrapper.className+=" CodeMirror-wrap",n.display.sizer.style.minWidth=""):(n.display.wrapper.className=n.display.wrapper.className.replace(" CodeMirror-wrap",""),he(n));ks(n);a(n);ci(n);setTimeout(function(){le(n)},100)}function bs(n){var t=li(n.display),i=n.options.lineWrapping,r=i&&Math.max(5,n.display.scroller.clientWidth/oh(n.display)-3);return function(u){return ri(n.doc,u)?0:i?(Math.ceil(u.text.length/r)||1)*t:t}}function ks(n){var t=n.doc,i=bs(n);t.iter(function(n){var t=i(n);t!=n.height&&rt(n,t)})}function ds(n){var t=ct[n.options.keyMap],i=t.style;n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(i?" cm-keymap-"+i:"");n.state.disableInput=t.disableInput}function gs(n){n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+n.options.theme.replace(/(^|\s)\s*/g," cm-s-");ci(n)}function sr(n){nh(n);a(n);setTimeout(function(){ve(n)},20)}function nh(n){var r=n.display.gutters,e=n.options.gutters,t,u,f;for(bf(r),t=0;t<e.length;++t)u=e[t],f=r.appendChild(i("div",null,"CodeMirror-gutter "+u)),u=="CodeMirror-linenumbers"&&(n.display.lineGutter=f,f.style.width=(n.display.lineNumWidth||1)+"px");r.style.display=t?"":"none"}function bu(n,t){var f,e,i,u;if(t.height==0)return 0;for(f=t.text.length,i=t;e=vo(i);)u=e.find(),i=r(n,u.from.line),f+=u.from.ch-u.to.ch;for(i=t;e=cf(i);)u=e.find(),f-=i.text.length-u.from.ch,i=r(n,u.to.line),f+=i.text.length-u.to.ch;return f}function he(n){var t=n.display,i=n.doc;t.maxLine=r(i,i.first);t.maxLineLength=bu(i,t.maxLine);t.maxLineChanged=!0;i.iter(function(n){var r=bu(i,n);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=n)})}function ce(n){for(var i=!1,t=0;t<n.gutters.length;++t)n.gutters[t]=="CodeMirror-linenumbers"&&(n.lineNumbers?i=!0:n.gutters.splice(t--,1));!i&&n.lineNumbers&&n.gutters.push("CodeMirror-linenumbers")}function le(n){var t=n.display,e=n.doc.height,r=e+rh(t);t.sizer.style.minHeight=t.heightForcer.style.top=r+"px";t.gutters.style.height=Math.max(r,t.scroller.clientHeight-si)+"px";var f=Math.max(r,t.scroller.scrollHeight),i=t.scroller.scrollWidth>t.scroller.clientWidth+1,u=f>t.scroller.clientHeight+1;u?(t.scrollbarV.style.display="block",t.scrollbarV.style.bottom=i?ou(t.measure)+"px":"0",t.scrollbarV.firstChild.style.height=f-t.scroller.clientHeight+t.scrollbarV.clientHeight+"px"):t.scrollbarV.style.display="";i?(t.scrollbarH.style.display="block",t.scrollbarH.style.right=u?ou(t.measure)+"px":"0",t.scrollbarH.firstChild.style.width=t.scroller.scrollWidth-t.scroller.clientWidth+t.scrollbarH.clientWidth+"px"):t.scrollbarH.style.display="";i&&u?(t.scrollbarFiller.style.display="block",t.scrollbarFiller.style.height=t.scrollbarFiller.style.width=ou(t.measure)+"px"):t.scrollbarFiller.style.display="";i&&n.options.coverGutterNextToScrollbar&&n.options.fixedGutter?(t.gutterFiller.style.display="block",t.gutterFiller.style.height=ou(t.measure)+"px",t.gutterFiller.style.width=t.gutters.offsetWidth+"px"):t.gutterFiller.style.display="";sy&&ou(t.measure)===0&&(t.scrollbarV.style.minWidth=t.scrollbarH.style.minHeight=hy?"18px":"12px")}function ae(n,t,i){var r=n.scroller.scrollTop,u=n.wrapper.clientHeight,f;return typeof i=="number"?r=i:i&&(r=i.top,u=i.bottom-i.top),r=Math.floor(r-ih(n)),f=Math.ceil(r+u),{from:iu(t,r),to:iu(t,f)}}function ve(n){var t=n.display,i,r,u;if(t.alignWidgets||t.gutters.firstChild&&n.options.fixedGutter){var f=pe(t)-t.scroller.scrollLeft+n.doc.scrollLeft,e=t.gutters.offsetWidth,o=f+"px";for(i=t.lineDiv.firstChild;i;i=i.nextSibling)if(i.alignable)for(r=0,u=i.alignable;r<u.length;++r)u[r].style.left=o;n.options.fixedGutter&&(t.gutters.style.left=f+e+"px")}}function ta(n){if(!n.options.lineNumbers)return!1;var u=n.doc,r=ye(n.options,u.first+u.size-1),t=n.display;
8if(r.length!=t.lineNumChars){var f=t.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=f.firstChild.offsetWidth,o=f.offsetWidth-e;return t.lineGutter.style.width="",t.lineNumInnerWidth=Math.max(e,t.lineGutter.offsetWidth-o),t.lineNumWidth=t.lineNumInnerWidth+o,t.lineNumChars=t.lineNumInnerWidth?r.length:-1,t.lineGutter.style.width=t.lineNumWidth+"px",!0}return!1}function ye(n,t){return String(n.lineNumberFormatter(t+n.firstLineNumber))}function pe(n){return c(n.scroller).left-c(n.sizer).left}function ku(n,t,i,r){for(var e=n.display.showingFrom,o=n.display.showingTo,f,u=ae(n.display,n.doc,i);;){if(!ia(n,t,u,r))break;if(r=!1,f=!0,be(n),le(n),i&&(i=Math.min(n.display.scroller.scrollHeight-n.display.scroller.clientHeight,typeof i=="number"?i:i.top)),u=ae(n.display,n.doc,i),u.from>=n.display.showingFrom&&u.to<=n.display.showingTo)break;t=[]}return f&&(k(n,"update",n),(n.display.showingFrom!=e||n.display.showingTo!=o)&&k(n,"viewportChange",n,n.display.showingFrom,n.display.showingTo)),f}function ia(n,t,i,u){var f=n.display,o=n.doc,b,p,h,k,w,v,e,c,a,g;if(!f.wrapper.clientWidth){f.showingFrom=f.showingTo=o.first;f.viewOffset=0;return}if(u||t.length!=0||!(i.from>f.showingFrom)||!(i.to<f.showingTo)){if(ta(n)&&(t=[{from:o.first,to:o.first+o.size}]),b=f.sizer.style.marginLeft=f.gutters.offsetWidth+"px",f.scrollbarH.style.left=n.options.fixedGutter?b:"0",p=Infinity,n.options.lineNumbers)for(e=0;e<t.length;++e)if(t[e].diff){p=t[e].from;break}var y=o.first+o.size,l=Math.max(i.from-n.options.viewportMargin,o.first),s=Math.min(y,i.to+n.options.viewportMargin);if(f.showingFrom<l&&l-f.showingFrom<20&&(l=Math.max(o.first,f.showingFrom)),f.showingTo>s&&f.showingTo-s<20&&(s=Math.min(y,f.showingTo)),wu)for(l=d(lt(o,r(o,l)));s<y&&ri(o,r(o,s));)++s;if(h=[{from:Math.max(f.showingFrom,o.first),to:Math.min(f.showingTo,y)}],h=h[0].from>=h[0].to?[]:ua(h,t),wu)for(e=0;e<h.length;++e)for(c=h[e];k=cf(r(o,c.to-1));)if(w=k.find().from.line,w>c.from)c.to=w;else{h.splice(e--,1);break}for(v=0,e=0;e<h.length;++e)c=h[e],c.from<l&&(c.from=l),c.to>s&&(c.to=s),c.from>=c.to?h.splice(e--,1):v+=c.to-c.from;if(!u&&v==s-l&&l==f.showingFrom&&s==f.showingTo){th(n);return}h.sort(function(n,t){return n.from-t.from});try{a=document.activeElement}catch(nt){}return v<(s-l)*.7&&(f.lineDiv.style.display="none"),ea(n,l,s,h,p),f.lineDiv.style.display="",a&&document.activeElement!=a&&a.offsetHeight&&a.focus(),g=l!=f.showingFrom||s!=f.showingTo||f.lastSizeC!=f.wrapper.clientHeight,g&&(f.lastSizeC=f.wrapper.clientHeight,hr(n,400)),f.showingFrom=l,f.showingTo=s,ra(n),th(n),!0}}function ra(n){for(var f,e,o,r,u,s=n.display,h=s.lineDiv.offsetTop,t=s.lineDiv.firstChild,i;t;t=t.nextSibling)if(t.lineObj&&(tr?(f=t.offsetTop+t.offsetHeight,i=f-h,h=f):(e=c(t),i=e.bottom-e.top),o=t.lineObj.height-i,i<2&&(i=li(s)),(o>.001||o<-.001)&&(rt(t.lineObj,i),r=t.lineObj.widgets,r)))for(u=0;u<r.length;++u)r[u].height=r[u].node.offsetHeight}function th(n){var t=n.display.viewOffset=ru(n,r(n.doc,n.display.showingFrom));n.display.mover.style.top=t+"px"}function ua(n,t){for(var f,s,i,e=0,h=t.length||0;e<h;++e){var r=t[e],u=[],o=r.diff||0;for(f=0,s=n.length;f<s;++f)i=n[f],r.to<=i.from&&r.diff?u.push({from:i.from+o,to:i.to+o}):r.to<=i.from||r.from>=i.to?u.push(i):(r.from>i.from&&u.push({from:i.from,to:r.from}),r.to<i.to&&u.push({from:r.to+o,to:i.to+o}));n=u}return n}function fa(n){for(var i=n.display,u={},f={},t=i.gutters.firstChild,r=0;t;t=t.nextSibling,++r)u[n.options.gutters[r]]=t.offsetLeft,f[n.options.gutters[r]]=t.offsetWidth;return{fixedPos:pe(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:u,gutterWidth:f,wrapperWidth:i.wrapper.clientWidth}}function ea(n,t,r,u,f){function h(t){var i=t.nextSibling;return nt&&ir&&n.display.currentWheelTarget==t?(t.style.display="none",t.lineObj=null):t.parentNode.removeChild(t),i}var l=fa(n),a=n.display,v=n.options.lineNumbers,c,e,s,o;for(u.length||nt&&n.display.currentWheelTarget||bf(a.lineDiv),c=a.lineDiv,e=c.firstChild,s=u.shift(),o=t,n.doc.iter(t,r,function(t){var p,y,r,w,d,g,a,b,k;if(s&&s.to==o&&(s=u.shift()),ri(n.doc,t)){if(t.height!=0&&rt(t,0),t.widgets&&e.previousSibling)for(p=0;p<t.widgets.length;++p)y=t.widgets[p],y.showIfHidden&&(r=e.previousSibling,/pre/i.test(r.nodeName)&&(w=i("div",null,null,"position: relative"),r.parentNode.replaceChild(w,r),w.appendChild(r),r=w),d=r.appendChild(i("div",[y.node],"CodeMirror-linewidget")),y.handleMouseEvents||(d.ignoreEvents=!0),we(y,d,r,l))}else if(s&&s.from<=o&&s.to>o){while(e.lineObj!=t)e=h(e);v&&f<=o&&e.lineNumber&&el(e.lineNumber,ye(n.options,o));e=e.nextSibling}else{if(t.widgets)for(g=0,a=e;a&&g<20;++g,a=a.nextSibling)if(a.lineObj==t&&/div/i.test(a.nodeName)){b=a;break}if(k=oa(n,t,o,l,b),k!=b)c.insertBefore(k,e);else{while(e!=b)e=h(e);e=e.nextSibling}k.lineObj=t}++o});e;)e=h(e)}function oa(n,t,r,u,f){var y=po(n,t),c=t.gutterMarkers,it=n.display,e,s,g,l,p,a,w,h,b,o,v;if(!n.options.lineNumbers&&!c&&!t.bgClass&&!t.wrapClass&&!t.widgets)return y;if(f){f.alignable=null;var nt=!0,tt=0,d=null;for(s=f.firstChild;s;s=g)if(g=s.nextSibling,/\bCodeMirror-linewidget\b/.test(s.className)){for(h=0;h<t.widgets.length;++h)if(o=t.widgets[h],o.node==s.firstChild){o.above||d||(d=s);we(o,s,f,u);++tt;break}if(h==t.widgets.length){nt=!1;break}}else f.removeChild(s);f.insertBefore(y,d);nt&&tt==t.widgets.length&&(e=f,f.className=t.wrapClass||"")}if(e||(e=i("div",null,t.wrapClass,"position: relative"),e.appendChild(y)),t.bgClass&&e.insertBefore(i("div",null,t.bgClass+" CodeMirror-linebackground"),e.firstChild),(n.options.lineNumbers||c)&&(l=e.insertBefore(i("div",null,null,"position: absolute; left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px"),e.firstChild),n.options.fixedGutter&&(e.alignable||(e.alignable=[])).push(l),!n.options.lineNumbers||c&&c["CodeMirror-linenumbers"]||(e.lineNumber=l.appendChild(i("div",ye(n.options,r),"CodeMirror-linenumber C
8odeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.lineNumInnerWidth+"px"))),c))for(p=0;p<n.options.gutters.length;++p)a=n.options.gutters[p],w=c.hasOwnProperty(a)&&c[a],w&&l.appendChild(i("div",[w],"CodeMirror-gutter-elt","left: "+u.gutterLeft[a]+"px; width: "+u.gutterWidth[a]+"px"));if(tr&&(e.style.zIndex=2),t.widgets&&e!=f)for(h=0,b=t.widgets;h<b.length;++h)o=b[h],v=i("div",[o.node],"CodeMirror-linewidget"),o.handleMouseEvents||(v.ignoreEvents=!0),we(o,v,e,u),o.above?e.insertBefore(v,n.options.lineNumbers&&t.height!=0?l:y):e.appendChild(v),k(o,"redraw");return e}function we(n,t,i,r){if(n.noHScroll){(i.alignable||(i.alignable=[])).push(t);var u=r.wrapperWidth;t.style.left=r.fixedPos+"px";n.coverGutter||(u-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px");t.style.width=u+"px"}n.coverGutter&&(t.style.zIndex=5,t.style.position="relative",n.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function be(n){var t=n.display,i=s(n.doc.sel.from,n.doc.sel.to);if(i||n.options.showCursorWhenSelecting?sa(n):t.cursor.style.display=t.otherCursor.style.display="none",i?t.selectionDiv.style.display="none":ha(n),n.options.moveInputWithCursor){var r=et(n,n.doc.sel.head,"div"),u=c(t.wrapper),f=c(t.lineDiv);t.inputDiv.style.top=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+f.top-u.top))+"px";t.inputDiv.style.left=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+f.left-u.left))+"px"}}function sa(n){var t=n.display,i=et(n,n.doc.sel.head,"div");t.cursor.style.left=i.left+"px";t.cursor.style.top=i.top+"px";t.cursor.style.height=Math.max(0,i.bottom-i.top)*n.options.cursorHeight+"px";t.cursor.style.display="";i.other?(t.otherCursor.style.display="",t.otherCursor.style.left=i.other.left+"px",t.otherCursor.style.top=i.other.top+"px",t.otherCursor.style.height=(i.other.bottom-i.other.top)*.85+"px"):t.otherCursor.style.display="none"}function ha(n){function e(n,t,r,u){t<0&&(t=0);v.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+n+"px; top: "+t+"px; width: "+(r==null?y-n:r)+"px; height: "+(u-t)+"px"))}function c(i,u,f){function a(r,u){return to(n,t(i,r),"div",l,u)}var l=r(h,i),v=l.text.length,o,c;return ry(ot(l),u||0,f==null?v:f,function(n,t,i){var r=a(n,"left"),h,l,p,w;n==t?(h=r,l=p=r.left):(h=a(t-1,"right"),i=="rtl"&&(w=r,r=h,h=w),l=r.left,p=h.right);u==null&&n==0&&(l=s);h.top-r.top>3&&(e(l,r.top,null,r.bottom),l=s,r.bottom<h.top&&e(l,r.bottom,null,h.top));f==null&&t==v&&(p=y);(!o||r.top<o.top||r.top==o.top&&r.left<o.left)&&(o=r);(!c||h.bottom>c.bottom||h.bottom==c.bottom&&h.right>c.right)&&(c=h);l<s+1&&(l=s);e(l,h.top,p-l,h.bottom)}),{start:o,end:c}}var l=n.display,h=n.doc,u=n.doc.sel,v=document.createDocumentFragment(),y=l.lineSpace.offsetWidth,s=aa(n.display);if(u.from.line==u.to.line)c(u.from.line,u.from.ch,u.to.ch);else{var p=r(h,u.from.line),w=r(h,u.to.line),a=lt(h,p)==lt(h,w),f=c(u.from.line,u.from.ch,a?p.text.length:null).end,o=c(u.to.line,a?0:null,u.to.ch).start;a&&(f.top<o.top-2?(e(f.right,f.top,null,f.bottom),e(s,o.top,o.left,o.bottom)):e(f.right,f.top,o.left-f.right,f.bottom));f.bottom<o.top&&e(s,f.bottom,null,o.top)}ht(l.selectionDiv,v);l.selectionDiv.style.display=""}function du(n){var t,i;n.state.focused&&(t=n.display,clearInterval(t.blinker),i=!0,t.cursor.style.visibility=t.otherCursor.style.visibility="",t.blinker=setInterval(function(){t.cursor.style.visibility=t.otherCursor.style.visibility=(i=!i)?"":"hidden"},n.options.cursorBlinkRate))}function hr(n,t){n.doc.mode.startState&&n.doc.frontier<n.display.showingTo&&n.state.highlight.set(t,ut(ca,n))}function ca(n){var t=n.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=n.display.showingTo)){var e=+new Date+n.options.workTime,r=bi(t.mode,cr(n,t.frontier)),i=[],u;t.iter(t.frontier,Math.min(t.first+t.size,n.display.showingTo+500),function(f){var o,h,s;if(t.frontier>=n.display.showingFrom){for(o=f.styles,f.styles=hc(n,f,r),h=!o||o.length!=f.styles.length,s=0;!h&&s<o.length;++s)h=o[s]!=f.styles[s];h&&(u&&u.end==t.frontier?u.end++:i.push(u={start:t.frontier,end:t.frontier+1}));f.stateAfter=bi(t.mode,r)}else lc(n,f,r),f.stateAfter=t.frontier%5==0?bi(t.mode,r):null;return++t.frontier,+new Date>e?(hr(n,n.options.workDelay),!0):void 0});i.length&&f(n,function(){for(var n=0;n<i.length;++n)a(this,i[n].start,i[n].end)})()}}function la(n,t,i){for(var e,o,h,s,f=n.doc,u=t,c=t-100;u>c;--u){if(u<=f.first)return f.first;if(e=r(f,u-1),e.stateAfter&&(!i||u<=f.frontier))return u;o=gi(e.text,null,n.options.tabSize);(s==null||h>o)&&(s=u-1,h=o)}return s}function cr(n,t,i){var f=n.doc,o=n.display,u,e;return f.mode.startState?(u=la(n,t,i),e=u>f.first&&r(f,u-1).stateAfter,e=e?bi(f.mode,e):tc(f.mode),f.iter(u,t,function(i){lc(n,i,e);var r=u==t-1||u%5==0||u>=o.showingFrom&&u<o.showingTo;i.stateAfter=r?bi(f.mode,e):null;++u}),e):!0}function ih(n){return n.lineSpace.offsetTop}function rh(n){return n.mover.offsetHeight-n.lineSpace.offsetHeight}function aa(n){var t=ht(n.measure,i("pre",null,null,"text-align: left")).appendChild(i("span","x"));return t.offsetLeft}function ke(n,t,i,r,u){var o=-1,e,f;for(r=r||ge(n,t),e=i;;
8e+=o){if(f=r[e],f)break;o<0&&e==0&&(o=1)}return u=e>i?"left":e<i?"right":u,u=="left"&&f.leftSide?f=f.leftSide:u=="right"&&f.rightSide&&(f=f.rightSide),{left:e<i?f.right:f.left,right:e>i?f.left:f.right,top:f.top,bottom:f.bottom}}function de(n,t){for(var i,u=n.display.measureLineCache,r=0;r<u.length;++r)if(i=u[r],i.text==t.text&&i.markedSpans==t.markedSpans&&n.display.scroller.clientWidth==i.width&&i.classes==t.textClass+"|"+t.bgClass+"|"+t.wrapClass)return i}function va(n,t){var i=de(n,t);i&&(i.text=i.measure=i.markedSpans=null)}function ge(n,t){var r=de(n,t);if(r)return r.measure;var u=ya(n,t),i=n.display.measureLineCache,f={text:t.text,width:n.display.scroller.clientWidth,markedSpans:t.markedSpans,measure:u,classes:t.textClass+"|"+t.bgClass+"|"+t.wrapClass};return i.length==16?i[++n.display.measureLineCachePos%16]=f:i.push(f),u}function ya(n,t){function a(n){var i=n.top-p.top,r=n.bottom-p.top,t,u,e;for(r>ut&&(r=ut),i<0&&(i=0),t=f.length-2;t>=0;t-=2)if((u=f[t],e=f[t+1],!(u>r)&&!(e<i))&&(u<=i&&e>=r||i<=u&&r>=e||Math.min(r,e)-Math.max(i,u)>=r-i>>1)){f[t]=Math.min(i,u);f[t+1]=Math.max(r,e);break}return t<0&&(t=f.length,f.push(i,r)),{left:n.left-p.left,right:n.right-p.left,top:t,bottom:null}}function w(n){n.bottom=f[n.top+1];n.top=f[n.top]}var v=n.display,b=ul(t.text.length),e=po(n,t,b,!0),tt,k,d,y,o,s,u,r;if(l&&!tr&&!n.options.lineWrapping&&e.childNodes.length>100){var it=document.createDocumentFragment(),rt=10,nt=e.childNodes.length;for(u=0,tt=Math.ceil(nt/rt);u<tt;++u){for(k=i("div",null,null,"display: inline-block"),d=0;d<rt&&nt;++d)k.appendChild(e.firstChild),--nt;it.appendChild(k)}e.appendChild(it)}ht(v.measure,e);var p=c(v.lineDiv),f=[],h=ul(t.text.length),ut=e.offsetHeight;for(g&&v.measure.first!=e&&ht(v.measure,e),u=0;u<b.length;++u)(r=b[u])&&(y=r,o=null,/\bCodeMirror-widget\b/.test(r.className)&&r.getClientRects&&(r.firstChild.nodeType==1&&(y=r.firstChild),s=y.getClientRects(),s.length>1&&(o=h[u]=a(s[0]),o.rightSide=a(s[s.length-1]))),o||(o=h[u]=a(c(y))),r.measureRight&&(o.right=c(r.measureRight).left),r.leftSide&&(o.leftSide=a(c(r.leftSide))));for(u=0;u<h.length;++u)(r=h[u])&&(w(r),r.leftSide&&w(r.leftSide),r.rightSide&&w(r.rightSide));return h}function pa(n,t){var e=!1,i,r,u,f,o;
8if(t.markedSpans)for(i=0;i<t.markedSpans;++i)r=t.markedSpans[i],r.collapsed&&(r.to==null||r.to==t.text.length)&&(e=!0);return(u=!e&&de(n,t),u)?ke(n,t,t.text.length,u.measure,"right").right:(f=po(n,t,null,!0),o=f.appendChild(su(n.display.measure)),ht(n.display.measure,f),c(o).right-c(n.display.lineDiv).left)}function ci(n){n.display.measureLineCache.length=n.display.measureLineCachePos=0;n.display.cachedCharWidth=n.display.cachedTextHeight=null;n.options.lineWrapping||(n.display.maxLineChanged=!0);n.display.lineNumChars=null}function uh(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fh(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function no(n,t,i,r){var f,e,u,o,s;if(t.widgets)for(f=0;f<t.widgets.length;++f)t.widgets[f].above&&(e=lf(t.widgets[f]),i.top+=e,i.bottom+=e);return r=="line"?i:(r||(r="local"),u=ru(n,t),r=="local"?u+=ih(n.display):u-=n.display.viewOffset,(r=="page"||r=="window")&&(o=c(n.display.lineSpace),u+=o.top+(r=="window"?0:fh()),s=o.left+(r=="window"?0:uh()),i.left+=s,i.right+=s),i.top+=u,i.bottom+=u,i)}function eh(n,t,i){var r,u,f,e;return i=="div"?t:(r=t.left,u=t.top,i=="page"?(r-=uh(),u-=fh()):i!="local"&&i||(f=c(n.display.sizer),r+=f.left,u+=f.top),e=c(n.display.lineSpace),{left:r-e.left,top:u-e.top})}function to(n,t,i,u,f){return u||(u=r(n.doc,t.line)),no(n,u,ke(n,u,t.ch,null,f),i)}function et(n,t,i,u,f){function s(t,r){var e=ke(n,u,t,f,r?"right":"left");return r?e.left=e.right:e.right=e.left,no(n,u,e,i)}function c(n,t){var i=e[t],r=i.level%2;return(n==is(i)&&t&&i.level<e[t-1].level?(i=e[--t],n=rs(i)-(i.level%2?0:1),r=!0):n==rs(i)&&t<e.length-1&&i.level<e[t+1].level&&(i=e[++t],n=is(i)-i.level%2,r=!1),r&&n==i.to&&n>i.from)?s(n-1):s(n,r)}var e,o,l,h;return(u=u||r(n.doc,t.line),f||(f=ge(n,u)),e=ot(u),o=t.ch,!e)?s(o):(l=us(e,o),h=c(o,l),er!=null&&(h.other=c(o,er)),h)}function gu(n,i,r,u){var f=new t(n,i);return f.xRel=u,r&&(f.outside=!0),f}function io(n,t,i){var u=n.doc,f,o;if(i+=n.display.viewOffset,i<0)return gu(u.first,0,!0,-1);if(f=iu(u,i),o=u.first+u.size-1,f>o)return gu(u.first+u.size-1,r(u,o).text.length,!0,1);for(t<0&&(t=0);;){var c=r(u,f),e=wa(n,c,f,t,i),s=cf(c),h=s&&s.find();if(s&&(e.ch>h.from.ch||e.ch==h.from.ch&&e.xRel>0))f=h.to.line;else return e}}function wa(n,i,r,u,f){function p(u){var f=et(n,t(r,u),"line",i,rt);return(h=!0,g>f.bottom)?f.left-nt:g<f.top?f.left+nt:(h=!1,f.left)}var g=f-ru(n,i),h=!1,nt=2*n.display.wrapper.clientWidth,rt=ge(n,i),tt=ot(i),w=i.text.length,e=df(i),o=gf(i),v=p(e),it=h,l=p(o),b=h,c,k,a,s,d,y;if(u>l)return gu(r,o,b,1);for(;;){if(tt?o==e||o==es(i,e,1):o-e<=1){for(c=u<v||u-v<=l-u?e:o,k=u-(c==e?v:l);se.test(i.text.charAt(c));)++c;return gu(r,c,c==e?it:b,k<0?-1:k?1:0)}if(a=Math.ceil(w/2),s=e+a,tt)for(s=e,d=0;d<a;++d)s=es(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 li(n){var r,t;if(n.cachedTextHeight!=null)return n.cachedTextHeight;if(fi==null){for(fi=i("pre"),r=0;r<49;++r)fi.appendChild(document.createTextNode("x")),fi.appendChild(i("br"));fi.appendChild(document.createTextNode("x"))}return ht(n.measure,fi),t=fi.offsetHeight/50,t>3&&(n.cachedTextHeight=t),bf(n.measure),t||1}function oh(n){var r,u,t;return n.cachedCharWidth!=null?n.cachedCharWidth:(r=i("span","x"),u=i("pre",[r]),ht(n.measure,u),t=r.offsetWidth,t>2&&(n.cachedCharWidth=t),t||10)}function ai(n){n.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++cl};vu++||(dt=[])}function vi(n){var t=n.curOp,h=n.doc,i=n.display,a,l,f,v,e,o,s,c,r;if(n.curOp=null,t.updateMaxLine&&he(n),i.maxLineChanged&&!n.options.lineWrapping&&i.maxLine&&(a=pa(n,i.maxLine),i.sizer.style.minWidth=Math.max(0,a+3+si)+"px",i.maxLineChanged=!1,l=Math.max(0,i.sizer.offsetLeft+i.sizer.offsetWidth-i.scroller.clientWidth),l<h.scrollLeft&&!t.updateScrollPos&&yi(n,Math.min(i.scroller.scrollLeft,l),!0)),t.updateScrollPos?f=t.updateScrollPos:t.selectionChanged&&i.scroller.clientHeight&&(e=et(n,h.sel.head),f=ff(n,e.left,e.top,e.left,e.bottom)),(t.changes.length||t.forceUpdate||f&&f.scrollTop!=null)&&(v=ku(n,t.changes,f&&f.scrollTop,t.forceUpdate),n.display.scroller.offsetHeight&&(n.doc.scrollTop=n.display.scroller.scrollTop)),!v&&t.selectionChanged&&be(n),t.updateScrollPos?(i.scroller.scrollTop=i.scrollbarV.scrollTop=h.scrollTop=f.scrollTop,i.scroller.scrollLeft=i.scrollbarH.scrollLeft=h.scrollLeft=f.scrollLeft,ve(n),t.scrollToPos&&gh(n,u(n.doc,t.scrollToPos),t.scrollToPosMargin)):f&&uv(n),t.selectionChanged&&du(n),n.state.focused&&t.updateInput&&pt(n,t.userSelChange),o=t.maybeHiddenMarkers,s=t.maybeUnhiddenMarkers,o)for(r=0;r<o.length;++r)o[r].lines.length||p(o[r],"hide");if(s)for(r=0;r<s.length;++r)s[r].lines.length&&p(s[r],"unhide");if(--vu||(c=dt,dt=null),t.textChanged&&p(n,"change",n,t.textChanged),t.cursorActivity&&p(n,"cursorActivity",n),c)for(r=0;r<c.length;++r)c[r]()}function f(n,t){return function(){var i=n||this,r=!i.curOp,u;r&&ai(i);try{u=t.apply(i,arguments)}finally{r&&vi(i)}return u}}function lr(n){return function(){var t=this.cm&&!this.cm.curOp,i;t&&ai(this.cm);try{i=n.apply(this,arguments)}finally{t&&vi(this.cm)}return i}}function ro(n,t){var i=!n.curOp,r;i&&ai(n);try{r=t()}finally{i&&vi(n)}return r}function a(n,t,i,r){t==null&&(t=n.doc.first);i==null&&(i=n.doc.first+n.doc.size);n.curOp.changes.push({from:t,to:i,diff:r})}function nf(n){n.display.pollingFast||n.display.poll.set(n.options.pollInterval,function(){uo(n);n.state.focused&&nf(n)})}function ar(n){function t(){var r=uo(n);r||i?(n.display.pollingFast=!1,nf(n)):(i=!0,n.display.poll.set(60,t))}var i=!1;n.display.pollingFast=!0;n.display.poll.set(20,t)}function uo(n){var c=n.display.input,o=n.display.prevInput,y=n.doc,h=y.sel,i,a,u,p,e,f,w,v;if(!n.state.focused||ay(c)||vr(n)||n.state.disableInput||(i=c.value,i==o&&s(h.from,h.to)))return!1;if(l&&!g&&n.display.inputHasSelection===i)return pt(n,!0),!1;for(a=!n.curOp,a&&ai(n),h.shift=!1,u=0,p=Math.min(o.length,i.length);u<p&&o.charCodeAt(u)==i.charCodeAt(u);)++u;return e=h.from,f=h.to,u<o.length?e=t(e.line,e.ch-(o.length-u)):n.state.overwrite&&s(e,f)&&!n.state.pasteIncoming&&(f=t(f.line,Math.min(r(y,f.line).text.length,f.ch+(i.length-u)))),w=n.curOp.updateInput,v={from:e,to:f,text:gt(i.slice(u)),origin:n.state.pasteIncoming?"paste":"+input"},pi(n.doc,v,"end"),n.curOp.updateInput=w,k(n,"inputRead",n,v),i.length>1e3||i.indexOf("\n")>-1?c.value=n.display.prevInput="":n.display.prevInput=i,a&&vi(n),n.state.pasteIncoming=!1,!0}function pt(n,t){var r,f,i=n.doc,u;s(i.sel.from,i.sel.to)?t&&(n.display.prevInput=n.display.input.value="",l&&!g&&(n.display.inputHasSelection=null)):(n.display.prevInput="",r=dl&&(i.sel.to.line-i.sel.from.line>100||(f=n.getSelection()).length>1e3),u=r?"-":f||n.getSelection(),n.display.input.value=u,n.state.focused&&il(n.display.input),l&&!g&&(n.display.inputHasSelection=u));n.display.inaccurateSelection=r}function it(n){n.options.readOnly=="nocursor"||hl&&document.activeElement==n.display.input||n.display.input.focus()}function vr(n){return n.options.readOnly||n.doc.cantEdit}function ba(n){function u(){n.state.focused&&setTimeout(ut(it,n),0)}function o(){i==null&&(i=setTimeout(function(){i=null;
8t.cachedCharWidth=t.cachedTextHeight=pu=null;ci(n);ro(n,ut(a,n))},100))}function s(){for(var n=t.wrapper.parentNode;n&&n!=document.body;n=n.parentNode);n?setTimeout(s,5e3):at(window,"resize",o)}function h(t){st(n,t)||n.options.onDragEvent&&n.options.onDragEvent(n,uu(t))||fu(t)}function c(){t.inaccurateSelection&&(t.prevInput="",t.inaccurateSelection=!1,t.input.value=n.getSelection(),il(t.input))}var t=n.display,i;e(t.scroller,"mousedown",f(n,ka));l?e(t.scroller,"dblclick",f(n,function(t){var i,u;st(n,t)||(i=yr(n,t),!i||sh(n,t)||ni(n.display,t))||(v(t),u=co(r(n.doc,i.line).text,i),y(n.doc,u.from,u.to))})):e(t.scroller,"dblclick",function(t){st(n,t)||v(t)});e(t.lineSpace,"selectstart",function(n){ni(t,n)||v(n)});ws||e(t.scroller,"contextmenu",function(t){vh(n,t)});e(t.scroller,"scroll",function(){t.scroller.clientHeight&&(pr(n,t.scroller.scrollTop),yi(n,t.scroller.scrollLeft,!0),p(n,"scroll",n))});e(t.scrollbarV,"scroll",function(){t.scroller.clientHeight&&pr(n,t.scrollbarV.scrollTop)});e(t.scrollbarH,"scroll",function(){t.scroller.clientHeight&&yi(n,t.scrollbarH.scrollLeft)});e(t.scroller,"mousewheel",function(t){hh(n,t)});e(t.scroller,"DOMMouseScroll",function(t){hh(n,t)});e(t.scrollbarH,"mousedown",u);e(t.scrollbarV,"mousedown",u);e(t.wrapper,"scroll",function(){t.wrapper.scrollTop=t.wrapper.scrollLeft=0});e(window,"resize",o);setTimeout(s,5e3);e(t.input,"keyup",f(n,function(t){st(n,t)||n.options.onKeyEvent&&n.options.onKeyEvent(n,uu(t))||t.keyCode==16&&(n.doc.sel.shift=!1)}));e(t.input,"input",ut(ar,n));e(t.input,"keydown",f(n,ah));e(t.input,"keypress",f(n,tv));e(t.input,"focus",ut(ti,n));e(t.input,"blur",ut(fo,n));n.options.dragDrop&&(e(t.scroller,"dragstart",function(t){ga(n,t)}),e(t.scroller,"dragenter",h),e(t.scroller,"dragover",h),e(t.scroller,"drop",f(n,da)));e(t.scroller,"paste",function(i){ni(t,i)||(it(n),ar(n))});e(t.input,"paste",function(){n.state.pasteIncoming=!0;ar(n)});e(t.input,"cut",c);e(t.input,"copy",c);ss&&e(t.sizer,"mouseup",function(){document.activeElement==t.input&&t.input.blur();it(n)})}function ni(n,t){for(var i=ns(t);i!=n.wrapper;i=i.parentNode)if(!i||i.ignoreEvents||i.parentNode==n.sizer&&i!=n.mover)return!0}function yr(n,t,i){var r=n.display,u,e,o,f;if(!i&&(u=ns(t),u==r.scrollbarH||u==r.scrollbarH.firstChild||u==r.scrollbarV||u==r.scrollbarV.firstChild||u==r.scrollbarFiller||u==r.gutterFiller))return null;f=c(r.lineSpace);try{e=t.clientX;o=t.clientY}catch(t){return null}return io(n,e-f.left,o-f.top)}function ka(n){function pt(n){if(!s(yt,n)){if(yt=n,w=="single"){y(i.doc,u(p,o),n);return}if(d=u(p,d),rt=u(p,rt),w=="double"){var f=co(r(p,n.line).text,n);h(n,d)?y(i.doc,f.from,rt):y(i.doc,d,f.to)}else w=="triple"&&(h(n,d)?y(i.doc,rt,u(p,t(n.line,0))):y(i.doc,d,u(p,t(n.line+1,0))))}}function ft(n){var e=++tt,t=yr(i,n,!0),r,u;t&&(s(t,ot)?(u=n.clientY<ht.top?-20:n.clientY>ht.bottom?20:0,u&&setTimeout(f(i,function(){tt==e&&(a.scroller.scrollTop+=u,ft(n))}),50)):(i.state.focused||ti(i),ot=t,pt(t),r=ae(a,p),(t.line>=r.to||t.line<r.from)&&setTimeout(f(i,function(){tt==e&&ft(n)}),150)))}function vt(n){tt=Infinity;v(n);it(i);at(document,"mousemove",ct);at(document,"mouseup",lt)}var o,g,w,et,ot,k,ht,tt,ct,lt;if(!st(this,n)){var i=this,a=i.display,p=i.doc,b=p.sel;if(b.shift=n.shiftKey,ni(a,n)){nt||(a.scroller.draggable=!1,setTimeout(function(){a.scroller.draggable=!0},100));return}if(!sh(i,n)){o=yr(i,n);switch(nl(n)){case 3:ws&&vh.call(i,i,n);return;case 2:o&&y(i.doc,o);setTimeout(ut(it,i),20);v(n);return}if(!o){ns(n)==a.scroller&&v(n);return}if(i.state.focused||ti(i),g=+new Date,w="single",te&&te.time>g-400&&s(te.pos,o)?(w="triple",v(n),setTimeout(ut(it,i),20),ev(i,o.line)):ne&&ne.time>g-400&&s(ne.pos,o)?(w="double",te={time:g,pos:o},v(n),et=co(r(p,o.line).text,o),y(i.doc,et.from,et.to)):ne={time:g,pos:o},ot=o,i.options.dragDrop&&pl&&!vr(i)&&!s(b.from,b.to)&&!h(o,b.from)&&!h(b.to,o)&&w=="single"){k=f(i,function(t){nt&&(a.scroller.draggable=!1);i.state.draggingText=!1;at(document,"mouseup",k);at(a.scroller,"drop",k);Math.abs(n.clientX-t.clientX)+Math.abs(n.clientY-t.clientY)<10&&(v(t),y(i.doc,o),it(i))});nt&&(a.scroller.draggable=!0);i.state.draggingText=k;a.scroller.dragDrop&&a.scroller.dragDrop();e(document,"mouseup",k);e(a.scroller,"drop",k);return}v(n);w=="single"&&y(i.doc,u(p,o));var d=b.from,rt=b.to,yt=o;ht=c(a.wrapper);tt=0;ct=f(i,function(n){l||nl(n)?ft(n):vt(n)});lt=f(i,vt);e(document,"mousemove",ct);e(document,"mouseup",lt)}}}function sh(n,t){var r=n.display,f,u,e,i,o,s,h;try{f=t.clientX;u=t.clientY}catch(t){return!1}if(f>=Math.floor(c(r.gutters).right))return!1;if((v(t),!vt(n,"gutterClick"))||(e=c(r.lineDiv),u>e.bottom))return!0;for(u-=e.top-r.viewOffset,i=0;i<n.options.gutters.length;++i)if(o=r.gutters.childNodes[i],o&&c(o).right>=f){s=iu(n.doc,u);h=n.options.gutters[i];k(n,"gutterClick",n,s,h,t);break}return!0}function da(n){var t=this,i,f,e,r,s,c;if(!st(t,n)&&!ni(t.display,n)&&(!t.options.onDragEvent||!t.options.onDragEvent(t,uu(n)))&&(v(n),l&&(hs=+new Date),i=yr(t,n,!0),f=n.dataTransfer.files,i&&!vr(t)))if(f&&f.length&&window.FileReader&&window.File){var o=f.length,r=Array(o),a=0,y=function(n,f){var e=new FileReader;e.onload=function(){r[f]=e.result;++a==o&&(i=u(t.doc,i),pi(t.doc,{from:i,to:i,text:gt(r.join("\n")),origin:"paste"},"around"))};e.readAsText(n)};for(e=0;e<o;++e)y(f[e],e)}else{if(t.state.draggingText&&!(h(i,t.doc.sel.from)||h(t.doc.sel.to,i))){t.state.draggingText(n);setTimeout(ut(it,t),20);return}try{r=n.dataTransfer.getData("Text");r&&(s=t.doc.sel.from,c=t.doc.sel.to,bt(t.doc,i,i),t.state.draggingText&&wt(t.doc,"",s,c,"paste"),t.replaceSelection(r,null,"paste"),it(t),ti(t))}catch(n){}}}function ga(n,t){var u,r;if(l&&(!n.state.draggingText||+new Date-hs<100)){fu(t);return}st(n,t)||ni(n.display,t)||(u=n.getSelection(),t.dataTransfer.setData("Text",u),t.dataTransfer.setDragImage&&!os&&(r=i("img",null,null,"position: fixed; left: 0; top: 0;"),ft&&(r.width=r.height=1,n.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ft&&r.parentNode.removeChild(r)))}function pr(n,t){Math.abs(n.doc.scrollTop-t)<2||(n.doc.scrollTop=t,nr||ku(n,[],t),n.display.scroller.scrollTop!=t&&(n.display.scroller.scrollTop=t),n.display.scrollbarV.scrollTop!=t&&(n.display.scrollbarV.scrollTop=t),nr&&ku(n,[]),hr(n,100))}function yi(n,t,i){(i?t==n.doc.scrollLeft:Math.abs(n.doc.scrollLeft-t)<2)||(t=Math.min(t,n.display.scroller.scrollWidth-n.display.scroller.clientWidth),n.doc.scrollLeft=t,ve(n),n.display.scroller.scrollLeft!=t&&(n.display.scroller.scrollLeft=t),n.display.scrollbarH.scrollLeft!=t&&(n.display.scrollbarH.scrollLeft=t))}function hh(n,t){var f=t.wheelDeltaX,u=t.wheelDeltaY,i,r,e;if(f==null&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(f=t.detail),u==null&&t.detail&&t.axis==t.VERTICAL_AXIS?u=t.detail
8:u==null&&(u=t.wheelDelta),i=n.display,r=i.scroller,f&&r.scrollWidth>r.clientWidth||u&&r.scrollHeight>r.clientHeight){if(u&&ir&&nt)for(e=t.target;e!=r;e=e.parentNode)if(e.lineObj){n.display.currentWheelTarget=e;break}if(f&&!nr&&!ft&&tt!=null){u&&pr(n,Math.max(0,Math.min(r.scrollTop+u*tt,r.scrollHeight-r.clientHeight)));yi(n,Math.max(0,Math.min(r.scrollLeft+f*tt,r.scrollWidth-r.clientWidth)));v(t);i.wheelStartX=null;return}if(u&&tt!=null){var s=u*tt,o=n.doc.scrollTop,h=o+i.wrapper.clientHeight;s<0?o=Math.max(0,o+s-50):h=Math.min(n.doc.height,h+s+50);ku(n,[],{top:o,bottom:h})}cu<20&&(i.wheelStartX==null?(i.wheelStartX=r.scrollLeft,i.wheelStartY=r.scrollTop,i.wheelDX=f,i.wheelDY=u,setTimeout(function(){if(i.wheelStartX!=null){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)&&(tt=(tt*cu+u)/(cu+1),++cu)}},200)):(i.wheelDX+=f,i.wheelDY+=u))}}function tf(n,t,i){if(typeof t=="string"&&(t=ee[t],!t))return!1;n.display.pollingFast&&uo(n)&&(n.display.pollingFast=!1);var r=n.doc,f=r.sel.shift,u=!1;try{vr(n)&&(n.state.suppressEdits=!0);i&&(r.sel.shift=!1);u=t(n)!=ys}finally{r.sel.shift=f;n.state.suppressEdits=!1}return u}function ch(n){var t=n.state.keyMaps.slice(0);return n.options.extraKeys&&t.push(n.options.extraKeys),t.push(n.options.keyMap),t}function lh(n,t){var e=lo(n.options.keyMap),r=e.auto,i,u,f;return(clearTimeout(ll),r&&!ic(t)&&(ll=setTimeout(function(){lo(n.options.keyMap)==e&&(n.options.keyMap=r.call?r.call(null,n):r,ds(n))},50)),i=rc(t,!0),u=!1,!i)?!1:(f=ch(n),u=t.shiftKey?br("Shift-"+i,f,function(t){return tf(n,t,!0)})||br(i,f,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion)return tf(n,t)}):br(i,f,function(t){return tf(n,t)}),u&&(v(t),du(n),g&&(t.oldKeyCode=t.keyCode,t.keyCode=0),k(n,"keyHandled",n,i,t)),u)}function nv(n,t,i){var r=br("'"+i+"'",ch(n),function(t){return tf(n,t,!0)});return r&&(v(t),du(n),k(n,"keyHandled",n,"'"+i+"'",t)),r}function ah(n){var t=this,i,r;(t.state.focused||ti(t),l&&n.keyCode==27&&(n.returnValue=!1),st(t,n)||t.options.onKeyEvent&&t.options.onKeyEvent(t,uu(n)))||(i=n.keyCode,t.doc.sel.shift=i==16||n.shiftKey,r=lh(t,n),ft&&(ie=r?i:null,r||i!=88||dl||!(ir?n.metaKey:n.ctrlKey)||t.replaceSelection("")))}function tv(n){var t=this,i,r,u;if(!st(t,n)&&(!t.options.onKeyEvent||!t.options.onKeyEvent(t,uu(n)))){if(i=n.keyCode,r=n.charCode,ft&&i==ie){ie=null;v(n);return}(ft&&(!n.which||n.which<10)||ss)&&lh(t,n)||(u=String.fromCharCode(r==null?i:r),this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!vr(this)&&this.doc.mode.electricChars.indexOf(u)>-1&&setTimeout(f(t,function(){of(t,t.doc.sel.to.line,"smart")}),75),nv(t,n,u))||(l&&!g&&(t.display.inputHasSelection=null),ar(t))}}function ti(n){n.options.readOnly!="nocursor"&&(n.state.focused||(p(n,"focus",n),n.state.focused=!0,n.display.wrapper.className.search(/\bCodeMirror-focused\b/)==-1&&(n.display.wrapper.className+=" CodeMirror-focused"),pt(n,!0)),nf(n),du(n))}function fo(n){n.state.focused&&(p(n,"blur",n),n.state.focused=!1,n.display.wrapper.className=n.display.wrapper.className.replace(" CodeMirror-focused",""));clearInterval(n.display.blinker);setTimeout(function(){n.state.focused||(n.doc.sel.shift=!1)},150)}function vh(n,t){function c(){if(i.input.selectionStart!=null){var n=i.input.value=" "+(s(r.from,r.to)?"":i.input.value);i.prevInput=" ";i.input.selectionStart=1;i.input.selectionEnd=n.length}}function a(){if(i.inputDiv.style.position="relative",i.input.style.cssText=y,g&&(i.scrollbarV.scrollTop=i.scroller.scrollTop=v),nf(n),i.input.selectionStart!=null){(!l||g)&&c();clearTimeout(cs);var r=0,t=function(){i.prevInput==" "&&i.input.selectionStart==0?f(n,ee.selectAll)(n):r++<10?cs=setTimeout(t,500):pt(n)};cs=setTimeout(t,200)}}var i,r,u,v,y,o;st(n,t,"contextmenu")||(i=n.display,r=n.doc.sel,ni(i,t))||(u=yr(n,t),v=i.scroller.scrollTop,u&&!ft)&&((s(r.from,r.to)||h(u,r.from)||!h(u,r.to))&&f(n,bt)(n.doc,u,u),y=i.input.style.cssText,i.inputDiv.style.position="absolute",i.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: white; outline: none;border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",it(n),pt(n,!0),s(r.from,r.to)&&(i.input.value=i.prevInput=" "),l&&!g&&c(),ws?(fu(t),o=function(){at(window,"mouseup",o);setTimeout(a,20)},e(window,"mouseup",o)):setTimeout(a,50))}function yh(n,i,f){var e,s,o,c;return h(i.from,f)?(e=i.text.length-1-(i.to.line-i.from.line),f.line>i.to.line+e)?(s=f.line-e,o=n.first+n.size-1,s>o)?t(o,r(n,o).text.length):rf(f,r(n,s).text.length):f.line==i.to.line+e?rf(f,b(i.text).length+(i.text.length==1?i.from.ch:0)+r(n,i.to.line).text.length-i.to.ch):(c=f.line-i.from.line,rf(f,i.text[c].length+(c?0:i.from.ch))):u(n,f)}function eo(n,i,r){var u,f;
8return r&&typeof r=="object"?{anchor:yh(n,i,r.anchor),head:yh(n,i,r.head)}:r=="start"?{anchor:i.from,head:i.from}:(u=re(i),r=="around")?{anchor:i.from,head:u}:r=="end"?{anchor:u,head:u}:(f=function(n){if(h(n,i.from))return n;if(!h(i.to,n))return u;var f=n.line+i.text.length-(i.to.line-i.from.line)-1,r=n.ch;return n.line==i.to.line&&(r+=u.ch-i.to.ch),t(f,r)},{anchor:f(n.sel.anchor),head:f(n.sel.head)})}function ph(n,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return(i&&(r.update=function(t,i,r,f){t&&(this.from=u(n,t));i&&(this.to=u(n,i));r&&(this.text=r);f!==undefined&&(this.origin=f)}),p(n,"beforeChange",n,r),n.cm&&p(n.cm,"beforeChange",n.cm,r),r.canceled)?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function pi(n,t,i,r){var u,e;if(n.cm){if(!n.cm.curOp)return f(n.cm,pi)(n,t,i,r);if(n.cm.state.suppressEdits)return}if(!vt(n,"beforeChange")&&(!n.cm||!vt(n.cm,"beforeChange"))||(t=ph(n,t,!0),t))if(u=kl&&!r&&av(n,t.from,t.to),u){for(e=u.length-1;e>=1;--e)oo(n,{from:u[e].from,to:u[e].to,text:[""]});u.length&&oo(n,{from:u[0].from,to:u[0].to,text:t.text},i)}else oo(n,t,i)}function oo(n,t,i){var u=eo(n,t,i),r;bc(n,t,u,n.cm?n.cm.curOp.id:NaN);wr(n,t,u,ao(n,t));r=[];ki(n,function(n,i){i||yt(r,n.history)!=-1||(dc(n.history,t),r.push(n.history));wr(n,t,null,ao(n,t))})}function wh(n,t){var r,i,e,s,f,u,h,o;if((!n.cm||!n.cm.state.suppressEdits)&&(r=n.history,i=(t=="undo"?r.done:r.undone).pop(),i))for(e={changes:[],anchorBefore:i.anchorAfter,headBefore:i.headAfter,anchorAfter:i.anchorBefore,headAfter:i.headBefore,generation:r.generation},(t=="undo"?r.undone:r.done).push(e),r.generation=i.generation||++r.maxGeneration,s=vt(n,"beforeChange")||n.cm&&vt(n.cm,"beforeChange"),f=i.changes.length-1;f>=0;--f){if(u=i.changes[f],u.origin=t,s&&!ph(n,u,!1)){(t=="undo"?r.done:r.undone).length=0;return}e.changes.push(go(n,u));h=f?eo(n,u,null):{anchor:i.anchorBefore,head:i.headBefore};wr(n,u,h,uc(n,u));o=[];ki(n,function(n,t){t||yt(o,n.history)!=-1||(dc(n.history,u),o.push(n.history));wr(n,u,null,uc(n,u))})}}function bh(n,i){function r(n){return t(n.line+i,n.ch)}n.first+=i;n.cm&&a(n.cm,n.first,n.first,i);n.sel.head=r(n.sel.head);n.sel.anchor=r(n.sel.anchor);n.sel.from=r(n.sel.from);n.sel.to=r(n.sel.to)}function wr(n,i,u,e){var s,o;if(n.cm&&!n.cm.curOp)return f(n.cm,wr)(n,i,u,e);if(i.to.line<n.first){bh(n,i.text.length-1-(i.to.line-i.from.line));return}i.from.line>n.lastLine()||(i.from.line<n.first&&(s=i.text.length-1-(n.first-i.from.line),bh(n,s),i={from:t(n.first,0),to:t(i.to.line+s,i.to.ch),text:[b(i.text)],origin:i.origin}),o=n.lastLine(),i.to.line>o&&(i={from:i.from,to:t(o,r(n,o).text.length),text:[i.text[0]],origin:i.origin}),i.removed=bo(n,i.from,i.to),u||(u=eo(n,i,null)),n.cm?iv(n.cm,i,e,u):wo(n,i,e,u))}function iv(n,t,i,u){var f=n.doc,o=n.display,e=t.from,c=t.to,l=!1,v=e.line,p,y,s;if(n.options.lineWrapping||(v=d(lt(f,r(f,e.line))),f.iter(v,c.line+1,function(n){if(n==o.maxLine)return l=!0,!0})),h(f.sel.head,t.from)||h(t.to,f.sel.head)||(n.curOp.cursorActivity=!0),wo(f,t,i,u,bs(n)),n.options.lineWrapping||(f.iter(v,e.line+t.text.length,function(n){var t=bu(f,n);t>o.maxLineLength&&(o.maxLine=n,o.maxLineLength=t,o.maxLineChanged=!0,l=!1)}),l&&(n.curOp.updateMaxLine=!0)),f.frontier=Math.min(f.frontier,e.line),hr(n,400),p=t.text.length-(c.line-e.line)-1,a(n,e.line,c.line+1,p),vt(n,"change"))if(y={from:e,to:c,text:t.text,removed:t.removed,origin:t.origin},n.curOp.textChanged){for(s=n.curOp.textChanged;s.next;s=s.next);s.next=y}else n.curOp.textChanged=y}function wt(n,t,i,r,u){if(r||(r=i),h(r,i)){var f=r;r=i;i=f}typeof t=="string"&&(t=gt(t));pi(n,{from:i,to:r,text:t,origin:u},null)}function t(n,i){if(!(this instanceof t))return new t(n,i);this.line=n;this.ch=i}function s(n,t){return n.line==t.line&&n.ch==t.ch}function h(n,t){return n.line<t.line||n.line==t.line&&n.ch<t.ch}function ii(n){return t(n.line,n.ch)}function kh(n,t){return Math.max(n.first,Math.min(t,n.first+n.size-1))}function u(n,i){if(i.line<n.first)return t(n.first,0);var u=n.first+n.size-1;return i.line>u?t(u,r(n,u).text.length):rf(i,r(n,i.line).text.length)}function rf(n,i){var r=n.ch;return r==null||r>i?t(n.line,i):r<0?t(n.line,0):n}function wi(n,t){return t>=n.first&&t<n.first+n.size}function y(n,t,i,r){var u,f;n.sel.shift||n.sel.extend?(u=n.sel.anchor,i&&(f=h(t,u),f!=h(i,u)?(u=t,t=i):f!=h(t,i)&&(t=i)),bt(n,u,t,r)):bt(n,t,i||t,r);n.cm&&(n.cm.curOp.userSelChange=!0)}function rv(n,t,i){var r={anchor:t,head:i};return p(n,"beforeSelectionChange",n,r),n.cm&&p(n.cm,"beforeSelectionChange",n.cm,r),r.anchor=u(n,r.anchor),r.head=u(n,r.head),r}function bt(n,t,i,r,u){var e,f,o;((!u&&vt(n,"beforeSelectionChange")||n.cm&&vt(n.cm,"beforeSelectionChange"))&&(e=rv(n,t,i),i=e.head,t=e.anchor),f=n.sel,f.goalColumn=null,(u||!s(t,f.anchor))&&(t=uf(n,t,r,u!="push")),(u||!s(i,f.head))&&(i=uf(n,i,r,u!="push")),s(f.anchor,t)&&s(f.head,i))||(f.anchor=t,f.head=i,o=h(i,t),f.from=o?i:t,f.to=o?t:i,n.cm&&(n.cm.curOp.updateInput=n.cm.curOp.selectionChanged=n.cm.curOp.cursorActivity=!0),k(n,"cursorActivity",n))}function dh(n){bt(n.doc,n.doc.sel.from,n.doc.sel.to,null,"push")}function uf(n,i,f,e){var w=!1,h=i,y=f||1,a,v,c,l,o;n.cantEdit=!1;n:for(;;){if(a=r(n,h.line),a.markedSpans)for(v=0;v<a.markedSpans.length;++v)if(c=a.markedSpans[v],l=c.marker,(c.from==null||(l.inclusiveLeft?c.from<=h.ch:c.from<h.ch))&&(c.to==null||(l.inclusiveRight?c.to>=h.ch:c.to>h.ch))){if(e&&(p(l,"beforeCursorEnter"),l.explicitlyCleared))if(a.markedSpans){--v;continue}else break;if(!l.atomic)continue;if(o=l.find()[y<0?"from":"to"],s(o,h)&&(o.ch+=y,o.ch<0?o=o.line>n.first?u(n,t(o.line-1)):null:o.ch>a.text.length&&(o=o.line<n.first+n.size-1?t(o.line+1,0):null),!o)){if(w)return e?(n.cantEdit=!0,t(n.first,0)):uf(n,i,f,!0);w=!0;o=i;y=-y}h=o;continue n}return h}}function uv(n){var i=gh(n,n.doc.sel.head,n.options.cursorScrollMargin),u;if(n.state.focused){var t=n.display,f=c(t.sizer),r=null;i.top+f.top<0?r=!0:i.bottom+f.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1);r==null||cy||(u=t.cursor.style.display=="none",u&&(t.cursor.style.display="",t.curs
8or.style.left=i.left+"px",t.cursor.style.top=i.top-t.viewOffset+"px"),t.cursor.scrollIntoView(r),u&&(t.cursor.style.display="none"))}}function gh(n,t,i){for(i==null&&(i=0);;){var f=!1,r=et(n,t),u=ff(n,r.left,r.top-i,r.left,r.bottom+i),e=n.doc.scrollTop,o=n.doc.scrollLeft;if(u.scrollTop!=null&&(pr(n,u.scrollTop),Math.abs(n.doc.scrollTop-e)>1&&(f=!0)),u.scrollLeft!=null&&(yi(n,u.scrollLeft),Math.abs(n.doc.scrollLeft-o)>1&&(f=!0)),!f)return r}}function fv(n,t,i,r,u){var f=ff(n,t,i,r,u);f.scrollTop!=null&&pr(n,f.scrollTop);f.scrollLeft!=null&&yi(n,f.scrollLeft)}function ff(n,t,i,r,u){var f=n.display,v=li(n.display),s,h,c,o,l;i<0&&(i=0);var y=f.scroller.clientHeight-si,a=f.scroller.scrollTop,e={},p=n.doc.height+rh(f),w=i<v,b=u>p-v;return i<a?e.scrollTop=w?0:i:u>a+y&&(s=Math.min(i,(b?p:u)-y),s!=a&&(e.scrollTop=s)),h=f.scroller.clientWidth-si,c=f.scroller.scrollLeft,t+=f.gutters.offsetWidth,r+=f.gutters.offsetWidth,o=f.gutters.offsetWidth,l=t<o+10,t<c+o||l?(l&&(t=0),e.scrollLeft=Math.max(0,t-10-o)):r>h+c-3&&(e.scrollLeft=r+10-h),e}function ef(n,t,i){n.curOp.updateScrollPos={scrollLeft:t==null?n.doc.scrollLeft:t,scrollTop:i==null?n.doc.scrollTop:i}}function so(n,t,i){var r=n.curOp.updateScrollPos||(n.curOp.updateScrollPos={scrollLeft:n.doc.scrollLeft,scrollTop:n.doc.scrollTop}),u=n.display.scroller;r.scrollTop=Math.max(0,Math.min(u.scrollHeight-u.clientHeight,r.scrollTop+i));r.scrollLeft=Math.max(0,Math.min(u.scrollWidth-u.clientWidth,r.scrollLeft+t))}function of(n,i,u,f){var l=n.doc,p,o,h,a;u==null&&(u="add");u=="smart"&&(n.doc.mode.indent?p=cr(n,i):u="prev");var c=n.options.tabSize,s=r(l,i),v=gi(s.text,null,c),y=s.text.match(/^\s*/)[0],e;if(u=="smart"&&(e=n.doc.mode.indent(p,s.text.slice(y.length),s.text),e==ys)){if(!f)return;u="prev"}if(u=="prev"?e=i>l.first?gi(r(l,i-1).text,null,c):0:u=="add"?e=v+n.options.indentUnit:u=="subtract"?e=v-n.options.indentUnit:typeof u=="number"&&(e=v+u),e=Math.max(0,e),o="",h=0,n.options.indentWithTabs)for(a=Math.floor(e/c);a;--a)h+=c,o+="\t";h<e&&(o+=tl(e-h));o!=y&&wt(n.doc,o,t(i,0),t(i,y.length),"+input");s.stateAfter=null}function sf(n,t,i){var u=t,f=t,e=n.doc;if(typeof t=="number"?f=r(e,kh(e,t)):u=d(t),u==null)return null;if(i(f,u))a(n,u,u+1);else return null;return f}function ho(n,i,u,f,e){function k(){var t=c+u;return t<n.first||t>=n.first+n.size?y=!1:(c=t,h=r(n,t))}function o(n){var t=(e?es:sl)(h,s,u,!0);if(t==null)if(!n&&k())s=e?(u<0?gf:df)(h):u<0?h.text.length:0;else return y=!1;else s=t;return!0}var c=i.line,s=i.ch,d=u,h=r(n,c),y=!0,l,b,a,p,v,w;if(f=="char")o();else if(f=="column")o(!0);else if(f=="word"||f=="group")for(l=null,b=f=="group",a=!0;;a=!1){if(u<0&&!o(!a))break;if(p=h.text.charAt(s)||"\n",v=eu(p)?"w":b?/\s/.test(p)?null:"p":null,l&&l!=v){u<0&&(u=1,o());break}if(v&&(l=v),u>0&&!o(!a))break}return w=uf(n,t(c,s),d,!0),y||(w.hitSide=!0),w}function nc(n,t,i,r){var o=n.doc,s=t.left,u,e,f;for(r=="page"?(e=Math.min(n.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=t.top+i*(e-(i<0?1.5:.5)*li(n.display))):r=="line"&&(u=i>0?t.bottom+3:t.top-3);;){if(f=io(n,s,u),!f.outside)break;if(i<0?u<=0:u>=o.height){f.hitSide=!0;break}u+=i*5}return f}function co(n,i){var r=i.ch,u=i.ch,f,e;if(n){for((i.xRel<0||u==n.length)&&r?--r:++u,f=n.charAt(r),e=eu(f)?eu:/\s/.test(f)?function(n){return/\s/.test(n)}:function(n){return!/\s/.test(n)&&!eu(n)};r>0&&e(n.charAt(r-1));)--r;while(u<n.length&&e(n.charAt(u)))++u}return{from:t(i.line,r),to:t(i.line,u)}}function ev(n,i){y(n.doc,t(i,0),u(n.doc,t(i+1,0)))}function o(t,i,r,u){n.defaults[t]=i;r&&(ei[t]=u?function(n,t,i){i!=ls&&r(n,t,i)}:r)}function bi(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}function tc(n,t,i){return n.startState?n.startState(t,i):!0}function lo(n){return typeof n=="string"?ct[n]:n}function br(n,t,i){function r(t){var f,u,e,s,o;if(t=lo(t),f=t[n],f===!1)return"stop";if(f!=null&&i(f))return!0;if(t.nofallthrough)return"stop";if(u=t.fallthrough,u==null)return!1;if(Object.prototype.toString.call(u)!="[object Array]")return r(u);for(e=0,s=u.length;e<s;++e)if(o=r(u[e]),o)return o;return!1}for(var u,f=0;f<t.length;++f)if(u=r(t[f]),u)return u!="stop"}function ic(n){var t=hi[n.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function rc(n,t){if(ft&&n.keyCode==34&&n.char)return!1;var i=hi[n.keyCode];
8return i==null||n.altGraphKey?!1:(n.altKey&&(i="Alt-"+i),(bl?n.metaKey:n.ctrlKey)&&(i="Ctrl-"+i),(bl?n.ctrlKey:n.metaKey)&&(i="Cmd-"+i),!t&&n.shiftKey&&(i="Shift-"+i),i)}function kr(n,t){this.pos=this.start=0;this.string=n;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0}function kt(n,t){this.lines=[];this.type=t;this.doc=n}function dr(n,t,r,u,o){var s;if(u&&u.shared)return ov(n,t,r,u,o);if(n.cm&&!n.cm.curOp)return f(n.cm,dr)(n,t,r,u,o);if(s=new kt(n,o),o=="range"&&!h(t,r))return s;u&&wf(u,s);s.replacedWith&&(s.collapsed=!0,s.replacedWith=i("span",[s.replacedWith],"CodeMirror-widget"),u.handleMouseEvents||(s.replacedWith.ignoreEvents=!0));s.collapsed&&(wu=!0);s.addToHistory&&bc(n,{from:t,to:r,origin:"markText"},{head:n.sel.head,anchor:n.sel.anchor},NaN);var l=t.line,v=0,y,p,c=n.cm,w;if(n.iter(l,r.line+1,function(i){c&&s.collapsed&&!c.options.lineWrapping&&lt(n,i)==c.display.maxLine&&(w=!0);var u={from:null,to:null,marker:s};v+=i.text.length;l==t.line&&(u.from=t.ch,v-=t.ch);l==r.line&&(u.to=r.ch,v-=i.text.length-r.ch);s.collapsed&&(l==r.line&&(p=hf(i,r.ch)),l==t.line?y=hf(i,t.ch):rt(i,0));hv(i,u);++l}),s.collapsed&&n.iter(t.line,r.line+1,function(t){ri(n,t)&&rt(t,0)}),s.clearOnEnter&&e(s,"beforeCursorEnter",function(){s.clear()}),s.readOnly&&(kl=!0,(n.history.done.length||n.history.undone.length)&&n.clearHistory()),s.collapsed){if(y!=p)throw new Error("Inserting collapsed marker overlapping an existing one");s.size=v;s.atomic=!0}return c&&(w&&(c.curOp.updateMaxLine=!0),(s.className||s.title||s.startStyle||s.endStyle||s.collapsed)&&a(c,t.line,r.line+1),s.atomic&&dh(c)),s}function gr(n,t){this.markers=n;this.primary=t;for(var i=0,r=this;i<n.length;++i)n[i].parent=this,e(n[i],"clear",function(){r.clear()})}function ov(n,t,i,r,f){r=wf(r);r.shared=!1;var e=[dr(n,t,i,r,f)],o=e[0],s=r.replacedWith;return ki(n,function(n){s&&(r.replacedWith=s.cloneNode(!0));e.push(dr(n,u(n,t),u(n,i),r,f));for(var h=0;h<n.linked.length;++h)if(n.linked[h].isParent)return;o=b(e)}),new gr(e,o)}function nu(n,t){var i,r;if(n)for(i=0;i<n.length;++i)if(r=n[i],r.marker==t)return r}function sv(n,t){for(var r,i=0;i<n.length;++i)n[i]!=t&&(r||(r=[])).push(n[i]);return r}function hv(n,t){n.markedSpans=n.markedSpans?n.markedSpans.concat([t]):[t];t.marker.attachLine(n)}function cv(n,t,i){var u,e,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t);!s&&(f.type!="bookmark"||r.from!=t||i&&r.marker.insertLeft)||(o=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t),(e||(e=[])).push({from:r.from,to:o?null:r.to,marker:f}))}return e}function lv(n,t,i){var u,e,o;if(n)for(u=0;u<n.length;++u){var r=n[u],f=r.marker,s=r.to==null||(f.inclusiveRight?r.to>=t:r.to>t);(s||f.type=="bookmark"&&r.from==t&&(!i||r.marker.insertLeft))&&(o=r.from==null||(f.inclusiveLeft?r.from<=t:r.from<t),(e||(e=[])).push({from:o?null:r.from-t,to:r.to==null?null:r.to-t,marker:f}))}return e}function ao(n,t){var p=wi(n,t.from.line)&&r(n,t.from.line).markedSpans,w=wi(n,t.to.line)&&r(n,t.to.line).markedSpans,f,e,c,a,v,i;if(!p&&!w)return null;var y=t.from.ch,d=t.to.ch,k=s(t.from,t.to),u=cv(p,y,k),h=lv(w,d,k),o=t.text.length==1,l=b(t.text).length+(o?y:0);if(u)for(i=0;i<u.length;++i)f=u[i],f.to==null&&(e=nu(h,f.marker),e?o&&(f.to=e.to==null?null:e.to+l):f.to=y);if(h)for(i=0;i<h.length;++i)f=h[i],f.to!=null&&(f.to+=l),f.from==null?(e=nu(u,f.marker),e||(f.from=l,o&&(u||(u=[])).push(f))):(f.from+=l,o&&(u||(u=[])).push(f));if(o&&u){for(i=0;i<u.length;++i)u[i].from!=null&&u[i].from==u[i].to&&u[i].marker.type!="bookmark"&&u.splice(i--,1);u.length||(u=null)}if(c=[u],!o){if(a=t.text.length-2,a>0&&u)for(i=0;i<u.length;++i)u[i].to==null&&(v||(v=[])).push({from:null,to:null,marker:u[i].marker});for(i=0;i<a;++i)c.push(v);c.push(h)}return c}function uc(n,t){var i=gv(n,t),s=ao(n,t),r,f,u,e,h,o;if(!i)return s;if(!s)return i;for(r=0;r<i.length;++r)if(f=i[r],u=s[r],f&&u)n:for(e=0;e<u.length;++e){for(h=u[e],o=0;o<f.length;++o)if(f[o].marker==h.marker)continue n;f.push(h)}else u&&(i[r]=u);return i}function av(n,t,i){var f=null,e,l,a,r,o,u,c;if(n.iter(t.line,i.line+1,function(n){var t,i;if(n.markedSpans)for(t=0;t<n.markedSpans.length;++t)i=n.markedSpans[t].marker,i.readOnly&&(!f||yt(f,i)==-1)&&(f||(f=[])).push(i)}),!f)return null;for(e=[{from:t,to:i}],l=0;l<f.length;++l)for(a=f[l],r=a.find(),o=0;o<e.length;++o)(u=e[o],h(u.to,r.from)||h(r.to,u.from))||(c=[o,1],(h(u.from,r.from)||!a.inclusiveLeft&&s(u.from,r.from))&&c.push({from:u.from,to:r.from}),(h(r.to,u.to)||!a.inclusiveRight&&s(u.to,r.to))&&c.push({from:r.to,to:u.to}),e.splice.apply(e,c),o+=c.length-1);return e}function hf(n,t){var f=wu&&n.markedSpans,r,i,u;if(f)for(u=0;
8u<f.length;++u)(i=f[u],i.marker.collapsed)&&(i.from==null||i.from<t)&&(i.to==null||i.to>t)&&(!r||r.width<i.marker.width)&&(r=i.marker);return r}function vo(n){return hf(n,-1)}function cf(n){return hf(n,n.text.length+1)}function lt(n,t){for(var i;i=vo(t);)t=r(n,i.find().from.line);return t}function ri(n,t){var u=wu&&t.markedSpans,i,r;if(u)for(r=0;r<u.length;++r)if((i=u[r],i.marker.collapsed)&&(i.from==null||!i.marker.replacedWith&&i.from==0&&i.marker.inclusiveLeft&&yo(n,t,i)))return!0}function yo(n,t,i){var o,e,u,f;if(i.to==null)return o=i.marker.find().to,e=r(n,o.line),yo(n,e,nu(e.markedSpans,i.marker));if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(f=0;f<t.markedSpans.length;++f)if(u=t.markedSpans[f],u.marker.collapsed&&!u.marker.replacedWith&&u.from==i.to&&(u.marker.inclusiveLeft||i.marker.inclusiveRight)&&yo(n,t,u))return!0}function fc(n){var i=n.markedSpans,t;if(i){for(t=0;t<i.length;++t)i[t].marker.detachLine(n);n.markedSpans=null}}function ec(n,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(n);n.markedSpans=t}}function oc(n){return function(){var t=!this.cm.curOp,i;t&&ai(this.cm);try{i=n.apply(this,arguments)}finally{t&&vi(this.cm)}return i}}function lf(n){return n.height!=null?n.height:(n.node.parentNode&&n.node.parentNode.nodeType==1||ht(n.cm.display.measure,i("div",[n.node],null,"position: relative")),n.height=n.node.offsetHeight)}function vv(n,t,i,r){var u=new lu(n,i,r);return u.noHScroll&&(n.display.alignWidgets=!0),sf(n,t,function(t){var i=t.widgets||(t.widgets=[]),r;return u.insertAt==null?i.push(u):i.splice(Math.min(i.length-1,Math.max(0,u.insertAt)),0,u),u.line=t,(!ri(n.doc,t)||u.showIfHidden)&&(r=ru(n,t)<n.doc.scrollTop,rt(t,t.height+lf(u)),r&&so(n,0,u.height)),!0}),u}function yv(n,t,i,r){n.text=t;n.stateAfter&&(n.stateAfter=null);n.styles&&(n.styles=null);n.order!=null&&(n.order=null);fc(n);ec(n,i);var u=r?r(n):1;u!=n.height&&rt(n,u)}function pv(n){n.parent=null;fc(n)}function sc(n,t,i,r,u){var e=i.flattenSpans;e==null&&(e=n.options.flattenSpans);var h=0,o=null,f=new kr(t,n.options.tabSize),s;for(t==""&&i.blankLine&&i.blankLine(r);!f.eol();)f.pos>n.options.maxHighlightLength?(e=!1,f.pos=Math.min(t.length,f.start+5e4),s=null):s=i.token(f,r),e&&o==s||(h<f.start&&u(f.start,o),h=f.start,o=s),f.start=f.pos;h<f.pos&&u(f.pos,o)}function hc(n,t,i){var r=[n.state.modeGen],f;
8for(sc(n,t.text,n.doc.mode,i,function(n,t){r.push(n,t)}),f=0;f<n.state.overlays.length;++f){var e=n.state.overlays[f],u=1,o=0;sc(n,t.text,e.mode,!0,function(n,t){for(var i=u,f,s;o<n;)f=r[u],f>n&&r.splice(u,1,n,r[u+1],f),u+=2,o=Math.min(n,f);if(t)if(e.opaque)r.splice(i,u-i,n,t),u=i+2;else for(;i<u;i+=2)s=r[i+1],r[i+1]=s?s+" "+t:t})}return r}function cc(n,t){return t.styles&&t.styles[0]==n.state.modeGen||(t.styles=hc(n,t,t.stateAfter=cr(n,d(t)))),t.styles}function lc(n,t,i){var u=n.doc.mode,r=new kr(t.text,n.options.tabSize);for(t.text==""&&u.blankLine&&u.blankLine(i);!r.eol()&&r.pos<=n.options.maxHighlightLength;)u.token(r,i),r.start=r.pos}function ac(n){return n?vs[n]||(vs[n]="cm-"+n.replace(/ +/g," cm-")):null}function po(n,t,u,f){for(var w,o=t,b=!0,e,a,s,h,v,y,c;w=vo(o);)o=r(n.doc,w.find().from.line);e={pre:i("pre"),col:0,pos:0,measure:null,measuredSomething:!1,cm:n,copyWidgets:f};o.textClass&&(e.pre.className=o.textClass);do o.text&&(b=!1),e.measure=o==t&&u,e.pos=0,e.addToken=e.measure?wv:vc,(l||nt)&&n.getOption("lineWrapping")&&(e.addToken=bv(e.addToken)),a=kv(o,e,cc(n,o)),u&&o==t&&!e.measuredSomething&&(u[0]=e.pre.appendChild(su(n.display.measure)),e.measuredSomething=!0),a&&(o=r(n.doc,a.to.line));while(a);return!u||e.measuredSomething||u[0]||(u[0]=e.pre.appendChild(b?i("span"," "):su(n.display.measure))),e.pre.firstChild||ri(n.doc,t)||e.pre.appendChild(document.createTextNode(" ")),u&&l&&(s=ot(o))&&(h=s.length-1,s[h].from==s[h].to&&--h,v=s[h],y=s[h-1],v.from+1==v.to&&y&&v.level<y.level&&(c=u[e.pos-1],c&&c.parentNode.insertBefore(c.measureRight=su(n.display.measure),c.nextSibling))),p(n,"renderLine",n,t,e.pre),e.pre}function vc(n,t,r,u,f,e){var o,s,h,l,v,y,a,c;if(t){if(oe.test(t))for(o=document.createDocumentFragment(),s=0;;){if(oe.lastIndex=s,h=oe.exec(t),l=h?h.index-s:t.length-s,l&&(o.appendChild(document.createTextNode(t.slice(s,s+l))),n.col+=l),!h)break;s+=l+1;h[0]=="\t"?(v=n.cm.options.tabSize,y=v-n.col%v,o.appendChild(i("span",tl(y),"cm-tab")),n.col+=y):(c=i("span","•","cm-invalidchar"),c.title="\\u"+h[0].charCodeAt(0).toString(16),o.appendChild(c),n.col+=1)}else n.col+=t.length,o=document.createTextNode(t);if(r||u||f||n.measure)return a=r||"",u&&(a+=u),f&&(a+=f),c=i("span",[o],a),e&&(c.title=e),n.pre.appendChild(c);n.pre.appendChild(o)}}function wv(n,t,r,u,f){for(var o,c,s,h,a=n.cm.options.lineWrapping,e=0;e<t.length;++e)o=t.charAt(e),c=e==0,o>="�"&&o<"�"&&e<t.length-1?(o=t.slice(e,e+2),++e):e&&a&&kf(t,e)&&n.pre.appendChild(i("wbr")),s=n.measure[n.pos],h=n.measure[n.pos]=vc(n,o,r,c&&u,e==t.length-1&&f),s&&(h.leftSide=s.leftSide||s),l&&a&&o==" "&&e&&!/\s/.test(t.charAt(e-1))&&e<t.length-1&&!/\s/.test(t.charAt(e+1))&&(h.style.whiteSpace="normal"),n.pos+=o.length;t.length&&(n.measuredSomething=!0)}function bv(n){function t(n){for(var i=" ",t=0;t<n.length-2;++t)i+=t%2?" ":" ";return i+" "}return function(i,r,u,f,e,o){return n(i,r.replace(/ {3,}/,t),u,f,e,o)}}function yc(n,t,i,r){var u=!r&&i.replacedWith,f;u&&(n.copyWidgets&&(u=u.cloneNode(!0)),n.pre.appendChild(u),n.measure&&(t?n.measure[n.pos]=u:(f=n.measure[n.pos]=su(n.cm.display.measure),i.type!="bookmark"||i.insertLeft?n.pre.insertBefore(f,u):n.pre.appendChild(f)),n.measuredSomething=!0));n.pos+=t}function kv(n,t,i){var d=n.markedSpans,g=n.text,l=0,s,a,v,r,f,c,y,nt;if(!d){for(s=1;s<i.length;s+=2)t.addToken(t,g.slice(l,l=i[s]),ac(i[s+1]));return}for(var tt=g.length,u=0,s=1,h="",it,o=0,p,w,b,k,e;;){if(o==u){for(p=w=b=k="",e=null,o=Infinity,a=null,v=0;v<d.length;++v)r=d[v],f=r.marker,r.from<=u&&(r.to==null||r.to>u)?(r.to!=null&&o>r.to&&(o=r.to,w=""),f.className&&(p+=" "+f.className),f.startStyle&&r.from==u&&(b+=" "+f.startStyle),f.endStyle&&r.to==o&&(w+=" "+f.endStyle),f.title&&!k&&(k=f.title),f.collapsed&&(!e||e.marker.size<f.size)&&(e=r)):r.from>u&&o>r.from&&(o=r.from),f.type=="bookmark"&&r.from==u&&f.replacedWith&&(a=f);if(e&&(e.from||0)==u&&(yc(t,(e.to==null?tt:e.to)-u,e.marker,e.from==null),e.to==null))return e.marker.find();a&&!e&&yc(t,0,a)}if(u>=tt)break;for(c=Math.min(tt,o);;){if(h){if(y=u+h.length,e||(nt=y>c?h.slice(0,c-u):h,t.addToken(t,nt,it?it+p:p,b,u+nt.length==o?w:"",k)),y>=c){h=h.slice(c-u);u=c;break}u=y;b=""}h=g.slice(l,l=i[s++]);it=ac(i[s++])}}}function wo(n,t,i,u,f){function l(n){return i?i[n]:null}function v(n,i,r){yv(n,i,r,f);k(n,"change",n,t)}
8var o=t.from,a=t.to,s=t.text,h=r(n,o.line),y=r(n,a.line),d=b(s),g=l(s.length-1),p=a.line-o.line;if(o.ch==0&&a.ch==0&&d==""){for(var e=0,w=s.length-1,c=[];e<w;++e)c.push(new oi(s[e],l(e),f));v(y,y.text,g);p&&n.remove(o.line,p);c.length&&n.insert(o.line,c)}else if(h==y)if(s.length==1)v(h,h.text.slice(0,o.ch)+d+h.text.slice(a.ch),g);else{for(var c=[],e=1,w=s.length-1;e<w;++e)c.push(new oi(s[e],l(e),f));c.push(new oi(d+h.text.slice(a.ch),g,f));v(h,h.text.slice(0,o.ch)+s[0],l(0));n.insert(o.line+1,c)}else if(s.length==1)v(h,h.text.slice(0,o.ch)+s[0]+y.text.slice(a.ch),l(0)),n.remove(o.line+1,p);else{v(h,h.text.slice(0,o.ch)+s[0],l(0));v(y,d+y.text.slice(a.ch),g);for(var e=1,w=s.length-1,c=[];e<w;++e)c.push(new oi(s[e],l(e),f));p>1&&n.remove(o.line+1,p-1);n.insert(o.line+1,c)}k(n,"change",n,t);bt(n,u.anchor,u.head,null,!0)}function af(n){this.lines=n;this.parent=null;for(var t=0,r=n.length,i=0;t<r;++t)n[t].parent=this,i+=n[t].height;this.height=i}function tu(n){var r,u,t,f,i;for(this.children=n,r=0,u=0,t=0,f=n.length;t<f;++t)i=n[t],r+=i.chunkSize(),u+=i.height,i.parent=this;this.size=r;this.height=u;this.parent=null}function ki(n,t,i){function r(n,u,f){var o,e,s;if(n.linked)for(o=0;o<n.linked.length;++o)(e=n.linked[o],e.doc!=u)&&(s=f&&e.sharedHist,!i||s)&&(t(e.doc,s),r(e.doc,n,s))}r(n,null,!0)}function pc(n,t){if(t.cm)throw new Error("This document is already in use.");n.doc=t;t.cm=n;ks(n);or(n);n.options.lineWrapping||he(n);n.options.mode=t.modeOption;a(n)}function r(n,t){var i,r,u;for(t-=n.first;!n.lines;)for(i=0;;++i){if(r=n.children[i],u=r.chunkSize(),t<u){n=r;break}t-=u}return n.lines[t]}function bo(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 ko(n,t,i){var r=[];return n.iter(t,i,function(n){r.push(n.text)}),r}function rt(n,t){for(var r=t-n.height,i=n;i;i=i.parent)i.height+=r}function d(n){var i,u,t,r;if(n.parent==null)return null;for(i=n.parent,u=yt(i.lines,n),t=i.parent;t;i=t,t=t.parent)for(r=0;;++r){if(t.children[r]==i)break;u+=t.children[r].chunkSize()}return u+i.first}function iu(n,t){var f=n.first,r,e,i,u,s,o;n:do{for(i=0,u=n.children.length;i<u;++i){if(r=n.children[i],e=r.height,t<e){n=r;continue n}t-=e;f+=r.chunkSize()}return f}while(!n.lines);for(i=0,u=n.lines.length;i<u;++i){if(s=n.lines[i],o=s.height,t<o)break;t-=o}return f+i}function ru(n,t){var f,r,e,u,i,o;for(t=lt(n.doc,t),f=0,r=t.parent,i=0;i<r.lines.length;++i)if(e=r.lines[i],e==t)break;else f+=e.height;for(u=r.parent;u;r=u,u=r.parent)for(i=0;i<u.children.length;++i)if(o=u.children[i],o==r)break;else f+=o.height;return f}function ot(n){var t=n.order;return t==null&&(t=n.order=wl(n.text)),t}function vf(n){return{done:[],undone:[],undoDepth:Infinity,lastTime:0,lastOp:null,lastOrigin:null,generation:n||1,maxGeneration:n||1}}function wc(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 go(n,t){var r={line:t.from.line,ch:t.from.ch},i={from:r,to:re(t),text:bo(n,t.from,t.to)};return wc(n,i,t.from.line,t.to.line+1),ki(n,function(n){wc(n,i,t.from.line,t.to.line+1)},!0),i}function bc(n,t,i,r){var u=n.history,e,f,o;if(u.undone.length=0,e=+new Date,f=b(u.done),f&&(u.lastOp==r||u.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.cm&&u.lastTime>e-n.cm.options.historyEventDelay||t.origin.charAt(0)=="*")))o=b(f.changes),s(t.from,t.to)&&s(t.from,o.to)?o.to=re(t):f.changes.push(go(n,t)),f.anchorAfter=i.anchor,f.headAfter=i.head;else for(f={changes:[go(n,t)],generation:u.generation,anchorBefore:n.sel.anchor,headBefore:n.sel.head,anchorAfter:i.anchor,headAfter:i.head},u.done.push(f),u.generation=++u.maxGeneration;u.done.length>u.undoDepth;)u.done.shift();u.lastTime=e;u.lastOp=r;u.lastOrigin=t.origin}function dv(n){if(!n)return null;for(var i=0,t;i<n.length;++i)n[i].marker.explicitlyCleared?t||(t=n.slice(0,i)):t&&t.push(n[i]);return t?t.length?t:null:n}function gv(n,t){var u=t["spans_"+n.id],i,r;if(!u)return null;for(i=0,r=[];i<t.text.length;++i)r.push(dv(u[i]));return r}function yf(n,t){for(var f,i,h,r,e=0,o=[];e<n.length;++e){var u=n[e],c=u.changes,s=[];for(o.push({changes:s,anchorBefore:u.anchorBefore,headBefore:u.headBefore,anchorAfter:u.anchorAfter,headAfter:u.headAfter}),f=0;f<c.length;++f)if(i=c[f],s.push({from:i.from,to:i.to,text:i.text}),t)for(r in i)(h=r.match(/^spans_(\d+)$/))&&yt(t,Number(h[1]))>-1&&(b(s)[r]=i[r],delete i[r])}return o}function pf(n,t,i,r){i<n.line?n.line+=r:t<n.line&&(n.line=t,n.ch=0)}function kc(n,t,i,r){for(var u,s,o,f,e=0;e<n.length;++e){for(u=n[e],s=!0,o=0;o<u.changes.length;++o)if(f=u.changes[o],u.copied||(f.from=ii(f.from),f.to=ii(f.to)),i<f.from.line)f.from.line+=r,f.to.line+=r;else if(t<=f.to.line){s=!1;break}u.copied||(u.anchorBefore=ii(u.anchorBefore),u.headBefore=ii(u.headBefore),u.anchorAfter=ii(u.anchorAfter),u.readAfter=ii(u.headAfter),u.copied=!0);s?(pf(u.anchorBefore),pf(u.headBefore),pf(u.anchorAfter),pf(u.headAfter)):(n.splice(0,e+1),e=0)}}function dc(n,t){var i=t.from.line,r=t.to.line,u=t.text.length-(r-i)-1;kc(n.done,i,r,u);kc(n.undone,i,r,u)}function ny(){fu(this)}function uu(n){return n.stop||(n.stop=ny),n}function v(n){n.preventDefault?n.preventDefault():n.returnValue=!1}function gc(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function ty(n){return n.defaultPrevented!=null?n.defaultPrevented:n.returnValue==!1}function fu(n){v(n);gc(n)}function ns(n){return n.target||n.srcElement}function nl(n){var t=n.which;return t==null&&(n.button&1?t=1:n.button&2?t=3:n.button&4&&(t=2)),ir&&n.ctrlKey&&t==1&&(t=3),t}function e(n,t,i){if(n.addEventListener)n.addEventListener(t,i,!1);else if(n.attachEvent)n.attachEvent("on"+t,i);else{var r=n._handlers||(n._handlers={}),u=r[t]||(r[t]=[]);u.push(i)}}function at(n,t,i){var r,u;if(n.removeEventListener)n.removeEventListener(t,i,!1);else if(n.detachEvent)n.detachEvent("on"+t,i);else{if(r=n._handlers&&n._handlers[t],!r)return;for(u=0;
8u<r.length;++u)if(r[u]==i){r.splice(u,1);break}}}function p(n,t){var r=n._handlers&&n._handlers[t],u,i;if(r)for(u=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,u)}function k(n,t){function f(n){return function(){n.apply(null,u)}}var r=n._handlers&&n._handlers[t],u,i;if(r)for(u=Array.prototype.slice.call(arguments,2),dt||(++vu,dt=[],setTimeout(iy,0)),i=0;i<r.length;++i)dt.push(f(r[i]))}function st(n,t,i){return p(n,i||t.type,n,t),ty(t)||t.codemirrorIgnore}function iy(){var t,n;for(--vu,t=dt,dt=null,n=0;n<t.length;++n)t[n]()}function vt(n,t){var i=n._handlers&&n._handlers[t];return i&&i.length>0}function di(n){n.prototype.on=function(n,t){e(this,n,t)};n.prototype.off=function(n,t){at(this,n,t)}}function ts(){this.id=null}function gi(n,t,i,r,u){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));for(var e=r||0,f=u||0;e<t;++e)n.charAt(e)=="\t"?f+=i-f%i:++f;return f}function tl(n){while(yu.length<=n)yu.push(b(yu)+" ");return yu[n]}function b(n){return n[n.length-1]}function il(n){if(hu)n.selectionStart=0,n.selectionEnd=n.value.length;else try{n.select()}catch(t){}}function yt(n,t){if(n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;i<r;++i)if(n[i]==t)return i;return-1}function rl(n,t){function i(){}i.prototype=n;var r=new i;return t&&wf(t,r),r}function wf(n,t){t||(t={});for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i]);return t}function ul(n){for(var t=[],i=0;i<n;++i)t.push(undefined);return t}function ut(n){var t=Array.prototype.slice.call(arguments,1);return function(){return n.apply(null,t)}}function eu(n){return/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||yl.test(n))}function fl(n){for(var t in n)if(n.hasOwnProperty(t)&&n[t])return!1;return!0}function i(n,t,i,r){var u=document.createElement(n),f;if(i&&(u.className=i),r&&(u.style.cssText=r),typeof t=="string")el(u,t);else if(t)for(f=0;f<t.length;++f)u.appendChild(t[f]);return u}function bf(n){for(var t=n.childNodes.length;t>0;--t)n.removeChild(n.firstChild);return n}function ht(n,t){return bf(n).appendChild(t)}function el(n,t){g?(n.innerHTML="",n.appendChild(document.createTextNode(t))):n.textContent=t}function c(n){return n.getBoundingClientRect()}function kf(){return!1}function ou(n){if(pu!=null)return pu;var t=i("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return ht(n,t),t.offsetWidth&&(pu=t.offsetHeight-t.clientHeight),pu||0}function su(n){if(ps==null){var t=i("span","​");ht(n,i("span",[t,document.createTextNode("x")]));n.firstChild.offsetHeight!=0&&(ps=t.offsetWidth<=1&&t.offsetHeight>2&&!tr)}return ps?i("span","​"):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function ry(n,t,i,r){var e,f,u;if(!n)return r(t,i,"ltr");for(e=!1,f=0;f<n.length;++f)u=n[f],(u.from<i&&u.to>t||t==i&&u.to==t)&&(r(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr"),e=!0);e||r(t,i,"ltr")}function is(n){return n.level%2?n.to:n.from}function rs(n){return n.level%2?n.from:n.to}function df(n){var t=ot(n);return t?is(t[0]):0}function gf(n){var t=ot(n);return t?rs(b(t)):n.text.length}function ol(n,i){var e=r(n.doc,i),u=lt(n.doc,e),f,o;return u!=e&&(i=d(u)),f=ot(u),o=f?f[0].level%2?gf(u):df(u):0,t(i,o)}function uy(n,i){for(var e,u,f,o;e=cf(u=r(n.doc,i));)i=e.find().to.line;return f=ot(u),o=f?f[0].level%2?df(u):gf(u):u.text.length,t(i,o)}function fy(n,t,i){var r=n[0].level;return t==r?!0:i==r?!1:t<i}function us(n,t){for(var r,u,i=0;i<n.length;++i){if(u=n[i],u.from<t&&u.to>t)return er=null,i;if(u.from==t||u.to==t)if(r==null)r=i;else return fy(n,u.level,n[r].level)?(er=r,i):(er=i,r)}return er=null,r}function fs(n,t,i,r){if(!r)return t+i;do t+=i;while(t>0&&se.test(n.text.charAt(t)));return t}function es(n,t,i,r){var e=ot(n);if(!e)return sl(n,t,i,r);for(var o=us(e,t),u=e[o],f=fs(n,t,u.level%2?-i:i,r);;){if(f>u.from&&f<u.to)return f;if(f==u.from||f==u.to)return us(e,f)==o?f:(u=e[o+=i],i>0==u.level%2?u.to:u.from);if(u=e[o+=i],!u)return null;f=i>0==u.level%2?fs(n,u.to,-1,r):fs(n,u.from,1,r)}}function sl(n,t,i,r){var u=t+i;if(r)while(u>0&&se.test(n.text.charAt(u)))u+=i;return u<0||u>n.text.length?null:u}var nr=/gecko\/\d/i.test(navigator.userAgent),l=/MSIE \d/.test(navigator.userAgent),tr=l&&(document.documentMode==null||document.documentMode<8),g=l&&(document.documentMode==null||document.documentMode<9),nt=/WebKit\//.test(navigator.userAgent),ey=nt&&/Qt\/\d+\.\d+/.test(navigator.userAgent),oy=/Chrome\//.test(navigator.userAgent),ft=/Opera\//.test(navigator.userAgent),os=/Apple Computer/.test(navigator.vendor),ss=/KHTML\//.test(navigator.userAgent),sy=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),hy=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),cy=/PhantomJS/.test(navigator.userAgent),hu=/AppleWeb
8Kit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),hl=hu||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ir=hu||/Mac/.test(navigator.platform),ly=/windows/i.test(navigator.platform),ui=ft&&navigator.userAgent.match(/Version\/(\d*\.\d*)/),fi,cl,ne,te,hs,cu,tt,ll,ie,cs,re,ei,ue,ls,as,rr,ur,fe,fr,ee,ct,lu,oi,vs,oe,al,w,vl,au,dt,vu,si,ys,yu,yl,se,pl,pu,ps,gt,er,wl;ui&&(ui=Number(ui[1]));ui&&ui>=15&&(ft=!1,nt=!0);var bl=ir&&(ey||ft&&(ui==null||ui<12.11)),ws=nr||l&&!g,kl=!1,wu=!1;cl=0;hs=0;cu=0;tt=null;l?tt=-.53:nr?tt=15:oy?tt=-.7:os&&(tt=-1/3);ie=null;re=n.changeEnd=function(n){return n.text?t(n.from.line+n.text.length-1,b(n.text).length+(n.text.length==1?n.from.ch:0)):n.to};n.Pos=t;n.prototype={constructor:n,focus:function(){window.focus();it(this);ti(this);ar(this)},setOption:function(n,t){var i=this.options,r=i[n];(i[n]!=t||n=="mode")&&(i[n]=t,ei.hasOwnProperty(n)&&f(this,ei[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"](n)},removeKeyMap:function(n){for(var i=this.state.keyMaps,t=0;t<i.length;++t)if(i[t]==n||typeof i[t]!="string"&&i[t].name==n)return i.splice(t,1),!0},addOverlay:f(null,function(t,i){var r=t.token?t:n.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:r,modeSpec:t,opaque:i&&i.opaque});this.state.modeGen++;a(this)}),removeOverlay:f(null,function(n){for(var i,r=this.state.overlays,t=0;t<r.length;++t)if(i=r[t].modeSpec,i==n||typeof n=="string"&&i.name==n){r.splice(t,1);this.state.modeGen++;a(this);return}}),indentLine:f(null,function(n,t,i){typeof t!="string"&&typeof t!="number"&&(t=t==null?this.options.smartIndent?"smart":"prev":t?"add":"subtract");wi(this.doc,n)&&of(this,n,t,i)}),indentSelection:f(null,function(n){var t=this.doc.sel,r,i;if(s(t.from,t.to))return of(this,t.from.line,n);for(r=t.to.line-(t.to.ch?0:1),i=t.from.line;i<=r;++i)of(this,i,n)}),getTokenAt:function(n,t){var e=this.doc,f;n=u(e,n);for(var o=cr(this,n.line,t),s=this.doc.mode,h=r(e,n.line),i=new kr(h.text,this.options.tabSize);i.pos<n.ch&&!i.eol();)i.start=i.pos,f=s.token(i,o);return{start:i.start,end:i.pos,string:i.current(),className:f||null,type:f||null,state:o}},getTokenTypeAt:function(n){var t;n=u(this.doc,n);var i=cc(this,r(this.doc,n.line)),e=0,o=(i.length-1)/2,f=n.ch;if(f==0)return i[2];for(;;)if(t=e+o>>1,(t?i[t*2-1]:0)>=f)o=t;else if(i[t*2+1]<f)e=t+1;else return i[t*2+2]},getModeAt:function(t){var i=this.doc.mode;return i.innerMode?n.innerMode(i,this.getTokenAt(t).state).mode:i},getHelper:function(n,t){if(fr.hasOwnProperty(t)){var r=fr[t],i=this.getModeAt(n);return i[t]&&r[i[t]]||i.helperType&&r[i.helperType]||r[i.name]}},getStateAfter:function(n,t){var i=this.doc;return n=kh(i,n==null?i.first+i.size-1:n),cr(this,n+1,t)},cursorCoords:function(n,t){var r,i=this.doc.sel;return r=n==null?i.head:typeof n=="object"?u(this.doc,n):n?i.from:i.to,et(this,r,t||"page")},charCoords:function(n,t){return to(this,u(this.doc,n),t||"page")},coordsChar:function(n,t){return n=eh(this,n,t||"page"),io(this,n.left,n.top)},lineAtHeight:function(n,t){return n=eh(this,{top:n,left:0},t||"page").top,iu(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,t){var i=!1,u=this.doc.first+this.doc.size-1,f;return n<this.doc.first?n=this.doc.first:n>u&&(n=u,i=!0),f=r(this.doc,n),no(this,r(this.doc,n),{top:0,left:0},t||"page").top+(i?f.height:0)},defaultTextHeight:function(){return li(this.display)},defaultCharWidth:function(){return oh(this.display)},setGutterMarker:f(null,function(n,t,i){return sf(this,n,function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&fl(r)&&(n.gutterMarkers=null),!0})}),clearGutter:f(null,function(n){var i=this,r=i.doc,t=r.first;r.iter(function(r){r.gutterMarkers&&r.gutterMarkers[n]&&(r.gutterMarkers[n]=null,a(i,t,t+1),fl(r.gutterMarkers)&&(r.gutterMarkers=null));++t})}),addLineClass:f(null,function(n,t,i){return sf(this,n,function(n){var r=t=="text"?"textClass":t=="background"?"bgClass":"wrapClass";if(n[r]){if(new RegExp("(?:^|\\s)"+i+"(?:$|\\s)").test(n[r]))return!1;n[r]+=" "+i}else n[r]=i;return!0})}),removeLineClass:f(null,function(n,t,i){return sf(this,n,function(n){var f=t=="text"?"textClass":t=="background"?"bgClass":"wrapClass",u=n[f],r,e;if(u)if(i==null)n[f]=null;else{if(r=u.match(new RegExp("(?:^|\\s+)"+i+"(?:$|\\s+)")),!r)return!1;e=r.index+r[0].length;n[f]=u.slice(0,r.index)+(!r.index||e==u.length?"":" ")+u.slice(e)||null}else return!1;return!0})}),addLineWidget:f(null,function(n,t,i){return vv(this,n,t,i)}),removeLineWidget:function(n){n.clear()},lineInfo:function(n){var t;if(typeof n=="number"){if(!wi(this.doc,n)||(t=n,n=r(this.doc,n),!n))return null}else if(t=d(n),t==null)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.showingFrom,to:this.display.showingTo}},addWidget:function(n,t,i,r,f){var s=this.display,o,e,h,c;n=et(this,u(this.doc,n));o=n.bottom;e=n.left;t.style.position="absolute";s.sizer.appendChild(t);r=="over"?o=n.top:(r=="above"||r=="near")&&(h=Math.max(s.wrapper.clientHeight,this.doc.height),c=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth),(r=="above"||n.bottom+t.offsetHeight>h)&&n.top>t.offsetHeight?o=n.top-t.offsetHeight:n.bottom+t.offsetHeight<=h&&(o=n.bottom),e+t.offsetWidth>c&&(e=c-t.offsetWidth));t.style.top=o+"px";t.style.left=t.style.right="";f=="right"?(e=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):(f=="left"?e=0:f=="middle"&&(e=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=e+"px");i&&fv(this,e,o,e+t.offsetWidth,o+t.offsetHeight)},triggerOnKeyDown:f(null,ah),execCommand:function(n){return ee[n](this)},findPosH:function(n,t,i,r){var o=1,e,f;for(t<0&&(o=-1,t=-t),e=0,f=u(this.doc,n);e<t;++e)if(f=ho(this.doc,f,o,i,r),f.hitSide)break;return f},moveH:f(null,function(n,t){var i=this.doc.sel,r;r=i.shift||i.extend||s(i.from,i.to)?ho(this.doc,i.head,n,t,this.options.rtlMoveVisually):n<0?i.from:i.to;y(this.doc,r,r,n)}),deleteH:f(null,function(n,t){var i=this.doc.sel;s(i.from,i.to)?wt(this.doc,"",i.from,ho(this.doc,i.head,n,t,!1),"+delete"):wt(this.doc,"",i.from,i.to,"+delete");this.curOp.userSelChange=!0}),findPosV:function(n,t,i,r){var h=1,o=r,s,f,e;for(t<0&&(h=-1,t=-t),s=0,f=u(this.doc,n);s<t;++s)if(e=et(this,f,"div"),o==null?o=e.left:e.left=o,f=nc(this,e,h,i),f.hitSide)break;return f},moveV:f(null,function(n,t){var i=this.doc.sel,r=et(this,i.head,"div"),u;i.goalColumn!=null&&(r.left=i.goalColumn);u=nc(this,r,n,t);t=="page"&&so(this,0,to(this,u,"div").top-r.top);y(this.doc,u,u,n);i.goalColumn=r.left}),toggleOverwrite:function(n){(n==null||n!=this.state.overwrite)&&((this.state.overwrite=!this.state.overwrite)?this.display.cursor.className+=" CodeMirror-overwrite":this.display.cursor.className=this.display.cursor.className.replace(" CodeMirror-overwrite",""))},hasFocus:function(){return this.state.focused},scrollTo:f(null,function(n,t){ef(this,n,t)}),getScrollInfo:function(){var n=this.display.scroller,t=si;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-t,width:n.scrollWidth-t,clientHeight:n.clientHeight-t,clientWidth:n.clientWidth-t}},scrollIntoView:f(null,function(n,i){var r,f;typeof n=="number"&&(n=t(n,0));
8i||(i=0);r=n;n&&n.line==null||(this.curOp.scrollToPos=n?u(this.doc,n):this.doc.sel.head,this.curOp.scrollToPosMargin=i,r=et(this,this.curOp.scrollToPos));f=ff(this,r.left,r.top-i,r.right,r.bottom+i);ef(this,f.scrollLeft,f.scrollTop)}),setSize:f(null,function(n,t){function i(n){return typeof n=="number"||/^\d+$/.test(String(n))?n+"px":n}n!=null&&(this.display.wrapper.style.width=i(n));t!=null&&(this.display.wrapper.style.height=i(t));this.options.lineWrapping&&(this.display.measureLineCache.length=this.display.measureLineCachePos=0);this.curOp.forceUpdate=!0}),operation:function(n){return ro(this,n)},refresh:f(null,function(){ci(this);ef(this,this.doc.scrollLeft,this.doc.scrollTop);a(this)}),swapDoc:f(null,function(n){var t=this.doc;return t.cm=null,pc(this,n),ci(this),pt(this,!0),ef(this,n.scrollLeft,n.scrollTop),t}),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};di(n);ei=n.optionHandlers={};ue=n.defaults={};ls=n.Init={toString:function(){return"CodeMirror.Init"}};o("value","",function(n,t){n.setValue(t)},!0);o("mode",null,function(n,t){n.doc.modeOption=t;or(n)},!0);o("indentUnit",2,or,!0);o("indentWithTabs",!1);o("smartIndent",!0);o("tabSize",4,function(n){or(n);ci(n);a(n)},!0);o("electricChars",!0);o("rtlMoveVisually",!ly);o("theme","default",function(n){gs(n);sr(n)},!0);o("keyMap","default",ds);o("extraKeys",null);o("onKeyEvent",null);o("onDragEvent",null);o("lineWrapping",!1,na,!0);o("gutters",[],function(n){ce(n.options);sr(n)},!0);o("fixedGutter",!0,function(n,t){n.display.gutters.style.left=t?pe(n.display)+"px":"0";n.refresh()},!0);o("coverGutterNextToScrollbar",!1,le,!0);o("lineNumbers",!1,function(n){ce(n.options);sr(n)},!0);o("firstLineNumber",1,sr,!0);o("lineNumberFormatter",function(n){return n},sr,!0);o("showCursorWhenSelecting",!1,be,!0);o("readOnly",!1,function(n,t){t=="nocursor"?(fo(n),n.display.input.blur()):t||pt(n,!0)});o("dragDrop",!0);o("cursorBlinkRate",530);o("cursorScrollMargin",0);o("cursorHeight",1);o("workTime",100);o("workDelay",100);o("flattenSpans",!0);o("pollInterval",100);o("undoDepth",40,function(n,t){n.doc.history.undoDepth=t});o("historyEventDelay",500);o("viewportMargin",10,function(n){n.refresh()},!0);o("maxHighlightLength",1e4,function(n){or(n);n.refresh()},!0);o("moveInputWithCursor",!0,function(n,t){t||(n.display.inputDiv.style.top=n.display.inputDiv.style.left=0)});o("tabindex",null,function(n,t){n.display.input.tabIndex=t||""});o("autofocus",null);as=n.modes={};rr=n.mimeModes={};n.defineMode=function(t,i){if(n.defaults.mode||t=="null"||(n.defaults.mode=t),arguments.length>2){i.dependencies=[];for(var r=2;r<arguments.length;++r)i.dependencies.push(arguments[r])}as[t]=i};n.defineMIME=function(n,t){rr[n]=t};n.resolveMode=function(t){if(typeof t=="string"&&rr.hasOwnProperty(t))t=rr[t];else if(t&&typeof t.name=="string"&&rr.hasOwnProperty(t.name)){var i=rr[t.name];t=rl(i,t);t.name=i.name}else if(typeof t=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return n.resolveMode("application/xml");return typeof t=="string"?{name:t}:t||{name:"null"}};n.getMode=function(t,i){var i=n.resolveMode(i),e=as[i.name],r,f,u;if(!e)return n.getMode(t,"text/plain");if(r=e(t,i),ur.hasOwnProperty(i.name)){f=ur[i.name];for(u in f)f.hasOwnProperty(u)&&(r.hasOwnProperty(u)&&(r["_"+u]=r[u]),r[u]=f[u])}return r.name=i.name,r};n.defineMode("null",function(){return{token:function(n){n.skipToEnd()}}});n.defineMIME("text/plain","null");ur=n.modeExtensions={};n.extendMode=function(n,t){var i=ur.hasOwnProperty(n)?ur[n]:ur[n]={};wf(t,i)};n.defineExtension=function(t,i){n.prototype[t]=i};n.defineDocExtension=function(n,t){w.prototype[n]=t};n.defineOption=o;fe=[];n.defineInitHook=function(n){fe.push(n)};fr=n.helpers={};n.registerHelper=function(t,i,r){fr.hasOwnProperty(t)||(fr[t]=n[t]={});fr[t][i]=r};n.isWordChar=eu;n.copyState=bi;n.startState=tc;n.innerMode=function(n,t){while(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}};ee=n.commands={selectAll:function(n){n.setSelection(t(n.firstLine(),0),t(n.lastLine()
8))},killLine:function(n){var i=n.getCursor(!0),r=n.getCursor(!1),u=!s(i,r);u||n.getLine(i.line).length!=i.ch?n.replaceRange("",i,u?r:t(i.line),"+delete"):n.replaceRange("",i,t(i.line+1,0),"+delete")},deleteLine:function(n){var i=n.getCursor().line;n.replaceRange("",t(i,0),t(i),"+delete")},delLineLeft:function(n){var i=n.getCursor();n.replaceRange("",t(i.line,0),i,"+delete")},undo:function(n){n.undo()},redo:function(n){n.redo()},goDocStart:function(n){n.extendSelection(t(n.firstLine(),0))},goDocEnd:function(n){n.extendSelection(t(n.lastLine()))},goLineStart:function(n){n.extendSelection(ol(n,n.getCursor().line))},goLineStartSmart:function(n){var i=n.getCursor(),r=ol(n,i.line),f=n.getLineHandle(r.line),e=ot(f),u,o;e&&e[0].level!=0?n.extendSelection(r):(u=Math.max(0,f.text.search(/\S/)),o=i.line==r.line&&i.ch<=u&&i.ch,n.extendSelection(t(r.line,o?0:u)))},goLineEnd:function(n){n.extendSelection(uy(n,n.getCursor().line))},goLineRight:function(n){var t=n.charCoords(n.getCursor(),"div").top+5;n.extendSelection(n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:t},"div"))},goLineLeft:function(n){var t=n.charCoords(n.getCursor(),"div").top+5;n.extendSelection(n.coordsChar({left:0,top:t},"div"))},goLineUp:function(n){n.moveV(-1,"line")},goLineDown:function(n){n.moveV(1,"line")},goPageUp:function(n){n.moveV(-1,"page")},goPageDown:function(n){n.moveV(1,"page")},goCharLeft:function(n){n.moveH(-1,"char")},goCharRight:function(n){n.moveH(1,"char")},goColumnLeft:function(n){n.moveH(-1,"column")},goColumnRight:function(n){n.moveH(1,"column")},goWordLeft:function(n){n.moveH(-1,"word")},goGroupRight:function(n){n.moveH(1,"group")},goGroupLeft:function(n){n.moveH(-1,"group")},goWordRight:function(n){n.moveH(1,"word")},delCharBefore:function(n){n.deleteH(-1,"char")},delCharAfter:function(n){n.deleteH(1,"char")},delWordBefore:function(n){n.deleteH(-1,"word")},delWordAfter:function(n){n.deleteH(1,"word")},delGroupBefore:function(n){n.deleteH(-1,"group")},delGroupAfter:function(n){n.deleteH(1,"group")},indentAuto:function(n){n.indentSelection("smart")},indentMore:function(n){n.indentSelection("add")},indentLess:function(n){n.indentSelection("subtract")},insertTab:function(n){n.replaceSelection("\t","end","+input")},defaultTab:function(n){n.somethingSelected()?n.indentSelection("add"):n.replaceSelection("\t","end","+input")},transposeChars:function(n){var i=n.getCursor(),r=n.getLine(i.line);i.ch>0&&i.ch<r.length-1&&n.replaceRange(r.charAt(i.ch)+r.charAt(i.ch-1),t(i.line,i.ch-1),t(i.line,i.ch+1))},newlineAndIndent:function(n){f(n,function(){n.replaceSelection("\n","end","+input");n.indentLine(n.getCursor().line,null,!0)})()},toggleOverwrite:function(n){n.toggleOverwrite()}};ct=n.keyMap={};ct.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite"};ct.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Alt-Up":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Down":"goDocEnd","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",fallthrough:"basic"};ct.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineStart","Cmd-Right":"goLineEnd","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":"delLineLeft",fallthrough:["basic","emacsy"]};ct["default"]=ir?ct.macDefault:ct.pcDefault;ct.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"};n.lookupKey=br;n.isModifierKey=ic;n.keyName=rc;n.fromTextArea=function(t,i){function f(){t.value=r.getValue()}var o,u,s,h,r;if(i||(i={}),i.value=t.value,!i.tabindex&&t.tabindex&&(i.tabindex=t.tabindex),!i.placeholder&&t.placeholder&&(i.placeholder=t.placeholder),i.autofocus==null){o=document.body;try{o=document.activeElement}catch(c){}i.autofocus=o==t||t.getAttribute("autofocus")!=null&&o==document.body}if(t.form&&(e(t.form,"submit",f),!i.leaveSubmitMethodAlone)){u=t.form;s=u.submit;try{h=u.submit=function(){f();u.submit=s;u.submit();u.submit=h}}catch(c){}}return t.style.display="none",r=n(function(n){t.parentNode.insertBefore(n,t.nextSibling)},i),r.save=f,r.getTextArea=function(){return t},r.toTextArea=function(){f();t.parentNode.removeChild(r.getWrapperElement());t.style.display="";t.form&&(at(t.form,"submit",f),typeof t.form.submit=="function"&&(t.form.submit=s))},r};kr.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(n){var t=this.string.charAt(this.pos),i;return i=typeof n=="string"?t==n:t&&(n.test?n.test(t):n(t)),i?(++this.pos,t):void 0},eatWhile:function(n){for(var t=this.pos;this.eat(n););return this.pos>t},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.lastColumnPos<this.start&&(this.lastColumnValue=gi(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue},indentation:function(){return gi(this.string,null,this.tabSize)},match:function(n,t,i){var u,f,r;if(typeof n=="string"){if(u=function(n){return i?n.toLowerCase():n},f=this.string.substr(this.pos,n.length),u(f)==u(n))return t!==!1&&(this.pos+=n.length),!0}else return(r=this.string.slice(this.pos).match(n),r&&r.index>
80)?null:(r&&t!==!1&&(this.pos+=r[0].length),r)},current:function(){return this.string.slice(this.start,this.pos)}};n.StringStream=kr;n.TextMarker=kt;di(kt);kt.prototype.clear=function(){var n,e,r,u,o,t,f,i,s,h;if(!this.explicitlyCleared){for(n=this.doc.cm,e=n&&!n.curOp,e&&ai(n),vt(this,"clear")&&(r=this.find(),r&&k(this,"clear",r.from,r.to)),u=null,o=null,i=0;i<this.lines.length;++i)t=this.lines[i],f=nu(t.markedSpans,this),f.to!=null&&(o=d(t)),t.markedSpans=sv(t.markedSpans,f),f.from!=null?u=d(t):this.collapsed&&!ri(this.doc,t)&&n&&rt(t,li(n.display));if(n&&this.collapsed&&!n.options.lineWrapping)for(i=0;i<this.lines.length;++i)s=lt(n.doc,this.lines[i]),h=bu(n.doc,s),h>n.display.maxLineLength&&(n.display.maxLine=s,n.display.maxLineLength=h,n.display.maxLineChanged=!0);u!=null&&n&&a(n,u,o+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,n&&dh(n));e&&vi(n)}};kt.prototype.find=function(){for(var r,n,u,i,e,f=0;f<this.lines.length;++f)r=this.lines[f],n=nu(r.markedSpans,this),(n.from!=null||n.to!=null)&&(u=d(r),n.from!=null&&(i=t(u,n.from)),n.to!=null&&(e=t(u,n.to)));return this.type=="bookmark"?i:i&&{from:i,to:e}};kt.prototype.changed=function(){var u=this.find(),n=this.doc.cm,i,t;if(u&&n&&(i=r(this.doc,u.from.line),va(n,i),u.from.line>=n.display.showingFrom&&u.from.line<n.display.showingTo)){for(t=n.display.lineDiv.firstChild;t;t=t.nextSibling)if(t.lineObj==i){t.offsetHeight!=i.height&&rt(i,t.offsetHeight);break}ro(n,function(){n.curOp.selectionChanged=n.curOp.forceUpdate=n.curOp.updateMaxLine=!0})}};kt.prototype.attachLine=function(n){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&yt(t.maybeHiddenMarkers,this)!=-1||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(n)};kt.prototype.detachLine=function(n){if(this.lines.splice(yt(this.lines,n),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};n.SharedTextMarker=gr;di(gr);gr.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var n=0;n<this.markers.length;++n)this.markers[n].clear();k(this,"clear")}};gr.prototype.find=function(){return this.primary.find()};lu=n.LineWidget=function(n,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.cm=n;this.node=t};di(lu);lu.prototype.clear=oc(function(){var n=this.line.widgets,i=d(this.line),t,r;if(i!=null&&n){for(t=0;t<n.length;++t)n[t]==this&&n.splice(t--,1);n.length||(this.line.widgets=null);r=ru(this.cm,this.line)<this.cm.doc.scrollTop;rt(this.line,Math.max(0,this.line.height-lf(this)));r&&so(this.cm,0,-this.height);a(this.cm,i,i+1)}});lu.prototype.changed=oc(function(){var i=this.height,n,t;(this.height=null,n=lf(this)-i,n)&&(rt(this.line,this.line.height+n),t=d(this.line),a(this.cm,t,t+1))});oi=n.Line=function(n,t,i){this.text=n;ec(this,t);this.height=i?i(this):1};di(oi);vs={};oe=/[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;af.prototype={chunkSize:function(){return this.lines.length},removeInner:function(n,t){for(var i,r=n,u=n+t;r<u;++r)i=this.lines[r],this.height-=i.height,pv(i),k(i,"delete");this.lines.splice(n,t)},collapse:function(n){n.splice.apply(n,[n.length,0].concat(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,u=t.length;r<u;++r)t[r].parent=this},iterN:function(n,t,i){for(var r=n+t;n<r;++n)if(i(this.lines[n]))return!0}};tu.prototype={chunkSize:function(){return this.size},removeInner:function(n,t){var r,i,u,f,o,e;for(this.size-=t,r=0;r<this.children.length;++r)if(i=this.children[r],u=i.chunkSize(),n<u){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),(t-=f)==0)break;n=0}else n-=u;this.size-t<25&&(e=[],this.collapse(e),this.children=[new af(e)],this.children[0].parent=this)},collapse:function(n){for(var t=0,i=this.children.length;t<i;++t)this.children[t].collapse(n)},insertInner:function(n,t,i){var u,o,r,e,s,f;for(this.size+=t.length,this.height+=i,u=0,o=this.children.length;u<o;++u){if(r=this.children[u],e=r.chunkSize(),n<=e){if(r.insertInner(n,t,i
8),r.lines&&r.lines.length>50){while(r.lines.length>50)s=r.lines.splice(r.lines.length-25,25),f=new af(s),r.height-=f.height,this.children.splice(u+1,0,f),f.parent=this;this.maybeSpill()}break}n-=e}},maybeSpill:function(){var n,r,t,i,u;if(!(this.children.length<=10)){n=this;do r=n.children.splice(n.children.length-5,5),t=new tu(r),n.parent?(n.size-=t.size,n.height-=t.height,u=yt(n.parent.children,n),n.parent.children.splice(u+1,0,t)):(i=new tu(n.children),i.parent=n,n.children=[i,t],n=i),t.parent=n.parent;while(n.children.length>10);n.parent.maybeSpill()}},iterN:function(n,t,i){for(var u,r,f,e=0,o=this.children.length;e<o;++e)if(u=this.children[e],r=u.chunkSize(),n<r){if(f=Math.min(t,r-n),u.iterN(n,f,i))return!0;if((t-=f)==0)break;n=0}else n-=r}};al=0;w=n.Doc=function(n,i,r){if(!(this instanceof w))return new w(n,i,r);r==null&&(r=0);tu.call(this,[new af([new oi("",null)])]);this.first=r;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.history=vf();this.cleanGeneration=1;this.frontier=r;var u=t(r,0);this.sel={from:u,to:u,head:u,anchor:u,shift:!1,extend:!1,goalColumn:null};this.id=++al;this.modeOption=i;typeof n=="string"&&(n=gt(n));wo(this,{from:u,to:u,text:n},null,{head:u,anchor:u})};w.prototype=rl(tu.prototype,{constructor:w,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,u=t.length;i<u;++i)r+=t[i].height;this.insertInner(n-this.first,t,r)},remove:function(n,t){this.removeInner(n-this.first,t)},getValue:function(n){var t=ko(this,this.first,this.first+this.size);return n===!1?t:t.join(n||"\n")},setValue:function(n){var i=t(this.first,0),u=this.first+this.size-1;pi(this,{from:i,to:t(u,r(this,u).text.length),text:gt(n),origin:"setValue"},{head:i,anchor:i},!0)},replaceRange:function(n,t,i,r){t=u(this,t);i=i?u(this,i):t;wt(this,n,t,i,r)},getRange:function(n,t,i){var r=bo(this,u(this,n),u(this,t));return i===!1?r:r.join(i||"\n")},getLine:function(n){var t=this.getLineHandle(n);return t&&t.text},setLine:function(n,i){wi(this,n)&&wt(this,i,t(n,0),u(this,t(n)))},removeLine:function(n){n?wt(this,"",u(this,t(n-1)),u(this,t(n))):wt(this,"",t(0,0),u(this,t(1,0)))},getLineHandle:function(n){if(wi(this,n))return r(this,n)},getLineNumber:function(n){return d(n)},getLineHandleVisualStart:function(n){return typeof n=="number"&&(n=r(this,n)),lt(this,n)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(n){return u(this,n)},getCursor:function(n){var t=this.sel,i;return i=n==null||n=="head"?t.head:n=="anchor"?t.anchor:n=="end"||n===!1?t.to:t.from,ii(i)},somethingSelected:function(){return!s(this.sel.head,this.sel.anchor)},setCursor:lr(function(n,i,r){var f=u(this,typeof n=="number"?t(n,i||0):n);r?y(this,f):bt(this,f,f)}),setSelection:lr(function(n,t){bt(this,u(this,n),u(this,t||n))}),extendSelection:lr(function(n,t){y(this,u(this,n),t&&u(this,t))}),getSelection:function(n){return this.getRange(this.sel.from,this.sel.to,n)},replaceSelection:function(n,t,i){pi(this,{from:this.sel.from,to:this.sel.to,text:gt(n),origin:i},t||"around")}
8,undo:lr(function(){wh(this,"undo")}),redo:lr(function(){wh(this,"redo")}),setExtending:function(n){this.sel.extend=n},historySize:function(){var n=this.history;return{undo:n.done.length,redo:n.undone.length}},clearHistory:function(){this.history=vf(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration()},changeGeneration:function(){return this.history.lastOp=this.history.lastOrigin=null,this.history.generation},isClean:function(n){return this.history.generation==(n||this.cleanGeneration)},getHistory:function(){return{done:yf(this.history.done),undone:yf(this.history.undone)}},setHistory:function(n){var t=this.history=vf(this.history.maxGeneration);t.done=n.done.slice(0);t.undone=n.undone.slice(0)},markText:function(n,t,i){return dr(this,u(this,n),u(this,t),i,"range")},setBookmark:function(n,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft};return n=u(this,n),dr(this,n,n,i,"bookmark")},findMarksAt:function(n){var e,i,f,t;if(n=u(this,n),e=[],i=r(this,n.line).markedSpans,i)for(f=0;f<i.length;++f)t=i[f],(t.from==null||t.from<=n.ch)&&(t.to==null||t.to>=n.ch)&&e.push(t.marker.parent||t.marker);return e},getAllMarks:function(){var n=[];return this.iter(function(t){var r=t.markedSpans,i;if(r)for(i=0;i<r.length;++i)r[i].from!=null&&n.push(r[i].marker)}),n},posFromIndex:function(n){var i,r=this.first;return this.iter(function(t){var u=t.text.length+1;if(u>n)return i=n,!0;n-=u;++r}),u(this,t(r,i))},indexFromPos:function(n){n=u(this,n);var t=n.ch;return n.line<this.first||n.ch<0?0:(this.iter(this.first,n.line,function(n){t+=n.text.length+1}),t)},copy:function(n){var t=new w(ko(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel={from:this.sel.from,to:this.sel.to,head:this.sel.head,anchor:this.sel.anchor,shift:this.sel.shift,extend:!1,goalColumn:this.sel.goalColumn},n&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(n){var t,r,i;return n||(n={}),t=this.first,r=this.first+this.size,n.from!=null&&n.from>t&&(t=n.from),n.to!=null&&n.to<r&&(r=n.to),i=new w(ko(this,t,r),n.mode||this.modeOption,t),n.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:n.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:n.sharedHist}],i},unlinkDoc:function(t){var i,u,r;if(t instanceof n&&(t=t.doc),this.linked)for(i=0;i<this.linked.length;++i)if(u=this.linked[i],u.doc==t){this.linked.splice(i,1);t.unlinkDoc(this);break}t.history==this.history&&(r=[t.id],ki(t,function(n){r.push(n.id)},!0),t.history=vf(),t.history.done=yf(this.history.done,r),t.history.undone=yf(this.history.undone,r))},iterLinkedDocs:function(n){ki(this,n)},getMode:function(){return this.mode},getEditor:function(){return this.cm}});w.prototype.eachLine=w.prototype.iter;vl="iter insert remove copy getEditor".split(" ");for(au in w.prototype)w.prototype.hasOwnProperty(au)&&yt(vl,au)<0&&(n.prototype[au]=function(n){return function(){return n.apply(this.doc,arguments)}}(w.prototype[au]));di(w);n.e_stop=fu;n.e_preventDefault=v;n.e_stopPropagation=gc;vu=0;n.on=e;n.off=at;n.signal=p;si=30;ys=n.Pass={toString:function(){return"CodeMirror.Pass"}};ts.prototype={set:function(n,t){clearTimeout(this.id);this.id=setTimeout(t,n)}};n.countColumn=gi;yu=[""];yl=/[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;se=/[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;n.replaceGetRect=function(n){c=n};pl=function(){if(g)return!1;var n=i("div");return"draggable"in n||"dragDrop"in n}();nr?kf=function(n,t){return n.charCodeAt(t-1)==36&&n.charCodeAt(t)==39}:os&&!/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent)?kf=function(n,t){return/\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(n.slice(t-1,t+1))}:nt&&!/Chrome\/(?:29|[3-9]\d|\d\d\d)\./.test(navigator.userAgent)&&(kf=function(n,t){if(t>
81&&n.charCodeAt(t-1)==45){if(/\w/.test(n.charAt(t-2))&&/[^\-?\.]/.test(n.charAt(t)))return!0;if(t>2&&/[\d\.,]/.test(n.charAt(t-2))&&/[\d\.,]/.test(n.charAt(t)))return!1}return/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|…[\w~`@#$%\^&*(_=+{[><]/.test(n.slice(t-1,t+1))});gt="\n\nb".split(/\n/).length!=3?function(n){for(var i=0,f=[],e=n.length,t,r,u;i<=e;)t=n.indexOf("\n",i),t==-1&&(t=n.length),r=n.slice(i,n.charAt(t-1)=="\r"?t-1:t),u=r.indexOf("\r"),u!=-1?(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/)};n.splitLines=gt;var ay=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?!1:t.compareEndPoints("StartToEnd",t)!=0},dl=function(){var n=i("div");return"oncopy"in n?!0:(n.setAttribute("oncopy","return;"),typeof n.oncopy=="function")}(),hi={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:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};return n.keyNames=hi,function(){for(var n=0;n<10;n++)hi[n+48]=String(n);for(n=65;n<=90;n++)hi[n]=String.fromCharCode(n);for(n=1;n<=12;n++)hi[n+111]=hi[n+63235]="F"+n}(),wl=function(){function f(n){return n<=255?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1791?o.charAt(n-1536):1792<=n&&n<=2220?"r":"L"}var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",o="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",s=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,u=/[1n]/,n="L";return function(e){var a,h,p,g,k,l,y,v,d,o,tt,w,nt,c,it;if(!s.test(e))return!1;for(a=e.length,h=[],o=0;o<a;++o)h.push(l=f(e.charCodeAt(o)));for(o=0,p=n;o<a;++o)l=h[o],l=="m"?h[o]=p:p=l;for(o=0,k=n;o<a;++o)l=h[o],l=="1"&&k=="r"?h[o]="n":i.test(l)&&(k=l,l=="r"&&(h[o]="R"));for(o=1,p=h[0];o<a-1;++o)l=h[o],l=="+"&&p=="1"&&h[o+1]=="1"?h[o]="1":l==","&&p==h[o+1]&&(p=="1"||p=="n")&&(h[o]=p),p=l;for(o=0;o<a;++o)if(l=h[o],l==",")h[o]="N";else if(l=="%"){for(y=o+1;y<a&&h[y]=="%";++y);for(g=o&&h[o-1]=="!"||y<a-1&&h[y]=="1"?"1":"N",c=o;c<y;++c)h[c]=g;o=y-1}for(o=0,k=n;o<a;++o)l=h[o],k=="L"&&l=="1"?h[o]="L":i.test(l)&&(k=l);for(o=0;o<a;++o)if(t.test(h[o])){for(y=o+1;y<a&&t.test(h[y]);++y);var rt=(o?h[o-1]:n)=="L",ut=(y<a-1?h[y]:n)=="L",g=rt||ut?"L":"R";for(c=o;c<y;++c)h[c]=g;o=y-1}for(v=[],o=0;o<a;)if(r.test(h[o])){for(tt=o,++o;o<a&&r.test(h[o]);++o);v.push({from:tt,to:o,level:0})}else{for(w=o,nt=v.length,++o;o<a&&h[o]!="L";++o);for(c=w;c<o;)if(u.test(h[c])){for(w<c&&v.splice(nt,0,{from:w,to:c,level:1}),it=c,++c;c<o&&u.test(h[c]);++c);v.splice(nt,0,{from:it,to:c,level:2});w=c}else++c;w<o&&v.splice(nt,0,{from:w,to:o,level:1})}return v[0].level==1&&(d=e.match(/^\s+/))&&(v[0].from=d[0].length,v.unshift({from:0,to:d[0].length,level:0})),b(v).level==1&&(d=e.match(/\s+$/))&&(b(v).to-=d[0].length,v.push({from:a-d[0].length,to:a,level:0})),v[0].level!=b(v).level&&v.push({from:a,to:a,level:v[0].level}),v}}(),n.version="3.15.0",n}(),p,w,b,h,it;const ft=/^(\s*)([*+-]|(\d+)\.)([\w+(\s+\w+)]|[\s*])/,et=/^(\s*)([*+-]|(\d+)\.)(\s*)$/,ot="*+-";p=function(n,t){return n.getStateAfter(t.line).list||null};w=function(n){var t=n.getCursor();return p(n,t)};i.commands.shiftTabAndIndentContinueMarkdownList=function(n){var t=w(n);if(t!==null){n.execCommand("insertTab");return}n.execCommand("indentLess")};i.commands.tabAndIndentContinueMarkdownList=function(n){var t=w(n);if(t!==null){n.execCommand("insertTab");return}n.execCommand("indentMore")};i.commands.newlineAndIndentContinueMarkdownList=function(n){var t,r,i,f,u,e,o;if(t=n.getCursor(),r=n.getTokenAt(t),f=n.getLine(t.line).match(et),u=p(n,t),!u&&f){n.replaceRange("",{line:t.line,ch:r.start},{line:t.line,ch:r.end});n.execCommand("delLineLeft");n.execCommand("newlineAndIndent");return}if(!u||!(i=n.getLine(t.line).match(ft))){n.execCommand("newlineAndIndent");return}e=i[1];o=ot.indexOf(i[2])>=0?i[2]:parseInt(i[3],10)+1+".";n.replaceSelection("\n"+e+o+" ","end")};i.defineMode("xml",function(n,t){function s(n,t){function i(i){return t.tokenize=i,i(n,t)}var r=n.next(),u,f,s;if(r=="<"){if(n.eat("!"))return n.eat("[")?n.match("CDATA[")?i(a("atom","]\]>")):null:n.match("--")?i(a("comment","-->")):n.match("DOCTYPE",!0,!0)?(n.eatWhile(/[\w\._\-]/),i(v(1))):null;if(n.eat("?"))return n.eatWhile(/[\w\._\-]/),t.tokenize=a("meta","?>"),"meta";
8for(u=n.eat("/"),e="";f=n.eat(/[^\s\u00a0=<>\"\'\/?]/);)e+=f;return e?(o=u?"closeTag":"openTag",t.tokenize=l,"tag"):"error"}return r=="&"?(s=n.eat("#")?n.eat("x")?n.eatWhile(/[a-fA-F\d]/)&&n.eat(";"):n.eatWhile(/[\d]/)&&n.eat(";"):n.eatWhile(/[\w\.\-:]/)&&n.eat(";"),s?"atom":"error"):(n.eatWhile(/[^&<]/),null)}function l(n,t){var i=n.next();return i==">"||i=="/"&&n.eat(">")?(t.tokenize=s,o=i==">"?"endTag":"selfcloseTag","tag"):i=="="?(o="equals",null):i=="<"?"error":/[\'\"]/.test(i)?(t.tokenize=d(i),t.stringStartCol=n.column(),t.tokenize(n,t)):(n.eatWhile(/[^\s\u00a0=<>\"\']/),"word")}function d(n){var t=function(t,i){while(!t.eol())if(t.next()==n){i.tokenize=l;break}return"string"};return t.isInAttribute=!0,t}function a(n,t){return function(i,r){while(!i.eol()){if(i.match(t)){r.tokenize=s;break}i.next()}return n}}function v(n){return function(t,i){for(var r;(r=t.next())!=null;){if(r=="<")return i.tokenize=v(n+1),i.tokenize(t,i);if(r==">")if(n==1){i.tokenize=s;break}else return i.tokenize=v(n-1),i.tokenize(t,i)}return"meta"}}function h(){for(var n=arguments.length-1;n>=0;n--)i.cc.push(arguments[n])}function r(){return h.apply(null,arguments),!0}function g(n,t){var r=f.doNotIndent.hasOwnProperty(n)||i.context&&i.context.noIndent;i.context={prev:i.context,tagName:n,indent:i.indented,startOfLine:t,noIndent:r}}function y(){i.context&&(i.context=i.context.prev)}function nt(n){if(n=="openTag")return i.tagName=e,i.tagStart=k.column(),r(c,tt(i.startOfLine));if(n=="closeTag"){var t=!1;return i.context?i.context.tagName!=e&&(f.implicitlyClosed.hasOwnProperty(i.context.tagName.toLowerCase())&&y(),t=!i.context||i.context.tagName!=e):t=!0,t&&(u="error"),r(it(t))}return r()}function tt(n){return function(t){var u=i.tagName;return(i.tagName=i.tagStart=null,t=="selfcloseTag"||t=="endTag"&&f.autoSelfClosers.hasOwnProperty(u.toLowerCase()))?(p(u.toLowerCase()),r()):t=="endTag"?(p(u.toLowerCase()),g(u,n),r()):r()}}function it(n){return function(t){return(n&&(u="error"),t=="endTag")?(y(),r()):(u="error",r(arguments.callee))}}function p(n){for(var t;;){if(!i.context)return;if(t=i.context.tagName.toLowerCase(),!f.contextGrabbers.hasOwnProperty(t)||!f.contextGrabbers[t].hasOwnProperty(n))return;y()}}function c(n){return n=="word"?(u="attribute",r(rt,c)):n=="endTag"||n=="selfcloseTag"?h():(u="error",r(c))}function rt(n){return n=="equals"?r(ut,c):(f.allowMissing?n=="word"&&(u="attribute"):u="error",n=="endTag"||n=="selfcloseTag"?h():r())}function ut(n){return n=="string"?r(w):n=="word"&&f.allowUnquoted?(u="string",r()):(u="error",n=="endTag"||n=="selfCloseTag"?h():r())}function w(n){return n=="string"?r(w):h()}var b=n.indentUnit,ft=t.multilineTagIndentFactor||1,et=t.multilineTagIndentPastTag||!0,f=t.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1},ot=t.alignCDATA,e,o,i,k,u;return{startState:function(){return{tokenize:s,cc:[],indented:0,startOfLine:!0,tagName:null,tagStart:null,context:null}},token:function(n,t){var r,f;if(!t.tagName&&n.sol()&&(t.startOfLine=!0,t.indented=n.indentation()),n.eatSpace())return null;if(u=o=e=null,r=t.tokenize(n,t),t.type=o,(r||o)&&r!="comment")for(i=t,k=n;;)if(f=t.cc.pop()||nt,f(o||r))break;return t.startOfLine=!1,u||r},indent:function(n,t,i){var r=n.context;
8if(n.tokenize.isInAttribute)return n.stringStartCol+1;if(n.tokenize!=l&&n.tokenize!=s||r&&r.noIndent)return i?i.match(/^(\s*)/)[0].length:0;if(n.tagName)return et?n.tagStart+n.tagName.length+2:n.tagStart+b*ft;if(ot&&/<!\[CDATA\[/.test(t))return 0;for(r&&/^<\//.test(t)&&(r=r.prev);r&&!r.startOfLine;)r=r.prev;return r?r.indent+b:0},electricChars:"/",blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:t.htmlMode?"html":"xml",helperType:t.htmlMode?"html":"xml"}});i.defineMIME("text/xml","xml");i.defineMIME("application/xml","xml");i.mimeModes.hasOwnProperty("text/html")||i.defineMIME("text/html",{name:"xml",htmlMode:!0});i.defineMode("markdown",function(n,t){function f(n,t,i){return t.f=t.inline=i,i(n,t)}function y(n,t,i){return t.f=t.block=i,i(n,t)}function p(n){return n.linkTitle=!1,n.em=!1,n.strong=!1,n.strike=!1,n.quote=0,l||n.f!=w||(n.f=u,n.block=e),n.trailingSpace=0,n.trailingSpaceNewLine=!1,n.thisLineHasContent=!1,null}function e(n,i){var r=i.list!==!1;if(i.list!==!1&&i.indentationDiff>=0?(i.indentationDiff<4&&(i.indentation-=i.indentationDiff),i.list=null):i.list!==!1&&i.indentation>0?(i.list=null,i.listDepth=Math.floor(i.indentation/4)):i.list!==!1&&(i.list=!1,i.listDepth=0),i.indentationDiff>=4)return i.indentation-=4,n.skipToEnd(),o;if(n.eatSpace())return null;if(n.peek()==="#"||i.prevLineHasContent&&n.match(ti))i.header=!0;else if(n.eat(">"))for(i.indentation++,i.quote=1,n.eatSpace();n.eat(">");)n.eatSpace(),i.quote++;else{if(n.peek()==="[")return f(n,i,it);if(n.match(dt,!0))return at;if((!i.prevLineHasContent||r)&&(n.match(gt,!0)||n.match(ni,!0)))i.indentation+=4,i.list=!0,i.listDepth++,t.taskLists&&n.match(g,!1)&&(i.taskList=!0);else if(t.fencedCodeBlocks&&n.match(/^```([\w+#]*)/,!0))return i.localMode=ft(RegExp.$1),i.localMode&&(i.localState=i.localMode.startState()),y(n,i,nt),o}return f(n,i,i.inline)}function w(n,t){var i=a.token(n,t.htmlState);return l&&i==="tag"&&t.htmlState.type!=="openTag"&&!t.htmlState.context&&(t.f=u,t.block=e),t.md_inside&&n.current().indexOf(">")!=-1&&(t.f=u,t.block=e,t.htmlState.context=undefined),i}function nt(n,t){return n.sol()&&n.match(/^```/,!0)?(t.localMode=t.localState=null,t.f=u,t.block=e,o):t.localMode?t.localMode.token(n,t.localState):(n.skipToEnd(),o)}function r(n){var t=[],i;return n.taskOpen?"meta":n.taskClosed?"property":(n.strong&&t.push(bt),n.strike&&t.push(kt),n.em&&t.push(wt),n.linkText&&t.push(d),n.code&&t.push(o),n.header&&t.push(et),n.quote&&t.push(n.quote%2?ot:st),n.list!==!1&&(i=(n.listDepth-1)%3,i?i===1?t.push(ct):t.push(lt):t.push(ht)),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 tt(n,t){return n.match(ii,!0)?r(t):undefined}function u(n,i){var p=i.text(n,i),d,u,e,nt,tt,s,it,rt,h,l,a,o;if(typeof p!="undefined")return p;if(i.list)return i.list=null,r(i);if(i.taskList)return d=n.match(g,!0)[1]!=="x",d?i.taskOpen=!0:i.taskClosed=!0,i.taskList=!1,r(i);if(i.taskOpen=!1,i.taskClosed=!1,u=n.next(),u==="\\")return n.next(),r(i);if(i.linkTitle&&(i.linkTitle=!1,e=u,u==="("&&(e=")"),e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),nt="^\\s*(?:[^"+e+"\\\\]+|\\\\\\\\|\\\\.)"+e,n.match(new RegExp(nt),!0)))return v;if(u==="`")return o=r(i),tt=n.pos,n.eatWhile("`"),s=1+n.pos-tt,i.code?s===k?(i.code=!1,o):r(i):(k=s,i.code=!0,r(i));if(i.code)return r(i);if(u==="!"&&n.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return n.match(/\[[^\]]*\]/),i.inline=i.f=b,vt;if(u==="["&&n.match(/.*\](\(| ?\[)/,!1))return i.linkText=!0,r(i);if(u==="]"&&i.linkText)return it=r(i),i.linkText=!1,i.inline=i.f=b,it;if(u==="<"&&n.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return f(n,i,c(yt,">"));if(u==="<"&&n.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return f(n,i,c(pt,">"));if(u==="<"&&n.match(/^\w/,!1))return n.string.indexOf(">")!=-1&&(rt=n.string.substring(1,n.string.indexOf(">")),/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(rt)&&(i.md_inside=!0)),n.backUp(1),y(n,i,w);if(u==="<"&&n.match(/^\/\w*?>/))return i.md_inside=!1,"tag";if(h=!1,t.underscoresBreakWords||u==="_"&&n.peek()!=="_"&&n.match(/(\w)/,!1)&&(l=n.pos-2,l>=0&&(a=n.string.charAt(l),a!=="_"&&a.match(/(\w)/,!1)&&(h=!0))),o=r(i),u!=="*"&&(u!=="_"||h)){if(u==="~"){if(i.strike===u&&n.eat(u))return i.strike=!1,o;if(!i.strike&&n.eat(u))return i.strike=u,r(i)}else if(u===" "&&(n.eat("*")||n.eat("_"))){if(n.peek()===" ")return r(i);n.backUp(1)}}else{if(i.strong===u&&n.eat(u)&&n.peek(u))return i.strong=!1,o;if(!i.strong&&n.eat(u)&&n.peek(u))return i.strong=u,r(i);if(i.em===u)return i.em=!1,o;if(!i.em)return i.em=u,r(i)}return u===" "&&(n.match(/ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),r(i)}function b(n,t){if(n.eatSpace())return null;var i=n.next();return i==="("||i==="["?f(n,t,c(v,i==="("?")":"]")):"error"}function it(n,t){return n.match(/^[^\]]*\]:/,!0)?(t.f=rt,d):f(n,t,u)}function rt(n,t){return n.eatSpace()?null:(n.match(/^[^\s]+/,!0),n.peek()===undefined?t.linkTitle=!0:n.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=u,v)}function ut(n){return h[n]||(n=(n+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),h[n]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+n+")")),h[n]}function c(n,t,i){return i=i||u,function(r,u){return r.match(ut(t)),u.inline=u.f=i,n}}var l=i.modes.hasOwnProperty("xml"),a=i.getMode(n,l?{name:"xml",htmlMode:!0}
8:"text/plain"),s={html:"htmlmixed",js:"javascript",json:"application/json",c:"text/x-csrc","c++":"text/x-c++src",java:"text/x-java",csharp:"text/x-csharp","c#":"text/x-csharp",scala:"text/x-scala"},ft=function(){var t,u={},h={},c,o=[],f,r,e;for(r in i.modes)i.modes.propertyIsEnumerable(r)&&o.push(r);for(t=0;t<o.length;t++)u[o[t]]=o[t];f=[];for(r in i.mimeModes)i.mimeModes.propertyIsEnumerable(r)&&f.push({mime:r,mode:i.mimeModes[r]});for(t=0;t<f.length;t++)c=f[t].mime,h[c]=f[t].mime;for(e in s)(s[e]in u||s[e]in h)&&(u[e]=s[e]);return function(t){return u[t]?i.getMode(n,u[t]):null}}(),h;t.underscoresBreakWords===undefined&&(t.underscoresBreakWords=!0);t.fencedCodeBlocks===undefined&&(t.fencedCodeBlocks=!1);t.taskLists===undefined&&(t.taskLists=!1);var k=0,et="header",o="comment",ot="atom",st="number",ht="variable-2",ct="variable-3",lt="keyword",at="hr",vt="tag",yt="link",pt="link",d="link",v="string",wt="em",bt="strong",kt="strike",dt=/^([*\-=_])(?:\s*\1){4,}\s*$/,gt=/^[*\-+]\s+/,ni=/^[0-9]+\.\s+/,g=/^\[(x| )\](?=\s)/,ti=/^(?:\={1,}|-{1,})$/,ii=/^[^!\[\]*_~\\<>` "'(]+/;return h=[],{startState:function(){return{f:e,prevLineHasContent:!1,thisLineHasContent:!1,block:e,htmlState:i.startState(a),indentation:0,inline:u,text:tt,linkText:!1,linkTitle:!1,em:!1,strong:!1,strike:!1,header:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1}},copyState:function(n){return{f:n.f,prevLineHasContent:n.prevLineHasContent,thisLineHasContent:n.thisLineHasContent,block:n.block,htmlState:i.copyState(a,n.htmlState),indentation:n.indentation,localMode:n.localMode,localState:n.localMode?i.copyState(n.localMode,n.localState):null,inline:n.inline,text:n.text,linkTitle:n.linkTitle,em:n.em,strong:n.strong,strike:n.strike,header:n.header,taskList:n.taskList,list:n.list,listDepth:n.listDepth,quote:n.quote,trailingSpace:n.trailingSpace,trailingSpaceNewLine:n.trailingSpaceNewLine,md_inside:n.md_inside}},token:function(n,t){var r,i,u;if(n.sol()){if(n.match(/^\s*$/,!0))return t.prevLineHasContent=!1,p(t);if(t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.header=!1,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block,r=n.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length,i=Math.floor((r-t.indentation)/4)*4,i>4&&(i=4),u=t.indentation+i,t.indentationDiff=u-t.indentation,t.indentation=u,r>0)return null}return t.f(n,t)},blankLine:p,getType:r}},"xml");i.defineMIME("text/x-markdown","markdown");b=/Mac/.test(navigator.platform);h={"Cmd-B":u,"Cmd-I":f,"Cmd-K":l,"Cmd-Alt-I":a,"Cmd-'":e,"Cmd-Alt-L":s,"Cmd-L":o};it=[{name:"bold",action:u},{name:"italic",action:f},"|",{name:"quote",action:e},{name:"unordered-list",action:o},{name:"ordered-list",action:s},"|",{name:"info",action:"http://lab.lepture.com/editor/markdown"},{name:"preview",action:v},{name:"fullscreen",action:c}];t.toolbar=it;t.markdown=function(n){if(window.marked)return marked(n)};t.prototype.render=function(n){var r;if(n||(n=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==n){this.element=n;var u=this.options,f=this,t={};for(r in h)(function(n){t[k(n)]=function(){h[n](f)}})(r);t.Enter="newlineAndIndentContinueMarkdownList";t.Tab="tabAndIndentContinueMarkdownList";t["Shift-Tab"]="shiftTabAndIndentContinueMarkdownList";this.codemirror=i.fromTextArea(n,{mode:"markdown",theme:"paper",tabSize:"2",indentWithTabs:!0,lineNumbers:!1,autofocus:!0,extraKeys:t});u.toolbar!==!1&&this.createToolbar();u.status!==!1&&this.createStatusbar();this._rendered=this.element}};t.prototype.createToolbar=function(n){var i,t,u,f,e;if(n=n||this.options.toolbar,n&&n.length!==0){for(i=document.createElement("div"),i.className="editor-toolbar",t=this,t.toolbar={},u=0;u<n.length;u++)(function(n){var r;r=n.name?d(n.name,n):n==="|"?rt():d(n);n.action&&(typeof n.action=="function"?r.onclick=function(){n.action(t)}:typeof n.action=="string"&&(r.href=n.action,r.target="_blank"));t.toolbar[n.name||n]=r;i.appendChild(r)})(n[u]);f=this.codemirror;f.on("cursorActivity",function(){var i=r(f),n;for(n in t.toolbar)(function(n){var r=t.toolbar[n];i[n]?r.className+=" active":r.className=r.className.replace(/\s*active\s*/g,"")})(n)});return e=f.getWrapperElement(),e.parentNode.insertBefore(i,e),i}};t.prototype.createStatusbar=function(n){var i,u,t,r,f;if(n=n||this.options.status,n&&n.length!==0){for(i=document.createElement("div"),i.className="editor-statusbar",t=this.codemirror,r=0;r<n.length;r++)(function(n){var r=document.createElement("span");if(r.className=n,n==="words"){r.innerHTML="0";t.on("update",function(){r.innerHTML=ut(t.getValue())})}else if(n==="lines"){r.innerHTML="0";t.on("update",function(){r.innerHTML=t.lineCount()})}else if(n==="cursor"){r.innerHTML="0:0";t.on("cursorActivity",function(){u=t.getCursor();r.innerHTML=u.line+":"+u.ch})}i.appendChild(r)})(n[r]);return f=this.codemirror.getWrapperElement(),f.parentNode.insertBefore(i,f.nextSibling),i}};t.prototype.value=function(n){return n?(this.codemirror.getDoc().setValue(n),this):this.codemirror.getValue()};t.toggleBold=u;t.toggleItalic=f;t.toggleBlockquote=e;t.toggleUnOrderedList=o;t.toggleOrderedList=s;t.drawLink=l;t.drawImage=a;t.undo=g;t.redo=nt;t.togglePreview=v;t.toggleFullScreen=c;t.prototype.toggleBold=function(){u(this)};t.prototype.toggleItalic=function(){f(this)};t.prototype.toggleBlockquote=function(){e(this)};t.prototype.toggleUnOrderedList=function(){o(this)};t.prototype.toggleOrderedList=function(){s(this)};t.prototype.drawLink=function(){l(this)};t.prototype.drawImage=function(){a(this)};t.prototype.undo=function(){g(this)};t.prototype.redo=function(){nt(this)};t.prototype.togglePreview=function(){v(this)};t.prototype.toggleFullScreen=function(){c(this)};n.Editor=t})(this);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.