5 lines
34 KiB
JavaScript
5 lines
34 KiB
JavaScript
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["vendors-node_modules_monaco-editor_esm_vs_language_html_htmlMode_js"],{"./node_modules/monaco-editor/esm/vs/language/html/htmlMode.js":function(Et,se,z){z.r(se),z.d(se,{CompletionAdapter:function(){return Oe},DefinitionAdapter:function(){return lt},DiagnosticsAdapter:function(){return it},DocumentColorAdapter:function(){return mt},DocumentFormattingEditProvider:function(){return ne},DocumentHighlightAdapter:function(){return K},DocumentLinkAdapter:function(){return re},DocumentRangeFormattingEditProvider:function(){return ie},DocumentSymbolAdapter:function(){return te},FoldingRangeAdapter:function(){return ae},HoverAdapter:function(){return q},ReferenceAdapter:function(){return ht},RenameAdapter:function(){return ee},SelectionRangeAdapter:function(){return oe},WorkerManager:function(){return X},fromPosition:function(){return x},fromRange:function(){return Z},setupMode:function(){return kt},setupMode1:function(){return wt},toRange:function(){return _},toTextEdit:function(){return I}});var Ye=z("include-loader!./node_modules/monaco-editor/esm/vs/editor/editor.api.js");var Ze=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,Ke=Object.getOwnPropertyNames,et=Object.prototype.hasOwnProperty,ue=(e,n,i,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of Ke(n))!et.call(e,t)&&t!==i&&Ze(e,t,{get:()=>n[t],enumerable:!(r=qe(n,t))||r.enumerable});return e},tt=(e,n,i)=>(ue(e,n,"default"),i&&ue(i,n,"default")),c={};tt(c,Ye);var rt=2*60*1e3,X=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>rt&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=c.editor.createWebWorker({moduleId:"vs/language/html/htmlWorker",createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),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)}},ce;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647})(ce||(ce={}));var j;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647})(j||(j={}));var k;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=j.MAX_VALUE),t===Number.MAX_VALUE&&(t=j.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})(k||(k={}));var p;(function(e){function n(r,t,a,o){if(s.uinteger(r)&&s.uinteger(t)&&s.uinteger(a)&&s.uinteger(o))return{start:k.create(r,t),end:k.create(a,o)};if(k.is(r)&&k.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)&&k.is(t.start)&&k.is(t.end)}e.is=i})(p||(p={}));var B;(function(e){function n(r,t){return{uri:r,range:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&p.is(t.range)&&(s.string(t.uri)||s.undefined(t.uri))}e.is=i})(B||(B={}));var de;(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)&&p.is(t.targetRange)&&s.string(t.targetUri)&&(p.is(t.targetSelectionRange)||s.undefined(t.targetSelectionRange))&&(p.is(t.originSelectionRange)||s.undefined(t.originSelectionRange))}e.is=i})(de||(de={}));var $;(function(e){function n(r,t,a,o){return{red:r,green:t,blue:a,alpha:o}}e.create=n;function i(r){var t=r;return s.numberRange(t.red,0,1)&&s.numberRange(t.green,0,1)&&s.numberRange(t.blue,0
|
||
|
`,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 k.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 k.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(f){return typeof f<"u"}e.defined=i;function r(f){return typeof f>"u"}e.undefined=r;function t(f){return f===!0||f===!1}e.boolean=t;function a(f){return n.call(f)==="[object String]"}e.string=a;function o(f){return n.call(f)==="[object Number]"}e.number=o;function u(f,P,V){return n.call(f)==="[object Number]"&&P<=f&&f<=V}e.numberRange=u;function g(f){return n.call(f)==="[object Number]"&&-2147483648<=f&&f<=2147483647}e.integer=g;function d(f){return n.call(f)==="[object Number]"&&0<=f&&f<=2147483647}e.uinteger=d;function v(f){return n.call(f)==="[object Function]"}e.func=v;function w(f){return f!==null&&typeof f=="object"}e.objectLiteral=w;function E(f,P){return Array.isArray(f)&&f.every(P)}e.typedArray=E})(s||(s={}));var it=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=>{c.editor.setModelMarkers(a,this._languageId,[]);let o=a.uri.toString(),u=this._listener[o];u&&(u.dispose(),delete this._listener[o])};this._disposables.push(c.editor.onDidCreateModel(r)),this._disposables.push(c.editor.onWillDisposeModel(t)),this._disposables.push(c.editor.onDidChangeModelLanguage(a=>{t(a.model),r(a.model)})),this._disposables.push(i(a=>{c.editor.getModels().forEach(o=>{o.getLanguageId()===this._languageId&&(t(o),r(o))})})),this._disposables.push({dispose:()=>{c.editor.getModels().forEach(t);for(let a in this._listener)this._listener[a].dispose()}}),c.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=>ot(e,a));let t=c.editor.getModel(e);t&&t.getLanguageId()===n&&c.editor.setModelMarkers(t,n,r)}).then(void 0,i=>{console.error(i)})}};function at(e){switch(e){case C.Error:return c.MarkerSeverity.Error;case C.Warning:return c.MarkerSeverity.Warning;case C.Information:return c.MarkerSeverity.Info;case C.Hint:return c.MarkerSeverity.Hint;default:return c.MarkerSeverity.Info}}function ot(e,n){let i=typeof n.code=="number"?String(n.code):n.code;return{severity:at(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 Oe=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(),x(n))).then(a=>{if(!a)return;const o=e.getWordUntilPosition(n),u=new c.Range(n.lineNumber,o.startColumn,n.lineNumber,o.endColumn),g=a.items.map(d=>{const v={label:d.label,insertText:d.insertText||d.label,sortText:d.sortText,filterText:d.filterText,documentation:d.documentation,detail:d.detail,command:ct(d.command),range:u,kind:ut(d.kind)};return d.textEdit&&(st(d.textEdit)?v.range={insert:_(d.textEdit.insert),replace:_(d.textEdit.replace)}:v.range=_(d.textEdit.range),v.insertText=d.textEdit.newText),d.additionalTextEdits&&(v.additionalTextEdits=d.additi
|
||
|
`+e.value+"\n```\n"}}function ft(e){if(e)return Array.isArray(e)?e.map(Ue):[Ue(e)]}var K=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),x(n))).then(t=>{if(t)return t.map(a=>({range:_(a.range),kind:gt(a.kind)}))})}};function gt(e){switch(e){case L.Read:return c.languages.DocumentHighlightKind.Read;case L.Write:return c.languages.DocumentHighlightKind.Write;case L.Text:return c.languages.DocumentHighlightKind.Text}return c.languages.DocumentHighlightKind.Text}var lt=class{constructor(e){this._worker=e}provideDefinition(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDefinition(r.toString(),x(n))).then(t=>{if(t)return[Ve(t)]})}};function Ve(e){return{uri:c.Uri.parse(e.uri),range:_(e.range)}}var ht=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(),x(n))).then(a=>{if(a)return a.map(Ve)})}},ee=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(),x(n),i)).then(a=>vt(a))}};function vt(e){if(!e||!e.changes)return;let n=[];for(let i in e.changes){const r=c.Uri.parse(i);for(let t of e.changes[i])n.push({resource:r,versionId:void 0,textEdit:{range:_(t.range),text:t.newText}})}return{edits:n}}var te=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)?ze(t):{name:t.name,detail:"",containerName:t.containerName,kind:Xe(t.kind),range:_(t.location.range),selectionRange:_(t.location.range),tags:[]})})}};function pt(e){return"children"in e}function ze(e){return{name:e.name,detail:e.detail??"",kind:Xe(e.kind),range:_(e.range),selectionRange:_(e.selectionRange),tags:e.tags??[],children:(e.children??[]).map(n=>ze(n))}}function Xe(e){let n=c.languages.SymbolKind;switch(e){case h.File:return n.File;case h.Module:return n.Module;case h.Namespace:return n.Namespace;case h.Package:return n.Package;case h.Class:return n.Class;case h.Method:return n.Method;case h.Property:return n.Property;case h.Field:return n.Field;case h.Constructor:return n.Constructor;case h.Enum:return n.Enum;case h.Interface:return n.Interface;case h.Function:return n.Function;case h.Variable:return n.Variable;case h.Constant:return n.Constant;case h.String:return n.String;case h.Number:return n.Number;case h.Boolean:return n.Boolean;case h.Array:return n.Array}return n.Function}var re=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:_(t.range),url:t.target}))}})}},ne=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,Be(n)).then(a=>{if(!(!a||a.length===0))return a.map(I)}))}},ie=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(),Z(n),Be(i)).then(o=>{if(!(!o||o.length===0))return o.map(I)}))}};function Be(e){return{tabSize:e.tabSize,insertSpaces:e.insertSpaces}}var mt=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:_(t.range)}))})}provideColorPresentations(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getColorPresentations(r.toString(),n.color,Z(n.range))).then(t=>{if(t)return t.map(a=>{let o={label:a.label};return a.textEdit&&(o.textEdit=I(a.textEdit)),a.additionalTextEdits&&(o.additionalTextEdits=a.additionalTextEdits.map(I)),o})})}},ae=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 typeof a
|