(()=>{var t={1283:(t,e,n)=>{var r=n(73837),i=n(71017),o=n(32081).spawn,s="HKLM",u="HKCU",c="HKCR",a="HKCC",f=[s,u,c,"HKU",a],h="REG_SZ",p="REG_MULTI_SZ",l="REG_EXPAND_SZ",_="REG_DWORD",d="REG_QWORD",v="REG_BINARY",E="REG_NONE",y=[h,p,l,_,d,v,E],w=/(\\[a-zA-Z0-9_\s]+)*/,R=/^(HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER|HKEY_CLASSES_ROOT|HKEY_USERS|HKEY_CURRENT_CONFIG)(.*)$/,G=/^(.*)\s(REG_SZ|REG_MULTI_SZ|REG_EXPAND_SZ|REG_DWORD|REG_QWORD|REG_BINARY|REG_NONE)\s+([^\s].*)$/;function g(t,e){if(!(this instanceof g))return new g(t,e);Error.captureStackTrace(this,g),this.__defineGetter__("name",(function(){return g.name})),this.__defineGetter__("message",(function(){return t})),this.__defineGetter__("code",(function(){return e}))}function m(t){var e={stdout:"",stderr:""};return t.stdout.on("data",(function(t){e.stdout+=t.toString()})),t.stderr.on("data",(function(t){e.stderr+=t.toString()})),e}function D(t,e,n){var i=n.stdout.trim(),o=n.stderr.trim();return new g(r.format("%s command exited with code %d:\n%s\n%s",t,e,i,o),e)}function x(t,e){e&&t.push("/reg:"+function(t){if("x64"==t)return"64";if("x86"==t)return"32";throw new Error("illegal architecture: "+t+" (use x86 or x64)")}(e))}function k(){return"win32"===process.platform?i.join(process.env.windir,"system32","reg.exe"):"REG"}function T(t,e,n,r,i,o,s){if(!(this instanceof T))return new T(t,e,n,r,i,o,s);var u=t,c=e,a=n,f=r,h=i,p=o,l=s;this.__defineGetter__("host",(function(){return u})),this.__defineGetter__("hive",(function(){return c})),this.__defineGetter__("key",(function(){return a})),this.__defineGetter__("name",(function(){return f})),this.__defineGetter__("type",(function(){return h})),this.__defineGetter__("value",(function(){return p})),this.__defineGetter__("arch",(function(){return l}))}function S(t){if(!(this instanceof S))return new S(t);var e=t||{},n=""+(e.host||""),r=""+(e.hive||s),i=""+(e.key||""),o=e.arch||null;if(this.__defineGetter__("host",(function(){return n})),this.__defineGetter__("hive",(function(){return r})),this.__defineGetter__("key",(function(){return i})),this.__defineGetter__("path",(function(){return(0==n.length?"":"\\\\"+n+"\\")+r+i})),this.__defineGetter__("arch",(function(){return o})),this.__defineGetter__("parent",(function(){var t=i.lastIndexOf("\\");return new S({host:this.host,hive:this.hive,key:-1==t?"":i.substring(0,t),arch:this.arch})})),-1==f.indexOf(r))throw new Error("illegal hive specified.");if(!w.test(i))throw new Error("illegal key specified.");if(o&&"x64"!=o&&"x86"!=o)throw new Error("illegal architecture specified (use x86 or x64)")}r.inherits(g,Error),r.inherits(T,Object),S.HKLM=s,S.HKCU=u,S.HKCR=c,S.HKU="HKU",S.HKCC=a,S.HIVES=f,S.REG_SZ=h,S.REG_MULTI_SZ=p,S.REG_EXPAND_SZ=l,S.REG_DWORD=_,S.REG_QWORD=d,S.REG_BINARY=v,S.REG_NONE=E,S.REG_TYPES=y,S.DEFAULT_VALUE="",S.prototype.values=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["QUERY",this.path];x(e,this.arch);var n=o(k(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r="",i=this,s=null,u=m(n);return n.on("close",(function(e){if(!s)if(0!==e)t(D("QUERY",e,u),null);else{for(var n=[],o=[],c=r.split("\n"),a=0,f=0,h=c.length;f0&&(0!=a&&n.push(p),++a)}for(f=0,h=n.length;f0&&e.push(c)}for(s=0,u=e.length;s0&&(0!=a&&n.push(p),++a)}var l,_,d,v=n[n.length-1]||"",E=G.exec(v);E&&(l=E[1].trim(),_=E[2].trim(),d=E[3],r=new T(s.host,s.hive,s.key,l,_,d,s.arch)),e(null,r)}})),r.stdout.on("data",(function(t){i+=t.toString()})),r.on("error",(function(t){u=t,e(t)})),this},S.prototype.set=function(t,e,n,r){if("function"!=typeof r)throw new TypeError("must specify a callback");if(-1==y.indexOf(e))throw Error("illegal type specified.");var i=["ADD",this.path];""==t?i.push("/ve"):i=i.concat(["/v",t]),x(i=i.concat(["/t",e,"/d",n,"/f"]),this.arch);var s=o(k(),i,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),u=null,c=m(s);return s.on("close",(function(t){u||r(0!==t?D("ADD",t,c):null)})),s.stdout.on("data",(function(t){})),s.on("error",(function(t){u=t,r(t)})),this},S.prototype.remove=function(t,e){if("function"!=typeof e)throw new TypeError("must specify a callback");var n=t?["DELETE",this.path,"/f","/v",t]:["DELETE",this.path,"/f","/ve"];x(n,this.arch);var r=o(k(),n,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),i=null,s=m(r);return r.on("close",(function(t){i||(0!==t?e(D("DELETE",t,s),null):e(null))})),r.stdout.on("data",(function(t){})),r.on("error",(function(t){i=t,e(t)})),this},S.prototype.clear=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["DELETE",this.path,"/f","/va"];x(e,this.arch);var n=o(k(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r=null,i=m(n);return n.on("close",(function(e){r||(0!==e?t(D("DELETE",e,i),null):t(null))})),n.stdout.on("data",(function(t){})),n.on("error",(function(e){r=e,t(e)})),this},S.prototype.erase=S.prototype.clear,S.prototype.destroy=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["DELETE",this.path,"/f"];x(e,this.arch);var n=o(k(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r=null,i=m(n);return n.on("close",(function(e){r||(0!==e?t(D("DELETE",e,i),null):t(null))})),n.stdout.on("data",(function(t){})),n.on("error",(function(e){r=e,t(e)})),this},S.prototype.create=function(t){if("function"!=typeof t)throw new TypeError("must specify a callback");var e=["ADD",this.path,"/f"];x(e,this.arch);var n=o(k(),e,{cwd:void 0,env:process.env,stdio:["ignore","pipe","pipe"]}),r=null,i=m(n);return n.on("close",(function(e){r||(0!==e?t(D("ADD",e,i),null):t(null))})),n.stdout.on("data",(function(t){})),n.on("error",(function(e){r=e,t(e)})),this},S.prototype.keyExists=function(t){return this.values((function(e,n){if(e)return 1==e.code?t(null,!1):t(e);t(null,!0)})),this},S.prototype.valueExists=function(t,e){return this.get(t,(function(t,n){if(t)return 1==t.code?e(null,!1):e(t);e(null,!0)})),this},t.exports=S},32081:t=>{"use strict";t.exports=require("child_process")},71017:t=>{"use strict";t.exports=require("path")},73837:t=>{"use strict";t.exports=require("util")},71267:t=>{"use strict";t.exports=require("worker_threads")}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}var r={};(()=>{"use strict";var t=r;Object.defineProperty(t,"__esModule",{value:!0});const e=n(71267);new(n(1283))(e.workerData).values(((t,n)=>{if(!e.parentPort)throw new Error("Not in a worker thread");const r=n.map((t=>({hive:t.hive,arch:t.arch,key:t.key,name:t.name,type:t.type,value:t.value})));e.parentPort.postMessage({err:t,res:r})}))})(),module.exports=r})(); //# sourceMappingURL=registryValues.worker.js.map