@fnndsc/argus 0.49.2 → 0.49.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Settings-CynwvVmF.js → Settings-fVKVemQQ.js} +1 -1
- package/dist/assets/{Texture-CUE2sZUc.js → Texture-BgODsSgK.js} +1 -1
- package/dist/assets/{addVolumesToViewports-jkL6cXhf.js → addVolumesToViewports-BY7KOGfA.js} +1 -1
- package/dist/assets/{asciidoc-BQO4iSvH.js → asciidoc-RQ_qptF1.js} +1 -1
- package/dist/assets/{cornerstoneEngine-CnL2H_m8.js → cornerstoneEngine-BRNPnIOt.js} +2 -2
- package/dist/assets/{documentEngines-nNs3BDQn.js → documentEngines-BYIPThV9.js} +1 -1
- package/dist/assets/{field-BxQaoE-X.js → field-B205-Tj-.js} +1 -1
- package/dist/assets/{index-Ds1IEeoY.js → index-BdNdXhQP.js} +1 -1
- package/dist/assets/{index-6xVu8SR3.js → index-Bqm_Hovd.js} +1 -1
- package/dist/assets/{index-C_gVizDw.js → index-Bx9on2--.js} +249 -249
- package/dist/assets/{index-DOHGOhd6.js → index-CO9muX7k.js} +1 -1
- package/dist/assets/{index-Dm5bSR88.js → index-CdJeDIcL.js} +1 -1
- package/dist/assets/{index-C7VOsCCm.js → index-CnRSmWoR.js} +1 -1
- package/dist/assets/{index-CmyfI33v.css → index-D8wX84LU.css} +1 -1
- package/dist/assets/{index-DDVamRo8.js → index-D9bTQUpC.js} +1 -1
- package/dist/assets/{index-vzSVL2TX.js → index-DIFOuWMx.js} +1 -1
- package/dist/assets/{index-CwoRnDne.js → index-Da-AnxRT.js} +1 -1
- package/dist/assets/{index-Cz2KdzUm.js → index-DfLbMZD1.js} +1 -1
- package/dist/assets/{index-BJhuEfhB.js → index-Dio0XCm2.js} +1 -1
- package/dist/assets/{index-DijpRmkl.js → index-VyT6mhra.js} +1 -1
- package/dist/assets/{index-BKTol-_M.js → index-pW9eskfl.js} +1 -1
- package/dist/assets/{index-D40Oznjb.js → index-vz50_mRp.js} +1 -1
- package/dist/assets/{niivueEngine-BsToxwze.js → niivueEngine-7YBeiNJD.js} +2 -2
- package/dist/assets/{slabScene-B2U0mzjt.js → slabScene-D8umgMl8.js} +1 -1
- package/dist/assets/{syntax-D498Iat0.js → syntax-CpKw5ptt.js} +3 -3
- package/dist/build.json +1 -1
- package/dist/index.html +2 -2
- package/dist/notes.json +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as St}from"./index-
|
|
1
|
+
import{_ as St}from"./index-Bx9on2--.js";function An(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Re=An();function zo(r){Re=r}var ye={exec:()=>null};function je(r){let t=[];return e=>{let i=Math.max(0,Math.min(3,e-1)),s=t[i];return s||(s=r(i),t[i]=s),s}}function P(r,t=""){let e=typeof r=="string"?r:r.source,i={replace:(s,n)=>{let o=typeof n=="string"?n:n.source;return o=o.replace(ut.caret,"$1"),e=e.replace(s,o),i},getRegex:()=>new RegExp(e,t)};return i}var ll=((r="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+r)}catch{return!1}})(),ut={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:je(r=>new RegExp(`^ {0,${r}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:je(r=>new RegExp(`^ {0,${r}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:je(r=>new RegExp(`^ {0,${r}}(?:\`\`\`|~~~)`)),headingBeginRegex:je(r=>new RegExp(`^ {0,${r}}#`)),htmlBeginRegex:je(r=>new RegExp(`^ {0,${r}}(?:</?(?:${_i})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:je(r=>new RegExp(`^ {0,${r}}>`))},cl=/^(?:[ \t]*(?:\n|$))+/,ul=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$i=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fl=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,jo=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Bo=P(jo).replace(/bull/g,vn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),pl=P(jo).replace(/bull/g,vn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Sn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,dl=/^[^\n]+/,Tn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ml=P(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gl=P(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,vn).getRegex(),_i="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ln=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,bl=P("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ln).replace("tag",_i).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Wo=r=>P(Sn).replace("hr",$i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",r).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",_i).getRegex(),$l=Wo(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),_l=Wo(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),yl=P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",_l).getRegex(),En={blockquote:yl,code:ul,def:ml,fences:hl,heading:fl,hr:$i,html:bl,lheading:Bo,list:gl,newline:cl,paragraph:$l,table:ye,text:dl},Sr=P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",_i).getRegex(),wl={...En,lheading:pl,table:Sr,paragraph:P(Sn).replace("hr",$i).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",_i).getRegex()},kl={...En,html:P(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ln).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ye,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:P(Sn).replace("hr",$i).replace("heading",` *#{1,6} *[^
|
|
2
2
|
]`).replace("lheading",Bo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Al=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Uo=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,vl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,qt=/[\p{P}\p{S}]/u,Ve=/[\s\p{P}\p{S}]/u,yi=/[^\s\p{P}\p{S}]/u,Sl=P(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ve).getRegex(),Tl=/[\p{Pi}\p{Ps}"']/u,Fo=/(?!~)[\p{P}\p{S}]/u,Ll=/(?!~)[\s\p{P}\p{S}]/u,El=/(?:[^\s\p{P}\p{S}]|~)/u,Rl=P(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ll?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),qo=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Il=P(qo,"u").replace(/punct/g,qt).getRegex(),Ol=P(qo,"u").replace(/punct/g,Fo).getRegex(),Cl=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Dl=P(Cl,"u").replace(/openQuote/g,Tl).replace(/punct/g,qt).getRegex(),Ho="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ml=P(Ho,"gu").replace(/notPunctSpace/g,yi).replace(/punctSpace/g,Ve).replace(/punct/g,qt).getRegex(),Pl=P(Ho,"gu").replace(/notPunctSpace/g,El).replace(/punctSpace/g,Ll).replace(/punct/g,Fo).getRegex(),Nl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",zl=P(Nl,"gu").replace(/notPunctSpace/g,yi).replace(/punctSpace/g,Ve).replace(/punct/g,qt).getRegex(),jl=P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,yi).replace(/punctSpace/g,Ve).replace(/punct/g,qt).getRegex(),Bl="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Wl=P(Bl,"gu").replace(/notPunctSpace/g,yi).replace(/punctSpace/g,Ve).replace(/punct/g,qt).getRegex(),Ul=P(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,qt).getRegex(),Fl="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ql=P(Fl,"gu").replace(/notPunctSpace/g,yi).replace(/punctSpace/g,Ve).replace(/punct/g,qt).getRegex(),Hl=P(/\\(punct)/,"gu").replace(/punct/g,qt).getRegex(),Vl=P(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,qt).getRegex(),Gl=P(/^<(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(),Yl=P(Ln).replace("(?:-->|$)","-->").getRegex(),Xl=P("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Yl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Vo=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Gi=P(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Vo).getRegex(),Ql=P(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",Gi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Kl=P(/^!?\[(label)\]\[(ref)\]/).replace("label",Gi).replace("ref",Tn).getRegex(),Zl=P(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tn).getRegex(),Tr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Jl=P(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Vo).getRegex(),tc=P("reflink|nolink(?!\\()","g").replace("reflink",P(/^!?\[(label)\]\[(ref)\]/).replace("label",Jl).replace("ref",Tr).getRegex()).replace("nolink",P(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tr).getRegex()).getRegex(),Lr=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ec=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,ic=P(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,ec).getRegex(),Rn={_backpedal:ye,anyPunctuation:Hl,anyPunctuationOutsideCode:Vl,autolink:Gl,blockSkip:Rl,br:Uo,code:Al,del:ye,delLDelim:ye,delRDelim:ye,emStrongLDelim:Il,emStrongRDelimAst:Ml,emStrongRDelimUnd:jl,escape:xl,link:Ql,nolink:Zl,punctuation:Sl,reflink:Kl,reflinkSearch:tc,tag:Xl,text:vl,url:ye},sc={...Rn,emStrongLDelim:Dl,emStrongRDelimAst:zl,emStrongRDelimUnd:Wl,link:P(/^!?\[(label)\]\((.*?)\)/).replace("label",Gi).getRegex(),reflink:P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Gi).getRegex()},nn={...Rn,emStrongRDelimAst:Pl,emStrongLDelim:Ol,delLDelim:Ul,delRDelim:ql,url:P(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",ic).replace("protocol",Lr).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:P(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",Lr).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},nc={...nn,br:P(Uo).replace("{2,}","*").getRegex(),text:P(nn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ci={normal:En,gfm:wl,pedantic:kl},Ze={normal:Rn,gfm:nn,breaks:nc,pedantic:sc},rc={"&":"&","<":"<",">":">",'"':""","'":"'"},Er=r=>rc[r];function Tt(r,t){if(t){if(ut.escapeTest.test(r))return r.replace(ut.escapeReplace,Er)}else if(ut.escapeTestNoEncode.test(r))return r.replace(ut.escapeReplaceNoEncode,Er);return r}function oc(r){return ut.numericCharacterReference.test(r)?r.replace(ut.numericCharacterReferenceOrAmpersand,(t,e,i)=>{if(e===void 0&&i===void 0)return"&";let s=e===void 0?Number.parseInt(i,16):Number.parseInt(e,10);return s===0||s>1114111||s>=55296&&s<=57343?"�":s===38?"&":String.fromCodePoint(s)}):r}function Rr(r){try{r=encodeURI(r).replace(ut.percentDecode,"%")}catch{return null}return r}function Ir(r,t){let e=r.replace(ut.findPipe,(n,o,l)=>{let a=!1,c=o;for(;--c>=0&&l[c]==="\\";)a=!a;return a?"|":" |"}),i=e.split(ut.splitPipe),s=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;s<i.length;s++)i[s]=i[s].trim().replace(ut.slashPipe,"|");return i}function re(r,t,e){let i=r.length;if(i===0)return"";let s=0;for(;s<i&&r.charAt(i-s-1)===t;)s++;return r.slice(0,i-s)}function Or(r){let t=r.split(`
|
|
3
3
|
`),e=t.length-1;for(;e>=0&&ut.blankLine.test(t[e]);)e--;return t.length-e<=2?r:t.slice(0,e+1).join(`
|
|
4
4
|
`)}function Yi(r){return r.trim().toLowerCase().toUpperCase().toLowerCase()}function Cr(r,t){if(r.indexOf(t[0])===-1&&r.indexOf(t[1])===-1)return-1;let e=0;for(let i=0;i<r.length;i++)if(r[i]==="\\")i++;else if(r[i]===t[0])e++;else if(r[i]===t[1]&&(e--,e<0))return i;return e>0?-2:-1}function Rs(r,t=0){let e=t,i="";for(let s of r)if(s===" "){let n=4-e%4;i+=" ".repeat(n),e+=n}else i+=s,e++;return i}function Dr(r,t,e,i,s){let n=t.href,o=t.title||null,l=r[1].replace(s.other.outputLinkReplace,"$1"),a=r[0].charAt(0)==="!",c=i.state.inLink,u=i.state.linkEmitted,f=i.state.inRawBlock;i.state.inLink=!0,i.state.linkEmitted=!1;let h=i.inlineTokens(l),p=i.state.linkEmitted;if(i.state.linkEmitted=u,i.state.inLink=c,!a){if(p){i.state.inRawBlock=f;return}i.state.linkEmitted=!0}return{type:a?"image":"link",raw:e,href:n,title:o,text:l,tokens:h}}function ac(r,t,e){let i=r.match(e.other.indentCodeCompensation);if(i===null)return t;let s=i[1];return t.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as m,S as we,T as le,F as Z,c as ye,a as f,I as Ge,b as w,C as Pt,d as qt,A as Ue,D as Nt,g as ze,e as xe,i as $,f as He,s as Se,m as W,h as E,N as ae,j as he,k as Vt,l as Je,n as wt,o as Gt,V as $e,p as x,P as Ut,q as zt,r as Ht,t as Jt,u as k,R as $t,v as _e,w as _t,x as S,y as Kt,z as Qt,B as jt,G as Xt,H as Yt,J as Zt,K as en,L as tn,M as nn,O as rn,Q as on}from"./syntax-D498Iat0.js";import"./index-C_gVizDw.js";const ln=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Ae(e.state,n.from);return r.line?sn(e):r.block?an(e):!1};function ke(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);return o?(r(n.update(o)),!0):!1}}const sn=ke(fn,0),cn=ke(Ke,0),an=ke((e,t)=>Ke(e,t,un(t)),0);function Ae(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const N=50;function hn(e,{open:t,close:n},r,o){let l=e.sliceDoc(r-N,r),s=e.sliceDoc(o,o+N),i=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(s)[0].length,a=l.length-i;if(l.slice(a-t.length,a)==t&&s.slice(c,c+n.length)==n)return{open:{pos:r-i,margin:i&&1},close:{pos:o+c,margin:c&&1}};let h,u;o-r<=2*N?h=u=e.sliceDoc(r,o):(h=e.sliceDoc(r,r+N),u=e.sliceDoc(o-N,o));let d=/^\s*/.exec(h)[0].length,R=/\s*$/.exec(u)[0].length,C=u.length-R-n.length;return h.slice(d,d+t.length)==t&&u.slice(C,C+n.length)==n?{open:{pos:r+d+t.length,margin:/\s/.test(h.charAt(d+t.length))?1:0},close:{pos:o-R-n.length,margin:/\s/.test(u.charAt(C-1))?1:0}}:null}function un(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=n.to<=r.to?r:e.doc.lineAt(n.to);o.from>r.from&&o.from==n.to&&(o=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let l=t.length-1;l>=0&&t[l].to>r.from?t[l].to=o.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return t}function Ke(e,t,n=t.selection.ranges){let r=n.map(l=>Ae(t,l.from).block);if(!r.every(l=>l))return null;let o=n.map((l,s)=>hn(t,r[s],l.from,l.to));if(e!=2&&!o.every(l=>l))return{changes:t.changes(n.map((l,s)=>o[s]?[]:[{from:l.from,insert:r[s].open+" "},{from:l.to,insert:" "+r[s].close}]))};if(e!=1&&o.some(l=>l)){let l=[];for(let s=0,i;s<o.length;s++)if(i=o[s]){let c=r[s],{open:a,close:h}=i;l.push({from:a.pos-c.open.length,to:a.pos+a.margin},{from:h.pos-h.margin,to:h.pos+c.close.length})}return{changes:l}}return null}function fn(e,t,n=t.selection.ranges){let r=[],o=-1;e:for(let{from:l,to:s}of n){let i=r.length,c=1e9,a;for(let h=l;h<=s;){let u=t.doc.lineAt(h);if(a==null&&(a=Ae(t,u.from).line,!a))continue e;if(u.from>o&&(l==s||s>u.from)){o=u.from;let d=/^\s*/.exec(u.text)[0].length,R=d==u.length,C=u.text.slice(d,d+a.length)==a?d:-1;d<u.text.length&&d<c&&(c=d),r.push({line:u,comment:C,token:a,indent:d,empty:R,single:!1})}h=u.to+1}if(c<1e9)for(let h=i;h<r.length;h++)r[h].indent<r[h].line.text.length&&(r[h].indent=c);r.length==i+1&&(r[i].single=!0)}if(e!=2&&r.some(l=>l.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:i,token:c,indent:a,empty:h,single:u}of r)(u||!h)&&l.push({from:i.from+a,insert:c+" "});let s=t.changes(l);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(l=>l.comment>=0)){let l=[];for(let{line:s,comment:i,token:c}of r)if(i>=0){let a=s.from+i,h=a+c.length;s.text[h-s.from]==" "&&h++,l.push({from:a,to:h})}return{changes:l}}return null}const ue=Ue.define(),dn=Ue.define(),mn=Z.define(),Qe=Z.define({combine(e){return ye(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,o)=>t(r,o)||n(r,o)})}}),je=we.define({create(){return D.empty},update(e,t){let n=t.state.facet(Qe),r=t.annotation(ue);if(r){let c=g.fromTransaction(t,r.selection),a=r.side,h=a==0?e.undone:e.done;return c?h=_(h,h.length,n.minDepth,c):h=Ze(h,t.startState.selection),new D(a==0?r.rest:h,a==0?h:r.rest)}let o=t.annotation(dn);if((o=="full"||o=="before")&&(e=e.isolate()),t.annotation(le.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let l=g.fromTransaction(t),s=t.annotation(le.time),i=t.annotation(le.userEvent);return l?e=e.addChanges(l,s,i,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,i,n.newGroupDelay)),(o=="full"||o=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new D(e.done.map(g.fromJSON),e.undone.map(g.fromJSON))}});function pn(e={}){return[je,Qe.of(e),m.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Xe:t.inputType=="historyRedo"?fe:null;return r?(t.preventDefault(),r(n)):!1}})]}function ee(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(je,!1);if(!o)return!1;let l=o.pop(e,n,t);return l?(r(l),!0):!1}}const Xe=ee(0,!1),fe=ee(1,!1),gn=ee(0,!0),yn=ee(1,!0);class g{constructor(t,n,r,o,l){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=o,this.selectionsAfter=l}setSelAfter(t){return new g(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(o=>o.toJSON())}}static fromJSON(t){return new g(t.changes&&Pt.fromJSON(t.changes),[],t.mapped&&qt.fromJSON(t.mapped),t.startSelection&&f.fromJSON(t.startSelection),t.selectionsAfter.map(f.fromJSON))}static fromTransaction(t,n){let r=A;for(let o of t.startState.facet(mn)){let l=o(t);l.length&&(r=r.concat(l))}return!r.length&&t.changes.empty?null:new g(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,A)}static selection(t){return new g(void 0,A,void 0,void 0,t)}}function _(e,t,n,r){let o=t+1>n+20?t-n-1:0,l=e.slice(o,t);return l.push(r),l}function xn(e,t){let n=[],r=!1;return e.iterChangedRanges((o,l)=>n.push(o,l)),t.iterChangedRanges((o,l,s,i)=>{for(let c=0;c<n.length;){let a=n[c++],h=n[c++];i>=a&&s<=h&&(r=!0)}}),r}function Sn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function Ye(e,t){return e.length?t.length?e.concat(t):e:t}const A=[],kn=200;function Ze(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-kn));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),_(e,e.length-1,1e9,n.setSelAfter(r)))}else return[g.selection([t])]}function An(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function se(e,t){if(!e.length)return e;let n=e.length,r=A;for(;n;){let o=Mn(e[n-1],t,r);if(o.changes&&!o.changes.empty||o.effects.length){let l=e.slice(0,n);return l[n-1]=o,l}else t=o.mapped,n--,r=o.selectionsAfter}return r.length?[g.selection(r)]:A}function Mn(e,t,n){let r=Ye(e.selectionsAfter.length?e.selectionsAfter.map(i=>i.map(t)):A,n);if(!e.changes)return g.selection(r);let o=e.changes.map(t),l=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(l):l;return new g(o,w.mapEffects(e.effects,t),s,e.startSelection.map(l),r)}const Cn=/^(input\.type|delete)($|\.)/;class D{constructor(t,n,r=0,o=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=o}isolate(){return this.prevTime?new D(this.done,this.undone):this}addChanges(t,n,r,o,l){let s=this.done,i=s[s.length-1];return i&&i.changes&&!i.changes.empty&&t.changes&&(!r||Cn.test(r))&&(!i.selectionsAfter.length&&n-this.prevTime<o.newGroupDelay&&o.joinToEvent(l,xn(i.changes,t.changes))||r=="input.type.compose")?s=_(s,s.length-1,o.minDepth,new g(t.changes.compose(i.changes),Ye(w.mapEffects(t.effects,i.changes),i.effects),i.mapped,i.startSelection,A)):s=_(s,s.length,o.minDepth,t),new D(s,A,n,r)}addSelection(t,n,r,o){let l=this.done.length?this.done[this.done.length-1].selectionsAfter:A;return l.length>0&&n-this.prevTime<o&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Sn(l[l.length-1],t)?this:new D(Ze(this.done,t),this.undone,n,r)}addMapping(t){return new D(se(this.done,t),se(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let o=t==0?this.done:this.undone;if(o.length==0)return null;let l=o[o.length-1],s=l.selectionsAfter[0]||(l.startSelection?l.startSelection.map(l.changes.invertedDesc,1):n.selection);if(r&&l.selectionsAfter.length)return n.update({selection:l.selectionsAfter[l.selectionsAfter.length-1],annotations:ue.of({side:t,rest:An(o),selection:s}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(l.changes){let i=o.length==1?A:o.slice(0,o.length-1);return l.mapped&&(i=se(i,l.mapped)),n.update({changes:l.changes,selection:l.startSelection,effects:l.effects,annotations:ue.of({side:t,rest:i,selection:s}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}D.empty=new D(A,A);const Ln=[{key:"Mod-z",run:Xe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:fe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:fe,preventDefault:!0},{key:"Mod-u",run:gn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:yn,preventDefault:!0}];function q(e,t){return f.create(e.ranges.map(t),e.mainIndex)}function L(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function v({state:e,dispatch:t},n){let r=q(e.selection,n);return r.eq(e.selection,!0)?!1:(t(L(e,r)),!0)}function te(e,t){return f.cursor(t?e.to:e.from)}function et(e,t){return v(e,n=>n.empty?e.moveByChar(n,t):te(n,t))}function p(e){return e.textDirectionAt(e.state.selection.main.head)==Nt.LTR}const tt=e=>et(e,!p(e)),nt=e=>et(e,p(e));function rt(e,t){return v(e,n=>n.empty?e.moveByGroup(n,t):te(n,t))}const vn=e=>rt(e,!p(e)),Dn=e=>rt(e,p(e));function Bn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ne(e,t,n){let r=Se(e).resolveInner(t.head),o=n?ae.closedBy:ae.openedBy;for(let c=t.head;;){let a=n?r.childAfter(c):r.childBefore(c);if(!a)break;Bn(e,a,o)?r=a:c=n?a.to:a.from}let l=r.type.prop(o),s,i;return l&&(s=n?W(e,r.from,1):W(e,r.to,-1))&&s.matched?i=n?s.end.to:s.end.from:i=n?r.to:r.from,f.cursor(i,n?-1:1)}const bn=e=>v(e,t=>ne(e.state,t,!p(e))),En=e=>v(e,t=>ne(e.state,t,p(e)));function ot(e,t){return v(e,n=>{if(!n.empty)return te(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const lt=e=>ot(e,!1),st=e=>ot(e,!0);function it(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,o;if(t){for(let l of e.state.facet(m.scrollMargins)){let s=l(e);s?.top&&(n=Math.max(s?.top,n)),s?.bottom&&(r=Math.max(s?.bottom,r))}o=e.scrollDOM.clientHeight-n-r}else o=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,o-5)}}function ct(e,t){let n=it(e),{state:r}=e,o=q(r.selection,s=>s.empty?e.moveVertically(s,t,n.height):te(s,t));if(o.eq(r.selection))return!1;let l;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),i=e.scrollDOM.getBoundingClientRect(),c=i.top+n.marginTop,a=i.bottom-n.marginBottom;s&&s.top>c&&s.bottom<a&&(l=m.scrollIntoView(o.main.head,{y:"start",yMargin:s.top-c}))}return e.dispatch(L(r,o),{effects:l}),!0}const Ee=e=>ct(e,!1),de=e=>ct(e,!0);function b(e,t,n){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){let l=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;l&&t.head!=r.from+l&&(o=f.cursor(r.from+l))}return o}const Tn=e=>v(e,t=>b(e,t,!0)),Rn=e=>v(e,t=>b(e,t,!1)),On=e=>v(e,t=>b(e,t,!p(e))),In=e=>v(e,t=>b(e,t,p(e))),Wn=e=>v(e,t=>e.moveToLineBoundary(t,!1,!1)),Fn=e=>v(e,t=>e.moveToLineBoundary(t,!0,!1));function Pn(e,t,n){let r=!1,o=q(e.selection,l=>{let s=W(e,l.head,-1)||W(e,l.head,1)||l.head>0&&W(e,l.head-1,1)||l.head<e.doc.length&&W(e,l.head+1,-1);if(!s||!s.end)return l;r=!0;let i=s.start.from==l.head?s.end.to:s.end.from;return f.cursor(i)});return r?(t(L(e,o)),!0):!1}const qn=({state:e,dispatch:t})=>Pn(e,t);function M(e,t,n){let r=q(e.state.selection,o=>{o.undirectional&&o.head>=o.anchor!=t&&(o=f.range(o.head,o.anchor));let l=n(o);return f.range(o.anchor,l.head,l.goalColumn,l.bidiLevel||void 0,l.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(L(e.state,r)),!0)}function at(e,t){return M(e,t,n=>e.moveByChar(n,t))}const ht=e=>at(e,!p(e)),ut=e=>at(e,p(e));function ft(e,t){return M(e,t,n=>e.moveByGroup(n,t))}const Nn=e=>ft(e,!p(e)),Vn=e=>ft(e,p(e)),wn=e=>{let t=!p(e);return M(e,t,n=>ne(e.state,n,t))},Gn=e=>{let t=p(e);return M(e,t,n=>ne(e.state,n,t))};function dt(e,t){return M(e,t,n=>e.moveVertically(n,t))}const mt=e=>dt(e,!1),pt=e=>dt(e,!0);function gt(e,t){return M(e,t,n=>e.moveVertically(n,t,it(e).height))}const Te=e=>gt(e,!1),Re=e=>gt(e,!0),Un=e=>M(e,!0,t=>b(e,t,!0)),zn=e=>M(e,!1,t=>b(e,t,!1)),Hn=e=>{let t=!p(e);return M(e,t,n=>b(e,n,t))},Jn=e=>{let t=p(e);return M(e,t,n=>b(e,n,t))},$n=e=>M(e,!1,t=>f.cursor(e.lineBlockAt(t.head).from)),_n=e=>M(e,!0,t=>f.cursor(e.lineBlockAt(t.head).to)),Oe=({state:e,dispatch:t})=>(t(L(e,{anchor:0})),!0),Ie=({state:e,dispatch:t})=>(t(L(e,{anchor:e.doc.length})),!0),We=({state:e,dispatch:t})=>(t(L(e,{anchor:e.selection.main.anchor,head:0})),!0),Fe=({state:e,dispatch:t})=>(t(L(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Kn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Qn=({state:e,dispatch:t})=>{let n=re(e).map(({from:r,to:o})=>f.undirectionalRange(r,Math.min(o+1,e.doc.length)));return t(e.update({selection:f.create(n),userEvent:"select"})),!0},jn=({state:e,dispatch:t})=>{let n=q(e.selection,r=>{let o=Se(e),l=o.resolveStack(r.from,1);if(r.empty){let s=o.resolveStack(r.from,-1);s.node.from>=l.node.from&&s.node.to<=l.node.to&&(l=s)}for(let s=l;s;s=s.next){let{node:i}=s;if((i.from<r.from&&i.to>=r.to||i.to>r.to&&i.from<=r.from)&&s.next)return f.undirectionalRange(i.from,i.to)}return r});return n.eq(e.selection)?!1:(t(L(e,n)),!0)};function yt(e,t){let{state:n}=e,r=n.selection,o=n.selection.ranges.slice();for(let l of n.selection.ranges){let s=n.doc.lineAt(l.head);if(t?s.to<e.state.doc.length:s.from>0)for(let i=l;;){let c=e.moveVertically(i,t);if(c.head<s.from||c.head>s.to){o.some(a=>a.head==c.head)||o.push(c);break}else{if(c.head==i.head)break;i=c}}}return o.length==r.ranges.length?!1:(e.dispatch(L(n,f.create(o,o.length-1))),!0)}const Xn=e=>yt(e,!1),Yn=e=>yt(e,!0),Zn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=f.create([n.main]):n.main.empty||(r=f.create([f.cursor(n.main.head)])),r?(t(L(e,r)),!0):!1};function G(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,o=r.changeByRange(l=>{let{from:s,to:i}=l;if(s==i){let c=t(l);c<s?(n="delete.backward",c=z(e,c,!1)):c>s&&(n="delete.forward",c=z(e,c,!0)),s=Math.min(s,c),i=Math.max(i,c)}else s=z(e,s,!1),i=z(e,i,!0);return s==i?{range:l}:{changes:{from:s,to:i},range:f.cursor(s,s<l.head?-1:1)}});return o.changes.empty?!1:(e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?m.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function z(e,t,n){if(e instanceof m)for(let r of e.state.facet(m.atomicRanges).map(o=>o(e)))r.between(t,t,(o,l)=>{o<t&&l>t&&(t=n?l:o)});return t}const xt=(e,t,n)=>G(e,r=>{let o=r.from,{state:l}=e,s=l.doc.lineAt(o),i,c;if(n&&!t&&o>s.from&&o<s.from+200&&!/[^ \t]/.test(i=s.text.slice(0,o-s.from))){if(i[i.length-1]==" ")return o-1;let a=xe(i,l.tabSize),h=a%he(l)||he(l);for(let u=0;u<h&&i[i.length-1-u]==" ";u++)o--;c=o}else c=E(s.text,o-s.from,t,t)+s.from,c==o&&s.number!=(t?l.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(c-s.from,o-s.from))&&(c=E(s.text,c-s.from,!1,!1)+s.from);return c}),me=e=>xt(e,!1,!0),St=e=>xt(e,!0,!1),kt=(e,t)=>G(e,n=>{let r=n.head,{state:o}=e,l=o.doc.lineAt(r),s=o.charCategorizer(r);for(let i=null;;){if(r==(t?l.to:l.from)){r==n.head&&l.number!=(t?o.doc.lines:1)&&(r+=t?1:-1);break}let c=E(l.text,r-l.from,t)+l.from,a=l.text.slice(Math.min(r,c)-l.from,Math.max(r,c)-l.from),h=s(a);if(i!=null&&h!=i)break;(a!=" "||r!=n.head)&&(i=h),r=c}return r}),At=e=>kt(e,!1),er=e=>kt(e,!0),tr=e=>G(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),nr=e=>G(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),rr=e=>G(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),or=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:He.of(["",""])},range:f.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},lr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let o=r.from,l=e.doc.lineAt(o),s=o==l.from?o-1:E(l.text,o-l.from,!1)+l.from,i=o==l.to?o+1:E(l.text,o-l.from,!0)+l.from;return{changes:{from:s,to:i,insert:e.doc.slice(o,i).append(e.doc.slice(s,o))},range:f.cursor(i)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function re(e){let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.from),l=e.doc.lineAt(r.to);if(!r.empty&&r.to==l.from&&(l=e.doc.lineAt(r.to-1)),n>=o.number){let s=t[t.length-1];s.to=l.to,s.ranges.push(r)}else t.push({from:o.from,to:l.to,ranges:[r]});n=l.number+1}return t}function Mt(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let l of re(e)){if(n?l.to==e.doc.length:l.from==0)continue;let s=e.doc.lineAt(n?l.to+1:l.from-1),i=s.length+1;if(n){r.push({from:l.to,to:s.to},{from:l.from,insert:s.text+e.lineBreak});for(let c of l.ranges)o.push(f.range(Math.min(e.doc.length,c.anchor+i),Math.min(e.doc.length,c.head+i)))}else{r.push({from:s.from,to:l.from},{from:l.to,insert:e.lineBreak+s.text});for(let c of l.ranges)o.push(f.range(c.anchor-i,c.head-i))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:f.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const sr=({state:e,dispatch:t})=>Mt(e,t,!1),ir=({state:e,dispatch:t})=>Mt(e,t,!0);function Ct(e,t,n){if(e.readOnly)return!1;let r=[];for(let l of re(e))n?r.push({from:l.from,insert:e.doc.slice(l.from,l.to)+e.lineBreak}):r.push({from:l.to,insert:e.lineBreak+e.doc.slice(l.from,l.to)});let o=e.changes(r);return t(e.update({changes:o,selection:e.selection.map(o,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const cr=({state:e,dispatch:t})=>Ct(e,t,!1),ar=({state:e,dispatch:t})=>Ct(e,t,!0),hr=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(re(t).map(({from:o,to:l})=>(o>0?o--:l<t.doc.length&&l++,{from:o,to:l}))),r=q(t.selection,o=>{let l;if(e.lineWrapping){let s=e.lineBlockAt(o.head),i=e.coordsAtPos(o.head,o.assoc||1);i&&(l=s.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(o,!0,l)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ur(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Se(e).resolveInner(t),r=n.childBefore(t),o=n.childAfter(t),l;return r&&o&&r.to<=t&&o.from>=t&&(l=r.type.prop(ae.closedBy))&&l.indexOf(o.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(o.from).from&&!/\S/.test(e.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}const Pe=Lt(!1),fr=Lt(!0);function Lt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(o=>{let{from:l,to:s}=o,i=t.doc.lineAt(l),c=!e&&l==s&&ur(t,l);e&&(l=s=(s<=i.to?i:t.doc.lineAt(s)).to);let a=new Ge(t,{simulateBreak:l,simulateDoubleBreak:!!c}),h=ze(a,l);for(h==null&&(h=xe(/^\s*/.exec(t.doc.lineAt(l).text)[0],t.tabSize));s<i.to&&/\s/.test(i.text[s-i.from]);)s++;c?{from:l,to:s}=c:l>i.from&&l<i.from+100&&!/\S/.test(i.text.slice(0,l))&&(l=i.from);let u=["",$(t,h)];return c&&u.push($(t,a.lineIndent(i.from,-1))),{changes:{from:l,to:s,insert:He.of(u)},range:f.cursor(l+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Me(e,t){let n=-1;return e.changeByRange(r=>{let o=[];for(let s=r.from;s<=r.to;){let i=e.doc.lineAt(s);i.number>n&&(r.empty||r.to>i.from)&&(t(i,o,r),n=i.number),s=i.to+1}let l=e.changes(o);return{changes:o,range:f.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}})}const dr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ge(e,{overrideIndentation:l=>{let s=n[l];return s??-1}}),o=Me(e,(l,s,i)=>{let c=ze(r,l.from);if(c==null)return;/\S/.test(l.text)||(c=0);let a=/^\s*/.exec(l.text)[0],h=$(e,c);(a!=h||i.from<l.from+a.length)&&(n[l.from]=c,s.push({from:l.from,to:l.from+a.length,insert:h}))});return o.changes.empty||t(e.update(o,{userEvent:"indent"})),!0},vt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Me(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Vt)})}),{userEvent:"input.indent"})),!0),Dt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Me(e,(n,r)=>{let o=/^\s*/.exec(n.text)[0];if(!o)return;let l=xe(o,e.tabSize),s=0,i=$(e,Math.max(0,l-he(e)));for(;s<o.length&&s<i.length&&o.charCodeAt(s)==i.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+o.length,insert:i.slice(s)})}),{userEvent:"delete.dedent"})),!0),mr=e=>(e.setTabFocusMode(),!0),pr=[{key:"Ctrl-b",run:tt,shift:ht,preventDefault:!0},{key:"Ctrl-f",run:nt,shift:ut},{key:"Ctrl-p",run:lt,shift:mt},{key:"Ctrl-n",run:st,shift:pt},{key:"Ctrl-a",run:Wn,shift:$n},{key:"Ctrl-e",run:Fn,shift:_n},{key:"Ctrl-d",run:St},{key:"Ctrl-h",run:me},{key:"Ctrl-k",run:tr},{key:"Ctrl-Alt-h",run:At},{key:"Ctrl-o",run:or},{key:"Ctrl-t",run:lr},{key:"Ctrl-v",run:de}],gr=[{key:"ArrowLeft",run:tt,shift:ht,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:vn,shift:Nn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:On,shift:Hn,preventDefault:!0},{key:"ArrowRight",run:nt,shift:ut,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Dn,shift:Vn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:In,shift:Jn,preventDefault:!0},{key:"ArrowUp",run:lt,shift:mt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Oe,shift:We},{mac:"Ctrl-ArrowUp",run:Ee,shift:Te},{key:"ArrowDown",run:st,shift:pt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ie,shift:Fe},{mac:"Ctrl-ArrowDown",run:de,shift:Re},{key:"PageUp",run:Ee,shift:Te},{key:"PageDown",run:de,shift:Re},{key:"Home",run:Rn,shift:zn,preventDefault:!0},{key:"Mod-Home",run:Oe,shift:We},{key:"End",run:Tn,shift:Un,preventDefault:!0},{key:"Mod-End",run:Ie,shift:Fe},{key:"Enter",run:Pe,shift:Pe},{key:"Mod-a",run:Kn},{key:"Backspace",run:me,shift:me,preventDefault:!0},{key:"Delete",run:St,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:At,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:er,preventDefault:!0},{mac:"Mod-Backspace",run:nr,preventDefault:!0},{mac:"Mod-Delete",run:rr,preventDefault:!0}].concat(pr.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),yr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:bn,shift:wn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:En,shift:Gn},{key:"Alt-ArrowUp",run:sr},{key:"Shift-Alt-ArrowUp",run:cr},{key:"Alt-ArrowDown",run:ir},{key:"Shift-Alt-ArrowDown",run:ar},{key:"Mod-Alt-ArrowUp",run:Xn},{key:"Mod-Alt-ArrowDown",run:Yn},{key:"Escape",run:Zn},{key:"Mod-Enter",run:fr},{key:"Alt-l",mac:"Ctrl-l",run:Qn},{key:"Mod-i",run:jn,preventDefault:!0},{key:"Mod-[",run:Dt},{key:"Mod-]",run:vt},{key:"Mod-Alt-\\",run:dr},{key:"Shift-Mod-k",run:hr},{key:"Shift-Mod-\\",run:qn},{key:"Mod-/",run:ln},{key:"Alt-A",mac:"Ctrl-A",run:cn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:mr}].concat(gr),xr={key:"Tab",run:vt,shift:Dt},qe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class P{constructor(t,n,r=0,o=t.length,l,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,o),this.bufferStart=r,this.normalize=l?i=>l(qe(i)):qe,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ht(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=_t(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Jt(t);let o=this.normalize(n);if(o.length)for(let l=0,s=r,i=!0;;l++){let c=o.charCodeAt(l),a=this.match(c,s,i,this.bufferPos+this.bufferStart,l==o.length-1);if(a)return this.value=a,this;if(l==o.length-1)break;i&&l<n.length&&n.charCodeAt(l)==c?s++:i=!1}}}match(t,n,r,o,l){let s=null;for(let i=0;i<this.matches.length;){let c=this.matches[i],a=!1;this.query.charCodeAt(c.index)==t&&(c.index==this.query.length-1?s={from:c.from,to:o,precise:l&&c.precise}:(c.index++,a=!0)),a?i++:this.matches.splice(i,1)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:n,to:o,precise:r&&l}:this.matches.push({from:n,index:1,precise:r})),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(P.prototype[Symbol.iterator]=function(){return this});const Bt={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Ce="gm"+(/x/.unicode==null?"":"u");class bt{constructor(t,n,r,o=0,l=t.length){if(this.text=t,this.to=l,this.curLine="",this.done=!1,this.value=Bt,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Et(t,n,r,o,l);this.re=new RegExp(n,Ce+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let s=t.lineAt(o);this.curLineStart=s.from,this.matchPos=K(t,o),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,o=r+n[0].length;if(this.matchPos=K(this.text,o+(r==o?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<o||r>this.value.to)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const ie=new WeakMap;class F{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let o=ie.get(t);if(!o||o.from>=r||o.to<=n){let i=new F(n,t.sliceString(n,r));return ie.set(t,i),i}if(o.from==n&&o.to==r)return o;let{text:l,from:s}=o;return s>n&&(l=t.sliceString(n,s)+l,s=n),o.to<r&&(l+=t.sliceString(o.to,r)),ie.set(t,new F(s,l)),new F(n,l.slice(n-s,r-s))}}class Et{constructor(t,n,r,o,l){this.text=t,this.to=l,this.done=!1,this.value=Bt,this.matchPos=K(t,o),this.re=new RegExp(n,Ce+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=F.get(t,o,this.chunkEnd(o+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,o=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,precise:!0,match:n},this.matchPos=K(this.text,o+(r==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=F.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(bt.prototype[Symbol.iterator]=Et.prototype[Symbol.iterator]=function(){return this});function Sr(e){try{return new RegExp(e,Ce),!0}catch{return!1}}function K(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const kr=e=>{let t=wt(e,"cm-goto-line");if(t){let s=t.dom.querySelector("input[type=text]");return s&&s.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:o,result:l}=Gt(e,{class:"cm-goto-line",label:n.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:n.phrase("go")});return l.then(s=>{let i=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!i){e.dispatch({effects:o});return}let c=n.doc.lineAt(n.selection.main.head),[,a,h,u,d]=i,R=u?+u.slice(1):0,C=h?+h:c.number;if(h&&d){let oe=C/100;a&&(oe=oe*(a=="-"?-1:1)+c.number/n.doc.lines),C=Math.round(n.doc.lines*oe)}else h&&a&&(C=C*(a=="-"?-1:1)+c.number);let Be=n.doc.line(Math.max(1,Math.min(n.doc.lines,C))),be=f.cursor(Be.from+Math.max(0,Math.min(R,Be.length)));e.dispatch({effects:[o,m.scrollIntoView(be.from,{y:"center"})],selection:be})}),!0},Ar={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Mr=Z.define({combine(e){return ye(e,Ar,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Cr(e){return[br,Br]}const Lr=x.mark({class:"cm-selectionMatch"}),vr=x.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ne(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=k.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=k.Word)}function Dr(e,t,n,r){return e(t.sliceDoc(n,n+1))==k.Word&&e(t.sliceDoc(r-1,r))==k.Word}const Br=$e.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Mr),{state:n}=e,r=n.selection;if(r.ranges.length>1)return x.none;let o=r.main,l,s=null;if(o.empty){if(!t.highlightWordAroundCursor)return x.none;let c=n.wordAt(o.head);if(!c)return x.none;s=n.charCategorizer(o.head),l=n.sliceDoc(c.from,c.to)}else{let c=o.to-o.from;if(c<t.minSelectionLength||c>200)return x.none;if(t.wholeWords){if(l=n.sliceDoc(o.from,o.to),s=n.charCategorizer(o.head),!(Ne(s,n,o.from,o.to)&&Dr(s,n,o.from,o.to)))return x.none}else if(l=n.sliceDoc(o.from,o.to),!l)return x.none}let i=[];for(let c of e.visibleRanges){let a=new P(n.doc,l,c.from,c.to);for(;!a.next().done;){let{from:h,to:u}=a.value;if((!s||Ne(s,n,h,u))&&(o.empty&&h<=o.from&&u>=o.to?i.push(vr.range(h,u)):(h>=o.to||u<=o.from)&&i.push(Lr.range(h,u)),i.length>t.maxMatches))return x.none}}return x.set(i)}},{decorations:e=>e.decorations}),br=m.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Er=({state:e,dispatch:t})=>{let{selection:n}=e,r=f.create(n.ranges.map(o=>e.wordAt(o.head)||f.cursor(o.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Tr(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),l=o&&o.from==n.from&&o.to==n.to;for(let s=!1,i=new P(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(s)return null;i=new P(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(c=>c.from==i.value.from))continue;if(l){let c=e.wordAt(i.value.from);if(!c||c.from!=i.value.from||c.to!=i.value.to)continue}return i.value}}const Rr=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(l=>l.from===l.to))return Er({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(l=>e.sliceDoc(l.from,l.to)!=r))return!1;let o=Tr(e,r);return o?(t(e.update({selection:e.selection.addRange(f.range(o.from,o.to),!1),effects:m.scrollIntoView(o.to)})),!0):!1},T=Z.define({combine(e){return ye(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new $r(t),scrollToMatch:t=>m.scrollIntoView(t)})}});function Or(e){return e?[T.of(e),ge]:ge}class Tt{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Sr(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
1
|
+
import{E as m,S as we,T as le,F as Z,c as ye,a as f,I as Ge,b as w,C as Pt,d as qt,A as Ue,D as Nt,g as ze,e as xe,i as $,f as He,s as Se,m as W,h as E,N as ae,j as he,k as Vt,l as Je,n as wt,o as Gt,V as $e,p as x,P as Ut,q as zt,r as Ht,t as Jt,u as k,R as $t,v as _e,w as _t,x as S,y as Kt,z as Qt,B as jt,G as Xt,H as Yt,J as Zt,K as en,L as tn,M as nn,O as rn,Q as on}from"./syntax-CpKw5ptt.js";import"./index-Bx9on2--.js";const ln=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=Ae(e.state,n.from);return r.line?sn(e):r.block?an(e):!1};function ke(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let o=e(t,n);return o?(r(n.update(o)),!0):!1}}const sn=ke(fn,0),cn=ke(Ke,0),an=ke((e,t)=>Ke(e,t,un(t)),0);function Ae(e,t){let n=e.languageDataAt("commentTokens",t,1);return n.length?n[0]:{}}const N=50;function hn(e,{open:t,close:n},r,o){let l=e.sliceDoc(r-N,r),s=e.sliceDoc(o,o+N),i=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(s)[0].length,a=l.length-i;if(l.slice(a-t.length,a)==t&&s.slice(c,c+n.length)==n)return{open:{pos:r-i,margin:i&&1},close:{pos:o+c,margin:c&&1}};let h,u;o-r<=2*N?h=u=e.sliceDoc(r,o):(h=e.sliceDoc(r,r+N),u=e.sliceDoc(o-N,o));let d=/^\s*/.exec(h)[0].length,R=/\s*$/.exec(u)[0].length,C=u.length-R-n.length;return h.slice(d,d+t.length)==t&&u.slice(C,C+n.length)==n?{open:{pos:r+d+t.length,margin:/\s/.test(h.charAt(d+t.length))?1:0},close:{pos:o-R-n.length,margin:/\s/.test(u.charAt(C-1))?1:0}}:null}function un(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),o=n.to<=r.to?r:e.doc.lineAt(n.to);o.from>r.from&&o.from==n.to&&(o=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let l=t.length-1;l>=0&&t[l].to>r.from?t[l].to=o.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:o.to})}return t}function Ke(e,t,n=t.selection.ranges){let r=n.map(l=>Ae(t,l.from).block);if(!r.every(l=>l))return null;let o=n.map((l,s)=>hn(t,r[s],l.from,l.to));if(e!=2&&!o.every(l=>l))return{changes:t.changes(n.map((l,s)=>o[s]?[]:[{from:l.from,insert:r[s].open+" "},{from:l.to,insert:" "+r[s].close}]))};if(e!=1&&o.some(l=>l)){let l=[];for(let s=0,i;s<o.length;s++)if(i=o[s]){let c=r[s],{open:a,close:h}=i;l.push({from:a.pos-c.open.length,to:a.pos+a.margin},{from:h.pos-h.margin,to:h.pos+c.close.length})}return{changes:l}}return null}function fn(e,t,n=t.selection.ranges){let r=[],o=-1;e:for(let{from:l,to:s}of n){let i=r.length,c=1e9,a;for(let h=l;h<=s;){let u=t.doc.lineAt(h);if(a==null&&(a=Ae(t,u.from).line,!a))continue e;if(u.from>o&&(l==s||s>u.from)){o=u.from;let d=/^\s*/.exec(u.text)[0].length,R=d==u.length,C=u.text.slice(d,d+a.length)==a?d:-1;d<u.text.length&&d<c&&(c=d),r.push({line:u,comment:C,token:a,indent:d,empty:R,single:!1})}h=u.to+1}if(c<1e9)for(let h=i;h<r.length;h++)r[h].indent<r[h].line.text.length&&(r[h].indent=c);r.length==i+1&&(r[i].single=!0)}if(e!=2&&r.some(l=>l.comment<0&&(!l.empty||l.single))){let l=[];for(let{line:i,token:c,indent:a,empty:h,single:u}of r)(u||!h)&&l.push({from:i.from+a,insert:c+" "});let s=t.changes(l);return{changes:s,selection:t.selection.map(s,1)}}else if(e!=1&&r.some(l=>l.comment>=0)){let l=[];for(let{line:s,comment:i,token:c}of r)if(i>=0){let a=s.from+i,h=a+c.length;s.text[h-s.from]==" "&&h++,l.push({from:a,to:h})}return{changes:l}}return null}const ue=Ue.define(),dn=Ue.define(),mn=Z.define(),Qe=Z.define({combine(e){return ye(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,n)=>(r,o)=>t(r,o)||n(r,o)})}}),je=we.define({create(){return D.empty},update(e,t){let n=t.state.facet(Qe),r=t.annotation(ue);if(r){let c=g.fromTransaction(t,r.selection),a=r.side,h=a==0?e.undone:e.done;return c?h=_(h,h.length,n.minDepth,c):h=Ze(h,t.startState.selection),new D(a==0?r.rest:h,a==0?h:r.rest)}let o=t.annotation(dn);if((o=="full"||o=="before")&&(e=e.isolate()),t.annotation(le.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let l=g.fromTransaction(t),s=t.annotation(le.time),i=t.annotation(le.userEvent);return l?e=e.addChanges(l,s,i,n,t):t.selection&&(e=e.addSelection(t.startState.selection,s,i,n.newGroupDelay)),(o=="full"||o=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new D(e.done.map(g.fromJSON),e.undone.map(g.fromJSON))}});function pn(e={}){return[je,Qe.of(e),m.domEventHandlers({beforeinput(t,n){let r=t.inputType=="historyUndo"?Xe:t.inputType=="historyRedo"?fe:null;return r?(t.preventDefault(),r(n)):!1}})]}function ee(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let o=n.field(je,!1);if(!o)return!1;let l=o.pop(e,n,t);return l?(r(l),!0):!1}}const Xe=ee(0,!1),fe=ee(1,!1),gn=ee(0,!0),yn=ee(1,!0);class g{constructor(t,n,r,o,l){this.changes=t,this.effects=n,this.mapped=r,this.startSelection=o,this.selectionsAfter=l}setSelAfter(t){return new g(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,n,r;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(o=>o.toJSON())}}static fromJSON(t){return new g(t.changes&&Pt.fromJSON(t.changes),[],t.mapped&&qt.fromJSON(t.mapped),t.startSelection&&f.fromJSON(t.startSelection),t.selectionsAfter.map(f.fromJSON))}static fromTransaction(t,n){let r=A;for(let o of t.startState.facet(mn)){let l=o(t);l.length&&(r=r.concat(l))}return!r.length&&t.changes.empty?null:new g(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,A)}static selection(t){return new g(void 0,A,void 0,void 0,t)}}function _(e,t,n,r){let o=t+1>n+20?t-n-1:0,l=e.slice(o,t);return l.push(r),l}function xn(e,t){let n=[],r=!1;return e.iterChangedRanges((o,l)=>n.push(o,l)),t.iterChangedRanges((o,l,s,i)=>{for(let c=0;c<n.length;){let a=n[c++],h=n[c++];i>=a&&s<=h&&(r=!0)}}),r}function Sn(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((n,r)=>n.empty!=t.ranges[r].empty).length===0}function Ye(e,t){return e.length?t.length?e.concat(t):e:t}const A=[],kn=200;function Ze(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-kn));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),_(e,e.length-1,1e9,n.setSelAfter(r)))}else return[g.selection([t])]}function An(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function se(e,t){if(!e.length)return e;let n=e.length,r=A;for(;n;){let o=Mn(e[n-1],t,r);if(o.changes&&!o.changes.empty||o.effects.length){let l=e.slice(0,n);return l[n-1]=o,l}else t=o.mapped,n--,r=o.selectionsAfter}return r.length?[g.selection(r)]:A}function Mn(e,t,n){let r=Ye(e.selectionsAfter.length?e.selectionsAfter.map(i=>i.map(t)):A,n);if(!e.changes)return g.selection(r);let o=e.changes.map(t),l=t.mapDesc(e.changes,!0),s=e.mapped?e.mapped.composeDesc(l):l;return new g(o,w.mapEffects(e.effects,t),s,e.startSelection.map(l),r)}const Cn=/^(input\.type|delete)($|\.)/;class D{constructor(t,n,r=0,o=void 0){this.done=t,this.undone=n,this.prevTime=r,this.prevUserEvent=o}isolate(){return this.prevTime?new D(this.done,this.undone):this}addChanges(t,n,r,o,l){let s=this.done,i=s[s.length-1];return i&&i.changes&&!i.changes.empty&&t.changes&&(!r||Cn.test(r))&&(!i.selectionsAfter.length&&n-this.prevTime<o.newGroupDelay&&o.joinToEvent(l,xn(i.changes,t.changes))||r=="input.type.compose")?s=_(s,s.length-1,o.minDepth,new g(t.changes.compose(i.changes),Ye(w.mapEffects(t.effects,i.changes),i.effects),i.mapped,i.startSelection,A)):s=_(s,s.length,o.minDepth,t),new D(s,A,n,r)}addSelection(t,n,r,o){let l=this.done.length?this.done[this.done.length-1].selectionsAfter:A;return l.length>0&&n-this.prevTime<o&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&Sn(l[l.length-1],t)?this:new D(Ze(this.done,t),this.undone,n,r)}addMapping(t){return new D(se(this.done,t),se(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,n,r){let o=t==0?this.done:this.undone;if(o.length==0)return null;let l=o[o.length-1],s=l.selectionsAfter[0]||(l.startSelection?l.startSelection.map(l.changes.invertedDesc,1):n.selection);if(r&&l.selectionsAfter.length)return n.update({selection:l.selectionsAfter[l.selectionsAfter.length-1],annotations:ue.of({side:t,rest:An(o),selection:s}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(l.changes){let i=o.length==1?A:o.slice(0,o.length-1);return l.mapped&&(i=se(i,l.mapped)),n.update({changes:l.changes,selection:l.startSelection,effects:l.effects,annotations:ue.of({side:t,rest:i,selection:s}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}D.empty=new D(A,A);const Ln=[{key:"Mod-z",run:Xe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:fe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:fe,preventDefault:!0},{key:"Mod-u",run:gn,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:yn,preventDefault:!0}];function q(e,t){return f.create(e.ranges.map(t),e.mainIndex)}function L(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function v({state:e,dispatch:t},n){let r=q(e.selection,n);return r.eq(e.selection,!0)?!1:(t(L(e,r)),!0)}function te(e,t){return f.cursor(t?e.to:e.from)}function et(e,t){return v(e,n=>n.empty?e.moveByChar(n,t):te(n,t))}function p(e){return e.textDirectionAt(e.state.selection.main.head)==Nt.LTR}const tt=e=>et(e,!p(e)),nt=e=>et(e,p(e));function rt(e,t){return v(e,n=>n.empty?e.moveByGroup(n,t):te(n,t))}const vn=e=>rt(e,!p(e)),Dn=e=>rt(e,p(e));function Bn(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function ne(e,t,n){let r=Se(e).resolveInner(t.head),o=n?ae.closedBy:ae.openedBy;for(let c=t.head;;){let a=n?r.childAfter(c):r.childBefore(c);if(!a)break;Bn(e,a,o)?r=a:c=n?a.to:a.from}let l=r.type.prop(o),s,i;return l&&(s=n?W(e,r.from,1):W(e,r.to,-1))&&s.matched?i=n?s.end.to:s.end.from:i=n?r.to:r.from,f.cursor(i,n?-1:1)}const bn=e=>v(e,t=>ne(e.state,t,!p(e))),En=e=>v(e,t=>ne(e.state,t,p(e)));function ot(e,t){return v(e,n=>{if(!n.empty)return te(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}const lt=e=>ot(e,!1),st=e=>ot(e,!0);function it(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,o;if(t){for(let l of e.state.facet(m.scrollMargins)){let s=l(e);s?.top&&(n=Math.max(s?.top,n)),s?.bottom&&(r=Math.max(s?.bottom,r))}o=e.scrollDOM.clientHeight-n-r}else o=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,o-5)}}function ct(e,t){let n=it(e),{state:r}=e,o=q(r.selection,s=>s.empty?e.moveVertically(s,t,n.height):te(s,t));if(o.eq(r.selection))return!1;let l;if(n.selfScroll){let s=e.coordsAtPos(r.selection.main.head),i=e.scrollDOM.getBoundingClientRect(),c=i.top+n.marginTop,a=i.bottom-n.marginBottom;s&&s.top>c&&s.bottom<a&&(l=m.scrollIntoView(o.main.head,{y:"start",yMargin:s.top-c}))}return e.dispatch(L(r,o),{effects:l}),!0}const Ee=e=>ct(e,!1),de=e=>ct(e,!0);function b(e,t,n){let r=e.lineBlockAt(t.head),o=e.moveToLineBoundary(t,n);if(o.head==t.head&&o.head!=(n?r.to:r.from)&&(o=e.moveToLineBoundary(t,n,!1)),!n&&o.head==r.from&&r.length){let l=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;l&&t.head!=r.from+l&&(o=f.cursor(r.from+l))}return o}const Tn=e=>v(e,t=>b(e,t,!0)),Rn=e=>v(e,t=>b(e,t,!1)),On=e=>v(e,t=>b(e,t,!p(e))),In=e=>v(e,t=>b(e,t,p(e))),Wn=e=>v(e,t=>e.moveToLineBoundary(t,!1,!1)),Fn=e=>v(e,t=>e.moveToLineBoundary(t,!0,!1));function Pn(e,t,n){let r=!1,o=q(e.selection,l=>{let s=W(e,l.head,-1)||W(e,l.head,1)||l.head>0&&W(e,l.head-1,1)||l.head<e.doc.length&&W(e,l.head+1,-1);if(!s||!s.end)return l;r=!0;let i=s.start.from==l.head?s.end.to:s.end.from;return f.cursor(i)});return r?(t(L(e,o)),!0):!1}const qn=({state:e,dispatch:t})=>Pn(e,t);function M(e,t,n){let r=q(e.state.selection,o=>{o.undirectional&&o.head>=o.anchor!=t&&(o=f.range(o.head,o.anchor));let l=n(o);return f.range(o.anchor,l.head,l.goalColumn,l.bidiLevel||void 0,l.assoc)});return r.eq(e.state.selection)?!1:(e.dispatch(L(e.state,r)),!0)}function at(e,t){return M(e,t,n=>e.moveByChar(n,t))}const ht=e=>at(e,!p(e)),ut=e=>at(e,p(e));function ft(e,t){return M(e,t,n=>e.moveByGroup(n,t))}const Nn=e=>ft(e,!p(e)),Vn=e=>ft(e,p(e)),wn=e=>{let t=!p(e);return M(e,t,n=>ne(e.state,n,t))},Gn=e=>{let t=p(e);return M(e,t,n=>ne(e.state,n,t))};function dt(e,t){return M(e,t,n=>e.moveVertically(n,t))}const mt=e=>dt(e,!1),pt=e=>dt(e,!0);function gt(e,t){return M(e,t,n=>e.moveVertically(n,t,it(e).height))}const Te=e=>gt(e,!1),Re=e=>gt(e,!0),Un=e=>M(e,!0,t=>b(e,t,!0)),zn=e=>M(e,!1,t=>b(e,t,!1)),Hn=e=>{let t=!p(e);return M(e,t,n=>b(e,n,t))},Jn=e=>{let t=p(e);return M(e,t,n=>b(e,n,t))},$n=e=>M(e,!1,t=>f.cursor(e.lineBlockAt(t.head).from)),_n=e=>M(e,!0,t=>f.cursor(e.lineBlockAt(t.head).to)),Oe=({state:e,dispatch:t})=>(t(L(e,{anchor:0})),!0),Ie=({state:e,dispatch:t})=>(t(L(e,{anchor:e.doc.length})),!0),We=({state:e,dispatch:t})=>(t(L(e,{anchor:e.selection.main.anchor,head:0})),!0),Fe=({state:e,dispatch:t})=>(t(L(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),Kn=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),Qn=({state:e,dispatch:t})=>{let n=re(e).map(({from:r,to:o})=>f.undirectionalRange(r,Math.min(o+1,e.doc.length)));return t(e.update({selection:f.create(n),userEvent:"select"})),!0},jn=({state:e,dispatch:t})=>{let n=q(e.selection,r=>{let o=Se(e),l=o.resolveStack(r.from,1);if(r.empty){let s=o.resolveStack(r.from,-1);s.node.from>=l.node.from&&s.node.to<=l.node.to&&(l=s)}for(let s=l;s;s=s.next){let{node:i}=s;if((i.from<r.from&&i.to>=r.to||i.to>r.to&&i.from<=r.from)&&s.next)return f.undirectionalRange(i.from,i.to)}return r});return n.eq(e.selection)?!1:(t(L(e,n)),!0)};function yt(e,t){let{state:n}=e,r=n.selection,o=n.selection.ranges.slice();for(let l of n.selection.ranges){let s=n.doc.lineAt(l.head);if(t?s.to<e.state.doc.length:s.from>0)for(let i=l;;){let c=e.moveVertically(i,t);if(c.head<s.from||c.head>s.to){o.some(a=>a.head==c.head)||o.push(c);break}else{if(c.head==i.head)break;i=c}}}return o.length==r.ranges.length?!1:(e.dispatch(L(n,f.create(o,o.length-1))),!0)}const Xn=e=>yt(e,!1),Yn=e=>yt(e,!0),Zn=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=f.create([n.main]):n.main.empty||(r=f.create([f.cursor(n.main.head)])),r?(t(L(e,r)),!0):!1};function G(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,o=r.changeByRange(l=>{let{from:s,to:i}=l;if(s==i){let c=t(l);c<s?(n="delete.backward",c=z(e,c,!1)):c>s&&(n="delete.forward",c=z(e,c,!0)),s=Math.min(s,c),i=Math.max(i,c)}else s=z(e,s,!1),i=z(e,i,!0);return s==i?{range:l}:{changes:{from:s,to:i},range:f.cursor(s,s<l.head?-1:1)}});return o.changes.empty?!1:(e.dispatch(r.update(o,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?m.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function z(e,t,n){if(e instanceof m)for(let r of e.state.facet(m.atomicRanges).map(o=>o(e)))r.between(t,t,(o,l)=>{o<t&&l>t&&(t=n?l:o)});return t}const xt=(e,t,n)=>G(e,r=>{let o=r.from,{state:l}=e,s=l.doc.lineAt(o),i,c;if(n&&!t&&o>s.from&&o<s.from+200&&!/[^ \t]/.test(i=s.text.slice(0,o-s.from))){if(i[i.length-1]==" ")return o-1;let a=xe(i,l.tabSize),h=a%he(l)||he(l);for(let u=0;u<h&&i[i.length-1-u]==" ";u++)o--;c=o}else c=E(s.text,o-s.from,t,t)+s.from,c==o&&s.number!=(t?l.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(s.text.slice(c-s.from,o-s.from))&&(c=E(s.text,c-s.from,!1,!1)+s.from);return c}),me=e=>xt(e,!1,!0),St=e=>xt(e,!0,!1),kt=(e,t)=>G(e,n=>{let r=n.head,{state:o}=e,l=o.doc.lineAt(r),s=o.charCategorizer(r);for(let i=null;;){if(r==(t?l.to:l.from)){r==n.head&&l.number!=(t?o.doc.lines:1)&&(r+=t?1:-1);break}let c=E(l.text,r-l.from,t)+l.from,a=l.text.slice(Math.min(r,c)-l.from,Math.max(r,c)-l.from),h=s(a);if(i!=null&&h!=i)break;(a!=" "||r!=n.head)&&(i=h),r=c}return r}),At=e=>kt(e,!1),er=e=>kt(e,!0),tr=e=>G(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),nr=e=>G(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),rr=e=>G(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),or=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:He.of(["",""])},range:f.cursor(r.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},lr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{if(!r.empty||r.from==0||r.from==e.doc.length)return{range:r};let o=r.from,l=e.doc.lineAt(o),s=o==l.from?o-1:E(l.text,o-l.from,!1)+l.from,i=o==l.to?o+1:E(l.text,o-l.from,!0)+l.from;return{changes:{from:s,to:i,insert:e.doc.slice(o,i).append(e.doc.slice(s,o))},range:f.cursor(i)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function re(e){let t=[],n=-1;for(let r of e.selection.ranges){let o=e.doc.lineAt(r.from),l=e.doc.lineAt(r.to);if(!r.empty&&r.to==l.from&&(l=e.doc.lineAt(r.to-1)),n>=o.number){let s=t[t.length-1];s.to=l.to,s.ranges.push(r)}else t.push({from:o.from,to:l.to,ranges:[r]});n=l.number+1}return t}function Mt(e,t,n){if(e.readOnly)return!1;let r=[],o=[];for(let l of re(e)){if(n?l.to==e.doc.length:l.from==0)continue;let s=e.doc.lineAt(n?l.to+1:l.from-1),i=s.length+1;if(n){r.push({from:l.to,to:s.to},{from:l.from,insert:s.text+e.lineBreak});for(let c of l.ranges)o.push(f.range(Math.min(e.doc.length,c.anchor+i),Math.min(e.doc.length,c.head+i)))}else{r.push({from:s.from,to:l.from},{from:l.to,insert:e.lineBreak+s.text});for(let c of l.ranges)o.push(f.range(c.anchor-i,c.head-i))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:f.create(o,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}const sr=({state:e,dispatch:t})=>Mt(e,t,!1),ir=({state:e,dispatch:t})=>Mt(e,t,!0);function Ct(e,t,n){if(e.readOnly)return!1;let r=[];for(let l of re(e))n?r.push({from:l.from,insert:e.doc.slice(l.from,l.to)+e.lineBreak}):r.push({from:l.to,insert:e.lineBreak+e.doc.slice(l.from,l.to)});let o=e.changes(r);return t(e.update({changes:o,selection:e.selection.map(o,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const cr=({state:e,dispatch:t})=>Ct(e,t,!1),ar=({state:e,dispatch:t})=>Ct(e,t,!0),hr=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(re(t).map(({from:o,to:l})=>(o>0?o--:l<t.doc.length&&l++,{from:o,to:l}))),r=q(t.selection,o=>{let l;if(e.lineWrapping){let s=e.lineBlockAt(o.head),i=e.coordsAtPos(o.head,o.assoc||1);i&&(l=s.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(o,!0,l)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function ur(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=Se(e).resolveInner(t),r=n.childBefore(t),o=n.childAfter(t),l;return r&&o&&r.to<=t&&o.from>=t&&(l=r.type.prop(ae.closedBy))&&l.indexOf(o.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(o.from).from&&!/\S/.test(e.sliceDoc(r.to,o.from))?{from:r.to,to:o.from}:null}const Pe=Lt(!1),fr=Lt(!0);function Lt(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(o=>{let{from:l,to:s}=o,i=t.doc.lineAt(l),c=!e&&l==s&&ur(t,l);e&&(l=s=(s<=i.to?i:t.doc.lineAt(s)).to);let a=new Ge(t,{simulateBreak:l,simulateDoubleBreak:!!c}),h=ze(a,l);for(h==null&&(h=xe(/^\s*/.exec(t.doc.lineAt(l).text)[0],t.tabSize));s<i.to&&/\s/.test(i.text[s-i.from]);)s++;c?{from:l,to:s}=c:l>i.from&&l<i.from+100&&!/\S/.test(i.text.slice(0,l))&&(l=i.from);let u=["",$(t,h)];return c&&u.push($(t,a.lineIndent(i.from,-1))),{changes:{from:l,to:s,insert:He.of(u)},range:f.cursor(l+1+u[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Me(e,t){let n=-1;return e.changeByRange(r=>{let o=[];for(let s=r.from;s<=r.to;){let i=e.doc.lineAt(s);i.number>n&&(r.empty||r.to>i.from)&&(t(i,o,r),n=i.number),s=i.to+1}let l=e.changes(o);return{changes:o,range:f.range(l.mapPos(r.anchor,1),l.mapPos(r.head,1))}})}const dr=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Ge(e,{overrideIndentation:l=>{let s=n[l];return s??-1}}),o=Me(e,(l,s,i)=>{let c=ze(r,l.from);if(c==null)return;/\S/.test(l.text)||(c=0);let a=/^\s*/.exec(l.text)[0],h=$(e,c);(a!=h||i.from<l.from+a.length)&&(n[l.from]=c,s.push({from:l.from,to:l.from+a.length,insert:h}))});return o.changes.empty||t(e.update(o,{userEvent:"indent"})),!0},vt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Me(e,(n,r)=>{r.push({from:n.from,insert:e.facet(Vt)})}),{userEvent:"input.indent"})),!0),Dt=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(Me(e,(n,r)=>{let o=/^\s*/.exec(n.text)[0];if(!o)return;let l=xe(o,e.tabSize),s=0,i=$(e,Math.max(0,l-he(e)));for(;s<o.length&&s<i.length&&o.charCodeAt(s)==i.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+o.length,insert:i.slice(s)})}),{userEvent:"delete.dedent"})),!0),mr=e=>(e.setTabFocusMode(),!0),pr=[{key:"Ctrl-b",run:tt,shift:ht,preventDefault:!0},{key:"Ctrl-f",run:nt,shift:ut},{key:"Ctrl-p",run:lt,shift:mt},{key:"Ctrl-n",run:st,shift:pt},{key:"Ctrl-a",run:Wn,shift:$n},{key:"Ctrl-e",run:Fn,shift:_n},{key:"Ctrl-d",run:St},{key:"Ctrl-h",run:me},{key:"Ctrl-k",run:tr},{key:"Ctrl-Alt-h",run:At},{key:"Ctrl-o",run:or},{key:"Ctrl-t",run:lr},{key:"Ctrl-v",run:de}],gr=[{key:"ArrowLeft",run:tt,shift:ht,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:vn,shift:Nn,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:On,shift:Hn,preventDefault:!0},{key:"ArrowRight",run:nt,shift:ut,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Dn,shift:Vn,preventDefault:!0},{mac:"Cmd-ArrowRight",run:In,shift:Jn,preventDefault:!0},{key:"ArrowUp",run:lt,shift:mt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Oe,shift:We},{mac:"Ctrl-ArrowUp",run:Ee,shift:Te},{key:"ArrowDown",run:st,shift:pt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ie,shift:Fe},{mac:"Ctrl-ArrowDown",run:de,shift:Re},{key:"PageUp",run:Ee,shift:Te},{key:"PageDown",run:de,shift:Re},{key:"Home",run:Rn,shift:zn,preventDefault:!0},{key:"Mod-Home",run:Oe,shift:We},{key:"End",run:Tn,shift:Un,preventDefault:!0},{key:"Mod-End",run:Ie,shift:Fe},{key:"Enter",run:Pe,shift:Pe},{key:"Mod-a",run:Kn},{key:"Backspace",run:me,shift:me,preventDefault:!0},{key:"Delete",run:St,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:At,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:er,preventDefault:!0},{mac:"Mod-Backspace",run:nr,preventDefault:!0},{mac:"Mod-Delete",run:rr,preventDefault:!0}].concat(pr.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),yr=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:bn,shift:wn},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:En,shift:Gn},{key:"Alt-ArrowUp",run:sr},{key:"Shift-Alt-ArrowUp",run:cr},{key:"Alt-ArrowDown",run:ir},{key:"Shift-Alt-ArrowDown",run:ar},{key:"Mod-Alt-ArrowUp",run:Xn},{key:"Mod-Alt-ArrowDown",run:Yn},{key:"Escape",run:Zn},{key:"Mod-Enter",run:fr},{key:"Alt-l",mac:"Ctrl-l",run:Qn},{key:"Mod-i",run:jn,preventDefault:!0},{key:"Mod-[",run:Dt},{key:"Mod-]",run:vt},{key:"Mod-Alt-\\",run:dr},{key:"Shift-Mod-k",run:hr},{key:"Shift-Mod-\\",run:qn},{key:"Mod-/",run:ln},{key:"Alt-A",mac:"Ctrl-A",run:cn},{key:"Ctrl-m",mac:"Shift-Alt-m",run:mr}].concat(gr),xr={key:"Tab",run:vt,shift:Dt},qe=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e;class P{constructor(t,n,r=0,o=t.length,l,s){this.test=s,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(r,o),this.bufferStart=r,this.normalize=l?i=>l(qe(i)):qe,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ht(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let n=_t(t),r=this.bufferStart+this.bufferPos;this.bufferPos+=Jt(t);let o=this.normalize(n);if(o.length)for(let l=0,s=r,i=!0;;l++){let c=o.charCodeAt(l),a=this.match(c,s,i,this.bufferPos+this.bufferStart,l==o.length-1);if(a)return this.value=a,this;if(l==o.length-1)break;i&&l<n.length&&n.charCodeAt(l)==c?s++:i=!1}}}match(t,n,r,o,l){let s=null;for(let i=0;i<this.matches.length;){let c=this.matches[i],a=!1;this.query.charCodeAt(c.index)==t&&(c.index==this.query.length-1?s={from:c.from,to:o,precise:l&&c.precise}:(c.index++,a=!0)),a?i++:this.matches.splice(i,1)}return this.query.charCodeAt(0)==t&&(this.query.length==1?s={from:n,to:o,precise:r&&l}:this.matches.push({from:n,index:1,precise:r})),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(P.prototype[Symbol.iterator]=function(){return this});const Bt={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Ce="gm"+(/x/.unicode==null?"":"u");class bt{constructor(t,n,r,o=0,l=t.length){if(this.text=t,this.to=l,this.curLine="",this.done=!1,this.value=Bt,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new Et(t,n,r,o,l);this.re=new RegExp(n,Ce+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=t.iter();let s=t.lineAt(o);this.curLineStart=s.from,this.matchPos=K(t,o),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,o=r+n[0].length;if(this.matchPos=K(this.text,o+(r==o?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<o||r>this.value.to)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,precise:!0,match:n},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const ie=new WeakMap;class F{constructor(t,n){this.from=t,this.text=n}get to(){return this.from+this.text.length}static get(t,n,r){let o=ie.get(t);if(!o||o.from>=r||o.to<=n){let i=new F(n,t.sliceString(n,r));return ie.set(t,i),i}if(o.from==n&&o.to==r)return o;let{text:l,from:s}=o;return s>n&&(l=t.sliceString(n,s)+l,s=n),o.to<r&&(l+=t.sliceString(o.to,r)),ie.set(t,new F(s,l)),new F(n,l.slice(n-s,r-s))}}class Et{constructor(t,n,r,o,l){this.text=t,this.to=l,this.done=!1,this.value=Bt,this.matchPos=K(t,o),this.re=new RegExp(n,Ce+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=F.get(t,o,this.chunkEnd(o+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==t&&(this.re.lastIndex=t+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,o=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,o,n)))return this.value={from:r,to:o,precise:!0,match:n},this.matchPos=K(this.text,o+(r==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=F.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(bt.prototype[Symbol.iterator]=Et.prototype[Symbol.iterator]=function(){return this});function Sr(e){try{return new RegExp(e,Ce),!0}catch{return!1}}function K(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}const kr=e=>{let t=wt(e,"cm-goto-line");if(t){let s=t.dom.querySelector("input[type=text]");return s&&s.select(),!0}let{state:n}=e,r=String(n.doc.lineAt(e.state.selection.main.head).number),{close:o,result:l}=Gt(e,{class:"cm-goto-line",label:n.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:n.phrase("go")});return l.then(s=>{let i=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!i){e.dispatch({effects:o});return}let c=n.doc.lineAt(n.selection.main.head),[,a,h,u,d]=i,R=u?+u.slice(1):0,C=h?+h:c.number;if(h&&d){let oe=C/100;a&&(oe=oe*(a=="-"?-1:1)+c.number/n.doc.lines),C=Math.round(n.doc.lines*oe)}else h&&a&&(C=C*(a=="-"?-1:1)+c.number);let Be=n.doc.line(Math.max(1,Math.min(n.doc.lines,C))),be=f.cursor(Be.from+Math.max(0,Math.min(R,Be.length)));e.dispatch({effects:[o,m.scrollIntoView(be.from,{y:"center"})],selection:be})}),!0},Ar={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Mr=Z.define({combine(e){return ye(e,Ar,{highlightWordAroundCursor:(t,n)=>t||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function Cr(e){return[br,Br]}const Lr=x.mark({class:"cm-selectionMatch"}),vr=x.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ne(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=k.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=k.Word)}function Dr(e,t,n,r){return e(t.sliceDoc(n,n+1))==k.Word&&e(t.sliceDoc(r-1,r))==k.Word}const Br=$e.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Mr),{state:n}=e,r=n.selection;if(r.ranges.length>1)return x.none;let o=r.main,l,s=null;if(o.empty){if(!t.highlightWordAroundCursor)return x.none;let c=n.wordAt(o.head);if(!c)return x.none;s=n.charCategorizer(o.head),l=n.sliceDoc(c.from,c.to)}else{let c=o.to-o.from;if(c<t.minSelectionLength||c>200)return x.none;if(t.wholeWords){if(l=n.sliceDoc(o.from,o.to),s=n.charCategorizer(o.head),!(Ne(s,n,o.from,o.to)&&Dr(s,n,o.from,o.to)))return x.none}else if(l=n.sliceDoc(o.from,o.to),!l)return x.none}let i=[];for(let c of e.visibleRanges){let a=new P(n.doc,l,c.from,c.to);for(;!a.next().done;){let{from:h,to:u}=a.value;if((!s||Ne(s,n,h,u))&&(o.empty&&h<=o.from&&u>=o.to?i.push(vr.range(h,u)):(h>=o.to||u<=o.from)&&i.push(Lr.range(h,u)),i.length>t.maxMatches))return x.none}}return x.set(i)}},{decorations:e=>e.decorations}),br=m.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Er=({state:e,dispatch:t})=>{let{selection:n}=e,r=f.create(n.ranges.map(o=>e.wordAt(o.head)||f.cursor(o.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Tr(e,t){let{main:n,ranges:r}=e.selection,o=e.wordAt(n.head),l=o&&o.from==n.from&&o.to==n.to;for(let s=!1,i=new P(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(s)return null;i=new P(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(c=>c.from==i.value.from))continue;if(l){let c=e.wordAt(i.value.from);if(!c||c.from!=i.value.from||c.to!=i.value.to)continue}return i.value}}const Rr=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(l=>l.from===l.to))return Er({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(l=>e.sliceDoc(l.from,l.to)!=r))return!1;let o=Tr(e,r);return o?(t(e.update({selection:e.selection.addRange(f.range(o.from,o.to),!1),effects:m.scrollIntoView(o.to)})),!0):!1},T=Z.define({combine(e){return ye(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new $r(t),scrollToMatch:t=>m.scrollIntoView(t)})}});function Or(e){return e?[T.of(e),ge]:ge}class Tt{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Sr(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord,this.test=t.test}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
2
2
|
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord&&this.test==t.test}create(){return this.regexp?new Nr(this):new Fr(this)}getCursor(t,n=0,r){let o=t.doc?t:_e.create({doc:t});return r==null&&(r=o.doc.length),this.regexp?I(this,o,n,r):O(this,o,n,r)}}class Rt{constructor(t){this.spec=t}}function Ir(e,t,n){return(r,o,l,s)=>{if(n&&!n(r,o,l,s))return!1;let i=r>=s&&o<=s+l.length?l.slice(r-s,o-s):t.doc.sliceString(r,o);return e(i,t,r,o)}}function O(e,t,n,r){let o;return e.wholeWord&&(o=Wr(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(o=Ir(e.test,t,o)),new P(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:l=>l.toLowerCase(),o)}function Wr(e,t){return(n,r,o,l)=>((l>n||l+o.length<r)&&(l=Math.max(0,n-2),o=e.sliceString(l,Math.min(e.length,r+2))),(t(Q(o,n-l))!=k.Word||t(j(o,n-l))!=k.Word)&&(t(j(o,r-l))!=k.Word||t(Q(o,r-l))!=k.Word))}class Fr extends Rt{constructor(t){super(t)}nextMatch(t,n,r){let o=O(this.spec,t,r,t.doc.length).nextOverlapping();if(o.done){let l=Math.min(t.doc.length,n+this.spec.unquoted.length);o=O(this.spec,t,0,l).nextOverlapping()}return o.done||o.value.from==n&&o.value.to==r?null:o.value}prevMatchInRange(t,n,r){for(let o=r;;){let l=Math.max(n,o-1e4-this.spec.unquoted.length),s=O(this.spec,t,l,o),i=null;for(;!s.nextOverlapping().done;)i=s.value;if(i)return i;if(l==n)return null;o-=1e4}}prevMatch(t,n,r){let o=this.prevMatchInRange(t,0,n);return o||(o=this.prevMatchInRange(t,Math.max(0,r-this.spec.unquoted.length),t.doc.length)),o&&(o.from!=n||o.to!=r)?o:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,n){let r=O(this.spec,t,0,t.doc.length),o=[];for(;!r.next().done;){if(o.length>=n)return null;o.push(r.value)}return o}highlight(t,n,r,o){let l=O(this.spec,t,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,t.doc.length));for(;!l.next().done;)o(l.value.from,l.value.to)}}function Pr(e,t,n){return(r,o,l)=>(!n||n(r,o,l))&&e(l[0],t,r,o)}function I(e,t,n,r){let o;return e.wholeWord&&(o=qr(t.charCategorizer(t.selection.main.head))),e.test&&(o=Pr(e.test,t,o)),new bt(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:o},n,r)}function Q(e,t){return e.slice(E(e,t,!1),t)}function j(e,t){return e.slice(t,E(e,t))}function qr(e){return(t,n,r)=>!r[0].length||(e(Q(r.input,r.index))!=k.Word||e(j(r.input,r.index))!=k.Word)&&(e(j(r.input,r.index+r[0].length))!=k.Word||e(Q(r.input,r.index+r[0].length))!=k.Word)}class Nr extends Rt{nextMatch(t,n,r){let o=I(this.spec,t,r,t.doc.length).next();return o.done&&(o=I(this.spec,t,0,n).next()),o.done?null:o.value}prevMatchInRange(t,n,r){for(let o=1;;o++){let l=Math.max(n,r-o*1e4),s=I(this.spec,t,l,r),i=null;for(;!s.next().done;)i=s.value;if(i&&(l==n||i.from>l+10))return i;if(l==n)return null}}prevMatch(t,n,r){return this.prevMatchInRange(t,0,n)||this.prevMatchInRange(t,r,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return t.match[0];if(r=="$")return"$";for(let o=r.length;o>0;o--){let l=+r.slice(0,o);if(l>0&&l<t.match.length)return t.match[l]+r.slice(o)}return n})}matchAll(t,n){let r=I(this.spec,t,0,t.doc.length),o=[];for(;!r.next().done;){if(o.length>=n)return null;o.push(r.value)}return o}highlight(t,n,r,o){let l=I(this.spec,t,Math.max(0,n-250),Math.min(r+250,t.doc.length));for(;!l.next().done;)o(l.value.from,l.value.to)}}const V=w.define(),Le=w.define(),B=we.define({create(e){return new ce(pe(e).create(),null)},update(e,t){for(let n of t.effects)n.is(V)?e=new ce(n.value.create(),e.panel):n.is(Le)&&(e=new ce(e.query,n.value?ve:null));return e},provide:e=>zt.from(e,t=>t.panel)});class ce{constructor(t,n){this.query=t,this.panel=n}}const Vr=x.mark({class:"cm-searchMatch"}),wr=x.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Gr=$e.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(B))}update(e){let t=e.state.field(B);(t!=e.startState.field(B)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return x.none;let{view:n}=this,r=new $t;for(let o=0,l=n.visibleRanges,s=l.length;o<s;o++){let{from:i,to:c}=l[o];for(;o<s-1&&c>l[o+1].from-500;)c=l[++o].to;e.highlight(n.state,i,c,(a,h)=>{let u=n.state.selection.ranges.some(d=>d.from==a&&d.to==h);r.add(a,h,u?wr:Vr)})}return r.finish()}},{decorations:e=>e.decorations});function U(e){return t=>{let n=t.state.field(B,!1);return n&&n.query.spec.valid?e(t,n):Wt(t)}}const X=U((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let o=f.single(r.from,r.to),l=e.state.facet(T);return e.dispatch({selection:o,effects:[De(e,r),l.scrollToMatch(o.main,e)],userEvent:"select.search"}),It(e),!0}),Y=U((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,o=t.prevMatch(n,r,r);if(!o)return!1;let l=f.single(o.from,o.to),s=e.state.facet(T);return e.dispatch({selection:l,effects:[De(e,o),s.scrollToMatch(l.main,e)],userEvent:"select.search"}),It(e),!0}),Ur=U((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:f.create(n.map(r=>f.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),zr=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:o}=n.main,l=[],s=0;for(let i=new P(e.doc,e.sliceDoc(r,o));!i.next().done;){if(l.length>1e3)return!1;i.value.from==r&&(s=l.length),l.push(f.range(i.value.from,i.value.to))}return t(e.update({selection:f.create(l,s),userEvent:"select.search.matches"})),!0},Ve=U((e,{query:t})=>{let{state:n}=e,{from:r,to:o}=n.selection.main;if(n.readOnly)return!1;let l=t.nextMatch(n,r,r);if(!l)return!1;let s=l,i=[],c,a,h=[];s.precise?s.from==r&&s.to==o&&(a=n.toText(t.getReplacement(s)),i.push({from:s.from,to:s.to,insert:a}),s=t.nextMatch(n,s.from,s.to),h.push(m.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):s=t.nextMatch(n,s.from,s.to);let u=e.state.changes(i);return s&&(c=f.single(s.from,s.to).map(u),h.push(De(e,s)),h.push(n.facet(T).scrollToMatch(c.main,e))),e.dispatch({changes:u,selection:c,effects:h,userEvent:"input.replace"}),!0}),Hr=U((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let o of t.matchAll(e.state,1e9)){let{from:l,to:s,precise:i}=o;i&&n.push({from:l,to:s,insert:t.getReplacement(o)})}if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:m.announce.of(r),userEvent:"input.replace.all"}),!0});function ve(e){return e.state.facet(T).createPanel(e)}function pe(e,t){var n,r,o,l,s;let i=e.selection.main,c=i.empty||i.to>i.from+100?"":e.sliceDoc(i.from,i.to);if(t&&!c)return t;let a=e.facet(T);return new Tt({search:((n=t?.literal)!==null&&n!==void 0?n:a.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(r=t?.caseSensitive)!==null&&r!==void 0?r:a.caseSensitive,literal:(o=t?.literal)!==null&&o!==void 0?o:a.literal,regexp:(l=t?.regexp)!==null&&l!==void 0?l:a.regexp,wholeWord:(s=t?.wholeWord)!==null&&s!==void 0?s:a.wholeWord})}function Ot(e){let t=Je(e,ve);return t&&t.dom.querySelector("[main-field]")}function It(e){let t=Ot(e);t&&t==e.root.activeElement&&t.select()}const Wt=e=>{let t=e.state.field(B,!1);if(t&&t.panel){let n=Ot(e);if(n&&n!=e.root.activeElement){let r=pe(e.state,t.query.spec);r.valid&&e.dispatch({effects:V.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[Le.of(!0),t?V.of(pe(e.state,t.query.spec)):w.appendConfig.of(ge)]});return!0},Ft=e=>{let t=e.state.field(B,!1);if(!t||!t.panel)return!1;let n=Je(e,ve);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Le.of(!1)}),!0},Jr=[{key:"Mod-f",run:Wt,scope:"editor search-panel"},{key:"F3",run:X,shift:Y,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:X,shift:Y,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Ft,scope:"editor search-panel"},{key:"Mod-Shift-l",run:zr},{key:"Mod-Alt-g",run:kr},{key:"Mod-d",run:Rr,preventDefault:!0}];class $r{constructor(t){this.view=t;let n=this.query=t.state.field(B).query.spec;this.commit=this.commit.bind(this),this.searchField=S("input",{value:n.search,placeholder:y(t,"Find"),"aria-label":y(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=S("input",{value:n.replace,placeholder:y(t,"Replace"),"aria-label":y(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=S("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=S("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=S("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(o,l,s){return S("button",{class:"cm-button",name:o,onclick:l,type:"button"},s)}this.dom=S("div",{onkeydown:o=>this.keydown(o),class:"cm-search"},[this.searchField,r("next",()=>X(t),[y(t,"next")]),r("prev",()=>Y(t),[y(t,"previous")]),r("select",()=>Ur(t),[y(t,"all")]),S("label",null,[this.caseField,y(t,"match case")]),S("label",null,[this.reField,y(t,"regexp")]),S("label",null,[this.wordField,y(t,"by word")]),...t.state.readOnly?[]:[S("br"),this.replaceField,r("replace",()=>Ve(t),[y(t,"replace")]),r("replaceAll",()=>Hr(t),[y(t,"replace all")])],S("button",{name:"close",onclick:()=>Ft(t),"aria-label":y(t,"close"),type:"button"},["×"])])}commit(){let t=new Tt({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:V.of(t)}))}keydown(t){Kt(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Y:X)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Ve(this.view))}update(t){for(let n of t.transactions)for(let r of n.effects)r.is(V)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(T).top}}function y(e,t){return e.state.phrase(t)}const H=30,J=/[\s\.,:;?!]/;function De(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),o=e.state.doc.lineAt(n).to,l=Math.max(r.from,t-H),s=Math.min(o,n+H),i=e.state.sliceDoc(l,s);if(l!=r.from){for(let c=0;c<H;c++)if(!J.test(i[c+1])&&J.test(i[c])){i=i.slice(c);break}}if(s!=o){for(let c=i.length-1;c>i.length-H;c--)if(!J.test(i[c-1])&&J.test(i[c])){i=i.slice(0,c);break}}return m.announce.of(`${e.state.phrase("current match")}. ${i} ${e.state.phrase("on line")} ${r.number}.`)}const _r=m.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),ge=[B,Ut.low(Gr),_r],Kr=m.theme({"&":{height:"100%",color:"var(--butter)",backgroundColor:"transparent",fontSize:"0.95rem"},".cm-scroller":{fontFamily:"'Share Tech Mono', monospace",lineHeight:"1.45"},".cm-content":{caretColor:"var(--harvestgold)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--harvestgold)",borderLeftWidth:"2px"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:"color-mix(in srgb, var(--orange) 35%, transparent)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--pumpkin-pie)",border:"none"},".cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--orange) 8%, transparent)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--harvestgold)"},".cm-matchingBracket":{outline:"1px solid var(--harvestgold)",backgroundColor:"transparent"},".cm-searchMatch":{backgroundColor:"color-mix(in srgb, var(--daybreak) 30%, transparent)"},".cm-panels":{backgroundColor:"#000",color:"var(--butter)"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid var(--orange)"}},{dark:!0});async function Xr(e,t,n,r){const o=await Qt(n),l=new m({parent:e,state:_e.create({doc:t,extensions:[jt(),Xt(),pn(),Yt(),Zt(),en(),tn(),Cr(),Or({top:!1}),nn(on),o,Kr,m.lineWrapping,rn.of([...yr,...Ln,...Jr,xr]),m.updateListener.of(s=>{s.docChanged&&r(s.state.doc.toString())})]})});return{text_get:()=>l.state.doc.toString(),text_set:s=>{l.dispatch({changes:{from:0,to:l.state.doc.length,insert:s}})},focus:()=>l.focus(),hasFocus:()=>l.contentDOM.contains(document.activeElement),blur:()=>l.contentDOM.blur(),destroy:()=>l.destroy()}}export{Xr as editField_create};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a2 as Pr,a3 as le,N as z,a4 as wr,a5 as bt,U as ie,a6 as A,a7 as kt,W as c,Y as Qt,Z as je,_ as yr,$ as oe,a0 as xr,X as ee,s as j,a8 as Xr,a9 as vr,aa as jr,E as Pt,a as E,P as Cr,O as Tr,ab as Vr,e as N,ac as qr,k as Ar,ad as Er,v as Lr,ae as zr,af as Ie,ag as Rr}from"./syntax-D498Iat0.js";import{C as _r}from"./index-BKTol-_M.js";import{L as wt,E as C,C as Yr,a as Br}from"./index-DDVamRo8.js";import{typescriptLanguage as Ir,jsxLanguage as Zr,tsxLanguage as Mr,javascriptLanguage as Ce,javascript as Nr}from"./index-CwoRnDne.js";import"./index-C_gVizDw.js";class te{static create(t,r,a,n,s){let l=n+(n<<8)+t+(r<<4)|0;return new te(t,r,a,l,s,[],[])}constructor(t,r,a,n,s,l,i){this.type=t,this.value=r,this.from=a,this.hash=n,this.end=s,this.children=l,this.positions=i,this.hashProp=[[z.contextHash,n]]}addChild(t,r){t.prop(z.contextHash)!=this.hash&&(t=new A(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(r)}toTree(t,r=this.end){let a=this.children.length-1;return a>=0&&(r=Math.max(r,this.positions[a]+this.children[a].length+this.from)),new A(t.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(n,s,l)=>new A(le.none,n,s,l,this.hashProp)})}}var h;(function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"})(h||(h={}));class Wr{constructor(t,r){this.start=t,this.content=r,this.marks=[],this.parsers=[]}}class Gr{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return Z(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,r=0,a=0){for(let n=r;n<t;n++)a+=this.text.charCodeAt(n)==9?4-a%4:1;return a}findColumn(t){let r=0;for(let a=0;r<this.text.length&&a<t;r++)a+=this.text.charCodeAt(r)==9?4-a%4:1;return r}scrub(){if(!this.baseIndent)return this.text;let t="";for(let r=0;r<this.basePos;r++)t+=" ";return t+this.text.slice(this.basePos)}}function Ze(e,t,r){if(r.pos==r.text.length||e!=t.block&&r.indent>=t.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let a=(e.type==h.OrderedList?qe:Ve)(r,t,!1);return a>0&&(e.type!=h.BulletList||Te(r,t,!1)<0)&&r.text.charCodeAt(r.pos+a-1)==e.value}const yt={[h.Blockquote](e,t,r){return r.next!=62?!1:(r.markers.push($(h.QuoteMark,t.lineStart+r.pos,t.lineStart+r.pos+1)),r.moveBase(r.pos+(x(r.text.charCodeAt(r.pos+1))?2:1)),e.end=t.lineStart+r.text.length,!0)},[h.ListItem](e,t,r){return r.indent<r.baseIndent+e.value&&r.next>-1?!1:(r.moveBaseColumn(r.baseIndent+e.value),!0)},[h.OrderedList]:Ze,[h.BulletList]:Ze,[h.Document](){return!0}};function x(e){return e==32||e==9||e==10||e==13}function Z(e,t=0){for(;t<e.length&&x(e.charCodeAt(t));)t++;return t}function Me(e,t,r){for(;t>r&&x(e.charCodeAt(t-1));)t--;return t}function xt(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let r=t;r<e.text.length;r++)if(e.text.charCodeAt(r)==96)return-1}return t}function Xt(e){return e.next!=62?-1:e.text.charCodeAt(e.pos+1)==32?2:1}function Te(e,t,r){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let a=1;for(let n=e.pos+1;n<e.text.length;n++){let s=e.text.charCodeAt(n);if(s==e.next)a++;else if(!x(s))return-1}return r&&e.next==45&&Ct(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(At.SetextHeading)>-1||a<3?-1:1}function vt(e,t){for(let r=e.stack.length-1;r>=0;r--)if(e.stack[r].type==t)return!0;return!1}function Ve(e,t,r){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||x(e.text.charCodeAt(e.pos+1)))&&(!r||vt(t,h.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function qe(e,t,r){let a=e.pos,n=e.next;for(;n>=48&&n<=57;){a++;if(a==e.text.length)return-1;n=e.text.charCodeAt(a)}return a==e.pos||a>e.pos+9||n!=46&&n!=41||a<e.text.length-1&&!x(e.text.charCodeAt(a+1))||r&&!vt(t,h.OrderedList)&&(e.skipSpace(a+1)==e.text.length||a>e.pos+1||e.next!=49)?-1:a+1-e.pos}function jt(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let r=t-e.pos;return r>6?-1:r}function Ct(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let r=t;for(;t<e.text.length&&x(e.text.charCodeAt(t));)t++;return t==e.text.length?r:-1}const Qe=/^[ \t]*$/,Tt=/-->/,Vt=/\?>/,Pe=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Tt],[/^\s*<\?/,Vt],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Qe],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Qe]];function qt(e,t,r){if(e.next!=60)return-1;let a=e.text.slice(e.pos);for(let n=0,s=Pe.length-(r?1:0);n<s;n++)if(Pe[n][0].test(a))return n;return-1}function Ne(e,t){let r=e.countIndent(t,e.pos,e.indent),a=e.skipSpace(t),n=e.countIndent(a,t,r);return n>=r+5||a==e.text.length?r+1:n}function v(e,t,r){let a=e.length-1;a>=0&&e[a].to==t&&e[a].type==h.CodeText?e[a].to=r:e.push($(h.CodeText,t,r))}const F={LinkReference:void 0,IndentedCode(e,t){let r=t.baseIndent+4;if(t.indent<r)return!1;let a=t.findColumn(r),n=e.lineStart+a,s=e.lineStart+t.text.length,l=[],i=[];for(v(l,n,s);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){v(i,e.lineStart-1,e.lineStart);for(let o of t.markers)i.push(o)}else{if(t.indent<r)break;{if(i.length){for(let O of i)O.type==h.CodeText?v(l,O.from,O.to):l.push(O);i=[]}v(l,e.lineStart-1,e.lineStart);for(let O of t.markers)l.push(O);s=e.lineStart+t.text.length;let o=e.lineStart+t.findColumn(t.baseIndent+4);o<s&&v(l,o,s)}}return i.length&&(i=i.filter(o=>o.type!=h.CodeText),i.length&&(t.markers=i.concat(t.markers))),e.addNode(e.buffer.writeElements(l,-n).finish(h.CodeBlock,s-n),n),!0},FencedCode(e,t){let r=xt(t);if(r<0)return!1;let a=e.lineStart+t.pos,n=t.next,s=r-t.pos,l=t.skipSpace(r),i=Me(t.text,t.text.length,l),o=[$(h.CodeMark,a,a+s)];l<i&&o.push($(h.CodeInfo,e.lineStart+l,e.lineStart+i));for(let O=!0,u=!0,d=!1;e.nextLine()&&t.depth>=e.stack.length;O=!1){let f=t.pos;if(t.indent-t.baseIndent<4)for(;f<t.text.length&&t.text.charCodeAt(f)==n;)f++;if(f-t.pos>=s&&t.skipSpace(f)==t.text.length){for(let m of t.markers)o.push(m);u&&d&&v(o,e.lineStart-1,e.lineStart),o.push($(h.CodeMark,e.lineStart+t.pos,e.lineStart+f)),e.nextLine();break}else{d=!0,O||(v(o,e.lineStart-1,e.lineStart),u=!1);for(let g of t.markers)o.push(g);let m=e.lineStart+t.basePos,S=e.lineStart+t.text.length;m<S&&(v(o,m,S),u=!1)}}return e.addNode(e.buffer.writeElements(o,-a).finish(h.FencedCode,e.prevLineEnd()-a),a),!0},Blockquote(e,t){let r=Xt(t);return r<0?!1:(e.startContext(h.Blockquote,t.pos),e.addNode(h.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+r),null)},HorizontalRule(e,t){if(Te(t,e,!1)<0)return!1;let r=e.lineStart+t.pos;return e.nextLine(),e.addNode(h.HorizontalRule,r),!0},BulletList(e,t){let r=Ve(t,e,!1);if(r<0)return!1;e.block.type!=h.BulletList&&e.startContext(h.BulletList,t.basePos,t.next);let a=Ne(t,t.pos+1);return e.startContext(h.ListItem,t.basePos,a-t.baseIndent),e.addNode(h.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+r),t.moveBaseColumn(a),null},OrderedList(e,t){let r=qe(t,e,!1);if(r<0)return!1;e.block.type!=h.OrderedList&&e.startContext(h.OrderedList,t.basePos,t.text.charCodeAt(t.pos+r-1));let a=Ne(t,t.pos+r);return e.startContext(h.ListItem,t.basePos,a-t.baseIndent),e.addNode(h.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+r),t.moveBaseColumn(a),null},ATXHeading(e,t){let r=jt(t);if(r<0)return!1;let a=t.pos,n=e.lineStart+a,s=Me(t.text,t.text.length,a),l=s;for(;l>a&&t.text.charCodeAt(l-1)==t.next;)l--;(l==s||l==a||!x(t.text.charCodeAt(l-1)))&&(l=t.text.length);let i=e.buffer.write(h.HeaderMark,0,r).writeElements(e.parser.parseInline(t.text.slice(a+r+1,l),n+r+1),-n);l<t.text.length&&i.write(h.HeaderMark,l-a,s-a);let o=i.finish(h.ATXHeading1-1+r,t.text.length-a);return e.nextLine(),e.addNode(o,n),!0},HTMLBlock(e,t){let r=qt(t,e,!1);if(r<0)return!1;let a=e.lineStart+t.pos,n=Pe[r][1],s=[],l=n!=Qe;for(;!n.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){l=!1;break}for(let O of t.markers)s.push(O)}l&&e.nextLine();let i=n==Tt?h.CommentBlock:n==Vt?h.ProcessingInstructionBlock:h.HTMLBlock,o=e.prevLineEnd();return e.addNode(e.buffer.writeElements(s,-a).finish(i,o-a),a),!0},SetextHeading:void 0};class Dr{constructor(t){this.stage=0,this.elts=[],this.pos=0,this.start=t.start,this.advance(t.content)}nextLine(t,r,a){if(this.stage==-1)return!1;let n=a.content+`
|
|
1
|
+
import{a2 as Pr,a3 as le,N as z,a4 as wr,a5 as bt,U as ie,a6 as A,a7 as kt,W as c,Y as Qt,Z as je,_ as yr,$ as oe,a0 as xr,X as ee,s as j,a8 as Xr,a9 as vr,aa as jr,E as Pt,a as E,P as Cr,O as Tr,ab as Vr,e as N,ac as qr,k as Ar,ad as Er,v as Lr,ae as zr,af as Ie,ag as Rr}from"./syntax-CpKw5ptt.js";import{C as _r}from"./index-pW9eskfl.js";import{L as wt,E as C,C as Yr,a as Br}from"./index-D9bTQUpC.js";import{typescriptLanguage as Ir,jsxLanguage as Zr,tsxLanguage as Mr,javascriptLanguage as Ce,javascript as Nr}from"./index-Da-AnxRT.js";import"./index-Bx9on2--.js";class te{static create(t,r,a,n,s){let l=n+(n<<8)+t+(r<<4)|0;return new te(t,r,a,l,s,[],[])}constructor(t,r,a,n,s,l,i){this.type=t,this.value=r,this.from=a,this.hash=n,this.end=s,this.children=l,this.positions=i,this.hashProp=[[z.contextHash,n]]}addChild(t,r){t.prop(z.contextHash)!=this.hash&&(t=new A(t.type,t.children,t.positions,t.length,this.hashProp)),this.children.push(t),this.positions.push(r)}toTree(t,r=this.end){let a=this.children.length-1;return a>=0&&(r=Math.max(r,this.positions[a]+this.children[a].length+this.from)),new A(t.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(n,s,l)=>new A(le.none,n,s,l,this.hashProp)})}}var h;(function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.Autolink=33]="Autolink",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel",e[e.URL=44]="URL"})(h||(h={}));class Wr{constructor(t,r){this.start=t,this.content=r,this.marks=[],this.parsers=[]}}class Gr{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return Z(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(t,r=0,a=0){for(let n=r;n<t;n++)a+=this.text.charCodeAt(n)==9?4-a%4:1;return a}findColumn(t){let r=0;for(let a=0;r<this.text.length&&a<t;r++)a+=this.text.charCodeAt(r)==9?4-a%4:1;return r}scrub(){if(!this.baseIndent)return this.text;let t="";for(let r=0;r<this.basePos;r++)t+=" ";return t+this.text.slice(this.basePos)}}function Ze(e,t,r){if(r.pos==r.text.length||e!=t.block&&r.indent>=t.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let a=(e.type==h.OrderedList?qe:Ve)(r,t,!1);return a>0&&(e.type!=h.BulletList||Te(r,t,!1)<0)&&r.text.charCodeAt(r.pos+a-1)==e.value}const yt={[h.Blockquote](e,t,r){return r.next!=62?!1:(r.markers.push($(h.QuoteMark,t.lineStart+r.pos,t.lineStart+r.pos+1)),r.moveBase(r.pos+(x(r.text.charCodeAt(r.pos+1))?2:1)),e.end=t.lineStart+r.text.length,!0)},[h.ListItem](e,t,r){return r.indent<r.baseIndent+e.value&&r.next>-1?!1:(r.moveBaseColumn(r.baseIndent+e.value),!0)},[h.OrderedList]:Ze,[h.BulletList]:Ze,[h.Document](){return!0}};function x(e){return e==32||e==9||e==10||e==13}function Z(e,t=0){for(;t<e.length&&x(e.charCodeAt(t));)t++;return t}function Me(e,t,r){for(;t>r&&x(e.charCodeAt(t-1));)t--;return t}function xt(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let r=t;r<e.text.length;r++)if(e.text.charCodeAt(r)==96)return-1}return t}function Xt(e){return e.next!=62?-1:e.text.charCodeAt(e.pos+1)==32?2:1}function Te(e,t,r){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let a=1;for(let n=e.pos+1;n<e.text.length;n++){let s=e.text.charCodeAt(n);if(s==e.next)a++;else if(!x(s))return-1}return r&&e.next==45&&Ct(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(At.SetextHeading)>-1||a<3?-1:1}function vt(e,t){for(let r=e.stack.length-1;r>=0;r--)if(e.stack[r].type==t)return!0;return!1}function Ve(e,t,r){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||x(e.text.charCodeAt(e.pos+1)))&&(!r||vt(t,h.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function qe(e,t,r){let a=e.pos,n=e.next;for(;n>=48&&n<=57;){a++;if(a==e.text.length)return-1;n=e.text.charCodeAt(a)}return a==e.pos||a>e.pos+9||n!=46&&n!=41||a<e.text.length-1&&!x(e.text.charCodeAt(a+1))||r&&!vt(t,h.OrderedList)&&(e.skipSpace(a+1)==e.text.length||a>e.pos+1||e.next!=49)?-1:a+1-e.pos}function jt(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let r=t-e.pos;return r>6?-1:r}function Ct(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let r=t;for(;t<e.text.length&&x(e.text.charCodeAt(t));)t++;return t==e.text.length?r:-1}const Qe=/^[ \t]*$/,Tt=/-->/,Vt=/\?>/,Pe=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Tt],[/^\s*<\?/,Vt],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,Qe],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Qe]];function qt(e,t,r){if(e.next!=60)return-1;let a=e.text.slice(e.pos);for(let n=0,s=Pe.length-(r?1:0);n<s;n++)if(Pe[n][0].test(a))return n;return-1}function Ne(e,t){let r=e.countIndent(t,e.pos,e.indent),a=e.skipSpace(t),n=e.countIndent(a,t,r);return n>=r+5||a==e.text.length?r+1:n}function v(e,t,r){let a=e.length-1;a>=0&&e[a].to==t&&e[a].type==h.CodeText?e[a].to=r:e.push($(h.CodeText,t,r))}const F={LinkReference:void 0,IndentedCode(e,t){let r=t.baseIndent+4;if(t.indent<r)return!1;let a=t.findColumn(r),n=e.lineStart+a,s=e.lineStart+t.text.length,l=[],i=[];for(v(l,n,s);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){v(i,e.lineStart-1,e.lineStart);for(let o of t.markers)i.push(o)}else{if(t.indent<r)break;{if(i.length){for(let O of i)O.type==h.CodeText?v(l,O.from,O.to):l.push(O);i=[]}v(l,e.lineStart-1,e.lineStart);for(let O of t.markers)l.push(O);s=e.lineStart+t.text.length;let o=e.lineStart+t.findColumn(t.baseIndent+4);o<s&&v(l,o,s)}}return i.length&&(i=i.filter(o=>o.type!=h.CodeText),i.length&&(t.markers=i.concat(t.markers))),e.addNode(e.buffer.writeElements(l,-n).finish(h.CodeBlock,s-n),n),!0},FencedCode(e,t){let r=xt(t);if(r<0)return!1;let a=e.lineStart+t.pos,n=t.next,s=r-t.pos,l=t.skipSpace(r),i=Me(t.text,t.text.length,l),o=[$(h.CodeMark,a,a+s)];l<i&&o.push($(h.CodeInfo,e.lineStart+l,e.lineStart+i));for(let O=!0,u=!0,d=!1;e.nextLine()&&t.depth>=e.stack.length;O=!1){let f=t.pos;if(t.indent-t.baseIndent<4)for(;f<t.text.length&&t.text.charCodeAt(f)==n;)f++;if(f-t.pos>=s&&t.skipSpace(f)==t.text.length){for(let m of t.markers)o.push(m);u&&d&&v(o,e.lineStart-1,e.lineStart),o.push($(h.CodeMark,e.lineStart+t.pos,e.lineStart+f)),e.nextLine();break}else{d=!0,O||(v(o,e.lineStart-1,e.lineStart),u=!1);for(let g of t.markers)o.push(g);let m=e.lineStart+t.basePos,S=e.lineStart+t.text.length;m<S&&(v(o,m,S),u=!1)}}return e.addNode(e.buffer.writeElements(o,-a).finish(h.FencedCode,e.prevLineEnd()-a),a),!0},Blockquote(e,t){let r=Xt(t);return r<0?!1:(e.startContext(h.Blockquote,t.pos),e.addNode(h.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+r),null)},HorizontalRule(e,t){if(Te(t,e,!1)<0)return!1;let r=e.lineStart+t.pos;return e.nextLine(),e.addNode(h.HorizontalRule,r),!0},BulletList(e,t){let r=Ve(t,e,!1);if(r<0)return!1;e.block.type!=h.BulletList&&e.startContext(h.BulletList,t.basePos,t.next);let a=Ne(t,t.pos+1);return e.startContext(h.ListItem,t.basePos,a-t.baseIndent),e.addNode(h.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+r),t.moveBaseColumn(a),null},OrderedList(e,t){let r=qe(t,e,!1);if(r<0)return!1;e.block.type!=h.OrderedList&&e.startContext(h.OrderedList,t.basePos,t.text.charCodeAt(t.pos+r-1));let a=Ne(t,t.pos+r);return e.startContext(h.ListItem,t.basePos,a-t.baseIndent),e.addNode(h.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+r),t.moveBaseColumn(a),null},ATXHeading(e,t){let r=jt(t);if(r<0)return!1;let a=t.pos,n=e.lineStart+a,s=Me(t.text,t.text.length,a),l=s;for(;l>a&&t.text.charCodeAt(l-1)==t.next;)l--;(l==s||l==a||!x(t.text.charCodeAt(l-1)))&&(l=t.text.length);let i=e.buffer.write(h.HeaderMark,0,r).writeElements(e.parser.parseInline(t.text.slice(a+r+1,l),n+r+1),-n);l<t.text.length&&i.write(h.HeaderMark,l-a,s-a);let o=i.finish(h.ATXHeading1-1+r,t.text.length-a);return e.nextLine(),e.addNode(o,n),!0},HTMLBlock(e,t){let r=qt(t,e,!1);if(r<0)return!1;let a=e.lineStart+t.pos,n=Pe[r][1],s=[],l=n!=Qe;for(;!n.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){l=!1;break}for(let O of t.markers)s.push(O)}l&&e.nextLine();let i=n==Tt?h.CommentBlock:n==Vt?h.ProcessingInstructionBlock:h.HTMLBlock,o=e.prevLineEnd();return e.addNode(e.buffer.writeElements(s,-a).finish(i,o-a),a),!0},SetextHeading:void 0};class Dr{constructor(t){this.stage=0,this.elts=[],this.pos=0,this.start=t.start,this.advance(t.content)}nextLine(t,r,a){if(this.stage==-1)return!1;let n=a.content+`
|
|
2
2
|
`+r.scrub(),s=this.advance(n);return s>-1&&s<n.length?this.complete(t,a,s):!1}finish(t,r){return(this.stage==2||this.stage==3)&&Z(r.content,this.pos)==r.content.length?this.complete(t,r,r.content.length):!1}complete(t,r,a){return t.addLeafElement(r,$(h.LinkReference,this.start,this.start+a,this.elts)),!0}nextStage(t){return t?(this.pos=t.to-this.start,this.elts.push(t),this.stage++,!0):(t===!1&&(this.stage=-1),!1)}advance(t){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(Zt(t,this.pos,this.start,!0)))return-1;if(t.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push($(h.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Bt(t,Z(t,this.pos),this.start)))return-1}else if(this.stage==2){let r=Z(t,this.pos),a=0;if(r>this.pos){let n=It(t,r,this.start);if(n){let s=ue(t,n.to-this.start);s>0&&(this.nextStage(n),a=s)}}return a||(a=ue(t,this.pos)),a>0&&a<t.length?a:-1}else return ue(t,this.pos)}}}function ue(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r==10)break;if(!x(r))return-1}return t}class Ur{nextLine(t,r,a){let n=r.depth<t.stack.length?-1:Ct(r),s=r.next;if(n<0)return!1;let l=$(h.HeaderMark,t.lineStart+r.pos,t.lineStart+n);return t.nextLine(),t.addLeafElement(a,$(s==61?h.SetextHeading1:h.SetextHeading2,a.start,t.prevLineEnd(),[...t.parser.parseInline(a.content,a.start),l])),!0}finish(){return!1}}const At={LinkReference(e,t){return t.content.charCodeAt(0)==91?new Dr(t):null},SetextHeading(){return new Ur}},Fr=[(e,t)=>jt(t)>=0,(e,t)=>xt(t)>=0,(e,t)=>Xt(t)>=0,(e,t)=>Ve(t,e,!0)>=0,(e,t)=>qe(t,e,!0)>=0,(e,t)=>Te(t,e,!0)>=0,(e,t)=>qt(t,e,!0)>=0],Hr={text:"",end:0};class Kr{constructor(t,r,a,n){this.parser=t,this.input=r,this.ranges=n,this.line=new Gr,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=n[n.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=n[0].from,this.block=te.create(h.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=a.length?new ta(a,r):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:t}=this;for(;;){for(let a=0;;){let n=t.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;a<t.markers.length&&(!n||t.markers[a].from<n.end);){let s=t.markers[a++];this.addNode(s.type,s.from,s.to)}if(!n)break;this.finishContext()}if(t.pos<t.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(t.basePos))return null;e:for(;;){for(let a of this.parser.blockParsers)if(a){let n=a(this,t);if(n!=!1){if(n==!0)return null;t.forward();continue e}}break}if(t.pos==t.text.length)return this.nextLine()?null:this.finish();let r=new Wr(this.lineStart+t.pos,t.text.slice(t.pos));for(let a of this.parser.leafBlockParsers)if(a){let n=a(this,r);n&&r.parsers.push(n)}e:for(;this.nextLine()&&t.pos!=t.text.length;){if(t.indent<t.baseIndent+4){for(let a of this.parser.endLeafBlock)if(a(this,t,r))break e}for(let a of r.parsers)if(a.nextLine(this,t,r))return null;r.content+=`
|
|
3
3
|
`+t.scrub();for(let a of t.markers)r.marks.push(a)}return this.finishLeaf(r),null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}reuseFragment(t){if(!this.fragments.moveTo(this.absoluteLineStart+t,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let r=this.fragments.takeNodes(this);return r?(this.absoluteLineStart+=r,this.lineStart=Mt(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(t=this.depth-1){return this.parser.nodeSet.types[this.stack[t].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(t){let r=Hr;if(r.end=t,t>=this.to)r.text="";else if(r.text=this.lineChunkAt(t),r.end+=r.text.length,this.ranges.length>1){let a=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<r.end;){n++;let s=this.ranges[n].from,l=this.lineChunkAt(s);r.end=s+l.length,r.text=r.text.slice(0,this.ranges[n-1].to-a)+l,a=r.end-r.text.length}}return r}readLine(){let{line:t}=this,{text:r,end:a}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=a,t.reset(r);t.depth<this.stack.length;t.depth++){let n=this.stack[t.depth],s=this.parser.skipContextMarkup[n.type];if(!s)throw new Error("Unhandled block context "+h[n.type]);let l=this.line.markers.length;if(!s(n,this,t)){this.line.markers.length>l&&(n.end=this.line.markers[this.line.markers.length-1].to),t.forward();break}t.forward()}}lineChunkAt(t){let r=this.input.chunk(t),a;if(this.input.lineChunks)a=r==`
|
|
4
4
|
`?"":r;else{let n=r.indexOf(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as r}from"./index-
|
|
1
|
+
import{L as r}from"./index-D9bTQUpC.js";import{U as a,W as O,X as P,Y as Q,Z as s,_ as e,$ as o,a0 as t}from"./syntax-CpKw5ptt.js";import"./index-Bx9on2--.js";const n=a({String:O.string,Number:O.number,"True False":O.bool,PropertyName:O.propertyName,Null:O.null,", :":O.separator,"[ ]":O.squareBracket,"{ }":O.brace}),i=r.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[n],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),c=Q.define({name:"json",parser:i.configure({props:[s.add({Object:e({except:/^\s*\}/}),Array:e({except:/^\s*\]/})}),o.add({"Object Array":t})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function l(){return new P(c)}export{l as json,c as jsonLanguage};
|