@jsjoeio/code-server
Version:
Run VS Code on a remote server.
1 lines • 1.21 MB
JavaScript
!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=60)}([function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function i(e,t){return r.call(e,t)}function a(e){return!(e>=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function o(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var s=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,l=new RegExp(s.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),c=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,_=n(38);var d=/[&<>"]/,u=/[&<>"]/g,p={"&":"&","<":"<",">":">",'"':"""};function m(e){return p[e]}var g=/[.?*+^$[\]\\(){}|-]/g;var E=n(39);t.lib={},t.lib.mdurl=n(40),t.lib.ucmicro=n(90),t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=i,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(s,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(l,(function(e,t,n){return t||function(e,t){var n=0;return i(_,t)?_[t]:35===t.charCodeAt(0)&&c.test(t)&&a(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?o(n):e}(e,n)}))},t.isValidEntityCode=a,t.fromCodePoint=o,t.escapeHtml=function(e){return d.test(e)?e.replace(u,m):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return E.test(e)},t.escapeRE=function(e){return e.replace(g,"\\$&")},t.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}},function(e,t){e.exports=require("vscode")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(44),i=n(44);t.makePatchingRequire=i.makePatchingRequire;var a=function(e){return!0},o=function(){function e(){this.version=n(345).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=a),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=a);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(46).prototype.require=r.makePatchingRequire(global.diagnosticsSource.getPatchesObject()));t.channel=global.diagnosticsSource},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.disableErrors=!1,e.TAG="ApplicationInsights:",e}();e.exports=r},function(e,t){e.exports=require("path")},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(383)),r(n(53)),r(n(398))},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(19),a=n(21),o=n(15),s=n(403),l=n(3),c=n(16),_=function(){function e(){}return e.getCookie=function(t,n){var r="";if(t&&t.length&&"string"==typeof n)for(var i=t+"=",a=n.split(";"),o=0;o<a.length;o++){n=a[o];if((n=e.trim(n))&&0===n.indexOf(i)){r=n.substring(i.length,a[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 a=n[8+4*Math.random()|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+a+r.substr(16,3)+r.substr(19,12)},e.isValidW3CId=function(e){return 32===e.length&&"00000000000000000000000000000000"!==e},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,(i>0?i+".":"")+(r=r.length<2?"0"+r: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="",a=t[r],o=typeof a;if(e.isPrimitive(a))i=a.toString();else if(null===a||"undefined"===o)i="";else{if("function"===o){l.info("key: "+r+" was function; will not serialize");continue}var s=e.isArray(a)?a:e.extractObject(a);try{i=e.isPrimitive(s)?s:JSON.stringify(s)}catch(e){i=a.constructor.name.toString()+" (Error: "+e.message+")",l.info("key: "+r+", could not be serialized")}}n[r]=i.substring(0,e.MAX_PROPERTY_LENGTH)}return n}l.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[c.requestContextHeader];if(n)for(var r=n.split(","),i=0;i<r.length;++i){var a=r[i].split("=");if(2==a.length&&a[0]==t)return a[1]}},e.makeRequest=function(t,n,s,c){n&&0===n.indexOf("//")&&(n="https:"+n);var _=o.parse(n),d=r({},s,{host:_.hostname,port:_.port,path:_.pathname}),u=void 0;if("https:"===_.protocol&&(u=t.proxyHttpsUrl||void 0),"http:"===_.protocol&&(u=t.proxyHttpUrl||void 0),u){0===u.indexOf("//")&&(u="http:"+u);var p=o.parse(u);"https:"===p.protocol?(l.info("Proxies that use HTTPS are not supported"),u=void 0):d=r({},d,{host:p.hostname,port:p.port||"80",path:n,headers:r({},d.headers,{Host:_.hostname})})}var m="https:"===_.protocol&&!u;return m&&void 0!==t.httpsAgent?d.agent=t.httpsAgent:m||void 0===t.httpAgent?m&&(d.agent=e.tlsRestrictedAgent):d.agent=t.httpAgent,m?a.request(d,c):i.request(d,c)},e.safeIncludeCorrelationHeader=function(t,n,r){var i;if("string"==typeof r)i=r;else if(r instanceof Array)i=r.join(",");else if(r&&"function"==typeof r.toString)try{i=r.toString()}catch(e){l.warn("Outgoing request-context header could not be read. Correlation of requests may be lost.",e,r)}i?e.addCorrelationIdHeaderFromString(t,n,i):n.setHeader(c.requestContextHeader,c.requestContextSourceKey+"="+t.config.correlationId)},e.addCorrelationIdHeaderFromString=function(e,t,n){var r=n.split(","),i=c.requestContextSourceKey+"=";r.some((function(e){return e.substring(0,i.length)===i}))||t.setHeader(c.requestContextHeader,n+","+c.requestContextSourceKey+"="+e.config.correlationId)},e.MAX_PROPERTY_LENGTH=8192,e.tlsRestrictedAgent=new a.Agent({secureOptions:s.SSL_OP_NO_SSLv2|s.SSL_OP_NO_SSLv3|s.SSL_OP_NO_TLSv1|s.SSL_OP_NO_TLSv1_1}),e}();e.exports=_},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isMarkdownFile=void 0,t.isMarkdownFile=function(e){return"markdown"===e.languageId}},function(e,t,n){"use strict";var r=n(6),i=n(3),a=function(){function e(){}return e.queryCorrelationId=function(t,n){var a=t.profileQueryEndpoint+"/api/profiles/"+t.instrumentationKey+"/appId";if(e.completedLookups.hasOwnProperty(a))n(e.completedLookups[a]);else if(e.pendingLookups[a])e.pendingLookups[a].push(n);else{e.pendingLookups[a]=[n];var o=function(){if(e.pendingLookups[a]){var n={method:"GET",disableAppInsightsAutoCollection:!0};i.info(e.TAG,n);var s=r.makeRequest(t,a,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[a]=t,e.pendingLookups[a]&&e.pendingLookups[a].forEach((function(e){return e(t)})),delete e.pendingLookups[a]}))}else n.statusCode>=400&&n.statusCode<500?(e.completedLookups[a]=void 0,delete e.pendingLookups[a]):setTimeout(o,t.correlationIdRetryIntervalMs)}));s&&(s.on("error",(function(t){i.warn(e.TAG,t)})),s.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 a=e.requestIdMaxLength-9;if(t.length>a)for(;a>1;--a){var o=t[a-1];if("."===o||"_"===o)break}if(a<=1)return e.generateRootId();for(n=r.randomu32().toString(16);n.length<8;)n="0"+n;return t.substring(0,a)+n+"#"},e.TAG="CorrelationIdManager",e.correlationIdPrefix="cid-v1:",e.w3cEnabled=!1,e.pendingLookups={},e.completedLookups={},e.requestIdMaxLength=1024,e.currentRootId=r.randomu32(),e}();e.exports=a},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.Disposable=t.disposeAll=void 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){e.exports=require("os")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=n(25),a=function(){function e(){}return e.getCurrentContext=function(){if(!e.enabled)return null;var t=e.session.get(e.CONTEXT_NAME);return void 0===t?null:t},e.generateContextObject=function(e,t,n,r,i,a){return t=t||e,this.enabled?{operation:{name:n,id:e,parentId:t,traceparent:i,tracestate:a},customProperties:new o(r)}:null},e.runWithContext=function(t,n){return e.enabled?e.session.bind(n,((r={})[e.CONTEXT_NAME]=t,r))():n();var r},e.wrapEmitter=function(t){e.enabled&&e.session.bindEmitter(t)},e.wrapCallback=function(t){return e.enabled?e.session.bind(t):t},e.enable=function(t){this.enabled||(this.isNodeVersionCompatible()?(e.hasEverEnabled||(this.forceClsHooked=t,this.hasEverEnabled=!0,void 0===this.cls&&(!0===e.forceClsHooked||void 0===e.forceClsHooked&&e.shouldUseClsHooked()?this.cls=n(362):this.cls=n(374)),e.session=this.cls.createNamespace("AI-CLS-Session"),i.registerContextPreservation((function(t){return e.session.bind(t)}))),this.enabled=!0):this.enabled=!1)},e.disable=function(){this.enabled=!1},e.reset=function(){e.hasEverEnabled&&(e.session=null,e.session=this.cls.createNamespace("AI-CLS-Session"))},e.isNodeVersionCompatible=function(){var e=process.versions.node.split(".");return parseInt(e[0])>3||parseInt(e[0])>2&&parseInt(e[1])>2},e.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2},e.canUseClsHooked=function(){var e=process.versions.node.split("."),t=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0,n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2,r=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(t&&n)&&r},e.enabled=!1,e.hasEverEnabled=!1,e.forceClsHooked=void 0,e.CONTEXT_NAME="ApplicationInsights-Context",e}();t.CorrelationContextManager=a;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 a=this.props[i];if(a.key===t)return void(a.value=n)}this.props.push({key:t,value:n})}},e.bannedCharacters=/[,=]/,e}()},function(e,t,n){"use strict";var r,i,a;Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com",t.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com",t.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com",function(e){e.COMMITTED_BYTES="\\Memory\\Committed Bytes",e.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",e.REQUEST_RATE="\\ApplicationInsights\\Requests/Sec",e.REQUEST_FAILURE_RATE="\\ApplicationInsights\\Requests Failed/Sec",e.REQUEST_DURATION="\\ApplicationInsights\\Request Duration",e.DEPENDENCY_RATE="\\ApplicationInsights\\Dependency Calls/Sec",e.DEPENDENCY_FAILURE_RATE="\\ApplicationInsights\\Dependency Calls Failed/Sec",e.DEPENDENCY_DURATION="\\ApplicationInsights\\Dependency Call Duration",e.EXCEPTION_RATE="\\ApplicationInsights\\Exceptions/Sec"}(r=t.QuickPulseCounter||(t.QuickPulseCounter={})),function(e){e.PRIVATE_BYTES="\\Process(??APP_WIN32_PROC??)\\Private Bytes",e.AVAILABLE_BYTES="\\Memory\\Available Bytes",e.PROCESSOR_TIME="\\Processor(_Total)\\% Processor Time",e.PROCESS_TIME="\\Process(??APP_WIN32_PROC??)\\% Processor Time",e.REQUEST_RATE="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",e.REQUEST_DURATION="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"}(i=t.PerformanceCounter||(t.PerformanceCounter={})),t.PerformanceToQuickPulseCounter=((a={})[i.PROCESSOR_TIME]=r.PROCESSOR_TIME,a[i.REQUEST_RATE]=r.REQUEST_RATE,a[i.REQUEST_DURATION]=r.REQUEST_DURATION,a[r.COMMITTED_BYTES]=r.COMMITTED_BYTES,a[r.REQUEST_FAILURE_RATE]=r.REQUEST_FAILURE_RATE,a[r.DEPENDENCY_RATE]=r.DEPENDENCY_RATE,a[r.DEPENDENCY_FAILURE_RATE]=r.DEPENDENCY_FAILURE_RATE,a[r.DEPENDENCY_DURATION]=r.DEPENDENCY_DURATION,a[r.EXCEPTION_RATE]=r.EXCEPTION_RATE,a),t.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability"},t.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument"},t.TelemetryTypeStringToQuickPulseType={EventData:t.QuickPulseType.Event,ExceptionData:t.QuickPulseType.Exception,MessageData:t.QuickPulseType.Trace,MetricData:t.QuickPulseType.Metric,RequestData:t.QuickPulseType.Request,RemoteDependencyData:t.QuickPulseType.Dependency,AvailabilityData:t.QuickPulseType.Availability},t.TelemetryTypeStringToQuickPulseDocumentType={EventData:t.QuickPulseDocumentType.Event,ExceptionData:t.QuickPulseDocumentType.Exception,MessageData:t.QuickPulseDocumentType.Trace,MetricData:t.QuickPulseDocumentType.Metric,RequestData:t.QuickPulseDocumentType.Request,RemoteDependencyData:t.QuickPulseDocumentType.Dependency,AvailabilityData:t.QuickPulseDocumentType.Availability}},function(e,t){e.exports=require("url")},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",traceparentHeader:"traceparent",traceStateHeader:"tracestate"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TableOfContentsProvider=void 0;const r=n(1),i=n(33);class a{constructor(e,t){this.engine=e,this.document=t}async getToc(){if(!this.toc)try{this.toc=await this.buildToc(this.document)}catch(e){this.toc=[]}return this.toc}async lookup(e){const t=await this.getToc(),n=i.githubSlugifier.fromHeading(e);return t.find(e=>e.slug.equals(n))}async buildToc(e){const t=[],n=await this.engine.parse(e),o=new Map;for(const s of n.filter(e=>"heading_open"===e.type)){const n=s.map[0],l=e.lineAt(n);let c=i.githubSlugifier.fromHeading(l.text);const _=o.get(c.value);_?(++_.count,c=i.githubSlugifier.fromHeading(c.value+"-"+_.count)):o.set(c.value,{count:0}),t.push({slug:c,text:a.getHeaderText(l.text),level:a.getHeaderLevel(s.markup),line:n,location:new r.Location(e.uri,new r.Range(n,0,n,l.text.length))})}return t.map((n,i)=>{let a=void 0;for(let e=i+1;e<t.length;++e)if(t[e].level<=n.level){a=t[e].line-1;break}const o=null!=a?a:e.lineCount-1;return{...n,location:new r.Location(e.uri,new r.Range(n.location.range.start,new r.Position(o,e.lineAt(o).text.length)))}})}static getHeaderLevel(e){return"="===e?1:"-"===e?2:e.length}static getHeaderText(e){return e.replace(/^\s*#+\s*(.*?)\s*#*$/,(e,t)=>t.trim())}}t.TableOfContentsProvider=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,a,o,s,l=n(4),c=n(10),_=Object.prototype.toString;function d(e){return void 0!==e}function u(e){return"[object Number]"===_.call(e)}function p(e){return"[object String]"===_.call(e)}function m(e){return JSON.parse(c.readFileSync(e,"utf8"))}function g(e,t){return s&&(e="["+e.replace(/[aouei]/g,"$&$&")+"]"),0===t.length?e:e.replace(/\{(\d+)\}/g,(function(e,n){var r=n[0],i=t[r],a=e;return"string"==typeof i?a=i:"number"!=typeof i&&"boolean"!=typeof i&&null!=i||(a=String(i)),a}))}function E(e){return function(t,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];return u(t)?t>=e.length?void console.error("Broken localize call found. Index out of bounds. Stacktrace is\n: "+new Error("").stack):g(e[t],r):p(n)?(console.warn("Message "+n+" didn't get externalized correctly."),g(n,r)):void console.error("Broken localize call found. Stacktrace is\n: "+new Error("").stack)}}function S(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return g(t,n)}function f(e,t){return a[e]=t,t}function h(e,t){var n,r,i,a=l.join(o.cacheRoot,e.id+"-"+e.hash+".json"),s=!1,_=!1;try{return n=JSON.parse(c.readFileSync(a,{encoding:"utf8",flag:"r"})),r=a,i=new Date,c.utimes(r,i,i,(function(){})),n}catch(e){if("ENOENT"===e.code)_=!0;else{if(!(e instanceof SyntaxError))throw e;console.log("Syntax error parsing message bundle: "+e.message+"."),c.unlink(a,(function(e){e&&console.error("Deleting corrupted bundle "+a+" failed.")})),s=!0}}if(!(n=function(e,t){var n=o.translationsConfig[e.id];if(n){var r=m(n).contents,i=m(l.join(t,"nls.metadata.json")),a=Object.create(null);for(var s in i){var c=i[s],_=r[e.outDir+"/"+s];if(_){for(var d=[],u=0;u<c.keys.length;u++){var g=c.keys[u],E=_[p(g)?g:g.key];void 0===E&&(E=c.messages[u]),d.push(E)}a[s]=d}else a[s]=c.messages}return a}}(e,t))||s)return n;if(_)try{c.writeFileSync(a,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=m(l.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 T(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=h(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=l.join(e,"nls.bundle."+t+".json");if(c.existsSync(n))return n;var r=t.lastIndexOf("-");t=r>0?t.substring(0,r):void 0}if(void 0===t){n=l.join(e,"nls.bundle.json");if(c.existsSync(n))return n}}(t);if(r)try{return m(r)}catch(e){console.log("Loading in the box message bundle failed.",e)}n=b(t)}return n}function v(e){if(!e)return S;var t=l.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=l.dirname(e);t=l.join(n,"nls.metadata.header.json"),!c.existsSync(t);){var r=l.dirname(n);if(r===n){t=void 0;break}n=r}return t}(e);if(n){var i=l.dirname(n),_=a[i];if(void 0===_)try{var u=JSON.parse(c.readFileSync(n,"utf8"));try{var p=T(u,i);_=f(i,p?{header:u,nlsBundle:p}:null)}catch(e){console.error("Failed to load nls bundle",e),_=f(i,null)}}catch(e){console.error("Failed to read header file",e),_=f(i,null)}if(_){var g=e.substr(i.length+1).replace(/\\/g,"/"),h=_.nlsBundle[g];return void 0===h?(console.error("Messages for file "+e+" not found. See console for details."),function(){return"Messages not found."}):E(h)}}}if(o.messageFormat===r.both||o.messageFormat===r.file)try{var b=m(function(e){var t;if(o.cacheLanguageResolution&&t)t=t;else{if(s||!o.locale)t=".nls.json";else for(var n=o.locale;n;){var r=".nls."+n+".json";if(c.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(b)?E(b):d(b.messages)&&d(b.keys)?E(b.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&&d(t.key)&&d(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()),(!0===(t=e._languagePackSupport)||!1===t)&&(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=m(o.translationsConfigFile)}catch(t){e._corruptedFile&&c.writeFile(e._corruptedFile,"corrupted","utf8",(function(e){console.error(e)}))}}}catch(e){}var t;s="pseudo"===o.locale,void 0,a=Object.create(null)}(),t.loadMessageBundle=v,t.config=function(e){return e&&(p(e.locale)&&(o.locale=e.locale.toLowerCase(),void 0,a=Object.create(null)),void 0!==e.messageFormat&&(o.messageFormat=e.messageFormat)),s="pseudo"===o.locale,v}},function(e,t){e.exports=require("http")},function(e,t,n){"use strict";var r=n(19),i=n(21),a=n(3),o=n(6),s=n(16),l=n(404),c=n(13),_=n(9),d=n(58),u=n(25),p=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(),u.IsInitialized&&(n(405).enable(e,this._client),n(406).enable(e,this._client),n(407).enable(e,this._client),n(408).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,a=i.request,o=function(n,r){var i=!r[e.disableCollectionRequestOption]&&!n[e.alreadyAutoCollectedFlag];n[e.alreadyAutoCollectedFlag]=!0,n&&r&&i&&(c.CorrelationContextManager.wrapEmitter(n),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 a=n.call.apply(n,[r,e].concat(t));return o(a,e),a},i.request=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=a.call.apply(a,[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,a=(i=r.request).call.apply(i,[r,e].concat(t));return a.end(),a},i.get=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,a=(r=i.request).call.apply(r,[i,e].concat(t));return a.end(),a}},e.trackRequest=function(t,n){if(n.options&&n.request&&t){var r,i,u=new l(n.options,n.request),p=c.CorrelationContextManager.getCurrentContext();if(p&&p.operation&&p.operation.traceparent&&d.isValidTraceId(p.operation.traceparent.traceId))p.operation.traceparent.updateSpanId(),r=p.operation.traceparent.getBackCompatRequestId();else if(_.w3cEnabled){i=(g=new d).toString(),r=g.getBackCompatRequestId()}else r=p&&p.operation&&p.operation.parentId+e.requestNumber+++".";if(o.canIncludeCorrelationHeader(t,u.getUrl())&&n.request.getHeader&&n.request.setHeader&&t.config&&t.config.correlationId){var m=n.request.getHeader(s.requestContextHeader);try{o.safeIncludeCorrelationHeader(t,n.request,m)}catch(e){a.warn("Request-Context header could not be set. Correlation of requests may be lost",e)}if(p&&p.operation)try{if(n.request.setHeader(s.requestIdHeader,r),n.request.setHeader(s.parentIdHeader,p.operation.id),n.request.setHeader(s.rootIdHeader,r),i||p.operation.traceparent)n.request.setHeader(s.traceparentHeader,i||p.operation.traceparent.toString());else if(_.w3cEnabled){var g=(new d).toString();n.request.setHeader(s.traceparentHeader,g)}if(p.operation.tracestate){var E=p.operation.tracestate.toString();E&&n.request.setHeader(s.traceStateHeader,E)}var S=p.customProperties.serializeToHeader();S&&n.request.setHeader(s.correlationContextHeader,S)}catch(e){a.warn("Correlation headers could not be set. Correlation of requests may be lost.",e)}}n.request.on&&(n.request.on("response",(function(e){u.onResponse(e);var i=u.getDependencyTelemetry(n,r);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){u.onError(e);var i=u.getDependencyTelemetry(n,r);i.contextObjects=i.contextObjects||{},i.contextObjects["http.RequestOptions"]=n.options,i.contextObjects["http.ClientRequest"]=n.request,i.contextObjects.Error=e,t.trackDependency(i)})))}else a.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=p},function(e,t){e.exports=require("https")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveLinkToMarkdownFile=t.OpenDocumentLinkCommand=void 0;const r=n(1),i=n(4),a=n(17),o=n(8);var s;!function(e){e.beside="beside",e.currentGroup="currentGroup"}(s||(s={}));class l{constructor(e){this.engine=e,this.id=l.id}static createCommandUri(e,t,n){const i=e=>({scheme:e.scheme,authority:e.authority,path:e.path,fragment:e.fragment,query:e.query});return r.Uri.parse(`command:${l.id}?${encodeURIComponent(JSON.stringify({parts:i(t),fragment:n,fromResource:i(e)}))}`)}async execute(e){return l.execute(this.engine,e)}static async execute(e,t){const n=r.Uri.parse("").with(t.fromResource),a=function(e){if("file"===e.scheme)return r.Uri.file(e.path);return r.Uri.parse("").with(e)}(t.parts),o=this.getViewColumn(n);await this.tryOpen(e,a,t,o)||""!==i.extname(a.path)||await this.tryOpen(e,a.with({path:a.path+".md"}),t,o)}static async tryOpen(e,t,n,i){const a=async()=>!(!r.window.activeTextEditor||!o.isMarkdownFile(r.window.activeTextEditor.document)||r.window.activeTextEditor.document.uri.fsPath!==t.fsPath)&&(await this.tryRevealLine(e,r.window.activeTextEditor,n.fragment),!0);if(await a())return!0;let s;try{s=await r.workspace.fs.stat(t)}catch(e){return!1}if(s.type===r.FileType.Directory)return await r.commands.executeCommand("revealInExplorer",t),!0;try{await r.commands.executeCommand("vscode.open",t,i)}catch(e){return!1}return a()}static getViewColumn(e){switch(r.workspace.getConfiguration("markdown",e).get("links.openLocation",s.currentGroup)){case s.beside:return r.ViewColumn.Beside;case s.currentGroup:default:return r.ViewColumn.Active}}static async tryRevealLine(e,t,n){if(n){const i=new a.TableOfContentsProvider(e,t.document),o=await i.lookup(n);if(o){const e=new r.Range(o.line,0,o.line,0);return t.selection=new r.Selection(e.start,e.end),t.revealRange(e,r.TextEditorRevealType.AtTop)}const s=n.match(/^L(\d+)$/i);if(s){const e=+s[1]-1;if(!isNaN(e)){const n=new r.Range(e,0,e,0);return t.selection=new r.Selection(n.start,n.end),t.revealRange(n,r.TextEditorRevealType.AtTop)}}}}}async function c(e){const t=r.Uri.file(e);let n;try{n=await r.workspace.openTextDocument(t)}catch(e){return}if(o.isMarkdownFile(n))return n.uri}t.OpenDocumentLinkCommand=l,l.id="_markdown.openDocumentLink",t.resolveLinkToMarkdownFile=async function(e){try{const t=await c(e);if(t)return t}catch(e){}if(""===i.extname(e))return c(e+".md")}},function(e,t,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(e){for(var t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},r.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach((function(e){e.enabled&&e.alt.forEach((function(e){t.indexOf(e)<0&&t.push(e)}))})),e.__cache__={},t.forEach((function(t){e.__cache__[t]=[],e.__rules__.forEach((function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))}))}))},r.prototype.at=function(e,t,n){var r=this.__find__(e),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},r.prototype.before=function(e,t,n,r){var i=this.__find__(e),a=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},r.prototype.after=function(e,t,n,r){var i=this.__find__(e),a=r||{};if(-1===i)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},r.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach((function(e){var r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!0,n.push(e)}),this),this.__cache__=null,n},r.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach((function(e){e.enabled=!1})),this.enable(e,t)},r.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);var n=[];return e.forEach((function(e){var r=this.__find__(e);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+e)}this.__rules__[r].enabled=!1,n.push(e)}),this),this.__cache__=null,n},r.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},e.exports=r},function(e,t,n){"use strict";function r(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}r.prototype.attrIndex=function(e){var t,n,r;if(!this.attrs)return-1;for(n=0,r=(t=this.attrs).length;n<r;n++)if(t[n][0]===e)return n;return-1},r.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},r.prototype.attrSet=function(e,t){var n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},r.prototype.attrGet=function(e){var t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},r.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);t.IsInitialized=!process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL;var i="DiagnosticChannel";if(t.IsInitialized){var a=n(343),o=(process.env.APPLICATION_INSIGHTS_NO_PATCH_MODULES||"").split(","),s={bunyan:a.bunyan,console:a.console,mongodb:a.mongodb,mongodbCore:a.mongodbCore,mysql:a.mysql,redis:a.redis,pg:a.pg,pgPool:a.pgPool,winston:a.winston};for(var l in s)-1===o.indexOf(l)&&(s[l].enable(),r.info(i,"Subscribed to "+l+" events"));o.length>0&&r.info(i,"Some modules will not be patched",o)}else r.info(i,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");t.registerContextPreservation=function(e){t.IsInitialized&&n(2).channel.addContextPreservation(e)}},function(e,t){e.exports=require("util")},function(e,t){e.exports=require("assert")},function(e,t,n){"use strict";var r=n(29),i=r.wrap,a=r.unwrap,o="wrap@before";function s(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function l(e,t){var n;return n=e._events&&e._events[t],Array.isArray(n)||(n=n?[n]:[]),n}function c(e,t,n){var r=l(e,t).filter((function(e){return-1===n.indexOf(e)}));r.length>0&&function(e,t){for(var n=t.length,r=0;r<n;r++){var i=t[r],a=e[o];if("function"==typeof a)a(i);else if(Array.isArray(a))for(var s=a.length,l=0;l<s;l++)a[l](i)}}(e,r)}function _(e,t){if(e){var n=e;if("function"==typeof e)n=t(e);else if(Array.isArray(e)){n=[];for(var r=0;r<e.length;r++)n[r]=t(e[r])}return n}}e.exports=function(e,t,n){if(!(e&&e.on&&e.addListener&&e.removeListener&&e.emit))throw new Error("can only wrap real EEs");if(!t)throw new Error("must have function to run on listener addition");if(!n)throw new Error("must have function to wrap listeners when emitting");function r(e){return function(t,n){var a=l(this,t).slice();try{var o=e.call(this,t,n);return c(this,t,a),o}finally{this.on.__wrapped||i(this,"on",r),this.addListener.__wrapped||i(this,"addListener",r)}}}e[o]?"function"==typeof e[o]?s(e,o,[e[o],t]):Array.isArray(e[o])&&e[o].push(t):s(e,o,t),e.__wrapped||(i(e,"addListener",r),i(e,"on",r),i(e,"emit",(function(e){return function(t){if(!this._events||!this._events[t])return e.apply(this,arguments);var r=this._events[t];function o(e){return function(){this._events[t]=r;try{return e.apply(this,arguments)}finally{r=this._events[t],this._events[t]=_(r,n)}}}i(this,"removeListener",o);try{return this._events[t]=_(r,n),e.apply(this,arguments)}finally{a(this,"removeListener"),this._events[t]=r}}})),s(e,"__unwrap",(function(){a(e,"addListener"),a(e,"on"),a(e,"emit"),delete e[o],delete e.__wrapped})),s(e,"__wrapped",!0))}},function(e,t,n){"use strict";function r(e){return"function"==typeof e}var i=console.error.bind(console);function a(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function o(e){e&&e.logger&&(r(e.logger)?i=e.logger:i("new logger isn't a function, not replacing"))}function s(e,t,n){if(e&&e[t]){if(!n)return i("no wrapper function"),void i((new Error).stack);if(r(e[t])&&r(n)){var o=e[t],s=n(o,t);return a(s,"__original",o),a(s,"__unwrap",(function(){e[t]===s&&a(e,t,o)})),a(s,"__wrapped",!0),a(e,t,s),s}i("original object and wrapper must be functions")}else i("no original function "+t+" to wrap")}function l(e,t){return e&&e[t]?e[t].__unwrap?e[t].__unwrap():void i("no original to unwrap to -- has "+t+" already been unwrapped?"):(i("no function to unwrap."),void i((new Error).stack))}o.wrap=s,o.massWrap=function(e,t,n){if(!e)return i("must provide one or more modules to patch"),void i((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){s(e,t,n)}))})):i("must provide one or more functions to wrap on modules")},o.unwrap=l,o.massUnwrap=function(e,t){if(!e)return i("must provide one or more modules to patch"),void i((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){l(e,t)}))})):i("must provide one or more functions to unwrap on modules")},e.exports=o},function(e,t,n){"use strict";var r=n(12),i=n(14),a=function(){function e(t,n,r){void 0===n&&(n=6e4),void 0===r&&(r=!1),this._lastIntervalRequestExecutionTime=0,this._lastIntervalDependencyExecutionTime=0,e.INSTANCE||(e.INSTANCE=this),this._isInitialized=!1,this._client=t,this._collectionInterval=n,this._enableLiveMetricsCounters=r}return e.prototype.enable=function(t,n){var i=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},this._lastDependencies={totalDependencyCount:e._totalDependencyCount,totalFailedDependencyCount:e._totalFailedDependencyCount,time:+new Date},this._lastExceptions={totalExceptionCount:e._totalExceptionCount,time:+new Date},"function"==typeof process.cpuUsage&&(this._lastAppCpuUsage=process.cpuUsage()),this._lastHrtime=process.hrtime(),this._collectionInterval=n||this._collectionInterval,this._handle=setInterval((function(){return i.trackPerformance()}),this._collectionInterval),this._handle.unref()):this._handle&&(clearInterval(this._handle),this._handle=void 0)},e.countRequest=function(t,n){var r;if(e.isEnabled()){if("string"==typeof t)r=+new Date("1970-01-01T"+t+"Z");else{if("number"!=typeof t)return;r=t}e._intervalRequestExecutionTime+=r,!1===n&&e._totalFailedRequestCount++,e._totalRequestCount++}},e.countException=function(){e._totalExceptionCount++},e.countDependency=function(t,n){var r;if(e.isEnabled()){if("string"==typeof t)r=+new Date("1970-01-01T"+t+"Z");else{if("number"!=typeof t)return;r=t}e._intervalDependencyExecutionTime+=r,!1===n&&e._totalFailedDependencyCount++,e._totalDependencyCount++}},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(),this._trackDependencyRate(),this._trackExceptionRate()},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,a=0,o=0,s=0,l=0;e&&l<e.length;l++){var c=e[l],_=this._lastCpus[l],d=(c.model,c.speed,c.times),u=_.times;t+=d.user-u.user||0,n+=d.sys-u.sys||0,a+=d.nice-u.nice||0,o+=d.idle-u.idle||0,s+=d.irq-u.irq||0}var p=void 0;if("function"==typeof process.cpuUsage){var m=process.cpuUsage(),g=process.hrtime(),E=m.user-this._lastAppCpuUsage.user+(m.system-this._lastAppCpuUsage.system)||0;if(void 0!==this._lastHrtime&&2===this._lastHrtime.length)p=100*E/((1e6*(g[0]-this._lastHrtime[0])+(g[1]-this._lastHrtime[1])/1e3||0)*e.length);this._lastAppCpuUsage=m,this._lastHrtime=g}var S=t+n+a+o+s||1;this._client.trackMetric({name:i.PerformanceCounter.PROCESSOR_TIME,value:(S-o)/S*100}),this._client.trackMetric({name:i.PerformanceCounter.PROCESS_TIME,value:p||t/S*100})}this._lastCpus=e},e.prototype._trackMemory=function(){var e=r.freemem(),t=process.memoryUsage().rss,n=r.totalmem()-e;this._client.trackMetric({name:i.PerformanceCounter.PRIVATE_BYTES,value:t}),this._client.trackMetric({name:i.PerformanceCounter.AVAILABLE_BYTES,value:e}),this._enableLiveMetricsCounters&&this._client.trackMetric({name:i.QuickPulseCounter.COMMITTED_BYTES,value:n})},e.prototype._trackNetwork=function(){var t=this._lastRequests,n={totalRequestCount:e._totalRequestCount,totalFailedRequestCount:e._totalFailedRequestCount,time:+new Date},r=n.totalRequestCount-t.totalRequestCount||0,a=n.totalFailedRequestCount-t.totalFailedRequestCount||0,o=n.time-t.time,s=o/1e3,l=(e._intervalRequestExecutionTime-this._lastIntervalRequestExecutionTime)/r||0;if(this._lastIntervalRequestExecutionTime=e._intervalRequestExecutionTime,o>0){var c=r/s,_=a/s;this._client.trackMetric({name:i.PerformanceCounter.REQUEST_RATE,value:c}),(!this._enableLiveMetricsCounters||r>0)&&this._client.trackMetric({name:i.PerformanceCounter.REQUEST_DURATION,value:l}),this._enableLiveMetricsCounters&&this._client.trackMetric({name:i.QuickPulseCounter.REQUEST_FAILURE_RATE,value:_})}this._lastRequests=n},e.prototype._trackDependencyRate=function(){if(this._enableLiveMetricsCounters){var t=this._lastDependencies,n={totalDependencyCount:e._totalDependencyCount,totalFailedDependencyCount:e._totalFailedDependencyCount,time:+new Date},r=n.totalDependencyCount-t.totalDependencyCount||0,a=n.totalFailedDependencyCount-t.totalFailedDependencyCount||0,o=n.time-t.time,s=o/1e3,l=(e._intervalDependencyExecutionTime-this._lastIntervalDependencyExecutionTime)/r||0;if(this._lastIntervalDependencyExecutionTime=e._intervalDependencyExecutionTime,o>0){var c=r/s,_=a/s;this._client.trackMetric({name:i.QuickPulseCounter.DEPENDENCY_RATE,value:c}),this._client.trackMetric({name:i.QuickPulseCounter.DEPENDENCY_FAILURE_RATE,value:_}),(!this._enableLiveMetricsCounters||r>0)&&this._client.trackMetric({name:i.QuickPulseCounter.DEPENDENCY_DURATION,value:l})}this._lastDependencies=n}},e.prototype._trackExceptionRate=function(){if(this._enableLiveMetricsCounters){var t=this._lastExceptions,n={totalExceptionCount:e._totalExceptionCount,time:+new Date},r=n.totalExceptionCount-t.totalExceptionCount||0,a=n.time-t.time;if(a>0){var o=r/(a/1e3);this._client.trackMetric({name:i.QuickPulseCounter.EXCEPTION_RATE,value:o})}this._lastExceptions=n}},e.prototype.dispose=function(){e.INSTANCE=null,this.enable(!1),this._isInitialized=!1},e._totalRequestCount=0,e._totalFailedRequestCount=0,e._lastRequestExecutionTime=0,e._totalDependencyCount=0,e._totalFailedDependencyCount=0,e._lastDependencyExecutionTime=0,e._totalExceptionCount=0,e._intervalDependencyExecutionTime=0,e._intervalRequestExecutionTime=0,e}();e.exports=a},function(e,t,n){"use strict";var r=n(9),i=n(412),a=n(14),o=n(15),s=function(){function e(t){var n=this;this.endpointBase=a.DEFAULT_BREEZE_ENDPOINT;var r=process.env[e.ENV_connectionString],s=i.parse(t),l=i.parse(r),c=!s.instrumentationkey&&Object.keys(s).length>0?null:t;this.instrumentationKey=s.instrumentationkey||c||l.instrumentationkey||e._getInstrumentationKey(),this.endpointUrl=(s.ingestionendpoint||l.ingestionendpoint||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","*.core.microsoft.scloud","*.core.eaglex.ic.gov"],this.setCorrelationId=function(e){return n.correlationId=e},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,this.profileQueryEndpoint=s.ingestionendpoint||l.ingestionendpoint||process.env[e.ENV_profileQueryEndpoint]||this.endpointBase,this._quickPulseHost=s.liveendpoint||l.liveendpoint||process.env[e.ENV_quickPulseHost]||a.DEFAULT_LIVEMETRICS_HOST,this._quickPulseHost.match(/^https?:\/\//)&&(this._quickPulseHost=o.parse(this._quickPulseHost).host)}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}),Object.defineProperty(e.prototype,"quickPulseHost",{get:function(){return this._quickPulseHost},set:function(e){this._quickPulseHost=e},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_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST",e.ENV_connectionString="APPLICATIONINSIGHTS_CONNECTION_STRING",e.ENV_nativeMetricsDisablers="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC",e.ENV_nativeMetricsDisableAll="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS",e.ENV_http_proxy="http_proxy",e.ENV_https_proxy="https_proxy",e}();e.exports=s},function(e,t,n){"use strict";var r=n(12),i=n(10),a=n(4),o=n(5),s=n(3),l=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||a.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){s.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=a.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){s.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=l},func