You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__RestFul__Edit__index.fc9...

166 lines
354 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[189,7],{"+NIl":function(ht,Ye,w){(function(M){M(w("VrN/"))})(function(M){"use strict";M.defineMode("stex",function(Ce,H){"use strict";function he(B,D){B.cmdState.push(D)}function ue(B){return B.cmdState.length>0?B.cmdState[B.cmdState.length-1]:null}function ee(B){var D=B.cmdState.pop();D&&D.closeBracket()}function O(B){for(var D=B.cmdState,L=D.length-1;L>=0;L--){var T=D[L];if(T.name=="DEFAULT")continue;return T}return{styleIdentifier:function(){return null}}}function S(B,D,L){return function(){this.name=B,this.bracketNo=0,this.style=D,this.styles=L,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var C={};C.importmodule=S("importmodule","tag",["string","builtin"]),C.documentclass=S("documentclass","tag",["","atom"]),C.usepackage=S("usepackage","tag",["atom"]),C.begin=S("begin","tag",["atom"]),C.end=S("end","tag",["atom"]),C.label=S("label","tag",["atom"]),C.ref=S("ref","tag",["atom"]),C.eqref=S("eqref","tag",["atom"]),C.cite=S("cite","tag",["atom"]),C.bibitem=S("bibitem","tag",["atom"]),C.Bibitem=S("Bibitem","tag",["atom"]),C.RBibitem=S("RBibitem","tag",["atom"]),C.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function ie(B,D){B.f=D}function j(B,D){var L;if(B.match(/^\\[a-zA-Z@]+/)){var T=B.current().slice(1);return L=C.hasOwnProperty(T)?C[T]:C.DEFAULT,L=new L,he(D,L),ie(D,le),L.style}if(B.match(/^\\[$&%#{}_]/))return"tag";if(B.match(/^\\[,;!\/\\]/))return"tag";if(B.match("\\["))return ie(D,function(V,be){return G(V,be,"\\]")}),"keyword";if(B.match("\\("))return ie(D,function(V,be){return G(V,be,"\\)")}),"keyword";if(B.match("$$"))return ie(D,function(V,be){return G(V,be,"$$")}),"keyword";if(B.match("$"))return ie(D,function(V,be){return G(V,be,"$")}),"keyword";var X=B.next();if(X=="%")return B.skipToEnd(),"comment";if(X=="}"||X=="]"){if(L=ue(D),L)L.closeBracket(X),ie(D,le);else return"error";return"bracket"}else return X=="{"||X=="["?(L=C.DEFAULT,L=new L,he(D,L),"bracket"):/\d/.test(X)?(B.eatWhile(/[\w.%]/),"atom"):(B.eatWhile(/[\w\-_]/),L=O(D),L.name=="begin"&&(L.argument=B.current()),L.styleIdentifier())}function G(B,D,L){if(B.eatSpace())return null;if(L&&B.match(L))return ie(D,j),"keyword";if(B.match(/^\\[a-zA-Z@]+/))return"tag";if(B.match(/^[a-zA-Z]+/))return"variable-2";if(B.match(/^\\[$&%#{}_]/))return"tag";if(B.match(/^\\[,;!\/]/))return"tag";if(B.match(/^[\^_&]/))return"tag";if(B.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(B.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var T=B.next();return T=="{"||T=="}"||T=="["||T=="]"||T=="("||T==")"?"bracket":T=="%"?(B.skipToEnd(),"comment"):"error"}function le(B,D){var L=B.peek(),T;return L=="{"||L=="["?(T=ue(D),T.openBracket(L),B.eat(L),ie(D,j),"bracket"):/[ \t\r]/.test(L)?(B.eat(L),null):(ie(D,j),ee(D),j(B,D))}return{startState:function(){var B=H.inMathMode?function(D,L){return G(D,L)}:j;return{cmdState:[],f:B}},copyState:function(B){return{cmdState:B.cmdState.slice(),f:B.f}},token:function(B,D){return D.f(B,D)},blankLine:function(B){B.f=j,B.cmdState.length=0},lineComment:"%"}}),M.defineMIME("text/x-stex","stex"),M.defineMIME("text/x-latex","stex")})},"19Vz":function(ht,Ye,w){(function(M){M(w("VrN/"))})(function(M){M.defineOption("placeholder","",function(S,C,ie){var j=ie&&ie!=M.Init;if(C&&!j)S.on("blur",ue),S.on("change",ee),S.on("swapDoc",ee),M.on(S.getInputField(),"compositionupdate",S.state.placeholderCompose=function(){he(S)}),ee(S);else if(!C&&j){S.off("blur",ue),S.off("change",ee),S.off("swapDoc",ee),M.off(S.getInputField(),"compositionupdate",S.state.placeholderCompose),Ce(S);var G=S.getWrapperElement();G.className=G.className.replace(" CodeMirror-empty","")}C&&!S.hasFocus()&&ue(S)});function Ce(S){S.state.placeholder&&(S.state.placeholder.parentNode.removeChild(S.state.placeholder),S.state.placeholder=null)}function H(S){Ce(S);var C=S.state.placeholder=document.createElement("pre");C.style.cssText="height: 0; overflow: visible",C.style.direction=S.getOption("direction"),C.className="CodeMirror-placeholder CodeMirror-line-like";var ie=S.getOption("placeholder");typeof ie=="string"&&(ie=document.createTextNode(ie)),C.appendChild(ie),S.display.lineSpace.insertBefore(C,S.display.lineSpace.firstChild)}function he(S){setTimeout(function(){var C=!1,ie=S.getInputField();ie.nodeName=="TEXTAREA"?C=!ie.value:S.lineCount()==1&&(C=!/[^\u200b]/.test(ie.querySelector(".CodeMirror-line").textContent)),C?H(S):Ce(S)},20)}function ue(S){O(S)&&H(S)}function ee(S){var C=S.getWrapperElement(),ie=O(S);C.className=C.className.replace(" CodeMirror-empty","")+(ie?" CodeMirror-empty":""),ie?H(S):Ce(S)}function O(S){return S.lineCount()===1&&S.getLine(0)===""}})},"1eCo":function(ht,Ye,w){(function(M){M(w("VrN/"))})(function(M){"use strict";var Ce={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},H={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};M.defineMode("xml",function(he,ue){var ee=he.indentUnit,O={},S=ue.htmlMode?Ce:H;for(var C in S)O[C]=S[C];for(var C in ue)O[C]=ue[C];var ie,j;function G(v,U){function P(ae){return U.tokenize=ae,ae(v,U)}var b=v.next();if(b=="<")return v.eat("!")?v.eat("[")?v.match("CDATA[")?P(D("atom","]]>")):null:v.match("--")?P(D("comment","-->")):v.match("DOCTYPE",!0,!0)?(v.eatWhile(/[\w\._\-]/),P(L(1))):null:v.eat("?")?(v.eatWhile(/[\w\._\-]/),U.tokenize=D("meta","?>"),"meta"):(ie=v.eat("/")?"closeTag":"openTag",U.tokenize=le,"tag bracket");if(b=="&"){var F;return v.eat("#")?v.eat("x")?F=v.eatWhile(/[a-fA-F\d]/)&&v.eat(";"):F=v.eatWhile(/[\d]/)&&v.eat(";"):F=v.eatWhile(/[\w\.\-:]/)&&v.eat(";"),F?"atom":"error"}else return v.eatWhile(/[^&<]/),null}G.isInText=!0;function le(v,U){var P=v.next();if(P==">"||P=="/"&&v.eat(">"))return U.tokenize=G,ie=P==">"?"endTag":"selfcloseTag","tag bracket";if(P=="=")return ie="equals",null;if(P=="<"){U.tokenize=G,U.state=be,U.tagName=U.tagStart=null;var b=U.tokenize(v,U);return b?b+" tag error":"tag error"}else return/[\'\"]/.test(P)?(U.tokenize=B(P),U.stringStartCol=v.column(),U.tokenize(v,U)):(v.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function B(v){var U=function(P,b){for(;!P.eol();)if(P.next()==v){b.tokenize=le;break}return"string"};return U.isInAttribute=!0,U}function D(v,U){return function(P,b){for(;!P.eol();){if(P.match(U)){b.tokenize=G;break}P.next()}return v}}function L(v){return function(U,P){for(var b;(b=U.next())!=null;){if(b=="<")return P.tokenize=L(v+1),P.tokenize(U,P);if(b==">")if(v==1){P.tokenize=G;break}else return P.tokenize=L(v-1),P.tokenize(U,P)}return"meta"}}function T(v,U,P){this.prev=v.context,this.tagName=U,this.indent=v.indented,this.startOfLine=P,(O.doNotIndent.hasOwnProperty(U)||v.context&&v.context.noIndent)&&(this.noIndent=!0)}function X(v){v.context&&(v.context=v.context.prev)}function V(v,U){for(var P;;){if(!v.context)return;if(P=v.context.tagName,!O.contextGrabbers.hasOwnProperty(P)||!O.contextGrabbers[P].hasOwnProperty(U))return;X(v)}}function be(v,U,P){return v=="openTag"?(P.tagStart=U.column(),Ie):v=="closeTag"?$:be}function Ie(v,U,P){return v=="word"?(P.tagName=U.current(),j="tag",q):O.allowMissingTagName&&v=="endTag"?(j="tag bracket",q(v,U,P)):(j="error",Ie)}function $(v,U,P){if(v=="word"){var b=U.current();return P.context&&P.context.tagName!=b&&O.implicitlyClosed.hasOwnProperty(P.context.tagName)&&X(P),P.context&&P.context.tagName==b||O.matchClosing===!1?(j="tag",ne):(j="tag error",_e)}else return O.allowMissingTagName&&v=="endTag"?(j="tag bracket",ne(v,U,P)):(j="error",_e)}function ne(v,U,P){return v!="endTag"?(j="error",ne):(X(P),be)}function _e(v,U,P){return j="error",ne(v,U,P)}function q(v,U,P){if(v=="word")return j="attribute",Q;if(v=="endTag"||v=="selfcloseTag"){var b=P.tagName,F=P.tagStart;return P.tagName=P.tagStart=null,v=="selfcloseTag"||O.autoSelfClosers.hasOwnProperty(b)?V(P,b):(V(P,b),P.context=new T(P,b,F==P.indented)),be}return j="error",q}function Q(v,U,P){return v=="equals"?ge:(O.allowMissing||(j="error"),q(v,U,P))}function ge(v,U,P){return v=="string"?J:v=="word"&&O.allowUnquoted?(j="string",q):(j="error",q(v,U,P))}function J(v,U,P){return v=="string"?J:q(v,U,P)}return{startState:function(v){var U={tokenize:G,state:be,indented:v||0,tagName:null,tagStart:null,context:null};return v!=null&&(U.baseIndent=v),U},token:function(v,U){if(!U.tagName&&v.sol()&&(U.indented=v.indentation()),v.eatSpace())return null;ie=null;var P=U.tokenize(v,U);return(P||ie)&&P!="comment"&&(j=null,U.state=U.state(ie||P,v,U),j&&(P=j=="error"?P+" error":j)),P},indent:function(v,U,P){var b=v.context;if(v.tokenize.isInAttribute)return v.tagStart==v.indented?v.stringStartCol+1:v.indented+ee;if(b&&b.noIndent)return M.Pass;if(v.tokenize!=le&&v.tokenize!=G)return P?P.match(/^(\s*)/)[0].length:0;if(v.tagName)return O.multilineTagIndentPastTag!==!1?v.tagStart+v.tagName.length+2:v.tagStart+ee*(O.multilineTagIndentFactor||1);if(O.alignCDATA&&/<!\[CDATA\[/.test(U))return 0;var F=U&&/^<(\/)?([\w_:\.-]*)/.exec(U);if(F&&F[1])for(;b;)if(b.tagName==F[2]){b=b.prev;break}else if(O.implicitlyClosed.hasOwnProperty(b.tagName))b=b.prev;else break;else if(F)for(;b;){var ae=O.contextGrabbers[b.tagName];if(ae&&ae.hasOwnProperty(F[2]))b=b.prev;else break}for(;b&&b.prev&&!b.startOfLine;)b=b.prev;return b?b.indent+ee:v.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:O.htmlMode?"html":"xml",helperType:O.htmlMode?"html":"xml",skipAttribute:function(v){v.state==ge&&(v.state=q)},xmlCurrentTag:function(v){return v.tagName?{name:v.tagName,close:v.type=="closeTag"}:null},xmlCurrentContext:function(v){for(var U=[],P=v.context;P;P=P.prev)P.tagName&&U.push(P.tagName);return U.reverse()}}}),M.defineMIME("text/xml","xml"),M.defineMIME("application/xml","xml"),M.mimeModes.hasOwnProperty("text/html")||M.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"7ahc":function(ht,Ye,w){"use strict";w.d(Ye,"a",function(){return Ie});var M=w("k1fw"),Ce=w("0Owb"),H=w("+L6B"),he=w("2/Rp"),ue=w("y8nQ"),ee=w("Vl3Y"),O=w("tJVT"),S=w("OaEy"),C=w("2fM7"),ie=w("q1tI"),j=w.n(ie),G=w("VrN/"),le=w.n(G),B=w("p77/"),D=w.n(B),L=w("c5Ni"),T=w.n(L),X=C.a.Option,V={labelCol:{span:4},wrapperCol:{span:20}},be={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};Ye.b=function($){var ne=$.callback,_e=$.onCancel,q=Object(ie.useState)("python"),Q=Object(O.a)(q,2),ge=Q[0],J=Q[1];function v(P){J(be[P][1])}function U(P){ne(P)}return j.a.createElement(ee.a,Object(Ce.a)({},V,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:U}),j.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},j.a.createElement(C.a,{onChange:v},Object.keys(be).map(function(P){return j.a.createElement(X,{key:P,value:P},be[P][0])}))),j.a.createElement(ee.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},j.a.createElement(Ie,{mode:ge})),j.a.createElement("div",{className:"flex-container flex-end"},j.a.createElement(he.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),j.a.createElement(he.a,{type:"ghost",onClick:_e},"\u53D6\u6D88")))};function Ie($){var ne=$.value,_e=$.onChange,q=$.mode,Q=$.options,ge=Q===void 0?{}:Q,J=Object(ie.useRef)(),v=Object(ie.useState)(),U=Object(O.a)(v,2),P=U[0],b=U[1];return Object(ie.useEffect)(function(){if(P){function F(ae){var W=ae.getValue();_e&&_e(W)}return P.on("change",F),function(){P.off("change",F)}}},[P,_e]),Object(ie.useEffect)(function(){P&&P.setOption("mode",q)},[P,q]),Object(ie.useEffect)(function(){P&&((ne!==P.getValue()||ne==="")&&setTimeout(function(){P.setValue(ne||" ")},300))},[P,ne]),Object(ie.useEffect)(function(){if(J.current&&!P){var F=le.a.fromTextArea(J.current,Object(M.a)({mode:q,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ge));b(F)}},[J.current,P]),j.a.createElement("div",{className:"my-codemirror-container"},j.a.createElement("textarea",{ref:J}))}},"7ixt":function(ht,Ye,w){"use strict";w.d(Ye,"a",function(){return H});var M={adjustX:1,adjustY:1},Ce=[0,0],H={left:{points:["cr","cl"],overflow:M,offset:[-4,0],targetOffset:Ce},right:{points:["cl","cr"],overflow:M,offset:[4,0],targetOffset:Ce},top:{points:["bc","tc"],overflow:M,offset:[0,-4],targetOffset:Ce},bottom:{points:["tc","bc"],overflow:M,offset:[0,4],targetOffset:Ce},topLeft:{points:["bl","tl"],overflow:M,offset:[0,-4],targetOffset:Ce},leftTop:{points:["tr","tl"],overflow:M,offset:[-4,0],targetOffset:Ce},topRight:{points:["br","tr"],overflow:M,offset:[0,-4],targetOffset:Ce},rightTop:{points:["tl","tr"],overflow:M,offset:[4,0],targetOffset:Ce},bottomRight:{points:["tr","br"],overflow:M,offset:[0,4],targetOffset:Ce},rightBottom:{points:["bl","br"],overflow:M,offset:[4,0],targetOffset:Ce},bottomLeft:{points:["tl","bl"],overflow:M,offset:[0,4],targetOffset:Ce},leftBottom:{points:["br","bl"],overflow:M,offset:[-4,0],targetOffset:Ce}},he=H},"8EBN":function(ht,Ye,w){(function(M){M(w("VrN/"))})(function(M){"use strict";M.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Ce=0;Ce<M.modeInfo.length;Ce++){var H=M.modeInfo[Ce];H.mimes&&(H.mime=H.mimes[0])}M.findModeByMIME=function(he){he=he.toLowerCase();for(var ue=0;ue<M.modeInfo.length;ue++){var ee=M.modeInfo[ue];if(ee.mime==he)return ee;if(ee.mimes){for(var O=0;O<ee.mimes.length;O++)if(ee.mimes[O]==he)return ee}}if(/\+xml$/.test(he))return M.findModeByMIME("application/xml");if(/\+json$/.test(he))return M.findModeByMIME("application/json")},M.findModeByExtension=function(he){he=he.toLowerCase();for(var ue=0;ue<M.modeInfo.length;ue++){var ee=M.modeInfo[ue];if(ee.ext){for(var O=0;O<ee.ext.length;O++)if(ee.ext[O]==he)return ee}}},M.findModeByFileName=function(he){for(var ue=0;ue<M.modeInfo.length;ue++){var ee=M.modeInfo[ue];if(ee.file&&ee.file.test(he))return ee}var O=he.lastIndexOf("."),S=O>-1&&he.substring(O+1,he.length);if(S)return M.findModeByExtension(S)},M.findModeByName=function(he){he=he.toLowerCase();for(var ue=0;ue<M.modeInfo.length;ue++){var ee=M.modeInfo[ue];if(ee.name.toLowerCase()==he)return ee;if(ee.alias){for(var O=0;O<ee.alias.length;O++)if(ee.alias[O].toLowerCase()==he)return ee}}}})},"9Bee":function(ht,Ye,w){"use strict";var M=w("k1fw"),Ce=w("tJVT"),H=w("q1tI"),he=w.n(H),ue=w("vg9a"),ee=w("DlQD"),O=w.n(ee),S=w("rUJ1");function C(_,Z){var Y=_.match(/^(\s+)(?:```)/);if(Y===null)return Z;var Se=Y[1];return Z.split(`
`).map(function(je){var de=je.match(/^\s+/);if(de===null)return je;var Le=Object(Ce.a)(de,1),ce=Le[0];return ce.length>=Se.length?je.slice(Se.length):je}).join(`
`)}var ie=[],j=["<ul>"],G=new O.a.Renderer,le=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function B(){ie.length=0,j=["<ul>"]}var D={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function L(_,Z,Y,Se){if(Z>=_.length||_[Z].level<=Y)return Z;var je=_[Z];Se.push("<li><a href='#"+je.anchor+"'>"+je.text+"</a>"),Z++;var de=[];return Z=L(_,Z,je.level,de),de.length>0&&(Se.push("<ul>"),de.forEach(function(Le){Se.push(Le)}),Se.push("</ul>")),Se.push("</li>"),Z=L(_,Z,Y,Se),Z}function T(){return L(ie,0,0,j),j.push("</ul>"),j.join("")}var X={heading:function(Z){var Y=le.exec(Z);if(Y)return{type:"heading",raw:Y[0],depth:Y[1].length,text:Y[2]}},fences:function(Z){var Y=this.rules.block.fences.exec(Z);if(Y){var Se=Y[0],je=C(Se,Y[3]||""),de=Y[2]?Y[2].trim():Y[2];if(["latex","katex","math"].indexOf(de)>=0){var Le=Ie(),ce=je;je=Le,$[Le]={type:"block",expression:ce}}return{type:"code",raw:Se,lang:de,text:je}}}},V=/(?:\${2})([^\n`]+?)(?:\${2})/gi,be=0,Ie=function(){return"__special_katext_id_".concat(be++,"__")},$={};function ne(){return $}function _e(){be=0,$={}}function q(_){return _=_.replace(V,function(Z,Y){var Se=Ie();return $[Se]={type:"inline",expression:Y},Se}),_}var Q=G.listitem;G.listitem=function(_){return Q(q(_))};var ge=G.paragraph;G.paragraph=function(_){return ge(q(_))};var J=G.tablecell;G.tablecell=function(_,Z){return J(q(_),Z)},G.code=function(_,Z,Y){var Se=(Z||"").match(/\S*/)[0];return Se?["latex","katex","math"].indexOf(Se)>=0?"<p class='editormd-tex'>".concat(_,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(Z,'">').concat(Y?_:Object(S.escape)(_,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(Y?_:Object(S.escape)(_,!0))+"</code></pre>"},G.heading=function(_,Z,Y){var Se=this.options.headerPrefix+Y.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return ie.push({anchor:Se,level:Z,text:_}),"<h"+Z+' id="'+Se+'">'+_+"</h"+Z+">"},O.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),O.a.use({tokenizer:X,renderer:G});var v=O.a,U=w("SJMd"),P=w("ulZh"),b=w.n(P),F=w("m3rI"),ae=w("Oy/b"),W=w("p5ED"),Ee=/<pre[^>]*>/g;function m(_){var Z=document.createElement("div");return Z.innerHTML=_,Z.childNodes.length===0?"":Z.childNodes[0].nodeValue}var c=Ye.a=function(_){var Z=_.value,Y=Z===void 0?"":Z,Se=_.className,je=_.showTextOnly,de=_.showLines,Le=_.style,ce=Le===void 0?{}:Le,me=_.stylesPrev,R=me===void 0?{}:me,z=String(Y),Oe=Object(H.useState)(""),We=Object(Ce.a)(Oe,2),Ze=We[0],He=We[1],Be=Object(H.useMemo)(function(){try{var Ne=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Ae=/\"\/api\/attachments\/|\"\/attachments\/download\//g,oe=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;z=z.replace(Ne,"("+F.a.API_SERVER+"/api/attachments/").replace(Ae,'"'+F.a.API_SERVER+"/api/attachments/").replace(oe,'"'+F.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`),z=z.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
`)}catch(Ve){}var ye=v(z),ze=ne();if(z.match(/\[TOC\]/)&&(ye=ye.replace("<p>[TOC]</p>",T()),B()),ye=ye.replace(/(__special_katext_id_\d+__)/g,function(Ve,Fe){var it=ze[Fe],qe=it.type,$e=it.expression;return Object(ae.renderToString)(m($e)||"",{displayMode:qe==="block",throwOnError:!1,output:"html"})}),ye=ye.replace(/▁/g,"\u2581\u2581\u2581"),_e(),je){var Ge=document.createElement("div");return Ge.innerHTML=ye,Ge.innerText}return setTimeout(function(){return De()},500),ye},[z]),ve=Object(H.useRef)();D.WebkitLineClamp=de,de&&(ce=Object(M.a)(Object(M.a)({},ce),D));function we(Ne){var Ae=Ne.target;if(Ae.tagName.toUpperCase()==="A"){var oe=Ae.getAttribute("href");if(oe.indexOf("office")>-1)Ne.preventDefault(),He(oe);else if(oe.startsWith("#")){Ne.preventDefault();var ye=document.getElementById(oe.replace("#",""));ye&&ye.scrollIntoView(!0)}}}var De=function(){var Ae,oe=(Ae=ve.current)===null||Ae===void 0?void 0:Ae.querySelectorAll("video");oe==null||oe.forEach(function(ye){if(ye.oncontextmenu=function(){return!1},ye.src.indexOf(".m3u8")>-1&&!ye.canPlayType("application/vnd.apple.mpegurl")){if(b.a.isSupported()){var ze=new b.a;ze.loadSource(ye.src),ze.attachMedia(ye)}}})};return Object(H.useEffect)(function(){if(ve.current&&Be&&(Be.match(Ee)&&window.PR.prettyPrint()),ve.current)return ve.current.addEventListener("click",we),function(){ve.current.removeEventListener("click",we),_e(),B()}},[Be,ve.current,we]),he.a.createElement(he.a.Fragment,null,he.a.createElement("div",{ref:ve,style:Object(M.a)({},ce),className:"".concat(Se||""," markdown-body "),dangerouslySetInnerHTML:{__html:Be}}),he.a.createElement(W.a,{close:!0,data:Ze,type:Ze!=null&&Ze.length?"office":"",style:Object(M.a)({},R),onClose:function(){return He("")}}))}},"9VGf":function(ht,Ye,w){"use strict";w.d(Ye,"a",function(){return H});var M=w("q1tI"),Ce=w.n(M);function H(he,ue){var ee=Object(M.useRef)();Object(M.useEffect)(function(){ee.current=he}),Object(M.useEffect)(function(){function O(){ee.current()}if(ue!==null){var S=setInterval(O,ue);return function(){return clearInterval(S)}}},[ue])}},Bd2K:function(ht,Ye,w){(function(M){M(w("VrN/"),w("osHv"))})(function(M){M.defineOption("autoCloseTags",!1,function(C,ie,j){if(j!=M.Init&&j&&C.removeKeyMap("autoCloseTags"),!ie)return;var G={name:"autoCloseTags"};(typeof ie!="object"||ie.whenClosing!==!1)&&(G["'/'"]=function(le){return ee(le)}),(typeof ie!="object"||ie.whenOpening!==!1)&&(G["'>'"]=function(le){return he(le)}),C.addKeyMap(G)});var Ce=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],H=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function he(C){if(C.getOption("disableInput"))return M.Pass;for(var ie=C.listSelections(),j=[],G=C.getOption("autoCloseTags"),le=0;le<ie.length;le++){if(!ie[le].empty())return M.Pass;var B=ie[le].head,D=C.getTokenAt(B),L=M.innerMode(C.getMode(),D.state),T=L.state,X=L.mode.xmlCurrentTag&&L.mode.xmlCurrentTag(T),V=X&&X.name;if(!V)return M.Pass;var be=L.mode.configuration=="html",Ie=typeof G=="object"&&G.dontCloseTags||be&&Ce,$=typeof G=="object"&&G.indentTags||be&&H;D.end>B.ch&&(V=V.slice(0,V.length-D.end+B.ch));var ne=V.toLowerCase();if(!V||D.type=="string"&&(D.end!=B.ch||!/[\"\']/.test(D.string.charAt(D.string.length-1))||D.string.length==1)||D.type=="tag"&&X.close||D.string.indexOf("/")==B.ch-D.start-1||Ie&&O(Ie,ne)>-1||S(C,L.mode.xmlCurrentContext&&L.mode.xmlCurrentContext(T)||[],V,B,!0))return M.Pass;var _e=typeof G=="object"&&G.emptyTags;if(_e&&O(_e,V)>-1){j[le]={text:"/>",newPos:M.Pos(B.line,B.ch+2)};continue}var q=$&&O($,ne)>-1;j[le]={indent:q,text:">"+(q?`
`:"")+"</"+V+">",newPos:q?M.Pos(B.line+1,0):M.Pos(B.line,B.ch+1)}}for(var Q=typeof G=="object"&&G.dontIndentOnAutoClose,le=ie.length-1;le>=0;le--){var ge=j[le];C.replaceRange(ge.text,ie[le].head,ie[le].anchor,"+insert");var J=C.listSelections().slice(0);J[le]={head:ge.newPos,anchor:ge.newPos},C.setSelections(J),!Q&&ge.indent&&(C.indentLine(ge.newPos.line,null,!0),C.indentLine(ge.newPos.line+1,null,!0))}}function ue(C,ie){for(var j=C.listSelections(),G=[],le=ie?"/":"</",B=C.getOption("autoCloseTags"),D=typeof B=="object"&&B.dontIndentOnSlash,L=0;L<j.length;L++){if(!j[L].empty())return M.Pass;var T=j[L].head,X=C.getTokenAt(T),V=M.innerMode(C.getMode(),X.state),be=V.state;if(ie&&(X.type=="string"||X.string.charAt(0)!="<"||X.start!=T.ch-1))return M.Pass;var Ie,$=V.mode.name!="xml"&&C.getMode().name=="htmlmixed";if($&&V.mode.name=="javascript")Ie=le+"script";else if($&&V.mode.name=="css")Ie=le+"style";else{var ne=V.mode.xmlCurrentContext&&V.mode.xmlCurrentContext(be);if(!ne||ne.length&&S(C,ne,ne[ne.length-1],T))return M.Pass;Ie=le+ne[ne.length-1]}C.getLine(T.line).charAt(X.end)!=">"&&(Ie+=">"),G[L]=Ie}if(C.replaceSelections(G),j=C.listSelections(),!D)for(var L=0;L<j.length;L++)(L==j.length-1||j[L].head.line<j[L+1].head.line)&&C.indentLine(j[L].head.line)}function ee(C){return C.getOption("disableInput")?M.Pass:ue(C,!0)}M.commands.closeTag=function(C){return ue(C)};function O(C,ie){if(C.indexOf)return C.indexOf(ie);for(var j=0,G=C.length;j<G;++j)if(C[j]==ie)return j;return-1}function S(C,ie,j,G,le){if(!M.scanForClosingTag)return!1;var B=Math.min(C.lastLine()+1,G.line+500),D=M.scanForClosingTag(C,G,null,B);if(!D||D.tag!=j)return!1;for(var L=le?1:0,T=ie.length-1;T>=0&&ie[T]==j;T--)++L;G=D.to;for(var T=1;T<L;T++){var X=M.scanForClosingTag(C,G,null,B);if(!X||X.tag!=j)return!1;G=X.to}return!0}})},BjJ7:function(ht,Ye,w){"use strict";w.d(Ye,"d",function(){return Ce}),w.d(Ye,"c",function(){return H}),w.d(Ye,"e",function(){return he}),w.d(Ye,"b",function(){return ue}),w.d(Ye,"a",function(){return O});var M=w("m3rI");function Ce(S){var C=!0;if(S.length>0){for(var ie=0;ie<S.length;ie++)if(S[ie].compile_success==0||!S[ie].compile_success){C=!1;break}}else C=!1;return C}function H(S){for(var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",ie=[],j=0;j<S.length;j++){var G=S[j],le=C?"".concat(C,"/").concat(G.name):"".concat(G.name);ie.push({title:G.name,isLeaf:!(G.type==="tree"),key:le})}return ie}function he(S,C,ie){for(var j=0;j<S.length;j++){var G=S[j];if(G.key===C){G.children=ie;break}G.children&&he(G.children,C,ie)}return S}function ue(S,C,ie){var j;return function(){var G=this,le=arguments,B=function(){j=null,ie||S.apply(G,le)},D=ie&&!j;clearTimeout(j),j=setTimeout(B,C),D&&S.apply(G,le)}}var ee=!0,O=M.a.API_SERVER},"C+DQ":function(ht,Ye,w){},DlQD:function(ht,Ye,w){(function(M,Ce){ht.exports=Ce()})(this,function(){"use strict";function M(y,x){for(var k=0;k<x.length;k++){var d=x[k];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(y,d.key,d)}}function Ce(y,x,k){return x&&M(y.prototype,x),k&&M(y,k),y}function H(y,x){if(!y)return;if(typeof y=="string")return he(y,x);var k=Object.prototype.toString.call(y).slice(8,-1);if(k==="Object"&&y.constructor&&(k=y.constructor.name),k==="Map"||k==="Set")return Array.from(y);if(k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k))return he(y,x)}function he(y,x){(x==null||x>y.length)&&(x=y.length);for(var k=0,d=new Array(x);k<x;k++)d[k]=y[k];return d}function ue(y,x){var k;if(typeof Symbol=="undefined"||y[Symbol.iterator]==null){if(Array.isArray(y)||(k=H(y))||x&&y&&typeof y.length=="number"){k&&(y=k);var d=0;return function(){return d>=y.length?{done:!0}:{done:!1,value:y[d++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return k=y[Symbol.iterator](),k.next.bind(k)}function ee(y,x){return x={exports:{}},y(x,x.exports),x.exports}var O=ee(function(y){function x(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function k(d){y.exports.defaults=d}y.exports={defaults:x(),getDefaults:x,changeDefaults:k}}),S=O.defaults,C=O.getDefaults,ie=O.changeDefaults,j=/[&<>"']/,G=/[&<>"']/g,le=/[<>"']|&(?!#?\w+;)/,B=/[<>"']|&(?!#?\w+;)/g,D={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},L=function(x){return D[x]};function T(y,x){if(x){if(j.test(y))return y.replace(G,L)}else if(le.test(y))return y.replace(B,L);return y}var X=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function V(y){return y.replace(X,function(x,k){return k=k.toLowerCase(),k==="colon"?":":k.charAt(0)==="#"?k.charAt(1)==="x"?String.fromCharCode(parseInt(k.substring(2),16)):String.fromCharCode(+k.substring(1)):""})}var be=/(^|[^\[])\^/g;function Ie(y,x){y=y.source||y,x=x||"";var k={replace:function(f,h){return h=h.source||h,h=h.replace(be,"$1"),y=y.replace(f,h),k},getRegex:function(){return new RegExp(y,x)}};return k}var $=/[^\w:]/g,ne=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _e(y,x,k){if(y){var d;try{d=decodeURIComponent(V(k)).replace($,"").toLowerCase()}catch(f){return null}if(d.indexOf("javascript:")===0||d.indexOf("vbscript:")===0||d.indexOf("data:")===0)return null}x&&!ne.test(k)&&(k=v(x,k));try{k=encodeURI(k).replace(/%25/g,"%")}catch(f){return null}return k}var q={},Q=/^[^:]+:\/*[^/]*$/,ge=/^([^:]+:)[\s\S]*$/,J=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(y,x){q[" "+y]||(Q.test(y)?q[" "+y]=y+"/":q[" "+y]=F(y,"/",!0)),y=q[" "+y];var k=y.indexOf(":")===-1;return x.substring(0,2)==="//"?k?x:y.replace(ge,"$1")+x:x.charAt(0)==="/"?k?x:y.replace(J,"$1")+x:y+x}var U={exec:function(){}};function P(y){for(var x=1,k,d;x<arguments.length;x++){k=arguments[x];for(d in k)Object.prototype.hasOwnProperty.call(k,d)&&(y[d]=k[d])}return y}function b(y,x){var k=y.replace(/\|/g,function(h,p,N){for(var K=!1,pe=p;--pe>=0&&N[pe]==="\\";)K=!K;return K?"|":" |"}),d=k.split(/ \|/),f=0;if(d.length>x)d.splice(x);else for(;d.length<x;)d.push("");for(;f<d.length;f++)d[f]=d[f].trim().replace(/\\\|/g,"|");return d}function F(y,x,k){var d=y.length;if(d===0)return"";for(var f=0;f<d;){var h=y.charAt(d-f-1);if(h===x&&!k)f++;else if(h!==x&&k)f++;else break}return y.substr(0,d-f)}function ae(y,x){if(y.indexOf(x[1])===-1)return-1;for(var k=y.length,d=0,f=0;f<k;f++)if(y[f]==="\\")f++;else if(y[f]===x[0])d++;else if(y[f]===x[1]&&(d--,d<0))return f;return-1}function W(y){y&&y.sanitize&&!y.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var Ee={escape:T,unescape:V,edit:Ie,cleanUrl:_e,resolveUrl:v,noopTest:U,merge:P,splitCells:b,rtrim:F,findClosingBracket:ae,checkSanitizeDeprecation:W},m=O.defaults,c=Ee.rtrim,_=Ee.splitCells,Z=Ee.escape,Y=Ee.findClosingBracket;function Se(y,x,k){var d=x.href,f=x.title?Z(x.title):null,h=y[1].replace(/\\([\[\]])/g,"$1");return y[0].charAt(0)!=="!"?{type:"link",raw:k,href:d,title:f,text:h}:{type:"image",raw:k,href:d,title:f,text:Z(h)}}function je(y,x){var k=y.match(/^(\s+)(?:```)/);if(k===null)return x;var d=k[1];return x.split(`
`).map(function(f){var h=f.match(/^\s+/);if(h===null)return f;var p=h[0];return p.length>=d.length?f.slice(d.length):f}).join(`
`)}var de=function(){function y(k){this.options=k||m}var x=y.prototype;return x.space=function(d){var f=this.rules.block.newline.exec(d);if(f)return f[0].length>1?{type:"space",raw:f[0]}:{raw:`
`}},x.code=function(d,f){var h=this.rules.block.code.exec(d);if(h){var p=f[f.length-1];if(p&&p.type==="paragraph")return{raw:h[0],text:h[0].trimRight()};var N=h[0].replace(/^ {4}/gm,"");return{type:"code",raw:h[0],codeBlockStyle:"indented",text:this.options.pedantic?N:c(N,`
`)}}},x.fences=function(d){var f=this.rules.block.fences.exec(d);if(f){var h=f[0],p=je(h,f[3]||"");return{type:"code",raw:h,lang:f[2]?f[2].trim():f[2],text:p}}},x.heading=function(d){var f=this.rules.block.heading.exec(d);if(f)return{type:"heading",raw:f[0],depth:f[1].length,text:f[2]}},x.nptable=function(d){var f=this.rules.block.nptable.exec(d);if(f){var h={type:"table",header:_(f[1].replace(/^ *| *\| *$/g,"")),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3]?f[3].replace(/\n$/,"").split(`
`):[],raw:f[0]};if(h.header.length===h.align.length){var p=h.align.length,N;for(N=0;N<p;N++)/^ *-+: *$/.test(h.align[N])?h.align[N]="right":/^ *:-+: *$/.test(h.align[N])?h.align[N]="center":/^ *:-+ *$/.test(h.align[N])?h.align[N]="left":h.align[N]=null;for(p=h.cells.length,N=0;N<p;N++)h.cells[N]=_(h.cells[N],h.header.length);return h}}},x.hr=function(d){var f=this.rules.block.hr.exec(d);if(f)return{type:"hr",raw:f[0]}},x.blockquote=function(d){var f=this.rules.block.blockquote.exec(d);if(f){var h=f[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:f[0],text:h}}},x.list=function(d){var f=this.rules.block.list.exec(d);if(f){for(var h=f[0],p=f[2],N=p.length>1,K=p[p.length-1]===")",pe={type:"list",raw:h,ordered:N,start:N?+p.slice(0,-1):"",loose:!1,items:[]},tt=f[0].match(this.rules.block.item),dt=!1,at,Pt,pt,st,Wt,bt,$t,Bt=tt.length,mt=0;mt<Bt;mt++)at=tt[mt],h=at,Pt=at.length,at=at.replace(/^ *([*+-]|\d+[.)]) */,""),~at.indexOf(`
`)&&(Pt-=at.length,at=this.options.pedantic?at.replace(/^ {1,4}/gm,""):at.replace(new RegExp("^ {1,"+Pt+"}","gm"),"")),mt!==Bt-1&&(pt=this.rules.block.bullet.exec(tt[mt+1])[0],(N?pt.length===1||!K&&pt[pt.length-1]===")":pt.length>1||this.options.smartLists&&pt!==p)&&(st=tt.slice(mt+1).join(`
`),pe.raw=pe.raw.substring(0,pe.raw.length-st.length),mt=Bt-1)),Wt=dt||/\n\n(?!\s*$)/.test(at),mt!==Bt-1&&(dt=at.charAt(at.length-1)===`
`,Wt||(Wt=dt)),Wt&&(pe.loose=!0),bt=/^\[[ xX]\] /.test(at),$t=void 0,bt&&($t=at[1]!==" ",at=at.replace(/^\[[ xX]\] +/,"")),pe.items.push({type:"list_item",raw:h,task:bt,checked:$t,loose:Wt,text:at});return pe}},x.html=function(d){var f=this.rules.block.html.exec(d);if(f)return{type:this.options.sanitize?"paragraph":"html",raw:f[0],pre:!this.options.sanitizer&&(f[1]==="pre"||f[1]==="script"||f[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(f[0]):Z(f[0]):f[0]}},x.def=function(d){var f=this.rules.block.def.exec(d);if(f){f[3]&&(f[3]=f[3].substring(1,f[3].length-1));var h=f[1].toLowerCase().replace(/\s+/g," ");return{tag:h,raw:f[0],href:f[2],title:f[3]}}},x.table=function(d){var f=this.rules.block.table.exec(d);if(f){var h={type:"table",header:_(f[1].replace(/^ *| *\| *$/g,"")),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:f[3]?f[3].replace(/\n$/,"").split(`
`):[]};if(h.header.length===h.align.length){h.raw=f[0];var p=h.align.length,N;for(N=0;N<p;N++)/^ *-+: *$/.test(h.align[N])?h.align[N]="right":/^ *:-+: *$/.test(h.align[N])?h.align[N]="center":/^ *:-+ *$/.test(h.align[N])?h.align[N]="left":h.align[N]=null;for(p=h.cells.length,N=0;N<p;N++)h.cells[N]=_(h.cells[N].replace(/^ *\| *| *\| *$/g,""),h.header.length);return h}}},x.lheading=function(d){var f=this.rules.block.lheading.exec(d);if(f)return{type:"heading",raw:f[0],depth:f[2].charAt(0)==="="?1:2,text:f[1]}},x.paragraph=function(d){var f=this.rules.block.paragraph.exec(d);if(f)return{type:"paragraph",raw:f[0],text:f[1].charAt(f[1].length-1)===`
`?f[1].slice(0,-1):f[1]}},x.text=function(d,f){var h=this.rules.block.text.exec(d);if(h){var p=f[f.length-1];return p&&p.type==="text"?{raw:h[0],text:h[0]}:{type:"text",raw:h[0],text:h[0]}}},x.escape=function(d){var f=this.rules.inline.escape.exec(d);if(f)return{type:"escape",raw:f[0],text:Z(f[1])}},x.tag=function(d,f,h){var p=this.rules.inline.tag.exec(d);if(p)return!f&&/^<a /i.test(p[0])?f=!0:f&&/^<\/a>/i.test(p[0])&&(f=!1),!h&&/^<(pre|code|kbd|script)(\s|>)/i.test(p[0])?h=!0:h&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(p[0])&&(h=!1),{type:this.options.sanitize?"text":"html",raw:p[0],inLink:f,inRawBlock:h,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(p[0]):Z(p[0]):p[0]}},x.link=function(d){var f=this.rules.inline.link.exec(d);if(f){var h=Y(f[2],"()");if(h>-1){var p=f[0].indexOf("!")===0?5:4,N=p+f[1].length+h;f[2]=f[2].substring(0,h),f[0]=f[0].substring(0,N).trim(),f[3]=""}var K=f[2],pe="";if(this.options.pedantic){var tt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(K);tt?(K=tt[1],pe=tt[3]):pe=""}else pe=f[3]?f[3].slice(1,-1):"";K=K.trim().replace(/^<([\s\S]*)>$/,"$1");var dt=Se(f,{href:K&&K.replace(this.rules.inline._escapes,"$1"),title:pe&&pe.replace(this.rules.inline._escapes,"$1")},f[0]);return dt}},x.reflink=function(d,f){var h;if((h=this.rules.inline.reflink.exec(d))||(h=this.rules.inline.nolink.exec(d))){var p=(h[2]||h[1]).replace(/\s+/g," ");if(p=f[p.toLowerCase()],!p||!p.href){var N=h[0].charAt(0);return{type:"text",raw:N,text:N}}var K=Se(h,p,h[0]);return K}},x.strong=function(d,f,h){h===void 0&&(h="");var p=this.rules.inline.strong.start.exec(d);if(p&&(!p[1]||p[1]&&(h===""||this.rules.inline.punctuation.exec(h)))){f=f.slice(-1*d.length);var N=p[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;N.lastIndex=0;for(var K;(p=N.exec(f))!=null;)if(K=this.rules.inline.strong.middle.exec(f.slice(0,p.index+3)),K)return{type:"strong",raw:d.slice(0,K[0].length),text:d.slice(2,K[0].length-2)}}},x.em=function(d,f,h){h===void 0&&(h="");var p=this.rules.inline.em.start.exec(d);if(p&&(!p[1]||p[1]&&(h===""||this.rules.inline.punctuation.exec(h)))){f=f.slice(-1*d.length);var N=p[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;N.lastIndex=0;for(var K;(p=N.exec(f))!=null;)if(K=this.rules.inline.em.middle.exec(f.slice(0,p.index+2)),K)return{type:"em",raw:d.slice(0,K[0].length),text:d.slice(1,K[0].length-1)}}},x.codespan=function(d){var f=this.rules.inline.code.exec(d);if(f){var h=f[2].replace(/\n/g," "),p=/[^ ]/.test(h),N=h.startsWith(" ")&&h.endsWith(" ");return p&&N&&(h=h.substring(1,h.length-1)),h=Z(h,!0),{type:"codespan",raw:f[0],text:h}}},x.br=function(d){var f=this.rules.inline.br.exec(d);if(f)return{type:"br",raw:f[0]}},x.del=function(d){var f=this.rules.inline.del.exec(d);if(f)return{type:"del",raw:f[0],text:f[1]}},x.autolink=function(d,f){var h=this.rules.inline.autolink.exec(d);if(h){var p,N;return h[2]==="@"?(p=Z(this.options.mangle?f(h[1]):h[1]),N="mailto:"+p):(p=Z(h[1]),N=p),{type:"link",raw:h[0],text:p,href:N,tokens:[{type:"text",raw:p,text:p}]}}},x.url=function(d,f){var h;if(h=this.rules.inline.url.exec(d)){var p,N;if(h[2]==="@")p=Z(this.options.mangle?f(h[0]):h[0]),N="mailto:"+p;else{var K;do K=h[0],h[0]=this.rules.inline._backpedal.exec(h[0])[0];while(K!==h[0]);p=Z(h[0]),h[1]==="www."?N="http://"+p:N=p}return{type:"link",raw:h[0],text:p,href:N,tokens:[{type:"text",raw:p,text:p}]}}},x.inlineText=function(d,f,h){var p=this.rules.inline.text.exec(d);if(p){var N;return f?N=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(p[0]):Z(p[0]):p[0]:N=Z(this.options.smartypants?h(p[0]):p[0]),{type:"text",raw:p[0],text:N}}},y}(),Le=Ee.noopTest,ce=Ee.edit,me=Ee.merge,R={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Le,table:Le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};R._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,R._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,R.def=ce(R.def).replace("label",R._label).replace("title",R._title).getRegex(),R.bullet=/(?:[*+-]|\d{1,9}[.)])/,R.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,R.item=ce(R.item,"gm").replace(/bull/g,R.bullet).getRegex(),R.list=ce(R.list).replace(/bull/g,R.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+R.def.source+")").getRegex(),R._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",R._comment=/<!--(?!-?>)[\s\S]*?-->/,R.html=ce(R.html,"i").replace("comment",R._comment).replace("tag",R._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),R.paragraph=ce(R._paragraph).replace("hr",R.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").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|!--)").replace("tag",R._tag).getRegex(),R.blockquote=ce(R.blockquote).replace("paragraph",R.paragraph).getRegex(),R.normal=me({},R),R.gfm=me({},R.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),R.gfm.nptable=ce(R.gfm.nptable).replace("hr",R.hr).replace("heading"," {0,3}#{1,6} ").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|!--)").replace("tag",R._tag).getRegex(),R.gfm.table=ce(R.gfm.table).replace("hr",R.hr).replace("heading"," {0,3}#{1,6} ").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|!--)").replace("tag",R._tag).getRegex(),R.pedantic=me({},R.normal,{html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",R._comment).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]+?) *(?:#+ *)?(?:\n+|$)/,fences:Le,paragraph:ce(R.normal._paragraph).replace("hr",R.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",R.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};z._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",z.punctuation=ce(z.punctuation).replace(/punctuation/g,z._punctuation).getRegex(),z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",z.em.start=ce(z.em.start).replace(/punctuation/g,z._punctuation).getRegex(),z.em.middle=ce(z.em.middle).replace(/punctuation/g,z._punctuation).replace(/overlapSkip/g,z._overlapSkip).getRegex(),z.em.endAst=ce(z.em.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.em.endUnd=ce(z.em.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.start=ce(z.strong.start).replace(/punctuation/g,z._punctuation).getRegex(),z.strong.middle=ce(z.strong.middle).replace(/punctuation/g,z._punctuation).replace(/blockSkip/g,z._blockSkip).getRegex(),z.strong.endAst=ce(z.strong.endAst,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.strong.endUnd=ce(z.strong.endUnd,"g").replace(/punctuation/g,z._punctuation).getRegex(),z.blockSkip=ce(z._blockSkip,"g").getRegex(),z.overlapSkip=ce(z._overlapSkip,"g").getRegex(),z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,z._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])?)+(?![-_])/,z.autolink=ce(z.autolink).replace("scheme",z._scheme).replace("email",z._email).getRegex(),z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,z.tag=ce(z.tag).replace("comment",R._comment).replace("attribute",z._attribute).getRegex(),z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,z.link=ce(z.link).replace("label",z._label).replace("href",z._href).replace("title",z._title).getRegex(),z.reflink=ce(z.reflink).replace("label",z._label).getRegex(),z.reflinkSearch=ce(z.reflinkSearch,"g").replace("reflink",z.reflink).replace("nolink",z.nolink).getRegex(),z.normal=me({},z),z.pedantic=me({},z.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",z._label).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",z._label).getRegex()}),z.gfm=me({},z.normal,{escape:ce(z.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),z.gfm.url=ce(z.gfm.url,"i").replace("email",z.gfm._extended_email).getRegex(),z.breaks=me({},z.gfm,{br:ce(z.br).replace("{2,}","*").getRegex(),text:ce(z.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Oe={block:R,inline:z},We=O.defaults,Ze=Oe.block,He=Oe.inline;function Be(y){return y.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function ve(y){var x="",k,d,f=y.length;for(k=0;k<f;k++)d=y.charCodeAt(k),Math.random()>.5&&(d="x"+d.toString(16)),x+="&#"+d+";";return x}var we=function(){function y(k){this.tokens=[],this.tokens.links=Object.create(null),this.options=k||We,this.options.tokenizer=this.options.tokenizer||new de,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var d={block:Ze.normal,inline:He.normal};this.options.pedantic?(d.block=Ze.pedantic,d.inline=He.pedantic):this.options.gfm&&(d.block=Ze.gfm,this.options.breaks?d.inline=He.breaks:d.inline=He.gfm),this.tokenizer.rules=d}y.lex=function(d,f){var h=new y(f);return h.lex(d)};var x=y.prototype;return x.lex=function(d){return d=d.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(d,this.tokens,!0),this.inline(this.tokens),this.tokens},x.blockTokens=function(d,f,h){f===void 0&&(f=[]),h===void 0&&(h=!0),d=d.replace(/^ +$/gm,"");for(var p,N,K,pe;d;){if(p=this.tokenizer.space(d)){d=d.substring(p.raw.length),p.type&&f.push(p);continue}if(p=this.tokenizer.code(d,f)){d=d.substring(p.raw.length),p.type?f.push(p):(pe=f[f.length-1],pe.raw+=`
`+p.raw,pe.text+=`
`+p.text);continue}if(p=this.tokenizer.fences(d)){d=d.substring(p.raw.length),f.push(p);continue}if(p=this.tokenizer.heading(d)){d=d.substring(p.raw.length),f.push(p);continue}if(p=this.tokenizer.nptable(d)){d=d.substring(p.raw.length),f.push(p);continue}if(p=this.tokenizer.hr(d)){d=d.substring(p.raw.length),f.push(p);continue}if(p=this.tokenizer.blockquote(d)){d=d.substring(p.raw.length),p.tokens=this.blockTokens(p.text,[],h),f.push(p);continue}if(p=this.tokenizer.list(d)){for(d=d.substring(p.raw.length),K=p.items.length,N=0;N<K;N++)p.items[N].tokens=this.blockTokens(p.items[N].text,[],!1);f.push(p);continue}if(p=this.tokenizer.html(d)){d=d.substring(p.raw.length),f.push(p);continue}if(h&&(p=this.tokenizer.def(d))){d=d.substring(p.raw.length),this.tokens.links[p.tag]||(this.tokens.links[p.tag]={href:p.href,title:p.title});continue}if(p=this.tokenizer.table(d)){d=d.substring(p.raw.length),f.push(p);continue}if(p=this.tokenizer.lheading(d)){d=d.substring(p.raw.length),f.push(p);continue}if(h&&(p=this.tokenizer.paragraph(d))){d=d.substring(p.raw.length),f.push(p);continue}if(p=this.tokenizer.text(d,f)){d=d.substring(p.raw.length),p.type?f.push(p):(pe=f[f.length-1],pe.raw+=`
`+p.raw,pe.text+=`
`+p.text);continue}if(d){var tt="Infinite loop on byte: "+d.charCodeAt(0);if(this.options.silent){console.error(tt);break}else throw new Error(tt)}}return f},x.inline=function(d){var f,h,p,N,K,pe,tt=d.length;for(f=0;f<tt;f++){pe=d[f];switch(pe.type){case"paragraph":case"text":case"heading":{pe.tokens=[],this.inlineTokens(pe.text,pe.tokens);break}case"table":{for(pe.tokens={header:[],cells:[]},N=pe.header.length,h=0;h<N;h++)pe.tokens.header[h]=[],this.inlineTokens(pe.header[h],pe.tokens.header[h]);for(N=pe.cells.length,h=0;h<N;h++)for(K=pe.cells[h],pe.tokens.cells[h]=[],p=0;p<K.length;p++)pe.tokens.cells[h][p]=[],this.inlineTokens(K[p],pe.tokens.cells[h][p]);break}case"blockquote":{this.inline(pe.tokens);break}case"list":{for(N=pe.items.length,h=0;h<N;h++)this.inline(pe.items[h].tokens);break}}}return d},x.inlineTokens=function(d,f,h,p,N){f===void 0&&(f=[]),h===void 0&&(h=!1),p===void 0&&(p=!1),N===void 0&&(N="");var K,pe=d,tt;if(this.tokens.links){var dt=Object.keys(this.tokens.links);if(dt.length>0)for(;(tt=this.tokenizer.rules.inline.reflinkSearch.exec(pe))!=null;)dt.includes(tt[0].slice(tt[0].lastIndexOf("[")+1,-1))&&(pe=pe.slice(0,tt.index)+"["+"a".repeat(tt[0].length-2)+"]"+pe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(tt=this.tokenizer.rules.inline.blockSkip.exec(pe))!=null;)pe=pe.slice(0,tt.index)+"["+"a".repeat(tt[0].length-2)+"]"+pe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;d;){if(K=this.tokenizer.escape(d)){d=d.substring(K.raw.length),f.push(K);continue}if(K=this.tokenizer.tag(d,h,p)){d=d.substring(K.raw.length),h=K.inLink,p=K.inRawBlock,f.push(K);continue}if(K=this.tokenizer.link(d)){d=d.substring(K.raw.length),K.type==="link"&&(K.tokens=this.inlineTokens(K.text,[],!0,p)),f.push(K);continue}if(K=this.tokenizer.reflink(d,this.tokens.links)){d=d.substring(K.raw.length),K.type==="link"&&(K.tokens=this.inlineTokens(K.text,[],!0,p)),f.push(K);continue}if(K=this.tokenizer.strong(d,pe,N)){d=d.substring(K.raw.length),K.tokens=this.inlineTokens(K.text,[],h,p),f.push(K);continue}if(K=this.tokenizer.em(d,pe,N)){d=d.substring(K.raw.length),K.tokens=this.inlineTokens(K.text,[],h,p),f.push(K);continue}if(K=this.tokenizer.codespan(d)){d=d.substring(K.raw.length),f.push(K);continue}if(K=this.tokenizer.br(d)){d=d.substring(K.raw.length),f.push(K);continue}if(K=this.tokenizer.del(d)){d=d.substring(K.raw.length),K.tokens=this.inlineTokens(K.text,[],h,p),f.push(K);continue}if(K=this.tokenizer.autolink(d,ve)){d=d.substring(K.raw.length),f.push(K);continue}if(!h&&(K=this.tokenizer.url(d,ve))){d=d.substring(K.raw.length),f.push(K);continue}if(K=this.tokenizer.inlineText(d,p,Be)){d=d.substring(K.raw.length),N=K.raw.slice(-1),f.push(K);continue}if(d){var at="Infinite loop on byte: "+d.charCodeAt(0);if(this.options.silent){console.error(at);break}else throw new Error(at)}}return f},Ce(y,null,[{key:"rules",get:function(){return{block:Ze,inline:He}}}]),y}(),De=O.defaults,Ne=Ee.cleanUrl,Ae=Ee.escape,oe=function(){function y(k){this.options=k||De}var x=y.prototype;return x.code=function(d,f,h){var p=(f||"").match(/\S*/)[0];if(this.options.highlight){var N=this.options.highlight(d,p);N!=null&&N!==d&&(h=!0,d=N)}return p?'<pre><code class="'+this.options.langPrefix+Ae(p,!0)+'">'+(h?d:Ae(d,!0))+`</code></pre>
`:"<pre><code>"+(h?d:Ae(d,!0))+`</code></pre>
`},x.blockquote=function(d){return`<blockquote>
`+d+`</blockquote>
`},x.html=function(d){return d},x.heading=function(d,f,h,p){return this.options.headerIds?"<h"+f+' id="'+this.options.headerPrefix+p.slug(h)+'">'+d+"</h"+f+`>
`:"<h"+f+">"+d+"</h"+f+`>
`},x.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},x.list=function(d,f,h){var p=f?"ol":"ul",N=f&&h!==1?' start="'+h+'"':"";return"<"+p+N+`>
`+d+"</"+p+`>
`},x.listitem=function(d){return"<li>"+d+`</li>
`},x.checkbox=function(d){return"<input "+(d?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},x.paragraph=function(d){return"<p>"+d+`</p>
`},x.table=function(d,f){return f&&(f="<tbody>"+f+"</tbody>"),`<table>
<thead>
`+d+`</thead>
`+f+`</table>
`},x.tablerow=function(d){return`<tr>
`+d+`</tr>
`},x.tablecell=function(d,f){var h=f.header?"th":"td",p=f.align?"<"+h+' align="'+f.align+'">':"<"+h+">";return p+d+"</"+h+`>
`},x.strong=function(d){return"<strong>"+d+"</strong>"},x.em=function(d){return"<em>"+d+"</em>"},x.codespan=function(d){return"<code>"+d+"</code>"},x.br=function(){return this.options.xhtml?"<br/>":"<br>"},x.del=function(d){return"<del>"+d+"</del>"},x.link=function(d,f,h){if(d=Ne(this.options.sanitize,this.options.baseUrl,d),d===null)return h;var p='<a href="'+Ae(d)+'"';return f&&(p+=' title="'+f+'"'),p+=">"+h+"</a>",p},x.image=function(d,f,h){if(d=Ne(this.options.sanitize,this.options.baseUrl,d),d===null)return h;var p='<img src="'+d+'" alt="'+h+'"';return f&&(p+=' title="'+f+'"'),p+=this.options.xhtml?"/>":">",p},x.text=function(d){return d},y}(),ye=function(){function y(){}var x=y.prototype;return x.strong=function(d){return d},x.em=function(d){return d},x.codespan=function(d){return d},x.del=function(d){return d},x.html=function(d){return d},x.text=function(d){return d},x.link=function(d,f,h){return""+h},x.image=function(d,f,h){return""+h},x.br=function(){return""},y}(),ze=function(){function y(){this.seen={}}var x=y.prototype;return x.slug=function(d){var f=d.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(f)){var h=f;do this.seen[h]++,f=h+"-"+this.seen[h];while(this.seen.hasOwnProperty(f))}return this.seen[f]=0,f},y}(),Ge=O.defaults,Ve=Ee.unescape,Fe=function(){function y(k){this.options=k||Ge,this.options.renderer=this.options.renderer||new oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ye,this.slugger=new ze}y.parse=function(d,f){var h=new y(f);return h.parse(d)};var x=y.prototype;return x.parse=function(d,f){f===void 0&&(f=!0);var h="",p,N,K,pe,tt,dt,at,Pt,pt,st,Wt,bt,$t,Bt,mt,Cn,Gn,un,kn=d.length;for(p=0;p<kn;p++){st=d[p];switch(st.type){case"space":continue;case"hr":{h+=this.renderer.hr();continue}case"heading":{h+=this.renderer.heading(this.parseInline(st.tokens),st.depth,Ve(this.parseInline(st.tokens,this.textRenderer)),this.slugger);continue}case"code":{h+=this.renderer.code(st.text,st.lang,st.escaped);continue}case"table":{for(Pt="",at="",pe=st.header.length,N=0;N<pe;N++)at+=this.renderer.tablecell(this.parseInline(st.tokens.header[N]),{header:!0,align:st.align[N]});for(Pt+=this.renderer.tablerow(at),pt="",pe=st.cells.length,N=0;N<pe;N++){for(dt=st.tokens.cells[N],at="",tt=dt.length,K=0;K<tt;K++)at+=this.renderer.tablecell(this.parseInline(dt[K]),{header:!1,align:st.align[K]});pt+=this.renderer.tablerow(at)}h+=this.renderer.table(Pt,pt);continue}case"blockquote":{pt=this.parse(st.tokens),h+=this.renderer.blockquote(pt);continue}case"list":{for(Wt=st.ordered,bt=st.start,$t=st.loose,pe=st.items.length,pt="",N=0;N<pe;N++)mt=st.items[N],Cn=mt.checked,Gn=mt.task,Bt="",mt.task&&(un=this.renderer.checkbox(Cn),$t?mt.tokens.length>0&&mt.tokens[0].type==="text"?(mt.tokens[0].text=un+" "+mt.tokens[0].text,mt.tokens[0].tokens&&mt.tokens[0].tokens.length>0&&mt.tokens[0].tokens[0].type==="text"&&(mt.tokens[0].tokens[0].text=un+" "+mt.tokens[0].tokens[0].text)):mt.tokens.unshift({type:"text",text:un}):Bt+=un),Bt+=this.parse(mt.tokens,$t),pt+=this.renderer.listitem(Bt,Gn,Cn);h+=this.renderer.list(pt,Wt,bt);continue}case"html":{h+=this.renderer.html(st.text);continue}case"paragraph":{h+=this.renderer.paragraph(this.parseInline(st.tokens));continue}case"text":{for(pt=st.tokens?this.parseInline(st.tokens):st.text;p+1<kn&&d[p+1].type==="text";)st=d[++p],pt+=`
`+(st.tokens?this.parseInline(st.tokens):st.text);h+=f?this.renderer.paragraph(pt):pt;continue}default:{var pn='Token with "'+st.type+'" type was not found.';if(this.options.silent){console.error(pn);return}else throw new Error(pn)}}}return h},x.parseInline=function(d,f){f=f||this.renderer;var h="",p,N,K=d.length;for(p=0;p<K;p++){N=d[p];switch(N.type){case"escape":{h+=f.text(N.text);break}case"html":{h+=f.html(N.text);break}case"link":{h+=f.link(N.href,N.title,this.parseInline(N.tokens,f));break}case"image":{h+=f.image(N.href,N.title,N.text);break}case"strong":{h+=f.strong(this.parseInline(N.tokens,f));break}case"em":{h+=f.em(this.parseInline(N.tokens,f));break}case"codespan":{h+=f.codespan(N.text);break}case"br":{h+=f.br();break}case"del":{h+=f.del(this.parseInline(N.tokens,f));break}case"text":{h+=f.text(N.text);break}default:{var pe='Token with "'+N.type+'" type was not found.';if(this.options.silent){console.error(pe);return}else throw new Error(pe)}}}return h},y}(),it=Ee.merge,qe=Ee.checkSanitizeDeprecation,$e=Ee.escape,re=O.getDefaults,nt=O.changeDefaults,Xe=O.defaults;function se(y,x,k){if(typeof y=="undefined"||y===null)throw new Error("marked(): input parameter is undefined or null");if(typeof y!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(y)+", string expected");if(typeof x=="function"&&(k=x,x=null),x=it({},se.defaults,x||{}),qe(x),k){var d=x.highlight,f;try{f=we.lex(y,x)}catch(K){return k(K)}var h=function(pe){var tt;if(!pe)try{tt=Fe.parse(f,x)}catch(dt){pe=dt}return x.highlight=d,pe?k(pe):k(null,tt)};if(!d||d.length<3)return h();if(delete x.highlight,!f.length)return h();var p=0;se.walkTokens(f,function(K){K.type==="code"&&(p++,setTimeout(function(){d(K.text,K.lang,function(pe,tt){if(pe)return h(pe);tt!=null&&tt!==K.text&&(K.text=tt,K.escaped=!0),p--,p===0&&h()})},0))}),p===0&&h();return}try{var N=we.lex(y,x);return x.walkTokens&&se.walkTokens(N,x.walkTokens),Fe.parse(N,x)}catch(K){if(K.message+=`
Please report this to https://github.com/markedjs/marked.`,x.silent)return"<p>An error occurred:</p><pre>"+$e(K.message+"",!0)+"</pre>";throw K}}se.options=se.setOptions=function(y){return it(se.defaults,y),nt(se.defaults),se},se.getDefaults=re,se.defaults=Xe,se.use=function(y){var x=it({},y);if(y.renderer&&function(){var d=se.defaults.renderer||new oe,f=function(N){var K=d[N];d[N]=function(){for(var pe=arguments.length,tt=new Array(pe),dt=0;dt<pe;dt++)tt[dt]=arguments[dt];var at=y.renderer[N].apply(d,tt);return at===!1&&(at=K.apply(d,tt)),at}};for(var h in y.renderer)f(h);x.renderer=d}(),y.tokenizer&&function(){var d=se.defaults.tokenizer||new de,f=function(N){var K=d[N];d[N]=function(){for(var pe=arguments.length,tt=new Array(pe),dt=0;dt<pe;dt++)tt[dt]=arguments[dt];var at=y.tokenizer[N].apply(d,tt);return at===!1&&(at=K.apply(d,tt)),at}};for(var h in y.tokenizer)f(h);x.tokenizer=d}(),y.walkTokens){var k=se.defaults.walkTokens;x.walkTokens=function(d){y.walkTokens(d),k&&k(d)}}se.setOptions(x)},se.walkTokens=function(y,x){for(var k=ue(y),d;!(d=k()).done;){var f=d.value;x(f);switch(f.type){case"table":{for(var h=ue(f.tokens.header),p;!(p=h()).done;){var N=p.value;se.walkTokens(N,x)}for(var K=ue(f.tokens.cells),pe;!(pe=K()).done;)for(var tt=pe.value,dt=ue(tt),at;!(at=dt()).done;){var Pt=at.value;se.walkTokens(Pt,x)}break}case"list":{se.walkTokens(f.items,x);break}default:f.tokens&&se.walkTokens(f.tokens,x)}}},se.Parser=Fe,se.parser=Fe.parse,se.Renderer=oe,se.TextRenderer=ye,se.Lexer=we,se.lexer=we.lex,se.Tokenizer=de,se.Slugger=ze,se.parse=se;var Te=se;return Te})},ELLl:function(ht,Ye,w){(function(M){M(w("VrN/"))})(function(M){var Ce={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},H=M.Pos;M.defineOption("autoCloseBrackets",!1,function(D,L,T){T&&T!=M.Init&&(D.removeKeyMap(ue),D.state.closeBrackets=null),L&&(ee(he(L,"pairs")),D.state.closeBrackets=L,D.addKeyMap(ue))});function he(D,L){return L=="pairs"&&typeof D=="string"?D:typeof D=="object"&&D[L]!=null?D[L]:Ce[L]}var ue={Backspace:C,Enter:ie};function ee(D){for(var L=0;L<D.length;L++){var T=D.charAt(L),X="'"+T+"'";ue[X]||(ue[X]=O(T))}}ee(Ce.pairs+"`");function O(D){return function(L){return G(L,D)}}function S(D){var L=D.state.closeBrackets;if(!L||L.override)return L;var T=D.getModeAt(D.getCursor());return T.closeBrackets||L}function C(D){var L=S(D);if(!L||D.getOption("disableInput"))return M.Pass;for(var T=he(L,"pairs"),X=D.listSelections(),V=0;V<X.length;V++){if(!X[V].empty())return M.Pass;var be=le(D,X[V].head);if(!be||T.indexOf(be)%2!=0)return M.Pass}for(var V=X.length-1;V>=0;V--){var Ie=X[V].head;D.replaceRange("",H(Ie.line,Ie.ch-1),H(Ie.line,Ie.ch+1),"+delete")}}function ie(D){var L=S(D),T=L&&he(L,"explode");if(!T||D.getOption("disableInput"))return M.Pass;for(var X=D.listSelections(),V=0;V<X.length;V++){if(!X[V].empty())return M.Pass;var be=le(D,X[V].head);if(!be||T.indexOf(be)%2!=0)return M.Pass}D.operation(function(){var Ie=D.lineSeparator()||`
`;D.replaceSelection(Ie+Ie,null),D.execCommand("goCharLeft"),X=D.listSelections();for(var $=0;$<X.length;$++){var ne=X[$].head.line;D.indentLine(ne,null,!0),D.indentLine(ne+1,null,!0)}})}function j(D){var L=M.cmpPos(D.anchor,D.head)>0;return{anchor:new H(D.anchor.line,D.anchor.ch+(L?-1:1)),head:new H(D.head.line,D.head.ch+(L?1:-1))}}function G(D,L){var T=S(D);if(!T||D.getOption("disableInput"))return M.Pass;var X=he(T,"pairs"),V=X.indexOf(L);if(V==-1)return M.Pass;for(var be=he(T,"closeBefore"),Ie=he(T,"triples"),$=X.charAt(V+1)==L,ne=D.listSelections(),_e=V%2==0,q,Q=0;Q<ne.length;Q++){var ge=ne[Q],J=ge.head,v,U=D.getRange(J,H(J.line,J.ch+1));if(_e&&!ge.empty())v="surround";else if(($||!_e)&&U==L)$&&B(D,J)?v="both":Ie.indexOf(L)>=0&&D.getRange(J,H(J.line,J.ch+3))==L+L+L?v="skipThree":v="skip";else if($&&J.ch>1&&Ie.indexOf(L)>=0&&D.getRange(H(J.line,J.ch-2),J)==L+L){if(J.ch>2&&/\bstring/.test(D.getTokenTypeAt(H(J.line,J.ch-2))))return M.Pass;v="addFour"}else if($){var P=J.ch==0?" ":D.getRange(H(J.line,J.ch-1),J);if(!M.isWordChar(U)&&P!=L&&!M.isWordChar(P))v="both";else return M.Pass}else if(_e&&(U.length===0||/\s/.test(U)||be.indexOf(U)>-1))v="both";else return M.Pass;if(!q)q=v;else if(q!=v)return M.Pass}var b=V%2?X.charAt(V-1):L,F=V%2?L:X.charAt(V+1);D.operation(function(){if(q=="skip")D.execCommand("goCharRight");else if(q=="skipThree")for(var ae=0;ae<3;ae++)D.execCommand("goCharRight");else if(q=="surround"){for(var W=D.getSelections(),ae=0;ae<W.length;ae++)W[ae]=b+W[ae]+F;D.replaceSelections(W,"around"),W=D.listSelections().slice();for(var ae=0;ae<W.length;ae++)W[ae]=j(W[ae]);D.setSelections(W)}else q=="both"?(D.replaceSelection(b+F,null),D.triggerElectric(b+F),D.execCommand("goCharLeft")):q=="addFour"&&(D.replaceSelection(b+b+b+b,"before"),D.execCommand("goCharRight"))})}function le(D,L){var T=D.getRange(H(L.line,L.ch-1),H(L.line,L.ch+1));return T.length==2?T:null}function B(D,L){var T=D.getTokenAt(H(L.line,L.ch+1));return/\bstring/.test(T.type)&&T.start==L.ch&&(L.ch==0||!/\bstring/.test(D.getTokenTypeAt(L)))}})},Gytx:function(ht,Ye){ht.exports=function(M,Ce,H,he){var ue=H?H.call(he,M,Ce):void 0;if(ue!==void 0)return!!ue;if(M===Ce)return!0;if(typeof M!="object"||!M||typeof Ce!="object"||!Ce)return!1;var ee=Object.keys(M),O=Object.keys(Ce);if(ee.length!==O.length)return!1;for(var S=Object.prototype.hasOwnProperty.bind(Ce),C=0;C<ee.length;C++){var ie=ee[C];if(!S(ie))return!1;var j=M[ie],G=Ce[ie];if(ue=H?H.call(he,j,G,ie):void 0,ue===!1||ue===void 0&&j!==G)return!1}return!0}},HmJG:function(ht,Ye,w){},LdHM:function(ht,Ye,w){"use strict";w.d(Ye,"b",function(){return be}),w.d(Ye,"a",function(){return $});var M=w("1OyB"),Ce=w("vuIU"),H=w("Ji7U"),he=w("LK+K"),ue=w("q1tI"),ee=w("rePB"),O=w("Ff2n"),S=w("ODXe"),C=w("4IlW"),ie=w("bX4T"),j=w("YrtM"),G=w("TSYQ"),le=w.n(G),B=w("+nKL"),D=w("8OUc"),L=function(_,Z){var Y=_.prefixCls,Se=_.id,je=_.flattenOptions,de=_.childrenAsData,Le=_.values,ce=_.searchValue,me=_.multiple,R=_.defaultActiveFirstOption,z=_.height,Oe=_.itemHeight,We=_.notFoundContent,Ze=_.open,He=_.menuItemSelectedIcon,Be=_.virtual,ve=_.onSelect,we=_.onToggleOpen,De=_.onActiveValue,Ne=_.onScroll,Ae=_.onMouseEnter,oe="".concat(Y,"-item"),ye=Object(j.a)(function(){return je},[Ze,je],function(Te,y){return y[0]&&Te[1]!==y[1]}),ze=ue.useRef(null),Ge=function(y){y.preventDefault()},Ve=function(y){ze.current&&ze.current.scrollTo({index:y})},Fe=function(y){for(var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,k=ye.length,d=0;d<k;d+=1){var f=(y+d*x+k)%k,h=ye[f],p=h.group,N=h.data;if(!p&&!N.disabled)return f}return-1},it=ue.useState(function(){return Fe(0)}),qe=Object(S.a)(it,2),$e=qe[0],re=qe[1],nt=function(y){re(y);var x=ye[y];if(!x){De(null,-1);return}De(x.data.value,y)};ue.useEffect(function(){nt(R!==!1?Fe(0):-1)},[ye.length,ce]),ue.useEffect(function(){var Te=setTimeout(function(){if(!me&&Ze&&Le.size===1){var y=Array.from(Le)[0],x=ye.findIndex(function(k){var d=k.data;return d.value===y});nt(x),Ve(x)}});return function(){return clearTimeout(Te)}},[Ze]);var Xe=function(y){y!==void 0&&ve(y,{selected:!Le.has(y)}),me||we(!1)};if(ue.useImperativeHandle(Z,function(){return{onKeyDown:function(y){var x=y.which;switch(x){case C.a.UP:case C.a.DOWN:{var k=0;if(x===C.a.UP?k=-1:x===C.a.DOWN&&(k=1),k!==0){var d=Fe($e+k,k);Ve(d),nt(d)}break}case C.a.ENTER:{var f=ye[$e];f&&!f.data.disabled?Xe(f.data.value):Xe(void 0),Ze&&y.preventDefault();break}case C.a.ESC:we(!1)}},onKeyUp:function(){},scrollTo:function(y){Ve(y)}}}),ye.length===0)return ue.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),className:"".concat(oe,"-empty"),onMouseDown:Ge},We);function se(Te){var y=ye[Te];if(!y)return null;var x=y.data||{},k=x.value,d=x.label,f=x.children,h=Object(ie.a)(x,!0),p=de?f:d;return y?ue.createElement("div",Object.assign({"aria-label":typeof p=="string"?p:null},h,{key:Te,role:"option",id:"".concat(Se,"_list_").concat(Te),"aria-selected":Le.has(k)}),k):null}return ue.createElement(ue.Fragment,null,ue.createElement("div",{role:"listbox",id:"".concat(Se,"_list"),style:{height:0,width:0,overflow:"hidden"}},se($e-1),se($e),se($e+1)),ue.createElement(B.a,{itemKey:"key",ref:ze,data:ye,height:z,itemHeight:Oe,fullHeight:!1,onMouseDown:Ge,onScroll:Ne,virtual:Be,onMouseEnter:Ae},function(Te,y){var x,k=Te.group,d=Te.groupOption,f=Te.data,h=f.label,p=f.key;if(k)return ue.createElement("div",{className:le()(oe,"".concat(oe,"-group"))},h!==void 0?h:p);var N=f.disabled,K=f.value,pe=f.title,tt=f.children,dt=f.style,at=f.className,Pt=Object(O.a)(f,["disabled","value","title","children","style","className"]),pt=Le.has(K),st="".concat(oe,"-option"),Wt=le()(oe,st,at,(x={},Object(ee.a)(x,"".concat(st,"-grouped"),d),Object(ee.a)(x,"".concat(st,"-active"),$e===y&&!N),Object(ee.a)(x,"".concat(st,"-disabled"),N),Object(ee.a)(x,"".concat(st,"-selected"),pt),x)),bt=de?tt:h,$t=!He||typeof He=="function"||pt;return ue.createElement("div",Object.assign({},Pt,{"aria-selected":pt,className:Wt,title:pe,onMouseMove:function(){if($e===y||N)return;nt(y)},onClick:function(){N||Xe(K)},style:dt}),ue.createElement("div",{className:"".concat(st,"-content")},bt||K),ue.isValidElement(He)||pt,$t&&ue.createElement(D.a,{className:"".concat(oe,"-option-state"),customizeIcon:He,customizeIconProps:{isSelected:pt}},pt?"\u2713":null))}))},T=ue.forwardRef(L);T.displayName="OptionList";var X=T,V=function(){return null};V.isSelectOption=!0;var be=V,Ie=function(){return null};Ie.isSelectOptGroup=!0;var $=Ie,ne=w("VTBJ"),_e=w("Zm9Q");function q(c){var _=c.key,Z=c.props,Y=Z.children,Se=Z.value,je=Object(O.a)(Z,["children","value"]);return Object(ne.a)({key:_,value:Se!==void 0?Se:_,children:Y},je)}function Q(c){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(_e.a)(c).map(function(Z,Y){if(!ue.isValidElement(Z)||!Z.type)return null;var Se=Z.type.isSelectOptGroup,je=Z.key,de=Z.props,Le=de.children,ce=Object(O.a)(de,["children"]);return _||!Se?q(Z):Object(ne.a)(Object(ne.a)({key:"__RC_SELECT_GRP__".concat(je===null?Y:je,"__"),label:je},ce),{},{options:Q(Le)})}).filter(function(Z){return Z})}var ge=w("2Qr1"),J=w("qNPg"),v=w("U8pU"),U=w("Kwbf"),P=w("WKfj");function b(c){var _=c.mode,Z=c.options,Y=c.children,Se=c.backfill,je=c.allowClear,de=c.placeholder,Le=c.getInputElement,ce=c.showSearch,me=c.onSearch,R=c.defaultOpen,z=c.autoFocus,Oe=c.labelInValue,We=c.value,Ze=c.inputValue,He=c.optionLabelProp,Be=_==="multiple"||_==="tags",ve=ce!==void 0?ce:Be||_==="combobox",we=Z||Q(Y);if(Object(U.a)(_!=="tags"||we.every(function(oe){return!oe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),_==="tags"||_==="combobox"){var De=we.some(function(oe){return oe.options?oe.options.some(function(ye){return typeof("value"in ye?ye.value:ye.key)=="number"}):typeof("value"in oe?oe.value:oe.key)=="number"});Object(U.a)(!De,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(U.a)(_!=="combobox"||!He,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(U.a)(_==="combobox"||!Se,"`backfill` only works with `combobox` mode."),Object(U.a)(_==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(U.b)(_!=="combobox"||!Le||!je||!de,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),me&&!ve&&_!=="combobox"&&_!=="tags"&&Object(U.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(U.b)(!R||z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),We!=null){var Ne=Object(P.d)(We);Object(U.a)(!Oe||Ne.every(function(oe){return Object(v.a)(oe)==="object"&&("key"in oe||"value"in oe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(U.a)(!Be||Array.isArray(We),"`value` should be array when `mode` is `multiple` or `tags`")}if(Y){var Ae=null;Object(_e.a)(Y).some(function(oe){if(!ue.isValidElement(oe)||!oe.type)return!1;var ye=oe.type;if(ye.isSelectOption)return!1;if(ye.isSelectOptGroup){var ze=Object(_e.a)(oe.props.children).every(function(Ge){return!ue.isValidElement(Ge)||!oe.type||Ge.type.isSelectOption?!0:(Ae=Ge.type,!1)});return!ze}return Ae=ye,!0}),Ae&&Object(U.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ae.displayName||Ae.name||Ae,"`.")),Object(U.a)(Ze===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=b,ae=Object(J.a)({prefixCls:"rc-select",components:{optionList:X},convertChildrenToData:Q,flattenOptions:ge.d,getLabeledValue:ge.e,filterOptions:ge.b,isValueDisabled:ge.g,findValueOption:ge.c,warningProps:F,fillOptionsWithMissingValue:ge.a}),W=function(c){Object(H.a)(Z,c);var _=Object(he.a)(Z);function Z(){var Y;return Object(M.a)(this,Z),Y=_.apply(this,arguments),Y.selectRef=ue.createRef(),Y.focus=function(){Y.selectRef.current.focus()},Y.blur=function(){Y.selectRef.current.blur()},Y}return Object(Ce.a)(Z,[{key:"render",value:function(){return ue.createElement(ae,Object.assign({ref:this.selectRef},this.props))}}]),Z}(ue.Component);W.Option=be,W.OptGroup=$;var Ee=W,m=Ye.c=Ee},M8RZ:function(ht,Ye,w){"use strict";w.d(Ye,"a",function(){return C});var M=w("fWQN"),Ce=w("mtLc"),H=w("yKVA"),he=w("879j"),ue=w("q1tI"),ee=w.n(ue),O=w("i8i4"),S=w.n(O),C=function(ie){Object(H.a)(G,ie);var j=Object(he.a)(G);function G(le){var B;Object(M.a)(this,G),B=j.call(this,le);var D=window.document;return B.node=D.createElement("div"),D.body.appendChild(B.node),B}return Object(Ce.a)(G,[{key:"render",value:function(){var B=this.props.children;return Object(O.createPortal)(B,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),G}(ee.a.Component)},OLES:function(ht,Ye,w){"use strict";var M=w("U8pU"),Ce=w("VTBJ"),H=w("Ff2n"),he=w("q1tI"),ue=w("uciX"),ee=w("7ixt"),O=function(le){var B=le.overlay,D=le.prefixCls,L=le.id,T=le.overlayInnerStyle;return he.createElement("div",{className:"".concat(D,"-inner"),id:L,role:"tooltip",style:T},typeof B=="function"?B():B)},S=O,C=function(le,B){var D=le.overlayClassName,L=le.trigger,T=L===void 0?["hover"]:L,X=le.mouseEnterDelay,V=X===void 0?0:X,be=le.mouseLeaveDelay,Ie=be===void 0?.1:be,$=le.overlayStyle,ne=le.prefixCls,_e=ne===void 0?"rc-tooltip":ne,q=le.children,Q=le.onVisibleChange,ge=le.afterVisibleChange,J=le.transitionName,v=le.animation,U=le.placement,P=U===void 0?"right":U,b=le.align,F=b===void 0?{}:b,ae=le.destroyTooltipOnHide,W=ae===void 0?!1:ae,Ee=le.defaultVisible,m=le.getTooltipContainer,c=le.overlayInnerStyle,_=Object(H.a)(le,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),Z=Object(he.useRef)(null);Object(he.useImperativeHandle)(B,function(){return Z.current});var Y=Object(Ce.a)({},_);"visible"in le&&(Y.popupVisible=le.visible);var Se=function(){var me=le.arrowContent,R=me===void 0?null:me,z=le.overlay,Oe=le.id;return[he.createElement("div",{className:"".concat(_e,"-arrow"),key:"arrow"},R),he.createElement(S,{key:"content",prefixCls:_e,id:Oe,overlay:z,overlayInnerStyle:c})]},je=!1,de=!1;if(typeof W=="boolean")je=W;else if(W&&Object(M.a)(W)==="object"){var Le=W.keepParent;je=Le===!0,de=Le===!1}return he.createElement(ue.a,Object.assign({popupClassName:D,prefixCls:_e,popup:Se,action:T,builtinPlacements:ee.a,popupPlacement:P,ref:Z,popupAlign:F,getPopupContainer:m,onPopupVisibleChange:Q,afterPopupVisibleChange:ge,popupTransitionName:J,popupAnimation:v,defaultPopupVisible:Ee,destroyPopupOnHide:je,autoDestroy:de,mouseLeaveDelay:Ie,popupStyle:$,mouseEnterDelay:V},Y),q)},ie=Object(he.forwardRef)(C),j=Ye.a=ie},Ot1p:function(ht,Ye,w){"use strict";var M=w("2qtc"),Ce=w("kLXV"),H=w("rAM+"),he=w("miYZ"),ue=w("tsqr"),ee=w("tJVT"),O=w("jrin"),S=w("q1tI"),C=w.n(S),ie=w("VrN/"),j=w.n(ie),G=w("bdgK"),le=w("p77/"),B=w("Bd2K"),D=w("ELLl"),L=w("19Vz"),T=w("lZu9"),X=w("+NIl"),V=w("kSUc"),be=w("9Bee"),Ie=function(y){var x=y.value,k=x===void 0?"":x,d=y.className,f=y.showTextOnly,h=y.showLines,p=y.style,N=p===void 0?{}:p,K=Object(S.useMemo)(function(){return""},[k]);return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{dangerouslySetInnerHTML:{__html:K}}))},$=w("0Owb"),ne=w("dejd"),_e=w("C+DQ"),q=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function Q(y){var x=y.onActionCallback,k=y.title,d=y.icon,f=y.actionName,h=y.className,p=h===void 0?"":h,N=y.children;function K(){x(f)}return C.a.createElement("a",{title:k,className:p,onClick:K},C.a.createElement("i",{className:"md-iconfont ".concat(d)}),N)}var ge=function(y){var x=y.watch,k=y.showNullButton,d=y.onActionCallback,f=y.fullScreen,h=y.insertTemp,p=y.hidetoolBar,N=[].concat(q,[{title:"".concat(x?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(x?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return C.a.createElement("ul",{className:"markdown-toolbar-container"},!p&&N.map(function(K,pe){return C.a.createElement("li",{key:pe},K.actionName?C.a.createElement(Q,Object($.a)({},K,{onActionCallback:d})):C.a.createElement("span",{className:"v-line"}))}),k?C.a.createElement("li",null,C.a.createElement(Q,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:d},C.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,h&&C.a.createElement("li",null,C.a.createElement(Q,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(h),onActionCallback:d},C.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),C.a.createElement("li",{className:"btn-full-screen"},C.a.createElement(Q,{icon:"".concat(f?"icon-shrink":"icon-enlarge"),title:f?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:d})))},J=w("M8RZ"),v=w("+L6B"),U=w("2/Rp"),P=w("y8nQ"),b=w("Vl3Y"),F=w("5NDa"),ae=w("5rEg"),W={labelCol:{span:4},wrapperCol:{span:20}},Ee=function(y){var x=y.callback,k=y.onCancel;function d(f){x(f)}return C.a.createElement(b.a,Object($.a)({},W,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:d}),C.a.createElement(b.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},C.a.createElement(ae.a,null)),C.a.createElement(b.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},C.a.createElement(ae.a,null)),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(U.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))},m=w("7ahc"),c=w("HmJG"),_=w("BjJ7"),Z=b.a.useForm,Y={width:280,marginRight:10},Se={labelCol:{span:5},wrapperCol:{span:19}},je=function(y){var x=y.callback,k=y.onCancel,d=Z(),f=Object(ee.a)(d,1),h=f[0];function p(pe){x(pe)}function N(pe,tt){h.setFieldsValue({src:"/api/attachments/".concat(pe.id),type:tt.type})}function K(pe){var tt=pe.target.files[0];Le(tt,N)}return C.a.createElement(b.a,Object($.a)({form:h},Se,{className:"upload-image-panel",onFinish:p}),C.a.createElement(b.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},C.a.createElement("div",{className:"flex-container"},C.a.createElement(b.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},C.a.createElement(ae.a,{style:Y})),C.a.createElement(de,{onFileChange:K}))),C.a.createElement(b.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},C.a.createElement(ae.a,{style:{width:264}})),C.a.createElement(b.a.Item,{style:{textAlign:"right"}},C.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(U.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))};function de(y){var x=y.onFileChange;return C.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",C.a.createElement("input",{type:"file",onChange:x}))}function Le(y,x){if(!y)throw new String("\u6CA1\u6709\u6587\u4EF6");var k=new FormData;k.append("editormd-image-file",y),k.append("file_param_name","editormd-image-file"),k.append("byxhr","true");var d=new window.XMLHttpRequest;d.withCredentials=!0,d.addEventListener("load",function(f){x(JSON.parse(f.target.responseText),y)},!1),d.addEventListener("error",function(f){console.error(f)},!1),d.open("POST","".concat(_.a,"/api/attachments.json")),d.send(k)}var ce=w("giR+"),me=w("fyUT"),R=w("7Kak"),z=w("9yH6"),Oe=z.a.Group,We={margin:"0 8px"},Ze=function(y){var x=y.callback,k=y.onCancel;function d(f){x(f)}return C.a.createElement(b.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:d},C.a.createElement("div",{className:"flex-container"},C.a.createElement("span",{style:We},"\u5355\u5143\u683C\u6570\uFF1A"),C.a.createElement("span",{style:We},"\u884C\u6570"),C.a.createElement(b.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},C.a.createElement(me.a,null)),C.a.createElement("span",{style:We},"\u5217\u6570"),C.a.createElement(b.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},C.a.createElement(me.a,null))),C.a.createElement("div",{className:"flex-container",style:{marginTop:12}},C.a.createElement("span",{style:We},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),C.a.createElement(b.a.Item,{name:"align"},C.a.createElement(Oe,null,C.a.createElement(z.a,{value:"default"},C.a.createElement("i",{className:"fa fa-align-justify"})),C.a.createElement(z.a,{value:"left"},C.a.createElement("i",{className:"fa fa-align-left"})),C.a.createElement(z.a,{value:"center"},C.a.createElement("i",{className:"fa fa-align-center"})),C.a.createElement(z.a,{value:"right"},C.a.createElement("i",{className:"fa fa-align-right"}))))),C.a.createElement("div",{className:"flex-container flex-end"},C.a.createElement(U.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),C.a.createElement(U.a,{type:"ghost",onClick:k},"\u53D6\u6D88")))},He=w("m3rI"),Be="link",ve="upload-image",we="code-block",De="add-table",Ne="------------",Ae={default:Ne,left:":".concat(Ne),center:":".concat(Ne,":"),right:"".concat(Ne,":")},oe=w("9VGf"),ye,ze;function Ge(){}var Ve=0,Fe=1e4,it="\u2581",qe=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function $e(y){return/^\d+$/.test(y)?"".concat(y,"px"):y}var re=navigator.platform.toUpperCase().indexOf("MAC")>=0,nt=re?"Cmd":"Ctrl",Xe=(ye={},Object(O.a)(ye,nt+"-B","bold"),Object(O.a)(ye,nt+"-I","italic"),ye),se=(ze={},Object(O.a)(ze,Be,"\u6DFB\u52A0\u94FE\u63A5"),Object(O.a)(ze,we,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(O.a)(ze,ve,"\u6DFB\u52A0\u56FE\u7247"),Object(O.a)(ze,De,"\u6DFB\u52A0\u8868\u683C"),ze),Te=Ye.a=function(y){var x=y.defaultValue,k=x===void 0?"":x,d=y.onChange,f=y.width,h=f===void 0?"100%":f,p=y.height,N=p===void 0?400:p,K=y.miniToolbar,pe=K===void 0?!1:K,tt=y.isFocus,dt=tt===void 0?!1:tt,at=y.watch,Pt=y.insertTemp,pt=y.mode,st=pt===void 0?"markdown":pt,Wt=y.id,bt=Wt===void 0?"markdown-editor-id":Wt,$t=y.showResizeBar,Bt=$t===void 0?!1:$t,mt=y.noStorage,Cn=mt===void 0?!1:mt,Gn=y.showNullButton,un=Gn===void 0?!1:Gn,kn=y.hidetoolBar,pn=kn===void 0?!1:kn,bi=y.fullScreen,cn=bi===void 0?!1:bi,Vn=y.onBlur,dr=y.onCMBeforeChange,St=y.onFullScreen,Je=y.className,Sn=Je===void 0?"":Je,fr=y.disablePaste,dn=fr===void 0?!1:fr,gt=y.placeholder,_n=gt===void 0?"":gt,Dn=y.values,$n=Dn===void 0?"":Dn,xe=Object(S.useState)(null),lt=Object(ee.a)(xe,2),Me=lt[0],jr=lt[1],hr=Object(S.useState)(k),Yn=Object(ee.a)(hr,2),Jn=Yn[0],ot=Yn[1],Zi=Object(S.useState)(at),Ur=Object(ee.a)(Zi,2),fn=Ur[0],on=Ur[1],yi=Object(S.useState)(cn),Fr=Object(ee.a)(yi,2),nn=Fr[0],pr=Fr[1],xi=Object(S.useState)(""),mr=Object(ee.a)(xi,2),Tn=mr[0],On=mr[1],wi=Object(S.useState)(0),Wr=Object(ee.a)(wi,2),Zn=Wr[0],Br=Wr[1],Ei=Object(S.useState)(N),hn=Object(ee.a)(Ei,2),Ci=hn[0],ki=hn[1],gr=Object(S.useState)(!1),Rn=Object(ee.a)(gr,2),ja=Rn[0],zr=Rn[1],qn=Object(S.useRef)(),Hr=Object(S.useRef)(),Pn=Object(S.useRef)(),Qn=Object(S.useRef)();Object(S.useEffect)(function(){ot($n),Me==null||Me.setValue($n)},[$n]),Object(S.useEffect)(function(){St==null||St(nn)},[nn]),Object(S.useEffect)(function(){if(qn.current){var Qe=j.a.fromTextArea(qn.current,{mode:st,lineNumbers:!pe,lineWrapping:!0,value:k,autoCloseTags:!0,autoCloseBrackets:!0});dt&&Qe.focus();function ut(ct,xt){if(dn){xt.preventDefault();return}var wt=xt.clipboardData;if(wt){var Ct=wt.types.toString(),Mt=wt.items,_t=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];if(Ct==="Files"||wt.types.indexOf("Files")>-1){if(xt.preventDefault(),st=="stex")return;try{var Kt,mn=Mt[1];((Kt=Mt[0])===null||Kt===void 0?void 0:Kt.kind)==="file"&&(mn=Mt[0]);var kt=mn.getAsFile(),Nn=kt.name.split(".").pop();Le(kt,function(Xt){if(Xt.id){var In,jn,br;(kt==null||((In=kt.type)===null||In===void 0)?void 0:In.indexOf("image"))>-1?Qe.replaceSelection("![,](/api/attachments/".concat(Xt.id,"?type=").concat(Xt.content_type,")")):(kt==null||((jn=kt.type)===null||jn===void 0)?void 0:jn.indexOf("video"))>-1?Qe.replaceSelection('<video width="100%" controls src="'.concat(He.a.API_SERVER,"/api/attachments/").concat(Xt.id,'"></video>')):(kt==null||((br=kt.type)===null||br===void 0)?void 0:br.indexOf("pdf"))>-1?Qe.replaceSelection('<a href="'.concat(He.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(kt.type,'&disposition=inline" target="_blank">').concat(kt.name,"</a>")):_t.includes(Nn)?Qe.replaceSelection('<a href="'.concat(He.a.API_SERVER,"/api/attachments/").concat(Xt.id,'?type=office&disposition=inline" target="_blank">').concat(kt.name,"</a>")):Qe.replaceSelection("[".concat(kt.name,"](").concat(He.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})}catch(Xt){ue.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Qe.on("paste",ut),jr(Qe),function(){Qe.off("paste",ut)}}},[]);var Si=Object(S.useCallback)(function(){if(Hr.current)try{}catch(Qe){console.log(Qe,"---- to set md editor body height")}},[Ci,Hr,nn]);Object(S.useEffect)(function(){function Qe(){var ct=new G.default(function(xt){var wt=Object(H.a)(xt),Ct;try{for(wt.s();!(Ct=wt.n()).done;){var Mt=Ct.value;(Mt.target.offsetHeight>0||Mt.target.offsetWidth>0)&&(Si(),Me.setSize("100%","100%"),Me.refresh())}}catch(_t){wt.e(_t)}finally{wt.f()}});return ct.observe(qn.current.parentElement),ct}if(Me){var ut=Qe();return function(){ut.unobserve(qn.current.parentElement)}}},[Me,Si]),Object(S.useEffect)(function(){if(Me){for(var Qe=[],ut=function(){var Mt=xt[ct];wt=Object(ee.a)(Mt,2);var _t=wt[0],Kt=wt[1],mn=Object(O.a)({},_t,function(){Kr(Kt)});Qe.push(mn),Me.addKeyMap(mn)},ct=0,xt=Object.entries(Xe);ct<xt.length;ct++){var wt;ut()}return function(){var Ct=Object(H.a)(Qe),Mt;try{for(Ct.s();!(Mt=Ct.n()).done;){var _t=Mt.value;Me.removeKeyMap(_t)}}catch(Kt){Ct.e(Kt)}finally{Ct.f()}}}},[Me]),Object(S.useEffect)(function(){cn!==nn&&pr(cn)},[cn]),Object(oe.a)(function(){if(!Cn&&Zn>0){var Qe=new Date().getTime(),ut=window.sessionStorage.getItem(bt);Qe>=Zn+Fe&&(!ut||ut!==Jn)&&(window.sessionStorage.setItem(bt,Jn),zr(!0))}},Fe),Object(S.useEffect)(function(){on(at)},[Me,at]),Object(S.useEffect)(function(){Me&&(dt&&Me.focus())},[Me,dt]),Object(S.useEffect)(function(){if(fn&&Me){var Qe=Me.getScrollerElement();function ut(ct){var xt=ct.target;if(Qn.current){var wt=xt.scrollTop/xt.scrollHeight;Qn.current.scrollTop=Qn.current.scrollHeight*wt}}return Qe.addEventListener("scroll",ut),function(){Qe.removeEventListener("scroll",ut)}}},[Me,fn]),Object(S.useEffect)(function(){if(Me&&dr){function Qe(ut,ct){dr(ut,ct)}return Me.on("beforeChange",Qe),function(){Me.off("beforeChange",Qe)}}},[Me,dr]),Object(S.useEffect)(function(){if(Me&&Vn){function Qe(){Vn(Me.getValue())}return Me.on("blur",Qe),function(){Me.off("blur",Qe)}}},[Me,Vn]),Object(S.useEffect)(function(){if(Me){function Qe(ut){var ct=ut.getValue();ot(ct),Br(new Date().getTime()),ut.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),d&&d(ct)}return Me.on("change",Qe),function(){Me.off("change",Qe)}}},[Me,d]),Object(S.useEffect)(function(){Me&&(k==null?(Me.setValue(""),ot("")):k!==Me.getValue()&&(Me.setValue(k),ot(k),Me.setCursor(Me.lineCount(),0)))},[Me,k]);var Kr=Object(S.useCallback)(function(Qe){var ut=Me.getCursor(),ct=Me.getSelection(),xt=ct.split(`
`);switch(Qe){case"bold":return Me.replaceSelection("**"+ct+"**"),ct===""&&Me.setCursor(ut.line,ut.ch+2),Me.focus();case"italic":return Me.replaceSelection("*"+ct+"*"),ct===""&&Me.setCursor(ut.line,ut.ch+1),Me.focus();case"code":return Me.replaceSelection("`"+ct+"`"),ct===""&&Me.setCursor(ut.line,ut.ch+1),Me.focus();case"inline-latex":return Me.replaceSelection("`$$"+ct+"$$`"),ct===""&&Me.setCursor(ut.line,ut.ch+3),Me.focus();case"latex":return Me.replaceSelection("```latex\n"+ct+"\n```"),Me.setCursor(ut.line+1,ct.length+1),Me.focus();case"line-break":return Me.replaceSelection(`<br/>
`),Me.focus();case"list-ul":return ct===""?Me.replaceSelection("- "+ct):Me.replaceSelection(xt.map(function(wt){return wt===""?"":"- ".concat(wt)}).join(`
`)),Me.focus();case"list-ol":return ct===""?Me.replaceSelection("1. "+ct):Me.replaceSelection(xt.map(function(wt,Ct){return wt===""?"":"".concat(Ct+1,". ").concat(wt)}).join(`
`)),Me.focus();case"add-null-ch":return ct===""&&Me.setCursor(ut.line,ut.ch+1),Me.replaceSelection(it),Me.focus();case"inster-template-1":return ct===""&&Me.setCursor(ut.line,ut.ch),Me.replaceSelection(qe),Me.focus();case"eraser":return Me.setValue(""),Me.focus();case"trigger-watch":return on(!fn),Me.focus();case"trigger-full-screen":return pr(!nn),Me.focus();case Be:On(Be);return;case we:On(we);return;case ve:On(ve);return;case De:On(De);return;default:throw new Error}},[Me,fn,nn]),er=Object(S.useCallback)(function(Qe){On("");switch(Tn){case Be:var ut=Qe.title,ct=Qe.link;return Me.replaceSelection("[".concat(ut,"](").concat(ct,")")),Me.focus();case we:var xt=Qe.language,wt=Qe.content;return Me.replaceSelection(["```"+xt,wt,"```"].join(`
`)),Me.focus();case ve:var Ct=Qe.src,Mt=Qe.alt;return Me.replaceSelection("![ ".concat(Mt," ]( ").concat(Ct,' "').concat(Mt,'" )')),Me.focus();case De:for(var _t=Qe.row,Kt=Qe.col,mn=Qe.align,kt=`
`,Nn=0;Nn<_t;Nn++){for(var Xt=[],In=[],jn=0;jn<Kt;jn++)Nn===1&&In.push(Ae[mn]),Xt.push(" ");Nn===1&&(kt+="| ".concat(In.join(" | "),` |
`)),kt+="| ".concat(Xt.join(Kt===1?"":" | "),` |
`)}return Me.replaceSelection(kt+`
`),Me.focus();default:throw new Error}},[Me,Tn]),vr=Object(S.useMemo)(function(){switch(Tn){case Be:return C.a.createElement(Ee,{callback:er,onCancel:yn});case we:return C.a.createElement(m.b,{callback:er,onCancel:yn});case ve:return C.a.createElement(je,{callback:er,onCancel:yn});case De:return C.a.createElement(Ze,{callback:er,onCancel:yn});default:return null}},[Tn]);function yn(){On("")}Object(S.useEffect)(function(){if(Pn.current){var Qe=Pn.current,ut=!1,ct=0;function xt(Mt){ut=!0,ct=Mt.pageY}function wt(){ut=!1}function Ct(Mt){if(ut){var _t=Mt.pageY-ct;_t<0&&(_t=0),_t>300&&(_t=300);var Kt=N+_t+"px";ki(Kt)}}return Qe.addEventListener("mousedown",xt),document.addEventListener("mousemove",Ct),document.addEventListener("mouseup",wt),function(){Qe.removeEventListener("mousedown",xt),document.removeEventListener("mousemove",Ct),document.removeEventListener("mouseup",wt)}}},[Me,Pn]),Object(S.useEffect)(function(){ki(N)},[N]);var Xr=$e(h),_i=$e(Ci),Ti={width:Xr,height:_i},Gr=Object(S.useMemo)(function(){if(Zn){var Qe=new Date(Zn),ut=Qe.getHours(),ct=Qe.getMinutes(),xt=Qe.getSeconds();return ut=ut<10?"0"+ut:ut,ct=ct<10?"0"+ct:ct,xt=xt<10?"0"+xt:xt,"".concat(ut,":").concat(ct,":").concat(xt)}return 0},[Zn]);function Ua(){window.sessionStorage.removeItem(bt),zr(!1),Br(0)}function qi(){zr(!1),Br(0),Me.setValue(window.sessionStorage.getItem(bt))}return C.a.createElement(S.Fragment,null,C.a.createElement("div",{className:"markdown-editor-wrapper",ref:Hr},C.a.createElement("div",{className:"markdown-editor-container ".concat(Sn," ").concat(fn?"on-preview":""," ").concat(pe?"mini":""," ").concat(nn?"full-screen":""),style:Ti},C.a.createElement(ge,{insertTemp:Pt,watch:fn,fullScreen:nn,showNullButton:un,onActionCallback:Kr,hidetoolBar:pn}),C.a.createElement("div",{className:"markdown-editor-body"},C.a.createElement("div",{className:"codemirror-container"},C.a.createElement("textarea",{ref:qn,placeholder:_n})),fn?C.a.createElement("div",{ref:Qn,className:"preview-container"},st==="stex"&&C.a.createElement(Ie,{value:Jn}),st!=="stex"&&C.a.createElement(be.a,{value:Jn})):null))),Bt?C.a.createElement("a",{ref:Pn,className:"editor-resize"}):null,C.a.createElement(J.a,null,se[Tn]?C.a.createElement(Ce.a,{centered:!0,title:se[Tn],visible:!0,onCancel:yn,footer:null},vr):null))}},SJMd:function(ht,Ye){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var w,M,Ce,H=!1,he,ue;window.PR_SHOULD_USE_CONTINUATION=!0;var ee,O;(function(){var S=window,C=["break,continue,do,else,for,if,return,while"],ie=[C,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],j=[ie,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],G=[j,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],le=[j,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],B=[j,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],D="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",L=[j,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],T="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",X=[C,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],V=[C,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],be=[C,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Ie=[G,B,le,L,T,X,V,be],$=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,ne="str",_e="kwd",q="com",Q="typ",ge="lit",J="pun",v="pln",U="tag",P="dec",b="src",F="atn",ae="atv",W="nocode",Ee="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function m(ve){for(var we=0,De=!1,Ne=!1,Ae=0,oe=ve.length;Ae<oe;++Ae){var ye=ve[Ae];if(ye.ignoreCase)Ne=!0;else if(/[a-z]/i.test(ye.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){De=!0,Ne=!1;break}}var ze={b:8,t:9,n:10,v:11,f:12,r:13};function Ge($e){var re=$e.charCodeAt(0);if(re!==92)return re;var nt=$e.charAt(1);return re=ze[nt],re||("0"<=nt&&nt<="7"?parseInt($e.substring(1),8):nt==="u"||nt==="x"?parseInt($e.substring(2),16):$e.charCodeAt(1))}function Ve($e){if($e<32)return($e<16?"\\x0":"\\x")+$e.toString(16);var re=String.fromCharCode($e);return re==="\\"||re==="-"||re==="]"||re==="^"?"\\"+re:re}function Fe($e){var re=$e.substring(1,$e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),nt=[],Xe=re[0]==="^",se=["["];Xe&&se.push("^");for(var Te=Xe?1:0,y=re.length;Te<y;++Te){var x=re[Te];if(/\\[bdsw]/i.test(x))se.push(x);else{var k=Ge(x),d;Te+2<y&&re[Te+1]==="-"?(d=Ge(re[Te+2]),Te+=2):d=k,nt.push([k,d]),d<65||k>122||(d<65||k>90||nt.push([Math.max(65,k)|32,Math.min(d,90)|32]),d<97||k>122||nt.push([Math.max(97,k)&~32,Math.min(d,122)&~32]))}}nt.sort(function(N,K){return N[0]-K[0]||K[1]-N[1]});for(var f=[],h=[],Te=0;Te<nt.length;++Te){var p=nt[Te];p[0]<=h[1]+1?h[1]=Math.max(h[1],p[1]):f.push(h=p)}for(var Te=0;Te<f.length;++Te){var p=f[Te];se.push(Ve(p[0])),p[1]>p[0]&&(p[1]+1>p[0]&&se.push("-"),se.push(Ve(p[1])))}return se.push("]"),se.join("")}function it($e){for(var re=$e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),nt=re.length,Xe=[],se=0,Te=0;se<nt;++se){var y=re[se];if(y==="(")++Te;else if(y.charAt(0)==="\\"){var x=+y.substring(1);x&&(x<=Te?Xe[x]=-1:re[se]=Ve(x))}}for(var se=1;se<Xe.length;++se)Xe[se]===-1&&(Xe[se]=++we);for(var se=0,Te=0;se<nt;++se){var y=re[se];if(y==="(")++Te,Xe[Te]||(re[se]="(?:");else if(y.charAt(0)==="\\"){var x=+y.substring(1);x&&x<=Te&&(re[se]="\\"+Xe[x])}}for(var se=0;se<nt;++se)re[se]==="^"&&re[se+1]!=="^"&&(re[se]="");if($e.ignoreCase&&De)for(var se=0;se<nt;++se){var y=re[se],k=y.charAt(0);y.length>=2&&k==="["?re[se]=Fe(y):k!=="\\"&&(re[se]=y.replace(/[a-zA-Z]/g,function(h){var p=h.charCodeAt(0);return"["+String.fromCharCode(p&~32,p|32)+"]"}))}return re.join("")}for(var qe=[],Ae=0,oe=ve.length;Ae<oe;++Ae){var ye=ve[Ae];if(ye.global||ye.multiline)throw new Error(""+ye);qe.push("(?:"+it(ye)+")")}return new RegExp(qe.join("|"),Ne?"gi":"g")}function c(ve,we){var De=/(?:^|\s)nocode(?:\s|$)/,Ne=[],Ae=0,oe=[],ye=0;function ze(Ge){var Ve=Ge.nodeType;if(Ve==1){if(De.test(Ge.className))return;for(var Fe=Ge.firstChild;Fe;Fe=Fe.nextSibling)ze(Fe);var it=Ge.nodeName.toLowerCase();(it==="br"||it==="li")&&(Ne[ye]=`
`,oe[ye<<1]=Ae++,oe[ye++<<1|1]=Ge)}else if(Ve==3||Ve==4){var qe=Ge.nodeValue;qe.length&&(we?qe=qe.replace(/\r\n?/g,`
`):qe=qe.replace(/[ \t\r\n]+/g," "),Ne[ye]=qe,oe[ye<<1]=Ae,Ae+=qe.length,oe[ye++<<1|1]=Ge)}}return ze(ve),{sourceCode:Ne.join("").replace(/\n$/,""),spans:oe}}function _(ve,we,De,Ne,Ae){if(!De)return;var oe={sourceNode:ve,pre:1,langExtension:null,numberLines:null,sourceCode:De,spans:null,basePos:we,decorations:null};Ne(oe),Ae.push.apply(Ae,oe.decorations)}var Z=/\S/;function Y(ve){for(var we=void 0,De=ve.firstChild;De;De=De.nextSibling){var Ne=De.nodeType;we=Ne===1?we?ve:De:Ne===3&&Z.test(De.nodeValue)?ve:we}return we===ve?void 0:we}function Se(ve,we){var De={},Ne;(function(){for(var ye=ve.concat(we),ze=[],Ge={},Ve=0,Fe=ye.length;Ve<Fe;++Ve){var it=ye[Ve],qe=it[3];if(qe)for(var $e=qe.length;--$e>=0;)De[qe.charAt($e)]=it;var re=it[1],nt=""+re;Ge.hasOwnProperty(nt)||(ze.push(re),Ge[nt]=null)}ze.push(/[\0-\uffff]/),Ne=m(ze)})();var Ae=we.length,oe=function(ye){for(var ze=ye.sourceCode,Ge=ye.basePos,Ve=ye.sourceNode,Fe=[Ge,v],it=0,qe=ze.match(Ne)||[],$e={},re=0,nt=qe.length;re<nt;++re){var Xe=qe[re],se=$e[Xe],Te=void 0,y;if(typeof se=="string")y=!1;else{var x=De[Xe.charAt(0)];if(x)Te=Xe.match(x[1]),se=x[0];else{for(var k=0;k<Ae;++k)if(x=we[k],Te=Xe.match(x[1]),Te){se=x[0];break}Te||(se=v)}y=se.length>=5&&se.substring(0,5)==="lang-",y&&!(Te&&typeof Te[1]=="string")&&(y=!1,se=b),y||($e[Xe]=se)}var d=it;if(it+=Xe.length,!y)Fe.push(Ge+d,se);else{var f=Te[1],h=Xe.indexOf(f),p=h+f.length;Te[2]&&(p=Xe.length-Te[2].length,h=p-f.length);var N=se.substring(5);_(Ve,Ge+d,Xe.substring(0,h),oe,Fe),_(Ve,Ge+d+h,f,z(N,f),Fe),_(Ve,Ge+d+p,Xe.substring(p),oe,Fe)}}ye.decorations=Fe};return oe}function je(ve){var we=[],De=[];ve.tripleQuotedStrings?we.push([ne,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ve.multiLineStrings?we.push([ne,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):we.push([ne,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ve.verbatimStrings&&De.push([ne,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ne=ve.hashComments;Ne&&(ve.cStyleComments?(Ne>1?we.push([q,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):we.push([q,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),De.push([ne,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):we.push([q,/^#[^\r\n]*/,null,"#"])),ve.cStyleComments&&(De.push([q,/^\/\/[^\r\n]*/,null]),De.push([q,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ae=ve.regexLiterals;if(Ae){var oe=Ae>1?"":`
\r`,ye=oe?".":"[\\S\\s]",ze="/(?=[^/*"+oe+"])(?:[^/\\x5B\\x5C"+oe+"]|\\x5C"+ye+"|\\x5B(?:[^\\x5C\\x5D"+oe+"]|\\x5C"+ye+")*(?:\\x5D|$))+/";De.push(["lang-regex",RegExp("^"+Ee+"("+ze+")")])}var Ge=ve.types;Ge&&De.push([Q,Ge]);var Ve=(""+ve.keywords).replace(/^ | $/g,"");Ve.length&&De.push([_e,new RegExp("^(?:"+Ve.replace(/[\s,]+/g,"|")+")\\b"),null]),we.push([v,/^\s+/,null,` \r
\xA0`]);var Fe="^.[^\\s\\w.$@'\"`/\\\\]*";return ve.regexLiterals&&(Fe+="(?!s*/)"),De.push([ge,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[v,/^[a-z_$][a-z_$@0-9]*/i,null],[ge,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[v,/^\\[\s\S]?/,null],[J,new RegExp(Fe),null]),Se(we,De)}var de=je({keywords:Ie,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(ve,we,De){for(var Ne=/(?:^|\s)nocode(?:\s|$)/,Ae=/\r\n?|\n/,oe=ve.ownerDocument,ye=oe.createElement("li");ve.firstChild;)ye.appendChild(ve.firstChild);var ze=[ye];function Ge(re){var nt=re.nodeType;if(nt==1&&!Ne.test(re.className))if(re.nodeName==="br")Ve(re),re.parentNode&&re.parentNode.removeChild(re);else for(var Xe=re.firstChild;Xe;Xe=Xe.nextSibling)Ge(Xe);else if((nt==3||nt==4)&&De){var se=re.nodeValue,Te=se.match(Ae);if(Te){var y=se.substring(0,Te.index);re.nodeValue=y;var x=se.substring(Te.index+Te[0].length);if(x){var k=re.parentNode;k.insertBefore(oe.createTextNode(x),re.nextSibling)}Ve(re),y||re.parentNode.removeChild(re)}}}function Ve(re){for(;!re.nextSibling;)if(re=re.parentNode,!re)return;function nt(Te,y){var x=y?Te.cloneNode(!1):Te,k=Te.parentNode;if(k){var d=nt(k,1),f=Te.nextSibling;d.appendChild(x);for(var h=f;h;h=f)f=h.nextSibling,d.appendChild(h)}return x}for(var Xe=nt(re.nextSibling,0),se;(se=Xe.parentNode)&&se.nodeType===1;)Xe=se;ze.push(Xe)}for(var Fe=0;Fe<ze.length;++Fe)Ge(ze[Fe]);we===(we|0)&&ze[0].setAttribute("value",we);var it=oe.createElement("ol");it.className="linenums";for(var qe=Math.max(0,we-1|0)||0,Fe=0,$e=ze.length;Fe<$e;++Fe)ye=ze[Fe],ye.className="L"+(Fe+qe)%10,ye.firstChild||ye.appendChild(oe.createTextNode("\xA0")),it.appendChild(ye);ve.appendChild(it)}function ce(ve){var we=/\bMSIE\s(\d+)/.exec(navigator.userAgent);we=we&&+we[1]<=8;var De=/\n/g,Ne=ve.sourceCode,Ae=Ne.length,oe=0,ye=ve.spans,ze=ye.length,Ge=0,Ve=ve.decorations,Fe=Ve.length,it=0;Ve[Fe]=Ae;var qe,$e;for($e=qe=0;$e<Fe;)Ve[$e]!==Ve[$e+2]?(Ve[qe++]=Ve[$e++],Ve[qe++]=Ve[$e++]):$e+=2;for(Fe=qe,$e=qe=0;$e<Fe;){for(var re=Ve[$e],nt=Ve[$e+1],Xe=$e+2;Xe+2<=Fe&&Ve[Xe+1]===nt;)Xe+=2;Ve[qe++]=re,Ve[qe++]=nt,$e=Xe}Fe=Ve.length=qe;var se=ve.sourceNode,Te="";se&&(Te=se.style.display,se.style.display="none");try{for(var y=null;Ge<ze;){var x=ye[Ge],k=ye[Ge+2]||Ae,d=Ve[it+2]||Ae,Xe=Math.min(k,d),f=ye[Ge+1],h;if(f.nodeType!==1&&(h=Ne.substring(oe,Xe))){we&&(h=h.replace(De,"\r")),f.nodeValue=h;var p=f.ownerDocument,N=p.createElement("span");N.className=Ve[it+1];var K=f.parentNode;K.replaceChild(N,f),N.appendChild(f),oe<k&&(ye[Ge+1]=f=p.createTextNode(Ne.substring(Xe,k)),K.insertBefore(f,N.nextSibling))}oe=Xe,oe>=k&&(Ge+=2),oe>=d&&(it+=2)}}finally{se&&(se.style.display=Te)}}var me={};function R(ve,we){for(var De=we.length;--De>=0;){var Ne=we[De];me.hasOwnProperty(Ne)?S.console&&console.warn("cannot override language handler %s",Ne):me[Ne]=ve}}function z(ve,we){return ve&&me.hasOwnProperty(ve)||(ve=/^\s*</.test(we)?"default-markup":"default-code"),me[ve]}R(de,["default-code"]),R(Se([],[[v,/^[^<?]+/],[P,/^<!\w[^>]*(?:>|$)/],[q,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[J,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),R(Se([[v,/^[\s]+/,null,` \r
`],[ae,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[U,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[F,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[J,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),R(Se([],[[ae,/^[\s\S]+/]]),["uq.val"]),R(je({keywords:G,hashComments:!0,cStyleComments:!0,types:$}),["c","cc","cpp","cxx","cyc","m"]),R(je({keywords:"null,true,false"}),["json"]),R(je({keywords:B,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:$}),["cs"]),R(je({keywords:le,cStyleComments:!0}),["java"]),R(je({keywords:be,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),R(je({keywords:X,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),R(je({keywords:T,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),R(je({keywords:V,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),R(je({keywords:L,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),R(je({keywords:D,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),R(Se([],[[ne,/^[\s\S]+/]]),["regex"]);function Oe(ve){var we=ve.langExtension;try{var De=c(ve.sourceNode,ve.pre),Ne=De.sourceCode;ve.sourceCode=Ne,ve.spans=De.spans,ve.basePos=0,z(we,Ne)(ve),ce(ve)}catch(Ae){S.console&&console.log(Ae&&Ae.stack||Ae)}}function We(ve,we,De){var Ne=De||!1,Ae=we||null,oe=document.createElement("div");oe.innerHTML="<pre>"+ve+"</pre>",oe=oe.firstChild,Ne&&Le(oe,Ne,!0);var ye={langExtension:Ae,numberLines:Ne,sourceNode:oe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Oe(ye),oe.innerHTML}function Ze(ve,we){var De=we||document.body,Ne=De.ownerDocument||document;function Ae(x){return De.getElementsByTagName(x)}for(var oe=[Ae("pre"),Ae("code"),Ae("xmp")],ye=[],ze=0;ze<oe.length;++ze)for(var Ge=0,Ve=oe[ze].length;Ge<Ve;++Ge)ye.push(oe[ze][Ge]);oe=null;var Fe=Date;Fe.now||(Fe={now:function(){return+new Date}});var it=0,qe=/\blang(?:uage)?-([\w.]+)(?!\S)/,$e=/\bprettyprint\b/,re=/\bprettyprinted\b/,nt=/pre|xmp/i,Xe=/^code$/i,se=/^(?:pre|code|xmp)$/i,Te={};function y(){for(var x=S.PR_SHOULD_USE_CONTINUATION?Fe.now()+250:Infinity;it<ye.length&&Fe.now()<x;it++){for(var k=ye[it],d=Te,f=k;f=f.previousSibling;){var h=f.nodeType,p=(h===7||h===8)&&f.nodeValue;if(p?!/^\??prettify\b/.test(p):h!==3||/\S/.test(f.nodeValue))break;if(p){d={},p.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Bt,mt,Cn){d[mt]=Cn});break}}var N=k.className;if((d!==Te||$e.test(N))&&!re.test(N)){for(var K=!1,pe=k.parentNode;pe;pe=pe.parentNode){var tt=pe.tagName;if(se.test(tt)&&pe.className&&$e.test(pe.className)){K=!0;break}}if(!K){k.className+=" prettyprinted";var dt=d.lang;if(!dt){dt=N.match(qe);var at;!dt&&(at=Y(k))&&Xe.test(at.tagName)&&(dt=at.className.match(qe)),dt&&(dt=dt[1])}var Pt;if(nt.test(k.tagName))Pt=1;else{var pt=k.currentStyle,st=Ne.defaultView,Wt=pt?pt.whiteSpace:st&&st.getComputedStyle?st.getComputedStyle(k,null).getPropertyValue("white-space"):0;Pt=Wt&&Wt.substring(0,3)==="pre"}var bt=d.linenums;(bt=bt==="true"||+bt)||(bt=N.match(/\blinenums\b(?::(\d+))?/),bt=bt?bt[1]&&bt[1].length?+bt[1]:!0:!1),bt&&Le(k,bt,Pt);var $t={langExtension:dt,sourceNode:k,numberLines:bt,pre:Pt,sourceCode:null,basePos:null,spans:null,decorations:null};Oe($t)}}}it<ye.length?S.setTimeout(y,250):typeof ve=="function"&&ve()}y()}var He=S.PR={createSimpleLexer:Se,registerLangHandler:R,sourceDecorator:je,PR_ATTRIB_NAME:F,PR_ATTRIB_VALUE:ae,PR_COMMENT:q,PR_DECLARATION:P,PR_KEYWORD:_e,PR_LITERAL:ge,PR_NOCODE:W,PR_PLAIN:v,PR_PUNCTUATION:J,PR_SOURCE:b,PR_STRING:ne,PR_TAG:U,PR_TYPE:Q,prettyPrintOne:H?S.prettyPrintOne=We:ee=We,prettyPrint:O=H?S.prettyPrint=Ze:O=Ze},Be=S.define;typeof Be=="function"&&Be.amd&&Be("google-code-prettify",[],function(){return He})})()},"VrN/":function(ht,Ye,w){(function(M,Ce){ht.exports=Ce()})(this,function(){"use strict";var M=navigator.userAgent,Ce=navigator.platform,H=/gecko\/\d/i.test(M),he=/MSIE \d/.test(M),ue=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(M),ee=/Edge\/(\d+)/.exec(M),O=he||ue||ee,S=O&&(he?document.documentMode||6:+(ee||ue)[1]),C=!ee&&/WebKit\//.test(M),ie=C&&/Qt\/\d+\.\d+/.test(M),j=!ee&&/Chrome\//.test(M),G=/Opera\//.test(M),le=/Apple Computer/.test(navigator.vendor),B=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(M),D=/PhantomJS/.test(M),L=!ee&&/AppleWebKit/.test(M)&&/Mobile\/\w+/.test(M),T=/Android/.test(M),X=L||T||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(M),V=L||/Mac/.test(Ce),be=/\bCrOS\b/.test(M),Ie=/win/i.test(Ce),$=G&&M.match(/Version\/(\d*\.\d*)/);$&&($=Number($[1])),$&&$>=15&&(G=!1,C=!0);var ne=V&&(ie||G&&($==null||$<12.11)),_e=H||O&&S>=9;function q(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Q=function(e,t){var r=e.className,n=q(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function ge(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function J(e,t){return ge(e).appendChild(t)}function v(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function U(e,t,r,n){var i=v(e,t,r,n);return i.setAttribute("role","presentation"),i}var P;document.createRange?P=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:P=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(i){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function b(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function F(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function ae(e,t){var r=e.className;q(t).test(r)||(e.className+=(r?" ":"")+t)}function W(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!q(r[n]).test(t)&&(t+=" "+r[n]);return t}var Ee=function(e){e.select()};L?Ee=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:O&&(Ee=function(e){try{e.select()}catch(t){}});function m(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function c(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function _(e,t,r,n,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=n||0,o=i||0;;){var s=e.indexOf(" ",a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=r-o%r,a=s+1}}var Z=function(){this.id=null,this.f=null,this.time=0,this.handler=m(this.onTimeout,this)};Z.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Z.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function Y(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var Se=50,je={toString:function(){return"CodeMirror.Pass"}},de={scroll:!1},Le={origin:"*mouse"},ce={origin:"+move"};function me(e,t,r){for(var n=0,i=0;;){var a=e.indexOf(" ",n);a==-1&&(a=e.length);var o=a-n;if(a==e.length||i+o>=t)return n+Math.min(o,t-i);if(i+=a-n,i+=r-i%r,n=a+1,i>=t)return n}}var R=[""];function z(e){for(;R.length<=e;)R.push(Oe(R)+" ");return R[e]}function Oe(e){return e[e.length-1]}function We(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Ze(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function He(){}function Be(e,t){var r;return Object.create?r=Object.create(e):(He.prototype=e,r=new He),t&&c(t,r),r}var ve=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function we(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||ve.test(e))}function De(e,t){return t?t.source.indexOf("\\w")>-1&&we(e)?!0:t.test(e):we(e)}function Ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Ae=/[\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 oe(e){return e.charCodeAt(0)>=768&&Ae.test(e)}function ye(e,t,r){for(;(r<0?t>0:t<e.length)&&oe(e.charAt(t));)t+=r;return t}function ze(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,a=n<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:r;e(a)?r=a:t=a+n}}function Ge(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var o=e[a];(o.from<r&&o.to>t||t==r&&o.to==t)&&(n(Math.max(o.from,t),Math.min(o.to,r),o.level==1?"rtl":"ltr",a),i=!0)}i||n(t,r,"ltr")}var Ve=null;function Fe(e,t,r){var n;Ve=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&r=="before"?n=i:Ve=i),a.from==t&&(a.from!=a.to&&r!="before"?n=i:Ve=i)}return n!=null?n:Ve}var it=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,o=/[Lb1n]/,s=/[1n]/;function l(u,g,E){this.level=u,this.from=g,this.to=E}return function(u,g){var E=g=="ltr"?"L":"R";if(u.length==0||g=="ltr"&&!n.test(u))return!1;for(var I=u.length,A=[],te=0;te<I;++te)A.push(r(u.charCodeAt(te)));for(var fe=0,ke=E;fe<I;++fe){var Re=A[fe];Re=="m"?A[fe]=ke:ke=Re}for(var Ue=0,Pe=E;Ue<I;++Ue){var Ke=A[Ue];Ke=="1"&&Pe=="r"?A[Ue]="n":a.test(Ke)&&(Pe=Ke,Ke=="r"&&(A[Ue]="R"))}for(var rt=1,et=A[0];rt<I-1;++rt){var ft=A[rt];ft=="+"&&et=="1"&&A[rt+1]=="1"?A[rt]="1":ft==","&&et==A[rt+1]&&(et=="1"||et=="n")&&(A[rt]=et),et=ft}for(var Et=0;Et<I;++Et){var Ut=A[Et];if(Ut==",")A[Et]="N";else if(Ut=="%"){var Ot=void 0;for(Ot=Et+1;Ot<I&&A[Ot]=="%";++Ot);for(var an=Et&&A[Et-1]=="!"||Ot<I&&A[Ot]=="1"?"1":"N",Qt=Et;Qt<Ot;++Qt)A[Qt]=an;Et=Ot-1}}for(var Dt=0,en=E;Dt<I;++Dt){var Ht=A[Dt];en=="L"&&Ht=="1"?A[Dt]="L":a.test(Ht)&&(en=Ht)}for(var Nt=0;Nt<I;++Nt)if(i.test(A[Nt])){var Rt=void 0;for(Rt=Nt+1;Rt<I&&i.test(A[Rt]);++Rt);for(var Lt=(Nt?A[Nt-1]:E)=="L",tn=(Rt<I?A[Rt]:E)=="L",Nr=Lt==tn?Lt?"L":"R":E,Xn=Nt;Xn<Rt;++Xn)A[Xn]=Nr;Nt=Rt-1}for(var Vt=[],En,Ft=0;Ft<I;)if(o.test(A[Ft])){var Na=Ft;for(++Ft;Ft<I&&o.test(A[Ft]);++Ft);Vt.push(new l(0,Na,Ft))}else{var An=Ft,ur=Vt.length,cr=g=="rtl"?1:0;for(++Ft;Ft<I&&A[Ft]!="L";++Ft);for(var Jt=An;Jt<Ft;)if(s.test(A[Jt])){An<Jt&&(Vt.splice(ur,0,new l(1,An,Jt)),ur+=cr);var Ir=Jt;for(++Jt;Jt<Ft&&s.test(A[Jt]);++Jt);Vt.splice(ur,0,new l(2,Ir,Jt)),ur+=cr,An=Jt}else++Jt;An<Ft&&Vt.splice(ur,0,new l(1,An,Ft))}return g=="ltr"&&(Vt[0].level==1&&(En=u.match(/^\s+/))&&(Vt[0].from=En[0].length,Vt.unshift(new l(0,0,En[0].length))),Oe(Vt).level==1&&(En=u.match(/\s+$/))&&(Oe(Vt).to-=En[0].length,Vt.push(new l(0,I-En[0].length,I)))),g=="rtl"?Vt.reverse():Vt}}();function qe(e,t){var r=e.order;return r==null&&(r=e.order=it(e.text,t)),r}var $e=[],re=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||$e).concat(r)}};function nt(e,t){return e._handlers&&e._handlers[t]||$e}function Xe(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var a=Y(i,r);a>-1&&(n[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function se(e,t){var r=nt(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function Te(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),se(e,r||t.type,e,t),h(t)||t.codemirrorIgnore}function y(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Y(r,t[n])==-1&&r.push(t[n])}function x(e,t){return nt(e,t).length>0}function k(e){e.prototype.on=function(t,r){re(this,t,r)},e.prototype.off=function(t,r){Xe(this,t,r)}}function d(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function f(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function h(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function p(e){d(e),f(e)}function N(e){return e.target||e.srcElement}function K(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),V&&e.ctrlKey&&t==1&&(t=3),t}var pe=function(){if(O&&S<9)return!1;var e=v("div");return"draggable"in e||"dragDrop"in e}(),tt;function dt(e){if(tt==null){var t=v("span","\u200B");J(e,v("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(tt=t.offsetWidth<=1&&t.offsetHeight>2&&!(O&&S<8))}var r=tt?v("span","\u200B"):v("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var at;function Pt(e){if(at!=null)return at;var t=J(e,document.createTextNode("A\u062EA")),r=P(t,0,1).getBoundingClientRect(),n=P(t,1,2).getBoundingClientRect();return ge(e),!r||r.left==r.right?!1:at=n.right-r.right<3}var pt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=a.indexOf("\r");o!=-1?(r.push(a.slice(0,o)),t+=o+1):(r.push(a),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},st=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Wt=function(){var e=v("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),bt=null;function $t(e){if(bt!=null)return bt;var t=J(e,v("span","x")),r=t.getBoundingClientRect(),n=P(t,0,1).getBoundingClientRect();return bt=Math.abs(r.left-n.left)>1}var Bt={},mt={};function Cn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Bt[e]=t}function Gn(e,t){mt[e]=t}function un(e){if(typeof e=="string"&&mt.hasOwnProperty(e))e=mt[e];else if(e&&typeof e.name=="string"&&mt.hasOwnProperty(e.name)){var t=mt[e.name];typeof t=="string"&&(t={name:t}),e=Be(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return un("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return un("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function kn(e,t){t=un(t);var r=Bt[t.name];if(!r)return kn(e,"text/plain");var n=r(e,t);if(pn.hasOwnProperty(t.name)){var i=pn[t.name];for(var a in i){if(!i.hasOwnProperty(a))continue;n.hasOwnProperty(a)&&(n["_"+a]=n[a]),n[a]=i[a]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)n[o]=t.modeProps[o];return n}var pn={};function bi(e,t){var r=pn.hasOwnProperty(e)?pn[e]:pn[e]={};c(t,r)}function cn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Vn(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function dr(e,t,r){return e.startState?e.startState(t,r):!0}var St=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};St.prototype.eol=function(){return this.pos>=this.string.length},St.prototype.sol=function(){return this.pos==this.lineStart},St.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},St.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},St.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},St.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},St.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},St.prototype.skipToEnd=function(){this.pos=this.string.length},St.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},St.prototype.backUp=function(e){this.pos-=e},St.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=_(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},St.prototype.indentation=function(){return _(this.string,null,this.tabSize)-(this.lineStart?_(this.string,this.lineStart,this.tabSize):0)},St.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(o){return r?o.toLowerCase():o},i=this.string.substr(this.pos,e.length);if(n(i)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},St.prototype.current=function(){return this.string.slice(this.start,this.pos)},St.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},St.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},St.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Je(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],a=i.chunkSize();if(t<a){r=i;break}t-=a}return r.lines[t]}function Sn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(a){var o=a.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function fr(e,t,r){var n=[];return e.iter(t,r,function(i){n.push(i.text)}),n}function dn(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function gt(e){if(e.parent==null)return null;for(var t=e.parent,r=Y(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;!(n.children[i]==t);++i)r+=n.children[i].chunkSize();return r+t.first}function _n(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],a=i.height;if(t<a){e=i;continue e}t-=a,r+=i.chunkSize()}return r}while(!e.lines);for(var o=0;o<e.lines.length;++o){var s=e.lines[o],l=s.height;if(t<l)break;t-=l}return r+o}function Dn(e,t){return t>=e.first&&t<e.first+e.size}function $n(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function xe(e,t,r){if(r===void 0&&(r=null),!(this instanceof xe))return new xe(e,t,r);this.line=e,this.ch=t,this.sticky=r}function lt(e,t){return e.line-t.line||e.ch-t.ch}function Me(e,t){return e.sticky==t.sticky&&lt(e,t)==0}function jr(e){return xe(e.line,e.ch)}function hr(e,t){return lt(e,t)<0?t:e}function Yn(e,t){return lt(e,t)<0?e:t}function Jn(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ot(e,t){if(t.line<e.first)return xe(e.first,0);var r=e.first+e.size-1;return t.line>r?xe(r,Je(e,r).text.length):Zi(t,Je(e,t.line).text.length)}function Zi(e,t){var r=e.ch;return r==null||r>t?xe(e.line,t):r<0?xe(e.line,0):e}function Ur(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=ot(e,t[n]);return r}var fn=function(e,t){this.state=e,this.lookAhead=t},on=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};on.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},on.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},on.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},on.fromSaved=function(e,t,r){return t instanceof fn?new on(e,cn(e.mode,t.state),r,t.lookAhead):new on(e,cn(e.mode,t),r)},on.prototype.save=function(e){var t=e!==!1?cn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new fn(t,this.maxLookAhead):t};function yi(e,t,r,n){var i=[e.state.modeGen],a={};Wr(e,t.text,e.doc.mode,r,function(u,g){return i.push(u,g)},a,n);for(var o=r.state,s=function(u){r.baseTokens=i;var g=e.state.overlays[u],E=1,I=0;r.state=!0,Wr(e,t.text,g.mode,r,function(A,te){for(var fe=E;I<A;){var ke=i[E];ke>A&&i.splice(E,1,A,i[E+1],ke),E+=2,I=Math.min(A,ke)}if(!te)return;if(g.opaque)i.splice(fe,E-fe,A,"overlay "+te),E=fe+2;else for(;fe<E;fe+=2){var Re=i[fe+1];i[fe+1]=(Re?Re+" ":"")+"overlay "+te}},a),r.state=o,r.baseTokens=null,r.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Fr(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=nn(e,gt(t)),i=t.text.length>e.options.maxHighlightLength&&cn(e.doc.mode,n.state),a=yi(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function nn(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new on(n,!0,t);var a=Zn(e,t,r),o=a>n.first&&Je(n,a-1).stateAfter,s=o?on.fromSaved(n,o,a):new on(n,dr(n.mode),a);return n.iter(a,t,function(l){pr(e,l.text,s);var u=s.line;l.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?s.save():null,s.nextLine()}),r&&(n.modeFrontier=s.line),s}function pr(e,t,r,n){var i=e.doc.mode,a=new St(t,e.options.tabSize,r);for(a.start=a.pos=n||0,t==""&&xi(i,r.state);!a.eol();)mr(i,a,r.state),a.start=a.pos}function xi(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var r=Vn(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}function mr(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Vn(e,r).mode);var a=e.token(t,r);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var Tn=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function On(e,t,r,n){var i=e.doc,a=i.mode,o;t=ot(i,t);var s=Je(i,t.line),l=nn(e,t.line,r),u=new St(s.text,e.options.tabSize,l),g;for(n&&(g=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,o=mr(a,u,l.state),n&&g.push(new Tn(u,o,cn(i.mode,l.state)));return n?g:new Tn(u,o,l.state)}function wi(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Wr(e,t,r,n,i,a,o){var s=r.flattenSpans;s==null&&(s=e.options.flattenSpans);var l=0,u=null,g=new St(t,e.options.tabSize,n),E,I=e.options.addModeClass&&[null];for(t==""&&wi(xi(r,n.state),a);!g.eol();){if(g.pos>e.options.maxHighlightLength?(s=!1,o&&pr(e,t,n,g.pos),g.pos=t.length,E=null):E=wi(mr(r,g,n.state,I),a),I){var A=I[0].name;A&&(E="m-"+(E?A+" "+E:A))}if(!s||u!=E){for(;l<g.start;)l=Math.min(g.start,l+5e3),i(l,u);u=E}g.start=g.pos}for(;l<g.pos;){var te=Math.min(g.pos,l+5e3);i(te,u),l=te}}function Zn(e,t,r){for(var n,i,a=e.doc,o=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var l=Je(a,s-1),u=l.stateAfter;if(u&&(!r||s+(u instanceof fn?u.lookAhead:0)<=a.modeFrontier))return s;var g=_(l.text,null,e.options.tabSize);(i==null||n>g)&&(i=s-1,n=g)}return i}function Br(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var r=e.first,n=t-1;n>r;n--){var i=Je(e,n).stateAfter;if(i&&(!(i instanceof fn)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}var Ei=!1,hn=!1;function Ci(){Ei=!0}function ki(){hn=!0}function gr(e,t,r){this.marker=e,this.from=t,this.to=r}function Rn(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function ja(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function zr(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function qn(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,s=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);if(s||a.from==t&&o.type=="bookmark"&&(!r||!a.marker.insertLeft)){var l=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);(n||(n=[])).push(new gr(o,a.from,l?null:a.to))}}return n}function Hr(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var a=e[i],o=a.marker,s=a.to==null||(o.inclusiveRight?a.to>=t:a.to>t);if(s||a.from==t&&o.type=="bookmark"&&(!r||a.marker.insertLeft)){var l=a.from==null||(o.inclusiveLeft?a.from<=t:a.from<t);(n||(n=[])).push(new gr(o,l?null:a.from-t,a.to==null?null:a.to-t))}}return n}function Pn(e,t){if(t.full)return null;var r=Dn(e,t.from.line)&&Je(e,t.from.line).markedSpans,n=Dn(e,t.to.line)&&Je(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,a=t.to.ch,o=lt(t.from,t.to)==0,s=qn(r,i,o),l=Hr(n,a,o),u=t.text.length==1,g=Oe(t.text).length+(u?i:0);if(s)for(var E=0;E<s.length;++E){var I=s[E];if(I.to==null){var A=Rn(l,I.marker);A?u&&(I.to=A.to==null?null:A.to+g):I.to=i}}if(l)for(var te=0;te<l.length;++te){var fe=l[te];if(fe.to!=null&&(fe.to+=g),fe.from==null){var ke=Rn(s,fe.marker);ke||(fe.from=g,u&&(s||(s=[])).push(fe))}else fe.from+=g,u&&(s||(s=[])).push(fe)}s&&(s=Qn(s)),l&&l!=s&&(l=Qn(l));var Re=[s];if(!u){var Ue=t.text.length-2,Pe;if(Ue>0&&s)for(var Ke=0;Ke<s.length;++Ke)s[Ke].to==null&&(Pe||(Pe=[])).push(new gr(s[Ke].marker,null,null));for(var rt=0;rt<Ue;++rt)Re.push(Pe);Re.push(l)}return Re}function Qn(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Si(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(A){if(A.markedSpans)for(var te=0;te<A.markedSpans.length;++te){var fe=A.markedSpans[te].marker;fe.readOnly&&(!n||Y(n,fe)==-1)&&(n||(n=[])).push(fe)}}),!n)return null;for(var i=[{from:t,to:r}],a=0;a<n.length;++a)for(var o=n[a],s=o.find(0),l=0;l<i.length;++l){var u=i[l];if(lt(u.to,s.from)<0||lt(u.from,s.to)>0)continue;var g=[l,1],E=lt(u.from,s.from),I=lt(u.to,s.to);(E<0||!o.inclusiveLeft&&!E)&&g.push({from:u.from,to:s.from}),(I>0||!o.inclusiveRight&&!I)&&g.push({from:s.to,to:u.to}),i.splice.apply(i,g),l+=g.length-3}return i}function Kr(e){var t=e.markedSpans;if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}function er(e,t){if(!t)return;for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}function vr(e){return e.inclusiveLeft?-1:0}function yn(e){return e.inclusiveRight?1:0}function Xr(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),i=t.find(),a=lt(n.from,i.from)||vr(e)-vr(t);if(a)return-a;var o=lt(n.to,i.to)||yn(e)-yn(t);return o||t.id-e.id}function _i(e,t){var r=hn&&e.markedSpans,n;if(r)for(var i=void 0,a=0;a<r.length;++a)i=r[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!n||Xr(n,i.marker)<0)&&(n=i.marker);return n}function Ti(e){return _i(e,!0)}function Gr(e){return _i(e,!1)}function Ua(e,t){var r=hn&&e.markedSpans,n;if(r)for(var i=0;i<r.length;++i){var a=r[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!n||Xr(n,a.marker)<0)&&(n=a.marker)}return n}function qi(e,t,r,n,i){var a=Je(e,t),o=hn&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var l=o[s];if(!l.marker.collapsed)continue;var u=l.marker.find(0),g=lt(u.from,r)||vr(l.marker)-vr(i),E=lt(u.to,n)||yn(l.marker)-yn(i);if(g>=0&&E<=0||g<=0&&E>=0)continue;if(g<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?lt(u.to,r)>=0:lt(u.to,r)>0)||g>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?lt(u.from,n)<=0:lt(u.from,n)<0))return!0}}function Qe(e){for(var t;t=Ti(e);)e=t.find(-1,!0).line;return e}function ut(e){for(var t;t=Gr(e);)e=t.find(1,!0).line;return e}function ct(e){for(var t,r;t=Gr(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function xt(e,t){var r=Je(e,t),n=Qe(r);return r==n?t:gt(n)}function wt(e,t){if(t>e.lastLine())return t;var r=Je(e,t),n;if(!Ct(e,r))return t;for(;n=Gr(r);)r=n.find(1,!0).line;return gt(r)+1}function Ct(e,t){var r=hn&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i){if(n=r[i],!n.marker.collapsed)continue;if(n.from==null)return!0;if(n.marker.widgetNode)continue;if(n.from==0&&n.marker.inclusiveLeft&&Mt(e,t,n))return!0}}function Mt(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return Mt(e,n.line,Rn(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(i.to==null||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&Mt(e,t,i))return!0}function _t(e){e=Qe(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var a=r.parent;a;r=a,a=r.parent)for(var o=0;o<a.children.length;++o){var s=a.children[o];if(s==r)break;t+=s.height}return t}function Kt(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=Ti(n);){var i=r.find(0,!0);n=i.from.line,t+=i.from.ch-i.to.ch}for(n=e;r=Gr(n);){var a=r.find(0,!0);t-=n.text.length-a.from.ch,n=a.to.line,t+=n.text.length-a.to.ch}return t}function mn(e){var t=e.display,r=e.doc;t.maxLine=Je(r,r.first),t.maxLineLength=Kt(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var i=Kt(n);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var kt=function(e,t,r){this.text=e,er(this,t),this.height=r?r(this):1};kt.prototype.lineNo=function(){return gt(this)},k(kt);function Nn(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Kr(e),er(e,r);var i=n?n(e):1;i!=e.height&&dn(e,i)}function Xt(e){e.parent=null,Kr(e)}var In={},jn={};function br(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?jn:In;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Fa(e,t){var r=U("span",null,null,C?"padding-right: .1px":null),n={pre:U("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,o=void 0;n.pos=0,n.addToken=Ss,Pt(e.display.measure)&&(o=qe(a,e.doc.direction))&&(n.addToken=Ts(n.addToken,o)),n.map=[];var s=t!=e.display.externalMeasured&&gt(a);Os(a,n,Fr(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=W(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=W(a.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(dt(e.display.measure))),i==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(C){var l=n.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return se(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=W(n.pre.className,n.textClass||"")),n}function ks(e){var t=v("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ss(e,t,r,n,i,a,o){if(!t)return;var s=e.splitSpaces?_s(t,e.trailingSpace):t,l=e.cm.state.specialChars,u=!1,g;if(!l.test(t))e.col+=t.length,g=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,g),O&&S<9&&(u=!0),e.pos+=t.length;else{g=document.createDocumentFragment();for(var E=0;;){l.lastIndex=E;var I=l.exec(t),A=I?I.index-E:t.length-E;if(A){var te=document.createTextNode(s.slice(E,E+A));O&&S<9?g.appendChild(v("span",[te])):g.appendChild(te),e.map.push(e.pos,e.pos+A,te),e.col+=A,e.pos+=A}if(!I)break;E+=A+1;var fe=void 0;if(I[0]==" "){var ke=e.cm.options.tabSize,Re=ke-e.col%ke;fe=g.appendChild(v("span",z(Re),"cm-tab")),fe.setAttribute("role","presentation"),fe.setAttribute("cm-text"," "),e.col+=Re}else I[0]=="\r"||I[0]==`
`?(fe=g.appendChild(v("span",I[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),fe.setAttribute("cm-text",I[0]),e.col+=1):(fe=e.cm.options.specialCharPlaceholder(I[0]),fe.setAttribute("cm-text",I[0]),O&&S<9?g.appendChild(v("span",[fe])):g.appendChild(fe),e.col+=1);e.map.push(e.pos,e.pos+1,fe),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,r||n||i||u||a||o){var Ue=r||"";n&&(Ue+=n),i&&(Ue+=i);var Pe=v("span",[g],Ue,a);if(o)for(var Ke in o)o.hasOwnProperty(Ke)&&Ke!="style"&&Ke!="class"&&Pe.setAttribute(Ke,o[Ke]);return e.content.appendChild(Pe)}e.content.appendChild(g)}function _s(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&r&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a="\xA0"),n+=a,r=a==" "}return n}function Ts(e,t){return function(r,n,i,a,o,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,g=u+n.length;;){for(var E=void 0,I=0;I<t.length&&!(E=t[I],E.to>u&&E.from<=u);I++);if(E.to>=g)return e(r,n,i,a,o,s,l);e(r,n.slice(0,E.to-u),i,a,null,s,l),a=null,n=n.slice(E.to-u),u=E.to}}}function Wa(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Os(e,t,r){var n=e.markedSpans,i=e.text,a=0;if(!n){for(var o=1;o<r.length;o+=2)t.addToken(t,i.slice(a,a=r[o]),br(r[o+1],t.cm.options));return}for(var s=i.length,l=0,u=1,g="",E,I,A=0,te,fe,ke,Re,Ue;;){if(A==l){te=fe=ke=I="",Ue=null,Re=null,A=Infinity;for(var Pe=[],Ke=void 0,rt=0;rt<n.length;++rt){var et=n[rt],ft=et.marker;if(ft.type=="bookmark"&&et.from==l&&ft.widgetNode)Pe.push(ft);else if(et.from<=l&&(et.to==null||et.to>l||ft.collapsed&&et.to==l&&et.from==l)){if(et.to!=null&&et.to!=l&&A>et.to&&(A=et.to,fe=""),ft.className&&(te+=" "+ft.className),ft.css&&(I=(I?I+";":"")+ft.css),ft.startStyle&&et.from==l&&(ke+=" "+ft.startStyle),ft.endStyle&&et.to==A&&(Ke||(Ke=[])).push(ft.endStyle,et.to),ft.title&&((Ue||(Ue={})).title=ft.title),ft.attributes)for(var Et in ft.attributes)(Ue||(Ue={}))[Et]=ft.attributes[Et];ft.collapsed&&(!Re||Xr(Re.marker,ft)<0)&&(Re=et)}else et.from>l&&A>et.from&&(A=et.from)}if(Ke)for(var Ut=0;Ut<Ke.length;Ut+=2)Ke[Ut+1]==A&&(fe+=" "+Ke[Ut]);if(!Re||Re.from==l)for(var Ot=0;Ot<Pe.length;++Ot)Wa(t,0,Pe[Ot]);if(Re&&(Re.from||0)==l){if(Wa(t,(Re.to==null?s+1:Re.to)-l,Re.marker,Re.from==null),Re.to==null)return;Re.to==l&&(Re=!1)}}if(l>=s)break;for(var an=Math.min(s,A);;){if(g){var Qt=l+g.length;if(!Re){var Dt=Qt>an?g.slice(0,an-l):g;t.addToken(t,Dt,E?E+te:te,ke,l+Dt.length==A?fe:"",I,Ue)}if(Qt>=an){g=g.slice(an-l),l=an;break}l=Qt,ke=""}g=i.slice(a,a=r[u++]),E=br(r[u++],t.cm.options)}}}function Ba(e,t,r){this.line=t,this.rest=ct(t),this.size=this.rest?gt(Oe(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ct(e,t)}function Oi(e,t,r){for(var n=[],i,a=t;a<r;a=i){var o=new Ba(e.doc,Je(e.doc,a),a);i=a+o.size,n.push(o)}return n}var yr=null;function Ls(e){yr?yr.ops.push(e):e.ownsGroup=yr={ops:[e],delayedCallbacks:[]}}function Ms(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function As(e,t){var r=e.ownsGroup;if(!r)return;try{Ms(r)}finally{yr=null,t(r)}}var Vr=null;function zt(e,t){var r=nt(e,t);if(!r.length)return;var n=Array.prototype.slice.call(arguments,2),i;yr?i=yr.delayedCallbacks:Vr?i=Vr:(i=Vr=[],setTimeout(Ds,0));for(var a=function(s){i.push(function(){return r[s].apply(null,n)})},o=0;o<r.length;++o)a(o)}function Ds(){var e=Vr;Vr=null;for(var t=0;t<e.length;++t)e[t]()}function za(e,t,r,n){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Ps(e,t):a=="gutter"?Ka(e,t,r,n):a=="class"?Qi(e,t):a=="widget"&&Ns(e,t,n)}t.changes=null}function $r(e){return e.node==e.text&&(e.node=v("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),O&&S<8&&(e.node.style.zIndex=2)),e.node}function Rs(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=$r(t);t.background=n.insertBefore(v("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Ha(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Fa(e,t)}function Ps(e,t){var r=t.text.className,n=Ha(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Qi(e,t)):r&&(t.text.className=r)}function Qi(e,t){Rs(e,t),t.line.wrapClass?$r(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Ka(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=$r(t);t.gutterBackground=v("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var o=$r(t),s=t.gutter=v("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),o.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=s.appendChild(v("div",$n(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var l=0;l<e.display.gutterSpecs.length;++l){var u=e.display.gutterSpecs[l].className,g=a.hasOwnProperty(u)&&a[u];g&&s.appendChild(v("div",[g],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function Ns(e,t,r){t.alignable&&(t.alignable=null);for(var n=q("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);Xa(e,t,r)}function Is(e,t,r,n){var i=Ha(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Qi(e,t),Ka(e,t,r,n),Xa(e,t,n),t.node}function Xa(e,t,r){if(Ga(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Ga(e,t.rest[n],t,r,!1)}function Ga(e,t,r,n,i){if(!t.widgets)return;for(var a=$r(r),o=0,s=t.widgets;o<s.length;++o){var l=s[o],u=v("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),js(l,u,r,n),e.display.input.setUneditable(u),i&&l.above?a.insertBefore(u,r.gutter||r.text):a.appendChild(u),zt(l,"redraw")}}function js(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Yr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!b(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),J(t.display.measure,v("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function Ln(e,t){for(var r=N(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Li(e){return e.lineSpace.offsetTop}function ea(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Va(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=J(e.measure,v("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function xn(e){return Se-e.display.nativeBarWidth}function tr(e){return e.display.scroller.clientWidth-xn(e)-e.display.barWidth}function ta(e){return e.display.scroller.clientHeight-xn(e)-e.display.barHeight}function Us(e,t,r){var n=e.options.lineWrapping,i=n&&tr(e);if(!t.measure.heights||n&&t.measure.width!=i){var a=t.measure.heights=[];if(n){t.measure.width=i;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var l=o[s],u=o[s+1];Math.abs(l.bottom-u.bottom)>2&&a.push((l.bottom+u.top)/2-r.top)}}a.push(r.bottom-r.top)}}function $a(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(gt(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Fs(e,t){t=Qe(t);var r=gt(t),n=e.display.externalMeasured=new Ba(e.doc,t,r);n.lineN=r;var i=n.built=Fa(e,n);return n.text=i.pre,J(e.display.lineMeasure,i.pre),n}function Ya(e,t,r,n){return wn(e,xr(e,t),r,n)}function na(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ir(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function xr(e,t){var r=gt(t),n=na(e,r);n&&!n.text?n=null:n&&n.changes&&(za(e,n,r,la(e)),e.curOp.forceUpdate=!0),n||(n=Fs(e,t));var i=$a(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function wn(e,t,r,n,i){t.before&&(r=-1);var a=r+(n||""),o;return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),o=Bs(e,t,r,n),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var Ja={left:0,right:0,top:0,bottom:0};function Za(e,t,r){for(var n,i,a,o,s,l,u=0;u<e.length;u+=3)if(s=e[u],l=e[u+1],t<s?(i=0,a=1,o="left"):t<l?(i=t-s,a=i+1):(u==e.length-3||t==l&&e[u+3]>t)&&(a=l-s,i=a-1,t>=l&&(o="right")),i!=null){if(n=e[u+2],s==l&&r==(n.insertLeft?"left":"right")&&(o=r),r=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[(u-=3)+2],o="left";if(r=="right"&&i==l-s)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],o="right";break}return{node:n,start:i,end:a,collapse:o,coverStart:s,coverEnd:l}}function Ws(e,t){var r=Ja;if(t=="left")for(var n=0;n<e.length&&!((r=e[n]).left!=r.right);n++);else for(var i=e.length-1;i>=0&&!((r=e[i]).left!=r.right);i--);return r}function Bs(e,t,r,n){var i=Za(t.map,r,n),a=i.node,o=i.start,s=i.end,l=i.collapse,u;if(a.nodeType==3){for(var g=0;g<4;g++){for(;o&&oe(t.line.text.charAt(i.coverStart+o));)--o;for(;i.coverStart+s<i.coverEnd&&oe(t.line.text.charAt(i.coverStart+s));)++s;if(O&&S<9&&o==0&&s==i.coverEnd-i.coverStart?u=a.parentNode.getBoundingClientRect():u=Ws(P(a,o,s).getClientRects(),n),u.left||u.right||o==0)break;s=o,o=o-1,l="right"}O&&S<11&&(u=zs(e.display.measure,u))}else{o>0&&(l=n="right");var E;e.options.lineWrapping&&(E=a.getClientRects()).length>1?u=E[n=="right"?E.length-1:0]:u=a.getBoundingClientRect()}if(O&&S<9&&!o&&(!u||!u.left&&!u.right)){var I=a.parentNode.getClientRects()[0];I?u={left:I.left,right:I.left+Er(e.display),top:I.top,bottom:I.bottom}:u=Ja}for(var A=u.top-t.rect.top,te=u.bottom-t.rect.top,fe=(A+te)/2,ke=t.view.measure.heights,Re=0;Re<ke.length-1&&!(fe<ke[Re]);Re++);var Ue=Re?ke[Re-1]:0,Pe=ke[Re],Ke={left:(l=="right"?u.right:u.left)-t.rect.left,right:(l=="left"?u.left:u.right)-t.rect.left,top:Ue,bottom:Pe};return!u.left&&!u.right&&(Ke.bogus=!0),e.options.singleCursorHeightPerLine||(Ke.rtop=A,Ke.rbottom=te),Ke}function zs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!$t(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function qa(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Qa(e){e.display.externalMeasure=null,ge(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)qa(e.display.view[t])}function Jr(e){Qa(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function eo(){return j&&T?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function to(){return j&&T?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ra(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Yr(e.widgets[r]));return t}function Mi(e,t,r,n,i){if(!i){var a=ra(t);r.top+=a,r.bottom+=a}if(n=="line")return r;n||(n="local");var o=_t(t);if(n=="local"?o+=Li(e.display):o-=e.display.viewOffset,n=="page"||n=="window"){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+(n=="window"?0:to());var l=s.left+(n=="window"?0:eo());r.left+=l,r.right+=l}return r.top+=o,r.bottom+=o,r}function no(e,t,r){if(r=="div")return t;var n=t.left,i=t.top;if(r=="page")n-=eo(),i-=to();else if(r=="local"||!r){var a=e.display.sizer.getBoundingClientRect();n+=a.left,i+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:n-o.left,top:i-o.top}}function ia(e,t,r,n,i){return n||(n=Je(e.doc,t.line)),Mi(e,n,Ya(e,n,t.ch,i),r)}function gn(e,t,r,n,i,a){n=n||Je(e.doc,t.line),i||(i=xr(e,n));function o(te,fe){var ke=wn(e,i,te,fe?"right":"left",a);return fe?ke.left=ke.right:ke.right=ke.left,Mi(e,n,ke,r)}var s=qe(n,e.doc.direction),l=t.ch,u=t.sticky;if(l>=n.text.length?(l=n.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return o(u=="before"?l-1:l,u=="before");function g(te,fe,ke){var Re=s[fe],Ue=Re.level==1;return o(ke?te-1:te,Ue!=ke)}var E=Fe(s,l,u),I=Ve,A=g(l,E,u=="before");return I!=null&&(A.other=g(l,I,u!="before")),A}function ro(e,t){var r=0;t=ot(e.doc,t),e.options.lineWrapping||(r=Er(e.display)*t.ch);var n=Je(e.doc,t.line),i=_t(n)+Li(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function aa(e,t,r,n,i){var a=xe(e,t,r);return a.xRel=i,n&&(a.outside=n),a}function oa(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return aa(n.first,0,null,-1,-1);var i=_n(n,r),a=n.first+n.size-1;if(i>a)return aa(n.first+n.size-1,Je(n,a).text.length,null,1,1);t<0&&(t=0);for(var o=Je(n,i);;){var s=Hs(e,o,i,t,r),l=Ua(o,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;o=Je(n,i=u.line)}}function io(e,t,r,n){n-=ra(t);var i=t.text.length,a=ze(function(o){return wn(e,r,o-1).bottom<=n},i,0);return i=ze(function(o){return wn(e,r,o).top>n},a,i),{begin:a,end:i}}function ao(e,t,r,n){r||(r=xr(e,t));var i=Mi(e,t,wn(e,r,n),"line").top;return io(e,t,r,i)}function sa(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Hs(e,t,r,n,i){i-=_t(t);var a=xr(e,t),o=ra(t),s=0,l=t.text.length,u=!0,g=qe(t,e.doc.direction);if(g){var E=(e.options.lineWrapping?Xs:Ks)(e,t,r,a,g,n,i);u=E.level!=1,s=u?E.from:E.to-1,l=u?E.to:E.from-1}var I=null,A=null,te=ze(function(rt){var et=wn(e,a,rt);return et.top+=o,et.bottom+=o,sa(et,n,i,!1)?(et.top<=i&&et.left<=n&&(I=rt,A=et),!0):!1},s,l),fe,ke,Re=!1;if(A){var Ue=n-A.left<A.right-n,Pe=Ue==u;te=I+(Pe?0:1),ke=Pe?"after":"before",fe=Ue?A.left:A.right}else{!u&&(te==l||te==s)&&te++,ke=te==0?"after":te==t.text.length?"before":wn(e,a,te-(u?1:0)).bottom+o<=i==u?"after":"before";var Ke=gn(e,xe(r,te,ke),"line",t,a);fe=Ke.left,Re=i<Ke.top?-1:i>=Ke.bottom?1:0}return te=ye(t.text,te,1),aa(r,te,ke,Re,n-fe)}function Ks(e,t,r,n,i,a,o){var s=ze(function(E){var I=i[E],A=I.level!=1;return sa(gn(e,xe(r,A?I.to:I.from,A?"before":"after"),"line",t,n),a,o,!0)},0,i.length-1),l=i[s];if(s>0){var u=l.level!=1,g=gn(e,xe(r,u?l.from:l.to,u?"after":"before"),"line",t,n);sa(g,a,o,!0)&&g.top>o&&(l=i[s-1])}return l}function Xs(e,t,r,n,i,a,o){var s=io(e,t,n,o),l=s.begin,u=s.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var g=null,E=null,I=0;I<i.length;I++){var A=i[I];if(A.from>=u||A.to<=l)continue;var te=A.level!=1,fe=wn(e,n,te?Math.min(u,A.to)-1:Math.max(l,A.from)).right,ke=fe<a?a-fe+1e9:fe-a;(!g||E>ke)&&(g=A,E=ke)}return g||(g=i[i.length-1]),g.from<l&&(g={from:l,to:g.to,level:g.level}),g.to>u&&(g={from:g.from,to:u,level:g.level}),g}var nr;function wr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(nr==null){nr=v("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)nr.appendChild(document.createTextNode("x")),nr.appendChild(v("br"));nr.appendChild(document.createTextNode("x"))}J(e.measure,nr);var r=nr.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),ge(e.measure),r||1}function Er(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=v("span","xxxxxxxxxx"),r=v("pre",[t],"CodeMirror-line-like");J(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function la(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o){var s=e.display.gutterSpecs[o].className;r[s]=a.offsetLeft+a.clientLeft+i,n[s]=a.clientWidth}return{fixedPos:ua(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function ua(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function oo(e){var t=wr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Er(e.display)-3);return function(i){if(Ct(e.doc,i))return 0;var a=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(a+=i.widgets[o].height);return r?a+(Math.ceil(i.text.length/n)||1)*t:a+t}}function ca(e){var t=e.doc,r=oo(e);t.iter(function(n){var i=r(n);i!=n.height&&dn(n,i)})}function rr(e,t,r,n){var i=e.display;if(!r&&N(t).getAttribute("cm-not-content")=="true")return null;var a,o,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch(E){return null}var l=oa(e,a,o),u;if(n&&l.xRel>0&&(u=Je(e.doc,l.line).text).length==l.ch){var g=_(u,u.length,e.options.tabSize)-u.length;l=xe(l.line,Math.max(0,Math.round((a-Va(e.display).left)/Er(e.display))-g))}return l}function ir(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Zt(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)hn&&xt(e.doc,t)<i.viewTo&&Fn(e);else if(r<=i.viewFrom)hn&&wt(e.doc,r+n)>i.viewFrom?Fn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)Fn(e);else if(t<=i.viewFrom){var a=Ai(e,r,r+n,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=n):Fn(e)}else if(r>=i.viewTo){var o=Ai(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Fn(e)}else{var s=Ai(e,t,t,-1),l=Ai(e,r,r+n,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Oi(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=n):Fn(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function Un(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),t<n.viewFrom||t>=n.viewTo)return;var a=n.view[ir(e,t)];if(a.node==null)return;var o=a.changes||(a.changes=[]);Y(o,r)==-1&&o.push(r)}function Fn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ai(e,t,r,n){var i=ir(e,t),a,o=e.display.view;if(!hn||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,l=0;l<i;l++)s+=o[l].size;if(s!=t){if(n>0){if(i==o.length-1)return null;a=s+o[i].size-t,i++}else a=s-t;t+=a,r+=a}for(;xt(e.doc,r)!=r;){if(i==(n<0?0:o.length-1))return null;r+=n*o[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function Gs(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Oi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Oi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(ir(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Oi(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,ir(e,r)))),n.viewTo=r}function so(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];!i.hidden&&(!i.node||i.changes)&&++r}return r}function Zr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function lo(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),a=n.selection=document.createDocumentFragment(),o=0;o<r.sel.ranges.length;o++){if(!t&&o==r.sel.primIndex)continue;var s=r.sel.ranges[o];if(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)continue;var l=s.empty();(l||e.options.showCursorWhenSelecting)&&uo(e,s.head,i),l||Vs(e,s,a)}return n}function uo(e,t,r){var n=gn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(v("div","\xA0","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var a=r.appendChild(v("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=n.other.left+"px",a.style.top=n.other.top+"px",a.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Di(e,t){return e.top-t.top||e.left-t.left}function Vs(e,t,r){var n=e.display,i=e.doc,a=document.createDocumentFragment(),o=Va(e.display),s=o.left,l=Math.max(n.sizerWidth,tr(e)-n.sizer.offsetLeft)-o.right,u=i.direction=="ltr";function g(Pe,Ke,rt,et){Ke<0&&(Ke=0),Ke=Math.round(Ke),et=Math.round(et),a.appendChild(v("div",null,"CodeMirror-selected","position: absolute; left: "+Pe+`px;
top: `+Ke+"px; width: "+(rt==null?l-Pe:rt)+`px;
height: `+(et-Ke)+"px"))}function E(Pe,Ke,rt){var et=Je(i,Pe),ft=et.text.length,Et,Ut;function Ot(Dt,en){return ia(e,xe(Pe,Dt),"div",et,en)}function an(Dt,en,Ht){var Nt=ao(e,et,null,Dt),Rt=en=="ltr"==(Ht=="after")?"left":"right",Lt=Ht=="after"?Nt.begin:Nt.end-(/\s/.test(et.text.charAt(Nt.end-1))?2:1);return Ot(Lt,Rt)[Rt]}var Qt=qe(et,i.direction);return Ge(Qt,Ke||0,rt==null?ft:rt,function(Dt,en,Ht,Nt){var Rt=Ht=="ltr",Lt=Ot(Dt,Rt?"left":"right"),tn=Ot(en-1,Rt?"right":"left"),Nr=Ke==null&&Dt==0,Xn=rt==null&&en==ft,Vt=Nt==0,En=!Qt||Nt==Qt.length-1;if(tn.top-Lt.top<=3){var Ft=(u?Nr:Xn)&&Vt,Na=(u?Xn:Nr)&&En,An=Ft?s:(Rt?Lt:tn).left,ur=Na?l:(Rt?tn:Lt).right;g(An,Lt.top,ur-An,Lt.bottom)}else{var cr,Jt,Ir,Ia;Rt?(cr=u&&Nr&&Vt?s:Lt.left,Jt=u?l:an(Dt,Ht,"before"),Ir=u?s:an(en,Ht,"after"),Ia=u&&Xn&&En?l:tn.right):(cr=u?an(Dt,Ht,"before"):s,Jt=!u&&Nr&&Vt?l:Lt.right,Ir=!u&&Xn&&En?s:tn.left,Ia=u?an(en,Ht,"after"):l),g(cr,Lt.top,Jt-cr,Lt.bottom),Lt.bottom<tn.top&&g(s,Lt.bottom,null,tn.top),g(Ir,tn.top,Ia-Ir,tn.bottom)}(!Et||Di(Lt,Et)<0)&&(Et=Lt),Di(tn,Et)<0&&(Et=tn),(!Ut||Di(Lt,Ut)<0)&&(Ut=Lt),Di(tn,Ut)<0&&(Ut=tn)}),{start:Et,end:Ut}}var I=t.from(),A=t.to();if(I.line==A.line)E(I.line,I.ch,A.ch);else{var te=Je(i,I.line),fe=Je(i,A.line),ke=Qe(te)==Qe(fe),Re=E(I.line,I.ch,ke?te.text.length+1:null).end,Ue=E(A.line,ke?0:null,A.ch).start;ke&&(Re.top<Ue.top-2?(g(Re.right,Re.top,null,Re.bottom),g(s,Ue.top,Ue.left,Ue.bottom)):g(Re.right,Re.top,Ue.left-Re.right,Re.bottom)),Re.bottom<Ue.top&&g(s,Re.bottom,null,Ue.top)}r.appendChild(a)}function da(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Cr(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function co(e){e.state.focused||(e.display.input.focus(),fa(e))}function fo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Cr(e))},100)}function fa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(se(e,"focus",e,t),e.state.focused=!0,ae(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),C&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),da(e)}function Cr(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(se(e,"blur",e,t),e.state.focused=!1,Q(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ri(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],a=e.options.lineWrapping,o=void 0,s=0;if(i.hidden)continue;if(O&&S<8){var l=i.node.offsetTop+i.node.offsetHeight;o=l-r,r=l}else{var u=i.node.getBoundingClientRect();o=u.bottom-u.top,!a&&i.text.firstChild&&(s=i.text.firstChild.getBoundingClientRect().right-u.left-1)}var g=i.line.height-o;if((g>.005||g<-.005)&&(dn(i.line,o),ho(i.line),i.rest))for(var E=0;E<i.rest.length;E++)ho(i.rest[E]);if(s>e.display.sizerWidth){var I=Math.ceil(s/Er(e.display));I>e.display.maxLineLength&&(e.display.maxLineLength=I,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}function ho(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function Pi(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Li(e));var i=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,a=_n(t,n),o=_n(t,i);if(r&&r.ensure){var s=r.ensure.from.line,l=r.ensure.to.line;s<a?(a=s,o=_n(t,_t(Je(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=o&&(a=_n(t,_t(Je(t,l))-e.wrapper.clientHeight),o=l)}return{from:a,to:Math.max(o,a+1)}}function $s(e,t){if(Te(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!D){var a=v("div","\u200B",null,`position: absolute;
top: `+(t.top-r.viewOffset-Li(e.display))+`px;
height: `+(t.bottom-t.top+xn(e)+r.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}function Ys(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(t=t.ch?xe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?xe(t.line,t.ch+1,"before"):t);for(var a=0;a<5;a++){var o=!1,s=gn(e,t),l=!r||r==t?s:gn(e,r);i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-n,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+n};var u=ha(e,i),g=e.doc.scrollTop,E=e.doc.scrollLeft;if(u.scrollTop!=null&&(Qr(e,u.scrollTop),Math.abs(e.doc.scrollTop-g)>1&&(o=!0)),u.scrollLeft!=null&&(ar(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-E)>1&&(o=!0)),!o)break}return i}function Js(e,t){var r=ha(e,t);r.scrollTop!=null&&Qr(e,r.scrollTop),r.scrollLeft!=null&&ar(e,r.scrollLeft)}function ha(e,t){var r=e.display,n=wr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,a=ta(e),o={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+ea(r),l=t.top<n,u=t.bottom>s-n;if(t.top<i)o.scrollTop=l?0:t.top;else if(t.bottom>i+a){var g=Math.min(t.top,(u?s:t.bottom)-a);g!=i&&(o.scrollTop=g)}var E=e.options.fixedGutter?0:r.gutters.offsetWidth,I=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-E,A=tr(e)-r.gutters.offsetWidth,te=t.right-t.left>A;return te&&(t.right=t.left+A),t.left<10?o.scrollLeft=0:t.left<I?o.scrollLeft=Math.max(0,t.left+E-(te?0:10)):t.right>A+I-3&&(o.scrollLeft=t.right+(te?0:10)-A),o}function pa(e,t){if(t==null)return;Ni(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function kr(e){Ni(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function qr(e,t,r){(t!=null||r!=null)&&Ni(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Zs(e,t){Ni(e),e.curOp.scrollToPos=t}function Ni(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=ro(e,t.from),n=ro(e,t.to);po(e,r,n,t.margin)}}function po(e,t,r,n){var i=ha(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});qr(e,i.scrollLeft,i.scrollTop)}function Qr(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;H||ga(e,{top:t}),mo(e,t,!0),H&&ga(e),ni(e,100)}function mo(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function ar(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function ei(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+ea(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+xn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var or=function(e,t,r){this.cm=r;var n=this.vert=v("div",[v("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=v("div",[v("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),re(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),re(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,O&&S<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};or.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},or.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},or.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},or.prototype.zeroWidthHack=function(){var e=V&&!B?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Z,this.disableVert=new Z},or.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var i=e.getBoundingClientRect(),a=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)},or.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ti=function(){};ti.prototype.update=function(){return{bottom:0,right:0}},ti.prototype.setScrollLeft=function(){},ti.prototype.setScrollTop=function(){},ti.prototype.clear=function(){};function Sr(e,t){t||(t=ei(e));var r=e.display.barWidth,n=e.display.barHeight;go(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Ri(e),go(e,ei(e)),r=e.display.barWidth,n=e.display.barHeight}function go(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var vo={native:or,null:ti};function bo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Q(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new vo[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),re(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?ar(e,t):Qr(e,t)},e),e.display.scrollbars.addClass&&ae(e.display.wrapper,e.display.scrollbars.addClass)}var qs=0;function sr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.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:++qs},Ls(e.curOp)}function lr(e){var t=e.curOp;t&&As(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;Qs(r)})}function Qs(e){for(var t=e.ops,r=0;r<t.length;r++)el(t[r]);for(var n=0;n<t.length;n++)tl(t[n]);for(var i=0;i<t.length;i++)nl(t[i]);for(var a=0;a<t.length;a++)rl(t[a]);for(var o=0;o<t.length;o++)il(t[o])}function el(e){var t=e.cm,r=t.display;ol(t),e.updateMaxLine&&mn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&ma(e.cm,e.update)}function nl(e){var t=e.cm,r=t.display;e.updatedDisplay&&Ri(t),e.barMeasure=ei(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ya(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+xn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-tr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function rl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ar(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==F();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Sr(t,e.barMeasure),e.updatedDisplay&&ba(t,e.barMeasure),e.selectionChanged&&da(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&co(e.cm)}function il(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&yo(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&mo(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ar(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Ys(t,ot(n,e.scrollToPos.from),ot(n,e.scrollToPos.to),e.scrollToPos.margin);$s(t,i)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var s=0;s<a.length;++s)a[s].lines.length||se(a[s],"hide");if(o)for(var l=0;l<o.length;++l)o[l].lines.length&&se(o[l],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&se(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function rn(e,t){if(e.curOp)return t();sr(e);try{return t()}finally{lr(e)}}function It(e,t){return function(){if(e.curOp)return t.apply(e,arguments);sr(e);try{return t.apply(e,arguments)}finally{lr(e)}}}function Yt(e){return function(){if(this.curOp)return e.apply(this,arguments);sr(this);try{return e.apply(this,arguments)}finally{lr(this)}}}function jt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);sr(t);try{return e.apply(this,arguments)}finally{lr(t)}}}function ni(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,m(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=nn(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(n.line>=e.display.viewFrom){var o=a.styles,s=a.text.length>e.options.maxHighlightLength?cn(t.mode,n.state):null,l=yi(e,a,n,!0);s&&(n.state=s),a.styles=l.styles;var u=a.styleClasses,g=l.classes;g?a.styleClasses=g:u&&(a.styleClasses=null);for(var E=!o||o.length!=a.styles.length||u!=g&&(!u||!g||u.bgClass!=g.bgClass||u.textClass!=g.textClass),I=0;!E&&I<o.length;++I)E=o[I]!=a.styles[I];E&&i.push(n.line),a.stateAfter=n.save(),n.nextLine()}else a.text.length<=e.options.maxHighlightLength&&pr(e,a.text,n),a.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return ni(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&rn(e,function(){for(var a=0;a<i.length;a++)Un(e,i[a],"text")})}var Ii=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Pi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=tr(e),this.force=r,this.dims=la(e),this.events=[]};Ii.prototype.signal=function(e,t){x(e,t)&&this.events.push(arguments)},Ii.prototype.finish=function(){for(var e=0;e<this.events.length;e++)se.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=xn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=xn(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=F();if(!t||!b(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&b(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ll(e){if(!e||!e.activeElt||e.activeElt==F())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&b(document.body,e.anchorNode)&&b(document.body,e.focusNode)){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function ma(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return Fn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&so(e)==0)return!1;wo(e)&&(Fn(e),t.dims=la(e));var i=n.first+n.size,a=Math.max(t.visible.from-e.options.viewportMargin,n.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<a&&a-r.viewFrom<20&&(a=Math.max(n.first,r.viewFrom)),r.viewTo>o&&r.viewTo-o<20&&(o=Math.min(i,r.viewTo)),hn&&(a=xt(e.doc,a),o=wt(e.doc,o));var s=a!=r.viewFrom||o!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Gs(e,a,o),r.viewOffset=_t(Je(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var l=so(e);if(!s&&l==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var u=sl(e);return l>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),l>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(u),ge(r.cursorDiv),ge(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,ni(e,400)),r.updateLineNumbers=null,!0}function yo(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==tr(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+ea(e.display)-ta(e),r.top)}),t.visible=Pi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Pi(e.display,e.doc,r));if(!ma(e,t))break;Ri(e);var i=ei(e);Zr(e),Sr(e,i),ba(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ga(e,t){var r=new Ii(e,t);if(ma(e,r)){Ri(e),yo(e,r);var n=ei(e);Zr(e),Sr(e,n),ba(e,n),r.finish()}}function ul(e,t,r){var n=e.display,i=e.options.lineNumbers,a=n.lineDiv,o=a.firstChild;function s(te){var fe=te.nextSibling;return C&&V&&e.display.currentWheelTarget==te?te.style.display="none":te.parentNode.removeChild(te),fe}for(var l=n.view,u=n.viewFrom,g=0;g<l.length;g++){var E=l[g];if(!E.hidden)if(!E.node||E.node.parentNode!=a){var I=Is(e,E,u,r);a.insertBefore(I,o)}else{for(;o!=E.node;)o=s(o);var A=i&&t!=null&&t<=u&&E.lineNumber;E.changes&&(Y(E.changes,"gutter")>-1&&(A=!1),za(e,E,u,r)),A&&(ge(E.lineNumber),E.lineNumber.appendChild(document.createTextNode($n(e.options,u)))),o=E.node.nextSibling}u+=E.size}for(;o;)o=s(o)}function va(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ba(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+xn(e)+"px"}function xo(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=ua(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=n+"px",o=0;o<r.length;o++)if(!r[o].hidden){e.options.fixedGutter&&(r[o].gutter&&(r[o].gutter.style.left=a),r[o].gutterBackground&&(r[o].gutterBackground.style.left=a));var s=r[o].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}function wo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=$n(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(v("div",[v("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,o=i.offsetWidth-a;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(a,n.lineGutter.offsetWidth-o)+1,n.lineNumWidth=n.lineNumInnerWidth+o,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",va(e.display),!0}return!1}function ya(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var a=e[i],o=null;if(typeof a!="string"&&(o=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:a,style:o})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function Eo(e){var t=e.gutters,r=e.gutterSpecs;ge(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],a=i.className,o=i.style,s=t.appendChild(v("div",null,"CodeMirror-gutter "+a));o&&(s.style.cssText=o),a=="CodeMirror-linenumbers"&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",va(e)}function ri(e){Eo(e.display),Zt(e),xo(e)}function cl(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=v("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=v("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=U("div",null,"CodeMirror-code"),i.selectionDiv=v("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=v("div",null,"CodeMirror-cursors"),i.measure=v("div",null,"CodeMirror-measure"),i.lineMeasure=v("div",null,"CodeMirror-measure"),i.lineSpace=U("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=U("div",[i.lineSpace],"CodeMirror-lines");i.mover=v("div",[a],null,"position: relative"),i.sizer=v("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=v("div",null,null,"position: absolute; height: "+Se+"px; width: 1px;"),i.gutters=v("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=v("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=v("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),O&&S<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!C&&!(H&&X)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=ya(n.gutters,n.lineNumbers),Eo(i),r.init(i)}var ji=0,sn=null;O?sn=-.53:H?sn=15:j?sn=-.7:le&&(sn=-1/3);function Co(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function dl(e){var t=Co(e);return t.x*=sn,t.y*=sn,t}function ko(e,t){var r=Co(t),n=r.x,i=r.y,a=e.display,o=a.scroller,s=o.scrollWidth>o.clientWidth,l=o.scrollHeight>o.clientHeight;if(!(n&&s||i&&l))return;if(i&&V&&C){e:for(var u=t.target,g=a.view;u!=o;u=u.parentNode)for(var E=0;E<g.length;E++)if(g[E].node==u){e.display.currentWheelTarget=u;break e}}if(n&&!H&&!G&&sn!=null){i&&l&&Qr(e,Math.max(0,o.scrollTop+i*sn)),ar(e,Math.max(0,o.scrollLeft+n*sn)),(!i||i&&l)&&d(t),a.wheelStartX=null;return}if(i&&sn!=null){var I=i*sn,A=e.doc.scrollTop,te=A+a.wrapper.clientHeight;I<0?A=Math.max(0,A+I-50):te=Math.min(e.doc.height,te+I+50),ga(e,{top:A,bottom:te})}ji<20&&(a.wheelStartX==null?(a.wheelStartX=o.scrollLeft,a.wheelStartY=o.scrollTop,a.wheelDX=n,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX==null)return;var fe=o.scrollLeft-a.wheelStartX,ke=o.scrollTop-a.wheelStartY,Re=ke&&a.wheelDY&&ke/a.wheelDY||fe&&a.wheelDX&&fe/a.wheelDX;if(a.wheelStartX=a.wheelStartY=null,!Re)return;sn=(sn*ji+Re)/(ji+1),++ji},200)):(a.wheelDX+=n,a.wheelDY+=i))}var ln=function(e,t){this.ranges=e,this.primIndex=t};ln.prototype.primary=function(){return this.ranges[this.primIndex]},ln.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!Me(r.anchor,n.anchor)||!Me(r.head,n.head))return!1}return!0},ln.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new vt(jr(this.ranges[t].anchor),jr(this.ranges[t].head));return new ln(e,this.primIndex)},ln.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ln.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(lt(t,n.from())>=0&&lt(e,n.to())<=0)return r}return-1};var vt=function(e,t){this.anchor=e,this.head=t};vt.prototype.from=function(){return Yn(this.anchor,this.head)},vt.prototype.to=function(){return hr(this.anchor,this.head)},vt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function vn(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(I,A){return lt(I.from(),A.from())}),r=Y(t,i);for(var a=1;a<t.length;a++){var o=t[a],s=t[a-1],l=lt(s.to(),o.from());if(n&&!o.empty()?l>0:l>=0){var u=Yn(s.from(),o.from()),g=hr(s.to(),o.to()),E=s.empty()?o.from()==o.head:s.from()==s.head;a<=r&&--r,t.splice(--a,2,new vt(E?g:u,E?u:g))}}return new ln(t,r)}function Wn(e,t){return new ln([new vt(e,t||e)],0)}function Bn(e){return e.text?xe(e.from.line+e.text.length-1,Oe(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function So(e,t){if(lt(e,t.from)<0)return e;if(lt(e,t.to)<=0)return Bn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Bn(t).ch-t.to.ch),xe(r,n)}function xa(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new vt(So(i.anchor,t),So(i.head,t)))}return vn(e.cm,r,e.sel.primIndex)}function _o(e,t,r){return e.line==t.line?xe(r.line,e.ch-t.ch+r.ch):xe(r.line+(e.line-t.line),e.ch)}function fl(e,t,r){for(var n=[],i=xe(e.first,0),a=i,o=0;o<t.length;o++){var s=t[o],l=_o(s.from,i,a),u=_o(Bn(s),i,a);if(i=s.to,a=u,r=="around"){var g=e.sel.ranges[o],E=lt(g.head,g.anchor)<0;n[o]=new vt(E?u:l,E?l:u)}else n[o]=new vt(l,l)}return new ln(n,e.sel.primIndex)}function wa(e){e.doc.mode=kn(e.options,e.doc.modeOption),ii(e)}function ii(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ni(e,100),e.state.modeGen++,e.curOp&&Zt(e)}function To(e,t){return t.from.ch==0&&t.to.ch==0&&Oe(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ea(e,t,r,n){function i(Ue){return r?r[Ue]:null}function a(Ue,Pe,Ke){Nn(Ue,Pe,Ke,n),zt(Ue,"change",Ue,t)}function o(Ue,Pe){for(var Ke=[],rt=Ue;rt<Pe;++rt)Ke.push(new kt(u[rt],i(rt),n));return Ke}var s=t.from,l=t.to,u=t.text,g=Je(e,s.line),E=Je(e,l.line),I=Oe(u),A=i(u.length-1),te=l.line-s.line;if(t.full)e.insert(0,o(0,u.length)),e.remove(u.length,e.size-u.length);else if(To(e,t)){var fe=o(0,u.length-1);a(E,E.text,A),te&&e.remove(s.line,te),fe.length&&e.insert(s.line,fe)}else if(g==E)if(u.length==1)a(g,g.text.slice(0,s.ch)+I+g.text.slice(l.ch),A);else{var ke=o(1,u.length-1);ke.push(new kt(I+g.text.slice(l.ch),A,n)),a(g,g.text.slice(0,s.ch)+u[0],i(0)),e.insert(s.line+1,ke)}else if(u.length==1)a(g,g.text.slice(0,s.ch)+u[0]+E.text.slice(l.ch),i(0)),e.remove(s.line+1,te);else{a(g,g.text.slice(0,s.ch)+u[0],i(0)),a(E,I+E.text.slice(l.ch),A);var Re=o(1,u.length-1);te>1&&e.remove(s.line+1,te-1),e.insert(s.line+1,Re)}zt(e,"change",e,t)}function zn(e,t,r){function n(i,a,o){if(i.linked)for(var s=0;s<i.linked.length;++s){var l=i.linked[s];if(l.doc==a)continue;var u=o&&l.sharedHist;if(r&&!u)continue;t(l.doc,u),n(l.doc,i,u)}}n(e,null,!0)}function Oo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ca(e),wa(e),Lo(e),e.options.lineWrapping||mn(e),e.options.mode=t.modeOption,Zt(e)}function Lo(e){(e.doc.direction=="rtl"?ae:Q)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){rn(e,function(){Lo(e),Zt(e)})}function Ui(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Ca(e,t){var r={from:jr(t.from),to:Bn(t),text:Sn(e,t.from,t.to)};return Do(e,r,t.from.line,t.to.line+1),zn(e,function(n){return Do(n,r,t.from.line,t.to.line+1)},!0),r}function Mo(e){for(;e.length;){var t=Oe(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Mo(e.done),Oe(e.done);if(e.done.length&&!Oe(e.done).ranges)return Oe(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Oe(e.done)}function Ao(e,t,r,n){var i=e.history;i.undone.length=0;var a=+new Date,o,s;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(o=pl(i,i.lastOp==n)))s=Oe(o.changes),lt(t.from,t.to)==0&&lt(t.from,s.to)==0?s.to=Bn(t):o.changes.push(Ca(e,t));else{var l=Oe(i.done);for((!l||!l.ranges)&&Fi(e.sel,i.done),o={changes:[Ca(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||se(e,"historyAdded")}function ml(e,t,r,n){var i=t.charAt(0);return i=="*"||i=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var i=e.history,a=n&&n.origin;r==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||ml(e,a,Oe(i.done),t))?i.done[i.done.length-1]=t:Fi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=r,n&&n.clearRedo!==!1&&Mo(i.undone)}function Fi(e,t){var r=Oe(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Do(e,t,r,n){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(o){o.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=o.markedSpans),++a})}function vl(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function bl(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(vl(r[i]));return n}function Ro(e,t){var r=bl(e,t),n=Pn(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var a=r[i],o=n[i];if(a&&o){e:for(var s=0;s<o.length;++s){for(var l=o[s],u=0;u<a.length;++u)if(a[u].marker==l.marker)continue e;a.push(l)}}else o&&(r[i]=o)}return r}function _r(e,t,r){for(var n=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){n.push(r?ln.prototype.deepCopy.call(a):a);continue}var o=a.changes,s=[];n.push({changes:s});for(var l=0;l<o.length;++l){var u=o[l],g=void 0;if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var E in u)(g=E.match(/^spans_(\d+)$/))&&(Y(t,Number(g[1]))>-1&&(Oe(s)[E]=u[E],delete u[E]))}}return n}function ka(e,t,r,n){if(n){var i=e.anchor;if(r){var a=lt(t,i)<0;a!=lt(r,i)<0?(i=t,t=r):a!=lt(t,r)<0&&(t=r)}return new vt(i,t)}else return new vt(r||t,t)}function Wi(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),Gt(e,new ln([ka(e.sel.primary(),t,r,i)],0),n)}function Po(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)n[a]=ka(e.sel.ranges[a],t[a],null,i);var o=vn(e.cm,n,e.sel.primIndex);Gt(e,o,r)}function Sa(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,Gt(e,vn(e.cm,i,e.sel.primIndex),n)}function No(e,t,r,n){Gt(e,Wn(t,r),n)}function yl(e,t,r){var n={ranges:t.ranges,update:function(i){this.ranges=[];for(var a=0;a<i.length;a++)this.ranges[a]=new vt(ot(e,i[a].anchor),ot(e,i[a].head))},origin:r&&r.origin};return se(e,"beforeSelectionChange",e,n),e.cm&&se(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?vn(e.cm,n.ranges,n.ranges.length-1):t}function Io(e,t,r){var n=e.history.done,i=Oe(n);i&&i.ranges?(n[n.length-1]=t,Bi(e,t,r)):Gt(e,t,r)}function Gt(e,t,r){Bi(e,t,r),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Bi(e,t,r){(x(e,"beforeSelectionChange")||e.cm&&x(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,r));var n=r&&r.bias||(lt(t.primary().head,e.sel.primary().head)<0?-1:1);jo(e,Fo(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&kr(e.cm)}function jo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,y(e.cm)),zt(e,"cursorActivity",e)}function Uo(e){jo(e,Fo(e,e.sel,null,!1))}function Fo(e,t,r,n){for(var i,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],l=zi(e,o.anchor,s&&s.anchor,r,n),u=zi(e,o.head,s&&s.head,r,n);(i||l!=o.anchor||u!=o.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new vt(l,u))}return i?vn(e.cm,i,t.primIndex):t}function Tr(e,t,r,n,i){var a=Je(e,t.line);if(a.markedSpans)for(var o=0;o<a.markedSpans.length;++o){var s=a.markedSpans[o],l=s.marker,u="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,g="selectRight"in l?!l.selectRight:l.inclusiveRight;if((s.from==null||(u?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(g?s.to>=t.ch:s.to>t.ch))){if(i&&(se(l,"beforeCursorEnter"),l.explicitlyCleared))if(a.markedSpans){--o;continue}else break;if(!l.atomic)continue;if(r){var E=l.find(n<0?1:-1),I=void 0;if((n<0?g:u)&&(E=Wo(e,E,-n,E&&E.line==t.line?a:null)),E&&E.line==t.line&&(I=lt(E,r))&&(n<0?I<0:I>0))return Tr(e,E,t,n,i)}var A=l.find(n<0?-1:1);return(n<0?u:g)&&(A=Wo(e,A,n,A.line==t.line?a:null)),A?Tr(e,A,t,n,i):null}}return t}function zi(e,t,r,n,i){var a=n||1,o=Tr(e,t,r,a,i)||!i&&Tr(e,t,r,a,!0)||Tr(e,t,r,-a,i)||!i&&Tr(e,t,r,-a,!0);return o||(e.cantEdit=!0,xe(e.first,0))}function Wo(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?ot(e,xe(t.line-1)):null:r>0&&t.ch==(n||Je(e,t.line)).text.length?t.line<e.first+e.size-1?xe(t.line+1,0):null:new xe(t.line,t.ch+r)}function Bo(e){e.setSelection(xe(e.firstLine(),0),xe(e.lastLine()),de)}function zo(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(i,a,o,s){i&&(n.from=ot(e,i)),a&&(n.to=ot(e,a)),o&&(n.text=o),s!==void 0&&(n.origin=s)}),se(e,"beforeChange",e,n),e.cm&&se(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function Or(e,t,r){if(e.cm){if(!e.cm.curOp)return It(e.cm,Or)(e,t,r);if(e.cm.state.suppressEdits)return}if((x(e,"beforeChange")||e.cm&&x(e.cm,"beforeChange"))&&(t=zo(e,t,!0),!t))return;var n=Ei&&!r&&Si(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Ho(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Ho(e,t)}function Ho(e,t){if(t.text.length==1&&t.text[0]==""&&lt(t.from,t.to)==0)return;var r=xa(e,t);Ao(e,t,r,e.cm?e.cm.curOp.id:NaN),ai(e,t,r,Pn(e,t));var n=[];zn(e,function(i,a){!a&&Y(n,i.history)==-1&&(Vo(i.history,t),n.push(i.history)),ai(i,t,null,Pn(i,t))})}function Hi(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var i=e.history,a,o=e.sel,s=t=="undo"?i.done:i.undone,l=t=="undo"?i.undone:i.done,u=0;u<s.length&&!(a=s[u],r?a.ranges&&!a.equals(e.sel):!a.ranges);u++);if(u==s.length)return;for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Fi(a,l),r&&!a.equals(e.sel)){Gt(e,a,{clearRedo:!1});return}o=a}else if(n){s.push(a);return}else break;var g=[];Fi(o,l),l.push({changes:g,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var E=x(e,"beforeChange")||e.cm&&x(e.cm,"beforeChange"),I=function(fe){var ke=a.changes[fe];if(ke.origin=t,E&&!zo(e,ke,!1))return s.length=0,{};g.push(Ca(e,ke));var Re=fe?xa(e,ke):Oe(s);ai(e,ke,Re,Ro(e,ke)),!fe&&e.cm&&e.cm.scrollIntoView({from:ke.from,to:Bn(ke)});var Ue=[];zn(e,function(Pe,Ke){!Ke&&Y(Ue,Pe.history)==-1&&(Vo(Pe.history,ke),Ue.push(Pe.history)),ai(Pe,ke,null,Ro(Pe,ke))})},A=a.changes.length-1;A>=0;--A){var te=I(A);if(te)return te.v}}function Ko(e,t){if(t==0)return;if(e.first+=t,e.sel=new ln(We(e.sel.ranges,function(i){return new vt(xe(i.anchor.line+t,i.anchor.ch),xe(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm){Zt(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Un(e.cm,n,"gutter")}}function ai(e,t,r,n){if(e.cm&&!e.cm.curOp)return It(e.cm,ai)(e,t,r,n);if(t.to.line<e.first){Ko(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Ko(e,i),t={from:xe(e.first,0),to:xe(t.to.line+i,t.to.ch),text:[Oe(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:xe(a,Je(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Sn(e,t.from,t.to),r||(r=xa(e,t)),e.cm?xl(e.cm,t,n):Ea(e,t,n),Bi(e,r,de),e.cantEdit&&zi(e,xe(e.firstLine(),0))&&(e.cantEdit=!1)}function xl(e,t,r){var n=e.doc,i=e.display,a=t.from,o=t.to,s=!1,l=a.line;e.options.lineWrapping||(l=gt(Qe(Je(n,a.line))),n.iter(l,o.line+1,function(A){if(A==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&y(e),Ea(n,t,r,oo(e)),e.options.lineWrapping||(n.iter(l,a.line+t.text.length,function(A){var te=Kt(A);te>i.maxLineLength&&(i.maxLine=A,i.maxLineLength=te,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),Br(n,a.line),ni(e,400);var u=t.text.length-(o.line-a.line)-1;t.full?Zt(e):a.line==o.line&&t.text.length==1&&!To(e.doc,t)?Un(e,a.line,"text"):Zt(e,a.line,o.line+1,u);var g=x(e,"changes"),E=x(e,"change");if(E||g){var I={from:a,to:o,text:t.text,removed:t.removed,origin:t.origin};E&&zt(e,"change",e,I),g&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(I)}e.display.selForContextMenu=null}function Lr(e,t,r,n,i){var a;n||(n=r),lt(n,r)<0&&(a=[n,r],r=a[0],n=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Or(e,{from:r,to:n,text:t,origin:i})}function Xo(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function Go(e,t,r,n){for(var i=0;i<e.length;++i){var a=e[i],o=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)Xo(a.ranges[s].anchor,t,r,n),Xo(a.ranges[s].head,t,r,n);continue}for(var l=0;l<a.changes.length;++l){var u=a.changes[l];if(r<u.from.line)u.from=xe(u.from.line+n,u.from.ch),u.to=xe(u.to.line+n,u.to.ch);else if(t<=u.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function Vo(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;Go(e.done,r,n,i),Go(e.undone,r,n,i)}function oi(e,t,r,n){var i=t,a=t;return typeof t=="number"?a=Je(e,Jn(e,t)):i=gt(t),i==null?null:(n(a,i)&&e.cm&&Un(e.cm,i,r),a)}function si(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}si.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,Xt(i),zt(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function li(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}li.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var a=Math.min(t,i-e),o=n.height;if(n.removeInner(e,a),this.height-=o-n.height,i==a&&(this.children.splice(r--,1),n.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof si))){var s=[];this.collapse(s),this.children=[new si(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var o=i.lines.length%25+25,s=o;s<i.lines.length;){var l=new si(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++n,0,l),l.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new li(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=Y(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new li(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],a=i.chunkSize();if(e<a){var o=Math.min(t,a-e);if(i.iterN(e,o,r))return!0;if((t-=o)==0)break;e=0}else e-=a}}};var ui=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};ui.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=gt(r);if(n==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var a=Yr(this);dn(r,Math.max(0,r.height-a)),e&&(rn(e,function(){$o(e,r,-a),Un(e,n,"widget")}),zt(e,"lineWidgetCleared",e,this,n))},ui.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Yr(this)-t;if(!i)return;Ct(this.doc,n)||dn(n,n.height+i),r&&rn(r,function(){r.curOp.forceUpdate=!0,$o(r,n,i),zt(r,"lineWidgetChanged",r,e,gt(n))})},k(ui);function $o(e,t,r){_t(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&pa(e,r)}function wl(e,t,r,n){var i=new ui(e,r,n),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),oi(e,t,"widget",function(o){var s=o.widgets||(o.widgets=[]);if(i.insertAt==null?s.push(i):s.splice(Math.min(s.length-1,Math.max(0,i.insertAt)),0,i),i.line=o,a&&!Ct(e,o)){var l=_t(o)<e.scrollTop;dn(o,o.height+Yr(i)),l&&pa(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&zt(a,"lineWidgetAdded",a,i,typeof t=="number"?t:gt(t)),i}var Yo=0,Hn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Yo};Hn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&sr(e),x(this,"clear")){var r=this.find();r&&zt(this,"clear",r.from,r.to)}for(var n=null,i=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Rn(o.markedSpans,this);e&&!this.collapsed?Un(e,gt(o),"text"):e&&(s.to!=null&&(i=gt(o)),s.from!=null&&(n=gt(o))),o.markedSpans=ja(o.markedSpans,s),s.from==null&&this.collapsed&&!Ct(this.doc,o)&&e&&dn(o,wr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var u=Qe(this.lines[l]),g=Kt(u);g>e.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=g,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Zt(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Uo(e.doc)),e&&zt(e,"markerCleared",e,this,n,i),t&&lr(e),this.parent&&this.parent.clear()},Hn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var a=this.lines[i],o=Rn(a.markedSpans,this);if(o.from!=null&&(r=xe(t?a:gt(a),o.from),e==-1))return r;if(o.to!=null&&(n=xe(t?a:gt(a),o.to),e==1))return n}return r&&{from:r,to:n}},Hn.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;if(!t||!n)return;rn(n,function(){var i=t.line,a=gt(t.line),o=na(n,a);if(o&&(qa(o),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ct(r.doc,i)&&r.height!=null){var s=r.height;r.height=null;var l=Yr(r)-s;l&&dn(i,i.height+l)}zt(n,"markerChanged",n,e)})},Hn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Y(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Hn.prototype.detachLine=function(e){if(this.lines.splice(Y(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},k(Hn);function Mr(e,t,r,n,i){if(n&&n.shared)return El(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return It(e.cm,Mr)(e,t,r,n,i);var a=new Hn(e,i),o=lt(t,r);if(n&&c(n,a,!1),o>0||o==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=U("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(qi(e,t.line,t,r,a)||t.line!=r.line&&qi(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");ki()}a.addToHistory&&Ao(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s=t.line,l=e.cm,u;if(e.iter(s,r.line+1,function(E){l&&a.collapsed&&!l.options.lineWrapping&&Qe(E)==l.display.maxLine&&(u=!0),a.collapsed&&s!=t.line&&dn(E,0),zr(E,new gr(a,s==t.line?t.ch:null,s==r.line?r.ch:null)),++s}),a.collapsed&&e.iter(t.line,r.line+1,function(E){Ct(e,E)&&dn(E,0)}),a.clearOnEnter&&re(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(Ci(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Yo,a.atomic=!0),l){if(u&&(l.curOp.updateMaxLine=!0),a.collapsed)Zt(l,t.line,r.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var g=t.line;g<=r.line;g++)Un(l,g,"text");a.atomic&&Uo(l.doc),zt(l,"markerAdded",l,a)}return a}var ci=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};ci.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();zt(this,"clear")},ci.prototype.find=function(e,t){return this.primary.find(e,t)},k(ci);function El(e,t,r,n,i){n=c(n),n.shared=!1;var a=[Mr(e,t,r,n,i)],o=a[0],s=n.widgetNode;return zn(e,function(l){s&&(n.widgetNode=s.cloneNode(!0)),a.push(Mr(l,ot(l,t),ot(l,r),n,i));for(var u=0;u<l.linked.length;++u)if(l.linked[u].isParent)return;o=Oe(a)}),new ci(a,o)}function Jo(e){return e.findMarks(xe(e.first,0),e.clipPos(xe(e.lastLine())),function(t){return t.parent})}function Cl(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),a=e.clipPos(i.from),o=e.clipPos(i.to);if(lt(a,o)){var s=Mr(e,a,o,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function kl(e){for(var t=function(n){var i=e[n],a=[i.primary.doc];zn(i.primary.doc,function(l){return a.push(l)});for(var o=0;o<i.markers.length;o++){var s=i.markers[o];Y(a,s.doc)==-1&&(s.parent=null,i.markers.splice(o--,1))}},r=0;r<e.length;r++)t(r)}var Sl=0,qt=function(e,t,r,n,i){if(!(this instanceof qt))return new qt(e,t,r,n,i);r==null&&(r=0),li.call(this,[new si([new kt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=xe(r,0);this.sel=Wn(a),this.history=new Ui(null),this.id=++Sl,this.modeOption=t,this.lineSep=n,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ea(this,{from:a,to:a,text:e}),Gt(this,Wn(a),de)};qt.prototype=Be(li.prototype,{constructor:qt,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=fr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:jt(function(e){var t=xe(this.first,0),r=this.first+this.size-1;Or(this,{from:t,to:xe(r,Je(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&qr(this.cm,0,0),Gt(this,Wn(t),de)}),replaceRange:function(e,t,r,n){t=ot(this,t),r=r?ot(this,r):t,Lr(this,e,t,r,n)},getRange:function(e,t,r){var n=Sn(this,ot(this,e),ot(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Dn(this,e))return Je(this,e)},getLineNumber:function(e){return gt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Je(this,e)),Qe(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ot(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:jt(function(e,t,r){No(this,ot(this,typeof e=="number"?xe(e,t||0):e),null,r)}),setSelection:jt(function(e,t,r){No(this,ot(this,e),ot(this,t||e),r)}),extendSelection:jt(function(e,t,r){Wi(this,ot(this,e),t&&ot(this,t),r)}),extendSelections:jt(function(e,t){Po(this,Ur(this,e),t)}),extendSelectionsBy:jt(function(e,t){var r=We(this.sel.ranges,e);Po(this,Ur(this,r),t)}),setSelections:jt(function(e,t,r){if(!e.length)return;for(var n=[],i=0;i<e.length;i++)n[i]=new vt(ot(this,e[i].anchor),ot(this,e[i].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Gt(this,vn(this.cm,n,t),r)}),addSelection:jt(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new vt(ot(this,e),ot(this,t||e))),Gt(this,vn(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var i=Sn(this,t[n].from(),t[n].to());r=r?r.concat(i):i}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=Sn(this,r[n].from(),r[n].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:jt(function(e,t,r){for(var n=[],i=this.sel,a=0;a<i.ranges.length;a++){var o=i.ranges[a];n[a]={from:o.from(),to:o.to(),text:this.splitLines(e[a]),origin:r}}for(var s=t&&t!="end"&&fl(this,n,t),l=n.length-1;l>=0;l--)Or(this,n[l]);s?Io(this,s):this.cm&&kr(this.cm)}),undo:jt(function(){Hi(this,"undo")}),redo:jt(function(){Hi(this,"redo")}),undoSelection:jt(function(){Hi(this,"undo",!0)}),redoSelection:jt(function(){Hi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new Ui(this.history.maxGeneration),zn(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:_r(this.history.done),undone:_r(this.history.undone)}},setHistory:function(e){var t=this.history=new Ui(this.history.maxGeneration);t.done=_r(e.done.slice(0),null,!0),t.undone=_r(e.undone.slice(0),null,!0)},setGutterMarker:jt(function(e,t,r){return oi(this,e,"gutter",function(n){var i=n.gutterMarkers||(n.gutterMarkers={});return i[t]=r,!r&&Ne(i)&&(n.gutterMarkers=null),!0})}),clearGutter:jt(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&oi(t,r,"gutter",function(){return r.gutterMarkers[e]=null,Ne(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Dn(this,e))return null;if(t=e,e=Je(this,e),!e)return null}else if(t=gt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:jt(function(e,t,r){return oi(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[i])n[i]=r;else{if(q(r).test(n[i]))return!1;n[i]+=" "+r}return!0})}),removeLineClass:jt(function(e,t,r){return oi(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=n[i];if(a)if(r==null)n[i]=null;else{var o=a.match(q(r));if(!o)return!1;var s=o.index+o[0].length;n[i]=a.slice(0,o.index)+(!o.index||s==a.length?"":" ")+a.slice(s)||null}else return!1;return!0})}),addLineWidget:jt(function(e,t,r){return wl(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return Mr(this,ot(this,e),ot(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ot(this,e),Mr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=ot(this,e);var t=[],r=Je(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=ot(this,e),t=ot(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var l=o[s];!(l.to!=null&&i==e.line&&e.ch>=l.to||l.from==null&&i!=e.line||l.from!=null&&i==t.line&&l.from>=t.ch)&&(!r||r(l.marker))&&n.push(l.marker.parent||l.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+n;if(a>e)return t=e,!0;e-=a,++r}),ot(this,xe(r,t))},indexFromPos:function(e){e=ot(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new qt(fr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new qt(fr(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cl(n,Jo(this)),n},unlinkDoc:function(e){if(e instanceof Tt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),kl(Jo(this));break}if(e.history==this.history){var n=[e.id];zn(e,function(i){return n.push(i.id)},!0),e.history=new Ui(null),e.history.done=_r(this.history.done,n),e.history.undone=_r(this.history.undone,n)}},iterLinkedDocs:function(e){zn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):pt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:jt(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),qt.prototype.eachLine=qt.prototype.iter;var Zo=0;function _l(e){var t=this;if(qo(t),Te(t,e)||Ln(t.display,e))return;d(e),O&&(Zo=+new Date);var r=rr(t,e,!0),n=e.dataTransfer.files;if(!r||t.isReadOnly())return;if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,a=Array(i),o=0,s=function(){++o==i&&It(t,function(){r=ot(t.doc,r);var A={from:r,to:r,text:t.doc.splitLines(a.filter(function(te){return te!=null}).join(t.doc.lineSeparator())),origin:"paste"};Or(t.doc,A),Io(t.doc,Wn(ot(t.doc,r),ot(t.doc,Bn(A))))})()},l=function(A,te){if(t.options.allowDropFileTypes&&Y(t.options.allowDropFileTypes,A.type)==-1){s();return}var fe=new FileReader;fe.onerror=function(){return s()},fe.onload=function(){var ke=fe.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ke)){s();return}a[te]=ke,s()},fe.readAsText(A)},u=0;u<n.length;u++)l(n[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var g=e.dataTransfer.getData("Text");if(g){var E;if(t.state.draggingText&&!t.state.draggingText.copy&&(E=t.listSelections()),Bi(t.doc,Wn(r,r)),E)for(var I=0;I<E.length;++I)Lr(t.doc,"",E[I].anchor,E[I].head,"drag");t.replaceSelection(g,"around","paste"),t.display.input.focus()}}catch(A){}}}function Tl(e,t){if(O&&(!e.state.draggingText||+new Date-Zo<100)){p(t);return}if(Te(e,t)||Ln(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!le){var r=v("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",G&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),G&&r.parentNode.removeChild(r)}}function Ol(e,t){var r=rr(e,t);if(!r)return;var n=document.createDocumentFragment();uo(e,r,n),e.display.dragCursor||(e.display.dragCursor=v("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),J(e.display.dragCursor,n)}function qo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Qo(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var a=0;a<r.length;a++)e(r[a])})}var es=!1;function Ll(){if(es)return;Ml(),es=!0}function Ml(){var e;re(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Qo(Al)},100))}),re(window,"blur",function(){return Qo(Cr)})}function Al(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Kn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},di=0;di<10;di++)Kn[di+48]=Kn[di+96]=String(di);for(var Ki=65;Ki<=90;Ki++)Kn[Ki]=String.fromCharCode(Ki);for(var fi=1;fi<=12;fi++)Kn[fi+111]=Kn[fi+63235]="F"+fi;var Mn={};Mn.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Mn.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Mn.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Mn.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Mn.default=V?Mn.macDefault:Mn.pcDefault;function Dl(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,a,o=0;o<t.length-1;o++){var s=t[o];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Rl(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var i=We(r.split(" "),Dl),a=0;a<i.length;a++){var o=void 0,s=void 0;a==i.length-1?(s=i.join(" "),o=n):(s=i.slice(0,a+1).join(" "),o="...");var l=t[s];if(!l)t[s]=o;else if(l!=o)throw new Error("Inconsistent bindings for "+s)}delete e[r]}for(var u in t)e[u]=t[u];return e}function Ar(e,t,r,n){t=Xi(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&r(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Ar(e,t.fallthrough,r,n);for(var a=0;a<t.fallthrough.length;a++){var o=Ar(e,t.fallthrough[a],r,n);if(o)return o}}}function ts(e){var t=typeof e=="string"?e:Kn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ns(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(ne?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(ne?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function rs(e,t){if(G&&e.keyCode==34&&e.char)return!1;var r=Kn[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),ns(r,e,t))}function Xi(e){return typeof e=="string"?Mn[e]:e}function Dr(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var a=t(r[i]);n.length&&lt(a.from,Oe(n).to)<=0;){var o=n.pop();if(lt(o.from,a.from)<0){a.from=o.from;break}}n.push(a)}rn(e,function(){for(var s=n.length-1;s>=0;s--)Lr(e.doc,"",n[s].from,n[s].to,"+delete");kr(e)})}function _a(e,t,r){var n=ye(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Ta(e,t,r){var n=_a(e,t.ch,r);return n==null?null:new xe(t.line,n,r<0?"after":"before")}function Oa(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=qe(r,t.doc.direction);if(a){var o=i<0?Oe(a):a[0],s=i<0==(o.level==1),l=s?"after":"before",u;if(o.level>0||t.doc.direction=="rtl"){var g=xr(t,r);u=i<0?r.text.length-1:0;var E=wn(t,g,u).top;u=ze(function(I){return wn(t,g,I).top==E},i<0==(o.level==1)?o.from:o.to-1,u),l=="before"&&(u=_a(r,u,1))}else u=i<0?o.to:o.from;return new xe(n,u,l)}}return new xe(n,i<0?r.text.length:0,i<0?"before":"after")}function Pl(e,t,r,n){var i=qe(t,e.doc.direction);if(!i)return Ta(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var a=Fe(i,r.ch,r.sticky),o=i[a];if(e.doc.direction=="ltr"&&o.level%2==0&&(n>0?o.to>r.ch:o.from<r.ch))return Ta(t,r,n);var s=function(Re,Ue){return _a(t,Re instanceof xe?Re.ch:Re,Ue)},l,u=function(Re){return e.options.lineWrapping?(l=l||xr(e,t),ao(e,t,l,Re)):{begin:0,end:t.text.length}},g=u(r.sticky=="before"?s(r,-1):r.ch);if(e.doc.direction=="rtl"||o.level==1){var E=o.level==1==n<0,I=s(r,E?1:-1);if(I!=null&&(E?I<=o.to&&I<=g.end:I>=o.from&&I>=g.begin)){var A=E?"before":"after";return new xe(r.line,I,A)}}var te=function(Re,Ue,Pe){for(var Ke=function(Et,Ut){return Ut?new xe(r.line,s(Et,1),"before"):new xe(r.line,Et,"after")};Re>=0&&Re<i.length;Re+=Ue){var rt=i[Re],et=Ue>0==(rt.level!=1),ft=et?Pe.begin:s(Pe.end,-1);if(rt.from<=ft&&ft<rt.to)return Ke(ft,et);if(ft=et?rt.from:s(rt.to,-1),Pe.begin<=ft&&ft<Pe.end)return Ke(ft,et)}},fe=te(a+n,n,g);if(fe)return fe;var ke=n>0?g.end:s(g.begin,-1);return ke!=null&&!(n>0&&ke==t.text.length)&&(fe=te(n>0?0:i.length-1,n,u(ke)),fe)?fe:null}var hi={selectAll:Bo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),de)},killLine:function(e){return Dr(e,function(t){if(t.empty()){var r=Je(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:xe(t.head.line+1,0)}:{from:t.head,to:xe(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Dr(e,function(t){return{from:xe(t.from().line,0),to:ot(e.doc,xe(t.to().line+1,0))}})},delLineLeft:function(e){return Dr(e,function(t){return{from:xe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Dr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Dr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(xe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(xe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return is(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return as(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Nl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?as(e,t.head):n},ce)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var a=r[i].from(),o=_(e.getLine(a.line),a.ch,n);t.push(z(n-o%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return rn(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++){if(!t[n].empty())continue;var i=t[n].head,a=Je(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new xe(i.line,i.ch-1)),i.ch>0)i=new xe(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),xe(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=Je(e.doc,i.line-1).text;o&&(i=new xe(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),xe(i.line-1,o.length-1),i,"+transpose"))}}r.push(new vt(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return rn(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);kr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function is(e,t){var r=Je(e.doc,t),n=Qe(r);return n!=r&&(t=gt(n)),Oa(!0,e,n,t,1)}function Nl(e,t){var r=Je(e.doc,t),n=ut(r);return n!=r&&(t=gt(n)),Oa(!0,e,r,t,-1)}function as(e,t){var r=is(e,t.line),n=Je(e.doc,r.line),i=qe(n,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(r.ch,n.text.search(/\S/)),o=t.line==r.line&&t.ch<=a&&t.ch;return xe(r.line,o?0:a,r.sticky)}return r}function Gi(e,t,r){if(typeof t=="string"&&(t=hi[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=je}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function Il(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Ar(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Ar(t,e.options.extraKeys,r,e)||Ar(t,e.options.keyMap,r,e)}var jl=new Z;function pi(e,t,r,n){var i=e.state.keySeq;if(i){if(ts(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:jl.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),os(e,i+" "+t,r,n))return!0}return os(e,t,r,n)}function os(e,t,r,n){var i=Il(e,t,n);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&zt(e,"keyHandled",e,t,r),(i=="handled"||i=="multi")&&(d(r),da(e)),!!i}function ss(e,t){var r=rs(t,!0);return r?t.shiftKey&&!e.state.keySeq?pi(e,"Shift-"+r,t,function(n){return Gi(e,n,!0)})||pi(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Gi(e,n)}):pi(e,r,t,function(n){return Gi(e,n)}):!1}function Ul(e,t,r){return pi(e,"'"+r+"'",t,function(n){return Gi(e,n,!0)})}var La=null;function ls(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=F(),Te(t,e))return;O&&S<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=ss(t,e);G&&(La=n?r:null,!n&&r==88&&!Wt&&(V?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),H&&!V&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Fl(t)}function Fl(e){var t=e.display.lineDiv;ae(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(Q(t,"CodeMirror-crosshair"),Xe(document,"keyup",r),Xe(document,"mouseover",r))}re(document,"keyup",r),re(document,"mouseover",r)}function us(e){e.keyCode==16&&(this.doc.sel.shift=!1),Te(this,e)}function cs(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Ln(t.display,e)||Te(t,e)||e.ctrlKey&&!e.altKey||V&&e.metaKey)return;var r=e.keyCode,n=e.charCode;if(G&&r==La){La=null,d(e);return}if(G&&(!e.which||e.which<10)&&ss(t,e))return;var i=String.fromCharCode(n==null?r:n);if(i=="\b")return;if(Ul(t,e,i))return;t.display.input.onKeyPress(e)}var Wl=400,Ma=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ma.prototype.compare=function(e,t,r){return this.time+Wl>e&&lt(t,this.pos)==0&&r==this.button};var mi,gi;function Bl(e,t){var r=+new Date;return gi&&gi.compare(r,e,t)?(mi=gi=null,"triple"):mi&&mi.compare(r,e,t)?(gi=new Ma(r,e,t),mi=null,"double"):(mi=new Ma(r,e,t),gi=null,"single")}function ds(e){var t=this,r=t.display;if(Te(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,Ln(r,e)){C||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Aa(t,e))return;var n=rr(t,e),i=K(e),a=n?Bl(n,i):"single";if(window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),n&&zl(t,i,n,a,e))return;i==1?n?Kl(t,n,a,e):N(e)==r.scroller&&d(e):i==2?(n&&Wi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(_e?t.display.input.onContextMenu(e):fo(t))}function zl(e,t,r,n,i){var a="Click";return n=="double"?a="Double"+a:n=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,pi(e,ns(a,i),i,function(o){if(typeof o=="string"&&(o=hi[o]),!o)return!1;var s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=o(e,r)!=je}finally{e.state.suppressEdits=!1}return s})}function Hl(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var a=be?r.shiftKey&&r.metaKey:r.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=V?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(V?r.altKey:r.ctrlKey)),i}function Kl(e,t,r,n){O?setTimeout(m(co,e),0):e.curOp.focus=F();var i=Hl(e,r,n),a=e.doc.sel,o;e.options.dragDrop&&pe&&!e.isReadOnly()&&r=="single"&&(o=a.contains(t))>-1&&(lt((o=a.ranges[o]).from(),t)<0||t.xRel>0)&&(lt(o.to(),t)>0||t.xRel<0)?Xl(e,n,t,i):Gl(e,n,t,i)}function Xl(e,t,r,n){var i=e.display,a=!1,o=It(e,function(u){C&&(i.scroller.draggable=!1),e.state.draggingText=!1,Xe(i.wrapper.ownerDocument,"mouseup",o),Xe(i.wrapper.ownerDocument,"mousemove",s),Xe(i.scroller,"dragstart",l),Xe(i.scroller,"drop",o),a||(d(u),n.addNew||Wi(e.doc,r,null,null,n.extend),C&&!le||O&&S==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),s=function(u){a=a||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},l=function(){return a=!0};C&&(i.scroller.draggable=!0),e.state.draggingText=o,o.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),re(i.wrapper.ownerDocument,"mouseup",o),re(i.wrapper.ownerDocument,"mousemove",s),re(i.scroller,"dragstart",l),re(i.scroller,"drop",o),fo(e),setTimeout(function(){return i.input.focus()},20)}function fs(e,t,r){if(r=="char")return new vt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new vt(xe(t.line,0),ot(e.doc,xe(t.line+1,0)));var n=r(e,t);return new vt(n.from,n.to)}function Gl(e,t,r,n){var i=e.display,a=e.doc;d(t);var o,s,l=a.sel,u=l.ranges;if(n.addNew&&!n.extend?(s=a.sel.contains(r),s>-1?o=u[s]:o=new vt(r,r)):(o=a.sel.primary(),s=a.sel.primIndex),n.unit=="rectangle")n.addNew||(o=new vt(r,r)),r=rr(e,t,!0,!0),s=-1;else{var g=fs(e,r,n.unit);n.extend?o=ka(o,g.anchor,g.head,n.extend):o=g}n.addNew?s==-1?(s=u.length,Gt(a,vn(e,u.concat([o]),s),{scroll:!1,origin:"*mouse"})):u.length>1&&u[s].empty()&&n.unit=="char"&&!n.extend?(Gt(a,vn(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=a.sel):Sa(a,s,o,Le):(s=0,Gt(a,new ln([o],0),Le),l=a.sel);var E=r;function I(Pe){if(lt(E,Pe)==0)return;if(E=Pe,n.unit=="rectangle"){for(var Ke=[],rt=e.options.tabSize,et=_(Je(a,r.line).text,r.ch,rt),ft=_(Je(a,Pe.line).text,Pe.ch,rt),Et=Math.min(et,ft),Ut=Math.max(et,ft),Ot=Math.min(r.line,Pe.line),an=Math.min(e.lastLine(),Math.max(r.line,Pe.line));Ot<=an;Ot++){var Qt=Je(a,Ot).text,Dt=me(Qt,Et,rt);Et==Ut?Ke.push(new vt(xe(Ot,Dt),xe(Ot,Dt))):Qt.length>Dt&&Ke.push(new vt(xe(Ot,Dt),xe(Ot,me(Qt,Ut,rt))))}Ke.length||Ke.push(new vt(r,r)),Gt(a,vn(e,l.ranges.slice(0,s).concat(Ke),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Pe)}else{var en=o,Ht=fs(e,Pe,n.unit),Nt=en.anchor,Rt;lt(Ht.anchor,Nt)>0?(Rt=Ht.head,Nt=Yn(en.from(),Ht.anchor)):(Rt=Ht.anchor,Nt=hr(en.to(),Ht.head));var Lt=l.ranges.slice(0);Lt[s]=Vl(e,new vt(ot(a,Nt),Rt)),Gt(a,vn(e,Lt,s),Le)}}var A=i.wrapper.getBoundingClientRect(),te=0;function fe(Pe){var Ke=++te,rt=rr(e,Pe,!0,n.unit=="rectangle");if(!rt)return;if(lt(rt,E)!=0){e.curOp.focus=F(),I(rt);var et=Pi(i,a);(rt.line>=et.to||rt.line<et.from)&&setTimeout(It(e,function(){te==Ke&&fe(Pe)}),150)}else{var ft=Pe.clientY<A.top?-20:Pe.clientY>A.bottom?20:0;ft&&setTimeout(It(e,function(){if(te!=Ke)return;i.scroller.scrollTop+=ft,fe(Pe)}),50)}}function ke(Pe){e.state.selectingText=!1,te=Infinity,Pe&&(d(Pe),i.input.focus()),Xe(i.wrapper.ownerDocument,"mousemove",Re),Xe(i.wrapper.ownerDocument,"mouseup",Ue),a.history.lastSelOrigin=null}var Re=It(e,function(Pe){Pe.buttons===0||!K(Pe)?ke(Pe):fe(Pe)}),Ue=It(e,ke);e.state.selectingText=Ue,re(i.wrapper.ownerDocument,"mousemove",Re),re(i.wrapper.ownerDocument,"mouseup",Ue)}function Vl(e,t){var r=t.anchor,n=t.head,i=Je(e.doc,r.line);if(lt(r,n)==0&&r.sticky==n.sticky)return t;var a=qe(i);if(!a)return t;var o=Fe(a,r.ch,r.sticky),s=a[o];if(s.from!=r.ch&&s.to!=r.ch)return t;var l=o+(s.from==r.ch==(s.level!=1)?0:1);if(l==0||l==a.length)return t;var u;if(n.line!=r.line)u=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var g=Fe(a,n.ch,n.sticky),E=g-o||(n.ch-r.ch)*(s.level==1?-1:1);g==l-1||g==l?u=E<0:u=E>0}var I=a[l+(u?-1:0)],A=u==(I.level==1),te=A?I.from:I.to,fe=A?"after":"before";return r.ch==te&&r.sticky==fe?t:new vt(new xe(r.line,te,fe),n)}function hs(e,t,r,n){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch(I){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&d(t);var o=e.display,s=o.lineDiv.getBoundingClientRect();if(a>s.bottom||!x(e,r))return h(t);a-=s.top-o.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var u=o.gutters.childNodes[l];if(u&&u.getBoundingClientRect().right>=i){var g=_n(e.doc,a),E=e.display.gutterSpecs[l];return se(e,r,e,g,E.className,t),h(t)}}}function Aa(e,t){return hs(e,t,"gutterClick",!0)}function ps(e,t){if(Ln(e.display,t)||$l(e,t))return;if(Te(e,t,"contextmenu"))return;_e||e.display.input.onContextMenu(t)}function $l(e,t){return x(e,"gutterContextMenu")?hs(e,t,"gutterContextMenu",!1):!1}function ms(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Jr(e)}var Rr={toString:function(){return"CodeMirror.Init"}},gs={},Vi={};function Yl(e){var t=e.optionHandlers;function r(n,i,a,o){e.defaults[n]=i,a&&(t[n]=o?function(s,l,u){u!=Rr&&a(s,l,u)}:a)}e.defineOption=r,e.Init=Rr,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,wa(n)},!0),r("indentUnit",2,wa,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){ii(n),Jr(n),Zt(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!i)return;var a=[],o=n.doc.first;n.doc.iter(function(l){for(var u=0;;){var g=l.text.indexOf(i,u);if(g==-1)break;u=g+i.length,a.push(xe(o,g))}o++});for(var s=a.length-1;s>=0;s--)Lr(n.doc,i,a[s],xe(a[s].line,a[s].ch+i.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,i,a){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),a!=Rr&&n.refresh()}),r("specialCharPlaceholder",ks,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",X?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!Ie),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){ms(n),ri(n)},!0),r("keyMap","default",function(n,i,a){var o=Xi(i),s=a!=Rr&&Xi(a);s&&s.detach&&s.detach(n,o),o.attach&&o.attach(n,s||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=ya(i,n.options.lineNumbers),ri(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?ua(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return Sr(n)},!0),r("scrollbarStyle","native",function(n){bo(n),Sr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=ya(n.options.gutters,i),ri(n)},!0),r("firstLineNumber",1,ri,!0),r("lineNumberFormatter",function(n){return n},ri,!0),r("showCursorWhenSelecting",!1,Zr,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(Cr(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("screenReaderLabel",null,function(n,i){i=i===""?null:i,n.display.input.screenReaderLabelChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,Zr,!0),r("singleCursorHeightPerLine",!0,Zr,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,ii,!0),r("addModeClass",!1,ii,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,ii,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=Rr;if(!t!=!n){var i=e.display.dragFunctions,a=t?re:Xe;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function Zl(e){e.options.lineWrapping?(ae(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Q(e.display.wrapper,"CodeMirror-wrap"),mn(e)),ca(e),Zt(e),Jr(e),setTimeout(function(){return Sr(e)},100)}function Tt(e,t){var r=this;if(!(this instanceof Tt))return new Tt(e,t);this.options=t=t?c(t):{},c(gs,t,!1);var n=t.value;typeof n=="string"?n=new qt(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new Tt.inputStyles[t.inputStyle](this),a=this.display=new cl(e,n,i,t);a.wrapper.CodeMirror=this,ms(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),bo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Z,keySeq:null,specialChars:null},t.autofocus&&!X&&a.input.focus(),O&&S<11&&setTimeout(function(){return r.display.input.reset(!0)},20),ql(this),Ll(),sr(this),this.curOp.forceUpdate=!0,Oo(this,n),t.autofocus&&!X||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&fa(r)},20):Cr(this);for(var o in Vi)Vi.hasOwnProperty(o)&&Vi[o](this,t[o],Rr);wo(this),t.finishInit&&t.finishInit(this);for(var s=0;s<Da.length;++s)Da[s](this);lr(this),C&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}Tt.defaults=gs,Tt.optionHandlers=Vi;function ql(e){var t=e.display;re(t.scroller,"mousedown",It(e,ds)),O&&S<11?re(t.scroller,"dblclick",It(e,function(l){if(Te(e,l))return;var u=rr(e,l);if(!u||Aa(e,l)||Ln(e.display,l))return;d(l);var g=e.findWordAt(u);Wi(e.doc,g.anchor,g.head)})):re(t.scroller,"dblclick",function(l){return Te(e,l)||d(l)}),re(t.scroller,"contextmenu",function(l){return ps(e,l)}),re(t.input.getField(),"contextmenu",function(l){t.scroller.contains(l.target)||ps(e,l)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function a(l){if(l.touches.length!=1)return!1;var u=l.touches[0];return u.radiusX<=1&&u.radiusY<=1}function o(l,u){if(u.left==null)return!0;var g=u.left-l.left,E=u.top-l.top;return g*g+E*E>20*20}re(t.scroller,"touchstart",function(l){if(!Te(e,l)&&!a(l)&&!Aa(e,l)){t.input.ensurePolled(),clearTimeout(r);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-n.end<=300?n:null},l.touches.length==1&&(t.activeTouch.left=l.touches[0].pageX,t.activeTouch.top=l.touches[0].pageY)}}),re(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),re(t.scroller,"touchend",function(l){var u=t.activeTouch;if(u&&!Ln(t,l)&&u.left!=null&&!u.moved&&new Date-u.start<300){var g=e.coordsChar(t.activeTouch,"page"),E;!u.prev||o(u,u.prev)?E=new vt(g,g):!u.prev.prev||o(u,u.prev.prev)?E=e.findWordAt(g):E=new vt(xe(g.line,0),ot(e.doc,xe(g.line+1,0))),e.setSelection(E.anchor,E.head),e.focus(),d(l)}i()}),re(t.scroller,"touchcancel",i),re(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Qr(e,t.scroller.scrollTop),ar(e,t.scroller.scrollLeft,!0),se(e,"scroll",e))}),re(t.scroller,"mousewheel",function(l){return ko(e,l)}),re(t.scroller,"DOMMouseScroll",function(l){return ko(e,l)}),re(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(l){Te(e,l)||p(l)},over:function(l){Te(e,l)||(Ol(e,l),p(l))},start:function(l){return Tl(e,l)},drop:It(e,_l),leave:function(l){Te(e,l)||qo(e)}};var s=t.input.getField();re(s,"keyup",function(l){return us.call(e,l)}),re(s,"keydown",It(e,ls)),re(s,"keypress",It(e,cs)),re(s,"focus",function(l){return fa(e,l)}),re(s,"blur",function(l){return Cr(e,l)})}var Da=[];Tt.defineInitHook=function(e){return Da.push(e)};function vi(e,t,r,n){var i=e.doc,a;r==null&&(r="add"),r=="smart"&&(i.mode.indent?a=nn(e,t).state:r="prev");var o=e.options.tabSize,s=Je(i,t),l=_(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var u=s.text.match(/^\s*/)[0],g;if(!n&&!/\S/.test(s.text))g=0,r="not";else if(r=="smart"&&(g=i.mode.indent(a,s.text.slice(u.length),s.text),g==je||g>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?g=_(Je(i,t-1).text,null,o):g=0:r=="add"?g=l+e.options.indentUnit:r=="subtract"?g=l-e.options.indentUnit:typeof r=="number"&&(g=l+r),g=Math.max(0,g);var E="",I=0;if(e.options.indentWithTabs)for(var A=Math.floor(g/o);A;--A)I+=o,E+=" ";if(I<g&&(E+=z(g-I)),E!=u)return Lr(i,E,xe(t,0),xe(t,u.length),"+input"),s.stateAfter=null,!0;for(var te=0;te<i.sel.ranges.length;te++){var fe=i.sel.ranges[te];if(fe.head.line==t&&fe.head.ch<u.length){var ke=xe(t,u.length);Sa(i,te,new vt(ke,ke));break}}}var bn=null;function $i(e){bn=e}function Ra(e,t,r,n,i){var a=e.doc;e.display.shift=!1,n||(n=a.sel);var o=+new Date-200,s=i=="paste"||e.state.pasteIncoming>o,l=pt(t),u=null;if(s&&n.ranges.length>1)if(bn&&bn.text.join(`
`)==t){if(n.ranges.length%bn.text.length==0){u=[];for(var g=0;g<bn.text.length;g++)u.push(a.splitLines(bn.text[g]))}}else l.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=We(l,function(Re){return[Re]}));for(var E=e.curOp.updateInput,I=n.ranges.length-1;I>=0;I--){var A=n.ranges[I],te=A.from(),fe=A.to();A.empty()&&(r&&r>0?te=xe(te.line,te.ch-r):e.state.overwrite&&!s?fe=xe(fe.line,Math.min(Je(a,fe.line).text.length,fe.ch+Oe(l).length)):s&&bn&&bn.lineWise&&bn.text.join(`
`)==l.join(`
`)&&(te=fe=xe(te.line,0)));var ke={from:te,to:fe,text:u?u[I%u.length]:l,origin:i||(s?"paste":e.state.cutIncoming>o?"cut":"+input")};Or(e.doc,ke),zt(e,"inputRead",e,ke)}t&&!s&&bs(e,t),kr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=E),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function vs(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&rn(t,function(){return Ra(t,r,0,null,"paste")}),!0}function bs(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)continue;var a=e.getModeAt(i.head),o=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){o=vi(e,i.head.line,"smart");break}}else a.electricInput&&(a.electricInput.test(Je(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=vi(e,i.head.line,"smart")));o&&zt(e,"electricInput",e,i.head.line)}}function ys(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,a={anchor:xe(i,0),head:xe(i+1,0)};r.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:r}}function xs(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function ws(){var e=v("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=v("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return C?e.style.width="1000px":e.setAttribute("wrap","off"),L&&(e.style.border="1px solid black"),xs(e),t}function Ql(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,i){var a=this.options,o=a[n];if(a[n]==i&&n!="mode")return;a[n]=i,t.hasOwnProperty(n)&&It(this,t[n])(this,i,o),se(this,"optionChange",this,n)},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,i){this.state.keyMaps[i?"push":"unshift"](Xi(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==n||i[a].name==n)return i.splice(a,1),!0},addOverlay:Yt(function(n,i){var a=n.token?n:e.getMode(this.options,n);if(a.startState)throw new Error("Overlays may not be stateful.");Ze(this.state.overlays,{mode:a,modeSpec:n,opaque:i&&i.opaque,priority:i&&i.priority||0},function(o){return o.priority}),this.state.modeGen++,Zt(this)}),removeOverlay:Yt(function(n){for(var i=this.state.overlays,a=0;a<i.length;++a){var o=i[a].modeSpec;if(o==n||typeof n=="string"&&o.name==n){i.splice(a,1),this.state.modeGen++,Zt(this);return}}}),indentLine:Yt(function(n,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Dn(this.doc,n)&&vi(this,n,i,a)}),indentSelection:Yt(function(n){for(var i=this.doc.sel.ranges,a=-1,o=0;o<i.length;o++){var s=i[o];if(s.empty())s.head.line>a&&(vi(this,s.head.line,n,!0),a=s.head.line,o==this.doc.sel.primIndex&&kr(this));else{var l=s.from(),u=s.to(),g=Math.max(a,l.line);a=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var E=g;E<a;++E)vi(this,E,n);var I=this.doc.sel.ranges;l.ch==0&&i.length==I.length&&I[o].from().ch>0&&Sa(this.doc,o,new vt(l,I[o].to()),de)}}}),getTokenAt:function(n,i){return On(this,n,i)},getLineTokens:function(n,i){return On(this,xe(n),i,!0)},getTokenTypeAt:function(n){n=ot(this.doc,n);var i=Fr(this,Je(this.doc,n.line)),a=0,o=(i.length-1)/2,s=n.ch,l;if(s==0)l=i[2];else for(;;){var u=a+o>>1;if((u?i[u*2-1]:0)>=s)o=u;else if(i[u*2+1]<s)a=u+1;else{l=i[u*2+2];break}}var g=l?l.indexOf("overlay "):-1;return g<0?l:g==0?null:l.slice(0,g-1)},getModeAt:function(n){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(n).state).mode:i},getHelper:function(n,i){return this.getHelpers(n,i)[0]},getHelpers:function(n,i){var a=[];if(!r.hasOwnProperty(i))return a;var o=r[i],s=this.getModeAt(n);if(typeof s[i]=="string")o[s[i]]&&a.push(o[s[i]]);else if(s[i])for(var l=0;l<s[i].length;l++){var u=o[s[i][l]];u&&a.push(u)}else s.helperType&&o[s.helperType]?a.push(o[s.helperType]):o[s.name]&&a.push(o[s.name]);for(var g=0;g<o._global.length;g++){var E=o._global[g];E.pred(s,this)&&Y(a,E.val)==-1&&a.push(E.val)}return a},getStateAfter:function(n,i){var a=this.doc;return n=Jn(a,n==null?a.first+a.size-1:n),nn(this,n+1,i).state},cursorCoords:function(n,i){var a,o=this.doc.sel.primary();return n==null?a=o.head:typeof n=="object"?a=ot(this.doc,n):a=n?o.from():o.to(),gn(this,a,i||"page")},charCoords:function(n,i){return ia(this,ot(this.doc,n),i||"page")},coordsChar:function(n,i){return n=no(this,n,i||"page"),oa(this,n.left,n.top)},lineAtHeight:function(n,i){return n=no(this,{top:n,left:0},i||"page").top,_n(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,i,a){var o=!1,s;if(typeof n=="number"){var l=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>l&&(n=l,o=!0),s=Je(this.doc,n)}else s=n;return Mi(this,s,{top:0,left:0},i||"page",a||o).top+(o?this.doc.height-_t(s):0)},defaultTextHeight:function(){return wr(this.display)},defaultCharWidth:function(){return Er(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,a,o,s){var l=this.display;n=gn(this,ot(this.doc,n));var u=n.bottom,g=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),l.sizer.appendChild(i),o=="over")u=n.top;else if(o=="above"||o=="near"){var E=Math.max(l.wrapper.clientHeight,this.doc.height),I=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);(o=="above"||n.bottom+i.offsetHeight>E)&&n.top>i.offsetHeight?u=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=E&&(u=n.bottom),g+i.offsetWidth>I&&(g=I-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",s=="right"?(g=l.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(s=="left"?g=0:s=="middle"&&(g=(l.sizer.clientWidth-i.offsetWidth)/2),i.style.left=g+"px"),a&&Js(this,{left:g,top:u,right:g+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:Yt(ls),triggerOnKeyPress:Yt(cs),triggerOnKeyUp:us,triggerOnMouseDown:Yt(ds),execCommand:function(n){if(hi.hasOwnProperty(n))return hi[n].call(null,this)},triggerElectric:Yt(function(n){bs(this,n)}),findPosH:function(n,i,a,o){var s=1;i<0&&(s=-1,i=-i);for(var l=ot(this.doc,n),u=0;u<i&&!(l=Pa(this.doc,l,s,a,o),l.hitSide);++u);return l},moveH:Yt(function(n,i){var a=this;this.extendSelectionsBy(function(o){return a.display.shift||a.doc.extend||o.empty()?Pa(a.doc,o.head,n,i,a.options.rtlMoveVisually):n<0?o.from():o.to()},ce)}),deleteH:Yt(function(n,i){var a=this.doc.sel,o=this.doc;a.somethingSelected()?o.replaceSelection("",null,"+delete"):Dr(this,function(s){var l=Pa(o,s.head,n,i,!1);return n<0?{from:l,to:s.head}:{from:s.head,to:l}})}),findPosV:function(n,i,a,o){var s=1,l=o;i<0&&(s=-1,i=-i);for(var u=ot(this.doc,n),g=0;g<i;++g){var E=gn(this,u,"div");if(l==null?l=E.left:E.left=l,u=Es(this,E,s,a),u.hitSide)break}return u},moveV:Yt(function(n,i){var a=this,o=this.doc,s=[],l=!this.display.shift&&!o.extend&&o.sel.somethingSelected();if(o.extendSelectionsBy(function(g){if(l)return n<0?g.from():g.to();var E=gn(a,g.head,"div");g.goalColumn!=null&&(E.left=g.goalColumn),s.push(E.left);var I=Es(a,E,n,i);return i=="page"&&g==o.sel.primary()&&pa(a,ia(a,I,"div").top-E.top),I},ce),s.length)for(var u=0;u<o.sel.ranges.length;u++)o.sel.ranges[u].goalColumn=s[u]}),findWordAt:function(n){var i=this.doc,a=Je(i,n.line).text,o=n.ch,s=n.ch;if(a){var l=this.getHelper(n,"wordChars");(n.sticky=="before"||s==a.length)&&o?--o:++s;for(var u=a.charAt(o),g=De(u,l)?function(E){return De(E,l)}:/\s/.test(u)?function(E){return/\s/.test(E)}:function(E){return!/\s/.test(E)&&!De(E)};o>0&&g(a.charAt(o-1));)--o;for(;s<a.length&&g(a.charAt(s));)++s}return new vt(xe(n.line,o),xe(n.line,s))},toggleOverwrite:function(n){if(n!=null&&n==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?ae(this.display.cursorDiv,"CodeMirror-overwrite"):Q(this.display.cursorDiv,"CodeMirror-overwrite"),se(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==F()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Yt(function(n,i){qr(this,n,i)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-xn(this)-this.display.barHeight,width:n.scrollWidth-xn(this)-this.display.barWidth,clientHeight:ta(this),clientWidth:tr(this)}},scrollIntoView:Yt(function(n,i){n==null?(n={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof n=="number"?n={from:xe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=i||0,n.from.line!=null?Zs(this,n):po(this,n.from,n.to,n.margin)}),setSize:Yt(function(n,i){var a=this,o=function(l){return typeof l=="number"||/^\d+$/.test(String(l))?l+"px":l};n!=null&&(this.display.wrapper.style.width=o(n)),i!=null&&(this.display.wrapper.style.height=o(i)),this.options.lineWrapping&&Qa(this);var s=this.display.viewFrom;this.doc.iter(s,this.display.viewTo,function(l){if(l.widgets){for(var u=0;u<l.widgets.length;u++)if(l.widgets[u].noHScroll){Un(a,s,"widget");break}}++s}),this.curOp.forceUpdate=!0,se(this,"refresh",this)}),operation:function(n){return rn(this,n)},startOperation:function(){return sr(this)},endOperation:function(){return lr(this)},refresh:Yt(function(){var n=this.display.cachedTextHeight;Zt(this),this.curOp.forceUpdate=!0,Jr(this),qr(this,this.doc.scrollLeft,this.doc.scrollTop),va(this.display),(n==null||Math.abs(n-wr(this.display))>.5||this.options.lineWrapping)&&ca(this),se(this,"refresh",this)}),swapDoc:Yt(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Oo(this,n),Jr(this),this.display.input.reset(),qr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,zt(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},k(e),e.registerHelper=function(n,i,a){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=a},e.registerGlobalHelper=function(n,i,a,o){e.registerHelper(n,i,o),r[n]._global.push({pred:a,val:o})}}function Pa(e,t,r,n,i){var a=t,o=r,s=Je(e,t.line),l=i&&e.direction=="rtl"?-r:r;function u(){var Ue=t.line+l;return Ue<e.first||Ue>=e.first+e.size?!1:(t=new xe(Ue,t.ch,t.sticky),s=Je(e,Ue))}function g(Ue){var Pe;if(n=="codepoint"){var Ke=s.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(Ke)?Pe=null:Pe=new xe(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(Ke>=55296&&Ke<56320?2:1))),-r)}else i?Pe=Pl(e.cm,s,t,r):Pe=Ta(s,t,r);if(Pe==null)if(!Ue&&u())t=Oa(i,e.cm,s,t.line,l);else return!1;else t=Pe;return!0}if(n=="char"||n=="codepoint")g();else if(n=="column")g(!0);else if(n=="word"||n=="group")for(var E=null,I=n=="group",A=e.cm&&e.cm.getHelper(t,"wordChars"),te=!0;!(r<0&&!g(!te));te=!1){var fe=s.text.charAt(t.ch)||`
`,ke=De(fe,A)?"w":I&&fe==`
`?"n":!I||/\s/.test(fe)?null:"p";if(I&&!te&&!ke&&(ke="s"),E&&E!=ke){r<0&&(r=1,g(),t.sticky="after");break}if(ke&&(E=ke),r>0&&!g(!te))break}var Re=zi(e,t,a,o,!0);return Me(a,Re)&&(Re.hitSide=!0),Re}function Es(e,t,r,n){var i=e.doc,a=t.left,o;if(n=="page"){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*wr(e.display),3);o=(r>0?t.bottom:t.top)+r*l}else n=="line"&&(o=r>0?t.bottom+3:t.top-3);for(var u;!(u=oa(e,a,o),!u.outside);){if(r<0?o<=0:o>=i.height){u.hitSide=!0;break}o+=r*5}return u}var yt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};yt.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;xs(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function a(s){for(var l=s.target;l;l=l.parentNode){if(l==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(l.className))break}return!1}re(i,"paste",function(s){if(!a(s)||Te(n,s)||vs(s,n))return;S<=11&&setTimeout(It(n,function(){return t.updateFromDOM()}),20)}),re(i,"compositionstart",function(s){t.composing={data:s.data,done:!1}}),re(i,"compositionupdate",function(s){t.composing||(t.composing={data:s.data,done:!1})}),re(i,"compositionend",function(s){t.composing&&(s.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),re(i,"touchstart",function(){return r.forceCompositionEnd()}),re(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(s){if(!a(s)||Te(n,s))return;if(n.somethingSelected())$i({lineWise:!1,text:n.getSelections()}),s.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var l=ys(n);$i({lineWise:!0,text:l.text}),s.type=="cut"&&n.operation(function(){n.setSelections(l.ranges,0,de),n.replaceSelection("",null,"cut")})}else return;if(s.clipboardData){s.clipboardData.clearData();var u=bn.text.join(`
`);if(s.clipboardData.setData("Text",u),s.clipboardData.getData("Text")==u){s.preventDefault();return}}var g=ws(),E=g.firstChild;n.display.lineSpace.insertBefore(g,n.display.lineSpace.firstChild),E.value=bn.text.join(`
`);var I=document.activeElement;Ee(E),setTimeout(function(){n.display.lineSpace.removeChild(g),I.focus(),I==i&&r.showPrimarySelection()},50)}re(i,"copy",o),re(i,"cut",o)},yt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},yt.prototype.prepareSelection=function(){var e=lo(this.cm,!1);return e.focus=document.activeElement==this.div,e},yt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},yt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},yt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=Yi(t,e.anchorNode,e.anchorOffset),o=Yi(t,e.focusNode,e.focusOffset);if(a&&!a.bad&&o&&!o.bad&&lt(Yn(a,o),n)==0&&lt(hr(a,o),i)==0)return;var s=t.display.view,l=n.line>=t.display.viewFrom&&Cs(t,n)||{node:s[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&Cs(t,i);if(!u){var g=s[s.length-1].measure,E=g.maps?g.maps[g.maps.length-1]:g.map;u={node:E[E.length-1],offset:E[E.length-2]-E[E.length-3]}}if(!l||!u){e.removeAllRanges();return}var I=e.rangeCount&&e.getRangeAt(0),A;try{A=P(l.node,l.offset,u.offset,u.node)}catch(te){}A&&(!H&&t.state.focused?(e.collapse(l.node,l.offset),A.collapsed||(e.removeAllRanges(),e.addRange(A))):(e.removeAllRanges(),e.addRange(A)),I&&e.anchorNode==null?e.addRange(I):H&&this.startGracePeriod()),this.rememberSelection()},yt.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},yt.prototype.showMultipleSelections=function(e){J(this.cm.display.cursorDiv,e.cursors),J(this.cm.display.selectionDiv,e.selection)},yt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},yt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return b(this.div,t)},yt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},yt.prototype.blur=function(){this.div.blur()},yt.prototype.getField=function(){return this.div},yt.prototype.supportsTouch=function(){return!0},yt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():rn(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},yt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},yt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(T&&j&&this.cm.display.gutterSpecs.length&&eu(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var r=Yi(t,e.anchorNode,e.anchorOffset),n=Yi(t,e.focusNode,e.focusOffset);r&&n&&rn(t,function(){Gt(t.doc,Wn(r,n),de),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})},yt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=xe(n.line-1,Je(e.doc,n.line-1).length)),i.ch==Je(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=xe(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,o,s;n.line==t.viewFrom||(a=ir(e,n.line))==0?(o=gt(t.view[0].line),s=t.view[0].node):(o=gt(t.view[a].line),s=t.view[a-1].node.nextSibling);var l=ir(e,i.line),u,g;if(l==t.view.length-1?(u=t.viewTo-1,g=t.lineDiv.lastChild):(u=gt(t.view[l+1].line)-1,g=t.view[l+1].node.previousSibling),!s)return!1;for(var E=e.doc.splitLines(tu(e,s,g,o,u)),I=Sn(e.doc,xe(o,0),xe(u,Je(e.doc,u).text.length));E.length>1&&I.length>1;)if(Oe(E)==Oe(I))E.pop(),I.pop(),u--;else if(E[0]==I[0])E.shift(),I.shift(),o++;else break;for(var A=0,te=0,fe=E[0],ke=I[0],Re=Math.min(fe.length,ke.length);A<Re&&fe.charCodeAt(A)==ke.charCodeAt(A);)++A;for(var Ue=Oe(E),Pe=Oe(I),Ke=Math.min(Ue.length-(E.length==1?A:0),Pe.length-(I.length==1?A:0));te<Ke&&Ue.charCodeAt(Ue.length-te-1)==Pe.charCodeAt(Pe.length-te-1);)++te;if(E.length==1&&I.length==1&&o==n.line)for(;A&&A>n.ch&&Ue.charCodeAt(Ue.length-te-1)==Pe.charCodeAt(Pe.length-te-1);)A--,te++;E[E.length-1]=Ue.slice(0,Ue.length-te).replace(/^\u200b+/,""),E[0]=E[0].slice(A).replace(/\u200b+$/,"");var rt=xe(o,A),et=xe(u,I.length?Oe(I).length-te:0);if(E.length>1||E[0]||lt(rt,et))return Lr(e.doc,E,rt,et,"+input"),!0},yt.prototype.ensurePolled=function(){this.forceCompositionEnd()},yt.prototype.reset=function(){this.forceCompositionEnd()},yt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},yt.prototype.readFromDOMSoon=function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80)},yt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&rn(this.cm,function(){return Zt(e.cm)})},yt.prototype.setUneditable=function(e){e.contentEditable="false"},yt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||It(this.cm,Ra)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},yt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},yt.prototype.onContextMenu=function(){},yt.prototype.resetPosition=function(){},yt.prototype.needsContentAttribute=!0;function Cs(e,t){var r=na(e,t.line);if(!r||r.hidden)return null;var n=Je(e.doc,t.line),i=$a(r,n,t.line),a=qe(n,e.doc.direction),o="left";if(a){var s=Fe(a,t.ch);o=s%2?"right":"left"}var l=Za(i.map,t.ch,o);return l.offset=l.collapse=="right"?l.end:l.start,l}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Pr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,i){var a="",o=!1,s=e.doc.lineSeparator(),l=!1;function u(A){return function(te){return te.id==A}}function g(){o&&(a+=s,l&&(a+=s),o=l=!1)}function E(A){A&&(g(),a+=A)}function I(A){if(A.nodeType==1){var te=A.getAttribute("cm-text");if(te){E(te);return}var fe=A.getAttribute("cm-marker"),ke;if(fe){var Re=e.findMarks(xe(n,0),xe(i+1,0),u(+fe));Re.length&&(ke=Re[0].find(0))&&E(Sn(e.doc,ke.from,ke.to).join(s));return}if(A.getAttribute("contenteditable")=="false")return;var Ue=/^(pre|div|p|li|table|br)$/i.test(A.nodeName);if(!/^br$/i.test(A.nodeName)&&A.textContent.length==0)return;Ue&&g();for(var Pe=0;Pe<A.childNodes.length;Pe++)I(A.childNodes[Pe]);/^(pre|p)$/i.test(A.nodeName)&&(l=!0),Ue&&(o=!0)}else A.nodeType==3&&E(A.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(I(t),t==r);)t=t.nextSibling,l=!1;return a}function Yi(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Pr(e.clipPos(xe(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==n)return nu(a,t,r)}}function nu(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!b(n,t))return Pr(xe(gt(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var a=e.rest?Oe(e.rest):e.line;return Pr(xe(gt(a),a.text.length),i)}var o=t.nodeType==3?t:null,s=t;for(!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,r&&(r=o.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var l=e.measure,u=l.maps;function g(ke,Re,Ue){for(var Pe=-1;Pe<(u?u.length:0);Pe++)for(var Ke=Pe<0?l.map:u[Pe],rt=0;rt<Ke.length;rt+=3){var et=Ke[rt+2];if(et==ke||et==Re){var ft=gt(Pe<0?e.line:e.rest[Pe]),Et=Ke[rt]+Ue;return(Ue<0||et!=ke)&&(Et=Ke[rt+(Ue?1:0)]),xe(ft,Et)}}}var E=g(o,s,r);if(E)return Pr(E,i);for(var I=s.nextSibling,A=o?o.nodeValue.length-r:0;I;I=I.nextSibling){if(E=g(I,I.firstChild,0),E)return Pr(xe(E.line,E.ch-A),i);A+=I.textContent.length}for(var te=s.previousSibling,fe=r;te;te=te.previousSibling){if(E=g(te,te.firstChild,-1),E)return Pr(xe(E.line,E.ch+fe),i);fe+=te.textContent.length}}var At=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Z,this.hasSelection=!1,this.composing=null};At.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),L&&(i.style.width="0px"),re(i,"input",function(){O&&S>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),re(i,"paste",function(o){if(Te(n,o)||vs(o,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function a(o){if(Te(n,o))return;if(n.somethingSelected())$i({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var s=ys(n);$i({lineWise:!0,text:s.text}),o.type=="cut"?n.setSelections(s.ranges,null,de):(r.prevInput="",i.value=s.text.join(`
`),Ee(i))}else return;o.type=="cut"&&(n.state.cutIncoming=+new Date)}re(i,"cut",a),re(i,"copy",a),re(e.scroller,"paste",function(o){if(Ln(e,o)||Te(n,o))return;if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var s=new Event("paste");s.clipboardData=o.clipboardData,i.dispatchEvent(s)}),re(e.lineSpace,"selectstart",function(o){Ln(e,o)||d(o)}),re(i,"compositionstart",function(){var o=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:o,range:n.markText(o,n.getCursor("to"),{className:"CodeMirror-composing"})}}),re(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},At.prototype.createField=function(e){this.wrapper=ws(),this.textarea=this.wrapper.firstChild},At.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},At.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=lo(e);if(e.options.moveInputWithCursor){var i=gn(e,r.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-a.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-a.left))}return n},At.prototype.showSelection=function(e){var t=this.cm,r=t.display;J(r.cursorDiv,e.cursors),J(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},At.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&Ee(this.textarea),O&&S>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",O&&S>=9&&(this.hasSelection=null))},At.prototype.getField=function(){return this.textarea},At.prototype.supportsTouch=function(){return!1},At.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!X||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},At.prototype.blur=function(){this.textarea.blur()},At.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},At.prototype.receivedFocus=function(){this.slowPoll()},At.prototype.slowPoll=function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},At.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},At.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||st(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(O&&S>=9&&this.hasSelection===i||V&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!n&&(n="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var o=0,s=Math.min(n.length,i.length);o<s&&n.charCodeAt(o)==i.charCodeAt(o);)++o;return rn(t,function(){Ra(t,i.slice(o),n.length-o,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},At.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},At.prototype.onKeyPress=function(){O&&S>=9&&(this.hasSelection=null),this.fastPoll()},At.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=rr(r,e),o=n.scroller.scrollTop;if(!a||G)return;var s=r.options.resetSelectionOnContextMenu;s&&r.doc.sel.contains(a)==-1&&It(r,Gt)(r.doc,Wn(a),de);var l=i.style.cssText,u=t.wrapper.style.cssText,g=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-g.top-5)+"px; left: "+(e.clientX-g.left-5)+`px;
z-index: 1000; background: `+(O?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var E;C&&(E=window.scrollY),n.input.focus(),C&&window.scrollTo(null,E),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=A,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function I(){if(i.selectionStart!=null){var fe=r.somethingSelected(),ke="\u200B"+(fe?i.value:"");i.value="\u21DA",i.value=ke,t.prevInput=fe?"":"\u200B",i.selectionStart=1,i.selectionEnd=ke.length,n.selForContextMenu=r.doc.sel}}function A(){if(t.contextMenuPending!=A)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=l,O&&S<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=o),i.selectionStart!=null){(!O||O&&S<9)&&I();var fe=0,ke=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?It(r,Bo)(r):fe++<10?n.detectingSelectAll=setTimeout(ke,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ke,200)}}if(O&&S>=9&&I(),_e){p(e);var te=function(){Xe(window,"mouseup",te),setTimeout(A,20)};re(window,"mouseup",te)}else setTimeout(A,50)},At.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},At.prototype.setUneditable=function(){},At.prototype.needsContentAttribute=!1;function ru(e,t){if(t=t?c(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=F();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(re(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var o=a.submit=function(){n(),a.submit=i,a.submit(),a.submit=o}}catch(l){}}t.finishInit=function(l){l.save=n,l.getTextArea=function(){return e},l.toTextArea=function(){l.toTextArea=isNaN,n(),e.parentNode.removeChild(l.getWrapperElement()),e.style.display="",e.form&&(Xe(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var s=Tt(function(l){return e.parentNode.insertBefore(l,e.nextSibling)},t);return s}function iu(e){e.off=Xe,e.on=re,e.wheelEventPixels=dl,e.Doc=qt,e.splitLines=pt,e.countColumn=_,e.findColumn=me,e.isWordChar=we,e.Pass=je,e.signal=se,e.Line=kt,e.changeEnd=Bn,e.scrollbarModel=vo,e.Pos=xe,e.cmpPos=lt,e.modes=Bt,e.mimeModes=mt,e.resolveMode=un,e.getMode=kn,e.modeExtensions=pn,e.extendMode=bi,e.copyState=cn,e.startState=dr,e.innerMode=Vn,e.commands=hi,e.keyMap=Mn,e.keyName=rs,e.isModifierKey=ts,e.lookupKey=Ar,e.normalizeKeyMap=Rl,e.StringStream=St,e.SharedTextMarker=ci,e.TextMarker=Hn,e.LineWidget=ui,e.e_preventDefault=d,e.e_stopPropagation=f,e.e_stop=p,e.addClass=ae,e.contains=b,e.rmClass=Q,e.keyNames=Kn}Yl(Tt),Ql(Tt);var au="iter insert remove copy getEditor constructor".split(" ");for(var Ji in qt.prototype)qt.prototype.hasOwnProperty(Ji)&&Y(au,Ji)<0&&(Tt.prototype[Ji]=function(e){return function(){return e.apply(this.doc,arguments)}}(qt.prototype[Ji]));return k(qt),Tt.inputStyles={textarea:At,contenteditable:yt},Tt.defineMode=function(e){!Tt.defaults.mode&&e!="null"&&(Tt.defaults.mode=e),Cn.apply(this,arguments)},Tt.defineMIME=Gn,Tt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Tt.defineMIME("text/plain","null"),Tt.defineExtension=function(e,t){Tt.prototype[e]=t},Tt.defineDocExtension=function(e,t){qt.prototype[e]=t},Tt.fromTextArea=ru,iu(Tt),Tt.version="5.58.2",Tt})},VwnK:function(ht,Ye,w){"use strict";w.r(Ye);var M=w("+L6B"),Ce=w("2/Rp"),H=w("OaEy"),he=w("2fM7"),ue=w("14J3"),ee=w("BMrR"),O=w("5NDa"),S=w("5rEg"),C=w("jCWc"),ie=w("kPKH"),j=w("jrin"),G=w("miYZ"),le=w("tsqr"),B=w("k1fw"),D=w("9og8"),L=w("y8nQ"),T=w("Vl3Y"),X=w("tJVT"),V=w("PpiC"),be=w("WmNS"),Ie=w.n(be),$=w("q1tI"),ne=w.n($),_e=w("9kvl"),q=w("ErOA"),Q=w("xKgJ"),ge=w("Ot1p"),J=function(U){var P,b,F,ae=U.user,W=U.globalSetting,Ee=U.loading,m=U.dispatch,c=U.restful,_=Object(V.a)(U,["user","globalSetting","loading","dispatch","restful"]),Z=Object($.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),Y=Object(X.a)(Z,2),Se=Y[0],je=Y[1],de=Object($.useState)(!0),Le=Object(X.a)(de,2),ce=Le[0],me=Le[1],R=_.match.params,z=T.a.useForm(),Oe=Object(X.a)(z,1),We=Oe[0],Ze=Object($.useState)(`
##### \u7B80\u8981\u63CF\u8FF0
- \u7528\u6237\u6CE8\u518C\u63A5\u53E3
##### \u8BF7\u6C42URL
- \` http://xx.com/api/user/register \`
##### \u8BF7\u6C42\u65B9\u5F0F
- POST
##### \u53C2\u6570
|\u53C2\u6570\u540D|\u5FC5\u9009|\u7C7B\u578B|\u8BF4\u660E|
|:---- |:---|:----- |----- |
|username |\u662F |string |\u7528\u6237\u540D |
|password |\u662F |string | \u5BC6\u7801 |
|name |\u5426 |string | \u6635\u79F0 |
##### \u8FD4\u56DE\u793A\u4F8B
\`\`\`
{
"error_code": 0,
"data": {
"uid": "1",
"username": "12154545",
"name": "\u5434\u7CFB\u6302",
"groupid": 2 ,
"reg_time": "1436864169",
"last_login_time": "0",
}
}
\`\`\`
##### \u8FD4\u56DE\u53C2\u6570\u8BF4\u660E
|\u53C2\u6570\u540D|\u7C7B\u578B|\u8BF4\u660E|
|:----- |:-----|----- |
|groupid |int |\u7528\u6237\u7EC4id\uFF0C1\uFF1A\u8D85\u7EA7\u7BA1\u7406\u5458\uFF1B2\uFF1A\u666E\u901A\u7528\u6237 |
##### \u5907\u6CE8
- \u66F4\u591A\u8FD4\u56DE\u9519\u8BEF\u4EE3\u7801\u8BF7\u770B\u9996\u9875\u7684\u9519\u8BEF\u4EE3\u7801\u63CF\u8FF0
\u6B22\u8FCE\u4F7F\u7528\uFF01`),He=Object(X.a)(Ze,2),Be=He[0],ve=He[1];Object($.useEffect)(function(){We.resetFields()},[R.id]);var we=function(){var Ne=Object(D.a)(Ie.a.mark(function Ae(oe){var ye,ze,Ge;return Ie.a.wrap(function(Fe){for(;;)switch(Fe.prev=Fe.next){case 0:return Fe.next=2,We.getFieldsValue();case 2:return ye=Fe.sent,ze="/api/restfuls.json",R.id!=0&&(ze="/api/restfuls/".concat(R.id,".json")),Fe.next=7,Object(q.a)(ze,{method:R.id!=0?"put":"post",body:Object(B.a)(Object(B.a)({file_type:0},ye),{},{parent_id:ye.parent_id||""})});case 7:Ge=Fe.sent,Ge.status===0&&(le.b.success("\u6DFB\u52A0\u6210\u529F"),_.history.push("/ch/rest/".concat(Ge.data.id)));case 9:case"end":return Fe.stop()}},Ae)}));return function(oe){return Ne.apply(this,arguments)}}(),De=function(){var Ne=Object(D.a)(Ie.a.mark(function Ae(){var oe;return Ie.a.wrap(function(ze){for(;;)switch(ze.prev=ze.next){case 0:return ze.next=2,m({type:"restful/getRestful"});case 2:if(!(R.id!=0)){ze.next=8;break}return ze.next=5,m({type:"restful/getRestfulDetail",payload:Object(B.a)({},R)});case 5:oe=ze.sent,We.setFieldsValue({description:oe==null?void 0:oe.description,name:oe==null?void 0:oe.name}),Object(Q.n)()||_.history.replace("/403");case 8:case"end":return ze.stop()}},Ae)}));return function(){return Ne.apply(this,arguments)}}();return Object($.useEffect)(function(){var Ne,Ae;if((Ne=c.restful)!==null&&Ne!==void 0&&Ne.data&&We.setFieldsValue({parent_id:R.categoryId*1}),(Ae=c.restfulDetail)!==null&&Ae!==void 0&&Ae.description&&R.id!=0){var oe;ve((oe=c.restfulDetail)===null||oe===void 0?void 0:oe.description)}},[c.restful,(P=c.restfulDetail)===null||P===void 0?void 0:P.description]),Object($.useEffect)(function(){me(!0),De()},[R.id]),ne.a.createElement("section",null,ne.a.createElement("aside",{className:"edu-container mt30"},ne.a.createElement(T.a,{onFinish:we,form:We,initialValues:Object(j.a)({},"name","")},ne.a.createElement(ee.a,{className:"mt30"},ne.a.createElement(ie.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),ne.a.createElement(ie.a,{flex:"1"},ne.a.createElement(T.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},ne.a.createElement(S.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))),ne.a.createElement(ee.a,{className:""},ne.a.createElement(ie.a,{flex:"80px",className:"font14"},"\u6240\u5C5E\u76EE\u5F55:"),ne.a.createElement(ie.a,{flex:"1"},ne.a.createElement(T.a.Item,{name:"parent_id",rules:[{required:!0,message:"\u6240\u5C5E\u76EE\u5F55"}]},ne.a.createElement(he.a,{showSearch:!0,style:{width:200},placeholder:"\u8BF7\u9009\u62E9\u76EE\u5F55",optionFilterProp:"children",filterOption:function(Ae,oe){return oe.children.toLowerCase().indexOf(Ae.toLowerCase())>=0}},ne.a.createElement(he.a.Option,{value:0,key:9999},"\u6839\u76EE\u5F55"),c==null||((b=c.restful)===null||b===void 0||((F=b.data)===null||F===void 0))?void 0:F.map(function(Ne,Ae){return ne.a.createElement(he.a.Option,{value:Ne.id,key:Ae},Ne.title)}))))),ne.a.createElement(T.a.Item,{name:"description",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},ne.a.createElement(ge.a,{defaultValue:Be,watch:!0,height:600})),ne.a.createElement(ee.a,{align:"middle",justify:"center"},ne.a.createElement(ie.a,null,ne.a.createElement(Ce.a,{style:{width:130},size:"large",type:"primary",htmlType:"submit"},"\u4FDD\u5B58"))),ne.a.createElement("div",{className:"mt40"}))))};Ye.default=Object(_e.b)(function(v){var U=v.user,P=v.loading,b=v.globalSetting,F=v.restful;return{user:U,globalSetting:b,restful:F,loading:P.models.index}})(J)},Y1PL:function(ht,Ye,w){"use strict";w.r(Ye),w.d(Ye,"ResizableTextArea",function(){return Y});var M=w("wx14"),Ce=w("1OyB"),H=w("vuIU"),he=w("Ji7U"),ue=w("LK+K"),ee=w("q1tI"),O=w("VTBJ"),S=w("rePB"),C=w("Zm9Q"),ie=w("Kwbf"),j=w("c+Xe"),G=w("m+aA"),le=w("bdgK"),B=new Map;function D(de){de.forEach(function(Le){var ce,me=Le.target;(ce=B.get(me))===null||ce===void 0||ce.forEach(function(R){return R(me)})})}var L=new le.default(D),T=null,X=null;function V(de,Le){B.has(de)||(B.set(de,new Set),L.observe(de)),B.get(de).add(Le)}function be(de,Le){B.has(de)&&(B.get(de).delete(Le),B.get(de).size||(L.unobserve(de),B.delete(de)))}var Ie=function(de){Object(he.a)(ce,de);var Le=Object(ue.a)(ce);function ce(){return Object(Ce.a)(this,ce),Le.apply(this,arguments)}return Object(H.a)(ce,[{key:"render",value:function(){return this.props.children}}]),ce}(ee.Component),$=ee.createContext(null);function ne(de){var Le=de.children,ce=de.onBatchResize,me=ee.useRef(0),R=ee.useRef([]),z=ee.useContext($),Oe=ee.useCallback(function(We,Ze,He){me.current+=1;var Be=me.current;R.current.push({size:We,element:Ze,data:He}),Promise.resolve().then(function(){Be===me.current&&(ce==null||ce(R.current),R.current=[])}),z==null||z(We,Ze,He)},[ce,z]);return ee.createElement($.Provider,{value:Oe},Le)}function _e(de){var Le=de.children,ce=de.disabled,me=ee.useRef(null),R=ee.useRef(null),z=ee.useContext($),Oe=ee.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),We=ee.isValidElement(Le)&&Object(j.c)(Le),Ze=We?Le.ref:null,He=ee.useMemo(function(){return Object(j.a)(Ze,me)},[Ze,me]),Be=ee.useRef(de);Be.current=de;var ve=ee.useCallback(function(we){var De=Be.current,Ne=De.onResize,Ae=De.data,oe=we.getBoundingClientRect(),ye=oe.width,ze=oe.height,Ge=we.offsetWidth,Ve=we.offsetHeight,Fe=Math.floor(ye),it=Math.floor(ze);if(Oe.current.width!==Fe||Oe.current.height!==it||Oe.current.offsetWidth!==Ge||Oe.current.offsetHeight!==Ve){var qe={width:Fe,height:it,offsetWidth:Ge,offsetHeight:Ve};Oe.current=qe;var $e=Ge===Math.round(ye)?ye:Ge,re=Ve===Math.round(ze)?ze:Ve,nt=Object(O.a)(Object(O.a)({},qe),{},{offsetWidth:$e,offsetHeight:re});z==null||z(nt,we,Ae),Ne&&Promise.resolve().then(function(){Ne(nt,we)})}},[]);return ee.useEffect(function(){var we=Object(G.a)(me.current)||Object(G.a)(R.current);return we&&!ce&&V(we,ve),function(){return be(we,ve)}},[me.current,ce]),ee.createElement(Ie,{ref:R},We?ee.cloneElement(Le,{ref:He}):Le)}var q="rc-observer-key";function Q(de){var Le=de.children,ce=Object(C.a)(Le);return ce.map(function(me,R){var z=(me==null?void 0:me.key)||"".concat(q,"-").concat(R);return ee.createElement(_e,Object(M.a)({},de,{key:z}),me)})}Q.Collection=ne;var ge=Q,J=w("bT9E"),v=w("TSYQ"),U=w.n(v),P=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,b=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],F={},ae;function W(de){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=de.getAttribute("id")||de.getAttribute("data-reactid")||de.getAttribute("name");if(Le&&F[ce])return F[ce];var me=window.getComputedStyle(de),R=me.getPropertyValue("box-sizing")||me.getPropertyValue("-moz-box-sizing")||me.getPropertyValue("-webkit-box-sizing"),z=parseFloat(me.getPropertyValue("padding-bottom"))+parseFloat(me.getPropertyValue("padding-top")),Oe=parseFloat(me.getPropertyValue("border-bottom-width"))+parseFloat(me.getPropertyValue("border-top-width")),We=b.map(function(He){return"".concat(He,":").concat(me.getPropertyValue(He))}).join(";"),Ze={sizingStyle:We,paddingSize:z,borderSize:Oe,boxSizing:R};return Le&&ce&&(F[ce]=Ze),Ze}function Ee(de){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,me=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;ae||(ae=document.createElement("textarea"),ae.setAttribute("tab-index","-1"),ae.setAttribute("aria-hidden","true"),document.body.appendChild(ae)),de.getAttribute("wrap")?ae.setAttribute("wrap",de.getAttribute("wrap")):ae.removeAttribute("wrap");var R=W(de,Le),z=R.paddingSize,Oe=R.borderSize,We=R.boxSizing,Ze=R.sizingStyle;ae.setAttribute("style","".concat(Ze,";").concat(P)),ae.value=de.value||de.placeholder||"";var He=Number.MIN_SAFE_INTEGER,Be=Number.MAX_SAFE_INTEGER,ve=ae.scrollHeight,we;if(We==="border-box"?ve+=Oe:We==="content-box"&&(ve-=z),ce!==null||me!==null){ae.value=" ";var De=ae.scrollHeight-z;ce!==null&&(He=De*ce,We==="border-box"&&(He=He+z+Oe),ve=Math.max(He,ve)),me!==null&&(Be=De*me,We==="border-box"&&(Be=Be+z+Oe),we=ve>Be?"":"hidden",ve=Math.min(Be,ve))}return{height:ve,minHeight:He,maxHeight:Be,overflowY:we,resize:"none"}}var m=w("Gytx"),c=w.n(m),_;(function(de){de[de.NONE=0]="NONE",de[de.RESIZING=1]="RESIZING",de[de.RESIZED=2]="RESIZED"})(_||(_={}));var Z=function(de){Object(he.a)(ce,de);var Le=Object(ue.a)(ce);function ce(me){var R;return Object(Ce.a)(this,ce),R=Le.call(this,me),R.nextFrameActionId=void 0,R.resizeFrameId=void 0,R.textArea=void 0,R.saveTextArea=function(z){R.textArea=z},R.handleResize=function(z){var Oe=R.state.resizeStatus,We=R.props,Ze=We.autoSize,He=We.onResize;if(Oe!==_.NONE)return;typeof He=="function"&&He(z),Ze&&R.resizeOnNextFrame()},R.resizeOnNextFrame=function(){cancelAnimationFrame(R.nextFrameActionId),R.nextFrameActionId=requestAnimationFrame(R.resizeTextarea)},R.resizeTextarea=function(){var z=R.props.autoSize;if(!z||!R.textArea)return;var Oe=z.minRows,We=z.maxRows,Ze=Ee(R.textArea,!1,Oe,We);R.setState({textareaStyles:Ze,resizeStatus:_.RESIZING},function(){cancelAnimationFrame(R.resizeFrameId),R.resizeFrameId=requestAnimationFrame(function(){R.setState({resizeStatus:_.RESIZED},function(){R.resizeFrameId=requestAnimationFrame(function(){R.setState({resizeStatus:_.NONE}),R.fixFirefoxAutoScroll()})})})})},R.renderTextArea=function(){var z=R.props,Oe=z.prefixCls,We=Oe===void 0?"rc-textarea":Oe,Ze=z.autoSize,He=z.onResize,Be=z.className,ve=z.disabled,we=R.state,De=we.textareaStyles,Ne=we.resizeStatus,Ae=Object(J.a)(R.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),oe=U()(We,Be,Object(S.a)({},"".concat(We,"-disabled"),ve));"value"in Ae&&(Ae.value=Ae.value||"");var ye=Object(O.a)(Object(O.a)(Object(O.a)({},R.props.style),De),Ne===_.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return ee.createElement(ge,{onResize:R.handleResize,disabled:!(Ze||He)},ee.createElement("textarea",Object(M.a)({},Ae,{className:oe,style:ye,ref:R.saveTextArea})))},R.state={textareaStyles:{},resizeStatus:_.NONE},R}return Object(H.a)(ce,[{key:"componentDidUpdate",value:function(R){(R.value!==this.props.value||!c()(R.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var R=this.textArea.selectionStart,z=this.textArea.selectionEnd;this.textArea.setSelectionRange(R,z)}}catch(Oe){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ce}(ee.Component),Y=Z,Se=function(de){Object(he.a)(ce,de);var Le=Object(ue.a)(ce);function ce(me){var R;Object(Ce.a)(this,ce),R=Le.call(this,me),R.resizableTextArea=void 0,R.focus=function(){R.resizableTextArea.textArea.focus()},R.saveTextArea=function(Oe){R.resizableTextArea=Oe},R.handleChange=function(Oe){var We=R.props.onChange;R.setValue(Oe.target.value,function(){R.resizableTextArea.resizeTextarea()}),We&&We(Oe)},R.handleKeyDown=function(Oe){var We=R.props,Ze=We.onPressEnter,He=We.onKeyDown;Oe.keyCode===13&&Ze&&Ze(Oe),He&&He(Oe)};var z=typeof me.value=="undefined"||me.value===null?me.defaultValue:me.value;return R.state={value:z},R}return Object(H.a)(ce,[{key:"setValue",value:function(R,z){"value"in this.props||this.setState({value:R},z)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return ee.createElement(Y,Object(M.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(R){return"value"in R?{value:R.value}:null}}]),ce}(ee.Component),je=Ye.default=Se},ZW9T:function(ht,Ye,w){"use strict";w.d(Ye,"a",function(){return Ie});var M=w("k1fw"),Ce=w("miYZ"),H=w("tsqr"),he=w("rAM+"),ue=w("tJVT"),ee=w("PpiC"),O=w("q1tI"),S=w.n(O),C=w("bdgK");function ie($,ne,_e,q,Q){var ge=ne.getWordUntilPosition(_e),J={startLineNumber:_e.lineNumber,endLineNumber:_e.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},v=q.map(function(U){return{label:U,kind:$.languages.CompletionItemKind.Keyword,insertText:U,insertTextRules:$.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:J}});return Q.map(function(U){v.push(Object(M.a)(Object(M.a)({},U),{},{range:J}))}),v}var j=function($){var ne={label:"ifelse",kind:$.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`),insertTextRules:$.languages.CompletionItemInsertTextRule.InsertAsSnippet},_e=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];$.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(J,v){var U=ie($,J,v,_e,[ne]);return{suggestions:U}}});var q=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];$.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(J,v){var U=[{label:"print",kind:$.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
`),insertTextRules:$.languages.CompletionItemInsertTextRule.InsertAsSnippet}],P=ie($,J,v,q,U);return{suggestions:P}}});var Q=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];$.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(J,v){var U=[ne,{label:"main",kind:$.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
`),insertTextRules:$.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:$.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
`),insertTextRules:$.languages.CompletionItemInsertTextRule.InsertAsSnippet}],P=ie($,J,v,Q,U);return{suggestions:P}}})},G="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",le=w("LvDl");function B($){return/^\d+$/.test($)?"".concat($,"px"):$}function D(){}var L=!1,T={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function X(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ne=$;if(Array.isArray($)){for(var _e=0;_e<$.length;_e++){var q=T[$[_e]];if(q)return q}return ne[0]}return T[ne]||ne}var V=null,be=Ye.b=function($){var ne=$.width,_e=ne===void 0?"100%":ne,q=$.height,Q=q===void 0?"100%":q,ge=$.value,J=$.language,v=J===void 0?"javascript":J,U=$.style,P=U===void 0?{}:U,b=$.options,F=b===void 0?{}:b,ae=$.overrideServices,W=ae===void 0?{}:ae,Ee=$.theme,m=Ee===void 0?"vs-dark":Ee,c=$.onEditBlur,_=$.onSave,Z=$.autoHeight,Y=Z===void 0?!1:Z,Se=$.forbidCopy,je=Se===void 0?!1:Se,de=$.onChange,Le=de===void 0?D:de,ce=$.editorDidMount,me=ce===void 0?D:ce,R=$.onFocus,z=R===void 0?D:R,Oe=$.filename,We=Oe===void 0?"educoder.txt":Oe,Ze=Object(ee.a)($,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),He=Object(O.useRef)(),Be=Object(O.useRef)({}),ve=Object(O.useRef)(),we=Object(O.useRef)(!1),De=Object(O.useRef)(),Ne=Object(O.useState)(!1),Ae=Object(ue.a)(Ne,2),oe=Ae[0],ye=Ae[1];function ze(){var h;return He.current&&(h=new C.default(function(p){var N=Object(he.a)(p),K;try{for(N.s();!(K=N.n()).done;){var pe=K.value;(pe.target.offsetHeight>0||pe.target.offsetWidth>0)&&Be.current.instance.layout()}}catch(tt){N.e(tt)}finally{N.f()}}),h.observe(He.current)),h}function Ge(){H.b.warn(decodeURIComponent(G))}var Ve=function(){var p=Be.current.instance;if(ge!=null&&p&&oe){var N=p.getModel();N&&ge!==N.getValue()&&(L=!0,N.setValue(ge),p.layout(),L=!1)}};Object(O.useEffect)(function(){ve.current&&clearTimeout(ve.current),ve.current=setTimeout(function(){Ve()},500)},[ge,oe,Be.current]);function Fe(){var h=Be.current.instance;if(h){var p=h.getSelection(),N=Be.current.pastePos||{},K=new V.Range(N.startLineNumber||p.endLineNumber,N.startColumn||p.endColumn,N.endLineNumber||p.endLineNumber,N.endColumn||p.endColumn);setTimeout(function(){h.executeEdits("",[{range:K,text:""}])},300)}}function it(h){(window.navigator.platform.match("Mac")?h.metaKey:h.ctrlKey)&&h.keyCode==83&&(h.preventDefault(),_())}var qe=function(){if(Y&&Be.current.instance){var p=Be.current.instance.getContentHeight();d(p<Q?Q:p)}else d(Q)};function $e(h){var p=document.createEvent("MouseEvents");p.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),h.dispatchEvent(p)}function re(h,p){var N=window.URL||window.webkitURL||window,K=new Blob([p]),pe=document.createElementNS("http://www.w3.org/1999/xhtml","a");pe.href=N.createObjectURL(K),pe.download=h,$e(pe)}Object(O.useEffect)(function(){qe()},[qe]),Object(O.useEffect)(function(){He.current&&!oe&&w.e(26).then(w.t.bind(null,"M/lh",7)).then(function(h){try{V=h,Be.current.instance=V.editor.create(He.current,{value:ge,language:X(v),theme:m,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},W);var p=Be.current.instance;if(me(p,V),setTimeout(function(){qe(),Be.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){re(We||"educoder.txt",p.getValue())}})},500),Be.current.subscription=p.onDidChangeModelContent(function(K){we.current?clearTimeout(De.current):(qe(),Le(p.getValue(),K)),De.current=setTimeout(function(){we.current=!1},500)}),window.Monaco||j(V),je&&(p.addCommand(V.KeyMod.CtrlCmd|V.KeyMod.Shift|V.KeyCode.KEY_V,function(){return Ge(),null}),p.addCommand(V.KeyMod.CtrlCmd|V.KeyCode.KEY_C,function(){return Ge(),null})),window.Monaco=V,c&&p.onDidBlurEditorWidget(function(){c(p.getValue())}),z&&p.onDidFocusEditorText(function(){z(p.getValue())}),je){p.addCommand(V.KeyMod.CtrlCmd|V.KeyCode.KEY_V,function(){return Ge(),null}),p.onDidPaste(function(K){Be.current.pastePos=K});try{window.addEventListener("paste",Fe)}catch(K){}}var N=ze();return ye(!0),function(){var K=Be.current.instance;K.dispose();var pe=K.getModel();pe&&pe.dispose(),Be.current.subscription&&Be.current.subscription.dispose(),je&&window.removeEventListener("paste",Fe),N.unobserve(He.current)}}catch(K){}})},[]),Object(O.useEffect)(function(){var h=Be.current.instance;if(h&&oe)return document.addEventListener("keydown",it,!1),function(){document.removeEventListener("keydown",it)}},[_,oe]),Object(O.useEffect)(function(){var h=Be.current.instance;if(h&&oe){var p=X(v);V.editor.setModelLanguage(h.getModel(),p),console.log("language:",v,h.getModel(),p)}},[v,oe]),Object(O.useEffect)(function(){var h=Be.current.instance;h&&oe&&V.editor.setTheme(m)},[m,oe]),Object(O.useEffect)(function(){var h=Be.current.instance;h&&oe&&(h.updateOptions(Object(M.a)({},F)),setTimeout(function(){h.getModel().updateOptions(Object(M.a)({},F))},200))},[JSON.stringify(F),oe]),Object(O.useEffect)(function(){var h=Be.current.instance;h&&oe&&h.layout()},[_e,Q,oe]);var nt=Object(O.useState)(B(_e)),Xe=Object(ue.a)(nt,2),se=Xe[0],Te=Xe[1],y=Object(O.useState)(B(Q)),x=Object(ue.a)(y,2),k=x[0],d=x[1],f=Object(M.a)(Object(M.a)({},P),{},{width:se,height:k});return S.a.createElement("div",{className:"my-monaco-editor",ref:He,style:f})};function Ie($){var ne=$.width,_e=ne===void 0?"100%":ne,q=$.height,Q=q===void 0?"100%":q,ge=$.original,J=$.modified,v=$.language,U=$.options,P=U===void 0?{}:U,b=Object(O.useRef)(),F=Object(O.useState)(null),ae=Object(ue.a)(F,2),W=ae[0],Ee=ae[1];function m(Y){var Se;return b.current&&(Se=new C.default(function(je){var de=Object(he.a)(je),Le;try{for(de.s();!(Le=de.n()).done;){var ce=Le.value;(ce.target.offsetHeight>0||ce.target.offsetWidth>0)&&Y.layout()}}catch(me){de.e(me)}finally{de.f()}}),Se.observe(b.current)),Se}Object(O.useEffect)(function(){b.current&&w.e(26).then(w.t.bind(null,"M/lh",7)).then(function(Y){V=Y;var Se=V.editor.createDiffEditor(b.current,Object(M.a)(Object(M.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},P),{},{wordWrap:!0}));Ee(Se);var je=m(Se);return function(){Se.dispose();var de=Se.getModel();de&&de.dispose(),je.unobserve(b.current)}})},[]),Object(O.useEffect)(function(){W&&W.setModel({original:V.editor.createModel(ge,v),modified:V.editor.createModel(J,v)})},[ge,J,v,W]);var c=B(_e),_=B(Q),Z={width:c,height:_};return S.a.createElement("div",{className:"my-diff-editor",ref:b,style:Z})}},ZpRC:function(ht,Ye,w){"use strict";function M(j){return typeof j=="object"&&j!=null&&j.nodeType===1}function Ce(j,G){return(!G||j!=="hidden")&&j!=="visible"&&j!=="clip"}function H(j,G){if(j.clientHeight<j.scrollHeight||j.clientWidth<j.scrollWidth){var le=getComputedStyle(j,null);return Ce(le.overflowY,G)||Ce(le.overflowX,G)||function(B){var D=function(L){if(!L.ownerDocument||!L.ownerDocument.defaultView)return null;try{return L.ownerDocument.defaultView.frameElement}catch(T){return null}}(B);return!!D&&(D.clientHeight<B.scrollHeight||D.clientWidth<B.scrollWidth)}(j)}return!1}function he(j,G,le,B,D,L,T,X){return L<j&&T>G||L>j&&T<G?0:L<=j&&X<=le||T>=G&&X>=le?L-j-B:T>G&&X<le||L<j&&X>le?T-G+D:0}var ue=function(j,G){var le=window,B=G.scrollMode,D=G.block,L=G.inline,T=G.boundary,X=G.skipOverflowHiddenElements,V=typeof T=="function"?T:function(De){return De!==T};if(!M(j))throw new TypeError("Invalid target");for(var be=document.scrollingElement||document.documentElement,Ie=[],$=j;M($)&&V($);){if(($=$.parentElement)===be){Ie.push($);break}$!=null&&$===document.body&&H($)&&!H(document.documentElement)||$!=null&&H($,X)&&Ie.push($)}for(var ne=le.visualViewport?le.visualViewport.width:innerWidth,_e=le.visualViewport?le.visualViewport.height:innerHeight,q=window.scrollX||pageXOffset,Q=window.scrollY||pageYOffset,ge=j.getBoundingClientRect(),J=ge.height,v=ge.width,U=ge.top,P=ge.right,b=ge.bottom,F=ge.left,ae=D==="start"||D==="nearest"?U:D==="end"?b:U+J/2,W=L==="center"?F+v/2:L==="end"?P:F,Ee=[],m=0;m<Ie.length;m++){var c=Ie[m],_=c.getBoundingClientRect(),Z=_.height,Y=_.width,Se=_.top,je=_.right,de=_.bottom,Le=_.left;if(B==="if-needed"&&U>=0&&F>=0&&b<=_e&&P<=ne&&U>=Se&&b<=de&&F>=Le&&P<=je)return Ee;var ce=getComputedStyle(c),me=parseInt(ce.borderLeftWidth,10),R=parseInt(ce.borderTopWidth,10),z=parseInt(ce.borderRightWidth,10),Oe=parseInt(ce.borderBottomWidth,10),We=0,Ze=0,He="offsetWidth"in c?c.offsetWidth-c.clientWidth-me-z:0,Be="offsetHeight"in c?c.offsetHeight-c.clientHeight-R-Oe:0;if(be===c)We=D==="start"?ae:D==="end"?ae-_e:D==="nearest"?he(Q,Q+_e,_e,R,Oe,Q+ae,Q+ae+J,J):ae-_e/2,Ze=L==="start"?W:L==="center"?W-ne/2:L==="end"?W-ne:he(q,q+ne,ne,me,z,q+W,q+W+v,v),We=Math.max(0,We+Q),Ze=Math.max(0,Ze+q);else{We=D==="start"?ae-Se-R:D==="end"?ae-de+Oe+Be:D==="nearest"?he(Se,de,Z,R,Oe+Be,ae,ae+J,J):ae-(Se+Z/2)+Be/2,Ze=L==="start"?W-Le-me:L==="center"?W-(Le+Y/2)+He/2:L==="end"?W-je+z+He:he(Le,je,Y,me,z+He,W,W+v,v);var ve=c.scrollLeft,we=c.scrollTop;ae+=we-(We=Math.max(0,Math.min(we+We,c.scrollHeight-Z+Be))),W+=ve-(Ze=Math.max(0,Math.min(ve+Ze,c.scrollWidth-Y+He)))}Ee.push({el:c,top:We,left:Ze})}return Ee};function ee(j){return j===Object(j)&&Object.keys(j).length!==0}function O(j,G){G===void 0&&(G="auto");var le="scrollBehavior"in document.body.style;j.forEach(function(B){var D=B.el,L=B.top,T=B.left;D.scroll&&le?D.scroll({top:L,left:T,behavior:G}):(D.scrollTop=L,D.scrollLeft=T)})}function S(j){return j===!1?{block:"end",inline:"nearest"}:ee(j)?j:{block:"start",inline:"nearest"}}function C(j,G){var le=!j.ownerDocument.documentElement.contains(j);if(ee(G)&&typeof G.behavior=="function")return G.behavior(le?[]:ue(j,G));if(le)return;var B=S(G);return O(ue(j,B),B.behavior)}var ie=Ye.a=C},bT9E:function(ht,Ye,w){"use strict";w.d(Ye,"a",function(){return Ce});var M=w("VTBJ");function Ce(H,he){var ue=Object(M.a)({},H);return Array.isArray(he)&&he.forEach(function(ee){delete ue[ee]}),ue}},c5Ni:function(ht,Ye,w){},dejd:function(ht,Ye,w){},dmUQ:function(ht,Ye,w){"use strict";var M=w("Ff2n"),Ce=w("rePB"),H=w("1OyB"),he=w("vuIU"),ue=w("Ji7U"),ee=w("md7G"),O=w("foSv"),S=w("q1tI"),C=w.n(S),ie=w("TSYQ"),j=w.n(ie),G=w("4IlW");function le(J,v){var U=Object.keys(J);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(J);v&&(P=P.filter(function(b){return Object.getOwnPropertyDescriptor(J,b).enumerable})),U.push.apply(U,P)}return U}function B(J){for(var v=1;v<arguments.length;v++){var U=arguments[v]!=null?arguments[v]:{};v%2?le(Object(U),!0).forEach(function(P){Object(Ce.a)(J,P,U[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(J,Object.getOwnPropertyDescriptors(U)):le(Object(U)).forEach(function(P){Object.defineProperty(J,P,Object.getOwnPropertyDescriptor(U,P))})}return J}function D(J){var v=L();return function(){var P=Object(O.a)(J),b;if(v){var F=Object(O.a)(this).constructor;b=Reflect.construct(P,arguments,F)}else b=P.apply(this,arguments);return Object(ee.a)(this,b)}}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(J){return!1}}function T(){}function X(J){J.preventDefault()}var V=function(v){return v.replace(/[^\w.-]+/g,"")},be=200,Ie=600,$=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,ne=function(v){return v!=null},_e=function(v,U){return U===v||typeof U=="number"&&typeof v=="number"&&isNaN(U)&&isNaN(v)},q=function(J){Object(ue.a)(U,J);var v=D(U);function U(P){var b;Object(H.a)(this,U),b=v.call(this,P),b.onKeyDown=function(W){var Ee=b.props,m=Ee.onKeyDown,c=Ee.onPressEnter;if(W.keyCode===G.a.UP){var _=b.getRatio(W);b.up(W,_,null),b.stop()}else if(W.keyCode===G.a.DOWN){var Z=b.getRatio(W);b.down(W,Z,null),b.stop()}else W.keyCode===G.a.ENTER&&c&&c(W);if(b.recordCursorPosition(),b.lastKeyCode=W.keyCode,m){for(var Y=arguments.length,Se=new Array(Y>1?Y-1:0),je=1;je<Y;je++)Se[je-1]=arguments[je];m.apply(void 0,[W].concat(Se))}},b.onKeyUp=function(W){var Ee=b.props.onKeyUp;if(b.stop(),b.recordCursorPosition(),Ee){for(var m=arguments.length,c=new Array(m>1?m-1:0),_=1;_<m;_++)c[_-1]=arguments[_];Ee.apply(void 0,[W].concat(c))}},b.onChange=function(W){var Ee=b.props.onChange;b.state.focused&&(b.inputting=!0),b.rawInput=b.props.parser(b.getValueFromEvent(W)),b.setState({inputValue:b.rawInput}),Ee(b.toNumber(b.rawInput))},b.onMouseUp=function(){var W=b.props.onMouseUp;b.recordCursorPosition(),W&&W.apply(void 0,arguments)},b.onFocus=function(){var W;b.setState({focused:!0}),(W=b.props).onFocus.apply(W,arguments)},b.onBlur=function(){var W=b.props.onBlur;b.inputting=!1,b.setState({focused:!1});var Ee=b.getCurrentValidValue(b.state.inputValue),m=b.setValue(Ee,T);if(W){var c=b.input.value,_=b.getInputDisplayValue({focus:!1,value:m});b.input.value=_&&Number(_),W.apply(void 0,arguments),b.input.value=c}},b.getRatio=function(W){var Ee=1;return W.metaKey||W.ctrlKey?Ee=.1:W.shiftKey&&(Ee=10),Ee},b.getFullNum=function(W){return isNaN(W)?W:/e/i.test(String(W))?Number(W).toFixed(18).replace(/\.?0+$/,""):W},b.getPrecision=function(W){if(ne(b.props.precision))return b.props.precision;var Ee=String(W);if(Ee.indexOf("e-")>=0)return parseInt(Ee.slice(Ee.indexOf("e-")+2),10);var m=0;return Ee.indexOf(".")>=0&&(m=Ee.length-Ee.indexOf(".")-1),m},b.getInputDisplayValue=function(W){var Ee=W||b.state,m=Ee.focused,c=Ee.inputValue,_=Ee.value,Z;m?Z=c:Z=b.toPrecisionAsStep(_),Z==null&&(Z="");var Y=b.formatWrapper(Z);return ne(b.props.decimalSeparator)&&(Y=Y.toString().replace(".",b.props.decimalSeparator)),Y},b.recordCursorPosition=function(){try{b.cursorStart=b.input.selectionStart,b.cursorEnd=b.input.selectionEnd,b.currentValue=b.input.value,b.cursorBefore=b.input.value.substring(0,b.cursorStart),b.cursorAfter=b.input.value.substring(b.cursorEnd)}catch(W){}},b.restoreByAfter=function(W){if(W===void 0)return!1;var Ee=b.input.value,m=Ee.lastIndexOf(W);if(m===-1)return!1;var c=b.cursorBefore.length;return b.lastKeyCode===G.a.DELETE&&b.cursorBefore.charAt(c-1)===W[0]?(b.fixCaret(c,c),!0):m+W.length===Ee.length?(b.fixCaret(m,m),!0):!1},b.partRestoreByAfter=function(W){return W===void 0?!1:Array.prototype.some.call(W,function(Ee,m){var c=W.substring(m);return b.restoreByAfter(c)})},b.isNotCompleteNumber=function(W){return isNaN(W)||W===""||W===null||W&&W.toString().indexOf(".")===W.toString().length-1},b.stop=function(){b.autoStepTimer&&clearTimeout(b.autoStepTimer)},b.down=function(W,Ee,m){b.pressingUpOrDown=!0,b.step("down",W,Ee,m)},b.up=function(W,Ee,m){b.pressingUpOrDown=!0,b.step("up",W,Ee,m)},b.saveInput=function(W){b.input=W};var F=P.value;F===void 0&&(F=P.defaultValue),b.state={focused:P.autoFocus};var ae=b.getValidValue(b.toNumber(F));return b.state=B(B({},b.state),{},{inputValue:b.toPrecisionAsStep(ae),value:ae}),b}return Object(he.a)(U,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(b){var F=this.props,ae=F.value,W=F.onChange,Ee=F.max,m=F.min,c=this.state.focused;if(b){if(!_e(b.value,ae)||!_e(b.max,Ee)||!_e(b.min,m)){var _=c?ae:this.getValidValue(ae),Z;this.pressingUpOrDown?Z=_:this.inputting?Z=this.rawInput:Z=this.toPrecisionAsStep(_),this.setState({value:_,inputValue:Z})}var Y="value"in this.props?ae:this.state.value;"max"in this.props&&b.max!==Ee&&typeof Y=="number"&&Y>Ee&&W&&W(Ee),"min"in this.props&&b.min!==m&&typeof Y=="number"&&Y<m&&W&&W(m)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var Se=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===G.a.BACKSPACE?Se=this.cursorStart-1:this.lastKeyCode===G.a.DELETE&&(Se=this.cursorStart):Se=this.input.value.length,this.fixCaret(Se,Se)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case G.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case G.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(je){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(b){var F=b;return F===""?F="":this.isNotCompleteNumber(parseFloat(F))?F=this.state.value:F=this.getValidValue(F),this.toNumber(F)}},{key:"getValueFromEvent",value:function(b){var F=b.target.value.trim().replace(/。/g,".");return ne(this.props.decimalSeparator)&&(F=F.replace(this.props.decimalSeparator,".")),F}},{key:"getValidValue",value:function(b){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,W=parseFloat(b);return isNaN(W)?b:(W<F&&(W=F),W>ae&&(W=ae),W)}},{key:"setValue",value:function(b,F){var ae=this.props.precision,W=this.isNotCompleteNumber(parseFloat(b))?null:parseFloat(b),Ee=this.state.value,m=Ee===void 0?null:Ee,c=this.state.inputValue,_=c===void 0?null:c,Z=typeof W=="number"?W.toFixed(ae):"".concat(W),Y=W!==m||Z!=="".concat(_);return"value"in this.props?(_=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:_},F)):this.setState({value:W,inputValue:this.toPrecisionAsStep(b)},F),Y&&this.props.onChange(W),W}},{key:"getMaxPrecision",value:function(b){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ae=this.props,W=ae.precision,Ee=ae.step;if(ne(W))return W;var m=this.getPrecision(F),c=this.getPrecision(Ee),_=this.getPrecision(b);return b?Math.max(_,m+c):m+c}},{key:"getPrecisionFactor",value:function(b){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ae=this.getMaxPrecision(b,F);return Math.pow(10,ae)}},{key:"focus",value:function(){this.input.focus(),this.recordCursorPosition()}},{key:"blur",value:function(){this.input.blur()}},{key:"select",value:function(){this.input.select()}},{key:"formatWrapper",value:function(b){return this.props.formatter?this.props.formatter(b):b}},{key:"toPrecisionAsStep",value:function(b){if(this.isNotCompleteNumber(b)||b==="")return b;var F=Math.abs(this.getMaxPrecision(b));return isNaN(F)?b.toString():Number(b).toFixed(F)}},{key:"toNumber",value:function(b){var F=this.props.precision,ae=this.state.focused,W=b&&b.length>16&&ae;return this.isNotCompleteNumber(b)||W?b:ne(F)?Math.round(b*Math.pow(10,F))/Math.pow(10,F):Number(b)}},{key:"upStep",value:function(b,F){var ae=this.props.step,W=this.getPrecisionFactor(b,F),Ee=Math.abs(this.getMaxPrecision(b,F)),m=((W*b+W*ae*F)/W).toFixed(Ee);return this.toNumber(m)}},{key:"downStep",value:function(b,F){var ae=this.props.step,W=this.getPrecisionFactor(b,F),Ee=Math.abs(this.getMaxPrecision(b,F)),m=((W*b-W*ae*F)/W).toFixed(Ee);return this.toNumber(m)}},{key:"step",value:function(b,F){var ae=this,W=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,Ee=arguments.length>3?arguments[3]:void 0;this.stop(),F&&(F.persist(),F.preventDefault());var m=this.props;if(m.disabled)return;var c=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(c))return;var _=this["".concat(b,"Step")](c,W),Z=_>m.max||_<m.min;if(_>m.max?_=m.max:_<m.min&&(_=m.min),this.setValue(_,null),this.setState({focused:!0},function(){ae.pressingUpOrDown=!1}),Z)return;this.autoStepTimer=setTimeout(function(){ae[b](F,W,!0)},Ee?be:Ie)}},{key:"fixCaret",value:function(b,F){if(b===void 0||F===void 0||!this.input||!this.input.value)return;try{var ae=this.input.selectionStart,W=this.input.selectionEnd;(b!==ae||F!==W)&&this.input.setSelectionRange(b,F)}catch(Ee){}}},{key:"render",value:function(){var b,F=this.props,ae=F.prefixCls,W=F.disabled,Ee=F.readOnly,m=F.useTouch,c=F.autoComplete,_=F.upHandler,Z=F.downHandler,Y=F.className,Se=F.max,je=F.min,de=F.style,Le=F.title,ce=F.onMouseEnter,me=F.onMouseLeave,R=F.onMouseOver,z=F.onMouseOut,Oe=F.required,We=F.onClick,Ze=F.tabIndex,He=F.type,Be=F.placeholder,ve=F.id,we=F.inputMode,De=F.pattern,Ne=F.step,Ae=F.maxLength,oe=F.autoFocus,ye=F.name,ze=F.onPaste,Ge=F.onInput,Ve=Object(M.a)(F,["prefixCls","disabled","readOnly","useTouch","autoComplete","upHandler","downHandler","className","max","min","style","title","onMouseEnter","onMouseLeave","onMouseOver","onMouseOut","required","onClick","tabIndex","type","placeholder","id","inputMode","pattern","step","maxLength","autoFocus","name","onPaste","onInput"]),Fe=this.state,it=Fe.value,qe=Fe.focused,$e=j()(ae,(b={},Object(Ce.a)(b,Y,!!Y),Object(Ce.a)(b,"".concat(ae,"-disabled"),W),Object(Ce.a)(b,"".concat(ae,"-focused"),qe),b)),re={};Object.keys(Ve).forEach(function(p){(p.substr(0,5)==="data-"||p.substr(0,5)==="aria-"||p==="role")&&(re[p]=Ve[p])});var nt=!Ee&&!W,Xe=this.getInputDisplayValue(null),se=(it||it===0)&&(isNaN(it)||Number(it)>=Se),Te=(it||it===0)&&(isNaN(it)||Number(it)<=je),y=se||W||Ee,x=Te||W||Ee,k=j()("".concat(ae,"-handler"),"".concat(ae,"-handler-up"),Object(Ce.a)({},"".concat(ae,"-handler-up-disabled"),y)),d=j()("".concat(ae,"-handler"),"".concat(ae,"-handler-down"),Object(Ce.a)({},"".concat(ae,"-handler-down-disabled"),x)),f=m?{onTouchStart:y?T:this.up,onTouchEnd:this.stop}:{onMouseDown:y?T:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},h=m?{onTouchStart:x?T:this.down,onTouchEnd:this.stop}:{onMouseDown:x?T:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return C.a.createElement("div",{className:$e,style:de,title:Le,onMouseEnter:ce,onMouseLeave:me,onMouseOver:R,onMouseOut:z,onFocus:function(){return null},onBlur:function(){return null}},C.a.createElement("div",{className:"".concat(ae,"-handler-wrap")},C.a.createElement("span",Object.assign({unselectable:"on"},f,{role:"button","aria-label":"Increase Value","aria-disabled":y,className:k}),_||C.a.createElement("span",{unselectable:"on",className:"".concat(ae,"-handler-up-inner"),onClick:X})),C.a.createElement("span",Object.assign({unselectable:"on"},h,{role:"button","aria-label":"Decrease Value","aria-disabled":x,className:d}),Z||C.a.createElement("span",{unselectable:"on",className:"".concat(ae,"-handler-down-inner"),onClick:X}))),C.a.createElement("div",{className:"".concat(ae,"-input-wrap")},C.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":je,"aria-valuemax":Se,"aria-valuenow":it,required:Oe,type:He,placeholder:Be,onPaste:ze,onClick:We,onMouseUp:this.onMouseUp,className:"".concat(ae,"-input"),tabIndex:Ze,autoComplete:c,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:nt?this.onKeyDown:T,onKeyUp:nt?this.onKeyUp:T,autoFocus:oe,maxLength:Ae,readOnly:Ee,disabled:W,max:Se,min:je,step:Ne,name:ye,title:Le,id:ve,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Xe),pattern:De,inputMode:we,onInput:Ge},re))))}}]),U}(C.a.Component);q.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:$,min:-$,step:1,style:{},onChange:T,onKeyDown:T,onPressEnter:T,onFocus:T,onBlur:T,parser:V,required:!1,autoComplete:"off"};var Q=q,ge=Ye.a=Q},kSUc:function(ht,Ye,w){},lZu9:function(ht,Ye,w){(function(M){M(w("VrN/"),w("1eCo"),w("8EBN"))})(function(M){"use strict";M.defineMode("markdown",function(Ce,H){var he=M.getMode(Ce,"text/html"),ue=he.name=="null";function ee(m){if(M.findModeByName){var c=M.findModeByName(m);c&&(m=c.mime||c.mimes[0])}var _=M.getMode(Ce,m);return _.name=="null"?null:_}H.highlightFormatting===void 0&&(H.highlightFormatting=!1),H.maxBlockquoteDepth===void 0&&(H.maxBlockquoteDepth=0),H.taskLists===void 0&&(H.taskLists=!1),H.strikethrough===void 0&&(H.strikethrough=!1),H.emoji===void 0&&(H.emoji=!1),H.fencedCodeBlockHighlighting===void 0&&(H.fencedCodeBlockHighlighting=!0),H.fencedCodeBlockDefaultMode===void 0&&(H.fencedCodeBlockDefaultMode="text/plain"),H.xml===void 0&&(H.xml=!0),H.tokenTypeOverrides===void 0&&(H.tokenTypeOverrides={});var O={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var S in O)O.hasOwnProperty(S)&&H.tokenTypeOverrides[S]&&(O[S]=H.tokenTypeOverrides[S]);var C=/^([*\-_])(?:\s*\1){2,}\s*$/,ie=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,j=/^\[(x| )\](?=\s)/i,G=H.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,le=/^ {0,3}(?:\={1,}|-{2,})\s*$/,B=/^[^#!\[\]*_\\<>` "'(~:]+/,D=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,L=/^\s*\[[^\]]+?\]:.*$/,T=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,X=" ";function V(m,c,_){return c.f=c.inline=_,_(m,c)}function be(m,c,_){return c.f=c.block=_,_(m,c)}function Ie(m){return!m||!/\S/.test(m.string)}function $(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==_e){var c=ue;if(!c){var _=M.innerMode(he,m.htmlState);c=_.mode.name=="xml"&&_.state.tagStart===null&&!_.state.context&&_.state.tokenize.isInText}c&&(m.f=J,m.block=ne,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function ne(m,c){var _=m.column()===c.indentation,Z=Ie(c.prevLine.stream),Y=c.indentedCode,Se=c.prevLine.hr,je=c.list!==!1,de=(c.listStack[c.listStack.length-1]||0)+3;c.indentedCode=!1;var Le=c.indentation;if(c.indentationDiff===null&&(c.indentationDiff=c.indentation,je)){for(c.list=null;Le<c.listStack[c.listStack.length-1];)c.listStack.pop(),c.listStack.length?c.indentation=c.listStack[c.listStack.length-1]:c.list=!1;c.list!==!1&&(c.indentationDiff=Le-c.listStack[c.listStack.length-1])}var ce=!Z&&!Se&&!c.prevLine.header&&(!je||!Y)&&!c.prevLine.fencedCodeEnd,me=(c.list===!1||Se||Z)&&c.indentation<=de&&m.match(C),R=null;if(c.indentationDiff>=4&&(Y||c.prevLine.fencedCodeEnd||c.prevLine.header||Z))return m.skipToEnd(),c.indentedCode=!0,O.code;if(m.eatSpace())return null;if(_&&c.indentation<=de&&(R=m.match(G))&&R[1].length<=6)return c.quote=0,c.header=R[1].length,c.thisLine.header=!0,H.highlightFormatting&&(c.formatting="header"),c.f=c.inline,Q(c);if(c.indentation<=de&&m.eat(">"))return c.quote=_?1:c.quote+1,H.highlightFormatting&&(c.formatting="quote"),m.eatSpace(),Q(c);if(!me&&!c.setext&&_&&c.indentation<=de&&(R=m.match(ie))){var z=R[1]?"ol":"ul";return c.indentation=Le+m.current().length,c.list=!0,c.quote=0,c.listStack.push(c.indentation),c.em=!1,c.strong=!1,c.code=!1,c.strikethrough=!1,H.taskLists&&m.match(j,!1)&&(c.taskList=!0),c.f=c.inline,H.highlightFormatting&&(c.formatting=["list","list-"+z]),Q(c)}else{if(_&&c.indentation<=de&&(R=m.match(D,!0)))return c.quote=0,c.fencedEndRE=new RegExp(R[1]+"+ *$"),c.localMode=H.fencedCodeBlockHighlighting&&ee(R[2]||H.fencedCodeBlockDefaultMode),c.localMode&&(c.localState=M.startState(c.localMode)),c.f=c.block=q,H.highlightFormatting&&(c.formatting="code-block"),c.code=-1,Q(c);if(c.setext||(!ce||!je)&&!c.quote&&c.list===!1&&!c.code&&!me&&!L.test(m.string)&&(R=m.lookAhead(1))&&(R=R.match(le)))return c.setext?(c.header=c.setext,c.setext=0,m.skipToEnd(),H.highlightFormatting&&(c.formatting="header")):(c.header=R[0].charAt(0)=="="?1:2,c.setext=c.header),c.thisLine.header=!0,c.f=c.inline,Q(c);if(me)return m.skipToEnd(),c.hr=!0,c.thisLine.hr=!0,O.hr;if(m.peek()==="[")return V(m,c,F)}return V(m,c,c.inline)}function _e(m,c){var _=he.token(m,c.htmlState);if(!ue){var Z=M.innerMode(he,c.htmlState);(Z.mode.name=="xml"&&Z.state.tagStart===null&&!Z.state.context&&Z.state.tokenize.isInText||c.md_inside&&m.current().indexOf(">")>-1)&&(c.f=J,c.block=ne,c.htmlState=null)}return _}function q(m,c){var _=c.listStack[c.listStack.length-1]||0,Z=c.indentation<_,Y=_+3;if(c.fencedEndRE&&c.indentation<=Y&&(Z||m.match(c.fencedEndRE))){H.highlightFormatting&&(c.formatting="code-block");var Se;return Z||(Se=Q(c)),c.localMode=c.localState=null,c.block=ne,c.f=J,c.fencedEndRE=null,c.code=0,c.thisLine.fencedCodeEnd=!0,Z?be(m,c,c.block):Se}else return c.localMode?c.localMode.token(m,c.localState):(m.skipToEnd(),O.code)}function Q(m){var c=[];if(m.formatting){c.push(O.formatting),typeof m.formatting=="string"&&(m.formatting=[m.formatting]);for(var _=0;_<m.formatting.length;_++)c.push(O.formatting+"-"+m.formatting[_]),m.formatting[_]==="header"&&c.push(O.formatting+"-"+m.formatting[_]+"-"+m.header),m.formatting[_]==="quote"&&(!H.maxBlockquoteDepth||H.maxBlockquoteDepth>=m.quote?c.push(O.formatting+"-"+m.formatting[_]+"-"+m.quote):c.push("error"))}if(m.taskOpen)return c.push("meta"),c.length?c.join(" "):null;if(m.taskClosed)return c.push("property"),c.length?c.join(" "):null;if(m.linkHref?c.push(O.linkHref,"url"):(m.strong&&c.push(O.strong),m.em&&c.push(O.em),m.strikethrough&&c.push(O.strikethrough),m.emoji&&c.push(O.emoji),m.linkText&&c.push(O.linkText),m.code&&c.push(O.code),m.image&&c.push(O.image),m.imageAltText&&c.push(O.imageAltText,"link"),m.imageMarker&&c.push(O.imageMarker)),m.header&&c.push(O.header,O.header+"-"+m.header),m.quote&&(c.push(O.quote),!H.maxBlockquoteDepth||H.maxBlockquoteDepth>=m.quote?c.push(O.quote+"-"+m.quote):c.push(O.quote+"-"+H.maxBlockquoteDepth)),m.list!==!1){var Z=(m.listStack.length-1)%3;Z?Z===1?c.push(O.list2):c.push(O.list3):c.push(O.list1)}return m.trailingSpaceNewLine?c.push("trailing-space-new-line"):m.trailingSpace&&c.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),c.length?c.join(" "):null}function ge(m,c){return m.match(B,!0)?Q(c):void 0}function J(m,c){var _=c.text(m,c);if(typeof _!="undefined")return _;if(c.list)return c.list=null,Q(c);if(c.taskList){var Z=m.match(j,!0)[1]===" ";return Z?c.taskOpen=!0:c.taskClosed=!0,H.highlightFormatting&&(c.formatting="task"),c.taskList=!1,Q(c)}if(c.taskOpen=!1,c.taskClosed=!1,c.header&&m.match(/^#+$/,!0))return H.highlightFormatting&&(c.formatting="header"),Q(c);var Y=m.next();if(c.linkTitle){c.linkTitle=!1;var Se=Y;Y==="("&&(Se=")"),Se=(Se+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var je="^\\s*(?:[^"+Se+"\\\\]+|\\\\\\\\|\\\\.)"+Se;if(m.match(new RegExp(je),!0))return O.linkHref}if(Y==="`"){var de=c.formatting;H.highlightFormatting&&(c.formatting="code"),m.eatWhile("`");var Le=m.current().length;if(c.code==0&&(!c.quote||Le==1))return c.code=Le,Q(c);if(Le==c.code){var ce=Q(c);return c.code=0,ce}else return c.formatting=de,Q(c)}else if(c.code)return Q(c);if(Y==="\\"&&(m.next(),H.highlightFormatting)){var me=Q(c),R=O.formatting+"-escape";return me?me+" "+R:R}if(Y==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return c.imageMarker=!0,c.image=!0,H.highlightFormatting&&(c.formatting="image"),Q(c);if(Y==="["&&c.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return c.imageMarker=!1,c.imageAltText=!0,H.highlightFormatting&&(c.formatting="image"),Q(c);if(Y==="]"&&c.imageAltText){H.highlightFormatting&&(c.formatting="image");var me=Q(c);return c.imageAltText=!1,c.image=!1,c.inline=c.f=U,me}if(Y==="["&&!c.image)return c.linkText&&m.match(/^.*?\]/)||(c.linkText=!0,H.highlightFormatting&&(c.formatting="link")),Q(c);if(Y==="]"&&c.linkText){H.highlightFormatting&&(c.formatting="link");var me=Q(c);return c.linkText=!1,c.inline=c.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?U:J,me}if(Y==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){c.f=c.inline=v,H.highlightFormatting&&(c.formatting="link");var me=Q(c);return me?me+=" ":me="",me+O.linkInline}if(Y==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){c.f=c.inline=v,H.highlightFormatting&&(c.formatting="link");var me=Q(c);return me?me+=" ":me="",me+O.linkEmail}if(H.xml&&Y==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var z=m.string.indexOf(">",m.pos);if(z!=-1){var Oe=m.string.substring(m.start,z);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Oe)&&(c.md_inside=!0)}return m.backUp(1),c.htmlState=M.startState(he),be(m,c,_e)}if(H.xml&&Y==="<"&&m.match(/^\/\w*?>/))return c.md_inside=!1,"tag";if(Y==="*"||Y==="_"){for(var We=1,Ze=m.pos==1?" ":m.string.charAt(m.pos-2);We<3&&m.eat(Y);)We++;var He=m.peek()||" ",Be=!/\s/.test(He)&&(!T.test(He)||/\s/.test(Ze)||T.test(Ze)),ve=!/\s/.test(Ze)&&(!T.test(Ze)||/\s/.test(He)||T.test(He)),we=null,De=null;if(We%2&&(!c.em&&Be&&(Y==="*"||!ve||T.test(Ze))?we=!0:c.em==Y&&ve&&(Y==="*"||!Be||T.test(He))&&(we=!1)),We>1&&(!c.strong&&Be&&(Y==="*"||!ve||T.test(Ze))?De=!0:c.strong==Y&&ve&&(Y==="*"||!Be||T.test(He))&&(De=!1)),De!=null||we!=null){H.highlightFormatting&&(c.formatting=we==null?"strong":De==null?"em":"strong em"),we===!0&&(c.em=Y),De===!0&&(c.strong=Y);var ce=Q(c);return we===!1&&(c.em=!1),De===!1&&(c.strong=!1),ce}}else if(Y===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return Q(c);m.backUp(1)}if(H.strikethrough){if(Y==="~"&&m.eatWhile(Y)){if(c.strikethrough){H.highlightFormatting&&(c.formatting="strikethrough");var ce=Q(c);return c.strikethrough=!1,ce}else if(m.match(/^[^\s]/,!1))return c.strikethrough=!0,H.highlightFormatting&&(c.formatting="strikethrough"),Q(c)}else if(Y===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return Q(c);m.backUp(2)}}if(H.emoji&&Y===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){c.emoji=!0,H.highlightFormatting&&(c.formatting="emoji");var Ne=Q(c);return c.emoji=!1,Ne}return Y===" "&&(m.match(/^ +$/,!1)?c.trailingSpace++:c.trailingSpace&&(c.trailingSpaceNewLine=!0)),Q(c)}function v(m,c){var _=m.next();if(_===">"){c.f=c.inline=J,H.highlightFormatting&&(c.formatting="link");var Z=Q(c);return Z?Z+=" ":Z="",Z+O.linkInline}return m.match(/^[^>]+/,!0),O.linkInline}function U(m,c){if(m.eatSpace())return null;var _=m.next();return _==="("||_==="["?(c.f=c.inline=b(_==="("?")":"]"),H.highlightFormatting&&(c.formatting="link-string"),c.linkHref=!0,Q(c)):"error"}var P={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function b(m){return function(c,_){var Z=c.next();if(Z===m){_.f=_.inline=J,H.highlightFormatting&&(_.formatting="link-string");var Y=Q(_);return _.linkHref=!1,Y}return c.match(P[m]),_.linkHref=!0,Q(_)}}function F(m,c){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(c.f=ae,m.next(),H.highlightFormatting&&(c.formatting="link"),c.linkText=!0,Q(c)):V(m,c,J)}function ae(m,c){if(m.match(/^\]:/,!0)){c.f=c.inline=W,H.highlightFormatting&&(c.formatting="link");var _=Q(c);return c.linkText=!1,_}return m.match(/^([^\]\\]|\\.)+/,!0),O.linkText}function W(m,c){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?c.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),c.f=c.inline=J,O.linkHref+" url")}var Ee={startState:function(){return{f:ne,prevLine:{stream:null},thisLine:{stream:null},block:ne,htmlState:null,indentation:0,inline:J,text:ge,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&M.copyState(he,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?M.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,c){if(c.formatting=!1,m!=c.thisLine.stream){if(c.header=0,c.hr=!1,m.match(/^\s*$/,!0))return $(c),null;if(c.prevLine=c.thisLine,c.thisLine={stream:m},c.taskList=!1,c.trailingSpace=0,c.trailingSpaceNewLine=!1,!c.localState&&(c.f=c.block,c.f!=_e)){var _=m.match(/^\s*/,!0)[0].replace(/\t/g,X).length;if(c.indentation=_,c.indentationDiff=null,_>0)return null}}return c.f(m,c)},innerMode:function(m){return m.block==_e?{state:m.htmlState,mode:he}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:Ee}},indent:function(m,c,_){return m.block==_e&&he.indent?he.indent(m.htmlState,c,_):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,c,_):M.Pass},blankLine:$,getType:Q,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ee},"xml"),M.defineMIME("text/markdown","markdown"),M.defineMIME("text/x-markdown","markdown")})},osHv:function(ht,Ye,w){(function(M){M(w("VrN/"))})(function(M){"use strict";var Ce=M.Pos;function H(T,X){return T.line-X.line||T.ch-X.ch}var he="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ue=he+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",ee=new RegExp("<(/?)(["+he+"]["+ue+"]*)","g");function O(T,X,V,be){this.line=X,this.ch=V,this.cm=T,this.text=T.getLine(X),this.min=be?Math.max(be.from,T.firstLine()):T.firstLine(),this.max=be?Math.min(be.to-1,T.lastLine()):T.lastLine()}function S(T,X){var V=T.cm.getTokenTypeAt(Ce(T.line,X));return V&&/\btag\b/.test(V)}function C(T){return T.line>=T.max?void 0:(T.ch=0,T.text=T.cm.getLine(++T.line),!0)}function ie(T){return T.line<=T.min?void 0:(T.text=T.cm.getLine(--T.line),T.ch=T.text.length,!0)}function j(T){for(;;){var X=T.text.indexOf(">",T.ch);if(X==-1){if(C(T))continue;return}if(!S(T,X+1)){T.ch=X+1;continue}var V=T.text.lastIndexOf("/",X),be=V>-1&&!/\S/.test(T.text.slice(V+1,X));return T.ch=X+1,be?"selfClose":"regular"}}function G(T){for(;;){var X=T.ch?T.text.lastIndexOf("<",T.ch-1):-1;if(X==-1){if(ie(T))continue;return}if(!S(T,X+1)){T.ch=X;continue}ee.lastIndex=X,T.ch=X;var V=ee.exec(T.text);if(V&&V.index==X)return V}}function le(T){for(;;){ee.lastIndex=T.ch;var X=ee.exec(T.text);if(!X){if(C(T))continue;return}if(!S(T,X.index+1)){T.ch=X.index+1;continue}return T.ch=X.index+X[0].length,X}}function B(T){for(;;){var X=T.ch?T.text.lastIndexOf(">",T.ch-1):-1;if(X==-1){if(ie(T))continue;return}if(!S(T,X+1)){T.ch=X;continue}var V=T.text.lastIndexOf("/",X),be=V>-1&&!/\S/.test(T.text.slice(V+1,X));return T.ch=X+1,be?"selfClose":"regular"}}function D(T,X){for(var V=[];;){var be=le(T),Ie,$=T.line,ne=T.ch-(be?be[0].length:0);if(!be||!(Ie=j(T)))return;if(Ie=="selfClose")continue;if(be[1]){for(var _e=V.length-1;_e>=0;--_e)if(V[_e]==be[2]){V.length=_e;break}if(_e<0&&(!X||X==be[2]))return{tag:be[2],from:Ce($,ne),to:Ce(T.line,T.ch)}}else V.push(be[2])}}function L(T,X){for(var V=[];;){var be=B(T);if(!be)return;if(be=="selfClose"){G(T);continue}var Ie=T.line,$=T.ch,ne=G(T);if(!ne)return;if(ne[1])V.push(ne[2]);else{for(var _e=V.length-1;_e>=0;--_e)if(V[_e]==ne[2]){V.length=_e;break}if(_e<0&&(!X||X==ne[2]))return{tag:ne[2],from:Ce(T.line,T.ch),to:Ce(Ie,$)}}}}M.registerHelper("fold","xml",function(T,X){for(var V=new O(T,X.line,0);;){var be=le(V);if(!be||V.line!=X.line)return;var Ie=j(V);if(!Ie)return;if(!be[1]&&Ie!="selfClose"){var $=Ce(V.line,V.ch),ne=D(V,be[2]);return ne&&H(ne.from,$)>0?{from:$,to:ne.from}:null}}}),M.findMatchingTag=function(T,X,V){var be=new O(T,X.line,X.ch,V);if(be.text.indexOf(">")==-1&&be.text.indexOf("<")==-1)return;var Ie=j(be),$=Ie&&Ce(be.line,be.ch),ne=Ie&&G(be);if(!Ie||!ne||H(be,X)>0)return;var _e={from:Ce(be.line,be.ch),to:$,tag:ne[2]};return Ie=="selfClose"?{open:_e,close:null,at:"open"}:ne[1]?{open:L(be,ne[2]),close:_e,at:"close"}:(be=new O(T,$.line,$.ch,V),{open:_e,close:D(be,ne[2]),at:"open"})},M.findEnclosingTag=function(T,X,V,be){for(var Ie=new O(T,X.line,X.ch,V);;){var $=L(Ie,be);if(!$)break;var ne=new O(T,X.line,X.ch,V),_e=D(ne,$.tag);if(_e)return{open:$,close:_e}}},M.scanForClosingTag=function(T,X,V,be){var Ie=new O(T,X.line,X.ch,be?{from:0,to:be}:null);return D(Ie,V)}})},p5ED:function(ht,Ye,w){"use strict";var M=w("+L6B"),Ce=w("2/Rp"),H=w("5Dmo"),he=w("3S7+"),ue=w("k1fw"),ee=w("tJVT"),O=w("q1tI"),S=w.n(O),C=w("vHTk"),ie=w.n(C),j=w("yEEn"),G=w("ZW9T"),le=w("1vsH");Ye.a=function(B){var D=B.name,L=B.data,T=B.theme,X=B.type,V=B.filename,be=B.monacoEditor,Ie=B.className,$=B.style,ne=B.close,_e=B.onClose,q=B.hasMask,Q=Object(O.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ge=Object(ee.a)(Q,2),J=ge[0],v=ge[1],U=Object(O.useState)(""),P=Object(ee.a)(U,2),b=P[0],F=P[1],ae=Object(O.useRef)();V&&(be.filename=V),Object(O.useEffect)(function(){var m,c,_=(m=document.cookie)===null||m===void 0||((c=m.replace(/\s/g,""))===null||c===void 0)?void 0:c.split(";");_==null||_.map(function(Z){var Y=Z.split("=");Y[0]==="_educoder_session"&&F(Y[1])})},[]);var W=function(){if(L.startsWith("http")||L.startsWith("/")){Ee();return}Object(le.x)(V||"educoder",L,V)},Ee=function(){Object(le.v)(V||D,L)};return S.a.createElement("div",{style:Object(ue.a)({},$||{}),className:"".concat(q&&ie.a.bgBlack," ").concat(X?ie.a.wrp:"hide")},ne&&S.a.createElement("div",{className:ie.a.close,ref:ae},S.a.createElement(he.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ae.current}},S.a.createElement("span",{onClick:Ee},S.a.createElement("i",{className:"icon-quxiaozhiding"}))),S.a.createElement(he.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ae.current}},S.a.createElement("span",{className:"",onClick:_e},S.a.createElement("i",{className:"icon-guanbi1"})))),S.a.createElement("div",{className:"".concat(ie.a[Ie]," ").concat(Ie," ").concat(ie.a.monaco," ").concat(X==="txt"?"show":"hide")},X==="txt"&&S.a.createElement(G.b,be)),X==="audio"&&S.a.createElement("audio",{src:"".concat(L!=null&&L.startsWith("/")||(L==null?void 0:L.indexOf("https://"))>-1?L:"data:audio/mp3;base64,").concat(L),autoPlay:!0}),X==="video"&&S.a.createElement(S.a.Fragment,null,L!=null&&L.startsWith("/")?S.a.createElement("video",{controls:!0,src:"".concat(L),autoPlay:!0}):S.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(L),autoPlay:!0})),X==="pdf"&&S.a.createElement("embed",{className:ie.a.embed,src:L}),X==="image"&&S.a.createElement(S.a.Fragment,null,S.a.createElement("img",{src:"".concat(L!=null&&L.startsWith("/")||(L==null?void 0:L.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(L)})),X==="other"&&S.a.createElement("div",null,S.a.createElement(Ce.a,{type:"primary",size:"large",onClick:W},S.a.createElement(j.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(X==="download"||X==="office")&&S.a.createElement(Ce.a,{type:"primary",size:"large",onClick:W},S.a.createElement(j.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ht,Ye,w){},"rAM+":function(ht,Ye,w){"use strict";w.d(Ye,"a",function(){return Ce});var M=w("Qw5x");function Ce(H,he){var ue;if(typeof Symbol=="undefined"||H[Symbol.iterator]==null){if(Array.isArray(H)||(ue=Object(M.a)(H))||he&&H&&typeof H.length=="number"){ue&&(H=ue);var ee=0,O=function(){};return{s:O,n:function(){return ee>=H.length?{done:!0}:{done:!1,value:H[ee++]}},e:function(G){throw G},f:O}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var S=!0,C=!1,ie;return{s:function(){ue=H[Symbol.iterator]()},n:function(){var G=ue.next();return S=G.done,G},e:function(G){C=!0,ie=G},f:function(){try{!S&&ue.return!=null&&ue.return()}finally{if(C)throw ie}}}}},rUJ1:function(ht,Ye){const w=/[&<>"']/,M=/[&<>"']/g,Ce=/[<>"']|&(?!#?\w+;)/,H=/[<>"']|&(?!#?\w+;)/g,he={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ue=q=>he[q];function ee(q,Q){if(Q){if(w.test(q))return q.replace(M,ue)}else if(Ce.test(q))return q.replace(H,ue);return q}const O=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function S(q){return q.replace(O,(Q,ge)=>(ge=ge.toLowerCase(),ge==="colon"?":":ge.charAt(0)==="#"?ge.charAt(1)==="x"?String.fromCharCode(parseInt(ge.substring(2),16)):String.fromCharCode(+ge.substring(1)):""))}const C=/(^|[^\[])\^/g;function ie(q,Q){q=q.source||q,Q=Q||"";const ge={replace:(J,v)=>(v=v.source||v,v=v.replace(C,"$1"),q=q.replace(J,v),ge),getRegex:()=>new RegExp(q,Q)};return ge}const j=/[^\w:]/g,G=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function le(q,Q,ge){if(q){let J;try{J=decodeURIComponent(S(ge)).replace(j,"").toLowerCase()}catch(v){return null}if(J.indexOf("javascript:")===0||J.indexOf("vbscript:")===0||J.indexOf("data:")===0)return null}Q&&!G.test(ge)&&(ge=X(Q,ge));try{ge=encodeURI(ge).replace(/%25/g,"%")}catch(J){return null}return ge}const B={},D=/^[^:]+:\/*[^/]*$/,L=/^([^:]+:)[\s\S]*$/,T=/^([^:]+:\/*[^/]*)[\s\S]*$/;function X(q,Q){B[" "+q]||(D.test(q)?B[" "+q]=q+"/":B[" "+q]=$(q,"/",!0)),q=B[" "+q];const ge=q.indexOf(":")===-1;return Q.substring(0,2)==="//"?ge?Q:q.replace(L,"$1")+Q:Q.charAt(0)==="/"?ge?Q:q.replace(T,"$1")+Q:q+Q}const V={exec:function(){}};function be(q){let Q=1,ge,J;for(;Q<arguments.length;Q++){ge=arguments[Q];for(J in ge)Object.prototype.hasOwnProperty.call(ge,J)&&(q[J]=ge[J])}return q}function Ie(q,Q){const ge=q.replace(/\|/g,(U,P,b)=>{let F=!1,ae=P;for(;--ae>=0&&b[ae]==="\\";)F=!F;return F?"|":" |"}),J=ge.split(/ \|/);let v=0;if(J.length>Q)J.splice(Q);else for(;J.length<Q;)J.push("");for(;v<J.length;v++)J[v]=J[v].trim().replace(/\\\|/g,"|");return J}function $(q,Q,ge){const J=q.length;if(J===0)return"";let v=0;for(;v<J;){const U=q.charAt(J-v-1);if(U===Q&&!ge)v++;else if(U!==Q&&ge)v++;else break}return q.substr(0,J-v)}function ne(q,Q){if(q.indexOf(Q[1])===-1)return-1;const ge=q.length;let J=0,v=0;for(;v<ge;v++)if(q[v]==="\\")v++;else if(q[v]===Q[0])J++;else if(q[v]===Q[1]&&(J--,J<0))return v;return-1}function _e(q){q&&q.sanitize&&!q.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}ht.exports={escape:ee,unescape:S,edit:ie,cleanUrl:le,resolveUrl:X,noopTest:V,merge:be,splitCells:Ie,rtrim:$,findClosingBracket:ne,checkSanitizeDeprecation:_e}},vHTk:function(ht,Ye,w){ht.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);