jwt-license-verifier 0.0.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jwt-license-verifier might be problematic. Click here for more details.

@@ -0,0 +1,390 @@
1
+ (function(Pt,qr){typeof exports=="object"&&typeof module<"u"?qr(exports):typeof define=="function"&&define.amd?define(["exports"],qr):(Pt=typeof globalThis<"u"?globalThis:Pt||self,qr(Pt["jwt-license-verifier"]={}))})(this,function(Pt){"use strict";const wl=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));function vl(t){if(t.__esModule)return t;var r=t.default;if(typeof r=="function"){var e=function n(){return this instanceof n?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};e.prototype=r.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),e}var Jn={};const xl={name:"systeminformation",version:"5.21.20",description:"Advanced, lightweight system and OS information library",license:"MIT",author:"Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",homepage:"https://systeminformation.io",main:"./lib/index.js",bin:{systeminformation:"lib/cli.js"},types:"./lib/index.d.ts",scripts:{test:"node ./test/test.js"},files:["lib/"],keywords:["system information","sysinfo","monitor","monitoring","os","linux","osx","windows","freebsd","openbsd","netbsd","cpu","cpuload","physical cores","logical cores","processor","cores","threads","socket type","memory","file system","fsstats","diskio","block devices","netstats","network","network interfaces","network connections","network stats","iface","printer","processes","users","internet","battery","docker","docker stats","docker processes","graphics","graphic card","graphic controller","gpu","display","smart","disk layout","usb","audio","bluetooth","wifi","wifinetworks","virtual box","virtualbox","vm","backend","hardware","BIOS","chassis"],repository:{type:"git",url:"https://github.com/sebhildebrandt/systeminformation.git"},funding:{type:"Buy me a coffee",url:"https://www.buymeacoffee.com/systeminfo"},os:["darwin","linux","win32","freebsd","openbsd","netbsd","sunos","android"],engines:{node:">=8.0.0"}};var W={};const M=vl(wl),Ye=M,Fe=M,Cl=M,Qn=M.spawn,Il=M.exec,zt=M.execSync,Kr=M;let Tt=process.platform;const Zn=Tt==="linux"||Tt==="android",Ii=Tt==="darwin",es=Tt==="win32",_i=Tt==="freebsd",Ei=Tt==="openbsd",Oi=Tt==="netbsd";let ts=0,Vt="",Ve="",Je=null,Qe=null;const Li=process.env.WINDIR||"C:\\Windows";let de,Xt="",Sr=[],rs=!1;const Pi="$OutputEncoding = [System.Console]::OutputEncoding = [System.Console]::InputEncoding = [System.Text.Encoding]::UTF8 ; ",ns="--###START###--",Ti="--ERROR--",Yr="--###ENDCMD###--",ss="--##ID##--",kt={windowsHide:!0,maxBuffer:1024*2e4,encoding:"UTF-8",env:Kr._extend({},process.env,{LANG:"en_US.UTF-8"})};function _l(t){let r=parseInt(t,10);return isNaN(r)&&(r=0),r}const is=new String().replace,os=new String().toLowerCase,Vi=new String().toString,Ai=new String().substr,El=new String().trim,Ol=new String().startsWith,bi=Math.min;function Ll(t){return t&&{}.toString.call(t)==="[object Function]"}function Pl(t){let r=[],e={};for(let n=0;n<t.length;n++){let i=Object.keys(t[n]);i.sort(function(o,a){return o-a});let s="";for(let o=0;o<i.length;o++)s+=JSON.stringify(i[o]),s+=JSON.stringify(t[n][i[o]]);({}).hasOwnProperty.call(e,s)||(r.push(t[n]),e[s]=!0)}return r}function Tl(t,r){return t.sort(function(e,n){let i="",s="";return r.forEach(function(o){i=i+e[o],s=s+n[o]}),i<s?-1:i>s?1:0})}function Vl(){return ts===0&&(ts=Ye.cpus().length),ts}function At(t,r,e,n,i){e=e||":",r=r.toLowerCase(),n=n||!1,i=i||!1;let s="";return t.some(o=>{let a=o.toLowerCase().replace(/\t/g,"");if(n&&(a=a.trim()),a.startsWith(r)&&(!i||a.match(r+e)||a.match(r+" "+e))){const u=n?o.trim().split(e):o.split(e);if(u.length>=2)return u.shift(),s=u.join(e).trim(),!0}}),s}function Al(t,r){return r=r||16,t.replace(/\\x([0-9A-Fa-f]{2})/g,function(){return String.fromCharCode(parseInt(arguments[1],r))})}function bl(t){let r="",e=0;return t.split("").forEach(n=>{n>="0"&&n<="9"?e===1&&e++:(e===0&&e++,e===1&&(r+=n))}),r}function Nl(t,r){r=r||"",t=t.toUpperCase();let e=0,n=0,i=bl(t),s=t.split(i);if(s.length>=2){s[2]&&(s[1]+=s[2]);let o=s[1]&&s[1].toLowerCase().indexOf("pm")>-1||s[1].toLowerCase().indexOf("p.m.")>-1||s[1].toLowerCase().indexOf("p. m.")>-1||s[1].toLowerCase().indexOf("n")>-1||s[1].toLowerCase().indexOf("ch")>-1||s[1].toLowerCase().indexOf("ös")>-1||r&&s[1].toLowerCase().indexOf(r)>-1;return e=parseInt(s[0],10),n=parseInt(s[1],10),e=o&&e<12?e+12:e,("0"+e).substr(-2)+":"+("0"+n).substr(-2)}}function $l(t,r){const e={date:"",time:""};r=r||{};let n=(r.dateFormat||"").toLowerCase(),i=r.pmDesignator||"";const s=t.split(" ");if(s[0]){if(s[0].indexOf("/")>=0){const o=s[0].split("/");o.length===3&&(o[0].length===4?e.date=o[0]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[2]).substr(-2):o[2].length===2?(n.indexOf("/d/")>-1||n.indexOf("/dd/")>-1,e.date="20"+o[2]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[0]).substr(-2)):(t.toLowerCase().indexOf("pm")>-1||t.toLowerCase().indexOf("p.m.")>-1||t.toLowerCase().indexOf("p. m.")>-1||t.toLowerCase().indexOf("am")>-1||t.toLowerCase().indexOf("a.m.")>-1||t.toLowerCase().indexOf("a. m.")>-1||n.indexOf("/d/")>-1||n.indexOf("/dd/")>-1)&&n.indexOf("dd/")!==0?e.date=o[2]+"-"+("0"+o[0]).substr(-2)+"-"+("0"+o[1]).substr(-2):e.date=o[2]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[0]).substr(-2))}if(s[0].indexOf(".")>=0){const o=s[0].split(".");o.length===3&&(n.indexOf(".d.")>-1||n.indexOf(".dd.")>-1?e.date=o[2]+"-"+("0"+o[0]).substr(-2)+"-"+("0"+o[1]).substr(-2):e.date=o[2]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[0]).substr(-2))}if(s[0].indexOf("-")>=0){const o=s[0].split("-");o.length===3&&(e.date=o[0]+"-"+("0"+o[1]).substr(-2)+"-"+("0"+o[2]).substr(-2))}}if(s[1]){s.shift();let o=s.join(" ");e.time=Nl(o,i)}return e}function Dl(t,r){let e=r>0,n=1,i=0,s=0,o=[];for(let u=0;u<t.length;u++)n<=r?(/\s/.test(t[u])&&!e&&(s=u-1,o.push({from:i,to:s+1,cap:t.substring(i,s+1)}),i=s+2,n++),e=t[u]===" "):(!/\s/.test(t[u])&&e&&(s=u-1,i<s&&o.push({from:i,to:s,cap:t.substring(i,s)}),i=s+1,n++),e=t[u]===" ");s=5e3,o.push({from:i,to:s,cap:t.substring(i,s)});let a=o.length;for(let u=0;u<a;u++)o[u].cap.replace(/\s/g,"").length===0&&u+1<a&&(o[u].to=o[u+1].to,o[u].cap=o[u].cap+o[u+1].cap,o.splice(u+1,1),a=a-1);return o}function Rl(t,r,e){for(let n=0;n<t.length;n++)if(t[n][r]===e)return n;return-1}function Ni(){if(Ye.type()==="Windows_NT"&&!Vt&&(Vt=Li+"\\system32\\wbem\\wmic.exe",!Fe.existsSync(Vt)))try{const t=zt("WHERE WMIC",kt).toString().split(`\r
2
+ `);t&&t.length?Vt=t[0]:Vt="wmic"}catch{Vt="wmic"}return Vt}function Ml(t){return new Promise(r=>{process.nextTick(()=>{try{$i(Ni()+" "+t).then(e=>{r(e,"")})}catch(e){r("",e)}})})}function Bl(){return es?`"${process.env.VBOX_INSTALL_PATH||process.env.VBOX_MSI_INSTALL_PATH}\\VBoxManage.exe"`:"vboxmanage"}function as(t){let r="",e,n="";if(t.indexOf(ns)>=0){e=t.split(ns);const s=e[1].split(ss);r=s[0],s.length>1&&(t=s.slice(1).join(ss))}t.indexOf(Yr)>=0&&(e=t.split(Yr),n=e[0]);let i=-1;for(let s=0;s<Sr.length;s++)Sr[s].id===r&&(i=s,Sr[s].callback(n));i>=0&&Sr.splice(i,1)}function Fl(){de||(de=Qn("powershell.exe",["-NoProfile","-NoLogo","-InputFormat","Text","-NoExit","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:1024*2e4,encoding:"UTF-8",env:Kr._extend({},process.env,{LANG:"en_US.UTF-8"})}),de&&de.pid&&(rs=!0,de.stdout.on("data",function(t){Xt=Xt+t.toString("utf8"),t.indexOf(Yr)>=0&&(as(Xt),Xt="")}),de.stderr.on("data",function(){as(Xt+Ti)}),de.on("error",function(){as(Xt+Ti)}),de.on("close",function(){de.kill()})))}function Wl(){try{de&&(de.stdin.write("exit"+Ye.EOL),de.stdin.end(),rs=!1)}catch{de&&de.kill()}de=null}function $i(t){if(rs){const r=Math.random().toString(36).substring(2,12);return new Promise(e=>{process.nextTick(()=>{function n(i){e(i)}Sr.push({id:r,cmd:t,callback:n,start:new Date});try{de&&de.pid&&de.stdin.write(Pi+"echo "+ns+r+ss+"; "+Ye.EOL+t+Ye.EOL+"echo "+Yr+Ye.EOL)}catch{e("")}})})}else{let r="";return new Promise(e=>{process.nextTick(()=>{try{const n=Qn("powershell.exe",["-NoProfile","-NoLogo","-InputFormat","Text","-NoExit","-ExecutionPolicy","Unrestricted","-Command","-"],{stdio:"pipe",windowsHide:!0,maxBuffer:2048e4,encoding:"UTF-8",env:Kr._extend({},process.env,{LANG:"en_US.UTF-8"})});if(n&&!n.pid&&n.on("error",function(){e(r)}),n&&n.pid){n.stdout.on("data",function(i){r=r+i.toString("utf8")}),n.stderr.on("data",function(){n.kill(),e(r)}),n.on("close",function(){n.kill(),e(r)}),n.on("error",function(){n.kill(),e(r)});try{n.stdin.write(Pi+t+Ye.EOL),n.stdin.write("exit"+Ye.EOL),n.stdin.end()}catch{n.kill(),e(r)}}else e(r)}catch{e(r)}})})}}function Gl(t,r,e){let n="";return e=e||{},new Promise(i=>{process.nextTick(()=>{try{const s=Qn(t,r,e);s&&!s.pid&&s.on("error",function(){i(n)}),s&&s.pid?(s.stdout.on("data",function(o){n+=o.toString()}),s.on("close",function(){s.kill(),i(n)}),s.on("error",function(){s.kill(),i(n)})):i(n)}catch{i(n)}})})}function Ul(){if(es){if(!Ve)try{const e=zt("chcp",kt).toString().split(`\r
3
+ `)[0].split(":");Ve=e.length>1?e[1].replace(".","").trim():""}catch{Ve="437"}return Ve}if(Zn||Ii||_i||Ei||Oi){if(!Ve)try{const e=zt("echo $LANG").toString().split(`\r
4
+ `)[0].split(".");Ve=e.length>1?e[1].trim():"",Ve||(Ve="UTF-8")}catch{Ve="UTF-8"}return Ve}}function jl(){if(Je!==null)return Je;if(Je=!1,es)try{const t=zt("WHERE smartctl 2>nul",kt).toString().split(`\r
5
+ `);t&&t.length?Je=t[0].indexOf(":\\")>=0:Je=!1}catch{Je=!1}if(Zn||Ii||_i||Ei||Oi)try{Je=zt("which smartctl 2>/dev/null",kt).toString().split(`\r
6
+ `).length>0}catch{Kr.noop()}return Je}function Hl(){const t=["BCM2708","BCM2709","BCM2710","BCM2711","BCM2712","BCM2835","BCM2836","BCM2837","BCM2837B0"];let r=[];if(Qe!==null)r=Qe;else try{r=Fe.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
7
+ `),Qe=r}catch{return!1}const e=At(r,"hardware");return e&&t.indexOf(e)>-1}function zl(){let t=[];try{t=Fe.readFileSync("/etc/os-release",{encoding:"utf8"}).toString().split(`
8
+ `)}catch{return!1}const r=At(t,"id","=");return r&&r.indexOf("raspbian")>-1}function Xl(t,r,e){e||(e=r,r=kt);let n="chcp 65001 > nul && cmd /C "+t+" && chcp "+Ve+" > nul";Il(n,r,function(i,s){e(i,s)})}function kl(){const t=Fe.existsSync("/Library/Developer/CommandLineTools/usr/bin/"),r=Fe.existsSync("/Applications/Xcode.app/Contents/Developer/Tools"),e=Fe.existsSync("/Library/Developer/Xcode/");return t||e||r}function ql(){const t=process.hrtime();return!Array.isArray(t)||t.length!==2?0:+t[0]*1e9+ +t[1]}function Kl(t,r){r=r||"";const e=[];return t.forEach(n=>{n.startsWith(r)&&e.indexOf(n)===-1&&e.push(n)}),e.length}function Yl(t,r){r=r||"";const e=[];return t.forEach(n=>{n.startsWith(r)&&e.push(n)}),e.length}function Jl(t,r){typeof r>"u"&&(r=!1);const e=t||"";let n="";const i=bi(e.length,2e3);for(let s=0;s<=i;s++)e[s]===void 0||e[s]===">"||e[s]==="<"||e[s]==="*"||e[s]==="?"||e[s]==="["||e[s]==="]"||e[s]==="|"||e[s]==="˚"||e[s]==="$"||e[s]===";"||e[s]==="&"||e[s]==="]"||e[s]==="#"||e[s]==="\\"||e[s]===" "||e[s]===`
9
+ `||e[s]==="\r"||e[s]==="'"||e[s]==="`"||e[s]==='"'||e[s].length>1||r&&e[s]==="("||r&&e[s]===")"||r&&e[s]==="@"||r&&e[s]===" "||r&&e[s]=="{"||r&&e[s]==";"||r&&e[s]=="}"||(n=n+e[s]);return n}function Ql(){const t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";let r=!0,e="";e.__proto__.replace=is,e.__proto__.toLowerCase=os,e.__proto__.toString=Vi,e.__proto__.substr=Ai,r=r||t.length!==62;const n=Date.now();if(typeof n=="number"&&n>16e11){const i=n%100+15;for(let l=0;l<i;l++){const c=Math.random()*61.99999999+1,f=parseInt(Math.floor(c).toString(),10),p=parseInt(c.toString().split(".")[0],10),d=Math.random()*61.99999999+1,m=parseInt(Math.floor(d).toString(),10),g=parseInt(d.toString().split(".")[0],10);r=r&&c!==d,r=r&&f===p&&m===g,e+=t[f-1]}r=r&&e.length===i;let s=Math.random()*i*.9999999999,o=e.substr(0,s)+" "+e.substr(s,2e3);o.__proto__.replace=is;let a=o.replace(/ /g,"");r=r&&e===a,s=Math.random()*i*.9999999999,o=e.substr(0,s)+"{"+e.substr(s,2e3),a=o.replace(/{/g,""),r=r&&e===a,s=Math.random()*i*.9999999999,o=e.substr(0,s)+"*"+e.substr(s,2e3),a=o.replace(/\*/g,""),r=r&&e===a,s=Math.random()*i*.9999999999,o=e.substr(0,s)+"$"+e.substr(s,2e3),a=o.replace(/\$/g,""),r=r&&e===a;const u=e.toLowerCase();r=r&&u.length===i&&u[i-1]&&!u[i];for(let l=0;l<i;l++){const c=e[l];c.__proto__.toLowerCase=os;const f=u?u[l]:"",p=c.toLowerCase();r=r&&p[0]===f&&p[0]&&!p[1]}}return!r}function Zl(t){return("00000000"+parseInt(t,16).toString(2)).substr(-8)}function eu(t){const r=Fe.lstatSync,e=Fe.readdirSync,n=Cl.join;function i(l){return r(l).isDirectory()}function s(l){return r(l).isFile()}function o(l){return e(l).map(function(c){return n(l,c)}).filter(i)}function a(l){return e(l).map(function(c){return n(l,c)}).filter(s)}function u(l){try{return o(l).map(function(p){return u(p)}).reduce(function(p,d){return p.concat(d)},[]).concat(a(l))}catch{return[]}}return Fe.existsSync(t)?u(t):[]}function Di(t){Qe===null&&(Qe=t);const r={"0002":{type:"B",revision:"1.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0003":{type:"B",revision:"1.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0004":{type:"B",revision:"2.0",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0005":{type:"B",revision:"2.0",memory:256,manufacturer:"Qisda",processor:"BCM2835"},"0006":{type:"B",revision:"2.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0007":{type:"A",revision:"2.0",memory:256,manufacturer:"Egoman",processor:"BCM2835"},"0008":{type:"A",revision:"2.0",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0009":{type:"A",revision:"2.0",memory:256,manufacturer:"Qisda",processor:"BCM2835"},"000d":{type:"B",revision:"2.0",memory:512,manufacturer:"Egoman",processor:"BCM2835"},"000e":{type:"B",revision:"2.0",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"000f":{type:"B",revision:"2.0",memory:512,manufacturer:"Egoman",processor:"BCM2835"},"0010":{type:"B+",revision:"1.2",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"0011":{type:"CM1",revision:"1.0",memory:512,manufacturer:"Sony UK",processor:"BCM2835"},"0012":{type:"A+",revision:"1.1",memory:256,manufacturer:"Sony UK",processor:"BCM2835"},"0013":{type:"B+",revision:"1.2",memory:512,manufacturer:"Embest",processor:"BCM2835"},"0014":{type:"CM1",revision:"1.0",memory:512,manufacturer:"Embest",processor:"BCM2835"},"0015":{type:"A+",revision:"1.1",memory:256,manufacturer:"512MB Embest",processor:"BCM2835"}},e=["BCM2835","BCM2836","BCM2837","BCM2711","BCM2712"],n=["Sony UK","Egoman","Embest","Sony Japan","Embest","Stadium"],i={"00":"A","01":"B","02":"A+","03":"B+","04":"2B","05":"Alpha (early prototype)","06":"CM1","08":"3B","09":"Zero","0a":"CM3","0c":"Zero W","0d":"3B+","0e":"3A+","0f":"Internal use only",10:"CM3+",11:"4B",12:"Zero 2 W",13:"400",14:"CM4",15:"CM4S",17:"5"},s=At(t,"revision",":",!0),o=At(t,"model:",":",!0),a=At(t,"serial",":",!0);let u={};if({}.hasOwnProperty.call(r,s))u={model:o,serial:a,revisionCode:s,memory:r[s].memory,manufacturer:r[s].manufacturer,processor:r[s].processor,type:r[s].type,revision:r[s].revision};else{const l=("00000000"+At(t,"revision",":",!0).toLowerCase()).substr(-8),c=parseInt(Zl(l.substr(2,1)).substr(5,3),2)||0,f=n[parseInt(l.substr(3,1),10)],p=e[parseInt(l.substr(4,1),10)],d=l.substr(5,2);u={model:o,serial:a,revisionCode:s,memory:256*Math.pow(2,c),manufacturer:f,processor:p,type:{}.hasOwnProperty.call(i,d)?i[d]:"",revision:"1."+l.substr(7,1)}}return u}function tu(){let t=null;if(Qe!==null)t=Qe;else try{t=Fe.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
10
+ `),Qe=t}catch{return!1}const r=Di(t);return r.type==="4B"||r.type==="CM4"||r.type==="CM4S"||r.type==="400"?"VideoCore VI":r.type==="5"?"VideoCore VII":"VideoCore IV"}function ru(t){const r=t.map(function(i){return new Promise(function(s){let o=new Array(2);i.then(function(a){o[0]=a}).catch(function(a){o[1]=a}).then(function(){s(o)})})}),e=[],n=[];return Promise.all(r).then(function(i){return i.forEach(function(s){s[1]?(e.push(s[1]),n.push(null)):(e.push(null),n.push(s[0]))}),{errors:e,results:n}})}function nu(t){return function(){const r=Array.prototype.slice.call(arguments);return new Promise(function(e,n){r.push(function(i,s){i?n(i):e(s)}),t.apply(null,r)})}}function su(t){return function(){const r=Array.prototype.slice.call(arguments);return new Promise(function(e){r.push(function(n,i){e(i)}),t.apply(null,r)})}}function iu(){let t="";if(Zn)try{t=zt("uname -v").toString()}catch{t=""}return t}function ou(t){const r=["array","dict","key","string","integer","date","real","data","boolean","arrayEmpty"],e="<plist version";let n=t.indexOf(e),i=t.length;for(;t[n]!==">"&&n<i;)n++;let s=0,o=!1,a=!1,u=!1,l=[{tagStart:"",tagEnd:"",tagContent:"",key:"",data:null}],c="",f=t[n];for(;n<i;)c=f,n+1<i&&(f=t[n+1]),c==="<"?(a=!1,f==="/"?u=!0:l[s].tagStart?(l[s].tagContent="",l[s].data||(l[s].data=l[s].tagStart==="array"?[]:{}),s++,l.push({tagStart:"",tagEnd:"",tagContent:"",key:null,data:null}),o=!0,a=!1):o||(o=!0)):c===">"?(l[s].tagStart==="true/"&&(o=!1,u=!0,l[s].tagStart="",l[s].tagEnd="/boolean",l[s].data=!0),l[s].tagStart==="false/"&&(o=!1,u=!0,l[s].tagStart="",l[s].tagEnd="/boolean",l[s].data=!1),l[s].tagStart==="array/"&&(o=!1,u=!0,l[s].tagStart="",l[s].tagEnd="/arrayEmpty",l[s].data=[]),a&&(a=!1),o&&(o=!1,a=!0,l[s].tagStart==="array"&&(l[s].data=[]),l[s].tagStart==="dict"&&(l[s].data={})),u&&(u=!1,l[s].tagEnd&&r.indexOf(l[s].tagEnd.substr(1))>=0&&(l[s].tagEnd==="/dict"||l[s].tagEnd==="/array"?(s>1&&l[s-2].tagStart==="array"&&l[s-2].data.push(l[s-1].data),s>1&&l[s-2].tagStart==="dict"&&(l[s-2].data[l[s-1].key]=l[s-1].data),s--,l.pop(),l[s].tagContent="",l[s].tagStart="",l[s].tagEnd=""):(l[s].tagEnd==="/key"&&l[s].tagContent?l[s].key=l[s].tagContent:(l[s].tagEnd==="/real"&&l[s].tagContent&&(l[s].data=parseFloat(l[s].tagContent)||0),l[s].tagEnd==="/integer"&&l[s].tagContent&&(l[s].data=parseInt(l[s].tagContent)||0),l[s].tagEnd==="/string"&&l[s].tagContent&&(l[s].data=l[s].tagContent||""),l[s].tagEnd==="/boolean"&&(l[s].data=l[s].tagContent||!1),l[s].tagEnd==="/arrayEmpty"&&(l[s].data=l[s].tagContent||[]),s>0&&l[s-1].tagStart==="array"&&l[s-1].data.push(l[s].data),s>0&&l[s-1].tagStart==="dict"&&(l[s-1].data[l[s].key]=l[s].data)),l[s].tagContent="",l[s].tagStart="",l[s].tagEnd="")),l[s].tagEnd="",o=!1,a=!1)):(o&&(l[s].tagStart+=c),u&&(l[s].tagEnd+=c),a&&(l[s].tagContent+=c)),n++;return l[0].data}function Ri(t){return typeof t=="string"&&!isNaN(t)&&!isNaN(parseFloat(t))}function au(t){const r=t.split(`
11
+ `);for(let n=0;n<r.length;n++){if(r[n].indexOf(" = ")>=0){const i=r[n].split(" = ");if(i[0]=i[0].trim(),i[0].startsWith('"')||(i[0]='"'+i[0]+'"'),i[1]=i[1].trim(),i[1].indexOf('"')===-1&&i[1].endsWith(";")){const s=i[1].substring(0,i[1].length-1);Ri(s)||(i[1]=`"${s}";`)}if(i[1].indexOf('"')>=0&&i[1].endsWith(";")){const s=i[1].substring(0,i[1].length-1).replace(/"/g,"");Ri(s)&&(i[1]=`${s};`)}r[n]=i.join(" : ")}r[n]=r[n].replace(/\(/g,"[").replace(/\)/g,"]").replace(/;/g,",").trim(),r[n].startsWith("}")&&r[n-1]&&r[n-1].endsWith(",")&&(r[n-1]=r[n-1].substring(0,r[n-1].length-1))}t=r.join("");let e={};try{e=JSON.parse(t)}catch{}return e}function lu(t,r){let e=0;const n=t.split("."),i=r.split(".");return n[0]<i[0]?e=1:n[0]>i[0]?e=-1:n[0]===i[0]&&n.length>=2&&i.length>=2&&(n[1]<i[1]?e=1:n[1]>i[1]?e=-1:n[1]===i[1]&&(n.length>=3&&i.length>=3?n[2]<i[2]?e=1:n[2]>i[2]&&(e=-1):i.length>=3&&(e=1))),e}function uu(){}W.toInt=_l,W.execOptsWin=kt,W.getCodepage=Ul,W.execWin=Xl,W.isFunction=Ll,W.unique=Pl,W.sortByKey=Tl,W.cores=Vl,W.getValue=At,W.decodeEscapeSequence=Al,W.parseDateTime=$l,W.parseHead=Dl,W.findObjectByKey=Rl,W.getWmic=Ni,W.wmic=Ml,W.darwinXcodeExists=kl,W.getVboxmanage=Bl,W.powerShell=$i,W.powerShellStart=Fl,W.powerShellRelease=Wl,W.execSafe=Gl,W.nanoSeconds=ql,W.countUniqueLines=Kl,W.countLines=Yl,W.noop=uu,W.isRaspberry=Hl,W.isRaspbian=zl,W.sanitizeShellString=Jl,W.isPrototypePolluted=Ql,W.decodePiCpuinfo=Di,W.getRpiGpu=tu,W.promiseAll=ru,W.promisify=nu,W.promisifySave=su,W.smartMonToolsInstalled=jl,W.linuxVersion=iu,W.plistParser=ou,W.plistReader=au,W.stringReplace=is,W.stringToLower=os,W.stringToString=Vi,W.stringSubstr=Ai,W.stringTrim=El,W.stringStartWith=Ol,W.mathMin=bi,W.WINDIR=Li,W.getFilesInPath=eu,W.semverCompare=lu;var wr={};const Jr=M,bt=M,C=W,qt=M.exec,Kt=M.execSync,Qr=C.promisify(M.exec);let Ze=process.platform;const Zr=Ze==="linux"||Ze==="android",en=Ze==="darwin",tn=Ze==="win32",vr=Ze==="freebsd",xr=Ze==="openbsd",Cr=Ze==="netbsd",rn=Ze==="sunos";function cu(t){return new Promise(r=>{process.nextTick(()=>{let e={manufacturer:"",model:"Computer",version:"",serial:"-",uuid:"-",sku:"-",virtual:!1};if((Zr||vr||xr||Cr)&&qt("export LC_ALL=C; dmidecode -t system 2>/dev/null; unset LC_ALL",function(n,i){let s=i.toString().split(`
12
+ `);e.manufacturer=C.getValue(s,"manufacturer"),e.model=C.getValue(s,"product name"),e.version=C.getValue(s,"version"),e.serial=C.getValue(s,"serial number"),e.uuid=C.getValue(s,"uuid").toLowerCase(),e.sku=C.getValue(s,"sku number");const o=`echo -n "product_name: "; cat /sys/devices/virtual/dmi/id/product_name 2>/dev/null; echo;
13
+ echo -n "product_serial: "; cat /sys/devices/virtual/dmi/id/product_serial 2>/dev/null; echo;
14
+ echo -n "product_uuid: "; cat /sys/devices/virtual/dmi/id/product_uuid 2>/dev/null; echo;
15
+ echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;
16
+ echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;try{s=Kt(o).toString().split(`
17
+ `),e.manufacturer=e.manufacturer===""?C.getValue(s,"sys_vendor"):e.manufacturer,e.model=e.model===""?C.getValue(s,"product_name"):e.model,e.version=e.version===""?C.getValue(s,"product_version"):e.version,e.serial=e.serial===""?C.getValue(s,"product_serial"):e.serial,e.uuid=e.uuid===""?C.getValue(s,"product_uuid").toLowerCase():e.uuid}catch{C.noop()}if((!e.serial||e.serial.toLowerCase().indexOf("o.e.m.")!==-1)&&(e.serial="-"),(!e.manufacturer||e.manufacturer.toLowerCase().indexOf("o.e.m.")!==-1)&&(e.manufacturer=""),(!e.model||e.model.toLowerCase().indexOf("o.e.m.")!==-1)&&(e.model="Computer"),(!e.version||e.version.toLowerCase().indexOf("o.e.m.")!==-1)&&(e.version=""),(!e.sku||e.sku.toLowerCase().indexOf("o.e.m.")!==-1)&&(e.sku="-"),e.model.toLowerCase()==="virtualbox"||e.model.toLowerCase()==="kvm"||e.model.toLowerCase()==="virtual machine"||e.model.toLowerCase()==="bochs"||e.model.toLowerCase().startsWith("vmware")||e.model.toLowerCase().startsWith("droplet"))switch(e.virtual=!0,e.model.toLowerCase()){case"virtualbox":e.virtualHost="VirtualBox";break;case"vmware":e.virtualHost="VMware";break;case"kvm":e.virtualHost="KVM";break;case"bochs":e.virtualHost="bochs";break}if(e.manufacturer.toLowerCase().startsWith("vmware")||e.manufacturer.toLowerCase()==="xen")switch(e.virtual=!0,e.manufacturer.toLowerCase()){case"vmware":e.virtualHost="VMware";break;case"xen":e.virtualHost="Xen";break}if(!e.virtual)try{const a=Kt("ls -1 /dev/disk/by-id/ 2>/dev/null").toString();a.indexOf("_QEMU_")>=0&&(e.virtual=!0,e.virtualHost="QEMU"),a.indexOf("_VBOX_")>=0&&(e.virtual=!0,e.virtualHost="VirtualBox")}catch{C.noop()}if(!e.virtual&&(bt.release().toLowerCase().indexOf("microsoft")>=0||bt.release().toLowerCase().endsWith("wsl2"))){const a=parseFloat(bt.release().toLowerCase());e.virtual=!0,e.manufacturer="Microsoft",e.model="WSL",e.version=a<4.19?"1":"2"}if((vr||xr||Cr)&&!e.virtualHost)try{const u=Kt("dmidecode -t 4").toString().split(`
18
+ `);switch(C.getValue(u,"manufacturer",":",!0).toLowerCase()){case"virtualbox":e.virtualHost="VirtualBox";break;case"vmware":e.virtualHost="VMware";break;case"kvm":e.virtualHost="KVM";break;case"bochs":e.virtualHost="bochs";break}}catch{C.noop()}(Jr.existsSync("/.dockerenv")||Jr.existsSync("/.dockerinit"))&&(e.model="Docker Container");try{const a=Kt('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"');a.toString().split(`
19
+ `).length>0&&(e.model==="Computer"&&(e.model="Virtual machine"),e.virtual=!0,a.toString().toLowerCase().indexOf("vmware")>=0&&!e.virtualHost&&(e.virtualHost="VMware"),a.toString().toLowerCase().indexOf("qemu")>=0&&!e.virtualHost&&(e.virtualHost="QEMU"),a.toString().toLowerCase().indexOf("xen")>=0&&!e.virtualHost&&(e.virtualHost="Xen"),a.toString().toLowerCase().indexOf("kvm")>=0&&!e.virtualHost&&(e.virtualHost="KVM"))}catch{C.noop()}e.manufacturer===""&&e.model==="Computer"&&e.version===""?Jr.readFile("/proc/cpuinfo",function(a,u){if(!a){let l=u.toString().split(`
20
+ `);e.model=C.getValue(l,"hardware",":",!0).toUpperCase(),e.version=C.getValue(l,"revision",":",!0).toLowerCase(),e.serial=C.getValue(l,"serial",":",!0);const c=C.getValue(l,"model:",":",!0);if((e.model==="BCM2835"||e.model==="BCM2708"||e.model==="BCM2709"||e.model==="BCM2710"||e.model==="BCM2711"||e.model==="BCM2836"||e.model==="BCM2837")&&c.toLowerCase().indexOf("raspberry")>=0){const f=C.decodePiCpuinfo(l);e.model=f.model,e.version=f.revisionCode,e.manufacturer="Raspberry Pi Foundation",e.raspberry={manufacturer:f.manufacturer,processor:f.processor,type:f.type,revision:f.revision}}}t&&t(e),r(e)}):(t&&t(e),r(e))}),en&&qt("ioreg -c IOPlatformExpertDevice -d 2",function(n,i){if(!n){let s=i.toString().replace(/[<>"]/g,"").split(`
21
+ `);e.manufacturer=C.getValue(s,"manufacturer","=",!0),e.model=C.getValue(s,"model","=",!0,!0),e.version=C.getValue(s,"version","=",!0),e.serial=C.getValue(s,"ioplatformserialnumber","=",!0),e.uuid=C.getValue(s,"ioplatformuuid","=",!0).toLowerCase(),e.sku=C.getValue(s,"board-id","=",!0)}t&&t(e),r(e)}),rn&&(t&&t(e),r(e)),tn)try{C.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select Name,Vendor,Version,IdentifyingNumber,UUID | fl").then((n,i)=>{if(i)t&&t(e),r(e);else{let s=n.split(`\r
22
+ `);e.manufacturer=C.getValue(s,"vendor",":"),e.model=C.getValue(s,"name",":"),e.version=C.getValue(s,"version",":"),e.serial=C.getValue(s,"identifyingnumber",":"),e.uuid=C.getValue(s,"uuid",":").toLowerCase();const o=e.model.toLowerCase();(o==="virtualbox"||o==="kvm"||o==="virtual machine"||o==="bochs"||o.startsWith("vmware")||o.startsWith("qemu")||o.startsWith("parallels"))&&(e.virtual=!0,o.startsWith("virtualbox")&&(e.virtualHost="VirtualBox"),o.startsWith("vmware")&&(e.virtualHost="VMware"),o.startsWith("kvm")&&(e.virtualHost="KVM"),o.startsWith("bochs")&&(e.virtualHost="bochs"),o.startsWith("qemu")&&(e.virtualHost="KVM"),o.startsWith("parallels")&&(e.virtualHost="Parallels"));const a=e.manufacturer.toLowerCase();(a.startsWith("vmware")||a.startsWith("qemu")||a==="xen"||a.startsWith("parallels"))&&(e.virtual=!0,a.startsWith("vmware")&&(e.virtualHost="VMware"),a.startsWith("xen")&&(e.virtualHost="Xen"),a.startsWith("qemu")&&(e.virtualHost="KVM"),a.startsWith("parallels")&&(e.virtualHost="Parallels")),C.powerShell('Get-CimInstance MS_Systeminformation -Namespace "root/wmi" | select systemsku | fl ').then((u,l)=>{if(!l){let c=u.split(`\r
23
+ `);e.sku=C.getValue(c,"systemsku",":")}e.virtual?(t&&t(e),r(e)):C.powerShell("Get-CimInstance Win32_bios | select Version, SerialNumber, SMBIOSBIOSVersion").then((c,f)=>{if(f)t&&t(e),r(e);else{let p=c.toString();(p.indexOf("VRTUAL")>=0||p.indexOf("A M I ")>=0||p.indexOf("VirtualBox")>=0||p.indexOf("VMWare")>=0||p.indexOf("Xen")>=0||p.indexOf("Parallels")>=0)&&(e.virtual=!0,p.indexOf("VirtualBox")>=0&&!e.virtualHost&&(e.virtualHost="VirtualBox"),p.indexOf("VMware")>=0&&!e.virtualHost&&(e.virtualHost="VMware"),p.indexOf("Xen")>=0&&!e.virtualHost&&(e.virtualHost="Xen"),p.indexOf("VRTUAL")>=0&&!e.virtualHost&&(e.virtualHost="Hyper-V"),p.indexOf("A M I")>=0&&!e.virtualHost&&(e.virtualHost="Virtual PC"),p.indexOf("Parallels")>=0&&!e.virtualHost&&(e.virtualHost="Parallels")),t&&t(e),r(e)}})})}})}catch{t&&t(e),r(e)}})})}wr.system=cu;function Se(t){const r=t.toLowerCase();return r.indexOf("o.e.m.")===-1&&r.indexOf("default string")===-1&&r!=="default"&&t||""}function fu(t){return new Promise(r=>{process.nextTick(()=>{let e={vendor:"",version:"",releaseDate:"",revision:""},n="";if((Zr||vr||xr||Cr)&&(process.arch==="arm"?n="cat /proc/cpuinfo | grep Serial":n="export LC_ALL=C; dmidecode -t bios 2>/dev/null; unset LC_ALL",qt(n,function(i,s){let o=s.toString().split(`
24
+ `);e.vendor=C.getValue(o,"Vendor"),e.version=C.getValue(o,"Version");let a=C.getValue(o,"Release Date");e.releaseDate=C.parseDateTime(a).date,e.revision=C.getValue(o,"BIOS Revision"),e.serial=C.getValue(o,"SerialNumber");let u=C.getValue(o,"Currently Installed Language").split("|")[0];if(u&&(e.language=u),o.length&&s.toString().indexOf("Characteristics:")>=0){const c=[];o.forEach(f=>{if(f.indexOf(" is supported")>=0){const p=f.split(" is supported")[0].trim();c.push(p)}}),e.features=c}const l=`echo -n "bios_date: "; cat /sys/devices/virtual/dmi/id/bios_date 2>/dev/null; echo;
25
+ echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;
26
+ echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;try{o=Kt(l).toString().split(`
27
+ `),e.vendor=e.vendor?e.vendor:C.getValue(o,"bios_vendor"),e.version=e.version?e.version:C.getValue(o,"bios_version"),a=C.getValue(o,"bios_date"),e.releaseDate=e.releaseDate?e.releaseDate:C.parseDateTime(a).date}catch{C.noop()}t&&t(e),r(e)})),en&&(e.vendor="Apple Inc.",qt("system_profiler SPHardwareDataType -json",function(i,s){try{const o=JSON.parse(s.toString());if(o&&o.SPHardwareDataType&&o.SPHardwareDataType.length){let a=o.SPHardwareDataType[0].boot_rom_version;a=a?a.split("(")[0].trim():null,e.version=a}}catch{C.noop()}t&&t(e),r(e)})),rn&&(e.vendor="Sun Microsystems",t&&t(e),r(e)),tn)try{C.powerShell('Get-CimInstance Win32_bios | select Description,Version,Manufacturer,@{n="ReleaseDate";e={$_.ReleaseDate.ToString("yyyy-MM-dd")}},BuildNumber,SerialNumber,SMBIOSBIOSVersion | fl').then((i,s)=>{if(!s){let o=i.toString().split(`\r
28
+ `);const a=C.getValue(o,"description",":"),u=C.getValue(o,"SMBIOSBIOSVersion",":");a.indexOf(" Version ")!==-1?(e.vendor=a.split(" Version ")[0].trim(),e.version=a.split(" Version ")[1].trim()):a.indexOf(" Ver: ")!==-1?(e.vendor=C.getValue(o,"manufacturer",":"),e.version=a.split(" Ver: ")[1].trim()):(e.vendor=C.getValue(o,"manufacturer",":"),e.version=u||C.getValue(o,"version",":")),e.releaseDate=C.getValue(o,"releasedate",":"),e.revision=C.getValue(o,"buildnumber",":"),e.serial=Se(C.getValue(o,"serialnumber",":"))}t&&t(e),r(e)})}catch{t&&t(e),r(e)}})})}wr.bios=fu;function pu(t){return new Promise(r=>{process.nextTick(()=>{let e={manufacturer:"",model:"",version:"",serial:"-",assetTag:"-",memMax:null,memSlots:null},n="";if(Zr||vr||xr||Cr){process.arch==="arm"?n="cat /proc/cpuinfo | grep Serial":n="export LC_ALL=C; dmidecode -t 2 2>/dev/null; unset LC_ALL";const i=[];i.push(Qr(n)),i.push(Qr("export LC_ALL=C; dmidecode -t memory 2>/dev/null")),C.promiseAll(i).then(s=>{let o=s.results[0]?s.results[0].toString().split(`
29
+ `):[""];e.manufacturer=C.getValue(o,"Manufacturer"),e.model=C.getValue(o,"Product Name"),e.version=C.getValue(o,"Version"),e.serial=C.getValue(o,"Serial Number"),e.assetTag=C.getValue(o,"Asset Tag");const a=`echo -n "board_asset_tag: "; cat /sys/devices/virtual/dmi/id/board_asset_tag 2>/dev/null; echo;
30
+ echo -n "board_name: "; cat /sys/devices/virtual/dmi/id/board_name 2>/dev/null; echo;
31
+ echo -n "board_serial: "; cat /sys/devices/virtual/dmi/id/board_serial 2>/dev/null; echo;
32
+ echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;
33
+ echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;try{o=Kt(a).toString().split(`
34
+ `),e.manufacturer=e.manufacturer?e.manufacturer:C.getValue(o,"board_vendor"),e.model=e.model?e.model:C.getValue(o,"board_name"),e.version=e.version?e.version:C.getValue(o,"board_version"),e.serial=e.serial?e.serial:C.getValue(o,"board_serial"),e.assetTag=e.assetTag?e.assetTag:C.getValue(o,"board_asset_tag")}catch{C.noop()}e.serial.toLowerCase().indexOf("o.e.m.")!==-1&&(e.serial="-"),e.assetTag.toLowerCase().indexOf("o.e.m.")!==-1&&(e.assetTag="-"),o=s.results[1]?s.results[1].toString().split(`
35
+ `):[""],e.memMax=C.toInt(C.getValue(o,"Maximum Capacity"))*1024*1024*1024||null,e.memSlots=C.toInt(C.getValue(o,"Number Of Devices"))||null;let u="";try{u=Jr.readFileSync("/proc/cpuinfo").toString().split(`
36
+ `)}catch{C.noop()}if(u&&C.getValue(u,"hardware").startsWith("BCM")){const c=C.decodePiCpuinfo(u);e.manufacturer=c.manufacturer,e.model="Raspberry Pi",e.serial=c.serial,e.version=c.type+" - "+c.revision,e.memMax=bt.totalmem(),e.memSlots=0}t&&t(e),r(e)})}if(en){const i=[];i.push(Qr("ioreg -c IOPlatformExpertDevice -d 2")),i.push(Qr("system_profiler SPMemoryDataType")),C.promiseAll(i).then(s=>{let o=s.results[0]?s.results[0].toString().replace(/[<>"]/g,"").split(`
37
+ `):[""];e.manufacturer=C.getValue(o,"manufacturer","=",!0),e.model=C.getValue(o,"model","=",!0),e.version=C.getValue(o,"version","=",!0),e.serial=C.getValue(o,"ioplatformserialnumber","=",!0),e.assetTag=C.getValue(o,"board-id","=",!0);let a=s.results[1]?s.results[1].toString().split(" BANK "):[""];a.length===1&&(a=s.results[1]?s.results[1].toString().split(" DIMM"):[""]),a.shift(),e.memSlots=a.length,bt.arch()==="arm64"&&(e.memSlots=0,e.memMax=bt.totalmem()),t&&t(e),r(e)})}if(rn&&(t&&t(e),r(e)),tn)try{const i=[],s=parseInt(bt.release())>=10,o=s?"MaxCapacityEx":"MaxCapacity";i.push(C.powerShell("Get-CimInstance Win32_baseboard | select Model,Manufacturer,Product,Version,SerialNumber,PartNumber,SKU | fl")),i.push(C.powerShell(`Get-CimInstance Win32_physicalmemoryarray | select ${o}, MemoryDevices | fl`)),C.promiseAll(i).then(a=>{let u=a.results[0]?a.results[0].toString().split(`\r
38
+ `):[""];e.manufacturer=Se(C.getValue(u,"manufacturer",":")),e.model=Se(C.getValue(u,"model",":")),e.model||(e.model=Se(C.getValue(u,"product",":"))),e.version=Se(C.getValue(u,"version",":")),e.serial=Se(C.getValue(u,"serialnumber",":")),e.assetTag=Se(C.getValue(u,"partnumber",":")),e.assetTag||(e.assetTag=Se(C.getValue(u,"sku",":"))),u=a.results[1]?a.results[1].toString().split(`\r
39
+ `):[""],e.memMax=C.toInt(C.getValue(u,o,":"))*(s?1024:1)||null,e.memSlots=C.toInt(C.getValue(u,"MemoryDevices",":"))||null,t&&t(e),r(e)})}catch{t&&t(e),r(e)}})})}wr.baseboard=pu;function du(t){const r=["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","Convertible","Detachable","IoT Gateway ","Embedded PC","Mini PC","Stick PC"];return new Promise(e=>{process.nextTick(()=>{let n={manufacturer:"",model:"",type:"",version:"",serial:"-",assetTag:"-",sku:""};if((Zr||vr||xr||Cr)&&qt(`echo -n "chassis_asset_tag: "; cat /sys/devices/virtual/dmi/id/chassis_asset_tag 2>/dev/null; echo;
40
+ echo -n "chassis_serial: "; cat /sys/devices/virtual/dmi/id/chassis_serial 2>/dev/null; echo;
41
+ echo -n "chassis_type: "; cat /sys/devices/virtual/dmi/id/chassis_type 2>/dev/null; echo;
42
+ echo -n "chassis_vendor: "; cat /sys/devices/virtual/dmi/id/chassis_vendor 2>/dev/null; echo;
43
+ echo -n "chassis_version: "; cat /sys/devices/virtual/dmi/id/chassis_version 2>/dev/null; echo;`,function(s,o){let a=o.toString().split(`
44
+ `);n.manufacturer=C.getValue(a,"chassis_vendor");const u=parseInt(C.getValue(a,"chassis_type").replace(/\D/g,""));n.type=u&&!isNaN(u)&&u<r.length?r[u-1]:"",n.version=C.getValue(a,"chassis_version"),n.serial=C.getValue(a,"chassis_serial"),n.assetTag=C.getValue(a,"chassis_asset_tag"),n.manufacturer.toLowerCase().indexOf("o.e.m.")!==-1&&(n.manufacturer="-"),n.version.toLowerCase().indexOf("o.e.m.")!==-1&&(n.version="-"),n.serial.toLowerCase().indexOf("o.e.m.")!==-1&&(n.serial="-"),n.assetTag.toLowerCase().indexOf("o.e.m.")!==-1&&(n.assetTag="-"),t&&t(n),e(n)}),en&&qt("ioreg -c IOPlatformExpertDevice -d 2",function(i,s){if(!i){let o=s.toString().replace(/[<>"]/g,"").split(`
45
+ `);n.manufacturer=C.getValue(o,"manufacturer","=",!0),n.model=C.getValue(o,"model","=",!0),n.version=C.getValue(o,"version","=",!0),n.serial=C.getValue(o,"ioplatformserialnumber","=",!0),n.assetTag=C.getValue(o,"board-id","=",!0)}t&&t(n),e(n)}),rn&&(t&&t(n),e(n)),tn)try{C.powerShell("Get-CimInstance Win32_SystemEnclosure | select Model,Manufacturer,ChassisTypes,Version,SerialNumber,PartNumber,SKU,SMBIOSAssetTag | fl").then((i,s)=>{if(!s){let o=i.toString().split(`\r
46
+ `);n.manufacturer=Se(C.getValue(o,"manufacturer",":")),n.model=Se(C.getValue(o,"model",":"));const a=parseInt(C.getValue(o,"ChassisTypes",":").replace(/\D/g,""));n.type=a&&!isNaN(a)&&a<r.length?r[a-1]:"",n.version=Se(C.getValue(o,"version",":")),n.serial=Se(C.getValue(o,"serialnumber",":")),n.assetTag=Se(C.getValue(o,"partnumber",":")),n.assetTag||(n.assetTag=Se(C.getValue(o,"SMBIOSAssetTag",":"))),n.sku=Se(C.getValue(o,"sku",":"))}t&&t(n),e(n)})}catch{t&&t(n),e(n)}})})}wr.chassis=du;var Yt={};const We=M,_e=M,k=W,K=M.exec,Ir=M.execSync;let Ae=process.platform;const _r=Ae==="linux"||Ae==="android",be=Ae==="darwin",Ee=Ae==="win32",ls=Ae==="freebsd",us=Ae==="openbsd",cs=Ae==="netbsd",mu=Ae==="sunos";function hu(){let t=new Date().toString().split(" ");return{current:Date.now(),uptime:We.uptime(),timezone:t.length>=7?t[5]:"",timezoneName:Intl?Intl.DateTimeFormat().resolvedOptions().timeZone:t.length>=7?t.slice(6).join(" ").replace(/\(/g,"").replace(/\)/g,""):""}}Yt.time=hu;function Er(t){t=t||"",t=t.toLowerCase();let r=Ae;return Ee?r="windows":t.indexOf("mac os")!==-1?r="apple":t.indexOf("arch")!==-1?r="arch":t.indexOf("centos")!==-1?r="centos":t.indexOf("coreos")!==-1?r="coreos":t.indexOf("debian")!==-1?r="debian":t.indexOf("deepin")!==-1?r="deepin":t.indexOf("elementary")!==-1?r="elementary":t.indexOf("fedora")!==-1?r="fedora":t.indexOf("gentoo")!==-1?r="gentoo":t.indexOf("mageia")!==-1?r="mageia":t.indexOf("mandriva")!==-1?r="mandriva":t.indexOf("manjaro")!==-1?r="manjaro":t.indexOf("mint")!==-1?r="mint":t.indexOf("mx")!==-1?r="mx":t.indexOf("openbsd")!==-1?r="openbsd":t.indexOf("freebsd")!==-1?r="freebsd":t.indexOf("opensuse")!==-1?r="opensuse":t.indexOf("pclinuxos")!==-1?r="pclinuxos":t.indexOf("puppy")!==-1?r="puppy":t.indexOf("raspbian")!==-1?r="raspbian":t.indexOf("reactos")!==-1?r="reactos":t.indexOf("redhat")!==-1?r="redhat":t.indexOf("slackware")!==-1?r="slackware":t.indexOf("sugar")!==-1?r="sugar":t.indexOf("steam")!==-1?r="steam":t.indexOf("suse")!==-1?r="suse":t.indexOf("mate")!==-1?r="ubuntu-mate":t.indexOf("lubuntu")!==-1?r="lubuntu":t.indexOf("xubuntu")!==-1?r="xubuntu":t.indexOf("ubuntu")!==-1?r="ubuntu":t.indexOf("solaris")!==-1?r="solaris":t.indexOf("tails")!==-1?r="tails":t.indexOf("feren")!==-1?r="ferenos":t.indexOf("robolinux")!==-1?r="robolinux":_r&&t&&(r=t.toLowerCase().trim().replace(/\s+/g,"-")),r}function gu(){let t=We.hostname;if(_r||be)try{const r=Ir("hostnamectl --json short 2>/dev/null");t=JSON.parse(r.toString()).StaticHostname}catch{try{t=Ir("hostname -f 2>/dev/null").toString().split(We.EOL)[0]}catch{k.noop()}}if(ls||us||cs)try{t=Ir("hostname 2>/dev/null").toString().split(We.EOL)[0]}catch{k.noop()}if(Ee)try{t=Ir("echo %COMPUTERNAME%.%USERDNSDOMAIN%",k.execOptsWin).toString().replace(".%USERDNSDOMAIN%","").split(We.EOL)[0]}catch{k.noop()}return t}function yu(t){return new Promise(r=>{process.nextTick(()=>{let e={platform:Ae==="win32"?"Windows":Ae,distro:"unknown",release:"unknown",codename:"",kernel:We.release(),arch:We.arch(),hostname:We.hostname(),fqdn:gu(),codepage:"",logofile:"",serial:"",build:"",servicepack:"",uefi:!1};if(_r&&K("cat /etc/*-release; cat /usr/lib/os-release; cat /etc/openwrt_release",function(n,i){let s={};i.toString().split(`
47
+ `).forEach(function(l){l.indexOf("=")!==-1&&(s[l.split("=")[0].trim().toUpperCase()]=l.split("=")[1].trim())});let a=(s.VERSION||"").replace(/"/g,""),u=(s.DISTRIB_CODENAME||s.VERSION_CODENAME||"").replace(/"/g,"");a.indexOf("(")>=0&&(u=a.split("(")[1].replace(/[()]/g,"").trim(),a=a.split("(")[0].trim()),e.distro=(s.DISTRIB_ID||s.NAME||"unknown").replace(/"/g,""),e.logofile=Er(e.distro),e.release=(a||s.DISTRIB_RELEASE||s.VERSION_ID||"unknown").replace(/"/g,""),e.codename=u,e.codepage=k.getCodepage(),e.build=(s.BUILD_ID||"").replace(/"/g,"").trim(),Su().then(l=>{e.uefi=l,Mi().then(c=>{e.serial=c.os,t&&t(e),r(e)})})}),(ls||us||cs)&&K("sysctl kern.ostype kern.osrelease kern.osrevision kern.hostuuid machdep.bootmethod kern.geom.confxml",function(n,i){let s=i.toString().split(`
48
+ `);const o=k.getValue(s,"kern.ostype"),a=Er(o),u=k.getValue(s,"kern.osrelease").split("-")[0],l=k.getValue(s,"kern.uuid"),c=k.getValue(s,"machdep.bootmethod"),f=i.toString().indexOf("<type>efi</type>")>=0,p=c?c.toLowerCase().indexOf("uefi")>=0:f||null;e.distro=o||e.distro,e.logofile=a||e.logofile,e.release=u||e.release,e.serial=l||e.serial,e.codename="",e.codepage=k.getCodepage(),e.uefi=p||null,t&&t(e),r(e)}),be&&K("sw_vers; sysctl kern.ostype kern.osrelease kern.osrevision kern.uuid",function(n,i){let s=i.toString().split(`
49
+ `);e.serial=k.getValue(s,"kern.uuid"),e.distro=k.getValue(s,"ProductName"),e.release=(k.getValue(s,"ProductVersion",":",!0,!0)+" "+k.getValue(s,"ProductVersionExtra",":",!0,!0)).trim(),e.build=k.getValue(s,"BuildVersion"),e.logofile=Er(e.distro),e.codename="macOS",e.codename=e.release.indexOf("10.4")>-1?"Mac OS X Tiger":e.codename,e.codename=e.release.indexOf("10.5")>-1?"Mac OS X Leopard":e.codename,e.codename=e.release.indexOf("10.6")>-1?"Mac OS X Snow Leopard":e.codename,e.codename=e.release.indexOf("10.7")>-1?"Mac OS X Lion":e.codename,e.codename=e.release.indexOf("10.8")>-1?"OS X Mountain Lion":e.codename,e.codename=e.release.indexOf("10.9")>-1?"OS X Mavericks":e.codename,e.codename=e.release.indexOf("10.10")>-1?"OS X Yosemite":e.codename,e.codename=e.release.indexOf("10.11")>-1?"OS X El Capitan":e.codename,e.codename=e.release.indexOf("10.12")>-1?"macOS Sierra":e.codename,e.codename=e.release.indexOf("10.13")>-1?"macOS High Sierra":e.codename,e.codename=e.release.indexOf("10.14")>-1?"macOS Mojave":e.codename,e.codename=e.release.indexOf("10.15")>-1?"macOS Catalina":e.codename,e.codename=e.release.startsWith("11.")?"macOS Big Sur":e.codename,e.codename=e.release.startsWith("12.")?"macOS Monterey":e.codename,e.codename=e.release.startsWith("13.")?"macOS Ventura":e.codename,e.codename=e.release.startsWith("14.")?"macOS Sonoma":e.codename,e.uefi=!0,e.codepage=k.getCodepage(),t&&t(e),r(e)}),mu&&(e.release=e.kernel,K("uname -o",function(n,i){let s=i.toString().split(`
50
+ `);e.distro=s[0],e.logofile=Er(e.distro),t&&t(e),r(e)})),Ee){e.logofile=Er(),e.release=e.kernel;try{const n=[];n.push(k.powerShell("Get-CimInstance Win32_OperatingSystem | select Caption,SerialNumber,BuildNumber,ServicePackMajorVersion,ServicePackMinorVersion | fl")),n.push(k.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),n.push(k.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.SystemInformation]::TerminalServerSession")),k.promiseAll(n).then(i=>{let s=i.results[0]?i.results[0].toString().split(`\r
51
+ `):[""];e.distro=k.getValue(s,"Caption",":").trim(),e.serial=k.getValue(s,"SerialNumber",":").trim(),e.build=k.getValue(s,"BuildNumber",":").trim(),e.servicepack=k.getValue(s,"ServicePackMajorVersion",":").trim()+"."+k.getValue(s,"ServicePackMinorVersion",":").trim(),e.codepage=k.getCodepage();const o=i.results[1]?i.results[1].toString().toLowerCase():"";e.hypervisor=o.indexOf("true")!==-1;const a=i.results[2]?i.results[2].toString():"";e.remoteSession=a.toString().toLowerCase().indexOf("true")>=0,wu().then(u=>{e.uefi=u,t&&t(e),r(e)})})}catch{t&&t(e),r(e)}}})})}Yt.osInfo=yu;function Su(){return new Promise(t=>{process.nextTick(()=>{_e.stat("/sys/firmware/efi",function(r){if(r)K('dmesg | grep -E "EFI v"',function(e,n){if(!e){const i=n.toString().split(`
52
+ `);return t(i.length>0)}return t(!1)});else return t(!0)})})})}function wu(){return new Promise(t=>{process.nextTick(()=>{try{K('findstr /C:"Detected boot environment" "%windir%\\Panther\\setupact.log"',k.execOptsWin,function(r,e){if(r)K("echo %firmware_type%",k.execOptsWin,function(n,i){if(n)return t(!1);{const s=i.toString()||"";return t(s.toLowerCase().indexOf("efi")>=0)}});else{const n=e.toString().split(`
53
+ \r`)[0];return t(n.toLowerCase().indexOf("efi")>=0)}})}catch{return t(!1)}})})}function vu(t,r){let e={kernel:We.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:""};function n(i){if(i==="*")return{versions:e,counter:30};if(!Array.isArray(i)){i=i.trim().toLowerCase().replace(/,+/g,"|").replace(/ /g,"|"),i=i.split("|");const s={versions:{},counter:0};return i.forEach(o=>{if(o)for(let a in e)({}).hasOwnProperty.call(e,a)&&a.toLowerCase()===o.toLowerCase()&&!{}.hasOwnProperty.call(s.versions,a)&&(s.versions[a]=e[a],a==="openssl"&&(s.versions.systemOpenssl="",s.versions.systemOpensslLib=""),s.versions[a]||s.counter++)}),s}}return new Promise(i=>{process.nextTick(()=>{if(k.isFunction(t)&&!r)r=t,t="*";else if(t=t||"*",typeof t!="string")return r&&r({}),i({});const s=n(t);let o=s.counter,a=function(){return function(){--o===0&&(r&&r(s.versions),i(s.versions))}}(),u="";try{if({}.hasOwnProperty.call(s.versions,"openssl")&&(s.versions.openssl=process.versions.openssl,K("openssl version",function(l,c){if(!l){let p=c.toString().split(`
54
+ `)[0].trim().split(" ");s.versions.systemOpenssl=p.length>0?p[1]:p[0],s.versions.systemOpensslLib=p.length>0?p[0]:"openssl"}a()})),{}.hasOwnProperty.call(s.versions,"npm")&&K("npm -v",function(l,c){l||(s.versions.npm=c.toString().split(`
55
+ `)[0]),a()}),{}.hasOwnProperty.call(s.versions,"pm2")&&(u="pm2",Ee&&(u+=".cmd"),K(`${u} -v`,function(l,c){if(!l){let f=c.toString().split(`
56
+ `)[0].trim();f.startsWith("[PM2]")||(s.versions.pm2=f)}a()})),{}.hasOwnProperty.call(s.versions,"yarn")&&K("yarn --version",function(l,c){l||(s.versions.yarn=c.toString().split(`
57
+ `)[0]),a()}),{}.hasOwnProperty.call(s.versions,"gulp")&&(u="gulp",Ee&&(u+=".cmd"),K(`${u} --version`,function(l,c){if(!l){const f=c.toString().split(`
58
+ `)[0]||"";s.versions.gulp=(f.toLowerCase().split("version")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"tsc")&&(u="tsc",Ee&&(u+=".cmd"),K(`${u} --version`,function(l,c){if(!l){const f=c.toString().split(`
59
+ `)[0]||"";s.versions.tsc=(f.toLowerCase().split("version")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"grunt")&&(u="grunt",Ee&&(u+=".cmd"),K(`${u} --version`,function(l,c){if(!l){const f=c.toString().split(`
60
+ `)[0]||"";s.versions.grunt=(f.toLowerCase().split("cli v")[1]||"").trim()}a()})),{}.hasOwnProperty.call(s.versions,"git"))if(be){const l=_e.existsSync("/usr/local/Cellar/git")||_e.existsSync("/opt/homebrew/bin/git");k.darwinXcodeExists()||l?K("git --version",function(c,f){if(!c){let p=f.toString().split(`
61
+ `)[0]||"";p=(p.toLowerCase().split("version")[1]||"").trim(),s.versions.git=(p.split(" ")[0]||"").trim()}a()}):a()}else K("git --version",function(l,c){if(!l){let f=c.toString().split(`
62
+ `)[0]||"";f=(f.toLowerCase().split("version")[1]||"").trim(),s.versions.git=(f.split(" ")[0]||"").trim()}a()});if({}.hasOwnProperty.call(s.versions,"apache")&&K("apachectl -v 2>&1",function(l,c){if(!l){const f=(c.toString().split(`
63
+ `)[0]||"").split(":");s.versions.apache=f.length>1?f[1].replace("Apache","").replace("/","").split("(")[0].trim():""}a()}),{}.hasOwnProperty.call(s.versions,"nginx")&&K("nginx -v 2>&1",function(l,c){if(!l){const f=c.toString().split(`
64
+ `)[0]||"";s.versions.nginx=(f.toLowerCase().split("/")[1]||"").trim()}a()}),{}.hasOwnProperty.call(s.versions,"mysql")&&K("mysql -V",function(l,c){if(!l){let f=c.toString().split(`
65
+ `)[0]||"";if(f=f.toLowerCase(),f.indexOf(",")>-1){f=(f.split(",")[0]||"").trim();const p=f.split(" ");s.versions.mysql=(p[p.length-1]||"").trim()}else f.indexOf(" ver ")>-1&&(f=f.split(" ver ")[1],s.versions.mysql=f.split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"php")&&K("php -v",function(l,c){if(!l){let p=(c.toString().split(`
66
+ `)[0]||"").split("(");p[0].indexOf("-")&&(p=p[0].split("-")),s.versions.php=p[0].replace(/[^0-9.]/g,"")}a()}),{}.hasOwnProperty.call(s.versions,"redis")&&K("redis-server --version",function(l,c){if(!l){const p=(c.toString().split(`
67
+ `)[0]||"").split(" ");s.versions.redis=k.getValue(p,"v","=",!0)}a()}),{}.hasOwnProperty.call(s.versions,"docker")&&K("docker --version",function(l,c){if(!l){const p=(c.toString().split(`
68
+ `)[0]||"").split(" ");s.versions.docker=p.length>2&&p[2].endsWith(",")?p[2].slice(0,-1):""}a()}),{}.hasOwnProperty.call(s.versions,"postfix")&&K("postconf -d | grep mail_version",function(l,c){if(!l){const f=c.toString().split(`
69
+ `)||[];s.versions.postfix=k.getValue(f,"mail_version","=",!0)}a()}),{}.hasOwnProperty.call(s.versions,"mongodb")&&K("mongod --version",function(l,c){if(!l){const f=c.toString().split(`
70
+ `)[0]||"";s.versions.mongodb=(f.toLowerCase().split(",")[0]||"").replace(/[^0-9.]/g,"")}a()}),{}.hasOwnProperty.call(s.versions,"postgresql")&&(_r?K("locate bin/postgres",function(l,c){if(l)K("psql -V",function(f,p){if(!f){const d=p.toString().split(`
71
+ `)[0].split(" ")||[];s.versions.postgresql=d.length?d[d.length-1]:"",s.versions.postgresql=s.versions.postgresql.split("-")[0]}a()});else{const f=c.toString().split(`
72
+ `).sort();f.length?K(f[f.length-1]+" -V",function(p,d){if(!p){const m=d.toString().split(`
73
+ `)[0].split(" ")||[];s.versions.postgresql=m.length?m[m.length-1]:""}a()}):a()}}):Ee?k.powerShell("Get-CimInstance Win32_Service | select caption | fl").then(l=>{l.split(/\n\s*\n/).forEach(f=>{if(f.trim()!==""){let p=f.trim().split(`\r
74
+ `),d=k.getValue(p,"caption",":",!0).toLowerCase();if(d.indexOf("postgresql")>-1){const m=d.split(" server ");m.length>1&&(s.versions.postgresql=m[1])}}}),a()}):K("postgres -V",function(l,c){if(!l){const f=c.toString().split(`
75
+ `)[0].split(" ")||[];s.versions.postgresql=f.length?f[f.length-1]:""}a()})),{}.hasOwnProperty.call(s.versions,"perl")&&K("perl -v",function(l,c){if(!l){const f=c.toString().split(`
76
+ `)||"";for(;f.length>0&&f[0].trim()==="";)f.shift();f.length>0&&(s.versions.perl=f[0].split("(").pop().split(")")[0].replace("v",""))}a()}),{}.hasOwnProperty.call(s.versions,"python"))if(be)try{const c=Ir("sw_vers").toString().split(`
77
+ `),f=k.getValue(c,"ProductVersion",":"),p=_e.existsSync("/usr/local/Cellar/python"),d=_e.existsSync("/opt/homebrew/bin/python");k.darwinXcodeExists()&&k.semverCompare("12.0.1",f)<0||p||d?K(p?"/usr/local/Cellar/python -V 2>&1":d?"/opt/homebrew/bin/python -V 2>&1":"python -V 2>&1",function(g,S){if(!g){const h=S.toString().split(`
78
+ `)[0]||"";s.versions.python=h.toLowerCase().replace("python","").trim()}a()}):a()}catch{a()}else K("python -V 2>&1",function(l,c){if(!l){const f=c.toString().split(`
79
+ `)[0]||"";s.versions.python=f.toLowerCase().replace("python","").trim()}a()});if({}.hasOwnProperty.call(s.versions,"python3"))if(be){const l=_e.existsSync("/usr/local/Cellar/python3")||_e.existsSync("/opt/homebrew/bin/python3");k.darwinXcodeExists()||l?K("python3 -V 2>&1",function(c,f){if(!c){const p=f.toString().split(`
80
+ `)[0]||"";s.versions.python3=p.toLowerCase().replace("python","").trim()}a()}):a()}else K("python3 -V 2>&1",function(l,c){if(!l){const f=c.toString().split(`
81
+ `)[0]||"";s.versions.python3=f.toLowerCase().replace("python","").trim()}a()});if({}.hasOwnProperty.call(s.versions,"pip"))if(be){const l=_e.existsSync("/usr/local/Cellar/pip")||_e.existsSync("/opt/homebrew/bin/pip");k.darwinXcodeExists()||l?K("pip -V 2>&1",function(c,f){if(!c){const d=(f.toString().split(`
82
+ `)[0]||"").split(" ");s.versions.pip=d.length>=2?d[1]:""}a()}):a()}else K("pip -V 2>&1",function(l,c){if(!l){const p=(c.toString().split(`
83
+ `)[0]||"").split(" ");s.versions.pip=p.length>=2?p[1]:""}a()});if({}.hasOwnProperty.call(s.versions,"pip3"))if(be){const l=_e.existsSync("/usr/local/Cellar/pip3")||_e.existsSync("/opt/homebrew/bin/pip3");k.darwinXcodeExists()||l?K("pip3 -V 2>&1",function(c,f){if(!c){const d=(f.toString().split(`
84
+ `)[0]||"").split(" ");s.versions.pip3=d.length>=2?d[1]:""}a()}):a()}else K("pip3 -V 2>&1",function(l,c){if(!l){const p=(c.toString().split(`
85
+ `)[0]||"").split(" ");s.versions.pip3=p.length>=2?p[1]:""}a()});({}).hasOwnProperty.call(s.versions,"java")&&(be?K("/usr/libexec/java_home -V 2>&1",function(l,c){!l&&c.toString().toLowerCase().indexOf("no java runtime")===-1?K("java -version 2>&1",function(f,p){if(!f){const m=(p.toString().split(`
86
+ `)[0]||"").split('"');s.versions.java=m.length===3?m[1].trim():""}a()}):a()}):K("java -version 2>&1",function(l,c){if(!l){const p=(c.toString().split(`
87
+ `)[0]||"").split('"');s.versions.java=p.length===3?p[1].trim():""}a()})),{}.hasOwnProperty.call(s.versions,"gcc")&&(be&&k.darwinXcodeExists()||!be?K("gcc -dumpversion",function(l,c){l||(s.versions.gcc=c.toString().split(`
88
+ `)[0].trim()||""),s.versions.gcc.indexOf(".")>-1?a():K("gcc --version",function(f,p){if(!f){const d=p.toString().split(`
89
+ `)[0].trim();if(d.indexOf("gcc")>-1&&d.indexOf(")")>-1){const m=d.split(")");s.versions.gcc=m[1].trim()||s.versions.gcc}}a()})}):a()),{}.hasOwnProperty.call(s.versions,"virtualbox")&&K(k.getVboxmanage()+" -v 2>&1",function(l,c){if(!l){const p=(c.toString().split(`
90
+ `)[0]||"").split("r");s.versions.virtualbox=p[0]}a()}),{}.hasOwnProperty.call(s.versions,"bash")&&K("bash --version",function(l,c){if(!l){const p=c.toString().split(`
91
+ `)[0].split(" version ");p.length>1&&(s.versions.bash=p[1].split(" ")[0].split("(")[0])}a()}),{}.hasOwnProperty.call(s.versions,"zsh")&&K("zsh --version",function(l,c){if(!l){const p=c.toString().split(`
92
+ `)[0].split("zsh ");p.length>1&&(s.versions.zsh=p[1].split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"fish")&&K("fish --version",function(l,c){if(!l){const p=c.toString().split(`
93
+ `)[0].split(" version ");p.length>1&&(s.versions.fish=p[1].split(" ")[0])}a()}),{}.hasOwnProperty.call(s.versions,"powershell")&&(Ee?k.powerShell("$PSVersionTable").then(l=>{const c=l.toString().split(`
94
+ `).map(f=>f.replace(/ +/g," ").replace(/ +/g,":"));s.versions.powershell=k.getValue(c,"psversion"),a()}):a()),{}.hasOwnProperty.call(s.versions,"dotnet")&&(Ee?k.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(l=>{const c=l.toString().split(`\r
95
+ `);let f="";c.forEach(p=>{p=p.replace(/ +/g," ");const d=p.split(" ");f=f||(d[0].toLowerCase().startsWith("client")&&d.length>2||d[0].toLowerCase().startsWith("full")&&d.length>2?d[1].trim():"")}),s.versions.dotnet=f.trim(),a()}):a())}catch{r&&r(s.versions),i(s.versions)}})})}Yt.versions=vu;function xu(t){return new Promise(r=>{process.nextTick(()=>{if(Ee)r("cmd");else{let e="";K("echo $SHELL",function(n,i){n||(e=i.toString().split(`
96
+ `)[0]),t&&t(e),r(e)})}})})}Yt.shell=xu;function Cu(){let t=[];try{const r=We.networkInterfaces();for(let e in r)({}).hasOwnProperty.call(r,e)&&r[e].forEach(function(n){if(n&&n.mac&&n.mac!=="00:00:00:00:00:00"){const i=n.mac.toLowerCase();t.indexOf(i)===-1&&t.push(i)}});t=t.sort(function(e,n){return e<n?-1:e>n?1:0})}catch{t.push("00:00:00:00:00:00")}return t}function Mi(t){return new Promise(r=>{process.nextTick(()=>{let e={os:"",hardware:"",macs:Cu()},n;if(be&&K("system_profiler SPHardwareDataType -json",function(i,s){if(!i)try{const o=JSON.parse(s.toString());if(o.SPHardwareDataType&&o.SPHardwareDataType.length>0){const a=o.SPHardwareDataType[0];e.os=a.platform_UUID.toLowerCase(),e.hardware=a.serial_number}}catch{k.noop()}t&&t(e),r(e)}),_r&&K(`echo -n "os: "; cat /var/lib/dbus/machine-id 2> /dev/null; echo;
97
+ echo -n "os: "; cat /etc/machine-id 2> /dev/null; echo;
98
+ echo -n "hardware: "; cat /sys/class/dmi/id/product_uuid 2> /dev/null; echo;`,function(s,o){const a=o.toString().split(`
99
+ `);if(e.os=k.getValue(a,"os").toLowerCase(),e.hardware=k.getValue(a,"hardware").toLowerCase(),!e.hardware){const u=_e.readFileSync("/proc/cpuinfo",{encoding:"utf8"}).toString().split(`
100
+ `),l=k.getValue(u,"serial");e.hardware=l||""}t&&t(e),r(e)}),(ls||us||cs)&&K("sysctl -i kern.hostid kern.hostuuid",function(i,s){const o=s.toString().split(`
101
+ `);e.os=k.getValue(o,"kern.hostid",":").toLowerCase(),e.hardware=k.getValue(o,"kern.hostuuid",":").toLowerCase(),e.os.indexOf("unknown")>=0&&(e.os=""),e.hardware.indexOf("unknown")>=0&&(e.hardware=""),t&&t(e),r(e)}),Ee){let i="%windir%\\System32";process.arch==="ia32"&&Object.prototype.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")&&(i="%windir%\\sysnative\\cmd.exe /c %windir%\\System32"),k.powerShell("Get-CimInstance Win32_ComputerSystemProduct | select UUID | fl").then(s=>{let o=s.split(`\r
102
+ `);e.hardware=k.getValue(o,"uuid",":").toLowerCase(),K(`${i}\\reg query "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography" /v MachineGuid`,k.execOptsWin,function(a,u){n=u.toString().split(`
103
+ \r`)[0].split("REG_SZ"),e.os=n.length>1?n[1].replace(/\r+|\n+|\s+/ig,"").toLowerCase():"",t&&t(e),r(e)})})}})})}Yt.uuid=Mi;var et={};const Ne=M,we=M.exec,fs=M.execSync,nn=M,$=W;let tt=process.platform;const Or=tt==="linux"||tt==="android",sn=tt==="darwin",on=tt==="win32",an=tt==="freebsd",ln=tt==="openbsd",un=tt==="netbsd",cn=tt==="sunos";let Jt=0,ee={user:0,nice:0,system:0,idle:0,irq:0,steal:0,guest:0,load:0,tick:0,ms:0,currentLoad:0,currentLoadUser:0,currentLoadSystem:0,currentLoadNice:0,currentLoadIdle:0,currentLoadIrq:0,currentLoadSteal:0,currentLoadGuest:0,rawCurrentLoad:0,rawCurrentLoadUser:0,rawCurrentLoadSystem:0,rawCurrentLoadNice:0,rawCurrentLoadIdle:0,rawCurrentLoadIrq:0,rawCurrentLoadSteal:0,rawCurrentLoadGuest:0},I=[],ps=0;const ds={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","4450U":"2.5","Pro 4450U":"2.5","4500U":"2.3","4600U":"2.1","PRO 4650U":"2.1","4680U":"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","5300U":"2.6","5500U":"2.1","5700U":"1.8","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","7773X":"2.2",7763:"2.45",7713:"2.0","7713P":"2.0",7663:"2.0",7643:"2.3","7573X":"2.8","75F3":"2.95",7543:"2.8","7543P":"2.8",7513:"2.6","7473X":"2.8",7453:"2.75","74F3":"3.2",7443:"2.85","7443P":"2.85",7413:"2.65","7373X":"3.05","73F3":"3.5",7343:"3.2",7313:"3.0","7313P":"3.0","72F3":"3.7","5600X":"3.7","5800X":"3.8","5900X":"3.7","5950X":"3.4","5945WX":"4.1","5955WX":"4.0","5965WX":"3.8","5975WX":"3.6","5995WX":"2.7","7960X":"4.2","7970X":"4.0","7980X":"3.2","7965WX":"4.2","7975WX":"4.0","7985WX":"3.2","7995WX":"2.5",9754:"2.25","9754S":"2.25",9734:"2.2","9684X":"2.55","9384X":"3.1","9184X":"3.55","9654P":"2.4",9654:"2.4",9634:"2.25","9554P":"3.1",9554:"3.1",9534:"2.45","9474F":"3.6","9454P":"2.75",9454:"2.75","9374F":"3.85","9354P":"3.25",9354:"3.25",9334:"2.7","9274F":"4.05",9254:"2.9",9224:"2.5","9174F":"4.1",9124:"3.0"},Bi={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",63:"LGA4677",64:"LGA1700",65:"BGA1744",66:"BGA1781",67:"BGA1211",68:"BGA2422",69:"LGA1211",70:"LGA2422",71:"LGA5773",72:"BGA5773"},Fi={LGA1150:"i7-5775C i3-4340 i3-4170 G3250 i3-4160T i3-4160 E3-1231 G3258 G3240 i7-4790S i7-4790K i7-4790 i5-4690K i5-4690 i5-4590T i5-4590S i5-4590 i5-4460 i3-4360 i3-4150 G1820 G3420 G3220 i7-4771 i5-4440 i3-4330 i3-4130T i3-4130 E3-1230 i7-4770S i7-4770K i7-4770 i5-4670K i5-4670 i5-4570T i5-4570S i5-4570 i5-4430",LGA1151:"i9-9900KS E-2288G E-2224 G5420 i9-9900T i9-9900 i7-9700T i7-9700F i7-9700E i7-9700 i5-9600 i5-9500T i5-9500F i5-9500 i5-9400T i3-9350K i3-9300 i3-9100T i3-9100F i3-9100 G4930 i9-9900KF i7-9700KF i5-9600KF i5-9400F i5-9400 i3-9350KF i9-9900K i7-9700K i5-9600K G5500 G5400 i7-8700T i7-8086K i5-8600 i5-8500T i5-8500 i5-8400T i3-8300 i3-8100T G4900 i7-8700K i7-8700 i5-8600K i5-8400 i3-8350K i3-8100 E3-1270 G4600 G4560 i7-7700T i7-7700K i7-7700 i5-7600K i5-7600 i5-7500T i5-7500 i5-7400 i3-7350K i3-7300 i3-7100T i3-7100 G3930 G3900 G4400 i7-6700T i7-6700K i7-6700 i5-6600K i5-6600 i5-6500T i5-6500 i5-6400T i5-6400 i3-6300 i3-6100T i3-6100 E3-1270 E3-1270 T4500 T4400",1155:"G440 G460 G465 G470 G530T G540T G550T G1610T G1620T G530 G540 G1610 G550 G1620 G555 G1630 i3-2100T i3-2120T i3-3220T i3-3240T i3-3250T i3-2100 i3-2105 i3-2102 i3-3210 i3-3220 i3-2125 i3-2120 i3-3225 i3-2130 i3-3245 i3-3240 i3-3250 i5-3570T i5-2500T i5-2400S i5-2405S i5-2390T i5-3330S i5-2500S i5-3335S i5-2300 i5-3450S i5-3340S i5-3470S i5-3475S i5-3470T i5-2310 i5-3550S i5-2320 i5-3330 i5-3350P i5-3450 i5-2400 i5-3340 i5-3570S i5-2380P i5-2450P i5-3470 i5-2500K i5-3550 i5-2500 i5-3570 i5-3570K i5-2550K i7-3770T i7-2600S i7-3770S i7-2600K i7-2600 i7-3770 i7-3770K i7-2700K G620T G630T G640T G2020T G645T G2100T G2030T G622 G860T G620 G632 G2120T G630 G640 G2010 G840 G2020 G850 G645 G2030 G860 G2120 G870 G2130 G2140 E3-1220L E3-1220L E3-1260L E3-1265L E3-1220 E3-1225 E3-1220 E3-1235 E3-1225 E3-1230 E3-1230 E3-1240 E3-1245 E3-1270 E3-1275 E3-1240 E3-1245 E3-1270 E3-1280 E3-1275 E3-1290 E3-1280 E3-1290"};function Iu(t){let r="";for(const e in Fi)Fi[e].split(" ").forEach(i=>{t.indexOf(i)>=0&&(r=e)});return r}function ms(t){let r=t;return t=t.toLowerCase(),t.indexOf("intel")>=0&&(r="Intel"),t.indexOf("amd")>=0&&(r="AMD"),t.indexOf("qemu")>=0&&(r="QEMU"),t.indexOf("hygon")>=0&&(r="Hygon"),t.indexOf("centaur")>=0&&(r="WinChip/Via"),t.indexOf("vmware")>=0&&(r="VMware"),t.indexOf("Xen")>=0&&(r="Xen Hypervisor"),t.indexOf("tcg")>=0&&(r="QEMU"),t.indexOf("apple")>=0&&(r="Apple"),r}function fn(t){t.brand=t.brand.replace(/\(R\)+/g,"®").replace(/\s+/g," ").trim(),t.brand=t.brand.replace(/\(TM\)+/g,"™").replace(/\s+/g," ").trim(),t.brand=t.brand.replace(/\(C\)+/g,"©").replace(/\s+/g," ").trim(),t.brand=t.brand.replace(/CPU+/g,"").replace(/\s+/g," ").trim(),t.manufacturer=ms(t.brand);let r=t.brand.split(" ");return r.shift(),t.brand=r.join(" "),t}function hs(t){let r="0";for(let e in ds)if({}.hasOwnProperty.call(ds,e)){let n=e.split("|"),i=0;n.forEach(s=>{t.indexOf(s)>-1&&i++}),i===n.length&&(r=ds[e])}return parseFloat(r)}function _u(){return new Promise(t=>{process.nextTick(()=>{const r="unknown";let e={manufacturer:r,brand:r,vendor:"",family:"",model:"",stepping:"",revision:"",voltage:"",speed:0,speedMin:0,speedMax:0,governor:"",cores:$.cores(),physicalCores:$.cores(),performanceCores:$.cores(),efficiencyCores:0,processors:1,socket:"",flags:"",virtualization:!1,cache:{}};Wi().then(n=>{if(e.flags=n,e.virtualization=n.indexOf("vmx")>-1||n.indexOf("svm")>-1,sn&&we("sysctl machdep.cpu hw.cpufrequency_max hw.cpufrequency_min hw.packages hw.physicalcpu_max hw.ncpu hw.tbfrequency hw.cpufamily hw.cpusubfamily",function(i,s){let o=s.toString().split(`
104
+ `);const u=$.getValue(o,"machdep.cpu.brand_string").split("@");e.brand=u[0].trim();const l=u[1]?u[1].trim():"0";e.speed=parseFloat(l.replace(/GHz+/g,""));let c=$.getValue(o,"hw.tbfrequency")/1e9;c=c<.1?c*100:c,e.speed=e.speed===0?c:e.speed,Jt=e.speed,e=fn(e),e.speedMin=$.getValue(o,"hw.cpufrequency_min")?$.getValue(o,"hw.cpufrequency_min")/1e9:e.speed,e.speedMax=$.getValue(o,"hw.cpufrequency_max")?$.getValue(o,"hw.cpufrequency_max")/1e9:e.speed,e.vendor=$.getValue(o,"machdep.cpu.vendor")||"Apple",e.family=$.getValue(o,"machdep.cpu.family")||$.getValue(o,"hw.cpufamily"),e.model=$.getValue(o,"machdep.cpu.model"),e.stepping=$.getValue(o,"machdep.cpu.stepping")||$.getValue(o,"hw.cpusubfamily"),e.virtualization=!0;const f=$.getValue(o,"hw.packages"),p=$.getValue(o,"hw.physicalcpu_max"),d=$.getValue(o,"hw.ncpu");if(Ne.arch()==="arm64"){e.socket="SOC";try{const m=fs("ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type").toString().split(`
105
+ `),g=m.filter(h=>h.indexOf('"E"')>=0).length,S=m.filter(h=>h.indexOf('"P"')>=0).length;e.efficiencyCores=g,e.performanceCores=S}catch{$.noop()}}f&&(e.processors=parseInt(f)||1),p&&d&&(e.cores=parseInt(d)||$.cores(),e.physicalCores=parseInt(p)||$.cores()),Gi().then(m=>{e.cache=m,t(e)})}),Or){let i="",s=[];Ne.cpus()[0]&&Ne.cpus()[0].model&&(i=Ne.cpus()[0].model),we('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(o,a){o||(s=a.toString().split(`
106
+ `)),i=$.getValue(s,"model name")||i;const u=i.split("@");if(e.brand=u[0].trim(),e.speed=u[1]?parseFloat(u[1].trim()):0,e.speed===0&&(e.brand.indexOf("AMD")>-1||e.brand.toLowerCase().indexOf("ryzen")>-1)&&(e.speed=hs(e.brand)),e.speed===0){const g=gs();g.avg!==0&&(e.speed=g.avg)}Jt=e.speed,e.speedMin=Math.round(parseFloat($.getValue(s,"cpu min mhz").replace(/,/g,"."))/10)/100,e.speedMax=Math.round(parseFloat($.getValue(s,"cpu max mhz").replace(/,/g,"."))/10)/100,e=fn(e),e.vendor=ms($.getValue(s,"vendor id")),e.family=$.getValue(s,"cpu family"),e.model=$.getValue(s,"model:"),e.stepping=$.getValue(s,"stepping"),e.revision=$.getValue(s,"cpu revision"),e.cache.l1d=$.getValue(s,"l1d cache"),e.cache.l1d&&(e.cache.l1d=parseInt(e.cache.l1d)*(e.cache.l1d.indexOf("M")!==-1?1024*1024:e.cache.l1d.indexOf("K")!==-1?1024:1)),e.cache.l1i=$.getValue(s,"l1i cache"),e.cache.l1i&&(e.cache.l1i=parseInt(e.cache.l1i)*(e.cache.l1i.indexOf("M")!==-1?1024*1024:e.cache.l1i.indexOf("K")!==-1?1024:1)),e.cache.l2=$.getValue(s,"l2 cache"),e.cache.l2&&(e.cache.l2=parseInt(e.cache.l2)*(e.cache.l2.indexOf("M")!==-1?1024*1024:e.cache.l2.indexOf("K")!==-1?1024:1)),e.cache.l3=$.getValue(s,"l3 cache"),e.cache.l3&&(e.cache.l3=parseInt(e.cache.l3)*(e.cache.l3.indexOf("M")!==-1?1024*1024:e.cache.l3.indexOf("K")!==-1?1024:1));const l=$.getValue(s,"thread(s) per core")||"1",c=$.getValue(s,"socket(s)")||"1";let f=parseInt(l,10),p=parseInt(c,10)||1;const d=parseInt($.getValue(s,"core(s) per socket"),10);if(e.physicalCores=d?d*p:e.cores/f,e.performanceCores=f>1?e.cores-e.physicalCores:e.cores,e.efficiencyCores=f>1?e.cores-f*e.performanceCores:0,e.processors=p,e.governor=$.getValue(s,"governor")||"",e.vendor==="ARM"){const g=nn.readFileSync("/proc/cpuinfo").toString().split(`
107
+ `),S=$.decodePiCpuinfo(g);S.model.toLowerCase().indexOf("raspberry")>=0&&(e.family=e.manufacturer,e.manufacturer=S.manufacturer,e.brand=S.processor,e.revision=S.revisionCode,e.socket="SOC")}let m=[];we('export LC_ALL=C; dmidecode –t 4 2>/dev/null | grep "Upgrade: Socket"; unset LC_ALL',function(g,S){m=S.toString().split(`
108
+ `),m&&m.length&&(e.socket=$.getValue(m,"Upgrade").replace("Socket","").trim()||e.socket),t(e)})})}if(an||ln||un){let i="",s=[];Ne.cpus()[0]&&Ne.cpus()[0].model&&(i=Ne.cpus()[0].model),we("export LC_ALL=C; dmidecode -t 4; dmidecode -t 7 unset LC_ALL",function(o,a){let u=[];if(!o){const d=a.toString().split("# dmidecode"),m=d.length>1?d[1]:"";u=d.length>2?d[2].split("Cache Information"):[],s=m.split(`
109
+ `)}if(e.brand=i.split("@")[0].trim(),e.speed=i.split("@")[1]?parseFloat(i.split("@")[1].trim()):0,e.speed===0&&(e.brand.indexOf("AMD")>-1||e.brand.toLowerCase().indexOf("ryzen")>-1)&&(e.speed=hs(e.brand)),e.speed===0){const d=gs();d.avg!==0&&(e.speed=d.avg)}Jt=e.speed,e.speedMin=e.speed,e.speedMax=Math.round(parseFloat($.getValue(s,"max speed").replace(/Mhz/g,""))/10)/100,e=fn(e),e.vendor=ms($.getValue(s,"manufacturer"));let l=$.getValue(s,"signature");l=l.split(",");for(let d=0;d<l.length;d++)l[d]=l[d].trim();e.family=$.getValue(l,"Family"," ",!0),e.model=$.getValue(l,"Model"," ",!0),e.stepping=$.getValue(l,"Stepping"," ",!0),e.revision="";const c=parseFloat($.getValue(s,"voltage"));e.voltage=isNaN(c)?"":c.toFixed(2);for(let d=0;d<u.length;d++){s=u[d].split(`
110
+ `);let m=$.getValue(s,"Socket Designation").toLowerCase().replace(" ","-").split("-");m=m.length?m[0]:"";const g=$.getValue(s,"Installed Size").split(" ");let S=parseInt(g[0],10);const h=g.length>1?g[1]:"kb";S=S*(h==="kb"?1024:h==="mb"?1024*1024:h==="gb"?1024*1024*1024:1),m&&(m==="l1"?(e.cache[m+"d"]=S/2,e.cache[m+"i"]=S/2):e.cache[m]=S)}e.socket=$.getValue(s,"Upgrade").replace("Socket","").trim();const f=$.getValue(s,"thread count").trim(),p=$.getValue(s,"core count").trim();p&&f&&(e.cores=parseInt(f,10),e.physicalCores=parseInt(p,10)),t(e)})}if(cn&&t(e),on)try{const i=[];i.push($.powerShell("Get-CimInstance Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl")),i.push($.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")),i.push($.powerShell("(Get-CimInstance Win32_ComputerSystem).HypervisorPresent")),Promise.all(i).then(s=>{let o=s[0].split(`\r
111
+ `),a=$.getValue(o,"name",":")||"";a.indexOf("@")>=0?(e.brand=a.split("@")[0].trim(),e.speed=a.split("@")[1]?parseFloat(a.split("@")[1].trim()):0,Jt=e.speed):(e.brand=a.trim(),e.speed=0),e=fn(e),e.revision=$.getValue(o,"revision",":"),e.vendor=$.getValue(o,"manufacturer",":"),e.speedMax=Math.round(parseFloat($.getValue(o,"maxclockspeed",":").replace(/,/g,"."))/10)/100,e.speed===0&&(e.brand.indexOf("AMD")>-1||e.brand.toLowerCase().indexOf("ryzen")>-1)&&(e.speed=hs(e.brand)),e.speed===0&&(e.speed=e.speedMax),e.speedMin=e.speed;let u=$.getValue(o,"description",":").split(" ");for(let g=0;g<u.length;g++)u[g].toLowerCase().startsWith("family")&&g+1<u.length&&u[g+1]&&(e.family=u[g+1]),u[g].toLowerCase().startsWith("model")&&g+1<u.length&&u[g+1]&&(e.model=u[g+1]),u[g].toLowerCase().startsWith("stepping")&&g+1<u.length&&u[g+1]&&(e.stepping=u[g+1]);const l=$.getValue(o,"UpgradeMethod",":");Bi[l]&&(e.socket=Bi[l]);const c=Iu(a);c&&(e.socket=c);const f=$.countLines(o,"Caption"),p=$.getValue(o,"NumberOfLogicalProcessors",":"),d=$.getValue(o,"NumberOfCores",":");f&&(e.processors=parseInt(f)||1),d&&p&&(e.cores=parseInt(p)||$.cores(),e.physicalCores=parseInt(d)||$.cores()),f>1&&(e.cores=e.cores*f,e.physicalCores=e.physicalCores*f),e.cache=Ui(s[0],s[1]);const m=s[2]?s[2].toString().toLowerCase():"";e.virtualization=m.indexOf("true")!==-1,t(e)})}catch{t(e)}})})})}function Eu(t){return new Promise(r=>{process.nextTick(()=>{_u().then(e=>{t&&t(e),r(e)})})})}et.cpu=Eu;function gs(){let t=Ne.cpus(),r=999999999,e=0,n=0,i=[];if(t&&t.length){for(let s in t)if({}.hasOwnProperty.call(t,s)){let o=t[s].speed>100?(t[s].speed+1)/1e3:t[s].speed/10;n=n+o,o>e&&(e=o),o<r&&(r=o),i.push(parseFloat(o.toFixed(2)))}return n=n/t.length,{min:parseFloat(r.toFixed(2)),max:parseFloat(e.toFixed(2)),avg:parseFloat(n.toFixed(2)),cores:i}}else return{min:0,max:0,avg:0,cores:i}}function Ou(t){return new Promise(r=>{process.nextTick(()=>{let e=gs();if(e.avg===0&&Jt!==0){const n=parseFloat(Jt);e={min:n,max:n,avg:n,cores:[]}}t&&t(e),r(e)})})}et.cpuCurrentSpeed=Ou;function Lu(t){return new Promise(r=>{process.nextTick(()=>{let e={main:null,cores:[],max:null,socket:[],chipset:null};if(Or){try{const s=fs('cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;').toString().split(`-----
112
+ `);if(s.length===2){const o=s[0].split(`
113
+ `),a=s[1].split(`
114
+ `);for(let u=0;u<o.length;u++){const l=o[u].trim();l.startsWith("acpi")&&a[u]&&e.socket.push(Math.round(parseInt(a[u],10)/100)/10),l.startsWith("pch")&&a[u]&&(e.chipset=Math.round(parseInt(a[u],10)/100)/10)}}}catch{$.noop()}const n='for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;';try{we(n,function(i,s){s=s.toString();const o=s.toLowerCase().indexOf("tdie");o!==-1&&(s=s.substring(o));let a=s.split(`
115
+ `),u=0;if(a.forEach(l=>{const c=l.split("___"),f=c[0],p=c.length>1&&c[1]?c[1]:"0";p&&f&&f.toLowerCase()==="tctl"&&(u=e.main=Math.round(parseInt(p,10)/100)/10),p&&(f===void 0||f&&f.toLowerCase().startsWith("core"))?e.cores.push(Math.round(parseInt(p,10)/100)/10):p&&f&&e.main===null&&(f.toLowerCase().indexOf("package")>=0||f.toLowerCase().indexOf("physical")>=0||f.toLowerCase()==="tccd1")&&(e.main=Math.round(parseInt(p,10)/100)/10)}),u&&e.main===null&&(e.main=u),e.cores.length>0){e.main===null&&(e.main=Math.round(e.cores.reduce((c,f)=>c+f,0)/e.cores.length));let l=Math.max.apply(Math,e.cores);e.max=l>e.main?l:e.main}if(e.main!==null){e.max===null&&(e.max=e.main),t&&t(e),r(e);return}we("sensors",function(l,c){if(!l){let f=c.toString().split(`
116
+ `),p=null,d=!0,m="";if(f.forEach(function(g){g.trim()===""?d=!0:d&&(g.trim().toLowerCase().startsWith("acpi")&&(m="acpi"),g.trim().toLowerCase().startsWith("pch")&&(m="pch"),g.trim().toLowerCase().startsWith("core")&&(m="core"),d=!1);let S=/[+-]([^°]*)/g,h=g.match(S),y=g.split(":")[0].toUpperCase();m==="acpi"?y.indexOf("TEMP")!==-1&&e.socket.push(parseFloat(h)):m==="pch"&&y.indexOf("TEMP")!==-1&&!e.chipset&&(e.chipset=parseFloat(h)),(y.indexOf("PHYSICAL")!==-1||y.indexOf("PACKAGE")!==-1)&&(e.main=parseFloat(h)),y.indexOf("CORE ")!==-1&&e.cores.push(parseFloat(h)),y.indexOf("TDIE")!==-1&&p===null&&(p=parseFloat(h))}),e.cores.length>0){e.main=Math.round(e.cores.reduce((S,h)=>S+h,0)/e.cores.length);let g=Math.max.apply(Math,e.cores);e.max=g>e.main?g:e.main}else e.main===null&&p!==null&&(e.main=p,e.max=p);if(e.main!==null||e.max!==null){t&&t(e),r(e);return}}nn.stat("/sys/class/thermal/thermal_zone0/temp",function(f){f===null?nn.readFile("/sys/class/thermal/thermal_zone0/temp",function(p,d){if(!p){let m=d.toString().split(`
117
+ `);m.length>0&&(e.main=parseFloat(m[0])/1e3,e.max=e.main)}t&&t(e),r(e)}):we("/opt/vc/bin/vcgencmd measure_temp",function(p,d){if(!p){let m=d.toString().split(`
118
+ `);m.length>0&&m[0].indexOf("=")&&(e.main=parseFloat(m[0].split("=")[1]),e.max=e.main)}t&&t(e),r(e)})})})})}catch{t&&t(e),r(e)}}if((an||ln||un)&&we("sysctl dev.cpu | grep temp",function(n,i){if(!n){let s=i.toString().split(`
119
+ `),o=0;s.forEach(function(a){const u=a.split(":");if(u.length>1){const l=parseFloat(u[1].replace(",","."));l>e.max&&(e.max=l),o=o+l,e.cores.push(l)}}),e.cores.length&&(e.main=Math.round(o/e.cores.length*100)/100)}t&&t(e),r(e)}),sn){let n=null;try{n=require("osx-temperature-sensor")}catch{n=null}if(n&&(e=n.cpuTemperature(),e.main&&(e.main=Math.round(e.main*100)/100),e.max&&(e.max=Math.round(e.max*100)/100),e.cores&&e.cores.length))for(let i=0;i<e.cores.length;i++)e.cores[i]=Math.round(e.cores[i]*100)/100;t&&t(e),r(e)}if(cn&&(t&&t(e),r(e)),on)try{$.powerShell('Get-CimInstance MSAcpi_ThermalZoneTemperature -Namespace "root/wmi" | Select CurrentTemperature').then((n,i)=>{if(!i){let s=0;n.split(`\r
120
+ `).filter(a=>a.trim()!=="").filter((a,u)=>u>0).forEach(function(a){let u=(parseInt(a,10)-2732)/10;isNaN(u)||(s=s+u,u>e.max&&(e.max=u),e.cores.push(u))}),e.cores.length&&(e.main=s/e.cores.length)}t&&t(e),r(e)})}catch{t&&t(e),r(e)}})})}et.cpuTemperature=Lu;function Wi(t){return new Promise(r=>{process.nextTick(()=>{let e="";if(on)try{we('reg query "HKEY_LOCAL_MACHINE\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v FeatureSet',$.execOptsWin,function(n,i){if(!n){let s=i.split("0x").pop().trim(),o=parseInt(s,16).toString(2),a="0".repeat(32-o.length)+o,u=["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 l=0;l<u.length;l++)a[l]==="1"&&u[l]!==""&&(e+=" "+u[l]);e=e.trim().toLowerCase()}t&&t(e),r(e)})}catch{t&&t(e),r(e)}if(Or)try{we("export LC_ALL=C; lscpu; unset LC_ALL",function(n,i){n||i.toString().split(`
121
+ `).forEach(function(o){o.split(":")[0].toUpperCase().indexOf("FLAGS")!==-1&&(e=o.split(":")[1].trim().toLowerCase())}),e?(t&&t(e),r(e)):nn.readFile("/proc/cpuinfo",function(s,o){if(!s){let a=o.toString().split(`
122
+ `);e=$.getValue(a,"features",":",!0).toLowerCase()}t&&t(e),r(e)})})}catch{t&&t(e),r(e)}(an||ln||un)&&we("export LC_ALL=C; dmidecode -t 4 2>/dev/null; unset LC_ALL",function(n,i){let s=[];if(!n){let o=i.toString().split(" Flags:");(o.length>1?o[1].split(" Version:")[0].split(`
123
+ `):[]).forEach(function(u){let l=(u.indexOf("(")?u.split("(")[0].toLowerCase():"").trim().replace(/\t/g,"");l&&s.push(l)})}e=s.join(" ").trim().toLowerCase(),t&&t(e),r(e)}),sn&&we("sysctl machdep.cpu.features",function(n,i){if(!n){let s=i.toString().split(`
124
+ `);s.length>0&&s[0].indexOf("machdep.cpu.features:")!==-1&&(e=s[0].split(":")[1].trim().toLowerCase())}t&&t(e),r(e)}),cn&&(t&&t(e),r(e))})})}et.cpuFlags=Wi;function Gi(t){return new Promise(r=>{process.nextTick(()=>{let e={l1d:null,l1i:null,l2:null,l3:null};if(Or)try{we("export LC_ALL=C; lscpu; unset LC_ALL",function(n,i){n||i.toString().split(`
125
+ `).forEach(function(o){let a=o.split(":");a[0].toUpperCase().indexOf("L1D CACHE")!==-1&&(e.l1d=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L1I CACHE")!==-1&&(e.l1i=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L2 CACHE")!==-1&&(e.l2=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1)),a[0].toUpperCase().indexOf("L3 CACHE")!==-1&&(e.l3=parseInt(a[1].trim())*(a[1].indexOf("M")!==-1?1024*1024:a[1].indexOf("K")!==-1?1024:1))}),t&&t(e),r(e)})}catch{t&&t(e),r(e)}if((an||ln||un)&&we("export LC_ALL=C; dmidecode -t 7 2>/dev/null; unset LC_ALL",function(n,i){let s=[];n||(s=i.toString().split("Cache Information"),s.shift());for(let o=0;o<s.length;o++){const a=s[o].split(`
126
+ `);let u=$.getValue(a,"Socket Designation").toLowerCase().replace(" ","-").split("-");u=u.length?u[0]:"";const l=$.getValue(a,"Installed Size").split(" ");let c=parseInt(l[0],10);const f=l.length>1?l[1]:"kb";c=c*(f==="kb"?1024:f==="mb"?1024*1024:f==="gb"?1024*1024*1024:1),u&&(u==="l1"?(e.cache[u+"d"]=c/2,e.cache[u+"i"]=c/2):e.cache[u]=c)}t&&t(e),r(e)}),sn&&we("sysctl hw.l1icachesize hw.l1dcachesize hw.l2cachesize hw.l3cachesize",function(n,i){n||i.toString().split(`
127
+ `).forEach(function(o){let a=o.split(":");a[0].toLowerCase().indexOf("hw.l1icachesize")!==-1&&(e.l1d=parseInt(a[1].trim())*(a[1].indexOf("K")!==-1?1024:1)),a[0].toLowerCase().indexOf("hw.l1dcachesize")!==-1&&(e.l1i=parseInt(a[1].trim())*(a[1].indexOf("K")!==-1?1024:1)),a[0].toLowerCase().indexOf("hw.l2cachesize")!==-1&&(e.l2=parseInt(a[1].trim())*(a[1].indexOf("K")!==-1?1024:1)),a[0].toLowerCase().indexOf("hw.l3cachesize")!==-1&&(e.l3=parseInt(a[1].trim())*(a[1].indexOf("K")!==-1?1024:1))}),t&&t(e),r(e)}),cn&&(t&&t(e),r(e)),on)try{const n=[];n.push($.powerShell("Get-CimInstance Win32_processor | select L2CacheSize, L3CacheSize | fl")),n.push($.powerShell("Get-CimInstance Win32_CacheMemory | select CacheType,InstalledSize,Level | fl")),Promise.all(n).then(i=>{e=Ui(i[0],i[1]),t&&t(e),r(e)})}catch{t&&t(e),r(e)}})})}function Ui(t,r){let e={l1d:null,l1i:null,l2:null,l3:null},n=t.split(`\r
128
+ `);e.l1d=0,e.l1i=0,e.l2=$.getValue(n,"l2cachesize",":"),e.l3=$.getValue(n,"l3cachesize",":"),e.l2?e.l2=parseInt(e.l2,10)*1024:e.l2=0,e.l3?e.l3=parseInt(e.l3,10)*1024:e.l3=0;const i=r.split(/\n\s*\n/);let s=0,o=0,a=0;return i.forEach(function(u){const l=u.split(`\r
129
+ `),c=$.getValue(l,"CacheType"),f=$.getValue(l,"Level"),p=$.getValue(l,"InstalledSize");f==="3"&&c==="3"&&(e.l1i=e.l1i+parseInt(p,10)*1024),f==="3"&&c==="4"&&(e.l1d=e.l1d+parseInt(p,10)*1024),f==="3"&&c==="5"&&(s=parseInt(p,10)/2,o=parseInt(p,10)/2),f==="4"&&c==="5"&&(a=a+parseInt(p,10)*1024)}),!e.l1i&&!e.l1d&&(e.l1i=s,e.l1d=o),a&&(e.l2=a),e}et.cpuCache=Gi;function Pu(){return new Promise(t=>{process.nextTick(()=>{let r=Ne.loadavg().map(function(s){return s/$.cores()}),e=parseFloat(Math.max.apply(Math,r).toFixed(2)),n={};if(Date.now()-ee.ms>=200){ee.ms=Date.now();const s=Ne.cpus().map(function(h){return h.times.steal=0,h.times.guest=0,h});let o=0,a=0,u=0,l=0,c=0,f=0,p=0,d=[];if(ps=s&&s.length?s.length:0,Or)try{const h=fs("cat /proc/stat 2>/dev/null | grep cpu",{encoding:"utf8"}).toString().split(`
130
+ `);if(h.length>1&&(h.shift(),h.length===s.length))for(let y=0;y<h.length;y++){let w=h[y].split(" ");if(w.length>=10){const v=parseFloat(w[8])||0,x=parseFloat(w[9])||0;s[y].times.steal=v,s[y].times.guest=x}}}catch{$.noop()}for(let h=0;h<ps;h++){const y=s[h].times;o+=y.user,a+=y.sys,u+=y.nice,c+=y.idle,l+=y.irq,f+=y.steal||0,p+=y.guest||0;let w=I&&I[h]&&I[h].totalTick?I[h].totalTick:0,v=I&&I[h]&&I[h].totalLoad?I[h].totalLoad:0,x=I&&I[h]&&I[h].user?I[h].user:0,z=I&&I[h]&&I[h].sys?I[h].sys:0,R=I&&I[h]&&I[h].nice?I[h].nice:0,Z=I&&I[h]&&I[h].idle?I[h].idle:0,L=I&&I[h]&&I[h].irq?I[h].irq:0,Y=I&&I[h]&&I[h].steal?I[h].steal:0,X=I&&I[h]&&I[h].guest?I[h].guest:0;I[h]=y,I[h].totalTick=I[h].user+I[h].sys+I[h].nice+I[h].irq+I[h].steal+I[h].guest+I[h].idle,I[h].totalLoad=I[h].user+I[h].sys+I[h].nice+I[h].irq+I[h].steal+I[h].guest,I[h].currentTick=I[h].totalTick-w,I[h].load=I[h].totalLoad-v,I[h].loadUser=I[h].user-x,I[h].loadSystem=I[h].sys-z,I[h].loadNice=I[h].nice-R,I[h].loadIdle=I[h].idle-Z,I[h].loadIrq=I[h].irq-L,I[h].loadSteal=I[h].steal-Y,I[h].loadGuest=I[h].guest-X,d[h]={},d[h].load=I[h].load/I[h].currentTick*100,d[h].loadUser=I[h].loadUser/I[h].currentTick*100,d[h].loadSystem=I[h].loadSystem/I[h].currentTick*100,d[h].loadNice=I[h].loadNice/I[h].currentTick*100,d[h].loadIdle=I[h].loadIdle/I[h].currentTick*100,d[h].loadIrq=I[h].loadIrq/I[h].currentTick*100,d[h].loadSteal=I[h].loadSteal/I[h].currentTick*100,d[h].loadGuest=I[h].loadGuest/I[h].currentTick*100,d[h].rawLoad=I[h].load,d[h].rawLoadUser=I[h].loadUser,d[h].rawLoadSystem=I[h].loadSystem,d[h].rawLoadNice=I[h].loadNice,d[h].rawLoadIdle=I[h].loadIdle,d[h].rawLoadIrq=I[h].loadIrq,d[h].rawLoadSteal=I[h].loadSteal,d[h].rawLoadGuest=I[h].loadGuest}let m=o+a+u+l+f+p+c,g=o+a+u+l+f+p,S=m-ee.tick;n={avgLoad:e,currentLoad:(g-ee.load)/S*100,currentLoadUser:(o-ee.user)/S*100,currentLoadSystem:(a-ee.system)/S*100,currentLoadNice:(u-ee.nice)/S*100,currentLoadIdle:(c-ee.idle)/S*100,currentLoadIrq:(l-ee.irq)/S*100,currentLoadSteal:(f-ee.steal)/S*100,currentLoadGuest:(p-ee.guest)/S*100,rawCurrentLoad:g-ee.load,rawCurrentLoadUser:o-ee.user,rawCurrentLoadSystem:a-ee.system,rawCurrentLoadNice:u-ee.nice,rawCurrentLoadIdle:c-ee.idle,rawCurrentLoadIrq:l-ee.irq,rawCurrentLoadSteal:f-ee.steal,rawCurrentLoadGuest:p-ee.guest,cpus:d},ee={user:o,nice:u,system:a,idle:c,irq:l,steal:f,guest:p,tick:m,load:g,ms:ee.ms,currentLoad:n.currentLoad,currentLoadUser:n.currentLoadUser,currentLoadSystem:n.currentLoadSystem,currentLoadNice:n.currentLoadNice,currentLoadIdle:n.currentLoadIdle,currentLoadIrq:n.currentLoadIrq,currentLoadSteal:n.currentLoadSteal,currentLoadGuest:n.currentLoadGuest,rawCurrentLoad:n.rawCurrentLoad,rawCurrentLoadUser:n.rawCurrentLoadUser,rawCurrentLoadSystem:n.rawCurrentLoadSystem,rawCurrentLoadNice:n.rawCurrentLoadNice,rawCurrentLoadIdle:n.rawCurrentLoadIdle,rawCurrentLoadIrq:n.rawCurrentLoadIrq,rawCurrentLoadSteal:n.rawCurrentLoadSteal,rawCurrentLoadGuest:n.rawCurrentLoadGuest}}else{let s=[];for(let o=0;o<ps;o++)s[o]={},s[o].load=I[o].load/I[o].currentTick*100,s[o].loadUser=I[o].loadUser/I[o].currentTick*100,s[o].loadSystem=I[o].loadSystem/I[o].currentTick*100,s[o].loadNice=I[o].loadNice/I[o].currentTick*100,s[o].loadIdle=I[o].loadIdle/I[o].currentTick*100,s[o].loadIrq=I[o].loadIrq/I[o].currentTick*100,s[o].rawLoad=I[o].load,s[o].rawLoadUser=I[o].loadUser,s[o].rawLoadSystem=I[o].loadSystem,s[o].rawLoadNice=I[o].loadNice,s[o].rawLoadIdle=I[o].loadIdle,s[o].rawLoadIrq=I[o].loadIrq,s[o].rawLoadSteal=I[o].loadSteal,s[o].rawLoadGuest=I[o].loadGuest;n={avgLoad:e,currentLoad:ee.currentLoad,currentLoadUser:ee.currentLoadUser,currentLoadSystem:ee.currentLoadSystem,currentLoadNice:ee.currentLoadNice,currentLoadIdle:ee.currentLoadIdle,currentLoadIrq:ee.currentLoadIrq,currentLoadSteal:ee.currentLoadSteal,currentLoadGuest:ee.currentLoadGuest,rawCurrentLoad:ee.rawCurrentLoad,rawCurrentLoadUser:ee.rawCurrentLoadUser,rawCurrentLoadSystem:ee.rawCurrentLoadSystem,rawCurrentLoadNice:ee.rawCurrentLoadNice,rawCurrentLoadIdle:ee.rawCurrentLoadIdle,rawCurrentLoadIrq:ee.rawCurrentLoadIrq,rawCurrentLoadSteal:ee.rawCurrentLoadSteal,rawCurrentLoadGuest:ee.rawCurrentLoadGuest,cpus:s}}t(n)})})}function Tu(t){return new Promise(r=>{process.nextTick(()=>{Pu().then(e=>{t&&t(e),r(e)})})})}et.currentLoad=Tu;function Vu(){return new Promise(t=>{process.nextTick(()=>{const r=Ne.cpus();let e=0,n=0,i=0,s=0,o=0,a=0;if(r&&r.length){for(let l=0,c=r.length;l<c;l++){const f=r[l].times;e+=f.user,n+=f.sys,i+=f.nice,s+=f.irq,o+=f.idle}let u=o+s+i+n+e;a=(u-o)/u*100}t(a)})})}function Au(t){return new Promise(r=>{process.nextTick(()=>{Vu().then(e=>{t&&t(e),r(e)})})})}et.fullLoad=Au;var ys={};const Ge=M,Lr=M.exec,pn=M.execSync,B=W,bu=M;let rt=process.platform;const ji=rt==="linux"||rt==="android",Hi=rt==="darwin",zi=rt==="win32",Xi=rt==="freebsd",ki=rt==="openbsd",qi=rt==="netbsd",Ki=rt==="sunos",Yi={"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"},Ji={"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"};function Nu(t){return new Promise(r=>{process.nextTick(()=>{let e={total:Ge.totalmem(),free:Ge.freemem(),used:Ge.totalmem()-Ge.freemem(),active:Ge.totalmem()-Ge.freemem(),available:Ge.freemem(),buffers:0,cached:0,slab:0,buffcache:0,swaptotal:0,swapused:0,swapfree:0,writeback:null,dirty:null};if(ji)try{bu.readFile("/proc/meminfo",function(n,i){if(!n){const s=i.toString().split(`
131
+ `);e.total=parseInt(B.getValue(s,"memtotal"),10),e.total=e.total?e.total*1024:Ge.totalmem(),e.free=parseInt(B.getValue(s,"memfree"),10),e.free=e.free?e.free*1024:Ge.freemem(),e.used=e.total-e.free,e.buffers=parseInt(B.getValue(s,"buffers"),10),e.buffers=e.buffers?e.buffers*1024:0,e.cached=parseInt(B.getValue(s,"cached"),10),e.cached=e.cached?e.cached*1024:0,e.slab=parseInt(B.getValue(s,"slab"),10),e.slab=e.slab?e.slab*1024:0,e.buffcache=e.buffers+e.cached+e.slab;let o=parseInt(B.getValue(s,"memavailable"),10);e.available=o?o*1024:e.free+e.buffcache,e.active=e.total-e.available,e.swaptotal=parseInt(B.getValue(s,"swaptotal"),10),e.swaptotal=e.swaptotal?e.swaptotal*1024:0,e.swapfree=parseInt(B.getValue(s,"swapfree"),10),e.swapfree=e.swapfree?e.swapfree*1024:0,e.swapused=e.swaptotal-e.swapfree,e.writeback=parseInt(B.getValue(s,"writeback"),10),e.writeback=e.writeback?e.writeback*1024:0,e.dirty=parseInt(B.getValue(s,"dirty"),10),e.dirty=e.dirty?e.dirty*1024:0}t&&t(e),r(e)})}catch{t&&t(e),r(e)}if(Xi||ki||qi)try{Lr("/sbin/sysctl 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(n,i){if(!n){let s=i.toString().split(`
132
+ `);const o=parseInt(B.getValue(s,"vm.stats.vm.v_page_size"),10),a=parseInt(B.getValue(s,"vm.stats.vm.v_inactive_count"),10)*o,u=parseInt(B.getValue(s,"vm.stats.vm.v_cache_count"),10)*o;e.total=parseInt(B.getValue(s,"hw.realmem"),10),isNaN(e.total)&&(e.total=parseInt(B.getValue(s,"hw.physmem"),10)),e.free=parseInt(B.getValue(s,"vm.stats.vm.v_free_count"),10)*o,e.buffcache=a+u,e.available=e.buffcache+e.free,e.active=e.total-e.free-e.buffcache,e.swaptotal=0,e.swapfree=0,e.swapused=0}t&&t(e),r(e)})}catch{t&&t(e),r(e)}if(Ki&&(t&&t(e),r(e)),Hi){let n=4096;try{n=B.toInt(pn("sysctl -n vm.pagesize").toString())||n}catch{B.noop()}try{Lr('vm_stat 2>/dev/null | grep "Pages active"',function(i,s){if(!i){let o=s.toString().split(`
133
+ `);e.active=parseInt(o[0].split(":")[1],10)*n,e.buffcache=e.used-e.active,e.available=e.free+e.buffcache}Lr("sysctl -n vm.swapusage 2>/dev/null",function(o,a){if(!o){let u=a.toString().split(`
134
+ `);u.length>0&&u[0].replace(/,/g,".").replace(/M/g,"").trim().split(" ").forEach(f=>{f.toLowerCase().indexOf("total")!==-1&&(e.swaptotal=parseFloat(f.split("=")[1].trim())*1024*1024),f.toLowerCase().indexOf("used")!==-1&&(e.swapused=parseFloat(f.split("=")[1].trim())*1024*1024),f.toLowerCase().indexOf("free")!==-1&&(e.swapfree=parseFloat(f.split("=")[1].trim())*1024*1024)})}t&&t(e),r(e)})})}catch{t&&t(e),r(e)}}if(zi){let n=0,i=0;try{B.powerShell("Get-CimInstance Win32_PageFileUsage | Select AllocatedBaseSize, CurrentUsage").then((s,o)=>{o||s.split(`\r
135
+ `).filter(u=>u.trim()!=="").filter((u,l)=>l>0).forEach(function(u){u!==""&&(u=u.trim().split(/\s\s+/),n=n+(parseInt(u[0],10)||0),i=i+(parseInt(u[1],10)||0))}),e.swaptotal=n*1024*1024,e.swapused=i*1024*1024,e.swapfree=e.swaptotal-e.swapused,t&&t(e),r(e)})}catch{t&&t(e),r(e)}}})})}ys.mem=Nu;function $u(t){function r(n){return{}.hasOwnProperty.call(Yi,n)?Yi[n]:n}function e(n){const i=n.replace("0x","").toUpperCase();return i.length===4&&{}.hasOwnProperty.call(Ji,i)?Ji[i]:n}return new Promise(n=>{process.nextTick(()=>{let i=[];if((ji||Xi||ki||qi)&&Lr('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(s,o){if(!s){let a=o.toString().split("Memory Device");a.shift(),a.forEach(function(u){let l=u.split(`
136
+ `);const c=B.getValue(l,"Size"),f=c.indexOf("GB")>=0?parseInt(c,10)*1024*1024*1024:parseInt(c,10)*1024*1024;let p=B.getValue(l,"Bank Locator");if(p.toLowerCase().indexOf("bad")>=0&&(p=""),parseInt(B.getValue(l,"Size"),10)>0){const d=B.toInt(B.getValue(l,"Total Width")),m=B.toInt(B.getValue(l,"Data Width"));i.push({size:f,bank:p,type:B.getValue(l,"Type:"),ecc:m&&d?d>m:!1,clockSpeed:B.getValue(l,"Configured Clock Speed:")?parseInt(B.getValue(l,"Configured Clock Speed:"),10):B.getValue(l,"Speed:")?parseInt(B.getValue(l,"Speed:"),10):null,formFactor:B.getValue(l,"Form Factor:"),manufacturer:e(B.getValue(l,"Manufacturer:")),partNum:B.getValue(l,"Part Number:"),serialNum:B.getValue(l,"Serial Number:"),voltageConfigured:parseFloat(B.getValue(l,"Configured Voltage:"))||null,voltageMin:parseFloat(B.getValue(l,"Minimum Voltage:"))||null,voltageMax:parseFloat(B.getValue(l,"Maximum Voltage:"))||null})}else i.push({size:0,bank:p,type:"Empty",ecc:null,clockSpeed:0,formFactor:B.getValue(l,"Form Factor:"),partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})})}if(!i.length){i.push({size:Ge.totalmem(),bank:"",type:"",ecc:null,clockSpeed:0,formFactor:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null});try{let a=pn("cat /proc/cpuinfo 2>/dev/null"),u=a.toString().split(`
137
+ `),l=B.getValue(u,"hardware",":",!0).toUpperCase(),c=B.getValue(u,"revision",":",!0).toLowerCase();if(l==="BCM2835"||l==="BCM2708"||l==="BCM2709"||l==="BCM2835"||l==="BCM2837"){const f={0:400,1:450,2:450,3:3200};i[0].type="LPDDR2",i[0].type=c&&c[2]&&c[2]==="3"?"LPDDR4":i[0].type,i[0].ecc=!1,i[0].clockSpeed=c&&c[2]&&f[c[2]]||400,i[0].clockSpeed=c&&c[4]&&c[4]==="d"?500:i[0].clockSpeed,i[0].formFactor="SoC",a=pn("vcgencmd get_config sdram_freq 2>/dev/null"),u=a.toString().split(`
138
+ `);let p=parseInt(B.getValue(u,"sdram_freq","=",!0),10)||0;p&&(i[0].clockSpeed=p),a=pn("vcgencmd measure_volts sdram_p 2>/dev/null"),u=a.toString().split(`
139
+ `);let d=parseFloat(B.getValue(u,"volt","=",!0))||0;d&&(i[0].voltageConfigured=d,i[0].voltageMin=d,i[0].voltageMax=d)}}catch{B.noop()}}t&&t(i),n(i)}),Hi&&Lr("system_profiler SPMemoryDataType",function(s,o){if(!s){const a=o.toString().split(`
140
+ `),u=B.getValue(a,"ecc",":",!0).toLowerCase();let l=o.toString().split(" BANK "),c=!0;l.length===1&&(l=o.toString().split(" DIMM"),c=!1),l.shift(),l.forEach(function(f){let p=f.split(`
141
+ `);const d=(c?"BANK ":"DIMM")+p[0].trim().split("/")[0],m=parseInt(B.getValue(p," Size"));m?i.push({size:m*1024*1024*1024,bank:d,type:B.getValue(p," Type:"),ecc:u?u==="enabled":null,clockSpeed:parseInt(B.getValue(p," Speed:"),10),formFactor:"",manufacturer:r(B.getValue(p," Manufacturer:")),partNum:B.getValue(p," Part Number:"),serialNum:B.getValue(p," Serial Number:"),voltageConfigured:null,voltageMin:null,voltageMax:null}):i.push({size:0,bank:d,type:"Empty",ecc:null,clockSpeed:0,formFactor:"",manufacturer:"",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})})}if(!i.length){const a=o.toString().split(`
142
+ `),u=parseInt(B.getValue(a," Memory:")),l=B.getValue(a," Type:");u&&l&&i.push({size:u*1024*1024*1024,bank:"0",type:l,ecc:!1,clockSpeed:0,formFactor:"",manufacturer:"Apple",partNum:"",serialNum:"",voltageConfigured:null,voltageMin:null,voltageMax:null})}t&&t(i),n(i)}),Ki&&(t&&t(i),n(i)),zi){const s="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|Logical non-volatile device|HBM|HBM2|DDR5|LPDDR5".split("|"),o="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{B.powerShell("Get-CimInstance Win32_PhysicalMemory | select DataWidth,TotalWidth,Capacity,BankLabel,MemoryType,SMBIOSMemoryType,ConfiguredClockSpeed,FormFactor,Manufacturer,PartNumber,SerialNumber,ConfiguredVoltage,MinVoltage,MaxVoltage | fl").then((a,u)=>{if(!u){let l=a.toString().split(/\n\s*\n/);l.shift(),l.forEach(function(c){let f=c.split(`\r
143
+ `);const p=B.toInt(B.getValue(f,"DataWidth",":")),d=B.toInt(B.getValue(f,"TotalWidth",":")),m=parseInt(B.getValue(f,"Capacity",":"),10)||0;m&&i.push({size:m,bank:B.getValue(f,"BankLabel",":"),type:s[parseInt(B.getValue(f,"MemoryType",":"),10)||parseInt(B.getValue(f,"SMBIOSMemoryType",":"),10)],ecc:p&&d?d>p:!1,clockSpeed:parseInt(B.getValue(f,"ConfiguredClockSpeed",":"),10)||parseInt(B.getValue(f,"Speed",":"),10)||0,formFactor:o[parseInt(B.getValue(f,"FormFactor",":"),10)||0],manufacturer:B.getValue(f,"Manufacturer",":"),partNum:B.getValue(f,"PartNumber",":"),serialNum:B.getValue(f,"SerialNumber",":"),voltageConfigured:(parseInt(B.getValue(f,"ConfiguredVoltage",":"),10)||0)/1e3,voltageMin:(parseInt(B.getValue(f,"MinVoltage",":"),10)||0)/1e3,voltageMax:(parseInt(B.getValue(f,"MaxVoltage",":"),10)||0)/1e3})})}t&&t(i),n(i)})}catch{t&&t(i),n(i)}}})})}ys.memLayout=$u;const Qi=M.exec,Qt=M,Q=W;let nt=process.platform;const Du=nt==="linux"||nt==="android",Ru=nt==="darwin",Mu=nt==="win32",Bu=nt==="freebsd",Fu=nt==="openbsd",Wu=nt==="netbsd",Gu=nt==="sunos";function Uu(t,r,e){const n={};let i=Q.getValue(t,"BatteryStatus",":").trim();if(i>=0){const s=i?parseInt(i):0;n.status=s,n.hasBattery=!0,n.maxCapacity=e||parseInt(Q.getValue(t,"DesignCapacity",":")||0),n.designedCapacity=parseInt(Q.getValue(t,"DesignCapacity",":")||r),n.voltage=parseInt(Q.getValue(t,"DesignVoltage",":")||0)/1e3,n.capacityUnit="mWh",n.percent=parseInt(Q.getValue(t,"EstimatedChargeRemaining",":")||0),n.currentCapacity=parseInt(n.maxCapacity*n.percent/100),n.isCharging=s>=6&&s<=9||s===11||s!==3&&s!==1&&n.percent<100,n.acConnected=n.isCharging||s===2,n.model=Q.getValue(t,"DeviceID",":")}else n.status=-1;return n}var ju=function(t){return new Promise(r=>{process.nextTick(()=>{let e={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(Du){let n="";Qt.existsSync("/sys/class/power_supply/BAT1/uevent")?n="/sys/class/power_supply/BAT1/":Qt.existsSync("/sys/class/power_supply/BAT0/uevent")&&(n="/sys/class/power_supply/BAT0/");let i=!1,s="";Qt.existsSync("/sys/class/power_supply/AC/online")?s="/sys/class/power_supply/AC/online":Qt.existsSync("/sys/class/power_supply/AC0/online")&&(s="/sys/class/power_supply/AC0/online"),s&&(i=Qt.readFileSync(s).toString().trim()==="1"),n?Qt.readFile(n+"uevent",function(o,a){if(o)t&&t(e),r(e);else{let u=a.toString().split(`
144
+ `);e.isCharging=Q.getValue(u,"POWER_SUPPLY_STATUS","=").toLowerCase()==="charging",e.acConnected=i||e.isCharging,e.voltage=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_VOLTAGE_NOW","="),10)/1e6,e.capacityUnit=e.voltage?"mWh":"mAh",e.cycleCount=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_CYCLE_COUNT","="),10),e.maxCapacity=Math.round(parseInt("0"+Q.getValue(u,"POWER_SUPPLY_CHARGE_FULL","=",!0,!0),10)/1e3*(e.voltage||1));const l=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_VOLTAGE_MIN_DESIGN","="),10)/1e6;e.designedCapacity=Math.round(parseInt("0"+Q.getValue(u,"POWER_SUPPLY_CHARGE_FULL_DESIGN","=",!0,!0),10)/1e3*(l||e.voltage||1)),e.currentCapacity=Math.round(parseInt("0"+Q.getValue(u,"POWER_SUPPLY_CHARGE_NOW","="),10)/1e3*(e.voltage||1)),e.maxCapacity||(e.maxCapacity=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_ENERGY_FULL","=",!0,!0),10)/1e3,e.designedCapacity=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_ENERGY_FULL_DESIGN","=",!0,!0),10)/1e3|e.maxCapacity,e.currentCapacity=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_ENERGY_NOW","="),10)/1e3);const c=Q.getValue(u,"POWER_SUPPLY_CAPACITY","="),f=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_ENERGY_NOW","="),10),p=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_POWER_NOW","="),10),d=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_CURRENT_NOW","="),10),m=parseInt("0"+Q.getValue(u,"POWER_SUPPLY_CHARGE_NOW","="),10);e.percent=parseInt("0"+c,10),e.maxCapacity&&e.currentCapacity&&(e.hasBattery=!0,c||(e.percent=100*e.currentCapacity/e.maxCapacity)),e.isCharging&&(e.hasBattery=!0),f&&p?e.timeRemaining=Math.floor(f/p*60):d&&m?e.timeRemaining=Math.floor(m/d*60):d&&e.currentCapacity&&(e.timeRemaining=Math.floor(e.currentCapacity/d*60)),e.type=Q.getValue(u,"POWER_SUPPLY_TECHNOLOGY","="),e.model=Q.getValue(u,"POWER_SUPPLY_MODEL_NAME","="),e.manufacturer=Q.getValue(u,"POWER_SUPPLY_MANUFACTURER","="),e.serial=Q.getValue(u,"POWER_SUPPLY_SERIAL_NUMBER","="),t&&t(e),r(e)}}):(t&&t(e),r(e))}if((Bu||Fu||Wu)&&Qi("sysctl -i hw.acpi.battery hw.acpi.acline",function(n,i){let s=i.toString().split(`
145
+ `);const o=parseInt("0"+Q.getValue(s,"hw.acpi.battery.units"),10),a=parseInt("0"+Q.getValue(s,"hw.acpi.battery.life"),10);e.hasBattery=o>0,e.cycleCount=null,e.isCharging=Q.getValue(s,"hw.acpi.acline")!=="1",e.acConnected=e.isCharging,e.maxCapacity=null,e.currentCapacity=null,e.capacityUnit="unknown",e.percent=o?a:null,t&&t(e),r(e)}),Ru&&Qi('ioreg -n AppleSmartBattery -r | egrep "CycleCount|IsCharging|DesignCapacity|MaxCapacity|CurrentCapacity|BatterySerialNumber|TimeRemaining|Voltage"; pmset -g batt | grep %',function(n,i){if(i){let s=i.toString().replace(/ +/g,"").replace(/"+/g,"").replace(/-/g,"").split(`
146
+ `);e.cycleCount=parseInt("0"+Q.getValue(s,"cyclecount","="),10),e.voltage=parseInt("0"+Q.getValue(s,"voltage","="),10)/1e3,e.capacityUnit=e.voltage?"mWh":"mAh",e.maxCapacity=Math.round(parseInt("0"+Q.getValue(s,"applerawmaxcapacity","="),10)*(e.voltage||1)),e.currentCapacity=Math.round(parseInt("0"+Q.getValue(s,"applerawcurrentcapacity","="),10)*(e.voltage||1)),e.designedCapacity=Math.round(parseInt("0"+Q.getValue(s,"DesignCapacity","="),10)*(e.voltage||1)),e.manufacturer="Apple",e.serial=Q.getValue(s,"BatterySerialNumber","=");let o=null,u=Q.getValue(s,"internal","Battery").split(";");if(u&&u[0]){let l=u[0].split(" ");l&&l[1]&&(o=parseFloat(l[1].trim().replace(/%/g,"")))}u&&u[1]?(e.isCharging=u[1].trim()==="charging",e.acConnected=u[1].trim()!=="discharging"):(e.isCharging=Q.getValue(s,"ischarging","=").toLowerCase()==="yes",e.acConnected=e.isCharging),e.maxCapacity&&e.currentCapacity&&(e.hasBattery=!0,e.type="Li-ion",e.percent=o!==null?o:Math.round(100*e.currentCapacity/e.maxCapacity),e.isCharging||(e.timeRemaining=parseInt("0"+Q.getValue(s,"TimeRemaining","="),10)))}t&&t(e),r(e)}),Gu&&(t&&t(e),r(e)),Mu)try{const n=[];n.push(Q.powerShell("Get-CimInstance Win32_Battery | select BatteryStatus, DesignCapacity, DesignVoltage, EstimatedChargeRemaining, DeviceID | fl")),n.push(Q.powerShell("(Get-CimInstance -Class BatteryStaticData -Namespace ROOT/WMI).DesignedCapacity")),n.push(Q.powerShell("(Get-CimInstance -Class BatteryFullChargedCapacity -Namespace ROOT/WMI).FullChargedCapacity")),Q.promiseAll(n).then(i=>{if(i){let s=i.results[0].split(/\n\s*\n/),o=[];const a=c=>/\S/.test(c);for(let c=0;c<s.length;c++)a(s[c])&&(!o.length||!a(s[c-1]))&&o.push([]),a(s[c])&&o[o.length-1].push(s[c]);let u=i.results[1].split(`\r
147
+ `).filter(c=>c),l=i.results[2].split(`\r
148
+ `).filter(c=>c);if(o.length){let c=!1,f=[];for(let p=0;p<o.length;p++){let d=o[p][0].split(`\r
149
+ `);const m=u&&u.length>=p+1&&u[p]?Q.toInt(u[p]):0,g=l&&l.length>=p+1&&l[p]?Q.toInt(l[p]):0,S=Uu(d,m,g);!c&&S.status>0&&S.status!==10?(e.hasBattery=S.hasBattery,e.maxCapacity=S.maxCapacity,e.designedCapacity=S.designedCapacity,e.voltage=S.voltage,e.capacityUnit=S.capacityUnit,e.percent=S.percent,e.currentCapacity=S.currentCapacity,e.isCharging=S.isCharging,e.acConnected=S.acConnected,e.model=S.model,c=!0):S.status!==-1&&f.push({hasBattery:S.hasBattery,maxCapacity:S.maxCapacity,designedCapacity:S.designedCapacity,voltage:S.voltage,capacityUnit:S.capacityUnit,percent:S.percent,currentCapacity:S.currentCapacity,isCharging:S.isCharging,timeRemaining:null,acConnected:S.acConnected,model:S.model,type:"",manufacturer:"",serial:""})}!c&&f.length&&(e=f[0],f.shift()),f.length&&(e.additionalBatteries=f)}}t&&t(e),r(e)})}catch{t&&t(e),r(e)}})})},Zi={};const dn=M,Zt=M.exec,Ss=M.execSync,F=W;let st=process.platform,Pr="";const ws=st==="linux"||st==="android",Hu=st==="darwin",eo=st==="win32",zu=st==="freebsd",Xu=st==="openbsd",ku=st==="netbsd",qu=st==="sunos";let Tr=0,Vr=0,mn=0,hn=0;const to={"-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"};function ro(t){const r=[{pattern:"^LG.+",manufacturer:"LG"},{pattern:"^BENQ.+",manufacturer:"BenQ"},{pattern:"^ASUS.+",manufacturer:"Asus"},{pattern:"^DELL.+",manufacturer:"Dell"},{pattern:"^SAMSUNG.+",manufacturer:"Samsung"},{pattern:"^VIEWSON.+",manufacturer:"ViewSonic"},{pattern:"^SONY.+",manufacturer:"Sony"},{pattern:"^ACER.+",manufacturer:"Acer"},{pattern:"^AOC.+",manufacturer:"AOC Monitors"},{pattern:"^HP.+",manufacturer:"HP"},{pattern:"^EIZO.?",manufacturer:"Eizo"},{pattern:"^PHILIPS.?",manufacturer:"Philips"},{pattern:"^IIYAMA.?",manufacturer:"Iiyama"},{pattern:"^SHARP.?",manufacturer:"Sharp"},{pattern:"^NEC.?",manufacturer:"NEC"},{pattern:"^LENOVO.?",manufacturer:"Lenovo"},{pattern:"COMPAQ.?",manufacturer:"Compaq"},{pattern:"APPLE.?",manufacturer:"Apple"},{pattern:"INTEL.?",manufacturer:"Intel"},{pattern:"AMD.?",manufacturer:"AMD"},{pattern:"NVIDIA.?",manufacturer:"NVDIA"}];let e="";return t&&(t=t.toUpperCase(),r.forEach(n=>{RegExp(n.pattern).test(t)&&(e=n.manufacturer)})),e}function Ku(t){return{610:"Apple","1e6d":"LG","10ac":"DELL","4dd9":"Sony","38a3":"NEC"}[t]||""}function Yu(t){let r="";return t=(t||"").toLowerCase(),t.indexOf("apple")>=0?r="0x05ac":t.indexOf("nvidia")>=0?r="0x10de":t.indexOf("intel")>=0?r="0x8086":(t.indexOf("ati")>=0||t.indexOf("amd")>=0)&&(r="0x1002"),r}function Ju(t){return{spdisplays_mtlgpufamilymac1:"mac1",spdisplays_mtlgpufamilymac2:"mac2",spdisplays_mtlgpufamilyapple1:"apple1",spdisplays_mtlgpufamilyapple2:"apple2",spdisplays_mtlgpufamilyapple3:"apple3",spdisplays_mtlgpufamilyapple4:"apple4",spdisplays_mtlgpufamilyapple5:"apple5",spdisplays_mtlgpufamilyapple6:"apple6",spdisplays_mtlgpufamilyapple7:"apple7",spdisplays_metalfeaturesetfamily11:"family1_v1",spdisplays_metalfeaturesetfamily12:"family1_v2",spdisplays_metalfeaturesetfamily13:"family1_v3",spdisplays_metalfeaturesetfamily14:"family1_v4",spdisplays_metalfeaturesetfamily21:"family2_v1"}[t]||""}function Qu(t){function r(p){const d={controllers:[],displays:[]};try{return p.forEach(function(m){const g=(m.sppci_bus||"").indexOf("builtin")>-1?"Built-In":(m.sppci_bus||"").indexOf("pcie")>-1?"PCIe":"",S=(parseInt(m.spdisplays_vram||"",10)||0)*((m.spdisplays_vram||"").indexOf("GB")>-1?1024:1),h=(parseInt(m.spdisplays_vram_shared||"",10)||0)*((m.spdisplays_vram_shared||"").indexOf("GB")>-1?1024:1);let y=Ju(m.spdisplays_metal||m.spdisplays_metalfamily||"");d.controllers.push({vendor:ro(m.spdisplays_vendor||"")||m.spdisplays_vendor||"",model:m.sppci_model||"",bus:g,vramDynamic:g==="Built-In",vram:S||h||null,deviceId:m["spdisplays_device-id"]||"",vendorId:m["spdisplays_vendor-id"]||Yu((m.spdisplays_vendor||"")+(m.sppci_model||"")),external:m.sppci_device_type==="spdisplays_egpu",cores:m.sppci_cores||null,metalVersion:y}),m.spdisplays_ndrvs&&m.spdisplays_ndrvs.length&&m.spdisplays_ndrvs.forEach(function(w){const v=w.spdisplays_connection_type||"",x=(w._spdisplays_resolution||"").split("@"),z=x[0].split("x"),R=(w._spdisplays_pixels||"").split("x"),Z=w.spdisplays_depth||"",L=w["_spdisplays_display-serial-number"]||w["_spdisplays_display-serial-number2"]||null;d.displays.push({vendor:Ku(w["_spdisplays_display-vendor-id"]||"")||ro(w._name||""),vendorId:w["_spdisplays_display-vendor-id"]||"",model:w._name||"",productionYear:w["_spdisplays_display-year"]||null,serial:L!=="0"?L:null,displayId:w._spdisplays_displayID||null,main:w.spdisplays_main?w.spdisplays_main==="spdisplays_yes":!1,builtin:(w.spdisplays_display_type||"").indexOf("built-in")>-1,connection:v.indexOf("_internal")>-1?"Internal":v.indexOf("_displayport")>-1?"Display Port":v.indexOf("_hdmi")>-1?"HDMI":null,sizeX:null,sizeY:null,pixelDepth:Z==="CGSThirtyBitColor"?30:Z==="CGSThirtytwoBitColor"?32:Z==="CGSTwentyfourBitColor"?24:null,resolutionX:R.length>1?parseInt(R[0],10):null,resolutionY:R.length>1?parseInt(R[1],10):null,currentResX:z.length>1?parseInt(z[0],10):null,currentResY:z.length>1?parseInt(z[1],10):null,positionX:0,positionY:0,currentRefreshRate:x.length>1?parseInt(x[1],10):null})})}),d}catch{return d}}function e(p){let d=[],m={vendor:"",subVendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1,pciID:""},g=!1,S=[];try{S=Ss('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "').toString().split(`
150
+ `);for(let y=0;y<S.length;y++)S[y]=S[y].replace("Bus Address:","").replace("0000:","").trim();S=S.filter(function(y){return y!=null&&y})}catch{F.noop()}let h=1;return p.forEach(y=>{let w="";if(h<p.length&&p[h]&&(w=p[h],w.indexOf(":")>0&&(w=w.split(":")[1])),y.trim()!==""){if(y[0]!==" "&&y[0]!==" "){let v=S.indexOf(y.split(" ")[0])>=0,x=y.toLowerCase().indexOf(" vga "),z=y.toLowerCase().indexOf("3d controller");if(x!==-1||z!==-1){z!==-1&&x===-1&&(x=z),(m.vendor||m.model||m.bus||m.vram!==null||m.vramDynamic)&&(d.push(m),m={vendor:"",model:"",bus:"",busAddress:"",vram:null,vramDynamic:!1});const R=y.split(" ")[0];/[\da-fA-F]{2}:[\da-fA-F]{2}\.[\da-fA-F]/.test(R)&&(m.busAddress=R),g=!0;let Z=y.search(/\[[0-9a-f]{4}:[0-9a-f]{4}]|$/),L=y.substr(x,Z-x).split(":");if(m.busAddress=y.substr(0,x).trim(),L.length>1&&(L[1]=L[1].trim(),L[1].toLowerCase().indexOf("corporation")>=0?(m.vendor=L[1].substr(0,L[1].toLowerCase().indexOf("corporation")+11).trim(),m.model=L[1].substr(L[1].toLowerCase().indexOf("corporation")+11,200).split("(")[0].trim(),m.bus=S.length>0&&v?"PCIe":"Onboard",m.vram=null,m.vramDynamic=!1):L[1].toLowerCase().indexOf(" inc.")>=0?((L[1].match(/]/g)||[]).length>1?(m.vendor=L[1].substr(0,L[1].toLowerCase().indexOf("]")+1).trim(),m.model=L[1].substr(L[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(m.vendor=L[1].substr(0,L[1].toLowerCase().indexOf(" inc.")+5).trim(),m.model=L[1].substr(L[1].toLowerCase().indexOf(" inc.")+5,200).trim().split("(")[0].trim()),m.bus=S.length>0&&v?"PCIe":"Onboard",m.vram=null,m.vramDynamic=!1):L[1].toLowerCase().indexOf(" ltd.")>=0&&((L[1].match(/]/g)||[]).length>1?(m.vendor=L[1].substr(0,L[1].toLowerCase().indexOf("]")+1).trim(),m.model=L[1].substr(L[1].toLowerCase().indexOf("]")+1,200).trim().split("(")[0].trim()):(m.vendor=L[1].substr(0,L[1].toLowerCase().indexOf(" ltd.")+5).trim(),m.model=L[1].substr(L[1].toLowerCase().indexOf(" ltd.")+5,200).trim().split("(")[0].trim())),m.model&&w.indexOf(m.model)!==-1)){const Y=w.split(m.model)[0].trim();Y&&(m.subVendor=Y)}}else g=!1}if(g){let v=y.split(":");if(v.length>1&&v[0].replace(/ +/g,"").toLowerCase().indexOf("devicename")!==-1&&v[1].toLowerCase().indexOf("onboard")!==-1&&(m.bus="Onboard"),v.length>1&&v[0].replace(/ +/g,"").toLowerCase().indexOf("region")!==-1&&v[1].toLowerCase().indexOf("memory")!==-1){let x=v[1].split("=");x.length>1&&(m.vram=parseInt(x[1]))}}}h++}),(m.vendor||m.model||m.bus||m.busAddress||m.vram!==null||m.vramDynamic)&&d.push(m),d}function n(p,d){const m=/\[([^\]]+)\]\s+(\w+)\s+(.*)/,g=d.reduce((S,h)=>{const y=m.exec(h.trim());return y&&(S[y[1]]||(S[y[1]]={}),S[y[1]][y[2]]=y[3]),S},{});for(let S in g){const h=g[S];if(h.CL_DEVICE_TYPE==="CL_DEVICE_TYPE_GPU"){let y;if(h.CL_DEVICE_TOPOLOGY_AMD){const w=h.CL_DEVICE_TOPOLOGY_AMD.match(/[a-zA-Z0-9]+:\d+\.\d+/);w&&(y=w[0])}else if(h.CL_DEVICE_PCI_BUS_ID_NV&&h.CL_DEVICE_PCI_SLOT_ID_NV){const w=parseInt(h.CL_DEVICE_PCI_BUS_ID_NV),v=parseInt(h.CL_DEVICE_PCI_SLOT_ID_NV);if(!isNaN(w)&&!isNaN(v)){const x=w&255,z=v>>3&255,R=v&7;y=`${x.toString().padStart(2,"0")}:${z.toString().padStart(2,"0")}.${R}`}}if(y){let w=p.find(x=>x.busAddress===y);w||(w={vendor:"",model:"",bus:"",busAddress:y,vram:null,vramDynamic:!1},p.push(w)),w.vendor=h.CL_DEVICE_VENDOR,h.CL_DEVICE_BOARD_NAME_AMD?w.model=h.CL_DEVICE_BOARD_NAME_AMD:w.model=h.CL_DEVICE_NAME;const v=parseInt(h.CL_DEVICE_GLOBAL_MEM_SIZE);isNaN(v)||(w.vram=Math.round(v/1024/1024))}}}return p}function i(){if(Pr)return Pr;if(eo)try{const p=F.WINDIR+"\\System32\\DriverStore\\FileRepository",m=dn.readdirSync(p).filter(g=>dn.readdirSync([p,g].join("/")).includes("nvidia-smi.exe")).reduce((g,S)=>{const h=dn.statSync([p,g,"nvidia-smi.exe"].join("/")),y=dn.statSync([p,S,"nvidia-smi.exe"].join("/"));return h.ctimeMs>y.ctimeMs?g:S});m&&(Pr=[p,m,"nvidia-smi.exe"].join("/"))}catch{F.noop()}else ws&&(Pr="nvidia-smi");return Pr}function s(p){const d=i();if(p=p||F.execOptsWin,d){const m="--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",g=d+" "+m+(ws?" 2>/dev/null":"");try{return Ss(g,p).toString()}catch{F.noop()}}return""}function o(){function p(S){return[null,void 0].includes(S)?S:parseFloat(S)}const d=s();if(!d)return[];let g=d.split(`
151
+ `).filter(Boolean).map(S=>{const h=S.split(", ").map(y=>y.includes("N/A")?void 0:y);return h.length===16?{driverVersion:h[0],subDeviceId:h[1],name:h[2],pciBus:h[3],fanSpeed:p(h[4]),memoryTotal:p(h[5]),memoryUsed:p(h[6]),memoryFree:p(h[7]),utilizationGpu:p(h[8]),utilizationMemory:p(h[9]),temperatureGpu:p(h[10]),temperatureMemory:p(h[11]),powerDraw:p(h[12]),powerLimit:p(h[13]),clockCore:p(h[14]),clockMemory:p(h[15])}:{}});return g=g.filter(S=>"pciBus"in S),g}function a(p,d){return d.driverVersion&&(p.driverVersion=d.driverVersion),d.subDeviceId&&(p.subDeviceId=d.subDeviceId),d.name&&(p.name=d.name),d.pciBus&&(p.pciBus=d.pciBus),d.fanSpeed&&(p.fanSpeed=d.fanSpeed),d.memoryTotal&&(p.memoryTotal=d.memoryTotal,p.vram=d.memoryTotal,p.vramDynamic=!1),d.memoryUsed&&(p.memoryUsed=d.memoryUsed),d.memoryFree&&(p.memoryFree=d.memoryFree),d.utilizationGpu&&(p.utilizationGpu=d.utilizationGpu),d.utilizationMemory&&(p.utilizationMemory=d.utilizationMemory),d.temperatureGpu&&(p.temperatureGpu=d.temperatureGpu),d.temperatureMemory&&(p.temperatureMemory=d.temperatureMemory),d.powerDraw&&(p.powerDraw=d.powerDraw),d.powerLimit&&(p.powerLimit=d.powerLimit),d.clockCore&&(p.clockCore=d.clockCore),d.clockMemory&&(p.clockMemory=d.clockMemory),p}function u(p){let d={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},m=108;if(p.substr(m,6)==="000000"&&(m+=36),p.substr(m,6)==="000000"&&(m+=36),p.substr(m,6)==="000000"&&(m+=36),p.substr(m,6)==="000000"&&(m+=36),d.resolutionX=parseInt("0x0"+p.substr(m+8,1)+p.substr(m+4,2)),d.resolutionY=parseInt("0x0"+p.substr(m+14,1)+p.substr(m+10,2)),d.sizeX=parseInt("0x0"+p.substr(m+28,1)+p.substr(m+24,2)),d.sizeY=parseInt("0x0"+p.substr(m+29,1)+p.substr(m+26,2)),m=p.indexOf("000000fc00"),m>=0){let g=p.substr(m+10,26);g.indexOf("0a")!==-1&&(g=g.substr(0,g.indexOf("0a")));try{g.length>2&&(d.model=g.match(/.{1,2}/g).map(function(S){return String.fromCharCode(parseInt(S,16))}).join(""))}catch{F.noop()}}else d.model="";return d}function l(p,d){let m=[],g={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},S=!1,h=!1,y="",w=0;for(let v=1;v<p.length;v++)if(p[v].trim()!==""){if(p[v][0]!==" "&&p[v][0]!==" "&&p[v].toLowerCase().indexOf(" connected ")!==-1){(g.model||g.main||g.builtin||g.connection||g.sizeX!==null||g.pixelDepth!==null||g.resolutionX!==null)&&(m.push(g),g={vendor:"",model:"",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});let x=p[v].split(" ");g.connection=x[0],g.main=p[v].toLowerCase().indexOf(" primary ")>=0,g.builtin=x[0].toLowerCase().indexOf("edp")>=0}if(S)if(p[v].search(/\S|$/)>w)y+=p[v].toLowerCase().trim();else{let x=u(y);g.vendor=x.vendor,g.model=x.model,g.resolutionX=x.resolutionX,g.resolutionY=x.resolutionY,g.sizeX=x.sizeX,g.sizeY=x.sizeY,g.pixelDepth=d,S=!1}if(p[v].toLowerCase().indexOf("edid:")>=0&&(S=!0,w=p[v].search(/\S|$/)),p[v].toLowerCase().indexOf("*current")>=0){const x=p[v].split("(");if(x&&x.length>1&&x[0].indexOf("x")>=0){const z=x[0].trim().split("x");g.currentResX=F.toInt(z[0]),g.currentResY=F.toInt(z[1])}h=!0}if(h&&p[v].toLowerCase().indexOf("clock")>=0&&p[v].toLowerCase().indexOf("hz")>=0&&p[v].toLowerCase().indexOf("v: height")>=0){const x=p[v].split("clock");x&&x.length>1&&x[1].toLowerCase().indexOf("hz")>=0&&(g.currentRefreshRate=F.toInt(x[1])),h=!1}}return(g.model||g.main||g.builtin||g.connection||g.sizeX!==null||g.pixelDepth!==null||g.resolutionX!==null)&&m.push(g),m}return new Promise(p=>{process.nextTick(()=>{let d={controllers:[],displays:[]};if(Hu&&Zt("system_profiler -xml -detailLevel full SPDisplaysDataType",function(g,S){if(!g){try{const h=S.toString();d=r(F.plistParser(h)[0]._items)}catch{F.noop()}try{S=Ss('defaults read /Library/Preferences/com.apple.windowserver.plist 2>/dev/null;defaults read /Library/Preferences/com.apple.windowserver.displays.plist 2>/dev/null; echo ""',{maxBuffer:1024*2e4});const h=(S||"").toString(),y=F.plistReader(h);if(y.DisplayAnyUserSets&&y.DisplayAnyUserSets.Configs&&y.DisplayAnyUserSets.Configs[0]&&y.DisplayAnyUserSets.Configs[0].DisplayConfig){const w=y.DisplayAnyUserSets.Configs[0].DisplayConfig;let v=0;w.forEach(x=>{x.CurrentInfo&&x.CurrentInfo.OriginX!==void 0&&d.displays&&d.displays[v]&&(d.displays[v].positionX=x.CurrentInfo.OriginX),x.CurrentInfo&&x.CurrentInfo.OriginY!==void 0&&d.displays&&d.displays[v]&&(d.displays[v].positionY=x.CurrentInfo.OriginY),v++})}if(y.DisplayAnyUserSets&&y.DisplayAnyUserSets.length>0&&y.DisplayAnyUserSets[0].length>0&&y.DisplayAnyUserSets[0][0].DisplayID){const w=y.DisplayAnyUserSets[0];let v=0;w.forEach(x=>{"OriginX"in x&&d.displays&&d.displays[v]&&(d.displays[v].positionX=x.OriginX),"OriginY"in x&&d.displays&&d.displays[v]&&(d.displays[v].positionY=x.OriginY),x.Mode&&x.Mode.BitsPerPixel!==void 0&&d.displays&&d.displays[v]&&(d.displays[v].pixelDepth=x.Mode.BitsPerPixel),v++})}}catch{F.noop()}}t&&t(d),p(d)}),ws&&(F.isRaspberry()&&F.isRaspbian()?Zt(`fbset -s | grep 'mode "'; vcgencmd get_mem gpu; tvservice -s; tvservice -n;`,function(g,S){let h=S.toString().split(`
152
+ `);if(h.length>3&&h[0].indexOf('mode "')>=-1&&h[2].indexOf("0x12000a")>-1){const y=h[0].replace("mode","").replace(/"/g,"").trim().split("x");y.length===2&&d.displays.push({vendor:"",model:F.getValue(h,"device_name","="),main:!0,builtin:!1,connection:"HDMI",sizeX:null,sizeY:null,pixelDepth:null,resolutionX:parseInt(y[0],10),resolutionY:parseInt(y[1],10),currentResX:null,currentResY:null,positionX:0,positionY:0,currentRefreshRate:null})}h.length>1&&S.toString().indexOf("gpu=")>=-1&&d.controllers.push({vendor:"Broadcom",model:F.getRpiGpu(),bus:"",vram:F.getValue(h,"gpu","=").replace("M",""),vramDynamic:!0}),t&&t(d),p(d)}):Zt("lspci -vvv 2>/dev/null",function(g,S){if(!g){let y=S.toString().split(`
153
+ `);d.controllers=e(y);const w=o();d.controllers=d.controllers.map(v=>a(v,w.find(x=>x.pciBus.toLowerCase().endsWith(v.busAddress.toLowerCase()))||{}))}Zt("clinfo --raw",function(y,w){if(!y){let x=w.toString().split(`
154
+ `);d.controllers=n(d.controllers,x)}Zt("xdpyinfo 2>/dev/null | grep 'depth of root window' | awk '{ print $5 }'",function(x,z){let R=0;if(!x){let L=z.toString().split(`
155
+ `);R=parseInt(L[0])||0}Zt("xrandr --verbose 2>/dev/null",function(L,Y){if(!L){let X=Y.toString().split(`
156
+ `);d.displays=l(X,R)}t&&t(d),p(d)})})})})),(zu||Xu||ku)&&(t&&t(null),p(null)),qu&&(t&&t(null),p(null)),eo)try{const m=[];m.push(F.powerShell("Get-CimInstance win32_VideoController | fl *")),m.push(F.powerShell('gp "HKLM:\\SYSTEM\\ControlSet001\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\*" -ErrorAction SilentlyContinue | where MatchingDeviceId $null -NE | select MatchingDeviceId,HardwareInformation.qwMemorySize | fl')),m.push(F.powerShell("Get-CimInstance win32_desktopmonitor | fl *")),m.push(F.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorBasicDisplayParams | fl")),m.push(F.powerShell("Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::AllScreens")),m.push(F.powerShell("Get-CimInstance -Namespace root\\wmi -ClassName WmiMonitorConnectionParams | fl")),m.push(F.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 g=o();Promise.all(m).then(S=>{let h=S[0].replace(/\r/g,"").split(/\n\s*\n/),y=S[1].replace(/\r/g,"").split(/\n\s*\n/);d.controllers=c(h,y),d.controllers=d.controllers.map(L=>L.vendor.toLowerCase()==="nvidia"?a(L,g.find(Y=>{let X=(L.subDeviceId||"").toLowerCase();const oe=Y.subDeviceId.split("x");let N=oe.length>1?oe[1].toLowerCase():oe[0].toLowerCase();const P=Math.abs(X.length-N.length);if(X.length>N.length)for(let b=0;b<P;b++)N="0"+N;else if(X.length<N.length)for(let b=0;b<P;b++)X="0"+X;return X===N})||{}):L);let w=S[2].replace(/\r/g,"").split(/\n\s*\n/);w[0].trim()===""&&w.shift(),w.length&&w[w.length-1].trim()===""&&w.pop();let v=S[3].replace(/\r/g,"").split("Active ");v.shift();let x=S[4].replace(/\r/g,"").split("BitsPerPixel ");x.shift();let z=S[5].replace(/\r/g,"").split(/\n\s*\n/);z.shift();const R=S[6].replace(/\r/g,"").split(/\n/);let Z=[];R.forEach(L=>{const Y=L.split("|");Y.length===5&&Z.push({vendor:Y[0],code:Y[1],model:Y[2],serial:Y[3],instanceId:Y[4]})}),d.displays=f(x,v,w,z,Z),d.displays.length===1&&(Tr&&(d.displays[0].resolutionX=Tr,d.displays[0].currentResX||(d.displays[0].currentResX=Tr)),Vr&&(d.displays[0].resolutionY=Vr,d.displays[0].currentResY===0&&(d.displays[0].currentResY=Vr)),mn&&(d.displays[0].pixelDepth=mn)),d.displays=d.displays.map(L=>(hn&&!L.currentRefreshRate&&(L.currentRefreshRate=hn),L)),t&&t(d),p(d)}).catch(()=>{t&&t(d),p(d)})}catch{t&&t(d),p(d)}})});function c(p,d){const m={};for(const S in d)if({}.hasOwnProperty.call(d,S)&&d[S].trim()!==""){const h=d[S].trim().split(`
157
+ `),y=F.getValue(h,"MatchingDeviceId").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i);if(y){const w=parseInt(F.getValue(h,"HardwareInformation.qwMemorySize"));if(!isNaN(w)){let v=y[1].toUpperCase()+"&"+y[2].toUpperCase();y[3]&&(v+="&"+y[3].toUpperCase()),y[4]&&(v+="&"+y[4].toUpperCase()),m[v]=w}}}let g=[];for(let S in p)if({}.hasOwnProperty.call(p,S)&&p[S].trim()!==""){let h=p[S].trim().split(`
158
+ `),y=F.getValue(h,"PNPDeviceID",":").match(/PCI\\(VEN_[0-9A-F]{4})&(DEV_[0-9A-F]{4})(?:&(SUBSYS_[0-9A-F]{8}))?(?:&(REV_[0-9A-F]{2}))?/i),w=null,v=null;if(y){if(w=y[3]||"",w&&(w=w.split("_")[1]),v==null&&y[3]&&y[4]){const x=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[3].toUpperCase()+"&"+y[4].toUpperCase();({}).hasOwnProperty.call(m,x)&&(v=m[x])}if(v==null&&y[3]){const x=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[3].toUpperCase();({}).hasOwnProperty.call(m,x)&&(v=m[x])}if(v==null&&y[4]){const x=y[1].toUpperCase()+"&"+y[2].toUpperCase()+"&"+y[4].toUpperCase();({}).hasOwnProperty.call(m,x)&&(v=m[x])}if(v==null){const x=y[1].toUpperCase()+"&"+y[2].toUpperCase();({}).hasOwnProperty.call(m,x)&&(v=m[x])}}g.push({vendor:F.getValue(h,"AdapterCompatibility",":"),model:F.getValue(h,"name",":"),bus:F.getValue(h,"PNPDeviceID",":").startsWith("PCI")?"PCI":"",vram:(v??F.toInt(F.getValue(h,"AdapterRAM",":")))/1024/1024,vramDynamic:F.getValue(h,"VideoMemoryType",":")==="2",subDeviceId:w}),Tr=F.toInt(F.getValue(h,"CurrentHorizontalResolution",":"))||Tr,Vr=F.toInt(F.getValue(h,"CurrentVerticalResolution",":"))||Vr,hn=F.toInt(F.getValue(h,"CurrentRefreshRate",":"))||hn,mn=F.toInt(F.getValue(h,"CurrentBitsPerPixel",":"))||mn}return g}function f(p,d,m,g,S){let h=[],y="",w="",v="",x=0,z=0;if(m&&m.length){let R=m[0].split(`
159
+ `);y=F.getValue(R,"MonitorManufacturer",":"),w=F.getValue(R,"Name",":"),v=F.getValue(R,"PNPDeviceID",":").replace(/&amp;/g,"&").toLowerCase(),x=F.toInt(F.getValue(R,"ScreenWidth",":")),z=F.toInt(F.getValue(R,"ScreenHeight",":"))}for(let R=0;R<p.length;R++)if(p[R].trim()!==""){p[R]="BitsPerPixel "+p[R],d[R]="Active "+d[R],(g.length===0||g[R]===void 0)&&(g[R]="Unknown");let Z=p[R].split(`
160
+ `),L=d[R].split(`
161
+ `),Y=g[R].split(`
162
+ `);const X=F.getValue(Z,"BitsPerPixel"),oe=F.getValue(Z,"Bounds").replace("{","").replace("}","").replace(/=/g,":").split(","),N=F.getValue(Z,"Primary"),P=F.getValue(L,"MaxHorizontalImageSize"),b=F.getValue(L,"MaxVerticalImageSize"),G=F.getValue(L,"InstanceName").toLowerCase(),O=F.getValue(Y,"VideoOutputTechnology"),V=F.getValue(Z,"DeviceName");let A="",D="";S.forEach(_=>{_.instanceId.toLowerCase().startsWith(G)&&y.startsWith("(")&&w.startsWith("PnP")&&(A=_.vendor,D=_.model)}),h.push({vendor:G.startsWith(v)&&A===""?y:A,model:G.startsWith(v)&&D===""?w:D,deviceName:V,main:N.toLowerCase()==="true",builtin:O==="2147483648",connection:O&&to[O]?to[O]:"",resolutionX:F.toInt(F.getValue(oe,"Width",":")),resolutionY:F.toInt(F.getValue(oe,"Height",":")),sizeX:P?parseInt(P,10):null,sizeY:b?parseInt(b,10):null,pixelDepth:X,currentResX:F.toInt(F.getValue(oe,"Width",":")),currentResY:F.toInt(F.getValue(oe,"Height",":")),positionX:F.toInt(F.getValue(oe,"X",":")),positionY:F.toInt(F.getValue(oe,"Y",":"))})}return p.length===0&&h.push({vendor:y,model:w,main:!0,sizeX:null,sizeY:null,resolutionX:x,resolutionY:z,pixelDepth:null,currentResX:x,currentResY:z,positionX:0,positionY:0}),h}}Zi.graphics=Qu;var Nt={};const E=W,no=M,ge=M.exec,it=M.execSync,Zu=E.promisifySave(M.exec);let ot=process.platform;const Oe=ot==="linux"||ot==="android",at=ot==="darwin",er=ot==="win32",Le=ot==="freebsd",Pe=ot==="openbsd",Te=ot==="netbsd",tr=ot==="sunos";let ne={},q={};function ec(t,r){E.isFunction(t)&&(r=t,t="");let e=[],n=[];function i(u){if(!u.startsWith("/"))return"NFS";const l=u.split("/"),c=l[l.length-1],f=e.filter(p=>p.indexOf(c)>=0);return f.length===1&&f[0].indexOf("APFS")>=0?"APFS":"HFS"}function s(u){const l=["rootfs","unionfs","squashfs","cramfs","initrd","initramfs","devtmpfs","tmpfs","udev","devfs","specfs","type","appimaged"];let c=!1;return l.forEach(f=>{u.toLowerCase().indexOf(f)>=0&&(c=!0)}),c}function o(u){let l=u.toString().split(`
163
+ `);if(l.shift(),u.toString().toLowerCase().indexOf("filesystem")){let c=0;for(let f=0;f<l.length;f++)l[f]&&l[f].toLowerCase().startsWith("filesystem")&&(c=f);for(let f=0;f<c;f++)l.shift()}return l}function a(u){let l=[];return u.forEach(function(c){if(c!==""&&(c=c.replace(/ +/g," ").split(" "),c&&(c[0].startsWith("/")||c[6]&&c[6]==="/"||c[0].indexOf("/")>0||c[0].indexOf(":")===1||!at&&!s(c[1])))){const f=c[0],p=Oe||Le||Pe||Te?c[1]:i(c[0]),d=parseInt(Oe||Le||Pe||Te?c[2]:c[1])*1024,m=parseInt(Oe||Le||Pe||Te?c[3]:c[2])*1024,g=parseInt(Oe||Le||Pe||Te?c[4]:c[3])*1024,S=parseFloat((100*(m/(m+g))).toFixed(2));let h=n&&Object.keys(n).length>0?n[f]||!1:null;c.splice(0,Oe||Le||Pe||Te?6:5);const y=c.join(" ");l.find(w=>w.fs===f&&w.type===p)||l.push({fs:f,type:p,size:d,used:m,available:g,use:S,mount:y,rw:h})}}),l}return new Promise(u=>{process.nextTick(()=>{let l=[];if(Oe||Le||Pe||Te||at){let c="";if(e=[],n={},at){c="df -kP";try{e=it("diskutil list").toString().split(`
164
+ `).filter(f=>!f.startsWith("/")&&f.indexOf(":")>0),it("mount").toString().split(`
165
+ `).filter(f=>f.startsWith("/")).forEach(f=>{n[f.split(" ")[0]]=f.toLowerCase().indexOf("read-only")===-1})}catch{E.noop()}}if(Oe)try{c="export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL",it("cat /proc/mounts 2>/dev/null").toString().split(`
166
+ `).filter(f=>f.startsWith("/")).forEach(f=>{n[f.split(" ")[0]]=n[f.split(" ")[0]]||!1,f.toLowerCase().indexOf("/snap/")===-1&&(n[f.split(" ")[0]]=f.toLowerCase().indexOf("rw,")>=0||f.toLowerCase().indexOf(" rw ")>=0)})}catch{E.noop()}if(Le||Pe||Te)try{c="df -lkPT",it("mount").toString().split(`
167
+ `).forEach(f=>{n[f.split(" ")[0]]=f.toLowerCase().indexOf("read-only")===-1})}catch{E.noop()}ge(c,{maxBuffer:1024*1024},function(f,p){let d=o(p);l=a(d),t&&(l=l.filter(m=>m.fs.toLowerCase().indexOf(t.toLowerCase())>=0||m.mount.toLowerCase().indexOf(t.toLowerCase())>=0)),(!f||l.length)&&p.toString().trim()!==""?(r&&r(l),u(l)):ge("df -kPT",{maxBuffer:1024*1024},function(m,g){if(!m){let S=o(g);l=a(S)}r&&r(l),u(l)})})}if(tr&&(r&&r(l),u(l)),er)try{const c=`Get-WmiObject Win32_logicaldisk | select Access,Caption,FileSystem,FreeSpace,Size ${t?"| where -property Caption -eq "+t:""} | fl`;E.powerShell(c).then((f,p)=>{p||f.toString().split(/\n\s*\n/).forEach(function(m){let g=m.split(`\r
168
+ `);const S=E.toInt(E.getValue(g,"size",":")),h=E.toInt(E.getValue(g,"freespace",":")),y=E.getValue(g,"caption",":"),w=E.getValue(g,"access",":"),v=w?E.toInt(w)!==1:null;S&&l.push({fs:y,type:E.getValue(g,"filesystem",":"),size:S,used:S-h,available:h,use:parseFloat((100*(S-h)/S).toFixed(2)),mount:y,rw:v})}),r&&r(l),u(l)})}catch{r&&r(l),u(l)}})})}Nt.fsSize=ec;function tc(t){return new Promise(r=>{process.nextTick(()=>{const e={max:null,allocated:null,available:null};(Le||Pe||Te||at)&&ge("sysctl -i kern.maxfiles kern.num_files kern.open_files",{maxBuffer:1024*1024},function(i,s){if(!i){let o=s.toString().split(`
169
+ `);e.max=parseInt(E.getValue(o,"kern.maxfiles",":"),10),e.allocated=parseInt(E.getValue(o,"kern.num_files",":"),10)||parseInt(E.getValue(o,"kern.open_files",":"),10),e.available=e.max-e.allocated}t&&t(e),r(e)}),Oe&&no.readFile("/proc/sys/fs/file-nr",function(n,i){if(n)no.readFile("/proc/sys/fs/file-max",function(s,o){if(!s){let a=o.toString().split(`
170
+ `);a[0]&&(e.max=parseInt(a[0],10))}t&&t(e),r(e)});else{let s=i.toString().split(`
171
+ `);if(s[0]){const o=s[0].replace(/\s+/g," ").split(" ");o.length===3&&(e.allocated=parseInt(o[0],10),e.available=parseInt(o[1],10),e.max=parseInt(o[2],10),e.available||(e.available=e.max-e.allocated))}t&&t(e),r(e)}}),tr&&(t&&t(null),r(null)),er&&(t&&t(null),r(null))})})}Nt.fsOpenFiles=tc;function rc(t){return parseInt(t.substr(t.indexOf(" (")+2,t.indexOf(" Bytes)")-10))}function nc(t){let r=[],e=0;return t.forEach(n=>{if(n.length>0)if(n[0]==="*")e++;else{let i=n.split(":");i.length>1&&(r[e]||(r[e]={name:"",identifier:"",type:"disk",fsType:"",mount:"",size:0,physical:"HDD",uuid:"",label:"",model:"",serial:"",removable:!1,protocol:"",group:"",device:""}),i[0]=i[0].trim().toUpperCase().replace(/ +/g,""),i[1]=i[1].trim(),i[0]==="DEVICEIDENTIFIER"&&(r[e].identifier=i[1]),i[0]==="DEVICENODE"&&(r[e].name=i[1]),i[0]==="VOLUMENAME"&&i[1].indexOf("Not applicable")===-1&&(r[e].label=i[1]),i[0]==="PROTOCOL"&&(r[e].protocol=i[1]),i[0]==="DISKSIZE"&&(r[e].size=rc(i[1])),i[0]==="FILESYSTEMPERSONALITY"&&(r[e].fsType=i[1]),i[0]==="MOUNTPOINT"&&(r[e].mount=i[1]),i[0]==="VOLUMEUUID"&&(r[e].uuid=i[1]),i[0]==="READ-ONLYMEDIA"&&i[1]==="Yes"&&(r[e].physical="CD/DVD"),i[0]==="SOLIDSTATE"&&i[1]==="Yes"&&(r[e].physical="SSD"),i[0]==="VIRTUAL"&&(r[e].type="virtual"),i[0]==="REMOVABLEMEDIA"&&(r[e].removable=i[1]==="Removable"),i[0]==="PARTITIONTYPE"&&(r[e].type="part"),i[0]==="DEVICE/MEDIANAME"&&(r[e].model=i[1]))}}),r}function vs(t){let r=[];return t.filter(e=>e!=="").forEach(e=>{try{e=decodeURIComponent(e.replace(/\\x/g,"%")),e=e.replace(/\\/g,"\\\\");let n=JSON.parse(e);r.push({name:n.name,type:n.type,fsType:n.fsType,mount:n.mountpoint,size:parseInt(n.size),physical:n.type==="disk"?n.rota==="0"?"SSD":"HDD":n.type==="rom"?"CD/DVD":"",uuid:n.uuid,label:n.label,model:(n.model||"").trim(),serial:n.serial,removable:n.rm==="1",protocol:n.tran,group:n.group||""})}catch{E.noop()}}),r=E.unique(r),r=E.sortByKey(r,["type","name"]),r}function sc(t){const r=E.getValue(t,"md_level","="),e=E.getValue(t,"md_name","="),n=E.getValue(t,"md_uuid","="),i=[];return t.forEach(s=>{s.toLowerCase().startsWith("md_device_dev")&&s.toLowerCase().indexOf("/dev/")>0&&i.push(s.split("/dev/")[1])}),{raid:r,label:e,uuid:n,members:i}}function so(t){let r=t;try{t.forEach(e=>{if(e.type.startsWith("raid")){const n=it(`mdadm --export --detail /dev/${e.name}`).toString().split(`
172
+ `),i=sc(n);e.label=i.label,e.uuid=i.uuid,i.members&&i.members.length&&i.raid===e.type&&(r=r.map(s=>(s.fsType==="linux_raid_member"&&i.members.indexOf(s.name)>=0&&(s.group=e.name),s)))}})}catch{E.noop()}return r}function ic(t){const r=[];return t.forEach(e=>{e.type.startsWith("disk")&&r.push(e.name)}),r}function oc(t){let r=t;try{const e=ic(t);r=r.map(n=>((n.type.startsWith("part")||n.type.startsWith("disk"))&&e.forEach(i=>{n.name.startsWith(i)&&(n.device="/dev/"+i)}),n))}catch{E.noop()}return r}function ac(t){const r=[];return t.forEach(e=>{if(e.type.startsWith("disk")&&r.push({name:e.name,model:e.model,device:e.name}),e.type.startsWith("virtual")){let n="";r.forEach(i=>{i.model===e.model&&(n=i.device)}),n&&r.push({name:e.name,model:e.model,device:n})}}),r}function lc(t){let r=t;try{const e=ac(t);r=r.map(n=>((n.type.startsWith("part")||n.type.startsWith("disk")||n.type.startsWith("virtual"))&&e.forEach(i=>{n.name.startsWith(i.name)&&(n.device=i.device)}),n))}catch{E.noop()}return r}function uc(t){const r=[];return t.forEach(e=>{const n=e.split(`\r
173
+ `),i=E.getValue(n,"DeviceID",":");let s=e.split("@{DeviceID=");s.length>1&&(s=s.slice(1),s.forEach(o=>{r.push({name:o.split(";")[0].toUpperCase(),device:i})}))}),r}function cc(t,r){const e=uc(r);return t.map(n=>{const i=e.filter(s=>s.name===n.name.toUpperCase());return i.length>0&&(n.device=i[0].device),n}),t}function xs(t){return t.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,`}
174
+ `)}function fc(t){return new Promise(r=>{process.nextTick(()=>{let e=[];if(Oe&&ge("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,TRAN,SERIAL,LABEL,MODEL,OWNER 2>/dev/null",{maxBuffer:1024*1024},function(n,i){if(n)ge("lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER 2>/dev/null",{maxBuffer:1024*1024},function(s,o){if(!s){let a=xs(o).split(`
175
+ `);e=vs(a),e=so(e)}t&&t(e),r(e)});else{let s=xs(i).split(`
176
+ `);e=vs(s),e=so(e),e=oc(e),t&&t(e),r(e)}}),at&&ge("diskutil info -all",{maxBuffer:1024*1024},function(n,i){if(!n){let s=i.toString().split(`
177
+ `);e=nc(s),e=lc(e)}t&&t(e),r(e)}),tr&&(t&&t(e),r(e)),er){let n=["Unknown","NoRoot","Removable","Local","Network","CD/DVD","RAM"];try{const i=[];i.push(E.powerShell("Get-CimInstance -ClassName Win32_LogicalDisk | select Caption,DriveType,Name,FileSystem,Size,VolumeSerialNumber,VolumeName | fl")),i.push(E.powerShell("Get-WmiObject -Class Win32_diskdrive | Select-Object -Property PNPDeviceId,DeviceID, Model, Size, @{L='Partitions'; E={$_.GetRelated('Win32_DiskPartition').GetRelated('Win32_LogicalDisk') | Select-Object -Property DeviceID, VolumeName, Size, FreeSpace}} | fl")),E.promiseAll(i).then(s=>{let o=s.results[0].toString().split(/\n\s*\n/),a=s.results[1].toString().split(/\n\s*\n/);o.forEach(function(u){let l=u.split(`\r
178
+ `),c=E.getValue(l,"drivetype",":");c&&e.push({name:E.getValue(l,"name",":"),identifier:E.getValue(l,"caption",":"),type:"disk",fsType:E.getValue(l,"filesystem",":").toLowerCase(),mount:E.getValue(l,"caption",":"),size:E.getValue(l,"size",":"),physical:c>=0&&c<=6?n[c]:n[0],uuid:E.getValue(l,"volumeserialnumber",":"),label:E.getValue(l,"volumename",":"),model:"",serial:E.getValue(l,"volumeserialnumber",":"),removable:c==="2",protocol:"",group:"",device:""})}),e=cc(e,a),t&&t(e),r(e)})}catch{t&&t(e),r(e)}}(Le||Pe||Te)&&(t&&t(null),r(null))})})}Nt.blockDevices=fc;function io(t,r){let e={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0};return ne&&ne.ms?(e.rx=t,e.wx=r,e.tx=e.rx+e.wx,e.ms=Date.now()-ne.ms,e.rx_sec=(e.rx-ne.bytes_read)/(e.ms/1e3),e.wx_sec=(e.wx-ne.bytes_write)/(e.ms/1e3),e.tx_sec=e.rx_sec+e.wx_sec,ne.rx_sec=e.rx_sec,ne.wx_sec=e.wx_sec,ne.tx_sec=e.tx_sec,ne.bytes_read=e.rx,ne.bytes_write=e.wx,ne.bytes_overall=e.rx+e.wx,ne.ms=Date.now(),ne.last_ms=e.ms):(e.rx=t,e.wx=r,e.tx=e.rx+e.wx,ne.rx_sec=null,ne.wx_sec=null,ne.tx_sec=null,ne.bytes_read=e.rx,ne.bytes_write=e.wx,ne.bytes_overall=e.rx+e.wx,ne.ms=Date.now(),ne.last_ms=0),e}function pc(t){return new Promise(r=>{process.nextTick(()=>{if(er||Le||Pe||Te||tr)return r(null);let e={rx:0,wx:0,tx:0,rx_sec:null,wx_sec:null,tx_sec:null,ms:0},n=0,i=0;ne&&!ne.ms||ne&&ne.ms&&Date.now()-ne.ms>=500?(Oe&&ge("lsblk -r 2>/dev/null | grep /",{maxBuffer:1024*1024},function(s,o){if(s)t&&t(e),r(e);else{let a=o.toString().split(`
179
+ `),u=[];a.forEach(function(c){c!==""&&(c=c.trim().split(" "),u.indexOf(c[0])===-1&&u.push(c[0]))});let l=u.join("|");ge('cat /proc/diskstats | egrep "'+l+'"',{maxBuffer:1024*1024},function(c,f){c||(f.toString().split(`
180
+ `).forEach(function(d){d=d.trim(),d!==""&&(d=d.replace(/ +/g," ").split(" "),n+=parseInt(d[5])*512,i+=parseInt(d[9])*512)}),e=io(n,i)),t&&t(e),r(e)})}}),at&&ge(`ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,
181
+ "`,{maxBuffer:1024*1024},function(s,o){s||(o.toString().split(`
182
+ `).forEach(function(u){u=u.trim(),u!==""&&(u=u.split(","),n+=parseInt(u[2]),i+=parseInt(u[9]))}),e=io(n,i)),t&&t(e),r(e)})):(e.ms=ne.last_ms,e.rx=ne.bytes_read,e.wx=ne.bytes_write,e.tx=ne.bytes_read+ne.bytes_write,e.rx_sec=ne.rx_sec,e.wx_sec=ne.wx_sec,e.tx_sec=ne.tx_sec,t&&t(e),r(e))})})}Nt.fsStats=pc;function oo(t,r,e,n,i){let s={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,rWaitTime:0,wWaitTime:0,tWaitTime:0,rWaitPercent:null,wWaitPercent:null,tWaitPercent:null,ms:0};return q&&q.ms?(s.rIO=t,s.wIO=r,s.tIO=t+r,s.ms=Date.now()-q.ms,s.rIO_sec=(s.rIO-q.rIO)/(s.ms/1e3),s.wIO_sec=(s.wIO-q.wIO)/(s.ms/1e3),s.tIO_sec=s.rIO_sec+s.wIO_sec,s.rWaitTime=e,s.wWaitTime=n,s.tWaitTime=i,s.rWaitPercent=(s.rWaitTime-q.rWaitTime)*100/s.ms,s.wWaitPercent=(s.wWaitTime-q.wWaitTime)*100/s.ms,s.tWaitPercent=(s.tWaitTime-q.tWaitTime)*100/s.ms,q.rIO=t,q.wIO=r,q.rIO_sec=s.rIO_sec,q.wIO_sec=s.wIO_sec,q.tIO_sec=s.tIO_sec,q.rWaitTime=e,q.wWaitTime=n,q.tWaitTime=i,q.rWaitPercent=s.rWaitPercent,q.wWaitPercent=s.wWaitPercent,q.tWaitPercent=s.tWaitPercent,q.last_ms=s.ms,q.ms=Date.now()):(s.rIO=t,s.wIO=r,s.tIO=t+r,s.rWaitTime=e,s.wWaitTime=n,s.tWaitTime=i,q.rIO=t,q.wIO=r,q.rIO_sec=null,q.wIO_sec=null,q.tIO_sec=null,q.rWaitTime=e,q.wWaitTime=n,q.tWaitTime=i,q.rWaitPercent=null,q.wWaitPercent=null,q.tWaitPercent=null,q.last_ms=0,q.ms=Date.now()),s}function dc(t){return new Promise(r=>{process.nextTick(()=>{if(er||tr)return r(null);let e={rIO:0,wIO:0,tIO:0,rIO_sec:null,wIO_sec:null,tIO_sec:null,rWaitTime:0,wWaitTime:0,tWaitTime:0,rWaitPercent:null,wWaitPercent:null,tWaitPercent:null,ms:0},n=0,i=0,s=0,o=0,a=0;q&&!q.ms||q&&q.ms&&Date.now()-q.ms>=500?((Oe||Le||Pe||Te)&&ge('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',{maxBuffer:1024*1024},function(l,c){l?(t&&t(e),r(e)):(c.split(`
183
+ `).forEach(function(p){if(!p)return;let d=p.split(";");n+=parseInt(d[0]),i+=parseInt(d[4]),s+=parseInt(d[3]),o+=parseInt(d[7]),a+=parseInt(d[10])}),e=oo(n,i,s,o,a),t&&t(e),r(e))}),at&&ge(`ioreg -c IOBlockStorageDriver -k Statistics -r -w0 | sed -n "/IOBlockStorageDriver/,/Statistics/p" | grep "Statistics" | tr -cd "01234567890,
184
+ "`,{maxBuffer:1024*1024},function(u,l){u||(l.toString().split(`
185
+ `).forEach(function(f){f=f.trim(),f!==""&&(f=f.split(","),n+=parseInt(f[10]),i+=parseInt(f[0]))}),e=oo(n,i,s,o,a)),t&&t(e),r(e)})):(e.rIO=q.rIO,e.wIO=q.wIO,e.tIO=q.rIO+q.wIO,e.ms=q.last_ms,e.rIO_sec=q.rIO_sec,e.wIO_sec=q.wIO_sec,e.tIO_sec=q.tIO_sec,e.rWaitTime=q.rWaitTime,e.wWaitTime=q.wWaitTime,e.tWaitTime=q.tWaitTime,e.rWaitPercent=q.rWaitPercent,e.wWaitPercent=q.wWaitPercent,e.tWaitPercent=q.tWaitPercent,t&&t(e),r(e))})})}Nt.disksIO=dc;function mc(t){function r(e){const n=[{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 Technology"},{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:"MAXTO.*",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 i="";return e&&(e=e.toUpperCase(),n.forEach(s=>{RegExp(s.pattern).test(e)&&(i=s.manufacturer)})),i}return new Promise(e=>{process.nextTick(()=>{const n=o=>{for(let a=0;a<o.length;a++)delete o[a].BSDName;t&&t(o),e(o)};let i=[],s="";if(Oe){let o="";ge("export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL",{maxBuffer:1024*1024},function(a,u){if(!a)try{const l=u.toString().trim();let c=[];try{const f=JSON.parse(l);f&&{}.hasOwnProperty.call(f,"blockdevices")&&(c=f.blockdevices.filter(p=>p.type==="disk"&&p.size>0&&(p.model!==null||p.mountpoint===null&&p.label===null&&p.fstype===null&&p.parttype===null&&p.path&&p.path.indexOf("/ram")!==0&&p.path.indexOf("/loop")!==0&&p["disc-max"]&&p["disc-max"]!==0)))}catch{try{const p=it("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();let d=xs(p).split(`
186
+ `);c=vs(d).filter(g=>g.type==="disk"&&g.size>0&&(g.model!==null&&g.model!==""||g.mount===""&&g.label===""&&g.fsType===""))}catch{E.noop()}}c.forEach(f=>{let p="";const d="/dev/"+f.name,m=f.name;try{p=it("cat /sys/block/"+m+"/queue/rotational 2>/dev/null").toString().split(`
187
+ `)[0]}catch{E.noop()}let g=f.tran?f.tran.toUpperCase().trim():"";g==="NVME"&&(p="2",g="PCIe"),i.push({device:d,type:p==="0"?"SSD":p==="1"?"HD":p==="2"?"NVMe":f.model&&f.model.indexOf("SSD")>-1?"SSD":f.model&&f.model.indexOf("NVM")>-1?"NVMe":"HD",name:f.model||"",vendor:r(f.model)||(f.vendor?f.vendor.trim():""),size:f.size||0,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:f.rev?f.rev.trim():"",serialNum:f.serial?f.serial.trim():"",interfaceType:g,smartStatus:"unknown",temperature:null,BSDName:d}),s+=`printf "
188
+ ${d}|"; smartctl -H ${d} | grep overall;`,o+=`${o?'printf ",";':""}smartctl -a -j ${d};`})}catch{E.noop()}o?ge(o,{maxBuffer:1024*1024},function(l,c){try{JSON.parse(`[${c}]`).forEach(p=>{const d=p.smartctl.argv[p.smartctl.argv.length-1];for(let m=0;m<i.length;m++)i[m].BSDName===d&&(i[m].smartStatus=p.smart_status.passed?"Ok":p.smart_status.passed===!1?"Predicted Failure":"unknown",p.temperature&&p.temperature.current&&(i[m].temperature=p.temperature.current),i[m].smartData=p)}),n(i)}catch{s?(s=s+`printf "
189
+ "`,ge(s,{maxBuffer:1024*1024},function(p,d){d.toString().split(`
190
+ `).forEach(g=>{if(g){let S=g.split("|");if(S.length===2){let h=S[0];S[1]=S[1].trim();let y=S[1].split(":");if(y.length===2){y[1]=y[1].trim();let w=y[1].toLowerCase();for(let v=0;v<i.length;v++)i[v].BSDName===h&&(i[v].smartStatus=w==="passed"?"Ok":w==="failed!"?"Predicted Failure":"unknown")}}}}),n(i)})):n(i)}}):n(i)})}if((Le||Pe||Te)&&(t&&t(i),e(i)),tr&&(t&&t(i),e(i)),at&&ge("system_profiler SPSerialATADataType SPNVMeDataType SPUSBDataType",{maxBuffer:1024*1024},function(o,a){if(!o){let u=a.toString().split(`
191
+ `),l=[],c=[],f=[],p="SATA";u.forEach(d=>{d==="NVMExpress:"?p="NVMe":d==="USB:"?p="USB":d==="SATA/SATA Express:"?p="SATA":p==="SATA"?l.push(d):p==="NVMe"?c.push(d):p==="USB"&&f.push(d)});try{let d=l.join(`
192
+ `).split(" Physical Interconnect: ");d.shift(),d.forEach(function(m){m="InterfaceType: "+m;let g=m.split(`
193
+ `);const S=E.getValue(g,"Medium Type",":",!0).trim(),h=E.getValue(g,"capacity",":",!0).trim(),y=E.getValue(g,"BSD Name",":",!0).trim();if(h){let w=0;if(h.indexOf("(")>=0&&(w=parseInt(h.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),w||(w=parseInt(h)),w){const v=E.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:y,type:S.startsWith("Solid")?"SSD":"HD",name:E.getValue(g,"Model",":",!0).trim(),vendor:r(E.getValue(g,"Model",":",!0).trim())||E.getValue(g,"Manufacturer",":",!0),size:w,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:E.getValue(g,"Revision",":",!0).trim(),serialNum:E.getValue(g,"Serial Number",":",!0).trim(),interfaceType:E.getValue(g,"InterfaceType",":",!0).trim(),smartStatus:v==="verified"?"OK":v||"unknown",temperature:null,BSDName:y}),s=s+`printf "
194
+ `+y+'|"; diskutil info /dev/'+y+" | grep SMART;"}}})}catch{E.noop()}try{let d=c.join(`
195
+ `).split(`
196
+
197
+ Capacity:`);d.shift(),d.forEach(function(m){m="!Capacity: "+m;let g=m.split(`
198
+ `);const S=E.getValue(g,"link width",":",!0).trim(),h=E.getValue(g,"!capacity",":",!0).trim(),y=E.getValue(g,"BSD Name",":",!0).trim();if(h){let w=0;if(h.indexOf("(")>=0&&(w=parseInt(h.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),w||(w=parseInt(h)),w){const v=E.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:y,type:"NVMe",name:E.getValue(g,"Model",":",!0).trim(),vendor:r(E.getValue(g,"Model",":",!0).trim()),size:w,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:E.getValue(g,"Revision",":",!0).trim(),serialNum:E.getValue(g,"Serial Number",":",!0).trim(),interfaceType:("PCIe "+S).trim(),smartStatus:v==="verified"?"OK":v||"unknown",temperature:null,BSDName:y}),s=s+`printf "
199
+ `+y+'|"; diskutil info /dev/'+y+" | grep SMART;"}}})}catch{E.noop()}try{let d=f.join(`
200
+ `).replaceAll(`Media:
201
+ `,"Model:").split(`
202
+
203
+ Product ID:`);d.shift(),d.forEach(function(m){let g=m.split(`
204
+ `);const S=E.getValue(g,"Capacity",":",!0).trim(),h=E.getValue(g,"BSD Name",":",!0).trim();if(S){let y=0;if(S.indexOf("(")>=0&&(y=parseInt(S.match(/\(([^)]+)\)/)[1].replace(/\./g,"").replace(/,/g,"").replace(/\s/g,""))),y||(y=parseInt(S)),y){const w=E.getValue(g,"S.M.A.R.T. status",":",!0).trim().toLowerCase();i.push({device:h,type:"USB",name:E.getValue(g,"Model",":",!0).trim().replaceAll(":",""),vendor:r(E.getValue(g,"Model",":",!0).trim()),size:y,bytesPerSector:null,totalCylinders:null,totalHeads:null,totalSectors:null,totalTracks:null,tracksPerCylinder:null,sectorsPerTrack:null,firmwareRevision:E.getValue(g,"Revision",":",!0).trim(),serialNum:E.getValue(g,"Serial Number",":",!0).trim(),interfaceType:"USB",smartStatus:w==="verified"?"OK":w||"unknown",temperature:null,BSDName:h}),s=s+`printf "
205
+ `+h+'|"; diskutil info /dev/'+h+" | grep SMART;"}}})}catch{E.noop()}if(s)s=s+`printf "
206
+ "`,ge(s,{maxBuffer:1024*1024},function(d,m){m.toString().split(`
207
+ `).forEach(S=>{if(S){let h=S.split("|");if(h.length===2){let y=h[0];h[1]=h[1].trim();let w=h[1].split(":");if(w.length===2){w[1]=w[1].trim();let v=w[1].toLowerCase();for(let x=0;x<i.length;x++)i[x].BSDName===y&&(i[x].smartStatus=v==="not supported"?"not supported":v==="verified"?"Ok":v==="failing"?"Predicted Failure":"unknown")}}}});for(let S=0;S<i.length;S++)delete i[S].BSDName;t&&t(i),e(i)});else{for(let d=0;d<i.length;d++)delete i[d].BSDName;t&&t(i),e(i)}}}),er)try{const o=[];if(o.push(E.powerShell("Get-CimInstance Win32_DiskDrive | select Caption,Size,Status,PNPDeviceId,DeviceId,BytesPerSector,TotalCylinders,TotalHeads,TotalSectors,TotalTracks,TracksPerCylinder,SectorsPerTrack,FirmwareRevision,SerialNumber,InterfaceType | fl")),o.push(E.powerShell("Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl")),E.smartMonToolsInstalled())try{const a=JSON.parse(it("smartctl --scan -j").toString());a&&a.devices&&a.devices.length>0&&a.devices.forEach(u=>{o.push(Zu(`smartctl -j -a ${u.name}`,E.execOptsWin))})}catch{E.noop()}E.promiseAll(o).then(a=>{let u=a.results[0].toString().split(/\n\s*\n/);u.forEach(function(l){let c=l.split(`\r
208
+ `);const f=E.getValue(c,"Size",":").trim(),p=E.getValue(c,"Status",":").trim().toLowerCase();f&&i.push({device:E.getValue(c,"DeviceId",":"),type:l.indexOf("SSD")>-1?"SSD":"HD",name:E.getValue(c,"Caption",":"),vendor:r(E.getValue(c,"Caption",":",!0).trim()),size:parseInt(f),bytesPerSector:parseInt(E.getValue(c,"BytesPerSector",":")),totalCylinders:parseInt(E.getValue(c,"TotalCylinders",":")),totalHeads:parseInt(E.getValue(c,"TotalHeads",":")),totalSectors:parseInt(E.getValue(c,"TotalSectors",":")),totalTracks:parseInt(E.getValue(c,"TotalTracks",":")),tracksPerCylinder:parseInt(E.getValue(c,"TracksPerCylinder",":")),sectorsPerTrack:parseInt(E.getValue(c,"SectorsPerTrack",":")),firmwareRevision:E.getValue(c,"FirmwareRevision",":").trim(),serialNum:E.getValue(c,"SerialNumber",":").trim(),interfaceType:E.getValue(c,"InterfaceType",":").trim(),smartStatus:p==="ok"?"Ok":p==="degraded"?"Degraded":p==="pred fail"?"Predicted Failure":"Unknown",temperature:null})}),u=a.results[1].split(/\n\s*\n/),u.forEach(function(l){let c=l.split(`\r
209
+ `);const f=E.getValue(c,"SerialNumber",":").trim(),p=E.getValue(c,"FriendlyName",":").trim().replace("Msft ","Microsoft"),d=E.getValue(c,"Size",":").trim(),m=E.getValue(c,"Model",":").trim(),g=E.getValue(c,"BusType",":").trim();let S=E.getValue(c,"MediaType",":").trim();if((S==="3"||S==="HDD")&&(S="HD"),S==="4"&&(S="SSD"),S==="5"&&(S="SCM"),S==="Unspecified"&&(m.toLowerCase().indexOf("virtual")>-1||m.toLowerCase().indexOf("vbox")>-1)&&(S="Virtual"),d){let h=E.findObjectByKey(i,"serialNum",f);(h===-1||f==="")&&(h=E.findObjectByKey(i,"name",p)),h!=-1&&(i[h].type=S,i[h].interfaceType=g)}}),a.results.shift(),a.results.shift(),a.results.length&&a.results.forEach(l=>{try{const c=JSON.parse(l);if(c.serial_number){const f=c.serial_number;let p=E.findObjectByKey(i,"serialNum",f);p!=-1&&(i[p].smartStatus=c.smart_status&&c.smart_status.passed?"Ok":c.smart_status&&c.smart_status.passed===!1?"Predicted Failure":"unknown",c.temperature&&c.temperature.current&&(i[p].temperature=c.temperature.current),i[p].smartData=c)}}catch{E.noop()}}),t&&t(i),e(i)})}catch{t&&t(i),e(i)}})})}Nt.diskLayout=mc;var $t={};const gn=M,Ie=M.exec,ue=M.execSync,hc=M,j=W;let lt=process.platform;const ze=lt==="linux"||lt==="android",Xe=lt==="darwin",Ar=lt==="win32",ut=lt==="freebsd",ct=lt==="openbsd",ft=lt==="netbsd",ao=lt==="sunos";let te={},lo="",rr={},uo=[],nr=[],sr={},Dt;function Rt(){let t="",r="";try{let e=gn.networkInterfaces(),n=9999;for(let i in e)({}).hasOwnProperty.call(e,i)&&e[i].forEach(function(s){s&&s.internal===!1&&(r=r||i,s.scopeid&&s.scopeid<n&&(t=i,n=s.scopeid))});if(t=t||r||"",Ar){let i="";if(ue("netstat -r",j.execOptsWin).toString().split(gn.EOL).forEach(u=>{if(u=u.replace(/\s+/g," ").trim(),u.indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(u)){const l=u.split(" ");l.length>=5&&(i=l[l.length-2])}}),i)for(let u in e)({}).hasOwnProperty.call(e,u)&&e[u].forEach(function(l){l&&l.address&&l.address===i&&(t=u)})}if(ze){let o=ue("ip route 2> /dev/null | grep default").toString().split(`
210
+ `)[0].split(/\s+/);o[0]==="none"&&o[5]?t=o[5]:o[4]&&(t=o[4]),t.indexOf(":")>-1&&(t=t.split(":")[1].trim())}if(Xe||ut||ct||ft||ao){let i="";ze&&(i="ip route 2> /dev/null | grep default | awk '{print $5}'"),Xe&&(i="route -n get default 2>/dev/null | grep interface: | awk '{print $2}'"),(ut||ct||ft||ao)&&(i="route get 0.0.0.0 | grep interface:"),t=ue(i).toString().split(`
211
+ `)[0],t.indexOf(":")>-1&&(t=t.split(":")[1].trim())}}catch{j.noop()}return t&&(lo=t),lo}$t.getDefaultNetworkInterface=Rt;function co(){let t="",r="",e={};if(ze||ut||ct||ft){if(typeof Dt>"u")try{const n=ue("which ip").toString().split(`
212
+ `);n.length&&n[0].indexOf(":")===-1&&n[0].indexOf("/")===0?Dt=n[0]:Dt=""}catch{Dt=""}try{const n="export LC_ALL=C; "+(Dt?Dt+" link show up":"/sbin/ifconfig")+"; unset LC_ALL",s=ue(n).toString().split(`
213
+ `);for(let o=0;o<s.length;o++)if(s[o]&&s[o][0]!==" "){if(Dt){let a=s[o+1].trim().split(" ");a[0]==="link/ether"&&(t=s[o].split(" ")[1],t=t.slice(0,t.length-1),r=a[1])}else t=s[o].split(" ")[0],r=s[o].split("HWaddr ")[1];t&&r&&(e[t]=r.trim(),t="",r="")}}catch{j.noop()}}if(Xe)try{const s=ue("/sbin/ifconfig").toString().split(`
214
+ `);for(let o=0;o<s.length;o++)s[o]&&s[o][0]!==" "&&s[o].indexOf(":")>0?t=s[o].split(":")[0]:s[o].indexOf(" ether ")===0&&(r=s[o].split(" ether ")[1],t&&r&&(e[t]=r.trim(),t="",r=""))}catch{j.noop()}return e}function gc(t){return new Promise(r=>{process.nextTick(()=>{let e=Rt();t&&t(e),r(e)})})}$t.networkInterfaceDefault=gc;function yc(t,r){let e=[];for(let n in t)if({}.hasOwnProperty.call(t,n)&&t[n].trim()!==""){let i=t[n].trim().split(`\r
215
+ `),s=r&&r[n]?r[n].trim().split(`\r
216
+ `):[],o=j.getValue(i,"NetEnabled",":"),a=j.getValue(i,"AdapterTypeID",":")==="9"?"wireless":"wired",u=j.getValue(i,"Name",":").replace(/\]/g,")").replace(/\[/g,"("),l=j.getValue(i,"NetConnectionID",":").replace(/\]/g,")").replace(/\[/g,"(");if((u.toLowerCase().indexOf("wi-fi")>=0||u.toLowerCase().indexOf("wireless")>=0)&&(a="wireless"),o!==""){const c=parseInt(j.getValue(i,"speed",":").trim(),10)/1e6;e.push({mac:j.getValue(i,"MACAddress",":").toLowerCase(),dhcp:j.getValue(s,"dhcpEnabled",":").toLowerCase()==="true",name:u,iface:l,netEnabled:o==="TRUE",speed:isNaN(c)?null:c,operstate:j.getValue(i,"NetConnectionStatus",":")==="2"?"up":"down",type:a})}}return e}function Sc(){return new Promise(t=>{process.nextTick(()=>{let r="Get-CimInstance Win32_NetworkAdapter | fl *; echo '#-#-#-#';";r+="Get-CimInstance Win32_NetworkAdapterConfiguration | fl DHCPEnabled";try{j.powerShell(r).then(e=>{e=e.split("#-#-#-#");const n=(e[0]||"").split(/\n\s*\n/),i=(e[1]||"").split(/\n\s*\n/);t(yc(n,i))})}catch{t([])}})})}function wc(){let t={},r={primaryDNS:"",exitCode:0,ifaces:[]};try{return ue("ipconfig /all",j.execOptsWin).split(`\r
217
+ \r
218
+ `).forEach((i,s)=>{if(s==1){const o=i.split(`\r
219
+ `).filter(u=>u.toUpperCase().includes("DNS")),a=o[0].substring(o[0].lastIndexOf(":")+1);r.primaryDNS=a.trim(),r.primaryDNS||(r.primaryDNS="Not defined")}if(s>1)if(s%2==0){const o=i.substring(i.lastIndexOf(" ")+1).replace(":","");t.name=o}else{const o=i.split(`\r
220
+ `).filter(u=>u.toUpperCase().includes("DNS")),a=o[0].substring(o[0].lastIndexOf(":")+1);t.dnsSuffix=a.trim(),r.ifaces.push(t),t={}}}),r}catch{return{primaryDNS:"",exitCode:0,ifaces:[]}}}function vc(t,r){let e="";const n=r+".";try{const i=t.filter(s=>n.includes(s.name+".")).map(s=>s.dnsSuffix);return i[0]&&(e=i[0]),e||(e=""),e}catch{return"Unknown"}}function xc(){try{return ue("netsh lan show profiles",j.execOptsWin).split(`\r
221
+ Profile on interface`)}catch(t){return t.status===1&&t.stdout.includes("AutoConfig")?"Disabled":[]}}function Cc(t){try{return ue(`netsh wlan show interface name="${t}" | findstr "SSID"`,j.execOptsWin).split(`\r
222
+ `).shift().split(":").pop()}catch{return"Unknown"}}function Ic(t,r,e){let n={state:"Unknown",protocol:"Unknown"};if(e==="Disabled")return n.state="Disabled",n.protocol="Not defined",n;if(t=="wired"&&e.length>0)try{const s=e.find(a=>a.includes(r+`\r
223
+ `)).split(`\r
224
+ `),o=s.find(a=>a.includes("802.1x"));if(o.includes("Disabled"))n.state="Disabled",n.protocol="Not defined";else if(o.includes("Enabled")){const a=s.find(u=>u.includes("EAP"));n.protocol=a.split(":").pop(),n.state="Enabled"}}catch{return n}else if(t=="wireless"){let i="",s="";try{const o=Cc(r);o!=="Unknown"&&(i=ue(`netsh wlan show profiles "${o}" | findstr "802.1X"`,j.execOptsWin),s=ue(`netsh wlan show profiles "${o}" | findstr "EAP"`,j.execOptsWin)),i.includes(":")&&s.includes(":")&&(n.state=i.split(":").pop(),n.protocol=s.split(":").pop())}catch(o){return o.status===1&&o.stdout.includes("AutoConfig")&&(n.state="Disabled",n.protocol="Not defined"),n}}return n}function fo(t){const r=[];let e=[];return t.forEach(function(n){!n.startsWith(" ")&&!n.startsWith(" ")&&e.length&&(r.push(e),e=[]),e.push(n)}),e.length&&r.push(e),r}function _c(t){let r=[];return t.forEach(e=>{let n={iface:"",mtu:null,mac:"",ip6:"",ip4:"",speed:null,type:"",operstate:"",duplex:"",internal:!1};const i=e[0];n.iface=i.split(":")[0].trim();let s=i.split("> mtu");n.mtu=s.length>1?parseInt(s[1],10):null,isNaN(n.mtu)&&(n.mtu=null),n.internal=s[0].toLowerCase().indexOf("loopback")>-1,e.forEach(u=>{u.trim().startsWith("ether ")&&(n.mac=u.split("ether ")[1].toLowerCase().trim()),u.trim().startsWith("inet6 ")&&!n.ip6&&(n.ip6=u.split("inet6 ")[1].toLowerCase().split("%")[0].split(" ")[0]),u.trim().startsWith("inet ")&&!n.ip4&&(n.ip4=u.split("inet ")[1].toLowerCase().split(" ")[0])});let o=j.getValue(e,"link rate");n.speed=o?parseFloat(o):null,n.speed===null?(o=j.getValue(e,"uplink rate"),n.speed=o?parseFloat(o):null,n.speed!==null&&o.toLowerCase().indexOf("gbps")>=0&&(n.speed=n.speed*1e3)):o.toLowerCase().indexOf("gbps")>=0&&(n.speed=n.speed*1e3),n.type=j.getValue(e,"type").toLowerCase().indexOf("wi-fi")>-1?"wireless":"wired";const a=j.getValue(e,"status").toLowerCase();n.operstate=a==="active"?"up":a==="inactive"?"down":"unknown",n.duplex=j.getValue(e,"media").toLowerCase().indexOf("half-duplex")>-1?"half":"full",(n.ip6||n.ip4||n.mac)&&r.push(n)}),r}function Ec(){const t="/sbin/ifconfig -v";try{const r=ue(t,{maxBuffer:2048e4}).toString().split(`
225
+ `),e=fo(r);return _c(e)}catch{return[]}}function Oc(t){const r=`nmcli device status 2>/dev/null | grep ${t}`;try{const s=ue(r).toString().replace(/\s+/g," ").trim().split(" ").slice(3).join(" ");return s!="--"?s:""}catch{return""}}function po(t){let r=[];try{let e=`cat ${t} 2> /dev/null | grep 'iface\\|source'`;ue(e,{maxBuffer:1024*2e4}).toString().split(`
226
+ `).forEach(i=>{const s=i.replace(/\s+/g," ").trim().split(" ");if(s.length>=4&&i.toLowerCase().indexOf(" inet ")>=0&&i.toLowerCase().indexOf("dhcp")>=0&&r.push(s[1]),i.toLowerCase().includes("source")){let o=i.split(" ")[1];r=r.concat(po(o))}})}catch{j.noop()}return r}function Lc(){let t="ip a 2> /dev/null",r=[];try{const e=ue(t,{maxBuffer:2048e4}).toString().split(`
227
+ `),n=fo(e);r=Pc(n)}catch{j.noop()}try{r=po("/etc/network/interfaces")}catch{j.noop()}return r}function Pc(t){const r=[];return t&&t.length&&t.forEach(e=>{if(e&&e.length&&e[0].split(":").length>2){for(let i of e)if(i.indexOf(" inet ")>=0&&i.indexOf(" dynamic ")>=0){const s=i.split(" "),o=s[s.length-1].trim();r.push(o);break}}}),r}function Tc(t,r,e){let n=!1;if(r){const i=`nmcli connection show "${r}" 2>/dev/null | grep ipv4.method;`;try{switch(ue(i).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString()){case"auto":n=!0;break;default:n=!1;break}return n}catch{return e.indexOf(t)>=0}}else return e.indexOf(t)>=0}function Vc(t){let r=!1;const e=`ipconfig getpacket "${t}" 2>/dev/null | grep lease_time;`;try{const n=ue(e).toString().split(`
228
+ `);n.length&&n[0].startsWith("lease_time")&&(r=!0)}catch{j.noop()}return r}function Ac(t){if(t){const r=`nmcli connection show "${t}" 2>/dev/null | grep ipv4.dns-search;`;try{const i=ue(r).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString();return i=="--"?"Not defined":i}catch{return"Unknown"}}else return"Unknown"}function bc(t){if(t){const r=`nmcli connection show "${t}" 2>/dev/null | grep 802-1x.eap;`;try{const i=ue(r).toString().replace(/\s+/g," ").trim().split(" ").slice(1).toString();return i=="--"?"":i}catch{return"Not defined"}}else return"Not defined"}function Nc(t){return t?t=="Not defined"?"Disabled":"Enabled":"Unknown"}function Cs(t,r,e){const n=["00:00:00:00:00:00","00:03:FF","00:05:69","00:0C:29","00:0F:4B","00:13:07","00:13:BE","00:15:5d","00:16:3E","00:1C:42","00:21:F6","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"];return e?n.filter(i=>e.toUpperCase().toUpperCase().startsWith(i.substring(0,e.length))).length>0||t.toLowerCase().indexOf(" virtual ")>-1||r.toLowerCase().indexOf(" virtual ")>-1||t.toLowerCase().indexOf("vethernet ")>-1||r.toLowerCase().indexOf("vethernet ")>-1||t.toLowerCase().startsWith("veth")||r.toLowerCase().startsWith("veth")||t.toLowerCase().startsWith("vboxnet")||r.toLowerCase().startsWith("vboxnet"):!1}function Is(t,r,e){return typeof t=="string"&&(e=t,r=!0,t=null),typeof t=="boolean"&&(r=t,t=null,e=""),typeof r>"u"&&(r=!0),e=e||"",e=""+e,new Promise(n=>{process.nextTick(()=>{let i=gn.networkInterfaces(),s=[],o=[],a=[],u=[];if(Xe||ut||ct||ft)if(JSON.stringify(i)===JSON.stringify(rr)&&!r)s=nr,t&&t(s),n(s);else{const l=Rt();rr=JSON.parse(JSON.stringify(i)),o=Ec(),o.forEach(c=>{({}).hasOwnProperty.call(i,c.iface)&&i[c.iface].forEach(function(m){(m.family==="IPv4"||m.family===4)&&(c.ip4subnet=m.netmask),(m.family==="IPv6"||m.family===6)&&(c.ip6subnet=m.netmask)});let f="";const p=j.isPrototypePolluted()?"---":j.sanitizeShellString(c.iface),d=j.mathMin(p.length,2e3);for(let m=0;m<=d;m++)p[m]!==void 0&&(f=f+p[m]);s.push({iface:c.iface,ifaceName:c.iface,default:c.iface===l,ip4:c.ip4,ip4subnet:c.ip4subnet||"",ip6:c.ip6,ip6subnet:c.ip6subnet||"",mac:c.mac,internal:c.internal,virtual:c.internal?!1:Cs(c.iface,c.iface,c.mac),operstate:c.operstate,type:c.type,duplex:c.duplex,mtu:c.mtu,speed:c.speed,dhcp:Vc(f),dnsSuffix:"",ieee8021xAuth:"",ieee8021xState:"",carrierChanges:0})}),nr=s,e.toLowerCase().indexOf("default")>=0&&(s=s.filter(c=>c.default),s.length>0?s=s[0]:s=[]),t&&t(s),n(s)}if(ze)if(JSON.stringify(i)===JSON.stringify(rr)&&!r)s=nr,t&&t(s),n(s);else{rr=JSON.parse(JSON.stringify(i)),uo=Lc();const l=Rt();for(let c in i){let f="",p="",d="",m="",g="",S="",h="",y=null,w=0,v=!1,x="",z="",R="",Z="";if({}.hasOwnProperty.call(i,c)){let L=c;i[c].forEach(function(_){(_.family==="IPv4"||_.family===4)&&(f=_.address,p=_.netmask),(_.family==="IPv6"||_.family===6)&&(!d||d.match(/^fe80::/i))&&(d=_.address,m=_.netmask),g=_.mac;const H=parseInt(process.versions.node.split("."),10);g.indexOf("00:00:0")>-1&&(ze||Xe)&&!_.internal&&H>=8&&H<=11&&(Object.keys(sr).length===0&&(sr=co()),g=sr[c]||"")});let Y=c.split(":")[0].trim().toLowerCase(),X="";const oe=j.isPrototypePolluted()?"---":j.sanitizeShellString(Y),N=j.mathMin(oe.length,2e3);for(let _=0;_<=N;_++)oe[_]!==void 0&&(X=X+oe[_]);const P=`echo -n "addr_assign_type: "; cat /sys/class/net/${X}/addr_assign_type 2>/dev/null; echo;
229
+ echo -n "address: "; cat /sys/class/net/${X}/address 2>/dev/null; echo;
230
+ echo -n "addr_len: "; cat /sys/class/net/${X}/addr_len 2>/dev/null; echo;
231
+ echo -n "broadcast: "; cat /sys/class/net/${X}/broadcast 2>/dev/null; echo;
232
+ echo -n "carrier: "; cat /sys/class/net/${X}/carrier 2>/dev/null; echo;
233
+ echo -n "carrier_changes: "; cat /sys/class/net/${X}/carrier_changes 2>/dev/null; echo;
234
+ echo -n "dev_id: "; cat /sys/class/net/${X}/dev_id 2>/dev/null; echo;
235
+ echo -n "dev_port: "; cat /sys/class/net/${X}/dev_port 2>/dev/null; echo;
236
+ echo -n "dormant: "; cat /sys/class/net/${X}/dormant 2>/dev/null; echo;
237
+ echo -n "duplex: "; cat /sys/class/net/${X}/duplex 2>/dev/null; echo;
238
+ echo -n "flags: "; cat /sys/class/net/${X}/flags 2>/dev/null; echo;
239
+ echo -n "gro_flush_timeout: "; cat /sys/class/net/${X}/gro_flush_timeout 2>/dev/null; echo;
240
+ echo -n "ifalias: "; cat /sys/class/net/${X}/ifalias 2>/dev/null; echo;
241
+ echo -n "ifindex: "; cat /sys/class/net/${X}/ifindex 2>/dev/null; echo;
242
+ echo -n "iflink: "; cat /sys/class/net/${X}/iflink 2>/dev/null; echo;
243
+ echo -n "link_mode: "; cat /sys/class/net/${X}/link_mode 2>/dev/null; echo;
244
+ echo -n "mtu: "; cat /sys/class/net/${X}/mtu 2>/dev/null; echo;
245
+ echo -n "netdev_group: "; cat /sys/class/net/${X}/netdev_group 2>/dev/null; echo;
246
+ echo -n "operstate: "; cat /sys/class/net/${X}/operstate 2>/dev/null; echo;
247
+ echo -n "proto_down: "; cat /sys/class/net/${X}/proto_down 2>/dev/null; echo;
248
+ echo -n "speed: "; cat /sys/class/net/${X}/speed 2>/dev/null; echo;
249
+ echo -n "tx_queue_len: "; cat /sys/class/net/${X}/tx_queue_len 2>/dev/null; echo;
250
+ echo -n "type: "; cat /sys/class/net/${X}/type 2>/dev/null; echo;
251
+ echo -n "wireless: "; cat /proc/net/wireless 2>/dev/null | grep ${X}; echo;
252
+ echo -n "wirelessspeed: "; iw dev ${X} link 2>&1 | grep bitrate; echo;`;let b=[];try{b=ue(P).toString().split(`
253
+ `);const _=Oc(X);v=Tc(X,_,uo),x=Ac(_),z=bc(_),R=Nc(z)}catch{j.noop()}S=j.getValue(b,"duplex"),S=S.startsWith("cat")?"":S,h=parseInt(j.getValue(b,"mtu"),10);let G=parseInt(j.getValue(b,"speed"),10);y=isNaN(G)?null:G;let O=j.getValue(b,"wirelessspeed").split("tx bitrate: ");y===null&&O.length===2&&(G=parseFloat(O[1]),y=isNaN(G)?null:G),w=parseInt(j.getValue(b,"carrier_changes"),10);const V=j.getValue(b,"operstate");Z=V==="up"?j.getValue(b,"wireless").trim()?"wireless":"wired":"unknown",(X==="lo"||X.startsWith("bond"))&&(Z="virtual");let A=i[c]&&i[c][0]?i[c][0].internal:!1;(c.toLowerCase().indexOf("loopback")>-1||L.toLowerCase().indexOf("loopback")>-1)&&(A=!0);const D=A?!1:Cs(c,L,g);s.push({iface:X,ifaceName:L,default:Y===l,ip4:f,ip4subnet:p,ip6:d,ip6subnet:m,mac:g,internal:A,virtual:D,operstate:V,type:Z,duplex:S,mtu:h,speed:y,dhcp:v,dnsSuffix:x,ieee8021xAuth:z,ieee8021xState:R,carrierChanges:w})}}nr=s,e.toLowerCase().indexOf("default")>=0&&(s=s.filter(c=>c.default),s.length>0?s=s[0]:s=[]),t&&t(s),n(s)}if(Ar)if(JSON.stringify(i)===JSON.stringify(rr)&&!r)s=nr,t&&t(s),n(s);else{rr=JSON.parse(JSON.stringify(i));const l=Rt();Sc().then(function(c){c.forEach(f=>{let p=!1;Object.keys(i).forEach(d=>{p||i[d].forEach(m=>{Object.keys(m).indexOf("mac")>=0&&(p=m.mac===f.mac)})}),p||(i[f.name]=[{mac:f.mac}])}),u=xc(),a=wc();for(let f in i){let p="";const d=j.isPrototypePolluted()?"---":j.sanitizeShellString(f),m=j.mathMin(d.length,2e3);for(let b=0;b<=m;b++)d[b]!==void 0&&(p=p+d[b]);let g=f,S="",h="",y="",w="",v="",x="",z="",R=null,Z=0,L="down",Y=!1,X="",oe="",N="",P="";if({}.hasOwnProperty.call(i,f)){let b=f;i[f].forEach(function(D){(D.family==="IPv4"||D.family===4)&&(S=D.address,h=D.netmask),(D.family==="IPv6"||D.family===6)&&(!y||y.match(/^fe80::/i))&&(y=D.address,w=D.netmask),v=D.mac;const _=parseInt(process.versions.node.split("."),10);v.indexOf("00:00:0")>-1&&(ze||Xe)&&!D.internal&&_>=8&&_<=11&&(Object.keys(sr).length===0&&(sr=co()),v=sr[f]||"")}),X=vc(a.ifaces,p);let G=!1;c.forEach(D=>{D.mac===v&&!G&&(g=D.iface||g,b=D.name,Y=D.dhcp,L=D.operstate,R=D.speed,P=D.type,G=!0)}),(f.toLowerCase().indexOf("wlan")>=0||b.toLowerCase().indexOf("wlan")>=0||b.toLowerCase().indexOf("802.11n")>=0||b.toLowerCase().indexOf("wireless")>=0||b.toLowerCase().indexOf("wi-fi")>=0||b.toLowerCase().indexOf("wifi")>=0)&&(P="wireless");const O=Ic(P,p,u);oe=O.protocol,N=O.state;let V=i[f]&&i[f][0]?i[f][0].internal:!1;(f.toLowerCase().indexOf("loopback")>-1||b.toLowerCase().indexOf("loopback")>-1)&&(V=!0);const A=V?!1:Cs(f,b,v);s.push({iface:g,ifaceName:b,default:g===l,ip4:S,ip4subnet:h,ip6:y,ip6subnet:w,mac:v,internal:V,virtual:A,operstate:L,type:P,duplex:x,mtu:z,speed:R,dhcp:Y,dnsSuffix:X,ieee8021xAuth:oe,ieee8021xState:N,carrierChanges:Z})}}nr=s,e.toLowerCase().indexOf("default")>=0&&(s=s.filter(f=>f.default),s.length>0?s=s[0]:s=[]),t&&t(s),n(s)})}})})}$t.networkInterfaces=Is;function yn(t,r,e,n,i,s,o,a){let u={iface:t,operstate:n,rx_bytes:r,rx_dropped:i,rx_errors:s,tx_bytes:e,tx_dropped:o,tx_errors:a,rx_sec:null,tx_sec:null,ms:0};return te[t]&&te[t].ms?(u.ms=Date.now()-te[t].ms,u.rx_sec=r-te[t].rx_bytes>=0?(r-te[t].rx_bytes)/(u.ms/1e3):0,u.tx_sec=e-te[t].tx_bytes>=0?(e-te[t].tx_bytes)/(u.ms/1e3):0,te[t].rx_bytes=r,te[t].tx_bytes=e,te[t].rx_sec=u.rx_sec,te[t].tx_sec=u.tx_sec,te[t].ms=Date.now(),te[t].last_ms=u.ms,te[t].operstate=n):(te[t]||(te[t]={}),te[t].rx_bytes=r,te[t].tx_bytes=e,te[t].rx_sec=null,te[t].tx_sec=null,te[t].ms=Date.now(),te[t].last_ms=0,te[t].operstate=n),u}function mo(t,r){let e=[];return new Promise(n=>{process.nextTick(()=>{if(j.isFunction(t)&&!r)r=t,e=[Rt()];else{if(typeof t!="string"&&t!==void 0)return r&&r([]),n([]);t=t||Rt(),t.__proto__.toLowerCase=j.stringToLower,t.__proto__.replace=j.stringReplace,t.__proto__.trim=j.stringTrim,t=t.trim().toLowerCase().replace(/,+/g,"|"),e=t.split("|")}const i=[],s=[];if(e.length&&e[0].trim()==="*")e=[],Is(!1).then(o=>{for(let a of o)e.push(a.iface);mo(e.join(",")).then(a=>{r&&r(a),n(a)})});else{for(let o of e)s.push($c(o.trim()));s.length?Promise.all(s).then(o=>{r&&r(o),n(o)}):(r&&r(i),n(i))}})})}function $c(t){function r(e){let n=[];for(let i in e)if({}.hasOwnProperty.call(e,i)&&e[i].trim()!==""){let s=e[i].trim().split(`\r
254
+ `);n.push({name:j.getValue(s,"Name",":").replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase(),rx_bytes:parseInt(j.getValue(s,"BytesReceivedPersec",":"),10),rx_errors:parseInt(j.getValue(s,"PacketsReceivedErrors",":"),10),rx_dropped:parseInt(j.getValue(s,"PacketsReceivedDiscarded",":"),10),tx_bytes:parseInt(j.getValue(s,"BytesSentPersec",":"),10),tx_errors:parseInt(j.getValue(s,"PacketsOutboundErrors",":"),10),tx_dropped:parseInt(j.getValue(s,"PacketsOutboundDiscarded",":"),10)})}return n}return new Promise(e=>{process.nextTick(()=>{let n="";const i=j.isPrototypePolluted()?"---":j.sanitizeShellString(t),s=j.mathMin(i.length,2e3);for(let h=0;h<=s;h++)i[h]!==void 0&&(n=n+i[h]);let o={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},a="unknown",u=0,l=0,c=0,f=0,p=0,d=0,m,g,S;if(!te[n]||te[n]&&!te[n].ms||te[n]&&te[n].ms&&Date.now()-te[n].ms>=500){if(ze&&(hc.existsSync("/sys/class/net/"+n)?(m="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; ",Ie(m,function(h,y){h||(g=y.toString().split(`
255
+ `),a=g[0].trim(),u=parseInt(g[1],10),l=parseInt(g[2],10),c=parseInt(g[3],10),f=parseInt(g[4],10),p=parseInt(g[5],10),d=parseInt(g[6],10),o=yn(n,u,l,a,c,f,p,d)),e(o)})):e(o)),(ut||ct||ft)&&(m="netstat -ibndI "+n,Ie(m,function(h,y){if(!h){g=y.toString().split(`
256
+ `);for(let w=1;w<g.length;w++){const v=g[w].replace(/ +/g," ").split(" ");v&&v[0]&&v[7]&&v[10]&&(u=u+parseInt(v[7]),v[6].trim()!=="-"&&(c=c+parseInt(v[6])),v[5].trim()!=="-"&&(f=f+parseInt(v[5])),l=l+parseInt(v[10]),v[12].trim()!=="-"&&(p=p+parseInt(v[12])),v[9].trim()!=="-"&&(d=d+parseInt(v[9])),a="up")}o=yn(n,u,l,a,c,f,p,d)}e(o)})),Xe&&(m="ifconfig "+n+' | grep "status"',Ie(m,function(h,y){o.operstate=(y.toString().split(":")[1]||"").trim(),o.operstate=(o.operstate||"").toLowerCase(),o.operstate=o.operstate==="active"?"up":o.operstate==="inactive"?"down":"unknown",m="netstat -bdI "+n,Ie(m,function(w,v){if(!w&&(g=v.toString().split(`
257
+ `),g.length>1&&g[1].trim()!=="")){S=g[1].replace(/ +/g," ").split(" ");const x=S.length>11?1:0;u=parseInt(S[x+5]),c=parseInt(S[x+10]),f=parseInt(S[x+4]),l=parseInt(S[x+8]),p=parseInt(S[x+10]),d=parseInt(S[x+7]),o=yn(n,u,l,o.operstate,c,f,p,d)}e(o)})})),Ar){let h=[],y=n;j.powerShell("Get-CimInstance Win32_PerfRawData_Tcpip_NetworkInterface | select Name,BytesReceivedPersec,PacketsReceivedErrors,PacketsReceivedDiscarded,BytesSentPersec,PacketsOutboundErrors,PacketsOutboundDiscarded | fl").then((w,v)=>{if(!v){const x=w.toString().split(/\n\s*\n/);h=r(x)}Is(!1).then(x=>{u=0,l=0,h.forEach(z=>{x.forEach(R=>{(R.iface.toLowerCase()===n.toLowerCase()||R.mac.toLowerCase()===n.toLowerCase()||R.ip4.toLowerCase()===n.toLowerCase()||R.ip6.toLowerCase()===n.toLowerCase()||R.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()===n.replace(/[()[\] ]+/g,"").replace("#","_").toLowerCase())&&R.ifaceName.replace(/[()[\] ]+/g,"").replace(/#|\//g,"_").toLowerCase()===z.name&&(y=R.iface,u=z.rx_bytes,c=z.rx_dropped,f=z.rx_errors,l=z.tx_bytes,p=z.tx_dropped,d=z.tx_errors,a=R.operstate)})}),u&&l&&(o=yn(y,parseInt(u),parseInt(l),a,c,f,p,d)),e(o)})})}}else o.rx_bytes=te[n].rx_bytes,o.tx_bytes=te[n].tx_bytes,o.rx_sec=te[n].rx_sec,o.tx_sec=te[n].tx_sec,o.ms=te[n].last_ms,o.operstate=te[n].operstate,e(o)})})}$t.networkStats=mo;function Dc(t,r){let e="";t.forEach(i=>{const s=i.split(" ");(parseInt(s[0],10)||-1)===r&&(s.shift(),e=s.join(" ").split(":")[0])}),e=e.split(" -")[0];const n=e.split("/");return n[n.length-1]}function Rc(t){return new Promise(r=>{process.nextTick(()=>{let e=[];if(ze||ut||ct||ft){let n='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';(ut||ct||ft)&&(n='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'),Ie(n,{maxBuffer:1024*2e4},function(i,s){let o=s.toString().split(`
258
+ `);!i&&(o.length>1||o[0]!="")?(o.forEach(function(a){if(a=a.replace(/ +/g," ").split(" "),a.length>=7){let u=a[3],l="",c=a[3].split(":");c.length>1&&(l=c[c.length-1],c.pop(),u=c.join(":"));let f=a[4],p="",d=a[4].split(":");d.length>1&&(p=d[d.length-1],d.pop(),f=d.join(":"));let m=a[5],g=a[6].split("/");m&&e.push({protocol:a[0],localAddress:u,localPort:l,peerAddress:f,peerPort:p,state:m,pid:g[0]&&g[0]!=="-"?parseInt(g[0],10):null,process:g[1]?g[1].split(" ")[0].split(":")[0]:""})}}),t&&t(e),r(e)):(n='ss -tunap | grep "ESTAB\\|SYN-SENT\\|SYN-RECV\\|FIN-WAIT1\\|FIN-WAIT2\\|TIME-WAIT\\|CLOSE\\|CLOSE-WAIT\\|LAST-ACK\\|LISTEN\\|CLOSING"',Ie(n,{maxBuffer:1024*2e4},function(a,u){a||u.toString().split(`
259
+ `).forEach(function(c){if(c=c.replace(/ +/g," ").split(" "),c.length>=6){let f=c[4],p="",d=c[4].split(":");d.length>1&&(p=d[d.length-1],d.pop(),f=d.join(":"));let m=c[5],g="",S=c[5].split(":");S.length>1&&(g=S[S.length-1],S.pop(),m=S.join(":"));let h=c[1];h==="ESTAB"&&(h="ESTABLISHED"),h==="TIME-WAIT"&&(h="TIME_WAIT");let y=null,w="";if(c.length>=7&&c[6].indexOf("users:")>-1){let v=c[6].replace('users:(("',"").replace(/"/g,"").split(",");v.length>2&&(w=v[0].split(" ")[0].split(":")[0],y=parseInt(v[1],10))}h&&e.push({protocol:c[0],localAddress:f,localPort:p,peerAddress:m,peerPort:g,state:h,pid:y,process:w})}}),t&&t(e),r(e)}))})}if(Xe){let n='netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"';const i="ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN";Ie(n,{maxBuffer:1024*2e4},function(s,o){s||Ie("ps -axo pid,command",{maxBuffer:1024*2e4},function(a,u){let l=u.toString().split(`
260
+ `);l=l.map(f=>f.trim().replace(/ +/g," ")),o.toString().split(`
261
+ `).forEach(function(f){if(f=f.replace(/ +/g," ").split(" "),f.length>=8){let p=f[3],d="",m=f[3].split(".");m.length>1&&(d=m[m.length-1],m.pop(),p=m.join("."));let g=f[4],S="",h=f[4].split(".");h.length>1&&(S=h[h.length-1],h.pop(),g=h.join("."));const y=i.indexOf(f[5])>=0;let w=y?f[5]:"UNKNOWN",v=parseInt(f[8+(y?0:-1)],10);w&&e.push({protocol:f[0],localAddress:p,localPort:d,peerAddress:g,peerPort:S,state:w,pid:v,process:Dc(l,v)})}}),t&&t(e),r(e)})})}if(Ar){let n="netstat -nao";try{Ie(n,j.execOptsWin,function(i,s){i||(s.toString().split(`\r
262
+ `).forEach(function(a){if(a=a.trim().replace(/ +/g," ").split(" "),a.length>=4){let u=a[1],l="",c=a[1].split(":");c.length>1&&(l=c[c.length-1],c.pop(),u=c.join(":")),u=u.replace(/\[/g,"").replace(/\]/g,"");let f=a[2],p="",d=a[2].split(":");d.length>1&&(p=d[d.length-1],d.pop(),f=d.join(":")),f=f.replace(/\[/g,"").replace(/\]/g,"");let m=j.toInt(a[4]),g=a[3];g==="HERGESTELLT"&&(g="ESTABLISHED"),g.startsWith("ABH")&&(g="LISTEN"),g==="SCHLIESSEN_WARTEN"&&(g="CLOSE_WAIT"),g==="WARTEND"&&(g="TIME_WAIT"),g==="SYN_GESENDET"&&(g="SYN_SENT"),g==="LISTENING"&&(g="LISTEN"),g==="SYN_RECEIVED"&&(g="SYN_RECV"),g==="FIN_WAIT_1"&&(g="FIN_WAIT1"),g==="FIN_WAIT_2"&&(g="FIN_WAIT2"),a[0].toLowerCase()!=="udp"&&g?e.push({protocol:a[0].toLowerCase(),localAddress:u,localPort:l,peerAddress:f,peerPort:p,state:g,pid:m,process:""}):a[0].toLowerCase()==="udp"&&e.push({protocol:a[0].toLowerCase(),localAddress:u,localPort:l,peerAddress:f,peerPort:p,state:"",pid:parseInt(a[3],10),process:""})}}),t&&t(e),r(e))})}catch{t&&t(e),r(e)}}})})}$t.networkConnections=Rc;function Mc(t){return new Promise(r=>{process.nextTick(()=>{let e="";if(ze||ut||ct||ft){let n="ip route get 1";try{Ie(n,{maxBuffer:1024*2e4},function(i,s){if(i)t&&t(e),r(e);else{let o=s.toString().split(`
263
+ `),u=(o&&o[0]?o[0]:"").split(" via ");u&&u[1]&&(u=u[1].split(" "),e=u[0]),t&&t(e),r(e)}})}catch{t&&t(e),r(e)}}if(Xe){let n="route -n get default";try{Ie(n,{maxBuffer:1024*2e4},function(i,s){if(!i){const o=s.toString().split(`
264
+ `).map(a=>a.trim());e=j.getValue(o,"gateway")}e?(t&&t(e),r(e)):(n="netstat -rn | awk '/default/ {print $2}'",Ie(n,{maxBuffer:1024*2e4},function(o,a){e=a.toString().split(`
265
+ `).map(l=>l.trim()).find(l=>/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(l)),t&&t(e),r(e)}))})}catch{t&&t(e),r(e)}}if(Ar)try{Ie("netstat -r",j.execOptsWin,function(n,i){i.toString().split(gn.EOL).forEach(o=>{if(o=o.replace(/\s+/g," ").trim(),o.indexOf("0.0.0.0 0.0.0.0")>-1&&!/[a-zA-Z]/.test(o)){const a=o.split(" ");a.length>=5&&a[a.length-3].indexOf(".")>-1&&(e=a[a.length-3])}}),e?(t&&t(e),r(e)):j.powerShell("Get-CimInstance -ClassName Win32_IP4RouteTable | Where-Object { $_.Destination -eq '0.0.0.0' -and $_.Mask -eq '0.0.0.0' }").then(o=>{let a=o.toString().split(`\r
266
+ `);a.length>1&&!e&&(e=j.getValue(a,"NextHop"),t&&t(e),r(e))})})}catch{t&&t(e),r(e)}})})}$t.networkGatewayDefault=Mc;var Sn={};const br=M,wn=M.exec,pt=M.execSync,T=W;let vn=process.platform;const _s=vn==="linux"||vn==="android",Es=vn==="darwin",Os=vn==="win32";function ho(t){return parseFloat(t)/2-100}function go(t){const r=2*(parseFloat(t)+100);return r<=100?r:100}const Nr={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 $r(t){return{}.hasOwnProperty.call(Nr,t)?Nr[t]:null}function Bc(t){let r=0;for(let e in Nr)({}).hasOwnProperty.call(Nr,e)&&Nr[e]===t&&(r=T.toInt(e));return r}function yo(){const t=[],r="iw dev 2>/dev/null";try{const n=pt(r).toString().split(`
267
+ `).map(i=>i.trim()).join(`
268
+ `).split(`
269
+ Interface `);return n.shift(),n.forEach(i=>{const s=i.split(`
270
+ `),o=s[0],a=T.toInt(T.getValue(s,"ifindex"," ")),u=T.getValue(s,"addr"," "),l=T.toInt(T.getValue(s,"channel"," "));t.push({id:a,iface:o,mac:u,channel:l})}),t}catch{try{const i=pt("nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null").toString().split(`
271
+
272
+ `);let s=1;return i.forEach(o=>{const a=o.split(`
273
+ `),u=T.getValue(a,"GENERAL.DEVICE"),l=T.getValue(a,"GENERAL.TYPE"),c=s++,f=T.getValue(a,"GENERAL.HWADDR"),p="";l.toLowerCase()==="wifi"&&t.push({id:c,iface:u,mac:f,channel:p})}),t}catch{return[]}}}function So(t){const r=`nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${t} 2>/dev/null`;try{const e=pt(r).toString().split(`
274
+ `),n=T.getValue(e,"GENERAL.CONNECTION");return{iface:t,type:T.getValue(e,"GENERAL.TYPE"),vendor:T.getValue(e,"GENERAL.VENDOR"),product:T.getValue(e,"GENERAL.PRODUCT"),mac:T.getValue(e,"GENERAL.HWADDR").toLowerCase(),ssid:n!=="--"?n:null}}catch{return{}}}function Fc(t){const r=`nmcli -t --show-secrets connection show ${t} 2>/dev/null`;try{const e=pt(r).toString().split(`
275
+ `),n=T.getValue(e,"802-11-wireless.seen-bssids").toLowerCase();return{ssid:t!=="--"?t:null,uuid:T.getValue(e,"connection.uuid"),type:T.getValue(e,"connection.type"),autoconnect:T.getValue(e,"connection.autoconnect")==="yes",security:T.getValue(e,"802-11-wireless-security.key-mgmt"),bssid:n!=="--"?n:null}}catch{return{}}}function Wc(t){if(!t)return{};const r=`wpa_cli -i ${t} status 2>&1`;try{const e=pt(r).toString().split(`
276
+ `),n=T.toInt(T.getValue(e,"freq","="));return{ssid:T.getValue(e,"ssid","="),uuid:T.getValue(e,"uuid","="),security:T.getValue(e,"key_mgmt","="),freq:n,channel:Bc(n),bssid:T.getValue(e,"bssid","=").toLowerCase()}}catch{return{}}}function wo(){const t=[],r="nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null";try{const n=pt(r,{maxBuffer:2048e4}).toString().split("ACTIVE:");return n.shift(),n.forEach(i=>{i="ACTIVE:"+i;const s=i.split(br.EOL),o=T.getValue(s,"CHAN"),a=T.getValue(s,"FREQ").toLowerCase().replace("mhz","").trim(),u=T.getValue(s,"SECURITY").replace("(","").replace(")",""),l=T.getValue(s,"WPA-FLAGS").replace("(","").replace(")",""),c=T.getValue(s,"RSN-FLAGS").replace("(","").replace(")","");t.push({ssid:T.getValue(s,"SSID"),bssid:T.getValue(s,"BSSID").toLowerCase(),mode:T.getValue(s,"MODE"),channel:o?parseInt(o,10):null,frequency:a?parseInt(a,10):null,signalLevel:ho(T.getValue(s,"SIGNAL")),quality:parseFloat(T.getValue(s,"SIGNAL")),security:u&&u!=="none"?u.split(" "):[],wpaFlags:l&&l!=="none"?l.split(" "):[],rsnFlags:c&&c!=="none"?c.split(" "):[]})}),t}catch{return[]}}function vo(t){const r=[];try{let e=pt(`export LC_ALL=C; iwlist ${t} scan 2>&1; unset LC_ALL`).toString().split(" Cell ");return e[0].indexOf("resource busy")>=0?-1:(e.length>1&&(e.shift(),e.forEach(n=>{const i=n.split(`
277
+ `),s=T.getValue(i,"channel",":",!0),o=i&&i.length&&i[0].indexOf("Address:")>=0?i[0].split("Address:")[1].trim().toLowerCase():"",a=T.getValue(i,"mode",":",!0),u=T.getValue(i,"frequency",":",!0),c=T.getValue(i,"Quality","=",!0).toLowerCase().split("signal level="),f=c.length>1?T.toInt(c[1]):0,p=f?go(f):0,d=T.getValue(i,"essid",":",!0),m=n.indexOf(" WPA ")>=0,g=n.indexOf("WPA2 ")>=0,S=[];m&&S.push("WPA"),g&&S.push("WPA2");const h=[];let y="";i.forEach(function(w){const v=w.trim().toLowerCase();if(v.indexOf("group cipher")>=0){y&&h.push(y);const x=v.split(":");x.length>1&&(y=x[1].trim().toUpperCase())}if(v.indexOf("pairwise cipher")>=0){const x=v.split(":");x.length>1&&(x[1].indexOf("tkip")?y=y?"TKIP/"+y:"TKIP":x[1].indexOf("ccmp")?y=y?"CCMP/"+y:"CCMP":x[1].indexOf("proprietary")&&(y=y?"PROP/"+y:"PROP"))}if(v.indexOf("authentication suites")>=0){const x=v.split(":");x.length>1&&(x[1].indexOf("802.1x")?y=y?"802.1x/"+y:"802.1x":x[1].indexOf("psk")&&(y=y?"PSK/"+y:"PSK"))}}),y&&h.push(y),r.push({ssid:d,bssid:o,mode:a,channel:s?T.toInt(s):null,frequency:u?T.toInt(u.replace(".","")):null,signalLevel:f,quality:p,security:S,wpaFlags:h,rsnFlags:[]})})),r)}catch{return-1}}function Gc(t){const r=[];return t&&t.forEach(function(e){const n=e.RSSI;let i=[],s=[],o=e.SSID_STR||"";if(e.WPA_IE&&(i.push("WPA"),e.WPA_IE.IE_KEY_WPA_UCIPHERS&&e.WPA_IE.IE_KEY_WPA_UCIPHERS.forEach(function(a){a===0&&s.indexOf("unknown/TKIP")===-1&&s.push("unknown/TKIP"),a===2&&s.indexOf("PSK/TKIP")===-1&&s.push("PSK/TKIP"),a===4&&s.indexOf("PSK/AES")===-1&&s.push("PSK/AES")})),e.RSN_IE&&(i.push("WPA2"),e.RSN_IE.IE_KEY_RSN_UCIPHERS&&e.RSN_IE.IE_KEY_RSN_UCIPHERS.forEach(function(a){a===0&&s.indexOf("unknown/TKIP")===-1&&s.push("unknown/TKIP"),a===2&&s.indexOf("TKIP/TKIP")===-1&&s.push("TKIP/TKIP"),a===4&&s.indexOf("PSK/AES")===-1&&s.push("PSK/AES")})),e.SSID&&o==="")try{o=Buffer.from(e.SSID,"base64").toString("utf8")}catch{T.noop()}r.push({ssid:o,bssid:e.BSSID||"",mode:"",channel:e.CHANNEL,frequency:$r(e.CHANNEL),signalLevel:n?parseInt(n,10):null,quality:go(n),security:i,wpaFlags:s,rsnFlags:[]})}),r}function Uc(t){return new Promise(r=>{process.nextTick(()=>{let e=[];if(_s)if(e=wo(),e.length===0)try{const n=pt("export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL").toString().split(`
278
+
279
+ `);let i="";if(n.forEach(s=>{s.indexOf("no wireless")===-1&&s.trim()!==""&&(i=s.split(" ")[0])}),i){let s="";const o=T.isPrototypePolluted()?"---":T.sanitizeShellString(i,!0),a=T.mathMin(o.length,2e3);for(let l=0;l<=a;l++)o[l]!==void 0&&(s=s+o[l]);const u=vo(s);u===-1?setTimeout(function(l){const c=vo(l);c!=-1&&(e=c),t&&t(e),r(e)},4e3):(e=u,t&&t(e),r(e))}else t&&t(e),r(e)}catch{t&&t(e),r(e)}else t&&t(e),r(e);else if(Es)wn("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x",{maxBuffer:1024*4e4},function(i,s){const o=s.toString();e=Gc(T.plistParser(o)),t&&t(e),r(e)});else if(Os){let n="netsh wlan show networks mode=Bssid";T.powerShell(n).then(i=>{const s=i.toString("utf8").split(br.EOL+br.EOL+"SSID ");s.shift(),s.forEach(o=>{const a=o.split(br.EOL);if(a&&a.length>=8&&a[0].indexOf(":")>=0){const u=o.split(" BSSID");u.shift(),u.forEach(l=>{const c=l.split(br.EOL),f=c[0].split(":");f.shift();const p=f.join(":").trim().toLowerCase(),d=c[3].split(":").pop().trim(),m=c[1].split(":").pop().trim();e.push({ssid:a[0].split(":").pop().trim(),bssid:p,mode:"",channel:d?parseInt(d,10):null,frequency:$r(d),signalLevel:ho(m),quality:m?parseInt(m,10):null,security:[a[2].split(":").pop().trim()],wpaFlags:[a[3].split(":").pop().trim()],rsnFlags:[]})})}}),t&&t(e),r(e)})}else t&&t(e),r(e)})})}Sn.wifiNetworks=Uc;function jc(t){t=t.toLowerCase();let r="";return t.indexOf("intel")>=0?r="Intel":t.indexOf("realtek")>=0?r="Realtek":t.indexOf("qualcom")>=0?r="Qualcom":t.indexOf("broadcom")>=0?r="Broadcom":t.indexOf("cavium")>=0?r="Cavium":t.indexOf("cisco")>=0?r="Cisco":t.indexOf("marvel")>=0?r="Marvel":t.indexOf("zyxel")>=0?r="Zyxel":t.indexOf("melanox")>=0?r="Melanox":t.indexOf("d-link")>=0?r="D-Link":t.indexOf("tp-link")>=0?r="TP-Link":t.indexOf("asus")>=0?r="Asus":t.indexOf("linksys")>=0&&(r="Linksys"),r}function Hc(t){return new Promise(r=>{process.nextTick(()=>{const e=[];if(_s){const n=yo(),i=wo();n.forEach(s=>{let o="";const a=T.isPrototypePolluted()?"---":T.sanitizeShellString(s.iface,!0),u=T.mathMin(a.length,2e3);for(let w=0;w<=u;w++)a[w]!==void 0&&(o=o+a[w]);const l=So(o),c=Wc(o),f=l.ssid||c.ssid,p=i.filter(w=>w.ssid===f);let d="";const m=T.isPrototypePolluted()?"---":T.sanitizeShellString(f,!0),g=T.mathMin(m.length,2e3);for(let w=0;w<=g;w++)m[w]!==void 0&&(d=d+m[w]);const S=Fc(d),h=p&&p.length&&p[0].channel?p[0].channel:c.channel?c.channel:null,y=p&&p.length&&p[0].bssid?p[0].bssid:c.bssid?c.bssid:null;f&&y&&e.push({id:s.id,iface:s.iface,model:l.product,ssid:f,bssid:p&&p.length&&p[0].bssid?p[0].bssid:c.bssid?c.bssid:null,channel:h,frequency:h?$r(h):null,type:S.type?S.type:"802.11",security:S.security?S.security:c.security?c.security:null,signalLevel:p&&p.length&&p[0].signalLevel?p[0].signalLevel:null,txRate:null})}),t&&t(e),r(e)}else if(Es){let n="system_profiler SPNetworkDataType";wn(n,function(i,s){const o=s.toString().split(`
280
+
281
+ Wi-Fi:
282
+
283
+ `);if(o.length>1){const a=o[1].split(`
284
+
285
+ `)[0].split(`
286
+ `),u=T.getValue(a,"BSD Device Name",":",!0),l=T.getValue(a,"hardware",":",!0);n="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I",wn(n,function(c,f){const p=f.toString().split(`
287
+ `);if(a.length>10){const d=T.getValue(p,"ssid",":",!0),m=T.getValue(p,"bssid",":",!0),g=T.getValue(p,"link auth",":",!0),S=T.getValue(p,"lastTxRate",":",!0),h=T.getValue(p,"channel",":",!0).split(",")[0],y="802.11",w=T.toInt(T.getValue(p,"agrCtlRSSI",":",!0)),v=T.toInt(T.getValue(p,"agrCtlNoise",":",!0)),x=w-v;(d||m)&&e.push({id:"Wi-Fi",iface:u,model:l,ssid:d,bssid:m,channel:T.toInt(h),frequency:h?$r(h):null,type:y,security:g,signalLevel:x,txRate:S})}t&&t(e),r(e)})}else t&&t(e),r(e)})}else if(Os){let n="netsh wlan show interfaces";T.powerShell(n).then(function(i){const s=i.toString().split(`\r
288
+ `);for(let a=0;a<s.length;a++)s[a]=s[a].trim();const o=s.join(`\r
289
+ `).split(`:\r
290
+ \r
291
+ `);o.shift(),o.forEach(a=>{const u=a.split(`\r
292
+ `);if(u.length>=5){const l=u[0].indexOf(":")>=0?u[0].split(":")[1].trim():"",c=u[1].indexOf(":")>=0?u[1].split(":")[1].trim():"",f=u[2].indexOf(":")>=0?u[2].split(":")[1].trim():"",p=T.getValue(u,"SSID",":",!0),d=T.getValue(u,"BSSID",":",!0),m=T.getValue(u,"Signal",":",!0),g=T.getValue(u,"Radio type",":",!0)||T.getValue(u,"Type de radio",":",!0)||T.getValue(u,"Funktyp",":",!0)||null,S=T.getValue(u,"authentication",":",!0)||T.getValue(u,"Authentification",":",!0)||T.getValue(u,"Authentifizierung",":",!0)||null,h=T.getValue(u,"Channel",":",!0)||T.getValue(u,"Canal",":",!0)||T.getValue(u,"Kanal",":",!0)||null,y=T.getValue(u,"Transmit rate (mbps)",":",!0)||T.getValue(u,"Transmission (mbit/s)",":",!0)||T.getValue(u,"Empfangsrate (MBit/s)",":",!0)||null;c&&f&&p&&d&&e.push({id:f,iface:l,model:c,ssid:p,bssid:d,channel:T.toInt(h),frequency:h?$r(h):null,type:g,security:S,signalLevel:m,txRate:T.toInt(y)||null})}}),t&&t(e),r(e)})}else t&&t(e),r(e)})})}Sn.wifiConnections=Hc;function zc(t){return new Promise(r=>{process.nextTick(()=>{const e=[];if(_s)yo().forEach(i=>{const s=So(i.iface);e.push({id:i.id,iface:i.iface,model:s.product?s.product:null,vendor:s.vendor?s.vendor:null,mac:i.mac})}),t&&t(e),r(e);else if(Es)wn("system_profiler SPNetworkDataType",function(i,s){const o=s.toString().split(`
293
+
294
+ Wi-Fi:
295
+
296
+ `);if(o.length>1){const a=o[1].split(`
297
+
298
+ `)[0].split(`
299
+ `),u=T.getValue(a,"BSD Device Name",":",!0),l=T.getValue(a,"MAC Address",":",!0),c=T.getValue(a,"hardware",":",!0);e.push({id:"Wi-Fi",iface:u,model:c,vendor:"",mac:l})}t&&t(e),r(e)});else if(Os){let n="netsh wlan show interfaces";T.powerShell(n).then(function(i){const s=i.toString().split(`\r
300
+ `);for(let a=0;a<s.length;a++)s[a]=s[a].trim();const o=s.join(`\r
301
+ `).split(`:\r
302
+ \r
303
+ `);o.shift(),o.forEach(a=>{const u=a.split(`\r
304
+ `);if(u.length>=5){const l=u[0].indexOf(":")>=0?u[0].split(":")[1].trim():"",c=u[1].indexOf(":")>=0?u[1].split(":")[1].trim():"",f=u[2].indexOf(":")>=0?u[2].split(":")[1].trim():"",p=u[3].indexOf(":")>=0?u[3].split(":"):[];p.shift();const d=p.join(":").trim(),m=jc(c);l&&c&&f&&d&&e.push({id:f,iface:l,model:c,vendor:m,mac:d})}}),t&&t(e),r(e)})}else t&&t(e),r(e)})})}Sn.wifiInterfaces=zc;var xn={};const Cn=M,Xc=M,kc=M,Dr=M.exec,Ls=M.execSync,J=W;let dt=process.platform;const ke=dt==="linux"||dt==="android",Mt=dt==="darwin",Ps=dt==="win32",Rr=dt==="freebsd",Mr=dt==="openbsd",Br=dt==="netbsd",In=dt==="sunos",pe={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},ir={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},xe={all:0,all_utime:0,all_stime:0,list:{},ms:0,result:{}},xo={0:"unknown",1:"other",2:"ready",3:"running",4:"blocked",5:"suspended blocked",6:"suspended ready",7:"terminated",8:"stopped",9:"growing"};function qc(t){let r=t,e=t.replace(/ +/g," ").split(" ");return e.length===5&&(r=e[4]+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(e[1].toUpperCase())/3+1)).slice(-2)+"-"+("0"+e[2]).slice(-2)+" "+e[3]),r}function Kc(t){let r=new Date;r=new Date(r.getTime()-r.getTimezoneOffset()*6e4);const e=t.split("-"),n=e.length-1,i=n>0?parseInt(e[n-1]):0,s=e[n].split(":"),o=s.length===3?parseInt(s[0]||0):0,a=parseInt(s[s.length===3?1:0]||0),u=parseInt(s[s.length===3?2:1]||0),l=(((i*24+o)*60+a)*60+u)*1e3;let c=new Date(r.getTime()),f=c.toISOString().substring(0,10)+" "+c.toISOString().substring(11,19);try{c=new Date(r.getTime()-l),f=c.toISOString().substring(0,10)+" "+c.toISOString().substring(11,19)}catch{J.noop()}return f}function Yc(t,r){return J.isFunction(t)&&!r&&(r=t,t=""),new Promise(e=>{process.nextTick(()=>{if(typeof t!="string")return r&&r([]),e([]);if(t){let n="";n.__proto__.toLowerCase=J.stringToLower,n.__proto__.replace=J.stringReplace,n.__proto__.trim=J.stringTrim;const i=J.sanitizeShellString(t),s=J.mathMin(i.length,2e3);for(let l=0;l<=s;l++)i[l]!==void 0&&(n=n+i[l]);n=n.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),n===""&&(n="*"),J.isPrototypePolluted()&&n!=="*"&&(n="------");let o=n.split("|"),a=[],u=[];if(ke||Rr||Mr||Br||Mt){if((ke||Rr||Mr||Br)&&n==="*")try{const c=Ls("systemctl --all --type=service --no-legend 2> /dev/null").toString().split(`
305
+ `);o=[];for(const f of c){const p=f.split(".service")[0];p&&f.indexOf(" not-found ")===-1&&o.push(p.trim())}n=o.join("|")}catch{try{n="";const f=Ls("service --status-all 2> /dev/null").toString().split(`
306
+ `);for(const p of f){const d=p.split("]");d.length===2&&(n+=(n!==""?"|":"")+d[1].trim())}o=n.split("|")}catch{try{const p=Ls("ls /etc/init.d/ -m 2> /dev/null").toString().split(`
307
+ `).join("");if(n="",p){const d=p.split(",");for(const m of d){const g=m.trim();g&&(n+=(n!==""?"|":"")+g)}o=n.split("|")}}catch{n="",o=[]}}}Mt&&n==="*"&&(r&&r(a),e(a));let l=Mt?["-caxo","pcpu,pmem,pid,command"]:["-axo","pcpu,pmem,pid,command"];n!==""&&o.length>0?J.execSafe("ps",l).then(c=>{if(c){let f=c.replace(/ +/g," ").replace(/,+/g,".").split(`
308
+ `);if(o.forEach(function(p){let d;Mt?d=f.filter(function(g){return g.toLowerCase().indexOf(p)!==-1}):d=f.filter(function(g){return g.toLowerCase().indexOf(" "+p.toLowerCase()+":")!==-1||g.toLowerCase().indexOf("/"+p.toLowerCase())!==-1});const m=[];for(const g of d){const S=g.trim().split(" ")[2];S&&m.push(parseInt(S,10))}a.push({name:p,running:d.length>0,startmode:"",pids:m,cpu:parseFloat(d.reduce(function(g,S){return g+parseFloat(S.trim().split(" ")[0])},0).toFixed(2)),mem:parseFloat(d.reduce(function(g,S){return g+parseFloat(S.trim().split(" ")[1])},0).toFixed(2))})}),ke){let p='cat /proc/stat | grep "cpu "';for(let d in a)for(let m in a[d].pids)p+=";cat /proc/"+a[d].pids[m]+"/stat";Dr(p,{maxBuffer:1024*2e4},function(d,m){let g=m.toString().split(`
309
+ `),S=Ts(g.shift()),h={},y={};g.forEach(w=>{if(y=Vs(w,S,ir),y.pid){let v=-1;for(let x in a)for(let z in a[x].pids)parseInt(a[x].pids[z])===parseInt(y.pid)&&(v=x);v>=0&&(a[v].cpu+=y.cpuu+y.cpus),h[y.pid]={cpuu:y.cpuu,cpus:y.cpus,utime:y.utime,stime:y.stime,cutime:y.cutime,cstime:y.cstime}}}),ir.all=S,ir.list=Object.assign({},h),ir.ms=Date.now()-ir.ms,ir.result=Object.assign({},a),r&&r(a),e(a)})}else r&&r(a),e(a)}else l=["-o","comm"],J.execSafe("ps",l).then(f=>{if(f){let p=f.replace(/ +/g," ").replace(/,+/g,".").split(`
310
+ `);o.forEach(function(d){let m=p.filter(function(g){return g.indexOf(d)!==-1});a.push({name:d,running:m.length>0,startmode:"",cpu:0,mem:0})}),r&&r(a),e(a)}else o.forEach(function(p){a.push({name:p,running:!1,startmode:"",cpu:0,mem:0})}),r&&r(a),e(a)})}):(r&&r(a),e(a))}if(Ps)try{let l="Get-CimInstance Win32_Service";o[0]!=="*"&&(l+=' -Filter "',o.forEach(c=>{l+=`Name='${c}' or `}),l=`${l.slice(0,-4)}"`),l+=" | select Name,Caption,Started,StartMode,ProcessId | fl",J.powerShell(l).then((c,f)=>{f?(o.forEach(function(p){a.push({name:p,running:!1,startmode:"",cpu:0,mem:0})}),r&&r(a),e(a)):(c.split(/\n\s*\n/).forEach(d=>{if(d.trim()!==""){let m=d.trim().split(`\r
311
+ `),g=J.getValue(m,"Name",":",!0).toLowerCase(),S=J.getValue(m,"Caption",":",!0).toLowerCase(),h=J.getValue(m,"Started",":",!0),y=J.getValue(m,"StartMode",":",!0),w=J.getValue(m,"ProcessId",":",!0);(n==="*"||o.indexOf(g)>=0||o.indexOf(S)>=0)&&(a.push({name:g,running:h.toLowerCase()==="true",startmode:y,pids:[w],cpu:0,mem:0}),u.push(g),u.push(S))}}),n!=="*"&&o.filter(function(m){return u.indexOf(m)===-1}).forEach(function(m){a.push({name:m,running:!1,startmode:"",pids:[],cpu:0,mem:0})}),r&&r(a),e(a))})}catch{r&&r(a),e(a)}}else r&&r([]),e([])})})}xn.services=Yc;function Ts(t){let r=t.replace(/ +/g," ").split(" "),e=r.length>=2?parseInt(r[1]):0,n=r.length>=3?parseInt(r[2]):0,i=r.length>=4?parseInt(r[3]):0,s=r.length>=5?parseInt(r[4]):0,o=r.length>=6?parseInt(r[5]):0,a=r.length>=7?parseInt(r[6]):0,u=r.length>=8?parseInt(r[7]):0,l=r.length>=9?parseInt(r[8]):0,c=r.length>=10?parseInt(r[9]):0,f=r.length>=11?parseInt(r[10]):0;return e+n+i+s+o+a+u+l+c+f}function Vs(t,r,e){let n=t.replace(/ +/g," ").split(")");if(n.length>=2){let i=n[1].split(" ");if(i.length>=16){let s=parseInt(n[0].split(" ")[0]),o=parseInt(i[12]),a=parseInt(i[13]),u=parseInt(i[14]),l=parseInt(i[15]),c=0,f=0;return e.all>0&&e.list[s]?(c=(o+u-e.list[s].utime-e.list[s].cutime)/(r-e.all)*100,f=(a+l-e.list[s].stime-e.list[s].cstime)/(r-e.all)*100):(c=(o+u)/r*100,f=(a+l)/r*100),{pid:s,utime:o,stime:a,cutime:u,cstime:l,cpuu:c,cpus:f}}else return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}else return{pid:0,utime:0,stime:0,cutime:0,cstime:0,cpuu:0,cpus:0}}function Co(t,r,e){let n=0,i=0;return e.all>0&&e.list[t.pid]?(n=(t.utime-e.list[t.pid].utime)/(r-e.all)*100,i=(t.stime-e.list[t.pid].stime)/(r-e.all)*100):(n=t.utime/r*100,i=t.stime/r*100),{pid:t.pid,utime:t.utime,stime:t.stime,cpuu:n>0?n:0,cpus:i>0?i:0}}function Jc(t){let r=[];function e(o){o=o||"";let a=o.split(" ")[0];if(a.substr(-1)===":"&&(a=a.substr(0,a.length-1)),a.substr(0,1)!=="["){let u=a.split("/");isNaN(parseInt(u[u.length-1]))?a=u[u.length-1]:a=u[0]}return a}function n(o){let a=0,u=0;function l(Y){a=u,r[Y]?u=o.substring(r[Y].to+a,1e4).indexOf(" "):u=1e4}l(0);const c=parseInt(o.substring(r[0].from+a,r[0].to+u));l(1);const f=parseInt(o.substring(r[1].from+a,r[1].to+u));l(2);const p=parseFloat(o.substring(r[2].from+a,r[2].to+u).replace(/,/g,"."));l(3);const d=parseFloat(o.substring(r[3].from+a,r[3].to+u).replace(/,/g,"."));l(4);const m=parseInt(o.substring(r[4].from+a,r[4].to+u));l(5);const g=parseInt(o.substring(r[5].from+a,r[5].to+u));l(6);const S=parseInt(o.substring(r[6].from+a,r[6].to+u));l(7);const h=parseInt(o.substring(r[7].from+a,r[7].to+u))||0;l(8);const y=In?qc(o.substring(r[8].from+a,r[8].to+u).trim()):Kc(o.substring(r[8].from+a,r[8].to+u).trim());l(9);let w=o.substring(r[9].from+a,r[9].to+u).trim();w=w[0]==="R"?"running":w[0]==="S"?"sleeping":w[0]==="T"?"stopped":w[0]==="W"?"paging":w[0]==="X"?"dead":w[0]==="Z"?"zombie":w[0]==="D"||w[0]==="U"?"blocked":"unknown",l(10);let v=o.substring(r[10].from+a,r[10].to+u).trim();(v==="?"||v==="??")&&(v=""),l(11);const x=o.substring(r[11].from+a,r[11].to+u).trim();l(12);let z="",R="",Z="",L=o.substring(r[12].from+a,r[12].to+u).trim();if(L.substr(L.length-1)==="]"&&(L=L.slice(0,-1)),L.substr(0,1)==="[")R=L.substring(1);else{const Y=L.indexOf("("),X=L.indexOf(")"),oe=L.indexOf("/"),N=L.indexOf(":");if(Y<X&&Y<oe&&oe<X)R=L.split(" ")[0],R=R.replace(/:/g,"");else if(N>0&&(oe===-1||oe>3))R=L.split(" ")[0],R=R.replace(/:/g,"");else{let P=L.indexOf(" -"),b=L.indexOf(" /");P=P>=0?P:1e4,b=b>=0?b:1e4;const G=Math.min(P,b);let O=L.substr(0,G);const V=L.substr(G),A=O.lastIndexOf("/");if(A>=0&&(z=O.substr(0,A),O=O.substr(A+1)),G===1e4&&O.indexOf(" ")>-1){const D=O.split(" ");Xc.existsSync(kc.join(z,D[0]))?(R=D.shift(),Z=(D.join(" ")+" "+V).trim()):(R=O.trim(),Z=V.trim())}else R=O.trim(),Z=V.trim()}}return{pid:c,parentPid:f,name:ke?e(R):R,cpu:p,cpuu:0,cpus:0,mem:d,priority:m,memVsz:g,memRss:S,nice:h,started:y,state:w,tty:v,user:x,command:R,params:Z,path:z}}function i(o){let a=[];if(o.length>1){let u=o[0];r=J.parseHead(u,8),o.shift(),o.forEach(function(l){l.trim()!==""&&a.push(n(l))})}return a}function s(o){function a(c){const f=("0"+(c.getMonth()+1).toString()).slice(-2),p=c.getFullYear().toString(),d=("0"+c.getDate().toString()).slice(-2),m=("0"+c.getHours().toString()).slice(-2),g=("0"+c.getMinutes().toString()).slice(-2),S=("0"+c.getSeconds().toString()).slice(-2);return p+"-"+f+"-"+d+" "+m+":"+g+":"+S}function u(c){let f="";if(c.indexOf("d")>=0){const p=c.split("d");f=a(new Date(Date.now()-(p[0]*24+p[1]*1)*60*60*1e3))}else if(c.indexOf("h")>=0){const p=c.split("h");f=a(new Date(Date.now()-(p[0]*60+p[1]*1)*60*1e3))}else if(c.indexOf(":")>=0){const p=c.split(":");f=a(new Date(Date.now()-(p.length>1?(p[0]*60+p[1])*1e3:p[0]*1e3)))}return f}let l=[];return o.forEach(function(c){if(c.trim()!==""){c=c.trim().replace(/ +/g," ").replace(/,+/g,".");const f=c.split(" "),p=f.slice(9).join(" "),d=parseFloat((1*parseInt(f[3])*1024/Cn.totalmem()).toFixed(1)),m=u(f[5]);l.push({pid:parseInt(f[0]),parentPid:parseInt(f[1]),name:e(p),cpu:0,cpuu:0,cpus:0,mem:d,priority:0,memVsz:parseInt(f[2]),memRss:parseInt(f[3]),nice:parseInt(f[4]),started:m,state:f[6]==="R"?"running":f[6]==="S"?"sleeping":f[6]==="T"?"stopped":f[6]==="W"?"paging":f[6]==="X"?"dead":f[6]==="Z"?"zombie":f[6]==="D"||f[6]==="U"?"blocked":"unknown",tty:f[7],user:f[8],command:p})}}),l}return new Promise(o=>{process.nextTick(()=>{let a={all:0,running:0,blocked:0,sleeping:0,unknown:0,list:[]},u="";if(pe.ms&&Date.now()-pe.ms>=500||pe.ms===0)if(ke||Rr||Mr||Br||Mt||In)ke&&(u="export LC_ALL=C; ps -axo pid:11,ppid:11,pcpu:6,pmem:6,pri:5,vsz:11,rss:11,ni:5,etime:30,state:5,tty:15,user:20,command; unset LC_ALL"),(Rr||Mr||Br)&&(u="export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,ni,etime,state,tty,user,command; unset LC_ALL"),Mt&&(u="ps -axo pid,ppid,pcpu,pmem,pri,vsz=temp_title_1,rss=temp_title_2,nice,etime=temp_title_3,state,tty,user,command -r"),In&&(u="ps -Ao pid,ppid,pcpu,pmem,pri,vsz,rss,nice,stime,s,tty,user,comm"),Dr(u,{maxBuffer:1024*2e4},function(l,c){!l&&c.toString().trim()?(a.list=i(c.toString().split(`
312
+ `)).slice(),a.all=a.list.length,a.running=a.list.filter(function(f){return f.state==="running"}).length,a.blocked=a.list.filter(function(f){return f.state==="blocked"}).length,a.sleeping=a.list.filter(function(f){return f.state==="sleeping"}).length,ke?(u='cat /proc/stat | grep "cpu "',a.list.forEach(f=>{u+=";cat /proc/"+f.pid+"/stat"}),Dr(u,{maxBuffer:1024*2e4},function(f,p){let d=p.toString().split(`
313
+ `),m=Ts(d.shift()),g={},S={};d.forEach(h=>{if(S=Vs(h,m,pe),S.pid){let y=a.list.map(function(w){return w.pid}).indexOf(S.pid);y>=0&&(a.list[y].cpu=S.cpuu+S.cpus,a.list[y].cpuu=S.cpuu,a.list[y].cpus=S.cpus),g[S.pid]={cpuu:S.cpuu,cpus:S.cpus,utime:S.utime,stime:S.stime,cutime:S.cutime,cstime:S.cstime}}}),pe.all=m,pe.list=Object.assign({},g),pe.ms=Date.now()-pe.ms,pe.result=Object.assign({},a),t&&t(a),o(a)})):(t&&t(a),o(a))):(u="ps -o pid,ppid,vsz,rss,nice,etime,stat,tty,user,comm",In&&(u="ps -o pid,ppid,vsz,rss,nice,etime,s,tty,user,comm"),Dr(u,{maxBuffer:1024*2e4},function(f,p){if(f)t&&t(a),o(a);else{let d=p.toString().split(`
314
+ `);d.shift(),a.list=s(d).slice(),a.all=a.list.length,a.running=a.list.filter(function(m){return m.state==="running"}).length,a.blocked=a.list.filter(function(m){return m.state==="blocked"}).length,a.sleeping=a.list.filter(function(m){return m.state==="sleeping"}).length,t&&t(a),o(a)}}))});else if(Ps)try{J.powerShell('Get-CimInstance Win32_Process | select-Object ProcessId,ParentProcessId,ExecutionState,Caption,CommandLine,ExecutablePath,UserModeTime,KernelModeTime,WorkingSetSize,Priority,PageFileUsage, @{n="CreationDate";e={$_.CreationDate.ToString("yyyy-MM-dd HH:mm:ss")}} | fl').then((l,c)=>{if(!c){let f=l.split(/\n\s*\n/),p=[],d=[],m={},g=0,S=0;f.forEach(h=>{if(h.trim()!==""){let y=h.trim().split(`\r
315
+ `),w=parseInt(J.getValue(y,"ProcessId",":",!0),10),v=parseInt(J.getValue(y,"ParentProcessId",":",!0),10),x=J.getValue(y,"ExecutionState",":"),z=J.getValue(y,"Caption",":",!0),R=J.getValue(y,"CommandLine",":",!0),Z=!1;y.forEach(N=>{Z&&N.toLowerCase().startsWith(" ")?R+=" "+N.trim():Z=!1,N.toLowerCase().startsWith("commandline")&&(Z=!0)});let L=J.getValue(y,"ExecutablePath",":",!0),Y=parseInt(J.getValue(y,"UserModeTime",":",!0),10),X=parseInt(J.getValue(y,"KernelModeTime",":",!0),10),oe=parseInt(J.getValue(y,"WorkingSetSize",":",!0),10);g=g+Y,S=S+X,a.all++,x||a.unknown++,x==="3"&&a.running++,(x==="4"||x==="5")&&a.blocked++,d.push({pid:w,utime:Y,stime:X,cpu:0,cpuu:0,cpus:0}),p.push({pid:w,parentPid:v,name:z,cpu:0,cpuu:0,cpus:0,mem:oe/Cn.totalmem()*100,priority:parseInt(J.getValue(y,"Priority",":",!0),10),memVsz:parseInt(J.getValue(y,"PageFileUsage",":",!0),10),memRss:Math.floor(parseInt(J.getValue(y,"WorkingSetSize",":",!0),10)/1024),nice:0,started:J.getValue(y,"CreationDate",":",!0),state:x?xo[x]:xo[0],tty:"",user:"",command:R||z,path:L,params:""})}}),a.sleeping=a.all-a.running-a.blocked-a.unknown,a.list=p,d.forEach(h=>{let y=Co(h,g+S,pe),w=a.list.map(function(v){return v.pid}).indexOf(y.pid);w>=0&&(a.list[w].cpu=y.cpuu+y.cpus,a.list[w].cpuu=y.cpuu,a.list[w].cpus=y.cpus),m[y.pid]={cpuu:y.cpuu,cpus:y.cpus,utime:y.utime,stime:y.stime}}),pe.all=g+S,pe.all_utime=g,pe.all_stime=S,pe.list=Object.assign({},m),pe.ms=Date.now()-pe.ms,pe.result=Object.assign({},a)}t&&t(a),o(a)})}catch{t&&t(a),o(a)}else t&&t(a),o(a);else t&&t(pe.result),o(pe.result)})})}xn.processes=Jc;function Qc(t,r){return J.isFunction(t)&&!r&&(r=t,t=""),new Promise(e=>{process.nextTick(()=>{if(t=t||"",typeof t!="string")return r&&r([]),e([]);let n="";n.__proto__.toLowerCase=J.stringToLower,n.__proto__.replace=J.stringReplace,n.__proto__.trim=J.stringTrim;const i=J.sanitizeShellString(t),s=J.mathMin(i.length,2e3);for(let l=0;l<=s;l++)i[l]!==void 0&&(n=n+i[l]);n=n.trim().toLowerCase().replace(/, /g,"|").replace(/,+/g,"|"),n===""&&(n="*"),J.isPrototypePolluted()&&n!=="*"&&(n="------");let o=n.split("|"),a=[];if((J.isPrototypePolluted()?"":J.sanitizeShellString(t))&&o.length&&o[0]!=="------"){if(Ps)try{J.powerShell("Get-CimInstance Win32_Process | select ProcessId,Caption,UserModeTime,KernelModeTime,WorkingSetSize | fl").then((l,c)=>{if(!c){let f=l.split(/\n\s*\n/),p=[],d={},m=0,g=0;f.forEach(S=>{if(S.trim()!==""){let h=S.trim().split(`\r
316
+ `),y=parseInt(J.getValue(h,"ProcessId",":",!0),10),w=J.getValue(h,"Caption",":",!0),v=parseInt(J.getValue(h,"UserModeTime",":",!0),10),x=parseInt(J.getValue(h,"KernelModeTime",":",!0),10),z=parseInt(J.getValue(h,"WorkingSetSize",":",!0),10);m=m+v,g=g+x,p.push({pid:y,name:w,utime:v,stime:x,cpu:0,cpuu:0,cpus:0,mem:z});let R="",Z=!1;if(o.forEach(function(L){w.toLowerCase().indexOf(L.toLowerCase())>=0&&!Z&&(Z=!0,R=L)}),n==="*"||Z){let L=!1;a.forEach(function(Y){Y.proc.toLowerCase()===R.toLowerCase()&&(Y.pids.push(y),Y.mem+=z/Cn.totalmem()*100,L=!0)}),L||a.push({proc:R,pid:y,pids:[y],cpu:0,mem:z/Cn.totalmem()*100})}}}),n!=="*"&&o.filter(function(h){return p.filter(function(y){return y.name.toLowerCase().indexOf(h)>=0}).length===0}).forEach(function(h){a.push({proc:h,pid:null,pids:[],cpu:0,mem:0})}),p.forEach(S=>{let h=Co(S,m+g,xe),y=-1;for(let w=0;w<a.length;w++)(a[w].pid===h.pid||a[w].pids.indexOf(h.pid)>=0)&&(y=w);y>=0&&(a[y].cpu+=h.cpuu+h.cpus),d[h.pid]={cpuu:h.cpuu,cpus:h.cpus,utime:h.utime,stime:h.stime}}),xe.all=m+g,xe.all_utime=m,xe.all_stime=g,xe.list=Object.assign({},d),xe.ms=Date.now()-xe.ms,xe.result=JSON.parse(JSON.stringify(a)),r&&r(a),e(a)}})}catch{r&&r(a),e(a)}if(Mt||ke||Rr||Mr||Br){const l=["-axo","pid,ppid,pcpu,pmem,comm"];J.execSafe("ps",l).then(c=>{if(c){let f=[];if(c.toString().split(`
317
+ `).filter(function(d){if(n==="*")return!0;if(d.toLowerCase().indexOf("grep")!==-1)return!1;let m=!1;return o.forEach(function(g){m=m||d.toLowerCase().indexOf(g.toLowerCase())>=0}),m}).forEach(function(d){let m=d.trim().replace(/ +/g," ").split(" ");m.length>4&&f.push({name:m[4].substring(m[4].lastIndexOf("/")+1),pid:parseInt(m[0])||0,ppid:parseInt(m[1])||0,cpu:parseFloat(m[2].replace(",",".")),mem:parseFloat(m[3].replace(",","."))})}),f.forEach(function(d){let m=-1,g=!1,S="";for(let h=0;h<a.length;h++)d.name.toLowerCase().indexOf(a[h].proc.toLowerCase())>=0&&(m=h);o.forEach(function(h){d.name.toLowerCase().indexOf(h.toLowerCase())>=0&&!g&&(g=!0,S=h)}),(n==="*"||g)&&(m<0?a.push({proc:S,pid:d.pid,pids:[d.pid],cpu:d.cpu,mem:d.mem}):(d.ppid<10&&(a[m].pid=d.pid),a[m].pids.push(d.pid),a[m].cpu+=d.cpu,a[m].mem+=d.mem))}),n!=="*"&&o.filter(function(m){return f.filter(function(g){return g.name.toLowerCase().indexOf(m)>=0}).length===0}).forEach(function(m){a.push({proc:m,pid:null,pids:[],cpu:0,mem:0})}),ke){a.forEach(function(m){m.cpu=0});let d='cat /proc/stat | grep "cpu "';for(let m in a)for(let g in a[m].pids)d+=";cat /proc/"+a[m].pids[g]+"/stat";Dr(d,{maxBuffer:1024*2e4},function(m,g){let S=g.toString().split(`
318
+ `),h=Ts(S.shift()),y={},w={};S.forEach(v=>{if(w=Vs(v,h,xe),w.pid){let x=-1;for(let z in a)a[z].pids.indexOf(w.pid)>=0&&(x=z);x>=0&&(a[x].cpu+=w.cpuu+w.cpus),y[w.pid]={cpuu:w.cpuu,cpus:w.cpus,utime:w.utime,stime:w.stime,cutime:w.cutime,cstime:w.cstime}}}),a.forEach(function(v){v.cpu=Math.round(v.cpu*100)/100}),xe.all=h,xe.list=Object.assign({},y),xe.ms=Date.now()-xe.ms,xe.result=Object.assign({},a),r&&r(a),e(a)})}else r&&r(a),e(a)}else r&&r(a),e(a)})}}})})}xn.processLoad=Qc;var Io={};const Fr=M.exec,mt=W;let ht=process.platform;const Zc=ht==="linux"||ht==="android",ef=ht==="darwin",tf=ht==="win32",rf=ht==="freebsd",nf=ht==="openbsd",sf=ht==="netbsd",of=ht==="sunos";function _o(t,r){let e=[],n=[],i={},s=!0,o=[],a=[],u={},l=!0;return t.forEach(function(c){if(c==="---")l=!1;else{let f=c.replace(/ +/g," ").split(" ");l?n.push({user:f[0],tty:f[1],date:f[2],time:f[3],ip:f&&f.length>4?f[4].replace(/\(/g,"").replace(/\)/g,""):""}):s?(o=f,o.forEach(function(p){a.push(c.indexOf(p))}),s=!1):(i.user=c.substring(a[0],a[1]-1).trim(),i.tty=c.substring(a[1],a[2]-1).trim(),i.ip=c.substring(a[2],a[3]-1).replace(/\(/g,"").replace(/\)/g,"").trim(),i.command=c.substring(a[7],1e3).trim(),u=n.filter(function(p){return p.user.substring(0,8).trim()===i.user&&p.tty===i.tty}),u.length===1&&e.push({user:u[0].user,tty:u[0].tty,date:u[0].date,time:u[0].time,ip:u[0].ip,command:i.command}))}}),e.length===0&&r===2?n:e}function As(t){let r=[],e=[],n={},i={},s=!0;return t.forEach(function(o){if(o==="---")s=!1;else{let a=o.replace(/ +/g," ").split(" ");s?e.push({user:a[0],tty:a[1],date:""+new Date().getFullYear()+"-"+("0"+("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC".indexOf(a[2].toUpperCase())/3+1)).slice(-2)+"-"+("0"+a[3]).slice(-2),time:a[4]}):(n.user=a[0],n.tty=a[1],n.ip=a[2]!=="-"?a[2]:"",n.command=a.slice(5,1e3).join(" "),i=e.filter(function(u){return u.user===n.user&&(u.tty.substring(3,1e3)===n.tty||u.tty===n.tty)}),i.length===1&&r.push({user:i[0].user,tty:i[0].tty,date:i[0].date,time:i[0].time,ip:n.ip,command:n.command}))}}),r}function af(t){return new Promise(r=>{process.nextTick(()=>{let e=[];if(Zc&&Fr('who --ips; echo "---"; w | tail -n +2',function(n,i){if(n)t&&t(e),r(e);else{let s=i.toString().split(`
319
+ `);e=_o(s,1),e.length===0?Fr('who; echo "---"; w | tail -n +2',function(o,a){o||(s=a.toString().split(`
320
+ `),e=_o(s,2)),t&&t(e),r(e)}):(t&&t(e),r(e))}}),(rf||nf||sf)&&Fr('who; echo "---"; w -ih',function(n,i){if(!n){let s=i.toString().split(`
321
+ `);e=As(s)}t&&t(e),r(e)}),of&&Fr('who; echo "---"; w -h',function(n,i){if(!n){let s=i.toString().split(`
322
+ `);e=As(s)}t&&t(e),r(e)}),ef&&Fr('who; echo "---"; w -ih',function(n,i){if(!n){let s=i.toString().split(`
323
+ `);e=As(s)}t&&t(e),r(e)}),tf)try{let n=`Get-CimInstance Win32_LogonSession | select LogonId,@{n="StartTime";e={$_.StartTime.ToString("yyyy-MM-dd HH:mm:ss")}} | fl; echo '#-#-#-#';`;n+="Get-CimInstance Win32_LoggedOnUser | select antecedent,dependent | fl ; echo '#-#-#-#';",n+=`$process = (Get-CimInstance Win32_Process -Filter "name = 'explorer.exe'"); Invoke-CimMethod -InputObject $process[0] -MethodName GetOwner | select user, domain | fl; get-process -name explorer | select-object sessionid | fl; echo '#-#-#-#';`,n+="query user",mt.powerShell(n).then(i=>{if(i){i=i.split("#-#-#-#");let s=lf((i[0]||"").split(/\n\s*\n/)),o=ff((i[1]||"").split(/\n\s*\n/)),a=pf((i[3]||"").split(`\r
324
+ `)),u=cf((i[2]||"").split(/\n\s*\n/),a);for(let l in o)({}).hasOwnProperty.call(o,l)&&(o[l].dateTime={}.hasOwnProperty.call(s,l)?s[l]:"");u.forEach(l=>{let c="";for(let f in o)({}).hasOwnProperty.call(o,f)&&o[f].user===l.user&&(!c||c<o[f].dateTime)&&(c=o[f].dateTime);e.push({user:l.user,tty:l.tty,date:`${c.substring(0,10)}`,time:`${c.substring(11,19)}`,ip:"",command:""})})}t&&t(e),r(e)})}catch{t&&t(e),r(e)}})})}function lf(t){const r={};return t.forEach(e=>{const n=e.split(`\r
325
+ `),i=mt.getValue(n,"LogonId"),s=mt.getValue(n,"starttime");i&&(r[i]=s)}),r}function uf(t,r){t=t.toLowerCase(),r=r.toLowerCase();let e=0,n=t.length;r.length>n&&(n=r.length);for(let i=0;i<n;i++){const s=t[i]||"",o=r[i]||"";s===o&&e++}return n>10?e/n>.9:n>0?e/n>.8:!1}function cf(t,r){const e=[];return t.forEach(n=>{const i=n.split(`\r
326
+ `),s=mt.getValue(i,"domain",":",!0),o=mt.getValue(i,"user",":",!0),a=mt.getValue(i,"sessionid",":",!0);if(o){const u=r.filter(l=>uf(l.user,o));e.push({domain:s,user:o,tty:u&&u[0]&&u[0].tty?u[0].tty:a})}}),e}function ff(t){const r={};return t.forEach(e=>{const n=e.split(`\r
327
+ `);let s=mt.getValue(n,"antecedent",":",!0).split("=");const o=s.length>2?s[1].split(",")[0].replace(/"/g,"").trim():"",a=s.length>2?s[2].replace(/"/g,"").replace(/\)/g,"").trim():"";s=mt.getValue(n,"dependent",":",!0).split("=");const l=s.length>1?s[1].replace(/"/g,"").replace(/\)/g,"").trim():"";l&&(r[l]={domain:a,user:o})}),r}function pf(t){t=t.filter(i=>i);let r=[];const e=t[0],n=[];if(e){const i=e[0]===" "?1:0;n.push(i-1);let s=0;for(let o=i+1;o<e.length;o++)e[o]===" "&&(e[o-1]===" "||e[o-1]===".")?s=o:s&&(n.push(s),s=0);for(let o=1;o<t.length;o++)if(t[o].trim()){const a=t[o].substring(n[0]+1,n[1]).trim()||"",u=t[o].substring(n[1]+1,n[2]-2).trim()||"";r.push({user:a,tty:u})}}return r}Io.users=af;var bs={};const ye=W;let gt=process.platform;const Ns=gt==="linux"||gt==="android",$s=gt==="darwin",Eo=gt==="win32",Ds=gt==="freebsd",Rs=gt==="openbsd",Ms=gt==="netbsd",Oo=gt==="sunos";function df(t,r){return new Promise(e=>{process.nextTick(()=>{let n={url:t,ok:!1,status:404,ms:null};if(typeof t!="string")return r&&r(n),e(n);let i="";const s=ye.sanitizeShellString(t,!0),o=ye.mathMin(s.length,2e3);for(let a=0;a<=o;a++)if(s[a]!==void 0){s[a].__proto__.toLowerCase=ye.stringToLower;const u=s[a].toLowerCase();u&&u[0]&&!u[1]&&u[0].length===1&&(i=i+u[0])}n.url=i;try{if(i&&!ye.isPrototypePolluted()){if(i.__proto__.startsWith=ye.stringStartWith,i.startsWith("file:")||i.startsWith("gopher:")||i.startsWith("telnet:")||i.startsWith("mailto:")||i.startsWith("news:")||i.startsWith("nntp:"))return r&&r(n),e(n);let a=Date.now();if(Ns||Ds||Rs||Ms||$s||Oo){let u=["-I","--connect-timeout","5","-m","5"];u.push(i);let l="curl";ye.execSafe(l,u).then(c=>{const f=c.split(`
328
+ `);let p=f[0]&&f[0].indexOf(" ")>=0?parseInt(f[0].split(" ")[1],10):404;n.status=p||404,n.ok=p===200||p===301||p===302||p===304,n.ms=n.ok?Date.now()-a:null,r&&r(n),e(n)})}if(Eo){const u=(i.startsWith("https:"),M);try{u.get(i,l=>{const c=l.statusCode;n.status=c||404,n.ok=c===200||c===301||c===302||c===304,c!==200?(l.resume(),n.ms=n.ok?Date.now()-a:null,r&&r(n),e(n)):(l.on("data",()=>{}),l.on("end",()=>{n.ms=n.ok?Date.now()-a:null,r&&r(n),e(n)}))}).on("error",()=>{r&&r(n),e(n)})}catch{r&&r(n),e(n)}}}else r&&r(n),e(n)}catch{r&&r(n),e(n)}})})}bs.inetChecksite=df;function mf(t,r){return ye.isFunction(t)&&!r&&(r=t,t=""),t=t||"8.8.8.8",new Promise(e=>{process.nextTick(()=>{if(typeof t!="string")return r&&r(null),e(null);let n="";const i=(ye.isPrototypePolluted()?"8.8.8.8":ye.sanitizeShellString(t,!0)).trim(),s=ye.mathMin(i.length,2e3);for(let a=0;a<=s;a++)if(i[a]!==void 0){i[a].__proto__.toLowerCase=ye.stringToLower;const u=i[a].toLowerCase();u&&u[0]&&!u[1]&&(n=n+u[0])}if(n.__proto__.startsWith=ye.stringStartWith,n.startsWith("file:")||n.startsWith("gopher:")||n.startsWith("telnet:")||n.startsWith("mailto:")||n.startsWith("news:")||n.startsWith("nntp:"))return r&&r(null),e(null);let o;if((Ns||Ds||Rs||Ms||$s)&&(Ns&&(o=["-c","2","-w","3",n]),(Ds||Rs||Ms)&&(o=["-c","2","-t","3",n]),$s&&(o=["-c2","-t3",n]),ye.execSafe("ping",o).then(a=>{let u=null;if(a){const c=a.split(`
329
+ `).filter(f=>f.indexOf("rtt")>=0||f.indexOf("round-trip")>=0||f.indexOf("avg")>=0).join(`
330
+ `).split("=");if(c.length>1){const f=c[1].split("/");f.length>1&&(u=parseFloat(f[1]))}}r&&r(u),e(u)})),Oo){const a=["-s","-a",n,"56","2"],u="avg";ye.execSafe("ping",a,{timeout:3e3}).then(l=>{let c=null;if(l){const p=l.split(`
331
+ `).filter(d=>d.indexOf(u)>=0).join(`
332
+ `).split("=");if(p.length>1){const d=p[1].split("/");d.length>1&&(c=parseFloat(d[1].replace(",",".")))}}r&&r(c),e(c)})}if(Eo){let a=null;try{const u=[n,"-n","1"];ye.execSafe("ping",u,ye.execOptsWin).then(l=>{if(l){let c=l.split(`\r
333
+ `);c.shift(),c.forEach(function(f){if((f.toLowerCase().match(/ms/g)||[]).length===3){let p=f.replace(/ +/g," ").split(" ");p.length>6&&(a=parseFloat(p[p.length-1]))}})}r&&r(a),e(a)})}catch{r&&r(a),e(a)}}})})}bs.inetLatency=mf;var yt={};const St=M,wt=M.type()==="Windows_NT"?"//./pipe/docker_engine":"/var/run/docker.sock";var hf=class{getInfo(r){try{let e=St.createConnection({path:wt}),n="",i;e.on("connect",()=>{e.write(`GET http:/info HTTP/1.0\r
334
+ \r
335
+ `)}),e.on("data",s=>{n=n+s.toString()}),e.on("error",()=>{e=!1,r({})}),e.on("end",()=>{let s=n.indexOf(`\r
336
+ \r
337
+ `);n=n.substring(s+4),e=!1;try{i=JSON.parse(n),r(i)}catch{r({})}})}catch{r({})}}listImages(r,e){try{let n=St.createConnection({path:wt}),i="",s;n.on("connect",()=>{n.write("GET http:/images/json"+(r?"?all=1":"")+` HTTP/1.0\r
338
+ \r
339
+ `)}),n.on("data",o=>{i=i+o.toString()}),n.on("error",()=>{n=!1,e({})}),n.on("end",()=>{let o=i.indexOf(`\r
340
+ \r
341
+ `);i=i.substring(o+4),n=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}}inspectImage(r,e){if(r=r||"",r)try{let n=St.createConnection({path:wt}),i="",s;n.on("connect",()=>{n.write("GET http:/images/"+r+`/json?stream=0 HTTP/1.0\r
342
+ \r
343
+ `)}),n.on("data",o=>{i=i+o.toString()}),n.on("error",()=>{n=!1,e({})}),n.on("end",()=>{let o=i.indexOf(`\r
344
+ \r
345
+ `);i=i.substring(o+4),n=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}listContainers(r,e){try{let n=St.createConnection({path:wt}),i="",s;n.on("connect",()=>{n.write("GET http:/containers/json"+(r?"?all=1":"")+` HTTP/1.0\r
346
+ \r
347
+ `)}),n.on("data",o=>{i=i+o.toString()}),n.on("error",()=>{n=!1,e({})}),n.on("end",()=>{let o=i.indexOf(`\r
348
+ \r
349
+ `);i=i.substring(o+4),n=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}}getStats(r,e){if(r=r||"",r)try{let n=St.createConnection({path:wt}),i="",s;n.on("connect",()=>{n.write("GET http:/containers/"+r+`/stats?stream=0 HTTP/1.0\r
350
+ \r
351
+ `)}),n.on("data",o=>{i=i+o.toString()}),n.on("error",()=>{n=!1,e({})}),n.on("end",()=>{let o=i.indexOf(`\r
352
+ \r
353
+ `);i=i.substring(o+4),n=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}getInspect(r,e){if(r=r||"",r)try{let n=St.createConnection({path:wt}),i="",s;n.on("connect",()=>{n.write("GET http:/containers/"+r+`/json?stream=0 HTTP/1.0\r
354
+ \r
355
+ `)}),n.on("data",o=>{i=i+o.toString()}),n.on("error",()=>{n=!1,e({})}),n.on("end",()=>{let o=i.indexOf(`\r
356
+ \r
357
+ `);i=i.substring(o+4),n=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}getProcesses(r,e){if(r=r||"",r)try{let n=St.createConnection({path:wt}),i="",s;n.on("connect",()=>{n.write("GET http:/containers/"+r+`/top?ps_args=-opid,ppid,pgid,vsz,time,etime,nice,ruser,user,rgroup,group,stat,rss,args HTTP/1.0\r
358
+ \r
359
+ `)}),n.on("data",o=>{i=i+o.toString()}),n.on("error",()=>{n=!1,e({})}),n.on("end",()=>{let o=i.indexOf(`\r
360
+ \r
361
+ `);i=i.substring(o+4),n=!1;try{s=JSON.parse(i),e(s)}catch{e({})}})}catch{e({})}else e({})}listVolumes(r){try{let e=St.createConnection({path:wt}),n="",i;e.on("connect",()=>{e.write(`GET http:/volumes HTTP/1.0\r
362
+ \r
363
+ `)}),e.on("data",s=>{n=n+s.toString()}),e.on("error",()=>{e=!1,r({})}),e.on("end",()=>{let s=n.indexOf(`\r
364
+ \r
365
+ `);n=n.substring(s+4),e=!1;try{i=JSON.parse(n),r(i)}catch{r({})}})}catch{r({})}}};const ce=W,vt=hf,gf=process.platform==="win32";let or={},le,Bs=0;function yf(t){return new Promise(r=>{process.nextTick(()=>{le||(le=new vt);const e={};le.getInfo(n=>{e.id=n.ID,e.containers=n.Containers,e.containersRunning=n.ContainersRunning,e.containersPaused=n.ContainersPaused,e.containersStopped=n.ContainersStopped,e.images=n.Images,e.driver=n.Driver,e.memoryLimit=n.MemoryLimit,e.swapLimit=n.SwapLimit,e.kernelMemory=n.KernelMemory,e.cpuCfsPeriod=n.CpuCfsPeriod,e.cpuCfsQuota=n.CpuCfsQuota,e.cpuShares=n.CPUShares,e.cpuSet=n.CPUSet,e.ipv4Forwarding=n.IPv4Forwarding,e.bridgeNfIptables=n.BridgeNfIptables,e.bridgeNfIp6tables=n.BridgeNfIp6tables,e.debug=n.Debug,e.nfd=n.NFd,e.oomKillDisable=n.OomKillDisable,e.ngoroutines=n.NGoroutines,e.systemTime=n.SystemTime,e.loggingDriver=n.LoggingDriver,e.cgroupDriver=n.CgroupDriver,e.nEventsListener=n.NEventsListener,e.kernelVersion=n.KernelVersion,e.operatingSystem=n.OperatingSystem,e.osType=n.OSType,e.architecture=n.Architecture,e.ncpu=n.NCPU,e.memTotal=n.MemTotal,e.dockerRootDir=n.DockerRootDir,e.httpProxy=n.HttpProxy,e.httpsProxy=n.HttpsProxy,e.noProxy=n.NoProxy,e.name=n.Name,e.labels=n.Labels,e.experimentalBuild=n.ExperimentalBuild,e.serverVersion=n.ServerVersion,e.clusterStore=n.ClusterStore,e.clusterAdvertise=n.ClusterAdvertise,e.defaultRuntime=n.DefaultRuntime,e.liveRestoreEnabled=n.LiveRestoreEnabled,e.isolation=n.Isolation,e.initBinary=n.InitBinary,e.productLicense=n.ProductLicense,t&&t(e),r(e)})})})}yt.dockerInfo=yf;function Sf(t,r){ce.isFunction(t)&&!r&&(r=t,t=!1),typeof t=="string"&&t==="true"&&(t=!0),typeof t!="boolean"&&t!==void 0&&(t=!1),t=t||!1;let e=[];return new Promise(n=>{process.nextTick(()=>{le||(le=new vt);const i=[];le.listImages(t,s=>{let o={};try{o=s,o&&Object.prototype.toString.call(o)==="[object Array]"&&o.length>0?(o.forEach(function(a){a.Names&&Object.prototype.toString.call(a.Names)==="[object Array]"&&a.Names.length>0&&(a.Name=a.Names[0].replace(/^\/|\/$/g,"")),i.push(wf(a.Id.trim(),a))}),i.length?Promise.all(i).then(a=>{r&&r(a),n(a)}):(r&&r(e),n(e))):(r&&r(e),n(e))}catch{r&&r(e),n(e)}})})})}function wf(t,r){return new Promise(e=>{process.nextTick(()=>{if(t=t||"",typeof t!="string")return e();const n=(ce.isPrototypePolluted()?"":ce.sanitizeShellString(t,!0)).trim();n?(le||(le=new vt),le.inspectImage(n.trim(),i=>{try{e({id:r.Id,container:i.Container,comment:i.Comment,os:i.Os,architecture:i.Architecture,parent:i.Parent,dockerVersion:i.DockerVersion,size:i.Size,sharedSize:r.SharedSize,virtualSize:i.VirtualSize,author:i.Author,created:i.Created?Math.round(new Date(i.Created).getTime()/1e3):0,containerConfig:i.ContainerConfig?i.ContainerConfig:{},graphDriver:i.GraphDriver?i.GraphDriver:{},repoDigests:i.RepoDigests?i.RepoDigests:{},repoTags:i.RepoTags?i.RepoTags:{},config:i.Config?i.Config:{},rootFS:i.RootFS?i.RootFS:{}})}catch{e()}})):e()})})}yt.dockerImages=Sf;function Fs(t,r){function e(i,s){return i.filter(a=>a.Id&&a.Id===s).length>0}ce.isFunction(t)&&!r&&(r=t,t=!1),typeof t=="string"&&t==="true"&&(t=!0),typeof t!="boolean"&&t!==void 0&&(t=!1),t=t||!1;let n=[];return new Promise(i=>{process.nextTick(()=>{le||(le=new vt);const s=[];le.listContainers(t,o=>{let a={};try{if(a=o,a&&Object.prototype.toString.call(a)==="[object Array]"&&a.length>0){for(let u in or)({}).hasOwnProperty.call(or,u)&&(e(a,u)||delete or[u]);a.forEach(function(u){u.Names&&Object.prototype.toString.call(u.Names)==="[object Array]"&&u.Names.length>0&&(u.Name=u.Names[0].replace(/^\/|\/$/g,"")),s.push(vf(u.Id.trim(),u))}),s.length?Promise.all(s).then(u=>{r&&r(u),i(u)}):(r&&r(n),i(n))}else r&&r(n),i(n)}catch{for(let l in or)({}).hasOwnProperty.call(or,l)&&(e(a,l)||delete or[l]);r&&r(n),i(n)}})})})}function vf(t,r){return new Promise(e=>{process.nextTick(()=>{if(t=t||"",typeof t!="string")return e();const n=(ce.isPrototypePolluted()?"":ce.sanitizeShellString(t,!0)).trim();n?(le||(le=new vt),le.getInspect(n.trim(),i=>{try{e({id:r.Id,name:r.Name,image:r.Image,imageID:r.ImageID,command:r.Command,created:r.Created,started:i.State&&i.State.StartedAt?Math.round(new Date(i.State.StartedAt).getTime()/1e3):0,finished:i.State&&i.State.FinishedAt&&!i.State.FinishedAt.startsWith("0001-01-01")?Math.round(new Date(i.State.FinishedAt).getTime()/1e3):0,createdAt:i.Created?i.Created:"",startedAt:i.State&&i.State.StartedAt?i.State.StartedAt:"",finishedAt:i.State&&i.State.FinishedAt&&!i.State.FinishedAt.startsWith("0001-01-01")?i.State.FinishedAt:"",state:r.State,restartCount:i.RestartCount||0,platform:i.Platform||"",driver:i.Driver||"",ports:r.Ports,mounts:r.Mounts})}catch{e()}})):e()})})}yt.dockerContainers=Fs;function xf(t,r){if(gf){let e=ce.nanoSeconds(),n=0;if(Bs>0){let i=e-Bs,s=t.cpu_usage.total_usage-r.cpu_usage.total_usage;i>0&&(n=100*s/i)}return Bs=e,n}else{let e=0,n=t.cpu_usage.total_usage-r.cpu_usage.total_usage,i=t.system_cpu_usage-r.system_cpu_usage;return i>0&&n>0&&(r.online_cpus?e=n/i*r.online_cpus*100:e=n/i*t.cpu_usage.percpu_usage.length*100),e}}function Cf(t){let r,e;for(let n in t){if(!{}.hasOwnProperty.call(t,n))continue;let i=t[n];r=+i.rx_bytes,e=+i.tx_bytes}return{rx:r,wx:e}}function If(t){let r={r:0,w:0};return t&&t.io_service_bytes_recursive&&Object.prototype.toString.call(t.io_service_bytes_recursive)==="[object Array]"&&t.io_service_bytes_recursive.length>0&&t.io_service_bytes_recursive.forEach(function(e){e.op&&e.op.toLowerCase()==="read"&&e.value&&(r.r+=e.value),e.op&&e.op.toLowerCase()==="write"&&e.value&&(r.w+=e.value)}),r}function Ws(t,r){let e=[];return new Promise(n=>{process.nextTick(()=>{if(ce.isFunction(t)&&!r)r=t,e=["*"];else{if(t=t||"*",typeof t!="string")return r&&r([]),n([]);let o="";if(o.__proto__.toLowerCase=ce.stringToLower,o.__proto__.replace=ce.stringReplace,o.__proto__.trim=ce.stringTrim,o=t,o=o.trim(),o!=="*"){o="";const a=(ce.isPrototypePolluted()?"":ce.sanitizeShellString(t,!0)).trim(),u=ce.mathMin(a.length,2e3);for(let l=0;l<=u;l++)if(a[l]!==void 0){a[l].__proto__.toLowerCase=ce.stringToLower;const c=a[l].toLowerCase();c&&c[0]&&!c[1]&&(o=o+c[0])}}o=o.trim().toLowerCase().replace(/,+/g,"|"),e=o.split("|")}const i=[],s=[];if(e.length&&e[0].trim()==="*")e=[],Fs().then(o=>{for(let a of o)e.push(a.id.substring(0,12));e.length?Ws(e.join(",")).then(a=>{r&&r(a),n(a)}):(r&&r(i),n(i))});else{for(let o of e)s.push(_f(o.trim()));s.length?Promise.all(s).then(o=>{r&&r(o),n(o)}):(r&&r(i),n(i))}})})}function _f(t){t=t||"";let r={id:t,memUsage:0,memLimit:0,memPercent:0,cpuPercent:0,pids:0,netIO:{rx:0,wx:0},blockIO:{r:0,w:0},restartCount:0,cpuStats:{},precpuStats:{},memoryStats:{},networks:{}};return new Promise(e=>{process.nextTick(()=>{t?(le||(le=new vt),le.getInspect(t,n=>{try{le.getStats(t,i=>{try{let s=i;s.message||(i.id&&(r.id=i.id),r.memUsage=s.memory_stats&&s.memory_stats.usage?s.memory_stats.usage:0,r.memLimit=s.memory_stats&&s.memory_stats.limit?s.memory_stats.limit:0,r.memPercent=s.memory_stats&&s.memory_stats.usage&&s.memory_stats.limit?s.memory_stats.usage/s.memory_stats.limit*100:0,r.cpuPercent=s.cpu_stats&&s.precpu_stats?xf(s.cpu_stats,s.precpu_stats):0,r.pids=s.pids_stats&&s.pids_stats.current?s.pids_stats.current:0,r.restartCount=n.RestartCount?n.RestartCount:0,s.networks&&(r.netIO=Cf(s.networks)),s.blkio_stats&&(r.blockIO=If(s.blkio_stats)),r.cpuStats=s.cpu_stats?s.cpu_stats:{},r.precpuStats=s.precpu_stats?s.precpu_stats:{},r.memoryStats=s.memory_stats?s.memory_stats:{},r.networks=s.networks?s.networks:{})}catch{ce.noop()}e(r)})}catch{ce.noop()}})):e(r)})})}yt.dockerContainerStats=Ws;function Lo(t,r){let e=[];return new Promise(n=>{process.nextTick(()=>{if(t=t||"",typeof t!="string")return n(e);const i=(ce.isPrototypePolluted()?"":ce.sanitizeShellString(t,!0)).trim();i?(le||(le=new vt),le.getProcesses(i,s=>{try{if(s&&s.Titles&&s.Processes){let o=s.Titles.map(function(x){return x.toUpperCase()}),a=o.indexOf("PID"),u=o.indexOf("PPID"),l=o.indexOf("PGID"),c=o.indexOf("VSZ"),f=o.indexOf("TIME"),p=o.indexOf("ELAPSED"),d=o.indexOf("NI"),m=o.indexOf("RUSER"),g=o.indexOf("USER"),S=o.indexOf("RGROUP"),h=o.indexOf("GROUP"),y=o.indexOf("STAT"),w=o.indexOf("RSS"),v=o.indexOf("COMMAND");s.Processes.forEach(x=>{e.push({pidHost:a>=0?x[a]:"",ppid:u>=0?x[u]:"",pgid:l>=0?x[l]:"",user:g>=0?x[g]:"",ruser:m>=0?x[m]:"",group:h>=0?x[h]:"",rgroup:S>=0?x[S]:"",stat:y>=0?x[y]:"",time:f>=0?x[f]:"",elapsed:p>=0?x[p]:"",nice:d>=0?x[d]:"",rss:w>=0?x[w]:"",vsz:c>=0?x[c]:"",command:v>=0?x[v]:""})})}}catch{ce.noop()}r&&r(e),n(e)})):(r&&r(e),n(e))})})}yt.dockerContainerProcesses=Lo;function Ef(t){let r=[];return new Promise(e=>{process.nextTick(()=>{le||(le=new vt),le.listVolumes(n=>{let i={};try{i=n,i&&i.Volumes&&Object.prototype.toString.call(i.Volumes)==="[object Array]"&&i.Volumes.length>0?(i.Volumes.forEach(function(s){r.push({name:s.Name,driver:s.Driver,labels:s.Labels,mountpoint:s.Mountpoint,options:s.Options,scope:s.Scope,created:s.CreatedAt?Math.round(new Date(s.CreatedAt).getTime()/1e3):0})}),t&&t(r),e(r)):(t&&t(r),e(r))}catch{t&&t(r),e(r)}})})})}yt.dockerVolumes=Ef;function Of(t){return new Promise(r=>{process.nextTick(()=>{Fs(!0).then(e=>{if(e&&Object.prototype.toString.call(e)==="[object Array]"&&e.length>0){let n=e.length;e.forEach(function(i){Ws(i.id).then(s=>{i.memUsage=s[0].memUsage,i.memLimit=s[0].memLimit,i.memPercent=s[0].memPercent,i.cpuPercent=s[0].cpuPercent,i.pids=s[0].pids,i.netIO=s[0].netIO,i.blockIO=s[0].blockIO,i.cpuStats=s[0].cpuStats,i.precpuStats=s[0].precpuStats,i.memoryStats=s[0].memoryStats,i.networks=s[0].networks,Lo(i.id).then(o=>{i.processes=o,n-=1,n===0&&(t&&t(e),r(e))})})})}else t&&t(e),r(e)})})})}yt.dockerAll=Of;var Po={};const Gs=M,Lf=M.exec,re=W;function Pf(t){let r=[];return new Promise(e=>{process.nextTick(()=>{try{Lf(re.getVboxmanage()+" list vms --long",function(n,i){let s=(Gs.EOL+i.toString()).split(Gs.EOL+"Name:");s.shift(),s.forEach(o=>{const a=("Name:"+o).split(Gs.EOL),u=re.getValue(a,"State"),l=u.startsWith("running"),c=l?u.replace("running (since ","").replace(")","").trim():"";let f=0;try{if(l){const m=new Date(c),g=m.getTimezoneOffset();f=Math.round((Date.now()-Date.parse(m))/1e3)+g*60}}catch{re.noop()}const p=l?"":u.replace("powered off (since","").replace(")","").trim();let d=0;try{if(!l){const m=new Date(p),g=m.getTimezoneOffset();d=Math.round((Date.now()-Date.parse(m))/1e3)+g*60}}catch{re.noop()}r.push({id:re.getValue(a,"UUID"),name:re.getValue(a,"Name"),running:l,started:c,runningSince:f,stopped:p,stoppedSince:d,guestOS:re.getValue(a,"Guest OS"),hardwareUUID:re.getValue(a,"Hardware UUID"),memory:parseInt(re.getValue(a,"Memory size"," "),10),vram:parseInt(re.getValue(a,"VRAM size"),10),cpus:parseInt(re.getValue(a,"Number of CPUs"),10),cpuExepCap:re.getValue(a,"CPU exec cap"),cpuProfile:re.getValue(a,"CPUProfile"),chipset:re.getValue(a,"Chipset"),firmware:re.getValue(a,"Firmware"),pageFusion:re.getValue(a,"Page Fusion")==="enabled",configFile:re.getValue(a,"Config file"),snapshotFolder:re.getValue(a,"Snapshot folder"),logFolder:re.getValue(a,"Log folder"),hpet:re.getValue(a,"HPET")==="enabled",pae:re.getValue(a,"PAE")==="enabled",longMode:re.getValue(a,"Long Mode")==="enabled",tripleFaultReset:re.getValue(a,"Triple Fault Reset")==="enabled",apic:re.getValue(a,"APIC")==="enabled",x2Apic:re.getValue(a,"X2APIC")==="enabled",acpi:re.getValue(a,"ACPI")==="enabled",ioApic:re.getValue(a,"IOAPIC")==="enabled",biosApicMode:re.getValue(a,"BIOS APIC mode"),bootMenuMode:re.getValue(a,"Boot menu mode"),bootDevice1:re.getValue(a,"Boot Device 1"),bootDevice2:re.getValue(a,"Boot Device 2"),bootDevice3:re.getValue(a,"Boot Device 3"),bootDevice4:re.getValue(a,"Boot Device 4"),timeOffset:re.getValue(a,"Time offset"),rtc:re.getValue(a,"RTC")})}),t&&t(r),e(r)})}catch{t&&t(r),e(r)}})})}Po.vboxInfo=Pf;var To={};const Us=M.exec,me=W;let xt=process.platform;const Vo=xt==="linux"||xt==="android",Tf=xt==="darwin",Vf=xt==="win32",Af=xt==="freebsd",bf=xt==="openbsd",Nf=xt==="netbsd",$f=xt==="sunos",Ao={1:"Other",2:"Unknown",3:"Idle",4:"Printing",5:"Warmup",6:"Stopped Printing",7:"Offline"};function Df(t){const r={};if(t&&t.length&&t[0].indexOf(" CUPS v")>0){const e=t[0].split(" CUPS v");r.cupsVersion=e[1]}return r}function Rf(t){const r={},e=me.getValue(t,"PrinterId"," ");return r.id=e?parseInt(e,10):null,r.name=me.getValue(t,"Info"," "),r.model=t.length>0&&t[0]?t[0].split(" ")[0]:"",r.uri=me.getValue(t,"DeviceURI"," "),r.uuid=me.getValue(t,"UUID"," "),r.status=me.getValue(t,"State"," "),r.local=me.getValue(t,"Location"," ").toLowerCase().startsWith("local"),r.default=null,r.shared=me.getValue(t,"Shared"," ").toLowerCase().startsWith("yes"),r}function Mf(t,r){const e={};return e.id=r,e.name=me.getValue(t,"Description",":",!0),e.model=t.length>0&&t[0]?t[0].split(" ")[0]:"",e.uri=null,e.uuid=null,e.status=t.length>0&&t[0]?t[0].indexOf(" idle")>0?"idle":t[0].indexOf(" printing")>0?"printing":"unknown":null,e.local=me.getValue(t,"Location",":",!0).toLowerCase().startsWith("local"),e.default=null,e.shared=me.getValue(t,"Shared"," ").toLowerCase().startsWith("yes"),e}function Bf(t,r){const e={},n=t.uri.split("/");return e.id=r,e.name=t._name,e.model=n.length?n[n.length-1]:"",e.uri=t.uri,e.uuid=null,e.status=t.status,e.local=t.printserver==="local",e.default=t.default==="yes",e.shared=t.shared==="yes",e}function Ff(t,r){const e={},n=parseInt(me.getValue(t,"PrinterStatus",":"),10);return e.id=r,e.name=me.getValue(t,"name",":"),e.model=me.getValue(t,"DriverName",":"),e.uri=null,e.uuid=null,e.status=Ao[n]?Ao[n]:null,e.local=me.getValue(t,"Local",":").toUpperCase()==="TRUE",e.default=me.getValue(t,"Default",":").toUpperCase()==="TRUE",e.shared=me.getValue(t,"Shared",":").toUpperCase()==="TRUE",e}function Wf(t){return new Promise(r=>{process.nextTick(()=>{let e=[];if(Vo||Af||bf||Nf){let n="cat /etc/cups/printers.conf 2>/dev/null";Us(n,function(i,s){if(!i){const o=s.toString().split("<Printer "),a=Df(o[0]);for(let u=1;u<o.length;u++){const l=Rf(o[u].split(`
366
+ `));l.name&&(l.engine="CUPS",l.engineVersion=a.cupsVersion,e.push(l))}}e.length===0&&Vo?(n="export LC_ALL=C; lpstat -lp 2>/dev/null; unset LC_ALL",Us(n,function(o,a){const u=(`
367
+ `+a.toString()).split(`
368
+ printer `);for(let l=1;l<u.length;l++){const c=Mf(u[l].split(`
369
+ `),l);e.push(c)}}),t&&t(e),r(e)):(t&&t(e),r(e))})}Tf&&Us("system_profiler SPPrintersDataType -json",function(i,s){if(!i)try{const o=JSON.parse(s.toString());if(o.SPPrintersDataType&&o.SPPrintersDataType.length)for(let a=0;a<o.SPPrintersDataType.length;a++){const u=Bf(o.SPPrintersDataType[a],a);e.push(u)}}catch{me.noop()}t&&t(e),r(e)}),Vf&&me.powerShell("Get-CimInstance Win32_Printer | select PrinterStatus,Name,DriverName,Local,Default,Shared | fl").then((n,i)=>{if(!i){const s=n.toString().split(/\n\s*\n/);for(let o=0;o<s.length;o++){const a=Ff(s[o].split(`
370
+ `),o);(a.name||a.model)&&e.push(a)}}t&&t(e),r(e)}),$f&&r(null)})})}To.printer=Wf;var bo={};const No=M.exec,$e=W;let Ct=process.platform;const Gf=Ct==="linux"||Ct==="android",Uf=Ct==="darwin",jf=Ct==="win32",Hf=Ct==="freebsd",zf=Ct==="openbsd",Xf=Ct==="netbsd",kf=Ct==="sunos";function qf(t,r){let e=t;const n=(r+" "+t).toLowerCase();return n.indexOf("camera")>=0?e="Camera":n.indexOf("hub")>=0?e="Hub":n.indexOf("keybrd")>=0||n.indexOf("keyboard")>=0?e="Keyboard":n.indexOf("mouse")>=0?e="Mouse":n.indexOf("stora")>=0?e="Storage":n.indexOf("mic")>=0?e="Microphone":(n.indexOf("headset")>=0||n.indexOf("audio")>=0)&&(e="Audio"),e}function Kf(t){const r={},e=t.split(`
371
+ `);if(e&&e.length&&e[0].indexOf("Device")>=0){const g=e[0].split(" ");r.bus=parseInt(g[0],10),g[2]?r.deviceId=parseInt(g[2],10):r.deviceId=null}else r.bus=null,r.deviceId=null;const n=$e.getValue(e,"idVendor"," ",!0).trim();let i=n.split(" ");i.shift();const s=i.join(" "),o=$e.getValue(e,"idProduct"," ",!0).trim();let a=o.split(" ");a.shift();const u=a.join(" ");let c=$e.getValue(e,"bInterfaceClass"," ",!0).trim().split(" ");c.shift();const f=c.join(" ");let d=$e.getValue(e,"iManufacturer"," ",!0).trim().split(" ");d.shift();const m=d.join(" ");return r.id=(n.startsWith("0x")?n.split(" ")[0].substr(2,10):"")+":"+(o.startsWith("0x")?o.split(" ")[0].substr(2,10):""),r.name=u,r.type=qf(f,u),r.removable=null,r.vendor=s,r.manufacturer=m,r.maxPower=$e.getValue(e,"MaxPower"," ",!0),r.serialNumber=null,r}function Yf(t){let r="";return t.indexOf("camera")>=0?r="Camera":t.indexOf("touch bar")>=0?r="Touch Bar":t.indexOf("controller")>=0?r="Controller":t.indexOf("headset")>=0?r="Audio":t.indexOf("keyboard")>=0?r="Keyboard":t.indexOf("trackpad")>=0?r="Trackpad":t.indexOf("sensor")>=0?r="Sensor":t.indexOf("bthusb")>=0||t.indexOf("bth")>=0||t.indexOf("rfcomm")>=0?r="Bluetooth":t.indexOf("usbhub")>=0||t.indexOf(" hub")>=0?r="Hub":t.indexOf("mouse")>=0?r="Mouse":t.indexOf("mic")>=0?r="Microphone":t.indexOf("removable")>=0&&(r="Storage"),r}function Jf(t,r){const e={};e.id=r,t=t.replace(/ \|/g,""),t=t.trim();let n=t.split(`
372
+ `);n.shift();try{for(let o=0;o<n.length;o++){n[o]=n[o].trim(),n[o]=n[o].replace(/=/g,":"),n[o]!=="{"&&n[o]!=="}"&&n[o+1]&&n[o+1].trim()!=="}"&&(n[o]=n[o]+","),n[o]=n[o].replace(":Yes,",':"Yes",'),n[o]=n[o].replace(": Yes,",': "Yes",'),n[o]=n[o].replace(": Yes",': "Yes"'),n[o]=n[o].replace(":No,",':"No",'),n[o]=n[o].replace(": No,",': "No",'),n[o]=n[o].replace(": No",': "No"'),n[o]=n[o].replace("((","").replace("))","");const a=/<(\w+)>/.exec(n[o]);if(a){const u=a[0];n[o]=n[o].replace(u,`"${u}"`)}}const i=JSON.parse(n.join(`
373
+ `)),s=(i["Built-In"]?i["Built-In"].toLowerCase()!=="yes":!0)&&(i["non-removable"]?i["non-removable"].toLowerCase()==="no":!0);return e.bus=null,e.deviceId=null,e.id=i["USB Address"]||null,e.name=i.kUSBProductString||i["USB Product Name"]||null,e.type=Yf((i.kUSBProductString||i["USB Product Name"]||"").toLowerCase()+(s?" removable":"")),e.removable=i["non-removable"]?i["non-removable"].toLowerCase()||!1:!0,e.vendor=i.kUSBVendorString||i["USB Vendor Name"]||null,e.manufacturer=i.kUSBVendorString||i["USB Vendor Name"]||null,e.maxPower=null,e.serialNumber=i.kUSBSerialNumberString||null,e.name?e:null}catch{return null}}function Qf(t,r){let e="";return r.indexOf("storage")>=0||r.indexOf("speicher")>=0?e="Storage":t.indexOf("usbhub")>=0?e="Hub":t.indexOf("storage")>=0?e="Storage":t.indexOf("usbcontroller")>=0?e="Controller":t.indexOf("keyboard")>=0?e="Keyboard":t.indexOf("pointing")>=0?e="Mouse":t.indexOf("disk")>=0&&(e="Storage"),e}function Zf(t,r){const e=Qf($e.getValue(t,"CreationClassName",":").toLowerCase(),$e.getValue(t,"name",":").toLowerCase());if(e){const n={};return n.bus=null,n.deviceId=$e.getValue(t,"deviceid",":"),n.id=r,n.name=$e.getValue(t,"name",":"),n.type=e,n.removable=null,n.vendor=null,n.manufacturer=$e.getValue(t,"Manufacturer",":"),n.maxPower=null,n.serialNumber=null,n}else return null}function ep(t){return new Promise(r=>{process.nextTick(()=>{let e=[];Gf&&No("export LC_ALL=C; lsusb -v 2>/dev/null; unset LC_ALL",{maxBuffer:1024*1024*128},function(i,s){if(!i){const o=(`
374
+
375
+ `+s.toString()).split(`
376
+
377
+ Bus `);for(let a=1;a<o.length;a++){const u=Kf(o[a]);e.push(u)}}t&&t(e),r(e)}),Uf&&No("ioreg -p IOUSB -c AppleUSBRootHubDevice -w0 -l",{maxBuffer:1024*1024*128},function(i,s){if(!i){const o=s.toString().split(" +-o ");for(let a=1;a<o.length;a++){const u=Jf(o[a]);u&&e.push(u)}t&&t(e),r(e)}t&&t(e),r(e)}),jf&&$e.powerShell('Get-CimInstance CIM_LogicalDevice | where { $_.Description -match "USB"} | select Name,CreationClassName,DeviceId,Manufacturer | fl').then((n,i)=>{if(!i){const s=n.toString().split(/\n\s*\n/);for(let o=0;o<s.length;o++){const a=Zf(s[o].split(`
378
+ `),o);a&&e.push(a)}}t&&t(e),r(e)}),(kf||Hf||zf||Xf)&&r(null)})})}bo.usb=ep;var $o={};const Do=M.exec,tp=M.execSync,Ce=W;let It=process.platform;const rp=It==="linux"||It==="android",np=It==="darwin",sp=It==="win32",ip=It==="freebsd",op=It==="openbsd",ap=It==="netbsd",lp=It==="sunos";function js(t,r,e){t=t.toLowerCase();let n="";return t.indexOf("input")>=0&&(n="Microphone"),t.indexOf("display audio")>=0&&(n="Speaker"),t.indexOf("speak")>=0&&(n="Speaker"),t.indexOf("laut")>=0&&(n="Speaker"),t.indexOf("loud")>=0&&(n="Speaker"),t.indexOf("head")>=0&&(n="Headset"),t.indexOf("mic")>=0&&(n="Microphone"),t.indexOf("mikr")>=0&&(n="Microphone"),t.indexOf("phone")>=0&&(n="Phone"),t.indexOf("controll")>=0&&(n="Controller"),t.indexOf("line o")>=0&&(n="Line Out"),t.indexOf("digital o")>=0&&(n="Digital Out"),t.indexOf("smart sound technology")>=0&&(n="Digital Signal Processor"),t.indexOf("high definition audio")>=0&&(n="Sound Driver"),!n&&e?n="Speaker":!n&&r&&(n="Microphone"),n}function up(){let t="lspci -v 2>/dev/null",r=[];try{return tp(t).toString().split(`
379
+
380
+ `).forEach(n=>{const i=n.split(`
381
+ `);if(i&&i.length&&i[0].toLowerCase().indexOf("audio")>=0){const s={};s.slotId=i[0].split(" ")[0],s.driver=Ce.getValue(i,"Kernel driver in use",":",!0)||Ce.getValue(i,"Kernel modules",":",!0),r.push(s)}}),r}catch{return r}}function cp(t,r){const e={},n=Ce.getValue(t,"Slot"),i=r.filter(function(s){return s.slotId===n});return e.id=n,e.name=Ce.getValue(t,"SDevice"),e.manufacturer=Ce.getValue(t,"SVendor"),e.revision=Ce.getValue(t,"Rev"),e.driver=i&&i.length===1&&i[0].driver?i[0].driver:"",e.default=null,e.channel="PCIe",e.type=js(e.name,null,null),e.in=null,e.out=null,e.status="online",e}function fp(t){let r="";return t.indexOf("builtin")>=0&&(r="Built-In"),t.indexOf("extern")>=0&&(r="Audio-Jack"),t.indexOf("hdmi")>=0&&(r="HDMI"),t.indexOf("displayport")>=0&&(r="Display-Port"),t.indexOf("usb")>=0&&(r="USB"),t.indexOf("pci")>=0&&(r="PCIe"),r}function pp(t,r){const e={},n=((t.coreaudio_device_transport||"")+" "+(t._name||"")).toLowerCase();return e.id=r,e.name=t._name,e.manufacturer=t.coreaudio_device_manufacturer,e.revision=null,e.driver=null,e.default=!!t.coreaudio_default_audio_input_device||!!t.coreaudio_default_audio_output_device,e.channel=fp(n),e.type=js(e.name,!!t.coreaudio_device_input,!!t.coreaudio_device_output),e.in=!!t.coreaudio_device_input,e.out=!!t.coreaudio_device_output,e.status="online",e}function dp(t){const r={},e=Ce.getValue(t,"StatusInfo",":");return r.id=Ce.getValue(t,"DeviceID",":"),r.name=Ce.getValue(t,"name",":"),r.manufacturer=Ce.getValue(t,"manufacturer",":"),r.revision=null,r.driver=null,r.default=null,r.channel=null,r.type=js(r.name,null,null),r.in=null,r.out=null,r.status=e,r}function mp(t){return new Promise(r=>{process.nextTick(()=>{let e=[];(rp||ip||op||ap)&&Do("lspci -vmm 2>/dev/null",function(i,s){if(!i){const o=up();s.toString().split(`
382
+
383
+ `).forEach(u=>{const l=u.split(`
384
+ `);if(Ce.getValue(l,"class",":",!0).toLowerCase().indexOf("audio")>=0){const c=cp(l,o);e.push(c)}})}t&&t(e),r(e)}),np&&Do("system_profiler SPAudioDataType -json",function(i,s){if(!i)try{const o=JSON.parse(s.toString());if(o.SPAudioDataType&&o.SPAudioDataType.length&&o.SPAudioDataType[0]&&o.SPAudioDataType[0]._items&&o.SPAudioDataType[0]._items.length)for(let a=0;a<o.SPAudioDataType[0]._items.length;a++){const u=pp(o.SPAudioDataType[0]._items[a],a);e.push(u)}}catch{Ce.noop()}t&&t(e),r(e)}),sp&&Ce.powerShell("Get-CimInstance Win32_SoundDevice | select DeviceID,StatusInfo,Name,Manufacturer | fl").then((n,i)=>{i||n.toString().split(/\n\s*\n/).forEach(o=>{const a=o.split(`
385
+ `);Ce.getValue(a,"name",":")&&e.push(dp(a))}),t&&t(e),r(e)}),lp&&r(null)})})}$o.audio=mp;var Ro={};const hp=M.exec,gp=M.execSync,yp=M,_t=W,Sp=M;let Et=process.platform;const wp=Et==="linux"||Et==="android",vp=Et==="darwin",xp=Et==="win32",Cp=Et==="freebsd",Ip=Et==="openbsd",_p=Et==="netbsd",Ep=Et==="sunos";function Hs(t){let r="";return t.indexOf("keyboard")>=0&&(r="Keyboard"),t.indexOf("mouse")>=0&&(r="Mouse"),t.indexOf("trackpad")>=0&&(r="Trackpad"),t.indexOf("speaker")>=0&&(r="Speaker"),t.indexOf("headset")>=0&&(r="Headset"),t.indexOf("phone")>=0&&(r="Phone"),t.indexOf("macbook")>=0&&(r="Computer"),t.indexOf("imac")>=0&&(r="Computer"),t.indexOf("ipad")>=0&&(r="Tablet"),t.indexOf("watch")>=0&&(r="Watch"),t.indexOf("headphone")>=0&&(r="Headset"),r}function Op(t){let r=t.split(" ")[0];return t=t.toLowerCase(),t.indexOf("apple")>=0&&(r="Apple"),t.indexOf("ipad")>=0&&(r="Apple"),t.indexOf("imac")>=0&&(r="Apple"),t.indexOf("iphone")>=0&&(r="Apple"),t.indexOf("magic mouse")>=0&&(r="Apple"),t.indexOf("magic track")>=0&&(r="Apple"),t.indexOf("macbook")>=0&&(r="Apple"),r}function Lp(t,r,e){const n={};return n.device=null,n.name=_t.getValue(t,"name","="),n.manufacturer=null,n.macDevice=r,n.macHost=e,n.batteryPercent=null,n.type=Hs(n.name.toLowerCase()),n.connected=!1,n}function zs(t,r){const e={},n=((t.device_minorClassOfDevice_string||t.device_majorClassOfDevice_string||t.device_minorType||"")+(t.device_name||"")).toLowerCase();return e.device=t.device_services||"",e.name=t.device_name||"",e.manufacturer=t.device_manufacturer||Op(t.device_name||"")||"",e.macDevice=(t.device_addr||t.device_address||"").toLowerCase().replace(/-/g,":"),e.macHost=r,e.batteryPercent=t.device_batteryPercent||null,e.type=Hs(n),e.connected=t.device_isconnected==="attrib_Yes"||!1,e}function Pp(t){const r={};return r.device=null,r.name=_t.getValue(t,"name",":"),r.manufacturer=_t.getValue(t,"manufacturer",":"),r.macDevice=null,r.macHost=null,r.batteryPercent=null,r.type=Hs(r.name.toLowerCase()),r.connected=null,r}function Tp(t){return new Promise(r=>{process.nextTick(()=>{let e=[];if(wp){_t.getFilesInPath("/var/lib/bluetooth/").forEach(i=>{const s=yp.basename(i),o=i.split("/"),a=o.length>=6?o[o.length-2]:null,u=o.length>=7?o[o.length-3]:null;if(s==="info"){const l=Sp.readFileSync(i,{encoding:"utf8"}).split(`
386
+ `);e.push(Lp(l,a,u))}});try{const i=gp("hcitool con").toString().toLowerCase();for(let s=0;s<e.length;s++)e[s].macDevice&&e[s].macDevice.length>10&&i.indexOf(e[s].macDevice.toLowerCase())>=0&&(e[s].connected=!0)}catch{_t.noop()}t&&t(e),r(e)}vp&&hp("system_profiler SPBluetoothDataType -json",function(i,s){if(!i)try{const o=JSON.parse(s.toString());if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_title&&o.SPBluetoothDataType[0].device_title.length){let a=null;o.SPBluetoothDataType[0].local_device_title&&o.SPBluetoothDataType[0].local_device_title.general_address&&(a=o.SPBluetoothDataType[0].local_device_title.general_address.toLowerCase().replace(/-/g,":")),o.SPBluetoothDataType[0].device_title.forEach(u=>{const l=u,c=Object.keys(l);if(c&&c.length===1){const f=l[c[0]];f.device_name=c[0];const p=zs(f,a);e.push(p)}})}if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_connected&&o.SPBluetoothDataType[0].device_connected.length){const a=o.SPBluetoothDataType[0].controller_properties&&o.SPBluetoothDataType[0].controller_properties.controller_address?o.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;o.SPBluetoothDataType[0].device_connected.forEach(u=>{const l=u,c=Object.keys(l);if(c&&c.length===1){const f=l[c[0]];f.device_name=c[0],f.device_isconnected="attrib_Yes";const p=zs(f,a);e.push(p)}})}if(o.SPBluetoothDataType&&o.SPBluetoothDataType.length&&o.SPBluetoothDataType[0]&&o.SPBluetoothDataType[0].device_not_connected&&o.SPBluetoothDataType[0].device_not_connected.length){const a=o.SPBluetoothDataType[0].controller_properties&&o.SPBluetoothDataType[0].controller_properties.controller_address?o.SPBluetoothDataType[0].controller_properties.controller_address.toLowerCase().replace(/-/g,":"):null;o.SPBluetoothDataType[0].device_not_connected.forEach(u=>{const l=u,c=Object.keys(l);if(c&&c.length===1){const f=l[c[0]];f.device_name=c[0],f.device_isconnected="attrib_No";const p=zs(f,a);e.push(p)}})}}catch{_t.noop()}t&&t(e),r(e)}),xp&&_t.powerShell("Get-CimInstance Win32_PNPEntity | select PNPClass, Name, Manufacturer | fl").then((n,i)=>{i||n.toString().split(/\n\s*\n/).forEach(o=>{_t.getValue(o.split(`
387
+ `),"PNPClass",":")==="Bluetooth"&&e.push(Pp(o.split(`
388
+ `)))}),t&&t(e),r(e)}),(Cp||_p||Ip||Ep)&&r(null)})})}Ro.bluetoothDevices=Tp,function(t){const r=xl.version,e=W,n=wr,i=Yt,s=et,o=ys,a=ju,u=Zi,l=Nt,c=$t,f=Sn,p=xn,d=Io,m=bs,g=yt,S=Po,h=To,y=bo,w=$o,v=Ro;let x=process.platform;const z=x==="win32",R=x==="freebsd",Z=x==="openbsd",L=x==="netbsd",Y=x==="sunos";z&&e.getCodepage();function X(){return r}function oe(O){return new Promise(V=>{process.nextTick(()=>{let A={};A.version=X(),Promise.all([n.system(),n.bios(),n.baseboard(),n.chassis(),i.osInfo(),i.uuid(),i.versions(),s.cpu(),s.cpuFlags(),u.graphics(),c.networkInterfaces(),o.memLayout(),l.diskLayout()]).then(D=>{A.system=D[0],A.bios=D[1],A.baseboard=D[2],A.chassis=D[3],A.os=D[4],A.uuid=D[5],A.versions=D[6],A.cpu=D[7],A.cpu.flags=D[8],A.graphics=D[9],A.net=D[10],A.memLayout=D[11],A.diskLayout=D[12],O&&O(A),V(A)})})})}function N(O,V,A){return e.isFunction(V)&&(A=V,V=""),e.isFunction(O)&&(A=O,O=""),new Promise(D=>{process.nextTick(()=>{V=V||c.getDefaultNetworkInterface(),O=O||"";let _=function(){let U=15;return z&&(U=13),(R||Z||L)&&(U=11),Y&&(U=6),function(){--U===0&&(A&&A(H),D(H))}}(),H={};H.time=i.time(),H.node=process.versions.node,H.v8=process.versions.v8,s.cpuCurrentSpeed().then(U=>{H.cpuCurrentSpeed=U,_()}),d.users().then(U=>{H.users=U,_()}),p.processes().then(U=>{H.processes=U,_()}),s.currentLoad().then(U=>{H.currentLoad=U,_()}),Y||s.cpuTemperature().then(U=>{H.temp=U,_()}),!Z&&!R&&!L&&!Y&&c.networkStats(V).then(U=>{H.networkStats=U,_()}),Y||c.networkConnections().then(U=>{H.networkConnections=U,_()}),o.mem().then(U=>{H.mem=U,_()}),Y||a().then(U=>{H.battery=U,_()}),Y||p.services(O).then(U=>{H.services=U,_()}),Y||l.fsSize().then(U=>{H.fsSize=U,_()}),!z&&!Z&&!R&&!L&&!Y&&l.fsStats().then(U=>{H.fsStats=U,_()}),!z&&!Z&&!R&&!L&&!Y&&l.disksIO().then(U=>{H.disksIO=U,_()}),!Z&&!R&&!L&&!Y&&f.wifiNetworks().then(U=>{H.wifiNetworks=U,_()}),m.inetLatency().then(U=>{H.inetLatency=U,_()})})})}function P(O,V,A){return new Promise(D=>{process.nextTick(()=>{let _={};V&&e.isFunction(V)&&!A&&(A=V,V=""),O&&e.isFunction(O)&&!V&&!A&&(A=O,O="",V=""),oe().then(H=>{_=H,N(O,V).then(U=>{for(let se in U)({}).hasOwnProperty.call(U,se)&&(_[se]=U[se]);A&&A(_),D(_)})})})})}function b(O,V){return new Promise(A=>{process.nextTick(()=>{const D=Object.keys(O).filter(_=>({}).hasOwnProperty.call(t,_)).map(_=>{const H=O[_].substring(O[_].lastIndexOf("(")+1,O[_].lastIndexOf(")"));let U=_.indexOf(")")>=0?_.split(")")[1].trim():_;return U=_.indexOf("|")>=0?_.split("|")[0].trim():U,H?t[U](H):t[U]("")});Promise.all(D).then(_=>{const H={};let U=0;for(let se in O)if({}.hasOwnProperty.call(O,se)&&{}.hasOwnProperty.call(t,se)&&_.length>U){if(O[se]==="*"||O[se]==="all")H[se]=_[U];else{let fe=O[se],Yn="",yr=[];if(fe.indexOf(")")>=0&&(fe=fe.split(")")[1].trim()),fe.indexOf("|")>=0&&(Yn=fe.split("|")[1].trim(),yr=Yn.split(":"),fe=fe.split("|")[0].trim()),fe=fe.replace(/,/g," ").replace(/ +/g," ").split(" "),_[U])if(Array.isArray(_[U])){const Ut=[];_[U].forEach(jt=>{let Ht={};if(fe.length===1&&(fe[0]==="*"||fe[0]==="all")?Ht=jt:fe.forEach(Lt=>{({}).hasOwnProperty.call(jt,Lt)&&(Ht[Lt]=jt[Lt])}),Yn&&yr.length===2){if({}.hasOwnProperty.call(Ht,yr[0].trim())){const Lt=Ht[yr[0].trim()];typeof Lt=="number"?Lt===parseFloat(yr[1].trim())&&Ut.push(Ht):typeof Lt=="string"&&Lt.toLowerCase()===yr[1].trim().toLowerCase()&&Ut.push(Ht)}}else Ut.push(Ht)}),H[se]=Ut}else{const Ut={};fe.forEach(jt=>{({}).hasOwnProperty.call(_[U],jt)&&(Ut[jt]=_[U][jt])}),H[se]=Ut}else H[se]={}}U++}V&&V(H),A(H)})})})}function G(O,V,A){let D=null;return setInterval(()=>{b(O).then(H=>{JSON.stringify(D)!==JSON.stringify(H)&&(D=Object.assign({},H),A(H))})},V)}t.version=X,t.system=n.system,t.bios=n.bios,t.baseboard=n.baseboard,t.chassis=n.chassis,t.time=i.time,t.osInfo=i.osInfo,t.versions=i.versions,t.shell=i.shell,t.uuid=i.uuid,t.cpu=s.cpu,t.cpuFlags=s.cpuFlags,t.cpuCache=s.cpuCache,t.cpuCurrentSpeed=s.cpuCurrentSpeed,t.cpuTemperature=s.cpuTemperature,t.currentLoad=s.currentLoad,t.fullLoad=s.fullLoad,t.mem=o.mem,t.memLayout=o.memLayout,t.battery=a,t.graphics=u.graphics,t.fsSize=l.fsSize,t.fsOpenFiles=l.fsOpenFiles,t.blockDevices=l.blockDevices,t.fsStats=l.fsStats,t.disksIO=l.disksIO,t.diskLayout=l.diskLayout,t.networkInterfaceDefault=c.networkInterfaceDefault,t.networkGatewayDefault=c.networkGatewayDefault,t.networkInterfaces=c.networkInterfaces,t.networkStats=c.networkStats,t.networkConnections=c.networkConnections,t.wifiNetworks=f.wifiNetworks,t.wifiInterfaces=f.wifiInterfaces,t.wifiConnections=f.wifiConnections,t.services=p.services,t.processes=p.processes,t.processLoad=p.processLoad,t.users=d.users,t.inetChecksite=m.inetChecksite,t.inetLatency=m.inetLatency,t.dockerInfo=g.dockerInfo,t.dockerImages=g.dockerImages,t.dockerContainers=g.dockerContainers,t.dockerContainerStats=g.dockerContainerStats,t.dockerContainerProcesses=g.dockerContainerProcesses,t.dockerVolumes=g.dockerVolumes,t.dockerAll=g.dockerAll,t.vboxInfo=S.vboxInfo,t.printer=h.printer,t.usb=y.usb,t.audio=w.audio,t.bluetoothDevices=v.bluetoothDevices,t.getStaticData=oe,t.getDynamicData=N,t.getAllData=P,t.get=b,t.observe=G,t.powerShellStart=e.powerShellStart,t.powerShellRelease=e.powerShellRelease}(Jn);const Vp=t=>{const r=(void 0)("md5").update(t).digest("hex");return`${r.substring(0,8)}-${r.substring(8,12)}-${r.substring(12,16)}-${r.substring(16,20)}-${r.substring(20,32)}`},Mo=async t=>new Promise(async(r,e)=>{try{const n=await Jn.baseboard(),i=`${n.manufacturer}-:-${n.model}-:-${n.version}-::-`,s=await Jn.system(),o=`${s.serial}-:-${s.uuid}`,a=i+o,u=Vp(a).toUpperCase();r(`NI-${t||"APP"}-${u}`)}catch{e()}});var Ue={},Xs={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,r){var e=M,n=e.Buffer;function i(o,a){for(var u in o)a[u]=o[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=e:(i(e,r),r.Buffer=s);function s(o,a,u){return n(o,a,u)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,u)},s.alloc=function(o,a,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof u=="string"?l.fill(a,u):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return e.SlowBuffer(o)}})(Xs,Xs.exports);var Wr=Xs.exports,_n=Wr.Buffer,Ap=M,bp=M;function En(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=_n.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=_n.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick((function(){this.emit("end",t),this.readable=!1,this.emit("close")}).bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}bp.inherits(En,Ap),En.prototype.write=function(r){this.buffer=_n.concat([this.buffer,_n.from(r)]),this.emit("data",r)},En.prototype.end=function(r){r&&this.write(r),this.emit("end",r),this.emit("close"),this.writable=!1,this.readable=!1};var Bo=En,Gr=M.Buffer,ks=M.SlowBuffer,Np=On;function On(t,r){if(!Gr.isBuffer(t)||!Gr.isBuffer(r)||t.length!==r.length)return!1;for(var e=0,n=0;n<t.length;n++)e|=t[n]^r[n];return e===0}On.install=function(){Gr.prototype.equal=ks.prototype.equal=function(r){return On(this,r)}};var $p=Gr.prototype.equal,Dp=ks.prototype.equal;On.restore=function(){Gr.prototype.equal=$p,ks.prototype.equal=Dp};function qs(t){var r=(t/8|0)+(t%8===0?0:1);return r}var Rp={ES256:qs(256),ES384:qs(384),ES512:qs(521)};function Mp(t){var r=Rp[t];if(r)return r;throw new Error('Unknown algorithm "'+t+'"')}var Bp=Mp,Ln=Wr.Buffer,Fo=Bp,Pn=128,Wo=0,Fp=32,Wp=16,Gp=2,Go=Wp|Fp|Wo<<6,Tn=Gp|Wo<<6;function Up(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Uo(t){if(Ln.isBuffer(t))return t;if(typeof t=="string")return Ln.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function jp(t,r){t=Uo(t);var e=Fo(r),n=e+1,i=t.length,s=0;if(t[s++]!==Go)throw new Error('Could not find expected "seq"');var o=t[s++];if(o===(Pn|1)&&(o=t[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(t[s++]!==Tn)throw new Error('Could not find expected "int" for "r"');var a=t[s++];if(i-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var u=s;if(s+=a,t[s++]!==Tn)throw new Error('Could not find expected "int" for "s"');var l=t[s++];if(i-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(i-s)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var c=s;if(s+=l,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=e-a,p=e-l,d=Ln.allocUnsafe(f+a+p+l);for(s=0;s<f;++s)d[s]=0;t.copy(d,s,u+Math.max(-f,0),u+a),s=e;for(var m=s;s<m+p;++s)d[s]=0;return t.copy(d,s,c+Math.max(-p,0),c+l),d=d.toString("base64"),d=Up(d),d}function jo(t,r,e){for(var n=0;r+n<e&&t[r+n]===0;)++n;var i=t[r+n]>=Pn;return i&&--n,n}function Hp(t,r){t=Uo(t);var e=Fo(r),n=t.length;if(n!==e*2)throw new TypeError('"'+r+'" signatures must be "'+e*2+'" bytes, saw "'+n+'"');var i=jo(t,0,e),s=jo(t,e,t.length),o=e-i,a=e-s,u=2+o+1+1+a,l=u<Pn,c=Ln.allocUnsafe((l?2:3)+u),f=0;return c[f++]=Go,l?c[f++]=u:(c[f++]=Pn|1,c[f++]=u&255),c[f++]=Tn,c[f++]=o,i<0?(c[f++]=0,f+=t.copy(c,f,0,e)):f+=t.copy(c,f,i,e),c[f++]=Tn,c[f++]=a,s<0?(c[f++]=0,t.copy(c,f,e)):t.copy(c,f,e+s),c}var zp={derToJose:jp,joseToDer:Hp},Xp=Np,ar=Wr.Buffer,je=M,Ho=zp,zo=M,kp=`"%s" is not a valid algorithm.
389
+ Supported algorithms are:
390
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Ur="secret must be a string or buffer",lr="key must be a string or a buffer",qp="key must be a string, a buffer or an object",Ks=typeof je.createPublicKey=="function";Ks&&(lr+=" or a KeyObject",Ur+="or a KeyObject");function Xo(t){if(!ar.isBuffer(t)&&typeof t!="string"&&(!Ks||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw De(lr)}function ko(t){if(!ar.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw De(qp)}function Kp(t){if(!ar.isBuffer(t)){if(typeof t=="string")return t;if(!Ks||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw De(Ur)}}function Ys(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function qo(t){t=t.toString();var r=4-t.length%4;if(r!==4)for(var e=0;e<r;++e)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}function De(t){var r=[].slice.call(arguments,1),e=zo.format.bind(zo,t).apply(null,r);return new TypeError(e)}function Yp(t){return ar.isBuffer(t)||typeof t=="string"}function jr(t){return Yp(t)||(t=JSON.stringify(t)),t}function Ko(t){return function(e,n){Kp(n),e=jr(e);var i=je.createHmac("sha"+t,n),s=(i.update(e),i.digest("base64"));return Ys(s)}}function Jp(t){return function(e,n,i){var s=Ko(t)(e,i);return Xp(ar.from(n),ar.from(s))}}function Yo(t){return function(e,n){ko(n),e=jr(e);var i=je.createSign("RSA-SHA"+t),s=(i.update(e),i.sign(n,"base64"));return Ys(s)}}function Jo(t){return function(e,n,i){Xo(i),e=jr(e),n=qo(n);var s=je.createVerify("RSA-SHA"+t);return s.update(e),s.verify(i,n,"base64")}}function Qp(t){return function(e,n){ko(n),e=jr(e);var i=je.createSign("RSA-SHA"+t),s=(i.update(e),i.sign({key:n,padding:je.constants.RSA_PKCS1_PSS_PADDING,saltLength:je.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Ys(s)}}function Zp(t){return function(e,n,i){Xo(i),e=jr(e),n=qo(n);var s=je.createVerify("RSA-SHA"+t);return s.update(e),s.verify({key:i,padding:je.constants.RSA_PKCS1_PSS_PADDING,saltLength:je.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function ed(t){var r=Yo(t);return function(){var n=r.apply(null,arguments);return n=Ho.derToJose(n,"ES"+t),n}}function td(t){var r=Jo(t);return function(n,i,s){i=Ho.joseToDer(i,"ES"+t).toString("base64");var o=r(n,i,s);return o}}function rd(){return function(){return""}}function nd(){return function(r,e){return e===""}}var Qo=function(r){var e={hs:Ko,rs:Yo,ps:Qp,es:ed,none:rd},n={hs:Jp,rs:Jo,ps:Zp,es:td,none:nd},i=r.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/i);if(!i)throw De(kp,r);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:e[s](o),verify:n[s](o)}},sd=M.Buffer,Zo=function(r){return typeof r=="string"?r:typeof r=="number"||sd.isBuffer(r)?r.toString():JSON.stringify(r)},id=Wr.Buffer,ea=Bo,od=Qo,ad=M,ta=Zo,Js=M;function ra(t,r){return id.from(t,r).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ld(t,r,e){e=e||"utf8";var n=ra(ta(t),"binary"),i=ra(ta(r),e);return Js.format("%s.%s",n,i)}function na(t){var r=t.header,e=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=od(r.alg),o=ld(r,e,i),a=s.sign(o,n);return Js.format("%s.%s",o,a)}function Vn(t){var r=t.secret||t.privateKey||t.key,e=new ea(r);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=e,this.payload=new ea(t.payload),this.secret.once("close",(function(){!this.payload.writable&&this.readable&&this.sign()}).bind(this)),this.payload.once("close",(function(){!this.secret.writable&&this.readable&&this.sign()}).bind(this))}Js.inherits(Vn,ad),Vn.prototype.sign=function(){try{var r=na({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",r),this.emit("data",r),this.emit("end"),this.readable=!1,r}catch(e){this.readable=!1,this.emit("error",e),this.emit("close")}},Vn.sign=na;var ud=Vn,sa=Wr.Buffer,ia=Bo,cd=Qo,fd=M,oa=Zo,pd=M,dd=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function md(t){return Object.prototype.toString.call(t)==="[object Object]"}function hd(t){if(md(t))return t;try{return JSON.parse(t)}catch{return}}function aa(t){var r=t.split(".",1)[0];return hd(sa.from(r,"base64").toString("binary"))}function gd(t){return t.split(".",2).join(".")}function la(t){return t.split(".")[2]}function yd(t,r){r=r||"utf8";var e=t.split(".")[1];return sa.from(e,"base64").toString(r)}function ua(t){return dd.test(t)&&!!aa(t)}function ca(t,r,e){if(!r){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=oa(t);var i=la(t),s=gd(t),o=cd(r);return o.verify(s,i,e)}function fa(t,r){if(r=r||{},t=oa(t),!ua(t))return null;var e=aa(t);if(!e)return null;var n=yd(t);return(e.typ==="JWT"||r.json)&&(n=JSON.parse(n,r.encoding)),{header:e,payload:n,signature:la(t)}}function ur(t){t=t||{};var r=t.secret||t.publicKey||t.key,e=new ia(r);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=e,this.signature=new ia(t.signature),this.secret.once("close",(function(){!this.signature.writable&&this.readable&&this.verify()}).bind(this)),this.signature.once("close",(function(){!this.secret.writable&&this.readable&&this.verify()}).bind(this))}pd.inherits(ur,fd),ur.prototype.verify=function(){try{var r=ca(this.signature.buffer,this.algorithm,this.key.buffer),e=fa(this.signature.buffer,this.encoding);return this.emit("done",r,e),this.emit("data",r),this.emit("end"),this.readable=!1,r}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},ur.decode=fa,ur.isValid=ua,ur.verify=ca;var Sd=ur,pa=ud,An=Sd,wd=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ue.ALGORITHMS=wd,Ue.sign=pa.sign,Ue.verify=An.verify,Ue.decode=An.decode,Ue.isValid=An.isValid,Ue.createSign=function(r){return new pa(r)},Ue.createVerify=function(r){return new An(r)};var vd=Ue,da=function(t,r){r=r||{};var e=vd.decode(t,r);if(!e)return null;var n=e.payload;if(typeof n=="string")try{var i=JSON.parse(n);i!==null&&typeof i=="object"&&(n=i)}catch{}return r.complete===!0?{header:e.header,payload:n,signature:e.signature}:n},bn=function(t,r){Error.call(this,t),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=t,r&&(this.inner=r)};bn.prototype=Object.create(Error.prototype),bn.prototype.constructor=bn;var Nn=bn,ma=Nn,$n=function(t,r){ma.call(this,t),this.name="NotBeforeError",this.date=r};$n.prototype=Object.create(ma.prototype),$n.prototype.constructor=$n;var ha=$n,ga=Nn,Dn=function(t,r){ga.call(this,t),this.name="TokenExpiredError",this.expiredAt=r};Dn.prototype=Object.create(ga.prototype),Dn.prototype.constructor=Dn;var ya=Dn,cr=1e3,fr=cr*60,pr=fr*60,Bt=pr*24,xd=Bt*7,Cd=Bt*365.25,Id=function(t,r){r=r||{};var e=typeof t;if(e==="string"&&t.length>0)return _d(t);if(e==="number"&&isFinite(t))return r.long?Od(t):Ed(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function _d(t){if(t=String(t),!(t.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(r){var e=parseFloat(r[1]),n=(r[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return e*Cd;case"weeks":case"week":case"w":return e*xd;case"days":case"day":case"d":return e*Bt;case"hours":case"hour":case"hrs":case"hr":case"h":return e*pr;case"minutes":case"minute":case"mins":case"min":case"m":return e*fr;case"seconds":case"second":case"secs":case"sec":case"s":return e*cr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}function Ed(t){var r=Math.abs(t);return r>=Bt?Math.round(t/Bt)+"d":r>=pr?Math.round(t/pr)+"h":r>=fr?Math.round(t/fr)+"m":r>=cr?Math.round(t/cr)+"s":t+"ms"}function Od(t){var r=Math.abs(t);return r>=Bt?Rn(t,r,Bt,"day"):r>=pr?Rn(t,r,pr,"hour"):r>=fr?Rn(t,r,fr,"minute"):r>=cr?Rn(t,r,cr,"second"):t+" ms"}function Rn(t,r,e,n){var i=r>=e*1.5;return Math.round(t/e)+" "+n+(i?"s":"")}var Ld=Id,Sa=function(t,r){var e=r||Math.floor(Date.now()/1e3);if(typeof t=="string"){var n=Ld(t);return typeof n>"u"?void 0:Math.floor(e+n/1e3)}else return typeof t=="number"?e+t:void 0},Qs={exports:{}};const Pd="2.0.0",wa=256,Td=Number.MAX_SAFE_INTEGER||9007199254740991,Vd=16,Ad=wa-6;var Mn={MAX_LENGTH:wa,MAX_SAFE_COMPONENT_LENGTH:Vd,MAX_SAFE_BUILD_LENGTH:Ad,MAX_SAFE_INTEGER:Td,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:Pd,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Bn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};(function(t,r){const{MAX_SAFE_COMPONENT_LENGTH:e,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Mn,s=Bn;r=t.exports={};const o=r.re=[],a=r.safeRe=[],u=r.src=[],l=r.t={};let c=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[f,n]],d=g=>{for(const[S,h]of p)g=g.split(`${S}*`).join(`${S}{0,${h}}`).split(`${S}+`).join(`${S}{1,${h}}`);return g},m=(g,S,h)=>{const y=d(S),w=c++;s(g,w,S),l[g]=w,u[w]=S,o[w]=new RegExp(S,h?"g":void 0),a[w]=new RegExp(y,h?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),m("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${f}+`),m("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),m("FULL",`^${u[l.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),m("LOOSE",`^${u[l.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),m("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),m("COERCE",`(^|[^\\d])(\\d{1,${e}})(?:\\.(\\d{1,${e}}))?(?:\\.(\\d{1,${e}}))?(?:$|[^\\d])`),m("COERCERTL",u[l.COERCE],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",m("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",m("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Qs,Qs.exports);var Hr=Qs.exports;const bd=Object.freeze({loose:!0}),Nd=Object.freeze({});var Zs=t=>t?typeof t!="object"?bd:t:Nd;const va=/^[0-9]+$/,xa=(t,r)=>{const e=va.test(t),n=va.test(r);return e&&n&&(t=+t,r=+r),t===r?0:e&&!n?-1:n&&!e?1:t<r?-1:1};var Ca={compareIdentifiers:xa,rcompareIdentifiers:(t,r)=>xa(r,t)};const Fn=Bn,{MAX_LENGTH:Ia,MAX_SAFE_INTEGER:Wn}=Mn,{safeRe:_a,t:Ea}=Hr,$d=Zs,{compareIdentifiers:dr}=Ca;var ve=class He{constructor(r,e){if(e=$d(e),r instanceof He){if(r.loose===!!e.loose&&r.includePrerelease===!!e.includePrerelease)return r;r=r.version}else if(typeof r!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof r}".`);if(r.length>Ia)throw new TypeError(`version is longer than ${Ia} characters`);Fn("SemVer",r,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const n=r.trim().match(e.loose?_a[Ea.LOOSE]:_a[Ea.FULL]);if(!n)throw new TypeError(`Invalid Version: ${r}`);if(this.raw=r,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Wn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Wn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Wn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<Wn)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(r){if(Fn("SemVer.compare",this.version,this.options,r),!(r instanceof He)){if(typeof r=="string"&&r===this.version)return 0;r=new He(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(r){return r instanceof He||(r=new He(r,this.options)),dr(this.major,r.major)||dr(this.minor,r.minor)||dr(this.patch,r.patch)}comparePre(r){if(r instanceof He||(r=new He(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let e=0;do{const n=this.prerelease[e],i=r.prerelease[e];if(Fn("prerelease compare",e,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return dr(n,i)}while(++e)}compareBuild(r){r instanceof He||(r=new He(r,this.options));let e=0;do{const n=this.build[e],i=r.build[e];if(Fn("prerelease compare",e,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return dr(n,i)}while(++e)}inc(r,e,n){switch(r){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e,n),this.inc("pre",e,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",e,n),this.inc("pre",e,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!e&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(e===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(e){let s=[e,i];n===!1&&(s=[e]),dr(this.prerelease[0],e)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${r}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const Oa=ve;var mr=(t,r,e=!1)=>{if(t instanceof Oa)return t;try{return new Oa(t,r)}catch(n){if(!e)return null;throw n}};const Dd=mr;var Rd=(t,r)=>{const e=Dd(t,r);return e?e.version:null};const Md=mr;var Bd=(t,r)=>{const e=Md(t.trim().replace(/^[=v]+/,""),r);return e?e.version:null};const La=ve;var Fd=(t,r,e,n,i)=>{typeof e=="string"&&(i=n,n=e,e=void 0);try{return new La(t instanceof La?t.version:t,e).inc(r,n,i).version}catch{return null}};const Pa=mr;var Wd=(t,r)=>{const e=Pa(t,null,!0),n=Pa(r,null,!0),i=e.compare(n);if(i===0)return null;const s=i>0,o=s?e:n,a=s?n:e,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const c=u?"pre":"";return e.major!==n.major?c+"major":e.minor!==n.minor?c+"minor":e.patch!==n.patch?c+"patch":"prerelease"};const Gd=ve;var Ud=(t,r)=>new Gd(t,r).major;const jd=ve;var Hd=(t,r)=>new jd(t,r).minor;const zd=ve;var Xd=(t,r)=>new zd(t,r).patch;const kd=mr;var qd=(t,r)=>{const e=kd(t,r);return e&&e.prerelease.length?e.prerelease:null};const Ta=ve;var Re=(t,r,e)=>new Ta(t,e).compare(new Ta(r,e));const Kd=Re;var Yd=(t,r,e)=>Kd(r,t,e);const Jd=Re;var Qd=(t,r)=>Jd(t,r,!0);const Va=ve;var ei=(t,r,e)=>{const n=new Va(t,e),i=new Va(r,e);return n.compare(i)||n.compareBuild(i)};const Zd=ei;var e0=(t,r)=>t.sort((e,n)=>Zd(e,n,r));const t0=ei;var r0=(t,r)=>t.sort((e,n)=>t0(n,e,r));const n0=Re;var Gn=(t,r,e)=>n0(t,r,e)>0;const s0=Re;var ti=(t,r,e)=>s0(t,r,e)<0;const i0=Re;var Aa=(t,r,e)=>i0(t,r,e)===0;const o0=Re;var ba=(t,r,e)=>o0(t,r,e)!==0;const a0=Re;var ri=(t,r,e)=>a0(t,r,e)>=0;const l0=Re;var ni=(t,r,e)=>l0(t,r,e)<=0;const u0=Aa,c0=ba,f0=Gn,p0=ri,d0=ti,m0=ni;var Na=(t,r,e,n)=>{switch(r){case"===":return typeof t=="object"&&(t=t.version),typeof e=="object"&&(e=e.version),t===e;case"!==":return typeof t=="object"&&(t=t.version),typeof e=="object"&&(e=e.version),t!==e;case"":case"=":case"==":return u0(t,e,n);case"!=":return c0(t,e,n);case">":return f0(t,e,n);case">=":return p0(t,e,n);case"<":return d0(t,e,n);case"<=":return m0(t,e,n);default:throw new TypeError(`Invalid operator: ${r}`)}};const h0=ve,g0=mr,{safeRe:Un,t:jn}=Hr;var y0=(t,r)=>{if(t instanceof h0)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;r=r||{};let e=null;if(!r.rtl)e=t.match(Un[jn.COERCE]);else{let n;for(;(n=Un[jn.COERCERTL].exec(t))&&(!e||e.index+e[0].length!==t.length);)(!e||n.index+n[0].length!==e.index+e[0].length)&&(e=n),Un[jn.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Un[jn.COERCERTL].lastIndex=-1}return e===null?null:g0(`${e[2]}.${e[3]||"0"}.${e[4]||"0"}`,r)},si,$a;function S0(){return $a||($a=1,si=function(t){t.prototype[Symbol.iterator]=function*(){for(let r=this.head;r;r=r.next)yield r.value}}),si}var w0=ie;ie.Node=Ft,ie.create=ie;function ie(t){var r=this;if(r instanceof ie||(r=new ie),r.tail=null,r.head=null,r.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){r.push(i)});else if(arguments.length>0)for(var e=0,n=arguments.length;e<n;e++)r.push(arguments[e]);return r}ie.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var r=t.next,e=t.prev;return r&&(r.prev=e),e&&(e.next=r),t===this.head&&(this.head=r),t===this.tail&&(this.tail=e),t.list.length--,t.next=null,t.prev=null,t.list=null,r},ie.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var r=this.head;t.list=this,t.next=r,r&&(r.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},ie.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var r=this.tail;t.list=this,t.prev=r,r&&(r.next=t),this.tail=t,this.head||(this.head=t),this.length++}},ie.prototype.push=function(){for(var t=0,r=arguments.length;t<r;t++)x0(this,arguments[t]);return this.length},ie.prototype.unshift=function(){for(var t=0,r=arguments.length;t<r;t++)C0(this,arguments[t]);return this.length},ie.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},ie.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},ie.prototype.forEach=function(t,r){r=r||this;for(var e=this.head,n=0;e!==null;n++)t.call(r,e.value,n,this),e=e.next},ie.prototype.forEachReverse=function(t,r){r=r||this;for(var e=this.tail,n=this.length-1;e!==null;n--)t.call(r,e.value,n,this),e=e.prev},ie.prototype.get=function(t){for(var r=0,e=this.head;e!==null&&r<t;r++)e=e.next;if(r===t&&e!==null)return e.value},ie.prototype.getReverse=function(t){for(var r=0,e=this.tail;e!==null&&r<t;r++)e=e.prev;if(r===t&&e!==null)return e.value},ie.prototype.map=function(t,r){r=r||this;for(var e=new ie,n=this.head;n!==null;)e.push(t.call(r,n.value,this)),n=n.next;return e},ie.prototype.mapReverse=function(t,r){r=r||this;for(var e=new ie,n=this.tail;n!==null;)e.push(t.call(r,n.value,this)),n=n.prev;return e},ie.prototype.reduce=function(t,r){var e,n=this.head;if(arguments.length>1)e=r;else if(this.head)n=this.head.next,e=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)e=t(e,n.value,i),n=n.next;return e},ie.prototype.reduceReverse=function(t,r){var e,n=this.tail;if(arguments.length>1)e=r;else if(this.tail)n=this.tail.prev,e=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)e=t(e,n.value,i),n=n.prev;return e},ie.prototype.toArray=function(){for(var t=new Array(this.length),r=0,e=this.head;e!==null;r++)t[r]=e.value,e=e.next;return t},ie.prototype.toArrayReverse=function(){for(var t=new Array(this.length),r=0,e=this.tail;e!==null;r++)t[r]=e.value,e=e.prev;return t},ie.prototype.slice=function(t,r){r=r||this.length,r<0&&(r+=this.length),t=t||0,t<0&&(t+=this.length);var e=new ie;if(r<t||r<0)return e;t<0&&(t=0),r>this.length&&(r=this.length);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(;i!==null&&n<r;n++,i=i.next)e.push(i.value);return e},ie.prototype.sliceReverse=function(t,r){r=r||this.length,r<0&&(r+=this.length),t=t||0,t<0&&(t+=this.length);var e=new ie;if(r<t||r<0)return e;t<0&&(t=0),r>this.length&&(r=this.length);for(var n=this.length,i=this.tail;i!==null&&n>r;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)e.push(i.value);return e},ie.prototype.splice=function(t,r,...e){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(var s=[],n=0;i&&n<r;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<e.length;n++)i=v0(this,i,e[n]);return s},ie.prototype.reverse=function(){for(var t=this.head,r=this.tail,e=t;e!==null;e=e.prev){var n=e.prev;e.prev=e.next,e.next=n}return this.head=r,this.tail=t,this};function v0(t,r,e){var n=r===t.head?new Ft(e,null,r,t):new Ft(e,r,r.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function x0(t,r){t.tail=new Ft(r,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function C0(t,r){t.head=new Ft(r,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function Ft(t,r,e,n){if(!(this instanceof Ft))return new Ft(t,r,e,n);this.list=n,this.value=t,r?(r.next=this,this.prev=r):this.prev=null,e?(e.prev=this,this.next=e):this.next=null}try{S0()(ie)}catch{}const I0=w0,Wt=Symbol("max"),qe=Symbol("length"),hr=Symbol("lengthCalculator"),zr=Symbol("allowStale"),Gt=Symbol("maxAge"),Ke=Symbol("dispose"),Da=Symbol("noDisposeOnSet"),he=Symbol("lruList"),Me=Symbol("cache"),Ra=Symbol("updateAgeOnGet"),ii=()=>1;class _0{constructor(r){if(typeof r=="number"&&(r={max:r}),r||(r={}),r.max&&(typeof r.max!="number"||r.max<0))throw new TypeError("max must be a non-negative number");this[Wt]=r.max||1/0;const e=r.length||ii;if(this[hr]=typeof e!="function"?ii:e,this[zr]=r.stale||!1,r.maxAge&&typeof r.maxAge!="number")throw new TypeError("maxAge must be a number");this[Gt]=r.maxAge||0,this[Ke]=r.dispose,this[Da]=r.noDisposeOnSet||!1,this[Ra]=r.updateAgeOnGet||!1,this.reset()}set max(r){if(typeof r!="number"||r<0)throw new TypeError("max must be a non-negative number");this[Wt]=r||1/0,Xr(this)}get max(){return this[Wt]}set allowStale(r){this[zr]=!!r}get allowStale(){return this[zr]}set maxAge(r){if(typeof r!="number")throw new TypeError("maxAge must be a non-negative number");this[Gt]=r,Xr(this)}get maxAge(){return this[Gt]}set lengthCalculator(r){typeof r!="function"&&(r=ii),r!==this[hr]&&(this[hr]=r,this[qe]=0,this[he].forEach(e=>{e.length=this[hr](e.value,e.key),this[qe]+=e.length})),Xr(this)}get lengthCalculator(){return this[hr]}get length(){return this[qe]}get itemCount(){return this[he].length}rforEach(r,e){e=e||this;for(let n=this[he].tail;n!==null;){const i=n.prev;Ma(this,r,n,e),n=i}}forEach(r,e){e=e||this;for(let n=this[he].head;n!==null;){const i=n.next;Ma(this,r,n,e),n=i}}keys(){return this[he].toArray().map(r=>r.key)}values(){return this[he].toArray().map(r=>r.value)}reset(){this[Ke]&&this[he]&&this[he].length&&this[he].forEach(r=>this[Ke](r.key,r.value)),this[Me]=new Map,this[he]=new I0,this[qe]=0}dump(){return this[he].map(r=>Hn(this,r)?!1:{k:r.key,v:r.value,e:r.now+(r.maxAge||0)}).toArray().filter(r=>r)}dumpLru(){return this[he]}set(r,e,n){if(n=n||this[Gt],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[hr](e,r);if(this[Me].has(r)){if(s>this[Wt])return gr(this,this[Me].get(r)),!1;const u=this[Me].get(r).value;return this[Ke]&&(this[Da]||this[Ke](r,u.value)),u.now=i,u.maxAge=n,u.value=e,this[qe]+=s-u.length,u.length=s,this.get(r),Xr(this),!0}const o=new E0(r,e,s,i,n);return o.length>this[Wt]?(this[Ke]&&this[Ke](r,e),!1):(this[qe]+=o.length,this[he].unshift(o),this[Me].set(r,this[he].head),Xr(this),!0)}has(r){if(!this[Me].has(r))return!1;const e=this[Me].get(r).value;return!Hn(this,e)}get(r){return oi(this,r,!0)}peek(r){return oi(this,r,!1)}pop(){const r=this[he].tail;return r?(gr(this,r),r.value):null}del(r){gr(this,this[Me].get(r))}load(r){this.reset();const e=Date.now();for(let n=r.length-1;n>=0;n--){const i=r[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-e;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Me].forEach((r,e)=>oi(this,e,!1))}}const oi=(t,r,e)=>{const n=t[Me].get(r);if(n){const i=n.value;if(Hn(t,i)){if(gr(t,n),!t[zr])return}else e&&(t[Ra]&&(n.value.now=Date.now()),t[he].unshiftNode(n));return i.value}},Hn=(t,r)=>{if(!r||!r.maxAge&&!t[Gt])return!1;const e=Date.now()-r.now;return r.maxAge?e>r.maxAge:t[Gt]&&e>t[Gt]},Xr=t=>{if(t[qe]>t[Wt])for(let r=t[he].tail;t[qe]>t[Wt]&&r!==null;){const e=r.prev;gr(t,r),r=e}},gr=(t,r)=>{if(r){const e=r.value;t[Ke]&&t[Ke](e.key,e.value),t[qe]-=e.length,t[Me].delete(e.key),t[he].removeNode(r)}};class E0{constructor(r,e,n,i,s){this.key=r,this.value=e,this.length=n,this.now=i,this.maxAge=s||0}}const Ma=(t,r,e,n)=>{let i=e.value;Hn(t,i)&&(gr(t,e),t[zr]||(i=void 0)),i&&r.call(n,i.value,i.key,t)};var O0=_0,ai,Ba;function Be(){if(Ba)return ai;Ba=1;class t{constructor(P,b){if(b=n(b),P instanceof t)return P.loose===!!b.loose&&P.includePrerelease===!!b.includePrerelease?P:new t(P.raw,b);if(P instanceof i)return this.raw=P.value,this.set=[[P]],this.format(),this;if(this.options=b,this.loose=!!b.loose,this.includePrerelease=!!b.includePrerelease,this.raw=P.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(G=>this.parseRange(G.trim())).filter(G=>G.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const G=this.set[0];if(this.set=this.set.filter(O=>!m(O[0])),this.set.length===0)this.set=[G];else if(this.set.length>1){for(const O of this.set)if(O.length===1&&g(O[0])){this.set=[O];break}}}this.format()}format(){return this.range=this.set.map(P=>P.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(P){const G=((this.options.includePrerelease&&p)|(this.options.loose&&d))+":"+P,O=e.get(G);if(O)return O;const V=this.options.loose,A=V?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];P=P.replace(A,X(this.options.includePrerelease)),s("hyphen replace",P),P=P.replace(a[u.COMPARATORTRIM],l),s("comparator trim",P),P=P.replace(a[u.TILDETRIM],c),s("tilde trim",P),P=P.replace(a[u.CARETTRIM],f),s("caret trim",P);let D=P.split(" ").map(se=>h(se,this.options)).join(" ").split(/\s+/).map(se=>Y(se,this.options));V&&(D=D.filter(se=>(s("loose invalid filter",se,this.options),!!se.match(a[u.COMPARATORLOOSE])))),s("range list",D);const _=new Map,H=D.map(se=>new i(se,this.options));for(const se of H){if(m(se))return[se];_.set(se.value,se)}_.size>1&&_.has("")&&_.delete("");const U=[..._.values()];return e.set(G,U),U}intersects(P,b){if(!(P instanceof t))throw new TypeError("a Range is required");return this.set.some(G=>S(G,b)&&P.set.some(O=>S(O,b)&&G.every(V=>O.every(A=>V.intersects(A,b)))))}test(P){if(!P)return!1;if(typeof P=="string")try{P=new o(P,this.options)}catch{return!1}for(let b=0;b<this.set.length;b++)if(oe(this.set[b],P,this.options))return!0;return!1}}ai=t;const r=O0,e=new r({max:1e3}),n=Zs,i=zn(),s=Bn,o=ve,{safeRe:a,t:u,comparatorTrimReplace:l,tildeTrimReplace:c,caretTrimReplace:f}=Hr,{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:d}=Mn,m=N=>N.value==="<0.0.0-0",g=N=>N.value==="",S=(N,P)=>{let b=!0;const G=N.slice();let O=G.pop();for(;b&&G.length;)b=G.every(V=>O.intersects(V,P)),O=G.pop();return b},h=(N,P)=>(s("comp",N,P),N=x(N,P),s("caret",N),N=w(N,P),s("tildes",N),N=R(N,P),s("xrange",N),N=L(N,P),s("stars",N),N),y=N=>!N||N.toLowerCase()==="x"||N==="*",w=(N,P)=>N.trim().split(/\s+/).map(b=>v(b,P)).join(" "),v=(N,P)=>{const b=P.loose?a[u.TILDELOOSE]:a[u.TILDE];return N.replace(b,(G,O,V,A,D)=>{s("tilde",N,G,O,V,A,D);let _;return y(O)?_="":y(V)?_=`>=${O}.0.0 <${+O+1}.0.0-0`:y(A)?_=`>=${O}.${V}.0 <${O}.${+V+1}.0-0`:D?(s("replaceTilde pr",D),_=`>=${O}.${V}.${A}-${D} <${O}.${+V+1}.0-0`):_=`>=${O}.${V}.${A} <${O}.${+V+1}.0-0`,s("tilde return",_),_})},x=(N,P)=>N.trim().split(/\s+/).map(b=>z(b,P)).join(" "),z=(N,P)=>{s("caret",N,P);const b=P.loose?a[u.CARETLOOSE]:a[u.CARET],G=P.includePrerelease?"-0":"";return N.replace(b,(O,V,A,D,_)=>{s("caret",N,O,V,A,D,_);let H;return y(V)?H="":y(A)?H=`>=${V}.0.0${G} <${+V+1}.0.0-0`:y(D)?V==="0"?H=`>=${V}.${A}.0${G} <${V}.${+A+1}.0-0`:H=`>=${V}.${A}.0${G} <${+V+1}.0.0-0`:_?(s("replaceCaret pr",_),V==="0"?A==="0"?H=`>=${V}.${A}.${D}-${_} <${V}.${A}.${+D+1}-0`:H=`>=${V}.${A}.${D}-${_} <${V}.${+A+1}.0-0`:H=`>=${V}.${A}.${D}-${_} <${+V+1}.0.0-0`):(s("no pr"),V==="0"?A==="0"?H=`>=${V}.${A}.${D}${G} <${V}.${A}.${+D+1}-0`:H=`>=${V}.${A}.${D}${G} <${V}.${+A+1}.0-0`:H=`>=${V}.${A}.${D} <${+V+1}.0.0-0`),s("caret return",H),H})},R=(N,P)=>(s("replaceXRanges",N,P),N.split(/\s+/).map(b=>Z(b,P)).join(" ")),Z=(N,P)=>{N=N.trim();const b=P.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return N.replace(b,(G,O,V,A,D,_)=>{s("xRange",N,G,O,V,A,D,_);const H=y(V),U=H||y(A),se=U||y(D),fe=se;return O==="="&&fe&&(O=""),_=P.includePrerelease?"-0":"",H?O===">"||O==="<"?G="<0.0.0-0":G="*":O&&fe?(U&&(A=0),D=0,O===">"?(O=">=",U?(V=+V+1,A=0,D=0):(A=+A+1,D=0)):O==="<="&&(O="<",U?V=+V+1:A=+A+1),O==="<"&&(_="-0"),G=`${O+V}.${A}.${D}${_}`):U?G=`>=${V}.0.0${_} <${+V+1}.0.0-0`:se&&(G=`>=${V}.${A}.0${_} <${V}.${+A+1}.0-0`),s("xRange return",G),G})},L=(N,P)=>(s("replaceStars",N,P),N.trim().replace(a[u.STAR],"")),Y=(N,P)=>(s("replaceGTE0",N,P),N.trim().replace(a[P.includePrerelease?u.GTE0PRE:u.GTE0],"")),X=N=>(P,b,G,O,V,A,D,_,H,U,se,fe,Yn)=>(y(G)?b="":y(O)?b=`>=${G}.0.0${N?"-0":""}`:y(V)?b=`>=${G}.${O}.0${N?"-0":""}`:A?b=`>=${b}`:b=`>=${b}${N?"-0":""}`,y(H)?_="":y(U)?_=`<${+H+1}.0.0-0`:y(se)?_=`<${H}.${+U+1}.0-0`:fe?_=`<=${H}.${U}.${se}-${fe}`:N?_=`<${H}.${U}.${+se+1}-0`:_=`<=${_}`,`${b} ${_}`.trim()),oe=(N,P,b)=>{for(let G=0;G<N.length;G++)if(!N[G].test(P))return!1;if(P.prerelease.length&&!b.includePrerelease){for(let G=0;G<N.length;G++)if(s(N[G].semver),N[G].semver!==i.ANY&&N[G].semver.prerelease.length>0){const O=N[G].semver;if(O.major===P.major&&O.minor===P.minor&&O.patch===P.patch)return!0}return!1}return!0};return ai}var li,Fa;function zn(){if(Fa)return li;Fa=1;const t=Symbol("SemVer ANY");class r{static get ANY(){return t}constructor(c,f){if(f=e(f),c instanceof r){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],p=c.match(f);if(!p)throw new TypeError(`Invalid comparator: ${c}`);this.operator=p[1]!==void 0?p[1]:"",this.operator==="="&&(this.operator=""),p[2]?this.semver=new a(p[2],this.options.loose):this.semver=t}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===t||c===t)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=e(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}li=r;const e=Zs,{safeRe:n,t:i}=Hr,s=Na,o=Bn,a=ve,u=Be();return li}const L0=Be();var Xn=(t,r,e)=>{try{r=new L0(r,e)}catch{return!1}return r.test(t)};const P0=Be();var T0=(t,r)=>new P0(t,r).set.map(e=>e.map(n=>n.value).join(" ").trim().split(" "));const V0=ve,A0=Be();var b0=(t,r,e)=>{let n=null,i=null,s=null;try{s=new A0(r,e)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new V0(n,e))}),n};const N0=ve,$0=Be();var D0=(t,r,e)=>{let n=null,i=null,s=null;try{s=new $0(r,e)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new N0(n,e))}),n};const ui=ve,R0=Be(),Wa=Gn;var M0=(t,r)=>{t=new R0(t,r);let e=new ui("0.0.0");if(t.test(e)||(e=new ui("0.0.0-0"),t.test(e)))return e;e=null;for(let n=0;n<t.set.length;++n){const i=t.set[n];let s=null;i.forEach(o=>{const a=new ui(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Wa(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!e||Wa(e,s))&&(e=s)}return e&&t.test(e)?e:null};const B0=Be();var F0=(t,r)=>{try{return new B0(t,r).range||"*"}catch{return null}};const W0=ve,Ga=zn(),{ANY:G0}=Ga,U0=Be(),j0=Xn,Ua=Gn,ja=ti,H0=ni,z0=ri;var ci=(t,r,e,n)=>{t=new W0(t,n),r=new U0(r,n);let i,s,o,a,u;switch(e){case">":i=Ua,s=H0,o=ja,a=">",u=">=";break;case"<":i=ja,s=z0,o=Ua,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(j0(t,r,n))return!1;for(let l=0;l<r.set.length;++l){const c=r.set[l];let f=null,p=null;if(c.forEach(d=>{d.semver===G0&&(d=new Ga(">=0.0.0")),f=f||d,p=p||d,i(d.semver,f.semver,n)?f=d:o(d.semver,p.semver,n)&&(p=d)}),f.operator===a||f.operator===u||(!p.operator||p.operator===a)&&s(t,p.semver))return!1;if(p.operator===u&&o(t,p.semver))return!1}return!0};const X0=ci;var k0=(t,r,e)=>X0(t,r,">",e);const q0=ci;var K0=(t,r,e)=>q0(t,r,"<",e);const Ha=Be();var Y0=(t,r,e)=>(t=new Ha(t,e),r=new Ha(r,e),t.intersects(r,e));const J0=Xn,Q0=Re;var Z0=(t,r,e)=>{const n=[];let i=null,s=null;const o=t.sort((c,f)=>Q0(c,f,e));for(const c of o)J0(c,r,e)?(s=c,i||(i=c)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[c,f]of n)c===f?a.push(c):!f&&c===o[0]?a.push("*"):f?c===o[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);const u=a.join(" || "),l=typeof r.raw=="string"?r.raw:String(r);return u.length<l.length?u:r};const za=Be(),fi=zn(),{ANY:pi}=fi,kr=Xn,di=Re,em=(t,r,e={})=>{if(t===r)return!0;t=new za(t,e),r=new za(r,e);let n=!1;e:for(const i of t.set){for(const s of r.set){const o=rm(i,s,e);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},tm=[new fi(">=0.0.0-0")],Xa=[new fi(">=0.0.0")],rm=(t,r,e)=>{if(t===r)return!0;if(t.length===1&&t[0].semver===pi){if(r.length===1&&r[0].semver===pi)return!0;e.includePrerelease?t=tm:t=Xa}if(r.length===1&&r[0].semver===pi){if(e.includePrerelease)return!0;r=Xa}const n=new Set;let i,s;for(const d of t)d.operator===">"||d.operator===">="?i=ka(i,d,e):d.operator==="<"||d.operator==="<="?s=qa(s,d,e):n.add(d.semver);if(n.size>1)return null;let o;if(i&&s){if(o=di(i.semver,s.semver,e),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const d of n){if(i&&!kr(d,String(i),e)||s&&!kr(d,String(s),e))return null;for(const m of r)if(!kr(d,String(m),e))return!1;return!0}let a,u,l,c,f=s&&!e.includePrerelease&&s.semver.prerelease.length?s.semver:!1,p=i&&!e.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const d of r){if(c=c||d.operator===">"||d.operator===">=",l=l||d.operator==="<"||d.operator==="<=",i){if(p&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch&&(p=!1),d.operator===">"||d.operator===">="){if(a=ka(i,d,e),a===d&&a!==i)return!1}else if(i.operator===">="&&!kr(i.semver,String(d),e))return!1}if(s){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(u=qa(s,d,e),u===d&&u!==s)return!1}else if(s.operator==="<="&&!kr(s.semver,String(d),e))return!1}if(!d.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&c&&!i&&o!==0||p||f)},ka=(t,r,e)=>{if(!t)return r;const n=di(t.semver,r.semver,e);return n>0?t:n<0||r.operator===">"&&t.operator===">="?r:t},qa=(t,r,e)=>{if(!t)return r;const n=di(t.semver,r.semver,e);return n<0?t:n>0||r.operator==="<"&&t.operator==="<="?r:t};var nm=em;const mi=Hr,Ka=Mn,sm=ve,Ya=Ca,im=mr,om=Rd,am=Bd,lm=Fd,um=Wd,cm=Ud,fm=Hd,pm=Xd,dm=qd,mm=Re,hm=Yd,gm=Qd,ym=ei,Sm=e0,wm=r0,vm=Gn,xm=ti,Cm=Aa,Im=ba,_m=ri,Em=ni,Om=Na,Lm=y0,Pm=zn(),Tm=Be();var hi={parse:im,valid:om,clean:am,inc:lm,diff:um,major:cm,minor:fm,patch:pm,prerelease:dm,compare:mm,rcompare:hm,compareLoose:gm,compareBuild:ym,sort:Sm,rsort:wm,gt:vm,lt:xm,eq:Cm,neq:Im,gte:_m,lte:Em,cmp:Om,coerce:Lm,Comparator:Pm,Range:Tm,satisfies:Xn,toComparators:T0,maxSatisfying:b0,minSatisfying:D0,minVersion:M0,validRange:F0,outside:ci,gtr:k0,ltr:K0,intersects:Y0,simplifyRange:Z0,subset:nm,SemVer:sm,re:mi.re,src:mi.src,tokens:mi.t,SEMVER_SPEC_VERSION:Ka.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ka.RELEASE_TYPES,compareIdentifiers:Ya.compareIdentifiers,rcompareIdentifiers:Ya.rcompareIdentifiers},Vm=hi.satisfies(process.version,">=15.7.0"),Am=hi.satisfies(process.version,">=16.9.0");const bm=Vm,Nm=Am,$m={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},Dm={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};var Ja=function(t,r){if(!t||!r)return;const e=r.asymmetricKeyType;if(!e)return;const n=$m[e];if(!n)throw new Error(`Unknown key type "${e}".`);if(!n.includes(t))throw new Error(`"alg" parameter for "${e}" key type must be one of: ${n.join(", ")}.`);if(bm)switch(e){case"ec":const i=r.asymmetricKeyDetails.namedCurve,s=Dm[t];if(i!==s)throw new Error(`"alg" parameter "${t}" requires curve "${s}".`);break;case"rsa-pss":if(Nm){const o=parseInt(t.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:u,saltLength:l}=r.asymmetricKeyDetails;if(a!==`sha${o}`||u!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${t}.`);if(l!==void 0&&l>o>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${t}.`)}break}},Rm=hi,Qa=Rm.satisfies(process.version,"^6.12.0 || >=8.0.0");const ae=Nn,Mm=ha,Za=ya,Bm=da,Fm=Sa,Wm=Ja,Gm=Qa,Um=Ue,{KeyObject:jm,createSecretKey:Hm,createPublicKey:zm}=M,gi=["RS256","RS384","RS512"],Xm=["ES256","ES384","ES512"],yi=["RS256","RS384","RS512"],km=["HS256","HS384","HS512"];Gm&&(gi.splice(gi.length,0,"PS256","PS384","PS512"),yi.splice(yi.length,0,"PS256","PS384","PS512"));var qm=function(t,r,e,n){typeof e=="function"&&!n&&(n=e,e={}),e||(e={}),e=Object.assign({},e);let i;if(n?i=n:i=function(c,f){if(c)throw c;return f},e.clockTimestamp&&typeof e.clockTimestamp!="number")return i(new ae("clockTimestamp must be a number"));if(e.nonce!==void 0&&(typeof e.nonce!="string"||e.nonce.trim()===""))return i(new ae("nonce must be a non-empty string"));if(e.allowInvalidAsymmetricKeyTypes!==void 0&&typeof e.allowInvalidAsymmetricKeyTypes!="boolean")return i(new ae("allowInvalidAsymmetricKeyTypes must be a boolean"));const s=e.clockTimestamp||Math.floor(Date.now()/1e3);if(!t)return i(new ae("jwt must be provided"));if(typeof t!="string")return i(new ae("jwt must be a string"));const o=t.split(".");if(o.length!==3)return i(new ae("jwt malformed"));let a;try{a=Bm(t,{complete:!0})}catch(c){return i(c)}if(!a)return i(new ae("invalid token"));const u=a.header;let l;if(typeof r=="function"){if(!n)return i(new ae("verify must be called asynchronous if secret or public key is provided as a callback"));l=r}else l=function(c,f){return f(null,r)};return l(u,function(c,f){if(c)return i(new ae("error in secret or public key callback: "+c.message));const p=o[2].trim()!=="";if(!p&&f)return i(new ae("jwt signature is required"));if(p&&!f)return i(new ae("secret or public key must be provided"));if(!p&&!e.algorithms)return i(new ae('please specify "none" in "algorithms" to verify unsigned tokens'));if(f!=null&&!(f instanceof jm))try{f=zm(f)}catch{try{f=Hm(typeof f=="string"?Buffer.from(f):f)}catch{return i(new ae("secretOrPublicKey is not valid key material"))}}if(e.algorithms||(f.type==="secret"?e.algorithms=km:["rsa","rsa-pss"].includes(f.asymmetricKeyType)?e.algorithms=yi:f.asymmetricKeyType==="ec"?e.algorithms=Xm:e.algorithms=gi),e.algorithms.indexOf(a.header.alg)===-1)return i(new ae("invalid algorithm"));if(u.alg.startsWith("HS")&&f.type!=="secret")return i(new ae(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&f.type!=="public")return i(new ae(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!e.allowInvalidAsymmetricKeyTypes)try{Wm(u.alg,f)}catch(g){return i(g)}let d;try{d=Um.verify(t,a.header.alg,f)}catch(g){return i(g)}if(!d)return i(new ae("invalid signature"));const m=a.payload;if(typeof m.nbf<"u"&&!e.ignoreNotBefore){if(typeof m.nbf!="number")return i(new ae("invalid nbf value"));if(m.nbf>s+(e.clockTolerance||0))return i(new Mm("jwt not active",new Date(m.nbf*1e3)))}if(typeof m.exp<"u"&&!e.ignoreExpiration){if(typeof m.exp!="number")return i(new ae("invalid exp value"));if(s>=m.exp+(e.clockTolerance||0))return i(new Za("jwt expired",new Date(m.exp*1e3)))}if(e.audience){const g=Array.isArray(e.audience)?e.audience:[e.audience];if(!(Array.isArray(m.aud)?m.aud:[m.aud]).some(function(y){return g.some(function(w){return w instanceof RegExp?w.test(y):w===y})}))return i(new ae("jwt audience invalid. expected: "+g.join(" or ")))}if(e.issuer&&(typeof e.issuer=="string"&&m.iss!==e.issuer||Array.isArray(e.issuer)&&e.issuer.indexOf(m.iss)===-1))return i(new ae("jwt issuer invalid. expected: "+e.issuer));if(e.subject&&m.sub!==e.subject)return i(new ae("jwt subject invalid. expected: "+e.subject));if(e.jwtid&&m.jti!==e.jwtid)return i(new ae("jwt jwtid invalid. expected: "+e.jwtid));if(e.nonce&&m.nonce!==e.nonce)return i(new ae("jwt nonce invalid. expected: "+e.nonce));if(e.maxAge){if(typeof m.iat!="number")return i(new ae("iat required when maxAge is specified"));const g=Fm(e.maxAge,m.iat);if(typeof g>"u")return i(new ae('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(s>=g+(e.clockTolerance||0))return i(new Za("maxAge exceeded",new Date(g*1e3)))}if(e.complete===!0){const g=a.signature;return i(null,{header:u,payload:m,signature:g})}return i(null,m)})},el=1/0,tl=9007199254740991,Km=17976931348623157e292,rl=NaN,Ym="[object Arguments]",Jm="[object Function]",Qm="[object GeneratorFunction]",Zm="[object String]",eh="[object Symbol]",th=/^\s+|\s+$/g,rh=/^[-+]0x[0-9a-f]+$/i,nh=/^0b[01]+$/i,sh=/^0o[0-7]+$/i,ih=/^(?:0|[1-9]\d*)$/,oh=parseInt;function ah(t,r){for(var e=-1,n=t?t.length:0,i=Array(n);++e<n;)i[e]=r(t[e],e,t);return i}function lh(t,r,e,n){for(var i=t.length,s=e+(n?1:-1);n?s--:++s<i;)if(r(t[s],s,t))return s;return-1}function uh(t,r,e){if(r!==r)return lh(t,ch,e);for(var n=e-1,i=t.length;++n<i;)if(t[n]===r)return n;return-1}function ch(t){return t!==t}function fh(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n}function ph(t,r){return ah(r,function(e){return t[e]})}function dh(t,r){return function(e){return t(r(e))}}var kn=Object.prototype,Si=kn.hasOwnProperty,qn=kn.toString,mh=kn.propertyIsEnumerable,hh=dh(Object.keys,Object),gh=Math.max;function yh(t,r){var e=nl(t)||Ch(t)?fh(t.length,String):[],n=e.length,i=!!n;for(var s in t)(r||Si.call(t,s))&&!(i&&(s=="length"||wh(s,n)))&&e.push(s);return e}function Sh(t){if(!vh(t))return hh(t);var r=[];for(var e in Object(t))Si.call(t,e)&&e!="constructor"&&r.push(e);return r}function wh(t,r){return r=r??tl,!!r&&(typeof t=="number"||ih.test(t))&&t>-1&&t%1==0&&t<r}function vh(t){var r=t&&t.constructor,e=typeof r=="function"&&r.prototype||kn;return t===e}function xh(t,r,e,n){t=wi(t)?t:bh(t),e=e&&!n?Th(e):0;var i=t.length;return e<0&&(e=gh(i+e,0)),Oh(t)?e<=i&&t.indexOf(r,e)>-1:!!i&&uh(t,r,e)>-1}function Ch(t){return Ih(t)&&Si.call(t,"callee")&&(!mh.call(t,"callee")||qn.call(t)==Ym)}var nl=Array.isArray;function wi(t){return t!=null&&Eh(t.length)&&!_h(t)}function Ih(t){return xi(t)&&wi(t)}function _h(t){var r=vi(t)?qn.call(t):"";return r==Jm||r==Qm}function Eh(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=tl}function vi(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function xi(t){return!!t&&typeof t=="object"}function Oh(t){return typeof t=="string"||!nl(t)&&xi(t)&&qn.call(t)==Zm}function Lh(t){return typeof t=="symbol"||xi(t)&&qn.call(t)==eh}function Ph(t){if(!t)return t===0?t:0;if(t=Vh(t),t===el||t===-el){var r=t<0?-1:1;return r*Km}return t===t?t:0}function Th(t){var r=Ph(t),e=r%1;return r===r?e?r-e:r:0}function Vh(t){if(typeof t=="number")return t;if(Lh(t))return rl;if(vi(t)){var r=typeof t.valueOf=="function"?t.valueOf():t;t=vi(r)?r+"":r}if(typeof t!="string")return t===0?t:+t;t=t.replace(th,"");var e=nh.test(t);return e||sh.test(t)?oh(t.slice(2),e?2:8):rh.test(t)?rl:+t}function Ah(t){return wi(t)?yh(t):Sh(t)}function bh(t){return t?ph(t,Ah(t)):[]}var Nh=xh,$h="[object Boolean]",Dh=Object.prototype,Rh=Dh.toString;function Mh(t){return t===!0||t===!1||Bh(t)&&Rh.call(t)==$h}function Bh(t){return!!t&&typeof t=="object"}var Fh=Mh,sl=1/0,Wh=17976931348623157e292,il=NaN,Gh="[object Symbol]",Uh=/^\s+|\s+$/g,jh=/^[-+]0x[0-9a-f]+$/i,Hh=/^0b[01]+$/i,zh=/^0o[0-7]+$/i,Xh=parseInt,kh=Object.prototype,qh=kh.toString;function Kh(t){return typeof t=="number"&&t==Zh(t)}function ol(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function Yh(t){return!!t&&typeof t=="object"}function Jh(t){return typeof t=="symbol"||Yh(t)&&qh.call(t)==Gh}function Qh(t){if(!t)return t===0?t:0;if(t=eg(t),t===sl||t===-sl){var r=t<0?-1:1;return r*Wh}return t===t?t:0}function Zh(t){var r=Qh(t),e=r%1;return r===r?e?r-e:r:0}function eg(t){if(typeof t=="number")return t;if(Jh(t))return il;if(ol(t)){var r=typeof t.valueOf=="function"?t.valueOf():t;t=ol(r)?r+"":r}if(typeof t!="string")return t===0?t:+t;t=t.replace(Uh,"");var e=Hh.test(t);return e||zh.test(t)?Xh(t.slice(2),e?2:8):jh.test(t)?il:+t}var tg=Kh,rg="[object Number]",ng=Object.prototype,sg=ng.toString;function ig(t){return!!t&&typeof t=="object"}function og(t){return typeof t=="number"||ig(t)&&sg.call(t)==rg}var ag=og,lg="[object Object]";function ug(t){var r=!1;if(t!=null&&typeof t.toString!="function")try{r=!!(t+"")}catch{}return r}function cg(t,r){return function(e){return t(r(e))}}var fg=Function.prototype,al=Object.prototype,ll=fg.toString,pg=al.hasOwnProperty,dg=ll.call(Object),mg=al.toString,hg=cg(Object.getPrototypeOf,Object);function gg(t){return!!t&&typeof t=="object"}function yg(t){if(!gg(t)||mg.call(t)!=lg||ug(t))return!1;var r=hg(t);if(r===null)return!0;var e=pg.call(r,"constructor")&&r.constructor;return typeof e=="function"&&e instanceof e&&ll.call(e)==dg}var Sg=yg,wg="[object String]",vg=Object.prototype,xg=vg.toString,Cg=Array.isArray;function Ig(t){return!!t&&typeof t=="object"}function _g(t){return typeof t=="string"||!Cg(t)&&Ig(t)&&xg.call(t)==wg}var Eg=_g,Og="Expected a function",ul=1/0,Lg=17976931348623157e292,cl=NaN,Pg="[object Symbol]",Tg=/^\s+|\s+$/g,Vg=/^[-+]0x[0-9a-f]+$/i,Ag=/^0b[01]+$/i,bg=/^0o[0-7]+$/i,Ng=parseInt,$g=Object.prototype,Dg=$g.toString;function Rg(t,r){var e;if(typeof r!="function")throw new TypeError(Og);return t=Gg(t),function(){return--t>0&&(e=r.apply(this,arguments)),t<=1&&(r=void 0),e}}function Mg(t){return Rg(2,t)}function fl(t){var r=typeof t;return!!t&&(r=="object"||r=="function")}function Bg(t){return!!t&&typeof t=="object"}function Fg(t){return typeof t=="symbol"||Bg(t)&&Dg.call(t)==Pg}function Wg(t){if(!t)return t===0?t:0;if(t=Ug(t),t===ul||t===-ul){var r=t<0?-1:1;return r*Lg}return t===t?t:0}function Gg(t){var r=Wg(t),e=r%1;return r===r?e?r-e:r:0}function Ug(t){if(typeof t=="number")return t;if(Fg(t))return cl;if(fl(t)){var r=typeof t.valueOf=="function"?t.valueOf():t;t=fl(r)?r+"":r}if(typeof t!="string")return t===0?t:+t;t=t.replace(Tg,"");var e=Ag.test(t);return e||bg.test(t)?Ng(t.slice(2),e?2:8):Vg.test(t)?cl:+t}var jg=Mg;const pl=Sa,Hg=Qa,zg=Ja,dl=Ue,Xg=Nh,Kn=Fh,ml=tg,Ci=ag,hl=Sg,Ot=Eg,kg=jg,{KeyObject:qg,createSecretKey:Kg,createPrivateKey:Yg}=M,gl=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];Hg&&gl.splice(3,0,"PS256","PS384","PS512");const Jg={expiresIn:{isValid:function(t){return ml(t)||Ot(t)&&t},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(t){return ml(t)||Ot(t)&&t},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(t){return Ot(t)||Array.isArray(t)},message:'"audience" must be a string or array'},algorithm:{isValid:Xg.bind(null,gl),message:'"algorithm" must be a valid string enum value'},header:{isValid:hl,message:'"header" must be an object'},encoding:{isValid:Ot,message:'"encoding" must be a string'},issuer:{isValid:Ot,message:'"issuer" must be a string'},subject:{isValid:Ot,message:'"subject" must be a string'},jwtid:{isValid:Ot,message:'"jwtid" must be a string'},noTimestamp:{isValid:Kn,message:'"noTimestamp" must be a boolean'},keyid:{isValid:Ot,message:'"keyid" must be a string'},mutatePayload:{isValid:Kn,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:Kn,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:Kn,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Qg={iat:{isValid:Ci,message:'"iat" should be a number of seconds'},exp:{isValid:Ci,message:'"exp" should be a number of seconds'},nbf:{isValid:Ci,message:'"nbf" should be a number of seconds'}};function yl(t,r,e,n){if(!hl(e))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(e).forEach(function(i){const s=t[i];if(!s){if(!r)throw new Error('"'+i+'" is not allowed in "'+n+'"');return}if(!s.isValid(e[i]))throw new Error(s.message)})}function Zg(t){return yl(Jg,!1,t,"options")}function e1(t){return yl(Qg,!0,t,"payload")}const Sl={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},t1=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];var r1=function(t,r,e,n){typeof e=="function"?(n=e,e={}):e=e||{};const i=typeof t=="object"&&!Buffer.isBuffer(t),s=Object.assign({alg:e.algorithm||"HS256",typ:i?"JWT":void 0,kid:e.keyid},e.header);function o(l){if(n)return n(l);throw l}if(!r&&e.algorithm!=="none")return o(new Error("secretOrPrivateKey must have a value"));if(r!=null&&!(r instanceof qg))try{r=Yg(r)}catch{try{r=Kg(typeof r=="string"?Buffer.from(r):r)}catch{return o(new Error("secretOrPrivateKey is not valid key material"))}}if(s.alg.startsWith("HS")&&r.type!=="secret")return o(new Error(`secretOrPrivateKey must be a symmetric key when using ${s.alg}`));if(/^(?:RS|PS|ES)/.test(s.alg)){if(r.type!=="private")return o(new Error(`secretOrPrivateKey must be an asymmetric key when using ${s.alg}`));if(!e.allowInsecureKeySizes&&!s.alg.startsWith("ES")&&r.asymmetricKeyDetails!==void 0&&r.asymmetricKeyDetails.modulusLength<2048)return o(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`))}if(typeof t>"u")return o(new Error("payload is required"));if(i){try{e1(t)}catch(l){return o(l)}e.mutatePayload||(t=Object.assign({},t))}else{const l=t1.filter(function(c){return typeof e[c]<"u"});if(l.length>0)return o(new Error("invalid "+l.join(",")+" option for "+typeof t+" payload"))}if(typeof t.exp<"u"&&typeof e.expiresIn<"u")return o(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof t.nbf<"u"&&typeof e.notBefore<"u")return o(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{Zg(e)}catch(l){return o(l)}if(!e.allowInvalidAsymmetricKeyTypes)try{zg(s.alg,r)}catch(l){return o(l)}const a=t.iat||Math.floor(Date.now()/1e3);if(e.noTimestamp?delete t.iat:i&&(t.iat=a),typeof e.notBefore<"u"){try{t.nbf=pl(e.notBefore,a)}catch(l){return o(l)}if(typeof t.nbf>"u")return o(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof e.expiresIn<"u"&&typeof t=="object"){try{t.exp=pl(e.expiresIn,a)}catch(l){return o(l)}if(typeof t.exp>"u")return o(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(Sl).forEach(function(l){const c=Sl[l];if(typeof e[l]<"u"){if(typeof t[c]<"u")return o(new Error('Bad "options.'+l+'" option. The payload already has an "'+c+'" property.'));t[c]=e[l]}});const u=e.encoding||"utf8";if(typeof n=="function")n=n&&kg(n),dl.createSign({header:s,privateKey:r,payload:t,encoding:u}).once("error",n).once("done",function(l){if(!e.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&l.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`));n(null,l)});else{let l=dl.sign({header:s,payload:t,secret:r,encoding:u});if(!e.allowInsecureKeySizes&&/^(?:RS|PS)/.test(s.alg)&&l.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${s.alg}`);return l}},n1={decode:da,verify:qm,sign:r1,JsonWebTokenError:Nn,NotBeforeError:ha,TokenExpiredError:ya};function s1(t,r){return new Promise((e,n)=>{n1.verify(t,r,async(i,s)=>{if(i)n(i);else if(s.hasOwnProperty("nodeinfo")){const o=s.application.name,a=await Mo(o);if(s.nodeinfo===a)e(s);else{const u=new Error("Node info does not match");n(u)}}else e(s||{})})})}Pt.getNodeInfo=Mo,Pt.verifyLicense=s1,Object.defineProperty(Pt,Symbol.toStringTag,{value:"Module"})});