@xano/xanoscript-monaco-editor 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +77 -126
  2. package/dist/.vite/manifest.json +54 -54
  3. package/dist/assets/{editor-BivTGeL1.js → editor-4HUBGwOu.js} +1 -1
  4. package/dist/assets/{extensionHost.worker-bYZXB0kM.js → extensionHost.worker-BEj8h9xB.js} +7 -7
  5. package/dist/assets/{files.contribution._fileEditorFactory-vS4ZLYi1.js → files.contribution._fileEditorFactory-YNF_vxMj.js} +1 -1
  6. package/dist/assets/{iconv-lite-umd-DQaTktu2.js → iconv-lite-umd-BCZHOywd.js} +2 -7
  7. package/dist/assets/{iconv-lite-umd-DYWd8cEa.js → iconv-lite-umd-BGIeO9cR.js} +2 -7
  8. package/dist/assets/{index-CrbRjSB_.js → index-9GTRLRSC.js} +1 -1
  9. package/dist/assets/{index-BGwiFEyd.js → index-B48SQPT2.js} +1 -1
  10. package/dist/assets/{index-VRHnXpb2.js → index-B7W-kS7G.js} +1 -1
  11. package/dist/assets/{index-51WpeTZl.js → index-CBODr4QR.js} +3 -3
  12. package/dist/assets/{index-C3pnKX8a.js → index-Cw1WVxjJ.js} +1 -1
  13. package/dist/assets/{index-BwfWF2CI.js → index-DSexFukl.js} +47 -47
  14. package/dist/assets/{index-C25FTAfE.js → index-DV2XmbY1.js} +1 -1
  15. package/dist/assets/{index-B132pG6E.js → index-DoXiLhIy.js} +2 -2
  16. package/dist/assets/{index-DgK2LcnW.js → index-r-mEMSNw.js} +2 -2
  17. package/dist/assets/{index-yPQeQvu7.js → index-sQEJqDvC.js} +1 -1
  18. package/dist/assets/main--VvQJcub.js +4 -0
  19. package/dist/assets/main-DUUA0eUQ.js +4 -0
  20. package/dist/assets/main-DWv94O3B.js +1 -0
  21. package/dist/assets/main-Du3mMy1c.js +1 -0
  22. package/dist/assets/{tokenClassificationRegistry-DcBtqg2t.js → tokenClassificationRegistry-CZyxOMX0.js} +1 -1
  23. package/dist/assets/{views-hUfpm9tT.js → views-Bu3Oa5Y-.js} +3 -3
  24. package/dist/assets/{views-C4cPu3oQ.css → views-qXWInm-E.css} +1 -1
  25. package/dist/assets/workbenchThemeService.service-CXlQNmVU.js +1 -0
  26. package/dist/assets/{worker-BIMDXoFp.js → worker-BiA-ZZ0u.js} +2 -2
  27. package/dist/index.html +1 -1
  28. package/dist/logic-assistant-script.js +22301 -16325
  29. package/dist/logic-assistant-script.js.map +4 -4
  30. package/dist/worker.js +20541 -14435
  31. package/dist/worker.js.map +4 -4
  32. package/package.json +3 -1
  33. package/dist/assets/main-D6ceXGB_.js +0 -4
  34. package/dist/assets/main-DNugpDp4.js +0 -4
  35. package/dist/assets/main-FP17jmvp.js +0 -1
  36. package/dist/assets/main-b5eBH2vx.js +0 -1
  37. package/dist/assets/workbenchThemeService.service-qBFVnuYD.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./main-DNugpDp4.js","./index-BwfWF2CI.js","./index-B0wc3Rza.css","./main-FP17jmvp.js"])))=>i.map(i=>d[i]);
2
- import{D as P,E as xe,S as Pe,a as pe,T as N,k as ve,n as De,b as Ne,o as Ae,c as Re,C as _e,L as Oe,l as ke,_ as ie,R as oe,d as B,e as je,F as Le,U as Fe,t as Be,f as X,g as m,I as Ce,h as le,i as ge,j as he,m as Ie,p as Z,q as l,s as $e,u as Ve,v as Ge,w as te,x as Me,y as v,P as We,z as He,A as qe,B as Ue,G as Je,H as Ke,J as Te,K as Ye,M as Qe,N as W,O as Xe,Q as Ze,V as et,W as ze,X as tt,Y as nt,Z as it,$ as ot,a0 as rt,a1 as me,a2 as st,a3 as at,a4 as ct,a5 as dt,a6 as Se,a7 as ut,a8 as p,a9 as lt,aa as G,ab as gt,ac as ye,ad as ht,ae as mt,af as ft,ag as pt,ah as be,ai as _t,aj as kt,ak as Tt,al as St,am as yt,an as bt,ao as wt,ap as vt}from"./index-BwfWF2CI.js";import{I as Ee}from"./workbenchThemeService.service-qBFVnuYD.js";import{t as $,g as Lt,S as Ct}from"./tokenClassificationRegistry-DcBtqg2t.js";class It extends P{constructor(e,t,n,o,i,s,r){super(),this._grammar=e,this._initialState=t,this._containsEmbeddedLanguages=n,this._createBackgroundTokenizer=o,this._backgroundTokenizerShouldOnlyVerifyTokens=i,this._reportTokenizationTime=s,this._reportSlowTokenization=r,this._seenLanguages=[],this._onDidEncounterLanguage=this._register(new xe),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event}get backgroundTokenizerShouldOnlyVerifyTokens(){return this._backgroundTokenizerShouldOnlyVerifyTokens()}getInitialState(){return this._initialState}tokenize(e,t,n){throw new Error("Not supported!")}createBackgroundTokenizer(e,t){if(this._createBackgroundTokenizer)return this._createBackgroundTokenizer(e,t)}tokenizeEncoded(e,t,n){const o=Math.random()*1e4<1,i=this._reportSlowTokenization||o,s=i?new Pe(!0):void 0,r=this._grammar.tokenizeLine2(e,n,500);if(i){const a=s.elapsed();(o||a>32)&&this._reportTokenizationTime(a,e.length,o)}if(r.stoppedEarly)return console.warn(`Time limit reached when tokenizing line: ${e.substring(0,100)}`),new pe(r.tokens,n);if(this._containsEmbeddedLanguages){const a=this._seenLanguages,u=r.tokens;for(let g=0,k=u.length>>>1;g<k;g++){const w=u[(g<<1)+1],y=N.getLanguageId(w);a[y]||(a[y]=!0,this._onDidEncounterLanguage.fire(y))}}let c;return n.equals(r.ruleStack)?c=n:c=r.ruleStack,new pe(r.tokens,c)}}class Mt extends P{get backgroundTokenizerShouldOnlyVerifyTokens(){return this._actual.backgroundTokenizerShouldOnlyVerifyTokens}constructor(e,t,n,o){super(),this._encodedLanguageId=e,this._actual=t,this._maxTokenizationLineLength=o,this._register(ve(this._maxTokenizationLineLength)),this._register(n)}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){throw new Error("Not supported!")}tokenizeEncoded(e,t,n){return e.length>=this._maxTokenizationLineLength.get()?De(this._encodedLanguageId,n):this._actual.tokenizeEncoded(e,t,n)}createBackgroundTokenizer(e,t){if(this._actual.createBackgroundTokenizer)return this._actual.createBackgroundTokenizer(e,t)}}const F=class F{static getChannel(e){return e.getChannel(F.CHANNEL_NAME)}static setChannel(e,t){e.setChannel(F.CHANNEL_NAME,t)}};F.CHANNEL_NAME="textMateWorkerHost";let re=F;class U{static fromMany(e){const t=e.map(n=>new U(n));return new zt(t)}constructor(e){this.transformation=e,this.idx=0,this.offset=0}transform(e){let t=this.transformation.replacements.at(this.idx);for(;t&&t.replaceRange.endExclusive<=e;)this.offset+=t.getLengthDelta(),this.idx++,t=this.transformation.replacements.at(this.idx);if(!(t&&t.replaceRange.start<=e))return e+this.offset}}class zt{constructor(e){this.transformers=e}transform(e){for(const t of this.transformers){const n=t.transform(e);if(n===void 0)return;e=n}return e}}const Y=class Y extends P{constructor(e,t,n,o,i,s){super(),this._model=e,this._worker=t,this._languageIdCodec=n,this._backgroundTokenizationStore=o,this._configurationService=i,this._maxTokenizationLineLength=s,this.controllerId=Y._id++,this._pendingChanges=[],this._states=new Ne,this._loggingEnabled=Ae("editor.experimental.asyncTokenizationLogging",!1,this._configurationService),this._register(ve(this._loggingEnabled)),this._register(this._model.onDidChangeContent(a=>{this._shouldLog&&console.log("model change",{fileName:this._model.uri.fsPath.split("\\").pop(),changes:ne(a.changes)}),this._worker.$acceptModelChanged(this.controllerId,a),this._pendingChanges.push(a)})),this._register(this._model.onDidChangeLanguage(a=>{const u=this._model.getLanguageId(),g=this._languageIdCodec.encodeLanguageId(u);this._worker.$acceptModelLanguageChanged(this.controllerId,u,g)}));const r=this._model.getLanguageId(),c=this._languageIdCodec.encodeLanguageId(r);this._worker.$acceptNewModel({uri:this._model.uri,versionId:this._model.getVersionId(),lines:this._model.getLinesContent(),EOL:this._model.getEOL(),languageId:r,encodedLanguageId:c,maxTokenizationLineLength:this._maxTokenizationLineLength.get(),controllerId:this.controllerId}),this._register(Re(a=>{const u=this._maxTokenizationLineLength.read(a);this._worker.$acceptMaxTokenizationLineLength(this.controllerId,u)}))}dispose(){super.dispose(),this._worker.$acceptRemovedModel(this.controllerId)}requestTokens(e,t){this._worker.$retokenize(this.controllerId,e,t)}async setTokensAndStates(e,t,n,o){if(this.controllerId!==e)return;let i=_e.deserialize(new Uint8Array(n));if(this._shouldLog&&console.log("received background tokenization result",{fileName:this._model.uri.fsPath.split("\\").pop(),updatedTokenLines:i.map(r=>r.getLineRange()).join(" & "),updatedStateLines:o.map(r=>new Oe(r.startLineNumber,r.startLineNumber+r.stateDeltas.length).toString()).join(" & ")}),this._shouldLog){const r=this._pendingChanges.filter(c=>c.versionId<=t).map(c=>c.changes).map(c=>ne(c)).join(" then ");console.log("Applying changes to local states",r)}for(;this._pendingChanges.length>0&&this._pendingChanges[0].versionId<=t;){const r=this._pendingChanges.shift();this._states.acceptChanges(r.changes)}if(this._pendingChanges.length>0){if(this._shouldLog){const a=this._pendingChanges.map(u=>u.changes).map(u=>ne(u)).join(" then ");console.log("Considering non-processed changes",a)}const r=U.fromMany(this._pendingChanges.map(a=>ke(a.changes))),c=new _e;for(const a of i)for(let u=a.startLineNumber;u<=a.endLineNumber;u++)r.transform(u-1)!==void 0&&c.add(u,a.getLineTokens(u));i=c.finalize();for(const a of this._pendingChanges)for(const u of a.changes)for(let g=0;g<i.length;g++)i[g].applyEdit(u.range,u.text)}const s=U.fromMany(this._pendingChanges.map(r=>ke(r.changes)));if(!this._applyStateStackDiffFn||!this._initialState){const{applyStateStackDiff:r,INITIAL:c}=await ie(()=>import("./main-DNugpDp4.js").then(a=>a.m),__vite__mapDeps([0,1,2]),import.meta.url).then(a=>a.default??a);this._applyStateStackDiffFn=r,this._initialState=c}for(const r of o){let c=r.startLineNumber<=1?this._initialState:this._states.getEndState(r.startLineNumber-1);for(let a=0;a<r.stateDeltas.length;a++){const u=r.stateDeltas[a];let g;u?(g=this._applyStateStackDiffFn(c,u),this._states.setEndState(r.startLineNumber+a,g)):g=this._states.getEndState(r.startLineNumber+a);const k=s.transform(r.startLineNumber+a-1);k!==void 0&&this._backgroundTokenizationStore.setEndState(k+1,g),r.startLineNumber+a>=this._model.getLineCount()-1&&this._backgroundTokenizationStore.backgroundTokenizationFinished(),c=g}}this._backgroundTokenizationStore.setTokens(i)}get _shouldLog(){return this._loggingEnabled.get()}};Y._id=0;let se=Y;function ne(h){return h.map(e=>oe.lift(e.range).toString()+" => "+e.text).join(" & ")}var H,z;let ae=(z=class{constructor(e,t,n,o,i,s,r){this._reportTokenizationTime=e,this._shouldTokenizeAsync=t,this._extensionResourceLoaderService=n,this._configurationService=o,this._languageService=i,this._notificationService=s,this._telemetryService=r,this._workerProxyPromise=null,this._worker=null,this._workerProxy=null,this._workerTokenizerControllers=new Map,this._currentTheme=null,this._currentTokenColorMap=null,this._grammarDefinitions=[]}dispose(){this._disposeWorker()}createBackgroundTokenizer(e,t,n){if(!this._shouldTokenizeAsync()||e.isTooLargeForSyncing())return;const o=new B,i=this._getWorkerProxy().then(s=>{if(o.isDisposed||!s)return;const r={controller:void 0,worker:this._worker};return o.add(Et(e,()=>{const c=new se(e,s,this._languageService.languageIdCodec,t,this._configurationService,n);return r.controller=c,this._workerTokenizerControllers.set(c.controllerId,c),Be(()=>{r.controller=void 0,this._workerTokenizerControllers.delete(c.controllerId),c.dispose()})})),r});return{dispose(){o.dispose()},requestTokens:async(s,r)=>{const c=await i;c?.controller&&c.worker===this._worker&&c.controller.requestTokens(s,r)},reportMismatchingTokens:s=>{H._reportedMismatchingTokens||(H._reportedMismatchingTokens=!0,this._notificationService.error({message:"Async Tokenization Token Mismatch in line "+s,name:"Async Tokenization Token Mismatch"}),this._telemetryService.publicLog2("asyncTokenizationMismatchingTokens",{}))}}}setGrammarDefinitions(e){this._grammarDefinitions=e,this._disposeWorker()}acceptTheme(e,t){this._currentTheme=e,this._currentTokenColorMap=t,this._currentTheme&&this._currentTokenColorMap&&this._workerProxy&&this._workerProxy.$acceptTheme(this._currentTheme,this._currentTokenColorMap)}_getWorkerProxy(){return this._workerProxyPromise||(this._workerProxyPromise=this._createWorkerProxy()),this._workerProxyPromise}async _createWorkerProxy(){const e={grammarDefinitions:this._grammarDefinitions,onigurumaWASMUri:new URL(""+new URL("onig-Du5pRr7Y.wasm",import.meta.url).href,import.meta.url).href},t=this._worker=je(Le.asBrowserUri("vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.workerMain.js"),"TextMateWorker");return re.setChannel(t,{$readFile:async n=>{const o=Fe.revive(n);return this._extensionResourceLoaderService.readExtensionResource(o)},$setTokensAndStates:async(n,o,i,s)=>{const r=this._workerTokenizerControllers.get(n);r&&r.setTokensAndStates(n,o,i,s)},$reportTokenizationTime:(n,o,i,s,r)=>{this._reportTokenizationTime(n,o,i,s,r)}}),await t.proxy.$init(e),this._worker!==t?null:(this._workerProxy=t.proxy,this._currentTheme&&this._currentTokenColorMap&&this._workerProxy.$acceptTheme(this._currentTheme,this._currentTokenColorMap),t.proxy)}_disposeWorker(){for(const e of this._workerTokenizerControllers.values())e.dispose();this._workerTokenizerControllers.clear(),this._worker&&(this._worker.dispose(),this._worker=null),this._workerProxy=null,this._workerProxyPromise=null}},H=z,z._reportedMismatchingTokens=!1,z);ae=H=X([m(2,Ce),m(3,le),m(4,ge),m(5,he),m(6,Ie)],ae);function Et(h,e){const t=new B,n=t.add(new B);function o(){h.isAttachedToEditor()?n.add(e()):n.clear()}return o(),t.add(h.onDidChangeAttached(()=>{o()})),t}class xt{constructor(){this._scopeNameToLanguageRegistration=Object.create(null)}reset(){this._scopeNameToLanguageRegistration=Object.create(null)}register(e){this._scopeNameToLanguageRegistration[e.scopeName]=e}getGrammarDefinition(e){return this._scopeNameToLanguageRegistration[e]||null}}const q="No TM Grammar registered for this language.";class Pt extends P{constructor(e,t,n,o){super(),this._host=e,this._initialState=n.INITIAL,this._scopeRegistry=new xt,this._injections={},this._injectedEmbeddedLanguages={},this._languageToScope=new Map,this._grammarRegistry=this._register(new n.Registry({onigLib:o,loadGrammar:async i=>{const s=this._scopeRegistry.getGrammarDefinition(i);if(!s)return this._host.logTrace(`No grammar found for scope ${i}`),null;const r=s.location;try{const c=await this._host.readFile(r);return n.parseRawGrammar(c,r.path)}catch(c){return this._host.logError(`Unable to load and parse grammar for scope ${i} from ${r}`,c),null}},getInjections:i=>{const s=i.split(".");let r=[];for(let c=1;c<=s.length;c++){const a=s.slice(0,c).join(".");r=[...r,...this._injections[a]||[]]}return r}}));for(const i of t){if(this._scopeRegistry.register(i),i.injectTo){for(const s of i.injectTo){let r=this._injections[s];r||(this._injections[s]=r=[]),r.push(i.scopeName)}if(i.embeddedLanguages)for(const s of i.injectTo){let r=this._injectedEmbeddedLanguages[s];r||(this._injectedEmbeddedLanguages[s]=r=[]),r.push(i.embeddedLanguages)}}i.language&&this._languageToScope.set(i.language,i.scopeName)}}has(e){return this._languageToScope.has(e)}setTheme(e,t){this._grammarRegistry.setTheme(e,t)}getColorMap(){return this._grammarRegistry.getColorMap()}async createGrammar(e,t){const n=this._languageToScope.get(e);if(typeof n!="string")throw new Error(q);const o=this._scopeRegistry.getGrammarDefinition(n);if(!o)throw new Error(q);const i=o.embeddedLanguages;if(this._injectedEmbeddedLanguages[n]){const c=this._injectedEmbeddedLanguages[n];for(const a of c)for(const u of Object.keys(a))i[u]=a[u]}const s=Object.keys(i).length>0;let r;try{r=await this._grammarRegistry.loadGrammarWithConfiguration(n,t,{embeddedLanguages:i,tokenTypes:o.tokenTypes,balancedBracketSelectors:o.balancedBracketSelectors,unbalancedBracketSelectors:o.unbalancedBracketSelectors})}catch(c){throw c.message&&c.message.startsWith("No grammar provided for")?new Error(q):c}return{languageId:e,grammar:r,initialState:this._initialState,containsEmbeddedLanguages:s,sourceExtensionId:o.sourceExtensionId}}}const M=Z.registerExtensionPoint({extensionPoint:"grammars",deps:[$e],jsonSchema:{description:l(12863,"Contributes textmate tokenizers."),type:"array",defaultSnippets:[{body:[{language:"${1:id}",scopeName:"source.${2:id}",path:"./syntaxes/${3:id}.tmLanguage."}]}],items:{type:"object",defaultSnippets:[{body:{language:"${1:id}",scopeName:"source.${2:id}",path:"./syntaxes/${3:id}.tmLanguage."}}],properties:{language:{description:l(12864,"Language identifier for which this syntax is contributed to."),type:"string"},scopeName:{description:l(12865,"Textmate scope name used by the tmLanguage file."),type:"string"},path:{description:l(12866,"Path of the tmLanguage file. The path is relative to the extension folder and typically starts with './syntaxes/'."),type:"string"},embeddedLanguages:{description:l(12867,"A map of scope name to language id if this grammar contains embedded languages."),type:"object"},tokenTypes:{description:l(12868,"A map of scope name to token types."),type:"object",additionalProperties:{enum:["string","comment","other"]}},injectTo:{description:l(12869,"List of language scope names to which this grammar is injected to."),type:"array",items:{type:"string"}},balancedBracketScopes:{description:l(12870,"Defines which scope names contain balanced brackets."),type:"array",items:{type:"string"},default:["*"]},unbalancedBracketScopes:{description:l(12871,"Defines which scope names do not contain balanced brackets."),type:"array",items:{type:"string"},default:[]}},required:["scopeName","path"]}}});var A,E;let ce=(E=class extends P{constructor(e,t,n,o,i,s,r,c,a,u){super(),this._languageService=e,this._themeService=t,this._extensionResourceLoaderService=n,this._notificationService=o,this._logService=i,this._configurationService=s,this._progressService=r,this._environmentService=c,this._instantiationService=a,this._telemetryService=u,this._createdModes=[],this._encounteredLanguages=[],this._debugMode=!1,this._debugModePrintFunc=()=>{},this._grammarDefinitions=null,this._grammarFactory=null,this._tokenizersRegistrations=this._register(new B),this._currentTheme=null,this._currentTokenColorMap=null,this._threadedBackgroundTokenizerFactory=this._instantiationService.createInstance(ae,(g,k,w,y,T)=>this._reportTokenizationTime(g,k,w,y,!0,T),()=>this.getAsyncTokenizationEnabled()),this._vscodeOniguruma=null,this._styleElement=Ve(),this._styleElement.className="vscode-tokens-styles",M.setHandler(g=>this._handleGrammarsExtPoint(g)),this._updateTheme(this._themeService.getColorTheme(),!0),this._register(this._themeService.onDidColorThemeChange(()=>{this._updateTheme(this._themeService.getColorTheme(),!1)})),this._register(this._languageService.onDidRequestRichLanguageFeatures(g=>{this._createdModes.push(g)}))}getAsyncTokenizationEnabled(){return!!this._configurationService.getValue("editor.experimental.asyncTokenization")}getAsyncTokenizationVerification(){return!!this._configurationService.getValue("editor.experimental.asyncTokenizationVerification")}_handleGrammarsExtPoint(e){this._grammarDefinitions=null,this._grammarFactory&&(this._grammarFactory.dispose(),this._grammarFactory=null),this._tokenizersRegistrations.clear(),this._grammarDefinitions=[];for(const t of e){const n=t.value;for(const o of n){const i=this._validateGrammarDefinition(t,o);if(i&&(this._grammarDefinitions.push(i),i.language)){const s=new Ge(()=>this._createTokenizationSupport(i.language));this._tokenizersRegistrations.add(s),this._tokenizersRegistrations.add(te.registerFactory(i.language,s))}}}this._threadedBackgroundTokenizerFactory.setGrammarDefinitions(this._grammarDefinitions);for(const t of this._createdModes)te.getOrCreate(t)}_validateGrammarDefinition(e,t){if(!At(e.description.extensionLocation,t,e.collector,this._languageService))return null;const n=Me(e.description.extensionLocation,t.path),o=Object.create(null);if(t.embeddedLanguages){const c=Object.keys(t.embeddedLanguages);for(let a=0,u=c.length;a<u;a++){const g=c[a],k=t.embeddedLanguages[g];typeof k=="string"&&this._languageService.isRegisteredLanguageId(k)&&(o[g]=this._languageService.languageIdCodec.encodeLanguageId(k))}}const i=Object.create(null);if(t.tokenTypes){const c=Object.keys(t.tokenTypes);for(const a of c)switch(t.tokenTypes[a]){case"string":i[a]=v.String;break;case"other":i[a]=v.Other;break;case"comment":i[a]=v.Comment;break}}const s=t.language&&this._languageService.isRegisteredLanguageId(t.language)?t.language:void 0;function r(c,a){return!Array.isArray(c)||!c.every(u=>typeof u=="string")?a:c}return{location:n,language:s,scopeName:t.scopeName,embeddedLanguages:o,tokenTypes:i,injectTo:t.injectTo,balancedBracketSelectors:r(t.balancedBracketScopes,["*"]),unbalancedBracketSelectors:r(t.unbalancedBracketScopes,[]),sourceExtensionId:e.description.id}}startDebugMode(e,t){if(this._debugMode){this._notificationService.error(l(12852,"Already Logging."));return}this._debugModePrintFunc=e,this._debugMode=!0,this._debugMode&&this._progressService.withProgress({location:We.Notification,buttons:[l(12853,"Stop")]},n=>(n.report({message:l(12854,"Preparing to log TM Grammar parsing. Press Stop when finished.")}),this._getVSCodeOniguruma().then(o=>(o.setDefaultDebugCall(!0),n.report({message:l(12855,"Now logging TM Grammar parsing. Press Stop when finished.")}),new Promise((i,s)=>{})))),n=>{this._getVSCodeOniguruma().then(o=>{this._debugModePrintFunc=()=>{},this._debugMode=!1,o.setDefaultDebugCall(!1),t()})})}_canCreateGrammarFactory(){return!!this._grammarDefinitions}async _getOrCreateGrammarFactory(){if(this._grammarFactory)return this._grammarFactory;const[e,t]=await Promise.all([ie(()=>import("./main-DNugpDp4.js").then(o=>o.m),__vite__mapDeps([0,1,2]),import.meta.url).then(o=>o.default??o),this._getVSCodeOniguruma()]),n=Promise.resolve({createOnigScanner:o=>t.createOnigScanner(o),createOnigString:o=>t.createOnigString(o)});return this._grammarFactory?this._grammarFactory:(this._grammarFactory=new Pt({logTrace:o=>this._logService.trace(o),logError:(o,i)=>this._logService.error(o,i),readFile:o=>this._extensionResourceLoaderService.readExtensionResource(o)},this._grammarDefinitions||[],e,n),this._updateTheme(this._themeService.getColorTheme(),!0),this._grammarFactory)}async _createTokenizationSupport(e){if(!this._languageService.isRegisteredLanguageId(e)||!this._canCreateGrammarFactory())return null;try{const t=await this._getOrCreateGrammarFactory();if(!t.has(e))return null;const n=this._languageService.languageIdCodec.encodeLanguageId(e),o=await t.createGrammar(e,n);if(!o.grammar)return null;const i=Rt("editor.maxTokenizationLineLength",e,-1,this._configurationService),s=new B,r=s.add(new It(o.grammar,o.initialState,o.containsEmbeddedLanguages,(c,a)=>this._threadedBackgroundTokenizerFactory.createBackgroundTokenizer(c,a,i),()=>this.getAsyncTokenizationVerification(),(c,a,u)=>{this._reportTokenizationTime(c,e,o.sourceExtensionId,a,!1,u)},!0));return s.add(r.onDidEncounterLanguage(c=>{if(!this._encounteredLanguages[c]){const a=this._languageService.languageIdCodec.decodeLanguageId(c);this._encounteredLanguages[c]=!0,this._languageService.requestBasicLanguageFeatures(a)}})),new Mt(n,r,s,i)}catch(t){return t.message&&t.message===q||He(t),null}}_updateTheme(e,t){if(!t&&this._currentTheme&&this._currentTokenColorMap&&Nt(this._currentTheme.settings,e.tokenColors)&&qe(this._currentTokenColorMap,e.tokenColorMap))return;this._currentTheme={name:e.label,settings:e.tokenColors},this._currentTokenColorMap=e.tokenColorMap,this._grammarFactory?.setTheme(this._currentTheme,this._currentTokenColorMap);const n=Dt(this._currentTokenColorMap),o=Ue(n);this._styleElement.textContent=o,te.setColorMap(n),this._currentTheme&&this._currentTokenColorMap&&this._threadedBackgroundTokenizerFactory.acceptTheme(this._currentTheme,this._currentTokenColorMap)}async createTokenizer(e){if(!this._languageService.isRegisteredLanguageId(e))return null;const t=await this._getOrCreateGrammarFactory();if(!t.has(e))return null;const n=this._languageService.languageIdCodec.encodeLanguageId(e),{grammar:o}=await t.createGrammar(e,n);return o}_getVSCodeOniguruma(){return this._vscodeOniguruma||(this._vscodeOniguruma=(async()=>{const[e,t]=await Promise.all([ie(()=>import("./main-FP17jmvp.js").then(n=>n.m),__vite__mapDeps([3,1,2]),import.meta.url).then(n=>n.default??n),this._loadVSCodeOnigurumaWASM()]);return await e.loadWASM({data:t,print:n=>{this._debugModePrintFunc(n)}}),e})()),this._vscodeOniguruma}async _loadVSCodeOnigurumaWASM(){return Je?await(await fetch(new URL(""+new URL("onig-Du5pRr7Y.wasm",import.meta.url).href,import.meta.url).href)).arrayBuffer():await fetch(Le.asBrowserUri(`${Ke}/vscode-oniguruma/release/onig.wasm`).toString(!0))}_reportTokenizationTime(e,t,n,o,i,s){const r=i?"async":"sync";A.reportTokenizationTimeCounter[r]>50||(A.reportTokenizationTimeCounter[r]===0&&setTimeout(()=>{A.reportTokenizationTimeCounter[r]=0},1e3*60*60),A.reportTokenizationTimeCounter[r]++,this._telemetryService.publicLog2("editor.tokenizedLine",{timeMs:e,languageId:t,lineLength:o,fromWorker:i,sourceExtensionId:n,isRandomSample:s,tokenizationSetting:this.getAsyncTokenizationEnabled()?this.getAsyncTokenizationVerification()?2:1:0}))}},A=E,E.reportTokenizationTimeCounter={sync:0,async:0},E);ce=A=X([m(0,ge),m(1,Ee),m(2,Ce),m(3,he),m(4,Xe),m(5,le),m(6,Ze),m(7,et),m(8,ze),m(9,Ie)],ce);function Dt(h){const e=[null];for(let t=1,n=h.length;t<n;t++)e[t]=W.fromHex(h[t]);return e}function Nt(h,e){if(!e||!h||e.length!==h.length)return!1;for(let t=e.length-1;t>=0;t--){const n=e[t],o=h[t];if(n.scope!==o.scope)return!1;const i=n.settings,s=o.settings;if(i&&s){if(i.fontStyle!==s.fontStyle||i.foreground!==s.foreground||i.background!==s.background)return!1}else if(!i||!s)return!1}return!0}function At(h,e,t,n){if(e.language&&(typeof e.language!="string"||!n.isRegisteredLanguageId(e.language)))return t.error(l(12856,"Unknown language in `contributes.{0}.language`. Provided value: {1}",M.name,String(e.language))),!1;if(!e.scopeName||typeof e.scopeName!="string")return t.error(l(12857,"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",M.name,String(e.scopeName))),!1;if(!e.path||typeof e.path!="string")return t.error(l(12858,"Expected string in `contributes.{0}.path`. Provided value: {1}",M.name,String(e.path))),!1;if(e.injectTo&&(!Array.isArray(e.injectTo)||e.injectTo.some(i=>typeof i!="string")))return t.error(l(12859,"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",M.name,JSON.stringify(e.injectTo))),!1;if(e.embeddedLanguages&&!Te(e.embeddedLanguages))return t.error(l(12860,"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",M.name,JSON.stringify(e.embeddedLanguages))),!1;if(e.tokenTypes&&!Te(e.tokenTypes))return t.error(l(12861,"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",M.name,JSON.stringify(e.tokenTypes))),!1;const o=Me(h,e.path);return Ye(o,h)||t.warn(l(12862,"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",M.name,o.path,h.path)),!0}function Rt(h,e,t,n){return Qe(o=>n.onDidChangeConfiguration(i=>{i.affectsConfiguration(h,{overrideIdentifier:e})&&o(i)}),()=>n.getValue(h,{overrideIdentifier:e})??t)}const I=Lt(),Ot=Z.registerExtensionPoint({extensionPoint:"semanticTokenTypes",jsonSchema:{description:l(13059,"Contributes semantic token types."),type:"array",items:{type:"object",properties:{id:{type:"string",description:l(13060,"The identifier of the semantic token type"),pattern:$,patternErrorMessage:l(13061,"Identifiers should be in the form letterOrDigit[_-letterOrDigit]*")},superType:{type:"string",description:l(13062,"The super type of the semantic token type"),pattern:$,patternErrorMessage:l(13063,"Super types should be in the form letterOrDigit[_-letterOrDigit]*")},description:{type:"string",description:l(13064,"The description of the semantic token type")}}}}}),jt=Z.registerExtensionPoint({extensionPoint:"semanticTokenModifiers",jsonSchema:{description:l(13065,"Contributes semantic token modifiers."),type:"array",items:{type:"object",properties:{id:{type:"string",description:l(13066,"The identifier of the semantic token modifier"),pattern:$,patternErrorMessage:l(13067,"Identifiers should be in the form letterOrDigit[_-letterOrDigit]*")},description:{type:"string",description:l(13068,"The description of the semantic token modifier")}}}}}),Ft=Z.registerExtensionPoint({extensionPoint:"semanticTokenScopes",jsonSchema:{description:l(13069,"Contributes semantic token scope maps."),type:"array",items:{type:"object",properties:{language:{description:l(13070,"Lists the languge for which the defaults are."),type:"string"},scopes:{description:l(13071,"Maps a semantic token (described by semantic token selector) to one or more textMate scopes used to represent that token."),type:"object",additionalProperties:{type:"array",items:{type:"string"}}}}}}});class Bt{constructor(){function e(t,n,o){if(typeof t.id!="string"||t.id.length===0)return o.error(l(13072,"'configuration.{0}.id' must be defined and can not be empty",n)),!1;if(!t.id.match($))return o.error(l(13073,"'configuration.{0}.id' must follow the pattern letterOrDigit[-_letterOrDigit]*",n)),!1;const i=t.superType;return i&&!i.match($)?(o.error(l(13074,"'configuration.{0}.superType' must follow the pattern letterOrDigit[-_letterOrDigit]*",n)),!1):typeof t.description!="string"||t.id.length===0?(o.error(l(13075,"'configuration.{0}.description' must be defined and can not be empty",n)),!1):!0}Ot.setHandler((t,n)=>{for(const o of n.added){const i=o.value,s=o.collector;if(!i||!Array.isArray(i)){s.error(l(13076,"'configuration.semanticTokenType' must be an array"));return}for(const r of i)e(r,"semanticTokenType",s)&&I.registerTokenType(r.id,r.description,r.superType)}for(const o of n.removed){const i=o.value;for(const s of i)I.deregisterTokenType(s.id)}}),jt.setHandler((t,n)=>{for(const o of n.added){const i=o.value,s=o.collector;if(!i||!Array.isArray(i)){s.error(l(13077,"'configuration.semanticTokenModifier' must be an array"));return}for(const r of i)e(r,"semanticTokenModifier",s)&&I.registerTokenModifier(r.id,r.description)}for(const o of n.removed){const i=o.value;for(const s of i)I.deregisterTokenModifier(s.id)}}),Ft.setHandler((t,n)=>{for(const o of n.added){const i=o.value,s=o.collector;if(!i||!Array.isArray(i)){s.error(l(13078,"'configuration.semanticTokenScopes' must be an array"));return}for(const r of i){if(r.language&&typeof r.language!="string"){s.error(l(13079,"'configuration.semanticTokenScopes.language' must be a string"));continue}if(!r.scopes||typeof r.scopes!="object"){s.error(l(13080,"'configuration.semanticTokenScopes.scopes' must be defined as an object"));continue}for(const c in r.scopes){const a=r.scopes[c];if(!Array.isArray(a)||a.some(u=>typeof u!="string")){s.error(l(13081,"'configuration.semanticTokenScopes.scopes' values must be an array of strings"));continue}try{const u=I.parseTokenSelector(c,r.language);I.registerTokenStyleDefault(u,{scopesToProbe:a.map(g=>g.split(" "))})}catch{s.error(l(13082,"configuration.semanticTokenScopes.scopes': Problems parsing selector {0}.",c))}}}}for(const o of n.removed){const i=o.value;for(const s of i)for(const r in s.scopes){const c=s.scopes[r];try{const a=I.parseTokenSelector(r,s.language);I.registerTokenStyleDefault(a,{scopesToProbe:c.map(u=>u.split(" "))})}catch{}}}})}}var R;let J=(R=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(Bt)}},R.ID="workbench.contrib.tokenClassificationExtensionPoint",R);J=X([m(0,ze)],J);tt(J.ID,J,nt.BlockStartup);const $t=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Vt(h,e,t=!0){for(let n=e.length-1;n>=0;n--){const o=e.slice(0,n),i=e[n],s=Gt(h,i,o,t);if(s)return s}return null}function Gt(h,e,t,n){let o=null;for(let i=h.tokenColors.length-1;i>=0;i--){const s=h.tokenColors[i];if(n&&!s.settings.foreground)continue;let r;if(typeof s.scope=="string")r=s.scope.split(/,/).map(c=>c.trim());else if(Array.isArray(s.scope))r=s.scope;else continue;for(let c=0,a=r.length;c<a;c++){const u=r[c],g=new K(u,s.settings);g.matches(e,t)&&g.isMoreSpecific(o)&&(o=g)}}return o}class K{constructor(e,t){this.rawSelector=e,this.settings=t;const n=this.rawSelector.split(/ /);this.scope=n[n.length-1],this.parentScopes=n.slice(0,n.length-1)}matches(e,t){return K._matches(this.scope,this.parentScopes,e,t)}static _cmp(e,t){if(e===null&&t===null)return 0;if(e===null)return-1;if(t===null)return 1;if(e.scope.length!==t.scope.length)return e.scope.length-t.scope.length;const n=e.parentScopes.length,o=t.parentScopes.length;if(n!==o)return n-o;for(let i=0;i<n;i++){const s=e.parentScopes[i].length,r=t.parentScopes[i].length;if(s!==r)return s-r}return 0}isMoreSpecific(e){return K._cmp(this,e)>0}static _matchesOne(e,t){const n=e+".";return e===t||t.substring(0,n.length)===n}static _matches(e,t,n,o){if(!this._matchesOne(e,n))return!1;let i=t.length-1,s=o.length-1;for(;i>=0&&s>=0;)this._matchesOne(t[i],o[s])&&i--,s--;return i===-1}}var de;it($t);const d=ut;var x;let O=(x=class extends P{static get(e){return e.getContribution(de.ID)}constructor(e,t,n,o,i,s,r){super(),this._editor=e,this._textMateService=t,this._themeService=o,this._languageService=n,this._notificationService=i,this._configurationService=s,this._languageFeaturesService=r,this._widget=null,this._register(this._editor.onDidChangeModel(c=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(c=>this.stop())),this._register(this._editor.onKeyUp(c=>c.keyCode===ot.Escape&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&this._editor.getModel().uri.scheme!==rt.vscodeNotebookCell&&(this._widget=new ue(this._editor,this._textMateService,this._languageService,this._themeService,this._notificationService,this._configurationService,this._languageFeaturesService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}toggle(){this._widget?this.stop():this.launch()}},de=x,x.ID="editor.contrib.inspectEditorTokens",x);O=de=X([m(1,me),m(2,ge),m(3,Ee),m(4,he),m(5,le),m(6,st)],O);class Wt extends _t{constructor(){super({id:"editor.action.inspectTMScopes",label:kt(5274,"Developer: Inspect Editor Tokens and Scopes"),precondition:void 0})}run(e,t){O.get(t)?.toggle()}}function we(h){h.length>40&&(h=h.substr(0,20)+"…"+h.substr(h.length-20));let e="";for(let t=0,n=h.length;t<n;t++){const o=h.charCodeAt(t);switch(o){case be.Tab:e+="→";break;case be.Space:e+="·";break;default:e+=String.fromCharCode(o)}}return e}const Q=class Q extends P{constructor(e,t,n,o,i,s,r){super(),this.allowEditorOverflow=!0,this._isDisposed=!1,this._editor=e,this._languageService=n,this._themeService=o,this._textMateService=t,this._notificationService=i,this._configurationService=s,this._languageFeaturesService=r,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="token-inspect-widget",this._currentRequestCancellationTokenSource=new at,this._beginCompute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(c=>this._beginCompute(this._editor.getPosition()))),this._register(o.onDidColorThemeChange(c=>this._beginCompute(this._editor.getPosition()))),this._register(s.onDidChangeConfiguration(c=>c.affectsConfiguration("editor.semanticHighlighting.enabled")&&this._beginCompute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._isDisposed=!0,this._editor.removeContentWidget(this),this._currentRequestCancellationTokenSource.cancel(),super.dispose()}getId(){return Q._ID}_beginCompute(e){const t=this._textMateService.createTokenizer(this._model.getLanguageId()),n=this._computeSemanticTokens(e),o=this._model.tokenization.tokens.get(),i=o instanceof pt?o:void 0;ct(this._domNode),this._domNode.appendChild(document.createTextNode(l(5275,"Loading..."))),Promise.all([t,n]).then(([s,r])=>{if(this._isDisposed)return;const c=i?.tree.get();this._compute(s,r,c,e),this._domNode.style.maxWidth=`${Math.max(this._editor.getLayoutInfo().width*.66,500)}px`,this._editor.layoutContentWidget(this)},s=>{this._notificationService.warn(s),setTimeout(()=>{O.get(this._editor)?.stop()})})}_isSemanticColoringEnabled(){const e=this._configurationService.getValue(dt,{overrideIdentifier:this._model.getLanguageId(),resource:this._model.uri})?.enabled;return typeof e=="boolean"?e:this._themeService.getColorTheme().semanticHighlighting}_compute(e,t,n,o){const i=e&&this._getTokensAtPosition(e,o),s=t&&this._getSemanticTokenAtPosition(t,o),r=n&&this._getTreeSitterTokenAtPosition(n,o);if(!i&&!s&&!r){Se(this._domNode,"No grammar or semantic tokens available.");return}const c=i?.metadata,a=s?.metadata,u=s&&we(this._model.getValueInRange(s.range)),g=i&&we(this._model.getLineContent(o.lineNumber).substring(i.token.startIndex,i.token.endIndex)),k=u||g||"";if(Se(this._domNode,d("h2.tiw-token",void 0,k,d("span.tiw-token-length",void 0,`${k.length} ${k.length===1?"char":"chars"}`))),p(this._domNode,d("hr.tiw-metadata-separator",{style:"clear:both"})),p(this._domNode,d("table.tiw-metadata-table",void 0,d("tbody",void 0,d("tr",void 0,d("td.tiw-metadata-key",void 0,"language"),d("td.tiw-metadata-value",void 0,c?.languageId||"")),d("tr",void 0,d("td.tiw-metadata-key",void 0,"standard token type"),d("td.tiw-metadata-value",void 0,this._tokenTypeToString(c?.tokenType||v.Other))),...this._formatMetadata(a,c)))),s){p(this._domNode,d("hr.tiw-metadata-separator"));const w=p(this._domNode,d("table.tiw-metadata-table",void 0)),y=p(w,d("tbody",void 0,d("tr",void 0,d("td.tiw-metadata-key",void 0,"semantic token type"),d("td.tiw-metadata-value",void 0,s.type))));if(s.modifiers.length&&p(y,d("tr",void 0,d("td.tiw-metadata-key",void 0,"modifiers"),d("td.tiw-metadata-value",void 0,s.modifiers.join(" ")))),s.metadata){const T=["foreground","bold","italic","underline","strikethrough"],S={},b=new Array;for(const f of T)if(s.metadata[f]!==void 0){const _=s.definitions[f],L=this._renderTokenStyleDefinition(_,f),C=L.map(V=>lt(V)?V.outerHTML:V).join();let j=S[C];j||(S[C]=j=[],b.push([L,C])),j.push(f)}for(const[f,_]of b)p(y,d("tr",void 0,d("td.tiw-metadata-key",void 0,S[_].join(", ")),d("td.tiw-metadata-value",void 0,...f)))}}if(i){const w=this._themeService.getColorTheme();p(this._domNode,d("hr.tiw-metadata-separator"));const y=p(this._domNode,d("table.tiw-metadata-table")),T=p(y,d("tbody"));g&&g!==k&&p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"textmate token"),d("td.tiw-metadata-value",void 0,`${g} (${g.length})`)));const S=new Array;for(let _=i.token.scopes.length-1;_>=0;_--)S.push(i.token.scopes[_]),_>0&&S.push(d("br"));p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"textmate scopes"),d("td.tiw-metadata-value.tiw-metadata-scopes",void 0,...S)));const b=Vt(w,i.token.scopes,!1),f=s?.metadata?.foreground;if(b){if(f!==i.metadata.foreground){let _=d("code.tiw-theme-selector",void 0,b.rawSelector,d("br"),JSON.stringify(b.settings,null," "));f&&(_=d("s",void 0,_)),p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"foreground"),d("td.tiw-metadata-value",void 0,_)))}}else f||p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"foreground"),d("td.tiw-metadata-value",void 0,"No theme selector")))}if(r){const w=r[r.length-1];p(this._domNode,d("hr.tiw-metadata-separator"));const y=p(this._domNode,d("table.tiw-metadata-table")),T=p(y,d("tbody"));p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,`tree-sitter token ${w.id}`),d("td.tiw-metadata-value",void 0,`${w.text}`)));const S=new Array;let b=r.length-1,f=r[b];for(;f.parent||b>0;)S.push(f.type),f=f.parent??r[--b],f&&S.push(d("br"));p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"tree-sitter tree"),d("td.tiw-metadata-value.tiw-metadata-scopes",void 0,...S)));const L=this._model.tokenization.tokens.get().tokenizationImpl.get()?.captureAtPosition(o.lineNumber,o.column);L&&L.length>0&&p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"foreground"),d("td.tiw-metadata-value",void 0,L.map(C=>C.name).join(" "))))}}_formatMetadata(e,t){const n=new Array;function o(a){const u=e?.[a]||t?.[a];if(u!==void 0){const g=e?.[a]?"tiw-metadata-semantic":"";n.push(d("tr",void 0,d("td.tiw-metadata-key",void 0,a),d(`td.tiw-metadata-value.${g}`,void 0,u)))}return u}const i=o("foreground"),s=o("background");if(i&&s){const a=W.fromHex(s),u=W.fromHex(i);a.isOpaque()?n.push(d("tr",void 0,d("td.tiw-metadata-key",void 0,"contrast ratio"),d("td.tiw-metadata-value",void 0,a.getContrastRatio(u.makeOpaque(a)).toFixed(2)))):n.push(d("tr",void 0,d("td.tiw-metadata-key",void 0,"Contrast ratio cannot be precise for background colors that use transparency"),d("td.tiw-metadata-value")))}const r=new Array;function c(a){let u;e&&e[a]?u=d("span.tiw-metadata-semantic",void 0,a):t&&t[a]&&(u=a),u&&(r.length&&r.push(" "),r.push(u))}return c("bold"),c("italic"),c("underline"),c("strikethrough"),r.length&&n.push(d("tr",void 0,d("td.tiw-metadata-key",void 0,"font style"),d("td.tiw-metadata-value",void 0,...r))),n}_decodeMetadata(e){const t=this._themeService.getColorTheme().tokenColorMap,n=N.getLanguageId(e),o=N.getTokenType(e),i=N.getFontStyle(e),s=N.getForeground(e),r=N.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(n),tokenType:o,bold:i&G.Bold?!0:void 0,italic:i&G.Italic?!0:void 0,underline:i&G.Underline?!0:void 0,strikethrough:i&G.Strikethrough?!0:void 0,foreground:t[s],background:t[r]}}_tokenTypeToString(e){switch(e){case v.Other:return"Other";case v.Comment:return"Comment";case v.String:return"String";case v.RegEx:return"RegEx";default:return"??"}}_getTokensAtPosition(e,t){const n=t.lineNumber,o=this._getStateBeforeLine(e,n),i=e.tokenizeLine(this._model.getLineContent(n),o),s=e.tokenizeLine2(this._model.getLineContent(n),o);let r=0;for(let a=i.tokens.length-1;a>=0;a--){const u=i.tokens[a];if(t.column-1>=u.startIndex){r=a;break}}let c=0;for(let a=s.tokens.length>>>1;a>=0;a--)if(t.column-1>=s.tokens[a<<1]){c=a;break}return{token:i.tokens[r],metadata:this._decodeMetadata(s.tokens[(c<<1)+1])}}_getStateBeforeLine(e,t){let n=null;for(let o=1;o<t;o++)n=e.tokenizeLine(this._model.getLineContent(o),n).ruleStack;return n}isSemanticTokens(e){return e&&e.data}async _computeSemanticTokens(e){if(!this._isSemanticColoringEnabled())return null;const t=this._languageFeaturesService.documentSemanticTokensProvider.ordered(this._model);if(t.length){const o=t[0],i=await Promise.resolve(o.provideDocumentSemanticTokens(this._model,null,this._currentRequestCancellationTokenSource.token));if(this.isSemanticTokens(i))return{tokens:i,legend:o.getLegend()}}const n=this._languageFeaturesService.documentRangeSemanticTokensProvider.ordered(this._model);if(n.length){const o=n[0],i=e.lineNumber,s=new oe(i,1,i,this._model.getLineMaxColumn(i)),r=await Promise.resolve(o.provideDocumentRangeSemanticTokens(this._model,s,this._currentRequestCancellationTokenSource.token));if(this.isSemanticTokens(r))return{tokens:r,legend:o.getLegend()}}return null}_getSemanticTokenAtPosition(e,t){const n=e.tokens.data,o=this._model.getLanguageId();let i=0,s=0;const r=t.lineNumber-1,c=t.column-1;for(let a=0;a<n.length;a+=5){const u=n[a],g=n[a+1],k=n[a+2],w=n[a+3],y=n[a+4],T=i+u,S=u===0?s+g:g;if(r===T&&S<=c&&c<S+k){const b=e.legend.tokenTypes[w]||"not in legend (ignored)",f=[];let _=y;for(let ee=0;_>0&&ee<e.legend.tokenModifiers.length;ee++)_&1&&f.push(e.legend.tokenModifiers[ee]),_=_>>1;_>0&&f.push("not in legend (ignored)");const L=new oe(T+1,S+1,T+1,S+1+k),C={},j=this._themeService.getColorTheme().tokenColorMap,D=this._themeService.getColorTheme().getTokenStyleMetadata(b,f,o,!0,C);let fe;return D&&(fe={languageId:void 0,tokenType:v.Other,bold:D?.bold,italic:D?.italic,underline:D?.underline,strikethrough:D?.strikethrough,foreground:j[D?.foreground||gt.None],background:void 0}),{type:b,modifiers:f,range:L,metadata:fe,definitions:C}}i=T,s=S}return null}_walkTreeforPosition(e,t){const n=this._model.getOffsetAt(t);e.gotoFirstChild();let o=!1,i=null;do e.currentNode.startIndex<=n&&n<e.currentNode.endIndex?(o=!0,i=e.currentNode):o=!1;while(o?e.gotoFirstChild():e.gotoNextSibling());return i}_getTreeSitterTokenAtPosition(e,t){const n=[];let o=e?.tree.get();for(;o;){const i=o.walk(),s=this._walkTreeforPosition(i,t);i.delete(),s?(n.push(s),e=e?.getInjectionTrees(s.startIndex,e.languageId),o=e?.tree.get()):o=void 0}return n.length>0?n:null}_renderTokenStyleDefinition(e,t){const n=new Array;if(e===void 0)return n;const o=this._themeService.getColorTheme();if(Array.isArray(e)){const i={};o.resolveScopes(e,i);const s=i[t];if(s&&i.scope){const r=d("ul.tiw-metadata-values"),c=Array.isArray(s.scope)?s.scope:[String(s.scope)];for(const a of c)r.appendChild(d("li.tiw-metadata-value.tiw-metadata-scopes",void 0,a));return n.push(i.scope.join(" "),r,d("code.tiw-theme-selector",void 0,JSON.stringify(s.settings,null," "))),n}return n}else if(Ct.is(e)){const i=o.getTokenStylingRuleScope(e);return i==="setting"?(n.push(`User settings: ${e.selector.id} - ${this._renderStyleProperty(e.style,t)}`),n):(i==="theme"&&n.push(`Color theme: ${e.selector.id} - ${this._renderStyleProperty(e.style,t)}`),n)}else{const i=o.resolveTokenStyleValue(e);return n.push(`Default: ${i?this._renderStyleProperty(i,t):""}`),n}}_renderStyleProperty(e,t){switch(t){case"foreground":return e.foreground?W.Format.CSS.formatHexA(e.foreground,!0):"";default:return e[t]!==void 0?String(e[t]):""}}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[ye.BELOW,ye.ABOVE]}}};Q._ID="editor.contrib.inspectEditorTokensWidget";let ue=Q;ht(O.ID,O,mt.Lazy);ft(Wt);yt(async h=>{h.get(bt).when(wt.Ready).then(()=>{vt.get(me)})});function Jt(){return{...St(),[me.toString()]:new Tt(ce,[],!1)}}export{me as ITextMateTokenizationService,Jt as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./main--VvQJcub.js","./index-DSexFukl.js","./index-B0wc3Rza.css","./main-DWv94O3B.js"])))=>i.map(i=>d[i]);
2
+ import{D as P,E as xe,S as Pe,a as pe,T as N,k as ve,n as De,b as Ne,o as Ae,c as Re,C as _e,L as Oe,l as ke,_ as ie,R as oe,d as B,e as je,F as Le,U as Fe,t as Be,f as X,g as m,I as Ce,h as le,i as ge,j as he,m as Ie,p as Z,q as l,s as $e,u as Ve,v as Ge,w as te,x as Me,y as v,P as We,z as He,A as qe,B as Ue,G as Je,H as Ke,J as Te,K as Ye,M as Qe,N as W,O as Xe,Q as Ze,V as et,W as ze,X as tt,Y as nt,Z as it,$ as ot,a0 as rt,a1 as me,a2 as st,a3 as at,a4 as ct,a5 as dt,a6 as Se,a7 as ut,a8 as p,a9 as lt,aa as G,ab as gt,ac as ye,ad as ht,ae as mt,af as ft,ag as pt,ah as be,ai as _t,aj as kt,ak as Tt,al as St,am as yt,an as bt,ao as wt,ap as vt}from"./index-DSexFukl.js";import{I as Ee}from"./workbenchThemeService.service-CXlQNmVU.js";import{t as $,g as Lt,S as Ct}from"./tokenClassificationRegistry-CZyxOMX0.js";class It extends P{constructor(e,t,n,o,i,s,r){super(),this._grammar=e,this._initialState=t,this._containsEmbeddedLanguages=n,this._createBackgroundTokenizer=o,this._backgroundTokenizerShouldOnlyVerifyTokens=i,this._reportTokenizationTime=s,this._reportSlowTokenization=r,this._seenLanguages=[],this._onDidEncounterLanguage=this._register(new xe),this.onDidEncounterLanguage=this._onDidEncounterLanguage.event}get backgroundTokenizerShouldOnlyVerifyTokens(){return this._backgroundTokenizerShouldOnlyVerifyTokens()}getInitialState(){return this._initialState}tokenize(e,t,n){throw new Error("Not supported!")}createBackgroundTokenizer(e,t){if(this._createBackgroundTokenizer)return this._createBackgroundTokenizer(e,t)}tokenizeEncoded(e,t,n){const o=Math.random()*1e4<1,i=this._reportSlowTokenization||o,s=i?new Pe(!0):void 0,r=this._grammar.tokenizeLine2(e,n,500);if(i){const a=s.elapsed();(o||a>32)&&this._reportTokenizationTime(a,e.length,o)}if(r.stoppedEarly)return console.warn(`Time limit reached when tokenizing line: ${e.substring(0,100)}`),new pe(r.tokens,n);if(this._containsEmbeddedLanguages){const a=this._seenLanguages,u=r.tokens;for(let g=0,k=u.length>>>1;g<k;g++){const w=u[(g<<1)+1],y=N.getLanguageId(w);a[y]||(a[y]=!0,this._onDidEncounterLanguage.fire(y))}}let c;return n.equals(r.ruleStack)?c=n:c=r.ruleStack,new pe(r.tokens,c)}}class Mt extends P{get backgroundTokenizerShouldOnlyVerifyTokens(){return this._actual.backgroundTokenizerShouldOnlyVerifyTokens}constructor(e,t,n,o){super(),this._encodedLanguageId=e,this._actual=t,this._maxTokenizationLineLength=o,this._register(ve(this._maxTokenizationLineLength)),this._register(n)}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,n){throw new Error("Not supported!")}tokenizeEncoded(e,t,n){return e.length>=this._maxTokenizationLineLength.get()?De(this._encodedLanguageId,n):this._actual.tokenizeEncoded(e,t,n)}createBackgroundTokenizer(e,t){if(this._actual.createBackgroundTokenizer)return this._actual.createBackgroundTokenizer(e,t)}}const F=class F{static getChannel(e){return e.getChannel(F.CHANNEL_NAME)}static setChannel(e,t){e.setChannel(F.CHANNEL_NAME,t)}};F.CHANNEL_NAME="textMateWorkerHost";let re=F;class U{static fromMany(e){const t=e.map(n=>new U(n));return new zt(t)}constructor(e){this.transformation=e,this.idx=0,this.offset=0}transform(e){let t=this.transformation.replacements.at(this.idx);for(;t&&t.replaceRange.endExclusive<=e;)this.offset+=t.getLengthDelta(),this.idx++,t=this.transformation.replacements.at(this.idx);if(!(t&&t.replaceRange.start<=e))return e+this.offset}}class zt{constructor(e){this.transformers=e}transform(e){for(const t of this.transformers){const n=t.transform(e);if(n===void 0)return;e=n}return e}}const Y=class Y extends P{constructor(e,t,n,o,i,s){super(),this._model=e,this._worker=t,this._languageIdCodec=n,this._backgroundTokenizationStore=o,this._configurationService=i,this._maxTokenizationLineLength=s,this.controllerId=Y._id++,this._pendingChanges=[],this._states=new Ne,this._loggingEnabled=Ae("editor.experimental.asyncTokenizationLogging",!1,this._configurationService),this._register(ve(this._loggingEnabled)),this._register(this._model.onDidChangeContent(a=>{this._shouldLog&&console.log("model change",{fileName:this._model.uri.fsPath.split("\\").pop(),changes:ne(a.changes)}),this._worker.$acceptModelChanged(this.controllerId,a),this._pendingChanges.push(a)})),this._register(this._model.onDidChangeLanguage(a=>{const u=this._model.getLanguageId(),g=this._languageIdCodec.encodeLanguageId(u);this._worker.$acceptModelLanguageChanged(this.controllerId,u,g)}));const r=this._model.getLanguageId(),c=this._languageIdCodec.encodeLanguageId(r);this._worker.$acceptNewModel({uri:this._model.uri,versionId:this._model.getVersionId(),lines:this._model.getLinesContent(),EOL:this._model.getEOL(),languageId:r,encodedLanguageId:c,maxTokenizationLineLength:this._maxTokenizationLineLength.get(),controllerId:this.controllerId}),this._register(Re(a=>{const u=this._maxTokenizationLineLength.read(a);this._worker.$acceptMaxTokenizationLineLength(this.controllerId,u)}))}dispose(){super.dispose(),this._worker.$acceptRemovedModel(this.controllerId)}requestTokens(e,t){this._worker.$retokenize(this.controllerId,e,t)}async setTokensAndStates(e,t,n,o){if(this.controllerId!==e)return;let i=_e.deserialize(new Uint8Array(n));if(this._shouldLog&&console.log("received background tokenization result",{fileName:this._model.uri.fsPath.split("\\").pop(),updatedTokenLines:i.map(r=>r.getLineRange()).join(" & "),updatedStateLines:o.map(r=>new Oe(r.startLineNumber,r.startLineNumber+r.stateDeltas.length).toString()).join(" & ")}),this._shouldLog){const r=this._pendingChanges.filter(c=>c.versionId<=t).map(c=>c.changes).map(c=>ne(c)).join(" then ");console.log("Applying changes to local states",r)}for(;this._pendingChanges.length>0&&this._pendingChanges[0].versionId<=t;){const r=this._pendingChanges.shift();this._states.acceptChanges(r.changes)}if(this._pendingChanges.length>0){if(this._shouldLog){const a=this._pendingChanges.map(u=>u.changes).map(u=>ne(u)).join(" then ");console.log("Considering non-processed changes",a)}const r=U.fromMany(this._pendingChanges.map(a=>ke(a.changes))),c=new _e;for(const a of i)for(let u=a.startLineNumber;u<=a.endLineNumber;u++)r.transform(u-1)!==void 0&&c.add(u,a.getLineTokens(u));i=c.finalize();for(const a of this._pendingChanges)for(const u of a.changes)for(let g=0;g<i.length;g++)i[g].applyEdit(u.range,u.text)}const s=U.fromMany(this._pendingChanges.map(r=>ke(r.changes)));if(!this._applyStateStackDiffFn||!this._initialState){const{applyStateStackDiff:r,INITIAL:c}=await ie(()=>import("./main--VvQJcub.js").then(a=>a.m),__vite__mapDeps([0,1,2]),import.meta.url).then(a=>a.default??a);this._applyStateStackDiffFn=r,this._initialState=c}for(const r of o){let c=r.startLineNumber<=1?this._initialState:this._states.getEndState(r.startLineNumber-1);for(let a=0;a<r.stateDeltas.length;a++){const u=r.stateDeltas[a];let g;u?(g=this._applyStateStackDiffFn(c,u),this._states.setEndState(r.startLineNumber+a,g)):g=this._states.getEndState(r.startLineNumber+a);const k=s.transform(r.startLineNumber+a-1);k!==void 0&&this._backgroundTokenizationStore.setEndState(k+1,g),r.startLineNumber+a>=this._model.getLineCount()-1&&this._backgroundTokenizationStore.backgroundTokenizationFinished(),c=g}}this._backgroundTokenizationStore.setTokens(i)}get _shouldLog(){return this._loggingEnabled.get()}};Y._id=0;let se=Y;function ne(h){return h.map(e=>oe.lift(e.range).toString()+" => "+e.text).join(" & ")}var H,z;let ae=(z=class{constructor(e,t,n,o,i,s,r){this._reportTokenizationTime=e,this._shouldTokenizeAsync=t,this._extensionResourceLoaderService=n,this._configurationService=o,this._languageService=i,this._notificationService=s,this._telemetryService=r,this._workerProxyPromise=null,this._worker=null,this._workerProxy=null,this._workerTokenizerControllers=new Map,this._currentTheme=null,this._currentTokenColorMap=null,this._grammarDefinitions=[]}dispose(){this._disposeWorker()}createBackgroundTokenizer(e,t,n){if(!this._shouldTokenizeAsync()||e.isTooLargeForSyncing())return;const o=new B,i=this._getWorkerProxy().then(s=>{if(o.isDisposed||!s)return;const r={controller:void 0,worker:this._worker};return o.add(Et(e,()=>{const c=new se(e,s,this._languageService.languageIdCodec,t,this._configurationService,n);return r.controller=c,this._workerTokenizerControllers.set(c.controllerId,c),Be(()=>{r.controller=void 0,this._workerTokenizerControllers.delete(c.controllerId),c.dispose()})})),r});return{dispose(){o.dispose()},requestTokens:async(s,r)=>{const c=await i;c?.controller&&c.worker===this._worker&&c.controller.requestTokens(s,r)},reportMismatchingTokens:s=>{H._reportedMismatchingTokens||(H._reportedMismatchingTokens=!0,this._notificationService.error({message:"Async Tokenization Token Mismatch in line "+s,name:"Async Tokenization Token Mismatch"}),this._telemetryService.publicLog2("asyncTokenizationMismatchingTokens",{}))}}}setGrammarDefinitions(e){this._grammarDefinitions=e,this._disposeWorker()}acceptTheme(e,t){this._currentTheme=e,this._currentTokenColorMap=t,this._currentTheme&&this._currentTokenColorMap&&this._workerProxy&&this._workerProxy.$acceptTheme(this._currentTheme,this._currentTokenColorMap)}_getWorkerProxy(){return this._workerProxyPromise||(this._workerProxyPromise=this._createWorkerProxy()),this._workerProxyPromise}async _createWorkerProxy(){const e={grammarDefinitions:this._grammarDefinitions,onigurumaWASMUri:new URL(""+new URL("onig-Du5pRr7Y.wasm",import.meta.url).href,import.meta.url).href},t=this._worker=je(Le.asBrowserUri("vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.workerMain.js"),"TextMateWorker");return re.setChannel(t,{$readFile:async n=>{const o=Fe.revive(n);return this._extensionResourceLoaderService.readExtensionResource(o)},$setTokensAndStates:async(n,o,i,s)=>{const r=this._workerTokenizerControllers.get(n);r&&r.setTokensAndStates(n,o,i,s)},$reportTokenizationTime:(n,o,i,s,r)=>{this._reportTokenizationTime(n,o,i,s,r)}}),await t.proxy.$init(e),this._worker!==t?null:(this._workerProxy=t.proxy,this._currentTheme&&this._currentTokenColorMap&&this._workerProxy.$acceptTheme(this._currentTheme,this._currentTokenColorMap),t.proxy)}_disposeWorker(){for(const e of this._workerTokenizerControllers.values())e.dispose();this._workerTokenizerControllers.clear(),this._worker&&(this._worker.dispose(),this._worker=null),this._workerProxy=null,this._workerProxyPromise=null}},H=z,z._reportedMismatchingTokens=!1,z);ae=H=X([m(2,Ce),m(3,le),m(4,ge),m(5,he),m(6,Ie)],ae);function Et(h,e){const t=new B,n=t.add(new B);function o(){h.isAttachedToEditor()?n.add(e()):n.clear()}return o(),t.add(h.onDidChangeAttached(()=>{o()})),t}class xt{constructor(){this._scopeNameToLanguageRegistration=Object.create(null)}reset(){this._scopeNameToLanguageRegistration=Object.create(null)}register(e){this._scopeNameToLanguageRegistration[e.scopeName]=e}getGrammarDefinition(e){return this._scopeNameToLanguageRegistration[e]||null}}const q="No TM Grammar registered for this language.";class Pt extends P{constructor(e,t,n,o){super(),this._host=e,this._initialState=n.INITIAL,this._scopeRegistry=new xt,this._injections={},this._injectedEmbeddedLanguages={},this._languageToScope=new Map,this._grammarRegistry=this._register(new n.Registry({onigLib:o,loadGrammar:async i=>{const s=this._scopeRegistry.getGrammarDefinition(i);if(!s)return this._host.logTrace(`No grammar found for scope ${i}`),null;const r=s.location;try{const c=await this._host.readFile(r);return n.parseRawGrammar(c,r.path)}catch(c){return this._host.logError(`Unable to load and parse grammar for scope ${i} from ${r}`,c),null}},getInjections:i=>{const s=i.split(".");let r=[];for(let c=1;c<=s.length;c++){const a=s.slice(0,c).join(".");r=[...r,...this._injections[a]||[]]}return r}}));for(const i of t){if(this._scopeRegistry.register(i),i.injectTo){for(const s of i.injectTo){let r=this._injections[s];r||(this._injections[s]=r=[]),r.push(i.scopeName)}if(i.embeddedLanguages)for(const s of i.injectTo){let r=this._injectedEmbeddedLanguages[s];r||(this._injectedEmbeddedLanguages[s]=r=[]),r.push(i.embeddedLanguages)}}i.language&&this._languageToScope.set(i.language,i.scopeName)}}has(e){return this._languageToScope.has(e)}setTheme(e,t){this._grammarRegistry.setTheme(e,t)}getColorMap(){return this._grammarRegistry.getColorMap()}async createGrammar(e,t){const n=this._languageToScope.get(e);if(typeof n!="string")throw new Error(q);const o=this._scopeRegistry.getGrammarDefinition(n);if(!o)throw new Error(q);const i=o.embeddedLanguages;if(this._injectedEmbeddedLanguages[n]){const c=this._injectedEmbeddedLanguages[n];for(const a of c)for(const u of Object.keys(a))i[u]=a[u]}const s=Object.keys(i).length>0;let r;try{r=await this._grammarRegistry.loadGrammarWithConfiguration(n,t,{embeddedLanguages:i,tokenTypes:o.tokenTypes,balancedBracketSelectors:o.balancedBracketSelectors,unbalancedBracketSelectors:o.unbalancedBracketSelectors})}catch(c){throw c.message&&c.message.startsWith("No grammar provided for")?new Error(q):c}return{languageId:e,grammar:r,initialState:this._initialState,containsEmbeddedLanguages:s,sourceExtensionId:o.sourceExtensionId}}}const M=Z.registerExtensionPoint({extensionPoint:"grammars",deps:[$e],jsonSchema:{description:l(12863,"Contributes textmate tokenizers."),type:"array",defaultSnippets:[{body:[{language:"${1:id}",scopeName:"source.${2:id}",path:"./syntaxes/${3:id}.tmLanguage."}]}],items:{type:"object",defaultSnippets:[{body:{language:"${1:id}",scopeName:"source.${2:id}",path:"./syntaxes/${3:id}.tmLanguage."}}],properties:{language:{description:l(12864,"Language identifier for which this syntax is contributed to."),type:"string"},scopeName:{description:l(12865,"Textmate scope name used by the tmLanguage file."),type:"string"},path:{description:l(12866,"Path of the tmLanguage file. The path is relative to the extension folder and typically starts with './syntaxes/'."),type:"string"},embeddedLanguages:{description:l(12867,"A map of scope name to language id if this grammar contains embedded languages."),type:"object"},tokenTypes:{description:l(12868,"A map of scope name to token types."),type:"object",additionalProperties:{enum:["string","comment","other"]}},injectTo:{description:l(12869,"List of language scope names to which this grammar is injected to."),type:"array",items:{type:"string"}},balancedBracketScopes:{description:l(12870,"Defines which scope names contain balanced brackets."),type:"array",items:{type:"string"},default:["*"]},unbalancedBracketScopes:{description:l(12871,"Defines which scope names do not contain balanced brackets."),type:"array",items:{type:"string"},default:[]}},required:["scopeName","path"]}}});var A,E;let ce=(E=class extends P{constructor(e,t,n,o,i,s,r,c,a,u){super(),this._languageService=e,this._themeService=t,this._extensionResourceLoaderService=n,this._notificationService=o,this._logService=i,this._configurationService=s,this._progressService=r,this._environmentService=c,this._instantiationService=a,this._telemetryService=u,this._createdModes=[],this._encounteredLanguages=[],this._debugMode=!1,this._debugModePrintFunc=()=>{},this._grammarDefinitions=null,this._grammarFactory=null,this._tokenizersRegistrations=this._register(new B),this._currentTheme=null,this._currentTokenColorMap=null,this._threadedBackgroundTokenizerFactory=this._instantiationService.createInstance(ae,(g,k,w,y,T)=>this._reportTokenizationTime(g,k,w,y,!0,T),()=>this.getAsyncTokenizationEnabled()),this._vscodeOniguruma=null,this._styleElement=Ve(),this._styleElement.className="vscode-tokens-styles",M.setHandler(g=>this._handleGrammarsExtPoint(g)),this._updateTheme(this._themeService.getColorTheme(),!0),this._register(this._themeService.onDidColorThemeChange(()=>{this._updateTheme(this._themeService.getColorTheme(),!1)})),this._register(this._languageService.onDidRequestRichLanguageFeatures(g=>{this._createdModes.push(g)}))}getAsyncTokenizationEnabled(){return!!this._configurationService.getValue("editor.experimental.asyncTokenization")}getAsyncTokenizationVerification(){return!!this._configurationService.getValue("editor.experimental.asyncTokenizationVerification")}_handleGrammarsExtPoint(e){this._grammarDefinitions=null,this._grammarFactory&&(this._grammarFactory.dispose(),this._grammarFactory=null),this._tokenizersRegistrations.clear(),this._grammarDefinitions=[];for(const t of e){const n=t.value;for(const o of n){const i=this._validateGrammarDefinition(t,o);if(i&&(this._grammarDefinitions.push(i),i.language)){const s=new Ge(()=>this._createTokenizationSupport(i.language));this._tokenizersRegistrations.add(s),this._tokenizersRegistrations.add(te.registerFactory(i.language,s))}}}this._threadedBackgroundTokenizerFactory.setGrammarDefinitions(this._grammarDefinitions);for(const t of this._createdModes)te.getOrCreate(t)}_validateGrammarDefinition(e,t){if(!At(e.description.extensionLocation,t,e.collector,this._languageService))return null;const n=Me(e.description.extensionLocation,t.path),o=Object.create(null);if(t.embeddedLanguages){const c=Object.keys(t.embeddedLanguages);for(let a=0,u=c.length;a<u;a++){const g=c[a],k=t.embeddedLanguages[g];typeof k=="string"&&this._languageService.isRegisteredLanguageId(k)&&(o[g]=this._languageService.languageIdCodec.encodeLanguageId(k))}}const i=Object.create(null);if(t.tokenTypes){const c=Object.keys(t.tokenTypes);for(const a of c)switch(t.tokenTypes[a]){case"string":i[a]=v.String;break;case"other":i[a]=v.Other;break;case"comment":i[a]=v.Comment;break}}const s=t.language&&this._languageService.isRegisteredLanguageId(t.language)?t.language:void 0;function r(c,a){return!Array.isArray(c)||!c.every(u=>typeof u=="string")?a:c}return{location:n,language:s,scopeName:t.scopeName,embeddedLanguages:o,tokenTypes:i,injectTo:t.injectTo,balancedBracketSelectors:r(t.balancedBracketScopes,["*"]),unbalancedBracketSelectors:r(t.unbalancedBracketScopes,[]),sourceExtensionId:e.description.id}}startDebugMode(e,t){if(this._debugMode){this._notificationService.error(l(12852,"Already Logging."));return}this._debugModePrintFunc=e,this._debugMode=!0,this._debugMode&&this._progressService.withProgress({location:We.Notification,buttons:[l(12853,"Stop")]},n=>(n.report({message:l(12854,"Preparing to log TM Grammar parsing. Press Stop when finished.")}),this._getVSCodeOniguruma().then(o=>(o.setDefaultDebugCall(!0),n.report({message:l(12855,"Now logging TM Grammar parsing. Press Stop when finished.")}),new Promise((i,s)=>{})))),n=>{this._getVSCodeOniguruma().then(o=>{this._debugModePrintFunc=()=>{},this._debugMode=!1,o.setDefaultDebugCall(!1),t()})})}_canCreateGrammarFactory(){return!!this._grammarDefinitions}async _getOrCreateGrammarFactory(){if(this._grammarFactory)return this._grammarFactory;const[e,t]=await Promise.all([ie(()=>import("./main--VvQJcub.js").then(o=>o.m),__vite__mapDeps([0,1,2]),import.meta.url).then(o=>o.default??o),this._getVSCodeOniguruma()]),n=Promise.resolve({createOnigScanner:o=>t.createOnigScanner(o),createOnigString:o=>t.createOnigString(o)});return this._grammarFactory?this._grammarFactory:(this._grammarFactory=new Pt({logTrace:o=>this._logService.trace(o),logError:(o,i)=>this._logService.error(o,i),readFile:o=>this._extensionResourceLoaderService.readExtensionResource(o)},this._grammarDefinitions||[],e,n),this._updateTheme(this._themeService.getColorTheme(),!0),this._grammarFactory)}async _createTokenizationSupport(e){if(!this._languageService.isRegisteredLanguageId(e)||!this._canCreateGrammarFactory())return null;try{const t=await this._getOrCreateGrammarFactory();if(!t.has(e))return null;const n=this._languageService.languageIdCodec.encodeLanguageId(e),o=await t.createGrammar(e,n);if(!o.grammar)return null;const i=Rt("editor.maxTokenizationLineLength",e,-1,this._configurationService),s=new B,r=s.add(new It(o.grammar,o.initialState,o.containsEmbeddedLanguages,(c,a)=>this._threadedBackgroundTokenizerFactory.createBackgroundTokenizer(c,a,i),()=>this.getAsyncTokenizationVerification(),(c,a,u)=>{this._reportTokenizationTime(c,e,o.sourceExtensionId,a,!1,u)},!0));return s.add(r.onDidEncounterLanguage(c=>{if(!this._encounteredLanguages[c]){const a=this._languageService.languageIdCodec.decodeLanguageId(c);this._encounteredLanguages[c]=!0,this._languageService.requestBasicLanguageFeatures(a)}})),new Mt(n,r,s,i)}catch(t){return t.message&&t.message===q||He(t),null}}_updateTheme(e,t){if(!t&&this._currentTheme&&this._currentTokenColorMap&&Nt(this._currentTheme.settings,e.tokenColors)&&qe(this._currentTokenColorMap,e.tokenColorMap))return;this._currentTheme={name:e.label,settings:e.tokenColors},this._currentTokenColorMap=e.tokenColorMap,this._grammarFactory?.setTheme(this._currentTheme,this._currentTokenColorMap);const n=Dt(this._currentTokenColorMap),o=Ue(n);this._styleElement.textContent=o,te.setColorMap(n),this._currentTheme&&this._currentTokenColorMap&&this._threadedBackgroundTokenizerFactory.acceptTheme(this._currentTheme,this._currentTokenColorMap)}async createTokenizer(e){if(!this._languageService.isRegisteredLanguageId(e))return null;const t=await this._getOrCreateGrammarFactory();if(!t.has(e))return null;const n=this._languageService.languageIdCodec.encodeLanguageId(e),{grammar:o}=await t.createGrammar(e,n);return o}_getVSCodeOniguruma(){return this._vscodeOniguruma||(this._vscodeOniguruma=(async()=>{const[e,t]=await Promise.all([ie(()=>import("./main-DWv94O3B.js").then(n=>n.m),__vite__mapDeps([3,1,2]),import.meta.url).then(n=>n.default??n),this._loadVSCodeOnigurumaWASM()]);return await e.loadWASM({data:t,print:n=>{this._debugModePrintFunc(n)}}),e})()),this._vscodeOniguruma}async _loadVSCodeOnigurumaWASM(){return Je?await(await fetch(new URL(""+new URL("onig-Du5pRr7Y.wasm",import.meta.url).href,import.meta.url).href)).arrayBuffer():await fetch(Le.asBrowserUri(`${Ke}/vscode-oniguruma/release/onig.wasm`).toString(!0))}_reportTokenizationTime(e,t,n,o,i,s){const r=i?"async":"sync";A.reportTokenizationTimeCounter[r]>50||(A.reportTokenizationTimeCounter[r]===0&&setTimeout(()=>{A.reportTokenizationTimeCounter[r]=0},1e3*60*60),A.reportTokenizationTimeCounter[r]++,this._telemetryService.publicLog2("editor.tokenizedLine",{timeMs:e,languageId:t,lineLength:o,fromWorker:i,sourceExtensionId:n,isRandomSample:s,tokenizationSetting:this.getAsyncTokenizationEnabled()?this.getAsyncTokenizationVerification()?2:1:0}))}},A=E,E.reportTokenizationTimeCounter={sync:0,async:0},E);ce=A=X([m(0,ge),m(1,Ee),m(2,Ce),m(3,he),m(4,Xe),m(5,le),m(6,Ze),m(7,et),m(8,ze),m(9,Ie)],ce);function Dt(h){const e=[null];for(let t=1,n=h.length;t<n;t++)e[t]=W.fromHex(h[t]);return e}function Nt(h,e){if(!e||!h||e.length!==h.length)return!1;for(let t=e.length-1;t>=0;t--){const n=e[t],o=h[t];if(n.scope!==o.scope)return!1;const i=n.settings,s=o.settings;if(i&&s){if(i.fontStyle!==s.fontStyle||i.foreground!==s.foreground||i.background!==s.background)return!1}else if(!i||!s)return!1}return!0}function At(h,e,t,n){if(e.language&&(typeof e.language!="string"||!n.isRegisteredLanguageId(e.language)))return t.error(l(12856,"Unknown language in `contributes.{0}.language`. Provided value: {1}",M.name,String(e.language))),!1;if(!e.scopeName||typeof e.scopeName!="string")return t.error(l(12857,"Expected string in `contributes.{0}.scopeName`. Provided value: {1}",M.name,String(e.scopeName))),!1;if(!e.path||typeof e.path!="string")return t.error(l(12858,"Expected string in `contributes.{0}.path`. Provided value: {1}",M.name,String(e.path))),!1;if(e.injectTo&&(!Array.isArray(e.injectTo)||e.injectTo.some(i=>typeof i!="string")))return t.error(l(12859,"Invalid value in `contributes.{0}.injectTo`. Must be an array of language scope names. Provided value: {1}",M.name,JSON.stringify(e.injectTo))),!1;if(e.embeddedLanguages&&!Te(e.embeddedLanguages))return t.error(l(12860,"Invalid value in `contributes.{0}.embeddedLanguages`. Must be an object map from scope name to language. Provided value: {1}",M.name,JSON.stringify(e.embeddedLanguages))),!1;if(e.tokenTypes&&!Te(e.tokenTypes))return t.error(l(12861,"Invalid value in `contributes.{0}.tokenTypes`. Must be an object map from scope name to token type. Provided value: {1}",M.name,JSON.stringify(e.tokenTypes))),!1;const o=Me(h,e.path);return Ye(o,h)||t.warn(l(12862,"Expected `contributes.{0}.path` ({1}) to be included inside extension's folder ({2}). This might make the extension non-portable.",M.name,o.path,h.path)),!0}function Rt(h,e,t,n){return Qe(o=>n.onDidChangeConfiguration(i=>{i.affectsConfiguration(h,{overrideIdentifier:e})&&o(i)}),()=>n.getValue(h,{overrideIdentifier:e})??t)}const I=Lt(),Ot=Z.registerExtensionPoint({extensionPoint:"semanticTokenTypes",jsonSchema:{description:l(13059,"Contributes semantic token types."),type:"array",items:{type:"object",properties:{id:{type:"string",description:l(13060,"The identifier of the semantic token type"),pattern:$,patternErrorMessage:l(13061,"Identifiers should be in the form letterOrDigit[_-letterOrDigit]*")},superType:{type:"string",description:l(13062,"The super type of the semantic token type"),pattern:$,patternErrorMessage:l(13063,"Super types should be in the form letterOrDigit[_-letterOrDigit]*")},description:{type:"string",description:l(13064,"The description of the semantic token type")}}}}}),jt=Z.registerExtensionPoint({extensionPoint:"semanticTokenModifiers",jsonSchema:{description:l(13065,"Contributes semantic token modifiers."),type:"array",items:{type:"object",properties:{id:{type:"string",description:l(13066,"The identifier of the semantic token modifier"),pattern:$,patternErrorMessage:l(13067,"Identifiers should be in the form letterOrDigit[_-letterOrDigit]*")},description:{type:"string",description:l(13068,"The description of the semantic token modifier")}}}}}),Ft=Z.registerExtensionPoint({extensionPoint:"semanticTokenScopes",jsonSchema:{description:l(13069,"Contributes semantic token scope maps."),type:"array",items:{type:"object",properties:{language:{description:l(13070,"Lists the languge for which the defaults are."),type:"string"},scopes:{description:l(13071,"Maps a semantic token (described by semantic token selector) to one or more textMate scopes used to represent that token."),type:"object",additionalProperties:{type:"array",items:{type:"string"}}}}}}});class Bt{constructor(){function e(t,n,o){if(typeof t.id!="string"||t.id.length===0)return o.error(l(13072,"'configuration.{0}.id' must be defined and can not be empty",n)),!1;if(!t.id.match($))return o.error(l(13073,"'configuration.{0}.id' must follow the pattern letterOrDigit[-_letterOrDigit]*",n)),!1;const i=t.superType;return i&&!i.match($)?(o.error(l(13074,"'configuration.{0}.superType' must follow the pattern letterOrDigit[-_letterOrDigit]*",n)),!1):typeof t.description!="string"||t.id.length===0?(o.error(l(13075,"'configuration.{0}.description' must be defined and can not be empty",n)),!1):!0}Ot.setHandler((t,n)=>{for(const o of n.added){const i=o.value,s=o.collector;if(!i||!Array.isArray(i)){s.error(l(13076,"'configuration.semanticTokenType' must be an array"));return}for(const r of i)e(r,"semanticTokenType",s)&&I.registerTokenType(r.id,r.description,r.superType)}for(const o of n.removed){const i=o.value;for(const s of i)I.deregisterTokenType(s.id)}}),jt.setHandler((t,n)=>{for(const o of n.added){const i=o.value,s=o.collector;if(!i||!Array.isArray(i)){s.error(l(13077,"'configuration.semanticTokenModifier' must be an array"));return}for(const r of i)e(r,"semanticTokenModifier",s)&&I.registerTokenModifier(r.id,r.description)}for(const o of n.removed){const i=o.value;for(const s of i)I.deregisterTokenModifier(s.id)}}),Ft.setHandler((t,n)=>{for(const o of n.added){const i=o.value,s=o.collector;if(!i||!Array.isArray(i)){s.error(l(13078,"'configuration.semanticTokenScopes' must be an array"));return}for(const r of i){if(r.language&&typeof r.language!="string"){s.error(l(13079,"'configuration.semanticTokenScopes.language' must be a string"));continue}if(!r.scopes||typeof r.scopes!="object"){s.error(l(13080,"'configuration.semanticTokenScopes.scopes' must be defined as an object"));continue}for(const c in r.scopes){const a=r.scopes[c];if(!Array.isArray(a)||a.some(u=>typeof u!="string")){s.error(l(13081,"'configuration.semanticTokenScopes.scopes' values must be an array of strings"));continue}try{const u=I.parseTokenSelector(c,r.language);I.registerTokenStyleDefault(u,{scopesToProbe:a.map(g=>g.split(" "))})}catch{s.error(l(13082,"configuration.semanticTokenScopes.scopes': Problems parsing selector {0}.",c))}}}}for(const o of n.removed){const i=o.value;for(const s of i)for(const r in s.scopes){const c=s.scopes[r];try{const a=I.parseTokenSelector(r,s.language);I.registerTokenStyleDefault(a,{scopesToProbe:c.map(u=>u.split(" "))})}catch{}}}})}}var R;let J=(R=class{constructor(e){this.instantiationService=e,this.instantiationService.createInstance(Bt)}},R.ID="workbench.contrib.tokenClassificationExtensionPoint",R);J=X([m(0,ze)],J);tt(J.ID,J,nt.BlockStartup);const $t=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function Vt(h,e,t=!0){for(let n=e.length-1;n>=0;n--){const o=e.slice(0,n),i=e[n],s=Gt(h,i,o,t);if(s)return s}return null}function Gt(h,e,t,n){let o=null;for(let i=h.tokenColors.length-1;i>=0;i--){const s=h.tokenColors[i];if(n&&!s.settings.foreground)continue;let r;if(typeof s.scope=="string")r=s.scope.split(/,/).map(c=>c.trim());else if(Array.isArray(s.scope))r=s.scope;else continue;for(let c=0,a=r.length;c<a;c++){const u=r[c],g=new K(u,s.settings);g.matches(e,t)&&g.isMoreSpecific(o)&&(o=g)}}return o}class K{constructor(e,t){this.rawSelector=e,this.settings=t;const n=this.rawSelector.split(/ /);this.scope=n[n.length-1],this.parentScopes=n.slice(0,n.length-1)}matches(e,t){return K._matches(this.scope,this.parentScopes,e,t)}static _cmp(e,t){if(e===null&&t===null)return 0;if(e===null)return-1;if(t===null)return 1;if(e.scope.length!==t.scope.length)return e.scope.length-t.scope.length;const n=e.parentScopes.length,o=t.parentScopes.length;if(n!==o)return n-o;for(let i=0;i<n;i++){const s=e.parentScopes[i].length,r=t.parentScopes[i].length;if(s!==r)return s-r}return 0}isMoreSpecific(e){return K._cmp(this,e)>0}static _matchesOne(e,t){const n=e+".";return e===t||t.substring(0,n.length)===n}static _matches(e,t,n,o){if(!this._matchesOne(e,n))return!1;let i=t.length-1,s=o.length-1;for(;i>=0&&s>=0;)this._matchesOne(t[i],o[s])&&i--,s--;return i===-1}}var de;it($t);const d=ut;var x;let O=(x=class extends P{static get(e){return e.getContribution(de.ID)}constructor(e,t,n,o,i,s,r){super(),this._editor=e,this._textMateService=t,this._themeService=o,this._languageService=n,this._notificationService=i,this._configurationService=s,this._languageFeaturesService=r,this._widget=null,this._register(this._editor.onDidChangeModel(c=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(c=>this.stop())),this._register(this._editor.onKeyUp(c=>c.keyCode===ot.Escape&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&this._editor.getModel().uri.scheme!==rt.vscodeNotebookCell&&(this._widget=new ue(this._editor,this._textMateService,this._languageService,this._themeService,this._notificationService,this._configurationService,this._languageFeaturesService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}toggle(){this._widget?this.stop():this.launch()}},de=x,x.ID="editor.contrib.inspectEditorTokens",x);O=de=X([m(1,me),m(2,ge),m(3,Ee),m(4,he),m(5,le),m(6,st)],O);class Wt extends _t{constructor(){super({id:"editor.action.inspectTMScopes",label:kt(5274,"Developer: Inspect Editor Tokens and Scopes"),precondition:void 0})}run(e,t){O.get(t)?.toggle()}}function we(h){h.length>40&&(h=h.substr(0,20)+"…"+h.substr(h.length-20));let e="";for(let t=0,n=h.length;t<n;t++){const o=h.charCodeAt(t);switch(o){case be.Tab:e+="→";break;case be.Space:e+="·";break;default:e+=String.fromCharCode(o)}}return e}const Q=class Q extends P{constructor(e,t,n,o,i,s,r){super(),this.allowEditorOverflow=!0,this._isDisposed=!1,this._editor=e,this._languageService=n,this._themeService=o,this._textMateService=t,this._notificationService=i,this._configurationService=s,this._languageFeaturesService=r,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="token-inspect-widget",this._currentRequestCancellationTokenSource=new at,this._beginCompute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(c=>this._beginCompute(this._editor.getPosition()))),this._register(o.onDidColorThemeChange(c=>this._beginCompute(this._editor.getPosition()))),this._register(s.onDidChangeConfiguration(c=>c.affectsConfiguration("editor.semanticHighlighting.enabled")&&this._beginCompute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._isDisposed=!0,this._editor.removeContentWidget(this),this._currentRequestCancellationTokenSource.cancel(),super.dispose()}getId(){return Q._ID}_beginCompute(e){const t=this._textMateService.createTokenizer(this._model.getLanguageId()),n=this._computeSemanticTokens(e),o=this._model.tokenization.tokens.get(),i=o instanceof pt?o:void 0;ct(this._domNode),this._domNode.appendChild(document.createTextNode(l(5275,"Loading..."))),Promise.all([t,n]).then(([s,r])=>{if(this._isDisposed)return;const c=i?.tree.get();this._compute(s,r,c,e),this._domNode.style.maxWidth=`${Math.max(this._editor.getLayoutInfo().width*.66,500)}px`,this._editor.layoutContentWidget(this)},s=>{this._notificationService.warn(s),setTimeout(()=>{O.get(this._editor)?.stop()})})}_isSemanticColoringEnabled(){const e=this._configurationService.getValue(dt,{overrideIdentifier:this._model.getLanguageId(),resource:this._model.uri})?.enabled;return typeof e=="boolean"?e:this._themeService.getColorTheme().semanticHighlighting}_compute(e,t,n,o){const i=e&&this._getTokensAtPosition(e,o),s=t&&this._getSemanticTokenAtPosition(t,o),r=n&&this._getTreeSitterTokenAtPosition(n,o);if(!i&&!s&&!r){Se(this._domNode,"No grammar or semantic tokens available.");return}const c=i?.metadata,a=s?.metadata,u=s&&we(this._model.getValueInRange(s.range)),g=i&&we(this._model.getLineContent(o.lineNumber).substring(i.token.startIndex,i.token.endIndex)),k=u||g||"";if(Se(this._domNode,d("h2.tiw-token",void 0,k,d("span.tiw-token-length",void 0,`${k.length} ${k.length===1?"char":"chars"}`))),p(this._domNode,d("hr.tiw-metadata-separator",{style:"clear:both"})),p(this._domNode,d("table.tiw-metadata-table",void 0,d("tbody",void 0,d("tr",void 0,d("td.tiw-metadata-key",void 0,"language"),d("td.tiw-metadata-value",void 0,c?.languageId||"")),d("tr",void 0,d("td.tiw-metadata-key",void 0,"standard token type"),d("td.tiw-metadata-value",void 0,this._tokenTypeToString(c?.tokenType||v.Other))),...this._formatMetadata(a,c)))),s){p(this._domNode,d("hr.tiw-metadata-separator"));const w=p(this._domNode,d("table.tiw-metadata-table",void 0)),y=p(w,d("tbody",void 0,d("tr",void 0,d("td.tiw-metadata-key",void 0,"semantic token type"),d("td.tiw-metadata-value",void 0,s.type))));if(s.modifiers.length&&p(y,d("tr",void 0,d("td.tiw-metadata-key",void 0,"modifiers"),d("td.tiw-metadata-value",void 0,s.modifiers.join(" ")))),s.metadata){const T=["foreground","bold","italic","underline","strikethrough"],S={},b=new Array;for(const f of T)if(s.metadata[f]!==void 0){const _=s.definitions[f],L=this._renderTokenStyleDefinition(_,f),C=L.map(V=>lt(V)?V.outerHTML:V).join();let j=S[C];j||(S[C]=j=[],b.push([L,C])),j.push(f)}for(const[f,_]of b)p(y,d("tr",void 0,d("td.tiw-metadata-key",void 0,S[_].join(", ")),d("td.tiw-metadata-value",void 0,...f)))}}if(i){const w=this._themeService.getColorTheme();p(this._domNode,d("hr.tiw-metadata-separator"));const y=p(this._domNode,d("table.tiw-metadata-table")),T=p(y,d("tbody"));g&&g!==k&&p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"textmate token"),d("td.tiw-metadata-value",void 0,`${g} (${g.length})`)));const S=new Array;for(let _=i.token.scopes.length-1;_>=0;_--)S.push(i.token.scopes[_]),_>0&&S.push(d("br"));p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"textmate scopes"),d("td.tiw-metadata-value.tiw-metadata-scopes",void 0,...S)));const b=Vt(w,i.token.scopes,!1),f=s?.metadata?.foreground;if(b){if(f!==i.metadata.foreground){let _=d("code.tiw-theme-selector",void 0,b.rawSelector,d("br"),JSON.stringify(b.settings,null," "));f&&(_=d("s",void 0,_)),p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"foreground"),d("td.tiw-metadata-value",void 0,_)))}}else f||p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"foreground"),d("td.tiw-metadata-value",void 0,"No theme selector")))}if(r){const w=r[r.length-1];p(this._domNode,d("hr.tiw-metadata-separator"));const y=p(this._domNode,d("table.tiw-metadata-table")),T=p(y,d("tbody"));p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,`tree-sitter token ${w.id}`),d("td.tiw-metadata-value",void 0,`${w.text}`)));const S=new Array;let b=r.length-1,f=r[b];for(;f.parent||b>0;)S.push(f.type),f=f.parent??r[--b],f&&S.push(d("br"));p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"tree-sitter tree"),d("td.tiw-metadata-value.tiw-metadata-scopes",void 0,...S)));const L=this._model.tokenization.tokens.get().tokenizationImpl.get()?.captureAtPosition(o.lineNumber,o.column);L&&L.length>0&&p(T,d("tr",void 0,d("td.tiw-metadata-key",void 0,"foreground"),d("td.tiw-metadata-value",void 0,L.map(C=>C.name).join(" "))))}}_formatMetadata(e,t){const n=new Array;function o(a){const u=e?.[a]||t?.[a];if(u!==void 0){const g=e?.[a]?"tiw-metadata-semantic":"";n.push(d("tr",void 0,d("td.tiw-metadata-key",void 0,a),d(`td.tiw-metadata-value.${g}`,void 0,u)))}return u}const i=o("foreground"),s=o("background");if(i&&s){const a=W.fromHex(s),u=W.fromHex(i);a.isOpaque()?n.push(d("tr",void 0,d("td.tiw-metadata-key",void 0,"contrast ratio"),d("td.tiw-metadata-value",void 0,a.getContrastRatio(u.makeOpaque(a)).toFixed(2)))):n.push(d("tr",void 0,d("td.tiw-metadata-key",void 0,"Contrast ratio cannot be precise for background colors that use transparency"),d("td.tiw-metadata-value")))}const r=new Array;function c(a){let u;e&&e[a]?u=d("span.tiw-metadata-semantic",void 0,a):t&&t[a]&&(u=a),u&&(r.length&&r.push(" "),r.push(u))}return c("bold"),c("italic"),c("underline"),c("strikethrough"),r.length&&n.push(d("tr",void 0,d("td.tiw-metadata-key",void 0,"font style"),d("td.tiw-metadata-value",void 0,...r))),n}_decodeMetadata(e){const t=this._themeService.getColorTheme().tokenColorMap,n=N.getLanguageId(e),o=N.getTokenType(e),i=N.getFontStyle(e),s=N.getForeground(e),r=N.getBackground(e);return{languageId:this._languageService.languageIdCodec.decodeLanguageId(n),tokenType:o,bold:i&G.Bold?!0:void 0,italic:i&G.Italic?!0:void 0,underline:i&G.Underline?!0:void 0,strikethrough:i&G.Strikethrough?!0:void 0,foreground:t[s],background:t[r]}}_tokenTypeToString(e){switch(e){case v.Other:return"Other";case v.Comment:return"Comment";case v.String:return"String";case v.RegEx:return"RegEx";default:return"??"}}_getTokensAtPosition(e,t){const n=t.lineNumber,o=this._getStateBeforeLine(e,n),i=e.tokenizeLine(this._model.getLineContent(n),o),s=e.tokenizeLine2(this._model.getLineContent(n),o);let r=0;for(let a=i.tokens.length-1;a>=0;a--){const u=i.tokens[a];if(t.column-1>=u.startIndex){r=a;break}}let c=0;for(let a=s.tokens.length>>>1;a>=0;a--)if(t.column-1>=s.tokens[a<<1]){c=a;break}return{token:i.tokens[r],metadata:this._decodeMetadata(s.tokens[(c<<1)+1])}}_getStateBeforeLine(e,t){let n=null;for(let o=1;o<t;o++)n=e.tokenizeLine(this._model.getLineContent(o),n).ruleStack;return n}isSemanticTokens(e){return e&&e.data}async _computeSemanticTokens(e){if(!this._isSemanticColoringEnabled())return null;const t=this._languageFeaturesService.documentSemanticTokensProvider.ordered(this._model);if(t.length){const o=t[0],i=await Promise.resolve(o.provideDocumentSemanticTokens(this._model,null,this._currentRequestCancellationTokenSource.token));if(this.isSemanticTokens(i))return{tokens:i,legend:o.getLegend()}}const n=this._languageFeaturesService.documentRangeSemanticTokensProvider.ordered(this._model);if(n.length){const o=n[0],i=e.lineNumber,s=new oe(i,1,i,this._model.getLineMaxColumn(i)),r=await Promise.resolve(o.provideDocumentRangeSemanticTokens(this._model,s,this._currentRequestCancellationTokenSource.token));if(this.isSemanticTokens(r))return{tokens:r,legend:o.getLegend()}}return null}_getSemanticTokenAtPosition(e,t){const n=e.tokens.data,o=this._model.getLanguageId();let i=0,s=0;const r=t.lineNumber-1,c=t.column-1;for(let a=0;a<n.length;a+=5){const u=n[a],g=n[a+1],k=n[a+2],w=n[a+3],y=n[a+4],T=i+u,S=u===0?s+g:g;if(r===T&&S<=c&&c<S+k){const b=e.legend.tokenTypes[w]||"not in legend (ignored)",f=[];let _=y;for(let ee=0;_>0&&ee<e.legend.tokenModifiers.length;ee++)_&1&&f.push(e.legend.tokenModifiers[ee]),_=_>>1;_>0&&f.push("not in legend (ignored)");const L=new oe(T+1,S+1,T+1,S+1+k),C={},j=this._themeService.getColorTheme().tokenColorMap,D=this._themeService.getColorTheme().getTokenStyleMetadata(b,f,o,!0,C);let fe;return D&&(fe={languageId:void 0,tokenType:v.Other,bold:D?.bold,italic:D?.italic,underline:D?.underline,strikethrough:D?.strikethrough,foreground:j[D?.foreground||gt.None],background:void 0}),{type:b,modifiers:f,range:L,metadata:fe,definitions:C}}i=T,s=S}return null}_walkTreeforPosition(e,t){const n=this._model.getOffsetAt(t);e.gotoFirstChild();let o=!1,i=null;do e.currentNode.startIndex<=n&&n<e.currentNode.endIndex?(o=!0,i=e.currentNode):o=!1;while(o?e.gotoFirstChild():e.gotoNextSibling());return i}_getTreeSitterTokenAtPosition(e,t){const n=[];let o=e?.tree.get();for(;o;){const i=o.walk(),s=this._walkTreeforPosition(i,t);i.delete(),s?(n.push(s),e=e?.getInjectionTrees(s.startIndex,e.languageId),o=e?.tree.get()):o=void 0}return n.length>0?n:null}_renderTokenStyleDefinition(e,t){const n=new Array;if(e===void 0)return n;const o=this._themeService.getColorTheme();if(Array.isArray(e)){const i={};o.resolveScopes(e,i);const s=i[t];if(s&&i.scope){const r=d("ul.tiw-metadata-values"),c=Array.isArray(s.scope)?s.scope:[String(s.scope)];for(const a of c)r.appendChild(d("li.tiw-metadata-value.tiw-metadata-scopes",void 0,a));return n.push(i.scope.join(" "),r,d("code.tiw-theme-selector",void 0,JSON.stringify(s.settings,null," "))),n}return n}else if(Ct.is(e)){const i=o.getTokenStylingRuleScope(e);return i==="setting"?(n.push(`User settings: ${e.selector.id} - ${this._renderStyleProperty(e.style,t)}`),n):(i==="theme"&&n.push(`Color theme: ${e.selector.id} - ${this._renderStyleProperty(e.style,t)}`),n)}else{const i=o.resolveTokenStyleValue(e);return n.push(`Default: ${i?this._renderStyleProperty(i,t):""}`),n}}_renderStyleProperty(e,t){return t==="foreground"?e.foreground?W.Format.CSS.formatHexA(e.foreground,!0):"":e[t]!==void 0?String(e[t]):""}getDomNode(){return this._domNode}getPosition(){return{position:this._editor.getPosition(),preference:[ye.BELOW,ye.ABOVE]}}};Q._ID="editor.contrib.inspectEditorTokensWidget";let ue=Q;ht(O.ID,O,mt.Lazy);ft(Wt);yt(async h=>{h.get(bt).when(wt.Ready).then(()=>{vt.get(me)})});function Jt(){return{...St(),[me.toString()]:new Tt(ce,[],!1)}}export{me as ITextMateTokenizationService,Jt as default};
@@ -1 +1 @@
1
- import{ak as o,cc as d,oC as u,bW as p,mt as c,tx as G,tA as t,cR as e,tB as a,cy as h,bu as g,f as v,g as l,W as m}from"./index-BwfWF2CI.js";import{T as D}from"./files.contribution._fileEditorFactory-vS4ZLYi1.js";import{M as S,a as N,f as r}from"./editor-BivTGeL1.js";class y{constructor(){this.onWillDispose=e.None,this.hasMaximizedGroup=()=>!1,this.windowId=g.vscodeWindowId,this.onDidLayout=e.None,this.onDidScroll=e.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=t,this.isLayoutCentered=t,this.enforcePartOptions=t,this.onDidChangeActiveGroup=e.None,this.onDidAddGroup=e.None,this.onDidRemoveGroup=e.None,this.onDidMoveGroup=e.None,this.onDidActivateGroup=e.None,this.onDidChangeGroupIndex=e.None,this.onDidChangeGroupLocked=e.None,this.onDidChangeGroupMaximized=e.None,this.activeGroup=r,this.groups=[r],this.count=0,this.orientation=h.HORIZONTAL,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=t,this.getSize=t,this.setSize=t,this.arrangeGroups=t,this.toggleMaximizeGroup=t,this.toggleExpandGroup=t,this.applyLayout=t,this.getLayout=t,this.setGroupOrientation=t,this.findGroup=()=>{},this.addGroup=t,this.removeGroup=t,this.moveGroup=t,this.mergeGroup=t,this.mergeAllGroups=t,this.copyGroup=t,this.partOptions=a,this.onDidChangeEditorPartOptions=e.None,this.createEditorDropTarget=t}get contentDimension(){return t()}get sideGroup(){return t()}}class f{constructor(){this.getScopedInstantiationService=t,this.registerContextKeyProvider=t,this.saveWorkingSet=t,this.getWorkingSets=t,this.applyWorkingSet=t,this.deleteWorkingSet=t,this.onDidCreateAuxiliaryEditorPart=e.None,this.mainPart=new y,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=t,this.createAuxiliaryEditorPart=t,this.onDidChangeGroupMaximized=e.None,this.toggleMaximizeGroup=t,this.toggleExpandGroup=t,this.partOptions=a,this.createEditorDropTarget=t,this._serviceBrand=void 0,this.getLayout=t,this.onDidChangeActiveGroup=e.None,this.onDidAddGroup=e.None,this.onDidRemoveGroup=e.None,this.onDidMoveGroup=e.None,this.onDidActivateGroup=e.None,this.onDidLayout=e.None,this.onDidScroll=e.None,this.onDidChangeGroupIndex=e.None,this.onDidChangeGroupLocked=e.None,this.activeGroup=r,this.groups=[r],this.count=0,this.orientation=h.HORIZONTAL,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=t,this.getSize=t,this.setSize=t,this.arrangeGroups=t,this.applyLayout=t,this.centerLayout=t,this.isLayoutCentered=()=>!1,this.setGroupOrientation=t,this.findGroup=()=>{},this.addGroup=t,this.removeGroup=t,this.moveGroup=t,this.mergeGroup=t,this.mergeAllGroups=t,this.copyGroup=t,this.onDidChangeEditorPartOptions=e.None,this.enforcePartOptions=t}get contentDimension(){return t()}get sideGroup(){return t()}}let s=class extends N{constructor(n){super(n.createInstance(f),!0,n)}};s=v([l(0,m)],s);function O(i){return{[c.toString()]:new o(G,void 0,!0),[p.toString()]:new o(S,[i,()=>!1],!0),[u.toString()]:new o(D,[],!1),[d.toString()]:new o(s)}}export{S as MonacoEditorService,O as default};
1
+ import{ak as o,cc as d,oC as u,bW as p,mt as c,tx as G,tA as t,cR as e,tB as a,cy as h,bu as g,f as v,g as l,W as m}from"./index-DSexFukl.js";import{T as D}from"./files.contribution._fileEditorFactory-YNF_vxMj.js";import{M as S,a as N,f as r}from"./editor-4HUBGwOu.js";class y{constructor(){this.onWillDispose=e.None,this.hasMaximizedGroup=()=>!1,this.windowId=g.vscodeWindowId,this.onDidLayout=e.None,this.onDidScroll=e.None,this.isReady=!0,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.centerLayout=t,this.isLayoutCentered=t,this.enforcePartOptions=t,this.onDidChangeActiveGroup=e.None,this.onDidAddGroup=e.None,this.onDidRemoveGroup=e.None,this.onDidMoveGroup=e.None,this.onDidActivateGroup=e.None,this.onDidChangeGroupIndex=e.None,this.onDidChangeGroupLocked=e.None,this.onDidChangeGroupMaximized=e.None,this.activeGroup=r,this.groups=[r],this.count=0,this.orientation=h.HORIZONTAL,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=t,this.getSize=t,this.setSize=t,this.arrangeGroups=t,this.toggleMaximizeGroup=t,this.toggleExpandGroup=t,this.applyLayout=t,this.getLayout=t,this.setGroupOrientation=t,this.findGroup=()=>{},this.addGroup=t,this.removeGroup=t,this.moveGroup=t,this.mergeGroup=t,this.mergeAllGroups=t,this.copyGroup=t,this.partOptions=a,this.onDidChangeEditorPartOptions=e.None,this.createEditorDropTarget=t}get contentDimension(){return t()}get sideGroup(){return t()}}class f{constructor(){this.getScopedInstantiationService=t,this.registerContextKeyProvider=t,this.saveWorkingSet=t,this.getWorkingSets=t,this.applyWorkingSet=t,this.deleteWorkingSet=t,this.onDidCreateAuxiliaryEditorPart=e.None,this.mainPart=new y,this.activePart=this.mainPart,this.parts=[this.mainPart],this.getPart=t,this.createAuxiliaryEditorPart=t,this.onDidChangeGroupMaximized=e.None,this.toggleMaximizeGroup=t,this.toggleExpandGroup=t,this.partOptions=a,this.createEditorDropTarget=t,this._serviceBrand=void 0,this.getLayout=t,this.onDidChangeActiveGroup=e.None,this.onDidAddGroup=e.None,this.onDidRemoveGroup=e.None,this.onDidMoveGroup=e.None,this.onDidActivateGroup=e.None,this.onDidLayout=e.None,this.onDidScroll=e.None,this.onDidChangeGroupIndex=e.None,this.onDidChangeGroupLocked=e.None,this.activeGroup=r,this.groups=[r],this.count=0,this.orientation=h.HORIZONTAL,this.isReady=!1,this.whenReady=Promise.resolve(),this.whenRestored=Promise.resolve(),this.hasRestorableState=!1,this.getGroups=()=>[],this.getGroup=()=>{},this.activateGroup=t,this.getSize=t,this.setSize=t,this.arrangeGroups=t,this.applyLayout=t,this.centerLayout=t,this.isLayoutCentered=()=>!1,this.setGroupOrientation=t,this.findGroup=()=>{},this.addGroup=t,this.removeGroup=t,this.moveGroup=t,this.mergeGroup=t,this.mergeAllGroups=t,this.copyGroup=t,this.onDidChangeEditorPartOptions=e.None,this.enforcePartOptions=t}get contentDimension(){return t()}get sideGroup(){return t()}}let s=class extends N{constructor(n){super(n.createInstance(f),!0,n)}};s=v([l(0,m)],s);function O(i){return{[c.toString()]:new o(G,void 0,!0),[p.toString()]:new o(S,[i,()=>!1],!0),[u.toString()]:new o(D,[],!1),[d.toString()]:new o(s)}}export{S as MonacoEditorService,O as default};
@@ -0,0 +1,4 @@
1
+ import{tR as ge}from"./index-DSexFukl.js";function _e(Q,oe){for(var V=0;V<oe.length;V++){const U=oe[V];if(typeof U!="string"&&!Array.isArray(U)){for(const $ in U)if($!=="default"&&!($ in Q)){const O=Object.getOwnPropertyDescriptor(U,$);O&&Object.defineProperty(Q,$,O.get?O:{enumerable:!0,get:()=>U[$]})}}}return Object.freeze(Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}))}var ie={exports:{}},be=ie.exports,he;function ye(){return he||(he=1,(function(Q,oe){var V={};(function(U,$){Q.exports=$()})(be,(()=>(()=>{var U={185:(O,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UseOnigurumaFindOptions=i.DebugFlags=void 0,i.DebugFlags={InDebugMode:typeof process<"u"&&!!V.VSCODE_TEXTMATE_DEBUG},i.UseOnigurumaFindOptions=!1},151:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyStateStackDiff=i.diffStateStacksRefEq=void 0;const f=A(752);i.diffStateStacksRefEq=function(P,m){let b=0;const c=[];let p=P,R=m;for(;p!==R;)p&&(!R||p.depth>=R.depth)?(b++,p=p.parent):(c.push(R.toStateStackFrame()),R=R.parent);return{pops:b,newFrames:c.reverse()}},i.applyStateStackDiff=function(P,m){let b=P;for(let c=0;c<m.pops;c++)b=b.parent;for(const c of m.newFrames)b=f.StateStackImpl.pushFrame(b,c);return b}},490:(O,i)=>{var A;Object.defineProperty(i,"__esModule",{value:!0}),i.toOptionalTokenType=i.EncodedTokenAttributes=void 0,(A=i.EncodedTokenAttributes||(i.EncodedTokenAttributes={})).toBinaryStr=function(f){return f.toString(2).padStart(32,"0")},A.print=function(f){const P=A.getLanguageId(f),m=A.getTokenType(f),b=A.getFontStyle(f),c=A.getForeground(f),p=A.getBackground(f);console.log({languageId:P,tokenType:m,fontStyle:b,foreground:c,background:p})},A.getLanguageId=function(f){return(255&f)>>>0},A.getTokenType=function(f){return(768&f)>>>8},A.containsBalancedBrackets=function(f){return!!(1024&f)},A.getFontStyle=function(f){return(30720&f)>>>11},A.getForeground=function(f){return(16744448&f)>>>15},A.getBackground=function(f){return(4278190080&f)>>>24},A.set=function(f,P,m,b,c,p,R){let u=A.getLanguageId(f),y=A.getTokenType(f),S=A.containsBalancedBrackets(f)?1:0,g=A.getFontStyle(f),C=A.getForeground(f),l=A.getBackground(f);return P!==0&&(u=P),m!==8&&(y=m),b!==null&&(S=b?1:0),c!==-1&&(g=c),p!==0&&(C=p),R!==0&&(l=R),(u|y<<8|S<<10|g<<11|C<<15|l<<24)>>>0},i.toOptionalTokenType=function(f){return f}},214:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BasicScopeAttributesProvider=i.BasicScopeAttributes=void 0;const f=A(807);class P{constructor(p,R){this.languageId=p,this.tokenType=R}}i.BasicScopeAttributes=P;class m{constructor(p,R){this._getBasicScopeAttributes=new f.CachedFn((u=>{const y=this._scopeToLanguage(u),S=this._toStandardTokenType(u);return new P(y,S)})),this._defaultAttributes=new P(p,8),this._embeddedLanguagesMatcher=new b(Object.entries(R||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(p){return p===null?m._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(p)}_scopeToLanguage(p){return this._embeddedLanguagesMatcher.match(p)||0}_toStandardTokenType(p){const R=p.match(m.STANDARD_TOKEN_TYPE_REGEXP);if(!R)return 8;switch(R[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!")}}i.BasicScopeAttributesProvider=m,m._NULL_SCOPE_METADATA=new P(0,0),m.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class b{constructor(p){if(p.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(p);const R=p.map((([u,y])=>f.escapeRegExpCharacters(u)));R.sort(),R.reverse(),this.scopesRegExp=new RegExp(`^((${R.join(")|(")}))($|\\.)`,"")}}match(p){if(!this.scopesRegExp)return;const R=p.match(this.scopesRegExp);return R?this.values.get(R[1]):void 0}}},929:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LineTokens=i.BalancedBracketSelectors=i.StateStackImpl=i.AttributedScopeStack=i.Grammar=i.createGrammar=void 0;const f=A(185),P=A(490),m=A(916),b=A(810),c=A(666),p=A(63),R=A(807),u=A(214),y=A(398);function S(o,t,r,a,d){const _=m.createMatchers(t,g),I=c.RuleFactory.getCompiledRuleId(r,a,d.repository);for(const w of _)o.push({debugSelector:t,matcher:w.matcher,ruleId:I,grammar:d,priority:w.priority})}function g(o,t){if(t.length<o.length)return!1;let r=0;return o.every((a=>{for(let d=r;d<t.length;d++)if(C(t[d],a))return r=d+1,!0;return!1}))}function C(o,t){if(!o)return!1;if(o===t)return!0;const r=t.length;return o.length>r&&o.substr(0,r)===t&&o[r]==="."}i.createGrammar=function(o,t,r,a,d,_,I,w){return new l(o,t,r,a,d,_,I,w)};class l{constructor(t,r,a,d,_,I,w,v){if(this._rootScopeName=t,this.balancedBracketSelectors=I,this._onigLib=v,this._basicScopeAttributesProvider=new u.BasicScopeAttributesProvider(a,d),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=w,this._grammar=h(r,null),this._injections=null,this._tokenTypeMatchers=[],_)for(const T of Object.keys(_)){const E=m.createMatchers(T,g);for(const N of E)this._tokenTypeMatchers.push({matcher:N.matcher,type:_[T]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t=[],r=this._rootScopeName,a=(d=>d===this._rootScopeName?this._grammar:this.getExternalGrammar(d))(r);if(a){const d=a.injections;if(d)for(let I in d)S(t,I,d[I],this,a);const _=this._grammarRepository.injections(r);_&&_.forEach((I=>{const w=this.getExternalGrammar(I);if(w){const v=w.injectionSelector;v&&S(t,v,w,this,w)}}))}return t.sort(((d,_)=>d.priority-_.priority)),t}getInjections(){if(this._injections===null&&(this._injections=this._collectInjections(),f.DebugFlags.InDebugMode&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const t of this._injections)console.log(` - ${t.debugSelector}`)}return this._injections}registerRule(t){const r=++this._lastRuleId,a=t(c.ruleIdFromNumber(r));return this._ruleId2desc[r]=a,a}getRule(t){return this._ruleId2desc[c.ruleIdToNumber(t)]}getExternalGrammar(t,r){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const a=this._grammarRepository.lookup(t);if(a)return this._includedGrammars[t]=h(a,r&&r.$base),this._includedGrammars[t]}}tokenizeLine(t,r,a=0){const d=this._tokenize(t,r,!1,a);return{tokens:d.lineTokens.getResult(d.ruleStack,d.lineLength),ruleStack:d.ruleStack,stoppedEarly:d.stoppedEarly}}tokenizeLine2(t,r,a=0){const d=this._tokenize(t,r,!0,a);return{tokens:d.lineTokens.getBinaryResult(d.ruleStack,d.lineLength),ruleStack:d.ruleStack,stoppedEarly:d.stoppedEarly}}_tokenize(t,r,a,d){let _;if(this._rootId===-1&&(this._rootId=c.RuleFactory.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),r&&r!==e.NULL)_=!1,r.reset();else{_=!0;const E=this._basicScopeAttributesProvider.getDefaultAttributes(),N=this.themeProvider.getDefaults(),D=P.EncodedTokenAttributes.set(0,E.languageId,E.tokenType,null,N.fontStyle,N.foregroundId,N.backgroundId),j=this.getRule(this._rootId).getName(null,null);let F;F=j?s.createRootAndLookUpScopeName(j,D,this):s.createRoot("unknown",D),r=new e(null,this._rootId,-1,-1,!1,null,F,F)}t+=`
2
+ `;const I=this.createOnigString(t),w=I.content.length,v=new n(a,t,this._tokenTypeMatchers,this.balancedBracketSelectors),T=y._tokenizeString(this,I,_,0,r,v,!0,d);return b.disposeOnigString(I),{lineLength:w,lineTokens:v,ruleStack:T.stack,stoppedEarly:T.stoppedEarly}}}function h(o,t){return(o=R.clone(o)).repository=o.repository||{},o.repository.$self={$vscodeTextmateLocation:o.$vscodeTextmateLocation,patterns:o.patterns,name:o.scopeName},o.repository.$base=t||o.repository.$self,o}i.Grammar=l;class s{constructor(t,r,a){this.parent=t,this.scopePath=r,this.tokenAttributes=a}static fromExtension(t,r){let a=t,d=t?.scopePath??null;for(const _ of r)d=p.ScopeStack.push(d,_.scopeNames),a=new s(a,d,_.encodedTokenAttributes);return a}static createRoot(t,r){return new s(null,new p.ScopeStack(null,t),r)}static createRootAndLookUpScopeName(t,r,a){const d=a.getMetadataForScope(t),_=new p.ScopeStack(null,t),I=a.themeProvider.themeMatch(_),w=s.mergeAttributes(r,d,I);return new s(null,_,w)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return s.equals(this,t)}static equals(t,r){for(;;){if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}}static mergeAttributes(t,r,a){let d=-1,_=0,I=0;return a!==null&&(d=a.fontStyle,_=a.foregroundId,I=a.backgroundId),P.EncodedTokenAttributes.set(t,r.languageId,r.tokenType,null,d,_,I)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return s._pushAttributed(this,t,r);const a=t.split(/ /g);let d=this;for(const _ of a)d=s._pushAttributed(d,_,r);return d}static _pushAttributed(t,r,a){const d=a.getMetadataForScope(r),_=t.scopePath.push(r),I=a.themeProvider.themeMatch(_),w=s.mergeAttributes(t.tokenAttributes,d,I);return new s(t,_,w)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const r=[];let a=this;for(;a&&a!==t;)r.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===t?r.reverse():void 0}}i.AttributedScopeStack=s;class e{constructor(t,r,a,d,_,I,w,v){this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=_,this.endRule=I,this.nameScopesList=w,this.contentNameScopesList=v,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=d}equals(t){return t!==null&&e._equals(this,t)}static _equals(t,r){return t===r||!!this._structuralEquals(t,r)&&s.equals(t.contentNameScopesList,r.contentNameScopesList)}static _structuralEquals(t,r){for(;;){if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,a,d,_,I,w){return new e(this,t,r,a,d,_,I,w)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){return{ruleId:c.ruleIdToNumber(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,r){const a=s.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new e(t,c.ruleIdFromNumber(r.ruleId),r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,a,s.fromExtension(a,r.contentNameScopesList))}}i.StateStackImpl=e,e.NULL=new e(null,0,0,0,!1,null,null,null),i.BalancedBracketSelectors=class{constructor(o,t){this.allowAny=!1,this.balancedBracketScopes=o.flatMap((r=>r==="*"?(this.allowAny=!0,[]):m.createMatchers(r,g).map((a=>a.matcher)))),this.unbalancedBracketScopes=t.flatMap((r=>m.createMatchers(r,g).map((a=>a.matcher))))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(o){for(const t of this.unbalancedBracketScopes)if(t(o))return!1;for(const t of this.balancedBracketScopes)if(t(o))return!0;return this.allowAny}};class n{constructor(t,r,a,d){this.balancedBracketSelectors=d,this._emitBinaryTokens=t,this._tokenTypeOverrides=a,f.DebugFlags.InDebugMode?this._lineText=r:this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,r){this.produceFromScopes(t.contentNameScopesList,r)}produceFromScopes(t,r){if(this._lastTokenEndIndex>=r)return;if(this._emitBinaryTokens){let d=t?.tokenAttributes??0,_=!1;if(this.balancedBracketSelectors?.matchesAlways&&(_=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const I=t?.getScopeNames()??[];for(const w of this._tokenTypeOverrides)w.matcher(I)&&(d=P.EncodedTokenAttributes.set(d,0,P.toOptionalTokenType(w.type),null,-1,0,0));this.balancedBracketSelectors&&(_=this.balancedBracketSelectors.match(I))}if(_&&(d=P.EncodedTokenAttributes.set(d,0,8,_,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===d)return void(this._lastTokenEndIndex=r);if(f.DebugFlags.InDebugMode){const I=t?.getScopeNames()??[];console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,r).replace(/\n$/,"\\n")+"|");for(let w=0;w<I.length;w++)console.log(" * "+I[w])}return this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(d),void(this._lastTokenEndIndex=r)}const a=t?.getScopeNames()??[];if(f.DebugFlags.InDebugMode){console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,r).replace(/\n$/,"\\n")+"|");for(let d=0;d<a.length;d++)console.log(" * "+a[d])}this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:r,scopes:a}),this._lastTokenEndIndex=r}getResult(t,r){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===r-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,r),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,r){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===r-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,r),this._binaryTokens[this._binaryTokens.length-2]=0);const a=new Uint32Array(this._binaryTokens.length);for(let d=0,_=this._binaryTokens.length;d<_;d++)a[d]=this._binaryTokens[d];return a}}i.LineTokens=n},784:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.parseInclude=i.TopLevelRepositoryReference=i.TopLevelReference=i.RelativeReference=i.SelfReference=i.BaseReference=i.ScopeDependencyProcessor=i.ExternalReferenceCollector=i.TopLevelRepositoryRuleReference=i.TopLevelRuleReference=void 0;const f=A(807);class P{constructor(e){this.scopeName=e}toKey(){return this.scopeName}}i.TopLevelRuleReference=P;class m{constructor(e,n){this.scopeName=e,this.ruleName=n}toKey(){return`${this.scopeName}#${this.ruleName}`}}i.TopLevelRepositoryRuleReference=m;class b{constructor(){this._references=[],this._seenReferenceKeys=new Set,this.visitedRule=new Set}get references(){return this._references}add(e){const n=e.toKey();this._seenReferenceKeys.has(n)||(this._seenReferenceKeys.add(n),this._references.push(e))}}function c(s,e,n,o){const t=n.lookup(s.scopeName);if(!t){if(s.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const r=n.lookup(e);s instanceof P?R({baseGrammar:r,selfGrammar:t},o):p(s.ruleName,{baseGrammar:r,selfGrammar:t,repository:t.repository},o);const a=n.injections(s.scopeName);if(a)for(const d of a)o.add(new P(d))}function p(s,e,n){e.repository&&e.repository[s]&&u([e.repository[s]],e,n)}function R(s,e){s.selfGrammar.patterns&&Array.isArray(s.selfGrammar.patterns)&&u(s.selfGrammar.patterns,{...s,repository:s.selfGrammar.repository},e),s.selfGrammar.injections&&u(Object.values(s.selfGrammar.injections),{...s,repository:s.selfGrammar.repository},e)}function u(s,e,n){for(const o of s){if(n.visitedRule.has(o))continue;n.visitedRule.add(o);const t=o.repository?f.mergeObjects({},e.repository,o.repository):e.repository;Array.isArray(o.patterns)&&u(o.patterns,{...e,repository:t},n);const r=o.include;if(!r)continue;const a=h(r);switch(a.kind){case 0:R({...e,selfGrammar:e.baseGrammar},n);break;case 1:R(e,n);break;case 2:p(a.ruleName,{...e,repository:t},n);break;case 3:case 4:const d=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(d){const _={baseGrammar:e.baseGrammar,selfGrammar:d,repository:t};a.kind===4?p(a.ruleName,_,n):R(_,n)}else a.kind===4?n.add(new m(a.scopeName,a.ruleName)):n.add(new P(a.scopeName))}}}i.ExternalReferenceCollector=b,i.ScopeDependencyProcessor=class{constructor(s,e){this.repo=s,this.initialScopeName=e,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new P(this.initialScopeName)]}processQueue(){const s=this.Q;this.Q=[];const e=new b;for(const n of s)c(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof P){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};class y{constructor(){this.kind=0}}i.BaseReference=y;class S{constructor(){this.kind=1}}i.SelfReference=S;class g{constructor(e){this.ruleName=e,this.kind=2}}i.RelativeReference=g;class C{constructor(e){this.scopeName=e,this.kind=3}}i.TopLevelReference=C;class l{constructor(e,n){this.scopeName=e,this.ruleName=n,this.kind=4}}function h(s){if(s==="$base")return new y;if(s==="$self")return new S;const e=s.indexOf("#");if(e===-1)return new C(s);if(e===0)return new g(s.substring(1));{const n=s.substring(0,e),o=s.substring(e+1);return new l(n,o)}}i.TopLevelRepositoryReference=l,i.parseInclude=h},752:function(O,i,A){var f=this&&this.__createBinding||(Object.create?function(m,b,c,p){p===void 0&&(p=c),Object.defineProperty(m,p,{enumerable:!0,get:function(){return b[c]}})}:function(m,b,c,p){p===void 0&&(p=c),m[p]=b[c]}),P=this&&this.__exportStar||function(m,b){for(var c in m)c==="default"||Object.prototype.hasOwnProperty.call(b,c)||f(b,m,c)};Object.defineProperty(i,"__esModule",{value:!0}),P(A(929),i)},398:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LocalStackElement=i._tokenizeString=void 0;const f=A(185),P=A(810),m=A(666),b=A(807);class c{constructor(l,h){this.stack=l,this.stoppedEarly=h}}function p(C,l,h,s,e,n,o,t){const r=l.content.length;let a=!1,d=-1;if(o){const w=(function(v,T,E,N,D,j){let F=D.beginRuleCapturedEOL?0:-1;const G=[];for(let x=D;x;x=x.pop()){const M=x.getRule(v);M instanceof m.BeginWhileRule&&G.push({rule:M,stack:x})}for(let x=G.pop();x;x=G.pop()){const{ruleScanner:M,findOptions:z}=u(x.rule,v,x.stack.endRule,E,N===F),k=M.findNextMatchSync(T,N,z);if(f.DebugFlags.InDebugMode&&(console.log(" scanning for while rule"),console.log(M.toString())),!k){f.DebugFlags.InDebugMode&&console.log(" popping "+x.rule.debugName+" - "+x.rule.debugWhileRegExp),D=x.stack.pop();break}if(k.ruleId!==m.whileRuleId){D=x.stack.pop();break}k.captureIndices&&k.captureIndices.length&&(j.produce(x.stack,k.captureIndices[0].start),S(v,T,E,x.stack,j,x.rule.whileCaptures,k.captureIndices),j.produce(x.stack,k.captureIndices[0].end),F=k.captureIndices[0].end,k.captureIndices[0].end>N&&(N=k.captureIndices[0].end,E=!1))}return{stack:D,linePos:N,anchorPosition:F,isFirstLine:E}})(C,l,h,s,e,n);e=w.stack,s=w.linePos,h=w.isFirstLine,d=w.anchorPosition}const _=Date.now();for(;!a;){if(t!==0&&Date.now()-_>t)return new c(e,!0);I()}return new c(e,!1);function I(){f.DebugFlags.InDebugMode&&(console.log(""),console.log(`@@scanNext ${s}: |${l.content.substr(s).replace(/\n$/,"\\n")}|`));const w=(function(N,D,j,F,G,x){const M=(function(q,J,ae,X,H,te){const Y=H.getRule(q),{ruleScanner:Z,findOptions:ee}=R(Y,q,H.endRule,ae,X===te);let K=0;f.DebugFlags.InDebugMode&&(K=b.performanceNow());const W=Z.findNextMatchSync(J,X,ee);if(f.DebugFlags.InDebugMode){const ne=b.performanceNow()-K;ne>5&&console.warn(`Rule ${Y.debugName} (${Y.id}) matching took ${ne} against '${J}'`),console.log(` scanning for (linePos: ${X}, anchorPosition: ${te})`),console.log(Z.toString()),W&&console.log(`matched rule id: ${W.ruleId} from ${W.captureIndices[0].start} to ${W.captureIndices[0].end}`)}return W?{captureIndices:W.captureIndices,matchedRuleId:W.ruleId}:null})(N,D,j,F,G,x),z=N.getInjections();if(z.length===0)return M;const k=(function(q,J,ae,X,H,te,Y){let Z,ee=Number.MAX_VALUE,K=null,W=0;const ne=te.contentNameScopesList.getScopeNames();for(let ce=0,de=q.length;ce<de;ce++){const se=q[ce];if(!se.matcher(ne))continue;const fe=J.getRule(se.ruleId),{ruleScanner:le,findOptions:me}=R(fe,J,null,X,H===Y),re=le.findNextMatchSync(ae,H,me);if(!re)continue;f.DebugFlags.InDebugMode&&(console.log(` matched injection: ${se.debugSelector}`),console.log(le.toString()));const ue=re.captureIndices[0].start;if(!(ue>=ee)&&(ee=ue,K=re.captureIndices,Z=re.ruleId,W=se.priority,ee===H))break}return K?{priorityMatch:W===-1,captureIndices:K,matchedRuleId:Z}:null})(z,N,D,j,F,G,x);if(!k)return M;if(!M)return k;const B=M.captureIndices[0].start,L=k.captureIndices[0].start;return L<B||k.priorityMatch&&L===B?k:M})(C,l,h,s,e,d);if(!w)return f.DebugFlags.InDebugMode&&console.log(" no more matches."),n.produce(e,r),void(a=!0);const v=w.captureIndices,T=w.matchedRuleId,E=!!(v&&v.length>0)&&v[0].end>s;if(T===m.endRuleId){const N=e.getRule(C);f.DebugFlags.InDebugMode&&console.log(" popping "+N.debugName+" - "+N.debugEndRegExp),n.produce(e,v[0].start),e=e.withContentNameScopesList(e.nameScopesList),S(C,l,h,e,n,N.endCaptures,v),n.produce(e,v[0].end);const D=e;if(e=e.parent,d=D.getAnchorPos(),!E&&D.getEnterPos()===s)return f.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),e=D,n.produce(e,r),void(a=!0)}else{const N=C.getRule(T);n.produce(e,v[0].start);const D=e,j=N.getName(l.content,v),F=e.contentNameScopesList.pushAttributed(j,C);if(e=e.push(T,s,d,v[0].end===r,null,F,F),N instanceof m.BeginEndRule){const G=N;f.DebugFlags.InDebugMode&&console.log(" pushing "+G.debugName+" - "+G.debugBeginRegExp),S(C,l,h,e,n,G.beginCaptures,v),n.produce(e,v[0].end),d=v[0].end;const x=G.getContentName(l.content,v),M=F.pushAttributed(x,C);if(e=e.withContentNameScopesList(M),G.endHasBackReferences&&(e=e.withEndRule(G.getEndWithResolvedBackReferences(l.content,v))),!E&&D.hasSameRuleAs(e))return f.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),e=e.pop(),n.produce(e,r),void(a=!0)}else if(N instanceof m.BeginWhileRule){const G=N;f.DebugFlags.InDebugMode&&console.log(" pushing "+G.debugName),S(C,l,h,e,n,G.beginCaptures,v),n.produce(e,v[0].end),d=v[0].end;const x=G.getContentName(l.content,v),M=F.pushAttributed(x,C);if(e=e.withContentNameScopesList(M),G.whileHasBackReferences&&(e=e.withEndRule(G.getWhileWithResolvedBackReferences(l.content,v))),!E&&D.hasSameRuleAs(e))return f.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),e=e.pop(),n.produce(e,r),void(a=!0)}else{const G=N;if(f.DebugFlags.InDebugMode&&console.log(" matched "+G.debugName+" - "+G.debugMatchRegExp),S(C,l,h,e,n,G.captures,v),n.produce(e,v[0].end),e=e.pop(),!E)return f.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),e=e.safePop(),n.produce(e,r),void(a=!0)}}v[0].end>s&&(s=v[0].end,h=!1)}}function R(C,l,h,s,e){return f.UseOnigurumaFindOptions?{ruleScanner:C.compile(l,h),findOptions:y(s,e)}:{ruleScanner:C.compileAG(l,h,s,e),findOptions:0}}function u(C,l,h,s,e){return f.UseOnigurumaFindOptions?{ruleScanner:C.compileWhile(l,h),findOptions:y(s,e)}:{ruleScanner:C.compileWhileAG(l,h,s,e),findOptions:0}}function y(C,l){let h=0;return C||(h|=1),l||(h|=4),h}function S(C,l,h,s,e,n,o){if(n.length===0)return;const t=l.content,r=Math.min(n.length,o.length),a=[],d=o[0].end;for(let _=0;_<r;_++){const I=n[_];if(I===null)continue;const w=o[_];if(w.length===0)continue;if(w.start>d)break;for(;a.length>0&&a[a.length-1].endPos<=w.start;)e.produceFromScopes(a[a.length-1].scopes,a[a.length-1].endPos),a.pop();if(a.length>0?e.produceFromScopes(a[a.length-1].scopes,w.start):e.produce(s,w.start),I.retokenizeCapturedWithRuleId){const T=I.getName(t,o),E=s.contentNameScopesList.pushAttributed(T,C),N=I.getContentName(t,o),D=E.pushAttributed(N,C),j=s.push(I.retokenizeCapturedWithRuleId,w.start,-1,!1,null,E,D),F=C.createOnigString(t.substring(0,w.end));p(C,F,h&&w.start===0,w.start,j,e,!1,0),P.disposeOnigString(F);continue}const v=I.getName(t,o);if(v!==null){const T=(a.length>0?a[a.length-1].scopes:s.contentNameScopesList).pushAttributed(v,C);a.push(new g(T,w.end))}}for(;a.length>0;)e.produceFromScopes(a[a.length-1].scopes,a[a.length-1].endPos),a.pop()}i._tokenizeString=p;class g{constructor(l,h){this.scopes=l,this.endPos=h}}i.LocalStackElement=g},726:(O,i)=>{function A(b,c){throw new Error("Near offset "+b.pos+": "+c+" ~~~"+b.source.substr(b.pos,50)+"~~~")}Object.defineProperty(i,"__esModule",{value:!0}),i.parseJSON=void 0,i.parseJSON=function(b,c,p){let R=new f(b),u=new P,y=0,S=null,g=[],C=[];function l(){g.push(y),C.push(S)}function h(){y=g.pop(),S=C.pop()}function s(e){A(R,e)}for(;m(R,u);){if(y===0){if(S!==null&&s("too many constructs in root"),u.type===3){S={},p&&(S.$vscodeTextmateLocation=u.toLocation(c)),l(),y=1;continue}if(u.type===2){S=[],l(),y=4;continue}s("unexpected token in root")}if(y===2){if(u.type===5){h();continue}if(u.type===7){y=3;continue}s("expected , or }")}if(y===1||y===3){if(y===1&&u.type===5){h();continue}if(u.type===1){let e=u.value;if(m(R,u)&&u.type===6||s("expected colon"),m(R,u)||s("expected value"),y=2,u.type===1){S[e]=u.value;continue}if(u.type===8){S[e]=null;continue}if(u.type===9){S[e]=!0;continue}if(u.type===10){S[e]=!1;continue}if(u.type===11){S[e]=parseFloat(u.value);continue}if(u.type===2){let n=[];S[e]=n,l(),y=4,S=n;continue}if(u.type===3){let n={};p&&(n.$vscodeTextmateLocation=u.toLocation(c)),S[e]=n,l(),y=1,S=n;continue}}s("unexpected token in dict")}if(y===5){if(u.type===4){h();continue}if(u.type===7){y=6;continue}s("expected , or ]")}if(y===4||y===6){if(y===4&&u.type===4){h();continue}if(y=5,u.type===1){S.push(u.value);continue}if(u.type===8){S.push(null);continue}if(u.type===9){S.push(!0);continue}if(u.type===10){S.push(!1);continue}if(u.type===11){S.push(parseFloat(u.value));continue}if(u.type===2){let e=[];S.push(e),l(),y=4,S=e;continue}if(u.type===3){let e={};p&&(e.$vscodeTextmateLocation=u.toLocation(c)),S.push(e),l(),y=1,S=e;continue}s("unexpected token in array")}s("unknown state")}return C.length!==0&&s("unclosed constructs"),S};class f{constructor(c){this.source=c,this.pos=0,this.len=c.length,this.line=1,this.char=0}}class P{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(c){return{filename:c,line:this.line,char:this.char}}}function m(b,c){c.value=null,c.type=0,c.offset=-1,c.len=-1,c.line=-1,c.char=-1;let p,R=b.source,u=b.pos,y=b.len,S=b.line,g=b.char;for(;;){if(u>=y)return!1;if(p=R.charCodeAt(u),p!==32&&p!==9&&p!==13){if(p!==10)break;u++,S++,g=0}else u++,g++}if(c.offset=u,c.line=S,c.char=g,p===34){for(c.type=1,u++,g++;;){if(u>=y)return!1;if(p=R.charCodeAt(u),u++,g++,p!==92){if(p===34)break}else u++,g++}c.value=R.substring(c.offset+1,u-1).replace(/\\u([0-9A-Fa-f]{4})/g,((C,l)=>String.fromCodePoint(parseInt(l,16)))).replace(/\\(.)/g,((C,l)=>{switch(l){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return`
3
+ `;case"r":return"\r";case"t":return" ";default:A(b,"invalid escape sequence")}throw new Error("unreachable")}))}else if(p===91)c.type=2,u++,g++;else if(p===123)c.type=3,u++,g++;else if(p===93)c.type=4,u++,g++;else if(p===125)c.type=5,u++,g++;else if(p===58)c.type=6,u++,g++;else if(p===44)c.type=7,u++,g++;else if(p===110){if(c.type=8,u++,g++,p=R.charCodeAt(u),p!==117||(u++,g++,p=R.charCodeAt(u),p!==108)||(u++,g++,p=R.charCodeAt(u),p!==108))return!1;u++,g++}else if(p===116){if(c.type=9,u++,g++,p=R.charCodeAt(u),p!==114||(u++,g++,p=R.charCodeAt(u),p!==117)||(u++,g++,p=R.charCodeAt(u),p!==101))return!1;u++,g++}else if(p===102){if(c.type=10,u++,g++,p=R.charCodeAt(u),p!==97||(u++,g++,p=R.charCodeAt(u),p!==108)||(u++,g++,p=R.charCodeAt(u),p!==115)||(u++,g++,p=R.charCodeAt(u),p!==101))return!1;u++,g++}else for(c.type=11;;){if(u>=y)return!1;if(p=R.charCodeAt(u),!(p===46||p>=48&&p<=57||p===101||p===69||p===45||p===43))break;u++,g++}return c.len=u-c.offset,c.value===null&&(c.value=R.substr(c.offset,c.len)),b.pos=u,b.line=S,b.char=g,!0}},625:function(O,i,A){var f=this&&this.__createBinding||(Object.create?function(y,S,g,C){C===void 0&&(C=g),Object.defineProperty(y,C,{enumerable:!0,get:function(){return S[g]}})}:function(y,S,g,C){C===void 0&&(C=g),y[C]=S[g]}),P=this&&this.__exportStar||function(y,S){for(var g in y)g==="default"||Object.prototype.hasOwnProperty.call(S,g)||f(S,y,g)};Object.defineProperty(i,"__esModule",{value:!0}),i.applyStateStackDiff=i.diffStateStacksRefEq=i.parseRawGrammar=i.INITIAL=i.Registry=void 0;const m=A(752),b=A(150),c=A(583),p=A(63),R=A(784),u=A(151);Object.defineProperty(i,"applyStateStackDiff",{enumerable:!0,get:function(){return u.applyStateStackDiff}}),Object.defineProperty(i,"diffStateStacksRefEq",{enumerable:!0,get:function(){return u.diffStateStacksRefEq}}),P(A(810),i),i.Registry=class{constructor(y){this._options=y,this._syncRegistry=new c.SyncRegistry(p.Theme.createFromRawTheme(y.theme,y.colorMap),y.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(y,S){this._syncRegistry.setTheme(p.Theme.createFromRawTheme(y,S))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(y,S,g){return this.loadGrammarWithConfiguration(y,S,{embeddedLanguages:g})}loadGrammarWithConfiguration(y,S,g){return this._loadGrammar(y,S,g.embeddedLanguages,g.tokenTypes,new m.BalancedBracketSelectors(g.balancedBracketSelectors||[],g.unbalancedBracketSelectors||[]))}loadGrammar(y){return this._loadGrammar(y,0,null,null,null)}async _loadGrammar(y,S,g,C,l){const h=new R.ScopeDependencyProcessor(this._syncRegistry,y);for(;h.Q.length>0;)await Promise.all(h.Q.map((s=>this._loadSingleGrammar(s.scopeName)))),h.processQueue();return this._grammarForScopeName(y,S,g,C,l)}async _loadSingleGrammar(y){return this._ensureGrammarCache.has(y)||this._ensureGrammarCache.set(y,this._doLoadSingleGrammar(y)),this._ensureGrammarCache.get(y)}async _doLoadSingleGrammar(y){const S=await this._options.loadGrammar(y);if(S){const g=typeof this._options.getInjections=="function"?this._options.getInjections(y):void 0;this._syncRegistry.addGrammar(S,g)}}async addGrammar(y,S=[],g=0,C=null){return this._syncRegistry.addGrammar(y,S),await this._grammarForScopeName(y.scopeName,g,C)}_grammarForScopeName(y,S=0,g=null,C=null,l=null){return this._syncRegistry.grammarForScopeName(y,S,g,C,l)}},i.INITIAL=m.StateStackImpl.NULL,i.parseRawGrammar=b.parseRawGrammar},916:(O,i)=>{function A(f){return!!f&&!!f.match(/[\w\.:]+/)}Object.defineProperty(i,"__esModule",{value:!0}),i.createMatchers=void 0,i.createMatchers=function(f,P){const m=[],b=(function(u){let y=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,S=y.exec(u);return{next:()=>{if(!S)return null;const g=S[0];return S=y.exec(u),g}}})(f);let c=b.next();for(;c!==null;){let u=0;if(c.length===2&&c.charAt(1)===":"){switch(c.charAt(0)){case"R":u=1;break;case"L":u=-1;break;default:console.log(`Unknown priority ${c} in scope selector`)}c=b.next()}let y=R();if(m.push({matcher:y,priority:u}),c!==",")break;c=b.next()}return m;function p(){if(c==="-"){c=b.next();const u=p();return y=>!!u&&!u(y)}if(c==="("){c=b.next();const u=(function(){const y=[];let S=R();for(;S&&(y.push(S),c==="|"||c===",");){do c=b.next();while(c==="|"||c===",");S=R()}return g=>y.some((C=>C(g)))})();return c===")"&&(c=b.next()),u}if(A(c)){const u=[];do u.push(c),c=b.next();while(A(c));return y=>P(u,y)}return null}function R(){const u=[];let y=p();for(;y;)u.push(y),y=p();return S=>u.every((g=>g(S)))}}},810:(O,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.disposeOnigString=void 0,i.disposeOnigString=function(A){typeof A.dispose=="function"&&A.dispose()}},150:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.parseRawGrammar=void 0;const f=A(578),P=A(185),m=A(726);i.parseRawGrammar=function(b,c=null){return c!==null&&/\.json$/.test(c)?(p=b,R=c,P.DebugFlags.InDebugMode?m.parseJSON(p,R,!0):JSON.parse(p)):(function(u,y){return P.DebugFlags.InDebugMode?f.parseWithLocation(u,y,"$vscodeTextmateLocation"):f.parsePLIST(u)})(b,c);var p,R}},578:(O,i)=>{function A(f,P,m){const b=f.length;let c=0,p=1,R=0;function u(k){if(m===null)c+=k;else for(;k>0;)f.charCodeAt(c)===10?(c++,p++,R=0):(c++,R++),k--}function y(k){m===null?c=k:u(k-c)}function S(){for(;c<b;){let k=f.charCodeAt(c);if(k!==32&&k!==9&&k!==13&&k!==10)break;u(1)}}function g(k){return f.substr(c,k.length)===k&&(u(k.length),!0)}function C(k){let B=f.indexOf(k,c);y(B!==-1?B+k.length:b)}function l(k){let B=f.indexOf(k,c);if(B!==-1){let L=f.substring(c,B);return y(B+k.length),L}{let L=f.substr(c);return y(b),L}}b>0&&f.charCodeAt(0)===65279&&(c=1);let h=0,s=null,e=[],n=[],o=null;function t(k,B){e.push(h),n.push(s),h=k,s=B}function r(){if(e.length===0)return a("illegal state stack");h=e.pop(),s=n.pop()}function a(k){throw new Error("Near offset "+c+": "+k+" ~~~"+f.substr(c,50)+"~~~")}const d=function(){if(o===null)return a("missing <key>");let k={};m!==null&&(k[m]={filename:P,line:p,char:R}),s[o]=k,o=null,t(1,k)},_=function(){if(o===null)return a("missing <key>");let k=[];s[o]=k,o=null,t(2,k)},I=function(){let k={};m!==null&&(k[m]={filename:P,line:p,char:R}),s.push(k),t(1,k)},w=function(){let k=[];s.push(k),t(2,k)};function v(){if(h!==1)return a("unexpected </dict>");r()}function T(){return h===1||h!==2?a("unexpected </array>"):void r()}function E(k){if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function N(k){if(isNaN(k))return a("cannot parse float");if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function D(k){if(isNaN(k))return a("cannot parse integer");if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function j(k){if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function F(k){if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function G(k){if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function x(){let k=l(">"),B=!1;return k.charCodeAt(k.length-1)===47&&(B=!0,k=k.substring(0,k.length-1)),{name:k.trim(),isClosed:B}}function M(k){if(k.isClosed)return"";let B=l("</");return C(">"),B.replace(/&#([0-9]+);/g,(function(L,q){return String.fromCodePoint(parseInt(q,10))})).replace(/&#x([0-9a-f]+);/g,(function(L,q){return String.fromCodePoint(parseInt(q,16))})).replace(/&amp;|&lt;|&gt;|&quot;|&apos;/g,(function(L){switch(L){case"&amp;":return"&";case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&apos;":return"'"}return L}))}for(;c<b&&(S(),!(c>=b));){const k=f.charCodeAt(c);if(u(1),k!==60)return a("expected <");if(c>=b)return a("unexpected end of input");const B=f.charCodeAt(c);if(B===63){u(1),C("?>");continue}if(B===33){if(u(1),g("--")){C("-->");continue}C(">");continue}if(B===47){if(u(1),S(),g("plist")){C(">");continue}if(g("dict")){C(">"),v();continue}if(g("array")){C(">"),T();continue}return a("unexpected closed tag")}let L=x();switch(L.name){case"dict":h===1?d():h===2?I():(s={},m!==null&&(s[m]={filename:P,line:p,char:R}),t(1,s)),L.isClosed&&v();continue;case"array":h===1?_():h===2?w():(s=[],t(2,s)),L.isClosed&&T();continue;case"key":z=M(L),h!==1?a("unexpected <key>"):o!==null?a("too many <key>"):o=z;continue;case"string":E(M(L));continue;case"real":N(parseFloat(M(L)));continue;case"integer":D(parseInt(M(L),10));continue;case"date":j(new Date(M(L)));continue;case"data":F(M(L));continue;case"true":M(L),G(!0);continue;case"false":M(L),G(!1);continue}if(!/^plist/.test(L.name))return a("unexpected opened tag "+L.name)}var z;return s}Object.defineProperty(i,"__esModule",{value:!0}),i.parsePLIST=i.parseWithLocation=void 0,i.parseWithLocation=function(f,P,m){return A(f,P,m)},i.parsePLIST=function(f){return A(f,null,null)}},583:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SyncRegistry=void 0;const f=A(752);i.SyncRegistry=class{constructor(P,m){this._onigLibPromise=m,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=P}dispose(){for(const P of this._grammars.values())P.dispose()}setTheme(P){this._theme=P}getColorMap(){return this._theme.getColorMap()}addGrammar(P,m){this._rawGrammars.set(P.scopeName,P),m&&this._injectionGrammars.set(P.scopeName,m)}lookup(P){return this._rawGrammars.get(P)}injections(P){return this._injectionGrammars.get(P)}getDefaults(){return this._theme.getDefaults()}themeMatch(P){return this._theme.match(P)}async grammarForScopeName(P,m,b,c,p){if(!this._grammars.has(P)){let R=this._rawGrammars.get(P);if(!R)return null;this._grammars.set(P,f.createGrammar(P,R,m,b,c,p,this,await this._onigLibPromise))}return this._grammars.get(P)}}},666:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CompiledRule=i.RegExpSourceList=i.RegExpSource=i.RuleFactory=i.BeginWhileRule=i.BeginEndRule=i.IncludeOnlyRule=i.MatchRule=i.CaptureRule=i.Rule=i.ruleIdToNumber=i.ruleIdFromNumber=i.whileRuleId=i.endRuleId=void 0;const f=A(807),P=A(784),m=/\\(\d+)/,b=/\\(\d+)/g;i.endRuleId=-1,i.whileRuleId=-2,i.ruleIdFromNumber=function(s){return s},i.ruleIdToNumber=function(s){return s};class c{constructor(e,n,o,t){this.$location=e,this.id=n,this._name=o||null,this._nameIsCapturing=f.RegexSource.hasCaptures(this._name),this._contentName=t||null,this._contentNameIsCapturing=f.RegexSource.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${f.basename(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,n){return this._nameIsCapturing&&this._name!==null&&e!==null&&n!==null?f.RegexSource.replaceCaptures(this._name,e,n):this._name}getContentName(e,n){return this._contentNameIsCapturing&&this._contentName!==null?f.RegexSource.replaceCaptures(this._contentName,e,n):this._contentName}}i.Rule=c;class p extends c{constructor(e,n,o,t,r){super(e,n,o,t),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,o,t){throw new Error("Not supported!")}}i.CaptureRule=p;class R extends c{constructor(e,n,o,t,r){super(e,n,o,null),this._match=new C(t,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,o,t){return this._getCachedCompiledPatterns(e).compileAG(e,o,t)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new l,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}i.MatchRule=R;class u extends c{constructor(e,n,o,t,r){super(e,n,o,t),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const o of this.patterns)e.getRule(o).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,o,t){return this._getCachedCompiledPatterns(e).compileAG(e,o,t)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new l,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}i.IncludeOnlyRule=u;class y extends c{constructor(e,n,o,t,r,a,d,_,I,w){super(e,n,o,t),this._begin=new C(r,this.id),this.beginCaptures=a,this._end=new C(d||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=_,this.applyEndPatternLast=I||!1,this.patterns=w.patterns,this.hasMissingPatterns=w.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,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,o,t){return this._getCachedCompiledPatterns(e,n).compileAG(e,o,t)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new l;for(const o of this.patterns)e.getRule(o).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,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}}i.BeginEndRule=y;class S extends c{constructor(e,n,o,t,r,a,d,_,I){super(e,n,o,t),this._begin=new C(r,this.id),this.beginCaptures=a,this.whileCaptures=_,this._while=new C(d,i.whileRuleId),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=I.patterns,this.hasMissingPatterns=I.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,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,o,t){return this._getCachedCompiledPatterns(e).compileAG(e,o,t)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new l;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,o,t){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,o,t)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new l,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}}i.BeginWhileRule=S;class g{static createCaptureRule(e,n,o,t,r){return e.registerRule((a=>new p(n,a,o,t,r)))}static getCompiledRuleId(e,n,o){return e.id||n.registerRule((t=>{if(e.id=t,e.match)return new R(e.$vscodeTextmateLocation,e.id,e.name,e.match,g._compileCaptures(e.captures,n,o));if(e.begin===void 0){e.repository&&(o=f.mergeObjects({},o,e.repository));let r=e.patterns;return r===void 0&&e.include&&(r=[{include:e.include}]),new u(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,g._compilePatterns(r,n,o))}return e.while?new S(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,g._compileCaptures(e.beginCaptures||e.captures,n,o),e.while,g._compileCaptures(e.whileCaptures||e.captures,n,o),g._compilePatterns(e.patterns,n,o)):new y(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,g._compileCaptures(e.beginCaptures||e.captures,n,o),e.end,g._compileCaptures(e.endCaptures||e.captures,n,o),e.applyEndPatternLast,g._compilePatterns(e.patterns,n,o))})),e.id}static _compileCaptures(e,n,o){let t=[];if(e){let r=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const d=parseInt(a,10);d>r&&(r=d)}for(let a=0;a<=r;a++)t[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const d=parseInt(a,10);let _=0;e[a].patterns&&(_=g.getCompiledRuleId(e[a],n,o)),t[d]=g.createCaptureRule(n,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,_)}}return t}static _compilePatterns(e,n,o){let t=[];if(e)for(let r=0,a=e.length;r<a;r++){const d=e[r];let _=-1;if(d.include){const I=P.parseInclude(d.include);switch(I.kind){case 0:case 1:_=g.getCompiledRuleId(o[d.include],n,o);break;case 2:let w=o[I.ruleName];w&&(_=g.getCompiledRuleId(w,n,o));break;case 3:case 4:const v=I.scopeName,T=I.kind===4?I.ruleName:null,E=n.getExternalGrammar(v,o);if(E)if(T){let N=E.repository[T];N&&(_=g.getCompiledRuleId(N,n,E.repository))}else _=g.getCompiledRuleId(E.repository.$self,n,E.repository)}}else _=g.getCompiledRuleId(d,n,o);if(_!==-1){const I=n.getRule(_);let w=!1;if((I instanceof u||I instanceof y||I instanceof S)&&I.hasMissingPatterns&&I.patterns.length===0&&(w=!0),w)continue;t.push(_)}}return{patterns:t,hasMissingPatterns:(e?e.length:0)!==t.length}}}i.RuleFactory=g;class C{constructor(e,n){if(e){const o=e.length;let t=0,r=[],a=!1;for(let d=0;d<o;d++)if(e.charAt(d)==="\\"&&d+1<o){const _=e.charAt(d+1);_==="z"?(r.push(e.substring(t,d)),r.push("$(?!\\n)(?<!\\n)"),t=d+2):_!=="A"&&_!=="G"||(a=!0),d++}this.hasAnchor=a,t===0?this.source=e:(r.push(e.substring(t,o)),this.source=r.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,this.hasBackReferences=m.test(this.source)}clone(){return new C(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){let o=n.map((t=>e.substring(t.start,t.end)));return b.lastIndex=0,this.source.replace(b,((t,r)=>f.escapeRegExpCharacters(o[parseInt(r,10)]||"")))}_buildAnchorCache(){let e,n,o,t,r=[],a=[],d=[],_=[];for(e=0,n=this.source.length;e<n;e++)o=this.source.charAt(e),r[e]=o,a[e]=o,d[e]=o,_[e]=o,o==="\\"&&e+1<n&&(t=this.source.charAt(e+1),t==="A"?(r[e+1]="￿",a[e+1]="￿",d[e+1]="A",_[e+1]="A"):t==="G"?(r[e+1]="￿",a[e+1]="G",d[e+1]="￿",_[e+1]="G"):(r[e+1]=t,a[e+1]=t,d[e+1]=t,_[e+1]=t),e++);return{A0_G0:r.join(""),A0_G1:a.join(""),A1_G0:d.join(""),A1_G1:_.join("")}}resolveAnchors(e,n){return this.hasAnchor&&this._anchorCache?e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}}i.RegExpSource=C;class l{constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,n){this._items[e].source!==n&&(this._disposeCaches(),this._items[e].setSource(n))}compile(e){if(!this._cached){let n=this._items.map((o=>o.source));this._cached=new h(e,n,this._items.map((o=>o.ruleId)))}return this._cached}compileAG(e,n,o){return this._hasAnchors?n?o?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,n,o)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,n,o)),this._anchorCache.A1_G0):o?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,n,o)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,n,o)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,n,o){let t=this._items.map((r=>r.resolveAnchors(n,o)));return new h(e,t,this._items.map((r=>r.ruleId)))}}i.RegExpSourceList=l;class h{constructor(e,n,o){this.regExps=n,this.rules=o,this.scanner=e.createOnigScanner(n)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let n=0,o=this.rules.length;n<o;n++)e.push(" - "+this.rules[n]+": "+this.regExps[n]);return e.join(`
4
+ `)}findNextMatchSync(e,n,o){const t=this.scanner.findNextMatchSync(e,n,o);return t?{ruleId:this.rules[t.index],captureIndices:t.captureIndices}:null}}i.CompiledRule=h},63:(O,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeTrieElement=i.ThemeTrieElementRule=i.ColorMap=i.fontStyleToString=i.ParsedThemeRule=i.parseTheme=i.StyleAttributes=i.ScopeStack=i.Theme=void 0;const f=A(807);class P{constructor(l,h,s){this._colorMap=l,this._defaults=h,this._root=s,this._cachedMatchRoot=new f.CachedFn((e=>this._root.match(e)))}static createFromRawTheme(l,h){return this.createFromParsedTheme(p(l),h)}static createFromParsedTheme(l,h){return(function(s,e){s.sort(((_,I)=>{let w=f.strcmp(_.scope,I.scope);return w!==0?w:(w=f.strArrCmp(_.parentScopes,I.parentScopes),w!==0?w:_.index-I.index)}));let n=0,o="#000000",t="#ffffff";for(;s.length>=1&&s[0].scope==="";){let _=s.shift();_.fontStyle!==-1&&(n=_.fontStyle),_.foreground!==null&&(o=_.foreground),_.background!==null&&(t=_.background)}let r=new u(e),a=new c(n,r.getId(o),r.getId(t)),d=new g(new S(0,null,-1,0,0),[]);for(let _=0,I=s.length;_<I;_++){let w=s[_];d.insert(0,w.scope,w.parentScopes,w.fontStyle,r.getId(w.foreground),r.getId(w.background))}return new P(r,a,d)})(l,h)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(l){if(l===null)return this._defaults;const h=l.scopeName,s=this._cachedMatchRoot.get(h).find((e=>(function(n,o){if(o.length===0)return!0;for(let t=0;t<o.length;t++){let r=o[t],a=!1;if(r===">"){if(t===o.length-1)return!1;r=o[++t],a=!0}for(;n&&!b(n.scopeName,r);){if(a)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0})(l.parent,e.parentScopes)));return s?new c(s.fontStyle,s.foreground,s.background):null}}i.Theme=P;class m{constructor(l,h){this.parent=l,this.scopeName=h}static push(l,h){for(const s of h)l=new m(l,s);return l}static from(...l){let h=null;for(let s=0;s<l.length;s++)h=new m(h,l[s]);return h}push(l){return new m(this,l)}getSegments(){let l=this;const h=[];for(;l;)h.push(l.scopeName),l=l.parent;return h.reverse(),h}toString(){return this.getSegments().join(" ")}extends(l){return this===l||this.parent!==null&&this.parent.extends(l)}getExtensionIfDefined(l){const h=[];let s=this;for(;s&&s!==l;)h.push(s.scopeName),s=s.parent;return s===l?h.reverse():void 0}}function b(C,l){return l===C||C.startsWith(l)&&C[l.length]==="."}i.ScopeStack=m;class c{constructor(l,h,s){this.fontStyle=l,this.foregroundId=h,this.backgroundId=s}}function p(C){if(!C)return[];if(!C.settings||!Array.isArray(C.settings))return[];let l=C.settings,h=[],s=0;for(let e=0,n=l.length;e<n;e++){let o,t=l[e];if(!t.settings)continue;if(typeof t.scope=="string"){let _=t.scope;_=_.replace(/^[,]+/,""),_=_.replace(/[,]+$/,""),o=_.split(",")}else o=Array.isArray(t.scope)?t.scope:[""];let r=-1;if(typeof t.settings.fontStyle=="string"){r=0;let _=t.settings.fontStyle.split(" ");for(let I=0,w=_.length;I<w;I++)switch(_[I]){case"italic":r|=1;break;case"bold":r|=2;break;case"underline":r|=4;break;case"strikethrough":r|=8}}let a=null;typeof t.settings.foreground=="string"&&f.isValidHexColor(t.settings.foreground)&&(a=t.settings.foreground);let d=null;typeof t.settings.background=="string"&&f.isValidHexColor(t.settings.background)&&(d=t.settings.background);for(let _=0,I=o.length;_<I;_++){let w=o[_].trim().split(" "),v=w[w.length-1],T=null;w.length>1&&(T=w.slice(0,w.length-1),T.reverse()),h[s++]=new R(v,T,e,r,a,d)}}return h}i.StyleAttributes=c,i.parseTheme=p;class R{constructor(l,h,s,e,n,o){this.scope=l,this.parentScopes=h,this.index=s,this.fontStyle=e,this.foreground=n,this.background=o}}i.ParsedThemeRule=R,i.fontStyleToString=function(C){if(C===-1)return"not set";let l="";return 1&C&&(l+="italic "),2&C&&(l+="bold "),4&C&&(l+="underline "),8&C&&(l+="strikethrough "),l===""&&(l="none"),l.trim()};class u{constructor(l){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(l)){this._isFrozen=!0;for(let h=0,s=l.length;h<s;h++)this._color2id[l[h]]=h,this._id2color[h]=l[h]}else this._isFrozen=!1}getId(l){if(l===null)return 0;l=l.toUpperCase();let h=this._color2id[l];if(h)return h;if(this._isFrozen)throw new Error(`Missing color in color map - ${l}`);return h=++this._lastColorId,this._color2id[l]=h,this._id2color[h]=l,h}getColorMap(){return this._id2color.slice(0)}}i.ColorMap=u;const y=Object.freeze([]);class S{constructor(l,h,s,e,n){this.scopeDepth=l,this.parentScopes=h||y,this.fontStyle=s,this.foreground=e,this.background=n}clone(){return new S(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(l){let h=[];for(let s=0,e=l.length;s<e;s++)h[s]=l[s].clone();return h}acceptOverwrite(l,h,s,e){this.scopeDepth>l?console.log("how did this happen?"):this.scopeDepth=l,h!==-1&&(this.fontStyle=h),s!==0&&(this.foreground=s),e!==0&&(this.background=e)}}i.ThemeTrieElementRule=S;class g{constructor(l,h=[],s={}){this._mainRule=l,this._children=s,this._rulesWithParentScopes=h}static _cmpBySpecificity(l,h){if(l.scopeDepth!==h.scopeDepth)return h.scopeDepth-l.scopeDepth;let s=0,e=0;for(;l.parentScopes[s]===">"&&s++,h.parentScopes[e]===">"&&e++,!(s>=l.parentScopes.length||e>=h.parentScopes.length);){const n=h.parentScopes[e].length-l.parentScopes[s].length;if(n!==0)return n;s++,e++}return h.parentScopes.length-l.parentScopes.length}match(l){if(l!==""){let s,e,n=l.indexOf(".");if(n===-1?(s=l,e=""):(s=l.substring(0,n),e=l.substring(n+1)),this._children.hasOwnProperty(s))return this._children[s].match(e)}const h=this._rulesWithParentScopes.concat(this._mainRule);return h.sort(g._cmpBySpecificity),h}insert(l,h,s,e,n,o){if(h==="")return void this._doInsertHere(l,s,e,n,o);let t,r,a,d=h.indexOf(".");d===-1?(t=h,r=""):(t=h.substring(0,d),r=h.substring(d+1)),this._children.hasOwnProperty(t)?a=this._children[t]:(a=new g(this._mainRule.clone(),S.cloneArr(this._rulesWithParentScopes)),this._children[t]=a),a.insert(l+1,r,s,e,n,o)}_doInsertHere(l,h,s,e,n){if(h!==null){for(let o=0,t=this._rulesWithParentScopes.length;o<t;o++){let r=this._rulesWithParentScopes[o];if(f.strArrCmp(r.parentScopes,h)===0)return void r.acceptOverwrite(l,s,e,n)}s===-1&&(s=this._mainRule.fontStyle),e===0&&(e=this._mainRule.foreground),n===0&&(n=this._mainRule.background),this._rulesWithParentScopes.push(new S(l,h,s,e,n))}else this._mainRule.acceptOverwrite(l,s,e,n)}}i.ThemeTrieElement=g},807:(O,i)=>{function A(m){return Array.isArray(m)?(function(b){let c=[];for(let p=0,R=b.length;p<R;p++)c[p]=A(b[p]);return c})(m):typeof m=="object"?(function(b){let c={};for(let p in b)c[p]=A(b[p]);return c})(m):m}Object.defineProperty(i,"__esModule",{value:!0}),i.performanceNow=i.CachedFn=i.escapeRegExpCharacters=i.isValidHexColor=i.strArrCmp=i.strcmp=i.RegexSource=i.basename=i.mergeObjects=i.clone=void 0,i.clone=function(m){return A(m)},i.mergeObjects=function(m,...b){return b.forEach((c=>{for(let p in c)m[p]=c[p]})),m},i.basename=function m(b){const c=~b.lastIndexOf("/")||~b.lastIndexOf("\\");return c===0?b:~c==b.length-1?m(b.substring(0,b.length-1)):b.substr(1+~c)};let f=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;function P(m,b){return m<b?-1:m>b?1:0}i.RegexSource=class{static hasCaptures(m){return m!==null&&(f.lastIndex=0,f.test(m))}static replaceCaptures(m,b,c){return m.replace(f,((p,R,u,y)=>{let S=c[parseInt(R||u,10)];if(!S)return p;{let g=b.substring(S.start,S.end);for(;g[0]===".";)g=g.substring(1);switch(y){case"downcase":return g.toLowerCase();case"upcase":return g.toUpperCase();default:return g}}}))}},i.strcmp=P,i.strArrCmp=function(m,b){if(m===null&&b===null)return 0;if(!m)return-1;if(!b)return 1;let c=m.length,p=b.length;if(c===p){for(let R=0;R<c;R++){let u=P(m[R],b[R]);if(u!==0)return u}return 0}return c-p},i.isValidHexColor=function(m){return!!(/^#[0-9a-f]{6}$/i.test(m)||/^#[0-9a-f]{8}$/i.test(m)||/^#[0-9a-f]{3}$/i.test(m)||/^#[0-9a-f]{4}$/i.test(m))},i.escapeRegExpCharacters=function(m){return m.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")},i.CachedFn=class{constructor(m){this.fn=m,this.cache=new Map}get(m){if(this.cache.has(m))return this.cache.get(m);const b=this.fn(m);return this.cache.set(m,b),b}},i.performanceNow=typeof performance>"u"?function(){return Date.now()}:function(){return performance.now()}}},$={};return(function O(i){var A=$[i];if(A!==void 0)return A.exports;var f=$[i]={exports:{}};return U[i].call(f.exports,f,f.exports,O),f.exports})(625)})()))})(ie)),ie.exports}var pe=ye();const Se=ge(pe),Ce=_e({__proto__:null,default:Se},[pe]);export{Ce as m};
@@ -0,0 +1,4 @@
1
+ import{g as ge}from"./_commonjsHelpers-CqkleIqs.js";function _e(V,ce){return ce.forEach(function(q){q&&typeof q!="string"&&!Array.isArray(q)&&Object.keys(q).forEach(function(U){if(U!=="default"&&!(U in V)){var z=Object.getOwnPropertyDescriptor(q,U);Object.defineProperty(V,U,z.get?z:{enumerable:!0,get:function(){return q[U]}})}})}),Object.freeze(V)}var ie={exports:{}},be=ie.exports,he;function ye(){return he||(he=1,(function(V,ce){var q={};(function(U,z){V.exports=z()})(be,(()=>(()=>{var U={185:(B,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UseOnigurumaFindOptions=i.DebugFlags=void 0,i.DebugFlags={InDebugMode:typeof process<"u"&&!!q.VSCODE_TEXTMATE_DEBUG},i.UseOnigurumaFindOptions=!1},151:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.applyStateStackDiff=i.diffStateStacksRefEq=void 0;const f=A(752);i.diffStateStacksRefEq=function(P,m){let b=0;const c=[];let p=P,R=m;for(;p!==R;)p&&(!R||p.depth>=R.depth)?(b++,p=p.parent):(c.push(R.toStateStackFrame()),R=R.parent);return{pops:b,newFrames:c.reverse()}},i.applyStateStackDiff=function(P,m){let b=P;for(let c=0;c<m.pops;c++)b=b.parent;for(const c of m.newFrames)b=f.StateStackImpl.pushFrame(b,c);return b}},490:(B,i)=>{var A;Object.defineProperty(i,"__esModule",{value:!0}),i.toOptionalTokenType=i.EncodedTokenAttributes=void 0,(A=i.EncodedTokenAttributes||(i.EncodedTokenAttributes={})).toBinaryStr=function(f){return f.toString(2).padStart(32,"0")},A.print=function(f){const P=A.getLanguageId(f),m=A.getTokenType(f),b=A.getFontStyle(f),c=A.getForeground(f),p=A.getBackground(f);console.log({languageId:P,tokenType:m,fontStyle:b,foreground:c,background:p})},A.getLanguageId=function(f){return(255&f)>>>0},A.getTokenType=function(f){return(768&f)>>>8},A.containsBalancedBrackets=function(f){return!!(1024&f)},A.getFontStyle=function(f){return(30720&f)>>>11},A.getForeground=function(f){return(16744448&f)>>>15},A.getBackground=function(f){return(4278190080&f)>>>24},A.set=function(f,P,m,b,c,p,R){let u=A.getLanguageId(f),y=A.getTokenType(f),S=A.containsBalancedBrackets(f)?1:0,g=A.getFontStyle(f),C=A.getForeground(f),l=A.getBackground(f);return P!==0&&(u=P),m!==8&&(y=m),b!==null&&(S=b?1:0),c!==-1&&(g=c),p!==0&&(C=p),R!==0&&(l=R),(u|y<<8|S<<10|g<<11|C<<15|l<<24)>>>0},i.toOptionalTokenType=function(f){return f}},214:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BasicScopeAttributesProvider=i.BasicScopeAttributes=void 0;const f=A(807);class P{constructor(p,R){this.languageId=p,this.tokenType=R}}i.BasicScopeAttributes=P;class m{constructor(p,R){this._getBasicScopeAttributes=new f.CachedFn((u=>{const y=this._scopeToLanguage(u),S=this._toStandardTokenType(u);return new P(y,S)})),this._defaultAttributes=new P(p,8),this._embeddedLanguagesMatcher=new b(Object.entries(R||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(p){return p===null?m._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(p)}_scopeToLanguage(p){return this._embeddedLanguagesMatcher.match(p)||0}_toStandardTokenType(p){const R=p.match(m.STANDARD_TOKEN_TYPE_REGEXP);if(!R)return 8;switch(R[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!")}}i.BasicScopeAttributesProvider=m,m._NULL_SCOPE_METADATA=new P(0,0),m.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class b{constructor(p){if(p.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(p);const R=p.map((([u,y])=>f.escapeRegExpCharacters(u)));R.sort(),R.reverse(),this.scopesRegExp=new RegExp(`^((${R.join(")|(")}))($|\\.)`,"")}}match(p){if(!this.scopesRegExp)return;const R=p.match(this.scopesRegExp);return R?this.values.get(R[1]):void 0}}},929:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LineTokens=i.BalancedBracketSelectors=i.StateStackImpl=i.AttributedScopeStack=i.Grammar=i.createGrammar=void 0;const f=A(185),P=A(490),m=A(916),b=A(810),c=A(666),p=A(63),R=A(807),u=A(214),y=A(398);function S(o,t,r,a,d){const _=m.createMatchers(t,g),I=c.RuleFactory.getCompiledRuleId(r,a,d.repository);for(const w of _)o.push({debugSelector:t,matcher:w.matcher,ruleId:I,grammar:d,priority:w.priority})}function g(o,t){if(t.length<o.length)return!1;let r=0;return o.every((a=>{for(let d=r;d<t.length;d++)if(C(t[d],a))return r=d+1,!0;return!1}))}function C(o,t){if(!o)return!1;if(o===t)return!0;const r=t.length;return o.length>r&&o.substr(0,r)===t&&o[r]==="."}i.createGrammar=function(o,t,r,a,d,_,I,w){return new l(o,t,r,a,d,_,I,w)};class l{constructor(t,r,a,d,_,I,w,v){if(this._rootScopeName=t,this.balancedBracketSelectors=I,this._onigLib=v,this._basicScopeAttributesProvider=new u.BasicScopeAttributesProvider(a,d),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=w,this._grammar=h(r,null),this._injections=null,this._tokenTypeMatchers=[],_)for(const T of Object.keys(_)){const G=m.createMatchers(T,g);for(const N of G)this._tokenTypeMatchers.push({matcher:N.matcher,type:_[T]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t=[],r=this._rootScopeName,a=(d=>d===this._rootScopeName?this._grammar:this.getExternalGrammar(d))(r);if(a){const d=a.injections;if(d)for(let I in d)S(t,I,d[I],this,a);const _=this._grammarRepository.injections(r);_&&_.forEach((I=>{const w=this.getExternalGrammar(I);if(w){const v=w.injectionSelector;v&&S(t,v,w,this,w)}}))}return t.sort(((d,_)=>d.priority-_.priority)),t}getInjections(){if(this._injections===null&&(this._injections=this._collectInjections(),f.DebugFlags.InDebugMode&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const t of this._injections)console.log(` - ${t.debugSelector}`)}return this._injections}registerRule(t){const r=++this._lastRuleId,a=t(c.ruleIdFromNumber(r));return this._ruleId2desc[r]=a,a}getRule(t){return this._ruleId2desc[c.ruleIdToNumber(t)]}getExternalGrammar(t,r){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const a=this._grammarRepository.lookup(t);if(a)return this._includedGrammars[t]=h(a,r&&r.$base),this._includedGrammars[t]}}tokenizeLine(t,r,a=0){const d=this._tokenize(t,r,!1,a);return{tokens:d.lineTokens.getResult(d.ruleStack,d.lineLength),ruleStack:d.ruleStack,stoppedEarly:d.stoppedEarly}}tokenizeLine2(t,r,a=0){const d=this._tokenize(t,r,!0,a);return{tokens:d.lineTokens.getBinaryResult(d.ruleStack,d.lineLength),ruleStack:d.ruleStack,stoppedEarly:d.stoppedEarly}}_tokenize(t,r,a,d){let _;if(this._rootId===-1&&(this._rootId=c.RuleFactory.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),r&&r!==e.NULL)_=!1,r.reset();else{_=!0;const G=this._basicScopeAttributesProvider.getDefaultAttributes(),N=this.themeProvider.getDefaults(),O=P.EncodedTokenAttributes.set(0,G.languageId,G.tokenType,null,N.fontStyle,N.foregroundId,N.backgroundId),j=this.getRule(this._rootId).getName(null,null);let D;D=j?s.createRootAndLookUpScopeName(j,O,this):s.createRoot("unknown",O),r=new e(null,this._rootId,-1,-1,!1,null,D,D)}t+=`
2
+ `;const I=this.createOnigString(t),w=I.content.length,v=new n(a,t,this._tokenTypeMatchers,this.balancedBracketSelectors),T=y._tokenizeString(this,I,_,0,r,v,!0,d);return b.disposeOnigString(I),{lineLength:w,lineTokens:v,ruleStack:T.stack,stoppedEarly:T.stoppedEarly}}}function h(o,t){return(o=R.clone(o)).repository=o.repository||{},o.repository.$self={$vscodeTextmateLocation:o.$vscodeTextmateLocation,patterns:o.patterns,name:o.scopeName},o.repository.$base=t||o.repository.$self,o}i.Grammar=l;class s{constructor(t,r,a){this.parent=t,this.scopePath=r,this.tokenAttributes=a}static fromExtension(t,r){let a=t,d=t?.scopePath??null;for(const _ of r)d=p.ScopeStack.push(d,_.scopeNames),a=new s(a,d,_.encodedTokenAttributes);return a}static createRoot(t,r){return new s(null,new p.ScopeStack(null,t),r)}static createRootAndLookUpScopeName(t,r,a){const d=a.getMetadataForScope(t),_=new p.ScopeStack(null,t),I=a.themeProvider.themeMatch(_),w=s.mergeAttributes(r,d,I);return new s(null,_,w)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return s.equals(this,t)}static equals(t,r){for(;;){if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}}static mergeAttributes(t,r,a){let d=-1,_=0,I=0;return a!==null&&(d=a.fontStyle,_=a.foregroundId,I=a.backgroundId),P.EncodedTokenAttributes.set(t,r.languageId,r.tokenType,null,d,_,I)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return s._pushAttributed(this,t,r);const a=t.split(/ /g);let d=this;for(const _ of a)d=s._pushAttributed(d,_,r);return d}static _pushAttributed(t,r,a){const d=a.getMetadataForScope(r),_=t.scopePath.push(r),I=a.themeProvider.themeMatch(_),w=s.mergeAttributes(t.tokenAttributes,d,I);return new s(t,_,w)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const r=[];let a=this;for(;a&&a!==t;)r.push({encodedTokenAttributes:a.tokenAttributes,scopeNames:a.scopePath.getExtensionIfDefined(a.parent?.scopePath??null)}),a=a.parent;return a===t?r.reverse():void 0}}i.AttributedScopeStack=s;class e{constructor(t,r,a,d,_,I,w,v){this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=_,this.endRule=I,this.nameScopesList=w,this.contentNameScopesList=v,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=a,this._anchorPos=d}equals(t){return t!==null&&e._equals(this,t)}static _equals(t,r){return t===r||!!this._structuralEquals(t,r)&&s.equals(t.contentNameScopesList,r.contentNameScopesList)}static _structuralEquals(t,r){for(;;){if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,a,d,_,I,w){return new e(this,t,r,a,d,_,I,w)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){return{ruleId:c.ruleIdToNumber(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,r){const a=s.fromExtension(t?.nameScopesList??null,r.nameScopesList);return new e(t,c.ruleIdFromNumber(r.ruleId),r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,a,s.fromExtension(a,r.contentNameScopesList))}}i.StateStackImpl=e,e.NULL=new e(null,0,0,0,!1,null,null,null),i.BalancedBracketSelectors=class{constructor(o,t){this.allowAny=!1,this.balancedBracketScopes=o.flatMap((r=>r==="*"?(this.allowAny=!0,[]):m.createMatchers(r,g).map((a=>a.matcher)))),this.unbalancedBracketScopes=t.flatMap((r=>m.createMatchers(r,g).map((a=>a.matcher))))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(o){for(const t of this.unbalancedBracketScopes)if(t(o))return!1;for(const t of this.balancedBracketScopes)if(t(o))return!0;return this.allowAny}};class n{constructor(t,r,a,d){this.balancedBracketSelectors=d,this._emitBinaryTokens=t,this._tokenTypeOverrides=a,f.DebugFlags.InDebugMode?this._lineText=r:this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(t,r){this.produceFromScopes(t.contentNameScopesList,r)}produceFromScopes(t,r){if(this._lastTokenEndIndex>=r)return;if(this._emitBinaryTokens){let d=t?.tokenAttributes??0,_=!1;if(this.balancedBracketSelectors?.matchesAlways&&(_=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const I=t?.getScopeNames()??[];for(const w of this._tokenTypeOverrides)w.matcher(I)&&(d=P.EncodedTokenAttributes.set(d,0,P.toOptionalTokenType(w.type),null,-1,0,0));this.balancedBracketSelectors&&(_=this.balancedBracketSelectors.match(I))}if(_&&(d=P.EncodedTokenAttributes.set(d,0,8,_,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===d)return void(this._lastTokenEndIndex=r);if(f.DebugFlags.InDebugMode){const I=t?.getScopeNames()??[];console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,r).replace(/\n$/,"\\n")+"|");for(let w=0;w<I.length;w++)console.log(" * "+I[w])}return this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(d),void(this._lastTokenEndIndex=r)}const a=t?.getScopeNames()??[];if(f.DebugFlags.InDebugMode){console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,r).replace(/\n$/,"\\n")+"|");for(let d=0;d<a.length;d++)console.log(" * "+a[d])}this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:r,scopes:a}),this._lastTokenEndIndex=r}getResult(t,r){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===r-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,r),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,r){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===r-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,r),this._binaryTokens[this._binaryTokens.length-2]=0);const a=new Uint32Array(this._binaryTokens.length);for(let d=0,_=this._binaryTokens.length;d<_;d++)a[d]=this._binaryTokens[d];return a}}i.LineTokens=n},784:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.parseInclude=i.TopLevelRepositoryReference=i.TopLevelReference=i.RelativeReference=i.SelfReference=i.BaseReference=i.ScopeDependencyProcessor=i.ExternalReferenceCollector=i.TopLevelRepositoryRuleReference=i.TopLevelRuleReference=void 0;const f=A(807);class P{constructor(e){this.scopeName=e}toKey(){return this.scopeName}}i.TopLevelRuleReference=P;class m{constructor(e,n){this.scopeName=e,this.ruleName=n}toKey(){return`${this.scopeName}#${this.ruleName}`}}i.TopLevelRepositoryRuleReference=m;class b{constructor(){this._references=[],this._seenReferenceKeys=new Set,this.visitedRule=new Set}get references(){return this._references}add(e){const n=e.toKey();this._seenReferenceKeys.has(n)||(this._seenReferenceKeys.add(n),this._references.push(e))}}function c(s,e,n,o){const t=n.lookup(s.scopeName);if(!t){if(s.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const r=n.lookup(e);s instanceof P?R({baseGrammar:r,selfGrammar:t},o):p(s.ruleName,{baseGrammar:r,selfGrammar:t,repository:t.repository},o);const a=n.injections(s.scopeName);if(a)for(const d of a)o.add(new P(d))}function p(s,e,n){e.repository&&e.repository[s]&&u([e.repository[s]],e,n)}function R(s,e){s.selfGrammar.patterns&&Array.isArray(s.selfGrammar.patterns)&&u(s.selfGrammar.patterns,{...s,repository:s.selfGrammar.repository},e),s.selfGrammar.injections&&u(Object.values(s.selfGrammar.injections),{...s,repository:s.selfGrammar.repository},e)}function u(s,e,n){for(const o of s){if(n.visitedRule.has(o))continue;n.visitedRule.add(o);const t=o.repository?f.mergeObjects({},e.repository,o.repository):e.repository;Array.isArray(o.patterns)&&u(o.patterns,{...e,repository:t},n);const r=o.include;if(!r)continue;const a=h(r);switch(a.kind){case 0:R({...e,selfGrammar:e.baseGrammar},n);break;case 1:R(e,n);break;case 2:p(a.ruleName,{...e,repository:t},n);break;case 3:case 4:const d=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(d){const _={baseGrammar:e.baseGrammar,selfGrammar:d,repository:t};a.kind===4?p(a.ruleName,_,n):R(_,n)}else a.kind===4?n.add(new m(a.scopeName,a.ruleName)):n.add(new P(a.scopeName))}}}i.ExternalReferenceCollector=b,i.ScopeDependencyProcessor=class{constructor(s,e){this.repo=s,this.initialScopeName=e,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new P(this.initialScopeName)]}processQueue(){const s=this.Q;this.Q=[];const e=new b;for(const n of s)c(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof P){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};class y{constructor(){this.kind=0}}i.BaseReference=y;class S{constructor(){this.kind=1}}i.SelfReference=S;class g{constructor(e){this.ruleName=e,this.kind=2}}i.RelativeReference=g;class C{constructor(e){this.scopeName=e,this.kind=3}}i.TopLevelReference=C;class l{constructor(e,n){this.scopeName=e,this.ruleName=n,this.kind=4}}function h(s){if(s==="$base")return new y;if(s==="$self")return new S;const e=s.indexOf("#");if(e===-1)return new C(s);if(e===0)return new g(s.substring(1));{const n=s.substring(0,e),o=s.substring(e+1);return new l(n,o)}}i.TopLevelRepositoryReference=l,i.parseInclude=h},752:function(B,i,A){var f=this&&this.__createBinding||(Object.create?function(m,b,c,p){p===void 0&&(p=c),Object.defineProperty(m,p,{enumerable:!0,get:function(){return b[c]}})}:function(m,b,c,p){p===void 0&&(p=c),m[p]=b[c]}),P=this&&this.__exportStar||function(m,b){for(var c in m)c==="default"||Object.prototype.hasOwnProperty.call(b,c)||f(b,m,c)};Object.defineProperty(i,"__esModule",{value:!0}),P(A(929),i)},398:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LocalStackElement=i._tokenizeString=void 0;const f=A(185),P=A(810),m=A(666),b=A(807);class c{constructor(l,h){this.stack=l,this.stoppedEarly=h}}function p(C,l,h,s,e,n,o,t){const r=l.content.length;let a=!1,d=-1;if(o){const w=(function(v,T,G,N,O,j){let D=O.beginRuleCapturedEOL?0:-1;const E=[];for(let x=O;x;x=x.pop()){const M=x.getRule(v);M instanceof m.BeginWhileRule&&E.push({rule:M,stack:x})}for(let x=E.pop();x;x=E.pop()){const{ruleScanner:M,findOptions:H}=u(x.rule,v,x.stack.endRule,G,N===D),k=M.findNextMatchSync(T,N,H);if(f.DebugFlags.InDebugMode&&(console.log(" scanning for while rule"),console.log(M.toString())),!k){f.DebugFlags.InDebugMode&&console.log(" popping "+x.rule.debugName+" - "+x.rule.debugWhileRegExp),O=x.stack.pop();break}if(k.ruleId!==m.whileRuleId){O=x.stack.pop();break}k.captureIndices&&k.captureIndices.length&&(j.produce(x.stack,k.captureIndices[0].start),S(v,T,G,x.stack,j,x.rule.whileCaptures,k.captureIndices),j.produce(x.stack,k.captureIndices[0].end),D=k.captureIndices[0].end,k.captureIndices[0].end>N&&(N=k.captureIndices[0].end,G=!1))}return{stack:O,linePos:N,anchorPosition:D,isFirstLine:G}})(C,l,h,s,e,n);e=w.stack,s=w.linePos,h=w.isFirstLine,d=w.anchorPosition}const _=Date.now();for(;!a;){if(t!==0&&Date.now()-_>t)return new c(e,!0);I()}return new c(e,!1);function I(){f.DebugFlags.InDebugMode&&(console.log(""),console.log(`@@scanNext ${s}: |${l.content.substr(s).replace(/\n$/,"\\n")}|`));const w=(function(N,O,j,D,E,x){const M=(function(W,J,oe,X,K,te){const Y=K.getRule(W),{ruleScanner:Z,findOptions:ee}=R(Y,W,K.endRule,oe,X===te);let Q=0;f.DebugFlags.InDebugMode&&(Q=b.performanceNow());const $=Z.findNextMatchSync(J,X,ee);if(f.DebugFlags.InDebugMode){const ne=b.performanceNow()-Q;ne>5&&console.warn(`Rule ${Y.debugName} (${Y.id}) matching took ${ne} against '${J}'`),console.log(` scanning for (linePos: ${X}, anchorPosition: ${te})`),console.log(Z.toString()),$&&console.log(`matched rule id: ${$.ruleId} from ${$.captureIndices[0].start} to ${$.captureIndices[0].end}`)}return $?{captureIndices:$.captureIndices,matchedRuleId:$.ruleId}:null})(N,O,j,D,E,x),H=N.getInjections();if(H.length===0)return M;const k=(function(W,J,oe,X,K,te,Y){let Z,ee=Number.MAX_VALUE,Q=null,$=0;const ne=te.contentNameScopesList.getScopeNames();for(let ae=0,de=W.length;ae<de;ae++){const se=W[ae];if(!se.matcher(ne))continue;const fe=J.getRule(se.ruleId),{ruleScanner:le,findOptions:me}=R(fe,J,null,X,K===Y),re=le.findNextMatchSync(oe,K,me);if(!re)continue;f.DebugFlags.InDebugMode&&(console.log(` matched injection: ${se.debugSelector}`),console.log(le.toString()));const ue=re.captureIndices[0].start;if(!(ue>=ee)&&(ee=ue,Q=re.captureIndices,Z=re.ruleId,$=se.priority,ee===K))break}return Q?{priorityMatch:$===-1,captureIndices:Q,matchedRuleId:Z}:null})(H,N,O,j,D,E,x);if(!k)return M;if(!M)return k;const F=M.captureIndices[0].start,L=k.captureIndices[0].start;return L<F||k.priorityMatch&&L===F?k:M})(C,l,h,s,e,d);if(!w)return f.DebugFlags.InDebugMode&&console.log(" no more matches."),n.produce(e,r),void(a=!0);const v=w.captureIndices,T=w.matchedRuleId,G=!!(v&&v.length>0)&&v[0].end>s;if(T===m.endRuleId){const N=e.getRule(C);f.DebugFlags.InDebugMode&&console.log(" popping "+N.debugName+" - "+N.debugEndRegExp),n.produce(e,v[0].start),e=e.withContentNameScopesList(e.nameScopesList),S(C,l,h,e,n,N.endCaptures,v),n.produce(e,v[0].end);const O=e;if(e=e.parent,d=O.getAnchorPos(),!G&&O.getEnterPos()===s)return f.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),e=O,n.produce(e,r),void(a=!0)}else{const N=C.getRule(T);n.produce(e,v[0].start);const O=e,j=N.getName(l.content,v),D=e.contentNameScopesList.pushAttributed(j,C);if(e=e.push(T,s,d,v[0].end===r,null,D,D),N instanceof m.BeginEndRule){const E=N;f.DebugFlags.InDebugMode&&console.log(" pushing "+E.debugName+" - "+E.debugBeginRegExp),S(C,l,h,e,n,E.beginCaptures,v),n.produce(e,v[0].end),d=v[0].end;const x=E.getContentName(l.content,v),M=D.pushAttributed(x,C);if(e=e.withContentNameScopesList(M),E.endHasBackReferences&&(e=e.withEndRule(E.getEndWithResolvedBackReferences(l.content,v))),!G&&O.hasSameRuleAs(e))return f.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),e=e.pop(),n.produce(e,r),void(a=!0)}else if(N instanceof m.BeginWhileRule){const E=N;f.DebugFlags.InDebugMode&&console.log(" pushing "+E.debugName),S(C,l,h,e,n,E.beginCaptures,v),n.produce(e,v[0].end),d=v[0].end;const x=E.getContentName(l.content,v),M=D.pushAttributed(x,C);if(e=e.withContentNameScopesList(M),E.whileHasBackReferences&&(e=e.withEndRule(E.getWhileWithResolvedBackReferences(l.content,v))),!G&&O.hasSameRuleAs(e))return f.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),e=e.pop(),n.produce(e,r),void(a=!0)}else{const E=N;if(f.DebugFlags.InDebugMode&&console.log(" matched "+E.debugName+" - "+E.debugMatchRegExp),S(C,l,h,e,n,E.captures,v),n.produce(e,v[0].end),e=e.pop(),!G)return f.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),e=e.safePop(),n.produce(e,r),void(a=!0)}}v[0].end>s&&(s=v[0].end,h=!1)}}function R(C,l,h,s,e){return f.UseOnigurumaFindOptions?{ruleScanner:C.compile(l,h),findOptions:y(s,e)}:{ruleScanner:C.compileAG(l,h,s,e),findOptions:0}}function u(C,l,h,s,e){return f.UseOnigurumaFindOptions?{ruleScanner:C.compileWhile(l,h),findOptions:y(s,e)}:{ruleScanner:C.compileWhileAG(l,h,s,e),findOptions:0}}function y(C,l){let h=0;return C||(h|=1),l||(h|=4),h}function S(C,l,h,s,e,n,o){if(n.length===0)return;const t=l.content,r=Math.min(n.length,o.length),a=[],d=o[0].end;for(let _=0;_<r;_++){const I=n[_];if(I===null)continue;const w=o[_];if(w.length===0)continue;if(w.start>d)break;for(;a.length>0&&a[a.length-1].endPos<=w.start;)e.produceFromScopes(a[a.length-1].scopes,a[a.length-1].endPos),a.pop();if(a.length>0?e.produceFromScopes(a[a.length-1].scopes,w.start):e.produce(s,w.start),I.retokenizeCapturedWithRuleId){const T=I.getName(t,o),G=s.contentNameScopesList.pushAttributed(T,C),N=I.getContentName(t,o),O=G.pushAttributed(N,C),j=s.push(I.retokenizeCapturedWithRuleId,w.start,-1,!1,null,G,O),D=C.createOnigString(t.substring(0,w.end));p(C,D,h&&w.start===0,w.start,j,e,!1,0),P.disposeOnigString(D);continue}const v=I.getName(t,o);if(v!==null){const T=(a.length>0?a[a.length-1].scopes:s.contentNameScopesList).pushAttributed(v,C);a.push(new g(T,w.end))}}for(;a.length>0;)e.produceFromScopes(a[a.length-1].scopes,a[a.length-1].endPos),a.pop()}i._tokenizeString=p;class g{constructor(l,h){this.scopes=l,this.endPos=h}}i.LocalStackElement=g},726:(B,i)=>{function A(b,c){throw new Error("Near offset "+b.pos+": "+c+" ~~~"+b.source.substr(b.pos,50)+"~~~")}Object.defineProperty(i,"__esModule",{value:!0}),i.parseJSON=void 0,i.parseJSON=function(b,c,p){let R=new f(b),u=new P,y=0,S=null,g=[],C=[];function l(){g.push(y),C.push(S)}function h(){y=g.pop(),S=C.pop()}function s(e){A(R,e)}for(;m(R,u);){if(y===0){if(S!==null&&s("too many constructs in root"),u.type===3){S={},p&&(S.$vscodeTextmateLocation=u.toLocation(c)),l(),y=1;continue}if(u.type===2){S=[],l(),y=4;continue}s("unexpected token in root")}if(y===2){if(u.type===5){h();continue}if(u.type===7){y=3;continue}s("expected , or }")}if(y===1||y===3){if(y===1&&u.type===5){h();continue}if(u.type===1){let e=u.value;if(m(R,u)&&u.type===6||s("expected colon"),m(R,u)||s("expected value"),y=2,u.type===1){S[e]=u.value;continue}if(u.type===8){S[e]=null;continue}if(u.type===9){S[e]=!0;continue}if(u.type===10){S[e]=!1;continue}if(u.type===11){S[e]=parseFloat(u.value);continue}if(u.type===2){let n=[];S[e]=n,l(),y=4,S=n;continue}if(u.type===3){let n={};p&&(n.$vscodeTextmateLocation=u.toLocation(c)),S[e]=n,l(),y=1,S=n;continue}}s("unexpected token in dict")}if(y===5){if(u.type===4){h();continue}if(u.type===7){y=6;continue}s("expected , or ]")}if(y===4||y===6){if(y===4&&u.type===4){h();continue}if(y=5,u.type===1){S.push(u.value);continue}if(u.type===8){S.push(null);continue}if(u.type===9){S.push(!0);continue}if(u.type===10){S.push(!1);continue}if(u.type===11){S.push(parseFloat(u.value));continue}if(u.type===2){let e=[];S.push(e),l(),y=4,S=e;continue}if(u.type===3){let e={};p&&(e.$vscodeTextmateLocation=u.toLocation(c)),S.push(e),l(),y=1,S=e;continue}s("unexpected token in array")}s("unknown state")}return C.length!==0&&s("unclosed constructs"),S};class f{constructor(c){this.source=c,this.pos=0,this.len=c.length,this.line=1,this.char=0}}class P{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(c){return{filename:c,line:this.line,char:this.char}}}function m(b,c){c.value=null,c.type=0,c.offset=-1,c.len=-1,c.line=-1,c.char=-1;let p,R=b.source,u=b.pos,y=b.len,S=b.line,g=b.char;for(;;){if(u>=y)return!1;if(p=R.charCodeAt(u),p!==32&&p!==9&&p!==13){if(p!==10)break;u++,S++,g=0}else u++,g++}if(c.offset=u,c.line=S,c.char=g,p===34){for(c.type=1,u++,g++;;){if(u>=y)return!1;if(p=R.charCodeAt(u),u++,g++,p!==92){if(p===34)break}else u++,g++}c.value=R.substring(c.offset+1,u-1).replace(/\\u([0-9A-Fa-f]{4})/g,((C,l)=>String.fromCodePoint(parseInt(l,16)))).replace(/\\(.)/g,((C,l)=>{switch(l){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return`
3
+ `;case"r":return"\r";case"t":return" ";default:A(b,"invalid escape sequence")}throw new Error("unreachable")}))}else if(p===91)c.type=2,u++,g++;else if(p===123)c.type=3,u++,g++;else if(p===93)c.type=4,u++,g++;else if(p===125)c.type=5,u++,g++;else if(p===58)c.type=6,u++,g++;else if(p===44)c.type=7,u++,g++;else if(p===110){if(c.type=8,u++,g++,p=R.charCodeAt(u),p!==117||(u++,g++,p=R.charCodeAt(u),p!==108)||(u++,g++,p=R.charCodeAt(u),p!==108))return!1;u++,g++}else if(p===116){if(c.type=9,u++,g++,p=R.charCodeAt(u),p!==114||(u++,g++,p=R.charCodeAt(u),p!==117)||(u++,g++,p=R.charCodeAt(u),p!==101))return!1;u++,g++}else if(p===102){if(c.type=10,u++,g++,p=R.charCodeAt(u),p!==97||(u++,g++,p=R.charCodeAt(u),p!==108)||(u++,g++,p=R.charCodeAt(u),p!==115)||(u++,g++,p=R.charCodeAt(u),p!==101))return!1;u++,g++}else for(c.type=11;;){if(u>=y)return!1;if(p=R.charCodeAt(u),!(p===46||p>=48&&p<=57||p===101||p===69||p===45||p===43))break;u++,g++}return c.len=u-c.offset,c.value===null&&(c.value=R.substr(c.offset,c.len)),b.pos=u,b.line=S,b.char=g,!0}},625:function(B,i,A){var f=this&&this.__createBinding||(Object.create?function(y,S,g,C){C===void 0&&(C=g),Object.defineProperty(y,C,{enumerable:!0,get:function(){return S[g]}})}:function(y,S,g,C){C===void 0&&(C=g),y[C]=S[g]}),P=this&&this.__exportStar||function(y,S){for(var g in y)g==="default"||Object.prototype.hasOwnProperty.call(S,g)||f(S,y,g)};Object.defineProperty(i,"__esModule",{value:!0}),i.applyStateStackDiff=i.diffStateStacksRefEq=i.parseRawGrammar=i.INITIAL=i.Registry=void 0;const m=A(752),b=A(150),c=A(583),p=A(63),R=A(784),u=A(151);Object.defineProperty(i,"applyStateStackDiff",{enumerable:!0,get:function(){return u.applyStateStackDiff}}),Object.defineProperty(i,"diffStateStacksRefEq",{enumerable:!0,get:function(){return u.diffStateStacksRefEq}}),P(A(810),i),i.Registry=class{constructor(y){this._options=y,this._syncRegistry=new c.SyncRegistry(p.Theme.createFromRawTheme(y.theme,y.colorMap),y.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(y,S){this._syncRegistry.setTheme(p.Theme.createFromRawTheme(y,S))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(y,S,g){return this.loadGrammarWithConfiguration(y,S,{embeddedLanguages:g})}loadGrammarWithConfiguration(y,S,g){return this._loadGrammar(y,S,g.embeddedLanguages,g.tokenTypes,new m.BalancedBracketSelectors(g.balancedBracketSelectors||[],g.unbalancedBracketSelectors||[]))}loadGrammar(y){return this._loadGrammar(y,0,null,null,null)}async _loadGrammar(y,S,g,C,l){const h=new R.ScopeDependencyProcessor(this._syncRegistry,y);for(;h.Q.length>0;)await Promise.all(h.Q.map((s=>this._loadSingleGrammar(s.scopeName)))),h.processQueue();return this._grammarForScopeName(y,S,g,C,l)}async _loadSingleGrammar(y){return this._ensureGrammarCache.has(y)||this._ensureGrammarCache.set(y,this._doLoadSingleGrammar(y)),this._ensureGrammarCache.get(y)}async _doLoadSingleGrammar(y){const S=await this._options.loadGrammar(y);if(S){const g=typeof this._options.getInjections=="function"?this._options.getInjections(y):void 0;this._syncRegistry.addGrammar(S,g)}}async addGrammar(y,S=[],g=0,C=null){return this._syncRegistry.addGrammar(y,S),await this._grammarForScopeName(y.scopeName,g,C)}_grammarForScopeName(y,S=0,g=null,C=null,l=null){return this._syncRegistry.grammarForScopeName(y,S,g,C,l)}},i.INITIAL=m.StateStackImpl.NULL,i.parseRawGrammar=b.parseRawGrammar},916:(B,i)=>{function A(f){return!!f&&!!f.match(/[\w\.:]+/)}Object.defineProperty(i,"__esModule",{value:!0}),i.createMatchers=void 0,i.createMatchers=function(f,P){const m=[],b=(function(u){let y=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,S=y.exec(u);return{next:()=>{if(!S)return null;const g=S[0];return S=y.exec(u),g}}})(f);let c=b.next();for(;c!==null;){let u=0;if(c.length===2&&c.charAt(1)===":"){switch(c.charAt(0)){case"R":u=1;break;case"L":u=-1;break;default:console.log(`Unknown priority ${c} in scope selector`)}c=b.next()}let y=R();if(m.push({matcher:y,priority:u}),c!==",")break;c=b.next()}return m;function p(){if(c==="-"){c=b.next();const u=p();return y=>!!u&&!u(y)}if(c==="("){c=b.next();const u=(function(){const y=[];let S=R();for(;S&&(y.push(S),c==="|"||c===",");){do c=b.next();while(c==="|"||c===",");S=R()}return g=>y.some((C=>C(g)))})();return c===")"&&(c=b.next()),u}if(A(c)){const u=[];do u.push(c),c=b.next();while(A(c));return y=>P(u,y)}return null}function R(){const u=[];let y=p();for(;y;)u.push(y),y=p();return S=>u.every((g=>g(S)))}}},810:(B,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.disposeOnigString=void 0,i.disposeOnigString=function(A){typeof A.dispose=="function"&&A.dispose()}},150:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.parseRawGrammar=void 0;const f=A(578),P=A(185),m=A(726);i.parseRawGrammar=function(b,c=null){return c!==null&&/\.json$/.test(c)?(p=b,R=c,P.DebugFlags.InDebugMode?m.parseJSON(p,R,!0):JSON.parse(p)):(function(u,y){return P.DebugFlags.InDebugMode?f.parseWithLocation(u,y,"$vscodeTextmateLocation"):f.parsePLIST(u)})(b,c);var p,R}},578:(B,i)=>{function A(f,P,m){const b=f.length;let c=0,p=1,R=0;function u(k){if(m===null)c+=k;else for(;k>0;)f.charCodeAt(c)===10?(c++,p++,R=0):(c++,R++),k--}function y(k){m===null?c=k:u(k-c)}function S(){for(;c<b;){let k=f.charCodeAt(c);if(k!==32&&k!==9&&k!==13&&k!==10)break;u(1)}}function g(k){return f.substr(c,k.length)===k&&(u(k.length),!0)}function C(k){let F=f.indexOf(k,c);y(F!==-1?F+k.length:b)}function l(k){let F=f.indexOf(k,c);if(F!==-1){let L=f.substring(c,F);return y(F+k.length),L}{let L=f.substr(c);return y(b),L}}b>0&&f.charCodeAt(0)===65279&&(c=1);let h=0,s=null,e=[],n=[],o=null;function t(k,F){e.push(h),n.push(s),h=k,s=F}function r(){if(e.length===0)return a("illegal state stack");h=e.pop(),s=n.pop()}function a(k){throw new Error("Near offset "+c+": "+k+" ~~~"+f.substr(c,50)+"~~~")}const d=function(){if(o===null)return a("missing <key>");let k={};m!==null&&(k[m]={filename:P,line:p,char:R}),s[o]=k,o=null,t(1,k)},_=function(){if(o===null)return a("missing <key>");let k=[];s[o]=k,o=null,t(2,k)},I=function(){let k={};m!==null&&(k[m]={filename:P,line:p,char:R}),s.push(k),t(1,k)},w=function(){let k=[];s.push(k),t(2,k)};function v(){if(h!==1)return a("unexpected </dict>");r()}function T(){return h===1||h!==2?a("unexpected </array>"):void r()}function G(k){if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function N(k){if(isNaN(k))return a("cannot parse float");if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function O(k){if(isNaN(k))return a("cannot parse integer");if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function j(k){if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function D(k){if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function E(k){if(h===1){if(o===null)return a("missing <key>");s[o]=k,o=null}else h===2?s.push(k):s=k}function x(){let k=l(">"),F=!1;return k.charCodeAt(k.length-1)===47&&(F=!0,k=k.substring(0,k.length-1)),{name:k.trim(),isClosed:F}}function M(k){if(k.isClosed)return"";let F=l("</");return C(">"),F.replace(/&#([0-9]+);/g,(function(L,W){return String.fromCodePoint(parseInt(W,10))})).replace(/&#x([0-9a-f]+);/g,(function(L,W){return String.fromCodePoint(parseInt(W,16))})).replace(/&amp;|&lt;|&gt;|&quot;|&apos;/g,(function(L){switch(L){case"&amp;":return"&";case"&lt;":return"<";case"&gt;":return">";case"&quot;":return'"';case"&apos;":return"'"}return L}))}for(;c<b&&(S(),!(c>=b));){const k=f.charCodeAt(c);if(u(1),k!==60)return a("expected <");if(c>=b)return a("unexpected end of input");const F=f.charCodeAt(c);if(F===63){u(1),C("?>");continue}if(F===33){if(u(1),g("--")){C("-->");continue}C(">");continue}if(F===47){if(u(1),S(),g("plist")){C(">");continue}if(g("dict")){C(">"),v();continue}if(g("array")){C(">"),T();continue}return a("unexpected closed tag")}let L=x();switch(L.name){case"dict":h===1?d():h===2?I():(s={},m!==null&&(s[m]={filename:P,line:p,char:R}),t(1,s)),L.isClosed&&v();continue;case"array":h===1?_():h===2?w():(s=[],t(2,s)),L.isClosed&&T();continue;case"key":H=M(L),h!==1?a("unexpected <key>"):o!==null?a("too many <key>"):o=H;continue;case"string":G(M(L));continue;case"real":N(parseFloat(M(L)));continue;case"integer":O(parseInt(M(L),10));continue;case"date":j(new Date(M(L)));continue;case"data":D(M(L));continue;case"true":M(L),E(!0);continue;case"false":M(L),E(!1);continue}if(!/^plist/.test(L.name))return a("unexpected opened tag "+L.name)}var H;return s}Object.defineProperty(i,"__esModule",{value:!0}),i.parsePLIST=i.parseWithLocation=void 0,i.parseWithLocation=function(f,P,m){return A(f,P,m)},i.parsePLIST=function(f){return A(f,null,null)}},583:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SyncRegistry=void 0;const f=A(752);i.SyncRegistry=class{constructor(P,m){this._onigLibPromise=m,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=P}dispose(){for(const P of this._grammars.values())P.dispose()}setTheme(P){this._theme=P}getColorMap(){return this._theme.getColorMap()}addGrammar(P,m){this._rawGrammars.set(P.scopeName,P),m&&this._injectionGrammars.set(P.scopeName,m)}lookup(P){return this._rawGrammars.get(P)}injections(P){return this._injectionGrammars.get(P)}getDefaults(){return this._theme.getDefaults()}themeMatch(P){return this._theme.match(P)}async grammarForScopeName(P,m,b,c,p){if(!this._grammars.has(P)){let R=this._rawGrammars.get(P);if(!R)return null;this._grammars.set(P,f.createGrammar(P,R,m,b,c,p,this,await this._onigLibPromise))}return this._grammars.get(P)}}},666:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CompiledRule=i.RegExpSourceList=i.RegExpSource=i.RuleFactory=i.BeginWhileRule=i.BeginEndRule=i.IncludeOnlyRule=i.MatchRule=i.CaptureRule=i.Rule=i.ruleIdToNumber=i.ruleIdFromNumber=i.whileRuleId=i.endRuleId=void 0;const f=A(807),P=A(784),m=/\\(\d+)/,b=/\\(\d+)/g;i.endRuleId=-1,i.whileRuleId=-2,i.ruleIdFromNumber=function(s){return s},i.ruleIdToNumber=function(s){return s};class c{constructor(e,n,o,t){this.$location=e,this.id=n,this._name=o||null,this._nameIsCapturing=f.RegexSource.hasCaptures(this._name),this._contentName=t||null,this._contentNameIsCapturing=f.RegexSource.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${f.basename(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,n){return this._nameIsCapturing&&this._name!==null&&e!==null&&n!==null?f.RegexSource.replaceCaptures(this._name,e,n):this._name}getContentName(e,n){return this._contentNameIsCapturing&&this._contentName!==null?f.RegexSource.replaceCaptures(this._contentName,e,n):this._contentName}}i.Rule=c;class p extends c{constructor(e,n,o,t,r){super(e,n,o,t),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,n){throw new Error("Not supported!")}compile(e,n){throw new Error("Not supported!")}compileAG(e,n,o,t){throw new Error("Not supported!")}}i.CaptureRule=p;class R extends c{constructor(e,n,o,t,r){super(e,n,o,null),this._match=new C(t,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,n){n.push(this._match)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,o,t){return this._getCachedCompiledPatterns(e).compileAG(e,o,t)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new l,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}i.MatchRule=R;class u extends c{constructor(e,n,o,t,r){super(e,n,o,t),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,n){for(const o of this.patterns)e.getRule(o).collectPatterns(e,n)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,o,t){return this._getCachedCompiledPatterns(e).compileAG(e,o,t)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new l,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}i.IncludeOnlyRule=u;class y extends c{constructor(e,n,o,t,r,a,d,_,I,w){super(e,n,o,t),this._begin=new C(r,this.id),this.beginCaptures=a,this._end=new C(d||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=_,this.applyEndPatternLast=I||!1,this.patterns=w.patterns,this.hasMissingPatterns=w.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,n){return this._end.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e,n).compile(e)}compileAG(e,n,o,t){return this._getCachedCompiledPatterns(e,n).compileAG(e,o,t)}_getCachedCompiledPatterns(e,n){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new l;for(const o of this.patterns)e.getRule(o).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,n):this._cachedCompiledPatterns.setSource(0,n)),this._cachedCompiledPatterns}}i.BeginEndRule=y;class S extends c{constructor(e,n,o,t,r,a,d,_,I){super(e,n,o,t),this._begin=new C(r,this.id),this.beginCaptures=a,this.whileCaptures=_,this._while=new C(d,i.whileRuleId),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=I.patterns,this.hasMissingPatterns=I.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,n){return this._while.resolveBackReferences(e,n)}collectPatterns(e,n){n.push(this._begin)}compile(e,n){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,n,o,t){return this._getCachedCompiledPatterns(e).compileAG(e,o,t)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new l;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,n){return this._getCachedCompiledWhilePatterns(e,n).compile(e)}compileWhileAG(e,n,o,t){return this._getCachedCompiledWhilePatterns(e,n).compileAG(e,o,t)}_getCachedCompiledWhilePatterns(e,n){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new l,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,n||"￿"),this._cachedCompiledWhilePatterns}}i.BeginWhileRule=S;class g{static createCaptureRule(e,n,o,t,r){return e.registerRule((a=>new p(n,a,o,t,r)))}static getCompiledRuleId(e,n,o){return e.id||n.registerRule((t=>{if(e.id=t,e.match)return new R(e.$vscodeTextmateLocation,e.id,e.name,e.match,g._compileCaptures(e.captures,n,o));if(e.begin===void 0){e.repository&&(o=f.mergeObjects({},o,e.repository));let r=e.patterns;return r===void 0&&e.include&&(r=[{include:e.include}]),new u(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,g._compilePatterns(r,n,o))}return e.while?new S(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,g._compileCaptures(e.beginCaptures||e.captures,n,o),e.while,g._compileCaptures(e.whileCaptures||e.captures,n,o),g._compilePatterns(e.patterns,n,o)):new y(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,g._compileCaptures(e.beginCaptures||e.captures,n,o),e.end,g._compileCaptures(e.endCaptures||e.captures,n,o),e.applyEndPatternLast,g._compilePatterns(e.patterns,n,o))})),e.id}static _compileCaptures(e,n,o){let t=[];if(e){let r=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const d=parseInt(a,10);d>r&&(r=d)}for(let a=0;a<=r;a++)t[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const d=parseInt(a,10);let _=0;e[a].patterns&&(_=g.getCompiledRuleId(e[a],n,o)),t[d]=g.createCaptureRule(n,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,_)}}return t}static _compilePatterns(e,n,o){let t=[];if(e)for(let r=0,a=e.length;r<a;r++){const d=e[r];let _=-1;if(d.include){const I=P.parseInclude(d.include);switch(I.kind){case 0:case 1:_=g.getCompiledRuleId(o[d.include],n,o);break;case 2:let w=o[I.ruleName];w&&(_=g.getCompiledRuleId(w,n,o));break;case 3:case 4:const v=I.scopeName,T=I.kind===4?I.ruleName:null,G=n.getExternalGrammar(v,o);if(G)if(T){let N=G.repository[T];N&&(_=g.getCompiledRuleId(N,n,G.repository))}else _=g.getCompiledRuleId(G.repository.$self,n,G.repository)}}else _=g.getCompiledRuleId(d,n,o);if(_!==-1){const I=n.getRule(_);let w=!1;if((I instanceof u||I instanceof y||I instanceof S)&&I.hasMissingPatterns&&I.patterns.length===0&&(w=!0),w)continue;t.push(_)}}return{patterns:t,hasMissingPatterns:(e?e.length:0)!==t.length}}}i.RuleFactory=g;class C{constructor(e,n){if(e){const o=e.length;let t=0,r=[],a=!1;for(let d=0;d<o;d++)if(e.charAt(d)==="\\"&&d+1<o){const _=e.charAt(d+1);_==="z"?(r.push(e.substring(t,d)),r.push("$(?!\\n)(?<!\\n)"),t=d+2):_!=="A"&&_!=="G"||(a=!0),d++}this.hasAnchor=a,t===0?this.source=e:(r.push(e.substring(t,o)),this.source=r.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,this.hasBackReferences=m.test(this.source)}clone(){return new C(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){let o=n.map((t=>e.substring(t.start,t.end)));return b.lastIndex=0,this.source.replace(b,((t,r)=>f.escapeRegExpCharacters(o[parseInt(r,10)]||"")))}_buildAnchorCache(){let e,n,o,t,r=[],a=[],d=[],_=[];for(e=0,n=this.source.length;e<n;e++)o=this.source.charAt(e),r[e]=o,a[e]=o,d[e]=o,_[e]=o,o==="\\"&&e+1<n&&(t=this.source.charAt(e+1),t==="A"?(r[e+1]="￿",a[e+1]="￿",d[e+1]="A",_[e+1]="A"):t==="G"?(r[e+1]="￿",a[e+1]="G",d[e+1]="￿",_[e+1]="G"):(r[e+1]=t,a[e+1]=t,d[e+1]=t,_[e+1]=t),e++);return{A0_G0:r.join(""),A0_G1:a.join(""),A1_G0:d.join(""),A1_G1:_.join("")}}resolveAnchors(e,n){return this.hasAnchor&&this._anchorCache?e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}}i.RegExpSource=C;class l{constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,n){this._items[e].source!==n&&(this._disposeCaches(),this._items[e].setSource(n))}compile(e){if(!this._cached){let n=this._items.map((o=>o.source));this._cached=new h(e,n,this._items.map((o=>o.ruleId)))}return this._cached}compileAG(e,n,o){return this._hasAnchors?n?o?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,n,o)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,n,o)),this._anchorCache.A1_G0):o?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,n,o)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,n,o)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,n,o){let t=this._items.map((r=>r.resolveAnchors(n,o)));return new h(e,t,this._items.map((r=>r.ruleId)))}}i.RegExpSourceList=l;class h{constructor(e,n,o){this.regExps=n,this.rules=o,this.scanner=e.createOnigScanner(n)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let n=0,o=this.rules.length;n<o;n++)e.push(" - "+this.rules[n]+": "+this.regExps[n]);return e.join(`
4
+ `)}findNextMatchSync(e,n,o){const t=this.scanner.findNextMatchSync(e,n,o);return t?{ruleId:this.rules[t.index],captureIndices:t.captureIndices}:null}}i.CompiledRule=h},63:(B,i,A)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeTrieElement=i.ThemeTrieElementRule=i.ColorMap=i.fontStyleToString=i.ParsedThemeRule=i.parseTheme=i.StyleAttributes=i.ScopeStack=i.Theme=void 0;const f=A(807);class P{constructor(l,h,s){this._colorMap=l,this._defaults=h,this._root=s,this._cachedMatchRoot=new f.CachedFn((e=>this._root.match(e)))}static createFromRawTheme(l,h){return this.createFromParsedTheme(p(l),h)}static createFromParsedTheme(l,h){return(function(s,e){s.sort(((_,I)=>{let w=f.strcmp(_.scope,I.scope);return w!==0?w:(w=f.strArrCmp(_.parentScopes,I.parentScopes),w!==0?w:_.index-I.index)}));let n=0,o="#000000",t="#ffffff";for(;s.length>=1&&s[0].scope==="";){let _=s.shift();_.fontStyle!==-1&&(n=_.fontStyle),_.foreground!==null&&(o=_.foreground),_.background!==null&&(t=_.background)}let r=new u(e),a=new c(n,r.getId(o),r.getId(t)),d=new g(new S(0,null,-1,0,0),[]);for(let _=0,I=s.length;_<I;_++){let w=s[_];d.insert(0,w.scope,w.parentScopes,w.fontStyle,r.getId(w.foreground),r.getId(w.background))}return new P(r,a,d)})(l,h)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(l){if(l===null)return this._defaults;const h=l.scopeName,s=this._cachedMatchRoot.get(h).find((e=>(function(n,o){if(o.length===0)return!0;for(let t=0;t<o.length;t++){let r=o[t],a=!1;if(r===">"){if(t===o.length-1)return!1;r=o[++t],a=!0}for(;n&&!b(n.scopeName,r);){if(a)return!1;n=n.parent}if(!n)return!1;n=n.parent}return!0})(l.parent,e.parentScopes)));return s?new c(s.fontStyle,s.foreground,s.background):null}}i.Theme=P;class m{constructor(l,h){this.parent=l,this.scopeName=h}static push(l,h){for(const s of h)l=new m(l,s);return l}static from(...l){let h=null;for(let s=0;s<l.length;s++)h=new m(h,l[s]);return h}push(l){return new m(this,l)}getSegments(){let l=this;const h=[];for(;l;)h.push(l.scopeName),l=l.parent;return h.reverse(),h}toString(){return this.getSegments().join(" ")}extends(l){return this===l||this.parent!==null&&this.parent.extends(l)}getExtensionIfDefined(l){const h=[];let s=this;for(;s&&s!==l;)h.push(s.scopeName),s=s.parent;return s===l?h.reverse():void 0}}function b(C,l){return l===C||C.startsWith(l)&&C[l.length]==="."}i.ScopeStack=m;class c{constructor(l,h,s){this.fontStyle=l,this.foregroundId=h,this.backgroundId=s}}function p(C){if(!C)return[];if(!C.settings||!Array.isArray(C.settings))return[];let l=C.settings,h=[],s=0;for(let e=0,n=l.length;e<n;e++){let o,t=l[e];if(!t.settings)continue;if(typeof t.scope=="string"){let _=t.scope;_=_.replace(/^[,]+/,""),_=_.replace(/[,]+$/,""),o=_.split(",")}else o=Array.isArray(t.scope)?t.scope:[""];let r=-1;if(typeof t.settings.fontStyle=="string"){r=0;let _=t.settings.fontStyle.split(" ");for(let I=0,w=_.length;I<w;I++)switch(_[I]){case"italic":r|=1;break;case"bold":r|=2;break;case"underline":r|=4;break;case"strikethrough":r|=8}}let a=null;typeof t.settings.foreground=="string"&&f.isValidHexColor(t.settings.foreground)&&(a=t.settings.foreground);let d=null;typeof t.settings.background=="string"&&f.isValidHexColor(t.settings.background)&&(d=t.settings.background);for(let _=0,I=o.length;_<I;_++){let w=o[_].trim().split(" "),v=w[w.length-1],T=null;w.length>1&&(T=w.slice(0,w.length-1),T.reverse()),h[s++]=new R(v,T,e,r,a,d)}}return h}i.StyleAttributes=c,i.parseTheme=p;class R{constructor(l,h,s,e,n,o){this.scope=l,this.parentScopes=h,this.index=s,this.fontStyle=e,this.foreground=n,this.background=o}}i.ParsedThemeRule=R,i.fontStyleToString=function(C){if(C===-1)return"not set";let l="";return 1&C&&(l+="italic "),2&C&&(l+="bold "),4&C&&(l+="underline "),8&C&&(l+="strikethrough "),l===""&&(l="none"),l.trim()};class u{constructor(l){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(l)){this._isFrozen=!0;for(let h=0,s=l.length;h<s;h++)this._color2id[l[h]]=h,this._id2color[h]=l[h]}else this._isFrozen=!1}getId(l){if(l===null)return 0;l=l.toUpperCase();let h=this._color2id[l];if(h)return h;if(this._isFrozen)throw new Error(`Missing color in color map - ${l}`);return h=++this._lastColorId,this._color2id[l]=h,this._id2color[h]=l,h}getColorMap(){return this._id2color.slice(0)}}i.ColorMap=u;const y=Object.freeze([]);class S{constructor(l,h,s,e,n){this.scopeDepth=l,this.parentScopes=h||y,this.fontStyle=s,this.foreground=e,this.background=n}clone(){return new S(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(l){let h=[];for(let s=0,e=l.length;s<e;s++)h[s]=l[s].clone();return h}acceptOverwrite(l,h,s,e){this.scopeDepth>l?console.log("how did this happen?"):this.scopeDepth=l,h!==-1&&(this.fontStyle=h),s!==0&&(this.foreground=s),e!==0&&(this.background=e)}}i.ThemeTrieElementRule=S;class g{constructor(l,h=[],s={}){this._mainRule=l,this._children=s,this._rulesWithParentScopes=h}static _cmpBySpecificity(l,h){if(l.scopeDepth!==h.scopeDepth)return h.scopeDepth-l.scopeDepth;let s=0,e=0;for(;l.parentScopes[s]===">"&&s++,h.parentScopes[e]===">"&&e++,!(s>=l.parentScopes.length||e>=h.parentScopes.length);){const n=h.parentScopes[e].length-l.parentScopes[s].length;if(n!==0)return n;s++,e++}return h.parentScopes.length-l.parentScopes.length}match(l){if(l!==""){let s,e,n=l.indexOf(".");if(n===-1?(s=l,e=""):(s=l.substring(0,n),e=l.substring(n+1)),this._children.hasOwnProperty(s))return this._children[s].match(e)}const h=this._rulesWithParentScopes.concat(this._mainRule);return h.sort(g._cmpBySpecificity),h}insert(l,h,s,e,n,o){if(h==="")return void this._doInsertHere(l,s,e,n,o);let t,r,a,d=h.indexOf(".");d===-1?(t=h,r=""):(t=h.substring(0,d),r=h.substring(d+1)),this._children.hasOwnProperty(t)?a=this._children[t]:(a=new g(this._mainRule.clone(),S.cloneArr(this._rulesWithParentScopes)),this._children[t]=a),a.insert(l+1,r,s,e,n,o)}_doInsertHere(l,h,s,e,n){if(h!==null){for(let o=0,t=this._rulesWithParentScopes.length;o<t;o++){let r=this._rulesWithParentScopes[o];if(f.strArrCmp(r.parentScopes,h)===0)return void r.acceptOverwrite(l,s,e,n)}s===-1&&(s=this._mainRule.fontStyle),e===0&&(e=this._mainRule.foreground),n===0&&(n=this._mainRule.background),this._rulesWithParentScopes.push(new S(l,h,s,e,n))}else this._mainRule.acceptOverwrite(l,s,e,n)}}i.ThemeTrieElement=g},807:(B,i)=>{function A(m){return Array.isArray(m)?(function(b){let c=[];for(let p=0,R=b.length;p<R;p++)c[p]=A(b[p]);return c})(m):typeof m=="object"?(function(b){let c={};for(let p in b)c[p]=A(b[p]);return c})(m):m}Object.defineProperty(i,"__esModule",{value:!0}),i.performanceNow=i.CachedFn=i.escapeRegExpCharacters=i.isValidHexColor=i.strArrCmp=i.strcmp=i.RegexSource=i.basename=i.mergeObjects=i.clone=void 0,i.clone=function(m){return A(m)},i.mergeObjects=function(m,...b){return b.forEach((c=>{for(let p in c)m[p]=c[p]})),m},i.basename=function m(b){const c=~b.lastIndexOf("/")||~b.lastIndexOf("\\");return c===0?b:~c==b.length-1?m(b.substring(0,b.length-1)):b.substr(1+~c)};let f=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;function P(m,b){return m<b?-1:m>b?1:0}i.RegexSource=class{static hasCaptures(m){return m!==null&&(f.lastIndex=0,f.test(m))}static replaceCaptures(m,b,c){return m.replace(f,((p,R,u,y)=>{let S=c[parseInt(R||u,10)];if(!S)return p;{let g=b.substring(S.start,S.end);for(;g[0]===".";)g=g.substring(1);switch(y){case"downcase":return g.toLowerCase();case"upcase":return g.toUpperCase();default:return g}}}))}},i.strcmp=P,i.strArrCmp=function(m,b){if(m===null&&b===null)return 0;if(!m)return-1;if(!b)return 1;let c=m.length,p=b.length;if(c===p){for(let R=0;R<c;R++){let u=P(m[R],b[R]);if(u!==0)return u}return 0}return c-p},i.isValidHexColor=function(m){return!!(/^#[0-9a-f]{6}$/i.test(m)||/^#[0-9a-f]{8}$/i.test(m)||/^#[0-9a-f]{3}$/i.test(m)||/^#[0-9a-f]{4}$/i.test(m))},i.escapeRegExpCharacters=function(m){return m.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")},i.CachedFn=class{constructor(m){this.fn=m,this.cache=new Map}get(m){if(this.cache.has(m))return this.cache.get(m);const b=this.fn(m);return this.cache.set(m,b),b}},i.performanceNow=typeof performance>"u"?function(){return Date.now()}:function(){return performance.now()}}},z={};return(function B(i){var A=z[i];if(A!==void 0)return A.exports;var f=z[i]={exports:{}};return U[i].call(f.exports,f,f.exports,B),f.exports})(625)})()))})(ie)),ie.exports}var pe=ye(),Se=ge(pe),Ce=_e({__proto__:null,default:Se},[pe]);export{Ce as m};
@@ -0,0 +1 @@
1
+ import{tR as _t}from"./index-DSexFukl.js";function yt(j,V){for(var R=0;R<V.length;R++){const w=V[R];if(typeof w!="string"&&!Array.isArray(w)){for(const A in w)if(A!=="default"&&!(A in j)){const h=Object.getOwnPropertyDescriptor(w,A);h&&Object.defineProperty(j,A,h.get?h:{enumerable:!0,get:()=>w[A]})}}}return Object.freeze(Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}))}var z={exports:{}},vt=z.exports,X;function wt(){return X||(X=1,(function(j,V){(function(R,w){j.exports=w()})(vt,(()=>{return R={770:function(A,h,O){var U=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(h,"__esModule",{value:!0}),h.setDefaultDebugCall=h.createOnigScanner=h.createOnigString=h.loadWASM=h.OnigScanner=h.OnigString=void 0;const D=U(O(418));let t=null,W=!1;class E{static _utf8ByteLength(e){let f=0;for(let c=0,p=e.length;c<p;c++){const s=e.charCodeAt(c);let i=s,o=!1;if(s>=55296&&s<=56319&&c+1<p){const a=e.charCodeAt(c+1);a>=56320&&a<=57343&&(i=65536+(s-55296<<10)|a-56320,o=!0)}f+=i<=127?1:i<=2047?2:i<=65535?3:4,o&&c++}return f}constructor(e){const f=e.length,c=E._utf8ByteLength(e),p=c!==f,s=p?new Uint32Array(f+1):null;p&&(s[f]=c);const i=p?new Uint32Array(c+1):null;p&&(i[c]=f);const o=new Uint8Array(c);let a=0;for(let u=0;u<f;u++){const S=e.charCodeAt(u);let l=S,b=!1;if(S>=55296&&S<=56319&&u+1<f){const x=e.charCodeAt(u+1);x>=56320&&x<=57343&&(l=65536+(S-55296<<10)|x-56320,b=!0)}p&&(s[u]=a,b&&(s[u+1]=a),l<=127?i[a+0]=u:l<=2047?(i[a+0]=u,i[a+1]=u):l<=65535?(i[a+0]=u,i[a+1]=u,i[a+2]=u):(i[a+0]=u,i[a+1]=u,i[a+2]=u,i[a+3]=u)),l<=127?o[a++]=l:l<=2047?(o[a++]=192|(1984&l)>>>6,o[a++]=128|(63&l)>>>0):l<=65535?(o[a++]=224|(61440&l)>>>12,o[a++]=128|(4032&l)>>>6,o[a++]=128|(63&l)>>>0):(o[a++]=240|(1835008&l)>>>18,o[a++]=128|(258048&l)>>>12,o[a++]=128|(4032&l)>>>6,o[a++]=128|(63&l)>>>0),b&&u++}this.utf16Length=f,this.utf8Length=c,this.utf16Value=e,this.utf8Value=o,this.utf16OffsetToUtf8=s,this.utf8OffsetToUtf16=i}createString(e){const f=e._omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,f),f}}class _{constructor(e){if(this.id=++_.LAST_ID,!t)throw new Error("Must invoke loadWASM first.");this._onigBinding=t,this.content=e;const f=new E(e);this.utf16Length=f.utf16Length,this.utf8Length=f.utf8Length,this.utf16OffsetToUtf8=f.utf16OffsetToUtf8,this.utf8OffsetToUtf16=f.utf8OffsetToUtf16,this.utf8Length<1e4&&!_._sharedPtrInUse?(_._sharedPtr||(_._sharedPtr=t._omalloc(1e4)),_._sharedPtrInUse=!0,t.HEAPU8.set(f.utf8Value,_._sharedPtr),this.ptr=_._sharedPtr):this.ptr=f.createString(t)}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===_._sharedPtr?_._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}h.OnigString=_,_.LAST_ID=0,_._sharedPtr=0,_._sharedPtrInUse=!1;class H{constructor(e){if(!t)throw new Error("Must invoke loadWASM first.");const f=[],c=[];for(let o=0,a=e.length;o<a;o++){const u=new E(e[o]);f[o]=u.createString(t),c[o]=u.utf8Length}const p=t._omalloc(4*e.length);t.HEAPU32.set(f,p/4);const s=t._omalloc(4*e.length);t.HEAPU32.set(c,s/4);const i=t._createOnigScanner(p,s,e.length);for(let o=0,a=e.length;o<a;o++)t._ofree(f[o]);t._ofree(s),t._ofree(p),i===0&&(function(o){throw new Error(o.UTF8ToString(o._getLastOnigError()))})(t),this._onigBinding=t,this._ptr=i}dispose(){this._onigBinding._freeOnigScanner(this._ptr)}findNextMatchSync(e,f,c){let p=W,s=0;if(typeof c=="number"?(8&c&&(p=!0),s=c):typeof c=="boolean"&&(p=c),typeof e=="string"){e=new _(e);const i=this._findNextMatchSync(e,f,p,s);return e.dispose(),i}return this._findNextMatchSync(e,f,p,s)}_findNextMatchSync(e,f,c,p){const s=this._onigBinding;let i;if(i=c?s._findNextOnigScannerMatchDbg(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(f),p):s._findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(f),p),i===0)return null;const o=s.HEAPU32;let a=i/4;const u=o[a++],S=o[a++];let l=[];for(let b=0;b<S;b++){const x=e.convertUtf8OffsetToUtf16(o[a++]),B=e.convertUtf8OffsetToUtf16(o[a++]);l[b]={start:x,end:B,length:B-x}}return{index:u,captureIndices:l}}}h.OnigScanner=H;let M=!1,T=null;h.loadWASM=function(m){if(M)return T;let e,f,c,p;if(M=!0,(function(s){return typeof s.instantiator=="function"})(m))e=m.instantiator,f=m.print;else{let s;(function(i){return i.data!==void 0})(m)?(s=m.data,f=m.print):s=m,e=(function(i){return typeof Response<"u"&&i instanceof Response})(s)?typeof WebAssembly.instantiateStreaming=="function"?(function(i){return o=>WebAssembly.instantiateStreaming(i,o)})(s):(function(i){return async o=>{const a=await i.arrayBuffer();return WebAssembly.instantiate(a,o)}})(s):(function(i){return o=>WebAssembly.instantiate(i,o)})(s)}return T=new Promise(((s,i)=>{c=s,p=i})),(function(s,i,o,a){(0,D.default)({print:i,instantiateWasm:(u,S)=>{if(typeof performance>"u"){const l=()=>Date.now();u.env.emscripten_get_now=l,u.wasi_snapshot_preview1.emscripten_get_now=l}return s(u).then((l=>S(l.instance)),a),{}}}).then((u=>{t=u,o()}))})(e,f,c,p),T},h.createOnigString=function(m){return new _(m)},h.createOnigScanner=function(m){return new H(m)},h.setDefaultDebugCall=function(m){W=m}},418:A=>{var h=(typeof document<"u"&&document.currentScript&&document.currentScript.src,function(O){var U,D,t=(O=O||{})!==void 0?O:{};t.ready=new Promise((function(n,r){U=n,D=r}));var W,E=Object.assign({},t),_="";function H(n){return t.locateFile?t.locateFile(n,_):_+n}W=function(n){let r;return typeof readbuffer=="function"?new Uint8Array(readbuffer(n)):(r=read(n,"binary"),c(typeof r=="object"),r)},typeof scriptArgs<"u"&&scriptArgs,typeof onig_print<"u"&&(typeof console>"u"&&(console={}),console.log=onig_print,console.warn=console.error=typeof printErr<"u"?printErr:onig_print);var M,T,m=t.print||console.log.bind(console),e=t.printErr||console.warn.bind(console);Object.assign(t,E),E=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit,t.wasmBinary&&(M=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&F("no native wasm support detected");var f=!1;function c(n,r){n||F(r)}var p,s,i,o=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function a(n,r,y){for(var P=r+y,g=r;n[g]&&!(g>=P);)++g;if(g-r>16&&n.buffer&&o)return o.decode(n.subarray(r,g));for(var d="";r<g;){var v=n[r++];if(128&v){var C=63&n[r++];if((224&v)!=192){var N=63&n[r++];if((v=(240&v)==224?(15&v)<<12|C<<6|N:(7&v)<<18|C<<12|N<<6|63&n[r++])<65536)d+=String.fromCharCode(v);else{var Q=v-65536;d+=String.fromCharCode(55296|Q>>10,56320|1023&Q)}}else d+=String.fromCharCode((31&v)<<6|C)}else d+=String.fromCharCode(v)}return d}function u(n,r){return n?a(s,n,r):""}function S(n){p=n,t.HEAP8=new Int8Array(n),t.HEAP16=new Int16Array(n),t.HEAP32=new Int32Array(n),t.HEAPU8=s=new Uint8Array(n),t.HEAPU16=new Uint16Array(n),t.HEAPU32=i=new Uint32Array(n),t.HEAPF32=new Float32Array(n),t.HEAPF64=new Float64Array(n)}t.INITIAL_MEMORY;var l=[],b=[],x=[];function B(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)et(t.preRun.shift());$(l)}function tt(){$(b)}function nt(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)it(t.postRun.shift());$(x)}function et(n){l.unshift(n)}function rt(n){b.unshift(n)}function it(n){x.unshift(n)}var L=0,k=null;function ot(n){L++,t.monitorRunDependencies&&t.monitorRunDependencies(L)}function at(n){if(L--,t.monitorRunDependencies&&t.monitorRunDependencies(L),L==0&&k){var r=k;k=null,r()}}function F(n){t.onAbort&&t.onAbort(n),e(n="Aborted("+n+")"),f=!0,n+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(n);throw D(r),r}var I,Y,st="data:application/octet-stream;base64,";function G(n){return n.startsWith(st)}function ft(n){try{if(n==I&&M)return new Uint8Array(M);if(W)return W(n);throw"both async and sync fetching of the wasm failed"}catch(r){F(r)}}function ut(){return Promise.resolve().then((function(){return ft(I)}))}function ct(){var n={env:J,wasi_snapshot_preview1:J};function r(g,d){var v=g.exports;t.asm=v,S((T=t.asm.memory).buffer),t.asm.__indirect_function_table,rt(t.asm.__wasm_call_ctors),at()}function y(g){r(g.instance)}function P(g){return ut().then((function(d){return WebAssembly.instantiate(d,n)})).then((function(d){return d})).then(g,(function(d){e("failed to asynchronously prepare wasm: "+d),F(d)}))}if(ot(),t.instantiateWasm)try{return t.instantiateWasm(n,r)}catch(g){e("Module.instantiateWasm callback failed with error: "+g),D(g)}return(M||typeof WebAssembly.instantiateStreaming!="function"||G(I)||typeof fetch!="function"?P(y):fetch(I,{credentials:"same-origin"}).then((function(g){return WebAssembly.instantiateStreaming(g,n).then(y,(function(d){return e("wasm streaming compile failed: "+d),e("falling back to ArrayBuffer instantiation"),P(y)}))}))).catch(D),{}}function $(n){for(;n.length>0;)n.shift()(t)}function lt(n,r,y){s.copyWithin(n,r,r+y)}function pt(n){try{return T.grow(n-p.byteLength+65535>>>16),S(T.buffer),1}catch{}}function gt(n){var r,y=s.length,P=2147483648;if((n>>>=0)>P)return!1;for(var g=1;g<=4;g*=2){var d=y*(1+.2/g);if(d=Math.min(d,n+100663296),pt(Math.min(P,(r=Math.max(n,d))+(65536-r%65536)%65536)))return!0}return!1}G(I="onig.wasm")||(I=H(I)),Y=typeof dateNow<"u"?dateNow:()=>performance.now();var ht=[null,[],[]];function dt(n,r){var y=ht[n];r===0||r===10?((n===1?m:e)(a(y,0)),y.length=0):y.push(r)}function mt(n,r,y,P){for(var g=0,d=0;d<y;d++){var v=i[r>>2],C=i[r+4>>2];r+=8;for(var N=0;N<C;N++)dt(n,s[v+N]);g+=C}return i[P>>2]=g,0}var q,J={emscripten_get_now:Y,emscripten_memcpy_big:lt,emscripten_resize_heap:gt,fd_write:mt};function K(n){function r(){q||(q=!0,t.calledRun=!0,f||(tt(),U(t),t.onRuntimeInitialized&&t.onRuntimeInitialized(),nt()))}L>0||(B(),L>0||(t.setStatus?(t.setStatus("Running..."),setTimeout((function(){setTimeout((function(){t.setStatus("")}),1),r()}),1)):r()))}if(ct(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.__wasm_call_ctors).apply(null,arguments)},t.___errno_location=function(){return(t.___errno_location=t.asm.__errno_location).apply(null,arguments)},t._omalloc=function(){return(t._omalloc=t.asm.omalloc).apply(null,arguments)},t._ofree=function(){return(t._ofree=t.asm.ofree).apply(null,arguments)},t._getLastOnigError=function(){return(t._getLastOnigError=t.asm.getLastOnigError).apply(null,arguments)},t._createOnigScanner=function(){return(t._createOnigScanner=t.asm.createOnigScanner).apply(null,arguments)},t._freeOnigScanner=function(){return(t._freeOnigScanner=t.asm.freeOnigScanner).apply(null,arguments)},t._findNextOnigScannerMatch=function(){return(t._findNextOnigScannerMatch=t.asm.findNextOnigScannerMatch).apply(null,arguments)},t._findNextOnigScannerMatchDbg=function(){return(t._findNextOnigScannerMatchDbg=t.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},t.stackSave=function(){return(t.stackSave=t.asm.stackSave).apply(null,arguments)},t.stackRestore=function(){return(t.stackRestore=t.asm.stackRestore).apply(null,arguments)},t.stackAlloc=function(){return(t.stackAlloc=t.asm.stackAlloc).apply(null,arguments)},t.dynCall_jiji=function(){return(t.dynCall_jiji=t.asm.dynCall_jiji).apply(null,arguments)},t.UTF8ToString=u,k=function n(){q||K(),q||(k=n)},t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();return K(),O.ready});A.exports=h}},w={},(function A(h){var O=w[h];if(O!==void 0)return O.exports;var U=w[h]={exports:{}};return R[h].call(U.exports,U,U.exports,A),U.exports})(770);var R,w}))})(z)),z.exports}var Z=wt();const St=_t(Z),bt=yt({__proto__:null,default:St},[Z]);export{bt as m};