text: !function(e,t){for(var n in t)e[n]=t[n]}(exports,function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=62)}([function(e,t){e.exports=require("vscode")},function(e,t){e.exports=require("path")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);var i;!function(e){e.fromTextSpan=(t=>e.fromLocations(t.start,t.end)),e.fromLocations=((e,t)=>new r.Range(Math.max(0,e.line-1),Math.max(e.offset-1,0),Math.max(0,t.line-1),Math.max(0,t.offset-1))),e.toFileRangeRequestArgs=((e,t)=>({file:e,startLine:t.start.line+1,startOffset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1})),e.toFormattingRequestArgs=((e,t)=>({file:e,line:t.start.line+1,offset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}))}(i=t.Range||(t.Range={})),function(e){e.fromLocation=(e=>new r.Position(e.line-1,e.offset-1)),e.toLocation=(e=>({line:e.line+1,offset:e.character+1})),e.toFileLocationRequestArgs=((e,t)=>({file:e,line:t.line+1,offset:t.character+1}))}(t.Position||(t.Position={})),function(e){e.fromTextSpan=((e,t)=>new r.Location(e,i.fromTextSpan(t)))}(t.Location||(t.Location={})),function(e){e.fromCodeEdit=(e=>new r.TextEdit(i.fromTextSpan(e),e.newText))}(t.TextEdit||(t.TextEdit={})),function(e){function t(e,t,n){for(const r of n){const n=t.toResource(r.fileName);for(const t of r.textChanges)e.replace(n,i.fromTextSpan(t),t.newText)}return e}e.fromFileCodeEdits=function(e,n){return t(new r.WorkspaceEdit,e,n)},e.withFileCodeEdits=t}(t.WorkspaceEdit||(t.WorkspaceEdit={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,s,o,a,c=n(1),u=n(5),l=Object.prototype.toString;function h(e){return void 0!==e}function p(e){return"[object String]"===l.call(e)}function d(e){return JSON.parse(u.readFileSync(e,"utf8"))}function f(e,t){return a&&(e="［"+e.replace(/[aouei]/g,"$&$&")+"］"),0===t.length?e:e.replace(/\{(\d+)\}/g,function(e,n){var r=n[0],i=t[r],s=e;return"string"==typeof i?s=i:"number"!=typeof i&&"boolean"!=typeof i&&void 0!==i&&null!==i||(s=String(i)),s})}function g(e){return function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return function(e){return"[object Number]"===l.call(e)}(t)?t>=e.length?void console.error("Broken localize call found. Index out of bounds. Stacktrace is\n: "+new Error("").stack):f(e[t],r):p(n)?(console.warn("Message "+n+" didn't get externalized correctly."),f(n,r)):void console.error("Broken localize call found. Stacktrace is\n: "+new Error("").stack)}}function m(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return f(t,n)}function v(e,t){return s[e]=t,t}function y(e,t){var n,r=c.join(o.cacheRoot,e.id+"-"+e.hash+".json"),i=!1,s=!1;try{return n=JSON.parse(u.readFileSync(r,{encoding:"utf8",flag:"r"})),function(e){var t=new Date;u.utimes(e,t,t,function(){})}(r),n}catch(e){if("ENOENT"===e.code)s=!0;else{if(!(e instanceof SyntaxError))throw e;console.log("Syntax error parsing message bundle: "+e.message+"."),u.unlink(r,function(e){e&&console.error("Deleting corrupted bundle "+r+" failed.")}),i=!0}}if(!(n=function(e,t){var n=o.translationsConfig[e.id];if(n){var r=d(n).contents,i=d(c.join(t,"nls.metadata.json")),s=Object.create(null);for(var a in i){var u=i[a],l=r[e.outDir+"/"+a];if(l){for(var h=[],f=0;f<u.keys.length;f++){var g=u.keys[f],m=l[p(g)?g:g.key];void 0===m&&(m=u.messages[f]),h.push(m)}s[a]=h}else s[a]=u.messages}return s}}(e,t))||i)return n;if(s)try{u.writeFileSync(r,JSON.stringify(n),{encoding:"utf8",flag:"wx"})}catch(e){if("EEXIST"===e.code)return n;throw e}return n}function b(e){try{return function(e){var t=d(c.join(e,"nls.metadata.json")),n=Object.create(null);for(var r in t){var i=t[r];n[r]=i.messages}return n}(e)}catch(e){return void console.log("Generating default bundle from meta data failed.",e)}}function _(e,t){var n;if(!0===o.languagePackSupport&&void 0!==o.cacheRoot&&void 0!==o.languagePackId&&void 0!==o.translationsConfigFile&&void 0!==o.translationsConfig)try{n=y(e,t)}catch(e){console.log("Load or create bundle failed ",e)}if(!n){if(o.languagePackSupport)return b(t);var r=function(e){for(var t=o.locale;t;){var n=c.join(e,"nls.bundle."+t+".json");if(u.existsSync(n))return n;var r=t.lastIndexOf("-");t=r>0?t.substring(0,r):void 0}if(void 0===t&&(n=c.join(e,"nls.bundle.json"),u.existsSync(n)))return n}(t);if(r)try{return d(r)}catch(e){console.log("Loading in the box message bundle failed.",e)}n=b(t)}return n}function w(e){if(!e)return m;var t=c.extname(e);if(t&&(e=e.substr(0,e.length-t.length)),o.messageFormat===r.both||o.messageFormat===r.bundle){var n=function(e){for(var t,n=c.dirname(e);t=c.join(n,"nls.metadata.header.json"),!u.existsSync(t);){var r=c.dirname(n);if(r===n){t=void 0;break}n=r}return t}(e);if(n){var i=c.dirname(n),l=s[i];if(void 0===l)try{var p=JSON.parse(u.readFileSync(n,"utf8"));try{var f=_(p,i);l=v(i,f?{header:p,nlsBundle:f}:null)}catch(e){console.error("Failed to load nls bundle",e),l=v(i,null)}}catch(e){console.error("Failed to read header file",e),l=v(i,null)}if(l){var y=e.substr(i.length+1).replace(/\\/g,"/"),b=l.nlsBundle[y];return void 0===b?(console.error("Messages for file "+e+" not found. See console for details."),function(){return"Messages not found."}):g(b)}}}if(o.messageFormat===r.both||o.messageFormat===r.file)try{var w=d(function(e){var t;if(o.cacheLanguageResolution&&t)t=t;else{if(a||!o.locale)t=".nls.json";else for(var n=o.locale;n;){var r=".nls."+n+".json";if(u.existsSync(e+r)){t=r;break}var i=n.lastIndexOf("-");i>0?n=n.substring(0,i):(t=".nls.json",n=null)}o.cacheLanguageResolution&&(t=t)}return e+t}(e));return Array.isArray(w)?g(w):h(w.messages)&&h(w.keys)?g(w.messages):(console.error("String bundle '"+e+"' uses an unsupported format."),function(){return"File bundle has unsupported format. See console for details"})}catch(e){"ENOENT"!==e.code&&console.error("Failed to load single file bundle",e)}return console.error("Failed to load message bundle for file "+e),function(){return"Failed to load message bundle. See console for details."}}!function(e){e.file="file",e.bundle="bundle",e.both="both"}(r=t.MessageFormat||(t.MessageFormat={})),function(e){e.is=function(e){var t=e;return t&&h(t.key)&&h(t.comment)}}(i||(i={})),function(){if(o={locale:void 0,languagePackSupport:!1,cacheLanguageResolution:!0,messageFormat:r.bundle},p(process.env.VSCODE_NLS_CONFIG))try{var e=JSON.parse(process.env.VSCODE_NLS_CONFIG);if(p(e.locale)&&(o.locale=e.locale.toLowerCase()),function(e){return!0===e||!1===e}(e._languagePackSupport)&&(o.languagePackSupport=e._languagePackSupport),p(e._cacheRoot)&&(o.cacheRoot=e._cacheRoot),p(e._languagePackId)&&(o.languagePackId=e._languagePackId),p(e._translationsConfigFile)){o.translationsConfigFile=e._translationsConfigFile;try{o.translationsConfig=d(o.translationsConfigFile)}catch(t){e._corruptedFile&&u.writeFile(e._corruptedFile,"corrupted","utf8",function(e){console.error(e)})}}}catch(e){}a="pseudo"===o.locale,void 0,s=Object.create(null)}(),t.loadMessageBundle=w,t.config=function(e){return e&&(p(e.locale)&&(o.locale=e.locale.toLowerCase(),void 0,s=Object.create(null)),void 0!==e.messageFormat&&(o.messageFormat=e.messageFormat)),a="pseudo"===o.locale,w}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(74),i=n(3).loadMessageBundle(n(1).join(__dirname,"utils/api.ts"));class s{constructor(e,t){this.versionString=e,this.version=t}static fromSimpleString(e){return new s(e,e)}static fromVersionString(e){let t=r.valid(e);if(!t)return new s(i(0,null),"1.0.0");const n=e.indexOf("-");return n>=0&&(t=t.substr(0,n)),new s(e,t)}gte(e){return r.gte(this.version,e.version)}lt(e){return!this.gte(e)}}t.default=s,s.defaultVersion=s.fromSimpleString("1.0.0"),s.v220=s.fromSimpleString("2.2.0"),s.v222=s.fromSimpleString("2.2.2"),s.v230=s.fromSimpleString("2.3.0"),s.v234=s.fromSimpleString("2.3.4"),s.v240=s.fromSimpleString("2.4.0"),s.v250=s.fromSimpleString("2.5.0"),s.v260=s.fromSimpleString("2.6.0"),s.v270=s.fromSimpleString("2.7.0"),s.v280=s.fromSimpleString("2.8.0"),s.v290=s.fromSimpleString("2.9.0"),s.v291=s.fromSimpleString("2.9.1"),s.v292=s.fromSimpleString("2.9.2"),s.v300=s.fromSimpleString("3.0.0"),s.v310=s.fromSimpleString("3.1.0"),s.v314=s.fromSimpleString("3.1.4"),s.v320=s.fromSimpleString("3.2.0"),s.v330=s.fromSimpleString("3.3.0"),s.v333=s.fromSimpleString("3.3.3"),s.v340=s.fromSimpleString("3.4.0"),s.v345=s.fromSimpleString("3.4.5"),s.v350=s.fromSimpleString("3.5.0")},function(e,t){e.exports=require("fs")},function(e,t,n){"use strict";function r(e){for(;e.length;){const t=e.pop();t&&t.dispose()}}Object.defineProperty(t,"__esModule",{value:!0}),t.disposeAll=r;t.Disposable=class{constructor(){this._isDisposed=!1,this._disposables=[]}dispose(){this._isDisposed||(this._isDisposed=!0,r(this._disposables))}_register(e){return this._isDisposed?e.dispose():this._disposables.push(e),e}get isDisposed(){return this._isDisposed}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44),i=n(44);t.makePatchingRequire=i.makePatchingRequire;var s=function(e){return!0},o=function(){function e(){this.version=n(112).version,this.subscribers={},this.contextPreservationFunction=function(e){return e},this.knownPatches={},this.currentlyPublishing=!1}return e.prototype.shouldPublish=function(e){var t=this.subscribers[e];return!!t&&t.some(function(e){var t=e.filter;return!t||t(!1)})},e.prototype.publish=function(e,t){if(!this.currentlyPublishing){var n=this.subscribers[e];if(n){var r={timestamp:Date.now(),data:t};this.currentlyPublishing=!0,n.forEach(function(e){var t=e.listener,n=e.filter;try{n&&n(!0)&&t(r)}catch(e){}}),this.currentlyPublishing=!1}}},e.prototype.subscribe=function(e,t,n){void 0===n&&(n=s),this.subscribers[e]||(this.subscribers[e]=[]),this.subscribers[e].push({listener:t,filter:n})},e.prototype.unsubscribe=function(e,t,n){void 0===n&&(n=s);var r=this.subscribers[e];if(r)for(var i=0;i<r.length;++i)if(r[i].listener===t&&r[i].filter===n)return r.splice(i,1),!0;return!1},e.prototype.reset=function(){var e=this;this.subscribers={},this.contextPreservationFunction=function(e){return e},Object.getOwnPropertyNames(this.knownPatches).forEach(function(t){return delete e.knownPatches[t]})},e.prototype.bindToContext=function(e){return this.contextPreservationFunction(e)},e.prototype.addContextPreservation=function(e){var t=this.contextPreservationFunction;this.contextPreservationFunction=function(n){return e(t(n))}},e.prototype.registerMonkeyPatch=function(e,t){this.knownPatches[e]||(this.knownPatches[e]=[]),this.knownPatches[e].push(t)},e.prototype.getPatchesObject=function(){return this.knownPatches},e}();global.diagnosticsSource||(global.diagnosticsSource=new o,n(45).prototype.require=r.makePatchingRequire(global.diagnosticsSource.getPatchesObject()));t.channel=global.diagnosticsSource},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(6);class s{constructor(e){this._doRegister=e,this.registration=void 0}dispose(){this.registration&&(this.registration.dispose(),this.registration=void 0)}update(e){e?this.registration||(this.registration=this._doRegister()):this.registration&&(this.registration.dispose(),this.registration=void 0)}}t.ConditionalRegistration=s;t.VersionDependentRegistration=class extends i.Disposable{constructor(e,t,n){super(),this.client=e,this.minVersion=t,this._registration=new s(n),this.update(e.apiVersion),this.client.onTsServerStarted(()=>{this.update(this.client.apiVersion)},null,this._disposables)}dispose(){super.dispose(),this._registration.dispose()}update(e){this._registration.update(e.gte(this.minVersion))}};t.ConfigurationDependentRegistration=class extends i.Disposable{constructor(e,t,n){super(),this.language=e,this.configValue=t,this._registration=new s(n),this.update(),r.workspace.onDidChangeConfiguration(this.update,this,this._disposables)}dispose(){super.dispose(),this._registration.dispose()}update(){const e=r.workspace.getConfiguration(this.language,null);this._registration.update(!!e.get(this.configValue))}}},function(e,t,n){"use strict";var r=function(){function e(){}return e.info=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e.enableDebug&&console.info(e.TAG+t,n)},e.warn=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];e.disableWarnings||console.warn(e.TAG+t,n)},e.enableDebug=!1,e.disableWarnings=!1,e.TAG="ApplicationInsights:",e}();e.exports=r},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(131)),r(n(46)),r(n(146))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memoize=function(e,t,n){let r,i;if("function"==typeof n.value)r="value",i=n.value;else{if("function"!=typeof n.get)throw new Error("not supported");r="get",i=n.get}const s=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[s]}}},function(e,t,n){"use strict";var r=function(){return function(){}}();e.exports=r},function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=n(30),s=n(31),o=n(23),a=n(151),c=n(9),u=n(21),l=function(){function e(){}return e.getCookie=function(t,n){var r="";if(t&&t.length&&"string"==typeof n)for(var i=t+"=",s=n.split(";"),o=0;o<s.length;o++){n=s[o];if((n=e.trim(n))&&0===n.indexOf(i)){r=n.substring(i.length,s[o].length);break}}return r},e.trim=function(e){return"string"==typeof e?e.replace(/^\s+|\s+$/g,""):""},e.int32ArrayToBase64=function(e){var t=function(e,t){return String.fromCharCode(e>>t&255)},n=e.map(function(e){return t(e,24)+t(e,16)+t(e,8)+t(e,0)}).join(""),r=(Buffer.from?Buffer.from(n,"binary"):new Buffer(n,"binary")).toString("base64");return r.substr(0,r.indexOf("="))},e.random32=function(){return 4294967296*Math.random()|0},e.randomu32=function(){return e.random32()+2147483648},e.w3cTraceId=function(){for(var t,n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",i=0;i<4;i++)r+=n[15&(t=e.random32())]+n[t>>4&15]+n[t>>8&15]+n[t>>12&15]+n[t>>16&15]+n[t>>20&15]+n[t>>24&15]+n[t>>28&15];var s=n[8+4*Math.random()|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+s+r.substr(16,3)+r.substr(19,12)},e.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},e.isError=function(e){return e instanceof Error},e.isPrimitive=function(e){var t=typeof e;return"string"===t||"number"===t||"boolean"===t},e.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},e.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,""),n=""+Math.floor(e/6e4)%60,r=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=t.indexOf(".")<2?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(i>0?i+".":"")+r+":"+n+":"+t},e.extractError=function(e){var t=e;return{message:e.message,code:t.code||t.id||""}},e.extractObject=function(t){return t instanceof Error?e.extractError(t):"function"==typeof t.toJSON?t.toJSON():t},e.validateStringMap=function(t){if("object"==typeof t){var n={};for(var r in t){var i="",s=t[r],o=typeof s;if(e.isPrimitive(s))i=s.toString();else if(null===s||"undefined"===o)i="";else{if("function"===o){c.info("key: "+r+" was function; will not serialize");continue}var a=e.isArray(s)?s:e.extractObject(s);try{i=e.isPrimitive(a)?a:JSON.stringify(a)}catch(e){i=s.constructor.name.toString()+" (Error: "+e.message+")",c.info("key: "+r+", could not be serialized")}}n[r]=i.substring(0,e.MAX_PROPERTY_LENGTH)}return n}c.info("Invalid properties dropped from payload")},e.canIncludeCorrelationHeader=function(e,t){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||0==n.length||!t)return!0;for(var r=0;r<n.length;r++){if(new RegExp(n[r].replace(/\./g,".").replace(/\*/g,".*")).test(o.parse(t).hostname))return!1}return!0},e.getCorrelationContextTarget=function(e,t){var n=e.headers&&e.headers[u.requestContextHeader];if(n)for(var r=n.split(","),i=0;i<r.length;++i){var s=r[i].split("=");if(2==s.length&&s[0]==t)return s[1]}},e.makeRequest=function(t,n,a,u){n&&0===n.indexOf("//")&&(n="https:"+n);var l=o.parse(n),h=r({},a,{host:l.hostname,port:l.port,path:l.pathname}),p=void 0;if("https:"===l.protocol&&(p=t.proxyHttpsUrl||void 0),"http:"===l.protocol&&(p=t.proxyHttpUrl||void 0),p){0===p.indexOf("//")&&(p="http:"+p);var d=o.parse(p);"https:"===d.protocol?(c.info("Proxies that use HTTPS are not supported"),p=void 0):h=r({},h,{host:d.hostname,port:d.port||"80",path:n,headers:r({},h.headers,{Host:l.hostname})})}var f="https:"===l.protocol&&!p;return f&&void 0!==t.httpsAgent?h.agent=t.httpsAgent:f||void 0===t.httpAgent?f&&(h.agent=e.tlsRestrictedAgent):h.agent=t.httpAgent,f?s.request(h,u):i.request(h,u)},e.MAX_PROPERTY_LENGTH=8192,e.tlsRestrictedAgent=new s.Agent({secureOptions:a.SSL_OP_NO_SSLv2|a.SSL_OP_NO_SSLv3|a.SSL_OP_NO_TLSv1|a.SSL_OP_NO_TLSv1_1}),e}();e.exports=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);t.typescript="typescript",t.typescriptreact="typescriptreact",t.javascript="javascript",t.javascriptreact="javascriptreact",t.jsxTags="jsx-tags",t.isSupportedLanguageMode=function(e){return r.languages.match([t.typescript,t.typescriptreact,t.javascript,t.javascriptreact],e)>0},t.isTypeScriptDocument=function(e){return r.languages.match([t.typescript,t.typescriptreact],e)>0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.empty=Object.freeze([]),t.equals=function(e,t,n=((e,t)=>e===t)){return e===t||e.length===t.length&&e.every((e,r)=>n(e,t[r]))},t.flatten=function(e){return Array.prototype.concat.apply([],e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new(n(0).CancellationTokenSource);t.nulToken=r.token},function(e,t){e.exports=require("os")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{}t.Kind=r,r.alias="alias",r.callSignature="call",r.class="class",r.const="const",r.constructorImplementation="constructor",r.constructSignature="construct",r.directory="directory",r.enum="enum",r.externalModuleName="external module name",r.function="function",r.indexSignature="index",r.interface="interface",r.keyword="keyword",r.let="let",r.localFunction="local function",r.localVariable="local var",r.memberFunction="method",r.memberGetAccessor="getter",r.memberSetAccessor="setter",r.memberVariable="property",r.module="module",r.primitiveType="primitive type",r.script="script",r.type="type",r.variable="var",r.warning="warning",r.string="string",r.parameter="parameter";class i{}t.DiagnosticCategory=i,i.error="error",i.warning="warning",i.suggestion="suggestion";class s{}t.KindModifiers=s,s.optional="optional",s.color="color",s.dtsFile=".d.ts",s.tsFile=".ts",s.tsxFile=".tsx",s.jsFile=".js",s.jsxFile=".jsx",s.jsonFile=".json",s.fileExtensionKindModifiers=[s.dtsFile,s.tsFile,s.tsxFile,s.jsFile,s.jsxFile,s.jsonFile];class o{}t.DisplayPartKind=o,o.functionName="functionName",o.methodName="methodName",o.parameterName="parameterName",o.propertyName="propertyName",o.punctuation="punctuation",o.text="text"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.file="file",t.untitled="untitled",t.walkThroughSnippet="walkThroughSnippet",t.supportedSchemes=[t.file,t.untitled,t.walkThroughSnippet],t.isSupportedScheme=function(e){return t.supportedSchemes.indexOf(e)>=0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(27),s=function(){function e(){}return e.getCurrentContext=function(){return e.enabled?Zone.current.get("context"):null},e.generateContextObject=function(e,t,n,r){return t=t||e,this.enabled?{operation:{name:n,id:e,parentId:t},customProperties:new o(r)}:null},e.runWithContext=function(t,n){e.enabled?Zone.current.fork({name:"AI-"+(t&&t.operation.parentId||"Unknown"),properties:{context:t}}).run(n):n()},e.wrapCallback=function(t){return e.enabled?Zone.current.wrap(t,"User-wrapped method"):t},e.enable=function(){if(!this.enabled)if(this.isNodeVersionCompatible()){if(!e.hasEverEnabled){this.hasEverEnabled=!0;try{"undefined"==typeof Zone&&n(125)}catch(e){r.warn("Failed to require zone.js")}i.registerContextPreservation(function(e){return Zone.current.wrap(e,"AI-ContextPreservation")}),this.patchError(),this.patchTimers(["setTimeout","setInterval"])}this.enabled=!0}else this.enabled=!1},e.disable=function(){this.enabled=!1},e.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},e.patchTimers=function(e){e.forEach(function(e){var t=global[e];global[e]=function(){var e=t.apply(this,arguments);return e.toString=function(){return this.data&&void 0!==this.data.handleId?this.data.handleId.toString():Object.prototype.toString.call(this)},e}})},e.patchError=function(){var e=global.Error;function t(){if(!(this instanceof t))return t.apply(Object.create(t.prototype),arguments);var n=e.stackRewrite;if(e.prepareStackTrace){e.stackRewrite=!1;var r=e.prepareStackTrace;e.prepareStackTrace=function(e,t){for(var n=!1,i=0;i<t.length;i++){var s=t[i].getFileName();if(s)if(-1===s.indexOf("AutoCollection/CorrelationContextManager")&&-1===s.indexOf("AutoCollection\\CorrelationContextManager")){if(n)break}else n=!0}return i=Math.max(0,i-1),n&&t.splice(0,i),r(e,t)}}if(e.apply(this,arguments),e.stackRewrite=n,this.stack&&"string"==typeof this.stack){var i=this.stack.split("\n");i.length>3&&(0===i[2].trim().indexOf("at Error.AppInsightsAsyncCorrelatedErrorWrapper")?i.splice(2,1):0===i[1].trim().indexOf("at AppInsightsAsyncCorrelatedErrorWrapper.ZoneAwareError")&&0===i[2].trim().indexOf("at new AppInsightsAsyncCorrelatedErrorWrapper")&&i.splice(1,2)),this.stack=i.map(function(e){var t=e.indexOf(") [");return t>-1&&(e=e.substr(0,t+1)),e}).join("\n")}for(var s=Object.getOwnPropertyNames(this).concat(Object.keys(this)),o=0;o<s.length;o++){var a=s[o],c=Zone.__symbol__(a);Object.defineProperty(this,a,{enumerable:!1}),Object.defineProperty(this,c,{enumerable:!1,writable:!0})}return this}t.prototype=e.prototype;for(var n=Object.getOwnPropertyNames(e),r=0;r<n.length;r++){var i=n[r];t[i]||Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(e,i))}global.Error=t},e.enabled=!1,e.hasEverEnabled=!1,e}();t.CorrelationContextManager=s;var o=function(){function e(e){this.props=[],this.addHeaderData(e)}return e.prototype.addHeaderData=function(e){var t=e?e.split(", "):[];this.props=t.map(function(e){var t=e.split("=");return{key:t[0],value:t[1]}}).concat(this.props)},e.prototype.serializeToHeader=function(){return this.props.map(function(e){return e.key+"="+e.value}).join(", ")},e.prototype.getProperty=function(e){for(var t=0;t<this.props.length;++t){var n=this.props[t];if(n.key===e)return n.value}},e.prototype.setProperty=function(t,n){if(e.bannedCharacters.test(t)||e.bannedCharacters.test(n))r.warn("Correlation context property keys and values must not contain ',' or '='. setProperty was called with key: "+t+" and value: "+n);else{for(var i=0;i<this.props.length;++i){var s=this.props[i];if(s.key===t)return void(s.value=n)}this.props.push({key:t,value:n})}},e.bannedCharacters=/[,=]/,e}()},function(e,t,n){"use strict";e.exports={requestContextHeader:"request-context",requestContextSourceKey:"appId",requestContextTargetKey:"appId",requestIdHeader:"request-id",parentIdHeader:"x-ms-request-id",rootIdHeader:"x-ms-request-root-id",correlationContextHeader:"correlation-context"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(0);function s(e){const t={module:"commonjs",target:"es2016",jsx:"preserve"};return e.checkJs&&(t.checkJs=!0),e.experimentalDecorators&&(t.experimentalDecorators=!0),t}t.isImplicitProjectConfigFile=function(e){return 0===e.indexOf("/dev/null/")},t.inferredProjectConfig=s,t.openOrCreateConfigFile=async function(e,t,n){const o=i.Uri.file(r.join(t,e?"tsconfig.json":"jsconfig.json")),a=i.window.activeTextEditor?i.window.activeTextEditor.viewColumn:void 0;try{const e=await i.workspace.openTextDocument(o);return i.window.showTextDocument(e,a)}catch(e){const t=await i.workspace.openTextDocument(o.with({scheme:"untitled"})),r=await i.window.showTextDocument(t,a);return 0===r.document.getText().length&&await r.insertSnippet(function(e){const t=s(e),n=Object.keys(t).map(e=>`"${e}": ${JSON.stringify(t[e])}`);return new i.SnippetString(`{\n\t"compilerOptions": {\n\t\t${n.join(",\n\t\t")}$0\n\t},\n\t"exclude": [\n\t\t"node_modules",\n\t\t"**/node_modules/*"\n\t]\n}`)}(n)),r}}},function(e,t){e.exports=require("url")},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0});const i=n(5),s=n(11),o=n(38);class a{constructor(e=(e=>e.fsPath)){this._normalizePath=e,this._map=new Map}get size(){return this._map.size}has(e){const t=this.toKey(e);return!!t&&this._map.has(t)}get(e){const t=this.toKey(e);if(!t)return;const n=this._map.get(t);return n?n.value:void 0}set(e,t){const n=this.toKey(e);if(!n)return;const r=this._map.get(n);r?r.value=t:this._map.set(n,{resource:e,value:t})}delete(e){const t=this.toKey(e);t&&this._map.delete(t)}clear(){this._map.clear()}get values(){return Array.from(this._map.values()).map(e=>e.value)}get entries(){return this._map.values()}toKey(e){const t=this._normalizePath(e);return t&&this.isCaseInsensitivePath(t)?t.toLowerCase():t}isCaseInsensitivePath(e){return!!c(e)||"/"===e[0]&&this.onIsCaseInsenitiveFileSystem}get onIsCaseInsenitiveFileSystem(){if("win32"===process.platform)return!0;if("darwin"!==process.platform)return!1;const e=o.getTempFile("typescript-case-check");return i.writeFileSync(e,""),i.existsSync(e.toUpperCase())}}function c(e){return/^[a-zA-Z]:\\/.test(e)}r([s.memoize],a.prototype,"onIsCaseInsenitiveFileSystem",null),t.ResourceMap=a,t.isWindowsPath=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);function i(e){switch(e.name){case"param":const t=(e.text||"").split(/^([\w\.]+)\s*-?\s*/);if(t&&3===t.length){const n=t[1],r=t[2],i=`*@${e.name}* \`${n}\``;return r?i+(r.match(/\r\n|\n/g)?"  \n"+r:` — ${r}`):i}}const t=`*@${e.name}*`,n=function(e){if(e.text){switch(e.name){case"example":const n=e.text.match(/<caption>(.*?)<\/caption>\s*(\r\n|\n)/);return n&&0===n.index?n[1]+"\n\n"+t(e.text.substr(n[0].length)):t(e.text);case"default":return t(e.text)}return e.text}function t(e){return e.match(/^\s*[~`]{3}/g)?e:"```\n"+e+"\n```"}}(e);return n?t+(n.match(/\r\n|\n/g)?"  \n"+n:` — ${n}`):t}function s(e){return e?e.map(e=>e.text).join(""):""}function o(e){return(e||[]).map(i).join("  \n\n")}function a(e,t,n){if(t&&e.appendMarkdown(s(t)),n){const t=o(n);t&&e.appendMarkdown("\n\n"+t)}return e}t.plain=s,t.tagsMarkdownPreview=o,t.markdownDocumentation=function(e,t){const n=new r.MarkdownString;return a(n,e,t),n},t.addMarkdownDocumentation=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);t.default=class{constructor(e){this.client=e}async getSymbolLocations(e,t,n,i){const s=this.client.toOpenedFilePath(t);if(!s)return;const o=r.Position.toFileLocationRequestArgs(s,n),a=await this.client.execute(e,o,i);return"response"===a.type&&a.body?a.body.map(e=>r.Location.fromTextSpan(this.client.toResource(e.file),e)):void 0}}},function(e,t,n){"use strict";if(Object.defineProperty(t,"__esModule",{value:!0}),t.IsInitialized=!process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL,t.IsInitialized){var r=n(109),i=(process.env.APPLICATION_INSIGHTS_NO_PATCH_MODULES||"").split(","),s={bunyan:r.bunyan,console:r.console,mongodb:r.mongodb,mongodbCore:r.mongodbCore,mysql:r.mysql,redis:r.redis,pg:r.pg,pgPool:r.pgPool,winston:r.winston};for(var o in s)-1===i.indexOf(o)&&s[o].enable()}t.registerContextPreservation=function(e){t.IsInitialized&&n(7).channel.addContextPreservation(e)}},function(e,t){e.exports=require("events")},function(e,t,n){"use strict";var r=n(30),i=n(31),s=n(9),o=n(13),a=n(21),c=n(152),u=n(20),l=n(27),h=function(){function e(t){if(e.INSTANCE)throw new Error("Client request tracking should be configured from the applicationInsights object");e.INSTANCE=this,this._client=t}return e.prototype.enable=function(e){this._isEnabled=e,this._isEnabled&&!this._isInitialized&&this._initialize(),l.IsInitialized&&(n(153).enable(e,this._client),n(154).enable(e,this._client),n(155).enable(e,this._client),n(156).enable(e,this._client))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype._initialize=function(){var t=this;this._isInitialized=!0;r.get;var n=r.request,s=i.request,o=function(n,r){var i=!r[e.disableCollectionRequestOption]&&!n[e.alreadyAutoCollectedFlag];n[e.alreadyAutoCollectedFlag]=!0,n&&r&&i&&e.trackRequest(t._client,{options:r,request:n})};r.request=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];var s=n.call.apply(n,[r,e].concat(t));return o(s,e),s},i.request=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=s.call.apply(s,[i,e].concat(t));return o(r,e),r},r.get=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i,s=(i=r.request).call.apply(i,[r,e].concat(t));return s.end(),s},i.get=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,s=(r=i.request).call.apply(r,[i,e].concat(t));return s.end(),s}},e.trackRequest=function(t,n){if(n.options&&n.request&&t){var r=new c(n.options,n.request),i=u.CorrelationContextManager.getCurrentContext(),l=i&&i.operation&&i.operation.parentId+e.requestNumber+++".";if(o.canIncludeCorrelationHeader(t,r.getUrl())&&n.request.getHeader&&n.request.setHeader){if(t.config&&t.config.correlationId){var h=n.request.getHeader(a.requestContextHeader);if(h){var p=h.split(","),d=a.requestContextSourceKey+"=";p.some(function(e){return e.substring(0,d.length)===d})||n.request.setHeader(a.requestContextHeader,h+","+a.requestContextSourceKey+"="+t.config.correlationId)}else n.request.setHeader(a.requestContextHeader,a.requestContextSourceKey+"="+t.config.correlationId)}if(i&&i.operation){n.request.setHeader(a.requestIdHeader,l),n.request.setHeader(a.parentIdHeader,i.operation.id),n.request.setHeader(a.rootIdHeader,l);var f=i.customProperties.serializeToHeader();f&&n.request.setHeader(a.correlationContextHeader,f)}}n.request.on&&(n.request.on("response",function(e){r.onResponse(e);var i=r.getDependencyTelemetry(n,l);i.contextObjects=i.contextObjects||{},i.contextObjects["http.RequestOptions"]=n.options,i.contextObjects["http.ClientRequest"]=n.request,i.contextObjects["http.ClientResponse"]=e,t.trackDependency(i)}),n.request.on("error",function(e){r.onError(e);var i=r.getDependencyTelemetry(n,l);i.contextObjects=i.contextObjects||{},i.contextObjects["http.RequestOptions"]=n.options,i.contextObjects["http.ClientRequest"]=n.request,i.contextObjects.Error=e,t.trackDependency(i)}))}else s.info("AutoCollectHttpDependencies.trackRequest was called with invalid parameters: ",!n.options,!n.request,!t)},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1},e.disableCollectionRequestOption="disableAppInsightsAutoCollection",e.requestNumber=1,e.alreadyAutoCollectedFlag="_appInsightsAutoCollected",e}();e.exports=h},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("https")},function(e,t,n){"use strict";var r=n(13),i=n(9),s=function(){function e(){}return e.queryCorrelationId=function(t,n){var s=t.profileQueryEndpoint+"/api/profiles/"+t.instrumentationKey+"/appId";if(e.completedLookups.hasOwnProperty(s))n(e.completedLookups[s]);else if(e.pendingLookups[s])e.pendingLookups[s].push(n);else{e.pendingLookups[s]=[n];var o=function(){if(e.pendingLookups[s]){var n={method:"GET",disableAppInsightsAutoCollection:!0};i.info(e.TAG,n);var a=r.makeRequest(t,s,n,function(n){if(200===n.statusCode){var r="";n.setEncoding("utf-8"),n.on("data",function(e){r+=e}),n.on("end",function(){i.info(e.TAG,r);var t=e.correlationIdPrefix+r;e.completedLookups[s]=t,e.pendingLookups[s]&&e.pendingLookups[s].forEach(function(e){return e(t)}),delete e.pendingLookups[s]})}else n.statusCode>=400&&n.statusCode<500?(e.completedLookups[s]=void 0,delete e.pendingLookups[s]):setTimeout(o,t.correlationIdRetryIntervalMs)});a&&(a.on("error",function(t){i.warn(e.TAG,t)}),a.end())}};setTimeout(o,0)}},e.cancelCorrelationIdQuery=function(t,n){var r=t.profileQueryEndpoint+"/api/profiles/"+t.instrumentationKey+"/appId",i=e.pendingLookups[r];i&&(e.pendingLookups[r]=i.filter(function(e){return e!=n}),0==e.pendingLookups[r].length&&delete e.pendingLookups[r])},e.generateRequestId=function(t){if(t){"."!==(t="|"==t[0]?t:"|"+t)[t.length-1]&&(t+=".");var n=(e.currentRootId++).toString(16);return e.appendSuffix(t,n,"_")}return e.generateRootId()},e.getRootId=function(e){var t=e.indexOf(".");t<0&&(t=e.length);var n="|"===e[0]?1:0;return e.substring(n,t)},e.generateRootId=function(){return"|"+r.w3cTraceId()+"."},e.appendSuffix=function(t,n,i){if(t.length+n.length<e.requestIdMaxLength)return t+n+i;var s=e.requestIdMaxLength-9;if(t.length>s)for(;s>1;--s){var o=t[s-1];if("."===o||"_"===o)break}if(s<=1)return e.generateRootId();for(n=r.randomu32().toString(16);n.length<8;)n="0"+n;return t.substring(0,s)+n+"#"},e.TAG="CorrelationIdManager",e.correlationIdPrefix="cid-v1:",e.pendingLookups={},e.completedLookups={},e.requestIdMaxLength=1024,e.currentRootId=r.randomu32(),e}();e.exports=s},function(e,t){e.exports=require("assert")},function(e,t,n){e.exports=f,f.Minimatch=g;var r={sep:"/"};try{r=n(1)}catch(e){}var i=f.GLOBSTAR=g.GLOBSTAR={},s=n(184),o={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="[^/]",c=a+"*?",u="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",l="(?:(?!(?:\\/|^)\\.).)*?",h=function(e){return e.split("").reduce(function(e,t){return e[t]=!0,e},{})}("().*{}+?[]^$\\!");var p=/\/+/;function d(e,t){e=e||{},t=t||{};var n={};return Object.keys(t).forEach(function(e){n[e]=t[e]}),Object.keys(e).forEach(function(t){n[t]=e[t]}),n}function f(e,t,n){if("string"!=typeof t)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===t.charAt(0))&&(""===t.trim()?""===e:new g(t,n).match(e))}function g(e,t){if(!(this instanceof g))return new g(e,t);if("string"!=typeof e)throw new TypeError("glob pattern string required");t||(t={}),e=e.trim(),"/"!==r.sep&&(e=e.split(r.sep).join("/")),this.options=t,this.set=[],this.pattern=e,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}function m(e,t){if(t||(t=this instanceof g?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:s(e)}f.filter=function(e,t){return t=t||{},function(n,r,i){return f(n,e,t)}},f.defaults=function(e){if(!e||!Object.keys(e).length)return f;var t=f,n=function(n,r,i){return t.minimatch(n,r,d(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,d(e,r))},n},g.defaults=function(e){return e&&Object.keys(e).length?f.defaults(e).Minimatch:g},g.prototype.debug=function(){},g.prototype.make=function(){if(this._made)return;var e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();t.debug&&(this.debug=console.error);this.debug(this.pattern,n),n=this.globParts=n.map(function(e){return e.split(p)}),this.debug(this.pattern,n),n=n.map(function(e,t,n){return e.map(this.parse,this)},this),this.debug(this.pattern,n),n=n.filter(function(e){return-1===e.indexOf(!1)}),this.debug(this.pattern,n),this.set=n},g.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=0;if(this.options.nonegate)return;for(var r=0,i=e.length;r<i&&"!"===e.charAt(r);r++)t=!t,n++;n&&(this.pattern=e.substr(n));this.negate=t},f.braceExpand=function(e,t){return m(e,t)},g.prototype.braceExpand=m,g.prototype.parse=function(e,t){if(e.length>65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return i;if(""===e)return"";var r,s="",u=!!n.nocase,l=!1,p=[],d=[],f=!1,g=-1,m=-1,y="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=this;function _(){if(r){switch(r){case"*":s+=c,u=!0;break;case"?":s+=a,u=!0;break;default:s+="\\"+r}b.debug("clearStateChar %j %j",r,s),r=!1}}for(var w,S=0,C=e.length;S<C&&(w=e.charAt(S));S++)if(this.debug("%s\t%s %s %j",e,S,s,w),l&&h[w])s+="\\"+w,l=!1;else switch(w){case"/":return!1;case"\\":_(),l=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",e,S,s,w),f){this.debug("  in class"),"!"===w&&S===m+1&&(w="^"),s+=w;continue}b.debug("call clearStateChar %j",r),_(),r=w,n.noext&&_();continue;case"(":if(f){s+="(";continue}if(!r){s+="\\(";continue}p.push({type:r,start:S-1,reStart:s.length,open:o[r].open,close:o[r].close}),s+="!"===r?"(?:(?!(?:":"(?:",this.debug("plType %j %j",r,s),r=!1;continue;case")":if(f||!p.length){s+="\\)";continue}_(),u=!0;var k=p.pop();s+=k.close,"!"===k.type&&d.push(k),k.reEnd=s.length;continue;case"|":if(f||!p.length||l){s+="\\|",l=!1;continue}_(),s+="|";continue;case"[":if(_(),f){s+="\\"+w;continue}f=!0,m=S,g=s.length,s+=w;continue;case"]":if(S===m+1||!f){s+="\\"+w,l=!1;continue}if(f){var T=e.substring(m+1,S);try{RegExp("["+T+"]")}catch(e){var x=this.parse(T,v);s=s.substr(0,g)+"\\["+x[0]+"\\]",u=u||x[1],f=!1;continue}}u=!0,f=!1,s+=w;continue;default:_(),l?l=!1:!h[w]||"^"===w&&f||(s+="\\"),s+=w}f&&(T=e.substr(m+1),x=this.parse(T,v),s=s.substr(0,g)+"\\["+x[0],u=u||x[1]);for(k=p.pop();k;k=p.pop()){var E=s.slice(k.reStart+k.open.length);this.debug("setting tail",s,k),E=E.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(e,t,n){return n||(n="\\"),t+t+n+"|"}),this.debug("tail=%j\n   %s",E,E,k,s);var P="*"===k.type?c:"?"===k.type?a:"\\"+k.type;u=!0,s=s.slice(0,k.reStart)+P+"\\("+E}_(),l&&(s+="\\\\");var I=!1;switch(s.charAt(0)){case".":case"[":case"(":I=!0}for(var O=d.length-1;O>-1;O--){var A=d[O],D=s.slice(0,A.reStart),R=s.slice(A.reStart,A.reEnd-8),j=s.slice(A.reEnd-8,A.reEnd),M=s.slice(A.reEnd);j+=M;var F=D.split("(").length-1,L=M;for(S=0;S<F;S++)L=L.replace(/\)[+*?]?/,"");var N="";""===(M=L)&&t!==v&&(N="$");var q=D+R+M+N+j;s=q}""!==s&&u&&(s="(?=.)"+s);I&&(s=y+s);if(t===v)return[s,u];if(!u)return function(e){return e.replace(/\\(.)/g,"$1")}(e);var V=n.nocase?"i":"";try{var K=new RegExp("^"+s+"$",V)}catch(e){return new RegExp("$.")}return K._glob=e,K._src=s,K};var v={};f.makeRe=function(e,t){return new g(e,t||{}).makeRe()},g.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var e=this.set;if(!e.length)return this.regexp=!1,this.regexp;var t=this.options,n=t.noglobstar?c:t.dot?u:l,r=t.nocase?"i":"",s=e.map(function(e){return e.map(function(e){return e===i?n:"string"==typeof e?function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(e):e._src}).join("\\/")}).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,r)}catch(e){this.regexp=!1}return this.regexp},f.match=function(e,t,n){var r=new g(t,n=n||{});return e=e.filter(function(e){return r.match(e)}),r.options.nonull&&!e.length&&e.push(t),e},g.prototype.match=function(e,t){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return""===e;if("/"===e&&t)return!0;var n=this.options;"/"!==r.sep&&(e=e.split(r.sep).join("/"));e=e.split(p),this.debug(this.pattern,"split",e);var i,s,o=this.set;for(this.debug(this.pattern,"set",o),s=e.length-1;s>=0&&!(i=e[s]);s--);for(s=0;s<o.length;s++){var a=o[s],c=e;n.matchBase&&1===a.length&&(c=[i]);var u=this.matchOne(c,a,t);if(u)return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate},g.prototype.matchOne=function(e,t,n){var r=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var s=0,o=0,a=e.length,c=t.length;s<a&&o<c;s++,o++){this.debug("matchOne loop");var u,l=t[o],h=e[s];if(this.debug(t,l,h),!1===l)return!1;if(l===i){this.debug("GLOBSTAR",[t,l,h]);var p=s,d=o+1;if(d===c){for(this.debug("** at the end");s<a;s++)if("."===e[s]||".."===e[s]||!r.dot&&"."===e[s].charAt(0))return!1;return!0}for(;p<a;){var f=e[p];if(this.debug("\nglobstar while",e,p,t,d,f),this.matchOne(e.slice(p),t.slice(d),n))return this.debug("globstar found match!",p,a,f),!0;if("."===f||".."===f||!r.dot&&"."===f.charAt(0)){this.debug("dot detected!",e,p,t,d);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!n||(this.debug("\n>>> no match, partial?",e,p,t,d),p!==a))}if("string"==typeof l?(u=r.nocase?h.toLowerCase()===l.toLowerCase():h===l,this.debug("string match",l,h,u)):(u=h.match(l),this.debug("pattern match",l,h,u)),!u)return!1}if(s===a&&o===c)return!0;if(s===a)return n;if(o===c)return s===a-1&&""===e[s];throw new Error("wtf?")}},function(e,t){e.exports=require("util")},function(e,t,n){"use strict";function r(e){return"/"===e.charAt(0)}function i(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/.exec(e),n=t[1]||"",r=Boolean(n&&":"!==n.charAt(1));return Boolean(t[2]||r)}e.exports="win32"===process.platform?i:r,e.exports.posix=r,e.exports.win32=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(14);t.allDiagnosticLanguages=[0,1],t.standardLanguageDescriptions=[{id:"typescript",diagnosticOwner:"typescript",diagnosticSource:"ts",diagnosticLanguage:1,modeIds:[i.typescript,i.typescriptreact],configFilePattern:/^tsconfig(\..*)?\.json$/gi},{id:"javascript",diagnosticOwner:"typescript",diagnosticSource:"ts",diagnosticLanguage:0,modeIds:[i.javascript,i.javascriptreact],configFilePattern:/^jsconfig(\..*)?\.json$/gi}],t.isTsConfigFileName=function(e){return/^tsconfig\.(.+\.)?json$/i.test(r.basename(e))},t.isJsConfigOrTsConfigFileName=function(e){return/^[jt]sconfig\.(.+\.)?json$/i.test(r.basename(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(17);t.makeRandomHexString=function(e){const t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];let n="";for(let r=0;r<e;r++)n+=t[Math.floor(t.length*Math.random())];return n},t.getTempFile=function(e){return r.join(i.tmpdir(),e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(2);function s(e,t){return t.changes&&t.changes.length?i.WorkspaceEdit.fromFileCodeEdits(e,t.changes):void 0}async function o(e,t,n){if(t&&t.length)for(const r of t)await e.execute("applyCodeActionCommand",{command:r},n);return!0}t.getEditForCodeAction=s,t.applyCodeAction=async function(e,t,n){const i=s(e,t);return!(i&&!await r.workspace.applyEdit(i))&&o(e,t.commands,n)},t.applyCodeActionCommands=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(41),o=n(2),a=i.loadMessageBundle(n(1).join(__dirname,"features/baseCodeLensProvider.ts"));class c extends r.CodeLens{constructor(e,t,n){super(n),this.document=e,this.file=t}}t.ReferencesCodeLens=c;class u{constructor(e,t){this.client=e,this.cachedResponse=t,this.onDidChangeCodeLensesEmitter=new r.EventEmitter}get onDidChangeCodeLenses(){return this.onDidChangeCodeLensesEmitter.event}async provideCodeLenses(e,t){const n=this.client.toOpenedFilePath(e);if(!n)return[];const r=await this.cachedResponse.execute(e,()=>this.client.execute("navtree",{file:n},t));if("response"!==r.type)return[];const i=r.body,s=[];return i&&i.childItems&&i.childItems.forEach(t=>this.walkNavTree(e,t,null,s)),s.map(t=>new c(e.uri,n,t))}walkNavTree(e,t,n,r){if(!t)return;const i=this.extractSymbol(e,t,n);i&&r.push(i),(t.childItems||[]).forEach(n=>this.walkNavTree(e,n,t,r))}}t.TypeScriptBaseCodeLensProvider=u,u.cancelledCommand={title:"",command:""},u.errorCommand={title:a(0,null),command:""},t.getSymbolRange=function(e,t){if(t.nameSpan)return o.Range.fromTextSpan(t.nameSpan);const n=t.spans&&t.spans[0];if(!n)return null;const i=o.Range.fromTextSpan(n),a=e.getText(i),c=new RegExp(`^(.*?(\\b|\\W))${s.escapeRegExp(t.text||"")}(\\b|\\W)`,"gm").exec(a),u=c?c.index+c[1].length:0,l=e.offsetAt(new r.Position(i.start.line,i.start.character))+u;return new r.Range(e.positionAt(l),e.positionAt(l+t.text.length))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.escapeRegExp=function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(15),s=n(17),o=n(1);var a;!function(e){e[e.Off=0]="Off",e[e.Normal=1]="Normal",e[e.Terse=2]="Terse",e[e.Verbose=3]="Verbose"}(a=t.TsServerLogLevel||(t.TsServerLogLevel={})),function(e){e.fromString=function(t){switch(t&&t.toLowerCase()){case"normal":return e.Normal;case"terse":return e.Terse;case"verbose":return e.Verbose;case"off":default:return e.Off}},e.toString=function(t){switch(t){case e.Normal:return"normal";case e.Terse:return"terse";case e.Verbose:return"verbose";case e.Off:default:return"off"}}}(a=t.TsServerLogLevel||(t.TsServerLogLevel={}));class c{constructor(){this.tsServerLogLevel=a.Off;const e=r.workspace.getConfiguration();this.locale=c.extractLocale(e),this.globalTsdk=c.extractGlobalTsdk(e),this.localTsdk=c.extractLocalTsdk(e),this.npmLocation=c.readNpmLocation(e),this.tsServerLogLevel=c.readTsServerLogLevel(e),this.tsServerPluginPaths=c.readTsServerPluginPaths(e),this.checkJs=c.readCheckJs(e),this.experimentalDecorators=c.readExperimentalDecorators(e),this.disableAutomaticTypeAcquisition=c.readDisableAutomaticTypeAcquisition(e),this.useSeparateSyntaxServer=c.readUseSeparateSyntaxServer(e)}static loadFromWorkspace(){return new c}isEqualTo(e){return this.locale===e.locale&&this.globalTsdk===e.globalTsdk&&this.localTsdk===e.localTsdk&&this.npmLocation===e.npmLocation&&this.tsServerLogLevel===e.tsServerLogLevel&&this.checkJs===e.checkJs&&this.experimentalDecorators===e.experimentalDecorators&&this.disableAutomaticTypeAcquisition===e.disableAutomaticTypeAcquisition&&i.equals(this.tsServerPluginPaths,e.tsServerPluginPaths)&&this.useSeparateSyntaxServer===e.useSeparateSyntaxServer}static fixPathPrefixes(e){const t=["~"+o.sep];for(const n of t)if(e.startsWith(n))return o.join(s.homedir(),e.slice(n.length));return e}static extractGlobalTsdk(e){const t=e.inspect("typescript.tsdk");return t&&"string"==typeof t.globalValue?this.fixPathPrefixes(t.globalValue):null}static extractLocalTsdk(e){const t=e.inspect("typescript.tsdk");return t&&"string"==typeof t.workspaceValue?this.fixPathPrefixes(t.workspaceValue):null}static readTsServerLogLevel(e){const t=e.get("typescript.tsserver.log","off");return a.fromString(t)}static readTsServerPluginPaths(e){return e.get("typescript.tsserver.pluginPaths",[])}static readCheckJs(e){return e.get("javascript.implicitProjectConfig.checkJs",!1)}static readExperimentalDecorators(e){return e.get("javascript.implicitProjectConfig.experimentalDecorators",!1)}static readNpmLocation(e){return e.get("typescript.npm",null)}static readDisableAutomaticTypeAcquisition(e){return e.get("typescript.disableAutomaticTypeAcquisition",!1)}static extractLocale(e){return e.get("typescript.locale",null)}static readUseSeparateSyntaxServer(e){return e.get("typescript.tsserver.useSeparateSyntaxServer",!0)}}t.TypeScriptServiceConfiguration=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(0);t.RelativeWorkspacePathResolver=class{static asAbsoluteWorkspacePath(e){for(const t of i.workspace.workspaceFolders||[]){const n=[`./${t.name}/`,`${t.name}/`,`.\\${t.name}\\`,`${t.name}\\`];for(const i of n)if(e.startsWith(i))return r.join(t.uri.fsPath,e.replace(i,""))}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(111),s=n(45),o=Object.keys(process.binding("natives")),a=s.prototype.require;t.makePatchingRequire=function(e){var t={};return function(n){var c=a.apply(this,arguments);if(e[n]){var u=s._resolveFilename(n,this);if(t.hasOwnProperty(u))return t[u];var l=void 0;if(o.indexOf(n)<0)try{l=a.call(this,r.join(n,"package.json")).version}catch(e){return c}else l=process.version.substring(1);var h=l.indexOf("-");h>=0&&(l=l.substring(0,h));for(var p=c,d=0,f=e[n];d<f.length;d++){var g=f[d];i.satisfies(l,g.versionSpecifier)&&(p=g.patch(p,u))}return t[u]=p}return c}}},function(e,t){e.exports=require("module")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvailabilityData=n(132),t.Base=n(47),t.ContextTagKeys=n(133),t.Data=n(134),t.DataPoint=n(135),t.DataPointType=n(48),t.Domain=n(12),t.Envelope=n(136),t.EventData=n(49),t.ExceptionData=n(137),t.ExceptionDetails=n(138),t.MessageData=n(139),t.MetricData=n(140),t.PageViewData=n(141),t.RemoteDependencyData=n(142),t.RequestData=n(143),t.SeverityLevel=n(144),t.StackFrame=n(145)},function(e,t,n){"use strict";var r=function(){return function(){}}();e.exports=r},function(e,t,n){"use strict";var r;!function(e){e[e.Measurement=0]="Measurement",e[e.Aggregation=1]="Aggregation"}(r||(r={})),e.exports=r},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return r(t,e),t}(n(12));e.exports=i},function(e,t,n){"use strict";var r=n(17),i=n(9),s=function(){function e(t){if(e.INSTANCE)throw new Error("Performance tracking should be configured from the applicationInsights object");e.INSTANCE=this,this._isInitialized=!1,this._client=t}return e.prototype.enable=function(t){var n=this;this._isEnabled=t,this._isEnabled&&!this._isInitialized&&(this._isInitialized=!0),t?this._handle||(this._lastCpus=r.cpus(),this._lastRequests={totalRequestCount:e._totalRequestCount,totalFailedRequestCount:e._totalFailedRequestCount,time:+new Date},"function"==typeof process.cpuUsage&&(this._lastAppCpuUsage=process.cpuUsage()),this._lastHrtime=process.hrtime(),this._handle=setInterval(function(){return n.trackPerformance()},6e4),this._handle.unref()):this._handle&&(clearInterval(this._handle),this._handle=void 0)},e.countRequest=function(t,n){var r=this;if(e.isEnabled()){var s=+new Date;t&&n?"function"==typeof n.once&&n.once("finish",function(){var t=+new Date;r._lastRequestExecutionTime=t-s,e._totalRequestCount++,n.statusCode>=400&&e._totalFailedRequestCount++}):i.warn("AutoCollectPerformance.countRequest was called with invalid parameters: ",!!t,!!n)}},e.prototype.isInitialized=function(){return this._isInitialized},e.isEnabled=function(){return e.INSTANCE&&e.INSTANCE._isEnabled},e.prototype.trackPerformance=function(){this._trackCpu(),this._trackMemory(),this._trackNetwork()},e.prototype._trackCpu=function(){var e=r.cpus();if(e&&e.length&&this._lastCpus&&e.length===this._lastCpus.length){for(var t=0,n=0,i=0,s=0,o=0,a=0;e&&a<e.length;a++){var c=e[a],u=this._lastCpus[a],l=(c.model,c.speed,c.times),h=u.times;t+=l.user-h.user||0,n+=l.sys-h.sys||0,i+=l.nice-h.nice||0,s+=l.idle-h.idle||0,o+=l.irq-h.irq||0}var p=void 0;if("function"==typeof process.cpuUsage){var d=process.cpuUsage(),f=process.hrtime(),g=d.user-this._lastAppCpuUsage.user+(d.system-this._lastAppCpuUsage.system)||0;if(void 0!==this._lastHrtime&&2===this._lastHrtime.length)p=100*g/((1e6*(f[0]-this._lastHrtime[0])+(f[1]-this._lastHrtime[1])/1e3||0)*e.length);this._lastAppCpuUsage=d,this._lastHrtime=f}var m=t+n+i+s+o||1;this._client.trackMetric({name:"\\Processor(_Total)\\% Processor Time",value:(m-s)/m*100}),this._client.trackMetric({name:"\\Process(??APP_WIN32_PROC??)\\% Processor Time",value:p||t/m*100})}this._lastCpus=e},e.prototype._trackMemory=function(){var e=r.freemem(),t=process.memoryUsage().rss;this._client.trackMetric({name:"\\Process(??APP_WIN32_PROC??)\\Private Bytes",value:t}),this._client.trackMetric({name:"\\Memory\\Available Bytes",value:e})},e.prototype._trackNetwork=function(){var t=this._lastRequests,n={totalRequestCount:e._totalRequestCount,totalFailedRequestCount:e._totalFailedRequestCount,time:+new Date},r=n.totalRequestCount-t.totalRequestCount||0,i=(t.totalFailedRequestCount,n.time-t.time),s=i/1e3;if(i>0){var o=r/s;this._client.trackMetric({name:"\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",value:o}),this._client.trackMetric({name:"\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time",value:e._lastRequestExecutionTime})}this._lastRequests=n},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1},e._totalRequestCount=0,e._totalFailedRequestCount=0,e._lastRequestExecutionTime=0,e}();e.exports=s},function(e,t,n){"use strict";var r=function(){function e(){}return e.prototype.getUrl=function(){return this.url},e.prototype.RequestParser=function(){this.startTime=+new Date},e.prototype._setStatus=function(e,t){var n=+new Date;this.duration=n-this.startTime,this.statusCode=e;var r=this.properties||{};if(t)if("string"==typeof t)r.error=t;else if(t instanceof Error)r.error=t.message;else if("object"==typeof t)for(var i in t)r[i]=t[i]&&t[i].toString&&t[i].toString();this.properties=r},e.prototype._isSuccess=function(){return 0<this.statusCode&&this.statusCode<400},e}();e.exports=r},function(e,t,n){"use strict";var r=n(30),i=n(31),s=n(9),o=n(13),a=n(21),c=n(157),u=n(20),l=n(50),h=function(){function e(t){if(e.INSTANCE)throw new Error("Server request tracking should be configured from the applicationInsights object");e.INSTANCE=this,this._client=t}return e.prototype.enable=function(e){this._isEnabled=e,(this._isAutoCorrelating||this._isEnabled||l.isEnabled())&&!this._isInitialized&&(this.useAutoCorrelation(this._isAutoCorrelating),this._initialize())},e.prototype.useAutoCorrelation=function(e){e&&!this._isAutoCorrelating?u.CorrelationContextManager.enable():!e&&this._isAutoCorrelating&&u.CorrelationContextManager.disable(),this._isAutoCorrelating=e},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.isAutoCorrelating=function(){return this._isAutoCorrelating},e.prototype._generateCorrelationContext=function(e){if(this._isAutoCorrelating)return u.CorrelationContextManager.generateContextObject(e.getOperationId(this._client.context.tags),e.getRequestId(),e.getOperationName(this._client.context.tags),e.getCorrelationContextHeader())},e.prototype._initialize=function(){var t=this;this._isInitialized=!0;var n=function(n){if(n){if("function"!=typeof n)throw new Error("onRequest handler must be a function");return function(r,i){var s=r&&!r[e.alreadyAutoCollectedFlag];if(r&&s){var o=new c(r),a=t._generateCorrelationContext(o);u.CorrelationContextManager.runWithContext(a,function(){t._isEnabled&&(r[e.alreadyAutoCollectedFlag]=!0,e.trackRequest(t._client,{request:r,response:i},o)),l.countRequest(r,i),"function"==typeof n&&n(r,i)})}else"function"==typeof n&&n(r,i)}}},s=function(e){var t=e.addListener.bind(e);e.addListener=function(e,r){switch(e){case"request":case"checkContinue":return t(e,n(r));default:return t(e,r)}},e.on=e.addListener},o=r.createServer;r.createServer=function(e){var t=o(n(e));return s(t),t};var a=i.createServer;i.createServer=function(e,t){var r=a(e,n(t));return s(r),r}},e.trackRequestSync=function(t,n){if(n.request&&n.response&&t){e.addResponseCorrelationIdHeader(t,n.response);var r=u.CorrelationContextManager.getCurrentContext(),i=new c(n.request,r&&r.operation.parentId);r&&(r.operation.id=i.getOperationId(t.context.tags)||r.operation.id,r.operation.name=i.getOperationName(t.context.tags)||r.operation.name,r.operation.parentId=i.getRequestId()||r.operation.parentId,r.customProperties.addHeaderData(i.getCorrelationContextHeader())),e.endRequest(t,i,n,n.duration,n.error)}else s.info("AutoCollectHttpRequests.trackRequestSync was called with invalid parameters: ",!n.request,!n.response,!t)},e.trackRequest=function(t,n,r){if(n.request&&n.response&&t){var i=u.CorrelationContextManager.getCurrentContext(),a=r||new c(n.request,i&&i.operation.parentId);o.canIncludeCorrelationHeader(t,a.getUrl())&&e.addResponseCorrelationIdHeader(t,n.response),i&&!r&&(i.operation.id=a.getOperationId(t.context.tags)||i.operation.id,i.operation.name=a.getOperationName(t.context.tags)||i.operation.name,i.operation.parentId=a.getOperationParentId(t.context.tags)||i.operation.parentId,i.customProperties.addHeaderData(a.getCorrelationContextHeader())),n.response.once&&n.response.once("finish",function(){e.endRequest(t,a,n,null,null)}),n.request.on&&n.request.on("error",function(r){e.endRequest(t,a,n,null,r)})}else s.info("AutoCollectHttpRequests.trackRequest was called with invalid parameters: ",!n.request,!n.response,!t)},e.addResponseCorrelationIdHeader=function(e,t){if(e.config&&e.config.correlationId&&t.getHeader&&t.setHeader&&!t.headersSent){var n=t.getHeader(a.requestContextHeader);if(n){var r=n.split(","),i=a.requestContextSourceKey+"=";r.some(function(e){return e.substring(0,i.length)===i})||t.setHeader(a.requestContextHeader,n+","+a.requestContextSourceKey+"="+e.config.correlationId)}else t.setHeader(a.requestContextHeader,a.requestContextSourceKey+"="+e.config.correlationId)}},e.endRequest=function(e,t,n,r,i){i?t.onError(i,r):t.onResponse(n.response,r);var s=t.getRequestTelemetry(n);if(s.tagOverrides=t.getRequestTags(e.context.tags),n.tagOverrides)for(var o in n.tagOverrides)s.tagOverrides[o]=n.tagOverrides[o];s.contextObjects=s.contextObjects||{},s.contextObjects["http.ServerRequest"]=n.request,s.contextObjects["http.ServerResponse"]=n.response,e.trackRequest(s)},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1},e.alreadyAutoCollectedFlag="_appInsightsAutoCollected",e}();e.exports=h},function(e,t){e.exports=require("child_process")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(38),i=n(1),s=n(5),o=n(53),a=n(172),c=(()=>{let e;return()=>(e||(e=r.getTempFile(`vscode-typescript${"win32"!==a.platform&&a.getuid?a.getuid():""}`)),s.existsSync(e)||s.mkdirSync(e),e)})();t.getInstanceDir=(()=>{let e;return()=>(e||(e=i.join(c(),r.makeRandomHexString(20))),s.existsSync(e)||s.mkdirSync(e),e)})(),t.getTempFile=function(e){return i.join(t.getInstanceDir(),`${e}-${r.makeRandomHexString(20)}.tmp`)},t.fork=function(e,t,n){const r=function(e,t){const n=Object.assign({},e);return n.ELECTRON_RUN_AS_NODE="1",n.NODE_PATH=i.join(t,"..","..",".."),n.PATH=n.PATH||a.env.PATH,n}(a.env,e);return o.fork(e,t,{silent:!0,cwd:n.cwd,env:r,execArgv:n.execArgv})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.Cancelled=class{constructor(e){this.reason=e,this.type="cancelled"}},e.NoContent=new class{constructor(){this.type="noContent"}}}(t.ServerResponse||(t.ServerResponse={}))},function(e,t,n){e.exports=b;var r=n(5),i=n(57),s=n(34),o=(s.Minimatch,n(187)),a=n(28).EventEmitter,c=n(1),u=n(33),l=n(36),h=n(189),p=n(58),d=(p.alphasort,p.alphasorti,p.setopts),f=p.ownProp,g=n(190),m=(n(35),p.childrenIgnored),v=p.isIgnored,y=n(60);function b(e,t,n){if("function"==typeof t&&(n=t,t={}),t||(t={}),t.sync){if(n)throw new TypeError("callback provided to sync glob");return h(e,t)}return new w(e,t,n)}b.sync=h;var _=b.GlobSync=h.GlobSync;function w(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&t.sync){if(n)throw new TypeError("callback provided to sync glob");return new _(e,t)}if(!(this instanceof w))return new w(e,t,n);d(this,e,t),this._didRealPath=!1;var r=this.minimatch.set.length;this.matches=new Array(r),"function"==typeof n&&(n=y(n),this.on("error",n),this.on("end",function(e){n(null,e)}));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===r)return a();for(var s=!0,o=0;o<r;o++)this._process(this.minimatch.set[o],o,!1,a);function a(){--i._processing,i._processing<=0&&(s?process.nextTick(function(){i._finish()}):i._finish())}s=!1}b.glob=b,b.hasMagic=function(e,t){var n=function(e,t){if(null===t||"object"!=typeof t)return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}({},t);n.noprocess=!0;var r=new w(e,n).minimatch.set;if(!e)return!1;if(r.length>1)return!0;for(var i=0;i<r[0].length;i++)if("string"!=typeof r[0][i])return!0;return!1},b.Glob=w,o(w,a),w.prototype._finish=function(){if(u(this instanceof w),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();p.finish(this),this.emit("end",this.found)}},w.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var e=this.matches.length;if(0===e)return this._finish();for(var t=this,n=0;n<this.matches.length;n++)this._realpathSet(n,r)}function r(){0==--e&&t._finish()}},w.prototype._realpathSet=function(e,t){var n=this.matches[e];if(!n)return t();var r=Object.keys(n),s=this,o=r.length;if(0===o)return t();var a=this.matches[e]=Object.create(null);r.forEach(function(n,r){n=s._makeAbs(n),i.realpath(n,s.realpathCache,function(r,i){r?"stat"===r.syscall?a[n]=!0:s.emit("error",r):a[i]=!0,0==--o&&(s.matches[e]=a,t())})})},w.prototype._mark=function(e){return p.mark(this,e)},w.prototype._makeAbs=function(e){return p.makeAbs(this,e)},w.prototype.abort=function(){this.aborted=!0,this.emit("abort")},w.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},w.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var n=e[t];this._emitMatch(n[0],n[1])}}if(this._processQueue.length){var r=this._processQueue.slice(0);this._processQueue.length=0;for(t=0;t<r.length;t++){var i=r[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},w.prototype._process=function(e,t,n,r){if(u(this instanceof w),u("function"==typeof r),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([e,t,n,r]);else{for(var i,o=0;"string"==typeof e[o];)o++;switch(o){case e.length:return void this._processSimple(e.join("/"),t,r);case 0:i=null;break;default:i=e.slice(0,o).join("/")}var a,c=e.slice(o);null===i?a=".":l(i)||l(e.join("/"))?(i&&l(i)||(i="/"+i),a=i):a=i;var h=this._makeAbs(a);if(m(this,a))return r();c[0]===s.GLOBSTAR?this._processGlobStar(i,a,h,c,t,n,r):this._processReaddir(i,a,h,c,t,n,r)}},w.prototype._processReaddir=function(e,t,n,r,i,s,o){var a=this;this._readdir(n,s,function(c,u){return a._processReaddir2(e,t,n,r,i,s,u,o)})},w.prototype._processReaddir2=function(e,t,n,r,i,s,o,a){if(!o)return a();for(var u=r[0],l=!!this.minimatch.negate,h=u._glob,p=this.dot||"."===h.charAt(0),d=[],f=0;f<o.length;f++){if("."!==(m=o[f]).charAt(0)||p)(l&&!e?!m.match(u):m.match(u))&&d.push(m)}var g=d.length;if(0===g)return a();if(1===r.length&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(f=0;f<g;f++){var m=d[f];e&&(m="/"!==e?e+"/"+m:e+m),"/"!==m.charAt(0)||this.nomount||(m=c.join(this.root,m)),this._emitMatch(i,m)}return a()}r.shift();for(f=0;f<g;f++){m=d[f];e&&(m="/"!==e?e+"/"+m:e+m),this._process([m].concat(r),i,s,a)}a()},w.prototype._emitMatch=function(e,t){if(!this.aborted&&!v(this,t))if(this.paused)this._emitQueue.push([e,t]);else{var n=l(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0;var i=this.statCache[n];i&&this.emit("stat",t,i),this.emit("match",t)}}},w.prototype._readdirInGlobStar=function(e,t){if(!this.aborted){if(this.follow)return this._readdir(e,!1,t);var n=this,i=g("lstat\0"+e,function(r,i){if(r&&"ENOENT"===r.code)return t();var s=i&&i.isSymbolicLink();n.symlinks[e]=s,s||!i||i.isDirectory()?n._readdir(e,!1,t):(n.cache[e]="FILE",t())});i&&r.lstat(e,i)}},w.prototype._readdir=function(e,t,n){if(!this.aborted&&(n=g("readdir\0"+e+"\0"+t,n))){if(t&&!f(this.symlinks,e))return this._readdirInGlobStar(e,n);if(f(this.cache,e)){var i=this.cache[e];if(!i||"FILE"===i)return n();if(Array.isArray(i))return n(null,i)}r.readdir(e,function(e,t,n){return function(r,i){r?e._readdirError(t,r,n):e._readdirEntries(t,i,n)}}(this,e,n))}},w.prototype._readdirEntries=function(e,t,n){if(!this.aborted){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var i=t[r];i="/"===e?e+i:e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,n(null,t)}},w.prototype._readdirError=function(e,t,n){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t)}return n()}},w.prototype._processGlobStar=function(e,t,n,r,i,s,o){var a=this;this._readdir(n,s,function(c,u){a._processGlobStar2(e,t,n,r,i,s,u,o)})},w.prototype._processGlobStar2=function(e,t,n,r,i,s,o,a){if(!o)return a();var c=r.slice(1),u=e?[e]:[],l=u.concat(c);this._process(l,i,!1,a);var h=this.symlinks[n],p=o.length;if(h&&s)return a();for(var d=0;d<p;d++){if("."!==o[d].charAt(0)||this.dot){var f=u.concat(o[d],c);this._process(f,i,!0,a);var g=u.concat(o[d],r);this._process(g,i,!0,a)}}a()},w.prototype._processSimple=function(e,t,n){var r=this;this._stat(e,function(i,s){r._processSimple2(e,t,i,s,n)})},w.prototype._processSimple2=function(e,t,n,r,i){if(this.matches[t]||(this.matches[t]=Object.create(null)),!r)return i();if(e&&l(e)&&!this.nomount){var s=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=c.join(this.root,e):(e=c.resolve(this.root,e),s&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),i()},w.prototype._stat=function(e,t){var n=this._makeAbs(e),i="/"===e.slice(-1);if(e.length>this.maxLength)return t();if(!this.stat&&f(this.cache,n)){var s=this.cache[n];if(Array.isArray(s)&&(s="DIR"),!i||"DIR"===s)return t(null,s);if(i&&"FILE"===s)return t()}var o=this.statCache[n];if(void 0!==o){if(!1===o)return t(null,o);var a=o.isDirectory()?"DIR":"FILE";return i&&"FILE"===a?t():t(null,a,o)}var c=this,u=g("stat\0"+n,function(i,s){if(s&&s.isSymbolicLink())return r.stat(n,function(r,i){r?c._stat2(e,n,null,s,t):c._stat2(e,n,r,i,t)});c._stat2(e,n,i,s,t)});u&&r.lstat(n,u)},w.prototype._stat2=function(e,t,n,r,i){if(n&&("ENOENT"===n.code||"ENOTDIR"===n.code))return this.statCache[t]=!1,i();var s="/"===e.slice(-1);if(this.statCache[t]=r,"/"===t.slice(-1)&&r&&!r.isDirectory())return i(null,!1,r);var o=!0;return r&&(o=r.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,s&&"FILE"===o?i():i(null,o,r)}},function(e,t,n){e.exports=l,l.realpath=l,l.sync=h,l.realpathSync=h,l.monkeypatch=function(){r.realpath=l,r.realpathSync=h},l.unmonkeypatch=function(){r.realpath=i,r.realpathSync=s};var r=n(5),i=r.realpath,s=r.realpathSync,o=process.version,a=/^v[0-5]\./.test(o),c=n(183);function u(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function l(e,t,n){if(a)return i(e,t,n);"function"==typeof t&&(n=t,t=null),i(e,t,function(r,i){u(r)?c.realpath(e,t,n):n(r,i)})}function h(e,t){if(a)return s(e,t);try{return s(e,t)}catch(n){if(u(n))return c.realpathSync(e,t);throw n}}},function(e,t,n){function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.alphasort=u,t.alphasorti=c,t.setopts=function(e,t,n){n||(n={});if(n.matchBase&&-1===t.indexOf("/")){if(n.noglobstar)throw new Error("base matching requires globstar");t="**/"+t}e.silent=!!n.silent,e.pattern=t,e.strict=!1!==n.strict,e.realpath=!!n.realpath,e.realpathCache=n.realpathCache||Object.create(null),e.follow=!!n.follow,e.dot=!!n.dot,e.mark=!!n.mark,e.nodir=!!n.nodir,e.nodir&&(e.mark=!0);e.sync=!!n.sync,e.nounique=!!n.nounique,e.nonull=!!n.nonull,e.nosort=!!n.nosort,e.nocase=!!n.nocase,e.stat=!!n.stat,e.noprocess=!!n.noprocess,e.absolute=!!n.absolute,e.maxLength=n.maxLength||1/0,e.cache=n.cache||Object.create(null),e.statCache=n.statCache||Object.create(null),e.symlinks=n.symlinks||Object.create(null),function(e,t){e.ignore=t.ignore||[],Array.isArray(e.ignore)||(e.ignore=[e.ignore]);e.ignore.length&&(e.ignore=e.ignore.map(l))}(e,n),e.changedCwd=!1;var s=process.cwd();r(n,"cwd")?(e.cwd=i.resolve(n.cwd),e.changedCwd=e.cwd!==s):e.cwd=s;e.root=n.root||i.resolve(e.cwd,"/"),e.root=i.resolve(e.root),"win32"===process.platform&&(e.root=e.root.replace(/\\/g,"/"));e.cwdAbs=o(e.cwd)?e.cwd:h(e,e.cwd),"win32"===process.platform&&(e.cwdAbs=e.cwdAbs.replace(/\\/g,"/"));e.nomount=!!n.nomount,n.nonegate=!0,n.nocomment=!0,e.minimatch=new a(t,n),e.options=e.minimatch.options},t.ownProp=r,t.makeAbs=h,t.finish=function(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,i=e.matches.length;r<i;r++){var s=e.matches[r];if(s&&0!==Object.keys(s).length){var o=Object.keys(s);t?n.push.apply(n,o):o.forEach(function(e){n[e]=!0})}else if(e.nonull){var a=e.minimatch.globSet[r];t?n.push(a):n[a]=!0}}t||(n=Object.keys(n));e.nosort||(n=n.sort(e.nocase?c:u));if(e.mark){for(var r=0;r<n.length;r++)n[r]=e._mark(n[r]);e.nodir&&(n=n.filter(function(t){var n=!/\/$/.test(t),r=e.cache[t]||e.cache[h(e,t)];return n&&r&&(n="DIR"!==r&&!Array.isArray(r)),n}))}e.ignore.length&&(n=n.filter(function(t){return!p(e,t)}));e.found=n},t.mark=function(e,t){var n=h(e,t),r=e.cache[n],i=t;if(r){var s="DIR"===r||Array.isArray(r),o="/"===t.slice(-1);if(s&&!o?i+="/":!s&&o&&(i=i.slice(0,-1)),i!==t){var a=h(e,i);e.statCache[a]=e.statCache[n],e.cache[a]=e.cache[n]}}return i},t.isIgnored=p,t.childrenIgnored=function(e,t){return!!e.ignore.length&&e.ignore.some(function(e){return!(!e.gmatcher||!e.gmatcher.match(t))})};var i=n(1),s=n(34),o=n(36),a=s.Minimatch;function c(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}function u(e,t){return e.localeCompare(t)}function l(e){var t=null;if("/**"===e.slice(-3)){var n=e.replace(/(\/\*\*)+$/,"");t=new a(n,{dot:!0})}return{matcher:new a(e,{dot:!0}),gmatcher:t}}function h(e,t){var n=t;return n="/"===t.charAt(0)?i.join(e.root,t):o(t)||""===t?t:e.changedCwd?i.resolve(e.cwd,t):i.resolve(t),"win32"===process.platform&&(n=n.replace(/\\/g,"/")),n}function p(e,t){return!!e.ignore.length&&e.ignore.some(function(e){return e.matcher.match(t)||!(!e.gmatcher||!e.gmatcher.match(t))})}},function(e,t){e.exports=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");Object.keys(t).forEach(function(e){r[e]=t[e]});return r;function r(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];var r=t.apply(this,e),i=e[e.length-1];return"function"==typeof r&&r!==i&&Object.keys(i).forEach(function(e){r[e]=i[e]}),r}}},function(e,t,n){var r=n(59);function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}e.exports=r(i),e.exports.strict=r(s),i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})})},function(e,t,n){"use strict";function r(e,t){void 0===t&&(t=!1);var n=0,r=e.length,a="",c=0,u=16,l=0,h=0,p=0,d=0,f=0;function g(t,r){for(var i=0,s=0;i<t||!r;){var o=e.charCodeAt(n);if(o>=48&&o<=57)s=16*s+o-48;else if(o>=65&&o<=70)s=16*s+o-65+10;else{if(!(o>=97&&o<=102))break;s=16*s+o-97+10}n++,i++}return i<t&&(s=-1),s}function m(){if(a="",f=0,c=n,h=l,d=p,n>=r)return c=r,u=17;var t=e.charCodeAt(n);if(i(t)){do{n++,a+=String.fromCharCode(t),t=e.charCodeAt(n)}while(i(t));return u=15}if(s(t))return n++,a+=String.fromCharCode(t),13===t&&10===e.charCodeAt(n)&&(n++,a+="\n"),l++,p=n,u=14;switch(t){case 123:return n++,u=1;case 125:return n++,u=2;case 91:return n++,u=3;case 93:return n++,u=4;case 58:return n++,u=6;case 44:return n++,u=5;case 34:return n++,a=function(){for(var t="",i=n;;){if(n>=r){t+=e.substring(i,n),f=2;break}var o=e.charCodeAt(n);if(34===o){t+=e.substring(i,n),n++;break}if(92!==o){if(o>=0&&o<=31){if(s(o)){t+=e.substring(i,n),f=2;break}f=6}n++}else{if(t+=e.substring(i,n),++n>=r){f=2;break}switch(o=e.charCodeAt(n++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:var a=g(4,!0);a>=0?t+=String.fromCharCode(a):f=4;break;default:f=5}i=n}}return t}(),u=10;case 47:var m=n-1;if(47===e.charCodeAt(n+1)){for(n+=2;n<r&&!s(e.charCodeAt(n));)n++;return a=e.substring(m,n),u=12}if(42===e.charCodeAt(n+1)){n+=2;for(var y=r-1,b=!1;n<y;){var _=e.charCodeAt(n);if(42===_&&47===e.charCodeAt(n+1)){n+=2,b=!0;break}n++,s(_)&&(13===_&&10===e.charCodeAt(n)&&n++,l++,p=n)}return b||(n++,f=1),a=e.substring(m,n),u=13}return a+=String.fromCharCode(t),n++,u=16;case 45:if(a+=String.fromCharCode(t),++n===r||!o(e.charCodeAt(n)))return u=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return a+=function(){var t=n;if(48===e.charCodeAt(n))n++;else for(n++;n<e.length&&o(e.charCodeAt(n));)n++;if(n<e.length&&46===e.charCodeAt(n)){if(!(++n<e.length&&o(e.charCodeAt(n))))return f=3,e.substring(t,n);for(n++;n<e.length&&o(e.charCodeAt(n));)n++}var r=n;if(n<e.length&&(69===e.charCodeAt(n)||101===e.charCodeAt(n)))if((++n<e.length&&43===e.charCodeAt(n)||45===e.charCodeAt(n))&&n++,n<e.length&&o(e.charCodeAt(n))){for(n++;n<e.length&&o(e.charCodeAt(n));)n++;r=n}else f=3;return e.substring(t,r)}(),u=11;default:for(;n<r&&v(t);)n++,t=e.charCodeAt(n);if(c!==n){switch(a=e.substring(c,n)){case"true":return u=8;case"false":return u=9;case"null":return u=7}return u=16}return a+=String.fromCharCode(t),n++,u=16}}function v(e){if(i(e)||s(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}return{setPosition:function(e){n=e,a="",c=0,u=16,f=0},getPosition:function(){return n},scan:t?function(){var e;do{e=m()}while(e>=12&&e<=15);return e}:m,getToken:function(){return u},getTokenValue:function(){return a},getTokenOffset:function(){return c},getTokenLength:function(){return n-c},getTokenStartLine:function(){return h},getTokenStartCharacter:function(){return c-d},getTokenError:function(){return f}}}function i(e){return 32===e||9===e||11===e||12===e||160===e||5760===e||e>=8192&&e<=8203||8239===e||8287===e||12288===e||65279===e}function s(e){return 10===e||13===e||8232===e||8233===e}function o(e){return e>=48&&e<=57}function a(e,t,n){var i,s,o,a,l;if(t){for(a=t.offset,l=a+t.length,o=a;o>0&&!u(e,o-1);)o--;for(var h=l;h<e.length&&!u(e,h);)h++;s=e.substring(o,h),i=function(e,t){var n=0,r=0,i=t.tabSize||4;for(;n<e.length;){var s=e.charAt(n);if(" "===s)r++;else{if("\t"!==s)break;r+=i}n++}return Math.floor(r/i)}(s,n)}else s=e,i=0,o=0,a=0,l=e.length;var p,d=function(e,t){for(var n=0;n<t.length;n++){var r=t.charAt(n);if("\r"===r)return n+1<t.length&&"\n"===t.charAt(n+1)?"\r\n":"\r";if("\n"===r)return"\n"}return e&&e.eol||"\n"}(n,e),f=!1,g=0;p=n.insertSpaces?c(" ",n.tabSize||4):"\t";var m=r(s,!1),v=!1;function y(){return d+c(p,i+g)}function b(){var e=m.scan();for(f=!1;15===e||14===e;)f=f||14===e,e=m.scan();return v=16===e||0!==m.getTokenError(),e}var _=[];function w(t,n,r){!v&&n<l&&r>a&&e.substring(n,r)!==t&&_.push({offset:n,length:r-n,content:t})}var S=b();if(17!==S){var C=m.getTokenOffset()+o;w(c(p,i),o,C)}for(;17!==S;){for(var k=m.getTokenOffset()+m.getTokenLength()+o,T=b(),x="";!f&&(12===T||13===T);){w(" ",k,m.getTokenOffset()+o),k=m.getTokenOffset()+m.getTokenLength()+o,x=12===T?y():"",T=b()}if(2===T)1!==S&&(g--,x=y());else if(4===T)3!==S&&(g--,x=y());else{switch(S){case 3:case 1:g++,x=y();break;case 5:case 12:x=y();break;case 13:x=f?y():" ";break;case 6:x=" ";break;case 10:if(6===T){x="";break}case 7:case 8:case 9:case 11:case 2:case 4:12===T||13===T?x=" ":5!==T&&17!==T&&(v=!0);break;case 16:v=!0}!f||12!==T&&13!==T||(x=y())}w(x,k,m.getTokenOffset()+o),S=T}return _}function c(e,t){for(var n="",r=0;r<t;r++)n+=e;return n}function u(e,t){return-1!=="\r\n".indexOf(e.charAt(t))}var l;function h(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=l.DEFAULT);var r={type:"array",offset:-1,length:-1,children:[],parent:void 0};function i(e){"property"===r.type&&(r.length=e-r.offset,r=r.parent)}function s(e){return r.children.push(e),e}d(e,{onObjectBegin:function(e){r=s({type:"object",offset:e,length:-1,parent:r,children:[]})},onObjectProperty:function(e,t,n){(r=s({type:"property",offset:t,length:-1,parent:r,children:[]})).children.push({type:"string",value:e,offset:t,length:n,parent:r})},onObjectEnd:function(e,t){r.length=e+t-r.offset,r=r.parent,i(e+t)},onArrayBegin:function(e,t){r=s({type:"array",offset:e,length:-1,parent:r,children:[]})},onArrayEnd:function(e,t){r.length=e+t-r.offset,r=r.parent,i(e+t)},onLiteralValue:function(e,t,n){s({type:f(e),offset:t,length:n,parent:r,value:e}),i(t+n)},onSeparator:function(e,t,n){"property"===r.type&&(":"===e?r.colonOffset=t:","===e&&i(t))},onError:function(e,n,r){t.push({error:e,offset:n,length:r})}},n);var o=r.children[0];return o&&delete o.parent,o}function p(e,t){if(e){for(var n=e,r=0,i=t;r<i.length;r++){var s=i[r];if("string"==typeof s){if("object"!==n.type||!Array.isArray(n.children))return;for(var o=!1,a=0,c=n.children;a<c.length;a++){var u=c[a];if(Array.isArray(u.children)&&u.children[0].value===s){n=u.children[1],o=!0;break}}if(!o)return}else{var l=s;if("array"!==n.type||l<0||!Array.isArray(n.children)||l>=n.children.length)return;n=n.children[l]}}return n}}function d(e,t,n){void 0===n&&(n=l.DEFAULT);var i=r(e,!1);function s(e){return e?function(){return e(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}function o(e){return e?function(t){return e(t,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}var a=s(t.onObjectBegin),c=o(t.onObjectProperty),u=s(t.onObjectEnd),h=s(t.onArrayBegin),p=s(t.onArrayEnd),d=o(t.onLiteralValue),f=o(t.onSeparator),g=s(t.onComment),m=o(t.onError),v=n&&n.disallowComments,y=n&&n.allowTrailingComma;function b(){for(;;){var e=i.scan();switch(i.getTokenError()){case 4:_(14);break;case 5:_(15);break;case 3:_(13);break;case 1:v||_(11);break;case 2:_(12);break;case 6:_(16)}switch(e){case 12:case 13:v?_(10):g();break;case 16:_(1);break;case 15:case 14:break;default:return e}}}function _(e,t,n){if(void 0===t&&(t=[]),void 0===n&&(n=[]),m(e),t.length+n.length>0)for(var r=i.getToken();17!==r;){if(-1!==t.indexOf(r)){b();break}if(-1!==n.indexOf(r))break;r=b()}}function w(e){var t=i.getTokenValue();return e?d(t):c(t),b(),!0}function S(){switch(i.getToken()){case 3:return function(){h(),b();for(var e=!1;4!==i.getToken()&&17!==i.getToken();){if(5===i.getToken()){if(e||_(4,[],[]),f(","),b(),4===i.getToken()&&y)break}else e&&_(6,[],[]);S()||_(4,[],[4,5]),e=!0}return p(),4!==i.getToken()?_(8,[4],[]):b(),!0}();case 1:return function(){a(),b();for(var e=!1;2!==i.getToken()&&17!==i.getToken();){if(5===i.getToken()){if(e||_(4,[],[]),f(","),b(),2===i.getToken()&&y)break}else e&&_(6,[],[]);(10!==i.getToken()?(_(3,[],[2,5]),0):(w(!1),6===i.getToken()?(f(":"),b(),S()||_(4,[],[2,5])):_(5,[],[2,5]),1))||_(4,[],[2,5]),e=!0}return u(),2!==i.getToken()?_(7,[2],[]):b(),!0}();case 10:return w(!0);default:return function(){switch(i.getToken()){case 11:var e=0;try{"number"!=typeof(e=JSON.parse(i.getTokenValue()))&&(_(2),e=0)}catch(e){_(2)}d(e);break;case 7:d(null);break;case 8:d(!0);break;case 9:d(!1);break;default:return!1}return b(),!0}()}}return b(),17===i.getToken()||(S()?(17!==i.getToken()&&_(9,[],[]),!0):(_(4,[],[]),!1))}function f(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string";default:return"null"}}function g(e,t,n,r,i){for(var s,o=t.slice(),a=h(e,[]),c=void 0,u=void 0;o.length>0&&(u=o.pop(),void 0===(c=p(a,o))&&void 0!==n);)"string"==typeof u?((s={})[u]=n,n=s):n=[n];if(c){if("object"===c.type&&"string"==typeof u&&Array.isArray(c.children)){var l=p(c,[u]);if(void 0!==l){if(void 0===n){if(!l.parent)throw new Error("Malformed AST");var d=c.children.indexOf(l.parent),f=void 0,g=l.parent.offset+l.parent.length;if(d>0)f=(S=c.children[d-1]).offset+S.length;else if(f=c.offset+1,c.children.length>1)g=c.children[1].offset;return m(e,{offset:f,length:g-f,content:""},r)}return m(e,{offset:l.offset,length:l.length,content:JSON.stringify(n)},r)}if(void 0===n)return[];var v=JSON.stringify(u)+": "+JSON.stringify(n),y=i?i(c.children.map(function(e){return e.children[0].value})):c.children.length,b=void 0;return m(e,b=y>0?{offset:(S=c.children[y-1]).offset+S.length,length:0,content:","+v}:0===c.children.length?{offset:c.offset+1,length:0,content:v}:{offset:c.offset+1,length:0,content:v+","},r)}if("array"===c.type&&"number"==typeof u&&Array.isArray(c.children)){if(-1===u){v=""+JSON.stringify(n),b=void 0;if(0===c.children.length)b={offset:c.offset+1,length:0,content:v};else b={offset:(S=c.children[c.children.length-1]).offset+S.length,length:0,content:","+v};return m(e,b,r)}if(void 0===n&&c.children.length>=0){var _=u,w=c.children[_];b=void 0;if(1===c.children.length)b={offset:c.offset+1,length:c.length-2,content:""};else if(c.children.length-1===_){var S,C=(S=c.children[_-1]).offset+S.length;b={offset:C,length:c.offset+c.length-2-C,content:""}}else b={offset:w.offset,length:c.children[_+1].offset-w.offset,content:""};return m(e,b,r)}throw new Error("Array modification not supported yet")}throw new Error("Can not add "+("number"!=typeof u?"index":"property")+" to parent of type "+c.type)}if(void 0===n)throw new Error("Can not delete in empty document");return m(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}function m(e,t,n){var r=v(e,t),i=t.offset,s=t.offset+t.content.length;if(0===t.length||0===t.content.length){for(;i>0&&!u(r,i-1);)i--;for(;s<r.length&&!u(r,s);)s++}for(var o=a(r,{offset:i,length:s-i},n),c=o.length-1;c>=0;c--){var l=o[c];r=v(r,l),i=Math.min(i,l.offset),s=Math.max(s,l.offset+l.length),s+=l.content.length-l.length}return[{offset:i,length:e.length-(r.length-s)-i,content:r.substring(i,s)}]}function v(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}n.r(t),function(e){e.DEFAULT={allowTrailingComma:!1}}(l||(l={})),n.d(t,"createScanner",function(){return y}),n.d(t,"getLocation",function(){return b}),n.d(t,"parse",function(){return _}),n.d(t,"parseTree",function(){return w}),n.d(t,"findNodeAtLocation",function(){return S}),n.d(t,"findNodeAtOffset",function(){return C}),n.d(t,"getNodePath",function(){return k}),n.d(t,"getNodeValue",function(){return T}),n.d(t,"visit",function(){return x}),n.d(t,"stripComments",function(){return E}),n.d(t,"printParseErrorCode",function(){return P}),n.d(t,"format",function(){return I}),n.d(t,"modify",function(){return O}),n.d(t,"applyEdits",function(){return A});var y=r,b=function(e,t){var n=[],r=new Object,i=void 0,s={value:{},offset:0,length:0,type:"object",parent:void 0},o=!1;function a(e,t,n,r){s.value=e,s.offset=t,s.length=n,s.type=r,s.colonOffset=void 0,i=s}try{d(e,{onObjectBegin:function(e,s){if(t<=e)throw r;i=void 0,o=t>e,n.push("")},onObjectProperty:function(e,i,s){if(t<i)throw r;if(a(e,i,s,"property"),n[n.length-1]=e,t<=i+s)throw r},onObjectEnd:function(e,s){if(t<=e)throw r;i=void 0,n.pop()},onArrayBegin:function(e,s){if(t<=e)throw r;i=void 0,n.push(0)},onArrayEnd:function(e,s){if(t<=e)throw r;i=void 0,n.pop()},onLiteralValue:function(e,n,i){if(t<n)throw r;if(a(e,n,i,f(e)),t<=n+i)throw r},onSeparator:function(e,s,a){if(t<=s)throw r;if(":"===e&&i&&"property"===i.type)i.colonOffset=s,o=!1,i=void 0;else if(","===e){var c=n[n.length-1];"number"==typeof c?n[n.length-1]=c+1:(o=!0,n[n.length-1]=""),i=void 0}}})}catch(e){if(e!==r)throw e}return{path:n,previousNode:i,isAtPropertyKey:o,matches:function(e){for(var t=0,r=0;t<e.length&&r<n.length;r++)if(e[t]===n[r]||"*"===e[t])t++;else if("**"!==e[t])return!1;return t===e.length}}},_=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=l.DEFAULT);var r=null,i=[],s=[];function o(e){Array.isArray(i)?i.push(e):r&&(i[r]=e)}return d(e,{onObjectBegin:function(){var e={};o(e),s.push(i),i=e,r=null},onObjectProperty:function(e){r=e},onObjectEnd:function(){i=s.pop()},onArrayBegin:function(){var e=[];o(e),s.push(i),i=e,r=null},onArrayEnd:function(){i=s.pop()},onLiteralValue:o,onError:function(e,n,r){t.push({error:e,offset:n,length:r})}},n),i[0]},w=h,S=p,C=function e(t,n,r){if(void 0===r&&(r=!1),function(e,t,n){return void 0===n&&(n=!1),t>=e.offset&&t<e.offset+e.length||n&&t===e.offset+e.length}(t,n,r)){var i=t.children;if(Array.isArray(i))for(var s=0;s<i.length&&i[s].offset<=n;s++){var o=e(i[s],n,r);if(o)return o}return t}},k=function e(t){if(!t.parent||!t.parent.children)return[];var n=e(t.parent);if("property"===t.parent.type){var r=t.parent.children[0].value;n.push(r)}else if("array"===t.parent.type){var i=t.parent.children.indexOf(t);-1!==i&&n.push(i)}return n},T=function e(t){switch(t.type){case"array":return t.children.map(e);case"object":for(var n=Object.create(null),r=0,i=t.children;r<i.length;r++){var s=i[r],o=s.children[1];o&&(n[s.children[0].value]=e(o))}return n;case"null":case"string":case"number":case"boolean":return t.value;default:return}},x=d,E=function(e,t){var n,i,s=r(e),o=[],a=0;do{switch(i=s.getPosition(),n=s.scan()){case 12:case 13:case 17:a!==i&&o.push(e.substring(a,i)),void 0!==t&&o.push(s.getTokenValue().replace(/[^\r\n]/g,t)),a=s.getPosition()}}while(17!==n);return o.join("")};function P(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function I(e,t,n){return a(e,t,n)}function O(e,t,n,r){return g(e,t,n,r.formattingOptions,r.getInsertionIndex)}function A(e,t){for(var n=t.length-1;n>=0;n--)e=v(e,t[n]);return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(63),s=n(64),o=n(71),a=n(72),c=n(15),u=n(54),l=n(182),h=n(191),p=n(19),d=n(37),f=n(192),g=n(193),m=n(194),v=n(195),y=n(196),b=n(197),_=n(198);t.activate=function(e){const t=new v.PluginManager;e.subscriptions.push(t);const u=new h.CommandManager;e.subscriptions.push(u);const l=new r.EventEmitter;e.subscriptions.push(l);const w=function(e,t,n,r){return f.lazy(()=>{const i=new g.default(e),s=new a.default(d.standardLanguageDescriptions,e.workspaceState,t,n,i,r);return e.subscriptions.push(s),e.subscriptions.push(new b.Surveyor(e.globalState,s.serviceClient)),s.serviceClient.onReady(()=>{e.subscriptions.push(y.create(s.serviceClient,s.serviceClient.telemetryReporter))}),s})}(e,t,u,e=>{l.fire(e)});return s.registerCommands(u,w,t),e.subscriptions.push(r.workspace.registerTaskProvider("typescript",new _.default(w.map(e=>e.serviceClient)))),e.subscriptions.push(new o.LanguageConfigurationManager),Promise.resolve().then(()=>n(200)).then(t=>{e.subscriptions.push(t.register())}),e.subscriptions.push(function(e,t){const n=[],i=c.flatten([...d.standardLanguageDescriptions.map(e=>e.modeIds),...t.plugins.map(e=>e.languages)]);let s=!1;const o=t=>!(s||!function(e,t){return!(e.indexOf(t.languageId)<0)&&p.isSupportedScheme(t.uri.scheme)}(i,t)||(s=!0,e.value,n.push(new m.default(t=>e.value.serviceClient.toPath(t))),0));if(!r.workspace.textDocuments.some(o)){const e=r.workspace.onDidOpenTextDocument(t=>{o(t)&&e.dispose()},void 0,n)}return r.Disposable.from(...n)}(w,t)),i.getExtensionApi(l.event,t)},t.deactivate=function(){l.sync(u.getInstanceDir())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e,t){this.onCompletionAccepted=e,this._pluginManager=t}configurePlugin(e,t){this._pluginManager.setConfiguration(e,t)}}t.getExtensionApi=function(e,t){return{getAPI(n){if(0===n)return new r(e,t)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(65),i=n(66),s=n(67),o=n(68),a=n(69),c=n(70);t.registerCommands=function(e,t,n){e.register(new o.ReloadTypeScriptProjectsCommand(t)),e.register(new o.ReloadJavaScriptProjectsCommand(t)),e.register(new c.SelectTypeScriptVersionCommand(t)),e.register(new s.OpenTsServerLogCommand(t)),e.register(new a.RestartTsServerCommand(t)),e.register(new i.TypeScriptGoToProjectConfigCommand(t)),e.register(new i.JavaScriptGoToProjectConfigCommand(t)),e.register(new r.ConfigurePluginCommand(n))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ConfigurePluginCommand=class{constructor(e){this.pluginManager=e,this.id="_typescript.configurePlugin"}execute(e,t){this.pluginManager.setConfiguration(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(16),o=n(22),a=i.loadMessageBundle(n(1).join(__dirname,"commands/goToProjectConfiguration.ts"));t.TypeScriptGoToProjectConfigCommand=class{constructor(e){this.lazyClientHost=e,this.id="typescript.goToProjectConfig"}execute(){const e=r.window.activeTextEditor;e&&c(this.lazyClientHost.value,!0,e.document.uri)}};async function c(e,t,n){const i=e.serviceClient,c=i.getWorkspaceRootForResource(n);if(!c)return void r.window.showInformationMessage(a(0,null));const u=i.toPath(n);if(!u||!await e.handles(n))return void r.window.showWarningMessage(a(1,null));let l;try{l=await i.execute("projectInfo",{file:u,needFileNameList:!1},s.nulToken)}catch(e){}if(!l||"response"!==l.type||!l.body)return void r.window.showWarningMessage(a(2,null));const{configFileName:h}=l.body;if(h&&!o.isImplicitProjectConfigFile(h)){const e=await r.workspace.openTextDocument(h);return void r.window.showTextDocument(e,r.window.activeTextEditor?r.window.activeTextEditor.viewColumn:void 0)}let p;!function(e){e[e.None=0]="None",e[e.CreateConfig=1]="CreateConfig",e[e.LearnMore=2]="LearnMore"}(p||(p={}));const d=await r.window.showInformationMessage(t?a(3,null,"https://go.microsoft.com/fwlink/?linkid=841896"):a(4,null,"https://go.microsoft.com/fwlink/?linkid=759670"),{title:a(t?5:6,null),id:p.CreateConfig});switch(d&&d.id){case p.CreateConfig:return void o.openOrCreateConfigFile(t,c,i.configuration)}}t.JavaScriptGoToProjectConfigCommand=class{constructor(e){this.lazyClientHost=e,this.id="javascript.goToProjectConfig"}execute(){const e=r.window.activeTextEditor;e&&c(this.lazyClientHost.value,!1,e.document.uri)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.OpenTsServerLogCommand=class{constructor(e){this.lazyClientHost=e,this.id="typescript.openTsServerLog"}execute(){this.lazyClientHost.value.serviceClient.openTsServerLogFile()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ReloadTypeScriptProjectsCommand=class{constructor(e){this.lazyClientHost=e,this.id="typescript.reloadProjects"}execute(){this.lazyClientHost.value.reloadProjects()}};t.ReloadJavaScriptProjectsCommand=class{constructor(e){this.lazyClientHost=e,this.id="javascript.reloadProjects"}execute(){this.lazyClientHost.value.reloadProjects()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.RestartTsServerCommand=class{constructor(e){this.lazyClientHost=e,this.id="typescript.restartTsServer"}execute(){this.lazyClientHost.value.serviceClient.restartTsServer()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SelectTypeScriptVersionCommand=class{constructor(e){this.lazyClientHost=e,this.id="typescript.selectTypeScriptVersion"}execute(){this.lazyClientHost.value.serviceClient.onVersionStatusClicked()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(6),s=n(14),o={indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]].*$/,increaseIndentPattern:/^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/},wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,onEnterRules:[{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,afterText:/^\s*\*\/$/,action:{indentAction:r.IndentAction.IndentOutdent,appendText:" * "}},{beforeText:/^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,action:{indentAction:r.IndentAction.None,appendText:" * "}},{beforeText:/^(\t|[ ])*[ ]\*([ ]([^\*]|\*(?!\/))*)?$/,oneLineAboveText:/^(\s*(\/\*\*|\*)).*/,action:{indentAction:r.IndentAction.None,appendText:"* "}},{beforeText:/^(\t|[ ])*[ ]\*\/\s*$/,action:{indentAction:r.IndentAction.None,removeText:1}},{beforeText:/^(\t|[ ])*[ ]\*[^/]*\*\/\s*$/,action:{indentAction:r.IndentAction.None,removeText:1}},{beforeText:/^\s*(\bcase\s.+:|\bdefault:)$/,afterText:/^(?!\s*(\bcase\b|\bdefault\b))/,action:{indentAction:r.IndentAction.Indent}}]},a=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],c={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,onEnterRules:[{beforeText:new RegExp(`<(?!(?:${a.join("|")}))([_:\\w][_:\\w\\-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:r.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${a.join("|")}))([_:\\w][_:\\w\\-.\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:r.IndentAction.Indent}},{beforeText:/^>$/,afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:r.IndentAction.IndentOutdent}},{beforeText:/^>$/,action:{indentAction:r.IndentAction.Indent}}]};t.LanguageConfigurationManager=class extends i.Disposable{constructor(){super();const e=[s.javascript,s.javascriptreact,s.typescript,s.typescriptreact];for(const t of e)this.registerConfiguration(t,o);this.registerConfiguration(s.jsxTags,c)}registerConfiguration(e,t){this._register(r.languages.setLanguageConfiguration(e,t))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(73),s=n(75),o=n(18),a=n(100),c=n(4),u=n(6),l=n(2),h=n(178),p=n(179),d=n(15),f=[6133,6138,6192,7027,7028,7029,7030];t.default=class extends u.Disposable{constructor(e,t,o,u,l,d){super(),this.commandManager=u,this.languages=[],this.languagePerId=new Map,this.reportStyleCheckAsWarnings=!0;const f=()=>{this.triggerAllDiagnostics()},g=this._register(r.workspace.createFileSystemWatcher("**/[tj]sconfig.json"));g.onDidCreate(f,this,this._disposables),g.onDidDelete(f,this,this._disposables),g.onDidChange(()=>{setTimeout(()=>{this.triggerAllDiagnostics()},1500)},this,this._disposables);const m=this.getAllModeIds(e,o);this.client=this._register(new a.default(t,e=>this.versionStatus.onDidChangeTypeScriptVersion(e),o,l,m)),this.client.onDiagnosticsReceived(({kind:e,resource:t,diagnostics:n})=>{this.diagnosticsReceived(e,t,n)},null,this._disposables),this.client.onConfigDiagnosticsReceived(e=>this.configFileDiagnosticsReceived(e),null,this._disposables),this.client.onResendModelsRequested(()=>this.populateService(),null,this._disposables),this.versionStatus=this._register(new p.default(e=>this.client.toPath(e))),this._register(new h.AtaProgressReporter(this.client)),this.typingsStatus=this._register(new h.default(this.client)),this.fileConfigurationManager=this._register(new i.default(this.client));for(const t of e){const e=new s.default(this.client,t,this.commandManager,this.client.telemetryReporter,this.typingsStatus,this.fileConfigurationManager,d);this.languages.push(e),this._register(e),this.languagePerId.set(t.id,e)}Promise.resolve().then(()=>n(180)).then(e=>this._register(e.register(this.client,this.fileConfigurationManager,e=>this.handles(e)))),Promise.resolve().then(()=>n(181)).then(e=>this._register(e.register(this.client,m))),this.client.ensureServiceStarted(),this.client.onReady(()=>{if(this.client.apiVersion.lt(c.default.v230))return;const e=new Set;for(const t of o.plugins)for(const n of t.languages)e.add(n);if(e.size){const t={id:"typescript-plugins",modeIds:Array.from(e.values()),diagnosticSource:"ts-plugin",diagnosticLanguage:1,diagnosticOwner:"typescript",isExternal:!0},n=new s.default(this.client,t,this.commandManager,this.client.telemetryReporter,this.typingsStatus,this.fileConfigurationManager,d);this.languages.push(n),this._register(n),this.languagePerId.set(t.id,n)}}),this.client.onTsServerStarted(()=>{this.triggerAllDiagnostics()}),r.workspace.onDidChangeConfiguration(this.configurationChanged,this,this._disposables),this.configurationChanged()}getAllModeIds(e,t){return d.flatten([...e.map(e=>e.modeIds),...t.plugins.map(e=>e.languages)])}get serviceClient(){return this.client}reloadProjects(){this.client.executeWithoutWaitingForResponse("reloadProjects",null),this.triggerAllDiagnostics()}async handles(e){return!!await this.findLanguage(e)||this.client.bufferSyncSupport.handles(e)}configurationChanged(){const e=r.workspace.getConfiguration("typescript");this.reportStyleCheckAsWarnings=e.get("reportStyleChecksAsWarnings",!0)}async findLanguage(e){try{const t=await r.workspace.openTextDocument(e);return this.languages.find(n=>n.handles(e,t))}catch(e){return}}triggerAllDiagnostics(){for(const e of this.languagePerId.values())e.triggerAllDiagnostics()}populateService(){this.fileConfigurationManager.reset(),this.client.bufferSyncSupport.reOpenDocuments(),this.client.bufferSyncSupport.requestAllDiagnostics(),r.workspace.saveAll(!1).then(()=>{for(const e of this.languagePerId.values())e.reInitialize()})}async diagnosticsReceived(e,t,n){const r=await this.findLanguage(t);r&&r.diagnosticsReceived(e,t,this.createMarkerDatas(n,r.diagnosticSource))}configFileDiagnosticsReceived(e){const t=e.body;t&&t.diagnostics&&t.configFile&&this.findLanguage(this.client.toResource(t.configFile)).then(e=>{e&&e.configFileDiagnosticsReceived(this.client.toResource(t.configFile),t.diagnostics.map(n=>{const i=n.start&&n.end?l.Range.fromTextSpan(n):new r.Range(0,0,0,1),s=new r.Diagnostic(i,t.diagnostics[0].text,this.getDiagnosticSeverity(n));return s.source=e.diagnosticSource,s}))})}createMarkerDatas(e,t){return e.map(e=>this.tsDiagnosticToVsDiagnostic(e,t))}tsDiagnosticToVsDiagnostic(e,t){const{start:n,end:i,text:s}=e,o=new r.Range(l.Position.fromLocation(n),l.Position.fromLocation(i)),a=new r.Diagnostic(o,s,this.getDiagnosticSeverity(e));a.source=e.source||t,e.code&&(a.code=e.code);const c=e.relatedInformation;return c&&(a.relatedInformation=c.map(e=>{let t=e.span;if(t)return new r.DiagnosticRelatedInformation(l.Location.fromTextSpan(this.client.toResource(t.file),t),e.message)}).filter(e=>!!e)),e.reportsUnnecessary&&(a.tags=[r.DiagnosticTag.Unnecessary]),a.reportUnnecessary=e.reportsUnnecessary,a}getDiagnosticSeverity(e){if(this.reportStyleCheckAsWarnings&&this.isStyleCheckDiagnostic(e.code)&&e.category===o.DiagnosticCategory.error)return r.DiagnosticSeverity.Warning;switch(e.category){case o.DiagnosticCategory.error:return r.DiagnosticSeverity.Error;case o.DiagnosticCategory.warning:return r.DiagnosticSeverity.Warning;case o.DiagnosticCategory.suggestion:return r.DiagnosticSeverity.Hint;default:return r.DiagnosticSeverity.Error}}isStyleCheckDiagnostic(e){return!!e&&-1!==f.indexOf(e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(4),s=n(14),o=n(24),a=n(6);function c(e,t){let n=Object.keys(e);for(const r of n)if(e[r]!==t[r])return!1;return!0}t.default=class extends a.Disposable{constructor(e){super(),this.client=e,this.formatOptions=new o.ResourceMap,r.workspace.onDidCloseTextDocument(e=>{this.formatOptions.delete(e.uri)},void 0,this._disposables)}async ensureConfigurationForDocument(e,t){const n=this.getFormattingOptions(e);if(n)return this.ensureConfigurationOptions(e,n,t)}getFormattingOptions(e){const t=r.window.visibleTextEditors.find(t=>t.document.fileName===e.fileName);return t?{tabSize:t.options.tabSize,insertSpaces:t.options.insertSpaces}:void 0}async ensureConfigurationOptions(e,t,n){const r=this.client.toOpenedFilePath(e);if(!r)return;const i=this.getFileOptions(e,t),s=this.formatOptions.get(e.uri);if(s){const e=await s;if(e&&function(e,t){return c(e.formatOptions,t.formatOptions)&&c(e.preferences,t.preferences)}(e,i))return}let o;this.formatOptions.set(e.uri,new Promise(e=>o=e));const a={file:r,...i};try{const e=await this.client.execute("configure",a,n);o("response"===e.type?i:void 0)}finally{o(void 0)}}async setGlobalConfigurationFromDocument(e,t){const n=this.getFormattingOptions(e);if(!n)return;const r={file:void 0,...this.getFileOptions(e,n)};await this.client.execute("configure",r,t)}reset(){this.formatOptions.clear()}getFileOptions(e,t){return{formatOptions:this.getFormatOptions(e,t),preferences:this.getPreferences(e)}}getFormatOptions(e,t){const n=r.workspace.getConfiguration(s.isTypeScriptDocument(e)?"typescript.format":"javascript.format",e.uri);return{tabSize:t.tabSize,indentSize:t.tabSize,convertTabsToSpaces:t.insertSpaces,newLineCharacter:"\n",insertSpaceAfterCommaDelimiter:n.get("insertSpaceAfterCommaDelimiter"),insertSpaceAfterConstructor:n.get("insertSpaceAfterConstructor"),insertSpaceAfterSemicolonInForStatements:n.get("insertSpaceAfterSemicolonInForStatements"),insertSpaceBeforeAndAfterBinaryOperators:n.get("insertSpaceBeforeAndAfterBinaryOperators"),insertSpaceAfterKeywordsInControlFlowStatements:n.get("insertSpaceAfterKeywordsInControlFlowStatements"),insertSpaceAfterFunctionKeywordForAnonymousFunctions:n.get("insertSpaceAfterFunctionKeywordForAnonymousFunctions"),insertSpaceBeforeFunctionParenthesis:n.get("insertSpaceBeforeFunctionParenthesis"),insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:n.get("insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis"),insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:n.get("insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets"),insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces:n.get("insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces"),insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:n.get("insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces"),insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces:n.get("insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces"),insertSpaceAfterTypeAssertion:n.get("insertSpaceAfterTypeAssertion"),placeOpenBraceOnNewLineForFunctions:n.get("placeOpenBraceOnNewLineForFunctions"),placeOpenBraceOnNewLineForControlBlocks:n.get("placeOpenBraceOnNewLineForControlBlocks"),semicolons:n.get("semicolons")}}getPreferences(e){if(this.client.apiVersion.lt(i.default.v290))return{};const t=r.workspace.getConfiguration(s.isTypeScriptDocument(e)?"typescript.preferences":"javascript.preferences",e.uri);return{quotePreference:this.getQuoteStylePreference(t),importModuleSpecifierPreference:function(e){switch(e.get("importModuleSpecifier")){case"relative":return"relative";case"non-relative":return"non-relative";default:return}}(t),allowTextChangesInNewFiles:"file"===e.uri.scheme,providePrefixAndSuffixTextForRename:t.get("renameShorthandProperties",!0),allowRenameOfImportPath:!0}}getQuoteStylePreference(e){switch(e.get("quoteStyle")){case"single":return"single";case"double":return"double";default:return this.client.apiVersion.gte(i.default.v333)?"auto":void 0}}}},function(e,t){var n;t=e.exports=U,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,s=t.re=[],o=t.src=[],a=0,c=a++;o[c]="0|[1-9]\\d*";var u=a++;o[u]="[0-9]+";var l=a++;o[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var h=a++;o[h]="("+o[c]+")\\.("+o[c]+")\\.("+o[c]+")";var p=a++;o[p]="("+o[u]+")\\.("+o[u]+")\\.("+o[u]+")";var d=a++;o[d]="(?:"+o[c]+"|"+o[l]+")";var f=a++;o[f]="(?:"+o[u]+"|"+o[l]+")";var g=a++;o[g]="(?:-("+o[d]+"(?:\\."+o[d]+")*))";var m=a++;o[m]="(?:-?("+o[f]+"(?:\\."+o[f]+")*))";var v=a++;o[v]="[0-9A-Za-z-]+";var y=a++;o[y]="(?:\\+("+o[v]+"(?:\\."+o[v]+")*))";var b=a++,_="v?"+o[h]+o[g]+"?"+o[y]+"?";o[b]="^"+_+"$";var w="[v=\\s]*"+o[p]+o[m]+"?"+o[y]+"?",S=a++;o[S]="^"+w+"$";var C=a++;o[C]="((?:<|>)?=?)";var k=a++;o[k]=o[u]+"|x|X|\\*";var T=a++;o[T]=o[c]+"|x|X|\\*";var x=a++;o[x]="[v=\\s]*("+o[T]+")(?:\\.("+o[T]+")(?:\\.("+o[T]+")(?:"+o[g]+")?"+o[y]+"?)?)?";var E=a++;o[E]="[v=\\s]*("+o[k]+")(?:\\.("+o[k]+")(?:\\.("+o[k]+")(?:"+o[m]+")?"+o[y]+"?)?)?";var P=a++;o[P]="^"+o[C]+"\\s*"+o[x]+"$";var I=a++;o[I]="^"+o[C]+"\\s*"+o[E]+"$";var O=a++;o[O]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var A=a++;o[A]="(?:~>?)";var D=a++;o[D]="(\\s*)"+o[A]+"\\s+",s[D]=new RegExp(o[D],"g");var R=a++;o[R]="^"+o[A]+o[x]+"$";var j=a++;o[j]="^"+o[A]+o[E]+"$";var M=a++;o[M]="(?:\\^)";var F=a++;o[F]="(\\s*)"+o[M]+"\\s+",s[F]=new RegExp(o[F],"g");var L=a++;o[L]="^"+o[M]+o[x]+"$";var N=a++;o[N]="^"+o[M]+o[E]+"$";var q=a++;o[q]="^"+o[C]+"\\s*("+w+")$|^$";var V=a++;o[V]="^"+o[C]+"\\s*("+_+")$|^$";var K=a++;o[K]="(\\s*)"+o[C]+"\\s*("+w+"|"+o[x]+")",s[K]=new RegExp(o[K],"g");var z=a++;o[z]="^\\s*("+o[x]+")\\s+-\\s+("+o[x]+")\\s*$";var H=a++;o[H]="^\\s*("+o[E]+")\\s+-\\s+("+o[E]+")\\s*$";var B=a++;o[B]="(<|>)?=?\\s*\\*";for(var $=0;$<a;$++)n($,o[$]),s[$]||(s[$]=new RegExp(o[$]));function W(e,t){if(e instanceof U)return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t?s[S]:s[b]).test(e))return null;try{return new U(e,t)}catch(e){return null}}function U(e,t){if(e instanceof U){if(e.loose===t)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>r)throw new TypeError("version is longer than "+r+" characters");if(!(this instanceof U))return new U(e,t);n("SemVer",e,t),this.loose=t;var o=e.trim().match(t?s[S]:s[b]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}t.parse=W,t.valid=function(e,t){var n=W(e,t);return n?n.version:null},t.clean=function(e,t){var n=W(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=U,U.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},U.prototype.toString=function(){return this.version},U.prototype.compare=function(e){return n("SemVer.compare",this.version,this.loose,e),e instanceof U||(e=new U(e,this.loose)),this.compareMain(e)||this.comparePre(e)},U.prototype.compareMain=function(e){return e instanceof U||(e=new U(e,this.loose)),Z(this.major,e.major)||Z(this.minor,e.minor)||Z(this.patch,e.patch)},U.prototype.comparePre=function(e){if(e instanceof U||(e=new U(e,this.loose)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return Z(r,i)}while(++t)},U.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new U(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(X(e,t))return null;var n=W(e),r=W(t);if(n.prerelease.length||r.prerelease.length){for(var i in n)if(("major"===i||"minor"===i||"patch"===i)&&n[i]!==r[i])return"pre"+i;return"prerelease"}for(var i in n)if(("major"===i||"minor"===i||"patch"===i)&&n[i]!==r[i])return i},t.compareIdentifiers=Z;var G=/^[0-9]+$/;function Z(e,t){var n=G.test(e),r=G.test(t);return n&&r&&(e=+e,t=+t),n&&!r?-1:r&&!n?1:e<t?-1:e>t?1:0}function J(e,t,n){return new U(e,n).compare(new U(t,n))}function Q(e,t,n){return J(e,t,n)>0}function Y(e,t,n){return J(e,t,n)<0}function X(e,t,n){return 0===J(e,t,n)}function ee(e,t,n){return 0!==J(e,t,n)}function te(e,t,n){return J(e,t,n)>=0}function ne(e,t,n){return J(e,t,n)<=0}function re(e,t,n,r){var i;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),i=e===n;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),i=e!==n;break;case"":case"=":case"==":i=X(e,n,r);break;case"!=":i=ee(e,n,r);break;case">":i=Q(e,n,r);break;case">=":i=te(e,n,r);break;case"<":i=Y(e,n,r);break;case"<=":i=ne(e,n,r);break;default:throw new TypeError("Invalid operator: "+t)}return i}function ie(e,t){if(e instanceof ie){if(e.loose===t)return e;e=e.value}if(!(this instanceof ie))return new ie(e,t);n("comparator",e,t),this.loose=t,this.parse(e),this.semver===se?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return Z(t,e)},t.major=function(e,t){return new U(e,t).major},t.minor=function(e,t){return new U(e,t).minor},t.patch=function(e,t){return new U(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort(function(e,r){return t.compare(e,r,n)})},t.rsort=function(e,n){return e.sort(function(e,r){return t.rcompare(e,r,n)})},t.gt=Q,t.lt=Y,t.eq=X,t.neq=ee,t.gte=te,t.lte=ne,t.cmp=re,t.Comparator=ie;var se={};function oe(e,t){if(e instanceof oe)return e.loose===t?e:new oe(e.raw,t);if(e instanceof ie)return new oe(e.value,t);if(!(this instanceof oe))return new oe(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function ae(e){return!e||"x"===e.toLowerCase()||"*"===e}function ce(e,t,n,r,i,s,o,a,c,u,l,h,p){return((t=ae(n)?"":ae(r)?">="+n+".0.0":ae(i)?">="+n+"."+r+".0":">="+t)+" "+(a=ae(c)?"":ae(u)?"<"+(+c+1)+".0.0":ae(l)?"<"+c+"."+(+u+1)+".0":h?"<="+c+"."+u+"."+l+"-"+h:"<="+a)).trim()}function ue(e,t){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length){for(r=0;r<e.length;r++)if(n(e[r].semver),e[r].semver!==se&&e[r].semver.prerelease.length>0){var i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new oe(t,n)}catch(e){return!1}return t.test(e)}function he(e,t,n,r){var i,s,o,a,c;switch(e=new U(e,r),t=new oe(t,r),n){case">":i=Q,s=ne,o=Y,a=">",c=">=";break;case"<":i=Y,s=te,o=Q,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var u=0;u<t.set.length;++u){var l=null,h=null;if(t.set[u].forEach(function(e){e.semver===se&&(e=new ie(">=0.0.0")),l=l||e,h=h||e,i(e.semver,l.semver,r)?l=e:o(e.semver,h.semver,r)&&(h=e)}),l.operator===a||l.operator===c)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0}ie.prototype.parse=function(e){var t=this.loose?s[q]:s[V],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new U(n[2],this.loose):this.semver=se},ie.prototype.toString=function(){return this.value},ie.prototype.test=function(e){return n("Comparator.test",e,this.loose),this.semver===se||("string"==typeof e&&(e=new U(e,this.loose)),re(e,this.operator,this.semver,this.loose))},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Comparator is required");var n;if(""===this.operator)return n=new oe(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new oe(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=re(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=re(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||s&&o||a||c},t.Range=oe,oe.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},oe.prototype.toString=function(){return this.range},oe.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),n("range",e,t);var r=t?s[H]:s[z];e=e.replace(r,ce),n("hyphen replace",e),e=e.replace(s[K],"$1$2$3"),n("comparator trim",e,s[K]),e=(e=(e=e.replace(s[D],"$1~")).replace(s[F],"$1^")).split(/\s+/).join(" ");var i=t?s[q]:s[V],o=e.split(" ").map(function(e){return function(e,t){return n("comp",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){n("caret",e,t);var r=t?s[N]:s[L];return e.replace(r,function(t,r,i,s,o){var a;return n("caret",e,t,r,i,s,o),ae(r)?a="":ae(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":ae(s)?a="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":o?(n("replaceCaret pr",o),"-"!==o.charAt(0)&&(o="-"+o),a="0"===r?"0"===i?">="+r+"."+i+"."+s+o+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+o+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===i?">="+r+"."+i+"."+s+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+" <"+(+r+1)+".0.0"),n("caret return",a),a})}(e,t)}).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){var r=t?s[j]:s[R];return e.replace(r,function(t,r,i,s,o){var a;return n("tilde",e,t,r,i,s,o),ae(r)?a="":ae(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":ae(s)?a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":o?(n("replaceTilde pr",o),"-"!==o.charAt(0)&&(o="-"+o),a=">="+r+"."+i+"."+s+o+" <"+r+"."+(+i+1)+".0"):a=">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0",n("tilde return",a),a})}(e,t)}).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return function(e,t){e=e.trim();var r=t?s[I]:s[P];return e.replace(r,function(t,r,i,s,o,a){n("xRange",e,t,r,i,s,o,a);var c=ae(i),u=c||ae(s),l=u||ae(o),h=l;return"="===r&&h&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&h?(u&&(s=0),l&&(o=0),">"===r?(r=">=",u?(i=+i+1,s=0,o=0):l&&(s=+s+1,o=0)):"<="===r&&(r="<",u?i=+i+1:s=+s+1),t=r+i+"."+s+"."+o):u?t=">="+i+".0.0 <"+(+i+1)+".0.0":l&&(t=">="+i+"."+s+".0 <"+i+"."+(+s+1)+".0"),n("xRange return",t),t})}(e,t)}).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(s[B],"")}(e,t),n("stars",e),e}(e,t)}).join(" ").split(/\s+/);return this.loose&&(o=o.filter(function(e){return!!e.match(i)})),o=o.map(function(e){return new ie(e,t)})},oe.prototype.intersects=function(e,t){if(!(e instanceof oe))throw new TypeError("a Range is required");return this.set.some(function(n){return n.every(function(n){return e.set.some(function(e){return e.every(function(e){return n.intersects(e,t)})})})})},t.toComparators=function(e,t){return new oe(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})},oe.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new U(e,this.loose));for(var t=0;t<this.set.length;t++)if(ue(this.set[t],e))return!0;return!1},t.satisfies=le,t.maxSatisfying=function(e,t,n){var r=null,i=null;try{var s=new oe(t,n)}catch(e){return null}return e.forEach(function(e){s.test(e)&&(r&&-1!==i.compare(e)||(i=new U(r=e,n)))}),r},t.minSatisfying=function(e,t,n){var r=null,i=null;try{var s=new oe(t,n)}catch(e){return null}return e.forEach(function(e){s.test(e)&&(r&&1!==i.compare(e)||(i=new U(r=e,n)))}),r},t.validRange=function(e,t){try{return new oe(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return he(e,t,"<",n)},t.gtr=function(e,t,n){return he(e,t,">",n)},t.outside=he,t.prerelease=function(e,t){var n=W(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new oe(e,n),t=new oe(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof U)return e;if("string"!=typeof e)return null;var t=e.match(s[O]);return null==t?null:W((t[1]||"0")+"."+(t[2]||"0")+"."+(t[3]||"0"))}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0});const i=n(1),s=n(0),o=n(76),a=n(6),c=n(19),u=n(11),l="validate.enable",h="suggestionActions.enabled";class p extends a.Disposable{constructor(e,t,n,r,i,o,a){super(),this.client=e,this.description=t,this.commandManager=n,this.telemetryReporter=r,this.typingsStatus=i,this.fileConfigurationManager=o,this.onCompletionAccepted=a,s.workspace.onDidChangeConfiguration(this.configurationChanged,this,this._disposables),this.configurationChanged(),e.onReady(()=>this.registerProviders())}get documentSelector(){const e=[];for(const t of this.description.modeIds)for(const n of c.supportedSchemes)e.push({language:t,scheme:n});return e}async registerProviders(){const e=this.documentSelector,t=new o.CachedResponse;await Promise.all([Promise.resolve().then(()=>n(77)).then(t=>this._register(t.register(e,this.description.id,this.client,this.typingsStatus,this.fileConfigurationManager,this.commandManager,this.telemetryReporter,this.onCompletionAccepted))),Promise.resolve().then(()=>n(79)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(80)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(81)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(82)).then(n=>this._register(n.register(e,this.client,t))),Promise.resolve().then(()=>n(83)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(84)).then(t=>this._register(t.register(e,this.description.id,this.client,this.fileConfigurationManager))),Promise.resolve().then(()=>n(85)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(86)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(87)).then(n=>this._register(n.register(e,this.description.id,this.client,t))),Promise.resolve().then(()=>n(88)).then(t=>this._register(t.register(e,this.description.id,this.client))),Promise.resolve().then(()=>n(89)).then(t=>this._register(t.register(e,this.client,this.commandManager,this.fileConfigurationManager,this.telemetryReporter))),Promise.resolve().then(()=>n(90)).then(t=>this._register(t.register(e,this.client,this.fileConfigurationManager,this.commandManager,this.client.diagnosticsManager,this.telemetryReporter))),Promise.resolve().then(()=>n(91)).then(t=>this._register(t.register(e,this.client,this.fileConfigurationManager,this.client.diagnosticsManager))),Promise.resolve().then(()=>n(92)).then(t=>this._register(t.register(e,this.client,this.fileConfigurationManager,this.commandManager,this.telemetryReporter))),Promise.resolve().then(()=>n(93)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(94)).then(n=>this._register(n.register(e,this.description.id,this.client,t))),Promise.resolve().then(()=>n(95)).then(t=>this._register(t.register(e,this.client,this.fileConfigurationManager))),Promise.resolve().then(()=>n(96)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(97)).then(t=>this._register(t.register(e,this.client))),Promise.resolve().then(()=>n(98)).then(t=>this._register(t.register(e,this.description.id,this.client))),Promise.resolve().then(()=>n(99)).then(t=>this._register(t.register(e,this.client)))])}configurationChanged(){const e=s.workspace.getConfiguration(this.id,null);this.updateValidate(e.get(l,!0)),this.updateSuggestionDiagnostics(e.get(h,!0))}handles(e,t){if(t&&this.description.modeIds.indexOf(t.languageId)>=0)return!0;const n=i.basename(e.fsPath);return!!n&&!!this.description.configFilePattern&&this.description.configFilePattern.test(n)}get id(){return this.description.id}get diagnosticSource(){return this.description.diagnosticSource}updateValidate(e){this.client.diagnosticsManager.setValidate(this._diagnosticLanguage,e)}updateSuggestionDiagnostics(e){this.client.diagnosticsManager.setEnableSuggestions(this._diagnosticLanguage,e)}reInitialize(){this.client.diagnosticsManager.reInitialize()}triggerAllDiagnostics(){this.client.bufferSyncSupport.requestAllDiagnostics()}diagnosticsReceived(e,t,n){const r=s.workspace.getConfiguration(this.id,t).get("showUnused",!0);this.client.diagnosticsManager.updateDiagnostics(t,this._diagnosticLanguage,e,n.filter(e=>!(!r&&(e.tags=void 0,e.reportUnnecessary&&e.severity===s.DiagnosticSeverity.Hint))))}configFileDiagnosticsReceived(e,t){this.client.diagnosticsManager.configFileDiagnosticsReceived(e,t)}get _diagnosticLanguage(){return this.description.diagnosticLanguage}}r([u.memoize],p.prototype,"documentSelector",null),t.default=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CachedResponse=class{constructor(){this.version=-1,this.document=""}execute(e,t){return this.response&&this.matches(e)?this.response=this.response.then(e=>"cancelled"===e.type?t():e):this.reset(e,t)}matches(e){return this.version===e.version&&this.document===e.uri.toString()}async reset(e,t){return this.version=e.version,this.document=e.uri.toString(),this.response=t()}}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),s=n(3),o=n(18),a=n(4),c=n(16),u=n(39),l=n(8),h=n(11),p=n(25),d=n(78),f=n(2),g=s.loadMessageBundle(n(1).join(__dirname,"features/completions.ts"));class m extends i.CompletionItem{constructor(e,t,n,r,s,a,c){if(super(r.name,m.convertKind(r.kind)),this.position=e,this.document=t,this.tsEntry=r,this.completionContext=a,this.metadata=c,r.source?this.sortText=""+r.sortText:this.sortText=r.sortText,r.isRecommended&&(this.preselect=!0),this.position=e,this.useCodeSnippet=s&&(this.kind===i.CompletionItemKind.Function||this.kind===i.CompletionItemKind.Method),r.replacementSpan&&(this.range=f.Range.fromTextSpan(r.replacementSpan),this.range.isSingleLine||(this.range=new i.Range(this.range.start.line,this.range.start.character,this.range.start.line,n.length))),this.insertText=r.insertText,this.filterText=r.insertText&&!/^this\./.test(r.insertText)?r.insertText:void 0,a.isMemberCompletion&&a.dotAccessorContext&&(this.filterText=a.dotAccessorContext.text+(this.insertText||this.label),this.range||(this.range=a.dotAccessorContext.range,this.insertText=this.filterText)),r.kindModifiers){const e=new Set(r.kindModifiers.split(/\s+/g));if(e.has(o.KindModifiers.optional)&&(this.insertText||(this.insertText=this.label),this.filterText||(this.filterText=this.label),this.label+="?"),e.has(o.KindModifiers.color)&&(this.kind=i.CompletionItemKind.Color),r.kind===o.Kind.script)for(const t of o.KindModifiers.fileExtensionKindModifiers)if(e.has(t)){r.name.toLowerCase().endsWith(t)?this.detail=r.name:this.detail=r.name+t;break}}this.resolveRange(n)}resolveRange(e){if(this.range)return;const t=this.document.getWordRangeAtPosition(this.position),n=e.slice(Math.max(0,this.position.character-this.label.length),this.position.character).toLowerCase(),r=this.label.toLowerCase();for(let e=r.length;e>=0;--e)if(n.endsWith(r.substr(0,e))&&(!t||t.start.character>this.position.character-e)){this.range=new i.Range(new i.Position(this.position.line,Math.max(0,this.position.character-e)),this.position);break}}static convertKind(e){switch(e){case o.Kind.primitiveType:case o.Kind.keyword:return i.CompletionItemKind.Keyword;case o.Kind.const:return i.CompletionItemKind.Constant;case o.Kind.let:case o.Kind.variable:case o.Kind.localVariable:case o.Kind.alias:return i.CompletionItemKind.Variable;case o.Kind.memberVariable:case o.Kind.memberGetAccessor:case o.Kind.memberSetAccessor:return i.CompletionItemKind.Field;case o.Kind.function:return i.CompletionItemKind.Function;case o.Kind.memberFunction:case o.Kind.constructSignature:case o.Kind.callSignature:case o.Kind.indexSignature:return i.CompletionItemKind.Method;case o.Kind.enum:return i.CompletionItemKind.Enum;case o.Kind.module:case o.Kind.externalModuleName:return i.CompletionItemKind.Module;case o.Kind.class:case o.Kind.type:return i.CompletionItemKind.Class;case o.Kind.interface:return i.CompletionItemKind.Interface;case o.Kind.warning:return i.CompletionItemKind.Text;case o.Kind.script:return i.CompletionItemKind.File;case o.Kind.directory:return i.CompletionItemKind.Folder;case o.Kind.string:return i.CompletionItemKind.Constant}return i.CompletionItemKind.Property}get commitCharacters(){if(this.completionContext.isNewIdentifierLocation||!this.completionContext.isInValidCommitCharacterContext)return;const e=[];switch(this.tsEntry.kind){case o.Kind.memberGetAccessor:case o.Kind.memberSetAccessor:case o.Kind.constructSignature:case o.Kind.callSignature:case o.Kind.indexSignature:case o.Kind.enum:case o.Kind.interface:e.push(".",";");break;case o.Kind.module:case o.Kind.alias:case o.Kind.const:case o.Kind.let:case o.Kind.variable:case o.Kind.localVariable:case o.Kind.memberVariable:case o.Kind.class:case o.Kind.function:case o.Kind.memberFunction:case o.Kind.keyword:case o.Kind.parameter:e.push(".",",",";"),this.completionContext.enableCallCompletions&&e.push("(")}return 0===e.length?void 0:e}}r([h.memoize],m.prototype,"commitCharacters",null);class v{constructor(){this.id=v.ID}execute(...e){for(const t of e)i.commands.executeCommand(t.command,...t.arguments||[])}}v.ID="_typescript.composite";class y{constructor(e){this.onCompletionAccepted=e,this.id=y.ID}execute(e){this.onCompletionAccepted(e)}}y.ID="_typescript.onCompletionAccepted";class b{constructor(e){this.client=e,this.id=b.ID}async execute(e,t){if(0===t.length)return!0;if(1===t.length)return u.applyCodeAction(this.client,t[0],c.nulToken);const n=await i.window.showQuickPick(t.map((e,t)=>({label:e.description,description:"",index:t})),{placeHolder:g(0,null)});if(!n)return!1;const r=t[n.index];return!!r&&u.applyCodeAction(this.client,r,c.nulToken)}}var _;b.ID="_typescript.applyCompletionCodeAction",function(e){e.useCodeSnippetsOnMethodSuggest="suggest.completeFunctionCalls",e.nameSuggestions="suggest.names",e.pathSuggestions="suggest.paths",e.autoImportSuggestions="suggest.autoImports",e.getConfigurationForResource=function(t,n){const r=i.workspace.getConfiguration(t,n);return{useCodeSnippetsOnMethodSuggest:r.get(e.useCodeSnippetsOnMethodSuggest,!1),pathSuggestions:r.get(e.pathSuggestions,!0),autoImportSuggestions:r.get(e.autoImportSuggestions,!0),nameSuggestions:r.get(e.nameSuggestions,!0)}}}(_||(_={}));class w{constructor(e,t,n,r,i,s,o){this.client=e,this.modeId=t,this.typingsStatus=n,this.fileConfigurationManager=r,this.telemetryReporter=s,i.register(new b(this.client)),i.register(new v),i.register(new y(o))}async provideCompletionItems(e,t,n,r){if(this.typingsStatus.isAcquiringTypings)return Promise.reject({label:g(1,null),detail:g(2,null)});const s=this.client.toOpenedFilePath(e);if(!s)return null;const c=e.lineAt(t.line),u=_.getConfigurationForResource(this.modeId,e.uri);if(!this.shouldTrigger(r,c,t))return null;await this.client.interruptGetErr(()=>this.fileConfigurationManager.ensureConfigurationForDocument(e,n));const l={...f.Position.toFileLocationRequestArgs(s,t),includeExternalModuleExports:u.autoImportSuggestions,includeInsertTextCompletions:!0,triggerCharacter:this.getTsTriggerCharacter(r)};let h,p,d,v=!0,y=!1,b=!1;if(this.client.apiVersion.gte(a.default.v300)){const r=Date.now();let s;try{s=await this.client.interruptGetErr(()=>this.client.execute("completionInfo",l,n))}finally{const e=Date.now()-r;this.telemetryReporter.logTelemetry("completions.execute",{duration:e+"",type:s?s.type:"unknown",count:(s&&"response"===s.type&&s.body?s.body.entries.length:0)+""})}if("response"!==s.type||!s.body)return null;if(v=s.body.isNewIdentifierLocation,b=s.body.isMemberCompletion){const n=c.text.slice(0,t.character).match(/\??\.\s*$/)||void 0;if(n){const r=new i.Range(t.translate({characterDelta:-n[0].length}),t),s=e.getText(r);h={range:r,text:s}}}y=s.metadata&&s.metadata.isIncomplete,p=s.body.entries,d=s.metadata}else{const e=await this.client.interruptGetErr(()=>this.client.execute("completions",l,n));if("response"!==e.type||!e.body)return null;p=e.body,d=e.metadata}const w=this.isInValidCommitCharacterContext(e,t),S=p.filter(e=>!function(e,t){return!t.nameSuggestions&&e.kind===o.Kind.warning||!t.pathSuggestions&&(e.kind===o.Kind.directory||e.kind===o.Kind.script||e.kind===o.Kind.externalModuleName)||!t.autoImportSuggestions&&e.hasAction}(e,u)).map(n=>new m(t,e,c.text,n,u.useCodeSnippetsOnMethodSuggest,{isNewIdentifierLocation:v,isMemberCompletion:b,dotAccessorContext:h,isInValidCommitCharacterContext:w,enableCallCompletions:!u.useCodeSnippetsOnMethodSuggest},d));return new i.CompletionList(S,y)}getTsTriggerCharacter(e){if("@"!==e.triggerCharacter||!this.client.apiVersion.gte(a.default.v310)||!this.client.apiVersion.lt(a.default.v320))return e.triggerCharacter}async resolveCompletionItem(e,t){if(!(e instanceof m))return;const n=this.client.toOpenedFilePath(e.document);if(!n)return;const r={...f.Position.toFileLocationRequestArgs(n,e.position),entryNames:[e.tsEntry.source?{name:e.tsEntry.name,source:e.tsEntry.source}:e.tsEntry.name]},i=await this.client.interruptGetErr(()=>this.client.execute("completionEntryDetails",r,t));if("response"!==i.type||!i.body||!i.body.length)return e;const s=i.body[0];!e.detail&&s.displayParts.length&&(e.detail=p.plain(s.displayParts)),e.documentation=this.getDocumentation(s,e);const o=this.getCodeActions(s,n),a=[{command:y.ID,title:"",arguments:[e]}];if(o.command&&a.push(o.command),e.additionalTextEdits=o.additionalTextEdits,s&&e.useCodeSnippet){if(await this.isValidFunctionCompletionContext(n,e.position,e.document,t)){const{snippet:t,parameterCount:n}=d.snippetForFunctionCall(e,s.displayParts);e.insertText=t,n>0&&a.push({title:"triggerParameterHints",command:"editor.action.triggerParameterHints"})}}return a.length&&(1===a.length?e.command=a[0]:e.command={command:v.ID,title:"",arguments:a}),e}getCodeActions(e,t){if(!e.codeActions||!e.codeActions.length)return{};const n=[];let r=!1;for(const i of e.codeActions)if(i.commands&&(r=!0),i.changes)for(const e of i.changes)e.fileName===t?n.push(...e.textChanges.map(f.TextEdit.fromCodeEdit)):r=!0;let i=void 0;return r&&(i={title:"",command:b.ID,arguments:[t,e.codeActions.map(e=>({commands:e.commands,description:e.description,changes:e.changes.filter(e=>e.fileName!==t)}))]}),{command:i,additionalTextEdits:n.length?n:void 0}}isInValidCommitCharacterContext(e,t){if(this.client.apiVersion.lt(a.default.v320)&&t.character>1){return null===e.getText(new i.Range(t.line,0,t.line,t.character)).match(/(\s|^)\.$/gi)}return!0}shouldTrigger(e,t,n){if(e.triggerCharacter&&this.client.apiVersion.lt(a.default.v290)){if('"'===e.triggerCharacter||"'"===e.triggerCharacter){const e=t.text.slice(0,n.character);if(!e.match(/\b(from|import)\s*["']$/)&&!e.match(/\b(import|require)\(['"]$/))return!1}if("/"===e.triggerCharacter){const e=t.text.slice(0,n.character);if(!e.match(/\b(from|import)\s*["'][^'"]*$/)&&!e.match(/\b(import|require)\(['"][^'"]*$/))return!1}if("@"===e.triggerCharacter){const e=t.text.slice(0,n.character);if(!e.match(/^\s*\*[ ]?@/)&&!e.match(/\/\*\*+[ ]?@/))return!1}if("<"===e.triggerCharacter)return!1}return!0}getDocumentation(e,t){const n=new i.MarkdownString;if(e.source){const n=`'${p.plain(e.source)}'`,r=g(3,null,n);t.detail=`${r}\n${t.detail}`}return p.addMarkdownDocumentation(n,e.documentation,e.tags),n.value.length?n:void 0}async isValidFunctionCompletionContext(e,t,n,r){try{const n=f.Position.toFileLocationRequestArgs(e,t),i=await this.client.execute("quickinfo",n,r);if("response"===i.type&&i.body)switch(i.body.kind){case"var":case"let":case"const":case"alias":return!1}}catch(e){}return null===n.lineAt(t.line).text.slice(t.character).match(/^[a-z_$0-9]*\s*\(/gi)}}w.triggerCharacters=[".",'"',"'","/","@","<"],t.register=function(e,t,n,r,s,o,a,c){return new l.ConfigurationDependentRegistration(t,"suggest.enabled",()=>i.languages.registerCompletionItemProvider(e,new w(n,t,r,s,o,a,c),...w.triggerCharacters))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(18);t.snippetForFunctionCall=function(e,t){if(e.insertText&&"string"!=typeof e.insertText)return{snippet:e.insertText,parameterCount:0};const n=function(e){const t=[];let n=!1,r=!1,s=0,o=0;e:for(let a=0;a<e.length;++a){const c=e[a];switch(c.kind){case i.DisplayPartKind.methodName:case i.DisplayPartKind.functionName:case i.DisplayPartKind.text:case i.DisplayPartKind.propertyName:0===s&&0===o&&(n=!0);break;case i.DisplayPartKind.parameterName:if(1===s&&0===o&&n){const n=e[a+1],i=n&&"?"===n.text;i||t.push(c),r=r||i}break;case i.DisplayPartKind.punctuation:if("("===c.text)++s;else if(")"===c.text){if(--s<=0&&n)break e}else{if("..."===c.text&&1===s){r=!0;break e}"{"===c.text?++o:"}"===c.text&&--o}}}return{hasOptionalParameters:r,parts:t}}(t),s=new r.SnippetString;return s.appendText(`${e.insertText||e.label}(`),function(e,t,n){for(let r=0;r<t.length;++r){const i=t[r];e.appendPlaceholder(i.text),r!==t.length-1&&e.appendText(n)}}(s,n.parts,", "),n.hasOptionalParameters&&s.appendTabstop(),s.appendText(")"),s.appendTabstop(0),{snippet:s,parameterCount:n.parts.length+(n.hasOptionalParameters?1:0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(4),s=n(2),o=n(26);class a extends o.default{constructor(e){super(e)}async provideDefinition(e,t,n){if(this.client.apiVersion.gte(i.default.v270)){const r=this.client.toOpenedFilePath(e);if(!r)return;const i=s.Position.toFileLocationRequestArgs(r,t),o=await this.client.execute("definitionAndBoundSpan",i,n);if("response"!==o.type||!o.body)return;const a=o.body.textSpan?s.Range.fromTextSpan(o.body.textSpan):void 0;return o.body.definitions.map(e=>{const t=s.Location.fromTextSpan(this.client.toResource(e.file),e);return e.contextStart?{originSelectionRange:a,targetRange:s.Range.fromLocations(e.contextStart,e.contextEnd),targetUri:t.uri,targetSelectionRange:t.range}:{originSelectionRange:a,targetRange:t.range,targetUri:t.uri}})}return this.getSymbolLocations("definition",e,t,n)}}t.default=a,t.register=function(e,t){return r.languages.registerDefinitionProvider(e,new a(t))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(4),o=n(8),a=i.loadMessageBundle(n(1).join(__dirname,"features/directiveCommentCompletions.ts")),c=[{value:"@ts-check",description:a(0,null)},{value:"@ts-nocheck",description:a(1,null)},{value:"@ts-ignore",description:a(2,null)}];class u{constructor(e){this.client=e}provideCompletionItems(e,t,n){if(!this.client.toOpenedFilePath(e))return[];const i=e.lineAt(t.line).text.slice(0,t.character).match(/^\s*\/\/+\s?(@[a-zA-Z\-]*)?$/);return i?c.map(e=>{const n=new r.CompletionItem(e.value,r.CompletionItemKind.Snippet);return n.detail=e.description,n.range=new r.Range(t.line,Math.max(0,t.character-(i[1]?i[1].length:0)),t.line,t.character),n}):[]}}u.minVersion=s.default.v230,t.register=function(e,t){return new o.VersionDependentRegistration(t,u.minVersion,()=>r.languages.registerCompletionItemProvider(e,new u(t),"@"))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(15),s=n(2);class o{constructor(e){this.client=e}async provideDocumentHighlights(e,t,n){const r=this.client.toOpenedFilePath(e);if(!r)return[];const o={...s.Position.toFileLocationRequestArgs(r,t),filesToSearch:[r]},c=await this.client.execute("documentHighlights",o,n);return"response"===c.type&&c.body?i.flatten(c.body.filter(e=>e.file===r).map(a)):[]}}function a(e){return e.highlightSpans.map(e=>new r.DocumentHighlight(s.Range.fromTextSpan(e),"writtenReference"===e.kind?r.DocumentHighlightKind.Write:r.DocumentHighlightKind.Read))}t.register=function(e,t){return r.languages.registerDocumentHighlightProvider(e,new o(t))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(18),s=n(2),o=e=>{switch(e){case i.Kind.module:return r.SymbolKind.Module;case i.Kind.class:return r.SymbolKind.Class;case i.Kind.enum:return r.SymbolKind.Enum;case i.Kind.interface:return r.SymbolKind.Interface;case i.Kind.memberFunction:return r.SymbolKind.Method;case i.Kind.memberVariable:case i.Kind.memberGetAccessor:case i.Kind.memberSetAccessor:return r.SymbolKind.Property;case i.Kind.variable:case i.Kind.const:case i.Kind.localVariable:return r.SymbolKind.Variable;case i.Kind.function:case i.Kind.localFunction:return r.SymbolKind.Function}return r.SymbolKind.Variable};class a{constructor(e,t){this.client=e,this.cachedResponse=t}async provideDocumentSymbols(e,t){const n=this.client.toOpenedFilePath(e);if(!n)return;const r={file:n},i=await this.cachedResponse.execute(e,()=>this.client.execute("navtree",r,t));if("response"!==i.type||!i.body)return;let s=i.body;if(s&&s.childItems){const t=[];return s.childItems.forEach(n=>a.convertNavTree(e.uri,t,n)),t}}static convertNavTree(e,t,n){let i=a.shouldInclueEntry(n);const c=new Set(n.childItems||[]);for(const u of n.spans){const l=s.Range.fromTextSpan(u),h=new r.DocumentSymbol(n.text,"",o(n.kind),l,l);for(const t of c)if(t.spans.some(e=>!!l.intersection(s.Range.fromTextSpan(e)))){const n=a.convertNavTree(e,h.children,t);i=i||n,c.delete(t)}i&&t.push(h)}return i}static shouldInclueEntry(e){return e.kind!==i.Kind.alias&&!(!e.text||"<function>"===e.text||"<class>"===e.text)}}t.register=function(e,t,n){return r.languages.registerDocumentSymbolProvider(e,new a(t,n),{label:"TypeScript"})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(4),s=n(8),o=n(2);class a{constructor(e){this.client=e}async provideFoldingRanges(e,t,n){const r=this.client.toOpenedFilePath(e);if(!r)return;const i={file:r},s=await this.client.execute("getOutliningSpans",i,n);return"response"===s.type&&s.body?s.body.map(t=>this.convertOutliningSpan(t,e)).filter(e=>!!e):void 0}convertOutliningSpan(e,t){const n=o.Range.fromTextSpan(e.textSpan),i=a.getFoldingRangeKind(e);if("comment"===e.kind){if(t.lineAt(n.start.line).text.match(/\/\/\s*#endregion/gi))return}const s=n.start.line,c=n.end.character>0&&new Set(["}","]"]).has(t.getText(new r.Range(n.end.translate(0,-1),n.end)))?Math.max(n.end.line-1,n.start.line):n.end.line;return new r.FoldingRange(s,c,i)}static getFoldingRangeKind(e){switch(e.kind){case"comment":return r.FoldingRangeKind.Comment;case"region":return r.FoldingRangeKind.Region;case"imports":return r.FoldingRangeKind.Imports;case"code":default:return}}}a.minVersion=i.default.v280,t.register=function(e,t){return new s.VersionDependentRegistration(t,a.minVersion,()=>r.languages.registerFoldingRangeProvider(e,new a(t)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(8),s=n(2);class o{constructor(e,t){this.client=e,this.formattingOptionsManager=t}async provideDocumentRangeFormattingEdits(e,t,n,r){const i=this.client.toOpenedFilePath(e);if(!i)return;await this.formattingOptionsManager.ensureConfigurationOptions(e,n,r);const o=s.Range.toFormattingRequestArgs(i,t),a=await this.client.execute("format",o,r);return"response"===a.type&&a.body?a.body.map(s.TextEdit.fromCodeEdit):void 0}async provideOnTypeFormattingEdits(e,t,n,r,i){const o=this.client.toOpenedFilePath(e);if(!o)return[];await this.formattingOptionsManager.ensureConfigurationOptions(e,r,i);const a={...s.Position.toFileLocationRequestArgs(o,t),key:n},c=await this.client.execute("formatonkey",a,i);if("response"!==c.type||!c.body)return[];const u=c.body,l=[];if(!u)return l;for(const t of u){const n=s.TextEdit.fromCodeEdit(t),r=n.range;if(0===r.start.character&&r.start.line===r.end.line&&""===n.newText){const t=e.lineAt(r.start.line).text;(t.trim().length>0||t.length>r.end.character)&&l.push(n)}else l.push(n)}return l}}t.register=function(e,t,n,s){return new i.ConfigurationDependentRegistration(t,"format.enable",()=>{const t=new o(n,s);return r.Disposable.from(r.languages.registerOnTypeFormattingEditProvider(e,t,";","}","\n"),r.languages.registerDocumentRangeFormattingEditProvider(e,t))})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(25),s=n(2);class o{constructor(e){this.client=e}async provideHover(e,t,n){const i=this.client.toOpenedFilePath(e);if(!i)return;const a=s.Position.toFileLocationRequestArgs(i,t),c=await this.client.interruptGetErr(()=>this.client.execute("quickinfo",a,n));return"response"===c.type&&c.body?new r.Hover(o.getContents(c.body),s.Range.fromTextSpan(c.body)):void 0}static getContents(e){const t=[];e.displayString&&t.push({language:"typescript",value:e.displayString});const n=i.tagsMarkdownPreview(e.tags);return t.push(e.documentation+(n?"\n\n"+n:"")),t}}t.register=function(e,t){return r.languages.registerHoverProvider(e,new o(t))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(4),s=n(8),o=n(26);class a extends o.default{provideImplementation(e,t,n){return this.getSymbolLocations("implementation",e,t,n)}}a.minVersion=i.default.v220,t.register=function(e,t){return new s.VersionDependentRegistration(t,a.minVersion,()=>r.languages.registerImplementationProvider(e,new a(t)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(18),o=n(4),a=n(8),c=n(40),u=n(2),l=i.loadMessageBundle(n(1).join(__dirname,"features/implementationsCodeLens.ts"));class h extends c.TypeScriptBaseCodeLensProvider{async resolveCodeLens(e,t){const n=e,i=u.Position.toFileLocationRequestArgs(n.file,n.range.start),s=await this.client.execute("implementation",i,t,{lowPriority:!0});if("response"!==s.type||!s.body)return n.command="cancelled"===s.type?c.TypeScriptBaseCodeLensProvider.cancelledCommand:c.TypeScriptBaseCodeLensProvider.errorCommand,n;const o=s.body.map(e=>new r.Location(this.client.toResource(e.file),e.start.line===e.end.line?u.Range.fromTextSpan(e):new r.Range(u.Position.fromLocation(e.start),new r.Position(e.start.line,0)))).filter(e=>!(e.uri.toString()===n.document.toString()&&e.range.start.line===n.range.start.line&&e.range.start.character===n.range.start.character));return n.command=this.getCommand(o,n),n}getCommand(e,t){return{title:this.getTitle(e),command:e.length?"editor.action.showReferences":"",arguments:[t.document,t.range.start,e]}}getTitle(e){return 1===e.length?l(0,null):l(1,null,e.length)}extractSymbol(e,t,n){switch(t.kind){case s.Kind.interface:return c.getSymbolRange(e,t);case s.Kind.class:case s.Kind.memberFunction:case s.Kind.memberVariable:case s.Kind.memberGetAccessor:case s.Kind.memberSetAccessor:if(t.kindModifiers.match(/\babstract\b/g))return c.getSymbolRange(e,t)}return null}}t.default=h,h.minVersion=o.default.v220,t.register=function(e,t,n,i){return new a.VersionDependentRegistration(n,h.minVersion,()=>new a.ConfigurationDependentRegistration(t,"implementationsCodeLens.enabled",()=>r.languages.registerCodeLensProvider(e,new h(n,i))))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(8),o=n(2),a=i.loadMessageBundle(n(1).join(__dirname,"features/jsDocCompletions.ts")),c=new r.SnippetString("/**\n * $0\n */");class u extends r.CompletionItem{constructor(e,t){super("/** */",r.CompletionItemKind.Snippet),this.document=e,this.position=t,this.detail=a(0,null),this.sortText="\0";const n=e.lineAt(t.line).text,i=n.slice(0,t.character).match(/\/\**\s*$/),s=n.slice(t.character).match(/^\s*\**\//),o=t.translate(0,i?-i[0].length:0);this.range=new r.Range(o,t.translate(0,s?s[0].length:0))}}class l{constructor(e){this.client=e}async provideCompletionItems(e,t,n){const r=this.client.toOpenedFilePath(e);if(!r)return;if(!this.isPotentiallyValidDocCompletionPosition(e,t))return;const i=o.Position.toFileLocationRequestArgs(r,t),s=await this.client.execute("docCommentTemplate",i,n);if("response"!==s.type||!s.body)return;const a=new u(e,t);return"/** */"===s.body.newText?a.insertText=c:a.insertText=h(s.body.newText),[a]}isPotentiallyValidDocCompletionPosition(e,t){const n=e.lineAt(t.line).text;return null!==n.slice(0,t.character).match(/^\s*$|\/\*\*\s*$|^\s*\/\*\*+\s*$/)&&null!==n.slice(t.character).match(/^\s*\*+\//)}}function h(e){let t=1;return e=(e=(e=(e=e.replace(/\$/g,"\\$")).replace(/^\s*(?=(\/|[ ]\*))/gm,"")).replace(/^(\/\*\*\s*\*[ ]*)$/m,e=>e+"$0")).replace(/\* @param([ ]\{\S+\})?\s+(\S+)\s*$/gm,(e,n,r)=>{let i="* @param ";return" {any}"===n||" {*}"===n?i+=`{\${${t++}:*}} `:n&&(i+=n+" "),i+=r+` \${${t++}}`}),new r.SnippetString(e)}t.templateToSnippet=h,t.register=function(e,t,n){return new s.ConfigurationDependentRegistration(t,"suggest.completeJSDocs",()=>r.languages.registerCompletionItemProvider(e,new l(n),"*"))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(4),o=n(8),a=n(2),c=n(16),u=i.loadMessageBundle(n(1).join(__dirname,"features/organizeImports.ts"));class l{constructor(e,t){this.client=e,this.telemetryReporter=t,this.id=l.Id}async execute(e){this.telemetryReporter.logTelemetry("organizeImports.execute",{});const t={scope:{type:"file",args:{file:e}}},n=await this.client.interruptGetErr(()=>this.client.execute("organizeImports",t,c.nulToken));if("response"!==n.type||!n.body)return!1;const i=a.WorkspaceEdit.fromFileCodeEdits(this.client,n.body);return r.workspace.applyEdit(i)}}l.Id="_typescript.organizeImports";class h{constructor(e,t,n,i){this.client=e,this.fileConfigManager=n,this.metadata={providedCodeActionKinds:[r.CodeActionKind.SourceOrganizeImports]},t.register(new l(e,i))}provideCodeActions(e,t,n,i){const s=this.client.toOpenedFilePath(e);if(!s)return[];if(!n.only||!n.only.contains(r.CodeActionKind.SourceOrganizeImports))return[];this.fileConfigManager.ensureConfigurationForDocument(e,i);const o=new r.CodeAction(u(0,null),r.CodeActionKind.SourceOrganizeImports);return o.command={title:"",command:l.Id,arguments:[s]},[o]}}t.OrganizeImportsCodeActionProvider=h,h.minVersion=s.default.v280,t.register=function(e,t,n,i,s){return new o.VersionDependentRegistration(t,h.minVersion,()=>{const o=new h(t,n,i,s);return r.languages.registerCodeActionsProvider(e,o,o.metadata)})}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),s=n(3),o=n(4),a=n(16),c=n(39),u=n(11),l=n(2),h=s.loadMessageBundle(n(1).join(__dirname,"features/quickFix.ts"));class p{constructor(e,t){this.client=e,this.telemetryReporter=t,this.id=p.ID}async execute(e){return this.telemetryReporter.logTelemetry("quickFix.execute",{fixName:e.fixName}),c.applyCodeActionCommands(this.client,e.commands,a.nulToken)}}p.ID="_typescript.applyCodeActionCommand";class d{constructor(e,t){this.client=e,this.telemetryReporter=t,this.id=d.ID}async execute(e,t){if(!t.fixId)return;this.telemetryReporter.logTelemetry("quickFixAll.execute",{fixName:t.fixName});const n={scope:{type:"file",args:{file:e}},fixId:t.fixId},r=await this.client.execute("getCombinedCodeFix",n,a.nulToken);if("response"!==r.type||!r.body)return;const s=l.WorkspaceEdit.fromFileCodeEdits(this.client,r.body.changes);await i.workspace.applyEdit(s),await c.applyCodeActionCommands(this.client,r.body.commands,a.nulToken)}}d.ID="_typescript.applyFixAllCodeAction";class f{constructor(e){this._values=e}static from(e){const t=new Map;for(const n of e)t.set(f.key(n),n);return new f(t)}static key(e){const{start:t,end:n}=e.range;return`${e.code}-${t.line},${t.character}-${n.line},${n.character}`}get values(){return this._values.values()}get size(){return this._values.size}}class g{constructor(){this._actions=new Set,this._fixAllActions=new Map}get values(){return this._actions}addAction(e){this._actions.add(e)}addFixAllAction(e,t){const n=this._fixAllActions.get(e);n&&this._actions.delete(n),this.addAction(t),this._fixAllActions.set(e,t)}hasFixAllAction(e){return this._fixAllActions.has(e)}}class m{constructor(e){this.client=e}async getFixableDiagnosticsForContext(e){const t=await this.fixableDiagnosticCodes;return f.from(e.diagnostics.filter(e=>void 0!==e.code&&t.has(e.code+"")))}get fixableDiagnosticCodes(){return this.client.execute("getSupportedCodeFixes",null,a.nulToken).then(e=>"response"===e.type&&e.body||[]).then(e=>new Set(e))}}r([u.memoize],m.prototype,"fixableDiagnosticCodes",null);class v{constructor(e,t,n,r,i){this.client=e,this.formattingConfigurationManager=t,this.diagnosticsManager=r,n.register(new p(e,i)),n.register(new d(e,i)),this.supportedCodeActionProvider=new m(e)}async provideCodeActions(e,t,n,r){const i=this.client.toOpenedFilePath(e);if(!i)return[];const s=await this.supportedCodeActionProvider.getFixableDiagnosticsForContext(n);if(!s.size)return[];if(this.client.bufferSyncSupport.hasPendingDiagnostics(e.uri))return[];await this.formattingConfigurationManager.ensureConfigurationForDocument(e,r);const o=new g;for(const t of s.values)await this.getFixesForDiagnostic(e,i,t,o,r);return Array.from(o.values)}async getFixesForDiagnostic(e,t,n,r,i){const s={...l.Range.toFileRangeRequestArgs(t,n.range),errorCodes:[+n.code]},o=await this.client.execute("getCodeFixes",s,i);if("response"!==o.type||!o.body)return r;for(const i of o.body)this.addAllFixesForTsCodeAction(r,e,t,n,i);return r}addAllFixesForTsCodeAction(e,t,n,r,i){return e.addAction(this.getSingleFixForTsCodeAction(r,i)),this.addFixAllForTsCodeAction(e,t,n,r,i),e}getSingleFixForTsCodeAction(e,t){const n=new i.CodeAction(t.description,i.CodeActionKind.QuickFix);return n.edit=c.getEditForCodeAction(this.client,t),n.diagnostics=[e],n.command={command:p.ID,arguments:[t],title:""},n.isPreferred=function(e){return b.has(e.fixName)}(t),n}addFixAllForTsCodeAction(e,t,n,r,s){if(!s.fixId||this.client.apiVersion.lt(o.default.v270)||e.hasFixAllAction(s.fixId))return e;if(!this.diagnosticsManager.getDiagnostics(t.uri).some(e=>e!==r&&(e.code===r.code||y.has(e.code)&&y.get(e.code)===y.get(r.code))))return e;const a=new i.CodeAction(s.fixAllDescription||h(0,null,s.description),i.CodeActionKind.QuickFix);return a.diagnostics=[r],a.command={command:d.ID,arguments:[n,s],title:""},e.addFixAllAction(s.fixId,a),e}}v.metadata={providedCodeActionKinds:[i.CodeActionKind.QuickFix]};const y=new Map([[2339,2339],[2345,2339]]),b=new Set(["annotateWithTypeFromJSDoc","constructorForDerivedNeedSuperCall","extendsInterfaceBecomesImplements","fixAwaitInSyncFunction","fixClassIncorrectlyImplementsInterface","fixUnreachableCode","forgottenThisPropertyAccess","spelling","unusedIdentifier","addMissingAwait"]);t.register=function(e,t,n,r,s,o){return i.languages.registerCodeActionsProvider(e,new v(t,n,r,s,o),v.metadata)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(4),o=n(8),a=n(2),c=i.loadMessageBundle(n(1).join(__dirname,"features/fixAll.ts")),u=new Set([2420,2552]);class l{constructor(e,t,n){this.client=e,this.fileConfigurationManager=t,this.diagnosticsManager=n}async provideCodeActions(e,t,n,i){if(!n.only||!r.CodeActionKind.SourceFixAll.intersects(n.only))return;const s=this.client.toOpenedFilePath(e);if(!s)return;const o=this.getAutoFixableDiagnostics(e);if(!o.length)return;const a=await this.getFixAllCodeAction(e,s,o,i);return a?[a]:void 0}getAutoFixableDiagnostics(e){return this.client.bufferSyncSupport.hasPendingDiagnostics(e.uri)?[]:this.diagnosticsManager.getDiagnostics(e.uri).filter(e=>u.has(e.code))}async getFixAllCodeAction(e,t,n,i){await this.fileConfigurationManager.ensureConfigurationForDocument(e,i);const s=await this.getAutoFixEdit(t,n,i);if(!s)return;const{edit:o,fixedDiagnostics:a}=s,u=new r.CodeAction(c(0,null),r.CodeActionKind.SourceFixAll);return u.edit=o,u.diagnostics=a,u}async getAutoFixEdit(e,t,n){const i=new r.WorkspaceEdit,s=[];for(const r of t){const t={...a.Range.toFileRangeRequestArgs(e,r.range),errorCodes:[+r.code]},o=await this.client.execute("getCodeFixes",t,n);if("response"!==o.type||!o.body||o.body.length>1)return;const c=o.body[0];new Set(["fixClassIncorrectlyImplementsInterface","spelling"]).has(c.fixName)&&(a.WorkspaceEdit.withFileCodeEdits(i,this.client,c.changes),s.push(r))}if(s.length)return{edit:i,fixedDiagnostics:s}}}l.metadata={providedCodeActionKinds:[r.CodeActionKind.SourceFixAll]},t.register=function(e,t,n,i){return new o.VersionDependentRegistration(t,s.default.v300,()=>new o.ConfigurationDependentRegistration("typescript","experimental.autoFix.enabled",()=>r.languages.registerCodeActionsProvider(e,new l(t,n,i),l.metadata)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(4),o=n(16),a=n(8),c=n(2),u=n(19),l=i.loadMessageBundle(n(1).join(__dirname,"features/refactor.ts"));class h{constructor(e,t){this.client=e,this.telemetryReporter=t,this.id=h.ID}async execute(e,t,n,i){const s=this.client.toOpenedFilePath(e);if(!s)return!1;this.telemetryReporter.logTelemetry("refactor.execute",{action:n});const a={...c.Range.toFileRangeRequestArgs(s,i),refactor:t,action:n},u=await this.client.execute("getEditsForRefactor",a,o.nulToken);if("response"!==u.type||!u.body)return!1;if(!u.body.edits.length)return r.window.showErrorMessage(l(0,null)),!1;const h=await this.toWorkspaceEdit(u.body);if(!await r.workspace.applyEdit(h))return!1;const p=u.body.renameLocation;return p&&await r.commands.executeCommand("editor.action.rename",[e.uri,c.Position.fromLocation(p)]),!0}async toWorkspaceEdit(e){const t=new r.WorkspaceEdit;for(const n of e.edits){const e=this.client.toResource(n.fileName);e.scheme===u.file&&t.createFile(e,{ignoreIfExists:!0})}return c.WorkspaceEdit.withFileCodeEdits(t,this.client,e.edits),t}}h.ID="_typescript.applyRefactoring";class p{constructor(e,t){this.client=e,this.doRefactoring=t,this.id=p.ID}async execute(e,t,n){if(!this.client.toOpenedFilePath(e))return!1;const i=await r.window.showQuickPick(t.actions.map(e=>({label:e.name,description:e.description})));return!!i&&this.doRefactoring.execute(e,t.name,i.label,n)}}p.ID="_typescript.selectRefactoring";class d{constructor(e,t,n,r){this.client=e,this.formattingOptionsManager=t;const i=n.register(new h(this.client,r));n.register(new p(this.client,i))}async provideCodeActions(e,t,n,r){if(!this.shouldTrigger(t,n))return;if(!this.client.toOpenedFilePath(e))return;const i=await this.client.interruptGetErr(()=>{const n=this.client.toOpenedFilePath(e);if(!n)return;this.formattingOptionsManager.ensureConfigurationForDocument(e,r);const i=c.Range.toFileRangeRequestArgs(n,t);return this.client.execute("getApplicableRefactors",i,r)});return i&&"response"===i.type&&i.body?this.convertApplicableRefactors(i.body,e,t):void 0}convertApplicableRefactors(e,t,n){const i=[];for(const s of e)if(!1===s.inlineable){const e=new r.CodeAction(s.description,r.CodeActionKind.Refactor);e.command={title:s.description,command:p.ID,arguments:[t,s,n]},i.push(e)}else for(const e of s.actions)i.push(this.refactorActionToCodeAction(e,t,s,n));return i}refactorActionToCodeAction(e,t,n,i){const s=new r.CodeAction(e.description,d.getKind(e));return s.command={title:e.description,command:h.ID,arguments:[t,n.name,e.name,i]},s.isPreferred=d.isPreferred(e),s}shouldTrigger(e,t){return!(t.only&&!r.CodeActionKind.Refactor.contains(t.only))&&e instanceof r.Selection}static getKind(e){return e.name.startsWith("function_")?d.extractFunctionKind:e.name.startsWith("constant_")?d.extractConstantKind:e.name.startsWith("Move")?d.moveKind:e.name.includes("Extract to type alias")?d.extractTypeKind:r.CodeActionKind.Refactor}static isPreferred(e){return e.name.startsWith("constant_")?e.name.endsWith("scope_0"):!!e.name.includes("Extract to type alias")}}d.minVersion=s.default.v240,d.extractFunctionKind=r.CodeActionKind.RefactorExtract.append("function"),d.extractConstantKind=r.CodeActionKind.RefactorExtract.append("constant"),d.extractTypeKind=r.CodeActionKind.RefactorExtract.append("type"),d.moveKind=r.CodeActionKind.Refactor.append("move"),d.metadata={providedCodeActionKinds:[r.CodeActionKind.Refactor]},t.register=function(e,t,n,i,s){return new a.VersionDependentRegistration(t,d.minVersion,()=>r.languages.registerCodeActionsProvider(e,new d(t,n,i,s),d.metadata))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(2);class s{constructor(e){this.client=e}async provideReferences(e,t,n,r){const s=this.client.toOpenedFilePath(e);if(!s)return[];const o=i.Position.toFileLocationRequestArgs(s,t),a=await this.client.execute("references",o,r);if("response"!==a.type||!a.body)return[];const c=[];for(const e of a.body.refs){if(!n.includeDeclaration&&e.isDefinition)continue;const t=this.client.toResource(e.file),r=i.Location.fromTextSpan(t,e);c.push(r)}return c}}t.register=function(e,t){return r.languages.registerReferenceProvider(e,new s(t))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(18),o=n(8),a=n(2),c=n(40),u=i.loadMessageBundle(n(1).join(__dirname,"features/referencesCodeLens.ts"));class l extends c.TypeScriptBaseCodeLensProvider{async resolveCodeLens(e,t){const n=e,r=a.Position.toFileLocationRequestArgs(n.file,n.range.start),i=await this.client.execute("references",r,t,{lowPriority:!0});if("response"!==i.type||!i.body)return n.command="cancelled"===i.type?c.TypeScriptBaseCodeLensProvider.cancelledCommand:c.TypeScriptBaseCodeLensProvider.errorCommand,n;const s=i.body.refs.map(e=>a.Location.fromTextSpan(this.client.toResource(e.file),e)).filter(e=>!(e.uri.toString()===n.document.toString()&&e.range.start.isEqual(n.range.start)));return n.command={title:this.getCodeLensLabel(s),command:s.length?"editor.action.showReferences":"",arguments:[n.document,n.range.start,s]},n}getCodeLensLabel(e){return 1===e.length?u(0,null):u(1,null,e.length)}extractSymbol(e,t,n){if(n&&n.kind===s.Kind.enum)return c.getSymbolRange(e,t);switch(t.kind){case s.Kind.const:case s.Kind.let:case s.Kind.variable:case s.Kind.function:if(!t.kindModifiers.match(/\bexport\b/))break;case s.Kind.class:if("<class>"===t.text)break;case s.Kind.memberFunction:case s.Kind.memberVariable:case s.Kind.memberGetAccessor:case s.Kind.memberSetAccessor:case s.Kind.constructorImplementation:case s.Kind.interface:case s.Kind.type:case s.Kind.enum:return c.getSymbolRange(e,t)}return null}}t.register=function(e,t,n,i){return new o.ConfigurationDependentRegistration(t,"referencesCodeLens.enabled",()=>r.languages.registerCodeLensProvider(e,new l(n,i)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(0),s=n(3),o=n(4),a=n(2),c=s.loadMessageBundle(n(1).join(__dirname,"features/rename.ts"));class u{constructor(e,t){this.client=e,this.fileConfigurationManager=t}async prepareRename(e,t,n){const r=await this.execRename(e,t,n);if(!r||"response"!==r.type||!r.body)return null;const i=r.body.info;if(!i.canRename)return Promise.reject(i.localizedErrorMessage);if(this.client.apiVersion.gte(o.default.v310)){const e=i.triggerSpan;if(e)return a.Range.fromTextSpan(e)}return null}async provideRenameEdits(e,t,n,r){const i=await this.execRename(e,t,r);if(!i||"response"!==i.type||!i.body)return null;const s=i.body.info;if(!s.canRename)return Promise.reject(s.localizedErrorMessage);if(this.client.apiVersion.gte(o.default.v310)&&s.fileToRename){const e=await this.renameFile(s.fileToRename,n,r);return e||Promise.reject(c(0,null))}return this.updateLocs(i.body.locs,n)}async execRename(e,t,n){const r=this.client.toOpenedFilePath(e);if(!r)return;const i={...a.Position.toFileLocationRequestArgs(r,t),findInStrings:!1,findInComments:!1};return this.client.interruptGetErr(()=>(this.fileConfigurationManager.ensureConfigurationForDocument(e,n),this.client.execute("rename",i,n)))}updateLocs(e,t){const n=new i.WorkspaceEdit;for(const r of e){const e=this.client.toResource(r.file);if(e)for(const i of r.locs)n.replace(e,a.Range.fromTextSpan(i),(i.prefixText||"")+t+(i.suffixText||""))}return n}async renameFile(e,t,n){r.extname(t)||(t+=r.extname(e));const s=r.dirname(e),o=r.join(s,t),c={file:e,oldFilePath:e,newFilePath:o},u=await this.client.execute("getEditsForFileRename",c,n);if("response"!==u.type||!u.body)return;const l=a.WorkspaceEdit.fromFileCodeEdits(this.client,u.body);return l.renameFile(i.Uri.file(e),i.Uri.file(o)),l}}t.register=function(e,t,n){return i.languages.registerRenameProvider(e,new u(t,n))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(4),s=n(8),o=n(2);class a{constructor(e){this.client=e}async provideSelectionRanges(e,t,n){const r=this.client.toOpenedFilePath(e);if(!r)return;const i={file:r,locations:t.map(o.Position.toLocation)},s=await this.client.execute("selectionRange",i,n);return"response"===s.type&&s.body?s.body.map(a.convertSelectionRange):void 0}static convertSelectionRange(e){return new r.SelectionRange(o.Range.fromTextSpan(e.textSpan),e.parent?a.convertSelectionRange(e.parent):void 0)}}a.minVersion=i.default.v350,t.register=function(e,t){return new s.VersionDependentRegistration(t,a.minVersion,()=>r.languages.registerSelectionRangeProvider(e,new a(t)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(25),s=n(2);class o{constructor(e){this.client=e}async provideSignatureHelp(e,t,n,i){const o=this.client.toOpenedFilePath(e);if(!o)return;const a={...s.Position.toFileLocationRequestArgs(o,t),triggerReason:function(e){switch(e.triggerKind){case r.SignatureHelpTriggerKind.TriggerCharacter:return e.triggerCharacter?e.isRetrigger?{kind:"retrigger",triggerCharacter:e.triggerCharacter}:{kind:"characterTyped",triggerCharacter:e.triggerCharacter}:{kind:"invoked"};case r.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case r.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}(i)},c=await this.client.interruptGetErr(()=>this.client.execute("signatureHelp",a,n));if("response"!==c.type||!c.body)return;const u=c.body,l=new r.SignatureHelp;return l.activeSignature=u.selectedItemIndex,l.activeParameter=this.getActiveParmeter(u),l.signatures=u.items.map(e=>this.convertSignature(e)),l}getActiveParmeter(e){const t=e.items[e.selectedItemIndex];return t&&t.isVariadic?Math.min(e.argumentIndex,t.parameters.length-1):e.argumentIndex}convertSignature(e){const t=new r.SignatureInformation(i.plain(e.prefixDisplayParts),i.markdownDocumentation(e.documentation,e.tags.filter(e=>"param"!==e.name)));let n=t.label.length;const s=i.plain(e.separatorDisplayParts);for(let o=0;o<e.parameters.length;++o){const a=e.parameters[o],c=i.plain(a.displayParts);t.parameters.push(new r.ParameterInformation([n,n+c.length],i.markdownDocumentation(a.documentation,[]))),n+=c.length,t.label+=c,o!==e.parameters.length-1&&(t.label+=s,n+=s.length)}return t.label+=i.plain(e.suffixDisplayParts),t}}o.triggerCharacters=["(",",","<"],o.retriggerCharacters=[")"],t.register=function(e,t){return r.languages.registerSignatureHelpProvider(e,new o(t),{triggerCharacters:o.triggerCharacters,retriggerCharacters:o.retriggerCharacters})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(4),s=n(8),o=n(6),a=n(2);class c extends o.Disposable{constructor(e){super(),this.client=e,this._disposed=!1,this._timeout=void 0,this._cancel=void 0,r.workspace.onDidChangeTextDocument(e=>this.onDidChangeTextDocument(e.document,e.contentChanges),null,this._disposables)}dispose(){super.dispose(),this._disposed=!0,this._timeout&&(clearTimeout(this._timeout),this._timeout=void 0),this._cancel&&(this._cancel.cancel(),this._cancel.dispose(),this._cancel=void 0)}onDidChangeTextDocument(e,t){const n=r.window.activeTextEditor&&r.window.activeTextEditor.document;if(e!==n||0===t.length)return;const i=this.client.toOpenedFilePath(e);if(!i)return;void 0!==this._timeout&&clearTimeout(this._timeout),this._cancel&&(this._cancel.cancel(),this._cancel.dispose(),this._cancel=void 0);const s=t[t.length-1],o=s.text[s.text.length-1];if(s.rangeLength>0||">"!==o&&"/"!==o)return;if(">"===(s.range.start.character>0?e.getText(new r.Range(s.range.start.translate({characterDelta:-1}),s.range.start)):""))return;const c=e.version;this._timeout=setTimeout(async()=>{if(this._timeout=void 0,this._disposed)return;const t=s.text.split(/\r\n|\n/g),n=t.length<=1?s.range.start.translate({characterDelta:s.text.length}):new r.Position(s.range.start.line+t.length-1,t[t.length-1].length),o=a.Position.toFileLocationRequestArgs(i,n);this._cancel=new r.CancellationTokenSource;const u=await this.client.execute("jsxClosingTag",o,this._cancel.token);if("response"!==u.type||!u.body)return;if(this._disposed)return;const l=r.window.activeTextEditor;if(!l)return;const h=u.body,p=l.document;e===p&&p.version===c&&l.insertSnippet(this.getTagSnippet(h),this.getInsertionPositions(l,n))},100)}getTagSnippet(e){const t=new r.SnippetString;return t.appendPlaceholder("",0),t.appendText(e.newText),t}getInsertionPositions(e,t){const n=e.selections.map(e=>e.active);return n.some(e=>e.isEqual(t))?n:t}}c.minVersion=i.default.v300;class u extends o.Disposable{constructor(e,t){super(),this.selector=e,this._registration=this._register(new s.ConditionalRegistration(t)),r.window.onDidChangeActiveTextEditor(this.update,this,this._disposables),r.workspace.onDidOpenTextDocument(this.onDidOpenDocument,this,this._disposables),this.update()}update(){const e=r.window.activeTextEditor,t=!(!e||!r.languages.match(this.selector,e.document));this._registration.update(t)}onDidOpenDocument(e){r.window.activeTextEditor&&r.window.activeTextEditor.document===e&&this.update()}}t.ActiveDocumentDependentRegistration=u,t.register=function(e,t,n){return new s.VersionDependentRegistration(n,c.minVersion,()=>new s.ConfigurationDependentRegistration(t,"autoClosingTags",()=>new u(e,()=>new c(n))))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(26);class s extends i.default{provideTypeDefinition(e,t,n){return this.getSymbolLocations("typeDefinition",e,t,n)}}t.default=s,t.register=function(e,t){return r.languages.registerTypeDefinitionProvider(e,new s(t))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5),i=n(1),s=n(0),o=n(3),a=n(101),c=n(103),u=n(4),l=n(42),h=n(6),p=n(19),d=n(104),f=n(105),g=n(106),m=n(168),v=n(22),y=n(169),b=n(170),_=n(171),w=o.loadMessageBundle(n(1).join(__dirname,"typescriptServiceClient.ts"));var S;!function(e){e.None=new class{constructor(){this.type=0}};e.Running=class{constructor(e,t,n,r){this.server=e,this.apiVersion=t,this.tsserverVersion=n,this.langaugeServiceEnabled=r,this.type=1}};e.Errored=class{constructor(e){this.error=e,this.type=2}}}(S||(S={}));class C extends h.Disposable{constructor(e,t,n,r,o){super(),this.workspaceState=e,this.onDidChangeTypeScriptVersion=t,this.pluginManager=n,this.logDirectoryProvider=r,this.logger=new d.default,this.serverState=S.None,this.isRestarting=!1,this.loadingIndicator=new k,this._onTsServerStarted=this._register(new s.EventEmitter),this.onTsServerStarted=this._onTsServerStarted.event,this._onDiagnosticsReceived=this._register(new s.EventEmitter),this.onDiagnosticsReceived=this._onDiagnosticsReceived.event,this._onConfigDiagnosticsReceived=this._register(new s.EventEmitter),this.onConfigDiagnosticsReceived=this._onConfigDiagnosticsReceived.event,this._onResendModelsRequested=this._register(new s.EventEmitter),this.onResendModelsRequested=this._onResendModelsRequested.event,this._onProjectLanguageServiceStateChanged=this._register(new s.EventEmitter),this.onProjectLanguageServiceStateChanged=this._onProjectLanguageServiceStateChanged.event,this._onDidBeginInstallTypings=this._register(new s.EventEmitter),this.onDidBeginInstallTypings=this._onDidBeginInstallTypings.event,this._onDidEndInstallTypings=this._register(new s.EventEmitter),this.onDidEndInstallTypings=this._onDidEndInstallTypings.event,this._onTypesInstallerInitializationFailed=this._register(new s.EventEmitter),this.onTypesInstallerInitializationFailed=this._onTypesInstallerInitializationFailed.event,this._onSurveyReady=this._register(new s.EventEmitter),this.onSurveyReady=this._onSurveyReady.event,this.token=0,this.pathSeparator=i.sep,this.lastStart=Date.now();var u=new Promise((e,t)=>{this._onReady={promise:u,resolve:e,reject:t}});this._onReady.promise=u,this.numberRestarts=0,this._configuration=l.TypeScriptServiceConfiguration.loadFromWorkspace(),this.versionProvider=new b.TypeScriptVersionProvider(this._configuration),this.pluginPathsProvider=new f.TypeScriptPluginPathsProvider(this._configuration),this.versionPicker=new y.TypeScriptVersionPicker(this.versionProvider,this.workspaceState),this.tracer=new m.default(this.logger),this.bufferSyncSupport=new a.default(this,o),this.onReady(()=>{this.bufferSyncSupport.listen()}),this.diagnosticsManager=new c.DiagnosticsManager("typescript"),this.bufferSyncSupport.onDelete(e=>{this.diagnosticsManager.delete(e)},null,this._disposables),s.workspace.onDidChangeConfiguration(()=>{const e=this._configuration;this._configuration=l.TypeScriptServiceConfiguration.loadFromWorkspace(),this.versionProvider.updateConfiguration(this._configuration),this.pluginPathsProvider.updateConfiguration(this._configuration),this.tracer.updateConfiguration(),1===this.serverState.type&&(this._configuration.checkJs===e.checkJs&&this._configuration.experimentalDecorators===e.experimentalDecorators||this.setCompilerOptionsForInferredProjects(this._configuration),this._configuration.isEqualTo(e)||this.restartTsServer())},this,this._disposables),this.telemetryReporter=this._register(new g.VSCodeTelemetryReporter(()=>1===this.serverState.type&&this.serverState.tsserverVersion?this.serverState.tsserverVersion:this.apiVersion.versionString)),this.typescriptServerSpawner=new _.TypeScriptServerSpawner(this.versionProvider,this.logDirectoryProvider,this.pluginPathsProvider,this.logger,this.telemetryReporter,this.tracer),this._register(this.pluginManager.onDidUpdateConfig(e=>{this.configurePlugin(e.pluginId,e.config)})),this._register(this.pluginManager.onDidChangePlugins(()=>{this.restartTsServer()}))}get configuration(){return this._configuration}dispose(){super.dispose(),this.bufferSyncSupport.dispose(),1===this.serverState.type&&this.serverState.server.kill(),this.loadingIndicator.reset()}restartTsServer(){1===this.serverState.type&&(this.info("Killing TS Server"),this.isRestarting=!0,this.serverState.server.kill()),this.serverState=this.startService(!0)}get apiVersion(){return 1===this.serverState.type?this.serverState.apiVersion:u.default.defaultVersion}onReady(e){return this._onReady.promise.then(e)}info(e,t){this.logger.info(e,t)}error(e,t){this.logger.error(e,t)}logTelemetry(e,t){this.telemetryReporter.logTelemetry(e,t)}service(){if(1===this.serverState.type)return this.serverState;if(2===this.serverState.type)throw this.serverState.error;const e=this.startService();if(1===e.type)return e;throw new Error("Could not create TS service")}ensureServiceStarted(){1!==this.serverState.type&&this.startService()}startService(e=!1){if(this.isDisposed)return S.None;let t=this.versionPicker.currentVersion;this.info(`Using tsserver from: ${t.path}`),r.existsSync(t.tsServerPath)||(s.window.showWarningMessage(w(0,null,t.path)),this.versionPicker.useBundledVersion(),t=this.versionPicker.currentVersion);const n=this.versionPicker.currentVersion.apiVersion||u.default.defaultVersion;this.onDidChangeTypeScriptVersion(t);let i=++this.token;const o=this.typescriptServerSpawner.spawn(t,this.configuration,this.pluginManager);return this.serverState=new S.Running(o,n,void 0,!0),this.lastStart=Date.now(),this.logTelemetry("tsserver.spawned",{localTypeScriptVersion:this.versionProvider.localVersion?this.versionProvider.localVersion.versionString:""}),o.onError(e=>{this.token===i&&(e&&s.window.showErrorMessage(w(1,null,e.message||e.name)),this.serverState=new S.Errored(e),this.error("TSServer errored with error.",e),o.tsServerLogFile&&this.error(`TSServer log file: ${o.tsServerLogFile}`),this.logTelemetry("tsserver.error"),this.serviceExited(!1))}),o.onExit(e=>{this.token===i&&(null===e||void 0===e?this.info("TSServer exited"):(this.error(`TSServer exited with code: ${e}`),this.logTelemetry("tsserver.exitWithCode",{code:e})),o.tsServerLogFile&&this.info(`TSServer log file: ${o.tsServerLogFile}`),this.serviceExited(!this.isRestarting),this.isRestarting=!1)}),o.onReaderError(e=>this.error("ReaderError",e)),o.onEvent(e=>this.dispatchEvent(e)),this._onReady.resolve(),this._onTsServerStarted.fire(t.apiVersion),n.gte(u.default.v300)&&this.loadingIndicator.startedLoadingProject(void 0),this.serviceStarted(e),this.serverState}onVersionStatusClicked(){return this.showVersionPicker(!1)}showVersionPicker(e){return this.versionPicker.show(e).then(t=>{!e&&t.newVersion&&t.oldVersion&&t.oldVersion.path!==t.newVersion.path&&this.restartTsServer()})}async openTsServerLogFile(){if(this.apiVersion.lt(u.default.v222))return s.window.showErrorMessage(w(2,null)),!1;if(this._configuration.tsServerLogLevel===l.TsServerLogLevel.Off)return s.window.showErrorMessage(w(3,null),{title:w(4,null)}).then(e=>{if(e)return s.workspace.getConfiguration().update("typescript.tsserver.log","verbose",!0).then(()=>{this.restartTsServer()})}),!1;if(1!==this.serverState.type||!this.serverState.server.tsServerLogFile)return s.window.showWarningMessage(w(5,null)),!1;try{const e=await s.workspace.openTextDocument(s.Uri.file(this.serverState.server.tsServerLogFile));return await s.window.showTextDocument(e),!0}catch(e){}try{return await s.commands.executeCommand("revealFileInOS",s.Uri.file(this.serverState.server.tsServerLogFile)),!0}catch(e){return s.window.showWarningMessage(w(6,null)),!1}}serviceStarted(e){this.executeWithoutWaitingForResponse("configure",{hostInfo:"vscode",preferences:{providePrefixAndSuffixTextForRename:!0,allowRenameOfImportPath:!0}}),this.setCompilerOptionsForInferredProjects(this._configuration),e&&this._onResendModelsRequested.fire();for(const[e,t]of this.pluginManager.configurations())this.configurePlugin(e,t)}setCompilerOptionsForInferredProjects(e){const t={options:this.getCompilerOptionsForInferredProjects(e)};this.executeWithoutWaitingForResponse("compilerOptionsForInferredProjects",t)}getCompilerOptionsForInferredProjects(e){return{...v.inferredProjectConfig(e),allowJs:!0,allowSyntheticDefaultImports:!0,allowNonTsExtensions:!0}}serviceExited(e){let t;if(this.loadingIndicator.reset(),function(e){e[e.reportIssue=0]="reportIssue"}(t||(t={})),this.serverState=S.None,e){const e=Date.now()-this.lastStart;this.numberRestarts++;let n=!0;if(this.numberRestarts>5){let r=void 0;this.numberRestarts=0,e<1e4?(this.lastStart=Date.now(),n=!1,r=s.window.showErrorMessage(w(7,null),{title:w(8,null),id:t.reportIssue}),this.logTelemetry("serviceExited")):e<6e4&&(this.lastStart=Date.now(),r=s.window.showWarningMessage(w(9,null),{title:w(10,null),id:t.reportIssue})),r&&r.then(e=>{if(e&&e.id===t.reportIssue)return s.commands.executeCommand("workbench.action.reportIssues")})}n&&this.startService(!0)}}normalizedPath(e){if(e.scheme===p.walkThroughSnippet||e.scheme===p.untitled){const t=i.dirname(e.path),n=this.inMemoryResourcePrefix+i.basename(e.path);return e.with({path:i.posix.join(t,n)}).toString(!0)}if(e.scheme!==p.file)return;const t=e.fsPath;return t?t.replace(new RegExp("\\"+this.pathSeparator,"g"),"/"):void 0}toPath(e){return this.normalizedPath(e)}toOpenedFilePath(e){if(this.bufferSyncSupport.handles(e.uri))return this.toPath(e.uri)||void 0;console.error(`Unexpected resource ${e.uri}`)}get inMemoryResourcePrefix(){return this.apiVersion.gte(u.default.v270)?"^":""}toResource(e){if(e.startsWith(C.WALK_THROUGH_SNIPPET_SCHEME_COLON)||e.startsWith(p.untitled+":")){let t=s.Uri.parse(e);if(this.inMemoryResourcePrefix){const e=i.dirname(t.path),n=i.basename(t.path);n.startsWith(this.inMemoryResourcePrefix)&&(t=t.with({path:i.posix.join(e,n.slice(this.inMemoryResourcePrefix.length))}))}return t}return this.bufferSyncSupport.toResource(e)}getWorkspaceRootForResource(e){const t=s.workspace.workspaceFolders;if(t&&t.length&&(e.scheme===p.file||e.scheme===p.untitled)){for(const n of t.sort((e,t)=>e.uri.fsPath.length-t.uri.fsPath.length))if(e.fsPath.startsWith(n.uri.fsPath+i.sep))return n.uri.fsPath;return t[0].uri.fsPath}}execute(e,t,n,r){return this.executeImpl(e,t,{isAsync:!1,token:n,expectsResult:!0,lowPriority:r?r.lowPriority:void 0})}executeWithoutWaitingForResponse(e,t){this.executeImpl(e,t,{isAsync:!1,token:void 0,expectsResult:!1})}executeAsync(e,t,n){return this.executeImpl(e,t,{isAsync:!0,token:n,expectsResult:!0})}executeImpl(e,t,n){return this.bufferSyncSupport.beforeCommand(e),this.service().server.executeImpl(e,t,n)}interruptGetErr(e){return this.bufferSyncSupport.interuptGetErr(e)}dispatchEvent(e){switch(e.event){case"syntaxDiag":case"semanticDiag":case"suggestionDiag":this.loadingIndicator.reset();const t=e;t.body&&t.body.diagnostics&&this._onDiagnosticsReceived.fire({kind:function(e){switch(e.event){case"syntaxDiag":return 0;case"semanticDiag":return 1;case"suggestionDiag":return 2}throw new Error("Unknown dignostics kind")}(e),resource:this.toResource(t.body.file),diagnostics:t.body.diagnostics});break;case"configFileDiag":this._onConfigDiagnosticsReceived.fire(e);break;case"telemetry":{const t=e.body;this.dispatchTelemetryEvent(t);break}case"projectLanguageServiceState":{const t=e.body;1===this.serverState.type&&(this.serverState={...this.serverState,langaugeServiceEnabled:t.languageServiceEnabled}),this._onProjectLanguageServiceStateChanged.fire(t);break}case"projectsUpdatedInBackground":const n=e.body.openFiles.map(s.Uri.file);this.bufferSyncSupport.getErr(n);break;case"beginInstallTypes":this._onDidBeginInstallTypings.fire(e.body);break;case"endInstallTypes":this._onDidEndInstallTypings.fire(e.body);break;case"typesInstallerInitializationFailed":this._onTypesInstallerInitializationFailed.fire(e.body);break;case"surveyReady":this._onSurveyReady.fire(e.body);break;case"projectLoadingStart":this.loadingIndicator.startedLoadingProject(e.body.projectName);break;case"projectLoadingFinish":this.loadingIndicator.finishedLoadingProject(e.body.projectName)}}dispatchTelemetryEvent(e){const t=Object.create(null);switch(e.telemetryEventName){case"typingsInstalled":const n=e.payload;t.installedPackages=n.installedPackages,"boolean"==typeof n.installSuccess&&(t.installSuccess=n.installSuccess.toString()),"string"==typeof n.typingsInstallerVersion&&(t.typingsInstallerVersion=n.typingsInstallerVersion);break;default:const r=e.payload;r&&Object.keys(r).forEach(e=>{try{r.hasOwnProperty(e)&&(t[e]="string"==typeof r[e]?r[e]:JSON.stringify(r[e]))}catch(e){}})}"projectInfo"===e.telemetryEventName&&1===this.serverState.type&&(this.serverState={...this.serverState,tsserverVersion:t.version}),this.logTelemetry(e.telemetryEventName,t)}configurePlugin(e,t){this.apiVersion.gte(u.default.v314)&&this.executeWithoutWaitingForResponse("configurePlugin",{pluginName:e,configuration:t})}}t.default=C,C.WALK_THROUGH_SNIPPET_SCHEME_COLON=`${p.walkThroughSnippet}:`;class k extends h.Disposable{reset(){this._task&&(this._task.reject(),this._task=void 0)}startedLoadingProject(e){this.reset(),s.window.withProgress({location:s.ProgressLocation.Window,title:w(11,null)},()=>new Promise((t,n)=>{this._task={project:e,resolve:t,reject:n}}))}finishedLoadingProject(e){this._task&&this._task.project===e&&(this._task.resolve(),this._task=void 0)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(4),s=n(102),o=n(6),a=n(14),c=n(24),u=n(2);class l{constructor(e){this.args=e,this.type="close"}}class h{constructor(e){this.args=e,this.type="open"}}class p{constructor(e){this.args=e,this.type="change"}}class d{constructor(e){this.client=e,this._pending=new Map}open(e){this.supportsBatching?this.updatePending(e.file,t=>{t.set(e.file,new h(e))}):this.client.executeWithoutWaitingForResponse("open",e)}close(e){if(this.supportsBatching)this.updatePending(e,t=>{t.set(e,new l(e))});else{const t={file:e};this.client.executeWithoutWaitingForResponse("close",t)}}change(e,t){if(t.length)if(this.supportsBatching)this.updatePending(e,n=>{n.set(e,new p({fileName:e,textChanges:t.map(e=>({newText:e.text,start:u.Position.toLocation(e.range.start),end:u.Position.toLocation(e.range.end)})).reverse()}))});else for(const{range:n,text:r}of t){const t={insertString:r,...u.Range.toFormattingRequestArgs(e,n)};this.client.executeWithoutWaitingForResponse("change",t)}}beforeCommand(e){"updateOpen"!==e&&this.flush()}flush(){if(this.supportsBatching){if(this._pending.size>0){const e=[],t=[],n=[];for(const r of this._pending.values())switch(r.type){case"change":n.push(r.args);break;case"open":t.push(r.args);break;case"close":e.push(r.args)}this.client.executeWithoutWaitingForResponse("updateOpen",{changedFiles:n,closedFiles:e,openFiles:t}),this._pending.clear()}}else this._pending.clear()}get supportsBatching(){return this.client.apiVersion.gte(i.default.v340)&&r.workspace.getConfiguration("typescript",null).get("useBatchedBufferSync",!0)}updatePending(e,t){this._pending.has(e)&&this.flush(),t(this._pending)}}class f{constructor(e,t,n,r){this.document=e,this.filepath=t,this.client=n,this.synchronizer=r,this.state=1}open(){const e={file:this.filepath,fileContent:this.document.getText()},t=function(e){switch(e){case a.typescript:return"TS";case a.typescriptreact:return"TSX";case a.javascript:return"JS";case a.javascriptreact:return"JSX"}}(this.document.languageId);if(t&&(e.scriptKindName=t),this.client.apiVersion.gte(i.default.v230)&&(e.projectRootPath=this.client.getWorkspaceRootForResource(this.document.uri)),this.client.apiVersion.gte(i.default.v240)){const t=this.client.pluginManager.plugins.filter(e=>e.languages.indexOf(this.document.languageId)>=0);t.length&&(e.plugins=t.map(e=>e.name))}this.synchronizer.open(e),this.state=2}get resource(){return this.document.uri}get lineCount(){return this.document.lineCount}get kind(){switch(this.document.languageId){case a.javascript:case a.javascriptreact:return 2;case a.typescript:case a.typescriptreact:default:return 1}}close(){this.synchronizer.close(this.filepath),this.state=2}onContentChanged(e){2!==this.state&&console.error(`Unexpected buffer state: ${this.state}`),this.synchronizer.change(this.filepath,e)}}class g extends c.ResourceMap{getForPath(e){return this.get(r.Uri.file(e))}get allBuffers(){return this.values}}class m extends c.ResourceMap{getOrderedFileSet(){const e=Array.from(this.entries).sort((e,t)=>e.value-t.value).map(e=>e.resource),t=new c.ResourceMap;for(const n of e)t.set(n,void 0);return t}}class v{constructor(e,t,n,r){this.files=t,this._token=n,this._done=!1;const i={delay:0,files:Array.from(t.entries).map(t=>e.normalizedPath(t.resource)).filter(e=>!!e)};e.executeAsync("geterr",i,n.token).finally(()=>{this._done||(this._done=!0,r())})}static executeGetErrRequest(e,t,n){const i=new r.CancellationTokenSource;return new v(e,t,i,n)}cancel(){this._done||this._token.cancel(),this._token.dispose()}}t.default=class extends o.Disposable{constructor(e,t){super(),this._validateJavaScript=!0,this._validateTypeScript=!0,this.listening=!1,this._onDelete=this._register(new r.EventEmitter),this.onDelete=this._onDelete.event,this.client=e,this.modeIds=new Set(t),this.diagnosticDelayer=new s.Delayer(300);const n=e=>this.client.normalizedPath(e);this.syncedBuffers=new g(n),this.pendingDiagnostics=new m(n),this.synchronizer=new d(e),this.updateConfiguration(),r.workspace.onDidChangeConfiguration(this.updateConfiguration,this,this._disposables)}listen(){this.listening||(this.listening=!0,r.workspace.onDidOpenTextDocument(this.openTextDocument,this,this._disposables),r.workspace.onDidCloseTextDocument(this.onDidCloseTextDocument,this,this._disposables),r.workspace.onDidChangeTextDocument(this.onDidChangeTextDocument,this,this._disposables),r.workspace.textDocuments.forEach(this.openTextDocument,this))}handles(e){return this.syncedBuffers.has(e)}toResource(e){const t=this.syncedBuffers.getForPath(e);return t?t.resource:r.Uri.file(e)}reOpenDocuments(){for(const e of this.syncedBuffers.allBuffers)e.open()}openTextDocument(e){if(!this.modeIds.has(e.languageId))return;const t=e.uri,n=this.client.normalizedPath(t);if(!n)return;if(this.syncedBuffers.has(t))return;const r=new f(e,n,this.client,this.synchronizer);this.syncedBuffers.set(t,r),r.open(),this.requestDiagnostic(r)}closeResource(e){const t=this.syncedBuffers.get(e);t&&(this.pendingDiagnostics.delete(e),this.syncedBuffers.delete(e),t.close(),this._onDelete.fire(e),this.requestAllDiagnostics())}interuptGetErr(e){if(!this.pendingGetErr)return e();this.pendingGetErr.cancel(),this.pendingGetErr=void 0;const t=e();return this.triggerDiagnostics(),t}beforeCommand(e){this.synchronizer.beforeCommand(e)}onDidCloseTextDocument(e){this.closeResource(e.uri)}onDidChangeTextDocument(e){const t=this.syncedBuffers.get(e.document.uri);t&&(t.onContentChanged(e.contentChanges),!this.requestDiagnostic(t)&&this.pendingGetErr&&(this.pendingGetErr.cancel(),this.pendingGetErr=void 0,this.triggerDiagnostics()))}requestAllDiagnostics(){for(const e of this.syncedBuffers.allBuffers)this.shouldValidate(e)&&this.pendingDiagnostics.set(e.resource,Date.now());this.triggerDiagnostics()}getErr(e){const t=e.filter(e=>this.handles(e));if(t.length){for(const e of t)this.pendingDiagnostics.set(e,Date.now());this.triggerDiagnostics()}}triggerDiagnostics(e=200){this.diagnosticDelayer.trigger(()=>{this.sendPendingDiagnostics()},e)}requestDiagnostic(e){if(!this.shouldValidate(e))return!1;this.pendingDiagnostics.set(e.resource,Date.now());const t=Math.min(Math.max(Math.ceil(e.lineCount/20),300),800);return this.triggerDiagnostics(t),!0}hasPendingDiagnostics(e){return this.pendingDiagnostics.has(e)}sendPendingDiagnostics(){const e=this.pendingDiagnostics.getOrderedFileSet();if(this.pendingGetErr){this.pendingGetErr.cancel();for(const t of this.pendingGetErr.files.entries)e.set(t.resource,void 0)}for(const t of this.syncedBuffers.values)e.set(t.resource,void 0);if(e.size){const t=this.pendingGetErr=v.executeGetErrRequest(this.client,e,()=>{this.pendingGetErr===t&&(this.pendingGetErr=void 0)})}this.pendingDiagnostics.clear()}updateConfiguration(){const e=r.workspace.getConfiguration("javascript",null),t=r.workspace.getConfiguration("typescript",null);this._validateJavaScript=e.get("validate.enable",!0),this._validateTypeScript=t.get("validate.enable",!0)}shouldValidate(e){switch(e.kind){case 2:return this._validateJavaScript;case 1:default:return this._validateTypeScript}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Delayer=class{constructor(e){this.defaultDelay=e,this.timeout=null,this.completionPromise=null,this.onSuccess=null,this.task=null}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(e=>{this.onSuccess=e}).then(()=>{this.completionPromise=null,this.onSuccess=null;const e=this.task&&this.task();return this.task=null,e})),(t>=0||null===this.timeout)&&(this.timeout=setTimeout(()=>{this.timeout=null,this.onSuccess&&this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}cancelTimeout(){null!==this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(24),s=n(15),o=n(6);function a(e,t){return e===t||e.code===t.code&&e.message===t.message&&e.severity===t.severity&&e.source===t.source&&e.range.isEqual(t.range)&&s.equals(e.relatedInformation||s.empty,t.relatedInformation||s.empty,(e,t)=>e.message===t.message&&e.location.range.isEqual(t.location.range)&&e.location.uri.fsPath===t.location.uri.fsPath)&&s.equals(e.tags||s.empty,t.tags||s.empty)}class c{constructor(e,t){this.file=e,this.language=t,this._diagnostics=new Map}updateDiagnostics(e,t,n){e!==this.language&&(this._diagnostics.clear(),this.language=e);const r=this._diagnostics.get(t);return!s.equals(r||s.empty,n,a)&&(this._diagnostics.set(t,n),!0)}getDiagnostics(e){return e.getValidate(this.language)?[...this.get(0),...this.get(1),...this.getSuggestionDiagnostics(e)]:[]}getSuggestionDiagnostics(e){const t=e.getEnableSuggestions(this.language);return this.get(2).filter(e=>!!t||e.tags&&e.tags.includes(r.DiagnosticTag.Unnecessary))}get(e){return this._diagnostics.get(e)||[]}}class u{constructor(){this._languageSettings=new Map}getValidate(e){return this.get(e).validate}setValidate(e,t){return this.update(e,e=>({validate:t,enableSuggestions:e.enableSuggestions}))}getEnableSuggestions(e){return this.get(e).enableSuggestions}setEnableSuggestions(e,t){return this.update(e,e=>({validate:e.validate,enableSuggestions:t}))}get(e){return this._languageSettings.get(e)||u.defaultSettings}update(e,t){const n=this.get(e),r=t(n);return this._languageSettings.set(e,r),function(e,t){return e.validate===t.validate&&e.enableSuggestions&&e.enableSuggestions}(n,r)}}u.defaultSettings={validate:!0,enableSuggestions:!0};t.DiagnosticsManager=class extends o.Disposable{constructor(e){super(),this._diagnostics=new i.ResourceMap,this._settings=new u,this._pendingUpdates=new i.ResourceMap,this._updateDelay=50,this._currentDiagnostics=this._register(r.languages.createDiagnosticCollection(e))}dispose(){super.dispose();for(const e of this._pendingUpdates.values)clearTimeout(e);this._pendingUpdates.clear()}reInitialize(){this._currentDiagnostics.clear(),this._diagnostics.clear()}setValidate(e,t){this._settings.setValidate(e,t)&&this.rebuild()}setEnableSuggestions(e,t){this._settings.setEnableSuggestions(e,t)&&this.rebuild()}updateDiagnostics(e,t,n,r){let i=!1;const s=this._diagnostics.get(e);if(s)i=s.updateDiagnostics(t,n,r);else if(r.length){const s=new c(e,t);s.updateDiagnostics(t,n,r),this._diagnostics.set(e,s),i=!0}i&&this.scheduleDiagnosticsUpdate(e)}configFileDiagnosticsReceived(e,t){this._currentDiagnostics.set(e,t)}delete(e){this._currentDiagnostics.delete(e),this._diagnostics.delete(e)}getDiagnostics(e){return this._currentDiagnostics.get(e)||[]}scheduleDiagnosticsUpdate(e){this._pendingUpdates.has(e)||this._pendingUpdates.set(e,setTimeout(()=>this.updateCurrentDiagnostics(e),this._updateDelay))}updateCurrentDiagnostics(e){this._pendingUpdates.has(e)&&(clearTimeout(this._pendingUpdates.get(e)),this._pendingUpdates.delete(e));const t=this._diagnostics.get(e);this._currentDiagnostics.set(e,t?t.getDiagnostics(this._settings):[])}rebuild(){this._currentDiagnostics.clear();for(const e of this._diagnostics.values)this._currentDiagnostics.set(e.file,e.getDiagnostics(this._settings))}}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),s=n(3),o=n(11),a=s.loadMessageBundle(n(1).join(__dirname,"utils/logger.ts"));class c{get output(){return i.window.createOutputChannel(a(0,null))}data2String(e){return e instanceof Error?e.stack||e.message:!1===e.success&&e.message?e.message:e.toString()}info(e,t){this.logLevel("Info",e,t)}error(e,t){t&&"No content available."===t.message||this.logLevel("Error",e,t)}logLevel(e,t,n){this.output.appendLine(`[${e}  - ${(new Date).toLocaleTimeString()}] ${t}`),n&&this.output.appendLine(this.data2String(n))}}r([o.memoize],c.prototype,"output",null),t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(0),s=n(43);t.TypeScriptPluginPathsProvider=class{constructor(e){this.configuration=e}updateConfiguration(e){this.configuration=e}getPluginPaths(){const e=[];for(const t of this.configuration.tsServerPluginPaths)e.push(...this.resolvePluginPath(t));return e}resolvePluginPath(e){if(r.isAbsolute(e))return[e];const t=s.RelativeWorkspacePathResolver.asAbsoluteWorkspacePath(e);return void 0!==t?[t]:(i.workspace.workspaceFolders||[]).map(t=>r.join(t.uri.fsPath,e))}}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),s=n(107),o=n(11);class a{constructor(e){this.clientVersionDelegate=e,this._reporter=null}logTelemetry(e,t){const n=this.reporter;n&&(t||(t={}),t.version=this.clientVersionDelegate(),n.sendTelemetryEvent(e,t))}dispose(){this._reporter&&(this._reporter.dispose(),this._reporter=null)}get reporter(){return this.packageInfo&&this.packageInfo.aiKey?(this._reporter=new s.default(this.packageInfo.name,this.packageInfo.version,this.packageInfo.aiKey),this._reporter):null}get packageInfo(){const{packageJSON:e}=i.extensions.getExtension("vscode.typescript-language-features");return e?{name:e.name,version:e.version,aiKey:e.aiKey}:null}}r([o.memoize],a.prototype,"reporter",null),r([o.memoize],a.prototype,"packageInfo",null),t.VSCodeTelemetryReporter=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=!0;var r=n(5),i=n(17),s=n(1),o=n(0),a=n(108),c=function(){function e(e,t,n){var i=this;this.extensionId=e,this.extensionVersion=t,this.userOptIn=!1;var a=process.env.VSCODE_LOGS||"";a&&e&&"trace"===process.env.VSCODE_LOG_LEVEL&&(a=s.join(a,e+".txt"),this.logStream=r.createWriteStream(a,{flags:"a",encoding:"utf8",autoClose:!0})),this.updateUserOptIn(n),this.configListener=o.workspace.onDidChangeConfiguration(function(){return i.updateUserOptIn(n)})}return e.prototype.updateUserOptIn=function(t){var n=o.workspace.getConfiguration(e.TELEMETRY_CONFIG_ID);this.userOptIn!==n.get(e.TELEMETRY_CONFIG_ENABLED_ID,!0)&&(this.userOptIn=n.get(e.TELEMETRY_CONFIG_ENABLED_ID,!0),this.userOptIn?this.createAppInsightsClient(t):this.dispose())},e.prototype.createAppInsightsClient=function(e){a.defaultClient?(this.appInsightsClient=new a.TelemetryClient(e),this.appInsightsClient.channel.setUseDiskRetryCaching(!0)):(a.setup(e).setAutoCollectRequests(!1).setAutoCollectPerformance(!1).setAutoCollectExceptions(!1).setAutoCollectDependencies(!1).setAutoDependencyCorrelation(!1).setAutoCollectConsole(!1).setUseDiskRetryCaching(!0).start(),this.appInsightsClient=a.defaultClient),this.appInsightsClient.commonProperties=this.getCommonProperties(),o&&o.env&&(this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.userId]=o.env.machineId,this.appInsightsClient.context.tags[this.appInsightsClient.context.keys.sessionId]=o.env.sessionId),e&&0===e.indexOf("AIF-")&&(this.appInsightsClient.config.endpointUrl="https://vortex.data.microsoft.com/collect/v1")},e.prototype.getCommonProperties=function(){var e=Object.create(null);return e["common.os"]=i.platform(),e["common.platformversion"]=(i.release()||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),e["common.extname"]=this.extensionId,e["common.extversion"]=this.extensionVersion,o&&o.env&&(e["common.vscodemachineid"]=o.env.machineId,e["common.vscodesessionid"]=o.env.sessionId,e["common.vscodeversion"]=o.version),e},e.prototype.sendTelemetryEvent=function(e,t,n){this.userOptIn&&e&&this.appInsightsClient&&(this.appInsightsClient.trackEvent({name:this.extensionId+"/"+e,properties:t,measurements:n}),this.logStream&&this.logStream.write("telemetry/"+e+" "+JSON.stringify({properties:t,measurements:n})+"\n"))},e.prototype.dispose=function(){var e=this;this.configListener.dispose();var t=new Promise(function(t){if(!e.logStream)return t(void 0);e.logStream.on("finish",t),e.logStream.end()}),n=new Promise(function(t){e.appInsightsClient?e.appInsightsClient.flush({callback:function(){e.appInsightsClient=void 0,t(void 0)}}):t(void 0)});return Promise.all([n,t])},e.TELEMETRY_CONFIG_ID="telemetry",e.TELEMETRY_CONFIG_ENABLED_ID="enableTelemetry",e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(20),i=n(129),s=n(150),o=n(50),a=n(29),c=n(52),u=n(9);t.TelemetryClient=n(158),t.Contracts=n(10);var l,h,p,d,f,g=!0,m=!1,v=!0,y=!0,b=!0,_=!0,w=!0,S=!0,C=void 0,k=void 0,T=!1;function x(){return t.defaultClient?(T=!0,l.enable(g,m),h.enable(v),p.enable(y),d.useAutoCorrelation(S),d.enable(b),f.enable(_)):u.warn("Start cannot be called before setup"),E}t.setup=function(e){return t.defaultClient?u.info("The default client is already setup"):(t.defaultClient=new t.TelemetryClient(e),l=new i(t.defaultClient),h=new s(t.defaultClient),p=new o(t.defaultClient),d=new c(t.defaultClient),f=new a(t.defaultClient)),t.defaultClient&&t.defaultClient.channel&&t.defaultClient.channel.setUseDiskRetryCaching(w,C,k),E},t.start=x,t.getCorrelationContext=function(){return S?r.CorrelationContextManager.getCurrentContext():null},t.wrapWithCorrelationContext=function(e){return r.CorrelationContextManager.wrapCallback(e)};var E=function(){function e(){}return e.setAutoCollectConsole=function(t,n){return void 0===n&&(n=!1),g=t,m=n,T&&l.enable(t,n),e},e.setAutoCollectExceptions=function(t){return v=t,T&&h.enable(t),e},e.setAutoCollectPerformance=function(t){return y=t,T&&p.enable(t),e},e.setAutoCollectRequests=function(t){return b=t,T&&d.enable(t),e},e.setAutoCollectDependencies=function(t){return _=t,T&&f.enable(t),e},e.setAutoDependencyCorrelation=function(t){return S=t,T&&d.useAutoCorrelation(t),e},e.setUseDiskRetryCaching=function(n,r,i){return w=n,C=r,k=i,t.defaultClient&&t.defaultClient.channel&&t.defaultClient.channel.setUseDiskRetryCaching(n,r,i),e},e.setInternalLogging=function(t,n){return void 0===t&&(t=!1),void 0===n&&(n=!0),u.enableDebug=t,u.disableWarnings=!n,e},e.start=x,e}();t.Configuration=E,t.dispose=function(){t.defaultClient=null,T=!1,l&&l.dispose(),h&&h.dispose(),p&&p.dispose(),d&&d.dispose(),f&&f.dispose()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(110);t.bunyan=r;var i=n(113);t.console=i;var s=n(116);t.mongodbCore=s;var o=n(117);t.mongodb=o;var a=n(118);t.mysql=a;var c=n(121);t.pgPool=c;var u=n(122);t.pg=u;var l=n(123);t.redis=l;var h=n(124);t.winston=h,t.enable=function(){r.enable(),i.enable(),s.enable(),o.enable(),a.enable(),u.enable(),c.enable(),l.enable(),h.enable()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);t.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:function(e){var t=e.prototype._emit;return e.prototype._emit=function(e,n){var i=t.apply(this,arguments);if(!n){var s=i;s||(s=t.call(this,e,!0)),r.channel.publish("bunyan",{level:e.level,result:s})}return i},e}},t.enable=function(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}},function(e,t){var n;t=e.exports=U,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},t.SEMVER_SPEC_VERSION="2.0.0";var r=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,s=t.re=[],o=t.src=[],a=0,c=a++;o[c]="0|[1-9]\\d*";var u=a++;o[u]="[0-9]+";var l=a++;o[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var h=a++;o[h]="("+o[c]+")\\.("+o[c]+")\\.("+o[c]+")";var p=a++;o[p]="("+o[u]+")\\.("+o[u]+")\\.("+o[u]+")";var d=a++;o[d]="(?:"+o[c]+"|"+o[l]+")";var f=a++;o[f]="(?:"+o[u]+"|"+o[l]+")";var g=a++;o[g]="(?:-("+o[d]+"(?:\\."+o[d]+")*))";var m=a++;o[m]="(?:-?("+o[f]+"(?:\\."+o[f]+")*))";var v=a++;o[v]="[0-9A-Za-z-]+";var y=a++;o[y]="(?:\\+("+o[v]+"(?:\\."+o[v]+")*))";var b=a++,_="v?"+o[h]+o[g]+"?"+o[y]+"?";o[b]="^"+_+"$";var w="[v=\\s]*"+o[p]+o[m]+"?"+o[y]+"?",S=a++;o[S]="^"+w+"$";var C=a++;o[C]="((?:<|>)?=?)";var k=a++;o[k]=o[u]+"|x|X|\\*";var T=a++;o[T]=o[c]+"|x|X|\\*";var x=a++;o[x]="[v=\\s]*("+o[T]+")(?:\\.("+o[T]+")(?:\\.("+o[T]+")(?:"+o[g]+")?"+o[y]+"?)?)?";var E=a++;o[E]="[v=\\s]*("+o[k]+")(?:\\.("+o[k]+")(?:\\.("+o[k]+")(?:"+o[m]+")?"+o[y]+"?)?)?";var P=a++;o[P]="^"+o[C]+"\\s*"+o[x]+"$";var I=a++;o[I]="^"+o[C]+"\\s*"+o[E]+"$";var O=a++;o[O]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var A=a++;o[A]="(?:~>?)";var D=a++;o[D]="(\\s*)"+o[A]+"\\s+",s[D]=new RegExp(o[D],"g");var R=a++;o[R]="^"+o[A]+o[x]+"$";var j=a++;o[j]="^"+o[A]+o[E]+"$";var M=a++;o[M]="(?:\\^)";var F=a++;o[F]="(\\s*)"+o[M]+"\\s+",s[F]=new RegExp(o[F],"g");var L=a++;o[L]="^"+o[M]+o[x]+"$";var N=a++;o[N]="^"+o[M]+o[E]+"$";var q=a++;o[q]="^"+o[C]+"\\s*("+w+")$|^$";var V=a++;o[V]="^"+o[C]+"\\s*("+_+")$|^$";var K=a++;o[K]="(\\s*)"+o[C]+"\\s*("+w+"|"+o[x]+")",s[K]=new RegExp(o[K],"g");var z=a++;o[z]="^\\s*("+o[x]+")\\s+-\\s+("+o[x]+")\\s*$";var H=a++;o[H]="^\\s*("+o[E]+")\\s+-\\s+("+o[E]+")\\s*$";var B=a++;o[B]="(<|>)?=?\\s*\\*";for(var $=0;$<a;$++)n($,o[$]),s[$]||(s[$]=new RegExp(o[$]));function W(e,t){if(e instanceof U)return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t?s[S]:s[b]).test(e))return null;try{return new U(e,t)}catch(e){return null}}function U(e,t){if(e instanceof U){if(e.loose===t)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>r)throw new TypeError("version is longer than "+r+" characters");if(!(this instanceof U))return new U(e,t);n("SemVer",e,t),this.loose=t;var o=e.trim().match(t?s[S]:s[b]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}t.parse=W,t.valid=function(e,t){var n=W(e,t);return n?n.version:null},t.clean=function(e,t){var n=W(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null},t.SemVer=U,U.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},U.prototype.toString=function(){return this.version},U.prototype.compare=function(e){return n("SemVer.compare",this.version,this.loose,e),e instanceof U||(e=new U(e,this.loose)),this.compareMain(e)||this.comparePre(e)},U.prototype.compareMain=function(e){return e instanceof U||(e=new U(e,this.loose)),Z(this.major,e.major)||Z(this.minor,e.minor)||Z(this.patch,e.patch)},U.prototype.comparePre=function(e){if(e instanceof U||(e=new U(e,this.loose)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return Z(r,i)}while(++t)},U.prototype.inc=function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},t.inc=function(e,t,n,r){"string"==typeof n&&(r=n,n=void 0);try{return new U(e,n).inc(t,r).version}catch(e){return null}},t.diff=function(e,t){if(X(e,t))return null;var n=W(e),r=W(t);if(n.prerelease.length||r.prerelease.length){for(var i in n)if(("major"===i||"minor"===i||"patch"===i)&&n[i]!==r[i])return"pre"+i;return"prerelease"}for(var i in n)if(("major"===i||"minor"===i||"patch"===i)&&n[i]!==r[i])return i},t.compareIdentifiers=Z;var G=/^[0-9]+$/;function Z(e,t){var n=G.test(e),r=G.test(t);return n&&r&&(e=+e,t=+t),n&&!r?-1:r&&!n?1:e<t?-1:e>t?1:0}function J(e,t,n){return new U(e,n).compare(new U(t,n))}function Q(e,t,n){return J(e,t,n)>0}function Y(e,t,n){return J(e,t,n)<0}function X(e,t,n){return 0===J(e,t,n)}function ee(e,t,n){return 0!==J(e,t,n)}function te(e,t,n){return J(e,t,n)>=0}function ne(e,t,n){return J(e,t,n)<=0}function re(e,t,n,r){var i;switch(t){case"===":"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),i=e===n;break;case"!==":"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),i=e!==n;break;case"":case"=":case"==":i=X(e,n,r);break;case"!=":i=ee(e,n,r);break;case">":i=Q(e,n,r);break;case">=":i=te(e,n,r);break;case"<":i=Y(e,n,r);break;case"<=":i=ne(e,n,r);break;default:throw new TypeError("Invalid operator: "+t)}return i}function ie(e,t){if(e instanceof ie){if(e.loose===t)return e;e=e.value}if(!(this instanceof ie))return new ie(e,t);n("comparator",e,t),this.loose=t,this.parse(e),this.semver===se?this.value="":this.value=this.operator+this.semver.version,n("comp",this)}t.rcompareIdentifiers=function(e,t){return Z(t,e)},t.major=function(e,t){return new U(e,t).major},t.minor=function(e,t){return new U(e,t).minor},t.patch=function(e,t){return new U(e,t).patch},t.compare=J,t.compareLoose=function(e,t){return J(e,t,!0)},t.rcompare=function(e,t,n){return J(t,e,n)},t.sort=function(e,n){return e.sort(function(e,r){return t.compare(e,r,n)})},t.rsort=function(e,n){return e.sort(function(e,r){return t.rcompare(e,r,n)})},t.gt=Q,t.lt=Y,t.eq=X,t.neq=ee,t.gte=te,t.lte=ne,t.cmp=re,t.Comparator=ie;var se={};function oe(e,t){if(e instanceof oe)return e.loose===t?e:new oe(e.raw,t);if(e instanceof ie)return new oe(e.value,t);if(!(this instanceof oe))return new oe(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function ae(e){return!e||"x"===e.toLowerCase()||"*"===e}function ce(e,t,n,r,i,s,o,a,c,u,l,h,p){return((t=ae(n)?"":ae(r)?">="+n+".0.0":ae(i)?">="+n+"."+r+".0":">="+t)+" "+(a=ae(c)?"":ae(u)?"<"+(+c+1)+".0.0":ae(l)?"<"+c+"."+(+u+1)+".0":h?"<="+c+"."+u+"."+l+"-"+h:"<="+a)).trim()}function ue(e,t){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length){for(r=0;r<e.length;r++)if(n(e[r].semver),e[r].semver!==se&&e[r].semver.prerelease.length>0){var i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}function le(e,t,n){try{t=new oe(t,n)}catch(e){return!1}return t.test(e)}function he(e,t,n,r){var i,s,o,a,c;switch(e=new U(e,r),t=new oe(t,r),n){case">":i=Q,s=ne,o=Y,a=">",c=">=";break;case"<":i=Y,s=te,o=Q,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(le(e,t,r))return!1;for(var u=0;u<t.set.length;++u){var l=null,h=null;if(t.set[u].forEach(function(e){e.semver===se&&(e=new ie(">=0.0.0")),l=l||e,h=h||e,i(e.semver,l.semver,r)?l=e:o(e.semver,h.semver,r)&&(h=e)}),l.operator===a||l.operator===c)return!1;if((!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0}ie.prototype.parse=function(e){var t=this.loose?s[q]:s[V],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1],"="===this.operator&&(this.operator=""),n[2]?this.semver=new U(n[2],this.loose):this.semver=se},ie.prototype.toString=function(){return this.value},ie.prototype.test=function(e){return n("Comparator.test",e,this.loose),this.semver===se||("string"==typeof e&&(e=new U(e,this.loose)),re(e,this.operator,this.semver,this.loose))},ie.prototype.intersects=function(e,t){if(!(e instanceof ie))throw new TypeError("a Comparator is required");var n;if(""===this.operator)return n=new oe(e.value,t),le(this.value,n,t);if(""===e.operator)return n=new oe(this.value,t),le(e.semver,n,t);var r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=re(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),c=re(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||s&&o||a||c},t.Range=oe,oe.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},oe.prototype.toString=function(){return this.range},oe.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),n("range",e,t);var r=t?s[H]:s[z];e=e.replace(r,ce),n("hyphen replace",e),e=e.replace(s[K],"$1$2$3"),n("comparator trim",e,s[K]),e=(e=(e=e.replace(s[D],"$1~")).replace(s[F],"$1^")).split(/\s+/).join(" ");var i=t?s[q]:s[V],o=e.split(" ").map(function(e){return function(e,t){return n("comp",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){n("caret",e,t);var r=t?s[N]:s[L];return e.replace(r,function(t,r,i,s,o){var a;return n("caret",e,t,r,i,s,o),ae(r)?a="":ae(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":ae(s)?a="0"===r?">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":">="+r+"."+i+".0 <"+(+r+1)+".0.0":o?(n("replaceCaret pr",o),"-"!==o.charAt(0)&&(o="-"+o),a="0"===r?"0"===i?">="+r+"."+i+"."+s+o+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+o+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+o+" <"+(+r+1)+".0.0"):(n("no pr"),a="0"===r?"0"===i?">="+r+"."+i+"."+s+" <"+r+"."+i+"."+(+s+1):">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0":">="+r+"."+i+"."+s+" <"+(+r+1)+".0.0"),n("caret return",a),a})}(e,t)}).join(" ")}(e,t),n("caret",e),e=function(e,t){return e.trim().split(/\s+/).map(function(e){return function(e,t){var r=t?s[j]:s[R];return e.replace(r,function(t,r,i,s,o){var a;return n("tilde",e,t,r,i,s,o),ae(r)?a="":ae(i)?a=">="+r+".0.0 <"+(+r+1)+".0.0":ae(s)?a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0":o?(n("replaceTilde pr",o),"-"!==o.charAt(0)&&(o="-"+o),a=">="+r+"."+i+"."+s+o+" <"+r+"."+(+i+1)+".0"):a=">="+r+"."+i+"."+s+" <"+r+"."+(+i+1)+".0",n("tilde return",a),a})}(e,t)}).join(" ")}(e,t),n("tildes",e),e=function(e,t){return n("replaceXRanges",e,t),e.split(/\s+/).map(function(e){return function(e,t){e=e.trim();var r=t?s[I]:s[P];return e.replace(r,function(t,r,i,s,o,a){n("xRange",e,t,r,i,s,o,a);var c=ae(i),u=c||ae(s),l=u||ae(o),h=l;return"="===r&&h&&(r=""),c?t=">"===r||"<"===r?"<0.0.0":"*":r&&h?(u&&(s=0),l&&(o=0),">"===r?(r=">=",u?(i=+i+1,s=0,o=0):l&&(s=+s+1,o=0)):"<="===r&&(r="<",u?i=+i+1:s=+s+1),t=r+i+"."+s+"."+o):u?t=">="+i+".0.0 <"+(+i+1)+".0.0":l&&(t=">="+i+"."+s+".0 <"+i+"."+(+s+1)+".0"),n("xRange return",t),t})}(e,t)}).join(" ")}(e,t),n("xrange",e),e=function(e,t){return n("replaceStars",e,t),e.trim().replace(s[B],"")}(e,t),n("stars",e),e}(e,t)}).join(" ").split(/\s+/);return this.loose&&(o=o.filter(function(e){return!!e.match(i)})),o=o.map(function(e){return new ie(e,t)})},oe.prototype.intersects=function(e,t){if(!(e instanceof oe))throw new TypeError("a Range is required");return this.set.some(function(n){return n.every(function(n){return e.set.some(function(e){return e.every(function(e){return n.intersects(e,t)})})})})},t.toComparators=function(e,t){return new oe(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})},oe.prototype.test=function(e){if(!e)return!1;"string"==typeof e&&(e=new U(e,this.loose));for(var t=0;t<this.set.length;t++)if(ue(this.set[t],e))return!0;return!1},t.satisfies=le,t.maxSatisfying=function(e,t,n){var r=null,i=null;try{var s=new oe(t,n)}catch(e){return null}return e.forEach(function(e){s.test(e)&&(r&&-1!==i.compare(e)||(i=new U(r=e,n)))}),r},t.minSatisfying=function(e,t,n){var r=null,i=null;try{var s=new oe(t,n)}catch(e){return null}return e.forEach(function(e){s.test(e)&&(r&&1!==i.compare(e)||(i=new U(r=e,n)))}),r},t.validRange=function(e,t){try{return new oe(e,t).range||"*"}catch(e){return null}},t.ltr=function(e,t,n){return he(e,t,"<",n)},t.gtr=function(e,t,n){return he(e,t,">",n)},t.outside=he,t.prerelease=function(e,t){var n=W(e,t);return n&&n.prerelease.length?n.prerelease:null},t.intersects=function(e,t,n){return e=new oe(e,n),t=new oe(t,n),e.intersects(t)},t.coerce=function(e){if(e instanceof U)return e;if("string"!=typeof e)return null;var t=e.match(s[O]);return null==t?null:W((t[1]||"0")+"."+(t[2]||"0")+"."+(t[3]||"0"))}},function(e){e.exports={name:"diagnostic-channel",version:"0.2.0",main:"./dist/src/channel.js",types:"./dist/src/channel.d.ts",scripts:{build:"tsc",lint:"tslint -c tslint.json -p tsconfig.json",clean:"rimraf ./dist",test:"mocha ./dist/tests/**/*.js"},homepage:"https://github.com/Microsoft/node-diagnostic-channel",bugs:{url:"https://github.com/Microsoft/node-diagnostic-channel/issues"},repository:{type:"git",url:"https://github.com/Microsoft/node-diagnostic-channel.git"},description:"Provides a context-saving pub/sub channel to connect diagnostic event publishers and subscribers",dependencies:{semver:"^5.3.0"},devDependencies:{"@types/mocha":"^2.2.40","@types/node":"^7.0.12",mocha:"^3.2.0",rimraf:"^2.6.1",tslint:"^5.0.0",typescript:"^2.2.1"},files:["dist/src/**/*.d.ts","dist/src/**/*.js","LICENSE","README.md","package.json"],license:"MIT"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=n(114);t.console={versionSpecifier:">= 4.0.0",patch:function(e){var t=new i.Writable,n=new i.Writable;t.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t}),!0},n.write=function(e){if(!e)return!0;var t=e.toString();return r.channel.publish("console",{message:t,stderr:!0}),!0};for(var s=new e.Console(t,n),o=function(t){var n=e[t];n&&(e[t]=function(){if(s[t])try{s[t].apply(s,arguments)}catch(e){}return n.apply(e,arguments)})},a=0,c=["log","info","warn","error","dir","time","timeEnd","trace","assert"];a<c.length;a++)o(c[a]);return e}},t.enable=function(){r.channel.registerMonkeyPatch("console",t.console),n(115)}},function(e,t){e.exports=require("stream")},function(e,t){e.exports=require("console")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);t.mongoCore2={versionSpecifier:">= 2.0.0 < 2.2.0",patch:function(e){var t=e.Server.prototype.connect;return e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.pool.write;this.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=r.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var i=this.s.pool.logout;return this.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=r.channel.bindToContext(arguments[1])),i.apply(this,arguments)},e},e}},t.enable=function(){r.channel.registerMonkeyPatch("mongodb-core",t.mongoCore2)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);t.mongo2={versionSpecifier:">= 2.0.0 <= 2.2.x",patch:function(e){var t=e.instrument({operationIdGenerator:{next:function(){return r.channel.bindToContext(function(e){return e()})}}}),n={};return t.on("started",function(e){n[e.requestId]||(n[e.requestId]=e)}),t.on("succeeded",function(e){var t=n[e.requestId];t&&delete n[e.requestId],e.operationId(function(){return r.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})}),t.on("failed",function(e){var t=n[e.requestId];t&&delete n[e.requestId],e.operationId(function(){return r.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})}),e}},t.enable=function(){r.channel.registerMonkeyPatch("mongodb",t.mongo2)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=n(1);t.mysql={versionSpecifier:">= 2.0.0 <= 2.14.x",patch:function(e,t){var s=function(e,t){return function(t,n){var i=e[t];i&&(e[t]=function(){for(var e=arguments.length-1,t=arguments.length-1;t>=0;--t){if("function"==typeof arguments[t]){e=t;break}if(void 0!==arguments[t])break}var s=arguments[e],o={result:null,startTime:null};"function"==typeof s&&(n?(o.startTime=process.hrtime(),arguments[e]=r.channel.bindToContext(n(o,s))):arguments[e]=r.channel.bindToContext(s));var a=i.apply(this,arguments);return o.result=a,a})}},o=function(e,t){return s(e.prototype)},a=n(119)(i.dirname(t)+"/lib/Connection");["connect","changeUser","ping","statistics","end"].forEach(function(e){return o(a)(e)}),s(a)("createQuery",function(e,t){return function(n){var i=process.hrtime(e.startTime),s=1e3*i[0]+i[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:s}),t.apply(this,arguments)}});var c=n(120)(i.dirname(t)+"/lib/Pool");return["_enqueueCallback"].forEach(function(e){return o(c)(e)}),e}},t.enable=function(){r.channel.registerMonkeyPatch("mysql",t.mysql)}},function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id=119},function(e,t){function n(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id=120},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);t.postgresPool1={versionSpecifier:"1.x",patch:function(e){var t=e.prototype.connect;return e.prototype.connect=function(e){e&&(arguments[0]=r.channel.bindToContext(e)),t.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=n(28);t.postgres6={versionSpecifier:"6.x",patch:function(e,t){var n=e.Client.prototype.query,s="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,o){var a,c={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0},u=process.hrtime();function l(e){e&&e[s]&&(e=e[s]);var t=r.channel.bindToContext(function(t,n){var s=process.hrtime(u);if(c.result=n&&{rowCount:n.rowCount,command:n.command},c.error=t,c.duration=Math.ceil(1e3*s[0]+s[1]/1e6),r.channel.publish("postgres",c),t){if(e)return e.apply(this,arguments);a&&a instanceof i.EventEmitter&&a.emit("error",t)}else e&&e.apply(this,arguments)});try{return Object.defineProperty(t,s,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(c.query.preparable={text:e,args:t},o=l(o)):(c.query.text=e,o?o=l(o):t=l(t)):("string"==typeof e.name?c.query.plan=e.name:e.values instanceof Array?c.query.preparable={text:e.text,args:e.values}:c.query.text=e.text,o?o=l(o):t?t=l(t):e.callback=l(e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=o,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg",t.postgres6)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);t.redis={versionSpecifier:">= 2.0.0 < 3.0.0",patch:function(e){var t=e.RedisClient.prototype.internal_send_command;return e.RedisClient.prototype.internal_send_command=function(e){if(e){var n=e.callback;if(!n||!n.pubsubBound){var i=this.address,s=process.hrtime();e.callback=r.channel.bindToContext(function(t,o){var a=process.hrtime(s),c=1e3*a[0]+a[1]/1e6|0;r.channel.publish("redis",{duration:c,address:i,commandObj:e,err:t,result:o}),"function"==typeof n&&n.apply(this,arguments)}),e.callback.pubsubBound=!0}}return t.call(this,e)},e}},t.enable=function(){r.channel.registerMonkeyPatch("redis",t.redis)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7);t.winston={versionSpecifier:"2.x",patch:function(e){var t,n=e.Logger.prototype.log,i=function(n,i,s){var o;return o=t===e.config.npm.levels?"npm":t===e.config.syslog.levels?"syslog":"unknown",r.channel.publish("winston",{level:n,message:i,meta:s,levelKind:o}),i};return e.Logger.prototype.log=function(){return t=this.levels,this.filters&&0!==this.filters.length?this.filters[this.filters.length-1]!==i&&(this.filters=this.filters.filter(function(e){return e!==i}),this.filters.push(i)):this.filters=[i],n.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("winston",t.winston)}},function(e,t,n){
  /**
  * @license
  * Copyright Google Inc. All Rights Reserved.
  *
  * Use of this source code is governed by an MIT-style license that can be
  * found in the LICENSE file at https://angular.io/license
  */
  !function(e,t){t()}(0,function(){"use strict";
  /**
   * @license
   * Copyright Google Inc. All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   */!function(e){if(e.Zone)throw new Error("Zone already loaded.");var t=function(){function t(e,t){this._properties=null,this._parent=e,this._name=t?t.name||"unnamed":"<root>",this._properties=t&&t.properties||{},this._zoneDelegate=new n(this,this._parent&&this._parent._zoneDelegate,t)}return t.assertZonePatched=function(){if(e.Promise!==D)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(t,"current",{get:function(){return u.zone},enumerable:!0,configurable:!0}),Object.defineProperty(t,"currentTask",{get:function(){return l},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var t=this.getZoneWith(e);if(t)return t._properties[e]},t.prototype.getZoneWith=function(e){for(var t=this;t;){if(t._properties.hasOwnProperty(e))return t;t=t._parent}return null},t.prototype.fork=function(e){if(!e)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,e)},t.prototype.wrap=function(e,t){if("function"!=typeof e)throw new Error("Expecting function got: "+e);var n=this._zoneDelegate.intercept(this,e,t),r=this;return function(){return r.runGuarded(n,this,arguments,t)}},t.prototype.run=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),u=new i(u,this);try{return this._zoneDelegate.invoke(this,e,t,n,r)}finally{u=u.parent}},t.prototype.runGuarded=function(e,t,n,r){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),u=new i(u,this);try{try{return this._zoneDelegate.invoke(this,e,t,n,r)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{u=u.parent}},t.prototype.runTask=function(e,t,n){if(e.runCount++,e.zone!=this)throw new Error("A task can only be run in the zone which created it! (Creation: "+e.zone.name+"; Execution: "+this.name+")");var r=l;l=e,u=new i(u,this);try{"macroTask"==e.type&&e.data&&!e.data.isPeriodic&&(e.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,e,t,n)}catch(e){if(this._zoneDelegate.handleError(this,e))throw e}}finally{u=u.parent,l=r}},t.prototype.scheduleMicroTask=function(e,t,n,i){return this._zoneDelegate.scheduleTask(this,new r("microTask",this,e,t,n,i,null))},t.prototype.scheduleMacroTask=function(e,t,n,i,s){return this._zoneDelegate.scheduleTask(this,new r("macroTask",this,e,t,n,i,s))},t.prototype.scheduleEventTask=function(e,t,n,i,s){return this._zoneDelegate.scheduleTask(this,new r("eventTask",this,e,t,n,i,s))},t.prototype.cancelTask=function(e){var t=this._zoneDelegate.cancelTask(this,e);return e.runCount=-1,e.cancelFn=null,t},t}();t.__symbol__=s;var n=function(){function e(e,t,n){this._taskCounts={microTask:0,macroTask:0,eventTask:0},this.zone=e,this._parentDelegate=t,this._forkZS=n&&(n&&n.onFork?n:t._forkZS),this._forkDlgt=n&&(n.onFork?t:t._forkDlgt),this._forkCurrZone=n&&(n.onFork?this.zone:t.zone),this._interceptZS=n&&(n.onIntercept?n:t._interceptZS),this._interceptDlgt=n&&(n.onIntercept?t:t._interceptDlgt),this._interceptCurrZone=n&&(n.onIntercept?this.zone:t.zone),this._invokeZS=n&&(n.onInvoke?n:t._invokeZS),this._invokeDlgt=n&&(n.onInvoke?t:t._invokeDlgt),this._invokeCurrZone=n&&(n.onInvoke?this.zone:t.zone),this._handleErrorZS=n&&(n.onHandleError?n:t._handleErrorZS),this._handleErrorDlgt=n&&(n.onHandleError?t:t._handleErrorDlgt),this._handleErrorCurrZone=n&&(n.onHandleError?this.zone:t.zone),this._scheduleTaskZS=n&&(n.onScheduleTask?n:t._scheduleTaskZS),this._scheduleTaskDlgt=n&&(n.onScheduleTask?t:t._scheduleTaskDlgt),this._scheduleTaskCurrZone=n&&(n.onScheduleTask?this.zone:t.zone),this._invokeTaskZS=n&&(n.onInvokeTask?n:t._invokeTaskZS),this._invokeTaskDlgt=n&&(n.onInvokeTask?t:t._invokeTaskDlgt),this._invokeTaskCurrZone=n&&(n.onInvokeTask?this.zone:t.zone),this._cancelTaskZS=n&&(n.onCancelTask?n:t._cancelTaskZS),this._cancelTaskDlgt=n&&(n.onCancelTask?t:t._cancelTaskDlgt),this._cancelTaskCurrZone=n&&(n.onCancelTask?this.zone:t.zone),this._hasTaskZS=n&&(n.onHasTask?n:t._hasTaskZS),this._hasTaskDlgt=n&&(n.onHasTask?t:t._hasTaskDlgt),this._hasTaskCurrZone=n&&(n.onHasTask?this.zone:t.zone)}return e.prototype.fork=function(e,n){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,e,n):new t(e,n)},e.prototype.intercept=function(e,t,n){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,e,t,n):t},e.prototype.invoke=function(e,t,n,r,i){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,e,t,n,r,i):t.apply(n,r)},e.prototype.handleError=function(e,t){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,e,t)},e.prototype.scheduleTask=function(e,t){try{if(this._scheduleTaskZS)return this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,e,t);if(t.scheduleFn)t.scheduleFn(t);else{if("microTask"!=t.type)throw new Error("Task is missing scheduleFn.");!function(e){g(),h.push(e)}(t)}return t}finally{e==this.zone&&this._updateTaskCount(t.type,1)}},e.prototype.invokeTask=function(e,t,n,r){try{return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,e,t,n,r):t.callback.apply(n,r)}finally{e!=this.zone||"eventTask"==t.type||t.data&&t.data.isPeriodic||this._updateTaskCount(t.type,-1)}},e.prototype.cancelTask=function(e,t){var n;if(this._cancelTaskZS)n=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,e,t);else{if(!t.cancelFn)throw new Error("Task does not support cancellation, or is already canceled.");n=t.cancelFn(t)}return e==this.zone&&this._updateTaskCount(t.type,-1),n},e.prototype.hasTask=function(e,t){return this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,e,t)},e.prototype._updateTaskCount=function(e,t){var n=this._taskCounts,r=n[e],i=n[e]=r+t;if(i<0)throw new Error("More tasks executed then were scheduled.");if(0==r||0==i){var s={microTask:n.microTask>0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:e};try{this.hasTask(this.zone,s)}finally{this._parentDelegate&&this._parentDelegate._updateTaskCount(e,t)}}},e}(),r=function(){function e(e,t,n,r,i,s,o){this.runCount=0,this.type=e,this.zone=t,this.source=n,this.data=i,this.scheduleFn=s,this.cancelFn=o,this.callback=r;var a=this;this.invoke=function(){f++;try{return t.runTask(a,this,arguments)}finally{1==f&&v(),f--}}}return e.prototype.toString=function(){return this.data&&void 0!==this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},e.prototype.toJSON=function(){return{type:this.type,source:this.source,data:this.data,zone:this.zone.name,invoke:this.invoke,scheduleFn:this.scheduleFn,cancelFn:this.cancelFn,runCount:this.runCount,callback:this.callback}},e}(),i=function(){return function(e,t){this.parent=e,this.zone=t}}();function s(e){return"__zone_symbol__"+e}var o=s("setTimeout"),a=s("Promise"),c=s("then"),u=new i(null,new t(null,null)),l=null,h=[],p=!1,d=[],f=0;function g(){0===f&&0===h.length&&(e[a]?e[a].resolve(0)[c](v):e[o](v,0))}function m(e){var t=e&&e.rejection;t&&console.error("Unhandled Promise rejection:",t instanceof Error?t.message:t,"; Zone:",e.zone.name,"; Task:",e.task&&e.task.source,"; Value:",t,t instanceof Error?t.stack:void 0),console.error(e)}function v(){if(!p){for(p=!0;h.length;){var e=h;h=[];for(var t=0;t<e.length;t++){var n=e[t];try{n.zone.runTask(n,null,null)}catch(e){m(e)}}}for(;d.length;)for(var r=function(){var e=d.shift();try{e.zone.runGuarded(function(){throw e})}catch(e){m(e)}};d.length;)r();p=!1}}function y(e){return e&&e.then}function b(e){return e}function _(e){return D.reject(e)}var w=s("state"),S=s("value"),C="Promise.then",k=null,T=!0,x=!1,E=0;function P(e,t){return function(n){I(e,t,n)}}function I(e,n,r){if(e[w]===k)if(r instanceof D&&r.hasOwnProperty(w)&&r.hasOwnProperty(S)&&r[w]!==k)O(r),I(e,r[w],r[S]);else if(y(r))r.then(P(e,n),P(e,!1));else{e[w]=n;var i=e[S];e[S]=r;for(var s=0;s<i.length;)A(e,i[s++],i[s++],i[s++],i[s++]);if(0==i.length&&n==x){e[w]=E;try{throw new Error("Uncaught (in promise): "+r+(r&&r.stack?"\n"+r.stack:""))}catch(n){var o=n;o.rejection=r,o.promise=e,o.zone=t.current,o.task=t.currentTask,d.push(o),g()}}}return e}function O(e){if(e[w]===E){e[w]=x;for(var t=0;t<d.length;t++)if(e===d[t].promise){d.splice(t,1);break}}}function A(e,t,n,r,i){O(e);var s=e[w]?r||b:i||_;t.scheduleMicroTask(C,function(){try{I(n,!0,t.run(s,null,[e[S]]))}catch(e){I(n,!1,e)}})}var D=function(){function e(t){if(!(this instanceof e))throw new Error("Must be an instanceof Promise.");this[w]=k,this[S]=[];try{t&&t(P(this,T),P(this,x))}catch(e){I(this,!1,e)}}return e.toString=function(){return"function ZoneAwarePromise() { [native code] }"},e.resolve=function(e){return I(new this(null),T,e)},e.reject=function(e){return I(new this(null),x,e)},e.race=function(e){var t,n,r=new this(function(e,r){var i;t=(i=[e,r])[0],n=i[1]});function i(e){r&&(r=t(e))}function s(e){r&&(r=n(e))}for(var o=0,a=e;o<a.length;o++){var c=a[o];y(c)||(c=this.resolve(c)),c.then(i,s)}return r},e.all=function(e){for(var t,n,r=new this(function(e,r){t=e,n=r}),i=0,s=[],o=0,a=e;o<a.length;o++){var c=a[o];y(c)||(c=this.resolve(c)),c.then(function(e){return function(n){s[e]=n,--i||t(s)}}(i),n),i++}return i||t(s),r},e.prototype.then=function(e,n){var r=new this.constructor(null),i=t.current;return this[w]==k?this[S].push(i,r,e,n):A(this,i,r,e,n),r},e.prototype.catch=function(e){return this.then(null,e)},e}();D.resolve=D.resolve,D.reject=D.reject,D.race=D.race,D.all=D.all;var R,j=e[s("Promise")]=e.Promise;function M(e){var t=e.prototype,n=t[s("then")]=t.then;t.then=function(e,t){var r=this;return new D(function(e,t){n.call(r,e,t)}).then(e,t)}}if(e.Promise=D,j&&(M(j),void 0!==e.fetch)){var F=void 0;try{F=e.fetch()}catch(t){F=e.fetch("about:blank")}F.then(function(){return null},function(){return null}),F.constructor!=j&&F.constructor!=D&&M(F.constructor)}Promise[t.__symbol__("uncaughtPromiseErrors")]=d,function(e){e[e.blackList=0]="blackList",e[e.transition=1]="transition"}(R||(R={}));var L,N=e[s("Error")]=e.Error,q={};e.Error=$;var V="stackRewrite",K=function(e,t){if(!e[t]){var n=s(t);e[t]={configurable:!0,enumerable:!0,get:function(){if(!this[n]){var e=this[s("error")];e&&(this[n]=e[t])}return this[n]},set:function(e){this[n]=e}}}},z=function(e,t){e[t]||(e[t]={configurable:!0,enumerable:!0,writable:!0,value:function(){var e=this[s("error")],n=e&&e[t]||this[t];if(n)return n.apply(e,arguments)}})},H=function(){for(var e=Object.create(null),t=new N,n=Object.getOwnPropertyNames(t),r=0;r<n.length;r++){var i=n[r];Object.prototype.hasOwnProperty.call(t,i)&&K(e,i)}var s=N.prototype;if(s){var o=Object.getOwnPropertyNames(s);for(r=0;r<o.length;r++)"constructor"!==(i=o[r])&&"toString"!==i&&"toSource"!==i&&K(e,i)}return K(e,"originalStack"),K(e,"zoneAwareStack"),z(e,"toString"),z(e,"toSource"),e}(),B=function(e){if(e===$.prototype)return H;var t=Object.create(null),n=Object.getOwnPropertyNames(H),r=Object.getOwnPropertyNames(e);return n.forEach(function(e){0===r.filter(function(t){return t===e}).length&&(t[e]=H[e])}),t};function $(){if(!(this instanceof $))return $.apply(Object.create($.prototype),arguments);var e=N.apply(this,arguments);if(this[s("error")]=e,e.originalStack=e.stack,$[V]&&e.originalStack){for(var t=e.originalStack.split("\n"),n=u,r=0;t[r]!==L&&r<t.length;)r++;for(;r<t.length&&n;r++){var i=t[r];if(i.trim()){var o=q.hasOwnProperty(i)&&q[i];o===R.blackList?(t.splice(r,1),r--):o===R.transition?n.parent?(t[r]+=" ["+n.parent.zone.name+" => "+n.zone.name+"]",n=n.parent):n=null:t[r]+=" ["+n.zone.name+"]"}}e.stack=e.zoneAwareStack=t.join("\n")}return Object.defineProperties(this,B(Object.getPrototypeOf(this))),this}$.prototype=N.prototype,$[t.__symbol__("blacklistedStackFrames")]=q,$[V]=!1,N.hasOwnProperty("stackTraceLimit")&&(N.stackTraceLimit=Math.max(N.stackTraceLimit,15),Object.defineProperty($,"stackTraceLimit",{get:function(){return N.stackTraceLimit},set:function(e){return N.stackTraceLimit=e}})),N.hasOwnProperty("captureStackTrace")&&Object.defineProperty($,"captureStackTrace",{value:function(e,t){N.captureStackTrace(e,t)}}),Object.defineProperty($,"prepareStackTrace",{get:function(){return N.prepareStackTrace},set:function(e){return N.prepareStackTrace=e&&"function"==typeof e?function(t,n){if(n)for(var r=0;r<n.length;r++){if("zoneCaptureStackTrace"===n[r].getFunctionName()){n.splice(r,1);break}}return e.apply(this,[t,n])}:e}});var W=t.current.fork({name:"detect",onInvoke:function(e,t,n,r,i,s,o){return e.invoke(n,r,i,s,o)},onHandleError:function(e,t,n,r){if(r.originalStack&&Error===$)for(var i=r.originalStack.split(/\n/),s=!1,o=!1,a=!1;i.length;){var c=i.shift();if(/:\d+:\d+/.test(c)){var u=c.split("(")[0].split("@")[0],l=R.transition;if(-1!==u.indexOf("ZoneAwareError")&&(L=c),-1!==u.indexOf("runGuarded")?o=!0:-1!==u.indexOf("runTask")?a=!0:-1!==u.indexOf("run")?s=!0:l=R.blackList,q[c]=l,s&&o&&a){$[V]=!0;break}}}return!1}});W.runTask(W.scheduleMacroTask("detect",function(){W.run(function(){W.runGuarded(function(){throw new Error("blacklistStackFrames")})})},null,function(){return null},null)),e.Zone=t}("object"==typeof window&&window||"object"==typeof self&&self||global);
  /**
   * @license
   * Copyright Google Inc. All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   */var e=function(e){return"__zone_symbol__"+e},t="object"==typeof window&&window||"object"==typeof self&&self||global;!("nw"in t)&&"undefined"!=typeof process&&{}.toString.call(process);var r=e("eventTasks");function i(e,t,n,i,s){var o=e[r];if(o)for(var a=0;a<o.length;a++){var c=o[a],u=c.data,l=u.handler;if((u.handler===t||l.listener===t)&&u.useCapturing===i&&u.eventName===n)return s&&o.splice(a,1),c}return null}var s=function(e,n){return{useCapturing:n[2],eventName:n[0],handler:n[1],target:e||t,name:n[0],invokeAddFunc:function(e,t){return t&&t.invoke?this.target[e](this.eventName,t.invoke,this.useCapturing):this.target[e](this.eventName,t,this.useCapturing)},invokeRemoveFunc:function(e,t){return t&&t.invoke?this.target[e](this.eventName,t.invoke,this.useCapturing):this.target[e](this.eventName,t,this.useCapturing)}}};function o(t,n,o,a,c,u){void 0===o&&(o=!0),void 0===a&&(a=!1),void 0===c&&(c=!1),void 0===u&&(u=s);var l=e(t),h=e(n),p=!o&&void 0;function d(e){var t=e.data;return function(e,t,n){var i=e[r];i||(i=e[r]=[]),n?i.unshift(t):i.push(t)}(t.target,e,c),t.invokeAddFunc(l,e)}function f(e){var t=e.data;return i(t.target,e.invoke,t.eventName,t.useCapturing,!0),t.invokeRemoveFunc(h,e)}return function(e,n){var r=u(e,n);r.useCapturing=r.useCapturing||p;var s=null;"function"==typeof r.handler?s=r.handler:r.handler&&r.handler.handleEvent&&(s=function(e){return r.handler.handleEvent(e)});var o=!1;try{o=r.handler&&"[object FunctionWrapper]"===r.handler.toString()}catch(e){return}if(!s||o)return r.invokeAddFunc(l,r.handler);if(!a){var c=i(r.target,r.handler,r.eventName,r.useCapturing,!1);if(c)return r.invokeAddFunc(l,c)}var h=Zone.current,g=r.target.constructor.name+"."+t+":"+r.eventName;h.scheduleEventTask(g,s,r,d,f)}}function a(t,n,r){void 0===n&&(n=!0),void 0===r&&(r=s);var o=e(t),a=!n&&void 0;return function(e,t){var n=r(e,t);n.useCapturing=n.useCapturing||a;var s=i(n.target,n.handler,n.eventName,n.useCapturing,!0);s?s.zone.cancelTask(s):n.invokeRemoveFunc(o,n.handler)}}o("addEventListener","removeEventListener"),a("removeEventListener"),e("originalInstance");function c(t,n,r){for(var i=t;i&&-1===Object.getOwnPropertyNames(i).indexOf(n);)i=Object.getPrototypeOf(i);!i&&t[n]&&(i=t);var s,o=e(n);return i&&!(s=i[o])&&(s=i[o]=i[n],i[n]=function(e,t){try{return Function("f","return function "+e+"(){return f(this, arguments)}")(t)}catch(e){return function(){return t(this,arguments)}}}(n,r(s,o,n))),s}
  /**
   * @license
   * Copyright Google Inc. All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   */
  var u,l,h=function(e){return function(t,n){return e(t,n),t}},p="addListener",d="prependListener",f="removeListener",g="removeAllListeners",m="listeners",v="on",y=h(o(p,f,!1,!0,!1)),b=h(o(d,f,!1,!0,!0)),_=h(a(f,!1)),w=h(function(n,i){void 0===i&&(i=!0);var s=e(n),o=!i&&void 0;return function(e,n){var i=e||t;if(0===n.length)return i[r]=[],void i[s]();var a=n[0];!function(e,t,n,i){var s=e[r];if(s){for(var o=[],a=s.length-1;a>=0;a--){var c=s[a],u=c.data;u.eventName===t&&u.useCapturing===n&&(o.push(c),i&&s.splice(a,1))}}}(i,a,n[1]||o,!0),i[s](a)}}(g,!1)),S=function(n){return e(n),function(e,n){var i=n[0],s=e||t;return s[r]?s[r].filter(function(e){return e.data.eventName===i}).map(function(e){return e.data.handler}):[]}}(m);try{u=n(28)}catch(e){}u&&u.EventEmitter&&function(e){!e||!e.addListener||(c(e,p,function(){return y}),c(e,d,function(){return b}),c(e,f,function(){return _}),c(e,g,function(){return w}),c(e,m,function(){return S}),e[v]=e[p])}(u.EventEmitter.prototype)
  /**
   * @license
   * Copyright Google Inc. All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   */;try{l=n(5)}catch(e){}
  /**
   * @license
   * Copyright Google Inc. All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   */
  function C(e,t,n,r){var i=null,s=null;n+=r;var o={};function a(t){var n=t.data;return n.args[0]=function(){t.invoke.apply(this,arguments),delete o[n.handleId]},n.handleId=i.apply(e,n.args),o[n.handleId]=t,t}function u(e){return delete o[e.data.handleId],s(e.data.handleId)}i=c(e,t+=r,function(n){return function(i,s){if("function"==typeof s[0]){var o=Zone.current,c={handleId:null,isPeriodic:"Interval"===r,delay:"Timeout"===r||"Interval"===r?s[1]||0:null,args:s},l=o.scheduleMacroTask(t,s[0],c,a,u);if(!l)return l;var h=l.data.handleId;return h.ref&&h.unref&&(l.ref=h.ref.bind(h),l.unref=h.unref.bind(h)),l}return n.apply(e,s)}}),s=c(e,n,function(t){return function(n,r){var i="number"==typeof r[0]?o[r[0]]:r[0];i&&"string"==typeof i.type?(i.cancelFn&&i.data.isPeriodic||0===i.runCount)&&i.zone.cancelTask(i):t.apply(e,r)}})}
  /**
   * @license
   * Copyright Google Inc. All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   */l&&["access","appendFile","chmod","chown","close","exists","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","read","readdir","readFile","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","write","writeFile"].filter(function(e){return!!l[e]&&"function"==typeof l[e]}).forEach(function(e){!function(e,t,n){var r=null;function i(e){var t=e.data;return t.args[t.callbackIndex]=function(){e.invoke.apply(this,arguments)},r.apply(t.target,t.args),e}r=c(e,t,function(e){return function(t,r){var s=n(t,r);return s.callbackIndex>=0&&"function"==typeof r[s.callbackIndex]?Zone.current.scheduleMacroTask(s.name,r[s.callbackIndex],s,i,null):e.apply(t,r)}})}(l,e,function(t,n){return{name:"fs."+e,args:n,callbackIndex:n.length>0?n.length-1:-1,target:t}})});var k,T,x="set",E="object"==typeof window&&window||"object"==typeof self&&self||global,P=n(126);C(P,x,"clear","Timeout"),C(P,x,"clear","Interval"),C(P,x,"clear","Immediate"),global.setTimeout!==P.setTimeout&&(C(E,x,"clear","Timeout"),C(E,x,"clear","Interval"),C(E,x,"clear","Immediate")),function(){var e=null;function t(t){var n=t.data;return n[0]=function(){t.invoke.apply(this,arguments)},e.apply(process,n),t}e=c(process,"nextTick",function(e){return function(n,r){if("function"==typeof r[0]){var i=Zone.current,s=i.scheduleMicroTask("nextTick",r[0],r,t);return s}return e.apply(process,r)}})}();try{k=n(127)}catch(e){}if(k){var I=k.randomBytes;k.randomBytes=function(e,t){if(t){var n=Zone.current,r=k.constructor.name+".randomBytes";return I(e,n.wrap(t,r))}return I(e)}.bind(k);var O=k.pbkdf2;k.pbkdf2=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e[e.length-1];if("function"==typeof n){var r=Zone.current,i=k.constructor.name+".pbkdf2";return e[e.length-1]=r.wrap(n,i),O.apply(void 0,e)}return O.apply(void 0,e)}.bind(k)}try{T=n(128)}catch(e){}if(T&&T.ClientRequest){var A=T.ClientRequest.bind(T);T.ClientRequest=function(e,t){if(t){var n=Zone.current;return new A(e,n.wrap(t,"http.ClientRequest"))}return new A(e)}}})},function(e,t){e.exports=require("timers")},function(e,t){e.exports=require("crypto")},function(e,t){e.exports=require("_http_client")},function(e,t,n){"use strict";var r=n(27),i=function(){function e(t){if(e.INSTANCE)throw new Error("Console logging adapter tracking should be configured from the applicationInsights object");this._client=t,e.INSTANCE=this}return e.prototype.enable=function(e,t){r.IsInitialized&&(n(130).enable(e&&t,this._client),n(148).enable(e,this._client),n(149).enable(e,this._client))},e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1,!1)},e._methodNames=["debug","info","log","warn","error"],e}();e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(7),s=[],o=function(e){s.forEach(function(t){var n=e.data.message;n.lastIndexOf("\n")==n.length-1&&(n=n.substring(0,n.length-1)),t.trackTrace({message:n,severity:e.data.stderr?r.SeverityLevel.Warning:r.SeverityLevel.Information})})};t.enable=function(e,t){e?(0===s.length&&i.channel.subscribe("console",o),s.push(t)):0===(s=s.filter(function(e){return e!=t})).length&&i.channel.unsubscribe("console",o)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(46),i=function(){function e(){}return e.TYPE_HTTP="Http",e.TYPE_AI="Http (tracked component)",e}();t.RemoteDependencyDataConstants=i,t.domainSupportsProperties=function(e){return"properties"in e||e instanceof r.EventData||e instanceof r.ExceptionData||e instanceof r.MessageData||e instanceof r.MetricData||e instanceof r.PageViewData||e instanceof r.RemoteDependencyData||e instanceof r.RequestData}},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return r(t,e),t}(n(12));e.exports=i},function(e,t,n){"use strict";var r=function(){return function(){this.applicationVersion="ai.application.ver",this.deviceId="ai.device.id",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceOEMName="ai.device.oemName",this.deviceOSVersion="ai.device.osVersion",this.deviceType="ai.device.type",this.locationIp="ai.location.ip",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.userAccountId="ai.user.accountId",this.userId="ai.user.id",this.userAuthUserId="ai.user.authUserId",this.cloudRole="ai.cloud.role",this.cloudRoleInstance="ai.cloud.roleInstance",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion",this.internalNodeName="ai.internal.nodeName"}}();e.exports=r},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){return e.call(this)||this}return r(t,e),t}(n(47));e.exports=i},function(e,t,n){"use strict";var r=n(48),i=function(){return function(){this.kind=r.Measurement}}();e.exports=i},function(e,t,n){"use strict";var r=function(){return function(){this.ver=1,this.sampleRate=100,this.tags={}}}();e.exports=r},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.exceptions=[],t.properties={},t.measurements={},t}return r(t,e),t}(n(12));e.exports=i},function(e,t,n){"use strict";var r=function(){return function(){this.hasFullStack=!0,this.parsedStack=[]}}();e.exports=r},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t}return r(t,e),t}(n(12));e.exports=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.metrics=[],t.properties={},t}return r(t,e),t}(n(12));e.exports=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return r(t,e),t}(n(49));e.exports=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.success=!0,t.properties={},t.measurements={},t}return r(t,e),t}(n(12));e.exports=i},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return r(t,e),t}(n(12));e.exports=i},function(e,t,n){"use strict";var r;!function(e){e[e.Verbose=0]="Verbose",e[e.Information=1]="Information",e[e.Warning=2]="Warning",e[e.Error=3]="Error",e[e.Critical=4]="Critical"}(r||(r={})),e.exports=r},function(e,t,n){"use strict";var r=function(){return function(){}}();e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(147))},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.telemetryTypeToBaseType=function(e){switch(e){case r.Event:return"EventData";case r.Exception:return"ExceptionData";case r.Trace:return"MessageData";case r.Metric:return"MetricData";case r.Request:return"RequestData";case r.Dependency:return"RemoteDependencyData"}},t.baseTypeToTelemetryType=function(e){switch(e){case"EventData":return r.Event;case"ExceptionData":return r.Exception;case"MessageData":return r.Trace;case"MetricData":return r.Metric;case"RequestData":return r.Request;case"RemoteDependencyData":return r.Dependency}},function(e){e[e.Event=0]="Event",e[e.Exception=1]="Exception",e[e.Trace=2]="Trace",e[e.Metric=3]="Metric",e[e.Request=4]="Request",e[e.Dependency=5]="Dependency"}(r=t.TelemetryType||(t.TelemetryType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(7),s=[],o={10:r.SeverityLevel.Verbose,20:r.SeverityLevel.Verbose,30:r.SeverityLevel.Information,40:r.SeverityLevel.Warning,50:r.SeverityLevel.Error,60:r.SeverityLevel.Critical},a=function(e){s.forEach(function(t){var n=o[e.data.level];t.trackTrace({message:e.data.result,severity:n})})};t.enable=function(e,t){e?(0===s.length&&i.channel.subscribe("bunyan",a),s.push(t)):0===(s=s.filter(function(e){return e!=t})).length&&i.channel.unsubscribe("bunyan",a)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(7),s=[],o={syslog:function(e){var t={emerg:r.SeverityLevel.Critical,alert:r.SeverityLevel.Critical,crit:r.SeverityLevel.Critical,error:r.SeverityLevel.Error,warning:r.SeverityLevel.Warning,notice:r.SeverityLevel.Information,info:r.SeverityLevel.Information,debug:r.SeverityLevel.Verbose};return void 0===t[e]?r.SeverityLevel.Information:t[e]},npm:function(e){var t={error:r.SeverityLevel.Error,warn:r.SeverityLevel.Warning,info:r.SeverityLevel.Information,verbose:r.SeverityLevel.Verbose,debug:r.SeverityLevel.Verbose,silly:r.SeverityLevel.Verbose};return void 0===t[e]?r.SeverityLevel.Information:t[e]},unknown:function(e){return r.SeverityLevel.Information}},a=function(e){s.forEach(function(t){var n=o[e.data.levelKind](e.data.level);t.trackTrace({message:e.data.message,severity:n,properties:e.data.meta})})};t.enable=function(e,t){e?(0===s.length&&i.channel.subscribe("winston",a),s.push(t)):0===(s=s.filter(function(e){return e!=t})).length&&i.channel.unsubscribe("winston",a)}},function(e,t,n){"use strict";var r=function(){function e(t){if(e.INSTANCE)throw new Error("Exception tracking should be configured from the applicationInsights object");e.INSTANCE=this,this._client=t}return Object.defineProperty(e,"UNCAUGHT_EXCEPTION_HANDLER_NAME",{get:function(){return"uncaughtException"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"UNHANDLED_REJECTION_HANDLER_NAME",{get:function(){return"unhandledRejection"},enumerable:!0,configurable:!0}),e.prototype.isInitialized=function(){return this._isInitialized},e.prototype.enable=function(t){var n=this;if(t){this._isInitialized=!0;if(!this._exceptionListenerHandle){var r=function(e,t){if(n._client.trackException({exception:t}),n._client.flush({isAppCrashing:!0}),e)throw t};this._exceptionListenerHandle=r.bind(this,!0),this._rejectionListenerHandle=r.bind(this,!1),process.on(e.UNCAUGHT_EXCEPTION_HANDLER_NAME,this._exceptionListenerHandle),process.on(e.UNHANDLED_REJECTION_HANDLER_NAME,this._rejectionListenerHandle)}}else this._exceptionListenerHandle&&(process.removeListener(e.UNCAUGHT_EXCEPTION_HANDLER_NAME,this._exceptionListenerHandle),process.removeListener(e.UNHANDLED_REJECTION_HANDLER_NAME,this._rejectionListenerHandle),this._exceptionListenerHandle=void 0,this._rejectionListenerHandle=void 0,delete this._exceptionListenerHandle,delete this._rejectionListenerHandle)},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1},e.INSTANCE=null,e}();e.exports=r},function(e,t){e.exports=require("constants")},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=n(23),s=n(10),o=n(13),a=n(21),c=n(51),u=n(32),l=function(e){function t(n,r){var i=e.call(this)||this;return r&&r.method&&n&&(i.method=r.method,i.url=t._getUrlFromRequestOptions(n,r),i.startTime=+new Date),i}return r(t,e),t.prototype.onError=function(e){this._setStatus(void 0,e)},t.prototype.onResponse=function(e){this._setStatus(e.statusCode,void 0),this.correlationId=o.getCorrelationContextTarget(e,a.requestContextTargetKey)},t.prototype.getDependencyTelemetry=function(e,t){var n=i.parse(this.url);n.search=void 0,n.hash=void 0;var r=this.method.toUpperCase()+" "+n.pathname,o=s.RemoteDependencyDataConstants.TYPE_HTTP,a=n.hostname;this.correlationId?(o=s.RemoteDependencyDataConstants.TYPE_AI,this.correlationId!==u.correlationIdPrefix&&(a=n.hostname+" | "+this.correlationId)):o=s.RemoteDependencyDataConstants.TYPE_HTTP;var c={id:t,name:r,data:this.url,duration:this.duration,success:this._isSuccess(),resultCode:this.statusCode?this.statusCode.toString():null,properties:this.properties||{},dependencyTypeName:o,target:a};if(e){for(var l in e)c[l]||(c[l]=e[l]);if(e.properties)for(var l in e.properties)c.properties[l]=e.properties[l]}return c},t._getUrlFromRequestOptions=function(e,t){if("string"==typeof e)e=i.parse(e);else{var n=e;e={},n&&Object.keys(n).forEach(function(t){e[t]=n[t]})}if(e.path){var r=i.parse(e.path);e.pathname=r.pathname,e.search=r.search}e.host&&e.port&&(!i.parse("http://"+e.host).port&&e.port&&(e.hostname=e.host,delete e.host));return e.protocol=e.protocol||t.agent&&t.agent.protocol||void 0,e.hostname=e.hostname||"localhost",i.format(e)},t}(c);e.exports=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=[];t.subscriber=function(e){i.forEach(function(t){var n=e.data.startedData&&e.data.startedData.databaseName||"Unknown database";t.trackDependency({target:n,data:e.data.event.commandName,name:e.data.event.commandName,duration:e.data.event.duration,success:e.data.succeeded,resultCode:e.data.succeeded?"0":"1",dependencyTypeName:"mongodb"})})},t.enable=function(e,n){e?(0===i.length&&r.channel.subscribe("mongodb",t.subscriber),i.push(n)):0===(i=i.filter(function(e){return e!=n})).length&&r.channel.unsubscribe("mongodb",t.subscriber)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=[];t.subscriber=function(e){i.forEach(function(t){var n=e.data.query||{},r=n.sql||"Unknown query",i=!e.data.err,s=(n._connection||{}).config||{},o=s.socketPath?s.socketPath:(s.host||"localhost")+":"+s.port;t.trackDependency({target:o,data:r,name:r,duration:e.data.duration,success:i,resultCode:i?"0":"1",dependencyTypeName:"mysql"})})},t.enable=function(e,n){e?(0===i.length&&r.channel.subscribe("mysql",t.subscriber),i.push(n)):0===(i=i.filter(function(e){return e!=n})).length&&r.channel.unsubscribe("mysql",t.subscriber)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=[];t.subscriber=function(e){i.forEach(function(t){"info"!==e.data.commandObj.command&&t.trackDependency({target:e.data.address,name:e.data.commandObj.command,data:e.data.commandObj.command,duration:e.data.duration,success:!e.data.err,resultCode:e.data.err?"1":"0",dependencyTypeName:"redis"})})},t.enable=function(e,n){e?(0===i.length&&r.channel.subscribe("redis",t.subscriber),i.push(n)):0===(i=i.filter(function(e){return e!=n})).length&&r.channel.unsubscribe("redis",t.subscriber)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=[];t.subscriber=function(e){i.forEach(function(t){var n=e.data.query,r=n.preparable&&n.preparable.text||n.plan||n.text||"unknown query",i=!e.data.error,s=e.data.database.host+":"+e.data.database.port;t.trackDependency({target:s,data:r,name:r,duration:e.data.duration,success:i,resultCode:i?"0":"1",dependencyTypeName:"postgres"})})},t.enable=function(e,n){e?(0===i.length&&r.channel.subscribe("postgres",t.subscriber),i.push(n)):0===(i=i.filter(function(e){return e!=n})).length&&r.channel.unsubscribe("postgres",t.subscriber)}},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=n(23),s=n(10),o=n(13),a=n(21),c=n(51),u=n(32),l=function(e){function t(t,n){var r=e.call(this)||this;return t&&(r.method=t.method,r.url=r._getAbsoluteUrl(t),r.startTime=+new Date,r.socketRemoteAddress=t.socket&&t.socket.remoteAddress,r.parseHeaders(t,n),t.connection&&(r.connectionRemoteAddress=t.connection.remoteAddress,r.legacySocketRemoteAddress=t.connection.socket&&t.connection.socket.remoteAddress)),r}return r(t,e),t.prototype.onError=function(e,t){this._setStatus(void 0,e),t&&(this.duration=t)},t.prototype.onResponse=function(e,t){this._setStatus(e.statusCode,void 0),t&&(this.duration=t)},t.prototype.getRequestTelemetry=function(e){var t={id:this.requestId,name:this.method+" "+i.parse(this.url).pathname,url:this.url,source:this.sourceCorrelationId,duration:this.duration,resultCode:this.statusCode?this.statusCode.toString():null,success:this._isSuccess(),properties:this.properties};if(e){for(var n in e)t[n]||(t[n]=e[n]);if(e.properties)for(var n in e.properties)t.properties[n]=e.properties[n]}return t},t.prototype.getRequestTags=function(e){var n={};for(var r in e)n[r]=e[r];return n[t.keys.locationIp]=e[t.keys.locationIp]||this._getIp(),n[t.keys.sessionId]=e[t.keys.sessionId]||this._getId("ai_session"),n[t.keys.userId]=e[t.keys.userId]||this._getId("ai_user"),n[t.keys.userAuthUserId]=e[t.keys.userAuthUserId]||this._getId("ai_authUser"),n[t.keys.operationName]=this.getOperationName(e),n[t.keys.operationParentId]=this.getOperationParentId(e),n[t.keys.operationId]=this.getOperationId(e),n},t.prototype.getOperationId=function(e){return e[t.keys.operationId]||this.operationId},t.prototype.getOperationParentId=function(e){return e[t.keys.operationParentId]||this.parentId||this.getOperationId(e)},t.prototype.getOperationName=function(e){return e[t.keys.operationName]||this.method+" "+i.parse(this.url).pathname},t.prototype.getRequestId=function(){return this.requestId},t.prototype.getCorrelationContextHeader=function(){return this.correlationContextHeader},t.prototype._getAbsoluteUrl=function(e){if(!e.headers)return e.url;var t=e.connection?e.connection.encrypted:null,n=i.parse(e.url),r=n.pathname,s=n.search;return i.format({protocol:t?"https":"http",host:e.headers.host,pathname:r,search:s})},t.prototype._getIp=function(){var e=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/,t=function(t){var n=e.exec(t);if(n)return n[0]},n=t(this.rawHeaders["x-forwarded-for"])||t(this.rawHeaders["x-client-ip"])||t(this.rawHeaders["x-real-ip"])||t(this.connectionRemoteAddress)||t(this.socketRemoteAddress)||t(this.legacySocketRemoteAddress);return!n&&this.connectionRemoteAddress&&this.connectionRemoteAddress.substr&&"::"===this.connectionRemoteAddress.substr(0,2)&&(n="127.0.0.1"),n},t.prototype._getId=function(e){var n=this.rawHeaders&&this.rawHeaders.cookie&&"string"==typeof this.rawHeaders.cookie&&this.rawHeaders.cookie||"";return t.parseId(o.getCookie(e,n))},t.prototype.parseHeaders=function(e,t){if(this.rawHeaders=e.headers||e.rawHeaders,this.userAgent=e.headers&&e.headers["user-agent"],this.sourceCorrelationId=o.getCorrelationContextTarget(e,a.requestContextSourceKey),e.headers){if(this.correlationContextHeader=e.headers[a.correlationContextHeader],e.headers[a.requestIdHeader])this.parentId=e.headers[a.requestIdHeader],this.requestId=u.generateRequestId(this.parentId),this.correlationContextHeader=e.headers[a.correlationContextHeader];else{var n=e.headers[a.rootIdHeader];this.parentId=e.headers[a.parentIdHeader],this.requestId=u.generateRequestId(n||this.parentId),this.correlationContextHeader=null}t&&(this.requestId=t),this.operationId=u.getRootId(this.requestId)}},t.parseId=function(e){return e.substr(0,e.indexOf("|"))},t.keys=new s.ContextTagKeys,t}(c);e.exports=l},function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=n(159),s=n(52),o=n(29),a=n(9),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.trackNodeHttpRequestSync=function(e){e&&e.request&&e.response&&e.duration?s.trackRequestSync(this,e):a.warn("trackNodeHttpRequestSync requires NodeHttpRequestTelemetry object with request, response and duration specified.")},t.prototype.trackNodeHttpRequest=function(e){(e.duration||e.error)&&a.warn("trackNodeHttpRequest will ignore supplied duration and error parameters. These values are collected from the request and response objects."),e&&e.request&&e.response?s.trackRequest(this,e):a.warn("trackNodeHttpRequest requires NodeHttpRequestTelemetry object with request and response specified.")},t.prototype.trackNodeHttpDependency=function(e){e&&e.request?o.trackRequest(this,e):a.warn("trackNodeHttpDependency requires NodeHttpDependencyTelemetry object with request specified.")},t}(i);e.exports=c},function(e,t,n){"use strict";var r=n(23),i=n(160),s=n(161),o=n(10),a=n(162),c=n(163),u=n(20),l=n(165),h=n(13),p=n(9),d=n(167),f=function(){function e(e){this._telemetryProcessors=[];var t=new i(e);this.config=t,this.context=new s,this.commonProperties={};var n=new l(this.config);this.channel=new a(function(){return t.disableAppInsights},function(){return t.maxBatchSize},function(){return t.maxBatchIntervalMs},n)}return e.prototype.trackTrace=function(e){this.track(e,o.TelemetryType.Trace)},e.prototype.trackMetric=function(e){this.track(e,o.TelemetryType.Metric)},e.prototype.trackException=function(e){e&&e.exception&&!h.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,o.TelemetryType.Exception)},e.prototype.trackEvent=function(e){this.track(e,o.TelemetryType.Event)},e.prototype.trackRequest=function(e){this.track(e,o.TelemetryType.Request)},e.prototype.trackDependency=function(e){e&&!e.target&&e.data&&(e.target=r.parse(e.data).host),this.track(e,o.TelemetryType.Dependency)},e.prototype.flush=function(e){this.channel.triggerSend(!!e&&!!e.isAppCrashing,e?e.callback:void 0)},e.prototype.track=function(e,t){if(e&&o.telemetryTypeToBaseType(t)){var n=d.createEnvelope(e,t,this.commonProperties,this.context,this.config);e.time&&(n.time=e.time.toISOString());var r=this.runTelemetryProcessors(n,e.contextObjects);(r=r&&c.samplingTelemetryProcessor(n,{correlationContext:u.CorrelationContextManager.getCurrentContext()}))&&this.channel.send(n)}else p.warn("track() requires telemetry object and telemetryType to be specified.")},e.prototype.addTelemetryProcessor=function(e){this._telemetryProcessors.push(e)},e.prototype.clearTelemetryProcessors=function(){this._telemetryProcessors=[]},e.prototype.runTelemetryProcessors=function(e,t){var n=!0,r=this._telemetryProcessors.length;if(0===r)return n;(t=t||{}).correlationContext=u.CorrelationContextManager.getCurrentContext();for(var i=0;i<r;++i)try{var s=this._telemetryProcessors[i];if(s&&!1===s.apply(null,[e,t])){n=!1;break}}catch(t){n=!0,p.warn("One of telemetry processors failed, telemetry item will be sent.",t,e)}return n},e}();e.exports=f},function(e,t,n){"use strict";var r=n(32),i=function(){function e(t){var n=this;this.endpointBase="https://dc.services.visualstudio.com",this.instrumentationKey=t||e._getInstrumentationKey(),this.endpointUrl=this.endpointBase+"/v2/track",this.maxBatchSize=250,this.maxBatchIntervalMs=15e3,this.disableAppInsights=!1,this.samplingPercentage=100,this.correlationIdRetryIntervalMs=3e4,this.correlationHeaderExcludedDomains=["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net"],this.setCorrelationId=function(e){return n.correlationId=e},this.profileQueryEndpoint=process.env[e.ENV_profileQueryEndpoint]||this.endpointBase,this.proxyHttpUrl=process.env[e.ENV_http_proxy]||void 0,this.proxyHttpsUrl=process.env[e.ENV_https_proxy]||void 0,this.httpAgent=void 0,this.httpsAgent=void 0}return Object.defineProperty(e.prototype,"profileQueryEndpoint",{get:function(){return this._profileQueryEndpoint},set:function(e){r.cancelCorrelationIdQuery(this,this.setCorrelationId),this._profileQueryEndpoint=e,this.correlationId=r.correlationIdPrefix,r.queryCorrelationId(this,this.setCorrelationId)},enumerable:!0,configurable:!0}),e._getInstrumentationKey=function(){var t=process.env[e.ENV_iKey]||process.env[e.ENV_azurePrefix+e.ENV_iKey]||process.env[e.legacy_ENV_iKey]||process.env[e.ENV_azurePrefix+e.legacy_ENV_iKey];if(!t||""==t)throw new Error("Instrumentation key not found, pass the key in the config to this method or set the key in the environment variable APPINSIGHTS_INSTRUMENTATIONKEY before starting the server");return t},e.ENV_azurePrefix="APPSETTING_",e.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY",e.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY",e.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT",e.ENV_http_proxy="http_proxy",e.ENV_https_proxy="https_proxy",e}();e.exports=i},function(e,t,n){"use strict";var r=n(17),i=n(5),s=n(1),o=n(10),a=n(9),c=function(){function e(e){this.keys=new o.ContextTagKeys,this.tags={},this._loadApplicationContext(),this._loadDeviceContext(),this._loadInternalContext()}return e.prototype._loadApplicationContext=function(t){if(t=t||s.resolve(__dirname,"../../../../package.json"),!e.appVersion[t]){e.appVersion[t]="unknown";try{var n=JSON.parse(i.readFileSync(t,"utf8"));n&&"string"==typeof n.version&&(e.appVersion[t]=n.version)}catch(e){a.info("unable to read app version: ",e)}}this.tags[this.keys.applicationVersion]=e.appVersion[t]},e.prototype._loadDeviceContext=function(){this.tags[this.keys.deviceId]="",this.tags[this.keys.cloudRoleInstance]=r&&r.hostname(),this.tags[this.keys.deviceOSVersion]=r&&r.type()+" "+r.release(),this.tags[this.keys.cloudRole]=e.DefaultRoleName,this.tags["ai.device.osArchitecture"]=r&&r.arch(),this.tags["ai.device.osPlatform"]=r&&r.platform()},e.prototype._loadInternalContext=function(){var t=s.resolve(__dirname,"../../package.json");if(!e.sdkVersion){e.sdkVersion="unknown";try{var n=JSON.parse(i.readFileSync(t,"utf8"));n&&"string"==typeof n.version&&(e.sdkVersion=n.version)}catch(e){a.info("unable to read app version: ",e)}}this.tags[this.keys.internalSdkVersion]="node:"+e.sdkVersion},e.DefaultRoleName="Web",e.appVersion={},e.sdkVersion=null,e}();e.exports=c},function(e,t,n){"use strict";var r=n(9),i=function(){function e(e,t,n,r){this._buffer=[],this._lastSend=0,this._isDisabled=e,this._getBatchSize=t,this._getBatchIntervalMs=n,this._sender=r}return e.prototype.setUseDiskRetryCaching=function(e,t,n){this._sender.setDiskRetryMode(e,t,n)},e.prototype.send=function(e){var t=this;if(!this._isDisabled())if(e){var n=this._stringify(e);"string"==typeof n&&(this._buffer.push(n),this._buffer.length>=this._getBatchSize()?this.triggerSend(!1):!this._timeoutHandle&&this._buffer.length>0&&(this._timeoutHandle=setTimeout(function(){t._timeoutHandle=null,t.triggerSend(!1)},this._getBatchIntervalMs())))}else r.warn("Cannot send null/undefined telemetry")},e.prototype.triggerSend=function(e,t){var n=this._buffer.length<1;if(!n){var r=this._buffer.join("\n");e?(this._sender.saveOnCrash(r),"function"==typeof t&&t("data saved on crash")):this._sender.send(Buffer.from?Buffer.from(r):new Buffer(r),t)}this._lastSend=+new Date,this._buffer.length=0,clearTimeout(this._timeoutHandle),this._timeoutHandle=null,n&&"function"==typeof t&&t("no data to send")},e.prototype._stringify=function(e){try{return JSON.stringify(e)}catch(t){r.warn("Failed to serialize payload",t,e)}},e}();e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(164))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(10);function i(e){var t=5381;if(!e)return 0;for(;e.length<8;)e+=e;for(var n=0;n<e.length;n++)t=((t<<5)+t|0)+e.charCodeAt(n)|0;return(t=t<=-2147483648?2147483647:Math.abs(t))/2147483647*100}t.samplingTelemetryProcessor=function(e,t){var n=e.sampleRate;return null===n||void 0===n||n>=100||!(!e.data||r.TelemetryType.Metric!==r.baseTypeToTelemetryType(e.data.baseType))||(t.correlationContext&&t.correlationContext.operation?i(t.correlationContext.operation.id)<n:100*Math.random()<n)},t.getSamplingHashCode=i},function(e,t,n){"use strict";var r=n(5),i=n(17),s=n(1),o=n(166),a=n(53),c=n(9),u=n(29),l=n(13),h=function(){function e(t,n,i){if(this._config=t,this._onSuccess=n,this._onError=i,this._enableDiskRetryMode=!1,this._resendInterval=e.WAIT_BETWEEN_RESEND,this._maxBytesOnDisk=e.MAX_BYTES_ON_DISK,this._numConsecutiveFailures=0,!e.OS_PROVIDES_FILE_PROTECTION)if(e.USE_ICACLS){try{e.OS_PROVIDES_FILE_PROTECTION=r.existsSync(e.ICACLS_PATH)}catch(e){}e.OS_PROVIDES_FILE_PROTECTION||c.warn(e.TAG,"Could not find ICACLS in expected location! This is necessary to use disk retry mode on Windows.")}else e.OS_PROVIDES_FILE_PROTECTION=!0}return e.prototype.setDiskRetryMode=function(t,n,r){this._enableDiskRetryMode=e.OS_PROVIDES_FILE_PROTECTION&&t,"number"==typeof n&&n>=0&&(this._resendInterval=Math.floor(n)),"number"==typeof r&&r>=0&&(this._maxBytesOnDisk=Math.floor(r)),t&&!e.OS_PROVIDES_FILE_PROTECTION&&(this._enableDiskRetryMode=!1,c.warn(e.TAG,"Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected."))},e.prototype.send=function(t,n){var r=this,i=this._config.endpointUrl,s={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}};o.gzip(t,function(o,a){var h=a;o?(c.warn(o),h=t,s.headers["Content-Length"]=t.length.toString()):(s.headers["Content-Encoding"]="gzip",s.headers["Content-Length"]=a.length),c.info(e.TAG,s),s[u.disableCollectionRequestOption]=!0;var p=l.makeRequest(r._config,i,s,function(i){i.setEncoding("utf-8");var s="";i.on("data",function(e){s+=e}),i.on("end",function(){r._numConsecutiveFailures=0,c.info(e.TAG,s),"function"==typeof r._onSuccess&&r._onSuccess(s),"function"==typeof n&&n(s),r._enableDiskRetryMode&&(200===i.statusCode?setTimeout(function(){return r._sendFirstFileOnDisk()},r._resendInterval):408!==i.statusCode&&429!==i.statusCode&&439!==i.statusCode&&500!==i.statusCode&&503!==i.statusCode||r._storeToDisk(t))})});p.on("error",function(i){if(r._numConsecutiveFailures++,!r._enableDiskRetryMode||r._numConsecutiveFailures>0&&r._numConsecutiveFailures%e.MAX_CONNECTION_FAILURES_BEFORE_WARN==0){var s="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";r._enableDiskRetryMode&&(s="Ingestion endpoint could not be reached "+r._numConsecutiveFailures+" consecutive times. There may be resulting telemetry loss. Most recent error:"),c.warn(e.TAG,s,i)}else{s="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";c.info(e.TAG,s,i)}if(r._onErrorHelper(i),"function"==typeof n){var o="error sending telemetry";i&&"function"==typeof i.toString&&(o=i.toString()),n(o)}r._enableDiskRetryMode&&r._storeToDisk(t)}),p.write(h),p.end()})},e.prototype.saveOnCrash=function(e){this._enableDiskRetryMode&&this._storeToDiskSync(e)},e.prototype._runICACLS=function(t,n){var r=a.spawn(e.ICACLS_PATH,t,{windowsHide:!0});r.on("error",function(e){return n(e)}),r.on("close",function(e,t){return n(0===e?null:new Error("Setting ACL restrictions did not succeed (ICACLS returned code "+e+")"))})},e.prototype._runICACLSSync=function(t){if(!a.spawnSync)throw new Error("Could not synchronously call ICACLS under current version of Node.js");var n=a.spawnSync(e.ICACLS_PATH,t,{windowsHide:!0});if(n.error)throw n.error;if(0!==n.status)throw new Error("Setting ACL restrictions did not succeed (ICACLS returned code "+n.status+")")},e.prototype._getACLIdentity=function(t){if(e.ACL_IDENTITY)return t(null,e.ACL_IDENTITY);var n=a.spawn(e.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:!0,stdio:["ignore","pipe","pipe"]}),r="";n.stdout.on("data",function(e){return r+=e}),n.on("error",function(e){return t(e,null)}),n.on("close",function(n,i){return e.ACL_IDENTITY=r&&r.trim(),t(0===n?null:new Error("Getting ACL identity did not succeed (PS returned code "+n+")"),e.ACL_IDENTITY)})},e.prototype._getACLIdentitySync=function(){if(e.ACL_IDENTITY)return e.ACL_IDENTITY;if(a.spawnSync){var t=a.spawnSync(e.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:!0,stdio:["ignore","pipe","pipe"]});if(t.error)throw t.error;if(0!==t.status)throw new Error("Getting ACL identity did not succeed (PS returned code "+t.status+")");return e.ACL_IDENTITY=t.stdout&&t.stdout.toString().trim(),e.ACL_IDENTITY}throw new Error("Could not synchronously get ACL identity under current version of Node.js")},e.prototype._getACLArguments=function(e,t){return[e,"/grant","*S-1-5-32-544:(OI)(CI)F","/grant",t+":(OI)(CI)F","/inheritance:r"]},e.prototype._applyACLRules=function(t,n){var r=this;return e.USE_ICACLS?void 0!==e.ACLED_DIRECTORIES[t]?n(e.ACLED_DIRECTORIES[t]?null:new Error("Setting ACL restrictions did not succeed (cached result)")):(e.ACLED_DIRECTORIES[t]=!1,void this._getACLIdentity(function(i,s){if(i)return e.ACLED_DIRECTORIES[t]=!1,n(i);r._runICACLS(r._getACLArguments(t,s),function(r){return e.ACLED_DIRECTORIES[t]=!r,n(r)})})):n(null)},e.prototype._applyACLRulesSync=function(t){if(e.USE_ICACLS){if(void 0===e.ACLED_DIRECTORIES[t])return this._runICACLSSync(this._getACLArguments(t,this._getACLIdentitySync())),void(e.ACLED_DIRECTORIES[t]=!0);if(!e.ACLED_DIRECTORIES[t])throw new Error("Setting ACL restrictions did not succeed (cached result)")}},e.prototype._confirmDirExists=function(e,t){var n=this;r.lstat(e,function(i,s){i&&"ENOENT"===i.code?r.mkdir(e,function(r){r&&"EEXIST"!==r.code?t(r):n._applyACLRules(e,t)}):!i&&s.isDirectory()?n._applyACLRules(e,t):t(i||new Error("Path existed but was not a directory"))})},e.prototype._getShallowDirectorySize=function(e,t){r.readdir(e,function(n,i){if(n)return t(n,-1);var o=null,a=0,c=0;if(0!==i.length)for(var u=0;u<i.length;u++)r.stat(s.join(e,i[u]),function(e,n){c++,e?o=e:n.isFile()&&(a+=n.size),c===i.length&&t(o,o?-1:a)});else t(null,0)})},e.prototype._getShallowDirectorySizeSync=function(e){for(var t=r.readdirSync(e),n=0,i=0;i<t.length;i++)n+=r.statSync(s.join(e,t[i])).size;return n},e.prototype._storeToDisk=function(t){var n=this,o=s.join(i.tmpdir(),e.TEMPDIR_PREFIX+this._config.instrumentationKey);c.info(e.TAG,"Checking existance of data storage directory: "+o),this._confirmDirExists(o,function(i){if(i)return c.warn(e.TAG,"Error while checking/creating directory: "+(i&&i.message)),void n._onErrorHelper(i);n._getShallowDirectorySize(o,function(i,a){if(i||a<0)return c.warn(e.TAG,"Error while checking directory size: "+(i&&i.message)),void n._onErrorHelper(i);if(a>n._maxBytesOnDisk)c.warn(e.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+a);else{var u=(new Date).getTime()+".ai.json",l=s.join(o,u);c.info(e.TAG,"saving data to disk at: "+l),r.writeFile(l,t,{mode:384},function(e){return n._onErrorHelper(e)})}})})},e.prototype._storeToDiskSync=function(t){var n=s.join(i.tmpdir(),e.TEMPDIR_PREFIX+this._config.instrumentationKey);try{c.info(e.TAG,"Checking existance of data storage directory: "+n),r.existsSync(n)||r.mkdirSync(n),this._applyACLRulesSync(n);var o=this._getShallowDirectorySizeSync(n);if(o>this._maxBytesOnDisk)return void c.info(e.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+o);var a=(new Date).getTime()+".ai.json",u=s.join(n,a);c.info(e.TAG,"saving data before crash to disk at: "+u),r.writeFileSync(u,t,{mode:384})}catch(t){c.warn(e.TAG,"Error while saving data to disk: "+(t&&t.message)),this._onErrorHelper(t)}},e.prototype._sendFirstFileOnDisk=function(){var t=this,n=s.join(i.tmpdir(),e.TEMPDIR_PREFIX+this._config.instrumentationKey);r.exists(n,function(e){e&&r.readdir(n,function(e,i){if(e)t._onErrorHelper(e);else if((i=i.filter(function(e){return s.basename(e).indexOf(".ai.json")>-1})).length>0){var o=i[0],a=s.join(n,o);r.readFile(a,function(e,n){e?t._onErrorHelper(e):r.unlink(a,function(e){e?t._onErrorHelper(e):t.send(n)})})}})})},e.prototype._onErrorHelper=function(e){"function"==typeof this._onError&&this._onError(e)},e.TAG="Sender",e.ICACLS_PATH=process.env.systemdrive+"/windows/system32/icacls.exe",e.POWERSHELL_PATH=process.env.systemdrive+"/windows/system32/windowspowershell/v1.0/powershell.exe",e.ACLED_DIRECTORIES={},e.ACL_IDENTITY=null,e.WAIT_BETWEEN_RESEND=6e4,e.MAX_BYTES_ON_DISK=5e7,e.MAX_CONNECTION_FAILURES_BEFORE_WARN=5,e.TEMPDIR_PREFIX="appInsights-node",e.OS_PROVIDES_FILE_PROTECTION=!1,e.USE_ICACLS="Windows_NT"===i.type(),e}();e.exports=h},function(e,t){e.exports=require("zlib")},function(e,t,n){"use strict";var r=n(10),i=n(13),s=n(20),o=function(){function e(){}return e.createEnvelope=function(t,n,s,o,a){var c=null;switch(n){case r.TelemetryType.Trace:c=e.createTraceData(t);break;case r.TelemetryType.Dependency:c=e.createDependencyData(t);break;case r.TelemetryType.Event:c=e.createEventData(t);break;case r.TelemetryType.Exception:c=e.createExceptionData(t);break;case r.TelemetryType.Request:c=e.createRequestData(t);break;case r.TelemetryType.Metric:c=e.createMetricData(t)}if(s&&r.domainSupportsProperties(c.baseData)){if(c&&c.baseData)if(c.baseData.properties)for(var u in s)c.baseData.properties[u]||(c.baseData.properties[u]=s[u]);else c.baseData.properties=s;c.baseData.properties=i.validateStringMap(c.baseData.properties)}var l=a&&a.instrumentationKey||"",h=new r.Envelope;return h.data=c,h.iKey=l,h.name="Microsoft.ApplicationInsights."+l.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),h.tags=this.getTags(o,t.tagOverrides),h.time=(new Date).toISOString(),h.ver=1,h.sampleRate=a?a.samplingPercentage:100,n===r.TelemetryType.Metric&&(h.sampleRate=100),h},e.createTraceData=function(e){var t=new r.MessageData;t.message=e.message,t.properties=e.properties,isNaN(e.severity)?t.severityLevel=r.SeverityLevel.Information:t.severityLevel=e.severity;var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Trace),n.baseData=t,n},e.createDependencyData=function(e){var t=new r.RemoteDependencyData;t.name=e.name,t.data=e.data,t.target=e.target,t.duration=i.msToTimeSpan(e.duration),t.success=e.success,t.type=e.dependencyTypeName,t.properties=e.properties,t.resultCode=e.resultCode?e.resultCode+"":"",e.id?t.id=e.id:t.id=i.w3cTraceId();var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Dependency),n.baseData=t,n},e.createEventData=function(e){var t=new r.EventData;t.name=e.name,t.properties=e.properties,t.measurements=e.measurements;var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Event),n.baseData=t,n},e.createExceptionData=function(e){var t=new r.ExceptionData;t.properties=e.properties,t.severityLevel=r.SeverityLevel.Error,t.measurements=e.measurements,t.exceptions=[];var n=e.exception.stack,s=new r.ExceptionDetails;s.message=e.exception.message,s.typeName=e.exception.name,s.parsedStack=this.parseStack(n),s.hasFullStack=i.isArray(s.parsedStack)&&s.parsedStack.length>0,t.exceptions.push(s);var o=new r.Data;return o.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Exception),o.baseData=t,o},e.createRequestData=function(e){var t=new r.RequestData;e.id?t.id=e.id:t.id=i.w3cTraceId(),t.name=e.name,t.url=e.url,t.source=e.source,t.duration=i.msToTimeSpan(e.duration),t.responseCode=e.resultCode?e.resultCode+"":"",t.success=e.success,t.properties=e.properties;var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Request),n.baseData=t,n},e.createMetricData=function(e){var t=new r.MetricData;t.metrics=[];var n=new r.DataPoint;n.count=isNaN(e.count)?1:e.count,n.kind=r.DataPointType.Aggregation,n.max=isNaN(e.max)?e.value:e.max,n.min=isNaN(e.min)?e.value:e.min,n.name=e.name,n.stdDev=isNaN(e.stdDev)?0:e.stdDev,n.value=e.value,t.metrics.push(n),t.properties=e.properties;var i=new r.Data;return i.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Metric),i.baseData=t,i},e.getTags=function(e,t){var n=s.CorrelationContextManager.getCurrentContext(),r={};if(e&&e.tags)for(var i in e.tags)r[i]=e.tags[i];if(t)for(var i in t)r[i]=t[i];return n&&(r[e.keys.operationId]=r[e.keys.operationId]||n.operation.id,r[e.keys.operationName]=r[e.keys.operationName]||n.operation.name,r[e.keys.operationParentId]=r[e.keys.operationParentId]||n.operation.parentId),r},e.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,s=0;s<=n.length;s++){var o=n[s];if(a.regex.test(o)){var c=new a(n[s],r++);i+=c.sizeInBytes,t.push(c)}}if(i>32768)for(var u=0,l=t.length-1,h=0,p=u,d=l;u<l;){if((h+=t[u].sizeInBytes+t[l].sizeInBytes)>32768){var f=d-p+1;t.splice(p,f);break}p=u,d=l,u++,l--}}return t},e}(),a=function(){function e(t,n){this.sizeInBytes=0,this.level=n,this.method="<no_method>",this.assembly=i.trim(t);var r=t.match(e.regex);r&&r.length>=5&&(this.method=i.trim(r[2])||this.method,this.fileName=i.trim(r[4])||"<no_filename>",this.line=parseInt(r[5])||0),this.sizeInBytes+=this.method.length,this.sizeInBytes+=this.fileName.length,this.sizeInBytes+=this.assembly.length,this.sizeInBytes+=e.baseSize,this.sizeInBytes+=this.level.toString().length,this.sizeInBytes+=this.line.toString().length}return e.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,e.baseSize=58,e}();e.exports=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);var i;!function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(i||(i={})),function(e){e.fromString=function(t){switch(t=t.toLowerCase()){case"off":return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose;default:return e.Off}}}(i||(i={}));class s{constructor(e){this.logger=e,this.updateConfiguration()}updateConfiguration(){this.trace=s.readTrace()}static readTrace(){let e=i.fromString(r.workspace.getConfiguration().get("typescript.tsserver.trace","off"));return e===i.Off&&process.env.TSS_TRACE&&(e=i.Messages),e}traceRequest(e,t,n,r){if(this.trace===i.Off)return;let s=void 0;this.trace===i.Verbose&&t.arguments&&(s=`Arguments: ${JSON.stringify(t.arguments,null,4)}`),this.logTrace(e,`Sending request: ${t.command} (${t.seq}). Response expected: ${n?"yes":"no"}. Current queue length: ${r}`,s)}traceResponse(e,t,n){if(this.trace===i.Off)return;let r=void 0;this.trace===i.Verbose&&t.body&&(r=`Result: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Response received: ${t.command} (${t.request_seq}). Request took ${Date.now()-n} ms. Success: ${t.success} ${t.success?"":". Message: "+t.message}`,r)}traceRequestCompleted(e,t,n,r){this.trace!==i.Off&&this.logTrace(e,`Async response received: ${t} (${n}). Request took ${Date.now()-r} ms.`)}traceEvent(e,t){if(this.trace===i.Off)return;let n=void 0;this.trace===i.Verbose&&t.body&&(n=`Data: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Event received: ${t.event} (${t.seq}).`,n)}logTrace(e,t,n){this.trace!==i.Off&&this.logger.logLevel("Trace",`<${e}> ${t}`,n)}}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3).loadMessageBundle(n(1).join(__dirname,"utils/versionPicker.ts")),s="typescript.useWorkspaceTsdk";var o;!function(e){e[e.useLocal=0]="useLocal",e[e.useBundled=1]="useBundled",e[e.learnMore=2]="learnMore"}(o||(o={}));t.TypeScriptVersionPicker=class{constructor(e,t){if(this.versionProvider=e,this.workspaceState=t,this._currentVersion=this.versionProvider.defaultVersion,this.useWorkspaceTsdkSetting){const e=this.versionProvider.localVersion;e&&(this._currentVersion=e)}}get useWorkspaceTsdkSetting(){return this.workspaceState.get(s,!1)}get currentVersion(){return this._currentVersion}useBundledVersion(){this._currentVersion=this.versionProvider.bundledVersion}async show(e){const t=[],n=this.versionProvider.defaultVersion;t.push({label:(this.useWorkspaceTsdkSetting?"":"• ")+i(0,null),description:n.versionString,detail:n.pathLabel,id:o.useBundled});for(const e of this.versionProvider.localVersions)t.push({label:(this.useWorkspaceTsdkSetting&&this.currentVersion.path===e.path?"• ":"")+i(1,null),description:e.versionString,detail:e.pathLabel,id:o.useLocal,version:e});t.push({label:i(2,null),description:"",id:o.learnMore});const a=await r.window.showQuickPick(t,{placeHolder:i(3,null),ignoreFocusOut:e});if(!a)return{oldVersion:this.currentVersion};switch(a.id){case o.useLocal:if(await this.workspaceState.update(s,!0),a.version){const e=r.workspace.getConfiguration("typescript");await e.update("tsdk",a.version.pathLabel,!1);const t=this.currentVersion;return this._currentVersion=a.version,{oldVersion:t,newVersion:a.version}}return{oldVersion:this.currentVersion};case o.useBundled:await this.workspaceState.update(s,!1);const e=this.currentVersion;return this._currentVersion=n,{oldVersion:e,newVersion:n};case o.learnMore:return r.env.openExternal(r.Uri.parse("https://go.microsoft.com/fwlink/?linkid=839919")),{oldVersion:this.currentVersion};default:return{oldVersion:this.currentVersion}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5),i=n(1),s=n(0),o=n(3),a=n(4),c=n(43),u=o.loadMessageBundle(n(1).join(__dirname,"utils/versionProvider.ts"));class l{constructor(e,t){this.path=e,this._pathLabel=t}get tsServerPath(){return i.join(this.path,"tsserver.js")}get pathLabel(){return void 0===this._pathLabel?this.path:this._pathLabel}get isValid(){return void 0!==this.apiVersion}get apiVersion(){const e=this.getTypeScriptVersion(this.tsServerPath);if(e)return e;const t=s.workspace.getConfiguration().get("typescript.tsdk_version",void 0);return t?a.default.fromVersionString(t):void 0}get versionString(){const e=this.apiVersion;return e?e.versionString:u(0,null)}getTypeScriptVersion(e){if(!r.existsSync(e))return;const t=e.split(i.sep);if(t.length<=2)return;const n=t.slice(0,-2).join(i.sep);let s=i.join(n,"package.json");if(r.existsSync(s)||"built"===i.basename(n)&&(s=i.join(n,"..","package.json")),!r.existsSync(s))return;const o=r.readFileSync(s).toString();let c=null;try{c=JSON.parse(o)}catch(e){return}return c&&c.version&&c.version?a.default.fromVersionString(c.version):void 0}}t.TypeScriptVersion=l;t.TypeScriptVersionProvider=class{constructor(e){this.configuration=e}updateConfiguration(e){this.configuration=e}get defaultVersion(){return this.globalVersion||this.bundledVersion}get globalVersion(){if(this.configuration.globalTsdk){const e=this.loadVersionsFromSetting(this.configuration.globalTsdk);if(e&&e.length)return e[0]}return this.contributedTsNextVersion}get localVersion(){const e=this.localTsdkVersions;if(e&&e.length)return e[0];const t=this.localNodeModulesVersions;return t&&1===t.length?t[0]:void 0}get localVersions(){const e=this.localTsdkVersions.concat(this.localNodeModulesVersions),t=new Set;return e.filter(e=>!t.has(e.path)&&(t.add(e.path),!0))}get bundledVersion(){const e=this.getContributedVersion("vscode.typescript-language-features",["..","node_modules"]);if(e)return e;throw s.window.showErrorMessage(u(1,null)),new Error("Could not find bundled tsserver.js")}get contributedTsNextVersion(){return this.getContributedVersion("ms-vscode.vscode-typescript-next",["node_modules"])}getContributedVersion(e,t){try{const n=s.extensions.getExtension(e);if(n){const e=i.join(n.extensionPath,...t,"typescript","lib"),r=new l(e,"");if(r.isValid)return r}}catch(e){}}get localTsdkVersions(){const e=this.configuration.localTsdk;return e?this.loadVersionsFromSetting(e):[]}loadVersionsFromSetting(e){if(i.isAbsolute(e))return[new l(e)];const t=c.RelativeWorkspacePathResolver.asAbsoluteWorkspacePath(e);return void 0!==t?[new l(t,e)]:this.loadTypeScriptVersionsFromPath(e)}get localNodeModulesVersions(){return this.loadTypeScriptVersionsFromPath(i.join("node_modules","typescript","lib")).filter(e=>e.isValid)}loadTypeScriptVersionsFromPath(e){if(!s.workspace.workspaceFolders)return[];const t=[];for(const n of s.workspace.workspaceFolders){let r=e;s.workspace.workspaceFolders&&s.workspace.workspaceFolders.length>1&&(r=i.join(n.name,e)),t.push(new l(i.join(n.uri.fsPath,e),r))}return t}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),i=n(0),s=n(4),o=n(42),a=n(54),c=n(173);class u{constructor(e,t,n,r,i,s){this._versionProvider=e,this._logDirectoryProvider=t,this._pluginPathsProvider=n,this._logger=r,this._telemetryReporter=i,this._tracer=s}spawn(e,t,n){if(this.shouldUseSeparateSyntaxServer(e,t)){const r=this.spawnTsServer("syntax",e,t,n),i=this.spawnTsServer("semantic",e,t,n);return new c.SyntaxRoutingTsServer(r,i)}return this.spawnTsServer("main",e,t,n)}shouldUseSeparateSyntaxServer(e,t){return t.useSeparateSyntaxServer&&!!e.apiVersion&&e.apiVersion.gte(s.default.v340)}spawnTsServer(e,t,n,r){const i=t.apiVersion||s.default.defaultVersion,{args:o,cancellationPipeName:h,tsServerLogFile:p}=this.getTsServerArgs(e,n,t,i,r);u.isLoggingEnabled(i,n)&&(p?this._logger.info(`<${e}>  Log file: ${p}`):this._logger.error(`<${e}> Could not create log directory`)),this._logger.info(`<${e}> Forking...`);const d=a.fork(t.tsServerPath,o,this.getForkOptions(e));return this._logger.info(`<${e}> Starting...`),new c.ProcessBasedTsServer(e,new l(d),p,new c.PipeRequestCanceller(e,h,this._tracer),t,this._telemetryReporter,this._tracer)}getForkOptions(e){const t=u.getDebugPort(e);return{execArgv:t?[`--inspect=${t}`]:[]}}getTsServerArgs(e,t,n,i,c){const l=[];let h,p;if("syntax"===e&&l.push("--syntaxOnly"),i.gte(s.default.v250)?l.push("--useInferredProjectPerProjectRoot"):l.push("--useSingleInferredProject"),(t.disableAutomaticTypeAcquisition||"syntax"===e)&&l.push("--disableAutomaticTypingAcquisition"),"syntax"!==e&&l.push("--enableTelemetry"),i.gte(s.default.v222)&&(h=a.getTempFile("tscancellation"),l.push("--cancellationPipeName",h+"*")),u.isLoggingEnabled(i,t)){const e=this._logDirectoryProvider.getNewLogDirectory();e&&(p=r.join(e,"tsserver.log"),l.push("--logVerbosity",o.TsServerLogLevel.toString(t.tsServerLogLevel)),l.push("--logFile",p))}if(i.gte(s.default.v230)){const e=this._pluginPathsProvider.getPluginPaths();if(c.plugins.length){l.push("--globalPlugins",c.plugins.map(e=>e.name).join(","));const t=n.path===this._versionProvider.defaultVersion.path;for(const n of c.plugins)(t||n.enableForWorkspaceTypeScriptVersions)&&e.push(n.path)}0!==e.length&&l.push("--pluginProbeLocations",e.join(","))}return i.gte(s.default.v234)&&t.npmLocation&&l.push("--npmLocation",`"${t.npmLocation}"`),i.gte(s.default.v260)&&l.push("--locale",u.getTsLocale(t)),i.gte(s.default.v291)&&l.push("--noGetErrOnBackgroundUpdate"),i.gte(s.default.v345)&&l.push("--validateDefaultNpmLocation"),{args:l,cancellationPipeName:h,tsServerLogFile:p}}static getDebugPort(e){if("syntax"===e)return;const t=process.env.TSS_DEBUG;if(t){const e=parseInt(t);if(!isNaN(e))return e}}static isLoggingEnabled(e,t){return e.gte(s.default.v222)&&t.tsServerLogLevel!==o.TsServerLogLevel.Off}static getTsLocale(e){return e.locale?e.locale:i.env.language}}t.TypeScriptServerSpawner=u;class l{constructor(e){this._process=e}get stdout(){return this._process.stdout}write(e){this._process.stdin.write(JSON.stringify(e)+"\r\n","utf8")}on(e,t){this._process.on(e,t)}kill(){this._process.kill()}}},function(e,t){e.exports=require("process")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5),i=n(0),s=n(55),o=n(6),a=n(174),c=n(175),u=n(176),l=n(177);t.PipeRequestCanceller=class{constructor(e,t,n){this._serverId=e,this._cancellationPipeName=t,this._tracer=n}tryCancelOngoingRequest(e){if(!this._cancellationPipeName)return!1;this._tracer.logTrace(this._serverId,`TypeScript Server: trying to cancel ongoing request with sequence number ${e}`);try{r.writeFileSync(this._cancellationPipeName+e,"")}catch(e){}return!0}};class h extends o.Disposable{constructor(e,t,n,r,s,o,l){super(),this._serverId=e,this._process=t,this._tsServerLogFile=n,this._requestCanceller=r,this._version=s,this._telemetryReporter=o,this._tracer=l,this._requestQueue=new u.RequestQueue,this._callbacks=new c.CallbackMap,this._pendingResponses=new Set,this._onEvent=this._register(new i.EventEmitter),this.onEvent=this._onEvent.event,this._onExit=this._register(new i.EventEmitter),this.onExit=this._onExit.event,this._onError=this._register(new i.EventEmitter),this.onError=this._onError.event,this._reader=this._register(new a.Reader(this._process.stdout)),this._reader.onData(e=>this.dispatchMessage(e)),this._process.on("exit",e=>{this._onExit.fire(e),this._callbacks.destroy("server exited")}),this._process.on("error",e=>{this._onError.fire(e),this._callbacks.destroy("server errored")})}get onReaderError(){return this._reader.onError}get tsServerLogFile(){return this._tsServerLogFile}write(e){this._process.write(e)}dispose(){super.dispose(),this._callbacks.destroy("server disposed"),this._pendingResponses.clear()}kill(){this._process.kill()}dispatchMessage(e){try{switch(e.type){case"response":this.dispatchResponse(e);break;case"event":const t=e;if("requestCompleted"===t.event){const e=t.body.request_seq,n=this._callbacks.fetch(e);n&&(this._tracer.traceRequestCompleted(this._serverId,"requestCompleted",e,n.startTime),n.onSuccess(void 0))}else this._tracer.traceEvent(this._serverId,t),this._onEvent.fire(t);break;default:throw new Error(`Unknown message type ${e.type} received`)}}finally{this.sendNextRequests()}}tryCancelRequest(e,t){try{return this._requestQueue.tryDeletePendingRequest(e)?(this.logTrace(`Canceled request with sequence number ${e}`),!0):!!this._requestCanceller.tryCancelOngoingRequest(e)||(this.logTrace(`Tried to cancel request with sequence number ${e}. But request got already delivered.`),!1)}finally{const n=this.fetchCallback(e);n&&n.onSuccess(new s.ServerResponse.Cancelled(`Cancelled request ${e} - ${t}`))}}dispatchResponse(e){const t=this.fetchCallback(e.request_seq);t&&(this._tracer.traceResponse(this._serverId,e,t.startTime),e.success?t.onSuccess(e):"No content available."===e.message?t.onSuccess(s.ServerResponse.NoContent):t.onError(l.TypeScriptServerError.create(this._serverId,this._version,e)))}executeImpl(e,t,n){const r=this._requestQueue.createRequest(e,t),i={request:r,expectsResponse:n.expectsResult,isAsync:n.isAsync,queueingType:h.getQueueingType(e,n.lowPriority)};let s;return n.expectsResult&&(s=new Promise((t,i)=>{this._callbacks.add(r.seq,{onSuccess:t,onError:i,startTime:Date.now(),isAsync:n.isAsync},n.isAsync),n.token&&n.token.onCancellationRequested(()=>{this.tryCancelRequest(r.seq,e)})}).catch(e=>{throw e instanceof l.TypeScriptServerError&&(n.token&&n.token.isCancellationRequested||this._telemetryReporter.logTelemetry("languageServiceErrorResponse",{command:e.serverCommand,message:e.serverMessage||"",stack:e.serverStack||"",errortext:e.serverErrorText||""})),e})),this._requestQueue.enqueue(i),this.sendNextRequests(),s}sendNextRequests(){for(;0===this._pendingResponses.size&&this._requestQueue.length>0;){const e=this._requestQueue.dequeue();e&&this.sendRequest(e)}}sendRequest(e){const t=e.request;this._tracer.traceRequest(this._serverId,t,e.expectsResponse,this._requestQueue.length),e.expectsResponse&&!e.isAsync&&this._pendingResponses.add(e.request.seq);try{this.write(t)}catch(e){const n=this.fetchCallback(t.seq);n&&n.onError(e)}}fetchCallback(e){const t=this._callbacks.fetch(e);if(t)return this._pendingResponses.delete(e),t}logTrace(e){this._tracer.logTrace(this._serverId,e)}static getQueueingType(e,t){return h.fenceCommands.has(e)?u.RequestQueueingType.Fence:t?u.RequestQueueingType.LowPriority:u.RequestQueueingType.Normal}}t.ProcessBasedTsServer=h,h.fenceCommands=new Set(["change","close","open","updateOpen"]);class p extends o.Disposable{constructor(e,t){super(),this.syntaxServer=e,this.semanticServer=t,this._onEvent=this._register(new i.EventEmitter),this.onEvent=this._onEvent.event,this._onExit=this._register(new i.EventEmitter),this.onExit=this._onExit.event,this._onError=this._register(new i.EventEmitter),this.onError=this._onError.event,this._register(e.onEvent(e=>this._onEvent.fire(e))),this._register(t.onEvent(e=>this._onEvent.fire(e))),this._register(t.onExit(e=>{this._onExit.fire(e),this.syntaxServer.kill()})),this._register(t.onError(e=>this._onError.fire(e)))}get onReaderError(){return this.semanticServer.onReaderError}get tsServerLogFile(){return this.semanticServer.tsServerLogFile}kill(){this.syntaxServer.kill(),this.semanticServer.kill()}executeImpl(e,t,n){if(p.syntaxCommands.has(e))return this.syntaxServer.executeImpl(e,t,n);if(p.sharedCommands.has(e)){let r=!1,s=!1,o=void 0;if(n.token){const e=new i.CancellationTokenSource;n.token.onCancellationRequested(()=>{r&&!s||s&&!r||e.cancel()}),o=e.token}const a=this.semanticServer.executeImpl(e,t,{...n,token:o});a&&a.finally(()=>{s=!0});const c=this.syntaxServer.executeImpl(e,t,{...n,token:o});return c&&c.finally(()=>{r=!0}),c}return this.semanticServer.executeImpl(e,t,n)}}t.SyntaxRoutingTsServer=p,p.syntaxCommands=new Set(["navtree","getOutliningSpans","jsxClosingTag","selectionRange","format","formatonkey","docCommentTemplate"]),p.sharedCommands=new Set(["change","close","open","updateOpen","configure","configurePlugin"])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(6),s=8192,o=Buffer.byteLength("Content-Length: ","utf8"),a=Buffer.from(" ","utf8")[0],c=Buffer.from("\r","utf8")[0],u=Buffer.from("\n","utf8")[0];class l{constructor(){this.index=0,this.buffer=Buffer.allocUnsafe(s)}append(e){let t=null;if(t=Buffer.isBuffer(e)?e:Buffer.from(e,"utf8"),this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{let e=(Math.ceil((this.index+t.length)/s)+1)*s;0===this.index?(this.buffer=Buffer.allocUnsafe(e),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],e)}this.index+=t.length}tryReadContentLength(){let e=-1,t=0;for(;t<this.index&&(this.buffer[t]===a||this.buffer[t]===c||this.buffer[t]===u);)t++;if(this.index<t+o)return e;let n=t+=o;for(;t<this.index&&this.buffer[t]!==c;)t++;if(t+3>=this.index||this.buffer[t+1]!==u||this.buffer[t+2]!==c||this.buffer[t+3]!==u)return e;let r=this.buffer.toString("utf8",n,t);return e=parseInt(r),this.buffer=this.buffer.slice(t+4),this.index=this.index-(t+4),e}tryReadContent(e){if(this.index<e)return null;let t=this.buffer.toString("utf8",0,e),n=e;for(;n<this.index&&(this.buffer[n]===c||this.buffer[n]===u);)n++;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,t}}t.Reader=class extends i.Disposable{constructor(e){super(),this.buffer=new l,this.nextMessageLength=-1,this._onError=this._register(new r.EventEmitter),this.onError=this._onError.event,this._onData=this._register(new r.EventEmitter),this.onData=this._onData.event,e.on("data",e=>this.onLengthData(e))}onLengthData(e){if(!this.isDisposed)try{for(this.buffer.append(e);;){if(-1===this.nextMessageLength&&(this.nextMessageLength=this.buffer.tryReadContentLength(),-1===this.nextMessageLength))return;const e=this.buffer.tryReadContent(this.nextMessageLength);if(null===e)return;this.nextMessageLength=-1;const t=JSON.parse(e);this._onData.fire(t)}}catch(e){this._onError.fire(e)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(55);t.CallbackMap=class{constructor(){this._callbacks=new Map,this._asyncCallbacks=new Map}destroy(e){const t=new r.ServerResponse.Cancelled(e);for(const e of this._callbacks.values())e.onSuccess(t);this._callbacks.clear();for(const e of this._asyncCallbacks.values())e.onSuccess(t);this._asyncCallbacks.clear()}add(e,t,n){n?this._asyncCallbacks.set(e,t):this._callbacks.set(e,t)}fetch(e){const t=this._callbacks.get(e)||this._asyncCallbacks.get(e);return this.delete(e),t}delete(e){this._callbacks.delete(e)||this._asyncCallbacks.delete(e)}}},function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Normal=1]="Normal",e[e.LowPriority=2]="LowPriority",e[e.Fence=3]="Fence"}(r=t.RequestQueueingType||(t.RequestQueueingType={}));t.RequestQueue=class{constructor(){this.queue=[],this.sequenceNumber=0}get length(){return this.queue.length}enqueue(e){if(e.queueingType===r.Normal){let t=this.queue.length-1;for(;t>=0&&this.queue[t].queueingType===r.LowPriority;)--t;this.queue.splice(t+1,0,e)}else this.queue.push(e)}dequeue(){return this.queue.shift()}tryDeletePendingRequest(e){for(let t=0;t<this.queue.length;t++)if(this.queue[t].request.seq===e)return this.queue.splice(t,1),!0;return!1}createRequest(e,t){return{seq:this.sequenceNumber++,type:"request",command:e,arguments:t}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(41);class i extends Error{constructor(e,t,n,r,i){super(`<${e}> TypeScript Server Error (${t.versionString})\n${r}\n${i}`),this.response=n,this.serverMessage=r,this.serverStack=i}static create(e,t,n){const r=i.parseErrorText(t,n);return new i(e,t,n,r?r.message:void 0,r?r.stack:void 0)}get serverErrorText(){return this.response.message}get serverCommand(){return this.response.command}static parseErrorText(e,t){const n=t.message;if(n){const t="Error processing request. ";if(n.startsWith(t)){let r=n.substr(t.length);r.indexOf("Could not find sourceFile")>=0&&(r=r.replace(/ in \[[^\]]*\]/g,""));const s=r.indexOf("\n");if(s>=0)return{message:r.substring(0,s),stack:i.normalizeMessageStack(e,r.substring(s+1))}}}}static normalizeMessageStack(e,t){return t?t.replace(new RegExp(`${r.escapeRegExp(e.path)}[/\\\\]tsserver.js:`,"gi"),"tsserver.js:"):""}}t.TypeScriptServerError=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(6),o=i.loadMessageBundle(n(1).join(__dirname,"utils/typingsStatus.ts")),a=3e4;t.default=class extends s.Disposable{constructor(e){super(),this._acquiringTypings=Object.create({}),this._subscriptions=[],this._client=e,this._subscriptions.push(this._client.onDidBeginInstallTypings(e=>this.onBeginInstallTypings(e.eventId))),this._subscriptions.push(this._client.onDidEndInstallTypings(e=>this.onEndInstallTypings(e.eventId)))}dispose(){super.dispose(),this._subscriptions.forEach(e=>e.dispose());for(const e of Object.keys(this._acquiringTypings))clearTimeout(this._acquiringTypings[e])}get isAcquiringTypings(){return Object.keys(this._acquiringTypings).length>0}onBeginInstallTypings(e){this._acquiringTypings[e]||(this._acquiringTypings[e]=setTimeout(()=>{this.onEndInstallTypings(e)},a))}onEndInstallTypings(e){const t=this._acquiringTypings[e];t&&clearTimeout(t),delete this._acquiringTypings[e]}};t.AtaProgressReporter=class{constructor(e){this._promises=new Map,this._disposable=r.Disposable.from(e.onDidBeginInstallTypings(e=>this._onBegin(e.eventId)),e.onDidEndInstallTypings(e=>this._onEndOrTimeout(e.eventId)),e.onTypesInstallerInitializationFailed(e=>this.onTypesInstallerInitializationFailed()))}dispose(){this._disposable.dispose(),this._promises.forEach(e=>e())}_onBegin(e){const t=setTimeout(()=>this._onEndOrTimeout(e),a),n=new Promise(n=>{this._promises.set(e,()=>{clearTimeout(t),n()})});r.window.withProgress({location:r.ProgressLocation.Window,title:o(0,null)},()=>n)}_onEndOrTimeout(e){const t=this._promises.get(e);t&&(this._promises.delete(e),t())}onTypesInstallerInitializationFailed(){r.workspace.getConfiguration("typescript").get("check.npmIsInstalled",!0)&&r.window.showWarningMessage(o(1,null,"https://go.microsoft.com/fwlink/?linkid=847635"),{title:o(2,null),id:1}).then(e=>{if(e)switch(e.id){case 1:r.workspace.getConfiguration("typescript").update("check.npmIsInstalled",!1,!0)}})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(14),s=n(6),o=n(3).loadMessageBundle(n(1).join(__dirname,"utils/versionStatus.ts"));t.default=class extends s.Disposable{constructor(e){super(),this._normalizePath=e,this._versionBarEntry=this._register(r.window.createStatusBarItem({id:"status.typescript.version",name:o(0,null),alignment:r.StatusBarAlignment.Right,priority:99})),r.window.onDidChangeActiveTextEditor(this.showHideStatus,this,this._disposables)}onDidChangeTypeScriptVersion(e){this.showHideStatus(),this._versionBarEntry.text=e.versionString,this._versionBarEntry.tooltip=e.path,this._versionBarEntry.command="typescript.selectTypeScriptVersion"}showHideStatus(){if(!r.window.activeTextEditor)return void this._versionBarEntry.hide();const e=r.window.activeTextEditor.document;r.languages.match([i.typescript,i.typescriptreact],e)?this._normalizePath(e.uri)?this._versionBarEntry.show():this._versionBarEntry.hide():r.window.activeTextEditor.viewColumn&&this._versionBarEntry.hide()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5),i=n(1),s=n(0),o=n(3),a=n(4),c=n(16),u=n(8),l=n(6),h=n(19),p=n(14),d=n(2),f=o.loadMessageBundle(n(1).join(__dirname,"features/updatePathsOnRename.ts")),g="updateImportsOnFileMove.enabled";class m extends l.Disposable{constructor(e,t,n){super(),this.client=e,this.fileConfigurationManager=t,this._handles=n,this._register(s.workspace.onDidRenameFile(e=>{s.window.withProgress({location:s.ProgressLocation.Window,title:f(0,null)},()=>this.doRename(e.oldUri,e.newUri))}))}async doRename(e,t){const n=await this.getJsTsFileBeingMoved(t);if(!n||!this.client.toPath(n))return;const r=this.client.toPath(t);if(!r)return;const i=this.client.toPath(e);if(!i)return;const o=await s.workspace.openTextDocument(n);if("never"===this.getConfiguration(o).get(g))return;this.client.bufferSyncSupport.closeResource(e),this.client.bufferSyncSupport.openTextDocument(o);const a=await this.getEditsForFileRename(o,i,r);a&&a.size&&await this.confirmActionWithUser(t,o)&&await s.workspace.applyEdit(a)}async confirmActionWithUser(e,t){switch(this.getConfiguration(t).get(g)){case"always":return!0;case"never":return!1;case"prompt":default:return this.promptUser(e,t)}}getConfiguration(e){return s.workspace.getConfiguration(p.isTypeScriptDocument(e)?"typescript":"javascript",e.uri)}async promptUser(e,t){const n=await s.window.showInformationMessage(f(1,null,i.basename(e.fsPath)),{modal:!0},{title:f(2,null),choice:2,isCloseAffordance:!0},{title:f(3,null),choice:1},{title:f(4,null),choice:3},{title:f(5,null),choice:4});if(!n)return!1;switch(n.choice){case 1:return!0;case 2:return!1;case 3:return this.getConfiguration(t).update(g,"always",s.ConfigurationTarget.Global),!0;case 4:return this.getConfiguration(t).update(g,"never",s.ConfigurationTarget.Global),!1}return!1}async getJsTsFileBeingMoved(e){if(e.scheme===h.file){if(await function(e){return new Promise((t,n)=>{r.stat(e,(e,r)=>e?n(e):t(r.isDirectory()))})}(e.fsPath)){return(await s.workspace.findFiles({base:e.fsPath,pattern:"**/*.{ts,tsx,js,jsx}"},"**/node_modules/**",1))[0]}return await this._handles(e)?e:void 0}}async getEditsForFileRename(e,t,n){const r=await this.client.interruptGetErr(()=>{this.fileConfigurationManager.setGlobalConfigurationFromDocument(e,c.nulToken);const r={oldFilePath:t,newFilePath:n};return this.client.execute("getEditsForFileRename",r,c.nulToken)});if("response"===r.type&&r.body)return d.WorkspaceEdit.fromFileCodeEdits(this.client,r.body)}}m.minVersion=a.default.v300,t.register=function(e,t,n){return new u.VersionDependentRegistration(e,m.minVersion,()=>new m(e,t,n))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(2);function s(e){switch(e.kind){case"method":return r.SymbolKind.Method;case"enum":return r.SymbolKind.Enum;case"function":return r.SymbolKind.Function;case"class":return r.SymbolKind.Class;case"interface":return r.SymbolKind.Interface;case"var":default:return r.SymbolKind.Variable}}class o{constructor(e,t){this.client=e,this.modeIds=t}async provideWorkspaceSymbols(e,t){const n=this.getDocument();if(!n)return[];const a=this.client.toOpenedFilePath(n);if(!a)return[];const c={file:a,searchValue:e},u=await this.client.execute("navto",c,t);if("response"!==u.type||!u.body)return[];const l=[];for(const e of u.body){if(!e.containerName&&"alias"===e.kind)continue;const t=o.getLabel(e);l.push(new r.SymbolInformation(t,s(e),e.containerName||"",i.Location.fromTextSpan(this.client.toResource(e.file),e)))}return l}static getLabel(e){let t=e.name;return"method"!==e.kind&&"function"!==e.kind||(t+="()"),t}getDocument(){const e=r.window.activeTextEditor;if(e){const t=e.document;if(t&&this.modeIds.indexOf(t.languageId)>=0)return t}const t=r.workspace.textDocuments;for(const e of t)if(this.modeIds.indexOf(e.languageId)>=0)return e}}t.register=function(e,t){return r.languages.registerWorkspaceSymbolProvider(new o(e,t))}},function(e,t,n){e.exports=p,p.sync=v;var r=n(33),i=n(1),s=n(5),o=n(56),a=parseInt("666",8),c={nosort:!0,silent:!0},u=0,l="win32"===process.platform;function h(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(function(t){e[t]=e[t]||s[t],e[t+="Sync"]=e[t]||s[t]}),e.maxBusyTries=e.maxBusyTries||3,e.emfileWait=e.emfileWait||1e3,!1===e.glob&&(e.disableGlob=!0),e.disableGlob=e.disableGlob||!1,e.glob=e.glob||c}function p(e,t,n){"function"==typeof t&&(n=t,t={}),r(e,"rimraf: missing path"),r.equal(typeof e,"string","rimraf: path should be a string"),r.equal(typeof n,"function","rimraf: callback function required"),r(t,"rimraf: invalid options argument provided"),r.equal(typeof t,"object","rimraf: options should be object"),h(t);var i=0,s=null,a=0;if(t.disableGlob||!o.hasMagic(e))return c(null,[e]);function c(e,r){return e?n(e):0===(a=r.length)?n():void r.forEach(function(e){d(e,t,function r(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&i<t.maxBusyTries)return i++,setTimeout(function(){d(e,t,r)},100*i);if("EMFILE"===o.code&&u<t.emfileWait)return setTimeout(function(){d(e,t,r)},u++);"ENOENT"===o.code&&(o=null)}u=0,function(e){s=s||e,0==--a&&n(s)}(o)})})}t.lstat(e,function(n,r){if(!n)return c(null,[e]);o(e,t.glob,c)})}function d(e,t,n){r(e),r(t),r("function"==typeof n),t.lstat(e,function(r,i){return r&&"ENOENT"===r.code?n(null):(r&&"EPERM"===r.code&&l&&f(e,t,r,n),i&&i.isDirectory()?m(e,t,r,n):void t.unlink(e,function(r){if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return l?f(e,t,r,n):m(e,t,r,n);if("EISDIR"===r.code)return m(e,t,r,n)}return n(r)}))})}function f(e,t,n,i){r(e),r(t),r("function"==typeof i),n&&r(n instanceof Error),t.chmod(e,a,function(r){r?i("ENOENT"===r.code?null:n):t.stat(e,function(r,s){r?i("ENOENT"===r.code?null:n):s.isDirectory()?m(e,t,n,i):t.unlink(e,i)})})}function g(e,t,n){r(e),r(t),n&&r(n instanceof Error);try{t.chmodSync(e,a)}catch(e){if("ENOENT"===e.code)return;throw n}try{var i=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}i.isDirectory()?y(e,t,n):t.unlinkSync(e)}function m(e,t,n,s){r(e),r(t),n&&r(n instanceof Error),r("function"==typeof s),t.rmdir(e,function(o){!o||"ENOTEMPTY"!==o.code&&"EEXIST"!==o.code&&"EPERM"!==o.code?o&&"ENOTDIR"===o.code?s(n):s(o):function(e,t,n){r(e),r(t),r("function"==typeof n),t.readdir(e,function(r,s){if(r)return n(r);var o,a=s.length;if(0===a)return t.rmdir(e,n);s.forEach(function(r){p(i.join(e,r),t,function(r){if(!o)return r?n(o=r):void(0==--a&&t.rmdir(e,n))})})})}(e,t,s)})}function v(e,t){var n;if(h(t=t||{}),r(e,"rimraf: missing path"),r.equal(typeof e,"string","rimraf: path should be a string"),r(t,"rimraf: missing options"),r.equal(typeof t,"object","rimraf: options should be object"),t.disableGlob||!o.hasMagic(e))n=[e];else try{t.lstatSync(e),n=[e]}catch(r){n=o.sync(e,t.glob)}if(n.length)for(var i=0;i<n.length;i++){e=n[i];try{var s=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&l&&g(e,t,n)}try{s&&s.isDirectory()?y(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return l?g(e,t,n):y(e,t,n);if("EISDIR"!==n.code)throw n;y(e,t,n)}}}function y(e,t,n){r(e),r(t),n&&r(n instanceof Error);try{t.rmdirSync(e)}catch(s){if("ENOENT"===s.code)return;if("ENOTDIR"===s.code)throw n;"ENOTEMPTY"!==s.code&&"EEXIST"!==s.code&&"EPERM"!==s.code||function(e,t){r(e),r(t),t.readdirSync(e).forEach(function(n){v(i.join(e,n),t)});var n=l?100:1,s=0;for(;;){var o=!0;try{var a=t.rmdirSync(e,t);return o=!1,a}finally{if(++s<n&&o)continue}}}(e,t)}}},function(e,t,n){var r=n(1),i="win32"===process.platform,s=n(5),o=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function a(e){return"function"==typeof e?e:function(){var e;if(o){var t=new Error;e=function(e){e&&(t.message=e.message,n(e=t))}}else e=n;return e;function n(e){if(e){if(process.throwDeprecation)throw e;if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);process.traceDeprecation?console.trace(t):console.error(t)}}}}()}r.normalize;if(i)var c=/(.*?)(?:[\/\\]+|$)/g;else c=/(.*?)(?:[\/]+|$)/g;if(i)var u=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else u=/^[\/]*/;t.realpathSync=function(e,t){if(e=r.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var n,o,a,l,h=e,p={},d={};function f(){var t=u.exec(e);n=t[0].length,o=t[0],a=t[0],l="",i&&!d[a]&&(s.lstatSync(a),d[a]=!0)}for(f();n<e.length;){c.lastIndex=n;var g=c.exec(e);if(l=o,o+=g[0],a=l+g[1],n=c.lastIndex,!(d[a]||t&&t[a]===a)){var m;if(t&&Object.prototype.hasOwnProperty.call(t,a))m=t[a];else{var v=s.lstatSync(a);if(!v.isSymbolicLink()){d[a]=!0,t&&(t[a]=a);continue}var y=null;if(!i){var b=v.dev.toString(32)+":"+v.ino.toString(32);p.hasOwnProperty(b)&&(y=p[b])}null===y&&(s.statSync(a),y=s.readlinkSync(a)),m=r.resolve(l,y),t&&(t[a]=m),i||(p[b]=y)}e=r.resolve(m,e.slice(n)),f()}}return t&&(t[h]=e),e},t.realpath=function(e,t,n){if("function"!=typeof n&&(n=a(t),t=null),e=r.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(n.bind(null,null,t[e]));var o,l,h,p,d=e,f={},g={};function m(){var t=u.exec(e);o=t[0].length,l=t[0],h=t[0],p="",i&&!g[h]?s.lstat(h,function(e){if(e)return n(e);g[h]=!0,v()}):process.nextTick(v)}function v(){if(o>=e.length)return t&&(t[d]=e),n(null,e);c.lastIndex=o;var r=c.exec(e);return p=l,l+=r[0],h=p+r[1],o=c.lastIndex,g[h]||t&&t[h]===h?process.nextTick(v):t&&Object.prototype.hasOwnProperty.call(t,h)?_(t[h]):s.lstat(h,y)}function y(e,r){if(e)return n(e);if(!r.isSymbolicLink())return g[h]=!0,t&&(t[h]=h),process.nextTick(v);if(!i){var o=r.dev.toString(32)+":"+r.ino.toString(32);if(f.hasOwnProperty(o))return b(null,f[o],h)}s.stat(h,function(e){if(e)return n(e);s.readlink(h,function(e,t){i||(f[o]=t),b(e,t)})})}function b(e,i,s){if(e)return n(e);var o=r.resolve(p,i);t&&(t[s]=o),_(o)}function _(t){e=r.resolve(t,e.slice(o)),m()}m()}},function(e,t,n){var r=n(185),i=n(186);e.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return function e(t,n){var s=[];var o=i("{","}",t);if(!o||/\$$/.test(o.pre))return[t];var c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body);var u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body);var h=c||u;var m=o.body.indexOf(",")>=0;if(!h&&!m)return o.post.match(/,.*\}/)?(t=o.pre+"{"+o.body+a+o.post,e(t)):[t];var v;if(h)v=o.body.split(/\.\./);else if(1===(v=function e(t){if(!t)return[""];var n=[];var r=i("{","}",t);if(!r)return t.split(",");var s=r.pre;var o=r.body;var a=r.post;var c=s.split(",");c[c.length-1]+="{"+o+"}";var u=e(a);a.length&&(c[c.length-1]+=u.shift(),c.push.apply(c,u));n.push.apply(n,c);return n}(o.body)).length&&1===(v=e(v[0],!1).map(p)).length){var y=o.post.length?e(o.post,!1):[""];return y.map(function(e){return o.pre+v[0]+e})}var b=o.pre;var y=o.post.length?e(o.post,!1):[""];var _;if(h){var w=l(v[0]),S=l(v[1]),C=Math.max(v[0].length,v[1].length),k=3==v.length?Math.abs(l(v[2])):1,T=f,x=S<w;x&&(k*=-1,T=g);var E=v.some(d);_=[];for(var P=w;T(P,S);P+=k){var I;if(u)"\\"===(I=String.fromCharCode(P))&&(I="");else if(I=String(P),E){var O=C-I.length;if(O>0){var A=new Array(O+1).join("0");I=P<0?"-"+A+I.slice(1):A+I}}_.push(I)}}else _=r(v,function(t){return e(t,!1)});for(var D=0;D<_.length;D++)for(var R=0;R<y.length;R++){var j=b+_[D]+y[R];(!n||h||j)&&s.push(j)}return s}(function(e){return e.split("\\\\").join(s).split("\\{").join(o).split("\\}").join(a).split("\\,").join(c).split("\\.").join(u)}(e),!0).map(h)};var s="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",a="\0CLOSE"+Math.random()+"\0",c="\0COMMA"+Math.random()+"\0",u="\0PERIOD"+Math.random()+"\0";function l(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function h(e){return e.split(s).join("\\").split(o).join("{").split(a).join("}").split(c).join(",").split(u).join(".")}function p(e){return"{"+e+"}"}function d(e){return/^-?0\d/.test(e)}function f(e,t){return e<=t}function g(e,t){return e>=t}},function(e,t){e.exports=function(e,t){for(var r=[],i=0;i<e.length;i++){var s=t(e[i],i);n(s)?r.push.apply(r,s):r.push(s)}return r};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,n){"use strict";function r(e,t,n){e instanceof RegExp&&(e=i(e,n)),t instanceof RegExp&&(t=i(t,n));var r=s(e,t,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+e.length,r[1]),post:n.slice(r[1]+t.length)}}function i(e,t){var n=t.match(e);return n?n[0]:null}function s(e,t,n){var r,i,s,o,a,c=n.indexOf(e),u=n.indexOf(t,c+1),l=c;if(c>=0&&u>0){for(r=[],s=n.length;l>=0&&!a;)l==c?(r.push(l),c=n.indexOf(e,l+1)):1==r.length?a=[r.pop(),u]:((i=r.pop())<s&&(s=i,o=u),u=n.indexOf(t,l+1)),l=c<u&&c>=0?c:u;r.length&&(a=[s,o])}return a}e.exports=r,r.range=s},function(e,t,n){try{var r=n(35);if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(t){e.exports=n(188)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){e.exports=f,f.GlobSync=g;var r=n(5),i=n(57),s=n(34),o=(s.Minimatch,n(56).Glob,n(35),n(1)),a=n(33),c=n(36),u=n(58),l=(u.alphasort,u.alphasorti,u.setopts),h=u.ownProp,p=u.childrenIgnored,d=u.isIgnored;function f(e,t){if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new g(e,t).found}function g(e,t){if(!e)throw new Error("must provide pattern");if("function"==typeof t||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof g))return new g(e,t);if(l(this,e,t),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var r=0;r<n;r++)this._process(this.minimatch.set[r],r,!1);this._finish()}g.prototype._finish=function(){if(a(this instanceof g),this.realpath){var e=this;this.matches.forEach(function(t,n){var r=e.matches[n]=Object.create(null);for(var s in t)try{s=e._makeAbs(s),r[i.realpathSync(s,e.realpathCache)]=!0}catch(t){if("stat"!==t.syscall)throw t;r[e._makeAbs(s)]=!0}})}u.finish(this)},g.prototype._process=function(e,t,n){a(this instanceof g);for(var r,i=0;"string"==typeof e[i];)i++;switch(i){case e.length:return void this._processSimple(e.join("/"),t);case 0:r=null;break;default:r=e.slice(0,i).join("/")}var o,u=e.slice(i);null===r?o=".":c(r)||c(e.join("/"))?(r&&c(r)||(r="/"+r),o=r):o=r;var l=this._makeAbs(o);p(this,o)||(u[0]===s.GLOBSTAR?this._processGlobStar(r,o,l,u,t,n):this._processReaddir(r,o,l,u,t,n))},g.prototype._processReaddir=function(e,t,n,r,i,s){var a=this._readdir(n,s);if(a){for(var c=r[0],u=!!this.minimatch.negate,l=c._glob,h=this.dot||"."===l.charAt(0),p=[],d=0;d<a.length;d++){if("."!==(m=a[d]).charAt(0)||h)(u&&!e?!m.match(c):m.match(c))&&p.push(m)}var f=p.length;if(0!==f)if(1!==r.length||this.mark||this.stat){r.shift();for(d=0;d<f;d++){var g;m=p[d];g=e?[e,m]:[m],this._process(g.concat(r),i,s)}}else{this.matches[i]||(this.matches[i]=Object.create(null));for(var d=0;d<f;d++){var m=p[d];e&&(m="/"!==e.slice(-1)?e+"/"+m:e+m),"/"!==m.charAt(0)||this.nomount||(m=o.join(this.root,m)),this._emitMatch(i,m)}}}},g.prototype._emitMatch=function(e,t){if(!d(this,t)){var n=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=n),!this.matches[e][t]){if(this.nodir){var r=this.cache[n];if("DIR"===r||Array.isArray(r))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}},g.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,n;try{n=r.lstatSync(e)}catch(e){if("ENOENT"===e.code)return null}var i=n&&n.isSymbolicLink();return this.symlinks[e]=i,i||!n||n.isDirectory()?t=this._readdir(e,!1):this.cache[e]="FILE",t},g.prototype._readdir=function(e,t){if(t&&!h(this.symlinks,e))return this._readdirInGlobStar(e);if(h(this.cache,e)){var n=this.cache[e];if(!n||"FILE"===n)return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,r.readdirSync(e))}catch(t){return this._readdirError(e,t),null}},g.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var r=t[n];r="/"===e?e+r:e+"/"+r,this.cache[r]=!0}return this.cache[e]=t,t},g.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var r=new Error(t.code+" invalid cwd "+this.cwd);throw r.path=this.cwd,r.code=t.code,r}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t)}},g.prototype._processGlobStar=function(e,t,n,r,i,s){var o=this._readdir(n,s);if(o){var a=r.slice(1),c=e?[e]:[],u=c.concat(a);this._process(u,i,!1);var l=o.length;if(!this.symlinks[n]||!s)for(var h=0;h<l;h++){if("."!==o[h].charAt(0)||this.dot){var p=c.concat(o[h],a);this._process(p,i,!0);var d=c.concat(o[h],r);this._process(d,i,!0)}}}},g.prototype._processSimple=function(e,t){var n=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),n){if(e&&c(e)&&!this.nomount){var r=/[\/\\]$/.test(e);"/"===e.charAt(0)?e=o.join(this.root,e):(e=o.resolve(this.root,e),r&&(e+="/"))}"win32"===process.platform&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}},g.prototype._stat=function(e){var t=this._makeAbs(e),n="/"===e.slice(-1);if(e.length>this.maxLength)return!1;if(!this.stat&&h(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return i;if(n&&"FILE"===i)return!1}var s=this.statCache[t];if(!s){var o;try{o=r.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(o&&o.isSymbolicLink())try{s=r.statSync(t)}catch(e){s=o}else s=o}this.statCache[t]=s;i=!0;return s&&(i=s.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||i,(!n||"FILE"!==i)&&i},g.prototype._mark=function(e){return u.mark(this,e)},g.prototype._makeAbs=function(e){return u.makeAbs(this,e)}},function(e,t,n){var r=n(59),i=Object.create(null),s=n(60);e.exports=r(function(e,t){return i[e]?(i[e].push(t),null):(i[e]=[t],function(e){return s(function t(){var n=i[e],r=n.length,s=function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r]=e[r];return n}(arguments);try{for(var o=0;o<r;o++)n[o].apply(null,s)}finally{n.length>r?(n.splice(0,r),process.nextTick(function(){t.apply(null,s)})):delete i[e]}})}(e))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);t.CommandManager=class{constructor(){this.commands=new Map}dispose(){for(const e of this.commands.values())e.dispose();this.commands.clear()}register(e){for(const t of Array.isArray(e.id)?e.id:[e.id])this.registerCommand(t,e.execute,e);return e}registerCommand(e,t,n){this.commands.has(e)||this.commands.set(e,r.commands.registerCommand(e,t,n))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e){this._getValue=e,this._hasValue=!1}get value(){return this._hasValue||(this._hasValue=!0,this._value=this._getValue()),this._value}get hasValue(){return this._hasValue}map(e){return new r(()=>e(this.value))}}t.lazy=function(e){return new r(e)}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0});const i=n(5),s=n(1),o=n(11);class a{constructor(e){this.context=e}getNewLogDirectory(){const e=this.logDirectory();if(e)try{return i.mkdtempSync(s.join(e,"tsserver-log-"))}catch(e){return}}logDirectory(){try{const e=this.context.logPath;return i.existsSync(e)||i.mkdirSync(e),this.context.logPath}catch(e){return}}}r([o.memoize],a.prototype,"logDirectory",null),t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(6),s=n(37),o=n(14);class a extends i.Disposable{constructor(e){super(),this.normalizePath=e,this.isInManagedFileContext=!1,r.window.onDidChangeActiveTextEditor(this.onDidChangeActiveTextEditor,this,this._disposables),this.onDidChangeActiveTextEditor(r.window.activeTextEditor)}onDidChangeActiveTextEditor(e){e&&this.updateContext(this.isManagedFile(e))}updateContext(e){e!==this.isInManagedFileContext&&(r.commands.executeCommand("setContext",a.contextName,e),this.isInManagedFileContext=e)}isManagedFile(e){return this.isManagedScriptFile(e)||this.isManagedConfigFile(e)}isManagedScriptFile(e){return o.isSupportedLanguageMode(e.document)&&null!==this.normalizePath(e.document.uri)}isManagedConfigFile(e){return s.isJsConfigOrTsConfigFileName(e.document.fileName)}}t.default=a,a.contextName="typescript.isManagedFile"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(15),s=n(6);var o;!function(e){e.equals=function(e,t){return e.path===t.path&&e.name===t.name&&e.enableForWorkspaceTypeScriptVersions===t.enableForWorkspaceTypeScriptVersions&&i.equals(e.languages,t.languages)}}(o||(o={}));t.PluginManager=class extends s.Disposable{constructor(){super(),this._pluginConfigurations=new Map,this._onDidUpdatePlugins=this._register(new r.EventEmitter),this.onDidChangePlugins=this._onDidUpdatePlugins.event,this._onDidUpdateConfig=this._register(new r.EventEmitter),this.onDidUpdateConfig=this._onDidUpdateConfig.event,r.extensions.onDidChange(()=>{if(!this._plugins)return;const e=this.readPlugins();i.equals(i.flatten(Array.from(this._plugins.values())),i.flatten(Array.from(e.values())),o.equals)||(this._plugins=e,this._onDidUpdatePlugins.fire(this))},void 0,this._disposables)}get plugins(){return this._plugins||(this._plugins=this.readPlugins()),i.flatten(Array.from(this._plugins.values()))}setConfiguration(e,t){this._pluginConfigurations.set(e,t),this._onDidUpdateConfig.fire({pluginId:e,config:t})}configurations(){return this._pluginConfigurations.entries()}readPlugins(){const e=new Map;for(const t of r.extensions.all){const n=t.packageJSON;if(n.contributes&&Array.isArray(n.contributes.typescriptServerPlugins)){const r=[];for(const e of n.contributes.typescriptServerPlugins)r.push({name:e.name,enableForWorkspaceTypeScriptVersions:!!e.enableForWorkspaceTypeScriptVersions,path:t.extensionPath,languages:Array.isArray(e.languages)?e.languages:[]});r.length&&e.set(t.id,r)}}return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),i=n(3),s=n(22),o=i.loadMessageBundle(n(1).join(__dirname,"utils/projectStatus.ts"));class a{constructor(e){this.telemetryReporter=e,this._item=r.window.createStatusBarItem({id:"status.typescript.exclude",name:o(0,null),alignment:r.StatusBarAlignment.Right,priority:98}),this._item.command="js.projectStatus.command"}getCurrentHint(){return this._currentHint}hide(){this._item.hide()}show(e){this._currentHint={message:e?o(1,null,e):o(2,null)},this._item.tooltip=this._currentHint.message,this._item.text=o(3,null),this._item.tooltip=o(4,null),this._item.color="#A5DF3B",this._item.show(),this.telemetryReporter.logTelemetry("js.hintProjectExcludes")}}function c(e,t){if(s.isImplicitProjectConfigFile(t)){const n=e.getWorkspaceRootForResource(r.Uri.file(t));n&&s.openOrCreateConfigFile(null!==t.match(/tsconfig\.?.*\.json/),n,e.configuration)}else r.workspace.openTextDocument(t).then(r.window.showTextDocument)}t.create=function(e,t){const n=[],i=new a(t);return n.push(r.commands.registerCommand("js.projectStatus.command",()=>{i.configFileName&&c(e,i.configFileName);let{message:t}=i.getCurrentHint();return r.window.showInformationMessage(t)})),n.push(function(e,t){return t.onProjectLanguageServiceStateChanged(n=>{if(n.languageServiceEnabled)e.hide();else{e.show();const i=n.projectName;i&&(e.configFileName=i,r.window.showWarningMessage(e.getCurrentHint().message,{title:o(5,null),index:0}).then(e=>{e&&0===e.index&&c(t,i)}))}})}(i,e)),r.Disposable.from(...n)}},function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o};Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),s=n(3),o=n(6),a=n(11),c=s.loadMessageBundle(n(1).join(__dirname,"utils/surveyor.ts")),u=[{id:"checkJs",prompt:c(0,null),globalTriggerThreshold:10,url:i.Uri.parse("https://www.surveymonkey.com/r/FH8PZQ3"),remindLaterDelayInMilliseconds:2592e5}];class l{constructor(e,t){this.data=e,this.memento=t,this._hasShownInThisSession=!1}get id(){return this.data.id}get prompt(){return this.data.prompt}get isActive(){return!this._hasShownInThisSession&&!this.memento.get(this.isCompletedMementoKey)}open(){this.markComplete(),i.commands.executeCommand("vscode.open",this.data.url)}remindLater(){this._hasShownInThisSession=!0,this.memento.update(this.lastPromptTimeMementoKey,Date.now())}trigger(){const e=this.triggerCount+1;if(this.memento.update(this.triggerCountMementoKey,e),e>=this.data.globalTriggerThreshold){const e=this.memento.get(this.lastPromptTimeMementoKey);return!(e&&!isNaN(+e))||e+this.data.remindLaterDelayInMilliseconds<Date.now()}return!1}willShow(){this._hasShownInThisSession=!0}markComplete(){this._hasShownInThisSession=!0,this.memento.update(this.isCompletedMementoKey,!0)}get triggerCount(){const e=this.memento.get(this.triggerCountMementoKey);return!e||isNaN(+e)?0:+e}getMementoKey(e){return`survey.v0.${this.id}.${e}`}get isCompletedMementoKey(){return this.getMementoKey("isComplete")}get lastPromptTimeMementoKey(){return this.getMementoKey("lastPromptTime")}get triggerCountMementoKey(){return this.getMementoKey("globalTriggerCount")}}class h extends o.Disposable{constructor(e,t){super(),this.memento=e,this._register(t.onSurveyReady(e=>this.surveyReady(e.surveyId)))}get surveys(){return new Map(u.map(e=>[e.id,new l(e,this.memento)]))}surveyReady(e){const t=this.tryGetActiveSurvey(e);t&&t.trigger()&&(t.willShow(),this.showSurveyToUser(t))}async showSurveyToUser(e){let t;!function(e){e[e.GoToSurvey=1]="GoToSurvey",e[e.RemindLater=2]="RemindLater",e[e.NeverAgain=3]="NeverAgain"}(t||(t={}));const n=await i.window.showInformationMessage(e.prompt,{title:c(1,null),choice:t.GoToSurvey},{title:c(2,null),choice:t.RemindLater},{title:c(3,null),choice:t.NeverAgain});switch(n&&n.choice){case t.GoToSurvey:e.open();break;case t.NeverAgain:e.markComplete(),this.disableSurveys();break;case t.RemindLater:default:e.remindLater()}}tryGetActiveSurvey(e){const t=this.surveys.get(e);if(t)return this.areSurveysEnabled()&&t.isActive?t:void 0}areSurveysEnabled(){return i.workspace.getConfiguration("typescript").get("surveys.enabled",!0)}disableSurveys(){i.workspace.getConfiguration("typescript").update("surveys.enabled",!1)}}r([a.memoize],h.prototype,"surveys",null),t.Surveyor=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5),i=n(61),s=n(1),o=n(0),a=n(3),c=n(37),u=n(22),l=n(199),h=a.loadMessageBundle(n(1).join(__dirname,"features/task.ts")),p=e=>new Promise((t,n)=>{r.exists(e,e=>{t(e)})});class d{constructor(e){this.client=e,this.autoDetect="on",this.disposables=[],this.tsconfigProvider=new l.default,o.workspace.onDidChangeConfiguration(this.onConfigurationChanged,this,this.disposables),this.onConfigurationChanged()}dispose(){this.disposables.forEach(e=>e.dispose())}async provideTasks(e){const t=o.workspace.workspaceFolders;if("off"===this.autoDetect||!t||!t.length)return[];const n=new Set,r=[];for(const t of await this.getAllTsConfigs(e))n.has(t.path)||(n.add(t.path),r.push(...await this.getTasksForProject(t)));return r}async resolveTask(e){const t=e.definition;if(null===/\\tsconfig.*\.json/.exec(t.tsconfig)){if(e.definition.tsconfig){if(void 0===e.scope||e.scope===o.TaskScope.Global||e.scope===o.TaskScope.Workspace)return;const t=e.definition,n=e.scope.uri.with({path:e.scope.uri.path+"/"+t.tsconfig}),r={path:n.fsPath,posixPath:n.path,workspaceFolder:e.scope};return this.getTasksForProjectAndDefinition(r,t)}}else o.window.showWarningMessage(h(0,null))}async getAllTsConfigs(e){const t=new Set,n=[...await this.getTsConfigForActiveFile(e),...await this.getTsConfigsInWorkspace()];for(const e of n)await p(e.path)&&t.add(e);return Array.from(t)}async getTsConfigForActiveFile(e){const t=o.window.activeTextEditor;if(t&&c.isTsConfigFileName(t.document.fileName)){const e=t.document.uri;return[{path:e.fsPath,posixPath:e.path,workspaceFolder:o.workspace.getWorkspaceFolder(e)}]}const n=this.getActiveTypeScriptFile();if(!n)return[];const r=await this.client.value.execute("projectInfo",{file:n,needFileNameList:!1},e);if("response"!==r.type||!r.body)return[];const{configFileName:i}=r.body;if(i&&!u.isImplicitProjectConfigFile(i)){const e=s.normalize(i),t=o.Uri.file(e),n=o.workspace.getWorkspaceFolder(t);return[{path:e,posixPath:t.path,workspaceFolder:n}]}return[]}async getTsConfigsInWorkspace(){return Array.from(await this.tsconfigProvider.getConfigsForWorkspace())}static async getCommand(e){if(e.workspaceFolder){const t=await d.getLocalTscAtPath(s.dirname(e.path));if(t)return t;const n=await d.getLocalTscAtPath(e.workspaceFolder.uri.fsPath);if(n)return n}return"tsc"}static async getLocalTscAtPath(e){const t=process.platform,n=s.join(e,"node_modules",".bin");return"win32"===t&&await p(s.join(n,"tsc.cmd"))?s.join(n,"tsc.cmd"):"linux"!==t&&"darwin"!==t||!await p(s.join(n,"tsc"))?void 0:s.join(n,"tsc")}getActiveTypeScriptFile(){const e=o.window.activeTextEditor;if(e){const t=e.document;if(t&&("typescript"===t.languageId||"typescriptreact"===t.languageId))return this.client.value.toPath(t.uri)}}getBuildTask(e,t,n,r,i){const s=new o.Task(i,e||o.TaskScope.Workspace,h(1,null,t),"tsc",new o.ShellExecution(n,r),"$tsc");return s.group=o.TaskGroup.Build,s.isBackground=!1,s}getWatchTask(e,t,n,r,i){const s=new o.Task(i,e||o.TaskScope.Workspace,h(2,null,t),"tsc",new o.ShellExecution(n,[...r,"--watch"]),"$tsc-watch");return s.group=o.TaskGroup.Build,s.isBackground=!0,s}async getTasksForProject(e){const t=await d.getCommand(e),n=await this.getBuildShellArgs(e),r=this.getLabelForTasks(e),i=[];return"build"!==this.autoDetect&&"on"!==this.autoDetect||i.push(this.getBuildTask(e.workspaceFolder,r,t,n,{type:"typescript",tsconfig:r})),"watch"!==this.autoDetect&&"on"!==this.autoDetect||i.push(this.getWatchTask(e.workspaceFolder,r,t,n,{type:"typescript",tsconfig:r,option:"watch"})),i}async getTasksForProjectAndDefinition(e,t){const n=await d.getCommand(e),r=await this.getBuildShellArgs(e),i=this.getLabelForTasks(e);let s;return void 0===t.option?s=this.getBuildTask(e.workspaceFolder,i,n,r,t):"watch"===t.option&&(s=this.getWatchTask(e.workspaceFolder,i,n,r,t)),s}getBuildShellArgs(e){const t=["-p",e.path];return new Promise(n=>{r.readFile(e.path,(r,s)=>{if(r)return n(t);try{if(i.parse(s.toString()).references)return n(["-b",e.path])}catch(e){}return n(t)})})}getLabelForTasks(e){if(e.workspaceFolder){const t=o.Uri.file(s.normalize(e.workspaceFolder.uri.fsPath));return s.posix.relative(t.path,e.posixPath)}return e.posixPath}onConfigurationChanged(){const e=o.workspace.getConfiguration("typescript.tsc").get("autoDetect");this.autoDetect=void 0===e?"on":e}}t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0);t.default=class{async getConfigsForWorkspace(){if(!r.workspace.workspaceFolders)return[];const e=new Map;for(const t of await r.workspace.findFiles("**/tsconfig*.json","**/node_modules/**")){const n=r.workspace.getWorkspaceFolder(t);n&&e.set(t.fsPath,{path:t.fsPath,posixPath:t.path,workspaceFolder:n})}return e.values()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(61),i=n(1),s=n(0),o=n(15);function a(e,t){return e&&"array"===e.type&&e.children?e.children.map(t):[]}class c{provideDocumentLinks(e,t){const n=r.parseTree(e.getText());return n?[this.getExtendsLink(e,n),...this.getFilesLinks(e,n),...this.getReferencesLinks(e,n)].filter(e=>!!e):null}getExtendsLink(e,t){const n=r.findNodeAtLocation(t,["extends"]);if(!this.isPathValue(n))return;if(n.value.startsWith("."))return new s.DocumentLink(this.getRange(e,n),s.Uri.file(i.join(i.dirname(e.uri.fsPath),n.value+(n.value.endsWith(".json")?"":".json"))));const o=s.workspace.getWorkspaceFolder(e.uri).uri.fsPath;return new s.DocumentLink(this.getRange(e,n),s.Uri.file(i.join(o,"node_modules",n.value+(n.value.endsWith(".json")?"":".json"))))}getFilesLinks(e,t){return a(r.findNodeAtLocation(t,["files"]),t=>this.pathNodeToLink(e,t))}getReferencesLinks(e,t){return a(r.findNodeAtLocation(t,["references"]),t=>{const n=r.findNodeAtLocation(t,["path"]);if(this.isPathValue(n))return new s.DocumentLink(this.getRange(e,n),i.basename(n.value).match(".json$")?this.getFileTarget(e,n):this.getFolderTarget(e,n))})}pathNodeToLink(e,t){return this.isPathValue(t)?new s.DocumentLink(this.getRange(e,t),this.getFileTarget(e,t)):void 0}isPathValue(e){return e&&"string"===e.type&&e.value&&!e.value.includes("*")}getFileTarget(e,t){return s.Uri.file(i.join(i.dirname(e.uri.fsPath),t.value))}getFolderTarget(e,t){return s.Uri.file(i.join(i.dirname(e.uri.fsPath),t.value,"tsconfig.json"))}getRange(e,t){const n=t.offset,r=e.positionAt(n+1),i=e.positionAt(n+(t.length-1));return new s.Range(r,i)}}t.register=function(){const e=["**/[jt]sconfig.json","**/[jt]sconfig.*.json"],t=o.flatten(["json","jsonc"].map(t=>e.map(e=>({language:t,pattern:e}))));return s.languages.registerDocumentLinkProvider(t,new c)}}]));
  //# sourceMappingURL=https://ticino.blob.core.windows.net/sourcemaps/6ab598523be7a800d7f3eb4d92d7ab9a66069390/extensions/typescript-language-features/dist/extension.js.map