@lcap/nasl
Version:
NetEase Application Specific Language
15 lines (13 loc) • 5.39 MB
JavaScript
(()=>{var e={5049:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=5049,e.exports=t},7150:(e,t,n)=>{"use strict";const r=n(8979);t.Z=class{options;requests;constructor(e){if(this.options=Object.assign({protocol:"vusion",sender:"platform",logLevel:"info",timeout:3e4,onlySend:!1,getSender:()=>window.parent,getReceiver:()=>window,handleMessage(e){}},e),this.requests=new Map,this.onMessageReceived=this.onMessageReceived.bind(this),this.onDataReceived=this.onDataReceived.bind(this),!this.options.onlySend){const e=this.options.getReceiver.call(this.options.context);e.addEventListener?e.addEventListener("message",this.onMessageReceived):e.addListener&&e.addListener("message",this.onDataReceived)}}destroy(){!this.options.onlySend&&this.options.getReceiver.call(this.options.context).removeEventListener("message",this.onMessageReceived)}sendMessage(e){e.logLevel||this.options.logLevel;const t=this.options.getSender.call(this.options.context);"undefined"!=typeof window&&t instanceof Window?t.postMessage(e,"*"):t.postMessage(e)}sendData(e){return this.sendMessage({protocol:this.options.protocol,sender:this.options.sender,type:"send",data:e})}sendCommand(e,...t){return this.sendMessage({protocol:this.options.protocol,sender:this.options.sender,type:"send",command:e,args:t})}requestMessage(e,t){return t&&Object.assign(e,t),this.sendMessage(e),new Promise(((t,n)=>{const r=setTimeout((()=>{this.requests.delete(e.id),n(Object.assign({error:"Timeout"},e))}),this.options.timeout||2e3);this.requests.set(e.id,Object.assign({res:n=>{this.requests.delete(e.id),clearTimeout(r),t(n)},rej:t=>{this.requests.delete(e.id),clearTimeout(r),n(t)}},e))}))}requestData(e){const t={id:(0,r.v4)(),protocol:this.options.protocol,sender:this.options.sender,type:"request",data:e};return this.requestMessage(t)}requestCommand(e,...t){const n={id:(0,r.v4)(),protocol:this.options.protocol,sender:this.options.sender,type:"request",command:e,args:t};return this.requestMessage(n)}onMessageReceived(e){e.data&&this.onDataReceived(e.data)}count=0;onDataReceived(e){if(this.count++,5===this.count&&(this.count=0,(async()=>{await new Promise((e=>setTimeout(e,30)))})()),e.protocol===this.options.protocol)if("response"!==e.type){if(e.command){const t=this.options.context[e.command];if(!t)return;let n;return n="function"==typeof t?t.call(this.options.context,...e.args,e.id):t,"request"===e.type?Promise.resolve(n).then((t=>{this.sendMessage({id:e.id,protocol:this.options.protocol,sender:this.options.sender,logLevel:e.logLevel,type:"response",command:e.command,result:t})})).catch((t=>{console.error(t),this.sendMessage({id:e.id,protocol:this.options.protocol,sender:this.options.sender,logLevel:e.logLevel,type:"response",command:e.command,error:t})})):void 0}this.options.handleMessage(e)}else{const t=this.requests.get(e.id);t&&(t.error?t.rej(e.error):t.res(e.result))}}}},9913:(e,t,n)=>{"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */var r=n(2203);function i(e){return r.existsSync(e)}e.exports=function(e){for(var t,n=0;n<e.length-1;n++)if("--cancellationPipeName"===e[n]){t=e[n+1];break}if(!t)return{isCancellationRequested:function(){return!1},setRequest:function(e){},resetRequest:function(e){}};if("*"===t.charAt(t.length-1)){var r,a,o=t.slice(0,-1);if(0===o.length||o.indexOf("*")>=0)throw new Error("Invalid name for template cancellation pipe: it should have length greater than 2 characters and contain only one '*'.");return{isCancellationRequested:function(){return void 0!==r&&i(r)},setRequest:function(e){a=e,r=o+e},resetRequest:function(e){if(a!==e)throw new Error("Mismatched request id, expected ".concat(a,", actual ").concat(e));r=void 0}}}return{isCancellationRequested:function(){return i(t)},setRequest:function(e){},resetRequest:function(e){}}}},3825:function(e,t,n){const r=n(7215),i=this&&this.__generator||function(e,t){let n,r,i,a,o={label:0,sent(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},a=this&&this.__values||function(e){const t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t];let r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:()=>(e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e})};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__extends||(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},s(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});var s,c=this&&this.__assign||function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},c.apply(this,arguments)};const l=this&&this.__rest||function(e,t){const n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n},u=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||t)};let d,p,f,m;!function(e){const t=function(){function e(e,t){if(this._keys=[],this._values=[],this._version=0,this._copyOnWrite=!1,this._comparer="object"==typeof e?e.comparer:e,this._order="object"==typeof e&&"insertion"===e.sort?[]:void 0,t){const e=o(t);try{for(let t=s(e);t;t=s(e)){const e=t.value,n=e[0],r=e[1];this.set(n,r)}}finally{c(e)}}}return Object.defineProperty(e.prototype,"size",{get(){return this._keys.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"comparer",{get(){return this._comparer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Symbol.toStringTag,{get:()=>"SortedMap",enumerable:!1,configurable:!0}),e.prototype.has=function(e){return r.binarySearch(this._keys,e,r.identity,this._comparer)>=0},e.prototype.get=function(e){const t=r.binarySearch(this._keys,e,r.identity,this._comparer);return t>=0?this._values[t]:void 0},e.prototype.getEntry=function(e){const t=r.binarySearch(this._keys,e,r.identity,this._comparer);return t>=0?[this._keys[t],this._values[t]]:void 0},e.prototype.set=function(e,t){const i=r.binarySearch(this._keys,e,r.identity,this._comparer);return i>=0?this._values[i]=t:(this.writePreamble(),n(this._keys,~i,e),n(this._values,~i,t),this._order&&n(this._order,~i,this._version),this.writePostScript()),this},e.prototype.delete=function(e){const t=r.binarySearch(this._keys,e,r.identity,this._comparer);return t>=0&&(this.writePreamble(),r.orderedRemoveItemAt(this._keys,t),r.orderedRemoveItemAt(this._values,t),this._order&&r.orderedRemoveItemAt(this._order,t),this.writePostScript(),!0)},e.prototype.clear=function(){this.size>0&&(this.writePreamble(),this._keys.length=0,this._values.length=0,this._order&&(this._order.length=0),this.writePostScript())},e.prototype.forEach=function(e,t){const n=this._keys,r=this._values,i=this.getIterationOrder(),a=this._version;this._copyOnWrite=!0;try{if(i)for(let a=0,s=i;a<s.length;a++){var o=s[a];e.call(t,r[o],n[o],this)}else for(o=0;o<n.length;o++)e.call(t,r[o],n[o],this)}finally{a===this._version&&(this._copyOnWrite=!1)}},e.prototype.keys=function(){let e,t,n,r,o,s;return i(this,(function(i){switch(i.label){case 0:e=this._keys,t=this.getIterationOrder(),n=this._version,this._copyOnWrite=!0,i.label=1;case 1:if(i.trys.push([1,,9,10]),!t)return[3,6];r=0,o=t,i.label=2;case 2:return r<o.length?(s=o[r],[4,e[s]]):[3,5];case 3:i.sent(),i.label=4;case 4:return r++,[3,2];case 5:return[3,8];case 6:return[5,a(e)];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:return n===this._version&&(this._copyOnWrite=!1),[7];case 10:return[2]}}))},e.prototype.values=function(){let e,t,n,r,o,s;return i(this,(function(i){switch(i.label){case 0:e=this._values,t=this.getIterationOrder(),n=this._version,this._copyOnWrite=!0,i.label=1;case 1:if(i.trys.push([1,,9,10]),!t)return[3,6];r=0,o=t,i.label=2;case 2:return r<o.length?(s=o[r],[4,e[s]]):[3,5];case 3:i.sent(),i.label=4;case 4:return r++,[3,2];case 5:return[3,8];case 6:return[5,a(e)];case 7:i.sent(),i.label=8;case 8:return[3,10];case 9:return n===this._version&&(this._copyOnWrite=!1),[7];case 10:return[2]}}))},e.prototype.entries=function(){let e,t,n,r,a,o;var s;return i(this,(function(i){switch(i.label){case 0:e=this._keys,t=this._values,n=this.getIterationOrder(),r=this._version,this._copyOnWrite=!0,i.label=1;case 1:if(i.trys.push([1,,11,12]),!n)return[3,6];a=0,o=n,i.label=2;case 2:return a<o.length?(s=o[a],[4,[e[s],t[s]]]):[3,5];case 3:i.sent(),i.label=4;case 4:return a++,[3,2];case 5:return[3,10];case 6:s=0,i.label=7;case 7:return s<e.length?[4,[e[s],t[s]]]:[3,10];case 8:i.sent(),i.label=9;case 9:return s++,[3,7];case 10:return[3,12];case 11:return r===this._version&&(this._copyOnWrite=!1),[7];case 12:return[2]}}))},e.prototype[Symbol.iterator]=function(){return this.entries()},e.prototype.writePreamble=function(){this._copyOnWrite&&(this._keys=this._keys.slice(),this._values=this._values.slice(),this._order&&(this._order=this._order.slice()),this._copyOnWrite=!1)},e.prototype.writePostScript=function(){this._version++},e.prototype.getIterationOrder=function(){if(this._order){const e=this._order;return this._order.map(((e,t)=>t)).sort(((t,n)=>e[t]-e[n]))}},e}();function n(e,t,n){if(0===t)e.unshift(n);else if(t===e.length)e.push(n);else{for(let n=e.length;n>t;n--)e[n]=e[n-1];e[t]=n}}function o(e){return e[Symbol.iterator]()}function s(e){const t=e.next();return t.done?void 0:t}function c(e){const t=e.return;"function"==typeof t&&t.call(e)}e.SortedMap=t,e.insertAt=n,e.getIterator=o,e.nextResult=s,e.closeIterator=c;const l=function(){function e(e){this._version=0,this._size=-1,this._parent=e,this._map=Object.create(e?e._map:null)}return Object.defineProperty(e.prototype,"size",{get(){if(-1===this._size||this._parent&&this._parent._version!==this._parentVersion){let e=0;for(const t in this._map)e++;this._size=e,this._parent&&(this._parentVersion=this._parent._version)}return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get(){return this._parent},enumerable:!1,configurable:!0}),e.prototype.has=function(t){return void 0!==this._map[e._escapeKey(t)]},e.prototype.get=function(t){const n=this._map[e._escapeKey(t)];return n===e._undefinedValue?void 0:n},e.prototype.set=function(t,n){return this._map[e._escapeKey(t)]=void 0===n?e._undefinedValue:n,this._size=-1,this._version++,this},e.prototype.delete=function(t){const n=e._escapeKey(t);return void 0!==this._map[n]&&(delete this._map[n],this._size=-1,this._version++,!0)},e.prototype.clear=function(){this._map=Object.create(this._parent?this._parent._map:null),this._size=-1,this._version++},e.prototype.forEach=function(t){for(const n in this._map)t(this._map[n],e._unescapeKey(n),this)},e._escapeKey=function(e){return e.length>=2&&"_"===e.charAt(0)&&"_"===e.charAt(1)?"_"+e:e},e._unescapeKey=function(e){return e.length>=3&&"_"===e.charAt(0)&&"_"===e.charAt(1)&&"_"===e.charAt(2)?e.slice(1):e},e._undefinedValue={},e}();e.Metadata=l}(d||(d={})),function(e){const t=function(){function e(e,t,n){this.file=e,this.text=t,this.meta=n||new Map}return Object.defineProperty(e.prototype,"lineStarts",{get(){return this._lineStarts||(this._lineStarts=r.computeLineStarts(this.text))},enumerable:!1,configurable:!0}),e.fromTestFile=function(t){return new e(t.unitName,t.content,t.fileOptions&&Object.keys(t.fileOptions).reduce(((e,n)=>e.set(n,t.fileOptions[n])),new Map))},e.prototype.asTestFile=function(){return this._testFile||(this._testFile={unitName:this.file,content:this.text,fileOptions:Array.from(this.meta).reduce(((e,t)=>{const n=t[0],r=t[1];return e[n]=r,e}),{})})},e}();e.TextDocument=t;const n=function(){function e(t,n){this.sources=[],this.mappings=[],this._emittedLineMappings=[],this._sourceLineMappings=[],this.raw="string"==typeof n?JSON.parse(n):n,this.mapFile=t,this.version=this.raw.version,this.file=this.raw.file,this.sourceRoot=this.raw.sourceRoot,this.sources=this.raw.sources,this.sourcesContent=this.raw.sourcesContent,this.names=this.raw.names;const r=[];let i,a=0,o=0,s=0,c=0,l=0,u=0;for(;i=e._mappingRegExp.exec(this.raw.mappings);)if(i[1]){const t=e._decodeVLQ(i[1]);if(1!==t.length&&4!==t.length&&5!==t.length)throw new Error("Invalid VLQ");o+=t[0],t.length>=4&&(s+=t[1],c+=t[2],l+=t[3]);const n={mappingIndex:r.length,emittedLine:a,emittedColumn:o,sourceIndex:s,sourceLine:c,sourceColumn:l};5===t.length&&(u+=t[4],n.nameIndex=u),r.push(n);(this._emittedLineMappings[n.emittedLine]||(this._emittedLineMappings[n.emittedLine]=[])).push(n);const d=this._sourceLineMappings[n.sourceIndex]||(this._sourceLineMappings[n.sourceIndex]=[]);(d[n.sourceLine]||(d[n.sourceLine]=[])).push(n)}else{if(!i[2])throw new Error("Unrecognized character '"+i[0]+"'.");a++,o=0}this.mappings=r}return e.getUrl=function(t){let n,r;for(;n=e._sourceMappingURLRegExp.exec(t);)r=n;return r?r[1]:void 0},e.fromUrl=function(t){const n=e._dataURLRegExp.exec(t);return n?new e(void 0,r.sys.base64decode(n[1])):void 0},e.fromSource=function(e){const t=this.getUrl(e);return void 0===t?void 0:this.fromUrl(t)},e.prototype.getMappingsForEmittedLine=function(e){return this._emittedLineMappings[e]},e.prototype.getMappingsForSourceLine=function(e,t){const n=this._sourceLineMappings[e];return n&&n[t]},e._decodeVLQ=function(t){const n=[];let r=0,i=0;for(let a=0;a<t.length;a++){const o=e._base64Chars.indexOf(t.charAt(a));i+=(31&o)<<r,32&o?r+=5:(n.push(1&i?-(i>>>1):i>>>1),r=0,i=0)}return n},e._mappingRegExp=/([A-Za-z0-9+/]+),?|(;)|./g,e._sourceMappingURLRegExp=/^\/\/[#@]\s*sourceMappingURL\s*=\s*(.*?)\s*$/gim,e._dataURLRegExp=/^data:application\/json;base64,([a-z0-9+/=]+)$/i,e._base64Chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e}();e.SourceMap=n}(p||(p={})),function(e){e.sep=r.directorySeparator,e.normalizeSeparators=r.normalizeSlashes,e.isAbsolute=r.isRootedDiskPath,e.isRoot=r.isDiskPathRoot,e.hasTrailingSeparator=r.hasTrailingDirectorySeparator,e.addTrailingSeparator=r.ensureTrailingDirectorySeparator,e.removeTrailingSeparator=r.removeTrailingDirectorySeparator,e.normalize=r.normalizePath,e.combine=r.combinePaths,e.parse=r.getPathComponents,e.reduce=r.reducePathComponents,e.format=r.getPathFromPathComponents,e.resolve=r.resolvePath,e.compare=r.comparePaths,e.compareCaseSensitive=r.comparePathsCaseSensitive,e.compareCaseInsensitive=r.comparePathsCaseInsensitive,e.dirname=r.getDirectoryPath,e.basename=r.getBaseFileName,e.extname=r.getAnyExtensionFromPath,e.relative=r.getRelativePathFromDirectory,e.beneath=r.containsPath,e.changeExtension=r.changeAnyExtension,e.isTypeScript=r.hasTSFileExtension,e.isJavaScript=r.hasJSFileExtension;const t=/^(?!(\/|\/\/\w+\/|[a-zA-Z]:\/?|)$)/,n=/[:*?"<>|]/,i=/[:"<>|]/,a=/^\.{1,2}$|[:*?"<>|]/,o=/^\.{1,2}$|[:"<>|]/,s=/\.\w+$/;let c;function l(e){return r.fileExtensionIsOneOf(e,[".d.mts",".d.cts",".d.ts"])}!function(e){e[e.None=0]="None",e[e.RequireRoot=1]="RequireRoot",e[e.RequireDirname=2]="RequireDirname",e[e.RequireBasename=4]="RequireBasename",e[e.RequireExtname=8]="RequireExtname",e[e.RequireTrailingSeparator=16]="RequireTrailingSeparator",e[e.AllowRoot=32]="AllowRoot",e[e.AllowDirname=64]="AllowDirname",e[e.AllowBasename=128]="AllowBasename",e[e.AllowExtname=256]="AllowExtname",e[e.AllowTrailingSeparator=512]="AllowTrailingSeparator",e[e.AllowNavigation=1024]="AllowNavigation",e[e.AllowWildcard=2048]="AllowWildcard",e[e.Root=545]="Root",e[e.Absolute=2017]="Absolute",e[e.RelativeOrAbsolute=2016]="RelativeOrAbsolute",e[e.Basename=260]="Basename"}(c=e.ValidationFlags||(e.ValidationFlags={})),e.validate=function(r,c){void 0===c&&(c=2016);const l=e.parse(r),u=e.hasTrailingSeparator(r);if(!function(e,r,c){const l=!!e[0],u=e.length>2,d=e.length>1,p=d&&s.test(e[e.length-1]),f=1024&r?2048&r?i:n:2048&r?o:a;if(1&r&&!l)return!1;if(2&r&&!u)return!1;if(4&r&&!d)return!1;if(8&r&&!p)return!1;if(16&r&&!c)return!1;if(1&r&&(r|=32),2&r&&(r|=64),4&r&&(r|=128),8&r&&(r|=256),16&r&&(r|=512),32&~r&&l)return!1;if(64&~r&&u)return!1;if(128&~r&&d)return!1;if(256&~r&&p)return!1;if(512&~r&&c)return!1;if(t.test(e[0]))return!1;for(let t=1;t<e.length;t++)if(f.test(e[t]))return!1;return!0}(l,c,u))throw m.createIOError("ENOENT");return l.length>1&&u?e.format(e.reduce(l))+e.sep:e.format(e.reduce(l))},e.isDeclaration=l,e.isSourceMap=function(t){return e.extname(t,".map",!1).length>0};const u=[".js.map",".jsx.map"];e.isJavaScriptSourceMap=function(t){return e.extname(t,u,!1).length>0},e.isJson=function(t){return e.extname(t,".json",!1).length>0},e.isDefaultLibrary=function(t){return l(t)&&e.basename(t).startsWith("lib.")},e.isTsConfigFile=function(e){return-1!==e.indexOf("tsconfig")&&-1!==e.indexOf("json")}}(f||(f={})),function(e){e.builtFolder="/.ts",e.projectsFolder="/.projects",e.testLibFolder="/.lib",e.srcFolder="/.src";const t=61440,n=40960,s=32768,c=16384;let l=0,u=0;const m=function(){function e(e,t){void 0===t&&(t={}),this._lazy={};const n=t.time,r=void 0===n?-1:n,i=t.files,a=t.meta;if(this.ignoreCase=e,this.stringComparer=this.ignoreCase?f.compareCaseInsensitive:f.compareCaseSensitive,this._time=r,a)for(let e=0,t=Object.keys(a);e<t.length;e++){const n=t[e];this.meta.set(n,a[n])}i&&this._applyFiles(i,"");let o=t.cwd;if((!o||!f.isRoot(o))&&this._lazy.links){const e=d.getIterator(this._lazy.links.keys());try{for(let t=d.nextResult(e);t;t=d.nextResult(e)){const e=t.value;o=o?f.resolve(e,o):e;break}}finally{d.closeIterator(e)}}o&&(f.validate(o,2017),this.mkdirpSync(o)),this._cwd=o||""}return Object.defineProperty(e.prototype,"meta",{get(){return this._lazy.meta||(this._lazy.meta=new d.Metadata(this._shadowRoot?this._shadowRoot.meta:void 0)),this._lazy.meta},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReadonly",{get(){return Object.isFrozen(this)},enumerable:!1,configurable:!0}),e.prototype.makeReadonly=function(){return Object.freeze(this),this},Object.defineProperty(e.prototype,"shadowRoot",{get(){return this._shadowRoot},enumerable:!1,configurable:!0}),e.prototype.snapshot=function(){if(this.isReadonly)return;const t=new e(this.ignoreCase,{time:this._time});t._lazy=this._lazy,t._cwd=this._cwd,t._time=this._time,t._shadowRoot=this._shadowRoot,t._dirStack=this._dirStack,t.makeReadonly(),this._lazy={},this._shadowRoot=t},e.prototype.shadow=function(t){if(void 0===t&&(t=this.ignoreCase),!this.isReadonly)throw new Error("Cannot shadow a mutable file system.");if(t&&!this.ignoreCase)throw new Error("Cannot create a case-insensitive file system from a case-sensitive one.");const n=new e(t,{time:this._time});return n._shadowRoot=this,n._cwd=this._cwd,n},e.prototype.time=function(e){if(void 0!==e&&this.isReadonly)throw h("EPERM");let t=this._time;return"function"==typeof t&&(t=t()),"object"==typeof t&&(t=t.getTime()),-1===t&&(t=Date.now()),void 0!==e&&(this._time=e),t},e.prototype.filemeta=function(e){const t=this._walk(this._resolve(e)).node;if(!t)throw h("ENOENT");return this._filemeta(t)},e.prototype._filemeta=function(e){if(!e.meta){const t=e.shadowRoot&&this._shadowRoot&&this._shadowRoot._filemeta(e.shadowRoot);e.meta=new d.Metadata(t)}return e.meta},e.prototype.cwd=function(){if(!this._cwd)throw new Error("The current working directory has not been set.");const e=this._walk(this._cwd).node;if(!e)throw h("ENOENT");if(!w(e))throw h("ENOTDIR");return this._cwd},e.prototype.chdir=function(e){if(this.isReadonly)throw h("EPERM");e=this._resolve(e);const t=this._walk(e).node;if(!t)throw h("ENOENT");if(!w(t))throw h("ENOTDIR");this._cwd=e},e.prototype.pushd=function(e){if(this.isReadonly)throw h("EPERM");e&&(e=this._resolve(e)),this._cwd&&(this._dirStack||(this._dirStack=[]),this._dirStack.push(this._cwd)),e&&e!==this._cwd&&this.chdir(e)},e.prototype.popd=function(){if(this.isReadonly)throw h("EPERM");const e=this._dirStack&&this._dirStack.pop();e&&this.chdir(e)},e.prototype.apply=function(e){this._applyFiles(e,this._cwd)},e.prototype.scanSync=function(e,t,n){e=this._resolve(e);const r=[];return this._scan(e,this._stat(this._walk(e)),t,n,!1,r),r},e.prototype.lscanSync=function(e,t,n){e=this._resolve(e);const r=[];return this._scan(e,this._stat(this._walk(e,!0)),t,n,!0,r),r},e.prototype._scan=function(e,t,n,r,i,a){if("ancestors-or-self"!==n&&"self"!==n&&"descendants-or-self"!==n||r.accept&&!r.accept(e,t)||a.push(e),"ancestors-or-self"===n||"ancestors"===n){const t=f.dirname(e);if(t!==e)try{const e=this._stat(this._walk(t,i));r.traverse&&!r.traverse(t,e)||this._scan(t,e,"ancestors-or-self",r,i,a)}catch(e){}}if(("descendants-or-self"===n||"descendants"===n)&&t.isDirectory()&&(!r.traverse||r.traverse(e,t)))for(let t=0,n=this.readdirSync(e);t<n.length;t++){const o=n[t];try{const t=f.combine(e,o),n=this._stat(this._walk(t,i));this._scan(t,n,"descendants-or-self",r,i,a)}catch(e){}}},e.prototype.mountSync=function(e,t,n){if(this.isReadonly)throw h("EROFS");e=f.validate(e,2017);const r=this._walk(this._resolve(t),!0),i=r.parent,a=r.links,o=r.node,s=r.basename;if(o)throw h("EEXIST");const u=this.time(),d=this._mknod(i?i.dev:++l,c,511,u);d.source=e,d.resolver=n,this._addLink(i,a,s,d,u)},e.prototype.rimrafSync=function(e){try{const t=this.lstatSync(e);if(t.isFile()||t.isSymbolicLink())this.unlinkSync(e);else if(t.isDirectory()){for(let t=0,n=this.readdirSync(e);t<n.length;t++){const r=n[t];this.rimrafSync(f.combine(e,r))}this.rmdirSync(e)}}catch(e){if("ENOENT"===e.code)return;throw e}},e.prototype.mkdirpSync=function(e){const t=this;e=this._resolve(e);const n=this._walk(e,!0,((e,n)=>"ENOENT"===e.code?(t._mkdir(n),"retry"):"throw"));n.node||this._mkdir(n)},e.prototype.getFileListing=function(){const e=this;let t="";var n=function(r,i){const a=d.getIterator(i);try{for(let i=d.nextResult(a);i;i=d.nextResult(a)){const a=i.value,o=a[0],s=a[1],c=r?f.combine(r,o):o,l=0===f.compare(e._cwd,c,e.ignoreCase)?"*":" ";t&&(t+="\n"),t+=l,w(s)?(t+=f.addTrailingSeparator(c),n(c,e._getLinks(s))):k(s)?t+=c:L(s)&&(t+=c+" -> "+s.symlink)}}finally{d.closeIterator(a)}};return n(void 0,this._getRootLinks()),t},e.prototype.debugPrint=function(){console.log(this.getFileListing())},e.prototype.existsSync=function(e){const t=this._walk(this._resolve(e),!0,(()=>"stop"));return void 0!==t&&void 0!==t.node},e.prototype.statSync=function(e){return this._stat(this._walk(this._resolve(e)))},e.prototype.utimesSync=function(e,t,n){if(this.isReadonly)throw h("EROFS");if(!isFinite(+t)||!isFinite(+n))throw h("EINVAL");const r=this._walk(this._resolve(e));if(!r||!r.node)throw h("ENOENT");r.node.atimeMs=+t,r.node.mtimeMs=+n,r.node.ctimeMs=this.time()},e.prototype.lstatSync=function(e){return this._stat(this._walk(this._resolve(e),!0))},e.prototype._stat=function(e){const t=e.node;if(!t)throw h("ENOENT",e.realpath);return new g(t.dev,t.ino,t.mode,t.nlink,0,k(t)?this._getSize(t):L(t)?t.symlink.length:0,4096,0,t.atimeMs,t.mtimeMs,t.ctimeMs,t.birthtimeMs)},e.prototype.readdirSync=function(e){const t=this._walk(this._resolve(e)).node;if(!t)throw h("ENOENT");if(!w(t))throw h("ENOTDIR");return Array.from(this._getLinks(t).keys())},e.prototype.mkdirSync=function(e){if(this.isReadonly)throw h("EROFS");this._mkdir(this._walk(this._resolve(e),!0))},e.prototype._mkdir=function(e){const t=e.parent,n=e.links,r=e.node,i=e.basename;if(r)throw h("EEXIST");const a=this.time(),o=this._mknod(t?t.dev:++l,c,511,a);this._addLink(t,n,i,o,a)},e.prototype.rmdirSync=function(e){if(this.isReadonly)throw h("EROFS");e=this._resolve(e);const t=this._walk(e,!0),n=t.parent,r=t.links,i=t.node,a=t.basename;if(!n)throw h("EPERM");if(!w(i))throw h("ENOTDIR");if(0!==this._getLinks(i).size)throw h("ENOTEMPTY");this._removeLink(n,r,a,i)},e.prototype.linkSync=function(e,t){if(this.isReadonly)throw h("EROFS");const n=this._walk(this._resolve(e)).node;if(!n)throw h("ENOENT");if(w(n))throw h("EPERM");const r=this._walk(this._resolve(t),!0),i=r.parent,a=r.links,o=r.basename,s=r.node;if(!i)throw h("EPERM");if(s)throw h("EEXIST");this._addLink(i,a,o,n)},e.prototype.unlinkSync=function(e){if(this.isReadonly)throw h("EROFS");const t=this._walk(this._resolve(e),!0),n=t.parent,r=t.links,i=t.node,a=t.basename;if(!n)throw h("EPERM");if(!i)throw h("ENOENT");if(w(i))throw h("EISDIR");this._removeLink(n,r,a,i)},e.prototype.renameSync=function(e,t){if(this.isReadonly)throw h("EROFS");const n=this._walk(this._resolve(e),!0),r=n.parent,i=n.links,a=n.node,o=n.basename;if(!r)throw h("EPERM");if(!a)throw h("ENOENT");const s=this._walk(this._resolve(t),!0),c=s.parent,l=s.links,u=s.node,d=s.basename;if(!c)throw h("EPERM");const p=this.time();if(u){if(w(a)){if(!w(u))throw h("ENOTDIR");if(0!==this.stringComparer(e,t)&&this._getLinks(u).size>0)throw h("ENOTEMPTY")}else if(w(u))throw h("EISDIR");this._removeLink(c,l,d,u,p)}this._replaceLink(r,i,o,c,l,d,a,p)},e.prototype.symlinkSync=function(e,t){if(this.isReadonly)throw h("EROFS");const r=this._walk(this._resolve(t),!0),i=r.parent,a=r.links,o=r.node,s=r.basename;if(!i)throw h("EPERM");if(o)throw h("EEXIST");const c=this.time(),l=this._mknod(i.dev,n,438,c);l.symlink=f.validate(e,2016),this._addLink(i,a,s,l,c)},e.prototype.realpathSync=function(e){return this._walk(this._resolve(e)).realpath},e.prototype.readFileSync=function(e,t){void 0===t&&(t=null);const n=this._walk(this._resolve(e)).node;if(!n)throw h("ENOENT");if(w(n))throw h("EISDIR");if(!k(n))throw h("EBADF");const r=this._getBuffer(n).slice();return t?r.toString(t):r},e.prototype.writeFileSync=function(e,t,n){if(void 0===n&&(n=null),this.isReadonly)throw h("EROFS");const i=this._walk(this._resolve(e),!1),a=i.parent,o=i.links,c=i.node,l=i.basename;if(!a)throw h("EPERM");const u=this.time();let d=c;if(d||(d=this._mknod(a.dev,s,438,u),this._addLink(a,o,l,d,u)),w(d))throw h("EISDIR");if(!k(d))throw h("EBADF");d.buffer=Buffer.isBuffer(t)?t.slice():r.sys.bufferFrom(""+t,n||"utf8"),d.size=d.buffer.byteLength,d.mtimeMs=u,d.ctimeMs=u},e.prototype.diff=function(t,n){void 0===n&&(n={}),t||n.baseIsNotShadowRoot||(t=this.shadowRoot);const r={};return(t?e.rootDiff(r,this,t,n):e.trackCreatedInodes(r,this,this._getRootLinks()))?r:void 0},e.diff=function(t,n,r){void 0===r&&(r={});const i={};return e.rootDiff(i,t,n,r)?i:void 0},e.diffWorker=function(t,n,r,i,a,o){if(r&&!a)return e.trackCreatedInodes(t,n,r);if(a&&!r)return e.trackDeletedInodes(t,a);if(r&&a){let s=!1;return a.forEach(((e,n)=>{r.has(n)||(t[n]=w(e)?new S:new T,s=!0)})),r.forEach(((r,c)=>{const l=a.get(c);if(l){if(w(r)&&w(l))return s=e.directoryDiff(t,c,n,r,i,l,o)||s;if(k(r)&&k(l))return s=e.fileDiff(t,c,n,r,i,l,o)||s;if(L(r)&&L(l))return s=e.symlinkDiff(t,c,r,l)||s}return s=e.trackCreatedInode(t,c,n,r)||s})),s}return!1},e.rootDiff=function(t,n,r,i){for(;!n._lazy.links&&n._shadowRoot;)n=n._shadowRoot;for(;!r._lazy.links&&r._shadowRoot;)r=r._shadowRoot;return n!==r&&(!!(n._lazy.links||n._shadowRoot||r._lazy.links||r._shadowRoot)&&e.diffWorker(t,n,n._getRootLinks(),r,r._getRootLinks(),i))},e.directoryDiff=function(t,n,r,i,a,o,s){for(;!i.links&&i.shadowRoot;)i=i.shadowRoot;for(;!o.links&&o.shadowRoot;)o=o.shadowRoot;if(i===o)return!1;if(C(i)&&C(o))return!1;if(!i.links&&!o.links&&i.resolver&&void 0!==i.source&&o.resolver===i.resolver&&o.source===i.source)return!1;const c={};return!!e.diffWorker(c,r,r._getLinks(i),a,a._getLinks(o),s)&&(t[n]=new y(c),!0)},e.fileDiff=function(e,t,n,r,i,a,o){for(;!r.buffer&&r.shadowRoot;)r=r.shadowRoot;for(;!a.buffer&&a.shadowRoot;)a=a.shadowRoot;if(r===a)return!1;if(A(r)&&A(a))return!1;if(!r.buffer&&!a.buffer&&r.resolver&&void 0!==r.source&&a.resolver===r.resolver&&a.source===r.source)return!1;const s=n._getBuffer(r),c=i._getBuffer(a);return s!==c&&(0===Buffer.compare(s,c)?!!o.includeChangedFileWithSameContent&&(e[t]=new b(s),!0):(e[t]=new v(s),!0))},e.symlinkDiff=function(e,t,n,r){return n.symlink!==r.symlink&&(e[t]=new x(n.symlink),!0)},e.trackCreatedInode=function(t,n,r,i){if(w(i)){const a={};e.trackCreatedInodes(a,r,r._getLinks(i)),t[n]=new y(a)}else L(i)?t[n]=new x(i.symlink):t[n]=new v(i.buffer||"");return!0},e.trackCreatedInodes=function(t,n,r){return!!r.size&&(r.forEach(((r,i)=>{e.trackCreatedInode(t,i,n,r)})),!0)},e.trackDeletedInodes=function(e,t){return!!t.size&&(t.forEach(((t,n)=>{e[n]=w(t)?new S:new T})),!0)},e.prototype._mknod=function(e,n,r,i){return void 0===i&&(i=this.time()),{dev:e,ino:++u,mode:-61441&r&-19&4095|n&t,atimeMs:i,mtimeMs:i,ctimeMs:i,birthtimeMs:i,nlink:0}},e.prototype._addLink=function(e,t,n,r,i){void 0===i&&(i=this.time()),t.set(n,r),r.nlink++,r.ctimeMs=i,e&&(e.mtimeMs=i),e||this._cwd||(this._cwd=n)},e.prototype._removeLink=function(e,t,n,r,i){void 0===i&&(i=this.time()),t.delete(n),r.nlink--,r.ctimeMs=i,e&&(e.mtimeMs=i)},e.prototype._replaceLink=function(e,t,n,r,i,a,o,s){e!==r?(this._removeLink(e,t,n,o,s),this._addLink(r,i,a,o,s)):(t.delete(n),t.set(a,o),e.mtimeMs=s,r.mtimeMs=s)},e.prototype._getRootLinks=function(){return this._lazy.links||(this._lazy.links=new d.SortedMap(this.stringComparer),this._shadowRoot&&this._copyShadowLinks(this._shadowRoot._getRootLinks(),this._lazy.links),this._lazy.links=this._lazy.links),this._lazy.links},e.prototype._getLinks=function(e){if(!e.links){const i=new d.SortedMap(this.stringComparer),a=e.source,o=e.resolver;if(a&&o){e.source=void 0,e.resolver=void 0;for(let l=0,u=o.readdirSync(a);l<u.length;l++){const d=u[l],p=f.combine(a,d),m=o.statSync(p);switch(m.mode&t){case c:var n=this._mknod(e.dev,c,511);n.source=f.combine(a,d),n.resolver=o,this._addLink(e,i,d,n);break;case s:var r=this._mknod(e.dev,s,438);r.source=f.combine(a,d),r.resolver=o,r.size=m.size,this._addLink(e,i,d,r)}}}else this._shadowRoot&&e.shadowRoot&&this._copyShadowLinks(this._shadowRoot._getLinks(e.shadowRoot),i);e.links=i}return e.links},e.prototype._getShadow=function(e){const t=this._lazy.shadows||(this._lazy.shadows=new Map);let n=t.get(e.ino);return n||(n={dev:e.dev,ino:e.ino,mode:e.mode,atimeMs:e.atimeMs,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,birthtimeMs:e.birthtimeMs,nlink:e.nlink,shadowRoot:e},L(e)&&(n.symlink=e.symlink),t.set(n.ino,n)),n},e.prototype._copyShadowLinks=function(e,t){const n=d.getIterator(e);try{for(let e=d.nextResult(n);e;e=d.nextResult(n)){const n=e.value,r=n[0],i=n[1];t.set(r,this._getShadow(i))}}finally{d.closeIterator(n)}},e.prototype._getSize=function(e){return e.buffer?e.buffer.byteLength:void 0!==e.size?e.size:e.source&&e.resolver?e.size=e.resolver.statSync(e.source).size:this._shadowRoot&&e.shadowRoot?e.size=this._shadowRoot._getSize(e.shadowRoot):0},e.prototype._getBuffer=function(e){if(!e.buffer){const t=e.source,n=e.resolver;t&&n?(e.source=void 0,e.resolver=void 0,e.size=void 0,e.buffer=n.readFileSync(t)):this._shadowRoot&&e.shadowRoot?e.buffer=this._shadowRoot._getBuffer(e.shadowRoot):e.buffer=Buffer.allocUnsafe(0)}return e.buffer},e.prototype._walk=function(e,t,n){let r,i=this._getRootLinks(),a=f.parse(e),o=0,s=0,c=!1;for(;;){if(s>=40)throw h("ELOOP");const e=o===a.length-1;let n=a[o];const u=i.getEntry(n);u&&(a[o]=n=u[0]);const d=null==u?void 0:u[1];if(e&&(t||!L(d)))return{realpath:f.format(a),basename:n,parent:r,links:i,node:d};if(void 0===d){if(l(h("ENOENT"),d))continue;return}if(L(d)){const e=f.format(a.slice(0,o)),t=f.resolve(e,d.symlink);i=this._getRootLinks(),r=void 0,a=f.parse(t).concat(a.slice(o+1)),o=0,s++,c=!1}else if(w(d))i=this._getLinks(d),r=d,o++,c=!1;else if(!l(h("ENOTDIR"),d))return}function l(e,t){const s=f.format(a.slice(0,o+1)),l=a[o],u=!c&&n?n(e,{realpath:s,basename:l,parent:r,links:i,node:t}):"throw";if("stop"===u)return!1;if("retry"===u)return c=!0,!0;throw e}},e.prototype._resolve=function(e){return this._cwd?f.resolve(this._cwd,f.validate(e,4064)):f.validate(e,4065)},e.prototype._applyFiles=function(e,t){const n=[];this._applyFilesWorker(e,t,n);for(let e=0,r=n;e<r.length;e++){const n=r[e],i=n[0],a=n[1];if(this.mkdirpSync(f.dirname(a)),this.pushd(f.dirname(a)),i instanceof x){if(0===this.stringComparer(f.dirname(a),a))throw new TypeError("Roots cannot be symbolic links.");this.symlinkSync(f.resolve(t,i.symlink),a),this._applyFileExtendedOptions(a,i)}else if(i instanceof E){if(0===this.stringComparer(f.dirname(a),a))throw new TypeError("Roots cannot be hard links.");this.linkSync(i.path,a)}else this.mountSync(i.source,a,i.resolver),this._applyFileExtendedOptions(a,i);this.popd()}},e.prototype._applyFileExtendedOptions=function(e,t){const n=t.meta;if(void 0!==n){const t=this.filemeta(e);for(let e=0,r=Object.keys(n);e<r.length;e++){const i=r[e];t.set(i,n[i])}}},e.prototype._applyFilesWorker=function(e,t,n){for(let r=0,i=Object.keys(e);r<i.length;r++){const a=i[r],o=P(e[a]),s=t?f.resolve(t,a):a;if(f.validate(s,2017),null==o||o instanceof S||o instanceof T){if(0===this.stringComparer(f.dirname(s),s))throw new TypeError("Roots cannot be deleted.");this.rimrafSync(s)}else if(o instanceof v){if(0===this.stringComparer(f.dirname(s),s))throw new TypeError("Roots cannot be files.");this.mkdirpSync(f.dirname(s)),this.writeFileSync(s,o.data,o.encoding),this._applyFileExtendedOptions(s,o)}else o instanceof y?(this.mkdirpSync(s),this._applyFileExtendedOptions(s,o),this._applyFilesWorker(o.files,s,n)):n.push([o,s])}},e}();function _(e){return{readdirSync(t){const n=e.getAccessibleFileSystemEntries(t),r=n.files;return n.directories.concat(r)},statSync(t){if(e.directoryExists(t))return{mode:16895,size:0};if(e.fileExists(t))return{mode:33206,size:e.getFileSize(t)};throw new Error("ENOENT: path does not exist")},readFileSync:t=>r.sys.bufferFrom(e.readFile(t),"utf8")}}e.FileSystem=m,e.createResolver=_,e.createFromFileSystem=function(t,n,r){const i=void 0===r?{}:r,a=i.documents,o=i.files,s=i.cwd,c=i.time,l=i.meta,u=function(t,n){let r;M!==t&&(N=void 0,I=void 0,M=t);if(!N){const n=_(t);N=new m(!0,{files:(r={},r[e.builtFolder]=new D(f.resolve(t.getWorkspaceRoot(),"built/local"),n),r[e.testLibFolder]=new D(f.resolve(t.getWorkspaceRoot(),"tests/lib"),n),r[e.projectsFolder]=new D(f.resolve(t.getWorkspaceRoot(),"tests/projects"),n),r[e.srcFolder]={},r),cwd:e.srcFolder,meta:{defaultLibLocation:e.builtFolder}}),N.makeReadonly()}if(n)return N;I||(I=N.shadow(!1),I.makeReadonly());return I}(t,n).shadow();if(l)for(let e=0,t=Object.keys(l);e<t.length;e++){const n=t[e];u.meta.set(n,l[n])}if(c&&u.time(c),s&&(u.mkdirpSync(s),u.chdir(s)),a)for(let e=0,t=a;e<t.length;e++){const n=t[e];u.mkdirpSync(f.dirname(n.file)),u.writeFileSync(n.file,n.text,"utf8"),u.filemeta(n.file).set("document",n);const r=n.meta.get("symlink");if(r)for(let e=0,t=r.split(",").map((e=>e.trim()));e<t.length;e++){const r=t[e];u.mkdirpSync(f.dirname(r)),u.symlinkSync(f.resolve(u.cwd(),n.file),r)}}return o&&u.apply(o),u};var g=function(){function e(e,t,n,r,i,a,o,s,c,l,u,d){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===a&&(a=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===c&&(c=0),void 0===l&&(l=0),void 0===u&&(u=0),void 0===d&&(d=0),this.dev=e,this.ino=t,this.mode=n,this.nlink=r,this.uid=0,this.gid=0,this.rdev=i,this.size=a,this.blksize=o,this.blocks=s,this.atimeMs=c,this.mtimeMs=l,this.ctimeMs=u,this.birthtimeMs=d,this.atime=new Date(this.atimeMs),this.mtime=new Date(this.mtimeMs),this.ctime=new Date(this.ctimeMs),this.birthtime=new Date(this.birthtimeMs)}return e.prototype.isFile=function(){return(this.mode&t)===s},e.prototype.isDirectory=function(){return(this.mode&t)===c},e.prototype.isSymbolicLink=function(){return(this.mode&t)===n},e.prototype.isBlockDevice=function(){return 24576==(this.mode&t)},e.prototype.isCharacterDevice=function(){return 8192==(this.mode&t)},e.prototype.isFIFO=function(){return 4096==(this.mode&t)},e.prototype.isSocket=function(){return 49152==(this.mode&t)},e}();function h(t,n){void 0===n&&(n="");const r=new Error(t+": "+e.IOErrorMessages[t]+" "+n);return r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,h),r}e.Stats=g,e.IOErrorMessages=Object.freeze({EACCES:"access denied",EIO:"an I/O error occurred",ENOENT:"no such file or directory",EEXIST:"file already exists",ELOOP:"too many symbolic links encountered",ENOTDIR:"no such directory",EISDIR:"path is a directory",EBADF:"invalid file descriptor",EINVAL:"invalid value",ENOTEMPTY:"directory not empty",EPERM:"operation not permitted",EROFS:"file system is read-only"}),e.createIOError=h;var y=function(e,t){const n=(void 0===t?{}:t).meta;this.files=e,this.meta=n};e.Directory=y;var v=function(e,t){const n=void 0===t?{}:t,r=n.meta,i=n.encoding;this.data=e,this.encoding=i,this.meta=r};e.File=v;var b=function(e){function t(t,n){return e.call(this,t,n)||this}return o(t,e),t}(v);e.SameFileContentFile=b;var E=function(e){this.path=e};e.Link=E;var S=function(){};e.Rmdir=S;var T=function(){};e.Unlink=T;var x=function(e,t){const n=(void 0===t?{}:t).meta;this.symlink=e,this.meta=n};e.Symlink=x;const D=function(e,t,n){const r=(void 0===n?{}:n).meta;this.source=e,this.resolver=t,this.meta=r};function C(e){return!(e.links||e.shadowRoot||e.resolver||e.source)}function A(e){return!(e.buffer||e.shadowRoot||e.resolver||e.source)}function k(e){return void 0!==e&&(e.mode&t)===s}function w(e){return void 0!==e&&(e.mode&t)===c}function L(e){return void 0!==e&&(e.mode&t)===n}let M,N,I;function P(e){return null==e||e instanceof y||e instanceof v||e instanceof E||e instanceof x||e instanceof D||e instanceof S||e instanceof T?e:"string"==typeof e||Buffer.isBuffer(e)?new v(e):new y(e)}function F(e,t){let n="";for(let r=0,i=Object.keys(t);r<i.length;r++){const a=i[r],o=P(t[a]),s=e?f.combine(e,a):a;if(null==o||o instanceof T||o instanceof S)n+="//// ["+s+"] unlink\r\n";else if(o instanceof S)n+="//// ["+f.addTrailingSeparator(s)+"] rmdir\r\n";else if(o instanceof y)n+=F(s,o.files);else if(o instanceof b)n+="//// ["+s+"] file written with same contents\r\n";else if(o instanceof v){n+="//// ["+s+"]\r\n"+("string"==typeof o.data?o.data:o.data.toString("utf8"))+"\r\n\r\n"}else o instanceof E?n+="//// ["+s+"] link("+o.path+")\r\n":o instanceof x?n+="//// ["+s+"] symlink("+o.symlink+")\r\n":o instanceof D&&(n+="//// ["+s+"] mount("+o.source+")\r\n")}return n}function O(e,t){let n,o,s,c,l,u;return i(this,(i=>{switch(i.label){case 0:n=0,o=Object.keys(t),i.label=1;case 1:return n<o.length?(s=o[n],c=P(t[s]),l=e?f.combine(e,s):s,c instanceof y?[5,a(r.arrayFrom(O(l,c.files)))]:[3,3]):[3,6];case 2:return i.sent(),[3,5];case 3:return c instanceof v?(u="string"==typeof c.data?c.data:c.data.toString("utf8"),[4,new p.TextDocument(l,u)]):[3,5];case 4:i.sent(),i.label=5;case 5:return n++,[3,1];case 6:return[2]}}))}e.Mount=D,e.formatPatch=function(e){return e?F("",e):null},e.iteratePatch=function(e){return e?O("",e):null}}(m||(m={}));var _=n(6392);globalThis.assert=_.assert,assert.isFalse=function(e,t){if(!1!==e)throw new Error(t)};var g=assert.deepEqual;assert.deepEqual=function(e,t,n){function i(e){var t={};for(var n in e)Number.isNaN(Number(n))&&(t[n]=e[n]);return t}r.isArray(e)&&r.isArray(t)&&g(i(e),i(t),"Array extra keys differ"),g(e,t,n)},globalThis.expect=_.expect,function(e){!function(t){function r(t){return e.isString(t.content)}function i(t){return e.isString(t.symLink)}function a(t){return!!t&&e.isArray(t.entries)}function o(t){return!!t&&e.isString(t.content)}function s(t){return!!t&&e.isString(t.symLink)}function d(e,t){if(e)for(var n=0,r=e.slice();n<r.length;n++){t(r[n])}}function p(e,t,n){return e.add(t,n),{close:()=>e.remove(t,n)}}function f(t,n){if(t.size===n.length)return"";var r=[],i=[],a=new e.Map;e.forEach(n,(e=>{a.has(e)?i.push(e):(a.set(e,!0),t.has(e)||r.push(e))}));var o=[];return t.forEach(((e,t)=>{a.has(t)||o.push(t),a.set(t,!0)})),"\n\nNotInActual: "+r+"\nDuplicates: "+i+"\nInActualButNotInExpected: "+o}function m(t,n,r){assert.equal(n.size,r.length,t+": incorrect size of map: Actual keys: "+e.arrayFrom(n.keys())+" Expected: "+r+f(n,r))}function _(t,n,r,i,a){var o=e.isArray(r)?e.arrayToMap(r,(e=>e),(()=>i)):r;m(t,n,e.isArray(r)?r:e.arrayFrom(o.keys())),e.isNumber(i)||(a=i);var s=a||[void 0,void 0],c=s[0],l=s[1];o.forEach(((a,o)=>{assert.isTrue(n.has(o),t+": expected to contain "+o+", actual keys: "+e.arrayFrom(n.keys())),e.isArray(r)&&void 0===i||(assert.equal(n.get(o).length,a,t+": Expected to be have "+a+" entries for "+o+". Actual entry: "+JSON.stringify(n.get(o))),c&&assert.deepEqual(n.get(o).map(l),c.get(o),t+":: expected values mismatch for "+o))}))}t.libFile={path:"/a/lib/lib.d.ts",content:'/// <reference no-default-lib="true"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }'},t.safeList={path:"/safeList.json",content:JSON.stringify({commander:"commander",express:"express",jquery:"jquery",lodash:"lodash",moment:"moment",chroma:"chroma-js"})},t.createWatchedSystem=function(e,t){return new y(!1,e,t)},t.createServerHost=function(t,n){var r=new y(!0,t,n);return e.patchWriteFileEnsuringDirectory(r),r},t.isFile=r,t.isSymLink=i,t.getDiffInKeys=f,t.verifyMapSize=m,t.checkMap=_,t.checkArray=function(t,n,r){_(t,e.arrayToMap(n,e.identity),r,void 0)},t.checkWatchedFiles=function(e,t,n){_("watchedFiles:: "+(n||"")+"::",e.watchedFiles,t,void 0)},t.checkWatchedFilesDetailed=function(t,n,r,i){e.isNumber(r)||(i=r),e.isArray(n)?_("watchedFiles",t.watchedFiles,n,r,[i,function(e){return{fileName:e.fileName,pollingInterval:e.pollingInterval}}]):_("watchedFiles",t.watchedFiles,n,[i,function(e){return{fileName:e.fileName,pollingInterval:e.pollingInterval}}])},t.checkWatchedDirectories=function(e,t,n){_("watchedDirectories"+(n?" recursive":""),n?e.fsWatchesRecursive:e.fsWatches,t,void 0)},t.checkWatchedDirectoriesDetailed=function(t,n,r,i,a){"boolean"!=typeof i&&(a=i),e.isArray(n)?_("fsWatches"+(i?" recursive":""),i?t.fsWatchesRecursive:t.fsWatches,n,r,[a,function(e){return{directoryName:e.directoryName,fallbackPollingInterval:e.fallbackPollingInterval,fallbackOptions:e.fallbackOptions}}]):_("fsWatches"+((i=r)?" recursive":""),i?t.fsWatchesRecursive:t.fsWatches,n,[a,function(e){return{directoryName:e.directoryName,fallbackPollingInterval:e.fallbackPollingInterval,fallbackOptions:e.fallbackOptions}}])},t.checkOutputContains=function(t,n){for(var r=new e.Set(n),i=new e.Set,a=0,o=t.getOutput();a<o.length;a++){var s=o[a];assert.isFalse(i.has(s),"Already found "+s+" in "+JSON.stringify(t.getOutput())),r.has(s)&&(r.delete(s),i.add(s))}assert.equal(r.size,0,"Output has missing "+JSON.stringify(e.arrayFrom(r.keys()))+" in "+JSON.stringify(t.getOutput()))},t.checkOutputDoesNotContain=function(t,n){for(var r=new e.Set(n),i=0,a=t.getOutput();i<a.length;i++){var o=a[i];assert.isFalse(r.has(o),"Contains "+o+" in "+JSON.stringify(t.getOutput()))}};var g,h=function(){function e(){this.map=[],this.nextId=1}return e.prototype.getNextId=function(){return this.nextId},e.prototype.register=function(e,t){var n=this.nextId;return this.nextId++,this.map[n]=e.bind.apply(e,u([void 0],t,!1)),n},e.prototype.unregister=function(e){"number"==typeof e&&delete this.map[e]},e.prototype.count=function(){var e=0;for(var t in this.map)e++;return e},e.prototype.invoke=function(e){if(e)return this.map[e](),void delete this.map[e];for(var t in this.map)this.map[t](),delete this.map[t]},e}();!function(e){e.DynamicPolling="DynamicPriorityPolling",e.SingleFileWatcherPerName="SingleFileWatcherPerName"}(g=t.Tsc_WatchFile||(t.Tsc_WatchFile={})),function(e){e.WatchFile="RecursiveDirectoryUsingFsWatchFile",e.NonRecursiveWatchDirectory="RecursiveDirectoryUsingNonRecursiveWatchDirectory",e.DynamicPolling="RecursiveDirectoryUsingDynamicPriorityPolling"}(t.Tsc_WatchDirectory||(t.Tsc_WatchDirectory={}));var y=function(){function c(n,r,i){var a=this,o=void 0===i?{}:i,s=o.useCaseSensitiveFileNames,c=o.executingFilePath,l=o.currentDirectory,u=o.newLine,d=o.windowsStyleRoot,p=o.environmentVariables,f=o.runWithoutRecursiveWatches,m=o.runWithFallbackPolling;this.withSafeList=n,this.args=[],this.output=[],this.fs=new e.Map,this.time=1e3,this.timeoutCallbacks=new h,this.immediateCallbacks=new h,this.screenClears=[],this.watchedFiles=e.createMultiMap(),this.fsWatches=e.createMultiMap(),this.fsWatchesRecursive=e.createMultiMap(),this.exitMessage="System Exit",this.resolvePath=function(e){return e},this.getExecutingFilePath=function(){return a.executingFilePath},this.getCurrentDirectory=function(){return a.currentDirectory},this.useCaseSensitiveFileNames=!!s,this.newLine=u||"\n",this.windowsStyleRoot=d,this.environmentVariables=p,l=l||"/",this.getCanonicalFileName=e.createGetCanonicalFileName(!!s),this.toPath=function(t){return e.toPath(t,l,a.getCanonicalFileName)},this.executingFilePath=this.getHostSpecificPath(c||e.combinePaths(e.getDirectoryPath(t.libFile.path),"tsc.js")),this.currentDirectory=this.getHostSpecificPath(l),this.runWithFallbackPolling=!!m;var _=this.environmentVariables&&this.environmentVariables.get("TSC_WATCHFILE"),y=this.environmentVariables&&this.environmentVariables.get("TSC_WATCHDIRECTORY"),v=e.createSystemWatchFunctions({pollingWatchFile:_===g.SingleFileWatcherPerName?e.createSingleFileWatcherPerName(this.watchFileWorker.bind(this),this.useCaseSensitiveFileNames):this.watchFileWorker.bind(this),getModifiedTime:this.getModifiedTime.bind(this),setTimeout:this.setTimeout.bind(this),clearTimeout:this.clearTimeout.bind(this),fsWatch:this.fsWatch.bind(this),fileExists:this.fileExists.bind(this),useCaseSensitiveFileNames:this.useCaseSensitiveFileNames,getCurrentDirectory:this.getCurrentDirectory.bind(this),fsSupportsRecursiveFsWatch:!y&&!f,directoryExists:this.directoryExists.bind(this),getAccessibleSortedChildDirectories:e=>a.getDirectories(e),realpath:this.realpath.bind(this),tscWatchFile:_,tscWatchDirectory:y,defaultWatchFileKind(){var e;return null===(e=a.defaultWatchFileKind)||void 0===e?void 0:e.call(a)}}),b=v.watchFile,E=v.watchDirectory;this.watchFile=b,this.watchDirectory=E,this.reloadFS(r)}return c.prototype.writeOutputIsTTY=function(){return!0},c.prototype.getNewLine=function(){return this.newLine},c.prototype.toNormalizedAbsolutePath=function(t){return e.getNormalizedAbsolutePath(t,this.currentDirectory)},c.prototype.toFullPath=function(e){return this.toPath(this.toNormalizedAbsolutePath(e))},c.prototype.getHostSpecificPath=function(t){return this.windowsStyleRoot&&t.startsWith(e.directorySeparator)?this.windowsStyleRoot+t.substring(1):t},c.prototype.now=function(){return this.time+=1e3,new Date(this.time)},c.prototype.reloadFS=function(n,i){var a=this;e.Debug.assert(0===this.fs.size),n=n.concat(this.withSafeList?t.safeList:[]);for(var c=0,l=this.windowsStyleRoot?n.map((t=>{var n=e.clone(t);return n.path=a.getHostSpecificPath(t.path),n})):n;c<l.length;c++){var u=l[c],d=this.toFullPath(u.path),p=this.fs.get(d);p?o(p)?r(u)&&p.content!==u.content&&this.modifyFile(u.path,u.content,i):s(p)||r(u)||(p.modifiedTime=this.now(),this.invokeFsWatches(p.fullPath,"change")):this.ensureFileOrFolder(u,i&&i.ignoreWatchInvokedWithTriggerAsFileCreate)}},c.prototype.modifyFile=function(t,n,r){var i=this.toFullPath(t),a=this.fs.get(i);if(!a||!o(a))throw new Error("file not present: "+t);if(r&&r.invokeFileDeleteCreateAsPartInsteadOfChange)this.removeFileOrFolder(a,e.returnFalse),this.ensureFileOrFolder({path:t,content:n});else if(a.content=n,a.modifiedTime=this.now(),this.fs.get(e.getDirectoryPath(a.path)).modifiedTime=this.now(),r&&r.invokeDirectoryWatcherInsteadOfFileChanged){var s=e.getDirectoryPath(a.fullPath);this.invokeFileWatcher(s,e.FileWatcherEventKind.Changed,!0),this.invokeFsWatchesCallbacks(s,"rename",a.fullPath),this.invokeRecursiveFsWatches(s,"rename",a.fullPath)}else this.invokeFileAndFsWatches(a.fullPath,e.FileWatcherEventKind.Changed)},c.prototype.renameFile=function(t,n){var r=e.getNormalizedAbsolutePath(t,this.currentDirectory),i=this.toPath(r),a=this.fs.get(i);e.Debug.assert(!!a),this.removeFileOrFolder(a,e.returnFalse,!0);var o=e.getNormalizedAbsolutePath(n,this.cu