(()=>{var e={8054:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};const i=n(8614),o=r(n(5158)),s=r(n(6304)),a=o.default("agent-base");function c(){const{stack:e}=new Error;return"string"==typeof e&&e.split("\n").some((e=>-1!==e.indexOf("(https.js:")||-1!==e.indexOf("node:https:")))}function u(e,t){return new u.Agent(e,t)}!function(e){class t extends i.EventEmitter{constructor(e,t){super();let n=t;"function"==typeof e?this.callback=e:e&&(n=e),this.timeout=null,n&&"number"==typeof n.timeout&&(this.timeout=n.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return"number"==typeof this.explicitDefaultPort?this.explicitDefaultPort:c()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return"string"==typeof this.explicitProtocol?this.explicitProtocol:c()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,t,n){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,t){const n=Object.assign({},t);"boolean"!=typeof n.secureEndpoint&&(n.secureEndpoint=c()),null==n.host&&(n.host="localhost"),null==n.port&&(n.port=n.secureEndpoint?443:80),null==n.protocol&&(n.protocol=n.secureEndpoint?"https:":"http:"),n.host&&n.path&&delete n.path,delete n.agent,delete n.hostname,delete n._defaultAgent,delete n.defaultPort,delete n.createConnection,e._last=!0,e.shouldKeepAlive=!1;let r=!1,i=null;const o=n.timeout||this.timeout,u=t=>{e._hadError||(e.emit("error",t),e._hadError=!0)},l=()=>{i=null,r=!0;const e=new Error(`A "socket" was not created for HTTP request before ${o}ms`);e.code="ETIMEOUT",u(e)},p=e=>{r||(null!==i&&(clearTimeout(i),i=null),u(e))},f=t=>{if(r)return;if(null!=i&&(clearTimeout(i),i=null),o=t,Boolean(o)&&"function"==typeof o.addRequest)return a("Callback returned another Agent instance %o",t.constructor.name),void t.addRequest(e,n);var o;if(t)return t.once("free",(()=>{this.freeSocket(t,n)})),void e.onSocket(t);const s=new Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``);u(s)};if("function"==typeof this.callback){this.promisifiedCallback||(this.callback.length>=3?(a("Converting legacy callback function to promise"),this.promisifiedCallback=s.default(this.callback)):this.promisifiedCallback=this.callback),"number"==typeof o&&o>0&&(i=setTimeout(l,o)),"port"in n&&"number"!=typeof n.port&&(n.port=Number(n.port));try{a("Resolving socket for %o request: %o",n.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,n)).then(f,p)}catch(e){Promise.reject(e).catch(p)}}else u(new Error("`callback` is not defined"))}freeSocket(e,t){a("Freeing socket %o %o",e.constructor.name,t),e.destroy()}destroy(){a("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype}(u||(u={})),e.exports=u},6304:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,n){return new Promise(((r,i)=>{e.call(this,t,n,((e,t)=>{e?i(e):r(t)}))}))}}},6281:(e,t,n)=>{"use strict";var r=n(7396),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(4309).wp(e&&t,this._client),n(5823).wp(e,this._client),n(454).wp(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},894:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5282),i=n(7396),o=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,o){return t=t||e,this.enabled?{operation:{name:n,id:e,parentId:t,traceparent:i,tracestate:o},customProperties:new s(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(9562):this.cls=n(3057)),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=o;var s=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;t0)for(var a=0,c=o;a{"use strict";var r=n(2087),i=n(3580),o=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,o=0,s=0,a=0,c=0;e&&c0){var u=r/a,l=o/a;this._client.trackMetric({name:i.PerformanceCounter.REQUEST_RATE,value:u}),(!this._enableLiveMetricsCounters||r>0)&&this._client.trackMetric({name:i.PerformanceCounter.REQUEST_DURATION,value:c}),this._enableLiveMetricsCounters&&this._client.trackMetric({name:i.QuickPulseCounter.REQUEST_FAILURE_RATE,value:l})}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,o=n.totalFailedDependencyCount-t.totalFailedDependencyCount||0,s=n.time-t.time,a=s/1e3,c=(e._intervalDependencyExecutionTime-this._lastIntervalDependencyExecutionTime)/r||0;if(this._lastIntervalDependencyExecutionTime=e._intervalDependencyExecutionTime,s>0){var u=r/a,l=o/a;this._client.trackMetric({name:i.QuickPulseCounter.DEPENDENCY_RATE,value:u}),this._client.trackMetric({name:i.QuickPulseCounter.DEPENDENCY_FAILURE_RATE,value:l}),(!this._enableLiveMetricsCounters||r>0)&&this._client.trackMetric({name:i.QuickPulseCounter.DEPENDENCY_DURATION,value:c})}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,o=n.time-t.time;if(o>0){var s=r/(o/1e3);this._client.trackMetric({name:i.QuickPulseCounter.EXCEPTION_RATE,value:s})}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=o},3054:e=>{"use strict";var t=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{"use strict";var r=n(5290),i=n(4953),o=[],s={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){var t=e.data.result;o.forEach((function(n){var r=s[e.data.level];t instanceof Error?n.trackException({exception:t}):n.trackTrace({message:t,severity:r})}))};t.wp=function(e,t){e?(0===o.length&&i.channel.subscribe("bunyan",a),o.push(t)):0===(o=o.filter((function(e){return e!=t}))).length&&i.channel.unsubscribe("bunyan",a)}},4309:(e,t,n)=>{"use strict";var r=n(5290),i=n(4953),o=[],s=function(e){var t=e.data.message;o.forEach((function(n){t instanceof Error?n.trackException({exception:t}):(t.lastIndexOf("\n")==t.length-1&&(t=t.substring(0,t.length-1)),n.trackTrace({message:t,severity:e.data.stderr?r.SeverityLevel.Warning:r.SeverityLevel.Information}))}))};t.wp=function(e,t){e?(0===o.length&&i.channel.subscribe("console",s),o.push(t)):0===(o=o.filter((function(e){return e!=t}))).length&&i.channel.unsubscribe("console",s)}},7396:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5282);t.IsInitialized=!process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL;var i="DiagnosticChannel";if(t.IsInitialized){var o=n(4106),s=(process.env.APPLICATION_INSIGHTS_NO_PATCH_MODULES||"").split(","),a={bunyan:o.bunyan,console:o.console,mongodb:o.mongodb,mongodbCore:o.mongodbCore,mysql:o.mysql,redis:o.redis,pg:o.pg,pgPool:o.pgPool,winston:o.winston};for(var c in a)-1===s.indexOf(c)&&(a[c].enable(),r.info(i,"Subscribed to "+c+" events"));s.length>0&&r.info(i,"Some modules will not be patched",s)}else r.info(i,"Not subscribing to dependency autocollection because APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL was set");t.registerContextPreservation=function(e){t.IsInitialized&&n(4953).channel.addContextPreservation(e)}},7886:(e,t,n)=>{"use strict";var r=n(4953),i=[];t.qP=function(e){e.data.event.commandName,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.wp=function(e,n){e?(0===i.length&&r.channel.subscribe("mongodb",t.qP),i.push(n)):0===(i=i.filter((function(e){return e!=n}))).length&&r.channel.unsubscribe("mongodb",t.qP)}},4777:(e,t,n)=>{"use strict";var r=n(4953),i=[];t.qP=function(e){i.forEach((function(t){var n=e.data.query||{},r=n.sql||"Unknown query",i=!e.data.err,o=(n._connection||{}).config||{},s=o.socketPath?o.socketPath:(o.host||"localhost")+":"+o.port;t.trackDependency({target:s,data:r,name:r,duration:e.data.duration,success:i,resultCode:i?"0":"1",dependencyTypeName:"mysql"})}))},t.wp=function(e,n){e?(0===i.length&&r.channel.subscribe("mysql",t.qP),i.push(n)):0===(i=i.filter((function(e){return e!=n}))).length&&r.channel.unsubscribe("mysql",t.qP)}},9843:(e,t,n)=>{"use strict";var r=n(4953),i=[];t.qP=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,o=e.data.database.host+":"+e.data.database.port;t.trackDependency({target:o,data:r,name:r,duration:e.data.duration,success:i,resultCode:i?"0":"1",dependencyTypeName:"postgres"})}))},t.wp=function(e,n){e?(0===i.length&&r.channel.subscribe("postgres",t.qP),i.push(n)):0===(i=i.filter((function(e){return e!=n}))).length&&r.channel.unsubscribe("postgres",t.qP)}},5071:(e,t,n)=>{"use strict";var r=n(4953),i=[];t.qP=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.wp=function(e,n){e?(0===i.length&&r.channel.subscribe("redis",t.qP),i.push(n)):0===(i=i.filter((function(e){return e!=n}))).length&&r.channel.unsubscribe("redis",t.qP)}},454:(e,t,n)=>{"use strict";var r=n(5290),i=n(4953),o=[],s={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){var t=e.data.message;o.forEach((function(n){if(t instanceof Error)n.trackException({exception:t,properties:e.data.meta});else{var r=s[e.data.levelKind](e.data.level);n.trackTrace({message:t,severity:r,properties:e.data.meta})}}))};t.wp=function(e,t){e?(0===o.length&&i.channel.subscribe("winston",a),o.push(t)):0===(o=o.filter((function(e){return e!=t}))).length&&i.channel.unsubscribe("winston",a)}},3580:(e,t)=>{"use strict";var n,r,i;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"}(n=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"}(r=t.PerformanceCounter||(t.PerformanceCounter={})),t.PerformanceToQuickPulseCounter=((i={})[r.PROCESSOR_TIME]=n.PROCESSOR_TIME,i[r.REQUEST_RATE]=n.REQUEST_RATE,i[r.REQUEST_DURATION]=n.REQUEST_DURATION,i[n.COMMITTED_BYTES]=n.COMMITTED_BYTES,i[n.REQUEST_FAILURE_RATE]=n.REQUEST_FAILURE_RATE,i[n.DEPENDENCY_RATE]=n.DEPENDENCY_RATE,i[n.DEPENDENCY_FAILURE_RATE]=n.DEPENDENCY_FAILURE_RATE,i[n.DEPENDENCY_DURATION]=n.DEPENDENCY_DURATION,i[n.EXCEPTION_RATE]=n.EXCEPTION_RATE,i),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}},9382:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9958),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}},7220:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return i(t,e),t}(n(8934));e.exports=o},4101:e=>{"use strict";var t=function(){};e.exports=t},9871:e=>{"use strict";var t=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=t},320:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){return e.call(this)||this}return i(t,e),t}(n(4101));e.exports=o},8602:(e,t,n)=>{"use strict";var r=n(495),i=function(){this.kind=r.Measurement};e.exports=i},495:e=>{"use strict";var t;!function(e){e[e.Measurement=0]="Measurement",e[e.Aggregation=1]="Aggregation"}(t||(t={})),e.exports=t},8934:e=>{"use strict";var t=function(){};e.exports=t},7300:e=>{"use strict";var t=function(){this.ver=1,this.sampleRate=100,this.tags={}};e.exports=t},4526:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return i(t,e),t}(n(8934));e.exports=o},935:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.exceptions=[],t.properties={},t.measurements={},t}return i(t,e),t}(n(8934));e.exports=o},8082:e=>{"use strict";var t=function(){this.hasFullStack=!0,this.parsedStack=[]};e.exports=t},901:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t}return i(t,e),t}(n(8934));e.exports=o},3092:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.metrics=[],t.properties={},t}return i(t,e),t}(n(8934));e.exports=o},6279:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return i(t,e),t}(n(4526));e.exports=o},6290:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.success=!0,t.properties={},t.measurements={},t}return i(t,e),t}(n(8934));e.exports=o},7339:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=function(e){function t(){var t=e.call(this)||this;return t.ver=2,t.properties={},t.measurements={},t}return i(t,e),t}(n(8934));e.exports=o},9697:e=>{"use strict";var t;!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"}(t||(t={})),e.exports=t},6781:e=>{"use strict";var t=function(){};e.exports=t},9958:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AvailabilityData=n(7220),t.Base=n(4101),t.ContextTagKeys=n(9871),t.Data=n(320),t.DataPoint=n(8602),t.DataPointType=n(495),t.Domain=n(8934),t.Envelope=n(7300),t.EventData=n(4526),t.ExceptionData=n(935),t.ExceptionDetails=n(8082),t.MessageData=n(901),t.MetricData=n(3092),t.PageViewData=n(6279),t.RemoteDependencyData=n(6290),t.RequestData=n(7339),t.SeverityLevel=n(9697),t.StackFrame=n(6781)},5481:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.telemetryTypeToBaseType=function(e){switch(e){case n.Event:return"EventData";case n.Exception:return"ExceptionData";case n.Trace:return"MessageData";case n.Metric:return"MetricData";case n.Request:return"RequestData";case n.Dependency:return"RemoteDependencyData";case n.Availability:return"AvailabilityData"}},t.baseTypeToTelemetryType=function(e){switch(e){case"EventData":return n.Event;case"ExceptionData":return n.Exception;case"MessageData":return n.Trace;case"MetricData":return n.Metric;case"RequestData":return n.Request;case"RemoteDependencyData":return n.Dependency;case"AvailabilityData":return n.Availability}},t.TelemetryTypeString={Event:"EventData",Exception:"ExceptionData",Trace:"MessageData",Metric:"MetricData",Request:"RequestData",Dependency:"RemoteDependencyData",Availability:"AvailabilityData"},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",e[e.Availability=6]="Availability"}(n=t.TelemetryType||(t.TelemetryType={}))},2626:(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(5481))},5290:(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(9382)),r(n(9958)),r(n(2626))},3504:(e,t,n)=>{"use strict";var r=n(5282),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},9253:(e,t,n)=>{"use strict";var r=n(9962),i=n(640),o=n(3580),s=n(8835),a=function(){function e(t){var n=this;this.endpointBase=o.DEFAULT_BREEZE_ENDPOINT;var r=process.env[e.ENV_connectionString],a=i.parse(t),c=i.parse(r),u=!a.instrumentationkey&&Object.keys(a).length>0?null:t;this.instrumentationKey=a.instrumentationkey||u||c.instrumentationkey||e._getInstrumentationKey(),this.endpointUrl=(a.ingestionendpoint||c.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=a.ingestionendpoint||c.ingestionendpoint||process.env[e.ENV_profileQueryEndpoint]||this.endpointBase,this._quickPulseHost=a.liveendpoint||c.liveendpoint||process.env[e.ENV_quickPulseHost]||o.DEFAULT_LIVEMETRICS_HOST,this._quickPulseHost.match(/^https?:\/\//)&&(this._quickPulseHost=s.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=a},640:(e,t,n)=>{"use strict";var r=n(3580),i=function(){function e(){}return e.parse=function(t){if(!t)return{};var n=t.split(e._FIELDS_SEPARATOR).reduce((function(t,n){var r=n.split(e._FIELD_KEY_VALUE_SEPARATOR);if(2===r.length){var i=r[0].toLowerCase(),o=r[1];t[i]=o}return t}),{});if(Object.keys(n).length>0){if(n.endpointsuffix){var i=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+i+"dc."+n.endpointsuffix,n.liveendpoint=n.liveendpoint||"https://"+i+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||r.DEFAULT_BREEZE_ENDPOINT,n.liveendpoint=n.liveendpoint||r.DEFAULT_LIVEMETRICS_ENDPOINT}return n},e._FIELDS_SEPARATOR=";",e._FIELD_KEY_VALUE_SEPARATOR="=",e}();e.exports=i},4470:(e,t,n)=>{"use strict";var r=n(2087),i=n(5747),o=n(5622),s=n(5290),a=n(5282),c=function(){function e(e){this.keys=new s.ContextTagKeys,this.tags={},this._loadApplicationContext(),this._loadDeviceContext(),this._loadInternalContext()}return e.prototype._loadApplicationContext=function(t){if(t=t||o.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=o.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},9962:(e,t,n)=>{"use strict";var r=n(5740),i=n(5282),o=function(){function e(){}return e.queryCorrelationId=function(t,n){var o=t.profileQueryEndpoint+"/api/profiles/"+t.instrumentationKey+"/appId";if(e.completedLookups.hasOwnProperty(o))n(e.completedLookups[o]);else if(e.pendingLookups[o])e.pendingLookups[o].push(n);else{e.pendingLookups[o]=[n];var s=function(){if(e.pendingLookups[o]){var n={method:"GET",disableAppInsightsAutoCollection:!0};i.info(e.TAG,n);var a=r.makeRequest(t,o,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[o]=t,e.pendingLookups[o]&&e.pendingLookups[o].forEach((function(e){return e(t)})),delete e.pendingLookups[o]}))}else n.statusCode>=400&&n.statusCode<500?(e.completedLookups[o]=void 0,delete e.pendingLookups[o]):setTimeout(s,t.correlationIdRetryIntervalMs)}));a&&(a.on("error",(function(t){i.warn(e.TAG,t)})),a.end())}};setTimeout(s,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.lengtho)for(;o>1;--o){var s=t[o-1];if("."===s||"_"===s)break}if(o<=1)return e.generateRootId();for(n=r.randomu32().toString(16);n.length<8;)n="0"+n;return t.substring(0,o)+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=o},9813:(e,t,n)=>{"use strict";var r=n(5290),i=n(5740),o=n(894),s=function(){function e(){}return e.createEnvelope=function(t,n,o,s,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);break;case r.TelemetryType.Availability:c=e.createAvailabilityData(t)}if(o&&r.domainSupportsProperties(c.baseData)){if(c&&c.baseData)if(c.baseData.properties)for(var u in o)c.baseData.properties[u]||(c.baseData.properties[u]=o[u]);else c.baseData.properties=o;c.baseData.properties=i.validateStringMap(c.baseData.properties)}var l=a&&a.instrumentationKey||"",p=new r.Envelope;return p.data=c,p.iKey=l,p.name="Microsoft.ApplicationInsights."+l.replace(/-/g,"")+"."+c.baseType.substr(0,c.baseType.length-4),p.tags=this.getTags(s,t.tagOverrides),p.time=(new Date).toISOString(),p.ver=1,p.sampleRate=a?a.samplingPercentage:100,n===r.TelemetryType.Metric&&(p.sampleRate=100),p},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;"string"==typeof e.name&&(t.name=e.name.length>1024?e.name.slice(0,1021)+"...":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,isNaN(e.severity)?t.severityLevel=r.SeverityLevel.Error:t.severityLevel=e.severity,t.measurements=e.measurements,t.exceptions=[];var n=e.exception.stack,o=new r.ExceptionDetails;o.message=e.exception.message,o.typeName=e.exception.name,o.parsedStack=this.parseStack(n),o.hasFullStack=i.isArray(o.parsedStack)&&o.parsedStack.length>0,t.exceptions.push(o);var s=new r.Data;return s.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Exception),s.baseData=t,s},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.createAvailabilityData=function(e){var t=new r.AvailabilityData;e.id?t.id=e.id:t.id=i.w3cTraceId(),t.name=e.name,t.duration=i.msToTimeSpan(e.duration),t.success=e.success,t.runLocation=e.runLocation,t.message=e.message,t.measurements=e.measurements,t.properties=e.properties;var n=new r.Data;return n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Availability),n.baseData=t,n},e.getTags=function(e,t){var n=o.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,o=0;o<=n.length;o++){var s=n[o];if(a.regex.test(s)){var c=new a(n[o],r++);i+=c.sizeInBytes,t.push(c)}}if(i>32768)for(var u=0,l=t.length-1,p=0,f=u,d=l;u32768){var h=d-f+1;t.splice(f,h);break}f=u,d=l,u++,l--}}return t},e}(),a=function(){function e(t,n){this.sizeInBytes=0,this.level=n,this.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])||"",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=s},5282:e=>{"use strict";var t=function(){function e(){}return e.info=function(t){for(var n=[],r=1;r0?t:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date("+Date.now()+")/",Version:r.tags[r.keys.internalSdkVersion],StreamId:u,MachineName:o,Instance:s}},e.createQuickPulseMetric=function(e){return{Name:e.name,Value:e.value,Weight:e.count||1}},e.telemetryEnvelopeToQuickPulseDocument=function(t){switch(t.data.baseType){case o.TelemetryTypeString.Event:return e.createQuickPulseEventDocument(t);case o.TelemetryTypeString.Exception:return e.createQuickPulseExceptionDocument(t);case o.TelemetryTypeString.Trace:return e.createQuickPulseTraceDocument(t);case o.TelemetryTypeString.Dependency:return e.createQuickPulseDependencyDocument(t);case o.TelemetryTypeString.Request:return e.createQuickPulseRequestDocument(t)}return null},e.createQuickPulseEventDocument=function(t){var n=e.createQuickPulseDocument(t),i=t.data.baseData.name;return r({},n,{Name:i})},e.createQuickPulseTraceDocument=function(t){var n=e.createQuickPulseDocument(t),i=t.data.baseData.severityLevel||0;return r({},n,{Message:t.data.baseData.message,SeverityLevel:o.SeverityLevel[i]})},e.createQuickPulseExceptionDocument=function(t){var n=e.createQuickPulseDocument(t),i=t.data.baseData.exceptions,o="",s="",a="";return i&&i.length>0&&(i[0].parsedStack&&i[0].parsedStack.length>0?i[0].parsedStack.forEach((function(e){o+=e.assembly+"\n"})):i[0].stack&&i[0].stack.length>0&&(o=i[0].stack),s=i[0].message,a=i[0].typeName),r({},n,{Exception:o,ExceptionMessage:s,ExceptionType:a})},e.createQuickPulseRequestDocument=function(t){var n=e.createQuickPulseDocument(t),i=t.data.baseData;return r({},n,{Name:i.name,Success:i.success,Duration:i.duration,ResponseCode:i.responseCode,OperationName:i.name})},e.createQuickPulseDependencyDocument=function(t){var n=e.createQuickPulseDocument(t),i=t.data.baseData;return r({},n,{Name:i.name,Target:i.target,Success:i.success,Duration:i.duration,ResultCode:i.resultCode,CommandName:i.data,OperationName:n.OperationId,DependencyTypeName:i.type})},e.createQuickPulseDocument=function(t){var n,r;return t.data.baseType?(r=s.TelemetryTypeStringToQuickPulseType[t.data.baseType],n=s.TelemetryTypeStringToQuickPulseDocumentType[t.data.baseType]):c.warn("Document type invalid; not sending live metric document",t.data.baseType),{DocumentType:n,__type:r,OperationId:t.tags[e.keys.operationId],Version:"1.0",Properties:e.aggregateProperties(t)}},e.aggregateProperties=function(e){var t=[],n=e.data.baseData.measurements||{};for(var r in n)if(n.hasOwnProperty(r)){var i={key:r,value:n[r]};t.push(i)}var o=e.data.baseData.properties||{};for(var r in o)if(o.hasOwnProperty(r)){i={key:r,value:o[r]};t.push(i)}return t},e.keys=new o.ContextTagKeys,e}();e.exports=l},9184:(e,t,n)=>{"use strict";var r=n(7211),i=n(8723),o=n(5282),s="POST",a="x-ms-qps-transmission-time",c="x-ms-qps-subscribed",u=function(){function e(e){this._config=e,this._consecutiveErrors=0}return e.prototype.ping=function(e,t){this._submitData(e,t,"ping")},e.prototype.post=function(e,t){this._submitData([e],t,"post")},e.prototype._submitData=function(t,n,u){var l,p,f=this,d=JSON.stringify(t),h=((l={})[i.disableCollectionRequestOption]=!0,l.host=this._config.quickPulseHost,l.method=s,l.path="/QuickPulseService.svc/"+u+"?ikey="+this._config.instrumentationKey,l.headers=((p={Expect:"100-continue"})[a]=1e4*Date.now(),p["Content-Type"]="application/json",p["Content-Length"]=Buffer.byteLength(d),p),l),m=r.request(h,(function(e){var t="true"===e.headers[c];f._consecutiveErrors=0,n(t,e)}));m.on("error",(function(t){f._consecutiveErrors++;var r="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";f._consecutiveErrors%e.MAX_QPS_FAILURES_BEFORE_WARN==0?(r="Live Metrics endpoint could not be reached "+f._consecutiveErrors+" consecutive times. Most recent error:",o.warn(e.TAG,r,t)):o.info(e.TAG,r,t),n()})),m.write(d),m.end()},e.TAG="QuickPulseSender",e.MAX_QPS_FAILURES_BEFORE_WARN=25,e}();e.exports=u},3668:(e,t,n)=>{"use strict";var r=n(5282),i=n(9253),o=n(7148),s=n(9184),a=n(3580),c=n(4470),u=function(){function e(e,t){this._isCollectingData=!1,this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0,this._metrics={},this._documents=[],this._collectors=[],this.config=new i(e),this.context=t||new c,this._sender=new s(this.config),this._isEnabled=!1}return e.prototype.addCollector=function(e){this._collectors.push(e)},e.prototype.trackMetric=function(e){this._addMetric(e)},e.prototype.addDocument=function(e){var t=o.telemetryEnvelopeToQuickPulseDocument(e);t&&this._documents.push(t)},e.prototype.enable=function(e){e&&!this._isEnabled?(this._isEnabled=!0,this._goQuickPulse()):!e&&this._isEnabled&&(this._isEnabled=!1,clearTimeout(this._handle),this._handle=void 0)},e.prototype.enableCollectors=function(e){this._collectors.forEach((function(t){t.enable(e)}))},e.prototype._addMetric=function(e){var t=e.value,n=e.count||1,r=a.PerformanceToQuickPulseCounter[e.name];r&&(this._metrics[r]?(this._metrics[r].Value=(this._metrics[r].Value*this._metrics[r].Weight+t*n)/(this._metrics[r].Weight+n),this._metrics[r].Weight+=n):(this._metrics[r]=o.createQuickPulseMetric(e),this._metrics[r].Name=r,this._metrics[r].Weight=1))},e.prototype._resetQuickPulseBuffer=function(){delete this._metrics,this._metrics={},this._documents.length=0},e.prototype._goQuickPulse=function(){var t=this,n=Object.keys(this._metrics).map((function(e){return t._metrics[e]})),r=o.createQuickPulseEnvelope(n,this._documents.slice(),this.config,this.context);this._resetQuickPulseBuffer(),this._isCollectingData?this._post(r):this._ping(r);var i=this._isCollectingData?e.POST_INTERVAL:e.PING_INTERVAL;this._isCollectingData&&Date.now()-this._lastSuccessTime>=e.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded?(this._isCollectingData=!1,i=e.FALLBACK_INTERVAL):!this._isCollectingData&&Date.now()-this._lastSuccessTime>=e.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded&&(i=e.FALLBACK_INTERVAL),this._lastSendSucceeded=null,this._handle=setTimeout(this._goQuickPulse.bind(this),i),this._handle.unref()},e.prototype._ping=function(e){this._sender.ping(e,this._quickPulseDone.bind(this))},e.prototype._post=function(e){this._sender.post(e,this._quickPulseDone.bind(this))},e.prototype._quickPulseDone=function(e,t){null!=e?(this._isCollectingData!==e&&(r.info("Live Metrics sending data",e),this.enableCollectors(e)),this._isCollectingData=e,t&&t.statusCode<300&&t.statusCode>=200?(this._lastSuccessTime=Date.now(),this._lastSendSucceeded=!0):this._lastSendSucceeded=!1):this._lastSendSucceeded=!1},e.MAX_POST_WAIT_TIME=2e4,e.MAX_PING_WAIT_TIME=6e4,e.FALLBACK_INTERVAL=6e4,e.PING_INTERVAL=5e3,e.POST_INTERVAL=1e3,e}();e.exports=u},9036:e=>{"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"}},2588:(e,t,n)=>{"use strict";var r=n(5747),i=n(2087),o=n(5622),s=n(8761),a=n(3129),c=n(5282),u=n(8723),l=n(5740),p=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,o={method:"POST",withCredentials:!1,headers:{"Content-Type":"application/x-json-stream"}};s.gzip(t,(function(s,a){var p=a;s?(c.warn(s),p=t,o.headers["Content-Length"]=t.length.toString()):(o.headers["Content-Encoding"]="gzip",o.headers["Content-Length"]=a.length),c.info(e.TAG,o),o[u.disableCollectionRequestOption]=!0;var f=l.makeRequest(r._config,i,o,(function(i){i.setEncoding("utf-8");var o="";i.on("data",(function(e){o+=e})),i.on("end",(function(){r._numConsecutiveFailures=0,c.info(e.TAG,o),"function"==typeof r._onSuccess&&r._onSuccess(o),"function"==typeof n&&n(o),r._enableDiskRetryMode&&(200===i.statusCode?setTimeout((function(){return r._sendFirstFileOnDisk()}),r._resendInterval).unref():408!==i.statusCode&&429!==i.statusCode&&439!==i.statusCode&&500!==i.statusCode&&503!==i.statusCode||r._storeToDisk(t))}))}));f.on("error",(function(i){if(r._numConsecutiveFailures++,!r._enableDiskRetryMode||r._numConsecutiveFailures>0&&r._numConsecutiveFailures%e.MAX_CONNECTION_FAILURES_BEFORE_WARN==0){var o="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&&(o="Ingestion endpoint could not be reached "+r._numConsecutiveFailures+" consecutive times. There may be resulting telemetry loss. Most recent error:"),c.warn(e.TAG,o,i)}else{o="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";c.info(e.TAG,o,i)}if(r._onErrorHelper(i),"function"==typeof n){var s="error sending telemetry";i&&"function"==typeof i.toString&&(s=i.toString()),n(s)}r._enableDiskRetryMode&&r._storeToDisk(t)})),f.write(p),f.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,o){if(i)return e.ACLED_DIRECTORIES[t]=!1,n(i);r._runICACLS(r._getACLArguments(t,o),(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,o){i&&"ENOENT"===i.code?r.mkdir(e,(function(r){r&&"EEXIST"!==r.code?t(r):n._applyACLRules(e,t)})):!i&&o.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 s=null,a=0,c=0;if(0!==i.length)for(var u=0;un._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=o.join(s,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=o.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 s=this._getShallowDirectorySizeSync(n);if(s>this._maxBytesOnDisk)return void c.info(e.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+s);var a=(new Date).getTime()+".ai.json",u=o.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=o.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 o.basename(e).indexOf(".ai.json")>-1}))).length>0){var s=i[0],a=o.join(n,s);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=p},7625:(e,t,n)=>{"use strict";var r=n(8835),i=n(9253),o=n(4470),s=n(5290),a=n(3504),c=n(9428),u=n(894),l=n(2588),p=n(5740),f=n(5282),d=n(9813),h=function(){function e(e){this._telemetryProcessors=[];var t=new i(e);this.config=t,this.context=new o,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.trackAvailability=function(e){this.track(e,s.TelemetryType.Availability)},e.prototype.trackTrace=function(e){this.track(e,s.TelemetryType.Trace)},e.prototype.trackMetric=function(e){this.track(e,s.TelemetryType.Metric)},e.prototype.trackException=function(e){e&&e.exception&&!p.isError(e.exception)&&(e.exception=new Error(e.exception.toString())),this.track(e,s.TelemetryType.Exception)},e.prototype.trackEvent=function(e){this.track(e,s.TelemetryType.Event)},e.prototype.trackRequest=function(e){this.track(e,s.TelemetryType.Request)},e.prototype.trackDependency=function(e){e&&!e.target&&e.data&&(e.target=r.parse(e.data).host),this.track(e,s.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&&s.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()}),c.performanceMetricsTelemetryProcessor(n,this.quickPulseClient),r&&this.channel.send(n)}else f.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{"use strict";var r=n(5740),i=n(9962),o=function(){function e(t,n){if(this.traceFlag=e.DEFAULT_TRACE_FLAG,this.version=e.DEFAULT_VERSION,t&&"string"==typeof t)if(t.split(",").length>1)this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16);else{var o=t.trim().split("-"),s=o.length;s>=4?(this.version=o[0],this.traceId=o[1],this.spanId=o[2],this.traceFlag=o[3]):(this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16)),this.version.match(/^[0-9a-f]{2}$/g)||(this.version=e.DEFAULT_VERSION,this.traceId=r.w3cTraceId()),"00"===this.version&&4!==s&&(this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16)),"ff"===this.version&&(this.version=e.DEFAULT_VERSION,this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16)),this.version.match(/^0[0-9a-f]$/g)||(this.version=e.DEFAULT_VERSION),this.traceFlag.match(/^[0-9a-f]{2}$/g)||(this.traceFlag=e.DEFAULT_TRACE_FLAG,this.traceId=r.w3cTraceId()),e.isValidTraceId(this.traceId)||(this.traceId=r.w3cTraceId()),e.isValidSpanId(this.spanId)||(this.spanId=r.w3cTraceId().substr(0,16),this.traceId=r.w3cTraceId()),this.parentId=this.getBackCompatRequestId()}else if(n){this.parentId=n.slice();var a=i.getRootId(n);e.isValidTraceId(a)||(this.legacyRootId=a,a=r.w3cTraceId()),-1!==n.indexOf("|")&&(n=n.substring(1+n.substring(0,n.length-1).lastIndexOf("."),n.length-1)),this.traceId=a,this.spanId=n}else this.traceId=r.w3cTraceId(),this.spanId=r.w3cTraceId().substr(0,16)}return e.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},e.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},e.prototype.getBackCompatRequestId=function(){return"|"+this.traceId+"."+this.spanId+"."},e.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},e.prototype.updateSpanId=function(){this.spanId=r.w3cTraceId().substr(0,16)},e.DEFAULT_TRACE_FLAG="01",e.DEFAULT_VERSION="00",e}();e.exports=o},6333:e=>{"use strict";var t=function(){function e(e){this.fieldmap=[],e&&(this.fieldmap=this.parseHeader(e))}return e.prototype.toString=function(){var e=this.fieldmap;return e&&0!=e.length?e.join(", "):null},e.validateKeyChars=function(e){var t=e.split("@");if(2==t.length){var n=t[0].trim(),r=t[1].trim(),i=Boolean(n.match(/^[\ ]?[a-z0-9\*\-\_/]{1,241}$/)),o=Boolean(r.match(/^[\ ]?[a-z0-9\*\-\_/]{1,14}$/));return i&&o}return 1==t.length&&Boolean(e.match(/^[\ ]?[a-z0-9\*\-\_/]{1,256}$/))},e.prototype.parseHeader=function(t){var n=[],r={},i=t.split(",");if(i.length>32)return null;for(var o=0,s=i;o>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 o=n[8+4*Math.random()|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+o+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="",o=t[r],s=typeof o;if(e.isPrimitive(o))i=o.toString();else if(null===o||"undefined"===s)i="";else{if("function"===s){c.info("key: "+r+" was function; will not serialize");continue}var a=e.isArray(o)?o:e.extractObject(o);try{i=e.isPrimitive(a)?a:JSON.stringify(a)}catch(e){i=o.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{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4350),i=n(5290);t.performanceMetricsTelemetryProcessor=function(e,t){switch(t&&t.addDocument(e),e.data.baseType){case i.TelemetryTypeString.Exception:r.countException();break;case i.TelemetryTypeString.Request:var n=e.data.baseData;r.countRequest(n.duration,n.success);break;case i.TelemetryTypeString.Dependency:var o=e.data.baseData;r.countDependency(o.duration,o.success)}return!0}},2037:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5290);function i(e){var t=2147483647,n=5381;if(!e)return 0;for(;e.length<8;)e+=e;for(var r=0;r=100||(!(!e.data||r.TelemetryType.Metric!==r.baseTypeToTelemetryType(e.data.baseType))||(t.correlationContext&&t.correlationContext.operation?i(t.correlationContext.operation.id){"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(2037)),r(n(4127))},9574:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(894),o=n(6281),s=n(6639),a=n(4350),c=n(8723),u=n(731),l=n(9962),p=n(5282),f=n(3668),d=n(1629);t.TelemetryClient=n(1259),t.Contracts=n(5290),function(e){e[e.AI=0]="AI",e[e.AI_AND_W3C=1]="AI_AND_W3C"}(r=t.DistributedTracingModes||(t.DistributedTracingModes={}));var h,m,g,v,y,_,E,b,w,S=!0,I=!1,C=!0,x=!0,O=!0,T=!0,A=!0,N=!0,P=!1,L=!0,R=void 0,k=void 0,D=!1;function M(){return t.defaultClient?(D=!0,g.enable(S,I),v.enable(C),y.enable(x),_.enable(L,m),E.useAutoCorrelation(N,h),E.enable(O),b.enable(T),t.liveMetricsClient&&P&&t.liveMetricsClient.enable(P)):p.warn("Start cannot be called before setup"),V}t.setup=function(e){return t.defaultClient?p.info("The default client is already setup"):(t.defaultClient=new t.TelemetryClient(e),g=new o(t.defaultClient),v=new s(t.defaultClient),y=new a(t.defaultClient),E=new u(t.defaultClient),b=new c(t.defaultClient),_||(_=new d.AutoCollectNativePerformance(t.defaultClient))),t.defaultClient&&t.defaultClient.channel&&t.defaultClient.channel.setUseDiskRetryCaching(A,R,k),V},t.start=M,t.getCorrelationContext=function(){return N?i.CorrelationContextManager.getCurrentContext():null},t.wrapWithCorrelationContext=function(e){return i.CorrelationContextManager.wrapCallback(e)};var V=function(){function e(){}return e.setDistributedTracingMode=function(t){return l.w3cEnabled=t===r.AI_AND_W3C,e},e.setAutoCollectConsole=function(t,n){return void 0===n&&(n=!1),S=t,I=n,D&&g.enable(t,n),e},e.setAutoCollectExceptions=function(t){return C=t,D&&v.enable(t),e},e.setAutoCollectPerformance=function(t,n){void 0===n&&(n=!0),x=t;var r=d.AutoCollectNativePerformance.parseEnabled(n);return L=r.isEnabled,m=r.disabledMetrics,D&&(y.enable(t),_.enable(r.isEnabled,r.disabledMetrics)),e},e.setAutoCollectRequests=function(t){return O=t,D&&E.enable(t),e},e.setAutoCollectDependencies=function(t){return T=t,D&&b.enable(t),e},e.setAutoDependencyCorrelation=function(t,n){return N=t,h=n,D&&E.useAutoCorrelation(t,n),e},e.setUseDiskRetryCaching=function(n,r,i){return A=n,R=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),p.enableDebug=t,p.disableWarnings=!n,e},e.setSendLiveMetrics=function(n){return void 0===n&&(n=!1),t.defaultClient?(!t.liveMetricsClient&&n?(t.liveMetricsClient=new f(t.defaultClient.config.instrumentationKey),w=new a(t.liveMetricsClient,1e3,!0),t.liveMetricsClient.addCollector(w),t.defaultClient.quickPulseClient=t.liveMetricsClient):t.liveMetricsClient&&t.liveMetricsClient.enable(n),P=n,e):(p.warn("Live metrics client cannot be setup without the default client"),e)},e.start=M,e}();t.Configuration=V,t.dispose=function(){t.defaultClient=null,D=!1,g&&g.dispose(),v&&v.dispose(),y&&y.dispose(),_&&_.dispose(),E&&E.dispose(),b&&b.dispose(),t.liveMetricsClient&&(t.liveMetricsClient.enable(!1),P=!1,t.liveMetricsClient=void 0)}},9822:(e,t,n)=>{"use strict";const r=process.binding("async_wrap"),i=r.Providers.TIMERWRAP,o={nextTick:n(3269),promise:n(9565),timers:n(7190)},s=new Set;function a(){this.enabled=!1,this.counter=0}function c(){const e=this.initFns=[],t=this.preFns=[],n=this.postFns=[],r=this.destroyFns=[];this.init=function(t,n,r,o){if(n!==i)for(const i of e)i(t,this,n,r,o);else s.add(t)},this.pre=function(e){if(!s.has(e))for(const n of t)n(e,this)},this.post=function(e,t){if(!s.has(e))for(const r of n)r(e,this,t)},this.destroy=function(e){if(s.has(e))s.delete(e);else for(const t of r)t(e)}}function u(e,t){const n=e.indexOf(t);-1!==n&&e.splice(n,1)}function l(){this._state=new a,this._hooks=new c,this.version=n(1910).i8,this.providers=r.Providers;for(const e of Object.keys(o))o[e].call(this);process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")&&console.warn("warning: you are using async-hook-jl which is unstable."),r.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}c.prototype.add=function(e){e.init&&this.initFns.push(e.init),e.pre&&this.preFns.push(e.pre),e.post&&this.postFns.push(e.post),e.destroy&&this.destroyFns.push(e.destroy)},c.prototype.remove=function(e){e.init&&u(this.initFns,e.init),e.pre&&u(this.preFns,e.pre),e.post&&u(this.postFns,e.post),e.destroy&&u(this.destroyFns,e.destroy)},e.exports=l,l.prototype.addHooks=function(e){this._hooks.add(e)},l.prototype.removeHooks=function(e){this._hooks.remove(e)},l.prototype.enable=function(){this._state.enabled=!0,r.enable()},l.prototype.disable=function(){this._state.enabled=!1,r.disable()}},3223:(e,t,n)=>{"use strict";const r=n(9822);if(global._asyncHook){if(global._asyncHook.version!==n(1910).i8)throw new Error("Conflicting version of async-hook-jl found");e.exports=global._asyncHook}else{n(2512).filter.attach((function(e,t){return t.filter((function(e){const t=e.getFileName();return!(t&&t.slice(0,__dirname.length)===__dirname)}))})),e.exports=global._asyncHook=new r}},1910:e=>{"use strict";e.exports={i8:"1.7.6"}},3269:e=>{"use strict";function t(){}e.exports=function(){const e=this._hooks,n=this._state,r=process.nextTick;process.nextTick=function(){if(!n.enabled)return r.apply(process,arguments);const i=new Array(arguments.length);for(let e=0;e0&&process.once("uncaughtException",(function(){e.post.call(s,a,!0),e.destroy.call(null,a)}))}e.post.call(s,a,!1),e.destroy.call(null,a)},r.apply(process,i)}}},9565:e=>{"use strict";function t(){}e.exports=function(){const e=this._hooks,n=this._state,r=global.Promise,i=r.prototype.then;function o(t,n,r,i){return"function"!=typeof t?i?function(t){return function(n){return e.destroy.call(null,t),n}}(r):function(t){return function(n){throw e.destroy.call(null,t),n}}(r):function(){e.pre.call(n,r);try{return t.apply(this,arguments)}finally{e.post.call(n,r,!1),e.destroy.call(null,r)}}}r.prototype.then=function(r,s){if(!n.enabled)return i.call(this,r,s);const a=new t,c=--n.counter;return e.init.call(a,c,0,null,null),i.call(this,o(r,a,c,!0),o(s,a,c,!1))}}},7190:(e,t,n)=>{"use strict";const r=n(8213);function i(){}function o(){}function s(){}const a=new Map,c=new Map,u=new Map;let l=null,p=!1;function f(e,t,n,i,o,s,a){const c=r[n],u=r[i];r[n]=function(){if(!t.enabled)return c.apply(r,arguments);const n=new Array(arguments.length);for(let e=0;e0&&process.once("uncaughtException",(function(){e.post.call(u,f,!0),s.delete(d),e.destroy.call(null,f)}))}e.post.call(u,f,!1),l=null,(a||p)&&(p=!1,s.delete(d),e.destroy.call(null,f))},d=c.apply(r,n),s.set(d,f),d},r[i]=function(t){if(l===t&&null!==t)p=!0;else if(s.has(t)){const n=s.get(t);s.delete(t),e.destroy.call(null,n)}u.apply(r,arguments)}}e.exports=function(){f(this._hooks,this._state,"setTimeout","clearTimeout",i,a,!0),f(this._hooks,this._state,"setInterval","clearInterval",o,c,!1),f(this._hooks,this._state,"setImmediate","clearImmediate",s,u,!0),global.setTimeout=r.setTimeout,global.setInterval=r.setInterval,global.setImmediate=r.setImmediate,global.clearTimeout=r.clearTimeout,global.clearInterval=r.clearInterval,global.clearImmediate=r.clearImmediate}},8286:e=>{"use strict";e.exports=(e,t)=>class extends e{constructor(e){var n,r;super((function(e,o){n=this,r=[function(n){return t(i,!1),e(n)},function(e){return t(i,!1),o(e)}]}));var i=this;try{e.apply(n,r)}catch(e){r[1](e)}return i}}},9090:(e,t,n)=>{var r,i,o=n(6372).wrap,s=[],a=0,c=!1,u=[];function l(e,t){var n=e.length,r=t.length,i=[];if(0===n&&0===r)return i;for(var o=0;o0&&(s=u.pop()),p=void 0,n&&!c},i=function(e,t,n){var r=[];c=!0;for(var i=0;i0&&t[i].before(this,r[t[i].uid]);c=!1;var o=e.apply(this,arguments);for(c=!0,i=0;i0&&t[i].after(this,r[t[i].uid]);return c=!1,s=u.pop(),p=void 0,o}},o(process,"_fatalException",(function(e){return function(t){return r(t)||e(t)}}))}else{var d=!1;r=function(e){if(d)throw e;for(var t=!1,n=s.length,r=0;r0&&t[f].before(this,i[t[f].uid]);c=!1;try{o=e.apply(this,arguments)}catch(e){a=!0;for(f=0;f0&&t[f].after(this,i[t[f].uid]);c=!1}s=u.pop()}return o}},process.addListener("uncaughtException",r)}function h(e,t){"function"==typeof e.create&&(this.create=e.create,this.flags|=1),"function"==typeof e.before&&(this.before=e.before,this.flags|=2),"function"==typeof e.after&&(this.after=e.after,this.flags|=4),"function"==typeof e.error&&(this.error=e.error,this.flags|=8),this.uid=++a,this.data=void 0===t?null:t}function m(e,t){if("object"!=typeof e||!e)throw new TypeError("callbacks argument must be an object");return e instanceof h?e:new h(e,t)}h.prototype.create=void 0,h.prototype.before=void 0,h.prototype.after=void 0,h.prototype.error=void 0,h.prototype.data=void 0,h.prototype.uid=0,h.prototype.flags=0,process.createAsyncListener=m,process.addAsyncListener=function(e,t){var n;n=e instanceof h?e:m(e,t);for(var r=!1,i=0;i0)return i(e,n,t);return function(e,t,n){c=!0;for(var r=0;r{"use strict";if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var r=n(6372),i=n(1249),o=r.wrap,s=r.massWrap,a=n(9090),c=n(1669),u=i.gte(process.version,"6.0.0"),l=i.gte(process.version,"7.0.0"),p=i.gte(process.version,"8.0.0"),f=i.gte(process.version,"11.0.0"),d=n(1631);function h(e){return function(){this.on("connection",(function(e){e._handle&&(e._handle.onread=a(e._handle.onread))}));try{return e.apply(this,arguments)}finally{this._handle&&this._handle.onconnection&&(this._handle.onconnection=a(this._handle.onconnection))}}}function m(e){if(e&&e._handle){var t=e._handle;t._originalOnread||(t._originalOnread=t.onread),t.onread=a(t._originalOnread)}}l&&!d._normalizeArgs?d._normalizeArgs=function(e){if(0===e.length)return[{},null];var t,n,r=e[0],i={};"object"==typeof r&&null!==r?i=r:"string"==typeof(t=r)&&!1===(n=t,(n=Number(n))>=0&&n)?i.path=r:(i.port=r,e.length>1&&"string"==typeof e[1]&&(i.host=e[1]));var o=e[e.length-1];return"function"!=typeof o?[i,null]:[i,o]}:l||d._normalizeConnectArgs||(d._normalizeConnectArgs=function(e){var t,n={};"object"==typeof e[0]&&null!==e[0]?n=e[0]:"string"==typeof e[0]&&!1===(t=e[0],(t=Number(t))>=0&&t)?n.path=e[0]:(n.port=e[0],"string"==typeof e[1]&&(n.host=e[1]));var r=e[e.length-1];return"function"==typeof r?[n,r]:[n]}),"_setUpListenHandle"in d.Server.prototype?o(d.Server.prototype,"_setUpListenHandle",h):o(d.Server.prototype,"_listen2",h),o(d.Socket.prototype,"connect",(function(e){return function(){var t;(t=p&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0?arguments[0]:l?d._normalizeArgs(arguments):d._normalizeConnectArgs(arguments))[1]&&(t[1]=a(t[1]));var n=e.apply(this,t);return m(this),n}}));var g=n(8605);o(g.Agent.prototype,"addRequest",(function(e){return function(t){var n=t.onSocket;return t.onSocket=a((function(e){return m(e),n.apply(this,arguments)})),e.apply(this,arguments)}}));var v=n(3129);function y(e){Array.isArray(e.stdio)&&e.stdio.forEach((function(e){e&&e._handle&&(e._handle.onread=a(e._handle.onread),o(e._handle,"close",L))})),e._handle&&(e._handle.onexit=a(e._handle.onexit))}v.ChildProcess?o(v.ChildProcess.prototype,"spawn",(function(e){return function(){var t=e.apply(this,arguments);return y(this),t}})):s(v,["execFile","fork","spawn"],(function(e){return function(){var t=e.apply(this,arguments);return y(t),t}})),process._fatalException||(process._originalNextTick=process.nextTick);var _=[];process._nextDomainTick&&_.push("_nextDomainTick"),process._tickDomainCallback&&_.push("_tickDomainCallback"),s(process,_,P),o(process,"nextTick",L);var E=["setTimeout","setInterval"];global.setImmediate&&E.push("setImmediate");var b=n(8213),w=global.setTimeout===b.setTimeout;s(b,E,L),w&&s(global,E,L);var S=n(881);s(S,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],P),S.resolveNaptr&&o(S,"resolveNaptr",P);var I,C,x=n(5747);s(x,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],P),x.lchown&&o(x,"lchown",P),x.lchmod&&o(x,"lchmod",P),x.ftruncate&&o(x,"ftruncate",P);try{I=n(8761)}catch(e){}if(I&&I.Deflate&&I.Deflate.prototype){var O=Object.getPrototypeOf(I.Deflate.prototype);O._transform?o(O,"_transform",P):O.write&&O.flush&&O.end&&s(O,["write","flush","end"],P)}try{C=n(6417)}catch(e){}if(C){var T=["pbkdf2","randomBytes"];f||T.push("pseudoRandomBytes"),s(C,T,P)}var A=!!global.Promise&&"function Promise() { [native code] }"===Promise.toString()&&"function toString() { [native code] }"===Promise.toString.toString();if(A){var N=process.addAsyncListener({create:function(){A=!1}});global.Promise.resolve(!0).then((function(){A=!1})),process.removeAsyncListener(N)}function P(e){var t=function(){var t,n=arguments.length-1;if("function"==typeof arguments[n]){t=Array(arguments.length);for(var r=0;r{"use strict";class n{constructor(e){this.tasks=[],this.count=e}sched(){if(this.count>0&&this.tasks.length>0){this.count--;let e=this.tasks.shift();if(void 0===e)throw"Unexpected undefined value in tasks list";e()}}acquire(){return new Promise(((e,t)=>{this.tasks.push((()=>{var t=!1;e((()=>{t||(t=!0,this.count++,this.sched())}))})),process&&process.nextTick?process.nextTick(this.sched.bind(this)):setImmediate(this.sched.bind(this))}))}use(e){return this.acquire().then((t=>e().then((e=>(t(),e))).catch((e=>{throw t(),e}))))}}t.Semaphore=n;t.Mutex=class extends n{constructor(){super(1)}}},9669:(e,t,n)=>{e.exports=n(1609)},7970:(e,t,n)=>{"use strict";var r=n(4867),i=n(6026),o=n(4097),s=n(5327),a=n(8605),c=n(7211),u=n(2629).http,l=n(2629).https,p=n(8835),f=n(8761),d=n(1075),h=n(5061),m=n(481),g=/https:?/;function v(e,t,n){if(e.hostname=t.host,e.host=t.host,e.port=t.port,e.path=n,t.auth){var r=Buffer.from(t.auth.username+":"+t.auth.password,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+r}e.beforeRedirect=function(e){e.headers.host=e.host,v(e,t,e.href)}}e.exports=function(e){return new Promise((function(t,n){var y=function(e){t(e)},_=function(e){n(e)},E=e.data,b=e.headers;if("User-Agent"in b||"user-agent"in b?b["User-Agent"]||b["user-agent"]||(delete b["User-Agent"],delete b["user-agent"]):b["User-Agent"]="axios/"+d.version,E&&!r.isStream(E)){if(Buffer.isBuffer(E));else if(r.isArrayBuffer(E))E=Buffer.from(new Uint8Array(E));else{if(!r.isString(E))return _(h("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));E=Buffer.from(E,"utf-8")}b["Content-Length"]=E.length}var w=void 0;e.auth&&(w=(e.auth.username||"")+":"+(e.auth.password||""));var S=o(e.baseURL,e.url),I=p.parse(S),C=I.protocol||"http:";if(!w&&I.auth){var x=I.auth.split(":");w=(x[0]||"")+":"+(x[1]||"")}w&&delete b.Authorization;var O=g.test(C),T=O?e.httpsAgent:e.httpAgent,A={path:s(I.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:b,agent:T,agents:{http:e.httpAgent,https:e.httpsAgent},auth:w};e.socketPath?A.socketPath=e.socketPath:(A.hostname=I.hostname,A.port=I.port);var N,P=e.proxy;if(!P&&!1!==P){var L=C.slice(0,-1)+"_proxy",R=process.env[L]||process.env[L.toUpperCase()];if(R){var k=p.parse(R),D=process.env.no_proxy||process.env.NO_PROXY,M=!0;if(D)M=!D.split(",").map((function(e){return e.trim()})).some((function(e){return!!e&&("*"===e||("."===e[0]&&I.hostname.substr(I.hostname.length-e.length)===e||I.hostname===e))}));if(M&&(P={host:k.hostname,port:k.port,protocol:k.protocol},k.auth)){var V=k.auth.split(":");P.auth={username:V[0],password:V[1]}}}}P&&(A.headers.host=I.hostname+(I.port?":"+I.port:""),v(A,P,C+"//"+I.hostname+(I.port?":"+I.port:"")+A.path));var F=O&&(!P||g.test(P.protocol));e.transport?N=e.transport:0===e.maxRedirects?N=F?c:a:(e.maxRedirects&&(A.maxRedirects=e.maxRedirects),N=F?l:u),e.maxBodyLength>-1&&(A.maxBodyLength=e.maxBodyLength);var j=N.request(A,(function(t){if(!j.aborted){var n=t,o=t.req||j;if(204!==t.statusCode&&"HEAD"!==o.method&&!1!==e.decompress)switch(t.headers["content-encoding"]){case"gzip":case"compress":case"deflate":n=n.pipe(f.createUnzip()),delete t.headers["content-encoding"]}var s={status:t.statusCode,statusText:t.statusMessage,headers:t.headers,config:e,request:o};if("stream"===e.responseType)s.data=n,i(y,_,s);else{var a=[],c=0;n.on("data",(function(t){a.push(t),c+=t.length,e.maxContentLength>-1&&c>e.maxContentLength&&(n.destroy(),_(h("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,o)))})),n.on("error",(function(t){j.aborted||_(m(t,e,null,o))})),n.on("end",(function(){var t=Buffer.concat(a);"arraybuffer"!==e.responseType&&(t=t.toString(e.responseEncoding),e.responseEncoding&&"utf8"!==e.responseEncoding||(t=r.stripBOM(t))),s.data=t,i(y,_,s)}))}}}));if(j.on("error",(function(t){j.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==t.code||_(m(t,e,null,j))})),e.timeout){var B=parseInt(e.timeout,10);if(isNaN(B))return void _(h("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",j));j.setTimeout(B,(function(){j.abort(),_(h("timeout of "+B+"ms exceeded",e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",j))}))}e.cancelToken&&e.cancelToken.promise.then((function(e){j.aborted||(j.abort(),_(e))})),r.isStream(E)?E.on("error",(function(t){_(m(t,e,null,j))})).pipe(j):j.end(E)}))}},5448:(e,t,n)=>{"use strict";var r=n(4867),i=n(6026),o=n(3691),s=n(5327),a=n(4097),c=n(4109),u=n(7985),l=n(5061);e.exports=function(e){return new Promise((function(t,n){var p=e.data,f=e.headers,d=e.responseType;r.isFormData(p)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(m+":"+g)}var v=a(e.baseURL,e.url);function y(){if(h){var r="getAllResponseHeaders"in h?c(h.getAllResponseHeaders()):null,o={data:d&&"text"!==d&&"json"!==d?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:e,request:h};i(t,n,o),h=null}}if(h.open(e.method.toUpperCase(),s(v,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,"onloadend"in h?h.onloadend=y:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(y)},h.onabort=function(){h&&(n(l("Request aborted",e,"ECONNABORTED",h)),h=null)},h.onerror=function(){n(l("Network Error",e,null,h)),h=null},h.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var _=(e.withCredentials||u(v))&&e.xsrfCookieName?o.read(e.xsrfCookieName):void 0;_&&(f[e.xsrfHeaderName]=_)}"setRequestHeader"in h&&r.forEach(f,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete f[t]:h.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),d&&"json"!==d&&(h.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&h.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),n(e),h=null)})),p||(p=null),h.send(p)}))}},1609:(e,t,n)=>{"use strict";var r=n(4867),i=n(1849),o=n(321),s=n(7185);function a(e){var t=new o(e),n=i(o.prototype.request,t);return r.extend(n,o.prototype,t),r.extend(n,t),n}var c=a(n(5655));c.Axios=o,c.create=function(e){return a(s(c.defaults,e))},c.Cancel=n(5263),c.CancelToken=n(4972),c.isCancel=n(6502),c.all=function(e){return Promise.all(e)},c.spread=n(8713),c.isAxiosError=n(6268),e.exports=c,e.exports.default=c},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,n)=>{"use strict";var r=n(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,n)=>{"use strict";var r=n(4867),i=n(5327),o=n(782),s=n(3572),a=n(7185),c=n(4875),u=c.validators;function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&c.assertOptions(t,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var n=[],r=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(r=r&&t.synchronous,n.unshift(t.fulfilled,t.rejected))}));var i,o=[];if(this.interceptors.response.forEach((function(e){o.push(e.fulfilled,e.rejected)})),!r){var l=[s,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(o),i=Promise.resolve(e);l.length;)i=i.then(l.shift(),l.shift());return i}for(var p=e;n.length;){var f=n.shift(),d=n.shift();try{p=f(p)}catch(e){d(e);break}}try{i=s(p)}catch(e){return Promise.reject(e)}for(;o.length;)i=i.then(o.shift(),o.shift());return i},l.prototype.getUri=function(e){return e=a(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(a(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,r){return this.request(a(r||{},{method:e,url:t,data:n}))}})),e.exports=l},782:(e,t,n)=>{"use strict";var r=n(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,n)=>{"use strict";var r=n(1793),i=n(9002);e.exports=function(e,t){return e&&!r(t)?i(e,t):t}},5061:(e,t,n)=>{"use strict";var r=n(481);e.exports=function(e,t,n,i,o){var s=new Error(e);return r(s,t,n,i,o)}},3572:(e,t,n)=>{"use strict";var r=n(4867),i=n(8527),o=n(6502),s=n(5655);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},7185:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){t=t||{};var n={},i=["url","method","data"],o=["headers","auth","proxy","params"],s=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],a=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function u(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=c(void 0,e[i])):n[i]=c(e[i],t[i])}r.forEach(i,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(o,u),r.forEach(s,(function(i){r.isUndefined(t[i])?r.isUndefined(e[i])||(n[i]=c(void 0,e[i])):n[i]=c(void 0,t[i])})),r.forEach(a,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var l=i.concat(o).concat(s).concat(a),p=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(p,u),n}},6026:(e,t,n)=>{"use strict";var r=n(5061);e.exports=function(e,t,n){var i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},8527:(e,t,n)=>{"use strict";var r=n(4867),i=n(5655);e.exports=function(e,t,n){var o=this||i;return r.forEach(n,(function(n){e=n.call(o,e,t)})),e}},5655:(e,t,n)=>{"use strict";var r=n(4867),i=n(6016),o=n(481),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:("undefined"!=typeof XMLHttpRequest?c=n(5448):"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)&&(c=n(7970)),c),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)||t&&"application/json"===t["Content-Type"]?(a(t,"application/json"),function(e,t,n){if(r.isString(e))try{return(t||JSON.parse)(e),r.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,n=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,s=!n&&"json"===this.responseType;if(s||i&&r.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(s){if("SyntaxError"===e.name)throw o(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){u.headers[e]=r.merge(s)})),e.exports=u},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r{"use strict";var r=n(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o;if(n)o=n(t);else if(r.isURLSearchParams(t))o=t.toString();else{var s=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),s.push(i(t)+"="+i(e))})))})),o=s.join("&")}if(o){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},9002:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},3691:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,s){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(i)&&a.push("path="+i),r.isString(o)&&a.push("domain="+o),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,n)=>{"use strict";var r=n(4867);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},6016:(e,t,n)=>{"use strict";var r=n(4867);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},4109:(e,t,n)=>{"use strict";var r=n(4867),i=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,o,s={};return e?(r.forEach(e.split("\n"),(function(e){if(o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t){if(s[t]&&i.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+", "+n:n}})),s):s}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,n)=>{"use strict";var r=n(1075),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var o={},s=r.version.split(".");function a(e,t){for(var n=t?t.split("."):s,r=e.split("."),i=0;i<3;i++){if(n[i]>r[i])return!0;if(n[i]0;){var o=r[i],s=t[o];if(s){var a=e[o],c=void 0===a||s(a,o,e);if(!0!==c)throw new TypeError("option "+o+" must be "+c)}else if(!0!==n)throw Error("Unknown option "+o)}},validators:i}},4867:(e,t,n)=>{"use strict";var r=n(1849),i=Object.prototype.toString;function o(e){return"[object Array]"===i.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===i.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),o(e))for(var n=0,r=e.length;n{var r;e.exports=function(){if(!r){try{r=n(5158)("follow-redirects")}catch(e){}"function"!=typeof r&&(r=function(){})}r.apply(null,arguments)}},2629:(e,t,n)=>{var r=n(8835),i=r.URL,o=n(8605),s=n(7211),a=n(2413).Writable,c=n(2357),u=n(7109),l=["abort","aborted","connect","error","socket","timeout"],p=Object.create(null);l.forEach((function(e){p[e]=function(t,n,r){this._redirectable.emit(e,t,n,r)}}));var f=b("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),d=b("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),h=b("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),m=b("ERR_STREAM_WRITE_AFTER_END","write after end");function g(e,t){a.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var n=this;this._onNativeResponse=function(e){n._processResponse(e)},this._performRequest()}function v(e){var t={maxRedirects:21,maxBodyLength:10485760},n={};return Object.keys(e).forEach((function(o){var s=o+":",a=n[s]=e[o],l=t[o]=Object.create(a);Object.defineProperties(l,{request:{value:function(e,o,a){if("string"==typeof e){var l=e;try{e=_(new i(l))}catch(t){e=r.parse(l)}}else i&&e instanceof i?e=_(e):(a=o,o=e,e={protocol:s});return"function"==typeof o&&(a=o,o=null),(o=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},e,o)).nativeProtocols=n,c.equal(o.protocol,s,"protocol mismatch"),u("options",o),new g(o,a)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,t,n){var r=l.request(e,t,n);return r.end(),r},configurable:!0,enumerable:!0,writable:!0}})})),t}function y(){}function _(e){var t={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(t.port=Number(e.port)),t}function E(e,t){var n;for(var r in t)e.test(r)&&(n=t[r],delete t[r]);return null==n?void 0:String(n).trim()}function b(e,t){function n(e){Error.captureStackTrace(this,this.constructor),e?(this.message=t+": "+e.message,this.cause=e):this.message=t}return n.prototype=new Error,n.prototype.constructor=n,n.prototype.name="Error ["+e+"]",n.prototype.code=e,n}function w(e){for(var t=0;t=400)return e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),void(this._requestBodyBuffers=[]);if(w(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)this.emit("error",new d);else{((301===t||302===t)&&"POST"===this._options.method||303===t&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],E(/^content-/i,this._options.headers));var i,o=E(/^host$/i,this._options.headers),s=r.parse(this._currentUrl),a=o||s.host,c=/^\w+:/.test(n)?this._currentUrl:r.format(Object.assign(s,{host:a}));try{i=r.resolve(c,n)}catch(e){return void this.emit("error",new f(e))}u("redirecting to",i),this._isRedirect=!0;var l=r.parse(i);if(Object.assign(this._options,l),(l.protocol!==s.protocol&&"https:"!==l.protocol||l.host!==a&&!function(e,t){const n=e.length-t.length-1;return n>0&&"."===e[n]&&e.endsWith(t)}(l.host,a))&&E(/^(?:authorization|cookie)$/i,this._options.headers),"function"==typeof this._options.beforeRedirect){var p={headers:e.headers};try{this._options.beforeRedirect.call(null,this._options,p)}catch(e){return void this.emit("error",e)}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(e){this.emit("error",new f(e))}}},e.exports=v({http:o,https:s}),e.exports.wrap=v},1075:e=>{"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},5623:e=>{"use strict";function t(e,t,i){e instanceof RegExp&&(e=n(e,i)),t instanceof RegExp&&(t=n(t,i));var o=r(e,t,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+e.length,o[1]),post:i.slice(o[1]+t.length)}}function n(e,t){var n=t.match(e);return n?n[0]:null}function r(e,t,n){var r,i,o,s,a,c=n.indexOf(e),u=n.indexOf(t,c+1),l=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],o=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())=0?c:u;r.length&&(a=[o,s])}return a}e.exports=t,t.range=r},3644:(e,t,n)=>{var r=n(1048),i=n(5623);e.exports=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return v(function(e){return e.split("\\\\").join(o).split("\\{").join(s).split("\\}").join(a).split("\\,").join(c).split("\\.").join(u)}(e),!0).map(p)};var o="\0SLASH"+Math.random()+"\0",s="\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 p(e){return e.split(o).join("\\").split(s).join("{").split(a).join("}").split(c).join(",").split(u).join(".")}function f(e){if(!e)return[""];var t=[],n=i("{","}",e);if(!n)return e.split(",");var r=n.pre,o=n.body,s=n.post,a=r.split(",");a[a.length-1]+="{"+o+"}";var c=f(s);return s.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),t.push.apply(t,a),t}function d(e){return"{"+e+"}"}function h(e){return/^-?0\d/.test(e)}function m(e,t){return e<=t}function g(e,t){return e>=t}function v(e,t){var n=[],o=i("{","}",e);if(!o||/\$$/.test(o.pre))return[e];var s,c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),p=c||u,y=o.body.indexOf(",")>=0;if(!p&&!y)return o.post.match(/,.*\}/)?v(e=o.pre+"{"+o.body+a+o.post):[e];if(p)s=o.body.split(/\.\./);else if(1===(s=f(o.body)).length&&1===(s=v(s[0],!1).map(d)).length)return(b=o.post.length?v(o.post,!1):[""]).map((function(e){return o.pre+s[0]+e}));var _,E=o.pre,b=o.post.length?v(o.post,!1):[""];if(p){var w=l(s[0]),S=l(s[1]),I=Math.max(s[0].length,s[1].length),C=3==s.length?Math.abs(l(s[2])):1,x=m;S0){var P=new Array(N+1).join("0");A=T<0?"-"+P+A.slice(1):P+A}}_.push(A)}}else _=r(s,(function(e){return v(e,!1)}));for(var L=0;L<_.length;L++)for(var R=0;R{var r=n(4293).Buffer,i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function o(e){if(r.isBuffer(e))return e;var t="function"==typeof r.alloc&&"function"==typeof r.from;if("number"==typeof e)return t?r.alloc(e):new r(e);if("string"==typeof e)return t?r.from(e):new r(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function s(e){var t=o(4);return t.writeInt32BE(e,0),t}function a(e,t){e=o(e),r.isBuffer(t)&&(t=t.readUInt32BE(0));for(var n=-1^~~t,s=0;s>>8;return-1^n}function c(){return s(a.apply(null,arguments))}"undefined"!=typeof Int32Array&&(i=new Int32Array(i)),c.signed=function(){return a.apply(null,arguments)},c.unsigned=function(){return a.apply(null,arguments)>>>0},e.exports=c},4046:(e,t,n)=>{"use strict";const r=n(1669),i=n(2357),o=n(9867),s=n(3223),a="error@context",c=[];for(let e in s.providers)c[s.providers[e]]=e;const u=process.env.DEBUG_CLS_HOOKED;let l=-1;function p(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map}function f(e){return process.namespaces[e]}function d(e){let t=f(e);i.ok(t,"can't delete nonexistent namespace! \""+e+'"'),i.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function h(e){process.env.DEBUG&&process._rawDebug(e)}function m(e){return e?"function"==typeof e?e.name?e.name:(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1]:e.constructor&&e.constructor.name?e.constructor.name:void 0:e}if(e.exports={getNamespace:f,createNamespace:function(e){i.ok(e,"namespace must be given a name."),u&&h("CREATING NAMESPACE "+e);let t=new p(e);return t.id=l,s.addHooks({init(n,i,o,s,a){l=n,s?(t._contexts.set(n,t._contexts.get(s)),u&&h("PARENTID: "+e+" uid:"+n+" parent:"+s+" provider:"+o)):t._contexts.set(l,t.active),u&&h("INIT "+e+" uid:"+n+" parent:"+s+" provider:"+c[o]+" active:"+r.inspect(t.active,!0))},pre(n,i){l=n;let o=t._contexts.get(n);o?(u&&h(" PRE "+e+" uid:"+n+" handle:"+m(i)+" context:"+r.inspect(o)),t.enter(o)):u&&h(" PRE MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(i))},post(n,i){l=n;let o=t._contexts.get(n);o?(u&&h(" POST "+e+" uid:"+n+" handle:"+m(i)+" context:"+r.inspect(o)),t.exit(o)):u&&h(" POST MISSING CONTEXT "+e+" uid:"+n+" handle:"+m(i))},destroy(n){l=n,u&&h("DESTROY "+e+" uid:"+n+" context:"+r.inspect(t._contexts.get(l))+" active:"+r.inspect(t.active,!0)),t._contexts.delete(n)}}),process.namespaces[e]=t,t},destroyNamespace:d,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){d(e)}));process.namespaces=Object.create(null)},ERROR_SYMBOL:a},p.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return u&&h(" SETTING KEY:"+e+"="+t+" in ns:"+this.name+" uid:"+l+" active:"+r.inspect(this.active,!0)),this.active[e]=t,t},p.prototype.get=function(e){if(this.active)return u&&h(" GETTING KEY:"+e+"="+this.active[e]+" "+this.name+" uid:"+l+" active:"+r.inspect(this.active,!0)),this.active[e];u&&h(" GETTING KEY:"+e+"=undefined "+this.name+" uid:"+l+" active:"+r.inspect(this.active,!0))},p.prototype.createContext=function(){u&&h(" CREATING Context: "+this.name+" uid:"+l+" len:"+this._set.length+" active:"+r.inspect(this.active,!0,2,!0));let e=Object.create(this.active?this.active:Object.prototype);return e._ns_name=this.name,e.id=l,u&&h(" CREATED Context: "+this.name+" uid:"+l+" len:"+this._set.length+" context:"+r.inspect(e,!0,2,!0)),e},p.prototype.run=function(e){let t=this.createContext();this.enter(t);try{return u&&h(" BEFORE RUN: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t)),e(t),t}catch(e){throw e&&(e[a]=t),e}finally{u&&h(" AFTER RUN: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t)}},p.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},p.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return u&&h(" BEFORE runPromise: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(u&&h(" AFTER runPromise: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,u&&h(" AFTER runPromise: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},p.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},p.prototype.enter=function(e){i.ok(e,"context must be provided for entering"),u&&h(" ENTER "+this.name+" uid:"+l+" len:"+this._set.length+" context: "+r.inspect(e)),this._set.push(this.active),this.active=e},p.prototype.exit=function(e){if(i.ok(e,"context must be provided for exiting"),u&&h(" EXIT "+this.name+" uid:"+l+" len:"+this._set.length+" context: "+r.inspect(e)),this.active===e)return i.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(u&&h("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),i.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(i.ok(t,"can't remove top context"),this._set.splice(t,1))},p.prototype.bindEmitter=function(e){i.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;o(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},p.prototype.fromException=function(e){return e[a]},process.namespaces={},s._state&&!s._state.enabled&&s.enable(),u){var g=n(2512);for(var v in g.filter._modifiers)g.filter.deattach(v)}},3964:(e,t,n)=>{"use strict";const r=n(1669),i=n(2357),o=n(9867),s=n(7303),a="error@context",c=process.env.DEBUG_CLS_HOOKED;let u=-1;function l(e){this.name=e,this.active=null,this._set=[],this.id=null,this._contexts=new Map,this._indent=0}function p(e){return process.namespaces[e]}function f(e){let t=p(e);i.ok(t,"can't delete nonexistent namespace! \""+e+'"'),i.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t)),process.namespaces[e]=null}function d(...e){c&&process._rawDebug(`${r.format(...e)}`)}e.exports={getNamespace:p,createNamespace:function(e){i.ok(e,"namespace must be given a name."),c&&d(`NS-CREATING NAMESPACE (${e})`);let t=new l(e);t.id=u;return s.createHook({init(n,i,o,a){u=s.executionAsyncId();if(t.active){t._contexts.set(n,t.active);if(c){const s=" ".repeat(t._indent<0?0:t._indent);d(`${s}INIT [${i}] (${e}) asyncId:${n} currentUid:${u} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}else if(u===0){const o=s.triggerAsyncId();const l=t._contexts.get(o);if(l){t._contexts.set(n,l);if(c){const s=" ".repeat(t._indent<0?0:t._indent);d(`${s}INIT USING CONTEXT FROM TRIGGERID [${i}] (${e}) asyncId:${n} currentUid:${u} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}else if(c){const s=" ".repeat(t._indent<0?0:t._indent);d(`${s}INIT MISSING CONTEXT [${i}] (${e}) asyncId:${n} currentUid:${u} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}if(c&&i==="PROMISE"){d(r.inspect(a,{showHidden:true}));const s=a.parentId;const c=" ".repeat(t._indent<0?0:t._indent);d(`${c}INIT RESOURCE-PROMISE [${i}] (${e}) parentId:${s} asyncId:${n} currentUid:${u} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}},before(n){u=s.executionAsyncId();let i;i=t._contexts.get(n)||t._contexts.get(u);if(i){if(c){const o=s.triggerAsyncId();const a=" ".repeat(t._indent<0?0:t._indent);d(`${a}BEFORE (${e}) asyncId:${n} currentUid:${u} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`);t._indent+=2}t.enter(i)}else if(c){const i=s.triggerAsyncId();const o=" ".repeat(t._indent<0?0:t._indent);d(`${o}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${u} triggerId:${i} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} namespace._contexts:${r.inspect(t._contexts,{showHidden:true,depth:2,colors:true})}`);t._indent+=2}},after(n){u=s.executionAsyncId();let i;i=t._contexts.get(n)||t._contexts.get(u);if(i){if(c){const o=s.triggerAsyncId();t._indent-=2;const a=" ".repeat(t._indent<0?0:t._indent);d(`${a}AFTER (${e}) asyncId:${n} currentUid:${u} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`)}t.exit(i)}else if(c){const o=s.triggerAsyncId();t._indent-=2;const a=" ".repeat(t._indent<0?0:t._indent);d(`${a}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${u} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`)}},destroy(n){u=s.executionAsyncId();if(c){const i=s.triggerAsyncId();const o=" ".repeat(t._indent<0?0:t._indent);d(`${o}DESTROY (${e}) currentUid:${u} asyncId:${n} triggerId:${i} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(t._contexts.get(u))}`)}t._contexts.delete(n)}}).enable(),process.namespaces[e]=t,t},destroyNamespace:f,reset:function(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){f(e)}));process.namespaces=Object.create(null)},ERROR_SYMBOL:a},l.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");if(this.active[e]=t,c){d(" ".repeat(this._indent<0?0:this._indent)+"CONTEXT-SET KEY:"+e+"="+t+" in ns:"+this.name+" currentUid:"+u+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0}))}return t},l.prototype.get=function(e){if(this.active){if(c){const t=s.executionAsyncId(),n=s.triggerAsyncId(),i=" ".repeat(this._indent<0?0:this._indent);d(i+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+u+" active:"+r.inspect(this.active,{showHidden:!0,depth:2,colors:!0})),d(`${i}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${u} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} active:${r.inspect(this.active)}`)}return this.active[e]}if(c){const t=s.currentId(),n=s.triggerAsyncId();d(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${u} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length}`)}},l.prototype.createContext=function(){let e=Object.create(this.active?this.active:Object.prototype);if(e._ns_name=this.name,e.id=u,c){const t=s.executionAsyncId(),n=s.triggerAsyncId();d(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-CREATED Context: (${this.name}) currentUid:${u} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} context:${r.inspect(e,{showHidden:!0,depth:2,colors:!0})}`)}return e},l.prototype.run=function(e){let t=this.createContext();this.enter(t);try{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();d(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${u} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} context:${r.inspect(t)}`)}return e(t),t}catch(e){throw e&&(e[a]=t),e}finally{if(c){const e=s.triggerAsyncId(),n=s.executionAsyncId();d(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-RUN END: (${this.name}) currentUid:${u} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} ${r.inspect(t)}`)}this.exit(t)}},l.prototype.runAndReturn=function(e){let t;return this.run((function(n){t=e(n)})),t},l.prototype.runPromise=function(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch)throw new Error("fn must return a promise.");return c&&d("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+u+" len:"+this._set.length+" "+r.inspect(t)),n.then((e=>(c&&d("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e))).catch((e=>{throw e[a]=t,c&&d("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+u+" len:"+this._set.length+" "+r.inspect(t)),this.exit(t),e}))},l.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());let n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[a]=t),e}finally{n.exit(t)}}},l.prototype.enter=function(e){if(i.ok(e,"context must be provided for entering"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();d(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-ENTER: (${this.name}) currentUid:${u} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}this._set.push(this.active),this.active=e},l.prototype.exit=function(e){if(i.ok(e,"context must be provided for exiting"),c){const t=s.executionAsyncId(),n=s.triggerAsyncId();d(`${" ".repeat(this._indent<0?0:this._indent)}CONTEXT-EXIT: (${this.name}) currentUid:${u} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}if(this.active===e)return i.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());let t=this._set.lastIndexOf(e);t<0?(c&&d("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e)),i.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))):(i.ok(t,"can't remove top context"),this._set.splice(t,1))},l.prototype.bindEmitter=function(e){i.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this,n="context@"+this.name;o(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;let t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){let r=n[e];t=r.namespace.bind(t,r.context)})),t}))},l.prototype.fromException=function(e){return e[a]},process.namespaces={}},9562:(e,t,n)=>{"use strict";const r=n(1249);process&&r.gte(process.versions.node,"8.0.0")?e.exports=n(3964):e.exports=n(4046)},1048:e=>{e.exports=function(e,n){for(var r=[],i=0;i{"use strict";var r=n(2357),i=n(9867),o="error@context";function s(e){this.name=e,this.active=null,this._set=[],this.id=null}function a(e){return process.namespaces[e]}function c(e){var t=a(e);r.ok(t,"can't delete nonexistent namespace!"),r.ok(t.id,"don't assign to process.namespaces directly!"),process.removeAsyncListener(t.id),process.namespaces[e]=null}function u(){process.namespaces&&Object.keys(process.namespaces).forEach((function(e){c(e)})),process.namespaces=Object.create(null)}process.addAsyncListener||n(7645),s.prototype.set=function(e,t){if(!this.active)throw new Error("No context available. ns.run() or ns.bind() must be called first.");return this.active[e]=t,t},s.prototype.get=function(e){if(this.active)return this.active[e]},s.prototype.createContext=function(){return Object.create(this.active)},s.prototype.run=function(e){var t=this.createContext();this.enter(t);try{return e(t),t}catch(e){throw e&&(e[o]=t),e}finally{this.exit(t)}},s.prototype.runAndReturn=function(e){var t;return this.run((function(n){t=e(n)})),t},s.prototype.bind=function(e,t){t||(t=this.active?this.active:this.createContext());var n=this;return function(){n.enter(t);try{return e.apply(this,arguments)}catch(e){throw e&&(e[o]=t),e}finally{n.exit(t)}}},s.prototype.enter=function(e){r.ok(e,"context must be provided for entering"),this._set.push(this.active),this.active=e},s.prototype.exit=function(e){if(r.ok(e,"context must be provided for exiting"),this.active===e)return r.ok(this._set.length,"can't remove top context"),void(this.active=this._set.pop());var t=this._set.lastIndexOf(e);r.ok(t>=0,"context not currently entered; can't exit"),r.ok(t,"can't remove top context"),this._set.splice(t,1)},s.prototype.bindEmitter=function(e){r.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");var t=this,n="context@"+this.name;i(e,(function(e){e&&(e["cls@contexts"]||(e["cls@contexts"]=Object.create(null)),e["cls@contexts"][n]={namespace:t,context:t.active})}),(function(e){if(!e||!e["cls@contexts"])return e;var t=e,n=e["cls@contexts"];return Object.keys(n).forEach((function(e){var r=n[e];t=r.namespace.bind(t,r.context)})),t}))},s.prototype.fromException=function(e){return e[o]},process.namespaces||u(),e.exports={getNamespace:a,createNamespace:function(e){r.ok(e,"namespace must be given a name!");var t=new s(e);return t.id=process.addAsyncListener({create:function(){return t.active},before:function(e,n){n&&t.enter(n)},after:function(e,n){n&&t.exit(n)},error:function(e){e&&t.exit(e)}}),process.namespaces[e]=t,t},destroyNamespace:c,reset:u}},296:e=>{function t(e,t,n){var r,i,o,s,a;function c(){var u=Date.now()-s;u=0?r=setTimeout(c,t-u):(r=null,n||(a=e.apply(o,i),o=i=null))}null==t&&(t=100);var u=function(){o=this,i=arguments,s=Date.now();var u=n&&!r;return r||(r=setTimeout(c,t)),u&&(a=e.apply(o,i),o=i=null),a};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(a=e.apply(o,i),o=i=null,clearTimeout(r),r=null)},u}t.debounce=t,e.exports=t},1227:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(2447)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,t,n)=>{e.exports=function(e){function t(e){let n,i=null;function o(...e){if(!o.enabled)return;const r=o,i=Number(new Date),s=i-(n||i);r.diff=s,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,i)=>{if("%%"===n)return"%";a++;const o=t.formatters[i];if("function"==typeof o){const t=e[a];n=o.call(r,t),e.splice(a,1),a--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=r,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null===i?t.enabled(e):i,set:e=>{i=e}}),"function"==typeof t.init&&t.init(o),o}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=n(1227):e.exports=n(39)},39:(e,t,n)=>{const r=n(3867),i=n(1669);t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=n(2130);e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=n(2447)(t);const{formatters:o}=e.exports;o.o=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},o.O=function(e){return this.inspectOpts.colors=this.useColors,i.inspect(e,this.inspectOpts)}},8604:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 1.0.0 < 2.0.0",patch:function(e){try{var n=new(0,Object(function(){var e=new Error("Cannot find module '@opentelemetry/tracing'");throw e.code="MODULE_NOT_FOUND",e}()).BasicTracer)(i.channel.spanContextPropagator?{scopeManager:i.channel.spanContextPropagator}:void 0),s=n.startSpan;n.startSpan=function(e,t){if(!t||!t.parent){var i=n.getCurrentSpan();i&&i.operation&&i.operation.traceparent&&(t=r({},t,{parent:{traceId:i.operation.traceparent.traceId,spanId:i.operation.traceparent.spanId}}))}var o=s.call(this,e,t);return o.addEvent("Application Insights Integration enabled"),o},n.addSpanProcessor(new o),n[t.AzureMonitorSymbol]=!0,e.setTracer(n)}catch(e){}return e}},t.enable=function(){i.channel.registerMonkeyPatch("@azure/core-tracing",t.azureCoreTracing)}},8859:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953);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 o=i;o||(o=t.call(this,e,!0)),r.channel.publish("bunyan",{level:e.level,result:o})}return i},e}},t.enable=function(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}},2495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953),i=n(2413);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 o=new e.Console(t,n),s=function(t){var n=e[t];n&&(e[t]=function(){if(o[t])try{o[t].apply(o,arguments)}catch(e){}return n.apply(e,arguments)})},a=0,c=["log","info","warn","error","dir","time","timeEnd","trace","assert"];a{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8604);t.azuresdk=r;var i=n(8859);t.bunyan=i;var o=n(2495);t.console=o;var s=n(2028);t.mongodbCore=s;var a=n(8436);t.mongodb=a;var c=n(8002);t.mysql=c;var u=n(9024);t.pgPool=u;var l=n(2080);t.pg=l;var p=n(4487);t.redis=p;var f=n(6661);t.tedious=f;var d=n(4650);t.winston=d,t.enable=function(){i.enable(),o.enable(),s.enable(),a.enable(),c.enable(),l.enable(),u.enable(),p.enable(),d.enable(),r.enable(),f.enable()}},2028:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953);t.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.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.mongoCore)}},8436:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 2.0.0 <= 3.0.5",patch:function(e){var t=e.instrument({operationIdGenerator:{next:function(){return i.channel.bindToContext((function(e){return e()}))}}}),n={};return t.on("started",(function(e){n[e.requestId]||(n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return i.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})):i.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"function"==typeof e.operationId?e.operationId((function(){return i.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})):i.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),e}},t.mongo3={versionSpecifier:"> 3.0.5 < 3.3.0",patch:function(e){var t=e.instrument(),n={},o={};return t.on("started",(function(e){n[e.requestId]||(o[e.requestId]=i.channel.bindToContext((function(e){return e()})),n[e.requestId]=r({},e,{time:new Date}))})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof o[e.requestId]&&(o[e.requestId]((function(){return i.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete o[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof o[e.requestId]&&(o[e.requestId]((function(){return i.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete o[e.requestId])})),e}},t.mongo330={versionSpecifier:">= 3.3.0 < 4.0.0",patch:function(e){!function(e){var t=e.Server.prototype.connect;e.Server.prototype.connect=function(){var e=t.apply(this,arguments),n=this.s.coreTopology.s.pool.write;this.s.coreTopology.s.pool.write=function(){var e="function"==typeof arguments[1]?1:2;return"function"==typeof arguments[e]&&(arguments[e]=i.channel.bindToContext(arguments[e])),n.apply(this,arguments)};var r=this.s.coreTopology.s.pool.logout;return this.s.coreTopology.s.pool.logout=function(){return"function"==typeof arguments[1]&&(arguments[1]=i.channel.bindToContext(arguments[1])),r.apply(this,arguments)},e}}(e);var t=e.instrument(),n={},r={};return t.on("started",(function(e){n[e.requestId]||(r[e.requestId]=i.channel.bindToContext((function(e){return e()})),n[e.requestId]=e)})),t.on("succeeded",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return i.channel.publish("mongodb",{startedData:t,event:e,succeeded:!0})})),delete r[e.requestId])})),t.on("failed",(function(e){var t=n[e.requestId];t&&delete n[e.requestId],"object"==typeof e&&"function"==typeof r[e.requestId]&&(r[e.requestId]((function(){return i.channel.publish("mongodb",{startedData:t,event:e,succeeded:!1})})),delete r[e.requestId])})),e}},t.enable=function(){i.channel.registerMonkeyPatch("mongodb",t.mongo2),i.channel.registerMonkeyPatch("mongodb",t.mongo3),i.channel.registerMonkeyPatch("mongodb",t.mongo330)}},8002:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953),i=n(5622);t.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:function(e,t){var o=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 o=arguments[e],s={result:null,startTime:null,startDate:null};"function"==typeof o&&(n?(s.startTime=process.hrtime(),s.startDate=new Date,arguments[e]=r.channel.bindToContext(n(s,o))):arguments[e]=r.channel.bindToContext(o));var a=i.apply(this,arguments);return s.result=a,a})}},s=function(e,t){return o(e.prototype)},a=n(4694)(i.dirname(t)+"/lib/Connection");["connect","changeUser","ping","statistics","end"].forEach((function(e){return s(a)(e)})),o(a)("createQuery",(function(e,t){return function(n){var i=process.hrtime(e.startTime),o=1e3*i[0]+i[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:o,time:e.startDate}),t.apply(this,arguments)}}));var c=n(420)(i.dirname(t)+"/lib/Pool");return["_enqueueCallback"].forEach((function(e){return s(c)(e)})),e}},t.enable=function(){r.channel.registerMonkeyPatch("mysql",t.mysql)}},9024:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953);t.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:function(e){var t=e.prototype.connect;return e.prototype.connect=function(e){return e&&(arguments[0]=r.channel.bindToContext(e)),t.apply(this,arguments)},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}},2080:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953),i=n(8614);t.postgres6={versionSpecifier:"6.*",patch:function(e,t){var n=e.Client.prototype.query,o="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},u=process.hrtime();function l(e){e&&e[o]&&(e=e[o]);var t=r.channel.bindToContext((function(t,n){var o=process.hrtime(u);if(c.result=n&&{rowCount:n.rowCount,command:n.command},c.error=t,c.duration=Math.ceil(1e3*o[0]+o[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,o,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(c.query.preparable={text:e,args:t},s=l(s)):(c.query.text=e,s?s=l(s):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,s?s=l(s):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]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments)},e}},t.postgres7={versionSpecifier:">=7.* <=8.*",patch:function(e,t){var n=e.Client.prototype.query,o="__diagnosticOriginalFunc";return e.Client.prototype.query=function(e,t,s){var a,c=this,u=!!s,l={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0,time:new Date},p=process.hrtime();function f(e){e&&e[o]&&(e=e[o]);var t=r.channel.bindToContext((function(t,n){var o=process.hrtime(p);if(l.result=n&&{rowCount:n.rowCount,command:n.command},l.error=t,l.duration=Math.ceil(1e3*o[0]+o[1]/1e6),r.channel.publish("postgres",l),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,o,{value:e}),t}catch(t){return e}}try{"string"==typeof e?t instanceof Array?(l.query.preparable={text:e,args:t},s=(u="function"==typeof s)?f(s):s):(l.query.text=e,s?s=(u="function"==typeof s)?f(s):s:t=(u="function"==typeof t)?f(t):t):("string"==typeof e.name?l.query.plan=e.name:e.values instanceof Array?l.query.preparable={text:e.text,args:e.values}:l.query.text=e.text,s?(u="function"==typeof s,s=f(s)):t?t=(u="function"==typeof t)?f(t):t:(u="function"==typeof e.callback,e.callback=u?f(e.callback):e.callback))}catch(e){return n.apply(this,arguments)}return arguments[0]=e,arguments[1]=t,arguments[2]=s,arguments.length=arguments.length>3?arguments.length:3,a=n.apply(this,arguments),u?a:a.then((function(e){return f()(void 0,e),new c._Promise((function(t,n){t(e)}))})).catch((function(e){return f()(e,void 0),new c._Promise((function(t,n){n(e)}))}))},e}},t.enable=function(){r.channel.registerMonkeyPatch("pg",t.postgres6),r.channel.registerMonkeyPatch("pg",t.postgres7)}},4487:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4953);t.redis={versionSpecifier:">= 2.0.0 < 4.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,o=process.hrtime(),s=new Date;e.callback=r.channel.bindToContext((function(t,a){var c=process.hrtime(o),u=1e3*c[0]+c[1]/1e6|0;r.channel.publish("redis",{duration:u,address:i,commandObj:e,err:t,result:a,time:s}),"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)}},6661:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n= 6.0.0 < 9.0.0",patch:function(e){var t=e.Connection.prototype.makeRequest;return e.Connection.prototype.makeRequest=function(){function e(e){var t=process.hrtime(),n={query:{},database:{host:null,port:null},result:null,error:null,duration:0};return i.channel.bindToContext((function(o,s,a){var c=process.hrtime(t);n=r({},n,{database:{host:this.connection.config.server,port:this.connection.config.options.port},result:!o&&{rowCount:s,rows:a},query:{text:this.parametersByName.statement.value},error:o,duration:Math.ceil(1e3*c[0]+c[1]/1e6)}),i.channel.publish("tedious",n),e.call(this,o,s,a)}))}var n=arguments[0];arguments[0].callback=e(n.callback),t.apply(this,arguments)},e}},t.enable=function(){i.channel.registerMonkeyPatch("tedious",t.tedious)}},4650:function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=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])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);ir[n]?i:n);this.add(new t(e,{level:n}))}var r=e.createLogger;e.createLogger=function(){var i,o=arguments[0].levels||e.config.npm.levels;for(var s in o)o.hasOwnProperty(s)&&(i=void 0===i||o[s]>o[i]?s:i);var a=r.apply(this,arguments);a.add(new t(e,{level:i}));var c=a.configure;return a.configure=function(){c.apply(this,arguments),n.apply(this,arguments)},a};var a=e.createLogger;return e.configure=function(){a.apply(this,arguments),n.apply(this,arguments)},e.add(new t(e)),e}},t.winston2={versionSpecifier:"2.x",patch:function(e){var t,n=e.Logger.prototype.log,r=function(n,r,i){var o;return o=t===e.config.npm.levels?"npm":t===e.config.syslog.levels?"syslog":"unknown",s.channel.publish("winston",{level:n,message:r,meta:i,levelKind:o}),r};return e.Logger.prototype.log=function(){return t=this.levels,this.filters&&0!==this.filters.length?this.filters[this.filters.length-1]!==r&&(this.filters=this.filters.filter((function(e){return e!==r})),this.filters.push(r)):this.filters=[r],n.apply(this,arguments)},e}},t.enable=function(){s.channel.registerMonkeyPatch("winston",t.winston2),s.channel.registerMonkeyPatch("winston",t.winston3)}},4694:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=4694,e.exports=t},420:e=>{function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=420,e.exports=t},4953:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7424),i=n(7424);t.makePatchingRequire=i.makePatchingRequire;var o=function(e){return!0},s=function(){function e(){this.version=n(5236).i8,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=o),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=o);var r=this.subscribers[e];if(r)for(var i=0;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5622),i=n(1249),o=n(2282),s=Object.keys(process.binding("natives")),a=o.prototype.require;t.makePatchingRequire=function(e){var t={};return function(n){var c=a.apply(this,arguments);if(e[n]){var u=o._resolveFilename(n,this);if(t.hasOwnProperty(u))return t[u];var l=void 0;if(s.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 p=l.indexOf("-");p>=0&&(l=l.substring(0,p));for(var f=c,d=0,h=e[n];d{"use strict";e.exports={i8:"0.2.0"}},696:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertChangesToDMP=function(e){for(var t,n,r=[],i=0;i{"use strict";function n(e){var t=e;return t=(t=(t=(t=t.replace(/&/g,"&")).replace(//g,">")).replace(/"/g,""")}Object.defineProperty(t,"__esModule",{value:!0}),t.convertChangesToXML=function(e){for(var t=[],r=0;r"):i.removed&&t.push(""),t.push(n(i.value)),i.added?t.push(""):i.removed&&t.push("")}return t.join("")}},6976:(e,t,n)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.diffArrays=function(e,t,n){return i.diff(e,t,n)},t.arrayDiff=void 0;var i=new(((r=n(5913))&&r.__esModule?r:{default:r}).default);t.arrayDiff=i,i.tokenize=function(e){return e.slice()},i.join=i.removeEmpty=function(e){return e}},5913:(e,t)=>{"use strict";function n(){}function r(e,t,n,r,i){for(var o=0,s=t.length,a=0,c=0;oe.length?n:e})),u.value=e.join(p)}else u.value=e.join(n.slice(a,a+u.count));a+=u.count,u.added||(c+=u.count)}}var f=t[s-1];return s>1&&"string"==typeof f.value&&(f.added||f.removed)&&e.equals("",f.value)&&(t[s-2].value+=f.value,t.pop()),t}function i(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.callback;"function"==typeof n&&(o=n,n={}),this.options=n;var s=this;function a(e){return o?(setTimeout((function(){o(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var c=(t=this.removeEmpty(this.tokenize(t))).length,u=e.length,l=1,p=c+u,f=[{newPos:-1,components:[]}],d=this.extractCommon(f[0],t,e,0);if(f[0].newPos+1>=c&&d+1>=u)return a([{value:this.join(t),count:t.length}]);function h(){for(var n=-1*l;n<=l;n+=2){var o=void 0,p=f[n-1],d=f[n+1],h=(d?d.newPos:0)-n;p&&(f[n-1]=void 0);var m=p&&p.newPos+1=c&&h+1>=u)return a(r(s,o.components,t,e,s.useLongestToken));f[n]=o}else f[n]=void 0}l++}if(o)!function e(){setTimeout((function(){if(l>p)return o();h()||e()}),0)}();else for(;l<=p;){var m=h();if(m)return m}},pushComponent:function(e,t,n){var r=e[e.length-1];r&&r.added===t&&r.removed===n?e[e.length-1]={count:r.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,r){for(var i=t.length,o=n.length,s=e.newPos,a=s-r,c=0;s+1{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.diffChars=function(e,t,n){return i.diff(e,t,n)},t.characterDiff=void 0;var i=new(((r=n(5913))&&r.__esModule?r:{default:r}).default);t.characterDiff=i},4852:(e,t,n)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.diffCss=function(e,t,n){return i.diff(e,t,n)},t.cssDiff=void 0;var i=new(((r=n(5913))&&r.__esModule?r:{default:r}).default);t.cssDiff=i,i.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)}},4276:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffJson=function(e,t,n){return c.diff(e,t,n)},t.canonicalize=u,t.jsonDiff=void 0;var r,i=(r=n(5913))&&r.__esModule?r:{default:r},o=n(8187);function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=Object.prototype.toString,c=new i.default;function u(e,t,n,r,i){var o,c;for(t=t||[],n=n||[],r&&(e=r(i,e)),o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffLines=function(e,t,n){return s.diff(e,t,n)},t.diffTrimmedLines=function(e,t,n){var r=(0,o.generateOptions)(n,{ignoreWhitespace:!0});return s.diff(e,t,r)},t.lineDiff=void 0;var r,i=(r=n(5913))&&r.__esModule?r:{default:r},o=n(8009);var s=new i.default;t.lineDiff=s,s.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.diffSentences=function(e,t,n){return i.diff(e,t,n)},t.sentenceDiff=void 0;var i=new(((r=n(5913))&&r.__esModule?r:{default:r}).default);t.sentenceDiff=i,i.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)}},5303:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.diffWords=function(e,t,n){return n=(0,o.generateOptions)(n,{ignoreWhitespace:!0}),c.diff(e,t,n)},t.diffWordsWithSpace=function(e,t,n){return c.diff(e,t,n)},t.wordDiff=void 0;var r,i=(r=n(5913))&&r.__esModule?r:{default:r},o=n(8009);var s=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,a=/\S/,c=new i.default;t.wordDiff=c,c.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!a.test(e)&&!a.test(t)},c.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Diff",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"diffChars",{enumerable:!0,get:function(){return o.diffChars}}),Object.defineProperty(t,"diffWords",{enumerable:!0,get:function(){return s.diffWords}}),Object.defineProperty(t,"diffWordsWithSpace",{enumerable:!0,get:function(){return s.diffWordsWithSpace}}),Object.defineProperty(t,"diffLines",{enumerable:!0,get:function(){return a.diffLines}}),Object.defineProperty(t,"diffTrimmedLines",{enumerable:!0,get:function(){return a.diffTrimmedLines}}),Object.defineProperty(t,"diffSentences",{enumerable:!0,get:function(){return c.diffSentences}}),Object.defineProperty(t,"diffCss",{enumerable:!0,get:function(){return u.diffCss}}),Object.defineProperty(t,"diffJson",{enumerable:!0,get:function(){return l.diffJson}}),Object.defineProperty(t,"canonicalize",{enumerable:!0,get:function(){return l.canonicalize}}),Object.defineProperty(t,"diffArrays",{enumerable:!0,get:function(){return p.diffArrays}}),Object.defineProperty(t,"applyPatch",{enumerable:!0,get:function(){return f.applyPatch}}),Object.defineProperty(t,"applyPatches",{enumerable:!0,get:function(){return f.applyPatches}}),Object.defineProperty(t,"parsePatch",{enumerable:!0,get:function(){return d.parsePatch}}),Object.defineProperty(t,"merge",{enumerable:!0,get:function(){return h.merge}}),Object.defineProperty(t,"structuredPatch",{enumerable:!0,get:function(){return m.structuredPatch}}),Object.defineProperty(t,"createTwoFilesPatch",{enumerable:!0,get:function(){return m.createTwoFilesPatch}}),Object.defineProperty(t,"createPatch",{enumerable:!0,get:function(){return m.createPatch}}),Object.defineProperty(t,"convertChangesToDMP",{enumerable:!0,get:function(){return g.convertChangesToDMP}}),Object.defineProperty(t,"convertChangesToXML",{enumerable:!0,get:function(){return v.convertChangesToXML}});var r,i=(r=n(5913))&&r.__esModule?r:{default:r},o=n(7630),s=n(5303),a=n(8187),c=n(4146),u=n(4852),l=n(4276),p=n(6976),f=n(3690),d=n(3719),h=n(3051),m=n(1286),g=n(696),v=n(5826)},3690:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.applyPatch=s,t.applyPatches=function(e,t){"string"==typeof e&&(e=(0,i.parsePatch)(e));var n=0;!function r(){var i=e[n++];if(!i)return t.complete();t.loadFile(i,(function(e,n){if(e)return t.complete(e);var o=s(n,i,t);t.patched(i,o,(function(e){if(e)return t.complete(e);r()}))}))}()};var r,i=n(3719),o=(r=n(8169))&&r.__esModule?r:{default:r};function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof t&&(t=(0,i.parsePatch)(t)),Array.isArray(t)){if(t.length>1)throw new Error("applyPatch only works with a single input.");t=t[0]}var r,s,a=e.split(/\r\n|[\n\v\f\r\x85]/),c=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],u=t.hunks,l=n.compareLine||function(e,t,n,r){return t===r},p=0,f=n.fuzzFactor||0,d=0,h=0;function m(e,t){for(var n=0;n0?r[0]:" ",o=r.length>0?r.substr(1):r;if(" "===i||"-"===i){if(!l(t+1,a[t],i,o)&&++p>f)return!1;t++}}return!0}for(var g=0;g0?O[0]:" ",A=O.length>0?O.substr(1):O,N=I.linedelimiters[x];if(" "===T)C++;else if("-"===T)a.splice(C,1),c.splice(C,1);else if("+"===T)a.splice(C,0,A),c.splice(C,0,N),C++;else if("\\"===T){var P=I.lines[x-1]?I.lines[x-1][0]:null;"+"===P?r=!0:"-"===P&&(s=!0)}}}if(r)for(;!a[a.length-1];)a.pop(),c.pop();else s&&(a.push(""),c.push("\n"));for(var L=0;L{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.structuredPatch=s,t.formatPatch=a,t.createTwoFilesPatch=c,t.createPatch=function(e,t,n,r,i,o){return c(e,e,t,n,r,i,o)};var r=n(8187);function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l(a.lines.slice(-c.context)):[],f-=h.length,d-=h.length)}(s=h).push.apply(s,i(r.map((function(e){return(t.added?"+":"-")+e})))),t.added?g+=r.length:m+=r.length}else{if(f)if(r.length<=2*c.context&&e=u.length-2&&r.length<=c.context){var b=/\n$/.test(n),w=/\n$/.test(o),S=0==r.length&&h.length>E.oldLines;!b&&S&&n.length>0&&h.splice(E.oldLines,0,"\\ No newline at end of file"),(b||S)&&w||h.push("\\ No newline at end of file")}p.push(E),f=0,d=0,h=[]}m+=r.length,g+=r.length}},y=0;y{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calcLineCount=c,t.merge=function(e,t,n){e=u(e,n),t=u(t,n);var r={};(e.index||t.index)&&(r.index=e.index||t.index);(e.newFileName||t.newFileName)&&(l(e)?l(t)?(r.oldFileName=p(r,e.oldFileName,t.oldFileName),r.newFileName=p(r,e.newFileName,t.newFileName),r.oldHeader=p(r,e.oldHeader,t.oldHeader),r.newHeader=p(r,e.newHeader,t.newHeader)):(r.oldFileName=e.oldFileName,r.newFileName=e.newFileName,r.oldHeader=e.oldHeader,r.newHeader=e.newHeader):(r.oldFileName=t.oldFileName||e.oldFileName,r.newFileName=t.newFileName||e.newFileName,r.oldHeader=t.oldHeader||e.oldHeader,r.newHeader=t.newHeader||e.newHeader));r.hunks=[];var i=0,o=0,s=0,a=0;for(;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parsePatch=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.split(/\r\n|[\n\v\f\r\x85]/),r=e.match(/\r\n|[\n\v\f\r\x85]/g)||[],i=[],o=0;function s(){var e={};for(i.push(e);o{"use strict";function n(e,t){if(t.length>e.length)return!1;for(var n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r=!0,i=!1,o=!1,s=1;return function a(){if(r&&!o){if(i?s++:r=!1,e+s<=n)return s;o=!0}if(!i)return o||(r=!0),t<=e-s?-s++:(i=!0,a())}}},8009:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.generateOptions=function(e,t){if("function"==typeof e)t.callback=e;else if(e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}},9867:(e,t,n)=>{"use strict";var r=n(6372),i=r.wrap,o=r.unwrap,s="wrap@before";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 c(e,t){var n;return n=e._events&&e._events[t],Array.isArray(n)||(n=n?[n]:[]),n}function u(e,t,n){var r=c(e,t).filter((function(e){return-1===n.indexOf(e)}));r.length>0&&function(e,t){for(var n=t.length,r=0;r{var r=n(778),i=function(){},o=function(e,t,n){if("function"==typeof t)return o(e,null,t);t||(t={}),n=r(n||i);var s=e._writableState,a=e._readableState,c=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,l=!1,p=function(){e.writable||f()},f=function(){u=!1,c||n.call(e)},d=function(){c=!1,u||n.call(e)},h=function(t){n.call(e,t?new Error("exited with error code: "+t):null)},m=function(t){n.call(e,t)},g=function(){process.nextTick(v)},v=function(){if(!l)return(!c||a&&a.ended&&!a.destroyed)&&(!u||s&&s.ended&&!s.destroyed)?void 0:n.call(e,new Error("premature close"))},y=function(){e.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?u&&!s&&(e.on("end",p),e.on("close",p)):(e.on("complete",f),e.on("abort",g),e.req?y():e.on("request",y)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",h),e.on("end",d),e.on("finish",f),!1!==t.error&&e.on("error",m),e.on("close",g),function(){l=!0,e.removeListener("complete",f),e.removeListener("abort",g),e.removeListener("request",y),e.req&&e.req.removeListener("finish",f),e.removeListener("end",p),e.removeListener("close",p),e.removeListener("finish",f),e.removeListener("exit",h),e.removeListener("end",d),e.removeListener("error",m),e.removeListener("close",g)}};e.exports=o},2106:(e,t,n)=>{const r=n(5158)("extract-zip"),{createWriteStream:i,promises:o}=n(5747),s=n(31),a=n(5622),{promisify:c}=n(1669),u=n(2413),l=n(7766),p=c(l.open),f=c(u.pipeline);class d{constructor(e,t){this.zipPath=e,this.opts=t}async extract(){return r("opening",this.zipPath,"with opts",this.opts),this.zipfile=await p(this.zipPath,{lazyEntries:!0}),this.canceled=!1,new Promise(((e,t)=>{this.zipfile.on("error",(e=>{this.canceled=!0,t(e)})),this.zipfile.readEntry(),this.zipfile.on("close",(()=>{this.canceled||(r("zip extraction complete"),e())})),this.zipfile.on("entry",(async e=>{if(this.canceled)return void r("skipping entry",e.fileName,{cancelled:this.canceled});if(r("zipfile entry",e.fileName),e.fileName.startsWith("__MACOSX/"))return void this.zipfile.readEntry();const n=a.dirname(a.join(this.opts.dir,e.fileName));try{await o.mkdir(n,{recursive:!0});const t=await o.realpath(n);if(a.relative(this.opts.dir,t).split(a.sep).includes(".."))throw new Error(`Out of bound path "${t}" found while processing file ${e.fileName}`);await this.extractEntry(e),r("finished processing",e.fileName),this.zipfile.readEntry()}catch(e){this.canceled=!0,this.zipfile.close(),t(e)}}))}))}async extractEntry(e){if(this.canceled)return void r("skipping entry extraction",e.fileName,{cancelled:this.canceled});this.opts.onEntry&&this.opts.onEntry(e,this.zipfile);const t=a.join(this.opts.dir,e.fileName),n=e.externalFileAttributes>>16&65535,u=40960==(61440&n);let l=16384==(61440&n);!l&&e.fileName.endsWith("/")&&(l=!0);const p=e.versionMadeBy>>8;l||(l=0===p&&16===e.externalFileAttributes),r("extracting entry",{filename:e.fileName,isDir:l,isSymlink:u});const d=511&this.getExtractedMode(n,l),h=l?t:a.dirname(t),m={recursive:!0};if(l&&(m.mode=d),r("mkdir",{dir:h,...m}),await o.mkdir(h,m),l)return;r("opening read stream",t);const g=await c(this.zipfile.openReadStream.bind(this.zipfile))(e);if(u){const e=await s(g);r("creating symlink",e,t),await o.symlink(e,t)}else await f(g,i(t,{mode:d}))}getExtractedMode(e,t){let n=e;return 0===n&&(t?(this.opts.defaultDirMode&&(n=parseInt(this.opts.defaultDirMode,10)),n||(n=493)):(this.opts.defaultFileMode&&(n=parseInt(this.opts.defaultFileMode,10)),n||(n=420))),n}}e.exports=async function(e,t){if(r("creating target directory",t.dir),!a.isAbsolute(t.dir))throw new Error("Target directory is expected to be absolute");return await o.mkdir(t.dir,{recursive:!0}),t.dir=await o.realpath(t.dir),new d(e,t).extract()}},8913:(e,t,n)=>{var r=n(5747),i=n(1669),o=n(2413),s=o.Readable,a=o.Writable,c=o.PassThrough,u=n(9916),l=n(8614).EventEmitter;function p(e,t){t=t||{},l.call(this),this.fd=e,this.pend=new u,this.pend.max=1,this.refCount=0,this.autoClose=!!t.autoClose}function f(e,t){t=t||{},s.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start,this.destroyed=!1}function d(e,t){t=t||{},a.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=null==t.end?1/0:+t.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}function h(e,t){l.call(this),t=t||{},this.refCount=0,this.buffer=e,this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}t.createFromBuffer=function(e,t){return new h(e,t)},t.createFromFd=function(e,t){return new p(e,t)},t.BufferSlicer=h,t.FdSlicer=p,i.inherits(p,l),p.prototype.read=function(e,t,n,i,o){var s=this;s.pend.go((function(a){r.read(s.fd,e,t,n,i,(function(e,t,n){a(),o(e,t,n)}))}))},p.prototype.write=function(e,t,n,i,o){var s=this;s.pend.go((function(a){r.write(s.fd,e,t,n,i,(function(e,t,n){a(),o(e,t,n)}))}))},p.prototype.createReadStream=function(e){return new f(this,e)},p.prototype.createWriteStream=function(e){return new d(this,e)},p.prototype.ref=function(){this.refCount+=1},p.prototype.unref=function(){var e=this;if(e.refCount-=1,!(e.refCount>0)){if(e.refCount<0)throw new Error("invalid unref");e.autoClose&&r.close(e.fd,(function(t){t?e.emit("error",t):e.emit("close")}))}},i.inherits(f,s),f.prototype._read=function(e){var t=this;if(!t.destroyed){var n=Math.min(t._readableState.highWaterMark,e);if(null!=t.endOffset&&(n=Math.min(n,t.endOffset-t.pos)),n<=0)return t.destroyed=!0,t.push(null),void t.context.unref();t.context.pend.go((function(e){if(t.destroyed)return e();var i=new Buffer(n);r.read(t.context.fd,i,0,n,t.pos,(function(n,r){n?t.destroy(n):0===r?(t.destroyed=!0,t.push(null),t.context.unref()):(t.pos+=r,t.push(i.slice(0,r))),e()}))}))}},f.prototype.destroy=function(e){this.destroyed||(e=e||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",e),this.context.unref())},i.inherits(d,a),d.prototype._write=function(e,t,n){var i=this;if(!i.destroyed){if(i.pos+e.length>i.endOffset){var o=new Error("maximum file length exceeded");return o.code="ETOOBIG",i.destroy(),void n(o)}i.context.pend.go((function(t){if(i.destroyed)return t();r.write(i.context.fd,e,0,e.length,i.pos,(function(e,r){e?(i.destroy(),t(),n(e)):(i.bytesWritten+=r,i.pos+=r,i.emit("progress"),t(),n())}))}))}},d.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())},i.inherits(h,l),h.prototype.read=function(e,t,n,r,i){var o=r+n,s=o-this.buffer.length,a=s>0?s:n;this.buffer.copy(e,t,r,o),setImmediate((function(){i(null,a)}))},h.prototype.write=function(e,t,n,r,i){e.copy(this.buffer,r,t,t+n),setImmediate((function(){i(null,n,e)}))},h.prototype.createReadStream=function(e){var t=new c(e=e||{});t.destroyed=!1,t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var n=this.buffer.slice(t.start,t.pos),r=0;;){var i=r+this.maxChunkSize;if(i>=n.length){rn.endOffset){var s=new Error("maximum file length exceeded");return s.code="ETOOBIG",n.destroyed=!0,void i(s)}e.copy(t.buffer,n.pos,0,e.length),n.bytesWritten+=e.length,n.pos=o,n.emit("progress"),i()}},n.destroy=function(){n.destroyed=!0},n},h.prototype.ref=function(){this.refCount+=1},h.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")}},7334:(e,t,n)=>{e.exports=l,l.realpath=l,l.sync=p,l.realpathSync=p,l.monkeypatch=function(){r.realpath=l,r.realpathSync=p},l.unmonkeypatch=function(){r.realpath=i,r.realpathSync=o};var r=n(5747),i=r.realpath,o=r.realpathSync,s=process.version,a=/^v[0-5]\./.test(s),c=n(7059);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 p(e,t){if(a)return o(e,t);try{return o(e,t)}catch(n){if(u(n))return c.realpathSync(e,t);throw n}}},7059:(e,t,n)=>{var r=n(5622),i="win32"===process.platform,o=n(5747),s=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function a(e){return"function"==typeof e?e:function(){var e;if(s){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,s,a,l,p=e,f={},d={};function h(){var t=u.exec(e);n=t[0].length,s=t[0],a=t[0],l="",i&&!d[a]&&(o.lstatSync(a),d[a]=!0)}for(h();n=e.length)return t&&(t[d]=e),n(null,e);c.lastIndex=s;var r=c.exec(e);return f=l,l+=r[0],p=f+r[1],s=c.lastIndex,m[p]||t&&t[p]===p?process.nextTick(v):t&&Object.prototype.hasOwnProperty.call(t,p)?E(t[p]):o.lstat(p,y)}function y(e,r){if(e)return n(e);if(!r.isSymbolicLink())return m[p]=!0,t&&(t[p]=p),process.nextTick(v);if(!i){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(h.hasOwnProperty(s))return _(null,h[s],p)}o.stat(p,(function(e){if(e)return n(e);o.readlink(p,(function(e,t){i||(h[s]=t),_(e,t)}))}))}function _(e,i,o){if(e)return n(e);var s=r.resolve(f,i);t&&(t[o]=s),E(s)}function E(t){e=r.resolve(t,e.slice(s)),g()}g()}},5105:(e,t,n)=>{"use strict";const{PassThrough:r}=n(2413);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const i="buffer"===n;let o=!1;t?o=!(n||i):n=n||"utf8",i&&(n=null);const s=new r({objectMode:o});n&&s.setEncoding(n);let a=0;const c=[];return s.on("data",(e=>{c.push(e),o?a=c.length:a+=e.length})),s.getBufferedValue=()=>t?c:i?Buffer.concat(c,a):c.join(""),s.getBufferedLength=()=>a,s}},31:(e,t,n)=>{"use strict";const{constants:r}=n(4293),i=n(4286),o=n(5105);class s extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function a(e,t){if(!e)return Promise.reject(new Error("Expected a stream"));t={maxBuffer:1/0,...t};const{maxBuffer:n}=t;let a;return await new Promise(((c,u)=>{const l=e=>{e&&a.getBufferedLength()<=r.MAX_LENGTH&&(e.bufferedData=a.getBufferedValue()),u(e)};a=i(e,o(t),(e=>{e?l(e):c()})),a.on("data",(()=>{a.getBufferedLength()>n&&l(new s)}))})),a.getBufferedValue()}e.exports=a,e.exports.default=a,e.exports.buffer=(e,t)=>a(e,{...t,encoding:"buffer"}),e.exports.array=(e,t)=>a(e,{...t,array:!0}),e.exports.MaxBufferError=s},6772:(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 o=process.cwd();r(n,"cwd")?(e.cwd=i.resolve(n.cwd),e.changedCwd=e.cwd!==o):e.cwd=o;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=s(e.cwd)?e.cwd:p(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=p,t.finish=function(e){for(var t=e.nounique,n=t?[]:Object.create(null),r=0,i=e.matches.length;r{e.exports=_;var r=n(5747),i=n(7334),o=n(1171),s=(o.Minimatch,n(4378)),a=n(8614).EventEmitter,c=n(5622),u=n(2357),l=n(4095),p=n(4751),f=n(6772),d=(f.alphasort,f.alphasorti,f.setopts),h=f.ownProp,m=n(7844),g=(n(1669),f.childrenIgnored),v=f.isIgnored,y=n(778);function _(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 p(e,t)}return new b(e,t,n)}_.sync=p;var E=_.GlobSync=p.GlobSync;function b(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(e,t)}if(!(this instanceof b))return new b(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 s();for(var o=0;o1)return!0;for(var i=0;ithis.maxLength)return t();if(!this.stat&&h(this.cache,n)){var o=this.cache[n];if(Array.isArray(o)&&(o="DIR"),!i||"DIR"===o)return t(null,o);if(i&&"FILE"===o)return t()}var s=this.statCache[n];if(void 0!==s){if(!1===s)return t(null,s);var a=s.isDirectory()?"DIR":"FILE";return i&&"FILE"===a?t():t(null,a,s)}var c=this,u=m("stat\0"+n,(function(i,o){if(o&&o.isSymbolicLink())return r.stat(n,(function(r,i){r?c._stat2(e,n,null,o,t):c._stat2(e,n,r,i,t)}));c._stat2(e,n,i,o,t)}));u&&r.lstat(n,u)},b.prototype._stat2=function(e,t,n,r,i){if(n&&("ENOENT"===n.code||"ENOTDIR"===n.code))return this.statCache[t]=!1,i();var o="/"===e.slice(-1);if(this.statCache[t]=r,"/"===t.slice(-1)&&r&&!r.isDirectory())return i(null,!1,r);var s=!0;return r&&(s=r.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||s,o&&"FILE"===s?i():i(null,s,r)}},4751:(e,t,n)=>{e.exports=h,h.GlobSync=m;var r=n(5747),i=n(7334),o=n(1171),s=(o.Minimatch,n(2884).Glob,n(1669),n(5622)),a=n(2357),c=n(4095),u=n(6772),l=(u.alphasort,u.alphasorti,u.setopts),p=u.ownProp,f=u.childrenIgnored,d=u.isIgnored;function h(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 m(e,t).found}function m(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 m))return new m(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;rthis.maxLength)return!1;if(!this.stat&&p(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 o=this.statCache[t];if(!o){var s;try{s=r.lstatSync(t)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[t]=!1,!1}if(s&&s.isSymbolicLink())try{o=r.statSync(t)}catch(e){o=s}else o=s}this.statCache[t]=o;i=!0;return o&&(i=o.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||i,(!n||"FILE"!==i)&&i},m.prototype._mark=function(e){return u.mark(this,e)},m.prototype._makeAbs=function(e){return u.makeAbs(this,e)}},6560:e=>{"use strict";e.exports=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||r{f("replaying proxy buffer for failed request"),c.default(e.listenerCount("data")>0),e.push(y),e.push(null)})),_}))}}function h(e){e.resume()}t.default=d},9829:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(n(5158)).default("https-proxy-agent:parse-proxy-response");t.default=function(e){return new Promise(((t,n)=>{let r=0;const o=[];function s(){const n=e.read();n?function(e){o.push(e),r+=e.length;const n=Buffer.concat(o,r);if(-1===n.indexOf("\r\n\r\n"))return i("have not received end of HTTP headers yet..."),void s();const a=n.toString("ascii",0,n.indexOf("\r\n")),c=+a.split(" ")[1];i("got proxy server response: %o",a),t({statusCode:c,buffered:n})}(n):e.once("readable",s)}function a(e){i("onclose had error %o",e)}function c(){i("onend")}function u(t){e.removeListener("end",c),e.removeListener("error",u),e.removeListener("close",a),e.removeListener("readable",s),i("onerror %o",t),n(t)}e.on("error",u),e.on("close",a),e.on("end",c),s()}))}},7844:(e,t,n)=>{var r=n(2479),i=Object.create(null),o=n(778);function s(e){for(var t=e.length,n=[],r=0;rr?(n.splice(0,r),process.nextTick((function(){t.apply(null,o)}))):delete i[e]}}))}(e))}))},4378:(e,t,n)=>{try{var r=n(1669);if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(t){e.exports=n(5717)}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},6486:function(e,t,n){var r; /** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */e=n.nmd(e),function(){var i,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",c=16,u=32,l=64,p=128,f=256,d=1/0,h=9007199254740991,m=NaN,g=4294967295,v=[["ary",p],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",u],["partialRight",l],["rearg",f]],y="[object Arguments]",_="[object Array]",E="[object Boolean]",b="[object Date]",w="[object Error]",S="[object Function]",I="[object GeneratorFunction]",C="[object Map]",x="[object Number]",O="[object Object]",T="[object Promise]",A="[object RegExp]",N="[object Set]",P="[object String]",L="[object Symbol]",R="[object WeakMap]",k="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",V="[object Float64Array]",F="[object Int8Array]",j="[object Int16Array]",B="[object Int32Array]",U="[object Uint8Array]",$="[object Uint8ClampedArray]",H="[object Uint16Array]",q="[object Uint32Array]",G=/\b__p \+= '';/g,z=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Y=/&(?:amp|lt|gt|quot|#39);/g,X=/[&<>"']/g,K=RegExp(Y.source),Q=RegExp(X.source),J=/<%-([\s\S]+?)%>/g,Z=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ie.source),se=/^\s+/,ae=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,pe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ve=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,Ee=/^(?:0|[1-9]\d*)$/,be=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,we=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Ie="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",xe="a-z\\xdf-\\xf6\\xf8-\\xff",Oe="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ne="['’]",Pe="[\\ud800-\\udfff]",Le="["+Ae+"]",Re="["+Ie+"]",ke="\\d+",De="[\\u2700-\\u27bf]",Me="["+xe+"]",Ve="[^\\ud800-\\udfff"+Ae+ke+Ce+xe+Oe+"]",Fe="\\ud83c[\\udffb-\\udfff]",je="[^\\ud800-\\udfff]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Ue="[\\ud800-\\udbff][\\udc00-\\udfff]",$e="["+Oe+"]",He="(?:"+Me+"|"+Ve+")",qe="(?:"+$e+"|"+Ve+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Re+"|"+Fe+")"+"?",Ye="[\\ufe0e\\ufe0f]?",Xe=Ye+We+("(?:\\u200d(?:"+[je,Be,Ue].join("|")+")"+Ye+We+")*"),Ke="(?:"+[De,Be,Ue].join("|")+")"+Xe,Qe="(?:"+[je+Re+"?",Re,Be,Ue,Pe].join("|")+")",Je=RegExp(Ne,"g"),Ze=RegExp(Re,"g"),et=RegExp(Fe+"(?="+Fe+")|"+Qe+Xe,"g"),tt=RegExp([$e+"?"+Me+"+"+Ge+"(?="+[Le,$e,"$"].join("|")+")",qe+"+"+ze+"(?="+[Le,$e+He,"$"].join("|")+")",$e+"?"+He+"+"+Ge,$e+"+"+ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ke,Ke].join("|"),"g"),nt=RegExp("[\\u200d\\ud800-\\udfff"+Ie+Te+"]"),rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,st={};st[M]=st[V]=st[F]=st[j]=st[B]=st[U]=st[$]=st[H]=st[q]=!0,st[y]=st[_]=st[k]=st[E]=st[D]=st[b]=st[w]=st[S]=st[C]=st[x]=st[O]=st[A]=st[N]=st[P]=st[R]=!1;var at={};at[y]=at[_]=at[k]=at[D]=at[E]=at[b]=at[M]=at[V]=at[F]=at[j]=at[B]=at[C]=at[x]=at[O]=at[A]=at[N]=at[P]=at[L]=at[U]=at[$]=at[H]=at[q]=!0,at[w]=at[S]=at[R]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,lt=parseInt,pt="object"==typeof global&&global&&global.Object===Object&&global,ft="object"==typeof self&&self&&self.Object===Object&&self,dt=pt||ft||Function("return this")(),ht=t&&!t.nodeType&&t,mt=ht&&e&&!e.nodeType&&e,gt=mt&&mt.exports===ht,vt=gt&&pt.process,yt=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||vt&&vt.binding&&vt.binding("util")}catch(e){}}(),_t=yt&&yt.isArrayBuffer,Et=yt&&yt.isDate,bt=yt&&yt.isMap,wt=yt&&yt.isRegExp,St=yt&&yt.isSet,It=yt&&yt.isTypedArray;function Ct(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function xt(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i-1}function Lt(e,t,n){for(var r=-1,i=null==e?0:e.length;++r-1;);return n}function tn(e,t){for(var n=e.length;n--&&Ut(t,e[n],0)>-1;);return n}function nn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var rn=zt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),on=zt({"&":"&","<":"<",">":">",'"':""","'":"'"});function sn(e){return"\\"+ct[e]}function an(e){return nt.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,r=e.length,i=0,o=[];++n",""":'"',"'":"'"});var vn=function e(t){var n,r=(t=null==t?dt:vn.defaults(dt.Object(),t,vn.pick(dt,it))).Array,ae=t.Date,Ie=t.Error,Ce=t.Function,xe=t.Math,Oe=t.Object,Te=t.RegExp,Ae=t.String,Ne=t.TypeError,Pe=r.prototype,Le=Ce.prototype,Re=Oe.prototype,ke=t["__core-js_shared__"],De=Le.toString,Me=Re.hasOwnProperty,Ve=0,Fe=(n=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",je=Re.toString,Be=De.call(Oe),Ue=dt._,$e=Te("^"+De.call(Me).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=gt?t.Buffer:i,qe=t.Symbol,Ge=t.Uint8Array,ze=He?He.allocUnsafe:i,We=un(Oe.getPrototypeOf,Oe),Ye=Oe.create,Xe=Re.propertyIsEnumerable,Ke=Pe.splice,Qe=qe?qe.isConcatSpreadable:i,et=qe?qe.iterator:i,nt=qe?qe.toStringTag:i,ct=function(){try{var e=ho(Oe,"defineProperty");return e({},"",{}),e}catch(e){}}(),pt=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ft=ae&&ae.now!==dt.Date.now&&ae.now,ht=t.setTimeout!==dt.setTimeout&&t.setTimeout,mt=xe.ceil,vt=xe.floor,yt=Oe.getOwnPropertySymbols,Ft=He?He.isBuffer:i,zt=t.isFinite,yn=Pe.join,_n=un(Oe.keys,Oe),En=xe.max,bn=xe.min,wn=ae.now,Sn=t.parseInt,In=xe.random,Cn=Pe.reverse,xn=ho(t,"DataView"),On=ho(t,"Map"),Tn=ho(t,"Promise"),An=ho(t,"Set"),Nn=ho(t,"WeakMap"),Pn=ho(Oe,"create"),Ln=Nn&&new Nn,Rn={},kn=Uo(xn),Dn=Uo(On),Mn=Uo(Tn),Vn=Uo(An),Fn=Uo(Nn),jn=qe?qe.prototype:i,Bn=jn?jn.valueOf:i,Un=jn?jn.toString:i;function $n(e){if(ia(e)&&!Ws(e)&&!(e instanceof zn)){if(e instanceof Gn)return e;if(Me.call(e,"__wrapped__"))return $o(e)}return new Gn(e)}var Hn=function(){function e(){}return function(t){if(!ra(t))return{};if(Ye)return Ye(t);e.prototype=t;var n=new e;return e.prototype=i,n}}();function qn(){}function Gn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function zn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function lr(e,t,n,r,o,s){var a,c=1&t,u=2&t,l=4&t;if(n&&(a=o?n(e,r,o,s):n(e)),a!==i)return a;if(!ra(e))return e;var p=Ws(e);if(p){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Me.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!c)return Pi(e,a)}else{var f=vo(e),d=f==S||f==I;if(Qs(e))return Ci(e,c);if(f==O||f==y||d&&!o){if(a=u||d?{}:_o(e),!c)return u?function(e,t){return Li(e,go(e),t)}(e,function(e,t){return e&&Li(t,Da(t),e)}(a,e)):function(e,t){return Li(e,mo(e),t)}(e,sr(a,e))}else{if(!at[f])return o?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case k:return xi(e);case E:case b:return new r(+e);case D:return function(e,t){var n=t?xi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case M:case V:case F:case j:case B:case U:case $:case H:case q:return Oi(e,n);case C:return new r;case x:case P:return new r(e);case A:return function(e){var t=new e.constructor(e.source,me.exec(e));return t.lastIndex=e.lastIndex,t}(e);case N:return new r;case L:return i=e,Bn?Oe(Bn.call(i)):{}}var i}(e,f,c)}}s||(s=new Qn);var h=s.get(e);if(h)return h;s.set(e,a),ua(e)?e.forEach((function(r){a.add(lr(r,t,n,r,e,s))})):oa(e)&&e.forEach((function(r,i){a.set(i,lr(r,t,n,i,e,s))}));var m=p?i:(l?u?so:oo:u?Da:ka)(e);return Ot(m||e,(function(r,i){m&&(r=e[i=r]),rr(a,i,lr(r,t,n,i,e,s))})),a}function pr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Oe(e);r--;){var o=n[r],s=t[o],a=e[o];if(a===i&&!(o in e)||!s(a))return!1}return!0}function fr(e,t,n){if("function"!=typeof e)throw new Ne(o);return ko((function(){e.apply(i,n)}),t)}function dr(e,t,n,r){var i=-1,o=Pt,s=!0,a=e.length,c=[],u=t.length;if(!a)return c;n&&(t=Rt(t,Qt(n))),r?(o=Lt,s=!1):t.length>=200&&(o=Zt,s=!1,t=new Kn(t));e:for(;++i-1},Yn.prototype.set=function(e,t){var n=this.__data__,r=ir(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Xn.prototype.clear=function(){this.size=0,this.__data__={hash:new Wn,map:new(On||Yn),string:new Wn}},Xn.prototype.delete=function(e){var t=po(this,e).delete(e);return this.size-=t?1:0,t},Xn.prototype.get=function(e){return po(this,e).get(e)},Xn.prototype.has=function(e){return po(this,e).has(e)},Xn.prototype.set=function(e,t){var n=po(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,s),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.clear=function(){this.__data__=new Yn,this.size=0},Qn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Qn.prototype.get=function(e){return this.__data__.get(e)},Qn.prototype.has=function(e){return this.__data__.has(e)},Qn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Yn){var r=n.__data__;if(!On||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Xn(r)}return n.set(e,t),this.size=n.size,this};var hr=Di(wr),mr=Di(Sr,!0);function gr(e,t){var n=!0;return hr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function vr(e,t,n){for(var r=-1,o=e.length;++r0&&n(a)?t>1?_r(a,t-1,n,r,i):kt(i,a):r||(i[i.length]=a)}return i}var Er=Mi(),br=Mi(!0);function wr(e,t){return e&&Er(e,t,ka)}function Sr(e,t){return e&&br(e,t,ka)}function Ir(e,t){return Nt(t,(function(t){return ea(e[t])}))}function Cr(e,t){for(var n=0,r=(t=bi(t,e)).length;null!=e&&nt}function Ar(e,t){return null!=e&&Me.call(e,t)}function Nr(e,t){return null!=e&&t in Oe(e)}function Pr(e,t,n){for(var o=n?Lt:Pt,s=e[0].length,a=e.length,c=a,u=r(a),l=1/0,p=[];c--;){var f=e[c];c&&t&&(f=Rt(f,Qt(t))),l=bn(f.length,l),u[c]=!n&&(t||s>=120&&f.length>=120)?new Kn(c&&f):i}f=e[0];var d=-1,h=u[0];e:for(;++d=a?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)}))}function Wr(e,t,n){for(var r=-1,i=t.length,o={};++r-1;)a!==e&&Ke.call(a,c,1),Ke.call(e,c,1);return e}function Xr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;bo(i)?Ke.call(e,i,1):di(e,i)}}return e}function Kr(e,t){return e+vt(In()*(t-e+1))}function Qr(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=vt(t/2))&&(e+=e)}while(t);return n}function Jr(e,t){return Do(Ao(e,t,sc),e+"")}function Zr(e){return Zn(Ha(e))}function ei(e,t){var n=Ha(e);return Fo(n,ur(t,0,n.length))}function ti(e,t,n,r){if(!ra(e))return e;for(var o=-1,s=(t=bi(t,e)).length,a=s-1,c=e;null!=c&&++oo?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var s=r(o);++i>>1,s=e[o];null!==s&&!pa(s)&&(n?s<=t:s=200){var u=t?null:Qi(e);if(u)return pn(u);s=!1,i=Zt,c=new Kn}else c=t?[]:a;e:for(;++r=r?e:oi(e,t,n)}var Ii=pt||function(e){return dt.clearTimeout(e)};function Ci(e,t){if(t)return e.slice();var n=e.length,r=ze?ze(n):new e.constructor(n);return e.copy(r),r}function xi(e){var t=new e.constructor(e.byteLength);return new Ge(t).set(new Ge(e)),t}function Oi(e,t){var n=t?xi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ti(e,t){if(e!==t){var n=e!==i,r=null===e,o=e==e,s=pa(e),a=t!==i,c=null===t,u=t==t,l=pa(t);if(!c&&!l&&!s&&e>t||s&&a&&u&&!c&&!l||r&&a&&u||!n&&u||!o)return 1;if(!r&&!s&&!l&&e1?n[o-1]:i,a=o>2?n[2]:i;for(s=e.length>3&&"function"==typeof s?(o--,s):i,a&&wo(n[0],n[1],a)&&(s=o<3?i:s,o=1),t=Oe(t);++r-1?o[s?t[a]:a]:i}}function Ui(e){return io((function(t){var n=t.length,r=n,s=Gn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new Ne(o);if(s&&!c&&"wrapper"==co(a))var c=new Gn([],!0)}for(r=c?r:n;++r1&&_.reverse(),d&&lc))return!1;var l=s.get(e),p=s.get(t);if(l&&p)return l==t&&p==e;var f=-1,d=!0,h=2&n?new Kn:i;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(ce,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return Ot(v,(function(n){var r="_."+n[0];t&n[1]&&!Pt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(le):[]}(r),n)))}function Vo(e){var t=0,n=0;return function(){var r=wn(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Fo(e,t){var n=-1,r=e.length,o=r-1;for(t=t===i?r:t;++n1?e[t-1]:i;return n="function"==typeof n?(e.pop(),n):i,cs(e,n)}));function ms(e){var t=$n(e);return t.__chain__=!0,t}function gs(e,t){return t(e)}var vs=io((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,o=function(t){return cr(t,e)};return!(t>1||this.__actions__.length)&&r instanceof zn&&bo(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:gs,args:[o],thisArg:i}),new Gn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)}));var ys=Ri((function(e,t,n){Me.call(e,n)?++e[n]:ar(e,n,1)}));var _s=Bi(zo),Es=Bi(Wo);function bs(e,t){return(Ws(e)?Ot:hr)(e,lo(t,3))}function ws(e,t){return(Ws(e)?Tt:mr)(e,lo(t,3))}var Ss=Ri((function(e,t,n){Me.call(e,n)?e[n].push(t):ar(e,n,[t])}));var Is=Jr((function(e,t,n){var i=-1,o="function"==typeof t,s=Xs(e)?r(e.length):[];return hr(e,(function(e){s[++i]=o?Ct(t,e,n):Lr(e,t,n)})),s})),Cs=Ri((function(e,t,n){ar(e,n,t)}));function xs(e,t){return(Ws(e)?Rt:Ur)(e,lo(t,3))}var Os=Ri((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var Ts=Jr((function(e,t){if(null==e)return[];var n=t.length;return n>1&&wo(e,t[0],t[1])?t=[]:n>2&&wo(t[0],t[1],t[2])&&(t=[t[0]]),zr(e,_r(t,1),[])})),As=ft||function(){return dt.Date.now()};function Ns(e,t,n){return t=n?i:t,t=e&&null==t?e.length:t,Zi(e,p,i,i,i,i,t)}function Ps(e,t){var n;if("function"!=typeof t)throw new Ne(o);return e=va(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=i),n}}var Ls=Jr((function(e,t,n){var r=1;if(n.length){var i=ln(n,uo(Ls));r|=u}return Zi(e,r,t,n,i)})),Rs=Jr((function(e,t,n){var r=3;if(n.length){var i=ln(n,uo(Rs));r|=u}return Zi(t,r,e,n,i)}));function ks(e,t,n){var r,s,a,c,u,l,p=0,f=!1,d=!1,h=!0;if("function"!=typeof e)throw new Ne(o);function m(t){var n=r,o=s;return r=s=i,p=t,c=e.apply(o,n)}function g(e){return p=e,u=ko(y,t),f?m(e):c}function v(e){var n=e-l;return l===i||n>=t||n<0||d&&e-p>=a}function y(){var e=As();if(v(e))return _(e);u=ko(y,function(e){var n=t-(e-l);return d?bn(n,a-(e-p)):n}(e))}function _(e){return u=i,h&&r?m(e):(r=s=i,c)}function E(){var e=As(),n=v(e);if(r=arguments,s=this,l=e,n){if(u===i)return g(l);if(d)return Ii(u),u=ko(y,t),m(l)}return u===i&&(u=ko(y,t)),c}return t=_a(t)||0,ra(n)&&(f=!!n.leading,a=(d="maxWait"in n)?En(_a(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),E.cancel=function(){u!==i&&Ii(u),p=0,r=l=s=u=i},E.flush=function(){return u===i?c:_(As())},E}var Ds=Jr((function(e,t){return fr(e,1,t)})),Ms=Jr((function(e,t,n){return fr(e,_a(t)||0,n)}));function Vs(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ne(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Vs.Cache||Xn),n}function Fs(e){if("function"!=typeof e)throw new Ne(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Vs.Cache=Xn;var js=wi((function(e,t){var n=(t=1==t.length&&Ws(t[0])?Rt(t[0],Qt(lo())):Rt(_r(t,1),Qt(lo()))).length;return Jr((function(r){for(var i=-1,o=bn(r.length,n);++i=t})),zs=Rr(function(){return arguments}())?Rr:function(e){return ia(e)&&Me.call(e,"callee")&&!Xe.call(e,"callee")},Ws=r.isArray,Ys=_t?Qt(_t):function(e){return ia(e)&&Or(e)==k};function Xs(e){return null!=e&&na(e.length)&&!ea(e)}function Ks(e){return ia(e)&&Xs(e)}var Qs=Ft||_c,Js=Et?Qt(Et):function(e){return ia(e)&&Or(e)==b};function Zs(e){if(!ia(e))return!1;var t=Or(e);return t==w||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!aa(e)}function ea(e){if(!ra(e))return!1;var t=Or(e);return t==S||t==I||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ta(e){return"number"==typeof e&&e==va(e)}function na(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ra(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ia(e){return null!=e&&"object"==typeof e}var oa=bt?Qt(bt):function(e){return ia(e)&&vo(e)==C};function sa(e){return"number"==typeof e||ia(e)&&Or(e)==x}function aa(e){if(!ia(e)||Or(e)!=O)return!1;var t=We(e);if(null===t)return!0;var n=Me.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var ca=wt?Qt(wt):function(e){return ia(e)&&Or(e)==A};var ua=St?Qt(St):function(e){return ia(e)&&vo(e)==N};function la(e){return"string"==typeof e||!Ws(e)&&ia(e)&&Or(e)==P}function pa(e){return"symbol"==typeof e||ia(e)&&Or(e)==L}var fa=It?Qt(It):function(e){return ia(e)&&na(e.length)&&!!st[Or(e)]};var da=Yi(Br),ha=Yi((function(e,t){return e<=t}));function ma(e){if(!e)return[];if(Xs(e))return la(e)?hn(e):Pi(e);if(et&&e[et])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[et]());var t=vo(e);return(t==C?cn:t==N?pn:Ha)(e)}function ga(e){return e?(e=_a(e))===d||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function va(e){var t=ga(e),n=t%1;return t==t?n?t-n:t:0}function ya(e){return e?ur(va(e),0,g):0}function _a(e){if("number"==typeof e)return e;if(pa(e))return m;if(ra(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ra(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Kt(e);var n=ve.test(e);return n||_e.test(e)?lt(e.slice(2),n?2:8):ge.test(e)?m:+e}function Ea(e){return Li(e,Da(e))}function ba(e){return null==e?"":pi(e)}var wa=ki((function(e,t){if(xo(t)||Xs(t))Li(t,ka(t),e);else for(var n in t)Me.call(t,n)&&rr(e,n,t[n])})),Sa=ki((function(e,t){Li(t,Da(t),e)})),Ia=ki((function(e,t,n,r){Li(t,Da(t),e,r)})),Ca=ki((function(e,t,n,r){Li(t,ka(t),e,r)})),xa=io(cr);var Oa=Jr((function(e,t){e=Oe(e);var n=-1,r=t.length,o=r>2?t[2]:i;for(o&&wo(t[0],t[1],o)&&(r=1);++n1),t})),Li(e,so(e),n),r&&(n=lr(n,7,no));for(var i=t.length;i--;)di(n,t[i]);return n}));var ja=io((function(e,t){return null==e?{}:function(e,t){return Wr(e,t,(function(t,n){return Na(e,n)}))}(e,t)}));function Ba(e,t){if(null==e)return{};var n=Rt(so(e),(function(e){return[e]}));return t=lo(t),Wr(e,n,(function(e,n){return t(e,n[0])}))}var Ua=Ji(ka),$a=Ji(Da);function Ha(e){return null==e?[]:Jt(e,ka(e))}var qa=Fi((function(e,t,n){return t=t.toLowerCase(),e+(n?Ga(t):t)}));function Ga(e){return Za(ba(e).toLowerCase())}function za(e){return(e=ba(e))&&e.replace(be,rn).replace(Ze,"")}var Wa=Fi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ya=Fi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Xa=Vi("toLowerCase");var Ka=Fi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Qa=Fi((function(e,t,n){return e+(n?" ":"")+Za(t)}));var Ja=Fi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Za=Vi("toUpperCase");function ec(e,t,n){return e=ba(e),(t=n?i:t)===i?function(e){return rt.test(e)}(e)?function(e){return e.match(tt)||[]}(e):function(e){return e.match(pe)||[]}(e):e.match(t)||[]}var tc=Jr((function(e,t){try{return Ct(e,i,t)}catch(e){return Zs(e)?e:new Ie(e)}})),nc=io((function(e,t){return Ot(t,(function(t){t=Bo(t),ar(e,t,Ls(e[t],e))})),e}));function rc(e){return function(){return e}}var ic=Ui(),oc=Ui(!0);function sc(e){return e}function ac(e){return Vr("function"==typeof e?e:lr(e,1))}var cc=Jr((function(e,t){return function(n){return Lr(n,e,t)}})),uc=Jr((function(e,t){return function(n){return Lr(e,n,t)}}));function lc(e,t,n){var r=ka(t),i=Ir(t,r);null!=n||ra(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=Ir(t,ka(t)));var o=!(ra(n)&&"chain"in n&&!n.chain),s=ea(e);return Ot(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=Pi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,kt([this.value()],arguments))})})),e}function pc(){}var fc=Gi(Rt),dc=Gi(At),hc=Gi(Vt);function mc(e){return So(e)?Gt(Bo(e)):function(e){return function(t){return Cr(t,e)}}(e)}var gc=Wi(),vc=Wi(!0);function yc(){return[]}function _c(){return!1}var Ec=qi((function(e,t){return e+t}),0),bc=Ki("ceil"),wc=qi((function(e,t){return e/t}),1),Sc=Ki("floor");var Ic,Cc=qi((function(e,t){return e*t}),1),xc=Ki("round"),Oc=qi((function(e,t){return e-t}),0);return $n.after=function(e,t){if("function"!=typeof t)throw new Ne(o);return e=va(e),function(){if(--e<1)return t.apply(this,arguments)}},$n.ary=Ns,$n.assign=wa,$n.assignIn=Sa,$n.assignInWith=Ia,$n.assignWith=Ca,$n.at=xa,$n.before=Ps,$n.bind=Ls,$n.bindAll=nc,$n.bindKey=Rs,$n.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ws(e)?e:[e]},$n.chain=ms,$n.chunk=function(e,t,n){t=(n?wo(e,t,n):t===i)?1:En(va(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var s=0,a=0,c=r(mt(o/t));so?0:o+n),(r=r===i||r>o?o:va(r))<0&&(r+=o),r=n>r?0:ya(r);n>>0)?(e=ba(e))&&("string"==typeof t||null!=t&&!ca(t))&&!(t=pi(t))&&an(e)?Si(hn(e),0,n):e.split(t,n):[]},$n.spread=function(e,t){if("function"!=typeof e)throw new Ne(o);return t=null==t?0:En(va(t),0),Jr((function(n){var r=n[t],i=Si(n,0,t);return r&&kt(i,r),Ct(e,this,i)}))},$n.tail=function(e){var t=null==e?0:e.length;return t?oi(e,1,t):[]},$n.take=function(e,t,n){return e&&e.length?oi(e,0,(t=n||t===i?1:va(t))<0?0:t):[]},$n.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?oi(e,(t=r-(t=n||t===i?1:va(t)))<0?0:t,r):[]},$n.takeRightWhile=function(e,t){return e&&e.length?mi(e,lo(t,3),!1,!0):[]},$n.takeWhile=function(e,t){return e&&e.length?mi(e,lo(t,3)):[]},$n.tap=function(e,t){return t(e),e},$n.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new Ne(o);return ra(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),ks(e,t,{leading:r,maxWait:t,trailing:i})},$n.thru=gs,$n.toArray=ma,$n.toPairs=Ua,$n.toPairsIn=$a,$n.toPath=function(e){return Ws(e)?Rt(e,Bo):pa(e)?[e]:Pi(jo(ba(e)))},$n.toPlainObject=Ea,$n.transform=function(e,t,n){var r=Ws(e),i=r||Qs(e)||fa(e);if(t=lo(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:ra(e)&&ea(o)?Hn(We(e)):{}}return(i?Ot:wr)(e,(function(e,r,i){return t(n,e,r,i)})),n},$n.unary=function(e){return Ns(e,1)},$n.union=is,$n.unionBy=os,$n.unionWith=ss,$n.uniq=function(e){return e&&e.length?fi(e):[]},$n.uniqBy=function(e,t){return e&&e.length?fi(e,lo(t,2)):[]},$n.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?fi(e,i,t):[]},$n.unset=function(e,t){return null==e||di(e,t)},$n.unzip=as,$n.unzipWith=cs,$n.update=function(e,t,n){return null==e?e:hi(e,t,Ei(n))},$n.updateWith=function(e,t,n,r){return r="function"==typeof r?r:i,null==e?e:hi(e,t,Ei(n),r)},$n.values=Ha,$n.valuesIn=function(e){return null==e?[]:Jt(e,Da(e))},$n.without=us,$n.words=ec,$n.wrap=function(e,t){return Bs(Ei(t),e)},$n.xor=ls,$n.xorBy=ps,$n.xorWith=fs,$n.zip=ds,$n.zipObject=function(e,t){return yi(e||[],t||[],rr)},$n.zipObjectDeep=function(e,t){return yi(e||[],t||[],ti)},$n.zipWith=hs,$n.entries=Ua,$n.entriesIn=$a,$n.extend=Sa,$n.extendWith=Ia,lc($n,$n),$n.add=Ec,$n.attempt=tc,$n.camelCase=qa,$n.capitalize=Ga,$n.ceil=bc,$n.clamp=function(e,t,n){return n===i&&(n=t,t=i),n!==i&&(n=(n=_a(n))==n?n:0),t!==i&&(t=(t=_a(t))==t?t:0),ur(_a(e),t,n)},$n.clone=function(e){return lr(e,4)},$n.cloneDeep=function(e){return lr(e,5)},$n.cloneDeepWith=function(e,t){return lr(e,5,t="function"==typeof t?t:i)},$n.cloneWith=function(e,t){return lr(e,4,t="function"==typeof t?t:i)},$n.conformsTo=function(e,t){return null==t||pr(e,t,ka(t))},$n.deburr=za,$n.defaultTo=function(e,t){return null==e||e!=e?t:e},$n.divide=wc,$n.endsWith=function(e,t,n){e=ba(e),t=pi(t);var r=e.length,o=n=n===i?r:ur(va(n),0,r);return(n-=t.length)>=0&&e.slice(n,o)==t},$n.eq=Hs,$n.escape=function(e){return(e=ba(e))&&Q.test(e)?e.replace(X,on):e},$n.escapeRegExp=function(e){return(e=ba(e))&&oe.test(e)?e.replace(ie,"\\$&"):e},$n.every=function(e,t,n){var r=Ws(e)?At:gr;return n&&wo(e,t,n)&&(t=i),r(e,lo(t,3))},$n.find=_s,$n.findIndex=zo,$n.findKey=function(e,t){return jt(e,lo(t,3),wr)},$n.findLast=Es,$n.findLastIndex=Wo,$n.findLastKey=function(e,t){return jt(e,lo(t,3),Sr)},$n.floor=Sc,$n.forEach=bs,$n.forEachRight=ws,$n.forIn=function(e,t){return null==e?e:Er(e,lo(t,3),Da)},$n.forInRight=function(e,t){return null==e?e:br(e,lo(t,3),Da)},$n.forOwn=function(e,t){return e&&wr(e,lo(t,3))},$n.forOwnRight=function(e,t){return e&&Sr(e,lo(t,3))},$n.get=Aa,$n.gt=qs,$n.gte=Gs,$n.has=function(e,t){return null!=e&&yo(e,t,Ar)},$n.hasIn=Na,$n.head=Xo,$n.identity=sc,$n.includes=function(e,t,n,r){e=Xs(e)?e:Ha(e),n=n&&!r?va(n):0;var i=e.length;return n<0&&(n=En(i+n,0)),la(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Ut(e,t,n)>-1},$n.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:va(n);return i<0&&(i=En(r+i,0)),Ut(e,t,i)},$n.inRange=function(e,t,n){return t=ga(t),n===i?(n=t,t=0):n=ga(n),function(e,t,n){return e>=bn(t,n)&&e=-9007199254740991&&e<=h},$n.isSet=ua,$n.isString=la,$n.isSymbol=pa,$n.isTypedArray=fa,$n.isUndefined=function(e){return e===i},$n.isWeakMap=function(e){return ia(e)&&vo(e)==R},$n.isWeakSet=function(e){return ia(e)&&"[object WeakSet]"==Or(e)},$n.join=function(e,t){return null==e?"":yn.call(e,t)},$n.kebabCase=Wa,$n.last=Zo,$n.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r;return n!==i&&(o=(o=va(n))<0?En(r+o,0):bn(o,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Bt(e,Ht,o,!0)},$n.lowerCase=Ya,$n.lowerFirst=Xa,$n.lt=da,$n.lte=ha,$n.max=function(e){return e&&e.length?vr(e,sc,Tr):i},$n.maxBy=function(e,t){return e&&e.length?vr(e,lo(t,2),Tr):i},$n.mean=function(e){return qt(e,sc)},$n.meanBy=function(e,t){return qt(e,lo(t,2))},$n.min=function(e){return e&&e.length?vr(e,sc,Br):i},$n.minBy=function(e,t){return e&&e.length?vr(e,lo(t,2),Br):i},$n.stubArray=yc,$n.stubFalse=_c,$n.stubObject=function(){return{}},$n.stubString=function(){return""},$n.stubTrue=function(){return!0},$n.multiply=Cc,$n.nth=function(e,t){return e&&e.length?Gr(e,va(t)):i},$n.noConflict=function(){return dt._===this&&(dt._=Ue),this},$n.noop=pc,$n.now=As,$n.pad=function(e,t,n){e=ba(e);var r=(t=va(t))?dn(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return zi(vt(i),n)+e+zi(mt(i),n)},$n.padEnd=function(e,t,n){e=ba(e);var r=(t=va(t))?dn(e):0;return t&&rt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=In();return bn(e+o*(t-e+ut("1e-"+((o+"").length-1))),t)}return Kr(e,t)},$n.reduce=function(e,t,n){var r=Ws(e)?Dt:Wt,i=arguments.length<3;return r(e,lo(t,4),n,i,hr)},$n.reduceRight=function(e,t,n){var r=Ws(e)?Mt:Wt,i=arguments.length<3;return r(e,lo(t,4),n,i,mr)},$n.repeat=function(e,t,n){return t=(n?wo(e,t,n):t===i)?1:va(t),Qr(ba(e),t)},$n.replace=function(){var e=arguments,t=ba(e[0]);return e.length<3?t:t.replace(e[1],e[2])},$n.result=function(e,t,n){var r=-1,o=(t=bi(t,e)).length;for(o||(o=1,e=i);++rh)return[];var n=g,r=bn(e,g);t=lo(t),e-=g;for(var i=Xt(r,t);++n=s)return e;var c=n-dn(r);if(c<1)return r;var u=a?Si(a,0,c).join(""):e.slice(0,c);if(o===i)return u+r;if(a&&(c+=u.length-c),ca(o)){if(e.slice(c).search(o)){var l,p=u;for(o.global||(o=Te(o.source,ba(me.exec(o))+"g")),o.lastIndex=0;l=o.exec(p);)var f=l.index;u=u.slice(0,f===i?c:f)}}else if(e.indexOf(pi(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r},$n.unescape=function(e){return(e=ba(e))&&K.test(e)?e.replace(Y,gn):e},$n.uniqueId=function(e){var t=++Ve;return ba(e)+t},$n.upperCase=Ja,$n.upperFirst=Za,$n.each=bs,$n.eachRight=ws,$n.first=Xo,lc($n,(Ic={},wr($n,(function(e,t){Me.call($n.prototype,t)||(Ic[t]=e)})),Ic),{chain:!1}),$n.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){$n[e].placeholder=$n})),Ot(["drop","take"],(function(e,t){zn.prototype[e]=function(n){n=n===i?1:En(va(n),0);var r=this.__filtered__&&!t?new zn(this):this.clone();return r.__filtered__?r.__takeCount__=bn(n,r.__takeCount__):r.__views__.push({size:bn(n,g),type:e+(r.__dir__<0?"Right":"")}),r},zn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;zn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:lo(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),Ot(["head","last"],(function(e,t){var n="take"+(t?"Right":"");zn.prototype[e]=function(){return this[n](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");zn.prototype[e]=function(){return this.__filtered__?new zn(this):this[n](1)}})),zn.prototype.compact=function(){return this.filter(sc)},zn.prototype.find=function(e){return this.filter(e).head()},zn.prototype.findLast=function(e){return this.reverse().find(e)},zn.prototype.invokeMap=Jr((function(e,t){return"function"==typeof e?new zn(this):this.map((function(n){return Lr(n,e,t)}))})),zn.prototype.reject=function(e){return this.filter(Fs(lo(e)))},zn.prototype.slice=function(e,t){e=va(e);var n=this;return n.__filtered__&&(e>0||t<0)?new zn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==i&&(n=(t=va(t))<0?n.dropRight(-t):n.take(t-e)),n)},zn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zn.prototype.toArray=function(){return this.take(g)},wr(zn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),o=$n[r?"take"+("last"==t?"Right":""):t],s=r||/^find/.test(t);o&&($n.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,c=t instanceof zn,u=a[0],l=c||Ws(t),p=function(e){var t=o.apply($n,kt([e],a));return r&&f?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(c=l=!1);var f=this.__chain__,d=!!this.__actions__.length,h=s&&!f,m=c&&!d;if(!s&&l){t=m?t:new zn(this);var g=e.apply(t,a);return g.__actions__.push({func:gs,args:[p],thisArg:i}),new Gn(g,f)}return h&&m?e.apply(this,a):(g=this.thru(p),h?r?g.value()[0]:g.value():g)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Pe[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);$n.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ws(i)?i:[],e)}return this[n]((function(n){return t.apply(Ws(n)?n:[],e)}))}})),wr(zn.prototype,(function(e,t){var n=$n[t];if(n){var r=n.name+"";Me.call(Rn,r)||(Rn[r]=[]),Rn[r].push({name:t,func:n})}})),Rn[$i(i,2).name]=[{name:"wrapper",func:i}],zn.prototype.clone=function(){var e=new zn(this.__wrapped__);return e.__actions__=Pi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Pi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Pi(this.__views__),e},zn.prototype.reverse=function(){if(this.__filtered__){var e=new zn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ws(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},$n.prototype.plant=function(e){for(var t,n=this;n instanceof qn;){var r=$o(n);r.__index__=0,r.__values__=i,t?o.__wrapped__=r:t=r;var o=r;n=n.__wrapped__}return o.__wrapped__=e,t},$n.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zn){var t=e;return this.__actions__.length&&(t=new zn(this)),(t=t.reverse()).__actions__.push({func:gs,args:[rs],thisArg:i}),new Gn(t,this.__chain__)}return this.thru(rs)},$n.prototype.toJSON=$n.prototype.valueOf=$n.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},$n.prototype.first=$n.prototype.head,et&&($n.prototype[et]=function(){return this}),$n}();dt._=vn,(r=function(){return vn}.call(t,n,t,e))===i||(e.exports=r)}.call(this)},9593:(e,t,n)=>{"use strict";const r=n(4411),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),p=Symbol("lruList"),f=Symbol("cache"),d=Symbol("updateAgeOnGet"),h=()=>1;const m=(e,t,n)=>{const r=e[f].get(t);if(r){const t=r.value;if(g(e,t)){if(y(e,r),!e[a])return}else n&&(e[d]&&(r.value.now=Date.now()),e[p].unshiftNode(r));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[c]&&n>e[c]},v=e=>{if(e[o]>e[i])for(let t=e[p].tail;e[o]>e[i]&&null!==t;){const n=t.prev;y(e,t),t=n}},y=(e,t)=>{if(t){const n=t.value;e[u]&&e[u](n.key,n.value),e[o]-=n.length,e[f].delete(n.key),e[p].removeNode(t)}};class _{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const E=(e,t,n,r)=>{let i=n.value;g(e,i)&&(y(e,n),e[a]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||h;if(this[s]="function"!=typeof t?h:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[d]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,v(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,v(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[s]&&(this[s]=e,this[o]=0,this[p].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),v(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let n=this[p].tail;null!==n;){const r=n.prev;E(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[p].head;null!==n;){const r=n.next;E(this,e,n,t),n=r}}keys(){return this[p].toArray().map((e=>e.key))}values(){return this[p].toArray().map((e=>e.value))}reset(){this[u]&&this[p]&&this[p].length&&this[p].forEach((e=>this[u](e.key,e.value))),this[f]=new Map,this[p]=new r,this[o]=0}dump(){return this[p].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[p]}set(e,t,n){if((n=n||this[c])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,a=this[s](t,e);if(this[f].has(e)){if(a>this[i])return y(this,this[f].get(e)),!1;const s=this[f].get(e).value;return this[u]&&(this[l]||this[u](e,s.value)),s.now=r,s.maxAge=n,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),v(this),!0}const d=new _(e,t,a,r,n);return d.length>this[i]?(this[u]&&this[u](e,t),!1):(this[o]+=d.length,this[p].unshift(d),this[f].set(e,this[p].head),v(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!g(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[p].tail;return e?(y(this,e),e.value):null}del(e){y(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[f].forEach(((e,t)=>m(this,t,!1)))}}},1171:(e,t,n)=>{e.exports=f,f.Minimatch=d;var r={sep:"/"};try{r=n(5622)}catch(e){}var i=f.GLOBSTAR=d.GLOBSTAR={},o=n(3644),s={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},a="[^/]",c="[^/]*?",u="().*{}+?[]^$\\!".split("").reduce((function(e,t){return e[t]=!0,e}),{});var l=/\/+/;function p(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 d(t,n).match(e))}function d(e,t){if(!(this instanceof d))return new d(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 h(e,t){if(t||(t=this instanceof d?this.options:{}),void 0===(e=void 0===e?this.pattern:e))throw new TypeError("undefined pattern");return t.nobrace||!e.match(/\{.*\}/)?[e]:o(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,p(e,i))};return n.Minimatch=function(n,r){return new t.Minimatch(n,p(e,r))},n},d.defaults=function(e){return e&&Object.keys(e).length?f.defaults(e).Minimatch:d},d.prototype.debug=function(){},d.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(l)})),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},d.prototype.parseNegate=function(){var e=this.pattern,t=!1,n=this.options,r=0;if(n.nonegate)return;for(var i=0,o=e.length;i65536)throw new TypeError("pattern is too long");var n=this.options;if(!n.noglobstar&&"**"===e)return i;if(""===e)return"";var r,o="",l=!!n.nocase,p=!1,f=[],d=[],h=!1,g=-1,v=-1,y="."===e.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",_=this;function E(){if(r){switch(r){case"*":o+=c,l=!0;break;case"?":o+=a,l=!0;break;default:o+="\\"+r}_.debug("clearStateChar %j %j",r,o),r=!1}}for(var b,w=0,S=e.length;w-1;N--){var P=d[N],L=o.slice(0,P.reStart),R=o.slice(P.reStart,P.reEnd-8),k=o.slice(P.reEnd-8,P.reEnd),D=o.slice(P.reEnd);k+=D;var M=L.split("(").length-1,V=D;for(w=0;w=0&&!(i=e[o]);o--);for(o=0;o>> no match, partial?",e,f,t,d),f!==a))}if("string"==typeof l?(u=r.nocase?p.toLowerCase()===l.toLowerCase():p===l,this.debug("string match",l,p,u)):(u=p.match(l),this.debug("pattern match",l,p,u)),!u)return!1}if(o===a&&s===c)return!0;if(o===a)return n;if(s===c)return o===a-1&&""===e[o];throw new Error("wtf?")}},7824:e=>{var t=1e3,n=60*t,r=60*n,i=24*r,o=7*i,s=365.25*i;function a(e,t,n,r){var i=t>=1.5*n;return Math.round(e/n)+" "+r+(i?"s":"")}e.exports=function(e,c){c=c||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var c=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*o;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*r;case"minutes":case"minute":case"mins":case"min":case"m":return c*n;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===u&&isFinite(e))return c.long?function(e){var o=Math.abs(e);if(o>=i)return a(e,o,i,"day");if(o>=r)return a(e,o,r,"hour");if(o>=n)return a(e,o,n,"minute");if(o>=t)return a(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=i)return Math.round(e/i)+"d";if(o>=r)return Math.round(e/r)+"h";if(o>=n)return Math.round(e/n)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},778:(e,t,n)=>{var r=n(2479);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 o(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(o),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},4095:e=>{"use strict";function t(e){return"/"===e.charAt(0)}function n(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?n:t,e.exports.posix=t,e.exports.win32=n},9916:e=>{function t(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}function n(e){e.pending+=1;var t=!1;return function(i){if(t)throw new Error("callback called twice");if(t=!0,e.error=e.error||i,e.pending-=1,e.waiting.length>0&&e.pending{var r=n(778),i=n(2840),o=n(5747),s=function(){},a=/^v?\.0/.test(process.version),c=function(e){return"function"==typeof e},u=function(e,t,n,u){u=r(u);var l=!1;e.on("close",(function(){l=!0})),i(e,{readable:t,writable:n},(function(e){if(e)return u(e);l=!0,u()}));var p=!1;return function(t){if(!l&&!p)return p=!0,function(e){return!!a&&!!o&&(e instanceof(o.ReadStream||s)||e instanceof(o.WriteStream||s))&&c(e.close)}(e)?e.close(s):function(e){return e.setHeader&&c(e.abort)}(e)?e.abort():c(e.destroy)?e.destroy():void u(t||new Error("stream was destroyed"))}},l=function(e){e()},p=function(e,t){return e.pipe(t)};e.exports=function(){var e,t=Array.prototype.slice.call(arguments),n=c(t[t.length-1]||s)&&t.pop()||s;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r=t.map((function(i,o){var s=o0,(function(t){e||(e=t),t&&r.forEach(l),s||(r.forEach(l),n(e))}))}));return t.reduce(p)}},984:(e,t,n)=>{const r=n(2357),i=n(5622),o=n(5747);let s;try{s=n(2884)}catch(e){}const a={nosort:!0,silent:!0};let c=0;const u="win32"===process.platform,l=e=>{if(["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||o[t],e[t+="Sync"]=e[t]||o[t]})),e.maxBusyTries=e.maxBusyTries||3,e.emfileWait=e.emfileWait||1e3,!1===e.glob&&(e.disableGlob=!0),!0!==e.disableGlob&&void 0===s)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");e.disableGlob=e.disableGlob||!1,e.glob=e.glob||a},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"),l(t);let i=0,o=null,a=0;const u=(e,r)=>e?n(e):(a=r.length,0===a?n():void r.forEach((e=>{const r=s=>{if(s){if(("EBUSY"===s.code||"ENOTEMPTY"===s.code||"EPERM"===s.code)&&if(e,t,r)),100*i);if("EMFILE"===s.code&&cf(e,t,r)),c++);"ENOENT"===s.code&&(s=null)}c=0,(e=>{o=o||e,0==--a&&n(o)})(s)};f(e,t,r)})));if(t.disableGlob||!s.hasMagic(e))return u(null,[e]);t.lstat(e,((n,r)=>{if(!n)return u(null,[e]);s(e,t.glob,u)}))},f=(e,t,n)=>{r(e),r(t),r("function"==typeof n),t.lstat(e,((r,i)=>r&&"ENOENT"===r.code?n(null):(r&&"EPERM"===r.code&&u&&d(e,t,r,n),i&&i.isDirectory()?m(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return u?d(e,t,r,n):m(e,t,r,n);if("EISDIR"===r.code)return m(e,t,r,n)}return n(r)})))))},d=(e,t,n,i)=>{r(e),r(t),r("function"==typeof i),t.chmod(e,438,(r=>{r?i("ENOENT"===r.code?null:n):t.stat(e,((r,o)=>{r?i("ENOENT"===r.code?null:n):o.isDirectory()?m(e,t,n,i):t.unlink(e,i)}))}))},h=(e,t,n)=>{r(e),r(t);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}let i;try{i=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}i.isDirectory()?y(e,t,n):t.unlinkSync(e)},m=(e,t,n,i)=>{r(e),r(t),r("function"==typeof i),t.rmdir(e,(r=>{!r||"ENOTEMPTY"!==r.code&&"EEXIST"!==r.code&&"EPERM"!==r.code?r&&"ENOTDIR"===r.code?i(n):i(r):g(e,t,i)}))},g=(e,t,n)=>{r(e),r(t),r("function"==typeof n),t.readdir(e,((r,o)=>{if(r)return n(r);let s,a=o.length;if(0===a)return t.rmdir(e,n);o.forEach((r=>{p(i.join(e,r),t,(r=>{if(!s)return r?n(s=r):void(0==--a&&t.rmdir(e,n))}))}))}))},v=(e,t)=>{let n;if(l(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||!s.hasMagic(e))n=[e];else try{t.lstatSync(e),n=[e]}catch(r){n=s.sync(e,t.glob)}if(n.length)for(let e=0;e{r(e),r(t);try{t.rmdirSync(e)}catch(r){if("ENOENT"===r.code)return;if("ENOTDIR"===r.code)throw n;"ENOTEMPTY"!==r.code&&"EEXIST"!==r.code&&"EPERM"!==r.code||_(e,t)}},_=(e,t)=>{r(e),r(t),t.readdirSync(e).forEach((n=>v(i.join(e,n),t)));const n=u?100:1;let o=0;for(;;){let r=!0;try{const i=t.rmdirSync(e,t);return r=!1,i}finally{if(++o{const r=Symbol("SemVer ANY");class i{static get ANY(){return r}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new l(n[2],this.options.loose):this.semver=r}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===r||e===r)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new p(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new p(this.value,t).test(e.semver);const n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=c(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),u=c(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||o&&s||a||u}}e.exports=i;const o=n(2893),{re:s,t:a}=n(5765),c=n(7539),u=n(4225),l=n(6376),p=n(6902)},6902:(e,t,n)=>{class r{constructor(e,t){if(t=o(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!h(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,n=i.get(t);if(n)return n;const r=this.options.loose,o=r?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(o,O(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],p),a("comparator trim",e,u[l.COMPARATORTRIM]),e=(e=(e=e.replace(u[l.TILDETRIM],f)).replace(u[l.CARETTRIM],d)).split(/\s+/).join(" ");const c=r?u[l.COMPARATORLOOSE]:u[l.COMPARATOR],m=e.split(" ").map((e=>v(e,this.options))).join(" ").split(/\s+/).map((e=>x(e,this.options))).filter(this.options.loose?e=>!!e.match(c):()=>!0).map((e=>new s(e,this.options))),g=(m.length,new Map);for(const e of m){if(h(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const y=[...g.values()];return i.set(t,y),y}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some((n=>g(n,t)&&e.set.some((e=>g(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},v=(e,t)=>(a("comp",e,t),e=b(e,t),a("caret",e),e=_(e,t),a("tildes",e),e=S(e,t),a("xrange",e),e=C(e,t),a("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,_=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{const n=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(n,((t,n,r,i,o)=>{let s;return a("tilde",e,t,n,r,i,o),y(n)?s="":y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:o?(a("replaceTilde pr",o),s=`>=${n}.${r}.${i}-${o} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,a("tilde return",s),s}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{a("caret",e,t);const n=t.loose?u[l.CARETLOOSE]:u[l.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,o,s)=>{let c;return a("caret",e,t,n,i,o,s),y(n)?c="":y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(o)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(a("replaceCaret pr",s),c="0"===n?"0"===i?`>=${n}.${i}.${o}-${s} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o}-${s} <${+n+1}.0.0-0`):(a("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${o}${r} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o} <${+n+1}.0.0-0`),a("caret return",c),c}))},S=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>I(e,t))).join(" ")),I=(e,t)=>{e=e.trim();const n=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(n,((n,r,i,o,s,c)=>{a("xRange",e,n,r,i,o,s,c);const u=y(i),l=u||y(o),p=l||y(s),f=p;return"="===r&&f&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(l&&(o=0),s=0,">"===r?(r=">=",l?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",l?i=+i+1:o=+o+1),"<"===r&&(c="-0"),n=`${r+i}.${o}.${s}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:p&&(n=`>=${i}.${o}.0${c} <${i}.${+o+1}.0-0`),a("xRange return",n),n}))},C=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[l.STAR],"")),x=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=e=>(t,n,r,i,o,s,a,c,u,l,p,f,d)=>`${n=y(r)?"":y(i)?`>=${r}.0.0${e?"-0":""}`:y(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=y(u)?"":y(l)?`<${+u+1}.0.0-0`:y(p)?`<${u}.${+l+1}.0-0`:f?`<=${u}.${l}.${p}-${f}`:e?`<${u}.${l}.${+p+1}-0`:`<=${c}`}`.trim(),T=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0}},6376:(e,t,n)=>{const r=n(4225),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=n(3295),{re:s,t:a}=n(5765),c=n(2893),{compareIdentifiers:u}=n(6742);class l{constructor(e,t){if(t=c(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);r("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const n=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&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}}e.exports=l},3507:(e,t,n)=>{const r=n(3959);e.exports=(e,t)=>{const n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},7539:(e,t,n)=>{const r=n(8718),i=n(1194),o=n(1312),s=n(5903),a=n(1544),c=n(2056);e.exports=(e,t,n,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,u);case"!=":return i(e,n,u);case">":return o(e,n,u);case">=":return s(e,n,u);case"<":return a(e,n,u);case"<=":return c(e,n,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},9038:(e,t,n)=>{const r=n(6376),i=n(3959),{re:o,t:s}=n(5765);e.exports=(e,t)=>{if(e instanceof r)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=o[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),o[s.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[s.COERCERTL].lastIndex=-1}else n=e.match(o[s.COERCE]);return null===n?null:i(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)}},8880:(e,t,n)=>{const r=n(6376);e.exports=(e,t,n)=>{const i=new r(e,n),o=new r(t,n);return i.compare(o)||i.compareBuild(o)}},7880:(e,t,n)=>{const r=n(6269);e.exports=(e,t)=>r(e,t,!0)},6269:(e,t,n)=>{const r=n(6376);e.exports=(e,t,n)=>new r(e,n).compare(new r(t,n))},2378:(e,t,n)=>{const r=n(3959),i=n(8718);e.exports=(e,t)=>{if(i(e,t))return null;{const n=r(e),i=r(t),o=n.prerelease.length||i.prerelease.length,s=o?"pre":"",a=o?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==i[e])return s+e;return a}}},8718:(e,t,n)=>{const r=n(6269);e.exports=(e,t,n)=>0===r(e,t,n)},1312:(e,t,n)=>{const r=n(6269);e.exports=(e,t,n)=>r(e,t,n)>0},5903:(e,t,n)=>{const r=n(6269);e.exports=(e,t,n)=>r(e,t,n)>=0},253:(e,t,n)=>{const r=n(6376);e.exports=(e,t,n,i)=>{"string"==typeof n&&(i=n,n=void 0);try{return new r(e,n).inc(t,i).version}catch(e){return null}}},1544:(e,t,n)=>{const r=n(6269);e.exports=(e,t,n)=>r(e,t,n)<0},2056:(e,t,n)=>{const r=n(6269);e.exports=(e,t,n)=>r(e,t,n)<=0},8679:(e,t,n)=>{const r=n(6376);e.exports=(e,t)=>new r(e,t).major},7789:(e,t,n)=>{const r=n(6376);e.exports=(e,t)=>new r(e,t).minor},1194:(e,t,n)=>{const r=n(6269);e.exports=(e,t,n)=>0!==r(e,t,n)},3959:(e,t,n)=>{const{MAX_LENGTH:r}=n(3295),{re:i,t:o}=n(5765),s=n(6376),a=n(2893);e.exports=(e,t)=>{if(t=a(t),e instanceof s)return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t.loose?i[o.LOOSE]:i[o.FULL]).test(e))return null;try{return new s(e,t)}catch(e){return null}}},2358:(e,t,n)=>{const r=n(6376);e.exports=(e,t)=>new r(e,t).patch},7559:(e,t,n)=>{const r=n(3959);e.exports=(e,t)=>{const n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},9795:(e,t,n)=>{const r=n(6269);e.exports=(e,t,n)=>r(t,e,n)},3657:(e,t,n)=>{const r=n(8880);e.exports=(e,t)=>e.sort(((e,n)=>r(n,e,t)))},5712:(e,t,n)=>{const r=n(6902);e.exports=(e,t,n)=>{try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},1100:(e,t,n)=>{const r=n(8880);e.exports=(e,t)=>e.sort(((e,n)=>r(e,n,t)))},6397:(e,t,n)=>{const r=n(3959);e.exports=(e,t)=>{const n=r(e,t);return n?n.version:null}},1249:(e,t,n)=>{const r=n(5765);e.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(3295).SEMVER_SPEC_VERSION,SemVer:n(6376),compareIdentifiers:n(6742).compareIdentifiers,rcompareIdentifiers:n(6742).rcompareIdentifiers,parse:n(3959),valid:n(6397),clean:n(3507),inc:n(253),diff:n(2378),major:n(8679),minor:n(7789),patch:n(2358),prerelease:n(7559),compare:n(6269),rcompare:n(9795),compareLoose:n(7880),compareBuild:n(8880),sort:n(1100),rsort:n(3657),gt:n(1312),lt:n(1544),eq:n(8718),neq:n(1194),gte:n(5903),lte:n(2056),cmp:n(7539),coerce:n(9038),Comparator:n(2257),Range:n(6902),satisfies:n(5712),toComparators:n(1042),maxSatisfying:n(5775),minSatisfying:n(1657),minVersion:n(5316),validRange:n(9042),outside:n(6826),gtr:n(7606),ltr:n(32),intersects:n(2937),simplifyRange:n(7908),subset:n(799)}},3295:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:t,MAX_SAFE_COMPONENT_LENGTH:16}},4225:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},6742:e=>{const t=/^[0-9]+$/,n=(e,n)=>{const r=t.test(e),i=t.test(n);return r&&i&&(e=+e,n=+n),e===n?0:r&&!i?-1:i&&!r?1:en(t,e)}},2893:e=>{const t=["includePrerelease","loose","rtl"];e.exports=e=>e?"object"!=typeof e?{loose:!0}:t.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{}},5765:(e,t,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:r}=n(3295),i=n(4225),o=(t=e.exports={}).re=[],s=t.src=[],a=t.t={};let c=0;const u=(e,t,n)=>{const r=c++;i(r,t),a[e]=r,s[r]=t,o[r]=new RegExp(t,n?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})\\.(${s[a.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})\\.(${s[a.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[a.NUMERICIDENTIFIER]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[a.NUMERICIDENTIFIERLOOSE]}|${s[a.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[a.PRERELEASEIDENTIFIER]}(?:\\.${s[a.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[a.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[a.BUILDIDENTIFIER]}(?:\\.${s[a.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[a.MAINVERSION]}${s[a.PRERELEASE]}?${s[a.BUILD]}?`),u("FULL",`^${s[a.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[a.MAINVERSIONLOOSE]}${s[a.PRERELEASELOOSE]}?${s[a.BUILD]}?`),u("LOOSE",`^${s[a.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",`${s[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),u("XRANGEIDENTIFIER",`${s[a.NUMERICIDENTIFIER]}|x|X|\\*`),u("XRANGEPLAIN",`[v=\\s]*(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:\\.(${s[a.XRANGEIDENTIFIER]})(?:${s[a.PRERELEASE]})?${s[a.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[a.XRANGEIDENTIFIERLOOSE]})(?:${s[a.PRERELEASELOOSE]})?${s[a.BUILD]}?)?)?`),u("XRANGE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[a.GTLT]}\\s*${s[a.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),u("COERCERTL",s[a.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[a.LONETILDE]}${s[a.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${s[a.LONECARET]}${s[a.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[a.LONECARET]}${s[a.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[a.GTLT]}\\s*(${s[a.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[a.GTLT]}\\s*(${s[a.LOOSEPLAIN]}|${s[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[a.XRANGEPLAIN]})\\s+-\\s+(${s[a.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[a.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0.0.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},7606:(e,t,n)=>{const r=n(6826);e.exports=(e,t,n)=>r(e,t,">",n)},2937:(e,t,n)=>{const r=n(6902);e.exports=(e,t,n)=>(e=new r(e,n),t=new r(t,n),e.intersects(t))},32:(e,t,n)=>{const r=n(6826);e.exports=(e,t,n)=>r(e,t,"<",n)},5775:(e,t,n)=>{const r=n(6376),i=n(6902);e.exports=(e,t,n)=>{let o=null,s=null,a=null;try{a=new i(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&-1!==s.compare(e)||(o=e,s=new r(o,n)))})),o}},1657:(e,t,n)=>{const r=n(6376),i=n(6902);e.exports=(e,t,n)=>{let o=null,s=null,a=null;try{a=new i(t,n)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(o&&1!==s.compare(e)||(o=e,s=new r(o,n)))})),o}},5316:(e,t,n)=>{const r=n(6376),i=n(6902),o=n(1312);e.exports=(e,t)=>{e=new i(e,t);let n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t{const t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!o(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!s||n&&!o(n,s)||(n=s)}return n&&e.test(n)?n:null}},6826:(e,t,n)=>{const r=n(6376),i=n(2257),{ANY:o}=i,s=n(6902),a=n(5712),c=n(1312),u=n(1544),l=n(2056),p=n(5903);e.exports=(e,t,n,f)=>{let d,h,m,g,v;switch(e=new r(e,f),t=new s(t,f),n){case">":d=c,h=l,m=u,g=">",v=">=";break;case"<":d=u,h=p,m=c,g="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,f))return!1;for(let n=0;n{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,d(e.semver,s.semver,f)?s=e:m(e.semver,a.semver,f)&&(a=e)})),s.operator===g||s.operator===v)return!1;if((!a.operator||a.operator===g)&&h(e,a.semver))return!1;if(a.operator===v&&m(e,a.semver))return!1}return!0}},7908:(e,t,n)=>{const r=n(5712),i=n(6269);e.exports=(e,t,n)=>{const o=[];let s=null,a=null;const c=e.sort(((e,t)=>i(e,t,n)));for(const e of c){r(e,t,n)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null)}s&&o.push([s,null]);const u=[];for(const[e,t]of o)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return l.length{const r=n(6902),i=n(2257),{ANY:o}=i,s=n(5712),a=n(6269),c=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=n.includePrerelease?[new i(">=0.0.0-0")]:[new i(">=0.0.0")]}if(1===t.length&&t[0].semver===o){if(n.includePrerelease)return!0;t=[new i(">=0.0.0")]}const r=new Set;let c,p,f,d,h,m,g;for(const t of e)">"===t.operator||">="===t.operator?c=u(c,t,n):"<"===t.operator||"<="===t.operator?p=l(p,t,n):r.add(t.semver);if(r.size>1)return null;if(c&&p){if(f=a(c.semver,p.semver,n),f>0)return null;if(0===f&&(">="!==c.operator||"<="!==p.operator))return null}for(const e of r){if(c&&!s(e,String(c),n))return null;if(p&&!s(e,String(p),n))return null;for(const r of t)if(!s(e,String(r),n))return!1;return!0}let v=!(!p||n.includePrerelease||!p.semver.prerelease.length)&&p.semver,y=!(!c||n.includePrerelease||!c.semver.prerelease.length)&&c.semver;v&&1===v.prerelease.length&&"<"===p.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(d=u(c,e,n),d===e&&d!==c)return!1}else if(">="===c.operator&&!s(c.semver,String(e),n))return!1;if(p)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(h=l(p,e,n),h===e&&h!==p)return!1}else if("<="===p.operator&&!s(p.semver,String(e),n))return!1;if(!e.operator&&(p||c)&&0!==f)return!1}return!(c&&m&&!p&&0!==f)&&(!(p&&g&&!c&&0!==f)&&(!y&&!v))},u=(e,t,n)=>{if(!e)return t;const r=a(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,n)=>{if(!e)return t;const r=a(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,n={})=>{if(e===t)return!0;e=new r(e,n),t=new r(t,n);let i=!1;e:for(const r of e.set){for(const e of t.set){const t=c(r,e,n);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},1042:(e,t,n)=>{const r=n(6902);e.exports=(e,t)=>new r(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},9042:(e,t,n)=>{const r=n(6902);e.exports=(e,t)=>{try{return new r(e,t).range||"*"}catch(e){return null}}},6372:e=>{"use strict";function t(e){return"function"==typeof e}var n=console.error.bind(console);function r(e,t,n){var r=!!e[t]&&e.propertyIsEnumerable(t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}function i(e){e&&e.logger&&(t(e.logger)?n=e.logger:n("new logger isn't a function, not replacing"))}function o(e,i,o){if(e&&e[i]){if(!o)return n("no wrapper function"),void n((new Error).stack);if(t(e[i])&&t(o)){var s=e[i],a=o(s,i);return r(a,"__original",s),r(a,"__unwrap",(function(){e[i]===a&&r(e,i,s)})),r(a,"__wrapped",!0),r(e,i,a),a}n("original object and wrapper must be functions")}else n("no original function "+i+" to wrap")}function s(e,t){return e&&e[t]?e[t].__unwrap?e[t].__unwrap():void n("no original to unwrap to -- has "+t+" already been unwrapped?"):(n("no function to unwrap."),void n((new Error).stack))}i.wrap=o,i.massWrap=function(e,t,r){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){o(e,t,r)}))})):n("must provide one or more functions to wrap on modules")},i.unwrap=s,i.massUnwrap=function(e,t){if(!e)return n("must provide one or more modules to patch"),void n((new Error).stack);Array.isArray(e)||(e=[e]),t&&Array.isArray(t)?e.forEach((function(e){t.forEach((function(t){s(e,t)}))})):n("must provide one or more functions to unwrap on modules")},e.exports=i},465:e=>{e.exports=function(e,t){var n=[];n.push(function(e){try{return Error.prototype.toString.call(e)}catch(e){try{return""}catch(e){return""}}}(e));for(var r=0;r"}catch(e){i=""}}n.push(" at "+i)}return n.join("\n")}},2512:(e,t,n)=>{if(global._stackChain){if(global._stackChain.version!==n(9414).i8)throw new Error("Conflicting version of stack-chain found");e.exports=global._stackChain}else e.exports=global._stackChain=n(7898)},9414:e=>{"use strict";e.exports={i8:"1.3.7"}},7898:(e,t,n)=>{var r=n(465);function i(){this.extend=new a,this.filter=new a,this.format=new c,this.version=n(9414).i8}var o=!1;i.prototype.callSite=function e(t){t||(t={}),o=!0;var n={};Error.captureStackTrace(n,e);var r=n.stack;return o=!1,r=r.slice(t.slice||0),t.extend&&(r=this.extend._modify(n,r)),t.filter&&(r=this.filter._modify(n,r)),r};var s=new i;function a(){this._modifiers=[]}function c(){this._formater=r,this._previous=void 0}a.prototype._modify=function(e,t){for(var n=0,r=this._modifiers.length;n{"use strict";const r=n(2087),i=n(3867),o=n(6560),{env:s}=process;let a;function c(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function u(e,t){if(0===a)return 0;if(o("color=16m")||o("color=full")||o("color=truecolor"))return 3;if(o("color=256"))return 2;if(e&&!t&&void 0===a)return 0;const n=a||0;if("dumb"===s.TERM)return n;if("win32"===process.platform){const e=r.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in s)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in s))||"codeship"===s.CI_NAME?1:n;if("TEAMCITY_VERSION"in s)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0;if("truecolor"===s.COLORTERM)return 3;if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(s.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)||"COLORTERM"in s?1:n}o("no-color")||o("no-colors")||o("color=false")||o("color=never")?a=0:(o("color")||o("colors")||o("color=true")||o("color=always"))&&(a=1),"FORCE_COLOR"in s&&(a="true"===s.FORCE_COLOR?1:"false"===s.FORCE_COLOR?0:0===s.FORCE_COLOR.length?1:Math.min(parseInt(s.FORCE_COLOR,10),3)),e.exports={supportsColor:function(e){return c(u(e,e&&e.isTTY))},stdout:c(u(!0,i.isatty(1))),stderr:c(u(!0,i.isatty(2)))}},7250:(e,t,n)=>{"use strict";const r=n(3129).exec,i=n(3129).execSync,o=n(1453);let s=process.platform;const a="linux"===s,c="darwin"===s,u="win32"===s,l="freebsd"===s,p="openbsd"===s,f="netbsd"===s,d="sunos"===s;function h(e,t,n){let r="";return e.indexOf("speak")>=0&&(r="Speaker"),e.indexOf("laut")>=0&&(r="Speaker"),e.indexOf("loud")>=0&&(r="Speaker"),e.indexOf("head")>=0&&(r="Headset"),e.indexOf("mic")>=0&&(r="Microphone"),e.indexOf("mikr")>=0&&(r="Microphone"),e.indexOf("phone")>=0&&(r="Phone"),e.indexOf("controll")>=0&&(r="Controller"),e.indexOf("line o")>=0&&(r="Line Out"),e.indexOf("digital o")>=0&&(r="Digital Out"),!r&&n?r="Speaker":!r&&t&&(r="Microphone"),r}function m(e,t){const n={},r=o.getValue(e,"Slot"),i=t.filter((function(e){return e.slotId===r}));return n.id=r,n.name=o.getValue(e,"SDevice"),n.manufacturer=o.getValue(e,"SVendor"),n.revision=o.getValue(e,"Rev"),n.driver=i&&1===i.length&&i[0].driver?i[0].driver:"",n.default=null,n.channel="PCIe",n.type=h(n.name,null,null),n.in=null,n.out=null,n.status="online",n}function g(e,t){const n={},r=((e.coreaudio_device_transport||"")+" "+(e._name||"")).toLowerCase();return n.id=t,n.name=e._name,n.manufacturer=e.coreaudio_device_manufacturer,n.revision=null,n.driver=null,n.default=!!e.coreaudio_default_audio_input_device||!!e.coreaudio_default_audio_output_device,n.channel=function(e){let t="";return e.indexOf("builtin")>=0&&(t="Built-In"),e.indexOf("extern")>=0&&(t="Audio-Jack"),e.indexOf("hdmi")>=0&&(t="HDMI"),e.indexOf("displayport")>=0&&(t="Display-Port"),e.indexOf("usb")>=0&&(t="USB"),e.indexOf("pci")>=0&&(t="PCIe"),t}(r),n.type=h(n.name,!!e.coreaudio_device_input,!!e.coreaudio_device_output),n.in=!!e.coreaudio_device_input,n.out=!!e.coreaudio_device_output,n.status="online",n}function v(e){const t={},n=o.getValue(e,"StatusInfo","=");return t.id=o.getValue(e,"DeviceID","="),t.name=o.getValue(e,"name","="),t.manufacturer=o.getValue(e,"manufacturer","="),t.revision=null,t.driver=null,t.default=null,t.channel=null,t.type=h(t.name,null,null),t.in=null,t.out=null,t.status=n,t}t.audio=function(e){return new Promise((t=>{process.nextTick((()=>{let n=[];if(a||l||p||f){r("lspci -vmm 2>/dev/null",(function(r,s){if(!r){const e=function(){let e=[];try{const t=i("lspci -v 2>/dev/null").toString().split("\n\n");for(let n=0;n=0){const t={};t.slotId=r[0].split(" ")[0],t.driver=o.getValue(r,"Kernel driver in use",":",!0)||o.getValue(r,"Kernel modules",":",!0),e.push(t)}}return e}catch(t){return e}}(),t=s.toString().split("\n\n");for(let r=0;r=0){const t=m(i,e);n.push(t)}}}e&&e(n),t(n)}))}if(c){r("system_profiler SPAudioDataType -json",(function(r,i){if(!r)try{const e=JSON.parse(i.toString());if(e.SPAudioDataType&&e.SPAudioDataType.length&&e.SPAudioDataType[0]&&e.SPAudioDataType[0]._items&&e.SPAudioDataType[0]._items.length)for(let t=0;t{"use strict";const r=n(3129).exec,i=n(5747),o=n(1453);let s=process.platform;const a="linux"===s,c="darwin"===s,u="win32"===s,l="freebsd"===s,p="openbsd"===s,f="netbsd"===s,d="sunos"===s;e.exports=function(e){return new Promise((t=>{process.nextTick((()=>{let n={hasBattery:!1,cycleCount:0,isCharging:!1,designedCapacity:0,maxCapacity:0,currentCapacity:0,voltage:0,capacityUnit:"",percent:0,timeRemaining:null,acConnected:!0,type:"",model:"",manufacturer:"",serial:""};if(a){let r="";i.existsSync("/sys/class/power_supply/BAT1/uevent")?r="/sys/class/power_supply/BAT1/":i.existsSync("/sys/class/power_supply/BAT0/uevent")&&(r="/sys/class/power_supply/BAT0/"),r?i.readFile(r+"uevent",(function(r,i){if(r)e&&e(n),t(n);else{let r=i.toString().split("\n");n.isCharging="charging"===o.getValue(r,"POWER_SUPPLY_STATUS","=").toLowerCase(),n.acConnected=n.isCharging,n.voltage=parseInt("0"+o.getValue(r,"POWER_SUPPLY_VOLTAGE_NOW","="),10)/1e6,n.capacityUnit=n.voltage?"mWh":"mAh",n.cycleCount=parseInt("0"+o.getValue(r,"POWER_SUPPLY_CYCLE_COUNT","="),10),n.maxCapacity=Math.round(parseInt("0"+o.getValue(r,"POWER_SUPPLY_CHARGE_FULL","="),10)/1e3/(n.voltage||1)),n.designedCapacity=Math.round(parseInt("0"+o.getValue(r,"POWER_SUPPLY_CHARGE_FULL_DESIGN","="),10)/1e3/(n.voltage||1))|n.maxcapacity,n.currentCapacity=Math.round(parseInt("0"+o.getValue(r,"POWER_SUPPLY_CHARGE_NOW","="),10)/1e3/(n.voltage||1)),n.maxCapacity||(n.maxCapacity=parseInt("0"+o.getValue(r,"POWER_SUPPLY_ENERGY_FULL","="),10)/1e3,n.designCapacity=parseInt("0"+o.getValue(r,"POWER_SUPPLY_ENERGY_FULL_DESIGN","="),10)/1e3|n.maxCapacity,n.currentCapacity=parseInt("0"+o.getValue(r,"POWER_SUPPLY_ENERGY_NOW","="),10)/1e3);const s=o.getValue(r,"POWER_SUPPLY_CAPACITY","="),a=parseInt("0"+o.getValue(r,"POWER_SUPPLY_ENERGY_NOW","="),10),c=parseInt("0"+o.getValue(r,"POWER_SUPPLY_POWER_NOW","="),10),u=parseInt("0"+o.getValue(r,"POWER_SUPPLY_CURRENT_NOW","="),10);n.percent=parseInt("0"+s,10),n.maxCapacity&&n.currentCapacity&&(n.hasBattery=!0,s||(n.percent=100*n.currentCapacity/n.maxCapacity)),n.isCharging&&(n.hasBattery=!0),a&&c?n.timeRemaining=Math.floor(a/c*60):u&&n.currentCapacity&&(n.timeRemaining=Math.floor(n.currentCapacity/u*60)),n.type=o.getValue(r,"POWER_SUPPLY_TECHNOLOGY","="),n.model=o.getValue(r,"POWER_SUPPLY_MODEL_NAME","="),n.manufacturer=o.getValue(r,"POWER_SUPPLY_MANUFACTURER","="),n.serial=o.getValue(r,"POWER_SUPPLY_SERIAL_NUMBER","="),e&&e(n),t(n)}})):(e&&e(n),t(n))}if((l||p||f)&&r("sysctl hw.acpi.battery hw.acpi.acline",(function(r,i){let s=i.toString().split("\n");const a=parseInt("0"+o.getValue(s,"hw.acpi.battery.units"),10),c=parseInt("0"+o.getValue(s,"hw.acpi.battery.life"),10);n.hasBattery=a>0,n.cycleCount=null,n.isCharging="1"!==o.getValue(s,"hw.acpi.acline"),n.acConnected=n.isCharging,n.maxCapacity=null,n.currentCapacity=null,n.capacityUnit="unknown",n.percent=a?c:null,e&&e(n),t(n)})),c&&r('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|BatterySerialNumber|TimeRemaining|Voltage"; pmset -g batt | grep %',(function(r,i){if(i){let e=i.toString().replace(/ +/g,"").replace(/"+/g,"").replace(/-/g,"").split("\n");n.cycleCount=parseInt("0"+o.getValue(e,"cyclecount","="),10),n.voltage=parseInt("0"+o.getValue(e,"voltage","="),10)/1e3,n.capacityUnit=n.voltage?"mWh":"mAh",n.maxCapacity=Math.round(parseInt("0"+o.getValue(e,"maxcapacity","="),10)*(n.voltage||1)),n.currentCapacity=Math.round(parseInt("0"+o.getValue(e,"currentcapacity","="),10)*(n.voltage||1)),n.designedCapacity=Math.round(parseInt("0"+o.getValue(e,"DesignCapacity","="),10)*(n.voltage||1)),n.manufacturer="Apple",n.serial=o.getValue(e,"BatterySerialNumber","=");let t=null;let r=o.getValue(e,"internal","Battery").split(";");if(r&&r[0]){let e=r[0].split("\t");e&&e[1]&&(t=parseFloat(e[1].trim().replace(/%/g,"")))}r&&r[1]?(n.isCharging="charging"===r[1].trim(),n.acConnected="discharging"!==r[1].trim()):(n.isCharging="yes"===o.getValue(e,"ischarging","=").toLowerCase(),n.acConnected=n.isCharging),n.maxCapacity&&n.currentCapacity&&(n.hasBattery=!0,n.type="Li-ion",n.percent=null!==t?t:Math.round(100*n.currentCapacity/n.maxCapacity),n.isCharging||(n.timeRemaining=parseInt("0"+o.getValue(e,"TimeRemaining","="),10)))}e&&e(n),t(n)})),d&&(e&&e(n),t(n)),u)try{o.wmic("Path Win32_Battery Get BatteryStatus, DesignCapacity, EstimatedChargeRemaining, DesignVoltage, FullChargeCapacity /value").then((r=>{if(r){let e=r.split("\r\n"),t=o.getValue(e,"BatteryStatus","=").trim();if(t&&"10"!=t){const r=parseInt(t);n.hasBattery=!0,n.maxCapacity=parseInt(o.getValue(e,"DesignCapacity","=")||0),n.designCapacity=parseInt(o.getValue(e,"DesignCapacity","=")||0),n.voltage=parseInt(o.getValue(e,"DesignVoltage","=")||0)/1e3,n.capacityUnit="mWh",n.percent=parseInt(o.getValue(e,"EstimatedChargeRemaining","=")||0),n.currentCapacity=parseInt(n.maxcapacity*n.percent/100),n.isCharging=r>=6&&r<=9||11===r||!(3===r)&&!(1===r)&&n.percent<100,n.acConnected=n.ischarging||2===r}}e&&e(n),t(n)}))}catch(r){e&&e(n),t(n)}}))}))}},7381:(e,t,n)=>{"use strict";const r=n(3129).exec,i=n(3129).execSync,o=n(5622),s=n(1453),a=n(5747);let c=process.platform;const u="linux"===c,l="darwin"===c,p="win32"===c,f="freebsd"===c,d="openbsd"===c,h="netbsd"===c,m="sunos"===c;function g(e){let t="";return e.indexOf("keyboard")>=0&&(t="Keyboard"),e.indexOf("mouse")>=0&&(t="Mouse"),e.indexOf("speaker")>=0&&(t="Speaker"),e.indexOf("headset")>=0&&(t="Headset"),e.indexOf("phone")>=0&&(t="Phone"),t}function v(e,t,n){const r={device:null};return r.name=s.getValue(e,"name","="),r.manufacturer=null,r.macDevice=t,r.macHost=n,r.batteryPercent=null,r.type=g(r.name.toLowerCase()),r.connected=!1,r}function y(e,t){const n={},r=((e.device_minorClassOfDevice_string||e.device_majorClassOfDevice_string||"")+(e.device_name||"")).toLowerCase();return n.device=e.device_services||"",n.name=e.device_name||"",n.manufacturer=e.device_manufacturer||"",n.macDevice=(e.device_addr||"").toLowerCase().replace(/-/g,":"),n.macHost=t,n.batteryPercent=e.device_batteryPercent||null,n.type=g(r),n.connected="attrib_Yes"===e.device_isconnected||!1,n}function _(e){const t={device:null};return t.name=s.getValue(e,"name","="),t.manufacturer=s.getValue(e,"manufacturer","="),t.macDevice=null,t.macHost=null,t.batteryPercent=null,t.type=g(t.name.toLowerCase()),t.connected=null,t}t.bluetoothDevices=function(e){return new Promise((t=>{process.nextTick((()=>{let n=[];if(u){const r=s.getFilesInPath("/var/lib/bluetooth/");for(let e=0;e=6?i[i.length-2]:null,c=i.length>=7?i[i.length-3]:null;if("info"===t){const t=a.readFileSync(r[e],{encoding:"utf8"}).split("\n");n.push(v(t,s,c))}}try{const e=i("hcitool con").toString().toLowerCase();for(let t=0;t10&&e.indexOf(n[t].macDevice.toLowerCase())>=0&&(n[t].connected=!0)}catch(e){s.noop()}e&&e(n),t(n)}if(l){r("system_profiler SPBluetoothDataType -json",(function(r,i){if(!r)try{const e=JSON.parse(i.toString());if(e.SPBluetoothDataType&&e.SPBluetoothDataType.length&&e.SPBluetoothDataType[0]&&e.SPBluetoothDataType[0].device_title&&e.SPBluetoothDataType[0].device_title.length){let t=null;e.SPBluetoothDataType[0].local_device_title&&e.SPBluetoothDataType[0].local_device_title.general_address&&(t=e.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g,":"));for(let r=0;r{"use strict";const r=n(2087),i=n(3129).exec,o=n(3129).execSync,s=n(5747),a=n(1453);let c=process.platform;const u="linux"===c,l="darwin"===c,p="win32"===c,f="freebsd"===c,d="openbsd"===c,h="netbsd"===c,m="sunos"===c;let g=0,v={user:0,nice:0,system:0,idle:0,irq:0,load:0,tick:0,ms:0,currentLoad:0,currentLoadUser:0,currentLoadSystem:0,currentLoadNice:0,currentLoadIdle:0,currentLoadIrq:0,rawCurrentLoad:0,rawCurrentLoadUser:0,rawCurrentLoadSystem:0,rawCurrentLoadNice:0,rawCurrentLoadIdle:0,rawCurrentLoadIrq:0},y=[],_=0;const E={8346:"1.8",8347:"1.9",8350:"2.0",8354:"2.2","8356|SE":"2.4",8356:"2.3",8360:"2.5",2372:"2.1",2373:"2.1",2374:"2.2",2376:"2.3",2377:"2.3",2378:"2.4",2379:"2.4",2380:"2.5",2381:"2.5",2382:"2.6",2384:"2.7",2386:"2.8",2387:"2.8",2389:"2.9",2393:"3.1",8374:"2.2",8376:"2.3",8378:"2.4",8379:"2.4",8380:"2.5",8381:"2.5",8382:"2.6",8384:"2.7",8386:"2.8",8387:"2.8",8389:"2.9",8393:"3.1","2419EE":"1.8","2423HE":"2.0","2425HE":"2.1",2427:"2.2",2431:"2.4",2435:"2.6","2439SE":"2.8","8425HE":"2.1",8431:"2.4",8435:"2.6","8439SE":"2.8",4122:"2.2",4130:"2.6","4162EE":"1.7","4164EE":"1.8","4170HE":"2.1","4174HE":"2.3","4176HE":"2.4",4180:"2.6",4184:"2.8","6124HE":"1.8","6128HE":"2.0","6132HE":"2.2",6128:"2.0",6134:"2.3",6136:"2.4",6140:"2.6","6164HE":"1.7","6166HE":"1.8",6168:"1.9",6172:"2.1",6174:"2.2",6176:"2.3","6176SE":"2.3","6180SE":"2.5",3250:"2.5",3260:"2.7",3280:"2.4",4226:"2.7",4228:"2.8",4230:"2.9",4234:"3.1",4238:"3.3",4240:"3.4",4256:"1.6",4274:"2.5",4276:"2.6",4280:"2.8",4284:"3.0",6204:"3.3",6212:"2.6",6220:"3.0",6234:"2.4",6238:"2.6","6262HE":"1.6",6272:"2.1",6274:"2.2",6276:"2.3",6278:"2.4","6282SE":"2.6","6284SE":"2.7",6308:"3.5",6320:"2.8",6328:"3.2","6338P":"2.3",6344:"2.6",6348:"2.8",6366:"1.8","6370P":"2.0",6376:"2.3",6378:"2.4",6380:"2.5",6386:"2.8","FX|4100":"3.6","FX|4120":"3.9","FX|4130":"3.8","FX|4150":"3.8","FX|4170":"4.2","FX|6100":"3.3","FX|6120":"3.6","FX|6130":"3.6","FX|6200":"3.8","FX|8100":"2.8","FX|8120":"3.1","FX|8140":"3.2","FX|8150":"3.6","FX|8170":"3.9","FX|4300":"3.8","FX|4320":"4.0","FX|4350":"4.2","FX|6300":"3.5","FX|6350":"3.9","FX|8300":"3.3","FX|8310":"3.4","FX|8320":"3.5","FX|8350":"4.0","FX|8370":"4.0","FX|9370":"4.4","FX|9590":"4.7","FX|8320E":"3.2","FX|8370E":"3.3",1200:"3.1","Pro 1200":"3.1","1300X":"3.5","Pro 1300":"3.5",1400:"3.2","1500X":"3.5","Pro 1500":"3.5",1600:"3.2","1600X":"3.6","Pro 1600":"3.2",1700:"3.0","Pro 1700":"3.0","1700X":"3.4","Pro 1700X":"3.4","1800X":"3.6","1900X":"3.8",1920:"3.2","1920X":"3.5","1950X":"3.4","200GE":"3.2","Pro 200GE":"3.2","220GE":"3.4","240GE":"3.5","3000G":"3.5","300GE":"3.4","3050GE":"3.4","2200G":"3.5","Pro 2200G":"3.5","2200GE":"3.2","Pro 2200GE":"3.2","2400G":"3.6","Pro 2400G":"3.6","2400GE":"3.2","Pro 2400GE":"3.2","Pro 200U":"2.3","300U":"2.4","2200U":"2.5","3200U":"2.6","2300U":"2.0","Pro 2300U":"2.0","2500U":"2.0","Pro 2500U":"2.2","2600H":"3.2","2700U":"2.0","Pro 2700U":"2.2","2800H":"3.3",7351:"2.4","7351P":"2.4",7401:"2.0","7401P":"2.0","7551P":"2.0",7551:"2.0",7251:"2.1",7261:"2.5",7281:"2.1",7301:"2.2",7371:"3.1",7451:"2.3",7501:"2.0",7571:"2.2",7601:"2.2",V1500B:"2.2",V1780B:"3.35",V1202B:"2.3",V1404I:"2.0",V1605B:"2.0",V1756B:"3.25",V1807B:"3.35",3101:"2.1",3151:"2.7",3201:"1.5",3251:"2.5",3255:"2.5",3301:"2.0",3351:"1.9",3401:"1.85",3451:"2.15","1200|AF":"3.1","2300X":"3.5","2500X":"3.6",2600:"3.4","2600E":"3.1","1600|AF":"3.2","2600X":"3.6",2700:"3.2","2700E":"2.8","Pro 2700":"3.2","2700X":"3.7","Pro 2700X":"3.6","2920X":"3.5","2950X":"3.5","2970WX":"3.0","2990WX":"3.0","Pro 300GE":"3.4","Pro 3125GE":"3.4","3150G":"3.5","Pro 3150G":"3.5","3150GE":"3.3","Pro 3150GE":"3.3","3200G":"3.6","Pro 3200G":"3.6","3200GE":"3.3","Pro 3200GE":"3.3","3350G":"3.6","Pro 3350G":"3.6","3350GE":"3.3","Pro 3350GE":"3.3","3400G":"3.7","Pro 3400G":"3.7","3400GE":"3.3","Pro 3400GE":"3.3","3300U":"2.1","PRO 3300U":"2.1","3450U":"2.1","3500U":"2.1","PRO 3500U":"2.1","3500C":"2.1","3550H":"2.1","3580U":"2.1","3700U":"2.3","PRO 3700U":"2.3","3700C":"2.3","3750H":"2.3","3780U":"2.3",3100:"3.6","3300X":"3.8",3500:"3.6","3500X":"3.6",3600:"3.6","Pro 3600":"3.6","3600X":"3.8","3600XT":"3.8","Pro 3700":"3.6","3700X":"3.6","3800X":"3.9","3800XT":"3.9",3900:"3.1","Pro 3900":"3.1","3900X":"3.8","3900XT":"3.8","3950X":"3.5","3960X":"3.8","3970X":"3.7","3990X":"2.9","3945WX":"4.0","3955WX":"3.9","3975WX":"3.5","3995WX":"2.7","4300GE":"3.5","Pro 4300GE":"3.5","4300G":"3.8","Pro 4300G":"3.8","4600GE":"3.3","Pro 4650GE":"3.3","4600G":"3.7","Pro 4650G":"3.7","4700GE":"3.1","Pro 4750GE":"3.1","4700G":"3.6","Pro 4750G":"3.6","4300U":"2.7","Pro 4450U":"2.5","4500U":"2.3","4600U":"2.1","PRO 4650U":"2.1","4600HS":"3.0","4600H":"3.0","4700U":"2.0","PRO 4750U":"1.7","4800U":"1.8","4800HS":"2.9","4800H":"2.9","4900HS":"3.0","4900H":"3.3","7232P":"3.1","7302P":"3.0","7402P":"2.8","7502P":"2.5","7702P":"2.0",7252:"3.1",7262:"3.2",7272:"2.9",7282:"2.8",7302:"3.0",7352:"2.3",7402:"2.8",7452:"2.35",7502:"2.5",7532:"2.4",7542:"2.9",7552:"2.2",7642:"2.3",7662:"2.0",7702:"2.0",7742:"2.25","7H12":"2.6","7F32":"3.7","7F52":"3.5","7F72":"3.2","5600X":"3.7","5800X":"3.8","5900X":"3.7","5950X":"3.4"},b={1:"Other",2:"Unknown",3:"Daughter Board",4:"ZIF Socket",5:"Replacement/Piggy Back",6:"None",7:"LIF Socket",8:"Slot 1",9:"Slot 2",10:"370 Pin Socket",11:"Slot A",12:"Slot M",13:"423",14:"A (Socket 462)",15:"478",16:"754",17:"940",18:"939",19:"mPGA604",20:"LGA771",21:"LGA775",22:"S1",23:"AM2",24:"F (1207)",25:"LGA1366",26:"G34",27:"AM3",28:"C32",29:"LGA1156",30:"LGA1567",31:"PGA988A",32:"BGA1288",33:"rPGA988B",34:"BGA1023",35:"BGA1224",36:"LGA1155",37:"LGA1356",38:"LGA2011",39:"FS1",40:"FS2",41:"FM1",42:"FM2",43:"LGA2011-3",44:"LGA1356-3",45:"LGA1150",46:"BGA1168",47:"BGA1234",48:"BGA1364",49:"AM4",50:"LGA1151",51:"BGA1356",52:"BGA1440",53:"BGA1515",54:"LGA3647-1",55:"SP3",56:"SP3r2",57:"LGA2066",58:"BGA1392",59:"BGA1510",60:"BGA1528",61:"LGA4189",62:"LGA1200"};function w(e){e.brand=e.brand.replace(/\(R\)+/g,"®").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/\(TM\)+/g,"™").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/\(C\)+/g,"©").replace(/\s+/g," ").trim(),e.brand=e.brand.replace(/CPU+/g,"").replace(/\s+/g," ").trim(),e.manufacturer=e.brand.split(" ")[0];let t=e.brand.split(" ");return t.shift(),e.brand=t.join(" "),e}function S(e){let t="0";for(let n in E)if({}.hasOwnProperty.call(E,n)){let r=n.split("|"),i=0;r.forEach((t=>{e.indexOf(t)>-1&&i++})),i===r.length&&(t=E[n])}return parseFloat(t)}function I(){let e=r.cpus(),t=999999999,n=0,i=0,o=[];if(e&&e.length){for(let r in e)if({}.hasOwnProperty.call(e,r)){let s=e[r].speed>100?(e[r].speed+1)/1e3:e[r].speed/10;i+=s,s>n&&(n=s),s{process.nextTick((()=>{let n="";if(p)try{i('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet',a.execOptsWin,(function(r,i){if(!r){let e=i.split("0x").pop().trim(),t=parseInt(e,16).toString(2),r="0".repeat(32-t.length)+t,o=["fpu","vme","de","pse","tsc","msr","pae","mce","cx8","apic","","sep","mtrr","pge","mca","cmov","pat","pse-36","psn","clfsh","","ds","acpi","mmx","fxsr","sse","sse2","ss","htt","tm","ia64","pbe"];for(let e=0;e/dev/null; unset LC_ALL",(function(r,i){let o=[];if(!r){let e=i.toString().split("\tFlags:");(e.length>1?e[1].split("\tVersion:")[0].split["\n"]:[]).forEach((function(e){let t=(e.indexOf("(")?e.split("(")[0].toLowerCase():"").trim().replace(/\t/g,"");t&&o.push(t)}))}n=o.join(" ").trim().toLowerCase(),e&&e(n),t(n)})),l&&i("sysctl machdep.cpu.features",(function(r,i){if(!r){let e=i.toString().split("\n");e.length>0&&-1!==e[0].indexOf("machdep.cpu.features:")&&(n=e[0].split(":")[1].trim().toLowerCase())}e&&e(n),t(n)})),m&&(e&&e(n),t(n))}))}))}function x(e){return new Promise((t=>{process.nextTick((()=>{let n={l1d:null,l1i:null,l2:null,l3:null};if(u)try{i("export LC_ALL=C; lscpu; unset LC_ALL",(function(r,i){if(!r){i.toString().split("\n").forEach((function(e){let t=e.split(":");-1!==t[0].toUpperCase().indexOf("L1D CACHE")&&(n.l1d=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L1I CACHE")&&(n.l1i=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L2 CACHE")&&(n.l2=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toUpperCase().indexOf("L3 CACHE")&&(n.l3=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1))}))}e&&e(n),t(n)}))}catch(r){e&&e(n),t(n)}if((f||d||h)&&i("export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL",(function(r,i){let o=[];if(!r){o=i.toString().split("Cache Information"),o.shift()}for(let e=0;e1?i[1]:"kb";s*="kb"===c?1024:"mb"===c?1048576:"gb"===c?1073741824:1,r&&("l1"===r?(n.cache[r+"d"]=s/2,n.cache[r+"i"]=s/2):n.cache[r]=s)}e&&e(n),t(n)})),l&&i("sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize",(function(r,i){if(!r){i.toString().split("\n").forEach((function(e){let t=e.split(":");-1!==t[0].toLowerCase().indexOf("hw.l1icachesize")&&(n.l1d=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l1dcachesize")&&(n.l1i=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l2cachesize")&&(n.l2=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1)),-1!==t[0].toLowerCase().indexOf("hw.l3cachesize")&&(n.l3=parseInt(t[1].trim())*(-1!==t[1].indexOf("K")?1024:1))}))}e&&e(n),t(n)})),m&&(e&&e(n),t(n)),p)try{a.wmic("cpu get l2cachesize, l3cachesize /value").then(((r,i)=>{if(!i){let e=r.split("\r\n");n.l1d=0,n.l1i=0,n.l2=a.getValue(e,"l2cachesize","="),n.l3=a.getValue(e,"l3cachesize","="),n.l2&&(n.l2=1024*parseInt(n.l2,10)),n.l3&&(n.l3=1024*parseInt(n.l3,10))}a.wmic("path Win32_CacheMemory get CacheType,InstalledSize,Purpose").then(((r,i)=>{if(!i){r.split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)).forEach((function(e){""!==e&&("L1 Cache"===(e=e.trim().split(/\s\s+/))[2]&&"3"===e[0]&&(n.l1i=parseInt(e[1],10)),"L1 Cache"===e[2]&&"4"===e[0]&&(n.l1d=parseInt(e[1],10)))}))}e&&e(n),t(n)}))}))}catch(r){e&&e(n),t(n)}}))}))}t.cpu=function(e){return new Promise((t=>{process.nextTick((()=>{new Promise((e=>{process.nextTick((()=>{const t="unknown";let n={manufacturer:t,brand:t,vendor:"",family:"",model:"",stepping:"",revision:"",voltage:"",speed:0,speedMin:0,speedMax:0,governor:"",cores:a.cores(),physicalCores:a.cores(),processors:1,socket:"",flags:"",virtualization:!1,cache:{}};C().then((t=>{if(n.flags=t,n.virtualization=t.indexOf("vmx")>-1||t.indexOf("svm")>-1,p)try{const e=o("systeminfo",a.execOptsWin).toString();n.virtualization=n.virtualization||-1!==e.indexOf("Virtualization Enabled In Firmware: Yes")||-1!==e.indexOf("Virtualisierung in Firmware aktiviert: Ja")||-1!==e.indexOf("Virtualisation activée dans le microprogramme : Qiu")}catch(e){a.noop()}if(l&&i("sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily",(function(t,i){let s=i.toString().split("\n");const c=a.getValue(s,"machdep.cpu.brand_string").split("@");n.brand=c[0].trim();const u=c[1]?c[1].trim():"0";n.speed=parseFloat(u.replace(/GHz+/g,""));let l=a.getValue(s,"hw.tbfrequency")/1e9;l=l<.1?100*l:l,n.speed=0===n.speed?l:n.speed,g=n.speed,n=w(n),n.speedMin=a.getValue(s,"hw.cpufrequency_min")?a.getValue(s,"hw.cpufrequency_min")/1e9:n.speed,n.speedMax=a.getValue(s,"hw.cpufrequency_max")?a.getValue(s,"hw.cpufrequency_max")/1e9:n.speed,n.vendor=a.getValue(s,"machdep.cpu.vendor")||"Apple",n.family=a.getValue(s,"machdep.cpu.family")||a.getValue(s,"hw.cpufamily"),n.model=a.getValue(s,"machdep.cpu.model"),n.stepping=a.getValue(s,"machdep.cpu.stepping")||a.getValue(s,"hw.cpusubfamily");const p=a.getValue(s,"hw.packages"),f=a.getValue(s,"hw.physicalcpu_max"),d=a.getValue(s,"hw.ncpu");if("arm64"===r.arch()){const e=o("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split("\n"),t=e.filter((e=>e.indexOf('"E"')>=0)).length,r=e.filter((e=>e.indexOf('"P"')>=0)).length;n.socket="SOC",n.efficiencyCores=t,n.performanceCores=r}p&&(n.processors=parseInt(p)||1),f&&d&&(n.cores=parseInt(d)||a.cores(),n.physicalCores=parseInt(f)||a.cores()),x().then((t=>{n.cache=t,e(n)}))})),u){let t="",o=[];r.cpus()[0]&&r.cpus()[0].model&&(t=r.cpus()[0].model),i('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL',(function(r,c){r||(o=c.toString().split("\n")),t=a.getValue(o,"model name")||t;const u=t.split("@");if(n.brand=u[0].trim(),n.speed=u[1]?parseFloat(u[1].trim()):0,0===n.speed&&(n.brand.indexOf("AMD")>-1||n.brand.toLowerCase().indexOf("ryzen")>-1)&&(n.speed=S(n.brand)),0===n.speed){const e=I();0!==e.avg&&(n.speed=e.avg)}g=n.speed,n.speedMin=Math.round(parseFloat(a.getValue(o,"cpu min mhz").replace(/,/g,"."))/10)/100,n.speedMax=Math.round(parseFloat(a.getValue(o,"cpu max mhz").replace(/,/g,"."))/10)/100,n=w(n),n.vendor=a.getValue(o,"vendor id"),n.family=a.getValue(o,"cpu family"),n.model=a.getValue(o,"model:"),n.stepping=a.getValue(o,"stepping"),n.revision=a.getValue(o,"cpu revision"),n.cache.l1d=a.getValue(o,"l1d cache"),n.cache.l1d&&(n.cache.l1d=parseInt(n.cache.l1d)*(-1!==n.cache.l1d.indexOf("K")?1024:1)),n.cache.l1i=a.getValue(o,"l1i cache"),n.cache.l1i&&(n.cache.l1i=parseInt(n.cache.l1i)*(-1!==n.cache.l1i.indexOf("K")?1024:1)),n.cache.l2=a.getValue(o,"l2 cache"),n.cache.l2&&(n.cache.l2=parseInt(n.cache.l2)*(-1!==n.cache.l2.indexOf("K")?1024:1)),n.cache.l3=a.getValue(o,"l3 cache"),n.cache.l3&&(n.cache.l3=parseInt(n.cache.l3)*(-1!==n.cache.l3.indexOf("K")?1024:1));const l=a.getValue(o,"thread(s) per core")||"1",p=a.getValue(o,"socket(s)")||"1";let f=parseInt(l,10),d=parseInt(p,10);if(n.physicalCores=n.cores/f,n.processors=d,n.governor=a.getValue(o,"governor")||"","ARM"===n.vendor){const e=s.readFileSync("/proc/cpuinfo").toString().split("\n"),t=a.decodePiCpuinfo(e);t.model.toLowerCase().indexOf("raspberry")>=0&&(n.family=n.manufacturer,n.manufacturer=t.manufacturer,n.brand=t.processor,n.revision=t.revisionCode,n.socket="SOC")}let h=[];i('export LC_ALL=C; dmidecode –t 4 2>/dev/null | grep "Upgrade: Socket"; unset LC_ALL',(function(t,r){h=r.toString().split("\n"),h&&h.length&&(n.socket=a.getValue(h,"Upgrade").replace("Socket","").trim()||n.socket),e(n)}))}))}if(f||d||h){let t="",o=[];r.cpus()[0]&&r.cpus()[0].model&&(t=r.cpus()[0].model),i("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL",(function(r,i){let s=[];if(!r){const e=i.toString().split("# dmidecode"),t=e.length>1?e[1]:"";s=e.length>2?e[2].split("Cache Information"):[],o=t.split("\n")}if(n.brand=t.split("@")[0].trim(),n.speed=t.split("@")[1]?parseFloat(t.split("@")[1].trim()):0,0===n.speed&&(n.brand.indexOf("AMD")>-1||n.brand.toLowerCase().indexOf("ryzen")>-1)&&(n.speed=S(n.brand)),0===n.speed){const e=I();0!==e.avg&&(n.speed=e.avg)}g=n.speed,n.speedMin=n.speed,n.speedMax=Math.round(parseFloat(a.getValue(o,"max speed").replace(/Mhz/g,""))/10)/100,n=w(n),n.vendor=a.getValue(o,"manufacturer");let c=a.getValue(o,"signature");c=c.split(",");for(var u=0;u1?r[1]:"kb";i*="kb"===c?1024:"mb"===c?1048576:"gb"===c?1073741824:1,t&&("l1"===t?(n.cache[t+"d"]=i/2,n.cache[t+"i"]=i/2):n.cache[t]=i)}n.socket=a.getValue(o,"Upgrade").replace("Socket","").trim();const p=a.getValue(o,"thread count").trim(),f=a.getValue(o,"core count").trim();f&&p&&(n.cores=p,n.physicalCores=f),e(n)}))}if(m&&e(n),p)try{const t=[];t.push(a.wmic("cpu get /value")),t.push(a.wmic("path Win32_CacheMemory get CacheType,InstalledSize,Purpose")),Promise.all(t).then((t=>{let r=t[0].split("\r\n"),i=a.getValue(r,"name","=")||"";i.indexOf("@")>=0?(n.brand=i.split("@")[0].trim(),n.speed=i.split("@")[1]?parseFloat(i.split("@")[1].trim()):0,g=n.speed):(n.brand=i.trim(),n.speed=0),n=w(n),n.revision=a.getValue(r,"revision","="),n.cache.l1d=0,n.cache.l1i=0,n.cache.l2=a.getValue(r,"l2cachesize","="),n.cache.l3=a.getValue(r,"l3cachesize","="),n.cache.l2&&(n.cache.l2=1024*parseInt(n.cache.l2,10)),n.cache.l3&&(n.cache.l3=1024*parseInt(n.cache.l3,10)),n.vendor=a.getValue(r,"manufacturer","="),n.speedMax=Math.round(parseFloat(a.getValue(r,"maxclockspeed","=").replace(/,/g,"."))/10)/100,0===n.speed&&(n.brand.indexOf("AMD")>-1||n.brand.toLowerCase().indexOf("ryzen")>-1)&&(n.speed=S(n.brand)),0===n.speed&&(n.speed=n.speedMax),n.speedMin=n.speed;let o=a.getValue(r,"description","=").split(" ");for(let e=0;e1&&(n.cores=n.cores*c,n.physicalCores=n.physicalCores*c),r=t[1].split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)),r.forEach((function(e){""!==e&&("L1 Cache"===(e=e.trim().split(/\s\s+/))[2]&&"3"===e[0]&&(n.cache.l1i=parseInt(e[1],10)),"L1 Cache"===e[2]&&"4"===e[0]&&(n.cache.l1d=parseInt(e[1],10)))})),e(n)}))}catch(t){e(n)}}))}))})).then((n=>{e&&e(n),t(n)}))}))}))},t.cpuCurrentSpeed=function(e){return new Promise((t=>{process.nextTick((()=>{let n=I();if(0===n.avg&&0!==g){const e=parseFloat(g);n={min:e,max:e,avg:e,cores:[]}}e&&e(n),t(n)}))}))},t.cpuTemperature=function(e){return new Promise((t=>{process.nextTick((()=>{let r={main:null,cores:[],max:null,socket:[],chipset:null};if(u){try{const e=o('cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;').toString().split("-----\n");if(2===e.length){const t=e[0].split("\n"),n=e[1].split("\n");for(let e=0;e{const t=e.split("___"),n=t[0],i=t.length>1&&t[1]?t[1]:"0";i&&(void 0===n||n&&n.toLowerCase().startsWith("core"))?r.cores.push(Math.round(parseInt(i,10)/100)/10):i&&n&&null===r.main&&(r.main=Math.round(parseInt(i,10)/100)/10)})),r.cores.length>0){null===r.main&&(r.main=Math.round(r.cores.reduce(((e,t)=>e+t),0)/r.cores.length));let e=Math.max.apply(Math,r.cores);r.max=e>r.main?e:r.main}if(null!==r.main)return null===r.max&&(r.max=r.main),e&&e(r),void t(r);i("sensors",(function(n,o){if(!n){let n=o.toString().split("\n"),i=null,s=!0,a="";if(n.forEach((function(e){""===e.trim()?s=!0:s&&(e.trim().toLowerCase().startsWith("acpi")&&(a="acpi"),e.trim().toLowerCase().startsWith("pch")&&(a="pch"),e.trim().toLowerCase().startsWith("core")&&(a="core"),s=!1);let t=e.match(/[+-]([^°]*)/g),n=e.split(":")[0].toUpperCase();"acpi"===a?-1!==n.indexOf("TEMP")&&r.socket.push(parseFloat(t)):"pch"===a&&-1!==n.indexOf("TEMP")&&(r.chipset=parseFloat(t)),-1===n.indexOf("PHYSICAL")&&-1===n.indexOf("PACKAGE")||(r.main=parseFloat(t)),-1!==n.indexOf("CORE ")&&r.cores.push(parseFloat(t)),-1!==n.indexOf("TDIE")&&null===i&&(i=parseFloat(t))})),r.cores.length>0){null===r.main&&(r.main=Math.round(r.cores.reduce(((e,t)=>e+t),0)/r.cores.length));let e=Math.max.apply(Math,r.cores);r.max=e>r.main?e:r.main}else null===r.main&&null!==i&&(r.main=i,r.max=i);if(null!==r.main||null!==r.max)return e&&e(r),void t(r)}s.stat("/sys/class/thermal/thermal_zone0/temp",(function(n){null===n?s.readFile("/sys/class/thermal/thermal_zone0/temp",(function(n,i){if(!n){let e=i.toString().split("\n");e.length>0&&(r.main=parseFloat(e[0])/1e3,r.max=r.main)}e&&e(r),t(r)})):i("/opt/vc/bin/vcgencmd measure_temp",(function(n,i){if(!n){let e=i.toString().split("\n");e.length>0&&e[0].indexOf("=")&&(r.main=parseFloat(e[0].split("=")[1]),r.max=r.main)}e&&e(r),t(r)}))}))}))}))}catch(n){e&&e(r),t(r)}}if((f||d||h)&&i("sysctl dev.cpu | grep temp",(function(n,i){if(!n){let e=i.toString().split("\n"),t=0;e.forEach((function(e){const n=e.split(":");if(n.length>1){const e=parseFloat(n[1].replace(",","."));e>r.max&&(r.max=e),t+=e,r.cores.push(e)}})),r.cores.length&&(r.main=Math.round(t/r.cores.length*100)/100)}e&&e(r),t(r)})),l){let i=null;try{i=n(Object(function(){var e=new Error("Cannot find module 'osx-temperature-sensor'");throw e.code="MODULE_NOT_FOUND",e}()))}catch(e){i=null}i&&(r=i.cpuTemperature()),e&&e(r),t(r)}if(m&&(e&&e(r),t(r)),p)try{a.wmic("/namespace:\\\\root\\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature").then(((n,i)=>{if(!i){let e=0;n.split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)).forEach((function(t){let n=(parseInt(t,10)-2732)/10;e+=n,n>r.max&&(r.max=n),r.cores.push(n)})),r.cores.length&&(r.main=e/r.cores.length)}e&&e(r),t(r)}))}catch(n){e&&e(r),t(r)}}))}))},t.cpuFlags=C,t.cpuCache=x,t.currentLoad=function(e){return new Promise((t=>{process.nextTick((()=>{new Promise((e=>{process.nextTick((()=>{let t=r.loadavg().map((function(e){return e/a.cores()})),n=parseFloat(Math.max.apply(Math,t).toFixed(2)),i={};if(Date.now()-v.ms>=200){v.ms=Date.now();const e=r.cpus();let t=0,o=0,s=0,a=0,c=0,u=[];_=e&&e.length?e.length:0;for(let n=0;n<_;n++){const r=e[n].times;t+=r.user,o+=r.sys,s+=r.nice,c+=r.idle,a+=r.irq;let i=y&&y[n]&&y[n].totalTick?y[n].totalTick:0,l=y&&y[n]&&y[n].totalLoad?y[n].totalLoad:0,p=y&&y[n]&&y[n].user?y[n].user:0,f=y&&y[n]&&y[n].sys?y[n].sys:0,d=y&&y[n]&&y[n].nice?y[n].nice:0,h=y&&y[n]&&y[n].idle?y[n].idle:0,m=y&&y[n]&&y[n].irq?y[n].irq:0;y[n]=r,y[n].totalTick=y[n].user+y[n].sys+y[n].nice+y[n].irq+y[n].idle,y[n].totalLoad=y[n].user+y[n].sys+y[n].nice+y[n].irq,y[n].currentTick=y[n].totalTick-i,y[n].load=y[n].totalLoad-l,y[n].loadUser=y[n].user-p,y[n].loadSystem=y[n].sys-f,y[n].loadNice=y[n].nice-d,y[n].loadIdle=y[n].idle-h,y[n].loadIrq=y[n].irq-m,u[n]={},u[n].load=y[n].load/y[n].currentTick*100,u[n].loadUser=y[n].loadUser/y[n].currentTick*100,u[n].loadSystem=y[n].loadSystem/y[n].currentTick*100,u[n].loadNice=y[n].loadNice/y[n].currentTick*100,u[n].loadIdle=y[n].loadIdle/y[n].currentTick*100,u[n].loadIrq=y[n].loadIrq/y[n].currentTick*100,u[n].rawLoad=y[n].load,u[n].rawLoadUser=y[n].loadUser,u[n].rawLoadSystem=y[n].loadSystem,u[n].rawLoadNice=y[n].loadNice,u[n].rawLoadIdle=y[n].loadIdle,u[n].rawLoadIrq=y[n].loadIrq}let l=t+o+s+a+c,p=t+o+s+a,f=l-v.tick;i={avgLoad:n,currentLoad:(p-v.load)/f*100,currentLoadUser:(t-v.user)/f*100,currentLoadSystem:(o-v.system)/f*100,currentLoadNice:(s-v.nice)/f*100,currentLoadIdle:(c-v.idle)/f*100,currentLoadIrq:(a-v.irq)/f*100,rawCurrentLoad:p-v.load,rawCurrentLoadUser:t-v.user,rawCurrentLoadSystem:o-v.system,rawCurrentLoadNice:s-v.nice,rawCurrentLoadIdle:c-v.idle,rawCurrentLoadIrq:a-v.irq,cpus:u},v={user:t,nice:s,system:o,idle:c,irq:a,tick:l,load:p,ms:v.ms,currentLoad:i.currentLoad,currentLoadUser:i.currentLoadUser,currentLoadSystem:i.currentLoadSystem,currentLoadNice:i.currentLoadNice,currentLoadIdle:i.currentLoadIdle,currentLoadIrq:i.currentLoadIrq,rawCurrentLoad:i.rawCurrentLoad,rawCurrentLoadUser:i.rawCurrentLoadUser,rawCurrentLoadSystem:i.rawCurrentLoadSystem,rawCurrentLoadNice:i.rawCurrentLoadNice,rawCurrentLoadIdle:i.rawCurrentLoadIdle,rawCurrentLoadIrq:i.rawCurrentLoadIrq}}else{let e=[];for(let t=0;t<_;t++)e[t]={},e[t].load=y[t].load/y[t].currentTick*100,e[t].loadUser=y[t].loadUser/y[t].currentTick*100,e[t].loadSystem=y[t].loadSystem/y[t].currentTick*100,e[t].loadNice=y[t].loadNice/y[t].currentTick*100,e[t].loadIdle=y[t].loadIdle/y[t].currentTick*100,e[t].loadIrq=y[t].loadIrq/y[t].currentTick*100,e[t].rawLoad=y[t].load,e[t].rawLoadUser=y[t].loadUser,e[t].rawLoadSystem=y[t].loadSystem,e[t].rawLoadNice=y[t].loadNice,e[t].rawLoadIdle=y[t].loadIdle,e[t].rawLoadIrq=y[t].loadIrq;i={avgLoad:n,currentload:v.currentload,currentloadUser:v.currentloadUser,currentloadSystem:v.currentloadSystem,currentloadNice:v.currentloadNice,currentloadIdle:v.currentloadIdle,currentloadIrq:v.currentloadIrq,rawCurrentload:v.rawCurrentload,rawCurrentloadUser:v.rawCurrentloadUser,rawCurrentloadSystem:v.rawCurrentloadSystem,rawCurrentloadNice:v.rawCurrentloadNice,rawCurrentloadIdle:v.rawCurrentloadIdle,rawCurrentloadIrq:v.rawCurrentloadIrq,cpus:e}}e(i)}))})).then((n=>{e&&e(n),t(n)}))}))}))},t.fullLoad=function(e){return new Promise((t=>{process.nextTick((()=>{new Promise((e=>{process.nextTick((()=>{const t=r.cpus();let n=0,i=0,o=0,s=0,a=0,c=0;if(t&&t.length){for(let e=0,r=t.length;e{e&&e(n),t(n)}))}))}))}},8725:(e,t,n)=>{"use strict";const r=n(1453),i=n(3568);const o="win32"===process.platform;let s,a={},c=0;function u(e,t){function n(e,t){return e.filter((e=>e.Id&&e.Id===t)).length>0}r.isFunction(e)&&!t&&(t=e,e=!1),"string"==typeof e&&"true"===e&&(e=!0),"boolean"!=typeof e&&void 0!==e&&(e=!1),e=e||!1;let o=[];return new Promise((c=>{process.nextTick((()=>{s||(s=new i);const u=[];s.listContainers(e,(e=>{let l={};try{if(l=e,l&&"[object Array]"===Object.prototype.toString.call(l)&&l.length>0){for(let e in a)({}).hasOwnProperty.call(a,e)&&(n(l,e)||delete a[e]);l.forEach((function(e){var t,n;e.Names&&"[object Array]"===Object.prototype.toString.call(e.Names)&&e.Names.length>0&&(e.Name=e.Names[0].replace(/^\/|\/$/g,"")),u.push((t=e.Id.trim(),n=e,new Promise((e=>{process.nextTick((()=>{"string"!=typeof(t=t||"")&&e();const o=(r.isPrototypePolluted()?"":r.sanitizeShellString(t,!0)).trim();o?(s||(s=new i),s.getInspect(o.trim(),(t=>{try{e({id:n.Id,name:n.Name,image:n.Image,imageID:n.ImageID,command:n.Command,created:n.Created,started:t.State&&t.State.StartedAt?Math.round(new Date(t.State.StartedAt).getTime()/1e3):0,finished:t.State&&t.State.FinishedAt&&!t.State.FinishedAt.startsWith("0001-01-01")?Math.round(new Date(t.State.FinishedAt).getTime()/1e3):0,createdAt:t.Created?t.Created:"",startedAt:t.State&&t.State.StartedAt?t.State.StartedAt:"",finishedAt:t.State&&t.State.FinishedAt&&!t.State.FinishedAt.startsWith("0001-01-01")?t.State.FinishedAt:"",state:n.State,restartCount:t.RestartCount||0,platform:t.Platform||"",driver:t.Driver||"",ports:n.Ports,mounts:n.Mounts})}catch(t){e()}}))):e()}))}))))})),u.length?Promise.all(u).then((e=>{t&&t(e),c(e)})):(t&&t(o),c(o))}else t&&t(o),c(o)}catch(e){for(let e in a)({}).hasOwnProperty.call(a,e)&&(n(l,e)||delete a[e]);t&&t(o),c(o)}}))}))}))}function l(e,t){let n=[];return new Promise((i=>{process.nextTick((()=>{if(r.isFunction(e)&&!t)t=e,n=["*"];else{if("string"!=typeof(e=e||"*"))return t&&t([]),i([]);let o="";if(o.__proto__.toLowerCase=r.stringToLower,o.__proto__.replace=r.stringReplace,o.__proto__.trim=r.stringTrim,o=e,o=o.trim(),"*"!==o){o="";const t=(r.isPrototypePolluted()?"":r.sanitizeShellString(e,!0)).trim();for(let e=0;e<=r.mathMin(t.length,2e3);e++)if(void 0!==t[e]){t[e].__proto__.toLowerCase=r.stringToLower;const n=t[e].toLowerCase();n&&n[0]&&!n[1]&&(o+=n[0])}}o=o.trim().toLowerCase().replace(/,+/g,"|"),n=o.split("|")}const o=[],s=[];if(n.length&&"*"===n[0].trim())n=[],u().then((e=>{for(let t of e)n.push(t.id);n.length?l(n.join(",")).then((e=>{t&&t(e),i(e)})):(t&&t(o),i(o))}));else{for(let e of n)s.push(p(e.trim()));s.length?Promise.all(s).then((e=>{t&&t(e),i(e)})):(t&&t(o),i(o))}}))}))}function p(e){let t={id:e=e||"",memUsage:0,memLimit:0,memPercent:0,cpuPercent:0,pids:0,netIO:{rx:0,wx:0},blockIO:{r:0,w:0}};return new Promise((n=>{process.nextTick((()=>{e?(s||(s=new i),s.getInspect(e,(i=>{try{s.getStats(e,(e=>{try{let n=e;n.message||(t.memUsage=n.memory_stats&&n.memory_stats.usage?n.memory_stats.usage:0,t.memLimit=n.memory_stats&&n.memory_stats.limit?n.memory_stats.limit:0,t.memPercent=n.memory_stats&&n.memory_stats.usage&&n.memory_stats.limit?n.memory_stats.usage/n.memory_stats.limit*100:0,t.cpuPercent=n.cpu_stats&&n.precpu_stats?function(e,t){if(o){let n=r.nanoSeconds(),i=0;if(c>0){let r=n-c,o=e.cpu_usage.total_usage-t.cpu_usage.total_usage;r>0&&(i=100*o/r)}return c=n,i}{let n=0,r=e.cpu_usage.total_usage-t.cpu_usage.total_usage,i=e.system_cpu_usage-t.system_cpu_usage;return i>0&&r>0&&(n=r/i*e.cpu_usage.percpu_usage.length*100),n}}(n.cpu_stats,n.precpu_stats):0,t.pids=n.pids_stats&&n.pids_stats.current?n.pids_stats.current:0,t.restartCount=i.RestartCount?i.RestartCount:0,n.networks&&(t.netIO=function(e){let t,n;for(let r in e){if(!{}.hasOwnProperty.call(e,r))continue;let i=e[r];t=+i.rx_bytes,n=+i.tx_bytes}return{rx:t,wx:n}}(n.networks)),n.blkio_stats&&(t.blockIO=function(e){let t={r:0,w:0};return e&&e.io_service_bytes_recursive&&"[object Array]"===Object.prototype.toString.call(e.io_service_bytes_recursive)&&e.io_service_bytes_recursive.length>0&&e.io_service_bytes_recursive.forEach((function(e){e.op&&"read"===e.op.toLowerCase()&&e.value&&(t.r+=e.value),e.op&&"write"===e.op.toLowerCase()&&e.value&&(t.w+=e.value)})),t}(n.blkio_stats)),t.cpuStats=n.cpu_stats?n.cpu_stats:{},t.precpuStats=n.precpu_stats?n.precpu_stats:{},t.memoryStats=n.memory_stats?n.memory_stats:{},t.networks=n.networks?n.networks:{})}catch(e){r.noop()}n(t)}))}catch(e){r.noop()}}))):n(t)}))}))}function f(e,t){let n=[];return new Promise((o=>{process.nextTick((()=>{"string"!=typeof(e=e||"")&&o(n);const a=(r.isPrototypePolluted()?"":r.sanitizeShellString(e,!0)).trim();a?(s||(s=new i),s.getProcesses(a,(e=>{try{if(e&&e.Titles&&e.Processes){let t=e.Titles.map((function(e){return e.toUpperCase()})),r=t.indexOf("PID"),i=t.indexOf("PPID"),o=t.indexOf("PGID"),s=t.indexOf("VSZ"),a=t.indexOf("TIME"),c=t.indexOf("ELAPSED"),u=t.indexOf("NI"),l=t.indexOf("RUSER"),p=t.indexOf("USER"),f=t.indexOf("RGROUP"),d=t.indexOf("GROUP"),h=t.indexOf("STAT"),m=t.indexOf("RSS"),g=t.indexOf("COMMAND");e.Processes.forEach((e=>{n.push({pidHost:r>=0?e[r]:"",ppid:i>=0?e[i]:"",pgid:o>=0?e[o]:"",user:p>=0?e[p]:"",ruser:l>=0?e[l]:"",group:d>=0?e[d]:"",rgroup:f>=0?e[f]:"",stat:h>=0?e[h]:"",time:a>=0?e[a]:"",elapsed:c>=0?e[c]:"",nice:u>=0?e[u]:"",rss:m>=0?e[m]:"",vsz:s>=0?e[s]:"",command:g>=0?e[g]:""})}))}}catch(e){r.noop()}t&&t(n),o(n)}))):(t&&t(n),o(n))}))}))}t.dockerInfo=function(e){return new Promise((t=>{process.nextTick((()=>{s||(s=new i);const n={};s.getInfo((r=>{n.id=r.ID,n.containers=r.Containers,n.containersRunning=r.ContainersRunning,n.containersPaused=r.ContainersPaused,n.containersStopped=r.ContainersStopped,n.images=r.Images,n.driver=r.Driver,n.memoryLimit=r.MemoryLimit,n.swapLimit=r.SwapLimit,n.kernelMemory=r.KernelMemory,n.cpuCfsPeriod=r.CpuCfsPeriod,n.cpuCfsQuota=r.CpuCfsQuota,n.cpuShares=r.CPUShares,n.cpuSet=r.CPUSet,n.ipv4Forwarding=r.IPv4Forwarding,n.bridgeNfIptables=r.BridgeNfIptables,n.bridgeNfIp6tables=r.BridgeNfIp6tables,n.debug=r.Debug,n.nfd=r.NFd,n.oomKillDisable=r.OomKillDisable,n.ngoroutines=r.NGoroutines,n.systemTime=r.SystemTime,n.loggingDriver=r.LoggingDriver,n.cgroupDriver=r.CgroupDriver,n.nEventsListener=r.NEventsListener,n.kernelVersion=r.KernelVersion,n.operatingSystem=r.OperatingSystem,n.osType=r.OSType,n.architecture=r.Architecture,n.ncpu=r.NCPU,n.memTotal=r.MemTotal,n.dockerRootDir=r.DockerRootDir,n.httpProxy=r.HttpProxy,n.httpsProxy=r.HttpsProxy,n.noProxy=r.NoProxy,n.name=r.Name,n.labels=r.Labels,n.experimentalBuild=r.ExperimentalBuild,n.serverVersion=r.ServerVersion,n.clusterStore=r.ClusterStore,n.clusterAdvertise=r.ClusterAdvertise,n.defaultRuntime=r.DefaultRuntime,n.liveRestoreEnabled=r.LiveRestoreEnabled,n.isolation=r.Isolation,n.initBinary=r.InitBinary,n.productLicense=r.ProductLicense,e&&e(n),t(n)}))}))}))},t.dockerImages=function(e,t){r.isFunction(e)&&!t&&(t=e,e=!1),"string"==typeof e&&"true"===e&&(e=!0),"boolean"!=typeof e&&void 0!==e&&(e=!1),e=e||!1;let n=[];return new Promise((o=>{process.nextTick((()=>{s||(s=new i);const a=[];s.listImages(e,(e=>{let c={};try{c=e,c&&"[object Array]"===Object.prototype.toString.call(c)&&c.length>0?(c.forEach((function(e){var t,n;e.Names&&"[object Array]"===Object.prototype.toString.call(e.Names)&&e.Names.length>0&&(e.Name=e.Names[0].replace(/^\/|\/$/g,"")),a.push((t=e.Id.trim(),n=e,new Promise((e=>{process.nextTick((()=>{"string"!=typeof(t=t||"")&&e();const o=(r.isPrototypePolluted()?"":r.sanitizeShellString(t,!0)).trim();o?(s||(s=new i),s.inspectImage(o.trim(),(t=>{try{e({id:n.Id,container:t.Container,comment:t.Comment,os:t.Os,architecture:t.Architecture,parent:t.Parent,dockerVersion:t.DockerVersion,size:t.Size,sharedSize:n.SharedSize,virtualSize:t.VirtualSize,author:t.Author,created:t.Created?Math.round(new Date(t.Created).getTime()/1e3):0,containerConfig:t.ContainerConfig?t.ContainerConfig:{},graphDriver:t.GraphDriver?t.GraphDriver:{},repoDigests:t.RepoDigests?t.RepoDigests:{},repoTags:t.RepoTags?t.RepoTags:{},config:t.Config?t.Config:{},rootFS:t.RootFS?t.RootFS:{}})}catch(t){e()}}))):e()}))}))))})),a.length?Promise.all(a).then((e=>{t&&t(e),o(e)})):(t&&t(n),o(n))):(t&&t(n),o(n))}catch(e){t&&t(n),o(n)}}))}))}))},t.dockerContainers=u,t.dockerContainerStats=l,t.dockerContainerProcesses=f,t.dockerVolumes=function(e){let t=[];return new Promise((n=>{process.nextTick((()=>{s||(s=new i),s.listVolumes((r=>{let i={};try{i=r,i&&i.Volumes&&"[object Array]"===Object.prototype.toString.call(i.Volumes)&&i.Volumes.length>0?(i.Volumes.forEach((function(e){t.push({name:e.Name,driver:e.Driver,labels:e.Labels,mountpoint:e.Mountpoint,options:e.Options,scope:e.Scope,created:e.CreatedAt?Math.round(new Date(e.CreatedAt).getTime()/1e3):0})})),e&&e(t),n(t)):(e&&e(t),n(t))}catch(r){e&&e(t),n(t)}}))}))}))},t.dockerAll=function(e){return new Promise((t=>{process.nextTick((()=>{u(!0).then((n=>{if(n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0){let r=n.length;n.forEach((function(i){l(i.id).then((o=>{i.memUsage=o[0].memUsage,i.memLimit=o[0].memLimit,i.memPercent=o[0].memPercent,i.cpuPercent=o[0].cpuPercent,i.pids=o[0].pids,i.netIO=o[0].netIO,i.blockIO=o[0].blockIO,i.cpuStats=o[0].cpuStats,i.precpuStats=o[0].precpuStats,i.memoryStats=o[0].memoryStats,i.networks=o[0].networks,f(i.id).then((o=>{i.processes=o,r-=1,0===r&&(e&&e(n),t(n))}))}))}))}else e&&e(n),t(n)}))}))}))}},3568:(e,t,n)=>{"use strict";const r=n(1631),i="Windows_NT"===n(2087).type()?"//./pipe/docker_engine":"/var/run/docker.sock";e.exports=class{getInfo(e){try{let t,n=r.createConnection({path:i}),o="";n.on("connect",(()=>{n.write("GET http:/info HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{o+=e.toString()})),n.on("error",(()=>{n=!1,e({})})),n.on("end",(()=>{let r=o.indexOf("\r\n\r\n");o=o.substring(r+4),n=!1;try{t=JSON.parse(o),e(t)}catch(t){e({})}}))}catch(t){e({})}}listImages(e,t){try{let n,o=r.createConnection({path:i}),s="";o.on("connect",(()=>{o.write("GET http:/images/json"+(e?"?all=1":"")+" HTTP/1.0\r\n\r\n")})),o.on("data",(e=>{s+=e.toString()})),o.on("error",(()=>{o=!1,t({})})),o.on("end",(()=>{let e=s.indexOf("\r\n\r\n");s=s.substring(e+4),o=!1;try{n=JSON.parse(s),t(n)}catch(e){t({})}}))}catch(e){t({})}}inspectImage(e,t){if(e=e||"")try{let n,o=r.createConnection({path:i}),s="";o.on("connect",(()=>{o.write("GET http:/images/"+e+"/json?stream=0 HTTP/1.0\r\n\r\n")})),o.on("data",(e=>{s+=e.toString()})),o.on("error",(()=>{o=!1,t({})})),o.on("end",(()=>{let e=s.indexOf("\r\n\r\n");s=s.substring(e+4),o=!1;try{n=JSON.parse(s),t(n)}catch(e){t({})}}))}catch(e){t({})}else t({})}listContainers(e,t){try{let n,o=r.createConnection({path:i}),s="";o.on("connect",(()=>{o.write("GET http:/containers/json"+(e?"?all=1":"")+" HTTP/1.0\r\n\r\n")})),o.on("data",(e=>{s+=e.toString()})),o.on("error",(()=>{o=!1,t({})})),o.on("end",(()=>{let e=s.indexOf("\r\n\r\n");s=s.substring(e+4),o=!1;try{n=JSON.parse(s),t(n)}catch(e){t({})}}))}catch(e){t({})}}getStats(e,t){if(e=e||"")try{let n,o=r.createConnection({path:i}),s="";o.on("connect",(()=>{o.write("GET http:/containers/"+e+"/stats?stream=0 HTTP/1.0\r\n\r\n")})),o.on("data",(e=>{s+=e.toString()})),o.on("error",(()=>{o=!1,t({})})),o.on("end",(()=>{let e=s.indexOf("\r\n\r\n");s=s.substring(e+4),o=!1;try{n=JSON.parse(s),t(n)}catch(e){t({})}}))}catch(e){t({})}else t({})}getInspect(e,t){if(e=e||"")try{let n,o=r.createConnection({path:i}),s="";o.on("connect",(()=>{o.write("GET http:/containers/"+e+"/json?stream=0 HTTP/1.0\r\n\r\n")})),o.on("data",(e=>{s+=e.toString()})),o.on("error",(()=>{o=!1,t({})})),o.on("end",(()=>{let e=s.indexOf("\r\n\r\n");s=s.substring(e+4),o=!1;try{n=JSON.parse(s),t(n)}catch(e){t({})}}))}catch(e){t({})}else t({})}getProcesses(e,t){if(e=e||"")try{let n,o=r.createConnection({path:i}),s="";o.on("connect",(()=>{o.write("GET http:/containers/"+e+"/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r\n\r\n")})),o.on("data",(e=>{s+=e.toString()})),o.on("error",(()=>{o=!1,t({})})),o.on("end",(()=>{let e=s.indexOf("\r\n\r\n");s=s.substring(e+4),o=!1;try{n=JSON.parse(s),t(n)}catch(e){t({})}}))}catch(e){t({})}else t({})}listVolumes(e){try{let t,n=r.createConnection({path:i}),o="";n.on("connect",(()=>{n.write("GET http:/volumes HTTP/1.0\r\n\r\n")})),n.on("data",(e=>{o+=e.toString()})),n.on("error",(()=>{n=!1,e({})})),n.on("end",(()=>{let r=o.indexOf("\r\n\r\n");o=o.substring(r+4),n=!1;try{t=JSON.parse(o),e(t)}catch(t){e({})}}))}catch(t){e({})}}}},2683:(e,t,n)=>{"use strict";const r=n(3129).exec,i=n(3129).execSync,o=n(1453),s=n(5747);let a=process.platform;const c="linux"===a,u="darwin"===a,l="win32"===a,p="freebsd"===a,f="openbsd"===a,d="netbsd"===a,h="sunos"===a;let m={},g={};function v(e){let t=[],n=0;return e.forEach((e=>{if(e.length>0)if("*"===e[0])n++;else{let i=e.split(":");i.length>1&&(t[n]||(t[n]={name:"",identifier:"",type:"disk",fsType:"",mount:"",size:0,physical:"HDD",uuid:"",label:"",model:"",serial:"",removable:!1,protocol:""}),i[0]=i[0].trim().toUpperCase().replace(/ +/g,""),i[1]=i[1].trim(),"DEVICEIDENTIFIER"===i[0]&&(t[n].identifier=i[1]),"DEVICENODE"===i[0]&&(t[n].name=i[1]),"VOLUMENAME"===i[0]&&-1===i[1].indexOf("Not applicable")&&(t[n].label=i[1]),"PROTOCOL"===i[0]&&(t[n].protocol=i[1]),"DISKSIZE"===i[0]&&(t[n].size=(r=i[1],parseInt(r.substr(r.indexOf(" (")+2,r.indexOf(" Bytes)")-10)))),"FILESYSTEMPERSONALITY"===i[0]&&(t[n].fsType=i[1]),"MOUNTPOINT"===i[0]&&(t[n].mount=i[1]),"VOLUMEUUID"===i[0]&&(t[n].uuid=i[1]),"READ-ONLYMEDIA"===i[0]&&"Yes"===i[1]&&(t[n].physical="CD/DVD"),"SOLIDSTATE"===i[0]&&"Yes"===i[1]&&(t[n].physical="SSD"),"VIRTUAL"===i[0]&&(t[n].type="virtual"),"REMOVABLEMEDIA"===i[0]&&(t[n].removable="Removable"===i[1]),"PARTITIONTYPE"===i[0]&&(t[n].type="part"),"DEVICE/MEDIANAME"===i[0]&&(t[n].model=i[1]))}var r})),t}function y(e){let t=[];return e.filter((e=>""!==e)).forEach((e=>{try{e=(e=decodeURIComponent(e.replace(/\\x/g,"%"))).replace(/\\/g,"\\\\");let n=JSON.parse(e);t.push({name:n.name,type:n.type,fsType:n.fsType,mount:n.mountpoint,size:parseInt(n.size),physical:"disk"===n.type?"0"===n.rota?"SSD":"HDD":"rom"===n.type?"CD/DVD":"",uuid:n.uuid,label:n.label,model:n.model,serial:n.serial,removable:"1"===n.rm,protocol:n.tran,group:n.group})}catch(e){o.noop()}})),t=o.unique(t),t=o.sortByKey(t,["type","name"]),t}function _(e){return e.toString().replace(/NAME=/g,'{"name":').replace(/FSTYPE=/g,',"fsType":').replace(/TYPE=/g,',"type":').replace(/SIZE=/g,',"size":').replace(/MOUNTPOINT=/g,',"mountpoint":').replace(/UUID=/g,',"uuid":').replace(/ROTA=/g,',"rota":').replace(/RO=/g,',"ro":').replace(/RM=/g,',"rm":').replace(/TRAN=/g,',"tran":').replace(/SERIAL=/g,',"serial":').replace(/LABEL=/g,',"label":').replace(/MODEL=/g,',"model":').replace(/OWNER=/g,',"owner":').replace(/GROUP=/g,',"group":').replace(/\n/g,"}\n")}function E(e,t){let n={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0};return m&&m.ms?(n.rx=e,n.wx=t,n.tx=n.rx+n.wx,n.ms=Date.now()-m.ms,n.rx_sec=(n.rx-m.bytes_read)/(n.ms/1e3),n.wx_sec=(n.wx-m.bytes_write)/(n.ms/1e3),n.tx_sec=n.rx_sec+n.wx_sec,m.rx_sec=n.rx_sec,m.wx_sec=n.wx_sec,m.tx_sec=n.tx_sec,m.bytes_read=n.rx,m.bytes_write=n.wx,m.bytes_overall=n.rx+n.wx,m.ms=Date.now(),m.last_ms=n.ms):(n.rx=e,n.wx=t,n.tx=n.rx+n.wx,m.rx_sec=null,m.wx_sec=null,m.tx_sec=null,m.bytes_read=n.rx,m.bytes_write=n.wx,m.bytes_overall=n.rx+n.wx,m.ms=Date.now(),m.last_ms=0),n}function b(e,t){let n={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,ms:0};return g&&g.ms?(n.rIO=e,n.wIO=t,n.tIO=e+t,n.ms=Date.now()-g.ms,n.rIO_sec=(n.rIO-g.rIO)/(n.ms/1e3),n.wIO_sec=(n.wIO-g.wIO)/(n.ms/1e3),n.tIO_sec=n.rIO_sec+n.wIO_sec,g.rIO=e,g.wIO=t,g.rIO_sec=n.rIO_sec,g.wIO_sec=n.wIO_sec,g.tIO_sec=n.tIO_sec,g.last_ms=n.ms,g.ms=Date.now()):(n.rIO=e,n.wIO=t,n.tIO=e+t,g.rIO=e,g.wIO=t,g.rIO_sec=null,g.wIO_sec=null,g.tIO_sec=null,g.last_ms=0,g.ms=Date.now()),n}t.fsSize=function(e){let t=[];function n(e){let n=[];return e.forEach((function(e){if(""!==e&&(e=e.replace(/ +/g," ").split(" "))&&(e[0].startsWith("/")||e[6]&&"/"===e[6]||e[0].indexOf("/")>0||1===e[0].indexOf(":"))){const r=e[0],i=c||p||f||d?e[1]:function(e){if(!e.startsWith("/"))return"NFS";const n=e.split("/"),r=n[n.length-1],i=t.filter((e=>e.indexOf(r)>=0));return 1===i.length&&i[0].indexOf("APFS")>=0?"APFS":"HFS"}(e[0]),o=1024*parseInt(c||p||f||d?e[2]:e[1]),s=1024*parseInt(c||p||f||d?e[3]:e[2]),a=1024*parseInt(c||p||f||d?e[4]:e[3]),u=parseFloat((s/(s+a)*100).toFixed(2));e.splice(0,c||p||f||d?6:5);const l=e.join(" ");n.find((e=>e.fs===r&&e.type===i))||n.push({fs:r,type:i,size:o,used:s,available:a,use:u,mount:l})}})),n}return new Promise((s=>{process.nextTick((()=>{let a=[];if(c||p||f||d||u){let o="";if(u){o="df -kP";try{t=i("diskutil list").toString().split("\n").filter((e=>!e.startsWith("/")&&e.indexOf(":")>0))}catch(e){t=[]}}c&&(o='df -lkPTx squashfs | grep -E "^/|^.\\:"'),(p||f||d)&&(o="df -lkPT"),r(o,(function(t,i){if(t)r("df -kPT",(function(t,r){if(!t){let e=r.toString().split("\n");a=n(e)}e&&e(a),s(a)}));else{let t=i.toString().split("\n");a=n(t),e&&e(a),s(a)}}))}if(h&&(e&&e(a),s(a)),l)try{o.wmic("logicaldisk get Caption,FileSystem,FreeSpace,Size").then((t=>{t.split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)).forEach((function(e){""!==e&&(e=e.trim().split(/\s\s+/)).length>=4&&parseInt(e[3],10)&&a.push({fs:e[0],type:e[1],size:parseInt(e[3],10),used:parseInt(e[3],10)-parseInt(e[2],10),available:parseInt(e[2],10),use:parseFloat((100*(parseInt(e[3])-parseInt(e[2]))/parseInt(e[3])).toFixed(2)),mount:e[0]})})),e&&e(a),s(a)}))}catch(t){e&&e(a),s(a)}}))}))},t.fsOpenFiles=function(e){return new Promise((t=>{process.nextTick((()=>{const n={max:null,allocated:null,available:null};if(p||f||d||u){r("sysctl -a | grep 'kern.*files'",(function(r,i){if(!r){let e=i.toString().split("\n");n.max=parseInt(o.getValue(e,"kern.maxfiles",":"),10),n.allocated=parseInt(o.getValue(e,"kern.num_files",":"),10),n.available=n.max-n.allocated}e&&e(n),t(n)}))}c&&s.readFile("/proc/sys/fs/file-nr",(function(r,i){if(r)s.readFile("/proc/sys/fs/file-max",(function(r,i){if(!r){let e=i.toString().split("\n");e[0]&&(n.max=parseInt(e[0],10))}e&&e(n),t(n)}));else{let r=i.toString().split("\n");if(r[0]){const e=r[0].replace(/\s+/g," ").split(" ");3===e.length&&(n.allocated=parseInt(e[0],10),n.available=parseInt(e[1],10),n.max=parseInt(e[2],10),n.available||(n.available=n.max-n.allocated))}e&&e(n),t(n)}})),h&&(e&&e(null),t(null)),l&&(e&&e(null),t(null))}))}))},t.blockDevices=function(e){return new Promise((t=>{process.nextTick((()=>{let n=[];if(c&&r("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null",(function(i,o){if(i)r("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null",(function(r,i){if(!r){let e=_(i).split("\n");n=y(e)}e&&e(n),t(n)}));else{let r=_(o).split("\n");n=y(r),e&&e(n),t(n)}})),u&&r("diskutil info -all",(function(r,i){if(!r){let e=i.toString().split("\n");n=v(e)}e&&e(n),t(n)})),h&&(e&&e(n),t(n)),l){let r=["Unknown","NoRoot","Removable","Local","Network","CD/DVD","RAM"];try{o.wmic("logicaldisk get Caption,Description,DeviceID,DriveType,FileSystem,FreeSpace,Name,Size,VolumeName,VolumeSerialNumber /value").then(((i,s)=>{if(!s){i.toString().split(/\n\s*\n/).forEach((function(e){let t=e.split("\r\n"),i=o.getValue(t,"drivetype","=");i&&n.push({name:o.getValue(t,"name","="),identifier:o.getValue(t,"caption","="),type:"disk",fsType:o.getValue(t,"filesystem","=").toLowerCase(),mount:o.getValue(t,"caption","="),size:o.getValue(t,"size","="),physical:i>=0&&i<=6?r[i]:r[0],uuid:o.getValue(t,"volumeserialnumber","="),label:o.getValue(t,"volumename","="),model:"",serial:o.getValue(t,"volumeserialnumber","="),removable:"2"===i,protocol:""})}))}e&&e(n),t(n)}))}catch(r){e&&e(n),t(n)}}(p||f||d)&&(e&&e(null),t(null))}))}))},t.fsStats=function(e){return new Promise((t=>{process.nextTick((()=>{l&&t(null);let n={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0},i=0,o=0;m&&!m.ms||m&&m.ms&&Date.now()-m.ms>=500?(c&&r("lsblk -r 2>/dev/null | grep /",(function(s,a){if(s)e&&e(n),t(n);else{let s=a.toString().split("\n"),c=[];s.forEach((function(e){""!==e&&(e=e.trim().split(" "),-1===c.indexOf(e[0])&&c.push(e[0]))}));let u=c.join("|");r('cat /proc/diskstats | egrep "'+u+'"',(function(r,s){if(!r){s.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.replace(/ +/g," ").split(" "),i+=512*parseInt(e[5]),o+=512*parseInt(e[9]))})),n=E(i,o)}e&&e(n),t(n)}))}})),u&&r('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"',(function(r,s){if(!r){s.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.split(","),i+=parseInt(e[2]),o+=parseInt(e[9]))})),n=E(i,o)}e&&e(n),t(n)}))):(n.ms=m.last_ms,n.rx=m.bytes_read,n.wx=m.bytes_write,n.tx=m.bytes_read+m.bytes_write,n.rx_sec=m.rx_sec,n.wx_sec=m.wx_sec,n.tx_sec=m.tx_sec,e&&e(n),t(n))}))}))},t.disksIO=function(e){return new Promise((t=>{process.nextTick((()=>{l&&t(null),h&&t(null);let n={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,ms:0},i=0,o=0;if(g&&!g.ms||g&&g.ms&&Date.now()-g.ms>=500){if(c||p||f||d){r('for mount in `lsblk 2>/dev/null | grep " disk " | sed "s/[│└─├]//g" | awk \'{$1=$1};1\' | cut -d " " -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r "s/ +/;/g" | sed -r "s/^;//"; done',(function(r,s){if(r)e&&e(n),t(n);else{s.split("\n").forEach((function(e){if(!e)return;let t=e.split(";");i+=parseInt(t[0]),o+=parseInt(t[4])})),n=b(i,o),e&&e(n),t(n)}}))}u&&r('ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,\n"',(function(r,s){if(!r){s.toString().split("\n").forEach((function(e){""!==(e=e.trim())&&(e=e.split(","),i+=parseInt(e[10]),o+=parseInt(e[0]))})),n=b(i,o)}e&&e(n),t(n)}))}else n.rIO=g.rIO,n.wIO=g.wIO,n.tIO=g.rIO+g.wIO,n.ms=g.last_ms,n.rIO_sec=g.rIO_sec,n.wIO_sec=g.wIO_sec,n.tIO_sec=g.tIO_sec,e&&e(n),t(n)}))}))},t.diskLayout=function(e){function t(e){const t=[{pattern:"^WESTERN.+",manufacturer:"Western Digital"},{pattern:"^WDC.+",manufacturer:"Western Digital"},{pattern:"WD.+",manufacturer:"Western Digital"},{pattern:"^TOSHIBA.+",manufacturer:"Toshiba"},{pattern:"^HITACHI.+",manufacturer:"Hitachi"},{pattern:"^IC.+",manufacturer:"Hitachi"},{pattern:"^HTS.+",manufacturer:"Hitachi"},{pattern:"^SANDISK.+",manufacturer:"SanDisk"},{pattern:"^KINGSTON.+",manufacturer:"Kingston Technonogy"},{pattern:"^SONY.+",manufacturer:"Sony"},{pattern:"^TRANSCEND.+",manufacturer:"Transcend"},{pattern:"SAMSUNG.+",manufacturer:"Samsung"},{pattern:"^ST(?!I\\ ).+",manufacturer:"Seagate"},{pattern:"^STI\\ .+",manufacturer:"SimpleTech"},{pattern:"^D...-.+",manufacturer:"IBM"},{pattern:"^IBM.+",manufacturer:"IBM"},{pattern:"^FUJITSU.+",manufacturer:"Fujitsu"},{pattern:"^MP.+",manufacturer:"Fujitsu"},{pattern:"^MK.+",manufacturer:"Toshiba"},{pattern:"^MAXTOR.+",manufacturer:"Maxtor"},{pattern:"^Pioneer.+",manufacturer:"Pioneer"},{pattern:"^PHILIPS.+",manufacturer:"Philips"},{pattern:"^QUANTUM.+",manufacturer:"Quantum Technology"},{pattern:"FIREBALL.+",manufacturer:"Quantum Technology"},{pattern:"^VBOX.+",manufacturer:"VirtualBox"},{pattern:"CORSAIR.+",manufacturer:"Corsair Components"},{pattern:"CRUCIAL.+",manufacturer:"Crucial"},{pattern:"ECM.+",manufacturer:"ECM"},{pattern:"INTEL.+",manufacturer:"INTEL"},{pattern:".+EVO",manufacturer:"Samsung"},{pattern:"APPLE.+",manufacturer:"Apple"}];let n="";return e&&(e=e.toUpperCase(),t.forEach((t=>{RegExp(t.pattern).test(e)&&(n=t.manufacturer)}))),n}return new Promise((n=>{process.nextTick((()=>{const s=t=>{for(let e=0;e/dev/null; unset LC_ALL",(function(n,c){if(!n)try{const n=c.toString().trim();let r=[];try{const e=JSON.parse(n);e&&{}.hasOwnProperty.call(e,"blockdevices")&&(r=e.blockdevices.filter((e=>"disk"===e.type&&e.size>0&&(null!==e.model||null===e.mountpoint&&null===e.label&&null===e.fsType&&null===e.parttype))))}catch(e){let t=_(i("export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL").toString()).split("\n");r=y(t).filter((e=>"disk"===e.type&&e.size>0&&(null!==e.model&&""!==e.model||""===e.mount&&""===e.label&&""===e.fsType)))}r.forEach((n=>{let r="";const s="/dev/"+n.name,c=n.name;try{r=i("cat /sys/block/"+c+"/queue/rotational 2>/dev/null").toString().split("\n")[0]}catch(e){o.noop()}let u=n.tran?n.tran.toUpperCase().trim():"";"NVME"===u&&(r="2",u="PCIe"),a.push({device:s,type:"0"===r?"SSD":"1"===r?"HD":"2"===r?"NVMe":n.model&&n.model.indexOf("SSD")>-1?"SSD":n.model&&n.model.indexOf("NVM")>-1?"NVMe":"HD",name:n.model||"",vendor:t(n.model)||(n.vendor?n.vendor.trim():""),size:n.size||0,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:n.rev?n.rev.trim():"",serialNum:n.serial?n.serial.trim():"",interfaceType:u,smartStatus:"unknown",temperature:null,BSDName:s}),m+=`printf "\n${s}|"; smartctl -H ${s} | grep overall;`,e+=`${e?'printf ",";':""}smartctl -a -j ${s};`}))}catch(e){o.noop()}e?r(e,(function(e,t){try{JSON.parse(`[${t}]`).forEach((e=>{const t=e.smartctl.argv[e.smartctl.argv.length-1];for(let n=0;n{if(e){let t=e.split("|");if(2===t.length){let e=t[0];t[1]=t[1].trim();let n=t[1].split(":");if(2===n.length){n[1]=n[1].trim();let t=n[1].toLowerCase();for(let n=0;n{"NVMExpress:"===e?p="NVMe":"USB:"===e?p="USB":"SATA/SATA Express:"===e?p="SATA":"SATA"===p?c.push(e):"NVMe"===p?u.push(e):"USB"===p&&l.push(e)}));try{let e=c.join("\n").split(" Physical Interconnect: ");e.shift(),e.forEach((function(e){let n=(e="InterfaceType: "+e).split("\n");const r=o.getValue(n,"Medium Type",":",!0).trim(),i=o.getValue(n,"capacity",":",!0).trim(),s=o.getValue(n,"BSD Name",":",!0).trim();if(i){let e=0;if(i.indexOf("(")>=0&&(e=parseInt(i.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,""))),e||(e=parseInt(i)),e){const i=o.getValue(n,"S.M.A.R.T. status",":",!0).trim().toLowerCase();a.push({device:s,type:r.startsWith("Solid")?"SSD":"HD",name:o.getValue(n,"Model",":",!0).trim(),vendor:t(o.getValue(n,"Model",":",!0).trim())||o.getValue(n,"Manufacturer",":",!0),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:o.getValue(n,"Revision",":",!0).trim(),serialNum:o.getValue(n,"Serial Number",":",!0).trim(),interfaceType:o.getValue(n,"InterfaceType",":",!0).trim(),smartStatus:"verified"===i?"OK":i||"unknown",temperature:null,BSDName:s}),m=m+'printf "\n'+s+'|"; diskutil info /dev/'+s+" | grep SMART;"}}}))}catch(e){o.noop()}try{let e=u.join("\n").split("\n\n Capacity:");e.shift(),e.forEach((function(e){let n=(e="!Capacity: "+e).split("\n");const r=o.getValue(n,"link width",":",!0).trim(),i=o.getValue(n,"!capacity",":",!0).trim(),s=o.getValue(n,"BSD Name",":",!0).trim();if(i){let e=0;if(i.indexOf("(")>=0&&(e=parseInt(i.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,""))),e||(e=parseInt(i)),e){const i=o.getValue(n,"S.M.A.R.T. status",":",!0).trim().toLowerCase();a.push({device:s,type:"NVMe",name:o.getValue(n,"Model",":",!0).trim(),vendor:t(o.getValue(n,"Model",":",!0).trim()),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:o.getValue(n,"Revision",":",!0).trim(),serialNum:o.getValue(n,"Serial Number",":",!0).trim(),interfaceType:("PCIe "+r).trim(),smartStatus:"verified"===i?"OK":i||"unknown",temperature:null,BSDName:s}),m=m+'printf "\n'+s+'|"; diskutil info /dev/'+s+" | grep SMART;"}}}))}catch(e){o.noop()}try{let e=l.join("\n").replaceAll("Media:\n ","Model:").split("\n\n Product ID:");e.shift(),e.forEach((function(e){let n=e.split("\n");const r=o.getValue(n,"Capacity",":",!0).trim(),i=o.getValue(n,"BSD Name",":",!0).trim();if(r){let e=0;if(r.indexOf("(")>=0&&(e=parseInt(r.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,""))),e||(e=parseInt(r)),e){const r=o.getValue(n,"S.M.A.R.T. status",":",!0).trim().toLowerCase();a.push({device:i,type:"USB",name:o.getValue(n,"Model",":",!0).trim().replaceAll(":",""),vendor:t(o.getValue(n,"Model",":",!0).trim()),size:e,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:o.getValue(n,"Revision",":",!0).trim(),serialNum:o.getValue(n,"Serial Number",":",!0).trim(),interfaceType:"USB",smartStatus:"verified"===r?"OK":r||"unknown",temperature:null,BSDName:i}),m=m+'printf "\n'+i+'|"; diskutil info /dev/'+i+" | grep SMART;"}}}))}catch(e){o.noop()}if(m)m+='printf "\n"',r(m,(function(t,r){r.toString().split("\n").forEach((e=>{if(e){let t=e.split("|");if(2===t.length){let e=t[0];t[1]=t[1].trim();let n=t[1].split(":");if(2===n.length){n[1]=n[1].trim();let t=n[1].toLowerCase();for(let n=0;n{t.toString().split(/\n\s*\n/).forEach((function(e){let t=e.split("\r\n");const n=o.getValue(t,"Size","=").trim(),r=o.getValue(t,"Status","=").trim().toLowerCase();n&&a.push({device:o.getValue(t,"PNPDeviceId","="),type:e.indexOf("SSD")>-1?"SSD":"HD",name:o.getValue(t,"Caption","="),vendor:o.getValue(t,"Manufacturer","="),size:parseInt(n),bytesPerSector:parseInt(o.getValue(t,"BytesPerSector","=")),totalCylinders:parseInt(o.getValue(t,"TotalCylinders","=")),totalHeads:parseInt(o.getValue(t,"TotalHeads","=")),totalSectors:parseInt(o.getValue(t,"TotalSectors","=")),totalTracks:parseInt(o.getValue(t,"TotalTracks","=")),tracksPerCylinder:parseInt(o.getValue(t,"TracksPerCylinder","=")),sectorsPerTrack:parseInt(o.getValue(t,"SectorsPerTrack","=")),firmwareRevision:o.getValue(t,"FirmwareRevision","=").trim(),serialNum:o.getValue(t,"SerialNumber","=").trim(),interfaceType:o.getValue(t,"InterfaceType","=").trim(),smartStatus:"ok"===r?"Ok":"degraded"===r?"Degraded":"pred fail"===r?"Predicted Failure":"Unknown",temperature:null})})),o.powerShell("Get-PhysicalDisk | Format-List").then((t=>{t.split(/\n\s*\n/).forEach((function(e){let t=e.split("\r\n");const n=o.getValue(t,"SerialNumber",":").trim(),r=o.getValue(t,"FriendlyName",":").trim().replace("Msft ","Microsoft"),i=o.getValue(t,"Size",":").trim(),s=o.getValue(t,"Model",":").trim(),c=o.getValue(t,"BusType",":").trim();let u=o.getValue(t,"MediaType",":").trim();if("3"!==u&&"HDD"!==u||(u="HD"),"4"===u&&(u="SSD"),"5"===u&&(u="SCM"),"Unspecified"===u&&(s.toLowerCase().indexOf("virtual")>-1||s.toLowerCase().indexOf("vbox")>-1)&&(u="Virtual"),i){let e=o.findObjectByKey(a,"serialNum",n);-1!==e&&""!==n||(e=o.findObjectByKey(a,"name",r)),-1!=e&&(a[e].type=u,a[e].interfaceType=c)}})),e&&e(a),n(a)})).catch((()=>{e&&e(a),n(a)}))}))}catch(t){e&&e(a),n(a)}}))}))}},559:(e,t,n)=>{"use strict";const r=n(2087),i=n(5747),o=n(3129).exec,s=n(3129).execSync,a=n(1453);let c=process.platform,u="";const l="linux"===c,p="darwin"===c,f="win32"===c,d="freebsd"===c,h="openbsd"===c,m="netbsd"===c,g="sunos"===c;let v=0,y=0,_=0,E=0;const b={"-2":"UNINITIALIZED","-1":"OTHER",0:"HD15",1:"SVIDEO",2:"Composite video",3:"Component video",4:"DVI",5:"HDMI",6:"LVDS",8:"D_JPN",9:"SDI",10:"DP",11:"DP embedded",12:"UDI",13:"UDI embedded",14:"SDTVDONGLE",15:"MIRACAST",2147483648:"INTERNAL"};t.graphics=function(e){function t(e){const t=function(){if(u)return u;if(f)try{const e=a.WINDIR+"\\System32\\DriverStore\\FileRepository",t=i.readdirSync(e).filter((t=>i.readdirSync([e,t].join("/")).includes("nvidia-smi.exe"))).reduce(((t,n)=>{const r=i.statSync([e,t,"nvidia-smi.exe"].join("/")),o=i.statSync([e,n,"nvidia-smi.exe"].join("/"));return r.ctimeMs>o.ctimeMs?t:n}));t&&(u=[e,t,"nvidia-smi.exe"].join("/"))}catch(e){a.noop()}else l&&(u="nvidia-smi");return u}();if(e=e||a.execOptsWin,t){const n=t+" "+"--query-gpu=driver_version,pci.sub_device_id,name,pci.bus_id,fan.speed,memory.total,memory.used,memory.free,utilization.gpu,utilization.memory,temperature.gpu,temperature.memory,power.draw,power.limit,clocks.gr,clocks.mem --format=csv,noheader,nounits"+(l?" 2>/dev/null":"");try{return s(n,e).toString()}catch(e){a.noop()}}return""}function n(){function e(e){return[null,void 0].includes(e)?e:parseFloat(e)}const n=t();if(!n)return[];return n.split("\n").filter(Boolean).map((t=>{const n=t.split(", ").map((e=>e.includes("N/A")?void 0:e));if(16===n.length)return{driverVersion:n[0],subDeviceId:n[1],name:n[2],pciBus:n[3],fanSpeed:e(n[4]),memoryTotal:e(n[5]),memoryUsed:e(n[6]),memoryFree:e(n[7]),utilizationGpu:e(n[8]),utilizationMemory:e(n[9]),temperatureGpu:e(n[10]),temperatureMemory:e(n[11]),powerDraw:e(n[12]),powerLimit:e(n[13]),clockCore:e(n[14]),clockMemory:e(n[15])}}))}function c(e,t){return t.driverVersion&&(e.driverVersion=t.driverVersion),t.subDeviceId&&(e.subDeviceId=t.subDeviceId),t.name&&(e.name=t.name),t.pciBus&&(e.pciBus=t.pciBus),t.fanSpeed&&(e.fanSpeed=t.fanSpeed),t.memoryTotal&&(e.memoryTotal=t.memoryTotal,e.vram=t.memoryTotal,e.vramDynamic=!1),t.memoryUsed&&(e.memoryUsed=t.memoryUsed),t.memoryFree&&(e.memoryFree=t.memoryFree),t.utilizationGpu&&(e.utilizationGpu=t.utilizationGpu),t.utilizationMemory&&(e.utilizationMemory=t.utilizationMemory),t.temperatureGpu&&(e.temperatureGpu=t.temperatureGpu),t.temperatureMemory&&(e.temperatureMemory=t.temperatureMemory),t.powerDraw&&(e.powerDraw=t.powerDraw),t.powerLimit&&(e.powerLimit=t.powerLimit),t.clockCore&&(e.clockCore=t.clockCore),t.clockMemory&&(e.clockMemory=t.clockMemory),e}function w(e){let t={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null},n=108;if("000000"===e.substr(n,6)&&(n+=36),"000000"===e.substr(n,6)&&(n+=36),"000000"===e.substr(n,6)&&(n+=36),"000000"===e.substr(n,6)&&(n+=36),t.resolutionX=parseInt("0x0"+e.substr(n+8,1)+e.substr(n+4,2)),t.resolutionY=parseInt("0x0"+e.substr(n+14,1)+e.substr(n+10,2)),t.sizeX=parseInt("0x0"+e.substr(n+28,1)+e.substr(n+24,2)),t.sizeY=parseInt("0x0"+e.substr(n+29,1)+e.substr(n+26,2)),n=e.indexOf("000000fc00"),n>=0){let r=e.substr(n+10,26);-1!==r.indexOf("0a")&&(r=r.substr(0,r.indexOf("0a")));try{r.length>2&&(t.model=r.match(/.{1,2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))}catch(e){a.noop()}}else t.model="";return t}return new Promise((t=>{process.nextTick((()=>{let i={controllers:[],displays:[]};if(p){o("system_profiler SPDisplaysDataType",(function(n,r){if(!n){let e=r.toString().split("\n");i=function(e){let t=[],n=-1,r=-1,i=[],o=[],s={vendor:"",model:"",bus:"",vram:null,vramDynamic:!1},a={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null};for(let c=0;c0&&(i.push(s),s={vendor:"",model:"",bus:"",vram:null,vramDynamic:!1}),Object.keys(a).length>0&&(o.push(a),a={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null})),r=n;let l=e[c].split(":");if(2===n&&(l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("chipsetmodel")&&(s.model=l[1].trim()),l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("vendor")&&(s.vendor=l[1].split("(")[0].trim()),l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("vram(total)")&&(s.vram=parseInt(l[1]),-1!==l[1].toLowerCase().indexOf("gb")&&(s.vram=1024*s.vram),s.vramDynamic=!1),l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("vram(dynamic,max)")&&(s.vram=parseInt(l[1]),-1!==l[1].toLowerCase().indexOf("gb")&&(s.vram=1024*s.vram),s.vramDynamic=!0),l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("bus")&&(s.bus=l[1].trim(),"built-in"===s.bus.toLowerCase()&&(s.vramDynamic=!0))),3===n&&l.length>1&&""===l[1]&&(a.vendor="",a.model=l[0].trim(),a.main=!1,a.builtin=!1,a.connection="",a.sizeX=null,a.sizeY=null,a.positionX=0,a.positionY=0,a.pixelDepth=null),4===n){if(l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("resolution")){let e=l[1].split("x");a.resolutionX=e.length>1?parseInt(e[0]):0,a.resolutionY=e.length>1?parseInt(e[1]):0,a.currentResX=a.resolutionX,a.currentResY=a.resolutionY}l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("pixeldepth")&&(a.pixelDepth=parseInt(l[1])),l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("framebufferdepth")&&(a.pixelDepth=parseInt(l[1])),l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("maindisplay")&&"yes"===l[1].replace(/ +/g,"").toLowerCase()&&(a.main=!0),l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("built-in")&&"yes"===l[1].replace(/ +/g,"").toLowerCase()&&(a.vendor="Apple",a.builtin=!0,a.connection=""),l.length>1&&-1!==l[0].replace(/ +/g,"").toLowerCase().indexOf("connectiontype")&&(a.builtin=!1,a.connection=l[1].trim(),"Internal"===a.connection&&(a.vendor="Apple",a.builtin=!0))}}return Object.keys(s).length>0&&i.push(s),Object.keys(a).length>0&&o.push(a),{controllers:i,displays:o}}(e)}e&&e(i),t(i)}))}if(l)if(a.isRaspberry()&&a.isRaspbian()){o("fbset -s | grep 'mode \"'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;",(function(n,r){let o=r.toString().split("\n");if(o.length>3&&o[0].indexOf('mode "')>=-1&&o[2].indexOf("0x12000a")>-1){const e=o[0].replace("mode","").replace(/"/g,"").trim().split("x");2===e.length&&i.displays.push({vendor:"",model:a.getValue(o,"device_name","="),main:!0,builtin:!1,connection:"HDMI",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:parseInt(e[0],10),resolutionY:parseInt(e[1],10),currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null})}o.length>1&&r.toString().indexOf("gpu=")>=-1&&i.controllers.push({vendor:"Broadcom",model:"VideoCore IV",bus:"",vram:a.getValue(o,"gpu","=").replace("M",""),vramDynamic:!0}),e&&e(i),t(i)}))}else{o("lspci -vvv 2>/dev/null",(function(r,u){if(!r){let e=u.toString().split("\n");i.controllers=function(e){let t=[],n={vendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1,pciID:""},r=!1,i=[];try{i=s('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "').toString().split("\n");for(let e=0;e=0,a=e[o].toLowerCase().indexOf(" vga "),c=e[o].toLowerCase().indexOf("3d controller");if(-1!==a||-1!==c){-1!==c&&-1===a&&(a=c),(n.vendor||n.model||n.bus||null!==n.vram||n.vramDynamic)&&(t.push(n),n={vendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1});const u=e[o].split(" ")[0];/[\da-fA-F]{2}:[\da-fA-F]{2}\.[\da-fA-F]/.test(u)&&(n.busAddress=u),r=!0;let l=e[o].search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/),p=e[o].substr(a,l-a).split(":");n.busAddress=e[o].substr(0,a).trim(),p.length>1&&(p[1]=p[1].trim(),p[1].toLowerCase().indexOf("corporation")>=0?(n.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("corporation")+11).trim(),n.model=p[1].substr(p[1].toLowerCase().indexOf("corporation")+11,200).trim().split("(")[0],n.bus=i.length>0&&s?"PCIe":"Onboard",n.vram=null,n.vramDynamic=!1):p[1].toLowerCase().indexOf(" inc.")>=0?((p[1].match(new RegExp("]","g"))||[]).length>1?(n.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("]")+1).trim(),n.model=p[1].substr(p[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(n.vendor=p[1].substr(0,p[1].toLowerCase().indexOf(" inc.")+5).trim(),n.model=p[1].substr(p[1].toLowerCase().indexOf(" inc.")+5,200).trim().split("(")[0].trim()),n.bus=i.length>0&&s?"PCIe":"Onboard",n.vram=null,n.vramDynamic=!1):p[1].toLowerCase().indexOf(" ltd.")>=0&&((p[1].match(new RegExp("]","g"))||[]).length>1?(n.vendor=p[1].substr(0,p[1].toLowerCase().indexOf("]")+1).trim(),n.model=p[1].substr(p[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(n.vendor=p[1].substr(0,p[1].toLowerCase().indexOf(" ltd.")+5).trim(),n.model=p[1].substr(p[1].toLowerCase().indexOf(" ltd.")+5,200).trim().split("(")[0].trim())))}else r=!1}if(r){let t=e[o].split(":");if(t.length>1&&-1!==t[0].replace(/ +/g,"").toLowerCase().indexOf("devicename")&&-1!==t[1].toLowerCase().indexOf("onboard")&&(n.bus="Onboard"),t.length>1&&-1!==t[0].replace(/ +/g,"").toLowerCase().indexOf("region")&&-1!==t[1].toLowerCase().indexOf("memory")){let e=t[1].split("=");e.length>1&&(n.vram=parseInt(e[1]))}}}return(n.vendor||n.model||n.bus||n.busAddress||null!==n.vram||n.vramDynamic)&&t.push(n),t}(e);const t=n();i.controllers=i.controllers.map((e=>c(e,t.find((({pciBus:t})=>t.toLowerCase().endsWith(e.busAddress.toLowerCase())))||{})))}o("clinfo --raw",(function(n,r){if(!n){let e=r.toString().split("\n");i.controllers=function(e,t){const n=/\[([^\]]+)\]\s+(\w+)\s+(.*)/,r=t.reduce(((e,t)=>{const r=n.exec(t.trim());return r&&(e[r[1]]||(e[r[1]]={}),e[r[1]][r[2]]=r[3]),e}),{});for(let t in r){const n=r[t];if("CL_DEVICE_TYPE_GPU"===n.CL_DEVICE_TYPE){let t;if(n.CL_DEVICE_TOPOLOGY_AMD){const e=n.CL_DEVICE_TOPOLOGY_AMD.match(/[a-zA-Z0-9]+:\d+\.\d+/);e&&(t=e[0])}else if(n.CL_DEVICE_PCI_BUS_ID_NV&&n.CL_DEVICE_PCI_SLOT_ID_NV){const e=parseInt(n.CL_DEVICE_PCI_BUS_ID_NV),r=parseInt(n.CL_DEVICE_PCI_SLOT_ID_NV);if(!isNaN(e)&&!isNaN(r)){const n=r>>3&255,i=7&r;t=`${(255&e).toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}.${i}`}}if(t){let r=e.find((e=>e.busAddress===t));r||(r={vendor:"",model:"",bus:"",busAddress:t,vram:null,vramDynamic:!1},e.push(r)),r.vendor=n.CL_DEVICE_VENDOR,n.CL_DEVICE_BOARD_NAME_AMD?r.model=n.CL_DEVICE_BOARD_NAME_AMD:r.model=n.CL_DEVICE_NAME;const i=parseInt(n.CL_DEVICE_GLOBAL_MEM_SIZE);isNaN(i)||(r.vram=Math.round(i/1024/1024))}}}return e}(i.controllers,e)}o("xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'",(function(n,r){let s=0;if(!n){let e=r.toString().split("\n");s=parseInt(e[0])||0}o("xrandr --verbose 2>/dev/null",(function(n,r){if(!n){let e=r.toString().split("\n");i.displays=function(e,t){let n=[],r={vendor:"",model:"",deviceName:"",main:!1,builtin:!1,connection:"",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:null,resolutionY:null,currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null},i=!1,o=!1,s="",c=0;for(let u=1;u=0,r.builtin=t[0].toLowerCase().indexOf("edp")>=0}if(i)if(e[u].search(/\S|$/)>c)s+=e[u].toLowerCase().trim();else{let e=w(s);r.vendor=e.vendor,r.model=e.model,r.resolutionX=e.resolutionX,r.resolutionY=e.resolutionY,r.sizeX=e.sizeX,r.sizeY=e.sizeY,r.pixelDepth=t,i=!1}if(e[u].toLowerCase().indexOf("edid:")>=0&&(i=!0,c=e[u].search(/\S|$/)),e[u].toLowerCase().indexOf("*current")>=0){const t=e[u].split("(");if(t&&t.length>1&&t[0].indexOf("x")>=0){const e=t[0].trim().split("x");r.currentResX=a.toInt(e[0]),r.currentResY=a.toInt(e[1])}o=!0}if(o&&e[u].toLowerCase().indexOf("clock")>=0&&e[u].toLowerCase().indexOf("hz")>=0&&e[u].toLowerCase().indexOf("v: height")>=0){const t=e[u].split("clock");t&&t.length>1&&t[1].toLowerCase().indexOf("hz")>=0&&(r.currentRefreshRate=a.toInt(t[1])),o=!1}}return(r.model||r.main||r.builtin||r.connection||null!==r.sizeX||null!==r.pixelDepth||null!==r.resolutionX)&&n.push(r),n}(e,s)}e&&e(i),t(i)}))}))}))}))}if((d||h||m)&&(e&&e(null),t(null)),g&&(e&&e(null),t(null)),f)try{const o=[];o.push(a.wmic("path win32_VideoController get /value")),o.push(a.wmic("path win32_desktopmonitor get /value")),o.push(a.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorBasicDisplayParams | fl")),o.push(a.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens")),o.push(a.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorConnectionParams | fl")),o.push(a.powerShell('gwmi WmiMonitorID -Namespace root\\wmi | ForEach-Object {(($_.ManufacturerName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.ProductCodeID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.UserFriendlyName -notmatch 0 | foreach {[char]$_}) -join "") + "|" + (($_.SerialNumberID -notmatch 0 | foreach {[char]$_}) -join "") + "|" + $_.InstanceName}'));const s=n();Promise.all(o).then((n=>{let o=n[0].split(/\n\s*\n/);i.controllers=function(e){let t=[];for(let n in e)if({}.hasOwnProperty.call(e,n)&&""!==e[n].trim()){let r=e[n].trim().split("\r\n"),i=a.getValue(r,"PNPDeviceID","=").match(/SUBSYS_[a-fA-F\d]{8}/),o=null;i&&(o=i[0],o&&(o=o.split("_")[1])),t.push({vendor:a.getValue(r,"AdapterCompatibility","="),model:a.getValue(r,"name","="),bus:a.getValue(r,"PNPDeviceID","=").startsWith("PCI")?"PCI":"",vram:a.toInt(a.getValue(r,"AdapterRAM","="))/1024/1024,vramDynamic:"2"===a.getValue(r,"VideoMemoryType","="),subDeviceId:o}),v=a.toInt(a.getValue(r,"CurrentHorizontalResolution","="))||v,y=a.toInt(a.getValue(r,"CurrentVerticalResolution","="))||y,E=a.toInt(a.getValue(r,"CurrentRefreshRate","="))||E,_=a.toInt(a.getValue(r,"CurrentBitsPerPixel","="))||_}return t}(o),i.controllers=i.controllers.map((e=>"nvidia"===e.vendor.toLowerCase()?c(e,s.find((t=>{let n=e.subDeviceId.toLowerCase();const r=t.subDeviceId.split("x");let i=r.length>1?r[1].toLowerCase():r[0].toLowerCase();const o=Math.abs(n.length-i.length);if(n.length>i.length)for(let e=0;e{const t=e.split("|");5===t.length&&h.push({vendor:t[0],code:t[1],model:t[2],serial:t[3],instanceId:t[4]})})),i.displays=function(e,t,n,i,o){let s=[],c="",u="",l="",p=0,f=0;if(n&&n.length){let e=n[0].split(r.EOL);c=a.getValue(e,"MonitorManufacturer","="),u=a.getValue(e,"Name","="),l=a.getValue(e,"PNPDeviceID","=").replace(/&/g,"&").toLowerCase(),p=a.toInt(a.getValue(e,"ScreenWidth","=")),f=a.toInt(a.getValue(e,"ScreenHeight","="))}for(let n=0;n{e.instanceId.toLowerCase().startsWith(_)&&c.startsWith("(")&&u.startsWith("PnP")&&(S=e.vendor,I=e.model)})),s.push({vendor:_.startsWith(l)&&""===S?c:S,model:_.startsWith(l)&&""===I?u:I,deviceName:w,main:"true"===g.toLowerCase(),builtin:"2147483648"===E,connection:E&&b[E]?b[E]:"",resolutionX:a.toInt(a.getValue(m,"Width","=")),resolutionY:a.toInt(a.getValue(m,"Height","=")),sizeX:v?parseInt(v,10):null,sizeY:y?parseInt(y,10):null,pixelDepth:h,currentResX:a.toInt(a.getValue(m,"Width","=")),currentResY:a.toInt(a.getValue(m,"Height","=")),positionX:a.toInt(a.getValue(m,"X","=")),positionY:a.toInt(a.getValue(m,"Y","="))})}0===e.length&&s.push({vendor:c,model:u,main:!0,sizeX:null,sizeY:null,resolutionX:p,resolutionY:f,pixelDepth:null,currentResX:p,currentResY:f,positionX:0,positionY:0});return s}(p,l,u,f,h),1===i.displays.length&&(v&&(i.displays[0].resolutionX=v,i.displays[0].currentResX||(i.displays[0].currentResX=v)),y&&(i.displays[0].resolutionY=y,0===i.displays[0].currentResY&&(i.displays[0].currentResY=y)),_&&(i.displays[0].pixelDepth=_),E&&!i.displays[0].refreshRate&&(i.displays[0].currentRefreshRate=E)),e&&e(i),t(i)})).catch((()=>{e&&e(i),t(i)}))}catch(n){e&&e(i),t(i)}}))}))}},294:(e,t,n)=>{"use strict";const r=n(702).i8,i=n(1453),o=n(1617),s=n(6599),a=n(51),c=n(6144),u=n(5953),l=n(559),p=n(2683),f=n(6926),d=n(2023),h=n(1111),m=n(840),g=n(2795),v=n(8725),y=n(4869),_=n(8958),E=n(3932),b=n(7250),w=n(7381);let S=process.platform;const I="win32"===S,C="freebsd"===S,x="openbsd"===S,O="netbsd"===S,T="sunos"===S;function A(){return r}function N(e){return new Promise((t=>{process.nextTick((()=>{let n={};n.version=A(),Promise.all([o.system(),o.bios(),o.baseboard(),o.chassis(),s.osInfo(),s.uuid(),s.versions(),a.cpu(),a.cpuFlags(),l.graphics(),f.networkInterfaces(),c.memLayout(),p.diskLayout()]).then((r=>{n.system=r[0],n.bios=r[1],n.baseboard=r[2],n.chassis=r[3],n.os=r[4],n.uuid=r[5],n.versions=r[6],n.cpu=r[7],n.cpu.flags=r[8],n.graphics=r[9],n.net=r[10],n.memLayout=r[11],n.diskLayout=r[12],e&&e(n),t(n)}))}))}))}function P(e,t,n){return i.isFunction(t)&&(n=t,t=""),i.isFunction(e)&&(n=e,e=""),new Promise((r=>{process.nextTick((()=>{t=t||f.getDefaultNetworkInterface(),e=e||"";let i=function(){let e=15;return I&&(e=13),(C||x||O)&&(e=11),T&&(e=6),function(){0==--e&&(n&&n(o),r(o))}}(),o={};o.time=s.time(),o.node=process.versions.node,o.v8=process.versions.v8,a.cpuCurrentSpeed().then((e=>{o.cpuCurrentSpeed=e,i()})),m.users().then((e=>{o.users=e,i()})),h.processes().then((e=>{o.processes=e,i()})),a.currentLoad().then((e=>{o.currentLoad=e,i()})),T||a.cpuTemperature().then((e=>{o.temp=e,i()})),x||C||O||T||f.networkStats(t).then((e=>{o.networkStats=e,i()})),T||f.networkConnections().then((e=>{o.networkConnections=e,i()})),c.mem().then((e=>{o.mem=e,i()})),T||u().then((e=>{o.battery=e,i()})),T||h.services(e).then((e=>{o.services=e,i()})),T||p.fsSize().then((e=>{o.fsSize=e,i()})),I||x||C||O||T||p.fsStats().then((e=>{o.fsStats=e,i()})),I||x||C||O||T||p.disksIO().then((e=>{o.disksIO=e,i()})),x||C||O||T||d.wifiNetworks().then((e=>{o.wifiNetworks=e,i()})),g.inetLatency().then((e=>{o.inetLatency=e,i()}))}))}))}function L(e,n){return new Promise((r=>{process.nextTick((()=>{const i=Object.keys(e).filter((e=>({}.hasOwnProperty.call(t,e)))).map((n=>{const r=e[n].substring(e[n].lastIndexOf("(")+1,e[n].lastIndexOf(")"));let i=n.indexOf(")")>=0?n.split(")")[1].trim():n;return i=n.indexOf("|")>=0?n.split("|")[0].trim():i,r?t[i](r):t[i]("")}));Promise.all(i).then((i=>{const o={};let s=0;for(let n in e)if({}.hasOwnProperty.call(e,n)&&{}.hasOwnProperty.call(t,n)&&i.length>s){if("*"===e[n]||"all"===e[n])o[n]=i[s];else{let t=e[n],r="",a=[];if(t.indexOf(")")>=0&&(t=t.split(")")[1].trim()),t.indexOf("|")>=0&&(r=t.split("|")[1].trim(),a=r.split(":"),t=t.split("|")[0].trim()),t=t.replace(/,/g," ").replace(/ +/g," ").split(" "),i[s])if(Array.isArray(i[s])){const e=[];i[s].forEach((n=>{let i={};if(1!==t.length||"*"!==t[0]&&"all"!==t[0]?t.forEach((e=>{({}).hasOwnProperty.call(n,e)&&(i[e]=n[e])})):i=n,r&&2===a.length){if({}.hasOwnProperty.call(i,a[0].trim())){const t=i[a[0].trim()];"number"==typeof t?t===parseFloat(a[1].trim())&&e.push(i):"string"==typeof t&&t.toLowerCase()===a[1].trim().toLowerCase()&&e.push(i)}}else e.push(i)})),o[n]=e}else{const e={};t.forEach((t=>{({}).hasOwnProperty.call(i[s],t)&&(e[t]=i[s][t])})),o[n]=e}else o[n]={}}s++}n&&n(o),r(o)}))}))}))}I&&i.getCodepage(),t.version=A,t.system=o.system,t.bios=o.bios,t.baseboard=o.baseboard,t.chassis=o.chassis,t.time=s.time,t.osInfo=s.osInfo,t.versions=s.versions,t.shell=s.shell,t.uuid=s.uuid,t.cpu=a.cpu,t.cpuFlags=a.cpuFlags,t.cpuCache=a.cpuCache,t.cpuCurrentSpeed=a.cpuCurrentSpeed,t.cpuTemperature=a.cpuTemperature,t.currentLoad=a.currentLoad,t.fullLoad=a.fullLoad,t.mem=c.mem,t.memLayout=c.memLayout,t.battery=u,t.graphics=l.graphics,t.fsSize=p.fsSize,t.fsOpenFiles=p.fsOpenFiles,t.blockDevices=p.blockDevices,t.fsStats=p.fsStats,t.disksIO=p.disksIO,t.diskLayout=p.diskLayout,t.networkInterfaceDefault=f.networkInterfaceDefault,t.networkGatewayDefault=f.networkGatewayDefault,t.networkInterfaces=f.networkInterfaces,t.networkStats=f.networkStats,t.networkConnections=f.networkConnections,t.wifiNetworks=d.wifiNetworks,t.wifiInterfaces=d.wifiInterfaces,t.wifiConnections=d.wifiConnections,t.services=h.services,t.processes=h.processes,t.processLoad=h.processLoad,t.users=m.users,t.inetChecksite=g.inetChecksite,t.inetLatency=g.inetLatency,t.dockerInfo=v.dockerInfo,t.dockerImages=v.dockerImages,t.dockerContainers=v.dockerContainers,t.dockerContainerStats=v.dockerContainerStats,t.dockerContainerProcesses=v.dockerContainerProcesses,t.dockerVolumes=v.dockerVolumes,t.dockerAll=v.dockerAll,t.vboxInfo=y.vboxInfo,t.printer=_.printer,t.usb=E.usb,t.audio=b.audio,t.bluetoothDevices=w.bluetoothDevices,t.getStaticData=N,t.getDynamicData=P,t.getAllData=function(e,t,n){return new Promise((r=>{process.nextTick((()=>{let o={};t&&i.isFunction(t)&&!n&&(n=t,t=""),e&&i.isFunction(e)&&!t&&!n&&(n=e,e="",t=""),N().then((i=>{o=i,P(e,t).then((e=>{for(let t in e)({}).hasOwnProperty.call(e,t)&&(o[t]=e[t]);n&&n(o),r(o)}))}))}))}))},t.get=L,t.observe=function(e,t,n){let r=null;return setInterval((()=>{L(e).then((e=>{JSON.stringify(r)!==JSON.stringify(e)&&(r=Object.assign({},e),n(e))}))}),t)}},2795:(e,t,n)=>{"use strict";const r=n(1453);let i=process.platform;const o="linux"===i,s="darwin"===i,a="win32"===i,c="freebsd"===i,u="openbsd"===i,l="netbsd"===i,p="sunos"===i;t.inetChecksite=function(e,t){return new Promise((i=>{process.nextTick((()=>{let f={url:e,ok:!1,status:404,ms:null};if("string"!=typeof e)return t&&t(f),i(f);let d="";const h=r.sanitizeShellString(e,!0);for(let e=0;e<=r.mathMin(h.length,2e3);e++)if(void 0!==h[e]){h[e].__proto__.toLowerCase=r.stringToLower;const t=h[e].toLowerCase();t&&t[0]&&!t[1]&&1===t[0].length&&(d+=t[0])}f.url=d;try{if(d&&!r.isPrototypePolluted()){if(d.__proto__.startsWith=r.stringStartWith,d.startsWith("file:")||d.startsWith("gopher:")||d.startsWith("telnet:")||d.startsWith("mailto:")||d.startsWith("news:")||d.startsWith("nntp:"))return t&&t(f),i(f);let e=Date.now();if(o||c||u||l||s||p){let n=["-I","--connect-timeout","5","-m","5"];n.push(d);let o="curl";r.execSafe(o,n).then((n=>{const r=n.split("\n");let o=r[0]&&r[0].indexOf(" ")>=0?parseInt(r[0].split(" ")[1],10):404;f.status=o||404,f.ok=200===o||301===o||302===o||304===o,f.ms=f.ok?Date.now()-e:null,t&&t(f),i(f)}))}if(a){const r=d.startsWith("https:")?n(7211):n(8605);try{r.get(d,(n=>{const r=n.statusCode;f.status=r||404,f.ok=200===r||301===r||302===r||304===r,200!==r?(n.resume(),f.ms=f.ok?Date.now()-e:null,t&&t(f),i(f)):(n.on("data",(()=>{})),n.on("end",(()=>{f.ms=f.ok?Date.now()-e:null,t&&t(f),i(f)})))})).on("error",(()=>{t&&t(f),i(f)}))}catch(e){t&&t(f),i(f)}}}else t&&t(f),i(f)}catch(e){t&&t(f),i(f)}}))}))},t.inetLatency=function(e,t){return r.isFunction(e)&&!t&&(t=e,e=""),e=e||"8.8.8.8",new Promise((n=>{process.nextTick((()=>{if("string"!=typeof e)return t&&t(null),n(null);let i="";const f=(r.isPrototypePolluted()?"8.8.8.8":r.sanitizeShellString(e,!0)).trim();for(let e=0;e<=r.mathMin(f.length,2e3);e++)if(void 0!==f[e]){f[e].__proto__.toLowerCase=r.stringToLower;const t=f[e].toLowerCase();t&&t[0]&&!t[1]&&(i+=t[0])}if(i.__proto__.startsWith=r.stringStartWith,i.startsWith("file:")||i.startsWith("gopher:")||i.startsWith("telnet:")||i.startsWith("mailto:")||i.startsWith("news:")||i.startsWith("nntp:"))return t&&t(null),n(null);let d,h;if((o||c||u||l||s)&&(o&&(d=["-c","2","-w","3",i],h="rtt"),(c||u||l)&&(d=["-c","2","-t","3",i],h="round-trip"),s&&(d=["-c2","-t3",i],h="avg"),r.execSafe("ping",d).then((e=>{let r=null;if(e){const t=e.split("\n").filter((e=>e.indexOf(h)>=0)).join("\n").split("=");if(t.length>1){const e=t[1].split("/");e.length>1&&(r=parseFloat(e[1]))}}t&&t(r),n(r)}))),p){const e=["-s","-a",i,"56","2"],o="avg";r.execSafe("ping",e,{timeout:3e3}).then((e=>{let r=null;if(e){const t=e.split("\n").filter((e=>e.indexOf(o)>=0)).join("\n").split("=");if(t.length>1){const e=t[1].split("/");e.length>1&&(r=parseFloat(e[1].replace(",",".")))}}t&&t(r),n(r)}))}if(a){let e=null;try{const o=[i,"-n","1"];r.execSafe("ping",o,r.execOptsWin).then((r=>{if(r){let t=r.split("\r\n");t.shift(),t.forEach((function(t){if(3===(t.toLowerCase().match(/ms/g)||[]).length){let n=t.replace(/ +/g," ").split(" ");n.length>6&&(e=parseFloat(n[n.length-1]))}}))}t&&t(e),n(e)}))}catch(r){t&&t(e),n(e)}}}))}))}},6144:(e,t,n)=>{"use strict";const r=n(2087),i=n(3129).exec,o=n(3129).execSync,s=n(1453),a=n(5747);let c=process.platform;const u="linux"===c,l="darwin"===c,p="win32"===c,f="freebsd"===c,d="openbsd"===c,h="netbsd"===c,m="sunos"===c,g={"0x014F":"Transcend Information","0x2C00":"Micron Technology Inc.","0x802C":"Micron Technology Inc.","0x80AD":"Hynix Semiconductor Inc.","0x80CE":"Samsung Electronics Inc.","0xAD00":"Hynix Semiconductor Inc.","0xCE00":"Samsung Electronics Inc.","0x02FE":"Elpida","0x5105":"Qimonda AG i. In.","0x8551":"Qimonda AG i. In.","0x859B":"Crucial","0x04CD":"G-Skill"},v={"017A":"Apacer","0198":"HyperX","029E":"Corsair","04CB":"A-DATA","04CD":"G-Skill","059B":"Crucial","00CE":"Samsung",1315:"Crutial","014F":"Transcend Information","2C00":"Micron Technology Inc.","802C":"Micron Technology Inc.","80AD":"Hynix Semiconductor Inc.","80CE":"Samsung Electronics Inc.",AD00:"Hynix Semiconductor Inc.",CE00:"Samsung Electronics Inc.","02FE":"Elpida",5105:"Qimonda AG i. In.",8551:"Qimonda AG i. In.","859B":"Crucial"};t.mem=function(e){return new Promise((t=>{process.nextTick((()=>{let n={total:r.totalmem(),free:r.freemem(),used:r.totalmem()-r.freemem(),active:r.totalmem()-r.freemem(),available:r.freemem(),buffers:0,cached:0,slab:0,buffcache:0,swaptotal:0,swapused:0,swapfree:0};if(u&&a.readFile("/proc/meminfo",(function(i,o){if(!i){const e=o.toString().split("\n");n.total=parseInt(s.getValue(e,"memtotal"),10),n.total=n.total?1024*n.total:r.totalmem(),n.free=parseInt(s.getValue(e,"memfree"),10),n.free=n.free?1024*n.free:r.freemem(),n.used=n.total-n.free,n.buffers=parseInt(s.getValue(e,"buffers"),10),n.buffers=n.buffers?1024*n.buffers:0,n.cached=parseInt(s.getValue(e,"cached"),10),n.cached=n.cached?1024*n.cached:0,n.slab=parseInt(s.getValue(e,"slab"),10),n.slab=n.slab?1024*n.slab:0,n.buffcache=n.buffers+n.cached+n.slab;let t=parseInt(s.getValue(e,"memavailable"),10);n.available=t?1024*t:n.free+n.buffcache,n.active=n.total-n.available,n.swaptotal=parseInt(s.getValue(e,"swaptotal"),10),n.swaptotal=n.swaptotal?1024*n.swaptotal:0,n.swapfree=parseInt(s.getValue(e,"swapfree"),10),n.swapfree=n.swapfree?1024*n.swapfree:0,n.swapused=n.swaptotal-n.swapfree}e&&e(n),t(n)})),(f||d||h)&&i('/sbin/sysctl -a 2>/dev/null | grep -E "hw.realmem|hw.physmem|vm.stats.vm.v_page_count|vm.stats.vm.v_wire_count|vm.stats.vm.v_active_count|vm.stats.vm.v_inactive_count|vm.stats.vm.v_cache_count|vm.stats.vm.v_free_count|vm.stats.vm.v_page_size"',(function(r,i){if(!r){let e=i.toString().split("\n");const t=parseInt(s.getValue(e,"vm.stats.vm.v_page_size"),10),r=parseInt(s.getValue(e,"vm.stats.vm.v_inactive_count"),10)*t,o=parseInt(s.getValue(e,"vm.stats.vm.v_cache_count"),10)*t;n.total=parseInt(s.getValue(e,"hw.realmem"),10),isNaN(n.total)&&(n.total=parseInt(s.getValue(e,"hw.physmem"),10)),n.free=parseInt(s.getValue(e,"vm.stats.vm.v_free_count"),10)*t,n.buffcache=r+o,n.available=n.buffcache+n.free,n.active=n.total-n.free-n.buffcache,n.swaptotal=0,n.swapfree=0,n.swapused=0}e&&e(n),t(n)})),m&&(e&&e(n),t(n)),l&&i('vm_stat 2>/dev/null | grep "Pages active"',(function(r,o){if(!r){let e=o.toString().split("\n");n.active=4096*parseInt(e[0].split(":")[1],10),n.buffcache=n.used-n.active,n.available=n.free+n.buffcache}i("sysctl -n vm.swapusage 2>/dev/null",(function(r,i){if(!r){let e=i.toString().split("\n");if(e.length>0){let t=e[0].replace(/,/g,".").replace(/M/g,"");t=t.trim().split(" ");for(let e=0;e{if(!s){o.split("\r\n").filter((e=>""!==e.trim())).filter(((e,t)=>t>0)).forEach((function(e){""!==e&&(e=e.trim().split(/\s\s+/),r+=parseInt(e[0],10),i+=parseInt(e[1],10))}))}n.swaptotal=1024*r*1024,n.swapused=1024*i*1024,n.swapfree=n.swaptotal-n.swapused,e&&e(n),t(n)}))}catch(r){e&&e(n),t(n)}}}))}))},t.memLayout=function(e){function t(e){const t=e.replace("0x","").toUpperCase();return 4===t.length&&{}.hasOwnProperty.call(v,t)?v[t]:e}return new Promise((n=>{process.nextTick((()=>{let a=[];if((u||f||d||h)&&i('export LC_ALL=C; dmidecode -t memory 2>/dev/null | grep -iE "Size:|Type|Speed|Manufacturer|Form Factor|Locator|Memory Device|Serial Number|Voltage|Part Number"; unset LC_ALL',(function(i,c){if(!i){let e=c.toString().split("Memory Device");e.shift(),e.forEach((function(e){let n=e.split("\n");const r=s.getValue(n,"Size"),i=r.indexOf("GB")>=0?1024*parseInt(r,10)*1024*1024:1024*parseInt(r,10)*1024;if(parseInt(s.getValue(n,"Size"),10)>0){const e=s.toInt(s.getValue(n,"Total Width")),r=s.toInt(s.getValue(n,"Data Width"));a.push({size:i,bank:s.getValue(n,"Bank Locator"),type:s.getValue(n,"Type:"),ecc:!(!r||!e)&&e>r,clockSpeed:s.getValue(n,"Configured Clock Speed:")?parseInt(s.getValue(n,"Configured Clock Speed:"),10):s.getValue(n,"Speed:")?parseInt(s.getValue(n,"Speed:"),10):null,formFactor:s.getValue(n,"Form Factor:"),manufacturer:t(s.getValue(n,"Manufacturer:")),partNum:s.getValue(n,"Part Number:"),serialNum:s.getValue(n,"Serial Number:"),voltageConfigured:parseFloat(s.getValue(n,"Configured Voltage:")||null),voltageMin:parseFloat(s.getValue(n,"Minimum Voltage:")||null),voltageMax:parseFloat(s.getValue(n,"Maximum Voltage:")||null)})}else a.push({size:0,bank:s.getValue(n,"Bank Locator"),type:"Empty",ecc:null,clockSpeed:0,formFactor:s.getValue(n,"Form Factor:"),partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}))}if(!a.length){a.push({size:r.totalmem(),bank:"",type:"",ecc:null,clockSpeed:0,formFactor:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null});try{let e=o("cat /proc/cpuinfo 2>/dev/null"),t=e.toString().split("\n"),n=s.getValue(t,"hardware",":",!0).toUpperCase(),r=s.getValue(t,"revision",":",!0).toLowerCase();if("BCM2835"===n||"BCM2708"===n||"BCM2709"===n||"BCM2835"===n||"BCM2837"===n){const n={0:400,1:450,2:450,3:3200};a[0].type="LPDDR2",a[0].type=r&&r[2]&&"3"===r[2]?"LPDDR4":a[0].type,a[0].ecc=!1,a[0].clockSpeed=r&&r[2]&&n[r[2]]||400,a[0].clockSpeed=r&&r[4]&&"d"===r[4]?"500":a[0].clockSpeed,a[0].formFactor="SoC",e=o("vcgencmd get_config sdram_freq 2>/dev/null"),t=e.toString().split("\n");let i=parseInt(s.getValue(t,"sdram_freq","=",!0),10)||0;i&&(a.clockSpeed=i),e=o("vcgencmd measure_volts sdram_p 2>/dev/null"),t=e.toString().split("\n");let c=parseFloat(s.getValue(t,"volt","=",!0))||0;c&&(a[0].voltageConfigured=c,a[0].voltageMin=c,a[0].voltageMax=c)}}catch(e){s.noop()}}e&&e(a),n(a)})),l&&i("system_profiler SPMemoryDataType",(function(t,r){if(!t){const e=r.toString().split("\n"),t=s.getValue(e,"ecc",":",!0).toLowerCase();let n=r.toString().split(" BANK "),i=!0;1===n.length&&(n=r.toString().split(" DIMM"),i=!1),n.shift(),n.forEach((function(e){let n=e.split("\n");const r=(i?"BANK ":"DIMM")+n[0].trim().split("/")[0],o=parseInt(s.getValue(n," Size"));var c;o?a.push({size:1024*o*1024*1024,bank:r,type:s.getValue(n," Type:"),ecc:t?"enabled"===t:null,clockSpeed:parseInt(s.getValue(n," Speed:"),10),formFactor:"",manufacturer:(c=s.getValue(n," Manufacturer:"),{}.hasOwnProperty.call(g,c)?g[c]:c),partNum:s.getValue(n," Part Number:"),serialNum:s.getValue(n," Serial Number:"),voltageConfigured:null,voltageMin:null,voltageMax:null}):a.push({size:0,bank:r,type:"Empty",ecc:null,clockSpeed:0,formFactor:"",manufacturer:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}))}if(!a.length){const e=r.toString().split("\n"),t=parseInt(s.getValue(e," Memory:")),n=s.getValue(e," Type:");t&&n&&a.push({size:1024*t*1024*1024,bank:0,type:n,ecc:!1,clockSpeed:0,formFactor:"",manufacturer:"Apple",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}e&&e(a),n(a)})),m&&(e&&e(a),n(a)),p){const t="Unknown|Other|DRAM|Synchronous DRAM|Cache DRAM|EDO|EDRAM|VRAM|SRAM|RAM|ROM|FLASH|EEPROM|FEPROM|EPROM|CDRAM|3DRAM|SDRAM|SGRAM|RDRAM|DDR|DDR2|DDR2 FB-DIMM|Reserved|DDR3|FBD2|DDR4|LPDDR|LPDDR2|LPDDR3|LPDDR4".split("|"),r="Unknown|Other|SIP|DIP|ZIP|SOJ|Proprietary|SIMM|DIMM|TSOP|PGA|RIMM|SODIMM|SRIMM|SMD|SSMP|QFP|TQFP|SOIC|LCC|PLCC|BGA|FPBGA|LGA".split("|");try{s.wmic("memorychip get /value").then(((i,o)=>{if(!o){let e=i.toString().split("BankL");e.shift(),e.forEach((function(e){let n=e.split("\r\n");const i=s.toInt(s.getValue(n,"DataWidth","=")),o=s.toInt(s.getValue(n,"TotalWidth","="));a.push({size:parseInt(s.getValue(n,"Capacity","="),10)||0,bank:s.getValue(n,"abel","="),type:t[parseInt(s.getValue(n,"MemoryType","="),10)],ecc:!(!i||!o)&&o>i,clockSpeed:parseInt(s.getValue(n,"ConfiguredClockSpeed","="),10)||0,formFactor:r[parseInt(s.getValue(n,"FormFactor","="),10)||0],manufacturer:s.getValue(n,"Manufacturer","="),partNum:s.getValue(n,"PartNumber","="),serialNum:s.getValue(n,"SerialNumber","="),voltageConfigured:(parseInt(s.getValue(n,"ConfiguredVoltage","="),10)||0)/1e3,voltageMin:(parseInt(s.getValue(n,"MinVoltage","="),10)||0)/1e3,voltageMax:(parseInt(s.getValue(n,"MaxVoltage","="),10)||0)/1e3})}))}e&&e(a),n(a)}))}catch(t){e&&e(a),n(a)}}}))}))}},6926:(e,t,n)=>{"use strict";const r=n(2087),i=n(3129).exec,o=n(3129).execSync,s=n(5747),a=n(1453);let c=process.platform;const u="linux"===c,l="darwin"===c,p="win32"===c,f="freebsd"===c,d="openbsd"===c,h="netbsd"===c,m="sunos"===c;let g,v={},y="",_={},E=[],b=[],w={};function S(){let e=r.networkInterfaces(),t="",n="",i=9999;for(let r in e)({}).hasOwnProperty.call(e,r)&&e[r].forEach((function(e){e&&!1===e.internal&&(n=n||r,e.scopeid&&e.scopeid{if((e=e.replace(/\s+/g," ").trim()).indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(e)){const t=e.split(" ");t.length>=5&&(n=t[t.length-2])}})),n)for(let r in e)({}).hasOwnProperty.call(e,r)&&e[r].forEach((function(e){e&&e.address&&e.address===n&&(t=r)}))}if(u){let e=o("ip route 2> /dev/null | grep default").toString().split("\n")[0].split(/\s+/);"none"===e[0]&&e[5]?t=e[5]:e[4]&&(t=e[4]),t.indexOf(":")>-1&&(t=t.split(":")[1].trim())}if(l||f||d||h||m){let e="";u&&(e="ip route 2> /dev/null | grep default | awk '{print $5}'"),l&&(e="route -n get default 2>/dev/null | grep interface: | awk '{print $2}'"),(f||d||h||m)&&(e="route get 0.0.0.0 | grep interface:");let n=o(e);t=n.toString().split("\n")[0],t.indexOf(":")>-1&&(t=t.split(":")[1].trim())}}catch(e){a.noop()}return t&&(y=t),y}function I(){let e="",t="",n={};if(u||f||d||h){if(void 0===g)try{const e=o("which ip").toString().split("\n");g=e.length&&-1===e[0].indexOf(":")&&0===e[0].indexOf("/")?e[0]:""}catch(e){g=""}try{const r=o("export LC_ALL=C; "+(g?g+" link show up":"/sbin/ifconfig")+"; unset LC_ALL").toString().split("\n");for(let i=0;i0?e=r[i].split(":")[0]:0===r[i].indexOf("\tether ")&&(t=r[i].split("\tether ")[1],e&&t&&(n[e]=t.trim(),e="",t=""))}catch(e){a.noop()}return n}function C(){const e=a.getWmic()+" nic get MACAddress, name, NetConnectionId, NetEnabled, Speed, NetConnectionStatus, AdapterTypeId /value",t=a.getWmic()+" nicconfig get dhcpEnabled /value";try{const n=o(e,a.execOptsWin).split(/\n\s*\n/);return function(e,t){let n=[];for(let r in e)if({}.hasOwnProperty.call(e,r)&&""!==e[r].trim()){let i=e[r].trim().split("\r\n"),o=t[r].trim().split("\r\n"),s=a.getValue(i,"NetEnabled","="),c="9"===a.getValue(i,"AdapterTypeID","=")?"wireless":"wired",u=a.getValue(i,"Name","=").replace(/\]/g,")").replace(/\[/g,"("),l=a.getValue(i,"NetConnectionID","=").replace(/\]/g,")").replace(/\[/g,"(");if((u.toLowerCase().indexOf("wi-fi")>=0||u.toLowerCase().indexOf("wireless")>=0)&&(c="wireless"),""!==s){const e=parseInt(a.getValue(i,"speed","=").trim(),10)/1e6;n.push({mac:a.getValue(i,"MACAddress","=").toLowerCase(),dhcp:a.getValue(o,"dhcpEnabled","=").toLowerCase(),name:u,iface:l,netEnabled:"TRUE"===s,speed:isNaN(e)?null:e,operstate:"2"===a.getValue(i,"NetConnectionStatus","=")?"up":"down",type:c})}}return n}(n,o(t,a.execOptsWin).split(/\n\s*\n/))}catch(e){return[]}}function x(e,t){let n="";const r=t+".";try{const t=e.filter((e=>r.includes(e.name+"."))).map((e=>e.dnsSuffix));return t[0]&&(n=t[0]),n||(n=""),n}catch(e){return"Unknown"}}function O(e,t,n){let r={state:"Unknown",protocol:"Unknown"};if("Disabled"===n)return r.state="Disabled",r.protocol="Not defined",r;if("wired"==e&&n.length>0)try{const e=n.find((e=>e.includes(t+"\r\n"))).split("\r\n"),i=e.find((e=>e.includes("802.1x")));if(i.includes("Disabled"))r.state="Disabled",r.protocol="Not defined";else if(i.includes("Enabled")){const t=e.find((e=>e.includes("EAP")));r.protocol=t.split(":").pop(),r.state="Enabled"}}catch(e){return r}else if("wireless"==e){let e="",n="";try{const i=function(e){try{return o(`netsh wlan show interface name="${e}" | findstr "SSID"`,a.execOptsWin).split("\r\n").shift().split(":").pop()}catch(e){return"Unknown"}}(t);"Unknown"!==i&&(e=o(`netsh wlan show profiles "${i}" | findstr "802.1X"`,a.execOptsWin),n=o(`netsh wlan show profiles "${i}" | findstr "EAP"`,a.execOptsWin)),e.includes(":")&&n.includes(":")&&(r.state=e.split(":").pop(),r.protocol=n.split(":").pop())}catch(e){return 1===e.status&&e.stdout.includes("AutoConfig")&&(r.state="Disabled",r.protocol="Not defined"),r}}return r}function T(e){const t=[];let n=[];return e.forEach((function(e){e.startsWith("\t")||e.startsWith(" ")||n.length&&(t.push(n),n=[]),n.push(e)})),n.length&&t.push(n),t}function A(){try{const e=o("/sbin/ifconfig -v",{maxBuffer:2048e4}).toString().split("\n");return function(e){let t=[];return e.forEach((e=>{let n={iface:"",mtu:null,mac:"",ip6:"",ip4:"",speed:null,type:"",operstate:"",duplex:"",internal:!1};const r=e[0];n.iface=r.split(":")[0].trim();let i=r.split("> mtu");n.mtu=i.length>1?parseInt(i[1],10):null,isNaN(n.mtu)&&(n.mtu=null),n.internal=i[0].toLowerCase().indexOf("loopback")>-1,e.forEach((e=>{e.trim().startsWith("ether ")&&(n.mac=e.split("ether ")[1].toLowerCase().trim()),e.trim().startsWith("inet6 ")&&!n.ip6&&(n.ip6=e.split("inet6 ")[1].toLowerCase().split("%")[0].split(" ")[0]),e.trim().startsWith("inet ")&&!n.ip4&&(n.ip4=e.split("inet ")[1].toLowerCase().split(" ")[0])}));let o=a.getValue(e,"link rate");n.speed=o?parseFloat(o):null,null===n.speed?(o=a.getValue(e,"uplink rate"),n.speed=o?parseFloat(o):null,null!==n.speed&&o.toLowerCase().indexOf("gbps")>=0&&(n.speed=1e3*n.speed)):o.toLowerCase().indexOf("gbps")>=0&&(n.speed=1e3*n.speed),n.type=a.getValue(e,"type").toLowerCase().indexOf("wi-fi")>-1?"wireless":"wired",n.operstate=a.getValue(e,"status").toLowerCase().indexOf("active")>-1?"up":"down",n.duplex=a.getValue(e,"media").toLowerCase().indexOf("half-duplex")>-1?"half":"full",(n.ip6||n.ip4||n.mac)&&t.push(n)})),t}(T(e))}catch(e){return[]}}function N(e){const t=`nmcli device status 2>/dev/null | grep ${e}`;try{const e=o(t).toString().replace(/\s+/g," ").trim(),n=e.split(" ").slice(3).join(" ");return"--"!=n?n:""}catch(e){return""}}function P(e){let t=[];try{let n=`cat ${e} 2> /dev/null | grep 'iface\\|source'`;o(n,{maxBuffer:2048e4}).toString().split("\n").forEach((e=>{const n=e.replace(/\s+/g," ").trim().split(" ");if(n.length>=4&&e.toLowerCase().indexOf(" inet ")>=0&&e.toLowerCase().indexOf("dhcp")>=0&&t.push(n[1]),e.toLowerCase().includes("source")){let n=e.split(" ")[1];t=t.concat(P(n))}}))}catch(e){a.noop()}return t}function L(){let e=[];try{const t=o("ip a 2> /dev/null",{maxBuffer:2048e4}).toString().split("\n");e=function(e){const t=[];e&&e.length&&e.forEach((e=>{if(e&&e.length){if(e[0].split(":").length>2)for(let n of e)if(n.indexOf(" inet ")>=0&&n.indexOf(" dynamic ")>=0){const e=n.split(" "),r=e[e.length-1].trim();t.push(r);break}}}));return t}(T(t))}catch(e){a.noop()}try{e=P("/etc/network/interfaces")}catch(e){a.noop()}return e}function R(e,t,n){let r=!1;if(!t)return n.indexOf(e)>=0;{const i=`nmcli connection show "${t}" 2>/dev/null | grep ipv4.method;`;try{const e=o(i).toString();switch(e.replace(/\s+/g," ").trim().split(" ").slice(1).toString()){case"auto":r=!0;break;default:r=!1}return r}catch(t){return n.indexOf(e)>=0}}}function k(e){let t=!1;const n=`ipconfig getpacket "${e}" 2>/dev/null | grep lease_time;`;try{const e=o(n).toString().split("\n");e.length&&e[0].startsWith("lease_time")&&(t=!0)}catch(e){a.noop()}return t}function D(e){if(!e)return"Unknown";{const t=`nmcli connection show "${e}" 2>/dev/null | grep ipv4.dns-search;`;try{const e=o(t).toString(),n=e.replace(/\s+/g," ").trim().split(" ").slice(1).toString();return"--"==n?"Not defined":n}catch(e){return"Unknown"}}}function M(e){if(!e)return"Not defined";{const t=`nmcli connection show "${e}" 2>/dev/null | grep 802-1x.eap;`;try{const e=o(t).toString(),n=e.replace(/\s+/g," ").trim().split(" ").slice(1).toString();return"--"==n?"":n}catch(e){return"Not defined"}}}function V(e,t,n){return!!n&&(["00:00:00:00:00:00","00:03:FF","00:05:69","00:0C:29","00:0F:4B","00:0F:4B","00:13:07","00:13:BE","00:15:5d","00:16:3E","00:1C:42","00:21:F6","00:21:F6","00:24:0B","00:24:0B","00:50:56","00:A0:B1","00:E0:C8","08:00:27","0A:00:27","18:92:2C","16:DF:49","3C:F3:92","54:52:00","FC:15:97"].filter((e=>n.toUpperCase().toUpperCase().startsWith(e.substr(0,n.length)))).length>0||e.toLowerCase().indexOf(" virtual ")>-1||t.toLowerCase().indexOf(" virtual ")>-1||e.toLowerCase().indexOf("vethernet ")>-1||t.toLowerCase().indexOf("vethernet ")>-1||e.toLowerCase().startsWith("veth")||t.toLowerCase().startsWith("veth")||e.toLowerCase().startsWith("vboxnet")||t.toLowerCase().startsWith("vboxnet"))}function F(e,t=!0){return"boolean"==typeof e&&(t=e,e=null),new Promise((n=>{process.nextTick((()=>{let i=r.networkInterfaces(),s=[],c=[],m=[],g=[];if(l||f||d||h)c=A(),c.forEach((e=>{({}).hasOwnProperty.call(i,e.iface)&&i[e.iface].forEach((function(t){"IPv4"===t.family&&(e.ip4subnet=t.netmask),"IPv6"===t.family&&(e.ip6subnet=t.netmask)})),s.push({iface:e.iface,ifaceName:e.iface,ip4:e.ip4,ip4subnet:e.ip4subnet||"",ip6:e.ip6,ip6subnet:e.ip6subnet||"",mac:e.mac,internal:e.internal,virtual:!e.internal&&V(e.iface,e.iface,e.mac),operstate:e.operstate,type:e.type,duplex:e.duplex,mtu:e.mtu,speed:e.speed,dhcp:k(e.iface),dnsSuffix:"",ieee8021xAuth:"",ieee8021xState:"",carrierChanges:0})})),b=s,e&&e(s),n(s);else if(JSON.stringify(i)!==JSON.stringify(_)||t){_=Object.assign({},i),p&&(c=C(),c.forEach((e=>{let t=!1;Object.keys(i).forEach((n=>{t||i[n].forEach((n=>{Object.keys(n).indexOf("mac")>=0&&(t=n.mac===e.mac)}))})),t||(i[e.name]=[{mac:e.mac}])})),g=function(){try{return o("netsh lan show profiles",a.execOptsWin).split("\r\nProfile on interface")}catch(e){return 1===e.status&&e.stdout.includes("AutoConfig")?"Disabled":[]}}(),m=function(){let e={},t={primaryDNS:"",exitCode:0,ifaces:[]};try{return o("ipconfig /all",a.execOptsWin).split("\r\n\r\n").forEach(((n,r)=>{if(1==r){const e=n.split("\r\n").filter((e=>e.toUpperCase().includes("DNS"))),r=e[0].substring(e[0].lastIndexOf(":")+1);t.primaryDNS=r.trim(),t.primaryDNS||(t.primaryDNS="Not defined")}if(r>1)if(r%2==0){const t=n.substring(n.lastIndexOf(" ")+1).replace(":","");e.name=t}else{const r=n.split("\r\n").filter((e=>e.toUpperCase().includes("DNS"))),i=r[0].substring(r[0].lastIndexOf(":")+1);e.dnsSuffix=i.trim(),t.ifaces.push(e),e={}}})),t}catch(e){return{primaryDNS:"",exitCode:0,ifaces:[]}}}()),u&&(E=L());for(let e in i){let t=e,n="",r="",f="",d="",h="",y="",_="",b=null,S=0,C="down",T=!1,A="",P="",L="",k="";if({}.hasOwnProperty.call(i,e)){let F=e;if(i[e].forEach((function(t){"IPv4"===t.family&&(n=t.address,r=t.netmask),"IPv6"===t.family&&(f&&!f.match(/^fe80::/i)||(f=t.address,d=t.netmask)),h=t.mac;const i=parseInt(process.versions.node.split("."),10);h.indexOf("00:00:0")>-1&&(u||l)&&!t.internal&&i>=8&&i<=11&&(0===Object.keys(w).length&&(w=I()),h=w[e]||"")})),u){let t=e.split(":")[0].trim().toLowerCase();const n=`echo -n "addr_assign_type: "; cat /sys/class/net/${t}/addr_assign_type 2>/dev/null; echo;\n echo -n "address: "; cat /sys/class/net/${t}/address 2>/dev/null; echo;\n echo -n "addr_len: "; cat /sys/class/net/${t}/addr_len 2>/dev/null; echo;\n echo -n "broadcast: "; cat /sys/class/net/${t}/broadcast 2>/dev/null; echo;\n echo -n "carrier: "; cat /sys/class/net/${t}/carrier 2>/dev/null; echo;\n echo -n "carrier_changes: "; cat /sys/class/net/${t}/carrier_changes 2>/dev/null; echo;\n echo -n "dev_id: "; cat /sys/class/net/${t}/dev_id 2>/dev/null; echo;\n echo -n "dev_port: "; cat /sys/class/net/${t}/dev_port 2>/dev/null; echo;\n echo -n "dormant: "; cat /sys/class/net/${t}/dormant 2>/dev/null; echo;\n echo -n "duplex: "; cat /sys/class/net/${t}/duplex 2>/dev/null; echo;\n echo -n "flags: "; cat /sys/class/net/${t}/flags 2>/dev/null; echo;\n echo -n "gro_flush_timeout: "; cat /sys/class/net/${t}/gro_flush_timeout 2>/dev/null; echo;\n echo -n "ifalias: "; cat /sys/class/net/${t}/ifalias 2>/dev/null; echo;\n echo -n "ifindex: "; cat /sys/class/net/${t}/ifindex 2>/dev/null; echo;\n echo -n "iflink: "; cat /sys/class/net/${t}/iflink 2>/dev/null; echo;\n echo -n "link_mode: "; cat /sys/class/net/${t}/link_mode 2>/dev/null; echo;\n echo -n "mtu: "; cat /sys/class/net/${t}/mtu 2>/dev/null; echo;\n echo -n "netdev_group: "; cat /sys/class/net/${t}/netdev_group 2>/dev/null; echo;\n echo -n "operstate: "; cat /sys/class/net/${t}/operstate 2>/dev/null; echo;\n echo -n "proto_down: "; cat /sys/class/net/${t}/proto_down 2>/dev/null; echo;\n echo -n "speed: "; cat /sys/class/net/${t}/speed 2>/dev/null; echo;\n echo -n "tx_queue_len: "; cat /sys/class/net/${t}/tx_queue_len 2>/dev/null; echo;\n echo -n "type: "; cat /sys/class/net/${t}/type 2>/dev/null; echo;\n echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${t}; echo;\n echo -n "wirelessspeed: "; iw dev ${t} link 2>&1 | grep bitrate; echo;`;let r=[];try{r=o(n).toString().split("\n");const e=N(t);T=R(t,e,E),A=D(e),P=M(e),L=(v=P)?"Not defined"==v?"Disabled":"Enabled":"Unknown"}catch(e){a.noop()}y=a.getValue(r,"duplex"),y=y.startsWith("cat")?"":y,_=parseInt(a.getValue(r,"mtu"),10);let i=parseInt(a.getValue(r,"speed"),10);b=isNaN(i)?null:i;let s=a.getValue(r,"wirelessspeed").split("tx bitrate: ");null===b&&2===s.length&&(i=parseFloat(s[1]),b=isNaN(i)?null:i),S=parseInt(a.getValue(r,"carrier_changes"),10),C=a.getValue(r,"operstate"),k="up"===C?a.getValue(r,"wireless").trim()?"wireless":"wired":"unknown",("lo"===t||t.startsWith("bond"))&&(k="virtual")}if(p){A=x(m.ifaces,e);let n=!1;c.forEach((e=>{e.mac!==h||n||(t=e.iface||t,F=e.name,T=e.dhcp,C=e.operstate,b=e.speed,k=e.type,n=!0)})),(e.toLowerCase().indexOf("wlan")>=0||F.toLowerCase().indexOf("wlan")>=0||F.toLowerCase().indexOf("802.11n")>=0||F.toLowerCase().indexOf("wireless")>=0||F.toLowerCase().indexOf("wi-fi")>=0||F.toLowerCase().indexOf("wifi")>=0)&&(k="wireless");const r=O(k,e,g);P=r.protocol,L=r.state}let j=!(!i[e]||!i[e][0])&&i[e][0].internal;(e.toLowerCase().indexOf("loopback")>-1||F.toLowerCase().indexOf("loopback")>-1)&&(j=!0);const B=!j&&V(e,F,h);s.push({iface:t,ifaceName:F,ip4:n,ip4subnet:r,ip6:f,ip6subnet:d,mac:h,internal:j,virtual:B,operstate:C,type:k,duplex:y,mtu:_,speed:b,dhcp:T,dnsSuffix:A,ieee8021xAuth:P,ieee8021xState:L,carrierChanges:S})}}b=s,e&&e(s),n(s)}else s=b,e&&e(s),n(s);var v}))}))}function j(e,t,n,r,i,o,s,a){let c={iface:e,operstate:r,rx_bytes:t,rx_dropped:i,rx_errors:o,tx_bytes:n,tx_dropped:s,tx_errors:a,rx_sec:null,tx_sec:null,ms:0};return v[e]&&v[e].ms?(c.ms=Date.now()-v[e].ms,c.rx_sec=t-v[e].rx_bytes>=0?(t-v[e].rx_bytes)/(c.ms/1e3):0,c.tx_sec=n-v[e].tx_bytes>=0?(n-v[e].tx_bytes)/(c.ms/1e3):0,v[e].rx_bytes=t,v[e].tx_bytes=n,v[e].rx_sec=c.rx_sec,v[e].tx_sec=c.tx_sec,v[e].ms=Date.now(),v[e].last_ms=c.ms,v[e].operstate=r):(v[e]||(v[e]={}),v[e].rx_bytes=t,v[e].tx_bytes=n,v[e].rx_sec=null,v[e].tx_sec=null,v[e].ms=Date.now(),v[e].last_ms=0,v[e].operstate=r),c}function B(e){return new Promise((t=>{process.nextTick((()=>{let n="";const r=a.isPrototypePolluted()?"---":a.sanitizeShellString(e);for(let e=0;e<=a.mathMin(r.length,2e3);e++)void 0!==r[e]&&(n+=r[e]);let o,c,m,g={iface:n,operstate:"unknown",rx_bytes:0,rx_dropped:0,rx_errors:0,tx_bytes:0,tx_dropped:0,tx_errors:0,rx_sec:null,tx_sec:null,ms:0},y="unknown",_=0,E=0,b=0,w=0,S=0,I=0;if(!v[n]||v[n]&&!v[n].ms||v[n]&&v[n].ms&&Date.now()-v[n].ms>=500){if(u&&(s.existsSync("/sys/class/net/"+n)?(o="cat /sys/class/net/"+n+"/operstate; cat /sys/class/net/"+n+"/statistics/rx_bytes; cat /sys/class/net/"+n+"/statistics/tx_bytes; cat /sys/class/net/"+n+"/statistics/rx_dropped; cat /sys/class/net/"+n+"/statistics/rx_errors; cat /sys/class/net/"+n+"/statistics/tx_dropped; cat /sys/class/net/"+n+"/statistics/tx_errors; ",i(o,(function(e,r){e||(c=r.toString().split("\n"),y=c[0].trim(),_=parseInt(c[1],10),E=parseInt(c[2],10),b=parseInt(c[3],10),w=parseInt(c[4],10),S=parseInt(c[5],10),I=parseInt(c[6],10),g=j(n,_,E,y,b,w,S,I)),t(g)}))):t(g)),(f||d||h)&&(o="netstat -ibndI "+n,i(o,(function(e,r){if(!e){c=r.toString().split("\n");for(let e=1;e1&&""!==c[1].trim())){m=c[1].replace(/ +/g," ").split(" ");const e=m.length>11?1:0;_=parseInt(m[e+5]),b=parseInt(m[e+10]),w=parseInt(m[e+4]),E=parseInt(m[e+8]),S=parseInt(m[e+10]),I=parseInt(m[e+7]),g=j(n,_,E,g.operstate,b,w,S,I)}t(g)}))}))),p){let e=[],r=n;a.wmic("path Win32_PerfRawData_Tcpip_NetworkInterface Get name,BytesReceivedPersec,BytesSentPersec,BytesTotalPersec,PacketsOutboundDiscarded,PacketsOutboundErrors,PacketsReceivedDiscarded,PacketsReceivedErrors /value").then(((i,o)=>{if(!o){const t=i.toString().split(/\n\s*\n/);e=function(e){let t=[];for(let n in e)if({}.hasOwnProperty.call(e,n)&&""!==e[n].trim()){let r=e[n].trim().split("\r\n");t.push({name:a.getValue(r,"Name","=").replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase(),rx_bytes:parseInt(a.getValue(r,"BytesReceivedPersec","="),10),rx_errors:parseInt(a.getValue(r,"PacketsReceivedErrors","="),10),rx_dropped:parseInt(a.getValue(r,"PacketsReceivedDiscarded","="),10),tx_bytes:parseInt(a.getValue(r,"BytesSentPersec","="),10),tx_errors:parseInt(a.getValue(r,"PacketsOutboundErrors","="),10),tx_dropped:parseInt(a.getValue(r,"PacketsOutboundDiscarded","="),10)})}return t}(t)}F(!1).then((i=>{_=0,E=0,e.forEach((e=>{i.forEach((t=>{t.iface.toLowerCase()!==n.toLowerCase()&&t.mac.toLowerCase()!==n.toLowerCase()&&t.ip4.toLowerCase()!==n.toLowerCase()&&t.ip6.toLowerCase()!==n.toLowerCase()&&t.ifaceName.replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase()!==n.replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase()||t.ifaceName.replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase()!==e.name||(r=t.iface,_=e.rx_bytes,b=e.rx_dropped,w=e.rx_errors,E=e.tx_bytes,S=e.tx_dropped,I=e.tx_errors,y=t.operstate)}))})),_&&E&&(g=j(r,parseInt(_),parseInt(E),y,b,w,S,I)),t(g)}))}))}}else g.rx_bytes=v[n].rx_bytes,g.tx_bytes=v[n].tx_bytes,g.rx_sec=v[n].rx_sec,g.tx_sec=v[n].tx_sec,g.ms=v[n].last_ms,g.operstate=v[n].operstate,t(g)}))}))}t.getDefaultNetworkInterface=S,t.networkInterfaceDefault=function(e){return new Promise((t=>{process.nextTick((()=>{let n=S();e&&e(n),t(n)}))}))},t.networkInterfaces=F,t.networkStats=function e(t,n){let r=[];return new Promise((i=>{process.nextTick((()=>{if(a.isFunction(t)&&!n)n=t,r=[S()];else{if("string"!=typeof t&&void 0!==t)return n&&n([]),i([]);(t=t||S()).__proto__.toLowerCase=a.stringToLower,t.__proto__.replace=a.stringReplace,t.__proto__.trim=a.stringTrim,t=t.trim().toLowerCase().replace(/,+/g,"|"),r=t.split("|")}const o=[],s=[];if(r.length&&"*"===r[0].trim())r=[],F(!1).then((t=>{for(let e of t)r.push(e.iface);e(r.join(",")).then((e=>{n&&n(e),i(e)}))}));else{for(let e of r)s.push(B(e.trim()));s.length?Promise.all(s).then((e=>{n&&n(e),i(e)})):(n&&n(o),i(o))}}))}))},t.networkConnections=function(e){return new Promise((t=>{process.nextTick((()=>{let n=[];if(u||f||d||h){let r='export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL';(f||d||h)&&(r='export LC_ALL=C; netstat -na | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL'),i(r,{maxBuffer:2048e4},(function(o,s){let a=s.toString().split("\n");!o&&(a.length>1||""!=a[0])?(a.forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=7){let t=e[3],r="",i=e[3].split(":");i.length>1&&(r=i[i.length-1],i.pop(),t=i.join(":"));let o=e[4],s="",a=e[4].split(":");a.length>1&&(s=a[a.length-1],a.pop(),o=a.join(":"));let c=e[5],u=e[6].split("/");c&&n.push({protocol:e[0],localAddress:t,localPort:r,peerAddress:o,peerPort:s,state:c,pid:u[0]&&"-"!==u[0]?parseInt(u[0],10):null,process:u[1]?u[1].split(" ")[0]:""})}})),e&&e(n),t(n)):(r='ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"',i(r,{maxBuffer:2048e4},(function(r,i){if(!r){i.toString().split("\n").forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=6){let t=e[4],r="",i=e[4].split(":");i.length>1&&(r=i[i.length-1],i.pop(),t=i.join(":"));let o=e[5],s="",a=e[5].split(":");a.length>1&&(s=a[a.length-1],a.pop(),o=a.join(":"));let c=e[1];"ESTAB"===c&&(c="ESTABLISHED"),"TIME-WAIT"===c&&(c="TIME_WAIT");let u=null,l="";if(e.length>=7&&e[6].indexOf("users:")>-1){let t=e[6].replace('users:(("',"").replace(/"/g,"").split(",");t.length>2&&(l=t[0].split(" ")[0],u=parseInt(t[1],10))}c&&n.push({protocol:e[0],localAddress:t,localPort:r,peerAddress:o,peerPort:s,state:c,pid:u,process:l})}}))}e&&e(n),t(n)})))}))}if(l){i('netstat -natv | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"',{maxBuffer:2048e4},(function(r,i){if(!r){i.toString().split("\n").forEach((function(e){if((e=e.replace(/ +/g," ").split(" ")).length>=8){let t=e[3],r="",i=e[3].split(".");i.length>1&&(r=i[i.length-1],i.pop(),t=i.join("."));let o=e[4],s="",a=e[4].split(".");a.length>1&&(s=a[a.length-1],a.pop(),o=a.join("."));let c=e[5],u=parseInt(e[8],10);c&&n.push({protocol:e[0],localAddress:t,localPort:r,peerAddress:o,peerPort:s,state:c,pid:u,process:""})}})),e&&e(n),t(n)}}))}if(p){let r="netstat -nao";try{i(r,a.execOptsWin,(function(r,i){if(!r){i.toString().split("\r\n").forEach((function(e){if((e=e.trim().replace(/ +/g," ").split(" ")).length>=4){let t=e[1],r="",i=e[1].split(":");i.length>1&&(r=i[i.length-1],i.pop(),t=i.join(":"));let o=e[2],s="",a=e[2].split(":");a.length>1&&(s=a[a.length-1],a.pop(),o=a.join(":"));let c=e[4],u=e[3];"HERGESTELLT"===u&&(u="ESTABLISHED"),u.startsWith("ABH")&&(u="LISTEN"),"SCHLIESSEN_WARTEN"===u&&(u="CLOSE_WAIT"),"WARTEND"===u&&(u="TIME_WAIT"),"SYN_GESENDET"===u&&(u="SYN_SENT"),"LISTENING"===u&&(u="LISTEN"),"SYN_RECEIVED"===u&&(u="SYN_RECV"),"FIN_WAIT_1"===u&&(u="FIN_WAIT1"),"FIN_WAIT_2"===u&&(u="FIN_WAIT2"),u&&n.push({protocol:e[0].toLowerCase(),localAddress:t,localPort:r,peerAddress:o,peerPort:s,state:u,pid:c,process:""})}})),e&&e(n),t(n)}}))}catch(r){e&&e(n),t(n)}}}))}))},t.networkGatewayDefault=function(e){return new Promise((t=>{process.nextTick((()=>{let n="";if(u||f||d||h){let r="ip route get 1";try{i(r,{maxBuffer:2048e4},(function(r,i){if(r)e&&e(n),t(n);else{let r=i.toString().split("\n");let o=(r&&r[0]?r[0]:"").split(" via ");o&&o[1]&&(o=o[1].split(" "),n=o[0]),e&&e(n),t(n)}}))}catch(r){e&&e(n),t(n)}}if(l){let r="route -n get default";try{i(r,{maxBuffer:2048e4},(function(r,i){if(r)e&&e(n),t(n);else{let r=i.toString().split("\n").map((e=>e.trim()));n=a.getValue(r,"gateway"),e&&e(n),t(n)}}))}catch(r){e&&e(n),t(n)}}if(p)try{i("netstat -r",a.execOptsWin,(function(i,o){o.toString().split(r.EOL).forEach((e=>{if((e=e.replace(/\s+/g," ").trim()).indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(e)){const t=e.split(" ");t.length>=5&&t[t.length-3].indexOf(".")>-1&&(n=t[t.length-3])}})),n?(e&&e(n),t(n)):a.powerShell("Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq '0.0.0.0' -and $_.Mask -eq '0.0.0.0' }").then((r=>{let i=r.toString().split("\r\n");i.length>1&&!n&&(n=a.getValue(i,"NextHop"),e&&e(n),t(n))}))}))}catch(r){e&&e(n),t(n)}}))}))}},6599:(e,t,n)=>{"use strict";const r=n(2087),i=n(5747),o=n(1453),s=n(3129).exec,a=n(3129).execSync,c=o.promisify(n(3129).exec);let u=process.platform;const l="linux"===u,p="darwin"===u,f="win32"===u,d="freebsd"===u,h="openbsd"===u,m="netbsd"===u,g="sunos"===u;function v(e){e=(e=e||"").toLowerCase();let t=u;return f?t="windows":-1!==e.indexOf("mac os")?t="apple":-1!==e.indexOf("arch")?t="arch":-1!==e.indexOf("centos")?t="centos":-1!==e.indexOf("coreos")?t="coreos":-1!==e.indexOf("debian")?t="debian":-1!==e.indexOf("deepin")?t="deepin":-1!==e.indexOf("elementary")?t="elementary":-1!==e.indexOf("fedora")?t="fedora":-1!==e.indexOf("gentoo")?t="gentoo":-1!==e.indexOf("mageia")?t="mageia":-1!==e.indexOf("mandriva")?t="mandriva":-1!==e.indexOf("manjaro")?t="manjaro":-1!==e.indexOf("mint")?t="mint":-1!==e.indexOf("mx")?t="mx":-1!==e.indexOf("openbsd")?t="openbsd":-1!==e.indexOf("freebsd")?t="freebsd":-1!==e.indexOf("opensuse")?t="opensuse":-1!==e.indexOf("pclinuxos")?t="pclinuxos":-1!==e.indexOf("puppy")?t="puppy":-1!==e.indexOf("raspbian")?t="raspbian":-1!==e.indexOf("reactos")?t="reactos":-1!==e.indexOf("redhat")?t="redhat":-1!==e.indexOf("slackware")?t="slackware":-1!==e.indexOf("sugar")?t="sugar":-1!==e.indexOf("steam")?t="steam":-1!==e.indexOf("suse")?t="suse":-1!==e.indexOf("mate")?t="ubuntu-mate":-1!==e.indexOf("lubuntu")?t="lubuntu":-1!==e.indexOf("xubuntu")?t="xubuntu":-1!==e.indexOf("ubuntu")?t="ubuntu":-1!==e.indexOf("solaris")?t="solaris":-1!==e.indexOf("tails")?t="tails":-1!==e.indexOf("feren")?t="ferenos":-1!==e.indexOf("robolinux")?t="robolinux":l&&e&&(t=e.toLowerCase().trim().replace(/\s+/g,"-")),t}function y(){let e=r.hostname;if(l||p||d||h||m)try{e=a("hostname -f").toString().split(r.EOL)[0]}catch(e){o.noop()}if(f)try{e=a("echo %COMPUTERNAME%.%USERDNSDOMAIN%",o.execOptsWin).toString().replace(".%USERDNSDOMAIN%","").split(r.EOL)[0]}catch(e){o.noop()}return e}function _(){const e=r.networkInterfaces();let t=[];for(let n in e)({}).hasOwnProperty.call(e,n)&&e[n].forEach((function(e){if(e&&e.mac&&"00:00:00:00:00:00"!==e.mac){const n=e.mac.toLowerCase();-1===t.indexOf(n)&&t.push(n)}}));return t=t.sort((function(e,t){return et?1:0})),t}function E(e){return new Promise((t=>{process.nextTick((()=>{let n,r={os:"",hardware:"",macs:_()};if(p&&s("system_profiler SPHardwareDataType -json",(function(n,i){if(!n)try{const e=JSON.parse(i.toString());if(e.SPHardwareDataType&&e.SPHardwareDataType.length>0){const t=e.SPHardwareDataType[0];r.os=t.platform_UUID.toLowerCase(),r.hardware=t.serial_number}}catch(e){o.noop()}e&&e(r),t(r)})),l){s('echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null; echo;\necho -n "os: "; cat /etc/machine-id 2> /dev/null; echo;\necho -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;',(function(n,s){const a=s.toString().split("\n");if(r.os=o.getValue(a,"os").toLowerCase(),r.hardware=o.getValue(a,"hardware").toLowerCase(),!r.hardware){const e=i.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split("\n"),t=o.getValue(e,"serial");r.hardware=t||""}e&&e(r),t(r)}))}if(d||h||m){s('echo -n "os: "; sysctl -n kern.hostid; echo;\necho -n "hardware: "; sysctl -n kern.hostuuid; echo;',(function(n,i){const s=i.toString().split("\n");r.os=o.getValue(s,"os").toLowerCase(),r.hardware=o.getValue(s,"hardware").toLowerCase(),r.os.indexOf("unknown")>=0&&(r.os=""),r.hardware.indexOf("unknown")>=0&&(r.hardware=""),e&&e(r),t(r)}))}f&&s('%windir%\\System32\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid',o.execOptsWin,(function(i,s){n=s.toString().split("\n\r")[0].split("REG_SZ"),r.os=n.length>1?n[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase():"",o.wmic("csproduct get /value").then((n=>{let i=n.split("\r\n");r.hardware=o.getValue(i,"uuid","=").toLowerCase(),e&&e(r),t(r)}))}))}))}))}t.time=function(){let e=(new Date).toString().split(" ");return{current:Date.now(),uptime:r.uptime(),timezone:e.length>=7?e[5]:"",timezoneName:e.length>=7?e.slice(6).join(" ").replace(/\(/g,"").replace(/\)/g,""):""}},t.osInfo=function(e){return new Promise((t=>{process.nextTick((()=>{let n={platform:"Windows_NT"===u?"Windows":u,distro:"unknown",release:"unknown",codename:"",kernel:r.release(),arch:r.arch(),hostname:r.hostname(),fqdn:y(),codepage:"",logofile:"",serial:"",build:"",servicepack:"",uefi:!1};if(l&&s("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release",(function(r,a){let c={};a.toString().split("\n").forEach((function(e){-1!==e.indexOf("=")&&(c[e.split("=")[0].trim().toUpperCase()]=e.split("=")[1].trim())}));let u=(c.VERSION||"").replace(/"/g,""),l=(c.DISTRIB_CODENAME||c.VERSION_CODENAME||"").replace(/"/g,"");u.indexOf("(")>=0&&(l=u.split("(")[1].replace(/[()]/g,"").trim(),u=u.split("(")[0].trim()),n.distro=(c.DISTRIB_ID||c.NAME||"unknown").replace(/"/g,""),n.logofile=v(n.distro),n.release=(u||c.DISTRIB_RELEASE||c.VERSION_ID||"unknown").replace(/"/g,""),n.codename=l,n.codepage=o.getCodepage(),n.build=(c.BUILD_ID||"").replace(/"/g,"").trim(),new Promise((e=>{process.nextTick((()=>{i.stat("/sys/firmware/efi",(function(t){t?s('dmesg | grep -E "EFI v"',(function(t,n){if(!t){const t=n.toString().split("\n");e(t.length>0)}e(!1)})):e(!0)}))}))})).then((r=>{n.uefi=r,E().then((r=>{n.serial=r.os,e&&e(n),t(n)}))}))})),(d||h||m)&&s("sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod",(function(r,i){if(!r){let e=i.toString().split("\n");n.distro=o.getValue(e,"kern.ostype"),n.logofile=v(n.distro),n.release=o.getValue(e,"kern.osrelease").split("-")[0],n.serial=o.getValue(e,"kern.uuid"),n.codename="",n.codepage=o.getCodepage(),n.uefi=o.getValue(e,"machdep.bootmethod").toLowerCase().indexOf("uefi")>=0}e&&e(n),t(n)})),p&&s("sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid",(function(r,i){let s=i.toString().split("\n");n.serial=o.getValue(s,"kern.uuid"),n.distro=o.getValue(s,"ProductName"),n.release=o.getValue(s,"ProductVersion"),n.build=o.getValue(s,"BuildVersion"),n.logofile=v(n.distro),n.codename="macOS",n.codename=n.release.indexOf("10.4")>-1?"Mac OS X Tiger":n.codename,n.codename=n.release.indexOf("10.4")>-1?"Mac OS X Tiger":n.codename,n.codename=n.release.indexOf("10.4")>-1?"Mac OS X Tiger":n.codename,n.codename=n.release.indexOf("10.5")>-1?"Mac OS X Leopard":n.codename,n.codename=n.release.indexOf("10.6")>-1?"Mac OS X Snow Leopard":n.codename,n.codename=n.release.indexOf("10.7")>-1?"Mac OS X Lion":n.codename,n.codename=n.release.indexOf("10.8")>-1?"OS X Mountain Lion":n.codename,n.codename=n.release.indexOf("10.9")>-1?"OS X Mavericks":n.codename,n.codename=n.release.indexOf("10.10")>-1?"OS X Yosemite":n.codename,n.codename=n.release.indexOf("10.11")>-1?"OS X El Capitan":n.codename,n.codename=n.release.indexOf("10.12")>-1?"macOS Sierra":n.codename,n.codename=n.release.indexOf("10.13")>-1?"macOS High Sierra":n.codename,n.codename=n.release.indexOf("10.14")>-1?"macOS Mojave":n.codename,n.codename=n.release.indexOf("10.15")>-1?"macOS Catalina":n.codename,n.codename=n.release.startsWith("11.")?"macOS Big Sur":n.codename,n.uefi=!0,n.codepage=o.getCodepage(),e&&e(n),t(n)})),g&&(n.release=n.kernel,s("uname -o",(function(r,i){let o=i.toString().split("\n");n.distro=o[0],n.logofile=v(n.distro),e&&e(n),t(n)}))),f){n.logofile=v(),n.release=n.kernel;try{const r=[];r.push(o.wmic("os get /value")),r.push(c("systeminfo",o.execOptsWin)),r.push(o.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession")),o.promiseAll(r).then((r=>{let i=r.results[0]?r.results[0].toString().split("\r\n"):[""];n.distro=o.getValue(i,"Caption","=").trim(),n.serial=o.getValue(i,"SerialNumber","=").trim(),n.build=o.getValue(i,"BuildNumber","=").trim(),n.servicepack=o.getValue(i,"ServicePackMajorVersion","=").trim()+"."+o.getValue(i,"ServicePackMinorVersion","=").trim(),n.codepage=o.getCodepage();const a=r.results[1]?r.results[1].toString():"";n.hypervisor=-1!==a.indexOf("hypervisor has been detected")||-1!==a.indexOf("Es wurde ein Hypervisor erkannt")||-1!==a.indexOf("Un hyperviseur a ");const c=r.results[2]?r.results[2].toString():"";n.remoteSession=c.toString().toLowerCase().indexOf("true")>=0,new Promise((e=>{process.nextTick((()=>{try{s('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"',o.execOptsWin,(function(t,n){if(t)s("$env:firmware_type",o.execOptsWin,(function(t,n){if(!t){const t=n.toString()||"";e(t.toLowerCase().indexOf("uefi")>=0)}e(!1)})),e(!1);else{const t=n.toString().split("\n\r")[0];e(t.toLowerCase().indexOf("uefi")>=0)}}))}catch(t){e(!1)}}))})).then((r=>{n.uefi=r,e&&e(n),t(n)}))}))}catch(r){e&&e(n),t(n)}}}))}))},t.versions=function(e,t){let n={kernel:r.release(),openssl:"",systemOpenssl:"",systemOpensslLib:"",node:process.versions.node,v8:process.versions.v8,npm:"",yarn:"",pm2:"",gulp:"",grunt:"",git:"",tsc:"",mysql:"",redis:"",mongodb:"",apache:"",nginx:"",php:"",docker:"",postfix:"",postgresql:"",perl:"",python:"",python3:"",pip:"",pip3:"",java:"",gcc:"",virtualbox:"",bash:"",zsh:"",fish:"",powershell:"",dotnet:""};return new Promise((r=>{process.nextTick((()=>{if(o.isFunction(e)&&!t)t=e,e="*";else if("string"!=typeof(e=e||"*"))return t&&t({}),r({});const a=function(e){if("*"===e)return{versions:n,counter:30};if(!Array.isArray(e)){e=(e=e.trim().toLowerCase().replace(/,+/g,"|").replace(/ /g,"|")).split("|");const t={versions:{},counter:0};return e.forEach((e=>{if(e)for(let r in n)({}).hasOwnProperty.call(n,r)&&(r.toLowerCase()!==e.toLowerCase()||{}.hasOwnProperty.call(t.versions,r)||(t.versions[r]=n[r],"openssl"===r&&(t.versions.systemOpenssl="",t.versions.systemOpensslLib=""),t.versions[r]||t.counter++))})),t}}(e);let c=a.counter,u=function(){0==--c&&(t&&t(a.versions),r(a.versions))},d="";try{if({}.hasOwnProperty.call(a.versions,"openssl")&&(a.versions.openssl=process.versions.openssl,s("openssl version",(function(e,t){if(!e){let e=t.toString().split("\n")[0].trim().split(" ");a.versions.systemOpenssl=e.length>0?e[1]:e[0],a.versions.systemOpensslLib=e.length>0?e[0]:"openssl"}u()}))),{}.hasOwnProperty.call(a.versions,"npm")&&s("npm -v",(function(e,t){e||(a.versions.npm=t.toString().split("\n")[0]),u()})),{}.hasOwnProperty.call(a.versions,"pm2")&&(d="pm2",f&&(d+=".cmd"),s(`${d} -v`,(function(e,t){if(!e){let e=t.toString().split("\n")[0].trim();e.startsWith("[PM2]")||(a.versions.pm2=e)}u()}))),{}.hasOwnProperty.call(a.versions,"yarn")&&s("yarn --version",(function(e,t){e||(a.versions.yarn=t.toString().split("\n")[0]),u()})),{}.hasOwnProperty.call(a.versions,"gulp")&&(d="gulp",f&&(d+=".cmd"),s(`${d} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.gulp=(e.toLowerCase().split("version")[1]||"").trim()}u()}))),{}.hasOwnProperty.call(a.versions,"tsc")&&(d="tsc",f&&(d+=".cmd"),s(`${d} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.tsc=(e.toLowerCase().split("version")[1]||"").trim()}u()}))),{}.hasOwnProperty.call(a.versions,"grunt")&&(d="grunt",f&&(d+=".cmd"),s(`${d} --version`,(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.grunt=(e.toLowerCase().split("cli v")[1]||"").trim()}u()}))),{}.hasOwnProperty.call(a.versions,"git"))if(p){const e=i.existsSync("/usr/local/Cellar/git");o.darwinXcodeExists()||e?s("git --version",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";e=(e.toLowerCase().split("version")[1]||"").trim(),a.versions.git=(e.split(" ")[0]||"").trim()}u()})):u()}else s("git --version",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";e=(e.toLowerCase().split("version")[1]||"").trim(),a.versions.git=(e.split(" ")[0]||"").trim()}u()}));if({}.hasOwnProperty.call(a.versions,"apache")&&s("apachectl -v 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(":");a.versions.apache=e.length>1?e[1].replace("Apache","").replace("/","").split("(")[0].trim():""}u()})),{}.hasOwnProperty.call(a.versions,"nginx")&&s("nginx -v 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.nginx=(e.toLowerCase().split("/")[1]||"").trim()}u()})),{}.hasOwnProperty.call(a.versions,"mysql")&&s("mysql -V",(function(e,t){if(!e){let e=t.toString().split("\n")[0]||"";if(e=e.toLowerCase(),e.indexOf(",")>-1){e=(e.split(",")[0]||"").trim();const t=e.split(" ");a.versions.mysql=(t[t.length-1]||"").trim()}else e.indexOf(" ver ")>-1&&(e=e.split(" ver ")[1],a.versions.mysql=e.split(" ")[0])}u()})),{}.hasOwnProperty.call(a.versions,"php")&&s("php -v",(function(e,t){if(!e){let e=(t.toString().split("\n")[0]||"").split("(");e[0].indexOf("-")&&(e=e[0].split("-")),a.versions.php=e[0].replace(/[^0-9.]/g,"")}u()})),{}.hasOwnProperty.call(a.versions,"redis")&&s("redis-server --version",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");a.versions.redis=o.getValue(e,"v","=",!0)}u()})),{}.hasOwnProperty.call(a.versions,"docker")&&s("docker --version",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");a.versions.docker=e.length>2&&e[2].endsWith(",")?e[2].slice(0,-1):""}u()})),{}.hasOwnProperty.call(a.versions,"postfix")&&s("postconf -d | grep mail_version",(function(e,t){if(!e){const e=t.toString().split("\n")||[];a.versions.postfix=o.getValue(e,"mail_version","=",!0)}u()})),{}.hasOwnProperty.call(a.versions,"mongodb")&&s("mongod --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.mongodb=(e.toLowerCase().split(",")[0]||"").replace(/[^0-9.]/g,"")}u()})),{}.hasOwnProperty.call(a.versions,"postgresql")&&(l?s("locate bin/postgres",(function(e,t){if(e)s("psql -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];a.versions.postgresql=e.length?e[e.length-1]:"",a.versions.postgresql=a.versions.postgresql.split("-")[0]}u()})),u();else{const e=t.toString().split("\n").sort();e.length?s(e[e.length-1]+" -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];a.versions.postgresql=e.length?e[e.length-1]:""}u()})):u()}})):f?o.wmic("service get /value").then((e=>{let t=e.split(/\n\s*\n/);for(let e=0;e-1){const e=r.split(" server ");e.length>1&&(a.versions.postgresql=e[1])}}u()})):s("postgres -V",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" ")||[];a.versions.postgresql=e.length?e[e.length-1]:""}u()}))),{}.hasOwnProperty.call(a.versions,"perl")&&s("perl -v",(function(e,t){if(!e){const e=t.toString().split("\n")||"";for(;e.length>0&&""===e[0].trim();)e.shift();e.length>0&&(a.versions.perl=e[0].split("(").pop().split(")")[0].replace("v",""))}u()})),{}.hasOwnProperty.call(a.versions,"python"))if(p){const e=i.existsSync("/usr/local/Cellar/python");o.darwinXcodeExists()||e?s("python -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.python=e.toLowerCase().replace("python","").trim()}u()})):u()}else s("python -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.python=e.toLowerCase().replace("python","").trim()}u()}));if({}.hasOwnProperty.call(a.versions,"python3"))if(p){const e=i.existsSync("/usr/local/Cellar/python3");o.darwinXcodeExists()||e?s("python3 -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.python3=e.toLowerCase().replace("python","").trim()}u()})):u()}else s("python3 -V 2>&1",(function(e,t){if(!e){const e=t.toString().split("\n")[0]||"";a.versions.python3=e.toLowerCase().replace("python","").trim()}u()}));if({}.hasOwnProperty.call(a.versions,"pip"))if(p){const e=i.existsSync("/usr/local/Cellar/pip");o.darwinXcodeExists()||e?s("pip -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");a.versions.pip=e.length>=2?e[1]:""}u()})):u()}else s("pip -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");a.versions.pip=e.length>=2?e[1]:""}u()}));if({}.hasOwnProperty.call(a.versions,"pip3"))if(p){const e=i.existsSync("/usr/local/Cellar/pip3");o.darwinXcodeExists()||e?s("pip3 -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");a.versions.pip3=e.length>=2?e[1]:""}u()})):u()}else s("pip3 -V 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split(" ");a.versions.pip3=e.length>=2?e[1]:""}u()}));({}).hasOwnProperty.call(a.versions,"java")&&(p?s("/usr/libexec/java_home -V 2>&1",(function(e,t){e||-1!==t.toString().toLowerCase().indexOf("no java runtime")?u():s("java -version 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split('"');a.versions.java=3===e.length?e[1].trim():""}u()}))})):s("java -version 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split('"');a.versions.java=3===e.length?e[1].trim():""}u()}))),{}.hasOwnProperty.call(a.versions,"gcc")&&(p&&o.darwinXcodeExists()||!p?s("gcc -dumpversion",(function(e,t){e||(a.versions.gcc=t.toString().split("\n")[0].trim()||""),a.versions.gcc.indexOf(".")>-1?u():s("gcc --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].trim();if(e.indexOf("gcc")>-1&&e.indexOf(")")>-1){const t=e.split(")");a.versions.gcc=t[1].trim()||a.versions.gcc}}u()}))})):u()),{}.hasOwnProperty.call(a.versions,"virtualbox")&&s(o.getVboxmanage()+" -v 2>&1",(function(e,t){if(!e){const e=(t.toString().split("\n")[0]||"").split("r");a.versions.virtualbox=e[0]}u()})),{}.hasOwnProperty.call(a.versions,"bash")&&s("bash --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" version ");e.length>1&&(a.versions.bash=e[1].split(" ")[0].split("(")[0])}u()})),{}.hasOwnProperty.call(a.versions,"zsh")&&s("zsh --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split("zsh ");e.length>1&&(a.versions.zsh=e[1].split(" ")[0])}u()})),{}.hasOwnProperty.call(a.versions,"fish")&&s("fish --version",(function(e,t){if(!e){const e=t.toString().split("\n")[0].split(" version ");e.length>1&&(a.versions.fish=e[1].split(" ")[0])}u()})),{}.hasOwnProperty.call(a.versions,"powershell")&&(f?o.powerShell("$PSVersionTable").then((e=>{const t=e.toString().split("\n").map((e=>e.replace(/ +/g," ").replace(/ +/g,":")));a.versions.powershell=o.getValue(t,"psversion"),u()})):u()),{}.hasOwnProperty.call(a.versions,"dotnet")&&o.powerShell('gci "HKLM:\\SOFTWARE\\Microsoft\\NET Framework Setup\\NDP" -recurse | gp -name Version,Release -EA 0 | where { $_.PSChildName -match "^(?!S)\\p{L}"} | select PSChildName, Version, Release').then((e=>{const t=e.toString().split("\r\n");let n="";t.forEach((e=>{const t=(e=e.replace(/ +/g," ")).split(" ");n=n||(t[0].toLowerCase().startsWith("client")&&t.length>2||t[0].toLowerCase().startsWith("full")&&t.length>2?t[1].trim():"")})),a.versions.dotnet=n.trim(),u()}))}catch(e){t&&t(a.versions),r(a.versions)}}))}))},t.shell=function(e){return new Promise((t=>{process.nextTick((()=>{f&&t("cmd");let n="";s("echo $SHELL",(function(r,i){r||(n=i.toString().split("\n")[0]),e&&e(n),t(n)}))}))}))},t.uuid=E},8958:(e,t,n)=>{"use strict";const r=n(3129).exec,i=n(1453);let o=process.platform;const s="linux"===o,a="darwin"===o,c="win32"===o,u="freebsd"===o,l="openbsd"===o,p="netbsd"===o,f="sunos"===o,d={1:"Other",2:"Unknown",3:"Idle",4:"Printing",5:"Warmup",6:"Stopped Printing",7:"Offline"};function h(e){const t={},n=i.getValue(e,"PrinterId"," ");return t.id=n?parseInt(n,10):null,t.name=i.getValue(e,"Info"," "),t.model=e.length>0&&e[0]?e[0].split(" ")[0]:"",t.uri=i.getValue(e,"DeviceURI"," "),t.uuid=i.getValue(e,"UUID"," "),t.status=i.getValue(e,"State"," "),t.local=i.getValue(e,"Location"," ").toLowerCase().startsWith("local"),t.default=null,t.shared=i.getValue(e,"Shared"," ").toLowerCase().startsWith("yes"),t}function m(e,t){const n={};return n.id=t,n.name=i.getValue(e,"Description",":",!0),n.model=e.length>0&&e[0]?e[0].split(" ")[0]:"",n.uri=null,n.uuid=null,n.status=e.length>0&&e[0]?e[0].indexOf(" idle")>0?"idle":e[0].indexOf(" printing")>0?"printing":"unknown":null,n.local=i.getValue(e,"Location",":",!0).toLowerCase().startsWith("local"),n.default=null,n.shared=i.getValue(e,"Shared"," ").toLowerCase().startsWith("yes"),n}function g(e,t){const n={},r=e.uri.split("/");return n.id=t,n.name=e._name,n.model=r.length?r[r.length-1]:"",n.uri=e.uri,n.uuid=null,n.status=e.status,n.local="local"===e.printserver,n.default="yes"===e.default,n.shared="yes"===e.shared,n}function v(e,t){const n={},r=parseInt(i.getValue(e,"PrinterStatus","="),10);return n.id=t,n.name=i.getValue(e,"name","="),n.model=i.getValue(e,"DriverName","="),n.uri=null,n.uuid=null,n.status=d[r]?d[r]:null,n.local="TRUE"===i.getValue(e,"Local","="),n.default="TRUE"===i.getValue(e,"Default","="),n.shared="TRUE"===i.getValue(e,"Shared","="),n}t.printer=function(e){return new Promise((t=>{process.nextTick((()=>{let n=[];if(s||u||l||p){let i="cat /etc/cups/printers.conf 2>/dev/null";r(i,(function(o,a){if(!o){const e=a.toString().split("0){const n=e[0].split(" CUPS v");t.cupsVersion=n[1]}return t}(e[0]);for(let r=1;r/dev/null; unset LC_ALL",r(i,(function(e,t){const r=("\n"+t.toString()).split("\nprinter ");for(let e=1;e{"use strict";const r=n(2087),i=n(5747),o=n(5622),s=n(3129).exec,a=n(3129).execSync,c=n(1453);let u=process.platform;const l="linux"===u,p="darwin"===u,f="win32"===u,d="freebsd"===u,h="openbsd"===u,m="netbsd"===u,g="sunos"===u,v={all:0,list:{},ms:0,result:{}},y={all:0,list:{},ms:0,result:{}},_={all:0,list:{},ms:0,result:{}},E={0:"unknown",1:"other",2:"ready",3:"running",4:"blocked",5:"suspended blocked",6:"suspended ready",7:"terminated",8:"stopped",9:"growing"};function b(e){let t=e.replace(/ +/g," ").split(" ");return(t.length>=2?parseInt(t[1]):0)+(t.length>=3?parseInt(t[2]):0)+(t.length>=4?parseInt(t[3]):0)+(t.length>=5?parseInt(t[4]):0)+(t.length>=6?parseInt(t[5]):0)+(t.length>=7?parseInt(t[6]):0)+(t.length>=8?parseInt(t[7]):0)+(t.length>=9?parseInt(t[8]):0)+(t.length>=10?parseInt(t[9]):0)+(t.length>=11?parseInt(t[10]):0)}function w(e,t,n){let r=e.replace(/ +/g," ").split(")");if(r.length>=2){let e=r[1].split(" ");if(e.length>=16){let i=parseInt(r[0].split(" ")[0]),o=parseInt(e[12]),s=parseInt(e[13]),a=parseInt(e[14]),c=parseInt(e[15]),u=0,l=0;return n.all>0&&n.list[i]?(u=(o+a-n.list[i].utime-n.list[i].cutime)/(t-n.all)*100,l=(s+c-n.list[i].stime-n.list[i].cstime)/(t-n.all)*100):(u=(o+a)/t*100,l=(s+c)/t*100),{pid:i,utime:o,stime:s,cutime:a,cstime:c,cpuu:u,cpus:l}}return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}function S(e,t,n){let r=0,i=0;return n.all>0&&n.list[e.pid]?(r=(e.utime-n.list[e.pid].utime)/(t-n.all)*100,i=(e.stime-n.list[e.pid].stime)/(t-n.all)*100):(r=e.utime/t*100,i=e.stime/t*100),{pid:e.pid,utime:e.utime,stime:e.stime,cpuu:r,cpus:i}}t.services=function(e,t){return c.isFunction(e)&&!t&&(t=e,e=""),new Promise((n=>{process.nextTick((()=>{if("string"!=typeof e)return t&&t([]),n([]);if(e){let r="";r.__proto__.toLowerCase=c.stringToLower,r.__proto__.replace=c.stringReplace,r.__proto__.trim=c.stringTrim;const i=c.sanitizeShellString(e);for(let e=0;e<=c.mathMin(i.length,2e3);e++)void 0!==i[e]&&(r+=i[e]);r=r.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),""===r&&(r="*"),c.isPrototypePolluted()&&"*"!==r&&(r="------");let o=r.split("|"),u=[],g=[];if(l||d||h||m||p){if((l||d||h||m)&&"*"===r)try{r="";const e=a("service --status-all 2> /dev/null").toString().split("\n");for(const t of e){const e=t.split("]");2===e.length&&(r+=(""!==r?"|":"")+e[1].trim())}o=r.split("|")}catch(e){try{const e=a("ls /etc/init.d/ -m 2> /dev/null").toString().split("\n").join("");if(r="",e){const t=e.split(",");for(const e of t){const t=e.trim();t&&(r+=(""!==r?"|":"")+t)}o=r.split("|")}}catch(e){r="",o=[]}}p&&"*"===r&&(t&&t(u),n(u));let e=p?["-caxo","pcpu,pmem,pid,command"]:["-axo","pcpu,pmem,pid,command"];""!==r&&o.length>0?c.execSafe("ps",e).then((r=>{if(r){let e=r.replace(/ +/g," ").replace(/,+/g,".").split("\n");if(o.forEach((function(t){let n;n=p?e.filter((function(e){return-1!==e.toLowerCase().indexOf(t)})):e.filter((function(e){return-1!==e.toLowerCase().indexOf(" "+t+":")||-1!==e.toLowerCase().indexOf("/"+t)}));const r=[];for(const e of n){const t=e.trim().split(" ")[2];t&&r.push(parseInt(t,10))}u.push({name:t,running:n.length>0,startmode:"",pids:r,cpu:parseFloat(n.reduce((function(e,t){return e+parseFloat(t.trim().split(" ")[0])}),0).toFixed(2)),mem:parseFloat(n.reduce((function(e,t){return e+parseFloat(t.trim().split(" ")[1])}),0).toFixed(2))})})),l){let e='cat /proc/stat | grep "cpu "';for(let t in u)for(let n in u[t].pids)e+=";cat /proc/"+u[t].pids[n]+"/stat";s(e,{maxBuffer:2048e4},(function(e,r){let i=r.toString().split("\n"),o=b(i.shift()),s={},a={};for(let e=0;e=0&&(u[e].cpu+=a.cpuu+a.cpus),s[a.pid]={cpuu:a.cpuu,cpus:a.cpus,utime:a.utime,stime:a.stime,cutime:a.cutime,cstime:a.cstime}}y.all=o,y.list=Object.assign({},s),y.ms=Date.now()-y.ms,y.result=Object.assign({},u),t&&t(u),n(u)}))}else t&&t(u),n(u)}else e=["-o","comm"],c.execSafe("ps",e).then((e=>{if(e){let r=e.replace(/ +/g," ").replace(/,+/g,".").split("\n");o.forEach((function(e){let t=r.filter((function(t){return-1!==t.indexOf(e)}));u.push({name:e,running:t.length>0,startmode:"",cpu:0,mem:0})})),t&&t(u),n(u)}else o.forEach((function(e){u.push({name:e,running:!1,startmode:"",cpu:0,mem:0})})),t&&t(u),n(u)}))})):(t&&t(u),n(u))}if(f)try{c.wmic("service get /value").then(((e,i)=>{if(i)o.forEach((function(e){u.push({name:e,running:!1,startmode:"",cpu:0,mem:0})})),t&&t(u),n(u);else{let i=e.split(/\n\s*\n/);for(let e=0;e=0||o.indexOf(s)>=0)&&(u.push({name:n,running:"TRUE"===a,startmode:l,pids:[p],cpu:0,mem:0}),g.push(n),g.push(s))}if("*"!==r){o.filter((function(e){return-1===g.indexOf(e)})).forEach((function(e){u.push({name:e,running:!1,startmode:"",pids:[],cpu:0,mem:0})}))}t&&t(u),n(u)}}))}catch(e){t&&t(u),n(u)}}else t&&t([]),n([])}))}))},t.processes=function(e){let t=[];function n(e){let t=(e=e||"").split(" ")[0];if(":"===t.substr(-1)&&(t=t.substr(0,t.length-1)),"["!==t.substr(0,1)){let e=t.split("/");t=isNaN(parseInt(e[e.length-1]))?e[e.length-1]:e[0]}return t}function a(e){let r=[];if(e.length>1){let s=e[0];t=c.parseHead(s,8),e.shift(),e.forEach((function(e){""!==e.trim()&&r.push(function(e){let r=0,s=0;function a(n){r=s,s=t[n]?e.substring(t[n].to+r,1e4).indexOf(" "):1e4}a(0);const c=parseInt(e.substring(t[0].from+r,t[0].to+s));a(1);const u=parseInt(e.substring(t[1].from+r,t[1].to+s));a(2);const p=parseFloat(e.substring(t[2].from+r,t[2].to+s).replace(/,/g,"."));a(3);const f=parseFloat(e.substring(t[3].from+r,t[3].to+s).replace(/,/g,"."));a(4);const d=parseInt(e.substring(t[4].from+r,t[4].to+s));a(5);const h=parseInt(e.substring(t[5].from+r,t[5].to+s));a(6);const m=parseInt(e.substring(t[6].from+r,t[6].to+s));a(7);const g=parseInt(e.substring(t[7].from+r,t[7].to+s))||0;a(8);const v=function(e){let t=e,n=e.replace(/ +/g," ").split(" ");return 5===n.length&&(t=n[4]+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(n[1].toUpperCase())/3+1)).slice(-2)+"-"+("0"+n[2]).slice(-2)+" "+n[3]),t}(e.substring(t[8].from+r,t[8].to+s).trim());a(9);let y=e.substring(t[9].from+r,t[9].to+s).trim();y="R"===y[0]?"running":"S"===y[0]?"sleeping":"T"===y[0]?"stopped":"W"===y[0]?"paging":"X"===y[0]?"dead":"Z"===y[0]?"zombie":"D"===y[0]||"U"===y[0]?"blocked":"unknown",a(10);let _=e.substring(t[10].from+r,t[10].to+s).trim();"?"!==_&&"??"!==_||(_=""),a(11);const E=e.substring(t[11].from+r,t[11].to+s).trim();a(12);let b="",w="",S="",I=e.substring(t[12].from+r,t[12].to+s).trim();if("]"===I.substr(I.length-1)&&(I=I.slice(0,-1)),"["===I.substr(0,1))w=I.substring(1);else{let e=I.indexOf(" -"),t=I.indexOf(" /");e=e>=0?e:1e4,t=t>=0?t:1e4;const n=Math.min(e,t);let r=I.substr(0,n);const s=I.substr(n),a=r.lastIndexOf("/");if(a>=0&&(b=r.substr(0,a),r=r.substr(a+1)),1e4===n&&r.indexOf(" ")>-1){const e=r.split(" ");i.existsSync(o.join(b,e[0]))?(w=e.shift(),S=(e.join(" ")+" "+s).trim()):(w=r.trim(),S=s.trim())}else w=r.trim(),S=s.trim()}return{pid:c,parentPid:u,name:l?n(w):w,cpu:p,cpuu:0,cpus:0,mem:f,priority:d,memVsz:h,memRss:m,nice:g,started:v,state:y,tty:_,user:E,command:w,params:S,path:b}}(e))}))}return r}return new Promise((t=>{process.nextTick((()=>{let i={all:0,running:0,blocked:0,sleeping:0,unknown:0,list:[]},o="";if(v.ms&&Date.now()-v.ms>=500||0===v.ms)if(l||d||h||m||p||g)l&&(o="export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,lstart:30,state:5,tty:15,user:20,command; unset LC_ALL"),(d||h||m)&&(o="export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,lstart,state,tty,user,command; unset LC_ALL"),p&&(o="export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,nice,lstart,state,tty,user,command -r; unset LC_ALL"),g&&(o="ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm"),s(o,{maxBuffer:2048e4},(function(c,u){if(c)o="ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm",g&&(o="ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm"),s(o,{maxBuffer:2048e4},(function(o,s){if(o)e&&e(i),t(i);else{let o=s.toString().split("\n");o.shift(),i.list=function(e){let t=[];return e.forEach((function(e){if(""!==e.trim()){const i=(e=e.trim().replace(/ +/g," ").replace(/,+/g,".")).split(" "),o=i.slice(9).join(" "),s=parseFloat((1*parseInt(i[3])*1024/r.totalmem()).toFixed(1)),a=i[5].split(":"),c=function(e){const t=("0"+(e.getMonth()+1).toString()).substr(-2);return e.getFullYear().toString()+"-"+t+"-"+("0"+e.getDay().toString()).substr(-2)+" "+e.getHours().toString()+":"+e.getMinutes().toString()+":"+("0"+e.getSeconds().toString()).substr(-2)}(new Date(Date.now()-(a.length>1?1e3*(60*a[0]+a[1]):1e3*a[0])));t.push({pid:parseInt(i[0]),parentPid:parseInt(i[1]),name:n(o),cpu:0,cpuu:0,cpus:0,mem:s,priority:0,memVsz:parseInt(i[2]),memRss:parseInt(i[3]),nice:parseInt(i[4]),started:c,state:"R"===i[6]?"running":"S"===i[6]?"sleeping":"T"===i[6]?"stopped":"W"===i[6]?"paging":"X"===i[6]?"dead":"Z"===i[6]?"zombie":"D"===i[6]||"U"===i[6]?"blocked":"unknown",tty:i[7],user:i[8],command:o})}})),t}(o).slice(),i.all=i.list.length,i.running=i.list.filter((function(e){return"running"===e.state})).length,i.blocked=i.list.filter((function(e){return"blocked"===e.state})).length,i.sleeping=i.list.filter((function(e){return"sleeping"===e.state})).length,e&&e(i),t(i)}}));else if(i.list=a(u.toString().split("\n")).slice(),i.all=i.list.length,i.running=i.list.filter((function(e){return"running"===e.state})).length,i.blocked=i.list.filter((function(e){return"blocked"===e.state})).length,i.sleeping=i.list.filter((function(e){return"sleeping"===e.state})).length,l){o='cat /proc/stat | grep "cpu "';for(let e=0;e=0&&(i.list[e].cpu=c.cpuu+c.cpus,i.list[e].cpuu=c.cpuu,i.list[e].cpus=c.cpus),a[c.pid]={cpuu:c.cpuu,cpus:c.cpus,utime:c.utime,stime:c.stime,cutime:c.cutime,cstime:c.cstime}}v.all=s,v.list=Object.assign({},a),v.ms=Date.now()-v.ms,v.result=Object.assign({},i),e&&e(i),t(i)}))}else e&&e(i),t(i)}));else if(f)try{c.wmic("process get /value").then(((n,o)=>{if(!o){let e=n.split(/\n\s*\n/),t=[],o=[],a={},u=0,l=0;for(let n=0;n=0&&(i.list[n].cpu=t.cpuu+t.cpus,i.list[n].cpuu=t.cpuu,i.list[n].cpus=t.cpus),a[t.pid]={cpuu:t.cpuu,cpus:t.cpus,utime:t.utime,stime:t.stime}}v.all=u+l,v.list=Object.assign({},a),v.ms=Date.now()-v.ms,v.result=Object.assign({},i)}var s;e&&e(i),t(i)}))}catch(n){e&&e(i),t(i)}else e&&e(i),t(i);else e&&e(v.result),t(v.result)}))}))},t.processLoad=function(e,t){return c.isFunction(e)&&!t&&(t=e,e=""),new Promise((n=>{process.nextTick((()=>{if("string"!=typeof(e=e||""))return t&&t([]),n([]);let i="";i.__proto__.toLowerCase=c.stringToLower,i.__proto__.replace=c.stringReplace,i.__proto__.trim=c.stringTrim;const o=c.sanitizeShellString(e);for(let e=0;e<=c.mathMin(o.length,2e3);e++)void 0!==o[e]&&(i+=o[e]);i=i.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),""===i&&(i="*"),c.isPrototypePolluted()&&"*"!==i&&(i="------");let a=i.split("|"),u=[];if((c.isPrototypePolluted()?"":c.sanitizeShellString(e))&&a.length&&"------"!==a[0]){if(f)try{c.wmic("process get /value").then(((e,o)=>{if(!o){let o=e.split(/\n\s*\n/),s=[],l={},p=0,f=0;for(let e=0;e=0&&!v&&(v=!0,g=e)})),"*"===i||v){let e=!1;u.forEach((function(t){t.proc.toLowerCase()===g.toLowerCase()&&(t.pids.push(n),t.mem+=m/r.totalmem()*100,e=!0)})),e||u.push({proc:g,pid:n,pids:[n],cpu:0,mem:m/r.totalmem()*100})}}if("*"!==i){a.filter((function(e){return 0===s.filter((function(t){return t.name.toLowerCase().indexOf(e)>=0})).length})).forEach((function(e){u.push({proc:e,pid:null,pids:[],cpu:0,mem:0})}))}for(let e=0;e=0)&&(n=e);n>=0&&(u[n].cpu+=t.cpuu+t.cpus),l[t.pid]={cpuu:t.cpuu,cpus:t.cpus,utime:t.utime,stime:t.stime}}_.all=p+f,_.list=Object.assign({},l),_.ms=Date.now()-_.ms,_.result=JSON.parse(JSON.stringify(u)),t&&t(u),n(u)}}))}catch(e){t&&t(u),n(u)}if(p||l||d||h||m){const e=["-axo","pid,pcpu,pmem,comm"];c.execSafe("ps",e).then((e=>{if(e){let r=[];if(e.toString().split("\n").filter((function(e){if("*"===i)return!0;if(-1!==e.toLowerCase().indexOf("grep"))return!1;let t=!1;return a.forEach((function(n){t=t||e.toLowerCase().indexOf(n.toLowerCase())>=0})),t})).forEach((function(e){let t=e.trim().replace(/ +/g," ").split(" ");t.length>3&&r.push({name:t[3].substring(t[3].lastIndexOf("/")+1),pid:parseInt(t[0])||0,cpu:parseFloat(t[1].replace(",",".")),mem:parseFloat(t[2].replace(",","."))})})),r.forEach((function(e){let t=-1,n=!1,r="";for(let n=0;n=0&&(t=n);a.forEach((function(t){e.name.toLowerCase().indexOf(t.toLowerCase())>=0&&!n&&(n=!0,r=t)})),("*"===i||n)&&(t<0?u.push({proc:r,pid:e.pid,pids:[e.pid],cpu:e.cpu,mem:e.mem}):(u[t].pids.push(e.pid),u[t].cpu+=e.cpu,u[t].mem+=e.mem))})),"*"!==i){a.filter((function(e){return 0===r.filter((function(t){return t.name.toLowerCase().indexOf(e)>=0})).length})).forEach((function(e){u.push({proc:e,pid:null,pids:[],cpu:0,mem:0})}))}if(l){u.forEach((function(e){e.cpu=0}));let e='cat /proc/stat | grep "cpu "';for(let t in u)for(let n in u[t].pids)e+=";cat /proc/"+u[t].pids[n]+"/stat";s(e,{maxBuffer:2048e4},(function(e,r){let i=r.toString().split("\n"),o=b(i.shift()),s={},a={};for(let e=0;e=0&&(e=t);e>=0&&(u[e].cpu+=a.cpuu+a.cpus),s[a.pid]={cpuu:a.cpuu,cpus:a.cpus,utime:a.utime,stime:a.stime,cutime:a.cutime,cstime:a.cstime}}u.forEach((function(e){e.cpu=Math.round(100*e.cpu)/100})),_.all=o,_.list=Object.assign({},s),_.ms=Date.now()-_.ms,_.result=Object.assign({},u),t&&t(u),n(u)}))}else t&&t(u),n(u)}else t&&t(u),n(u)}))}}}))}))}},1617:(e,t,n)=>{"use strict";const r=n(5747),i=n(2087),o=n(1453),s=n(3129).exec,a=n(3129).execSync,c=o.promisify(n(3129).exec);let u=process.platform;const l="linux"===u,p="darwin"===u,f="win32"===u,d="freebsd"===u,h="openbsd"===u,m="netbsd"===u,g="sunos"===u;t.system=function(e){return new Promise((t=>{process.nextTick((()=>{let n={manufacturer:"",model:"Computer",version:"",serial:"-",uuid:"-",sku:"-",virtual:!1};if((l||d||h||m)&&s("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL",(function(i,s){let c=s.toString().split("\n");n.manufacturer=o.getValue(c,"manufacturer"),n.model=o.getValue(c,"product name"),n.version=o.getValue(c,"version"),n.serial=o.getValue(c,"serial number"),n.uuid=o.getValue(c,"uuid").toLowerCase(),n.sku=o.getValue(c,"sku number");try{c=a('echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;\n echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;\n echo -n "product_uuid: "; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;\n echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;\n echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;').toString().split("\n"),n.manufacturer=""===n.manufacturer?o.getValue(c,"sys_vendor"):n.manufacturer,n.model=""===n.model?o.getValue(c,"product_name"):n.model,n.version=""===n.version?o.getValue(c,"product_version"):n.version,n.serial=""===n.serial?o.getValue(c,"product_serial"):n.serial,n.uuid=""===n.uuid?o.getValue(c,"product_uuid").toLowerCase():n.uuid}catch(e){o.noop()}if(n.serial&&-1===n.serial.toLowerCase().indexOf("o.e.m.")||(n.serial="-"),n.manufacturer&&-1===n.manufacturer.toLowerCase().indexOf("o.e.m.")||(n.manufacturer=""),n.model&&-1===n.model.toLowerCase().indexOf("o.e.m.")||(n.model="Computer"),n.version&&-1===n.version.toLowerCase().indexOf("o.e.m.")||(n.version=""),n.sku&&-1===n.sku.toLowerCase().indexOf("o.e.m.")||(n.sku="-"),"virtualbox"===n.model.toLowerCase()||"kvm"===n.model.toLowerCase()||"virtual machine"===n.model.toLowerCase()||"bochs"===n.model.toLowerCase()||n.model.toLowerCase().startsWith("vmware")||n.model.toLowerCase().startsWith("droplet"))switch(n.virtual=!0,n.model.toLowerCase()){case"virtualbox":n.virtualHost="VirtualBox";break;case"vmware":n.virtualHost="VMware";break;case"kvm":n.virtualHost="KVM";break;case"bochs":n.virtualHost="bochs"}if(n.manufacturer.toLowerCase().startsWith("vmware")||"xen"===n.manufacturer.toLowerCase())switch(n.virtual=!0,n.manufacturer.toLowerCase()){case"vmware":n.virtualHost="VMware";break;case"xen":n.virtualHost="Xen"}if(!n.virtual)try{const e=a("ls -1 /dev/disk/by-id/ 2>/dev/null").toString();e.indexOf("_QEMU_")>=0&&(n.virtual=!0,n.virtualHost="QEMU"),e.indexOf("_VBOX_")>=0&&(n.virtual=!0,n.virtualHost="VirtualBox")}catch(e){o.noop()}if(!n.virtual&&o.linuxVersion().toLowerCase().indexOf("microsoft")>=0){let e=o.linuxVersion().toLowerCase();e=e.split("-")[0].replace("#","");const t=parseInt(e,10)||null;n.virtual=!0,n.manufacturer="Microsoft",n.model="WSL",n.version=t}if((d||h||m)&&!n.virtualHost)try{const e=a("dmidecode -t 4").toString().split("\n");switch(o.getValue(e,"manufacturer",":",!0).toLowerCase()){case"virtualbox":n.virtualHost="VirtualBox";break;case"vmware":n.virtualHost="VMware";break;case"kvm":n.virtualHost="KVM";break;case"bochs":n.virtualHost="bochs"}}catch(e){o.noop()}(r.existsSync("/.dockerenv")||r.existsSync("/.dockerinit"))&&(n.model="Docker Container");try{const e=a('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen"');e.toString().split("\n").length>0&&("Computer"===n.model&&(n.model="Virtual machine"),n.virtual=!0,e.toString().toLowerCase().indexOf("vmware")&&!n.virtualHost&&(n.virtualHost="VMware"),e.toString().toLowerCase().indexOf("qemu")&&!n.virtualHost&&(n.virtualHost="QEMU"),e.toString().toLowerCase().indexOf("xen")&&!n.virtualHost&&(n.virtualHost="Xen"),e.toString().toLowerCase().indexOf("kvm")&&!n.virtualHost&&(n.virtualHost="KVM"))}catch(e){o.noop()}""===n.manufacturer&&"Computer"===n.model&&""===n.version?r.readFile("/proc/cpuinfo",(function(r,i){if(!r){let e=i.toString().split("\n");n.model=o.getValue(e,"hardware",":",!0).toUpperCase(),n.version=o.getValue(e,"revision",":",!0).toLowerCase(),n.serial=o.getValue(e,"serial",":",!0);const t=o.getValue(e,"model:",":",!0);if(("BCM2835"===n.model||"BCM2708"===n.model||"BCM2709"===n.model||"BCM2710"===n.model||"BCM2711"===n.model||"BCM2836"===n.model||"BCM2837"===n.model)&&t.toLowerCase().indexOf("raspberry")>=0){const t=o.decodePiCpuinfo(e);n.model=t.model,n.version=t.revisionCode,n.manufacturer="Raspberry Pi Foundation",n.raspberry={manufacturer:t.manufacturer,processor:t.processor,type:t.type,revision:t.revision}}}e&&e(n),t(n)})):(e&&e(n),t(n))})),p&&s("ioreg -c IOPlatformExpertDevice -d 2",(function(r,i){if(!r){let e=i.toString().replace(/[<>"]/g,"").split("\n");n.manufacturer=o.getValue(e,"manufacturer","=",!0),n.model=o.getValue(e,"model","=",!0),n.version=o.getValue(e,"version","=",!0),n.serial=o.getValue(e,"ioplatformserialnumber","=",!0),n.uuid=o.getValue(e,"ioplatformuuid","=",!0).toLowerCase(),n.sku=o.getValue(e,"board-id","=",!0)}e&&e(n),t(n)})),g&&(e&&e(n),t(n)),f)try{o.wmic("csproduct get /value").then(((r,i)=>{if(i)e&&e(n),t(n);else{let i=r.split("\r\n");if(n.manufacturer=o.getValue(i,"vendor","="),n.model=o.getValue(i,"name","="),n.version=o.getValue(i,"version","="),n.serial=o.getValue(i,"identifyingnumber","="),n.uuid=o.getValue(i,"uuid","=").toLowerCase(),"virtualbox"===n.model.toLowerCase()||"kvm"===n.model.toLowerCase()||"virtual machine"===n.model.toLowerCase()||"bochs"===n.model.toLowerCase()||n.model.toLowerCase().startsWith("vmware"))switch(n.virtual=!0,n.model.toLowerCase()){case"virtualbox":n.virtualHost="VirtualBox";break;case"vmware":n.virtualHost="VMware";break;case"kvm":n.virtualHost="KVM";break;case"bochs":n.virtualHost="bochs"}if(n.manufacturer.toLowerCase().startsWith("vmware")||"xen"===n.manufacturer.toLowerCase())switch(n.virtual=!0,n.manufacturer.toLowerCase()){case"vmware":n.virtualHost="VMware";break;case"xen":n.virtualHost="Xen"}o.wmic("/namespace:\\\\root\\wmi path MS_SystemInformation get /value").then(((r,i)=>{if(!i){let e=r.split("\r\n");n.sku=o.getValue(e,"systemsku","=")}n.virtual?(e&&e(n),t(n)):o.wmic("bios get Version, SerialNumber, SMBIOSBIOSVersion").then(((r,i)=>{if(i)e&&e(n),t(n);else{let i=r.toString();(i.indexOf("VRTUAL")>=0||i.indexOf("A M I ")>=0||i.indexOf("VirtualBox")>=0||i.indexOf("VMWare")>=0||i.indexOf("Xen")>=0)&&(n.virtual=!0,i.indexOf("VirtualBox")>=0&&!n.virtualHost&&(n.virtualHost="VirtualBox"),i.indexOf("VMware")>=0&&!n.virtualHost&&(n.virtualHost="VMware"),i.indexOf("Xen")>=0&&!n.virtualHost&&(n.virtualHost="Xen"),i.indexOf("VRTUAL")>=0&&!n.virtualHost&&(n.virtualHost="Hyper-V"),i.indexOf("A M I")>=0&&!n.virtualHost&&(n.virtualHost="Virtual PC")),e&&e(n),t(n)}}))}))}}))}catch(r){e&&e(n),t(n)}}))}))},t.bios=function(e){return new Promise((t=>{process.nextTick((()=>{let n={vendor:"",version:"",releaseDate:"",revision:""},r="";if((l||d||h||m)&&(r="arm"===process.arch?"cat /proc/cpuinfo | grep Serial":"export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL",s(r,(function(r,i){let s=i.toString().split("\n");n.vendor=o.getValue(s,"Vendor"),n.version=o.getValue(s,"Version");let c=o.getValue(s,"Release Date");n.releaseDate=o.parseDateTime(c).date,n.revision=o.getValue(s,"BIOS Revision");let u=o.getValue(s,"Currently Installed Language").split("|")[0];if(u&&(n.language=u),s.length&&i.toString().indexOf("Characteristics:")>=0){const e=[];s.forEach((t=>{if(t.indexOf(" is supported")>=0){const n=t.split(" is supported")[0].trim();e.push(n)}})),n.features=e}try{s=a('echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;\n echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;\n echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;').toString().split("\n"),n.vendor=n.vendor?n.vendor:o.getValue(s,"bios_vendor"),n.version=n.version?n.version:o.getValue(s,"bios_version"),c=o.getValue(s,"bios_date"),n.releaseDate=n.releaseDate?n.releaseDate:o.parseDateTime(c).date}catch(e){o.noop()}e&&e(n),t(n)}))),p&&(n.vendor="Apple Inc.",s("system_profiler SPHardwareDataType -json",(function(r,i){try{const e=JSON.parse(i.toString());if(e&&e.SPHardwareDataType&&e.SPHardwareDataType.length){let t=e.SPHardwareDataType[0].boot_rom_version;t=t?t.split("(")[0].trim():null,n.version=t}}catch(e){o.noop()}e&&e(n),t(n)}))),g&&(n.vendor="Sun Microsystems",e&&e(n),t(n)),f)try{o.wmic("bios get /value").then(((r,i)=>{if(!i){let e=r.toString().split("\r\n");const t=o.getValue(e,"description","=");-1!==t.indexOf(" Version ")?(n.vendor=t.split(" Version ")[0].trim(),n.version=t.split(" Version ")[1].trim()):-1!==t.indexOf(" Ver: ")?(n.vendor=o.getValue(e,"manufacturer","="),n.version=t.split(" Ver: ")[1].trim()):(n.vendor=o.getValue(e,"manufacturer","="),n.version=o.getValue(e,"version","=")),n.releaseDate=o.getValue(e,"releasedate","="),n.releaseDate.length>=10&&(n.releaseDate=n.releaseDate.substr(0,4)+"-"+n.releaseDate.substr(4,2)+"-"+n.releaseDate.substr(6,2)),n.revision=o.getValue(e,"buildnumber","=")}e&&e(n),t(n)}))}catch(r){e&&e(n),t(n)}}))}))},t.baseboard=function(e){return new Promise((t=>{process.nextTick((()=>{let n={manufacturer:"",model:"",version:"",serial:"-",assetTag:"-",memMax:null,memSlots:null},s="";if(l||d||h||m){s="arm"===process.arch?"cat /proc/cpuinfo | grep Serial":"export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL";const u=[];u.push(c(s)),u.push(c("export LC_ALL=C; dmidecode -t memory 2>/dev/null")),o.promiseAll(u).then((s=>{let c=s.results[0]?s.results[0].toString().split("\n"):[""];n.manufacturer=o.getValue(c,"Manufacturer"),n.model=o.getValue(c,"Product Name"),n.version=o.getValue(c,"Version"),n.serial=o.getValue(c,"Serial Number"),n.assetTag=o.getValue(c,"Asset Tag");try{c=a('echo -n "board_asset_tag: "; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;\n echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;\n echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;\n echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;\n echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;').toString().split("\n"),n.manufacturer=n.manufacturer?n.manufacturer:o.getValue(c,"board_vendor"),n.model=n.model?n.model:o.getValue(c,"board_name"),n.version=n.version?n.version:o.getValue(c,"board_version"),n.serial=n.serial?n.serial:o.getValue(c,"board_serial"),n.assetTag=n.assetTag?n.assetTag:o.getValue(c,"board_asset_tag")}catch(e){o.noop()}-1!==n.serial.toLowerCase().indexOf("o.e.m.")&&(n.serial="-"),-1!==n.assetTag.toLowerCase().indexOf("o.e.m.")&&(n.assetTag="-"),c=s.results[1]?s.results[1].toString().split("\n"):[""],n.memMax=1024*o.toInt(o.getValue(c,"Maximum Capacity"))*1024*1024||null,n.memSlots=o.toInt(o.getValue(c,"Number Of Devices"))||null;const u=r.readFileSync("/proc/cpuinfo").toString().split("\n");if(o.getValue(u,"hardware").startsWith("BCM")){const e=o.decodePiCpuinfo(u);n.manufacturer=e.manufacturer,n.model="Raspberry Pi",n.serial=e.serial,n.version=e.type+" - "+e.revision,n.memMax=i.totalmem(),n.memSlots=0}e&&e(n),t(n)}))}if(p){const r=[];r.push(c("ioreg -c IOPlatformExpertDevice -d 2")),r.push(c("system_profiler SPMemoryDataType")),o.promiseAll(r).then((r=>{let s=r.results[0]?r.results[0].toString().replace(/[<>"]/g,"").split("\n"):[""];n.manufacturer=o.getValue(s,"manufacturer","=",!0),n.model=o.getValue(s,"model","=",!0),n.version=o.getValue(s,"version","=",!0),n.serial=o.getValue(s,"ioplatformserialnumber","=",!0),n.assetTag=o.getValue(s,"board-id","=",!0);let a=r.results[1]?r.results[1].toString().split(" BANK "):[""];1===a.length&&(a=r.results[1]?r.results[1].toString().split(" DIMM"):[""]),a.shift(),n.memSlots=a.length,"arm64"===i.arch()&&(n.memSlots=0,n.memMax=i.totalmem()),e&&e(n),t(n)}))}if(g&&(e&&e(n),t(n)),f)try{const r=[];r.push(o.wmic("baseboard get /value")),r.push(o.wmic("memphysical get MaxCapacity, MemoryDevices\t/value")),o.promiseAll(r).then((r=>{let i=r.results[0]?r.results[0].toString().split("\r\n"):[""];n.manufacturer=o.getValue(i,"manufacturer","="),n.model=o.getValue(i,"model","="),n.model||(n.model=o.getValue(i,"product","=")),n.version=o.getValue(i,"version","="),n.serial=o.getValue(i,"serialnumber","="),n.assetTag=o.getValue(i,"partnumber","="),n.assetTag||(n.assetTag=o.getValue(i,"sku","=")),i=r.results[1]?r.results[1].toString().split("\r\n"):[""],n.memMax=o.toInt(o.getValue(i,"MaxCapacity","="))||null,n.memSlots=o.toInt(o.getValue(i,"MemoryDevices","="))||null,e&&e(n),t(n)}))}catch(r){e&&e(n),t(n)}}))}))},t.chassis=function(e){const t=["Other","Unknown","Desktop","Low Profile Desktop","Pizza Box","Mini Tower","Tower","Portable","Laptop","Notebook","Hand Held","Docking Station","All in One","Sub Notebook","Space-Saving","Lunch Box","Main System Chassis","Expansion Chassis","SubChassis","Bus Expansion Chassis","Peripheral Chassis","Storage Chassis","Rack Mount Chassis","Sealed-Case PC","Multi-System Chassis","Compact PCI","Advanced TCA","Blade","Blade Enclosure","Tablet","Concertible","Detachable","IoT Gateway ","Embedded PC","Mini PC","Stick PC"];return new Promise((n=>{process.nextTick((()=>{let r={manufacturer:"",model:"",type:"",version:"",serial:"-",assetTag:"-",sku:""};if(l||d||h||m){s('echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;\n echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;\n echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;\n echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;\n echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;',(function(i,s){let a=s.toString().split("\n");r.manufacturer=o.getValue(a,"chassis_vendor");const c=parseInt(o.getValue(a,"chassis_type").replace(/\D/g,""));r.type=c&&!isNaN(c)&&c"]/g,"").split("\n");r.manufacturer=o.getValue(e,"manufacturer","=",!0),r.model=o.getValue(e,"model","=",!0),r.version=o.getValue(e,"version","=",!0),r.serial=o.getValue(e,"ioplatformserialnumber","=",!0),r.assetTag=o.getValue(e,"board-id","=",!0)}e&&e(r),n(r)})),g&&(e&&e(r),n(r)),f)try{o.wmic("path Win32_SystemEnclosure get /value").then(((i,s)=>{if(!s){let e=i.toString().split("\r\n");r.manufacturer=o.getValue(e,"manufacturer","="),r.model=o.getValue(e,"model","=");const n=parseInt(o.getValue(e,"ChassisTypes","=").replace(/\D/g,""));r.type=n&&!isNaN(n)&&n{"use strict";const r=n(3129).exec,i=n(1453);let o=process.platform;const s="linux"===o,a="darwin"===o,c="win32"===o,u="freebsd"===o,l="openbsd"===o,p="netbsd"===o,f="sunos"===o;function d(e){const t={},n=e.split("\n");if(n&&n.length&&n[0].indexOf("Device")>=0){const e=n[0].split(" ");t.bus=parseInt(e[0],10),e[2]?t.deviceId=parseInt(e[2],10):t.deviceId=null}else t.bus=null,t.deviceId=null;const r=i.getValue(n,"idVendor"," ",!0).trim();let o=r.split(" ");o.shift();const s=o.join(" "),a=i.getValue(n,"idProduct"," ",!0).trim();let c=a.split(" ");c.shift();const u=c.join(" ");let l=i.getValue(n,"bInterfaceClass"," ",!0).trim().split(" ");l.shift();const p=l.join(" ");let f=i.getValue(n,"iManufacturer"," ",!0).trim().split(" ");f.shift();const d=f.join(" ");return t.id=(r.startsWith("0x")?r.split(" ")[0].substr(2,10):"")+":"+(a.startsWith("0x")?a.split(" ")[0].substr(2,10):""),t.name=u,t.type=function(e,t){let n=e;const r=(t+" "+e).toLowerCase();return r.indexOf("camera")>=0?n="Camera":r.indexOf("hub")>=0?n="Hub":r.indexOf("keybrd")>=0||r.indexOf("keyboard")>=0?n="Keyboard":r.indexOf("mouse")>=0?n="Mouse":r.indexOf("stora")>=0?n="Storage":r.indexOf("mic")>=0?n="Microphone":(r.indexOf("headset")>=0||r.indexOf("audio")>=0)&&(n="Audio"),n}(p,u),t.removable=null,t.vendor=s,t.manufacturer=d,t.maxPower=i.getValue(n,"MaxPower"," ",!0),t.serialNumber=null,t}function h(e,t){const n={};n.id=t;let r=(e=(e=e.replace(/ \|/g,"")).trim()).split("\n");r.shift();try{for(let e=0;e=0?t="Camera":e.indexOf("touch bar")>=0?t="Touch Bar":e.indexOf("controller")>=0?t="Controller":e.indexOf("headset")>=0?t="Audio":e.indexOf("keyboard")>=0?t="Keyboard":e.indexOf("trackpad")>=0?t="Trackpad":e.indexOf("sensor")>=0?t="Sensor":e.indexOf("bthusb")>=0||e.indexOf("bth")>=0||e.indexOf("rfcomm")>=0?t="Bluetooth":e.indexOf("usbhub")>=0||e.indexOf(" hub")>=0?t="Hub":e.indexOf("mouse")>=0?t="Mouse":e.indexOf("mic")>=0?t="Microphone":e.indexOf("removable")>=0&&(t="Storage"),t}((e.kUSBProductString||e["USB Product Name"]||"").toLowerCase()+(t?" removable":"")),n.removable="no"===e["non-removable"].toLowerCase(),n.vendor=e.kUSBVendorString||e["USB Vendor Name"]||null,n.manufacturer=e.kUSBVendorString||e["USB Vendor Name"]||null,n.maxPower=null,n.serialNumber=e.kUSBSerialNumberString||null,n.name?n:null}catch(e){return null}}function m(e,t){const n=function(e,t){let n="";return t.indexOf("storage")>=0||t.indexOf("speicher")>=0?n="Storage":e.indexOf("usbhub")>=0?n="Hub":e.indexOf("storage")>=0?n="Storage":e.indexOf("usbcontroller")>=0?n="Controller":e.indexOf("keyboard")>=0?n="Keyboard":e.indexOf("pointing")>=0?n="Mouse":e.indexOf("disk")>=0&&(n="Storage"),n}(i.getValue(e,"CreationClassName","=").toLowerCase(),i.getValue(e,"name","=").toLowerCase());if(n){const r={bus:null};return r.deviceId=i.getValue(e,"deviceid","="),r.id=t,r.name=i.getValue(e,"name","="),r.type=n,r.removable=null,r.vendor=null,r.manufacturer=i.getValue(e,"Manufacturer","="),r.maxPower=null,r.serialNumber=null,r}return null}t.usb=function(e){return new Promise((t=>{process.nextTick((()=>{let n=[];if(s){r("export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL",{maxBuffer:134217728},(function(r,i){if(!r){const e=("\n\n"+i.toString()).split("\n\nBus ");for(let t=1;t{"use strict";const r=n(3129).exec,i=n(1453);let o=process.platform;const s="linux"===o,a="darwin"===o,c="win32"===o,u="freebsd"===o,l="openbsd"===o,p="netbsd"===o,f="sunos"===o;let d={dateFormat:"",dateSeperator:"",timeFormat:"",timeSeperator:"",amDesignator:"",pmDesignator:""};function h(e,t){let n=[],r=[],i={},o=!0,s=[],a=[],c={},u=!0;return e.forEach((function(e){if("---"===e)u=!1;else{let t=e.replace(/ +/g," ").split(" ");u?r.push({user:t[0],tty:t[1],date:t[2],time:t[3],ip:t&&t.length>4?t[4].replace(/\(/g,"").replace(/\)/g,""):""}):o?(s=t,s.forEach((function(t){a.push(e.indexOf(t))})),o=!1):(i.user=e.substring(a[0],a[1]-1).trim(),i.tty=e.substring(a[1],a[2]-1).trim(),i.ip=e.substring(a[2],a[3]-1).replace(/\(/g,"").replace(/\)/g,"").trim(),i.command=e.substring(a[7],1e3).trim(),c=r.filter((function(e){return e.user.substring(0,8).trim()===i.user&&e.tty===i.tty})),1===c.length&&n.push({user:c[0].user,tty:c[0].tty,date:c[0].date,time:c[0].time,ip:c[0].ip,command:i.command}))}})),0===n.length&&2===t?r:n}function m(e){let t=[],n=[],r={},i={},o=!0;return e.forEach((function(e){if("---"===e)o=!1;else{let s=e.replace(/ +/g," ").split(" ");o?n.push({user:s[0],tty:s[1],date:(new Date).getFullYear()+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(s[2].toUpperCase())/3+1)).slice(-2)+"-"+("0"+s[3]).slice(-2),time:s[4]}):(r.user=s[0],r.tty=s[1],r.ip="-"!==s[2]?s[2]:"",r.command=s.slice(5,1e3).join(" "),i=n.filter((function(e){return e.user===r.user&&(e.tty.substring(3,1e3)===r.tty||e.tty===r.tty)})),1===i.length&&t.push({user:i[0].user,tty:i[0].tty,date:i[0].date,time:i[0].time,ip:r.ip,command:r.command}))}})),t}t.users=function(e){return new Promise((t=>{process.nextTick((()=>{let n=[];if(s&&r('who --ips; echo "---"; w | tail -n +2',(function(i,o){if(i)e&&e(n),t(n);else{let i=o.toString().split("\n");n=h(i,1),0===n.length?r('who; echo "---"; w | tail -n +2',(function(r,o){r||(i=o.toString().split("\n"),n=h(i,2)),e&&e(n),t(n)})):(e&&e(n),t(n))}})),(u||l||p)&&r('who; echo "---"; w -ih',(function(r,i){if(!r){let e=i.toString().split("\n");n=m(e)}e&&e(n),t(n)})),f&&r('who; echo "---"; w -h',(function(r,i){if(!r){let e=i.toString().split("\n");n=m(e)}e&&e(n),t(n)})),a&&r('who; echo "---"; w -ih',(function(r,i){if(!r){let e=i.toString().split("\n");n=m(e)}e&&e(n),t(n)})),c)try{r("query user",i.execOptsWin,(function(r,o){if(o){let r=o.toString().split("\r\n");new Promise((e=>{process.nextTick((()=>{d.dateFormat?e(d):i.powerShell("(get-culture).DateTimeFormat").then((t=>{let n=t.toString().split("\r\n");d.dateFormat=i.getValue(n,"ShortDatePattern",":"),d.dateSeperator=i.getValue(n,"DateSeparator",":"),d.timeFormat=i.getValue(n,"ShortTimePattern",":"),d.timeSeperator=i.getValue(n,"TimeSeparator",":"),d.amDesignator=i.getValue(n,"AMDesignator",":"),d.pmDesignator=i.getValue(n,"PMDesignator",":"),e(d)})).catch((()=>{e(d)}))}))})).then((o=>{n=function(e,t){let n=[];const r=e[0],o=[];if(r){const s=" "===r[0]?1:0;o.push(s-1);let a=0;for(let e=s+1;e{"use strict";const r=n(2087),i=n(5747),o=n(5622),s=n(3129).spawn,a=n(3129).exec,c=n(3129).execSync,u=n(1669);let l=process.platform;const p="linux"===l,f="darwin"===l,d="win32"===l,h="freebsd"===l,m="openbsd"===l,g="netbsd"===l;let v=0,y="",_="";const E=process.env.WINDIR||"C:\\Windows",b={windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:u._extend({},process.env,{LANG:"en_US.UTF-8"})};const w=(new String).replace,S=(new String).toLowerCase,I=(new String).toString,C=(new String).substr,x=(new String).trim,O=(new String).startsWith,T=Math.min;function A(e,t,n,r){n=n||":",t=t.toLowerCase(),r=r||!1;for(let i=0;i=2?(t.shift(),t.join(n).trim()):""}}return""}function N(){if("Windows_NT"===r.type()&&!y&&(y=E+"\\system32\\wbem\\wmic.exe",!i.existsSync(y)))try{const e=c("WHERE WMIC",b).toString().split("\r\n");y=e&&e.length?e[0]:"wmic"}catch(e){y="wmic"}return y}t.toInt=function(e){let t=parseInt(e,10);return isNaN(t)&&(t=0),t},t.execOptsWin=b,t.getCodepage=function(){if(d){if(!_)try{const e=c("chcp",b),t=e.toString().split("\r\n")[0].split(":");_=t.length>1?t[1].replace(".",""):""}catch(e){_="437"}return _}if(p||f||h||m||g){if(!_)try{const e=c("echo $LANG"),t=e.toString().split("\r\n")[0].split(".");_=t.length>1?t[1].trim():"",_||(_="UTF-8")}catch(e){_="UTF-8"}return _}},t.execWin=function(e,t,n){n||(n=t,t=b),a("chcp 65001 > nul && cmd /C "+e+" && chcp "+_+" > nul",t,(function(e,t){n(e,t)}))},t.isFunction=function(e){return e&&"[object Function]"==={}.toString.call(e)},t.unique=function(e){let t=[],n={};for(let r=0;ri?1:0}))},t.cores=function(){return 0===v&&(v=r.cpus().length),v},t.getValue=A,t.decodeEscapeSequence=function(e,t){return t=t||16,e.replace(/\\x([0-9A-Fa-f]{2})/g,(function(){return String.fromCharCode(parseInt(arguments[1],t))}))},t.parseDateTime=function(e,t){const n={date:"",time:""};let r=((t=t||{}).dateFormat||"").toLowerCase(),i=t.pmDesignator||"";const o=e.split(" ");if(o[0]){if(o[0].indexOf("/")>=0){const t=o[0].split("/");if(3===t.length)if(4===t[0].length)n.date=t[0]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[2]).substr(-2);else if(2===t[2].length)r.indexOf("/d/")>-1||r.indexOf("/dd/"),n.date="20"+t[2]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[0]).substr(-2);else{(e.toLowerCase().indexOf("pm")>-1||e.toLowerCase().indexOf("p.m.")>-1||e.toLowerCase().indexOf("p. m.")>-1||e.toLowerCase().indexOf("am")>-1||e.toLowerCase().indexOf("a.m.")>-1||e.toLowerCase().indexOf("a. m.")>-1||r.indexOf("/d/")>-1||r.indexOf("/dd/")>-1)&&0!==r.indexOf("dd/")?n.date=t[2]+"-"+("0"+t[0]).substr(-2)+"-"+("0"+t[1]).substr(-2):n.date=t[2]+"-"+("0"+t[1]).substr(-2)+"-"+("0"+t[0]).substr(-2)}}if(o[0].indexOf(".")>=0){const e=o[0].split(".");3===e.length&&(r.indexOf(".d.")>-1||r.indexOf(".dd.")>-1?n.date=e[2]+"-"+("0"+e[0]).substr(-2)+"-"+("0"+e[1]).substr(-2):n.date=e[2]+"-"+("0"+e[1]).substr(-2)+"-"+("0"+e[0]).substr(-2))}if(o[0].indexOf("-")>=0){const e=o[0].split("-");3===e.length&&(n.date=e[0]+"-"+("0"+e[1]).substr(-2)+"-"+("0"+e[2]).substr(-2))}}if(o[1]){o.shift();let e=o.join(" ");n.time=function(e,t){t=t||"";let n=0,r=0,i=function(e){let t="",n=0;return e.split("").forEach((e=>{e>="0"&&e<="9"?1===n&&n++:(0===n&&n++,1===n&&(t+=e))})),t}(e=e.toUpperCase()),o=e.split(i);if(o.length>=2){o[2]&&(o[1]+=o[2]);let e=o[1]&&o[1].toLowerCase().indexOf("pm")>-1||o[1].toLowerCase().indexOf("p.m.")>-1||o[1].toLowerCase().indexOf("p. m.")>-1||o[1].toLowerCase().indexOf("n")>-1||o[1].toLowerCase().indexOf("ch")>-1||o[1].toLowerCase().indexOf("ös")>-1||t&&o[1].toLowerCase().indexOf(t)>-1;return n=parseInt(o[0],10),r=parseInt(o[1],10),n=e&&n<12?n+12:n,("0"+n).substr(-2)+":"+("0"+r).substr(-2)}}(e,i)}return n},t.parseHead=function(e,t){let n=t>0,r=1,i=0,o=0,s=[];for(let a=0;a{process.nextTick((()=>{try{a(E+"\\system32\\chcp.com 65001 | "+N()+" "+e,t,(function(e,t){n(t,e)})).stdin.end()}catch(e){n("",e)}}))}))},t.darwinXcodeExists=function(){const e=i.existsSync("/Library/Developer/CommandLineTools/usr/bin/"),t=i.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"),n=i.existsSync("/Library/Developer/Xcode/");return e||n||t},t.getVboxmanage=function(){return d?`"${process.env.VBOX_INSTALL_PATH||process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"`:"vboxmanage"},t.powerShell=function(e){let t="";return new Promise((n=>{process.nextTick((()=>{try{const i=s("powershell.exe",["-NoLogo","-InputFormat","Text","-NoExit","-ExecutionPolicy","Unrestricted","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:u._extend({},process.env,{LANG:"en_US.UTF-8"})});if(i&&!i.pid&&i.on("error",(function(){n(t)})),i&&i.pid){i.stdout.on("data",(function(e){t+=e.toString("utf8")})),i.stderr.on("data",(function(){i.kill(),n(t)})),i.on("close",(function(){i.kill(),n(t)})),i.on("error",(function(){i.kill(),n(t)}));try{i.stdin.write(e+r.EOL),i.stdin.write("exit"+r.EOL),i.stdin.end()}catch(e){i.kill(),n(t)}}else n(t)}catch(e){n(t)}}))}))},t.execSafe=function(e,t,n){let r="";return n=n||{},new Promise((i=>{process.nextTick((()=>{try{const o=s(e,t,n);o&&!o.pid&&o.on("error",(function(){i(r)})),o&&o.pid?(o.stdout.on("data",(function(e){r+=e.toString()})),o.on("close",(function(){o.kill(),i(r)})),o.on("error",(function(){o.kill(),i(r)}))):i(r)}catch(e){i(r)}}))}))},t.nanoSeconds=function(){const e=process.hrtime();return Array.isArray(e)&&2===e.length?1e9*+e[0]+ +e[1]:0},t.countUniqueLines=function(e,t){t=t||"";const n=[];return e.forEach((e=>{e.startsWith(t)&&-1===n.indexOf(e)&&n.push(e)})),n.length},t.countLines=function(e,t){t=t||"";const n=[];return e.forEach((e=>{e.startsWith(t)&&n.push(e)})),n.length},t.noop=function(){},t.isRaspberry=function(){let e=[];try{e=i.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split("\n")}catch(e){return!1}const t=A(e,"hardware");return t&&["BCM2708","BCM2709","BCM2710","BCM2711","BCM2835","BCM2836","BCM2837","BCM2837B0"].indexOf(t)>-1},t.isRaspbian=function(){let e=[];try{e=i.readFileSync("/etc/os-release",{encoding:"utf8"}).toString().split("\n")}catch(e){return!1}const t=A(e,"id","=");return t&&t.indexOf("raspbian")>-1},t.sanitizeShellString=function(e,t=!1){const n=e||"";let r="";for(let e=0;e<=T(n.length,2e3);e++)void 0===n[e]||">"===n[e]||"<"===n[e]||"*"===n[e]||"?"===n[e]||"["===n[e]||"]"===n[e]||"|"===n[e]||"˚"===n[e]||"$"===n[e]||";"===n[e]||"&"===n[e]||"("===n[e]||")"===n[e]||"]"===n[e]||"#"===n[e]||"\\"===n[e]||"\t"===n[e]||"\n"===n[e]||"'"===n[e]||"`"===n[e]||'"'===n[e]||n[e].length>1||t&&"@"===n[e]||t&&" "===n[e]||t&&"{"==n[e]||t&&")"==n[e]||(r+=n[e]);return r},t.isPrototypePolluted=function(){const e="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";let t=!0,n="";n.__proto__.replace=w,n.__proto__.toLowerCase=S,n.__proto__.toString=I,n.__proto__.substr=C,t=t||!(62===e.length);const r=Date.now();if("number"==typeof r&&r>16e11){const i=r%100+15;for(let r=0;r{"use strict";const r=n(2087),i=n(3129).exec,o=n(1453);t.vboxInfo=function(e){let t=[];return new Promise((n=>{process.nextTick((()=>{try{i(o.getVboxmanage()+" list vms --long",(function(i,s){let a=(r.EOL+s.toString()).split(r.EOL+"Name:");a.shift(),a.forEach((e=>{const n=("Name:"+e).split(r.EOL),i=o.getValue(n,"State"),s=i.startsWith("running"),a=s?i.replace("running (since ","").replace(")","").trim():"";let c=0;try{if(s){const e=new Date(a),t=e.getTimezoneOffset();c=Math.round((Date.now()-Date.parse(e))/1e3)+60*t}}catch(e){o.noop()}const u=s?"":i.replace("powered off (since","").replace(")","").trim();let l=0;try{if(!s){const e=new Date(u),t=e.getTimezoneOffset();l=Math.round((Date.now()-Date.parse(e))/1e3)+60*t}}catch(e){o.noop()}t.push({id:o.getValue(n,"UUID"),name:o.getValue(n,"Name"),running:s,started:a,runningSince:c,stopped:u,stoppedSince:l,guestOS:o.getValue(n,"Guest OS"),hardwareUUID:o.getValue(n,"Hardware UUID"),memory:parseInt(o.getValue(n,"Memory size"," "),10),vram:parseInt(o.getValue(n,"VRAM size"),10),cpus:parseInt(o.getValue(n,"Number of CPUs"),10),cpuExepCap:o.getValue(n,"CPU exec cap"),cpuProfile:o.getValue(n,"CPUProfile"),chipset:o.getValue(n,"Chipset"),firmware:o.getValue(n,"Firmware"),pageFusion:"enabled"===o.getValue(n,"Page Fusion"),configFile:o.getValue(n,"Config file"),snapshotFolder:o.getValue(n,"Snapshot folder"),logFolder:o.getValue(n,"Log folder"),hpet:"enabled"===o.getValue(n,"HPET"),pae:"enabled"===o.getValue(n,"PAE"),longMode:"enabled"===o.getValue(n,"Long Mode"),tripleFaultReset:"enabled"===o.getValue(n,"Triple Fault Reset"),apic:"enabled"===o.getValue(n,"APIC"),x2Apic:"enabled"===o.getValue(n,"X2APIC"),acpi:"enabled"===o.getValue(n,"ACPI"),ioApic:"enabled"===o.getValue(n,"IOAPIC"),biosApicMode:o.getValue(n,"BIOS APIC mode"),bootMenuMode:o.getValue(n,"Boot menu mode"),bootDevice1:o.getValue(n,"Boot Device 1"),bootDevice2:o.getValue(n,"Boot Device 2"),bootDevice3:o.getValue(n,"Boot Device 3"),bootDevice4:o.getValue(n,"Boot Device 4"),timeOffset:o.getValue(n,"Time offset"),rtc:o.getValue(n,"RTC")})})),e&&e(t),n(t)}))}catch(r){e&&e(t),n(t)}}))}))}},2023:(e,t,n)=>{"use strict";const r=n(2087),i=n(3129).exec,o=n(3129).execSync,s=n(1453);let a=process.platform;const c="linux"===a,u="darwin"===a,l="win32"===a;function p(e){return parseFloat(e)/2-100}function f(e){const t=2*(parseFloat(e)+100);return t<=100?t:100}const d={1:2412,2:2417,3:2422,4:2427,5:2432,6:2437,7:2442,8:2447,9:2452,10:2457,11:2462,12:2467,13:2472,14:2484,32:5160,34:5170,36:5180,38:5190,40:5200,42:5210,44:5220,46:5230,48:5240,50:5250,52:5260,54:5270,56:5280,58:5290,60:5300,62:5310,64:5320,68:5340,96:5480,100:5500,102:5510,104:5520,106:5530,108:5540,110:5550,112:5560,114:5570,116:5580,118:5590,120:5600,122:5610,124:5620,126:5630,128:5640,132:5660,134:5670,136:5680,138:5690,140:5700,142:5710,144:5720,149:5745,151:5755,153:5765,155:5775,157:5785,159:5795,161:5805,165:5825,169:5845,173:5865,183:4915,184:4920,185:4925,187:4935,188:4940,189:4945,192:4960,196:4980};function h(e){return{}.hasOwnProperty.call(d,e)?d[e]:null}function m(e){let t=0;for(let n in d)({}).hasOwnProperty.call(d,n)&&d[n]===e&&(t=s.toInt(n));return t}function g(){const e=[];try{const t=o("iw dev").toString().split("\n").map((e=>e.trim())).join("\n").split("\nInterface ");return t.shift(),t.forEach((t=>{const n=t.split("\n"),r=n[0],i=s.toInt(s.getValue(n,"ifindex"," ")),o=s.getValue(n,"addr"," "),a=s.toInt(s.getValue(n,"channel"," "));e.push({id:i,iface:r,mac:o,channel:a})})),e}catch(e){return[]}}function v(e){const t=`nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${e} 2>/dev/null`;try{const n=o(t).toString().split("\n"),r=s.getValue(n,"GENERAL.CONNECTION");return{iface:e,type:s.getValue(n,"GENERAL.TYPE"),vendor:s.getValue(n,"GENERAL.VENDOR"),product:s.getValue(n,"GENERAL.PRODUCT"),mac:s.getValue(n,"GENERAL.HWADDR").toLowerCase(),ssid:"--"!==r?r:null}}catch(e){return{}}}function y(){const e=[];try{const t=o("nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null",{maxBuffer:2048e4}).toString().split("ACTIVE:");return t.shift(),t.forEach((t=>{const n=(t="ACTIVE:"+t).split(r.EOL),i=s.getValue(n,"CHAN"),o=s.getValue(n,"FREQ").toLowerCase().replace("mhz","").trim(),a=s.getValue(n,"SECURITY").replace("(","").replace(")",""),c=s.getValue(n,"WPA-FLAGS").replace("(","").replace(")",""),u=s.getValue(n,"RSN-FLAGS").replace("(","").replace(")","");e.push({ssid:s.getValue(n,"SSID"),bssid:s.getValue(n,"BSSID").toLowerCase(),mode:s.getValue(n,"MODE"),channel:i?parseInt(i,10):null,frequency:o?parseInt(o,10):null,signalLevel:p(s.getValue(n,"SIGNAL")),quality:parseFloat(s.getValue(n,"SIGNAL")),security:a&&"none"!==a?a.split(" "):[],wpaFlags:c&&"none"!==c?c.split(" "):[],rsnFlags:u&&"none"!==u?u.split(" "):[]})})),e}catch(e){return[]}}function _(e){const t=[];try{let n=o(`export LC_ALL=C; iwlist ${e} scan 2>&1; unset LC_ALL`).toString().split(" Cell ");if(n[0].indexOf("resource busy")>=0)return-1;if(n.length>1){n.shift();for(let e=0;e=0?r[0].split("Address:")[1].trim().toLowerCase():"",a=s.getValue(r,"mode",":",!0),c=s.getValue(r,"frequency",":",!0),u=s.getValue(r,"Quality","=",!0).toLowerCase().split("signal level="),l=u.length>1?s.toInt(u[1]):0,p=l?f(l):0,d=s.getValue(r,"essid",":",!0),h=n[e].indexOf(" WPA ")>=0,m=n[e].indexOf("WPA2 ")>=0,g=[];h&&g.push("WPA"),m&&g.push("WPA2");const v=[];let y="";r.forEach((function(e){const t=e.trim().toLowerCase();if(t.indexOf("group cipher")>=0){y&&v.push(y);const e=t.split(":");e.length>1&&(y=e[1].trim().toUpperCase())}if(t.indexOf("pairwise cipher")>=0){const e=t.split(":");e.length>1&&(e[1].indexOf("tkip")?y=y?"TKIP/"+y:"TKIP":e[1].indexOf("ccmp")?y=y?"CCMP/"+y:"CCMP":e[1].indexOf("proprietary")&&(y=y?"PROP/"+y:"PROP"))}if(t.indexOf("authentication suites")>=0){const e=t.split(":");e.length>1&&(e[1].indexOf("802.1x")?y=y?"802.1x/"+y:"802.1x":e[1].indexOf("psk")&&(y=y?"PSK/"+y:"PSK"))}})),y&&v.push(y),t.push({ssid:d,bssid:o,mode:a,channel:i?s.toInt(i):null,frequency:c?s.toInt(c.replace(".","")):null,signalLevel:l,quality:p,security:g,wpaFlags:v,rsnFlags:[]})}}return t}catch(e){return-1}}t.wifiNetworks=function(e){return new Promise((t=>{process.nextTick((()=>{let n=[];if(c)if(n=y(),0===n.length)try{const r=o("export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL").toString().split("\n\n");let i="";for(let e=0;e1){const e=s.parseHead(a[0],1);e.length>=7&&(a.shift(),a.forEach((t=>{if(t.trim()){const r=t.substring(e[3].from,e[3].to).trim(),i=r?parseInt(r,10):null,o=t.substring(e[2].from,e[2].to).trim(),s=t.substring(e[6].from,1e3).trim().split(" ");let a=[],c=[];s.forEach((e=>{if(e.indexOf("(")>0){const t=e.split("(");a.push(t[0]),c=c.concat(t[1].replace(")","").split(","))}})),c=Array.from(new Set(c)),n.push({ssid:t.substring(e[0].from,e[0].to).trim(),bssid:t.substring(e[1].from,e[1].to).trim().toLowerCase(),mode:"",channel:i,frequency:h(i),signalLevel:o?parseInt(o,10):null,quality:f(o),security:a,wpaFlags:c,rsnFlags:[]})}})))}e&&e(n),t(n)}))}else if(l){i("chcp 65001 && netsh wlan show networks mode=Bssid",s.execOptsWin,(function(i,o){const s=o.toString("utf8").split(r.EOL+r.EOL+"SSID ");s.shift(),s.forEach((e=>{const t=e.split(r.EOL);if(t&&t.length>=8&&t[0].indexOf(":")>=0){let e=t[4].split(":");e.shift(),e=e.join(":").trim().toLowerCase();const r=t[7].split(":").pop().trim(),i=t[5].split(":").pop().trim();n.push({ssid:t[0].split(":").pop().trim(),bssid:e,mode:"",channel:r?parseInt(r,10):null,frequency:h(r),signalLevel:p(i),quality:i?parseInt(i,10):null,security:[t[2].split(":").pop().trim()],wpaFlags:[t[3].split(":").pop().trim()],rsnFlags:[]})}})),e&&e(n),t(n)}))}else e&&e(n),t(n)}))}))},t.wifiConnections=function(e){return new Promise((t=>{process.nextTick((()=>{const n=[];if(c){const r=g(),i=y();r.forEach((e=>{const t=v(e.iface),r=function(e){const t=`wpa_cli -i ${e} status 2>&1`;try{const e=o(t).toString().split("\n"),n=s.toInt(s.getValue(e,"freq","="));return{ssid:s.getValue(e,"ssid","="),uuid:s.getValue(e,"uuid","="),security:s.getValue(e,"key_mgmt","="),freq:n,channel:m(n),bssid:s.getValue(e,"bssid","=").toLowerCase()}}catch(e){return{}}}(e.iface),a=t.ssid||r.ssid,c=i.filter((e=>e.ssid===a)),u=function(e){const t=`nmcli -t --show-secrets connection show ${e} 2>/dev/null`;try{const n=o(t).toString().split("\n"),r=s.getValue(n,"802-11-wireless.seen-bssids").toLowerCase();return{ssid:"--"!==e?e:null,uuid:s.getValue(n,"connection.uuid"),type:s.getValue(n,"connection.type"),autoconnect:"yes"===s.getValue(n,"connection.autoconnect"),security:s.getValue(n,"802-11-wireless-security.key-mgmt"),bssid:"--"!==r?r:null}}catch(e){return{}}}(a),l=c&&c.length&&c[0].channel?c[0].channel:r.channel?r.channel:null,p=c&&c.length&&c[0].bssid?c[0].bssid:r.bssid?r.bssid:null;a&&p&&n.push({id:e.id,iface:e.iface,model:t.product,ssid:a,bssid:c&&c.length&&c[0].bssid?c[0].bssid:r.bssid?r.bssid:null,channel:l,frequency:l?h(l):null,type:u.type?u.type:"802.11",security:u.security?u.security:r.security?r.security:null,signalLevel:c&&c.length&&c[0].signalLevel?c[0].signalLevel:null,txRate:null})})),e&&e(n),t(n)}else if(u){let r="system_profiler SPNetworkDataType";i(r,(function(o,a){const c=a.toString().split("\n\n Wi-Fi:\n\n");if(c.length>1){const o=c[1].split("\n\n")[0].split("\n"),a=s.getValue(o,"BSD Device Name",":",!0),u=s.getValue(o,"hardware",":",!0);r="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I",i(r,(function(r,i){const c=i.toString().split("\n");if(o.length>10){const e=s.getValue(c,"ssid",":",!0),t=s.getValue(c,"bssid",":",!0),r=s.getValue(c,"link auth",":",!0),i=s.getValue(c,"lastTxRate",":",!0),o=s.getValue(c,"channel",":",!0).split(",")[0],l="802.11",p=s.toInt(s.getValue(c,"agrCtlRSSI",":",!0))-s.toInt(s.getValue(c,"agrCtlNoise",":",!0));e&&t&&n.push({id:"Wi-Fi",iface:a,model:u,ssid:e,bssid:t,channel:s.toInt(o),frequency:o?h(o):null,type:l,security:r,signalLevel:p,txRate:i})}e&&e(n),t(n)}))}}))}else if(l){i("netsh wlan show interfaces",s.execOptsWin,(function(r,i){const o=i.toString().split(":\r\n\r\n");o.shift(),o.forEach((e=>{const t=e.split("\r\n");if(t.length>=5){const e=t[0].indexOf(":")>=0?t[0].split(":")[1].trim():"",r=t[1].indexOf(":")>=0?t[1].split(":")[1].trim():"",i=t[2].indexOf(":")>=0?t[2].split(":")[1].trim():"",o=s.getValue(t,"SSID",":",!0),a=s.getValue(t,"BSSID",":",!0),c=s.getValue(t,"Signal",":",!0),u=s.getValue(t,"Radio type",":",!0)||s.getValue(t,"Type de radio",":",!0)||s.getValue(t,"Funktyp",":",!0)||null,l=s.getValue(t,"authentication",":",!0)||s.getValue(t,"Authentification",":",!0)||s.getValue(t,"Authentifizierung",":",!0)||null,p=s.getValue(t,"Channel",":",!0)||s.getValue(t,"Canal",":",!0)||s.getValue(t,"Kanal",":",!0)||null,f=s.getValue(t,"Transmit rate (mbps)",":",!0)||s.getValue(t,"Transmission (mbit/s)",":",!0)||s.getValue(t,"Empfangsrate (MBit/s)",":",!0)||null;r&&i&&o&&a&&n.push({id:i,iface:e,model:r,ssid:o,bssid:a,channel:s.toInt(p),frequency:p?h(p):null,type:u,security:l,signalLevel:c,txRate:s.toInt(f)||null})}})),e&&e(n),t(n)}))}else e&&e(n),t(n)}))}))},t.wifiInterfaces=function(e){return new Promise((t=>{process.nextTick((()=>{const n=[];if(c){g().forEach((e=>{const t=v(e.iface);n.push({id:e.id,iface:e.iface,model:t.product?t.product:null,vendor:t.vendor?t.vendor:null,mac:e.mac})})),e&&e(n),t(n)}else if(u){i("system_profiler SPNetworkDataType",(function(r,i){const o=i.toString().split("\n\n Wi-Fi:\n\n");if(o.length>1){const e=o[1].split("\n\n")[0].split("\n"),t=s.getValue(e,"BSD Device Name",":",!0),r=s.getValue(e,"MAC Address",":",!0),i=s.getValue(e,"hardware",":",!0);n.push({id:"Wi-Fi",iface:t,model:i,vendor:"",mac:r})}e&&e(n),t(n)}))}else if(l){i("netsh wlan show interfaces",s.execOptsWin,(function(r,i){const o=i.toString().split(":\r\n\r\n");o.shift(),o.forEach((e=>{const t=e.split("\r\n");if(t.length>=5){const e=t[0].indexOf(":")>=0?t[0].split(":")[1].trim():"",r=t[1].indexOf(":")>=0?t[1].split(":")[1].trim():"",i=t[2].indexOf(":")>=0?t[2].split(":")[1].trim():"",o=t[3].indexOf(":")>=0?t[3].split(":"):[];o.shift();const s=o.join(":").trim(),a=function(e){let t="";return(e=e.toLowerCase()).indexOf("intel")>=0?t="Intel":e.indexOf("realtek")>=0?t="Realtek":e.indexOf("qualcom")>=0?t="Qualcom":e.indexOf("broadcom")>=0?t="Broadcom":e.indexOf("cavium")>=0?t="Cavium":e.indexOf("cisco")>=0?t="Cisco":e.indexOf("marvel")>=0?t="Marvel":e.indexOf("zyxel")>=0?t="Zyxel":e.indexOf("melanox")>=0?t="Melanox":e.indexOf("d-link")>=0?t="D-Link":e.indexOf("tp-link")>=0?t="TP-Link":e.indexOf("asus")>=0?t="Asus":e.indexOf("linksys")>=0&&(t="Linksys"),t}(r);e&&r&&i&&s&&n.push({id:i,iface:e,model:r,vendor:a,mac:s})}})),e&&e(n),t(n)}))}else e&&e(n),t(n)}))}))}},702:e=>{"use strict";e.exports={i8:"5.6.12"}},6276:(e,t,n)=>{ /*! * Tmp * * Copyright (c) 2011-2017 KARASZI Istvan * * MIT Licensed */ const r=n(5747),i=n(2087),o=n(5622),s=n(6417),a={fs:r.constants,os:i.constants},c=n(984),u="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",l=/XXXXXX/,p=(a.O_CREAT||a.fs.O_CREAT)|(a.O_EXCL||a.fs.O_EXCL)|(a.O_RDWR||a.fs.O_RDWR),f="win32"===i.platform(),d=a.EBADF||a.os.errno.EBADF,h=a.ENOENT||a.os.errno.ENOENT,m=[],g=r.rmdirSync.bind(r),v=c.sync;let y=!1;function _(e,t){const n=A(e,t),i=n[0],o=n[1];try{P(i)}catch(e){return o(e)}let s=i.tries;!function e(){try{const t=N(i);r.stat(t,(function(n){if(!n)return s-- >0?e():o(new Error("Could not get a unique tmp filename, max tries reached "+t));o(null,t)}))}catch(e){o(e)}}()}function E(e){const t=A(e)[0];P(t);let n=t.tries;do{const e=N(t);try{r.statSync(e)}catch(t){return e}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function b(e,t){const n=function(e){if(e&&!D(e))return t(e);t()};0<=e[0]?r.close(e[0],(function(){r.unlink(e[1],n)})):r.unlink(e[1],n)}function w(e){let t=null;try{0<=e[0]&&r.closeSync(e[0])}catch(e){if(!(n=e,M(n,-d,"EBADF")||D(e)))throw e}finally{try{r.unlinkSync(e[1])}catch(e){D(e)||(t=e)}}var n;if(null!==t)throw t}function S(e,t,n,r){const i=C(w,[t,e],r),o=C(b,[t,e],r,i);return n.keep||m.unshift(i),r?i:o}function I(e,t,n){const i=t.unsafeCleanup?c:r.rmdir.bind(r),o=C(t.unsafeCleanup?v:g,e,n),s=C(i,e,n,o);return t.keep||m.unshift(o),n?o:s}function C(e,t,n,r){let i=!1;return function o(s){if(!i){const a=r||o,c=m.indexOf(a);return c>=0&&m.splice(c,1),i=!0,n||e===g||e===v?e(t):e(t,s||function(){})}}}function x(e){let t=[],n=null;try{n=s.randomBytes(e)}catch(t){n=s.pseudoRandomBytes(e)}for(var r=0;r{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.LOCAL="LOCAL",e.CLOUD="CLOUD",e.VANILLA="VANILLA",e.VANILLA_KEYWORD="VANILLA_KEYWORD",e.LSP="LSP",e.UNKNOWN="UNKNOWN"}(n||(n={})),t.default=n},6817:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(5104),o=n(7054),s=n(2478),a=n(7498),c=n(8083),u=n(4372),l=n(6136),p=n(4365);t.default=async function(e,t){await r.commands.executeCommand("setContext",p.CAPABILITY_KEY,!0),l.setAssistantMode(l.AssistantMode.Background);let n=!0;o.isCapabilityEnabled(o.Capability.ASSISTANT_BACKGROUND_CAPABILITY)||o.isCapabilityEnabled(o.Capability.ASSISTANT_PASTE_CAPABILITY)&&(n=!1,l.setAssistantMode(l.AssistantMode.Paste)),await r.commands.executeCommand("setContext",p.BACKGROUND_KEY,n);let f=e.globalState.get(p.ACTIVE_STATE_KEY,n);if(null==f&&(f=!0),function(e,t){e.subscriptions.push(r.commands.registerCommand(p.ASSISTANT_TOGGLE_COMMAND,(async()=>{const n=t?"Off":"On",o=`Please reload Visual Studio Code to turn Assistant ${n}.`;await r.window.showInformationMessage(o,"Reload Now")&&(i.default({[s.StatePayload.STATE]:{state_type:c.StateType.toggle,state:n}}),await e.globalState.update(p.ACTIVE_STATE_KEY,!t),r.commands.executeCommand("workbench.action.reloadWindow"))})))}(e,f),f){await c.downloadAssistantBinary()&&(t.dispose(),await a.default(e,t),e.subscriptions.push(r.commands.registerTextEditorCommand(p.ASSISTANT_SELECTION_COMMAND,((e,t,n)=>{u.assistantSelectionHandler(e,t,n)}))),e.subscriptions.push(r.commands.registerTextEditorCommand(p.ASSISTANT_IGNORE_COMMAND,((e,t,n)=>{u.assistantIgnoreHandler(e,t,n)}))),n&&e.subscriptions.push(r.commands.registerCommand(p.ASSISTANT_CLEAR_CACHE_COMMAND,u.assistantClearCacheHandler)),await r.commands.executeCommand("setContext",p.ENABLED_KEY,!0))}}},6167:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(6136),o=n(4365);class s{provideCodeActions(e,t,n){const s=[];return n.diagnostics.filter((e=>e.code===o.TABNINE_DIAGNOSTIC_CODE)).forEach((t=>{t.choices.forEach((n=>{s.push(function(e,t,n){const{range:s}=t,a=`${n.message} '${n.value}'`,c=new r.CodeAction(a,r.CodeActionKind.QuickFix);c.edit=new r.WorkspaceEdit,c.edit.replace(e.uri,new r.Range(s.start,s.end),n.value),i.getAssistantMode()===i.AssistantMode.Paste&&t.references.forEach((t=>{var r;return null===(r=c.edit)||void 0===r?void 0:r.replace(e.uri,t,n.value)}));return c.diagnostics=[t],c.command={arguments:[{currentSuggestion:n,allSuggestions:t.choices,reference:t.reference,threshold:t.threshold}],command:o.ASSISTANT_SELECTION_COMMAND,title:"accept replacement"},c}(e,t,n))}));const n=new r.CodeAction("Ignore TabNine Assistant suggestions at this spot",r.CodeActionKind.QuickFix);n.command={arguments:[{allSuggestions:t.choices,reference:t.reference,threshold:t.threshold,responseId:t.responseId}],command:o.ASSISTANT_IGNORE_COMMAND,title:"ignore replacement"},s.push(n)})),s}}t.default=s,s.providedCodeActionKinds=[r.CodeActionKind.QuickFix]},4372:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assistantIgnoreHandler=t.assistantSelectionHandler=t.assistantClearCacheHandler=void 0;const r=n(7549),i=n(5104),o=n(6291),s=n(2478),a=n(8083),c=n(6835),u=n(7007),l=n(3934),p=n(4365),f=n(7498);function d(e,t,n,r,i,s=!1,a){let c=n.findIndex((e=>e===t));-1===c&&(c=n.length);const u=n.map((e=>({length:e.value.length,strength:h(e),origin:o.default.CLOUD}))),{length:l}=t.value,p=t.value,f=h(t),d=o.default.CLOUD;return{AssistantSelection:{language:e.document.fileName.split(".").pop()||"",length:l,strength:f,origin:d,index:c,threshold:i,num_of_suggestions:n.length,suggestions:u,selected_suggestion:p,reference:r,reference_length:r.length,is_ignore:s,assistant_version:a}}}function h(e){return`${e.score}%`}t.assistantClearCacheHandler=async function(){await c.default(),i.default({[s.StatePayload.STATE]:{state_type:a.StateType.clearCache}})},t.assistantSelectionHandler=async function(e,t,{currentSuggestion:n,allSuggestions:o,reference:s,threshold:a}){try{f.setDecorators([]),await r.commands.executeCommand(p.ASSISTANT_IGNORE_REFRESH_COMMAND);const t=d(e,n,o,s,a,!1,await l.getAssistantVersion());i.default(t)}catch(e){console.error(e)}},t.assistantIgnoreHandler=async function(e,t,{allSuggestions:n,reference:o,threshold:s,responseId:a}){try{await u.default(a),f.setDecorators([]);const t=await l.getAssistantVersion();r.commands.executeCommand(p.ASSISTANT_IGNORE_REFRESH_COMMAND);const c=d(e,{value:"__IGNORE__",score:0,message:""},n,o,s,!0,t);i.default(c)}catch(e){console.error(e)}}},6136:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.getAssistantMode=t.setAssistantMode=t.AssistantMode=void 0,function(e){e[e.Background=0]="Background",e[e.Paste=1]="Paste"}(n=t.AssistantMode||(t.AssistantMode={}));let r=n.Background;t.setAssistantMode=function(e){r=e},t.getAssistantMode=function(){return r}},9158:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4017),i=n(1058),o=n(9688);t.default=class{constructor(){this.numRestarts=0,this.childDead=!1,this.mutex=new r.Mutex,this.resolveMap=new Map,this.isShutdown=!1,this.restartChild()}async post(e,t,n=1e4){var r,i;const o=await this.mutex.acquire();try{this.isChildAlive()||this.restartChild();const s=`${JSON.stringify(e)}\n`;return null===(i=null===(r=this.proc)||void 0===r?void 0:r.stdin)||void 0===i||i.write(s,"utf8"),await new Promise(((e,r)=>{this.resolveMap.set(t,e),setTimeout((()=>{this.resolveMap.delete(t),r(new Error("Timeout"))}),n)}))}catch(e){return void console.log(`interacting with tabnine assistant: ${e}`)}finally{o()}}get shutdowned(){return this.isShutdown}set shutdowned(e){this.isShutdown=e}isChildAlive(){return!!this.proc&&!this.childDead}onChildDeath(){this.childDead=!0,setTimeout((()=>{this.isChildAlive()||this.restartChild()}),1e4)}restartChild(){var e,t;this.numRestarts>=10||(this.numRestarts+=1,this.proc&&this.proc.kill(),this.proc=o.default(),this.childDead=!1,this.proc.on("exit",(()=>{this.shutdowned||this.onChildDeath()})),null===(e=this.proc.stdin)||void 0===e||e.on("error",(e=>{console.log("assistant binary stdin error: ",e),this.onChildDeath()})),null===(t=this.proc.stdout)||void 0===t||t.on("error",(e=>{console.log("assistant binary stdout error:",e),this.onChildDeath()})),this.proc.unref(),this.rl=i.createInterface({input:this.proc.stdout,output:this.proc.stdin}),this.rl.on("line",(e=>{const t=JSON.parse(e),{id:n}=t,{body:r}=t,i=this.resolveMap.get(n);i&&(i(r),this.resolveMap.delete(n))})))}}},3847:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){this.cancelled=!1,this.callbacks=[]}isCancelled(){return this.cancelled}cancel(){this.isCancelled()||(this.cancelled=!0,this.callbacks.forEach((([e,t])=>e(t))))}reset(){this.cancelled=!1,this.callbacks=[]}registerCallback(e,...t){this.isCancelled()?e(...t):this.callbacks.push([e,t])}}},9064:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DocumentValidator=void 0;const r=n(6151),i=n(6394);class o{constructor(e,t){this.validLanguages=e,this.validExtensions=t}isValid(e){var t,n;const{fileName:r}=e,i=`.${(null==r?void 0:r.split(".").pop())||""}`;return(null===(t=this.validExtensions)||void 0===t?void 0:t.includes(i))&&(null===(n=this.validLanguages)||void 0===n?void 0:n.includes(e.languageId))}}t.DocumentValidator=o,t.default=async function(){const e=await i.default(),t=await r.default();return new o(e,t)}},6680:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549);class i extends r.Diagnostic{constructor(e,t,n,r,i,o,s,a,c){super(e,t,c),this.choices=[],this.references=[],this.choices=n,this.reference=r,this.references=i,this.assistantRange=o,this.responseId=s,this.threshold=a}}t.default=i},7498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setDecorators=void 0;const r=n(7549),i=n(4017),o=n(3847),s=n(6136),a=n(8083),c=n(5104),u=n(9064),l=n(8967),p=n(1785),f=n(6167),d=n(6394),h=n(6680),m=n(4365),g=n(3226),v=r.window.createTextEditorDecorationType({border:"#3794FF 2px",borderStyle:"none none solid none"}),y=new Map;function _(e){const t=r.window.activeTextEditor,n=(null==e?void 0:e.map((({range:e})=>({range:e}))))||[];t&&t.setDecorations(v,n)}function E(e,t=3e4){(null==e?void 0:e.length)&&r.window.setStatusBarMessage(`${e}`,t)}t.setDecorators=_;const b=new i.Mutex,w=new o.default;async function S(e,t,n){var i;w.cancel();const o=await b.acquire();w.reset(),w.registerCallback(E);try{let u=0;const p=function(e,t){const n=y.get(e.uri),i=t.reduce(((e,t)=>e.union(t)));return n&&i.intersection(new r.Range(n,i.end))}(e,n);if(!p)return;const f=e.offsetAt(p.start),d=e.offsetAt(p.end),v=s.getAssistantMode()===s.AssistantMode.Background?g.getBackgroundThreshold():m.PASTE_THRESHOLD,b=e.getText(),S=await a.getAPIKey();if(w.isCancelled())return;const I=await l.default(b,e.fileName,{start:f,end:d},v,m.EDIT_DISTANCE,S,w);if(w.isCancelled())return;const C=[];null==I||I.forEach((t=>{const n=t.completionList.filter((e=>e.value!==t.reference)),i=n.map((e=>`${e.message} '${e.value}'\t${e.score}%`));if(n.length>0){const o=t.references.filter((e=>e.starto.includes(e.assistantRange)));if(s.getAssistantMode()===s.AssistantMode.Background||0===o.length||o.length>0&&a.length>0){const o=new r.Range(e.positionAt(t.range.start),e.positionAt(t.range.end)),s=t.references.map((t=>new r.Range(e.positionAt(t.start),e.positionAt(t.end)))),a=new h.default(o,`${i.join("\n")}`,n,t.reference,s,t.range,t.responseId,v,r.DiagnosticSeverity.Information);a.code=m.TABNINE_DIAGNOSTIC_CODE,C.push(a),u+=1}}})),C.length>0&&c.default({ValidatorState:{num_of_diagnostics:C.length,num_of_locations:(null==I?void 0:I.length)||0}}),(null===(i=t.get(e.uri))||void 0===i?void 0:i.length)!==C.length&&(_(C),t.set(e.uri,C));const x=u?`${u}`:"";console.log(x),E("$(pass)")}catch(e){E(),console.error("tabnine assistant: error: ",e)}finally{o()}}const I=a.debounce(S);let C=null,x=!1;t.default=async function(e,t){const n=r.languages.createDiagnosticCollection("tabnine");e.subscriptions.push(n);const i=await u.default();var o,a;g.initAssistantThreshold(e),function(e,t,n){e.subscriptions.push(r.commands.registerCommand(m.ASSISTANT_IGNORE_REFRESH_COMMAND,(()=>{const e=r.window.activeTextEditor;if(e){const{document:r,visibleRanges:i}=e;t.isValid(r)&&(s.getAssistantMode()===s.AssistantMode.Paste?C&&S(r,n,[null==C?void 0:C.range]):S(r,n,i))}})))}(e,i,n),o=n,a=i,r.commands.registerCommand(m.ASSISTANT_MODE_TOGGLE_COMMAND,(()=>{w.cancel(),r.window.activeTextEditor&&o.delete(r.window.activeTextEditor.document.uri),_([]);const e=s.getAssistantMode()===s.AssistantMode.Background?s.AssistantMode.Paste:s.AssistantMode.Background;s.setAssistantMode(e),s.getAssistantMode()===s.AssistantMode.Paste?(r.window.showInformationMessage("tabnine assistant paste mode"),console.log("paste validation mode")):(r.window.showInformationMessage("tabnine assistant background mode"),console.log("background validation mode")),r.window.activeTextEditor&&a.isValid(r.window.activeTextEditor.document)&&function(e,t){s.getAssistantMode()===s.AssistantMode.Background?r.window.activeTextEditor&&S(e,t,r.window.activeTextEditor.visibleRanges):p.default(e.getText(),e.fileName)}(r.window.activeTextEditor.document,o)})),function(e,t,n){e.subscriptions.push(r.window.onDidChangeTextEditorVisibleRanges((e=>{s.getAssistantMode()===s.AssistantMode.Background&&t.isValid(e.textEditor.document)&&I(e.textEditor.document,n,e.textEditor.visibleRanges)})))}(e,i,n),t.dispose(),function(e,t,n){e.subscriptions.push(r.commands.registerCommand(m.PASTE_COMMAND,(async e=>{x=!0;const{start:i}=e.selection;await r.commands.executeCommand("editor.action.clipboardPasteAction");const{end:o}=e.selection;if(r.window.activeTextEditor){const{document:e}=r.window.activeTextEditor;if(!t.isValid(e)||s.getAssistantMode()===s.AssistantMode.Background)return void(x=!1);C={range:new r.Range(i,o),length:e.offsetAt(o)-e.offsetAt(i)},x=!1,n.delete(e.uri),_([]),S(e,n,[C.range])}})))}(e,i,n),function(e,t,n){e.subscriptions.push(r.workspace.onDidChangeTextDocument((e=>{var i;if(s.getAssistantMode()===s.AssistantMode.Paste&&!x&&n.isValid(e.document)){let n=null,o=0;if(e.contentChanges.forEach((e=>{(null===n||e.range.start.isBefore(n))&&(n=e.range.start),null!==C&&(!e.range.start.isAfterOrEqual(C.range.start)||!e.range.end.isBefore(C.range.end)||e.range.start.isEqual(C.range.start)&&e.range.end.isEqual(C.range.end)?C=null:o+=-e.rangeLength+(e.text.length||0))})),null!==n&&null!==C){const s=null===(i=t.get(e.document.uri))||void 0===i?void 0:i.filter((e=>e.range.end.isBefore(n)));if(t.set(e.document.uri,s),_(s),0!==o){const t=C.length+o,n=e.document.positionAt(e.document.offsetAt(C.range.start)+t);C={range:new r.Range(C.range.start,n),length:t}}I(e.document,t,[C.range])}else t.delete(e.document.uri),_([])}})))}(e,n,i),function(e,t,n){e.subscriptions.push(r.workspace.onDidChangeTextDocument((e=>{var i,o;if(s.getAssistantMode()===s.AssistantMode.Background&&n.isValid(e.document)&&e.contentChanges.length){const n=e.contentChanges.map((e=>e.range.start)).reduce(((e,t)=>null===e||t.isBefore(e)?t:e),null);if(null!==n){const r=null===(i=t.get(e.document.uri))||void 0===i?void 0:i.filter((e=>e.range.end.isBefore(n)));t.set(e.document.uri,r),(null===(o=t.get(e.document.uri))||void 0===o?void 0:o.length)!==(null==r?void 0:r.length)&&_(r),y.has(e.document.uri)||y.set(e.document.uri,n)}else t.delete(e.document.uri),_([]);r.window.activeTextEditor&&I(r.window.activeTextEditor.document,t,r.window.activeTextEditor.visibleRanges)}})))}(e,n,i),async function(e){const t=await d.default();e.subscriptions.push(r.languages.registerCodeActionsProvider(t,new f.default,{providedCodeActionKinds:f.default.providedCodeActionKinds}))}(e)}},4703:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7054);t.default=function(){return r.isCapabilityEnabled(r.Capability.ASSISTANT_MODE_A_CAPABILITY_KEY)?"A":r.isCapabilityEnabled(r.Capability.ASSISTANT_MODE_B_CAPABILITY_KEY)?"B":"A"}},4365:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ASSISTANT_TOGGLE_COMMAND=t.ASSISTANT_SET_THRESHOLD_COMMAND=t.ASSISTANT_CLEAR_CACHE_COMMAND=t.PASTE_COMMAND=t.ASSISTANT_MODE_TOGGLE_COMMAND=t.ASSISTANT_IGNORE_REFRESH_COMMAND=t.ASSISTANT_IGNORE_COMMAND=t.ASSISTANT_SELECTION_COMMAND=t.EDIT_DISTANCE=t.PASTE_THRESHOLD=t.THRESHOLD_STATE_KEY=t.CAPABILITY_KEY=t.BACKGROUND_KEY=t.ENABLED_KEY=t.ACTIVE_STATE_KEY=t.TABNINE_DIAGNOSTIC_CODE=t.ASSISTANT_API_VERSION=void 0,t.ASSISTANT_API_VERSION="1.0.0",t.TABNINE_DIAGNOSTIC_CODE="tabnine",t.ACTIVE_STATE_KEY="tabnine-assistant-active",t.ENABLED_KEY="tabnine-assistant:enabled",t.BACKGROUND_KEY="tabnine-assistant:background",t.CAPABILITY_KEY="tabnine-assistant:capability",t.THRESHOLD_STATE_KEY="tabnine-assistant-threshold",t.PASTE_THRESHOLD="Paste",t.EDIT_DISTANCE=2,t.ASSISTANT_SELECTION_COMMAND="tabnine-assistant-select",t.ASSISTANT_IGNORE_COMMAND="tabnine-assistant-ignore",t.ASSISTANT_IGNORE_REFRESH_COMMAND="tabnine-assistant-ignore-refresh",t.ASSISTANT_MODE_TOGGLE_COMMAND="TabNine::assistantModeToggle",t.PASTE_COMMAND="TabNine::paste",t.ASSISTANT_CLEAR_CACHE_COMMAND="TabNine::assistantClearCache",t.ASSISTANT_SET_THRESHOLD_COMMAND="TabNine::assistantSetThreshold",t.ASSISTANT_TOGGLE_COMMAND="TabNine::assistantToggle"},3226:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBackgroundThreshold=t.initAssistantThreshold=void 0;const r=n(7549),i=n(6136),o=n(8083),s=n(5104),a=n(2478),c=n(4365);let u="Medium";t.initAssistantThreshold=function(e){u=e.workspaceState.get(c.THRESHOLD_STATE_KEY,u)||u,function(e){i.getAssistantMode()===i.AssistantMode.Background&&e.subscriptions.push(r.commands.registerCommand(c.ASSISTANT_SET_THRESHOLD_COMMAND,(async()=>{const t=u,n={canPickMany:!1,placeHolder:`Pick threshold (Currently: ${u})`},i=["Low","Medium","High"],l=await r.window.showQuickPick(i,n);l&&i.includes(l)&&(u=l,await e.workspaceState.update(c.THRESHOLD_STATE_KEY,u),s.default({[a.StatePayload.STATE]:{state_type:o.StateType.threshold,state:JSON.stringify({from:t,to:u})}}),r.commands.executeCommand(c.ASSISTANT_IGNORE_REFRESH_COMMAND))})))}(e)},t.getBackgroundThreshold=function(){return u}},6835:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3934);t.default=function(){const e={method:"clear_cache",params:{}};return r.request(e)}},8967:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4703),i=n(3934);t.default=function(e,t,n,o,s,a,c){const u={method:"get_assistant_diagnostics",params:{code:e,fileName:t,visibleRange:n,mode:r.default(),threshold:o,editDistance:s,apiKey:a}};return i.request(u,c)}},1785:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3934);t.default=function(e,t){const n={method:"get_compiler_diagnostics",params:{code:e,fileName:t}};return r.request(n)}},6151:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3934);t.default=function(){const e={method:"get_valid_extensions",params:{}};return r.request(e)}},6394:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3934);t.default=function(){const e={method:"get_valid_languages",params:{}};return r.request(e)}},3934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closeAssistant=t.request=t.getAssistantVersion=void 0;const r=n(9158),i=n(4365),o=n(8083);let s,a=null;async function c(e,t){if(null===a&&(a=new r.default),!a.shutdowned)return new Promise(((n,r)=>{const s=o.getNanoSecTime();null==t||t.registerCallback(n,void 0),null==a||a.post({...e,id:s,version:i.ASSISTANT_API_VERSION},s).then(n,r)}))}t.getAssistantVersion=async function(){return s||(s=await c({method:"get_version",params:{}})),s},t.request=c,t.closeAssistant=function(){if(console.log("assistant is closing"),a){const e={method:"shutdown",params:{}};return a.shutdowned=!0,c(e)}return Promise.resolve()}},7007:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3934);t.default=function(e){const t={method:"set_ignore",params:{responseId:e}};return r.request(t)}},9688:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3129),i=n(8083);t.default=function(e=[],t=!1){const n=[...e],o=i.getFullPathToAssistantBinary();return r.spawn(o,n,{stdio:t?"inherit":"pipe"})}},8083:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.debounce=t.getNanoSecTime=t.getFullPathToAssistantBinary=t.downloadAssistantBinary=t.getAPIKey=t.StateType=void 0;const r=n(5747),i=n(7211),o=n(7549),s=n(4381),a=n(9973),c=n(1357),u=n(7225),l=r.promises,p="update.tabnine.com",f="tabnine-assistant",d=o.window.createStatusBarItem(o.StatusBarAlignment.Right);t.StateType={threshold:"assistant-set-threshold-from-to",toggle:"assistant-toggle",clearCache:"validtor-clear-cache"};let h=null;function m(e){const t=function(){if("x64"===process.arch)return"x86_64";if("arm64"===process.arch)return"arm64";throw new Error(`Architecture "${process.arch}" is not supported by tabnine assistant`)}(),{target:n,filename:i}=function(){if("win32"===process.platform)return{target:"pc-windows-gnu",filename:"tabnine-assistant.exe"};if("darwin"===process.platform)return{target:"apple-darwin",filename:f};if("linux"===process.platform)return{target:"unknown-linux-musl",filename:f};throw new Error(`Platform "${process.platform}" is not supported by TabNine Assistant`)}(),o=s.getAssistantRootPath();if(void 0===e){const e=u.default(r.readdirSync(o)),s=e.map((e=>`${o}/${e}/${t}-${n}/${i}`)).find((e=>r.existsSync(e)));if(!s)throw new Error(`Couldn't find a TabNine Assistant binary (tried the following local versions: ${e.join(", ")})`);return s}return`${o}/${e}/${t}-${n}/${i}`}t.getAPIKey=async function(){return null===h&&(h=await a.getState()),(null==h?void 0:h.api_key)||""},t.downloadAssistantBinary=async function(){if(null===h&&(h=await a.getState()),!(null==h?void 0:h.cloud_enabled))return!1;let e;try{e=await async function(){return new Promise(((e,t)=>{const n=i.get({timeout:1e4,hostname:p,path:"/assistant/version"},(n=>{let r="";n.on("data",(e=>{r+=e})),n.on("end",(()=>e(r.trim()))),n.on("error",(e=>t(e)))}));n.on("timeout",(()=>t(new Error("Request to assistant version timed out")))),n.on("error",(e=>t(e)))}))}()}catch(e){try{return m(),!0}catch(e){return!1}}return!!await c.asyncExists(m(e))||o.window.withProgress({location:o.ProgressLocation.Notification,cancellable:!0,title:"downloading tabnine assistant..."},((t,n)=>new Promise(((s,a)=>{try{const c=m(e),u=c.slice(0,c.lastIndexOf("/"));l.mkdir(u,{recursive:!0}).then((()=>{let u;const f=i.get({timeout:1e4,hostname:p,path:`/assistant/${c.slice(c.indexOf(e))}`},(i=>{const l=r.createWriteStream(c,{mode:493});l.on("error",(e=>a(e)));let p=0,f=0;i.on("data",(e=>{if(!u)return;p+=e.length;const n=Number((100*p/Number.parseInt(u,10)).toFixed());0===f?t.report({increment:0}):n>f&&t.report({increment:1}),f=n})).on("error",(e=>a(e))).on("end",(()=>{n.isCancellationRequested||(t.report({increment:100}),o.window.showInformationMessage(`TabNine Assistant ${e} binary is successfully downloaded`),s(!0))})).pipe(l).on("error",(e=>a(e))),n.onCancellationRequested((()=>{i.destroy(),l.destroy()}))}));f.on("response",(t=>{d.text="tabnine assistant: $(sync~spin)",d.tooltip=`downloading tabnine assistant ${e} binary`,u=t.headers["content-length"]})),f.on("timeout",(()=>a(new Error("Request to assistant timed out")))),f.on("error",(e=>a(e))),n.onCancellationRequested((()=>{l.unlink(c).catch((e=>a(e))),f.destroy(new Error("Canceled")),a(new Error("Download of tabnine assistant binary has been cancelled"))}))}))}catch(e){a(e)}}))))},t.getFullPathToAssistantBinary=m,t.getNanoSecTime=function(){const[e,t]=process.hrtime();return 1e9*e+t},t.debounce=function(e,t=500){let n;return(...r)=>{clearTimeout(n),n=setTimeout((()=>{e.apply(this,r)}),t)}}},4533:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(8614),o=n(9973),s=n(2478),a=n(974),c=n(7332),u=n(3926),l="loginHappened";t.default=class{constructor(){this.id=s.BRAND_NAME,this.label=s.BRAND_NAME,this.onDidLogin=new i.EventEmitter,this.myOnDidChangeSessions=new r.EventEmitter,this.initializedDisposable=r.Disposable.from(this.handleSessionChange(),this.pollState())}get onDidChangeSessions(){return this.myOnDidChangeSessions.event}async getSessions(){const e=await this.lastState;return(null==e?void 0:e.is_logged_in)?[new u.default(null==e?void 0:e.user_name)]:[]}async createSession(){await c.callForLogin();const e=await this.waitForLogin();return new u.default(null==e?void 0:e.user_name)}async removeSession(){await c.callForLogout(),this.myOnDidChangeSessions.fire({removed:[(await this.getSessions())[0]]}),await a.sleep(5e3)}dispose(){var e;null===(e=this.initializedDisposable)||void 0===e||e.dispose()}async waitForLogin(){return(await i.once(this.onDidLogin,l))[0]}handleSessionChange(){return r.authentication.onDidChangeSessions((e=>{e.provider.id===s.BRAND_NAME&&this.checkForUpdates()}))}pollState(){const e=setInterval((()=>{this.checkForUpdates()}),1e4);return new r.Disposable((()=>{clearInterval(e)}))}async checkForUpdates(){const e=[],t=[],n=o.getState(),{lastState:r}=this;this.lastState=n;const i=await this.lastState,s=await r;if((null==i?void 0:i.is_logged_in)&&this.onDidLogin.emit(l,i),!(null==s?void 0:s.is_logged_in)&&(null==i?void 0:i.is_logged_in))e.push((await this.getSessions())[0]);else{if(!i||i.is_logged_in||!(null==s?void 0:s.is_logged_in))return;t.push((await this.getSessions())[0])}this.myOnDidChangeSessions.fire({added:e,removed:t})}}},3926:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2478);t.default=class{constructor(e="Tabnine Authentication"){this.id=r.BRAND_NAME,this.scopes=[],this.accessToken="",this.account={id:e,label:e}}}},7332:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callForLogout=t.callForLogin=void 0;const r=n(9973),i=n(9549),o=n(8675);t.callForLogin=function(){return o.default?i.default():r.tabNineProcess.request({Login:{}})},t.callForLogout=async function(){return r.tabNineProcess.request({Logout:{}})}},9342:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4017),i=n(545),o=n(5220),s=n(2478),a=n(974);t.default=class{constructor(){this.mutex=new r.Mutex,this.innerBinary=new i.default,this.consecutiveRestarts=0,this.requestFailures=0,this.isRestarting=!1}init(){return this.startChild()}async request(e,t=1e3){const n=await this.mutex.acquire();try{if(this.isRestarting)return null;if(this.isBinaryDead())return console.warn("Binary died. It is being restarted."),await this.restartChild(),null;const r=await this.innerBinary.request(e,t);return this.consecutiveRestarts=0,this.requestFailures=0,r}catch(e){console.error(e),this.requestFailures+=1,this.requestFailures>s.REQUEST_FAILURES_THRESHOLD&&(console.warn("Binary not returning results, it is being restarted."),await this.restartChild())}finally{n()}return null}isBinaryDead(){var e,t;return null!==(t=null===(e=this.proc)||void 0===e?void 0:e.killed)&&void 0!==t&&t}async resetBinaryForTesting(){const{proc:e,readLine:t}=await o.default([]);this.proc=e,this.innerBinary.init(e,t)}async restartChild(){var e,t;null===(e=this.proc)||void 0===e||e.removeAllListeners(),null===(t=this.proc)||void 0===t||t.kill(),this.isRestarting=!0,this.consecutiveRestarts+=1,this.consecutiveRestarts>=s.CONSECUTIVE_RESTART_THRESHOLD||(await a.sleep(s.restartBackoff(this.consecutiveRestarts)),await this.startChild())}async startChild(){var e,t;const{proc:n,readLine:r}=await o.default([`ide-restart-counter=${this.consecutiveRestarts}`]);this.proc=n,this.proc.unref(),this.proc.on("exit",((e,t)=>{console.warn(`Binary child process exited with code ${null!=e?e:"unknown"} signal ${null!=t?t:"unknown"}`),this.restartChild()})),this.proc.on("error",(e=>{console.warn(`Binary child process error: ${e.message}`),this.restartChild()})),null===(e=this.proc.stdin)||void 0===e||e.on("error",(e=>{console.warn(`Binary child process stdin error: ${e.message}`),this.restartChild()})),null===(t=this.proc.stdout)||void 0===t||t.on("error",(e=>{console.warn(`Binary child process stdout error: ${e.message}`),this.restartChild()})),this.innerBinary.init(n,r),this.isRestarting=!1}}},545:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2478),i=n(8060);t.default=class{init(e,t){this.proc=e,this.onceReader=new i.default(t)}async request(e,t=1e3){const n=await this.requestWithTimeout(e,t);return JSON.parse(n.toString())}requestWithTimeout(e,t){return new Promise(((n,i)=>{var o,s,a;setTimeout((()=>{i(new Error(`Binary request timed out. ${JSON.stringify(e)}`))}),t),null===(o=this.onceReader)||void 0===o||o.onLineRead(n),null===(a=null===(s=this.proc)||void 0===s?void 0:s.stdin)||void 0===a||a.write(`${JSON.stringify({version:r.API_VERSION,request:e})}\n`,"utf8")}))}}},8060:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e){this.callbackQueue=[],e.on("line",(e=>{const t=this.callbackQueue.shift();if(!t)throw new Error("Read a response from the engine before a request was written.");t(e)}))}onLineRead(e){this.callbackQueue.push(e)}}},1713:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5747),i=n(4381),o=n(4256);t.default=function(){try{const e=i.getActivePath();if(r.existsSync(e)){const t=r.readFileSync(e,"utf-8").trim();if(t===o.BAD_VERSION)return null;const n=i.versionPath(t);if(r.existsSync(n))return n}}catch(e){console.error("Error handling .active file. Falling back to semver sorting",e)}return null}},4256:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BAD_VERSION=void 0;const r=n(1249),i=n(1357),o=n(8638);t.BAD_VERSION="4.0.47";t.default=async function(e){if(e===t.BAD_VERSION||!await i.asyncExists(e))return!1;const{proc:n,readLine:s}=o.runProcess(e,["--print-version"]);return new Promise((t=>{setTimeout((()=>{console.error(`validating ${e} timeout`),t(!1)}),2e3),n.on("exit",((e,n)=>{n&&t(!1)})),n.on("error",(()=>{t(!1)})),s.once("line",(e=>{r.valid(e)?t(!0):t(!1)}))}))}},8022:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5747),i=n(5622),o=n(2106),s=n(1249),a=n(2497),c=n(4381),u=n(9142);async function l(e){try{await r.promises.unlink(e)}catch(e){}}t.default=async function(){const{bundlePath:e,bundleDownloadUrl:t,bundleDirectory:n,executablePath:p}=await async function(){const e=await async function(){const e=c.getUpdateVersionFileUrl(),t=await a.downloadFileToStr(e);return function(e){if(!s.valid(e))throw new Error(`invalid version: ${e}`)}(t),t}(),t=c.getBundlePath(e),n=c.getDownloadVersionUrl(e),r=i.dirname(t),o=c.versionPath(e);return{bundlePath:t,bundleDownloadUrl:n,bundleDirectory:r,executablePath:o}}();try{return await function(e){return r.promises.mkdir(e,{recursive:!0})}(n),await a.downloadFileToDestination(t,e),await async function(e,t){return o(e,{dir:t})}(e,n),await l(e),await async function(e){if(c.isWindows())return Promise.resolve([]);const t=await r.promises.readdir(e);return Promise.all(t.map((t=>r.promises.chmod(i.join(e,t),493))))}(n),u.report(u.EventName.BUNDLE_DOWNLOAD_SUCCESS),p}finally{await l(e)}}},6123:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5747),i=n(7225),o=n(974),s=n(4256),a=n(4381);t.default=async function(){try{const e=await r.promises.readdir(a.getRootPath()),t=i.default(e).map(a.versionPath);return await o.asyncFind(t,s.default)}catch(e){console.error("Error handling existing version. Falling back to downloading",e)}return null}},507:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(2478),o=n(9142),s=n(1713),a=n(8022),c=n(6123);t.default=async function(){const e=s.default();if(e)return e;const t=await c.default();return t||async function(){try{return await async function(){return r.window.withProgress({location:r.ProgressLocation.Notification,title:"Initializing Tabnine"},a.default)}()}catch(e){const t=await c.default();return t||async function(e){return o.reportErrorEvent(o.EventName.BUNDLE_DOWNLOAD_FAILURE,e),o.reportException(e),new Promise(((t,n)=>{r.window.showErrorMessage(i.BUNDLE_DOWNLOAD_FAILURE_MESSAGE,i.RELOAD_BUTTON,i.OPEN_NETWORK_SETUP_HELP).then((t=>{t===i.OPEN_NETWORK_SETUP_HELP?(r.env.openExternal(r.Uri.parse("https://code.visualstudio.com/docs/setup/network")),n(e)):t===i.RELOAD_BUTTON?(r.commands.executeCommand("workbench.action.reloadWindow"),n(e)):n(e)}),n)}))}(e)}}()}},7719:(e,t,n)=>{"use strict";t.mC=t.Lv=t.$m=t.EM=t.eL=void 0;const r=n(4351),i=n(974),o=n(7054);t.eL=r.mock(),t.EM=r.mock(),t.$m=r.mock(),t.Lv=r.mock();let s=()=>{};const a=new Promise((e=>{s=e}));t.mC=[],t.ZP=function(){return r.when(t.eL.killed).thenReturn(!1),r.when(t.eL.stdin).thenReturn(r.instance(t.$m)),r.when(t.eL.stdout).thenReturn(r.instance(t.Lv)),r.when(t.EM.once("line",r.anyFunction())).thenCall(((e,t)=>{t("1.2.3")})),function(){let e=null;r.when(t.EM.on("line",r.anyFunction())).thenCall(((t,n)=>{e=n})),r.when(t.$m.write(r.anyString(),"utf8")).thenCall((n=>{const r=t.mC.find((({isQualified:e})=>e(n)));return null==e||e(r?function(e,t){return JSON.stringify(i.isFunction(t)?t(e):t)}(n,r.result):"null"),!0}))}(),t.mC.push({isQualified:e=>{var t;const n=JSON.parse(e);return!!(null===(t=null==n?void 0:n.request)||void 0===t?void 0:t.Features)},result:{enabled_features:[o.Capability.ALPHA_CAPABILITY,o.Capability.SAVE_SNIPPETS]}}),s(),{proc:r.instance(t.eL),readLine:r.instance(t.EM)}}},4381:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isWindows=t.getUpdateVersionFileUrl=t.getActivePath=t.getAssistantRootPath=t.getRootPath=t.getDownloadVersionUrl=t.getBundlePath=t.versionPath=t.setBinaryRootPath=void 0;const r=n(5747),i=n(5622),o=n(7549),s=n(2478);let a;const c=function(){if("darwin"===process.platform&&"arm64"===process.arch)return"aarch64";if("x32"===process.arch||"ia32"===process.arch)return"i686";if("x64"===process.arch)return"x86_64";throw new Error(`Sorry, the architecture '${process.arch}' is not supported by TabNine.`)}(),u=function(){switch(process.platform){case"win32":return"pc-windows-gnu/TabNine.exe";case"darwin":return"apple-darwin/TabNine";case"linux":return"unknown-linux-musl/TabNine";default:throw new Error(`Sorry, the platform '${process.platform}' is not supported by TabNine.`)}}(),l=`${u.replace(".exe","")}.zip`;t.setBinaryRootPath=async function(e){a=e.extensionMode===o.ExtensionMode.Test?i.join(__dirname,"..","..","binaries"):i.join(e.globalStorageUri.fsPath,"binaries");try{await r.promises.mkdir(a,{recursive:!0})}catch(e){}},t.versionPath=function(e){if(!a)throw new Error("Binary root path not set");return i.join(a,e,`${c}-${u}`)},t.getBundlePath=function(e){if(!a)throw new Error("Binary root path not set");return i.join(a,e,`${c}-${l}`)},t.getDownloadVersionUrl=function(e){return`${s.BINARY_UPDATE_URL}/${e}/${c}-${l}`},t.getRootPath=function(){if(!a)throw new Error("Binary root path not set");return a},t.getAssistantRootPath=function(){if(!a)throw new Error("Binary root path not set");return i.join(a,"..","assistant-binaries")},t.getActivePath=function(){if(!a)throw new Error("Binary root path not set");return i.join(a,".active")},t.getUpdateVersionFileUrl=function(){return s.BINARY_UPDATE_VERSION_FILE_URL},t.isWindows=function(){return"win32"===process.platform}},9838:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9973),i=n(5104),o=n(2478),s=n(7962),a=n(974),c=n(8433),u=1500;function l(e){return Math.floor(e/1024/1024)}t.default=function(){a.withPolling((e=>{r.getState().then((t=>{var n,a;!function(e){var t,n,r;return!(null==e?void 0:e.local_enabled)||(null==e?void 0:e.local_enabled)&&!(null==e?void 0:e.is_cpu_supported)&&!(null==e?void 0:e.cloud_enabled)||(null===(t=null==e?void 0:e.download_state)||void 0===t?void 0:t.status)===c.DownloadStatus.FINISHED||(null===(n=null==e?void 0:e.download_state)||void 0===n?void 0:n.status)===c.DownloadStatus.NOT_STARTED&&!!(null===(r=null==e?void 0:e.download_state)||void 0===r?void 0:r.last_failure)}(t)?(null===(n=null==t?void 0:t.download_state)||void 0===n?void 0:n.status)===c.DownloadStatus.IN_PROGRESS&&(null===(a=null==t?void 0:t.download_state)||void 0===a?void 0:a.kind)===c.DownloadProgress.DOWNLOADING&&(e(),function(){i.default({[o.StatePayload.MESSAGE]:{message_type:o.StateType.PROGRESS}}),s.setLoadingStatus("Initializing... 0%");const e=setInterval((()=>{r.getState().then((t=>{(null==t?void 0:t.download_state.status)===c.DownloadStatus.FINISHED||(null==t?void 0:t.download_state.last_failure)?(s.setDefaultStatus(),clearInterval(e)):s.setLoadingStatus(`Initializing... ${function(e){if(!e)return"0";return(null==e?void 0:e.kind)===c.DownloadProgress.DOWNLOADING?Math.round(l(e.crnt_bytes||0)/l(e.total_bytes||1)*100).toString():"100"}(null==t?void 0:t.download_state)}%`)}))}),u)}()):(e(),s.setDefaultStatus())}))}),u,6e4)}},1666:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendHoverAction=t.getHover=t.HoverActions=void 0;const r=n(9973);!function(e){e[e.NONE=0]="NONE"}(t.HoverActions||(t.HoverActions={})),t.getHover=function(){return r.tabNineProcess.request({Hover:{}})},t.sendHoverAction=async function(e,t,n,i,o){return r.tabNineProcess.request({HoverAction:{id:e,actions:n,notification_type:i,state:o,selected:t}})}},2189:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendNotificationAction=t.getNotifications=void 0;const r=n(9973);t.getNotifications=function(){return r.tabNineProcess.request({Notifications:{}})},t.sendNotificationAction=async function(e,t,n,i,o,s){return r.tabNineProcess.request({NotificationAction:{id:e,selected:n,message:t,notification_type:i,actions:o,state:s}})}},5157:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9973);t.default=function(e){return r.tabNineProcess.request({NotifyWorkspaceChanged:{workspace_folders:e}},5e3).catch(console.error)}},5103:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9973);t.default=function(e){return r.tabNineProcess.request({OpenUrl:{url:e}})}},9973:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.saveSnippet=t.getCapabilities=t.uninstalling=t.deactivate=t.fireEvent=t.getState=t.configuration=t.autocomplete=t.SnippetRequestTrigger=t.resetBinaryForTesting=t.initBinary=t.UserIntent=t.CompletionKind=t.tabNineProcess=void 0;const r=n(9342);t.tabNineProcess=new r.default,function(e){e.Classic="Classic",e.Line="Line",e.Snippet="Snippet"}(t.CompletionKind||(t.CompletionKind={})),function(e){e[e.Comment=0]="Comment",e[e.Block=1]="Block",e[e.FunctionDeclaration=2]="FunctionDeclaration",e[e.NoScope=3]="NoScope",e[e.NewLine=4]="NewLine"}(t.UserIntent||(t.UserIntent={})),t.initBinary=function(){return t.tabNineProcess.init()},t.resetBinaryForTesting=function(){t.tabNineProcess.resetBinaryForTesting()},function(e){e.Auto="Auto",e.User="User"}(t.SnippetRequestTrigger||(t.SnippetRequestTrigger={})),t.autocomplete=function(e,n){return t.tabNineProcess.request({Autocomplete:e},n)},t.configuration=function(e){return t.tabNineProcess.request({Configuration:e},5e3)},t.getState=function(e={}){return t.tabNineProcess.request({State:e})},t.fireEvent=function(e){return t.tabNineProcess.request({Event:e})},t.deactivate=function(){return t.tabNineProcess?t.tabNineProcess.request({Deactivate:{}}):(console.error("No TabNine process"),Promise.resolve(null))},t.uninstalling=function(){return t.tabNineProcess.request({Uninstalling:{}})},t.getCapabilities=async function(){try{const e=await t.tabNineProcess.request({Features:{}},7e3);if(!Array.isArray(null==e?void 0:e.enabled_features))throw new Error("Could not get enabled capabilities");return e}catch(e){return console.error(e),{enabled_features:[]}}},t.saveSnippet=async function(e){return t.tabNineProcess.request({SaveSnippet:e})}},5104:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9973);t.default=function(e){return r.tabNineProcess.request({SetState:{state_type:e}})}},9014:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getStartupActions=void 0;const r=n(9973);t.getStartupActions=function(){return r.tabNineProcess.request({StartupActions:{}})}},9851:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sendStatusBarAction=t.getStatus=void 0;const r=n(9973);t.getStatus=function(){return r.tabNineProcess.request({StatusBar:{}})},t.sendStatusBarAction=async function(e,t,n,i,o){return r.tabNineProcess.request({StatusBarAction:{id:e,selected:t,notification_type:n,actions:i,state:o}})}},5220:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(7348),o=n(507),s=n(8638);t.default=async function(e=[],t=!1){var n,a,c,u,l;const p=await o.default(),f=["--client=vscode","--no-lsp=true",i.default.logFilePath?`--log-file-path=${i.default.logFilePath}`:null,i.default.logLevel?`--log-level=${i.default.logLevel}`:null,"--client-metadata",`clientVersion=${i.default.vscodeVersion}`,`pluginVersion=${null!==(n=i.default.version)&&void 0!==n?n:"unknown"}`,`t9-vscode-AutoImportEnabled=${i.default.isTabNineAutoImportEnabled}`,`t9-vscode-TSAutoImportEnabled=${null!==(a=i.default.isTypeScriptAutoImports)&&void 0!==a?a:"unknown"}`,`t9-vscode-JSAutoImportEnabled=${null!==(c=i.default.isJavaScriptAutoImports)&&void 0!==c?c:"unknown"}`,`vscode-telemetry-enabled=${i.default.isVscodeTelemetryEnabled}`,`vscode-remote=${i.default.isRemote}`,`vscode-remote-name=${i.default.remoteName}`,`vscode-extension-kind=${i.default.extensionKind}`,`vscode-theme-name=${null!==(u=i.default.themeName)&&void 0!==u?u:"unknown"}`,`vscode-theme-kind=${i.default.themeKind}`,`vscode-machine-id=${r.env.machineId}`,`vscode-is-new-app-install=${r.env.isNewAppInstall}`,`vscode-session-id=${r.env.sessionId}`,`vscode-language=${r.env.language}`,`vscode-app-name=${r.env.appName}`,`vscode-beta-channel-enabled=${i.default.isExtentionBetaChannelEnabled}`,`vscode-status-customization=${null!==(l=i.default.statusBarColorCustomizations)&&void 0!==l?l:"unknown"}`,...e].filter((e=>null!==e));return s.runProcess(p,f,{stdio:t?"inherit":"pipe"})}},8638:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.runProcess=void 0;const r=n(3129),i=n(1058),o=n(7549),s=n(6096),a=n(9142);t.runProcess=function(e,t,c={}){var u;if((null===(u=s.getTabnineExtensionContext())||void 0===u?void 0:u.extensionMode)===o.ExtensionMode.Test)return n(7719).ZP();a.report(a.EventName.START_BINARY);const l=t?r.spawn(e,t,c):r.spawn(e,c),p=l.stdout;return{proc:l,readLine:i.createInterface({input:p,output:l.stdin})}}},4905:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2478),i=n(9913),o=n(9014),s=n(974);t.default=async function(){await s.sleep(r.BINARY_STARTUP_GRACE);const e=await o.getStartupActions();return(null==e?void 0:e.actions.includes(r.MessageActions.OPEN_HUB))?i.openConfigWithSource(r.StateType.STARTUP)():Promise.resolve()}},8433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EmuMode=t.Mode=t.OSArchTarget=t.DownloadProgress=t.DownloadStatus=void 0,function(e){e.FINISHED="Finished",e.NOT_STARTED="NotStarted",e.IN_PROGRESS="InProgress"}(t.DownloadStatus||(t.DownloadStatus={})),function(e){e.DOWNLOADING="Downloading",e.RETRIEVING_METADATA="RetrievingMetadata",e.VERIFYING_CHECKSUM="VerifyingChecksum"}(t.DownloadProgress||(t.DownloadProgress={})),function(e){e.APPLE_64="x86_64-apple-darwin"}(t.OSArchTarget||(t.OSArchTarget={})),function(e){e.RELEASE="Release"}(t.Mode||(t.Mode={})),function(e){e.NATIVE="Native"}(t.EmuMode||(t.EmuMode={}))},7054:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchCapabilitiesOnFocus=t.isCapabilityEnabled=t.Capability=void 0;const r=n(7549),i=n(9973);!function(e){e.ON_BOARDING_CAPABILITY="vscode.onboarding",e.ASSISTANT_CAPABILITY="vscode.assistant",e.ASSISTANT_MODE_A_CAPABILITY_KEY="vscode.assistant.mode.A",e.ASSISTANT_MODE_B_CAPABILITY_KEY="vscode.assistant.mode.B",e.ASSISTANT_BACKGROUND_CAPABILITY="vscode.assistant.background",e.ASSISTANT_PASTE_CAPABILITY="vscode.assistant.paste",e.SUGGESTIONS_SINGLE="suggestions-single",e.SUGGESTIONS_TWO="suggestions-two",e.SUGGESTIONS_ORIGINAL="suggestions-original",e.ALPHA_CAPABILITY="vscode.validator",e.SHOW_AGRESSIVE_STATUS_BAR_UNTIL_CLICKED="promoteHub1",e.INLINE_SUGGESTIONS="inline_suggestions_mode",e.SNIPPET_SUGGESTIONS="snippet_suggestions",e.SNIPPET_AUTO_TRIGGER="snippet_auto_trigger",e.LEFT_TREE_VIEW="vscode.left_tree_view",e.EMPTY_LINE_SUGGESTIONS="empty_line_suggestions",e.AUTHENTICATION="vscode.authentication",e.NOTIFICATIONS_WIDGET="vscode.notifications-widget",e.TABNINE_TODAY_WIDGET="vscode.tabnine-today-widget",e.CODE_REVIEW="vscode.code-review",e.SAVE_SNIPPETS="save_snippets",e.BETA_CAPABILITY="beta"}(t.Capability||(t.Capability={}));const o={};function s(e){i.getCapabilities().then((t=>{null==t||t.enabled_features.forEach((e=>{o[e]=!0})),e()}))}t.isCapabilityEnabled=function(e){return o[e]},t.fetchCapabilitiesOnFocus=function(){return new Promise((e=>{if(r.window.state.focused)console.log("capabilities resolved immediately"),s(e);else{const t=r.window.onDidChangeWindowState((({focused:n})=>{t.dispose(),console.log(`capabilities resolved on focus ${n}`),s(e)}))}}))}},1988:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SuggestionsMode=void 0;const r=n(7054);var i;!function(e){e[e.INLINE=0]="INLINE",e[e.AUTOCOMPLETE=1]="AUTOCOMPLETE"}(i=t.SuggestionsMode||(t.SuggestionsMode={})),t.default=function(){return r.isCapabilityEnabled(r.Capability.INLINE_SUGGESTIONS)?i.INLINE:i.AUTOCOMPLETE}},2617:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TABNINE_CONFIG_CONTEXT_KEY=t.TABNINE_TOKEN_CONTEXT_KEY=t.TABNINE_CONFIG_FILE_PATH=t.TABNINE_CONFIG_FILE_NAME=t.TABNINE_TOKEN_FILE_PATH=t.TABNINE_TOKEN_FILE_NAME=t.TABNINE_CONFIG_DIR=void 0;const r=n(5622),i=n(2087);t.TABNINE_CONFIG_DIR=r.join(i.homedir(),".config","TabNine"),t.TABNINE_TOKEN_FILE_NAME=".refresh_token_v2",t.TABNINE_TOKEN_FILE_PATH=r.join(t.TABNINE_CONFIG_DIR,t.TABNINE_TOKEN_FILE_NAME),t.TABNINE_CONFIG_FILE_NAME="tabnine_config.json",t.TABNINE_CONFIG_FILE_PATH=r.join(t.TABNINE_CONFIG_DIR,t.TABNINE_CONFIG_FILE_NAME),t.TABNINE_TOKEN_CONTEXT_KEY="TABNINE_TOKEN_V2",t.TABNINE_CONFIG_CONTEXT_KEY="TABNINE_CONFIG"},8675:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=!!process.env.GITPOD_REPO_ROOT||!!process.env.CODESPACES},9549:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(9973),o=n(2478),s=n(9980);t.default=async function(){const e=await i.configuration({quiet:!0,source:o.StateType.AUTH});if(e&&e.message){const t=await r.env.asExternalUri(r.Uri.parse(e.message)),n=`https://app.tabnine.com/auth/sign-in?tabnineUrl=${t.toString()}&sync=false`;await s.default(t),r.env.openExternal(r.Uri.parse(n))}}},9191:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5747),i=n(2617),o=n(1357);t.default=async function(e){await o.ensureExists(i.TABNINE_CONFIG_DIR),e.globalState.setKeysForSync([i.TABNINE_TOKEN_CONTEXT_KEY,i.TABNINE_CONFIG_CONTEXT_KEY]),await async function(e){const t=e.globalState.get(i.TABNINE_TOKEN_CONTEXT_KEY),n=e.globalState.get(i.TABNINE_CONFIG_CONTEXT_KEY);t&&await r.promises.writeFile(i.TABNINE_TOKEN_FILE_PATH,t).catch((e=>{console.error("Error occurred while trying to load Tabnine token",e)}));n&&await r.promises.writeFile(i.TABNINE_CONFIG_FILE_PATH,n).catch((e=>{console.error("Error occurred while trying to load Tabnine config",e)}))}(e),function(e){o.watch(i.TABNINE_CONFIG_DIR,((t,n)=>{switch(n){case i.TABNINE_TOKEN_FILE_NAME:"rename"===t?e.globalState.update(i.TABNINE_TOKEN_CONTEXT_KEY,void 0):r.promises.readFile(i.TABNINE_TOKEN_FILE_PATH,"utf8").then((t=>e.globalState.update(i.TABNINE_TOKEN_CONTEXT_KEY,t))).catch((e=>{console.error("Error occurred while trying to persist Tabnine token",e)}));break;case i.TABNINE_CONFIG_FILE_NAME:r.promises.readFile(i.TABNINE_CONFIG_FILE_PATH,"utf8").then((t=>e.globalState.update(i.TABNINE_CONFIG_CONTEXT_KEY,t))).catch((e=>{console.error("Error occurred while trying to persist Tabnine config",e)}))}}))}(e)}},4803:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t){this.uri=e,this.threads=t}dispose(){this.threads.forEach((e=>e.dispose()))}}},7350:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(9973);function o(e){return r.workspace.textDocuments.find((t=>t.uri===e.uri))}t.default=class{constructor(e,t,n){this.oldValue=e,this.suggestion=t,this.language=n}get body(){return(new r.MarkdownString).appendCodeblock(this.suggestion.value,this.language)}get mode(){return r.CommentMode.Preview}get author(){return{name:"Tabnine",iconPath:r.Uri.parse("https://www.tabnine.com/favicons/favicon-32x32.png")}}apply(e){const t=o(e);if(!t)return this.fireEvent("comment-applied",e,{success:!1,failureReason:"doument not found"}),!1;const n=t.getText(e.range);if(this.oldValue!==n.trim())return this.fireEvent("comment-applied",e,{success:!1,failureReason:"text did not match"}),!1;const i=new r.WorkspaceEdit;return i.replace(e.uri,e.range,this.suggestion.value),r.workspace.applyEdit(i),this.fireEvent("comment-applied",e,{success:!0}),!0}hide(e){this.fireEvent("comment-hidden",e),e.dispose()}fireEvent(e,t,n={}){var r;i.fireEvent({name:`code-review-${e}`,lineIndex:t.range.start.line,file:t.uri.path,lineCount:null===(r=o(t))||void 0===r?void 0:r.lineCount,...n})}}},4754:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.querySuggestions=t.supportedExtensions=void 0;const r=n(9669),i=n(7348),o=r.default.create({baseURL:i.default.codeReviewBaseUrl,timeout:3e4});t.supportedExtensions=async function(){return(await o.get("languages/extensions")).data},t.querySuggestions=async function(e){return(await o.post("suggestions",e)).data}},1852:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(7054),o=n(8444);let s=null;function a(e){if("git"===e.document.uri.scheme){const t=JSON.parse(e.document.uri.query);return"HEAD"===t.ref||"~"===t.ref}return!1}t.default=function(){const e=r.comments.createCommentController("tabnine.commentController","");e.options={placeHolder:"",prompt:""},r.commands.registerCommand("Tabnine.hideSuggestion",(e=>{const t=e.comments[0];t&&t.hide(e)})),r.commands.registerCommand("Tabnine.applySuggestion",(e=>{const t=e.comments[0];t&&t.apply(e)&&e.dispose()})),r.window.onDidChangeActiveTextEditor((async()=>{if(!i.isCapabilityEnabled(i.Capability.CODE_REVIEW))return;const t=function(){const e=r.window.visibleTextEditors;if(2!==e.length)return null;if(e[0].document.uri.path!==e[1].document.uri.path)return null;const t=e.find(a),n=e.find((e=>"file"===e.document.uri.scheme));if(t&&n)return{oldEditor:t,newEditor:n};return null}();let n=null;t&&(n=await o.default(e,t.newEditor.document,t.oldEditor.document)),s&&s.dispose(),s=n}))}},8444:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(5622),o=n(9479),s=n(4754),a=n(7350),c=n(9973),u=n(4803);t.default=async function(e,t,n){const p=(new Date).getTime();try{if(!(await async function(){l||(l=(await s.supportedExtensions()).extensions);return l}()).includes(i.extname(t.uri.path)))return null;const f=t.getText(),d=[],h=o.diffLines(f,n.getText());let m=0;h.forEach((e=>{e.removed&&d.push({start:m,end:m+e.value.length}),e.added||(m+=e.value.length)}));const g=r.window.createStatusBarItem(r.StatusBarAlignment.Left,-1);let v;g.text="Fecthing Tabnine code review suggestions...",g.show();try{v=await s.querySuggestions({filename:i.basename(t.uri.path),buffer:f,ranges:d,threshold:"review"})}finally{g.dispose()}const y=[];return v.focus.forEach((n=>{const i=n.suggestions.find((e=>"other"===e.classification.type));if(!i)return;const o=t.lineAt(t.positionAt(n.start)),s=e.createCommentThread(t.uri,o.range,[new a.default(n.old_value,i,t.languageId)]);s.canReply=!1,s.collapsibleState=r.CommentThreadCollapsibleState.Expanded,s.label=i.classification.description,y.push(s)})),c.fireEvent({name:"code-review-diff-task-success",durationMs:(new Date).getTime()-p,suggestions:v.focus.length,file:t.uri.path,lineCount:t.lineCount}),new u.default(t.uri,y)}catch(e){throw c.fireEvent({name:"code-review-diff-task-error",durationMs:(new Date).getTime()-p,file:t.uri.path,lineCount:t.lineCount,error:e.message||e.toString()}),e}};let l=null;setInterval((()=>{l=null}),6e5)},9913:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openConfigWithSource=t.registerCommands=t.SAVE_SNIPPET_COMMAND=t.STATUS_BAR_COMMAND=t.CONFIG_COMMAND=void 0;const r=n(7549),i=n(9980),o=n(2478),s=n(9973),a=n(5104),c=n(7054),u=n(663);function l(e){return async(t=null)=>{const n=await s.configuration({quiet:!0,source:e});if(n&&n.message){const e=await r.env.asExternalUri(r.Uri.parse(n.message));i.default(e)}a.default({[o.StatePayload.STATE]:{state_type:(null==t?void 0:t.join("-"))||e}})}}t.CONFIG_COMMAND="TabNine::config",t.STATUS_BAR_COMMAND="TabNine.statusBar",t.SAVE_SNIPPET_COMMAND="Tabnine.saveSnippet",t.registerCommands=async function(e){e.subscriptions.push(r.commands.registerCommand(t.CONFIG_COMMAND,l(o.StateType.PALLETTE))),e.subscriptions.push(r.commands.registerCommand(t.STATUS_BAR_COMMAND,function(e){const t=l(o.StateType.STATUS);return async(n=null)=>{await t(n),c.isCapabilityEnabled(c.Capability.SHOW_AGRESSIVE_STATUS_BAR_UNTIL_CLICKED)&&await e.globalState.update(o.STATUS_BAR_FIRST_TIME_CLICKED,!0)}}(e))),c.isCapabilityEnabled(c.Capability.SAVE_SNIPPETS)&&(await u.enableSaveSnippetContext(),e.subscriptions.push(r.commands.registerCommand(t.SAVE_SNIPPET_COMMAND,u.default)))},t.openConfigWithSource=l},1880:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[/Import ([\S]*) from module [\S]*/,/Add ([\S]*) to existing import declaration from [\S]*/,/Import default ([\S]*) from module [\S]*/,/Add default import ([\S]*) to existing import declaration from [\S]*/];function r({title:e}){const t=n.map((t=>t.exec(e))).find(Boolean);return t&&t[1]}t.default=function(e=[]){const t=e.filter((({title:e})=>n.some((t=>t.test(e))))),i=t.map(r);return t.filter((e=>i.filter((t=>t===r(e))).length<=1))}},2478:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TABNINE_APP_URL=t.TABNINE_OPEN_APP_COMMAND=t.SNIPPET_COMMAND=t.TABNINE_TREE_NAVIGATION_COMMAND=t.PREV_INLINE_COMMAND=t.NEXT_INLINE_COMMAND=t.ESCAPE_INLINE_COMMAND=t.ACCEPT_INLINE_COMMAND=t.SLEEP_TIME_BEFORE_OPEN_HUB=t.IS_OSX=t.restartBackoff=t.MessageActions=t.StatePayload=t.StateType=t.COMPLETION_TRIGGERS=t.PROGRESS_KEY=t.DEFAULT_DETAIL=t.BETA_CHANNEL_MESSAGE_SHOWN_KEY=t.ALPHA_VERSION_KEY=t.MINIMAL_SUPPORTED_VSCODE_API=t.LATEST_RELEASE_URL=t.INSTALL_COMMAND=t.OPEN_LP_FROM_STATUS_BAR=t.STATUS_BAR_FIRST_TIME_CLICKED=t.STATUS_BAR_NOTIFICATION_PERIOD=t.BINARY_STATUS_BAR_FIRST_MESSAGE_POLLING_INTERVAL=t.BINARY_STATUS_BAR_POLLING_INTERVAL=t.BINARY_NOTIFICATION_POLLING_INTERVAL=t.BINARY_STARTUP_GRACE=t.DELAY_FOR_CODE_ACTION_PROVIDER=t.WAIT_BEFORE_RESTART_MILLIS=t.REQUEST_FAILURES_THRESHOLD=t.CONSECUTIVE_RESTART_THRESHOLD=t.MAX_NUM_RESULTS=t.CHAR_LIMIT=t.INSTRUMENTATION_KEY=t.STATUS_NAME=t.OPEN_ISSUE_LINK=t.RELOAD_BUTTON=t.DOWNLOAD_RETRY=t.OPEN_NETWORK_SETUP_HELP=t.OPEN_ISSUE_BUTTON=t.BUNDLE_DOWNLOAD_FAILURE_MESSAGE=t.FULL_BRAND_REPRESENTATION=t.LIMITATION_SYMBOL=t.BRAND_NAME=t.ATTRIBUTION_BRAND=t.BINARY_UPDATE_VERSION_FILE_URL=t.BINARY_UPDATE_URL=t.API_VERSION=void 0,t.URI_SCHEME_FILE=void 0;const r=n(8675);t.API_VERSION="4.1.21",t.BINARY_UPDATE_URL="https://update.tabnine.com/bundles",t.BINARY_UPDATE_VERSION_FILE_URL=`${t.BINARY_UPDATE_URL}/version`,t.ATTRIBUTION_BRAND="⌬ ",t.BRAND_NAME="tabnine",t.LIMITATION_SYMBOL="🔒",t.FULL_BRAND_REPRESENTATION=t.ATTRIBUTION_BRAND+t.BRAND_NAME,t.BUNDLE_DOWNLOAD_FAILURE_MESSAGE="Tabnine Extension was unable to download its dependencies. Please check your internet connection. If you use a proxy server, please visit https://code.visualstudio.com/docs/setup/network",t.OPEN_ISSUE_BUTTON="Open issue",t.OPEN_NETWORK_SETUP_HELP="Help",t.DOWNLOAD_RETRY="Retry",t.RELOAD_BUTTON="Reload",t.OPEN_ISSUE_LINK="https://github.com/codota/tabnine-vscode/issues/new",t.STATUS_NAME="Tabnine",t.INSTRUMENTATION_KEY="38efe475-3afd-4e03-8af2-bbcfdeee3b7a",t.CHAR_LIMIT=1e5,t.MAX_NUM_RESULTS=5,t.CONSECUTIVE_RESTART_THRESHOLD=100,t.REQUEST_FAILURES_THRESHOLD=20,t.WAIT_BEFORE_RESTART_MILLIS=1e3,t.DELAY_FOR_CODE_ACTION_PROVIDER=800,t.BINARY_STARTUP_GRACE=+(process.env.BINARY_NOTIFICATION_POLLING_INTERVAL||9e3),t.BINARY_NOTIFICATION_POLLING_INTERVAL=+(process.env.BINARY_NOTIFICATION_POLLING_INTERVAL||1e4),t.BINARY_STATUS_BAR_POLLING_INTERVAL=+(process.env.BINARY_STATUS_BAR_POLLING_INTERVAL||36e5),t.BINARY_STATUS_BAR_FIRST_MESSAGE_POLLING_INTERVAL=+(process.env.BINARY_NOTIFICATION_POLLING_INTERVAL||1e4),t.STATUS_BAR_NOTIFICATION_PERIOD=+(process.env.STATUS_BAR_NOTIFICATION_PERIOD||12e4),t.STATUS_BAR_FIRST_TIME_CLICKED="status-bar-first-time-clicked",t.OPEN_LP_FROM_STATUS_BAR="tabnine:open_lp",t.INSTALL_COMMAND="workbench.extensions.installExtension",t.LATEST_RELEASE_URL="https://api.github.com/repos/codota/tabnine-vscode/releases",t.MINIMAL_SUPPORTED_VSCODE_API="1.35.0",t.ALPHA_VERSION_KEY="tabnine.alpha.version",t.BETA_CHANNEL_MESSAGE_SHOWN_KEY="tabnine.joinBetaChannelMessageShown",t.DEFAULT_DETAIL=t.BRAND_NAME,t.PROGRESS_KEY="tabnine.hide.progress",t.COMPLETION_TRIGGERS=[" ",".","(",")","{","}","[","]",",",":","'",'"',"=","<",">","/","\\","+","-","|","&","*","%","=","$","#","@","!"],function(e){e.ERROR="error",e.INFO="info",e.PROGRESS="progress",e.STATUS="status",e.PALLETTE="pallette",e.NOTIFICATION="notification",e.STARTUP="startup",e.TREE_VIEW="treeView",e.NOTIFICATIONS_WIDGET_WEBVIEW="notificationsWidgetWebview",e.TABNINE_TODAY_WIDGET_WEBVIEW="tabnineTodayWidgetWebview",e.AUTH="auth"}(t.StateType||(t.StateType={})),function(e){e.MESSAGE="Message",e.STATE="State",e.NOTIFICATION_SHOWN="NotificationShown",e.STATUS_SHOWN="StatusShown",e.HOVER_SHOWN="HoverShown",e.HINT_SHOWN="HintShown",e.SNIPPET_SHOWN="SnippetShown"}(t.StatePayload||(t.StatePayload={})),function(e){e.NONE="None",e.OPEN_HUB="OpenHub",e.OPEN_LP="OpenLp",e.OPEN_BUY="OpenBuy",e.OPEN_SIGNUP="OpenSignup"}(t.MessageActions||(t.MessageActions={}));t.restartBackoff=function(e){return Math.min(1e3*2**Math.min(e,10),36e5)},t.IS_OSX="darwin"===process.platform,t.SLEEP_TIME_BEFORE_OPEN_HUB=r.default?1e4:0,t.ACCEPT_INLINE_COMMAND="tabnine.accept-inline-suggestion",t.ESCAPE_INLINE_COMMAND="tabnine.escape-inline-suggestion",t.NEXT_INLINE_COMMAND="tabnine.next-inline-suggestion",t.PREV_INLINE_COMMAND="tabnine.prev-inline-suggestion",t.TABNINE_TREE_NAVIGATION_COMMAND="tabnine:navigation",t.SNIPPET_COMMAND="tabnine.snippet-suggestion",t.TABNINE_OPEN_APP_COMMAND="tabnine:open-app",t.TABNINE_APP_URL="https://app.tabnine.com",t.URI_SCHEME_FILE="file"},4401:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5747),i=n(7549),o=n(5622),s=n(2087),a=n(9030),c="TabNine.tabnine-vscode",u="argv.json",l=o.join(i.env.appRoot,"product.json"),p=["",`\t"enable-proposed-api": ["${c}"]`,"}"];t.default=async function(){return async function(){const e=await async function(){const e=await r.promises.readFile(l),t=JSON.parse(e.toString("utf8"));return null==t?void 0:t.dataFolderName}();if(e){const t=function(e){const t=process.env.VSCODE_PORTABLE;if(t)return o.join(t,u);return o.join(s.homedir(),e,u)}(e),n=(await r.promises.readFile(t)).toString();if(n.includes(`${c}`))return!0;const l=function(e){return e.substring(0,e.length-2).concat(",\n",p.join("\n"))}(n);await r.promises.writeFile(t,Buffer.from(l)),a.default({messageId:"inline-update",messageText:"Please reload the window for the Tabnine inline completions to take effect.",buttonText:"Reload",action:()=>{i.commands.executeCommand("workbench.action.reloadWindow")}})}return!1}().catch((e=>(console.error("failed to enable proposedAPI",e),!1)))}},6096:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTabnineExtensionContext=t.setTabnineExtensionContext=void 0;let n=null;t.setTabnineExtensionContext=function(e){n=e},t.getTabnineExtensionContext=function(){return n}},7348:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i="tabnine-vscode";function o(){return r.workspace.getConfiguration("workbench")}const s=function(){const e=r.extensions.all.find((e=>e.id.includes(i))),t=r.workspace.getConfiguration(),n=t.get("javascript.suggest.autoImports"),s=t.get("typescript.suggest.autoImports"),a="tabnine.experimentalAutoImports",c=t.get("tabnine.logFilePath"),u=t.get("tabnine.logLevel");let l=t.get(a);const{remoteName:p}=r.env,{extensionKind:f}=e,d=!!p&&2===f,h=null===l;!1!==l&&(l=!0,t.update(a,l,!0));const m=t.get("tabnine.receiveBetaChannelUpdates")||!1,g=r.env.appName.toLocaleLowerCase().includes("insider");return{get extensionPath(){return null==e?void 0:e.extensionPath},get version(){return(null==e?void 0:e.packageJSON).version},get id(){return null==e?void 0:e.id},get name(){var e;return`tabnine-vscode-${null!==(e=this.version)&&void 0!==e?e:"unknown"}`},get vscodeVersion(){return r.version},get isTabNineAutoImportEnabled(){return!!l},get isJavaScriptAutoImports(){return n},get isTypeScriptAutoImports(){return s},get logFilePath(){return c?`${c}-${process.pid}`:""},get logLevel(){return u},get isRemote(){return d},get remoteName(){return p},get extensionKind(){return f},get themeKind(){return r.ColorThemeKind[r.window.activeColorTheme.kind]},get themeName(){return o().get("colorTheme")},get statusBarColorCustomizations(){const e=o().get("colorCustomizations");return null==e?void 0:e["statusBar.background"]},get isInstalled(){return h},get isVscodeTelemetryEnabled(){return r.workspace.getConfiguration("telemetry").get("enableTelemetry",!0)},get isExtentionBetaChannelEnabled(){return m},get isVscodeInsiders(){return g},get codeReviewBaseUrl(){var e;return null!==(e=t.get("tabnine.codeReviewBaseUrl"))&&void 0!==e?e:"https://api.tabnine.com/code-review/"}}}();t.default=s},5011:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInlineSuggestionApiSupported=void 0;const r=n(1249),i=n(7348);t.default=function(){return r.gte(i.default.vscodeVersion,"1.54.0")},t.isInlineSuggestionApiSupported=function(){return r.gte(i.default.vscodeVersion,"1.58.0")}},3329:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5747),i=n(5622),o=n(7348);t.default=function(e){var t;try{const n=i.dirname(null!==(t=o.default.extensionPath)&&void 0!==t?t:""),s=i.join(n,".obsolete"),a=e=>0!==e.size,c=(e,t)=>new Date(e.mtimeMs)>=new Date(t.atimeMs),u=e=>1!==e.filter((e=>!!o.default.id&&e.toLowerCase().includes(o.default.id.toLowerCase()))).length,l=(t,i)=>{a(t)&&c(t,i)&&r.readFile(s,((t,i)=>{if(t)throw console.error("failed to read .obsolete file:",t),t;r.readdir(n,((t,a)=>{if(t)throw console.error(`failed to read ${n} directory:`,t),t;!u(a)&&i.includes(o.default.name)&&e().then((()=>{r.unwatchFile(s,l)})).catch((e=>{console.error("failed to report uninstall:",e)}))}))}))};r.watchFile(s,l)}catch(e){console.error("failed to invoke uninstall:",e)}}},5784:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDecorationContains=void 0;const r=n(7549),i=n(5104),o=n(2478),s=n(678),a=r.window.createTextEditorDecorationType({after:{margin:"0 0 0 1rem"}});let c,u;function l(e,t){var n;const i=s.getLogoPath(e),o=null===(n=t.options[0])||void 0===n?void 0:n.key,a=o?`command:${o}`:"https://www.tabnine.com",c=t.message?`[![tabnine](${i}|width=100)](${a}) \n${t.message}`:"",u=new r.MarkdownString(c,!0);return u.isTrusted=!0,u}t.default=function(e,t,n){c={renderOptions:{after:{contentText:n.title,color:"gray"}},range:new r.Range(new r.Position(e.line,e.character),new r.Position(e.line,1024)),hoverMessage:l(t,n)},function(e=10){u&&clearTimeout(u);u=setTimeout((()=>{var e;return c&&(null===(e=r.window.activeTextEditor)||void 0===e?void 0:e.setDecorations(a,[c]))}),e)}(),i.default({[o.StatePayload.HINT_SHOWN]:{id:n.id,text:n.title,notification_type:n.notification_type,state:null}})},t.isDecorationContains=function(e){return!!(null==c?void 0:c.range.contains(e))},r.workspace.onDidChangeTextDocument((()=>{return null===(e=r.window.activeTextEditor)||void 0===e||e.setDecorations(a,[]),void(c=null);var e}))},5955:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(7549),i=n(1666);let o=[];t.default=function(e,t){o.forEach((e=>!!e.dispose())),o=[],e.options.forEach((n=>{const s=r.commands.registerCommand(n.key,(()=>{i.sendHoverAction(e.id,n.key,n.actions,e.notification_type,e.state)}));o.push(s),t.subscriptions.push(s)}))}},8806:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.provideHover=void 0;const r=n(1666),i=n(2478),o=n(5104),s=n(5955),a=n(5784);let c=null;t.provideHover=function(e,t){return function(e){c&&a.isDecorationContains(e)&&o.default({[i.StatePayload.HOVER_SHOWN]:{id:c.id,text:c.message,notification_type:c.notification_type,state:c.state}})}(t),null},t.default=async function(e,t){c=await r.getHover(),(null==c?void 0:c.title)&&(s.default(c,e),a.default(t,e,c))}},9136:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2478),i=n(1264);t.default=function(){return{setLoading:function(){return i.default('\n Loading ...\n \n ')},setUrl:function(e){return i.default(`\n \n