7 lines
39 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["vendors-node_modules_monaco-editor_esm_vs_language_json_jsonMode_js"],{"./node_modules/monaco-editor/esm/vs/language/json/jsonMode.js":function(Kt,ce,K){K.r(ce),K.d(ce,{CompletionAdapter:function(){return Be},DefinitionAdapter:function(){return yt},DiagnosticsAdapter:function(){return ze},DocumentColorAdapter:function(){return et},DocumentFormattingEditProvider:function(){return Qe},DocumentHighlightAdapter:function(){return St},DocumentLinkAdapter:function(){return Mt},DocumentRangeFormattingEditProvider:function(){return Ze},DocumentSymbolAdapter:function(){return Ye},FoldingRangeAdapter:function(){return tt},HoverAdapter:function(){return Xe},ReferenceAdapter:function(){return Tt},RenameAdapter:function(){return Dt},SelectionRangeAdapter:function(){return rt},WorkerManager:function(){return fe},fromPosition:function(){return P},fromRange:function(){return oe},getWorker:function(){return qt},setupMode:function(){return $t},toRange:function(){return w},toTextEdit:function(){return N}});var dt=K("include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js");var ft=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,gt=Object.getOwnPropertyNames,ht=Object.prototype.hasOwnProperty,de=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of gt(n))!ht.call(e,t)&&t!==i&&ft(e,t,{get:()=>n[t],enumerable:!(r=lt(n,t))||r.enumerable});return e},vt=(e,n,i)=>(de(e,n,"default"),i&&de(i,n,"default")),f={};vt(f,dt);var pt=2*60*1e3,fe=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){if(!this._worker)return;Date.now()-this._lastUsedTime>pt&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=f.editor.createWebWorker({moduleId:"vs/language/json/jsonWorker",label:this._defaults.languageId,createData:{languageSettings:this._defaults.diagnosticsOptions,languageId:this._defaults.languageId,enableSchemaRequest:this._defaults.diagnosticsOptions.enableSchemaRequest}}),this._client=this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let n;return this._getClient().then(i=>{n=i}).then(i=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(i=>n)}},le;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647})(le||(le={}));var q;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647})(q||(q={}));var y;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=q.MAX_VALUE),t===Number.MAX_VALUE&&(t=q.MAX_VALUE),{line:r,character:t}}e.create=n;function i(r){var t=r;return s.objectLiteral(t)&&s.uinteger(t.line)&&s.uinteger(t.character)}e.is=i})(y||(y={}));var _;(function(e){function n(r,t,a,o){if(s.uinteger(r)&&s.uinteger(t)&&s.uinteger(a)&&s.uinteger(o))return{start:y.create(r,t),end:y.create(a,o)};if(y.is(r)&&y.is(t))return{start:r,end:t};throw new Error("Range#create called with invalid arguments["+r+", "+t+", "+a+", "+o+"]")}e.create=n;function i(r){var t=r;return s.objectLiteral(t)&&y.is(t.start)&&y.is(t.end)}e.is=i})(_||(_={}));var ee;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&_.is(t.range)&&(s.string(t.uri)||s.undefined(t.uri))}e.is=i})(ee||(ee={}));var ge;(function(e){function n(r,t,a,o){return{targetUri:r,targetRange:t,targetSelectionRange:a,originSelectionRange:o}}e.create=n;function i(r){var t=r;return s.defined(t)&&_.is(t.targetRange)&&s.string(t.targetUri)&&(_.is(t.targetSelectionRange)||s.undefined(t.targetSelectionRange))&&(_.is(t.originSelectionRange)||s.undefined(t.originSelectionRange))}e.is=i})(ge||(ge={}));var te;(function(e){function n(r,t,a,o){return{red:r,green:t,blue:a,alpha:o}}e.create=n;function i(r
`,a==="\r"&&t+1<i.length&&i.charAt(t+1)===`
`&&t++}r&&i.length>0&&n.push(i.length),this._lineOffsets=n}return this._lineOffsets},e.prototype.positionAt=function(n){n=Math.max(Math.min(n,this._content.length),0);var i=this.getLineOffsets(),r=0,t=i.length;if(t===0)return y.create(0,n);for(;r<t;){var a=Math.floor((r+t)/2);i[a]>n?t=a:r=a+1}var o=r-1;return y.create(o,n-i[o])},e.prototype.offsetAt=function(n){var i=this.getLineOffsets();if(n.line>=i.length)return this._content.length;if(n.line<0)return 0;var r=i[n.line],t=n.line+1<i.length?i[n.line+1]:this._content.length;return Math.max(Math.min(r+n.character,t),r)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}(),s;(function(e){var n=Object.prototype.toString;function i(h){return typeof h<"u"}e.defined=i;function r(h){return typeof h>"u"}e.undefined=r;function t(h){return h===!0||h===!1}e.boolean=t;function a(h){return n.call(h)==="[object String]"}e.string=a;function o(h){return n.call(h)==="[object Number]"}e.number=o;function u(h,T,O){return n.call(h)==="[object Number]"&&T<=h&&h<=O}e.numberRange=u;function l(h){return n.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}e.integer=l;function c(h){return n.call(h)==="[object Number]"&&0<=h&&h<=2147483647}e.uinteger=c;function v(h){return n.call(h)==="[object Function]"}e.func=v;function g(h){return h!==null&&typeof h=="object"}e.objectLiteral=g;function b(h,T){return Array.isArray(h)&&h.every(T)}e.typedArray=b})(s||(s={}));var ze=class{constructor(e,n,i){this._languageId=e,this._worker=n,this._disposables=[],this._listener=Object.create(null);const r=a=>{let o=a.getLanguageId();if(o!==this._languageId)return;let u;this._listener[a.uri.toString()]=a.onDidChangeContent(()=>{window.clearTimeout(u),u=window.setTimeout(()=>this._doValidate(a.uri,o),500)}),this._doValidate(a.uri,o)},t=a=>{f.editor.setModelMarkers(a,this._languageId,[]);let o=a.uri.toString(),u=this._listener[o];u&&(u.dispose(),delete this._listener[o])};this._disposables.push(f.editor.onDidCreateModel(r)),this._disposables.push(f.editor.onWillDisposeModel(t)),this._disposables.push(f.editor.onDidChangeModelLanguage(a=>{t(a.model),r(a.model)})),this._disposables.push(i(a=>{f.editor.getModels().forEach(o=>{o.getLanguageId()===this._languageId&&(t(o),r(o))})})),this._disposables.push({dispose:()=>{f.editor.getModels().forEach(t);for(let a in this._listener)this._listener[a].dispose()}}),f.editor.getModels().forEach(r)}dispose(){this._disposables.forEach(e=>e&&e.dispose()),this._disposables.length=0}_doValidate(e,n){this._worker(e).then(i=>i.doValidation(e.toString())).then(i=>{const r=i.map(a=>kt(e,a));let t=f.editor.getModel(e);t&&t.getLanguageId()===n&&f.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function _t(e){switch(e){case M.Error:return f.MarkerSeverity.Error;case M.Warning:return f.MarkerSeverity.Warning;case M.Information:return f.MarkerSeverity.Info;case M.Hint:return f.MarkerSeverity.Hint;default:return f.MarkerSeverity.Info}}function kt(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:_t(n.severity),startLineNumber:n.range.start.line+1,startColumn:n.range.start.character+1,endLineNumber:n.range.end.line+1,endColumn:n.range.end.character+1,message:n.message,code:i,source:n.source}}var Be=class{constructor(e,n){this._worker=e,this._triggerCharacters=n}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.doComplete(t.toString(),P(n))).then(a=>{if(!a)return;const o=e.getWordUntilPosition(n),u=new f.Range(n.lineNumber,o.startColumn,n.lineNumber,o.endColumn),l=a.items.map(c=>{const v={label:c.label,insertText:c.insertText||c.label,sortText:c.sortText,filterText:c.filterText,documentation:c.documentation,detail:c.detail,command:bt(c.command),range:u,kind:Ct(c.kind)};return c.textEdit&&(wt(c.textEdit)?v.range={insert:w(c.textEdit.insert),replace:w(c.textEdit.replace)}:v.range=w(c.textEdit.range),v.insertText=c.textEdit.newText),c.additionalTextEdits&&(v.additionalTextEdits=c.additi
`+e.value+"\n```\n"}}function At(e){if(e)return Array.isArray(e)?e.map(Je):[Je(e)]}var St=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),P(n))).then(t=>{if(t)return t.map(a=>({range:w(a.range),kind:It(a.kind)}))})}};function It(e){switch(e){case z.Read:return f.languages.DocumentHighlightKind.Read;case z.Write:return f.languages.DocumentHighlightKind.Write;case z.Text:return f.languages.DocumentHighlightKind.Text}return f.languages.DocumentHighlightKind.Text}var yt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),P(n))).then(t=>{if(t)return[qe(t)]})}};function qe(e){return{uri:f.Uri.parse(e.uri),range:w(e.range)}}var Tt=class{constructor(e){this._worker=e}provideReferences(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.findReferences(t.toString(),P(n))).then(a=>{if(a)return a.map(qe)})}},Dt=class{constructor(e){this._worker=e}provideRenameEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.doRename(t.toString(),P(n),i)).then(a=>Rt(a))}};function Rt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=f.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:w(t.range),text:t.newText}})}return{edits:n}}var Ye=class{constructor(e){this._worker=e}provideDocumentSymbols(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentSymbols(i.toString())).then(r=>{if(r)return r.map(t=>Pt(t)?$e(t):{name:t.name,detail:"",containerName:t.containerName,kind:Ge(t.kind),range:w(t.location.range),selectionRange:w(t.location.range),tags:[]})})}};function Pt(e){return"children"in e}function $e(e){return{name:e.name,detail:e.detail??"",kind:Ge(e.kind),range:w(e.range),selectionRange:w(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>$e(n))}}function Ge(e){let n=f.languages.SymbolKind;switch(e){case m.File:return n.File;case m.Module:return n.Module;case m.Namespace:return n.Namespace;case m.Package:return n.Package;case m.Class:return n.Class;case m.Method:return n.Method;case m.Property:return n.Property;case m.Field:return n.Field;case m.Constructor:return n.Constructor;case m.Enum:return n.Enum;case m.Interface:return n.Interface;case m.Function:return n.Function;case m.Variable:return n.Variable;case m.Constant:return n.Constant;case m.String:return n.String;case m.Number:return n.Number;case m.Boolean:return n.Boolean;case m.Array:return n.Array}return n.Function}var Mt=class{constructor(e){this._worker=e}provideLinks(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentLinks(i.toString())).then(r=>{if(r)return{links:r.map(t=>({range:w(t.range),url:t.target}))}})}},Qe=class{constructor(e){this._worker=e}provideDocumentFormattingEdits(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.format(r.toString(),null,Ke(n)).then(a=>{if(!(!a||a.length===0))return a.map(N)}))}},Ze=class{constructor(e){this._worker=e,this.canFormatMultipleRanges=!1}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.format(t.toString(),oe(n),Ke(i)).then(o=>{if(!(!o||o.length===0))return o.map(N)}))}};function Ke(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var et=class{constructor(e){this._worker=e}provideDocumentColors(e,n){const i=e.uri;return this._worker(i).then(r=>r.findDocumentColors(i.toString())).then(r=>{if(r)return r.map(t=>({color:t.color,range:w(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,oe(n.range))).then(t=>{if(t)return t.map(a=>{let o={label:a.label};return a.textEdit&&(o.textEdit=N(a.textEdit)),a.additionalTextEdits&&(o.additionalTextEdits=a.additionalTextEdits.map(N)),o})})}},tt=class{constructor(e){this._worker=e}provideFoldingRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getFoldingRanges(r.toString(),n)).then(t=>{if(t)return t.map(a=>{const o={start:a.startLine+1,end:a.endLine+1};return typeo
`;break;case 114:d+="\r";break;case 116:d+=" ";break;case 117:var C=b(4,!0);C>=0?d+=String.fromCharCode(C):g=4;break;default:g=5}E=r;continue}if(I>=0&&I<=31)if(B(I)){d+=e.substring(E,r),g=2;break}else g=6;r++}return d}function J(){if(t="",g=0,a=r,l=u,v=c,r>=i)return a=i,o=17;var d=e.charCodeAt(r);if(se(d)){do r++,t+=String.fromCharCode(d),d=e.charCodeAt(r);while(se(d));return o=15}if(B(d))return r++,t+=String.fromCharCode(d),d===13&&e.charCodeAt(r)===10&&(r++,t+=`
`),u++,c=r,o=14;switch(d){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,t=O(),o=10;case 47:var E=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<i&&!B(e.charCodeAt(r));)r++;return t=e.substring(E,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;for(var I=i-1,A=!1;r<I;){var C=e.charCodeAt(r);if(C===42&&e.charCodeAt(r+1)===47){r+=2,A=!0;break}r++,B(C)&&(C===13&&e.charCodeAt(r)===10&&r++,u++,c=r)}return A||(r++,g=1),t=e.substring(E,r),o=13}return t+=String.fromCharCode(d),r++,o=16;case 45:if(t+=String.fromCharCode(d),r++,r===i||!j(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return t+=T(),o=11;default:for(;r<i&&Qt(d);)r++,d=e.charCodeAt(r);if(a!==r){switch(t=e.substring(a,r),t){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return t+=String.fromCharCode(d),r++,o=16}}function Qt(d){if(se(d)||B(d))return!1;switch(d){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function Zt(){var d;do d=J();while(d>=12&&d<=15);return d}return{setPosition:h,getPosition:function(){return r},scan:n?Zt:J,getToken:function(){return o},getTokenValue:function(){return t},getTokenOffset:function(){return a},getTokenLength:function(){return r-a},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return a-v},getTokenError:function(){return g}}}function se(e){return e===32||e===9||e===11||e===12||e===160||e===5760||e>=8192&&e<=8203||e===8239||e===8287||e===12288||e===65279}function B(e){return e===10||e===13||e===8232||e===8233}function j(e){return e>=48&&e<=57}var nt;(function(e){e.DEFAULT={allowTrailingComma:!1}})(nt||(nt={}));var jt=Nt;function Ot(e){return{getInitialState:()=>new ot(null,null,!1,null),tokenize:(n,i)=>Jt(e,n,i)}}var it="delimiter.bracket.json",at="delimiter.array.json",Ft="delimiter.colon.json",xt="delimiter.comma.json",Wt="keyword.json",Ut="keyword.json",Vt="string.value.json",Ht="number.json",zt="string.key.json",Bt="comment.block.json",Xt="comment.line.json",X=class ct{constructor(n,i){this.parent=n,this.type=i}static pop(n){return n?n.parent:null}static push(n,i){return new ct(n,i)}static equals(n,i){if(!n&&!i)return!0;if(!n||!i)return!1;for(;n&&i;){if(n===i)return!0;if(n.type!==i.type)return!1;n=n.parent,i=i.parent}return!0}},ot=class ue{constructor(n,i,r,t){this._state=n,this.scanError=i,this.lastWasColon=r,this.parents=t}clone(){return new ue(this._state,this.scanError,this.lastWasColon,this.parents)}equals(n){return n===this?!0:!n||!(n instanceof ue)?!1:this.scanError===n.scanError&&this.lastWasColon===n.lastWasColon&&X.equals(this.parents,n.parents)}getStateData(){return this._state}setStateData(n){this._state=n}};function Jt(e,n,i,r=0){let t=0,a=!1;switch(i.scanError){case 2:n='"'+n,t=1;break;case 1:n="/*"+n,t=2;break}const o=jt(n);let u=i.lastWasColon,l=i.parents;const c={tokens:[],endState:i.clone()};for(;;){let v=r+o.getPosition(),g="";const b=o.scan();if(b===17)break;if(v===r+o.getPosition())throw new Error("Scanner did not advance, next 3 characters are: "+n.substr(o.getPosition(),3));switch(a&&(v-=t),a=t>0,b){case 1:l=X.push(l,0),g=it,u=!1;break;case 2:l=X.pop(l),g=it,u=!1;break;case 3:l=X.push(l,1),g=at,u=!1;break;case 4:l=X.pop(l),g=at,u=!1;break;case 6:g=Ft,u=!0;break;case 5:g=xt,u=!1;break;case 8:case 9:g=Wt,u=!1;break;case 7:g=Ut,u=!1;break;case 10:const T=(l?l.type:0)===1;g=u||T?Vt:zt,u=!1;break;case 11:g=Ht,u=!1;break}if(e)switch(b){case 12:g=Xt;break;case 13:g=Bt;break}c.endState=new ot(i.getStateData(),o.getTokenError(),u,l),c.tokens.push({startIndex:v,scopes:g})}return c}var S;function qt(){return new Promise((e,n)=>{if(!S)return n("JSON not registered!");e(S)})}var Yt=class extends ze{constructor(e,n,i){super(e,n,i.onDidChange),this._disposables.push(f.editor.onWillDisposeModel(r=>{this._resetSchema(r.uri)})),this._disposables.push(f.editor.onDidChangeModelLanguage(r=>{this._resetSchema(r.model.uri)}))}_resetSchema(e){this._worker().then(n=>{n.resetSchema(e.