mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-13 09:18:42 +00:00
14 lines
34 KiB
JavaScript
14 lines
34 KiB
JavaScript
|
"use strict";/*!-----------------------------------------------------------------------------
|
||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||
|
* Version: 0.34.1(547870b6881302c5b4ff32173c16d06009e3588f)
|
||
|
* Released under the MIT license
|
||
|
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
|
||
|
*-----------------------------------------------------------------------------*/
|
||
|
define("vs/language/html/htmlMode", ["require","require"],(require)=>{
|
||
|
var moduleExports=(()=>{var nn=Object.create;var Q=Object.defineProperty;var tn=Object.getOwnPropertyDescriptor;var rn=Object.getOwnPropertyNames;var on=Object.getPrototypeOf,sn=Object.prototype.hasOwnProperty;var an=(n=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(n,{get:(t,i)=>(typeof require!="undefined"?require:t)[i]}):n)(function(n){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+n+'" is not supported')});var un=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),dn=(n,t)=>{for(var i in t)Q(n,i,{get:t[i],enumerable:!0})},q=(n,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of rn(t))!sn.call(n,e)&&e!==i&&Q(n,e,{get:()=>t[e],enumerable:!(r=tn(t,e))||r.enumerable});return n},he=(n,t,i)=>(q(n,t,"default"),i&&q(i,t,"default")),me=(n,t,i)=>(i=n!=null?nn(on(n)):{},q(t||!n||!n.__esModule?Q(i,"default",{value:n,enumerable:!0}):i,n)),cn=n=>q(Q({},"__esModule",{value:!0}),n);var Te=un((Ln,ve)=>{var ln=me(an("vs/editor/editor.api"));ve.exports=ln});var Rn={};dn(Rn,{CompletionAdapter:()=>B,DefinitionAdapter:()=>ce,DiagnosticsAdapter:()=>de,DocumentColorAdapter:()=>ge,DocumentFormattingEditProvider:()=>H,DocumentHighlightAdapter:()=>S,DocumentLinkAdapter:()=>A,DocumentRangeFormattingEditProvider:()=>K,DocumentSymbolAdapter:()=>M,FoldingRangeAdapter:()=>U,HoverAdapter:()=>D,ReferenceAdapter:()=>le,RenameAdapter:()=>F,SelectionRangeAdapter:()=>j,WorkerManager:()=>b,fromPosition:()=>C,fromRange:()=>fe,setupMode:()=>Pn,setupMode1:()=>En,toRange:()=>y,toTextEdit:()=>L});var d={};he(d,me(Te()));var gn=2*60*1e3,b=class{_defaults;_idleCheckInterval;_lastUsedTime;_configChangeListener;_worker;_client;constructor(t){this._defaults=t,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>gn&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||(this._worker=d.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(...t){let i;return this._getClient().then(r=>{i=r}).then(r=>{if(this._worker)return this._worker.withSyncedResources(t)}).then(r=>i)}};var ye;(function(n){n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647})(ye||(ye={}));var J;(function(n){n.MIN_VALUE=0,n.MAX_VALUE=2147483647})(J||(J={}));var x;(function(n){function t(r,e){return r===Number.MAX_VALUE&&(r=J.MAX_VALUE),e===Number.MAX_VALUE&&(e=J.MAX_VALUE),{line:r,character:e}}n.create=t;function i(r){var e=r;return a.objectLiteral(e)&&a.uinteger(e.line)&&a.uinteger(e.character)}n.is=i})(x||(x={}));var v;(function(n){function t(r,e,o,s){if(a.uinteger(r)&&a.uinteger(e)&&a.uinteger(o)&&a.uinteger(s))return{start:x.create(r,e),end:x.create(o,s)};if(x.is(r)&&x.is(e))return{start:r,end:e};throw new Error("Range#create called with invalid arguments["+r+", "+e+", "+o+", "+s+"]")}n.create=t;function i(r){var e=r;return a.objectLiteral(e)&&x.is(e.start)&&x.is(e.end)}n.is=i})(v||(v={}));var ie;(function(n){function t(r,e){return{uri:r,range:e}}n.create=t;function i(r){var e=r;return a.defined(e)&&v.is(e.range)&&(a.string(e.uri)||a.undefined(e.uri))}n.is=i})(ie||(ie={}));var xe;(function(n){function t(r,e,o,s){return{targetUri:r,targetRange:e,targetSelectionRange:o,originSelectionRange:s}}n.create=t;function i(r){var e=r;return a.defined(e)&&v.is(e.targetRange)&&a.string(e.targetUri)&&(v.is(e.targetSelectionRange)||a.undefined(e.targetSelectionRange))&&(v.is(e.originSelectionRange)||a.undefined(e.originSelectionRange))}n.is=i})(xe||(xe={}));var oe;
|
||
|
`,o==="\r"&&e+1<i.length&&i.charAt(e+1)===`
|
||
|
`&&e++}r&&i.length>0&&t.push(i.length),this._lineOffsets=t}return this._lineOffsets},n.prototype.positionAt=function(t){t=Math.max(Math.min(t,this._content.length),0);var i=this.getLineOffsets(),r=0,e=i.length;if(e===0)return x.create(0,t);for(;r<e;){var o=Math.floor((r+e)/2);i[o]>t?e=o:r=o+1}var s=r-1;return x.create(s,t-i[s])},n.prototype.offsetAt=function(t){var i=this.getLineOffsets();if(t.line>=i.length)return this._content.length;if(t.line<0)return 0;var r=i[t.line],e=t.line+1<i.length?i[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,e),r)},Object.defineProperty(n.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),n}(),a;(function(n){var t=Object.prototype.toString;function i(c){return typeof c<"u"}n.defined=i;function r(c){return typeof c>"u"}n.undefined=r;function e(c){return c===!0||c===!1}n.boolean=e;function o(c){return t.call(c)==="[object String]"}n.string=o;function s(c){return t.call(c)==="[object Number]"}n.number=s;function u(c,E,$){return t.call(c)==="[object Number]"&&E<=c&&c<=$}n.numberRange=u;function l(c){return t.call(c)==="[object Number]"&&-2147483648<=c&&c<=2147483647}n.integer=l;function f(c){return t.call(c)==="[object Number]"&&0<=c&&c<=2147483647}n.uinteger=f;function g(c){return t.call(c)==="[object Function]"}n.func=g;function m(c){return c!==null&&typeof c=="object"}n.objectLiteral=m;function k(c,E){return Array.isArray(c)&&c.every(E)}n.typedArray=k})(a||(a={}));var de=class{constructor(t,i,r){this._languageId=t;this._worker=i;let e=s=>{let u=s.getLanguageId();if(u!==this._languageId)return;let l;this._listener[s.uri.toString()]=s.onDidChangeContent(()=>{window.clearTimeout(l),l=window.setTimeout(()=>this._doValidate(s.uri,u),500)}),this._doValidate(s.uri,u)},o=s=>{d.editor.setModelMarkers(s,this._languageId,[]);let u=s.uri.toString(),l=this._listener[u];l&&(l.dispose(),delete this._listener[u])};this._disposables.push(d.editor.onDidCreateModel(e)),this._disposables.push(d.editor.onWillDisposeModel(o)),this._disposables.push(d.editor.onDidChangeModelLanguage(s=>{o(s.model),e(s.model)})),this._disposables.push(r(s=>{d.editor.getModels().forEach(u=>{u.getLanguageId()===this._languageId&&(o(u),e(u))})})),this._disposables.push({dispose:()=>{d.editor.getModels().forEach(o);for(let s in this._listener)this._listener[s].dispose()}}),d.editor.getModels().forEach(e)}_disposables=[];_listener=Object.create(null);dispose(){this._disposables.forEach(t=>t&&t.dispose()),this._disposables.length=0}_doValidate(t,i){this._worker(t).then(r=>r.doValidation(t.toString())).then(r=>{let e=r.map(s=>mn(t,s)),o=d.editor.getModel(t);o&&o.getLanguageId()===i&&d.editor.setModelMarkers(o,i,e)}).then(void 0,r=>{console.error(r)})}};function hn(n){switch(n){case w.Error:return d.MarkerSeverity.Error;case w.Warning:return d.MarkerSeverity.Warning;case w.Information:return d.MarkerSeverity.Info;case w.Hint:return d.MarkerSeverity.Hint;default:return d.MarkerSeverity.Info}}function mn(n,t){let i=typeof t.code=="number"?String(t.code):t.code;return{severity:hn(t.severity),startLineNumber:t.range.start.line+1,startColumn:t.range.start.character+1,endLineNumber:t.range.end.line+1,endColumn:t.range.end.character+1,message:t.message,code:i,source:t.source}}var B=class{constructor(t,i){this._worker=t;this._triggerCharacters=i}get triggerCharacters(){return this._triggerCharacters}provideCompletionItems(t,i,r,e){let o=t.uri;return this._worker(o).then(s=>s.doComplete(o.toString(),C(i))).then(s=>{if(!s)return;let u=t.getWordUntilPosition(i),l=new d.Range(i.lineNumber,u.startColumn,i.lineNumber,u.endColumn),f=s.items.map(g=>{let m={label:g.label,insertText:g.insertText||g.label,sortText:g.sortText,filterText:g.filterText,documentation:g.documentation,detail:g.detail,command:yn(g.command),range:l,kind:Tn(g.kind)};return g.textEdit&&(vn(g.textEdit)?m.range={insert:y(g.textEdit.insert),replace:y(g.textEdit.replace)}:m.range=y(g.textEdit.range),m.insertText=g.textEdit.newText),g.additionalTextEdits&&(m.additionalTextEdits=g.additionalTextEdits.map(L)),g.i
|
||
|
`+n.value+"\n```\n"}}function kn(n){if(!!n)return Array.isArray(n)?n.map(Ge):[Ge(n)]}var S=class{constructor(t){this._worker=t}provideDocumentHighlights(t,i,r){let e=t.uri;return this._worker(e).then(o=>o.findDocumentHighlights(e.toString(),C(i))).then(o=>{if(!!o)return o.map(s=>({range:y(s.range),kind:In(s.kind)}))})}};function In(n){switch(n){case W.Read:return d.languages.DocumentHighlightKind.Read;case W.Write:return d.languages.DocumentHighlightKind.Write;case W.Text:return d.languages.DocumentHighlightKind.Text}return d.languages.DocumentHighlightKind.Text}var ce=class{constructor(t){this._worker=t}provideDefinition(t,i,r){let e=t.uri;return this._worker(e).then(o=>o.findDefinition(e.toString(),C(i))).then(o=>{if(!!o)return[Je(o)]})}};function Je(n){return{uri:d.Uri.parse(n.uri),range:y(n.range)}}var le=class{constructor(t){this._worker=t}provideReferences(t,i,r,e){let o=t.uri;return this._worker(o).then(s=>s.findReferences(o.toString(),C(i))).then(s=>{if(!!s)return s.map(Je)})}},F=class{constructor(t){this._worker=t}provideRenameEdits(t,i,r,e){let o=t.uri;return this._worker(o).then(s=>s.doRename(o.toString(),C(i),r)).then(s=>_n(s))}};function _n(n){if(!n||!n.changes)return;let t=[];for(let i in n.changes){let r=d.Uri.parse(i);for(let e of n.changes[i])t.push({resource:r,versionId:void 0,textEdit:{range:y(e.range),text:e.newText}})}return{edits:t}}var M=class{constructor(t){this._worker=t}provideDocumentSymbols(t,i){let r=t.uri;return this._worker(r).then(e=>e.findDocumentSymbols(r.toString())).then(e=>{if(!!e)return e.map(o=>({name:o.name,detail:"",containerName:o.containerName,kind:Cn(o.kind),range:y(o.location.range),selectionRange:y(o.location.range),tags:[]}))})}};function Cn(n){let t=d.languages.SymbolKind;switch(n){case h.File:return t.Array;case h.Module:return t.Module;case h.Namespace:return t.Namespace;case h.Package:return t.Package;case h.Class:return t.Class;case h.Method:return t.Method;case h.Property:return t.Property;case h.Field:return t.Field;case h.Constructor:return t.Constructor;case h.Enum:return t.Enum;case h.Interface:return t.Interface;case h.Function:return t.Function;case h.Variable:return t.Variable;case h.Constant:return t.Constant;case h.String:return t.String;case h.Number:return t.Number;case h.Boolean:return t.Boolean;case h.Array:return t.Array}return t.Function}var A=class{constructor(t){this._worker=t}provideLinks(t,i){let r=t.uri;return this._worker(r).then(e=>e.findDocumentLinks(r.toString())).then(e=>{if(!!e)return{links:e.map(o=>({range:y(o.range),url:o.target}))}})}},H=class{constructor(t){this._worker=t}provideDocumentFormattingEdits(t,i,r){let e=t.uri;return this._worker(e).then(o=>o.format(e.toString(),null,Ye(i)).then(s=>{if(!(!s||s.length===0))return s.map(L)}))}},K=class{constructor(t){this._worker=t}provideDocumentRangeFormattingEdits(t,i,r,e){let o=t.uri;return this._worker(o).then(s=>s.format(o.toString(),fe(i),Ye(r)).then(u=>{if(!(!u||u.length===0))return u.map(L)}))}};function Ye(n){return{tabSize:n.tabSize,insertSpaces:n.insertSpaces}}var ge=class{constructor(t){this._worker=t}provideDocumentColors(t,i){let r=t.uri;return this._worker(r).then(e=>e.findDocumentColors(r.toString())).then(e=>{if(!!e)return e.map(o=>({color:o.color,range:y(o.range)}))})}provideColorPresentations(t,i,r){let e=t.uri;return this._worker(e).then(o=>o.getColorPresentations(e.toString(),i.color,fe(i.range))).then(o=>{if(!!o)return o.map(s=>{let u={label:s.label};return s.textEdit&&(u.textEdit=L(s.textEdit)),s.additionalTextEdits&&(u.additionalTextEdits=s.additionalTextEdits.map(L)),u})})}},U=class{constructor(t){this._worker=t}provideFoldingRanges(t,i,r){let e=t.uri;return this._worker(e).then(o=>o.getFoldingRanges(e.toString(),i)).then(o=>{if(!!o)return o.map(s=>{let u={start:s.startLine+1,end:s.endLine+1};return typeof s.kind<"u"&&(u.kind=bn(s.kind)),u})})}};function bn(n){switch(n){case R.Comment:return d.languages.FoldingRangeKind.Comment;case R.Imports:return d.languages.FoldingRangeKind.Imports;case R.Region:return d.languages.FoldingRangeKind.Region}}var j=class{constructor(t){t
|
||
|
return moduleExports;
|
||
|
});
|