|
|
|
@@ -1,23 +1,23 @@
|
|
|
|
|
var CM6=(()=>{var Dk=Object.create;var es=Object.defineProperty;var Ik=Object.getOwnPropertyDescriptor;var Bk=Object.getOwnPropertyNames;var Nk=Object.getPrototypeOf,jk=Object.prototype.hasOwnProperty;var zk=(t,e,i)=>e in t?es(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Yk=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}},qk=(t,e)=>{for(var i in e)es(t,i,{get:e[i],enumerable:!0})},bg=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Bk(e))!jk.call(t,r)&&r!==i&&es(t,r,{get:()=>e[r],enumerable:!(n=Ik(e,r))||n.enumerable});return t};var Wk=(t,e,i)=>(i=t!=null?Dk(Nk(t)):{},bg(e||!t||!t.__esModule?es(i,"default",{value:t,enumerable:!0}):i,t)),Vk=t=>bg(es({},"__esModule",{value:!0}),t);var K=(t,e,i)=>zk(t,typeof e!="symbol"?e+"":e,i);var Qk=Yk((CZ,vk)=>{function uk(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let i=t[e],n=typeof i;(n==="object"||n==="function")&&!Object.isFrozen(i)&&uk(i)}),t}var ac=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function dk(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function on(t,...e){let i=Object.create(null);for(let n in t)i[n]=t[n];return e.forEach(function(n){for(let r in n)i[r]=n[r]}),i}var xL="</span>",ok=t=>!!t.scope,kL=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let i=t.split(".");return[`${e}${i.shift()}`,...i.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${e}${t}`},rg=class{constructor(e,i){this.buffer="",this.classPrefix=i.classPrefix,e.walk(this)}addText(e){this.buffer+=dk(e)}openNode(e){if(!ok(e))return;let i=kL(e.scope,{prefix:this.classPrefix});this.span(i)}closeNode(e){ok(e)&&(this.buffer+=xL)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},lk=(t={})=>{let e={children:[]};return Object.assign(e,t),e},sg=class t{constructor(){this.rootNode=lk(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let i=lk({scope:e});this.add(i),this.stack.push(i)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,i){return typeof i=="string"?e.addText(i):i.children&&(e.openNode(i),i.children.forEach(n=>this._walk(e,n)),e.closeNode(i)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(i=>typeof i=="string")?e.children=[e.children.join("")]:e.children.forEach(i=>{t._collapse(i)}))}},og=class extends sg{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,i){let n=e.root;i&&(n.scope=`language:${i}`),this.add(n)}toHTML(){return new rg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Qo(t){return t?typeof t=="string"?t:t.source:null}function pk(t){return Hn("(?=",t,")")}function wL(t){return Hn("(?:",t,")*")}function vL(t){return Hn("(?:",t,")?")}function Hn(...t){return t.map(i=>Qo(i)).join("")}function QL(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function ag(...t){return"("+(QL(t).capture?"":"?:")+t.map(n=>Qo(n)).join("|")+")"}function gk(t){return new RegExp(t.toString()+"|").exec("").length-1}function PL(t,e){let i=t&&t.exec(e);return i&&i.index===0}var $L=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function cg(t,{joinWith:e}){let i=0;return t.map(n=>{i+=1;let r=i,s=Qo(n),o="";for(;s.length>0;){let l=$L.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&i++)}return o}).map(n=>`(${n})`).join(e)}var TL=/\b\B/,Ok="[a-zA-Z]\\w*",hg="[a-zA-Z_]\\w*",mk="\\b\\d+(\\.\\d+)?",bk="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",yk="\\b(0b[01]+)",CL="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",AL=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Hn(e,/.*\b/,t.binary,/\b.*/)),on({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(i,n)=>{i.index!==0&&n.ignoreMatch()}},t)},Po={begin:"\\\\[\\s\\S]",relevance:0},RL={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Po]},EL={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Po]},ML={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|suLine truncated
|
|
|
|
|
https://github.com/highlightjs/highlight.js/issues/2277`),te=P,Y=D),V===void 0&&(V=!0);let re={code:Y,language:te};E("before:highlight",re);let J=re.result?re.result:f(re.language,re.code,V);return J.code=re.code,E("after:highlight",J),J}function f(P,D,V,Y){let te=Object.create(null);function re(B,q){return B.keywords[q]}function J(){if(!H.keywords){Ye.addText(Pe);return}let B=0;H.keywordPatternRe.lastIndex=0;let q=H.keywordPatternRe.exec(Pe),ee="";for(;q;){ee+=Pe.substring(B,q.index);let Se=ii.case_insensitive?q[0].toLowerCase():q[0],He=re(H,Se);if(He){let[yi,_k]=He;if(Ye.addText(ee),ee="",te[Se]=(te[Se]||0)+1,te[Se]<=cX&&(Ao+=_k),yi.startsWith("_"))ee+=q[0];else{let Zk=ii.classNameAliases[yi]||yi;xe(q[0],Zk)}}else ee+=q[0];B=H.keywordPatternRe.lastIndex,q=H.keywordPatternRe.exec(Pe)}ee+=Pe.substring(B),Ye.addText(ee)}function ye(){if(Pe==="")return;let B=null;if(typeof H.subLanguage=="string"){if(!e[H.subLanguage]){Ye.addText(Pe);return}B=f(H.subLanguage,Pe,!0,mg[H.subLanguage]),mg[H.subLanguage]=B._top}else B=d(Pe,H.subLanguage.length?H.subLanguage:null);H.relevance>0&&(Ao+=B.relevance),Ye.__addSublanguage(B._emitter,B.language)}function ce(){H.subLanguage!=null?ye():J(),Pe=""}function xe(B,q){B!==""&&(Ye.startScope(q),Ye.addText(B),Ye.endScope())}function dt(B,q){let ee=1,Se=q.length-1;for(;ee<=Se;){if(!B._emit[ee]){ee++;continue}let He=ii.classNameAliases[B[ee]]||B[ee],yi=q[ee];He?xe(yi,He):(Pe=yi,J(),Pe=""),ee++}}function Nt(B,q){return B.scope&&typeof B.scope=="string"&&Ye.openNode(ii.classNameAliases[B.scope]||B.scope),B.beginScope&&(B.beginScope._wrap?(xe(Pe,ii.classNameAliases[B.beginScope._wrap]||B.beginScope._wrap),Pe=""):B.beginScope._multi&&(dt(B.beginScope,q),Pe="")),H=Object.create(B,{parent:{value:H}}),H}function Jr(B,q,ee){let Se=PL(B.endRe,ee);if(Se){if(B["on:end"]){let He=new ac(B);B["on:end"](q,He),He.isMatchIgnored&&(Se=!1)}if(Se){for(;B.endsParent&&B.parent;)B=B.parent;return B}}if(B.endsWithParent)return Jr(B.parent,q,ee)}function To(B){return H.matcher.regexIndex===0?(Pe+=B[0],1):(Oc=!0,0)}function Ek(B){let q=B[0],ee=B.rule,Se=new ac(ee),He=[ee.__beforeBegin,ee["on:begin"]];for(let yi of He)if(yi&&(yi(B,Se),Se.isMatchIgnored))return To(q);return ee.skip?Pe+=q:(ee.excludeBegin&&(Pe+=q),ce(),!ee.returnBegin&&!ee.excludeBegin&&(Pe=q)),Nt(ee,B),ee.returnBegin?0:q.length}function Mk(B){let q=B[0],ee=D.substring(B.index),Se=Jr(H,B,ee);if(!Se)return fk;let He=H;H.endScope&&H.endScope._wrap?(ce(),xe(q,H.endScope._wrap)):H.endScope&&H.endScope._multi?(ce(),dt(H.endScope,B)):He.skip?Pe+=q:(He.returnEnd||He.excludeEnd||(Pe+=q),ce(),He.excludeEnd&&(Pe=q));do H.scope&&Ye.closeNode(),!H.skip&&!H.subLanguage&&(Ao+=H.relevance),H=H.parent;while(H!==Se.parent);return Se.starts&&Nt(Se.starts,B),He.returnEnd?0:q.length}function Lk(){let B=[];for(let q=H;q!==ii;q=q.parent)q.scope&&B.unshift(q.scope);B.forEach(q=>Ye.openNode(q))}let Co={};function Og(B,q){let ee=q&&q[0];if(Pe+=B,ee==null)return ce(),0;if(Co.type==="begin"&&q.type==="end"&&Co.index===q.index&&ee===""){if(Pe+=D.slice(q.index,q.index+1),!r){let Se=new Error(`0 width match regex (${P})`);throw Se.languageName=P,Se.badRule=Co.rule,Se}return 1}if(Co=q,q.type==="begin")return Ek(q);if(q.type==="illegal"&&!V){let Se=new Error('Illegal lexeme "'+ee+'" for mode "'+(H.scope||"<unnamed>")+'"');throw Se.mode=H,Se}else if(q.type==="end"){let Se=Mk(q);if(Se!==fk)return Se}if(q.type==="illegal"&&ee==="")return Pe+=`
|
|
|
|
|
`,1;if(gc>1e5&&gc>q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=ee,ee.length}let ii=C(P);if(!ii)throw Fn(s.replace("{}",P)),new Error('Unknown language: "'+P+'"');let Xk=oX(ii),pc="",H=Y||Xk,mg={},Ye=new l.__emitter(l);Lk();let Pe="",Ao=0,ln=0,gc=0,Oc=!1;try{if(ii.__emitTokens)ii.__emitTokens(D,Ye);else{for(H.matcher.considerAll();;){gc++,Oc?Oc=!1:H.matcher.considerAll(),H.matcher.lastIndex=ln;let B=H.matcher.exec(D);if(!B)break;let q=D.substring(ln,B.index),ee=Og(q,B);ln=B.index+ee}Og(D.substring(ln))}return Ye.finalize(),pc=Ye.toHTML(),{language:P,value:pc,relevance:Ao,illegal:!1,_emitter:Ye,_top:H}}catch(B){if(B.message&&B.message.includes("Illegal"))return{language:P,value:ng(D),illegal:!0,relevance:0,_illegalBy:{message:B.message,index:ln,context:D.slice(ln-100,ln+100),mode:B.mode,resultSoFar:pc},_emitter:Ye};if(r)return{language:P,value:ng(D),illegal:!1,relevance:0,errorRaised:B,_emitter:Ye,_top:H};throw B}}function u(P){let D={value:ng(P),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return D._emitter.addText(P),D}function d(P,D){D=D||l.languages||Object.keys(e);let V=u(P),Y=D.filter(C).filter(N).map(ce=>f(ce,P,!1));Y.unshift(V);let te=Y.sort((ce,xe)=>{if(ce.relevance!==xe.relevance)return xe.relevance-ce.relevance;if(ce.language&&xe.language){if(C(ce.language).supersetOf===xe.language)return 1;if(C(xe.language).supersetOf===ce.language)return-1}return 0}),[re,J]=te,ye=re;return ye.secondBest=J,ye}function p(P,D,V){let Y=D&&i[D]||V;P.classList.add("hljs"),P.classList.add(`language-${Y}`)}function g(P){let D=null,V=h(P);if(a(V))return;if(E("before:highlightElement",{el:P,language:V}),P.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",P);return}if(P.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(P)),l.throwUnescapedHTML))throw new lg("One of your code blocks includes unescaped HTML.",P.innerHTML);D=P;let Y=D.textContent,te=V?c(Y,{language:V,ignoreIllegals:!0}):d(Y);P.innerHTML=te.value,P.dataset.highlighted="yes",p(P,V,te.language),P.result={language:te.language,re:te.relevance,relevance:te.relevance},te.secondBest&&(P.secondBest={language:te.secondBest.language,relevance:te.secondBest.relevance}),E("after:highlightElement",{el:P,result:te,text:Y})}function m(P){l=hk(l,P)}let b=()=>{v(),Hr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){v(),Hr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function v(){function P(){v()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",P,!1),S=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function x(P,D){let V=null;try{V=D(t)}catch(Y){if(Fn("Language definition for '{}' could not be registered.".replace("{}",P)),r)Fn(Y);else throw Y;V=o}V.name||(V.name=P),e[P]=V,V.rawDefinition=D.bind(null,t),V.aliases&&_(V.aliases,{languageName:P})}function w(P){delete e[P];for(let D of Object.keys(i))i[D]===P&&delete i[D]}function k(){return Object.keys(e)}function C(P){return P=(P||"").toLowerCase(),e[P]||e[i[P]]}function _(P,{languageName:D}){typeof P=="string"&&(P=[P]),P.forEach(V=>{i[V.toLowerCase()]=D})}function N(P){let D=C(P);return D&&!D.disableAutodetect}function R(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=D=>{P["before:highlightBlock"](Object.assign({block:D.el},D))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=D=>{P["after:highlightBlock"](Object.assign({block:D.el},D))})}function $(P){R(P),n.push(P)}function j(P){let D=n.indexOf(P);D!==-1&&n.splice(D,1)}function E(P,D){let V=P;n.forEach(function(Y){Y[V]&&Y[V](D)})}function U(P){return Hr("10.7.0","highlightBlock will be removed entirely in v12.0"),Hr("10.7.0","Please use highlightElement now."),g(P)}Object.assign(t,{highlight:c,highlightAuto:d,highlightAll:v,highlightElement:g,highlightBlock:U,configure:m,initHighlighting:b,initHighlightingOnLoad:y,registerLanguage:x,unregisterLanguage:w,listLanguages:k,getLanguage:C,registerAliases:_,autoDetection:N,inherit:hk,addPlugin:$,removePlugin:j}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=aX,t.regex={concat:Hn,lookahead:pk,either:ag,optional:vL,anyNumberOfTimes:wL};for(let P in lc)typeof lc[P]=="object"&&uk(lc[P]);return Object.assign(t,lc),t},Kr=wk({});Kr.newInstance=()=>wk({});vk.exports=Kr;Kr.HighlightJS=Kr;Kr.default=Kr});var EX={};qk(EX,{Compartment:()=>ni,EditorState:()=>he,EditorView:()=>T,HighlightStyle:()=>Vt,MergeView:()=>Ja,StreamLanguage:()=>_s,autocompletion:()=>Fb,baseExtensions:()=>yX,bracketMatching:()=>Rf,closeBrackets:()=>Tu,closeBracketsKeymap:()=>Cu,
Line truncated
|
|
|
|
|
var CM6=(()=>{var Nk=Object.create;var es=Object.defineProperty;var jk=Object.getOwnPropertyDescriptor;var zk=Object.getOwnPropertyNames;var Yk=Object.getPrototypeOf,qk=Object.prototype.hasOwnProperty;var Wk=(t,e,i)=>e in t?es(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Vk=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}},Gk=(t,e)=>{for(var i in e)es(t,i,{get:e[i],enumerable:!0})},mg=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of zk(e))!qk.call(t,r)&&r!==i&&es(t,r,{get:()=>e[r],enumerable:!(n=jk(e,r))||n.enumerable});return t};var Uk=(t,e,i)=>(i=t!=null?Nk(Yk(t)):{},mg(e||!t||!t.__esModule?es(i,"default",{value:t,enumerable:!0}):i,t)),Fk=t=>mg(es({},"__esModule",{value:!0}),t);var K=(t,e,i)=>Wk(t,typeof e!="symbol"?e+"":e,i);var vk=Vk((MZ,wk)=>{function fk(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{let i=t[e],n=typeof i;(n==="object"||n==="function")&&!Object.isFrozen(i)&&fk(i)}),t}var lc=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function uk(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function on(t,...e){let i=Object.create(null);for(let n in t)i[n]=t[n];return e.forEach(function(n){for(let r in n)i[r]=n[r]}),i}var vL="</span>",sk=t=>!!t.scope,QL=(t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let i=t.split(".");return[`${e}${i.shift()}`,...i.map((n,r)=>`${n}${"_".repeat(r+1)}`)].join(" ")}return`${e}${t}`},ng=class{constructor(e,i){this.buffer="",this.classPrefix=i.classPrefix,e.walk(this)}addText(e){this.buffer+=uk(e)}openNode(e){if(!sk(e))return;let i=QL(e.scope,{prefix:this.classPrefix});this.span(i)}closeNode(e){sk(e)&&(this.buffer+=vL)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},ok=(t={})=>{let e={children:[]};return Object.assign(e,t),e},rg=class t{constructor(){this.rootNode=ok(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let i=ok({scope:e});this.add(i),this.stack.push(i)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,i){return typeof i=="string"?e.addText(i):i.children&&(e.openNode(i),i.children.forEach(n=>this._walk(e,n)),e.closeNode(i)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(i=>typeof i=="string")?e.children=[e.children.join("")]:e.children.forEach(i=>{t._collapse(i)}))}},sg=class extends rg{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,i){let n=e.root;i&&(n.scope=`language:${i}`),this.add(n)}toHTML(){return new ng(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function Qo(t){return t?typeof t=="string"?t:t.source:null}function dk(t){return Hn("(?=",t,")")}function PL(t){return Hn("(?:",t,")*")}function $L(t){return Hn("(?:",t,")?")}function Hn(...t){return t.map(i=>Qo(i)).join("")}function TL(t){let e=t[t.length-1];return typeof e=="object"&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}function lg(...t){return"("+(TL(t).capture?"":"?:")+t.map(n=>Qo(n)).join("|")+")"}function pk(t){return new RegExp(t.toString()+"|").exec("").length-1}function CL(t,e){let i=t&&t.exec(e);return i&&i.index===0}var AL=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function ag(t,{joinWith:e}){let i=0;return t.map(n=>{i+=1;let r=i,s=Qo(n),o="";for(;s.length>0;){let l=AL.exec(s);if(!l){o+=s;break}o+=s.substring(0,l.index),s=s.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?o+="\\"+String(Number(l[1])+r):(o+=l[0],l[0]==="("&&i++)}return o}).map(n=>`(${n})`).join(e)}var RL=/\b\B/,gk="[a-zA-Z]\\w*",cg="[a-zA-Z_]\\w*",Ok="\\b\\d+(\\.\\d+)?",mk="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",bk="\\b(0b[01]+)",EL="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ML=(t={})=>{let e=/^#![ ]*\//;return t.binary&&(t.begin=Hn(e,/.*\b/,t.binary,/\b.*/)),on({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(i,n)=>{i.index!==0&&n.ignoreMatch()}},t)},Po={begin:"\\\\[\\s\\S]",relevance:0},LL={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Po]},XL={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Po]},_L={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|suLine truncated
|
|
|
|
|
https://github.com/highlightjs/highlight.js/issues/2277`),te=P,Y=D),V===void 0&&(V=!0);let re={code:Y,language:te};E("before:highlight",re);let J=re.result?re.result:f(re.language,re.code,V);return J.code=re.code,E("after:highlight",J),J}function f(P,D,V,Y){let te=Object.create(null);function re(B,q){return B.keywords[q]}function J(){if(!H.keywords){Ye.addText(Pe);return}let B=0;H.keywordPatternRe.lastIndex=0;let q=H.keywordPatternRe.exec(Pe),ee="";for(;q;){ee+=Pe.substring(B,q.index);let Se=ii.case_insensitive?q[0].toLowerCase():q[0],He=re(H,Se);if(He){let[yi,Ik]=He;if(Ye.addText(ee),ee="",te[Se]=(te[Se]||0)+1,te[Se]<=uX&&(Co+=Ik),yi.startsWith("_"))ee+=q[0];else{let Bk=ii.classNameAliases[yi]||yi;xe(q[0],Bk)}}else ee+=q[0];B=H.keywordPatternRe.lastIndex,q=H.keywordPatternRe.exec(Pe)}ee+=Pe.substring(B),Ye.addText(ee)}function ye(){if(Pe==="")return;let B=null;if(typeof H.subLanguage=="string"){if(!e[H.subLanguage]){Ye.addText(Pe);return}B=f(H.subLanguage,Pe,!0,Og[H.subLanguage]),Og[H.subLanguage]=B._top}else B=d(Pe,H.subLanguage.length?H.subLanguage:null);H.relevance>0&&(Co+=B.relevance),Ye.__addSublanguage(B._emitter,B.language)}function ce(){H.subLanguage!=null?ye():J(),Pe=""}function xe(B,q){B!==""&&(Ye.startScope(q),Ye.addText(B),Ye.endScope())}function dt(B,q){let ee=1,Se=q.length-1;for(;ee<=Se;){if(!B._emit[ee]){ee++;continue}let He=ii.classNameAliases[B[ee]]||B[ee],yi=q[ee];He?xe(yi,He):(Pe=yi,J(),Pe=""),ee++}}function Nt(B,q){return B.scope&&typeof B.scope=="string"&&Ye.openNode(ii.classNameAliases[B.scope]||B.scope),B.beginScope&&(B.beginScope._wrap?(xe(Pe,ii.classNameAliases[B.beginScope._wrap]||B.beginScope._wrap),Pe=""):B.beginScope._multi&&(dt(B.beginScope,q),Pe="")),H=Object.create(B,{parent:{value:H}}),H}function Jr(B,q,ee){let Se=CL(B.endRe,ee);if(Se){if(B["on:end"]){let He=new lc(B);B["on:end"](q,He),He.isMatchIgnored&&(Se=!1)}if(Se){for(;B.endsParent&&B.parent;)B=B.parent;return B}}if(B.endsWithParent)return Jr(B.parent,q,ee)}function $o(B){return H.matcher.regexIndex===0?(Pe+=B[0],1):(gc=!0,0)}function Xk(B){let q=B[0],ee=B.rule,Se=new lc(ee),He=[ee.__beforeBegin,ee["on:begin"]];for(let yi of He)if(yi&&(yi(B,Se),Se.isMatchIgnored))return $o(q);return ee.skip?Pe+=q:(ee.excludeBegin&&(Pe+=q),ce(),!ee.returnBegin&&!ee.excludeBegin&&(Pe=q)),Nt(ee,B),ee.returnBegin?0:q.length}function _k(B){let q=B[0],ee=D.substring(B.index),Se=Jr(H,B,ee);if(!Se)return hk;let He=H;H.endScope&&H.endScope._wrap?(ce(),xe(q,H.endScope._wrap)):H.endScope&&H.endScope._multi?(ce(),dt(H.endScope,B)):He.skip?Pe+=q:(He.returnEnd||He.excludeEnd||(Pe+=q),ce(),He.excludeEnd&&(Pe=q));do H.scope&&Ye.closeNode(),!H.skip&&!H.subLanguage&&(Co+=H.relevance),H=H.parent;while(H!==Se.parent);return Se.starts&&Nt(Se.starts,B),He.returnEnd?0:q.length}function Zk(){let B=[];for(let q=H;q!==ii;q=q.parent)q.scope&&B.unshift(q.scope);B.forEach(q=>Ye.openNode(q))}let To={};function gg(B,q){let ee=q&&q[0];if(Pe+=B,ee==null)return ce(),0;if(To.type==="begin"&&q.type==="end"&&To.index===q.index&&ee===""){if(Pe+=D.slice(q.index,q.index+1),!r){let Se=new Error(`0 width match regex (${P})`);throw Se.languageName=P,Se.badRule=To.rule,Se}return 1}if(To=q,q.type==="begin")return Xk(q);if(q.type==="illegal"&&!V){let Se=new Error('Illegal lexeme "'+ee+'" for mode "'+(H.scope||"<unnamed>")+'"');throw Se.mode=H,Se}else if(q.type==="end"){let Se=_k(q);if(Se!==hk)return Se}if(q.type==="illegal"&&ee==="")return Pe+=`
|
|
|
|
|
`,1;if(pc>1e5&&pc>q.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Pe+=ee,ee.length}let ii=C(P);if(!ii)throw Fn(s.replace("{}",P)),new Error('Unknown language: "'+P+'"');let Dk=cX(ii),dc="",H=Y||Dk,Og={},Ye=new l.__emitter(l);Zk();let Pe="",Co=0,ln=0,pc=0,gc=!1;try{if(ii.__emitTokens)ii.__emitTokens(D,Ye);else{for(H.matcher.considerAll();;){pc++,gc?gc=!1:H.matcher.considerAll(),H.matcher.lastIndex=ln;let B=H.matcher.exec(D);if(!B)break;let q=D.substring(ln,B.index),ee=gg(q,B);ln=B.index+ee}gg(D.substring(ln))}return Ye.finalize(),dc=Ye.toHTML(),{language:P,value:dc,relevance:Co,illegal:!1,_emitter:Ye,_top:H}}catch(B){if(B.message&&B.message.includes("Illegal"))return{language:P,value:ig(D),illegal:!0,relevance:0,_illegalBy:{message:B.message,index:ln,context:D.slice(ln-100,ln+100),mode:B.mode,resultSoFar:dc},_emitter:Ye};if(r)return{language:P,value:ig(D),illegal:!1,relevance:0,errorRaised:B,_emitter:Ye,_top:H};throw B}}function u(P){let D={value:ig(P),illegal:!1,relevance:0,_top:o,_emitter:new l.__emitter(l)};return D._emitter.addText(P),D}function d(P,D){D=D||l.languages||Object.keys(e);let V=u(P),Y=D.filter(C).filter(N).map(ce=>f(ce,P,!1));Y.unshift(V);let te=Y.sort((ce,xe)=>{if(ce.relevance!==xe.relevance)return xe.relevance-ce.relevance;if(ce.language&&xe.language){if(C(ce.language).supersetOf===xe.language)return 1;if(C(xe.language).supersetOf===ce.language)return-1}return 0}),[re,J]=te,ye=re;return ye.secondBest=J,ye}function p(P,D,V){let Y=D&&i[D]||V;P.classList.add("hljs"),P.classList.add(`language-${Y}`)}function g(P){let D=null,V=h(P);if(a(V))return;if(E("before:highlightElement",{el:P,language:V}),P.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",P);return}if(P.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(P)),l.throwUnescapedHTML))throw new og("One of your code blocks includes unescaped HTML.",P.innerHTML);D=P;let Y=D.textContent,te=V?c(Y,{language:V,ignoreIllegals:!0}):d(Y);P.innerHTML=te.value,P.dataset.highlighted="yes",p(P,V,te.language),P.result={language:te.language,re:te.relevance,relevance:te.relevance},te.secondBest&&(P.secondBest={language:te.secondBest.language,relevance:te.secondBest.relevance}),E("after:highlightElement",{el:P,result:te,text:Y})}function m(P){l=ck(l,P)}let b=()=>{v(),Hr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){v(),Hr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let S=!1;function v(){function P(){v()}if(document.readyState==="loading"){S||window.addEventListener("DOMContentLoaded",P,!1),S=!0;return}document.querySelectorAll(l.cssSelector).forEach(g)}function x(P,D){let V=null;try{V=D(t)}catch(Y){if(Fn("Language definition for '{}' could not be registered.".replace("{}",P)),r)Fn(Y);else throw Y;V=o}V.name||(V.name=P),e[P]=V,V.rawDefinition=D.bind(null,t),V.aliases&&_(V.aliases,{languageName:P})}function w(P){delete e[P];for(let D of Object.keys(i))i[D]===P&&delete i[D]}function k(){return Object.keys(e)}function C(P){return P=(P||"").toLowerCase(),e[P]||e[i[P]]}function _(P,{languageName:D}){typeof P=="string"&&(P=[P]),P.forEach(V=>{i[V.toLowerCase()]=D})}function N(P){let D=C(P);return D&&!D.disableAutodetect}function R(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=D=>{P["before:highlightBlock"](Object.assign({block:D.el},D))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=D=>{P["after:highlightBlock"](Object.assign({block:D.el},D))})}function $(P){R(P),n.push(P)}function j(P){let D=n.indexOf(P);D!==-1&&n.splice(D,1)}function E(P,D){let V=P;n.forEach(function(Y){Y[V]&&Y[V](D)})}function U(P){return Hr("10.7.0","highlightBlock will be removed entirely in v12.0"),Hr("10.7.0","Please use highlightElement now."),g(P)}Object.assign(t,{highlight:c,highlightAuto:d,highlightAll:v,highlightElement:g,highlightBlock:U,configure:m,initHighlighting:b,initHighlightingOnLoad:y,registerLanguage:x,unregisterLanguage:w,listLanguages:k,getLanguage:C,registerAliases:_,autoDetection:N,inherit:ck,addPlugin:$,removePlugin:j}),t.debugMode=function(){r=!1},t.safeMode=function(){r=!0},t.versionString=fX,t.regex={concat:Hn,lookahead:dk,either:lg,optional:$L,anyNumberOfTimes:PL};for(let P in oc)typeof oc[P]=="object"&&fk(oc[P]);return Object.assign(t,oc),t},Kr=kk({});Kr.newInstance=()=>kk({});wk.exports=Kr;Kr.HighlightJS=Kr;Kr.default=Kr});var _X={};Gk(_X,{Compartment:()=>ni,EditorState:()=>he,EditorView:()=>T,HighlightStyle:()=>Vt,MergeView:()=>Ka,StreamLanguage:()=>_s,autocompletion:()=>Ub,baseExtensions:()=>kX,bracketMatching:()=>Af,closeBrackets:()=>$u,closeBracketsKeymap:()=>Tu,
Line truncated
|
|
|
|
|
`){[e,i]=ir(this,e,i);let r="";for(let s=0,o=0;s<=i&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=n),e<a&&i>s&&(r+=l.slice(Math.max(0,e-s),i-s)),s=a+1}return r}flatten(e){for(let i of this.text)e.push(i)}scanIdentical(){return 0}static split(e,i){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(i.push(new t(n,r)),n=[],r=-1);return r>-1&&i.push(new t(n,r)),i}},Jn=class t extends ie{constructor(e,i){super(),this.children=e,this.length=i,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,i,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((i?a:l)>=e)return o.lineInner(e,i,n,r);r=l+1,n=a+1}}decompose(e,i,n,r){for(let s=0,o=0;o<=i&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&i>=o){let h=r&((o<=e?1:0)|(a>=i?2:0));o>=e&&a<=i&&!h?n.push(l):l.decompose(e-o,i-o,n,h)}o=a+1}}replace(e,i,n){if([e,i]=ir(this,e,i),n.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&i<=l){let a=o.replace(e-s,i-s,n),h=this.lines-o.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[r]=a,new t(c,this.length-(i-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,i,n)}sliceString(e,i=this.length,n=`
|
|
|
|
|
`){[e,i]=ir(this,e,i);let r="";for(let s=0,o=0;s<this.children.length&&o<=i;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=n),e<a&&i>o&&(r+=l.sliceString(e-o,i-o,n)),o=a+1}return r}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof t))return 0;let n=0,[r,s,o,l]=i>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=i,s+=i){if(r==o||s==l)return n;let a=this.children[r],h=e.children[s];if(a!=h)return n+a.scanIdentical(h,i);n+=a.length+1}}static from(e,i=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new wt(d,i)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>s&&d instanceof t)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof wt&&a&&(p=c[c.length-1])instanceof wt&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new wt(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>r&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:t.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new t(l,i)}};ie.empty=new wt([""],0);function Fk(t){let e=-1;for(let i of t)e+=i.length+1;return e}function Mo(t,e,i=0,n=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=n;s++){let l=t[s],a=r+l.length;a>=i&&(a>n&&(l=l.slice(0,n-r)),r<i&&(l=l.slice(i-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function $g(t,e,i){return Mo(t,[""],e,i)}var hn=class{constructor(e,i=1){this.dir=i,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[i>0?1:(e instanceof wt?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof wt?r.text.length:r.children.length;if(o==(i>0?l:0)){if(n==0)return this.done=!0,this.value="",this;i>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(i>0?0:1)){if(this.offsets[n]+=i,e==0)return this.lineBreak=!0,this.value=`
|
|
|
|
|
`,this;e--}else if(r instanceof wt){let a=r.text[o+(i<0?-1:0)];if(this.offsets[n]+=i,a.length>Math.max(0,e))return this.value=e==0?a:i>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(i<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=i):(i<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(i>0?1:(a instanceof wt?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Lo=class{constructor(e,i,n){this.value="",this.done=!1,this.cursor=new hn(e,i>n?-1:1),this.pos=i>n?e.length:0,this.from=Math.min(i,n),this.to=Math.max(i,n)}nextInner(e,i){if(i<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,i<0?this.pos-this.to:this.from-this.pos);let n=i<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*i,this.value=r.length<=n?r:i<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Xo=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:n,value:r}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol!="undefined"&&(ie.prototype[Symbol.iterator]=function(){return this.iter()},hn.prototype[Symbol.iterator]=Lo.prototype[Symbol.iterator]=Xo.prototype[Symbol.iterator]=function(){return this});var Sc=class{constructor(e,i,n,r){this.from=e,this.to=i,this.number=n,this.text=r}get length(){return this.to-this.from}};function ir(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function Xe(t,e,i=!0,n=!0){return wg(t,e,i,n)}function Hk(t){return t>=56320&&t<57344}function Kk(t){return t>=55296&&t<56320}function We(t,e){let i=t.charCodeAt(e);if(!Kk(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return Hk(n)?(i-55296<<10)+(n-56320)+65536:i}function os(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function vt(t){return t<65536?1:2}var xc=/\r\n?|\n/,De=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(De||(De={})),Si=class t{constructor(e){this.sections=e}get length(){let e=0;for(let i=0;i<this.sections.length;i+=2)e+=this.sections[i];return e}get newLength(){let e=0;for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i+1];e+=n<0?this.sections[i]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let i=0,n=0,r=0;i<this.sections.length;){let s=this.sections[i++],o=this.sections[i++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRanges(e,i=!1){kc(this,e,i)}get invertedDesc(){let e=[];for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];r<0?e.push(n,r):e.push(r,n)}return new t(e)}composeDesc(e){return this.empty?e:e.empty?this:Mg(this,e)}mapDesc(e,i=!1){return e.empty?this:wc(this,e,i)}mapPos(e,i=-1,n=De.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=r+l;if(a<0){if(h>e)return s+(e-r);s+=l}else{if(n!=De.Simple&&h>=e&&(n==De.TrackDel&&r<e&&h>e||n==De.TrackBefore&&r<e||n==De.TrackAfter&&h>e))return null;if(h>e||h==e&&i<0&&!l)return e==r||i<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,i=e){for(let n=0,r=0;n<this.sections.length&&r<=i;){let s=this.sections[n++],o=this.sections[n++],l=r+s;if(o>=0&&r<=i&&l>=e)return r<e&&l>i?"cover":!0;r=l}return!1}toString(){let e="";for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(i=>typeof i!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new t(e)}static create(e){return new t(e)}},qe=class t extends Si{constructor(e,i){super(e),this.inserted=i}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return kc(this,(i,n,r,s,o)=>e=e.replace(r,r+(n-i),o),!1),e}mapDesc(e,i=!1){return wc(this,e,i,!0)}invert(e){let i=this.sections.slice(),n=[];for(let r=0,s=0;r<i.length;r+=2){let o=i[r],l=i[r+1];if(l>=0){i[r]=l,i[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(ie.empty);n.push(o?e.slice(s,s+o):ie.empty)}s+=o}return new t(i,n)}compose(e){return this.empty?e:e.empty?this:Mg(this,e,!0)}map(e,i=!1){return e.empty?this:wc(this,e,i,!0)}iterChanges(e,i=!1){kc(this,e,i)}get desc
Line truncated
|
|
|
|
|
`}get readOnly(){return this.facet(Bg)}phrase(e,...i){for(let n of this.facet(t.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return i.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>i.length?n:i[s-1]})),e}languageDataAt(e,i,n=-1){let r=[];for(let s of this.facet(Xg))for(let o of s(this,i,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return lw(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:i,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=Xe(i,o,!1);if(s(i.slice(a,o))!=ke.Word)break;o=a}for(;l<r;){let a=Xe(i,l);if(s(i.slice(l,a))!=ke.Word)break;l=a}return o==l?null:Q.range(o+n,l+n)}};he.allowMultipleSelections=Qc;he.tabSize=L.define({combine:t=>t.length?t[0]:4});he.lineSeparator=_g;he.readOnly=Bg;he.phrases=L.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(r=>t[r]==e[r])}});he.languageData=Xg;he.changeFilter=Zg;he.transactionFilter=Dg;he.transactionExtender=Ig;ni.reconfigure=W.define();function Ge(t,e,i={}){let n={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(i,s))n[s]=i[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}var jt=class{eq(e){return this==e}range(e,i=e){return rs.create(e,i,this)}};jt.prototype.startSide=jt.prototype.endSide=0;jt.prototype.point=!1;jt.prototype.mapMode=De.TrackDel;var rs=class t{constructor(e,i,n){this.from=e,this.to=i,this.value=n}static create(e,i,n){return new t(e,i,n)}};function Ac(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var Rc=class t{constructor(e,i,n,r){this.from=e,this.to=i,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,i,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,h=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-i;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,i,n,r){for(let s=this.findIndex(i,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,i){let n=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let h=this.value[a],c=this.from[a]+e,f=this.to[a]+e,u,d;if(c==f){let p=i.mapPos(c,h.startSide,h.mapMode);if(p==null||(u=d=p,h.startSide!=h.endSide&&(d=i.mapPos(c,h.endSide),d<u)))continue}else if(u=i.mapPos(c,h.startSide),d=i.mapPos(f,h.endSide),u>d||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),n.push(h),r.push(u-o),s.push(d-o))}return{mapped:n.length?new t(r,s,n,l):null,pos:o}}},se=class t{constructor(e,i,n,r){this.chunkPos=e,this.chunk=i,this.nextLayer=n,this.maxPoint=r}static create(e,i,n,r){return new t(e,i,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let i of this.chunk)e+=i.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:i=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(i.length==0&&!o)return this;if(n&&(i=i.slice().sort(Ac)),this.isEmpty)return i.length?t.of(i):this;let l=new Io(this,null,-1).goto(0),a=0,h=[],c=new Ee;for(;l.value||a<i.length;)if(a<i.length&&(l.from-i[a].from||l.startSide-i[a].value.startSide)>=0){let f=i[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==i.length||this.chunkEnd(l.chunkIndex)<i[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||h.push(rs.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!h.length?t.empty:this.nextLayer.update({add:h,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let i=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],h=e.touchesRange(l,l+a.length);if(h===!1)r=Math.max(r,a.maxPoint),i.push(a),n.push(e.mapPos(l));else if(h===!0){let{mapped:c,pos:f}=a.map(l,e);c&&(r=Math.max(r,c.maxPoint),i.push(c),n.push(f))}}let s=this.nextLayer.map(e);return i.length==0?s:new t(n,i,s||t.empty,r)}between(e,i,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(i>=s&&e<=s+o.length&&o.between(s,e-s,i-s,n)===!1)return}this.nextLayer.between(e,i,n)}}iter(e=0){return ss.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,i=0){return ss.from(e).goto(i)}static compare(e,i,n,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=i.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=Ag(o,l
Line truncated
|
|
|
|
|
`)}static newName(){let e=Yg[zg]||1;return Yg[zg]=e+1,"\u037C"+e.toString(36)}static mount(e,i,n){let r=e[Xc],s=n&&n.nonce;r?s&&r.setNonce(s):r=new _c(e,s),r.mount(Array.isArray(i)?i:[i],e)}},qg=new Map,_c=class{constructor(e,i){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=qg.get(n);if(s)return e[Xc]=s;this.sheet=new r.CSSStyleSheet,qg.set(n,this)}else this.styleTag=n.createElement("style"),i&&this.styleTag.setAttribute("nonce",i);this.modules=[],e[Xc]=this}mount(e,i){let n=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let h=0;h<l.rules.length;h++)n.insertRule(l.rules[h],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(n)i.adoptedStyleSheets.indexOf(this.sheet)<0&&(i.adoptedStyleSheets=[this.sheet,...i.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
|
|
|
|
`;this.styleTag.textContent=o;let l=i.head||i;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var xi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},nr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},cw=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),hw=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(_e=0;_e<10;_e++)xi[48+_e]=xi[96+_e]=String(_e);var _e;for(_e=1;_e<=24;_e++)xi[_e+111]="F"+_e;var _e;for(_e=65;_e<=90;_e++)xi[_e]=String.fromCharCode(_e+32),nr[_e]=String.fromCharCode(_e);var _e;for(No in xi)nr.hasOwnProperty(No)||(nr[No]=xi[No]);var No;function Wg(t){var e=cw&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||hw&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",i=!e&&t.key||(t.shiftKey?nr:xi)[t.keyCode]||t.key||"Unidentified";return i=="Esc"&&(i="Escape"),i=="Del"&&(i="Delete"),i=="Left"&&(i="ArrowLeft"),i=="Up"&&(i="ArrowUp"),i=="Right"&&(i="ArrowRight"),i=="Down"&&(i="ArrowDown"),i}function Oe(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&typeof i=="object"&&i.nodeType==null&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];typeof r=="string"?t.setAttribute(n,r):r!=null&&(t[n]=r)}e++}for(;e<arguments.length;e++)Vg(t,arguments[e]);return t}function Vg(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var i=0;i<e.length;i++)Vg(t,e[i]);else throw new RangeError("Unsupported child node: "+e)}var st=typeof navigator!="undefined"?navigator:{userAgent:"",vendor:"",platform:""},Yc=typeof document!="undefined"?document:{documentElement:{style:{}}},qc=/Edge\/(\d+)/.exec(st.userAgent),_O=/MSIE \d/.test(st.userAgent),Wc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(st.userAgent),yl=!!(_O||Wc||qc),Gg=!yl&&/gecko\/(\d+)/i.test(st.userAgent),Zc=!yl&&/Chrome\/(\d+)/.exec(st.userAgent),Ug="webkitFontSmoothing"in Yc.documentElement.style,Vc=!yl&&/Apple Computer/.test(st.vendor),Fg=Vc&&(/Mobile\/\w+/.test(st.userAgent)||st.maxTouchPoints>2),I={mac:Fg||/Mac/.test(st.platform),windows:/Win/.test(st.platform),linux:/Linux|X11/.test(st.platform),ie:yl,ie_version:_O?Yc.documentMode||6:Wc?+Wc[1]:qc?+qc[1]:0,gecko:Gg,gecko_version:Gg?+(/Firefox\/(\d+)/.exec(st.userAgent)||[0,0])[1]:0,chrome:!!Zc,chrome_version:Zc?+Zc[1]:0,ios:Fg,android:/Android\b/.test(st.userAgent),webkit:Ug,webkit_version:Ug?+(/\bAppleWebKit\/(\d+)/.exec(st.userAgent)||[0,0])[1]:0,safari:Vc,safari_version:Vc?+(/\bVersion\/(\d+(\.\d+)?)/.exec(st.userAgent)||[0,0])[1]:0,tabSize:Yc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function ys(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Gc(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Ko(t,e){if(!e.anchorNode)return!1;try{return Gc(t,e.anchorNode)}catch{return!1}}function cr(t){return t.nodeType==3?gn(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function fs(t,e,i,n){return i?Hg(t,e,i,n,-1)||Hg(t,e,i,n,1):!1}function pn(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function rl(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Hg(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:ai(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=pn(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?ai(t):0}else return!1}}function ai(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function $s(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function fw(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function ZO(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function uw(t,e,i,n,r,Line truncated
|
|
|
|
|
`,r=t.state.doc.line(r.number+(i?1:-1)),s=t.bidiSpans(r),h=t.visualLineSide(r,!i)}if(a){if(!a(c))return l}else{if(!n)return h;a=n(c)}l=h}}function qw(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return s=>{let o=n(s);return r==ke.Space&&(r=o),r==o}}function Ww(t,e,i,n){let r=e.head,s=i?1:-1;if(r==(i?t.state.doc.length:0))return Q.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(r,e.assoc||-1),c=t.documentTop;if(h)o==null&&(o=h.left-a.left),l=s<0?h.top:h.bottom;else{let d=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-d.from))),l=(s<0?d.top:d.bottom)+c}let f=a.left+o,u=n!=null?n:t.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*s,g=gm(t,{x:f,y:p},!1,s);if(p<a.top||p>a.bottom||(s<0?g<r:g>r)){let m=t.docView.coordsForChar(g),b=!m||p<m.top?-1:1;return Q.cursor(g,b,void 0,o)}}}function gs(t,e,i){for(;;){let n=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=n||i||(e-s<o-e?-1:1);e=a<0?s:o,n=a}});if(!n)return e}}function mm(t,e){let i=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let o=gs(t,r.from,0);o!=r.from&&(s=Q.cursor(o,-1))}else{let o=gs(t,r.from,-1),l=gs(t,r.to,1);(o!=r.from||l!=r.to)&&(s=Q.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(i||(i=e.ranges.slice()),i[n]=s)}return i?Q.create(i,e.mainIndex):e}function Ic(t,e,i){let n=gs(t.state.facet(Ts).map(r=>r(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:Q.cursor(n,n<i.from?1:-1)}var as="\uFFFF",rh=class{constructor(e,i){this.points=e,this.text="",this.lineSeparator=i.facet(he.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=as}readRange(e,i){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==i)break;let l=Qe.get(r),a=Qe.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:rl(r))||rl(o)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&!Gw(o,i)&&this.lineBreak(),r=o}return this.findPointBefore(n,i),this}readTextNode(e){let i=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,i.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=i.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(i))&&(s=l.index,o=l[0].length),this.append(i.slice(n,s<0?i.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let i=Qe.get(e),n=i&&i.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,i){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==i&&(n.pos=this.text.length)}findPointInside(e,i){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Vw(e,n.node,n.offset)?i:0))}};function Vw(t,e,i){for(;;){if(!e||i<ai(e))return!1;if(e==t)return!0;i=pn(e)+1,e=e.parentNode}}function Gw(t,e){let i;for(;!(t==e||!t);t=t.nextSibling){let n=Qe.get(t);if(!(n!=null&&n.isWidget||t.cmIgnore))return!1;n&&(i||(i=[])).push(n)}if(i)for(let n of i){let r=n.overrideDOMText;if(r!=null&&r.length)return!1}return!0}var cl=class{constructor(e,i){this.node=e,this.offset=i,this.pos=-1}},sh=class{constructor(e,i,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=i>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&i>-1)this.newSel=null;else if(i>-1&&(this.bounds=e.docView.domBoundsAround(i,n,0))){let l=s||o?[]:Fw(e),a=new rh(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Hw(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!Gc(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Gc(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),c=e.viewport;if((I.ios||I.chrome)&&e.state.selection.main.empty&&a!=h&&(c.from>0||c.to<e.state.doc.length)){let f=Math.min(a,h),u=Math.max(a,h),d=c.from-f,p=c.to-u;(d==0||d==1||f==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,h=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Q.range(h,a)):this.newSel=Q.single(h,a)}}};function bm(t,e){let i,{newSel:n}=e,r=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=r.from,h=null;(s===8||I.android&&e.text.length<l-o)&&(a=r.to,h="end");let c=ym(t.state.doc.sliceString(o,l,as),e.text,a-o,h);c&&(I.chrome&&s==13&&c.toB==c.from+2&&e.text.sl
Line truncated
|
|
|
|
|
`&&t.lineWrapping&&(n&&(n=Q.single(n.main.anchor-1,n.main.head-1)),i={from:r.from,to:r.to,insert:ie.of([" "])}),i)return Ih(t,i,n,s);if(n&&!n.main.eq(r)){let o=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=mm(t.state.facet(Ts).map(a=>a(t)),n))),t.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function Ih(t,e,i,n=-1){if(I.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(I.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ar(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&ar(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ar(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=Uw(t,e,i));return t.state.facet(rm).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function Uw(t,e,i){let n,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,h=a<0?s.from:s.to,c=gs(r.facet(Ts).map(f=>f(t)),h,a);e.from==c&&(o=c)}if(o>-1)n={changes:e,selection:Q.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",h=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let a=r.changes(e),h=i&&i.main.to<=a.newLength?i.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=t.state.sliceDoc(e.from,e.to),f,u=i&&pm(t,i.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=t.state.doc.lineAt(s.head);let d=s.to-e.to;n=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:h||p.map(a)};let g=p.to-d,m=g-c.length;if(t.state.sliceDoc(m,g)!=c||g>=f.from&&m<=f.to)return{range:p};let b=r.changes({from:m,to:g,insert:e.insert}),y=p.to-s.to;return{changes:b,range:h?Q.range(Math.max(0,h.anchor+y),Math.max(0,h.head+y)):p.map(b)}})}else n={changes:a,selection:h&&r.selection.replaceRange(h)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:l,scrollIntoView:!0})}function ym(t,e,i,n){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));i-=o+a-s}if(o<s&&t.length<e.length){let a=i<=s&&i>=o?s-i:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=i<=s&&i>=l?s-i:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function Fw(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}=t.observer.selectionRange;return i&&(e.push(new cl(i,n)),(r!=i||s!=n)&&e.push(new cl(r,s))),e}function Hw(t,e){if(t.length==0)return null;let i=t[0].pos,n=t.length==2?t[1].pos:i;return i>-1&&n>-1?Q.single(i+e,n+e):null}var oh=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,I.safari&&e.contentDOM.addEventListener("input",()=>null),I.gecko&&uv(e.contentDOM.ownerDocument)}handleEvent(e){!rv(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,i){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,i);for(let r of n.handlers){if(i.defaultPrevented)break;if(r(this.view,i)){i.preventDefault();break}}}}ensureHandlers(e){let i=Kw(e),n=this.handlers,r=this.view.contentDOM;for(let s in i)if(s!="scroll"){let o=!i[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListe
Line truncated
|
|
|
|
|
`))};if((I.mac||I.android)&&f.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ie.of([n.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Ih(e,f,Q.single(this.toEditorPos(n.selectionStart,u),this.toEditorPos(n.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(i.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(i.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}i.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(a<h){let c=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(X.mark({attributes:{style:c}}).range(a,h))}}}e.dispatch({effects:cm.of(X.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)i.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=ys(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let i=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,h)=>{if(n)return;let c=h.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(h)){r=this.pendingContextChange=null,i+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(s+=i,o+=i,o<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+h.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=c}i+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){let i=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||i)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:i}=e.selection.main;this.from=Math.max(0,i-1e4),this.to=Math.min(e.doc.length,i+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let i=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(i.from),this.toContextPos(i.from+i.insert.length),e.doc.sliceString(i.from,i.to))}setSelection(e){let{main:i}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,i.anchor))),r=this.toContextPos(i.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:i}=e.selection.main;return!(this.from>0&&i-this.from<500||this.to<e.doc.length&&this.to-i<500||this.to-this.from>1e4*3)}toEditorPos(e,i=this.to-this.from){e=Math.min(e,i);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let i=this.composing;return i&&i.drifted?i.contextBase+(e-i.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},T=class t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var i;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureR
Line truncated
|
|
|
|
|
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,vh),Zv={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Nc=null;function Dv(){var t;if(Nc==null&&typeof document!="undefined"&&document.body){let e=document.body.style;Nc=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Nc||!1}var il=L.define({combine(t){let e=Ge(t,{render:null,specialChars:_v,addSpecialChars:null});return(e.replaceTabs=!Dv())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,vh)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,vh)),e}});function jh(t={}){return[il.of(t),Iv()]}var TO=null;function Iv(){return TO||(TO=me.fromClass(class{constructor(t){this.view=t,this.decorations=X.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(il)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new wh({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:r}=i.state,s=We(e[0],0);if(s==9){let o=r.lineAt(n),l=i.state.tabSize,a=rt(o.text,l,n-o.from);return X.replace({widget:new Ph((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=X.replace({widget:new Qh(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(il);t.startState.facet(il)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}var Bv="\u2022";function Nv(t){return t>=32?Bv:t==10?"\u2424":String.fromCharCode(9216+t)}var Qh=class extends Be{constructor(e,i){super(),this.options=e,this.code=i}eq(e){return e.code==this.code}toDOM(e){let i=Nv(this.code),n=e.state.phrase("Control character")+" "+(Zv[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,i);if(r)return r;let s=document.createElement("span");return s.textContent=i,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}},Ph=class extends Be{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function zh(){return zv}var jv=X.line({class:"cm-activeLine"}),zv=me.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let n of t.state.selection.ranges){let r=t.lineBlockAt(n.head);r.from>e&&(i.push(jv.range(r.from)),e=r.from)}return X.set(i)}},{decorations:t=>t.decorations}),$h=class extends Be{constructor(e){super(),this.content=e}toDOM(e){let i=document.createElement("span");return i.className="cm-placeholder",i.style.pointerEvents="none",i.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),i.setAttribute("aria-hidden","true"),i}coordsAt(e){let i=e.firstChild?cr(e.firstChild):[];if(!i.length)return null;let n=window.getComputedStyle(e.parentNode),r=$s(i[0],n.direction!="rtl"),s=parseInt(n.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}};function Dm(t){let e=me.fromClass(class{constructor(i){this.view=i,this.placeholder=t?X.set([X.widget({widget:new $h(t),side:1}).range(0)]):X.none}get decorations(){return this.view.state.doc.length?X.none:this.placeholder}},{decorations:i=>i.decorations});return typeof t=="string"?[e,T.contentAttributes.of({"aria-placeholder":t})]:e}var Th=2e3;function Yv(t,e,i){let n=Math.min(e.line,i.line),r=Math.max(e.line,i.line),s=[];if(e.off>Th||i.off>Th||e.col<0||i.col<0){let o=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let a=n;a<=r;a++){let h=t.doc.line(a);h.length<=l&&s.push(Q.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,i.col),l=Math.max(e.col,i.col);for(let a=n;a<=r;a++){let h=t.doc.line(a),c=Bo(h.text,o,t.tabSize,!0);if(c<0)s.push(Q.cursor(h.to));else{let f=Bo(h.text,l,t.tabSize);s.push(Q.range(h.from+c,h.from+f))}}}return s}function qv(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}function CO(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(i),r=i-n.from,s=r>Th?-1:r==n.length?qv(t,e.clientX):rt(n.text,t.state.tabSize,i-n.from);return{line:n.numbe
Line truncated
|
|
|
|
|
`){[e,i]=ir(this,e,i);let r="";for(let s=0,o=0;s<this.children.length&&o<=i;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=n),e<a&&i>o&&(r+=l.sliceString(e-o,i-o,n)),o=a+1}return r}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof t))return 0;let n=0,[r,s,o,l]=i>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=i,s+=i){if(r==o||s==l)return n;let a=this.children[r],h=e.children[s];if(a!=h)return n+a.scanIdentical(h,i);n+=a.length+1}}static from(e,i=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new wt(d,i)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>s&&d instanceof t)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof wt&&a&&(p=c[c.length-1])instanceof wt&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new wt(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>r&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:t.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new t(l,i)}};ie.empty=new wt([""],0);function Jk(t){let e=-1;for(let i of t)e+=i.length+1;return e}function Eo(t,e,i=0,n=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=n;s++){let l=t[s],a=r+l.length;a>=i&&(a>n&&(l=l.slice(0,n-r)),r<i&&(l=l.slice(i-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function Pg(t,e,i){return Eo(t,[""],e,i)}var hn=class{constructor(e,i=1){this.dir=i,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[i>0?1:(e instanceof wt?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof wt?r.text.length:r.children.length;if(o==(i>0?l:0)){if(n==0)return this.done=!0,this.value="",this;i>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(i>0?0:1)){if(this.offsets[n]+=i,e==0)return this.lineBreak=!0,this.value=`
|
|
|
|
|
`,this;e--}else if(r instanceof wt){let a=r.text[o+(i<0?-1:0)];if(this.offsets[n]+=i,a.length>Math.max(0,e))return this.value=e==0?a:i>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(i<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=i):(i<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(i>0?1:(a instanceof wt?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Mo=class{constructor(e,i,n){this.value="",this.done=!1,this.cursor=new hn(e,i>n?-1:1),this.pos=i>n?e.length:0,this.from=Math.min(i,n),this.to=Math.max(i,n)}nextInner(e,i){if(i<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,i<0?this.pos-this.to:this.from-this.pos);let n=i<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*i,this.value=r.length<=n?r:i<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Lo=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:n,value:r}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol!="undefined"&&(ie.prototype[Symbol.iterator]=function(){return this.iter()},hn.prototype[Symbol.iterator]=Mo.prototype[Symbol.iterator]=Lo.prototype[Symbol.iterator]=function(){return this});var yc=class{constructor(e,i,n,r){this.from=e,this.to=i,this.number=n,this.text=r}get length(){return this.to-this.from}};function ir(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function Xe(t,e,i=!0,n=!0){return kg(t,e,i,n)}function ew(t){return t>=56320&&t<57344}function tw(t){return t>=55296&&t<56320}function We(t,e){let i=t.charCodeAt(e);if(!tw(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return ew(n)?(i-55296<<10)+(n-56320)+65536:i}function os(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function vt(t){return t<65536?1:2}var Sc=/\r\n?|\n/,De=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(De||(De={})),Si=class t{constructor(e){this.sections=e}get length(){let e=0;for(let i=0;i<this.sections.length;i+=2)e+=this.sections[i];return e}get newLength(){let e=0;for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i+1];e+=n<0?this.sections[i]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let i=0,n=0,r=0;i<this.sections.length;){let s=this.sections[i++],o=this.sections[i++];o<0?(e(n,r,s),r+=s):r+=o,n+=s}}iterChangedRanges(e,i=!1){xc(this,e,i)}get invertedDesc(){let e=[];for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];r<0?e.push(n,r):e.push(r,n)}return new t(e)}composeDesc(e){return this.empty?e:e.empty?this:Eg(this,e)}mapDesc(e,i=!1){return e.empty?this:kc(this,e,i)}mapPos(e,i=-1,n=De.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=r+l;if(a<0){if(h>e)return s+(e-r);s+=l}else{if(n!=De.Simple&&h>=e&&(n==De.TrackDel&&r<e&&h>e||n==De.TrackBefore&&r<e||n==De.TrackAfter&&h>e))return null;if(h>e||h==e&&i<0&&!l)return e==r||i<0?s:s+a;s+=a}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,i=e){for(let n=0,r=0;n<this.sections.length&&r<=i;){let s=this.sections[n++],o=this.sections[n++],l=r+s;if(o>=0&&r<=i&&l>=e)return r<e&&l>i?"cover":!0;r=l}return!1}toString(){let e="";for(let i=0;i<this.sections.length;){let n=this.sections[i++],r=this.sections[i++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(i=>typeof i!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new t(e)}static create(e){return new t(e)}},qe=class t extends Si{constructor(e,i){super(e),this.inserted=i}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return xc(this,(i,n,r,s,o)=>e=e.replace(r,r+(n-i),o),!1),e}mapDesc(e,i=!1){return kc(this,e,i,!0)}invert(e){let i=this.sections.slice(),n=[];for(let r=0,s=0;r<i.length;r+=2){let o=i[r],l=i[r+1];if(l>=0){i[r]=l,i[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(ie.empty);n.push(o?e.slice(s,s+o):ie.empty)}s+=o}return new t(i,n)}compose(e){return this.empty?e:e.empty?this:Eg(this,e,!0)}map(e,i=!1){return e.empty?this:kc(this,e,i,!0)}iterChanges(e,i=!1){xc(this,e,i)}get desc
Line truncated
|
|
|
|
|
`}get readOnly(){return this.facet(Ig)}phrase(e,...i){for(let n of this.facet(t.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return i.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>i.length?n:i[s-1]})),e}languageDataAt(e,i,n=-1){let r=[];for(let s of this.facet(Lg))for(let o of s(this,i,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){return hw(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:i,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=Xe(i,o,!1);if(s(i.slice(a,o))!=ke.Word)break;o=a}for(;l<r;){let a=Xe(i,l);if(s(i.slice(l,a))!=ke.Word)break;l=a}return o==l?null:Q.range(o+n,l+n)}};he.allowMultipleSelections=vc;he.tabSize=L.define({combine:t=>t.length?t[0]:4});he.lineSeparator=Xg;he.readOnly=Ig;he.phrases=L.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(r=>t[r]==e[r])}});he.languageData=Lg;he.changeFilter=_g;he.transactionFilter=Zg;he.transactionExtender=Dg;ni.reconfigure=W.define();function Ge(t,e,i={}){let n={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(i,s))n[s]=i[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}var jt=class{eq(e){return this==e}range(e,i=e){return rs.create(e,i,this)}};jt.prototype.startSide=jt.prototype.endSide=0;jt.prototype.point=!1;jt.prototype.mapMode=De.TrackDel;var rs=class t{constructor(e,i,n){this.from=e,this.to=i,this.value=n}static create(e,i,n){return new t(e,i,n)}};function Cc(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var Ac=class t{constructor(e,i,n,r){this.from=e,this.to=i,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,i,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,h=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-i;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,i,n,r){for(let s=this.findIndex(i,-1e9,!0),o=this.findIndex(n,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,i){let n=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let h=this.value[a],c=this.from[a]+e,f=this.to[a]+e,u,d;if(c==f){let p=i.mapPos(c,h.startSide,h.mapMode);if(p==null||(u=d=p,h.startSide!=h.endSide&&(d=i.mapPos(c,h.endSide),d<u)))continue}else if(u=i.mapPos(c,h.startSide),d=i.mapPos(f,h.endSide),u>d||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),n.push(h),r.push(u-o),s.push(d-o))}return{mapped:n.length?new t(r,s,n,l):null,pos:o}}},se=class t{constructor(e,i,n,r){this.chunkPos=e,this.chunk=i,this.nextLayer=n,this.maxPoint=r}static create(e,i,n,r){return new t(e,i,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let i of this.chunk)e+=i.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:i=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(i.length==0&&!o)return this;if(n&&(i=i.slice().sort(Cc)),this.isEmpty)return i.length?t.of(i):this;let l=new Do(this,null,-1).goto(0),a=0,h=[],c=new Ee;for(;l.value||a<i.length;)if(a<i.length&&(l.from-i[a].from||l.startSide-i[a].value.startSide)>=0){let f=i[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==i.length||this.chunkEnd(l.chunkIndex)<i[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||h.push(rs.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!h.length?t.empty:this.nextLayer.update({add:h,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let i=[],n=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],h=e.touchesRange(l,l+a.length);if(h===!1)r=Math.max(r,a.maxPoint),i.push(a),n.push(e.mapPos(l));else if(h===!0){let{mapped:c,pos:f}=a.map(l,e);c&&(r=Math.max(r,c.maxPoint),i.push(c),n.push(f))}}let s=this.nextLayer.map(e);return i.length==0?s:new t(n,i,s||t.empty,r)}between(e,i,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(i>=s&&e<=s+o.length&&o.between(s,e-s,i-s,n)===!1)return}this.nextLayer.between(e,i,n)}}iter(e=0){return ss.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,i=0){return ss.from(e).goto(i)}static compare(e,i,n,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=i.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=Cg(o,l
Line truncated
|
|
|
|
|
`)}static newName(){let e=zg[jg]||1;return zg[jg]=e+1,"\u037C"+e.toString(36)}static mount(e,i,n){let r=e[Lc],s=n&&n.nonce;r?s&&r.setNonce(s):r=new Xc(e,s),r.mount(Array.isArray(i)?i:[i],e)}},Yg=new Map,Xc=class{constructor(e,i){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Yg.get(n);if(s)return e[Lc]=s;this.sheet=new r.CSSStyleSheet,Yg.set(n,this)}else this.styleTag=n.createElement("style"),i&&this.styleTag.setAttribute("nonce",i);this.modules=[],e[Lc]=this}mount(e,i){let n=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let h=0;h<l.rules.length;h++)n.insertRule(l.rules[h],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(n)i.adoptedStyleSheets.indexOf(this.sheet)<0&&(i.adoptedStyleSheets=[this.sheet,...i.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
|
|
|
|
`;this.styleTag.textContent=o;let l=i.head||i;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var xi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},nr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},uw=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),dw=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(_e=0;_e<10;_e++)xi[48+_e]=xi[96+_e]=String(_e);var _e;for(_e=1;_e<=24;_e++)xi[_e+111]="F"+_e;var _e;for(_e=65;_e<=90;_e++)xi[_e]=String.fromCharCode(_e+32),nr[_e]=String.fromCharCode(_e);var _e;for(Bo in xi)nr.hasOwnProperty(Bo)||(nr[Bo]=xi[Bo]);var Bo;function qg(t){var e=uw&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||dw&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",i=!e&&t.key||(t.shiftKey?nr:xi)[t.keyCode]||t.key||"Unidentified";return i=="Esc"&&(i="Escape"),i=="Del"&&(i="Delete"),i=="Left"&&(i="ArrowLeft"),i=="Up"&&(i="ArrowUp"),i=="Right"&&(i="ArrowRight"),i=="Down"&&(i="ArrowDown"),i}function Oe(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&typeof i=="object"&&i.nodeType==null&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];typeof r=="string"?t.setAttribute(n,r):r!=null&&(t[n]=r)}e++}for(;e<arguments.length;e++)Wg(t,arguments[e]);return t}function Wg(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var i=0;i<e.length;i++)Wg(t,e[i]);else throw new RangeError("Unsupported child node: "+e)}var st=typeof navigator!="undefined"?navigator:{userAgent:"",vendor:"",platform:""},zc=typeof document!="undefined"?document:{documentElement:{style:{}}},Yc=/Edge\/(\d+)/.exec(st.userAgent),XO=/MSIE \d/.test(st.userAgent),qc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(st.userAgent),bl=!!(XO||qc||Yc),Vg=!bl&&/gecko\/(\d+)/i.test(st.userAgent),_c=!bl&&/Chrome\/(\d+)/.exec(st.userAgent),Gg="webkitFontSmoothing"in zc.documentElement.style,Wc=!bl&&/Apple Computer/.test(st.vendor),Ug=Wc&&(/Mobile\/\w+/.test(st.userAgent)||st.maxTouchPoints>2),I={mac:Ug||/Mac/.test(st.platform),windows:/Win/.test(st.platform),linux:/Linux|X11/.test(st.platform),ie:bl,ie_version:XO?zc.documentMode||6:qc?+qc[1]:Yc?+Yc[1]:0,gecko:Vg,gecko_version:Vg?+(/Firefox\/(\d+)/.exec(st.userAgent)||[0,0])[1]:0,chrome:!!_c,chrome_version:_c?+_c[1]:0,ios:Ug,android:/Android\b/.test(st.userAgent),webkit:Gg,webkit_version:Gg?+(/\bAppleWebKit\/(\d+)/.exec(st.userAgent)||[0,0])[1]:0,safari:Wc,safari_version:Wc?+(/\bVersion\/(\d+(\.\d+)?)/.exec(st.userAgent)||[0,0])[1]:0,tabSize:zc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function ys(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Vc(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Ho(t,e){if(!e.anchorNode)return!1;try{return Vc(t,e.anchorNode)}catch{return!1}}function cr(t){return t.nodeType==3?gn(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function fs(t,e,i,n){return i?Fg(t,e,i,n,-1)||Fg(t,e,i,n,1):!1}function pn(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function nl(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Fg(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:ai(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=pn(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?ai(t):0}else return!1}}function ai(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function $s(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function pw(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function _O(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function gw(t,e,i,n,r,Line truncated
|
|
|
|
|
`,r=t.state.doc.line(r.number+(i?1:-1)),s=t.bidiSpans(r),h=t.visualLineSide(r,!i)}if(a){if(!a(c))return l}else{if(!n)return h;a=n(c)}l=h}}function Gw(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return s=>{let o=n(s);return r==ke.Space&&(r=o),r==o}}function Uw(t,e,i,n){let r=e.head,s=i?1:-1;if(r==(i?t.state.doc.length:0))return Q.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),h=t.coordsAtPos(r,e.assoc||-1),c=t.documentTop;if(h)o==null&&(o=h.left-a.left),l=s<0?h.top:h.bottom;else{let d=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-d.from))),l=(s<0?d.top:d.bottom)+c}let f=a.left+o,u=n!=null?n:t.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*s,g=pm(t,{x:f,y:p},!1,s);if(p<a.top||p>a.bottom||(s<0?g<r:g>r)){let m=t.docView.coordsForChar(g),b=!m||p<m.top?-1:1;return Q.cursor(g,b,void 0,o)}}}function gs(t,e,i){for(;;){let n=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=n||i||(e-s<o-e?-1:1);e=a<0?s:o,n=a}});if(!n)return e}}function Om(t,e){let i=null;for(let n=0;n<e.ranges.length;n++){let r=e.ranges[n],s=null;if(r.empty){let o=gs(t,r.from,0);o!=r.from&&(s=Q.cursor(o,-1))}else{let o=gs(t,r.from,-1),l=gs(t,r.to,1);(o!=r.from||l!=r.to)&&(s=Q.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(i||(i=e.ranges.slice()),i[n]=s)}return i?Q.create(i,e.mainIndex):e}function Dc(t,e,i){let n=gs(t.state.facet(Ts).map(r=>r(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:Q.cursor(n,n<i.from?1:-1)}var as="\uFFFF",nh=class{constructor(e,i){this.points=e,this.text="",this.lineSeparator=i.facet(he.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=as}readRange(e,i){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=r.nextSibling;if(o==i)break;let l=Qe.get(r),a=Qe.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:nl(r))||nl(o)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&!Hw(o,i)&&this.lineBreak(),r=o}return this.findPointBefore(n,i),this}readTextNode(e){let i=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,i.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=i.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(i))&&(s=l.index,o=l[0].length),this.append(i.slice(n,s<0?i.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){if(e.cmIgnore)return;let i=Qe.get(e),n=i&&i.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,i){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==i&&(n.pos=this.text.length)}findPointInside(e,i){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Fw(e,n.node,n.offset)?i:0))}};function Fw(t,e,i){for(;;){if(!e||i<ai(e))return!1;if(e==t)return!0;i=pn(e)+1,e=e.parentNode}}function Hw(t,e){let i;for(;!(t==e||!t);t=t.nextSibling){let n=Qe.get(t);if(!(n!=null&&n.isWidget||t.cmIgnore))return!1;n&&(i||(i=[])).push(n)}if(i)for(let n of i){let r=n.overrideDOMText;if(r!=null&&r.length)return!1}return!0}var al=class{constructor(e,i){this.node=e,this.offset=i,this.pos=-1}},rh=class{constructor(e,i,n,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=i>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&i>-1)this.newSel=null;else if(i>-1&&(this.bounds=e.docView.domBoundsAround(i,n,0))){let l=s||o?[]:Jw(e),a=new nh(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=ev(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!Vc(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Vc(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),c=e.viewport;if((I.ios||I.chrome)&&e.state.selection.main.empty&&a!=h&&(c.from>0||c.to<e.state.doc.length)){let f=Math.min(a,h),u=Math.max(a,h),d=c.from-f,p=c.to-u;(d==0||d==1||f==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,h=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(Q.range(h,a)):this.newSel=Q.single(h,a)}}};function mm(t,e){let i,{newSel:n}=e,r=t.state.selection.main,s=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=r.from,h=null;(s===8||I.android&&e.text.length<l-o)&&(a=r.to,h="end");let c=bm(t.state.doc.sliceString(o,l,as),e.text,a-o,h);c&&(I.chrome&&s==13&&c.toB==c.from+2&&e.text.sl
Line truncated
|
|
|
|
|
`&&t.lineWrapping&&(n&&(n=Q.single(n.main.anchor-1,n.main.head-1)),i={from:r.from,to:r.to,insert:ie.of([" "])}),i)return Dh(t,i,n,s);if(n&&!n.main.eq(r)){let o=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=Om(t.state.facet(Ts).map(a=>a(t)),n))),t.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function Dh(t,e,i,n=-1){if(I.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(I.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ar(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&ar(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ar(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=Kw(t,e,i));return t.state.facet(nm).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function Kw(t,e,i){let n,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,h=a<0?s.from:s.to,c=gs(r.facet(Ts).map(f=>f(t)),h,a);e.from==c&&(o=c)}if(o>-1)n={changes:e,selection:Q.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",h=s.to>e.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+h))}else{let a=r.changes(e),h=i&&i.main.to<=a.newLength?i.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=t.state.sliceDoc(e.from,e.to),f,u=i&&dm(t,i.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=t.state.doc.lineAt(s.head);let d=s.to-e.to;n=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:h||p.map(a)};let g=p.to-d,m=g-c.length;if(t.state.sliceDoc(m,g)!=c||g>=f.from&&m<=f.to)return{range:p};let b=r.changes({from:m,to:g,insert:e.insert}),y=p.to-s.to;return{changes:b,range:h?Q.range(Math.max(0,h.anchor+y),Math.max(0,h.head+y)):p.map(b)}})}else n={changes:a,selection:h&&r.selection.replaceRange(h)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:l,scrollIntoView:!0})}function bm(t,e,i,n){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));i-=o+a-s}if(o<s&&t.length<e.length){let a=i<=s&&i>=o?s-i:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=i<=s&&i>=l?s-i:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function Jw(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}=t.observer.selectionRange;return i&&(e.push(new al(i,n)),(r!=i||s!=n)&&e.push(new al(r,s))),e}function ev(t,e){if(t.length==0)return null;let i=t[0].pos,n=t.length==2?t[1].pos:i;return i>-1&&n>-1?Q.single(i+e,n+e):null}var sh=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,I.safari&&e.contentDOM.addEventListener("input",()=>null),I.gecko&&gv(e.contentDOM.ownerDocument)}handleEvent(e){!lv(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,i){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,i);for(let r of n.handlers){if(i.defaultPrevented)break;if(r(this.view,i)){i.preventDefault();break}}}}ensureHandlers(e){let i=tv(e),n=this.handlers,r=this.view.contentDOM;for(let s in i)if(s!="scroll"){let o=!i[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListe
Line truncated
|
|
|
|
|
`))};if((I.mac||I.android)&&f.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ie.of([n.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Dh(e,f,Q.single(this.toEditorPos(n.selectionStart,u),this.toEditorPos(n.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(i.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(i.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}i.updateCharacterBounds(n.rangeStart,r)},this.handlers.textformatupdate=n=>{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(a<h){let c=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(X.mark({attributes:{style:c}}).range(a,h))}}}e.dispatch({effects:am.of(X.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)i.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let r=ys(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let i=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,h)=>{if(n)return;let c=h.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(h)){r=this.pendingContextChange=null,i+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(s+=i,o+=i,o<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+h.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=c}i+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){let i=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||i)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:i}=e.selection.main;this.from=Math.max(0,i-1e4),this.to=Math.min(e.doc.length,i+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let i=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(i.from),this.toContextPos(i.from+i.insert.length),e.doc.sliceString(i.from,i.to))}setSelection(e){let{main:i}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,i.anchor))),r=this.toContextPos(i.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:i}=e.selection.main;return!(this.from>0&&i-this.from<500||this.to<e.doc.length&&this.to-i<500||this.to-this.from>1e4*3)}toEditorPos(e,i=this.to-this.from){e=Math.min(e,i);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let i=this.composing;return i&&i.drifted?i.contextBase+(e-i.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},T=class t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var i;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureR
Line truncated
|
|
|
|
|
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,wh),Bv={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Bc=null;function Nv(){var t;if(Bc==null&&typeof document!="undefined"&&document.body){let e=document.body.style;Bc=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Bc||!1}var tl=L.define({combine(t){let e=Ge(t,{render:null,specialChars:Iv,addSpecialChars:null});return(e.replaceTabs=!Nv())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,wh)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,wh)),e}});function Nh(t={}){return[tl.of(t),jv()]}var $O=null;function jv(){return $O||($O=me.fromClass(class{constructor(t){this.view=t,this.decorations=X.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(tl)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new kh({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:r}=i.state,s=We(e[0],0);if(s==9){let o=r.lineAt(n),l=i.state.tabSize,a=rt(o.text,l,n-o.from);return X.replace({widget:new Qh((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=X.replace({widget:new vh(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(tl);t.startState.facet(tl)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}var zv="\u2022";function Yv(t){return t>=32?zv:t==10?"\u2424":String.fromCharCode(9216+t)}var vh=class extends Be{constructor(e,i){super(),this.options=e,this.code=i}eq(e){return e.code==this.code}toDOM(e){let i=Yv(this.code),n=e.state.phrase("Control character")+" "+(Bv[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,i);if(r)return r;let s=document.createElement("span");return s.textContent=i,s.title=n,s.setAttribute("aria-label",n),s.className="cm-specialChar",s}ignoreEvent(){return!1}},Qh=class extends Be{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function jh(){return Wv}var qv=X.line({class:"cm-activeLine"}),Wv=me.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,i=[];for(let n of t.state.selection.ranges){let r=t.lineBlockAt(n.head);r.from>e&&(i.push(qv.range(r.from)),e=r.from)}return X.set(i)}},{decorations:t=>t.decorations}),Ph=class extends Be{constructor(e){super(),this.content=e}toDOM(e){let i=document.createElement("span");return i.className="cm-placeholder",i.style.pointerEvents="none",i.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),i.setAttribute("aria-hidden","true"),i}coordsAt(e){let i=e.firstChild?cr(e.firstChild):[];if(!i.length)return null;let n=window.getComputedStyle(e.parentNode),r=$s(i[0],n.direction!="rtl"),s=parseInt(n.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}};function Zm(t){let e=me.fromClass(class{constructor(i){this.view=i,this.placeholder=t?X.set([X.widget({widget:new Ph(t),side:1}).range(0)]):X.none}get decorations(){return this.view.state.doc.length?X.none:this.placeholder}},{decorations:i=>i.decorations});return typeof t=="string"?[e,T.contentAttributes.of({"aria-placeholder":t})]:e}var $h=2e3;function Vv(t,e,i){let n=Math.min(e.line,i.line),r=Math.max(e.line,i.line),s=[];if(e.off>$h||i.off>$h||e.col<0||i.col<0){let o=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let a=n;a<=r;a++){let h=t.doc.line(a);h.length<=l&&s.push(Q.range(h.from+o,h.to+l))}}else{let o=Math.min(e.col,i.col),l=Math.max(e.col,i.col);for(let a=n;a<=r;a++){let h=t.doc.line(a),c=Io(h.text,o,t.tabSize,!0);if(c<0)s.push(Q.cursor(h.to));else{let f=Io(h.text,l,t.tabSize);s.push(Q.range(h.from+c,h.from+f))}}}return s}function Gv(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}function TO(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(i),r=i-n.from,s=r>$h?-1:r==n.length?Gv(t,e.clientX):rt(n.text,t.state.tabSize,i-n.from);return{line:n.numbe
Line truncated
|
|
|
|
|
`&&(i="");else{let n=i.indexOf(`
|
|
|
|
|
`);n>-1&&(i=i.slice(0,n))}return e+i.length<=this.to?i:i.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,i=this.lineAfter(e),n=e+i.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=n||(i=i.slice(0,s-(n-i.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);i+=l,n=o+l.length}return{line:i,end:n}}skipGapsTo(e,i,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+i;if(n>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;i+=o-r}return i}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,i,n,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(i,r,1),i+=r;let l=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==i?this.chunk[o+2]=n:this.chunk.push(e,i,n,s),r}parseLine(e){let{line:i,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new Rl(i,e?e.state.tabSize:4,e?Wt(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=v0(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=ue.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:tP,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new ue(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new ue(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function v0(t,e,i){e.start=e.pos;for(let n=0;n<10;n++){let r=t(e,i);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}var Lf=Object.create(null),Zs=[Ne.none],tP=new gr(Zs),o0=[],l0=Object.create(null),Q0=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Q0[t]=P0(Lf,e);var El=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Q0)}resolve(e){return e?this.table[e]||(this.table[e]=P0(this.extra,e)):0}},iP=new El(Lf);function mf(t,e){o0.indexOf(t)>-1||(o0.push(t),console.warn(e))}function P0(t,e){let i=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=t[h]||O[h];c?typeof c=="function"?a.length?a=a.map(c):mf(h,`Modifier ${h} used at start of tag`):a.length?mf(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:mf(h,`Unknown highlighting tag ${h}`)}for(let h of a)i.push(h)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+i.map(l=>l.id),s=l0[r];if(s)return s.id;let o=l0[r]=Ne.define({id:Zs.length,name:n,props:[at({[n]:i})]});return Zs.push(o),o.id}function nP(t,e){let i=Ne.define({id:Zs.length,name:"Document",props:[Qi.add(()=>t),Et.add(()=>n=>e.getIndent(n))],top:!0});return Zs.push(i),i}var u_={rtl:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:we.RTL}),ltr:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:we.LTR}),auto:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Bf=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=jf(t.state,i.from);return n.line?rP(t):n.block?oP(t):!1};function Nf(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=t(e,i);return r?(n(i.update(r)),!0):!1}}var rP=Nf(cP,0);var sP=Nf(X0,0);var oP=Nf((t,e)=>X0(t,e,aP(e)),0);function jf(t,e){let i=t.languageDataAt("commentTokens",e);return i.length?i[0]:{}}var Bs=50;function lP(t,{open:e,close:i},n,r){let s=t.sliceDoc(n-Bs,n),o=t.sliceDoc(r,r+Bs),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&o.slice(a,a+i.length)==i)return{open:{pos:n-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let c,f;r-n<=2*Bs?c=f=t.sliceDoc(n,r):(c=t.sliceDoc(n,n+Bs),f=t.sliceDoc(r-Bs,r));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-i.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+i.length)==i?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:r-d-i.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function aP(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),r=i.to<=n.to?n:t.doc.lineAt(i.to);r.from>n.from&&r.from==i.to&&(r=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function X
Line truncated
|
|
|
|
|
`+i.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,n,s):!1}finish(e,i){return(this.stage==2||this.stage==3)&&Js(i.content,this.pos)==i.content.length?this.complete(e,i,i.content.length):!1}complete(e,i,n){return e.addLeafElement(i,oe(A.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(Ly(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(oe(A.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Ey(e,Js(e,this.pos),this.start)))return-1}else if(this.stage==2){let i=Js(e,this.pos),n=0;if(i>this.pos){let r=My(e,i,this.start);if(r){let s=Nu(e,r.to-this.start);s>0&&(this.nextStage(r),n=s)}}return n||(n=Nu(e,this.pos)),n>0&&n<e.length?n:-1}else return Nu(e,this.pos)}}};function Nu(t,e){for(;e<t.length;e++){let i=t.charCodeAt(e);if(i==10)break;if(!Dt(i))return-1}return e}var Gu=class{nextLine(e,i,n){let r=i.depth<e.stack.length?-1:wy(i),s=i.next;if(r<0)return!1;let o=oe(A.HeaderMark,e.lineStart+i.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,oe(s==61?A.SetextHeading1:A.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}},$y={LinkReference(t,e){return e.content.charCodeAt(0)==91?new Vu(e):null},SetextHeading(){return new Gu}},_T=[(t,e)=>ky(e)>=0,(t,e)=>yy(e)>=0,(t,e)=>Sy(e)>=0,(t,e)=>td(e,t,!0)>=0,(t,e)=>id(e,t,!0)>=0,(t,e)=>ed(e,t,!0)>=0,(t,e)=>Py(e,t,!0)>=0],ZT={text:"",end:0},Uu=class{constructor(e,i,n,r){this.parser=e,this.input=i,this.ranges=r,this.line=new Yu,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=sa.create(A.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Ku(n,i):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!r||e.markers[n].from<r.end);){let s=e.markers[n++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let r=n(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let i=new zu(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let r=n(this,i);r&&i.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,i))break e}for(let n of i.parsers)if(n.nextLine(this,e,i))return null;i.content+=`
|
|
|
|
|
`+e.scrub();for(let n of e.markers)i.marks.push(n)}return this.finishLeaf(i),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let i=this.fragments.takeNodes(this);return i?(this.absoluteLineStart+=i,this.lineStart=Xy(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let i=ZT;if(i.end=e,e>=this.to)i.text="";else if(i.text=this.lineChunkAt(e),i.end+=i.text.length,this.ranges.length>1){let n=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<i.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);i.end=s+o.length,i.text=i.text.slice(0,this.ranges[r-1].to-n)+o,n=i.end-i.text.length}}return i}readLine(){let{line:e}=this,{text:i,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(i);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+A[r.type]);let o=this.line.markers.length;if(!s(r,this,e)){this.line.markers.length>o&&(r.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let i=this.input.chunk(e),n;if(this.input.lineChunks)n=i==`
|
|
|
|
|
`);n>-1&&(i=i.slice(0,n))}return e+i.length<=this.to?i:i.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,i=this.lineAfter(e),n=e+i.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=n||(i=i.slice(0,s-(n-i.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);i+=l,n=o+l.length}return{line:i,end:n}}skipGapsTo(e,i,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+i;if(n>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;i+=o-r}return i}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,i,n,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(i,r,1),i+=r;let l=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==i?this.chunk[o+2]=n:this.chunk.push(e,i,n,s),r}parseLine(e){let{line:i,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new Al(i,e?e.state.tabSize:4,e?Wt(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=w0(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=ue.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:rP,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new ue(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new ue(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function w0(t,e,i){e.start=e.pos;for(let n=0;n<10;n++){let r=t(e,i);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}var Mf=Object.create(null),Zs=[Ne.none],rP=new gr(Zs),s0=[],o0=Object.create(null),v0=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])v0[t]=Q0(Mf,e);var Rl=class{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),v0)}resolve(e){return e?this.table[e]||(this.table[e]=Q0(this.extra,e)):0}},sP=new Rl(Mf);function Of(t,e){s0.indexOf(t)>-1||(s0.push(t),console.warn(e))}function Q0(t,e){let i=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=t[h]||O[h];c?typeof c=="function"?a.length?a=a.map(c):Of(h,`Modifier ${h} used at start of tag`):a.length?Of(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:Of(h,`Unknown highlighting tag ${h}`)}for(let h of a)i.push(h)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+i.map(l=>l.id),s=o0[r];if(s)return s.id;let o=o0[r]=Ne.define({id:Zs.length,name:n,props:[at({[n]:i})]});return Zs.push(o),o.id}function oP(t,e){let i=Ne.define({id:Zs.length,name:"Document",props:[Qi.add(()=>t),Et.add(()=>n=>e.getIndent(n))],top:!0});return Zs.push(i),i}var O_={rtl:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:we.RTL}),ltr:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:we.LTR}),auto:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var If=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=Nf(t.state,i.from);return n.line?lP(t):n.block?cP(t):!1};function Bf(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=t(e,i);return r?(n(i.update(r)),!0):!1}}var lP=Bf(uP,0);var aP=Bf(L0,0);var cP=Bf((t,e)=>L0(t,e,fP(e)),0);function Nf(t,e){let i=t.languageDataAt("commentTokens",e);return i.length?i[0]:{}}var Bs=50;function hP(t,{open:e,close:i},n,r){let s=t.sliceDoc(n-Bs,n),o=t.sliceDoc(r,r+Bs),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&o.slice(a,a+i.length)==i)return{open:{pos:n-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let c,f;r-n<=2*Bs?c=f=t.sliceDoc(n,r):(c=t.sliceDoc(n,n+Bs),f=t.sliceDoc(r-Bs,r));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-i.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+i.length)==i?{open:{pos:n+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:r-d-i.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function fP(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),r=i.to<=n.to?n:t.doc.lineAt(i.to);r.from>n.from&&r.from==i.to&&(r=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function L
Line truncated
|
|
|
|
|
`+i.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,n,s):!1}finish(e,i){return(this.stage==2||this.stage==3)&&Js(i.content,this.pos)==i.content.length?this.complete(e,i,i.content.length):!1}complete(e,i,n){return e.addLeafElement(i,oe(A.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(My(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(oe(A.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Ry(e,Js(e,this.pos),this.start)))return-1}else if(this.stage==2){let i=Js(e,this.pos),n=0;if(i>this.pos){let r=Ey(e,i,this.start);if(r){let s=Bu(e,r.to-this.start);s>0&&(this.nextStage(r),n=s)}}return n||(n=Bu(e,this.pos)),n>0&&n<e.length?n:-1}else return Bu(e,this.pos)}}};function Bu(t,e){for(;e<t.length;e++){let i=t.charCodeAt(e);if(i==10)break;if(!Dt(i))return-1}return e}var Vu=class{nextLine(e,i,n){let r=i.depth<e.stack.length?-1:ky(i),s=i.next;if(r<0)return!1;let o=oe(A.HeaderMark,e.lineStart+i.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,oe(s==61?A.SetextHeading1:A.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}},Py={LinkReference(t,e){return e.content.charCodeAt(0)==91?new Wu(e):null},SetextHeading(){return new Vu}},IT=[(t,e)=>xy(e)>=0,(t,e)=>by(e)>=0,(t,e)=>yy(e)>=0,(t,e)=>ed(e,t,!0)>=0,(t,e)=>td(e,t,!0)>=0,(t,e)=>Ju(e,t,!0)>=0,(t,e)=>Qy(e,t,!0)>=0],BT={text:"",end:0},Gu=class{constructor(e,i,n,r){this.parser=e,this.input=i,this.ranges=r,this.line=new zu,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=ra.create(A.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Hu(n,i):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!r||e.markers[n].from<r.end);){let s=e.markers[n++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let r=n(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let i=new ju(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let r=n(this,i);r&&i.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,i))break e}for(let n of i.parsers)if(n.nextLine(this,e,i))return null;i.content+=`
|
|
|
|
|
`+e.scrub();for(let n of e.markers)i.marks.push(n)}return this.finishLeaf(i),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let i=this.fragments.takeNodes(this);return i?(this.absoluteLineStart+=i,this.lineStart=Ly(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let i=BT;if(i.end=e,e>=this.to)i.text="";else if(i.text=this.lineChunkAt(e),i.end+=i.text.length,this.ranges.length>1){let n=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<i.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);i.end=s+o.length,i.text=i.text.slice(0,this.ranges[r-1].to-n)+o,n=i.end-i.text.length}}return i}readLine(){let{line:e}=this,{text:i,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(i);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+A[r.type]);let o=this.line.markers.length;if(!s(r,this,e)){this.line.markers.length>o&&(r.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let i=this.input.chunk(e),n;if(this.input.lineChunks)n=i==`
|
|
|
|
|
`?"":i;else{let r=i.indexOf(`
|
|
|
|
|
`);n=r<0?i:i.slice(0,r)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,i,n=0){this.block=sa.create(e,n,this.lineStart+i,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,i,n=0){this.startContext(this.parser.getNodeType(e),i,n)}addNode(e,i,n){typeof e=="number"&&(e=new Me(this.parser.nodeSet.types[e],Rr,Rr,(n!=null?n:this.prevLineEnd())-i)),this.block.addChild(e,i-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,i){this.addNode(this.buffer.writeElements(Hu(i.children,e.marks),-i.from).finish(i.type,i.to-i.from),i.from)}finishContext(){let e=this.stack.pop(),i=this.stack[this.stack.length-1];i.addChild(e.toTree(this.parser.nodeSet),e.from-i.from),this.block=i}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Ty(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let i=Hu(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(i,-e.start).finish(A.Paragraph,e.content.length),e.start)}elt(e,i,n,r){return typeof e=="string"?oe(this.parser.getNodeType(e),i,n,r):new la(e,i)}get buffer(){return new oa(this.parser.nodeSet)}};function Ty(t,e,i,n,r){let s=t[e].to,o=[],l=[],a=i.from+n;function h(c,f){for(;f?c>=s:c>s;){let u=t[e+1].from-s;n+=u,c+=u,e++,s=t[e].to}}for(let c=i.firstChild;c;c=c.nextSibling){h(c.from+n,!0);let f=c.from+n,u,d=r.get(c.tree);d?u=d:c.to+n>s?(u=Ty(t,e,c,n,r),h(c.to+n,!1)):u=c.toTree(),o.push(u),l.push(f-a)}return h(i.to+n,!1),new Me(i.type,o,l,i.to+n-a,i.tree?i.tree.propValues:void 0)}var to=class t extends ea{constructor(e,i,n,r,s,o,l,a,h){super(),this.nodeSet=e,this.blockParsers=i,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=a,this.wrappers=h,this.nodeTypes=Object.create(null);for(let c of e.types)this.nodeTypes[c.name]=c.id}createParse(e,i,n){let r=new Uu(this,e,i,n);for(let s of this.wrappers)r=s(r,e,i,n);return r}configure(e){let i=Fu(e);if(!i)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),a=this.inlineParsers.slice(),h=this.inlineNames.slice(),c=this.endLeafBlock.slice(),f=this.wrappers;if(Ks(i.defineNodes)){r=Object.assign({},r);let u=n.types.slice(),d;for(let p of i.defineNodes){let{name:g,block:m,composite:b,style:y}=typeof p=="string"?{name:p}:p;if(u.some(x=>x.name==g))continue;b&&(r[u.length]=(x,w,k)=>b(w,k,x.value));let S=u.length,v=b?["Block","BlockContext"]:m?S>=A.ATXHeading1&&S<=A.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;u.push(tt.define({id:S,name:g,props:v&&[[de.group,v]]})),y&&(d||(d={}),Array.isArray(y)||y instanceof $e?d[g]=y:Object.assign(d,y))}n=new Us(u),d&&(n=n.extend(at(d)))}if(Ks(i.props)&&(n=n.extend(...i.props)),Ks(i.remove))for(let u of i.remove){let d=this.blockNames.indexOf(u),p=this.inlineNames.indexOf(u);d>-1&&(s[d]=o[d]=void 0),p>-1&&(a[p]=void 0)}if(Ks(i.parseBlock))for(let u of i.parseBlock){let d=l.indexOf(u.name);if(d>-1)s[d]=u.parse,o[d]=u.leaf;else{let p=u.before?ra(l,u.before):u.after?ra(l,u.after)+1:l.length-1;s.splice(p,0,u.parse),o.splice(p,0,u.leaf),l.splice(p,0,u.name)}u.endLeaf&&c.push(u.endLeaf)}if(Ks(i.parseInline))for(let u of i.parseInline){let d=h.indexOf(u.name);if(d>-1)a[d]=u.parse;else{let p=u.before?ra(h,u.before):u.after?ra(h,u.after)+1:h.length-1;a.splice(p,0,u.parse),h.splice(p,0,u.name)}}return i.wrap&&(f=f.concat(i.wrap)),new t(n,s,o,l,c,r,a,h,f)}getNodeType(e){let i=this.nodeTypes[e];if(i==null)throw new RangeError(`Unknown node type '${e}'`);return i}parseInline(e,i){let n=new no(this,e,i);e:for(let r=i;r<n.end;){let s=n.char(r);for(let o of this.inlineParsers)if(o){let l=o(n,s,r);if(l>=0){r=l;continue e}}r++}return n.resolveMarkers(0)}};function Ks(t){return t!=null&&t.length>0}function Fu(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=Fu(t[0]);if(t.length==1)return e;let i=Fu(t.slice(1));if(!i||!e)return e||i;let n=(o,l)=>(o||Rr).concat(l||Rr),r=e.wrap,s=i.wrap;return{props:n(e.props,i.props),defineNodes:n(e.defineNodes,i.defineNodes),parseBlock:n(e.parseBlock,i.parseBlock),parseInline:n(e.parseInline,i.parseInline),remove:n(e.remove,i.remove),wrap:r?s?(o,l,a,h)=>r(s(o,l,a,h),l,a,h):r:s}}function ra(t,e){let i=t.indexOf(e);if(i<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return i}var Cy=[tt.none];for(let t=1,e;e=A[t];t++)Cy[t]=tt.define({id:t,name:e,props:t>=A.Escape?[]:[[de.group,t in by?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var Rr=[],oa=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,i,n,
Line truncated
|
|
|
|
|
`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=i;if(!n.childAfter(r))return!1}}matches(e){let i=this.cursor.tree;return i&&i.prop(de.contextHash)==e}takeNodes(e){let i=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,h=l;for(;;){if(i.to-n>r){if(i.type.isAnonymous&&i.firstChild())continue;break}let c=Xy(i.from-n,e.ranges);if(i.to-n<=e.ranges[e.rangeI].to)e.addNode(i.tree,c);else{let f=new Me(e.parser.nodeSet.types[A.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,i.tree),e.addNode(f,c)}if(i.type.is("Block")&&(IT.indexOf(i.type.id)<0?(o=i.to-n,l=e.block.children.length):(o=a,l=h),a=i.to-n,h=e.block.children.length),!i.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function Xy(t,e){let i=t;for(let n=1;n<e.length;n++){let r=e[n-1].to,s=e[n].from;r<t&&(i-=s-r)}return i}var BT=at({"Blockquote/...":O.quote,HorizontalRule:O.contentSeparator,"ATXHeading1/... SetextHeading1/...":O.heading1,"ATXHeading2/... SetextHeading2/...":O.heading2,"ATXHeading3/...":O.heading3,"ATXHeading4/...":O.heading4,"ATXHeading5/...":O.heading5,"ATXHeading6/...":O.heading6,"Comment CommentBlock":O.comment,Escape:O.escape,Entity:O.character,"Emphasis/...":O.emphasis,"StrongEmphasis/...":O.strong,"Link/... Image/...":O.link,"OrderedList/... BulletList/...":O.list,"BlockQuote/...":O.quote,"InlineCode CodeText":O.monospace,"URL Autolink":O.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":O.processingInstruction,"CodeInfo LinkLabel":O.labelName,LinkTitle:O.string,Paragraph:O.content}),_y=new to(new Us(Cy).extend(BT),Object.keys(na).map(t=>na[t]),Object.keys(na).map(t=>$y[t]),Object.keys(na),_T,by,Object.keys(ju).map(t=>ju[t]),Object.keys(ju),[]);function NT(t,e,i){let n=[];for(let r=t.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:i;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function Zy(t){let{codeParser:e,htmlParser:i}=t;return{wrap:oy((r,s)=>{let o=r.type.id;if(e&&(o==A.CodeBlock||o==A.FencedCode)){let l="";if(o==A.FencedCode){let h=r.node.getChild(A.CodeInfo);h&&(l=s.read(h.from,h.to))}let a=e(l);if(a)return{parser:a,overlay:h=>h.type.id==A.CodeText,bracketed:o==A.FencedCode}}else if(i&&(o==A.HTMLBlock||o==A.HTMLTag||o==A.CommentBlock))return{parser:i,overlay:NT(r.node,r.from,r.to)};return null})}}var jT={resolve:"Strikethrough",mark:"StrikethroughMark"},zT={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":O.strikethrough}},{name:"StrikethroughMark",style:O.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,i){if(e!=126||t.char(i+1)!=126||t.char(i+2)==126)return-1;let n=t.slice(i-1,i),r=t.slice(i+2,i+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=io.test(n),a=io.test(r);return t.addDelimiter(jT,i,i+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:"Emphasis"}]};function eo(t,e,i=0,n,r=0){let s=0,o=!0,l=-1,a=-1,h=!1,c=()=>{n.push(t.elt("TableCell",r+l,r+a,t.parser.parseInline(e.slice(l,a),r+l)))};for(let f=i;f<e.length;f++){let u=e.charCodeAt(f);u==124&&!h?((!o||l>-1)&&s++,o=!1,n&&(l>-1&&c(),n.push(t.elt("TableDelimiter",f+r,f+r+1))),l=a=-1):(h||u!=32&&u!=9)&&(l<0&&(l=f),a=f+1),h=!h&&u==92}return l>-1&&(s++,n&&c()),s}function fy(t,e){for(let i=e;i<t.length;i++){let n=t.charCodeAt(i);if(n==124)return!0;n==92&&i++}return!1}var Dy=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,ca=class{constructor(){this.rows=null}nextLine(e,i,n){if(this.rows==null){this.rows=!1;let r;if((i.next==45||i.next==58||i.next==124)&&Dy.test(r=i.text.slice(i.pos))){let s=[];eo(e,n.content,0,s,n.start)==eo(e,r,0)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+i.pos,e.lineStart+i.text.length)])}}else if(this.rows){let r=[];eo(e,i.text,i.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+i.pos,e.lineStart+i.text.length,r))}return!1}finish(e,i){return this.rows?(e.addLeafElement(i,e.elt("Table",i.start,i.start+i.content.length,this.rows)),!0):!1}},YT={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":O.heading}},"TableRow",{name:"TableCell",style:O.content},{name:"TableDelimiter",style:O.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return fy(e.content,0)?new ca:null},endLeaf(t,e,i){if(i.parsers.some(r=>r instanceof ca)||!fy(e.text,e.basePos))return!1;let n=t.peekLine();return Dy.test(n)&&eo(t,e.text,e.basePos)==eo(t,n,e.basePos)},before:"SetextHeading"}]},Ju=class{nextLine(){return!1}finish(e,i){return e.addLeafElement(i,e.elt("Task",i.start,i.start+i.content.length,[e.elt("TaskMarker",i.start,i.start+3),...e.parser.parseInline(i.content.slice(3),i.start+3)])),!0}},qT={defineNodes:[{name:"Task",block:!0,style:O.list},{name:"TaskMarker",style:O.atom}],parseBlock:[{name:
Line truncated
|
|
|
|
|
`);n=r<0?i:i.slice(0,r)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,i,n=0){this.block=ra.create(e,n,this.lineStart+i,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,i,n=0){this.startContext(this.parser.getNodeType(e),i,n)}addNode(e,i,n){typeof e=="number"&&(e=new Me(this.parser.nodeSet.types[e],Rr,Rr,(n!=null?n:this.prevLineEnd())-i)),this.block.addChild(e,i-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,i){this.addNode(this.buffer.writeElements(Fu(i.children,e.marks),-i.from).finish(i.type,i.to-i.from),i.from)}finishContext(){let e=this.stack.pop(),i=this.stack[this.stack.length-1];i.addChild(e.toTree(this.parser.nodeSet),e.from-i.from),this.block=i}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?$y(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let i=Fu(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(i,-e.start).finish(A.Paragraph,e.content.length),e.start)}elt(e,i,n,r){return typeof e=="string"?oe(this.parser.getNodeType(e),i,n,r):new oa(e,i)}get buffer(){return new sa(this.parser.nodeSet)}};function $y(t,e,i,n,r){let s=t[e].to,o=[],l=[],a=i.from+n;function h(c,f){for(;f?c>=s:c>s;){let u=t[e+1].from-s;n+=u,c+=u,e++,s=t[e].to}}for(let c=i.firstChild;c;c=c.nextSibling){h(c.from+n,!0);let f=c.from+n,u,d=r.get(c.tree);d?u=d:c.to+n>s?(u=$y(t,e,c,n,r),h(c.to+n,!1)):u=c.toTree(),o.push(u),l.push(f-a)}return h(i.to+n,!1),new Me(i.type,o,l,i.to+n-a,i.tree?i.tree.propValues:void 0)}var to=class t extends Jl{constructor(e,i,n,r,s,o,l,a,h){super(),this.nodeSet=e,this.blockParsers=i,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=a,this.wrappers=h,this.nodeTypes=Object.create(null);for(let c of e.types)this.nodeTypes[c.name]=c.id}createParse(e,i,n){let r=new Gu(this,e,i,n);for(let s of this.wrappers)r=s(r,e,i,n);return r}configure(e){let i=Uu(e);if(!i)return this;let{nodeSet:n,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),a=this.inlineParsers.slice(),h=this.inlineNames.slice(),c=this.endLeafBlock.slice(),f=this.wrappers;if(Ks(i.defineNodes)){r=Object.assign({},r);let u=n.types.slice(),d;for(let p of i.defineNodes){let{name:g,block:m,composite:b,style:y}=typeof p=="string"?{name:p}:p;if(u.some(x=>x.name==g))continue;b&&(r[u.length]=(x,w,k)=>b(w,k,x.value));let S=u.length,v=b?["Block","BlockContext"]:m?S>=A.ATXHeading1&&S<=A.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;u.push(tt.define({id:S,name:g,props:v&&[[de.group,v]]})),y&&(d||(d={}),Array.isArray(y)||y instanceof $e?d[g]=y:Object.assign(d,y))}n=new Us(u),d&&(n=n.extend(at(d)))}if(Ks(i.props)&&(n=n.extend(...i.props)),Ks(i.remove))for(let u of i.remove){let d=this.blockNames.indexOf(u),p=this.inlineNames.indexOf(u);d>-1&&(s[d]=o[d]=void 0),p>-1&&(a[p]=void 0)}if(Ks(i.parseBlock))for(let u of i.parseBlock){let d=l.indexOf(u.name);if(d>-1)s[d]=u.parse,o[d]=u.leaf;else{let p=u.before?na(l,u.before):u.after?na(l,u.after)+1:l.length-1;s.splice(p,0,u.parse),o.splice(p,0,u.leaf),l.splice(p,0,u.name)}u.endLeaf&&c.push(u.endLeaf)}if(Ks(i.parseInline))for(let u of i.parseInline){let d=h.indexOf(u.name);if(d>-1)a[d]=u.parse;else{let p=u.before?na(h,u.before):u.after?na(h,u.after)+1:h.length-1;a.splice(p,0,u.parse),h.splice(p,0,u.name)}}return i.wrap&&(f=f.concat(i.wrap)),new t(n,s,o,l,c,r,a,h,f)}getNodeType(e){let i=this.nodeTypes[e];if(i==null)throw new RangeError(`Unknown node type '${e}'`);return i}parseInline(e,i){let n=new no(this,e,i);e:for(let r=i;r<n.end;){let s=n.char(r);for(let o of this.inlineParsers)if(o){let l=o(n,s,r);if(l>=0){r=l;continue e}}r++}return n.resolveMarkers(0)}};function Ks(t){return t!=null&&t.length>0}function Uu(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=Uu(t[0]);if(t.length==1)return e;let i=Uu(t.slice(1));if(!i||!e)return e||i;let n=(o,l)=>(o||Rr).concat(l||Rr),r=e.wrap,s=i.wrap;return{props:n(e.props,i.props),defineNodes:n(e.defineNodes,i.defineNodes),parseBlock:n(e.parseBlock,i.parseBlock),parseInline:n(e.parseInline,i.parseInline),remove:n(e.remove,i.remove),wrap:r?s?(o,l,a,h)=>r(s(o,l,a,h),l,a,h):r:s}}function na(t,e){let i=t.indexOf(e);if(i<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return i}var Ty=[tt.none];for(let t=1,e;e=A[t];t++)Ty[t]=tt.define({id:t,name:e,props:t>=A.Escape?[]:[[de.group,t in my?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var Rr=[],sa=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,i,n,
Line truncated
|
|
|
|
|
`;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=i;if(!n.childAfter(r))return!1}}matches(e){let i=this.cursor.tree;return i&&i.prop(de.contextHash)==e}takeNodes(e){let i=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,h=l;for(;;){if(i.to-n>r){if(i.type.isAnonymous&&i.firstChild())continue;break}let c=Ly(i.from-n,e.ranges);if(i.to-n<=e.ranges[e.rangeI].to)e.addNode(i.tree,c);else{let f=new Me(e.parser.nodeSet.types[A.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,i.tree),e.addNode(f,c)}if(i.type.is("Block")&&(jT.indexOf(i.type.id)<0?(o=i.to-n,l=e.block.children.length):(o=a,l=h),a=i.to-n,h=e.block.children.length),!i.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function Ly(t,e){let i=t;for(let n=1;n<e.length;n++){let r=e[n-1].to,s=e[n].from;r<t&&(i-=s-r)}return i}var zT=at({"Blockquote/...":O.quote,HorizontalRule:O.contentSeparator,"ATXHeading1/... SetextHeading1/...":O.heading1,"ATXHeading2/... SetextHeading2/...":O.heading2,"ATXHeading3/...":O.heading3,"ATXHeading4/...":O.heading4,"ATXHeading5/...":O.heading5,"ATXHeading6/...":O.heading6,"Comment CommentBlock":O.comment,Escape:O.escape,Entity:O.character,"Emphasis/...":O.emphasis,"StrongEmphasis/...":O.strong,"Link/... Image/...":O.link,"OrderedList/... BulletList/...":O.list,"BlockQuote/...":O.quote,"InlineCode CodeText":O.monospace,"URL Autolink":O.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":O.processingInstruction,"CodeInfo LinkLabel":O.labelName,LinkTitle:O.string,Paragraph:O.content}),Xy=new to(new Us(Ty).extend(zT),Object.keys(ia).map(t=>ia[t]),Object.keys(ia).map(t=>Py[t]),Object.keys(ia),IT,my,Object.keys(Nu).map(t=>Nu[t]),Object.keys(Nu),[]);function YT(t,e,i){let n=[];for(let r=t.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:i;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function _y(t){let{codeParser:e,htmlParser:i}=t;return{wrap:sy((r,s)=>{let o=r.type.id;if(e&&(o==A.CodeBlock||o==A.FencedCode)){let l="";if(o==A.FencedCode){let h=r.node.getChild(A.CodeInfo);h&&(l=s.read(h.from,h.to))}let a=e(l);if(a)return{parser:a,overlay:h=>h.type.id==A.CodeText,bracketed:o==A.FencedCode}}else if(i&&(o==A.HTMLBlock||o==A.HTMLTag||o==A.CommentBlock))return{parser:i,overlay:YT(r.node,r.from,r.to)};return null})}}var qT={resolve:"Strikethrough",mark:"StrikethroughMark"},WT={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":O.strikethrough}},{name:"StrikethroughMark",style:O.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,i){if(e!=126||t.char(i+1)!=126||t.char(i+2)==126)return-1;let n=t.slice(i-1,i),r=t.slice(i+2,i+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=io.test(n),a=io.test(r);return t.addDelimiter(qT,i,i+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:"Emphasis"}]};function eo(t,e,i=0,n,r=0){let s=0,o=!0,l=-1,a=-1,h=!1,c=()=>{n.push(t.elt("TableCell",r+l,r+a,t.parser.parseInline(e.slice(l,a),r+l)))};for(let f=i;f<e.length;f++){let u=e.charCodeAt(f);u==124&&!h?((!o||l>-1)&&s++,o=!1,n&&(l>-1&&c(),n.push(t.elt("TableDelimiter",f+r,f+r+1))),l=a=-1):(h||u!=32&&u!=9)&&(l<0&&(l=f),a=f+1),h=!h&&u==92}return l>-1&&(s++,n&&c()),s}function hy(t,e){for(let i=e;i<t.length;i++){let n=t.charCodeAt(i);if(n==124)return!0;n==92&&i++}return!1}var Zy=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,aa=class{constructor(){this.rows=null}nextLine(e,i,n){if(this.rows==null){this.rows=!1;let r;if((i.next==45||i.next==58||i.next==124)&&Zy.test(r=i.text.slice(i.pos))){let s=[];eo(e,n.content,0,s,n.start)==eo(e,r,0)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+i.pos,e.lineStart+i.text.length)])}}else if(this.rows){let r=[];eo(e,i.text,i.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+i.pos,e.lineStart+i.text.length,r))}return!1}finish(e,i){return this.rows?(e.addLeafElement(i,e.elt("Table",i.start,i.start+i.content.length,this.rows)),!0):!1}},VT={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":O.heading}},"TableRow",{name:"TableCell",style:O.content},{name:"TableDelimiter",style:O.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return hy(e.content,0)?new aa:null},endLeaf(t,e,i){if(i.parsers.some(r=>r instanceof aa)||!hy(e.text,e.basePos))return!1;let n=t.peekLine();return Zy.test(n)&&eo(t,e.text,e.basePos)==eo(t,n,e.basePos)},before:"SetextHeading"}]},Ku=class{nextLine(){return!1}finish(e,i){return e.addLeafElement(i,e.elt("Task",i.start,i.start+i.content.length,[e.elt("TaskMarker",i.start,i.start+3),...e.parser.parseInline(i.content.slice(3),i.start+3)])),!0}},GT={defineNodes:[{name:"Task",block:!0,style:O.list},{name:"TaskMarker",style:O.atom}],parseBlock:[{name:
Line truncated
|
|
|
|
|
\${}
|
|
|
|
|
} catch (\${error}) {
|
|
|
|
|
\${}
|
|
|
|
@@ -29,15 +29,15 @@ https://github.com/highlightjs/highlight.js/issues/2277`),te=P,Y=D),V===void 0&&
|
|
|
|
|
constructor(\${params}) {
|
|
|
|
|
\${}
|
|
|
|
|
}
|
|
|
|
|
}`,{label:"class",detail:"definition",type:"keyword"}),M('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),M('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],jA=P1.concat([M("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),M("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),M("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),w1=new mr,$1=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function oo(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}var zA=["FunctionDeclaration"],YA={FunctionDeclaration:oo("function"),ClassDeclaration:oo("class"),ClassExpression:()=>!0,EnumDeclaration:oo("constant"),TypeAliasDeclaration:oo("type"),NamespaceDeclaration:oo("namespace"),VariableDefinition(t,e){t.matchContext(zA)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function T1(t,e){let i=w1.get(e);if(i)return i;let n=[],r=!0;function s(o,l){let a=t.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(be.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=YA[o.name];if(l&&l(o,s)||$1.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of T1(t,o.node))n.push(l);return!1}}),w1.set(e,n),n}var v1=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,C1=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function qA(t){let e=fe(t.state).resolveInner(t.pos,-1);if(C1.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&v1.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let r=e;r;r=r.parent)$1.has(r.name)&&(n=n.concat(T1(t.state.doc,r)));return{options:n,from:i?e.from:t.pos,validFor:v1}}var Ft=qt.define({name:"javascript",parser:k1.configure({props:[Et.add({IfStatement:xr({except:/^\s*({|else\b)/}),TryStatement:xr({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:u0,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:Ds({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":xr({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Mt.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":kr,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let i=t.lastChild;return{from:e.to,to:i.type.isError?t.to:i.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let i=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,n=t.lastChild;return!i||i.type.isError?null:{from:i.to,to:n.type.isError?t.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),A1={test:t=>/^JSX/.test(t.name),facet:yr({commentTokens:{block:{open:"{/*",close:"*/}"}}})},md=Ft.configure({dialect:"ts"},"typescript"),bd=Ft.configure({dialect:"jsx",props:[Ml.add(t=>t.isTop?[A1]:void 0)]}),yd=Ft.configure({dialect:"jsx ts",props:[Ml.add(t=>t.isTop?[A1]:void 0)]},"typescript"),R1=t=>({label:t,type:"keyword"}),E1="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(R1),WA=E1.concat(["declare","implements","private","protected","public"].map(R1));function M1(t={}){let e=t.jsx?t.typescript?yd:bd:t.typescript?md:Ft,i=t.typescript?jA.concat(WA):P1.concat(E1);return new Pt(e,[Ft.data.of({autocomplete:Bb(C1,xu(i))}),Ft.data.of({autocomplete:qA}),t.jsx?UA:[]])}function VA(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function Q1(t,e,i=t.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return t.sliceString(n.from,Math.min(n.to,i));return""}var GA=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),UA=T.inputHandler.of((t,e,i,n,r)=>{if((GA?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||n!=">"&&n!="/"||!Ft.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var h;let{head:c}=a,f=fe(o).resolveInn
Line truncated
|
|
|
|
|
${a}`}let f=Xd(t.buffer,r[l],s[l],t.position,c);a+=`${" ".repeat(i.indent)}${_d((t.line+1).toString(),h)} | ${f.str}
|
|
|
|
|
}`,{label:"class",detail:"definition",type:"keyword"}),M('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),M('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],qA=Q1.concat([M("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),M("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),M("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),k1=new mr,P1=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function oo(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}var WA=["FunctionDeclaration"],VA={FunctionDeclaration:oo("function"),ClassDeclaration:oo("class"),ClassExpression:()=>!0,EnumDeclaration:oo("constant"),TypeAliasDeclaration:oo("type"),NamespaceDeclaration:oo("namespace"),VariableDefinition(t,e){t.matchContext(WA)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function $1(t,e){let i=k1.get(e);if(i)return i;let n=[],r=!0;function s(o,l){let a=t.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(be.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=VA[o.name];if(l&&l(o,s)||P1.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of $1(t,o.node))n.push(l);return!1}}),k1.set(e,n),n}var w1=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,T1=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function GA(t){let e=fe(t.state).resolveInner(t.pos,-1);if(T1.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&w1.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let r=e;r;r=r.parent)P1.has(r.name)&&(n=n.concat($1(t.state.doc,r)));return{options:n,from:i?e.from:t.pos,validFor:w1}}var Ft=qt.define({name:"javascript",parser:x1.configure({props:[Et.add({IfStatement:xr({except:/^\s*({|else\b)/}),TryStatement:xr({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:f0,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:Ds({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":xr({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),Mt.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":kr,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let i=t.lastChild;return{from:e.to,to:i.type.isError?t.to:i.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let i=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,n=t.lastChild;return!i||i.type.isError?null:{from:i.to,to:n.type.isError?t.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),C1={test:t=>/^JSX/.test(t.name),facet:yr({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Od=Ft.configure({dialect:"ts"},"typescript"),md=Ft.configure({dialect:"jsx",props:[El.add(t=>t.isTop?[C1]:void 0)]}),bd=Ft.configure({dialect:"jsx ts",props:[El.add(t=>t.isTop?[C1]:void 0)]},"typescript"),A1=t=>({label:t,type:"keyword"}),R1="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(A1),UA=R1.concat(["declare","implements","private","protected","public"].map(A1));function E1(t={}){let e=t.jsx?t.typescript?bd:md:t.typescript?Od:Ft,i=t.typescript?qA.concat(UA):Q1.concat(R1);return new Pt(e,[Ft.data.of({autocomplete:Ib(T1,Su(i))}),Ft.data.of({autocomplete:GA}),t.jsx?KA:[]])}function FA(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function v1(t,e,i=t.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return t.sliceString(n.from,Math.min(n.to,i));return""}var HA=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),KA=T.inputHandler.of((t,e,i,n,r)=>{if((HA?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||n!=">"&&n!="/"||!Ft.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var h;let{head:c}=a,f=fe(o).resolveInn
Line truncated
|
|
|
|
|
${a}`}let f=Ld(t.buffer,r[l],s[l],t.position,c);a+=`${" ".repeat(i.indent)}${Xd((t.line+1).toString(),h)} | ${f.str}
|
|
|
|
|
`,a+=`${"-".repeat(i.indent+h+3+f.pos)}^
|
|
|
|
|
`;for(let u=1;u<=i.linesAfter&&!(l+u>=s.length);u++){let d=Xd(t.buffer,r[l+u],s[l+u],t.position-(r[l]-r[l+u]),c);a+=`${" ".repeat(i.indent)}${_d((t.line+u+1).toString(),h)} | ${d.str}
|
|
|
|
|
`}return a.replace(/\n$/,"")}function kS(t,e){let i="";return t.mark?(t.mark.name&&(i+=`in "${t.mark.name}" `),i+=`(${t.mark.line+1}:${t.mark.column+1})`,!e&&t.mark.snippet&&(i+=`
|
|
|
|
|
`;for(let u=1;u<=i.linesAfter&&!(l+u>=s.length);u++){let d=Ld(t.buffer,r[l+u],s[l+u],t.position-(r[l]-r[l+u]),c);a+=`${" ".repeat(i.indent)}${Xd((t.line+u+1).toString(),h)} | ${d.str}
|
|
|
|
|
`}return a.replace(/\n$/,"")}function xS(t,e){let i="";return t.mark?(t.mark.name&&(i+=`in "${t.mark.name}" `),i+=`(${t.mark.line+1}:${t.mark.column+1})`,!e&&t.mark.snippet&&(i+=`
|
|
|
|
|
|
|
|
|
|
${t.mark.snippet}`),`${t.reason} ${i}`):t.reason}var MS=class extends Error{constructor(e,i){super();K(this,"reason");K(this,"mark");this.name="YAMLException",this.reason=e,this.mark=i,this.message=kS(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${kS(this,e)}`}};function Ca(t,e,i,n=""){let r=0,s=0;for(let l=0;l<e;l++){let a=t.charCodeAt(l);a===10?(r++,s=l+1):a===13&&(r++,t.charCodeAt(l+1)===10&&l++,s=l+1)}let o={name:n,buffer:t,position:e,line:r,column:e-s};throw o.snippet=Z2(o),new MS(i,o)}var D2=-1;function wS(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
|
|
|
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}var LS=new Array(256),XS=new Array(256);for(let t=0;t<256;t++)LS[t]=wS(t)?1:0,XS[t]=wS(t);function I2(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function B2(t){return t>=48&&t<=57?t-48:(t|32)-97+10}function N2(t){return t===120?2:t===117?4:8}function wa(t,e,i){let n=0;for(;e<i;){let r=t.charCodeAt(e);if(r===10)n++,e++;else if(r===13)n++,e++,t.charCodeAt(e)===10&&e++;else if(r===32||r===9)e++;else break}return{position:e,breaks:n}}function Ud(t){return t===1?" ":`
|
|
|
|
|
`.repeat(t-1)}function j2(t,e,i){let n="",r=e,s=e,o=e;for(;r<i;){let l=t.charCodeAt(r);if(l===10||l===13){n+=t.slice(s,o);let a=wa(t,r,i);n+=Ud(a.breaks),r=s=o=a.position}else r++,l!==32&&l!==9&&(o=r)}return n+t.slice(s,o)}function z2(t,e,i){let n="",r=e,s=e,o=e;for(;r<i;){let l=t.charCodeAt(r);if(l===39)n+=t.slice(s,r)+"'",r+=2,s=o=r;else if(l===10||l===13){n+=t.slice(s,o);let a=wa(t,r,i);n+=Ud(a.breaks),r=s=o=a.position}else r++,l!==32&&l!==9&&(o=r)}return n+t.slice(s,i)}function Y2(t,e,i){let n="",r=e,s=e,o=e;for(;r<i;){let l=t.charCodeAt(r);if(l===92){n+=t.slice(s,r),r++;let a=t.charCodeAt(r);if(a===10||a===13)r=wa(t,r,i).position;else if(a<256&&LS[a])n+=XS[a],r++;else{let h=N2(a),c=0;for(;h>0;h--){r++;let f=B2(t.charCodeAt(r));c=(c<<4)+f}n+=I2(c),r++}s=o=r}else if(l===10||l===13){n+=t.slice(s,o);let a=wa(t,r,i);n+=Ud(a.breaks),r=s=o=a.position}else r++,l!==32&&l!==9&&(o=r)}return n+t.slice(s,i)}function vS(t,e,i,n,r,s){let o=n<0?0:n,l=t.slice(e,i).replace(/\r\n?/g,`
|
|
|
|
|
${t.mark.snippet}`),`${t.reason} ${i}`):t.reason}var ES=class extends Error{constructor(e,i){super();K(this,"reason");K(this,"mark");this.name="YAMLException",this.reason=e,this.mark=i,this.message=xS(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${xS(this,e)}`}};function Ta(t,e,i,n=""){let r=0,s=0;for(let l=0;l<e;l++){let a=t.charCodeAt(l);a===10?(r++,s=l+1):a===13&&(r++,t.charCodeAt(l+1)===10&&l++,s=l+1)}let o={name:n,buffer:t,position:e,line:r,column:e-s};throw o.snippet=B2(o),new ES(i,o)}var N2=-1;function kS(t){switch(t){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
|
|
|
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}var MS=new Array(256),LS=new Array(256);for(let t=0;t<256;t++)MS[t]=kS(t)?1:0,LS[t]=kS(t);function j2(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function z2(t){return t>=48&&t<=57?t-48:(t|32)-97+10}function Y2(t){return t===120?2:t===117?4:8}function ka(t,e,i){let n=0;for(;e<i;){let r=t.charCodeAt(e);if(r===10)n++,e++;else if(r===13)n++,e++,t.charCodeAt(e)===10&&e++;else if(r===32||r===9)e++;else break}return{position:e,breaks:n}}function Gd(t){return t===1?" ":`
|
|
|
|
|
`.repeat(t-1)}function q2(t,e,i){let n="",r=e,s=e,o=e;for(;r<i;){let l=t.charCodeAt(r);if(l===10||l===13){n+=t.slice(s,o);let a=ka(t,r,i);n+=Gd(a.breaks),r=s=o=a.position}else r++,l!==32&&l!==9&&(o=r)}return n+t.slice(s,o)}function W2(t,e,i){let n="",r=e,s=e,o=e;for(;r<i;){let l=t.charCodeAt(r);if(l===39)n+=t.slice(s,r)+"'",r+=2,s=o=r;else if(l===10||l===13){n+=t.slice(s,o);let a=ka(t,r,i);n+=Gd(a.breaks),r=s=o=a.position}else r++,l!==32&&l!==9&&(o=r)}return n+t.slice(s,i)}function V2(t,e,i){let n="",r=e,s=e,o=e;for(;r<i;){let l=t.charCodeAt(r);if(l===92){n+=t.slice(s,r),r++;let a=t.charCodeAt(r);if(a===10||a===13)r=ka(t,r,i).position;else if(a<256&&MS[a])n+=LS[a],r++;else{let h=Y2(a),c=0;for(;h>0;h--){r++;let f=z2(t.charCodeAt(r));c=(c<<4)+f}n+=j2(c),r++}s=o=r}else if(l===10||l===13){n+=t.slice(s,o);let a=ka(t,r,i);n+=Gd(a.breaks),r=s=o=a.position}else r++,l!==32&&l!==9&&(o=r)}return n+t.slice(s,i)}function wS(t,e,i,n,r,s){let o=n<0?0:n,l=t.slice(e,i).replace(/\r\n?/g,`
|
|
|
|
|
`),a=l===""?[]:(l.endsWith(`
|
|
|
|
|
`)?l.slice(0,-1):l).split(`
|
|
|
|
|
`),h="",c=!1,f=0,u=!1;for(let d of a){let p=0;for(;p<o&&d.charCodeAt(p)===32;)p++;if(n<0||p>=d.length){f++;continue}let g=d.slice(o),m=g.charCodeAt(0);s?m===32||m===9?(u=!0,h+=`
|
|
|
|
@@ -46,13 +46,13 @@ ${t.mark.snippet}`),`${t.reason} ${i}`):t.reason}var MS=class extends Error{cons
|
|
|
|
|
`.repeat(f):h+=`
|
|
|
|
|
`.repeat(c?1+f:f),h+=g,c=!0,f=0}return r===3?h+=`
|
|
|
|
|
`.repeat(c?1+f:f):r!==2&&c&&(h+=`
|
|
|
|
|
`),h}function q2(t,e){if(e.valueStart===D2)return"";let{valueStart:i,valueEnd:n}=e;if(e.fast)return t.slice(i,n);switch(e.style){case 2:return z2(t,i,n);case 3:return Y2(t,i,n);case 4:return vS(t,i,n,e.indent,e.chomping,!1);case 5:return vS(t,i,n,e.indent,e.chomping,!0);default:return j2(t,i,n)}}var W2={"!":"!","!!":"tag:yaml.org,2002:"};function _S(t,e){var s,o;if(t.startsWith("!<")&&t.endsWith(">"))return decodeURIComponent(t.slice(2,-1));let i=t.indexOf("!",1),n=i===-1?"!":t.slice(0,i+1),r=(o=(s=e==null?void 0:e[n])!=null?s:W2[n])!=null?o:n;return decodeURIComponent(r)+decodeURIComponent(t.slice(n.length))}var _r=-1,Fd={filename:"",schema:X2,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function V2(t){return"tagStart"in t&&t.tagStart!==_r?t.tagStart:"anchorStart"in t&&t.anchorStart!==_r?t.anchorStart:"valueStart"in t&&t.valueStart!==_r?t.valueStart:"start"in t?t.start:0}function xt(t,e){Ca(t.source,t.position,e,t.filename)}function ZS(t,e,i,n){try{return i.finalize(n)}catch(r){if(r instanceof MS)throw r;Ca(t.source,e,r instanceof Error?r.message:String(r),t.filename)}}function ka(t,e,i){let n=t[i];if(n)return n;for(let r of e)if(i.startsWith(r.tagName))return r}function G2(t,e,i,n,r){let s=ka(e,i,n);if(s)return s;xt(t,`unknown ${r} tag !<${n}>`)}function U2(t,e){var s,o;let i=q2(t.source,e),n=e.tagStart===_r?"":t.source.slice(e.tagStart,e.tagEnd),r=t.schema.defaultScalarTag;if(n!==""){if(n==="!")return{value:i,tag:r};let l=_S(n,t.tagHandlers),a=ka(t.schema.exact.scalar,t.schema.prefix.scalar,l);if(a){let c=a.resolve(i,!0,l);return c===ae&&xt(t,`cannot resolve a node with !<${l}> explicit tag`),{value:c,tag:a}}let h=(s=ka(t.schema.exact.mapping,t.schema.prefix.mapping,l))!=null?s:ka(t.schema.exact.sequence,t.schema.prefix.sequence,l);if(h){i!==""&&xt(t,`cannot resolve a node with !<${l}> explicit tag`);let c=h.create(l);return{value:h.carrierIsResult?c:ZS(t,t.position,h,c),tag:h}}xt(t,`unknown scalar tag !<${l}>`)}if(e.style===1){let l=(o=t.schema.implicitScalarByFirstChar.get(i.charAt(0)))!=null?o:t.schema.implicitScalarAnyFirstChar;for(let a of l){let h=a.resolve(i,!1,a.tagName);if(h!==ae)return{value:h,tag:a}}}return{value:r.resolve(i,!1,r.tagName),tag:r}}function QS(t,e,i,n,r,s){let o=e.tagStart===_r?"":t.source.slice(e.tagStart,e.tagEnd),l=o===""||o==="!"?r:_S(o,t.tagHandlers);return{tagName:l,tag:G2(t,i,n,l,s)}}function DS(t){return t.nodeKind==="mapping"}function PS(t,e,i,n){var r;for(let s of n.keys(i)){if(t.maxTotalMergeKeys!==-1&&++t.totalMergeKeys>t.maxTotalMergeKeys&&xt(t,`merge keys exceeded maxTotalMergeKeys (${t.maxTotalMergeKeys})`),e.tag.has(e.value,s))continue;let o=e.tag.addPair(e.value,s,n.get(i,s));o&&xt(t,o),((r=e.overridable)!=null?r:e.overridable=new Set).add(s)}}function F2(t,e,i,n){if(t.position=e.keyPosition,DS(n))PS(t,e,i,n);else if(n.nodeKind==="sequence"&&Array.isArray(i))for(let r of i)PS(t,e,r,e.tag);else xt(t,"cannot merge mappings; the provided source object is unacceptable")}function H2(t,e,i,n,r){var o,l;if(t.position=e.keyPosition,i===qd){F2(t,e,n,r);return}!t.json&&e.tag.has(e.value,i)&&!((o=e.overridable)!=null&&o.has(i))&&xt(t,"duplicated mapping key");let s=e.tag.addPair(e.value,i,n);s&&xt(t,s),(l=e.overridable)==null||l.delete(i)}function Zd(t,e,i){let n=t.frames[t.frames.length-1];if(n.kind==="document")n.value=e,n.hasValue=!0;else if(n.kind==="sequence"){n.merge&&(DS(i)||xt(t,"cannot merge mappings; the provided source object is unacceptable"));let r=n.tag.addItem(n.value,e,n.index++);r&&xt(t,r)}else if(n.hasKey){let r=n.key;n.key=void 0,n.hasKey=!1,H2(t,n,r,e,i)}else n.key=e,n.keyPosition=t.position,n.hasKey=!0}function Dd(t,e,i,n,r){if(e.anchorStart!==_r){let s={value:i,tag:n,isValueFinal:r};return t.anchors.set(t.source.slice(e.anchorStart,e.anchorEnd),s),s}return null}function K2(t,e){let i={...Fd,...e,events:t,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;i.eventIndex<i.events.length;){let n=i.events[i.eventIndex++];switch(i.position=V2(n),n.type){case 1:i.anchors=new Map,i.aliasCount=0,i.tagHandlers=Object.create(null);for(let r of n.directives)r.kind==="tag"&&(i.tagHandlers[r.handle]=r.prefix);i.frames.push({kind:"document",position:i.position,value:void 0,hasValue:!1});break;case 4:{let{value:r,tag:s}=U2(i,n);Dd(i,n,r,s,!0),Zd(i,r,s);break}case 2:{let r=QS(i,n,i.schema.exact.sequence,i.schema.prefix.sequence,"tag:yaml.org,2002:seq","sequence"),s=r.tag.create(r.tagName),o=Dd(i,n,s,r.tag,r.tag.carrierIsResult),l=i.frames[i.frames.length-1],a=l!==void 0&&l.kind==="mapping"&&l.hasKey&&l.key===qd;i.frames.push({kind:"sequence",position:i.position,value:s,tag:r.tag,anchor:o,index:0,merge:a});break}case 3:{let r=QS(i,n,i.schema.exact.mapping,i.schema.prefix.mapping,"tag:yaml.org,2002:map","mapping"),s=r.tag.create(r.tagName),o=Dd(i,n,s,r.tag,r.tag.carrierIsResult);i.frames.push({kind:"mapping",position:i.position,value:s,tag:r.tag,anchor:o,key:void 0,keyPosition:i.position,hasK
Line truncated
|
|
|
|
|
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new tp(this):new ep(this)}getCursor(e,i=0,n){let r=e.doc?e:he.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?Br(this,r,i,n):Ir(this,r,i,n)}},Da=class{constructor(e){this.spec=e}};function Ir(t,e,i,n){return new tn(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:r=>r.toLowerCase(),t.wholeWord?DE(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function DE(t,e){return(i,n,r,s)=>((s>i||s+r.length<n)&&(s=Math.max(0,i-2),r=t.sliceString(s,Math.min(t.length,n+2))),(e(Ia(r,i-s))!=ke.Word||e(Ba(r,i-s))!=ke.Word)&&(e(Ba(r,n-s))!=ke.Word||e(Ia(r,n-s))!=ke.Word))}var ep=class extends Da{constructor(e){super(e)}nextMatch(e,i,n){let r=Ir(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,i+this.spec.unquoted.length);r=Ir(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==i&&r.value.to==n?null:r.value}prevMatchInRange(e,i,n){for(let r=n;;){let s=Math.max(i,r-1e4-this.spec.unquoted.length),o=Ir(this.spec,e,s,r),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==i)return null;r-=1e4}}prevMatch(e,i,n){let r=this.prevMatchInRange(e,0,i);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=i||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,i){let n=Ir(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=Ir(this.spec,e,Math.max(0,i-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}};function Br(t,e,i,n){return new Ea(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?IE(e.charCategorizer(e.selection.main.head)):void 0},i,n)}function Ia(t,e){return t.slice(Xe(t,e,!1),e)}function Ba(t,e){return t.slice(e,Xe(t,e))}function IE(t){return(e,i,n)=>!n[0].length||(t(Ia(n.input,n.index))!=ke.Word||t(Ba(n.input,n.index))!=ke.Word)&&(t(Ba(n.input,n.index+n[0].length))!=ke.Word||t(Ia(n.input,n.index+n[0].length))!=ke.Word)}var tp=class extends Da{nextMatch(e,i,n){let r=Br(this.spec,e,n,e.doc.length).next();return r.done&&(r=Br(this.spec,e,0,i).next()),r.done?null:r.value}prevMatchInRange(e,i,n){for(let r=1;;r++){let s=Math.max(i,n-r*1e4),o=Br(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==i||l.from>s+10))return l;if(s==i)return null}}prevMatch(e,i,n){return this.prevMatchInRange(e,0,i)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(i,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n<e.match.length?e.match[n]:i)}matchAll(e,i){let n=Br(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=Br(this.spec,e,Math.max(0,i-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}},uo=W.define(),ap=W.define(),en=ge.define({create(t){return new fo(ip(t).create(),null)},update(t,e){for(let i of e.effects)i.is(uo)?t=new fo(i.value.create(),t.panel):i.is(ap)&&(t=new fo(t.query,i.value?cp:null));return t},provide:t=>mn.from(t,e=>e.panel)});var fo=class{constructor(e,i){this.query=e,this.panel=i}},BE=X.mark({class:"cm-searchMatch"}),NE=X.mark({class:"cm-searchMatch cm-searchMatch-selected"}),jE=me.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(en))}update(t){let e=t.state.field(en);(e!=t.startState.field(en)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return X.none;let{view:i}=this,n=new Ee;for(let r=0,s=i.visibleRanges,o=s.length;r<o;r++){let{from:l,to:a}=s[r];for(;r<o-1&&a>s[r+1].from-500;)a=s[++r].to;t.highlight(i.state,l,a,(h,c)=>{let f=i.state.selection.ranges.some(u=>u.from==h&&u.to==c);n.add(h,c,f?NE:BE)})}return n.finish()}},{decorations:t=>t.decorations});function po(t){return e=>{let i=e.state.field(en,!1);return i&&i.query.spec.valid?t(e,i):ex(e)}}var Na=po((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let r=Q.single(n.from,n.to),s=t.state.facet(_n);return t.dispatch({selection:r,effects:[fp(t,n),s.scrollToMatch(r.main,t)],userEvent:"select.search"}),JS(t),!0}),ja=po((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,r=e.prevMatch(i,n,n);if(!r)return!1;let s=Q.single(r.from,r.to),o=t.state.facet(_n);return t.dispatch({selection:s,effects:[fp(t,r),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),JS(t),!0}),zE=po((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!i||!i.length?!1:(t.dispatch({selection:Q.create(i.map(n=>Q.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),YE=({state:t,dispatch:e})=>{let i=t.select
Line truncated
|
|
|
|
|
]`).replace("lheading",Kx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},VM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,GM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ek=/^( {2,}|\\)\n(?!\s*$)/,UM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fr=/[\p{P}\p{S}]/u,oc=/[\s\p{P}\p{S}]/u,eg=/[^\s\p{P}\p{S}]/u,FM=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,oc).getRegex(),tk=/(?!~)[\p{P}\p{S}]/u,HM=/(?!~)[\s\p{P}\p{S}]/u,KM=/(?:[^\s\p{P}\p{S}]|~)/u,JM=le(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",LM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ik=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,eL=le(ik,"u").replace(/punct/g,Fr).getRegex(),tL=le(ik,"u").replace(/punct/g,tk).getRegex(),nk="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",iL=le(nk,"gu").replace(/notPunctSpace/g,eg).replace(/punctSpace/g,oc).replace(/punct/g,Fr).getRegex(),nL=le(nk,"gu").replace(/notPunctSpace/g,KM).replace(/punctSpace/g,HM).replace(/punct/g,tk).getRegex(),rL=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,eg).replace(/punctSpace/g,oc).replace(/punct/g,Fr).getRegex(),sL=le(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Fr).getRegex(),oL="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",lL=le(oL,"gu").replace(/notPunctSpace/g,eg).replace(/punctSpace/g,oc).replace(/punct/g,Fr).getRegex(),aL=le(/\\(punct)/,"gu").replace(/punct/g,Fr).getRegex(),cL=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),hL=le(Kp).replace("(?:-->|$)","-->").getRegex(),fL=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",hL).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ic=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,uL=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ic).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),rk=le(/^!?\[(label)\]\[(ref)\]/).replace("label",ic).replace("ref",Hp).getRegex(),sk=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hp).getRegex(),dL=le("reflink|nolink(?!\\()","g").replace("reflink",rk).replace("nolink",sk).getRegex(),Yx=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,tg={_backpedal:Vn,anyPunctuation:aL,autolink:cL,blockSkip:JM,br:ek,code:GM,del:Vn,delLDelim:Vn,delRDelim:Vn,emStrongLDelim:eL,emStrongRDelimAst:iL,emStrongRDelimUnd:rL,escape:VM,link:uL,nolink:sk,punctuation:FM,reflink:rk,reflinkSearch:dL,tag:fL,text:UM,url:Vn},pL={...tg,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",ic).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ic).getRegex()},qp={...tg,emStrongRDelimAst:nL,emStrongLDelim:tL,delLDelim:sL,delRDelim:lL,url:le(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Yx).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:le(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Yx).getRegex()},gL={...qp,br:le(ek).replace("{2,}","*").getRegex(),text:le(qp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ec={normal:Jp,gfm:qM,pedantic:WM},ko={normal:tg,gfm:qp,breaks:gL,pedantic:pL},OL={"&":"&","<":"<",">":">",'"':""","'":"'"},qx=t=>OL[t];function bi(t,e){if(e){if(nt.escapeTest.test(t))return t.replace(nt.escapeReplace,qx)}else if(nt.escapeTestNoEncode.tesLine truncated
|
|
|
|
|
`),h}function G2(t,e){if(e.valueStart===N2)return"";let{valueStart:i,valueEnd:n}=e;if(e.fast)return t.slice(i,n);switch(e.style){case 2:return W2(t,i,n);case 3:return V2(t,i,n);case 4:return wS(t,i,n,e.indent,e.chomping,!1);case 5:return wS(t,i,n,e.indent,e.chomping,!0);default:return q2(t,i,n)}}var U2={"!":"!","!!":"tag:yaml.org,2002:"};function XS(t,e){var s,o;if(t.startsWith("!<")&&t.endsWith(">"))return decodeURIComponent(t.slice(2,-1));let i=t.indexOf("!",1),n=i===-1?"!":t.slice(0,i+1),r=(o=(s=e==null?void 0:e[n])!=null?s:U2[n])!=null?o:n;return decodeURIComponent(r)+decodeURIComponent(t.slice(n.length))}var _r=-1,Ud={filename:"",schema:D2,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function F2(t){return"tagStart"in t&&t.tagStart!==_r?t.tagStart:"anchorStart"in t&&t.anchorStart!==_r?t.anchorStart:"valueStart"in t&&t.valueStart!==_r?t.valueStart:"start"in t?t.start:0}function xt(t,e){Ta(t.source,t.position,e,t.filename)}function _S(t,e,i,n){try{return i.finalize(n)}catch(r){if(r instanceof ES)throw r;Ta(t.source,e,r instanceof Error?r.message:String(r),t.filename)}}function xa(t,e,i){let n=t[i];if(n)return n;for(let r of e)if(i.startsWith(r.tagName))return r}function H2(t,e,i,n,r){let s=xa(e,i,n);if(s)return s;xt(t,`unknown ${r} tag !<${n}>`)}function K2(t,e){var s,o;let i=G2(t.source,e),n=e.tagStart===_r?"":t.source.slice(e.tagStart,e.tagEnd),r=t.schema.defaultScalarTag;if(n!==""){if(n==="!")return{value:i,tag:r};let l=XS(n,t.tagHandlers),a=xa(t.schema.exact.scalar,t.schema.prefix.scalar,l);if(a){let c=a.resolve(i,!0,l);return c===ae&&xt(t,`cannot resolve a node with !<${l}> explicit tag`),{value:c,tag:a}}let h=(s=xa(t.schema.exact.mapping,t.schema.prefix.mapping,l))!=null?s:xa(t.schema.exact.sequence,t.schema.prefix.sequence,l);if(h){i!==""&&xt(t,`cannot resolve a node with !<${l}> explicit tag`);let c=h.create(l);return{value:h.carrierIsResult?c:_S(t,t.position,h,c),tag:h}}xt(t,`unknown scalar tag !<${l}>`)}if(e.style===1){let l=(o=t.schema.implicitScalarByFirstChar.get(i.charAt(0)))!=null?o:t.schema.implicitScalarAnyFirstChar;for(let a of l){let h=a.resolve(i,!1,a.tagName);if(h!==ae)return{value:h,tag:a}}}return{value:r.resolve(i,!1,r.tagName),tag:r}}function vS(t,e,i,n,r,s){let o=e.tagStart===_r?"":t.source.slice(e.tagStart,e.tagEnd),l=o===""||o==="!"?r:XS(o,t.tagHandlers);return{tagName:l,tag:H2(t,i,n,l,s)}}function ZS(t){return t.nodeKind==="mapping"}function QS(t,e,i,n){var r;for(let s of n.keys(i)){if(t.maxTotalMergeKeys!==-1&&++t.totalMergeKeys>t.maxTotalMergeKeys&&xt(t,`merge keys exceeded maxTotalMergeKeys (${t.maxTotalMergeKeys})`),e.tag.has(e.value,s))continue;let o=e.tag.addPair(e.value,s,n.get(i,s));o&&xt(t,o),((r=e.overridable)!=null?r:e.overridable=new Set).add(s)}}function J2(t,e,i,n){if(t.position=e.keyPosition,ZS(n))QS(t,e,i,n);else if(n.nodeKind==="sequence"&&Array.isArray(i))for(let r of i)QS(t,e,r,e.tag);else xt(t,"cannot merge mappings; the provided source object is unacceptable")}function eE(t,e,i,n,r){var o,l;if(t.position=e.keyPosition,i===Yd){J2(t,e,n,r);return}!t.json&&e.tag.has(e.value,i)&&!((o=e.overridable)!=null&&o.has(i))&&xt(t,"duplicated mapping key");let s=e.tag.addPair(e.value,i,n);s&&xt(t,s),(l=e.overridable)==null||l.delete(i)}function _d(t,e,i){let n=t.frames[t.frames.length-1];if(n.kind==="document")n.value=e,n.hasValue=!0;else if(n.kind==="sequence"){n.merge&&(ZS(i)||xt(t,"cannot merge mappings; the provided source object is unacceptable"));let r=n.tag.addItem(n.value,e,n.index++);r&&xt(t,r)}else if(n.hasKey){let r=n.key;n.key=void 0,n.hasKey=!1,eE(t,n,r,e,i)}else n.key=e,n.keyPosition=t.position,n.hasKey=!0}function Zd(t,e,i,n,r){if(e.anchorStart!==_r){let s={value:i,tag:n,isValueFinal:r};return t.anchors.set(t.source.slice(e.anchorStart,e.anchorEnd),s),s}return null}function tE(t,e){let i={...Ud,...e,events:t,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;i.eventIndex<i.events.length;){let n=i.events[i.eventIndex++];switch(i.position=F2(n),n.type){case 1:i.anchors=new Map,i.aliasCount=0,i.tagHandlers=Object.create(null);for(let r of n.directives)r.kind==="tag"&&(i.tagHandlers[r.handle]=r.prefix);i.frames.push({kind:"document",position:i.position,value:void 0,hasValue:!1});break;case 4:{let{value:r,tag:s}=K2(i,n);Zd(i,n,r,s,!0),_d(i,r,s);break}case 2:{let r=vS(i,n,i.schema.exact.sequence,i.schema.prefix.sequence,"tag:yaml.org,2002:seq","sequence"),s=r.tag.create(r.tagName),o=Zd(i,n,s,r.tag,r.tag.carrierIsResult),l=i.frames[i.frames.length-1],a=l!==void 0&&l.kind==="mapping"&&l.hasKey&&l.key===Yd;i.frames.push({kind:"sequence",position:i.position,value:s,tag:r.tag,anchor:o,index:0,merge:a});break}case 3:{let r=vS(i,n,i.schema.exact.mapping,i.schema.prefix.mapping,"tag:yaml.org,2002:map","mapping"),s=r.tag.create(r.tagName),o=Zd(i,n,s,r.tag,r.tag.carrierIsResult);i.frames.push({kind:"mapping",position:i.position,value:s,tag:r.tag,anchor:o,key:void 0,keyPosition:i.position,hasK
Line truncated
|
|
|
|
|
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new ep(this):new Jd(this)}getCursor(e,i=0,n){let r=e.doc?e:he.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?Br(this,r,i,n):Ir(this,r,i,n)}},Za=class{constructor(e){this.spec=e}};function Ir(t,e,i,n){return new tn(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:r=>r.toLowerCase(),t.wholeWord?NE(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function NE(t,e){return(i,n,r,s)=>((s>i||s+r.length<n)&&(s=Math.max(0,i-2),r=t.sliceString(s,Math.min(t.length,n+2))),(e(Da(r,i-s))!=ke.Word||e(Ia(r,i-s))!=ke.Word)&&(e(Ia(r,n-s))!=ke.Word||e(Da(r,n-s))!=ke.Word))}var Jd=class extends Za{constructor(e){super(e)}nextMatch(e,i,n){let r=Ir(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,i+this.spec.unquoted.length);r=Ir(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==i&&r.value.to==n?null:r.value}prevMatchInRange(e,i,n){for(let r=n;;){let s=Math.max(i,r-1e4-this.spec.unquoted.length),o=Ir(this.spec,e,s,r),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(s==i)return null;r-=1e4}}prevMatch(e,i,n){let r=this.prevMatchInRange(e,0,i);return r||(r=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=i||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,i){let n=Ir(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=Ir(this.spec,e,Math.max(0,i-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}};function Br(t,e,i,n){return new Ra(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?jE(e.charCategorizer(e.selection.main.head)):void 0},i,n)}function Da(t,e){return t.slice(Xe(t,e,!1),e)}function Ia(t,e){return t.slice(e,Xe(t,e))}function jE(t){return(e,i,n)=>!n[0].length||(t(Da(n.input,n.index))!=ke.Word||t(Ia(n.input,n.index))!=ke.Word)&&(t(Ia(n.input,n.index+n[0].length))!=ke.Word||t(Da(n.input,n.index+n[0].length))!=ke.Word)}var ep=class extends Za{nextMatch(e,i,n){let r=Br(this.spec,e,n,e.doc.length).next();return r.done&&(r=Br(this.spec,e,0,i).next()),r.done?null:r.value}prevMatchInRange(e,i,n){for(let r=1;;r++){let s=Math.max(i,n-r*1e4),o=Br(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==i||l.from>s+10))return l;if(s==i)return null}}prevMatch(e,i,n){return this.prevMatchInRange(e,0,i)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(i,n)=>n=="$"?"$":n=="&"?e.match[0]:n!="0"&&+n<e.match.length?e.match[n]:i)}matchAll(e,i){let n=Br(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=Br(this.spec,e,Math.max(0,i-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}},uo=W.define(),lp=W.define(),en=ge.define({create(t){return new fo(tp(t).create(),null)},update(t,e){for(let i of e.effects)i.is(uo)?t=new fo(i.value.create(),t.panel):i.is(lp)&&(t=new fo(t.query,i.value?ap:null));return t},provide:t=>mn.from(t,e=>e.panel)});var fo=class{constructor(e,i){this.query=e,this.panel=i}},zE=X.mark({class:"cm-searchMatch"}),YE=X.mark({class:"cm-searchMatch cm-searchMatch-selected"}),qE=me.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(en))}update(t){let e=t.state.field(en);(e!=t.startState.field(en)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return X.none;let{view:i}=this,n=new Ee;for(let r=0,s=i.visibleRanges,o=s.length;r<o;r++){let{from:l,to:a}=s[r];for(;r<o-1&&a>s[r+1].from-500;)a=s[++r].to;t.highlight(i.state,l,a,(h,c)=>{let f=i.state.selection.ranges.some(u=>u.from==h&&u.to==c);n.add(h,c,f?YE:zE)})}return n.finish()}},{decorations:t=>t.decorations});function po(t){return e=>{let i=e.state.field(en,!1);return i&&i.query.spec.valid?t(e,i):JS(e)}}var Ba=po((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let r=Q.single(n.from,n.to),s=t.state.facet(_n);return t.dispatch({selection:r,effects:[hp(t,n),s.scrollToMatch(r.main,t)],userEvent:"select.search"}),KS(t),!0}),Na=po((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,r=e.prevMatch(i,n,n);if(!r)return!1;let s=Q.single(r.from,r.to),o=t.state.facet(_n);return t.dispatch({selection:s,effects:[hp(t,r),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),KS(t),!0}),WE=po((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!i||!i.length?!1:(t.dispatch({selection:Q.create(i.map(n=>Q.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),VE=({state:t,dispatch:e})=>{let i=t.select
Line truncated
|
|
|
|
|
]`).replace("lheading",Hx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},FM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Jx=/^( {2,}|\\)\n(?!\s*$)/,KM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fr=/[\p{P}\p{S}]/u,sc=/[\s\p{P}\p{S}]/u,Jp=/[^\s\p{P}\p{S}]/u,JM=le(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,sc).getRegex(),ek=/(?!~)[\p{P}\p{S}]/u,eL=/(?!~)[\s\p{P}\p{S}]/u,tL=/(?:[^\s\p{P}\p{S}]|~)/u,iL=le(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ZM?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),tk=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,nL=le(tk,"u").replace(/punct/g,Fr).getRegex(),rL=le(tk,"u").replace(/punct/g,ek).getRegex(),ik="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",sL=le(ik,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,sc).replace(/punct/g,Fr).getRegex(),oL=le(ik,"gu").replace(/notPunctSpace/g,tL).replace(/punctSpace/g,eL).replace(/punct/g,ek).getRegex(),lL=le("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,sc).replace(/punct/g,Fr).getRegex(),aL=le(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Fr).getRegex(),cL="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",hL=le(cL,"gu").replace(/notPunctSpace/g,Jp).replace(/punctSpace/g,sc).replace(/punct/g,Fr).getRegex(),fL=le(/\\(punct)/,"gu").replace(/punct/g,Fr).getRegex(),uL=le(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),dL=le(Hp).replace("(?:-->|$)","-->").getRegex(),pL=le("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",dL).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),tc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,gL=le(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",tc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),nk=le(/^!?\[(label)\]\[(ref)\]/).replace("label",tc).replace("ref",Fp).getRegex(),rk=le(/^!?\[(ref)\](?:\[\])?/).replace("ref",Fp).getRegex(),OL=le("reflink|nolink(?!\\()","g").replace("reflink",nk).replace("nolink",rk).getRegex(),zx=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,eg={_backpedal:Vn,anyPunctuation:fL,autolink:uL,blockSkip:iL,br:Jx,code:HM,del:Vn,delLDelim:Vn,delRDelim:Vn,emStrongLDelim:nL,emStrongRDelimAst:sL,emStrongRDelimUnd:lL,escape:FM,link:gL,nolink:rk,punctuation:JM,reflink:nk,reflinkSearch:OL,tag:pL,text:KM,url:Vn},mL={...eg,link:le(/^!?\[(label)\]\((.*?)\)/).replace("label",tc).getRegex(),reflink:le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",tc).getRegex()},Yp={...eg,emStrongRDelimAst:oL,emStrongLDelim:rL,delLDelim:aL,delRDelim:hL,url:le(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",zx).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:le(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",zx).getRegex()},bL={...Yp,br:le(Jx).replace("{2,}","*").getRegex(),text:le(Yp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ja={normal:Kp,gfm:GM,pedantic:UM},ko={normal:eg,gfm:Yp,breaks:bL,pedantic:mL},yL={"&":"&","<":"<",">":">",'"':""","'":"'"},Yx=t=>yL[t];function bi(t,e){if(e){if(nt.escapeTest.test(t))return t.replace(nt.escapeReplace,Yx)}else if(nt.escapeTestNoEncode.tesLine truncated
|
|
|
|
|
`),i=e.length-1;for(;i>=0&&nt.blankLine.test(e[i]);)i--;return e.length-i<=2?t:e.slice(0,i+1).join(`
|
|
|
|
|
`)}function mL(t,e){if(t.indexOf(e[1])===-1)return-1;let i=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])i++;else if(t[n]===e[1]&&(i--,i<0))return n;return i>0?-2:-1}function bL(t,e=0){let i=e,n="";for(let r of t)if(r===" "){let s=4-i%4;n+=" ".repeat(s),i+=s}else n+=r,i++;return n}function Ux(t,e,i,n,r){let s=e.href,o=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let a={type:t[0].charAt(0)==="!"?"image":"link",raw:i,href:s,title:o,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,a}function yL(t,e,i){let n=t.match(i.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
|
|
|
|
|
`)}function SL(t,e){if(t.indexOf(e[1])===-1)return-1;let i=0;for(let n=0;n<t.length;n++)if(t[n]==="\\")n++;else if(t[n]===e[0])i++;else if(t[n]===e[1]&&(i--,i<0))return n;return i>0?-2:-1}function xL(t,e=0){let i=e,n="";for(let r of t)if(r===" "){let s=4-i%4;n+=" ".repeat(s),i+=s}else n+=r,i++;return n}function Gx(t,e,i,n,r){let s=e.href,o=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");n.state.inLink=!0;let a={type:t[0].charAt(0)==="!"?"image":"link",raw:i,href:s,title:o,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,a}function kL(t,e,i){let n=t.match(i.other.indentCodeCompensation);if(n===null)return e;let r=n[1];return e.split(`
|
|
|
|
|
`).map(s=>{let o=s.match(i.other.beginningSpace);if(o===null)return s;let[l]=o;return l.length>=r.length?s.slice(r.length):s}).join(`
|
|
|
|
|
`)}var nc=class{constructor(t){K(this,"options");K(this,"rules");K(this,"lexer");this.options=t||Un}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let i=this.options.pedantic?e[0]:Gx(e[0]),n=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let i=e[0],n=yL(i,e[3]||"",this.rules);return{type:"code",raw:i,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let i=e[2].trim();if(this.rules.other.endingHash.test(i)){let n=sn(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(i=n.trim())}return{type:"heading",raw:sn(e[0],`
|
|
|
|
|
`)}var ic=class{constructor(t){K(this,"options");K(this,"rules");K(this,"lexer");this.options=t||Un}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let i=this.options.pedantic?e[0]:Vx(e[0]),n=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:n}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let i=e[0],n=kL(i,e[3]||"",this.rules);return{type:"code",raw:i,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let i=e[2].trim();if(this.rules.other.endingHash.test(i)){let n=sn(i,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(i=n.trim())}return{type:"heading",raw:sn(e[0],`
|
|
|
|
|
`),depth:e[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:sn(e[0],`
|
|
|
|
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let i=sn(e[0],`
|
|
|
|
|
`).split(`
|
|
|
|
@@ -65,19 +65,19 @@ ${c}`:c;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
|
|
`),g=this.blockquote(p);s[s.length-1]=g,n=n.substring(0,n.length-d.raw.length)+g.raw,r=r.substring(0,r.length-d.text.length)+g.text;break}else if((u==null?void 0:u.type)==="list"){let d=u,p=d.raw+`
|
|
|
|
|
`+i.join(`
|
|
|
|
|
`),g=this.list(p);s[s.length-1]=g,n=n.substring(0,n.length-u.raw.length)+g.raw,r=r.substring(0,r.length-d.raw.length)+g.raw,i=p.substring(s.at(-1).raw.length).split(`
|
|
|
|
|
`);continue}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let i=e[1].trim(),n=i.length>1,r={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let s=this.rules.other.listItemRegex(i),o=!1;for(;t;){let a=!1,h="",c="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;h=e[0],t=t.substring(h.length);let f=bL(e[2].split(`
|
|
|
|
|
`);continue}}return{type:"blockquote",raw:n,tokens:s,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let i=e[1].trim(),n=i.length>1,r={type:"list",raw:"",ordered:n,start:n?+i.slice(0,-1):"",loose:!1,items:[]};i=n?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=n?i:"[*+-]");let s=this.rules.other.listItemRegex(i),o=!1;for(;t;){let a=!1,h="",c="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;h=e[0],t=t.substring(h.length);let f=xL(e[2].split(`
|
|
|
|
|
`,1)[0],e[1].length),u=t.split(`
|
|
|
|
|
`,1)[0],d=!f.trim(),p=0;if(this.options.pedantic?(p=2,c=f.trimStart()):d?p=e[1].length+1:(p=f.search(this.rules.other.nonSpaceChar),p=p>4?1:p,c=f.slice(p),p+=e[1].length),d&&this.rules.other.blankLine.test(u)&&(h+=u+`
|
|
|
|
|
`,t=t.substring(u.length+1),a=!0),!a){let g=this.rules.other.nextBulletRegex(p),m=this.rules.other.hrRegex(p),b=this.rules.other.fencesBeginRegex(p),y=this.rules.other.headingBeginRegex(p),S=this.rules.other.htmlBeginRegex(p),v=this.rules.other.blockquoteBeginRegex(p);for(;t;){let x=t.split(`
|
|
|
|
|
`,1)[0],w;if(u=x,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting," "),w=u):w=u.replace(this.rules.other.tabCharGlobal," "),b.test(u)||y.test(u)||S.test(u)||v.test(u)||g.test(u)||m.test(u))break;if(w.search(this.rules.other.nonSpaceChar)>=p||!u.trim())c+=`
|
|
|
|
|
`+w.slice(p);else{if(d||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(f)||y.test(f)||m.test(f))break;c+=`
|
|
|
|
|
`+u}d=!u.trim(),h+=x+`
|
|
|
|
|
`,t=t.substring(x.length+1),f=w.slice(p)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0)),r.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=h}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let a of r.items){this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]);let h=a.tokens[0];if(a.task&&((h==null?void 0:h.type)==="text"||(h==null?void 0:h.type)==="paragraph")){a.text=a.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let c=this.rules.other.listTaskCheckbox.exec(a.raw);if(c){let f={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};a.checked=f.checked,r.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=f.raw+a.tokens[0].raw,a.tokens[0].text=f.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(f)):a.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):a.tokens.unshift(f)}}else a.task&&(a.task=!1);if(!r.loose){let c=a.tokens.filter(u=>u.type==="space"),f=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));r.loose=f}}if(r.loose)for(let a of r.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let i=Gx(e[0]);return{type:"html",block:!0,raw:i,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:i}}}def(t){let e=this.rules.block.def.exec(t);if(e){let i=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:i,raw:sn(e[0],`
|
|
|
|
|
`),href:n,title:r}}}table(t){var o;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let i=Vx(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
|
|
|
`,t=t.substring(x.length+1),f=w.slice(p)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(o=!0)),r.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=h}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let a of r.items){this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]);let h=a.tokens[0];if(a.task&&((h==null?void 0:h.type)==="text"||(h==null?void 0:h.type)==="paragraph")){a.text=a.text.replace(this.rules.other.listReplaceTask,""),h.raw=h.raw.replace(this.rules.other.listReplaceTask,""),h.text=h.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let c=this.rules.other.listTaskCheckbox.exec(a.raw);if(c){let f={type:"checkbox",raw:c[0]+" ",checked:c[0]!=="[ ]"};a.checked=f.checked,r.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=f.raw+a.tokens[0].raw,a.tokens[0].text=f.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(f)):a.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):a.tokens.unshift(f)}}else a.task&&(a.task=!1);if(!r.loose){let c=a.tokens.filter(u=>u.type==="space"),f=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));r.loose=f}}if(r.loose)for(let a of r.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return r}}html(t){let e=this.rules.block.html.exec(t);if(e){let i=Vx(e[0]);return{type:"html",block:!0,raw:i,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:i}}}def(t){let e=this.rules.block.def.exec(t);if(e){let i=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:i,raw:sn(e[0],`
|
|
|
|
|
`),href:n,title:r}}}table(t){var o;let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let i=Wx(e[1]),n=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
|
|
|
`):[],s={type:"table",raw:sn(e[0],`
|
|
|
|
|
`),header:[],align:[],rows:[]};if(i.length===n.length){for(let l of n)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<i.length;l++)s.header.push({text:i[l],tokens:this.lexer.inline(i[l]),header:!0,align:s.align[l]});for(let l of r)s.rows.push(Vx(l,s.header.length).map((a,h)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[h]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let i=e[1].trim();return{type:"heading",raw:sn(e[0],`
|
|
|
|
|
`),header:[],align:[],rows:[]};if(i.length===n.length){for(let l of n)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<i.length;l++)s.header.push({text:i[l],tokens:this.lexer.inline(i[l]),header:!0,align:s.align[l]});for(let l of r)s.rows.push(Wx(l,s.header.length).map((a,h)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:s.align[h]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let i=e[1].trim();return{type:"heading",raw:sn(e[0],`
|
|
|
|
|
`),depth:e[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let i=e[1].charAt(e[1].length-1)===`
|
|
|
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let i=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let s=sn(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=mL(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(n);s&&(n=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?n=n.slice(1):n=n.slice(1,-1)),Ux(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let n=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[n.toLowerCase()];if(!r){let s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return Ux(i,r,i[0],this.lexer,this.rules)}}emStrong(t,e,i=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!i||this.rules.inline.punctuation.exec(i))){let r=[...n[0]].length-1,s,o,l=r,a=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*t.length+r);(n=h.exec(e))!==null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s)continue;if(o=[...s].length,n[3]||n[4]){l+=o;continue}else if((n[5]||n[6])&&r%3&&!((r+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let c=[...n[0]][0].length,f=t.slice(0,r+n.index+c+o);if(Math.min(r,o)%2){let d=f.slice(1,-1);return{type:"em",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let i=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),r=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&r&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:e[0],text:i}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,i=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!i||this.rules.inline.punctuation.exec(i))){let r=[...n[0]].length-1,s,o,l=r,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*t.length+r);(n=a.exec(e))!==null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s||(o=[...s].length,o!==r))continue;if(n[3]||n[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let h=[...n[0]][0].length,c=t.slice(0,r+n.index+h+o),f=c.slice(r,-r);return{type:"del",raw:c,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let i,n;return e[2]==="@"?(i=e[1],n="mailto:"+i):(i=e[1],n=i),{type:"link",raw:e[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(t){var i,n;let e;if(e=this.rules.inline.url.exec(t)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let o;do o=e[0],e[0]=(n=(i=this.rules.inline._backpedal.exec(e[0]))==null?void 0:i[0])!=null?n:"";while(o!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let i=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:i}}}},ei=class Wp{constructor(e){K(this,"tokens");K(this,"options");K(this,"state");K(this,"inlineQueue");K(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Un,this.options.tokenizer=this.options.tokenizer||new nc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={other:nt,block:ec.normal,inline:ko.normal};this.options.pedantic?(i.block=ec.pedantic,i.inline=ko.p
Line truncated
|
|
|
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:i,tokens:this.lexer.inline(i)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let i=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let s=sn(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=SL(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(n);s&&(n=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?n=n.slice(1):n=n.slice(1,-1)),Gx(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let n=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[n.toLowerCase()];if(!r){let s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return Gx(i,r,i[0],this.lexer,this.rules)}}emStrong(t,e,i=""){let n=this.rules.inline.emStrongLDelim.exec(t);if(!(!n||!n[1]&&!n[2]&&!n[3]&&!n[4]||n[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[3])||!i||this.rules.inline.punctuation.exec(i))){let r=[...n[0]].length-1,s,o,l=r,a=0,h=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*t.length+r);(n=h.exec(e))!==null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s)continue;if(o=[...s].length,n[3]||n[4]){l+=o;continue}else if((n[5]||n[6])&&r%3&&!((r+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let c=[...n[0]][0].length,f=t.slice(0,r+n.index+c+o);if(Math.min(r,o)%2){let d=f.slice(1,-1);return{type:"em",raw:f,text:d,tokens:this.lexer.inlineTokens(d)}}let u=f.slice(2,-2);return{type:"strong",raw:f,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let i=e[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(i),r=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return n&&r&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:e[0],text:i}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,i=""){let n=this.rules.inline.delLDelim.exec(t);if(n&&(!n[1]||!i||this.rules.inline.punctuation.exec(i))){let r=[...n[0]].length-1,s,o,l=r,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*t.length+r);(n=a.exec(e))!==null;){if(s=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!s||(o=[...s].length,o!==r))continue;if(n[3]||n[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let h=[...n[0]][0].length,c=t.slice(0,r+n.index+h+o),f=c.slice(r,-r);return{type:"del",raw:c,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let i,n;return e[2]==="@"?(i=e[1],n="mailto:"+i):(i=e[1],n=i),{type:"link",raw:e[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}}url(t){var i,n;let e;if(e=this.rules.inline.url.exec(t)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let o;do o=e[0],e[0]=(n=(i=this.rules.inline._backpedal.exec(e[0]))==null?void 0:i[0])!=null?n:"";while(o!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let i=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:i}}}},ei=class qp{constructor(e){K(this,"tokens");K(this,"options");K(this,"state");K(this,"inlineQueue");K(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Un,this.options.tokenizer=this.options.tokenizer||new ic,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={other:nt,block:Ja.normal,inline:ko.normal};this.options.pedantic?(i.block=Ja.pedantic,i.inline=ko.p
Line truncated
|
|
|
|
|
`),this.blockTokens(e,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let n=this.inlineQueue[i];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,i=[],n=!1){var s,o,l;this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(nt.tabCharGlobal," ").replace(nt.spaceLine,""));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let a;if((o=(s=this.options.extensions)==null?void 0:s.block)!=null&&o.some(c=>(a=c.call({lexer:this},e,i))?(e=e.substring(a.raw.length),i.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let c=i.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
|
|
|
|
|
`:i.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let c=i.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
|
|
|
`)?"":`
|
|
|
|
@@ -91,7 +91,7 @@ ${c}`:c;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
|
|
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):i.push(a),n=h.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let c=i.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
|
|
|
`)?"":`
|
|
|
|
|
`)+a.raw,c.text+=`
|
|
|
|
|
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):i.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,i}inline(e,i=[]){return this.inlineQueue.push({src:e,tokens:i}),i}inlineTokens(e,i=[]){var h,c,f,u,d,p;this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)g.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)s=r[2]?r[2].length:0,n=n.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=(f=(c=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:c.call({lexer:this},n))!=null?f:n;let o=!1,l="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}o||(l=""),o=!1;let g;if((d=(u=this.options.extensions)==null?void 0:u.inline)!=null&&d.some(b=>(g=b.call({lexer:this},e,i))?(e=e.substring(g.raw.length),i.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);let b=i.at(-1);g.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):i.push(g);continue}if(g=this.tokenizer.emStrong(e,n,l)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.del(e,n,l)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),i.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),i.push(g);continue}let m=e;if((p=this.options.extensions)!=null&&p.startInline){let b=1/0,y=e.slice(1),S;this.options.extensions.startInline.forEach(v=>{S=v.call({lexer:this},y),typeof S=="number"&&S>=0&&(b=Math.min(b,S))}),b<1/0&&b>=0&&(m=e.substring(0,b+1))}if(g=this.tokenizer.inlineText(m)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(l=g.raw.slice(-1)),o=!0;let b=i.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):i.push(g);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return i}infiniteLoopError(e){let i="Infinite loop on byte: "+e;if(this.options.silent)console.error(i);else throw new Error(i)}},rc=class{constructor(t){K(this,"options");K(this,"parser");this.options=t||Un}space(t){return""}code({text:t,lang:e,escaped:i}){var s;let n=(s=(e||"").match(nt.notSpaceStart))==null?void 0:s[0],r=t.replace(nt.endingNewline,"")+`
|
|
|
|
|
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):i.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,i}inline(e,i=[]){return this.inlineQueue.push({src:e,tokens:i}),i}inlineTokens(e,i=[]){var h,c,f,u,d,p;this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let g=Object.keys(this.tokens.links);if(g.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)g.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)s=r[2]?r[2].length:0,n=n.slice(0,r.index+s)+"["+"a".repeat(r[0].length-s-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=(f=(c=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:c.call({lexer:this},n))!=null?f:n;let o=!1,l="",a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}o||(l=""),o=!1;let g;if((d=(u=this.options.extensions)==null?void 0:u.inline)!=null&&d.some(b=>(g=b.call({lexer:this},e,i))?(e=e.substring(g.raw.length),i.push(g),!0):!1))continue;if(g=this.tokenizer.escape(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.tag(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.link(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(g.raw.length);let b=i.at(-1);g.type==="text"&&(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):i.push(g);continue}if(g=this.tokenizer.emStrong(e,n,l)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.codespan(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.br(e)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.del(e,n,l)){e=e.substring(g.raw.length),i.push(g);continue}if(g=this.tokenizer.autolink(e)){e=e.substring(g.raw.length),i.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(e))){e=e.substring(g.raw.length),i.push(g);continue}let m=e;if((p=this.options.extensions)!=null&&p.startInline){let b=1/0,y=e.slice(1),S;this.options.extensions.startInline.forEach(v=>{S=v.call({lexer:this},y),typeof S=="number"&&S>=0&&(b=Math.min(b,S))}),b<1/0&&b>=0&&(m=e.substring(0,b+1))}if(g=this.tokenizer.inlineText(m)){e=e.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(l=g.raw.slice(-1)),o=!0;let b=i.at(-1);(b==null?void 0:b.type)==="text"?(b.raw+=g.raw,b.text+=g.text):i.push(g);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return i}infiniteLoopError(e){let i="Infinite loop on byte: "+e;if(this.options.silent)console.error(i);else throw new Error(i)}},nc=class{constructor(t){K(this,"options");K(this,"parser");this.options=t||Un}space(t){return""}code({text:t,lang:e,escaped:i}){var s;let n=(s=(e||"").match(nt.notSpaceStart))==null?void 0:s[0],r=t.replace(nt.endingNewline,"")+`
|
|
|
|
|
`;return n?'<pre><code class="language-'+bi(n)+'">'+(i?r:bi(r,!0))+`</code></pre>
|
|
|
|
|
`:"<pre><code>"+(i?r:bi(r,!0))+`</code></pre>
|
|
|
|
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
|
|
@@ -109,8 +109,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
|
|
`}tablerow({text:t}){return`<tr>
|
|
|
|
|
${t}</tr>
|
|
|
|
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+e+`</${i}>
|
|
|
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${bi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:i}){let n=this.parser.parseInline(i),r=Wx(t);if(r===null)return n;t=r;let s='<a href="'+t+'"';return e&&(s+=' title="'+bi(e)+'"'),s+=">"+n+"</a>",s}image({href:t,title:e,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let r=Wx(t);if(r===null)return bi(i);t=r;let s=`<img src="${t}" alt="${bi(i)}"`;return e&&(s+=` title="${bi(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:bi(t.text)}},ig=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ti=class Vp{constructor(e){K(this,"options");K(this,"renderer");K(this,"textRenderer");this.options=e||Un,this.options.renderer=this.options.renderer||new rc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ig}static parse(e,i){return new Vp(i).parse(e)}static parseInline(e,i){return new Vp(i).parseInline(e)}parse(e){var n,r;this.renderer.parser=this;let i="";for(let s=0;s<e.length;s++){let o=e[s];if((r=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&r[o.type]){let a=o,h=this.options.extensions.renderers[a.type].call({parser:this},a);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){i+=h||"";continue}}let l=o;switch(l.type){case"space":{i+=this.renderer.space(l);break}case"hr":{i+=this.renderer.hr(l);break}case"heading":{i+=this.renderer.heading(l);break}case"code":{i+=this.renderer.code(l);break}case"table":{i+=this.renderer.table(l);break}case"blockquote":{i+=this.renderer.blockquote(l);break}case"list":{i+=this.renderer.list(l);break}case"checkbox":{i+=this.renderer.checkbox(l);break}case"html":{i+=this.renderer.html(l);break}case"def":{i+=this.renderer.def(l);break}case"paragraph":{i+=this.renderer.paragraph(l);break}case"text":{i+=this.renderer.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}parseInline(e,i=this.renderer){var r,s;this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let l=e[o];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[l.type]){let h=this.options.extensions.renderers[l.type].call({parser:this},l);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=h||"";continue}}let a=l;switch(a.type){case"escape":{n+=i.text(a);break}case"html":{n+=i.html(a);break}case"link":{n+=i.link(a);break}case"image":{n+=i.image(a);break}case"checkbox":{n+=i.checkbox(a);break}case"strong":{n+=i.strong(a);break}case"em":{n+=i.em(a);break}case"codespan":{n+=i.codespan(a);break}case"br":{n+=i.br(a);break}case"del":{n+=i.del(a);break}case"text":{n+=i.text(a);break}default:{let h='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return n}},tc,wo=(tc=class{constructor(t){K(this,"options");K(this,"block");this.options=t||Un}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ei.lex:ei.lexInline}provideParser(t=this.block){return t?ti.parse:ti.parseInline}},K(tc,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),K(tc,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),tc),SL=class{constructor(...t){K(this,"defaults",Gp());K(this,"options",this.setOptions);K(this,"parse",this.parseMarkdown(!0));K(this,"parseInline",this.parseMarkdown(!1));K(this,"Parser",ti);K(this,"Renderer",rc);K(this,"TextRenderer",ig);K(this,"Lexer",ei);K(this,"Tokenizer",nc);K(this,"Hooks",wo);this.use(...t)}walkTokens(t,e){var n,r;let i=[];for(let s of t)switch(i=i.concat(e.call(this,s)),s.type){case"table":{let o=s;for(let l of o.header)i=i.concat(this.walkTokens(l.tokens,e));for(let l of o.rows)for(let a of l)i=i.concat(this.walkTokens(a.tokens,e));break}case"list":{let o=s;i=i.concat(this.walkTokens(o.items,e));break}default:{let o=s;(r=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let a=o[l].flat(1/0);i=i.concat(this.walkTokens(a,e))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,e)))}}return i}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensLine truncated
|
|
|
|
|
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+bi(i.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(i);throw i}}},Gn=new SL;function pe(t,e){return Gn.parse(t,e)}pe.options=pe.setOptions=function(t){return Gn.setOptions(t),pe.defaults=Gn.defaults,Fx(pe.defaults),pe};pe.getDefaults=Gp;pe.defaults=Un;pe.use=function(...t){return Gn.use(...t),pe.defaults=Gn.defaults,Fx(pe.defaults),pe};pe.walkTokens=function(t,e){return Gn.walkTokens(t,e)};pe.parseInline=Gn.parseInline;pe.Parser=ti;pe.parser=ti.parse;pe.Renderer=rc;pe.TextRenderer=ig;pe.Lexer=ei;pe.lexer=ei.lex;pe.Tokenizer=nc;pe.Hooks=wo;pe.parse=pe;var gZ=pe.options,OZ=pe.setOptions,mZ=pe.use,bZ=pe.walkTokens,yZ=pe.parseInline;var SZ=ti.parse,xZ=ei.lex;var Pk=Wk(Qk(),1);var Mi=Pk.default;function fg(t){let e="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},l=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),u={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},d={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},m=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},u,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},p,g,s,o],b=[...m];return b.pop(),b.push(l),d.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:m}}function fc(t){let e=t.regex,i={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,i,r]};r.contains.push(l);let a={match:/\\"/},h={className:"string",begin:/'/,end:/'/},c={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,i]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=t.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],m=["true","false"],b={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],v=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],x=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","
Line truncated
|
|
|
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${bi(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:i}){let n=this.parser.parseInline(i),r=qx(t);if(r===null)return n;t=r;let s='<a href="'+t+'"';return e&&(s+=' title="'+bi(e)+'"'),s+=">"+n+"</a>",s}image({href:t,title:e,text:i,tokens:n}){n&&(i=this.parser.parseInline(n,this.parser.textRenderer));let r=qx(t);if(r===null)return bi(i);t=r;let s=`<img src="${t}" alt="${bi(i)}"`;return e&&(s+=` title="${bi(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:bi(t.text)}},tg=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},ti=class Wp{constructor(e){K(this,"options");K(this,"renderer");K(this,"textRenderer");this.options=e||Un,this.options.renderer=this.options.renderer||new nc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new tg}static parse(e,i){return new Wp(i).parse(e)}static parseInline(e,i){return new Wp(i).parseInline(e)}parse(e){var n,r;this.renderer.parser=this;let i="";for(let s=0;s<e.length;s++){let o=e[s];if((r=(n=this.options.extensions)==null?void 0:n.renderers)!=null&&r[o.type]){let a=o,h=this.options.extensions.renderers[a.type].call({parser:this},a);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){i+=h||"";continue}}let l=o;switch(l.type){case"space":{i+=this.renderer.space(l);break}case"hr":{i+=this.renderer.hr(l);break}case"heading":{i+=this.renderer.heading(l);break}case"code":{i+=this.renderer.code(l);break}case"table":{i+=this.renderer.table(l);break}case"blockquote":{i+=this.renderer.blockquote(l);break}case"list":{i+=this.renderer.list(l);break}case"checkbox":{i+=this.renderer.checkbox(l);break}case"html":{i+=this.renderer.html(l);break}case"def":{i+=this.renderer.def(l);break}case"paragraph":{i+=this.renderer.paragraph(l);break}case"text":{i+=this.renderer.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return i}parseInline(e,i=this.renderer){var r,s;this.renderer.parser=this;let n="";for(let o=0;o<e.length;o++){let l=e[o];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[l.type]){let h=this.options.extensions.renderers[l.type].call({parser:this},l);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=h||"";continue}}let a=l;switch(a.type){case"escape":{n+=i.text(a);break}case"html":{n+=i.html(a);break}case"link":{n+=i.link(a);break}case"image":{n+=i.image(a);break}case"checkbox":{n+=i.checkbox(a);break}case"strong":{n+=i.strong(a);break}case"em":{n+=i.em(a);break}case"codespan":{n+=i.codespan(a);break}case"br":{n+=i.br(a);break}case"del":{n+=i.del(a);break}case"text":{n+=i.text(a);break}default:{let h='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return n}},ec,wo=(ec=class{constructor(t){K(this,"options");K(this,"block");this.options=t||Un}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ei.lex:ei.lexInline}provideParser(t=this.block){return t?ti.parse:ti.parseInline}},K(ec,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),K(ec,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ec),wL=class{constructor(...t){K(this,"defaults",Vp());K(this,"options",this.setOptions);K(this,"parse",this.parseMarkdown(!0));K(this,"parseInline",this.parseMarkdown(!1));K(this,"Parser",ti);K(this,"Renderer",nc);K(this,"TextRenderer",tg);K(this,"Lexer",ei);K(this,"Tokenizer",ic);K(this,"Hooks",wo);this.use(...t)}walkTokens(t,e){var n,r;let i=[];for(let s of t)switch(i=i.concat(e.call(this,s)),s.type){case"table":{let o=s;for(let l of o.header)i=i.concat(this.walkTokens(l.tokens,e));for(let l of o.rows)for(let a of l)i=i.concat(this.walkTokens(a.tokens,e));break}case"list":{let o=s;i=i.concat(this.walkTokens(o.items,e));break}default:{let o=s;(r=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let a=o[l].flat(1/0);i=i.concat(this.walkTokens(a,e))}):o.tokens&&(i=i.concat(this.walkTokens(o.tokens,e)))}}return i}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{let n={...i};if(n.async=this.defaults.async||n.async||!1,i.extensions&&(i.extensLine truncated
|
|
|
|
|
Please report this to https://github.com/markedjs/marked.`,t){let n="<p>An error occurred:</p><pre>"+bi(i.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(i);throw i}}},Gn=new wL;function pe(t,e){return Gn.parse(t,e)}pe.options=pe.setOptions=function(t){return Gn.setOptions(t),pe.defaults=Gn.defaults,Ux(pe.defaults),pe};pe.getDefaults=Vp;pe.defaults=Un;pe.use=function(...t){return Gn.use(...t),pe.defaults=Gn.defaults,Ux(pe.defaults),pe};pe.walkTokens=function(t,e){return Gn.walkTokens(t,e)};pe.parseInline=Gn.parseInline;pe.Parser=ti;pe.parser=ti.parse;pe.Renderer=nc;pe.TextRenderer=tg;pe.Lexer=ei;pe.lexer=ei.lex;pe.Tokenizer=ic;pe.Hooks=wo;pe.parse=pe;var yZ=pe.options,SZ=pe.setOptions,xZ=pe.use,kZ=pe.walkTokens,wZ=pe.parseInline;var vZ=ti.parse,QZ=ei.lex;var Qk=Uk(vk(),1);var Mi=Qk.default;function hg(t){let e="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,r]},l=t.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),u={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},d={end:",",endsWithParent:!0,excludeEnd:!0,keywords:e,relevance:0},p={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},m=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},u,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},p,g,s,o],b=[...m];return b.pop(),b.push(l),d.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:m}}function hc(t){let e=t.regex,i={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,i,r]};r.contains.push(l);let a={match:/\\"/},h={className:"string",begin:/'/,end:/'/},c={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,i]},u=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=t.SHEBANG({binary:`(${u.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],m=["true","false"],b={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],v=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],x=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","
Line truncated
|
|
|
|
|
display: block;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
padding: 1em
|
|
|
|
@@ -227,7 +227,7 @@ code.hljs {
|
|
|
|
|
.hljs-tag {
|
|
|
|
|
/* purposely ignored */
|
|
|
|
|
|
|
|
|
|
}`;var dg=`pre code.hljs {
|
|
|
|
|
}`;var ug=`pre code.hljs {
|
|
|
|
|
display: block;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
padding: 1em
|
|
|
|
@@ -343,7 +343,7 @@ code.hljs {
|
|
|
|
|
.hljs-tag {
|
|
|
|
|
/* purposely ignored */
|
|
|
|
|
|
|
|
|
|
}`;var Ae={timestamp:$e.define(),bracket:$e.define(),category:$e.define(),logString:$e.define(),logLink:$e.define(),levelInfo:$e.define(),levelWarning:$e.define(),levelError:$e.define(),levelDebug:$e.define(),levelTip:$e.define(),levelFatal:$e.define(),levelWatchdog:$e.define()};Mi.registerLanguage("yaml",fg);Mi.registerLanguage("yml",fg);Mi.registerLanguage("bash",fc);Mi.registerLanguage("sh",fc);Mi.registerLanguage("shell",fc);Mi.registerLanguage("json",$k);var uX=[{label:"port",type:"keyword",detail:"HTTP proxy port",info:"Invalid when mixed port is enabled"},{label:"socks-port",type:"keyword",detail:"SOCKS5 proxy port"},{label:"mixed-port",type:"keyword",detail:"HTTP/SOCKS mixed port",info:"Overrides port and socks-port when set"},{label:"redir-port",type:"keyword",detail:"Transparent proxy port"},{label:"tproxy-port",type:"keyword",detail:"TPROXY transparent proxy port"},{label:"mode",type:"keyword",detail:"Run mode: rule / global / direct"},{label:"log-level",type:"keyword",detail:"Log level: debug / info / warning / error / silent"},{label:"ipv6",type:"keyword",detail:"IPv6 traffic handling: true / false"},{label:"allow-lan",type:"keyword",detail:"Allow LAN connections: true / false"},{label:"bind-address",type:"keyword",detail:"Bind address, default *"},{label:"authentication",type:"keyword",detail:"HTTP/SOCKS authentication, array format"},{label:"external-controller",type:"keyword",detail:"RESTful API listen address"},{label:"external-ui",type:"keyword",detail:"Dashboard path"},{label:"secret",type:"keyword",detail:"API secret"},{label:"interface-name",type:"keyword",detail:"Outbound interface name"},{label:"routing-mark",type:"keyword",detail:"Routing mark"},{label:"hosts",type:"keyword",detail:"Custom hosts mapping"},{label:"profile",type:"keyword",detail:"Profiling configuration"},{label:"global-ua",type:"keyword",detail:"Global User-Agent"},{label:"unified-delay",type:"keyword",detail:"Unified delay: true / false"},{label:"tcp-concurrent",type:"keyword",detail:"TCP concurrent connections"},{label:"find-process-mode",type:"keyword",detail:"Find process mode: off / strict / always"},{label:"sniffing",type:"keyword",detail:"Domain sniffing: true / false"},{label:"keep-alive-interval",type:"keyword",detail:"TCP keep-alive interval (seconds)"},{label:"geodata-mode",type:"keyword",detail:"GEO data mode: true / false"},{label:"geodata-loader",type:"keyword",detail:"GEO loader: memconservative / standard"},{label:"geox-url",type:"keyword",detail:"GEOX custom URL template"},{label:"geosite",type:"keyword",detail:"GeoSite configuration"},{label:"geo-auto-update",type:"keyword",detail:"GEO auto update: true / false"},{label:"geo-update-interval",type:"keyword",detail:"GEO update interval (hours)"},{label:"tun",type:"keyword",detail:"TUN mode configuration"},{label:"enable",type:"property",detail:"Enable: true / false"},{label:"stack",type:"property",detail:"Protocol stack: system / gvisor / mixed"},{label:"device",type:"property",detail:"TUN device name"},{label:"dns-hijack",type:"property",detail:"DNS hijack address list"},{label:"auto-route",type:"property",detail:"Auto set route: true / false"},{label:"auto-detect-interface",type:"property",detail:"Auto detect interface: true / false"},{label:"mtu",type:"property",detail:"MTU value"},{label:"inet4-address",type:"property",detail:"IPv4 address range"},{label:"inet6-address",type:"property",detail:"IPv6 address range"},{label:"strict-route",type:"property",detail:"Strict route: true / false"},{label:"endpoint-independent-nat",type:"property",detail:"Endpoint-independent NAT: true / false"},{label:"udp-timeout",type:"property",detail:"UDP timeout"},{label:"dns",type:"keyword",detail:"DNS configuration"},{label:"nameserver",type:"property",detail:"DNS upstream servers"},{label:"fallback",type:"property",detail:"Fallback DNS servers"},{label:"fallback-filter",type:"property",detail:"Fallback filter configuration"},{label:"default-nameserver",type:"property",detail:"Default DNS servers"},{label:"nameserver-policy",type:"property",detail:"DNS by domain name"},{label:"proxy-server-nameserver",type:"property",detail:"Proxy DNS servers"},{label:"use-hosts",type:"property",detail:"Use hosts: true / false"},{label:"enhanced-mode",type:"property",detail:"DNS mode: normal / redir-host / fake-ip"},{label:"fake-ip-range",type:"property",detail:"Fake-IP address range"},{label:"fake-ip-filter",type:"property",detail:"Fake-IP filter domains"},{label:"type",type:"type",detail:"ss / ssr / vmess / trojan / snell / http / socks5 / hysteria / vless / tuic / wireguard"},{label:"server",type:"property",detail:"Server address"},{label:"name",type:"property",detail:"Proxy name"},{label:"password",type:"property",detail:"Password"},{label:"cipher",type:"property",detail:"Encryption method"},{label:"udp",type:"property",detail:"UDP relay: true / false"},{label:"xudp",type:"property",detail:"XUDP mode"},{label:"tfo",type:"property",detail:"TCP Fast Open: true / false"},{label:"mpt
Line truncated
|
|
|
|
|
}`;var Ae={timestamp:$e.define(),bracket:$e.define(),category:$e.define(),logString:$e.define(),logLink:$e.define(),levelInfo:$e.define(),levelWarning:$e.define(),levelError:$e.define(),levelDebug:$e.define(),levelTip:$e.define(),levelFatal:$e.define(),levelWatchdog:$e.define()},$k=!1;function Ck(){$k||($k=!0,Mi.registerLanguage("yaml",hg),Mi.registerLanguage("yml",hg),Mi.registerLanguage("bash",hc),Mi.registerLanguage("sh",hc),Mi.registerLanguage("shell",hc),Mi.registerLanguage("json",Pk))}var gX=[{label:"port",type:"keyword",detail:"HTTP proxy port",info:"Invalid when mixed port is enabled"},{label:"socks-port",type:"keyword",detail:"SOCKS5 proxy port"},{label:"mixed-port",type:"keyword",detail:"HTTP/SOCKS mixed port",info:"Overrides port and socks-port when set"},{label:"redir-port",type:"keyword",detail:"Transparent proxy port"},{label:"tproxy-port",type:"keyword",detail:"TPROXY transparent proxy port"},{label:"mode",type:"keyword",detail:"Run mode: rule / global / direct"},{label:"log-level",type:"keyword",detail:"Log level: debug / info / warning / error / silent"},{label:"ipv6",type:"keyword",detail:"IPv6 traffic handling: true / false"},{label:"allow-lan",type:"keyword",detail:"Allow LAN connections: true / false"},{label:"bind-address",type:"keyword",detail:"Bind address, default *"},{label:"authentication",type:"keyword",detail:"HTTP/SOCKS authentication, array format"},{label:"external-controller",type:"keyword",detail:"RESTful API listen address"},{label:"external-ui",type:"keyword",detail:"Dashboard path"},{label:"secret",type:"keyword",detail:"API secret"},{label:"interface-name",type:"keyword",detail:"Outbound interface name"},{label:"routing-mark",type:"keyword",detail:"Routing mark"},{label:"hosts",type:"keyword",detail:"Custom hosts mapping"},{label:"profile",type:"keyword",detail:"Profiling configuration"},{label:"global-ua",type:"keyword",detail:"Global User-Agent"},{label:"unified-delay",type:"keyword",detail:"Unified delay: true / false"},{label:"tcp-concurrent",type:"keyword",detail:"TCP concurrent connections"},{label:"find-process-mode",type:"keyword",detail:"Find process mode: off / strict / always"},{label:"sniffing",type:"keyword",detail:"Domain sniffing: true / false"},{label:"keep-alive-interval",type:"keyword",detail:"TCP keep-alive interval (seconds)"},{label:"geodata-mode",type:"keyword",detail:"GEO data mode: true / false"},{label:"geodata-loader",type:"keyword",detail:"GEO loader: memconservative / standard"},{label:"geox-url",type:"keyword",detail:"GEOX custom URL template"},{label:"geosite",type:"keyword",detail:"GeoSite configuration"},{label:"geo-auto-update",type:"keyword",detail:"GEO auto update: true / false"},{label:"geo-update-interval",type:"keyword",detail:"GEO update interval (hours)"},{label:"tun",type:"keyword",detail:"TUN mode configuration"},{label:"enable",type:"property",detail:"Enable: true / false"},{label:"stack",type:"property",detail:"Protocol stack: system / gvisor / mixed"},{label:"device",type:"property",detail:"TUN device name"},{label:"dns-hijack",type:"property",detail:"DNS hijack address list"},{label:"auto-route",type:"property",detail:"Auto set route: true / false"},{label:"auto-detect-interface",type:"property",detail:"Auto detect interface: true / false"},{label:"mtu",type:"property",detail:"MTU value"},{label:"inet4-address",type:"property",detail:"IPv4 address range"},{label:"inet6-address",type:"property",detail:"IPv6 address range"},{label:"strict-route",type:"property",detail:"Strict route: true / false"},{label:"endpoint-independent-nat",type:"property",detail:"Endpoint-independent NAT: true / false"},{label:"udp-timeout",type:"property",detail:"UDP timeout"},{label:"dns",type:"keyword",detail:"DNS configuration"},{label:"nameserver",type:"property",detail:"DNS upstream servers"},{label:"fallback",type:"property",detail:"Fallback DNS servers"},{label:"fallback-filter",type:"property",detail:"Fallback filter configuration"},{label:"default-nameserver",type:"property",detail:"Default DNS servers"},{label:"nameserver-policy",type:"property",detail:"DNS by domain name"},{label:"proxy-server-nameserver",type:"property",detail:"Proxy DNS servers"},{label:"use-hosts",type:"property",detail:"Use hosts: true / false"},{label:"enhanced-mode",type:"property",detail:"DNS mode: normal / redir-host / fake-ip"},{label:"fake-ip-range",type:"property",detail:"Fake-IP address range"},{label:"fake-ip-filter",type:"property",detail:"Fake-IP filter domains"},{label:"type",type:"type",detail:"ss / ssr / vmess / trojan / snell / http / socks5 / hysteria / vless / tuic / wireguard"},{label:"server",type:"property",detail:"Server address"},{label:"name",type:"property",detail:"Proxy name"},{label:"password",type:"property",detail:"Password"},{label:"cipher",type:"property",detail:"Encryption method"},{label:"udp",type:"property",detail:"UDP relay: true / false"},{label:"xudp",type:"property",detail:"XUDP mode"},{label:"tfo",type:"property",detail:"TCP Fast
Line truncated
|
|
|
|
|
mode: #{2}
|
|
|
|
|
log-level: #{3}
|
|
|
|
|
allow-lan: #{4}
|
|
|
|
@@ -872,4 +872,4 @@ external-controller: 0.0.0.0:9093
|
|
|
|
|
# mux: true
|
|
|
|
|
# username: ""
|
|
|
|
|
# password: ""
|
|
|
|
|
#{}`,{label:"gost-relay-template",type:"snippet",detail:"GOST Relay node"})];function pX(t){let e=t.matchBefore(/[\w-]+/);if(!e||e.from===e.to&&!t.explicit)return null;let i=uX.filter(s=>s.label.toLowerCase().startsWith(e.text.toLowerCase())),n=dX.filter(s=>(s.label||s.name||"").toLowerCase().startsWith(e.text.toLowerCase())),r=[...i,...n];return r.length?{from:e.from,options:r,validFor:/^[\w-]*$/}:null}function gX(t=750){return Md(e=>{let i=[];try{qS(e.state.doc.toString(),{schema:Gd})}catch(n){let r=n.mark;if(r&&r.line!==void 0){let s=r.line+1;if(s<=e.state.doc.lines){let o=e.state.doc.line(s),l=Math.min(o.from+(r.column||0),o.to);i.push({from:l,to:Math.min(l+1,o.to),severity:"error",message:n.reason||n.message})}}else i.push({from:0,to:0,severity:"error",message:n.reason||n.message})}return i},typeof t=="number"?{delay:t}:void 0)}var uc=null,gg=null;function OX(){if(!window.levelTranslations){uc={},gg=/(?!)/;return}var t={},e=[];for(var i in window.levelTranslations)if(window.levelTranslations.hasOwnProperty(i)){var n=window.levelTranslations[i];t[n]=i,e.push(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}uc=t,gg=new RegExp("^\\[("+e.join("|")+")\\]")}var mX=_s.define({tokenTable:{timestamp:Ae.timestamp,bracket:Ae.bracket,category:Ae.category,logString:Ae.logString,logLink:Ae.logLink,levelInfo:Ae.levelInfo,levelWarning:Ae.levelWarning,levelError:Ae.levelError,levelDebug:Ae.levelDebug,levelTip:Ae.levelTip,levelFatal:Ae.levelFatal,levelWatchdog:Ae.levelWatchdog},startState(){return{tabDone:!1}},token(t,e){if(t.sol()&&(e.tabDone=!1,t.match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/)))return"timestamp";if(t.eatSpace())return null;var i=t.peek();if(!i)return t.skipToEnd(),null;if(i==="\u3010"&&t.match(/\u3010[^\u3011]*\u3011/))return"bracket";if(e.tabDone)return t.next(),"logString";if(i==="["){uc===null&&OX();var n=t.match(gg);if(n){var r=uc[n[1]];if(r){var s="level"+r.charAt(0).toUpperCase()+r.slice(1);if(Ae[s])return s}return"category"}if(t.match(/\[[A-Z][^\]]*\]/))return"category"}return i!=="["&&(e.tabDone=!0),t.next(),"logString"}}),bX=Vt.define([{tag:Ae.timestamp,class:"cmt-log-timestamp"},{tag:Ae.bracket,class:"cmt-log-bracket"},{tag:Ae.category,class:"cmt-log-category"},{tag:Ae.logString,class:"cmt-log-string"},{tag:Ae.logLink,class:"cmt-log-link"},{tag:Ae.levelInfo,class:"cmt-log-level-info"},{tag:Ae.levelWarning,class:"cmt-log-level-warning"},{tag:Ae.levelError,class:"cmt-log-level-error"},{tag:Ae.levelDebug,class:"cmt-log-level-debug"},{tag:Ae.levelTip,class:"cmt-log-level-tip"},{tag:Ae.levelFatal,class:"cmt-log-level-fatal"},{tag:Ae.levelWatchdog,class:"cmt-log-level-watchdog"}]);function Tk(t=1e3){return me.fromClass(class{constructor(e){this._preload(e)}update(e){if(e.viewportChanged||e.docChanged){this._rafId&&cancelAnimationFrame(this._rafId);var i=this;this._rafId=requestAnimationFrame(function(){i._rafId=null,i._preload(e.view)})}}_preload(e){var i=e.state.doc,n=i.lineAt(e.viewport.to).number,r=Math.min(n+t,i.lines);a0(e.state,i.line(r).to,50)}})}function yX(t=[]){return[Gh(),zh(),Uh(),jh(),Bh(),Nh(),Yh(),qh(),Rf(),Af({placeholderDOM:null}),Pf(),zf(),op(),T.lineWrapping,Tu(),Tk(),wi.of([...Wf,...Yf,...hp,...Cu,...Tf,{key:"Tab",run:function(e){return Qu(e)||jl(e)}}]),...t]}var SX=T.baseTheme({".cm-line":{position:"relative"},".cm-oc-im::before":{content:'""',position:"absolute",top:0,left:"6px",right:0,height:"var(--oc-lh, 100%)",background:"var(--oc-im)",pointerEvents:"none",zIndex:"-1"},"&light":{"--oc-im-c":"#e1e4e8","--oc-im-ca":"#d0d7de"},"&dark":{"--oc-im-c":"#30363d","--oc-im-ca":"#484f58"}});function pg(t,e){let i=0;for(let n=0;n<t.length;n++)if(t[n]===" ")i++;else if(t[n]===" ")i+=e;else break;return i}function xX({highlightActiveBlock:t=!0,hideFirstIndent:e=!1,thickness:i=1,colors:n,deferMode:r="raf",buffer:s=1e3}={}){var o=n?T.baseTheme({"&light":{"--oc-im-c":n.light||"#e1e4e8","--oc-im-ca":n.activeLight||"#d0d7de"},"&dark":{"--oc-im-c":n.dark||"#30363d","--oc-im-ca":n.activeDark||"#484f58"}}):[];return[SX,o,me.fromClass(class{constructor(l){this._view=l,this._stepPx=null,this._measurePending=!1,this.decorations=this._build(l),this._scheduleMeasure(l)}update(l){this._view=l.view;var a=l.docChanged||l.viewportChanged||t&&l.selectionSet;if(a){if(r==="raf"&&l.viewportChanged&&!l.docChanged){this._rafId&&cancelAnimationFrame(this._rafId);var h=this;this._rafId=requestAnimationFrame(function(){h._rafId=null,h._stepPx=null,h._measurePending=!1,h.decorations=h._build(l.view),h._scheduleMeasure(l.view)});return}this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._stepPx=null,this._measurePending=!1,this.decorations=this._build(l.view),this._scheduleMeasure(l.view)}else this._measurePending&&(this._measurePending=!1,this.decorations=this._build(l.view))}_scheduleMeasure(l){this._measureId!==void 0&&l.cancelMeasure(this._measureId),this._measureId=l.requestMeasure(this._mkSpec())}_mkSpec(){var l=this;return{read:function(a){for(var h=a.state,c=Wt(h),f=h.tabSize,u=h.doc,d=u.lineAt(a
Line truncated
|
|
|
|
|
#{}`,{label:"gost-relay-template",type:"snippet",detail:"GOST Relay node"})];function mX(t){let e=t.matchBefore(/[\w-]+/);if(!e||e.from===e.to&&!t.explicit)return null;let i=gX.filter(s=>s.label.toLowerCase().startsWith(e.text.toLowerCase())),n=OX.filter(s=>(s.label||s.name||"").toLowerCase().startsWith(e.text.toLowerCase())),r=[...i,...n];return r.length?{from:e.from,options:r,validFor:/^[\w-]*$/}:null}function bX(t=750){return Ed(e=>{let i=[];try{YS(e.state.doc.toString(),{schema:Vd})}catch(n){let r=n.mark;if(r&&r.line!==void 0){let s=r.line+1;if(s<=e.state.doc.lines){let o=e.state.doc.line(s),l=Math.min(o.from+(r.column||0),o.to);i.push({from:l,to:Math.min(l+1,o.to),severity:"error",message:n.reason||n.message})}}else i.push({from:0,to:0,severity:"error",message:n.reason||n.message})}return i},typeof t=="number"?{delay:t}:void 0)}var fc=null,pg=null;function yX(){if(!window.levelTranslations){fc={},pg=/(?!)/;return}var t={},e=[];for(var i in window.levelTranslations)if(window.levelTranslations.hasOwnProperty(i)){var n=window.levelTranslations[i];t[n]=i,e.push(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}fc=t,pg=new RegExp("^\\[("+e.join("|")+")\\]")}var SX=_s.define({tokenTable:{timestamp:Ae.timestamp,bracket:Ae.bracket,category:Ae.category,logString:Ae.logString,logLink:Ae.logLink,levelInfo:Ae.levelInfo,levelWarning:Ae.levelWarning,levelError:Ae.levelError,levelDebug:Ae.levelDebug,levelTip:Ae.levelTip,levelFatal:Ae.levelFatal,levelWatchdog:Ae.levelWatchdog},startState(){return{tabDone:!1}},token(t,e){if(t.sol()&&(e.tabDone=!1,t.match(/\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}/)))return"timestamp";if(t.eatSpace())return null;var i=t.peek();if(!i)return t.skipToEnd(),null;if(i==="\u3010"&&t.match(/\u3010[^\u3011]*\u3011/))return"bracket";if(e.tabDone)return t.next(),"logString";if(i==="["){fc===null&&yX();var n=t.match(pg);if(n){var r=fc[n[1]];if(r){var s="level"+r.charAt(0).toUpperCase()+r.slice(1);if(Ae[s])return s}return"category"}if(t.match(/\[[A-Z][^\]]*\]/))return"category"}return i!=="["&&(e.tabDone=!0),t.next(),"logString"}}),xX=Vt.define([{tag:Ae.timestamp,class:"cmt-log-timestamp"},{tag:Ae.bracket,class:"cmt-log-bracket"},{tag:Ae.category,class:"cmt-log-category"},{tag:Ae.logString,class:"cmt-log-string"},{tag:Ae.logLink,class:"cmt-log-link"},{tag:Ae.levelInfo,class:"cmt-log-level-info"},{tag:Ae.levelWarning,class:"cmt-log-level-warning"},{tag:Ae.levelError,class:"cmt-log-level-error"},{tag:Ae.levelDebug,class:"cmt-log-level-debug"},{tag:Ae.levelTip,class:"cmt-log-level-tip"},{tag:Ae.levelFatal,class:"cmt-log-level-fatal"},{tag:Ae.levelWatchdog,class:"cmt-log-level-watchdog"}]);function Ak(t=1e3){return me.fromClass(class{constructor(e){this._preload(e)}update(e){if(e.viewportChanged||e.docChanged){this._rafId&&cancelAnimationFrame(this._rafId);var i=this;this._rafId=requestAnimationFrame(function(){i._rafId=null,i._preload(e.view)})}}_preload(e){var i=e.state.doc,n=i.lineAt(e.viewport.to).number,r=Math.min(n+t,i.lines);l0(e.state,i.line(r).to,50)}})}function kX(t=[]){return[Vh(),jh(),Gh(),Nh(),Ih(),Bh(),zh(),Yh(),Af(),Cf({placeholderDOM:null}),Qf(),jf(),sp(),T.lineWrapping,$u(),Ak(),wi.of([...qf,...zf,...cp,...Tu,...$f,{key:"Tab",run:function(e){return vu(e)||Nl(e)}}]),...t]}var wX=T.baseTheme({".cm-line":{position:"relative"},".cm-oc-im::before":{content:'""',position:"absolute",top:0,left:"6px",right:0,height:"var(--oc-lh, 100%)",background:"var(--oc-im)",pointerEvents:"none",zIndex:"-1"},"&light":{"--oc-im-c":"#e1e4e8","--oc-im-ca":"#d0d7de"},"&dark":{"--oc-im-c":"#30363d","--oc-im-ca":"#484f58"}});function dg(t,e){let i=0;for(let n=0;n<t.length;n++)if(t[n]===" ")i++;else if(t[n]===" ")i+=e;else break;return i}function vX({highlightActiveBlock:t=!0,hideFirstIndent:e=!1,thickness:i=1,colors:n,deferMode:r="raf",buffer:s=1e3}={}){var o=n?T.baseTheme({"&light":{"--oc-im-c":n.light||"#e1e4e8","--oc-im-ca":n.activeLight||"#d0d7de"},"&dark":{"--oc-im-c":n.dark||"#30363d","--oc-im-ca":n.activeDark||"#484f58"}}):[];return[wX,o,me.fromClass(class{constructor(l){this._view=l,this._stepPx=null,this._measurePending=!1,this.decorations=this._build(l),this._scheduleMeasure(l)}update(l){this._view=l.view;var a=l.docChanged||l.viewportChanged||t&&l.selectionSet;if(a){if(r==="raf"&&l.viewportChanged&&!l.docChanged){this._rafId&&cancelAnimationFrame(this._rafId);var h=this;this._rafId=requestAnimationFrame(function(){h._rafId=null,h._stepPx=null,h._measurePending=!1,h.decorations=h._build(l.view),h._scheduleMeasure(l.view)});return}this._rafId&&(cancelAnimationFrame(this._rafId),this._rafId=null),this._stepPx=null,this._measurePending=!1,this.decorations=this._build(l.view),this._scheduleMeasure(l.view)}else this._measurePending&&(this._measurePending=!1,this.decorations=this._build(l.view))}_scheduleMeasure(l){this._measureId!==void 0&&l.cancelMeasure(this._measureId),this._measureId=l.requestMeasure(this._mkSpec())}_mkSpec(){var l=this;return{read:function(a){for(var h=a.state,c=Wt(h),f=h.tabSize,u=h.doc,d=u.lineAt(a
Line truncated
|