gitea_hat/public/js/monaco-language-htmlmode.9c...

5 lines
34 KiB
JavaScript

"use strict";var Et=Object.defineProperty;var bt=(P,k,b)=>k in P?Et(P,k,{enumerable:!0,configurable:!0,writable:!0,value:b}):P[k]=b;var C=(P,k,b)=>(bt(P,typeof k!="symbol"?k+"":k,b),b);(self.webpackChunkgitea=self.webpackChunkgitea||[]).push([["vendors-node_modules_monaco-editor_esm_vs_language_html_htmlMode_js"],{"./node_modules/monaco-editor/esm/vs/language/html/htmlMode.js":function(P,k,b){b.r(k),b.d(k,{CompletionAdapter:function(){return Ve},DefinitionAdapter:function(){return lt},DiagnosticsAdapter:function(){return it},DocumentColorAdapter:function(){return mt},DocumentFormattingEditProvider:function(){return oe},DocumentHighlightAdapter:function(){return re},DocumentLinkAdapter:function(){return ae},DocumentRangeFormattingEditProvider:function(){return se},DocumentSymbolAdapter:function(){return ie},FoldingRangeAdapter:function(){return ue},HoverAdapter:function(){return te},ReferenceAdapter:function(){return ht},RenameAdapter:function(){return ne},SelectionRangeAdapter:function(){return ce},WorkerManager:function(){return Q},fromPosition:function(){return I},fromRange:function(){return ee},setupMode:function(){return kt},setupMode1:function(){return wt},toRange:function(){return _},toTextEdit:function(){return M}});var Ye=b("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,de=(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)=>(de(e,n,"default"),i&&de(i,n,"default")),c={};tt(c,Ye);var rt=2*60*1e3,Q=class{constructor(e){C(this,"_defaults");C(this,"_idleCheckInterval");C(this,"_lastUsedTime");C(this,"_configChangeListener");C(this,"_worker");C(this,"_client");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)}},fe;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647})(fe||(fe={}));var O;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647})(O||(O={}));var E;(function(e){function n(r,t){return r===Number.MAX_VALUE&&(r=O.MAX_VALUE),t===Number.MAX_VALUE&&(t=O.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})(E||(E={}));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:E.create(r,t),end:E.create(a,o)};if(E.is(r)&&E.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)&&E.is(t.start)&&E.is(t.end)}e.is=i})(p||(p={}));var G;(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})(G||(G={}));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)&&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})(ge||(ge={}));var J;(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,1)&&s.numberRange(t.alpha,0,1)}e.is=i})(J||(J={}));var le;(function(e){function n(r,t){return{range:r,color:t}}e.create=n;function i(r){var t=r;return p.is(t.range)&&J.is(t.color)}e.is=i})(le||(le={}));var he;(function(e){function n(r,t,a){return{label:r,textEdit:t,additionalTextEdits:a}}e.create=n;function i(r){var t=r;return s.string(t.label)&&(s.undefined(t.textEdit)||x.is(t))&&(s.undefined(t.additionalTextEdits)||s.typedArray(t.additionalTextEdits,x.is))}e.is=i})(he||(he={}));var T;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(T||(T={}));var ve;(function(e){function n(r,t,a,o,u){var g={startLine:r,endLine:t};return s.defined(a)&&(g.startCharacter=a),s.defined(o)&&(g.endCharacter=o),s.defined(u)&&(g.kind=u),g}e.create=n;function i(r){var t=r;return s.uinteger(t.startLine)&&s.uinteger(t.startLine)&&(s.undefined(t.startCharacter)||s.uinteger(t.startCharacter))&&(s.undefined(t.endCharacter)||s.uinteger(t.endCharacter))&&(s.undefined(t.kind)||s.string(t.kind))}e.is=i})(ve||(ve={}));var Y;(function(e){function n(r,t){return{location:r,message:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&G.is(t.location)&&s.string(t.message)}e.is=i})(Y||(Y={}));var R;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(R||(R={}));var pe;(function(e){e.Unnecessary=1,e.Deprecated=2})(pe||(pe={}));var me;(function(e){function n(i){var r=i;return r!=null&&s.string(r.href)}e.is=n})(me||(me={}));var U;(function(e){function n(r,t,a,o,u,g){var d={range:r,message:t};return s.defined(a)&&(d.severity=a),s.defined(o)&&(d.code=o),s.defined(u)&&(d.source=u),s.defined(g)&&(d.relatedInformation=g),d}e.create=n;function i(r){var t,a=r;return s.defined(a)&&p.is(a.range)&&s.string(a.message)&&(s.number(a.severity)||s.undefined(a.severity))&&(s.integer(a.code)||s.string(a.code)||s.undefined(a.code))&&(s.undefined(a.codeDescription)||s.string((t=a.codeDescription)===null||t===void 0?void 0:t.href))&&(s.string(a.source)||s.undefined(a.source))&&(s.undefined(a.relatedInformation)||s.typedArray(a.relatedInformation,Y.is))}e.is=i})(U||(U={}));var F;(function(e){function n(r,t){for(var a=[],o=2;o<arguments.length;o++)a[o-2]=arguments[o];var u={title:r,command:t};return s.defined(a)&&a.length>0&&(u.arguments=a),u}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.title)&&s.string(t.command)}e.is=i})(F||(F={}));var x;(function(e){function n(a,o){return{range:a,newText:o}}e.replace=n;function i(a,o){return{range:{start:a,end:a},newText:o}}e.insert=i;function r(a){return{range:a,newText:""}}e.del=r;function t(a){var o=a;return s.objectLiteral(o)&&s.string(o.newText)&&p.is(o.range)}e.is=t})(x||(x={}));var D;(function(e){function n(r,t,a){var o={label:r};return t!==void 0&&(o.needsConfirmation=t),a!==void 0&&(o.description=a),o}e.create=n;function i(r){var t=r;return t!==void 0&&s.objectLiteral(t)&&s.string(t.label)&&(s.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(s.string(t.description)||t.description===void 0)}e.is=i})(D||(D={}));var m;(function(e){function n(i){var r=i;return typeof r=="string"}e.is=n})(m||(m={}));var y;(function(e){function n(a,o,u){return{range:a,newText:o,annotationId:u}}e.replace=n;function i(a,o,u){return{range:{start:a,end:a},newText:o,annotationId:u}}e.insert=i;function r(a,o){return{range:a,newText:"",annotationId:o}}e.del=r;function t(a){var o=a;return x.is(o)&&(D.is(o.annotationId)||m.is(o.annotationId))}e.is=t})(y||(y={}));var V;(function(e){function n(r,t){return{textDocument:r,edits:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&X.is(t.textDocument)&&Array.isArray(t.edits)}e.is=i})(V||(V={}));var L;(function(e){function n(r,t,a){var o={kind:"create",uri:r};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(o.options=t),a!==void 0&&(o.annotationId=a),o}e.create=n;function i(r){var t=r;return t&&t.kind==="create"&&s.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||s.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||s.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(L||(L={}));var j;(function(e){function n(r,t,a,o){var u={kind:"rename",oldUri:r,newUri:t};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(u.options=a),o!==void 0&&(u.annotationId=o),u}e.create=n;function i(r){var t=r;return t&&t.kind==="rename"&&s.string(t.oldUri)&&s.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||s.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||s.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(j||(j={}));var N;(function(e){function n(r,t,a){var o={kind:"delete",uri:r};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(o.options=t),a!==void 0&&(o.annotationId=a),o}e.create=n;function i(r){var t=r;return t&&t.kind==="delete"&&s.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||s.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||s.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||m.is(t.annotationId))}e.is=i})(N||(N={}));var Z;(function(e){function n(i){var r=i;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(function(t){return s.string(t.kind)?L.is(t)||j.is(t)||N.is(t):V.is(t)}))}e.is=n})(Z||(Z={}));var z=function(){function e(n,i){this.edits=n,this.changeAnnotations=i}return e.prototype.insert=function(n,i,r){var t,a;if(r===void 0?t=x.insert(n,i):m.is(r)?(a=r,t=y.insert(n,i,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),t=y.insert(n,i,a)),this.edits.push(t),a!==void 0)return a},e.prototype.replace=function(n,i,r){var t,a;if(r===void 0?t=x.replace(n,i):m.is(r)?(a=r,t=y.replace(n,i,r)):(this.assertChangeAnnotations(this.changeAnnotations),a=this.changeAnnotations.manage(r),t=y.replace(n,i,a)),this.edits.push(t),a!==void 0)return a},e.prototype.delete=function(n,i){var r,t;if(i===void 0?r=x.del(n):m.is(i)?(t=i,r=y.del(n,i)):(this.assertChangeAnnotations(this.changeAnnotations),t=this.changeAnnotations.manage(i),r=y.del(n,t)),this.edits.push(r),t!==void 0)return t},e.prototype.add=function(n){this.edits.push(n)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(n){if(n===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),_e=function(){function e(n){this._annotations=n===void 0?Object.create(null):n,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(n,i){var r;if(m.is(n)?r=n:(r=this.nextId(),i=n),this._annotations[r]!==void 0)throw new Error("Id "+r+" is already in use.");if(i===void 0)throw new Error("No annotation provided for id "+r);return this._annotations[r]=i,this._size++,r},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),At=function(){function e(n){var i=this;this._textEditChanges=Object.create(null),n!==void 0?(this._workspaceEdit=n,n.documentChanges?(this._changeAnnotations=new _e(n.changeAnnotations),n.changeAnnotations=this._changeAnnotations.all(),n.documentChanges.forEach(function(r){if(V.is(r)){var t=new z(r.edits,i._changeAnnotations);i._textEditChanges[r.textDocument.uri]=t}})):n.changes&&Object.keys(n.changes).forEach(function(r){var t=new z(n.changes[r]);i._textEditChanges[r]=t})):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(n){if(X.is(n)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var i={uri:n.uri,version:n.version},r=this._textEditChanges[i.uri];if(!r){var t=[],a={textDocument:i,edits:t};this._workspaceEdit.documentChanges.push(a),r=new z(t,this._changeAnnotations),this._textEditChanges[i.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var r=this._textEditChanges[n];if(!r){var t=[];this._workspaceEdit.changes[n]=t,r=new z(t),this._textEditChanges[n]=r}return r}},e.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new _e,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(n,i,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t;D.is(i)||m.is(i)?t=i:r=i;var a,o;if(t===void 0?a=L.create(n,r):(o=m.is(t)?t:this._changeAnnotations.manage(t),a=L.create(n,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},e.prototype.renameFile=function(n,i,r,t){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var a;D.is(r)||m.is(r)?a=r:t=r;var o,u;if(a===void 0?o=j.create(n,i,t):(u=m.is(a)?a:this._changeAnnotations.manage(a),o=j.create(n,i,t,u)),this._workspaceEdit.documentChanges.push(o),u!==void 0)return u},e.prototype.deleteFile=function(n,i,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var t;D.is(i)||m.is(i)?t=i:r=i;var a,o;if(t===void 0?a=N.create(n,r):(o=m.is(t)?t:this._changeAnnotations.manage(t),a=N.create(n,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},e}(),we;(function(e){function n(r){return{uri:r}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)}e.is=i})(we||(we={}));var ke;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&s.integer(t.version)}e.is=i})(ke||(ke={}));var X;(function(e){function n(r,t){return{uri:r,version:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&(t.version===null||s.integer(t.version))}e.is=i})(X||(X={}));var Ee;(function(e){function n(r,t,a,o){return{uri:r,languageId:t,version:a,text:o}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.string(t.uri)&&s.string(t.languageId)&&s.integer(t.version)&&s.string(t.text)}e.is=i})(Ee||(Ee={}));var W;(function(e){e.PlainText="plaintext",e.Markdown="markdown"})(W||(W={})),function(e){function n(i){var r=i;return r===e.PlainText||r===e.Markdown}e.is=n}(W||(W={}));var q;(function(e){function n(i){var r=i;return s.objectLiteral(i)&&W.is(r.kind)&&s.string(r.value)}e.is=n})(q||(q={}));var l;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(l||(l={}));var K;(function(e){e.PlainText=1,e.Snippet=2})(K||(K={}));var be;(function(e){e.Deprecated=1})(be||(be={}));var Ae;(function(e){function n(r,t,a){return{newText:r,insert:t,replace:a}}e.create=n;function i(r){var t=r;return t&&s.string(t.newText)&&p.is(t.insert)&&p.is(t.replace)}e.is=i})(Ae||(Ae={}));var Ce;(function(e){e.asIs=1,e.adjustIndentation=2})(Ce||(Ce={}));var xe;(function(e){function n(i){return{label:i}}e.create=n})(xe||(xe={}));var ye;(function(e){function n(i,r){return{items:i||[],isIncomplete:!!r}}e.create=n})(ye||(ye={}));var B;(function(e){function n(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=n;function i(r){var t=r;return s.string(t)||s.objectLiteral(t)&&s.string(t.language)&&s.string(t.value)}e.is=i})(B||(B={}));var Ie;(function(e){function n(i){var r=i;return!!r&&s.objectLiteral(r)&&(q.is(r.contents)||B.is(r.contents)||s.typedArray(r.contents,B.is))&&(i.range===void 0||p.is(i.range))}e.is=n})(Ie||(Ie={}));var Pe;(function(e){function n(i,r){return r?{label:i,documentation:r}:{label:i}}e.create=n})(Pe||(Pe={}));var Re;(function(e){function n(i,r){for(var t=[],a=2;a<arguments.length;a++)t[a-2]=arguments[a];var o={label:i};return s.defined(r)&&(o.documentation=r),s.defined(t)?o.parameters=t:o.parameters=[],o}e.create=n})(Re||(Re={}));var H;(function(e){e.Text=1,e.Read=2,e.Write=3})(H||(H={}));var De;(function(e){function n(i,r){var t={range:i};return s.number(r)&&(t.kind=r),t}e.create=n})(De||(De={}));var h;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(h||(h={}));var Me;(function(e){e.Deprecated=1})(Me||(Me={}));var Se;(function(e){function n(i,r,t,a,o){var u={name:i,kind:r,location:{uri:a,range:t}};return o&&(u.containerName=o),u}e.create=n})(Se||(Se={}));var Te;(function(e){function n(r,t,a,o,u,g){var d={name:r,detail:t,kind:a,range:o,selectionRange:u};return g!==void 0&&(d.children=g),d}e.create=n;function i(r){var t=r;return t&&s.string(t.name)&&s.number(t.kind)&&p.is(t.range)&&p.is(t.selectionRange)&&(t.detail===void 0||s.string(t.detail))&&(t.deprecated===void 0||s.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}e.is=i})(Te||(Te={}));var Fe;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"})(Fe||(Fe={}));var Le;(function(e){function n(r,t){var a={diagnostics:r};return t!=null&&(a.only=t),a}e.create=n;function i(r){var t=r;return s.defined(t)&&s.typedArray(t.diagnostics,U.is)&&(t.only===void 0||s.typedArray(t.only,s.string))}e.is=i})(Le||(Le={}));var je;(function(e){function n(r,t,a){var o={title:r},u=!0;return typeof t=="string"?(u=!1,o.kind=t):F.is(t)?o.command=t:o.edit=t,u&&a!==void 0&&(o.kind=a),o}e.create=n;function i(r){var t=r;return t&&s.string(t.title)&&(t.diagnostics===void 0||s.typedArray(t.diagnostics,U.is))&&(t.kind===void 0||s.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||F.is(t.command))&&(t.isPreferred===void 0||s.boolean(t.isPreferred))&&(t.edit===void 0||Z.is(t.edit))}e.is=i})(je||(je={}));var Ne;(function(e){function n(r,t){var a={range:r};return s.defined(t)&&(a.data=t),a}e.create=n;function i(r){var t=r;return s.defined(t)&&p.is(t.range)&&(s.undefined(t.command)||F.is(t.command))}e.is=i})(Ne||(Ne={}));var We;(function(e){function n(r,t){return{tabSize:r,insertSpaces:t}}e.create=n;function i(r){var t=r;return s.defined(t)&&s.uinteger(t.tabSize)&&s.boolean(t.insertSpaces)}e.is=i})(We||(We={}));var He;(function(e){function n(r,t,a){return{range:r,target:t,data:a}}e.create=n;function i(r){var t=r;return s.defined(t)&&p.is(t.range)&&(s.undefined(t.target)||s.string(t.target))}e.is=i})(He||(He={}));var Oe;(function(e){function n(r,t){return{range:r,parent:t}}e.create=n;function i(r){var t=r;return t!==void 0&&p.is(t.range)&&(t.parent===void 0||e.is(t.parent))}e.is=i})(Oe||(Oe={}));var Ue;(function(e){function n(a,o,u,g){return new nt(a,o,u,g)}e.create=n;function i(a){var o=a;return!!(s.defined(o)&&s.string(o.uri)&&(s.undefined(o.languageId)||s.string(o.languageId))&&s.uinteger(o.lineCount)&&s.func(o.getText)&&s.func(o.positionAt)&&s.func(o.offsetAt))}e.is=i;function r(a,o){for(var u=a.getText(),g=t(o,function(S,$){var Je=S.range.start.line-$.range.start.line;return Je===0?S.range.start.character-$.range.start.character:Je}),d=u.length,v=g.length-1;v>=0;v--){var w=g[v],A=a.offsetAt(w.range.start),f=a.offsetAt(w.range.end);if(f<=d)u=u.substring(0,A)+w.newText+u.substring(f,u.length);else throw new Error("Overlapping edit");d=A}return u}e.applyEdits=r;function t(a,o){if(a.length<=1)return a;var u=a.length/2|0,g=a.slice(0,u),d=a.slice(u);t(g,o),t(d,o);for(var v=0,w=0,A=0;v<g.length&&w<d.length;){var f=o(g[v],d[w]);f<=0?a[A++]=g[v++]:a[A++]=d[w++]}for(;v<g.length;)a[A++]=g[v++];for(;w<d.length;)a[A++]=d[w++];return a}})(Ue||(Ue={}));var nt=function(){function e(n,i,r,t){this._uri=n,this._languageId=i,this._version=r,this._content=t,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(n){if(n){var i=this.offsetAt(n.start),r=this.offsetAt(n.end);return this._content.substring(i,r)}return this._content},e.prototype.update=function(n,i){this._content=n.text,this._version=i,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var n=[],i=this._content,r=!0,t=0;t<i.length;t++){r&&(n.push(t),r=!1);var a=i.charAt(t);r=a==="\r"||a===`
`,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 E.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 E.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!="undefined"}e.defined=i;function r(f){return typeof f=="undefined"}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,S,$){return n.call(f)==="[object Number]"&&S<=f&&f<=$}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 A(f,S){return Array.isArray(f)&&f.every(S)}e.typedArray=A})(s||(s={}));var it=class{constructor(e,n,i){C(this,"_disposables",[]);C(this,"_listener",Object.create(null));this._languageId=e,this._worker=n;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 R.Error:return c.MarkerSeverity.Error;case R.Warning:return c.MarkerSeverity.Warning;case R.Information:return c.MarkerSeverity.Info;case R.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 Ve=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(),I(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.additionalTextEdits.map(M)),d.insertTextFormat===K.Snippet&&(v.insertTextRules=c.languages.CompletionItemInsertTextRule.InsertAsSnippet),v});return{isIncomplete:a.isIncomplete,suggestions:g}})}};function I(e){if(!!e)return{character:e.column-1,line:e.lineNumber-1}}function ee(e){if(!!e)return{start:{line:e.startLineNumber-1,character:e.startColumn-1},end:{line:e.endLineNumber-1,character:e.endColumn-1}}}function _(e){if(!!e)return new c.Range(e.start.line+1,e.start.character+1,e.end.line+1,e.end.character+1)}function st(e){return typeof e.insert!="undefined"&&typeof e.replace!="undefined"}function ut(e){const n=c.languages.CompletionItemKind;switch(e){case l.Text:return n.Text;case l.Method:return n.Method;case l.Function:return n.Function;case l.Constructor:return n.Constructor;case l.Field:return n.Field;case l.Variable:return n.Variable;case l.Class:return n.Class;case l.Interface:return n.Interface;case l.Module:return n.Module;case l.Property:return n.Property;case l.Unit:return n.Unit;case l.Value:return n.Value;case l.Enum:return n.Enum;case l.Keyword:return n.Keyword;case l.Snippet:return n.Snippet;case l.Color:return n.Color;case l.File:return n.File;case l.Reference:return n.Reference}return n.Property}function M(e){if(!!e)return{range:_(e.range),text:e.newText}}function ct(e){return e&&e.command==="editor.action.triggerSuggest"?{id:e.command,title:e.title,arguments:e.arguments}:void 0}var te=class{constructor(e){this._worker=e}provideHover(e,n,i){let r=e.uri;return this._worker(r).then(t=>t.doHover(r.toString(),I(n))).then(t=>{if(!!t)return{range:_(t.range),contents:ft(t.contents)}})}};function dt(e){return e&&typeof e=="object"&&typeof e.kind=="string"}function ze(e){return typeof e=="string"?{value:e}:dt(e)?e.kind==="plaintext"?{value:e.value.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}:{value:e.value}:{value:"```"+e.language+`
`+e.value+"\n```\n"}}function ft(e){if(!!e)return Array.isArray(e)?e.map(ze):[ze(e)]}var re=class{constructor(e){this._worker=e}provideDocumentHighlights(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.findDocumentHighlights(r.toString(),I(n))).then(t=>{if(!!t)return t.map(a=>({range:_(a.range),kind:gt(a.kind)}))})}};function gt(e){switch(e){case H.Read:return c.languages.DocumentHighlightKind.Read;case H.Write:return c.languages.DocumentHighlightKind.Write;case H.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(),I(n))).then(t=>{if(!!t)return[Xe(t)]})}};function Xe(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(),I(n))).then(a=>{if(!!a)return a.map(Xe)})}},ne=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(),I(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 ie=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=>({name:t.name,detail:"",containerName:t.containerName,kind:pt(t.kind),range:_(t.location.range),selectionRange:_(t.location.range),tags:[]}))})}};function pt(e){let n=c.languages.SymbolKind;switch(e){case h.File:return n.Array;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 ae=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}))}})}},oe=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(M)}))}},se=class{constructor(e){this._worker=e}provideDocumentRangeFormattingEdits(e,n,i,r){const t=e.uri;return this._worker(t).then(a=>a.format(t.toString(),ee(n),Be(i)).then(o=>{if(!(!o||o.length===0))return o.map(M)}))}};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,ee(n.range))).then(t=>{if(!!t)return t.map(a=>{let o={label:a.label};return a.textEdit&&(o.textEdit=M(a.textEdit)),a.additionalTextEdits&&(o.additionalTextEdits=a.additionalTextEdits.map(M)),o})})}},ue=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.kind!="undefined"&&(o.kind=_t(a.kind)),o})})}};function _t(e){switch(e){case T.Comment:return c.languages.FoldingRangeKind.Comment;case T.Imports:return c.languages.FoldingRangeKind.Imports;case T.Region:return c.languages.FoldingRangeKind.Region}}var ce=class{constructor(e){this._worker=e}provideSelectionRanges(e,n,i){const r=e.uri;return this._worker(r).then(t=>t.getSelectionRanges(r.toString(),n.map(I))).then(t=>{if(!!t)return t.map(a=>{const o=[];for(;a;)o.push({range:_(a.range)}),a=a.parent;return o})})}},$e=class extends Ve{constructor(e){super(e,[".",":","<",'"',"=","/"])}};function wt(e){const n=new Q(e),i=(...t)=>n.getLanguageServiceWorker(...t);let r=e.languageId;c.languages.registerCompletionItemProvider(r,new $e(i)),c.languages.registerHoverProvider(r,new te(i)),c.languages.registerDocumentHighlightProvider(r,new re(i)),c.languages.registerLinkProvider(r,new ae(i)),c.languages.registerFoldingRangeProvider(r,new ue(i)),c.languages.registerDocumentSymbolProvider(r,new ie(i)),c.languages.registerSelectionRangeProvider(r,new ce(i)),c.languages.registerRenameProvider(r,new ne(i)),r==="html"&&(c.languages.registerDocumentFormattingEditProvider(r,new oe(i)),c.languages.registerDocumentRangeFormattingEditProvider(r,new se(i)))}function kt(e){const n=[],i=[],r=new Q(e);n.push(r);const t=(...o)=>r.getLanguageServiceWorker(...o);function a(){const{languageId:o,modeConfiguration:u}=e;Ge(i),u.completionItems&&i.push(c.languages.registerCompletionItemProvider(o,new $e(t))),u.hovers&&i.push(c.languages.registerHoverProvider(o,new te(t))),u.documentHighlights&&i.push(c.languages.registerDocumentHighlightProvider(o,new re(t))),u.links&&i.push(c.languages.registerLinkProvider(o,new ae(t))),u.documentSymbols&&i.push(c.languages.registerDocumentSymbolProvider(o,new ie(t))),u.rename&&i.push(c.languages.registerRenameProvider(o,new ne(t))),u.foldingRanges&&i.push(c.languages.registerFoldingRangeProvider(o,new ue(t))),u.selectionRanges&&i.push(c.languages.registerSelectionRangeProvider(o,new ce(t))),u.documentFormattingEdits&&i.push(c.languages.registerDocumentFormattingEditProvider(o,new oe(t))),u.documentRangeFormattingEdits&&i.push(c.languages.registerDocumentRangeFormattingEditProvider(o,new se(t)))}return a(),n.push(Qe(i)),Qe(n)}function Qe(e){return{dispose:()=>Ge(e)}}function Ge(e){for(;e.length;)e.pop().dispose()}}}]);