/i.test(ae[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(ae[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ae[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:ae[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:ae[0]}}link(ie){const ae=this.rules.inline.link.exec(ie);if(ae){const oe=ae[2].trim();if(!this.options.pedantic&&/^$/.test(oe))return;const pe=rtrim$1(oe.slice(0,-1),"\\");if((oe.length-pe.length)%2===0)return}else{const pe=findClosingBracket$1(ae[2],"()");if(pe>-1){const Ce=(ae[0].indexOf("!")===0?5:4)+ae[1].length+pe;ae[2]=ae[2].substring(0,pe),ae[0]=ae[0].substring(0,Ce).trim(),ae[3]=""}}let ue=ae[2],de="";if(this.options.pedantic){const pe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ue);pe&&(ue=pe[1],de=pe[3])}else de=ae[3]?ae[3].slice(1,-1):"";return ue=ue.trim(),/^$/.test(oe)?ue=ue.slice(1):ue=ue.slice(1,-1)),outputLink$1(ae,{href:ue&&ue.replace(this.rules.inline.anyPunctuation,"$1"),title:de&&de.replace(this.rules.inline.anyPunctuation,"$1")},ae[0],this.lexer)}}reflink(ie,ae){let oe;if((oe=this.rules.inline.reflink.exec(ie))||(oe=this.rules.inline.nolink.exec(ie))){const ue=(oe[2]||oe[1]).replace(/\s+/g," "),de=ae[ue.toLowerCase()];if(!de){const pe=oe[0].charAt(0);return{type:"text",raw:pe,text:pe}}return outputLink$1(oe,de,oe[0],this.lexer)}}emStrong(ie,ae,oe=""){let ue=this.rules.inline.emStrongLDelim.exec(ie);if(!ue||ue[3]&&oe.match(/[\p{L}\p{N}]/u))return;if(!(ue[1]||ue[2]||"")||!oe||this.rules.inline.punctuation.exec(oe)){const pe=[...ue[0]].length-1;let _e,Ce,Ne=pe,Oe=0;const Ie=ue[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(Ie.lastIndex=0,ae=ae.slice(-1*ie.length+pe);(ue=Ie.exec(ae))!=null;){if(_e=ue[1]||ue[2]||ue[3]||ue[4]||ue[5]||ue[6],!_e)continue;if(Ce=[..._e].length,ue[3]||ue[4]){Ne+=Ce;continue}else if((ue[5]||ue[6])&&pe%3&&!((pe+Ce)%3)){Oe+=Ce;continue}if(Ne-=Ce,Ne>0)continue;Ce=Math.min(Ce,Ce+Ne+Oe);const Fe=[...ue[0]][0].length,Ue=ie.slice(0,pe+ue.index+Fe+Ce);if(Math.min(pe,Ce)%2){const ze=Ue.slice(1,-1);return{type:"em",raw:Ue,text:ze,tokens:this.lexer.inlineTokens(ze)}}const Ve=Ue.slice(2,-2);return{type:"strong",raw:Ue,text:Ve,tokens:this.lexer.inlineTokens(Ve)}}}}codespan(ie){const ae=this.rules.inline.code.exec(ie);if(ae){let oe=ae[2].replace(/\n/g," ");const ue=/[^ ]/.test(oe),de=/^ /.test(oe)&&/ $/.test(oe);return ue&&de&&(oe=oe.substring(1,oe.length-1)),oe=escape$1$2(oe,!0),{type:"codespan",raw:ae[0],text:oe}}}br(ie){const ae=this.rules.inline.br.exec(ie);if(ae)return{type:"br",raw:ae[0]}}del(ie){const ae=this.rules.inline.del.exec(ie);if(ae)return{type:"del",raw:ae[0],text:ae[2],tokens:this.lexer.inlineTokens(ae[2])}}autolink(ie){const ae=this.rules.inline.autolink.exec(ie);if(ae){let oe,ue;return ae[2]==="@"?(oe=escape$1$2(ae[1]),ue="mailto:"+oe):(oe=escape$1$2(ae[1]),ue=oe),{type:"link",raw:ae[0],text:oe,href:ue,tokens:[{type:"text",raw:oe,text:oe}]}}}url(ie){var oe;let ae;if(ae=this.rules.inline.url.exec(ie)){let ue,de;if(ae[2]==="@")ue=escape$1$2(ae[0]),de="mailto:"+ue;else{let pe;do pe=ae[0],ae[0]=((oe=this.rules.inline._backpedal.exec(ae[0]))==null?void 0:oe[0])??"";while(pe!==ae[0]);ue=escape$1$2(ae[0]),ae[1]==="www."?de="http://"+ae[0]:de=ae[0]}return{type:"link",raw:ae[0],text:ue,href:de,tokens:[{type:"text",raw:ue,text:ue}]}}}inlineText(ie){const ae=this.rules.inline.text.exec(ie);if(ae){let oe;return this.lexer.state.inRawBlock?oe=ae[0]:oe=escape$1$2(ae[0]),{type:"text",raw:ae[0],text:oe}}}};const newline$1=/^(?: *(?:\n|$))+/,blockCode$1=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences$1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr$1=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading$1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bullet$3=/(?:[*+-]|\d{1,9}[.)])/,lheading$1=edit$1(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,bullet$3).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),_paragraph$1=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,blockText$1=/^[^\n]+/,_blockLabel$1=/(?!\s*\])(?:\\.|[^\[\]\\])+/,def$1=edit$1(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",_blockLabel$1).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),list$1=edit$1(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bullet$3).getRegex(),_tag$1="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",_comment$1=/|$))/,html$3=edit$1("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",_comment$1).replace("tag",_tag$1).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),paragraph$1=edit$1(_paragraph$1).replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag$1).getRegex(),blockquote$1=edit$1(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",paragraph$1).getRegex(),blockNormal$1={blockquote:blockquote$1,code:blockCode$1,def:def$1,fences:fences$1,heading:heading$1,hr:hr$1,html:html$3,lheading:lheading$1,list:list$1,newline:newline$1,paragraph:paragraph$1,table:noopTest$1,text:blockText$1},gfmTable$1=edit$1("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag$1).getRegex(),blockGfm$1={...blockNormal$1,table:gfmTable$1,paragraph:edit$1(_paragraph$1).replace("hr",hr$1).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gfmTable$1).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",_tag$1).getRegex()},blockPedantic$1={...blockNormal$1,html:edit$1(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| \\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_comment$1).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:noopTest$1,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:edit$1(_paragraph$1).replace("hr",hr$1).replace("heading",` *#{1,6} *[^
+]`).replace("lheading",lheading$1).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},escape$5=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,inlineCode$1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br$1=/^( {2,}|\\)\n(?!\s*$)/,inlineText$1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,emStrongLDelim$1=edit$1(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,_punctuation$1).getRegex(),emStrongRDelimAst$1=edit$1("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,_punctuation$1).getRegex(),emStrongRDelimUnd$1=edit$1("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,_punctuation$1).getRegex(),anyPunctuation$1=edit$1(/\\([punct])/,"gu").replace(/punct/g,_punctuation$1).getRegex(),autolink$1=edit$1(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),_inlineComment$1=edit$1(_comment$1).replace("(?:-->|$)","-->").getRegex(),tag$1=edit$1("^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",_inlineComment$1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),_inlineLabel$1=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,link$1=edit$1(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",_inlineLabel$1).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),reflink$1=edit$1(/^!?\[(label)\]\[(ref)\]/).replace("label",_inlineLabel$1).replace("ref",_blockLabel$1).getRegex(),nolink$1=edit$1(/^!?\[(ref)\](?:\[\])?/).replace("ref",_blockLabel$1).getRegex(),reflinkSearch$1=edit$1("reflink|nolink(?!\\()","g").replace("reflink",reflink$1).replace("nolink",nolink$1).getRegex(),inlineNormal$1={_backpedal:noopTest$1,anyPunctuation:anyPunctuation$1,autolink:autolink$1,blockSkip:blockSkip$1,br:br$1,code:inlineCode$1,del:noopTest$1,emStrongLDelim:emStrongLDelim$1,emStrongRDelimAst:emStrongRDelimAst$1,emStrongRDelimUnd:emStrongRDelimUnd$1,escape:escape$5,link:link$1,nolink:nolink$1,punctuation:punctuation$1,reflink:reflink$1,reflinkSearch:reflinkSearch$1,tag:tag$1,text:inlineText$1,url:noopTest$1},inlinePedantic$1={...inlineNormal$1,link:edit$1(/^!?\[(label)\]\((.*?)\)/).replace("label",_inlineLabel$1).getRegex(),reflink:edit$1(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",_inlineLabel$1).getRegex()},inlineGfm$1={...inlineNormal$1,escape:edit$1(escape$5).replace("])","~|])").getRegex(),url:edit$1(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\Ce+" ".repeat(Ne.length));let ue,de,pe;for(;ie;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(_e=>(ue=_e.call({lexer:this},ie,ae))?(ie=ie.substring(ue.raw.length),ae.push(ue),!0):!1))){if(ue=this.tokenizer.space(ie)){ie=ie.substring(ue.raw.length),ue.raw.length===1&&ae.length>0?ae[ae.length-1].raw+=`
+`:ae.push(ue);continue}if(ue=this.tokenizer.code(ie)){ie=ie.substring(ue.raw.length),de=ae[ae.length-1],de&&(de.type==="paragraph"||de.type==="text")?(de.raw+=`
+`+ue.raw,de.text+=`
+`+ue.text,this.inlineQueue[this.inlineQueue.length-1].src=de.text):ae.push(ue);continue}if(ue=this.tokenizer.fences(ie)){ie=ie.substring(ue.raw.length),ae.push(ue);continue}if(ue=this.tokenizer.heading(ie)){ie=ie.substring(ue.raw.length),ae.push(ue);continue}if(ue=this.tokenizer.hr(ie)){ie=ie.substring(ue.raw.length),ae.push(ue);continue}if(ue=this.tokenizer.blockquote(ie)){ie=ie.substring(ue.raw.length),ae.push(ue);continue}if(ue=this.tokenizer.list(ie)){ie=ie.substring(ue.raw.length),ae.push(ue);continue}if(ue=this.tokenizer.html(ie)){ie=ie.substring(ue.raw.length),ae.push(ue);continue}if(ue=this.tokenizer.def(ie)){ie=ie.substring(ue.raw.length),de=ae[ae.length-1],de&&(de.type==="paragraph"||de.type==="text")?(de.raw+=`
+`+ue.raw,de.text+=`
+`+ue.raw,this.inlineQueue[this.inlineQueue.length-1].src=de.text):this.tokens.links[ue.tag]||(this.tokens.links[ue.tag]={href:ue.href,title:ue.title});continue}if(ue=this.tokenizer.table(ie)){ie=ie.substring(ue.raw.length),ae.push(ue);continue}if(ue=this.tokenizer.lheading(ie)){ie=ie.substring(ue.raw.length),ae.push(ue);continue}if(pe=ie,this.options.extensions&&this.options.extensions.startBlock){let _e=1/0;const Ce=ie.slice(1);let Ne;this.options.extensions.startBlock.forEach(Oe=>{Ne=Oe.call({lexer:this},Ce),typeof Ne=="number"&&Ne>=0&&(_e=Math.min(_e,Ne))}),_e<1/0&&_e>=0&&(pe=ie.substring(0,_e+1))}if(this.state.top&&(ue=this.tokenizer.paragraph(pe))){de=ae[ae.length-1],oe&&(de==null?void 0:de.type)==="paragraph"?(de.raw+=`
+`+ue.raw,de.text+=`
+`+ue.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=de.text):ae.push(ue),oe=pe.length!==ie.length,ie=ie.substring(ue.raw.length);continue}if(ue=this.tokenizer.text(ie)){ie=ie.substring(ue.raw.length),de=ae[ae.length-1],de&&de.type==="text"?(de.raw+=`
+`+ue.raw,de.text+=`
+`+ue.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=de.text):ae.push(ue);continue}if(ie){const _e="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(_e);break}else throw new Error(_e)}}return this.state.top=!0,ae}inline(ie,ae=[]){return this.inlineQueue.push({src:ie,tokens:ae}),ae}inlineTokens(ie,ae=[]){let oe,ue,de,pe=ie,_e,Ce,Ne;if(this.tokens.links){const Oe=Object.keys(this.tokens.links);if(Oe.length>0)for(;(_e=this.tokenizer.rules.inline.reflinkSearch.exec(pe))!=null;)Oe.includes(_e[0].slice(_e[0].lastIndexOf("[")+1,-1))&&(pe=pe.slice(0,_e.index)+"["+"a".repeat(_e[0].length-2)+"]"+pe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(_e=this.tokenizer.rules.inline.blockSkip.exec(pe))!=null;)pe=pe.slice(0,_e.index)+"["+"a".repeat(_e[0].length-2)+"]"+pe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(_e=this.tokenizer.rules.inline.anyPunctuation.exec(pe))!=null;)pe=pe.slice(0,_e.index)+"++"+pe.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;ie;)if(Ce||(Ne=""),Ce=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(Oe=>(oe=Oe.call({lexer:this},ie,ae))?(ie=ie.substring(oe.raw.length),ae.push(oe),!0):!1))){if(oe=this.tokenizer.escape(ie)){ie=ie.substring(oe.raw.length),ae.push(oe);continue}if(oe=this.tokenizer.tag(ie)){ie=ie.substring(oe.raw.length),ue=ae[ae.length-1],ue&&oe.type==="text"&&ue.type==="text"?(ue.raw+=oe.raw,ue.text+=oe.text):ae.push(oe);continue}if(oe=this.tokenizer.link(ie)){ie=ie.substring(oe.raw.length),ae.push(oe);continue}if(oe=this.tokenizer.reflink(ie,this.tokens.links)){ie=ie.substring(oe.raw.length),ue=ae[ae.length-1],ue&&oe.type==="text"&&ue.type==="text"?(ue.raw+=oe.raw,ue.text+=oe.text):ae.push(oe);continue}if(oe=this.tokenizer.emStrong(ie,pe,Ne)){ie=ie.substring(oe.raw.length),ae.push(oe);continue}if(oe=this.tokenizer.codespan(ie)){ie=ie.substring(oe.raw.length),ae.push(oe);continue}if(oe=this.tokenizer.br(ie)){ie=ie.substring(oe.raw.length),ae.push(oe);continue}if(oe=this.tokenizer.del(ie)){ie=ie.substring(oe.raw.length),ae.push(oe);continue}if(oe=this.tokenizer.autolink(ie)){ie=ie.substring(oe.raw.length),ae.push(oe);continue}if(!this.state.inLink&&(oe=this.tokenizer.url(ie))){ie=ie.substring(oe.raw.length),ae.push(oe);continue}if(de=ie,this.options.extensions&&this.options.extensions.startInline){let Oe=1/0;const Ie=ie.slice(1);let Fe;this.options.extensions.startInline.forEach(Ue=>{Fe=Ue.call({lexer:this},Ie),typeof Fe=="number"&&Fe>=0&&(Oe=Math.min(Oe,Fe))}),Oe<1/0&&Oe>=0&&(de=ie.substring(0,Oe+1))}if(oe=this.tokenizer.inlineText(de)){ie=ie.substring(oe.raw.length),oe.raw.slice(-1)!=="_"&&(Ne=oe.raw.slice(-1)),Ce=!0,ue=ae[ae.length-1],ue&&ue.type==="text"?(ue.raw+=oe.raw,ue.text+=oe.text):ae.push(oe);continue}if(ie){const Oe="Infinite loop on byte: "+ie.charCodeAt(0);if(this.options.silent){console.error(Oe);break}else throw new Error(Oe)}}return ae}},_Renderer$1=class{constructor(ie){Hu(this,"options");Hu(this,"parser");this.options=ie||_defaults$1}space(ie){return""}code({text:ie,lang:ae,escaped:oe}){var pe;const ue=(pe=(ae||"").match(/^\S*/))==null?void 0:pe[0],de=ie.replace(/\n$/,"")+`
+`;return ue?''+(oe?de:escape$1$2(de,!0))+`
+`:""+(oe?de:escape$1$2(de,!0))+`
+`}blockquote({tokens:ie}){return`
+${this.parser.parse(ie)}
+`}html({text:ie}){return ie}heading({tokens:ie,depth:ae}){return`${this.parser.parseInline(ie)}
+`}hr(ie){return`
+`}list(ie){const ae=ie.ordered,oe=ie.start;let ue="";for(let _e=0;_e
+`+ue+""+de+`>
+`}listitem(ie){let ae="";if(ie.task){const oe=this.checkbox({checked:!!ie.checked});ie.loose?ie.tokens.length>0&&ie.tokens[0].type==="paragraph"?(ie.tokens[0].text=oe+" "+ie.tokens[0].text,ie.tokens[0].tokens&&ie.tokens[0].tokens.length>0&&ie.tokens[0].tokens[0].type==="text"&&(ie.tokens[0].tokens[0].text=oe+" "+ie.tokens[0].tokens[0].text)):ie.tokens.unshift({type:"text",raw:oe+" ",text:oe+" "}):ae+=oe+" "}return ae+=this.parser.parse(ie.tokens,!!ie.loose),`${ae}
+`}checkbox({checked:ie}){return" '}paragraph({tokens:ie}){return`${this.parser.parseInline(ie)}
+`}table(ie){let ae="",oe="";for(let de=0;de${ue}`),`
+`}tablerow({text:ie}){return`
+${ie}
+`}tablecell(ie){const ae=this.parser.parseInline(ie.tokens),oe=ie.header?"th":"td";return(ie.align?`<${oe} align="${ie.align}">`:`<${oe}>`)+ae+`${oe}>
+`}strong({tokens:ie}){return`${this.parser.parseInline(ie)} `}em({tokens:ie}){return`${this.parser.parseInline(ie)} `}codespan({text:ie}){return`${ie}
`}br(ie){return" "}del({tokens:ie}){return`${this.parser.parseInline(ie)}`}link({href:ie,title:ae,tokens:oe}){const ue=this.parser.parseInline(oe),de=cleanUrl$1(ie);if(de===null)return ue;ie=de;let pe='"+ue+" ",pe}image({href:ie,title:ae,text:oe}){const ue=cleanUrl$1(ie);if(ue===null)return oe;ie=ue;let de=` ",de}text(ie){return"tokens"in ie&&ie.tokens?this.parser.parseInline(ie.tokens):ie.text}},_TextRenderer$1=class{strong({text:ie}){return ie}em({text:ie}){return ie}codespan({text:ie}){return ie}del({text:ie}){return ie}html({text:ie}){return ie}text({text:ie}){return ie}link({text:ie}){return""+ie}image({text:ie}){return""+ie}br(){return""}},_Parser$1=class bg{constructor(ie){Hu(this,"options");Hu(this,"renderer");Hu(this,"textRenderer");this.options=ie||_defaults$1,this.options.renderer=this.options.renderer||new _Renderer$1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _TextRenderer$1}static parse(ie,ae){return new bg(ae).parse(ie)}static parseInline(ie,ae){return new bg(ae).parseInline(ie)}parse(ie,ae=!0){let oe="";for(let ue=0;ue{const Ne=_e[Ce].flat(1/0);oe=oe.concat(this.walkTokens(Ne,ae))}):_e.tokens&&(oe=oe.concat(this.walkTokens(_e.tokens,ae)))}}return oe}use(...ie){const ae=this.defaults.extensions||{renderers:{},childTokens:{}};return ie.forEach(oe=>{const ue={...oe};if(ue.async=this.defaults.async||ue.async||!1,oe.extensions&&(oe.extensions.forEach(de=>{if(!de.name)throw new Error("extension name required");if("renderer"in de){const pe=ae.renderers[de.name];pe?ae.renderers[de.name]=function(..._e){let Ce=de.renderer.apply(this,_e);return Ce===!1&&(Ce=pe.apply(this,_e)),Ce}:ae.renderers[de.name]=de.renderer}if("tokenizer"in de){if(!de.level||de.level!=="block"&&de.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const pe=ae[de.level];pe?pe.unshift(de.tokenizer):ae[de.level]=[de.tokenizer],de.start&&(de.level==="block"?ae.startBlock?ae.startBlock.push(de.start):ae.startBlock=[de.start]:de.level==="inline"&&(ae.startInline?ae.startInline.push(de.start):ae.startInline=[de.start]))}"childTokens"in de&&de.childTokens&&(ae.childTokens[de.name]=de.childTokens)}),ue.extensions=ae),oe.renderer){const de=this.defaults.renderer||new _Renderer$1(this.defaults);for(const pe in oe.renderer){if(!(pe in de))throw new Error(`renderer '${pe}' does not exist`);if(["options","parser"].includes(pe))continue;const _e=pe,Ce=oe.renderer[_e],Ne=de[_e];de[_e]=(...Oe)=>{let Ie=Ce.apply(de,Oe);return Ie===!1&&(Ie=Ne.apply(de,Oe)),Ie||""}}ue.renderer=de}if(oe.tokenizer){const de=this.defaults.tokenizer||new _Tokenizer$1(this.defaults);for(const pe in oe.tokenizer){if(!(pe in de))throw new Error(`tokenizer '${pe}' does not exist`);if(["options","rules","lexer"].includes(pe))continue;const _e=pe,Ce=oe.tokenizer[_e],Ne=de[_e];de[_e]=(...Oe)=>{let Ie=Ce.apply(de,Oe);return Ie===!1&&(Ie=Ne.apply(de,Oe)),Ie}}ue.tokenizer=de}if(oe.hooks){const de=this.defaults.hooks||new _Hooks$1;for(const pe in oe.hooks){if(!(pe in de))throw new Error(`hook '${pe}' does not exist`);if(["options","block"].includes(pe))continue;const _e=pe,Ce=oe.hooks[_e],Ne=de[_e];_Hooks$1.passThroughHooks.has(pe)?de[_e]=Oe=>{if(this.defaults.async)return Promise.resolve(Ce.call(de,Oe)).then(Fe=>Ne.call(de,Fe));const Ie=Ce.call(de,Oe);return Ne.call(de,Ie)}:de[_e]=(...Oe)=>{let Ie=Ce.apply(de,Oe);return Ie===!1&&(Ie=Ne.apply(de,Oe)),Ie}}ue.hooks=de}if(oe.walkTokens){const de=this.defaults.walkTokens,pe=oe.walkTokens;ue.walkTokens=function(_e){let Ce=[];return Ce.push(pe.call(this,_e)),de&&(Ce=Ce.concat(de.call(this,_e))),Ce}}this.defaults={...this.defaults,...ue}}),this}setOptions(ie){return this.defaults={...this.defaults,...ie},this}lexer(ie,ae){return _Lexer$1.lex(ie,ae??this.defaults)}parser(ie,ae){return _Parser$1.parse(ie,ae??this.defaults)}parseMarkdown(ie){return(oe,ue)=>{const de={...ue},pe={...this.defaults,...de},_e=this.onError(!!pe.silent,!!pe.async);if(this.defaults.async===!0&&de.async===!1)return _e(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof oe>"u"||oe===null)return _e(new Error("marked(): input parameter is undefined or null"));if(typeof oe!="string")return _e(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(oe)+", string expected"));pe.hooks&&(pe.hooks.options=pe,pe.hooks.block=ie);const Ce=pe.hooks?pe.hooks.provideLexer():ie?_Lexer$1.lex:_Lexer$1.lexInline,Ne=pe.hooks?pe.hooks.provideParser():ie?_Parser$1.parse:_Parser$1.parseInline;if(pe.async)return Promise.resolve(pe.hooks?pe.hooks.preprocess(oe):oe).then(Oe=>Ce(Oe,pe)).then(Oe=>pe.hooks?pe.hooks.processAllTokens(Oe):Oe).then(Oe=>pe.walkTokens?Promise.all(this.walkTokens(Oe,pe.walkTokens)).then(()=>Oe):Oe).then(Oe=>Ne(Oe,pe)).then(Oe=>pe.hooks?pe.hooks.postprocess(Oe):Oe).catch(_e);try{pe.hooks&&(oe=pe.hooks.preprocess(oe));let Oe=Ce(oe,pe);pe.hooks&&(Oe=pe.hooks.processAllTokens(Oe)),pe.walkTokens&&this.walkTokens(Oe,pe.walkTokens);let Ie=Ne(Oe,pe);return pe.hooks&&(Ie=pe.hooks.postprocess(Ie)),Ie}catch(Oe){return _e(Oe)}}}onError(ie,ae){return oe=>{if(oe.message+=`
+Please report this to https://github.com/markedjs/marked.`,ie){const ue="An error occurred:
"+escape$1$2(oe.message+"",!0)+" ";return ae?Promise.resolve(ue):ue}if(ae)return Promise.reject(oe);throw oe}}};const markedInstance$1=new Marked$1;function marked$1(re,ie){return markedInstance$1.parse(re,ie)}marked$1.options=marked$1.setOptions=function(re){return markedInstance$1.setOptions(re),marked$1.defaults=markedInstance$1.defaults,changeDefaults$1(marked$1.defaults),marked$1};marked$1.getDefaults=_getDefaults$1;marked$1.defaults=_defaults$1;marked$1.use=function(...re){return markedInstance$1.use(...re),marked$1.defaults=markedInstance$1.defaults,changeDefaults$1(marked$1.defaults),marked$1};marked$1.walkTokens=function(re,ie){return markedInstance$1.walkTokens(re,ie)};marked$1.parseInline=markedInstance$1.parseInline;marked$1.Parser=_Parser$1;marked$1.parser=_Parser$1.parse;marked$1.Renderer=_Renderer$1;marked$1.TextRenderer=_TextRenderer$1;marked$1.Lexer=_Lexer$1;marked$1.lexer=_Lexer$1.lex;marked$1.Tokenizer=_Tokenizer$1;marked$1.Hooks=_Hooks$1;marked$1.parse=marked$1;marked$1.options;marked$1.setOptions;marked$1.use;marked$1.walkTokens;marked$1.parseInline;_Parser$1.parse;_Lexer$1.lex;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(re){return re&&re.__esModule&&Object.prototype.hasOwnProperty.call(re,"default")?re.default:re}function getAugmentedNamespace(re){if(re.__esModule)return re;var ie=re.default;if(typeof ie=="function"){var ae=function oe(){return this instanceof oe?Reflect.construct(ie,arguments,this.constructor):ie.apply(this,arguments)};ae.prototype=ie.prototype}else ae={};return Object.defineProperty(ae,"__esModule",{value:!0}),Object.keys(re).forEach(function(oe){var ue=Object.getOwnPropertyDescriptor(re,oe);Object.defineProperty(ae,oe,ue.get?ue:{enumerable:!0,get:function(){return re[oe]}})}),ae}var codemirror={exports:{}},hasRequiredCodemirror;function requireCodemirror(){return hasRequiredCodemirror||(hasRequiredCodemirror=1,function(re,ie){(function(ae,oe){re.exports=oe()})(commonjsGlobal,function(){var ae=navigator.userAgent,oe=navigator.platform,ue=/gecko\/\d/i.test(ae),de=/MSIE \d/.test(ae),pe=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ae),_e=/Edge\/(\d+)/.exec(ae),Ce=de||pe||_e,Ne=Ce&&(de?document.documentMode||6:+(_e||pe)[1]),Oe=!_e&&/WebKit\//.test(ae),Ie=Oe&&/Qt\/\d+\.\d+/.test(ae),Fe=!_e&&/Chrome\/(\d+)/.exec(ae),Ue=Fe&&+Fe[1],Ve=/Opera\//.test(ae),ze=/Apple Computer/.test(navigator.vendor),jt=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ae),kt=/PhantomJS/.test(ae),Pt=ze&&(/Mobile\/\w+/.test(ae)||navigator.maxTouchPoints>2),Et=/Android/.test(ae),er=Pt||Et||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ae),tr=Pt||/Mac/.test(oe),nr=/\bCrOS\b/.test(ae),lr=/win/i.test(oe),cr=Ve&&ae.match(/Version\/(\d*\.\d*)/);cr&&(cr=Number(cr[1])),cr&&cr>=15&&(Ve=!1,Oe=!0);var ir=tr&&(Ie||Ve&&(cr==null||cr<12.11)),ar=ue||Ce&&Ne>=9;function sr(rr){return new RegExp("(^|\\s)"+rr+"(?:$|\\s)\\s*")}var dr=function(rr,ur){var gr=rr.className,yr=sr(ur).exec(gr);if(yr){var Tr=gr.slice(yr.index+yr[0].length);rr.className=gr.slice(0,yr.index)+(Tr?yr[1]+Tr:"")}};function fr(rr){for(var ur=rr.childNodes.length;ur>0;--ur)rr.removeChild(rr.firstChild);return rr}function _r(rr,ur){return fr(rr).appendChild(ur)}function mr(rr,ur,gr,yr){var Tr=document.createElement(rr);if(gr&&(Tr.className=gr),yr&&(Tr.style.cssText=yr),typeof ur=="string")Tr.appendChild(document.createTextNode(ur));else if(ur)for(var Xr=0;Xr=ur)return In+(ur-Xr);In+=mi-Xr,In+=gr-In%gr,Xr=mi+1}}var Sn=function(){this.id=null,this.f=null,this.time=0,this.handler=Ar(this.onTimeout,this)};Sn.prototype.onTimeout=function(rr){rr.id=0,rr.time<=+new Date?rr.f():setTimeout(rr.handler,rr.time-+new Date)},Sn.prototype.set=function(rr,ur){this.f=ur;var gr=+new Date+rr;(!this.id||gr=ur)return yr+Math.min(In,ur-Tr);if(Tr+=Xr-yr,Tr+=gr-Tr%gr,yr=Xr+1,Tr>=ur)return yr}}var Hr=[""];function zr(rr){for(;Hr.length<=rr;)Hr.push(An(Hr)+" ");return Hr[rr]}function An(rr){return rr[rr.length-1]}function kn(rr,ur){for(var gr=[],yr=0;yr""&&(rr.toUpperCase()!=rr.toLowerCase()||ta.test(rr))}function to(rr,ur){return ur?ur.source.indexOf("\\w")>-1&&Mo(rr)?!0:ur.test(rr):Mo(rr)}function rs(rr){for(var ur in rr)if(rr.hasOwnProperty(ur)&&rr[ur])return!1;return!0}var gs=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function hi(rr){return rr.charCodeAt(0)>=768&&gs.test(rr)}function En(rr,ur,gr){for(;(gr<0?ur>0:urgr?-1:1;;){if(ur==gr)return ur;var Tr=(ur+gr)/2,Xr=yr<0?Math.ceil(Tr):Math.floor(Tr);if(Xr==ur)return rr(Xr)?ur:gr;rr(Xr)?gr=Xr:ur=Xr+yr}}function Wn(rr,ur,gr,yr){if(!rr)return yr(ur,gr,"ltr",0);for(var Tr=!1,Xr=0;Xrur||ur==gr&&In.to==ur)&&(yr(Math.max(In.from,ur),Math.min(In.to,gr),In.level==1?"rtl":"ltr",Xr),Tr=!0)}Tr||yr(ur,gr,"ltr")}var Kn=null;function Ra(rr,ur,gr){var yr;Kn=null;for(var Tr=0;Trur)return Tr;Xr.to==ur&&(Xr.from!=Xr.to&&gr=="before"?yr=Tr:Kn=Tr),Xr.from==ur&&(Xr.from!=Xr.to&&gr!="before"?yr=Tr:Kn=Tr)}return yr??Kn}var Ea=function(){var rr="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",ur="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function gr(Aa){return Aa<=247?rr.charAt(Aa):1424<=Aa&&Aa<=1524?"R":1536<=Aa&&Aa<=1785?ur.charAt(Aa-1536):1774<=Aa&&Aa<=2220?"r":8192<=Aa&&Aa<=8203?"w":Aa==8204?"b":"L"}var yr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,Tr=/[stwN]/,Xr=/[LRr]/,In=/[Lb1n]/,mi=/[1n]/;function Vi(Aa,Co,Cs){this.level=Aa,this.from=Co,this.to=Cs}return function(Aa,Co){var Cs=Co=="ltr"?"L":"R";if(Aa.length==0||Co=="ltr"&&!yr.test(Aa))return!1;for(var ws=Aa.length,Is=[],sl=0;sl-1&&(yr[ur]=Tr.slice(0,Xr).concat(Tr.slice(Xr+1)))}}}function xs(rr,ur){var gr=da(rr,ur);if(gr.length)for(var yr=Array.prototype.slice.call(arguments,2),Tr=0;Tr0}function Ac(rr){rr.prototype.on=function(ur,gr){ra(this,ur,gr)},rr.prototype.off=function(ur,gr){Ka(this,ur,gr)}}function Ms(rr){rr.preventDefault?rr.preventDefault():rr.returnValue=!1}function zc(rr){rr.stopPropagation?rr.stopPropagation():rr.cancelBubble=!0}function Fc(rr){return rr.defaultPrevented!=null?rr.defaultPrevented:rr.returnValue==!1}function $u(rr){Ms(rr),zc(rr)}function xu(rr){return rr.target||rr.srcElement}function Su(rr){var ur=rr.which;return ur==null&&(rr.button&1?ur=1:rr.button&2?ur=3:rr.button&4&&(ur=2)),tr&&rr.ctrlKey&&ur==1&&(ur=3),ur}var Vl=function(){if(Ce&&Ne<9)return!1;var rr=mr("div");return"draggable"in rr||"dragDrop"in rr}(),Es;function $s(rr){if(Es==null){var ur=mr("span","");_r(rr,mr("span",[ur,document.createTextNode("x")])),rr.firstChild.offsetHeight!=0&&(Es=ur.offsetWidth<=1&&ur.offsetHeight>2&&!(Ce&&Ne<8))}var gr=Es?mr("span",""):mr("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return gr.setAttribute("cm-text",""),gr}var Xs;function Qs(rr){if(Xs!=null)return Xs;var ur=_r(rr,document.createTextNode("AخA")),gr=Sr(ur,0,1).getBoundingClientRect(),yr=Sr(ur,1,2).getBoundingClientRect();return fr(rr),!gr||gr.left==gr.right?!1:Xs=yr.right-gr.right<3}var Kr=`
+
+b`.split(/\n/).length!=3?function(rr){for(var ur=0,gr=[],yr=rr.length;ur<=yr;){var Tr=rr.indexOf(`
+`,ur);Tr==-1&&(Tr=rr.length);var Xr=rr.slice(ur,rr.charAt(Tr-1)=="\r"?Tr-1:Tr),In=Xr.indexOf("\r");In!=-1?(gr.push(Xr.slice(0,In)),ur+=In+1):(gr.push(Xr),ur=Tr+1)}return gr}:function(rr){return rr.split(/\r\n?|\n/)},Mi=window.getSelection?function(rr){try{return rr.selectionStart!=rr.selectionEnd}catch{return!1}}:function(rr){var ur;try{ur=rr.ownerDocument.selection.createRange()}catch{}return!ur||ur.parentElement()!=rr?!1:ur.compareEndPoints("StartToEnd",ur)!=0},Mn=function(){var rr=mr("div");return"oncopy"in rr?!0:(rr.setAttribute("oncopy","return;"),typeof rr.oncopy=="function")}(),oi=null;function na(rr){if(oi!=null)return oi;var ur=_r(rr,mr("span","x")),gr=ur.getBoundingClientRect(),yr=Sr(ur,0,1).getBoundingClientRect();return oi=Math.abs(gr.left-yr.left)>1}var aa={},Ta={};function qi(rr,ur){arguments.length>2&&(ur.dependencies=Array.prototype.slice.call(arguments,2)),aa[rr]=ur}function va(rr,ur){Ta[rr]=ur}function Ha(rr){if(typeof rr=="string"&&Ta.hasOwnProperty(rr))rr=Ta[rr];else if(rr&&typeof rr.name=="string"&&Ta.hasOwnProperty(rr.name)){var ur=Ta[rr.name];typeof ur=="string"&&(ur={name:ur}),rr=Rn(ur,rr),rr.name=ur.name}else{if(typeof rr=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(rr))return Ha("application/xml");if(typeof rr=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(rr))return Ha("application/json")}return typeof rr=="string"?{name:rr}:rr||{name:"null"}}function bo(rr,ur){ur=Ha(ur);var gr=aa[ur.name];if(!gr)return bo(rr,"text/plain");var yr=gr(rr,ur);if(hs.hasOwnProperty(ur.name)){var Tr=hs[ur.name];for(var Xr in Tr)Tr.hasOwnProperty(Xr)&&(yr.hasOwnProperty(Xr)&&(yr["_"+Xr]=yr[Xr]),yr[Xr]=Tr[Xr])}if(yr.name=ur.name,ur.helperType&&(yr.helperType=ur.helperType),ur.modeProps)for(var In in ur.modeProps)yr[In]=ur.modeProps[In];return yr}var hs={};function Vn(rr,ur){var gr=hs.hasOwnProperty(rr)?hs[rr]:hs[rr]={};Dr(ur,gr)}function Go(rr,ur){if(ur===!0)return ur;if(rr.copyState)return rr.copyState(ur);var gr={};for(var yr in ur){var Tr=ur[yr];Tr instanceof Array&&(Tr=Tr.concat([])),gr[yr]=Tr}return gr}function Wl(rr,ur){for(var gr;rr.innerMode&&(gr=rr.innerMode(ur),!(!gr||gr.mode==rr));)ur=gr.state,rr=gr.mode;return gr||{mode:rr,state:ur}}function Po(rr,ur,gr){return rr.startState?rr.startState(ur,gr):!0}var Ec=function(rr,ur,gr){this.pos=this.start=0,this.string=rr,this.tabSize=ur||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=gr};Ec.prototype.eol=function(){return this.pos>=this.string.length},Ec.prototype.sol=function(){return this.pos==this.lineStart},Ec.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ec.prototype.next=function(){if(this.posur},Ec.prototype.eatSpace=function(){for(var rr=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>rr},Ec.prototype.skipToEnd=function(){this.pos=this.string.length},Ec.prototype.skipTo=function(rr){var ur=this.string.indexOf(rr,this.pos);if(ur>-1)return this.pos=ur,!0},Ec.prototype.backUp=function(rr){this.pos-=rr},Ec.prototype.column=function(){return this.lastColumnPos0?null:(Xr&&ur!==!1&&(this.pos+=Xr[0].length),Xr)}},Ec.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ec.prototype.hideFirstChars=function(rr,ur){this.lineStart+=rr;try{return ur()}finally{this.lineStart-=rr}},Ec.prototype.lookAhead=function(rr){var ur=this.lineOracle;return ur&&ur.lookAhead(rr)},Ec.prototype.baseToken=function(){var rr=this.lineOracle;return rr&&rr.baseToken(this.pos)};function jl(rr,ur){if(ur-=rr.first,ur<0||ur>=rr.size)throw new Error("There is no line "+(ur+rr.first)+" in the document.");for(var gr=rr;!gr.lines;)for(var yr=0;;++yr){var Tr=gr.children[yr],Xr=Tr.chunkSize();if(ur=rr.first&&urgr?Ml(gr,jl(rr,gr).text.length):np(ur,jl(rr,ur.line).text.length)}function np(rr,ur){var gr=rr.ch;return gr==null||gr>ur?Ml(rr.line,ur):gr<0?Ml(rr.line,0):rr}function Ad(rr,ur){for(var gr=[],yr=0;yrthis.maxLookAhead&&(this.maxLookAhead=rr),ur},Lp.prototype.baseToken=function(rr){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=rr;)this.baseTokenPos+=2;var ur=this.baseTokens[this.baseTokenPos+1];return{type:ur&&ur.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-rr}},Lp.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Lp.fromSaved=function(rr,ur,gr){return ur instanceof Up?new Lp(rr,Go(rr.mode,ur.state),gr,ur.lookAhead):new Lp(rr,Go(rr.mode,ur),gr)},Lp.prototype.save=function(rr){var ur=rr!==!1?Go(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Up(ur,this.maxLookAhead):ur};function Bf(rr,ur,gr,yr){var Tr=[rr.state.modeGen],Xr={};Tf(rr,ur.text,rr.doc.mode,gr,function(Aa,Co){return Tr.push(Aa,Co)},Xr,yr);for(var In=gr.state,mi=function(Aa){gr.baseTokens=Tr;var Co=rr.state.overlays[Aa],Cs=1,ws=0;gr.state=!0,Tf(rr,ur.text,Co.mode,gr,function(Is,sl){for(var pc=Cs;wsIs&&Tr.splice(Cs,1,Is,Tr[Cs+1],_l),Cs+=2,ws=Math.min(Is,_l)}if(sl)if(Co.opaque)Tr.splice(pc,Cs-pc,Is,"overlay "+sl),Cs=pc+2;else for(;pcrr.options.maxHighlightLength&&Go(rr.doc.mode,yr.state),Xr=Bf(rr,ur,yr);Tr&&(yr.state=Tr),ur.stateAfter=yr.save(!Tr),ur.styles=Xr.styles,Xr.classes?ur.styleClasses=Xr.classes:ur.styleClasses&&(ur.styleClasses=null),gr===rr.doc.highlightFrontier&&(rr.doc.modeFrontier=Math.max(rr.doc.modeFrontier,++rr.doc.highlightFrontier))}return ur.styles}function Sf(rr,ur,gr){var yr=rr.doc,Tr=rr.display;if(!yr.mode.startState)return new Lp(yr,!0,ur);var Xr=Zf(rr,ur,gr),In=Xr>yr.first&&jl(yr,Xr-1).stateAfter,mi=In?Lp.fromSaved(yr,In,Xr):new Lp(yr,Po(yr.mode),Xr);return yr.iter(Xr,ur,function(Vi){Hp(rr,Vi.text,mi);var Aa=mi.line;Vi.stateAfter=Aa==ur-1||Aa%5==0||Aa>=Tr.viewFrom&&Aaur.start)return Xr}throw new Error("Mode "+rr.name+" failed to advance stream.")}var Du=function(rr,ur,gr){this.start=rr.start,this.end=rr.pos,this.string=rr.current(),this.type=ur||null,this.state=gr};function $f(rr,ur,gr,yr){var Tr=rr.doc,Xr=Tr.mode,In;ur=Lu(Tr,ur);var mi=jl(Tr,ur.line),Vi=Sf(rr,ur.line,gr),Aa=new Ec(mi.text,rr.options.tabSize,Vi),Co;for(yr&&(Co=[]);(yr||Aa.posrr.options.maxHighlightLength?(mi=!1,In&&Hp(rr,ur,yr,Co.pos),Co.pos=ur.length,Cs=null):Cs=Bp(Vf(gr,Co,yr.state,ws),Xr),ws){var Is=ws[0].name;Is&&(Cs="m-"+(Cs?Is+" "+Cs:Is))}if(!mi||Aa!=Cs){for(;ViIn;--mi){if(mi<=Xr.first)return Xr.first;var Vi=jl(Xr,mi-1),Aa=Vi.stateAfter;if(Aa&&(!gr||mi+(Aa instanceof Up?Aa.lookAhead:0)<=Xr.modeFrontier))return mi;var Co=Jr(Vi.text,null,rr.options.tabSize);(Tr==null||yr>Co)&&(Tr=mi-1,yr=Co)}return Tr}function Lf(rr,ur){if(rr.modeFrontier=Math.min(rr.modeFrontier,ur),!(rr.highlightFrontiergr;yr--){var Tr=jl(rr,yr).stateAfter;if(Tr&&(!(Tr instanceof Up)||yr+Tr.lookAhead=ur:Xr.to>ur);(yr||(yr=[])).push(new df(In,Xr.from,Vi?null:Xr.to))}}return yr}function Gh(rr,ur,gr){var yr;if(rr)for(var Tr=0;Tr=ur:Xr.to>ur);if(mi||Xr.from==ur&&In.type=="bookmark"&&(!gr||Xr.marker.insertLeft)){var Vi=Xr.from==null||(In.inclusiveLeft?Xr.from<=ur:Xr.from0&&mi)for(var bu=0;bu0)){var Co=[Vi,1],Cs=Gc(Aa.from,mi.from),ws=Gc(Aa.to,mi.to);(Cs<0||!In.inclusiveLeft&&!Cs)&&Co.push({from:Aa.from,to:mi.from}),(ws>0||!In.inclusiveRight&&!ws)&&Co.push({from:mi.to,to:Aa.to}),Tr.splice.apply(Tr,Co),Vi+=Co.length-3}}return Tr}function jd(rr){var ur=rr.markedSpans;if(ur){for(var gr=0;grur)&&(!yr||od(yr,Xr.marker)<0)&&(yr=Xr.marker)}return yr}function qm(rr,ur,gr,yr,Tr){var Xr=jl(rr,ur),In=rf&&Xr.markedSpans;if(In)for(var mi=0;mi=0&&Cs<=0||Co<=0&&Cs>=0)&&(Co<=0&&(Vi.marker.inclusiveRight&&Tr.inclusiveLeft?Gc(Aa.to,gr)>=0:Gc(Aa.to,gr)>0)||Co>=0&&(Vi.marker.inclusiveRight&&Tr.inclusiveLeft?Gc(Aa.from,yr)<=0:Gc(Aa.from,yr)<0)))return!0}}}function Xd(rr){for(var ur;ur=oh(rr);)rr=ur.find(-1,!0).line;return rr}function Am(rr){for(var ur;ur=wf(rr);)rr=ur.find(1,!0).line;return rr}function qf(rr){for(var ur,gr;ur=wf(rr);)rr=ur.find(1,!0).line,(gr||(gr=[])).push(rr);return gr}function Gf(rr,ur){var gr=jl(rr,ur),yr=Xd(gr);return gr==yr?ur:ei(yr)}function Dm(rr,ur){if(ur>rr.lastLine())return ur;var gr=jl(rr,ur),yr;if(!_p(rr,gr))return ur;for(;yr=wf(gr);)gr=yr.find(1,!0).line;return ei(gr)+1}function _p(rr,ur){var gr=rf&&ur.markedSpans;if(gr){for(var yr=void 0,Tr=0;Trur.maxLineLength&&(ur.maxLineLength=Tr,ur.maxLine=yr)})}var Fi=function(rr,ur,gr){this.text=rr,Fd(this,ur),this.height=gr?gr(this):1};Fi.prototype.lineNo=function(){return ei(this)},Ac(Fi);function Hi(rr,ur,gr,yr){rr.text=ur,rr.stateAfter&&(rr.stateAfter=null),rr.styles&&(rr.styles=null),rr.order!=null&&(rr.order=null),jd(rr),Fd(rr,gr);var Tr=yr?yr(rr):1;Tr!=rr.height&&Qc(rr,Tr)}function Bc(rr){rr.parent=null,jd(rr)}var sd={},kd={};function cp(rr,ur){if(!rr||/^\s*$/.test(rr))return null;var gr=ur.addModeClass?kd:sd;return gr[rr]||(gr[rr]=rr.replace(/\S+/g,"cm-$&"))}function xf(rr,ur){var gr=Er("span",null,null,Oe?"padding-right: .1px":null),yr={pre:Er("pre",[gr],"CodeMirror-line"),content:gr,col:0,pos:0,cm:rr,trailingSpace:!1,splitSpaces:rr.getOption("lineWrapping")};ur.measure={};for(var Tr=0;Tr<=(ur.rest?ur.rest.length:0);Tr++){var Xr=Tr?ur.rest[Tr-1]:ur.line,In=void 0;yr.pos=0,yr.addToken=Gm,Qs(rr.display.measure)&&(In=ro(Xr,rr.doc.direction))&&(yr.addToken=vp(yr.addToken,In)),yr.map=[];var mi=ur!=rr.display.externalMeasured&&ei(Xr);uh(Xr,yr,Uf(rr,Xr,mi)),Xr.styleClasses&&(Xr.styleClasses.bgClass&&(yr.bgClass=Vr(Xr.styleClasses.bgClass,yr.bgClass||"")),Xr.styleClasses.textClass&&(yr.textClass=Vr(Xr.styleClasses.textClass,yr.textClass||""))),yr.map.length==0&&yr.map.push(0,0,yr.content.appendChild($s(rr.display.measure))),Tr==0?(ur.measure.map=yr.map,ur.measure.cache={}):((ur.measure.maps||(ur.measure.maps=[])).push(yr.map),(ur.measure.caches||(ur.measure.caches=[])).push({}))}if(Oe){var Vi=yr.content.lastChild;(/\bcm-tab\b/.test(Vi.className)||Vi.querySelector&&Vi.querySelector(".cm-tab"))&&(yr.content.className="cm-tab-wrap-hack")}return xs(rr,"renderLine",rr,ur.line,yr.pre),yr.pre.className&&(yr.textClass=Vr(yr.pre.className,yr.textClass||"")),yr}function Wf(rr){var ur=mr("span","•","cm-invalidchar");return ur.title="\\u"+rr.charCodeAt(0).toString(16),ur.setAttribute("aria-label",ur.title),ur}function Gm(rr,ur,gr,yr,Tr,Xr,In){if(ur){var mi=rr.splitSpaces?sh(ur,rr.trailingSpace):ur,Vi=rr.cm.state.specialChars,Aa=!1,Co;if(!Vi.test(ur))rr.col+=ur.length,Co=document.createTextNode(mi),rr.map.push(rr.pos,rr.pos+ur.length,Co),Ce&&Ne<9&&(Aa=!0),rr.pos+=ur.length;else{Co=document.createDocumentFragment();for(var Cs=0;;){Vi.lastIndex=Cs;var ws=Vi.exec(ur),Is=ws?ws.index-Cs:ur.length-Cs;if(Is){var sl=document.createTextNode(mi.slice(Cs,Cs+Is));Ce&&Ne<9?Co.appendChild(mr("span",[sl])):Co.appendChild(sl),rr.map.push(rr.pos,rr.pos+Is,sl),rr.col+=Is,rr.pos+=Is}if(!ws)break;Cs+=Is+1;var pc=void 0;if(ws[0]==" "){var _l=rr.cm.options.tabSize,_c=_l-rr.col%_l;pc=Co.appendChild(mr("span",zr(_c),"cm-tab")),pc.setAttribute("role","presentation"),pc.setAttribute("cm-text"," "),rr.col+=_c}else ws[0]=="\r"||ws[0]==`
+`?(pc=Co.appendChild(mr("span",ws[0]=="\r"?"␍":"","cm-invalidchar")),pc.setAttribute("cm-text",ws[0]),rr.col+=1):(pc=rr.cm.options.specialCharPlaceholder(ws[0]),pc.setAttribute("cm-text",ws[0]),Ce&&Ne<9?Co.appendChild(mr("span",[pc])):Co.appendChild(pc),rr.col+=1);rr.map.push(rr.pos,rr.pos+1,pc),rr.pos++}}if(rr.trailingSpace=mi.charCodeAt(ur.length-1)==32,gr||yr||Tr||Aa||Xr||In){var yc=gr||"";yr&&(yc+=yr),Tr&&(yc+=Tr);var As=mr("span",[Co],yc,Xr);if(In)for(var bu in In)In.hasOwnProperty(bu)&&bu!="style"&&bu!="class"&&As.setAttribute(bu,In[bu]);return rr.content.appendChild(As)}rr.content.appendChild(Co)}}function sh(rr,ur){if(rr.length>1&&!/ /.test(rr))return rr;for(var gr=ur,yr="",Tr=0;TrAa&&Cs.from<=Aa));ws++);if(Cs.to>=Co)return rr(gr,yr,Tr,Xr,In,mi,Vi);rr(gr,yr.slice(0,Cs.to-Aa),Tr,Xr,null,mi,Vi),Xr=null,yr=yr.slice(Cs.to-Aa),Aa=Cs.to}}}function am(rr,ur,gr,yr){var Tr=!yr&&gr.widgetNode;Tr&&rr.map.push(rr.pos,rr.pos+ur,Tr),!yr&&rr.cm.display.input.needsContentAttribute&&(Tr||(Tr=rr.content.appendChild(document.createElement("span"))),Tr.setAttribute("cm-marker",gr.id)),Tr&&(rr.cm.display.input.setUneditable(Tr),rr.content.appendChild(Tr)),rr.pos+=ur,rr.trailingSpace=!1}function uh(rr,ur,gr){var yr=rr.markedSpans,Tr=rr.text,Xr=0;if(!yr){for(var In=1;InVi||vu.collapsed&&Hc.to==Vi&&Hc.from==Vi)){if(Hc.to!=null&&Hc.to!=Vi&&Is>Hc.to&&(Is=Hc.to,pc=""),vu.className&&(sl+=" "+vu.className),vu.css&&(ws=(ws?ws+";":"")+vu.css),vu.startStyle&&Hc.from==Vi&&(_l+=" "+vu.startStyle),vu.endStyle&&Hc.to==Is&&(bu||(bu=[])).push(vu.endStyle,Hc.to),vu.title&&((yc||(yc={})).title=vu.title),vu.attributes)for(var rd in vu.attributes)(yc||(yc={}))[rd]=vu.attributes[rd];vu.collapsed&&(!_c||od(_c.marker,vu)<0)&&(_c=Hc)}else Hc.from>Vi&&Is>Hc.from&&(Is=Hc.from)}if(bu)for(var rp=0;rp=mi)break;for(var dl=Math.min(mi,Is);;){if(Co){var cu=Vi+Co.length;if(!_c){var Wu=cu>dl?Co.slice(0,dl-Vi):Co;ur.addToken(ur,Wu,Cs?Cs+sl:sl,_l,Vi+Wu.length==Is?pc:"",ws,yc)}if(cu>=dl){Co=Co.slice(dl-Vi),Vi=dl;break}Vi=cu,_l=""}Co=Tr.slice(Xr,Xr=gr[Aa++]),Cs=cp(gr[Aa++],ur.cm.options)}}}function Fh(rr,ur,gr){this.line=ur,this.rest=qf(ur),this.size=this.rest?ei(An(this.rest))-gr+1:1,this.node=this.text=null,this.hidden=_p(rr,ur)}function Wm(rr,ur,gr){for(var yr=[],Tr,Xr=ur;Xr2&&Xr.push((Vi.bottom+Aa.top)/2-gr.top)}}Xr.push(gr.bottom-gr.top)}}function Xh(rr,ur,gr){if(rr.line==ur)return{map:rr.measure.map,cache:rr.measure.cache};if(rr.rest){for(var yr=0;yrgr)return{map:rr.measure.maps[Tr],cache:rr.measure.caches[Tr],before:!0}}}function Qh(rr,ur){ur=Xd(ur);var gr=ei(ur),yr=rr.display.externalMeasured=new Fh(rr.doc,ur,gr);yr.lineN=gr;var Tr=yr.built=xf(rr,yr);return yr.text=Tr.pre,_r(rr.display.lineMeasure,Tr.pre),yr}function kh(rr,ur,gr,yr){return of(rr,Pp(rr,ur),gr,yr)}function Oh(rr,ur){if(ur>=rr.display.viewFrom&&ur=gr.lineN&&urur)&&(Xr=Vi-mi,Tr=Xr-1,ur>=Vi&&(In="right")),Tr!=null){if(yr=rr[Aa+2],mi==Vi&&gr==(yr.insertLeft?"left":"right")&&(In=gr),gr=="left"&&Tr==0)for(;Aa&&rr[Aa-2]==rr[Aa-3]&&rr[Aa-1].insertLeft;)yr=rr[(Aa-=3)+2],In="left";if(gr=="right"&&Tr==Vi-mi)for(;Aa=0&&(gr=rr[Tr]).left==gr.right;Tr--);return gr}function hh(rr,ur,gr,yr){var Tr=Jh(ur.map,gr,yr),Xr=Tr.node,In=Tr.start,mi=Tr.end,Vi=Tr.collapse,Aa;if(Xr.nodeType==3){for(var Co=0;Co<4;Co++){for(;In&&hi(ur.line.text.charAt(Tr.coverStart+In));)--In;for(;Tr.coverStart+mi0&&(Vi=yr="right");var Cs;rr.options.lineWrapping&&(Cs=Xr.getClientRects()).length>1?Aa=Cs[yr=="right"?Cs.length-1:0]:Aa=Xr.getBoundingClientRect()}if(Ce&&Ne<9&&!In&&(!Aa||!Aa.left&&!Aa.right)){var ws=Xr.parentNode.getClientRects()[0];ws?Aa={left:ws.left,right:ws.left+cm(rr.display),top:ws.top,bottom:ws.bottom}:Aa=Uh}for(var Is=Aa.top-ur.rect.top,sl=Aa.bottom-ur.rect.top,pc=(Is+sl)/2,_l=ur.view.measure.heights,_c=0;_c<_l.length-1&&!(pc<_l[_c]);_c++);var yc=_c?_l[_c-1]:0,As=_l[_c],bu={left:(Vi=="right"?Aa.right:Aa.left)-ur.rect.left,right:(Vi=="left"?Aa.left:Aa.right)-ur.rect.left,top:yc,bottom:As};return!Aa.left&&!Aa.right&&(bu.bogus=!0),rr.options.singleCursorHeightPerLine||(bu.rtop=Is,bu.rbottom=sl),bu}function Kf(rr,ur){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!na(rr))return ur;var gr=screen.logicalXDPI/screen.deviceXDPI,yr=screen.logicalYDPI/screen.deviceYDPI;return{left:ur.left*gr,right:ur.right*gr,top:ur.top*yr,bottom:ur.bottom*yr}}function Zh(rr){if(rr.measure&&(rr.measure.cache={},rr.measure.heights=null,rr.rest))for(var ur=0;ur=yr.text.length?(Vi=yr.text.length,Aa="before"):Vi<=0&&(Vi=0,Aa="after"),!mi)return In(Aa=="before"?Vi-1:Vi,Aa=="before");function Co(sl,pc,_l){var _c=mi[pc],yc=_c.level==1;return In(_l?sl-1:sl,yc!=_l)}var Cs=Ra(mi,Vi,Aa),ws=Kn,Is=Co(Vi,Cs,Aa=="before");return ws!=null&&(Is.other=Co(Vi,ws,Aa!="before")),Is}function Cu(rr,ur){var gr=0;ur=Lu(rr.doc,ur),rr.options.lineWrapping||(gr=cm(rr.display)*ur.ch);var yr=jl(rr.doc,ur.line),Tr=Xp(yr)+sm(rr.display);return{left:gr,right:gr,top:Tr,bottom:Tr+yr.height}}function ku(rr,ur,gr,yr,Tr){var Xr=Ml(rr,ur,gr);return Xr.xRel=Tr,yr&&(Xr.outside=yr),Xr}function Ud(rr,ur,gr){var yr=rr.doc;if(gr+=rr.display.viewOffset,gr<0)return ku(yr.first,0,null,-1,-1);var Tr=ds(yr,gr),Xr=yr.first+yr.size-1;if(Tr>Xr)return ku(yr.first+yr.size-1,jl(yr,Xr).text.length,null,1,1);ur<0&&(ur=0);for(var In=jl(yr,Tr);;){var mi=l0(rr,In,Tr,ur,gr),Vi=zm(In,mi.ch+(mi.xRel>0||mi.outside>0?1:0));if(!Vi)return mi;var Aa=Vi.find(1);if(Aa.line==Tr)return Aa;In=jl(yr,Tr=Aa.line)}}function Op(rr,ur,gr,yr){yr-=Vh(ur);var Tr=ur.text.length,Xr=Ur(function(In){return of(rr,gr,In-1).bottom<=yr},Tr,0);return Tr=Ur(function(In){return of(rr,gr,In).top>yr},Xr,Tr),{begin:Xr,end:Tr}}function ip(rr,ur,gr,yr){gr||(gr=Pp(rr,ur));var Tr=bm(rr,ur,of(rr,gr,yr),"line").top;return Op(rr,ur,gr,Tr)}function _h(rr,ur,gr,yr){return rr.bottom<=gr?!1:rr.top>gr?!0:(yr?rr.left:rr.right)>ur}function l0(rr,ur,gr,yr,Tr){Tr-=Xp(ur);var Xr=Pp(rr,ur),In=Vh(ur),mi=0,Vi=ur.text.length,Aa=!0,Co=ro(ur,rr.doc.direction);if(Co){var Cs=(rr.options.lineWrapping?Yf:Df)(rr,ur,gr,Xr,Co,yr,Tr);Aa=Cs.level!=1,mi=Aa?Cs.from:Cs.to-1,Vi=Aa?Cs.to:Cs.from-1}var ws=null,Is=null,sl=Ur(function(wu){var Hc=of(rr,Xr,wu);return Hc.top+=In,Hc.bottom+=In,_h(Hc,yr,Tr,!1)?(Hc.top<=Tr&&Hc.left<=yr&&(ws=wu,Is=Hc),!0):!1},mi,Vi),pc,_l,_c=!1;if(Is){var yc=yr-Is.left=bu.bottom?1:0}return sl=En(ur.text,sl,1),ku(gr,sl,_l,_c,yr-pc)}function Df(rr,ur,gr,yr,Tr,Xr,In){var mi=Ur(function(Cs){var ws=Tr[Cs],Is=ws.level!=1;return _h(rc(rr,Ml(gr,Is?ws.to:ws.from,Is?"before":"after"),"line",ur,yr),Xr,In,!0)},0,Tr.length-1),Vi=Tr[mi];if(mi>0){var Aa=Vi.level!=1,Co=rc(rr,Ml(gr,Aa?Vi.from:Vi.to,Aa?"after":"before"),"line",ur,yr);_h(Co,Xr,In,!0)&&Co.top>In&&(Vi=Tr[mi-1])}return Vi}function Yf(rr,ur,gr,yr,Tr,Xr,In){var mi=Op(rr,ur,yr,In),Vi=mi.begin,Aa=mi.end;/\s/.test(ur.text.charAt(Aa-1))&&Aa--;for(var Co=null,Cs=null,ws=0;ws=Aa||Is.to<=Vi)){var sl=Is.level!=1,pc=of(rr,yr,sl?Math.min(Aa,Is.to)-1:Math.max(Vi,Is.from)).right,_l=pc_l)&&(Co=Is,Cs=_l)}}return Co||(Co=Tr[Tr.length-1]),Co.fromAa&&(Co={from:Co.from,to:Aa,level:Co.level}),Co}var $m;function kf(rr){if(rr.cachedTextHeight!=null)return rr.cachedTextHeight;if($m==null){$m=mr("pre",null,"CodeMirror-line-like");for(var ur=0;ur<49;++ur)$m.appendChild(document.createTextNode("x")),$m.appendChild(mr("br"));$m.appendChild(document.createTextNode("x"))}_r(rr.measure,$m);var gr=$m.offsetHeight/50;return gr>3&&(rr.cachedTextHeight=gr),fr(rr.measure),gr||1}function cm(rr){if(rr.cachedCharWidth!=null)return rr.cachedCharWidth;var ur=mr("span","xxxxxxxxxx"),gr=mr("pre",[ur],"CodeMirror-line-like");_r(rr.measure,gr);var yr=ur.getBoundingClientRect(),Tr=(yr.right-yr.left)/10;return Tr>2&&(rr.cachedCharWidth=Tr),Tr||10}function Ym(rr){for(var ur=rr.display,gr={},yr={},Tr=ur.gutters.clientLeft,Xr=ur.gutters.firstChild,In=0;Xr;Xr=Xr.nextSibling,++In){var mi=rr.display.gutterSpecs[In].className;gr[mi]=Xr.offsetLeft+Xr.clientLeft+Tr,yr[mi]=Xr.clientWidth}return{fixedPos:Vd(ur),gutterTotalWidth:ur.gutters.offsetWidth,gutterLeft:gr,gutterWidth:yr,wrapperWidth:ur.wrapper.clientWidth}}function Vd(rr){return rr.scroller.getBoundingClientRect().left-rr.sizer.getBoundingClientRect().left}function c0(rr){var ur=kf(rr.display),gr=rr.options.lineWrapping,yr=gr&&Math.max(5,rr.display.scroller.clientWidth/cm(rr.display)-3);return function(Tr){if(_p(rr.doc,Tr))return 0;var Xr=0;if(Tr.widgets)for(var In=0;In0&&(Aa=jl(rr.doc,Vi.line).text).length==Vi.ch){var Co=Jr(Aa,Aa.length,rr.options.tabSize)-Aa.length;Vi=Ml(Vi.line,Math.max(0,Math.round((Xr-Yh(rr.display).left)/cm(rr.display))-Co))}return Vi}function Xm(rr,ur){if(ur>=rr.display.viewTo||(ur-=rr.display.viewFrom,ur<0))return null;for(var gr=rr.display.view,yr=0;yrur)&&(Tr.updateLineNumbers=ur),rr.curOp.viewChanged=!0,ur>=Tr.viewTo)rf&&Gf(rr.doc,ur)Tr.viewFrom?Xf(rr):(Tr.viewFrom+=yr,Tr.viewTo+=yr);else if(ur<=Tr.viewFrom&&gr>=Tr.viewTo)Xf(rr);else if(ur<=Tr.viewFrom){var Xr=Qf(rr,gr,gr+yr,1);Xr?(Tr.view=Tr.view.slice(Xr.index),Tr.viewFrom=Xr.lineN,Tr.viewTo+=yr):Xf(rr)}else if(gr>=Tr.viewTo){var In=Qf(rr,ur,ur,-1);In?(Tr.view=Tr.view.slice(0,In.index),Tr.viewTo=In.lineN):Xf(rr)}else{var mi=Qf(rr,ur,ur,-1),Vi=Qf(rr,gr,gr+yr,1);mi&&Vi?(Tr.view=Tr.view.slice(0,mi.index).concat(Wm(rr,mi.lineN,Vi.lineN)).concat(Tr.view.slice(Vi.index)),Tr.viewTo+=yr):Xf(rr)}var Aa=Tr.externalMeasured;Aa&&(gr=Tr.lineN&&ur=yr.viewTo)){var Xr=yr.view[Xm(rr,ur)];if(Xr.node!=null){var In=Xr.changes||(Xr.changes=[]);vn(In,gr)==-1&&In.push(gr)}}}function Xf(rr){rr.display.viewFrom=rr.display.viewTo=rr.doc.first,rr.display.view=[],rr.display.viewOffset=0}function Qf(rr,ur,gr,yr){var Tr=Xm(rr,ur),Xr,In=rr.display.view;if(!rf||gr==rr.doc.first+rr.doc.size)return{index:Tr,lineN:gr};for(var mi=rr.display.viewFrom,Vi=0;Vi0){if(Tr==In.length-1)return null;Xr=mi+In[Tr].size-ur,Tr++}else Xr=mi-ur;ur+=Xr,gr+=Xr}for(;Gf(rr.doc,gr)!=gr;){if(Tr==(yr<0?0:In.length-1))return null;gr+=yr*In[Tr-(yr<0?1:0)].size,Tr+=yr}return{index:Tr,lineN:gr}}function Rh(rr,ur,gr){var yr=rr.display,Tr=yr.view;Tr.length==0||ur>=yr.viewTo||gr<=yr.viewFrom?(yr.view=Wm(rr,ur,gr),yr.viewFrom=ur):(yr.viewFrom>ur?yr.view=Wm(rr,ur,yr.viewFrom).concat(yr.view):yr.viewFromgr&&(yr.view=yr.view.slice(0,Xm(rr,gr)))),yr.viewTo=gr}function Ih(rr){for(var ur=rr.display.view,gr=0,yr=0;yr=rr.display.viewTo||Vi.to().line0?In:rr.defaultCharWidth())+"px"}if(yr.other){var mi=gr.appendChild(mr("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));mi.style.display="",mi.style.left=yr.other.left+"px",mi.style.top=yr.other.top+"px",mi.style.height=(yr.other.bottom-yr.other.top)*.85+"px"}}function um(rr,ur){return rr.top-ur.top||rr.left-ur.left}function Hh(rr,ur,gr){var yr=rr.display,Tr=rr.doc,Xr=document.createDocumentFragment(),In=Yh(rr.display),mi=In.left,Vi=Math.max(yr.sizerWidth,vm(rr)-yr.sizer.offsetLeft)-In.right,Aa=Tr.direction=="ltr";function Co(As,bu,wu,Hc){bu<0&&(bu=0),bu=Math.round(bu),Hc=Math.round(Hc),Xr.appendChild(mr("div",null,"CodeMirror-selected","position: absolute; left: "+As+`px;
+ top: `+bu+"px; width: "+(wu??Vi-As)+`px;
+ height: `+(Hc-bu)+"px"))}function Cs(As,bu,wu){var Hc=jl(Tr,As),vu=Hc.text.length,rd,rp;function xo(Wu,ld){return mc(rr,Ml(As,Wu),"div",Hc,ld)}function dl(Wu,ld,fp){var Ld=ip(rr,Hc,null,Wu),Wd=ld=="ltr"==(fp=="after")?"left":"right",Qd=fp=="after"?Ld.begin:Ld.end-(/\s/.test(Hc.text.charAt(Ld.end-1))?2:1);return xo(Qd,Wd)[Wd]}var cu=ro(Hc,Tr.direction);return Wn(cu,bu||0,wu??vu,function(Wu,ld,fp,Ld){var Wd=fp=="ltr",Qd=xo(Wu,Wd?"left":"right"),Jd=xo(ld-1,Wd?"right":"left"),Gu=bu==null&&Wu==0,gd=wu==null&&ld==vu,ef=Ld==0,jm=!cu||Ld==cu.length-1;if(Jd.top-Qd.top<=3){var tf=(Aa?Gu:gd)&&ef,x0=(Aa?gd:Gu)&&jm,Zm=tf?mi:(Wd?Qd:Jd).left,Mh=x0?Vi:(Wd?Jd:Qd).right;Co(Zm,Qd.top,Mh-Zm,Qd.bottom)}else{var Th,yf,T0,U0;Wd?(Th=Aa&&Gu&&ef?mi:Qd.left,yf=Aa?Vi:dl(Wu,fp,"before"),T0=Aa?mi:dl(ld,fp,"after"),U0=Aa&&gd&&jm?Vi:Jd.right):(Th=Aa?dl(Wu,fp,"before"):mi,yf=!Aa&&Gu&&ef?Vi:Qd.right,T0=!Aa&&gd&&jm?mi:Jd.left,U0=Aa?dl(ld,fp,"after"):Vi),Co(Th,Qd.top,yf-Th,Qd.bottom),Qd.bottom0?ur.blinker=setInterval(function(){rr.hasFocus()||Fo(rr),ur.cursorDiv.style.visibility=(gr=!gr)?"":"hidden"},rr.options.cursorBlinkRate):rr.options.cursorBlinkRate<0&&(ur.cursorDiv.style.visibility="hidden")}}function vs(rr){rr.hasFocus()||(rr.display.input.focus(),rr.state.focused||Vo(rr))}function Io(rr){rr.state.delayingBlurEvent=!0,setTimeout(function(){rr.state.delayingBlurEvent&&(rr.state.delayingBlurEvent=!1,rr.state.focused&&Fo(rr))},100)}function Vo(rr,ur){rr.state.delayingBlurEvent&&!rr.state.draggingText&&(rr.state.delayingBlurEvent=!1),rr.options.readOnly!="nocursor"&&(rr.state.focused||(xs(rr,"focus",rr,ur),rr.state.focused=!0,Rr(rr.display.wrapper,"CodeMirror-focused"),!rr.curOp&&rr.display.selForContextMenu!=rr.doc.sel&&(rr.display.input.reset(),Oe&&setTimeout(function(){return rr.display.input.reset(!0)},20)),rr.display.input.receivedFocus()),Ps(rr))}function Fo(rr,ur){rr.state.delayingBlurEvent||(rr.state.focused&&(xs(rr,"blur",rr,ur),rr.state.focused=!1,dr(rr.display.wrapper,"CodeMirror-focused")),clearInterval(rr.display.blinker),setTimeout(function(){rr.state.focused||(rr.display.shift=!1)},150))}function vo(rr){for(var ur=rr.display,gr=ur.lineDiv.offsetTop,yr=Math.max(0,ur.scroller.getBoundingClientRect().top),Tr=ur.lineDiv.getBoundingClientRect().top,Xr=0,In=0;In.005||Is<-.005)&&(Trrr.display.sizerWidth){var pc=Math.ceil(Co/cm(rr.display));pc>rr.display.maxLineLength&&(rr.display.maxLineLength=pc,rr.display.maxLine=mi.line,rr.display.maxLineChanged=!0)}}}Math.abs(Xr)>2&&(ur.scroller.scrollTop+=Xr)}function Ro(rr){if(rr.widgets)for(var ur=0;ur=In&&(Xr=ds(ur,Xp(jl(ur,Vi))-rr.wrapper.clientHeight),In=Vi)}return{from:Xr,to:Math.max(In,Xr+1)}}function To(rr,ur){if(!_s(rr,"scrollCursorIntoView")){var gr=rr.display,yr=gr.sizer.getBoundingClientRect(),Tr=null,Xr=gr.wrapper.ownerDocument;if(ur.top+yr.top<0?Tr=!0:ur.bottom+yr.top>(Xr.defaultView.innerHeight||Xr.documentElement.clientHeight)&&(Tr=!1),Tr!=null&&!kt){var In=mr("div","",null,`position: absolute;
+ top: `+(ur.top-gr.viewOffset-sm(rr.display))+`px;
+ height: `+(ur.bottom-ur.top+Pf(rr)+gr.barHeight)+`px;
+ left: `+ur.left+"px; width: "+Math.max(2,ur.right-ur.left)+"px;");rr.display.lineSpace.appendChild(In),In.scrollIntoView(Tr),rr.display.lineSpace.removeChild(In)}}}function is(rr,ur,gr,yr){yr==null&&(yr=0);var Tr;!rr.options.lineWrapping&&ur==gr&&(gr=ur.sticky=="before"?Ml(ur.line,ur.ch+1,"before"):ur,ur=ur.ch?Ml(ur.line,ur.sticky=="before"?ur.ch-1:ur.ch,"after"):ur);for(var Xr=0;Xr<5;Xr++){var In=!1,mi=rc(rr,ur),Vi=!gr||gr==ur?mi:rc(rr,gr);Tr={left:Math.min(mi.left,Vi.left),top:Math.min(mi.top,Vi.top)-yr,right:Math.max(mi.left,Vi.left),bottom:Math.max(mi.bottom,Vi.bottom)+yr};var Aa=Zo(rr,Tr),Co=rr.doc.scrollTop,Cs=rr.doc.scrollLeft;if(Aa.scrollTop!=null&&(ps(rr,Aa.scrollTop),Math.abs(rr.doc.scrollTop-Co)>1&&(In=!0)),Aa.scrollLeft!=null&&(ks(rr,Aa.scrollLeft),Math.abs(rr.doc.scrollLeft-Cs)>1&&(In=!0)),!In)break}return Tr}function _o(rr,ur){var gr=Zo(rr,ur);gr.scrollTop!=null&&ps(rr,gr.scrollTop),gr.scrollLeft!=null&&ks(rr,gr.scrollLeft)}function Zo(rr,ur){var gr=rr.display,yr=kf(rr.display);ur.top<0&&(ur.top=0);var Tr=rr.curOp&&rr.curOp.scrollTop!=null?rr.curOp.scrollTop:gr.scroller.scrollTop,Xr=Km(rr),In={};ur.bottom-ur.top>Xr&&(ur.bottom=ur.top+Xr);var mi=rr.doc.height+Bm(gr),Vi=ur.topmi-yr;if(ur.topTr+Xr){var Co=Math.min(ur.top,(Aa?mi:ur.bottom)-Xr);Co!=Tr&&(In.scrollTop=Co)}var Cs=rr.options.fixedGutter?0:gr.gutters.offsetWidth,ws=rr.curOp&&rr.curOp.scrollLeft!=null?rr.curOp.scrollLeft:gr.scroller.scrollLeft-Cs,Is=vm(rr)-gr.gutters.offsetWidth,sl=ur.right-ur.left>Is;return sl&&(ur.right=ur.left+Is),ur.left<10?In.scrollLeft=0:ur.leftIs+ws-3&&(In.scrollLeft=ur.right+(sl?0:10)-Is),In}function Rs(rr,ur){ur!=null&&(Gs(rr),rr.curOp.scrollTop=(rr.curOp.scrollTop==null?rr.doc.scrollTop:rr.curOp.scrollTop)+ur)}function Ss(rr){Gs(rr);var ur=rr.getCursor();rr.curOp.scrollToPos={from:ur,to:ur,margin:rr.options.cursorScrollMargin}}function Us(rr,ur,gr){(ur!=null||gr!=null)&&Gs(rr),ur!=null&&(rr.curOp.scrollLeft=ur),gr!=null&&(rr.curOp.scrollTop=gr)}function tl(rr,ur){Gs(rr),rr.curOp.scrollToPos=ur}function Gs(rr){var ur=rr.curOp.scrollToPos;if(ur){rr.curOp.scrollToPos=null;var gr=Cu(rr,ur.from),yr=Cu(rr,ur.to);bl(rr,gr,yr,ur.margin)}}function bl(rr,ur,gr,yr){var Tr=Zo(rr,{left:Math.min(ur.left,gr.left),top:Math.min(ur.top,gr.top)-yr,right:Math.max(ur.right,gr.right),bottom:Math.max(ur.bottom,gr.bottom)+yr});Us(rr,Tr.scrollLeft,Tr.scrollTop)}function ps(rr,ur){Math.abs(rr.doc.scrollTop-ur)<2||(ue||Ou(rr,{top:ur}),fl(rr,ur,!0),ue&&Ou(rr),Hl(rr,100))}function fl(rr,ur,gr){ur=Math.max(0,Math.min(rr.display.scroller.scrollHeight-rr.display.scroller.clientHeight,ur)),!(rr.display.scroller.scrollTop==ur&&!gr)&&(rr.doc.scrollTop=ur,rr.display.scrollbars.setScrollTop(ur),rr.display.scroller.scrollTop!=ur&&(rr.display.scroller.scrollTop=ur))}function ks(rr,ur,gr,yr){ur=Math.max(0,Math.min(ur,rr.display.scroller.scrollWidth-rr.display.scroller.clientWidth)),!((gr?ur==rr.doc.scrollLeft:Math.abs(rr.doc.scrollLeft-ur)<2)&&!yr)&&(rr.doc.scrollLeft=ur,Ep(rr),rr.display.scroller.scrollLeft!=ur&&(rr.display.scroller.scrollLeft=ur),rr.display.scrollbars.setScrollLeft(ur))}function Os(rr){var ur=rr.display,gr=ur.gutters.offsetWidth,yr=Math.round(rr.doc.height+Bm(rr.display));return{clientHeight:ur.scroller.clientHeight,viewHeight:ur.wrapper.clientHeight,scrollWidth:ur.scroller.scrollWidth,clientWidth:ur.scroller.clientWidth,viewWidth:ur.wrapper.clientWidth,barLeft:rr.options.fixedGutter?gr:0,docHeight:yr,scrollHeight:yr+Pf(rr)+ur.barHeight,nativeBarWidth:ur.nativeBarWidth,gutterWidth:gr}}var Bs=function(rr,ur,gr){this.cm=gr;var yr=this.vert=mr("div",[mr("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),Tr=this.horiz=mr("div",[mr("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");yr.tabIndex=Tr.tabIndex=-1,rr(yr),rr(Tr),ra(yr,"scroll",function(){yr.clientHeight&&ur(yr.scrollTop,"vertical")}),ra(Tr,"scroll",function(){Tr.clientWidth&&ur(Tr.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Ce&&Ne<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Bs.prototype.update=function(rr){var ur=rr.scrollWidth>rr.clientWidth+1,gr=rr.scrollHeight>rr.clientHeight+1,yr=rr.nativeBarWidth;if(gr){this.vert.style.display="block",this.vert.style.bottom=ur?yr+"px":"0";var Tr=rr.viewHeight-(ur?yr:0);this.vert.firstChild.style.height=Math.max(0,rr.scrollHeight-rr.clientHeight+Tr)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(ur){this.horiz.style.display="block",this.horiz.style.right=gr?yr+"px":"0",this.horiz.style.left=rr.barLeft+"px";var Xr=rr.viewWidth-rr.barLeft-(gr?yr:0);this.horiz.firstChild.style.width=Math.max(0,rr.scrollWidth-rr.clientWidth+Xr)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&rr.clientHeight>0&&(yr==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:gr?yr:0,bottom:ur?yr:0}},Bs.prototype.setScrollLeft=function(rr){this.horiz.scrollLeft!=rr&&(this.horiz.scrollLeft=rr),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Bs.prototype.setScrollTop=function(rr){this.vert.scrollTop!=rr&&(this.vert.scrollTop=rr),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Bs.prototype.zeroWidthHack=function(){var rr=tr&&!jt?"12px":"18px";this.horiz.style.height=this.vert.style.width=rr,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Sn,this.disableVert=new Sn},Bs.prototype.enableZeroWidthBar=function(rr,ur,gr){rr.style.visibility="";function yr(){var Tr=rr.getBoundingClientRect(),Xr=gr=="vert"?document.elementFromPoint(Tr.right-1,(Tr.top+Tr.bottom)/2):document.elementFromPoint((Tr.right+Tr.left)/2,Tr.bottom-1);Xr!=rr?rr.style.visibility="hidden":ur.set(1e3,yr)}ur.set(1e3,yr)},Bs.prototype.clear=function(){var rr=this.horiz.parentNode;rr.removeChild(this.horiz),rr.removeChild(this.vert)};var Vs=function(){};Vs.prototype.update=function(){return{bottom:0,right:0}},Vs.prototype.setScrollLeft=function(){},Vs.prototype.setScrollTop=function(){},Vs.prototype.clear=function(){};function Pl(rr,ur){ur||(ur=Os(rr));var gr=rr.display.barWidth,yr=rr.display.barHeight;Zl(rr,ur);for(var Tr=0;Tr<4&&gr!=rr.display.barWidth||yr!=rr.display.barHeight;Tr++)gr!=rr.display.barWidth&&rr.options.lineWrapping&&vo(rr),Zl(rr,Os(rr)),gr=rr.display.barWidth,yr=rr.display.barHeight}function Zl(rr,ur){var gr=rr.display,yr=gr.scrollbars.update(ur);gr.sizer.style.paddingRight=(gr.barWidth=yr.right)+"px",gr.sizer.style.paddingBottom=(gr.barHeight=yr.bottom)+"px",gr.heightForcer.style.borderBottom=yr.bottom+"px solid transparent",yr.right&&yr.bottom?(gr.scrollbarFiller.style.display="block",gr.scrollbarFiller.style.height=yr.bottom+"px",gr.scrollbarFiller.style.width=yr.right+"px"):gr.scrollbarFiller.style.display="",yr.bottom&&rr.options.coverGutterNextToScrollbar&&rr.options.fixedGutter?(gr.gutterFiller.style.display="block",gr.gutterFiller.style.height=yr.bottom+"px",gr.gutterFiller.style.width=ur.gutterWidth+"px"):gr.gutterFiller.style.display=""}var wc={native:Bs,null:Vs};function Bl(rr){rr.display.scrollbars&&(rr.display.scrollbars.clear(),rr.display.scrollbars.addClass&&dr(rr.display.wrapper,rr.display.scrollbars.addClass)),rr.display.scrollbars=new wc[rr.options.scrollbarStyle](function(ur){rr.display.wrapper.insertBefore(ur,rr.display.scrollbarFiller),ra(ur,"mousedown",function(){rr.state.focused&&setTimeout(function(){return rr.display.input.focus()},0)}),ur.setAttribute("cm-not-content","true")},function(ur,gr){gr=="horizontal"?ks(rr,ur):ps(rr,ur)},rr),rr.display.scrollbars.addClass&&Rr(rr.display.wrapper,rr.display.scrollbars.addClass)}var fc=0;function Cc(rr){rr.curOp={cm:rr,viewChanged:!1,startHeight:rr.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++fc,markArrays:null},a0(rr.curOp)}function Rc(rr){var ur=rr.curOp;ur&&o0(ur,function(gr){for(var yr=0;yr=gr.viewTo)||gr.maxLineChanged&&ur.options.lineWrapping,rr.update=rr.mustUpdate&&new tc(ur,rr.mustUpdate&&{top:rr.scrollTop,ensure:rr.scrollToPos},rr.forceUpdate)}function Jc(rr){rr.updatedDisplay=rr.mustUpdate&&zu(rr.cm,rr.update)}function pu(rr){var ur=rr.cm,gr=ur.display;rr.updatedDisplay&&vo(ur),rr.barMeasure=Os(ur),gr.maxLineChanged&&!ur.options.lineWrapping&&(rr.adjustWidthTo=kh(ur,gr.maxLine,gr.maxLine.text.length).left+3,ur.display.sizerWidth=rr.adjustWidthTo,rr.barMeasure.scrollWidth=Math.max(gr.scroller.clientWidth,gr.sizer.offsetLeft+rr.adjustWidthTo+Pf(ur)+ur.display.barWidth),rr.maxScrollLeft=Math.max(0,gr.sizer.offsetLeft+rr.adjustWidthTo-vm(ur))),(rr.updatedDisplay||rr.selectionChanged)&&(rr.preparedSelection=gr.input.prepareSelection())}function io(rr){var ur=rr.cm;rr.adjustWidthTo!=null&&(ur.display.sizer.style.minWidth=rr.adjustWidthTo+"px",rr.maxScrollLeft=rr.display.viewTo)){var gr=+new Date+rr.options.workTime,yr=Sf(rr,ur.highlightFrontier),Tr=[];ur.iter(yr.line,Math.min(ur.first+ur.size,rr.display.viewTo+500),function(Xr){if(yr.line>=rr.display.viewFrom){var In=Xr.styles,mi=Xr.text.length>rr.options.maxHighlightLength?Go(ur.mode,yr.state):null,Vi=Bf(rr,Xr,yr,!0);mi&&(yr.state=mi),Xr.styles=Vi.styles;var Aa=Xr.styleClasses,Co=Vi.classes;Co?Xr.styleClasses=Co:Aa&&(Xr.styleClasses=null);for(var Cs=!In||In.length!=Xr.styles.length||Aa!=Co&&(!Aa||!Co||Aa.bgClass!=Co.bgClass||Aa.textClass!=Co.textClass),ws=0;!Cs&&wsgr)return Hl(rr,rr.options.workDelay),!0}),ur.highlightFrontier=yr.line,ur.modeFrontier=Math.max(ur.modeFrontier,yr.line),Tr.length&&Au(rr,function(){for(var Xr=0;Xr=gr.viewFrom&&ur.visible.to<=gr.viewTo&&(gr.updateLineNumbers==null||gr.updateLineNumbers>=gr.viewTo)&&gr.renderedView==gr.view&&Ih(rr)==0)return!1;cd(rr)&&(Xf(rr),ur.dims=Ym(rr));var Tr=yr.first+yr.size,Xr=Math.max(ur.visible.from-rr.options.viewportMargin,yr.first),In=Math.min(Tr,ur.visible.to+rr.options.viewportMargin);gr.viewFromIn&&gr.viewTo-In<20&&(In=Math.min(Tr,gr.viewTo)),rf&&(Xr=Gf(rr.doc,Xr),In=Dm(rr.doc,In));var mi=Xr!=gr.viewFrom||In!=gr.viewTo||gr.lastWrapHeight!=ur.wrapperHeight||gr.lastWrapWidth!=ur.wrapperWidth;Rh(rr,Xr,In),gr.viewOffset=Xp(jl(rr.doc,gr.viewFrom)),rr.display.mover.style.top=gr.viewOffset+"px";var Vi=Ih(rr);if(!mi&&Vi==0&&!ur.force&&gr.renderedView==gr.view&&(gr.updateLineNumbers==null||gr.updateLineNumbers>=gr.viewTo))return!1;var Aa=gu(rr);return Vi>4&&(gr.lineDiv.style.display="none"),gp(rr,gr.updateLineNumbers,ur.dims),Vi>4&&(gr.lineDiv.style.display=""),gr.renderedView=gr.view,Pu(Aa),fr(gr.cursorDiv),fr(gr.selectionDiv),gr.gutters.style.height=gr.sizer.style.minHeight=0,mi&&(gr.lastWrapHeight=ur.wrapperHeight,gr.lastWrapWidth=ur.wrapperWidth,Hl(rr,400)),gr.updateLineNumbers=null,!0}function qd(rr,ur){for(var gr=ur.viewport,yr=!0;;yr=!1){if(!yr||!rr.options.lineWrapping||ur.oldDisplayWidth==vm(rr)){if(gr&&gr.top!=null&&(gr={top:Math.min(rr.doc.height+Bm(rr.display)-Km(rr),gr.top)}),ur.visible=Yo(rr.display,rr.doc,gr),ur.visible.from>=rr.display.viewFrom&&ur.visible.to<=rr.display.viewTo)break}else yr&&(ur.visible=Yo(rr.display,rr.doc,gr));if(!zu(rr,ur))break;vo(rr);var Tr=Os(rr);Of(rr),Pl(rr,Tr),jp(rr,Tr),ur.force=!1}ur.signal(rr,"update",rr),(rr.display.viewFrom!=rr.display.reportedViewFrom||rr.display.viewTo!=rr.display.reportedViewTo)&&(ur.signal(rr,"viewportChange",rr,rr.display.viewFrom,rr.display.viewTo),rr.display.reportedViewFrom=rr.display.viewFrom,rr.display.reportedViewTo=rr.display.viewTo)}function Ou(rr,ur){var gr=new tc(rr,ur);if(zu(rr,gr)){vo(rr),qd(rr,gr);var yr=Os(rr);Of(rr),Pl(rr,yr),jp(rr,yr),gr.finish()}}function gp(rr,ur,gr){var yr=rr.display,Tr=rr.options.lineNumbers,Xr=yr.lineDiv,In=Xr.firstChild;function mi(sl){var pc=sl.nextSibling;return Oe&&tr&&rr.display.currentWheelTarget==sl?sl.style.display="none":sl.parentNode.removeChild(sl),pc}for(var Vi=yr.view,Aa=yr.viewFrom,Co=0;Co-1&&(Is=!1),jh(rr,Cs,Aa,gr)),Is&&(fr(Cs.lineNumber),Cs.lineNumber.appendChild(document.createTextNode(Nc(rr.options,Aa)))),In=Cs.node.nextSibling}Aa+=Cs.size}for(;In;)In=mi(In)}function Jp(rr){var ur=rr.gutters.offsetWidth;rr.sizer.style.marginLeft=ur+"px",bp(rr,"gutterChanged",rr)}function jp(rr,ur){rr.display.sizer.style.minHeight=ur.docHeight+"px",rr.display.heightForcer.style.top=ur.docHeight+"px",rr.display.gutters.style.height=ur.docHeight+rr.display.barHeight+Pf(rr)+"px"}function Ep(rr){var ur=rr.display,gr=ur.view;if(!(!ur.alignWidgets&&(!ur.gutters.firstChild||!rr.options.fixedGutter))){for(var yr=Vd(ur)-ur.scroller.scrollLeft+rr.doc.scrollLeft,Tr=ur.gutters.offsetWidth,Xr=yr+"px",In=0;In=105&&(Tr.wrapper.style.clipPath="inset(0px)"),Tr.wrapper.setAttribute("translate","no"),Ce&&Ne<8&&(Tr.gutters.style.zIndex=-1,Tr.scroller.style.paddingRight=0),!Oe&&!(ue&&er)&&(Tr.scroller.draggable=!0),rr&&(rr.appendChild?rr.appendChild(Tr.wrapper):rr(Tr.wrapper)),Tr.viewFrom=Tr.viewTo=ur.first,Tr.reportedViewFrom=Tr.reportedViewTo=ur.first,Tr.view=[],Tr.renderedView=null,Tr.externalMeasured=null,Tr.viewOffset=0,Tr.lastWrapHeight=Tr.lastWrapWidth=0,Tr.updateLineNumbers=null,Tr.nativeBarWidth=Tr.barHeight=Tr.barWidth=0,Tr.scrollbarsClipped=!1,Tr.lineNumWidth=Tr.lineNumInnerWidth=Tr.lineNumChars=null,Tr.alignWidgets=!1,Tr.cachedCharWidth=Tr.cachedTextHeight=Tr.cachedPaddingH=null,Tr.maxLine=null,Tr.maxLineLength=0,Tr.maxLineChanged=!1,Tr.wheelDX=Tr.wheelDY=Tr.wheelStartX=Tr.wheelStartY=null,Tr.shift=!1,Tr.selForContextMenu=null,Tr.activeTouch=null,Tr.gutterSpecs=Rd(yr.gutters,yr.lineNumbers),ff(Tr),gr.init(Tr)}var lf=0,dp=null;Ce?dp=-.53:ue?dp=15:Fe?dp=-.7:ze&&(dp=-1/3);function Cp(rr){var ur=rr.wheelDeltaX,gr=rr.wheelDeltaY;return ur==null&&rr.detail&&rr.axis==rr.HORIZONTAL_AXIS&&(ur=rr.detail),gr==null&&rr.detail&&rr.axis==rr.VERTICAL_AXIS?gr=rr.detail:gr==null&&(gr=rr.wheelDelta),{x:ur,y:gr}}function xp(rr){var ur=Cp(rr);return ur.x*=dp,ur.y*=dp,ur}function Zd(rr,ur){Fe&&Ue==102&&(rr.display.chromeScrollHack==null?rr.display.sizer.style.pointerEvents="none":clearTimeout(rr.display.chromeScrollHack),rr.display.chromeScrollHack=setTimeout(function(){rr.display.chromeScrollHack=null,rr.display.sizer.style.pointerEvents=""},100));var gr=Cp(ur),yr=gr.x,Tr=gr.y,Xr=dp;ur.deltaMode===0&&(yr=ur.deltaX,Tr=ur.deltaY,Xr=1);var In=rr.display,mi=In.scroller,Vi=mi.scrollWidth>mi.clientWidth,Aa=mi.scrollHeight>mi.clientHeight;if(yr&&Vi||Tr&&Aa){if(Tr&&tr&&Oe){e:for(var Co=ur.target,Cs=In.view;Co!=mi;Co=Co.parentNode)for(var ws=0;ws=0&&Gc(rr,yr.to())<=0)return gr}return-1};var yd=function(rr,ur){this.anchor=rr,this.head=ur};yd.prototype.from=function(){return kp(this.anchor,this.head)},yd.prototype.to=function(){return Id(this.anchor,this.head)},yd.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tp(rr,ur,gr){var yr=rr&&rr.options.selectionsMayTouch,Tr=ur[gr];ur.sort(function(ws,Is){return Gc(ws.from(),Is.from())}),gr=vn(ur,Tr);for(var Xr=1;Xr0:Vi>=0){var Aa=kp(mi.from(),In.from()),Co=Id(mi.to(),In.to()),Cs=mi.empty()?In.from()==In.head:mi.from()==mi.head;Xr<=gr&&--gr,ur.splice(--Xr,2,new yd(Cs?Co:Aa,Cs?Aa:Co))}}return new ep(ur,gr)}function Vp(rr,ur){return new ep([new yd(rr,ur||rr)],0)}function Jf(rr){return rr.text?Ml(rr.from.line+rr.text.length-1,An(rr.text).length+(rr.text.length==1?rr.from.ch:0)):rr.to}function bh(rr,ur){if(Gc(rr,ur.from)<0)return rr;if(Gc(rr,ur.to)<=0)return Jf(ur);var gr=rr.line+ur.text.length-(ur.to.line-ur.from.line)-1,yr=rr.ch;return rr.line==ur.to.line&&(yr+=Jf(ur).ch-ur.to.ch),Ml(gr,yr)}function hf(rr,ur){for(var gr=[],yr=0;yr1&&rr.remove(mi.line+1,sl-1),rr.insert(mi.line+1,_c)}bp(rr,"change",rr,ur)}function Wp(rr,ur,gr){function yr(Tr,Xr,In){if(Tr.linked)for(var mi=0;mi1&&!rr.done[rr.done.length-2].ranges)return rr.done.pop(),An(rr.done)}function Wa(rr,ur,gr,yr){var Tr=rr.history;Tr.undone.length=0;var Xr=+new Date,In,mi;if((Tr.lastOp==yr||Tr.lastOrigin==ur.origin&&ur.origin&&(ur.origin.charAt(0)=="+"&&Tr.lastModTime>Xr-(rr.cm?rr.cm.options.historyEventDelay:500)||ur.origin.charAt(0)=="*"))&&(In=ci(Tr,Tr.lastOp==yr)))mi=An(In.changes),Gc(ur.from,ur.to)==0&&Gc(ur.from,mi.to)==0?mi.to=Jf(ur):In.changes.push(Ff(rr,ur));else{var Vi=An(Tr.done);for((!Vi||!Vi.ranges)&&eo(rr.sel,Tr.done),In={changes:[Ff(rr,ur)],generation:Tr.generation},Tr.done.push(In);Tr.done.length>Tr.undoDepth;)Tr.done.shift(),Tr.done[0].ranges||Tr.done.shift()}Tr.done.push(gr),Tr.generation=++Tr.maxGeneration,Tr.lastModTime=Tr.lastSelTime=Xr,Tr.lastOp=Tr.lastSelOp=yr,Tr.lastOrigin=Tr.lastSelOrigin=ur.origin,mi||xs(rr,"historyAdded")}function Ba(rr,ur,gr,yr){var Tr=ur.charAt(0);return Tr=="*"||Tr=="+"&&gr.ranges.length==yr.ranges.length&&gr.somethingSelected()==yr.somethingSelected()&&new Date-rr.history.lastSelTime<=(rr.cm?rr.cm.options.historyEventDelay:500)}function La(rr,ur,gr,yr){var Tr=rr.history,Xr=yr&&yr.origin;gr==Tr.lastSelOp||Xr&&Tr.lastSelOrigin==Xr&&(Tr.lastModTime==Tr.lastSelTime&&Tr.lastOrigin==Xr||Ba(rr,Xr,An(Tr.done),ur))?Tr.done[Tr.done.length-1]=ur:eo(ur,Tr.done),Tr.lastSelTime=+new Date,Tr.lastSelOrigin=Xr,Tr.lastSelOp=gr,yr&&yr.clearRedo!==!1&&Zp(Tr.undone)}function eo(rr,ur){var gr=An(ur);gr&&gr.ranges&&gr.equals(rr)||ur.push(rr)}function Ao(rr,ur,gr,yr){var Tr=ur["spans_"+rr.id],Xr=0;rr.iter(Math.max(rr.first,gr),Math.min(rr.first+rr.size,yr),function(In){In.markedSpans&&((Tr||(Tr=ur["spans_"+rr.id]={}))[Xr]=In.markedSpans),++Xr})}function So(rr){if(!rr)return null;for(var ur,gr=0;gr-1&&(An(mi)[Cs]=Aa[Cs],delete Aa[Cs])}}return yr}function Ni(rr,ur,gr,yr){if(yr){var Tr=rr.anchor;if(gr){var Xr=Gc(ur,Tr)<0;Xr!=Gc(gr,Tr)<0?(Tr=ur,ur=gr):Xr!=Gc(ur,gr)<0&&(ur=gr)}return new yd(Tr,ur)}else return new yd(gr||ur,ur)}function Un(rr,ur,gr,yr,Tr){Tr==null&&(Tr=rr.cm&&(rr.cm.display.shift||rr.extend)),ms(rr,new ep([Ni(rr.sel.primary(),ur,gr,Tr)],0),yr)}function qa(rr,ur,gr){for(var yr=[],Tr=rr.cm&&(rr.cm.display.shift||rr.extend),Xr=0;Xr=ur.ch:mi.to>ur.ch))){if(Tr&&(xs(Vi,"beforeCursorEnter"),Vi.explicitlyCleared))if(Xr.markedSpans){--In;continue}else break;if(!Vi.atomic)continue;if(gr){var Cs=Vi.find(yr<0?1:-1),ws=void 0;if((yr<0?Co:Aa)&&(Cs=_u(rr,Cs,-yr,Cs&&Cs.line==ur.line?Xr:null)),Cs&&Cs.line==ur.line&&(ws=Gc(Cs,gr))&&(yr<0?ws<0:ws>0))return Mc(rr,Cs,ur,yr,Tr)}var Is=Vi.find(yr<0?-1:1);return(yr<0?Aa:Co)&&(Is=_u(rr,Is,yr,Is.line==ur.line?Xr:null)),Is?Mc(rr,Is,ur,yr,Tr):null}}return ur}function Yc(rr,ur,gr,yr,Tr){var Xr=yr||1,In=Mc(rr,ur,gr,Xr,Tr)||!Tr&&Mc(rr,ur,gr,Xr,!0)||Mc(rr,ur,gr,-Xr,Tr)||!Tr&&Mc(rr,ur,gr,-Xr,!0);return In||(rr.cantEdit=!0,Ml(rr.first,0))}function _u(rr,ur,gr,yr){return gr<0&&ur.ch==0?ur.line>rr.first?Lu(rr,Ml(ur.line-1)):null:gr>0&&ur.ch==(yr||jl(rr,ur.line)).text.length?ur.line=0;--Tr)Vu(rr,{from:yr[Tr].from,to:yr[Tr].to,text:Tr?[""]:ur.text,origin:ur.origin});else Vu(rr,ur)}}function Vu(rr,ur){if(!(ur.text.length==1&&ur.text[0]==""&&Gc(ur.from,ur.to)==0)){var gr=hf(rr,ur);Wa(rr,ur,gr,rr.cm?rr.cm.curOp.id:NaN),bc(rr,ur,gr,Nm(rr,ur));var yr=[];Wp(rr,function(Tr,Xr){!Xr&&vn(yr,Tr.history)==-1&&(sp(Tr.history,ur),yr.push(Tr.history)),bc(Tr,ur,null,Nm(Tr,ur))})}}function Fu(rr,ur,gr){var yr=rr.cm&&rr.cm.state.suppressEdits;if(!(yr&&!gr)){for(var Tr=rr.history,Xr,In=rr.sel,mi=ur=="undo"?Tr.done:Tr.undone,Vi=ur=="undo"?Tr.undone:Tr.done,Aa=0;Aa=0;--Is){var sl=ws(Is);if(sl)return sl.v}}}}function Uc(rr,ur){if(ur!=0&&(rr.first+=ur,rr.sel=new ep(kn(rr.sel.ranges,function(Tr){return new yd(Ml(Tr.anchor.line+ur,Tr.anchor.ch),Ml(Tr.head.line+ur,Tr.head.ch))}),rr.sel.primIndex),rr.cm)){qp(rr.cm,rr.first,rr.first-ur,ur);for(var gr=rr.cm.display,yr=gr.viewFrom;yrrr.lastLine())){if(ur.from.lineXr&&(ur={from:ur.from,to:Ml(Xr,jl(rr,Xr).text.length),text:[ur.text[0]],origin:ur.origin}),ur.removed=Zc(rr,ur.from,ur.to),gr||(gr=hf(rr,ur)),rr.cm?Vc(rr.cm,ur,yr):Em(rr,ur,yr),$o(rr,gr,Lr),rr.cantEdit&&Yc(rr,Ml(rr.firstLine(),0))&&(rr.cantEdit=!1)}}function Vc(rr,ur,gr){var yr=rr.doc,Tr=rr.display,Xr=ur.from,In=ur.to,mi=!1,Vi=Xr.line;rr.options.lineWrapping||(Vi=ei(Xd(jl(yr,Xr.line))),yr.iter(Vi,In.line+1,function(Is){if(Is==Tr.maxLine)return mi=!0,!0})),yr.sel.contains(ur.from,ur.to)>-1&&kl(rr),Em(yr,ur,gr,c0(rr)),rr.options.lineWrapping||(yr.iter(Vi,Xr.line+ur.text.length,function(Is){var sl=im(Is);sl>Tr.maxLineLength&&(Tr.maxLine=Is,Tr.maxLineLength=sl,Tr.maxLineChanged=!0,mi=!1)}),mi&&(rr.curOp.updateMaxLine=!0)),Lf(yr,Xr.line),Hl(rr,400);var Aa=ur.text.length-(In.line-Xr.line)-1;ur.full?qp(rr):Xr.line==In.line&&ur.text.length==1&&!dm(rr.doc,ur)?ym(rr,Xr.line,"text"):qp(rr,Xr.line,In.line+1,Aa);var Co=Yl(rr,"changes"),Cs=Yl(rr,"change");if(Cs||Co){var ws={from:Xr,to:In,text:ur.text,removed:ur.removed,origin:ur.origin};Cs&&bp(rr,"change",rr,ws),Co&&(rr.curOp.changeObjs||(rr.curOp.changeObjs=[])).push(ws)}rr.display.selForContextMenu=null}function vc(rr,ur,gr,yr,Tr){var Xr;yr||(yr=gr),Gc(yr,gr)<0&&(Xr=[yr,gr],gr=Xr[0],yr=Xr[1]),typeof ur=="string"&&(ur=rr.splitLines(ur)),Ku(rr,{from:gr,to:yr,text:ur,origin:Tr})}function Np(rr,ur,gr,yr){gr1||!(this.children[0]instanceof Nd))){var mi=[];this.collapse(mi),this.children=[new Nd(mi)],this.children[0].parent=this}},collapse:function(rr){for(var ur=0;ur50){for(var In=Tr.lines.length%25+25,mi=In;mi10);rr.parent.maybeSpill()}},iterN:function(rr,ur,gr){for(var yr=0;yrrr.display.maxLineLength&&(rr.display.maxLine=Aa,rr.display.maxLineLength=Co,rr.display.maxLineChanged=!0)}yr!=null&&rr&&this.collapsed&&qp(rr,yr,Tr+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,rr&&Zs(rr.doc)),rr&&bp(rr,"markerCleared",rr,this,yr,Tr),ur&&Rc(rr),this.parent&&this.parent.clear()}},Kl.prototype.find=function(rr,ur){rr==null&&this.type=="bookmark"&&(rr=1);for(var gr,yr,Tr=0;Tr0||In==0&&Xr.clearWhenEmpty!==!1)return Xr;if(Xr.replacedWith&&(Xr.collapsed=!0,Xr.widgetNode=Er("span",[Xr.replacedWith],"CodeMirror-widget"),yr.handleMouseEvents||Xr.widgetNode.setAttribute("cm-ignore-events","true"),yr.insertLeft&&(Xr.widgetNode.insertLeft=!0)),Xr.collapsed){if(qm(rr,ur.line,ur,gr,Xr)||ur.line!=gr.line&&qm(rr,gr.line,ur,gr,Xr))throw new Error("Inserting collapsed marker partially overlapping an existing one");Um()}Xr.addToHistory&&Wa(rr,{from:ur,to:gr,origin:"markText"},rr.sel,NaN);var mi=ur.line,Vi=rr.cm,Aa;if(rr.iter(mi,gr.line+1,function(Cs){Vi&&Xr.collapsed&&!Vi.options.lineWrapping&&Xd(Cs)==Vi.display.maxLine&&(Aa=!0),Xr.collapsed&&mi!=ur.line&&Qc(Cs,0),Ah(Cs,new df(Xr,mi==ur.line?ur.ch:null,mi==gr.line?gr.ch:null),rr.cm&&rr.cm.curOp),++mi}),Xr.collapsed&&rr.iter(ur.line,gr.line+1,function(Cs){_p(rr,Cs)&&Qc(Cs,0)}),Xr.clearOnEnter&&ra(Xr,"beforeCursorEnter",function(){return Xr.clear()}),Xr.readOnly&&(xm(),(rr.history.done.length||rr.history.undone.length)&&rr.clearHistory()),Xr.collapsed&&(Xr.id=++cl,Xr.atomic=!0),Vi){if(Aa&&(Vi.curOp.updateMaxLine=!0),Xr.collapsed)qp(Vi,ur.line,gr.line+1);else if(Xr.className||Xr.startStyle||Xr.endStyle||Xr.css||Xr.attributes||Xr.title)for(var Co=ur.line;Co<=gr.line;Co++)ym(Vi,Co,"text");Xr.atomic&&Zs(Vi.doc),bp(Vi,"markerAdded",Vi,Xr)}return Xr}var Xc=function(rr,ur){this.markers=rr,this.primary=ur;for(var gr=0;gr=0;Vi--)Ku(this,yr[Vi]);mi?ys(this,mi):this.cm&&Ss(this.cm)}),undo:Lc(function(){Fu(this,"undo")}),redo:Lc(function(){Fu(this,"redo")}),undoSelection:Lc(function(){Fu(this,"undo",!0)}),redoSelection:Lc(function(){Fu(this,"redo",!0)}),setExtending:function(rr){this.extend=rr},getExtending:function(){return this.extend},historySize:function(){for(var rr=this.history,ur=0,gr=0,yr=0;yr=rr.ch)&&ur.push(Tr.marker.parent||Tr.marker)}return ur},findMarks:function(rr,ur,gr){rr=Lu(this,rr),ur=Lu(this,ur);var yr=[],Tr=rr.line;return this.iter(rr.line,ur.line+1,function(Xr){var In=Xr.markedSpans;if(In)for(var mi=0;mi=Vi.to||Vi.from==null&&Tr!=rr.line||Vi.from!=null&&Tr==ur.line&&Vi.from>=ur.ch)&&(!gr||gr(Vi.marker))&&yr.push(Vi.marker.parent||Vi.marker)}++Tr}),yr},getAllMarks:function(){var rr=[];return this.iter(function(ur){var gr=ur.markedSpans;if(gr)for(var yr=0;yrrr)return ur=rr,!0;rr-=Xr,++gr}),Lu(this,Ml(gr,ur))},indexFromPos:function(rr){rr=Lu(this,rr);var ur=rr.ch;if(rr.lineur&&(ur=rr.from),rr.to!=null&&rr.to-1){ur.state.draggingText(rr),setTimeout(function(){return ur.display.input.focus()},20);return}try{var Co=rr.dataTransfer.getData("Text");if(Co){var Cs;if(ur.state.draggingText&&!ur.state.draggingText.copy&&(Cs=ur.listSelections()),$o(ur.doc,Vp(gr,gr)),Cs)for(var ws=0;ws=0;mi--)vc(rr.doc,"",yr[mi].from,yr[mi].to,"+delete");Ss(rr)})}function u0(rr,ur,gr){var yr=En(rr.text,ur+gr,gr);return yr<0||yr>rr.text.length?null:yr}function Zn(rr,ur,gr){var yr=u0(rr,ur.ch,gr);return yr==null?null:new Ml(ur.line,yr,gr<0?"after":"before")}function Ui(rr,ur,gr,yr,Tr){if(rr){ur.doc.direction=="rtl"&&(Tr=-Tr);var Xr=ro(gr,ur.doc.direction);if(Xr){var In=Tr<0?An(Xr):Xr[0],mi=Tr<0==(In.level==1),Vi=mi?"after":"before",Aa;if(In.level>0||ur.doc.direction=="rtl"){var Co=Pp(ur,gr);Aa=Tr<0?gr.text.length-1:0;var Cs=of(ur,Co,Aa).top;Aa=Ur(function(ws){return of(ur,Co,ws).top==Cs},Tr<0==(In.level==1)?In.from:In.to-1,Aa),Vi=="before"&&(Aa=u0(gr,Aa,1))}else Aa=Tr<0?In.to:In.from;return new Ml(yr,Aa,Vi)}}return new Ml(yr,Tr<0?gr.text.length:0,Tr<0?"before":"after")}function Ln(rr,ur,gr,yr){var Tr=ro(ur,rr.doc.direction);if(!Tr)return Zn(ur,gr,yr);gr.ch>=ur.text.length?(gr.ch=ur.text.length,gr.sticky="before"):gr.ch<=0&&(gr.ch=0,gr.sticky="after");var Xr=Ra(Tr,gr.ch,gr.sticky),In=Tr[Xr];if(rr.doc.direction=="ltr"&&In.level%2==0&&(yr>0?In.to>gr.ch:In.from=In.from&&ws>=Co.begin)){var Is=Cs?"before":"after";return new Ml(gr.line,ws,Is)}}var sl=function(_c,yc,As){for(var bu=function(rd,rp){return rp?new Ml(gr.line,mi(rd,1),"before"):new Ml(gr.line,rd,"after")};_c>=0&&_c0==(wu.level!=1),vu=Hc?As.begin:mi(As.end,-1);if(wu.from<=vu&&vu0?Co.end:mi(Co.begin,-1);return _l!=null&&!(yr>0&&_l==ur.text.length)&&(pc=sl(yr>0?0:Tr.length-1,yr,Aa(_l)),pc)?pc:null}var fi={selectAll:Uu,singleSelection:function(rr){return rr.setSelection(rr.getCursor("anchor"),rr.getCursor("head"),Lr)},killLine:function(rr){return fm(rr,function(ur){if(ur.empty()){var gr=jl(rr.doc,ur.head.line).text.length;return ur.head.ch==gr&&ur.head.line0)Tr=new Ml(Tr.line,Tr.ch+1),rr.replaceRange(Xr.charAt(Tr.ch-1)+Xr.charAt(Tr.ch-2),Ml(Tr.line,Tr.ch-2),Tr,"+transpose");else if(Tr.line>rr.doc.first){var In=jl(rr.doc,Tr.line-1).text;In&&(Tr=new Ml(Tr.line,1),rr.replaceRange(Xr.charAt(0)+rr.doc.lineSeparator()+In.charAt(In.length-1),Ml(Tr.line-1,In.length-1),Tr,"+transpose"))}}gr.push(new yd(Tr,Tr))}rr.setSelections(gr)})},newlineAndIndent:function(rr){return Au(rr,function(){for(var ur=rr.listSelections(),gr=ur.length-1;gr>=0;gr--)rr.replaceRange(rr.doc.lineSeparator(),ur[gr].anchor,ur[gr].head,"+input");ur=rr.listSelections();for(var yr=0;yrrr&&Gc(ur,this.pos)==0&&gr==this.button};var co,Ja;function us(rr,ur){var gr=+new Date;return Ja&&Ja.compare(gr,rr,ur)?(co=Ja=null,"triple"):co&&co.compare(gr,rr,ur)?(Ja=new Ia(gr,rr,ur),co=null,"double"):(co=new Ia(gr,rr,ur),Ja=null,"single")}function ea(rr){var ur=this,gr=ur.display;if(!(_s(ur,rr)||gr.activeTouch&&gr.input.supportsTouch())){if(gr.input.ensurePolled(),gr.shift=rr.shiftKey,pf(gr,rr)){Oe||(gr.scroller.draggable=!1,setTimeout(function(){return gr.scroller.draggable=!0},100));return}if(!Fa(ur,rr)){var yr=sf(ur,rr),Tr=Su(rr),Xr=yr?us(yr,Tr):"single";Wr(ur).focus(),Tr==1&&ur.state.selectingText&&ur.state.selectingText(rr),!(yr&&Ma(ur,Tr,yr,Xr,rr))&&(Tr==1?yr?fa(ur,yr,Xr,rr):xu(rr)==gr.scroller&&Ms(rr):Tr==2?(yr&&Un(ur.doc,yr),setTimeout(function(){return gr.input.focus()},20)):Tr==3&&(ar?ur.display.input.onContextMenu(rr):Io(ur)))}}}function Ma(rr,ur,gr,yr,Tr){var Xr="Click";return yr=="double"?Xr="Double"+Xr:yr=="triple"&&(Xr="Triple"+Xr),Xr=(ur==1?"Left":ur==2?"Middle":"Right")+Xr,la(rr,w0(Xr,Tr),Tr,function(In){if(typeof In=="string"&&(In=fi[In]),!In)return!1;var mi=!1;try{rr.isReadOnly()&&(rr.state.suppressEdits=!0),mi=In(rr,gr)!=$r}finally{rr.state.suppressEdits=!1}return mi})}function Zi(rr,ur,gr){var yr=rr.getOption("configureMouse"),Tr=yr?yr(rr,ur,gr):{};if(Tr.unit==null){var Xr=nr?gr.shiftKey&&gr.metaKey:gr.altKey;Tr.unit=Xr?"rectangle":ur=="single"?"char":ur=="double"?"word":"line"}return(Tr.extend==null||rr.doc.extend)&&(Tr.extend=rr.doc.extend||gr.shiftKey),Tr.addNew==null&&(Tr.addNew=tr?gr.metaKey:gr.ctrlKey),Tr.moveOnDrag==null&&(Tr.moveOnDrag=!(tr?gr.altKey:gr.ctrlKey)),Tr}function fa(rr,ur,gr,yr){Ce?setTimeout(Ar(vs,rr),0):rr.curOp.focus=Nr(kr(rr));var Tr=Zi(rr,gr,yr),Xr=rr.doc.sel,In;rr.options.dragDrop&&Vl&&!rr.isReadOnly()&&gr=="single"&&(In=Xr.contains(ur))>-1&&(Gc((In=Xr.ranges[In]).from(),ur)<0||ur.xRel>0)&&(Gc(In.to(),ur)>0||ur.xRel<0)?di(rr,yr,ur,Tr):pa(rr,yr,ur,Tr)}function di(rr,ur,gr,yr){var Tr=rr.display,Xr=!1,In=Oc(rr,function(Aa){Oe&&(Tr.scroller.draggable=!1),rr.state.draggingText=!1,rr.state.delayingBlurEvent&&(rr.hasFocus()?rr.state.delayingBlurEvent=!1:Io(rr)),Ka(Tr.wrapper.ownerDocument,"mouseup",In),Ka(Tr.wrapper.ownerDocument,"mousemove",mi),Ka(Tr.scroller,"dragstart",Vi),Ka(Tr.scroller,"drop",In),Xr||(Ms(Aa),yr.addNew||Un(rr.doc,gr,null,null,yr.extend),Oe&&!ze||Ce&&Ne==9?setTimeout(function(){Tr.wrapper.ownerDocument.body.focus({preventScroll:!0}),Tr.input.focus()},20):Tr.input.focus())}),mi=function(Aa){Xr=Xr||Math.abs(ur.clientX-Aa.clientX)+Math.abs(ur.clientY-Aa.clientY)>=10},Vi=function(){return Xr=!0};Oe&&(Tr.scroller.draggable=!0),rr.state.draggingText=In,In.copy=!yr.moveOnDrag,ra(Tr.wrapper.ownerDocument,"mouseup",In),ra(Tr.wrapper.ownerDocument,"mousemove",mi),ra(Tr.scroller,"dragstart",Vi),ra(Tr.scroller,"drop",In),rr.state.delayingBlurEvent=!0,setTimeout(function(){return Tr.input.focus()},20),Tr.scroller.dragDrop&&Tr.scroller.dragDrop()}function sa(rr,ur,gr){if(gr=="char")return new yd(ur,ur);if(gr=="word")return rr.findWordAt(ur);if(gr=="line")return new yd(Ml(ur.line,0),Lu(rr.doc,Ml(ur.line+1,0)));var yr=gr(rr,ur);return new yd(yr.from,yr.to)}function pa(rr,ur,gr,yr){Ce&&Io(rr);var Tr=rr.display,Xr=rr.doc;Ms(ur);var In,mi,Vi=Xr.sel,Aa=Vi.ranges;if(yr.addNew&&!yr.extend?(mi=Xr.sel.contains(gr),mi>-1?In=Aa[mi]:In=new yd(gr,gr)):(In=Xr.sel.primary(),mi=Xr.sel.primIndex),yr.unit=="rectangle")yr.addNew||(In=new yd(gr,gr)),gr=sf(rr,ur,!0,!0),mi=-1;else{var Co=sa(rr,gr,yr.unit);yr.extend?In=Ni(In,Co.anchor,Co.head,yr.extend):In=Co}yr.addNew?mi==-1?(mi=Aa.length,ms(Xr,tp(rr,Aa.concat([In]),mi),{scroll:!1,origin:"*mouse"})):Aa.length>1&&Aa[mi].empty()&&yr.unit=="char"&&!yr.extend?(ms(Xr,tp(rr,Aa.slice(0,mi).concat(Aa.slice(mi+1)),0),{scroll:!1,origin:"*mouse"}),Vi=Xr.sel):Na(Xr,mi,In,Gr):(mi=0,ms(Xr,new ep([In],0),Gr),Vi=Xr.sel);var Cs=gr;function ws(As){if(Gc(Cs,As)!=0)if(Cs=As,yr.unit=="rectangle"){for(var bu=[],wu=rr.options.tabSize,Hc=Jr(jl(Xr,gr.line).text,gr.ch,wu),vu=Jr(jl(Xr,As.line).text,As.ch,wu),rd=Math.min(Hc,vu),rp=Math.max(Hc,vu),xo=Math.min(gr.line,As.line),dl=Math.min(rr.lastLine(),Math.max(gr.line,As.line));xo<=dl;xo++){var cu=jl(Xr,xo).text,Wu=Br(cu,rd,wu);rd==rp?bu.push(new yd(Ml(xo,Wu),Ml(xo,Wu))):cu.length>Wu&&bu.push(new yd(Ml(xo,Wu),Ml(xo,Br(cu,rp,wu))))}bu.length||bu.push(new yd(gr,gr)),ms(Xr,tp(rr,Vi.ranges.slice(0,mi).concat(bu),mi),{origin:"*mouse",scroll:!1}),rr.scrollIntoView(As)}else{var ld=In,fp=sa(rr,As,yr.unit),Ld=ld.anchor,Wd;Gc(fp.anchor,Ld)>0?(Wd=fp.head,Ld=kp(ld.from(),fp.anchor)):(Wd=fp.anchor,Ld=Id(ld.to(),fp.head));var Qd=Vi.ranges.slice(0);Qd[mi]=xa(rr,new yd(Lu(Xr,Ld),Wd)),ms(Xr,tp(rr,Qd,mi),Gr)}}var Is=Tr.wrapper.getBoundingClientRect(),sl=0;function pc(As){var bu=++sl,wu=sf(rr,As,!0,yr.unit=="rectangle");if(wu)if(Gc(wu,Cs)!=0){rr.curOp.focus=Nr(kr(rr)),ws(wu);var Hc=Yo(Tr,Xr);(wu.line>=Hc.to||wu.line