diff --git a/lib/dist/browser.esm.mjs b/lib/dist/browser.esm.mjs index 44833de..a9dbdca 100644 --- a/lib/dist/browser.esm.mjs +++ b/lib/dist/browser.esm.mjs @@ -1 +1 @@ -async function A(A){throw new Error("no fs")}async function B(A){const B=await fetch(`https://lighter.codehike.org/${A}.json`);if(B.ok)return await B.json()}const Q=A=>/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(A),g=(A,B)=>A.match(new RegExp(`.{${B}}`,"g")),E=A=>parseInt(A.repeat(2/A.length),16);function C(A,B){return void 0!==A?A/255:"number"!=typeof B||B<0||B>1?1:B}function I(A,B){if(!A)return A;const{r:I,g:D,b:w,a:o}=function(A){if(!A)return;if(!Q(A))throw new Error("Invalid color string, must be a valid hex color");const B=Math.floor((A.length-1)/3),I=g(A.slice(1),B),[D,w,o,s]=I.map(E);return{r:D,g:w,b:o,a:C(s,1)}}(A);return function(A){if(!A)return;const{r:B,g:Q,b:g,a:E}=A,C=Math.round(255*E);return`#${B.toString(16).padStart(2,"0")}${Q.toString(16).padStart(2,"0")}${g.toString(16).padStart(2,"0")}${C.toString(16).padStart(2,"0")}`}({r:I,g:D,b:w,a:o*B})}function D(A,B){const Q=A.colors||{};if(Q[B])return Q[B];const g=o[B];if(!g)throw new Error(`Unknown theme color key: ${B}`);return"string"==typeof g?D(A,g):function(A,B){const Q=B[A.type];if(Array.isArray(Q)){const[B,g,...E]=Q;return B(D(A,g),...E)}return Q}(A,g)}const w="#6FC3DF",o={"editor.foreground":{dark:"#bbbbbb",light:"#333333",hc:"#ffffff"},"editorLineNumber.foreground":{dark:"#858585",light:"#237893",hc:"#fffffe"},"editor.selectionBackground":{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},"editor.background":{light:"#fffffe",dark:"#1E1E1E",hc:"#000000"},"editorGroupHeader.tabsBackground":{dark:"#252526",light:"#F3F3F3"},"tab.activeBackground":"editor.background","tab.activeForeground":{dark:"#ffffff",light:"#333333",hc:"#ffffff"},"tab.border":{dark:"#252526",light:"#F3F3F3",hc:w},"tab.activeBorder":"tab.activeBackground","tab.inactiveBackground":{dark:"#2D2D2D",light:"#ECECEC"},"tab.inactiveForeground":{dark:[I,"tab.activeForeground",.5],light:[I,"tab.activeForeground",.5],hc:"#ffffff"},"diffEditor.insertedTextBackground":{dark:"#9ccc2c33",light:"#9ccc2c40"},"diffEditor.removedTextBackground":{dark:"#ff000033",light:"#ff000033"},"diffEditor.insertedLineBackground":{dark:"#9bb95533",light:"#9bb95533"},"diffEditor.removedLineBackground":{dark:"#ff000033",light:"#ff000033"},"icon.foreground":{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},"sideBar.background":{dark:"#252526",light:"#F3F3F3",hc:"#000000"},"sideBar.foreground":"editor.foreground","sideBar.border":"sideBar.background","list.inactiveSelectionBackground":{dark:"#37373D",light:"#E4E6F1"},"list.inactiveSelectionForeground":{},"list.hoverBackground":{dark:"#2A2D2E",light:"#F0F0F0"},"list.hoverForeground":{},"editorGroupHeader.tabsBorder":{hc:w},"tab.activeBorderTop":{hc:w},"tab.hoverBackground":"tab.inactiveBackground","tab.hoverForeground":"tab.inactiveForeground","editor.rangeHighlightBackground":{dark:"#ffffff0b",light:"#fdff0033"},"editor.infoForeground":{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},"input.border":{hc:w},"input.background":{dark:"#3C3C3C",light:"#fffffe",hc:"#000000"},"input.foreground":"editor.foreground","editor.lineHighlightBackground":{},focusBorder:{light:"#0090F1",dark:"#007FD4",hc:w},"editorGroup.border":{dark:"#444444",light:"#E7E7E7",hc:w},"list.activeSelectionBackground":{dark:"#094771",light:"#0060C0",hc:"#000000"},"list.activeSelectionForeground":{dark:"#fffffe",light:"#fffffe",hc:"#fffffe"},"lighter.inlineBackground":{dark:[I,"editor.background",.9],light:[I,"editor.background",.9]},"terminal.background":"editor.background","terminal.foreground":"editor.foreground","terminal.ansiBlack":{dark:"#000000",light:"#000000",hc:"#000000"},"terminal.ansiRed":{dark:"#cd3131",light:"#cd3131",hc:"#cd0000"},"terminal.ansiGreen":{dark:"#0DBC79",light:"#00BC00",hc:"#00cd00"},"terminal.ansiYellow":{dark:"#e5e510",light:"#949800",hc:"#cdcd00"},"terminal.ansiBlue":{dark:"#2472c8",light:"#0451a5",hc:"#0000ee"},"terminal.ansiMagenta":{dark:"#bc3fbc",light:"#bc05bc",hc:"#cd00cd"},"terminal.ansiCyan":{dark:"#11a8cd",light:"#0598bc",hc:"#00cdcd"},"terminal.ansiWhite":{dark:"#e5e5e5",light:"#555555",hc:"#e5e5e5"},"terminal.ansiBrightBlack":{dark:"#666666",light:"#666666",hc:"#7f7f7f"},"terminal.ansiBrightRed":{dark:"#f14c4c",light:"#cd3131",hc:"#ff0000"},"terminal.ansiBrightGreen":{dark:"#23d18b",light:"#14CE14",hc:"#00ff00"},"terminal.ansiBrightYellow":{dark:"#f5f543",light:"#b5ba00",hc:"#ffff00"},"terminal.ansiBrightBlue":{dark:"#3b8eea",light:"#0451a5",hc:"#5c5cff"},"terminal.ansiBrightMagenta":{dark:"#d670d6",light:"#bc05bc",hc:"#ff00ff"},"terminal.ansiBrightCyan":{dark:"#29b8db",light:"#0598bc",hc:"#00ffff"},"terminal.ansiBrightWhite":{dark:"#e5e5e5",light:"#a5a5a5",hc:"#ffffff"}},s=new Map,e=new Map;async function c(A){if("string"==typeof A){const Q=A;if(!M.includes(Q))throw new h(Q);if(!s.has(Q)){const A=async function(A){try{return await async function(A){throw new Error("no fs")}()}catch(Q){return await B(`themes/${A}`)}}(Q).then((A=>(e.set(Q,A),A)));s.set(Q,A)}return s.get(Q)}return A}function i(A){let B=null;if("string"==typeof A){if(B=e.get(A),!B)throw new Error("Syntax highlighting error: theme not loaded")}else B=A;return function(A){if(!A)return;const B=A.settings||A.tokenColors||[],Q={name:A.name||"unknown-theme",type:t(A),foreground:"",background:"",settings:B,colors:A.colors||{},colorNames:A.colorNames},g=B.find((A=>!A.scope));if(g){const{foreground:A,background:B}=(null==g?void 0:g.settings)||{},E={};A&&!Q.colors["editor.foreground"]&&(E["editor.foreground"]=A),B&&!Q.colors["editor.background"]&&(E["editor.background"]=B),Object.keys(E).length>0&&(Q.colors=Object.assign(Object.assign({},Q.colors),E)),Q.foreground=A,Q.background=B}g||(Q.settings=[{settings:{foreground:D(Q,"editor.foreground"),background:D(Q,"editor.background")}},...Q.settings]);if(Q.background=Q.background||D(Q,"editor.background"),Q.foreground=Q.foreground||D(Q,"editor.foreground"),"from-css"===A.type&&!Q.colorNames){const A={};let B=0;Q.settings=Q.settings.map((Q=>{const g=Object.assign(Object.assign({},Q),{settings:Object.assign({},Q.settings)}),{foreground:E,background:C}=g.settings||{};return E&&!A[E]&&(A[E]=`#${B.toString(16).padStart(6,"0")}`,B++),C&&!A[C]&&(A[C]=`#${B.toString(16).padStart(6,"0")}`,B++),E&&(g.settings.foreground=A[E]),C&&(g.settings.background=A[C]),g})),Q.colorNames=A}return Q}(B)}function t(A){var B;if("from-css"===A.type)return"from-css";return"light"===(A.type?A.type:(null===(B=A.name)||void 0===B?void 0:B.toLowerCase().includes("light"))?"light":"dark")?"light":"dark"}const M=["dark-plus","dracula-soft","dracula","github-dark","github-dark-dimmed","github-from-css","github-light","light-plus","material-darker","material-default","material-from-css","material-lighter","material-ocean","material-palenight","min-dark","min-light","monokai","nord","one-dark-pro","poimandres","slack-dark","slack-ochin","solarized-dark","solarized-light"];class h extends Error{constructor(A){super(`Unknown theme: ${A}`),this.theme=A}}function F(A){const B=B=>"colorScheme"===B?function(A){return"from-css"===A.type?"var(--ch-0)":A.type}(A):"foreground"===B?A.foreground:"background"===B?A.background:D(A,B);return{colorScheme:B("colorScheme"),foreground:B("foreground"),background:B("background"),lighter:{inlineBackground:B("lighter.inlineBackground")},editor:{background:B("editor.background"),foreground:B("editor.foreground"),lineHighlightBackground:B("editor.lineHighlightBackground"),rangeHighlightBackground:B("editor.rangeHighlightBackground"),infoForeground:B("editor.infoForeground"),selectionBackground:B("editor.selectionBackground")},focusBorder:B("focusBorder"),tab:{activeBackground:B("tab.activeBackground"),activeForeground:B("tab.activeForeground"),inactiveBackground:B("tab.inactiveBackground"),inactiveForeground:B("tab.inactiveForeground"),border:B("tab.border"),activeBorder:B("tab.activeBorder"),activeBorderTop:B("tab.activeBorderTop")},editorGroup:{border:B("editorGroup.border")},editorGroupHeader:{tabsBackground:B("editorGroupHeader.tabsBackground")},editorLineNumber:{foreground:B("editorLineNumber.foreground")},input:{background:B("input.background"),foreground:B("input.foreground"),border:B("input.border")},icon:{foreground:B("icon.foreground")},sideBar:{background:B("sideBar.background"),foreground:B("sideBar.foreground"),border:B("sideBar.border")},list:{activeSelectionBackground:B("list.activeSelectionBackground"),activeSelectionForeground:B("list.activeSelectionForeground"),hoverBackground:B("list.hoverBackground"),hoverForeground:B("list.hoverForeground")}}}const G=["abap","actionscript-3","ada","adoc","angular-html","angular-ts","apache","apex","apl","applescript","ara","asciidoc","asm","astro","awk","ballerina","bash","bat","batch","be","beancount","berry","bibtex","bicep","blade","c","c#","c++","cadence","cdc","clarity","clj","clojure","closure-templates","cmake","cmd","cobol","codeowners","codeql","coffee","coffeescript","common-lisp","console","cpp","cql","crystal","cs","csharp","css","csv","cue","cypher","d","dart","dax","desktop","diff","docker","dockerfile","dotenv","dream-maker","edge","elisp","elixir","elm","emacs-lisp","erb","erl","erlang","f","f#","f03","f08","f18","f77","f90","f95","fennel","fish","fluent","for","fortran-fixed-form","fortran-free-form","fs","fsharp","fsl","ftl","gdresource","gdscript","gdshader","genie","gherkin","git-commit","git-rebase","gjs","gleam","glimmer-js","glimmer-ts","glsl","gnuplot","go","gql","graphql","groovy","gts","hack","haml","handlebars","haskell","haxe","hbs","hcl","hjson","hlsl","hs","html","html-derivative","http","hxml","hy","imba","ini","jade","java","javascript","jinja","jison","jl","js","json","json5","jsonc","jsonl","jsonnet","jssm","jsx","julia","kotlin","kql","kt","kts","kusto","latex","lean","lean4","less","liquid","lisp","lit","log","logo","lua","luau","make","makefile","markdown","marko","matlab","md","mdc","mdx","mediawiki","mermaid","mojo","move","nar","narrat","nextflow","nf","nginx","nim","nix","nu","nushell","objc","objective-c","objective-cpp","ocaml","pascal","perl","perl6","php","plsql","po","postcss","pot","potx","powerquery","powershell","prisma","prolog","properties","proto","ps","ps1","pug","puppet","purescript","py","python","ql","qml","qmldir","qss","r","racket","raku","razor","rb","reg","regex","regexp","rel","riscv","rs","rst","ruby","rust","sas","sass","scala","scheme","scss","sh","shader","shaderlab","shell","shellscript","shellsession","smalltalk","solidity","soy","sparql","spl","splunk","sql","ssh-config","stata","styl","stylus","svelte","swift","system-verilog","systemd","tasl","tcl","templ","terminal","terraform","tex","text","tf","tfvars","toml","ts","ts-tags","tsp","tsv","tsx","turtle","twig","txt","typ","typescript","typespec","typst","v","vala","vb","verilog","vhdl","vim","viml","vimscript","vue","vue-html","vy","vyper","wasm","wenyan","wgsl","wiki","wikitext","wl","wolfram","xml","xsl","yaml","yml","zenscript","zig","zsh","文言"],a={abap:"source.abap","actionscript-3":"source.actionscript.3",ada:"source.ada","angular-html":"text.html.derivative.ng","angular-ts":"source.ts.ng",apache:"source.apacheconf",apex:"source.apex",apl:"source.apl",applescript:"source.applescript",ara:"source.ara",asciidoc:"text.asciidoc",adoc:"text.asciidoc",asm:"source.asm.x86_64",astro:"source.astro",awk:"source.awk",ballerina:"source.ballerina",bat:"source.batchfile",batch:"source.batchfile",beancount:"text.beancount",berry:"source.berry",be:"source.berry",bibtex:"text.bibtex",bicep:"source.bicep",blade:"text.html.php.blade",c:"source.c",cadence:"source.cadence",cdc:"source.cadence",clarity:"source.clar",clojure:"source.clojure",clj:"source.clojure",cmake:"source.cmake",cobol:"source.cobol",codeowners:"text.codeowners",codeql:"source.ql",ql:"source.ql",coffee:"source.coffee",coffeescript:"source.coffee","common-lisp":"source.commonlisp",lisp:"source.commonlisp",cpp:"source.cpp","c++":"source.cpp",crystal:"source.crystal",csharp:"source.cs","c#":"source.cs",cs:"source.cs",css:"source.css",csv:"text.csv",cue:"source.cue",cypher:"source.cypher",cql:"source.cypher",d:"source.d",dart:"source.dart",dax:"source.dax",desktop:"source.desktop",diff:"source.diff",docker:"source.dockerfile",dockerfile:"source.dockerfile",dotenv:"source.dotenv","dream-maker":"source.dm",edge:"text.html.edge",elixir:"source.elixir",elm:"source.elm","emacs-lisp":"source.emacs.lisp",elisp:"source.emacs.lisp",erb:"text.html.erb",erlang:"source.erlang",erl:"source.erlang",fennel:"source.fnl",fish:"source.fish",fluent:"source.ftl",ftl:"source.ftl","fortran-fixed-form":"source.fortran.fixed",f:"source.fortran.fixed",for:"source.fortran.fixed",f77:"source.fortran.fixed","fortran-free-form":"source.fortran.free",f90:"source.fortran.free",f95:"source.fortran.free",f03:"source.fortran.free",f08:"source.fortran.free",f18:"source.fortran.free",fsharp:"source.fsharp","f#":"source.fsharp",fs:"source.fsharp",gdresource:"source.gdresource",gdscript:"source.gdscript",gdshader:"source.gdshader",genie:"source.genie",gherkin:"text.gherkin.feature","git-commit":"text.git-commit","git-rebase":"text.git-rebase",gleam:"source.gleam","glimmer-js":"source.gjs",gjs:"source.gjs","glimmer-ts":"source.gts",gts:"source.gts",glsl:"source.glsl",gnuplot:"source.gnuplot",go:"source.go",graphql:"source.graphql",gql:"source.graphql",groovy:"source.groovy",hack:"source.hack",haml:"text.haml",handlebars:"text.html.handlebars",hbs:"text.html.handlebars",haskell:"source.haskell",hs:"source.haskell",haxe:"source.hx",hcl:"source.hcl",hjson:"source.hjson",hlsl:"source.hlsl",html:"text.html.basic","html-derivative":"text.html.derivative",http:"source.http",hxml:"source.hxml",hy:"source.hy",imba:"source.imba",ini:"source.ini",properties:"source.ini",java:"source.java",javascript:"source.js",js:"source.js",jinja:"source.jinja",jison:"source.jison",json:"source.json",json5:"source.json5",jsonc:"source.json.comments",jsonl:"source.json.lines",jsonnet:"source.jsonnet",jssm:"source.jssm",fsl:"source.jssm",jsx:"source.js.jsx",julia:"source.julia",jl:"source.julia",kotlin:"source.kotlin",kt:"source.kotlin",kts:"source.kotlin",kusto:"source.kusto",kql:"source.kusto",latex:"text.tex.latex",lean:"source.lean4",lean4:"source.lean4",less:"source.css.less",liquid:"text.html.liquid",log:"text.log",logo:"source.logo",lua:"source.lua",luau:"source.luau",make:"source.makefile",makefile:"source.makefile",markdown:"text.html.markdown",md:"text.html.markdown",marko:"text.marko",matlab:"source.matlab",mdc:"text.markdown.mdc",mdx:"source.mdx",mermaid:"markdown.mermaid.codeblock",mojo:"source.mojo",move:"source.move",narrat:"source.narrat",nar:"source.narrat",nextflow:"source.nextflow",nf:"source.nextflow",nginx:"source.nginx",nim:"source.nim",nix:"source.nix",nushell:"source.nushell",nu:"source.nushell","objective-c":"source.objc",objc:"source.objc","objective-cpp":"source.objcpp",ocaml:"source.ocaml",pascal:"source.pascal",perl:"source.perl",php:"source.php",plsql:"source.plsql.oracle",po:"source.po",pot:"source.po",potx:"source.po",postcss:"source.css.postcss",powerquery:"source.powerquery",powershell:"source.powershell",ps:"source.powershell",ps1:"source.powershell",prisma:"source.prisma",prolog:"source.prolog",proto:"source.proto",pug:"text.pug",jade:"text.pug",puppet:"source.puppet",purescript:"source.purescript",python:"source.python",py:"source.python",qml:"source.qml",qmldir:"source.qmldir",qss:"source.qss",r:"source.r",racket:"source.racket",raku:"source.perl.6",perl6:"source.perl.6",razor:"text.aspnetcorerazor",reg:"source.reg",regexp:"source.regexp.python",regex:"source.regexp.python",rel:"source.rel",riscv:"source.riscv",rst:"source.rst",ruby:"source.ruby",rb:"source.ruby",rust:"source.rust",rs:"source.rust",sas:"source.sas",sass:"source.sass",scala:"source.scala",scheme:"source.scheme",scss:"source.css.scss",shaderlab:"source.shaderlab",shader:"source.shaderlab",shellscript:"source.shell",bash:"source.shell",sh:"source.shell",shell:"source.shell",zsh:"source.shell",shellsession:"text.shell-session",console:"text.shell-session",smalltalk:"source.smalltalk",solidity:"source.solidity",soy:"text.html.soy","closure-templates":"text.html.soy",sparql:"source.sparql",splunk:"source.splunk_search",spl:"source.splunk_search",sql:"source.sql","ssh-config":"source.ssh-config",stata:"source.stata",stylus:"source.stylus",styl:"source.stylus",svelte:"source.svelte",swift:"source.swift","system-verilog":"source.systemverilog",systemd:"source.systemd",tasl:"source.tasl",tcl:"source.tcl",templ:"source.templ",terraform:"source.hcl.terraform",tf:"source.hcl.terraform",tfvars:"source.hcl.terraform",tex:"text.tex",toml:"source.toml","ts-tags":"source.ts.tags",lit:"source.ts.tags",tsv:"text.tsv",tsx:"source.tsx",turtle:"source.turtle",twig:"text.html.twig",txt:"source.txt",typescript:"source.ts",ts:"source.ts",typespec:"source.tsp",tsp:"source.tsp",typst:"source.typst",typ:"source.typst",v:"source.v",vala:"source.vala",vb:"source.asp.vb.net",cmd:"source.asp.vb.net",verilog:"source.verilog",vhdl:"source.vhdl",viml:"source.viml",vim:"source.viml",vimscript:"source.viml",vue:"source.vue","vue-html":"text.html.vue-html",vyper:"source.vyper",vy:"source.vyper",wasm:"source.wat",wenyan:"source.wenyan","文言":"source.wenyan",wgsl:"source.wgsl",wikitext:"source.wikitext",mediawiki:"source.wikitext",wiki:"source.wikitext",wolfram:"source.wolfram",wl:"source.wolfram",xml:"text.xml",xsl:"text.xml.xsl",yaml:"source.yaml",yml:"source.yaml",zenscript:"source.zenscript",zig:"source.zig"},n={"source.abap":{id:"abap",embeddedScopes:[]},"source.actionscript.3":{id:"actionscript-3",embeddedScopes:[]},"source.ada":{id:"ada",embeddedScopes:[]},"text.html.derivative.ng":{id:"angular-html",embeddedScopes:["text.html.basic"]},"source.ts.ng":{id:"angular-ts",embeddedScopes:[]},"source.apacheconf":{id:"apache",embeddedScopes:[]},"source.apex":{id:"apex",embeddedScopes:[]},"source.apl":{id:"apl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.json"]},"source.applescript":{id:"applescript",embeddedScopes:[]},"source.ara":{id:"ara",embeddedScopes:[]},"text.asciidoc":{id:"asciidoc",embeddedScopes:["text.html.basic","source.yaml","text.csv","source.c","source.clojure","source.coffee","source.cpp","source.css","source.cs","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.groovy","source.haskell","source.java","source.js","source.json","source.js.jsx","source.julia","source.kotlin","source.css.less","source.makefile","source.objc","source.ocaml","source.perl","source.python","source.r","source.ruby","source.rust","source.sass","source.scala","source.css.scss","source.shell","source.sql","source.swift","source.toml","source.ts","text.xml"]},"source.asm.x86_64":{id:"asm",embeddedScopes:[]},"source.astro":{id:"astro",embeddedScopes:["source.json","source.js","source.ts","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","source.tsx"]},"source.awk":{id:"awk",embeddedScopes:[]},"source.ballerina":{id:"ballerina",embeddedScopes:[]},"source.batchfile":{id:"bat",embeddedScopes:[]},"text.beancount":{id:"beancount",embeddedScopes:[]},"source.berry":{id:"berry",embeddedScopes:[]},"text.bibtex":{id:"bibtex",embeddedScopes:[]},"source.bicep":{id:"bicep",embeddedScopes:[]},"text.html.php.blade":{id:"blade",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.c":{id:"c",embeddedScopes:[]},"source.cadence":{id:"cadence",embeddedScopes:[]},"source.clar":{id:"clarity",embeddedScopes:[]},"source.clojure":{id:"clojure",embeddedScopes:[]},"source.cmake":{id:"cmake",embeddedScopes:[]},"source.cobol":{id:"cobol",embeddedScopes:["source.sql","text.html.basic","source.java"]},"text.codeowners":{id:"codeowners",embeddedScopes:[]},"source.ql":{id:"codeql",embeddedScopes:[]},"source.coffee":{id:"coffee",embeddedScopes:["source.js"]},"source.commonlisp":{id:"common-lisp",embeddedScopes:[]},"source.cpp":{id:"cpp",embeddedScopes:["source.regexp.python","source.glsl","source.sql"]},"source.crystal":{id:"crystal",embeddedScopes:["text.html.basic","source.sql","source.css","source.c","source.js","source.shell"]},"source.cs":{id:"csharp",embeddedScopes:[]},"source.css":{id:"css",embeddedScopes:[]},"text.csv":{id:"csv",embeddedScopes:[]},"source.cue":{id:"cue",embeddedScopes:[]},"source.cypher":{id:"cypher",embeddedScopes:[]},"source.d":{id:"d",embeddedScopes:[]},"source.dart":{id:"dart",embeddedScopes:[]},"source.dax":{id:"dax",embeddedScopes:[]},"source.desktop":{id:"desktop",embeddedScopes:[]},"source.diff":{id:"diff",embeddedScopes:[]},"source.dockerfile":{id:"docker",embeddedScopes:[]},"source.dotenv":{id:"dotenv",embeddedScopes:[]},"source.dm":{id:"dream-maker",embeddedScopes:[]},"text.html.edge":{id:"edge",embeddedScopes:["source.ts","text.html.basic","text.html.derivative"]},"source.elixir":{id:"elixir",embeddedScopes:["text.html.basic"]},"source.elm":{id:"elm",embeddedScopes:["source.glsl"]},"source.emacs.lisp":{id:"emacs-lisp",embeddedScopes:[]},"text.html.erb":{id:"erb",embeddedScopes:["text.html.basic","source.ruby"]},"source.erlang":{id:"erlang",embeddedScopes:[]},"source.fnl":{id:"fennel",embeddedScopes:[]},"source.fish":{id:"fish",embeddedScopes:[]},"source.ftl":{id:"fluent",embeddedScopes:[]},"source.fortran.fixed":{id:"fortran-fixed-form",embeddedScopes:["source.fortran.free"]},"source.fortran.free":{id:"fortran-free-form",embeddedScopes:[]},"source.fsharp":{id:"fsharp",embeddedScopes:["text.html.markdown"]},"source.gdresource":{id:"gdresource",embeddedScopes:["source.gdshader","source.gdscript"]},"source.gdscript":{id:"gdscript",embeddedScopes:[]},"source.gdshader":{id:"gdshader",embeddedScopes:[]},"source.genie":{id:"genie",embeddedScopes:[]},"text.gherkin.feature":{id:"gherkin",embeddedScopes:[]},"text.git-commit":{id:"git-commit",embeddedScopes:["source.diff"]},"text.git-rebase":{id:"git-rebase",embeddedScopes:["source.shell"]},"source.gleam":{id:"gleam",embeddedScopes:[]},"source.gjs":{id:"glimmer-js",embeddedScopes:["source.js","source.ts","source.css","text.html.basic"]},"source.gts":{id:"glimmer-ts",embeddedScopes:["source.ts","source.css","source.js","text.html.basic"]},"source.glsl":{id:"glsl",embeddedScopes:["source.c"]},"source.gnuplot":{id:"gnuplot",embeddedScopes:[]},"source.go":{id:"go",embeddedScopes:[]},"source.graphql":{id:"graphql",embeddedScopes:["source.js","source.ts","source.js.jsx","source.tsx"]},"source.groovy":{id:"groovy",embeddedScopes:[]},"source.hack":{id:"hack",embeddedScopes:["text.html.basic","source.sql"]},"text.haml":{id:"haml",embeddedScopes:["source.ruby","source.js","source.sass","source.coffee","text.html.markdown","source.css"]},"text.html.handlebars":{id:"handlebars",embeddedScopes:["text.html.basic","source.css","source.js","source.yaml"]},"source.haskell":{id:"haskell",embeddedScopes:[]},"source.hx":{id:"haxe",embeddedScopes:[]},"source.hcl":{id:"hcl",embeddedScopes:[]},"source.hjson":{id:"hjson",embeddedScopes:[]},"source.hlsl":{id:"hlsl",embeddedScopes:[]},"text.html.basic":{id:"html",embeddedScopes:["source.js","source.css"]},"text.html.derivative":{id:"html-derivative",embeddedScopes:["text.html.basic"]},"source.http":{id:"http",embeddedScopes:["source.shell","source.json","text.xml","source.graphql"]},"source.hxml":{id:"hxml",embeddedScopes:["source.hx"]},"source.hy":{id:"hy",embeddedScopes:[]},"source.imba":{id:"imba",embeddedScopes:["source.ts"]},"source.ini":{id:"ini",embeddedScopes:[]},"source.java":{id:"java",embeddedScopes:[]},"source.js":{id:"javascript",embeddedScopes:[]},"source.jinja":{id:"jinja",embeddedScopes:[]},"source.jison":{id:"jison",embeddedScopes:["source.js"]},"source.json":{id:"json",embeddedScopes:[]},"source.json5":{id:"json5",embeddedScopes:[]},"source.json.comments":{id:"jsonc",embeddedScopes:[]},"source.json.lines":{id:"jsonl",embeddedScopes:[]},"source.jsonnet":{id:"jsonnet",embeddedScopes:[]},"source.jssm":{id:"jssm",embeddedScopes:[]},"source.js.jsx":{id:"jsx",embeddedScopes:[]},"source.julia":{id:"julia",embeddedScopes:["source.cpp","source.python","source.js","source.r","source.sql"]},"source.kotlin":{id:"kotlin",embeddedScopes:[]},"source.kusto":{id:"kusto",embeddedScopes:[]},"text.tex.latex":{id:"latex",embeddedScopes:["text.tex","source.shell","source.css","source.gnuplot","source.haskell","text.html.basic","source.java","source.julia","source.js","source.lua","source.python","source.ruby","source.rust","source.ts","text.xml","source.yaml","source.scala"]},"source.lean4":{id:"lean",embeddedScopes:[]},"source.css.less":{id:"less",embeddedScopes:[]},"text.html.liquid":{id:"liquid",embeddedScopes:["text.html.basic","source.css","source.json","source.js"]},"text.log":{id:"log",embeddedScopes:[]},"source.logo":{id:"logo",embeddedScopes:[]},"source.lua":{id:"lua",embeddedScopes:["source.c"]},"source.luau":{id:"luau",embeddedScopes:[]},"source.makefile":{id:"make",embeddedScopes:[]},"text.html.markdown":{id:"markdown",embeddedScopes:["source.css","text.html.basic","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","text.git-commit","text.git-rebase","source.go","source.groovy","text.pug","source.js","source.json","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.regexp.python","source.rust","source.scala","source.shell","source.ts","source.tsx","source.cs","source.fsharp","source.dart","text.html.handlebars","text.log","source.erlang","source.elixir","text.tex.latex","text.bibtex","text.html.derivative"]},"text.marko":{id:"marko",embeddedScopes:["source.css","source.css.less","source.css.scss","source.js"]},"source.matlab":{id:"matlab",embeddedScopes:[]},"text.markdown.mdc":{id:"mdc",embeddedScopes:["text.html.markdown","source.yaml","text.html.derivative"]},"source.mdx":{id:"mdx",embeddedScopes:["source.tsx","source.toml","source.yaml","source.c","source.clojure","source.coffee","source.cpp","source.cs","source.css","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.graphql","source.haskell","text.html.basic","source.ini","source.java","source.js","source.json","source.julia","source.kotlin","source.css.less","source.lua","source.makefile","text.html.markdown","source.objc","source.perl","source.python","source.r","source.ruby","source.rust","source.scala","source.css.scss","source.shell","text.shell-session","source.sql","text.xml","source.swift","source.ts"]},"markdown.mermaid.codeblock":{id:"mermaid",embeddedScopes:[]},"source.mojo":{id:"mojo",embeddedScopes:[]},"source.move":{id:"move",embeddedScopes:[]},"source.narrat":{id:"narrat",embeddedScopes:[]},"source.nextflow":{id:"nextflow",embeddedScopes:[]},"source.nginx":{id:"nginx",embeddedScopes:["source.lua"]},"source.nim":{id:"nim",embeddedScopes:["source.c","text.html.basic","text.xml","source.js","source.css","source.glsl","text.html.markdown"]},"source.nix":{id:"nix",embeddedScopes:[]},"source.nushell":{id:"nushell",embeddedScopes:[]},"source.objc":{id:"objective-c",embeddedScopes:[]},"source.objcpp":{id:"objective-cpp",embeddedScopes:[]},"source.ocaml":{id:"ocaml",embeddedScopes:[]},"source.pascal":{id:"pascal",embeddedScopes:[]},"source.perl":{id:"perl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.sql"]},"source.php":{id:"php",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.plsql.oracle":{id:"plsql",embeddedScopes:[]},"source.po":{id:"po",embeddedScopes:[]},"source.css.postcss":{id:"postcss",embeddedScopes:[]},"source.powerquery":{id:"powerquery",embeddedScopes:[]},"source.powershell":{id:"powershell",embeddedScopes:[]},"source.prisma":{id:"prisma",embeddedScopes:[]},"source.prolog":{id:"prolog",embeddedScopes:[]},"source.proto":{id:"proto",embeddedScopes:[]},"text.pug":{id:"pug",embeddedScopes:["source.js","source.css","source.sass","source.css.scss","source.stylus","source.coffee","text.html.basic"]},"source.puppet":{id:"puppet",embeddedScopes:[]},"source.purescript":{id:"purescript",embeddedScopes:[]},"source.python":{id:"python",embeddedScopes:[]},"source.qml":{id:"qml",embeddedScopes:["source.js"]},"source.qmldir":{id:"qmldir",embeddedScopes:[]},"source.qss":{id:"qss",embeddedScopes:[]},"source.r":{id:"r",embeddedScopes:[]},"source.racket":{id:"racket",embeddedScopes:[]},"source.perl.6":{id:"raku",embeddedScopes:[]},"text.aspnetcorerazor":{id:"razor",embeddedScopes:["text.html.basic","source.cs"]},"source.reg":{id:"reg",embeddedScopes:[]},"source.regexp.python":{id:"regexp",embeddedScopes:[]},"source.rel":{id:"rel",embeddedScopes:[]},"source.riscv":{id:"riscv",embeddedScopes:[]},"source.rst":{id:"rst",embeddedScopes:["text.html.derivative","source.cpp","source.python","source.js","source.shell","source.yaml","source.cmake","source.ruby"]},"source.ruby":{id:"ruby",embeddedScopes:["text.html.basic","text.xml","source.sql","source.css","source.c","source.js","source.shell","source.lua"]},"source.rust":{id:"rust",embeddedScopes:[]},"source.sas":{id:"sas",embeddedScopes:["source.sql"]},"source.sass":{id:"sass",embeddedScopes:[]},"source.scala":{id:"scala",embeddedScopes:[]},"source.scheme":{id:"scheme",embeddedScopes:[]},"source.css.scss":{id:"scss",embeddedScopes:["source.css"]},"source.shaderlab":{id:"shaderlab",embeddedScopes:["source.hlsl"]},"source.shell":{id:"shellscript",embeddedScopes:[]},"text.shell-session":{id:"shellsession",embeddedScopes:["source.shell"]},"source.smalltalk":{id:"smalltalk",embeddedScopes:[]},"source.solidity":{id:"solidity",embeddedScopes:[]},"text.html.soy":{id:"soy",embeddedScopes:["text.html.basic"]},"source.sparql":{id:"sparql",embeddedScopes:["source.turtle"]},"source.splunk_search":{id:"splunk",embeddedScopes:[]},"source.sql":{id:"sql",embeddedScopes:[]},"source.ssh-config":{id:"ssh-config",embeddedScopes:[]},"source.stata":{id:"stata",embeddedScopes:["source.sql"]},"source.stylus":{id:"stylus",embeddedScopes:[]},"source.svelte":{id:"svelte",embeddedScopes:["source.js","source.ts","source.coffee","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","text.pug","text.html.markdown"]},"source.swift":{id:"swift",embeddedScopes:[]},"source.systemverilog":{id:"system-verilog",embeddedScopes:[]},"source.systemd":{id:"systemd",embeddedScopes:[]},"source.tasl":{id:"tasl",embeddedScopes:[]},"source.tcl":{id:"tcl",embeddedScopes:[]},"source.templ":{id:"templ",embeddedScopes:["source.go","source.js","source.css"]},"source.hcl.terraform":{id:"terraform",embeddedScopes:[]},"text.tex":{id:"tex",embeddedScopes:["source.r"]},"source.toml":{id:"toml",embeddedScopes:[]},"source.ts.tags":{id:"ts-tags",embeddedScopes:["source.ts"]},"text.tsv":{id:"tsv",embeddedScopes:[]},"source.tsx":{id:"tsx",embeddedScopes:[]},"source.turtle":{id:"turtle",embeddedScopes:[]},"text.html.twig":{id:"twig",embeddedScopes:["source.css","source.js","source.css.scss","source.php","source.python","source.ruby"]},"source.txt":{id:"txt",embeddedScopes:[]},"source.ts":{id:"typescript",embeddedScopes:[]},"source.tsp":{id:"typespec",embeddedScopes:[]},"source.typst":{id:"typst",embeddedScopes:[]},"source.v":{id:"v",embeddedScopes:[]},"source.vala":{id:"vala",embeddedScopes:[]},"source.asp.vb.net":{id:"vb",embeddedScopes:[]},"source.verilog":{id:"verilog",embeddedScopes:[]},"source.vhdl":{id:"vhdl",embeddedScopes:[]},"source.viml":{id:"viml",embeddedScopes:[]},"source.vue":{id:"vue",embeddedScopes:["text.html.basic","text.html.markdown","text.pug","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.js","source.ts","source.js.jsx","source.tsx","source.coffee","source.json","source.json.comments","source.json5","source.yaml","source.toml","source.graphql","text.html.derivative"]},"text.html.vue-html":{id:"vue-html",embeddedScopes:["source.vue","source.js"]},"source.vyper":{id:"vyper",embeddedScopes:[]},"source.wat":{id:"wasm",embeddedScopes:[]},"source.wenyan":{id:"wenyan",embeddedScopes:[]},"source.wgsl":{id:"wgsl",embeddedScopes:[]},"source.wikitext":{id:"wikitext",embeddedScopes:["text.html.basic","source.css","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","source.go","source.groovy","text.pug","source.js","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.rust","source.scala","source.shell","source.ts","source.cs","source.fsharp","source.dart","text.html.handlebars","text.html.markdown","source.erlang","source.elixir","text.tex.latex","text.bibtex","source.json"]},"source.wolfram":{id:"wolfram",embeddedScopes:[]},"text.xml":{id:"xml",embeddedScopes:["source.java"]},"text.xml.xsl":{id:"xsl",embeddedScopes:["text.xml"]},"source.yaml":{id:"yaml",embeddedScopes:[]},"source.zenscript":{id:"zenscript",embeddedScopes:[]},"source.zig":{id:"zig",embeddedScopes:[]}};var N={d:(A,B)=>{for(var Q in B)N.o(B,Q)&&!N.o(A,Q)&&Object.defineProperty(A,Q,{enumerable:!0,get:B[Q]})},o:(A,B)=>Object.prototype.hasOwnProperty.call(A,B)},r={};N.d(r,{_X:()=>XA,Bz:()=>TA,ot:()=>WA,u:()=>bA,jG:()=>K,Pn:()=>vA});const H="undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG;var L;function k(A,B){const Q=[],g=function(A){let B=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,Q=B.exec(A);return{next:()=>{if(!Q)return null;const g=Q[0];return Q=B.exec(A),g}}}(A);let E=g.next();for(;null!==E;){let A=0;if(2===E.length&&":"===E.charAt(1)){switch(E.charAt(0)){case"R":A=1;break;case"L":A=-1;break;default:console.log(`Unknown priority ${E} in scope selector`)}E=g.next()}let B=I();if(Q.push({matcher:B,priority:A}),","!==E)break;E=g.next()}return Q;function C(){if("-"===E){E=g.next();const A=C();return B=>!!A&&!A(B)}if("("===E){E=g.next();const A=function(){const A=[];let B=I();for(;B&&(A.push(B),"|"===E||","===E);){do{E=g.next()}while("|"===E||","===E);B=I()}return B=>A.some((A=>A(B)))}();return")"===E&&(E=g.next()),A}if(R(E)){const A=[];do{A.push(E),E=g.next()}while(R(E));return Q=>B(A,Q)}return null}function I(){const A=[];let B=C();for(;B;)A.push(B),B=C();return B=>A.every((A=>A(B)))}}function R(A){return!!A&&!!A.match(/[\w\.:]+/)}function K(A){"function"==typeof A.dispose&&A.dispose()}function Y(A){return Array.isArray(A)?function(A){let B=[];for(let Q=0,g=A.length;Q{for(let Q in B)A[Q]=B[Q]})),A}function P(A){const B=~A.lastIndexOf("/")||~A.lastIndexOf("\\");return 0===B?A:~B==A.length-1?P(A.substring(0,A.length-1)):A.substr(1+~B)}!function(A){A.toBinaryStr=function(A){let B=A.toString(2);for(;B.length<32;)B="0"+B;return B},A.print=function(B){const Q=A.getLanguageId(B),g=A.getTokenType(B),E=A.getFontStyle(B),C=A.getForeground(B),I=A.getBackground(B);console.log({languageId:Q,tokenType:g,fontStyle:E,foreground:C,background:I})},A.getLanguageId=function(A){return(255&A)>>>0},A.getTokenType=function(A){return(768&A)>>>8},A.containsBalancedBrackets=function(A){return 0!=(1024&A)},A.getFontStyle=function(A){return(30720&A)>>>11},A.getForeground=function(A){return(16744448&A)>>>15},A.getBackground=function(A){return(4278190080&A)>>>24},A.set=function(B,Q,g,E,C,I,D){let w=A.getLanguageId(B),o=A.getTokenType(B),s=A.containsBalancedBrackets(B)?1:0,e=A.getFontStyle(B),c=A.getForeground(B),i=A.getBackground(B);return 0!==Q&&(w=Q),8!==g&&(o=g),null!==E&&(s=E?1:0),-1!==C&&(e=C),0!==I&&(c=I),0!==D&&(i=D),(w<<0|o<<8|s<<10|e<<11|c<<15|i<<24)>>>0}}(L||(L={}));let u=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;class y{static hasCaptures(A){return null!==A&&(u.lastIndex=0,u.test(A))}static replaceCaptures(A,B,Q){return A.replace(u,((A,g,E,C)=>{let I=Q[parseInt(g||E,10)];if(!I)return A;{let A=B.substring(I.start,I.end);for(;"."===A[0];)A=A.substring(1);switch(C){case"downcase":return A.toLowerCase();case"upcase":return A.toUpperCase();default:return A}}}))}}function J(A,B){return AB?1:0}function S(A,B){if(null===A&&null===B)return 0;if(!A)return-1;if(!B)return 1;let Q=A.length,g=B.length;if(Q===g){for(let g=0;g`);return}const C=Q.lookup(B);A instanceof x?T({baseGrammar:C,selfGrammar:E},g):W(A.ruleName,{baseGrammar:C,selfGrammar:E,repository:E.repository},g);const I=Q.injections(A.scopeName);if(I)for(const A of I)g.add(new x(A))}function W(A,B,Q){B.repository&&B.repository[A]&&X([B.repository[A]],B,Q)}function T(A,B){A.selfGrammar.patterns&&Array.isArray(A.selfGrammar.patterns)&&X(A.selfGrammar.patterns,{...A,repository:A.selfGrammar.repository},B),A.selfGrammar.injections&&X(Object.values(A.selfGrammar.injections),{...A,repository:A.selfGrammar.repository},B)}function X(A,B,Q){for(const g of A){if(Q.visitedRule.has(g))continue;Q.visitedRule.add(g);const A=g.repository?U({},B.repository,g.repository):B.repository;Array.isArray(g.patterns)&&X(g.patterns,{...B,repository:A},Q);const E=g.include;if(!E)continue;const C=_(E);switch(C.kind){case 0:T({...B,selfGrammar:B.baseGrammar},Q);break;case 1:T(B,Q);break;case 2:W(C.ruleName,{...B,repository:A},Q);break;case 3:case 4:const g=C.scopeName===B.selfGrammar.scopeName?B.selfGrammar:C.scopeName===B.baseGrammar.scopeName?B.baseGrammar:void 0;if(g){const E={baseGrammar:B.baseGrammar,selfGrammar:g,repository:A};4===C.kind?W(C.ruleName,E,Q):T(E,Q)}else 4===C.kind?Q.add(new O(C.scopeName,C.ruleName)):Q.add(new x(C.scopeName))}}}class v{constructor(){this.kind=0}}class Z{constructor(){this.kind=1}}class j{constructor(A){this.ruleName=A,this.kind=2}}class V{constructor(A){this.scopeName=A,this.kind=3}}class z{constructor(A,B){this.scopeName=A,this.ruleName=B,this.kind=4}}function _(A){if("$base"===A)return new v;if("$self"===A)return new Z;const B=A.indexOf("#");if(-1===B)return new V(A);if(0===B)return new j(A.substring(1));{const Q=A.substring(0,B),g=A.substring(B+1);return new z(Q,g)}}const $=/\\(\d+)/,AA=/\\(\d+)/g;class BA{constructor(A,B,Q,g){this.$location=A,this.id=B,this._name=Q||null,this._nameIsCapturing=y.hasCaptures(this._name),this._contentName=g||null,this._contentNameIsCapturing=y.hasCaptures(this._contentName)}get debugName(){const A=this.$location?`${P(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${A}`}getName(A,B){return this._nameIsCapturing&&null!==this._name&&null!==A&&null!==B?y.replaceCaptures(this._name,A,B):this._name}getContentName(A,B){return this._contentNameIsCapturing&&null!==this._contentName?y.replaceCaptures(this._contentName,A,B):this._contentName}}class QA extends BA{constructor(A,B,Q,g,E){super(A,B,Q,g),this.retokenizeCapturedWithRuleId=E}dispose(){}collectPatterns(A,B){throw new Error("Not supported!")}compile(A,B){throw new Error("Not supported!")}compileAG(A,B,Q,g){throw new Error("Not supported!")}}class gA extends BA{constructor(A,B,Q,g,E){super(A,B,Q,null),this._match=new wA(g,this.id),this.captures=E,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(A,B){B.push(this._match)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oA,this.collectPatterns(A,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class EA extends BA{constructor(A,B,Q,g,E){super(A,B,Q,g),this.patterns=E.patterns,this.hasMissingPatterns=E.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(A,B){for(const Q of this.patterns)A.getRule(Q).collectPatterns(A,B)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oA,this.collectPatterns(A,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class CA extends BA{constructor(A,B,Q,g,E,C,I,D,w,o){super(A,B,Q,g),this._begin=new wA(E,this.id),this.beginCaptures=C,this._end=new wA(I||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=D,this.applyEndPatternLast=w||!1,this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(A,B){return this._end.resolveBackReferences(A,B)}collectPatterns(A,B){B.push(this._begin)}compile(A,B){return this._getCachedCompiledPatterns(A,B).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A,B).compileAG(A,Q,g)}_getCachedCompiledPatterns(A,B){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oA;for(const B of this.patterns)A.getRule(B).collectPatterns(A,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,B):this._cachedCompiledPatterns.setSource(0,B)),this._cachedCompiledPatterns}}class IA extends BA{constructor(A,B,Q,g,E,C,I,D,w){super(A,B,Q,g),this._begin=new wA(E,this.id),this.beginCaptures=C,this.whileCaptures=D,this._while=new wA(I,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=w.patterns,this.hasMissingPatterns=w.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(A,B){return this._while.resolveBackReferences(A,B)}collectPatterns(A,B){B.push(this._begin)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oA;for(const B of this.patterns)A.getRule(B).collectPatterns(A,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(A,B){return this._getCachedCompiledWhilePatterns(A,B).compile(A)}compileWhileAG(A,B,Q,g){return this._getCachedCompiledWhilePatterns(A,B).compileAG(A,Q,g)}_getCachedCompiledWhilePatterns(A,B){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new oA,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,B||"￿"),this._cachedCompiledWhilePatterns}}class DA{static createCaptureRule(A,B,Q,g,E){return A.registerRule((A=>new QA(B,A,Q,g,E)))}static getCompiledRuleId(A,B,Q){return A.id||B.registerRule((g=>{if(A.id=g,A.match)return new gA(A.$vscodeTextmateLocation,A.id,A.name,A.match,DA._compileCaptures(A.captures,B,Q));if(void 0===A.begin){A.repository&&(Q=U({},Q,A.repository));let g=A.patterns;return void 0===g&&A.include&&(g=[{include:A.include}]),new EA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,DA._compilePatterns(g,B,Q))}return A.while?new IA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,A.begin,DA._compileCaptures(A.beginCaptures||A.captures,B,Q),A.while,DA._compileCaptures(A.whileCaptures||A.captures,B,Q),DA._compilePatterns(A.patterns,B,Q)):new CA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,A.begin,DA._compileCaptures(A.beginCaptures||A.captures,B,Q),A.end,DA._compileCaptures(A.endCaptures||A.captures,B,Q),A.applyEndPatternLast,DA._compilePatterns(A.patterns,B,Q))})),A.id}static _compileCaptures(A,B,Q){let g=[];if(A){let E=0;for(const B in A){if("$vscodeTextmateLocation"===B)continue;const A=parseInt(B,10);A>E&&(E=A)}for(let A=0;A<=E;A++)g[A]=null;for(const E in A){if("$vscodeTextmateLocation"===E)continue;const C=parseInt(E,10);let I=0;A[E].patterns&&(I=DA.getCompiledRuleId(A[E],B,Q)),g[C]=DA.createCaptureRule(B,A[E].$vscodeTextmateLocation,A[E].name,A[E].contentName,I)}}return g}static _compilePatterns(A,B,Q){let g=[];if(A)for(let E=0,C=A.length;EA.substring(B.start,B.end)));return AA.lastIndex=0,this.source.replace(AA,((A,B)=>l(Q[parseInt(B,10)]||"")))}_buildAnchorCache(){let A,B,Q,g,E=[],C=[],I=[],D=[];for(A=0,B=this.source.length;AA.source));this._cached=new sA(A,B,this._items.map((A=>A.ruleId)))}return this._cached}compileAG(A,B,Q){return this._hasAnchors?B?Q?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(A,B,Q)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(A,B,Q)),this._anchorCache.A1_G0):Q?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(A,B,Q)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(A,B,Q)),this._anchorCache.A0_G0):this.compile(A)}_resolveAnchors(A,B,Q){let g=this._items.map((A=>A.resolveAnchors(B,Q)));return new sA(A,g,this._items.map((A=>A.ruleId)))}}class sA{constructor(A,B,Q){this.regExps=B,this.rules=Q,this.scanner=A.createOnigScanner(B)}dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const A=[];for(let B=0,Q=this.rules.length;Bthis._root.match(A)))}static createFromRawTheme(A,B){return this.createFromParsedTheme(function(A){if(!A)return[];if(!A.settings||!Array.isArray(A.settings))return[];let B=A.settings,Q=[],g=0;for(let A=0,E=B.length;A1&&(s=C.slice(0,C.length-1),s.reverse()),Q[g++]=new MA(o,s,A,I,D,w)}}return Q}(A),B)}static createFromParsedTheme(A,B){return function(A,B){A.sort(((A,B)=>{let Q=J(A.scope,B.scope);return 0!==Q?Q:(Q=S(A.parentScopes,B.parentScopes),0!==Q?Q:A.index-B.index)}));let Q=0,g="#000000",E="#ffffff";for(;A.length>=1&&""===A[0].scope;){let B=A.shift();-1!==B.fontStyle&&(Q=B.fontStyle),null!==B.foreground&&(g=B.foreground),null!==B.background&&(E=B.background)}let C=new hA(B),I=new tA(Q,C.getId(g),C.getId(E)),D=new GA(new FA(0,null,-1,0,0),[]);for(let B=0,Q=A.length;Bfunction(A,B){if(null===B)return!0;let Q=0,g=B[Q];for(;A;){if(iA(A.scopeName,g)){if(Q++,Q===B.length)return!0;g=B[Q]}A=A.parent}return!1}(A.parent,B.parentScopes)));return Q?new tA(Q.fontStyle,Q.foreground,Q.background):null}}class cA{constructor(A,B){this.parent=A,this.scopeName=B}static push(A,B){for(const Q of B)A=new cA(A,Q);return A}static from(...A){let B=null;for(let Q=0;QA?console.log("how did this happen?"):this.scopeDepth=A,-1!==B&&(this.fontStyle=B),0!==Q&&(this.foreground=Q),0!==g&&(this.background=g)}}class GA{constructor(A,B=[],Q={}){this._mainRule=A,this._children=Q,this._rulesWithParentScopes=B}static _sortBySpecificity(A){return 1===A.length||A.sort(this._cmpBySpecificity),A}static _cmpBySpecificity(A,B){if(A.scopeDepth===B.scopeDepth){const Q=A.parentScopes,g=B.parentScopes;let E=null===Q?0:Q.length,C=null===g?0:g.length;if(E===C)for(let A=0;A{const B=this._scopeToLanguage(A),Q=this._toStandardTokenType(A);return new aA(B,Q)})),this._defaultAttributes=new aA(A,8),this._embeddedLanguagesMatcher=new NA(Object.entries(B||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(A){return null===A?nA._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(A)}_scopeToLanguage(A){return this._embeddedLanguagesMatcher.match(A)||0}_toStandardTokenType(A){const B=A.match(nA.STANDARD_TOKEN_TYPE_REGEXP);if(!B)return 8;switch(B[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}}nA._NULL_SCOPE_METADATA=new aA(0,0),nA.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class NA{constructor(A){if(0===A.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(A);const B=A.map((([A,B])=>l(A)));B.sort(),B.reverse(),this.scopesRegExp=new RegExp(`^((${B.join(")|(")}))($|\\.)`,"")}}match(A){if(!this.scopesRegExp)return;const B=A.match(this.scopesRegExp);return B?this.values.get(B[1]):void 0}}class rA{constructor(A,B){this.stack=A,this.stoppedEarly=B}}function HA(A,B,Q,g,E,C,I,D){const w=B.content.length;let o=!1,s=-1;if(I){const I=function(A,B,Q,g,E,C){let I=E.beginRuleCapturedEOL?0:-1;const D=[];for(let B=E;B;B=B.pop()){const Q=B.getRule(A);Q instanceof IA&&D.push({rule:Q,stack:B})}for(let w=D.pop();w;w=D.pop()){const{ruleScanner:D,findOptions:o}=kA(w.rule,A,w.stack.endRule,Q,g===I),s=D.findNextMatchSync(B,g,o);if(H&&(console.log(" scanning for while rule"),console.log(D.toString())),!s){H&&console.log(" popping "+w.rule.debugName+" - "+w.rule.debugWhileRegExp),E=w.stack.pop();break}if(-2!==s.ruleId){E=w.stack.pop();break}s.captureIndices&&s.captureIndices.length&&(C.produce(w.stack,s.captureIndices[0].start),RA(A,B,Q,w.stack,C,w.rule.whileCaptures,s.captureIndices),C.produce(w.stack,s.captureIndices[0].end),I=s.captureIndices[0].end,s.captureIndices[0].end>g&&(g=s.captureIndices[0].end,Q=!1))}return{stack:E,linePos:g,anchorPosition:I,isFirstLine:Q}}(A,B,Q,g,E,C);E=I.stack,g=I.linePos,Q=I.isFirstLine,s=I.anchorPosition}const e=Date.now();for(;!o;){if(0!==D&&Date.now()-e>D)return new rA(E,!0);c()}return new rA(E,!1);function c(){H&&(console.log(""),console.log(`@@scanNext ${g}: |${B.content.substr(g).replace(/\n$/,"\\n")}|`));const I=function(A,B,Q,g,E,C){const I=function(A,B,Q,g,E,C){const I=E.getRule(A),{ruleScanner:D,findOptions:w}=LA(I,A,E.endRule,Q,g===C);let o=0;H&&(o=f());const s=D.findNextMatchSync(B,g,w);if(H){const A=f()-o;A>5&&console.warn(`Rule ${I.debugName} (${I.id}) matching took ${A} against '${B}'`),console.log(` scanning for (linePos: ${g}, anchorPosition: ${C})`),console.log(D.toString()),s&&console.log(`matched rule id: ${s.ruleId} from ${s.captureIndices[0].start} to ${s.captureIndices[0].end}`)}return s?{captureIndices:s.captureIndices,matchedRuleId:s.ruleId}:null}(A,B,Q,g,E,C),D=A.getInjections();if(0===D.length)return I;const w=function(A,B,Q,g,E,C,I){let D,w=Number.MAX_VALUE,o=null,s=0;const e=C.contentNameScopesList.getScopeNames();for(let C=0,c=A.length;C=w)&&(w=F,o=h.captureIndices,D=h.ruleId,s=c.priority,w===E))break}return o?{priorityMatch:-1===s,captureIndices:o,matchedRuleId:D}:null}(D,A,B,Q,g,E,C);if(!w)return I;if(!I)return w;const o=I.captureIndices[0].start,s=w.captureIndices[0].start;return s0)&&D[0].end>g;if(-1===e){const I=E.getRule(A);H&&console.log(" popping "+I.debugName+" - "+I.debugEndRegExp),C.produce(E,D[0].start),E=E.withContentNameScopesList(E.nameScopesList),RA(A,B,Q,E,C,I.endCaptures,D),C.produce(E,D[0].end);const e=E;if(E=E.parent,s=e.getAnchorPos(),!c&&e.getEnterPos()===g)return H&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),E=e,C.produce(E,w),void(o=!0)}else{const I=A.getRule(e);C.produce(E,D[0].start);const i=E,t=I.getName(B.content,D),M=E.contentNameScopesList.pushAttributed(t,A);if(E=E.push(e,g,s,D[0].end===w,null,M,M),I instanceof CA){const g=I;H&&console.log(" pushing "+g.debugName+" - "+g.debugBeginRegExp),RA(A,B,Q,E,C,g.beginCaptures,D),C.produce(E,D[0].end),s=D[0].end;const e=g.getContentName(B.content,D),t=M.pushAttributed(e,A);if(E=E.withContentNameScopesList(t),g.endHasBackReferences&&(E=E.withEndRule(g.getEndWithResolvedBackReferences(B.content,D))),!c&&i.hasSameRuleAs(E))return H&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),E=E.pop(),C.produce(E,w),void(o=!0)}else if(I instanceof IA){const g=I;H&&console.log(" pushing "+g.debugName),RA(A,B,Q,E,C,g.beginCaptures,D),C.produce(E,D[0].end),s=D[0].end;const e=g.getContentName(B.content,D),t=M.pushAttributed(e,A);if(E=E.withContentNameScopesList(t),g.whileHasBackReferences&&(E=E.withEndRule(g.getWhileWithResolvedBackReferences(B.content,D))),!c&&i.hasSameRuleAs(E))return H&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),E=E.pop(),C.produce(E,w),void(o=!0)}else{const g=I;if(H&&console.log(" matched "+g.debugName+" - "+g.debugMatchRegExp),RA(A,B,Q,E,C,g.captures,D),C.produce(E,D[0].end),E=E.pop(),!c)return H&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),E=E.safePop(),C.produce(E,w),void(o=!0)}}D[0].end>g&&(g=D[0].end,Q=!1)}}function LA(A,B,Q,g,E){return{ruleScanner:A.compileAG(B,Q,g,E),findOptions:0}}function kA(A,B,Q,g,E){return{ruleScanner:A.compileWhileAG(B,Q,g,E),findOptions:0}}function RA(A,B,Q,g,E,C,I){if(0===C.length)return;const D=B.content,w=Math.min(C.length,I.length),o=[],s=I[0].end;for(let B=0;Bs)break;for(;o.length>0&&o[o.length-1].endPos<=e.start;)E.produceFromScopes(o[o.length-1].scopes,o[o.length-1].endPos),o.pop();if(o.length>0?E.produceFromScopes(o[o.length-1].scopes,e.start):E.produce(g,e.start),w.retokenizeCapturedWithRuleId){const B=w.getName(D,I),C=g.contentNameScopesList.pushAttributed(B,A),o=w.getContentName(D,I),s=C.pushAttributed(o,A),c=g.push(w.retokenizeCapturedWithRuleId,e.start,-1,!1,null,C,s),i=A.createOnigString(D.substring(0,e.end));HA(A,i,Q&&0===e.start,e.start,c,E,!1,0),K(i);continue}const c=w.getName(D,I);if(null!==c){const B=(o.length>0?o[o.length-1].scopes:g.contentNameScopesList).pushAttributed(c,A);o.push(new KA(B,e.end))}}for(;o.length>0;)E.produceFromScopes(o[o.length-1].scopes,o[o.length-1].endPos),o.pop()}class KA{constructor(A,B){this.scopes=A,this.endPos=B}}function YA(A,B,Q,g,E){const C=k(B,UA),I=DA.getCompiledRuleId(Q,g,E.repository);for(const Q of C)A.push({debugSelector:B,matcher:Q.matcher,ruleId:I,grammar:E,priority:Q.priority})}function UA(A,B){if(B.length{for(let g=Q;gQ&&A.substr(0,Q)===B&&"."===A[Q]}class uA{constructor(A,B,Q,g,E,C,I,D){if(this._rootScopeName=A,this.balancedBracketSelectors=C,this._onigLib=D,this._basicScopeAttributesProvider=new nA(Q,g),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=I,this._grammar=yA(B,null),this._injections=null,this._tokenTypeMatchers=[],E)for(const A of Object.keys(E)){const B=k(A,UA);for(const Q of B)this._tokenTypeMatchers.push({matcher:Q.matcher,type:E[A]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const A of this._ruleId2desc)A&&A.dispose()}createOnigScanner(A){return this._onigLib.createOnigScanner(A)}createOnigString(A){return this._onigLib.createOnigString(A)}getMetadataForScope(A){return this._basicScopeAttributesProvider.getBasicScopeAttributes(A)}_collectInjections(){const A=[],B=this._rootScopeName,Q=(A=>A===this._rootScopeName?this._grammar:this.getExternalGrammar(A))(B);if(Q){const g=Q.injections;if(g)for(let B in g)YA(A,B,g[B],this,Q);const E=this._grammarRepository.injections(B);E&&E.forEach((B=>{const Q=this.getExternalGrammar(B);if(Q){const B=Q.injectionSelector;B&&YA(A,B,Q,this,Q)}}))}return A.sort(((A,B)=>A.priority-B.priority)),A}getInjections(){if(null===this._injections&&(this._injections=this._collectInjections(),H&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const A of this._injections)console.log(` - ${A.debugSelector}`)}return this._injections}registerRule(A){const B=++this._lastRuleId,Q=A(B);return this._ruleId2desc[B]=Q,Q}getRule(A){return this._ruleId2desc[A]}getExternalGrammar(A,B){if(this._includedGrammars[A])return this._includedGrammars[A];if(this._grammarRepository){const Q=this._grammarRepository.lookup(A);if(Q)return this._includedGrammars[A]=yA(Q,B&&B.$base),this._includedGrammars[A]}}tokenizeLine(A,B,Q=0){const g=this._tokenize(A,B,!1,Q);return{tokens:g.lineTokens.getResult(g.ruleStack,g.lineLength),ruleStack:g.ruleStack,stoppedEarly:g.stoppedEarly}}tokenizeLine2(A,B,Q=0){const g=this._tokenize(A,B,!0,Q);return{tokens:g.lineTokens.getBinaryResult(g.ruleStack,g.lineLength),ruleStack:g.ruleStack,stoppedEarly:g.stoppedEarly}}_tokenize(A,B,Q,g){let E;if(-1===this._rootId&&(this._rootId=DA.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),B&&B!==SA.NULL)E=!1,B.reset();else{E=!0;const A=this._basicScopeAttributesProvider.getDefaultAttributes(),Q=this.themeProvider.getDefaults(),g=L.set(0,A.languageId,A.tokenType,null,Q.fontStyle,Q.foregroundId,Q.backgroundId),C=this.getRule(this._rootId).getName(null,null);let I;I=C?JA.createRootAndLookUpScopeName(C,g,this):JA.createRoot("unknown",g),B=new SA(null,this._rootId,-1,-1,!1,null,I,I)}A+="\n";const C=this.createOnigString(A),I=C.content.length,D=new lA(Q,A,this._tokenTypeMatchers,this.balancedBracketSelectors),w=HA(this,C,E,0,B,D,!0,g);return K(C),{lineLength:I,lineTokens:D,ruleStack:w.stack,stoppedEarly:w.stoppedEarly}}}function yA(A,B){return(A=Y(A)).repository=A.repository||{},A.repository.$self={$vscodeTextmateLocation:A.$vscodeTextmateLocation,patterns:A.patterns,name:A.scopeName},A.repository.$base=B||A.repository.$self,A}class JA{constructor(A,B,Q){this.parent=A,this.scopePath=B,this.tokenAttributes=Q}static fromExtension(A,B){let Q=A,g=A?.scopePath??null;for(const A of B)g=cA.push(g,A.scopeNames),Q=new JA(Q,g,A.encodedTokenAttributes);return Q}static createRoot(A,B){return new JA(null,new cA(null,A),B)}static createRootAndLookUpScopeName(A,B,Q){const g=Q.getMetadataForScope(A),E=new cA(null,A),C=Q.themeProvider.themeMatch(E),I=JA.mergeAttributes(B,g,C);return new JA(null,E,I)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(A){return JA.equals(this,A)}static equals(A,B){for(;;){if(A===B)return!0;if(!A&&!B)return!0;if(!A||!B)return!1;if(A.scopeName!==B.scopeName||A.tokenAttributes!==B.tokenAttributes)return!1;A=A.parent,B=B.parent}}static mergeAttributes(A,B,Q){let g=-1,E=0,C=0;return null!==Q&&(g=Q.fontStyle,E=Q.foregroundId,C=Q.backgroundId),L.set(A,B.languageId,B.tokenType,null,g,E,C)}pushAttributed(A,B){if(null===A)return this;if(-1===A.indexOf(" "))return JA._pushAttributed(this,A,B);const Q=A.split(/ /g);let g=this;for(const A of Q)g=JA._pushAttributed(g,A,B);return g}static _pushAttributed(A,B,Q){const g=Q.getMetadataForScope(B),E=A.scopePath.push(B),C=Q.themeProvider.themeMatch(E),I=JA.mergeAttributes(A.tokenAttributes,g,C);return new JA(A,E,I)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(A){const B=[];let Q=this;for(;Q&&Q!==A;)B.push({encodedTokenAttributes:Q.tokenAttributes,scopeNames:Q.scopePath.getExtensionIfDefined(Q.parent?.scopePath??null)}),Q=Q.parent;return Q===A?B.reverse():void 0}}class SA{constructor(A,B,Q,g,E,C,I,D){this.parent=A,this.ruleId=B,this.beginRuleCapturedEOL=E,this.endRule=C,this.nameScopesList=I,this.contentNameScopesList=D,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=Q,this._anchorPos=g}equals(A){return null!==A&&SA._equals(this,A)}static _equals(A,B){return A===B||!!this._structuralEquals(A,B)&&JA.equals(A.contentNameScopesList,B.contentNameScopesList)}static _structuralEquals(A,B){for(;;){if(A===B)return!0;if(!A&&!B)return!0;if(!A||!B)return!1;if(A.depth!==B.depth||A.ruleId!==B.ruleId||A.endRule!==B.endRule)return!1;A=A.parent,B=B.parent}}clone(){return this}static _reset(A){for(;A;)A._enterPos=-1,A._anchorPos=-1,A=A.parent}reset(){SA._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(A,B,Q,g,E,C,I){return new SA(this,A,B,Q,g,E,C,I)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(A){return A.getRule(this.ruleId)}toString(){const A=[];return this._writeString(A,0),"["+A.join(",")+"]"}_writeString(A,B){return this.parent&&(B=this.parent._writeString(A,B)),A[B++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,B}withContentNameScopesList(A){return this.contentNameScopesList===A?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,A)}withEndRule(A){return this.endRule===A?this:new SA(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,A,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(A){let B=this;for(;B&&B._enterPos===A._enterPos;){if(B.ruleId===A.ruleId)return!0;B=B.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(A,B){const Q=JA.fromExtension(A?.nameScopesList??null,B.nameScopesList);return new SA(A,B.ruleId,B.enterPos??-1,B.anchorPos??-1,B.beginRuleCapturedEOL,B.endRule,Q,JA.fromExtension(Q,B.contentNameScopesList))}}SA.NULL=new SA(null,0,0,0,!1,null,null,null);class dA{constructor(A,B){this.allowAny=!1,this.balancedBracketScopes=A.flatMap((A=>"*"===A?(this.allowAny=!0,[]):k(A,UA).map((A=>A.matcher)))),this.unbalancedBracketScopes=B.flatMap((A=>k(A,UA).map((A=>A.matcher))))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(A){for(const B of this.unbalancedBracketScopes)if(B(A))return!1;for(const B of this.balancedBracketScopes)if(B(A))return!0;return this.allowAny}}class lA{constructor(A,B,Q,g){this.balancedBracketSelectors=g,this._emitBinaryTokens=A,this._tokenTypeOverrides=Q,this._lineText=H?B:null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(A,B){this.produceFromScopes(A.contentNameScopesList,B)}produceFromScopes(A,B){if(this._lastTokenEndIndex>=B)return;if(this._emitBinaryTokens){let Q=A?.tokenAttributes??0,g=!1;if(this.balancedBracketSelectors?.matchesAlways&&(g=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const B=A?.getScopeNames()??[];for(const A of this._tokenTypeOverrides)A.matcher(B)&&(Q=L.set(Q,0,A.type,null,-1,0,0));this.balancedBracketSelectors&&(g=this.balancedBracketSelectors.match(B))}if(g&&(Q=L.set(Q,0,8,g,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===Q)return void(this._lastTokenEndIndex=B);if(H){const Q=A?.getScopeNames()??[];console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,B).replace(/\n$/,"\\n")+"|");for(let A=0;A0&&this._tokens[this._tokens.length-1].startIndex===B-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(A,B),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(A,B){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===B-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(A,B),this._binaryTokens[this._binaryTokens.length-2]=0);const Q=new Uint32Array(this._binaryTokens.length);for(let A=0,B=this._binaryTokens.length;A0;)10===A.charCodeAt(E)?(E++,C++,I=0):(E++,I++),B--}function w(A){null===Q?E=A:D(A-E)}function o(){for(;E0&&65279===A.charCodeAt(0)&&(E=1);let i=0,t=null,M=[],h=[],F=null;function G(A,B){M.push(i),h.push(t),i=A,t=B}function a(){if(0===M.length)return n("illegal state stack");i=M.pop(),t=h.pop()}function n(B){throw new Error("Near offset "+E+": "+B+" ~~~"+A.substr(E,50)+"~~~")}const N=function(){if(null===F)return n("missing ");let A={};null!==Q&&(A[Q]={filename:B,line:C,char:I}),t[F]=A,F=null,G(1,A)},r=function(){if(null===F)return n("missing ");let A=[];t[F]=A,F=null,G(2,A)},H=function(){let A={};null!==Q&&(A[Q]={filename:B,line:C,char:I}),t.push(A),G(1,A)},L=function(){let A=[];t.push(A),G(2,A)};function k(){if(1!==i)return n("unexpected ");a()}function R(){return 1===i||2!==i?n("unexpected "):void a()}function K(A){if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function Y(A){if(isNaN(A))return n("cannot parse float");if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function U(A){if(isNaN(A))return n("cannot parse integer");if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function P(A){if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function u(A){if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function y(A){if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function J(){let A=c(">"),B=!1;return 47===A.charCodeAt(A.length-1)&&(B=!0,A=A.substring(0,A.length-1)),{name:A.trim(),isClosed:B}}function S(A){if(A.isClosed)return"";let B=c(""),B.replace(/&#([0-9]+);/g,(function(A,B){return String.fromCodePoint(parseInt(B,10))})).replace(/&#x([0-9a-f]+);/g,(function(A,B){return String.fromCodePoint(parseInt(B,16))})).replace(/&|<|>|"|'/g,(function(A){switch(A){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return A}))}for(;E=g));){const w=A.charCodeAt(E);if(D(1),60!==w)return n("expected <");if(E>=g)return n("unexpected end of input");const c=A.charCodeAt(E);if(63===c){D(1),e("?>");continue}if(33===c){if(D(1),s("--")){e("--\x3e");continue}e(">");continue}if(47===c){if(D(1),o(),s("plist")){e(">");continue}if(s("dict")){e(">"),k();continue}if(s("array")){e(">"),R();continue}return n("unexpected closed tag")}let M=J();switch(M.name){case"dict":1===i?N():2===i?H():(t={},null!==Q&&(t[Q]={filename:B,line:C,char:I}),G(1,t)),M.isClosed&&k();continue;case"array":1===i?r():2===i?L():(t=[],G(2,t)),M.isClosed&&R();continue;case"key":d=S(M),1!==i?n("unexpected "):null!==F?n("too many "):F=d;continue;case"string":K(S(M));continue;case"real":Y(parseFloat(S(M)));continue;case"integer":U(parseInt(S(M),10));continue;case"date":P(new Date(S(M)));continue;case"data":u(S(M));continue;case"true":S(M),y(!0);continue;case"false":S(M),y(!1);continue}if(!/^plist/.test(M.name))return n("unexpected opened tag "+M.name)}var d;return t}function fA(A,B){throw new Error("Near offset "+A.pos+": "+B+" ~~~"+A.source.substr(A.pos,50)+"~~~")}class xA{constructor(A){this.source=A,this.pos=0,this.len=A.length,this.line=1,this.char=0}}class OA{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(A){return{filename:A,line:this.line,char:this.char}}}function mA(A,B){B.value=null,B.type=0,B.offset=-1,B.len=-1,B.line=-1,B.char=-1;let Q,g=A.source,E=A.pos,C=A.len,I=A.line,D=A.char;for(;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),32!==Q&&9!==Q&&13!==Q){if(10!==Q)break;E++,I++,D=0}else E++,D++}if(B.offset=E,B.line=I,B.char=D,34===Q){for(B.type=1,E++,D++;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),E++,D++,92!==Q){if(34===Q)break}else E++,D++}B.value=g.substring(B.offset+1,E-1).replace(/\\u([0-9A-Fa-f]{4})/g,((A,B)=>String.fromCodePoint(parseInt(B,16)))).replace(/\\(.)/g,((B,Q)=>{switch(Q){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:fA(A,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===Q)B.type=2,E++,D++;else if(123===Q)B.type=3,E++,D++;else if(93===Q)B.type=4,E++,D++;else if(125===Q)B.type=5,E++,D++;else if(58===Q)B.type=6,E++,D++;else if(44===Q)B.type=7,E++,D++;else if(110===Q){if(B.type=8,E++,D++,Q=g.charCodeAt(E),117!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;E++,D++}else if(116===Q){if(B.type=9,E++,D++,Q=g.charCodeAt(E),114!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),117!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),101!==Q)return!1;E++,D++}else if(102===Q){if(B.type=10,E++,D++,Q=g.charCodeAt(E),97!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),115!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),101!==Q)return!1;E++,D++}else for(B.type=11;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),!(46===Q||Q>=48&&Q<=57||101===Q||69===Q||45===Q||43===Q))break;E++,D++}return B.len=E-B.offset,null===B.value&&(B.value=g.substr(B.offset,B.len)),A.pos=E,A.line=I,A.char=D,!0}class qA{constructor(A,B){this._onigLibPromise=B,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=A}dispose(){for(const A of this._grammars.values())A.dispose()}setTheme(A){this._theme=A}getColorMap(){return this._theme.getColorMap()}addGrammar(A,B){this._rawGrammars.set(A.scopeName,A),B&&this._injectionGrammars.set(A.scopeName,B)}lookup(A){return this._rawGrammars.get(A)}injections(A){return this._injectionGrammars.get(A)}getDefaults(){return this._theme.getDefaults()}themeMatch(A){return this._theme.match(A)}async grammarForScopeName(A,B,Q,g,E){if(!this._grammars.has(A)){let C=this._rawGrammars.get(A);if(!C)return null;this._grammars.set(A,function(A,B,Q,g,E,C,I,D){return new uA(A,B,Q,g,E,C,I,D)}(A,C,B,Q,g,E,this,await this._onigLibPromise))}return this._grammars.get(A)}}function bA(A,B){let Q=0;const g=[];let E=A,C=B;for(;E!==C;)E&&(!C||E.depth>=C.depth)?(Q++,E=E.parent):(g.push(C.toStateStackFrame()),C=C.parent);return{pops:Q,newFrames:g.reverse()}}function WA(A,B){let Q=A;for(let A=0;A0;)await Promise.all(C.Q.map((A=>this._loadSingleGrammar(A.scopeName)))),C.processQueue();return this._grammarForScopeName(A,B,Q,g,E)}async _loadSingleGrammar(A){return this._ensureGrammarCache.has(A)||this._ensureGrammarCache.set(A,this._doLoadSingleGrammar(A)),this._ensureGrammarCache.get(A)}async _doLoadSingleGrammar(A){const B=await this._options.loadGrammar(A);if(B){const Q="function"==typeof this._options.getInjections?this._options.getInjections(A):void 0;this._syncRegistry.addGrammar(B,Q)}}async addGrammar(A,B=[],Q=0,g=null){return this._syncRegistry.addGrammar(A,B),await this._grammarForScopeName(A.scopeName,Q,g)}_grammarForScopeName(A,B=0,Q=null,g=null,E=null){return this._syncRegistry.grammarForScopeName(A,B,Q,g,E)}}const XA=SA.NULL,vA=function(A,B=null){return null!==B&&/\.json$/.test(B)?(Q=A,H?function(A,B,Q){let g=new xA(A),E=new OA,C=0,I=null,D=[],w=[];function o(){D.push(C),w.push(I)}function s(){C=D.pop(),I=w.pop()}function e(A){fA(g,A)}for(;mA(g,E);){if(0===C){if(null!==I&&e("too many constructs in root"),3===E.type){I={},I.$vscodeTextmateLocation=E.toLocation(B),o(),C=1;continue}if(2===E.type){I=[],o(),C=4;continue}e("unexpected token in root")}if(2===C){if(5===E.type){s();continue}if(7===E.type){C=3;continue}e("expected , or }")}if(1===C||3===C){if(1===C&&5===E.type){s();continue}if(1===E.type){let A=E.value;if(mA(g,E)&&6===E.type||e("expected colon"),mA(g,E)||e("expected value"),C=2,1===E.type){I[A]=E.value;continue}if(8===E.type){I[A]=null;continue}if(9===E.type){I[A]=!0;continue}if(10===E.type){I[A]=!1;continue}if(11===E.type){I[A]=parseFloat(E.value);continue}if(2===E.type){let B=[];I[A]=B,o(),C=4,I=B;continue}if(3===E.type){let Q={};Q.$vscodeTextmateLocation=E.toLocation(B),I[A]=Q,o(),C=1,I=Q;continue}}e("unexpected token in dict")}if(5===C){if(4===E.type){s();continue}if(7===E.type){C=6;continue}e("expected , or ]")}if(4===C||6===C){if(4===C&&4===E.type){s();continue}if(C=5,1===E.type){I.push(E.value);continue}if(8===E.type){I.push(null);continue}if(9===E.type){I.push(!0);continue}if(10===E.type){I.push(!1);continue}if(11===E.type){I.push(parseFloat(E.value));continue}if(2===E.type){let A=[];I.push(A),o(),C=4,I=A;continue}if(3===E.type){let A={};A.$vscodeTextmateLocation=E.toLocation(B),I.push(A),o(),C=1,I=A;continue}e("unexpected token in array")}e("unknown state")}return 0!==w.length&&e("unclosed constructs"),I}(Q,B):JSON.parse(Q)):function(A,B){return H?function(A,B,Q){return pA(A,B,"$vscodeTextmateLocation")}(A,B):function(A){return pA(A,null,null)}(A)}(A,B);var Q};var ZA=r.Bz,jA=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(A){var B,Q,g=void 0!==(A=A||{})?A:{};g.ready=new Promise((function(A,g){B=A,Q=g}));var E,C=Object.assign({},g),I=!1;E=function(A){let B;return"function"==typeof readbuffer?new Uint8Array(readbuffer(A)):(B=read(A,"binary"),"object"==typeof B||H(Q),B);var Q},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print);var D,w,o=g.print||console.log.bind(console),s=g.printErr||console.warn.bind(console);Object.assign(g,C),C=null,g.arguments&&g.arguments,g.thisProgram&&g.thisProgram,g.quit&&g.quit,g.wasmBinary&&(D=g.wasmBinary),g.noExitRuntime,"object"!=typeof WebAssembly&&H("no native wasm support detected");var e,c,i,t=!1,M="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function h(A,B,Q){for(var g=B+Q,E=B;A[E]&&!(E>=g);)++E;if(E-B>16&&A.buffer&&M)return M.decode(A.subarray(B,E));for(var C="";B>10,56320|1023&o)}}else C+=String.fromCharCode((31&I)<<6|D)}else C+=String.fromCharCode(I)}return C}function F(A){e=A,g.HEAP8=new Int8Array(A),g.HEAP16=new Int16Array(A),g.HEAP32=new Int32Array(A),g.HEAPU8=c=new Uint8Array(A),g.HEAPU16=new Uint16Array(A),g.HEAPU32=i=new Uint32Array(A),g.HEAPF32=new Float32Array(A),g.HEAPF64=new Float64Array(A)}g.INITIAL_MEMORY;var G=[],a=[],n=[],N=0,r=null;function H(A){g.onAbort&&g.onAbort(A),s(A="Aborted("+A+")"),t=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw Q(B),B}var L,k,R,K="data:application/octet-stream;base64,";function Y(A){return A.startsWith(K)}function U(A){try{if(A==L&&D)return new Uint8Array(D);if(E)return E(A);throw"both async and sync fetching of the wasm failed"}catch(A){H(A)}}function P(A){for(;A.length>0;)A.shift()(g)}function u(A){try{return w.grow(A-e.byteLength+65535>>>16),F(w.buffer),1}catch(A){}}Y(L="onig.wasm")||(k=L,L=g.locateFile?g.locateFile(k,""):""+k),R="undefined"!=typeof dateNow?dateNow:()=>performance.now();var y=[null,[],[]];function J(A,B){var Q=y[A];0===B||10===B?((1===A?o:s)(h(Q,0)),Q.length=0):Q.push(B)}var S,d={emscripten_get_now:R,emscripten_memcpy_big:function(A,B,Q){c.copyWithin(A,B,B+Q)},emscripten_resize_heap:function(A){var B=c.length,Q=2147483648;if((A>>>=0)>Q)return!1;let g=(A,B)=>A+(B-A%B)%B;for(var E=1;E<=4;E*=2){var C=B*(1+.2/E);if(C=Math.min(C,A+100663296),u(Math.min(Q,g(Math.max(A,C),65536))))return!0}return!1},fd_write:function(A,B,Q,g){for(var E=0,C=0;C>2],D=i[B+4>>2];B+=8;for(var w=0;w>2]=E,0}};function l(A){function Q(){S||(S=!0,g.calledRun=!0,t||(P(a),B(g),g.onRuntimeInitialized&&g.onRuntimeInitialized(),function(){if(g.postRun)for("function"==typeof g.postRun&&(g.postRun=[g.postRun]);g.postRun.length;)A=g.postRun.shift(),n.unshift(A);var A;P(n)}()))}N>0||(function(){if(g.preRun)for("function"==typeof g.preRun&&(g.preRun=[g.preRun]);g.preRun.length;)A=g.preRun.shift(),G.unshift(A);var A;P(G)}(),N>0||(g.setStatus?(g.setStatus("Running..."),setTimeout((function(){setTimeout((function(){g.setStatus("")}),1),Q()}),1)):Q()))}if(function(){var A={env:d,wasi_snapshot_preview1:d};function B(A,B){var Q,E=A.exports;g.asm=E,F((w=g.asm.memory).buffer),g.asm.__indirect_function_table,Q=g.asm.__wasm_call_ctors,a.unshift(Q),function(A){if(N--,g.monitorRunDependencies&&g.monitorRunDependencies(N),0==N&&r){var B=r;r=null,B()}}()}function E(A){B(A.instance)}function C(B){return(!D&&I&&"function"==typeof fetch?fetch(L,{credentials:"same-origin"}).then((function(A){if(!A.ok)throw"failed to load wasm binary file at '"+L+"'";return A.arrayBuffer()})).catch((function(){return U(L)})):Promise.resolve().then((function(){return U(L)}))).then((function(B){return WebAssembly.instantiate(B,A)})).then((function(A){return A})).then(B,(function(A){s("failed to asynchronously prepare wasm: "+A),H(A)}))}if(N++,g.monitorRunDependencies&&g.monitorRunDependencies(N),g.instantiateWasm)try{return g.instantiateWasm(A,B)}catch(A){s("Module.instantiateWasm callback failed with error: "+A),Q(A)}(D||"function"!=typeof WebAssembly.instantiateStreaming||Y(L)||"function"!=typeof fetch?C(E):fetch(L,{credentials:"same-origin"}).then((function(B){return WebAssembly.instantiateStreaming(B,A).then(E,(function(A){return s("wasm streaming compile failed: "+A),s("falling back to ArrayBuffer instantiation"),C(E)}))}))).catch(Q)}(),g.___wasm_call_ctors=function(){return(g.___wasm_call_ctors=g.asm.__wasm_call_ctors).apply(null,arguments)},g.___errno_location=function(){return(g.___errno_location=g.asm.__errno_location).apply(null,arguments)},g._omalloc=function(){return(g._omalloc=g.asm.omalloc).apply(null,arguments)},g._ofree=function(){return(g._ofree=g.asm.ofree).apply(null,arguments)},g._getLastOnigError=function(){return(g._getLastOnigError=g.asm.getLastOnigError).apply(null,arguments)},g._createOnigScanner=function(){return(g._createOnigScanner=g.asm.createOnigScanner).apply(null,arguments)},g._freeOnigScanner=function(){return(g._freeOnigScanner=g.asm.freeOnigScanner).apply(null,arguments)},g._findNextOnigScannerMatch=function(){return(g._findNextOnigScannerMatch=g.asm.findNextOnigScannerMatch).apply(null,arguments)},g._findNextOnigScannerMatchDbg=function(){return(g._findNextOnigScannerMatchDbg=g.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},g.stackSave=function(){return(g.stackSave=g.asm.stackSave).apply(null,arguments)},g.stackRestore=function(){return(g.stackRestore=g.asm.stackRestore).apply(null,arguments)},g.stackAlloc=function(){return(g.stackAlloc=g.asm.stackAlloc).apply(null,arguments)},g.dynCall_jiji=function(){return(g.dynCall_jiji=g.asm.dynCall_jiji).apply(null,arguments)},g.UTF8ToString=function(A,B){return A?h(c,A,B):""},r=function A(){S||l(),S||(r=A)},g.preInit)for("function"==typeof g.preInit&&(g.preInit=[g.preInit]);g.preInit.length>0;)g.preInit.pop()();return l(),A.ready});let VA=null;class zA{static _utf8ByteLength(A){let B=0;for(let Q=0,g=A.length;Q=55296&&E<=56319&&Q+1=56320&&B<=57343&&(C=65536+(E-55296<<10)|B-56320,I=!0)}B+=C<=127?1:C<=2047?2:C<=65535?3:4,I&&Q++}return B}constructor(A){const B=A.length,Q=zA._utf8ByteLength(A),g=Q!==B,E=g?new Uint32Array(B+1):null;g&&(E[B]=Q);const C=g?new Uint32Array(Q+1):null;g&&(C[Q]=B);const I=new Uint8Array(Q);let D=0;for(let Q=0;Q=55296&&w<=56319&&Q+1=56320&&B<=57343&&(o=65536+(w-55296<<10)|B-56320,s=!0)}g&&(E[Q]=D,s&&(E[Q+1]=D),o<=127?C[D+0]=Q:o<=2047?(C[D+0]=Q,C[D+1]=Q):o<=65535?(C[D+0]=Q,C[D+1]=Q,C[D+2]=Q):(C[D+0]=Q,C[D+1]=Q,C[D+2]=Q,C[D+3]=Q)),o<=127?I[D++]=o:o<=2047?(I[D++]=192|(1984&o)>>>6,I[D++]=128|(63&o)>>>0):o<=65535?(I[D++]=224|(61440&o)>>>12,I[D++]=128|(4032&o)>>>6,I[D++]=128|(63&o)>>>0):(I[D++]=240|(1835008&o)>>>18,I[D++]=128|(258048&o)>>>12,I[D++]=128|(4032&o)>>>6,I[D++]=128|(63&o)>>>0),s&&Q++}this.utf16Length=B,this.utf8Length=Q,this.utf16Value=A,this.utf8Value=I,this.utf16OffsetToUtf8=E,this.utf8OffsetToUtf16=C}createString(A){const B=A._omalloc(this.utf8Length);return A.HEAPU8.set(this.utf8Value,B),B}}class _A{constructor(A){if(this.id=++_A.LAST_ID,!VA)throw new Error("Must invoke loadWASM first.");this._onigBinding=VA,this.content=A;const B=new zA(A);this.utf16Length=B.utf16Length,this.utf8Length=B.utf8Length,this.utf16OffsetToUtf8=B.utf16OffsetToUtf8,this.utf8OffsetToUtf16=B.utf8OffsetToUtf16,this.utf8Length<1e4&&!_A._sharedPtrInUse?(_A._sharedPtr||(_A._sharedPtr=VA._omalloc(1e4)),_A._sharedPtrInUse=!0,VA.HEAPU8.set(B.utf8Value,_A._sharedPtr),this.ptr=_A._sharedPtr):this.ptr=B.createString(VA)}convertUtf8OffsetToUtf16(A){return this.utf8OffsetToUtf16?A<0?0:A>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[A]:A}convertUtf16OffsetToUtf8(A){return this.utf16OffsetToUtf8?A<0?0:A>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[A]:A}dispose(){this.ptr===_A._sharedPtr?_A._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}_A.LAST_ID=0,_A._sharedPtr=0,_A._sharedPtrInUse=!1;class $A{constructor(A){if(!VA)throw new Error("Must invoke loadWASM first.");const B=[],Q=[];for(let g=0,E=A.length;gWebAssembly.instantiateStreaming(A,B)}(g):function(A){return async B=>{const Q=await A.arrayBuffer();return WebAssembly.instantiate(Q,B)}}(g):function(A){return B=>WebAssembly.instantiate(A,B)}(g)}return BB=new Promise(((A,B)=>{g=A,E=B})),function(A,B,Q,g){jA({print:B,instantiateWasm:(B,Q)=>{if("undefined"==typeof performance){const A=()=>Date.now();B.env.emscripten_get_now=A,B.wasi_snapshot_preview1.emscripten_get_now=A}return A(B).then((A=>Q(A.instance)),g),{}}}).then((A=>{VA=A,Q()}))}(B,Q,g,E),BB}function gB(A){return new _A(A)}function EB(A){return new $A(A)}function CB(A){const B=a[A];if(!B)return;const{id:Q}=n[B];return{id:Q,scopeName:B}}const IB=new Map;let DB,wB;async function oB(Q){if(IB.has(Q))return IB.get(Q);const g=function(A){return n[A]}(Q);if(!g)return Promise.resolve(void 0);let E;if(void 0===DB&&(E=A(g.id),DB=E.then((()=>!0)).catch((()=>!1))),void 0===wB&&(wB=await DB),wB){const B=E||A(g.id);return IB.set(Q,B),B}const C=B(`grammars/${g.id}`);g.embeddedScopes.forEach((A=>{if(!IB.has(A)){const B=C.then((B=>null==B?void 0:B.find((B=>B.scopeName===A))));IB.set(A,B)}}));const I=C.then((A=>null==A?void 0:A.find((A=>A.scopeName===Q))));return IB.set(Q,I),I}const sB=30720,eB=16744448,cB=16775168,iB=11,tB=15,MB={NotSet:-1,None:0,Italic:1,Bold:2,Underline:4,Strikethrough:8};function hB(A,B,Q,g){const{tokens:E,ruleStack:C}=A.tokenizeLine2(Q,B),I=[];let D=Q.length;for(let A=E.length-2;A>=0;A-=2){const B=E[A],g=E[A+1],C=Q.slice(B,D);I.unshift({content:C,metadata:g}),D=B}let w=[];if(null==g?void 0:g.preserveWhitespace)w=I;else for(let A=0;A0?w[w.length-1].content+=B.content:A{const{rawTokens:E,nextStack:C}=hB(B,g,A,{preserveWhitespace:!0}),I=E.map((({content:A,metadata:B})=>({content:A,style:GB(B,Q)}))),D=function(A,B,Q,g){const{tokens:E}=Q.tokenizeLine(A,B),C=[];for(let B=0;B{if(w+=A.content.length,Q>>tB]},g=(A&sB)>>>iB;return g&MB.Italic&&(Q.fontStyle="italic"),g&MB.Bold&&(Q.fontWeight="bold"),g&MB.Underline&&(Q.textDecoration="underline"),g&MB.Strikethrough&&(Q.textDecoration="line-through"),Q}var aB=function(A){var B=null;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)B=Buffer.from(A,"base64");else{var Q=globalThis.atob(A),g=Q.length;B=new Uint8Array(new ArrayBuffer(g));for(var E=0;E({createOnigScanner:EB,createOnigString:gB})));nB=new ZA({onigLib:A,loadGrammar:A=>oB(A)})}const B=A.filter((A=>!NB(A))).map((A=>{const B=CB(A);if(!B)throw new LB(A);return nB.loadGrammar(B.scopeName)}));return Promise.all(B)}function HB(A){if(NB(A))return{langId:A,grammar:null};const B=CB(A);if(!B)throw new LB(A);const Q=function(A){const{_syncRegistry:B}=nB;return null==B?void 0:B._grammars.get(A)}(B.scopeName);if(!Q)throw new Error(`Syntax highlighting error: grammar for ${A} not loaded`);return{langId:B.id,grammar:Q}}class LB extends Error{constructor(A){super(`Unknown language: ${A}`),this.alias=A}}function kB(A,B,Q){nB.setTheme(Q);const g=function(A){const B=nB.getColorMap();return A.colorNames?B.map((B=>Object.keys(A.colorNames).find((Q=>A.colorNames[Q].toUpperCase()===B.toUpperCase()))||B)):B}(Q);return function(A,B,Q){let g=null;return A.split(/\r?\n|\r/g).map((A=>{const{rawTokens:E,nextStack:C}=hB(B,g,A);return g=C,E.map((({content:A,metadata:B})=>({content:A,style:GB(B,Q)})))}))}(A,B,g)}function RB(A){return A.split(/\r?\n|\r/g).map((A=>[{content:A,style:{}}]))}function KB(A,B){return UB(A.slice(1,-1)).map((A=>{const{from:Q,to:g}=YB(A);return{lineNumber:B,fromColumn:Q,toColumn:g}}))}function YB(A){const[B,Q]=A.split(":");if(!PB(B))throw new uB(B);const g=Number(B);if(g<1)throw new yB;if(Q){if(!PB(Q))throw new uB(Q);return{from:g,to:+Q}}return{from:g,to:g}}function UB(A){return A.split(/,(?![^\[]*\])/g)}function PB(A){A=A.toString();var B=Math.abs(A),Q=parseInt(A,10);return!isNaN(B)&&Q===B&&B.toString()===A}class uB extends Error{constructor(A){super(`Invalid number "${A}" in range string`),this.number=A,Object.setPrototypeOf(this,new.target.prototype)}}class yB extends Error{constructor(){super("Invalid line or column number in range string"),Object.setPrototypeOf(this,new.target.prototype)}}const JB="#001",SB="#010",dB={name:"comments",type:"light",foreground:"",background:"",colors:{},settings:[{settings:{foreground:"#000"}},{scope:["punctuation.definition.comment"],settings:{foreground:JB}},{scope:"comment",settings:{foreground:SB}}]};function lB(A,B,Q,g){const E=B?kB(A,B,dB):RB(A),C=[];let I=1;const D=E.map((A=>{const{annotations:B,lineWithoutComments:E}=function(A,B,Q,g){if(g in pB&&A.some((A=>A.style.color===SB))){const B=pB[g];A=A.flatMap((A=>{if(A.style.color!==SB)return[A];const Q=A.content.trimStart();if(Q.startsWith(B)){const g=Q.slice(B.length),E=[{content:A.content.slice(0,A.content.length-g.length),style:{color:JB}}];return g.length&&E.push({content:g,style:A.style}),E}return[A]}))}if(!A.some((A=>A.style.color===JB)))return{annotations:[],lineWithoutComments:A};const E=[];let C=0;for(;C!A.tokens.includes(B)));I.every((A=>""===A.content.trim()))&&(I=null);return{annotations:E.map((A=>({name:A.name,query:A.query,lineNumber:A.lineNumber,rangeString:A.rangeString}))),lineWithoutComments:I}}(A,g,I,Q);if(C.push(...B),!E)return null;const D=E.map((A=>A.content)).join("");return["mdx","jsx","tsx"].includes(Q)&&B.length>0&&"{}"===D.trim()?null:(I++,D)})).filter((A=>null!==A)).join("\n"),w=C.map((A=>{var{rangeString:B,lineNumber:Q}=A,g=function(A,B){var Q={};for(var g in A)Object.prototype.hasOwnProperty.call(A,g)&&B.indexOf(g)<0&&(Q[g]=A[g]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols){var E=0;for(g=Object.getOwnPropertySymbols(A);EA.ranges.length>0));return{newCode:D,annotations:w}}const pB={"actionscript-3":"//",ada:"--",asm:"#",dart:"//",fsharp:"//",graphql:"#",http:"#",rust:"//",sparql:"#",wgsl:"//",jsonnet:"//",kql:"//",zenscript:"//",kusto:"//",turtle:"#",abap:"*",beancount:";",kotlin:"//",hlsl:"//",berry:"#",cypher:"//",elm:"--",nix:"#",viml:'"',solidity:"//",bat:"REM",shaderlab:"//",sas:"*"};function fB(A,B,Q){return A&&A.startsWith("(/")?function(A,B,Q){const g=B.match(/\(\/([\s\S]*?)\/([gimuy]*)\)/);if(!g)throw new Error(`Invalid RegExp string: ${B}`);const E=new RegExp(g[1],g[2]),C=A.split(/\r?\n/).slice(Q-1).join("\n");if(!E.global){const A=E.exec(C);if(!A)return[];const B=C.slice(0,A.index).split("\n").length+Q-1;return[{fromLineNumber:B,toLineNumber:B+A[0].split("\n").length-1}]}let I;const D=[];for(;I=E.exec(C);){const A=C.slice(0,I.index).split("\n").length+Q-1,B=A+I[0].split("\n").length-1,g=D[D.length-1];g&&g.fromLineNumber===A||D.push({fromLineNumber:A,toLineNumber:B})}return D}(Q,A,B):A&&A.startsWith("[/")?function(A,B,Q){const g=B.match(/\[\/([\s\S]*?)\/([gimuy]*)\]/);if(!g)throw new Error(`Invalid RegExp string: ${B}`);let E=g[2]||"";E+="d";const C=new RegExp(g[1],E);let I=A.split(/\r?\n/);I=I.slice(Q-1),C.multiline||(I=[I[0]]);const D=[];return I.forEach(((A,B)=>{if(!C.global){if(D.length>0)return;const g=C.exec(A);if(!g)return;const E=g.indices[1]||g.indices[0];return void D.push({lineNumber:B+Q,fromColumn:E[0]+1,toColumn:E[1]})}let g;for(;g=C.exec(A);){const A=g.indices[1]||g.indices[0];D.push({lineNumber:B+Q,fromColumn:A[0]+1,toColumn:A[1]})}})),D}(Q,A,B):function(A,B){return A?A.startsWith("[")?KB(A,B):UB(A.slice(1,-1)).map((A=>{if(A.includes("[")){const[Q,g]=A.split("["),E=Number(Q),C=B+E-1;if(!PB(C))throw new uB(Q);return KB("["+g,C)}const{from:Q,to:g}=YB(A);return[{fromLineNumber:Q+B-1,toLineNumber:g+B-1}]})).flat():[{fromLineNumber:B,toLineNumber:B}]}(A,B)}function xB(A,B){var Q;const g=A.match(/\s*([\w-]+)?(\([^\)]*\)|\[[^\]]*\])?(.*)$/),E=g[1],C=g[2],I=null===(Q=g[3])||void 0===Q?void 0:Q.trim();return B.includes(E)?{name:E,rangeString:C,query:I}:null}function OB(A,B){let Q=[],g=1;return A.forEach((A=>{Q.push({fromColumn:g,toColumn:g+A.content.length-1,token:A}),g+=A.content.length})),B.forEach((A=>{Q=function(A,B){const{range:Q}=B,{fromColumn:g,toColumn:E}=Q,C=[];let I=0;for(;IE){const[A,Q]=qB(B,E+1);D.tokens.push(A),C.push(Q)}else D.tokens.push(B);I++}else C.push(D);for(;ImB(A)))}function mB(A){return"tokens"in A?{annotationName:A.annotationName,annotationQuery:A.annotationQuery,fromColumn:A.fromColumn,toColumn:A.toColumn,tokens:A.tokens.map((A=>mB(A)))}:A.token}function qB(A,B){if("token"in A){const Q=Object.assign(Object.assign({},A.token),{content:A.token.content.slice(0,B-A.fromColumn)}),g=Object.assign(Object.assign({},A.token),{content:A.token.content.slice(B-A.fromColumn)});return[Object.assign(Object.assign({},A),{toColumn:B-1,token:Q}),Object.assign(Object.assign({},A),{fromColumn:B,token:g})]}{const Q=[],g=[];A.tokens.forEach((A=>{if(A.toColumn=B)g.push(A);else{const[E,C]=qB(A,B);Q.push(E),g.push(C)}}));return[Object.assign(Object.assign({},A),{toColumn:B-1,tokens:Q}),Object.assign(Object.assign({},A),{fromColumn:B,tokens:g})]}}function bB(A,B){let Q=A.map(((A,B)=>({fromLineNumber:B+1,toLineNumber:B+1,line:A})));return B.forEach((A=>{Q=function(A,B){const{range:Q,name:g,query:E}=B,{fromLineNumber:C,toLineNumber:I}=Q,D=[];let w=0;for(;wI){const[A,Q]=TB(B,I+1);o.lines.push(A),D.push(Q)}else o.lines.push(B);w++}else D.push(o);for(;wWB(A)))}function WB(A){return"line"in A?{lineNumber:A.fromLineNumber,tokens:A.line.tokens}:{annotationName:A.annotationName,annotationQuery:A.annotationQuery,fromLineNumber:A.fromLineNumber,toLineNumber:A.toLineNumber,lines:A.lines.map((A=>WB(A)))}}function TB(A,B){if("line"in A)return[Object.assign(Object.assign({},A),{toLineNumber:B-1}),Object.assign(Object.assign({},A),{fromLineNumber:B})];{const Q=[],g=[];return A.lines.forEach((A=>{if(A.toLineNumber=B)g.push(A);else{const[E,C]=TB(A,B);Q.push(E),g.push(C)}})),[Object.assign(Object.assign({},A),{toLineNumber:B-1,lines:Q}),Object.assign(Object.assign({},A),{fromLineNumber:B,lines:g})]}}function XB(A,B){const{inlineAnnotations:Q,multilineAnnotations:g}=function(A){const B=[],Q=[];return A.forEach((A=>{A.ranges.forEach((g=>{"lineNumber"in g?B.push(Object.assign(Object.assign({},A),{range:g})):Q.push(Object.assign(Object.assign({},A),{range:g}))}))})),{inlineAnnotations:B,multilineAnnotations:Q}}(B);return bB(A.map(((A,B)=>{const g=Q.filter((A=>A.range.lineNumber===B+1));return{lineNumber:B+1,tokens:OB(A,g)}})),g)}var vB=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ZB={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function jB(A,B){const Q=A.indexOf("[",B);if(-1!==Q){const B=A.indexOf("m",Q);return{sequence:A.substring(Q+2,B).split(";"),startPosition:Q,position:B+1}}return{position:A.length}}function VB(A,B){let Q=1;const g=A[B+Q++];let E;if("2"===g){const g=[A[B+Q++],A[B+Q++],A[B+Q]].map((A=>Number.parseInt(A)));3!==g.length||g.some((A=>Number.isNaN(A)))||(E={type:"rgb",rgb:g})}else if("5"===g){const g=Number.parseInt(A[B+Q]);Number.isNaN(g)||(E={type:"table",index:Number(g)})}return[Q,E]}function zB(A){const B=[];for(let Q=0;Q=90&&E<=97?B.push({type:"setForegroundColor",value:{type:"named",name:vB[E-90+8]}}):E>=100&&E<=107&&B.push({type:"setBackgroundColor",value:{type:"named",name:vB[E-100+8]}})}return B}function _B(A,B){const Q=function(){let A=null,B=null,Q=new Set;return{parse(g){const E=[];let C=0;do{const I=jB(g,C),D=I.sequence?g.substring(C,I.startPosition):g.substring(C);if(D.length>0&&E.push({value:D,foreground:A,background:B,decorations:new Set(Q)}),I.sequence){const g=zB(I.sequence);for(const E of g)"resetAll"===E.type?(A=null,B=null,Q.clear()):"resetForegroundColor"===E.type?A=null:"resetBackgroundColor"===E.type?B=null:"resetDecoration"===E.type&&Q.delete(E.value);for(const E of g)"setForegroundColor"===E.type?A=E.value:"setBackgroundColor"===E.type?B=E.value:"setDecoration"===E.type&&Q.add(E.value)}C=I.position}while(Cfunction(A,B,Q){const g=A.parse(B),E=g.map((({value:A,foreground:B,background:g,decorations:E})=>{const C=$B(B,Q),I={};C&&(I.color=C);const D=$B(g,Q);return D&&(I.background=D),E.has("bold")&&(I.fontWeight="bold"),E.has("italic")&&(I.fontStyle="italic"),E.has("underline")&&(I.textDecoration="underline"),E.has("strikethrough")&&(I.textDecoration="line-through"),E.has("reverse")&&(I.color=D,I.background=C),E.has("dim")&&(I.opacity=.5),{content:A,style:I}}));return E}(Q,A,B)));return g}function $B(A,B){if(A){if("named"===A.type){return D(B,"terminal.ansi"+(A.name[0].toUpperCase()+A.name.slice(1)))}if("rgb"===A.type){const[B,Q,g]=A.rgb;return`rgb(${B}, ${Q}, ${g})`}}}async function AQ(A,B){await Promise.all([rB(A),c(B)])}async function BQ(A,B,Q="dark-plus",g={}){const E=A||"",C=B||"text";if("string"!=typeof E)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof C)throw new Error("Syntax highlighter error: lang must be a string");return await AQ([C],Q),QQ(E,C,Q,g)}function QQ(A,B,Q="dark-plus",g={}){const E=A||"",C=B||"text";if("string"!=typeof E)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof C)throw new Error("Syntax highlighter error: lang must be a string");const{langId:I,grammar:w}=HB(C),o=i(Q),s="text"==I?RB(E):"terminal"==I?_B(E,o):(null==g?void 0:g.scopes)?function(A,B,Q){return nB.setTheme(Q),FB(A,B,nB.getColorMap())}(E,w,o):kB(E,w,o),e="terminal"==I?function(A){return{color:D(A,"terminal.foreground"),background:D(A,"terminal.background")}}(o):{color:o.foreground,background:o.background};if(function(A){return"annotations"in A}(g)){return{lines:XB(s,(null==g?void 0:g.annotations)||[]),lang:I,style:e}}return{lines:s,lang:I,style:e}}async function gQ(A,B,Q){if(!Q)return{code:A,annotations:[]};await rB([B]);const{grammar:g,langId:E}=HB(B),{newCode:C,annotations:I}=lB(A,g,E,Q);return{code:C,annotations:I}}async function EQ(A){if(!A)throw new Error("Syntax highlighter error: undefined theme");await AQ([],A);return F(i(A))}function CQ(A){if(!A)throw new Error("Syntax highlighter error: undefined theme");return F(i(A))}export{G as LANG_NAMES,M as THEME_NAMES,LB as UnknownLanguageError,h as UnknownThemeError,gQ as extractAnnotations,EQ as getThemeColors,CQ as getThemeColorsSync,BQ as highlight,QQ as highlightSync,AQ as preload}; +async function A(A){throw new Error("no fs")}async function B(A){console.warn(`Code Hike warning: Fetching resource from network "${A}"`);const B=await fetch(`https://lighter.codehike.org/${A}.json`);if(B.ok)return await B.json()}const Q=A=>/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(A),g=(A,B)=>A.match(new RegExp(`.{${B}}`,"g")),E=A=>parseInt(A.repeat(2/A.length),16);function C(A,B){return void 0!==A?A/255:"number"!=typeof B||B<0||B>1?1:B}function I(A,B){if(!A)return A;const{r:I,g:D,b:w,a:o}=function(A){if(!A)return;if(!Q(A))throw new Error("Invalid color string, must be a valid hex color");const B=Math.floor((A.length-1)/3),I=g(A.slice(1),B),[D,w,o,s]=I.map(E);return{r:D,g:w,b:o,a:C(s,1)}}(A);return function(A){if(!A)return;const{r:B,g:Q,b:g,a:E}=A,C=Math.round(255*E);return`#${B.toString(16).padStart(2,"0")}${Q.toString(16).padStart(2,"0")}${g.toString(16).padStart(2,"0")}${C.toString(16).padStart(2,"0")}`}({r:I,g:D,b:w,a:o*B})}function D(A){return"from-css"===A.type?"var(--ch-0)":A.type}function w(A,B){const Q=A.colors||{};if(Q[B])return Q[B];const g=s[B];if(!g)throw new Error(`Unknown theme color key: ${B}`);return"string"==typeof g?w(A,g):function(A,B){const Q=B[A.type];if(Array.isArray(Q)){const[B,g,...E]=Q;return B(w(A,g),...E)}return Q}(A,g)}const o="#6FC3DF",s={"editor.foreground":{dark:"#bbbbbb",light:"#333333",hc:"#ffffff"},"editorLineNumber.foreground":{dark:"#858585",light:"#237893",hc:"#fffffe"},"editor.selectionBackground":{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},"editor.background":{light:"#fffffe",dark:"#1E1E1E",hc:"#000000"},"editorGroupHeader.tabsBackground":{dark:"#252526",light:"#F3F3F3"},"tab.activeBackground":"editor.background","tab.activeForeground":{dark:"#ffffff",light:"#333333",hc:"#ffffff"},"tab.border":{dark:"#252526",light:"#F3F3F3",hc:o},"tab.activeBorder":"tab.activeBackground","tab.inactiveBackground":{dark:"#2D2D2D",light:"#ECECEC"},"tab.inactiveForeground":{dark:[I,"tab.activeForeground",.5],light:[I,"tab.activeForeground",.5],hc:"#ffffff"},"diffEditor.insertedTextBackground":{dark:"#9ccc2c33",light:"#9ccc2c40"},"diffEditor.removedTextBackground":{dark:"#ff000033",light:"#ff000033"},"diffEditor.insertedLineBackground":{dark:"#9bb95533",light:"#9bb95533"},"diffEditor.removedLineBackground":{dark:"#ff000033",light:"#ff000033"},"icon.foreground":{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},"sideBar.background":{dark:"#252526",light:"#F3F3F3",hc:"#000000"},"sideBar.foreground":"editor.foreground","sideBar.border":"sideBar.background","list.inactiveSelectionBackground":{dark:"#37373D",light:"#E4E6F1"},"list.inactiveSelectionForeground":{},"list.hoverBackground":{dark:"#2A2D2E",light:"#F0F0F0"},"list.hoverForeground":{},"editorGroupHeader.tabsBorder":{hc:o},"tab.activeBorderTop":{hc:o},"tab.hoverBackground":"tab.inactiveBackground","tab.hoverForeground":"tab.inactiveForeground","editor.rangeHighlightBackground":{dark:"#ffffff0b",light:"#fdff0033"},"editor.infoForeground":{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},"input.border":{hc:o},"input.background":{dark:"#3C3C3C",light:"#fffffe",hc:"#000000"},"input.foreground":"editor.foreground","editor.lineHighlightBackground":{},focusBorder:{light:"#0090F1",dark:"#007FD4",hc:o},"editorGroup.border":{dark:"#444444",light:"#E7E7E7",hc:o},"list.activeSelectionBackground":{dark:"#094771",light:"#0060C0",hc:"#000000"},"list.activeSelectionForeground":{dark:"#fffffe",light:"#fffffe",hc:"#fffffe"},"lighter.inlineBackground":{dark:[I,"editor.background",.9],light:[I,"editor.background",.9]},"terminal.background":"editor.background","terminal.foreground":"editor.foreground","terminal.ansiBlack":{dark:"#000000",light:"#000000",hc:"#000000"},"terminal.ansiRed":{dark:"#cd3131",light:"#cd3131",hc:"#cd0000"},"terminal.ansiGreen":{dark:"#0DBC79",light:"#00BC00",hc:"#00cd00"},"terminal.ansiYellow":{dark:"#e5e510",light:"#949800",hc:"#cdcd00"},"terminal.ansiBlue":{dark:"#2472c8",light:"#0451a5",hc:"#0000ee"},"terminal.ansiMagenta":{dark:"#bc3fbc",light:"#bc05bc",hc:"#cd00cd"},"terminal.ansiCyan":{dark:"#11a8cd",light:"#0598bc",hc:"#00cdcd"},"terminal.ansiWhite":{dark:"#e5e5e5",light:"#555555",hc:"#e5e5e5"},"terminal.ansiBrightBlack":{dark:"#666666",light:"#666666",hc:"#7f7f7f"},"terminal.ansiBrightRed":{dark:"#f14c4c",light:"#cd3131",hc:"#ff0000"},"terminal.ansiBrightGreen":{dark:"#23d18b",light:"#14CE14",hc:"#00ff00"},"terminal.ansiBrightYellow":{dark:"#f5f543",light:"#b5ba00",hc:"#ffff00"},"terminal.ansiBrightBlue":{dark:"#3b8eea",light:"#0451a5",hc:"#5c5cff"},"terminal.ansiBrightMagenta":{dark:"#d670d6",light:"#bc05bc",hc:"#ff00ff"},"terminal.ansiBrightCyan":{dark:"#29b8db",light:"#0598bc",hc:"#00ffff"},"terminal.ansiBrightWhite":{dark:"#e5e5e5",light:"#a5a5a5",hc:"#ffffff"}},e=new Map,c=new Map;async function i(A){if("string"==typeof A){const Q=A;if(!h.includes(Q))throw new F(Q);if(!e.has(Q)){const A=async function(A){try{return await async function(A){throw new Error("no fs")}()}catch(Q){return await B(`themes/${A}`)}}(Q).then((A=>(c.set(Q,A),A)));e.set(Q,A)}return e.get(Q)}return A}function t(A){let B=null;if("string"==typeof A){if(B=c.get(A),!B)throw new Error("Syntax highlighting error: theme not loaded")}else B=A;return function(A){if(!A)return;const B=A.settings||A.tokenColors||[],Q={name:A.name||"unknown-theme",type:M(A),foreground:"",background:"",settings:B,colors:A.colors||{},colorNames:A.colorNames},g=B.find((A=>!A.scope));if(g){const{foreground:A,background:B}=(null==g?void 0:g.settings)||{},E={};A&&!Q.colors["editor.foreground"]&&(E["editor.foreground"]=A),B&&!Q.colors["editor.background"]&&(E["editor.background"]=B),Object.keys(E).length>0&&(Q.colors=Object.assign(Object.assign({},Q.colors),E)),Q.foreground=A,Q.background=B}g||(Q.settings=[{settings:{foreground:w(Q,"editor.foreground"),background:w(Q,"editor.background")}},...Q.settings]);if(Q.background=Q.background||w(Q,"editor.background"),Q.foreground=Q.foreground||w(Q,"editor.foreground"),"from-css"===A.type&&!Q.colorNames){const A={};let B=0;Q.settings=Q.settings.map((Q=>{const g=Object.assign(Object.assign({},Q),{settings:Object.assign({},Q.settings)}),{foreground:E,background:C}=g.settings||{};return E&&!A[E]&&(A[E]=`#${B.toString(16).padStart(6,"0")}`,B++),C&&!A[C]&&(A[C]=`#${B.toString(16).padStart(6,"0")}`,B++),E&&(g.settings.foreground=A[E]),C&&(g.settings.background=A[C]),g})),Q.colorNames=A}return Q}(B)}function M(A){var B;if("from-css"===A.type)return"from-css";return"light"===(A.type?A.type:(null===(B=A.name)||void 0===B?void 0:B.toLowerCase().includes("light"))?"light":"dark")?"light":"dark"}const h=["dark-plus","dracula-soft","dracula","github-dark","github-dark-dimmed","github-from-css","github-light","light-plus","material-darker","material-default","material-from-css","material-lighter","material-ocean","material-palenight","min-dark","min-light","monokai","nord","one-dark-pro","poimandres","slack-dark","slack-ochin","solarized-dark","solarized-light"];class F extends Error{constructor(A){super(`Unknown theme: ${A}`),this.theme=A}}function G(A){const B=B=>"colorScheme"===B?D(A):"foreground"===B?A.foreground:"background"===B?A.background:w(A,B);return{colorScheme:B("colorScheme"),foreground:B("foreground"),background:B("background"),lighter:{inlineBackground:B("lighter.inlineBackground")},editor:{background:B("editor.background"),foreground:B("editor.foreground"),lineHighlightBackground:B("editor.lineHighlightBackground"),rangeHighlightBackground:B("editor.rangeHighlightBackground"),infoForeground:B("editor.infoForeground"),selectionBackground:B("editor.selectionBackground")},focusBorder:B("focusBorder"),tab:{activeBackground:B("tab.activeBackground"),activeForeground:B("tab.activeForeground"),inactiveBackground:B("tab.inactiveBackground"),inactiveForeground:B("tab.inactiveForeground"),border:B("tab.border"),activeBorder:B("tab.activeBorder"),activeBorderTop:B("tab.activeBorderTop")},editorGroup:{border:B("editorGroup.border")},editorGroupHeader:{tabsBackground:B("editorGroupHeader.tabsBackground")},editorLineNumber:{foreground:B("editorLineNumber.foreground")},input:{background:B("input.background"),foreground:B("input.foreground"),border:B("input.border")},icon:{foreground:B("icon.foreground")},sideBar:{background:B("sideBar.background"),foreground:B("sideBar.foreground"),border:B("sideBar.border")},list:{activeSelectionBackground:B("list.activeSelectionBackground"),activeSelectionForeground:B("list.activeSelectionForeground"),hoverBackground:B("list.hoverBackground"),hoverForeground:B("list.hoverForeground")}}}const a=["abap","actionscript-3","ada","adoc","angular-html","angular-ts","apache","apex","apl","applescript","ara","asciidoc","asm","astro","awk","ballerina","bash","bat","batch","be","beancount","berry","bibtex","bicep","blade","c","c#","c++","cadence","cdc","clarity","clj","clojure","closure-templates","cmake","cmd","cobol","codeowners","codeql","coffee","coffeescript","common-lisp","console","cpp","cql","crystal","cs","csharp","css","csv","cue","cypher","d","dart","dax","desktop","diff","docker","dockerfile","dotenv","dream-maker","edge","elisp","elixir","elm","emacs-lisp","erb","erl","erlang","f","f#","f03","f08","f18","f77","f90","f95","fennel","fish","fluent","for","fortran-fixed-form","fortran-free-form","fs","fsharp","fsl","ftl","gdresource","gdscript","gdshader","genie","gherkin","git-commit","git-rebase","gjs","gleam","glimmer-js","glimmer-ts","glsl","gnuplot","go","gql","graphql","groovy","gts","hack","haml","handlebars","haskell","haxe","hbs","hcl","hjson","hlsl","hs","html","html-derivative","http","hxml","hy","imba","ini","jade","java","javascript","jinja","jison","jl","js","json","json5","jsonc","jsonl","jsonnet","jssm","jsx","julia","kotlin","kql","kt","kts","kusto","latex","lean","lean4","less","liquid","lisp","lit","log","logo","lua","luau","make","makefile","markdown","marko","matlab","md","mdc","mdx","mediawiki","mermaid","mojo","move","nar","narrat","nextflow","nf","nginx","nim","nix","nu","nushell","objc","objective-c","objective-cpp","ocaml","pascal","perl","perl6","php","plsql","po","postcss","pot","potx","powerquery","powershell","prisma","prolog","properties","proto","ps","ps1","pug","puppet","purescript","py","python","ql","qml","qmldir","qss","r","racket","raku","razor","rb","reg","regex","regexp","rel","riscv","rs","rst","ruby","rust","sas","sass","scala","scheme","scss","sh","shader","shaderlab","shell","shellscript","shellsession","smalltalk","solidity","soy","sparql","spl","splunk","sql","ssh-config","stata","styl","stylus","svelte","swift","system-verilog","systemd","tasl","tcl","templ","terminal","terraform","tex","text","tf","tfvars","toml","ts","ts-tags","tsp","tsv","tsx","turtle","twig","txt","typ","typescript","typespec","typst","v","vala","vb","verilog","vhdl","vim","viml","vimscript","vue","vue-html","vy","vyper","wasm","wenyan","wgsl","wiki","wikitext","wl","wolfram","xml","xsl","yaml","yml","zenscript","zig","zsh","文言"],n={abap:"source.abap","actionscript-3":"source.actionscript.3",ada:"source.ada","angular-html":"text.html.derivative.ng","angular-ts":"source.ts.ng",apache:"source.apacheconf",apex:"source.apex",apl:"source.apl",applescript:"source.applescript",ara:"source.ara",asciidoc:"text.asciidoc",adoc:"text.asciidoc",asm:"source.asm.x86_64",astro:"source.astro",awk:"source.awk",ballerina:"source.ballerina",bat:"source.batchfile",batch:"source.batchfile",beancount:"text.beancount",berry:"source.berry",be:"source.berry",bibtex:"text.bibtex",bicep:"source.bicep",blade:"text.html.php.blade",c:"source.c",cadence:"source.cadence",cdc:"source.cadence",clarity:"source.clar",clojure:"source.clojure",clj:"source.clojure",cmake:"source.cmake",cobol:"source.cobol",codeowners:"text.codeowners",codeql:"source.ql",ql:"source.ql",coffee:"source.coffee",coffeescript:"source.coffee","common-lisp":"source.commonlisp",lisp:"source.commonlisp",cpp:"source.cpp","c++":"source.cpp",crystal:"source.crystal",csharp:"source.cs","c#":"source.cs",cs:"source.cs",css:"source.css",csv:"text.csv",cue:"source.cue",cypher:"source.cypher",cql:"source.cypher",d:"source.d",dart:"source.dart",dax:"source.dax",desktop:"source.desktop",diff:"source.diff",docker:"source.dockerfile",dockerfile:"source.dockerfile",dotenv:"source.dotenv","dream-maker":"source.dm",edge:"text.html.edge",elixir:"source.elixir",elm:"source.elm","emacs-lisp":"source.emacs.lisp",elisp:"source.emacs.lisp",erb:"text.html.erb",erlang:"source.erlang",erl:"source.erlang",fennel:"source.fnl",fish:"source.fish",fluent:"source.ftl",ftl:"source.ftl","fortran-fixed-form":"source.fortran.fixed",f:"source.fortran.fixed",for:"source.fortran.fixed",f77:"source.fortran.fixed","fortran-free-form":"source.fortran.free",f90:"source.fortran.free",f95:"source.fortran.free",f03:"source.fortran.free",f08:"source.fortran.free",f18:"source.fortran.free",fsharp:"source.fsharp","f#":"source.fsharp",fs:"source.fsharp",gdresource:"source.gdresource",gdscript:"source.gdscript",gdshader:"source.gdshader",genie:"source.genie",gherkin:"text.gherkin.feature","git-commit":"text.git-commit","git-rebase":"text.git-rebase",gleam:"source.gleam","glimmer-js":"source.gjs",gjs:"source.gjs","glimmer-ts":"source.gts",gts:"source.gts",glsl:"source.glsl",gnuplot:"source.gnuplot",go:"source.go",graphql:"source.graphql",gql:"source.graphql",groovy:"source.groovy",hack:"source.hack",haml:"text.haml",handlebars:"text.html.handlebars",hbs:"text.html.handlebars",haskell:"source.haskell",hs:"source.haskell",haxe:"source.hx",hcl:"source.hcl",hjson:"source.hjson",hlsl:"source.hlsl",html:"text.html.basic","html-derivative":"text.html.derivative",http:"source.http",hxml:"source.hxml",hy:"source.hy",imba:"source.imba",ini:"source.ini",properties:"source.ini",java:"source.java",javascript:"source.js",js:"source.js",jinja:"source.jinja",jison:"source.jison",json:"source.json",json5:"source.json5",jsonc:"source.json.comments",jsonl:"source.json.lines",jsonnet:"source.jsonnet",jssm:"source.jssm",fsl:"source.jssm",jsx:"source.js.jsx",julia:"source.julia",jl:"source.julia",kotlin:"source.kotlin",kt:"source.kotlin",kts:"source.kotlin",kusto:"source.kusto",kql:"source.kusto",latex:"text.tex.latex",lean:"source.lean4",lean4:"source.lean4",less:"source.css.less",liquid:"text.html.liquid",log:"text.log",logo:"source.logo",lua:"source.lua",luau:"source.luau",make:"source.makefile",makefile:"source.makefile",markdown:"text.html.markdown",md:"text.html.markdown",marko:"text.marko",matlab:"source.matlab",mdc:"text.markdown.mdc",mdx:"source.mdx",mermaid:"markdown.mermaid.codeblock",mojo:"source.mojo",move:"source.move",narrat:"source.narrat",nar:"source.narrat",nextflow:"source.nextflow",nf:"source.nextflow",nginx:"source.nginx",nim:"source.nim",nix:"source.nix",nushell:"source.nushell",nu:"source.nushell","objective-c":"source.objc",objc:"source.objc","objective-cpp":"source.objcpp",ocaml:"source.ocaml",pascal:"source.pascal",perl:"source.perl",php:"source.php",plsql:"source.plsql.oracle",po:"source.po",pot:"source.po",potx:"source.po",postcss:"source.css.postcss",powerquery:"source.powerquery",powershell:"source.powershell",ps:"source.powershell",ps1:"source.powershell",prisma:"source.prisma",prolog:"source.prolog",proto:"source.proto",pug:"text.pug",jade:"text.pug",puppet:"source.puppet",purescript:"source.purescript",python:"source.python",py:"source.python",qml:"source.qml",qmldir:"source.qmldir",qss:"source.qss",r:"source.r",racket:"source.racket",raku:"source.perl.6",perl6:"source.perl.6",razor:"text.aspnetcorerazor",reg:"source.reg",regexp:"source.regexp.python",regex:"source.regexp.python",rel:"source.rel",riscv:"source.riscv",rst:"source.rst",ruby:"source.ruby",rb:"source.ruby",rust:"source.rust",rs:"source.rust",sas:"source.sas",sass:"source.sass",scala:"source.scala",scheme:"source.scheme",scss:"source.css.scss",shaderlab:"source.shaderlab",shader:"source.shaderlab",shellscript:"source.shell",bash:"source.shell",sh:"source.shell",shell:"source.shell",zsh:"source.shell",shellsession:"text.shell-session",console:"text.shell-session",smalltalk:"source.smalltalk",solidity:"source.solidity",soy:"text.html.soy","closure-templates":"text.html.soy",sparql:"source.sparql",splunk:"source.splunk_search",spl:"source.splunk_search",sql:"source.sql","ssh-config":"source.ssh-config",stata:"source.stata",stylus:"source.stylus",styl:"source.stylus",svelte:"source.svelte",swift:"source.swift","system-verilog":"source.systemverilog",systemd:"source.systemd",tasl:"source.tasl",tcl:"source.tcl",templ:"source.templ",terraform:"source.hcl.terraform",tf:"source.hcl.terraform",tfvars:"source.hcl.terraform",tex:"text.tex",toml:"source.toml","ts-tags":"source.ts.tags",lit:"source.ts.tags",tsv:"text.tsv",tsx:"source.tsx",turtle:"source.turtle",twig:"text.html.twig",txt:"source.txt",typescript:"source.ts",ts:"source.ts",typespec:"source.tsp",tsp:"source.tsp",typst:"source.typst",typ:"source.typst",v:"source.v",vala:"source.vala",vb:"source.asp.vb.net",cmd:"source.asp.vb.net",verilog:"source.verilog",vhdl:"source.vhdl",viml:"source.viml",vim:"source.viml",vimscript:"source.viml",vue:"source.vue","vue-html":"text.html.vue-html",vyper:"source.vyper",vy:"source.vyper",wasm:"source.wat",wenyan:"source.wenyan","文言":"source.wenyan",wgsl:"source.wgsl",wikitext:"source.wikitext",mediawiki:"source.wikitext",wiki:"source.wikitext",wolfram:"source.wolfram",wl:"source.wolfram",xml:"text.xml",xsl:"text.xml.xsl",yaml:"source.yaml",yml:"source.yaml",zenscript:"source.zenscript",zig:"source.zig"},N={"source.abap":{id:"abap",embeddedScopes:[]},"source.actionscript.3":{id:"actionscript-3",embeddedScopes:[]},"source.ada":{id:"ada",embeddedScopes:[]},"text.html.derivative.ng":{id:"angular-html",embeddedScopes:["text.html.basic"]},"source.ts.ng":{id:"angular-ts",embeddedScopes:[]},"source.apacheconf":{id:"apache",embeddedScopes:[]},"source.apex":{id:"apex",embeddedScopes:[]},"source.apl":{id:"apl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.json"]},"source.applescript":{id:"applescript",embeddedScopes:[]},"source.ara":{id:"ara",embeddedScopes:[]},"text.asciidoc":{id:"asciidoc",embeddedScopes:["text.html.basic","source.yaml","text.csv","source.c","source.clojure","source.coffee","source.cpp","source.css","source.cs","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.groovy","source.haskell","source.java","source.js","source.json","source.js.jsx","source.julia","source.kotlin","source.css.less","source.makefile","source.objc","source.ocaml","source.perl","source.python","source.r","source.ruby","source.rust","source.sass","source.scala","source.css.scss","source.shell","source.sql","source.swift","source.toml","source.ts","text.xml"]},"source.asm.x86_64":{id:"asm",embeddedScopes:[]},"source.astro":{id:"astro",embeddedScopes:["source.json","source.js","source.ts","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","source.tsx"]},"source.awk":{id:"awk",embeddedScopes:[]},"source.ballerina":{id:"ballerina",embeddedScopes:[]},"source.batchfile":{id:"bat",embeddedScopes:[]},"text.beancount":{id:"beancount",embeddedScopes:[]},"source.berry":{id:"berry",embeddedScopes:[]},"text.bibtex":{id:"bibtex",embeddedScopes:[]},"source.bicep":{id:"bicep",embeddedScopes:[]},"text.html.php.blade":{id:"blade",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.c":{id:"c",embeddedScopes:[]},"source.cadence":{id:"cadence",embeddedScopes:[]},"source.clar":{id:"clarity",embeddedScopes:[]},"source.clojure":{id:"clojure",embeddedScopes:[]},"source.cmake":{id:"cmake",embeddedScopes:[]},"source.cobol":{id:"cobol",embeddedScopes:["source.sql","text.html.basic","source.java"]},"text.codeowners":{id:"codeowners",embeddedScopes:[]},"source.ql":{id:"codeql",embeddedScopes:[]},"source.coffee":{id:"coffee",embeddedScopes:["source.js"]},"source.commonlisp":{id:"common-lisp",embeddedScopes:[]},"source.cpp":{id:"cpp",embeddedScopes:["source.regexp.python","source.glsl","source.sql"]},"source.crystal":{id:"crystal",embeddedScopes:["text.html.basic","source.sql","source.css","source.c","source.js","source.shell"]},"source.cs":{id:"csharp",embeddedScopes:[]},"source.css":{id:"css",embeddedScopes:[]},"text.csv":{id:"csv",embeddedScopes:[]},"source.cue":{id:"cue",embeddedScopes:[]},"source.cypher":{id:"cypher",embeddedScopes:[]},"source.d":{id:"d",embeddedScopes:[]},"source.dart":{id:"dart",embeddedScopes:[]},"source.dax":{id:"dax",embeddedScopes:[]},"source.desktop":{id:"desktop",embeddedScopes:[]},"source.diff":{id:"diff",embeddedScopes:[]},"source.dockerfile":{id:"docker",embeddedScopes:[]},"source.dotenv":{id:"dotenv",embeddedScopes:[]},"source.dm":{id:"dream-maker",embeddedScopes:[]},"text.html.edge":{id:"edge",embeddedScopes:["source.ts","text.html.basic","text.html.derivative"]},"source.elixir":{id:"elixir",embeddedScopes:["text.html.basic"]},"source.elm":{id:"elm",embeddedScopes:["source.glsl"]},"source.emacs.lisp":{id:"emacs-lisp",embeddedScopes:[]},"text.html.erb":{id:"erb",embeddedScopes:["text.html.basic","source.ruby"]},"source.erlang":{id:"erlang",embeddedScopes:[]},"source.fnl":{id:"fennel",embeddedScopes:[]},"source.fish":{id:"fish",embeddedScopes:[]},"source.ftl":{id:"fluent",embeddedScopes:[]},"source.fortran.fixed":{id:"fortran-fixed-form",embeddedScopes:["source.fortran.free"]},"source.fortran.free":{id:"fortran-free-form",embeddedScopes:[]},"source.fsharp":{id:"fsharp",embeddedScopes:["text.html.markdown"]},"source.gdresource":{id:"gdresource",embeddedScopes:["source.gdshader","source.gdscript"]},"source.gdscript":{id:"gdscript",embeddedScopes:[]},"source.gdshader":{id:"gdshader",embeddedScopes:[]},"source.genie":{id:"genie",embeddedScopes:[]},"text.gherkin.feature":{id:"gherkin",embeddedScopes:[]},"text.git-commit":{id:"git-commit",embeddedScopes:["source.diff"]},"text.git-rebase":{id:"git-rebase",embeddedScopes:["source.shell"]},"source.gleam":{id:"gleam",embeddedScopes:[]},"source.gjs":{id:"glimmer-js",embeddedScopes:["source.js","source.ts","source.css","text.html.basic"]},"source.gts":{id:"glimmer-ts",embeddedScopes:["source.ts","source.css","source.js","text.html.basic"]},"source.glsl":{id:"glsl",embeddedScopes:["source.c"]},"source.gnuplot":{id:"gnuplot",embeddedScopes:[]},"source.go":{id:"go",embeddedScopes:[]},"source.graphql":{id:"graphql",embeddedScopes:["source.js","source.ts","source.js.jsx","source.tsx"]},"source.groovy":{id:"groovy",embeddedScopes:[]},"source.hack":{id:"hack",embeddedScopes:["text.html.basic","source.sql"]},"text.haml":{id:"haml",embeddedScopes:["source.ruby","source.js","source.sass","source.coffee","text.html.markdown","source.css"]},"text.html.handlebars":{id:"handlebars",embeddedScopes:["text.html.basic","source.css","source.js","source.yaml"]},"source.haskell":{id:"haskell",embeddedScopes:[]},"source.hx":{id:"haxe",embeddedScopes:[]},"source.hcl":{id:"hcl",embeddedScopes:[]},"source.hjson":{id:"hjson",embeddedScopes:[]},"source.hlsl":{id:"hlsl",embeddedScopes:[]},"text.html.basic":{id:"html",embeddedScopes:["source.js","source.css"]},"text.html.derivative":{id:"html-derivative",embeddedScopes:["text.html.basic"]},"source.http":{id:"http",embeddedScopes:["source.shell","source.json","text.xml","source.graphql"]},"source.hxml":{id:"hxml",embeddedScopes:["source.hx"]},"source.hy":{id:"hy",embeddedScopes:[]},"source.imba":{id:"imba",embeddedScopes:["source.ts"]},"source.ini":{id:"ini",embeddedScopes:[]},"source.java":{id:"java",embeddedScopes:[]},"source.js":{id:"javascript",embeddedScopes:[]},"source.jinja":{id:"jinja",embeddedScopes:[]},"source.jison":{id:"jison",embeddedScopes:["source.js"]},"source.json":{id:"json",embeddedScopes:[]},"source.json5":{id:"json5",embeddedScopes:[]},"source.json.comments":{id:"jsonc",embeddedScopes:[]},"source.json.lines":{id:"jsonl",embeddedScopes:[]},"source.jsonnet":{id:"jsonnet",embeddedScopes:[]},"source.jssm":{id:"jssm",embeddedScopes:[]},"source.js.jsx":{id:"jsx",embeddedScopes:[]},"source.julia":{id:"julia",embeddedScopes:["source.cpp","source.python","source.js","source.r","source.sql"]},"source.kotlin":{id:"kotlin",embeddedScopes:[]},"source.kusto":{id:"kusto",embeddedScopes:[]},"text.tex.latex":{id:"latex",embeddedScopes:["text.tex","source.shell","source.css","source.gnuplot","source.haskell","text.html.basic","source.java","source.julia","source.js","source.lua","source.python","source.ruby","source.rust","source.ts","text.xml","source.yaml","source.scala"]},"source.lean4":{id:"lean",embeddedScopes:[]},"source.css.less":{id:"less",embeddedScopes:[]},"text.html.liquid":{id:"liquid",embeddedScopes:["text.html.basic","source.css","source.json","source.js"]},"text.log":{id:"log",embeddedScopes:[]},"source.logo":{id:"logo",embeddedScopes:[]},"source.lua":{id:"lua",embeddedScopes:["source.c"]},"source.luau":{id:"luau",embeddedScopes:[]},"source.makefile":{id:"make",embeddedScopes:[]},"text.html.markdown":{id:"markdown",embeddedScopes:["source.css","text.html.basic","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","text.git-commit","text.git-rebase","source.go","source.groovy","text.pug","source.js","source.json","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.regexp.python","source.rust","source.scala","source.shell","source.ts","source.tsx","source.cs","source.fsharp","source.dart","text.html.handlebars","text.log","source.erlang","source.elixir","text.tex.latex","text.bibtex","text.html.derivative"]},"text.marko":{id:"marko",embeddedScopes:["source.css","source.css.less","source.css.scss","source.js"]},"source.matlab":{id:"matlab",embeddedScopes:[]},"text.markdown.mdc":{id:"mdc",embeddedScopes:["text.html.markdown","source.yaml","text.html.derivative"]},"source.mdx":{id:"mdx",embeddedScopes:["source.tsx","source.toml","source.yaml","source.c","source.clojure","source.coffee","source.cpp","source.cs","source.css","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.graphql","source.haskell","text.html.basic","source.ini","source.java","source.js","source.json","source.julia","source.kotlin","source.css.less","source.lua","source.makefile","text.html.markdown","source.objc","source.perl","source.python","source.r","source.ruby","source.rust","source.scala","source.css.scss","source.shell","text.shell-session","source.sql","text.xml","source.swift","source.ts"]},"markdown.mermaid.codeblock":{id:"mermaid",embeddedScopes:[]},"source.mojo":{id:"mojo",embeddedScopes:[]},"source.move":{id:"move",embeddedScopes:[]},"source.narrat":{id:"narrat",embeddedScopes:[]},"source.nextflow":{id:"nextflow",embeddedScopes:[]},"source.nginx":{id:"nginx",embeddedScopes:["source.lua"]},"source.nim":{id:"nim",embeddedScopes:["source.c","text.html.basic","text.xml","source.js","source.css","source.glsl","text.html.markdown"]},"source.nix":{id:"nix",embeddedScopes:[]},"source.nushell":{id:"nushell",embeddedScopes:[]},"source.objc":{id:"objective-c",embeddedScopes:[]},"source.objcpp":{id:"objective-cpp",embeddedScopes:[]},"source.ocaml":{id:"ocaml",embeddedScopes:[]},"source.pascal":{id:"pascal",embeddedScopes:[]},"source.perl":{id:"perl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.sql"]},"source.php":{id:"php",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.plsql.oracle":{id:"plsql",embeddedScopes:[]},"source.po":{id:"po",embeddedScopes:[]},"source.css.postcss":{id:"postcss",embeddedScopes:[]},"source.powerquery":{id:"powerquery",embeddedScopes:[]},"source.powershell":{id:"powershell",embeddedScopes:[]},"source.prisma":{id:"prisma",embeddedScopes:[]},"source.prolog":{id:"prolog",embeddedScopes:[]},"source.proto":{id:"proto",embeddedScopes:[]},"text.pug":{id:"pug",embeddedScopes:["source.js","source.css","source.sass","source.css.scss","source.stylus","source.coffee","text.html.basic"]},"source.puppet":{id:"puppet",embeddedScopes:[]},"source.purescript":{id:"purescript",embeddedScopes:[]},"source.python":{id:"python",embeddedScopes:[]},"source.qml":{id:"qml",embeddedScopes:["source.js"]},"source.qmldir":{id:"qmldir",embeddedScopes:[]},"source.qss":{id:"qss",embeddedScopes:[]},"source.r":{id:"r",embeddedScopes:[]},"source.racket":{id:"racket",embeddedScopes:[]},"source.perl.6":{id:"raku",embeddedScopes:[]},"text.aspnetcorerazor":{id:"razor",embeddedScopes:["text.html.basic","source.cs"]},"source.reg":{id:"reg",embeddedScopes:[]},"source.regexp.python":{id:"regexp",embeddedScopes:[]},"source.rel":{id:"rel",embeddedScopes:[]},"source.riscv":{id:"riscv",embeddedScopes:[]},"source.rst":{id:"rst",embeddedScopes:["text.html.derivative","source.cpp","source.python","source.js","source.shell","source.yaml","source.cmake","source.ruby"]},"source.ruby":{id:"ruby",embeddedScopes:["text.html.basic","text.xml","source.sql","source.css","source.c","source.js","source.shell","source.lua"]},"source.rust":{id:"rust",embeddedScopes:[]},"source.sas":{id:"sas",embeddedScopes:["source.sql"]},"source.sass":{id:"sass",embeddedScopes:[]},"source.scala":{id:"scala",embeddedScopes:[]},"source.scheme":{id:"scheme",embeddedScopes:[]},"source.css.scss":{id:"scss",embeddedScopes:["source.css"]},"source.shaderlab":{id:"shaderlab",embeddedScopes:["source.hlsl"]},"source.shell":{id:"shellscript",embeddedScopes:[]},"text.shell-session":{id:"shellsession",embeddedScopes:["source.shell"]},"source.smalltalk":{id:"smalltalk",embeddedScopes:[]},"source.solidity":{id:"solidity",embeddedScopes:[]},"text.html.soy":{id:"soy",embeddedScopes:["text.html.basic"]},"source.sparql":{id:"sparql",embeddedScopes:["source.turtle"]},"source.splunk_search":{id:"splunk",embeddedScopes:[]},"source.sql":{id:"sql",embeddedScopes:[]},"source.ssh-config":{id:"ssh-config",embeddedScopes:[]},"source.stata":{id:"stata",embeddedScopes:["source.sql"]},"source.stylus":{id:"stylus",embeddedScopes:[]},"source.svelte":{id:"svelte",embeddedScopes:["source.js","source.ts","source.coffee","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","text.pug","text.html.markdown"]},"source.swift":{id:"swift",embeddedScopes:[]},"source.systemverilog":{id:"system-verilog",embeddedScopes:[]},"source.systemd":{id:"systemd",embeddedScopes:[]},"source.tasl":{id:"tasl",embeddedScopes:[]},"source.tcl":{id:"tcl",embeddedScopes:[]},"source.templ":{id:"templ",embeddedScopes:["source.go","source.js","source.css"]},"source.hcl.terraform":{id:"terraform",embeddedScopes:[]},"text.tex":{id:"tex",embeddedScopes:["source.r"]},"source.toml":{id:"toml",embeddedScopes:[]},"source.ts.tags":{id:"ts-tags",embeddedScopes:["source.ts"]},"text.tsv":{id:"tsv",embeddedScopes:[]},"source.tsx":{id:"tsx",embeddedScopes:[]},"source.turtle":{id:"turtle",embeddedScopes:[]},"text.html.twig":{id:"twig",embeddedScopes:["source.css","source.js","source.css.scss","source.php","source.python","source.ruby"]},"source.txt":{id:"txt",embeddedScopes:[]},"source.ts":{id:"typescript",embeddedScopes:[]},"source.tsp":{id:"typespec",embeddedScopes:[]},"source.typst":{id:"typst",embeddedScopes:[]},"source.v":{id:"v",embeddedScopes:[]},"source.vala":{id:"vala",embeddedScopes:[]},"source.asp.vb.net":{id:"vb",embeddedScopes:[]},"source.verilog":{id:"verilog",embeddedScopes:[]},"source.vhdl":{id:"vhdl",embeddedScopes:[]},"source.viml":{id:"viml",embeddedScopes:[]},"source.vue":{id:"vue",embeddedScopes:["text.html.basic","text.html.markdown","text.pug","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.js","source.ts","source.js.jsx","source.tsx","source.coffee","source.json","source.json.comments","source.json5","source.yaml","source.toml","source.graphql","text.html.derivative"]},"text.html.vue-html":{id:"vue-html",embeddedScopes:["source.vue","source.js"]},"source.vyper":{id:"vyper",embeddedScopes:[]},"source.wat":{id:"wasm",embeddedScopes:[]},"source.wenyan":{id:"wenyan",embeddedScopes:[]},"source.wgsl":{id:"wgsl",embeddedScopes:[]},"source.wikitext":{id:"wikitext",embeddedScopes:["text.html.basic","source.css","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","source.go","source.groovy","text.pug","source.js","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.rust","source.scala","source.shell","source.ts","source.cs","source.fsharp","source.dart","text.html.handlebars","text.html.markdown","source.erlang","source.elixir","text.tex.latex","text.bibtex","source.json"]},"source.wolfram":{id:"wolfram",embeddedScopes:[]},"text.xml":{id:"xml",embeddedScopes:["source.java"]},"text.xml.xsl":{id:"xsl",embeddedScopes:["text.xml"]},"source.yaml":{id:"yaml",embeddedScopes:[]},"source.zenscript":{id:"zenscript",embeddedScopes:[]},"source.zig":{id:"zig",embeddedScopes:[]}};var r={d:(A,B)=>{for(var Q in B)r.o(B,Q)&&!r.o(A,Q)&&Object.defineProperty(A,Q,{enumerable:!0,get:B[Q]})},o:(A,B)=>Object.prototype.hasOwnProperty.call(A,B)},H={};r.d(H,{_X:()=>vA,Bz:()=>XA,ot:()=>TA,u:()=>WA,jG:()=>Y,Pn:()=>ZA});const L="undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG;var k;function R(A,B){const Q=[],g=function(A){let B=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,Q=B.exec(A);return{next:()=>{if(!Q)return null;const g=Q[0];return Q=B.exec(A),g}}}(A);let E=g.next();for(;null!==E;){let A=0;if(2===E.length&&":"===E.charAt(1)){switch(E.charAt(0)){case"R":A=1;break;case"L":A=-1;break;default:console.log(`Unknown priority ${E} in scope selector`)}E=g.next()}let B=I();if(Q.push({matcher:B,priority:A}),","!==E)break;E=g.next()}return Q;function C(){if("-"===E){E=g.next();const A=C();return B=>!!A&&!A(B)}if("("===E){E=g.next();const A=function(){const A=[];let B=I();for(;B&&(A.push(B),"|"===E||","===E);){do{E=g.next()}while("|"===E||","===E);B=I()}return B=>A.some((A=>A(B)))}();return")"===E&&(E=g.next()),A}if(K(E)){const A=[];do{A.push(E),E=g.next()}while(K(E));return Q=>B(A,Q)}return null}function I(){const A=[];let B=C();for(;B;)A.push(B),B=C();return B=>A.every((A=>A(B)))}}function K(A){return!!A&&!!A.match(/[\w\.:]+/)}function Y(A){"function"==typeof A.dispose&&A.dispose()}function U(A){return Array.isArray(A)?function(A){let B=[];for(let Q=0,g=A.length;Q{for(let Q in B)A[Q]=B[Q]})),A}function u(A){const B=~A.lastIndexOf("/")||~A.lastIndexOf("\\");return 0===B?A:~B==A.length-1?u(A.substring(0,A.length-1)):A.substr(1+~B)}!function(A){A.toBinaryStr=function(A){let B=A.toString(2);for(;B.length<32;)B="0"+B;return B},A.print=function(B){const Q=A.getLanguageId(B),g=A.getTokenType(B),E=A.getFontStyle(B),C=A.getForeground(B),I=A.getBackground(B);console.log({languageId:Q,tokenType:g,fontStyle:E,foreground:C,background:I})},A.getLanguageId=function(A){return(255&A)>>>0},A.getTokenType=function(A){return(768&A)>>>8},A.containsBalancedBrackets=function(A){return 0!=(1024&A)},A.getFontStyle=function(A){return(30720&A)>>>11},A.getForeground=function(A){return(16744448&A)>>>15},A.getBackground=function(A){return(4278190080&A)>>>24},A.set=function(B,Q,g,E,C,I,D){let w=A.getLanguageId(B),o=A.getTokenType(B),s=A.containsBalancedBrackets(B)?1:0,e=A.getFontStyle(B),c=A.getForeground(B),i=A.getBackground(B);return 0!==Q&&(w=Q),8!==g&&(o=g),null!==E&&(s=E?1:0),-1!==C&&(e=C),0!==I&&(c=I),0!==D&&(i=D),(w<<0|o<<8|s<<10|e<<11|c<<15|i<<24)>>>0}}(k||(k={}));let y=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;class J{static hasCaptures(A){return null!==A&&(y.lastIndex=0,y.test(A))}static replaceCaptures(A,B,Q){return A.replace(y,((A,g,E,C)=>{let I=Q[parseInt(g||E,10)];if(!I)return A;{let A=B.substring(I.start,I.end);for(;"."===A[0];)A=A.substring(1);switch(C){case"downcase":return A.toLowerCase();case"upcase":return A.toUpperCase();default:return A}}}))}}function S(A,B){return AB?1:0}function d(A,B){if(null===A&&null===B)return 0;if(!A)return-1;if(!B)return 1;let Q=A.length,g=B.length;if(Q===g){for(let g=0;g`);return}const C=Q.lookup(B);A instanceof O?X({baseGrammar:C,selfGrammar:E},g):T(A.ruleName,{baseGrammar:C,selfGrammar:E,repository:E.repository},g);const I=Q.injections(A.scopeName);if(I)for(const A of I)g.add(new O(A))}function T(A,B,Q){B.repository&&B.repository[A]&&v([B.repository[A]],B,Q)}function X(A,B){A.selfGrammar.patterns&&Array.isArray(A.selfGrammar.patterns)&&v(A.selfGrammar.patterns,{...A,repository:A.selfGrammar.repository},B),A.selfGrammar.injections&&v(Object.values(A.selfGrammar.injections),{...A,repository:A.selfGrammar.repository},B)}function v(A,B,Q){for(const g of A){if(Q.visitedRule.has(g))continue;Q.visitedRule.add(g);const A=g.repository?P({},B.repository,g.repository):B.repository;Array.isArray(g.patterns)&&v(g.patterns,{...B,repository:A},Q);const E=g.include;if(!E)continue;const C=$(E);switch(C.kind){case 0:X({...B,selfGrammar:B.baseGrammar},Q);break;case 1:X(B,Q);break;case 2:T(C.ruleName,{...B,repository:A},Q);break;case 3:case 4:const g=C.scopeName===B.selfGrammar.scopeName?B.selfGrammar:C.scopeName===B.baseGrammar.scopeName?B.baseGrammar:void 0;if(g){const E={baseGrammar:B.baseGrammar,selfGrammar:g,repository:A};4===C.kind?T(C.ruleName,E,Q):X(E,Q)}else 4===C.kind?Q.add(new m(C.scopeName,C.ruleName)):Q.add(new O(C.scopeName))}}}class Z{constructor(){this.kind=0}}class j{constructor(){this.kind=1}}class V{constructor(A){this.ruleName=A,this.kind=2}}class z{constructor(A){this.scopeName=A,this.kind=3}}class _{constructor(A,B){this.scopeName=A,this.ruleName=B,this.kind=4}}function $(A){if("$base"===A)return new Z;if("$self"===A)return new j;const B=A.indexOf("#");if(-1===B)return new z(A);if(0===B)return new V(A.substring(1));{const Q=A.substring(0,B),g=A.substring(B+1);return new _(Q,g)}}const AA=/\\(\d+)/,BA=/\\(\d+)/g;class QA{constructor(A,B,Q,g){this.$location=A,this.id=B,this._name=Q||null,this._nameIsCapturing=J.hasCaptures(this._name),this._contentName=g||null,this._contentNameIsCapturing=J.hasCaptures(this._contentName)}get debugName(){const A=this.$location?`${u(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${A}`}getName(A,B){return this._nameIsCapturing&&null!==this._name&&null!==A&&null!==B?J.replaceCaptures(this._name,A,B):this._name}getContentName(A,B){return this._contentNameIsCapturing&&null!==this._contentName?J.replaceCaptures(this._contentName,A,B):this._contentName}}class gA extends QA{constructor(A,B,Q,g,E){super(A,B,Q,g),this.retokenizeCapturedWithRuleId=E}dispose(){}collectPatterns(A,B){throw new Error("Not supported!")}compile(A,B){throw new Error("Not supported!")}compileAG(A,B,Q,g){throw new Error("Not supported!")}}class EA extends QA{constructor(A,B,Q,g,E){super(A,B,Q,null),this._match=new oA(g,this.id),this.captures=E,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(A,B){B.push(this._match)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new sA,this.collectPatterns(A,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class CA extends QA{constructor(A,B,Q,g,E){super(A,B,Q,g),this.patterns=E.patterns,this.hasMissingPatterns=E.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(A,B){for(const Q of this.patterns)A.getRule(Q).collectPatterns(A,B)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new sA,this.collectPatterns(A,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class IA extends QA{constructor(A,B,Q,g,E,C,I,D,w,o){super(A,B,Q,g),this._begin=new oA(E,this.id),this.beginCaptures=C,this._end=new oA(I||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=D,this.applyEndPatternLast=w||!1,this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(A,B){return this._end.resolveBackReferences(A,B)}collectPatterns(A,B){B.push(this._begin)}compile(A,B){return this._getCachedCompiledPatterns(A,B).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A,B).compileAG(A,Q,g)}_getCachedCompiledPatterns(A,B){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new sA;for(const B of this.patterns)A.getRule(B).collectPatterns(A,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,B):this._cachedCompiledPatterns.setSource(0,B)),this._cachedCompiledPatterns}}class DA extends QA{constructor(A,B,Q,g,E,C,I,D,w){super(A,B,Q,g),this._begin=new oA(E,this.id),this.beginCaptures=C,this.whileCaptures=D,this._while=new oA(I,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=w.patterns,this.hasMissingPatterns=w.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(A,B){return this._while.resolveBackReferences(A,B)}collectPatterns(A,B){B.push(this._begin)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new sA;for(const B of this.patterns)A.getRule(B).collectPatterns(A,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(A,B){return this._getCachedCompiledWhilePatterns(A,B).compile(A)}compileWhileAG(A,B,Q,g){return this._getCachedCompiledWhilePatterns(A,B).compileAG(A,Q,g)}_getCachedCompiledWhilePatterns(A,B){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new sA,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,B||"￿"),this._cachedCompiledWhilePatterns}}class wA{static createCaptureRule(A,B,Q,g,E){return A.registerRule((A=>new gA(B,A,Q,g,E)))}static getCompiledRuleId(A,B,Q){return A.id||B.registerRule((g=>{if(A.id=g,A.match)return new EA(A.$vscodeTextmateLocation,A.id,A.name,A.match,wA._compileCaptures(A.captures,B,Q));if(void 0===A.begin){A.repository&&(Q=P({},Q,A.repository));let g=A.patterns;return void 0===g&&A.include&&(g=[{include:A.include}]),new CA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,wA._compilePatterns(g,B,Q))}return A.while?new DA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,A.begin,wA._compileCaptures(A.beginCaptures||A.captures,B,Q),A.while,wA._compileCaptures(A.whileCaptures||A.captures,B,Q),wA._compilePatterns(A.patterns,B,Q)):new IA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,A.begin,wA._compileCaptures(A.beginCaptures||A.captures,B,Q),A.end,wA._compileCaptures(A.endCaptures||A.captures,B,Q),A.applyEndPatternLast,wA._compilePatterns(A.patterns,B,Q))})),A.id}static _compileCaptures(A,B,Q){let g=[];if(A){let E=0;for(const B in A){if("$vscodeTextmateLocation"===B)continue;const A=parseInt(B,10);A>E&&(E=A)}for(let A=0;A<=E;A++)g[A]=null;for(const E in A){if("$vscodeTextmateLocation"===E)continue;const C=parseInt(E,10);let I=0;A[E].patterns&&(I=wA.getCompiledRuleId(A[E],B,Q)),g[C]=wA.createCaptureRule(B,A[E].$vscodeTextmateLocation,A[E].name,A[E].contentName,I)}}return g}static _compilePatterns(A,B,Q){let g=[];if(A)for(let E=0,C=A.length;EA.substring(B.start,B.end)));return BA.lastIndex=0,this.source.replace(BA,((A,B)=>p(Q[parseInt(B,10)]||"")))}_buildAnchorCache(){let A,B,Q,g,E=[],C=[],I=[],D=[];for(A=0,B=this.source.length;AA.source));this._cached=new eA(A,B,this._items.map((A=>A.ruleId)))}return this._cached}compileAG(A,B,Q){return this._hasAnchors?B?Q?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(A,B,Q)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(A,B,Q)),this._anchorCache.A1_G0):Q?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(A,B,Q)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(A,B,Q)),this._anchorCache.A0_G0):this.compile(A)}_resolveAnchors(A,B,Q){let g=this._items.map((A=>A.resolveAnchors(B,Q)));return new eA(A,g,this._items.map((A=>A.ruleId)))}}class eA{constructor(A,B,Q){this.regExps=B,this.rules=Q,this.scanner=A.createOnigScanner(B)}dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const A=[];for(let B=0,Q=this.rules.length;Bthis._root.match(A)))}static createFromRawTheme(A,B){return this.createFromParsedTheme(function(A){if(!A)return[];if(!A.settings||!Array.isArray(A.settings))return[];let B=A.settings,Q=[],g=0;for(let A=0,E=B.length;A1&&(s=C.slice(0,C.length-1),s.reverse()),Q[g++]=new hA(o,s,A,I,D,w)}}return Q}(A),B)}static createFromParsedTheme(A,B){return function(A,B){A.sort(((A,B)=>{let Q=S(A.scope,B.scope);return 0!==Q?Q:(Q=d(A.parentScopes,B.parentScopes),0!==Q?Q:A.index-B.index)}));let Q=0,g="#000000",E="#ffffff";for(;A.length>=1&&""===A[0].scope;){let B=A.shift();-1!==B.fontStyle&&(Q=B.fontStyle),null!==B.foreground&&(g=B.foreground),null!==B.background&&(E=B.background)}let C=new FA(B),I=new MA(Q,C.getId(g),C.getId(E)),D=new aA(new GA(0,null,-1,0,0),[]);for(let B=0,Q=A.length;Bfunction(A,B){if(null===B)return!0;let Q=0,g=B[Q];for(;A;){if(tA(A.scopeName,g)){if(Q++,Q===B.length)return!0;g=B[Q]}A=A.parent}return!1}(A.parent,B.parentScopes)));return Q?new MA(Q.fontStyle,Q.foreground,Q.background):null}}class iA{constructor(A,B){this.parent=A,this.scopeName=B}static push(A,B){for(const Q of B)A=new iA(A,Q);return A}static from(...A){let B=null;for(let Q=0;QA?console.log("how did this happen?"):this.scopeDepth=A,-1!==B&&(this.fontStyle=B),0!==Q&&(this.foreground=Q),0!==g&&(this.background=g)}}class aA{constructor(A,B=[],Q={}){this._mainRule=A,this._children=Q,this._rulesWithParentScopes=B}static _sortBySpecificity(A){return 1===A.length||A.sort(this._cmpBySpecificity),A}static _cmpBySpecificity(A,B){if(A.scopeDepth===B.scopeDepth){const Q=A.parentScopes,g=B.parentScopes;let E=null===Q?0:Q.length,C=null===g?0:g.length;if(E===C)for(let A=0;A{const B=this._scopeToLanguage(A),Q=this._toStandardTokenType(A);return new nA(B,Q)})),this._defaultAttributes=new nA(A,8),this._embeddedLanguagesMatcher=new rA(Object.entries(B||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(A){return null===A?NA._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(A)}_scopeToLanguage(A){return this._embeddedLanguagesMatcher.match(A)||0}_toStandardTokenType(A){const B=A.match(NA.STANDARD_TOKEN_TYPE_REGEXP);if(!B)return 8;switch(B[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}}NA._NULL_SCOPE_METADATA=new nA(0,0),NA.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class rA{constructor(A){if(0===A.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(A);const B=A.map((([A,B])=>p(A)));B.sort(),B.reverse(),this.scopesRegExp=new RegExp(`^((${B.join(")|(")}))($|\\.)`,"")}}match(A){if(!this.scopesRegExp)return;const B=A.match(this.scopesRegExp);return B?this.values.get(B[1]):void 0}}class HA{constructor(A,B){this.stack=A,this.stoppedEarly=B}}function LA(A,B,Q,g,E,C,I,D){const w=B.content.length;let o=!1,s=-1;if(I){const I=function(A,B,Q,g,E,C){let I=E.beginRuleCapturedEOL?0:-1;const D=[];for(let B=E;B;B=B.pop()){const Q=B.getRule(A);Q instanceof DA&&D.push({rule:Q,stack:B})}for(let w=D.pop();w;w=D.pop()){const{ruleScanner:D,findOptions:o}=RA(w.rule,A,w.stack.endRule,Q,g===I),s=D.findNextMatchSync(B,g,o);if(L&&(console.log(" scanning for while rule"),console.log(D.toString())),!s){L&&console.log(" popping "+w.rule.debugName+" - "+w.rule.debugWhileRegExp),E=w.stack.pop();break}if(-2!==s.ruleId){E=w.stack.pop();break}s.captureIndices&&s.captureIndices.length&&(C.produce(w.stack,s.captureIndices[0].start),KA(A,B,Q,w.stack,C,w.rule.whileCaptures,s.captureIndices),C.produce(w.stack,s.captureIndices[0].end),I=s.captureIndices[0].end,s.captureIndices[0].end>g&&(g=s.captureIndices[0].end,Q=!1))}return{stack:E,linePos:g,anchorPosition:I,isFirstLine:Q}}(A,B,Q,g,E,C);E=I.stack,g=I.linePos,Q=I.isFirstLine,s=I.anchorPosition}const e=Date.now();for(;!o;){if(0!==D&&Date.now()-e>D)return new HA(E,!0);c()}return new HA(E,!1);function c(){L&&(console.log(""),console.log(`@@scanNext ${g}: |${B.content.substr(g).replace(/\n$/,"\\n")}|`));const I=function(A,B,Q,g,E,C){const I=function(A,B,Q,g,E,C){const I=E.getRule(A),{ruleScanner:D,findOptions:w}=kA(I,A,E.endRule,Q,g===C);let o=0;L&&(o=x());const s=D.findNextMatchSync(B,g,w);if(L){const A=x()-o;A>5&&console.warn(`Rule ${I.debugName} (${I.id}) matching took ${A} against '${B}'`),console.log(` scanning for (linePos: ${g}, anchorPosition: ${C})`),console.log(D.toString()),s&&console.log(`matched rule id: ${s.ruleId} from ${s.captureIndices[0].start} to ${s.captureIndices[0].end}`)}return s?{captureIndices:s.captureIndices,matchedRuleId:s.ruleId}:null}(A,B,Q,g,E,C),D=A.getInjections();if(0===D.length)return I;const w=function(A,B,Q,g,E,C,I){let D,w=Number.MAX_VALUE,o=null,s=0;const e=C.contentNameScopesList.getScopeNames();for(let C=0,c=A.length;C=w)&&(w=F,o=h.captureIndices,D=h.ruleId,s=c.priority,w===E))break}return o?{priorityMatch:-1===s,captureIndices:o,matchedRuleId:D}:null}(D,A,B,Q,g,E,C);if(!w)return I;if(!I)return w;const o=I.captureIndices[0].start,s=w.captureIndices[0].start;return s0)&&D[0].end>g;if(-1===e){const I=E.getRule(A);L&&console.log(" popping "+I.debugName+" - "+I.debugEndRegExp),C.produce(E,D[0].start),E=E.withContentNameScopesList(E.nameScopesList),KA(A,B,Q,E,C,I.endCaptures,D),C.produce(E,D[0].end);const e=E;if(E=E.parent,s=e.getAnchorPos(),!c&&e.getEnterPos()===g)return L&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),E=e,C.produce(E,w),void(o=!0)}else{const I=A.getRule(e);C.produce(E,D[0].start);const i=E,t=I.getName(B.content,D),M=E.contentNameScopesList.pushAttributed(t,A);if(E=E.push(e,g,s,D[0].end===w,null,M,M),I instanceof IA){const g=I;L&&console.log(" pushing "+g.debugName+" - "+g.debugBeginRegExp),KA(A,B,Q,E,C,g.beginCaptures,D),C.produce(E,D[0].end),s=D[0].end;const e=g.getContentName(B.content,D),t=M.pushAttributed(e,A);if(E=E.withContentNameScopesList(t),g.endHasBackReferences&&(E=E.withEndRule(g.getEndWithResolvedBackReferences(B.content,D))),!c&&i.hasSameRuleAs(E))return L&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),E=E.pop(),C.produce(E,w),void(o=!0)}else if(I instanceof DA){const g=I;L&&console.log(" pushing "+g.debugName),KA(A,B,Q,E,C,g.beginCaptures,D),C.produce(E,D[0].end),s=D[0].end;const e=g.getContentName(B.content,D),t=M.pushAttributed(e,A);if(E=E.withContentNameScopesList(t),g.whileHasBackReferences&&(E=E.withEndRule(g.getWhileWithResolvedBackReferences(B.content,D))),!c&&i.hasSameRuleAs(E))return L&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),E=E.pop(),C.produce(E,w),void(o=!0)}else{const g=I;if(L&&console.log(" matched "+g.debugName+" - "+g.debugMatchRegExp),KA(A,B,Q,E,C,g.captures,D),C.produce(E,D[0].end),E=E.pop(),!c)return L&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),E=E.safePop(),C.produce(E,w),void(o=!0)}}D[0].end>g&&(g=D[0].end,Q=!1)}}function kA(A,B,Q,g,E){return{ruleScanner:A.compileAG(B,Q,g,E),findOptions:0}}function RA(A,B,Q,g,E){return{ruleScanner:A.compileWhileAG(B,Q,g,E),findOptions:0}}function KA(A,B,Q,g,E,C,I){if(0===C.length)return;const D=B.content,w=Math.min(C.length,I.length),o=[],s=I[0].end;for(let B=0;Bs)break;for(;o.length>0&&o[o.length-1].endPos<=e.start;)E.produceFromScopes(o[o.length-1].scopes,o[o.length-1].endPos),o.pop();if(o.length>0?E.produceFromScopes(o[o.length-1].scopes,e.start):E.produce(g,e.start),w.retokenizeCapturedWithRuleId){const B=w.getName(D,I),C=g.contentNameScopesList.pushAttributed(B,A),o=w.getContentName(D,I),s=C.pushAttributed(o,A),c=g.push(w.retokenizeCapturedWithRuleId,e.start,-1,!1,null,C,s),i=A.createOnigString(D.substring(0,e.end));LA(A,i,Q&&0===e.start,e.start,c,E,!1,0),Y(i);continue}const c=w.getName(D,I);if(null!==c){const B=(o.length>0?o[o.length-1].scopes:g.contentNameScopesList).pushAttributed(c,A);o.push(new YA(B,e.end))}}for(;o.length>0;)E.produceFromScopes(o[o.length-1].scopes,o[o.length-1].endPos),o.pop()}class YA{constructor(A,B){this.scopes=A,this.endPos=B}}function UA(A,B,Q,g,E){const C=R(B,PA),I=wA.getCompiledRuleId(Q,g,E.repository);for(const Q of C)A.push({debugSelector:B,matcher:Q.matcher,ruleId:I,grammar:E,priority:Q.priority})}function PA(A,B){if(B.length{for(let g=Q;gQ&&A.substr(0,Q)===B&&"."===A[Q]}class yA{constructor(A,B,Q,g,E,C,I,D){if(this._rootScopeName=A,this.balancedBracketSelectors=C,this._onigLib=D,this._basicScopeAttributesProvider=new NA(Q,g),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=I,this._grammar=JA(B,null),this._injections=null,this._tokenTypeMatchers=[],E)for(const A of Object.keys(E)){const B=R(A,PA);for(const Q of B)this._tokenTypeMatchers.push({matcher:Q.matcher,type:E[A]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const A of this._ruleId2desc)A&&A.dispose()}createOnigScanner(A){return this._onigLib.createOnigScanner(A)}createOnigString(A){return this._onigLib.createOnigString(A)}getMetadataForScope(A){return this._basicScopeAttributesProvider.getBasicScopeAttributes(A)}_collectInjections(){const A=[],B=this._rootScopeName,Q=(A=>A===this._rootScopeName?this._grammar:this.getExternalGrammar(A))(B);if(Q){const g=Q.injections;if(g)for(let B in g)UA(A,B,g[B],this,Q);const E=this._grammarRepository.injections(B);E&&E.forEach((B=>{const Q=this.getExternalGrammar(B);if(Q){const B=Q.injectionSelector;B&&UA(A,B,Q,this,Q)}}))}return A.sort(((A,B)=>A.priority-B.priority)),A}getInjections(){if(null===this._injections&&(this._injections=this._collectInjections(),L&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const A of this._injections)console.log(` - ${A.debugSelector}`)}return this._injections}registerRule(A){const B=++this._lastRuleId,Q=A(B);return this._ruleId2desc[B]=Q,Q}getRule(A){return this._ruleId2desc[A]}getExternalGrammar(A,B){if(this._includedGrammars[A])return this._includedGrammars[A];if(this._grammarRepository){const Q=this._grammarRepository.lookup(A);if(Q)return this._includedGrammars[A]=JA(Q,B&&B.$base),this._includedGrammars[A]}}tokenizeLine(A,B,Q=0){const g=this._tokenize(A,B,!1,Q);return{tokens:g.lineTokens.getResult(g.ruleStack,g.lineLength),ruleStack:g.ruleStack,stoppedEarly:g.stoppedEarly}}tokenizeLine2(A,B,Q=0){const g=this._tokenize(A,B,!0,Q);return{tokens:g.lineTokens.getBinaryResult(g.ruleStack,g.lineLength),ruleStack:g.ruleStack,stoppedEarly:g.stoppedEarly}}_tokenize(A,B,Q,g){let E;if(-1===this._rootId&&(this._rootId=wA.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),B&&B!==dA.NULL)E=!1,B.reset();else{E=!0;const A=this._basicScopeAttributesProvider.getDefaultAttributes(),Q=this.themeProvider.getDefaults(),g=k.set(0,A.languageId,A.tokenType,null,Q.fontStyle,Q.foregroundId,Q.backgroundId),C=this.getRule(this._rootId).getName(null,null);let I;I=C?SA.createRootAndLookUpScopeName(C,g,this):SA.createRoot("unknown",g),B=new dA(null,this._rootId,-1,-1,!1,null,I,I)}A+="\n";const C=this.createOnigString(A),I=C.content.length,D=new pA(Q,A,this._tokenTypeMatchers,this.balancedBracketSelectors),w=LA(this,C,E,0,B,D,!0,g);return Y(C),{lineLength:I,lineTokens:D,ruleStack:w.stack,stoppedEarly:w.stoppedEarly}}}function JA(A,B){return(A=U(A)).repository=A.repository||{},A.repository.$self={$vscodeTextmateLocation:A.$vscodeTextmateLocation,patterns:A.patterns,name:A.scopeName},A.repository.$base=B||A.repository.$self,A}class SA{constructor(A,B,Q){this.parent=A,this.scopePath=B,this.tokenAttributes=Q}static fromExtension(A,B){let Q=A,g=A?.scopePath??null;for(const A of B)g=iA.push(g,A.scopeNames),Q=new SA(Q,g,A.encodedTokenAttributes);return Q}static createRoot(A,B){return new SA(null,new iA(null,A),B)}static createRootAndLookUpScopeName(A,B,Q){const g=Q.getMetadataForScope(A),E=new iA(null,A),C=Q.themeProvider.themeMatch(E),I=SA.mergeAttributes(B,g,C);return new SA(null,E,I)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(A){return SA.equals(this,A)}static equals(A,B){for(;;){if(A===B)return!0;if(!A&&!B)return!0;if(!A||!B)return!1;if(A.scopeName!==B.scopeName||A.tokenAttributes!==B.tokenAttributes)return!1;A=A.parent,B=B.parent}}static mergeAttributes(A,B,Q){let g=-1,E=0,C=0;return null!==Q&&(g=Q.fontStyle,E=Q.foregroundId,C=Q.backgroundId),k.set(A,B.languageId,B.tokenType,null,g,E,C)}pushAttributed(A,B){if(null===A)return this;if(-1===A.indexOf(" "))return SA._pushAttributed(this,A,B);const Q=A.split(/ /g);let g=this;for(const A of Q)g=SA._pushAttributed(g,A,B);return g}static _pushAttributed(A,B,Q){const g=Q.getMetadataForScope(B),E=A.scopePath.push(B),C=Q.themeProvider.themeMatch(E),I=SA.mergeAttributes(A.tokenAttributes,g,C);return new SA(A,E,I)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(A){const B=[];let Q=this;for(;Q&&Q!==A;)B.push({encodedTokenAttributes:Q.tokenAttributes,scopeNames:Q.scopePath.getExtensionIfDefined(Q.parent?.scopePath??null)}),Q=Q.parent;return Q===A?B.reverse():void 0}}class dA{constructor(A,B,Q,g,E,C,I,D){this.parent=A,this.ruleId=B,this.beginRuleCapturedEOL=E,this.endRule=C,this.nameScopesList=I,this.contentNameScopesList=D,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=Q,this._anchorPos=g}equals(A){return null!==A&&dA._equals(this,A)}static _equals(A,B){return A===B||!!this._structuralEquals(A,B)&&SA.equals(A.contentNameScopesList,B.contentNameScopesList)}static _structuralEquals(A,B){for(;;){if(A===B)return!0;if(!A&&!B)return!0;if(!A||!B)return!1;if(A.depth!==B.depth||A.ruleId!==B.ruleId||A.endRule!==B.endRule)return!1;A=A.parent,B=B.parent}}clone(){return this}static _reset(A){for(;A;)A._enterPos=-1,A._anchorPos=-1,A=A.parent}reset(){dA._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(A,B,Q,g,E,C,I){return new dA(this,A,B,Q,g,E,C,I)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(A){return A.getRule(this.ruleId)}toString(){const A=[];return this._writeString(A,0),"["+A.join(",")+"]"}_writeString(A,B){return this.parent&&(B=this.parent._writeString(A,B)),A[B++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,B}withContentNameScopesList(A){return this.contentNameScopesList===A?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,A)}withEndRule(A){return this.endRule===A?this:new dA(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,A,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(A){let B=this;for(;B&&B._enterPos===A._enterPos;){if(B.ruleId===A.ruleId)return!0;B=B.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(A,B){const Q=SA.fromExtension(A?.nameScopesList??null,B.nameScopesList);return new dA(A,B.ruleId,B.enterPos??-1,B.anchorPos??-1,B.beginRuleCapturedEOL,B.endRule,Q,SA.fromExtension(Q,B.contentNameScopesList))}}dA.NULL=new dA(null,0,0,0,!1,null,null,null);class lA{constructor(A,B){this.allowAny=!1,this.balancedBracketScopes=A.flatMap((A=>"*"===A?(this.allowAny=!0,[]):R(A,PA).map((A=>A.matcher)))),this.unbalancedBracketScopes=B.flatMap((A=>R(A,PA).map((A=>A.matcher))))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(A){for(const B of this.unbalancedBracketScopes)if(B(A))return!1;for(const B of this.balancedBracketScopes)if(B(A))return!0;return this.allowAny}}class pA{constructor(A,B,Q,g){this.balancedBracketSelectors=g,this._emitBinaryTokens=A,this._tokenTypeOverrides=Q,this._lineText=L?B:null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(A,B){this.produceFromScopes(A.contentNameScopesList,B)}produceFromScopes(A,B){if(this._lastTokenEndIndex>=B)return;if(this._emitBinaryTokens){let Q=A?.tokenAttributes??0,g=!1;if(this.balancedBracketSelectors?.matchesAlways&&(g=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const B=A?.getScopeNames()??[];for(const A of this._tokenTypeOverrides)A.matcher(B)&&(Q=k.set(Q,0,A.type,null,-1,0,0));this.balancedBracketSelectors&&(g=this.balancedBracketSelectors.match(B))}if(g&&(Q=k.set(Q,0,8,g,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===Q)return void(this._lastTokenEndIndex=B);if(L){const Q=A?.getScopeNames()??[];console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,B).replace(/\n$/,"\\n")+"|");for(let A=0;A0&&this._tokens[this._tokens.length-1].startIndex===B-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(A,B),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(A,B){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===B-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(A,B),this._binaryTokens[this._binaryTokens.length-2]=0);const Q=new Uint32Array(this._binaryTokens.length);for(let A=0,B=this._binaryTokens.length;A0;)10===A.charCodeAt(E)?(E++,C++,I=0):(E++,I++),B--}function w(A){null===Q?E=A:D(A-E)}function o(){for(;E0&&65279===A.charCodeAt(0)&&(E=1);let i=0,t=null,M=[],h=[],F=null;function G(A,B){M.push(i),h.push(t),i=A,t=B}function a(){if(0===M.length)return n("illegal state stack");i=M.pop(),t=h.pop()}function n(B){throw new Error("Near offset "+E+": "+B+" ~~~"+A.substr(E,50)+"~~~")}const N=function(){if(null===F)return n("missing ");let A={};null!==Q&&(A[Q]={filename:B,line:C,char:I}),t[F]=A,F=null,G(1,A)},r=function(){if(null===F)return n("missing ");let A=[];t[F]=A,F=null,G(2,A)},H=function(){let A={};null!==Q&&(A[Q]={filename:B,line:C,char:I}),t.push(A),G(1,A)},L=function(){let A=[];t.push(A),G(2,A)};function k(){if(1!==i)return n("unexpected ");a()}function R(){return 1===i||2!==i?n("unexpected "):void a()}function K(A){if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function Y(A){if(isNaN(A))return n("cannot parse float");if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function U(A){if(isNaN(A))return n("cannot parse integer");if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function P(A){if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function u(A){if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function y(A){if(1===i){if(null===F)return n("missing ");t[F]=A,F=null}else 2===i?t.push(A):t=A}function J(){let A=c(">"),B=!1;return 47===A.charCodeAt(A.length-1)&&(B=!0,A=A.substring(0,A.length-1)),{name:A.trim(),isClosed:B}}function S(A){if(A.isClosed)return"";let B=c(""),B.replace(/&#([0-9]+);/g,(function(A,B){return String.fromCodePoint(parseInt(B,10))})).replace(/&#x([0-9a-f]+);/g,(function(A,B){return String.fromCodePoint(parseInt(B,16))})).replace(/&|<|>|"|'/g,(function(A){switch(A){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return A}))}for(;E=g));){const w=A.charCodeAt(E);if(D(1),60!==w)return n("expected <");if(E>=g)return n("unexpected end of input");const c=A.charCodeAt(E);if(63===c){D(1),e("?>");continue}if(33===c){if(D(1),s("--")){e("--\x3e");continue}e(">");continue}if(47===c){if(D(1),o(),s("plist")){e(">");continue}if(s("dict")){e(">"),k();continue}if(s("array")){e(">"),R();continue}return n("unexpected closed tag")}let M=J();switch(M.name){case"dict":1===i?N():2===i?H():(t={},null!==Q&&(t[Q]={filename:B,line:C,char:I}),G(1,t)),M.isClosed&&k();continue;case"array":1===i?r():2===i?L():(t=[],G(2,t)),M.isClosed&&R();continue;case"key":d=S(M),1!==i?n("unexpected "):null!==F?n("too many "):F=d;continue;case"string":K(S(M));continue;case"real":Y(parseFloat(S(M)));continue;case"integer":U(parseInt(S(M),10));continue;case"date":P(new Date(S(M)));continue;case"data":u(S(M));continue;case"true":S(M),y(!0);continue;case"false":S(M),y(!1);continue}if(!/^plist/.test(M.name))return n("unexpected opened tag "+M.name)}var d;return t}function xA(A,B){throw new Error("Near offset "+A.pos+": "+B+" ~~~"+A.source.substr(A.pos,50)+"~~~")}class OA{constructor(A){this.source=A,this.pos=0,this.len=A.length,this.line=1,this.char=0}}class mA{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(A){return{filename:A,line:this.line,char:this.char}}}function qA(A,B){B.value=null,B.type=0,B.offset=-1,B.len=-1,B.line=-1,B.char=-1;let Q,g=A.source,E=A.pos,C=A.len,I=A.line,D=A.char;for(;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),32!==Q&&9!==Q&&13!==Q){if(10!==Q)break;E++,I++,D=0}else E++,D++}if(B.offset=E,B.line=I,B.char=D,34===Q){for(B.type=1,E++,D++;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),E++,D++,92!==Q){if(34===Q)break}else E++,D++}B.value=g.substring(B.offset+1,E-1).replace(/\\u([0-9A-Fa-f]{4})/g,((A,B)=>String.fromCodePoint(parseInt(B,16)))).replace(/\\(.)/g,((B,Q)=>{switch(Q){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:xA(A,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===Q)B.type=2,E++,D++;else if(123===Q)B.type=3,E++,D++;else if(93===Q)B.type=4,E++,D++;else if(125===Q)B.type=5,E++,D++;else if(58===Q)B.type=6,E++,D++;else if(44===Q)B.type=7,E++,D++;else if(110===Q){if(B.type=8,E++,D++,Q=g.charCodeAt(E),117!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;E++,D++}else if(116===Q){if(B.type=9,E++,D++,Q=g.charCodeAt(E),114!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),117!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),101!==Q)return!1;E++,D++}else if(102===Q){if(B.type=10,E++,D++,Q=g.charCodeAt(E),97!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),115!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),101!==Q)return!1;E++,D++}else for(B.type=11;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),!(46===Q||Q>=48&&Q<=57||101===Q||69===Q||45===Q||43===Q))break;E++,D++}return B.len=E-B.offset,null===B.value&&(B.value=g.substr(B.offset,B.len)),A.pos=E,A.line=I,A.char=D,!0}class bA{constructor(A,B){this._onigLibPromise=B,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=A}dispose(){for(const A of this._grammars.values())A.dispose()}setTheme(A){this._theme=A}getColorMap(){return this._theme.getColorMap()}addGrammar(A,B){this._rawGrammars.set(A.scopeName,A),B&&this._injectionGrammars.set(A.scopeName,B)}lookup(A){return this._rawGrammars.get(A)}injections(A){return this._injectionGrammars.get(A)}getDefaults(){return this._theme.getDefaults()}themeMatch(A){return this._theme.match(A)}async grammarForScopeName(A,B,Q,g,E){if(!this._grammars.has(A)){let C=this._rawGrammars.get(A);if(!C)return null;this._grammars.set(A,function(A,B,Q,g,E,C,I,D){return new yA(A,B,Q,g,E,C,I,D)}(A,C,B,Q,g,E,this,await this._onigLibPromise))}return this._grammars.get(A)}}function WA(A,B){let Q=0;const g=[];let E=A,C=B;for(;E!==C;)E&&(!C||E.depth>=C.depth)?(Q++,E=E.parent):(g.push(C.toStateStackFrame()),C=C.parent);return{pops:Q,newFrames:g.reverse()}}function TA(A,B){let Q=A;for(let A=0;A0;)await Promise.all(C.Q.map((A=>this._loadSingleGrammar(A.scopeName)))),C.processQueue();return this._grammarForScopeName(A,B,Q,g,E)}async _loadSingleGrammar(A){return this._ensureGrammarCache.has(A)||this._ensureGrammarCache.set(A,this._doLoadSingleGrammar(A)),this._ensureGrammarCache.get(A)}async _doLoadSingleGrammar(A){const B=await this._options.loadGrammar(A);if(B){const Q="function"==typeof this._options.getInjections?this._options.getInjections(A):void 0;this._syncRegistry.addGrammar(B,Q)}}async addGrammar(A,B=[],Q=0,g=null){return this._syncRegistry.addGrammar(A,B),await this._grammarForScopeName(A.scopeName,Q,g)}_grammarForScopeName(A,B=0,Q=null,g=null,E=null){return this._syncRegistry.grammarForScopeName(A,B,Q,g,E)}}const vA=dA.NULL,ZA=function(A,B=null){return null!==B&&/\.json$/.test(B)?(Q=A,L?function(A,B,Q){let g=new OA(A),E=new mA,C=0,I=null,D=[],w=[];function o(){D.push(C),w.push(I)}function s(){C=D.pop(),I=w.pop()}function e(A){xA(g,A)}for(;qA(g,E);){if(0===C){if(null!==I&&e("too many constructs in root"),3===E.type){I={},I.$vscodeTextmateLocation=E.toLocation(B),o(),C=1;continue}if(2===E.type){I=[],o(),C=4;continue}e("unexpected token in root")}if(2===C){if(5===E.type){s();continue}if(7===E.type){C=3;continue}e("expected , or }")}if(1===C||3===C){if(1===C&&5===E.type){s();continue}if(1===E.type){let A=E.value;if(qA(g,E)&&6===E.type||e("expected colon"),qA(g,E)||e("expected value"),C=2,1===E.type){I[A]=E.value;continue}if(8===E.type){I[A]=null;continue}if(9===E.type){I[A]=!0;continue}if(10===E.type){I[A]=!1;continue}if(11===E.type){I[A]=parseFloat(E.value);continue}if(2===E.type){let B=[];I[A]=B,o(),C=4,I=B;continue}if(3===E.type){let Q={};Q.$vscodeTextmateLocation=E.toLocation(B),I[A]=Q,o(),C=1,I=Q;continue}}e("unexpected token in dict")}if(5===C){if(4===E.type){s();continue}if(7===E.type){C=6;continue}e("expected , or ]")}if(4===C||6===C){if(4===C&&4===E.type){s();continue}if(C=5,1===E.type){I.push(E.value);continue}if(8===E.type){I.push(null);continue}if(9===E.type){I.push(!0);continue}if(10===E.type){I.push(!1);continue}if(11===E.type){I.push(parseFloat(E.value));continue}if(2===E.type){let A=[];I.push(A),o(),C=4,I=A;continue}if(3===E.type){let A={};A.$vscodeTextmateLocation=E.toLocation(B),I.push(A),o(),C=1,I=A;continue}e("unexpected token in array")}e("unknown state")}return 0!==w.length&&e("unclosed constructs"),I}(Q,B):JSON.parse(Q)):function(A,B){return L?function(A,B,Q){return fA(A,B,"$vscodeTextmateLocation")}(A,B):function(A){return fA(A,null,null)}(A)}(A,B);var Q};var jA=H.Bz,VA=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(A){var B,Q,g=void 0!==(A=A||{})?A:{};g.ready=new Promise((function(A,g){B=A,Q=g}));var E,C=Object.assign({},g),I=!1;E=function(A){let B;return"function"==typeof readbuffer?new Uint8Array(readbuffer(A)):(B=read(A,"binary"),"object"==typeof B||H(Q),B);var Q},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print);var D,w,o=g.print||console.log.bind(console),s=g.printErr||console.warn.bind(console);Object.assign(g,C),C=null,g.arguments&&g.arguments,g.thisProgram&&g.thisProgram,g.quit&&g.quit,g.wasmBinary&&(D=g.wasmBinary),g.noExitRuntime,"object"!=typeof WebAssembly&&H("no native wasm support detected");var e,c,i,t=!1,M="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function h(A,B,Q){for(var g=B+Q,E=B;A[E]&&!(E>=g);)++E;if(E-B>16&&A.buffer&&M)return M.decode(A.subarray(B,E));for(var C="";B>10,56320|1023&o)}}else C+=String.fromCharCode((31&I)<<6|D)}else C+=String.fromCharCode(I)}return C}function F(A){e=A,g.HEAP8=new Int8Array(A),g.HEAP16=new Int16Array(A),g.HEAP32=new Int32Array(A),g.HEAPU8=c=new Uint8Array(A),g.HEAPU16=new Uint16Array(A),g.HEAPU32=i=new Uint32Array(A),g.HEAPF32=new Float32Array(A),g.HEAPF64=new Float64Array(A)}g.INITIAL_MEMORY;var G=[],a=[],n=[],N=0,r=null;function H(A){g.onAbort&&g.onAbort(A),s(A="Aborted("+A+")"),t=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw Q(B),B}var L,k,R,K="data:application/octet-stream;base64,";function Y(A){return A.startsWith(K)}function U(A){try{if(A==L&&D)return new Uint8Array(D);if(E)return E(A);throw"both async and sync fetching of the wasm failed"}catch(A){H(A)}}function P(A){for(;A.length>0;)A.shift()(g)}function u(A){try{return w.grow(A-e.byteLength+65535>>>16),F(w.buffer),1}catch(A){}}Y(L="onig.wasm")||(k=L,L=g.locateFile?g.locateFile(k,""):""+k),R="undefined"!=typeof dateNow?dateNow:()=>performance.now();var y=[null,[],[]];function J(A,B){var Q=y[A];0===B||10===B?((1===A?o:s)(h(Q,0)),Q.length=0):Q.push(B)}var S,d={emscripten_get_now:R,emscripten_memcpy_big:function(A,B,Q){c.copyWithin(A,B,B+Q)},emscripten_resize_heap:function(A){var B=c.length,Q=2147483648;if((A>>>=0)>Q)return!1;let g=(A,B)=>A+(B-A%B)%B;for(var E=1;E<=4;E*=2){var C=B*(1+.2/E);if(C=Math.min(C,A+100663296),u(Math.min(Q,g(Math.max(A,C),65536))))return!0}return!1},fd_write:function(A,B,Q,g){for(var E=0,C=0;C>2],D=i[B+4>>2];B+=8;for(var w=0;w>2]=E,0}};function l(A){function Q(){S||(S=!0,g.calledRun=!0,t||(P(a),B(g),g.onRuntimeInitialized&&g.onRuntimeInitialized(),function(){if(g.postRun)for("function"==typeof g.postRun&&(g.postRun=[g.postRun]);g.postRun.length;)A=g.postRun.shift(),n.unshift(A);var A;P(n)}()))}N>0||(function(){if(g.preRun)for("function"==typeof g.preRun&&(g.preRun=[g.preRun]);g.preRun.length;)A=g.preRun.shift(),G.unshift(A);var A;P(G)}(),N>0||(g.setStatus?(g.setStatus("Running..."),setTimeout((function(){setTimeout((function(){g.setStatus("")}),1),Q()}),1)):Q()))}if(function(){var A={env:d,wasi_snapshot_preview1:d};function B(A,B){var Q,E=A.exports;g.asm=E,F((w=g.asm.memory).buffer),g.asm.__indirect_function_table,Q=g.asm.__wasm_call_ctors,a.unshift(Q),function(A){if(N--,g.monitorRunDependencies&&g.monitorRunDependencies(N),0==N&&r){var B=r;r=null,B()}}()}function E(A){B(A.instance)}function C(B){return(!D&&I&&"function"==typeof fetch?fetch(L,{credentials:"same-origin"}).then((function(A){if(!A.ok)throw"failed to load wasm binary file at '"+L+"'";return A.arrayBuffer()})).catch((function(){return U(L)})):Promise.resolve().then((function(){return U(L)}))).then((function(B){return WebAssembly.instantiate(B,A)})).then((function(A){return A})).then(B,(function(A){s("failed to asynchronously prepare wasm: "+A),H(A)}))}if(N++,g.monitorRunDependencies&&g.monitorRunDependencies(N),g.instantiateWasm)try{return g.instantiateWasm(A,B)}catch(A){s("Module.instantiateWasm callback failed with error: "+A),Q(A)}(D||"function"!=typeof WebAssembly.instantiateStreaming||Y(L)||"function"!=typeof fetch?C(E):fetch(L,{credentials:"same-origin"}).then((function(B){return WebAssembly.instantiateStreaming(B,A).then(E,(function(A){return s("wasm streaming compile failed: "+A),s("falling back to ArrayBuffer instantiation"),C(E)}))}))).catch(Q)}(),g.___wasm_call_ctors=function(){return(g.___wasm_call_ctors=g.asm.__wasm_call_ctors).apply(null,arguments)},g.___errno_location=function(){return(g.___errno_location=g.asm.__errno_location).apply(null,arguments)},g._omalloc=function(){return(g._omalloc=g.asm.omalloc).apply(null,arguments)},g._ofree=function(){return(g._ofree=g.asm.ofree).apply(null,arguments)},g._getLastOnigError=function(){return(g._getLastOnigError=g.asm.getLastOnigError).apply(null,arguments)},g._createOnigScanner=function(){return(g._createOnigScanner=g.asm.createOnigScanner).apply(null,arguments)},g._freeOnigScanner=function(){return(g._freeOnigScanner=g.asm.freeOnigScanner).apply(null,arguments)},g._findNextOnigScannerMatch=function(){return(g._findNextOnigScannerMatch=g.asm.findNextOnigScannerMatch).apply(null,arguments)},g._findNextOnigScannerMatchDbg=function(){return(g._findNextOnigScannerMatchDbg=g.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},g.stackSave=function(){return(g.stackSave=g.asm.stackSave).apply(null,arguments)},g.stackRestore=function(){return(g.stackRestore=g.asm.stackRestore).apply(null,arguments)},g.stackAlloc=function(){return(g.stackAlloc=g.asm.stackAlloc).apply(null,arguments)},g.dynCall_jiji=function(){return(g.dynCall_jiji=g.asm.dynCall_jiji).apply(null,arguments)},g.UTF8ToString=function(A,B){return A?h(c,A,B):""},r=function A(){S||l(),S||(r=A)},g.preInit)for("function"==typeof g.preInit&&(g.preInit=[g.preInit]);g.preInit.length>0;)g.preInit.pop()();return l(),A.ready});let zA=null;class _A{static _utf8ByteLength(A){let B=0;for(let Q=0,g=A.length;Q=55296&&E<=56319&&Q+1=56320&&B<=57343&&(C=65536+(E-55296<<10)|B-56320,I=!0)}B+=C<=127?1:C<=2047?2:C<=65535?3:4,I&&Q++}return B}constructor(A){const B=A.length,Q=_A._utf8ByteLength(A),g=Q!==B,E=g?new Uint32Array(B+1):null;g&&(E[B]=Q);const C=g?new Uint32Array(Q+1):null;g&&(C[Q]=B);const I=new Uint8Array(Q);let D=0;for(let Q=0;Q=55296&&w<=56319&&Q+1=56320&&B<=57343&&(o=65536+(w-55296<<10)|B-56320,s=!0)}g&&(E[Q]=D,s&&(E[Q+1]=D),o<=127?C[D+0]=Q:o<=2047?(C[D+0]=Q,C[D+1]=Q):o<=65535?(C[D+0]=Q,C[D+1]=Q,C[D+2]=Q):(C[D+0]=Q,C[D+1]=Q,C[D+2]=Q,C[D+3]=Q)),o<=127?I[D++]=o:o<=2047?(I[D++]=192|(1984&o)>>>6,I[D++]=128|(63&o)>>>0):o<=65535?(I[D++]=224|(61440&o)>>>12,I[D++]=128|(4032&o)>>>6,I[D++]=128|(63&o)>>>0):(I[D++]=240|(1835008&o)>>>18,I[D++]=128|(258048&o)>>>12,I[D++]=128|(4032&o)>>>6,I[D++]=128|(63&o)>>>0),s&&Q++}this.utf16Length=B,this.utf8Length=Q,this.utf16Value=A,this.utf8Value=I,this.utf16OffsetToUtf8=E,this.utf8OffsetToUtf16=C}createString(A){const B=A._omalloc(this.utf8Length);return A.HEAPU8.set(this.utf8Value,B),B}}class $A{constructor(A){if(this.id=++$A.LAST_ID,!zA)throw new Error("Must invoke loadWASM first.");this._onigBinding=zA,this.content=A;const B=new _A(A);this.utf16Length=B.utf16Length,this.utf8Length=B.utf8Length,this.utf16OffsetToUtf8=B.utf16OffsetToUtf8,this.utf8OffsetToUtf16=B.utf8OffsetToUtf16,this.utf8Length<1e4&&!$A._sharedPtrInUse?($A._sharedPtr||($A._sharedPtr=zA._omalloc(1e4)),$A._sharedPtrInUse=!0,zA.HEAPU8.set(B.utf8Value,$A._sharedPtr),this.ptr=$A._sharedPtr):this.ptr=B.createString(zA)}convertUtf8OffsetToUtf16(A){return this.utf8OffsetToUtf16?A<0?0:A>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[A]:A}convertUtf16OffsetToUtf8(A){return this.utf16OffsetToUtf8?A<0?0:A>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[A]:A}dispose(){this.ptr===$A._sharedPtr?$A._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}$A.LAST_ID=0,$A._sharedPtr=0,$A._sharedPtrInUse=!1;class AB{constructor(A){if(!zA)throw new Error("Must invoke loadWASM first.");const B=[],Q=[];for(let g=0,E=A.length;gWebAssembly.instantiateStreaming(A,B)}(g):function(A){return async B=>{const Q=await A.arrayBuffer();return WebAssembly.instantiate(Q,B)}}(g):function(A){return B=>WebAssembly.instantiate(A,B)}(g)}return QB=new Promise(((A,B)=>{g=A,E=B})),function(A,B,Q,g){VA({print:B,instantiateWasm:(B,Q)=>{if("undefined"==typeof performance){const A=()=>Date.now();B.env.emscripten_get_now=A,B.wasi_snapshot_preview1.emscripten_get_now=A}return A(B).then((A=>Q(A.instance)),g),{}}}).then((A=>{zA=A,Q()}))}(B,Q,g,E),QB}function EB(A){return new $A(A)}function CB(A){return new AB(A)}function IB(A){const B=n[A];if(!B)return;const{id:Q}=N[B];return{id:Q,scopeName:B}}const DB=new Map;let wB,oB;async function sB(Q){if(DB.has(Q))return DB.get(Q);const g=function(A){return N[A]}(Q);if(!g)return Promise.resolve(void 0);let E;if(void 0===wB&&(E=A(g.id),wB=E.then((()=>!0)).catch((()=>!1))),void 0===oB&&(oB=await wB),oB){const B=E||A(g.id);return DB.set(Q,B),B}const C=B(`grammars/${g.id}`);g.embeddedScopes.forEach((A=>{if(!DB.has(A)){const B=C.then((B=>null==B?void 0:B.find((B=>B.scopeName===A))));DB.set(A,B)}}));const I=C.then((A=>null==A?void 0:A.find((A=>A.scopeName===Q))));return DB.set(Q,I),I}const eB=30720,cB=16744448,iB=16775168,tB=11,MB=15,hB={NotSet:-1,None:0,Italic:1,Bold:2,Underline:4,Strikethrough:8};function FB(A,B,Q,g){const{tokens:E,ruleStack:C}=A.tokenizeLine2(Q,B),I=[];let D=Q.length;for(let A=E.length-2;A>=0;A-=2){const B=E[A],g=E[A+1],C=Q.slice(B,D);I.unshift({content:C,metadata:g}),D=B}let w=[];if(null==g?void 0:g.preserveWhitespace)w=I;else for(let A=0;A0?w[w.length-1].content+=B.content:A{const{rawTokens:E,nextStack:C}=FB(B,g,A,{preserveWhitespace:!0}),I=E.map((({content:A,metadata:B})=>({content:A,style:aB(B,Q)}))),D=function(A,B,Q,g){const{tokens:E}=Q.tokenizeLine(A,B),C=[];for(let B=0;B{if(w+=A.content.length,Q>>MB]},g=(A&eB)>>>tB;return g&hB.Italic&&(Q.fontStyle="italic"),g&hB.Bold&&(Q.fontWeight="bold"),g&hB.Underline&&(Q.textDecoration="underline"),g&hB.Strikethrough&&(Q.textDecoration="line-through"),Q}var nB=function(A){var B=null;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)B=Buffer.from(A,"base64");else{var Q=globalThis.atob(A),g=Q.length;B=new Uint8Array(new ArrayBuffer(g));for(var E=0;E({createOnigScanner:CB,createOnigString:EB})));NB=new jA({onigLib:A,loadGrammar:A=>sB(A)})}const B=A.filter((A=>!rB(A))).map((A=>{const B=IB(A);if(!B)throw new kB(A);return NB.loadGrammar(B.scopeName)}));return Promise.all(B)}function LB(A){if(rB(A))return{langId:A,grammar:null};const B=IB(A);if(!B)throw new kB(A);const Q=function(A){const{_syncRegistry:B}=NB;return null==B?void 0:B._grammars.get(A)}(B.scopeName);if(!Q)throw new Error(`Syntax highlighting error: grammar for ${A} not loaded`);return{langId:B.id,grammar:Q}}class kB extends Error{constructor(A){super(`Unknown language: ${A}`),this.alias=A}}function RB(A,B,Q){NB.setTheme(Q);const g=function(A){const B=NB.getColorMap();return A.colorNames?B.map((B=>Object.keys(A.colorNames).find((Q=>A.colorNames[Q].toUpperCase()===B.toUpperCase()))||B)):B}(Q);return function(A,B,Q){let g=null;return A.split(/\r?\n|\r/g).map((A=>{const{rawTokens:E,nextStack:C}=FB(B,g,A);return g=C,E.map((({content:A,metadata:B})=>({content:A,style:aB(B,Q)})))}))}(A,B,g)}function KB(A){return A.split(/\r?\n|\r/g).map((A=>[{content:A,style:{}}]))}function YB(A,B){return PB(A.slice(1,-1)).map((A=>{const{from:Q,to:g}=UB(A);return{lineNumber:B,fromColumn:Q,toColumn:g}}))}function UB(A){const[B,Q]=A.split(":");if(!uB(B))throw new yB(B);const g=Number(B);if(g<1)throw new JB;if(Q){if(!uB(Q))throw new yB(Q);return{from:g,to:+Q}}return{from:g,to:g}}function PB(A){return A.split(/,(?![^\[]*\])/g)}function uB(A){A=A.toString();var B=Math.abs(A),Q=parseInt(A,10);return!isNaN(B)&&Q===B&&B.toString()===A}class yB extends Error{constructor(A){super(`Invalid number "${A}" in range string`),this.number=A,Object.setPrototypeOf(this,new.target.prototype)}}class JB extends Error{constructor(){super("Invalid line or column number in range string"),Object.setPrototypeOf(this,new.target.prototype)}}const SB="#001",dB="#010",lB={name:"comments",type:"light",foreground:"",background:"",colors:{},settings:[{settings:{foreground:"#000"}},{scope:["punctuation.definition.comment"],settings:{foreground:SB}},{scope:"comment",settings:{foreground:dB}}]};function pB(A,B,Q,g){const E=B?RB(A,B,lB):KB(A),C=[];let I=1;const D=E.map((A=>{const{annotations:B,lineWithoutComments:E}=function(A,B,Q,g){if(g in fB&&A.some((A=>A.style.color===dB))){const B=fB[g];A=A.flatMap((A=>{if(A.style.color!==dB)return[A];const Q=A.content.trimStart();if(Q.startsWith(B)){const g=Q.slice(B.length),E=[{content:A.content.slice(0,A.content.length-g.length),style:{color:SB}}];return g.length&&E.push({content:g,style:A.style}),E}return[A]}))}if(!A.some((A=>A.style.color===SB)))return{annotations:[],lineWithoutComments:A};const E=[];let C=0;for(;C!A.tokens.includes(B)));I.every((A=>""===A.content.trim()))&&(I=null);return{annotations:E.map((A=>({name:A.name,query:A.query,lineNumber:A.lineNumber,rangeString:A.rangeString}))),lineWithoutComments:I}}(A,g,I,Q);if(C.push(...B),!E)return null;const D=E.map((A=>A.content)).join("");return["mdx","jsx","tsx"].includes(Q)&&B.length>0&&"{}"===D.trim()?null:(I++,D)})).filter((A=>null!==A)).join("\n"),w=C.map((A=>{var{rangeString:B,lineNumber:Q}=A,g=function(A,B){var Q={};for(var g in A)Object.prototype.hasOwnProperty.call(A,g)&&B.indexOf(g)<0&&(Q[g]=A[g]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols){var E=0;for(g=Object.getOwnPropertySymbols(A);EA.ranges.length>0));return{newCode:D,annotations:w}}const fB={"actionscript-3":"//",ada:"--",asm:"#",dart:"//",fsharp:"//",graphql:"#",http:"#",rust:"//",sparql:"#",wgsl:"//",jsonnet:"//",kql:"//",zenscript:"//",kusto:"//",turtle:"#",abap:"*",beancount:";",kotlin:"//",hlsl:"//",berry:"#",cypher:"//",elm:"--",nix:"#",viml:'"',solidity:"//",bat:"REM",shaderlab:"//",sas:"*",clarity:";;"};function xB(A,B,Q){return A&&A.startsWith("(/")?function(A,B,Q){const g=B.match(/\(\/([\s\S]*?)\/([gimuy]*)\)/);if(!g)throw new Error(`Invalid RegExp string: ${B}`);const E=new RegExp(g[1],g[2]),C=A.split(/\r?\n/).slice(Q-1).join("\n");if(!E.global){const A=E.exec(C);if(!A)return[];const B=C.slice(0,A.index).split("\n").length+Q-1;return[{fromLineNumber:B,toLineNumber:B+A[0].split("\n").length-1}]}let I;const D=[];for(;I=E.exec(C);){const A=C.slice(0,I.index).split("\n").length+Q-1,B=A+I[0].split("\n").length-1,g=D[D.length-1];g&&g.fromLineNumber===A||D.push({fromLineNumber:A,toLineNumber:B})}return D}(Q,A,B):A&&A.startsWith("[/")?function(A,B,Q){const g=B.match(/\[\/([\s\S]*?)\/([gimuy]*)\]/);if(!g)throw new Error(`Invalid RegExp string: ${B}`);let E=g[2]||"";E+="d";const C=new RegExp(g[1],E);let I=A.split(/\r?\n/);I=I.slice(Q-1),C.multiline||(I=[I[0]]);const D=[];return I.forEach(((A,B)=>{if(!C.global){if(D.length>0)return;const g=C.exec(A);if(!g)return;const E=g.indices[1]||g.indices[0];return void D.push({lineNumber:B+Q,fromColumn:E[0]+1,toColumn:E[1]})}let g;for(;g=C.exec(A);){const A=g.indices[1]||g.indices[0];D.push({lineNumber:B+Q,fromColumn:A[0]+1,toColumn:A[1]})}})),D}(Q,A,B):function(A,B){return A?A.startsWith("[")?YB(A,B):PB(A.slice(1,-1)).map((A=>{if(A.includes("[")){const[Q,g]=A.split("["),E=Number(Q),C=B+E-1;if(!uB(C))throw new yB(Q);return YB("["+g,C)}const{from:Q,to:g}=UB(A);return[{fromLineNumber:Q+B-1,toLineNumber:g+B-1}]})).flat():[{fromLineNumber:B,toLineNumber:B}]}(A,B)}function OB(A,B){var Q;const g=A.match(/\s*([\w-]+)?(\([^\)]*\)|\[[^\]]*\])?(.*)$/),E=g[1],C=g[2],I=null===(Q=g[3])||void 0===Q?void 0:Q.trim();return B.includes(E)?{name:E,rangeString:C,query:I}:null}function mB(A,B){let Q=[],g=1;return A.forEach((A=>{Q.push({fromColumn:g,toColumn:g+A.content.length-1,token:A}),g+=A.content.length})),B.forEach((A=>{Q=function(A,B){const{range:Q}=B,{fromColumn:g,toColumn:E}=Q,C=[];let I=0;for(;IE){const[A,Q]=bB(B,E+1);D.tokens.push(A),C.push(Q)}else D.tokens.push(B);I++}else C.push(D);for(;IqB(A)))}function qB(A){return"tokens"in A?{annotationName:A.annotationName,annotationQuery:A.annotationQuery,fromColumn:A.fromColumn,toColumn:A.toColumn,tokens:A.tokens.map((A=>qB(A)))}:A.token}function bB(A,B){if("token"in A){const Q=Object.assign(Object.assign({},A.token),{content:A.token.content.slice(0,B-A.fromColumn)}),g=Object.assign(Object.assign({},A.token),{content:A.token.content.slice(B-A.fromColumn)});return[Object.assign(Object.assign({},A),{toColumn:B-1,token:Q}),Object.assign(Object.assign({},A),{fromColumn:B,token:g})]}{const Q=[],g=[];A.tokens.forEach((A=>{if(A.toColumn=B)g.push(A);else{const[E,C]=bB(A,B);Q.push(E),g.push(C)}}));return[Object.assign(Object.assign({},A),{toColumn:B-1,tokens:Q}),Object.assign(Object.assign({},A),{fromColumn:B,tokens:g})]}}function WB(A,B){let Q=A.map(((A,B)=>({fromLineNumber:B+1,toLineNumber:B+1,line:A})));return B.forEach((A=>{Q=function(A,B){const{range:Q,name:g,query:E}=B,{fromLineNumber:C,toLineNumber:I}=Q,D=[];let w=0;for(;wI){const[A,Q]=XB(B,I+1);o.lines.push(A),D.push(Q)}else o.lines.push(B);w++}else D.push(o);for(;wTB(A)))}function TB(A){return"line"in A?{lineNumber:A.fromLineNumber,tokens:A.line.tokens}:{annotationName:A.annotationName,annotationQuery:A.annotationQuery,fromLineNumber:A.fromLineNumber,toLineNumber:A.toLineNumber,lines:A.lines.map((A=>TB(A)))}}function XB(A,B){if("line"in A)return[Object.assign(Object.assign({},A),{toLineNumber:B-1}),Object.assign(Object.assign({},A),{fromLineNumber:B})];{const Q=[],g=[];return A.lines.forEach((A=>{if(A.toLineNumber=B)g.push(A);else{const[E,C]=XB(A,B);Q.push(E),g.push(C)}})),[Object.assign(Object.assign({},A),{toLineNumber:B-1,lines:Q}),Object.assign(Object.assign({},A),{fromLineNumber:B,lines:g})]}}function vB(A,B){const{inlineAnnotations:Q,multilineAnnotations:g}=function(A){const B=[],Q=[];return A.forEach((A=>{A.ranges.forEach((g=>{"lineNumber"in g?B.push(Object.assign(Object.assign({},A),{range:g})):Q.push(Object.assign(Object.assign({},A),{range:g}))}))})),{inlineAnnotations:B,multilineAnnotations:Q}}(B);return WB(A.map(((A,B)=>{const g=Q.filter((A=>A.range.lineNumber===B+1));return{lineNumber:B+1,tokens:mB(A,g)}})),g)}var ZB=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],jB={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function VB(A,B){const Q=A.indexOf("[",B);if(-1!==Q){const B=A.indexOf("m",Q);return{sequence:A.substring(Q+2,B).split(";"),startPosition:Q,position:B+1}}return{position:A.length}}function zB(A,B){let Q=1;const g=A[B+Q++];let E;if("2"===g){const g=[A[B+Q++],A[B+Q++],A[B+Q]].map((A=>Number.parseInt(A)));3!==g.length||g.some((A=>Number.isNaN(A)))||(E={type:"rgb",rgb:g})}else if("5"===g){const g=Number.parseInt(A[B+Q]);Number.isNaN(g)||(E={type:"table",index:Number(g)})}return[Q,E]}function _B(A){const B=[];for(let Q=0;Q=90&&E<=97?B.push({type:"setForegroundColor",value:{type:"named",name:ZB[E-90+8]}}):E>=100&&E<=107&&B.push({type:"setBackgroundColor",value:{type:"named",name:ZB[E-100+8]}})}return B}function $B(A,B){const Q=function(){let A=null,B=null,Q=new Set;return{parse(g){const E=[];let C=0;do{const I=VB(g,C),D=I.sequence?g.substring(C,I.startPosition):g.substring(C);if(D.length>0&&E.push({value:D,foreground:A,background:B,decorations:new Set(Q)}),I.sequence){const g=_B(I.sequence);for(const E of g)"resetAll"===E.type?(A=null,B=null,Q.clear()):"resetForegroundColor"===E.type?A=null:"resetBackgroundColor"===E.type?B=null:"resetDecoration"===E.type&&Q.delete(E.value);for(const E of g)"setForegroundColor"===E.type?A=E.value:"setBackgroundColor"===E.type?B=E.value:"setDecoration"===E.type&&Q.add(E.value)}C=I.position}while(Cfunction(A,B,Q){const g=A.parse(B),E=g.map((({value:A,foreground:B,background:g,decorations:E})=>{const C=AQ(B,Q),I={};C&&(I.color=C);const D=AQ(g,Q);return D&&(I.background=D),E.has("bold")&&(I.fontWeight="bold"),E.has("italic")&&(I.fontStyle="italic"),E.has("underline")&&(I.textDecoration="underline"),E.has("strikethrough")&&(I.textDecoration="line-through"),E.has("reverse")&&(I.color=D,I.background=C),E.has("dim")&&(I.opacity=.5),{content:A,style:I}}));return E}(Q,A,B)));return g}function AQ(A,B){if(A){if("named"===A.type){return w(B,"terminal.ansi"+(A.name[0].toUpperCase()+A.name.slice(1)))}if("rgb"===A.type){const[B,Q,g]=A.rgb;return`rgb(${B}, ${Q}, ${g})`}}}async function BQ(A,B){await Promise.all([HB(A),i(B)])}async function QQ(A,B,Q="dark-plus",g={}){const E=A||"",C=B||"text";if("string"!=typeof E)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof C)throw new Error("Syntax highlighter error: lang must be a string");return await BQ([C],Q),gQ(E,C,Q,g)}function gQ(A,B,Q="dark-plus",g={}){const E=A||"",C=B||"text";if("string"!=typeof E)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof C)throw new Error("Syntax highlighter error: lang must be a string");const{langId:I,grammar:o}=LB(C),s=t(Q),e="text"==I?KB(E):"terminal"==I?$B(E,s):(null==g?void 0:g.scopes)?function(A,B,Q){return NB.setTheme(Q),GB(A,B,NB.getColorMap())}(E,o,s):RB(E,o,s),c="terminal"==I?function(A){return{color:w(A,"terminal.foreground"),background:w(A,"terminal.background"),colorScheme:D(A)}}(s):{color:s.foreground,background:s.background,colorScheme:D(s)};if(function(A){return"annotations"in A}(g)){return{lines:vB(e,(null==g?void 0:g.annotations)||[]),lang:I,style:c}}return{lines:e,lang:I,style:c}}async function EQ(A,B,Q){if(!Q)return{code:A,annotations:[]};await HB([B]);const{grammar:g,langId:E}=LB(B),{newCode:C,annotations:I}=pB(A,g,E,Q);return{code:C,annotations:I}}async function CQ(A){if(!A)throw new Error("Syntax highlighter error: undefined theme");await BQ([],A);return G(t(A))}function IQ(A){if(!A)throw new Error("Syntax highlighter error: undefined theme");return G(t(A))}export{a as LANG_NAMES,h as THEME_NAMES,kB as UnknownLanguageError,F as UnknownThemeError,EQ as extractAnnotations,CQ as getThemeColors,IQ as getThemeColorsSync,QQ as highlight,gQ as highlightSync,BQ as preload}; diff --git a/lib/dist/index.d.ts b/lib/dist/index.d.ts index 28282b4..2a45baf 100644 --- a/lib/dist/index.d.ts +++ b/lib/dist/index.d.ts @@ -103,6 +103,7 @@ type LighterResult = { style: { color: string; background: string; + colorScheme: string; }; }; type AnnotatedLighterResult = { @@ -111,6 +112,7 @@ type AnnotatedLighterResult = { style: { color: string; background: string; + colorScheme: string; }; }; diff --git a/lib/dist/index.esm.mjs b/lib/dist/index.esm.mjs index 581fa25..af1ecbc 100644 --- a/lib/dist/index.esm.mjs +++ b/lib/dist/index.esm.mjs @@ -1 +1 @@ -async function A(A){return async function(A){switch(A){case"abap":return import("./grammar/abap.mjs");case"actionscript-3":return import("./grammar/actionscript-3.mjs");case"ada":return import("./grammar/ada.mjs");case"angular-html":return import("./grammar/angular-html.mjs");case"angular-ts":return import("./grammar/angular-ts.mjs");case"apache":return import("./grammar/apache.mjs");case"apex":return import("./grammar/apex.mjs");case"apl":return import("./grammar/apl.mjs");case"applescript":return import("./grammar/applescript.mjs");case"ara":return import("./grammar/ara.mjs");case"asciidoc":return import("./grammar/asciidoc.mjs");case"asm":return import("./grammar/asm.mjs");case"astro":return import("./grammar/astro.mjs");case"awk":return import("./grammar/awk.mjs");case"ballerina":return import("./grammar/ballerina.mjs");case"bat":return import("./grammar/bat.mjs");case"beancount":return import("./grammar/beancount.mjs");case"berry":return import("./grammar/berry.mjs");case"bibtex":return import("./grammar/bibtex.mjs");case"bicep":return import("./grammar/bicep.mjs");case"blade":return import("./grammar/blade.mjs");case"c":return import("./grammar/c.mjs");case"cadence":return import("./grammar/cadence.mjs");case"clarity":return import("./grammar/clarity.mjs");case"clojure":return import("./grammar/clojure.mjs");case"cmake":return import("./grammar/cmake.mjs");case"cobol":return import("./grammar/cobol.mjs");case"codeowners":return import("./grammar/codeowners.mjs");case"codeql":return import("./grammar/codeql.mjs");case"coffee":return import("./grammar/coffee.mjs");case"common-lisp":return import("./grammar/common-lisp.mjs");case"cpp":return import("./grammar/cpp.mjs");case"crystal":return import("./grammar/crystal.mjs");case"csharp":return import("./grammar/csharp.mjs");case"css":return import("./grammar/css.mjs");case"csv":return import("./grammar/csv.mjs");case"cue":return import("./grammar/cue.mjs");case"cypher":return import("./grammar/cypher.mjs");case"d":return import("./grammar/d.mjs");case"dart":return import("./grammar/dart.mjs");case"dax":return import("./grammar/dax.mjs");case"desktop":return import("./grammar/desktop.mjs");case"diff":return import("./grammar/diff.mjs");case"docker":return import("./grammar/docker.mjs");case"dotenv":return import("./grammar/dotenv.mjs");case"dream-maker":return import("./grammar/dream-maker.mjs");case"edge":return import("./grammar/edge.mjs");case"elixir":return import("./grammar/elixir.mjs");case"elm":return import("./grammar/elm.mjs");case"emacs-lisp":return import("./grammar/emacs-lisp.mjs");case"erb":return import("./grammar/erb.mjs");case"erlang":return import("./grammar/erlang.mjs");case"fennel":return import("./grammar/fennel.mjs");case"fish":return import("./grammar/fish.mjs");case"fluent":return import("./grammar/fluent.mjs");case"fortran-fixed-form":return import("./grammar/fortran-fixed-form.mjs");case"fortran-free-form":return import("./grammar/fortran-free-form.mjs");case"fsharp":return import("./grammar/fsharp.mjs");case"gdresource":return import("./grammar/gdresource.mjs");case"gdscript":return import("./grammar/gdscript.mjs");case"gdshader":return import("./grammar/gdshader.mjs");case"genie":return import("./grammar/genie.mjs");case"gherkin":return import("./grammar/gherkin.mjs");case"git-commit":return import("./grammar/git-commit.mjs");case"git-rebase":return import("./grammar/git-rebase.mjs");case"gleam":return import("./grammar/gleam.mjs");case"glimmer-js":return import("./grammar/glimmer-js.mjs");case"glimmer-ts":return import("./grammar/glimmer-ts.mjs");case"glsl":return import("./grammar/glsl.mjs");case"gnuplot":return import("./grammar/gnuplot.mjs");case"go":return import("./grammar/go.mjs");case"graphql":return import("./grammar/graphql.mjs");case"groovy":return import("./grammar/groovy.mjs");case"hack":return import("./grammar/hack.mjs");case"haml":return import("./grammar/haml.mjs");case"handlebars":return import("./grammar/handlebars.mjs");case"haskell":return import("./grammar/haskell.mjs");case"haxe":return import("./grammar/haxe.mjs");case"hcl":return import("./grammar/hcl.mjs");case"hjson":return import("./grammar/hjson.mjs");case"hlsl":return import("./grammar/hlsl.mjs");case"html":return import("./grammar/html.mjs");case"html-derivative":return import("./grammar/html-derivative.mjs");case"http":return import("./grammar/http.mjs");case"hxml":return import("./grammar/hxml.mjs");case"hy":return import("./grammar/hy.mjs");case"imba":return import("./grammar/imba.mjs");case"ini":return import("./grammar/ini.mjs");case"java":return import("./grammar/java.mjs");case"javascript":return import("./grammar/javascript.mjs");case"jinja":return import("./grammar/jinja.mjs");case"jison":return import("./grammar/jison.mjs");case"json":return import("./grammar/json.mjs");case"json5":return import("./grammar/json5.mjs");case"jsonc":return import("./grammar/jsonc.mjs");case"jsonl":return import("./grammar/jsonl.mjs");case"jsonnet":return import("./grammar/jsonnet.mjs");case"jssm":return import("./grammar/jssm.mjs");case"jsx":return import("./grammar/jsx.mjs");case"julia":return import("./grammar/julia.mjs");case"kotlin":return import("./grammar/kotlin.mjs");case"kusto":return import("./grammar/kusto.mjs");case"latex":return import("./grammar/latex.mjs");case"lean":return import("./grammar/lean.mjs");case"less":return import("./grammar/less.mjs");case"liquid":return import("./grammar/liquid.mjs");case"log":return import("./grammar/log.mjs");case"logo":return import("./grammar/logo.mjs");case"lua":return import("./grammar/lua.mjs");case"luau":return import("./grammar/luau.mjs");case"make":return import("./grammar/make.mjs");case"markdown":return import("./grammar/markdown.mjs");case"marko":return import("./grammar/marko.mjs");case"matlab":return import("./grammar/matlab.mjs");case"mdc":return import("./grammar/mdc.mjs");case"mdx":return import("./grammar/mdx.mjs");case"mermaid":return import("./grammar/mermaid.mjs");case"mojo":return import("./grammar/mojo.mjs");case"move":return import("./grammar/move.mjs");case"narrat":return import("./grammar/narrat.mjs");case"nextflow":return import("./grammar/nextflow.mjs");case"nginx":return import("./grammar/nginx.mjs");case"nim":return import("./grammar/nim.mjs");case"nix":return import("./grammar/nix.mjs");case"nushell":return import("./grammar/nushell.mjs");case"objective-c":return import("./grammar/objective-c.mjs");case"objective-cpp":return import("./grammar/objective-cpp.mjs");case"ocaml":return import("./grammar/ocaml.mjs");case"pascal":return import("./grammar/pascal.mjs");case"perl":return import("./grammar/perl.mjs");case"php":return import("./grammar/php.mjs");case"plsql":return import("./grammar/plsql.mjs");case"po":return import("./grammar/po.mjs");case"postcss":return import("./grammar/postcss.mjs");case"powerquery":return import("./grammar/powerquery.mjs");case"powershell":return import("./grammar/powershell.mjs");case"prisma":return import("./grammar/prisma.mjs");case"prolog":return import("./grammar/prolog.mjs");case"proto":return import("./grammar/proto.mjs");case"pug":return import("./grammar/pug.mjs");case"puppet":return import("./grammar/puppet.mjs");case"purescript":return import("./grammar/purescript.mjs");case"python":return import("./grammar/python.mjs");case"qml":return import("./grammar/qml.mjs");case"qmldir":return import("./grammar/qmldir.mjs");case"qss":return import("./grammar/qss.mjs");case"r":return import("./grammar/r.mjs");case"racket":return import("./grammar/racket.mjs");case"raku":return import("./grammar/raku.mjs");case"razor":return import("./grammar/razor.mjs");case"reg":return import("./grammar/reg.mjs");case"regexp":return import("./grammar/regexp.mjs");case"rel":return import("./grammar/rel.mjs");case"riscv":return import("./grammar/riscv.mjs");case"rst":return import("./grammar/rst.mjs");case"ruby":return import("./grammar/ruby.mjs");case"rust":return import("./grammar/rust.mjs");case"sas":return import("./grammar/sas.mjs");case"sass":return import("./grammar/sass.mjs");case"scala":return import("./grammar/scala.mjs");case"scheme":return import("./grammar/scheme.mjs");case"scss":return import("./grammar/scss.mjs");case"shaderlab":return import("./grammar/shaderlab.mjs");case"shellscript":return import("./grammar/shellscript.mjs");case"shellsession":return import("./grammar/shellsession.mjs");case"smalltalk":return import("./grammar/smalltalk.mjs");case"solidity":return import("./grammar/solidity.mjs");case"soy":return import("./grammar/soy.mjs");case"sparql":return import("./grammar/sparql.mjs");case"splunk":return import("./grammar/splunk.mjs");case"sql":return import("./grammar/sql.mjs");case"ssh-config":return import("./grammar/ssh-config.mjs");case"stata":return import("./grammar/stata.mjs");case"stylus":return import("./grammar/stylus.mjs");case"svelte":return import("./grammar/svelte.mjs");case"swift":return import("./grammar/swift.mjs");case"system-verilog":return import("./grammar/system-verilog.mjs");case"systemd":return import("./grammar/systemd.mjs");case"tasl":return import("./grammar/tasl.mjs");case"tcl":return import("./grammar/tcl.mjs");case"templ":return import("./grammar/templ.mjs");case"terraform":return import("./grammar/terraform.mjs");case"tex":return import("./grammar/tex.mjs");case"toml":return import("./grammar/toml.mjs");case"ts-tags":return import("./grammar/ts-tags.mjs");case"tsv":return import("./grammar/tsv.mjs");case"tsx":return import("./grammar/tsx.mjs");case"turtle":return import("./grammar/turtle.mjs");case"twig":return import("./grammar/twig.mjs");case"txt":return import("./grammar/txt.mjs");case"typescript":return import("./grammar/typescript.mjs");case"typespec":return import("./grammar/typespec.mjs");case"typst":return import("./grammar/typst.mjs");case"v":return import("./grammar/v.mjs");case"vala":return import("./grammar/vala.mjs");case"vb":return import("./grammar/vb.mjs");case"verilog":return import("./grammar/verilog.mjs");case"vhdl":return import("./grammar/vhdl.mjs");case"viml":return import("./grammar/viml.mjs");case"vue":return import("./grammar/vue.mjs");case"vue-html":return import("./grammar/vue-html.mjs");case"vyper":return import("./grammar/vyper.mjs");case"wasm":return import("./grammar/wasm.mjs");case"wenyan":return import("./grammar/wenyan.mjs");case"wgsl":return import("./grammar/wgsl.mjs");case"wikitext":return import("./grammar/wikitext.mjs");case"wolfram":return import("./grammar/wolfram.mjs");case"xml":return import("./grammar/xml.mjs");case"xsl":return import("./grammar/xsl.mjs");case"yaml":return import("./grammar/yaml.mjs");case"zenscript":return import("./grammar/zenscript.mjs");case"zig":return import("./grammar/zig.mjs");default:throw new Error("no grammar for "+A)}}(A)}async function B(A){return async function(A){switch(A){case"dark-plus":return import("./theme/dark-plus.mjs");case"dracula-soft":return import("./theme/dracula-soft.mjs");case"dracula":return import("./theme/dracula.mjs");case"github-dark-dimmed":return import("./theme/github-dark-dimmed.mjs");case"github-dark":return import("./theme/github-dark.mjs");case"github-from-css":return import("./theme/github-from-css.mjs");case"github-light":return import("./theme/github-light.mjs");case"light-plus":return import("./theme/light-plus.mjs");case"material-darker":return import("./theme/material-darker.mjs");case"material-default":return import("./theme/material-default.mjs");case"material-from-css":return import("./theme/material-from-css.mjs");case"material-lighter":return import("./theme/material-lighter.mjs");case"material-ocean":return import("./theme/material-ocean.mjs");case"material-palenight":return import("./theme/material-palenight.mjs");case"min-dark":return import("./theme/min-dark.mjs");case"min-light":return import("./theme/min-light.mjs");case"monokai":return import("./theme/monokai.mjs");case"nord":return import("./theme/nord.mjs");case"one-dark-pro":return import("./theme/one-dark-pro.mjs");case"poimandres":return import("./theme/poimandres.mjs");case"rose-pine-dawn":return import("./theme/rose-pine-dawn.mjs");case"rose-pine-moon":return import("./theme/rose-pine-moon.mjs");case"rose-pine":return import("./theme/rose-pine.mjs");case"slack-dark":return import("./theme/slack-dark.mjs");case"slack-ochin":return import("./theme/slack-ochin.mjs");case"solarized-dark":return import("./theme/solarized-dark.mjs");case"solarized-light":return import("./theme/solarized-light.mjs");default:throw new Error("no theme for "+A)}}(A)}async function Q(A){if(console.warn("[WARN] Code Hike:","fetching resource from network",A),"function"==typeof fetch){const B=await fetch(`https://lighter.codehike.org/${A}.json`);return await B.json()}const B=await import("https"),Q={host:"lighter.codehike.org",path:`/${A}.json`,method:"GET"};return new Promise(((A,g)=>{const E=B.request(Q,(B=>{let Q="";B.on("data",(A=>{Q+=A})),B.on("end",(()=>{A(JSON.parse(Q))}))}));E.on("error",(A=>{g(A)})),E.end()}))}const g=A=>/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(A),E=(A,B)=>A.match(new RegExp(`.{${B}}`,"g")),C=A=>parseInt(A.repeat(2/A.length),16);function I(A,B){return void 0!==A?A/255:"number"!=typeof B||B<0||B>1?1:B}function D(A,B){if(!A)return A;const{r:Q,g:D,b:w,a:o}=function(A){if(!A)return;if(!g(A))throw new Error("Invalid color string, must be a valid hex color");const B=Math.floor((A.length-1)/3),Q=E(A.slice(1),B),[D,w,o,s]=Q.map(C);return{r:D,g:w,b:o,a:I(s,1)}}(A);return function(A){if(!A)return;const{r:B,g:Q,b:g,a:E}=A,C=Math.round(255*E);return`#${B.toString(16).padStart(2,"0")}${Q.toString(16).padStart(2,"0")}${g.toString(16).padStart(2,"0")}${C.toString(16).padStart(2,"0")}`}({r:Q,g:D,b:w,a:o*B})}function w(A,B){const Q=A.colors||{};if(Q[B])return Q[B];const g=s[B];if(!g)throw new Error(`Unknown theme color key: ${B}`);return"string"==typeof g?w(A,g):function(A,B){const Q=B[A.type];if(Array.isArray(Q)){const[B,g,...E]=Q;return B(w(A,g),...E)}return Q}(A,g)}const o="#6FC3DF",s={"editor.foreground":{dark:"#bbbbbb",light:"#333333",hc:"#ffffff"},"editorLineNumber.foreground":{dark:"#858585",light:"#237893",hc:"#fffffe"},"editor.selectionBackground":{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},"editor.background":{light:"#fffffe",dark:"#1E1E1E",hc:"#000000"},"editorGroupHeader.tabsBackground":{dark:"#252526",light:"#F3F3F3"},"tab.activeBackground":"editor.background","tab.activeForeground":{dark:"#ffffff",light:"#333333",hc:"#ffffff"},"tab.border":{dark:"#252526",light:"#F3F3F3",hc:o},"tab.activeBorder":"tab.activeBackground","tab.inactiveBackground":{dark:"#2D2D2D",light:"#ECECEC"},"tab.inactiveForeground":{dark:[D,"tab.activeForeground",.5],light:[D,"tab.activeForeground",.5],hc:"#ffffff"},"diffEditor.insertedTextBackground":{dark:"#9ccc2c33",light:"#9ccc2c40"},"diffEditor.removedTextBackground":{dark:"#ff000033",light:"#ff000033"},"diffEditor.insertedLineBackground":{dark:"#9bb95533",light:"#9bb95533"},"diffEditor.removedLineBackground":{dark:"#ff000033",light:"#ff000033"},"icon.foreground":{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},"sideBar.background":{dark:"#252526",light:"#F3F3F3",hc:"#000000"},"sideBar.foreground":"editor.foreground","sideBar.border":"sideBar.background","list.inactiveSelectionBackground":{dark:"#37373D",light:"#E4E6F1"},"list.inactiveSelectionForeground":{},"list.hoverBackground":{dark:"#2A2D2E",light:"#F0F0F0"},"list.hoverForeground":{},"editorGroupHeader.tabsBorder":{hc:o},"tab.activeBorderTop":{hc:o},"tab.hoverBackground":"tab.inactiveBackground","tab.hoverForeground":"tab.inactiveForeground","editor.rangeHighlightBackground":{dark:"#ffffff0b",light:"#fdff0033"},"editor.infoForeground":{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},"input.border":{hc:o},"input.background":{dark:"#3C3C3C",light:"#fffffe",hc:"#000000"},"input.foreground":"editor.foreground","editor.lineHighlightBackground":{},focusBorder:{light:"#0090F1",dark:"#007FD4",hc:o},"editorGroup.border":{dark:"#444444",light:"#E7E7E7",hc:o},"list.activeSelectionBackground":{dark:"#094771",light:"#0060C0",hc:"#000000"},"list.activeSelectionForeground":{dark:"#fffffe",light:"#fffffe",hc:"#fffffe"},"lighter.inlineBackground":{dark:[D,"editor.background",.9],light:[D,"editor.background",.9]},"terminal.background":"editor.background","terminal.foreground":"editor.foreground","terminal.ansiBlack":{dark:"#000000",light:"#000000",hc:"#000000"},"terminal.ansiRed":{dark:"#cd3131",light:"#cd3131",hc:"#cd0000"},"terminal.ansiGreen":{dark:"#0DBC79",light:"#00BC00",hc:"#00cd00"},"terminal.ansiYellow":{dark:"#e5e510",light:"#949800",hc:"#cdcd00"},"terminal.ansiBlue":{dark:"#2472c8",light:"#0451a5",hc:"#0000ee"},"terminal.ansiMagenta":{dark:"#bc3fbc",light:"#bc05bc",hc:"#cd00cd"},"terminal.ansiCyan":{dark:"#11a8cd",light:"#0598bc",hc:"#00cdcd"},"terminal.ansiWhite":{dark:"#e5e5e5",light:"#555555",hc:"#e5e5e5"},"terminal.ansiBrightBlack":{dark:"#666666",light:"#666666",hc:"#7f7f7f"},"terminal.ansiBrightRed":{dark:"#f14c4c",light:"#cd3131",hc:"#ff0000"},"terminal.ansiBrightGreen":{dark:"#23d18b",light:"#14CE14",hc:"#00ff00"},"terminal.ansiBrightYellow":{dark:"#f5f543",light:"#b5ba00",hc:"#ffff00"},"terminal.ansiBrightBlue":{dark:"#3b8eea",light:"#0451a5",hc:"#5c5cff"},"terminal.ansiBrightMagenta":{dark:"#d670d6",light:"#bc05bc",hc:"#ff00ff"},"terminal.ansiBrightCyan":{dark:"#29b8db",light:"#0598bc",hc:"#00ffff"},"terminal.ansiBrightWhite":{dark:"#e5e5e5",light:"#a5a5a5",hc:"#ffffff"}},e=new Map,c=new Map;async function i(A){if("string"==typeof A){const g=A;if(!a.includes(g))throw new M(g);if(!e.has(g)){const A=async function(A){try{return await B(A)}catch(B){return await Q(`themes/${A}`)}}(g).then((A=>(c.set(g,A),A)));e.set(g,A)}return e.get(g)}return A}function t(A){let B=null;if("string"==typeof A){if(B=c.get(A),!B)throw new Error("Syntax highlighting error: theme not loaded")}else B=A;return function(A){if(!A)return;const B=A.settings||A.tokenColors||[],Q={name:A.name||"unknown-theme",type:r(A),foreground:"",background:"",settings:B,colors:A.colors||{},colorNames:A.colorNames},g=B.find((A=>!A.scope));if(g){const{foreground:A,background:B}=(null==g?void 0:g.settings)||{},E={};A&&!Q.colors["editor.foreground"]&&(E["editor.foreground"]=A),B&&!Q.colors["editor.background"]&&(E["editor.background"]=B),Object.keys(E).length>0&&(Q.colors=Object.assign(Object.assign({},Q.colors),E)),Q.foreground=A,Q.background=B}g||(Q.settings=[{settings:{foreground:w(Q,"editor.foreground"),background:w(Q,"editor.background")}},...Q.settings]);if(Q.background=Q.background||w(Q,"editor.background"),Q.foreground=Q.foreground||w(Q,"editor.foreground"),"from-css"===A.type&&!Q.colorNames){const A={};let B=0;Q.settings=Q.settings.map((Q=>{const g=Object.assign(Object.assign({},Q),{settings:Object.assign({},Q.settings)}),{foreground:E,background:C}=g.settings||{};return E&&!A[E]&&(A[E]=`#${B.toString(16).padStart(6,"0")}`,B++),C&&!A[C]&&(A[C]=`#${B.toString(16).padStart(6,"0")}`,B++),E&&(g.settings.foreground=A[E]),C&&(g.settings.background=A[C]),g})),Q.colorNames=A}return Q}(B)}function r(A){var B;if("from-css"===A.type)return"from-css";return"light"===(A.type?A.type:(null===(B=A.name)||void 0===B?void 0:B.toLowerCase().includes("light"))?"light":"dark")?"light":"dark"}const a=["dark-plus","dracula-soft","dracula","github-dark","github-dark-dimmed","github-from-css","github-light","light-plus","material-darker","material-default","material-from-css","material-lighter","material-ocean","material-palenight","min-dark","min-light","monokai","nord","one-dark-pro","poimandres","slack-dark","slack-ochin","solarized-dark","solarized-light"];class M extends Error{constructor(A){super(`Unknown theme: ${A}`),this.theme=A}}function h(A){const B=B=>"colorScheme"===B?function(A){return"from-css"===A.type?"var(--ch-0)":A.type}(A):"foreground"===B?A.foreground:"background"===B?A.background:w(A,B);return{colorScheme:B("colorScheme"),foreground:B("foreground"),background:B("background"),lighter:{inlineBackground:B("lighter.inlineBackground")},editor:{background:B("editor.background"),foreground:B("editor.foreground"),lineHighlightBackground:B("editor.lineHighlightBackground"),rangeHighlightBackground:B("editor.rangeHighlightBackground"),infoForeground:B("editor.infoForeground"),selectionBackground:B("editor.selectionBackground")},focusBorder:B("focusBorder"),tab:{activeBackground:B("tab.activeBackground"),activeForeground:B("tab.activeForeground"),inactiveBackground:B("tab.inactiveBackground"),inactiveForeground:B("tab.inactiveForeground"),border:B("tab.border"),activeBorder:B("tab.activeBorder"),activeBorderTop:B("tab.activeBorderTop")},editorGroup:{border:B("editorGroup.border")},editorGroupHeader:{tabsBackground:B("editorGroupHeader.tabsBackground")},editorLineNumber:{foreground:B("editorLineNumber.foreground")},input:{background:B("input.background"),foreground:B("input.foreground"),border:B("input.border")},icon:{foreground:B("icon.foreground")},sideBar:{background:B("sideBar.background"),foreground:B("sideBar.foreground"),border:B("sideBar.border")},list:{activeSelectionBackground:B("list.activeSelectionBackground"),activeSelectionForeground:B("list.activeSelectionForeground"),hoverBackground:B("list.hoverBackground"),hoverForeground:B("list.hoverForeground")}}}const n=["abap","actionscript-3","ada","adoc","angular-html","angular-ts","apache","apex","apl","applescript","ara","asciidoc","asm","astro","awk","ballerina","bash","bat","batch","be","beancount","berry","bibtex","bicep","blade","c","c#","c++","cadence","cdc","clarity","clj","clojure","closure-templates","cmake","cmd","cobol","codeowners","codeql","coffee","coffeescript","common-lisp","console","cpp","cql","crystal","cs","csharp","css","csv","cue","cypher","d","dart","dax","desktop","diff","docker","dockerfile","dotenv","dream-maker","edge","elisp","elixir","elm","emacs-lisp","erb","erl","erlang","f","f#","f03","f08","f18","f77","f90","f95","fennel","fish","fluent","for","fortran-fixed-form","fortran-free-form","fs","fsharp","fsl","ftl","gdresource","gdscript","gdshader","genie","gherkin","git-commit","git-rebase","gjs","gleam","glimmer-js","glimmer-ts","glsl","gnuplot","go","gql","graphql","groovy","gts","hack","haml","handlebars","haskell","haxe","hbs","hcl","hjson","hlsl","hs","html","html-derivative","http","hxml","hy","imba","ini","jade","java","javascript","jinja","jison","jl","js","json","json5","jsonc","jsonl","jsonnet","jssm","jsx","julia","kotlin","kql","kt","kts","kusto","latex","lean","lean4","less","liquid","lisp","lit","log","logo","lua","luau","make","makefile","markdown","marko","matlab","md","mdc","mdx","mediawiki","mermaid","mojo","move","nar","narrat","nextflow","nf","nginx","nim","nix","nu","nushell","objc","objective-c","objective-cpp","ocaml","pascal","perl","perl6","php","plsql","po","postcss","pot","potx","powerquery","powershell","prisma","prolog","properties","proto","ps","ps1","pug","puppet","purescript","py","python","ql","qml","qmldir","qss","r","racket","raku","razor","rb","reg","regex","regexp","rel","riscv","rs","rst","ruby","rust","sas","sass","scala","scheme","scss","sh","shader","shaderlab","shell","shellscript","shellsession","smalltalk","solidity","soy","sparql","spl","splunk","sql","ssh-config","stata","styl","stylus","svelte","swift","system-verilog","systemd","tasl","tcl","templ","terminal","terraform","tex","text","tf","tfvars","toml","ts","ts-tags","tsp","tsv","tsx","turtle","twig","txt","typ","typescript","typespec","typst","v","vala","vb","verilog","vhdl","vim","viml","vimscript","vue","vue-html","vy","vyper","wasm","wenyan","wgsl","wiki","wikitext","wl","wolfram","xml","xsl","yaml","yml","zenscript","zig","zsh","文言"],F={abap:"source.abap","actionscript-3":"source.actionscript.3",ada:"source.ada","angular-html":"text.html.derivative.ng","angular-ts":"source.ts.ng",apache:"source.apacheconf",apex:"source.apex",apl:"source.apl",applescript:"source.applescript",ara:"source.ara",asciidoc:"text.asciidoc",adoc:"text.asciidoc",asm:"source.asm.x86_64",astro:"source.astro",awk:"source.awk",ballerina:"source.ballerina",bat:"source.batchfile",batch:"source.batchfile",beancount:"text.beancount",berry:"source.berry",be:"source.berry",bibtex:"text.bibtex",bicep:"source.bicep",blade:"text.html.php.blade",c:"source.c",cadence:"source.cadence",cdc:"source.cadence",clarity:"source.clar",clojure:"source.clojure",clj:"source.clojure",cmake:"source.cmake",cobol:"source.cobol",codeowners:"text.codeowners",codeql:"source.ql",ql:"source.ql",coffee:"source.coffee",coffeescript:"source.coffee","common-lisp":"source.commonlisp",lisp:"source.commonlisp",cpp:"source.cpp","c++":"source.cpp",crystal:"source.crystal",csharp:"source.cs","c#":"source.cs",cs:"source.cs",css:"source.css",csv:"text.csv",cue:"source.cue",cypher:"source.cypher",cql:"source.cypher",d:"source.d",dart:"source.dart",dax:"source.dax",desktop:"source.desktop",diff:"source.diff",docker:"source.dockerfile",dockerfile:"source.dockerfile",dotenv:"source.dotenv","dream-maker":"source.dm",edge:"text.html.edge",elixir:"source.elixir",elm:"source.elm","emacs-lisp":"source.emacs.lisp",elisp:"source.emacs.lisp",erb:"text.html.erb",erlang:"source.erlang",erl:"source.erlang",fennel:"source.fnl",fish:"source.fish",fluent:"source.ftl",ftl:"source.ftl","fortran-fixed-form":"source.fortran.fixed",f:"source.fortran.fixed",for:"source.fortran.fixed",f77:"source.fortran.fixed","fortran-free-form":"source.fortran.free",f90:"source.fortran.free",f95:"source.fortran.free",f03:"source.fortran.free",f08:"source.fortran.free",f18:"source.fortran.free",fsharp:"source.fsharp","f#":"source.fsharp",fs:"source.fsharp",gdresource:"source.gdresource",gdscript:"source.gdscript",gdshader:"source.gdshader",genie:"source.genie",gherkin:"text.gherkin.feature","git-commit":"text.git-commit","git-rebase":"text.git-rebase",gleam:"source.gleam","glimmer-js":"source.gjs",gjs:"source.gjs","glimmer-ts":"source.gts",gts:"source.gts",glsl:"source.glsl",gnuplot:"source.gnuplot",go:"source.go",graphql:"source.graphql",gql:"source.graphql",groovy:"source.groovy",hack:"source.hack",haml:"text.haml",handlebars:"text.html.handlebars",hbs:"text.html.handlebars",haskell:"source.haskell",hs:"source.haskell",haxe:"source.hx",hcl:"source.hcl",hjson:"source.hjson",hlsl:"source.hlsl",html:"text.html.basic","html-derivative":"text.html.derivative",http:"source.http",hxml:"source.hxml",hy:"source.hy",imba:"source.imba",ini:"source.ini",properties:"source.ini",java:"source.java",javascript:"source.js",js:"source.js",jinja:"source.jinja",jison:"source.jison",json:"source.json",json5:"source.json5",jsonc:"source.json.comments",jsonl:"source.json.lines",jsonnet:"source.jsonnet",jssm:"source.jssm",fsl:"source.jssm",jsx:"source.js.jsx",julia:"source.julia",jl:"source.julia",kotlin:"source.kotlin",kt:"source.kotlin",kts:"source.kotlin",kusto:"source.kusto",kql:"source.kusto",latex:"text.tex.latex",lean:"source.lean4",lean4:"source.lean4",less:"source.css.less",liquid:"text.html.liquid",log:"text.log",logo:"source.logo",lua:"source.lua",luau:"source.luau",make:"source.makefile",makefile:"source.makefile",markdown:"text.html.markdown",md:"text.html.markdown",marko:"text.marko",matlab:"source.matlab",mdc:"text.markdown.mdc",mdx:"source.mdx",mermaid:"markdown.mermaid.codeblock",mojo:"source.mojo",move:"source.move",narrat:"source.narrat",nar:"source.narrat",nextflow:"source.nextflow",nf:"source.nextflow",nginx:"source.nginx",nim:"source.nim",nix:"source.nix",nushell:"source.nushell",nu:"source.nushell","objective-c":"source.objc",objc:"source.objc","objective-cpp":"source.objcpp",ocaml:"source.ocaml",pascal:"source.pascal",perl:"source.perl",php:"source.php",plsql:"source.plsql.oracle",po:"source.po",pot:"source.po",potx:"source.po",postcss:"source.css.postcss",powerquery:"source.powerquery",powershell:"source.powershell",ps:"source.powershell",ps1:"source.powershell",prisma:"source.prisma",prolog:"source.prolog",proto:"source.proto",pug:"text.pug",jade:"text.pug",puppet:"source.puppet",purescript:"source.purescript",python:"source.python",py:"source.python",qml:"source.qml",qmldir:"source.qmldir",qss:"source.qss",r:"source.r",racket:"source.racket",raku:"source.perl.6",perl6:"source.perl.6",razor:"text.aspnetcorerazor",reg:"source.reg",regexp:"source.regexp.python",regex:"source.regexp.python",rel:"source.rel",riscv:"source.riscv",rst:"source.rst",ruby:"source.ruby",rb:"source.ruby",rust:"source.rust",rs:"source.rust",sas:"source.sas",sass:"source.sass",scala:"source.scala",scheme:"source.scheme",scss:"source.css.scss",shaderlab:"source.shaderlab",shader:"source.shaderlab",shellscript:"source.shell",bash:"source.shell",sh:"source.shell",shell:"source.shell",zsh:"source.shell",shellsession:"text.shell-session",console:"text.shell-session",smalltalk:"source.smalltalk",solidity:"source.solidity",soy:"text.html.soy","closure-templates":"text.html.soy",sparql:"source.sparql",splunk:"source.splunk_search",spl:"source.splunk_search",sql:"source.sql","ssh-config":"source.ssh-config",stata:"source.stata",stylus:"source.stylus",styl:"source.stylus",svelte:"source.svelte",swift:"source.swift","system-verilog":"source.systemverilog",systemd:"source.systemd",tasl:"source.tasl",tcl:"source.tcl",templ:"source.templ",terraform:"source.hcl.terraform",tf:"source.hcl.terraform",tfvars:"source.hcl.terraform",tex:"text.tex",toml:"source.toml","ts-tags":"source.ts.tags",lit:"source.ts.tags",tsv:"text.tsv",tsx:"source.tsx",turtle:"source.turtle",twig:"text.html.twig",txt:"source.txt",typescript:"source.ts",ts:"source.ts",typespec:"source.tsp",tsp:"source.tsp",typst:"source.typst",typ:"source.typst",v:"source.v",vala:"source.vala",vb:"source.asp.vb.net",cmd:"source.asp.vb.net",verilog:"source.verilog",vhdl:"source.vhdl",viml:"source.viml",vim:"source.viml",vimscript:"source.viml",vue:"source.vue","vue-html":"text.html.vue-html",vyper:"source.vyper",vy:"source.vyper",wasm:"source.wat",wenyan:"source.wenyan","文言":"source.wenyan",wgsl:"source.wgsl",wikitext:"source.wikitext",mediawiki:"source.wikitext",wiki:"source.wikitext",wolfram:"source.wolfram",wl:"source.wolfram",xml:"text.xml",xsl:"text.xml.xsl",yaml:"source.yaml",yml:"source.yaml",zenscript:"source.zenscript",zig:"source.zig"},G={"source.abap":{id:"abap",embeddedScopes:[]},"source.actionscript.3":{id:"actionscript-3",embeddedScopes:[]},"source.ada":{id:"ada",embeddedScopes:[]},"text.html.derivative.ng":{id:"angular-html",embeddedScopes:["text.html.basic"]},"source.ts.ng":{id:"angular-ts",embeddedScopes:[]},"source.apacheconf":{id:"apache",embeddedScopes:[]},"source.apex":{id:"apex",embeddedScopes:[]},"source.apl":{id:"apl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.json"]},"source.applescript":{id:"applescript",embeddedScopes:[]},"source.ara":{id:"ara",embeddedScopes:[]},"text.asciidoc":{id:"asciidoc",embeddedScopes:["text.html.basic","source.yaml","text.csv","source.c","source.clojure","source.coffee","source.cpp","source.css","source.cs","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.groovy","source.haskell","source.java","source.js","source.json","source.js.jsx","source.julia","source.kotlin","source.css.less","source.makefile","source.objc","source.ocaml","source.perl","source.python","source.r","source.ruby","source.rust","source.sass","source.scala","source.css.scss","source.shell","source.sql","source.swift","source.toml","source.ts","text.xml"]},"source.asm.x86_64":{id:"asm",embeddedScopes:[]},"source.astro":{id:"astro",embeddedScopes:["source.json","source.js","source.ts","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","source.tsx"]},"source.awk":{id:"awk",embeddedScopes:[]},"source.ballerina":{id:"ballerina",embeddedScopes:[]},"source.batchfile":{id:"bat",embeddedScopes:[]},"text.beancount":{id:"beancount",embeddedScopes:[]},"source.berry":{id:"berry",embeddedScopes:[]},"text.bibtex":{id:"bibtex",embeddedScopes:[]},"source.bicep":{id:"bicep",embeddedScopes:[]},"text.html.php.blade":{id:"blade",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.c":{id:"c",embeddedScopes:[]},"source.cadence":{id:"cadence",embeddedScopes:[]},"source.clar":{id:"clarity",embeddedScopes:[]},"source.clojure":{id:"clojure",embeddedScopes:[]},"source.cmake":{id:"cmake",embeddedScopes:[]},"source.cobol":{id:"cobol",embeddedScopes:["source.sql","text.html.basic","source.java"]},"text.codeowners":{id:"codeowners",embeddedScopes:[]},"source.ql":{id:"codeql",embeddedScopes:[]},"source.coffee":{id:"coffee",embeddedScopes:["source.js"]},"source.commonlisp":{id:"common-lisp",embeddedScopes:[]},"source.cpp":{id:"cpp",embeddedScopes:["source.regexp.python","source.glsl","source.sql"]},"source.crystal":{id:"crystal",embeddedScopes:["text.html.basic","source.sql","source.css","source.c","source.js","source.shell"]},"source.cs":{id:"csharp",embeddedScopes:[]},"source.css":{id:"css",embeddedScopes:[]},"text.csv":{id:"csv",embeddedScopes:[]},"source.cue":{id:"cue",embeddedScopes:[]},"source.cypher":{id:"cypher",embeddedScopes:[]},"source.d":{id:"d",embeddedScopes:[]},"source.dart":{id:"dart",embeddedScopes:[]},"source.dax":{id:"dax",embeddedScopes:[]},"source.desktop":{id:"desktop",embeddedScopes:[]},"source.diff":{id:"diff",embeddedScopes:[]},"source.dockerfile":{id:"docker",embeddedScopes:[]},"source.dotenv":{id:"dotenv",embeddedScopes:[]},"source.dm":{id:"dream-maker",embeddedScopes:[]},"text.html.edge":{id:"edge",embeddedScopes:["source.ts","text.html.basic","text.html.derivative"]},"source.elixir":{id:"elixir",embeddedScopes:["text.html.basic"]},"source.elm":{id:"elm",embeddedScopes:["source.glsl"]},"source.emacs.lisp":{id:"emacs-lisp",embeddedScopes:[]},"text.html.erb":{id:"erb",embeddedScopes:["text.html.basic","source.ruby"]},"source.erlang":{id:"erlang",embeddedScopes:[]},"source.fnl":{id:"fennel",embeddedScopes:[]},"source.fish":{id:"fish",embeddedScopes:[]},"source.ftl":{id:"fluent",embeddedScopes:[]},"source.fortran.fixed":{id:"fortran-fixed-form",embeddedScopes:["source.fortran.free"]},"source.fortran.free":{id:"fortran-free-form",embeddedScopes:[]},"source.fsharp":{id:"fsharp",embeddedScopes:["text.html.markdown"]},"source.gdresource":{id:"gdresource",embeddedScopes:["source.gdshader","source.gdscript"]},"source.gdscript":{id:"gdscript",embeddedScopes:[]},"source.gdshader":{id:"gdshader",embeddedScopes:[]},"source.genie":{id:"genie",embeddedScopes:[]},"text.gherkin.feature":{id:"gherkin",embeddedScopes:[]},"text.git-commit":{id:"git-commit",embeddedScopes:["source.diff"]},"text.git-rebase":{id:"git-rebase",embeddedScopes:["source.shell"]},"source.gleam":{id:"gleam",embeddedScopes:[]},"source.gjs":{id:"glimmer-js",embeddedScopes:["source.js","source.ts","source.css","text.html.basic"]},"source.gts":{id:"glimmer-ts",embeddedScopes:["source.ts","source.css","source.js","text.html.basic"]},"source.glsl":{id:"glsl",embeddedScopes:["source.c"]},"source.gnuplot":{id:"gnuplot",embeddedScopes:[]},"source.go":{id:"go",embeddedScopes:[]},"source.graphql":{id:"graphql",embeddedScopes:["source.js","source.ts","source.js.jsx","source.tsx"]},"source.groovy":{id:"groovy",embeddedScopes:[]},"source.hack":{id:"hack",embeddedScopes:["text.html.basic","source.sql"]},"text.haml":{id:"haml",embeddedScopes:["source.ruby","source.js","source.sass","source.coffee","text.html.markdown","source.css"]},"text.html.handlebars":{id:"handlebars",embeddedScopes:["text.html.basic","source.css","source.js","source.yaml"]},"source.haskell":{id:"haskell",embeddedScopes:[]},"source.hx":{id:"haxe",embeddedScopes:[]},"source.hcl":{id:"hcl",embeddedScopes:[]},"source.hjson":{id:"hjson",embeddedScopes:[]},"source.hlsl":{id:"hlsl",embeddedScopes:[]},"text.html.basic":{id:"html",embeddedScopes:["source.js","source.css"]},"text.html.derivative":{id:"html-derivative",embeddedScopes:["text.html.basic"]},"source.http":{id:"http",embeddedScopes:["source.shell","source.json","text.xml","source.graphql"]},"source.hxml":{id:"hxml",embeddedScopes:["source.hx"]},"source.hy":{id:"hy",embeddedScopes:[]},"source.imba":{id:"imba",embeddedScopes:["source.ts"]},"source.ini":{id:"ini",embeddedScopes:[]},"source.java":{id:"java",embeddedScopes:[]},"source.js":{id:"javascript",embeddedScopes:[]},"source.jinja":{id:"jinja",embeddedScopes:[]},"source.jison":{id:"jison",embeddedScopes:["source.js"]},"source.json":{id:"json",embeddedScopes:[]},"source.json5":{id:"json5",embeddedScopes:[]},"source.json.comments":{id:"jsonc",embeddedScopes:[]},"source.json.lines":{id:"jsonl",embeddedScopes:[]},"source.jsonnet":{id:"jsonnet",embeddedScopes:[]},"source.jssm":{id:"jssm",embeddedScopes:[]},"source.js.jsx":{id:"jsx",embeddedScopes:[]},"source.julia":{id:"julia",embeddedScopes:["source.cpp","source.python","source.js","source.r","source.sql"]},"source.kotlin":{id:"kotlin",embeddedScopes:[]},"source.kusto":{id:"kusto",embeddedScopes:[]},"text.tex.latex":{id:"latex",embeddedScopes:["text.tex","source.shell","source.css","source.gnuplot","source.haskell","text.html.basic","source.java","source.julia","source.js","source.lua","source.python","source.ruby","source.rust","source.ts","text.xml","source.yaml","source.scala"]},"source.lean4":{id:"lean",embeddedScopes:[]},"source.css.less":{id:"less",embeddedScopes:[]},"text.html.liquid":{id:"liquid",embeddedScopes:["text.html.basic","source.css","source.json","source.js"]},"text.log":{id:"log",embeddedScopes:[]},"source.logo":{id:"logo",embeddedScopes:[]},"source.lua":{id:"lua",embeddedScopes:["source.c"]},"source.luau":{id:"luau",embeddedScopes:[]},"source.makefile":{id:"make",embeddedScopes:[]},"text.html.markdown":{id:"markdown",embeddedScopes:["source.css","text.html.basic","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","text.git-commit","text.git-rebase","source.go","source.groovy","text.pug","source.js","source.json","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.regexp.python","source.rust","source.scala","source.shell","source.ts","source.tsx","source.cs","source.fsharp","source.dart","text.html.handlebars","text.log","source.erlang","source.elixir","text.tex.latex","text.bibtex","text.html.derivative"]},"text.marko":{id:"marko",embeddedScopes:["source.css","source.css.less","source.css.scss","source.js"]},"source.matlab":{id:"matlab",embeddedScopes:[]},"text.markdown.mdc":{id:"mdc",embeddedScopes:["text.html.markdown","source.yaml","text.html.derivative"]},"source.mdx":{id:"mdx",embeddedScopes:["source.tsx","source.toml","source.yaml","source.c","source.clojure","source.coffee","source.cpp","source.cs","source.css","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.graphql","source.haskell","text.html.basic","source.ini","source.java","source.js","source.json","source.julia","source.kotlin","source.css.less","source.lua","source.makefile","text.html.markdown","source.objc","source.perl","source.python","source.r","source.ruby","source.rust","source.scala","source.css.scss","source.shell","text.shell-session","source.sql","text.xml","source.swift","source.ts"]},"markdown.mermaid.codeblock":{id:"mermaid",embeddedScopes:[]},"source.mojo":{id:"mojo",embeddedScopes:[]},"source.move":{id:"move",embeddedScopes:[]},"source.narrat":{id:"narrat",embeddedScopes:[]},"source.nextflow":{id:"nextflow",embeddedScopes:[]},"source.nginx":{id:"nginx",embeddedScopes:["source.lua"]},"source.nim":{id:"nim",embeddedScopes:["source.c","text.html.basic","text.xml","source.js","source.css","source.glsl","text.html.markdown"]},"source.nix":{id:"nix",embeddedScopes:[]},"source.nushell":{id:"nushell",embeddedScopes:[]},"source.objc":{id:"objective-c",embeddedScopes:[]},"source.objcpp":{id:"objective-cpp",embeddedScopes:[]},"source.ocaml":{id:"ocaml",embeddedScopes:[]},"source.pascal":{id:"pascal",embeddedScopes:[]},"source.perl":{id:"perl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.sql"]},"source.php":{id:"php",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.plsql.oracle":{id:"plsql",embeddedScopes:[]},"source.po":{id:"po",embeddedScopes:[]},"source.css.postcss":{id:"postcss",embeddedScopes:[]},"source.powerquery":{id:"powerquery",embeddedScopes:[]},"source.powershell":{id:"powershell",embeddedScopes:[]},"source.prisma":{id:"prisma",embeddedScopes:[]},"source.prolog":{id:"prolog",embeddedScopes:[]},"source.proto":{id:"proto",embeddedScopes:[]},"text.pug":{id:"pug",embeddedScopes:["source.js","source.css","source.sass","source.css.scss","source.stylus","source.coffee","text.html.basic"]},"source.puppet":{id:"puppet",embeddedScopes:[]},"source.purescript":{id:"purescript",embeddedScopes:[]},"source.python":{id:"python",embeddedScopes:[]},"source.qml":{id:"qml",embeddedScopes:["source.js"]},"source.qmldir":{id:"qmldir",embeddedScopes:[]},"source.qss":{id:"qss",embeddedScopes:[]},"source.r":{id:"r",embeddedScopes:[]},"source.racket":{id:"racket",embeddedScopes:[]},"source.perl.6":{id:"raku",embeddedScopes:[]},"text.aspnetcorerazor":{id:"razor",embeddedScopes:["text.html.basic","source.cs"]},"source.reg":{id:"reg",embeddedScopes:[]},"source.regexp.python":{id:"regexp",embeddedScopes:[]},"source.rel":{id:"rel",embeddedScopes:[]},"source.riscv":{id:"riscv",embeddedScopes:[]},"source.rst":{id:"rst",embeddedScopes:["text.html.derivative","source.cpp","source.python","source.js","source.shell","source.yaml","source.cmake","source.ruby"]},"source.ruby":{id:"ruby",embeddedScopes:["text.html.basic","text.xml","source.sql","source.css","source.c","source.js","source.shell","source.lua"]},"source.rust":{id:"rust",embeddedScopes:[]},"source.sas":{id:"sas",embeddedScopes:["source.sql"]},"source.sass":{id:"sass",embeddedScopes:[]},"source.scala":{id:"scala",embeddedScopes:[]},"source.scheme":{id:"scheme",embeddedScopes:[]},"source.css.scss":{id:"scss",embeddedScopes:["source.css"]},"source.shaderlab":{id:"shaderlab",embeddedScopes:["source.hlsl"]},"source.shell":{id:"shellscript",embeddedScopes:[]},"text.shell-session":{id:"shellsession",embeddedScopes:["source.shell"]},"source.smalltalk":{id:"smalltalk",embeddedScopes:[]},"source.solidity":{id:"solidity",embeddedScopes:[]},"text.html.soy":{id:"soy",embeddedScopes:["text.html.basic"]},"source.sparql":{id:"sparql",embeddedScopes:["source.turtle"]},"source.splunk_search":{id:"splunk",embeddedScopes:[]},"source.sql":{id:"sql",embeddedScopes:[]},"source.ssh-config":{id:"ssh-config",embeddedScopes:[]},"source.stata":{id:"stata",embeddedScopes:["source.sql"]},"source.stylus":{id:"stylus",embeddedScopes:[]},"source.svelte":{id:"svelte",embeddedScopes:["source.js","source.ts","source.coffee","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","text.pug","text.html.markdown"]},"source.swift":{id:"swift",embeddedScopes:[]},"source.systemverilog":{id:"system-verilog",embeddedScopes:[]},"source.systemd":{id:"systemd",embeddedScopes:[]},"source.tasl":{id:"tasl",embeddedScopes:[]},"source.tcl":{id:"tcl",embeddedScopes:[]},"source.templ":{id:"templ",embeddedScopes:["source.go","source.js","source.css"]},"source.hcl.terraform":{id:"terraform",embeddedScopes:[]},"text.tex":{id:"tex",embeddedScopes:["source.r"]},"source.toml":{id:"toml",embeddedScopes:[]},"source.ts.tags":{id:"ts-tags",embeddedScopes:["source.ts"]},"text.tsv":{id:"tsv",embeddedScopes:[]},"source.tsx":{id:"tsx",embeddedScopes:[]},"source.turtle":{id:"turtle",embeddedScopes:[]},"text.html.twig":{id:"twig",embeddedScopes:["source.css","source.js","source.css.scss","source.php","source.python","source.ruby"]},"source.txt":{id:"txt",embeddedScopes:[]},"source.ts":{id:"typescript",embeddedScopes:[]},"source.tsp":{id:"typespec",embeddedScopes:[]},"source.typst":{id:"typst",embeddedScopes:[]},"source.v":{id:"v",embeddedScopes:[]},"source.vala":{id:"vala",embeddedScopes:[]},"source.asp.vb.net":{id:"vb",embeddedScopes:[]},"source.verilog":{id:"verilog",embeddedScopes:[]},"source.vhdl":{id:"vhdl",embeddedScopes:[]},"source.viml":{id:"viml",embeddedScopes:[]},"source.vue":{id:"vue",embeddedScopes:["text.html.basic","text.html.markdown","text.pug","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.js","source.ts","source.js.jsx","source.tsx","source.coffee","source.json","source.json.comments","source.json5","source.yaml","source.toml","source.graphql","text.html.derivative"]},"text.html.vue-html":{id:"vue-html",embeddedScopes:["source.vue","source.js"]},"source.vyper":{id:"vyper",embeddedScopes:[]},"source.wat":{id:"wasm",embeddedScopes:[]},"source.wenyan":{id:"wenyan",embeddedScopes:[]},"source.wgsl":{id:"wgsl",embeddedScopes:[]},"source.wikitext":{id:"wikitext",embeddedScopes:["text.html.basic","source.css","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","source.go","source.groovy","text.pug","source.js","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.rust","source.scala","source.shell","source.ts","source.cs","source.fsharp","source.dart","text.html.handlebars","text.html.markdown","source.erlang","source.elixir","text.tex.latex","text.bibtex","source.json"]},"source.wolfram":{id:"wolfram",embeddedScopes:[]},"text.xml":{id:"xml",embeddedScopes:["source.java"]},"text.xml.xsl":{id:"xsl",embeddedScopes:["text.xml"]},"source.yaml":{id:"yaml",embeddedScopes:[]},"source.zenscript":{id:"zenscript",embeddedScopes:[]},"source.zig":{id:"zig",embeddedScopes:[]}};var N={d:(A,B)=>{for(var Q in B)N.o(B,Q)&&!N.o(A,Q)&&Object.defineProperty(A,Q,{enumerable:!0,get:B[Q]})},o:(A,B)=>Object.prototype.hasOwnProperty.call(A,B)},H={};N.d(H,{_X:()=>XA,Bz:()=>vA,ot:()=>TA,u:()=>WA,jG:()=>Y,Pn:()=>ZA});const L="undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG;var k;function R(A,B){const Q=[],g=function(A){let B=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,Q=B.exec(A);return{next:()=>{if(!Q)return null;const g=Q[0];return Q=B.exec(A),g}}}(A);let E=g.next();for(;null!==E;){let A=0;if(2===E.length&&":"===E.charAt(1)){switch(E.charAt(0)){case"R":A=1;break;case"L":A=-1;break;default:console.log(`Unknown priority ${E} in scope selector`)}E=g.next()}let B=I();if(Q.push({matcher:B,priority:A}),","!==E)break;E=g.next()}return Q;function C(){if("-"===E){E=g.next();const A=C();return B=>!!A&&!A(B)}if("("===E){E=g.next();const A=function(){const A=[];let B=I();for(;B&&(A.push(B),"|"===E||","===E);){do{E=g.next()}while("|"===E||","===E);B=I()}return B=>A.some((A=>A(B)))}();return")"===E&&(E=g.next()),A}if(K(E)){const A=[];do{A.push(E),E=g.next()}while(K(E));return Q=>B(A,Q)}return null}function I(){const A=[];let B=C();for(;B;)A.push(B),B=C();return B=>A.every((A=>A(B)))}}function K(A){return!!A&&!!A.match(/[\w\.:]+/)}function Y(A){"function"==typeof A.dispose&&A.dispose()}function U(A){return Array.isArray(A)?function(A){let B=[];for(let Q=0,g=A.length;Q{for(let Q in B)A[Q]=B[Q]})),A}function u(A){const B=~A.lastIndexOf("/")||~A.lastIndexOf("\\");return 0===B?A:~B==A.length-1?u(A.substring(0,A.length-1)):A.substr(1+~B)}!function(A){A.toBinaryStr=function(A){let B=A.toString(2);for(;B.length<32;)B="0"+B;return B},A.print=function(B){const Q=A.getLanguageId(B),g=A.getTokenType(B),E=A.getFontStyle(B),C=A.getForeground(B),I=A.getBackground(B);console.log({languageId:Q,tokenType:g,fontStyle:E,foreground:C,background:I})},A.getLanguageId=function(A){return(255&A)>>>0},A.getTokenType=function(A){return(768&A)>>>8},A.containsBalancedBrackets=function(A){return 0!=(1024&A)},A.getFontStyle=function(A){return(30720&A)>>>11},A.getForeground=function(A){return(16744448&A)>>>15},A.getBackground=function(A){return(4278190080&A)>>>24},A.set=function(B,Q,g,E,C,I,D){let w=A.getLanguageId(B),o=A.getTokenType(B),s=A.containsBalancedBrackets(B)?1:0,e=A.getFontStyle(B),c=A.getForeground(B),i=A.getBackground(B);return 0!==Q&&(w=Q),8!==g&&(o=g),null!==E&&(s=E?1:0),-1!==C&&(e=C),0!==I&&(c=I),0!==D&&(i=D),(w<<0|o<<8|s<<10|e<<11|c<<15|i<<24)>>>0}}(k||(k={}));let y=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;class J{static hasCaptures(A){return null!==A&&(y.lastIndex=0,y.test(A))}static replaceCaptures(A,B,Q){return A.replace(y,((A,g,E,C)=>{let I=Q[parseInt(g||E,10)];if(!I)return A;{let A=B.substring(I.start,I.end);for(;"."===A[0];)A=A.substring(1);switch(C){case"downcase":return A.toLowerCase();case"upcase":return A.toUpperCase();default:return A}}}))}}function p(A,B){return AB?1:0}function d(A,B){if(null===A&&null===B)return 0;if(!A)return-1;if(!B)return 1;let Q=A.length,g=B.length;if(Q===g){for(let g=0;g`);return}const C=Q.lookup(B);A instanceof x?v({baseGrammar:C,selfGrammar:E},g):T(A.ruleName,{baseGrammar:C,selfGrammar:E,repository:E.repository},g);const I=Q.injections(A.scopeName);if(I)for(const A of I)g.add(new x(A))}function T(A,B,Q){B.repository&&B.repository[A]&&X([B.repository[A]],B,Q)}function v(A,B){A.selfGrammar.patterns&&Array.isArray(A.selfGrammar.patterns)&&X(A.selfGrammar.patterns,{...A,repository:A.selfGrammar.repository},B),A.selfGrammar.injections&&X(Object.values(A.selfGrammar.injections),{...A,repository:A.selfGrammar.repository},B)}function X(A,B,Q){for(const g of A){if(Q.visitedRule.has(g))continue;Q.visitedRule.add(g);const A=g.repository?P({},B.repository,g.repository):B.repository;Array.isArray(g.patterns)&&X(g.patterns,{...B,repository:A},Q);const E=g.include;if(!E)continue;const C=$(E);switch(C.kind){case 0:v({...B,selfGrammar:B.baseGrammar},Q);break;case 1:v(B,Q);break;case 2:T(C.ruleName,{...B,repository:A},Q);break;case 3:case 4:const g=C.scopeName===B.selfGrammar.scopeName?B.selfGrammar:C.scopeName===B.baseGrammar.scopeName?B.baseGrammar:void 0;if(g){const E={baseGrammar:B.baseGrammar,selfGrammar:g,repository:A};4===C.kind?T(C.ruleName,E,Q):v(E,Q)}else 4===C.kind?Q.add(new O(C.scopeName,C.ruleName)):Q.add(new x(C.scopeName))}}}class Z{constructor(){this.kind=0}}class j{constructor(){this.kind=1}}class V{constructor(A){this.ruleName=A,this.kind=2}}class z{constructor(A){this.scopeName=A,this.kind=3}}class _{constructor(A,B){this.scopeName=A,this.ruleName=B,this.kind=4}}function $(A){if("$base"===A)return new Z;if("$self"===A)return new j;const B=A.indexOf("#");if(-1===B)return new z(A);if(0===B)return new V(A.substring(1));{const Q=A.substring(0,B),g=A.substring(B+1);return new _(Q,g)}}const AA=/\\(\d+)/,BA=/\\(\d+)/g;class QA{constructor(A,B,Q,g){this.$location=A,this.id=B,this._name=Q||null,this._nameIsCapturing=J.hasCaptures(this._name),this._contentName=g||null,this._contentNameIsCapturing=J.hasCaptures(this._contentName)}get debugName(){const A=this.$location?`${u(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${A}`}getName(A,B){return this._nameIsCapturing&&null!==this._name&&null!==A&&null!==B?J.replaceCaptures(this._name,A,B):this._name}getContentName(A,B){return this._contentNameIsCapturing&&null!==this._contentName?J.replaceCaptures(this._contentName,A,B):this._contentName}}class gA extends QA{constructor(A,B,Q,g,E){super(A,B,Q,g),this.retokenizeCapturedWithRuleId=E}dispose(){}collectPatterns(A,B){throw new Error("Not supported!")}compile(A,B){throw new Error("Not supported!")}compileAG(A,B,Q,g){throw new Error("Not supported!")}}class EA extends QA{constructor(A,B,Q,g,E){super(A,B,Q,null),this._match=new oA(g,this.id),this.captures=E,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(A,B){B.push(this._match)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new sA,this.collectPatterns(A,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class CA extends QA{constructor(A,B,Q,g,E){super(A,B,Q,g),this.patterns=E.patterns,this.hasMissingPatterns=E.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(A,B){for(const Q of this.patterns)A.getRule(Q).collectPatterns(A,B)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new sA,this.collectPatterns(A,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class IA extends QA{constructor(A,B,Q,g,E,C,I,D,w,o){super(A,B,Q,g),this._begin=new oA(E,this.id),this.beginCaptures=C,this._end=new oA(I||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=D,this.applyEndPatternLast=w||!1,this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(A,B){return this._end.resolveBackReferences(A,B)}collectPatterns(A,B){B.push(this._begin)}compile(A,B){return this._getCachedCompiledPatterns(A,B).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A,B).compileAG(A,Q,g)}_getCachedCompiledPatterns(A,B){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new sA;for(const B of this.patterns)A.getRule(B).collectPatterns(A,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,B):this._cachedCompiledPatterns.setSource(0,B)),this._cachedCompiledPatterns}}class DA extends QA{constructor(A,B,Q,g,E,C,I,D,w){super(A,B,Q,g),this._begin=new oA(E,this.id),this.beginCaptures=C,this.whileCaptures=D,this._while=new oA(I,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=w.patterns,this.hasMissingPatterns=w.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(A,B){return this._while.resolveBackReferences(A,B)}collectPatterns(A,B){B.push(this._begin)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new sA;for(const B of this.patterns)A.getRule(B).collectPatterns(A,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(A,B){return this._getCachedCompiledWhilePatterns(A,B).compile(A)}compileWhileAG(A,B,Q,g){return this._getCachedCompiledWhilePatterns(A,B).compileAG(A,Q,g)}_getCachedCompiledWhilePatterns(A,B){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new sA,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,B||"￿"),this._cachedCompiledWhilePatterns}}class wA{static createCaptureRule(A,B,Q,g,E){return A.registerRule((A=>new gA(B,A,Q,g,E)))}static getCompiledRuleId(A,B,Q){return A.id||B.registerRule((g=>{if(A.id=g,A.match)return new EA(A.$vscodeTextmateLocation,A.id,A.name,A.match,wA._compileCaptures(A.captures,B,Q));if(void 0===A.begin){A.repository&&(Q=P({},Q,A.repository));let g=A.patterns;return void 0===g&&A.include&&(g=[{include:A.include}]),new CA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,wA._compilePatterns(g,B,Q))}return A.while?new DA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,A.begin,wA._compileCaptures(A.beginCaptures||A.captures,B,Q),A.while,wA._compileCaptures(A.whileCaptures||A.captures,B,Q),wA._compilePatterns(A.patterns,B,Q)):new IA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,A.begin,wA._compileCaptures(A.beginCaptures||A.captures,B,Q),A.end,wA._compileCaptures(A.endCaptures||A.captures,B,Q),A.applyEndPatternLast,wA._compilePatterns(A.patterns,B,Q))})),A.id}static _compileCaptures(A,B,Q){let g=[];if(A){let E=0;for(const B in A){if("$vscodeTextmateLocation"===B)continue;const A=parseInt(B,10);A>E&&(E=A)}for(let A=0;A<=E;A++)g[A]=null;for(const E in A){if("$vscodeTextmateLocation"===E)continue;const C=parseInt(E,10);let I=0;A[E].patterns&&(I=wA.getCompiledRuleId(A[E],B,Q)),g[C]=wA.createCaptureRule(B,A[E].$vscodeTextmateLocation,A[E].name,A[E].contentName,I)}}return g}static _compilePatterns(A,B,Q){let g=[];if(A)for(let E=0,C=A.length;EA.substring(B.start,B.end)));return BA.lastIndex=0,this.source.replace(BA,((A,B)=>l(Q[parseInt(B,10)]||"")))}_buildAnchorCache(){let A,B,Q,g,E=[],C=[],I=[],D=[];for(A=0,B=this.source.length;AA.source));this._cached=new eA(A,B,this._items.map((A=>A.ruleId)))}return this._cached}compileAG(A,B,Q){return this._hasAnchors?B?Q?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(A,B,Q)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(A,B,Q)),this._anchorCache.A1_G0):Q?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(A,B,Q)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(A,B,Q)),this._anchorCache.A0_G0):this.compile(A)}_resolveAnchors(A,B,Q){let g=this._items.map((A=>A.resolveAnchors(B,Q)));return new eA(A,g,this._items.map((A=>A.ruleId)))}}class eA{constructor(A,B,Q){this.regExps=B,this.rules=Q,this.scanner=A.createOnigScanner(B)}dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const A=[];for(let B=0,Q=this.rules.length;Bthis._root.match(A)))}static createFromRawTheme(A,B){return this.createFromParsedTheme(function(A){if(!A)return[];if(!A.settings||!Array.isArray(A.settings))return[];let B=A.settings,Q=[],g=0;for(let A=0,E=B.length;A1&&(s=C.slice(0,C.length-1),s.reverse()),Q[g++]=new aA(o,s,A,I,D,w)}}return Q}(A),B)}static createFromParsedTheme(A,B){return function(A,B){A.sort(((A,B)=>{let Q=p(A.scope,B.scope);return 0!==Q?Q:(Q=d(A.parentScopes,B.parentScopes),0!==Q?Q:A.index-B.index)}));let Q=0,g="#000000",E="#ffffff";for(;A.length>=1&&""===A[0].scope;){let B=A.shift();-1!==B.fontStyle&&(Q=B.fontStyle),null!==B.foreground&&(g=B.foreground),null!==B.background&&(E=B.background)}let C=new MA(B),I=new rA(Q,C.getId(g),C.getId(E)),D=new nA(new hA(0,null,-1,0,0),[]);for(let B=0,Q=A.length;Bfunction(A,B){if(null===B)return!0;let Q=0,g=B[Q];for(;A;){if(tA(A.scopeName,g)){if(Q++,Q===B.length)return!0;g=B[Q]}A=A.parent}return!1}(A.parent,B.parentScopes)));return Q?new rA(Q.fontStyle,Q.foreground,Q.background):null}}class iA{constructor(A,B){this.parent=A,this.scopeName=B}static push(A,B){for(const Q of B)A=new iA(A,Q);return A}static from(...A){let B=null;for(let Q=0;QA?console.log("how did this happen?"):this.scopeDepth=A,-1!==B&&(this.fontStyle=B),0!==Q&&(this.foreground=Q),0!==g&&(this.background=g)}}class nA{constructor(A,B=[],Q={}){this._mainRule=A,this._children=Q,this._rulesWithParentScopes=B}static _sortBySpecificity(A){return 1===A.length||A.sort(this._cmpBySpecificity),A}static _cmpBySpecificity(A,B){if(A.scopeDepth===B.scopeDepth){const Q=A.parentScopes,g=B.parentScopes;let E=null===Q?0:Q.length,C=null===g?0:g.length;if(E===C)for(let A=0;A{const B=this._scopeToLanguage(A),Q=this._toStandardTokenType(A);return new FA(B,Q)})),this._defaultAttributes=new FA(A,8),this._embeddedLanguagesMatcher=new NA(Object.entries(B||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(A){return null===A?GA._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(A)}_scopeToLanguage(A){return this._embeddedLanguagesMatcher.match(A)||0}_toStandardTokenType(A){const B=A.match(GA.STANDARD_TOKEN_TYPE_REGEXP);if(!B)return 8;switch(B[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}}GA._NULL_SCOPE_METADATA=new FA(0,0),GA.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class NA{constructor(A){if(0===A.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(A);const B=A.map((([A,B])=>l(A)));B.sort(),B.reverse(),this.scopesRegExp=new RegExp(`^((${B.join(")|(")}))($|\\.)`,"")}}match(A){if(!this.scopesRegExp)return;const B=A.match(this.scopesRegExp);return B?this.values.get(B[1]):void 0}}class HA{constructor(A,B){this.stack=A,this.stoppedEarly=B}}function LA(A,B,Q,g,E,C,I,D){const w=B.content.length;let o=!1,s=-1;if(I){const I=function(A,B,Q,g,E,C){let I=E.beginRuleCapturedEOL?0:-1;const D=[];for(let B=E;B;B=B.pop()){const Q=B.getRule(A);Q instanceof DA&&D.push({rule:Q,stack:B})}for(let w=D.pop();w;w=D.pop()){const{ruleScanner:D,findOptions:o}=RA(w.rule,A,w.stack.endRule,Q,g===I),s=D.findNextMatchSync(B,g,o);if(L&&(console.log(" scanning for while rule"),console.log(D.toString())),!s){L&&console.log(" popping "+w.rule.debugName+" - "+w.rule.debugWhileRegExp),E=w.stack.pop();break}if(-2!==s.ruleId){E=w.stack.pop();break}s.captureIndices&&s.captureIndices.length&&(C.produce(w.stack,s.captureIndices[0].start),KA(A,B,Q,w.stack,C,w.rule.whileCaptures,s.captureIndices),C.produce(w.stack,s.captureIndices[0].end),I=s.captureIndices[0].end,s.captureIndices[0].end>g&&(g=s.captureIndices[0].end,Q=!1))}return{stack:E,linePos:g,anchorPosition:I,isFirstLine:Q}}(A,B,Q,g,E,C);E=I.stack,g=I.linePos,Q=I.isFirstLine,s=I.anchorPosition}const e=Date.now();for(;!o;){if(0!==D&&Date.now()-e>D)return new HA(E,!0);c()}return new HA(E,!1);function c(){L&&(console.log(""),console.log(`@@scanNext ${g}: |${B.content.substr(g).replace(/\n$/,"\\n")}|`));const I=function(A,B,Q,g,E,C){const I=function(A,B,Q,g,E,C){const I=E.getRule(A),{ruleScanner:D,findOptions:w}=kA(I,A,E.endRule,Q,g===C);let o=0;L&&(o=f());const s=D.findNextMatchSync(B,g,w);if(L){const A=f()-o;A>5&&console.warn(`Rule ${I.debugName} (${I.id}) matching took ${A} against '${B}'`),console.log(` scanning for (linePos: ${g}, anchorPosition: ${C})`),console.log(D.toString()),s&&console.log(`matched rule id: ${s.ruleId} from ${s.captureIndices[0].start} to ${s.captureIndices[0].end}`)}return s?{captureIndices:s.captureIndices,matchedRuleId:s.ruleId}:null}(A,B,Q,g,E,C),D=A.getInjections();if(0===D.length)return I;const w=function(A,B,Q,g,E,C,I){let D,w=Number.MAX_VALUE,o=null,s=0;const e=C.contentNameScopesList.getScopeNames();for(let C=0,c=A.length;C=w)&&(w=M,o=a.captureIndices,D=a.ruleId,s=c.priority,w===E))break}return o?{priorityMatch:-1===s,captureIndices:o,matchedRuleId:D}:null}(D,A,B,Q,g,E,C);if(!w)return I;if(!I)return w;const o=I.captureIndices[0].start,s=w.captureIndices[0].start;return s0)&&D[0].end>g;if(-1===e){const I=E.getRule(A);L&&console.log(" popping "+I.debugName+" - "+I.debugEndRegExp),C.produce(E,D[0].start),E=E.withContentNameScopesList(E.nameScopesList),KA(A,B,Q,E,C,I.endCaptures,D),C.produce(E,D[0].end);const e=E;if(E=E.parent,s=e.getAnchorPos(),!c&&e.getEnterPos()===g)return L&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),E=e,C.produce(E,w),void(o=!0)}else{const I=A.getRule(e);C.produce(E,D[0].start);const i=E,t=I.getName(B.content,D),r=E.contentNameScopesList.pushAttributed(t,A);if(E=E.push(e,g,s,D[0].end===w,null,r,r),I instanceof IA){const g=I;L&&console.log(" pushing "+g.debugName+" - "+g.debugBeginRegExp),KA(A,B,Q,E,C,g.beginCaptures,D),C.produce(E,D[0].end),s=D[0].end;const e=g.getContentName(B.content,D),t=r.pushAttributed(e,A);if(E=E.withContentNameScopesList(t),g.endHasBackReferences&&(E=E.withEndRule(g.getEndWithResolvedBackReferences(B.content,D))),!c&&i.hasSameRuleAs(E))return L&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),E=E.pop(),C.produce(E,w),void(o=!0)}else if(I instanceof DA){const g=I;L&&console.log(" pushing "+g.debugName),KA(A,B,Q,E,C,g.beginCaptures,D),C.produce(E,D[0].end),s=D[0].end;const e=g.getContentName(B.content,D),t=r.pushAttributed(e,A);if(E=E.withContentNameScopesList(t),g.whileHasBackReferences&&(E=E.withEndRule(g.getWhileWithResolvedBackReferences(B.content,D))),!c&&i.hasSameRuleAs(E))return L&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),E=E.pop(),C.produce(E,w),void(o=!0)}else{const g=I;if(L&&console.log(" matched "+g.debugName+" - "+g.debugMatchRegExp),KA(A,B,Q,E,C,g.captures,D),C.produce(E,D[0].end),E=E.pop(),!c)return L&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),E=E.safePop(),C.produce(E,w),void(o=!0)}}D[0].end>g&&(g=D[0].end,Q=!1)}}function kA(A,B,Q,g,E){return{ruleScanner:A.compileAG(B,Q,g,E),findOptions:0}}function RA(A,B,Q,g,E){return{ruleScanner:A.compileWhileAG(B,Q,g,E),findOptions:0}}function KA(A,B,Q,g,E,C,I){if(0===C.length)return;const D=B.content,w=Math.min(C.length,I.length),o=[],s=I[0].end;for(let B=0;Bs)break;for(;o.length>0&&o[o.length-1].endPos<=e.start;)E.produceFromScopes(o[o.length-1].scopes,o[o.length-1].endPos),o.pop();if(o.length>0?E.produceFromScopes(o[o.length-1].scopes,e.start):E.produce(g,e.start),w.retokenizeCapturedWithRuleId){const B=w.getName(D,I),C=g.contentNameScopesList.pushAttributed(B,A),o=w.getContentName(D,I),s=C.pushAttributed(o,A),c=g.push(w.retokenizeCapturedWithRuleId,e.start,-1,!1,null,C,s),i=A.createOnigString(D.substring(0,e.end));LA(A,i,Q&&0===e.start,e.start,c,E,!1,0),Y(i);continue}const c=w.getName(D,I);if(null!==c){const B=(o.length>0?o[o.length-1].scopes:g.contentNameScopesList).pushAttributed(c,A);o.push(new YA(B,e.end))}}for(;o.length>0;)E.produceFromScopes(o[o.length-1].scopes,o[o.length-1].endPos),o.pop()}class YA{constructor(A,B){this.scopes=A,this.endPos=B}}function UA(A,B,Q,g,E){const C=R(B,PA),I=wA.getCompiledRuleId(Q,g,E.repository);for(const Q of C)A.push({debugSelector:B,matcher:Q.matcher,ruleId:I,grammar:E,priority:Q.priority})}function PA(A,B){if(B.length{for(let g=Q;gQ&&A.substr(0,Q)===B&&"."===A[Q]}class yA{constructor(A,B,Q,g,E,C,I,D){if(this._rootScopeName=A,this.balancedBracketSelectors=C,this._onigLib=D,this._basicScopeAttributesProvider=new GA(Q,g),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=I,this._grammar=JA(B,null),this._injections=null,this._tokenTypeMatchers=[],E)for(const A of Object.keys(E)){const B=R(A,PA);for(const Q of B)this._tokenTypeMatchers.push({matcher:Q.matcher,type:E[A]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const A of this._ruleId2desc)A&&A.dispose()}createOnigScanner(A){return this._onigLib.createOnigScanner(A)}createOnigString(A){return this._onigLib.createOnigString(A)}getMetadataForScope(A){return this._basicScopeAttributesProvider.getBasicScopeAttributes(A)}_collectInjections(){const A=[],B=this._rootScopeName,Q=(A=>A===this._rootScopeName?this._grammar:this.getExternalGrammar(A))(B);if(Q){const g=Q.injections;if(g)for(let B in g)UA(A,B,g[B],this,Q);const E=this._grammarRepository.injections(B);E&&E.forEach((B=>{const Q=this.getExternalGrammar(B);if(Q){const B=Q.injectionSelector;B&&UA(A,B,Q,this,Q)}}))}return A.sort(((A,B)=>A.priority-B.priority)),A}getInjections(){if(null===this._injections&&(this._injections=this._collectInjections(),L&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const A of this._injections)console.log(` - ${A.debugSelector}`)}return this._injections}registerRule(A){const B=++this._lastRuleId,Q=A(B);return this._ruleId2desc[B]=Q,Q}getRule(A){return this._ruleId2desc[A]}getExternalGrammar(A,B){if(this._includedGrammars[A])return this._includedGrammars[A];if(this._grammarRepository){const Q=this._grammarRepository.lookup(A);if(Q)return this._includedGrammars[A]=JA(Q,B&&B.$base),this._includedGrammars[A]}}tokenizeLine(A,B,Q=0){const g=this._tokenize(A,B,!1,Q);return{tokens:g.lineTokens.getResult(g.ruleStack,g.lineLength),ruleStack:g.ruleStack,stoppedEarly:g.stoppedEarly}}tokenizeLine2(A,B,Q=0){const g=this._tokenize(A,B,!0,Q);return{tokens:g.lineTokens.getBinaryResult(g.ruleStack,g.lineLength),ruleStack:g.ruleStack,stoppedEarly:g.stoppedEarly}}_tokenize(A,B,Q,g){let E;if(-1===this._rootId&&(this._rootId=wA.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),B&&B!==dA.NULL)E=!1,B.reset();else{E=!0;const A=this._basicScopeAttributesProvider.getDefaultAttributes(),Q=this.themeProvider.getDefaults(),g=k.set(0,A.languageId,A.tokenType,null,Q.fontStyle,Q.foregroundId,Q.backgroundId),C=this.getRule(this._rootId).getName(null,null);let I;I=C?pA.createRootAndLookUpScopeName(C,g,this):pA.createRoot("unknown",g),B=new dA(null,this._rootId,-1,-1,!1,null,I,I)}A+="\n";const C=this.createOnigString(A),I=C.content.length,D=new lA(Q,A,this._tokenTypeMatchers,this.balancedBracketSelectors),w=LA(this,C,E,0,B,D,!0,g);return Y(C),{lineLength:I,lineTokens:D,ruleStack:w.stack,stoppedEarly:w.stoppedEarly}}}function JA(A,B){return(A=U(A)).repository=A.repository||{},A.repository.$self={$vscodeTextmateLocation:A.$vscodeTextmateLocation,patterns:A.patterns,name:A.scopeName},A.repository.$base=B||A.repository.$self,A}class pA{constructor(A,B,Q){this.parent=A,this.scopePath=B,this.tokenAttributes=Q}static fromExtension(A,B){let Q=A,g=A?.scopePath??null;for(const A of B)g=iA.push(g,A.scopeNames),Q=new pA(Q,g,A.encodedTokenAttributes);return Q}static createRoot(A,B){return new pA(null,new iA(null,A),B)}static createRootAndLookUpScopeName(A,B,Q){const g=Q.getMetadataForScope(A),E=new iA(null,A),C=Q.themeProvider.themeMatch(E),I=pA.mergeAttributes(B,g,C);return new pA(null,E,I)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(A){return pA.equals(this,A)}static equals(A,B){for(;;){if(A===B)return!0;if(!A&&!B)return!0;if(!A||!B)return!1;if(A.scopeName!==B.scopeName||A.tokenAttributes!==B.tokenAttributes)return!1;A=A.parent,B=B.parent}}static mergeAttributes(A,B,Q){let g=-1,E=0,C=0;return null!==Q&&(g=Q.fontStyle,E=Q.foregroundId,C=Q.backgroundId),k.set(A,B.languageId,B.tokenType,null,g,E,C)}pushAttributed(A,B){if(null===A)return this;if(-1===A.indexOf(" "))return pA._pushAttributed(this,A,B);const Q=A.split(/ /g);let g=this;for(const A of Q)g=pA._pushAttributed(g,A,B);return g}static _pushAttributed(A,B,Q){const g=Q.getMetadataForScope(B),E=A.scopePath.push(B),C=Q.themeProvider.themeMatch(E),I=pA.mergeAttributes(A.tokenAttributes,g,C);return new pA(A,E,I)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(A){const B=[];let Q=this;for(;Q&&Q!==A;)B.push({encodedTokenAttributes:Q.tokenAttributes,scopeNames:Q.scopePath.getExtensionIfDefined(Q.parent?.scopePath??null)}),Q=Q.parent;return Q===A?B.reverse():void 0}}class dA{constructor(A,B,Q,g,E,C,I,D){this.parent=A,this.ruleId=B,this.beginRuleCapturedEOL=E,this.endRule=C,this.nameScopesList=I,this.contentNameScopesList=D,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=Q,this._anchorPos=g}equals(A){return null!==A&&dA._equals(this,A)}static _equals(A,B){return A===B||!!this._structuralEquals(A,B)&&pA.equals(A.contentNameScopesList,B.contentNameScopesList)}static _structuralEquals(A,B){for(;;){if(A===B)return!0;if(!A&&!B)return!0;if(!A||!B)return!1;if(A.depth!==B.depth||A.ruleId!==B.ruleId||A.endRule!==B.endRule)return!1;A=A.parent,B=B.parent}}clone(){return this}static _reset(A){for(;A;)A._enterPos=-1,A._anchorPos=-1,A=A.parent}reset(){dA._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(A,B,Q,g,E,C,I){return new dA(this,A,B,Q,g,E,C,I)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(A){return A.getRule(this.ruleId)}toString(){const A=[];return this._writeString(A,0),"["+A.join(",")+"]"}_writeString(A,B){return this.parent&&(B=this.parent._writeString(A,B)),A[B++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,B}withContentNameScopesList(A){return this.contentNameScopesList===A?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,A)}withEndRule(A){return this.endRule===A?this:new dA(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,A,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(A){let B=this;for(;B&&B._enterPos===A._enterPos;){if(B.ruleId===A.ruleId)return!0;B=B.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(A,B){const Q=pA.fromExtension(A?.nameScopesList??null,B.nameScopesList);return new dA(A,B.ruleId,B.enterPos??-1,B.anchorPos??-1,B.beginRuleCapturedEOL,B.endRule,Q,pA.fromExtension(Q,B.contentNameScopesList))}}dA.NULL=new dA(null,0,0,0,!1,null,null,null);class SA{constructor(A,B){this.allowAny=!1,this.balancedBracketScopes=A.flatMap((A=>"*"===A?(this.allowAny=!0,[]):R(A,PA).map((A=>A.matcher)))),this.unbalancedBracketScopes=B.flatMap((A=>R(A,PA).map((A=>A.matcher))))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(A){for(const B of this.unbalancedBracketScopes)if(B(A))return!1;for(const B of this.balancedBracketScopes)if(B(A))return!0;return this.allowAny}}class lA{constructor(A,B,Q,g){this.balancedBracketSelectors=g,this._emitBinaryTokens=A,this._tokenTypeOverrides=Q,this._lineText=L?B:null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(A,B){this.produceFromScopes(A.contentNameScopesList,B)}produceFromScopes(A,B){if(this._lastTokenEndIndex>=B)return;if(this._emitBinaryTokens){let Q=A?.tokenAttributes??0,g=!1;if(this.balancedBracketSelectors?.matchesAlways&&(g=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const B=A?.getScopeNames()??[];for(const A of this._tokenTypeOverrides)A.matcher(B)&&(Q=k.set(Q,0,A.type,null,-1,0,0));this.balancedBracketSelectors&&(g=this.balancedBracketSelectors.match(B))}if(g&&(Q=k.set(Q,0,8,g,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===Q)return void(this._lastTokenEndIndex=B);if(L){const Q=A?.getScopeNames()??[];console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,B).replace(/\n$/,"\\n")+"|");for(let A=0;A0&&this._tokens[this._tokens.length-1].startIndex===B-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(A,B),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(A,B){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===B-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(A,B),this._binaryTokens[this._binaryTokens.length-2]=0);const Q=new Uint32Array(this._binaryTokens.length);for(let A=0,B=this._binaryTokens.length;A0;)10===A.charCodeAt(E)?(E++,C++,I=0):(E++,I++),B--}function w(A){null===Q?E=A:D(A-E)}function o(){for(;E0&&65279===A.charCodeAt(0)&&(E=1);let i=0,t=null,r=[],a=[],M=null;function h(A,B){r.push(i),a.push(t),i=A,t=B}function n(){if(0===r.length)return F("illegal state stack");i=r.pop(),t=a.pop()}function F(B){throw new Error("Near offset "+E+": "+B+" ~~~"+A.substr(E,50)+"~~~")}const G=function(){if(null===M)return F("missing ");let A={};null!==Q&&(A[Q]={filename:B,line:C,char:I}),t[M]=A,M=null,h(1,A)},N=function(){if(null===M)return F("missing ");let A=[];t[M]=A,M=null,h(2,A)},H=function(){let A={};null!==Q&&(A[Q]={filename:B,line:C,char:I}),t.push(A),h(1,A)},L=function(){let A=[];t.push(A),h(2,A)};function k(){if(1!==i)return F("unexpected ");n()}function R(){return 1===i||2!==i?F("unexpected "):void n()}function K(A){if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function Y(A){if(isNaN(A))return F("cannot parse float");if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function U(A){if(isNaN(A))return F("cannot parse integer");if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function P(A){if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function u(A){if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function y(A){if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function J(){let A=c(">"),B=!1;return 47===A.charCodeAt(A.length-1)&&(B=!0,A=A.substring(0,A.length-1)),{name:A.trim(),isClosed:B}}function p(A){if(A.isClosed)return"";let B=c(""),B.replace(/&#([0-9]+);/g,(function(A,B){return String.fromCodePoint(parseInt(B,10))})).replace(/&#x([0-9a-f]+);/g,(function(A,B){return String.fromCodePoint(parseInt(B,16))})).replace(/&|<|>|"|'/g,(function(A){switch(A){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return A}))}for(;E=g));){const w=A.charCodeAt(E);if(D(1),60!==w)return F("expected <");if(E>=g)return F("unexpected end of input");const c=A.charCodeAt(E);if(63===c){D(1),e("?>");continue}if(33===c){if(D(1),s("--")){e("--\x3e");continue}e(">");continue}if(47===c){if(D(1),o(),s("plist")){e(">");continue}if(s("dict")){e(">"),k();continue}if(s("array")){e(">"),R();continue}return F("unexpected closed tag")}let r=J();switch(r.name){case"dict":1===i?G():2===i?H():(t={},null!==Q&&(t[Q]={filename:B,line:C,char:I}),h(1,t)),r.isClosed&&k();continue;case"array":1===i?N():2===i?L():(t=[],h(2,t)),r.isClosed&&R();continue;case"key":d=p(r),1!==i?F("unexpected "):null!==M?F("too many "):M=d;continue;case"string":K(p(r));continue;case"real":Y(parseFloat(p(r)));continue;case"integer":U(parseInt(p(r),10));continue;case"date":P(new Date(p(r)));continue;case"data":u(p(r));continue;case"true":p(r),y(!0);continue;case"false":p(r),y(!1);continue}if(!/^plist/.test(r.name))return F("unexpected opened tag "+r.name)}var d;return t}function fA(A,B){throw new Error("Near offset "+A.pos+": "+B+" ~~~"+A.source.substr(A.pos,50)+"~~~")}class xA{constructor(A){this.source=A,this.pos=0,this.len=A.length,this.line=1,this.char=0}}class OA{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(A){return{filename:A,line:this.line,char:this.char}}}function qA(A,B){B.value=null,B.type=0,B.offset=-1,B.len=-1,B.line=-1,B.char=-1;let Q,g=A.source,E=A.pos,C=A.len,I=A.line,D=A.char;for(;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),32!==Q&&9!==Q&&13!==Q){if(10!==Q)break;E++,I++,D=0}else E++,D++}if(B.offset=E,B.line=I,B.char=D,34===Q){for(B.type=1,E++,D++;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),E++,D++,92!==Q){if(34===Q)break}else E++,D++}B.value=g.substring(B.offset+1,E-1).replace(/\\u([0-9A-Fa-f]{4})/g,((A,B)=>String.fromCodePoint(parseInt(B,16)))).replace(/\\(.)/g,((B,Q)=>{switch(Q){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:fA(A,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===Q)B.type=2,E++,D++;else if(123===Q)B.type=3,E++,D++;else if(93===Q)B.type=4,E++,D++;else if(125===Q)B.type=5,E++,D++;else if(58===Q)B.type=6,E++,D++;else if(44===Q)B.type=7,E++,D++;else if(110===Q){if(B.type=8,E++,D++,Q=g.charCodeAt(E),117!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;E++,D++}else if(116===Q){if(B.type=9,E++,D++,Q=g.charCodeAt(E),114!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),117!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),101!==Q)return!1;E++,D++}else if(102===Q){if(B.type=10,E++,D++,Q=g.charCodeAt(E),97!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),115!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),101!==Q)return!1;E++,D++}else for(B.type=11;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),!(46===Q||Q>=48&&Q<=57||101===Q||69===Q||45===Q||43===Q))break;E++,D++}return B.len=E-B.offset,null===B.value&&(B.value=g.substr(B.offset,B.len)),A.pos=E,A.line=I,A.char=D,!0}class bA{constructor(A,B){this._onigLibPromise=B,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=A}dispose(){for(const A of this._grammars.values())A.dispose()}setTheme(A){this._theme=A}getColorMap(){return this._theme.getColorMap()}addGrammar(A,B){this._rawGrammars.set(A.scopeName,A),B&&this._injectionGrammars.set(A.scopeName,B)}lookup(A){return this._rawGrammars.get(A)}injections(A){return this._injectionGrammars.get(A)}getDefaults(){return this._theme.getDefaults()}themeMatch(A){return this._theme.match(A)}async grammarForScopeName(A,B,Q,g,E){if(!this._grammars.has(A)){let C=this._rawGrammars.get(A);if(!C)return null;this._grammars.set(A,function(A,B,Q,g,E,C,I,D){return new yA(A,B,Q,g,E,C,I,D)}(A,C,B,Q,g,E,this,await this._onigLibPromise))}return this._grammars.get(A)}}function WA(A,B){let Q=0;const g=[];let E=A,C=B;for(;E!==C;)E&&(!C||E.depth>=C.depth)?(Q++,E=E.parent):(g.push(C.toStateStackFrame()),C=C.parent);return{pops:Q,newFrames:g.reverse()}}function TA(A,B){let Q=A;for(let A=0;A0;)await Promise.all(C.Q.map((A=>this._loadSingleGrammar(A.scopeName)))),C.processQueue();return this._grammarForScopeName(A,B,Q,g,E)}async _loadSingleGrammar(A){return this._ensureGrammarCache.has(A)||this._ensureGrammarCache.set(A,this._doLoadSingleGrammar(A)),this._ensureGrammarCache.get(A)}async _doLoadSingleGrammar(A){const B=await this._options.loadGrammar(A);if(B){const Q="function"==typeof this._options.getInjections?this._options.getInjections(A):void 0;this._syncRegistry.addGrammar(B,Q)}}async addGrammar(A,B=[],Q=0,g=null){return this._syncRegistry.addGrammar(A,B),await this._grammarForScopeName(A.scopeName,Q,g)}_grammarForScopeName(A,B=0,Q=null,g=null,E=null){return this._syncRegistry.grammarForScopeName(A,B,Q,g,E)}}const XA=dA.NULL,ZA=function(A,B=null){return null!==B&&/\.json$/.test(B)?(Q=A,L?function(A,B,Q){let g=new xA(A),E=new OA,C=0,I=null,D=[],w=[];function o(){D.push(C),w.push(I)}function s(){C=D.pop(),I=w.pop()}function e(A){fA(g,A)}for(;qA(g,E);){if(0===C){if(null!==I&&e("too many constructs in root"),3===E.type){I={},I.$vscodeTextmateLocation=E.toLocation(B),o(),C=1;continue}if(2===E.type){I=[],o(),C=4;continue}e("unexpected token in root")}if(2===C){if(5===E.type){s();continue}if(7===E.type){C=3;continue}e("expected , or }")}if(1===C||3===C){if(1===C&&5===E.type){s();continue}if(1===E.type){let A=E.value;if(qA(g,E)&&6===E.type||e("expected colon"),qA(g,E)||e("expected value"),C=2,1===E.type){I[A]=E.value;continue}if(8===E.type){I[A]=null;continue}if(9===E.type){I[A]=!0;continue}if(10===E.type){I[A]=!1;continue}if(11===E.type){I[A]=parseFloat(E.value);continue}if(2===E.type){let B=[];I[A]=B,o(),C=4,I=B;continue}if(3===E.type){let Q={};Q.$vscodeTextmateLocation=E.toLocation(B),I[A]=Q,o(),C=1,I=Q;continue}}e("unexpected token in dict")}if(5===C){if(4===E.type){s();continue}if(7===E.type){C=6;continue}e("expected , or ]")}if(4===C||6===C){if(4===C&&4===E.type){s();continue}if(C=5,1===E.type){I.push(E.value);continue}if(8===E.type){I.push(null);continue}if(9===E.type){I.push(!0);continue}if(10===E.type){I.push(!1);continue}if(11===E.type){I.push(parseFloat(E.value));continue}if(2===E.type){let A=[];I.push(A),o(),C=4,I=A;continue}if(3===E.type){let A={};A.$vscodeTextmateLocation=E.toLocation(B),I.push(A),o(),C=1,I=A;continue}e("unexpected token in array")}e("unknown state")}return 0!==w.length&&e("unclosed constructs"),I}(Q,B):JSON.parse(Q)):function(A,B){return L?function(A,B,Q){return mA(A,B,"$vscodeTextmateLocation")}(A,B):function(A){return mA(A,null,null)}(A)}(A,B);var Q};var jA=H.Bz,VA=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(A){var B,Q,g=void 0!==(A=A||{})?A:{};g.ready=new Promise((function(A,g){B=A,Q=g}));var E,C=Object.assign({},g),I=!1;E=function(A){let B;return"function"==typeof readbuffer?new Uint8Array(readbuffer(A)):(B=read(A,"binary"),"object"==typeof B||H(Q),B);var Q},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print);var D,w,o=g.print||console.log.bind(console),s=g.printErr||console.warn.bind(console);Object.assign(g,C),C=null,g.arguments&&g.arguments,g.thisProgram&&g.thisProgram,g.quit&&g.quit,g.wasmBinary&&(D=g.wasmBinary),g.noExitRuntime,"object"!=typeof WebAssembly&&H("no native wasm support detected");var e,c,i,t=!1,r="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(A,B,Q){for(var g=B+Q,E=B;A[E]&&!(E>=g);)++E;if(E-B>16&&A.buffer&&r)return r.decode(A.subarray(B,E));for(var C="";B>10,56320|1023&o)}}else C+=String.fromCharCode((31&I)<<6|D)}else C+=String.fromCharCode(I)}return C}function M(A){e=A,g.HEAP8=new Int8Array(A),g.HEAP16=new Int16Array(A),g.HEAP32=new Int32Array(A),g.HEAPU8=c=new Uint8Array(A),g.HEAPU16=new Uint16Array(A),g.HEAPU32=i=new Uint32Array(A),g.HEAPF32=new Float32Array(A),g.HEAPF64=new Float64Array(A)}g.INITIAL_MEMORY;var h=[],n=[],F=[],G=0,N=null;function H(A){g.onAbort&&g.onAbort(A),s(A="Aborted("+A+")"),t=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw Q(B),B}var L,k,R,K="data:application/octet-stream;base64,";function Y(A){return A.startsWith(K)}function U(A){try{if(A==L&&D)return new Uint8Array(D);if(E)return E(A);throw"both async and sync fetching of the wasm failed"}catch(A){H(A)}}function P(A){for(;A.length>0;)A.shift()(g)}function u(A){try{return w.grow(A-e.byteLength+65535>>>16),M(w.buffer),1}catch(A){}}Y(L="onig.wasm")||(k=L,L=g.locateFile?g.locateFile(k,""):""+k),R="undefined"!=typeof dateNow?dateNow:()=>performance.now();var y=[null,[],[]];function J(A,B){var Q=y[A];0===B||10===B?((1===A?o:s)(a(Q,0)),Q.length=0):Q.push(B)}var p,d={emscripten_get_now:R,emscripten_memcpy_big:function(A,B,Q){c.copyWithin(A,B,B+Q)},emscripten_resize_heap:function(A){var B=c.length,Q=2147483648;if((A>>>=0)>Q)return!1;let g=(A,B)=>A+(B-A%B)%B;for(var E=1;E<=4;E*=2){var C=B*(1+.2/E);if(C=Math.min(C,A+100663296),u(Math.min(Q,g(Math.max(A,C),65536))))return!0}return!1},fd_write:function(A,B,Q,g){for(var E=0,C=0;C>2],D=i[B+4>>2];B+=8;for(var w=0;w>2]=E,0}};function S(A){function Q(){p||(p=!0,g.calledRun=!0,t||(P(n),B(g),g.onRuntimeInitialized&&g.onRuntimeInitialized(),function(){if(g.postRun)for("function"==typeof g.postRun&&(g.postRun=[g.postRun]);g.postRun.length;)A=g.postRun.shift(),F.unshift(A);var A;P(F)}()))}G>0||(function(){if(g.preRun)for("function"==typeof g.preRun&&(g.preRun=[g.preRun]);g.preRun.length;)A=g.preRun.shift(),h.unshift(A);var A;P(h)}(),G>0||(g.setStatus?(g.setStatus("Running..."),setTimeout((function(){setTimeout((function(){g.setStatus("")}),1),Q()}),1)):Q()))}if(function(){var A={env:d,wasi_snapshot_preview1:d};function B(A,B){var Q,E=A.exports;g.asm=E,M((w=g.asm.memory).buffer),g.asm.__indirect_function_table,Q=g.asm.__wasm_call_ctors,n.unshift(Q),function(A){if(G--,g.monitorRunDependencies&&g.monitorRunDependencies(G),0==G&&N){var B=N;N=null,B()}}()}function E(A){B(A.instance)}function C(B){return(!D&&I&&"function"==typeof fetch?fetch(L,{credentials:"same-origin"}).then((function(A){if(!A.ok)throw"failed to load wasm binary file at '"+L+"'";return A.arrayBuffer()})).catch((function(){return U(L)})):Promise.resolve().then((function(){return U(L)}))).then((function(B){return WebAssembly.instantiate(B,A)})).then((function(A){return A})).then(B,(function(A){s("failed to asynchronously prepare wasm: "+A),H(A)}))}if(G++,g.monitorRunDependencies&&g.monitorRunDependencies(G),g.instantiateWasm)try{return g.instantiateWasm(A,B)}catch(A){s("Module.instantiateWasm callback failed with error: "+A),Q(A)}(D||"function"!=typeof WebAssembly.instantiateStreaming||Y(L)||"function"!=typeof fetch?C(E):fetch(L,{credentials:"same-origin"}).then((function(B){return WebAssembly.instantiateStreaming(B,A).then(E,(function(A){return s("wasm streaming compile failed: "+A),s("falling back to ArrayBuffer instantiation"),C(E)}))}))).catch(Q)}(),g.___wasm_call_ctors=function(){return(g.___wasm_call_ctors=g.asm.__wasm_call_ctors).apply(null,arguments)},g.___errno_location=function(){return(g.___errno_location=g.asm.__errno_location).apply(null,arguments)},g._omalloc=function(){return(g._omalloc=g.asm.omalloc).apply(null,arguments)},g._ofree=function(){return(g._ofree=g.asm.ofree).apply(null,arguments)},g._getLastOnigError=function(){return(g._getLastOnigError=g.asm.getLastOnigError).apply(null,arguments)},g._createOnigScanner=function(){return(g._createOnigScanner=g.asm.createOnigScanner).apply(null,arguments)},g._freeOnigScanner=function(){return(g._freeOnigScanner=g.asm.freeOnigScanner).apply(null,arguments)},g._findNextOnigScannerMatch=function(){return(g._findNextOnigScannerMatch=g.asm.findNextOnigScannerMatch).apply(null,arguments)},g._findNextOnigScannerMatchDbg=function(){return(g._findNextOnigScannerMatchDbg=g.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},g.stackSave=function(){return(g.stackSave=g.asm.stackSave).apply(null,arguments)},g.stackRestore=function(){return(g.stackRestore=g.asm.stackRestore).apply(null,arguments)},g.stackAlloc=function(){return(g.stackAlloc=g.asm.stackAlloc).apply(null,arguments)},g.dynCall_jiji=function(){return(g.dynCall_jiji=g.asm.dynCall_jiji).apply(null,arguments)},g.UTF8ToString=function(A,B){return A?a(c,A,B):""},N=function A(){p||S(),p||(N=A)},g.preInit)for("function"==typeof g.preInit&&(g.preInit=[g.preInit]);g.preInit.length>0;)g.preInit.pop()();return S(),A.ready});let zA=null;class _A{static _utf8ByteLength(A){let B=0;for(let Q=0,g=A.length;Q=55296&&E<=56319&&Q+1=56320&&B<=57343&&(C=65536+(E-55296<<10)|B-56320,I=!0)}B+=C<=127?1:C<=2047?2:C<=65535?3:4,I&&Q++}return B}constructor(A){const B=A.length,Q=_A._utf8ByteLength(A),g=Q!==B,E=g?new Uint32Array(B+1):null;g&&(E[B]=Q);const C=g?new Uint32Array(Q+1):null;g&&(C[Q]=B);const I=new Uint8Array(Q);let D=0;for(let Q=0;Q=55296&&w<=56319&&Q+1=56320&&B<=57343&&(o=65536+(w-55296<<10)|B-56320,s=!0)}g&&(E[Q]=D,s&&(E[Q+1]=D),o<=127?C[D+0]=Q:o<=2047?(C[D+0]=Q,C[D+1]=Q):o<=65535?(C[D+0]=Q,C[D+1]=Q,C[D+2]=Q):(C[D+0]=Q,C[D+1]=Q,C[D+2]=Q,C[D+3]=Q)),o<=127?I[D++]=o:o<=2047?(I[D++]=192|(1984&o)>>>6,I[D++]=128|(63&o)>>>0):o<=65535?(I[D++]=224|(61440&o)>>>12,I[D++]=128|(4032&o)>>>6,I[D++]=128|(63&o)>>>0):(I[D++]=240|(1835008&o)>>>18,I[D++]=128|(258048&o)>>>12,I[D++]=128|(4032&o)>>>6,I[D++]=128|(63&o)>>>0),s&&Q++}this.utf16Length=B,this.utf8Length=Q,this.utf16Value=A,this.utf8Value=I,this.utf16OffsetToUtf8=E,this.utf8OffsetToUtf16=C}createString(A){const B=A._omalloc(this.utf8Length);return A.HEAPU8.set(this.utf8Value,B),B}}class $A{constructor(A){if(this.id=++$A.LAST_ID,!zA)throw new Error("Must invoke loadWASM first.");this._onigBinding=zA,this.content=A;const B=new _A(A);this.utf16Length=B.utf16Length,this.utf8Length=B.utf8Length,this.utf16OffsetToUtf8=B.utf16OffsetToUtf8,this.utf8OffsetToUtf16=B.utf8OffsetToUtf16,this.utf8Length<1e4&&!$A._sharedPtrInUse?($A._sharedPtr||($A._sharedPtr=zA._omalloc(1e4)),$A._sharedPtrInUse=!0,zA.HEAPU8.set(B.utf8Value,$A._sharedPtr),this.ptr=$A._sharedPtr):this.ptr=B.createString(zA)}convertUtf8OffsetToUtf16(A){return this.utf8OffsetToUtf16?A<0?0:A>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[A]:A}convertUtf16OffsetToUtf8(A){return this.utf16OffsetToUtf8?A<0?0:A>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[A]:A}dispose(){this.ptr===$A._sharedPtr?$A._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}$A.LAST_ID=0,$A._sharedPtr=0,$A._sharedPtrInUse=!1;class AB{constructor(A){if(!zA)throw new Error("Must invoke loadWASM first.");const B=[],Q=[];for(let g=0,E=A.length;gWebAssembly.instantiateStreaming(A,B)}(g):function(A){return async B=>{const Q=await A.arrayBuffer();return WebAssembly.instantiate(Q,B)}}(g):function(A){return B=>WebAssembly.instantiate(A,B)}(g)}return QB=new Promise(((A,B)=>{g=A,E=B})),function(A,B,Q,g){VA({print:B,instantiateWasm:(B,Q)=>{if("undefined"==typeof performance){const A=()=>Date.now();B.env.emscripten_get_now=A,B.wasi_snapshot_preview1.emscripten_get_now=A}return A(B).then((A=>Q(A.instance)),g),{}}}).then((A=>{zA=A,Q()}))}(B,Q,g,E),QB}function EB(A){return new $A(A)}function CB(A){return new AB(A)}function IB(A){const B=F[A];if(!B)return;const{id:Q}=G[B];return{id:Q,scopeName:B}}const DB=new Map;let wB,oB;async function sB(B){if(DB.has(B))return DB.get(B);const g=function(A){return G[A]}(B);if(!g)return Promise.resolve(void 0);let E;if(void 0===wB&&(E=A(g.id),wB=E.then((()=>!0)).catch((()=>!1))),void 0===oB&&(oB=await wB),oB){const Q=E||A(g.id);return DB.set(B,Q),Q}const C=Q(`grammars/${g.id}`);g.embeddedScopes.forEach((A=>{if(!DB.has(A)){const B=C.then((B=>null==B?void 0:B.find((B=>B.scopeName===A))));DB.set(A,B)}}));const I=C.then((A=>null==A?void 0:A.find((A=>A.scopeName===B))));return DB.set(B,I),I}const eB=30720,cB=16744448,iB=16775168,tB=11,rB=15,aB={NotSet:-1,None:0,Italic:1,Bold:2,Underline:4,Strikethrough:8};function MB(A,B,Q,g){const{tokens:E,ruleStack:C}=A.tokenizeLine2(Q,B),I=[];let D=Q.length;for(let A=E.length-2;A>=0;A-=2){const B=E[A],g=E[A+1],C=Q.slice(B,D);I.unshift({content:C,metadata:g}),D=B}let w=[];if(null==g?void 0:g.preserveWhitespace)w=I;else for(let A=0;A0?w[w.length-1].content+=B.content:A{const{rawTokens:E,nextStack:C}=MB(B,g,A,{preserveWhitespace:!0}),I=E.map((({content:A,metadata:B})=>({content:A,style:nB(B,Q)}))),D=function(A,B,Q,g){const{tokens:E}=Q.tokenizeLine(A,B),C=[];for(let B=0;B{if(w+=A.content.length,Q>>rB]},g=(A&eB)>>>tB;return g&aB.Italic&&(Q.fontStyle="italic"),g&aB.Bold&&(Q.fontWeight="bold"),g&aB.Underline&&(Q.textDecoration="underline"),g&aB.Strikethrough&&(Q.textDecoration="line-through"),Q}var FB=function(A){var B=null;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)B=Buffer.from(A,"base64");else{var Q=globalThis.atob(A),g=Q.length;B=new Uint8Array(new ArrayBuffer(g));for(var E=0;E({createOnigScanner:CB,createOnigString:EB})));GB=new jA({onigLib:A,loadGrammar:A=>sB(A)})}const B=A.filter((A=>!NB(A))).map((A=>{const B=IB(A);if(!B)throw new kB(A);return GB.loadGrammar(B.scopeName)}));return Promise.all(B)}function LB(A){if(NB(A))return{langId:A,grammar:null};const B=IB(A);if(!B)throw new kB(A);const Q=function(A){const{_syncRegistry:B}=GB;return null==B?void 0:B._grammars.get(A)}(B.scopeName);if(!Q)throw new Error(`Syntax highlighting error: grammar for ${A} not loaded`);return{langId:B.id,grammar:Q}}class kB extends Error{constructor(A){super(`Unknown language: ${A}`),this.alias=A}}function RB(A,B,Q){GB.setTheme(Q);const g=function(A){const B=GB.getColorMap();return A.colorNames?B.map((B=>Object.keys(A.colorNames).find((Q=>A.colorNames[Q].toUpperCase()===B.toUpperCase()))||B)):B}(Q);return function(A,B,Q){let g=null;return A.split(/\r?\n|\r/g).map((A=>{const{rawTokens:E,nextStack:C}=MB(B,g,A);return g=C,E.map((({content:A,metadata:B})=>({content:A,style:nB(B,Q)})))}))}(A,B,g)}function KB(A){return A.split(/\r?\n|\r/g).map((A=>[{content:A,style:{}}]))}function YB(A,B){return PB(A.slice(1,-1)).map((A=>{const{from:Q,to:g}=UB(A);return{lineNumber:B,fromColumn:Q,toColumn:g}}))}function UB(A){const[B,Q]=A.split(":");if(!uB(B))throw new yB(B);const g=Number(B);if(g<1)throw new JB;if(Q){if(!uB(Q))throw new yB(Q);return{from:g,to:+Q}}return{from:g,to:g}}function PB(A){return A.split(/,(?![^\[]*\])/g)}function uB(A){A=A.toString();var B=Math.abs(A),Q=parseInt(A,10);return!isNaN(B)&&Q===B&&B.toString()===A}class yB extends Error{constructor(A){super(`Invalid number "${A}" in range string`),this.number=A,Object.setPrototypeOf(this,new.target.prototype)}}class JB extends Error{constructor(){super("Invalid line or column number in range string"),Object.setPrototypeOf(this,new.target.prototype)}}const pB="#001",dB="#010",SB={name:"comments",type:"light",foreground:"",background:"",colors:{},settings:[{settings:{foreground:"#000"}},{scope:["punctuation.definition.comment"],settings:{foreground:pB}},{scope:"comment",settings:{foreground:dB}}]};function lB(A,B,Q,g){const E=B?RB(A,B,SB):KB(A),C=[];let I=1;const D=E.map((A=>{const{annotations:B,lineWithoutComments:E}=function(A,B,Q,g){if(g in mB&&A.some((A=>A.style.color===dB))){const B=mB[g];A=A.flatMap((A=>{if(A.style.color!==dB)return[A];const Q=A.content.trimStart();if(Q.startsWith(B)){const g=Q.slice(B.length),E=[{content:A.content.slice(0,A.content.length-g.length),style:{color:pB}}];return g.length&&E.push({content:g,style:A.style}),E}return[A]}))}if(!A.some((A=>A.style.color===pB)))return{annotations:[],lineWithoutComments:A};const E=[];let C=0;for(;C!A.tokens.includes(B)));I.every((A=>""===A.content.trim()))&&(I=null);return{annotations:E.map((A=>({name:A.name,query:A.query,lineNumber:A.lineNumber,rangeString:A.rangeString}))),lineWithoutComments:I}}(A,g,I,Q);if(C.push(...B),!E)return null;const D=E.map((A=>A.content)).join("");return["mdx","jsx","tsx"].includes(Q)&&B.length>0&&"{}"===D.trim()?null:(I++,D)})).filter((A=>null!==A)).join("\n"),w=C.map((A=>{var{rangeString:B,lineNumber:Q}=A,g=function(A,B){var Q={};for(var g in A)Object.prototype.hasOwnProperty.call(A,g)&&B.indexOf(g)<0&&(Q[g]=A[g]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols){var E=0;for(g=Object.getOwnPropertySymbols(A);EA.ranges.length>0));return{newCode:D,annotations:w}}const mB={"actionscript-3":"//",ada:"--",asm:"#",dart:"//",fsharp:"//",graphql:"#",http:"#",rust:"//",sparql:"#",wgsl:"//",jsonnet:"//",kql:"//",zenscript:"//",kusto:"//",turtle:"#",abap:"*",beancount:";",kotlin:"//",hlsl:"//",berry:"#",cypher:"//",elm:"--",nix:"#",viml:'"',solidity:"//",bat:"REM",shaderlab:"//",sas:"*"};function fB(A,B,Q){return A&&A.startsWith("(/")?function(A,B,Q){const g=B.match(/\(\/([\s\S]*?)\/([gimuy]*)\)/);if(!g)throw new Error(`Invalid RegExp string: ${B}`);const E=new RegExp(g[1],g[2]),C=A.split(/\r?\n/).slice(Q-1).join("\n");if(!E.global){const A=E.exec(C);if(!A)return[];const B=C.slice(0,A.index).split("\n").length+Q-1;return[{fromLineNumber:B,toLineNumber:B+A[0].split("\n").length-1}]}let I;const D=[];for(;I=E.exec(C);){const A=C.slice(0,I.index).split("\n").length+Q-1,B=A+I[0].split("\n").length-1,g=D[D.length-1];g&&g.fromLineNumber===A||D.push({fromLineNumber:A,toLineNumber:B})}return D}(Q,A,B):A&&A.startsWith("[/")?function(A,B,Q){const g=B.match(/\[\/([\s\S]*?)\/([gimuy]*)\]/);if(!g)throw new Error(`Invalid RegExp string: ${B}`);let E=g[2]||"";E+="d";const C=new RegExp(g[1],E);let I=A.split(/\r?\n/);I=I.slice(Q-1),C.multiline||(I=[I[0]]);const D=[];return I.forEach(((A,B)=>{if(!C.global){if(D.length>0)return;const g=C.exec(A);if(!g)return;const E=g.indices[1]||g.indices[0];return void D.push({lineNumber:B+Q,fromColumn:E[0]+1,toColumn:E[1]})}let g;for(;g=C.exec(A);){const A=g.indices[1]||g.indices[0];D.push({lineNumber:B+Q,fromColumn:A[0]+1,toColumn:A[1]})}})),D}(Q,A,B):function(A,B){return A?A.startsWith("[")?YB(A,B):PB(A.slice(1,-1)).map((A=>{if(A.includes("[")){const[Q,g]=A.split("["),E=Number(Q),C=B+E-1;if(!uB(C))throw new yB(Q);return YB("["+g,C)}const{from:Q,to:g}=UB(A);return[{fromLineNumber:Q+B-1,toLineNumber:g+B-1}]})).flat():[{fromLineNumber:B,toLineNumber:B}]}(A,B)}function xB(A,B){var Q;const g=A.match(/\s*([\w-]+)?(\([^\)]*\)|\[[^\]]*\])?(.*)$/),E=g[1],C=g[2],I=null===(Q=g[3])||void 0===Q?void 0:Q.trim();return B.includes(E)?{name:E,rangeString:C,query:I}:null}function OB(A,B){let Q=[],g=1;return A.forEach((A=>{Q.push({fromColumn:g,toColumn:g+A.content.length-1,token:A}),g+=A.content.length})),B.forEach((A=>{Q=function(A,B){const{range:Q}=B,{fromColumn:g,toColumn:E}=Q,C=[];let I=0;for(;IE){const[A,Q]=bB(B,E+1);D.tokens.push(A),C.push(Q)}else D.tokens.push(B);I++}else C.push(D);for(;IqB(A)))}function qB(A){return"tokens"in A?{annotationName:A.annotationName,annotationQuery:A.annotationQuery,fromColumn:A.fromColumn,toColumn:A.toColumn,tokens:A.tokens.map((A=>qB(A)))}:A.token}function bB(A,B){if("token"in A){const Q=Object.assign(Object.assign({},A.token),{content:A.token.content.slice(0,B-A.fromColumn)}),g=Object.assign(Object.assign({},A.token),{content:A.token.content.slice(B-A.fromColumn)});return[Object.assign(Object.assign({},A),{toColumn:B-1,token:Q}),Object.assign(Object.assign({},A),{fromColumn:B,token:g})]}{const Q=[],g=[];A.tokens.forEach((A=>{if(A.toColumn=B)g.push(A);else{const[E,C]=bB(A,B);Q.push(E),g.push(C)}}));return[Object.assign(Object.assign({},A),{toColumn:B-1,tokens:Q}),Object.assign(Object.assign({},A),{fromColumn:B,tokens:g})]}}function WB(A,B){let Q=A.map(((A,B)=>({fromLineNumber:B+1,toLineNumber:B+1,line:A})));return B.forEach((A=>{Q=function(A,B){const{range:Q,name:g,query:E}=B,{fromLineNumber:C,toLineNumber:I}=Q,D=[];let w=0;for(;wI){const[A,Q]=vB(B,I+1);o.lines.push(A),D.push(Q)}else o.lines.push(B);w++}else D.push(o);for(;wTB(A)))}function TB(A){return"line"in A?{lineNumber:A.fromLineNumber,tokens:A.line.tokens}:{annotationName:A.annotationName,annotationQuery:A.annotationQuery,fromLineNumber:A.fromLineNumber,toLineNumber:A.toLineNumber,lines:A.lines.map((A=>TB(A)))}}function vB(A,B){if("line"in A)return[Object.assign(Object.assign({},A),{toLineNumber:B-1}),Object.assign(Object.assign({},A),{fromLineNumber:B})];{const Q=[],g=[];return A.lines.forEach((A=>{if(A.toLineNumber=B)g.push(A);else{const[E,C]=vB(A,B);Q.push(E),g.push(C)}})),[Object.assign(Object.assign({},A),{toLineNumber:B-1,lines:Q}),Object.assign(Object.assign({},A),{fromLineNumber:B,lines:g})]}}function XB(A,B){const{inlineAnnotations:Q,multilineAnnotations:g}=function(A){const B=[],Q=[];return A.forEach((A=>{A.ranges.forEach((g=>{"lineNumber"in g?B.push(Object.assign(Object.assign({},A),{range:g})):Q.push(Object.assign(Object.assign({},A),{range:g}))}))})),{inlineAnnotations:B,multilineAnnotations:Q}}(B);return WB(A.map(((A,B)=>{const g=Q.filter((A=>A.range.lineNumber===B+1));return{lineNumber:B+1,tokens:OB(A,g)}})),g)}var ZB=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],jB={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function VB(A,B){const Q=A.indexOf("[",B);if(-1!==Q){const B=A.indexOf("m",Q);return{sequence:A.substring(Q+2,B).split(";"),startPosition:Q,position:B+1}}return{position:A.length}}function zB(A,B){let Q=1;const g=A[B+Q++];let E;if("2"===g){const g=[A[B+Q++],A[B+Q++],A[B+Q]].map((A=>Number.parseInt(A)));3!==g.length||g.some((A=>Number.isNaN(A)))||(E={type:"rgb",rgb:g})}else if("5"===g){const g=Number.parseInt(A[B+Q]);Number.isNaN(g)||(E={type:"table",index:Number(g)})}return[Q,E]}function _B(A){const B=[];for(let Q=0;Q=90&&E<=97?B.push({type:"setForegroundColor",value:{type:"named",name:ZB[E-90+8]}}):E>=100&&E<=107&&B.push({type:"setBackgroundColor",value:{type:"named",name:ZB[E-100+8]}})}return B}function $B(A,B){const Q=function(){let A=null,B=null,Q=new Set;return{parse(g){const E=[];let C=0;do{const I=VB(g,C),D=I.sequence?g.substring(C,I.startPosition):g.substring(C);if(D.length>0&&E.push({value:D,foreground:A,background:B,decorations:new Set(Q)}),I.sequence){const g=_B(I.sequence);for(const E of g)"resetAll"===E.type?(A=null,B=null,Q.clear()):"resetForegroundColor"===E.type?A=null:"resetBackgroundColor"===E.type?B=null:"resetDecoration"===E.type&&Q.delete(E.value);for(const E of g)"setForegroundColor"===E.type?A=E.value:"setBackgroundColor"===E.type?B=E.value:"setDecoration"===E.type&&Q.add(E.value)}C=I.position}while(Cfunction(A,B,Q){const g=A.parse(B),E=g.map((({value:A,foreground:B,background:g,decorations:E})=>{const C=AQ(B,Q),I={};C&&(I.color=C);const D=AQ(g,Q);return D&&(I.background=D),E.has("bold")&&(I.fontWeight="bold"),E.has("italic")&&(I.fontStyle="italic"),E.has("underline")&&(I.textDecoration="underline"),E.has("strikethrough")&&(I.textDecoration="line-through"),E.has("reverse")&&(I.color=D,I.background=C),E.has("dim")&&(I.opacity=.5),{content:A,style:I}}));return E}(Q,A,B)));return g}function AQ(A,B){if(A){if("named"===A.type){return w(B,"terminal.ansi"+(A.name[0].toUpperCase()+A.name.slice(1)))}if("rgb"===A.type){const[B,Q,g]=A.rgb;return`rgb(${B}, ${Q}, ${g})`}}}async function BQ(A,B){await Promise.all([HB(A),i(B)])}async function QQ(A,B,Q="dark-plus",g={}){const E=A||"",C=B||"text";if("string"!=typeof E)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof C)throw new Error("Syntax highlighter error: lang must be a string");return await BQ([C],Q),gQ(E,C,Q,g)}function gQ(A,B,Q="dark-plus",g={}){const E=A||"",C=B||"text";if("string"!=typeof E)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof C)throw new Error("Syntax highlighter error: lang must be a string");const{langId:I,grammar:D}=LB(C),o=t(Q),s="text"==I?KB(E):"terminal"==I?$B(E,o):(null==g?void 0:g.scopes)?function(A,B,Q){return GB.setTheme(Q),hB(A,B,GB.getColorMap())}(E,D,o):RB(E,D,o),e="terminal"==I?function(A){return{color:w(A,"terminal.foreground"),background:w(A,"terminal.background")}}(o):{color:o.foreground,background:o.background};if(function(A){return"annotations"in A}(g)){return{lines:XB(s,(null==g?void 0:g.annotations)||[]),lang:I,style:e}}return{lines:s,lang:I,style:e}}async function EQ(A,B,Q){if(!Q)return{code:A,annotations:[]};await HB([B]);const{grammar:g,langId:E}=LB(B),{newCode:C,annotations:I}=lB(A,g,E,Q);return{code:C,annotations:I}}async function CQ(A){if(!A)throw new Error("Syntax highlighter error: undefined theme");await BQ([],A);return h(t(A))}function IQ(A){if(!A)throw new Error("Syntax highlighter error: undefined theme");return h(t(A))}export{n as LANG_NAMES,a as THEME_NAMES,kB as UnknownLanguageError,M as UnknownThemeError,EQ as extractAnnotations,CQ as getThemeColors,IQ as getThemeColorsSync,QQ as highlight,gQ as highlightSync,BQ as preload}; +async function A(A){return async function(A){switch(A){case"abap":return import("./grammar/abap.mjs");case"actionscript-3":return import("./grammar/actionscript-3.mjs");case"ada":return import("./grammar/ada.mjs");case"angular-html":return import("./grammar/angular-html.mjs");case"angular-ts":return import("./grammar/angular-ts.mjs");case"apache":return import("./grammar/apache.mjs");case"apex":return import("./grammar/apex.mjs");case"apl":return import("./grammar/apl.mjs");case"applescript":return import("./grammar/applescript.mjs");case"ara":return import("./grammar/ara.mjs");case"asciidoc":return import("./grammar/asciidoc.mjs");case"asm":return import("./grammar/asm.mjs");case"astro":return import("./grammar/astro.mjs");case"awk":return import("./grammar/awk.mjs");case"ballerina":return import("./grammar/ballerina.mjs");case"bat":return import("./grammar/bat.mjs");case"beancount":return import("./grammar/beancount.mjs");case"berry":return import("./grammar/berry.mjs");case"bibtex":return import("./grammar/bibtex.mjs");case"bicep":return import("./grammar/bicep.mjs");case"blade":return import("./grammar/blade.mjs");case"c":return import("./grammar/c.mjs");case"cadence":return import("./grammar/cadence.mjs");case"clarity":return import("./grammar/clarity.mjs");case"clojure":return import("./grammar/clojure.mjs");case"cmake":return import("./grammar/cmake.mjs");case"cobol":return import("./grammar/cobol.mjs");case"codeowners":return import("./grammar/codeowners.mjs");case"codeql":return import("./grammar/codeql.mjs");case"coffee":return import("./grammar/coffee.mjs");case"common-lisp":return import("./grammar/common-lisp.mjs");case"cpp":return import("./grammar/cpp.mjs");case"crystal":return import("./grammar/crystal.mjs");case"csharp":return import("./grammar/csharp.mjs");case"css":return import("./grammar/css.mjs");case"csv":return import("./grammar/csv.mjs");case"cue":return import("./grammar/cue.mjs");case"cypher":return import("./grammar/cypher.mjs");case"d":return import("./grammar/d.mjs");case"dart":return import("./grammar/dart.mjs");case"dax":return import("./grammar/dax.mjs");case"desktop":return import("./grammar/desktop.mjs");case"diff":return import("./grammar/diff.mjs");case"docker":return import("./grammar/docker.mjs");case"dotenv":return import("./grammar/dotenv.mjs");case"dream-maker":return import("./grammar/dream-maker.mjs");case"edge":return import("./grammar/edge.mjs");case"elixir":return import("./grammar/elixir.mjs");case"elm":return import("./grammar/elm.mjs");case"emacs-lisp":return import("./grammar/emacs-lisp.mjs");case"erb":return import("./grammar/erb.mjs");case"erlang":return import("./grammar/erlang.mjs");case"fennel":return import("./grammar/fennel.mjs");case"fish":return import("./grammar/fish.mjs");case"fluent":return import("./grammar/fluent.mjs");case"fortran-fixed-form":return import("./grammar/fortran-fixed-form.mjs");case"fortran-free-form":return import("./grammar/fortran-free-form.mjs");case"fsharp":return import("./grammar/fsharp.mjs");case"gdresource":return import("./grammar/gdresource.mjs");case"gdscript":return import("./grammar/gdscript.mjs");case"gdshader":return import("./grammar/gdshader.mjs");case"genie":return import("./grammar/genie.mjs");case"gherkin":return import("./grammar/gherkin.mjs");case"git-commit":return import("./grammar/git-commit.mjs");case"git-rebase":return import("./grammar/git-rebase.mjs");case"gleam":return import("./grammar/gleam.mjs");case"glimmer-js":return import("./grammar/glimmer-js.mjs");case"glimmer-ts":return import("./grammar/glimmer-ts.mjs");case"glsl":return import("./grammar/glsl.mjs");case"gnuplot":return import("./grammar/gnuplot.mjs");case"go":return import("./grammar/go.mjs");case"graphql":return import("./grammar/graphql.mjs");case"groovy":return import("./grammar/groovy.mjs");case"hack":return import("./grammar/hack.mjs");case"haml":return import("./grammar/haml.mjs");case"handlebars":return import("./grammar/handlebars.mjs");case"haskell":return import("./grammar/haskell.mjs");case"haxe":return import("./grammar/haxe.mjs");case"hcl":return import("./grammar/hcl.mjs");case"hjson":return import("./grammar/hjson.mjs");case"hlsl":return import("./grammar/hlsl.mjs");case"html":return import("./grammar/html.mjs");case"html-derivative":return import("./grammar/html-derivative.mjs");case"http":return import("./grammar/http.mjs");case"hxml":return import("./grammar/hxml.mjs");case"hy":return import("./grammar/hy.mjs");case"imba":return import("./grammar/imba.mjs");case"ini":return import("./grammar/ini.mjs");case"java":return import("./grammar/java.mjs");case"javascript":return import("./grammar/javascript.mjs");case"jinja":return import("./grammar/jinja.mjs");case"jison":return import("./grammar/jison.mjs");case"json":return import("./grammar/json.mjs");case"json5":return import("./grammar/json5.mjs");case"jsonc":return import("./grammar/jsonc.mjs");case"jsonl":return import("./grammar/jsonl.mjs");case"jsonnet":return import("./grammar/jsonnet.mjs");case"jssm":return import("./grammar/jssm.mjs");case"jsx":return import("./grammar/jsx.mjs");case"julia":return import("./grammar/julia.mjs");case"kotlin":return import("./grammar/kotlin.mjs");case"kusto":return import("./grammar/kusto.mjs");case"latex":return import("./grammar/latex.mjs");case"lean":return import("./grammar/lean.mjs");case"less":return import("./grammar/less.mjs");case"liquid":return import("./grammar/liquid.mjs");case"log":return import("./grammar/log.mjs");case"logo":return import("./grammar/logo.mjs");case"lua":return import("./grammar/lua.mjs");case"luau":return import("./grammar/luau.mjs");case"make":return import("./grammar/make.mjs");case"markdown":return import("./grammar/markdown.mjs");case"marko":return import("./grammar/marko.mjs");case"matlab":return import("./grammar/matlab.mjs");case"mdc":return import("./grammar/mdc.mjs");case"mdx":return import("./grammar/mdx.mjs");case"mermaid":return import("./grammar/mermaid.mjs");case"mojo":return import("./grammar/mojo.mjs");case"move":return import("./grammar/move.mjs");case"narrat":return import("./grammar/narrat.mjs");case"nextflow":return import("./grammar/nextflow.mjs");case"nginx":return import("./grammar/nginx.mjs");case"nim":return import("./grammar/nim.mjs");case"nix":return import("./grammar/nix.mjs");case"nushell":return import("./grammar/nushell.mjs");case"objective-c":return import("./grammar/objective-c.mjs");case"objective-cpp":return import("./grammar/objective-cpp.mjs");case"ocaml":return import("./grammar/ocaml.mjs");case"pascal":return import("./grammar/pascal.mjs");case"perl":return import("./grammar/perl.mjs");case"php":return import("./grammar/php.mjs");case"plsql":return import("./grammar/plsql.mjs");case"po":return import("./grammar/po.mjs");case"postcss":return import("./grammar/postcss.mjs");case"powerquery":return import("./grammar/powerquery.mjs");case"powershell":return import("./grammar/powershell.mjs");case"prisma":return import("./grammar/prisma.mjs");case"prolog":return import("./grammar/prolog.mjs");case"proto":return import("./grammar/proto.mjs");case"pug":return import("./grammar/pug.mjs");case"puppet":return import("./grammar/puppet.mjs");case"purescript":return import("./grammar/purescript.mjs");case"python":return import("./grammar/python.mjs");case"qml":return import("./grammar/qml.mjs");case"qmldir":return import("./grammar/qmldir.mjs");case"qss":return import("./grammar/qss.mjs");case"r":return import("./grammar/r.mjs");case"racket":return import("./grammar/racket.mjs");case"raku":return import("./grammar/raku.mjs");case"razor":return import("./grammar/razor.mjs");case"reg":return import("./grammar/reg.mjs");case"regexp":return import("./grammar/regexp.mjs");case"rel":return import("./grammar/rel.mjs");case"riscv":return import("./grammar/riscv.mjs");case"rst":return import("./grammar/rst.mjs");case"ruby":return import("./grammar/ruby.mjs");case"rust":return import("./grammar/rust.mjs");case"sas":return import("./grammar/sas.mjs");case"sass":return import("./grammar/sass.mjs");case"scala":return import("./grammar/scala.mjs");case"scheme":return import("./grammar/scheme.mjs");case"scss":return import("./grammar/scss.mjs");case"shaderlab":return import("./grammar/shaderlab.mjs");case"shellscript":return import("./grammar/shellscript.mjs");case"shellsession":return import("./grammar/shellsession.mjs");case"smalltalk":return import("./grammar/smalltalk.mjs");case"solidity":return import("./grammar/solidity.mjs");case"soy":return import("./grammar/soy.mjs");case"sparql":return import("./grammar/sparql.mjs");case"splunk":return import("./grammar/splunk.mjs");case"sql":return import("./grammar/sql.mjs");case"ssh-config":return import("./grammar/ssh-config.mjs");case"stata":return import("./grammar/stata.mjs");case"stylus":return import("./grammar/stylus.mjs");case"svelte":return import("./grammar/svelte.mjs");case"swift":return import("./grammar/swift.mjs");case"system-verilog":return import("./grammar/system-verilog.mjs");case"systemd":return import("./grammar/systemd.mjs");case"tasl":return import("./grammar/tasl.mjs");case"tcl":return import("./grammar/tcl.mjs");case"templ":return import("./grammar/templ.mjs");case"terraform":return import("./grammar/terraform.mjs");case"tex":return import("./grammar/tex.mjs");case"toml":return import("./grammar/toml.mjs");case"ts-tags":return import("./grammar/ts-tags.mjs");case"tsv":return import("./grammar/tsv.mjs");case"tsx":return import("./grammar/tsx.mjs");case"turtle":return import("./grammar/turtle.mjs");case"twig":return import("./grammar/twig.mjs");case"txt":return import("./grammar/txt.mjs");case"typescript":return import("./grammar/typescript.mjs");case"typespec":return import("./grammar/typespec.mjs");case"typst":return import("./grammar/typst.mjs");case"v":return import("./grammar/v.mjs");case"vala":return import("./grammar/vala.mjs");case"vb":return import("./grammar/vb.mjs");case"verilog":return import("./grammar/verilog.mjs");case"vhdl":return import("./grammar/vhdl.mjs");case"viml":return import("./grammar/viml.mjs");case"vue":return import("./grammar/vue.mjs");case"vue-html":return import("./grammar/vue-html.mjs");case"vyper":return import("./grammar/vyper.mjs");case"wasm":return import("./grammar/wasm.mjs");case"wenyan":return import("./grammar/wenyan.mjs");case"wgsl":return import("./grammar/wgsl.mjs");case"wikitext":return import("./grammar/wikitext.mjs");case"wolfram":return import("./grammar/wolfram.mjs");case"xml":return import("./grammar/xml.mjs");case"xsl":return import("./grammar/xsl.mjs");case"yaml":return import("./grammar/yaml.mjs");case"zenscript":return import("./grammar/zenscript.mjs");case"zig":return import("./grammar/zig.mjs");default:throw new Error("no grammar for "+A)}}(A)}async function B(A){return async function(A){switch(A){case"dark-plus":return import("./theme/dark-plus.mjs");case"dracula-soft":return import("./theme/dracula-soft.mjs");case"dracula":return import("./theme/dracula.mjs");case"github-dark-dimmed":return import("./theme/github-dark-dimmed.mjs");case"github-dark":return import("./theme/github-dark.mjs");case"github-from-css":return import("./theme/github-from-css.mjs");case"github-light":return import("./theme/github-light.mjs");case"light-plus":return import("./theme/light-plus.mjs");case"material-darker":return import("./theme/material-darker.mjs");case"material-default":return import("./theme/material-default.mjs");case"material-from-css":return import("./theme/material-from-css.mjs");case"material-lighter":return import("./theme/material-lighter.mjs");case"material-ocean":return import("./theme/material-ocean.mjs");case"material-palenight":return import("./theme/material-palenight.mjs");case"min-dark":return import("./theme/min-dark.mjs");case"min-light":return import("./theme/min-light.mjs");case"monokai":return import("./theme/monokai.mjs");case"nord":return import("./theme/nord.mjs");case"one-dark-pro":return import("./theme/one-dark-pro.mjs");case"poimandres":return import("./theme/poimandres.mjs");case"rose-pine-dawn":return import("./theme/rose-pine-dawn.mjs");case"rose-pine-moon":return import("./theme/rose-pine-moon.mjs");case"rose-pine":return import("./theme/rose-pine.mjs");case"slack-dark":return import("./theme/slack-dark.mjs");case"slack-ochin":return import("./theme/slack-ochin.mjs");case"solarized-dark":return import("./theme/solarized-dark.mjs");case"solarized-light":return import("./theme/solarized-light.mjs");default:throw new Error("no theme for "+A)}}(A)}async function Q(A){if(console.warn(`Code Hike warning: Fetching resource from network "${A}"`),"function"==typeof fetch){const B=await fetch(`https://lighter.codehike.org/${A}.json`);return await B.json()}const B=await import("https"),Q={host:"lighter.codehike.org",path:`/${A}.json`,method:"GET"};return new Promise(((A,g)=>{const E=B.request(Q,(B=>{let Q="";B.on("data",(A=>{Q+=A})),B.on("end",(()=>{A(JSON.parse(Q))}))}));E.on("error",(A=>{g(A)})),E.end()}))}const g=A=>/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(A),E=(A,B)=>A.match(new RegExp(`.{${B}}`,"g")),C=A=>parseInt(A.repeat(2/A.length),16);function I(A,B){return void 0!==A?A/255:"number"!=typeof B||B<0||B>1?1:B}function D(A,B){if(!A)return A;const{r:Q,g:D,b:w,a:o}=function(A){if(!A)return;if(!g(A))throw new Error("Invalid color string, must be a valid hex color");const B=Math.floor((A.length-1)/3),Q=E(A.slice(1),B),[D,w,o,s]=Q.map(C);return{r:D,g:w,b:o,a:I(s,1)}}(A);return function(A){if(!A)return;const{r:B,g:Q,b:g,a:E}=A,C=Math.round(255*E);return`#${B.toString(16).padStart(2,"0")}${Q.toString(16).padStart(2,"0")}${g.toString(16).padStart(2,"0")}${C.toString(16).padStart(2,"0")}`}({r:Q,g:D,b:w,a:o*B})}function w(A){return"from-css"===A.type?"var(--ch-0)":A.type}function o(A,B){const Q=A.colors||{};if(Q[B])return Q[B];const g=e[B];if(!g)throw new Error(`Unknown theme color key: ${B}`);return"string"==typeof g?o(A,g):function(A,B){const Q=B[A.type];if(Array.isArray(Q)){const[B,g,...E]=Q;return B(o(A,g),...E)}return Q}(A,g)}const s="#6FC3DF",e={"editor.foreground":{dark:"#bbbbbb",light:"#333333",hc:"#ffffff"},"editorLineNumber.foreground":{dark:"#858585",light:"#237893",hc:"#fffffe"},"editor.selectionBackground":{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},"editor.background":{light:"#fffffe",dark:"#1E1E1E",hc:"#000000"},"editorGroupHeader.tabsBackground":{dark:"#252526",light:"#F3F3F3"},"tab.activeBackground":"editor.background","tab.activeForeground":{dark:"#ffffff",light:"#333333",hc:"#ffffff"},"tab.border":{dark:"#252526",light:"#F3F3F3",hc:s},"tab.activeBorder":"tab.activeBackground","tab.inactiveBackground":{dark:"#2D2D2D",light:"#ECECEC"},"tab.inactiveForeground":{dark:[D,"tab.activeForeground",.5],light:[D,"tab.activeForeground",.5],hc:"#ffffff"},"diffEditor.insertedTextBackground":{dark:"#9ccc2c33",light:"#9ccc2c40"},"diffEditor.removedTextBackground":{dark:"#ff000033",light:"#ff000033"},"diffEditor.insertedLineBackground":{dark:"#9bb95533",light:"#9bb95533"},"diffEditor.removedLineBackground":{dark:"#ff000033",light:"#ff000033"},"icon.foreground":{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},"sideBar.background":{dark:"#252526",light:"#F3F3F3",hc:"#000000"},"sideBar.foreground":"editor.foreground","sideBar.border":"sideBar.background","list.inactiveSelectionBackground":{dark:"#37373D",light:"#E4E6F1"},"list.inactiveSelectionForeground":{},"list.hoverBackground":{dark:"#2A2D2E",light:"#F0F0F0"},"list.hoverForeground":{},"editorGroupHeader.tabsBorder":{hc:s},"tab.activeBorderTop":{hc:s},"tab.hoverBackground":"tab.inactiveBackground","tab.hoverForeground":"tab.inactiveForeground","editor.rangeHighlightBackground":{dark:"#ffffff0b",light:"#fdff0033"},"editor.infoForeground":{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},"input.border":{hc:s},"input.background":{dark:"#3C3C3C",light:"#fffffe",hc:"#000000"},"input.foreground":"editor.foreground","editor.lineHighlightBackground":{},focusBorder:{light:"#0090F1",dark:"#007FD4",hc:s},"editorGroup.border":{dark:"#444444",light:"#E7E7E7",hc:s},"list.activeSelectionBackground":{dark:"#094771",light:"#0060C0",hc:"#000000"},"list.activeSelectionForeground":{dark:"#fffffe",light:"#fffffe",hc:"#fffffe"},"lighter.inlineBackground":{dark:[D,"editor.background",.9],light:[D,"editor.background",.9]},"terminal.background":"editor.background","terminal.foreground":"editor.foreground","terminal.ansiBlack":{dark:"#000000",light:"#000000",hc:"#000000"},"terminal.ansiRed":{dark:"#cd3131",light:"#cd3131",hc:"#cd0000"},"terminal.ansiGreen":{dark:"#0DBC79",light:"#00BC00",hc:"#00cd00"},"terminal.ansiYellow":{dark:"#e5e510",light:"#949800",hc:"#cdcd00"},"terminal.ansiBlue":{dark:"#2472c8",light:"#0451a5",hc:"#0000ee"},"terminal.ansiMagenta":{dark:"#bc3fbc",light:"#bc05bc",hc:"#cd00cd"},"terminal.ansiCyan":{dark:"#11a8cd",light:"#0598bc",hc:"#00cdcd"},"terminal.ansiWhite":{dark:"#e5e5e5",light:"#555555",hc:"#e5e5e5"},"terminal.ansiBrightBlack":{dark:"#666666",light:"#666666",hc:"#7f7f7f"},"terminal.ansiBrightRed":{dark:"#f14c4c",light:"#cd3131",hc:"#ff0000"},"terminal.ansiBrightGreen":{dark:"#23d18b",light:"#14CE14",hc:"#00ff00"},"terminal.ansiBrightYellow":{dark:"#f5f543",light:"#b5ba00",hc:"#ffff00"},"terminal.ansiBrightBlue":{dark:"#3b8eea",light:"#0451a5",hc:"#5c5cff"},"terminal.ansiBrightMagenta":{dark:"#d670d6",light:"#bc05bc",hc:"#ff00ff"},"terminal.ansiBrightCyan":{dark:"#29b8db",light:"#0598bc",hc:"#00ffff"},"terminal.ansiBrightWhite":{dark:"#e5e5e5",light:"#a5a5a5",hc:"#ffffff"}},c=new Map,i=new Map;async function t(A){if("string"==typeof A){const g=A;if(!M.includes(g))throw new h(g);if(!c.has(g)){const A=async function(A){try{return await B(A)}catch(B){return await Q(`themes/${A}`)}}(g).then((A=>(i.set(g,A),A)));c.set(g,A)}return c.get(g)}return A}function r(A){let B=null;if("string"==typeof A){if(B=i.get(A),!B)throw new Error("Syntax highlighting error: theme not loaded")}else B=A;return function(A){if(!A)return;const B=A.settings||A.tokenColors||[],Q={name:A.name||"unknown-theme",type:a(A),foreground:"",background:"",settings:B,colors:A.colors||{},colorNames:A.colorNames},g=B.find((A=>!A.scope));if(g){const{foreground:A,background:B}=(null==g?void 0:g.settings)||{},E={};A&&!Q.colors["editor.foreground"]&&(E["editor.foreground"]=A),B&&!Q.colors["editor.background"]&&(E["editor.background"]=B),Object.keys(E).length>0&&(Q.colors=Object.assign(Object.assign({},Q.colors),E)),Q.foreground=A,Q.background=B}g||(Q.settings=[{settings:{foreground:o(Q,"editor.foreground"),background:o(Q,"editor.background")}},...Q.settings]);if(Q.background=Q.background||o(Q,"editor.background"),Q.foreground=Q.foreground||o(Q,"editor.foreground"),"from-css"===A.type&&!Q.colorNames){const A={};let B=0;Q.settings=Q.settings.map((Q=>{const g=Object.assign(Object.assign({},Q),{settings:Object.assign({},Q.settings)}),{foreground:E,background:C}=g.settings||{};return E&&!A[E]&&(A[E]=`#${B.toString(16).padStart(6,"0")}`,B++),C&&!A[C]&&(A[C]=`#${B.toString(16).padStart(6,"0")}`,B++),E&&(g.settings.foreground=A[E]),C&&(g.settings.background=A[C]),g})),Q.colorNames=A}return Q}(B)}function a(A){var B;if("from-css"===A.type)return"from-css";return"light"===(A.type?A.type:(null===(B=A.name)||void 0===B?void 0:B.toLowerCase().includes("light"))?"light":"dark")?"light":"dark"}const M=["dark-plus","dracula-soft","dracula","github-dark","github-dark-dimmed","github-from-css","github-light","light-plus","material-darker","material-default","material-from-css","material-lighter","material-ocean","material-palenight","min-dark","min-light","monokai","nord","one-dark-pro","poimandres","slack-dark","slack-ochin","solarized-dark","solarized-light"];class h extends Error{constructor(A){super(`Unknown theme: ${A}`),this.theme=A}}function n(A){const B=B=>"colorScheme"===B?w(A):"foreground"===B?A.foreground:"background"===B?A.background:o(A,B);return{colorScheme:B("colorScheme"),foreground:B("foreground"),background:B("background"),lighter:{inlineBackground:B("lighter.inlineBackground")},editor:{background:B("editor.background"),foreground:B("editor.foreground"),lineHighlightBackground:B("editor.lineHighlightBackground"),rangeHighlightBackground:B("editor.rangeHighlightBackground"),infoForeground:B("editor.infoForeground"),selectionBackground:B("editor.selectionBackground")},focusBorder:B("focusBorder"),tab:{activeBackground:B("tab.activeBackground"),activeForeground:B("tab.activeForeground"),inactiveBackground:B("tab.inactiveBackground"),inactiveForeground:B("tab.inactiveForeground"),border:B("tab.border"),activeBorder:B("tab.activeBorder"),activeBorderTop:B("tab.activeBorderTop")},editorGroup:{border:B("editorGroup.border")},editorGroupHeader:{tabsBackground:B("editorGroupHeader.tabsBackground")},editorLineNumber:{foreground:B("editorLineNumber.foreground")},input:{background:B("input.background"),foreground:B("input.foreground"),border:B("input.border")},icon:{foreground:B("icon.foreground")},sideBar:{background:B("sideBar.background"),foreground:B("sideBar.foreground"),border:B("sideBar.border")},list:{activeSelectionBackground:B("list.activeSelectionBackground"),activeSelectionForeground:B("list.activeSelectionForeground"),hoverBackground:B("list.hoverBackground"),hoverForeground:B("list.hoverForeground")}}}const F=["abap","actionscript-3","ada","adoc","angular-html","angular-ts","apache","apex","apl","applescript","ara","asciidoc","asm","astro","awk","ballerina","bash","bat","batch","be","beancount","berry","bibtex","bicep","blade","c","c#","c++","cadence","cdc","clarity","clj","clojure","closure-templates","cmake","cmd","cobol","codeowners","codeql","coffee","coffeescript","common-lisp","console","cpp","cql","crystal","cs","csharp","css","csv","cue","cypher","d","dart","dax","desktop","diff","docker","dockerfile","dotenv","dream-maker","edge","elisp","elixir","elm","emacs-lisp","erb","erl","erlang","f","f#","f03","f08","f18","f77","f90","f95","fennel","fish","fluent","for","fortran-fixed-form","fortran-free-form","fs","fsharp","fsl","ftl","gdresource","gdscript","gdshader","genie","gherkin","git-commit","git-rebase","gjs","gleam","glimmer-js","glimmer-ts","glsl","gnuplot","go","gql","graphql","groovy","gts","hack","haml","handlebars","haskell","haxe","hbs","hcl","hjson","hlsl","hs","html","html-derivative","http","hxml","hy","imba","ini","jade","java","javascript","jinja","jison","jl","js","json","json5","jsonc","jsonl","jsonnet","jssm","jsx","julia","kotlin","kql","kt","kts","kusto","latex","lean","lean4","less","liquid","lisp","lit","log","logo","lua","luau","make","makefile","markdown","marko","matlab","md","mdc","mdx","mediawiki","mermaid","mojo","move","nar","narrat","nextflow","nf","nginx","nim","nix","nu","nushell","objc","objective-c","objective-cpp","ocaml","pascal","perl","perl6","php","plsql","po","postcss","pot","potx","powerquery","powershell","prisma","prolog","properties","proto","ps","ps1","pug","puppet","purescript","py","python","ql","qml","qmldir","qss","r","racket","raku","razor","rb","reg","regex","regexp","rel","riscv","rs","rst","ruby","rust","sas","sass","scala","scheme","scss","sh","shader","shaderlab","shell","shellscript","shellsession","smalltalk","solidity","soy","sparql","spl","splunk","sql","ssh-config","stata","styl","stylus","svelte","swift","system-verilog","systemd","tasl","tcl","templ","terminal","terraform","tex","text","tf","tfvars","toml","ts","ts-tags","tsp","tsv","tsx","turtle","twig","txt","typ","typescript","typespec","typst","v","vala","vb","verilog","vhdl","vim","viml","vimscript","vue","vue-html","vy","vyper","wasm","wenyan","wgsl","wiki","wikitext","wl","wolfram","xml","xsl","yaml","yml","zenscript","zig","zsh","文言"],G={abap:"source.abap","actionscript-3":"source.actionscript.3",ada:"source.ada","angular-html":"text.html.derivative.ng","angular-ts":"source.ts.ng",apache:"source.apacheconf",apex:"source.apex",apl:"source.apl",applescript:"source.applescript",ara:"source.ara",asciidoc:"text.asciidoc",adoc:"text.asciidoc",asm:"source.asm.x86_64",astro:"source.astro",awk:"source.awk",ballerina:"source.ballerina",bat:"source.batchfile",batch:"source.batchfile",beancount:"text.beancount",berry:"source.berry",be:"source.berry",bibtex:"text.bibtex",bicep:"source.bicep",blade:"text.html.php.blade",c:"source.c",cadence:"source.cadence",cdc:"source.cadence",clarity:"source.clar",clojure:"source.clojure",clj:"source.clojure",cmake:"source.cmake",cobol:"source.cobol",codeowners:"text.codeowners",codeql:"source.ql",ql:"source.ql",coffee:"source.coffee",coffeescript:"source.coffee","common-lisp":"source.commonlisp",lisp:"source.commonlisp",cpp:"source.cpp","c++":"source.cpp",crystal:"source.crystal",csharp:"source.cs","c#":"source.cs",cs:"source.cs",css:"source.css",csv:"text.csv",cue:"source.cue",cypher:"source.cypher",cql:"source.cypher",d:"source.d",dart:"source.dart",dax:"source.dax",desktop:"source.desktop",diff:"source.diff",docker:"source.dockerfile",dockerfile:"source.dockerfile",dotenv:"source.dotenv","dream-maker":"source.dm",edge:"text.html.edge",elixir:"source.elixir",elm:"source.elm","emacs-lisp":"source.emacs.lisp",elisp:"source.emacs.lisp",erb:"text.html.erb",erlang:"source.erlang",erl:"source.erlang",fennel:"source.fnl",fish:"source.fish",fluent:"source.ftl",ftl:"source.ftl","fortran-fixed-form":"source.fortran.fixed",f:"source.fortran.fixed",for:"source.fortran.fixed",f77:"source.fortran.fixed","fortran-free-form":"source.fortran.free",f90:"source.fortran.free",f95:"source.fortran.free",f03:"source.fortran.free",f08:"source.fortran.free",f18:"source.fortran.free",fsharp:"source.fsharp","f#":"source.fsharp",fs:"source.fsharp",gdresource:"source.gdresource",gdscript:"source.gdscript",gdshader:"source.gdshader",genie:"source.genie",gherkin:"text.gherkin.feature","git-commit":"text.git-commit","git-rebase":"text.git-rebase",gleam:"source.gleam","glimmer-js":"source.gjs",gjs:"source.gjs","glimmer-ts":"source.gts",gts:"source.gts",glsl:"source.glsl",gnuplot:"source.gnuplot",go:"source.go",graphql:"source.graphql",gql:"source.graphql",groovy:"source.groovy",hack:"source.hack",haml:"text.haml",handlebars:"text.html.handlebars",hbs:"text.html.handlebars",haskell:"source.haskell",hs:"source.haskell",haxe:"source.hx",hcl:"source.hcl",hjson:"source.hjson",hlsl:"source.hlsl",html:"text.html.basic","html-derivative":"text.html.derivative",http:"source.http",hxml:"source.hxml",hy:"source.hy",imba:"source.imba",ini:"source.ini",properties:"source.ini",java:"source.java",javascript:"source.js",js:"source.js",jinja:"source.jinja",jison:"source.jison",json:"source.json",json5:"source.json5",jsonc:"source.json.comments",jsonl:"source.json.lines",jsonnet:"source.jsonnet",jssm:"source.jssm",fsl:"source.jssm",jsx:"source.js.jsx",julia:"source.julia",jl:"source.julia",kotlin:"source.kotlin",kt:"source.kotlin",kts:"source.kotlin",kusto:"source.kusto",kql:"source.kusto",latex:"text.tex.latex",lean:"source.lean4",lean4:"source.lean4",less:"source.css.less",liquid:"text.html.liquid",log:"text.log",logo:"source.logo",lua:"source.lua",luau:"source.luau",make:"source.makefile",makefile:"source.makefile",markdown:"text.html.markdown",md:"text.html.markdown",marko:"text.marko",matlab:"source.matlab",mdc:"text.markdown.mdc",mdx:"source.mdx",mermaid:"markdown.mermaid.codeblock",mojo:"source.mojo",move:"source.move",narrat:"source.narrat",nar:"source.narrat",nextflow:"source.nextflow",nf:"source.nextflow",nginx:"source.nginx",nim:"source.nim",nix:"source.nix",nushell:"source.nushell",nu:"source.nushell","objective-c":"source.objc",objc:"source.objc","objective-cpp":"source.objcpp",ocaml:"source.ocaml",pascal:"source.pascal",perl:"source.perl",php:"source.php",plsql:"source.plsql.oracle",po:"source.po",pot:"source.po",potx:"source.po",postcss:"source.css.postcss",powerquery:"source.powerquery",powershell:"source.powershell",ps:"source.powershell",ps1:"source.powershell",prisma:"source.prisma",prolog:"source.prolog",proto:"source.proto",pug:"text.pug",jade:"text.pug",puppet:"source.puppet",purescript:"source.purescript",python:"source.python",py:"source.python",qml:"source.qml",qmldir:"source.qmldir",qss:"source.qss",r:"source.r",racket:"source.racket",raku:"source.perl.6",perl6:"source.perl.6",razor:"text.aspnetcorerazor",reg:"source.reg",regexp:"source.regexp.python",regex:"source.regexp.python",rel:"source.rel",riscv:"source.riscv",rst:"source.rst",ruby:"source.ruby",rb:"source.ruby",rust:"source.rust",rs:"source.rust",sas:"source.sas",sass:"source.sass",scala:"source.scala",scheme:"source.scheme",scss:"source.css.scss",shaderlab:"source.shaderlab",shader:"source.shaderlab",shellscript:"source.shell",bash:"source.shell",sh:"source.shell",shell:"source.shell",zsh:"source.shell",shellsession:"text.shell-session",console:"text.shell-session",smalltalk:"source.smalltalk",solidity:"source.solidity",soy:"text.html.soy","closure-templates":"text.html.soy",sparql:"source.sparql",splunk:"source.splunk_search",spl:"source.splunk_search",sql:"source.sql","ssh-config":"source.ssh-config",stata:"source.stata",stylus:"source.stylus",styl:"source.stylus",svelte:"source.svelte",swift:"source.swift","system-verilog":"source.systemverilog",systemd:"source.systemd",tasl:"source.tasl",tcl:"source.tcl",templ:"source.templ",terraform:"source.hcl.terraform",tf:"source.hcl.terraform",tfvars:"source.hcl.terraform",tex:"text.tex",toml:"source.toml","ts-tags":"source.ts.tags",lit:"source.ts.tags",tsv:"text.tsv",tsx:"source.tsx",turtle:"source.turtle",twig:"text.html.twig",txt:"source.txt",typescript:"source.ts",ts:"source.ts",typespec:"source.tsp",tsp:"source.tsp",typst:"source.typst",typ:"source.typst",v:"source.v",vala:"source.vala",vb:"source.asp.vb.net",cmd:"source.asp.vb.net",verilog:"source.verilog",vhdl:"source.vhdl",viml:"source.viml",vim:"source.viml",vimscript:"source.viml",vue:"source.vue","vue-html":"text.html.vue-html",vyper:"source.vyper",vy:"source.vyper",wasm:"source.wat",wenyan:"source.wenyan","文言":"source.wenyan",wgsl:"source.wgsl",wikitext:"source.wikitext",mediawiki:"source.wikitext",wiki:"source.wikitext",wolfram:"source.wolfram",wl:"source.wolfram",xml:"text.xml",xsl:"text.xml.xsl",yaml:"source.yaml",yml:"source.yaml",zenscript:"source.zenscript",zig:"source.zig"},N={"source.abap":{id:"abap",embeddedScopes:[]},"source.actionscript.3":{id:"actionscript-3",embeddedScopes:[]},"source.ada":{id:"ada",embeddedScopes:[]},"text.html.derivative.ng":{id:"angular-html",embeddedScopes:["text.html.basic"]},"source.ts.ng":{id:"angular-ts",embeddedScopes:[]},"source.apacheconf":{id:"apache",embeddedScopes:[]},"source.apex":{id:"apex",embeddedScopes:[]},"source.apl":{id:"apl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.json"]},"source.applescript":{id:"applescript",embeddedScopes:[]},"source.ara":{id:"ara",embeddedScopes:[]},"text.asciidoc":{id:"asciidoc",embeddedScopes:["text.html.basic","source.yaml","text.csv","source.c","source.clojure","source.coffee","source.cpp","source.css","source.cs","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.groovy","source.haskell","source.java","source.js","source.json","source.js.jsx","source.julia","source.kotlin","source.css.less","source.makefile","source.objc","source.ocaml","source.perl","source.python","source.r","source.ruby","source.rust","source.sass","source.scala","source.css.scss","source.shell","source.sql","source.swift","source.toml","source.ts","text.xml"]},"source.asm.x86_64":{id:"asm",embeddedScopes:[]},"source.astro":{id:"astro",embeddedScopes:["source.json","source.js","source.ts","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","source.tsx"]},"source.awk":{id:"awk",embeddedScopes:[]},"source.ballerina":{id:"ballerina",embeddedScopes:[]},"source.batchfile":{id:"bat",embeddedScopes:[]},"text.beancount":{id:"beancount",embeddedScopes:[]},"source.berry":{id:"berry",embeddedScopes:[]},"text.bibtex":{id:"bibtex",embeddedScopes:[]},"source.bicep":{id:"bicep",embeddedScopes:[]},"text.html.php.blade":{id:"blade",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.c":{id:"c",embeddedScopes:[]},"source.cadence":{id:"cadence",embeddedScopes:[]},"source.clar":{id:"clarity",embeddedScopes:[]},"source.clojure":{id:"clojure",embeddedScopes:[]},"source.cmake":{id:"cmake",embeddedScopes:[]},"source.cobol":{id:"cobol",embeddedScopes:["source.sql","text.html.basic","source.java"]},"text.codeowners":{id:"codeowners",embeddedScopes:[]},"source.ql":{id:"codeql",embeddedScopes:[]},"source.coffee":{id:"coffee",embeddedScopes:["source.js"]},"source.commonlisp":{id:"common-lisp",embeddedScopes:[]},"source.cpp":{id:"cpp",embeddedScopes:["source.regexp.python","source.glsl","source.sql"]},"source.crystal":{id:"crystal",embeddedScopes:["text.html.basic","source.sql","source.css","source.c","source.js","source.shell"]},"source.cs":{id:"csharp",embeddedScopes:[]},"source.css":{id:"css",embeddedScopes:[]},"text.csv":{id:"csv",embeddedScopes:[]},"source.cue":{id:"cue",embeddedScopes:[]},"source.cypher":{id:"cypher",embeddedScopes:[]},"source.d":{id:"d",embeddedScopes:[]},"source.dart":{id:"dart",embeddedScopes:[]},"source.dax":{id:"dax",embeddedScopes:[]},"source.desktop":{id:"desktop",embeddedScopes:[]},"source.diff":{id:"diff",embeddedScopes:[]},"source.dockerfile":{id:"docker",embeddedScopes:[]},"source.dotenv":{id:"dotenv",embeddedScopes:[]},"source.dm":{id:"dream-maker",embeddedScopes:[]},"text.html.edge":{id:"edge",embeddedScopes:["source.ts","text.html.basic","text.html.derivative"]},"source.elixir":{id:"elixir",embeddedScopes:["text.html.basic"]},"source.elm":{id:"elm",embeddedScopes:["source.glsl"]},"source.emacs.lisp":{id:"emacs-lisp",embeddedScopes:[]},"text.html.erb":{id:"erb",embeddedScopes:["text.html.basic","source.ruby"]},"source.erlang":{id:"erlang",embeddedScopes:[]},"source.fnl":{id:"fennel",embeddedScopes:[]},"source.fish":{id:"fish",embeddedScopes:[]},"source.ftl":{id:"fluent",embeddedScopes:[]},"source.fortran.fixed":{id:"fortran-fixed-form",embeddedScopes:["source.fortran.free"]},"source.fortran.free":{id:"fortran-free-form",embeddedScopes:[]},"source.fsharp":{id:"fsharp",embeddedScopes:["text.html.markdown"]},"source.gdresource":{id:"gdresource",embeddedScopes:["source.gdshader","source.gdscript"]},"source.gdscript":{id:"gdscript",embeddedScopes:[]},"source.gdshader":{id:"gdshader",embeddedScopes:[]},"source.genie":{id:"genie",embeddedScopes:[]},"text.gherkin.feature":{id:"gherkin",embeddedScopes:[]},"text.git-commit":{id:"git-commit",embeddedScopes:["source.diff"]},"text.git-rebase":{id:"git-rebase",embeddedScopes:["source.shell"]},"source.gleam":{id:"gleam",embeddedScopes:[]},"source.gjs":{id:"glimmer-js",embeddedScopes:["source.js","source.ts","source.css","text.html.basic"]},"source.gts":{id:"glimmer-ts",embeddedScopes:["source.ts","source.css","source.js","text.html.basic"]},"source.glsl":{id:"glsl",embeddedScopes:["source.c"]},"source.gnuplot":{id:"gnuplot",embeddedScopes:[]},"source.go":{id:"go",embeddedScopes:[]},"source.graphql":{id:"graphql",embeddedScopes:["source.js","source.ts","source.js.jsx","source.tsx"]},"source.groovy":{id:"groovy",embeddedScopes:[]},"source.hack":{id:"hack",embeddedScopes:["text.html.basic","source.sql"]},"text.haml":{id:"haml",embeddedScopes:["source.ruby","source.js","source.sass","source.coffee","text.html.markdown","source.css"]},"text.html.handlebars":{id:"handlebars",embeddedScopes:["text.html.basic","source.css","source.js","source.yaml"]},"source.haskell":{id:"haskell",embeddedScopes:[]},"source.hx":{id:"haxe",embeddedScopes:[]},"source.hcl":{id:"hcl",embeddedScopes:[]},"source.hjson":{id:"hjson",embeddedScopes:[]},"source.hlsl":{id:"hlsl",embeddedScopes:[]},"text.html.basic":{id:"html",embeddedScopes:["source.js","source.css"]},"text.html.derivative":{id:"html-derivative",embeddedScopes:["text.html.basic"]},"source.http":{id:"http",embeddedScopes:["source.shell","source.json","text.xml","source.graphql"]},"source.hxml":{id:"hxml",embeddedScopes:["source.hx"]},"source.hy":{id:"hy",embeddedScopes:[]},"source.imba":{id:"imba",embeddedScopes:["source.ts"]},"source.ini":{id:"ini",embeddedScopes:[]},"source.java":{id:"java",embeddedScopes:[]},"source.js":{id:"javascript",embeddedScopes:[]},"source.jinja":{id:"jinja",embeddedScopes:[]},"source.jison":{id:"jison",embeddedScopes:["source.js"]},"source.json":{id:"json",embeddedScopes:[]},"source.json5":{id:"json5",embeddedScopes:[]},"source.json.comments":{id:"jsonc",embeddedScopes:[]},"source.json.lines":{id:"jsonl",embeddedScopes:[]},"source.jsonnet":{id:"jsonnet",embeddedScopes:[]},"source.jssm":{id:"jssm",embeddedScopes:[]},"source.js.jsx":{id:"jsx",embeddedScopes:[]},"source.julia":{id:"julia",embeddedScopes:["source.cpp","source.python","source.js","source.r","source.sql"]},"source.kotlin":{id:"kotlin",embeddedScopes:[]},"source.kusto":{id:"kusto",embeddedScopes:[]},"text.tex.latex":{id:"latex",embeddedScopes:["text.tex","source.shell","source.css","source.gnuplot","source.haskell","text.html.basic","source.java","source.julia","source.js","source.lua","source.python","source.ruby","source.rust","source.ts","text.xml","source.yaml","source.scala"]},"source.lean4":{id:"lean",embeddedScopes:[]},"source.css.less":{id:"less",embeddedScopes:[]},"text.html.liquid":{id:"liquid",embeddedScopes:["text.html.basic","source.css","source.json","source.js"]},"text.log":{id:"log",embeddedScopes:[]},"source.logo":{id:"logo",embeddedScopes:[]},"source.lua":{id:"lua",embeddedScopes:["source.c"]},"source.luau":{id:"luau",embeddedScopes:[]},"source.makefile":{id:"make",embeddedScopes:[]},"text.html.markdown":{id:"markdown",embeddedScopes:["source.css","text.html.basic","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","text.git-commit","text.git-rebase","source.go","source.groovy","text.pug","source.js","source.json","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.regexp.python","source.rust","source.scala","source.shell","source.ts","source.tsx","source.cs","source.fsharp","source.dart","text.html.handlebars","text.log","source.erlang","source.elixir","text.tex.latex","text.bibtex","text.html.derivative"]},"text.marko":{id:"marko",embeddedScopes:["source.css","source.css.less","source.css.scss","source.js"]},"source.matlab":{id:"matlab",embeddedScopes:[]},"text.markdown.mdc":{id:"mdc",embeddedScopes:["text.html.markdown","source.yaml","text.html.derivative"]},"source.mdx":{id:"mdx",embeddedScopes:["source.tsx","source.toml","source.yaml","source.c","source.clojure","source.coffee","source.cpp","source.cs","source.css","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.graphql","source.haskell","text.html.basic","source.ini","source.java","source.js","source.json","source.julia","source.kotlin","source.css.less","source.lua","source.makefile","text.html.markdown","source.objc","source.perl","source.python","source.r","source.ruby","source.rust","source.scala","source.css.scss","source.shell","text.shell-session","source.sql","text.xml","source.swift","source.ts"]},"markdown.mermaid.codeblock":{id:"mermaid",embeddedScopes:[]},"source.mojo":{id:"mojo",embeddedScopes:[]},"source.move":{id:"move",embeddedScopes:[]},"source.narrat":{id:"narrat",embeddedScopes:[]},"source.nextflow":{id:"nextflow",embeddedScopes:[]},"source.nginx":{id:"nginx",embeddedScopes:["source.lua"]},"source.nim":{id:"nim",embeddedScopes:["source.c","text.html.basic","text.xml","source.js","source.css","source.glsl","text.html.markdown"]},"source.nix":{id:"nix",embeddedScopes:[]},"source.nushell":{id:"nushell",embeddedScopes:[]},"source.objc":{id:"objective-c",embeddedScopes:[]},"source.objcpp":{id:"objective-cpp",embeddedScopes:[]},"source.ocaml":{id:"ocaml",embeddedScopes:[]},"source.pascal":{id:"pascal",embeddedScopes:[]},"source.perl":{id:"perl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.sql"]},"source.php":{id:"php",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.plsql.oracle":{id:"plsql",embeddedScopes:[]},"source.po":{id:"po",embeddedScopes:[]},"source.css.postcss":{id:"postcss",embeddedScopes:[]},"source.powerquery":{id:"powerquery",embeddedScopes:[]},"source.powershell":{id:"powershell",embeddedScopes:[]},"source.prisma":{id:"prisma",embeddedScopes:[]},"source.prolog":{id:"prolog",embeddedScopes:[]},"source.proto":{id:"proto",embeddedScopes:[]},"text.pug":{id:"pug",embeddedScopes:["source.js","source.css","source.sass","source.css.scss","source.stylus","source.coffee","text.html.basic"]},"source.puppet":{id:"puppet",embeddedScopes:[]},"source.purescript":{id:"purescript",embeddedScopes:[]},"source.python":{id:"python",embeddedScopes:[]},"source.qml":{id:"qml",embeddedScopes:["source.js"]},"source.qmldir":{id:"qmldir",embeddedScopes:[]},"source.qss":{id:"qss",embeddedScopes:[]},"source.r":{id:"r",embeddedScopes:[]},"source.racket":{id:"racket",embeddedScopes:[]},"source.perl.6":{id:"raku",embeddedScopes:[]},"text.aspnetcorerazor":{id:"razor",embeddedScopes:["text.html.basic","source.cs"]},"source.reg":{id:"reg",embeddedScopes:[]},"source.regexp.python":{id:"regexp",embeddedScopes:[]},"source.rel":{id:"rel",embeddedScopes:[]},"source.riscv":{id:"riscv",embeddedScopes:[]},"source.rst":{id:"rst",embeddedScopes:["text.html.derivative","source.cpp","source.python","source.js","source.shell","source.yaml","source.cmake","source.ruby"]},"source.ruby":{id:"ruby",embeddedScopes:["text.html.basic","text.xml","source.sql","source.css","source.c","source.js","source.shell","source.lua"]},"source.rust":{id:"rust",embeddedScopes:[]},"source.sas":{id:"sas",embeddedScopes:["source.sql"]},"source.sass":{id:"sass",embeddedScopes:[]},"source.scala":{id:"scala",embeddedScopes:[]},"source.scheme":{id:"scheme",embeddedScopes:[]},"source.css.scss":{id:"scss",embeddedScopes:["source.css"]},"source.shaderlab":{id:"shaderlab",embeddedScopes:["source.hlsl"]},"source.shell":{id:"shellscript",embeddedScopes:[]},"text.shell-session":{id:"shellsession",embeddedScopes:["source.shell"]},"source.smalltalk":{id:"smalltalk",embeddedScopes:[]},"source.solidity":{id:"solidity",embeddedScopes:[]},"text.html.soy":{id:"soy",embeddedScopes:["text.html.basic"]},"source.sparql":{id:"sparql",embeddedScopes:["source.turtle"]},"source.splunk_search":{id:"splunk",embeddedScopes:[]},"source.sql":{id:"sql",embeddedScopes:[]},"source.ssh-config":{id:"ssh-config",embeddedScopes:[]},"source.stata":{id:"stata",embeddedScopes:["source.sql"]},"source.stylus":{id:"stylus",embeddedScopes:[]},"source.svelte":{id:"svelte",embeddedScopes:["source.js","source.ts","source.coffee","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","text.pug","text.html.markdown"]},"source.swift":{id:"swift",embeddedScopes:[]},"source.systemverilog":{id:"system-verilog",embeddedScopes:[]},"source.systemd":{id:"systemd",embeddedScopes:[]},"source.tasl":{id:"tasl",embeddedScopes:[]},"source.tcl":{id:"tcl",embeddedScopes:[]},"source.templ":{id:"templ",embeddedScopes:["source.go","source.js","source.css"]},"source.hcl.terraform":{id:"terraform",embeddedScopes:[]},"text.tex":{id:"tex",embeddedScopes:["source.r"]},"source.toml":{id:"toml",embeddedScopes:[]},"source.ts.tags":{id:"ts-tags",embeddedScopes:["source.ts"]},"text.tsv":{id:"tsv",embeddedScopes:[]},"source.tsx":{id:"tsx",embeddedScopes:[]},"source.turtle":{id:"turtle",embeddedScopes:[]},"text.html.twig":{id:"twig",embeddedScopes:["source.css","source.js","source.css.scss","source.php","source.python","source.ruby"]},"source.txt":{id:"txt",embeddedScopes:[]},"source.ts":{id:"typescript",embeddedScopes:[]},"source.tsp":{id:"typespec",embeddedScopes:[]},"source.typst":{id:"typst",embeddedScopes:[]},"source.v":{id:"v",embeddedScopes:[]},"source.vala":{id:"vala",embeddedScopes:[]},"source.asp.vb.net":{id:"vb",embeddedScopes:[]},"source.verilog":{id:"verilog",embeddedScopes:[]},"source.vhdl":{id:"vhdl",embeddedScopes:[]},"source.viml":{id:"viml",embeddedScopes:[]},"source.vue":{id:"vue",embeddedScopes:["text.html.basic","text.html.markdown","text.pug","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.js","source.ts","source.js.jsx","source.tsx","source.coffee","source.json","source.json.comments","source.json5","source.yaml","source.toml","source.graphql","text.html.derivative"]},"text.html.vue-html":{id:"vue-html",embeddedScopes:["source.vue","source.js"]},"source.vyper":{id:"vyper",embeddedScopes:[]},"source.wat":{id:"wasm",embeddedScopes:[]},"source.wenyan":{id:"wenyan",embeddedScopes:[]},"source.wgsl":{id:"wgsl",embeddedScopes:[]},"source.wikitext":{id:"wikitext",embeddedScopes:["text.html.basic","source.css","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","source.go","source.groovy","text.pug","source.js","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.rust","source.scala","source.shell","source.ts","source.cs","source.fsharp","source.dart","text.html.handlebars","text.html.markdown","source.erlang","source.elixir","text.tex.latex","text.bibtex","source.json"]},"source.wolfram":{id:"wolfram",embeddedScopes:[]},"text.xml":{id:"xml",embeddedScopes:["source.java"]},"text.xml.xsl":{id:"xsl",embeddedScopes:["text.xml"]},"source.yaml":{id:"yaml",embeddedScopes:[]},"source.zenscript":{id:"zenscript",embeddedScopes:[]},"source.zig":{id:"zig",embeddedScopes:[]}};var H={d:(A,B)=>{for(var Q in B)H.o(B,Q)&&!H.o(A,Q)&&Object.defineProperty(A,Q,{enumerable:!0,get:B[Q]})},o:(A,B)=>Object.prototype.hasOwnProperty.call(A,B)},L={};H.d(L,{_X:()=>ZA,Bz:()=>XA,ot:()=>vA,u:()=>TA,jG:()=>U,Pn:()=>jA});const k="undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG;var R;function K(A,B){const Q=[],g=function(A){let B=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,Q=B.exec(A);return{next:()=>{if(!Q)return null;const g=Q[0];return Q=B.exec(A),g}}}(A);let E=g.next();for(;null!==E;){let A=0;if(2===E.length&&":"===E.charAt(1)){switch(E.charAt(0)){case"R":A=1;break;case"L":A=-1;break;default:console.log(`Unknown priority ${E} in scope selector`)}E=g.next()}let B=I();if(Q.push({matcher:B,priority:A}),","!==E)break;E=g.next()}return Q;function C(){if("-"===E){E=g.next();const A=C();return B=>!!A&&!A(B)}if("("===E){E=g.next();const A=function(){const A=[];let B=I();for(;B&&(A.push(B),"|"===E||","===E);){do{E=g.next()}while("|"===E||","===E);B=I()}return B=>A.some((A=>A(B)))}();return")"===E&&(E=g.next()),A}if(Y(E)){const A=[];do{A.push(E),E=g.next()}while(Y(E));return Q=>B(A,Q)}return null}function I(){const A=[];let B=C();for(;B;)A.push(B),B=C();return B=>A.every((A=>A(B)))}}function Y(A){return!!A&&!!A.match(/[\w\.:]+/)}function U(A){"function"==typeof A.dispose&&A.dispose()}function P(A){return Array.isArray(A)?function(A){let B=[];for(let Q=0,g=A.length;Q{for(let Q in B)A[Q]=B[Q]})),A}function y(A){const B=~A.lastIndexOf("/")||~A.lastIndexOf("\\");return 0===B?A:~B==A.length-1?y(A.substring(0,A.length-1)):A.substr(1+~B)}!function(A){A.toBinaryStr=function(A){let B=A.toString(2);for(;B.length<32;)B="0"+B;return B},A.print=function(B){const Q=A.getLanguageId(B),g=A.getTokenType(B),E=A.getFontStyle(B),C=A.getForeground(B),I=A.getBackground(B);console.log({languageId:Q,tokenType:g,fontStyle:E,foreground:C,background:I})},A.getLanguageId=function(A){return(255&A)>>>0},A.getTokenType=function(A){return(768&A)>>>8},A.containsBalancedBrackets=function(A){return 0!=(1024&A)},A.getFontStyle=function(A){return(30720&A)>>>11},A.getForeground=function(A){return(16744448&A)>>>15},A.getBackground=function(A){return(4278190080&A)>>>24},A.set=function(B,Q,g,E,C,I,D){let w=A.getLanguageId(B),o=A.getTokenType(B),s=A.containsBalancedBrackets(B)?1:0,e=A.getFontStyle(B),c=A.getForeground(B),i=A.getBackground(B);return 0!==Q&&(w=Q),8!==g&&(o=g),null!==E&&(s=E?1:0),-1!==C&&(e=C),0!==I&&(c=I),0!==D&&(i=D),(w<<0|o<<8|s<<10|e<<11|c<<15|i<<24)>>>0}}(R||(R={}));let J=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;class p{static hasCaptures(A){return null!==A&&(J.lastIndex=0,J.test(A))}static replaceCaptures(A,B,Q){return A.replace(J,((A,g,E,C)=>{let I=Q[parseInt(g||E,10)];if(!I)return A;{let A=B.substring(I.start,I.end);for(;"."===A[0];)A=A.substring(1);switch(C){case"downcase":return A.toLowerCase();case"upcase":return A.toUpperCase();default:return A}}}))}}function d(A,B){return AB?1:0}function S(A,B){if(null===A&&null===B)return 0;if(!A)return-1;if(!B)return 1;let Q=A.length,g=B.length;if(Q===g){for(let g=0;g`);return}const C=Q.lookup(B);A instanceof O?X({baseGrammar:C,selfGrammar:E},g):v(A.ruleName,{baseGrammar:C,selfGrammar:E,repository:E.repository},g);const I=Q.injections(A.scopeName);if(I)for(const A of I)g.add(new O(A))}function v(A,B,Q){B.repository&&B.repository[A]&&Z([B.repository[A]],B,Q)}function X(A,B){A.selfGrammar.patterns&&Array.isArray(A.selfGrammar.patterns)&&Z(A.selfGrammar.patterns,{...A,repository:A.selfGrammar.repository},B),A.selfGrammar.injections&&Z(Object.values(A.selfGrammar.injections),{...A,repository:A.selfGrammar.repository},B)}function Z(A,B,Q){for(const g of A){if(Q.visitedRule.has(g))continue;Q.visitedRule.add(g);const A=g.repository?u({},B.repository,g.repository):B.repository;Array.isArray(g.patterns)&&Z(g.patterns,{...B,repository:A},Q);const E=g.include;if(!E)continue;const C=AA(E);switch(C.kind){case 0:X({...B,selfGrammar:B.baseGrammar},Q);break;case 1:X(B,Q);break;case 2:v(C.ruleName,{...B,repository:A},Q);break;case 3:case 4:const g=C.scopeName===B.selfGrammar.scopeName?B.selfGrammar:C.scopeName===B.baseGrammar.scopeName?B.baseGrammar:void 0;if(g){const E={baseGrammar:B.baseGrammar,selfGrammar:g,repository:A};4===C.kind?v(C.ruleName,E,Q):X(E,Q)}else 4===C.kind?Q.add(new q(C.scopeName,C.ruleName)):Q.add(new O(C.scopeName))}}}class j{constructor(){this.kind=0}}class V{constructor(){this.kind=1}}class z{constructor(A){this.ruleName=A,this.kind=2}}class _{constructor(A){this.scopeName=A,this.kind=3}}class ${constructor(A,B){this.scopeName=A,this.ruleName=B,this.kind=4}}function AA(A){if("$base"===A)return new j;if("$self"===A)return new V;const B=A.indexOf("#");if(-1===B)return new _(A);if(0===B)return new z(A.substring(1));{const Q=A.substring(0,B),g=A.substring(B+1);return new $(Q,g)}}const BA=/\\(\d+)/,QA=/\\(\d+)/g;class gA{constructor(A,B,Q,g){this.$location=A,this.id=B,this._name=Q||null,this._nameIsCapturing=p.hasCaptures(this._name),this._contentName=g||null,this._contentNameIsCapturing=p.hasCaptures(this._contentName)}get debugName(){const A=this.$location?`${y(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${A}`}getName(A,B){return this._nameIsCapturing&&null!==this._name&&null!==A&&null!==B?p.replaceCaptures(this._name,A,B):this._name}getContentName(A,B){return this._contentNameIsCapturing&&null!==this._contentName?p.replaceCaptures(this._contentName,A,B):this._contentName}}class EA extends gA{constructor(A,B,Q,g,E){super(A,B,Q,g),this.retokenizeCapturedWithRuleId=E}dispose(){}collectPatterns(A,B){throw new Error("Not supported!")}compile(A,B){throw new Error("Not supported!")}compileAG(A,B,Q,g){throw new Error("Not supported!")}}class CA extends gA{constructor(A,B,Q,g,E){super(A,B,Q,null),this._match=new sA(g,this.id),this.captures=E,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(A,B){B.push(this._match)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new eA,this.collectPatterns(A,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class IA extends gA{constructor(A,B,Q,g,E){super(A,B,Q,g),this.patterns=E.patterns,this.hasMissingPatterns=E.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(A,B){for(const Q of this.patterns)A.getRule(Q).collectPatterns(A,B)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new eA,this.collectPatterns(A,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class DA extends gA{constructor(A,B,Q,g,E,C,I,D,w,o){super(A,B,Q,g),this._begin=new sA(E,this.id),this.beginCaptures=C,this._end=new sA(I||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=D,this.applyEndPatternLast=w||!1,this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(A,B){return this._end.resolveBackReferences(A,B)}collectPatterns(A,B){B.push(this._begin)}compile(A,B){return this._getCachedCompiledPatterns(A,B).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A,B).compileAG(A,Q,g)}_getCachedCompiledPatterns(A,B){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new eA;for(const B of this.patterns)A.getRule(B).collectPatterns(A,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,B):this._cachedCompiledPatterns.setSource(0,B)),this._cachedCompiledPatterns}}class wA extends gA{constructor(A,B,Q,g,E,C,I,D,w){super(A,B,Q,g),this._begin=new sA(E,this.id),this.beginCaptures=C,this.whileCaptures=D,this._while=new sA(I,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=w.patterns,this.hasMissingPatterns=w.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(A,B){return this._while.resolveBackReferences(A,B)}collectPatterns(A,B){B.push(this._begin)}compile(A,B){return this._getCachedCompiledPatterns(A).compile(A)}compileAG(A,B,Q,g){return this._getCachedCompiledPatterns(A).compileAG(A,Q,g)}_getCachedCompiledPatterns(A){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new eA;for(const B of this.patterns)A.getRule(B).collectPatterns(A,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(A,B){return this._getCachedCompiledWhilePatterns(A,B).compile(A)}compileWhileAG(A,B,Q,g){return this._getCachedCompiledWhilePatterns(A,B).compileAG(A,Q,g)}_getCachedCompiledWhilePatterns(A,B){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new eA,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,B||"￿"),this._cachedCompiledWhilePatterns}}class oA{static createCaptureRule(A,B,Q,g,E){return A.registerRule((A=>new EA(B,A,Q,g,E)))}static getCompiledRuleId(A,B,Q){return A.id||B.registerRule((g=>{if(A.id=g,A.match)return new CA(A.$vscodeTextmateLocation,A.id,A.name,A.match,oA._compileCaptures(A.captures,B,Q));if(void 0===A.begin){A.repository&&(Q=u({},Q,A.repository));let g=A.patterns;return void 0===g&&A.include&&(g=[{include:A.include}]),new IA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,oA._compilePatterns(g,B,Q))}return A.while?new wA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,A.begin,oA._compileCaptures(A.beginCaptures||A.captures,B,Q),A.while,oA._compileCaptures(A.whileCaptures||A.captures,B,Q),oA._compilePatterns(A.patterns,B,Q)):new DA(A.$vscodeTextmateLocation,A.id,A.name,A.contentName,A.begin,oA._compileCaptures(A.beginCaptures||A.captures,B,Q),A.end,oA._compileCaptures(A.endCaptures||A.captures,B,Q),A.applyEndPatternLast,oA._compilePatterns(A.patterns,B,Q))})),A.id}static _compileCaptures(A,B,Q){let g=[];if(A){let E=0;for(const B in A){if("$vscodeTextmateLocation"===B)continue;const A=parseInt(B,10);A>E&&(E=A)}for(let A=0;A<=E;A++)g[A]=null;for(const E in A){if("$vscodeTextmateLocation"===E)continue;const C=parseInt(E,10);let I=0;A[E].patterns&&(I=oA.getCompiledRuleId(A[E],B,Q)),g[C]=oA.createCaptureRule(B,A[E].$vscodeTextmateLocation,A[E].name,A[E].contentName,I)}}return g}static _compilePatterns(A,B,Q){let g=[];if(A)for(let E=0,C=A.length;EA.substring(B.start,B.end)));return QA.lastIndex=0,this.source.replace(QA,((A,B)=>m(Q[parseInt(B,10)]||"")))}_buildAnchorCache(){let A,B,Q,g,E=[],C=[],I=[],D=[];for(A=0,B=this.source.length;AA.source));this._cached=new cA(A,B,this._items.map((A=>A.ruleId)))}return this._cached}compileAG(A,B,Q){return this._hasAnchors?B?Q?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(A,B,Q)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(A,B,Q)),this._anchorCache.A1_G0):Q?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(A,B,Q)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(A,B,Q)),this._anchorCache.A0_G0):this.compile(A)}_resolveAnchors(A,B,Q){let g=this._items.map((A=>A.resolveAnchors(B,Q)));return new cA(A,g,this._items.map((A=>A.ruleId)))}}class cA{constructor(A,B,Q){this.regExps=B,this.rules=Q,this.scanner=A.createOnigScanner(B)}dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const A=[];for(let B=0,Q=this.rules.length;Bthis._root.match(A)))}static createFromRawTheme(A,B){return this.createFromParsedTheme(function(A){if(!A)return[];if(!A.settings||!Array.isArray(A.settings))return[];let B=A.settings,Q=[],g=0;for(let A=0,E=B.length;A1&&(s=C.slice(0,C.length-1),s.reverse()),Q[g++]=new MA(o,s,A,I,D,w)}}return Q}(A),B)}static createFromParsedTheme(A,B){return function(A,B){A.sort(((A,B)=>{let Q=d(A.scope,B.scope);return 0!==Q?Q:(Q=S(A.parentScopes,B.parentScopes),0!==Q?Q:A.index-B.index)}));let Q=0,g="#000000",E="#ffffff";for(;A.length>=1&&""===A[0].scope;){let B=A.shift();-1!==B.fontStyle&&(Q=B.fontStyle),null!==B.foreground&&(g=B.foreground),null!==B.background&&(E=B.background)}let C=new hA(B),I=new aA(Q,C.getId(g),C.getId(E)),D=new FA(new nA(0,null,-1,0,0),[]);for(let B=0,Q=A.length;Bfunction(A,B){if(null===B)return!0;let Q=0,g=B[Q];for(;A;){if(rA(A.scopeName,g)){if(Q++,Q===B.length)return!0;g=B[Q]}A=A.parent}return!1}(A.parent,B.parentScopes)));return Q?new aA(Q.fontStyle,Q.foreground,Q.background):null}}class tA{constructor(A,B){this.parent=A,this.scopeName=B}static push(A,B){for(const Q of B)A=new tA(A,Q);return A}static from(...A){let B=null;for(let Q=0;QA?console.log("how did this happen?"):this.scopeDepth=A,-1!==B&&(this.fontStyle=B),0!==Q&&(this.foreground=Q),0!==g&&(this.background=g)}}class FA{constructor(A,B=[],Q={}){this._mainRule=A,this._children=Q,this._rulesWithParentScopes=B}static _sortBySpecificity(A){return 1===A.length||A.sort(this._cmpBySpecificity),A}static _cmpBySpecificity(A,B){if(A.scopeDepth===B.scopeDepth){const Q=A.parentScopes,g=B.parentScopes;let E=null===Q?0:Q.length,C=null===g?0:g.length;if(E===C)for(let A=0;A{const B=this._scopeToLanguage(A),Q=this._toStandardTokenType(A);return new GA(B,Q)})),this._defaultAttributes=new GA(A,8),this._embeddedLanguagesMatcher=new HA(Object.entries(B||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(A){return null===A?NA._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(A)}_scopeToLanguage(A){return this._embeddedLanguagesMatcher.match(A)||0}_toStandardTokenType(A){const B=A.match(NA.STANDARD_TOKEN_TYPE_REGEXP);if(!B)return 8;switch(B[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}}NA._NULL_SCOPE_METADATA=new GA(0,0),NA.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class HA{constructor(A){if(0===A.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(A);const B=A.map((([A,B])=>m(A)));B.sort(),B.reverse(),this.scopesRegExp=new RegExp(`^((${B.join(")|(")}))($|\\.)`,"")}}match(A){if(!this.scopesRegExp)return;const B=A.match(this.scopesRegExp);return B?this.values.get(B[1]):void 0}}class LA{constructor(A,B){this.stack=A,this.stoppedEarly=B}}function kA(A,B,Q,g,E,C,I,D){const w=B.content.length;let o=!1,s=-1;if(I){const I=function(A,B,Q,g,E,C){let I=E.beginRuleCapturedEOL?0:-1;const D=[];for(let B=E;B;B=B.pop()){const Q=B.getRule(A);Q instanceof wA&&D.push({rule:Q,stack:B})}for(let w=D.pop();w;w=D.pop()){const{ruleScanner:D,findOptions:o}=KA(w.rule,A,w.stack.endRule,Q,g===I),s=D.findNextMatchSync(B,g,o);if(k&&(console.log(" scanning for while rule"),console.log(D.toString())),!s){k&&console.log(" popping "+w.rule.debugName+" - "+w.rule.debugWhileRegExp),E=w.stack.pop();break}if(-2!==s.ruleId){E=w.stack.pop();break}s.captureIndices&&s.captureIndices.length&&(C.produce(w.stack,s.captureIndices[0].start),YA(A,B,Q,w.stack,C,w.rule.whileCaptures,s.captureIndices),C.produce(w.stack,s.captureIndices[0].end),I=s.captureIndices[0].end,s.captureIndices[0].end>g&&(g=s.captureIndices[0].end,Q=!1))}return{stack:E,linePos:g,anchorPosition:I,isFirstLine:Q}}(A,B,Q,g,E,C);E=I.stack,g=I.linePos,Q=I.isFirstLine,s=I.anchorPosition}const e=Date.now();for(;!o;){if(0!==D&&Date.now()-e>D)return new LA(E,!0);c()}return new LA(E,!1);function c(){k&&(console.log(""),console.log(`@@scanNext ${g}: |${B.content.substr(g).replace(/\n$/,"\\n")}|`));const I=function(A,B,Q,g,E,C){const I=function(A,B,Q,g,E,C){const I=E.getRule(A),{ruleScanner:D,findOptions:w}=RA(I,A,E.endRule,Q,g===C);let o=0;k&&(o=x());const s=D.findNextMatchSync(B,g,w);if(k){const A=x()-o;A>5&&console.warn(`Rule ${I.debugName} (${I.id}) matching took ${A} against '${B}'`),console.log(` scanning for (linePos: ${g}, anchorPosition: ${C})`),console.log(D.toString()),s&&console.log(`matched rule id: ${s.ruleId} from ${s.captureIndices[0].start} to ${s.captureIndices[0].end}`)}return s?{captureIndices:s.captureIndices,matchedRuleId:s.ruleId}:null}(A,B,Q,g,E,C),D=A.getInjections();if(0===D.length)return I;const w=function(A,B,Q,g,E,C,I){let D,w=Number.MAX_VALUE,o=null,s=0;const e=C.contentNameScopesList.getScopeNames();for(let C=0,c=A.length;C=w)&&(w=M,o=a.captureIndices,D=a.ruleId,s=c.priority,w===E))break}return o?{priorityMatch:-1===s,captureIndices:o,matchedRuleId:D}:null}(D,A,B,Q,g,E,C);if(!w)return I;if(!I)return w;const o=I.captureIndices[0].start,s=w.captureIndices[0].start;return s0)&&D[0].end>g;if(-1===e){const I=E.getRule(A);k&&console.log(" popping "+I.debugName+" - "+I.debugEndRegExp),C.produce(E,D[0].start),E=E.withContentNameScopesList(E.nameScopesList),YA(A,B,Q,E,C,I.endCaptures,D),C.produce(E,D[0].end);const e=E;if(E=E.parent,s=e.getAnchorPos(),!c&&e.getEnterPos()===g)return k&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),E=e,C.produce(E,w),void(o=!0)}else{const I=A.getRule(e);C.produce(E,D[0].start);const i=E,t=I.getName(B.content,D),r=E.contentNameScopesList.pushAttributed(t,A);if(E=E.push(e,g,s,D[0].end===w,null,r,r),I instanceof DA){const g=I;k&&console.log(" pushing "+g.debugName+" - "+g.debugBeginRegExp),YA(A,B,Q,E,C,g.beginCaptures,D),C.produce(E,D[0].end),s=D[0].end;const e=g.getContentName(B.content,D),t=r.pushAttributed(e,A);if(E=E.withContentNameScopesList(t),g.endHasBackReferences&&(E=E.withEndRule(g.getEndWithResolvedBackReferences(B.content,D))),!c&&i.hasSameRuleAs(E))return k&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),E=E.pop(),C.produce(E,w),void(o=!0)}else if(I instanceof wA){const g=I;k&&console.log(" pushing "+g.debugName),YA(A,B,Q,E,C,g.beginCaptures,D),C.produce(E,D[0].end),s=D[0].end;const e=g.getContentName(B.content,D),t=r.pushAttributed(e,A);if(E=E.withContentNameScopesList(t),g.whileHasBackReferences&&(E=E.withEndRule(g.getWhileWithResolvedBackReferences(B.content,D))),!c&&i.hasSameRuleAs(E))return k&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),E=E.pop(),C.produce(E,w),void(o=!0)}else{const g=I;if(k&&console.log(" matched "+g.debugName+" - "+g.debugMatchRegExp),YA(A,B,Q,E,C,g.captures,D),C.produce(E,D[0].end),E=E.pop(),!c)return k&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),E=E.safePop(),C.produce(E,w),void(o=!0)}}D[0].end>g&&(g=D[0].end,Q=!1)}}function RA(A,B,Q,g,E){return{ruleScanner:A.compileAG(B,Q,g,E),findOptions:0}}function KA(A,B,Q,g,E){return{ruleScanner:A.compileWhileAG(B,Q,g,E),findOptions:0}}function YA(A,B,Q,g,E,C,I){if(0===C.length)return;const D=B.content,w=Math.min(C.length,I.length),o=[],s=I[0].end;for(let B=0;Bs)break;for(;o.length>0&&o[o.length-1].endPos<=e.start;)E.produceFromScopes(o[o.length-1].scopes,o[o.length-1].endPos),o.pop();if(o.length>0?E.produceFromScopes(o[o.length-1].scopes,e.start):E.produce(g,e.start),w.retokenizeCapturedWithRuleId){const B=w.getName(D,I),C=g.contentNameScopesList.pushAttributed(B,A),o=w.getContentName(D,I),s=C.pushAttributed(o,A),c=g.push(w.retokenizeCapturedWithRuleId,e.start,-1,!1,null,C,s),i=A.createOnigString(D.substring(0,e.end));kA(A,i,Q&&0===e.start,e.start,c,E,!1,0),U(i);continue}const c=w.getName(D,I);if(null!==c){const B=(o.length>0?o[o.length-1].scopes:g.contentNameScopesList).pushAttributed(c,A);o.push(new UA(B,e.end))}}for(;o.length>0;)E.produceFromScopes(o[o.length-1].scopes,o[o.length-1].endPos),o.pop()}class UA{constructor(A,B){this.scopes=A,this.endPos=B}}function PA(A,B,Q,g,E){const C=K(B,uA),I=oA.getCompiledRuleId(Q,g,E.repository);for(const Q of C)A.push({debugSelector:B,matcher:Q.matcher,ruleId:I,grammar:E,priority:Q.priority})}function uA(A,B){if(B.length{for(let g=Q;gQ&&A.substr(0,Q)===B&&"."===A[Q]}class JA{constructor(A,B,Q,g,E,C,I,D){if(this._rootScopeName=A,this.balancedBracketSelectors=C,this._onigLib=D,this._basicScopeAttributesProvider=new NA(Q,g),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=I,this._grammar=pA(B,null),this._injections=null,this._tokenTypeMatchers=[],E)for(const A of Object.keys(E)){const B=K(A,uA);for(const Q of B)this._tokenTypeMatchers.push({matcher:Q.matcher,type:E[A]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const A of this._ruleId2desc)A&&A.dispose()}createOnigScanner(A){return this._onigLib.createOnigScanner(A)}createOnigString(A){return this._onigLib.createOnigString(A)}getMetadataForScope(A){return this._basicScopeAttributesProvider.getBasicScopeAttributes(A)}_collectInjections(){const A=[],B=this._rootScopeName,Q=(A=>A===this._rootScopeName?this._grammar:this.getExternalGrammar(A))(B);if(Q){const g=Q.injections;if(g)for(let B in g)PA(A,B,g[B],this,Q);const E=this._grammarRepository.injections(B);E&&E.forEach((B=>{const Q=this.getExternalGrammar(B);if(Q){const B=Q.injectionSelector;B&&PA(A,B,Q,this,Q)}}))}return A.sort(((A,B)=>A.priority-B.priority)),A}getInjections(){if(null===this._injections&&(this._injections=this._collectInjections(),k&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const A of this._injections)console.log(` - ${A.debugSelector}`)}return this._injections}registerRule(A){const B=++this._lastRuleId,Q=A(B);return this._ruleId2desc[B]=Q,Q}getRule(A){return this._ruleId2desc[A]}getExternalGrammar(A,B){if(this._includedGrammars[A])return this._includedGrammars[A];if(this._grammarRepository){const Q=this._grammarRepository.lookup(A);if(Q)return this._includedGrammars[A]=pA(Q,B&&B.$base),this._includedGrammars[A]}}tokenizeLine(A,B,Q=0){const g=this._tokenize(A,B,!1,Q);return{tokens:g.lineTokens.getResult(g.ruleStack,g.lineLength),ruleStack:g.ruleStack,stoppedEarly:g.stoppedEarly}}tokenizeLine2(A,B,Q=0){const g=this._tokenize(A,B,!0,Q);return{tokens:g.lineTokens.getBinaryResult(g.ruleStack,g.lineLength),ruleStack:g.ruleStack,stoppedEarly:g.stoppedEarly}}_tokenize(A,B,Q,g){let E;if(-1===this._rootId&&(this._rootId=oA.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),B&&B!==SA.NULL)E=!1,B.reset();else{E=!0;const A=this._basicScopeAttributesProvider.getDefaultAttributes(),Q=this.themeProvider.getDefaults(),g=R.set(0,A.languageId,A.tokenType,null,Q.fontStyle,Q.foregroundId,Q.backgroundId),C=this.getRule(this._rootId).getName(null,null);let I;I=C?dA.createRootAndLookUpScopeName(C,g,this):dA.createRoot("unknown",g),B=new SA(null,this._rootId,-1,-1,!1,null,I,I)}A+="\n";const C=this.createOnigString(A),I=C.content.length,D=new mA(Q,A,this._tokenTypeMatchers,this.balancedBracketSelectors),w=kA(this,C,E,0,B,D,!0,g);return U(C),{lineLength:I,lineTokens:D,ruleStack:w.stack,stoppedEarly:w.stoppedEarly}}}function pA(A,B){return(A=P(A)).repository=A.repository||{},A.repository.$self={$vscodeTextmateLocation:A.$vscodeTextmateLocation,patterns:A.patterns,name:A.scopeName},A.repository.$base=B||A.repository.$self,A}class dA{constructor(A,B,Q){this.parent=A,this.scopePath=B,this.tokenAttributes=Q}static fromExtension(A,B){let Q=A,g=A?.scopePath??null;for(const A of B)g=tA.push(g,A.scopeNames),Q=new dA(Q,g,A.encodedTokenAttributes);return Q}static createRoot(A,B){return new dA(null,new tA(null,A),B)}static createRootAndLookUpScopeName(A,B,Q){const g=Q.getMetadataForScope(A),E=new tA(null,A),C=Q.themeProvider.themeMatch(E),I=dA.mergeAttributes(B,g,C);return new dA(null,E,I)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(A){return dA.equals(this,A)}static equals(A,B){for(;;){if(A===B)return!0;if(!A&&!B)return!0;if(!A||!B)return!1;if(A.scopeName!==B.scopeName||A.tokenAttributes!==B.tokenAttributes)return!1;A=A.parent,B=B.parent}}static mergeAttributes(A,B,Q){let g=-1,E=0,C=0;return null!==Q&&(g=Q.fontStyle,E=Q.foregroundId,C=Q.backgroundId),R.set(A,B.languageId,B.tokenType,null,g,E,C)}pushAttributed(A,B){if(null===A)return this;if(-1===A.indexOf(" "))return dA._pushAttributed(this,A,B);const Q=A.split(/ /g);let g=this;for(const A of Q)g=dA._pushAttributed(g,A,B);return g}static _pushAttributed(A,B,Q){const g=Q.getMetadataForScope(B),E=A.scopePath.push(B),C=Q.themeProvider.themeMatch(E),I=dA.mergeAttributes(A.tokenAttributes,g,C);return new dA(A,E,I)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(A){const B=[];let Q=this;for(;Q&&Q!==A;)B.push({encodedTokenAttributes:Q.tokenAttributes,scopeNames:Q.scopePath.getExtensionIfDefined(Q.parent?.scopePath??null)}),Q=Q.parent;return Q===A?B.reverse():void 0}}class SA{constructor(A,B,Q,g,E,C,I,D){this.parent=A,this.ruleId=B,this.beginRuleCapturedEOL=E,this.endRule=C,this.nameScopesList=I,this.contentNameScopesList=D,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=Q,this._anchorPos=g}equals(A){return null!==A&&SA._equals(this,A)}static _equals(A,B){return A===B||!!this._structuralEquals(A,B)&&dA.equals(A.contentNameScopesList,B.contentNameScopesList)}static _structuralEquals(A,B){for(;;){if(A===B)return!0;if(!A&&!B)return!0;if(!A||!B)return!1;if(A.depth!==B.depth||A.ruleId!==B.ruleId||A.endRule!==B.endRule)return!1;A=A.parent,B=B.parent}}clone(){return this}static _reset(A){for(;A;)A._enterPos=-1,A._anchorPos=-1,A=A.parent}reset(){SA._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(A,B,Q,g,E,C,I){return new SA(this,A,B,Q,g,E,C,I)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(A){return A.getRule(this.ruleId)}toString(){const A=[];return this._writeString(A,0),"["+A.join(",")+"]"}_writeString(A,B){return this.parent&&(B=this.parent._writeString(A,B)),A[B++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,B}withContentNameScopesList(A){return this.contentNameScopesList===A?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,A)}withEndRule(A){return this.endRule===A?this:new SA(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,A,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(A){let B=this;for(;B&&B._enterPos===A._enterPos;){if(B.ruleId===A.ruleId)return!0;B=B.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(A,B){const Q=dA.fromExtension(A?.nameScopesList??null,B.nameScopesList);return new SA(A,B.ruleId,B.enterPos??-1,B.anchorPos??-1,B.beginRuleCapturedEOL,B.endRule,Q,dA.fromExtension(Q,B.contentNameScopesList))}}SA.NULL=new SA(null,0,0,0,!1,null,null,null);class lA{constructor(A,B){this.allowAny=!1,this.balancedBracketScopes=A.flatMap((A=>"*"===A?(this.allowAny=!0,[]):K(A,uA).map((A=>A.matcher)))),this.unbalancedBracketScopes=B.flatMap((A=>K(A,uA).map((A=>A.matcher))))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(A){for(const B of this.unbalancedBracketScopes)if(B(A))return!1;for(const B of this.balancedBracketScopes)if(B(A))return!0;return this.allowAny}}class mA{constructor(A,B,Q,g){this.balancedBracketSelectors=g,this._emitBinaryTokens=A,this._tokenTypeOverrides=Q,this._lineText=k?B:null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(A,B){this.produceFromScopes(A.contentNameScopesList,B)}produceFromScopes(A,B){if(this._lastTokenEndIndex>=B)return;if(this._emitBinaryTokens){let Q=A?.tokenAttributes??0,g=!1;if(this.balancedBracketSelectors?.matchesAlways&&(g=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const B=A?.getScopeNames()??[];for(const A of this._tokenTypeOverrides)A.matcher(B)&&(Q=R.set(Q,0,A.type,null,-1,0,0));this.balancedBracketSelectors&&(g=this.balancedBracketSelectors.match(B))}if(g&&(Q=R.set(Q,0,8,g,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===Q)return void(this._lastTokenEndIndex=B);if(k){const Q=A?.getScopeNames()??[];console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,B).replace(/\n$/,"\\n")+"|");for(let A=0;A0&&this._tokens[this._tokens.length-1].startIndex===B-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(A,B),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(A,B){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===B-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(A,B),this._binaryTokens[this._binaryTokens.length-2]=0);const Q=new Uint32Array(this._binaryTokens.length);for(let A=0,B=this._binaryTokens.length;A0;)10===A.charCodeAt(E)?(E++,C++,I=0):(E++,I++),B--}function w(A){null===Q?E=A:D(A-E)}function o(){for(;E0&&65279===A.charCodeAt(0)&&(E=1);let i=0,t=null,r=[],a=[],M=null;function h(A,B){r.push(i),a.push(t),i=A,t=B}function n(){if(0===r.length)return F("illegal state stack");i=r.pop(),t=a.pop()}function F(B){throw new Error("Near offset "+E+": "+B+" ~~~"+A.substr(E,50)+"~~~")}const G=function(){if(null===M)return F("missing ");let A={};null!==Q&&(A[Q]={filename:B,line:C,char:I}),t[M]=A,M=null,h(1,A)},N=function(){if(null===M)return F("missing ");let A=[];t[M]=A,M=null,h(2,A)},H=function(){let A={};null!==Q&&(A[Q]={filename:B,line:C,char:I}),t.push(A),h(1,A)},L=function(){let A=[];t.push(A),h(2,A)};function k(){if(1!==i)return F("unexpected ");n()}function R(){return 1===i||2!==i?F("unexpected "):void n()}function K(A){if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function Y(A){if(isNaN(A))return F("cannot parse float");if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function U(A){if(isNaN(A))return F("cannot parse integer");if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function P(A){if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function u(A){if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function y(A){if(1===i){if(null===M)return F("missing ");t[M]=A,M=null}else 2===i?t.push(A):t=A}function J(){let A=c(">"),B=!1;return 47===A.charCodeAt(A.length-1)&&(B=!0,A=A.substring(0,A.length-1)),{name:A.trim(),isClosed:B}}function p(A){if(A.isClosed)return"";let B=c(""),B.replace(/&#([0-9]+);/g,(function(A,B){return String.fromCodePoint(parseInt(B,10))})).replace(/&#x([0-9a-f]+);/g,(function(A,B){return String.fromCodePoint(parseInt(B,16))})).replace(/&|<|>|"|'/g,(function(A){switch(A){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return A}))}for(;E=g));){const w=A.charCodeAt(E);if(D(1),60!==w)return F("expected <");if(E>=g)return F("unexpected end of input");const c=A.charCodeAt(E);if(63===c){D(1),e("?>");continue}if(33===c){if(D(1),s("--")){e("--\x3e");continue}e(">");continue}if(47===c){if(D(1),o(),s("plist")){e(">");continue}if(s("dict")){e(">"),k();continue}if(s("array")){e(">"),R();continue}return F("unexpected closed tag")}let r=J();switch(r.name){case"dict":1===i?G():2===i?H():(t={},null!==Q&&(t[Q]={filename:B,line:C,char:I}),h(1,t)),r.isClosed&&k();continue;case"array":1===i?N():2===i?L():(t=[],h(2,t)),r.isClosed&&R();continue;case"key":d=p(r),1!==i?F("unexpected "):null!==M?F("too many "):M=d;continue;case"string":K(p(r));continue;case"real":Y(parseFloat(p(r)));continue;case"integer":U(parseInt(p(r),10));continue;case"date":P(new Date(p(r)));continue;case"data":u(p(r));continue;case"true":p(r),y(!0);continue;case"false":p(r),y(!1);continue}if(!/^plist/.test(r.name))return F("unexpected opened tag "+r.name)}var d;return t}function xA(A,B){throw new Error("Near offset "+A.pos+": "+B+" ~~~"+A.source.substr(A.pos,50)+"~~~")}class OA{constructor(A){this.source=A,this.pos=0,this.len=A.length,this.line=1,this.char=0}}class qA{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(A){return{filename:A,line:this.line,char:this.char}}}function bA(A,B){B.value=null,B.type=0,B.offset=-1,B.len=-1,B.line=-1,B.char=-1;let Q,g=A.source,E=A.pos,C=A.len,I=A.line,D=A.char;for(;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),32!==Q&&9!==Q&&13!==Q){if(10!==Q)break;E++,I++,D=0}else E++,D++}if(B.offset=E,B.line=I,B.char=D,34===Q){for(B.type=1,E++,D++;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),E++,D++,92!==Q){if(34===Q)break}else E++,D++}B.value=g.substring(B.offset+1,E-1).replace(/\\u([0-9A-Fa-f]{4})/g,((A,B)=>String.fromCodePoint(parseInt(B,16)))).replace(/\\(.)/g,((B,Q)=>{switch(Q){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:xA(A,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===Q)B.type=2,E++,D++;else if(123===Q)B.type=3,E++,D++;else if(93===Q)B.type=4,E++,D++;else if(125===Q)B.type=5,E++,D++;else if(58===Q)B.type=6,E++,D++;else if(44===Q)B.type=7,E++,D++;else if(110===Q){if(B.type=8,E++,D++,Q=g.charCodeAt(E),117!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;E++,D++}else if(116===Q){if(B.type=9,E++,D++,Q=g.charCodeAt(E),114!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),117!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),101!==Q)return!1;E++,D++}else if(102===Q){if(B.type=10,E++,D++,Q=g.charCodeAt(E),97!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),108!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),115!==Q)return!1;if(E++,D++,Q=g.charCodeAt(E),101!==Q)return!1;E++,D++}else for(B.type=11;;){if(E>=C)return!1;if(Q=g.charCodeAt(E),!(46===Q||Q>=48&&Q<=57||101===Q||69===Q||45===Q||43===Q))break;E++,D++}return B.len=E-B.offset,null===B.value&&(B.value=g.substr(B.offset,B.len)),A.pos=E,A.line=I,A.char=D,!0}class WA{constructor(A,B){this._onigLibPromise=B,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=A}dispose(){for(const A of this._grammars.values())A.dispose()}setTheme(A){this._theme=A}getColorMap(){return this._theme.getColorMap()}addGrammar(A,B){this._rawGrammars.set(A.scopeName,A),B&&this._injectionGrammars.set(A.scopeName,B)}lookup(A){return this._rawGrammars.get(A)}injections(A){return this._injectionGrammars.get(A)}getDefaults(){return this._theme.getDefaults()}themeMatch(A){return this._theme.match(A)}async grammarForScopeName(A,B,Q,g,E){if(!this._grammars.has(A)){let C=this._rawGrammars.get(A);if(!C)return null;this._grammars.set(A,function(A,B,Q,g,E,C,I,D){return new JA(A,B,Q,g,E,C,I,D)}(A,C,B,Q,g,E,this,await this._onigLibPromise))}return this._grammars.get(A)}}function TA(A,B){let Q=0;const g=[];let E=A,C=B;for(;E!==C;)E&&(!C||E.depth>=C.depth)?(Q++,E=E.parent):(g.push(C.toStateStackFrame()),C=C.parent);return{pops:Q,newFrames:g.reverse()}}function vA(A,B){let Q=A;for(let A=0;A0;)await Promise.all(C.Q.map((A=>this._loadSingleGrammar(A.scopeName)))),C.processQueue();return this._grammarForScopeName(A,B,Q,g,E)}async _loadSingleGrammar(A){return this._ensureGrammarCache.has(A)||this._ensureGrammarCache.set(A,this._doLoadSingleGrammar(A)),this._ensureGrammarCache.get(A)}async _doLoadSingleGrammar(A){const B=await this._options.loadGrammar(A);if(B){const Q="function"==typeof this._options.getInjections?this._options.getInjections(A):void 0;this._syncRegistry.addGrammar(B,Q)}}async addGrammar(A,B=[],Q=0,g=null){return this._syncRegistry.addGrammar(A,B),await this._grammarForScopeName(A.scopeName,Q,g)}_grammarForScopeName(A,B=0,Q=null,g=null,E=null){return this._syncRegistry.grammarForScopeName(A,B,Q,g,E)}}const ZA=SA.NULL,jA=function(A,B=null){return null!==B&&/\.json$/.test(B)?(Q=A,k?function(A,B,Q){let g=new OA(A),E=new qA,C=0,I=null,D=[],w=[];function o(){D.push(C),w.push(I)}function s(){C=D.pop(),I=w.pop()}function e(A){xA(g,A)}for(;bA(g,E);){if(0===C){if(null!==I&&e("too many constructs in root"),3===E.type){I={},I.$vscodeTextmateLocation=E.toLocation(B),o(),C=1;continue}if(2===E.type){I=[],o(),C=4;continue}e("unexpected token in root")}if(2===C){if(5===E.type){s();continue}if(7===E.type){C=3;continue}e("expected , or }")}if(1===C||3===C){if(1===C&&5===E.type){s();continue}if(1===E.type){let A=E.value;if(bA(g,E)&&6===E.type||e("expected colon"),bA(g,E)||e("expected value"),C=2,1===E.type){I[A]=E.value;continue}if(8===E.type){I[A]=null;continue}if(9===E.type){I[A]=!0;continue}if(10===E.type){I[A]=!1;continue}if(11===E.type){I[A]=parseFloat(E.value);continue}if(2===E.type){let B=[];I[A]=B,o(),C=4,I=B;continue}if(3===E.type){let Q={};Q.$vscodeTextmateLocation=E.toLocation(B),I[A]=Q,o(),C=1,I=Q;continue}}e("unexpected token in dict")}if(5===C){if(4===E.type){s();continue}if(7===E.type){C=6;continue}e("expected , or ]")}if(4===C||6===C){if(4===C&&4===E.type){s();continue}if(C=5,1===E.type){I.push(E.value);continue}if(8===E.type){I.push(null);continue}if(9===E.type){I.push(!0);continue}if(10===E.type){I.push(!1);continue}if(11===E.type){I.push(parseFloat(E.value));continue}if(2===E.type){let A=[];I.push(A),o(),C=4,I=A;continue}if(3===E.type){let A={};A.$vscodeTextmateLocation=E.toLocation(B),I.push(A),o(),C=1,I=A;continue}e("unexpected token in array")}e("unknown state")}return 0!==w.length&&e("unclosed constructs"),I}(Q,B):JSON.parse(Q)):function(A,B){return k?function(A,B,Q){return fA(A,B,"$vscodeTextmateLocation")}(A,B):function(A){return fA(A,null,null)}(A)}(A,B);var Q};var VA=L.Bz,zA=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(A){var B,Q,g=void 0!==(A=A||{})?A:{};g.ready=new Promise((function(A,g){B=A,Q=g}));var E,C=Object.assign({},g),I=!1;E=function(A){let B;return"function"==typeof readbuffer?new Uint8Array(readbuffer(A)):(B=read(A,"binary"),"object"==typeof B||H(Q),B);var Q},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print);var D,w,o=g.print||console.log.bind(console),s=g.printErr||console.warn.bind(console);Object.assign(g,C),C=null,g.arguments&&g.arguments,g.thisProgram&&g.thisProgram,g.quit&&g.quit,g.wasmBinary&&(D=g.wasmBinary),g.noExitRuntime,"object"!=typeof WebAssembly&&H("no native wasm support detected");var e,c,i,t=!1,r="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function a(A,B,Q){for(var g=B+Q,E=B;A[E]&&!(E>=g);)++E;if(E-B>16&&A.buffer&&r)return r.decode(A.subarray(B,E));for(var C="";B>10,56320|1023&o)}}else C+=String.fromCharCode((31&I)<<6|D)}else C+=String.fromCharCode(I)}return C}function M(A){e=A,g.HEAP8=new Int8Array(A),g.HEAP16=new Int16Array(A),g.HEAP32=new Int32Array(A),g.HEAPU8=c=new Uint8Array(A),g.HEAPU16=new Uint16Array(A),g.HEAPU32=i=new Uint32Array(A),g.HEAPF32=new Float32Array(A),g.HEAPF64=new Float64Array(A)}g.INITIAL_MEMORY;var h=[],n=[],F=[],G=0,N=null;function H(A){g.onAbort&&g.onAbort(A),s(A="Aborted("+A+")"),t=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw Q(B),B}var L,k,R,K="data:application/octet-stream;base64,";function Y(A){return A.startsWith(K)}function U(A){try{if(A==L&&D)return new Uint8Array(D);if(E)return E(A);throw"both async and sync fetching of the wasm failed"}catch(A){H(A)}}function P(A){for(;A.length>0;)A.shift()(g)}function u(A){try{return w.grow(A-e.byteLength+65535>>>16),M(w.buffer),1}catch(A){}}Y(L="onig.wasm")||(k=L,L=g.locateFile?g.locateFile(k,""):""+k),R="undefined"!=typeof dateNow?dateNow:()=>performance.now();var y=[null,[],[]];function J(A,B){var Q=y[A];0===B||10===B?((1===A?o:s)(a(Q,0)),Q.length=0):Q.push(B)}var p,d={emscripten_get_now:R,emscripten_memcpy_big:function(A,B,Q){c.copyWithin(A,B,B+Q)},emscripten_resize_heap:function(A){var B=c.length,Q=2147483648;if((A>>>=0)>Q)return!1;let g=(A,B)=>A+(B-A%B)%B;for(var E=1;E<=4;E*=2){var C=B*(1+.2/E);if(C=Math.min(C,A+100663296),u(Math.min(Q,g(Math.max(A,C),65536))))return!0}return!1},fd_write:function(A,B,Q,g){for(var E=0,C=0;C>2],D=i[B+4>>2];B+=8;for(var w=0;w>2]=E,0}};function S(A){function Q(){p||(p=!0,g.calledRun=!0,t||(P(n),B(g),g.onRuntimeInitialized&&g.onRuntimeInitialized(),function(){if(g.postRun)for("function"==typeof g.postRun&&(g.postRun=[g.postRun]);g.postRun.length;)A=g.postRun.shift(),F.unshift(A);var A;P(F)}()))}G>0||(function(){if(g.preRun)for("function"==typeof g.preRun&&(g.preRun=[g.preRun]);g.preRun.length;)A=g.preRun.shift(),h.unshift(A);var A;P(h)}(),G>0||(g.setStatus?(g.setStatus("Running..."),setTimeout((function(){setTimeout((function(){g.setStatus("")}),1),Q()}),1)):Q()))}if(function(){var A={env:d,wasi_snapshot_preview1:d};function B(A,B){var Q,E=A.exports;g.asm=E,M((w=g.asm.memory).buffer),g.asm.__indirect_function_table,Q=g.asm.__wasm_call_ctors,n.unshift(Q),function(A){if(G--,g.monitorRunDependencies&&g.monitorRunDependencies(G),0==G&&N){var B=N;N=null,B()}}()}function E(A){B(A.instance)}function C(B){return(!D&&I&&"function"==typeof fetch?fetch(L,{credentials:"same-origin"}).then((function(A){if(!A.ok)throw"failed to load wasm binary file at '"+L+"'";return A.arrayBuffer()})).catch((function(){return U(L)})):Promise.resolve().then((function(){return U(L)}))).then((function(B){return WebAssembly.instantiate(B,A)})).then((function(A){return A})).then(B,(function(A){s("failed to asynchronously prepare wasm: "+A),H(A)}))}if(G++,g.monitorRunDependencies&&g.monitorRunDependencies(G),g.instantiateWasm)try{return g.instantiateWasm(A,B)}catch(A){s("Module.instantiateWasm callback failed with error: "+A),Q(A)}(D||"function"!=typeof WebAssembly.instantiateStreaming||Y(L)||"function"!=typeof fetch?C(E):fetch(L,{credentials:"same-origin"}).then((function(B){return WebAssembly.instantiateStreaming(B,A).then(E,(function(A){return s("wasm streaming compile failed: "+A),s("falling back to ArrayBuffer instantiation"),C(E)}))}))).catch(Q)}(),g.___wasm_call_ctors=function(){return(g.___wasm_call_ctors=g.asm.__wasm_call_ctors).apply(null,arguments)},g.___errno_location=function(){return(g.___errno_location=g.asm.__errno_location).apply(null,arguments)},g._omalloc=function(){return(g._omalloc=g.asm.omalloc).apply(null,arguments)},g._ofree=function(){return(g._ofree=g.asm.ofree).apply(null,arguments)},g._getLastOnigError=function(){return(g._getLastOnigError=g.asm.getLastOnigError).apply(null,arguments)},g._createOnigScanner=function(){return(g._createOnigScanner=g.asm.createOnigScanner).apply(null,arguments)},g._freeOnigScanner=function(){return(g._freeOnigScanner=g.asm.freeOnigScanner).apply(null,arguments)},g._findNextOnigScannerMatch=function(){return(g._findNextOnigScannerMatch=g.asm.findNextOnigScannerMatch).apply(null,arguments)},g._findNextOnigScannerMatchDbg=function(){return(g._findNextOnigScannerMatchDbg=g.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},g.stackSave=function(){return(g.stackSave=g.asm.stackSave).apply(null,arguments)},g.stackRestore=function(){return(g.stackRestore=g.asm.stackRestore).apply(null,arguments)},g.stackAlloc=function(){return(g.stackAlloc=g.asm.stackAlloc).apply(null,arguments)},g.dynCall_jiji=function(){return(g.dynCall_jiji=g.asm.dynCall_jiji).apply(null,arguments)},g.UTF8ToString=function(A,B){return A?a(c,A,B):""},N=function A(){p||S(),p||(N=A)},g.preInit)for("function"==typeof g.preInit&&(g.preInit=[g.preInit]);g.preInit.length>0;)g.preInit.pop()();return S(),A.ready});let _A=null;class $A{static _utf8ByteLength(A){let B=0;for(let Q=0,g=A.length;Q=55296&&E<=56319&&Q+1=56320&&B<=57343&&(C=65536+(E-55296<<10)|B-56320,I=!0)}B+=C<=127?1:C<=2047?2:C<=65535?3:4,I&&Q++}return B}constructor(A){const B=A.length,Q=$A._utf8ByteLength(A),g=Q!==B,E=g?new Uint32Array(B+1):null;g&&(E[B]=Q);const C=g?new Uint32Array(Q+1):null;g&&(C[Q]=B);const I=new Uint8Array(Q);let D=0;for(let Q=0;Q=55296&&w<=56319&&Q+1=56320&&B<=57343&&(o=65536+(w-55296<<10)|B-56320,s=!0)}g&&(E[Q]=D,s&&(E[Q+1]=D),o<=127?C[D+0]=Q:o<=2047?(C[D+0]=Q,C[D+1]=Q):o<=65535?(C[D+0]=Q,C[D+1]=Q,C[D+2]=Q):(C[D+0]=Q,C[D+1]=Q,C[D+2]=Q,C[D+3]=Q)),o<=127?I[D++]=o:o<=2047?(I[D++]=192|(1984&o)>>>6,I[D++]=128|(63&o)>>>0):o<=65535?(I[D++]=224|(61440&o)>>>12,I[D++]=128|(4032&o)>>>6,I[D++]=128|(63&o)>>>0):(I[D++]=240|(1835008&o)>>>18,I[D++]=128|(258048&o)>>>12,I[D++]=128|(4032&o)>>>6,I[D++]=128|(63&o)>>>0),s&&Q++}this.utf16Length=B,this.utf8Length=Q,this.utf16Value=A,this.utf8Value=I,this.utf16OffsetToUtf8=E,this.utf8OffsetToUtf16=C}createString(A){const B=A._omalloc(this.utf8Length);return A.HEAPU8.set(this.utf8Value,B),B}}class AB{constructor(A){if(this.id=++AB.LAST_ID,!_A)throw new Error("Must invoke loadWASM first.");this._onigBinding=_A,this.content=A;const B=new $A(A);this.utf16Length=B.utf16Length,this.utf8Length=B.utf8Length,this.utf16OffsetToUtf8=B.utf16OffsetToUtf8,this.utf8OffsetToUtf16=B.utf8OffsetToUtf16,this.utf8Length<1e4&&!AB._sharedPtrInUse?(AB._sharedPtr||(AB._sharedPtr=_A._omalloc(1e4)),AB._sharedPtrInUse=!0,_A.HEAPU8.set(B.utf8Value,AB._sharedPtr),this.ptr=AB._sharedPtr):this.ptr=B.createString(_A)}convertUtf8OffsetToUtf16(A){return this.utf8OffsetToUtf16?A<0?0:A>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[A]:A}convertUtf16OffsetToUtf8(A){return this.utf16OffsetToUtf8?A<0?0:A>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[A]:A}dispose(){this.ptr===AB._sharedPtr?AB._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}AB.LAST_ID=0,AB._sharedPtr=0,AB._sharedPtrInUse=!1;class BB{constructor(A){if(!_A)throw new Error("Must invoke loadWASM first.");const B=[],Q=[];for(let g=0,E=A.length;gWebAssembly.instantiateStreaming(A,B)}(g):function(A){return async B=>{const Q=await A.arrayBuffer();return WebAssembly.instantiate(Q,B)}}(g):function(A){return B=>WebAssembly.instantiate(A,B)}(g)}return gB=new Promise(((A,B)=>{g=A,E=B})),function(A,B,Q,g){zA({print:B,instantiateWasm:(B,Q)=>{if("undefined"==typeof performance){const A=()=>Date.now();B.env.emscripten_get_now=A,B.wasi_snapshot_preview1.emscripten_get_now=A}return A(B).then((A=>Q(A.instance)),g),{}}}).then((A=>{_A=A,Q()}))}(B,Q,g,E),gB}function CB(A){return new AB(A)}function IB(A){return new BB(A)}function DB(A){const B=G[A];if(!B)return;const{id:Q}=N[B];return{id:Q,scopeName:B}}const wB=new Map;let oB,sB;async function eB(B){if(wB.has(B))return wB.get(B);const g=function(A){return N[A]}(B);if(!g)return Promise.resolve(void 0);let E;if(void 0===oB&&(E=A(g.id),oB=E.then((()=>!0)).catch((()=>!1))),void 0===sB&&(sB=await oB),sB){const Q=E||A(g.id);return wB.set(B,Q),Q}const C=Q(`grammars/${g.id}`);g.embeddedScopes.forEach((A=>{if(!wB.has(A)){const B=C.then((B=>null==B?void 0:B.find((B=>B.scopeName===A))));wB.set(A,B)}}));const I=C.then((A=>null==A?void 0:A.find((A=>A.scopeName===B))));return wB.set(B,I),I}const cB=30720,iB=16744448,tB=16775168,rB=11,aB=15,MB={NotSet:-1,None:0,Italic:1,Bold:2,Underline:4,Strikethrough:8};function hB(A,B,Q,g){const{tokens:E,ruleStack:C}=A.tokenizeLine2(Q,B),I=[];let D=Q.length;for(let A=E.length-2;A>=0;A-=2){const B=E[A],g=E[A+1],C=Q.slice(B,D);I.unshift({content:C,metadata:g}),D=B}let w=[];if(null==g?void 0:g.preserveWhitespace)w=I;else for(let A=0;A0?w[w.length-1].content+=B.content:A{const{rawTokens:E,nextStack:C}=hB(B,g,A,{preserveWhitespace:!0}),I=E.map((({content:A,metadata:B})=>({content:A,style:FB(B,Q)}))),D=function(A,B,Q,g){const{tokens:E}=Q.tokenizeLine(A,B),C=[];for(let B=0;B{if(w+=A.content.length,Q>>aB]},g=(A&cB)>>>rB;return g&MB.Italic&&(Q.fontStyle="italic"),g&MB.Bold&&(Q.fontWeight="bold"),g&MB.Underline&&(Q.textDecoration="underline"),g&MB.Strikethrough&&(Q.textDecoration="line-through"),Q}var GB=function(A){var B=null;if("undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node)B=Buffer.from(A,"base64");else{var Q=globalThis.atob(A),g=Q.length;B=new Uint8Array(new ArrayBuffer(g));for(var E=0;E({createOnigScanner:IB,createOnigString:CB})));NB=new VA({onigLib:A,loadGrammar:A=>eB(A)})}const B=A.filter((A=>!HB(A))).map((A=>{const B=DB(A);if(!B)throw new RB(A);return NB.loadGrammar(B.scopeName)}));return Promise.all(B)}function kB(A){if(HB(A))return{langId:A,grammar:null};const B=DB(A);if(!B)throw new RB(A);const Q=function(A){const{_syncRegistry:B}=NB;return null==B?void 0:B._grammars.get(A)}(B.scopeName);if(!Q)throw new Error(`Syntax highlighting error: grammar for ${A} not loaded`);return{langId:B.id,grammar:Q}}class RB extends Error{constructor(A){super(`Unknown language: ${A}`),this.alias=A}}function KB(A,B,Q){NB.setTheme(Q);const g=function(A){const B=NB.getColorMap();return A.colorNames?B.map((B=>Object.keys(A.colorNames).find((Q=>A.colorNames[Q].toUpperCase()===B.toUpperCase()))||B)):B}(Q);return function(A,B,Q){let g=null;return A.split(/\r?\n|\r/g).map((A=>{const{rawTokens:E,nextStack:C}=hB(B,g,A);return g=C,E.map((({content:A,metadata:B})=>({content:A,style:FB(B,Q)})))}))}(A,B,g)}function YB(A){return A.split(/\r?\n|\r/g).map((A=>[{content:A,style:{}}]))}function UB(A,B){return uB(A.slice(1,-1)).map((A=>{const{from:Q,to:g}=PB(A);return{lineNumber:B,fromColumn:Q,toColumn:g}}))}function PB(A){const[B,Q]=A.split(":");if(!yB(B))throw new JB(B);const g=Number(B);if(g<1)throw new pB;if(Q){if(!yB(Q))throw new JB(Q);return{from:g,to:+Q}}return{from:g,to:g}}function uB(A){return A.split(/,(?![^\[]*\])/g)}function yB(A){A=A.toString();var B=Math.abs(A),Q=parseInt(A,10);return!isNaN(B)&&Q===B&&B.toString()===A}class JB extends Error{constructor(A){super(`Invalid number "${A}" in range string`),this.number=A,Object.setPrototypeOf(this,new.target.prototype)}}class pB extends Error{constructor(){super("Invalid line or column number in range string"),Object.setPrototypeOf(this,new.target.prototype)}}const dB="#001",SB="#010",lB={name:"comments",type:"light",foreground:"",background:"",colors:{},settings:[{settings:{foreground:"#000"}},{scope:["punctuation.definition.comment"],settings:{foreground:dB}},{scope:"comment",settings:{foreground:SB}}]};function mB(A,B,Q,g){const E=B?KB(A,B,lB):YB(A),C=[];let I=1;const D=E.map((A=>{const{annotations:B,lineWithoutComments:E}=function(A,B,Q,g){if(g in fB&&A.some((A=>A.style.color===SB))){const B=fB[g];A=A.flatMap((A=>{if(A.style.color!==SB)return[A];const Q=A.content.trimStart();if(Q.startsWith(B)){const g=Q.slice(B.length),E=[{content:A.content.slice(0,A.content.length-g.length),style:{color:dB}}];return g.length&&E.push({content:g,style:A.style}),E}return[A]}))}if(!A.some((A=>A.style.color===dB)))return{annotations:[],lineWithoutComments:A};const E=[];let C=0;for(;C!A.tokens.includes(B)));I.every((A=>""===A.content.trim()))&&(I=null);return{annotations:E.map((A=>({name:A.name,query:A.query,lineNumber:A.lineNumber,rangeString:A.rangeString}))),lineWithoutComments:I}}(A,g,I,Q);if(C.push(...B),!E)return null;const D=E.map((A=>A.content)).join("");return["mdx","jsx","tsx"].includes(Q)&&B.length>0&&"{}"===D.trim()?null:(I++,D)})).filter((A=>null!==A)).join("\n"),w=C.map((A=>{var{rangeString:B,lineNumber:Q}=A,g=function(A,B){var Q={};for(var g in A)Object.prototype.hasOwnProperty.call(A,g)&&B.indexOf(g)<0&&(Q[g]=A[g]);if(null!=A&&"function"==typeof Object.getOwnPropertySymbols){var E=0;for(g=Object.getOwnPropertySymbols(A);EA.ranges.length>0));return{newCode:D,annotations:w}}const fB={"actionscript-3":"//",ada:"--",asm:"#",dart:"//",fsharp:"//",graphql:"#",http:"#",rust:"//",sparql:"#",wgsl:"//",jsonnet:"//",kql:"//",zenscript:"//",kusto:"//",turtle:"#",abap:"*",beancount:";",kotlin:"//",hlsl:"//",berry:"#",cypher:"//",elm:"--",nix:"#",viml:'"',solidity:"//",bat:"REM",shaderlab:"//",sas:"*",clarity:";;"};function xB(A,B,Q){return A&&A.startsWith("(/")?function(A,B,Q){const g=B.match(/\(\/([\s\S]*?)\/([gimuy]*)\)/);if(!g)throw new Error(`Invalid RegExp string: ${B}`);const E=new RegExp(g[1],g[2]),C=A.split(/\r?\n/).slice(Q-1).join("\n");if(!E.global){const A=E.exec(C);if(!A)return[];const B=C.slice(0,A.index).split("\n").length+Q-1;return[{fromLineNumber:B,toLineNumber:B+A[0].split("\n").length-1}]}let I;const D=[];for(;I=E.exec(C);){const A=C.slice(0,I.index).split("\n").length+Q-1,B=A+I[0].split("\n").length-1,g=D[D.length-1];g&&g.fromLineNumber===A||D.push({fromLineNumber:A,toLineNumber:B})}return D}(Q,A,B):A&&A.startsWith("[/")?function(A,B,Q){const g=B.match(/\[\/([\s\S]*?)\/([gimuy]*)\]/);if(!g)throw new Error(`Invalid RegExp string: ${B}`);let E=g[2]||"";E+="d";const C=new RegExp(g[1],E);let I=A.split(/\r?\n/);I=I.slice(Q-1),C.multiline||(I=[I[0]]);const D=[];return I.forEach(((A,B)=>{if(!C.global){if(D.length>0)return;const g=C.exec(A);if(!g)return;const E=g.indices[1]||g.indices[0];return void D.push({lineNumber:B+Q,fromColumn:E[0]+1,toColumn:E[1]})}let g;for(;g=C.exec(A);){const A=g.indices[1]||g.indices[0];D.push({lineNumber:B+Q,fromColumn:A[0]+1,toColumn:A[1]})}})),D}(Q,A,B):function(A,B){return A?A.startsWith("[")?UB(A,B):uB(A.slice(1,-1)).map((A=>{if(A.includes("[")){const[Q,g]=A.split("["),E=Number(Q),C=B+E-1;if(!yB(C))throw new JB(Q);return UB("["+g,C)}const{from:Q,to:g}=PB(A);return[{fromLineNumber:Q+B-1,toLineNumber:g+B-1}]})).flat():[{fromLineNumber:B,toLineNumber:B}]}(A,B)}function OB(A,B){var Q;const g=A.match(/\s*([\w-]+)?(\([^\)]*\)|\[[^\]]*\])?(.*)$/),E=g[1],C=g[2],I=null===(Q=g[3])||void 0===Q?void 0:Q.trim();return B.includes(E)?{name:E,rangeString:C,query:I}:null}function qB(A,B){let Q=[],g=1;return A.forEach((A=>{Q.push({fromColumn:g,toColumn:g+A.content.length-1,token:A}),g+=A.content.length})),B.forEach((A=>{Q=function(A,B){const{range:Q}=B,{fromColumn:g,toColumn:E}=Q,C=[];let I=0;for(;IE){const[A,Q]=WB(B,E+1);D.tokens.push(A),C.push(Q)}else D.tokens.push(B);I++}else C.push(D);for(;IbB(A)))}function bB(A){return"tokens"in A?{annotationName:A.annotationName,annotationQuery:A.annotationQuery,fromColumn:A.fromColumn,toColumn:A.toColumn,tokens:A.tokens.map((A=>bB(A)))}:A.token}function WB(A,B){if("token"in A){const Q=Object.assign(Object.assign({},A.token),{content:A.token.content.slice(0,B-A.fromColumn)}),g=Object.assign(Object.assign({},A.token),{content:A.token.content.slice(B-A.fromColumn)});return[Object.assign(Object.assign({},A),{toColumn:B-1,token:Q}),Object.assign(Object.assign({},A),{fromColumn:B,token:g})]}{const Q=[],g=[];A.tokens.forEach((A=>{if(A.toColumn=B)g.push(A);else{const[E,C]=WB(A,B);Q.push(E),g.push(C)}}));return[Object.assign(Object.assign({},A),{toColumn:B-1,tokens:Q}),Object.assign(Object.assign({},A),{fromColumn:B,tokens:g})]}}function TB(A,B){let Q=A.map(((A,B)=>({fromLineNumber:B+1,toLineNumber:B+1,line:A})));return B.forEach((A=>{Q=function(A,B){const{range:Q,name:g,query:E}=B,{fromLineNumber:C,toLineNumber:I}=Q,D=[];let w=0;for(;wI){const[A,Q]=XB(B,I+1);o.lines.push(A),D.push(Q)}else o.lines.push(B);w++}else D.push(o);for(;wvB(A)))}function vB(A){return"line"in A?{lineNumber:A.fromLineNumber,tokens:A.line.tokens}:{annotationName:A.annotationName,annotationQuery:A.annotationQuery,fromLineNumber:A.fromLineNumber,toLineNumber:A.toLineNumber,lines:A.lines.map((A=>vB(A)))}}function XB(A,B){if("line"in A)return[Object.assign(Object.assign({},A),{toLineNumber:B-1}),Object.assign(Object.assign({},A),{fromLineNumber:B})];{const Q=[],g=[];return A.lines.forEach((A=>{if(A.toLineNumber=B)g.push(A);else{const[E,C]=XB(A,B);Q.push(E),g.push(C)}})),[Object.assign(Object.assign({},A),{toLineNumber:B-1,lines:Q}),Object.assign(Object.assign({},A),{fromLineNumber:B,lines:g})]}}function ZB(A,B){const{inlineAnnotations:Q,multilineAnnotations:g}=function(A){const B=[],Q=[];return A.forEach((A=>{A.ranges.forEach((g=>{"lineNumber"in g?B.push(Object.assign(Object.assign({},A),{range:g})):Q.push(Object.assign(Object.assign({},A),{range:g}))}))})),{inlineAnnotations:B,multilineAnnotations:Q}}(B);return TB(A.map(((A,B)=>{const g=Q.filter((A=>A.range.lineNumber===B+1));return{lineNumber:B+1,tokens:qB(A,g)}})),g)}var jB=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],VB={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function zB(A,B){const Q=A.indexOf("[",B);if(-1!==Q){const B=A.indexOf("m",Q);return{sequence:A.substring(Q+2,B).split(";"),startPosition:Q,position:B+1}}return{position:A.length}}function _B(A,B){let Q=1;const g=A[B+Q++];let E;if("2"===g){const g=[A[B+Q++],A[B+Q++],A[B+Q]].map((A=>Number.parseInt(A)));3!==g.length||g.some((A=>Number.isNaN(A)))||(E={type:"rgb",rgb:g})}else if("5"===g){const g=Number.parseInt(A[B+Q]);Number.isNaN(g)||(E={type:"table",index:Number(g)})}return[Q,E]}function $B(A){const B=[];for(let Q=0;Q=90&&E<=97?B.push({type:"setForegroundColor",value:{type:"named",name:jB[E-90+8]}}):E>=100&&E<=107&&B.push({type:"setBackgroundColor",value:{type:"named",name:jB[E-100+8]}})}return B}function AQ(A,B){const Q=function(){let A=null,B=null,Q=new Set;return{parse(g){const E=[];let C=0;do{const I=zB(g,C),D=I.sequence?g.substring(C,I.startPosition):g.substring(C);if(D.length>0&&E.push({value:D,foreground:A,background:B,decorations:new Set(Q)}),I.sequence){const g=$B(I.sequence);for(const E of g)"resetAll"===E.type?(A=null,B=null,Q.clear()):"resetForegroundColor"===E.type?A=null:"resetBackgroundColor"===E.type?B=null:"resetDecoration"===E.type&&Q.delete(E.value);for(const E of g)"setForegroundColor"===E.type?A=E.value:"setBackgroundColor"===E.type?B=E.value:"setDecoration"===E.type&&Q.add(E.value)}C=I.position}while(Cfunction(A,B,Q){const g=A.parse(B),E=g.map((({value:A,foreground:B,background:g,decorations:E})=>{const C=BQ(B,Q),I={};C&&(I.color=C);const D=BQ(g,Q);return D&&(I.background=D),E.has("bold")&&(I.fontWeight="bold"),E.has("italic")&&(I.fontStyle="italic"),E.has("underline")&&(I.textDecoration="underline"),E.has("strikethrough")&&(I.textDecoration="line-through"),E.has("reverse")&&(I.color=D,I.background=C),E.has("dim")&&(I.opacity=.5),{content:A,style:I}}));return E}(Q,A,B)));return g}function BQ(A,B){if(A){if("named"===A.type){return o(B,"terminal.ansi"+(A.name[0].toUpperCase()+A.name.slice(1)))}if("rgb"===A.type){const[B,Q,g]=A.rgb;return`rgb(${B}, ${Q}, ${g})`}}}async function QQ(A,B){await Promise.all([LB(A),t(B)])}async function gQ(A,B,Q="dark-plus",g={}){const E=A||"",C=B||"text";if("string"!=typeof E)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof C)throw new Error("Syntax highlighter error: lang must be a string");return await QQ([C],Q),EQ(E,C,Q,g)}function EQ(A,B,Q="dark-plus",g={}){const E=A||"",C=B||"text";if("string"!=typeof E)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof C)throw new Error("Syntax highlighter error: lang must be a string");const{langId:I,grammar:D}=kB(C),s=r(Q),e="text"==I?YB(E):"terminal"==I?AQ(E,s):(null==g?void 0:g.scopes)?function(A,B,Q){return NB.setTheme(Q),nB(A,B,NB.getColorMap())}(E,D,s):KB(E,D,s),c="terminal"==I?function(A){return{color:o(A,"terminal.foreground"),background:o(A,"terminal.background"),colorScheme:w(A)}}(s):{color:s.foreground,background:s.background,colorScheme:w(s)};if(function(A){return"annotations"in A}(g)){return{lines:ZB(e,(null==g?void 0:g.annotations)||[]),lang:I,style:c}}return{lines:e,lang:I,style:c}}async function CQ(A,B,Q){if(!Q)return{code:A,annotations:[]};await LB([B]);const{grammar:g,langId:E}=kB(B),{newCode:C,annotations:I}=mB(A,g,E,Q);return{code:C,annotations:I}}async function IQ(A){if(!A)throw new Error("Syntax highlighter error: undefined theme");await QQ([],A);return n(r(A))}function DQ(A){if(!A)throw new Error("Syntax highlighter error: undefined theme");return n(r(A))}export{F as LANG_NAMES,M as THEME_NAMES,RB as UnknownLanguageError,h as UnknownThemeError,CQ as extractAnnotations,IQ as getThemeColors,DQ as getThemeColorsSync,gQ as highlight,EQ as highlightSync,QQ as preload}; diff --git a/lib/dist/worker.esm.mjs b/lib/dist/worker.esm.mjs index 2d28d69..65db4af 100644 --- a/lib/dist/worker.esm.mjs +++ b/lib/dist/worker.esm.mjs @@ -1 +1 @@ -import e from"./onig.wasm?module";async function t(e){throw new Error("no fs")}async function s(e){const t=await fetch(`https://lighter.codehike.org/${e}.json`);if(t.ok)return await t.json()}const r=e=>/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(e),o=(e,t)=>e.match(new RegExp(`.{${t}}`,"g")),n=e=>parseInt(e.repeat(2/e.length),16);function c(e,t){return void 0!==e?e/255:"number"!=typeof t||t<0||t>1?1:t}function i(e,t){if(!e)return e;const{r:s,g:i,b:a,a:u}=function(e){if(!e)return;if(!r(e))throw new Error("Invalid color string, must be a valid hex color");const t=Math.floor((e.length-1)/3),s=o(e.slice(1),t),[i,a,u,l]=s.map(n);return{r:i,g:a,b:u,a:c(l,1)}}(e);return function(e){if(!e)return;const{r:t,g:s,b:r,a:o}=e,n=Math.round(255*o);return`#${t.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}({r:s,g:i,b:a,a:u*t})}function a(e,t){const s=e.colors||{};if(s[t])return s[t];const r=l[t];if(!r)throw new Error(`Unknown theme color key: ${t}`);return"string"==typeof r?a(e,r):function(e,t){const s=t[e.type];if(Array.isArray(s)){const[t,r,...o]=s;return t(a(e,r),...o)}return s}(e,r)}const u="#6FC3DF",l={"editor.foreground":{dark:"#bbbbbb",light:"#333333",hc:"#ffffff"},"editorLineNumber.foreground":{dark:"#858585",light:"#237893",hc:"#fffffe"},"editor.selectionBackground":{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},"editor.background":{light:"#fffffe",dark:"#1E1E1E",hc:"#000000"},"editorGroupHeader.tabsBackground":{dark:"#252526",light:"#F3F3F3"},"tab.activeBackground":"editor.background","tab.activeForeground":{dark:"#ffffff",light:"#333333",hc:"#ffffff"},"tab.border":{dark:"#252526",light:"#F3F3F3",hc:u},"tab.activeBorder":"tab.activeBackground","tab.inactiveBackground":{dark:"#2D2D2D",light:"#ECECEC"},"tab.inactiveForeground":{dark:[i,"tab.activeForeground",.5],light:[i,"tab.activeForeground",.5],hc:"#ffffff"},"diffEditor.insertedTextBackground":{dark:"#9ccc2c33",light:"#9ccc2c40"},"diffEditor.removedTextBackground":{dark:"#ff000033",light:"#ff000033"},"diffEditor.insertedLineBackground":{dark:"#9bb95533",light:"#9bb95533"},"diffEditor.removedLineBackground":{dark:"#ff000033",light:"#ff000033"},"icon.foreground":{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},"sideBar.background":{dark:"#252526",light:"#F3F3F3",hc:"#000000"},"sideBar.foreground":"editor.foreground","sideBar.border":"sideBar.background","list.inactiveSelectionBackground":{dark:"#37373D",light:"#E4E6F1"},"list.inactiveSelectionForeground":{},"list.hoverBackground":{dark:"#2A2D2E",light:"#F0F0F0"},"list.hoverForeground":{},"editorGroupHeader.tabsBorder":{hc:u},"tab.activeBorderTop":{hc:u},"tab.hoverBackground":"tab.inactiveBackground","tab.hoverForeground":"tab.inactiveForeground","editor.rangeHighlightBackground":{dark:"#ffffff0b",light:"#fdff0033"},"editor.infoForeground":{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},"input.border":{hc:u},"input.background":{dark:"#3C3C3C",light:"#fffffe",hc:"#000000"},"input.foreground":"editor.foreground","editor.lineHighlightBackground":{},focusBorder:{light:"#0090F1",dark:"#007FD4",hc:u},"editorGroup.border":{dark:"#444444",light:"#E7E7E7",hc:u},"list.activeSelectionBackground":{dark:"#094771",light:"#0060C0",hc:"#000000"},"list.activeSelectionForeground":{dark:"#fffffe",light:"#fffffe",hc:"#fffffe"},"lighter.inlineBackground":{dark:[i,"editor.background",.9],light:[i,"editor.background",.9]},"terminal.background":"editor.background","terminal.foreground":"editor.foreground","terminal.ansiBlack":{dark:"#000000",light:"#000000",hc:"#000000"},"terminal.ansiRed":{dark:"#cd3131",light:"#cd3131",hc:"#cd0000"},"terminal.ansiGreen":{dark:"#0DBC79",light:"#00BC00",hc:"#00cd00"},"terminal.ansiYellow":{dark:"#e5e510",light:"#949800",hc:"#cdcd00"},"terminal.ansiBlue":{dark:"#2472c8",light:"#0451a5",hc:"#0000ee"},"terminal.ansiMagenta":{dark:"#bc3fbc",light:"#bc05bc",hc:"#cd00cd"},"terminal.ansiCyan":{dark:"#11a8cd",light:"#0598bc",hc:"#00cdcd"},"terminal.ansiWhite":{dark:"#e5e5e5",light:"#555555",hc:"#e5e5e5"},"terminal.ansiBrightBlack":{dark:"#666666",light:"#666666",hc:"#7f7f7f"},"terminal.ansiBrightRed":{dark:"#f14c4c",light:"#cd3131",hc:"#ff0000"},"terminal.ansiBrightGreen":{dark:"#23d18b",light:"#14CE14",hc:"#00ff00"},"terminal.ansiBrightYellow":{dark:"#f5f543",light:"#b5ba00",hc:"#ffff00"},"terminal.ansiBrightBlue":{dark:"#3b8eea",light:"#0451a5",hc:"#5c5cff"},"terminal.ansiBrightMagenta":{dark:"#d670d6",light:"#bc05bc",hc:"#ff00ff"},"terminal.ansiBrightCyan":{dark:"#29b8db",light:"#0598bc",hc:"#00ffff"},"terminal.ansiBrightWhite":{dark:"#e5e5e5",light:"#a5a5a5",hc:"#ffffff"}},d=new Map,h=new Map;async function p(e){if("string"==typeof e){const t=e;if(!g.includes(t))throw new b(t);if(!d.has(t)){const e=async function(e){try{return await async function(e){throw new Error("no fs")}()}catch(t){return await s(`themes/${e}`)}}(t).then((e=>(h.set(t,e),e)));d.set(t,e)}return d.get(t)}return e}function m(e){let t=null;if("string"==typeof e){if(t=h.get(e),!t)throw new Error("Syntax highlighting error: theme not loaded")}else t=e;return function(e){if(!e)return;const t=e.settings||e.tokenColors||[],s={name:e.name||"unknown-theme",type:f(e),foreground:"",background:"",settings:t,colors:e.colors||{},colorNames:e.colorNames},r=t.find((e=>!e.scope));if(r){const{foreground:e,background:t}=(null==r?void 0:r.settings)||{},o={};e&&!s.colors["editor.foreground"]&&(o["editor.foreground"]=e),t&&!s.colors["editor.background"]&&(o["editor.background"]=t),Object.keys(o).length>0&&(s.colors=Object.assign(Object.assign({},s.colors),o)),s.foreground=e,s.background=t}r||(s.settings=[{settings:{foreground:a(s,"editor.foreground"),background:a(s,"editor.background")}},...s.settings]);if(s.background=s.background||a(s,"editor.background"),s.foreground=s.foreground||a(s,"editor.foreground"),"from-css"===e.type&&!s.colorNames){const e={};let t=0;s.settings=s.settings.map((s=>{const r=Object.assign(Object.assign({},s),{settings:Object.assign({},s.settings)}),{foreground:o,background:n}=r.settings||{};return o&&!e[o]&&(e[o]=`#${t.toString(16).padStart(6,"0")}`,t++),n&&!e[n]&&(e[n]=`#${t.toString(16).padStart(6,"0")}`,t++),o&&(r.settings.foreground=e[o]),n&&(r.settings.background=e[n]),r})),s.colorNames=e}return s}(t)}function f(e){var t;if("from-css"===e.type)return"from-css";return"light"===(e.type?e.type:(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes("light"))?"light":"dark")?"light":"dark"}const g=["dark-plus","dracula-soft","dracula","github-dark","github-dark-dimmed","github-from-css","github-light","light-plus","material-darker","material-default","material-from-css","material-lighter","material-ocean","material-palenight","min-dark","min-light","monokai","nord","one-dark-pro","poimandres","slack-dark","slack-ochin","solarized-dark","solarized-light"];class b extends Error{constructor(e){super(`Unknown theme: ${e}`),this.theme=e}}function y(e){const t=t=>"colorScheme"===t?function(e){return"from-css"===e.type?"var(--ch-0)":e.type}(e):"foreground"===t?e.foreground:"background"===t?e.background:a(e,t);return{colorScheme:t("colorScheme"),foreground:t("foreground"),background:t("background"),lighter:{inlineBackground:t("lighter.inlineBackground")},editor:{background:t("editor.background"),foreground:t("editor.foreground"),lineHighlightBackground:t("editor.lineHighlightBackground"),rangeHighlightBackground:t("editor.rangeHighlightBackground"),infoForeground:t("editor.infoForeground"),selectionBackground:t("editor.selectionBackground")},focusBorder:t("focusBorder"),tab:{activeBackground:t("tab.activeBackground"),activeForeground:t("tab.activeForeground"),inactiveBackground:t("tab.inactiveBackground"),inactiveForeground:t("tab.inactiveForeground"),border:t("tab.border"),activeBorder:t("tab.activeBorder"),activeBorderTop:t("tab.activeBorderTop")},editorGroup:{border:t("editorGroup.border")},editorGroupHeader:{tabsBackground:t("editorGroupHeader.tabsBackground")},editorLineNumber:{foreground:t("editorLineNumber.foreground")},input:{background:t("input.background"),foreground:t("input.foreground"),border:t("input.border")},icon:{foreground:t("icon.foreground")},sideBar:{background:t("sideBar.background"),foreground:t("sideBar.foreground"),border:t("sideBar.border")},list:{activeSelectionBackground:t("list.activeSelectionBackground"),activeSelectionForeground:t("list.activeSelectionForeground"),hoverBackground:t("list.hoverBackground"),hoverForeground:t("list.hoverForeground")}}}const _=["abap","actionscript-3","ada","adoc","angular-html","angular-ts","apache","apex","apl","applescript","ara","asciidoc","asm","astro","awk","ballerina","bash","bat","batch","be","beancount","berry","bibtex","bicep","blade","c","c#","c++","cadence","cdc","clarity","clj","clojure","closure-templates","cmake","cmd","cobol","codeowners","codeql","coffee","coffeescript","common-lisp","console","cpp","cql","crystal","cs","csharp","css","csv","cue","cypher","d","dart","dax","desktop","diff","docker","dockerfile","dotenv","dream-maker","edge","elisp","elixir","elm","emacs-lisp","erb","erl","erlang","f","f#","f03","f08","f18","f77","f90","f95","fennel","fish","fluent","for","fortran-fixed-form","fortran-free-form","fs","fsharp","fsl","ftl","gdresource","gdscript","gdshader","genie","gherkin","git-commit","git-rebase","gjs","gleam","glimmer-js","glimmer-ts","glsl","gnuplot","go","gql","graphql","groovy","gts","hack","haml","handlebars","haskell","haxe","hbs","hcl","hjson","hlsl","hs","html","html-derivative","http","hxml","hy","imba","ini","jade","java","javascript","jinja","jison","jl","js","json","json5","jsonc","jsonl","jsonnet","jssm","jsx","julia","kotlin","kql","kt","kts","kusto","latex","lean","lean4","less","liquid","lisp","lit","log","logo","lua","luau","make","makefile","markdown","marko","matlab","md","mdc","mdx","mediawiki","mermaid","mojo","move","nar","narrat","nextflow","nf","nginx","nim","nix","nu","nushell","objc","objective-c","objective-cpp","ocaml","pascal","perl","perl6","php","plsql","po","postcss","pot","potx","powerquery","powershell","prisma","prolog","properties","proto","ps","ps1","pug","puppet","purescript","py","python","ql","qml","qmldir","qss","r","racket","raku","razor","rb","reg","regex","regexp","rel","riscv","rs","rst","ruby","rust","sas","sass","scala","scheme","scss","sh","shader","shaderlab","shell","shellscript","shellsession","smalltalk","solidity","soy","sparql","spl","splunk","sql","ssh-config","stata","styl","stylus","svelte","swift","system-verilog","systemd","tasl","tcl","templ","terminal","terraform","tex","text","tf","tfvars","toml","ts","ts-tags","tsp","tsv","tsx","turtle","twig","txt","typ","typescript","typespec","typst","v","vala","vb","verilog","vhdl","vim","viml","vimscript","vue","vue-html","vy","vyper","wasm","wenyan","wgsl","wiki","wikitext","wl","wolfram","xml","xsl","yaml","yml","zenscript","zig","zsh","文言"],k={abap:"source.abap","actionscript-3":"source.actionscript.3",ada:"source.ada","angular-html":"text.html.derivative.ng","angular-ts":"source.ts.ng",apache:"source.apacheconf",apex:"source.apex",apl:"source.apl",applescript:"source.applescript",ara:"source.ara",asciidoc:"text.asciidoc",adoc:"text.asciidoc",asm:"source.asm.x86_64",astro:"source.astro",awk:"source.awk",ballerina:"source.ballerina",bat:"source.batchfile",batch:"source.batchfile",beancount:"text.beancount",berry:"source.berry",be:"source.berry",bibtex:"text.bibtex",bicep:"source.bicep",blade:"text.html.php.blade",c:"source.c",cadence:"source.cadence",cdc:"source.cadence",clarity:"source.clar",clojure:"source.clojure",clj:"source.clojure",cmake:"source.cmake",cobol:"source.cobol",codeowners:"text.codeowners",codeql:"source.ql",ql:"source.ql",coffee:"source.coffee",coffeescript:"source.coffee","common-lisp":"source.commonlisp",lisp:"source.commonlisp",cpp:"source.cpp","c++":"source.cpp",crystal:"source.crystal",csharp:"source.cs","c#":"source.cs",cs:"source.cs",css:"source.css",csv:"text.csv",cue:"source.cue",cypher:"source.cypher",cql:"source.cypher",d:"source.d",dart:"source.dart",dax:"source.dax",desktop:"source.desktop",diff:"source.diff",docker:"source.dockerfile",dockerfile:"source.dockerfile",dotenv:"source.dotenv","dream-maker":"source.dm",edge:"text.html.edge",elixir:"source.elixir",elm:"source.elm","emacs-lisp":"source.emacs.lisp",elisp:"source.emacs.lisp",erb:"text.html.erb",erlang:"source.erlang",erl:"source.erlang",fennel:"source.fnl",fish:"source.fish",fluent:"source.ftl",ftl:"source.ftl","fortran-fixed-form":"source.fortran.fixed",f:"source.fortran.fixed",for:"source.fortran.fixed",f77:"source.fortran.fixed","fortran-free-form":"source.fortran.free",f90:"source.fortran.free",f95:"source.fortran.free",f03:"source.fortran.free",f08:"source.fortran.free",f18:"source.fortran.free",fsharp:"source.fsharp","f#":"source.fsharp",fs:"source.fsharp",gdresource:"source.gdresource",gdscript:"source.gdscript",gdshader:"source.gdshader",genie:"source.genie",gherkin:"text.gherkin.feature","git-commit":"text.git-commit","git-rebase":"text.git-rebase",gleam:"source.gleam","glimmer-js":"source.gjs",gjs:"source.gjs","glimmer-ts":"source.gts",gts:"source.gts",glsl:"source.glsl",gnuplot:"source.gnuplot",go:"source.go",graphql:"source.graphql",gql:"source.graphql",groovy:"source.groovy",hack:"source.hack",haml:"text.haml",handlebars:"text.html.handlebars",hbs:"text.html.handlebars",haskell:"source.haskell",hs:"source.haskell",haxe:"source.hx",hcl:"source.hcl",hjson:"source.hjson",hlsl:"source.hlsl",html:"text.html.basic","html-derivative":"text.html.derivative",http:"source.http",hxml:"source.hxml",hy:"source.hy",imba:"source.imba",ini:"source.ini",properties:"source.ini",java:"source.java",javascript:"source.js",js:"source.js",jinja:"source.jinja",jison:"source.jison",json:"source.json",json5:"source.json5",jsonc:"source.json.comments",jsonl:"source.json.lines",jsonnet:"source.jsonnet",jssm:"source.jssm",fsl:"source.jssm",jsx:"source.js.jsx",julia:"source.julia",jl:"source.julia",kotlin:"source.kotlin",kt:"source.kotlin",kts:"source.kotlin",kusto:"source.kusto",kql:"source.kusto",latex:"text.tex.latex",lean:"source.lean4",lean4:"source.lean4",less:"source.css.less",liquid:"text.html.liquid",log:"text.log",logo:"source.logo",lua:"source.lua",luau:"source.luau",make:"source.makefile",makefile:"source.makefile",markdown:"text.html.markdown",md:"text.html.markdown",marko:"text.marko",matlab:"source.matlab",mdc:"text.markdown.mdc",mdx:"source.mdx",mermaid:"markdown.mermaid.codeblock",mojo:"source.mojo",move:"source.move",narrat:"source.narrat",nar:"source.narrat",nextflow:"source.nextflow",nf:"source.nextflow",nginx:"source.nginx",nim:"source.nim",nix:"source.nix",nushell:"source.nushell",nu:"source.nushell","objective-c":"source.objc",objc:"source.objc","objective-cpp":"source.objcpp",ocaml:"source.ocaml",pascal:"source.pascal",perl:"source.perl",php:"source.php",plsql:"source.plsql.oracle",po:"source.po",pot:"source.po",potx:"source.po",postcss:"source.css.postcss",powerquery:"source.powerquery",powershell:"source.powershell",ps:"source.powershell",ps1:"source.powershell",prisma:"source.prisma",prolog:"source.prolog",proto:"source.proto",pug:"text.pug",jade:"text.pug",puppet:"source.puppet",purescript:"source.purescript",python:"source.python",py:"source.python",qml:"source.qml",qmldir:"source.qmldir",qss:"source.qss",r:"source.r",racket:"source.racket",raku:"source.perl.6",perl6:"source.perl.6",razor:"text.aspnetcorerazor",reg:"source.reg",regexp:"source.regexp.python",regex:"source.regexp.python",rel:"source.rel",riscv:"source.riscv",rst:"source.rst",ruby:"source.ruby",rb:"source.ruby",rust:"source.rust",rs:"source.rust",sas:"source.sas",sass:"source.sass",scala:"source.scala",scheme:"source.scheme",scss:"source.css.scss",shaderlab:"source.shaderlab",shader:"source.shaderlab",shellscript:"source.shell",bash:"source.shell",sh:"source.shell",shell:"source.shell",zsh:"source.shell",shellsession:"text.shell-session",console:"text.shell-session",smalltalk:"source.smalltalk",solidity:"source.solidity",soy:"text.html.soy","closure-templates":"text.html.soy",sparql:"source.sparql",splunk:"source.splunk_search",spl:"source.splunk_search",sql:"source.sql","ssh-config":"source.ssh-config",stata:"source.stata",stylus:"source.stylus",styl:"source.stylus",svelte:"source.svelte",swift:"source.swift","system-verilog":"source.systemverilog",systemd:"source.systemd",tasl:"source.tasl",tcl:"source.tcl",templ:"source.templ",terraform:"source.hcl.terraform",tf:"source.hcl.terraform",tfvars:"source.hcl.terraform",tex:"text.tex",toml:"source.toml","ts-tags":"source.ts.tags",lit:"source.ts.tags",tsv:"text.tsv",tsx:"source.tsx",turtle:"source.turtle",twig:"text.html.twig",txt:"source.txt",typescript:"source.ts",ts:"source.ts",typespec:"source.tsp",tsp:"source.tsp",typst:"source.typst",typ:"source.typst",v:"source.v",vala:"source.vala",vb:"source.asp.vb.net",cmd:"source.asp.vb.net",verilog:"source.verilog",vhdl:"source.vhdl",viml:"source.viml",vim:"source.viml",vimscript:"source.viml",vue:"source.vue","vue-html":"text.html.vue-html",vyper:"source.vyper",vy:"source.vyper",wasm:"source.wat",wenyan:"source.wenyan","文言":"source.wenyan",wgsl:"source.wgsl",wikitext:"source.wikitext",mediawiki:"source.wikitext",wiki:"source.wikitext",wolfram:"source.wolfram",wl:"source.wolfram",xml:"text.xml",xsl:"text.xml.xsl",yaml:"source.yaml",yml:"source.yaml",zenscript:"source.zenscript",zig:"source.zig"},S={"source.abap":{id:"abap",embeddedScopes:[]},"source.actionscript.3":{id:"actionscript-3",embeddedScopes:[]},"source.ada":{id:"ada",embeddedScopes:[]},"text.html.derivative.ng":{id:"angular-html",embeddedScopes:["text.html.basic"]},"source.ts.ng":{id:"angular-ts",embeddedScopes:[]},"source.apacheconf":{id:"apache",embeddedScopes:[]},"source.apex":{id:"apex",embeddedScopes:[]},"source.apl":{id:"apl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.json"]},"source.applescript":{id:"applescript",embeddedScopes:[]},"source.ara":{id:"ara",embeddedScopes:[]},"text.asciidoc":{id:"asciidoc",embeddedScopes:["text.html.basic","source.yaml","text.csv","source.c","source.clojure","source.coffee","source.cpp","source.css","source.cs","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.groovy","source.haskell","source.java","source.js","source.json","source.js.jsx","source.julia","source.kotlin","source.css.less","source.makefile","source.objc","source.ocaml","source.perl","source.python","source.r","source.ruby","source.rust","source.sass","source.scala","source.css.scss","source.shell","source.sql","source.swift","source.toml","source.ts","text.xml"]},"source.asm.x86_64":{id:"asm",embeddedScopes:[]},"source.astro":{id:"astro",embeddedScopes:["source.json","source.js","source.ts","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","source.tsx"]},"source.awk":{id:"awk",embeddedScopes:[]},"source.ballerina":{id:"ballerina",embeddedScopes:[]},"source.batchfile":{id:"bat",embeddedScopes:[]},"text.beancount":{id:"beancount",embeddedScopes:[]},"source.berry":{id:"berry",embeddedScopes:[]},"text.bibtex":{id:"bibtex",embeddedScopes:[]},"source.bicep":{id:"bicep",embeddedScopes:[]},"text.html.php.blade":{id:"blade",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.c":{id:"c",embeddedScopes:[]},"source.cadence":{id:"cadence",embeddedScopes:[]},"source.clar":{id:"clarity",embeddedScopes:[]},"source.clojure":{id:"clojure",embeddedScopes:[]},"source.cmake":{id:"cmake",embeddedScopes:[]},"source.cobol":{id:"cobol",embeddedScopes:["source.sql","text.html.basic","source.java"]},"text.codeowners":{id:"codeowners",embeddedScopes:[]},"source.ql":{id:"codeql",embeddedScopes:[]},"source.coffee":{id:"coffee",embeddedScopes:["source.js"]},"source.commonlisp":{id:"common-lisp",embeddedScopes:[]},"source.cpp":{id:"cpp",embeddedScopes:["source.regexp.python","source.glsl","source.sql"]},"source.crystal":{id:"crystal",embeddedScopes:["text.html.basic","source.sql","source.css","source.c","source.js","source.shell"]},"source.cs":{id:"csharp",embeddedScopes:[]},"source.css":{id:"css",embeddedScopes:[]},"text.csv":{id:"csv",embeddedScopes:[]},"source.cue":{id:"cue",embeddedScopes:[]},"source.cypher":{id:"cypher",embeddedScopes:[]},"source.d":{id:"d",embeddedScopes:[]},"source.dart":{id:"dart",embeddedScopes:[]},"source.dax":{id:"dax",embeddedScopes:[]},"source.desktop":{id:"desktop",embeddedScopes:[]},"source.diff":{id:"diff",embeddedScopes:[]},"source.dockerfile":{id:"docker",embeddedScopes:[]},"source.dotenv":{id:"dotenv",embeddedScopes:[]},"source.dm":{id:"dream-maker",embeddedScopes:[]},"text.html.edge":{id:"edge",embeddedScopes:["source.ts","text.html.basic","text.html.derivative"]},"source.elixir":{id:"elixir",embeddedScopes:["text.html.basic"]},"source.elm":{id:"elm",embeddedScopes:["source.glsl"]},"source.emacs.lisp":{id:"emacs-lisp",embeddedScopes:[]},"text.html.erb":{id:"erb",embeddedScopes:["text.html.basic","source.ruby"]},"source.erlang":{id:"erlang",embeddedScopes:[]},"source.fnl":{id:"fennel",embeddedScopes:[]},"source.fish":{id:"fish",embeddedScopes:[]},"source.ftl":{id:"fluent",embeddedScopes:[]},"source.fortran.fixed":{id:"fortran-fixed-form",embeddedScopes:["source.fortran.free"]},"source.fortran.free":{id:"fortran-free-form",embeddedScopes:[]},"source.fsharp":{id:"fsharp",embeddedScopes:["text.html.markdown"]},"source.gdresource":{id:"gdresource",embeddedScopes:["source.gdshader","source.gdscript"]},"source.gdscript":{id:"gdscript",embeddedScopes:[]},"source.gdshader":{id:"gdshader",embeddedScopes:[]},"source.genie":{id:"genie",embeddedScopes:[]},"text.gherkin.feature":{id:"gherkin",embeddedScopes:[]},"text.git-commit":{id:"git-commit",embeddedScopes:["source.diff"]},"text.git-rebase":{id:"git-rebase",embeddedScopes:["source.shell"]},"source.gleam":{id:"gleam",embeddedScopes:[]},"source.gjs":{id:"glimmer-js",embeddedScopes:["source.js","source.ts","source.css","text.html.basic"]},"source.gts":{id:"glimmer-ts",embeddedScopes:["source.ts","source.css","source.js","text.html.basic"]},"source.glsl":{id:"glsl",embeddedScopes:["source.c"]},"source.gnuplot":{id:"gnuplot",embeddedScopes:[]},"source.go":{id:"go",embeddedScopes:[]},"source.graphql":{id:"graphql",embeddedScopes:["source.js","source.ts","source.js.jsx","source.tsx"]},"source.groovy":{id:"groovy",embeddedScopes:[]},"source.hack":{id:"hack",embeddedScopes:["text.html.basic","source.sql"]},"text.haml":{id:"haml",embeddedScopes:["source.ruby","source.js","source.sass","source.coffee","text.html.markdown","source.css"]},"text.html.handlebars":{id:"handlebars",embeddedScopes:["text.html.basic","source.css","source.js","source.yaml"]},"source.haskell":{id:"haskell",embeddedScopes:[]},"source.hx":{id:"haxe",embeddedScopes:[]},"source.hcl":{id:"hcl",embeddedScopes:[]},"source.hjson":{id:"hjson",embeddedScopes:[]},"source.hlsl":{id:"hlsl",embeddedScopes:[]},"text.html.basic":{id:"html",embeddedScopes:["source.js","source.css"]},"text.html.derivative":{id:"html-derivative",embeddedScopes:["text.html.basic"]},"source.http":{id:"http",embeddedScopes:["source.shell","source.json","text.xml","source.graphql"]},"source.hxml":{id:"hxml",embeddedScopes:["source.hx"]},"source.hy":{id:"hy",embeddedScopes:[]},"source.imba":{id:"imba",embeddedScopes:["source.ts"]},"source.ini":{id:"ini",embeddedScopes:[]},"source.java":{id:"java",embeddedScopes:[]},"source.js":{id:"javascript",embeddedScopes:[]},"source.jinja":{id:"jinja",embeddedScopes:[]},"source.jison":{id:"jison",embeddedScopes:["source.js"]},"source.json":{id:"json",embeddedScopes:[]},"source.json5":{id:"json5",embeddedScopes:[]},"source.json.comments":{id:"jsonc",embeddedScopes:[]},"source.json.lines":{id:"jsonl",embeddedScopes:[]},"source.jsonnet":{id:"jsonnet",embeddedScopes:[]},"source.jssm":{id:"jssm",embeddedScopes:[]},"source.js.jsx":{id:"jsx",embeddedScopes:[]},"source.julia":{id:"julia",embeddedScopes:["source.cpp","source.python","source.js","source.r","source.sql"]},"source.kotlin":{id:"kotlin",embeddedScopes:[]},"source.kusto":{id:"kusto",embeddedScopes:[]},"text.tex.latex":{id:"latex",embeddedScopes:["text.tex","source.shell","source.css","source.gnuplot","source.haskell","text.html.basic","source.java","source.julia","source.js","source.lua","source.python","source.ruby","source.rust","source.ts","text.xml","source.yaml","source.scala"]},"source.lean4":{id:"lean",embeddedScopes:[]},"source.css.less":{id:"less",embeddedScopes:[]},"text.html.liquid":{id:"liquid",embeddedScopes:["text.html.basic","source.css","source.json","source.js"]},"text.log":{id:"log",embeddedScopes:[]},"source.logo":{id:"logo",embeddedScopes:[]},"source.lua":{id:"lua",embeddedScopes:["source.c"]},"source.luau":{id:"luau",embeddedScopes:[]},"source.makefile":{id:"make",embeddedScopes:[]},"text.html.markdown":{id:"markdown",embeddedScopes:["source.css","text.html.basic","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","text.git-commit","text.git-rebase","source.go","source.groovy","text.pug","source.js","source.json","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.regexp.python","source.rust","source.scala","source.shell","source.ts","source.tsx","source.cs","source.fsharp","source.dart","text.html.handlebars","text.log","source.erlang","source.elixir","text.tex.latex","text.bibtex","text.html.derivative"]},"text.marko":{id:"marko",embeddedScopes:["source.css","source.css.less","source.css.scss","source.js"]},"source.matlab":{id:"matlab",embeddedScopes:[]},"text.markdown.mdc":{id:"mdc",embeddedScopes:["text.html.markdown","source.yaml","text.html.derivative"]},"source.mdx":{id:"mdx",embeddedScopes:["source.tsx","source.toml","source.yaml","source.c","source.clojure","source.coffee","source.cpp","source.cs","source.css","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.graphql","source.haskell","text.html.basic","source.ini","source.java","source.js","source.json","source.julia","source.kotlin","source.css.less","source.lua","source.makefile","text.html.markdown","source.objc","source.perl","source.python","source.r","source.ruby","source.rust","source.scala","source.css.scss","source.shell","text.shell-session","source.sql","text.xml","source.swift","source.ts"]},"markdown.mermaid.codeblock":{id:"mermaid",embeddedScopes:[]},"source.mojo":{id:"mojo",embeddedScopes:[]},"source.move":{id:"move",embeddedScopes:[]},"source.narrat":{id:"narrat",embeddedScopes:[]},"source.nextflow":{id:"nextflow",embeddedScopes:[]},"source.nginx":{id:"nginx",embeddedScopes:["source.lua"]},"source.nim":{id:"nim",embeddedScopes:["source.c","text.html.basic","text.xml","source.js","source.css","source.glsl","text.html.markdown"]},"source.nix":{id:"nix",embeddedScopes:[]},"source.nushell":{id:"nushell",embeddedScopes:[]},"source.objc":{id:"objective-c",embeddedScopes:[]},"source.objcpp":{id:"objective-cpp",embeddedScopes:[]},"source.ocaml":{id:"ocaml",embeddedScopes:[]},"source.pascal":{id:"pascal",embeddedScopes:[]},"source.perl":{id:"perl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.sql"]},"source.php":{id:"php",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.plsql.oracle":{id:"plsql",embeddedScopes:[]},"source.po":{id:"po",embeddedScopes:[]},"source.css.postcss":{id:"postcss",embeddedScopes:[]},"source.powerquery":{id:"powerquery",embeddedScopes:[]},"source.powershell":{id:"powershell",embeddedScopes:[]},"source.prisma":{id:"prisma",embeddedScopes:[]},"source.prolog":{id:"prolog",embeddedScopes:[]},"source.proto":{id:"proto",embeddedScopes:[]},"text.pug":{id:"pug",embeddedScopes:["source.js","source.css","source.sass","source.css.scss","source.stylus","source.coffee","text.html.basic"]},"source.puppet":{id:"puppet",embeddedScopes:[]},"source.purescript":{id:"purescript",embeddedScopes:[]},"source.python":{id:"python",embeddedScopes:[]},"source.qml":{id:"qml",embeddedScopes:["source.js"]},"source.qmldir":{id:"qmldir",embeddedScopes:[]},"source.qss":{id:"qss",embeddedScopes:[]},"source.r":{id:"r",embeddedScopes:[]},"source.racket":{id:"racket",embeddedScopes:[]},"source.perl.6":{id:"raku",embeddedScopes:[]},"text.aspnetcorerazor":{id:"razor",embeddedScopes:["text.html.basic","source.cs"]},"source.reg":{id:"reg",embeddedScopes:[]},"source.regexp.python":{id:"regexp",embeddedScopes:[]},"source.rel":{id:"rel",embeddedScopes:[]},"source.riscv":{id:"riscv",embeddedScopes:[]},"source.rst":{id:"rst",embeddedScopes:["text.html.derivative","source.cpp","source.python","source.js","source.shell","source.yaml","source.cmake","source.ruby"]},"source.ruby":{id:"ruby",embeddedScopes:["text.html.basic","text.xml","source.sql","source.css","source.c","source.js","source.shell","source.lua"]},"source.rust":{id:"rust",embeddedScopes:[]},"source.sas":{id:"sas",embeddedScopes:["source.sql"]},"source.sass":{id:"sass",embeddedScopes:[]},"source.scala":{id:"scala",embeddedScopes:[]},"source.scheme":{id:"scheme",embeddedScopes:[]},"source.css.scss":{id:"scss",embeddedScopes:["source.css"]},"source.shaderlab":{id:"shaderlab",embeddedScopes:["source.hlsl"]},"source.shell":{id:"shellscript",embeddedScopes:[]},"text.shell-session":{id:"shellsession",embeddedScopes:["source.shell"]},"source.smalltalk":{id:"smalltalk",embeddedScopes:[]},"source.solidity":{id:"solidity",embeddedScopes:[]},"text.html.soy":{id:"soy",embeddedScopes:["text.html.basic"]},"source.sparql":{id:"sparql",embeddedScopes:["source.turtle"]},"source.splunk_search":{id:"splunk",embeddedScopes:[]},"source.sql":{id:"sql",embeddedScopes:[]},"source.ssh-config":{id:"ssh-config",embeddedScopes:[]},"source.stata":{id:"stata",embeddedScopes:["source.sql"]},"source.stylus":{id:"stylus",embeddedScopes:[]},"source.svelte":{id:"svelte",embeddedScopes:["source.js","source.ts","source.coffee","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","text.pug","text.html.markdown"]},"source.swift":{id:"swift",embeddedScopes:[]},"source.systemverilog":{id:"system-verilog",embeddedScopes:[]},"source.systemd":{id:"systemd",embeddedScopes:[]},"source.tasl":{id:"tasl",embeddedScopes:[]},"source.tcl":{id:"tcl",embeddedScopes:[]},"source.templ":{id:"templ",embeddedScopes:["source.go","source.js","source.css"]},"source.hcl.terraform":{id:"terraform",embeddedScopes:[]},"text.tex":{id:"tex",embeddedScopes:["source.r"]},"source.toml":{id:"toml",embeddedScopes:[]},"source.ts.tags":{id:"ts-tags",embeddedScopes:["source.ts"]},"text.tsv":{id:"tsv",embeddedScopes:[]},"source.tsx":{id:"tsx",embeddedScopes:[]},"source.turtle":{id:"turtle",embeddedScopes:[]},"text.html.twig":{id:"twig",embeddedScopes:["source.css","source.js","source.css.scss","source.php","source.python","source.ruby"]},"source.txt":{id:"txt",embeddedScopes:[]},"source.ts":{id:"typescript",embeddedScopes:[]},"source.tsp":{id:"typespec",embeddedScopes:[]},"source.typst":{id:"typst",embeddedScopes:[]},"source.v":{id:"v",embeddedScopes:[]},"source.vala":{id:"vala",embeddedScopes:[]},"source.asp.vb.net":{id:"vb",embeddedScopes:[]},"source.verilog":{id:"verilog",embeddedScopes:[]},"source.vhdl":{id:"vhdl",embeddedScopes:[]},"source.viml":{id:"viml",embeddedScopes:[]},"source.vue":{id:"vue",embeddedScopes:["text.html.basic","text.html.markdown","text.pug","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.js","source.ts","source.js.jsx","source.tsx","source.coffee","source.json","source.json.comments","source.json5","source.yaml","source.toml","source.graphql","text.html.derivative"]},"text.html.vue-html":{id:"vue-html",embeddedScopes:["source.vue","source.js"]},"source.vyper":{id:"vyper",embeddedScopes:[]},"source.wat":{id:"wasm",embeddedScopes:[]},"source.wenyan":{id:"wenyan",embeddedScopes:[]},"source.wgsl":{id:"wgsl",embeddedScopes:[]},"source.wikitext":{id:"wikitext",embeddedScopes:["text.html.basic","source.css","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","source.go","source.groovy","text.pug","source.js","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.rust","source.scala","source.shell","source.ts","source.cs","source.fsharp","source.dart","text.html.handlebars","text.html.markdown","source.erlang","source.elixir","text.tex.latex","text.bibtex","source.json"]},"source.wolfram":{id:"wolfram",embeddedScopes:[]},"text.xml":{id:"xml",embeddedScopes:["source.java"]},"text.xml.xsl":{id:"xsl",embeddedScopes:["text.xml"]},"source.yaml":{id:"yaml",embeddedScopes:[]},"source.zenscript":{id:"zenscript",embeddedScopes:[]},"source.zig":{id:"zig",embeddedScopes:[]}};var x={d:(e,t)=>{for(var s in t)x.o(t,s)&&!x.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},w={};x.d(w,{_X:()=>Qe,Bz:()=>He,ot:()=>ze,u:()=>De,jG:()=>N,Pn:()=>Ke});const v="undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG;var C;function j(e,t){const s=[],r=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,s=t.exec(e);return{next:()=>{if(!s)return null;const r=s[0];return s=t.exec(e),r}}}(e);let o=r.next();for(;null!==o;){let e=0;if(2===o.length&&":"===o.charAt(1)){switch(o.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let t=c();if(s.push({matcher:t,priority:e}),","!==o)break;o=r.next()}return s;function n(){if("-"===o){o=r.next();const e=n();return t=>!!e&&!e(t)}if("("===o){o=r.next();const e=function(){const e=[];let t=c();for(;t&&(e.push(t),"|"===o||","===o);){do{o=r.next()}while("|"===o||","===o);t=c()}return t=>e.some((e=>e(t)))}();return")"===o&&(o=r.next()),e}if(A(o)){const e=[];do{e.push(o),o=r.next()}while(A(o));return s=>t(e,s)}return null}function c(){const e=[];let t=n();for(;t;)e.push(t),t=n();return t=>e.every((e=>e(t)))}}function A(e){return!!e&&!!e.match(/[\w\.:]+/)}function N(e){"function"==typeof e.dispose&&e.dispose()}function P(e){return Array.isArray(e)?function(e){let t=[];for(let s=0,r=e.length;s{for(let s in t)e[s]=t[s]})),e}function E(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t==e.length-1?E(e.substring(0,e.length-1)):e.substr(1+~t)}!function(e){e.toBinaryStr=function(e){let t=e.toString(2);for(;t.length<32;)t="0"+t;return t},e.print=function(t){const s=e.getLanguageId(t),r=e.getTokenType(t),o=e.getFontStyle(t),n=e.getForeground(t),c=e.getBackground(t);console.log({languageId:s,tokenType:r,fontStyle:o,foreground:n,background:c})},e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(768&e)>>>8},e.containsBalancedBrackets=function(e){return 0!=(1024&e)},e.getFontStyle=function(e){return(30720&e)>>>11},e.getForeground=function(e){return(16744448&e)>>>15},e.getBackground=function(e){return(4278190080&e)>>>24},e.set=function(t,s,r,o,n,c,i){let a=e.getLanguageId(t),u=e.getTokenType(t),l=e.containsBalancedBrackets(t)?1:0,d=e.getFontStyle(t),h=e.getForeground(t),p=e.getBackground(t);return 0!==s&&(a=s),8!==r&&(u=r),null!==o&&(l=o?1:0),-1!==n&&(d=n),0!==c&&(h=c),0!==i&&(p=i),(a<<0|u<<8|l<<10|d<<11|h<<15|p<<24)>>>0}}(C||(C={}));let I=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;class L{static hasCaptures(e){return null!==e&&(I.lastIndex=0,I.test(e))}static replaceCaptures(e,t,s){return e.replace(I,((e,r,o,n)=>{let c=s[parseInt(r||o,10)];if(!c)return e;{let e=t.substring(c.start,c.end);for(;"."===e[0];)e=e.substring(1);switch(n){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}}))}}function B(e,t){return et?1:0}function O(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let s=e.length,r=t.length;if(s===r){for(let r=0;r`);return}const n=s.lookup(t);e instanceof $?H({baseGrammar:n,selfGrammar:o},r):z(e.ruleName,{baseGrammar:n,selfGrammar:o,repository:o.repository},r);const c=s.injections(e.scopeName);if(c)for(const e of c)r.add(new $(e))}function z(e,t,s){t.repository&&t.repository[e]&&Q([t.repository[e]],t,s)}function H(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Q(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Q(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Q(e,t,s){for(const r of e){if(s.visitedRule.has(r))continue;s.visitedRule.add(r);const e=r.repository?R({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Q(r.patterns,{...t,repository:e},s);const o=r.include;if(!o)continue;const n=Z(o);switch(n.kind){case 0:H({...t,selfGrammar:t.baseGrammar},s);break;case 1:H(t,s);break;case 2:z(n.ruleName,{...t,repository:e},s);break;case 3:case 4:const r=n.scopeName===t.selfGrammar.scopeName?t.selfGrammar:n.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){const o={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};4===n.kind?z(n.ruleName,o,s):H(o,s)}else 4===n.kind?s.add(new M(n.scopeName,n.ruleName)):s.add(new $(n.scopeName))}}}class K{constructor(){this.kind=0}}class V{constructor(){this.kind=1}}class Y{constructor(e){this.ruleName=e,this.kind=2}}class X{constructor(e){this.scopeName=e,this.kind=3}}class J{constructor(e,t){this.scopeName=e,this.ruleName=t,this.kind=4}}function Z(e){if("$base"===e)return new K;if("$self"===e)return new V;const t=e.indexOf("#");if(-1===t)return new X(e);if(0===t)return new Y(e.substring(1));{const s=e.substring(0,t),r=e.substring(t+1);return new J(s,r)}}const ee=/\\(\d+)/,te=/\\(\d+)/g;class se{constructor(e,t,s,r){this.$location=e,this.id=t,this._name=s||null,this._nameIsCapturing=L.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=L.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${E(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?L.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?L.replaceCaptures(this._contentName,e,t):this._contentName}}class re extends se{constructor(e,t,s,r,o){super(e,t,s,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,s,r){throw new Error("Not supported!")}}class oe extends se{constructor(e,t,s,r,o){super(e,t,s,null),this._match=new ue(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,s,r){return this._getCachedCompiledPatterns(e).compileAG(e,s,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new le,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class ne extends se{constructor(e,t,s,r,o){super(e,t,s,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const s of this.patterns)e.getRule(s).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,s,r){return this._getCachedCompiledPatterns(e).compileAG(e,s,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new le,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class ce extends se{constructor(e,t,s,r,o,n,c,i,a,u){super(e,t,s,r),this._begin=new ue(o,this.id),this.beginCaptures=n,this._end=new ue(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=a||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,s,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,s,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new le;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}}class ie extends se{constructor(e,t,s,r,o,n,c,i,a){super(e,t,s,r),this._begin=new ue(o,this.id),this.beginCaptures=n,this.whileCaptures=i,this._while=new ue(c,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,s,r){return this._getCachedCompiledPatterns(e).compileAG(e,s,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new le;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,s,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,s,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new le,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}}class ae{static createCaptureRule(e,t,s,r,o){return e.registerRule((e=>new re(t,e,s,r,o)))}static getCompiledRuleId(e,t,s){return e.id||t.registerRule((r=>{if(e.id=r,e.match)return new oe(e.$vscodeTextmateLocation,e.id,e.name,e.match,ae._compileCaptures(e.captures,t,s));if(void 0===e.begin){e.repository&&(s=R({},s,e.repository));let r=e.patterns;return void 0===r&&e.include&&(r=[{include:e.include}]),new ne(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,ae._compilePatterns(r,t,s))}return e.while?new ie(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ae._compileCaptures(e.beginCaptures||e.captures,t,s),e.while,ae._compileCaptures(e.whileCaptures||e.captures,t,s),ae._compilePatterns(e.patterns,t,s)):new ce(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ae._compileCaptures(e.beginCaptures||e.captures,t,s),e.end,ae._compileCaptures(e.endCaptures||e.captures,t,s),e.applyEndPatternLast,ae._compilePatterns(e.patterns,t,s))})),e.id}static _compileCaptures(e,t,s){let r=[];if(e){let o=0;for(const t in e){if("$vscodeTextmateLocation"===t)continue;const e=parseInt(t,10);e>o&&(o=e)}for(let e=0;e<=o;e++)r[e]=null;for(const o in e){if("$vscodeTextmateLocation"===o)continue;const n=parseInt(o,10);let c=0;e[o].patterns&&(c=ae.getCompiledRuleId(e[o],t,s)),r[n]=ae.createCaptureRule(t,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,t,s){let r=[];if(e)for(let o=0,n=e.length;oe.substring(t.start,t.end)));return te.lastIndex=0,this.source.replace(te,((e,t)=>T(s[parseInt(t,10)]||"")))}_buildAnchorCache(){let e,t,s,r,o=[],n=[],c=[],i=[];for(e=0,t=this.source.length;ee.source));this._cached=new de(e,t,this._items.map((e=>e.ruleId)))}return this._cached}compileAG(e,t,s){return this._hasAnchors?t?s?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,s)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,s)),this._anchorCache.A1_G0):s?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,s)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,s)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,s){let r=this._items.map((e=>e.resolveAnchors(t,s)));return new de(e,r,this._items.map((e=>e.ruleId)))}}class de{constructor(e,t,s){this.regExps=t,this.rules=s,this.scanner=e.createOnigScanner(t)}dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,s=this.rules.length;tthis._root.match(e)))}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,s=[],r=0;for(let e=0,o=t.length;e1&&(l=n.slice(0,n.length-1),l.reverse()),s[r++]=new ge(u,l,e,c,i,a)}}return s}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort(((e,t)=>{let s=B(e.scope,t.scope);return 0!==s?s:(s=O(e.parentScopes,t.parentScopes),0!==s?s:e.index-t.index)}));let s=0,r="#000000",o="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(s=t.fontStyle),null!==t.foreground&&(r=t.foreground),null!==t.background&&(o=t.background)}let n=new be(t),c=new fe(s,n.getId(r),n.getId(o)),i=new _e(new ye(0,null,-1,0,0),[]);for(let t=0,s=e.length;tfunction(e,t){if(null===t)return!0;let s=0,r=t[s];for(;e;){if(me(e.scopeName,r)){if(s++,s===t.length)return!0;r=t[s]}e=e.parent}return!1}(e.parent,t.parentScopes)));return s?new fe(s.fontStyle,s.foreground,s.background):null}}class pe{constructor(e,t){this.parent=e,this.scopeName=t}static push(e,t){for(const s of t)e=new pe(e,s);return e}static from(...e){let t=null;for(let s=0;se?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==s&&(this.foreground=s),0!==r&&(this.background=r)}}class _e{constructor(e,t=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=t}static _sortBySpecificity(e){return 1===e.length||e.sort(this._cmpBySpecificity),e}static _cmpBySpecificity(e,t){if(e.scopeDepth===t.scopeDepth){const s=e.parentScopes,r=t.parentScopes;let o=null===s?0:s.length,n=null===r?0:r.length;if(o===n)for(let e=0;e{const t=this._scopeToLanguage(e),s=this._toStandardTokenType(e);return new ke(t,s)})),this._defaultAttributes=new ke(e,8),this._embeddedLanguagesMatcher=new xe(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return null===e?Se._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(Se.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}}Se._NULL_SCOPE_METADATA=new ke(0,0),Se.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class xe{constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map((([e,t])=>T(e)));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}}class we{constructor(e,t){this.stack=e,this.stoppedEarly=t}}function ve(e,t,s,r,o,n,c,i){const a=t.content.length;let u=!1,l=-1;if(c){const c=function(e,t,s,r,o,n){let c=o.beginRuleCapturedEOL?0:-1;const i=[];for(let t=o;t;t=t.pop()){const s=t.getRule(e);s instanceof ie&&i.push({rule:s,stack:t})}for(let a=i.pop();a;a=i.pop()){const{ruleScanner:i,findOptions:u}=je(a.rule,e,a.stack.endRule,s,r===c),l=i.findNextMatchSync(t,r,u);if(v&&(console.log(" scanning for while rule"),console.log(i.toString())),!l){v&&console.log(" popping "+a.rule.debugName+" - "+a.rule.debugWhileRegExp),o=a.stack.pop();break}if(-2!==l.ruleId){o=a.stack.pop();break}l.captureIndices&&l.captureIndices.length&&(n.produce(a.stack,l.captureIndices[0].start),Ae(e,t,s,a.stack,n,a.rule.whileCaptures,l.captureIndices),n.produce(a.stack,l.captureIndices[0].end),c=l.captureIndices[0].end,l.captureIndices[0].end>r&&(r=l.captureIndices[0].end,s=!1))}return{stack:o,linePos:r,anchorPosition:c,isFirstLine:s}}(e,t,s,r,o,n);o=c.stack,r=c.linePos,s=c.isFirstLine,l=c.anchorPosition}const d=Date.now();for(;!u;){if(0!==i&&Date.now()-d>i)return new we(o,!0);h()}return new we(o,!1);function h(){v&&(console.log(""),console.log(`@@scanNext ${r}: |${t.content.substr(r).replace(/\n$/,"\\n")}|`));const c=function(e,t,s,r,o,n){const c=function(e,t,s,r,o,n){const c=o.getRule(e),{ruleScanner:i,findOptions:a}=Ce(c,e,o.endRule,s,r===n);let u=0;v&&(u=F());const l=i.findNextMatchSync(t,r,a);if(v){const e=F()-u;e>5&&console.warn(`Rule ${c.debugName} (${c.id}) matching took ${e} against '${t}'`),console.log(` scanning for (linePos: ${r}, anchorPosition: ${n})`),console.log(i.toString()),l&&console.log(`matched rule id: ${l.ruleId} from ${l.captureIndices[0].start} to ${l.captureIndices[0].end}`)}return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}(e,t,s,r,o,n),i=e.getInjections();if(0===i.length)return c;const a=function(e,t,s,r,o,n,c){let i,a=Number.MAX_VALUE,u=null,l=0;const d=n.contentNameScopesList.getScopeNames();for(let n=0,h=e.length;n=a)&&(a=b,u=g.captureIndices,i=g.ruleId,l=h.priority,a===o))break}return u?{priorityMatch:-1===l,captureIndices:u,matchedRuleId:i}:null}(i,e,t,s,r,o,n);if(!a)return c;if(!c)return a;const u=c.captureIndices[0].start,l=a.captureIndices[0].start;return l0)&&i[0].end>r;if(-1===d){const c=o.getRule(e);v&&console.log(" popping "+c.debugName+" - "+c.debugEndRegExp),n.produce(o,i[0].start),o=o.withContentNameScopesList(o.nameScopesList),Ae(e,t,s,o,n,c.endCaptures,i),n.produce(o,i[0].end);const d=o;if(o=o.parent,l=d.getAnchorPos(),!h&&d.getEnterPos()===r)return v&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),o=d,n.produce(o,a),void(u=!0)}else{const c=e.getRule(d);n.produce(o,i[0].start);const p=o,m=c.getName(t.content,i),f=o.contentNameScopesList.pushAttributed(m,e);if(o=o.push(d,r,l,i[0].end===a,null,f,f),c instanceof ce){const r=c;v&&console.log(" pushing "+r.debugName+" - "+r.debugBeginRegExp),Ae(e,t,s,o,n,r.beginCaptures,i),n.produce(o,i[0].end),l=i[0].end;const d=r.getContentName(t.content,i),m=f.pushAttributed(d,e);if(o=o.withContentNameScopesList(m),r.endHasBackReferences&&(o=o.withEndRule(r.getEndWithResolvedBackReferences(t.content,i))),!h&&p.hasSameRuleAs(o))return v&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),o=o.pop(),n.produce(o,a),void(u=!0)}else if(c instanceof ie){const r=c;v&&console.log(" pushing "+r.debugName),Ae(e,t,s,o,n,r.beginCaptures,i),n.produce(o,i[0].end),l=i[0].end;const d=r.getContentName(t.content,i),m=f.pushAttributed(d,e);if(o=o.withContentNameScopesList(m),r.whileHasBackReferences&&(o=o.withEndRule(r.getWhileWithResolvedBackReferences(t.content,i))),!h&&p.hasSameRuleAs(o))return v&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),o=o.pop(),n.produce(o,a),void(u=!0)}else{const r=c;if(v&&console.log(" matched "+r.debugName+" - "+r.debugMatchRegExp),Ae(e,t,s,o,n,r.captures,i),n.produce(o,i[0].end),o=o.pop(),!h)return v&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),o=o.safePop(),n.produce(o,a),void(u=!0)}}i[0].end>r&&(r=i[0].end,s=!1)}}function Ce(e,t,s,r,o){return{ruleScanner:e.compileAG(t,s,r,o),findOptions:0}}function je(e,t,s,r,o){return{ruleScanner:e.compileWhileAG(t,s,r,o),findOptions:0}}function Ae(e,t,s,r,o,n,c){if(0===n.length)return;const i=t.content,a=Math.min(n.length,c.length),u=[],l=c[0].end;for(let t=0;tl)break;for(;u.length>0&&u[u.length-1].endPos<=d.start;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?o.produceFromScopes(u[u.length-1].scopes,d.start):o.produce(r,d.start),a.retokenizeCapturedWithRuleId){const t=a.getName(i,c),n=r.contentNameScopesList.pushAttributed(t,e),u=a.getContentName(i,c),l=n.pushAttributed(u,e),h=r.push(a.retokenizeCapturedWithRuleId,d.start,-1,!1,null,n,l),p=e.createOnigString(i.substring(0,d.end));ve(e,p,s&&0===d.start,d.start,h,o,!1,0),N(p);continue}const h=a.getName(i,c);if(null!==h){const t=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);u.push(new Ne(t,d.end))}}for(;u.length>0;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}class Ne{constructor(e,t){this.scopes=e,this.endPos=t}}function Pe(e,t,s,r,o){const n=j(t,Re),c=ae.getCompiledRuleId(s,r,o.repository);for(const s of n)e.push({debugSelector:t,matcher:s.matcher,ruleId:c,grammar:o,priority:s.priority})}function Re(e,t){if(t.length{for(let r=s;rs&&e.substr(0,s)===t&&"."===e[s]}class Ie{constructor(e,t,s,r,o,n,c,i){if(this._rootScopeName=e,this.balancedBracketSelectors=n,this._onigLib=i,this._basicScopeAttributesProvider=new Se(s,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=c,this._grammar=Le(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const e of Object.keys(o)){const t=j(e,Re);for(const s of t)this._tokenTypeMatchers.push({matcher:s.matcher,type:o[e]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=[],t=this._rootScopeName,s=(e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e))(t);if(s){const r=s.injections;if(r)for(let t in r)Pe(e,t,r[t],this,s);const o=this._grammarRepository.injections(t);o&&o.forEach((t=>{const s=this.getExternalGrammar(t);if(s){const t=s.injectionSelector;t&&Pe(e,t,s,this,s)}}))}return e.sort(((e,t)=>e.priority-t.priority)),e}getInjections(){if(null===this._injections&&(this._injections=this._collectInjections(),v&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const e of this._injections)console.log(` - ${e.debugSelector}`)}return this._injections}registerRule(e){const t=++this._lastRuleId,s=e(t);return this._ruleId2desc[t]=s,s}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const s=this._grammarRepository.lookup(e);if(s)return this._includedGrammars[e]=Le(s,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,s=0){const r=this._tokenize(e,t,!1,s);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,s=0){const r=this._tokenize(e,t,!0,s);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,s,r){let o;if(-1===this._rootId&&(this._rootId=ae.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==Oe.NULL)o=!1,t.reset();else{o=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),s=this.themeProvider.getDefaults(),r=C.set(0,e.languageId,e.tokenType,null,s.fontStyle,s.foregroundId,s.backgroundId),n=this.getRule(this._rootId).getName(null,null);let c;c=n?Be.createRootAndLookUpScopeName(n,r,this):Be.createRoot("unknown",r),t=new Oe(null,this._rootId,-1,-1,!1,null,c,c)}e+="\n";const n=this.createOnigString(e),c=n.content.length,i=new Te(s,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=ve(this,n,o,0,t,i,!0,r);return N(n),{lineLength:c,lineTokens:i,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}}function Le(e,t){return(e=P(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}class Be{constructor(e,t,s){this.parent=e,this.scopePath=t,this.tokenAttributes=s}static fromExtension(e,t){let s=e,r=e?.scopePath??null;for(const e of t)r=pe.push(r,e.scopeNames),s=new Be(s,r,e.encodedTokenAttributes);return s}static createRoot(e,t){return new Be(null,new pe(null,e),t)}static createRootAndLookUpScopeName(e,t,s){const r=s.getMetadataForScope(e),o=new pe(null,e),n=s.themeProvider.themeMatch(o),c=Be.mergeAttributes(t,r,n);return new Be(null,o,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Be.equals(this,e)}static equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,s){let r=-1,o=0,n=0;return null!==s&&(r=s.fontStyle,o=s.foregroundId,n=s.backgroundId),C.set(e,t.languageId,t.tokenType,null,r,o,n)}pushAttributed(e,t){if(null===e)return this;if(-1===e.indexOf(" "))return Be._pushAttributed(this,e,t);const s=e.split(/ /g);let r=this;for(const e of s)r=Be._pushAttributed(r,e,t);return r}static _pushAttributed(e,t,s){const r=s.getMetadataForScope(t),o=e.scopePath.push(t),n=s.themeProvider.themeMatch(o),c=Be.mergeAttributes(e.tokenAttributes,r,n);return new Be(e,o,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const t=[];let s=this;for(;s&&s!==e;)t.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===e?t.reverse():void 0}}class Oe{constructor(e,t,s,r,o,n,c,i){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=o,this.endRule=n,this.nameScopesList=c,this.contentNameScopesList=i,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=r}equals(e){return null!==e&&Oe._equals(this,e)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&Be.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Oe._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,s,r,o,n,c){return new Oe(this,e,t,s,r,o,n,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Oe(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,t){const s=Be.fromExtension(e?.nameScopesList??null,t.nameScopesList);return new Oe(e,t.ruleId,t.enterPos??-1,t.anchorPos??-1,t.beginRuleCapturedEOL,t.endRule,s,Be.fromExtension(s,t.contentNameScopesList))}}Oe.NULL=new Oe(null,0,0,0,!1,null,null,null);class Ge{constructor(e,t){this.allowAny=!1,this.balancedBracketScopes=e.flatMap((e=>"*"===e?(this.allowAny=!0,[]):j(e,Re).map((e=>e.matcher)))),this.unbalancedBracketScopes=t.flatMap((e=>j(e,Re).map((e=>e.matcher))))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}}class Te{constructor(e,t,s,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=s,this._lineText=v?t:null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let s=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e?.getScopeNames()??[];for(const e of this._tokenTypeOverrides)e.matcher(t)&&(s=C.set(s,0,e.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(s=C.set(s,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s)return void(this._lastTokenEndIndex=t);if(v){const s=e?.getScopeNames()??[];console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(let e=0;e0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const s=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e0;)10===e.charCodeAt(o)?(o++,n++,c=0):(o++,c++),t--}function a(e){null===s?o=e:i(e-o)}function u(){for(;o0&&65279===e.charCodeAt(0)&&(o=1);let p=0,m=null,f=[],g=[],b=null;function y(e,t){f.push(p),g.push(m),p=e,m=t}function _(){if(0===f.length)return k("illegal state stack");p=f.pop(),m=g.pop()}function k(t){throw new Error("Near offset "+o+": "+t+" ~~~"+e.substr(o,50)+"~~~")}const S=function(){if(null===b)return k("missing ");let e={};null!==s&&(e[s]={filename:t,line:n,char:c}),m[b]=e,b=null,y(1,e)},x=function(){if(null===b)return k("missing ");let e=[];m[b]=e,b=null,y(2,e)},w=function(){let e={};null!==s&&(e[s]={filename:t,line:n,char:c}),m.push(e),y(1,e)},v=function(){let e=[];m.push(e),y(2,e)};function C(){if(1!==p)return k("unexpected ");_()}function j(){return 1===p||2!==p?k("unexpected "):void _()}function A(e){if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function N(e){if(isNaN(e))return k("cannot parse float");if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function P(e){if(isNaN(e))return k("cannot parse integer");if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function R(e){if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function E(e){if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function I(e){if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function L(){let e=h(">"),t=!1;return 47===e.charCodeAt(e.length-1)&&(t=!0,e=e.substring(0,e.length-1)),{name:e.trim(),isClosed:t}}function B(e){if(e.isClosed)return"";let t=h(""),t.replace(/&#([0-9]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,10))})).replace(/&#x([0-9a-f]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/&|<|>|"|'/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return e}))}for(;o=r));){const a=e.charCodeAt(o);if(i(1),60!==a)return k("expected <");if(o>=r)return k("unexpected end of input");const h=e.charCodeAt(o);if(63===h){i(1),d("?>");continue}if(33===h){if(i(1),l("--")){d("--\x3e");continue}d(">");continue}if(47===h){if(i(1),u(),l("plist")){d(">");continue}if(l("dict")){d(">"),C();continue}if(l("array")){d(">"),j();continue}return k("unexpected closed tag")}let f=L();switch(f.name){case"dict":1===p?S():2===p?w():(m={},null!==s&&(m[s]={filename:t,line:n,char:c}),y(1,m)),f.isClosed&&C();continue;case"array":1===p?x():2===p?v():(m=[],y(2,m)),f.isClosed&&j();continue;case"key":O=B(f),1!==p?k("unexpected "):null!==b?k("too many "):b=O;continue;case"string":A(B(f));continue;case"real":N(parseFloat(B(f)));continue;case"integer":P(parseInt(B(f),10));continue;case"date":R(new Date(B(f)));continue;case"data":E(B(f));continue;case"true":B(f),I(!0);continue;case"false":B(f),I(!1);continue}if(!/^plist/.test(f.name))return k("unexpected opened tag "+f.name)}var O;return m}function Fe(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}class $e{constructor(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0}}class Me{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(e){return{filename:e,line:this.line,char:this.char}}}function We(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;let s,r=e.source,o=e.pos,n=e.len,c=e.line,i=e.char;for(;;){if(o>=n)return!1;if(s=r.charCodeAt(o),32!==s&&9!==s&&13!==s){if(10!==s)break;o++,c++,i=0}else o++,i++}if(t.offset=o,t.line=c,t.char=i,34===s){for(t.type=1,o++,i++;;){if(o>=n)return!1;if(s=r.charCodeAt(o),o++,i++,92!==s){if(34===s)break}else o++,i++}t.value=r.substring(t.offset+1,o-1).replace(/\\u([0-9A-Fa-f]{4})/g,((e,t)=>String.fromCodePoint(parseInt(t,16)))).replace(/\\(.)/g,((t,s)=>{switch(s){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:Fe(e,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===s)t.type=2,o++,i++;else if(123===s)t.type=3,o++,i++;else if(93===s)t.type=4,o++,i++;else if(125===s)t.type=5,o++,i++;else if(58===s)t.type=6,o++,i++;else if(44===s)t.type=7,o++,i++;else if(110===s){if(t.type=8,o++,i++,s=r.charCodeAt(o),117!==s)return!1;if(o++,i++,s=r.charCodeAt(o),108!==s)return!1;if(o++,i++,s=r.charCodeAt(o),108!==s)return!1;o++,i++}else if(116===s){if(t.type=9,o++,i++,s=r.charCodeAt(o),114!==s)return!1;if(o++,i++,s=r.charCodeAt(o),117!==s)return!1;if(o++,i++,s=r.charCodeAt(o),101!==s)return!1;o++,i++}else if(102===s){if(t.type=10,o++,i++,s=r.charCodeAt(o),97!==s)return!1;if(o++,i++,s=r.charCodeAt(o),108!==s)return!1;if(o++,i++,s=r.charCodeAt(o),115!==s)return!1;if(o++,i++,s=r.charCodeAt(o),101!==s)return!1;o++,i++}else for(t.type=11;;){if(o>=n)return!1;if(s=r.charCodeAt(o),!(46===s||s>=48&&s<=57||101===s||69===s||45===s||43===s))break;o++,i++}return t.len=o-t.offset,null===t.value&&(t.value=r.substr(t.offset,t.len)),e.pos=o,e.line=c,e.char=i,!0}class Ue{constructor(e,t){this._onigLibPromise=t,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}async grammarForScopeName(e,t,s,r,o){if(!this._grammars.has(e)){let n=this._rawGrammars.get(e);if(!n)return null;this._grammars.set(e,function(e,t,s,r,o,n,c,i){return new Ie(e,t,s,r,o,n,c,i)}(e,n,t,s,r,o,this,await this._onigLibPromise))}return this._grammars.get(e)}}function De(e,t){let s=0;const r=[];let o=e,n=t;for(;o!==n;)o&&(!n||o.depth>=n.depth)?(s++,o=o.parent):(r.push(n.toStateStackFrame()),n=n.parent);return{pops:s,newFrames:r.reverse()}}function ze(e,t){let s=e;for(let e=0;e0;)await Promise.all(n.Q.map((e=>this._loadSingleGrammar(e.scopeName)))),n.processQueue();return this._grammarForScopeName(e,t,s,r,o)}async _loadSingleGrammar(e){return this._ensureGrammarCache.has(e)||this._ensureGrammarCache.set(e,this._doLoadSingleGrammar(e)),this._ensureGrammarCache.get(e)}async _doLoadSingleGrammar(e){const t=await this._options.loadGrammar(e);if(t){const s="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,s)}}async addGrammar(e,t=[],s=0,r=null){return this._syncRegistry.addGrammar(e,t),await this._grammarForScopeName(e.scopeName,s,r)}_grammarForScopeName(e,t=0,s=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,s,r,o)}}const Qe=Oe.NULL,Ke=function(e,t=null){return null!==t&&/\.json$/.test(t)?(s=e,v?function(e,t,s){let r=new $e(e),o=new Me,n=0,c=null,i=[],a=[];function u(){i.push(n),a.push(c)}function l(){n=i.pop(),c=a.pop()}function d(e){Fe(r,e)}for(;We(r,o);){if(0===n){if(null!==c&&d("too many constructs in root"),3===o.type){c={},c.$vscodeTextmateLocation=o.toLocation(t),u(),n=1;continue}if(2===o.type){c=[],u(),n=4;continue}d("unexpected token in root")}if(2===n){if(5===o.type){l();continue}if(7===o.type){n=3;continue}d("expected , or }")}if(1===n||3===n){if(1===n&&5===o.type){l();continue}if(1===o.type){let e=o.value;if(We(r,o)&&6===o.type||d("expected colon"),We(r,o)||d("expected value"),n=2,1===o.type){c[e]=o.value;continue}if(8===o.type){c[e]=null;continue}if(9===o.type){c[e]=!0;continue}if(10===o.type){c[e]=!1;continue}if(11===o.type){c[e]=parseFloat(o.value);continue}if(2===o.type){let t=[];c[e]=t,u(),n=4,c=t;continue}if(3===o.type){let s={};s.$vscodeTextmateLocation=o.toLocation(t),c[e]=s,u(),n=1,c=s;continue}}d("unexpected token in dict")}if(5===n){if(4===o.type){l();continue}if(7===o.type){n=6;continue}d("expected , or ]")}if(4===n||6===n){if(4===n&&4===o.type){l();continue}if(n=5,1===o.type){c.push(o.value);continue}if(8===o.type){c.push(null);continue}if(9===o.type){c.push(!0);continue}if(10===o.type){c.push(!1);continue}if(11===o.type){c.push(parseFloat(o.value));continue}if(2===o.type){let e=[];c.push(e),u(),n=4,c=e;continue}if(3===o.type){let e={};e.$vscodeTextmateLocation=o.toLocation(t),c.push(e),u(),n=1,c=e;continue}d("unexpected token in array")}d("unknown state")}return 0!==a.length&&d("unclosed constructs"),c}(s,t):JSON.parse(s)):function(e,t){return v?function(e,t,s){return qe(e,t,"$vscodeTextmateLocation")}(e,t):function(e){return qe(e,null,null)}(e)}(e,t);var s};var Ve=w.Bz,Ye=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(e){var t,s,r=void 0!==(e=e||{})?e:{};r.ready=new Promise((function(e,r){t=e,s=r}));var o,n=Object.assign({},r),c=!1;o=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),"object"==typeof t||w(s),t);var s},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print);var i,a,u=r.print||console.log.bind(console),l=r.printErr||console.warn.bind(console);Object.assign(r,n),n=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(i=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&w("no native wasm support detected");var d,h,p,m=!1,f="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(e,t,s){for(var r=t+s,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&f)return f.decode(e.subarray(t,o));for(var n="";t>10,56320|1023&u)}}else n+=String.fromCharCode((31&c)<<6|i)}else n+=String.fromCharCode(c)}return n}function b(e){d=e,r.HEAP8=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU8=h=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}r.INITIAL_MEMORY;var y=[],_=[],k=[],S=0,x=null;function w(e){r.onAbort&&r.onAbort(e),l(e="Aborted("+e+")"),m=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw s(t),t}var v,C,j,A="data:application/octet-stream;base64,";function N(e){return e.startsWith(A)}function P(e){try{if(e==v&&i)return new Uint8Array(i);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}catch(e){w(e)}}function R(e){for(;e.length>0;)e.shift()(r)}function E(e){try{return a.grow(e-d.byteLength+65535>>>16),b(a.buffer),1}catch(e){}}N(v="onig.wasm")||(C=v,v=r.locateFile?r.locateFile(C,""):""+C),j="undefined"!=typeof dateNow?dateNow:()=>performance.now();var I=[null,[],[]];function L(e,t){var s=I[e];0===t||10===t?((1===e?u:l)(g(s,0)),s.length=0):s.push(t)}var B,O={emscripten_get_now:j,emscripten_memcpy_big:function(e,t,s){h.copyWithin(e,t,t+s)},emscripten_resize_heap:function(e){var t=h.length,s=2147483648;if((e>>>=0)>s)return!1;let r=(e,t)=>e+(t-e%t)%t;for(var o=1;o<=4;o*=2){var n=t*(1+.2/o);if(n=Math.min(n,e+100663296),E(Math.min(s,r(Math.max(e,n),65536))))return!0}return!1},fd_write:function(e,t,s,r){for(var o=0,n=0;n>2],i=p[t+4>>2];t+=8;for(var a=0;a>2]=o,0}};function G(e){function s(){B||(B=!0,r.calledRun=!0,m||(R(_),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),k.unshift(e);var e;R(k)}()))}S>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),y.unshift(e);var e;R(y)}(),S>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),s()}),1)):s()))}if(function(){var e={env:O,wasi_snapshot_preview1:O};function t(e,t){var s,o=e.exports;r.asm=o,b((a=r.asm.memory).buffer),r.asm.__indirect_function_table,s=r.asm.__wasm_call_ctors,_.unshift(s),function(e){if(S--,r.monitorRunDependencies&&r.monitorRunDependencies(S),0==S&&x){var t=x;x=null,t()}}()}function o(e){t(e.instance)}function n(t){return(!i&&c&&"function"==typeof fetch?fetch(v,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+v+"'";return e.arrayBuffer()})).catch((function(){return P(v)})):Promise.resolve().then((function(){return P(v)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){l("failed to asynchronously prepare wasm: "+e),w(e)}))}if(S++,r.monitorRunDependencies&&r.monitorRunDependencies(S),r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(e){l("Module.instantiateWasm callback failed with error: "+e),s(e)}(i||"function"!=typeof WebAssembly.instantiateStreaming||N(v)||"function"!=typeof fetch?n(o):fetch(v,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(e){return l("wasm streaming compile failed: "+e),l("falling back to ArrayBuffer instantiation"),n(o)}))}))).catch(s)}(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.__wasm_call_ctors).apply(null,arguments)},r.___errno_location=function(){return(r.___errno_location=r.asm.__errno_location).apply(null,arguments)},r._omalloc=function(){return(r._omalloc=r.asm.omalloc).apply(null,arguments)},r._ofree=function(){return(r._ofree=r.asm.ofree).apply(null,arguments)},r._getLastOnigError=function(){return(r._getLastOnigError=r.asm.getLastOnigError).apply(null,arguments)},r._createOnigScanner=function(){return(r._createOnigScanner=r.asm.createOnigScanner).apply(null,arguments)},r._freeOnigScanner=function(){return(r._freeOnigScanner=r.asm.freeOnigScanner).apply(null,arguments)},r._findNextOnigScannerMatch=function(){return(r._findNextOnigScannerMatch=r.asm.findNextOnigScannerMatch).apply(null,arguments)},r._findNextOnigScannerMatchDbg=function(){return(r._findNextOnigScannerMatchDbg=r.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},r.stackSave=function(){return(r.stackSave=r.asm.stackSave).apply(null,arguments)},r.stackRestore=function(){return(r.stackRestore=r.asm.stackRestore).apply(null,arguments)},r.stackAlloc=function(){return(r.stackAlloc=r.asm.stackAlloc).apply(null,arguments)},r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm.dynCall_jiji).apply(null,arguments)},r.UTF8ToString=function(e,t){return e?g(h,e,t):""},x=function e(){B||G(),B||(x=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return G(),e.ready});let Xe=null;class Je{static _utf8ByteLength(e){let t=0;for(let s=0,r=e.length;s=55296&&o<=56319&&s+1=56320&&t<=57343&&(n=65536+(o-55296<<10)|t-56320,c=!0)}t+=n<=127?1:n<=2047?2:n<=65535?3:4,c&&s++}return t}constructor(e){const t=e.length,s=Je._utf8ByteLength(e),r=s!==t,o=r?new Uint32Array(t+1):null;r&&(o[t]=s);const n=r?new Uint32Array(s+1):null;r&&(n[s]=t);const c=new Uint8Array(s);let i=0;for(let s=0;s=55296&&a<=56319&&s+1=56320&&t<=57343&&(u=65536+(a-55296<<10)|t-56320,l=!0)}r&&(o[s]=i,l&&(o[s+1]=i),u<=127?n[i+0]=s:u<=2047?(n[i+0]=s,n[i+1]=s):u<=65535?(n[i+0]=s,n[i+1]=s,n[i+2]=s):(n[i+0]=s,n[i+1]=s,n[i+2]=s,n[i+3]=s)),u<=127?c[i++]=u:u<=2047?(c[i++]=192|(1984&u)>>>6,c[i++]=128|(63&u)>>>0):u<=65535?(c[i++]=224|(61440&u)>>>12,c[i++]=128|(4032&u)>>>6,c[i++]=128|(63&u)>>>0):(c[i++]=240|(1835008&u)>>>18,c[i++]=128|(258048&u)>>>12,c[i++]=128|(4032&u)>>>6,c[i++]=128|(63&u)>>>0),l&&s++}this.utf16Length=t,this.utf8Length=s,this.utf16Value=e,this.utf8Value=c,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=n}createString(e){const t=e._omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}class Ze{constructor(e){if(this.id=++Ze.LAST_ID,!Xe)throw new Error("Must invoke loadWASM first.");this._onigBinding=Xe,this.content=e;const t=new Je(e);this.utf16Length=t.utf16Length,this.utf8Length=t.utf8Length,this.utf16OffsetToUtf8=t.utf16OffsetToUtf8,this.utf8OffsetToUtf16=t.utf8OffsetToUtf16,this.utf8Length<1e4&&!Ze._sharedPtrInUse?(Ze._sharedPtr||(Ze._sharedPtr=Xe._omalloc(1e4)),Ze._sharedPtrInUse=!0,Xe.HEAPU8.set(t.utf8Value,Ze._sharedPtr),this.ptr=Ze._sharedPtr):this.ptr=t.createString(Xe)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===Ze._sharedPtr?Ze._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}Ze.LAST_ID=0,Ze._sharedPtr=0,Ze._sharedPtrInUse=!1;class et{constructor(e){if(!Xe)throw new Error("Must invoke loadWASM first.");const t=[],s=[];for(let r=0,o=e.length;rWebAssembly.instantiateStreaming(e,t)}(r):function(e){return async t=>{const s=await e.arrayBuffer();return WebAssembly.instantiate(s,t)}}(r):function(e){return t=>WebAssembly.instantiate(e,t)}(r)}return st=new Promise(((e,t)=>{r=e,o=t})),function(e,t,s,r){Ye({print:t,instantiateWasm:(t,s)=>{if("undefined"==typeof performance){const e=()=>Date.now();t.env.emscripten_get_now=e,t.wasi_snapshot_preview1.emscripten_get_now=e}return e(t).then((e=>s(e.instance)),r),{}}}).then((e=>{Xe=e,s()}))}(t,s,r,o),st}function ot(e){return new Ze(e)}function nt(e){return new et(e)}function ct(e){const t=k[e];if(!t)return;const{id:s}=S[t];return{id:s,scopeName:t}}const it=new Map;let at,ut;async function lt(e){if(it.has(e))return it.get(e);const r=function(e){return S[e]}(e);if(!r)return Promise.resolve(void 0);let o;if(void 0===at&&(o=t(r.id),at=o.then((()=>!0)).catch((()=>!1))),void 0===ut&&(ut=await at),ut){const s=o||t(r.id);return it.set(e,s),s}const n=s(`grammars/${r.id}`);r.embeddedScopes.forEach((e=>{if(!it.has(e)){const t=n.then((t=>null==t?void 0:t.find((t=>t.scopeName===e))));it.set(e,t)}}));const c=n.then((t=>null==t?void 0:t.find((t=>t.scopeName===e))));return it.set(e,c),c}const dt=30720,ht=16744448,pt=16775168,mt=11,ft=15,gt={NotSet:-1,None:0,Italic:1,Bold:2,Underline:4,Strikethrough:8};function bt(e,t,s,r){const{tokens:o,ruleStack:n}=e.tokenizeLine2(s,t),c=[];let i=s.length;for(let e=o.length-2;e>=0;e-=2){const t=o[e],r=o[e+1],n=s.slice(t,i);c.unshift({content:n,metadata:r}),i=t}let a=[];if(null==r?void 0:r.preserveWhitespace)a=c;else for(let e=0;e0?a[a.length-1].content+=t.content:e{const{rawTokens:o,nextStack:n}=bt(t,r,e,{preserveWhitespace:!0}),c=o.map((({content:e,metadata:t})=>({content:e,style:_t(t,s)}))),i=function(e,t,s,r){const{tokens:o}=s.tokenizeLine(e,t),n=[];for(let t=0;t{if(a+=e.content.length,s>>ft]},r=(e&dt)>>>mt;return r>.Italic&&(s.fontStyle="italic"),r>.Bold&&(s.fontWeight="bold"),r>.Underline&&(s.textDecoration="underline"),r>.Strikethrough&&(s.textDecoration="line-through"),s}var kt={instantiator:t=>WebAssembly.instantiate(e,t).then((e=>({instance:e})))};let St=null;function xt(e){return"text"==e||"terminal"==e}function wt(e){if(!St){const e=rt(kt).then((()=>({createOnigScanner:nt,createOnigString:ot})));St=new Ve({onigLib:e,loadGrammar:e=>lt(e)})}const t=e.filter((e=>!xt(e))).map((e=>{const t=ct(e);if(!t)throw new Ct(e);return St.loadGrammar(t.scopeName)}));return Promise.all(t)}function vt(e){if(xt(e))return{langId:e,grammar:null};const t=ct(e);if(!t)throw new Ct(e);const s=function(e){const{_syncRegistry:t}=St;return null==t?void 0:t._grammars.get(e)}(t.scopeName);if(!s)throw new Error(`Syntax highlighting error: grammar for ${e} not loaded`);return{langId:t.id,grammar:s}}class Ct extends Error{constructor(e){super(`Unknown language: ${e}`),this.alias=e}}function jt(e,t,s){St.setTheme(s);const r=function(e){const t=St.getColorMap();return e.colorNames?t.map((t=>Object.keys(e.colorNames).find((s=>e.colorNames[s].toUpperCase()===t.toUpperCase()))||t)):t}(s);return function(e,t,s){let r=null;return e.split(/\r?\n|\r/g).map((e=>{const{rawTokens:o,nextStack:n}=bt(t,r,e);return r=n,o.map((({content:e,metadata:t})=>({content:e,style:_t(t,s)})))}))}(e,t,r)}function At(e){return e.split(/\r?\n|\r/g).map((e=>[{content:e,style:{}}]))}function Nt(e,t){return Rt(e.slice(1,-1)).map((e=>{const{from:s,to:r}=Pt(e);return{lineNumber:t,fromColumn:s,toColumn:r}}))}function Pt(e){const[t,s]=e.split(":");if(!Et(t))throw new It(t);const r=Number(t);if(r<1)throw new Lt;if(s){if(!Et(s))throw new It(s);return{from:r,to:+s}}return{from:r,to:r}}function Rt(e){return e.split(/,(?![^\[]*\])/g)}function Et(e){e=e.toString();var t=Math.abs(e),s=parseInt(e,10);return!isNaN(t)&&s===t&&t.toString()===e}class It extends Error{constructor(e){super(`Invalid number "${e}" in range string`),this.number=e,Object.setPrototypeOf(this,new.target.prototype)}}class Lt extends Error{constructor(){super("Invalid line or column number in range string"),Object.setPrototypeOf(this,new.target.prototype)}}const Bt="#001",Ot="#010",Gt={name:"comments",type:"light",foreground:"",background:"",colors:{},settings:[{settings:{foreground:"#000"}},{scope:["punctuation.definition.comment"],settings:{foreground:Bt}},{scope:"comment",settings:{foreground:Ot}}]};function Tt(e,t,s,r){const o=t?jt(e,t,Gt):At(e),n=[];let c=1;const i=o.map((e=>{const{annotations:t,lineWithoutComments:o}=function(e,t,s,r){if(r in qt&&e.some((e=>e.style.color===Ot))){const t=qt[r];e=e.flatMap((e=>{if(e.style.color!==Ot)return[e];const s=e.content.trimStart();if(s.startsWith(t)){const r=s.slice(t.length),o=[{content:e.content.slice(0,e.content.length-r.length),style:{color:Bt}}];return r.length&&o.push({content:r,style:e.style}),o}return[e]}))}if(!e.some((e=>e.style.color===Bt)))return{annotations:[],lineWithoutComments:e};const o=[];let n=0;for(;n!e.tokens.includes(t)));c.every((e=>""===e.content.trim()))&&(c=null);return{annotations:o.map((e=>({name:e.name,query:e.query,lineNumber:e.lineNumber,rangeString:e.rangeString}))),lineWithoutComments:c}}(e,r,c,s);if(n.push(...t),!o)return null;const i=o.map((e=>e.content)).join("");return["mdx","jsx","tsx"].includes(s)&&t.length>0&&"{}"===i.trim()?null:(c++,i)})).filter((e=>null!==e)).join("\n"),a=n.map((e=>{var{rangeString:t,lineNumber:s}=e,r=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);oe.ranges.length>0));return{newCode:i,annotations:a}}const qt={"actionscript-3":"//",ada:"--",asm:"#",dart:"//",fsharp:"//",graphql:"#",http:"#",rust:"//",sparql:"#",wgsl:"//",jsonnet:"//",kql:"//",zenscript:"//",kusto:"//",turtle:"#",abap:"*",beancount:";",kotlin:"//",hlsl:"//",berry:"#",cypher:"//",elm:"--",nix:"#",viml:'"',solidity:"//",bat:"REM",shaderlab:"//",sas:"*"};function Ft(e,t,s){return e&&e.startsWith("(/")?function(e,t,s){const r=t.match(/\(\/([\s\S]*?)\/([gimuy]*)\)/);if(!r)throw new Error(`Invalid RegExp string: ${t}`);const o=new RegExp(r[1],r[2]),n=e.split(/\r?\n/).slice(s-1).join("\n");if(!o.global){const e=o.exec(n);if(!e)return[];const t=n.slice(0,e.index).split("\n").length+s-1;return[{fromLineNumber:t,toLineNumber:t+e[0].split("\n").length-1}]}let c;const i=[];for(;c=o.exec(n);){const e=n.slice(0,c.index).split("\n").length+s-1,t=e+c[0].split("\n").length-1,r=i[i.length-1];r&&r.fromLineNumber===e||i.push({fromLineNumber:e,toLineNumber:t})}return i}(s,e,t):e&&e.startsWith("[/")?function(e,t,s){const r=t.match(/\[\/([\s\S]*?)\/([gimuy]*)\]/);if(!r)throw new Error(`Invalid RegExp string: ${t}`);let o=r[2]||"";o+="d";const n=new RegExp(r[1],o);let c=e.split(/\r?\n/);c=c.slice(s-1),n.multiline||(c=[c[0]]);const i=[];return c.forEach(((e,t)=>{if(!n.global){if(i.length>0)return;const r=n.exec(e);if(!r)return;const o=r.indices[1]||r.indices[0];return void i.push({lineNumber:t+s,fromColumn:o[0]+1,toColumn:o[1]})}let r;for(;r=n.exec(e);){const e=r.indices[1]||r.indices[0];i.push({lineNumber:t+s,fromColumn:e[0]+1,toColumn:e[1]})}})),i}(s,e,t):function(e,t){return e?e.startsWith("[")?Nt(e,t):Rt(e.slice(1,-1)).map((e=>{if(e.includes("[")){const[s,r]=e.split("["),o=Number(s),n=t+o-1;if(!Et(n))throw new It(s);return Nt("["+r,n)}const{from:s,to:r}=Pt(e);return[{fromLineNumber:s+t-1,toLineNumber:r+t-1}]})).flat():[{fromLineNumber:t,toLineNumber:t}]}(e,t)}function $t(e,t){var s;const r=e.match(/\s*([\w-]+)?(\([^\)]*\)|\[[^\]]*\])?(.*)$/),o=r[1],n=r[2],c=null===(s=r[3])||void 0===s?void 0:s.trim();return t.includes(o)?{name:o,rangeString:n,query:c}:null}function Mt(e,t){let s=[],r=1;return e.forEach((e=>{s.push({fromColumn:r,toColumn:r+e.content.length-1,token:e}),r+=e.content.length})),t.forEach((e=>{s=function(e,t){const{range:s}=t,{fromColumn:r,toColumn:o}=s,n=[];let c=0;for(;co){const[e,s]=Ut(t,o+1);i.tokens.push(e),n.push(s)}else i.tokens.push(t);c++}else n.push(i);for(;cWt(e)))}function Wt(e){return"tokens"in e?{annotationName:e.annotationName,annotationQuery:e.annotationQuery,fromColumn:e.fromColumn,toColumn:e.toColumn,tokens:e.tokens.map((e=>Wt(e)))}:e.token}function Ut(e,t){if("token"in e){const s=Object.assign(Object.assign({},e.token),{content:e.token.content.slice(0,t-e.fromColumn)}),r=Object.assign(Object.assign({},e.token),{content:e.token.content.slice(t-e.fromColumn)});return[Object.assign(Object.assign({},e),{toColumn:t-1,token:s}),Object.assign(Object.assign({},e),{fromColumn:t,token:r})]}{const s=[],r=[];e.tokens.forEach((e=>{if(e.toColumn=t)r.push(e);else{const[o,n]=Ut(e,t);s.push(o),r.push(n)}}));return[Object.assign(Object.assign({},e),{toColumn:t-1,tokens:s}),Object.assign(Object.assign({},e),{fromColumn:t,tokens:r})]}}function Dt(e,t){let s=e.map(((e,t)=>({fromLineNumber:t+1,toLineNumber:t+1,line:e})));return t.forEach((e=>{s=function(e,t){const{range:s,name:r,query:o}=t,{fromLineNumber:n,toLineNumber:c}=s,i=[];let a=0;for(;ac){const[e,s]=Ht(t,c+1);u.lines.push(e),i.push(s)}else u.lines.push(t);a++}else i.push(u);for(;azt(e)))}function zt(e){return"line"in e?{lineNumber:e.fromLineNumber,tokens:e.line.tokens}:{annotationName:e.annotationName,annotationQuery:e.annotationQuery,fromLineNumber:e.fromLineNumber,toLineNumber:e.toLineNumber,lines:e.lines.map((e=>zt(e)))}}function Ht(e,t){if("line"in e)return[Object.assign(Object.assign({},e),{toLineNumber:t-1}),Object.assign(Object.assign({},e),{fromLineNumber:t})];{const s=[],r=[];return e.lines.forEach((e=>{if(e.toLineNumber=t)r.push(e);else{const[o,n]=Ht(e,t);s.push(o),r.push(n)}})),[Object.assign(Object.assign({},e),{toLineNumber:t-1,lines:s}),Object.assign(Object.assign({},e),{fromLineNumber:t,lines:r})]}}function Qt(e,t){const{inlineAnnotations:s,multilineAnnotations:r}=function(e){const t=[],s=[];return e.forEach((e=>{e.ranges.forEach((r=>{"lineNumber"in r?t.push(Object.assign(Object.assign({},e),{range:r})):s.push(Object.assign(Object.assign({},e),{range:r}))}))})),{inlineAnnotations:t,multilineAnnotations:s}}(t);return Dt(e.map(((e,t)=>{const r=s.filter((e=>e.range.lineNumber===t+1));return{lineNumber:t+1,tokens:Mt(e,r)}})),r)}var Kt=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Vt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function Yt(e,t){const s=e.indexOf("[",t);if(-1!==s){const t=e.indexOf("m",s);return{sequence:e.substring(s+2,t).split(";"),startPosition:s,position:t+1}}return{position:e.length}}function Xt(e,t){let s=1;const r=e[t+s++];let o;if("2"===r){const r=[e[t+s++],e[t+s++],e[t+s]].map((e=>Number.parseInt(e)));3!==r.length||r.some((e=>Number.isNaN(e)))||(o={type:"rgb",rgb:r})}else if("5"===r){const r=Number.parseInt(e[t+s]);Number.isNaN(r)||(o={type:"table",index:Number(r)})}return[s,o]}function Jt(e){const t=[];for(let s=0;s=90&&o<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Kt[o-90+8]}}):o>=100&&o<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Kt[o-100+8]}})}return t}function Zt(e,t){const s=function(){let e=null,t=null,s=new Set;return{parse(r){const o=[];let n=0;do{const c=Yt(r,n),i=c.sequence?r.substring(n,c.startPosition):r.substring(n);if(i.length>0&&o.push({value:i,foreground:e,background:t,decorations:new Set(s)}),c.sequence){const r=Jt(c.sequence);for(const o of r)"resetAll"===o.type?(e=null,t=null,s.clear()):"resetForegroundColor"===o.type?e=null:"resetBackgroundColor"===o.type?t=null:"resetDecoration"===o.type&&s.delete(o.value);for(const o of r)"setForegroundColor"===o.type?e=o.value:"setBackgroundColor"===o.type?t=o.value:"setDecoration"===o.type&&s.add(o.value)}n=c.position}while(nfunction(e,t,s){const r=e.parse(t),o=r.map((({value:e,foreground:t,background:r,decorations:o})=>{const n=es(t,s),c={};n&&(c.color=n);const i=es(r,s);return i&&(c.background=i),o.has("bold")&&(c.fontWeight="bold"),o.has("italic")&&(c.fontStyle="italic"),o.has("underline")&&(c.textDecoration="underline"),o.has("strikethrough")&&(c.textDecoration="line-through"),o.has("reverse")&&(c.color=i,c.background=n),o.has("dim")&&(c.opacity=.5),{content:e,style:c}}));return o}(s,e,t)));return r}function es(e,t){if(e){if("named"===e.type){return a(t,"terminal.ansi"+(e.name[0].toUpperCase()+e.name.slice(1)))}if("rgb"===e.type){const[t,s,r]=e.rgb;return`rgb(${t}, ${s}, ${r})`}}}async function ts(e,t){await Promise.all([wt(e),p(t)])}async function ss(e,t,s="dark-plus",r={}){const o=e||"",n=t||"text";if("string"!=typeof o)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof n)throw new Error("Syntax highlighter error: lang must be a string");return await ts([n],s),rs(o,n,s,r)}function rs(e,t,s="dark-plus",r={}){const o=e||"",n=t||"text";if("string"!=typeof o)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof n)throw new Error("Syntax highlighter error: lang must be a string");const{langId:c,grammar:i}=vt(n),u=m(s),l="text"==c?At(o):"terminal"==c?Zt(o,u):(null==r?void 0:r.scopes)?function(e,t,s){return St.setTheme(s),yt(e,t,St.getColorMap())}(o,i,u):jt(o,i,u),d="terminal"==c?function(e){return{color:a(e,"terminal.foreground"),background:a(e,"terminal.background")}}(u):{color:u.foreground,background:u.background};if(function(e){return"annotations"in e}(r)){return{lines:Qt(l,(null==r?void 0:r.annotations)||[]),lang:c,style:d}}return{lines:l,lang:c,style:d}}async function os(e,t,s){if(!s)return{code:e,annotations:[]};await wt([t]);const{grammar:r,langId:o}=vt(t),{newCode:n,annotations:c}=Tt(e,r,o,s);return{code:n,annotations:c}}async function ns(e){if(!e)throw new Error("Syntax highlighter error: undefined theme");await ts([],e);return y(m(e))}function cs(e){if(!e)throw new Error("Syntax highlighter error: undefined theme");return y(m(e))}export{_ as LANG_NAMES,g as THEME_NAMES,Ct as UnknownLanguageError,b as UnknownThemeError,os as extractAnnotations,ns as getThemeColors,cs as getThemeColorsSync,ss as highlight,rs as highlightSync,ts as preload}; +import e from"./onig.wasm?module";async function t(e){throw new Error("no fs")}async function s(e){console.warn(`Code Hike warning: Fetching resource from network "${e}"`);const t=await fetch(`https://lighter.codehike.org/${e}.json`);if(t.ok)return await t.json()}const r=e=>/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(e),o=(e,t)=>e.match(new RegExp(`.{${t}}`,"g")),n=e=>parseInt(e.repeat(2/e.length),16);function c(e,t){return void 0!==e?e/255:"number"!=typeof t||t<0||t>1?1:t}function i(e,t){if(!e)return e;const{r:s,g:i,b:a,a:u}=function(e){if(!e)return;if(!r(e))throw new Error("Invalid color string, must be a valid hex color");const t=Math.floor((e.length-1)/3),s=o(e.slice(1),t),[i,a,u,l]=s.map(n);return{r:i,g:a,b:u,a:c(l,1)}}(e);return function(e){if(!e)return;const{r:t,g:s,b:r,a:o}=e,n=Math.round(255*o);return`#${t.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${n.toString(16).padStart(2,"0")}`}({r:s,g:i,b:a,a:u*t})}function a(e){return"from-css"===e.type?"var(--ch-0)":e.type}function u(e,t){const s=e.colors||{};if(s[t])return s[t];const r=d[t];if(!r)throw new Error(`Unknown theme color key: ${t}`);return"string"==typeof r?u(e,r):function(e,t){const s=t[e.type];if(Array.isArray(s)){const[t,r,...o]=s;return t(u(e,r),...o)}return s}(e,r)}const l="#6FC3DF",d={"editor.foreground":{dark:"#bbbbbb",light:"#333333",hc:"#ffffff"},"editorLineNumber.foreground":{dark:"#858585",light:"#237893",hc:"#fffffe"},"editor.selectionBackground":{light:"#ADD6FF",dark:"#264F78",hc:"#f3f518"},"editor.background":{light:"#fffffe",dark:"#1E1E1E",hc:"#000000"},"editorGroupHeader.tabsBackground":{dark:"#252526",light:"#F3F3F3"},"tab.activeBackground":"editor.background","tab.activeForeground":{dark:"#ffffff",light:"#333333",hc:"#ffffff"},"tab.border":{dark:"#252526",light:"#F3F3F3",hc:l},"tab.activeBorder":"tab.activeBackground","tab.inactiveBackground":{dark:"#2D2D2D",light:"#ECECEC"},"tab.inactiveForeground":{dark:[i,"tab.activeForeground",.5],light:[i,"tab.activeForeground",.5],hc:"#ffffff"},"diffEditor.insertedTextBackground":{dark:"#9ccc2c33",light:"#9ccc2c40"},"diffEditor.removedTextBackground":{dark:"#ff000033",light:"#ff000033"},"diffEditor.insertedLineBackground":{dark:"#9bb95533",light:"#9bb95533"},"diffEditor.removedLineBackground":{dark:"#ff000033",light:"#ff000033"},"icon.foreground":{dark:"#C5C5C5",light:"#424242",hc:"#FFFFFF"},"sideBar.background":{dark:"#252526",light:"#F3F3F3",hc:"#000000"},"sideBar.foreground":"editor.foreground","sideBar.border":"sideBar.background","list.inactiveSelectionBackground":{dark:"#37373D",light:"#E4E6F1"},"list.inactiveSelectionForeground":{},"list.hoverBackground":{dark:"#2A2D2E",light:"#F0F0F0"},"list.hoverForeground":{},"editorGroupHeader.tabsBorder":{hc:l},"tab.activeBorderTop":{hc:l},"tab.hoverBackground":"tab.inactiveBackground","tab.hoverForeground":"tab.inactiveForeground","editor.rangeHighlightBackground":{dark:"#ffffff0b",light:"#fdff0033"},"editor.infoForeground":{dark:"#3794FF",light:"#1a85ff",hc:"#3794FF"},"input.border":{hc:l},"input.background":{dark:"#3C3C3C",light:"#fffffe",hc:"#000000"},"input.foreground":"editor.foreground","editor.lineHighlightBackground":{},focusBorder:{light:"#0090F1",dark:"#007FD4",hc:l},"editorGroup.border":{dark:"#444444",light:"#E7E7E7",hc:l},"list.activeSelectionBackground":{dark:"#094771",light:"#0060C0",hc:"#000000"},"list.activeSelectionForeground":{dark:"#fffffe",light:"#fffffe",hc:"#fffffe"},"lighter.inlineBackground":{dark:[i,"editor.background",.9],light:[i,"editor.background",.9]},"terminal.background":"editor.background","terminal.foreground":"editor.foreground","terminal.ansiBlack":{dark:"#000000",light:"#000000",hc:"#000000"},"terminal.ansiRed":{dark:"#cd3131",light:"#cd3131",hc:"#cd0000"},"terminal.ansiGreen":{dark:"#0DBC79",light:"#00BC00",hc:"#00cd00"},"terminal.ansiYellow":{dark:"#e5e510",light:"#949800",hc:"#cdcd00"},"terminal.ansiBlue":{dark:"#2472c8",light:"#0451a5",hc:"#0000ee"},"terminal.ansiMagenta":{dark:"#bc3fbc",light:"#bc05bc",hc:"#cd00cd"},"terminal.ansiCyan":{dark:"#11a8cd",light:"#0598bc",hc:"#00cdcd"},"terminal.ansiWhite":{dark:"#e5e5e5",light:"#555555",hc:"#e5e5e5"},"terminal.ansiBrightBlack":{dark:"#666666",light:"#666666",hc:"#7f7f7f"},"terminal.ansiBrightRed":{dark:"#f14c4c",light:"#cd3131",hc:"#ff0000"},"terminal.ansiBrightGreen":{dark:"#23d18b",light:"#14CE14",hc:"#00ff00"},"terminal.ansiBrightYellow":{dark:"#f5f543",light:"#b5ba00",hc:"#ffff00"},"terminal.ansiBrightBlue":{dark:"#3b8eea",light:"#0451a5",hc:"#5c5cff"},"terminal.ansiBrightMagenta":{dark:"#d670d6",light:"#bc05bc",hc:"#ff00ff"},"terminal.ansiBrightCyan":{dark:"#29b8db",light:"#0598bc",hc:"#00ffff"},"terminal.ansiBrightWhite":{dark:"#e5e5e5",light:"#a5a5a5",hc:"#ffffff"}},h=new Map,p=new Map;async function m(e){if("string"==typeof e){const t=e;if(!b.includes(t))throw new y(t);if(!h.has(t)){const e=async function(e){try{return await async function(e){throw new Error("no fs")}()}catch(t){return await s(`themes/${e}`)}}(t).then((e=>(p.set(t,e),e)));h.set(t,e)}return h.get(t)}return e}function f(e){let t=null;if("string"==typeof e){if(t=p.get(e),!t)throw new Error("Syntax highlighting error: theme not loaded")}else t=e;return function(e){if(!e)return;const t=e.settings||e.tokenColors||[],s={name:e.name||"unknown-theme",type:g(e),foreground:"",background:"",settings:t,colors:e.colors||{},colorNames:e.colorNames},r=t.find((e=>!e.scope));if(r){const{foreground:e,background:t}=(null==r?void 0:r.settings)||{},o={};e&&!s.colors["editor.foreground"]&&(o["editor.foreground"]=e),t&&!s.colors["editor.background"]&&(o["editor.background"]=t),Object.keys(o).length>0&&(s.colors=Object.assign(Object.assign({},s.colors),o)),s.foreground=e,s.background=t}r||(s.settings=[{settings:{foreground:u(s,"editor.foreground"),background:u(s,"editor.background")}},...s.settings]);if(s.background=s.background||u(s,"editor.background"),s.foreground=s.foreground||u(s,"editor.foreground"),"from-css"===e.type&&!s.colorNames){const e={};let t=0;s.settings=s.settings.map((s=>{const r=Object.assign(Object.assign({},s),{settings:Object.assign({},s.settings)}),{foreground:o,background:n}=r.settings||{};return o&&!e[o]&&(e[o]=`#${t.toString(16).padStart(6,"0")}`,t++),n&&!e[n]&&(e[n]=`#${t.toString(16).padStart(6,"0")}`,t++),o&&(r.settings.foreground=e[o]),n&&(r.settings.background=e[n]),r})),s.colorNames=e}return s}(t)}function g(e){var t;if("from-css"===e.type)return"from-css";return"light"===(e.type?e.type:(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes("light"))?"light":"dark")?"light":"dark"}const b=["dark-plus","dracula-soft","dracula","github-dark","github-dark-dimmed","github-from-css","github-light","light-plus","material-darker","material-default","material-from-css","material-lighter","material-ocean","material-palenight","min-dark","min-light","monokai","nord","one-dark-pro","poimandres","slack-dark","slack-ochin","solarized-dark","solarized-light"];class y extends Error{constructor(e){super(`Unknown theme: ${e}`),this.theme=e}}function _(e){const t=t=>"colorScheme"===t?a(e):"foreground"===t?e.foreground:"background"===t?e.background:u(e,t);return{colorScheme:t("colorScheme"),foreground:t("foreground"),background:t("background"),lighter:{inlineBackground:t("lighter.inlineBackground")},editor:{background:t("editor.background"),foreground:t("editor.foreground"),lineHighlightBackground:t("editor.lineHighlightBackground"),rangeHighlightBackground:t("editor.rangeHighlightBackground"),infoForeground:t("editor.infoForeground"),selectionBackground:t("editor.selectionBackground")},focusBorder:t("focusBorder"),tab:{activeBackground:t("tab.activeBackground"),activeForeground:t("tab.activeForeground"),inactiveBackground:t("tab.inactiveBackground"),inactiveForeground:t("tab.inactiveForeground"),border:t("tab.border"),activeBorder:t("tab.activeBorder"),activeBorderTop:t("tab.activeBorderTop")},editorGroup:{border:t("editorGroup.border")},editorGroupHeader:{tabsBackground:t("editorGroupHeader.tabsBackground")},editorLineNumber:{foreground:t("editorLineNumber.foreground")},input:{background:t("input.background"),foreground:t("input.foreground"),border:t("input.border")},icon:{foreground:t("icon.foreground")},sideBar:{background:t("sideBar.background"),foreground:t("sideBar.foreground"),border:t("sideBar.border")},list:{activeSelectionBackground:t("list.activeSelectionBackground"),activeSelectionForeground:t("list.activeSelectionForeground"),hoverBackground:t("list.hoverBackground"),hoverForeground:t("list.hoverForeground")}}}const k=["abap","actionscript-3","ada","adoc","angular-html","angular-ts","apache","apex","apl","applescript","ara","asciidoc","asm","astro","awk","ballerina","bash","bat","batch","be","beancount","berry","bibtex","bicep","blade","c","c#","c++","cadence","cdc","clarity","clj","clojure","closure-templates","cmake","cmd","cobol","codeowners","codeql","coffee","coffeescript","common-lisp","console","cpp","cql","crystal","cs","csharp","css","csv","cue","cypher","d","dart","dax","desktop","diff","docker","dockerfile","dotenv","dream-maker","edge","elisp","elixir","elm","emacs-lisp","erb","erl","erlang","f","f#","f03","f08","f18","f77","f90","f95","fennel","fish","fluent","for","fortran-fixed-form","fortran-free-form","fs","fsharp","fsl","ftl","gdresource","gdscript","gdshader","genie","gherkin","git-commit","git-rebase","gjs","gleam","glimmer-js","glimmer-ts","glsl","gnuplot","go","gql","graphql","groovy","gts","hack","haml","handlebars","haskell","haxe","hbs","hcl","hjson","hlsl","hs","html","html-derivative","http","hxml","hy","imba","ini","jade","java","javascript","jinja","jison","jl","js","json","json5","jsonc","jsonl","jsonnet","jssm","jsx","julia","kotlin","kql","kt","kts","kusto","latex","lean","lean4","less","liquid","lisp","lit","log","logo","lua","luau","make","makefile","markdown","marko","matlab","md","mdc","mdx","mediawiki","mermaid","mojo","move","nar","narrat","nextflow","nf","nginx","nim","nix","nu","nushell","objc","objective-c","objective-cpp","ocaml","pascal","perl","perl6","php","plsql","po","postcss","pot","potx","powerquery","powershell","prisma","prolog","properties","proto","ps","ps1","pug","puppet","purescript","py","python","ql","qml","qmldir","qss","r","racket","raku","razor","rb","reg","regex","regexp","rel","riscv","rs","rst","ruby","rust","sas","sass","scala","scheme","scss","sh","shader","shaderlab","shell","shellscript","shellsession","smalltalk","solidity","soy","sparql","spl","splunk","sql","ssh-config","stata","styl","stylus","svelte","swift","system-verilog","systemd","tasl","tcl","templ","terminal","terraform","tex","text","tf","tfvars","toml","ts","ts-tags","tsp","tsv","tsx","turtle","twig","txt","typ","typescript","typespec","typst","v","vala","vb","verilog","vhdl","vim","viml","vimscript","vue","vue-html","vy","vyper","wasm","wenyan","wgsl","wiki","wikitext","wl","wolfram","xml","xsl","yaml","yml","zenscript","zig","zsh","文言"],S={abap:"source.abap","actionscript-3":"source.actionscript.3",ada:"source.ada","angular-html":"text.html.derivative.ng","angular-ts":"source.ts.ng",apache:"source.apacheconf",apex:"source.apex",apl:"source.apl",applescript:"source.applescript",ara:"source.ara",asciidoc:"text.asciidoc",adoc:"text.asciidoc",asm:"source.asm.x86_64",astro:"source.astro",awk:"source.awk",ballerina:"source.ballerina",bat:"source.batchfile",batch:"source.batchfile",beancount:"text.beancount",berry:"source.berry",be:"source.berry",bibtex:"text.bibtex",bicep:"source.bicep",blade:"text.html.php.blade",c:"source.c",cadence:"source.cadence",cdc:"source.cadence",clarity:"source.clar",clojure:"source.clojure",clj:"source.clojure",cmake:"source.cmake",cobol:"source.cobol",codeowners:"text.codeowners",codeql:"source.ql",ql:"source.ql",coffee:"source.coffee",coffeescript:"source.coffee","common-lisp":"source.commonlisp",lisp:"source.commonlisp",cpp:"source.cpp","c++":"source.cpp",crystal:"source.crystal",csharp:"source.cs","c#":"source.cs",cs:"source.cs",css:"source.css",csv:"text.csv",cue:"source.cue",cypher:"source.cypher",cql:"source.cypher",d:"source.d",dart:"source.dart",dax:"source.dax",desktop:"source.desktop",diff:"source.diff",docker:"source.dockerfile",dockerfile:"source.dockerfile",dotenv:"source.dotenv","dream-maker":"source.dm",edge:"text.html.edge",elixir:"source.elixir",elm:"source.elm","emacs-lisp":"source.emacs.lisp",elisp:"source.emacs.lisp",erb:"text.html.erb",erlang:"source.erlang",erl:"source.erlang",fennel:"source.fnl",fish:"source.fish",fluent:"source.ftl",ftl:"source.ftl","fortran-fixed-form":"source.fortran.fixed",f:"source.fortran.fixed",for:"source.fortran.fixed",f77:"source.fortran.fixed","fortran-free-form":"source.fortran.free",f90:"source.fortran.free",f95:"source.fortran.free",f03:"source.fortran.free",f08:"source.fortran.free",f18:"source.fortran.free",fsharp:"source.fsharp","f#":"source.fsharp",fs:"source.fsharp",gdresource:"source.gdresource",gdscript:"source.gdscript",gdshader:"source.gdshader",genie:"source.genie",gherkin:"text.gherkin.feature","git-commit":"text.git-commit","git-rebase":"text.git-rebase",gleam:"source.gleam","glimmer-js":"source.gjs",gjs:"source.gjs","glimmer-ts":"source.gts",gts:"source.gts",glsl:"source.glsl",gnuplot:"source.gnuplot",go:"source.go",graphql:"source.graphql",gql:"source.graphql",groovy:"source.groovy",hack:"source.hack",haml:"text.haml",handlebars:"text.html.handlebars",hbs:"text.html.handlebars",haskell:"source.haskell",hs:"source.haskell",haxe:"source.hx",hcl:"source.hcl",hjson:"source.hjson",hlsl:"source.hlsl",html:"text.html.basic","html-derivative":"text.html.derivative",http:"source.http",hxml:"source.hxml",hy:"source.hy",imba:"source.imba",ini:"source.ini",properties:"source.ini",java:"source.java",javascript:"source.js",js:"source.js",jinja:"source.jinja",jison:"source.jison",json:"source.json",json5:"source.json5",jsonc:"source.json.comments",jsonl:"source.json.lines",jsonnet:"source.jsonnet",jssm:"source.jssm",fsl:"source.jssm",jsx:"source.js.jsx",julia:"source.julia",jl:"source.julia",kotlin:"source.kotlin",kt:"source.kotlin",kts:"source.kotlin",kusto:"source.kusto",kql:"source.kusto",latex:"text.tex.latex",lean:"source.lean4",lean4:"source.lean4",less:"source.css.less",liquid:"text.html.liquid",log:"text.log",logo:"source.logo",lua:"source.lua",luau:"source.luau",make:"source.makefile",makefile:"source.makefile",markdown:"text.html.markdown",md:"text.html.markdown",marko:"text.marko",matlab:"source.matlab",mdc:"text.markdown.mdc",mdx:"source.mdx",mermaid:"markdown.mermaid.codeblock",mojo:"source.mojo",move:"source.move",narrat:"source.narrat",nar:"source.narrat",nextflow:"source.nextflow",nf:"source.nextflow",nginx:"source.nginx",nim:"source.nim",nix:"source.nix",nushell:"source.nushell",nu:"source.nushell","objective-c":"source.objc",objc:"source.objc","objective-cpp":"source.objcpp",ocaml:"source.ocaml",pascal:"source.pascal",perl:"source.perl",php:"source.php",plsql:"source.plsql.oracle",po:"source.po",pot:"source.po",potx:"source.po",postcss:"source.css.postcss",powerquery:"source.powerquery",powershell:"source.powershell",ps:"source.powershell",ps1:"source.powershell",prisma:"source.prisma",prolog:"source.prolog",proto:"source.proto",pug:"text.pug",jade:"text.pug",puppet:"source.puppet",purescript:"source.purescript",python:"source.python",py:"source.python",qml:"source.qml",qmldir:"source.qmldir",qss:"source.qss",r:"source.r",racket:"source.racket",raku:"source.perl.6",perl6:"source.perl.6",razor:"text.aspnetcorerazor",reg:"source.reg",regexp:"source.regexp.python",regex:"source.regexp.python",rel:"source.rel",riscv:"source.riscv",rst:"source.rst",ruby:"source.ruby",rb:"source.ruby",rust:"source.rust",rs:"source.rust",sas:"source.sas",sass:"source.sass",scala:"source.scala",scheme:"source.scheme",scss:"source.css.scss",shaderlab:"source.shaderlab",shader:"source.shaderlab",shellscript:"source.shell",bash:"source.shell",sh:"source.shell",shell:"source.shell",zsh:"source.shell",shellsession:"text.shell-session",console:"text.shell-session",smalltalk:"source.smalltalk",solidity:"source.solidity",soy:"text.html.soy","closure-templates":"text.html.soy",sparql:"source.sparql",splunk:"source.splunk_search",spl:"source.splunk_search",sql:"source.sql","ssh-config":"source.ssh-config",stata:"source.stata",stylus:"source.stylus",styl:"source.stylus",svelte:"source.svelte",swift:"source.swift","system-verilog":"source.systemverilog",systemd:"source.systemd",tasl:"source.tasl",tcl:"source.tcl",templ:"source.templ",terraform:"source.hcl.terraform",tf:"source.hcl.terraform",tfvars:"source.hcl.terraform",tex:"text.tex",toml:"source.toml","ts-tags":"source.ts.tags",lit:"source.ts.tags",tsv:"text.tsv",tsx:"source.tsx",turtle:"source.turtle",twig:"text.html.twig",txt:"source.txt",typescript:"source.ts",ts:"source.ts",typespec:"source.tsp",tsp:"source.tsp",typst:"source.typst",typ:"source.typst",v:"source.v",vala:"source.vala",vb:"source.asp.vb.net",cmd:"source.asp.vb.net",verilog:"source.verilog",vhdl:"source.vhdl",viml:"source.viml",vim:"source.viml",vimscript:"source.viml",vue:"source.vue","vue-html":"text.html.vue-html",vyper:"source.vyper",vy:"source.vyper",wasm:"source.wat",wenyan:"source.wenyan","文言":"source.wenyan",wgsl:"source.wgsl",wikitext:"source.wikitext",mediawiki:"source.wikitext",wiki:"source.wikitext",wolfram:"source.wolfram",wl:"source.wolfram",xml:"text.xml",xsl:"text.xml.xsl",yaml:"source.yaml",yml:"source.yaml",zenscript:"source.zenscript",zig:"source.zig"},x={"source.abap":{id:"abap",embeddedScopes:[]},"source.actionscript.3":{id:"actionscript-3",embeddedScopes:[]},"source.ada":{id:"ada",embeddedScopes:[]},"text.html.derivative.ng":{id:"angular-html",embeddedScopes:["text.html.basic"]},"source.ts.ng":{id:"angular-ts",embeddedScopes:[]},"source.apacheconf":{id:"apache",embeddedScopes:[]},"source.apex":{id:"apex",embeddedScopes:[]},"source.apl":{id:"apl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.json"]},"source.applescript":{id:"applescript",embeddedScopes:[]},"source.ara":{id:"ara",embeddedScopes:[]},"text.asciidoc":{id:"asciidoc",embeddedScopes:["text.html.basic","source.yaml","text.csv","source.c","source.clojure","source.coffee","source.cpp","source.css","source.cs","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.groovy","source.haskell","source.java","source.js","source.json","source.js.jsx","source.julia","source.kotlin","source.css.less","source.makefile","source.objc","source.ocaml","source.perl","source.python","source.r","source.ruby","source.rust","source.sass","source.scala","source.css.scss","source.shell","source.sql","source.swift","source.toml","source.ts","text.xml"]},"source.asm.x86_64":{id:"asm",embeddedScopes:[]},"source.astro":{id:"astro",embeddedScopes:["source.json","source.js","source.ts","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","source.tsx"]},"source.awk":{id:"awk",embeddedScopes:[]},"source.ballerina":{id:"ballerina",embeddedScopes:[]},"source.batchfile":{id:"bat",embeddedScopes:[]},"text.beancount":{id:"beancount",embeddedScopes:[]},"source.berry":{id:"berry",embeddedScopes:[]},"text.bibtex":{id:"bibtex",embeddedScopes:[]},"source.bicep":{id:"bicep",embeddedScopes:[]},"text.html.php.blade":{id:"blade",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.c":{id:"c",embeddedScopes:[]},"source.cadence":{id:"cadence",embeddedScopes:[]},"source.clar":{id:"clarity",embeddedScopes:[]},"source.clojure":{id:"clojure",embeddedScopes:[]},"source.cmake":{id:"cmake",embeddedScopes:[]},"source.cobol":{id:"cobol",embeddedScopes:["source.sql","text.html.basic","source.java"]},"text.codeowners":{id:"codeowners",embeddedScopes:[]},"source.ql":{id:"codeql",embeddedScopes:[]},"source.coffee":{id:"coffee",embeddedScopes:["source.js"]},"source.commonlisp":{id:"common-lisp",embeddedScopes:[]},"source.cpp":{id:"cpp",embeddedScopes:["source.regexp.python","source.glsl","source.sql"]},"source.crystal":{id:"crystal",embeddedScopes:["text.html.basic","source.sql","source.css","source.c","source.js","source.shell"]},"source.cs":{id:"csharp",embeddedScopes:[]},"source.css":{id:"css",embeddedScopes:[]},"text.csv":{id:"csv",embeddedScopes:[]},"source.cue":{id:"cue",embeddedScopes:[]},"source.cypher":{id:"cypher",embeddedScopes:[]},"source.d":{id:"d",embeddedScopes:[]},"source.dart":{id:"dart",embeddedScopes:[]},"source.dax":{id:"dax",embeddedScopes:[]},"source.desktop":{id:"desktop",embeddedScopes:[]},"source.diff":{id:"diff",embeddedScopes:[]},"source.dockerfile":{id:"docker",embeddedScopes:[]},"source.dotenv":{id:"dotenv",embeddedScopes:[]},"source.dm":{id:"dream-maker",embeddedScopes:[]},"text.html.edge":{id:"edge",embeddedScopes:["source.ts","text.html.basic","text.html.derivative"]},"source.elixir":{id:"elixir",embeddedScopes:["text.html.basic"]},"source.elm":{id:"elm",embeddedScopes:["source.glsl"]},"source.emacs.lisp":{id:"emacs-lisp",embeddedScopes:[]},"text.html.erb":{id:"erb",embeddedScopes:["text.html.basic","source.ruby"]},"source.erlang":{id:"erlang",embeddedScopes:[]},"source.fnl":{id:"fennel",embeddedScopes:[]},"source.fish":{id:"fish",embeddedScopes:[]},"source.ftl":{id:"fluent",embeddedScopes:[]},"source.fortran.fixed":{id:"fortran-fixed-form",embeddedScopes:["source.fortran.free"]},"source.fortran.free":{id:"fortran-free-form",embeddedScopes:[]},"source.fsharp":{id:"fsharp",embeddedScopes:["text.html.markdown"]},"source.gdresource":{id:"gdresource",embeddedScopes:["source.gdshader","source.gdscript"]},"source.gdscript":{id:"gdscript",embeddedScopes:[]},"source.gdshader":{id:"gdshader",embeddedScopes:[]},"source.genie":{id:"genie",embeddedScopes:[]},"text.gherkin.feature":{id:"gherkin",embeddedScopes:[]},"text.git-commit":{id:"git-commit",embeddedScopes:["source.diff"]},"text.git-rebase":{id:"git-rebase",embeddedScopes:["source.shell"]},"source.gleam":{id:"gleam",embeddedScopes:[]},"source.gjs":{id:"glimmer-js",embeddedScopes:["source.js","source.ts","source.css","text.html.basic"]},"source.gts":{id:"glimmer-ts",embeddedScopes:["source.ts","source.css","source.js","text.html.basic"]},"source.glsl":{id:"glsl",embeddedScopes:["source.c"]},"source.gnuplot":{id:"gnuplot",embeddedScopes:[]},"source.go":{id:"go",embeddedScopes:[]},"source.graphql":{id:"graphql",embeddedScopes:["source.js","source.ts","source.js.jsx","source.tsx"]},"source.groovy":{id:"groovy",embeddedScopes:[]},"source.hack":{id:"hack",embeddedScopes:["text.html.basic","source.sql"]},"text.haml":{id:"haml",embeddedScopes:["source.ruby","source.js","source.sass","source.coffee","text.html.markdown","source.css"]},"text.html.handlebars":{id:"handlebars",embeddedScopes:["text.html.basic","source.css","source.js","source.yaml"]},"source.haskell":{id:"haskell",embeddedScopes:[]},"source.hx":{id:"haxe",embeddedScopes:[]},"source.hcl":{id:"hcl",embeddedScopes:[]},"source.hjson":{id:"hjson",embeddedScopes:[]},"source.hlsl":{id:"hlsl",embeddedScopes:[]},"text.html.basic":{id:"html",embeddedScopes:["source.js","source.css"]},"text.html.derivative":{id:"html-derivative",embeddedScopes:["text.html.basic"]},"source.http":{id:"http",embeddedScopes:["source.shell","source.json","text.xml","source.graphql"]},"source.hxml":{id:"hxml",embeddedScopes:["source.hx"]},"source.hy":{id:"hy",embeddedScopes:[]},"source.imba":{id:"imba",embeddedScopes:["source.ts"]},"source.ini":{id:"ini",embeddedScopes:[]},"source.java":{id:"java",embeddedScopes:[]},"source.js":{id:"javascript",embeddedScopes:[]},"source.jinja":{id:"jinja",embeddedScopes:[]},"source.jison":{id:"jison",embeddedScopes:["source.js"]},"source.json":{id:"json",embeddedScopes:[]},"source.json5":{id:"json5",embeddedScopes:[]},"source.json.comments":{id:"jsonc",embeddedScopes:[]},"source.json.lines":{id:"jsonl",embeddedScopes:[]},"source.jsonnet":{id:"jsonnet",embeddedScopes:[]},"source.jssm":{id:"jssm",embeddedScopes:[]},"source.js.jsx":{id:"jsx",embeddedScopes:[]},"source.julia":{id:"julia",embeddedScopes:["source.cpp","source.python","source.js","source.r","source.sql"]},"source.kotlin":{id:"kotlin",embeddedScopes:[]},"source.kusto":{id:"kusto",embeddedScopes:[]},"text.tex.latex":{id:"latex",embeddedScopes:["text.tex","source.shell","source.css","source.gnuplot","source.haskell","text.html.basic","source.java","source.julia","source.js","source.lua","source.python","source.ruby","source.rust","source.ts","text.xml","source.yaml","source.scala"]},"source.lean4":{id:"lean",embeddedScopes:[]},"source.css.less":{id:"less",embeddedScopes:[]},"text.html.liquid":{id:"liquid",embeddedScopes:["text.html.basic","source.css","source.json","source.js"]},"text.log":{id:"log",embeddedScopes:[]},"source.logo":{id:"logo",embeddedScopes:[]},"source.lua":{id:"lua",embeddedScopes:["source.c"]},"source.luau":{id:"luau",embeddedScopes:[]},"source.makefile":{id:"make",embeddedScopes:[]},"text.html.markdown":{id:"markdown",embeddedScopes:["source.css","text.html.basic","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","text.git-commit","text.git-rebase","source.go","source.groovy","text.pug","source.js","source.json","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.regexp.python","source.rust","source.scala","source.shell","source.ts","source.tsx","source.cs","source.fsharp","source.dart","text.html.handlebars","text.log","source.erlang","source.elixir","text.tex.latex","text.bibtex","text.html.derivative"]},"text.marko":{id:"marko",embeddedScopes:["source.css","source.css.less","source.css.scss","source.js"]},"source.matlab":{id:"matlab",embeddedScopes:[]},"text.markdown.mdc":{id:"mdc",embeddedScopes:["text.html.markdown","source.yaml","text.html.derivative"]},"source.mdx":{id:"mdx",embeddedScopes:["source.tsx","source.toml","source.yaml","source.c","source.clojure","source.coffee","source.cpp","source.cs","source.css","source.diff","source.dockerfile","source.elixir","source.elm","source.erlang","source.go","source.graphql","source.haskell","text.html.basic","source.ini","source.java","source.js","source.json","source.julia","source.kotlin","source.css.less","source.lua","source.makefile","text.html.markdown","source.objc","source.perl","source.python","source.r","source.ruby","source.rust","source.scala","source.css.scss","source.shell","text.shell-session","source.sql","text.xml","source.swift","source.ts"]},"markdown.mermaid.codeblock":{id:"mermaid",embeddedScopes:[]},"source.mojo":{id:"mojo",embeddedScopes:[]},"source.move":{id:"move",embeddedScopes:[]},"source.narrat":{id:"narrat",embeddedScopes:[]},"source.nextflow":{id:"nextflow",embeddedScopes:[]},"source.nginx":{id:"nginx",embeddedScopes:["source.lua"]},"source.nim":{id:"nim",embeddedScopes:["source.c","text.html.basic","text.xml","source.js","source.css","source.glsl","text.html.markdown"]},"source.nix":{id:"nix",embeddedScopes:[]},"source.nushell":{id:"nushell",embeddedScopes:[]},"source.objc":{id:"objective-c",embeddedScopes:[]},"source.objcpp":{id:"objective-cpp",embeddedScopes:[]},"source.ocaml":{id:"ocaml",embeddedScopes:[]},"source.pascal":{id:"pascal",embeddedScopes:[]},"source.perl":{id:"perl",embeddedScopes:["text.html.basic","text.xml","source.css","source.js","source.sql"]},"source.php":{id:"php",embeddedScopes:["text.html.basic","text.xml","source.sql","source.js","source.json","source.css"]},"source.plsql.oracle":{id:"plsql",embeddedScopes:[]},"source.po":{id:"po",embeddedScopes:[]},"source.css.postcss":{id:"postcss",embeddedScopes:[]},"source.powerquery":{id:"powerquery",embeddedScopes:[]},"source.powershell":{id:"powershell",embeddedScopes:[]},"source.prisma":{id:"prisma",embeddedScopes:[]},"source.prolog":{id:"prolog",embeddedScopes:[]},"source.proto":{id:"proto",embeddedScopes:[]},"text.pug":{id:"pug",embeddedScopes:["source.js","source.css","source.sass","source.css.scss","source.stylus","source.coffee","text.html.basic"]},"source.puppet":{id:"puppet",embeddedScopes:[]},"source.purescript":{id:"purescript",embeddedScopes:[]},"source.python":{id:"python",embeddedScopes:[]},"source.qml":{id:"qml",embeddedScopes:["source.js"]},"source.qmldir":{id:"qmldir",embeddedScopes:[]},"source.qss":{id:"qss",embeddedScopes:[]},"source.r":{id:"r",embeddedScopes:[]},"source.racket":{id:"racket",embeddedScopes:[]},"source.perl.6":{id:"raku",embeddedScopes:[]},"text.aspnetcorerazor":{id:"razor",embeddedScopes:["text.html.basic","source.cs"]},"source.reg":{id:"reg",embeddedScopes:[]},"source.regexp.python":{id:"regexp",embeddedScopes:[]},"source.rel":{id:"rel",embeddedScopes:[]},"source.riscv":{id:"riscv",embeddedScopes:[]},"source.rst":{id:"rst",embeddedScopes:["text.html.derivative","source.cpp","source.python","source.js","source.shell","source.yaml","source.cmake","source.ruby"]},"source.ruby":{id:"ruby",embeddedScopes:["text.html.basic","text.xml","source.sql","source.css","source.c","source.js","source.shell","source.lua"]},"source.rust":{id:"rust",embeddedScopes:[]},"source.sas":{id:"sas",embeddedScopes:["source.sql"]},"source.sass":{id:"sass",embeddedScopes:[]},"source.scala":{id:"scala",embeddedScopes:[]},"source.scheme":{id:"scheme",embeddedScopes:[]},"source.css.scss":{id:"scss",embeddedScopes:["source.css"]},"source.shaderlab":{id:"shaderlab",embeddedScopes:["source.hlsl"]},"source.shell":{id:"shellscript",embeddedScopes:[]},"text.shell-session":{id:"shellsession",embeddedScopes:["source.shell"]},"source.smalltalk":{id:"smalltalk",embeddedScopes:[]},"source.solidity":{id:"solidity",embeddedScopes:[]},"text.html.soy":{id:"soy",embeddedScopes:["text.html.basic"]},"source.sparql":{id:"sparql",embeddedScopes:["source.turtle"]},"source.splunk_search":{id:"splunk",embeddedScopes:[]},"source.sql":{id:"sql",embeddedScopes:[]},"source.ssh-config":{id:"ssh-config",embeddedScopes:[]},"source.stata":{id:"stata",embeddedScopes:["source.sql"]},"source.stylus":{id:"stylus",embeddedScopes:[]},"source.svelte":{id:"svelte",embeddedScopes:["source.js","source.ts","source.coffee","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.css.postcss","text.pug","text.html.markdown"]},"source.swift":{id:"swift",embeddedScopes:[]},"source.systemverilog":{id:"system-verilog",embeddedScopes:[]},"source.systemd":{id:"systemd",embeddedScopes:[]},"source.tasl":{id:"tasl",embeddedScopes:[]},"source.tcl":{id:"tcl",embeddedScopes:[]},"source.templ":{id:"templ",embeddedScopes:["source.go","source.js","source.css"]},"source.hcl.terraform":{id:"terraform",embeddedScopes:[]},"text.tex":{id:"tex",embeddedScopes:["source.r"]},"source.toml":{id:"toml",embeddedScopes:[]},"source.ts.tags":{id:"ts-tags",embeddedScopes:["source.ts"]},"text.tsv":{id:"tsv",embeddedScopes:[]},"source.tsx":{id:"tsx",embeddedScopes:[]},"source.turtle":{id:"turtle",embeddedScopes:[]},"text.html.twig":{id:"twig",embeddedScopes:["source.css","source.js","source.css.scss","source.php","source.python","source.ruby"]},"source.txt":{id:"txt",embeddedScopes:[]},"source.ts":{id:"typescript",embeddedScopes:[]},"source.tsp":{id:"typespec",embeddedScopes:[]},"source.typst":{id:"typst",embeddedScopes:[]},"source.v":{id:"v",embeddedScopes:[]},"source.vala":{id:"vala",embeddedScopes:[]},"source.asp.vb.net":{id:"vb",embeddedScopes:[]},"source.verilog":{id:"verilog",embeddedScopes:[]},"source.vhdl":{id:"vhdl",embeddedScopes:[]},"source.viml":{id:"viml",embeddedScopes:[]},"source.vue":{id:"vue",embeddedScopes:["text.html.basic","text.html.markdown","text.pug","source.stylus","source.sass","source.css","source.css.scss","source.css.less","source.js","source.ts","source.js.jsx","source.tsx","source.coffee","source.json","source.json.comments","source.json5","source.yaml","source.toml","source.graphql","text.html.derivative"]},"text.html.vue-html":{id:"vue-html",embeddedScopes:["source.vue","source.js"]},"source.vyper":{id:"vyper",embeddedScopes:[]},"source.wat":{id:"wasm",embeddedScopes:[]},"source.wenyan":{id:"wenyan",embeddedScopes:[]},"source.wgsl":{id:"wgsl",embeddedScopes:[]},"source.wikitext":{id:"wikitext",embeddedScopes:["text.html.basic","source.css","source.ini","source.java","source.lua","source.makefile","source.perl","source.r","source.ruby","source.php","source.sql","source.asp.vb.net","text.xml","text.xml.xsl","source.yaml","source.batchfile","source.clojure","source.coffee","source.c","source.cpp","source.diff","source.dockerfile","source.go","source.groovy","text.pug","source.js","source.json.comments","source.css.less","source.objc","source.swift","source.css.scss","source.perl.6","source.powershell","source.python","source.julia","source.rust","source.scala","source.shell","source.ts","source.cs","source.fsharp","source.dart","text.html.handlebars","text.html.markdown","source.erlang","source.elixir","text.tex.latex","text.bibtex","source.json"]},"source.wolfram":{id:"wolfram",embeddedScopes:[]},"text.xml":{id:"xml",embeddedScopes:["source.java"]},"text.xml.xsl":{id:"xsl",embeddedScopes:["text.xml"]},"source.yaml":{id:"yaml",embeddedScopes:[]},"source.zenscript":{id:"zenscript",embeddedScopes:[]},"source.zig":{id:"zig",embeddedScopes:[]}};var w={d:(e,t)=>{for(var s in t)w.o(t,s)&&!w.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},v={};w.d(v,{_X:()=>Ke,Bz:()=>Qe,ot:()=>He,u:()=>ze,jG:()=>P,Pn:()=>Ve});const C="undefined"!=typeof process&&!!process.env.VSCODE_TEXTMATE_DEBUG;var j;function A(e,t){const s=[],r=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,s=t.exec(e);return{next:()=>{if(!s)return null;const r=s[0];return s=t.exec(e),r}}}(e);let o=r.next();for(;null!==o;){let e=0;if(2===o.length&&":"===o.charAt(1)){switch(o.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let t=c();if(s.push({matcher:t,priority:e}),","!==o)break;o=r.next()}return s;function n(){if("-"===o){o=r.next();const e=n();return t=>!!e&&!e(t)}if("("===o){o=r.next();const e=function(){const e=[];let t=c();for(;t&&(e.push(t),"|"===o||","===o);){do{o=r.next()}while("|"===o||","===o);t=c()}return t=>e.some((e=>e(t)))}();return")"===o&&(o=r.next()),e}if(N(o)){const e=[];do{e.push(o),o=r.next()}while(N(o));return s=>t(e,s)}return null}function c(){const e=[];let t=n();for(;t;)e.push(t),t=n();return t=>e.every((e=>e(t)))}}function N(e){return!!e&&!!e.match(/[\w\.:]+/)}function P(e){"function"==typeof e.dispose&&e.dispose()}function R(e){return Array.isArray(e)?function(e){let t=[];for(let s=0,r=e.length;s{for(let s in t)e[s]=t[s]})),e}function I(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return 0===t?e:~t==e.length-1?I(e.substring(0,e.length-1)):e.substr(1+~t)}!function(e){e.toBinaryStr=function(e){let t=e.toString(2);for(;t.length<32;)t="0"+t;return t},e.print=function(t){const s=e.getLanguageId(t),r=e.getTokenType(t),o=e.getFontStyle(t),n=e.getForeground(t),c=e.getBackground(t);console.log({languageId:s,tokenType:r,fontStyle:o,foreground:n,background:c})},e.getLanguageId=function(e){return(255&e)>>>0},e.getTokenType=function(e){return(768&e)>>>8},e.containsBalancedBrackets=function(e){return 0!=(1024&e)},e.getFontStyle=function(e){return(30720&e)>>>11},e.getForeground=function(e){return(16744448&e)>>>15},e.getBackground=function(e){return(4278190080&e)>>>24},e.set=function(t,s,r,o,n,c,i){let a=e.getLanguageId(t),u=e.getTokenType(t),l=e.containsBalancedBrackets(t)?1:0,d=e.getFontStyle(t),h=e.getForeground(t),p=e.getBackground(t);return 0!==s&&(a=s),8!==r&&(u=r),null!==o&&(l=o?1:0),-1!==n&&(d=n),0!==c&&(h=c),0!==i&&(p=i),(a<<0|u<<8|l<<10|d<<11|h<<15|p<<24)>>>0}}(j||(j={}));let L=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;class B{static hasCaptures(e){return null!==e&&(L.lastIndex=0,L.test(e))}static replaceCaptures(e,t,s){return e.replace(L,((e,r,o,n)=>{let c=s[parseInt(r||o,10)];if(!c)return e;{let e=t.substring(c.start,c.end);for(;"."===e[0];)e=e.substring(1);switch(n){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}}))}}function O(e,t){return et?1:0}function G(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let s=e.length,r=t.length;if(s===r){for(let r=0;r`);return}const n=s.lookup(t);e instanceof M?Q({baseGrammar:n,selfGrammar:o},r):H(e.ruleName,{baseGrammar:n,selfGrammar:o,repository:o.repository},r);const c=s.injections(e.scopeName);if(c)for(const e of c)r.add(new M(e))}function H(e,t,s){t.repository&&t.repository[e]&&K([t.repository[e]],t,s)}function Q(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&K(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&K(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function K(e,t,s){for(const r of e){if(s.visitedRule.has(r))continue;s.visitedRule.add(r);const e=r.repository?E({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&K(r.patterns,{...t,repository:e},s);const o=r.include;if(!o)continue;const n=ee(o);switch(n.kind){case 0:Q({...t,selfGrammar:t.baseGrammar},s);break;case 1:Q(t,s);break;case 2:H(n.ruleName,{...t,repository:e},s);break;case 3:case 4:const r=n.scopeName===t.selfGrammar.scopeName?t.selfGrammar:n.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){const o={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};4===n.kind?H(n.ruleName,o,s):Q(o,s)}else 4===n.kind?s.add(new W(n.scopeName,n.ruleName)):s.add(new M(n.scopeName))}}}class V{constructor(){this.kind=0}}class Y{constructor(){this.kind=1}}class X{constructor(e){this.ruleName=e,this.kind=2}}class J{constructor(e){this.scopeName=e,this.kind=3}}class Z{constructor(e,t){this.scopeName=e,this.ruleName=t,this.kind=4}}function ee(e){if("$base"===e)return new V;if("$self"===e)return new Y;const t=e.indexOf("#");if(-1===t)return new J(e);if(0===t)return new X(e.substring(1));{const s=e.substring(0,t),r=e.substring(t+1);return new Z(s,r)}}const te=/\\(\d+)/,se=/\\(\d+)/g;class re{constructor(e,t,s,r){this.$location=e,this.id=t,this._name=s||null,this._nameIsCapturing=B.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=B.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${I(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?B.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?B.replaceCaptures(this._contentName,e,t):this._contentName}}class oe extends re{constructor(e,t,s,r,o){super(e,t,s,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,s,r){throw new Error("Not supported!")}}class ne extends re{constructor(e,t,s,r,o){super(e,t,s,null),this._match=new le(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,s,r){return this._getCachedCompiledPatterns(e).compileAG(e,s,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new de,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class ce extends re{constructor(e,t,s,r,o){super(e,t,s,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const s of this.patterns)e.getRule(s).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,s,r){return this._getCachedCompiledPatterns(e).compileAG(e,s,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new de,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}class ie extends re{constructor(e,t,s,r,o,n,c,i,a,u){super(e,t,s,r),this._begin=new le(o,this.id),this.beginCaptures=n,this._end=new le(c||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=a||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,s,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,s,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new de;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}}class ae extends re{constructor(e,t,s,r,o,n,c,i,a){super(e,t,s,r),this._begin=new le(o,this.id),this.beginCaptures=n,this.whileCaptures=i,this._while=new le(c,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,s,r){return this._getCachedCompiledPatterns(e).compileAG(e,s,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new de;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,s,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,s,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new de,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}}class ue{static createCaptureRule(e,t,s,r,o){return e.registerRule((e=>new oe(t,e,s,r,o)))}static getCompiledRuleId(e,t,s){return e.id||t.registerRule((r=>{if(e.id=r,e.match)return new ne(e.$vscodeTextmateLocation,e.id,e.name,e.match,ue._compileCaptures(e.captures,t,s));if(void 0===e.begin){e.repository&&(s=E({},s,e.repository));let r=e.patterns;return void 0===r&&e.include&&(r=[{include:e.include}]),new ce(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,ue._compilePatterns(r,t,s))}return e.while?new ae(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ue._compileCaptures(e.beginCaptures||e.captures,t,s),e.while,ue._compileCaptures(e.whileCaptures||e.captures,t,s),ue._compilePatterns(e.patterns,t,s)):new ie(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,ue._compileCaptures(e.beginCaptures||e.captures,t,s),e.end,ue._compileCaptures(e.endCaptures||e.captures,t,s),e.applyEndPatternLast,ue._compilePatterns(e.patterns,t,s))})),e.id}static _compileCaptures(e,t,s){let r=[];if(e){let o=0;for(const t in e){if("$vscodeTextmateLocation"===t)continue;const e=parseInt(t,10);e>o&&(o=e)}for(let e=0;e<=o;e++)r[e]=null;for(const o in e){if("$vscodeTextmateLocation"===o)continue;const n=parseInt(o,10);let c=0;e[o].patterns&&(c=ue.getCompiledRuleId(e[o],t,s)),r[n]=ue.createCaptureRule(t,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,t,s){let r=[];if(e)for(let o=0,n=e.length;oe.substring(t.start,t.end)));return se.lastIndex=0,this.source.replace(se,((e,t)=>q(s[parseInt(t,10)]||"")))}_buildAnchorCache(){let e,t,s,r,o=[],n=[],c=[],i=[];for(e=0,t=this.source.length;ee.source));this._cached=new he(e,t,this._items.map((e=>e.ruleId)))}return this._cached}compileAG(e,t,s){return this._hasAnchors?t?s?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,s)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,s)),this._anchorCache.A1_G0):s?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,s)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,s)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,s){let r=this._items.map((e=>e.resolveAnchors(t,s)));return new he(e,r,this._items.map((e=>e.ruleId)))}}class he{constructor(e,t,s){this.regExps=t,this.rules=s,this.scanner=e.createOnigScanner(t)}dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,s=this.rules.length;tthis._root.match(e)))}static createFromRawTheme(e,t){return this.createFromParsedTheme(function(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,s=[],r=0;for(let e=0,o=t.length;e1&&(l=n.slice(0,n.length-1),l.reverse()),s[r++]=new be(u,l,e,c,i,a)}}return s}(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort(((e,t)=>{let s=O(e.scope,t.scope);return 0!==s?s:(s=G(e.parentScopes,t.parentScopes),0!==s?s:e.index-t.index)}));let s=0,r="#000000",o="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(s=t.fontStyle),null!==t.foreground&&(r=t.foreground),null!==t.background&&(o=t.background)}let n=new ye(t),c=new ge(s,n.getId(r),n.getId(o)),i=new ke(new _e(0,null,-1,0,0),[]);for(let t=0,s=e.length;tfunction(e,t){if(null===t)return!0;let s=0,r=t[s];for(;e;){if(fe(e.scopeName,r)){if(s++,s===t.length)return!0;r=t[s]}e=e.parent}return!1}(e.parent,t.parentScopes)));return s?new ge(s.fontStyle,s.foreground,s.background):null}}class me{constructor(e,t){this.parent=e,this.scopeName=t}static push(e,t){for(const s of t)e=new me(e,s);return e}static from(...e){let t=null;for(let s=0;se?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==s&&(this.foreground=s),0!==r&&(this.background=r)}}class ke{constructor(e,t=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=t}static _sortBySpecificity(e){return 1===e.length||e.sort(this._cmpBySpecificity),e}static _cmpBySpecificity(e,t){if(e.scopeDepth===t.scopeDepth){const s=e.parentScopes,r=t.parentScopes;let o=null===s?0:s.length,n=null===r?0:r.length;if(o===n)for(let e=0;e{const t=this._scopeToLanguage(e),s=this._toStandardTokenType(e);return new Se(t,s)})),this._defaultAttributes=new Se(e,8),this._embeddedLanguagesMatcher=new we(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return null===e?xe._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(xe.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}}xe._NULL_SCOPE_METADATA=new Se(0,0),xe.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class we{constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map((([e,t])=>q(e)));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}}class ve{constructor(e,t){this.stack=e,this.stoppedEarly=t}}function Ce(e,t,s,r,o,n,c,i){const a=t.content.length;let u=!1,l=-1;if(c){const c=function(e,t,s,r,o,n){let c=o.beginRuleCapturedEOL?0:-1;const i=[];for(let t=o;t;t=t.pop()){const s=t.getRule(e);s instanceof ae&&i.push({rule:s,stack:t})}for(let a=i.pop();a;a=i.pop()){const{ruleScanner:i,findOptions:u}=Ae(a.rule,e,a.stack.endRule,s,r===c),l=i.findNextMatchSync(t,r,u);if(C&&(console.log(" scanning for while rule"),console.log(i.toString())),!l){C&&console.log(" popping "+a.rule.debugName+" - "+a.rule.debugWhileRegExp),o=a.stack.pop();break}if(-2!==l.ruleId){o=a.stack.pop();break}l.captureIndices&&l.captureIndices.length&&(n.produce(a.stack,l.captureIndices[0].start),Ne(e,t,s,a.stack,n,a.rule.whileCaptures,l.captureIndices),n.produce(a.stack,l.captureIndices[0].end),c=l.captureIndices[0].end,l.captureIndices[0].end>r&&(r=l.captureIndices[0].end,s=!1))}return{stack:o,linePos:r,anchorPosition:c,isFirstLine:s}}(e,t,s,r,o,n);o=c.stack,r=c.linePos,s=c.isFirstLine,l=c.anchorPosition}const d=Date.now();for(;!u;){if(0!==i&&Date.now()-d>i)return new ve(o,!0);h()}return new ve(o,!1);function h(){C&&(console.log(""),console.log(`@@scanNext ${r}: |${t.content.substr(r).replace(/\n$/,"\\n")}|`));const c=function(e,t,s,r,o,n){const c=function(e,t,s,r,o,n){const c=o.getRule(e),{ruleScanner:i,findOptions:a}=je(c,e,o.endRule,s,r===n);let u=0;C&&(u=$());const l=i.findNextMatchSync(t,r,a);if(C){const e=$()-u;e>5&&console.warn(`Rule ${c.debugName} (${c.id}) matching took ${e} against '${t}'`),console.log(` scanning for (linePos: ${r}, anchorPosition: ${n})`),console.log(i.toString()),l&&console.log(`matched rule id: ${l.ruleId} from ${l.captureIndices[0].start} to ${l.captureIndices[0].end}`)}return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}(e,t,s,r,o,n),i=e.getInjections();if(0===i.length)return c;const a=function(e,t,s,r,o,n,c){let i,a=Number.MAX_VALUE,u=null,l=0;const d=n.contentNameScopesList.getScopeNames();for(let n=0,h=e.length;n=a)&&(a=b,u=g.captureIndices,i=g.ruleId,l=h.priority,a===o))break}return u?{priorityMatch:-1===l,captureIndices:u,matchedRuleId:i}:null}(i,e,t,s,r,o,n);if(!a)return c;if(!c)return a;const u=c.captureIndices[0].start,l=a.captureIndices[0].start;return l0)&&i[0].end>r;if(-1===d){const c=o.getRule(e);C&&console.log(" popping "+c.debugName+" - "+c.debugEndRegExp),n.produce(o,i[0].start),o=o.withContentNameScopesList(o.nameScopesList),Ne(e,t,s,o,n,c.endCaptures,i),n.produce(o,i[0].end);const d=o;if(o=o.parent,l=d.getAnchorPos(),!h&&d.getEnterPos()===r)return C&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),o=d,n.produce(o,a),void(u=!0)}else{const c=e.getRule(d);n.produce(o,i[0].start);const p=o,m=c.getName(t.content,i),f=o.contentNameScopesList.pushAttributed(m,e);if(o=o.push(d,r,l,i[0].end===a,null,f,f),c instanceof ie){const r=c;C&&console.log(" pushing "+r.debugName+" - "+r.debugBeginRegExp),Ne(e,t,s,o,n,r.beginCaptures,i),n.produce(o,i[0].end),l=i[0].end;const d=r.getContentName(t.content,i),m=f.pushAttributed(d,e);if(o=o.withContentNameScopesList(m),r.endHasBackReferences&&(o=o.withEndRule(r.getEndWithResolvedBackReferences(t.content,i))),!h&&p.hasSameRuleAs(o))return C&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),o=o.pop(),n.produce(o,a),void(u=!0)}else if(c instanceof ae){const r=c;C&&console.log(" pushing "+r.debugName),Ne(e,t,s,o,n,r.beginCaptures,i),n.produce(o,i[0].end),l=i[0].end;const d=r.getContentName(t.content,i),m=f.pushAttributed(d,e);if(o=o.withContentNameScopesList(m),r.whileHasBackReferences&&(o=o.withEndRule(r.getWhileWithResolvedBackReferences(t.content,i))),!h&&p.hasSameRuleAs(o))return C&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),o=o.pop(),n.produce(o,a),void(u=!0)}else{const r=c;if(C&&console.log(" matched "+r.debugName+" - "+r.debugMatchRegExp),Ne(e,t,s,o,n,r.captures,i),n.produce(o,i[0].end),o=o.pop(),!h)return C&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),o=o.safePop(),n.produce(o,a),void(u=!0)}}i[0].end>r&&(r=i[0].end,s=!1)}}function je(e,t,s,r,o){return{ruleScanner:e.compileAG(t,s,r,o),findOptions:0}}function Ae(e,t,s,r,o){return{ruleScanner:e.compileWhileAG(t,s,r,o),findOptions:0}}function Ne(e,t,s,r,o,n,c){if(0===n.length)return;const i=t.content,a=Math.min(n.length,c.length),u=[],l=c[0].end;for(let t=0;tl)break;for(;u.length>0&&u[u.length-1].endPos<=d.start;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?o.produceFromScopes(u[u.length-1].scopes,d.start):o.produce(r,d.start),a.retokenizeCapturedWithRuleId){const t=a.getName(i,c),n=r.contentNameScopesList.pushAttributed(t,e),u=a.getContentName(i,c),l=n.pushAttributed(u,e),h=r.push(a.retokenizeCapturedWithRuleId,d.start,-1,!1,null,n,l),p=e.createOnigString(i.substring(0,d.end));Ce(e,p,s&&0===d.start,d.start,h,o,!1,0),P(p);continue}const h=a.getName(i,c);if(null!==h){const t=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);u.push(new Pe(t,d.end))}}for(;u.length>0;)o.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}class Pe{constructor(e,t){this.scopes=e,this.endPos=t}}function Re(e,t,s,r,o){const n=A(t,Ee),c=ue.getCompiledRuleId(s,r,o.repository);for(const s of n)e.push({debugSelector:t,matcher:s.matcher,ruleId:c,grammar:o,priority:s.priority})}function Ee(e,t){if(t.length{for(let r=s;rs&&e.substr(0,s)===t&&"."===e[s]}class Le{constructor(e,t,s,r,o,n,c,i){if(this._rootScopeName=e,this.balancedBracketSelectors=n,this._onigLib=i,this._basicScopeAttributesProvider=new xe(s,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=c,this._grammar=Be(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const e of Object.keys(o)){const t=A(e,Ee);for(const s of t)this._tokenTypeMatchers.push({matcher:s.matcher,type:o[e]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=[],t=this._rootScopeName,s=(e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e))(t);if(s){const r=s.injections;if(r)for(let t in r)Re(e,t,r[t],this,s);const o=this._grammarRepository.injections(t);o&&o.forEach((t=>{const s=this.getExternalGrammar(t);if(s){const t=s.injectionSelector;t&&Re(e,t,s,this,s)}}))}return e.sort(((e,t)=>e.priority-t.priority)),e}getInjections(){if(null===this._injections&&(this._injections=this._collectInjections(),C&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const e of this._injections)console.log(` - ${e.debugSelector}`)}return this._injections}registerRule(e){const t=++this._lastRuleId,s=e(t);return this._ruleId2desc[t]=s,s}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const s=this._grammarRepository.lookup(e);if(s)return this._includedGrammars[e]=Be(s,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,s=0){const r=this._tokenize(e,t,!1,s);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,s=0){const r=this._tokenize(e,t,!0,s);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,s,r){let o;if(-1===this._rootId&&(this._rootId=ue.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),t&&t!==Ge.NULL)o=!1,t.reset();else{o=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),s=this.themeProvider.getDefaults(),r=j.set(0,e.languageId,e.tokenType,null,s.fontStyle,s.foregroundId,s.backgroundId),n=this.getRule(this._rootId).getName(null,null);let c;c=n?Oe.createRootAndLookUpScopeName(n,r,this):Oe.createRoot("unknown",r),t=new Ge(null,this._rootId,-1,-1,!1,null,c,c)}e+="\n";const n=this.createOnigString(e),c=n.content.length,i=new qe(s,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Ce(this,n,o,0,t,i,!0,r);return P(n),{lineLength:c,lineTokens:i,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}}function Be(e,t){return(e=R(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}class Oe{constructor(e,t,s){this.parent=e,this.scopePath=t,this.tokenAttributes=s}static fromExtension(e,t){let s=e,r=e?.scopePath??null;for(const e of t)r=me.push(r,e.scopeNames),s=new Oe(s,r,e.encodedTokenAttributes);return s}static createRoot(e,t){return new Oe(null,new me(null,e),t)}static createRootAndLookUpScopeName(e,t,s){const r=s.getMetadataForScope(e),o=new me(null,e),n=s.themeProvider.themeMatch(o),c=Oe.mergeAttributes(t,r,n);return new Oe(null,o,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return Oe.equals(this,e)}static equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,s){let r=-1,o=0,n=0;return null!==s&&(r=s.fontStyle,o=s.foregroundId,n=s.backgroundId),j.set(e,t.languageId,t.tokenType,null,r,o,n)}pushAttributed(e,t){if(null===e)return this;if(-1===e.indexOf(" "))return Oe._pushAttributed(this,e,t);const s=e.split(/ /g);let r=this;for(const e of s)r=Oe._pushAttributed(r,e,t);return r}static _pushAttributed(e,t,s){const r=s.getMetadataForScope(t),o=e.scopePath.push(t),n=s.themeProvider.themeMatch(o),c=Oe.mergeAttributes(e.tokenAttributes,r,n);return new Oe(e,o,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const t=[];let s=this;for(;s&&s!==e;)t.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===e?t.reverse():void 0}}class Ge{constructor(e,t,s,r,o,n,c,i){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=o,this.endRule=n,this.nameScopesList=c,this.contentNameScopesList=i,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=r}equals(e){return null!==e&&Ge._equals(this,e)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&Oe.equals(e.contentNameScopesList,t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){Ge._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,s,r,o,n,c){return new Ge(this,e,t,s,r,o,n,c)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new Ge(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,t){const s=Oe.fromExtension(e?.nameScopesList??null,t.nameScopesList);return new Ge(e,t.ruleId,t.enterPos??-1,t.anchorPos??-1,t.beginRuleCapturedEOL,t.endRule,s,Oe.fromExtension(s,t.contentNameScopesList))}}Ge.NULL=new Ge(null,0,0,0,!1,null,null,null);class Te{constructor(e,t){this.allowAny=!1,this.balancedBracketScopes=e.flatMap((e=>"*"===e?(this.allowAny=!0,[]):A(e,Ee).map((e=>e.matcher)))),this.unbalancedBracketScopes=t.flatMap((e=>A(e,Ee).map((e=>e.matcher))))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}}class qe{constructor(e,t,s,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=s,this._lineText=C?t:null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let s=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e?.getScopeNames()??[];for(const e of this._tokenTypeOverrides)e.matcher(t)&&(s=j.set(s,0,e.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(s=j.set(s,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s)return void(this._lastTokenEndIndex=t);if(C){const s=e?.getScopeNames()??[];console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(let e=0;e0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const s=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e0;)10===e.charCodeAt(o)?(o++,n++,c=0):(o++,c++),t--}function a(e){null===s?o=e:i(e-o)}function u(){for(;o0&&65279===e.charCodeAt(0)&&(o=1);let p=0,m=null,f=[],g=[],b=null;function y(e,t){f.push(p),g.push(m),p=e,m=t}function _(){if(0===f.length)return k("illegal state stack");p=f.pop(),m=g.pop()}function k(t){throw new Error("Near offset "+o+": "+t+" ~~~"+e.substr(o,50)+"~~~")}const S=function(){if(null===b)return k("missing ");let e={};null!==s&&(e[s]={filename:t,line:n,char:c}),m[b]=e,b=null,y(1,e)},x=function(){if(null===b)return k("missing ");let e=[];m[b]=e,b=null,y(2,e)},w=function(){let e={};null!==s&&(e[s]={filename:t,line:n,char:c}),m.push(e),y(1,e)},v=function(){let e=[];m.push(e),y(2,e)};function C(){if(1!==p)return k("unexpected ");_()}function j(){return 1===p||2!==p?k("unexpected "):void _()}function A(e){if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function N(e){if(isNaN(e))return k("cannot parse float");if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function P(e){if(isNaN(e))return k("cannot parse integer");if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function R(e){if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function E(e){if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function I(e){if(1===p){if(null===b)return k("missing ");m[b]=e,b=null}else 2===p?m.push(e):m=e}function L(){let e=h(">"),t=!1;return 47===e.charCodeAt(e.length-1)&&(t=!0,e=e.substring(0,e.length-1)),{name:e.trim(),isClosed:t}}function B(e){if(e.isClosed)return"";let t=h(""),t.replace(/&#([0-9]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,10))})).replace(/&#x([0-9a-f]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/&|<|>|"|'/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return e}))}for(;o=r));){const a=e.charCodeAt(o);if(i(1),60!==a)return k("expected <");if(o>=r)return k("unexpected end of input");const h=e.charCodeAt(o);if(63===h){i(1),d("?>");continue}if(33===h){if(i(1),l("--")){d("--\x3e");continue}d(">");continue}if(47===h){if(i(1),u(),l("plist")){d(">");continue}if(l("dict")){d(">"),C();continue}if(l("array")){d(">"),j();continue}return k("unexpected closed tag")}let f=L();switch(f.name){case"dict":1===p?S():2===p?w():(m={},null!==s&&(m[s]={filename:t,line:n,char:c}),y(1,m)),f.isClosed&&C();continue;case"array":1===p?x():2===p?v():(m=[],y(2,m)),f.isClosed&&j();continue;case"key":O=B(f),1!==p?k("unexpected "):null!==b?k("too many "):b=O;continue;case"string":A(B(f));continue;case"real":N(parseFloat(B(f)));continue;case"integer":P(parseInt(B(f),10));continue;case"date":R(new Date(B(f)));continue;case"data":E(B(f));continue;case"true":B(f),I(!0);continue;case"false":B(f),I(!1);continue}if(!/^plist/.test(f.name))return k("unexpected opened tag "+f.name)}var O;return m}function $e(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}class Me{constructor(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0}}class We{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(e){return{filename:e,line:this.line,char:this.char}}}function Ue(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;let s,r=e.source,o=e.pos,n=e.len,c=e.line,i=e.char;for(;;){if(o>=n)return!1;if(s=r.charCodeAt(o),32!==s&&9!==s&&13!==s){if(10!==s)break;o++,c++,i=0}else o++,i++}if(t.offset=o,t.line=c,t.char=i,34===s){for(t.type=1,o++,i++;;){if(o>=n)return!1;if(s=r.charCodeAt(o),o++,i++,92!==s){if(34===s)break}else o++,i++}t.value=r.substring(t.offset+1,o-1).replace(/\\u([0-9A-Fa-f]{4})/g,((e,t)=>String.fromCodePoint(parseInt(t,16)))).replace(/\\(.)/g,((t,s)=>{switch(s){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:$e(e,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===s)t.type=2,o++,i++;else if(123===s)t.type=3,o++,i++;else if(93===s)t.type=4,o++,i++;else if(125===s)t.type=5,o++,i++;else if(58===s)t.type=6,o++,i++;else if(44===s)t.type=7,o++,i++;else if(110===s){if(t.type=8,o++,i++,s=r.charCodeAt(o),117!==s)return!1;if(o++,i++,s=r.charCodeAt(o),108!==s)return!1;if(o++,i++,s=r.charCodeAt(o),108!==s)return!1;o++,i++}else if(116===s){if(t.type=9,o++,i++,s=r.charCodeAt(o),114!==s)return!1;if(o++,i++,s=r.charCodeAt(o),117!==s)return!1;if(o++,i++,s=r.charCodeAt(o),101!==s)return!1;o++,i++}else if(102===s){if(t.type=10,o++,i++,s=r.charCodeAt(o),97!==s)return!1;if(o++,i++,s=r.charCodeAt(o),108!==s)return!1;if(o++,i++,s=r.charCodeAt(o),115!==s)return!1;if(o++,i++,s=r.charCodeAt(o),101!==s)return!1;o++,i++}else for(t.type=11;;){if(o>=n)return!1;if(s=r.charCodeAt(o),!(46===s||s>=48&&s<=57||101===s||69===s||45===s||43===s))break;o++,i++}return t.len=o-t.offset,null===t.value&&(t.value=r.substr(t.offset,t.len)),e.pos=o,e.line=c,e.char=i,!0}class De{constructor(e,t){this._onigLibPromise=t,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}async grammarForScopeName(e,t,s,r,o){if(!this._grammars.has(e)){let n=this._rawGrammars.get(e);if(!n)return null;this._grammars.set(e,function(e,t,s,r,o,n,c,i){return new Le(e,t,s,r,o,n,c,i)}(e,n,t,s,r,o,this,await this._onigLibPromise))}return this._grammars.get(e)}}function ze(e,t){let s=0;const r=[];let o=e,n=t;for(;o!==n;)o&&(!n||o.depth>=n.depth)?(s++,o=o.parent):(r.push(n.toStateStackFrame()),n=n.parent);return{pops:s,newFrames:r.reverse()}}function He(e,t){let s=e;for(let e=0;e0;)await Promise.all(n.Q.map((e=>this._loadSingleGrammar(e.scopeName)))),n.processQueue();return this._grammarForScopeName(e,t,s,r,o)}async _loadSingleGrammar(e){return this._ensureGrammarCache.has(e)||this._ensureGrammarCache.set(e,this._doLoadSingleGrammar(e)),this._ensureGrammarCache.get(e)}async _doLoadSingleGrammar(e){const t=await this._options.loadGrammar(e);if(t){const s="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,s)}}async addGrammar(e,t=[],s=0,r=null){return this._syncRegistry.addGrammar(e,t),await this._grammarForScopeName(e.scopeName,s,r)}_grammarForScopeName(e,t=0,s=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,s,r,o)}}const Ke=Ge.NULL,Ve=function(e,t=null){return null!==t&&/\.json$/.test(t)?(s=e,C?function(e,t,s){let r=new Me(e),o=new We,n=0,c=null,i=[],a=[];function u(){i.push(n),a.push(c)}function l(){n=i.pop(),c=a.pop()}function d(e){$e(r,e)}for(;Ue(r,o);){if(0===n){if(null!==c&&d("too many constructs in root"),3===o.type){c={},c.$vscodeTextmateLocation=o.toLocation(t),u(),n=1;continue}if(2===o.type){c=[],u(),n=4;continue}d("unexpected token in root")}if(2===n){if(5===o.type){l();continue}if(7===o.type){n=3;continue}d("expected , or }")}if(1===n||3===n){if(1===n&&5===o.type){l();continue}if(1===o.type){let e=o.value;if(Ue(r,o)&&6===o.type||d("expected colon"),Ue(r,o)||d("expected value"),n=2,1===o.type){c[e]=o.value;continue}if(8===o.type){c[e]=null;continue}if(9===o.type){c[e]=!0;continue}if(10===o.type){c[e]=!1;continue}if(11===o.type){c[e]=parseFloat(o.value);continue}if(2===o.type){let t=[];c[e]=t,u(),n=4,c=t;continue}if(3===o.type){let s={};s.$vscodeTextmateLocation=o.toLocation(t),c[e]=s,u(),n=1,c=s;continue}}d("unexpected token in dict")}if(5===n){if(4===o.type){l();continue}if(7===o.type){n=6;continue}d("expected , or ]")}if(4===n||6===n){if(4===n&&4===o.type){l();continue}if(n=5,1===o.type){c.push(o.value);continue}if(8===o.type){c.push(null);continue}if(9===o.type){c.push(!0);continue}if(10===o.type){c.push(!1);continue}if(11===o.type){c.push(parseFloat(o.value));continue}if(2===o.type){let e=[];c.push(e),u(),n=4,c=e;continue}if(3===o.type){let e={};e.$vscodeTextmateLocation=o.toLocation(t),c.push(e),u(),n=1,c=e;continue}d("unexpected token in array")}d("unknown state")}return 0!==a.length&&d("unclosed constructs"),c}(s,t):JSON.parse(s)):function(e,t){return C?function(e,t,s){return Fe(e,t,"$vscodeTextmateLocation")}(e,t):function(e){return Fe(e,null,null)}(e)}(e,t);var s};var Ye=v.Bz,Xe=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(e){var t,s,r=void 0!==(e=e||{})?e:{};r.ready=new Promise((function(e,r){t=e,s=r}));var o,n=Object.assign({},r),c=!1;o=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),"object"==typeof t||w(s),t);var s},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print);var i,a,u=r.print||console.log.bind(console),l=r.printErr||console.warn.bind(console);Object.assign(r,n),n=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(i=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&w("no native wasm support detected");var d,h,p,m=!1,f="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function g(e,t,s){for(var r=t+s,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&f)return f.decode(e.subarray(t,o));for(var n="";t>10,56320|1023&u)}}else n+=String.fromCharCode((31&c)<<6|i)}else n+=String.fromCharCode(c)}return n}function b(e){d=e,r.HEAP8=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU8=h=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}r.INITIAL_MEMORY;var y=[],_=[],k=[],S=0,x=null;function w(e){r.onAbort&&r.onAbort(e),l(e="Aborted("+e+")"),m=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw s(t),t}var v,C,j,A="data:application/octet-stream;base64,";function N(e){return e.startsWith(A)}function P(e){try{if(e==v&&i)return new Uint8Array(i);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}catch(e){w(e)}}function R(e){for(;e.length>0;)e.shift()(r)}function E(e){try{return a.grow(e-d.byteLength+65535>>>16),b(a.buffer),1}catch(e){}}N(v="onig.wasm")||(C=v,v=r.locateFile?r.locateFile(C,""):""+C),j="undefined"!=typeof dateNow?dateNow:()=>performance.now();var I=[null,[],[]];function L(e,t){var s=I[e];0===t||10===t?((1===e?u:l)(g(s,0)),s.length=0):s.push(t)}var B,O={emscripten_get_now:j,emscripten_memcpy_big:function(e,t,s){h.copyWithin(e,t,t+s)},emscripten_resize_heap:function(e){var t=h.length,s=2147483648;if((e>>>=0)>s)return!1;let r=(e,t)=>e+(t-e%t)%t;for(var o=1;o<=4;o*=2){var n=t*(1+.2/o);if(n=Math.min(n,e+100663296),E(Math.min(s,r(Math.max(e,n),65536))))return!0}return!1},fd_write:function(e,t,s,r){for(var o=0,n=0;n>2],i=p[t+4>>2];t+=8;for(var a=0;a>2]=o,0}};function G(e){function s(){B||(B=!0,r.calledRun=!0,m||(R(_),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),k.unshift(e);var e;R(k)}()))}S>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),y.unshift(e);var e;R(y)}(),S>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),s()}),1)):s()))}if(function(){var e={env:O,wasi_snapshot_preview1:O};function t(e,t){var s,o=e.exports;r.asm=o,b((a=r.asm.memory).buffer),r.asm.__indirect_function_table,s=r.asm.__wasm_call_ctors,_.unshift(s),function(e){if(S--,r.monitorRunDependencies&&r.monitorRunDependencies(S),0==S&&x){var t=x;x=null,t()}}()}function o(e){t(e.instance)}function n(t){return(!i&&c&&"function"==typeof fetch?fetch(v,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+v+"'";return e.arrayBuffer()})).catch((function(){return P(v)})):Promise.resolve().then((function(){return P(v)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){l("failed to asynchronously prepare wasm: "+e),w(e)}))}if(S++,r.monitorRunDependencies&&r.monitorRunDependencies(S),r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(e){l("Module.instantiateWasm callback failed with error: "+e),s(e)}(i||"function"!=typeof WebAssembly.instantiateStreaming||N(v)||"function"!=typeof fetch?n(o):fetch(v,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(e){return l("wasm streaming compile failed: "+e),l("falling back to ArrayBuffer instantiation"),n(o)}))}))).catch(s)}(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.__wasm_call_ctors).apply(null,arguments)},r.___errno_location=function(){return(r.___errno_location=r.asm.__errno_location).apply(null,arguments)},r._omalloc=function(){return(r._omalloc=r.asm.omalloc).apply(null,arguments)},r._ofree=function(){return(r._ofree=r.asm.ofree).apply(null,arguments)},r._getLastOnigError=function(){return(r._getLastOnigError=r.asm.getLastOnigError).apply(null,arguments)},r._createOnigScanner=function(){return(r._createOnigScanner=r.asm.createOnigScanner).apply(null,arguments)},r._freeOnigScanner=function(){return(r._freeOnigScanner=r.asm.freeOnigScanner).apply(null,arguments)},r._findNextOnigScannerMatch=function(){return(r._findNextOnigScannerMatch=r.asm.findNextOnigScannerMatch).apply(null,arguments)},r._findNextOnigScannerMatchDbg=function(){return(r._findNextOnigScannerMatchDbg=r.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},r.stackSave=function(){return(r.stackSave=r.asm.stackSave).apply(null,arguments)},r.stackRestore=function(){return(r.stackRestore=r.asm.stackRestore).apply(null,arguments)},r.stackAlloc=function(){return(r.stackAlloc=r.asm.stackAlloc).apply(null,arguments)},r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm.dynCall_jiji).apply(null,arguments)},r.UTF8ToString=function(e,t){return e?g(h,e,t):""},x=function e(){B||G(),B||(x=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return G(),e.ready});let Je=null;class Ze{static _utf8ByteLength(e){let t=0;for(let s=0,r=e.length;s=55296&&o<=56319&&s+1=56320&&t<=57343&&(n=65536+(o-55296<<10)|t-56320,c=!0)}t+=n<=127?1:n<=2047?2:n<=65535?3:4,c&&s++}return t}constructor(e){const t=e.length,s=Ze._utf8ByteLength(e),r=s!==t,o=r?new Uint32Array(t+1):null;r&&(o[t]=s);const n=r?new Uint32Array(s+1):null;r&&(n[s]=t);const c=new Uint8Array(s);let i=0;for(let s=0;s=55296&&a<=56319&&s+1=56320&&t<=57343&&(u=65536+(a-55296<<10)|t-56320,l=!0)}r&&(o[s]=i,l&&(o[s+1]=i),u<=127?n[i+0]=s:u<=2047?(n[i+0]=s,n[i+1]=s):u<=65535?(n[i+0]=s,n[i+1]=s,n[i+2]=s):(n[i+0]=s,n[i+1]=s,n[i+2]=s,n[i+3]=s)),u<=127?c[i++]=u:u<=2047?(c[i++]=192|(1984&u)>>>6,c[i++]=128|(63&u)>>>0):u<=65535?(c[i++]=224|(61440&u)>>>12,c[i++]=128|(4032&u)>>>6,c[i++]=128|(63&u)>>>0):(c[i++]=240|(1835008&u)>>>18,c[i++]=128|(258048&u)>>>12,c[i++]=128|(4032&u)>>>6,c[i++]=128|(63&u)>>>0),l&&s++}this.utf16Length=t,this.utf8Length=s,this.utf16Value=e,this.utf8Value=c,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=n}createString(e){const t=e._omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}class et{constructor(e){if(this.id=++et.LAST_ID,!Je)throw new Error("Must invoke loadWASM first.");this._onigBinding=Je,this.content=e;const t=new Ze(e);this.utf16Length=t.utf16Length,this.utf8Length=t.utf8Length,this.utf16OffsetToUtf8=t.utf16OffsetToUtf8,this.utf8OffsetToUtf16=t.utf8OffsetToUtf16,this.utf8Length<1e4&&!et._sharedPtrInUse?(et._sharedPtr||(et._sharedPtr=Je._omalloc(1e4)),et._sharedPtrInUse=!0,Je.HEAPU8.set(t.utf8Value,et._sharedPtr),this.ptr=et._sharedPtr):this.ptr=t.createString(Je)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===et._sharedPtr?et._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}et.LAST_ID=0,et._sharedPtr=0,et._sharedPtrInUse=!1;class tt{constructor(e){if(!Je)throw new Error("Must invoke loadWASM first.");const t=[],s=[];for(let r=0,o=e.length;rWebAssembly.instantiateStreaming(e,t)}(r):function(e){return async t=>{const s=await e.arrayBuffer();return WebAssembly.instantiate(s,t)}}(r):function(e){return t=>WebAssembly.instantiate(e,t)}(r)}return rt=new Promise(((e,t)=>{r=e,o=t})),function(e,t,s,r){Xe({print:t,instantiateWasm:(t,s)=>{if("undefined"==typeof performance){const e=()=>Date.now();t.env.emscripten_get_now=e,t.wasi_snapshot_preview1.emscripten_get_now=e}return e(t).then((e=>s(e.instance)),r),{}}}).then((e=>{Je=e,s()}))}(t,s,r,o),rt}function nt(e){return new et(e)}function ct(e){return new tt(e)}function it(e){const t=S[e];if(!t)return;const{id:s}=x[t];return{id:s,scopeName:t}}const at=new Map;let ut,lt;async function dt(e){if(at.has(e))return at.get(e);const r=function(e){return x[e]}(e);if(!r)return Promise.resolve(void 0);let o;if(void 0===ut&&(o=t(r.id),ut=o.then((()=>!0)).catch((()=>!1))),void 0===lt&&(lt=await ut),lt){const s=o||t(r.id);return at.set(e,s),s}const n=s(`grammars/${r.id}`);r.embeddedScopes.forEach((e=>{if(!at.has(e)){const t=n.then((t=>null==t?void 0:t.find((t=>t.scopeName===e))));at.set(e,t)}}));const c=n.then((t=>null==t?void 0:t.find((t=>t.scopeName===e))));return at.set(e,c),c}const ht=30720,pt=16744448,mt=16775168,ft=11,gt=15,bt={NotSet:-1,None:0,Italic:1,Bold:2,Underline:4,Strikethrough:8};function yt(e,t,s,r){const{tokens:o,ruleStack:n}=e.tokenizeLine2(s,t),c=[];let i=s.length;for(let e=o.length-2;e>=0;e-=2){const t=o[e],r=o[e+1],n=s.slice(t,i);c.unshift({content:n,metadata:r}),i=t}let a=[];if(null==r?void 0:r.preserveWhitespace)a=c;else for(let e=0;e0?a[a.length-1].content+=t.content:e{const{rawTokens:o,nextStack:n}=yt(t,r,e,{preserveWhitespace:!0}),c=o.map((({content:e,metadata:t})=>({content:e,style:kt(t,s)}))),i=function(e,t,s,r){const{tokens:o}=s.tokenizeLine(e,t),n=[];for(let t=0;t{if(a+=e.content.length,s>>gt]},r=(e&ht)>>>ft;return r&bt.Italic&&(s.fontStyle="italic"),r&bt.Bold&&(s.fontWeight="bold"),r&bt.Underline&&(s.textDecoration="underline"),r&bt.Strikethrough&&(s.textDecoration="line-through"),s}var St={instantiator:t=>WebAssembly.instantiate(e,t).then((e=>({instance:e})))};let xt=null;function wt(e){return"text"==e||"terminal"==e}function vt(e){if(!xt){const e=ot(St).then((()=>({createOnigScanner:ct,createOnigString:nt})));xt=new Ye({onigLib:e,loadGrammar:e=>dt(e)})}const t=e.filter((e=>!wt(e))).map((e=>{const t=it(e);if(!t)throw new jt(e);return xt.loadGrammar(t.scopeName)}));return Promise.all(t)}function Ct(e){if(wt(e))return{langId:e,grammar:null};const t=it(e);if(!t)throw new jt(e);const s=function(e){const{_syncRegistry:t}=xt;return null==t?void 0:t._grammars.get(e)}(t.scopeName);if(!s)throw new Error(`Syntax highlighting error: grammar for ${e} not loaded`);return{langId:t.id,grammar:s}}class jt extends Error{constructor(e){super(`Unknown language: ${e}`),this.alias=e}}function At(e,t,s){xt.setTheme(s);const r=function(e){const t=xt.getColorMap();return e.colorNames?t.map((t=>Object.keys(e.colorNames).find((s=>e.colorNames[s].toUpperCase()===t.toUpperCase()))||t)):t}(s);return function(e,t,s){let r=null;return e.split(/\r?\n|\r/g).map((e=>{const{rawTokens:o,nextStack:n}=yt(t,r,e);return r=n,o.map((({content:e,metadata:t})=>({content:e,style:kt(t,s)})))}))}(e,t,r)}function Nt(e){return e.split(/\r?\n|\r/g).map((e=>[{content:e,style:{}}]))}function Pt(e,t){return Et(e.slice(1,-1)).map((e=>{const{from:s,to:r}=Rt(e);return{lineNumber:t,fromColumn:s,toColumn:r}}))}function Rt(e){const[t,s]=e.split(":");if(!It(t))throw new Lt(t);const r=Number(t);if(r<1)throw new Bt;if(s){if(!It(s))throw new Lt(s);return{from:r,to:+s}}return{from:r,to:r}}function Et(e){return e.split(/,(?![^\[]*\])/g)}function It(e){e=e.toString();var t=Math.abs(e),s=parseInt(e,10);return!isNaN(t)&&s===t&&t.toString()===e}class Lt extends Error{constructor(e){super(`Invalid number "${e}" in range string`),this.number=e,Object.setPrototypeOf(this,new.target.prototype)}}class Bt extends Error{constructor(){super("Invalid line or column number in range string"),Object.setPrototypeOf(this,new.target.prototype)}}const Ot="#001",Gt="#010",Tt={name:"comments",type:"light",foreground:"",background:"",colors:{},settings:[{settings:{foreground:"#000"}},{scope:["punctuation.definition.comment"],settings:{foreground:Ot}},{scope:"comment",settings:{foreground:Gt}}]};function qt(e,t,s,r){const o=t?At(e,t,Tt):Nt(e),n=[];let c=1;const i=o.map((e=>{const{annotations:t,lineWithoutComments:o}=function(e,t,s,r){if(r in Ft&&e.some((e=>e.style.color===Gt))){const t=Ft[r];e=e.flatMap((e=>{if(e.style.color!==Gt)return[e];const s=e.content.trimStart();if(s.startsWith(t)){const r=s.slice(t.length),o=[{content:e.content.slice(0,e.content.length-r.length),style:{color:Ot}}];return r.length&&o.push({content:r,style:e.style}),o}return[e]}))}if(!e.some((e=>e.style.color===Ot)))return{annotations:[],lineWithoutComments:e};const o=[];let n=0;for(;n!e.tokens.includes(t)));c.every((e=>""===e.content.trim()))&&(c=null);return{annotations:o.map((e=>({name:e.name,query:e.query,lineNumber:e.lineNumber,rangeString:e.rangeString}))),lineWithoutComments:c}}(e,r,c,s);if(n.push(...t),!o)return null;const i=o.map((e=>e.content)).join("");return["mdx","jsx","tsx"].includes(s)&&t.length>0&&"{}"===i.trim()?null:(c++,i)})).filter((e=>null!==e)).join("\n"),a=n.map((e=>{var{rangeString:t,lineNumber:s}=e,r=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);oe.ranges.length>0));return{newCode:i,annotations:a}}const Ft={"actionscript-3":"//",ada:"--",asm:"#",dart:"//",fsharp:"//",graphql:"#",http:"#",rust:"//",sparql:"#",wgsl:"//",jsonnet:"//",kql:"//",zenscript:"//",kusto:"//",turtle:"#",abap:"*",beancount:";",kotlin:"//",hlsl:"//",berry:"#",cypher:"//",elm:"--",nix:"#",viml:'"',solidity:"//",bat:"REM",shaderlab:"//",sas:"*",clarity:";;"};function $t(e,t,s){return e&&e.startsWith("(/")?function(e,t,s){const r=t.match(/\(\/([\s\S]*?)\/([gimuy]*)\)/);if(!r)throw new Error(`Invalid RegExp string: ${t}`);const o=new RegExp(r[1],r[2]),n=e.split(/\r?\n/).slice(s-1).join("\n");if(!o.global){const e=o.exec(n);if(!e)return[];const t=n.slice(0,e.index).split("\n").length+s-1;return[{fromLineNumber:t,toLineNumber:t+e[0].split("\n").length-1}]}let c;const i=[];for(;c=o.exec(n);){const e=n.slice(0,c.index).split("\n").length+s-1,t=e+c[0].split("\n").length-1,r=i[i.length-1];r&&r.fromLineNumber===e||i.push({fromLineNumber:e,toLineNumber:t})}return i}(s,e,t):e&&e.startsWith("[/")?function(e,t,s){const r=t.match(/\[\/([\s\S]*?)\/([gimuy]*)\]/);if(!r)throw new Error(`Invalid RegExp string: ${t}`);let o=r[2]||"";o+="d";const n=new RegExp(r[1],o);let c=e.split(/\r?\n/);c=c.slice(s-1),n.multiline||(c=[c[0]]);const i=[];return c.forEach(((e,t)=>{if(!n.global){if(i.length>0)return;const r=n.exec(e);if(!r)return;const o=r.indices[1]||r.indices[0];return void i.push({lineNumber:t+s,fromColumn:o[0]+1,toColumn:o[1]})}let r;for(;r=n.exec(e);){const e=r.indices[1]||r.indices[0];i.push({lineNumber:t+s,fromColumn:e[0]+1,toColumn:e[1]})}})),i}(s,e,t):function(e,t){return e?e.startsWith("[")?Pt(e,t):Et(e.slice(1,-1)).map((e=>{if(e.includes("[")){const[s,r]=e.split("["),o=Number(s),n=t+o-1;if(!It(n))throw new Lt(s);return Pt("["+r,n)}const{from:s,to:r}=Rt(e);return[{fromLineNumber:s+t-1,toLineNumber:r+t-1}]})).flat():[{fromLineNumber:t,toLineNumber:t}]}(e,t)}function Mt(e,t){var s;const r=e.match(/\s*([\w-]+)?(\([^\)]*\)|\[[^\]]*\])?(.*)$/),o=r[1],n=r[2],c=null===(s=r[3])||void 0===s?void 0:s.trim();return t.includes(o)?{name:o,rangeString:n,query:c}:null}function Wt(e,t){let s=[],r=1;return e.forEach((e=>{s.push({fromColumn:r,toColumn:r+e.content.length-1,token:e}),r+=e.content.length})),t.forEach((e=>{s=function(e,t){const{range:s}=t,{fromColumn:r,toColumn:o}=s,n=[];let c=0;for(;co){const[e,s]=Dt(t,o+1);i.tokens.push(e),n.push(s)}else i.tokens.push(t);c++}else n.push(i);for(;cUt(e)))}function Ut(e){return"tokens"in e?{annotationName:e.annotationName,annotationQuery:e.annotationQuery,fromColumn:e.fromColumn,toColumn:e.toColumn,tokens:e.tokens.map((e=>Ut(e)))}:e.token}function Dt(e,t){if("token"in e){const s=Object.assign(Object.assign({},e.token),{content:e.token.content.slice(0,t-e.fromColumn)}),r=Object.assign(Object.assign({},e.token),{content:e.token.content.slice(t-e.fromColumn)});return[Object.assign(Object.assign({},e),{toColumn:t-1,token:s}),Object.assign(Object.assign({},e),{fromColumn:t,token:r})]}{const s=[],r=[];e.tokens.forEach((e=>{if(e.toColumn=t)r.push(e);else{const[o,n]=Dt(e,t);s.push(o),r.push(n)}}));return[Object.assign(Object.assign({},e),{toColumn:t-1,tokens:s}),Object.assign(Object.assign({},e),{fromColumn:t,tokens:r})]}}function zt(e,t){let s=e.map(((e,t)=>({fromLineNumber:t+1,toLineNumber:t+1,line:e})));return t.forEach((e=>{s=function(e,t){const{range:s,name:r,query:o}=t,{fromLineNumber:n,toLineNumber:c}=s,i=[];let a=0;for(;ac){const[e,s]=Qt(t,c+1);u.lines.push(e),i.push(s)}else u.lines.push(t);a++}else i.push(u);for(;aHt(e)))}function Ht(e){return"line"in e?{lineNumber:e.fromLineNumber,tokens:e.line.tokens}:{annotationName:e.annotationName,annotationQuery:e.annotationQuery,fromLineNumber:e.fromLineNumber,toLineNumber:e.toLineNumber,lines:e.lines.map((e=>Ht(e)))}}function Qt(e,t){if("line"in e)return[Object.assign(Object.assign({},e),{toLineNumber:t-1}),Object.assign(Object.assign({},e),{fromLineNumber:t})];{const s=[],r=[];return e.lines.forEach((e=>{if(e.toLineNumber=t)r.push(e);else{const[o,n]=Qt(e,t);s.push(o),r.push(n)}})),[Object.assign(Object.assign({},e),{toLineNumber:t-1,lines:s}),Object.assign(Object.assign({},e),{fromLineNumber:t,lines:r})]}}function Kt(e,t){const{inlineAnnotations:s,multilineAnnotations:r}=function(e){const t=[],s=[];return e.forEach((e=>{e.ranges.forEach((r=>{"lineNumber"in r?t.push(Object.assign(Object.assign({},e),{range:r})):s.push(Object.assign(Object.assign({},e),{range:r}))}))})),{inlineAnnotations:t,multilineAnnotations:s}}(t);return zt(e.map(((e,t)=>{const r=s.filter((e=>e.range.lineNumber===t+1));return{lineNumber:t+1,tokens:Wt(e,r)}})),r)}var Vt=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Yt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",9:"strikethrough"};function Xt(e,t){const s=e.indexOf("[",t);if(-1!==s){const t=e.indexOf("m",s);return{sequence:e.substring(s+2,t).split(";"),startPosition:s,position:t+1}}return{position:e.length}}function Jt(e,t){let s=1;const r=e[t+s++];let o;if("2"===r){const r=[e[t+s++],e[t+s++],e[t+s]].map((e=>Number.parseInt(e)));3!==r.length||r.some((e=>Number.isNaN(e)))||(o={type:"rgb",rgb:r})}else if("5"===r){const r=Number.parseInt(e[t+s]);Number.isNaN(r)||(o={type:"table",index:Number(r)})}return[s,o]}function Zt(e){const t=[];for(let s=0;s=90&&o<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Vt[o-90+8]}}):o>=100&&o<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Vt[o-100+8]}})}return t}function es(e,t){const s=function(){let e=null,t=null,s=new Set;return{parse(r){const o=[];let n=0;do{const c=Xt(r,n),i=c.sequence?r.substring(n,c.startPosition):r.substring(n);if(i.length>0&&o.push({value:i,foreground:e,background:t,decorations:new Set(s)}),c.sequence){const r=Zt(c.sequence);for(const o of r)"resetAll"===o.type?(e=null,t=null,s.clear()):"resetForegroundColor"===o.type?e=null:"resetBackgroundColor"===o.type?t=null:"resetDecoration"===o.type&&s.delete(o.value);for(const o of r)"setForegroundColor"===o.type?e=o.value:"setBackgroundColor"===o.type?t=o.value:"setDecoration"===o.type&&s.add(o.value)}n=c.position}while(nfunction(e,t,s){const r=e.parse(t),o=r.map((({value:e,foreground:t,background:r,decorations:o})=>{const n=ts(t,s),c={};n&&(c.color=n);const i=ts(r,s);return i&&(c.background=i),o.has("bold")&&(c.fontWeight="bold"),o.has("italic")&&(c.fontStyle="italic"),o.has("underline")&&(c.textDecoration="underline"),o.has("strikethrough")&&(c.textDecoration="line-through"),o.has("reverse")&&(c.color=i,c.background=n),o.has("dim")&&(c.opacity=.5),{content:e,style:c}}));return o}(s,e,t)));return r}function ts(e,t){if(e){if("named"===e.type){return u(t,"terminal.ansi"+(e.name[0].toUpperCase()+e.name.slice(1)))}if("rgb"===e.type){const[t,s,r]=e.rgb;return`rgb(${t}, ${s}, ${r})`}}}async function ss(e,t){await Promise.all([vt(e),m(t)])}async function rs(e,t,s="dark-plus",r={}){const o=e||"",n=t||"text";if("string"!=typeof o)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof n)throw new Error("Syntax highlighter error: lang must be a string");return await ss([n],s),os(o,n,s,r)}function os(e,t,s="dark-plus",r={}){const o=e||"",n=t||"text";if("string"!=typeof o)throw new Error("Syntax highlighter error: code must be a string");if("string"!=typeof n)throw new Error("Syntax highlighter error: lang must be a string");const{langId:c,grammar:i}=Ct(n),l=f(s),d="text"==c?Nt(o):"terminal"==c?es(o,l):(null==r?void 0:r.scopes)?function(e,t,s){return xt.setTheme(s),_t(e,t,xt.getColorMap())}(o,i,l):At(o,i,l),h="terminal"==c?function(e){return{color:u(e,"terminal.foreground"),background:u(e,"terminal.background"),colorScheme:a(e)}}(l):{color:l.foreground,background:l.background,colorScheme:a(l)};if(function(e){return"annotations"in e}(r)){return{lines:Kt(d,(null==r?void 0:r.annotations)||[]),lang:c,style:h}}return{lines:d,lang:c,style:h}}async function ns(e,t,s){if(!s)return{code:e,annotations:[]};await vt([t]);const{grammar:r,langId:o}=Ct(t),{newCode:n,annotations:c}=qt(e,r,o,s);return{code:n,annotations:c}}async function cs(e){if(!e)throw new Error("Syntax highlighter error: undefined theme");await ss([],e);return _(f(e))}function is(e){if(!e)throw new Error("Syntax highlighter error: undefined theme");return _(f(e))}export{k as LANG_NAMES,b as THEME_NAMES,jt as UnknownLanguageError,y as UnknownThemeError,ns as extractAnnotations,cs as getThemeColors,is as getThemeColorsSync,rs as highlight,os as highlightSync,ss as preload}; diff --git a/lib/src/comments.ts b/lib/src/comments.ts index c8126fa..672595c 100644 --- a/lib/src/comments.ts +++ b/lib/src/comments.ts @@ -130,6 +130,7 @@ const prefixes = { bat: "REM", shaderlab: "//", sas: "*", + clarity: ";;", }; function getAnnotationsFromLine( diff --git a/lib/src/index.ts b/lib/src/index.ts index b199ab0..b2b8686 100644 --- a/lib/src/index.ts +++ b/lib/src/index.ts @@ -32,6 +32,7 @@ import { Token, } from "./annotations"; import { getTerminalStyle, highlightTerminal } from "./terminal"; +import { getColorScheme } from "./theme-colors"; type Config = { scopes?: boolean }; type AnnotatedConfig = { annotations: Annotation[] } & Config; @@ -41,6 +42,7 @@ type LighterResult = { style: { color: string; background: string; + colorScheme: string; }; }; type AnnotatedLighterResult = { @@ -49,6 +51,7 @@ type AnnotatedLighterResult = { style: { color: string; background: string; + colorScheme: string; }; }; @@ -157,6 +160,7 @@ export function highlightSync( : { color: theme.foreground, background: theme.background, + colorScheme: getColorScheme(theme), }; if (isAnnotatedConfig(config)) { diff --git a/lib/src/terminal.ts b/lib/src/terminal.ts index cb54f9e..3c842c3 100644 --- a/lib/src/terminal.ts +++ b/lib/src/terminal.ts @@ -1,7 +1,7 @@ import { FinalTheme } from "./theme"; import { Token } from "./annotations"; import { Color, createAnsiSequenceParser } from "ansi-sequence-parser"; -import { getColor } from "./theme-colors"; +import { getColor, getColorScheme } from "./theme-colors"; export function highlightTerminal(code: string, theme: FinalTheme): Token[][] { const parser = createAnsiSequenceParser(); @@ -76,5 +76,6 @@ export function getTerminalStyle(theme: FinalTheme) { return { color: getColor(theme, "terminal.foreground"), background: getColor(theme, "terminal.background"), + colorScheme: getColorScheme(theme), }; } diff --git a/lib/test/__snapshots__/browser.test.ts.snap b/lib/test/__snapshots__/browser.test.ts.snap index 2ee8fc4..904b657 100644 --- a/lib/test/__snapshots__/browser.test.ts.snap +++ b/lib/test/__snapshots__/browser.test.ts.snap @@ -197,6 +197,7 @@ exports[`extract annotation with inline global regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -385,6 +386,7 @@ exports[`extract annotation with inline regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -701,6 +703,7 @@ exports[`extract annotation with multiline inline regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -810,6 +813,7 @@ exports[`extract annottations 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -932,6 +936,7 @@ exports[`extract annottations from jsx 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1021,6 +1026,7 @@ exports[`extract annottations from mdx 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1069,6 +1075,7 @@ exports[`extract annottations from text 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1143,6 +1150,7 @@ exports[`extract annottations from txt 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1277,6 +1285,7 @@ exports[`extract annottations with prefix 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1427,6 +1436,7 @@ exports[`extract empty annotation with inline regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1511,6 +1521,7 @@ exports[`extract empty line annotation with regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1704,6 +1715,7 @@ exports[`extract line annotation with global regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1843,6 +1855,7 @@ exports[`extract line annotation with regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1917,6 +1930,7 @@ exports[`highlight html with theme 1`] = ` "style": { "background": "#0d1117", "color": "#c9d1d9", + "colorScheme": "dark", }, } `; @@ -1949,6 +1963,7 @@ exports[`highlight js 1`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1967,6 +1982,7 @@ exports[`highlight terminal 1`] = ` "style": { "background": "#0d1117", "color": "#c9d1d9", + "colorScheme": "dark", }, } `; @@ -2027,6 +2043,7 @@ exports[`highlight terminal ansi codes 1`] = ` "style": { "background": "#0d1117", "color": "#c9d1d9", + "colorScheme": "dark", }, } `; @@ -2045,6 +2062,7 @@ exports[`highlight text 1`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -2065,6 +2083,7 @@ exports[`highlight with empty theme 1`] = ` "style": { "background": "#1E1E1E", "color": "#bbbbbb", + "colorScheme": "dark", }, } `; @@ -2085,6 +2104,7 @@ exports[`highlight with frozen theme 1`] = ` "style": { "background": "#1E1E1E", "color": "#bbbbbb", + "colorScheme": "dark", }, } `; @@ -2105,6 +2125,7 @@ exports[`highlight with frozen theme with global setting 1`] = ` "style": { "background": "#1E1E1E", "color": "#bbbbbb", + "colorScheme": "dark", }, } `; @@ -2167,6 +2188,7 @@ exports[`highlight with scopes 1`] = ` "style": { "background": "#0d1117", "color": "#c9d1d9", + "colorScheme": "dark", }, } `; @@ -2187,6 +2209,7 @@ exports[`null code 1`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -2205,6 +2228,7 @@ exports[`null lang 1`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; diff --git a/lib/test/__snapshots__/esm.test.ts.snap b/lib/test/__snapshots__/esm.test.ts.snap index 2ee8fc4..904b657 100644 --- a/lib/test/__snapshots__/esm.test.ts.snap +++ b/lib/test/__snapshots__/esm.test.ts.snap @@ -197,6 +197,7 @@ exports[`extract annotation with inline global regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -385,6 +386,7 @@ exports[`extract annotation with inline regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -701,6 +703,7 @@ exports[`extract annotation with multiline inline regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -810,6 +813,7 @@ exports[`extract annottations 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -932,6 +936,7 @@ exports[`extract annottations from jsx 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1021,6 +1026,7 @@ exports[`extract annottations from mdx 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1069,6 +1075,7 @@ exports[`extract annottations from text 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1143,6 +1150,7 @@ exports[`extract annottations from txt 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1277,6 +1285,7 @@ exports[`extract annottations with prefix 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1427,6 +1436,7 @@ exports[`extract empty annotation with inline regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1511,6 +1521,7 @@ exports[`extract empty line annotation with regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1704,6 +1715,7 @@ exports[`extract line annotation with global regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1843,6 +1855,7 @@ exports[`extract line annotation with regex 2`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1917,6 +1930,7 @@ exports[`highlight html with theme 1`] = ` "style": { "background": "#0d1117", "color": "#c9d1d9", + "colorScheme": "dark", }, } `; @@ -1949,6 +1963,7 @@ exports[`highlight js 1`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -1967,6 +1982,7 @@ exports[`highlight terminal 1`] = ` "style": { "background": "#0d1117", "color": "#c9d1d9", + "colorScheme": "dark", }, } `; @@ -2027,6 +2043,7 @@ exports[`highlight terminal ansi codes 1`] = ` "style": { "background": "#0d1117", "color": "#c9d1d9", + "colorScheme": "dark", }, } `; @@ -2045,6 +2062,7 @@ exports[`highlight text 1`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -2065,6 +2083,7 @@ exports[`highlight with empty theme 1`] = ` "style": { "background": "#1E1E1E", "color": "#bbbbbb", + "colorScheme": "dark", }, } `; @@ -2085,6 +2104,7 @@ exports[`highlight with frozen theme 1`] = ` "style": { "background": "#1E1E1E", "color": "#bbbbbb", + "colorScheme": "dark", }, } `; @@ -2105,6 +2125,7 @@ exports[`highlight with frozen theme with global setting 1`] = ` "style": { "background": "#1E1E1E", "color": "#bbbbbb", + "colorScheme": "dark", }, } `; @@ -2167,6 +2188,7 @@ exports[`highlight with scopes 1`] = ` "style": { "background": "#0d1117", "color": "#c9d1d9", + "colorScheme": "dark", }, } `; @@ -2187,6 +2209,7 @@ exports[`null code 1`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; @@ -2205,6 +2228,7 @@ exports[`null lang 1`] = ` "style": { "background": "#1E1E1E", "color": "#D4D4D4", + "colorScheme": "dark", }, } `; diff --git a/lib/test/comments.test.ts b/lib/test/comments.test.ts index 2a25dff..1bd5727 100644 --- a/lib/test/comments.test.ts +++ b/lib/test/comments.test.ts @@ -120,6 +120,7 @@ let codes = [ ["// foo", "shader"], ["// foo", "shaderlab"], ["* foo", "sas"], + [";; foo", "clarity"], // fail // ["// foo", "apl"], diff --git a/test/test.js b/test/test.js index 5691a5c..67a25a3 100644 --- a/test/test.js +++ b/test/test.js @@ -9,7 +9,7 @@ const x = 20 `.trim(); // const code = `// foo `; const alias = "js"; -const theme = "dracula"; +const theme = "github-from-css"; async function run() { const result = await highlight(code, alias, theme, { scopes: true }); @@ -23,6 +23,8 @@ async function run() { s: t.scopes?.join(" ").slice(0, 24), })) ); + + console.log(result.style); } import { Console } from "console";