azureauth 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var wn=Object.create;var Ae=Object.defineProperty;var En=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var vn=Object.getPrototypeOf,In=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!In.call(e,o)&&o!==n&&Ae(e,o,{get:()=>t[o],enumerable:!(r=En(t,o))||r.enumerable});return e};var g=(e,t,n)=>(n=e!=null?wn(vn(e)):{},Pn(t||!e||!e.__esModule?Ae(n,"default",{value:e,enumerable:!0}):n,e));var Le=d((Kr,je)=>{je.exports=Ne;Ne.sync=Gn;var Re=require("fs");function Cn(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function $e(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:Cn(t,n)}function Ne(e,t,n){Re.stat(e,function(r,o){n(r,r?!1:$e(o,e,t))})}function Gn(e,t){return $e(Re.statSync(e),e,t)}});var Fe=d((Xr,Ue)=>{Ue.exports=Be;Be.sync=On;var ke=require("fs");function Be(e,t,n){ke.stat(e,function(r,o){n(r,r?!1:Me(o,t))})}function On(e,t){return Me(ke.statSync(e),t)}function Me(e,t){return e.isFile()&&An(e,t)}function An(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),f=a|c,h=n&u||n&c&&o===s||n&a&&r===i||n&f&&i===0;return h}});var qe=d((Yr,_e)=>{var Vr=require("fs"),M;process.platform==="win32"||global.TESTING_WINDOWS?M=Le():M=Fe();_e.exports=Q;Q.sync=Rn;function Q(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Q(e,t||{},function(i,s){i?o(i):r(s)})})}M(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function Rn(e,t){try{return M.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var Ve=d((Qr,Xe)=>{var T=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",De=require("path"),$n=T?";":":",He=qe(),ze=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),We=(e,t)=>{let n=t.colon||$n,r=e.match(/\//)||T&&e.match(/\\/)?[""]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=T?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=T?o.split(n):[""];return T&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},Ke=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=We(e,t),s=[],a=u=>new Promise((f,h)=>{if(u===r.length)return t.all&&s.length?f(s):h(ze(e));let m=r[u],S=/^".*"$/.test(m)?m.slice(1,-1):m,y=De.join(S,e),x=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;f(c(x,u,0))}),c=(u,f,h)=>new Promise((m,S)=>{if(h===o.length)return m(a(f+1));let y=o[h];He(u+y,{pathExt:i},(x,E)=>{if(!x&&E)if(t.all)s.push(u+y);else return m(u+y);return m(c(u,f,h+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},Nn=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=We(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=De.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let h=0;h<r.length;h++){let m=f+r[h];try{if(He.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw ze(e)};Xe.exports=Ke;Ke.sync=Nn});var Qe=d((Zr,Z)=>{"use strict";var Ye=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Z.exports=Ye;Z.exports.default=Ye});var tt=d((Jr,et)=>{"use strict";var Ze=require("path"),jn=Ve(),Ln=Qe();function Je(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=jn.sync(e.command,{path:n[Ln({env:n})],pathExt:t?Ze.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Ze.resolve(o?e.options.cwd:"",s)),s}function kn(e){return Je(e)||Je(e,!0)}et.exports=kn});var nt=d((eo,ee)=>{"use strict";var J=/([()\][%!^"`<>&|;, *?])/g;function Bn(e){return e=e.replace(J,"^$1"),e}function Mn(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(J,"^$1"),t&&(e=e.replace(J,"^$1")),e}ee.exports.command=Bn;ee.exports.argument=Mn});var ot=d((to,rt)=>{"use strict";rt.exports=/^#!(.*)/});var st=d((no,it)=>{"use strict";var Un=ot();it.exports=(e="")=>{let t=e.match(Un);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var ct=d((ro,at)=>{"use strict";var te=require("fs"),Fn=st();function _n(e){let n=Buffer.alloc(150),r;try{r=te.openSync(e,"r"),te.readSync(r,n,0,150,0),te.closeSync(r)}catch{}return Fn(n.toString())}at.exports=_n});var dt=d((oo,lt)=>{"use strict";var qn=require("path"),ut=tt(),ft=nt(),Dn=ct(),Hn=process.platform==="win32",zn=/\.(?:com|exe)$/i,Wn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Kn(e){e.file=ut(e);let t=e.file&&Dn(e.file);return t?(e.args.unshift(e.file),e.command=t,ut(e)):e.file}function Xn(e){if(!Hn)return e;let t=Kn(e),n=!zn.test(t);if(e.options.forceShell||n){let r=Wn.test(t);e.command=qn.normalize(e.command),e.command=ft.command(e.command),e.args=e.args.map(i=>ft.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Vn(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Xn(r)}lt.exports=Vn});var ht=d((io,mt)=>{"use strict";var ne=process.platform==="win32";function re(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Yn(e,t){if(!ne)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=pt(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function pt(e,t){return ne&&e===1&&!t.file?re(t.original,"spawn"):null}function Qn(e,t){return ne&&e===1&&!t.file?re(t.original,"spawnSync"):null}mt.exports={hookChildProcess:Yn,verifyENOENT:pt,verifyENOENTSync:Qn,notFoundError:re}});var St=d((so,v)=>{"use strict";var yt=require("child_process"),oe=dt(),ie=ht();function gt(e,t,n){let r=oe(e,t,n),o=yt.spawn(r.command,r.args,r.options);return ie.hookChildProcess(o,r),o}function Zn(e,t,n){let r=oe(e,t,n),o=yt.spawnSync(r.command,r.args,r.options);return o.error=o.error||ie.verifyENOENTSync(o.status,r),o}v.exports=gt;v.exports.spawn=gt;v.exports.sync=Zn;v.exports._parse=oe;v.exports._enoent=ie});var Rt=d((Po,q)=>{q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var kt=d((Co,G)=>{var l=global.process,b=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};b(l)?($t=require("assert"),P=Rt(),Nt=/^win/i.test(l.platform),R=require("events"),typeof R!="function"&&(R=R.EventEmitter),l.__signal_exit_emitter__?p=l.__signal_exit_emitter__:(p=l.__signal_exit_emitter__=new R,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),G.exports=function(e,t){if(!b(global.process))return function(){};$t.equal(typeof e,"function","a callback must be provided for exit handler"),C===!1&&fe();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){p.removeListener(n,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&D()};return p.on(n,e),r},D=function(){!C||!b(global.process)||(C=!1,P.forEach(function(t){try{l.removeListener(t,H[t])}catch{}}),l.emit=z,l.reallyExit=le,p.count-=1)},G.exports.unload=D,w=function(t,n,r){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,n,r))},H={},P.forEach(function(e){H[e]=function(){if(b(global.process)){var n=l.listeners(e);n.length===p.count&&(D(),w("exit",null,e),w("afterexit",null,e),Nt&&e==="SIGHUP"&&(e="SIGINT"),l.kill(l.pid,e))}}}),G.exports.signals=function(){return P},C=!1,fe=function(){C||!b(global.process)||(C=!0,p.count+=1,P=P.filter(function(t){try{return l.on(t,H[t]),!0}catch{return!1}}),l.emit=Lt,l.reallyExit=jt)},G.exports.load=fe,le=l.reallyExit,jt=function(t){b(global.process)&&(l.exitCode=t||0,w("exit",l.exitCode,null),w("afterexit",l.exitCode,null),le.call(l,l.exitCode))},z=l.emit,Lt=function(t,n){if(t==="exit"&&b(global.process)){n!==void 0&&(l.exitCode=n);var r=z.apply(this,arguments);return w("exit",l.exitCode,null),w("afterexit",l.exitCode,null),r}else return z.apply(this,arguments)}):G.exports=function(){return function(){}};var $t,P,Nt,R,p,D,w,H,C,fe,le,jt,z,Lt});var Xt=d(($o,Kt)=>{"use strict";var{PassThrough:Ir}=require("stream");Kt.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new Ir({objectMode:o});n&&i.setEncoding(n);let s=0,a=[];return i.on("data",c=>{a.push(c),o?s=a.length:s+=c.length}),i.getBufferedValue=()=>t?a:r?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var Vt=d((No,$)=>{"use strict";var{constants:Pr}=require("buffer"),Cr=require("stream"),{promisify:Gr}=require("util"),Or=Xt(),Ar=Gr(Cr.pipeline),K=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function me(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=Or(t);return await new Promise((o,i)=>{let s=a=>{a&&r.getBufferedLength()<=Pr.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),i(a)};(async()=>{try{await Ar(e,r),o()}catch(a){s(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new K)})}),r.getBufferedValue()}$.exports=me;$.exports.buffer=(e,t)=>me(e,{...t,encoding:"buffer"});$.exports.array=(e,t)=>me(e,{...t,array:!0});$.exports.MaxBufferError=K});var Qt=d((jo,Yt)=>{"use strict";var{PassThrough:Rr}=require("stream");Yt.exports=function(){var e=[],t=new Rr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var bn=g(require("node:path"),1),Ie=g(require("node:process"),1);var hn=require("node:buffer"),yn=g(require("node:path"),1),Y=g(require("node:child_process"),1),N=g(require("node:process"),1),gn=g(St(),1);function se(e){let t=typeof e=="string"?`
2
+ "use strict";var wn=Object.create;var Ae=Object.defineProperty;var En=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var vn=Object.getPrototypeOf,In=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var Pn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!In.call(e,o)&&o!==n&&Ae(e,o,{get:()=>t[o],enumerable:!(r=En(t,o))||r.enumerable});return e};var g=(e,t,n)=>(n=e!=null?wn(vn(e)):{},Pn(t||!e||!e.__esModule?Ae(n,"default",{value:e,enumerable:!0}):n,e));var Le=d((Kr,je)=>{je.exports=Ne;Ne.sync=Gn;var Re=require("fs");function Cn(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function $e(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:Cn(t,n)}function Ne(e,t,n){Re.stat(e,function(r,o){n(r,r?!1:$e(o,e,t))})}function Gn(e,t){return $e(Re.statSync(e),e,t)}});var Fe=d((Xr,Ue)=>{Ue.exports=Be;Be.sync=On;var ke=require("fs");function Be(e,t,n){ke.stat(e,function(r,o){n(r,r?!1:Me(o,t))})}function On(e,t){return Me(ke.statSync(e),t)}function Me(e,t){return e.isFile()&&An(e,t)}function An(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),f=a|c,h=n&u||n&c&&o===s||n&a&&r===i||n&f&&i===0;return h}});var qe=d((Yr,_e)=>{var Vr=require("fs"),M;process.platform==="win32"||global.TESTING_WINDOWS?M=Le():M=Fe();_e.exports=Q;Q.sync=Rn;function Q(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Q(e,t||{},function(i,s){i?o(i):r(s)})})}M(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function Rn(e,t){try{return M.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var Ve=d((Qr,Xe)=>{var T=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",De=require("path"),$n=T?";":":",He=qe(),ze=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),We=(e,t)=>{let n=t.colon||$n,r=e.match(/\//)||T&&e.match(/\\/)?[""]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=T?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=T?o.split(n):[""];return T&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},Ke=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=We(e,t),s=[],a=u=>new Promise((f,h)=>{if(u===r.length)return t.all&&s.length?f(s):h(ze(e));let m=r[u],S=/^".*"$/.test(m)?m.slice(1,-1):m,y=De.join(S,e),x=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;f(c(x,u,0))}),c=(u,f,h)=>new Promise((m,S)=>{if(h===o.length)return m(a(f+1));let y=o[h];He(u+y,{pathExt:i},(x,E)=>{if(!x&&E)if(t.all)s.push(u+y);else return m(u+y);return m(c(u,f,h+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},Nn=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=We(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=De.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let h=0;h<r.length;h++){let m=f+r[h];try{if(He.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw ze(e)};Xe.exports=Ke;Ke.sync=Nn});var Qe=d((Zr,Z)=>{"use strict";var Ye=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Z.exports=Ye;Z.exports.default=Ye});var tt=d((Jr,et)=>{"use strict";var Ze=require("path"),jn=Ve(),Ln=Qe();function Je(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=jn.sync(e.command,{path:n[Ln({env:n})],pathExt:t?Ze.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Ze.resolve(o?e.options.cwd:"",s)),s}function kn(e){return Je(e)||Je(e,!0)}et.exports=kn});var nt=d((eo,ee)=>{"use strict";var J=/([()\][%!^"`<>&|;, *?])/g;function Bn(e){return e=e.replace(J,"^$1"),e}function Mn(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(J,"^$1"),t&&(e=e.replace(J,"^$1")),e}ee.exports.command=Bn;ee.exports.argument=Mn});var ot=d((to,rt)=>{"use strict";rt.exports=/^#!(.*)/});var st=d((no,it)=>{"use strict";var Un=ot();it.exports=(e="")=>{let t=e.match(Un);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var ct=d((ro,at)=>{"use strict";var te=require("fs"),Fn=st();function _n(e){let n=Buffer.alloc(150),r;try{r=te.openSync(e,"r"),te.readSync(r,n,0,150,0),te.closeSync(r)}catch{}return Fn(n.toString())}at.exports=_n});var dt=d((oo,lt)=>{"use strict";var qn=require("path"),ut=tt(),ft=nt(),Dn=ct(),Hn=process.platform==="win32",zn=/\.(?:com|exe)$/i,Wn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Kn(e){e.file=ut(e);let t=e.file&&Dn(e.file);return t?(e.args.unshift(e.file),e.command=t,ut(e)):e.file}function Xn(e){if(!Hn)return e;let t=Kn(e),n=!zn.test(t);if(e.options.forceShell||n){let r=Wn.test(t);e.command=qn.normalize(e.command),e.command=ft.command(e.command),e.args=e.args.map(i=>ft.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Vn(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Xn(r)}lt.exports=Vn});var ht=d((io,mt)=>{"use strict";var ne=process.platform==="win32";function re(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Yn(e,t){if(!ne)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=pt(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function pt(e,t){return ne&&e===1&&!t.file?re(t.original,"spawn"):null}function Qn(e,t){return ne&&e===1&&!t.file?re(t.original,"spawnSync"):null}mt.exports={hookChildProcess:Yn,verifyENOENT:pt,verifyENOENTSync:Qn,notFoundError:re}});var St=d((so,v)=>{"use strict";var yt=require("child_process"),oe=dt(),ie=ht();function gt(e,t,n){let r=oe(e,t,n),o=yt.spawn(r.command,r.args,r.options);return ie.hookChildProcess(o,r),o}function Zn(e,t,n){let r=oe(e,t,n),o=yt.spawnSync(r.command,r.args,r.options);return o.error=o.error||ie.verifyENOENTSync(o.status,r),o}v.exports=gt;v.exports.spawn=gt;v.exports.sync=Zn;v.exports._parse=oe;v.exports._enoent=ie});var Rt=d((Po,q)=>{q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var kt=d((Co,G)=>{var l=global.process,b=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};b(l)?($t=require("assert"),P=Rt(),Nt=/^win/i.test(l.platform),R=require("events"),typeof R!="function"&&(R=R.EventEmitter),l.__signal_exit_emitter__?p=l.__signal_exit_emitter__:(p=l.__signal_exit_emitter__=new R,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),G.exports=function(e,t){if(!b(global.process))return function(){};$t.equal(typeof e,"function","a callback must be provided for exit handler"),C===!1&&fe();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){p.removeListener(n,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&D()};return p.on(n,e),r},D=function(){!C||!b(global.process)||(C=!1,P.forEach(function(t){try{l.removeListener(t,H[t])}catch{}}),l.emit=z,l.reallyExit=le,p.count-=1)},G.exports.unload=D,w=function(t,n,r){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,n,r))},H={},P.forEach(function(e){H[e]=function(){if(b(global.process)){var n=l.listeners(e);n.length===p.count&&(D(),w("exit",null,e),w("afterexit",null,e),Nt&&e==="SIGHUP"&&(e="SIGINT"),l.kill(l.pid,e))}}}),G.exports.signals=function(){return P},C=!1,fe=function(){C||!b(global.process)||(C=!0,p.count+=1,P=P.filter(function(t){try{return l.on(t,H[t]),!0}catch{return!1}}),l.emit=Lt,l.reallyExit=jt)},G.exports.load=fe,le=l.reallyExit,jt=function(t){b(global.process)&&(l.exitCode=t||0,w("exit",l.exitCode,null),w("afterexit",l.exitCode,null),le.call(l,l.exitCode))},z=l.emit,Lt=function(t,n){if(t==="exit"&&b(global.process)){n!==void 0&&(l.exitCode=n);var r=z.apply(this,arguments);return w("exit",l.exitCode,null),w("afterexit",l.exitCode,null),r}else return z.apply(this,arguments)}):G.exports=function(){return function(){}};var $t,P,Nt,R,p,D,w,H,C,fe,le,jt,z,Lt});var Xt=d(($o,Kt)=>{"use strict";var{PassThrough:Ir}=require("stream");Kt.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new Ir({objectMode:o});n&&i.setEncoding(n);let s=0,a=[];return i.on("data",c=>{a.push(c),o?s=a.length:s+=c.length}),i.getBufferedValue=()=>t?a:r?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var Vt=d((No,$)=>{"use strict";var{constants:Pr}=require("buffer"),Cr=require("stream"),{promisify:Gr}=require("util"),Or=Xt(),Ar=Gr(Cr.pipeline),K=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function me(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=Or(t);return await new Promise((o,i)=>{let s=a=>{a&&r.getBufferedLength()<=Pr.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),i(a)};(async()=>{try{await Ar(e,r),o()}catch(a){s(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new K)})}),r.getBufferedValue()}$.exports=me;$.exports.buffer=(e,t)=>me(e,{...t,encoding:"buffer"});$.exports.array=(e,t)=>me(e,{...t,array:!0});$.exports.MaxBufferError=K});var Qt=d((jo,Yt)=>{"use strict";var{PassThrough:Rr}=require("stream");Yt.exports=function(){var e=[],t=new Rr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var bn=g(require("node:path"),1),Ie=g(require("node:process"),1);var hn=require("node:buffer"),yn=g(require("node:path"),1),Y=g(require("node:child_process"),1),N=g(require("node:process"),1),gn=g(St(),1);function se(e){let t=typeof e=="string"?`
3
3
  `:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}var O=g(require("node:process"),1),I=g(require("node:path"),1),ae=require("node:url");function U(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}var Jn=({cwd:e=O.default.cwd(),path:t=O.default.env[U()],preferLocal:n=!0,execPath:r=O.default.execPath,addExecPath:o=!0}={})=>{let i=e instanceof URL?(0,ae.fileURLToPath)(e):e,s=I.default.resolve(i),a=[];return n&&er(a,s),o&&tr(a,r,s),[...a,t].join(I.default.delimiter)},er=(e,t)=>{let n;for(;n!==t;)e.push(I.default.join(t,"node_modules/.bin")),n=t,t=I.default.resolve(t,"..")},tr=(e,t,n)=>{let r=t instanceof URL?(0,ae.fileURLToPath)(t):t;e.push(I.default.resolve(n,r,".."))},xt=({env:e=O.default.env,...t}={})=>{e={...e};let n=U({env:e});return t.path=e[n],e[n]=Jn(t),e};var nr=(e,t,n,r)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let o=Object.getOwnPropertyDescriptor(e,n),i=Object.getOwnPropertyDescriptor(t,n);!rr(o,i)&&r||Object.defineProperty(e,n,i)},rr=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},or=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},ir=(e,t)=>`/* Wrapped ${e}*/
4
4
  ${t}`,sr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ar=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),cr=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=ir.bind(null,r,t.toString());Object.defineProperty(o,"name",ar),Object.defineProperty(e,"toString",{...sr,value:o})};function ce(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let o of Reflect.ownKeys(t))nr(e,t,o,n);return or(e,t),cr(e,t,r),e}var F=new WeakMap,bt=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(F.set(i,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return n};return ce(i,e),F.set(i,r),i};bt.callCount=e=>{if(!F.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return F.get(e)};var wt=bt;var Ot=g(require("node:process"),1);var Ct=require("node:os");var Et=()=>{let e=vt-Tt+1;return Array.from({length:e},ur)},ur=(e,t)=>({name:`SIGRT${t+1}`,number:Tt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Tt=34,vt=64;var Pt=require("node:os");var It=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var ue=()=>{let e=Et();return[...It,...e].map(fr)},fr=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=Pt.constants,a=s!==void 0;return{name:e,number:a?s:t,description:n,supported:a,action:r,forced:o,standard:i}};var lr=()=>{let e=ue();return Object.fromEntries(e.map(dr))},dr=({name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s}],Gt=lr(),pr=()=>{let e=ue(),t=65,n=Array.from({length:t},(r,o)=>mr(o,e));return Object.assign({},...n)},mr=(e,t)=>{let n=hr(e,t);if(n===void 0)return{};let{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}},hr=(e,t)=>{let n=t.find(({name:r})=>Ct.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},wo=pr();var yr=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",A=({stdout:e,stderr:t,all:n,error:r,signal:o,exitCode:i,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:f,parsed:{options:{timeout:h,cwd:m=Ot.default.cwd()}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let S=o===void 0?void 0:Gt[o].description,y=r&&r.code,E=`Command ${yr({timedOut:c,timeout:h,errorCode:y,signal:o,signalDescription:S,exitCode:i,isCanceled:u})}: ${s}`,L=Object.prototype.toString.call(r)==="[object Error]",k=L?`${E}
5
5
  ${r.message}`:E,B=[k,t,e].filter(Boolean).join(`
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var an=Object.create;var Ce=Object.defineProperty;var cn=Object.getOwnPropertyDescriptor;var un=Object.getOwnPropertyNames;var dn=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var h=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ln=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of un(t))!fn.call(e,o)&&o!==n&&Ce(e,o,{get:()=>t[o],enumerable:!(r=cn(t,o))||r.enumerable});return e};var k=(e,t,n)=>(n=e!=null?an(dn(e)):{},ln(t||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e));var Re=l((Qr,$e)=>{$e.exports=Oe;Oe.sync=mn;var Ae=h("fs");function pn(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Ge(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:pn(t,n)}function Oe(e,t,n){Ae.stat(e,function(r,o){n(r,r?!1:Ge(o,e,t))})}function mn(e,t){return Ge(Ae.statSync(e),e,t)}});var Be=l((Zr,ke)=>{ke.exports=je;je.sync=hn;var Ne=h("fs");function je(e,t,n){Ne.stat(e,function(r,o){n(r,r?!1:Le(o,t))})}function hn(e,t){return Le(Ne.statSync(e),t)}function Le(e,t){return e.isFile()&&gn(e,t)}function gn(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),d=a|c,g=n&u||n&c&&o===s||n&a&&r===i||n&d&&i===0;return g}});var Me=l((eo,Fe)=>{var Jr=h("fs"),B;process.platform==="win32"||global.TESTING_WINDOWS?B=Re():B=Be();Fe.exports=Y;Y.sync=yn;function Y(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Y(e,t||{},function(i,s){i?o(i):r(s)})})}B(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function yn(e,t){try{return B.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var We=l((to,He)=>{var T=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ue=h("path"),Sn=T?";":":",_e=Me(),qe=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),De=(e,t)=>{let n=t.colon||Sn,r=e.match(/\//)||T&&e.match(/\\/)?[""]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=T?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=T?o.split(n):[""];return T&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},ze=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=De(e,t),s=[],a=u=>new Promise((d,g)=>{if(u===r.length)return t.all&&s.length?d(s):g(qe(e));let m=r[u],S=/^".*"$/.test(m)?m.slice(1,-1):m,y=Ue.join(S,e),x=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;d(c(x,u,0))}),c=(u,d,g)=>new Promise((m,S)=>{if(g===o.length)return m(a(d+1));let y=o[g];_e(u+y,{pathExt:i},(x,E)=>{if(!x&&E)if(t.all)s.push(u+y);else return m(u+y);return m(c(u,d,g+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},xn=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=De(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Ue.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let g=0;g<r.length;g++){let m=d+r[g];try{if(_e.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw qe(e)};He.exports=ze;ze.sync=xn});var Xe=l((no,Q)=>{"use strict";var Ke=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Q.exports=Ke;Q.exports.default=Ke});var Ze=l((ro,Qe)=>{"use strict";var Ve=h("path"),bn=We(),wn=Xe();function Ye(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=bn.sync(e.command,{path:n[wn({env:n})],pathExt:t?Ve.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Ve.resolve(o?e.options.cwd:"",s)),s}function En(e){return Ye(e)||Ye(e,!0)}Qe.exports=En});var Je=l((oo,J)=>{"use strict";var Z=/([()\][%!^"`<>&|;, *?])/g;function Tn(e){return e=e.replace(Z,"^$1"),e}function vn(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Z,"^$1"),t&&(e=e.replace(Z,"^$1")),e}J.exports.command=Tn;J.exports.argument=vn});var tt=l((io,et)=>{"use strict";et.exports=/^#!(.*)/});var rt=l((so,nt)=>{"use strict";var In=tt();nt.exports=(e="")=>{let t=e.match(In);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var it=l((ao,ot)=>{"use strict";var ee=h("fs"),Pn=rt();function Cn(e){let n=Buffer.alloc(150),r;try{r=ee.openSync(e,"r"),ee.readSync(r,n,0,150,0),ee.closeSync(r)}catch{}return Pn(n.toString())}ot.exports=Cn});var ut=l((co,ct)=>{"use strict";var An=h("path"),st=Ze(),at=Je(),Gn=it(),On=process.platform==="win32",$n=/\.(?:com|exe)$/i,Rn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Nn(e){e.file=st(e);let t=e.file&&Gn(e.file);return t?(e.args.unshift(e.file),e.command=t,st(e)):e.file}function jn(e){if(!On)return e;let t=Nn(e),n=!$n.test(t);if(e.options.forceShell||n){let r=Rn.test(t);e.command=An.normalize(e.command),e.command=at.command(e.command),e.args=e.args.map(i=>at.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Ln(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:jn(r)}ct.exports=Ln});var lt=l((uo,ft)=>{"use strict";var te=process.platform==="win32";function ne(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function kn(e,t){if(!te)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=dt(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function dt(e,t){return te&&e===1&&!t.file?ne(t.original,"spawn"):null}function Bn(e,t){return te&&e===1&&!t.file?ne(t.original,"spawnSync"):null}ft.exports={hookChildProcess:kn,verifyENOENT:dt,verifyENOENTSync:Bn,notFoundError:ne}});var ht=l((fo,v)=>{"use strict";var pt=h("child_process"),re=ut(),oe=lt();function mt(e,t,n){let r=re(e,t,n),o=pt.spawn(r.command,r.args,r.options);return oe.hookChildProcess(o,r),o}function Fn(e,t,n){let r=re(e,t,n),o=pt.spawnSync(r.command,r.args,r.options);return o.error=o.error||oe.verifyENOENTSync(o.status,r),o}v.exports=mt;v.exports.spawn=mt;v.exports.sync=Fn;v.exports._parse=re;v.exports._enoent=oe});var Pt=l((ko,q)=>{q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var $t=l((Bo,C)=>{var f=global.process,b=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};b(f)?(Ct=h("assert"),I=Pt(),At=/^win/i.test(f.platform),O=h("events"),typeof O!="function"&&(O=O.EventEmitter),f.__signal_exit_emitter__?p=f.__signal_exit_emitter__:(p=f.__signal_exit_emitter__=new O,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),C.exports=function(e,t){if(!b(global.process))return function(){};Ct.equal(typeof e,"function","a callback must be provided for exit handler"),P===!1&&ce();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){p.removeListener(n,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&D()};return p.on(n,e),r},D=function(){!P||!b(global.process)||(P=!1,I.forEach(function(t){try{f.removeListener(t,z[t])}catch{}}),f.emit=H,f.reallyExit=ue,p.count-=1)},C.exports.unload=D,w=function(t,n,r){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,n,r))},z={},I.forEach(function(e){z[e]=function(){if(b(global.process)){var n=f.listeners(e);n.length===p.count&&(D(),w("exit",null,e),w("afterexit",null,e),At&&e==="SIGHUP"&&(e="SIGINT"),f.kill(f.pid,e))}}}),C.exports.signals=function(){return I},P=!1,ce=function(){P||!b(global.process)||(P=!0,p.count+=1,I=I.filter(function(t){try{return f.on(t,z[t]),!0}catch{return!1}}),f.emit=Ot,f.reallyExit=Gt)},C.exports.load=ce,ue=f.reallyExit,Gt=function(t){b(global.process)&&(f.exitCode=t||0,w("exit",f.exitCode,null),w("afterexit",f.exitCode,null),ue.call(f,f.exitCode))},H=f.emit,Ot=function(t,n){if(t==="exit"&&b(global.process)){n!==void 0&&(f.exitCode=n);var r=H.apply(this,arguments);return w("exit",f.exitCode,null),w("afterexit",f.exitCode,null),r}else return H.apply(this,arguments)}):C.exports=function(){return function(){}};var Ct,I,At,O,p,D,w,z,P,ce,ue,Gt,H,Ot});var Ut=l((Ho,Mt)=>{"use strict";var{PassThrough:yr}=h("stream");Mt.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new yr({objectMode:o});n&&i.setEncoding(n);let s=0,a=[];return i.on("data",c=>{a.push(c),o?s=a.length:s+=c.length}),i.getBufferedValue=()=>t?a:r?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var _t=l((Wo,$)=>{"use strict";var{constants:Sr}=h("buffer"),xr=h("stream"),{promisify:br}=h("util"),wr=Ut(),Er=br(xr.pipeline),K=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function le(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=wr(t);return await new Promise((o,i)=>{let s=a=>{a&&r.getBufferedLength()<=Sr.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),i(a)};(async()=>{try{await Er(e,r),o()}catch(a){s(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new K)})}),r.getBufferedValue()}$.exports=le;$.exports.buffer=(e,t)=>le(e,{...t,encoding:"buffer"});$.exports.array=(e,t)=>le(e,{...t,array:!0});$.exports.MaxBufferError=K});var Dt=l((Ko,qt)=>{"use strict";var{PassThrough:Tr}=h("stream");qt.exports=function(){var e=[],t=new Tr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var nn=k(ht(),1);import{Buffer as Ur}from"node:buffer";import _r from"node:path";import we from"node:child_process";import V from"node:process";function ie(e){let t=typeof e=="string"?`
1
+ var an=Object.create;var Ce=Object.defineProperty;var cn=Object.getOwnPropertyDescriptor;var un=Object.getOwnPropertyNames;var dn=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var h=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var l=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var ln=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of un(t))!fn.call(e,o)&&o!==n&&Ce(e,o,{get:()=>t[o],enumerable:!(r=cn(t,o))||r.enumerable});return e};var k=(e,t,n)=>(n=e!=null?an(dn(e)):{},ln(t||!e||!e.__esModule?Ce(n,"default",{value:e,enumerable:!0}):n,e));var Re=l((Qr,$e)=>{$e.exports=Oe;Oe.sync=mn;var Ae=h("fs");function pn(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Ge(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:pn(t,n)}function Oe(e,t,n){Ae.stat(e,function(r,o){n(r,r?!1:Ge(o,e,t))})}function mn(e,t){return Ge(Ae.statSync(e),e,t)}});var Be=l((Zr,ke)=>{ke.exports=je;je.sync=hn;var Ne=h("fs");function je(e,t,n){Ne.stat(e,function(r,o){n(r,r?!1:Le(o,t))})}function hn(e,t){return Le(Ne.statSync(e),t)}function Le(e,t){return e.isFile()&&gn(e,t)}function gn(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),d=a|c,g=n&u||n&c&&o===s||n&a&&r===i||n&d&&i===0;return g}});var Me=l((eo,Fe)=>{var Jr=h("fs"),B;process.platform==="win32"||global.TESTING_WINDOWS?B=Re():B=Be();Fe.exports=Y;Y.sync=yn;function Y(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){Y(e,t||{},function(i,s){i?o(i):r(s)})})}B(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function yn(e,t){try{return B.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var We=l((to,He)=>{var T=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ue=h("path"),Sn=T?";":":",_e=Me(),qe=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),De=(e,t)=>{let n=t.colon||Sn,r=e.match(/\//)||T&&e.match(/\\/)?[""]:[...T?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=T?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=T?o.split(n):[""];return T&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},ze=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=De(e,t),s=[],a=u=>new Promise((d,g)=>{if(u===r.length)return t.all&&s.length?d(s):g(qe(e));let m=r[u],S=/^".*"$/.test(m)?m.slice(1,-1):m,y=Ue.join(S,e),x=!S&&/^\.[\\\/]/.test(e)?e.slice(0,2)+y:y;d(c(x,u,0))}),c=(u,d,g)=>new Promise((m,S)=>{if(g===o.length)return m(a(d+1));let y=o[g];_e(u+y,{pathExt:i},(x,E)=>{if(!x&&E)if(t.all)s.push(u+y);else return m(u+y);return m(c(u,d,g+1))})});return n?a(0).then(u=>n(null,u),n):a(0)},xn=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=De(e,t),i=[];for(let s=0;s<n.length;s++){let a=n[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Ue.join(c,e),d=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let g=0;g<r.length;g++){let m=d+r[g];try{if(_e.sync(m,{pathExt:o}))if(t.all)i.push(m);else return m}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw qe(e)};He.exports=ze;ze.sync=xn});var Xe=l((no,Q)=>{"use strict";var Ke=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};Q.exports=Ke;Q.exports.default=Ke});var Ze=l((ro,Qe)=>{"use strict";var Ve=h("path"),bn=We(),wn=Xe();function Ye(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=bn.sync(e.command,{path:n[wn({env:n})],pathExt:t?Ve.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=Ve.resolve(o?e.options.cwd:"",s)),s}function En(e){return Ye(e)||Ye(e,!0)}Qe.exports=En});var Je=l((oo,J)=>{"use strict";var Z=/([()\][%!^"`<>&|;, *?])/g;function Tn(e){return e=e.replace(Z,"^$1"),e}function vn(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Z,"^$1"),t&&(e=e.replace(Z,"^$1")),e}J.exports.command=Tn;J.exports.argument=vn});var tt=l((io,et)=>{"use strict";et.exports=/^#!(.*)/});var rt=l((so,nt)=>{"use strict";var In=tt();nt.exports=(e="")=>{let t=e.match(In);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var it=l((ao,ot)=>{"use strict";var ee=h("fs"),Pn=rt();function Cn(e){let n=Buffer.alloc(150),r;try{r=ee.openSync(e,"r"),ee.readSync(r,n,0,150,0),ee.closeSync(r)}catch{}return Pn(n.toString())}ot.exports=Cn});var ut=l((co,ct)=>{"use strict";var An=h("path"),st=Ze(),at=Je(),Gn=it(),On=process.platform==="win32",$n=/\.(?:com|exe)$/i,Rn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Nn(e){e.file=st(e);let t=e.file&&Gn(e.file);return t?(e.args.unshift(e.file),e.command=t,st(e)):e.file}function jn(e){if(!On)return e;let t=Nn(e),n=!$n.test(t);if(e.options.forceShell||n){let r=Rn.test(t);e.command=An.normalize(e.command),e.command=at.command(e.command),e.args=e.args.map(i=>at.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Ln(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:jn(r)}ct.exports=Ln});var lt=l((uo,ft)=>{"use strict";var te=process.platform==="win32";function ne(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function kn(e,t){if(!te)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=dt(o,t);if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function dt(e,t){return te&&e===1&&!t.file?ne(t.original,"spawn"):null}function Bn(e,t){return te&&e===1&&!t.file?ne(t.original,"spawnSync"):null}ft.exports={hookChildProcess:kn,verifyENOENT:dt,verifyENOENTSync:Bn,notFoundError:ne}});var ht=l((fo,v)=>{"use strict";var pt=h("child_process"),re=ut(),oe=lt();function mt(e,t,n){let r=re(e,t,n),o=pt.spawn(r.command,r.args,r.options);return oe.hookChildProcess(o,r),o}function Fn(e,t,n){let r=re(e,t,n),o=pt.spawnSync(r.command,r.args,r.options);return o.error=o.error||oe.verifyENOENTSync(o.status,r),o}v.exports=mt;v.exports.spawn=mt;v.exports.sync=Fn;v.exports._parse=re;v.exports._enoent=oe});var Pt=l((ko,q)=>{q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var $t=l((Bo,C)=>{var f=global.process,b=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};b(f)?(Ct=h("assert"),I=Pt(),At=/^win/i.test(f.platform),O=h("events"),typeof O!="function"&&(O=O.EventEmitter),f.__signal_exit_emitter__?p=f.__signal_exit_emitter__:(p=f.__signal_exit_emitter__=new O,p.count=0,p.emitted={}),p.infinite||(p.setMaxListeners(1/0),p.infinite=!0),C.exports=function(e,t){if(!b(global.process))return function(){};Ct.equal(typeof e,"function","a callback must be provided for exit handler"),P===!1&&ce();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){p.removeListener(n,e),p.listeners("exit").length===0&&p.listeners("afterexit").length===0&&D()};return p.on(n,e),r},D=function(){!P||!b(global.process)||(P=!1,I.forEach(function(t){try{f.removeListener(t,z[t])}catch{}}),f.emit=H,f.reallyExit=ue,p.count-=1)},C.exports.unload=D,w=function(t,n,r){p.emitted[t]||(p.emitted[t]=!0,p.emit(t,n,r))},z={},I.forEach(function(e){z[e]=function(){if(b(global.process)){var n=f.listeners(e);n.length===p.count&&(D(),w("exit",null,e),w("afterexit",null,e),At&&e==="SIGHUP"&&(e="SIGINT"),f.kill(f.pid,e))}}}),C.exports.signals=function(){return I},P=!1,ce=function(){P||!b(global.process)||(P=!0,p.count+=1,I=I.filter(function(t){try{return f.on(t,z[t]),!0}catch{return!1}}),f.emit=Ot,f.reallyExit=Gt)},C.exports.load=ce,ue=f.reallyExit,Gt=function(t){b(global.process)&&(f.exitCode=t||0,w("exit",f.exitCode,null),w("afterexit",f.exitCode,null),ue.call(f,f.exitCode))},H=f.emit,Ot=function(t,n){if(t==="exit"&&b(global.process)){n!==void 0&&(f.exitCode=n);var r=H.apply(this,arguments);return w("exit",f.exitCode,null),w("afterexit",f.exitCode,null),r}else return H.apply(this,arguments)}):C.exports=function(){return function(){}};var Ct,I,At,O,p,D,w,z,P,ce,ue,Gt,H,Ot});var Ut=l((Ho,Mt)=>{"use strict";var{PassThrough:yr}=h("stream");Mt.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new yr({objectMode:o});n&&i.setEncoding(n);let s=0,a=[];return i.on("data",c=>{a.push(c),o?s=a.length:s+=c.length}),i.getBufferedValue=()=>t?a:r?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var _t=l((Wo,$)=>{"use strict";var{constants:Sr}=h("buffer"),xr=h("stream"),{promisify:br}=h("util"),wr=Ut(),Er=br(xr.pipeline),K=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function le(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=wr(t);return await new Promise((o,i)=>{let s=a=>{a&&r.getBufferedLength()<=Sr.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),i(a)};(async()=>{try{await Er(e,r),o()}catch(a){s(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new K)})}),r.getBufferedValue()}$.exports=le;$.exports.buffer=(e,t)=>le(e,{...t,encoding:"buffer"});$.exports.array=(e,t)=>le(e,{...t,array:!0});$.exports.MaxBufferError=K});var Dt=l((Ko,qt)=>{"use strict";var{PassThrough:Tr}=h("stream");qt.exports=function(){var e=[],t=new Tr({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var nn=k(ht(),1);import{Buffer as Ur}from"node:buffer";import _r from"node:path";import we from"node:child_process";import V from"node:process";function ie(e){let t=typeof e=="string"?`
2
2
  `:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}import M from"node:process";import A from"node:path";import{fileURLToPath as gt}from"node:url";function F(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}var Mn=({cwd:e=M.cwd(),path:t=M.env[F()],preferLocal:n=!0,execPath:r=M.execPath,addExecPath:o=!0}={})=>{let i=e instanceof URL?gt(e):e,s=A.resolve(i),a=[];return n&&Un(a,s),o&&_n(a,r,s),[...a,t].join(A.delimiter)},Un=(e,t)=>{let n;for(;n!==t;)e.push(A.join(t,"node_modules/.bin")),n=t,t=A.resolve(t,"..")},_n=(e,t,n)=>{let r=t instanceof URL?gt(t):t;e.push(A.resolve(n,r,".."))},yt=({env:e=M.env,...t}={})=>{e={...e};let n=F({env:e});return t.path=e[n],e[n]=Mn(t),e};var qn=(e,t,n,r)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let o=Object.getOwnPropertyDescriptor(e,n),i=Object.getOwnPropertyDescriptor(t,n);!Dn(o,i)&&r||Object.defineProperty(e,n,i)},Dn=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},zn=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Hn=(e,t)=>`/* Wrapped ${e}*/
3
3
  ${t}`,Wn=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Kn=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Xn=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=Hn.bind(null,r,t.toString());Object.defineProperty(o,"name",Kn),Object.defineProperty(e,"toString",{...Wn,value:o})};function se(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let o of Reflect.ownKeys(t))qn(e,t,o,n);return zn(e,t),Xn(e,t,r),e}var U=new WeakMap,St=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(U.set(i,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return n};return se(i,e),U.set(i,r),i};St.callCount=e=>{if(!U.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return U.get(e)};var xt=St;import or from"node:process";import{constants as Zn}from"node:os";var bt=()=>{let e=Et-wt+1;return Array.from({length:e},Vn)},Vn=(e,t)=>({name:`SIGRT${t+1}`,number:wt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),wt=34,Et=64;import{constants as Yn}from"node:os";var Tt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var ae=()=>{let e=bt();return[...Tt,...e].map(Qn)},Qn=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=Yn,a=s!==void 0;return{name:e,number:a?s:t,description:n,supported:a,action:r,forced:o,standard:i}};var Jn=()=>{let e=ae();return Object.fromEntries(e.map(er))},er=({name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s}],vt=Jn(),tr=()=>{let e=ae(),t=65,n=Array.from({length:t},(r,o)=>nr(o,e));return Object.assign({},...n)},nr=(e,t)=>{let n=rr(e,t);if(n===void 0)return{};let{name:r,description:o,supported:i,action:s,forced:a,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:a,standard:c}}},rr=(e,t)=>{let n=t.find(({name:r})=>Zn.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},Oo=tr();var ir=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",G=({stdout:e,stderr:t,all:n,error:r,signal:o,exitCode:i,command:s,escapedCommand:a,timedOut:c,isCanceled:u,killed:d,parsed:{options:{timeout:g,cwd:m=or.cwd()}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let S=o===void 0?void 0:vt[o].description,y=r&&r.code,E=`Command ${ir({timedOut:c,timeout:g,errorCode:y,signal:o,signalDescription:S,exitCode:i,isCanceled:u})}: ${s}`,N=Object.prototype.toString.call(r)==="[object Error]",j=N?`${E}
4
4
  ${r.message}`:E,L=[j,t,e].filter(Boolean).join(`
package/dist/install.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var pu=Object.create;var kt=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var yu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gu=(e,t)=>{for(var r in t)kt(e,r,{get:t[r],enumerable:!0})},_n=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of yu(t))!_u.call(e,n)&&n!==r&&kt(e,n,{get:()=>t[n],enumerable:!(i=mu(t,n))||i.enumerable});return e};var jt=(e,t,r)=>(r=e!=null?pu(vu(e)):{},_n(t||!e||!e.__esModule?kt(r,"default",{value:e,enumerable:!0}):r,e)),wu=e=>_n(kt({},"__esModule",{value:!0}),e);var Sn=d(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.DownloaderHelper=Ie.DH_STATES=void 0;var Wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu=function(){function e(t,r){for(var i,n=0;n<r.length;n++)i=r[n],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),Eu=require("fs"),V=Nt(Eu),De=require("url"),Su=require("path"),Fe=Nt(Su),Au=require("http"),gn=Nt(Au),Fu=require("https"),wn=Nt(Fu),Ou=require("events");function Nt(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Ru(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Pu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var En=Ie.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"},Gh=Ie.DownloaderHelper=function(e){function t(r,i){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};Ru(this,t);var o=bn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{captureRejections:!0}));return o.__validate(r,i)?(o.url=o.requestURL=r.trim(),o.state=En.IDLE,o.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},o.__opts=Object.assign({},o.__defaultOpts),o.__pipes=[],o.__total=0,o.__downloaded=0,o.__progress=0,o.__retryCount=0,o.__retryTimeout=null,o.__resumeRetryCount=0,o.__states=En,o.__promise=null,o.__request=null,o.__response=null,o.__isAborted=!1,o.__isResumed=!1,o.__isResumable=!1,o.__isRedirected=!1,o.__destFolder=i,o.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},o.__fileName="",o.__filePath="",o.updateOptions(n),o):bn(o)}return Pu(t,e),bu(t,[{key:"start",value:function(){var i=this,n=function(){return new Promise(function(o,a){i.__promise={resolve:o,reject:a},i.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(o){var a=o.name,s=o.total,f=i.__opts.override;if(i.__opts.override=!0,i.__filePath=i.__getFilePath(a),i.__opts.override=f,i.__filePath&&V.existsSync(i.__filePath)){var c=i.__getFilesizeInBytes(i.__filePath);return c===s?n():i.resumeFromFile(i.__filePath,{total:s,fileName:a})}return n()}):n()}},{key:"pause",value:function(){var i=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(n){return n.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return i.__setState(i.__states.PAUSED),i.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var i=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var n=function(){return new Promise(function(o,a){V.access(i.__filePath,function(s){return s?(i.__emitStop(),o(!0)):void V.unlink(i.__filePath,function(f){return f?(i.__setState(i.__states.FAILED),i.emit("error",f),a(f)):(i.__emitStop(),void o(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return i.__opts.removeOnStop?n():(i.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(i){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:i,options:n}),i}},{key:"unpipe",value:function(){var i=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,o=function(s){return i.__response?i.__response.unpipe(s):s.unpipe()};if(n){var a=this.__pipes.find(function(s){return s.stream===n});return void(a&&(o(n),this.__pipes=this.__pipes.filter(function(s){return s.stream!==n})))}this.__pipes.forEach(function(s){return o(s.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(i){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,i),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=n||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var i=this;return new Promise(function(n,o){var a=function(f){i.__initProtocol(f);var c=Object.assign({},i.__headers);c.hasOwnProperty("range")&&delete c.range;var l=i.__getReqOptions("HEAD",f,c);return Object.assign({},i.__reqOptions,l)},s=function(f,c){var l=i.__protocol.request(c,function(x){if(i.__isRequireRedirect(x)){var u=/^https?:\/\//.test(x.headers.location)?x.headers.location:new De.URL(x.headers.location,f).href;return i.emit("redirected",u,f),s(u,a(u))}return x.statusCode===200?void n({name:i.__getFileNameFromHeaders(x.headers,x),total:parseInt(x.headers["content-length"])||null}):o(new Error("Response status was "+x.statusCode))});l.on("error",function(x){return o(x)}),l.on("timeout",function(){return o(new Error("timeout"))}),l.on("uncaughtException",function(x){return o(x)}),l.end()};s(i.url,a(i.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(i){var n=this,o=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=i,(o.total&&o.fileName?Promise.resolve({name:o.fileName,total:o.total}):this.getTotalSize()).then(function(a){var s=a.name,f=a.total;return n.__total=o.total||f,n.__fileName=o.fileName||s,n.__downloaded=o.downloaded||n.__getFilesizeInBytes(n.__filePath),n.__reqOptions.headers.range="bytes="+n.__downloaded+"-",n.__isResumed=!0,n.__isResumable=!0,n.__setState(n.__states.RESUMED),n.emit("resume",n.__isResumed),new Promise(function(c,l){n.__promise={resolve:c,reject:l},n.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var i=this.__promise.resolve;return this.__promise=null,i(!0)}}},{key:"__downloadRequest",value:function(i,n){var o=this;return this.__protocol.request(this.__reqOptions,function(a){if(o.__response=a,o.__isResumed||(o.__total=parseInt(a.headers["content-length"])||null,o.__resetStats()),o.__isRequireRedirect(a)){var s=/^https?:\/\//.test(a.headers.location)?a.headers.location:new De.URL(a.headers.location,o.url).href;return o.__isRedirected=!0,o.__initProtocol(s),o.emit("redirected",s,o.url),o.__start()}if(a.statusCode!==200&&a.statusCode!==206){var f=new Error("Response status was "+a.statusCode);return f.status=a.statusCode||0,f.body=a.body||"",o.__setState(o.__states.FAILED),o.emit("error",f),n(f)}(o.__opts.forceResume||a.headers.hasOwnProperty("accept-ranges")&&a.headers["accept-ranges"]!=="none")&&(o.__isResumable=!0),o.__startDownload(a,i,n)})}},{key:"__startDownload",value:function(i,n,o){var a=this,s=i;if(this.__isResumed)this.__fileStream=V.createWriteStream(this.__filePath,{flags:"a"});else{var f=this.__getFileNameFromHeaders(i.headers);if(this.__filePath=this.__getFilePath(f),this.__fileName=this.__filePath.split(Fe.sep).pop(),V.existsSync(this.__filePath)){var c=this.__getFilesizeInBytes(this.__filePath),l=this.__total?this.__total:0;if(Wr(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||c>=l))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:c}),this.__setState(this.__states.SKIPPED),n(!0)}this.__fileStream=V.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,s.on("data",function(x){return a.__calculateStats(x.length)}),this.__pipes.forEach(function(x){s.pipe(x.stream,x.options),s=x.stream}),s.pipe(this.__fileStream),s.on("error",this.__onError(n,o)),this.__fileStream.on("finish",this.__onFinished(n,o)),this.__fileStream.on("error",this.__onError(n,o))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(i){return 300<i.statusCode&&400>i.statusCode&&i.headers.hasOwnProperty("location")&&i.headers.location}},{key:"__onFinished",value:function(i,n){var o=this;return function(){o.__fileStream.close(function(a){if(a)return n(a);if(o.__hasFinished()){var s=!!o.__total&&o.__downloaded!==o.__total;if(s&&o.__isResumable&&o.__opts.resumeOnIncomplete&&o.__resumeRetryCount<=o.__opts.resumeOnIncompleteMaxRetry)return o.__resumeRetryCount++,o.emit("warning",new Error("uncomplete download, retrying")),o.resume();o.__setState(o.__states.FINISHED),o.__pipes=[],o.emit("end",{fileName:o.__fileName,filePath:o.__filePath,totalSize:o.__total,incomplete:s,onDiskSize:o.__getFilesizeInBytes(o.__filePath),downloadedSize:o.__downloaded})}return i(o.__downloaded===o.__total)})}}},{key:"__closeFileStream",value:function(){var i=this;return this.__fileStream?new Promise(function(n,o){i.__fileStream.close(function(a){return a?o(a):n(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(i,n){var o=this,a=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function(s){return o.__pipes=[],a&&o.__requestAbort(),o.state===o.__states.STOPPED||o.state===o.__states.FAILED?void 0:o.__opts.retry?o.__retry(s).catch(function(f){o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("error",f||s),n(f||s)})}):o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("error",s),n(s)})}}},{key:"__retry",value:function(){var i=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||Wr(this.__opts.retry)!=="object")return Promise.reject(n||new Error("wrong retry options"));var o=this.__opts.retry,a=o.delay,s=a===void 0?0:a,f=o.maxRetries,c=f===void 0?999:f;return this.__retryCount>=c?Promise.reject(n||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,n),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(l){return l.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(l){return i.__retryTimeout=setTimeout(function(){return l(0<i.__downloaded?i.resume():i.__start())},s)})}))}},{key:"__onTimeout",value:function(i,n){var o=this;return function(){return o.__requestAbort(),o.__opts.retry?o.__retry(new Error("timeout")).catch(function(a){o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),a?n(a):(o.emit("timeout"),n(new Error("timeout")))})}):o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("timeout"),n(new Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(i,n){var o="",a=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,s=/.*filename="(.*?)";?/i,f=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,c=i.hasOwnProperty("content-disposition"),l=c?i["content-disposition"].match(a):null,x=!c||l?null:i["content-disposition"].match(s),u=!c||l||x?null:i["content-disposition"].match(f);return c&&(l||x||u)?(o=i["content-disposition"],o=o.trim(),l?o=l[1]:x?o=x[1]:u&&(o=u[1]),o=o.replace(/[/\\]/g,"")):0<Fe.basename(new De.URL(this.requestURL).pathname).length?o=Fe.basename(new De.URL(this.requestURL).pathname):o=new De.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(o,n):o.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(i){var n=Fe.join(this.__destFolder,i),o=n;return this.__opts.override||this.state===this.__states.RESUMED||(o=this.__uniqFileNameSync(o),n!==o&&this.emit("renamed",{path:o,fileName:o.split(Fe.sep).pop(),prevPath:n,prevFileName:n.split(Fe.sep).pop()})),o}},{key:"__getFileNameFromOpts",value:function(i,n){if(!this.__opts.fileName)return i;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var o=Fe.join(this.__destFolder,i);return n&&n.headers||this.__response&&this.__response.headers?this.__opts.fileName(i,o,(n||this.__response).headers["content-type"]):this.__opts.fileName(i,o)}if(Wr(this.__opts.fileName)==="object"){var a=this.__opts.fileName,s=a.name,f=!!a.hasOwnProperty("ext")&&a.ext;if(typeof f=="string")return s+"."+f;if(typeof f=="boolean"){if(f)return s;var c=i.includes(".")?i.split(".").pop():"";return c===""?s:s+"."+c}}return i}},{key:"__calculateStats",value:function(i){var n=new Date,o=n-this.__statsEstimate.time,a=n-this.__statsEstimate.throttleTime,s=this.__total||0;i&&(this.__downloaded+=i,this.__progress=s===0?0:100*(this.__downloaded/s),(this.__downloaded===s||1e3<o)&&(this.__statsEstimate.time=n,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===s||a>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=n,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(i){this.state=i,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(i,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},a=new De.URL(n),s={protocol:a.protocol,host:a.hostname,port:a.port,path:a.pathname+a.search,method:i};return o&&(s.headers=o),s}},{key:"__getFilesizeInBytes",value:function(i){try{var n=V.statSync(i,{throwIfNoEntry:!1}),o=n.size||0;return o}catch(a){this.emit("warning",a)}return 0}},{key:"__validate",value:function(i,n){if(typeof i!="string")throw new Error("URL should be an string");if(i.trim()==="")throw new Error("URL couldn't be empty");if(typeof n!="string")throw new Error("Destination Folder should be an string");if(n.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!V.existsSync(n))throw new Error("Destination Folder must exist");var o=V.statSync(n);if(!o.isDirectory())throw new Error("Destination Folder must be a directory");try{V.accessSync(n,V.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(i){var n=this.__getReqOptions(this.__opts.method,i,this.__headers);this.requestURL=i,-1<i.indexOf("https://")?(this.__protocol=wn,n.agent=new wn.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpsRequestOptions)):(this.__protocol=gn,n.agent=new gn.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(i){if(typeof i!="string"||i==="")return i;try{V.accessSync(i,V.F_OK);var n=i.match(/(.*)(\([0-9]+\))(\..*)$/),o=n?n[1].trim():i,a=n?parseInt(n[2].replace(/\(|\)/,"")):0,s=i.split(".").pop();return s!==i&&0<s.length?(s="."+s,o=o.replace(s,"")):s="",this.__uniqFileNameSync(o+" ("+ ++a+")"+s)}catch{return i}}},{key:"__removeFile",value:function(){var i=this;return new Promise(function(n){return i.__fileStream?void i.__fileStream.close(function(o){return o&&i.emit("warning",o),i.__opts.removeOnFail?V.access(i.__filePath,function(a){return a?n():void V.unlink(i.__filePath,function(s){s&&i.emit("warning",o),n()})}):void n()}):n()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),t}(Ou.EventEmitter)});var Fn=d((Zh,An)=>{var ye=require("constants"),Tu=process.cwd,Ut=null,Bu=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ut||(Ut=Tu.call(process)),Ut};try{process.cwd()}catch{}typeof process.chdir=="function"&&($r=process.chdir,process.chdir=function(e){Ut=null,$r.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,$r));var $r;An.exports=Cu;function Cu(e){ye.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=f(e.statSync),e.fstatSync=f(e.fstatSync),e.lstatSync=f(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,x,u){u&&process.nextTick(u)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,x,u,h){h&&process.nextTick(h)},e.lchownSync=function(){}),Bu==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(l){function x(u,h,m){var y=Date.now(),p=0;l(u,h,function _(g){if(g&&(g.code==="EACCES"||g.code==="EPERM"||g.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){e.stat(h,function(E,N){E&&E.code==="ENOENT"?l(u,h,_):m(g)})},p),p<100&&(p+=10);return}m&&m(g)})}return Object.setPrototypeOf&&Object.setPrototypeOf(x,l),x}(e.rename)),e.read=typeof e.read!="function"?e.read:function(l){function x(u,h,m,y,p,_){var g;if(_&&typeof _=="function"){var E=0;g=function(N,R,J){if(N&&N.code==="EAGAIN"&&E<10)return E++,l.call(e,u,h,m,y,p,g);_.apply(this,arguments)}}return l.call(e,u,h,m,y,p,g)}return Object.setPrototypeOf&&Object.setPrototypeOf(x,l),x}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(l){return function(x,u,h,m,y){for(var p=0;;)try{return l.call(e,x,u,h,m,y)}catch(_){if(_.code==="EAGAIN"&&p<10){p++;continue}throw _}}}(e.readSync);function t(l){l.lchmod=function(x,u,h){l.open(x,ye.O_WRONLY|ye.O_SYMLINK,u,function(m,y){if(m){h&&h(m);return}l.fchmod(y,u,function(p){l.close(y,function(_){h&&h(p||_)})})})},l.lchmodSync=function(x,u){var h=l.openSync(x,ye.O_WRONLY|ye.O_SYMLINK,u),m=!0,y;try{y=l.fchmodSync(h,u),m=!1}finally{if(m)try{l.closeSync(h)}catch{}else l.closeSync(h)}return y}}function r(l){ye.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(x,u,h,m){l.open(x,ye.O_SYMLINK,function(y,p){if(y){m&&m(y);return}l.futimes(p,u,h,function(_){l.close(p,function(g){m&&m(_||g)})})})},l.lutimesSync=function(x,u,h){var m=l.openSync(x,ye.O_SYMLINK),y,p=!0;try{y=l.futimesSync(m,u,h),p=!1}finally{if(p)try{l.closeSync(m)}catch{}else l.closeSync(m)}return y}):l.futimes&&(l.lutimes=function(x,u,h,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function i(l){return l&&function(x,u,h){return l.call(e,x,u,function(m){c(m)&&(m=null),h&&h.apply(this,arguments)})}}function n(l){return l&&function(x,u){try{return l.call(e,x,u)}catch(h){if(!c(h))throw h}}}function o(l){return l&&function(x,u,h,m){return l.call(e,x,u,h,function(y){c(y)&&(y=null),m&&m.apply(this,arguments)})}}function a(l){return l&&function(x,u,h){try{return l.call(e,x,u,h)}catch(m){if(!c(m))throw m}}}function s(l){return l&&function(x,u,h){typeof u=="function"&&(h=u,u=null);function m(y,p){p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),h&&h.apply(this,arguments)}return u?l.call(e,x,u,m):l.call(e,x,m)}}function f(l){return l&&function(x,u){var h=u?l.call(e,x,u):l.call(e,x);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function c(l){if(!l||l.code==="ENOSYS")return!0;var x=!process.getuid||process.getuid()!==0;return!!(x&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Pn=d((Kh,Rn)=>{var On=require("stream").Stream;Rn.exports=qu;function qu(e){return{ReadStream:t,WriteStream:r};function t(i,n){if(!(this instanceof t))return new t(i,n);On.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var a=Object.keys(n),s=0,f=a.length;s<f;s++){var c=a[s];this[c]=n[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(l,x){if(l){o.emit("error",l),o.readable=!1;return}o.fd=x,o.emit("open",x),o._read()})}function r(i,n){if(!(this instanceof r))return new r(i,n);On.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),a=0,s=o.length;a<s;a++){var f=o[a];this[f]=n[f]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Bn=d((Vh,Tn)=>{"use strict";Tn.exports=Iu;var Du=Object.getPrototypeOf||function(e){return e.__proto__};function Iu(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Du(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var In=d((Xh,Yr)=>{var U=require("fs"),ku=Fn(),ju=Pn(),Nu=Bn(),Lt=require("util"),H,Mt;typeof Symbol=="function"&&typeof Symbol.for=="function"?(H=Symbol.for("graceful-fs.queue"),Mt=Symbol.for("graceful-fs.previous")):(H="___graceful-fs.queue",Mt="___graceful-fs.previous");function Uu(){}function Dn(e,t){Object.defineProperty(e,H,{get:function(){return t}})}var Oe=Uu;Lt.debuglog?Oe=Lt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Oe=function(){var e=Lt.format.apply(Lt,arguments);e="GFS4: "+e.split(/\n/).join(`
2
- GFS4: `),console.error(e)});U[H]||(Cn=global[H]||[],Dn(U,Cn),U.close=function(e){function t(r,i){return e.call(U,r,function(n){n||qn(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,Mt,{value:e}),t}(U.close),U.closeSync=function(e){function t(r){e.apply(U,arguments),qn()}return Object.defineProperty(t,Mt,{value:e}),t}(U.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Oe(U[H]),require("assert").equal(U[H].length,0)}));var Cn;global[H]||Dn(global,U[H]);Yr.exports=Hr(Nu(U));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!U.__patched&&(Yr.exports=Hr(U),U.__patched=!0);function Hr(e){ku(e),e.gracefulify=Hr,e.createReadStream=R,e.createWriteStream=J;var t=e.readFile;e.readFile=r;function r(v,w,b){return typeof w=="function"&&(b=w,w=null),C(v,w,b);function C(q,B,A,F){return t(q,B,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ke([C,[q,B,A],O,F||Date.now(),Date.now()]):typeof A=="function"&&A.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=n;function n(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return i(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=a);function a(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return o(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=f);function f(v,w,b,C){return typeof b=="function"&&(C=b,b=0),q(v,w,b,C);function q(B,A,F,O,M){return s(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var c=e.readdir;e.readdir=x;var l=/^v[0-5]\./;function x(v,w,b){typeof w=="function"&&(b=w,w=null);var C=l.test(process.version)?function(A,F,O,M){return c(A,q(A,F,O,M))}:function(A,F,O,M){return c(A,F,q(A,F,O,M))};return C(v,w,b);function q(B,A,F,O){return function(M,T){M&&(M.code==="EMFILE"||M.code==="ENFILE")?ke([C,[B,A,F],M,O||Date.now(),Date.now()]):(T&&T.sort&&T.sort(),typeof F=="function"&&F.call(this,M,T))}}}if(process.version.substr(0,4)==="v0.8"){var u=ju(e);_=u.ReadStream,E=u.WriteStream}var h=e.ReadStream;h&&(_.prototype=Object.create(h.prototype),_.prototype.open=g);var m=e.WriteStream;m&&(E.prototype=Object.create(m.prototype),E.prototype.open=N),Object.defineProperty(e,"ReadStream",{get:function(){return _},set:function(v){_=v},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return E},set:function(v){E=v},enumerable:!0,configurable:!0});var y=_;Object.defineProperty(e,"FileReadStream",{get:function(){return y},set:function(v){y=v},enumerable:!0,configurable:!0});var p=E;Object.defineProperty(e,"FileWriteStream",{get:function(){return p},set:function(v){p=v},enumerable:!0,configurable:!0});function _(v,w){return this instanceof _?(h.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function g(){var v=this;z(v.path,v.flags,v.mode,function(w,b){w?(v.autoClose&&v.destroy(),v.emit("error",w)):(v.fd=b,v.emit("open",b),v.read())})}function E(v,w){return this instanceof E?(m.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function N(){var v=this;z(v.path,v.flags,v.mode,function(w,b){w?(v.destroy(),v.emit("error",w)):(v.fd=b,v.emit("open",b))})}function R(v,w){return new e.ReadStream(v,w)}function J(v,w){return new e.WriteStream(v,w)}var j=e.open;e.open=z;function z(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return j(B,A,F,function(T,D){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}return e}function ke(e){Oe("ENQUEUE",e[0].name,e[1]),U[H].push(e),Gr()}var zt;function qn(){for(var e=Date.now(),t=0;t<U[H].length;++t)U[H][t].length>2&&(U[H][t][3]=e,U[H][t][4]=e);Gr()}function Gr(){if(clearTimeout(zt),zt=void 0,U[H].length!==0){var e=U[H].shift(),t=e[0],r=e[1],i=e[2],n=e[3],o=e[4];if(n===void 0)Oe("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-n>=6e4){Oe("TIMEOUT",t.name,r);var a=r.pop();typeof a=="function"&&a.call(null,i)}else{var s=Date.now()-o,f=Math.max(o-n,1),c=Math.min(f*1.2,100);s>=c?(Oe("RETRY",t.name,r),t.apply(null,r.concat([n]))):U[H].push(e)}zt===void 0&&(zt=setTimeout(Gr,0))}}});var Zr=d((Jh,kn)=>{"use strict";kn.exports=e=>{let t=new Uint8Array(e);if(!(t&&t.length>1))return null;let r=(i,n)=>{n=Object.assign({offset:0},n);for(let o=0;o<i.length;o++)if(i[o]!==t[o+n.offset])return!1;return!0};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(r([80,75,3,4])&&r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r([80,75,3,4])&&r([77,69,84,65,45,73,78,70,47,109,111,122,105,108,108,97,46,114,115,97],{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(r([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8))return{ext:"zip",mime:"application/zip"};if(r([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(t[6]===0||t[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([0,0,0])&&(t[3]===24||t[3]===32)&&r([102,116,121,112],{offset:4})||r([51,103,112,53])||r([0,0,0,28,102,116,121,112,109,112,52,50])&&r([109,112,52,49,109,112,52,50,105,115,111,109],{offset:16})||r([0,0,0,28,102,116,121,112,105,115,111,109])||r([0,0,0,28,102,116,121,112,109,112,52,50,0,0,0,0]))return{ext:"mp4",mime:"video/mp4"};if(r([0,0,0,28,102,116,121,112,77,52,86]))return{ext:"m4v",mime:"video/x-m4v"};if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){let i=t.subarray(4,4100),n=i.findIndex((o,a,s)=>s[a]===66&&s[a+1]===130);if(n>=0){let o=n+3,a=s=>Array.from(s).every((f,c)=>i[o+c]===f.charCodeAt(0));if(a("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(a("webm"))return{ext:"webm",mime:"video/webm"}}}return r([0,0,0,20,102,116,121,112,113,116,32,32])||r([102,114,101,101],{offset:4})||r([102,116,121,112,113,116,32,32],{offset:4})||r([109,100,97,116],{offset:4})||r([119,105,100,101],{offset:4})?{ext:"mov",mime:"video/quicktime"}:r([82,73,70,70])&&r([65,86,73],{offset:8})?{ext:"avi",mime:"video/x-msvideo"}:r([48,38,178,117,142,102,207,17,166,217])?{ext:"wmv",mime:"video/x-ms-wmv"}:r([0,0,1,186])?{ext:"mpg",mime:"video/mpeg"}:r([73,68,51])||r([255,251])?{ext:"mp3",mime:"audio/mpeg"}:r([102,116,121,112,77,52,65],{offset:4})||r([77,52,65,32])?{ext:"m4a",mime:"audio/m4a"}:r([79,112,117,115,72,101,97,100],{offset:28})?{ext:"opus",mime:"audio/opus"}:r([79,103,103,83])?{ext:"ogg",mime:"audio/ogg"}:r([102,76,97,67])?{ext:"flac",mime:"audio/x-flac"}:r([82,73,70,70])&&r([87,65,86,69],{offset:8})?{ext:"wav",mime:"audio/x-wav"}:r([35,33,65,77,82,10])?{ext:"amr",mime:"audio/amr"}:r([37,80,68,70])?{ext:"pdf",mime:"application/pdf"}:r([77,90])?{ext:"exe",mime:"application/x-msdownload"}:(t[0]===67||t[0]===70)&&r([87,83],{offset:1})?{ext:"swf",mime:"application/x-shockwave-flash"}:r([123,92,114,116,102])?{ext:"rtf",mime:"application/rtf"}:r([0,97,115,109])?{ext:"wasm",mime:"application/wasm"}:r([119,79,70,70])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff",mime:"font/woff"}:r([119,79,70,50])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff2",mime:"font/woff2"}:r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8}))?{ext:"eot",mime:"application/octet-stream"}:r([0,1,0,0,0])?{ext:"ttf",mime:"font/ttf"}:r([79,84,84,79,0])?{ext:"otf",mime:"font/otf"}:r([0,0,1,0])?{ext:"ico",mime:"image/x-icon"}:r([70,76,86,1])?{ext:"flv",mime:"video/x-flv"}:r([37,33])?{ext:"ps",mime:"application/postscript"}:r([253,55,122,88,90,0])?{ext:"xz",mime:"application/x-xz"}:r([83,81,76,105])?{ext:"sqlite",mime:"application/x-sqlite3"}:r([78,69,83,26])?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:r([67,114,50,52])?{ext:"crx",mime:"application/x-google-chrome-extension"}:r([77,83,67,70])||r([73,83,99,40])?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:r([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])?{ext:"deb",mime:"application/x-deb"}:r([33,60,97,114,99,104,62])?{ext:"ar",mime:"application/x-unix-archive"}:r([237,171,238,219])?{ext:"rpm",mime:"application/x-rpm"}:r([31,160])||r([31,157])?{ext:"Z",mime:"application/x-compress"}:r([76,90,73,80])?{ext:"lz",mime:"application/x-lzip"}:r([208,207,17,224,161,177,26,225])?{ext:"msi",mime:"application/x-msi"}:r([6,14,43,52,2,5,1,1,13,1,2,1,1,2])?{ext:"mxf",mime:"application/mxf"}:r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196}))?{ext:"mts",mime:"video/mp2t"}:r([66,76,69,78,68,69,82])?{ext:"blend",mime:"application/x-blender"}:r([66,80,71,251])?{ext:"bpg",mime:"image/bpg"}:null}});var Wt=d((Qh,jn)=>{"use strict";var ue=jn.exports=function(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"};ue.writable=function(e){return ue(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"};ue.readable=function(e){return ue(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object"};ue.duplex=function(e){return ue.writable(e)&&ue.readable(e)};ue.transform=function(e){return ue.duplex(e)&&typeof e._transform=="function"&&typeof e._transformState=="object"}});var ft=d((ep,Kr)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Kr.exports={nextTick:Lu}:Kr.exports=process;function Lu(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,a;switch(n){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(n-1),a=0;a<o.length;)o[a++]=arguments[a];return process.nextTick(function(){e.apply(null,o)})}}});var Un=d((tp,Nn)=>{var zu={}.toString;Nn.exports=Array.isArray||function(e){return zu.call(e)=="[object Array]"}});var Vr=d((rp,Ln)=>{Ln.exports=require("stream")});var ut=d((Xr,Mn)=>{var $t=require("buffer"),le=$t.Buffer;function zn(e,t){for(var r in e)t[r]=e[r]}le.from&&le.alloc&&le.allocUnsafe&&le.allocUnsafeSlow?Mn.exports=$t:(zn($t,Xr),Xr.Buffer=je);function je(e,t,r){return le(e,t,r)}zn(le,je);je.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return le(e,t,r)};je.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=le(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};je.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return le(e)};je.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return $t.SlowBuffer(e)}});var Ne=d(K=>{function Mu(e){return Array.isArray?Array.isArray(e):Ht(e)==="[object Array]"}K.isArray=Mu;function Wu(e){return typeof e=="boolean"}K.isBoolean=Wu;function $u(e){return e===null}K.isNull=$u;function Hu(e){return e==null}K.isNullOrUndefined=Hu;function Gu(e){return typeof e=="number"}K.isNumber=Gu;function Yu(e){return typeof e=="string"}K.isString=Yu;function Zu(e){return typeof e=="symbol"}K.isSymbol=Zu;function Ku(e){return e===void 0}K.isUndefined=Ku;function Vu(e){return Ht(e)==="[object RegExp]"}K.isRegExp=Vu;function Xu(e){return typeof e=="object"&&e!==null}K.isObject=Xu;function Ju(e){return Ht(e)==="[object Date]"}K.isDate=Ju;function Qu(e){return Ht(e)==="[object Error]"||e instanceof Error}K.isError=Qu;function el(e){return typeof e=="function"}K.isFunction=el;function tl(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}K.isPrimitive=tl;K.isBuffer=require("buffer").Buffer.isBuffer;function Ht(e){return Object.prototype.toString.call(e)}});var Wn=d((np,Jr)=>{typeof Object.create=="function"?Jr.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Jr.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var Ue=d((op,ei)=>{try{if(Qr=require("util"),typeof Qr.inherits!="function")throw"";ei.exports=Qr.inherits}catch{ei.exports=Wn()}var Qr});var Hn=d((ap,ti)=>{"use strict";function rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $n=ut().Buffer,lt=require("util");function il(e,t,r){e.copy(t,r)}ti.exports=function(){function e(){rl(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return $n.alloc(0);for(var i=$n.allocUnsafe(r>>>0),n=this.head,o=0;n;)il(n.data,i,o),o+=n.data.length,n=n.next;return i},e}();lt&&lt.inspect&&lt.inspect.custom&&(ti.exports.prototype[lt.inspect.custom]=function(){var e=lt.inspect({length:this.length});return this.constructor.name+" "+e})});var ri=d((sp,Gn)=>{"use strict";var Gt=ft();function nl(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Gt.nextTick(Yt,this,e)):Gt.nextTick(Yt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,Gt.nextTick(Yt,r,o)):Gt.nextTick(Yt,r,o):t&&t(o)}),this)}function ol(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Yt(e,t){e.emit("error",t)}Gn.exports={destroy:nl,undestroy:ol}});var Zn=d((fp,Yn)=>{Yn.exports=require("util").deprecate});var ni=d((up,ro)=>{"use strict";var Re=ft();ro.exports=W;function Vn(e){var t=this;this.next=null,this.entry=null,this.finish=function(){El(t,e)}}var al=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Re.nextTick,Le;W.WritableState=xt;var Xn=Object.create(Ne());Xn.inherits=Ue();var sl={deprecate:Zn()},Jn=Vr(),Kt=ut().Buffer,fl=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ul(e){return Kt.from(e)}function ll(e){return Kt.isBuffer(e)||e instanceof fl}var Qn=ri();Xn.inherits(W,Jn);function cl(){}function xt(e,t){Le=Le||Pe(),e=e||{};var r=t instanceof Le;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){vl(t,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Vn(this)}xt.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(xt.prototype,"buffer",{get:sl.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Zt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Zt=Function.prototype[Symbol.hasInstance],Object.defineProperty(W,Symbol.hasInstance,{value:function(e){return Zt.call(this,e)?!0:this!==W?!1:e&&e._writableState instanceof xt}})):Zt=function(e){return e instanceof this};function W(e){if(Le=Le||Pe(),!Zt.call(W,this)&&!(this instanceof Le))return new W(e);this._writableState=new xt(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),Jn.call(this)}W.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function xl(e,t){var r=new Error("write after end");e.emit("error",r),Re.nextTick(t,r)}function dl(e,t,r,i){var n=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),Re.nextTick(i,o),n=!1),n}W.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&ll(e);return o&&!Kt.isBuffer(e)&&(e=ul(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=cl),i.ended?xl(this,r):(o||dl(this,i,e,r))&&(i.pendingcb++,n=pl(this,i,o,e,t,r)),n};W.prototype.cork=function(){var e=this._writableState;e.corked++};W.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&eo(this,e))};W.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function hl(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Kt.from(t,r)),t}Object.defineProperty(W.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pl(e,t,r,i,n,o){if(!r){var a=hl(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else ii(e,t,!1,s,i,n,o);return f}function ii(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function ml(e,t,r,i,n){--t.pendingcb,r?(Re.nextTick(n,i),Re.nextTick(ct,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),ct(e,t))}function yl(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function vl(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(yl(r),t)ml(e,r,i,t,n);else{var o=to(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&eo(e,r),i?al(Kn,e,r,o,n):Kn(e,r,o,n)}}function Kn(e,t,r,i){r||_l(e,t),t.pendingcb--,i(),ct(e,t)}function _l(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function eo(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,ii(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new Vn(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback,x=t.objectMode?1:f.length;if(ii(e,t,!1,x,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}W.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};W.prototype._writev=null;W.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||bl(this,i,r)};function to(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function gl(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),ct(e,t)})}function wl(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Re.nextTick(gl,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function ct(e,t){var r=to(t);return r&&(wl(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function bl(e,t,r){t.ending=!0,ct(e,t),r&&(t.finished?Re.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function El(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(W.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});W.prototype.destroy=Qn.destroy;W.prototype._undestroy=Qn.undestroy;W.prototype._destroy=function(e,t){this.end(),t(e)}});var Pe=d((lp,ao)=>{"use strict";var io=ft(),Sl=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};ao.exports=ce;var no=Object.create(Ne());no.inherits=Ue();var oo=si(),ai=ni();no.inherits(ce,oo);for(oi=Sl(ai.prototype),Vt=0;Vt<oi.length;Vt++)Xt=oi[Vt],ce.prototype[Xt]||(ce.prototype[Xt]=ai.prototype[Xt]);var oi,Xt,Vt;function ce(e){if(!(this instanceof ce))return new ce(e);oo.call(this,e),ai.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",Al)}Object.defineProperty(ce.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Al(){this.allowHalfOpen||this._writableState.ended||io.nextTick(Fl,this)}function Fl(e){e.end()}Object.defineProperty(ce.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});ce.prototype._destroy=function(e,t){this.push(null),this.end(),io.nextTick(t,e)}});var li=d(fo=>{"use strict";var ui=ut().Buffer,so=ui.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ol(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Rl(e){var t=Ol(e);if(typeof t!="string"&&(ui.isEncoding===so||!so(e)))throw new Error("Unknown encoding: "+e);return t||e}fo.StringDecoder=dt;function dt(e){this.encoding=Rl(e);var t;switch(this.encoding){case"utf16le":this.text=Dl,this.end=Il,t=4;break;case"utf8":this.fillLast=Bl,t=4;break;case"base64":this.text=kl,this.end=jl,t=3;break;default:this.write=Nl,this.end=Ul;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ui.allocUnsafe(t)}dt.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};dt.prototype.end=ql;dt.prototype.text=Cl;dt.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function fi(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Pl(e,t,r){var i=t.length-1;if(i<r)return 0;var n=fi(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=fi(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=fi(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function Tl(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Bl(e){var t=this.lastTotal-this.lastNeed,r=Tl(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Cl(e,t){var r=Pl(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function ql(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Dl(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Il(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function kl(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function jl(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Nl(e){return e.toString(this.encoding)}function Ul(e){return e&&e.length?this.write(e):""}});var si=d((dp,wo)=>{"use strict";var Me=ft();wo.exports=I;var Ll=Un(),ht;I.ReadableState=mo;var xp=require("events").EventEmitter,xo=function(e,t){return e.listeners(t).length},pi=Vr(),pt=ut().Buffer,zl=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Ml(e){return pt.from(e)}function Wl(e){return pt.isBuffer(e)||e instanceof zl}var ho=Object.create(Ne());ho.inherits=Ue();var ci=require("util"),P=void 0;ci&&ci.debuglog?P=ci.debuglog("stream"):P=function(){};var $l=Hn(),po=ri(),ze;ho.inherits(I,pi);var xi=["error","close","destroy","pause","resume"];function Hl(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Ll(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function mo(e,t){ht=ht||Pe(),e=e||{};var r=t instanceof ht;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new $l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(ze||(ze=li().StringDecoder),this.decoder=new ze(e.encoding),this.encoding=e.encoding)}function I(e){if(ht=ht||Pe(),!(this instanceof I))return new I(e);this._readableState=new mo(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),pi.call(this)}Object.defineProperty(I.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});I.prototype.destroy=po.destroy;I.prototype._undestroy=po.undestroy;I.prototype._destroy=function(e,t){this.push(null),t(e)};I.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=pt.from(e,t),t=""),i=!0),yo(this,e,t,!1,i)};I.prototype.unshift=function(e){return yo(this,e,null,!0,!1)};function yo(e,t,r,i,n){var o=e._readableState;if(t===null)o.reading=!1,Kl(e,o);else{var a;n||(a=Gl(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==pt.prototype&&(t=Ml(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):di(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?di(e,o,t,!1):vo(e,o)):di(e,o,t,!1))):i||(o.reading=!1)}return Yl(o)}function di(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Jt(e)),vo(e,t)}function Gl(e,t){var r;return!Wl(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function Yl(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}I.prototype.isPaused=function(){return this._readableState.flowing===!1};I.prototype.setEncoding=function(e){return ze||(ze=li().StringDecoder),this._readableState.decoder=new ze(e),this._readableState.encoding=e,this};var uo=8388608;function Zl(e){return e>=uo?e=uo:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function lo(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Zl(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}I.prototype.read=function(e){P("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return P("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?hi(this):Jt(this),null;if(e=lo(e,t),e===0&&t.ended)return t.length===0&&hi(this),null;var i=t.needReadable;P("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,P("length less than watermark",i)),t.ended||t.reading?(i=!1,P("reading or ended",i)):i&&(P("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=lo(r,t)));var n;return e>0?n=_o(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&hi(this)),n!==null&&this.emit("data",n),n};function Kl(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,Jt(e)}}function Jt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Me.nextTick(co,e):co(e))}function co(e){P("emit readable"),e.emit("readable"),mi(e)}function vo(e,t){t.readingMore||(t.readingMore=!0,Me.nextTick(Vl,e,t))}function Vl(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(P("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}I.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};I.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,P("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=n?s:p;i.endEmitted?Me.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(_,g){P("onunpipe"),_===r&&g&&g.hasUnpiped===!1&&(g.hasUnpiped=!0,l())}function s(){P("onend"),e.end()}var f=Xl(r);e.on("drain",f);var c=!1;function l(){P("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",p),r.removeListener("data",u),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}var x=!1;r.on("data",u);function u(_){P("ondata"),x=!1;var g=e.write(_);g===!1&&!x&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&go(i.pipes,e)!==-1)&&!c&&(P("false write response, pause",i.awaitDrain),i.awaitDrain++,x=!0),r.pause())}function h(_){P("onerror",_),p(),e.removeListener("error",h),xo(e,"error")===0&&e.emit("error",_)}Hl(e,"error",h);function m(){e.removeListener("finish",y),p()}e.once("close",m);function y(){P("onfinish"),e.removeListener("close",m),p()}e.once("finish",y);function p(){P("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(P("pipe resume"),r.resume()),e};function Xl(e){return function(){var t=e._readableState;P("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&xo(e,"data")&&(t.flowing=!0,mi(e))}}I.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=go(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};I.prototype.on=function(e,t){var r=pi.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&Jt(this):Me.nextTick(Jl,this))}return r};I.prototype.addListener=I.prototype.on;function Jl(e){P("readable nexttick read 0"),e.read(0)}I.prototype.resume=function(){var e=this._readableState;return e.flowing||(P("resume"),e.flowing=!0,Ql(this,e)),this};function Ql(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick(ec,e,t))}function ec(e,t){t.reading||(P("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),mi(e),t.flowing&&!t.reading&&e.read(0)}I.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function mi(e){var t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}I.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(P("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(P("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=function(a){return function(){return e[a].apply(e,arguments)}}(n));for(var o=0;o<xi.length;o++)e.on(xi[o],this.emit.bind(this,xi[o]));return this._read=function(a){P("wrapped _read",a),i&&(i=!1,e.resume())},this};Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});I._fromList=_o;function _o(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=tc(e,t.buffer,t.decoder),r}function tc(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?rc(e,t):ic(e,t),i}function rc(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?n+=o:n+=o.slice(0,e),e-=a,e===0){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function ic(e,t){var r=pt.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(a));break}++n}return t.length-=n,r}function hi(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Me.nextTick(nc,t,e))}function nc(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function go(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var yi=d((hp,So)=>{"use strict";So.exports=xe;var Qt=Pe(),Eo=Object.create(Ne());Eo.inherits=Ue();Eo.inherits(xe,Qt);function oc(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function xe(e){if(!(this instanceof xe))return new xe(e);Qt.call(this,e),this._transformState={afterTransform:oc.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",ac)}function ac(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){bo(e,t,r)}):bo(this,null,null)}xe.prototype.push=function(e,t){return this._transformState.needTransform=!1,Qt.prototype.push.call(this,e,t)};xe.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};xe.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};xe.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};xe.prototype._destroy=function(e,t){var r=this;Qt.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function bo(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Ro=d((pp,Oo)=>{"use strict";Oo.exports=mt;var Ao=yi(),Fo=Object.create(Ne());Fo.inherits=Ue();Fo.inherits(mt,Ao);function mt(e){if(!(this instanceof mt))return new mt(e);Ao.call(this,e)}mt.prototype._transform=function(e,t,r){r(null,e)}});var We=d((G,er)=>{var ie=require("stream");process.env.READABLE_STREAM==="disable"&&ie?(er.exports=ie,G=er.exports=ie.Readable,G.Readable=ie.Readable,G.Writable=ie.Writable,G.Duplex=ie.Duplex,G.Transform=ie.Transform,G.PassThrough=ie.PassThrough,G.Stream=ie):(G=er.exports=si(),G.Stream=ie||G,G.Readable=G,G.Writable=ni(),G.Duplex=Pe(),G.Transform=yi(),G.PassThrough=Ro())});var To=d((mp,Po)=>{Po.exports=We().Duplex});var _i=d((vi,Co)=>{var tr=require("buffer"),ne=tr.Buffer;function Bo(e,t){for(var r in e)t[r]=e[r]}ne.from&&ne.alloc&&ne.allocUnsafe&&ne.allocUnsafeSlow?Co.exports=tr:(Bo(tr,vi),vi.Buffer=Te);function Te(e,t,r){return ne(e,t,r)}Te.prototype=Object.create(ne.prototype);Bo(ne,Te);Te.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ne(e,t,r)};Te.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=ne(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Te.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ne(e)};Te.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return tr.SlowBuffer(e)}});var Do=d((yp,qo)=>{var gi=To(),sc=require("util"),$e=_i().Buffer;function L(e){if(!(this instanceof L))return new L(e);if(this._bufs=[],this.length=0,typeof e=="function"){this._callback=e;var t=function(i){this._callback&&(this._callback(i),this._callback=null)}.bind(this);this.on("pipe",function(i){i.on("error",t)}),this.on("unpipe",function(i){i.removeListener("error",t)})}else this.append(e);gi.call(this)}sc.inherits(L,gi);L.prototype._offset=function(t){var r=0,i=0,n;if(t===0)return[0,0];for(;i<this._bufs.length;i++){if(n=r+this._bufs[i].length,t<n||i==this._bufs.length-1)return[i,t-r];r=n}};L.prototype.append=function(t){var r=0;if($e.isBuffer(t))this._appendBuffer(t);else if(Array.isArray(t))for(;r<t.length;r++)this.append(t[r]);else if(t instanceof L)for(;r<t._bufs.length;r++)this.append(t._bufs[r]);else t!=null&&(typeof t=="number"&&(t=t.toString()),this._appendBuffer($e.from(t)));return this};L.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length};L.prototype._write=function(t,r,i){this._appendBuffer(t),typeof i=="function"&&i()};L.prototype._read=function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)};L.prototype.end=function(t){gi.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)};L.prototype.get=function(t){return this.slice(t,t+1)[0]};L.prototype.slice=function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)};L.prototype.copy=function(t,r,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return t||$e.alloc(0);var o=!!t,a=this._offset(i),s=n-i,f=s,c=o&&r||0,l=a[1],x,u;if(i===0&&n==this.length){if(!o)return this._bufs.length===1?this._bufs[0]:$e.concat(this._bufs,this.length);for(u=0;u<this._bufs.length;u++)this._bufs[u].copy(t,c),c+=this._bufs[u].length;return t}if(f<=this._bufs[a[0]].length-l)return o?this._bufs[a[0]].copy(t,r,l,l+f):this._bufs[a[0]].slice(l,l+f);for(o||(t=$e.allocUnsafe(s)),u=a[0];u<this._bufs.length;u++){if(x=this._bufs[u].length-l,f>x)this._bufs[u].copy(t,c,l),c+=x;else{this._bufs[u].copy(t,c,l,l+f),c+=x;break}f-=x,l&&(l=0)}return t.length>c?t.slice(0,c):t};L.prototype.shallowSlice=function(t,r){t=t||0,r=r||this.length,t<0&&(t+=this.length),r<0&&(r+=this.length);var i=this._offset(t),n=this._offset(r),o=this._bufs.slice(i[0],n[0]+1);return n[1]==0?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),i[1]!=0&&(o[0]=o[0].slice(i[1])),new L(o)};L.prototype.toString=function(t,r,i){return this.slice(r,i).toString(t)};L.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this};L.prototype.duplicate=function(){for(var t=0,r=new L;t<this._bufs.length;t++)r.append(this._bufs[t]);return r};L.prototype.destroy=function(){this._bufs.length=0,this.length=0,this.push(null)};(function(){var e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1};for(var t in e)(function(r){L.prototype[r]=function(i){return this.slice(i,i+e[r])[r](0)}})(t)})();qo.exports=L});var ko=d((vp,Io)=>{Io.exports=uc;var fc=Object.prototype.hasOwnProperty;function uc(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)fc.call(r,i)&&(e[i]=r[i])}return e}});var No=d((_p,jo)=>{var lc={}.toString;jo.exports=Array.isArray||function(e){return lc.call(e)=="[object Array]"}});var He=d((gp,Uo)=>{"use strict";Uo.exports=TypeError});var wi=d((wp,Lo)=>{"use strict";Lo.exports=Object});var Mo=d((bp,zo)=>{"use strict";zo.exports=Error});var $o=d((Ep,Wo)=>{"use strict";Wo.exports=EvalError});var Go=d((Sp,Ho)=>{"use strict";Ho.exports=RangeError});var Zo=d((Ap,Yo)=>{"use strict";Yo.exports=ReferenceError});var bi=d((Fp,Ko)=>{"use strict";Ko.exports=SyntaxError});var Xo=d((Op,Vo)=>{"use strict";Vo.exports=URIError});var Qo=d((Rp,Jo)=>{"use strict";Jo.exports=Math.abs});var ta=d((Pp,ea)=>{"use strict";ea.exports=Math.floor});var ia=d((Tp,ra)=>{"use strict";ra.exports=Math.max});var oa=d((Bp,na)=>{"use strict";na.exports=Math.min});var sa=d((Cp,aa)=>{"use strict";aa.exports=Math.pow});var ua=d((qp,fa)=>{"use strict";fa.exports=Math.round});var ca=d((Dp,la)=>{"use strict";la.exports=Number.isNaN||function(t){return t!==t}});var da=d((Ip,xa)=>{"use strict";var cc=ca();xa.exports=function(t){return cc(t)||t===0?t:t<0?-1:1}});var pa=d((kp,ha)=>{"use strict";ha.exports=Object.getOwnPropertyDescriptor});var Ge=d((jp,ma)=>{"use strict";var rr=pa();if(rr)try{rr([],"length")}catch{rr=null}ma.exports=rr});var yt=d((Np,ya)=>{"use strict";var ir=Object.defineProperty||!1;if(ir)try{ir({},"a",{value:1})}catch{ir=!1}ya.exports=ir});var Ei=d((Up,va)=>{"use strict";va.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[r]=n;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==n||s.enumerable!==!0)return!1}return!0}});var wa=d((Lp,ga)=>{"use strict";var _a=typeof Symbol<"u"&&Symbol,xc=Ei();ga.exports=function(){return typeof _a!="function"||typeof Symbol!="function"||typeof _a("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:xc()}});var Si=d((zp,ba)=>{"use strict";ba.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Ai=d((Mp,Ea)=>{"use strict";var dc=wi();Ea.exports=dc.getPrototypeOf||null});var Fa=d((Wp,Aa)=>{"use strict";var hc="Function.prototype.bind called on incompatible ",pc=Object.prototype.toString,mc=Math.max,yc="[object Function]",Sa=function(t,r){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<r.length;o+=1)i[o+t.length]=r[o];return i},vc=function(t,r){for(var i=[],n=r||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},_c=function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r};Aa.exports=function(t){var r=this;if(typeof r!="function"||pc.apply(r)!==yc)throw new TypeError(hc+r);for(var i=vc(arguments,1),n,o=function(){if(this instanceof n){var l=r.apply(this,Sa(i,arguments));return Object(l)===l?l:this}return r.apply(t,Sa(i,arguments))},a=mc(0,r.length-i.length),s=[],f=0;f<a;f++)s[f]="$"+f;if(n=Function("binder","return function ("+_c(s,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=function(){};c.prototype=r.prototype,n.prototype=new c,c.prototype=null}return n}});var Ye=d(($p,Oa)=>{"use strict";var gc=Fa();Oa.exports=Function.prototype.bind||gc});var nr=d((Hp,Ra)=>{"use strict";Ra.exports=Function.prototype.call});var or=d((Gp,Pa)=>{"use strict";Pa.exports=Function.prototype.apply});var Ba=d((Yp,Ta)=>{"use strict";Ta.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Fi=d((Zp,Ca)=>{"use strict";var wc=Ye(),bc=or(),Ec=nr(),Sc=Ba();Ca.exports=Sc||wc.call(Ec,bc)});var ar=d((Kp,qa)=>{"use strict";var Ac=Ye(),Fc=He(),Oc=nr(),Rc=Fi();qa.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new Fc("a function is required");return Rc(Ac,Oc,t)}});var Ua=d((Vp,Na)=>{"use strict";var Pc=ar(),Da=Ge(),ka;try{ka=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Oi=!!ka&&Da&&Da(Object.prototype,"__proto__"),ja=Object,Ia=ja.getPrototypeOf;Na.exports=Oi&&typeof Oi.get=="function"?Pc([Oi.get]):typeof Ia=="function"?function(t){return Ia(t==null?t:ja(t))}:!1});var Ri=d((Xp,Wa)=>{"use strict";var La=Si(),za=Ai(),Ma=Ua();Wa.exports=La?function(t){return La(t)}:za?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return za(t)}:Ma?function(t){return Ma(t)}:null});var Ha=d((Jp,$a)=>{"use strict";var Tc=async function(){}.constructor;$a.exports=()=>Tc});var Ya=d((Qp,Ga)=>{"use strict";var Bc=function*(){}.constructor;Ga.exports=()=>Bc});var Ka=d((em,Za)=>{"use strict";var Cc=async function*(){}.constructor;Za.exports=()=>Cc});var Xa=d((tm,Va)=>{"use strict";var qc=Function.prototype.call,Dc=Object.prototype.hasOwnProperty,Ic=Ye();Va.exports=Ic.call(qc,Dc)});var Ti=d((rm,rs)=>{"use strict";var S,kc=wi(),jc=Mo(),Nc=$o(),Uc=Go(),Lc=Zo(),Xe=bi(),Ve=He(),zc=Xo(),Mc=Qo(),Wc=ta(),$c=ia(),Hc=oa(),Gc=sa(),Yc=ua(),Zc=da(),vt=Ge(),Kc=yt(),Pi=function(){throw new Ve},Vc=vt?function(){try{return arguments.callee,Pi}catch{try{return vt(arguments,"callee").get}catch{return Pi}}}():Pi,Ze=wa()(),$=Ri(),Xc=Ai(),Jc=Si(),ts=or(),_t=nr(),Ke={},Qc=typeof Uint8Array>"u"||!$?S:$(Uint8Array),Be={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?S:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?S:ArrayBuffer,"%ArrayIteratorPrototype%":Ze&&$?$([][Symbol.iterator]()):S,"%AsyncFromSyncIteratorPrototype%":S,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?S:Atomics,"%BigInt%":typeof BigInt>"u"?S:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?S:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?S:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?S:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jc,"%eval%":eval,"%EvalError%":Nc,"%Float16Array%":typeof Float16Array>"u"?S:Float16Array,"%Float32Array%":typeof Float32Array>"u"?S:Float32Array,"%Float64Array%":typeof Float64Array>"u"?S:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?S:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?S:Int8Array,"%Int16Array%":typeof Int16Array>"u"?S:Int16Array,"%Int32Array%":typeof Int32Array>"u"?S:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ze&&$?$($([][Symbol.iterator]())):S,"%JSON%":typeof JSON=="object"?JSON:S,"%Map%":typeof Map>"u"?S:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ze||!$?S:$(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":kc,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?S:Promise,"%Proxy%":typeof Proxy>"u"?S:Proxy,"%RangeError%":Uc,"%ReferenceError%":Lc,"%Reflect%":typeof Reflect>"u"?S:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?S:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ze||!$?S:$(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?S:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ze&&$?$(""[Symbol.iterator]()):S,"%Symbol%":Ze?Symbol:S,"%SyntaxError%":Xe,"%ThrowTypeError%":Vc,"%TypedArray%":Qc,"%TypeError%":Ve,"%Uint8Array%":typeof Uint8Array>"u"?S:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?S:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?S:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?S:Uint32Array,"%URIError%":zc,"%WeakMap%":typeof WeakMap>"u"?S:WeakMap,"%WeakRef%":typeof WeakRef>"u"?S:WeakRef,"%WeakSet%":typeof WeakSet>"u"?S:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":ts,"%Object.defineProperty%":Kc,"%Object.getPrototypeOf%":Xc,"%Math.abs%":Mc,"%Math.floor%":Wc,"%Math.max%":$c,"%Math.min%":Hc,"%Math.pow%":Gc,"%Math.round%":Yc,"%Math.sign%":Zc,"%Reflect.getPrototypeOf%":Jc};if($)try{null.error}catch(e){Ja=$($(e)),Be["%Error.prototype%"]=Ja}var Ja,ex=Ha(),tx=Ya(),rx=Ka(),ix=function e(t){var r;if(t==="%AsyncFunction%")r=ex()||void 0;else if(t==="%GeneratorFunction%")r=tx()||void 0;else if(t==="%AsyncGeneratorFunction%")r=rx()||void 0;else if(t==="%AsyncGenerator%"){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=e("%AsyncGenerator%");n&&$&&(r=$(n.prototype))}return Be[t]=r,r},Qa={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gt=Ye(),sr=Xa(),nx=gt.call(_t,Array.prototype.concat),ox=gt.call(ts,Array.prototype.splice),es=gt.call(_t,String.prototype.replace),fr=gt.call(_t,String.prototype.slice),ax=gt.call(_t,RegExp.prototype.exec),sx=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fx=/\\(\\)?/g,ux=function(t){var r=fr(t,0,1),i=fr(t,-1);if(r==="%"&&i!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var n=[];return es(t,sx,function(o,a,s,f){n[n.length]=s?es(f,fx,"$1"):a||o}),n},lx=function(t,r){var i=t,n;if(sr(Qa,i)&&(n=Qa[i],i="%"+n[0]+"%"),sr(Be,i)){var o=Be[i];if(o===Ke&&(o=ix(i)),typeof o>"u"&&!r)throw new Ve("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new Xe("intrinsic "+t+" does not exist!")};rs.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Ve("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ve('"allowMissing" argument must be a boolean');if(ax(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=ux(t),n=i.length>0?i[0]:"",o=lx("%"+n+"%",r),a=o.name,s=o.value,f=!1,c=o.alias;c&&(n=c[0],ox(i,nx([0,1],c)));for(var l=1,x=!0;l<i.length;l+=1){var u=i[l],h=fr(u,0,1),m=fr(u,-1);if((h==='"'||h==="'"||h==="`"||m==='"'||m==="'"||m==="`")&&h!==m)throw new Xe("property names with quotes must have matching quotes");if((u==="constructor"||!x)&&(f=!0),n+="."+u,a="%"+n+"%",sr(Be,a))s=Be[a];else if(s!=null){if(!(u in s)){if(!r)throw new Ve("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&l+1>=i.length){var y=vt(s,u);x=!!y,x&&"get"in y&&!("originalValue"in y.get)?s=y.get:s=s[u]}else x=sr(s,u),s=s[u];x&&!f&&(Be[a]=s)}}return s}});var Bi=d((im,os)=>{"use strict";var is=Ti(),ns=ar(),cx=ns([is("%String.prototype.indexOf%")]);os.exports=function(t,r){var i=is(t,!!r);return typeof i=="function"&&cx(t,".prototype.")>-1?ns([i]):i}});var us=d((nm,fs)=>{"use strict";var ss=Function.prototype.toString,Je=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,qi,ur;if(typeof Je=="function"&&typeof Object.defineProperty=="function")try{qi=Object.defineProperty({},"length",{get:function(){throw ur}}),ur={},Je(function(){throw 42},null,qi)}catch(e){e!==ur&&(Je=null)}else Je=null;var xx=/^\s*class\b/,Di=function(t){try{var r=ss.call(t);return xx.test(r)}catch{return!1}},Ci=function(t){try{return Di(t)?!1:(ss.call(t),!0)}catch{return!1}},lr=Object.prototype.toString,dx="[object Object]",hx="[object Function]",px="[object GeneratorFunction]",mx="[object HTMLAllCollection]",yx="[object HTML document.all class]",vx="[object HTMLCollection]",_x=typeof Symbol=="function"&&!!Symbol.toStringTag,gx=!(0 in[,]),Ii=function(){return!1};typeof document=="object"&&(as=document.all,lr.call(as)===lr.call(document.all)&&(Ii=function(t){if((gx||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=lr.call(t);return(r===mx||r===yx||r===vx||r===dx)&&t("")==null}catch{}return!1}));var as;fs.exports=Je?function(t){if(Ii(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Je(t,null,qi)}catch(r){if(r!==ur)return!1}return!Di(t)&&Ci(t)}:function(t){if(Ii(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(_x)return Ci(t);if(Di(t))return!1;var r=lr.call(t);return r!==hx&&r!==px&&!/^\[object HTML/.test(r)?!1:Ci(t)}});var xs=d((om,cs)=>{"use strict";var wx=us(),bx=Object.prototype.toString,ls=Object.prototype.hasOwnProperty,Ex=function(t,r,i){for(var n=0,o=t.length;n<o;n++)ls.call(t,n)&&(i==null?r(t[n],n,t):r.call(i,t[n],n,t))},Sx=function(t,r,i){for(var n=0,o=t.length;n<o;n++)i==null?r(t.charAt(n),n,t):r.call(i,t.charAt(n),n,t)},Ax=function(t,r,i){for(var n in t)ls.call(t,n)&&(i==null?r(t[n],n,t):r.call(i,t[n],n,t))};function Fx(e){return bx.call(e)==="[object Array]"}cs.exports=function(t,r,i){if(!wx(r))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),Fx(t)?Ex(t,r,n):typeof t=="string"?Sx(t,r,n):Ax(t,r,n)}});var hs=d((am,ds)=>{"use strict";ds.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var ms=d((sm,ps)=>{"use strict";var ki=hs(),Ox=typeof globalThis>"u"?global:globalThis;ps.exports=function(){for(var t=[],r=0;r<ki.length;r++)typeof Ox[ki[r]]=="function"&&(t[t.length]=ki[r]);return t}});var gs=d((fm,_s)=>{"use strict";var ys=yt(),Rx=bi(),Qe=He(),vs=Ge();_s.exports=function(t,r,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Qe("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Qe("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qe("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qe("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qe("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qe("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,f=!!vs&&vs(t,r);if(ys)ys(t,r,{configurable:a===null&&f?f.configurable:!a,enumerable:n===null&&f?f.enumerable:!n,value:i,writable:o===null&&f?f.writable:!o});else if(s||!n&&!o&&!a)t[r]=i;else throw new Rx("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Es=d((um,bs)=>{"use strict";var ji=yt(),ws=function(){return!!ji};ws.hasArrayLengthDefineBug=function(){if(!ji)return null;try{return ji([],"length",{value:1}).length!==1}catch{return!0}};bs.exports=ws});var Rs=d((lm,Os)=>{"use strict";var Px=Ti(),Ss=gs(),Tx=Es()(),As=Ge(),Fs=He(),Bx=Px("%Math.floor%");Os.exports=function(t,r){if(typeof t!="function")throw new Fs("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Bx(r)!==r)throw new Fs("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&As){var a=As(t,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(Tx?Ss(t,"length",r,!0,!0):Ss(t,"length",r)),t}});var Ts=d((cm,Ps)=>{"use strict";var Cx=Ye(),qx=or(),Dx=Fi();Ps.exports=function(){return Dx(Cx,qx,arguments)}});var qs=d((xm,cr)=>{"use strict";var Ix=Rs(),Bs=yt(),kx=ar(),Cs=Ts();cr.exports=function(t){var r=kx(arguments),i=t.length-(arguments.length-1);return Ix(r,1+(i>0?i:0),!0)};Bs?Bs(cr.exports,"apply",{value:Cs}):cr.exports.apply=Cs});var Is=d((dm,Ds)=>{"use strict";var jx=Ei();Ds.exports=function(){return jx()&&!!Symbol.toStringTag}});var Ls=d((hm,Us)=>{"use strict";var hr=xs(),Nx=ms(),ks=qs(),Ui=Bi(),dr=Ge(),xr=Ri(),Ux=Ui("Object.prototype.toString"),Ns=Is()(),js=typeof globalThis>"u"?global:globalThis,Ni=Nx(),Li=Ui("String.prototype.slice"),Lx=Ui("Array.prototype.indexOf",!0)||function(t,r){for(var i=0;i<t.length;i+=1)if(t[i]===r)return i;return-1},pr={__proto__:null};Ns&&dr&&xr?hr(Ni,function(e){var t=new js[e];if(Symbol.toStringTag in t&&xr){var r=xr(t),i=dr(r,Symbol.toStringTag);if(!i&&r){var n=xr(r);i=dr(n,Symbol.toStringTag)}pr["$"+e]=ks(i.get)}}):hr(Ni,function(e){var t=new js[e],r=t.slice||t.set;r&&(pr["$"+e]=ks(r))});var zx=function(t){var r=!1;return hr(pr,function(i,n){if(!r)try{"$"+i(t)===n&&(r=Li(n,1))}catch{}}),r},Mx=function(t){var r=!1;return hr(pr,function(i,n){if(!r)try{i(t),r=Li(n,1)}catch{}}),r};Us.exports=function(t){if(!t||typeof t!="object")return!1;if(!Ns){var r=Li(Ux(t),8,-1);return Lx(Ni,r)>-1?r:r!=="Object"?!1:Mx(t)}return dr?zx(t):null}});var Ms=d((pm,zs)=>{"use strict";var Wx=Ls();zs.exports=function(t){return!!Wx(t)}});var $s=d((mm,Ws)=>{"use strict";var $x=He(),Hx=Bi(),Gx=Hx("TypedArray.prototype.buffer",!0),Yx=Ms();Ws.exports=Gx||function(t){if(!Yx(t))throw new $x("Not a Typed Array");return t.buffer}});var zi=d((ym,Gs)=>{"use strict";var te=_i().Buffer,Zx=No(),Kx=$s(),Vx=ArrayBuffer.isView||function(t){try{return Kx(t),!0}catch{return!1}},Xx=typeof Uint8Array<"u",Hs=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Jx=Hs&&(te.prototype instanceof Uint8Array||te.TYPED_ARRAY_SUPPORT);Gs.exports=function(t,r){if(te.isBuffer(t))return t.constructor&&!("isBuffer"in t)?te.from(t):t;if(typeof t=="string")return te.from(t,r);if(Hs&&Vx(t)){if(t.byteLength===0)return te.alloc(0);if(Jx){var i=te.from(t.buffer,t.byteOffset,t.byteLength);if(i.byteLength===t.byteLength)return i}var n=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=te.from(n);if(o.length===t.byteLength)return o}if(Xx&&t instanceof Uint8Array)return te.from(t);var a=Zx(t);if(a)for(var s=0;s<t.length;s+=1){var f=t[s];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||te.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return te.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var Zs=d((vm,Ys)=>{var Qx=function(){try{if(!Buffer.isEncoding("latin1"))return!1;var e=Buffer.alloc?Buffer.alloc(4):new Buffer(4);return e.fill("ab","ucs2"),e.toString("hex")==="61006200"}catch{return!1}}();function ed(e){return e.length===1&&e.charCodeAt(0)<256}function mr(e,t,r,i){if(r<0||i>e.length)throw new RangeError("Out of range index");return r=r>>>0,i=i===void 0?e.length:i>>>0,i>r&&e.fill(t,r,i),e}function td(e,t,r,i){if(r<0||i>e.length)throw new RangeError("Out of range index");if(i<=r)return e;r=r>>>0,i=i===void 0?e.length:i>>>0;for(var n=r,o=t.length;n<=i-o;)t.copy(e,n),n+=o;return n!==i&&t.copy(e,n,0,i-n),e}function rd(e,t,r,i,n){if(Qx)return e.fill(t,r,i,n);if(typeof t=="number")return mr(e,t,r,i);if(typeof t=="string"){if(typeof r=="string"?(n=r,r=0,i=e.length):typeof i=="string"&&(n=i,i=e.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(n==="latin1"&&(n="binary"),typeof n=="string"&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(t==="")return mr(e,0,r,i);if(ed(t))return mr(e,t.charCodeAt(0),r,i);t=new Buffer(t,n)}return Buffer.isBuffer(t)?td(e,t,r,i):mr(e,0,r,i)}Ys.exports=rd});var Vs=d((_m,Ks)=>{function id(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative');return Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e)}Ks.exports=id});var Mi=d((gm,Js)=>{var Xs=Zs(),nd=Vs();Js.exports=function(t,r,i){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');if(Buffer.alloc)return Buffer.alloc(t,r,i);var n=nd(t);return t===0?n:r===void 0?Xs(n,0):(typeof i!="string"&&(i=void 0),Xs(n,r,i))}});var $i=d(tt=>{var od=zi(),ad=Mi(),sd="0000000000000000000",fd="7777777777777777777",Qs=48,ud="ustar\x0000",ld=parseInt("7777",8),cd=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},xd=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},dd=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},ef=function(e,t,r,i){for(;r<i;r++)if(e[r]===t)return r;return i},tf=function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var i=156;i<512;i++)t+=e[i];return t},ve=function(e,t){return e=e.toString(8),e.length>t?fd.slice(0,t)+" ":sd.slice(0,t-e.length)+e+" "};function hd(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=!1,i=[],n=e.length-1;n>0;n--){var o=e[n];t?i.push(o):r&&o===0?i.push(0):r?(r=!1,i.push(256-o)):i.push(255-o)}var a=0,s=i.length;for(n=0;n<s;n++)a+=i[n]*Math.pow(256,n);return t?a:-1*a}var _e=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return hd(e);for(;t<e.length&&e[t]===32;)t++;for(var i=cd(ef(e,32,t,e.length),e.length,e.length);t<i&&e[t]===0;)t++;return i===t?0:parseInt(e.slice(t,i).toString(),8)},et=function(e,t,r,i){return e.slice(t,ef(e,0,t,t+r)).toString(i)},Wi=function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e};tt.decodeLongPath=function(e,t){return et(e,0,e.length,t)};tt.encodePax=function(e){var t="";e.name&&(t+=Wi(" path="+e.name+`
1
+ "use strict";var pu=Object.create;var kt=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var yu=Object.getOwnPropertyNames;var vu=Object.getPrototypeOf,_u=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},gu=(e,t)=>{for(var r in t)kt(e,r,{get:t[r],enumerable:!0})},_n=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of yu(t))!_u.call(e,n)&&n!==r&&kt(e,n,{get:()=>t[n],enumerable:!(i=mu(t,n))||i.enumerable});return e};var jt=(e,t,r)=>(r=e!=null?pu(vu(e)):{},_n(t||!e||!e.__esModule?kt(r,"default",{value:e,enumerable:!0}):r,e)),wu=e=>_n(kt({},"__esModule",{value:!0}),e);var Sn=d(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.DownloaderHelper=Ie.DH_STATES=void 0;var Wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bu=(function(){function e(t,r){for(var i,n=0;n<r.length;n++)i=r[n],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}})(),Eu=require("fs"),V=Nt(Eu),De=require("url"),Su=require("path"),Fe=Nt(Su),Au=require("http"),gn=Nt(Au),Fu=require("https"),wn=Nt(Fu),Ou=require("events");function Nt(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Ru(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Pu(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var En=Ie.DH_STATES={IDLE:"IDLE",SKIPPED:"SKIPPED",STARTED:"STARTED",DOWNLOADING:"DOWNLOADING",RETRY:"RETRY",PAUSED:"PAUSED",RESUMED:"RESUMED",STOPPED:"STOPPED",FINISHED:"FINISHED",FAILED:"FAILED"},Gh=Ie.DownloaderHelper=(function(e){function t(r,i){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{};Ru(this,t);var o=bn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{captureRejections:!0}));return o.__validate(r,i)?(o.url=o.requestURL=r.trim(),o.state=En.IDLE,o.__defaultOpts={body:null,retry:!1,method:"GET",headers:{},fileName:"",timeout:-1,metadata:null,override:!1,forceResume:!1,removeOnStop:!0,removeOnFail:!0,progressThrottle:1e3,httpRequestOptions:{},httpsRequestOptions:{},resumeOnIncomplete:!0,resumeIfFileExists:!1,resumeOnIncompleteMaxRetry:5},o.__opts=Object.assign({},o.__defaultOpts),o.__pipes=[],o.__total=0,o.__downloaded=0,o.__progress=0,o.__retryCount=0,o.__retryTimeout=null,o.__resumeRetryCount=0,o.__states=En,o.__promise=null,o.__request=null,o.__response=null,o.__isAborted=!1,o.__isResumed=!1,o.__isResumable=!1,o.__isRedirected=!1,o.__destFolder=i,o.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0},o.__fileName="",o.__filePath="",o.updateOptions(n),o):bn(o)}return Pu(t,e),bu(t,[{key:"start",value:function(){var i=this,n=function(){return new Promise(function(o,a){i.__promise={resolve:o,reject:a},i.__start()})};return this.__opts.resumeIfFileExists&&this.state!==this.__states.RESUMED?this.getTotalSize().then(function(o){var a=o.name,s=o.total,f=i.__opts.override;if(i.__opts.override=!0,i.__filePath=i.__getFilePath(a),i.__opts.override=f,i.__filePath&&V.existsSync(i.__filePath)){var c=i.__getFilesizeInBytes(i.__filePath);return c===s?n():i.resumeFromFile(i.__filePath,{total:s,fileName:a})}return n()}):n()}},{key:"pause",value:function(){var i=this;return this.state===this.__states.STOPPED?Promise.resolve(!0):(this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(n){return n.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return i.__setState(i.__states.PAUSED),i.emit("pause"),!0}))}},{key:"resume",value:function(){return this.__promise?this.state===this.__states.STOPPED?Promise.resolve(!1):(this.__setState(this.__states.RESUMED),this.__isResumable&&(this.__isResumed=!0,this.__reqOptions.headers.range="bytes="+this.__downloaded+"-"),this.emit("resume",this.__isResumed),this.__start()):this.start()}},{key:"stop",value:function(){var i=this;if(this.state===this.__states.STOPPED)return Promise.resolve(!0);var n=function(){return new Promise(function(o,a){V.access(i.__filePath,function(s){return s?(i.__emitStop(),o(!0)):void V.unlink(i.__filePath,function(f){return f?(i.__setState(i.__states.FAILED),i.emit("error",f),a(f)):(i.__emitStop(),void o(!0))})})})};return this.__requestAbort(),this.__closeFileStream().then(function(){return i.__opts.removeOnStop?n():(i.__emitStop(),Promise.resolve(!0))})}},{key:"pipe",value:function(i){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:null;return this.__pipes.push({stream:i,options:n}),i}},{key:"unpipe",value:function(){var i=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null,o=function(s){return i.__response?i.__response.unpipe(s):s.unpipe()};if(n){var a=this.__pipes.find(function(s){return s.stream===n});return void(a&&(o(n),this.__pipes=this.__pipes.filter(function(s){return s.stream!==n})))}this.__pipes.forEach(function(s){return o(s.stream)}),this.__pipes=[]}},{key:"getDownloadPath",value:function(){return this.__filePath}},{key:"isResumable",value:function(){return this.__isResumable}},{key:"updateOptions",value:function(i){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"";this.__opts=Object.assign({},this.__opts,i),this.__headers=this.__opts.headers,-1<this.__opts.timeout&&(this.__opts.httpRequestOptions.timeout=this.__opts.timeout,this.__opts.httpsRequestOptions.timeout=this.__opts.timeout),(typeof this.__opts.progressThrottle!="number"||0>this.__opts.progressThrottle)&&(this.__opts.progressThrottle=this.__defaultOpts.progressThrottle),this.url=n||this.url,this.__reqOptions=this.__getReqOptions(this.__opts.method,this.url,this.__opts.headers),this.__initProtocol(this.url)}},{key:"getOptions",value:function(){return this.__opts}},{key:"getMetadata",value:function(){return this.__opts.metadata}},{key:"getStats",value:function(){return{total:this.__total,name:this.__fileName,downloaded:this.__downloaded,progress:this.__progress,speed:this.__statsEstimate.bytes}}},{key:"getTotalSize",value:function(){var i=this;return new Promise(function(n,o){var a=function(f){i.__initProtocol(f);var c=Object.assign({},i.__headers);c.hasOwnProperty("range")&&delete c.range;var l=i.__getReqOptions("HEAD",f,c);return Object.assign({},i.__reqOptions,l)},s=function(f,c){var l=i.__protocol.request(c,function(x){if(i.__isRequireRedirect(x)){var u=/^https?:\/\//.test(x.headers.location)?x.headers.location:new De.URL(x.headers.location,f).href;return i.emit("redirected",u,f),s(u,a(u))}return x.statusCode===200?void n({name:i.__getFileNameFromHeaders(x.headers,x),total:parseInt(x.headers["content-length"])||null}):o(new Error("Response status was "+x.statusCode))});l.on("error",function(x){return o(x)}),l.on("timeout",function(){return o(new Error("timeout"))}),l.on("uncaughtException",function(x){return o(x)}),l.end()};s(i.url,a(i.url))})}},{key:"getResumeState",value:function(){return{downloaded:this.__downloaded,filePath:this.__filePath,fileName:this.__fileName,total:this.__total}}},{key:"resumeFromFile",value:function(i){var n=this,o=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};return this.__opts.override=!0,this.__filePath=i,(o.total&&o.fileName?Promise.resolve({name:o.fileName,total:o.total}):this.getTotalSize()).then(function(a){var s=a.name,f=a.total;return n.__total=o.total||f,n.__fileName=o.fileName||s,n.__downloaded=o.downloaded||n.__getFilesizeInBytes(n.__filePath),n.__reqOptions.headers.range="bytes="+n.__downloaded+"-",n.__isResumed=!0,n.__isResumable=!0,n.__setState(n.__states.RESUMED),n.emit("resume",n.__isResumed),new Promise(function(c,l){n.__promise={resolve:c,reject:l},n.__start()})})}},{key:"__start",value:function(){this.__isRedirected||this.state===this.__states.RESUMED||(this.emit("start"),this.__setState(this.__states.STARTED),this.__initProtocol(this.url)),this.__response=null,this.__isAborted=!1,this.__request&&!this.__request.destroyed&&this.__request.destroy(),this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__request=this.__downloadRequest(this.__promise.resolve,this.__promise.reject),this.__request.on("error",this.__onError(this.__promise.resolve,this.__promise.reject)),this.__request.on("timeout",this.__onTimeout(this.__promise.resolve,this.__promise.reject)),this.__request.on("uncaughtException",this.__onError(this.__promise.resolve,this.__promise.reject,!0)),this.__opts.body&&this.__request.write(this.__opts.body),this.__request.end()}},{key:"__resolvePending",value:function(){if(this.__promise){var i=this.__promise.resolve;return this.__promise=null,i(!0)}}},{key:"__downloadRequest",value:function(i,n){var o=this;return this.__protocol.request(this.__reqOptions,function(a){if(o.__response=a,o.__isResumed||(o.__total=parseInt(a.headers["content-length"])||null,o.__resetStats()),o.__isRequireRedirect(a)){var s=/^https?:\/\//.test(a.headers.location)?a.headers.location:new De.URL(a.headers.location,o.url).href;return o.__isRedirected=!0,o.__initProtocol(s),o.emit("redirected",s,o.url),o.__start()}if(a.statusCode!==200&&a.statusCode!==206){var f=new Error("Response status was "+a.statusCode);return f.status=a.statusCode||0,f.body=a.body||"",o.__setState(o.__states.FAILED),o.emit("error",f),n(f)}(o.__opts.forceResume||a.headers.hasOwnProperty("accept-ranges")&&a.headers["accept-ranges"]!=="none")&&(o.__isResumable=!0),o.__startDownload(a,i,n)})}},{key:"__startDownload",value:function(i,n,o){var a=this,s=i;if(this.__isResumed)this.__fileStream=V.createWriteStream(this.__filePath,{flags:"a"});else{var f=this.__getFileNameFromHeaders(i.headers);if(this.__filePath=this.__getFilePath(f),this.__fileName=this.__filePath.split(Fe.sep).pop(),V.existsSync(this.__filePath)){var c=this.__getFilesizeInBytes(this.__filePath),l=this.__total?this.__total:0;if(Wr(this.__opts.override)==="object"&&this.__opts.override.skip&&(this.__opts.override.skipSmaller||c>=l))return this.emit("skip",{totalSize:this.__total,fileName:this.__fileName,filePath:this.__filePath,downloadedSize:c}),this.__setState(this.__states.SKIPPED),n(!0)}this.__fileStream=V.createWriteStream(this.__filePath,{})}this.emit("download",{fileName:this.__fileName,filePath:this.__filePath,totalSize:this.__total,isResumed:this.__isResumed,downloadedSize:this.__downloaded}),this.__retryCount=0,this.__isResumed=!1,this.__isRedirected=!1,this.__setState(this.__states.DOWNLOADING),this.__statsEstimate.time=new Date,this.__statsEstimate.throttleTime=new Date,s.on("data",function(x){return a.__calculateStats(x.length)}),this.__pipes.forEach(function(x){s.pipe(x.stream,x.options),s=x.stream}),s.pipe(this.__fileStream),s.on("error",this.__onError(n,o)),this.__fileStream.on("finish",this.__onFinished(n,o)),this.__fileStream.on("error",this.__onError(n,o))}},{key:"__hasFinished",value:function(){return!this.__isAborted&&[this.__states.PAUSED,this.__states.STOPPED,this.__states.RETRY,this.__states.FAILED,this.__states.RESUMED].indexOf(this.state)===-1}},{key:"__isRequireRedirect",value:function(i){return 300<i.statusCode&&400>i.statusCode&&i.headers.hasOwnProperty("location")&&i.headers.location}},{key:"__onFinished",value:function(i,n){var o=this;return function(){o.__fileStream.close(function(a){if(a)return n(a);if(o.__hasFinished()){var s=!!o.__total&&o.__downloaded!==o.__total;if(s&&o.__isResumable&&o.__opts.resumeOnIncomplete&&o.__resumeRetryCount<=o.__opts.resumeOnIncompleteMaxRetry)return o.__resumeRetryCount++,o.emit("warning",new Error("uncomplete download, retrying")),o.resume();o.__setState(o.__states.FINISHED),o.__pipes=[],o.emit("end",{fileName:o.__fileName,filePath:o.__filePath,totalSize:o.__total,incomplete:s,onDiskSize:o.__getFilesizeInBytes(o.__filePath),downloadedSize:o.__downloaded})}return i(o.__downloaded===o.__total)})}}},{key:"__closeFileStream",value:function(){var i=this;return this.__fileStream?new Promise(function(n,o){i.__fileStream.close(function(a){return a?o(a):n(!0)})}):Promise.resolve(!0)}},{key:"__onError",value:function(i,n){var o=this,a=2<arguments.length&&arguments[2]!==void 0&&arguments[2];return function(s){return o.__pipes=[],a&&o.__requestAbort(),o.state===o.__states.STOPPED||o.state===o.__states.FAILED?void 0:o.__opts.retry?o.__retry(s).catch(function(f){o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("error",f||s),n(f||s)})}):o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("error",s),n(s)})}}},{key:"__retry",value:function(){var i=this,n=0<arguments.length&&arguments[0]!==void 0?arguments[0]:null;if(!this.__opts.retry||Wr(this.__opts.retry)!=="object")return Promise.reject(n||new Error("wrong retry options"));var o=this.__opts.retry,a=o.delay,s=a===void 0?0:a,f=o.maxRetries,c=f===void 0?999:f;return this.__retryCount>=c?Promise.reject(n||new Error("reached the maximum retries")):(this.__retryCount++,this.__setState(this.__states.RETRY),this.emit("retry",this.__retryCount,this.__opts.retry,n),this.__response&&(this.__response.unpipe(),this.__pipes.forEach(function(l){return l.stream.unpipe()})),this.__fileStream&&this.__fileStream.removeAllListeners(),this.__requestAbort(),this.__closeFileStream().then(function(){return new Promise(function(l){return i.__retryTimeout=setTimeout(function(){return l(0<i.__downloaded?i.resume():i.__start())},s)})}))}},{key:"__onTimeout",value:function(i,n){var o=this;return function(){return o.__requestAbort(),o.__opts.retry?o.__retry(new Error("timeout")).catch(function(a){o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),a?n(a):(o.emit("timeout"),n(new Error("timeout")))})}):o.__removeFile().finally(function(){o.__setState(o.__states.FAILED),o.emit("timeout"),n(new Error("timeout"))})}}},{key:"__resetStats",value:function(){this.__retryCount=0,this.__downloaded=0,this.__progress=0,this.__resumeRetryCount=0,this.__statsEstimate={time:0,bytes:0,prevBytes:0,throttleTime:0}}},{key:"__getFileNameFromHeaders",value:function(i,n){var o="",a=/.*filename\*=.*?'.*?'([^"].+?[^"])(?:(?:;)|$)/i,s=/.*filename="(.*?)";?/i,f=/.*filename=([^"].+?[^"])(?:(?:;)|$)/i,c=i.hasOwnProperty("content-disposition"),l=c?i["content-disposition"].match(a):null,x=!c||l?null:i["content-disposition"].match(s),u=!c||l||x?null:i["content-disposition"].match(f);return c&&(l||x||u)?(o=i["content-disposition"],o=o.trim(),l?o=l[1]:x?o=x[1]:u&&(o=u[1]),o=o.replace(/[/\\]/g,"")):0<Fe.basename(new De.URL(this.requestURL).pathname).length?o=Fe.basename(new De.URL(this.requestURL).pathname):o=new De.URL(this.requestURL).hostname+".html",this.__opts.fileName?this.__getFileNameFromOpts(o,n):o.replace(/\.*$/,"")}},{key:"__getFilePath",value:function(i){var n=Fe.join(this.__destFolder,i),o=n;return this.__opts.override||this.state===this.__states.RESUMED||(o=this.__uniqFileNameSync(o),n!==o&&this.emit("renamed",{path:o,fileName:o.split(Fe.sep).pop(),prevPath:n,prevFileName:n.split(Fe.sep).pop()})),o}},{key:"__getFileNameFromOpts",value:function(i,n){if(!this.__opts.fileName)return i;if(typeof this.__opts.fileName=="string")return this.__opts.fileName;if(typeof this.__opts.fileName=="function"){var o=Fe.join(this.__destFolder,i);return n&&n.headers||this.__response&&this.__response.headers?this.__opts.fileName(i,o,(n||this.__response).headers["content-type"]):this.__opts.fileName(i,o)}if(Wr(this.__opts.fileName)==="object"){var a=this.__opts.fileName,s=a.name,f=!!a.hasOwnProperty("ext")&&a.ext;if(typeof f=="string")return s+"."+f;if(typeof f=="boolean"){if(f)return s;var c=i.includes(".")?i.split(".").pop():"";return c===""?s:s+"."+c}}return i}},{key:"__calculateStats",value:function(i){var n=new Date,o=n-this.__statsEstimate.time,a=n-this.__statsEstimate.throttleTime,s=this.__total||0;i&&(this.__downloaded+=i,this.__progress=s===0?0:100*(this.__downloaded/s),(this.__downloaded===s||1e3<o)&&(this.__statsEstimate.time=n,this.__statsEstimate.bytes=this.__downloaded-this.__statsEstimate.prevBytes,this.__statsEstimate.prevBytes=this.__downloaded),(this.__downloaded===s||a>this.__opts.progressThrottle)&&(this.__statsEstimate.throttleTime=n,this.emit("progress.throttled",this.getStats())),this.emit("progress",this.getStats()))}},{key:"__setState",value:function(i){this.state=i,this.emit("stateChanged",this.state)}},{key:"__getReqOptions",value:function(i,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:{},a=new De.URL(n),s={protocol:a.protocol,host:a.hostname,port:a.port,path:a.pathname+a.search,method:i};return o&&(s.headers=o),s}},{key:"__getFilesizeInBytes",value:function(i){try{var n=V.statSync(i,{throwIfNoEntry:!1}),o=n.size||0;return o}catch(a){this.emit("warning",a)}return 0}},{key:"__validate",value:function(i,n){if(typeof i!="string")throw new Error("URL should be an string");if(i.trim()==="")throw new Error("URL couldn't be empty");if(typeof n!="string")throw new Error("Destination Folder should be an string");if(n.trim()==="")throw new Error("Destination Folder couldn't be empty");if(!V.existsSync(n))throw new Error("Destination Folder must exist");var o=V.statSync(n);if(!o.isDirectory())throw new Error("Destination Folder must be a directory");try{V.accessSync(n,V.constants.W_OK)}catch{throw new Error("Destination Folder must be writable")}return!0}},{key:"__initProtocol",value:function(i){var n=this.__getReqOptions(this.__opts.method,i,this.__headers);this.requestURL=i,-1<i.indexOf("https://")?(this.__protocol=wn,n.agent=new wn.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpsRequestOptions)):(this.__protocol=gn,n.agent=new gn.Agent({keepAlive:!1}),this.__reqOptions=Object.assign({},n,this.__opts.httpRequestOptions))}},{key:"__uniqFileNameSync",value:function(i){if(typeof i!="string"||i==="")return i;try{V.accessSync(i,V.F_OK);var n=i.match(/(.*)(\([0-9]+\))(\..*)$/),o=n?n[1].trim():i,a=n?parseInt(n[2].replace(/\(|\)/,"")):0,s=i.split(".").pop();return s!==i&&0<s.length?(s="."+s,o=o.replace(s,"")):s="",this.__uniqFileNameSync(o+" ("+ ++a+")"+s)}catch{return i}}},{key:"__removeFile",value:function(){var i=this;return new Promise(function(n){return i.__fileStream?void i.__fileStream.close(function(o){return o&&i.emit("warning",o),i.__opts.removeOnFail?V.access(i.__filePath,function(a){return a?n():void V.unlink(i.__filePath,function(s){s&&i.emit("warning",o),n()})}):void n()}):n()})}},{key:"__requestAbort",value:function(){this.__isAborted=!0,this.__retryTimeout&&(clearTimeout(this.__retryTimeout),this.__retryTimeout=null),this.__response&&this.__response.destroy(),this.__request&&(this.__request.destroy?this.__request.destroy():this.__request.abort())}},{key:"__emitStop",value:function(){this.__resolvePending(),this.__setState(this.__states.STOPPED),this.emit("stop")}}]),t})(Ou.EventEmitter)});var Fn=d((Zh,An)=>{var ye=require("constants"),Tu=process.cwd,Ut=null,Bu=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ut||(Ut=Tu.call(process)),Ut};try{process.cwd()}catch{}typeof process.chdir=="function"&&($r=process.chdir,process.chdir=function(e){Ut=null,$r.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,$r));var $r;An.exports=Cu;function Cu(e){ye.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||r(e),e.chown=o(e.chown),e.fchown=o(e.fchown),e.lchown=o(e.lchown),e.chmod=i(e.chmod),e.fchmod=i(e.fchmod),e.lchmod=i(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=f(e.statSync),e.fstatSync=f(e.fstatSync),e.lstatSync=f(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(l,x,u){u&&process.nextTick(u)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(l,x,u,h){h&&process.nextTick(h)},e.lchownSync=function(){}),Bu==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(l){function x(u,h,m){var y=Date.now(),p=0;l(u,h,function _(g){if(g&&(g.code==="EACCES"||g.code==="EPERM"||g.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){e.stat(h,function(E,N){E&&E.code==="ENOENT"?l(u,h,_):m(g)})},p),p<100&&(p+=10);return}m&&m(g)})}return Object.setPrototypeOf&&Object.setPrototypeOf(x,l),x})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(l){function x(u,h,m,y,p,_){var g;if(_&&typeof _=="function"){var E=0;g=function(N,R,J){if(N&&N.code==="EAGAIN"&&E<10)return E++,l.call(e,u,h,m,y,p,g);_.apply(this,arguments)}}return l.call(e,u,h,m,y,p,g)}return Object.setPrototypeOf&&Object.setPrototypeOf(x,l),x})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(l){return function(x,u,h,m,y){for(var p=0;;)try{return l.call(e,x,u,h,m,y)}catch(_){if(_.code==="EAGAIN"&&p<10){p++;continue}throw _}}})(e.readSync);function t(l){l.lchmod=function(x,u,h){l.open(x,ye.O_WRONLY|ye.O_SYMLINK,u,function(m,y){if(m){h&&h(m);return}l.fchmod(y,u,function(p){l.close(y,function(_){h&&h(p||_)})})})},l.lchmodSync=function(x,u){var h=l.openSync(x,ye.O_WRONLY|ye.O_SYMLINK,u),m=!0,y;try{y=l.fchmodSync(h,u),m=!1}finally{if(m)try{l.closeSync(h)}catch{}else l.closeSync(h)}return y}}function r(l){ye.hasOwnProperty("O_SYMLINK")&&l.futimes?(l.lutimes=function(x,u,h,m){l.open(x,ye.O_SYMLINK,function(y,p){if(y){m&&m(y);return}l.futimes(p,u,h,function(_){l.close(p,function(g){m&&m(_||g)})})})},l.lutimesSync=function(x,u,h){var m=l.openSync(x,ye.O_SYMLINK),y,p=!0;try{y=l.futimesSync(m,u,h),p=!1}finally{if(p)try{l.closeSync(m)}catch{}else l.closeSync(m)}return y}):l.futimes&&(l.lutimes=function(x,u,h,m){m&&process.nextTick(m)},l.lutimesSync=function(){})}function i(l){return l&&function(x,u,h){return l.call(e,x,u,function(m){c(m)&&(m=null),h&&h.apply(this,arguments)})}}function n(l){return l&&function(x,u){try{return l.call(e,x,u)}catch(h){if(!c(h))throw h}}}function o(l){return l&&function(x,u,h,m){return l.call(e,x,u,h,function(y){c(y)&&(y=null),m&&m.apply(this,arguments)})}}function a(l){return l&&function(x,u,h){try{return l.call(e,x,u,h)}catch(m){if(!c(m))throw m}}}function s(l){return l&&function(x,u,h){typeof u=="function"&&(h=u,u=null);function m(y,p){p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),h&&h.apply(this,arguments)}return u?l.call(e,x,u,m):l.call(e,x,m)}}function f(l){return l&&function(x,u){var h=u?l.call(e,x,u):l.call(e,x);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}function c(l){if(!l||l.code==="ENOSYS")return!0;var x=!process.getuid||process.getuid()!==0;return!!(x&&(l.code==="EINVAL"||l.code==="EPERM"))}}});var Pn=d((Kh,Rn)=>{var On=require("stream").Stream;Rn.exports=qu;function qu(e){return{ReadStream:t,WriteStream:r};function t(i,n){if(!(this instanceof t))return new t(i,n);On.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var a=Object.keys(n),s=0,f=a.length;s<f;s++){var c=a[s];this[c]=n[c]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}e.open(this.path,this.flags,this.mode,function(l,x){if(l){o.emit("error",l),o.readable=!1;return}o.fd=x,o.emit("open",x),o._read()})}function r(i,n){if(!(this instanceof r))return new r(i,n);On.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),a=0,s=o.length;a<s;a++){var f=o[a];this[f]=n[f]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var Bn=d((Vh,Tn)=>{"use strict";Tn.exports=Iu;var Du=Object.getPrototypeOf||function(e){return e.__proto__};function Iu(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Du(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r))}),t}});var In=d((Xh,Yr)=>{var U=require("fs"),ku=Fn(),ju=Pn(),Nu=Bn(),Lt=require("util"),H,Mt;typeof Symbol=="function"&&typeof Symbol.for=="function"?(H=Symbol.for("graceful-fs.queue"),Mt=Symbol.for("graceful-fs.previous")):(H="___graceful-fs.queue",Mt="___graceful-fs.previous");function Uu(){}function Dn(e,t){Object.defineProperty(e,H,{get:function(){return t}})}var Oe=Uu;Lt.debuglog?Oe=Lt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Oe=function(){var e=Lt.format.apply(Lt,arguments);e="GFS4: "+e.split(/\n/).join(`
2
+ GFS4: `),console.error(e)});U[H]||(Cn=global[H]||[],Dn(U,Cn),U.close=(function(e){function t(r,i){return e.call(U,r,function(n){n||qn(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(t,Mt,{value:e}),t})(U.close),U.closeSync=(function(e){function t(r){e.apply(U,arguments),qn()}return Object.defineProperty(t,Mt,{value:e}),t})(U.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Oe(U[H]),require("assert").equal(U[H].length,0)}));var Cn;global[H]||Dn(global,U[H]);Yr.exports=Hr(Nu(U));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!U.__patched&&(Yr.exports=Hr(U),U.__patched=!0);function Hr(e){ku(e),e.gracefulify=Hr,e.createReadStream=R,e.createWriteStream=J;var t=e.readFile;e.readFile=r;function r(v,w,b){return typeof w=="function"&&(b=w,w=null),C(v,w,b);function C(q,B,A,F){return t(q,B,function(O){O&&(O.code==="EMFILE"||O.code==="ENFILE")?ke([C,[q,B,A],O,F||Date.now(),Date.now()]):typeof A=="function"&&A.apply(this,arguments)})}}var i=e.writeFile;e.writeFile=n;function n(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return i(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var o=e.appendFile;o&&(e.appendFile=a);function a(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return o(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=f);function f(v,w,b,C){return typeof b=="function"&&(C=b,b=0),q(v,w,b,C);function q(B,A,F,O,M){return s(B,A,F,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}var c=e.readdir;e.readdir=x;var l=/^v[0-5]\./;function x(v,w,b){typeof w=="function"&&(b=w,w=null);var C=l.test(process.version)?function(A,F,O,M){return c(A,q(A,F,O,M))}:function(A,F,O,M){return c(A,F,q(A,F,O,M))};return C(v,w,b);function q(B,A,F,O){return function(M,T){M&&(M.code==="EMFILE"||M.code==="ENFILE")?ke([C,[B,A,F],M,O||Date.now(),Date.now()]):(T&&T.sort&&T.sort(),typeof F=="function"&&F.call(this,M,T))}}}if(process.version.substr(0,4)==="v0.8"){var u=ju(e);_=u.ReadStream,E=u.WriteStream}var h=e.ReadStream;h&&(_.prototype=Object.create(h.prototype),_.prototype.open=g);var m=e.WriteStream;m&&(E.prototype=Object.create(m.prototype),E.prototype.open=N),Object.defineProperty(e,"ReadStream",{get:function(){return _},set:function(v){_=v},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return E},set:function(v){E=v},enumerable:!0,configurable:!0});var y=_;Object.defineProperty(e,"FileReadStream",{get:function(){return y},set:function(v){y=v},enumerable:!0,configurable:!0});var p=E;Object.defineProperty(e,"FileWriteStream",{get:function(){return p},set:function(v){p=v},enumerable:!0,configurable:!0});function _(v,w){return this instanceof _?(h.apply(this,arguments),this):_.apply(Object.create(_.prototype),arguments)}function g(){var v=this;z(v.path,v.flags,v.mode,function(w,b){w?(v.autoClose&&v.destroy(),v.emit("error",w)):(v.fd=b,v.emit("open",b),v.read())})}function E(v,w){return this instanceof E?(m.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function N(){var v=this;z(v.path,v.flags,v.mode,function(w,b){w?(v.destroy(),v.emit("error",w)):(v.fd=b,v.emit("open",b))})}function R(v,w){return new e.ReadStream(v,w)}function J(v,w){return new e.WriteStream(v,w)}var j=e.open;e.open=z;function z(v,w,b,C){return typeof b=="function"&&(C=b,b=null),q(v,w,b,C);function q(B,A,F,O,M){return j(B,A,F,function(T,D){T&&(T.code==="EMFILE"||T.code==="ENFILE")?ke([q,[B,A,F,O],T,M||Date.now(),Date.now()]):typeof O=="function"&&O.apply(this,arguments)})}}return e}function ke(e){Oe("ENQUEUE",e[0].name,e[1]),U[H].push(e),Gr()}var zt;function qn(){for(var e=Date.now(),t=0;t<U[H].length;++t)U[H][t].length>2&&(U[H][t][3]=e,U[H][t][4]=e);Gr()}function Gr(){if(clearTimeout(zt),zt=void 0,U[H].length!==0){var e=U[H].shift(),t=e[0],r=e[1],i=e[2],n=e[3],o=e[4];if(n===void 0)Oe("RETRY",t.name,r),t.apply(null,r);else if(Date.now()-n>=6e4){Oe("TIMEOUT",t.name,r);var a=r.pop();typeof a=="function"&&a.call(null,i)}else{var s=Date.now()-o,f=Math.max(o-n,1),c=Math.min(f*1.2,100);s>=c?(Oe("RETRY",t.name,r),t.apply(null,r.concat([n]))):U[H].push(e)}zt===void 0&&(zt=setTimeout(Gr,0))}}});var Zr=d((Jh,kn)=>{"use strict";kn.exports=e=>{let t=new Uint8Array(e);if(!(t&&t.length>1))return null;let r=(i,n)=>{n=Object.assign({offset:0},n);for(let o=0;o<i.length;o++)if(i[o]!==t[o+n.offset])return!1;return!0};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(r([80,75,3,4])&&r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r([80,75,3,4])&&r([77,69,84,65,45,73,78,70,47,109,111,122,105,108,108,97,46,114,115,97],{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(r([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8))return{ext:"zip",mime:"application/zip"};if(r([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(t[6]===0||t[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([0,0,0])&&(t[3]===24||t[3]===32)&&r([102,116,121,112],{offset:4})||r([51,103,112,53])||r([0,0,0,28,102,116,121,112,109,112,52,50])&&r([109,112,52,49,109,112,52,50,105,115,111,109],{offset:16})||r([0,0,0,28,102,116,121,112,105,115,111,109])||r([0,0,0,28,102,116,121,112,109,112,52,50,0,0,0,0]))return{ext:"mp4",mime:"video/mp4"};if(r([0,0,0,28,102,116,121,112,77,52,86]))return{ext:"m4v",mime:"video/x-m4v"};if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){let i=t.subarray(4,4100),n=i.findIndex((o,a,s)=>s[a]===66&&s[a+1]===130);if(n>=0){let o=n+3,a=s=>Array.from(s).every((f,c)=>i[o+c]===f.charCodeAt(0));if(a("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(a("webm"))return{ext:"webm",mime:"video/webm"}}}return r([0,0,0,20,102,116,121,112,113,116,32,32])||r([102,114,101,101],{offset:4})||r([102,116,121,112,113,116,32,32],{offset:4})||r([109,100,97,116],{offset:4})||r([119,105,100,101],{offset:4})?{ext:"mov",mime:"video/quicktime"}:r([82,73,70,70])&&r([65,86,73],{offset:8})?{ext:"avi",mime:"video/x-msvideo"}:r([48,38,178,117,142,102,207,17,166,217])?{ext:"wmv",mime:"video/x-ms-wmv"}:r([0,0,1,186])?{ext:"mpg",mime:"video/mpeg"}:r([73,68,51])||r([255,251])?{ext:"mp3",mime:"audio/mpeg"}:r([102,116,121,112,77,52,65],{offset:4})||r([77,52,65,32])?{ext:"m4a",mime:"audio/m4a"}:r([79,112,117,115,72,101,97,100],{offset:28})?{ext:"opus",mime:"audio/opus"}:r([79,103,103,83])?{ext:"ogg",mime:"audio/ogg"}:r([102,76,97,67])?{ext:"flac",mime:"audio/x-flac"}:r([82,73,70,70])&&r([87,65,86,69],{offset:8})?{ext:"wav",mime:"audio/x-wav"}:r([35,33,65,77,82,10])?{ext:"amr",mime:"audio/amr"}:r([37,80,68,70])?{ext:"pdf",mime:"application/pdf"}:r([77,90])?{ext:"exe",mime:"application/x-msdownload"}:(t[0]===67||t[0]===70)&&r([87,83],{offset:1})?{ext:"swf",mime:"application/x-shockwave-flash"}:r([123,92,114,116,102])?{ext:"rtf",mime:"application/rtf"}:r([0,97,115,109])?{ext:"wasm",mime:"application/wasm"}:r([119,79,70,70])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff",mime:"font/woff"}:r([119,79,70,50])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff2",mime:"font/woff2"}:r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8}))?{ext:"eot",mime:"application/octet-stream"}:r([0,1,0,0,0])?{ext:"ttf",mime:"font/ttf"}:r([79,84,84,79,0])?{ext:"otf",mime:"font/otf"}:r([0,0,1,0])?{ext:"ico",mime:"image/x-icon"}:r([70,76,86,1])?{ext:"flv",mime:"video/x-flv"}:r([37,33])?{ext:"ps",mime:"application/postscript"}:r([253,55,122,88,90,0])?{ext:"xz",mime:"application/x-xz"}:r([83,81,76,105])?{ext:"sqlite",mime:"application/x-sqlite3"}:r([78,69,83,26])?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:r([67,114,50,52])?{ext:"crx",mime:"application/x-google-chrome-extension"}:r([77,83,67,70])||r([73,83,99,40])?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:r([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])?{ext:"deb",mime:"application/x-deb"}:r([33,60,97,114,99,104,62])?{ext:"ar",mime:"application/x-unix-archive"}:r([237,171,238,219])?{ext:"rpm",mime:"application/x-rpm"}:r([31,160])||r([31,157])?{ext:"Z",mime:"application/x-compress"}:r([76,90,73,80])?{ext:"lz",mime:"application/x-lzip"}:r([208,207,17,224,161,177,26,225])?{ext:"msi",mime:"application/x-msi"}:r([6,14,43,52,2,5,1,1,13,1,2,1,1,2])?{ext:"mxf",mime:"application/mxf"}:r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196}))?{ext:"mts",mime:"video/mp2t"}:r([66,76,69,78,68,69,82])?{ext:"blend",mime:"application/x-blender"}:r([66,80,71,251])?{ext:"bpg",mime:"image/bpg"}:null}});var Wt=d((Qh,jn)=>{"use strict";var ue=jn.exports=function(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"};ue.writable=function(e){return ue(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"};ue.readable=function(e){return ue(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object"};ue.duplex=function(e){return ue.writable(e)&&ue.readable(e)};ue.transform=function(e){return ue.duplex(e)&&typeof e._transform=="function"&&typeof e._transformState=="object"}});var ft=d((ep,Kr)=>{"use strict";typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Kr.exports={nextTick:Lu}:Kr.exports=process;function Lu(e,t,r,i){if(typeof e!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,o,a;switch(n){case 0:case 1:return process.nextTick(e);case 2:return process.nextTick(function(){e.call(null,t)});case 3:return process.nextTick(function(){e.call(null,t,r)});case 4:return process.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(n-1),a=0;a<o.length;)o[a++]=arguments[a];return process.nextTick(function(){e.apply(null,o)})}}});var Un=d((tp,Nn)=>{var zu={}.toString;Nn.exports=Array.isArray||function(e){return zu.call(e)=="[object Array]"}});var Vr=d((rp,Ln)=>{Ln.exports=require("stream")});var ut=d((Xr,Mn)=>{var $t=require("buffer"),le=$t.Buffer;function zn(e,t){for(var r in e)t[r]=e[r]}le.from&&le.alloc&&le.allocUnsafe&&le.allocUnsafeSlow?Mn.exports=$t:(zn($t,Xr),Xr.Buffer=je);function je(e,t,r){return le(e,t,r)}zn(le,je);je.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return le(e,t,r)};je.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=le(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};je.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return le(e)};je.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return $t.SlowBuffer(e)}});var Ne=d(K=>{function Mu(e){return Array.isArray?Array.isArray(e):Ht(e)==="[object Array]"}K.isArray=Mu;function Wu(e){return typeof e=="boolean"}K.isBoolean=Wu;function $u(e){return e===null}K.isNull=$u;function Hu(e){return e==null}K.isNullOrUndefined=Hu;function Gu(e){return typeof e=="number"}K.isNumber=Gu;function Yu(e){return typeof e=="string"}K.isString=Yu;function Zu(e){return typeof e=="symbol"}K.isSymbol=Zu;function Ku(e){return e===void 0}K.isUndefined=Ku;function Vu(e){return Ht(e)==="[object RegExp]"}K.isRegExp=Vu;function Xu(e){return typeof e=="object"&&e!==null}K.isObject=Xu;function Ju(e){return Ht(e)==="[object Date]"}K.isDate=Ju;function Qu(e){return Ht(e)==="[object Error]"||e instanceof Error}K.isError=Qu;function el(e){return typeof e=="function"}K.isFunction=el;function tl(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}K.isPrimitive=tl;K.isBuffer=require("buffer").Buffer.isBuffer;function Ht(e){return Object.prototype.toString.call(e)}});var Wn=d((np,Jr)=>{typeof Object.create=="function"?Jr.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Jr.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}});var Ue=d((op,ei)=>{try{if(Qr=require("util"),typeof Qr.inherits!="function")throw"";ei.exports=Qr.inherits}catch{ei.exports=Wn()}var Qr});var Hn=d((ap,ti)=>{"use strict";function rl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var $n=ut().Buffer,lt=require("util");function il(e,t,r){e.copy(t,r)}ti.exports=(function(){function e(){rl(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},e.prototype.unshift=function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},e.prototype.shift=function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},e.prototype.concat=function(r){if(this.length===0)return $n.alloc(0);for(var i=$n.allocUnsafe(r>>>0),n=this.head,o=0;n;)il(n.data,i,o),o+=n.data.length,n=n.next;return i},e})();lt&&lt.inspect&&lt.inspect.custom&&(ti.exports.prototype[lt.inspect.custom]=function(){var e=lt.inspect({length:this.length});return this.constructor.name+" "+e})});var ri=d((sp,Gn)=>{"use strict";var Gt=ft();function nl(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Gt.nextTick(Yt,this,e)):Gt.nextTick(Yt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(o){!t&&o?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,Gt.nextTick(Yt,r,o)):Gt.nextTick(Yt,r,o):t&&t(o)}),this)}function ol(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Yt(e,t){e.emit("error",t)}Gn.exports={destroy:nl,undestroy:ol}});var Zn=d((fp,Yn)=>{Yn.exports=require("util").deprecate});var ni=d((up,ro)=>{"use strict";var Re=ft();ro.exports=W;function Vn(e){var t=this;this.next=null,this.entry=null,this.finish=function(){El(t,e)}}var al=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:Re.nextTick,Le;W.WritableState=xt;var Xn=Object.create(Ne());Xn.inherits=Ue();var sl={deprecate:Zn()},Jn=Vr(),Kt=ut().Buffer,fl=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ul(e){return Kt.from(e)}function ll(e){return Kt.isBuffer(e)||e instanceof fl}var Qn=ri();Xn.inherits(W,Jn);function cl(){}function xt(e,t){Le=Le||Pe(),e=e||{};var r=t instanceof Le;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=e.decodeStrings===!1;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){vl(t,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new Vn(this)}xt.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(xt.prototype,"buffer",{get:sl.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Zt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Zt=Function.prototype[Symbol.hasInstance],Object.defineProperty(W,Symbol.hasInstance,{value:function(e){return Zt.call(this,e)?!0:this!==W?!1:e&&e._writableState instanceof xt}})):Zt=function(e){return e instanceof this};function W(e){if(Le=Le||Pe(),!Zt.call(W,this)&&!(this instanceof Le))return new W(e);this._writableState=new xt(e,this),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),Jn.call(this)}W.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function xl(e,t){var r=new Error("write after end");e.emit("error",r),Re.nextTick(t,r)}function dl(e,t,r,i){var n=!0,o=!1;return r===null?o=new TypeError("May not write null values to stream"):typeof r!="string"&&r!==void 0&&!t.objectMode&&(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),Re.nextTick(i,o),n=!1),n}W.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&ll(e);return o&&!Kt.isBuffer(e)&&(e=ul(e)),typeof t=="function"&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),typeof r!="function"&&(r=cl),i.ended?xl(this,r):(o||dl(this,i,e,r))&&(i.pendingcb++,n=pl(this,i,o,e,t,r)),n};W.prototype.cork=function(){var e=this._writableState;e.corked++};W.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&eo(this,e))};W.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this};function hl(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=Kt.from(t,r)),t}Object.defineProperty(W.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pl(e,t,r,i,n,o){if(!r){var a=hl(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else ii(e,t,!1,s,i,n,o);return f}function ii(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function ml(e,t,r,i,n){--t.pendingcb,r?(Re.nextTick(n,i),Re.nextTick(ct,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),ct(e,t))}function yl(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function vl(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(yl(r),t)ml(e,r,i,t,n);else{var o=to(r);!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&eo(e,r),i?al(Kn,e,r,o,n):Kn(e,r,o,n)}}function Kn(e,t,r,i){r||_l(e,t),t.pendingcb--,i(),ct(e,t)}function _l(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function eo(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,ii(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new Vn(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback,x=t.objectMode?1:f.length;if(ii(e,t,!1,x,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}W.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};W.prototype._writev=null;W.prototype.end=function(e,t,r){var i=this._writableState;typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||bl(this,i,r)};function to(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function gl(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),ct(e,t)})}function wl(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"?(t.pendingcb++,t.finalCalled=!0,Re.nextTick(gl,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function ct(e,t){var r=to(t);return r&&(wl(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"))),r}function bl(e,t,r){t.ending=!0,ct(e,t),r&&(t.finished?Re.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function El(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}Object.defineProperty(W.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});W.prototype.destroy=Qn.destroy;W.prototype._undestroy=Qn.undestroy;W.prototype._destroy=function(e,t){this.end(),t(e)}});var Pe=d((lp,ao)=>{"use strict";var io=ft(),Sl=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};ao.exports=ce;var no=Object.create(Ne());no.inherits=Ue();var oo=si(),ai=ni();no.inherits(ce,oo);for(oi=Sl(ai.prototype),Vt=0;Vt<oi.length;Vt++)Xt=oi[Vt],ce.prototype[Xt]||(ce.prototype[Xt]=ai.prototype[Xt]);var oi,Xt,Vt;function ce(e){if(!(this instanceof ce))return new ce(e);oo.call(this,e),ai.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",Al)}Object.defineProperty(ce.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Al(){this.allowHalfOpen||this._writableState.ended||io.nextTick(Fl,this)}function Fl(e){e.end()}Object.defineProperty(ce.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}});ce.prototype._destroy=function(e,t){this.push(null),this.end(),io.nextTick(t,e)}});var li=d(fo=>{"use strict";var ui=ut().Buffer,so=ui.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ol(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function Rl(e){var t=Ol(e);if(typeof t!="string"&&(ui.isEncoding===so||!so(e)))throw new Error("Unknown encoding: "+e);return t||e}fo.StringDecoder=dt;function dt(e){this.encoding=Rl(e);var t;switch(this.encoding){case"utf16le":this.text=Dl,this.end=Il,t=4;break;case"utf8":this.fillLast=Bl,t=4;break;case"base64":this.text=kl,this.end=jl,t=3;break;default:this.write=Nl,this.end=Ul;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ui.allocUnsafe(t)}dt.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};dt.prototype.end=ql;dt.prototype.text=Cl;dt.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function fi(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function Pl(e,t,r){var i=t.length-1;if(i<r)return 0;var n=fi(t[i]);return n>=0?(n>0&&(e.lastNeed=n-1),n):--i<r||n===-2?0:(n=fi(t[i]),n>=0?(n>0&&(e.lastNeed=n-2),n):--i<r||n===-2?0:(n=fi(t[i]),n>=0?(n>0&&(n===2?n=0:e.lastNeed=n-3),n):0))}function Tl(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function Bl(e){var t=this.lastTotal-this.lastNeed,r=Tl(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function Cl(e,t){var r=Pl(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)}function ql(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function Dl(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Il(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function kl(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function jl(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Nl(e){return e.toString(this.encoding)}function Ul(e){return e&&e.length?this.write(e):""}});var si=d((dp,wo)=>{"use strict";var Me=ft();wo.exports=I;var Ll=Un(),ht;I.ReadableState=mo;var xp=require("events").EventEmitter,xo=function(e,t){return e.listeners(t).length},pi=Vr(),pt=ut().Buffer,zl=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Ml(e){return pt.from(e)}function Wl(e){return pt.isBuffer(e)||e instanceof zl}var ho=Object.create(Ne());ho.inherits=Ue();var ci=require("util"),P=void 0;ci&&ci.debuglog?P=ci.debuglog("stream"):P=function(){};var $l=Hn(),po=ri(),ze;ho.inherits(I,pi);var xi=["error","close","destroy","pause","resume"];function Hl(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Ll(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function mo(e,t){ht=ht||Pe(),e=e||{};var r=t instanceof ht;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,n=e.readableHighWaterMark,o=this.objectMode?16:16*1024;i||i===0?this.highWaterMark=i:r&&(n||n===0)?this.highWaterMark=n:this.highWaterMark=o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new $l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(ze||(ze=li().StringDecoder),this.decoder=new ze(e.encoding),this.encoding=e.encoding)}function I(e){if(ht=ht||Pe(),!(this instanceof I))return new I(e);this._readableState=new mo(e,this),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),pi.call(this)}Object.defineProperty(I.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});I.prototype.destroy=po.destroy;I.prototype._undestroy=po.undestroy;I.prototype._destroy=function(e,t){this.push(null),t(e)};I.prototype.push=function(e,t){var r=this._readableState,i;return r.objectMode?i=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=pt.from(e,t),t=""),i=!0),yo(this,e,t,!1,i)};I.prototype.unshift=function(e){return yo(this,e,null,!0,!1)};function yo(e,t,r,i,n){var o=e._readableState;if(t===null)o.reading=!1,Kl(e,o);else{var a;n||(a=Gl(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?(typeof t!="string"&&!o.objectMode&&Object.getPrototypeOf(t)!==pt.prototype&&(t=Ml(t)),i?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):di(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||t.length!==0?di(e,o,t,!1):vo(e,o)):di(e,o,t,!1))):i||(o.reading=!1)}return Yl(o)}function di(e,t,r,i){t.flowing&&t.length===0&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Jt(e)),vo(e,t)}function Gl(e,t){var r;return!Wl(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new TypeError("Invalid non-string/buffer chunk")),r}function Yl(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}I.prototype.isPaused=function(){return this._readableState.flowing===!1};I.prototype.setEncoding=function(e){return ze||(ze=li().StringDecoder),this._readableState.decoder=new ze(e),this._readableState.encoding=e,this};var uo=8388608;function Zl(e){return e>=uo?e=uo:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function lo(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Zl(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}I.prototype.read=function(e){P("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return P("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?hi(this):Jt(this),null;if(e=lo(e,t),e===0&&t.ended)return t.length===0&&hi(this),null;var i=t.needReadable;P("need readable",i),(t.length===0||t.length-e<t.highWaterMark)&&(i=!0,P("length less than watermark",i)),t.ended||t.reading?(i=!1,P("reading or ended",i)):i&&(P("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=lo(r,t)));var n;return e>0?n=_o(e,t):n=null,n===null?(t.needReadable=!0,e=0):t.length-=e,t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&hi(this)),n!==null&&this.emit("data",n),n};function Kl(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,Jt(e)}}function Jt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?Me.nextTick(co,e):co(e))}function co(e){P("emit readable"),e.emit("readable"),mi(e)}function vo(e,t){t.readingMore||(t.readingMore=!0,Me.nextTick(Vl,e,t))}function Vl(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(P("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}I.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};I.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e);break}i.pipesCount+=1,P("pipe count=%d opts=%j",i.pipesCount,t);var n=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,o=n?s:p;i.endEmitted?Me.nextTick(o):r.once("end",o),e.on("unpipe",a);function a(_,g){P("onunpipe"),_===r&&g&&g.hasUnpiped===!1&&(g.hasUnpiped=!0,l())}function s(){P("onend"),e.end()}var f=Xl(r);e.on("drain",f);var c=!1;function l(){P("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",p),r.removeListener("data",u),c=!0,i.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}var x=!1;r.on("data",u);function u(_){P("ondata"),x=!1;var g=e.write(_);g===!1&&!x&&((i.pipesCount===1&&i.pipes===e||i.pipesCount>1&&go(i.pipes,e)!==-1)&&!c&&(P("false write response, pause",i.awaitDrain),i.awaitDrain++,x=!0),r.pause())}function h(_){P("onerror",_),p(),e.removeListener("error",h),xo(e,"error")===0&&e.emit("error",_)}Hl(e,"error",h);function m(){e.removeListener("finish",y),p()}e.once("close",m);function y(){P("onfinish"),e.removeListener("close",m),p()}e.once("finish",y);function p(){P("unpipe"),r.unpipe(e)}return e.emit("pipe",r),i.flowing||(P("pipe resume"),r.resume()),e};function Xl(e){return function(){var t=e._readableState;P("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&xo(e,"data")&&(t.flowing=!0,mi(e))}}I.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=go(t.pipes,e);return a===-1?this:(t.pipes.splice(a,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};I.prototype.on=function(e,t){var r=pi.prototype.on.call(this,e,t);if(e==="data")this._readableState.flowing!==!1&&this.resume();else if(e==="readable"){var i=this._readableState;!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&Jt(this):Me.nextTick(Jl,this))}return r};I.prototype.addListener=I.prototype.on;function Jl(e){P("readable nexttick read 0"),e.read(0)}I.prototype.resume=function(){var e=this._readableState;return e.flowing||(P("resume"),e.flowing=!0,Ql(this,e)),this};function Ql(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick(ec,e,t))}function ec(e,t){t.reading||(P("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),mi(e),t.flowing&&!t.reading&&e.read(0)}I.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function mi(e){var t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}I.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;e.on("end",function(){if(P("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&t.push(a)}t.push(null)}),e.on("data",function(a){if(P("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=t.push(a);s||(i=!0,e.pause())}});for(var n in e)this[n]===void 0&&typeof e[n]=="function"&&(this[n]=(function(a){return function(){return e[a].apply(e,arguments)}})(n));for(var o=0;o<xi.length;o++)e.on(xi[o],this.emit.bind(this,xi[o]));return this._read=function(a){P("wrapped _read",a),i&&(i=!1,e.resume())},this};Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});I._fromList=_o;function _o(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.head.data:r=t.buffer.concat(t.length),t.buffer.clear()):r=tc(e,t.buffer,t.decoder),r}function tc(e,t,r){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):e===t.head.data.length?i=t.shift():i=r?rc(e,t):ic(e,t),i}function rc(e,t){var r=t.head,i=1,n=r.data;for(e-=n.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(a===o.length?n+=o:n+=o.slice(0,e),e-=a,e===0){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}function ic(e,t){var r=pt.allocUnsafe(e),i=t.head,n=1;for(i.data.copy(r),e-=i.data.length;i=i.next;){var o=i.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),e-=a,e===0){a===o.length?(++n,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=o.slice(a));break}++n}return t.length-=n,r}function hi(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,Me.nextTick(nc,t,e))}function nc(e,t){!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function go(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}});var yi=d((hp,So)=>{"use strict";So.exports=xe;var Qt=Pe(),Eo=Object.create(Ne());Eo.inherits=Ue();Eo.inherits(xe,Qt);function oc(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,t!=null&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function xe(e){if(!(this instanceof xe))return new xe(e);Qt.call(this,e),this._transformState={afterTransform:oc.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",ac)}function ac(){var e=this;typeof this._flush=="function"?this._flush(function(t,r){bo(e,t,r)}):bo(this,null,null)}xe.prototype.push=function(e,t){return this._transformState.needTransform=!1,Qt.prototype.push.call(this,e,t)};xe.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};xe.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};xe.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};xe.prototype._destroy=function(e,t){var r=this;Qt.prototype._destroy.call(this,e,function(i){t(i),r.emit("close")})};function bo(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Ro=d((pp,Oo)=>{"use strict";Oo.exports=mt;var Ao=yi(),Fo=Object.create(Ne());Fo.inherits=Ue();Fo.inherits(mt,Ao);function mt(e){if(!(this instanceof mt))return new mt(e);Ao.call(this,e)}mt.prototype._transform=function(e,t,r){r(null,e)}});var We=d((G,er)=>{var ie=require("stream");process.env.READABLE_STREAM==="disable"&&ie?(er.exports=ie,G=er.exports=ie.Readable,G.Readable=ie.Readable,G.Writable=ie.Writable,G.Duplex=ie.Duplex,G.Transform=ie.Transform,G.PassThrough=ie.PassThrough,G.Stream=ie):(G=er.exports=si(),G.Stream=ie||G,G.Readable=G,G.Writable=ni(),G.Duplex=Pe(),G.Transform=yi(),G.PassThrough=Ro())});var To=d((mp,Po)=>{Po.exports=We().Duplex});var _i=d((vi,Co)=>{var tr=require("buffer"),ne=tr.Buffer;function Bo(e,t){for(var r in e)t[r]=e[r]}ne.from&&ne.alloc&&ne.allocUnsafe&&ne.allocUnsafeSlow?Co.exports=tr:(Bo(tr,vi),vi.Buffer=Te);function Te(e,t,r){return ne(e,t,r)}Te.prototype=Object.create(ne.prototype);Bo(ne,Te);Te.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ne(e,t,r)};Te.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var i=ne(e);return t!==void 0?typeof r=="string"?i.fill(t,r):i.fill(t):i.fill(0),i};Te.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return ne(e)};Te.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return tr.SlowBuffer(e)}});var Do=d((yp,qo)=>{var gi=To(),sc=require("util"),$e=_i().Buffer;function L(e){if(!(this instanceof L))return new L(e);if(this._bufs=[],this.length=0,typeof e=="function"){this._callback=e;var t=function(i){this._callback&&(this._callback(i),this._callback=null)}.bind(this);this.on("pipe",function(i){i.on("error",t)}),this.on("unpipe",function(i){i.removeListener("error",t)})}else this.append(e);gi.call(this)}sc.inherits(L,gi);L.prototype._offset=function(t){var r=0,i=0,n;if(t===0)return[0,0];for(;i<this._bufs.length;i++){if(n=r+this._bufs[i].length,t<n||i==this._bufs.length-1)return[i,t-r];r=n}};L.prototype.append=function(t){var r=0;if($e.isBuffer(t))this._appendBuffer(t);else if(Array.isArray(t))for(;r<t.length;r++)this.append(t[r]);else if(t instanceof L)for(;r<t._bufs.length;r++)this.append(t._bufs[r]);else t!=null&&(typeof t=="number"&&(t=t.toString()),this._appendBuffer($e.from(t)));return this};L.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length};L.prototype._write=function(t,r,i){this._appendBuffer(t),typeof i=="function"&&i()};L.prototype._read=function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)};L.prototype.end=function(t){gi.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)};L.prototype.get=function(t){return this.slice(t,t+1)[0]};L.prototype.slice=function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)};L.prototype.copy=function(t,r,i,n){if((typeof i!="number"||i<0)&&(i=0),(typeof n!="number"||n>this.length)&&(n=this.length),i>=this.length||n<=0)return t||$e.alloc(0);var o=!!t,a=this._offset(i),s=n-i,f=s,c=o&&r||0,l=a[1],x,u;if(i===0&&n==this.length){if(!o)return this._bufs.length===1?this._bufs[0]:$e.concat(this._bufs,this.length);for(u=0;u<this._bufs.length;u++)this._bufs[u].copy(t,c),c+=this._bufs[u].length;return t}if(f<=this._bufs[a[0]].length-l)return o?this._bufs[a[0]].copy(t,r,l,l+f):this._bufs[a[0]].slice(l,l+f);for(o||(t=$e.allocUnsafe(s)),u=a[0];u<this._bufs.length;u++){if(x=this._bufs[u].length-l,f>x)this._bufs[u].copy(t,c,l),c+=x;else{this._bufs[u].copy(t,c,l,l+f),c+=x;break}f-=x,l&&(l=0)}return t.length>c?t.slice(0,c):t};L.prototype.shallowSlice=function(t,r){t=t||0,r=r||this.length,t<0&&(t+=this.length),r<0&&(r+=this.length);var i=this._offset(t),n=this._offset(r),o=this._bufs.slice(i[0],n[0]+1);return n[1]==0?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),i[1]!=0&&(o[0]=o[0].slice(i[1])),new L(o)};L.prototype.toString=function(t,r,i){return this.slice(r,i).toString(t)};L.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this};L.prototype.duplicate=function(){for(var t=0,r=new L;t<this._bufs.length;t++)r.append(this._bufs[t]);return r};L.prototype.destroy=function(){this._bufs.length=0,this.length=0,this.push(null)};(function(){var e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1};for(var t in e)(function(r){L.prototype[r]=function(i){return this.slice(i,i+e[r])[r](0)}})(t)})();qo.exports=L});var ko=d((vp,Io)=>{Io.exports=uc;var fc=Object.prototype.hasOwnProperty;function uc(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)fc.call(r,i)&&(e[i]=r[i])}return e}});var No=d((_p,jo)=>{var lc={}.toString;jo.exports=Array.isArray||function(e){return lc.call(e)=="[object Array]"}});var He=d((gp,Uo)=>{"use strict";Uo.exports=TypeError});var wi=d((wp,Lo)=>{"use strict";Lo.exports=Object});var Mo=d((bp,zo)=>{"use strict";zo.exports=Error});var $o=d((Ep,Wo)=>{"use strict";Wo.exports=EvalError});var Go=d((Sp,Ho)=>{"use strict";Ho.exports=RangeError});var Zo=d((Ap,Yo)=>{"use strict";Yo.exports=ReferenceError});var bi=d((Fp,Ko)=>{"use strict";Ko.exports=SyntaxError});var Xo=d((Op,Vo)=>{"use strict";Vo.exports=URIError});var Qo=d((Rp,Jo)=>{"use strict";Jo.exports=Math.abs});var ta=d((Pp,ea)=>{"use strict";ea.exports=Math.floor});var ia=d((Tp,ra)=>{"use strict";ra.exports=Math.max});var oa=d((Bp,na)=>{"use strict";na.exports=Math.min});var sa=d((Cp,aa)=>{"use strict";aa.exports=Math.pow});var ua=d((qp,fa)=>{"use strict";fa.exports=Math.round});var ca=d((Dp,la)=>{"use strict";la.exports=Number.isNaN||function(t){return t!==t}});var da=d((Ip,xa)=>{"use strict";var cc=ca();xa.exports=function(t){return cc(t)||t===0?t:t<0?-1:1}});var pa=d((kp,ha)=>{"use strict";ha.exports=Object.getOwnPropertyDescriptor});var Ge=d((jp,ma)=>{"use strict";var rr=pa();if(rr)try{rr([],"length")}catch{rr=null}ma.exports=rr});var yt=d((Np,ya)=>{"use strict";var ir=Object.defineProperty||!1;if(ir)try{ir({},"a",{value:1})}catch{ir=!1}ya.exports=ir});var Ei=d((Up,va)=>{"use strict";va.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;t[r]=n;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==n||s.enumerable!==!0)return!1}return!0}});var wa=d((Lp,ga)=>{"use strict";var _a=typeof Symbol<"u"&&Symbol,xc=Ei();ga.exports=function(){return typeof _a!="function"||typeof Symbol!="function"||typeof _a("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:xc()}});var Si=d((zp,ba)=>{"use strict";ba.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Ai=d((Mp,Ea)=>{"use strict";var dc=wi();Ea.exports=dc.getPrototypeOf||null});var Fa=d((Wp,Aa)=>{"use strict";var hc="Function.prototype.bind called on incompatible ",pc=Object.prototype.toString,mc=Math.max,yc="[object Function]",Sa=function(t,r){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<r.length;o+=1)i[o+t.length]=r[o];return i},vc=function(t,r){for(var i=[],n=r||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i},_c=function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r};Aa.exports=function(t){var r=this;if(typeof r!="function"||pc.apply(r)!==yc)throw new TypeError(hc+r);for(var i=vc(arguments,1),n,o=function(){if(this instanceof n){var l=r.apply(this,Sa(i,arguments));return Object(l)===l?l:this}return r.apply(t,Sa(i,arguments))},a=mc(0,r.length-i.length),s=[],f=0;f<a;f++)s[f]="$"+f;if(n=Function("binder","return function ("+_c(s,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=function(){};c.prototype=r.prototype,n.prototype=new c,c.prototype=null}return n}});var Ye=d(($p,Oa)=>{"use strict";var gc=Fa();Oa.exports=Function.prototype.bind||gc});var nr=d((Hp,Ra)=>{"use strict";Ra.exports=Function.prototype.call});var or=d((Gp,Pa)=>{"use strict";Pa.exports=Function.prototype.apply});var Ba=d((Yp,Ta)=>{"use strict";Ta.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Fi=d((Zp,Ca)=>{"use strict";var wc=Ye(),bc=or(),Ec=nr(),Sc=Ba();Ca.exports=Sc||wc.call(Ec,bc)});var ar=d((Kp,qa)=>{"use strict";var Ac=Ye(),Fc=He(),Oc=nr(),Rc=Fi();qa.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new Fc("a function is required");return Rc(Ac,Oc,t)}});var Ua=d((Vp,Na)=>{"use strict";var Pc=ar(),Da=Ge(),ka;try{ka=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Oi=!!ka&&Da&&Da(Object.prototype,"__proto__"),ja=Object,Ia=ja.getPrototypeOf;Na.exports=Oi&&typeof Oi.get=="function"?Pc([Oi.get]):typeof Ia=="function"?function(t){return Ia(t==null?t:ja(t))}:!1});var Ri=d((Xp,Wa)=>{"use strict";var La=Si(),za=Ai(),Ma=Ua();Wa.exports=La?function(t){return La(t)}:za?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return za(t)}:Ma?function(t){return Ma(t)}:null});var Ha=d((Jp,$a)=>{"use strict";var Tc=async function(){}.constructor;$a.exports=()=>Tc});var Ya=d((Qp,Ga)=>{"use strict";var Bc=function*(){}.constructor;Ga.exports=()=>Bc});var Ka=d((em,Za)=>{"use strict";var Cc=async function*(){}.constructor;Za.exports=()=>Cc});var Xa=d((tm,Va)=>{"use strict";var qc=Function.prototype.call,Dc=Object.prototype.hasOwnProperty,Ic=Ye();Va.exports=Ic.call(qc,Dc)});var Ti=d((rm,rs)=>{"use strict";var S,kc=wi(),jc=Mo(),Nc=$o(),Uc=Go(),Lc=Zo(),Xe=bi(),Ve=He(),zc=Xo(),Mc=Qo(),Wc=ta(),$c=ia(),Hc=oa(),Gc=sa(),Yc=ua(),Zc=da(),vt=Ge(),Kc=yt(),Pi=function(){throw new Ve},Vc=vt?(function(){try{return arguments.callee,Pi}catch{try{return vt(arguments,"callee").get}catch{return Pi}}})():Pi,Ze=wa()(),$=Ri(),Xc=Ai(),Jc=Si(),ts=or(),_t=nr(),Ke={},Qc=typeof Uint8Array>"u"||!$?S:$(Uint8Array),Be={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?S:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?S:ArrayBuffer,"%ArrayIteratorPrototype%":Ze&&$?$([][Symbol.iterator]()):S,"%AsyncFromSyncIteratorPrototype%":S,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?S:Atomics,"%BigInt%":typeof BigInt>"u"?S:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?S:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?S:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?S:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jc,"%eval%":eval,"%EvalError%":Nc,"%Float16Array%":typeof Float16Array>"u"?S:Float16Array,"%Float32Array%":typeof Float32Array>"u"?S:Float32Array,"%Float64Array%":typeof Float64Array>"u"?S:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?S:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?S:Int8Array,"%Int16Array%":typeof Int16Array>"u"?S:Int16Array,"%Int32Array%":typeof Int32Array>"u"?S:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ze&&$?$($([][Symbol.iterator]())):S,"%JSON%":typeof JSON=="object"?JSON:S,"%Map%":typeof Map>"u"?S:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ze||!$?S:$(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":kc,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?S:Promise,"%Proxy%":typeof Proxy>"u"?S:Proxy,"%RangeError%":Uc,"%ReferenceError%":Lc,"%Reflect%":typeof Reflect>"u"?S:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?S:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ze||!$?S:$(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?S:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ze&&$?$(""[Symbol.iterator]()):S,"%Symbol%":Ze?Symbol:S,"%SyntaxError%":Xe,"%ThrowTypeError%":Vc,"%TypedArray%":Qc,"%TypeError%":Ve,"%Uint8Array%":typeof Uint8Array>"u"?S:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?S:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?S:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?S:Uint32Array,"%URIError%":zc,"%WeakMap%":typeof WeakMap>"u"?S:WeakMap,"%WeakRef%":typeof WeakRef>"u"?S:WeakRef,"%WeakSet%":typeof WeakSet>"u"?S:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":ts,"%Object.defineProperty%":Kc,"%Object.getPrototypeOf%":Xc,"%Math.abs%":Mc,"%Math.floor%":Wc,"%Math.max%":$c,"%Math.min%":Hc,"%Math.pow%":Gc,"%Math.round%":Yc,"%Math.sign%":Zc,"%Reflect.getPrototypeOf%":Jc};if($)try{null.error}catch(e){Ja=$($(e)),Be["%Error.prototype%"]=Ja}var Ja,ex=Ha(),tx=Ya(),rx=Ka(),ix=function e(t){var r;if(t==="%AsyncFunction%")r=ex()||void 0;else if(t==="%GeneratorFunction%")r=tx()||void 0;else if(t==="%AsyncGeneratorFunction%")r=rx()||void 0;else if(t==="%AsyncGenerator%"){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=e("%AsyncGenerator%");n&&$&&(r=$(n.prototype))}return Be[t]=r,r},Qa={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gt=Ye(),sr=Xa(),nx=gt.call(_t,Array.prototype.concat),ox=gt.call(ts,Array.prototype.splice),es=gt.call(_t,String.prototype.replace),fr=gt.call(_t,String.prototype.slice),ax=gt.call(_t,RegExp.prototype.exec),sx=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fx=/\\(\\)?/g,ux=function(t){var r=fr(t,0,1),i=fr(t,-1);if(r==="%"&&i!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var n=[];return es(t,sx,function(o,a,s,f){n[n.length]=s?es(f,fx,"$1"):a||o}),n},lx=function(t,r){var i=t,n;if(sr(Qa,i)&&(n=Qa[i],i="%"+n[0]+"%"),sr(Be,i)){var o=Be[i];if(o===Ke&&(o=ix(i)),typeof o>"u"&&!r)throw new Ve("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new Xe("intrinsic "+t+" does not exist!")};rs.exports=function(t,r){if(typeof t!="string"||t.length===0)throw new Ve("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ve('"allowMissing" argument must be a boolean');if(ax(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=ux(t),n=i.length>0?i[0]:"",o=lx("%"+n+"%",r),a=o.name,s=o.value,f=!1,c=o.alias;c&&(n=c[0],ox(i,nx([0,1],c)));for(var l=1,x=!0;l<i.length;l+=1){var u=i[l],h=fr(u,0,1),m=fr(u,-1);if((h==='"'||h==="'"||h==="`"||m==='"'||m==="'"||m==="`")&&h!==m)throw new Xe("property names with quotes must have matching quotes");if((u==="constructor"||!x)&&(f=!0),n+="."+u,a="%"+n+"%",sr(Be,a))s=Be[a];else if(s!=null){if(!(u in s)){if(!r)throw new Ve("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&l+1>=i.length){var y=vt(s,u);x=!!y,x&&"get"in y&&!("originalValue"in y.get)?s=y.get:s=s[u]}else x=sr(s,u),s=s[u];x&&!f&&(Be[a]=s)}}return s}});var Bi=d((im,os)=>{"use strict";var is=Ti(),ns=ar(),cx=ns([is("%String.prototype.indexOf%")]);os.exports=function(t,r){var i=is(t,!!r);return typeof i=="function"&&cx(t,".prototype.")>-1?ns([i]):i}});var us=d((nm,fs)=>{"use strict";var ss=Function.prototype.toString,Je=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,qi,ur;if(typeof Je=="function"&&typeof Object.defineProperty=="function")try{qi=Object.defineProperty({},"length",{get:function(){throw ur}}),ur={},Je(function(){throw 42},null,qi)}catch(e){e!==ur&&(Je=null)}else Je=null;var xx=/^\s*class\b/,Di=function(t){try{var r=ss.call(t);return xx.test(r)}catch{return!1}},Ci=function(t){try{return Di(t)?!1:(ss.call(t),!0)}catch{return!1}},lr=Object.prototype.toString,dx="[object Object]",hx="[object Function]",px="[object GeneratorFunction]",mx="[object HTMLAllCollection]",yx="[object HTML document.all class]",vx="[object HTMLCollection]",_x=typeof Symbol=="function"&&!!Symbol.toStringTag,gx=!(0 in[,]),Ii=function(){return!1};typeof document=="object"&&(as=document.all,lr.call(as)===lr.call(document.all)&&(Ii=function(t){if((gx||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=lr.call(t);return(r===mx||r===yx||r===vx||r===dx)&&t("")==null}catch{}return!1}));var as;fs.exports=Je?function(t){if(Ii(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Je(t,null,qi)}catch(r){if(r!==ur)return!1}return!Di(t)&&Ci(t)}:function(t){if(Ii(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(_x)return Ci(t);if(Di(t))return!1;var r=lr.call(t);return r!==hx&&r!==px&&!/^\[object HTML/.test(r)?!1:Ci(t)}});var xs=d((om,cs)=>{"use strict";var wx=us(),bx=Object.prototype.toString,ls=Object.prototype.hasOwnProperty,Ex=function(t,r,i){for(var n=0,o=t.length;n<o;n++)ls.call(t,n)&&(i==null?r(t[n],n,t):r.call(i,t[n],n,t))},Sx=function(t,r,i){for(var n=0,o=t.length;n<o;n++)i==null?r(t.charAt(n),n,t):r.call(i,t.charAt(n),n,t)},Ax=function(t,r,i){for(var n in t)ls.call(t,n)&&(i==null?r(t[n],n,t):r.call(i,t[n],n,t))};function Fx(e){return bx.call(e)==="[object Array]"}cs.exports=function(t,r,i){if(!wx(r))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),Fx(t)?Ex(t,r,n):typeof t=="string"?Sx(t,r,n):Ax(t,r,n)}});var hs=d((am,ds)=>{"use strict";ds.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var ms=d((sm,ps)=>{"use strict";var ki=hs(),Ox=typeof globalThis>"u"?global:globalThis;ps.exports=function(){for(var t=[],r=0;r<ki.length;r++)typeof Ox[ki[r]]=="function"&&(t[t.length]=ki[r]);return t}});var gs=d((fm,_s)=>{"use strict";var ys=yt(),Rx=bi(),Qe=He(),vs=Ge();_s.exports=function(t,r,i){if(!t||typeof t!="object"&&typeof t!="function")throw new Qe("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Qe("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Qe("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Qe("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Qe("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Qe("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,f=!!vs&&vs(t,r);if(ys)ys(t,r,{configurable:a===null&&f?f.configurable:!a,enumerable:n===null&&f?f.enumerable:!n,value:i,writable:o===null&&f?f.writable:!o});else if(s||!n&&!o&&!a)t[r]=i;else throw new Rx("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Es=d((um,bs)=>{"use strict";var ji=yt(),ws=function(){return!!ji};ws.hasArrayLengthDefineBug=function(){if(!ji)return null;try{return ji([],"length",{value:1}).length!==1}catch{return!0}};bs.exports=ws});var Rs=d((lm,Os)=>{"use strict";var Px=Ti(),Ss=gs(),Tx=Es()(),As=Ge(),Fs=He(),Bx=Px("%Math.floor%");Os.exports=function(t,r){if(typeof t!="function")throw new Fs("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||Bx(r)!==r)throw new Fs("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in t&&As){var a=As(t,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(o=!1)}return(n||o||!i)&&(Tx?Ss(t,"length",r,!0,!0):Ss(t,"length",r)),t}});var Ts=d((cm,Ps)=>{"use strict";var Cx=Ye(),qx=or(),Dx=Fi();Ps.exports=function(){return Dx(Cx,qx,arguments)}});var qs=d((xm,cr)=>{"use strict";var Ix=Rs(),Bs=yt(),kx=ar(),Cs=Ts();cr.exports=function(t){var r=kx(arguments),i=t.length-(arguments.length-1);return Ix(r,1+(i>0?i:0),!0)};Bs?Bs(cr.exports,"apply",{value:Cs}):cr.exports.apply=Cs});var Is=d((dm,Ds)=>{"use strict";var jx=Ei();Ds.exports=function(){return jx()&&!!Symbol.toStringTag}});var Ls=d((hm,Us)=>{"use strict";var hr=xs(),Nx=ms(),ks=qs(),Ui=Bi(),dr=Ge(),xr=Ri(),Ux=Ui("Object.prototype.toString"),Ns=Is()(),js=typeof globalThis>"u"?global:globalThis,Ni=Nx(),Li=Ui("String.prototype.slice"),Lx=Ui("Array.prototype.indexOf",!0)||function(t,r){for(var i=0;i<t.length;i+=1)if(t[i]===r)return i;return-1},pr={__proto__:null};Ns&&dr&&xr?hr(Ni,function(e){var t=new js[e];if(Symbol.toStringTag in t&&xr){var r=xr(t),i=dr(r,Symbol.toStringTag);if(!i&&r){var n=xr(r);i=dr(n,Symbol.toStringTag)}pr["$"+e]=ks(i.get)}}):hr(Ni,function(e){var t=new js[e],r=t.slice||t.set;r&&(pr["$"+e]=ks(r))});var zx=function(t){var r=!1;return hr(pr,function(i,n){if(!r)try{"$"+i(t)===n&&(r=Li(n,1))}catch{}}),r},Mx=function(t){var r=!1;return hr(pr,function(i,n){if(!r)try{i(t),r=Li(n,1)}catch{}}),r};Us.exports=function(t){if(!t||typeof t!="object")return!1;if(!Ns){var r=Li(Ux(t),8,-1);return Lx(Ni,r)>-1?r:r!=="Object"?!1:Mx(t)}return dr?zx(t):null}});var Ms=d((pm,zs)=>{"use strict";var Wx=Ls();zs.exports=function(t){return!!Wx(t)}});var $s=d((mm,Ws)=>{"use strict";var $x=He(),Hx=Bi(),Gx=Hx("TypedArray.prototype.buffer",!0),Yx=Ms();Ws.exports=Gx||function(t){if(!Yx(t))throw new $x("Not a Typed Array");return t.buffer}});var zi=d((ym,Gs)=>{"use strict";var te=_i().Buffer,Zx=No(),Kx=$s(),Vx=ArrayBuffer.isView||function(t){try{return Kx(t),!0}catch{return!1}},Xx=typeof Uint8Array<"u",Hs=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Jx=Hs&&(te.prototype instanceof Uint8Array||te.TYPED_ARRAY_SUPPORT);Gs.exports=function(t,r){if(te.isBuffer(t))return t.constructor&&!("isBuffer"in t)?te.from(t):t;if(typeof t=="string")return te.from(t,r);if(Hs&&Vx(t)){if(t.byteLength===0)return te.alloc(0);if(Jx){var i=te.from(t.buffer,t.byteOffset,t.byteLength);if(i.byteLength===t.byteLength)return i}var n=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o=te.from(n);if(o.length===t.byteLength)return o}if(Xx&&t instanceof Uint8Array)return te.from(t);var a=Zx(t);if(a)for(var s=0;s<t.length;s+=1){var f=t[s];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||te.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return te.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var Zs=d((vm,Ys)=>{var Qx=(function(){try{if(!Buffer.isEncoding("latin1"))return!1;var e=Buffer.alloc?Buffer.alloc(4):new Buffer(4);return e.fill("ab","ucs2"),e.toString("hex")==="61006200"}catch{return!1}})();function ed(e){return e.length===1&&e.charCodeAt(0)<256}function mr(e,t,r,i){if(r<0||i>e.length)throw new RangeError("Out of range index");return r=r>>>0,i=i===void 0?e.length:i>>>0,i>r&&e.fill(t,r,i),e}function td(e,t,r,i){if(r<0||i>e.length)throw new RangeError("Out of range index");if(i<=r)return e;r=r>>>0,i=i===void 0?e.length:i>>>0;for(var n=r,o=t.length;n<=i-o;)t.copy(e,n),n+=o;return n!==i&&t.copy(e,n,0,i-n),e}function rd(e,t,r,i,n){if(Qx)return e.fill(t,r,i,n);if(typeof t=="number")return mr(e,t,r,i);if(typeof t=="string"){if(typeof r=="string"?(n=r,r=0,i=e.length):typeof i=="string"&&(n=i,i=e.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(n==="latin1"&&(n="binary"),typeof n=="string"&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(t==="")return mr(e,0,r,i);if(ed(t))return mr(e,t.charCodeAt(0),r,i);t=new Buffer(t,n)}return Buffer.isBuffer(t)?td(e,t,r,i):mr(e,0,r,i)}Ys.exports=rd});var Vs=d((_m,Ks)=>{function id(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative');return Buffer.allocUnsafe?Buffer.allocUnsafe(e):new Buffer(e)}Ks.exports=id});var Mi=d((gm,Js)=>{var Xs=Zs(),nd=Vs();Js.exports=function(t,r,i){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');if(Buffer.alloc)return Buffer.alloc(t,r,i);var n=nd(t);return t===0?n:r===void 0?Xs(n,0):(typeof i!="string"&&(i=void 0),Xs(n,r,i))}});var $i=d(tt=>{var od=zi(),ad=Mi(),sd="0000000000000000000",fd="7777777777777777777",Qs=48,ud="ustar\x0000",ld=parseInt("7777",8),cd=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},xd=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},dd=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},ef=function(e,t,r,i){for(;r<i;r++)if(e[r]===t)return r;return i},tf=function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var i=156;i<512;i++)t+=e[i];return t},ve=function(e,t){return e=e.toString(8),e.length>t?fd.slice(0,t)+" ":sd.slice(0,t-e.length)+e+" "};function hd(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=!1,i=[],n=e.length-1;n>0;n--){var o=e[n];t?i.push(o):r&&o===0?i.push(0):r?(r=!1,i.push(256-o)):i.push(255-o)}var a=0,s=i.length;for(n=0;n<s;n++)a+=i[n]*Math.pow(256,n);return t?a:-1*a}var _e=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return hd(e);for(;t<e.length&&e[t]===32;)t++;for(var i=cd(ef(e,32,t,e.length),e.length,e.length);t<i&&e[t]===0;)t++;return i===t?0:parseInt(e.slice(t,i).toString(),8)},et=function(e,t,r,i){return e.slice(t,ef(e,0,t,t+r)).toString(i)},Wi=function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e};tt.decodeLongPath=function(e,t){return et(e,0,e.length,t)};tt.encodePax=function(e){var t="";e.name&&(t+=Wi(" path="+e.name+`
3
3
  `)),e.linkname&&(t+=Wi(" linkpath="+e.linkname+`
4
4
  `));var r=e.pax;if(r)for(var i in r)t+=Wi(" "+i+"="+r[i]+`
5
- `);return od(t)};tt.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var i=parseInt(e.slice(0,r).toString(),10);if(!i)return t;var n=e.slice(r+1,i-1).toString(),o=n.indexOf("=");if(o===-1)return t;t[n.slice(0,o)]=n.slice(o+1),e=e.slice(i)}return t};tt.encode=function(e){var t=ad(512),r=e.name,i="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(i)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(ve(e.mode&ld,6),100),t.write(ve(e.uid,6),108),t.write(ve(e.gid,6),116),t.write(ve(e.size,11),124),t.write(ve(e.mtime.getTime()/1e3|0,11),136),t[156]=Qs+dd(e.type),e.linkname&&t.write(e.linkname,157),t.write(ud,257),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(ve(e.devmajor||0,6),329),t.write(ve(e.devminor||0,6),337),i&&t.write(i,345),t.write(ve(tf(t),6),148),t)};tt.decode=function(e,t){var r=e[156]===0?0:e[156]-Qs,i=et(e,0,100,t),n=_e(e,100,8),o=_e(e,108,8),a=_e(e,116,8),s=_e(e,124,12),f=_e(e,136,12),c=xd(r),l=e[157]===0?null:et(e,157,100,t),x=et(e,265,32),u=et(e,297,32),h=_e(e,329,8),m=_e(e,337,8);e[345]&&(i=et(e,345,155,t)+"/"+i),r===0&&i&&i[i.length-1]==="/"&&(r=5);var y=tf(e);if(y===8*32)return null;if(y!==_e(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");return{name:i,mode:n,uid:o,gid:a,size:s,mtime:new Date(1e3*f),type:c,linkname:l,uname:x,gname:u,devmajor:h,devminor:m}}});var uf=d((bm,ff)=>{var nf=require("util"),pd=Do(),md=ko(),wt=$i(),of=We().Writable,af=We().PassThrough,sf=function(){},rf=function(e){return e&=511,e&&512-e},yd=function(e,t){var r=new yr(e,t);return r.end(),r},vd=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},yr=function(e,t){this._parent=e,this.offset=t,af.call(this)};nf.inherits(yr,af);yr.prototype.destroy=function(e){this._parent.destroy(e)};var de=function(e){if(!(this instanceof de))return new de(e);of.call(this,e),e=e||{},this._offset=0,this._buffer=pd(),this._missing=0,this._partial=!1,this._onparse=sf,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,i=function(){t._continue()},n=function(u){if(t._locked=!1,u)return t.destroy(u);t._stream||i()},o=function(){t._stream=null;var u=rf(t._header.size);u?t._parse(u,a):t._parse(512,x),t._locked||i()},a=function(){t._buffer.consume(rf(t._header.size)),t._parse(512,x),i()},s=function(){var u=t._header.size;t._paxGlobal=wt.decodePax(r.slice(0,u)),r.consume(u),o()},f=function(){var u=t._header.size;t._pax=wt.decodePax(r.slice(0,u)),t._paxGlobal&&(t._pax=md(t._paxGlobal,t._pax)),r.consume(u),o()},c=function(){var u=t._header.size;this._gnuLongPath=wt.decodeLongPath(r.slice(0,u),e.filenameEncoding),r.consume(u),o()},l=function(){var u=t._header.size;this._gnuLongLinkPath=wt.decodeLongPath(r.slice(0,u),e.filenameEncoding),r.consume(u),o()},x=function(){var u=t._offset,h;try{h=t._header=wt.decode(r.slice(0,512),e.filenameEncoding)}catch(m){t.emit("error",m)}if(r.consume(512),!h){t._parse(512,x),i();return}if(h.type==="gnu-long-path"){t._parse(h.size,c),i();return}if(h.type==="gnu-long-link-path"){t._parse(h.size,l),i();return}if(h.type==="pax-global-header"){t._parse(h.size,s),i();return}if(h.type==="pax-header"){t._parse(h.size,f),i();return}if(t._gnuLongPath&&(h.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(h.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=h=vd(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,x),t.emit("entry",h,yd(t,u),n);return}t._stream=new yr(t,u),t.emit("entry",h,t._stream,n),t._parse(h.size,o),i()};this._onheader=x,this._parse(512,x)};nf.inherits(de,of);de.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};de.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};de.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=sf,this._overflow?this._write(this._overflow,void 0,e):e()}};de.prototype._write=function(e,t,r){if(!this._destroyed){var i=this._stream,n=this._buffer,o=this._missing;if(e.length&&(this._partial=!0),e.length<o)return this._missing-=e.length,this._overflow=null,i?i.write(e,r):(n.append(e),r());this._cb=r,this._missing=0;var a=null;e.length>o&&(a=e.slice(o),e=e.slice(0,o)),i?i.end(e):n.append(e),this._overflow=a,this._onparse()}};de.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};ff.exports=de});var cf=d((Em,lf)=>{lf.exports=require("fs").constants||require("constants")});var hf=d((Sm,df)=>{df.exports=xf;function xf(e,t){if(e&&t)return xf(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(i){r[i]=e[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=e.apply(this,i),a=i[i.length-1];return typeof o=="function"&&o!==a&&Object.keys(a).forEach(function(s){o[s]=a[s]}),o}}});var yf=d((Am,Hi)=>{var pf=hf();Hi.exports=pf(vr);Hi.exports.strict=pf(mf);vr.proto=vr(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return vr(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return mf(this)},configurable:!0})});function vr(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function mf(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var gf=d((Fm,_f)=>{var _d=yf(),gd=function(){},wd=global.Bare?queueMicrotask:process.nextTick.bind(process),bd=function(e){return e.setHeader&&typeof e.abort=="function"},Ed=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},vf=function(e,t,r){if(typeof t=="function")return vf(e,null,t);t||(t={}),r=_d(r||gd);var i=e._writableState,n=e._readableState,o=t.readable||t.readable!==!1&&e.readable,a=t.writable||t.writable!==!1&&e.writable,s=!1,f=function(){e.writable||c()},c=function(){a=!1,o||r.call(e)},l=function(){o=!1,a||r.call(e)},x=function(p){r.call(e,p?new Error("exited with error code: "+p):null)},u=function(p){r.call(e,p)},h=function(){wd(m)},m=function(){if(!s){if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"));if(a&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"))}},y=function(){e.req.on("finish",c)};return bd(e)?(e.on("complete",c),e.on("abort",h),e.req?y():e.on("request",y)):a&&!i&&(e.on("end",f),e.on("close",f)),Ed(e)&&e.on("exit",x),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",u),e.on("close",h),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",h),e.removeListener("request",y),e.req&&e.req.removeListener("finish",c),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",c),e.removeListener("exit",x),e.removeListener("end",l),e.removeListener("error",u),e.removeListener("close",h)}};_f.exports=vf});var Af=d((Om,Sf)=>{var rt=cf(),wf=gf(),gr=require("util"),Sd=Mi(),Ad=zi(),bf=We().Readable,it=We().Writable,Fd=require("string_decoder").StringDecoder,_r=$i(),Od=parseInt("755",8),Rd=parseInt("644",8),Ef=Sd(1024),Yi=function(){},Gi=function(e,t){t&=511,t&&e.push(Ef.slice(0,512-t))};function Pd(e){switch(e&rt.S_IFMT){case rt.S_IFBLK:return"block-device";case rt.S_IFCHR:return"character-device";case rt.S_IFDIR:return"directory";case rt.S_IFIFO:return"fifo";case rt.S_IFLNK:return"symlink"}return"file"}var wr=function(e){it.call(this),this.written=0,this._to=e,this._destroyed=!1};gr.inherits(wr,it);wr.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};wr.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var br=function(){it.call(this),this.linkname="",this._decoder=new Fd("utf-8"),this._destroyed=!1};gr.inherits(br,it);br.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};br.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var bt=function(){it.call(this),this._destroyed=!1};gr.inherits(bt,it);bt.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};bt.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var oe=function(e){if(!(this instanceof oe))return new oe(e);bf.call(this,e),this._drain=Yi,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};gr.inherits(oe,bf);oe.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=Yi);var i=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=Pd(e.mode)),e.mode||(e.mode=e.type==="directory"?Od:Rd),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Ad(t)),Buffer.isBuffer(t))return e.size=t.length,this._encode(e),this.push(t),Gi(i,e.size),process.nextTick(r),new bt;if(e.type==="symlink"&&!e.linkname){var n=new br;return wf(n,function(a){if(a)return i.destroy(),r(a);e.linkname=n.linkname,i._encode(e),r()}),n}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new bt;var o=new wr(this);return this._stream=o,wf(o,function(a){if(i._stream=null,a)return i.destroy(),r(a);if(o.written!==e.size)return i.destroy(),r(new Error("size mismatch"));Gi(i,e.size),i._finalizing&&i.finalize(),r()}),o}};oe.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Ef),this.push(null))};oe.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};oe.prototype._encode=function(e){if(!e.pax){var t=_r.encode(e);if(t){this.push(t);return}}this._encodePax(e)};oe.prototype._encodePax=function(e){var t=_r.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(_r.encode(r)),this.push(t),Gi(this,t.length),r.size=e.size,r.type=e.type,this.push(_r.encode(r))};oe.prototype._read=function(e){var t=this._drain;this._drain=Yi,t()};Sf.exports=oe});var Ff=d(Zi=>{Zi.extract=uf();Zi.pack=Af()});var Er=d((Pm,Rf)=>{"use strict";var Of=Zr(),Td=Wt(),Bd=Ff();Rf.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!Td(e))return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`));if(Buffer.isBuffer(e)&&(!Of(e)||Of(e).ext!=="tar"))return Promise.resolve([]);let t=Bd.extract(),r=[];t.on("entry",(n,o,a)=>{let s=[];o.on("data",f=>s.push(f)),o.on("end",()=>{let f={data:Buffer.concat(s),mode:n.mode,mtime:n.mtime,path:n.name,type:n.type};(n.type==="symlink"||n.type==="link")&&(f.linkname=n.linkname),r.push(f),a()})});let i=new Promise((n,o)=>{Buffer.isBuffer(e)||e.on("error",o),t.on("finish",()=>n(r)),t.on("error",o)});return t.then=i.then.bind(i),t.catch=i.catch.bind(i),Buffer.isBuffer(e)?t.end(e):e.pipe(t),t}});var Tf=d((Tm,Pf)=>{"use strict";var nt=e=>Array.from(e).map(t=>t.charCodeAt(0)),Cd=nt("META-INF/mozilla.rsa"),qd=nt("[Content_Types].xml"),Dd=nt("_rels/.rels");Pf.exports=e=>{let t=new Uint8Array(e);if(!(t&&t.length>1))return null;let r=(i,n)=>{n=Object.assign({offset:0},n);for(let o=0;o<i.length;o++)if(n.mask){if(i[o]!==(n.mask[o]&t[o+n.offset]))return!1}else if(i[o]!==t[o+n.offset])return!1;return!0};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(r([80,75,3,4])){if(r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r(Cd,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(r(qd,{offset:30})||r(Dd,{offset:30})){let i=t.subarray(4,2004),n=a=>a.findIndex((s,f,c)=>c[f]===80&&c[f+1]===75&&c[f+2]===3&&c[f+3]===4),o=n(i);if(o!==-1){let a=t.subarray(o+8,o+8+1e3),s=n(a);if(s!==-1){let f=8+o+s+30;if(r(nt("word/"),{offset:f}))return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(r(nt("ppt/"),{offset:f}))return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(r(nt("xl/"),{offset:f}))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}}}if(r([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8))return{ext:"zip",mime:"application/zip"};if(r([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(t[6]===0||t[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([51,103,112,53])||r([0,0,0])&&r([102,116,121,112],{offset:4})&&(r([109,112,52,49],{offset:8})||r([109,112,52,50],{offset:8})||r([105,115,111,109],{offset:8})||r([105,115,111,50],{offset:8})||r([109,109,112,52],{offset:8})||r([77,52,86],{offset:8})||r([100,97,115,104],{offset:8})))return{ext:"mp4",mime:"video/mp4"};if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){let i=t.subarray(4,4100),n=i.findIndex((o,a,s)=>s[a]===66&&s[a+1]===130);if(n!==-1){let o=n+3,a=s=>Array.from(s).every((f,c)=>i[o+c]===f.charCodeAt(0));if(a("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(a("webm"))return{ext:"webm",mime:"video/webm"}}}if(r([0,0,0,20,102,116,121,112,113,116,32,32])||r([102,114,101,101],{offset:4})||r([102,116,121,112,113,116,32,32],{offset:4})||r([109,100,97,116],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([82,73,70,70])&&r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/x-msvideo"};if(r([48,38,178,117,142,102,207,17,166,217]))return{ext:"wmv",mime:"video/x-ms-wmv"};if(r([0,0,1,186]))return{ext:"mpg",mime:"video/mpeg"};for(let i=0;i<2&&i<t.length-16;i++)if(r([73,68,51],{offset:i})||r([255,226],{offset:i,mask:[255,226]}))return{ext:"mp3",mime:"audio/mpeg"};return r([102,116,121,112,77,52,65],{offset:4})||r([77,52,65,32])?{ext:"m4a",mime:"audio/m4a"}:r([79,112,117,115,72,101,97,100],{offset:28})?{ext:"opus",mime:"audio/opus"}:r([79,103,103,83])?{ext:"ogg",mime:"audio/ogg"}:r([102,76,97,67])?{ext:"flac",mime:"audio/x-flac"}:r([82,73,70,70])&&r([87,65,86,69],{offset:8})?{ext:"wav",mime:"audio/x-wav"}:r([35,33,65,77,82,10])?{ext:"amr",mime:"audio/amr"}:r([37,80,68,70])?{ext:"pdf",mime:"application/pdf"}:r([77,90])?{ext:"exe",mime:"application/x-msdownload"}:(t[0]===67||t[0]===70)&&r([87,83],{offset:1})?{ext:"swf",mime:"application/x-shockwave-flash"}:r([123,92,114,116,102])?{ext:"rtf",mime:"application/rtf"}:r([0,97,115,109])?{ext:"wasm",mime:"application/wasm"}:r([119,79,70,70])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff",mime:"font/woff"}:r([119,79,70,50])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff2",mime:"font/woff2"}:r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8}))?{ext:"eot",mime:"application/octet-stream"}:r([0,1,0,0,0])?{ext:"ttf",mime:"font/ttf"}:r([79,84,84,79,0])?{ext:"otf",mime:"font/otf"}:r([0,0,1,0])?{ext:"ico",mime:"image/x-icon"}:r([70,76,86,1])?{ext:"flv",mime:"video/x-flv"}:r([37,33])?{ext:"ps",mime:"application/postscript"}:r([253,55,122,88,90,0])?{ext:"xz",mime:"application/x-xz"}:r([83,81,76,105])?{ext:"sqlite",mime:"application/x-sqlite3"}:r([78,69,83,26])?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:r([67,114,50,52])?{ext:"crx",mime:"application/x-google-chrome-extension"}:r([77,83,67,70])||r([73,83,99,40])?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:r([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])?{ext:"deb",mime:"application/x-deb"}:r([33,60,97,114,99,104,62])?{ext:"ar",mime:"application/x-unix-archive"}:r([237,171,238,219])?{ext:"rpm",mime:"application/x-rpm"}:r([31,160])||r([31,157])?{ext:"Z",mime:"application/x-compress"}:r([76,90,73,80])?{ext:"lz",mime:"application/x-lzip"}:r([208,207,17,224,161,177,26,225])?{ext:"msi",mime:"application/x-msi"}:r([6,14,43,52,2,5,1,1,13,1,2,1,1,2])?{ext:"mxf",mime:"application/mxf"}:r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196}))?{ext:"mts",mime:"video/mp2t"}:r([66,76,69,78,68,69,82])?{ext:"blend",mime:"application/x-blender"}:r([66,80,71,251])?{ext:"bpg",mime:"image/bpg"}:null}});var qf=d((Bm,Cf)=>{var Bf=[0,1,3,7,15,31,63,127,255],Et=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Et.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)};Et.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=Bf[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var i=r-e;t|=(this.curByte&Bf[e]<<i)>>i,this.bitOffset+=e,e=0}}return t};Et.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1};Et.prototype.pi=function(){var e=new Buffer(6),t;for(t=0;t<e.length;t++)e[t]=this.read(8);return e.toString("hex")};Cf.exports=Et});var If=d((Cm,Df)=>{var Ce=function(){};Ce.prototype.readByte=function(){throw new Error("abstract method readByte() not implemented")};Ce.prototype.read=function(e,t,r){for(var i=0;i<r;){var n=this.readByte();if(n<0)return i===0?-1:i;e[t++]=n,i++}return i};Ce.prototype.seek=function(e){throw new Error("abstract method seek() not implemented")};Ce.prototype.writeByte=function(e){throw new Error("abstract method readByte() not implemented")};Ce.prototype.write=function(e,t,r){var i;for(i=0;i<r;i++)this.writeByte(e[t++]);return r};Ce.prototype.flush=function(){};Df.exports=Ce});var jf=d((qm,kf)=>{kf.exports=function(){var e=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]),t=function(){var r=4294967295;this.getCRC=function(){return~r>>>0},this.updateCRC=function(i){r=r<<8^e[(r>>>24^i)&255]},this.updateCRCRun=function(i,n){for(;n-- >0;)r=r<<8^e[(r>>>24^i)&255]}};return t}()});var Nf=d((Dm,Id)=>{Id.exports={name:"seek-bzip",version:"1.0.6",contributors:["C. Scott Ananian (http://cscott.net)","Eli Skeggs","Kevin Kwok","Rob Landley (http://landley.net)"],description:"a pure-JavaScript Node.JS module for random-access decoding bzip2 data",main:"./lib/index.js",repository:{type:"git",url:"https://github.com/cscott/seek-bzip.git"},license:"MIT",bin:{"seek-bunzip":"./bin/seek-bunzip","seek-table":"./bin/seek-bzip-table"},directories:{test:"test"},dependencies:{commander:"^2.8.1"},devDependencies:{fibers:"~1.0.6",mocha:"~2.2.5"},scripts:{test:"mocha"}}});var Gf=d((Im,Hf)=>{var kd=qf(),St=If(),Mf=jf(),Wf=Nf(),Sr=20,Uf=258,Lf=0,jd=1,Nd=2,Ud=6,Ld=50,zd="314159265359",Md="177245385090",zf=function(e,t){var r=e[t],i;for(i=t;i>0;i--)e[i]=e[i-1];return e[0]=r,r},k={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},ge={};ge[k.LAST_BLOCK]="Bad file checksum";ge[k.NOT_BZIP_DATA]="Not bzip data";ge[k.UNEXPECTED_INPUT_EOF]="Unexpected input EOF";ge[k.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF";ge[k.DATA_ERROR]="Data error";ge[k.OUT_OF_MEMORY]="Out of memory";ge[k.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var Y=function(e,t){var r=ge[e]||"unknown error";t&&(r+=": "+t);var i=new TypeError(r);throw i.errorCode=e,i},X=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};X.prototype._init_block=function(){var e=this._get_next_block();return e?(this.blockCRC=new Mf,!0):(this.writeCount=-1,!1)};X.prototype._start_bunzip=function(e,t){var r=new Buffer(4);(e.read(r,0,4)!==4||String.fromCharCode(r[0],r[1],r[2])!=="BZh")&&Y(k.NOT_BZIP_DATA,"bad magic");var i=r[3]-48;(i<1||i>9)&&Y(k.NOT_BZIP_DATA,"level out of range"),this.reader=new kd(e),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=t,this.streamCRC=0};X.prototype._get_next_block=function(){var e,t,r,i=this.reader,n=i.pi();if(n===Md)return!1;n!==zd&&Y(k.NOT_BZIP_DATA),this.targetBlockCRC=i.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,i.read(1)&&Y(k.OBSOLETE_INPUT);var o=i.read(24);o>this.dbufSize&&Y(k.DATA_ERROR,"initial position out of bounds");var a=i.read(16),s=new Buffer(256),f=0;for(e=0;e<16;e++)if(a&1<<15-e){var c=e*16;for(r=i.read(16),t=0;t<16;t++)r&1<<15-t&&(s[f++]=c+t)}var l=i.read(3);(l<Nd||l>Ud)&&Y(k.DATA_ERROR);var x=i.read(15);x===0&&Y(k.DATA_ERROR);var u=new Buffer(256);for(e=0;e<l;e++)u[e]=e;var h=new Buffer(x);for(e=0;e<x;e++){for(t=0;i.read(1);t++)t>=l&&Y(k.DATA_ERROR);h[e]=zf(u,t)}var m=f+2,y=[],p;for(t=0;t<l;t++){var _=new Buffer(m),g=new Uint16Array(Sr+1);for(a=i.read(5),e=0;e<m;e++){for(;(a<1||a>Sr)&&Y(k.DATA_ERROR),!!i.read(1);)i.read(1)?a--:a++;_[e]=a}var E,N;for(E=N=_[0],e=1;e<m;e++)_[e]>N?N=_[e]:_[e]<E&&(E=_[e]);p={},y.push(p),p.permute=new Uint16Array(Uf),p.limit=new Uint32Array(Sr+2),p.base=new Uint32Array(Sr+1),p.minLen=E,p.maxLen=N;var R=0;for(e=E;e<=N;e++)for(g[e]=p.limit[e]=0,a=0;a<m;a++)_[a]===e&&(p.permute[R++]=a);for(e=0;e<m;e++)g[_[e]]++;for(R=a=0,e=E;e<N;e++)R+=g[e],p.limit[e]=R-1,R<<=1,a+=g[e],p.base[e+1]=R-a;p.limit[N+1]=Number.MAX_VALUE,p.limit[N]=R+g[N]-1,p.base[E]=0}var J=new Uint32Array(256);for(e=0;e<256;e++)u[e]=e;var j=0,z=0,v=0,w,b=this.dbuf=new Uint32Array(this.dbufSize);for(m=0;;){for(m--||(m=Ld-1,v>=x&&Y(k.DATA_ERROR),p=y[h[v++]]),e=p.minLen,t=i.read(e);e>p.maxLen&&Y(k.DATA_ERROR),!(t<=p.limit[e]);e++)t=t<<1|i.read(1);t-=p.base[e],(t<0||t>=Uf)&&Y(k.DATA_ERROR);var C=p.permute[t];if(C===Lf||C===jd){j||(j=1,a=0),C===Lf?a+=j:a+=2*j,j<<=1;continue}if(j)for(j=0,z+a>this.dbufSize&&Y(k.DATA_ERROR),w=s[u[0]],J[w]+=a;a--;)b[z++]=w;if(C>f)break;z>=this.dbufSize&&Y(k.DATA_ERROR),e=C-1,w=zf(u,e),w=s[w],J[w]++,b[z++]=w}for((o<0||o>=z)&&Y(k.DATA_ERROR),t=0,e=0;e<256;e++)r=t+J[e],J[e]=t,t=r;for(e=0;e<z;e++)w=b[e]&255,b[J[w]]|=e<<8,J[w]++;var q=0,B=0,A=0;return z&&(q=b[o],B=q&255,q>>=8,A=-1),this.writePos=q,this.writeCurrent=B,this.writeCount=z,this.writeRun=A,!0};X.prototype._read_bunzip=function(e,t){var r,i,n;if(this.writeCount<0)return 0;for(var o=0,a=this.dbuf,s=this.writePos,f=this.writeCurrent,c=this.writeCount,l=this.outputsize,x=this.writeRun;c;){for(c--,i=f,s=a[s],f=s&255,s>>=8,x++===3?(r=f,n=i,f=-1):(r=1,n=f),this.blockCRC.updateCRCRun(n,r);r--;)this.outputStream.writeByte(n),this.nextoutput++;f!=i&&(x=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&Y(k.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var Ki=function(e){if("readByte"in e)return e;var t=new St;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(r){this.pos=r},t.eof=function(){return this.pos>=e.length},t},$f=function(e){var t=new St,r=!0;if(e)if(typeof e=="number")t.buffer=new Buffer(e),r=!1;else{if("writeByte"in e)return e;t.buffer=e,r=!1}else t.buffer=new Buffer(16384);return t.pos=0,t.writeByte=function(i){if(r&&this.pos>=this.buffer.length){var n=new Buffer(this.buffer.length*2);this.buffer.copy(n),this.buffer=n}this.buffer[this.pos++]=i},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!r)throw new TypeError("outputsize does not match decoded input");var i=new Buffer(this.pos);this.buffer.copy(i,0,0,this.pos),this.buffer=i}return this.buffer},t._coerced=!0,t};X.Err=k;X.decode=function(e,t,r){for(var i=Ki(e),n=$f(t),o=new X(i,n);!("eof"in i&&i.eof());)if(o._init_block())o._read_bunzip();else{var a=o.reader.read(32)>>>0;if(a!==o.streamCRC&&Y(k.DATA_ERROR,"Bad stream CRC (got "+o.streamCRC.toString(16)+" expected "+a.toString(16)+")"),r&&"eof"in i&&!i.eof())o._start_bunzip(i,n);else break}if("getBuffer"in n)return n.getBuffer()};X.decodeBlock=function(e,t,r){var i=Ki(e),n=$f(r),o=new X(i,n);o.reader.seek(t);var a=o._get_next_block();if(a&&(o.blockCRC=new Mf,o.writeCopies=0,o._read_bunzip()),"getBuffer"in n)return n.getBuffer()};X.table=function(e,t,r){var i=new St;i.delegate=Ki(e),i.pos=0,i.readByte=function(){return this.pos++,this.delegate.readByte()},i.delegate.eof&&(i.eof=i.delegate.eof.bind(i.delegate));var n=new St;n.pos=0,n.writeByte=function(){this.pos++};for(var o=new X(i,n),a=o.dbufSize;!("eof"in i&&i.eof());){var s=i.pos*8+o.reader.bitOffset;if(o.reader.hasByte&&(s-=8),o._init_block()){var f=n.pos;o._read_bunzip(),t(s,n.pos-f)}else{var c=o.reader.read(32);if(r&&"eof"in i&&!i.eof())o._start_bunzip(i,n),console.assert(o.dbufSize===a,"shouldn't change block size within multistream file");else break}}};X.Stream=St;X.version=Wf.version;X.license=Wf.license;Hf.exports=X});var Kf=d((Yf,Zf)=>{var Wd=require("stream");Yf=Zf.exports=Vi;Vi.through=Vi;function Vi(e,t,r){e=e||function(l){this.queue(l)},t=t||function(){this.queue(null)};var i=!1,n=!1,o=[],a=!1,s=new Wd;s.readable=s.writable=!0,s.paused=!1,s.autoDestroy=!(r&&r.autoDestroy===!1),s.write=function(l){return e.call(this,l),!s.paused};function f(){for(;o.length&&!s.paused;){var l=o.shift();if(l===null)return s.emit("end");s.emit("data",l)}}s.queue=s.push=function(l){return a||(l===null&&(a=!0),o.push(l),f()),s},s.on("end",function(){s.readable=!1,!s.writable&&s.autoDestroy&&process.nextTick(function(){s.destroy()})});function c(){s.writable=!1,t.call(s),!s.readable&&s.autoDestroy&&s.destroy()}return s.end=function(l){if(!i)return i=!0,arguments.length&&s.write(l),c(),s},s.destroy=function(){if(!n)return n=!0,i=!0,o.length=0,s.writable=s.readable=!1,s.emit("close"),s},s.pause=function(){if(!s.paused)return s.paused=!0,s},s.resume=function(){return s.paused&&(s.paused=!1,s.emit("resume")),f(),s.paused||s.emit("drain"),s},s}});var Xf=d((km,Vf)=>{function Xi(e){this.name="Bzip2Error",this.message=e,this.stack=new Error().stack}Xi.prototype=new Error;var Z={Error:function(e){throw new Xi(e)}},ae={};ae.Bzip2Error=Xi;ae.crcTable=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];ae.array=function(e){var t=0,r=0,i=[0,1,3,7,15,31,63,127,255];return function(n){for(var o=0;n>0;){var a=8-t;n>=a?(o<<=a,o|=i[a]&e[r++],t=0,n-=a):(o<<=n,o|=(e[r]&i[n]<<8-n-t)>>8-n-t,t+=n,n=0)}return o}};ae.simple=function(e,t){var r=ae.array(e),i=ae.header(r),n=!1,o=1e5*i,a=new Int32Array(o);do n=ae.decompress(r,t,a,o);while(!n)};ae.header=function(e){this.byteCount=new Int32Array(256),this.symToByte=new Uint8Array(256),this.mtfSymbol=new Int32Array(256),this.selectors=new Uint8Array(32768),e(8*3)!=4348520&&Z.Error("No magic number found");var t=e(8)-48;return(t<1||t>9)&&Z.Error("Not a BZIP archive"),t};ae.decompress=function(e,t,r,i,n){for(var o=20,a=258,s=0,f=1,c=50,l=-1,x="",u=0;u<6;u++)x+=e(8).toString(16);if(x=="177245385090"){var h=e(32)|0;return h!==n&&Z.Error("Error in bzip2: crc32 do not match"),e(null),null}x!="314159265359"&&Z.Error("eek not valid bzip data");var m=e(32)|0;e(1)&&Z.Error("unsupported obsolete version");var y=e(24);y>i&&Z.Error("Initial position larger than buffer size");var p=e(16),_=0;for(u=0;u<16;u++)if(p&1<<15-u){var g=e(16);for(D=0;D<16;D++)g&1<<15-D&&(this.symToByte[_++]=16*u+D)}var E=e(3);(E<2||E>6)&&Z.Error("another error");var N=e(15);N==0&&Z.Error("meh");for(var u=0;u<E;u++)this.mtfSymbol[u]=u;for(var u=0;u<N;u++){for(var D=0;e(1);D++)D>=E&&Z.Error("whoops another error");for(var R=this.mtfSymbol[D],g=D-1;g>=0;g--)this.mtfSymbol[g+1]=this.mtfSymbol[g];this.mtfSymbol[0]=R,this.selectors[u]=R}for(var O=_+2,J=[],j=new Uint8Array(a),z=new Uint16Array(o+1),v,D=0;D<E;D++){p=e(5);for(var u=0;u<O;u++){for(;(p<1||p>o)&&Z.Error("I gave up a while ago on writing error messages"),!!e(1);)e(1)?p--:p++;j[u]=p}var w,b;w=b=j[0];for(var u=1;u<O;u++)j[u]>b?b=j[u]:j[u]<w&&(w=j[u]);v=J[D]={},v.permute=new Int32Array(a),v.limit=new Int32Array(o+1),v.base=new Int32Array(o+1),v.minLen=w,v.maxLen=b;for(var C=v.base,q=v.limit,B=0,u=w;u<=b;u++)for(var p=0;p<O;p++)j[p]==u&&(v.permute[B++]=p);for(u=w;u<=b;u++)z[u]=q[u]=0;for(u=0;u<O;u++)z[j[u]]++;for(B=p=0,u=w;u<b;u++)B+=z[u],q[u]=B-1,B<<=1,C[u+1]=B-(p+=z[u]);q[b]=B+z[b]-1,C[w]=0}for(var u=0;u<256;u++)this.mtfSymbol[u]=u,this.byteCount[u]=0;var A,F,O,M;for(A=F=O=M=0;;){for(O--||(O=c-1,M>=N&&Z.Error("meow i'm a kitty, that's an error"),v=J[this.selectors[M++]],C=v.base,q=v.limit),u=v.minLen,D=e(u);u>v.maxLen&&Z.Error("rawr i'm a dinosaur"),!(D<=q[u]);)u++,D=D<<1|e(1);D-=C[u],(D<0||D>=a)&&Z.Error("moo i'm a cow");var T=v.permute[D];if(T==s||T==f){A||(A=1,p=0),T==s?p+=A:p+=2*A,A<<=1;continue}if(A)for(A=0,F+p>i&&Z.Error("Boom."),R=this.symToByte[this.mtfSymbol[0]],this.byteCount[R]+=p;p--;)r[F++]=R;if(T>_)break;F>=i&&Z.Error("I can't think of anything. Error"),u=T-1,R=this.mtfSymbol[u];for(var g=u-1;g>=0;g--)this.mtfSymbol[g+1]=this.mtfSymbol[g];this.mtfSymbol[0]=R,R=this.symToByte[R],this.byteCount[R]++,r[F++]=R}(y<0||y>=F)&&Z.Error("I'm a monkey and I'm throwing something at someone, namely you");for(var D=0,u=0;u<256;u++)g=D+this.byteCount[u],this.byteCount[u]=D,D=g;for(var u=0;u<F;u++)R=r[u]&255,r[this.byteCount[R]]|=u<<8,this.byteCount[R]++;var Se=0,Ae=0,Lr=0;F&&(Se=r[y],Ae=Se&255,Se>>=8,Lr=-1),F=F;for(var zr,Mr,It;F;){for(F--,Mr=Ae,Se=r[Se],Ae=Se&255,Se>>=8,Lr++==3?(zr=Ae,It=Mr,Ae=-1):(zr=1,It=Ae);zr--;)l=(l<<8^this.crcTable[(l>>24^It)&255])&4294967295,t(It);Ae!=Mr&&(Lr=0)}return l=(l^-1)>>>0,(l|0)!=(m|0)&&Z.Error("Error in bzip2: crc32 do not match"),n=(l^(n<<1|n>>>31))&4294967295,n};Vf.exports=ae});var e0=d((jm,Qf)=>{var Jf=[0,1,3,7,15,31,63,127,255];Qf.exports=function(t){var r=0,i=0,n=t(),o=function(a){if(a===null&&r!=0){r=0,i++;return}for(var s=0;a>0;){i>=n.length&&(i=0,n=t());var f=8-r;r===0&&a>0&&o.bytesRead++,a>=f?(s<<=f,s|=Jf[f]&n[i++],r=0,a-=f):(s<<=a,s|=(n[i]&Jf[a]<<8-a-r)>>8-a-r,r+=a,a=0)}return s};return o.bytesRead=0,o}});var i0=d((Nm,r0)=>{var $d=Kf(),t0=Xf(),Hd=e0();r0.exports=Gd;function Gd(){var e=[],t=0,r=0,i=!1,n=!1,o=null,a=null;function s(l){if(r){var x=1e5*r,u=new Int32Array(x),h=[],m=function(y){h.push(y)};return a=t0.decompress(o,m,u,x,a),a===null?(r=0,!1):(l(Buffer.from(h)),!0)}else return r=t0.header(o),a=0,!0}var f=0;function c(l){if(!i)try{return s(function(x){l.queue(x),x!==null&&(f+=x.length)})}catch(x){return l.emit("error",x),i=!0,!1}}return $d(function(x){for(e.push(x),t+=x.length,o===null&&(o=Hd(function(){return e.shift()}));!i&&t-o.bytesRead+1>=(25e3+1e5*r||4);)c(this)},function(x){for(;!i&&o&&t>o.bytesRead;)c(this);i||(a!==null&&this.emit("error",new Error("input stream ended prematurely")),this.queue(null))})}});var s0=d((Um,a0)=>{"use strict";var n0=Er(),o0=Tf(),Yd=Wt(),Zd=Gf(),Kd=i0();a0.exports=()=>e=>!Buffer.isBuffer(e)&&!Yd(e)?Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`)):Buffer.isBuffer(e)&&(!o0(e)||o0(e).ext!=="bz2")?Promise.resolve([]):Buffer.isBuffer(e)?n0()(Zd.decode(e)):n0()(e.pipe(Kd()))});var l0=d((Lm,u0)=>{"use strict";var Vd=require("zlib"),Xd=Er(),f0=Zr(),Jd=Wt();u0.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!Jd(e))return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`));if(Buffer.isBuffer(e)&&(!f0(e)||f0(e).ext!=="gz"))return Promise.resolve([]);let t=Vd.createGunzip(),r=Xd()(t);return Buffer.isBuffer(e)?t.end(e):e.pipe(t),r}});var x0=d((zm,c0)=>{"use strict";c0.exports=function(e){return e&&e.length>1?e[0]===255&&e[1]===216&&e[2]===255?{ext:"jpg",mime:"image/jpeg"}:e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71?{ext:"png",mime:"image/png"}:e[0]===71&&e[1]===73&&e[2]===70?{ext:"gif",mime:"image/gif"}:e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80?{ext:"webp",mime:"image/webp"}:e[0]===70&&e[1]===76&&e[2]===73&&e[3]===70?{ext:"flif",mime:"image/flif"}:(e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42)&&e[8]===67&&e[9]===82?{ext:"cr2",mime:"image/x-canon-cr2"}:e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42?{ext:"tif",mime:"image/tiff"}:e[0]===66&&e[1]===77?{ext:"bmp",mime:"image/bmp"}:e[0]===73&&e[1]===73&&e[2]===188?{ext:"jxr",mime:"image/vnd.ms-photo"}:e[0]===56&&e[1]===66&&e[2]===80&&e[3]===83?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===109&&e[31]===105&&e[32]===109&&e[33]===101&&e[34]===116&&e[35]===121&&e[36]===112&&e[37]===101&&e[38]===97&&e[39]===112&&e[40]===112&&e[41]===108&&e[42]===105&&e[43]===99&&e[44]===97&&e[45]===116&&e[46]===105&&e[47]===111&&e[48]===110&&e[49]===47&&e[50]===101&&e[51]===112&&e[52]===117&&e[53]===98&&e[54]===43&&e[55]===122&&e[56]===105&&e[57]===112?{ext:"epub",mime:"application/epub+zip"}:e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===77&&e[31]===69&&e[32]===84&&e[33]===65&&e[34]===45&&e[35]===73&&e[36]===78&&e[37]===70&&e[38]===47&&e[39]===109&&e[40]===111&&e[41]===122&&e[42]===105&&e[43]===108&&e[44]===108&&e[45]===97&&e[46]===46&&e[47]===114&&e[48]===115&&e[49]===97?{ext:"xpi",mime:"application/x-xpinstall"}:e[0]===80&&e[1]===75&&(e[2]===3||e[2]===5||e[2]===7)&&(e[3]===4||e[3]===6||e[3]===8)?{ext:"zip",mime:"application/zip"}:e[257]===117&&e[258]===115&&e[259]===116&&e[260]===97&&e[261]===114?{ext:"tar",mime:"application/x-tar"}:e[0]===82&&e[1]===97&&e[2]===114&&e[3]===33&&e[4]===26&&e[5]===7&&(e[6]===0||e[6]===1)?{ext:"rar",mime:"application/x-rar-compressed"}:e[0]===31&&e[1]===139&&e[2]===8?{ext:"gz",mime:"application/gzip"}:e[0]===66&&e[1]===90&&e[2]===104?{ext:"bz2",mime:"application/x-bzip2"}:e[0]===55&&e[1]===122&&e[2]===188&&e[3]===175&&e[4]===39&&e[5]===28?{ext:"7z",mime:"application/x-7z-compressed"}:e[0]===120&&e[1]===1?{ext:"dmg",mime:"application/x-apple-diskimage"}:e[0]===0&&e[1]===0&&e[2]===0&&(e[3]===24||e[3]===32)&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112||e[0]===51&&e[1]===103&&e[2]===112&&e[3]===53||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[16]===109&&e[17]===112&&e[18]===52&&e[19]===49&&e[20]===109&&e[21]===112&&e[22]===52&&e[23]===50&&e[24]===105&&e[25]===115&&e[26]===111&&e[27]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===105&&e[9]===115&&e[10]===111&&e[11]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===0?{ext:"mp4",mime:"video/mp4"}:e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===86?{ext:"m4v",mime:"video/x-m4v"}:e[0]===77&&e[1]===84&&e[2]===104&&e[3]===100?{ext:"mid",mime:"audio/midi"}:e[31]===109&&e[32]===97&&e[33]===116&&e[34]===114&&e[35]===111&&e[36]===115&&e[37]===107&&e[38]===97?{ext:"mkv",mime:"video/x-matroska"}:e[0]===26&&e[1]===69&&e[2]===223&&e[3]===163?{ext:"webm",mime:"video/webm"}:e[0]===0&&e[1]===0&&e[2]===0&&e[3]===20&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112?{ext:"mov",mime:"video/quicktime"}:e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===65&&e[9]===86&&e[10]===73?{ext:"avi",mime:"video/x-msvideo"}:e[0]===48&&e[1]===38&&e[2]===178&&e[3]===117&&e[4]===142&&e[5]===102&&e[6]===207&&e[7]===17&&e[8]===166&&e[9]===217?{ext:"wmv",mime:"video/x-ms-wmv"}:e[0]===0&&e[1]===0&&e[2]===1&&e[3].toString(16)[0]==="b"?{ext:"mpg",mime:"video/mpeg"}:e[0]===73&&e[1]===68&&e[2]===51||e[0]===255&&e[1]===251?{ext:"mp3",mime:"audio/mpeg"}:e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===65||e[0]===77&&e[1]===52&&e[2]===65&&e[3]===32?{ext:"m4a",mime:"audio/m4a"}:e[28]===79&&e[29]===112&&e[30]===117&&e[31]===115&&e[32]===72&&e[33]===101&&e[34]===97&&e[35]===100?{ext:"opus",mime:"audio/opus"}:e[0]===79&&e[1]===103&&e[2]===103&&e[3]===83?{ext:"ogg",mime:"audio/ogg"}:e[0]===102&&e[1]===76&&e[2]===97&&e[3]===67?{ext:"flac",mime:"audio/x-flac"}:e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===65&&e[10]===86&&e[11]===69?{ext:"wav",mime:"audio/x-wav"}:e[0]===35&&e[1]===33&&e[2]===65&&e[3]===77&&e[4]===82&&e[5]===10?{ext:"amr",mime:"audio/amr"}:e[0]===37&&e[1]===80&&e[2]===68&&e[3]===70?{ext:"pdf",mime:"application/pdf"}:e[0]===77&&e[1]===90?{ext:"exe",mime:"application/x-msdownload"}:(e[0]===67||e[0]===70)&&e[1]===87&&e[2]===83?{ext:"swf",mime:"application/x-shockwave-flash"}:e[0]===123&&e[1]===92&&e[2]===114&&e[3]===116&&e[4]===102?{ext:"rtf",mime:"application/rtf"}:e[0]===119&&e[1]===79&&e[2]===70&&e[3]===70&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)?{ext:"woff",mime:"application/font-woff"}:e[0]===119&&e[1]===79&&e[2]===70&&e[3]===50&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)?{ext:"woff2",mime:"application/font-woff"}:e[34]===76&&e[35]===80&&(e[8]===0&&e[9]===0&&e[10]===1||e[8]===1&&e[9]===0&&e[10]===2||e[8]===2&&e[9]===0&&e[10]===2)?{ext:"eot",mime:"application/octet-stream"}:e[0]===0&&e[1]===1&&e[2]===0&&e[3]===0&&e[4]===0?{ext:"ttf",mime:"application/font-sfnt"}:e[0]===79&&e[1]===84&&e[2]===84&&e[3]===79&&e[4]===0?{ext:"otf",mime:"application/font-sfnt"}:e[0]===0&&e[1]===0&&e[2]===1&&e[3]===0?{ext:"ico",mime:"image/x-icon"}:e[0]===70&&e[1]===76&&e[2]===86&&e[3]===1?{ext:"flv",mime:"video/x-flv"}:e[0]===37&&e[1]===33?{ext:"ps",mime:"application/postscript"}:e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0?{ext:"xz",mime:"application/x-xz"}:e[0]===83&&e[1]===81&&e[2]===76&&e[3]===105?{ext:"sqlite",mime:"application/x-sqlite3"}:e[0]===78&&e[1]===69&&e[2]===83&&e[3]===26?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:e[0]===67&&e[1]===114&&e[2]===50&&e[3]===52?{ext:"crx",mime:"application/x-google-chrome-extension"}:e[0]===77&&e[1]===83&&e[2]===67&&e[3]===70||e[0]===73&&e[1]===83&&e[2]===99&&e[3]===40?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62&&e[7]===10&&e[8]===100&&e[9]===101&&e[10]===98&&e[11]===105&&e[12]===97&&e[13]===110&&e[14]===45&&e[15]===98&&e[16]===105&&e[17]===110&&e[18]===97&&e[19]===114&&e[20]===121?{ext:"deb",mime:"application/x-deb"}:e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62?{ext:"ar",mime:"application/x-unix-archive"}:e[0]===237&&e[1]===171&&e[2]===238&&e[3]===219?{ext:"rpm",mime:"application/x-rpm"}:e[0]===31&&e[1]===160||e[0]===31&&e[1]===157?{ext:"Z",mime:"application/x-compress"}:e[0]===76&&e[1]===90&&e[2]===73&&e[3]===80?{ext:"lz",mime:"application/x-lzip"}:e[0]===208&&e[1]===207&&e[2]===17&&e[3]===224&&e[4]===161&&e[5]===177&&e[6]===26&&e[7]===225?{ext:"msi",mime:"application/x-msi"}:null:null}});var g0=d((Mm,_0)=>{"use strict";var Qi="pending",d0="settled",Ar="fulfilled",Fr="rejected",Qd=function(){},h0=typeof global<"u"&&typeof global.process<"u"&&typeof global.process.emit=="function",eh=typeof setImmediate>"u"?setTimeout:setImmediate,At=[],Ji;function th(){for(var e=0;e<At.length;e++)At[e][0](At[e][1]);At=[],Ji=!1}function Or(e,t){At.push([e,t]),Ji||(Ji=!0,eh(th,0))}function rh(e,t){function r(n){en(t,n)}function i(n){Ft(t,n)}try{e(r,i)}catch(n){i(n)}}function p0(e){var t=e.owner,r=t._state,i=t._data,n=e[r],o=e.then;if(typeof n=="function"){r=Ar;try{i=n(i)}catch(a){Ft(o,a)}}m0(o,i)||(r===Ar&&en(o,i),r===Fr&&Ft(o,i))}function m0(e,t){var r;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&(typeof t=="function"||typeof t=="object")){var i=t.then;if(typeof i=="function")return i.call(t,function(n){r||(r=!0,t===n?y0(e,n):en(e,n))},function(n){r||(r=!0,Ft(e,n))}),!0}}catch(n){return r||Ft(e,n),!0}return!1}function en(e,t){(e===t||!m0(e,t))&&y0(e,t)}function y0(e,t){e._state===Qi&&(e._state=d0,e._data=t,Or(ih,e))}function Ft(e,t){e._state===Qi&&(e._state=d0,e._data=t,Or(nh,e))}function v0(e){e._then=e._then.forEach(p0)}function ih(e){e._state=Ar,v0(e)}function nh(e){e._state=Fr,v0(e),!e._handled&&h0&&global.process.emit("unhandledRejection",e._data,e)}function oh(e){global.process.emit("rejectionHandled",e)}function Q(e){if(typeof e!="function")throw new TypeError("Promise resolver "+e+" is not a function");if(!(this instanceof Q))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],rh(e,this)}Q.prototype={constructor:Q,_state:Qi,_then:null,_data:void 0,_handled:!1,then:function(e,t){var r={owner:this,then:new this.constructor(Qd),fulfilled:e,rejected:t};return(t||e)&&!this._handled&&(this._handled=!0,this._state===Fr&&h0&&Or(oh,this)),this._state===Ar||this._state===Fr?Or(p0,r):this._then.push(r),r.then},catch:function(e){return this.then(null,e)}};Q.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new Q(function(t,r){var i=[],n=0;function o(f){return n++,function(c){i[f]=c,--n||t(i)}}for(var a=0,s;a<e.length;a++)s=e[a],s&&typeof s.then=="function"?s.then(o(a),r):i[a]=s;n||t(i)})};Q.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new Q(function(t,r){for(var i=0,n;i<e.length;i++)n=e[i],n&&typeof n.then=="function"?n.then(t,r):t(n)})};Q.resolve=function(e){return e&&typeof e=="object"&&e.constructor===Q?e:new Q(function(t){t(e)})};Q.reject=function(e){return new Q(function(t,r){r(e)})};_0.exports=Q});var b0=d((Wm,w0)=>{"use strict";w0.exports=typeof Promise=="function"?Promise:g0()});var tn=d(($m,S0)=>{"use strict";var E0=Object.getOwnPropertySymbols,ah=Object.prototype.hasOwnProperty,sh=Object.prototype.propertyIsEnumerable;function fh(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function uh(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(o){n[o]=o}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}S0.exports=uh()?Object.assign:function(e,t){for(var r,i=fh(e),n,o=1;o<arguments.length;o++){r=Object(arguments[o]);for(var a in r)ah.call(r,a)&&(i[a]=r[a]);if(E0){n=E0(r);for(var s=0;s<n.length;s++)sh.call(r,n[s])&&(i[n[s]]=r[n[s]])}}return i}});var F0=d((Hm,A0)=>{var lh=require("stream").PassThrough,ch=tn();A0.exports=function(e){e=ch({},e);var t=e.array,r=e.encoding,i=r==="buffer",n=!1;t?n=!(r||i):r=r||"utf8",i&&(r=null);var o=0,a=[],s=new lh({objectMode:n});return r&&s.setEncoding(r),s.on("data",function(f){a.push(f),n?o=a.length:o+=f.length}),s.getBufferedValue=function(){return t?a:i?Buffer.concat(a,o):a.join("")},s.getBufferedLength=function(){return o},s}});var R0=d((Gm,Rr)=>{"use strict";var O0=b0(),rn=tn(),xh=F0();function nn(e,t){if(!e)return O0.reject(new Error("Expected a stream"));t=rn({maxBuffer:1/0},t);var r=t.maxBuffer,i,n,o=new O0(function(a,s){i=xh(t),e.once("error",f),e.pipe(i),i.on("data",function(){i.getBufferedLength()>r&&s(new Error("maxBuffer exceeded"))}),i.once("error",f),i.on("end",a),n=function(){e.unpipe&&e.unpipe(i)};function f(c){c&&(c.bufferedData=i.getBufferedValue()),s(c)}});return o.then(n,n),o.then(function(){return i.getBufferedValue()})}Rr.exports=nn;Rr.exports.buffer=function(e,t){return nn(e,rn({},t,{encoding:"buffer"}))};Rr.exports.array=function(e,t){return nn(e,rn({},t,{array:!0}))}});var on=d((Ym,B0)=>{"use strict";var P0=function(e,t,r){return function(){for(var i=this,n=new Array(arguments.length),o=0;o<arguments.length;o++)n[o]=arguments[o];return new t(function(a,s){n.push(function(f,c){if(f)s(f);else if(r.multiArgs){for(var l=new Array(arguments.length-1),x=1;x<arguments.length;x++)l[x-1]=arguments[x];a(l)}else a(c)}),e.apply(i,n)})}},T0=B0.exports=function(e,t,r){typeof t!="function"&&(r=t,t=Promise),r=r||{},r.exclude=r.exclude||[/.+Sync$/];var i=function(o){var a=function(s){return typeof s=="string"?o===s:s.test(o)};return r.include?r.include.some(a):!r.exclude.some(a)},n=typeof e=="function"?function(){return r.excludeMain?e.apply(this,arguments):P0(e,t,r).apply(this,arguments)}:{};return Object.keys(e).reduce(function(o,a){var s=e[a];return o[a]=typeof s=="function"&&i(a)?P0(s,t,r):s,o},n)};T0.all=T0});var I0=d((Zm,D0)=>{D0.exports=Pr;function Pr(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}Pr.prototype.go=function(e){this.pending<this.max?q0(this,e):this.waiting.push(e)};Pr.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)};Pr.prototype.hold=function(){return C0(this)};function C0(e){e.pending+=1;var t=!1;return r;function r(n){if(t)throw new Error("callback called twice");if(t=!0,e.error=e.error||n,e.pending-=1,e.waiting.length>0&&e.pending<e.max)q0(e,e.waiting.shift());else if(e.pending===0){var o=e.listeners;e.listeners=[],o.forEach(i)}}function i(n){n(e.error)}}function q0(e,t){t(C0(e))}});var j0=d(Rt=>{var Ot=require("fs"),Tr=require("util"),an=require("stream"),k0=an.Readable,sn=an.Writable,dh=an.PassThrough,hh=I0(),Br=require("events").EventEmitter;Rt.createFromBuffer=ph;Rt.createFromFd=mh;Rt.BufferSlicer=pe;Rt.FdSlicer=he;Tr.inherits(he,Br);function he(e,t){t=t||{},Br.call(this),this.fd=e,this.pend=new hh,this.pend.max=1,this.refCount=0,this.autoClose=!!t.autoClose}he.prototype.read=function(e,t,r,i,n){var o=this;o.pend.go(function(a){Ot.read(o.fd,e,t,r,i,function(s,f,c){a(),n(s,f,c)})})};he.prototype.write=function(e,t,r,i,n){var o=this;o.pend.go(function(a){Ot.write(o.fd,e,t,r,i,function(s,f,c){a(),n(s,f,c)})})};he.prototype.createReadStream=function(e){return new Cr(this,e)};he.prototype.createWriteStream=function(e){return new qr(this,e)};he.prototype.ref=function(){this.refCount+=1};he.prototype.unref=function(){var e=this;if(e.refCount-=1,e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.autoClose&&Ot.close(e.fd,t);function t(r){r?e.emit("error",r):e.emit("close")}};Tr.inherits(Cr,k0);function Cr(e,t){t=t||{},k0.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start,this.destroyed=!1}Cr.prototype._read=function(e){var t=this;if(!t.destroyed){var r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.destroyed=!0,t.push(null),t.context.unref();return}t.context.pend.go(function(i){if(t.destroyed)return i();var n=new Buffer(r);Ot.read(t.context.fd,n,0,r,t.pos,function(o,a){o?t.destroy(o):a===0?(t.destroyed=!0,t.push(null),t.context.unref()):(t.pos+=a,t.push(n.slice(0,a))),i()})})}};Cr.prototype.destroy=function(e){this.destroyed||(e=e||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",e),this.context.unref())};Tr.inherits(qr,sn);function qr(e,t){t=t||{},sn.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end==null?1/0:+t.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}qr.prototype._write=function(e,t,r){var i=this;if(!i.destroyed){if(i.pos+e.length>i.endOffset){var n=new Error("maximum file length exceeded");n.code="ETOOBIG",i.destroy(),r(n);return}i.context.pend.go(function(o){if(i.destroyed)return o();Ot.write(i.context.fd,e,0,e.length,i.pos,function(a,s){a?(i.destroy(),o(),r(a)):(i.bytesWritten+=s,i.pos+=s,i.emit("progress"),o(),r())})})}};qr.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())};Tr.inherits(pe,Br);function pe(e,t){Br.call(this),t=t||{},this.refCount=0,this.buffer=e,this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}pe.prototype.read=function(e,t,r,i,n){var o=i+r,a=o-this.buffer.length,s=a>0?a:r;this.buffer.copy(e,t,i,o),setImmediate(function(){n(null,s)})};pe.prototype.write=function(e,t,r,i,n){e.copy(this.buffer,i,t,t+r),setImmediate(function(){n(null,r,e)})};pe.prototype.createReadStream=function(e){e=e||{};var t=new dh(e);t.destroyed=!1,t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var r=this.buffer.slice(t.start,t.pos),i=0;;){var n=i+this.maxChunkSize;if(n>=r.length){i<r.length&&t.write(r.slice(i,r.length));break}t.write(r.slice(i,n)),i=n}return t.end(),t.destroy=function(){t.destroyed=!0},t};pe.prototype.createWriteStream=function(e){var t=this;e=e||{};var r=new sn(e);return r.start=e.start||0,r.endOffset=e.end==null?this.buffer.length:+e.end,r.bytesWritten=0,r.pos=r.start,r.destroyed=!1,r._write=function(i,n,o){if(!r.destroyed){var a=r.pos+i.length;if(a>r.endOffset){var s=new Error("maximum file length exceeded");s.code="ETOOBIG",r.destroyed=!0,o(s);return}i.copy(t.buffer,r.pos,0,i.length),r.bytesWritten+=i.length,r.pos=a,r.emit("progress"),o()}},r.destroy=function(){r.destroyed=!0},r};pe.prototype.ref=function(){this.refCount+=1};pe.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function ph(e,t){return new pe(e,t)}function mh(e,t){return new he(e,t)}});var L0=d((Vm,U0)=>{var we=require("buffer").Buffer,fn=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(fn=new Int32Array(fn));function N0(e){if(we.isBuffer(e))return e;var t=typeof we.alloc=="function"&&typeof we.from=="function";if(typeof e=="number")return t?we.alloc(e):new we(e);if(typeof e=="string")return t?we.from(e):new we(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function yh(e){var t=N0(4);return t.writeInt32BE(e,0),t}function un(e,t){e=N0(e),we.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=~~t^-1,i=0;i<e.length;i++)r=fn[(r^e[i])&255]^r>>>8;return r^-1}function ln(){return yh(un.apply(null,arguments))}ln.signed=function(){return un.apply(null,arguments)};ln.unsigned=function(){return un.apply(null,arguments)>>>0};U0.exports=ln});var Y0=d(fe=>{var cn=require("fs"),vh=require("zlib"),z0=j0(),_h=L0(),kr=require("util"),jr=require("events").EventEmitter,M0=require("stream").Transform,xn=require("stream").PassThrough,gh=require("stream").Writable;fe.open=wh;fe.fromFd=W0;fe.fromBuffer=bh;fe.fromRandomAccessReader=dn;fe.dosDateTimeToDate=H0;fe.validateFileName=G0;fe.ZipFile=be;fe.Entry=Pt;fe.RandomAccessReader=Ee;function wh(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!0),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),r==null&&(r=Ir),cn.open(e,"r",function(i,n){if(i)return r(i);W0(n,t,function(o,a){o&&cn.close(n,Ir),r(o,a)})})}function W0(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!1),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),r==null&&(r=Ir),cn.fstat(e,function(i,n){if(i)return r(i);var o=z0.createFromFd(e,{autoClose:!0});dn(o,n.size,t,r)})}function bh(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose=!1,t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1);var i=z0.createFromBuffer(e,{maxChunkSize:65536});dn(i,e.length,t,r)}function dn(e,t,r,i){typeof r=="function"&&(i=r,r=null),r==null&&(r={}),r.autoClose==null&&(r.autoClose=!0),r.lazyEntries==null&&(r.lazyEntries=!1),r.decodeStrings==null&&(r.decodeStrings=!0);var n=!!r.decodeStrings;if(r.validateEntrySizes==null&&(r.validateEntrySizes=!0),r.strictFileNames==null&&(r.strictFileNames=!1),i==null&&(i=Ir),typeof t!="number")throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");e.ref();var o=22,a=65535,s=Math.min(o+a,t),f=se(s),c=t-f.length;ot(e,f,0,s,c,function(l){if(l)return i(l);for(var x=s-o;x>=0;x-=1)if(f.readUInt32LE(x)===101010256){var u=f.slice(x),h=u.readUInt16LE(4);if(h!==0)return i(new Error("multi-disk zip files are not supported: found disk number: "+h));var m=u.readUInt16LE(10),y=u.readUInt32LE(16),p=u.readUInt16LE(20),_=u.length-o;if(p!==_)return i(new Error("invalid comment length. expected: "+_+". found: "+p));var g=n?Dr(u,22,u.length,!1):u.slice(22);if(!(m===65535||y===4294967295))return i(null,new be(e,y,t,m,g,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames));var E=se(20),N=c+x-E.length;ot(e,E,0,E.length,N,function(R){if(R)return i(R);if(E.readUInt32LE(0)!==117853008)return i(new Error("invalid zip64 end of central directory locator signature"));var J=at(E,8),j=se(56);ot(e,j,0,j.length,J,function(z){return z?i(z):j.readUInt32LE(0)!==101075792?i(new Error("invalid zip64 end of central directory record signature")):(m=at(j,32),y=at(j,48),i(null,new be(e,y,t,m,g,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames)))})});return}i(new Error("end of central directory record signature not found"))})}kr.inherits(be,jr);function be(e,t,r,i,n,o,a,s,f,c){var l=this;jr.call(l),l.reader=e,l.reader.on("error",function(x){$0(l,x)}),l.reader.once("close",function(){l.emit("close")}),l.readEntryCursor=t,l.fileSize=r,l.entryCount=i,l.comment=n,l.entriesRead=0,l.autoClose=!!o,l.lazyEntries=!!a,l.decodeStrings=!!s,l.validateEntrySizes=!!f,l.strictFileNames=!!c,l.isOpen=!0,l.emittedError=!1,l.lazyEntries||l._readEntry()}be.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function re(e,t){e.autoClose&&e.close(),$0(e,t)}function $0(e,t){e.emittedError||(e.emittedError=!0,e.emit("error",t))}be.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};be.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit("end")});return}if(!e.emittedError){var t=se(46);ot(e.reader,t,0,t.length,e.readEntryCursor,function(r){if(r)return re(e,r);if(!e.emittedError){var i=new Pt,n=t.readUInt32LE(0);if(n!==33639248)return re(e,new Error("invalid central directory file header signature: 0x"+n.toString(16)));if(i.versionMadeBy=t.readUInt16LE(4),i.versionNeededToExtract=t.readUInt16LE(6),i.generalPurposeBitFlag=t.readUInt16LE(8),i.compressionMethod=t.readUInt16LE(10),i.lastModFileTime=t.readUInt16LE(12),i.lastModFileDate=t.readUInt16LE(14),i.crc32=t.readUInt32LE(16),i.compressedSize=t.readUInt32LE(20),i.uncompressedSize=t.readUInt32LE(24),i.fileNameLength=t.readUInt16LE(28),i.extraFieldLength=t.readUInt16LE(30),i.fileCommentLength=t.readUInt16LE(32),i.internalFileAttributes=t.readUInt16LE(36),i.externalFileAttributes=t.readUInt32LE(38),i.relativeOffsetOfLocalHeader=t.readUInt32LE(42),i.generalPurposeBitFlag&64)return re(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46,t=se(i.fileNameLength+i.extraFieldLength+i.fileCommentLength),ot(e.reader,t,0,t.length,e.readEntryCursor,function(o){if(o)return re(e,o);if(!e.emittedError){var a=(i.generalPurposeBitFlag&2048)!==0;i.fileName=e.decodeStrings?Dr(t,0,i.fileNameLength,a):t.slice(0,i.fileNameLength);var s=i.fileNameLength+i.extraFieldLength,f=t.slice(i.fileNameLength,s);i.extraFields=[];for(var c=0;c<f.length-3;){var l=f.readUInt16LE(c+0),x=f.readUInt16LE(c+2),u=c+4,h=u+x;if(h>f.length)return re(e,new Error("extra field length exceeds extra field buffer size"));var m=se(x);f.copy(m,0,u,h),i.extraFields.push({id:l,data:m}),c=h}if(i.fileComment=e.decodeStrings?Dr(t,s,s+i.fileCommentLength,a):t.slice(s,s+i.fileCommentLength),i.comment=i.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1,i.uncompressedSize===4294967295||i.compressedSize===4294967295||i.relativeOffsetOfLocalHeader===4294967295){for(var y=null,c=0;c<i.extraFields.length;c++){var p=i.extraFields[c];if(p.id===1){y=p.data;break}}if(y==null)return re(e,new Error("expected zip64 extended information extra field"));var _=0;if(i.uncompressedSize===4294967295){if(_+8>y.length)return re(e,new Error("zip64 extended information extra field does not include uncompressed size"));i.uncompressedSize=at(y,_),_+=8}if(i.compressedSize===4294967295){if(_+8>y.length)return re(e,new Error("zip64 extended information extra field does not include compressed size"));i.compressedSize=at(y,_),_+=8}if(i.relativeOffsetOfLocalHeader===4294967295){if(_+8>y.length)return re(e,new Error("zip64 extended information extra field does not include relative header offset"));i.relativeOffsetOfLocalHeader=at(y,_),_+=8}}if(e.decodeStrings)for(var c=0;c<i.extraFields.length;c++){var p=i.extraFields[c];if(p.id===28789){if(p.data.length<6||p.data.readUInt8(0)!==1)continue;var g=p.data.readUInt32LE(1);if(_h.unsigned(t.slice(0,i.fileNameLength))!==g)continue;i.fileName=Dr(p.data,5,p.data.length,!0);break}}if(e.validateEntrySizes&&i.compressionMethod===0){var E=i.uncompressedSize;if(i.isEncrypted()&&(E+=12),i.compressedSize!==E){var N="compressed/uncompressed size mismatch for stored file: "+i.compressedSize+" != "+i.uncompressedSize;return re(e,new Error(N))}}if(e.decodeStrings){e.strictFileNames||(i.fileName=i.fileName.replace(/\\/g,"/"));var R=G0(i.fileName,e.validateFileNameOptions);if(R!=null)return re(e,new Error(R))}e.emit("entry",i),e.lazyEntries||e._readEntry()}})}})}};be.prototype.openReadStream=function(e,t,r){var i=this,n=0,o=e.compressedSize;if(r==null)r=t,t={};else{if(t.decrypt!=null){if(!e.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(t.decrypt!==!1)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}if(t.decompress!=null){if(!e.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!(t.decompress===!1||t.decompress===!0))throw new Error("invalid options.decompress value: "+t.decompress)}if(t.start!=null||t.end!=null){if(e.isCompressed()&&t.decompress!==!1)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(e.isEncrypted()&&t.decrypt!==!1)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(t.start!=null){if(n=t.start,n<0)throw new Error("options.start < 0");if(n>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(t.end!=null){if(o=t.end,o<0)throw new Error("options.end < 0");if(o>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(o<n)throw new Error("options.end < options.start")}}if(!i.isOpen)return r(new Error("closed"));if(e.isEncrypted()&&t.decrypt!==!1)return r(new Error("entry is encrypted, and options.decrypt !== false"));i.reader.ref();var a=se(30);ot(i.reader,a,0,a.length,e.relativeOffsetOfLocalHeader,function(s){try{if(s)return r(s);var f=a.readUInt32LE(0);if(f!==67324752)return r(new Error("invalid local file header signature: 0x"+f.toString(16)));var c=a.readUInt16LE(26),l=a.readUInt16LE(28),x=e.relativeOffsetOfLocalHeader+a.length+c+l,u;if(e.compressionMethod===0)u=!1;else if(e.compressionMethod===8)u=t.decompress!=null?t.decompress:!0;else return r(new Error("unsupported compression method: "+e.compressionMethod));var h=x,m=h+e.compressedSize;if(e.compressedSize!==0&&m>i.fileSize)return r(new Error("file data overflows file bounds: "+h+" + "+e.compressedSize+" > "+i.fileSize));var y=i.reader.createReadStream({start:h+n,end:h+o}),p=y;if(u){var _=!1,g=vh.createInflateRaw();y.on("error",function(E){setImmediate(function(){_||g.emit("error",E)})}),y.pipe(g),i.validateEntrySizes?(p=new Tt(e.uncompressedSize),g.on("error",function(E){setImmediate(function(){_||p.emit("error",E)})}),g.pipe(p)):p=g,p.destroy=function(){_=!0,g!==p&&g.unpipe(p),y.unpipe(g),y.destroy()}}r(null,p)}finally{i.reader.unref()}})};function Pt(){}Pt.prototype.getLastModDate=function(){return H0(this.lastModFileDate,this.lastModFileTime)};Pt.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Pt.prototype.isCompressed=function(){return this.compressionMethod===8};function H0(e,t){var r=e&31,i=(e>>5&15)-1,n=(e>>9&127)+1980,o=0,a=(t&31)*2,s=t>>5&63,f=t>>11&31;return new Date(n,i,r,f,s,a,o)}function G0(e){return e.indexOf("\\")!==-1?"invalid characters in fileName: "+e:/^[a-zA-Z]:/.test(e)||/^\//.test(e)?"absolute path: "+e:e.split("/").indexOf("..")!==-1?"invalid relative path: "+e:null}function ot(e,t,r,i,n,o){if(i===0)return setImmediate(function(){o(null,se(0))});e.read(t,r,i,n,function(a,s){if(a)return o(a);if(s<i)return o(new Error("unexpected EOF"));o()})}kr.inherits(Tt,M0);function Tt(e){M0.call(this),this.actualByteCount=0,this.expectedByteCount=e}Tt.prototype._transform=function(e,t,r){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var i="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return r(new Error(i))}r(null,e)};Tt.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()};kr.inherits(Ee,jr);function Ee(){jr.call(this),this.refCount=0}Ee.prototype.ref=function(){this.refCount+=1};Ee.prototype.unref=function(){var e=this;if(e.refCount-=1,e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.close(t);function t(r){if(r)return e.emit("error",r);e.emit("close")}};Ee.prototype.createReadStream=function(e){var t=e.start,r=e.end;if(t===r){var i=new xn;return setImmediate(function(){i.end()}),i}var n=this._readStreamForRange(t,r),o=!1,a=new Nr(this);n.on("error",function(f){setImmediate(function(){o||a.emit("error",f)})}),a.destroy=function(){n.unpipe(a),a.unref(),n.destroy()};var s=new Tt(r-t);return a.on("error",function(f){setImmediate(function(){o||s.emit("error",f)})}),s.destroy=function(){o=!0,a.unpipe(s),a.destroy()},n.pipe(a).pipe(s)};Ee.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")};Ee.prototype.read=function(e,t,r,i,n){var o=this.createReadStream({start:i,end:i+r}),a=new gh,s=0;a._write=function(f,c,l){f.copy(e,t+s,0,f.length),s+=f.length,l()},a.on("finish",n),o.on("error",function(f){n(f)}),o.pipe(a)};Ee.prototype.close=function(e){setImmediate(e)};kr.inherits(Nr,xn);function Nr(e){xn.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}Nr.prototype._flush=function(e){this.unref(),e()};Nr.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var Eh="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";function Dr(e,t,r,i){if(i)return e.toString("utf8",t,r);for(var n="",o=t;o<r;o++)n+=Eh[e[o]];return n}function at(e,t){var r=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return i*4294967296+r}var se;typeof Buffer.allocUnsafe=="function"?se=function(e){return Buffer.allocUnsafe(e)}:se=function(e){return new Buffer(e)};function Ir(e){if(e)throw e}});var X0=d((Jm,V0)=>{"use strict";var Z0=x0(),Sh=R0(),K0=on(),Ah=Y0(),Fh=(e,t)=>{let o=e.versionMadeBy>>8;return(t&61440)===40960?"symlink":(t&61440)===16384||o===0&&e.externalFileAttributes===16?"directory":"file"},Oh=(e,t)=>{let r={mode:e.externalFileAttributes>>16&65535,mtime:e.getLastModDate(),path:e.fileName};return r.type=Fh(e,r.mode),r.mode===0&&r.type==="directory"&&(r.mode=493),r.mode===0&&(r.mode=420),K0(t.openReadStream.bind(t))(e).then(Sh.buffer).then(i=>(r.data=i,r.type==="symlink"&&(r.linkname=i.toString()),r)).catch(i=>{throw t.close(),i})},Rh=e=>new Promise((t,r)=>{let i=[];e.readEntry(),e.on("entry",n=>{Oh(n,e).catch(r).then(o=>{i.push(o),e.readEntry()})}),e.on("error",r),e.on("end",()=>t(i))});V0.exports=()=>e=>Buffer.isBuffer(e)?!Z0(e)||Z0(e).ext!=="zip"?Promise.resolve([]):K0(Ah.fromBuffer)(e,{lazyEntries:!0}).then(Rh):Promise.reject(new TypeError(`Expected a Buffer, got ${typeof e}`))});var eu=d((Qm,Q0)=>{"use strict";var J0=(e,t)=>function(){let r=t.promiseModule,i=new Array(arguments.length);for(let n=0;n<arguments.length;n++)i[n]=arguments[n];return new r((n,o)=>{t.errorFirst?i.push(function(a,s){if(t.multiArgs){let f=new Array(arguments.length-1);for(let c=1;c<arguments.length;c++)f[c-1]=arguments[c];a?(f.unshift(a),o(f)):n(f)}else a?o(a):n(s)}):i.push(function(a){if(t.multiArgs){let s=new Array(arguments.length-1);for(let f=0;f<arguments.length;f++)s[f]=arguments[f];n(s)}else n(a)}),e.apply(this,i)})};Q0.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=n=>{let o=a=>typeof a=="string"?n===a:a.test(n);return t.include?t.include.some(o):!t.exclude.some(o)},i;typeof e=="function"?i=function(){return t.excludeMain?e.apply(this,arguments):J0(e,t).apply(this,arguments)}:i=Object.create(Object.getPrototypeOf(e));for(let n in e){let o=e[n];i[n]=typeof o=="function"&&r(n)?J0(o,t):o}return i}});var nu=d((ey,hn)=>{"use strict";var Ph=require("fs"),qe=require("path"),tu=eu(),ru={mode:511&~process.umask(),fs:Ph},iu=e=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(qe.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}};hn.exports=(e,t)=>Promise.resolve().then(()=>{iu(e),t=Object.assign({},ru,t);let r=tu(t.fs.mkdir),i=tu(t.fs.stat),n=o=>r(o,t.mode).then(()=>o).catch(a=>{if(a.code==="ENOENT"){if(a.message.includes("null bytes")||qe.dirname(o)===o)throw a;return n(qe.dirname(o)).then(()=>n(o))}return i(o).then(s=>s.isDirectory()?o:Promise.reject()).catch(()=>{throw a})});return n(qe.resolve(e))});hn.exports.sync=(e,t)=>{iu(e),t=Object.assign({},ru,t);let r=i=>{try{t.fs.mkdirSync(i,t.mode)}catch(n){if(n.code==="ENOENT"){if(n.message.includes("null bytes")||qe.dirname(i)===i)throw n;return r(qe.dirname(i)),r(i)}try{if(!t.fs.statSync(i).isDirectory())throw new Error("The path is not a directory")}catch{throw n}}return i};return r(qe.resolve(e))}});var au=d((ty,ou)=>{"use strict";ou.exports=function(t,r){if(r){if(typeof r!="object")throw new TypeError(String(r)+" is not an object. Expected an object that has boolean `includeZero` property.");if("includeZero"in r){if(typeof r.includeZero!="boolean")throw new TypeError(String(r.includeZero)+" is neither true nor false. `includeZero` option must be a Boolean value.");if(r.includeZero&&t===0)return!0}}return Number.isSafeInteger(t)&&t>=1}});var fu=d((ry,su)=>{"use strict";var Bt=require("path"),Ct=require("util"),Th=au();su.exports=function(t,r,i){if(typeof t!="string")throw new TypeError(Ct.inspect(t)+" is not a string. First argument to strip-dirs must be a path string.");if(Bt.posix.isAbsolute(t)||Bt.win32.isAbsolute(t))throw new Error(`${t} is an absolute path. strip-dirs requires a relative path.`);if(!Th(r,{includeZero:!0}))throw new Error("The Second argument of strip-dirs must be a natural number or 0, but received "+Ct.inspect(r)+".");if(i){if(typeof i!="object")throw new TypeError(Ct.inspect(i)+" is not an object. Expected an object with a boolean `disallowOverflow` property.");if(Array.isArray(i))throw new TypeError(Ct.inspect(i)+" is an array. Expected an object with a boolean `disallowOverflow` property.");if("disallowOverflow"in i&&typeof i.disallowOverflow!="boolean")throw new TypeError(Ct.inspect(i.disallowOverflow)+" is neither true nor false. `disallowOverflow` option must be a Boolean value.")}else i={disallowOverflow:!1};let n=Bt.normalize(t).split(Bt.sep);if(n.length>1&&n[0]==="."&&n.shift(),r>n.length-1){if(i.disallowOverflow)throw new RangeError("Cannot strip more directories than there are.");r=n.length-1}return Bt.join.apply(null,n.slice(r))}});var lu=d((iy,uu)=>{"use strict";var Ur=require("path"),Bh=In(),Ch=Er(),qh=s0(),Dh=l0(),Ih=X0(),pn=nu(),kh=on(),jh=fu(),ee=kh(Bh),Nh=(e,t)=>t.plugins.length===0?Promise.resolve([]):Promise.all(t.plugins.map(r=>r(e,t))).then(r=>r.reduce((i,n)=>i.concat(n))),mn=(e,t)=>ee.realpath(e).catch(r=>{let i=Ur.dirname(e);return mn(i,t)}).then(r=>{if(r.indexOf(t)!==0)throw new Error("Refusing to create a directory outside the output path.");return pn(e).then(ee.realpath)}),Uh=(e,t)=>ee.readlink(e).catch(r=>null).then(r=>{if(r)throw new Error("Refusing to write into a symlink");return t}),Lh=(e,t,r)=>Nh(e,r).then(i=>(r.strip>0&&(i=i.map(n=>(n.path=jh(n.path,r.strip),n)).filter(n=>n.path!==".")),typeof r.filter=="function"&&(i=i.filter(r.filter)),typeof r.map=="function"&&(i=i.map(r.map)),t?Promise.all(i.map(n=>{let o=Ur.join(t,n.path),a=n.mode&~process.umask(),s=new Date;return n.type==="directory"?pn(t).then(f=>ee.realpath(f)).then(f=>mn(o,f)).then(()=>ee.utimes(o,s,n.mtime)).then(()=>n):pn(t).then(f=>ee.realpath(f)).then(f=>mn(Ur.dirname(o),f).then(()=>f)).then(f=>n.type==="file"?Uh(o,f):f).then(f=>ee.realpath(Ur.dirname(o)).then(c=>{if(c.indexOf(f)!==0)throw new Error("Refusing to write outside output directory: "+c)})).then(()=>n.type==="link"||n.type==="symlink"&&process.platform==="win32"?ee.link(n.linkname,o):n.type==="symlink"?ee.symlink(n.linkname,o):ee.writeFile(o,n.data,{mode:a})).then(()=>n.type==="file"&&ee.utimes(o,s,n.mtime)).then(()=>n)})):i));uu.exports=(e,t,r)=>typeof e!="string"&&!Buffer.isBuffer(e)?Promise.reject(new TypeError("Input file required")):(typeof t=="object"&&(r=t,t=null),r=Object.assign({plugins:[Ch(),qh(),Dh(),Ih()]},r),(typeof e=="string"?ee.readFile(e):Promise.resolve(e)).then(n=>Lh(n,t,r)))});var $h={};gu($h,{AZUREAUTH_NAME:()=>vn,install:()=>hu});module.exports=wu($h);var st=jt(require("node:path"),1),me=jt(require("node:fs"),1),xu=jt(Sn(),1),du=jt(lu(),1),zh="0.8.4";async function Mh(e,t){let r=new xu.DownloaderHelper(e,t);return new Promise((i,n)=>{r.on("end",()=>i()),r.on("error",o=>n(o)),r.on("progress.throttled",o=>{let a=o.progress<100?o.progress.toPrecision(2):100;console.info(`Downloaded: ${a}%`)}),r.start()})}var Dt=process.platform,cu=process.arch,qt={name:"azureauth",url:"https://github.com/AzureAD/microsoft-authentication-cli/releases/download/",version:zh},yn={def:"azureauth",win32:"azureauth.exe",linux:"azureauth.exe"},vn=Dt in yn?yn[Dt]:yn.def,hu=async()=>{let e=st.default.join(__dirname,"..","bin"),t=i=>{try{return me.default.existsSync(i)}catch{return!1}};if(me.default.existsSync(e)||(me.default.mkdirSync(e,{recursive:!0}),console.info(`${e} directory was created`)),t(st.default.join(e,"azureauth",vn))){console.log("azureauth is already installed");return}let r={win32:{x64:`azureauth-${qt.version}-win10-x64.zip`},darwin:{x64:`azureauth-${qt.version}-osx-x64.tar.gz`,arm64:`azureauth-${qt.version}-osx-arm64.tar.gz`}};if(Dt in r){let i="";if(cu in r[Dt])i=r[Dt][cu];else throw new Error("Arch is not supported in azureauth");let n=`${qt.url}${qt.version}/${i}`,o=st.default.join(e,"azureauth"),a=st.default.join(e,i);console.log(`Downloading azureauth from ${n}`);try{await Mh(n,e)}catch(f){throw new Error(`Download failed: ${f.message}`)}console.log(`Downloaded in ${e}`),me.default.mkdirSync(o,{recursive:!0});let s=st.default.join(o,vn);await(0,du.default)(a,o),t(s)&&(me.default.chmodSync(s,me.default.constants.S_IXUSR||64),me.default.chmodSync(s,493)),console.log(`Unzipped in ${a}`),me.default.unlinkSync(a)}};async function Wh(){for(let t=0;t<3;t++){try{await hu();break}catch(r){console.log(`Install failed: ${r.message}`)}if(t===2)throw new Error("Install failed after 3 attempts")}}Wh().catch(e=>{console.error(e),process.exit(1)});0&&(module.exports={AZUREAUTH_NAME,install});
5
+ `);return od(t)};tt.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var i=parseInt(e.slice(0,r).toString(),10);if(!i)return t;var n=e.slice(r+1,i-1).toString(),o=n.indexOf("=");if(o===-1)return t;t[n.slice(0,o)]=n.slice(o+1),e=e.slice(i)}return t};tt.encode=function(e){var t=ad(512),r=e.name,i="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var n=r.indexOf("/");if(n===-1)return null;i+=i?"/"+r.slice(0,n):r.slice(0,n),r=r.slice(n+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(i)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(ve(e.mode&ld,6),100),t.write(ve(e.uid,6),108),t.write(ve(e.gid,6),116),t.write(ve(e.size,11),124),t.write(ve(e.mtime.getTime()/1e3|0,11),136),t[156]=Qs+dd(e.type),e.linkname&&t.write(e.linkname,157),t.write(ud,257),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(ve(e.devmajor||0,6),329),t.write(ve(e.devminor||0,6),337),i&&t.write(i,345),t.write(ve(tf(t),6),148),t)};tt.decode=function(e,t){var r=e[156]===0?0:e[156]-Qs,i=et(e,0,100,t),n=_e(e,100,8),o=_e(e,108,8),a=_e(e,116,8),s=_e(e,124,12),f=_e(e,136,12),c=xd(r),l=e[157]===0?null:et(e,157,100,t),x=et(e,265,32),u=et(e,297,32),h=_e(e,329,8),m=_e(e,337,8);e[345]&&(i=et(e,345,155,t)+"/"+i),r===0&&i&&i[i.length-1]==="/"&&(r=5);var y=tf(e);if(y===256)return null;if(y!==_e(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");return{name:i,mode:n,uid:o,gid:a,size:s,mtime:new Date(1e3*f),type:c,linkname:l,uname:x,gname:u,devmajor:h,devminor:m}}});var uf=d((bm,ff)=>{var nf=require("util"),pd=Do(),md=ko(),wt=$i(),of=We().Writable,af=We().PassThrough,sf=function(){},rf=function(e){return e&=511,e&&512-e},yd=function(e,t){var r=new yr(e,t);return r.end(),r},vd=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},yr=function(e,t){this._parent=e,this.offset=t,af.call(this)};nf.inherits(yr,af);yr.prototype.destroy=function(e){this._parent.destroy(e)};var de=function(e){if(!(this instanceof de))return new de(e);of.call(this,e),e=e||{},this._offset=0,this._buffer=pd(),this._missing=0,this._partial=!1,this._onparse=sf,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,i=function(){t._continue()},n=function(u){if(t._locked=!1,u)return t.destroy(u);t._stream||i()},o=function(){t._stream=null;var u=rf(t._header.size);u?t._parse(u,a):t._parse(512,x),t._locked||i()},a=function(){t._buffer.consume(rf(t._header.size)),t._parse(512,x),i()},s=function(){var u=t._header.size;t._paxGlobal=wt.decodePax(r.slice(0,u)),r.consume(u),o()},f=function(){var u=t._header.size;t._pax=wt.decodePax(r.slice(0,u)),t._paxGlobal&&(t._pax=md(t._paxGlobal,t._pax)),r.consume(u),o()},c=function(){var u=t._header.size;this._gnuLongPath=wt.decodeLongPath(r.slice(0,u),e.filenameEncoding),r.consume(u),o()},l=function(){var u=t._header.size;this._gnuLongLinkPath=wt.decodeLongPath(r.slice(0,u),e.filenameEncoding),r.consume(u),o()},x=function(){var u=t._offset,h;try{h=t._header=wt.decode(r.slice(0,512),e.filenameEncoding)}catch(m){t.emit("error",m)}if(r.consume(512),!h){t._parse(512,x),i();return}if(h.type==="gnu-long-path"){t._parse(h.size,c),i();return}if(h.type==="gnu-long-link-path"){t._parse(h.size,l),i();return}if(h.type==="pax-global-header"){t._parse(h.size,s),i();return}if(h.type==="pax-header"){t._parse(h.size,f),i();return}if(t._gnuLongPath&&(h.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(h.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=h=vd(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,x),t.emit("entry",h,yd(t,u),n);return}t._stream=new yr(t,u),t.emit("entry",h,t._stream,n),t._parse(h.size,o),i()};this._onheader=x,this._parse(512,x)};nf.inherits(de,of);de.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};de.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};de.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=sf,this._overflow?this._write(this._overflow,void 0,e):e()}};de.prototype._write=function(e,t,r){if(!this._destroyed){var i=this._stream,n=this._buffer,o=this._missing;if(e.length&&(this._partial=!0),e.length<o)return this._missing-=e.length,this._overflow=null,i?i.write(e,r):(n.append(e),r());this._cb=r,this._missing=0;var a=null;e.length>o&&(a=e.slice(o),e=e.slice(0,o)),i?i.end(e):n.append(e),this._overflow=a,this._onparse()}};de.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};ff.exports=de});var cf=d((Em,lf)=>{lf.exports=require("fs").constants||require("constants")});var hf=d((Sm,df)=>{df.exports=xf;function xf(e,t){if(e&&t)return xf(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(i){r[i]=e[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=e.apply(this,i),a=i[i.length-1];return typeof o=="function"&&o!==a&&Object.keys(a).forEach(function(s){o[s]=a[s]}),o}}});var yf=d((Am,Hi)=>{var pf=hf();Hi.exports=pf(vr);Hi.exports.strict=pf(mf);vr.proto=vr(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return vr(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return mf(this)},configurable:!0})});function vr(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function mf(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var gf=d((Fm,_f)=>{var _d=yf(),gd=function(){},wd=global.Bare?queueMicrotask:process.nextTick.bind(process),bd=function(e){return e.setHeader&&typeof e.abort=="function"},Ed=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},vf=function(e,t,r){if(typeof t=="function")return vf(e,null,t);t||(t={}),r=_d(r||gd);var i=e._writableState,n=e._readableState,o=t.readable||t.readable!==!1&&e.readable,a=t.writable||t.writable!==!1&&e.writable,s=!1,f=function(){e.writable||c()},c=function(){a=!1,o||r.call(e)},l=function(){o=!1,a||r.call(e)},x=function(p){r.call(e,p?new Error("exited with error code: "+p):null)},u=function(p){r.call(e,p)},h=function(){wd(m)},m=function(){if(!s){if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"));if(a&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"))}},y=function(){e.req.on("finish",c)};return bd(e)?(e.on("complete",c),e.on("abort",h),e.req?y():e.on("request",y)):a&&!i&&(e.on("end",f),e.on("close",f)),Ed(e)&&e.on("exit",x),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",u),e.on("close",h),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",h),e.removeListener("request",y),e.req&&e.req.removeListener("finish",c),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",c),e.removeListener("exit",x),e.removeListener("end",l),e.removeListener("error",u),e.removeListener("close",h)}};_f.exports=vf});var Af=d((Om,Sf)=>{var rt=cf(),wf=gf(),gr=require("util"),Sd=Mi(),Ad=zi(),bf=We().Readable,it=We().Writable,Fd=require("string_decoder").StringDecoder,_r=$i(),Od=parseInt("755",8),Rd=parseInt("644",8),Ef=Sd(1024),Yi=function(){},Gi=function(e,t){t&=511,t&&e.push(Ef.slice(0,512-t))};function Pd(e){switch(e&rt.S_IFMT){case rt.S_IFBLK:return"block-device";case rt.S_IFCHR:return"character-device";case rt.S_IFDIR:return"directory";case rt.S_IFIFO:return"fifo";case rt.S_IFLNK:return"symlink"}return"file"}var wr=function(e){it.call(this),this.written=0,this._to=e,this._destroyed=!1};gr.inherits(wr,it);wr.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};wr.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var br=function(){it.call(this),this.linkname="",this._decoder=new Fd("utf-8"),this._destroyed=!1};gr.inherits(br,it);br.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};br.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var bt=function(){it.call(this),this._destroyed=!1};gr.inherits(bt,it);bt.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};bt.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var oe=function(e){if(!(this instanceof oe))return new oe(e);bf.call(this,e),this._drain=Yi,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};gr.inherits(oe,bf);oe.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=Yi);var i=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=Pd(e.mode)),e.mode||(e.mode=e.type==="directory"?Od:Rd),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Ad(t)),Buffer.isBuffer(t))return e.size=t.length,this._encode(e),this.push(t),Gi(i,e.size),process.nextTick(r),new bt;if(e.type==="symlink"&&!e.linkname){var n=new br;return wf(n,function(a){if(a)return i.destroy(),r(a);e.linkname=n.linkname,i._encode(e),r()}),n}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new bt;var o=new wr(this);return this._stream=o,wf(o,function(a){if(i._stream=null,a)return i.destroy(),r(a);if(o.written!==e.size)return i.destroy(),r(new Error("size mismatch"));Gi(i,e.size),i._finalizing&&i.finalize(),r()}),o}};oe.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Ef),this.push(null))};oe.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};oe.prototype._encode=function(e){if(!e.pax){var t=_r.encode(e);if(t){this.push(t);return}}this._encodePax(e)};oe.prototype._encodePax=function(e){var t=_r.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(_r.encode(r)),this.push(t),Gi(this,t.length),r.size=e.size,r.type=e.type,this.push(_r.encode(r))};oe.prototype._read=function(e){var t=this._drain;this._drain=Yi,t()};Sf.exports=oe});var Ff=d(Zi=>{Zi.extract=uf();Zi.pack=Af()});var Er=d((Pm,Rf)=>{"use strict";var Of=Zr(),Td=Wt(),Bd=Ff();Rf.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!Td(e))return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`));if(Buffer.isBuffer(e)&&(!Of(e)||Of(e).ext!=="tar"))return Promise.resolve([]);let t=Bd.extract(),r=[];t.on("entry",(n,o,a)=>{let s=[];o.on("data",f=>s.push(f)),o.on("end",()=>{let f={data:Buffer.concat(s),mode:n.mode,mtime:n.mtime,path:n.name,type:n.type};(n.type==="symlink"||n.type==="link")&&(f.linkname=n.linkname),r.push(f),a()})});let i=new Promise((n,o)=>{Buffer.isBuffer(e)||e.on("error",o),t.on("finish",()=>n(r)),t.on("error",o)});return t.then=i.then.bind(i),t.catch=i.catch.bind(i),Buffer.isBuffer(e)?t.end(e):e.pipe(t),t}});var Tf=d((Tm,Pf)=>{"use strict";var nt=e=>Array.from(e).map(t=>t.charCodeAt(0)),Cd=nt("META-INF/mozilla.rsa"),qd=nt("[Content_Types].xml"),Dd=nt("_rels/.rels");Pf.exports=e=>{let t=new Uint8Array(e);if(!(t&&t.length>1))return null;let r=(i,n)=>{n=Object.assign({offset:0},n);for(let o=0;o<i.length;o++)if(n.mask){if(i[o]!==(n.mask[o]&t[o+n.offset]))return!1}else if(i[o]!==t[o+n.offset])return!1;return!0};if(r([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(r([137,80,78,71,13,10,26,10]))return{ext:"png",mime:"image/png"};if(r([71,73,70]))return{ext:"gif",mime:"image/gif"};if(r([87,69,66,80],{offset:8}))return{ext:"webp",mime:"image/webp"};if(r([70,76,73,70]))return{ext:"flif",mime:"image/flif"};if((r([73,73,42,0])||r([77,77,0,42]))&&r([67,82],{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r([73,73,42,0])||r([77,77,0,42]))return{ext:"tif",mime:"image/tiff"};if(r([66,77]))return{ext:"bmp",mime:"image/bmp"};if(r([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(r([56,66,80,83]))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(r([80,75,3,4])){if(r([109,105,109,101,116,121,112,101,97,112,112,108,105,99,97,116,105,111,110,47,101,112,117,98,43,122,105,112],{offset:30}))return{ext:"epub",mime:"application/epub+zip"};if(r(Cd,{offset:30}))return{ext:"xpi",mime:"application/x-xpinstall"};if(r(qd,{offset:30})||r(Dd,{offset:30})){let i=t.subarray(4,2004),n=a=>a.findIndex((s,f,c)=>c[f]===80&&c[f+1]===75&&c[f+2]===3&&c[f+3]===4),o=n(i);if(o!==-1){let a=t.subarray(o+8,o+8+1e3),s=n(a);if(s!==-1){let f=8+o+s+30;if(r(nt("word/"),{offset:f}))return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(r(nt("ppt/"),{offset:f}))return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(r(nt("xl/"),{offset:f}))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}}}if(r([80,75])&&(t[2]===3||t[2]===5||t[2]===7)&&(t[3]===4||t[3]===6||t[3]===8))return{ext:"zip",mime:"application/zip"};if(r([117,115,116,97,114],{offset:257}))return{ext:"tar",mime:"application/x-tar"};if(r([82,97,114,33,26,7])&&(t[6]===0||t[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(r([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(r([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(r([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(r([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(r([51,103,112,53])||r([0,0,0])&&r([102,116,121,112],{offset:4})&&(r([109,112,52,49],{offset:8})||r([109,112,52,50],{offset:8})||r([105,115,111,109],{offset:8})||r([105,115,111,50],{offset:8})||r([109,109,112,52],{offset:8})||r([77,52,86],{offset:8})||r([100,97,115,104],{offset:8})))return{ext:"mp4",mime:"video/mp4"};if(r([77,84,104,100]))return{ext:"mid",mime:"audio/midi"};if(r([26,69,223,163])){let i=t.subarray(4,4100),n=i.findIndex((o,a,s)=>s[a]===66&&s[a+1]===130);if(n!==-1){let o=n+3,a=s=>Array.from(s).every((f,c)=>i[o+c]===f.charCodeAt(0));if(a("matroska"))return{ext:"mkv",mime:"video/x-matroska"};if(a("webm"))return{ext:"webm",mime:"video/webm"}}}if(r([0,0,0,20,102,116,121,112,113,116,32,32])||r([102,114,101,101],{offset:4})||r([102,116,121,112,113,116,32,32],{offset:4})||r([109,100,97,116],{offset:4})||r([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(r([82,73,70,70])&&r([65,86,73],{offset:8}))return{ext:"avi",mime:"video/x-msvideo"};if(r([48,38,178,117,142,102,207,17,166,217]))return{ext:"wmv",mime:"video/x-ms-wmv"};if(r([0,0,1,186]))return{ext:"mpg",mime:"video/mpeg"};for(let i=0;i<2&&i<t.length-16;i++)if(r([73,68,51],{offset:i})||r([255,226],{offset:i,mask:[255,226]}))return{ext:"mp3",mime:"audio/mpeg"};return r([102,116,121,112,77,52,65],{offset:4})||r([77,52,65,32])?{ext:"m4a",mime:"audio/m4a"}:r([79,112,117,115,72,101,97,100],{offset:28})?{ext:"opus",mime:"audio/opus"}:r([79,103,103,83])?{ext:"ogg",mime:"audio/ogg"}:r([102,76,97,67])?{ext:"flac",mime:"audio/x-flac"}:r([82,73,70,70])&&r([87,65,86,69],{offset:8})?{ext:"wav",mime:"audio/x-wav"}:r([35,33,65,77,82,10])?{ext:"amr",mime:"audio/amr"}:r([37,80,68,70])?{ext:"pdf",mime:"application/pdf"}:r([77,90])?{ext:"exe",mime:"application/x-msdownload"}:(t[0]===67||t[0]===70)&&r([87,83],{offset:1})?{ext:"swf",mime:"application/x-shockwave-flash"}:r([123,92,114,116,102])?{ext:"rtf",mime:"application/rtf"}:r([0,97,115,109])?{ext:"wasm",mime:"application/wasm"}:r([119,79,70,70])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff",mime:"font/woff"}:r([119,79,70,50])&&(r([0,1,0,0],{offset:4})||r([79,84,84,79],{offset:4}))?{ext:"woff2",mime:"font/woff2"}:r([76,80],{offset:34})&&(r([0,0,1],{offset:8})||r([1,0,2],{offset:8})||r([2,0,2],{offset:8}))?{ext:"eot",mime:"application/octet-stream"}:r([0,1,0,0,0])?{ext:"ttf",mime:"font/ttf"}:r([79,84,84,79,0])?{ext:"otf",mime:"font/otf"}:r([0,0,1,0])?{ext:"ico",mime:"image/x-icon"}:r([70,76,86,1])?{ext:"flv",mime:"video/x-flv"}:r([37,33])?{ext:"ps",mime:"application/postscript"}:r([253,55,122,88,90,0])?{ext:"xz",mime:"application/x-xz"}:r([83,81,76,105])?{ext:"sqlite",mime:"application/x-sqlite3"}:r([78,69,83,26])?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:r([67,114,50,52])?{ext:"crx",mime:"application/x-google-chrome-extension"}:r([77,83,67,70])||r([73,83,99,40])?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:r([33,60,97,114,99,104,62,10,100,101,98,105,97,110,45,98,105,110,97,114,121])?{ext:"deb",mime:"application/x-deb"}:r([33,60,97,114,99,104,62])?{ext:"ar",mime:"application/x-unix-archive"}:r([237,171,238,219])?{ext:"rpm",mime:"application/x-rpm"}:r([31,160])||r([31,157])?{ext:"Z",mime:"application/x-compress"}:r([76,90,73,80])?{ext:"lz",mime:"application/x-lzip"}:r([208,207,17,224,161,177,26,225])?{ext:"msi",mime:"application/x-msi"}:r([6,14,43,52,2,5,1,1,13,1,2,1,1,2])?{ext:"mxf",mime:"application/mxf"}:r([71],{offset:4})&&(r([71],{offset:192})||r([71],{offset:196}))?{ext:"mts",mime:"video/mp2t"}:r([66,76,69,78,68,69,82])?{ext:"blend",mime:"application/x-blender"}:r([66,80,71,251])?{ext:"bpg",mime:"image/bpg"}:null}});var qf=d((Bm,Cf)=>{var Bf=[0,1,3,7,15,31,63,127,255],Et=function(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1};Et.prototype._ensureByte=function(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)};Et.prototype.read=function(e){for(var t=0;e>0;){this._ensureByte();var r=8-this.bitOffset;if(e>=r)t<<=r,t|=Bf[r]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=r;else{t<<=e;var i=r-e;t|=(this.curByte&Bf[e]<<i)>>i,this.bitOffset+=e,e=0}}return t};Et.prototype.seek=function(e){var t=e%8,r=(e-t)/8;this.bitOffset=t,this.stream.seek(r),this.hasByte=!1};Et.prototype.pi=function(){var e=new Buffer(6),t;for(t=0;t<e.length;t++)e[t]=this.read(8);return e.toString("hex")};Cf.exports=Et});var If=d((Cm,Df)=>{var Ce=function(){};Ce.prototype.readByte=function(){throw new Error("abstract method readByte() not implemented")};Ce.prototype.read=function(e,t,r){for(var i=0;i<r;){var n=this.readByte();if(n<0)return i===0?-1:i;e[t++]=n,i++}return i};Ce.prototype.seek=function(e){throw new Error("abstract method seek() not implemented")};Ce.prototype.writeByte=function(e){throw new Error("abstract method readByte() not implemented")};Ce.prototype.write=function(e,t,r){var i;for(i=0;i<r;i++)this.writeByte(e[t++]);return r};Ce.prototype.flush=function(){};Df.exports=Ce});var jf=d((qm,kf)=>{kf.exports=(function(){var e=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]),t=function(){var r=4294967295;this.getCRC=function(){return~r>>>0},this.updateCRC=function(i){r=r<<8^e[(r>>>24^i)&255]},this.updateCRCRun=function(i,n){for(;n-- >0;)r=r<<8^e[(r>>>24^i)&255]}};return t})()});var Nf=d((Dm,Id)=>{Id.exports={name:"seek-bzip",version:"1.0.6",contributors:["C. Scott Ananian (http://cscott.net)","Eli Skeggs","Kevin Kwok","Rob Landley (http://landley.net)"],description:"a pure-JavaScript Node.JS module for random-access decoding bzip2 data",main:"./lib/index.js",repository:{type:"git",url:"https://github.com/cscott/seek-bzip.git"},license:"MIT",bin:{"seek-bunzip":"./bin/seek-bunzip","seek-table":"./bin/seek-bzip-table"},directories:{test:"test"},dependencies:{commander:"^2.8.1"},devDependencies:{fibers:"~1.0.6",mocha:"~2.2.5"},scripts:{test:"mocha"}}});var Gf=d((Im,Hf)=>{var kd=qf(),St=If(),Mf=jf(),Wf=Nf(),Sr=20,Uf=258,Lf=0,jd=1,Nd=2,Ud=6,Ld=50,zd="314159265359",Md="177245385090",zf=function(e,t){var r=e[t],i;for(i=t;i>0;i--)e[i]=e[i-1];return e[0]=r,r},k={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},ge={};ge[k.LAST_BLOCK]="Bad file checksum";ge[k.NOT_BZIP_DATA]="Not bzip data";ge[k.UNEXPECTED_INPUT_EOF]="Unexpected input EOF";ge[k.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF";ge[k.DATA_ERROR]="Data error";ge[k.OUT_OF_MEMORY]="Out of memory";ge[k.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";var Y=function(e,t){var r=ge[e]||"unknown error";t&&(r+=": "+t);var i=new TypeError(r);throw i.errorCode=e,i},X=function(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)};X.prototype._init_block=function(){var e=this._get_next_block();return e?(this.blockCRC=new Mf,!0):(this.writeCount=-1,!1)};X.prototype._start_bunzip=function(e,t){var r=new Buffer(4);(e.read(r,0,4)!==4||String.fromCharCode(r[0],r[1],r[2])!=="BZh")&&Y(k.NOT_BZIP_DATA,"bad magic");var i=r[3]-48;(i<1||i>9)&&Y(k.NOT_BZIP_DATA,"level out of range"),this.reader=new kd(e),this.dbufSize=1e5*i,this.nextoutput=0,this.outputStream=t,this.streamCRC=0};X.prototype._get_next_block=function(){var e,t,r,i=this.reader,n=i.pi();if(n===Md)return!1;n!==zd&&Y(k.NOT_BZIP_DATA),this.targetBlockCRC=i.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,i.read(1)&&Y(k.OBSOLETE_INPUT);var o=i.read(24);o>this.dbufSize&&Y(k.DATA_ERROR,"initial position out of bounds");var a=i.read(16),s=new Buffer(256),f=0;for(e=0;e<16;e++)if(a&1<<15-e){var c=e*16;for(r=i.read(16),t=0;t<16;t++)r&1<<15-t&&(s[f++]=c+t)}var l=i.read(3);(l<Nd||l>Ud)&&Y(k.DATA_ERROR);var x=i.read(15);x===0&&Y(k.DATA_ERROR);var u=new Buffer(256);for(e=0;e<l;e++)u[e]=e;var h=new Buffer(x);for(e=0;e<x;e++){for(t=0;i.read(1);t++)t>=l&&Y(k.DATA_ERROR);h[e]=zf(u,t)}var m=f+2,y=[],p;for(t=0;t<l;t++){var _=new Buffer(m),g=new Uint16Array(Sr+1);for(a=i.read(5),e=0;e<m;e++){for(;(a<1||a>Sr)&&Y(k.DATA_ERROR),!!i.read(1);)i.read(1)?a--:a++;_[e]=a}var E,N;for(E=N=_[0],e=1;e<m;e++)_[e]>N?N=_[e]:_[e]<E&&(E=_[e]);p={},y.push(p),p.permute=new Uint16Array(Uf),p.limit=new Uint32Array(Sr+2),p.base=new Uint32Array(Sr+1),p.minLen=E,p.maxLen=N;var R=0;for(e=E;e<=N;e++)for(g[e]=p.limit[e]=0,a=0;a<m;a++)_[a]===e&&(p.permute[R++]=a);for(e=0;e<m;e++)g[_[e]]++;for(R=a=0,e=E;e<N;e++)R+=g[e],p.limit[e]=R-1,R<<=1,a+=g[e],p.base[e+1]=R-a;p.limit[N+1]=Number.MAX_VALUE,p.limit[N]=R+g[N]-1,p.base[E]=0}var J=new Uint32Array(256);for(e=0;e<256;e++)u[e]=e;var j=0,z=0,v=0,w,b=this.dbuf=new Uint32Array(this.dbufSize);for(m=0;;){for(m--||(m=Ld-1,v>=x&&Y(k.DATA_ERROR),p=y[h[v++]]),e=p.minLen,t=i.read(e);e>p.maxLen&&Y(k.DATA_ERROR),!(t<=p.limit[e]);e++)t=t<<1|i.read(1);t-=p.base[e],(t<0||t>=Uf)&&Y(k.DATA_ERROR);var C=p.permute[t];if(C===Lf||C===jd){j||(j=1,a=0),C===Lf?a+=j:a+=2*j,j<<=1;continue}if(j)for(j=0,z+a>this.dbufSize&&Y(k.DATA_ERROR),w=s[u[0]],J[w]+=a;a--;)b[z++]=w;if(C>f)break;z>=this.dbufSize&&Y(k.DATA_ERROR),e=C-1,w=zf(u,e),w=s[w],J[w]++,b[z++]=w}for((o<0||o>=z)&&Y(k.DATA_ERROR),t=0,e=0;e<256;e++)r=t+J[e],J[e]=t,t=r;for(e=0;e<z;e++)w=b[e]&255,b[J[w]]|=e<<8,J[w]++;var q=0,B=0,A=0;return z&&(q=b[o],B=q&255,q>>=8,A=-1),this.writePos=q,this.writeCurrent=B,this.writeCount=z,this.writeRun=A,!0};X.prototype._read_bunzip=function(e,t){var r,i,n;if(this.writeCount<0)return 0;for(var o=0,a=this.dbuf,s=this.writePos,f=this.writeCurrent,c=this.writeCount,l=this.outputsize,x=this.writeRun;c;){for(c--,i=f,s=a[s],f=s&255,s>>=8,x++===3?(r=f,n=i,f=-1):(r=1,n=f),this.blockCRC.updateCRCRun(n,r);r--;)this.outputStream.writeByte(n),this.nextoutput++;f!=i&&(x=0)}return this.writeCount=c,this.blockCRC.getCRC()!==this.targetBlockCRC&&Y(k.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput};var Ki=function(e){if("readByte"in e)return e;var t=new St;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(r){this.pos=r},t.eof=function(){return this.pos>=e.length},t},$f=function(e){var t=new St,r=!0;if(e)if(typeof e=="number")t.buffer=new Buffer(e),r=!1;else{if("writeByte"in e)return e;t.buffer=e,r=!1}else t.buffer=new Buffer(16384);return t.pos=0,t.writeByte=function(i){if(r&&this.pos>=this.buffer.length){var n=new Buffer(this.buffer.length*2);this.buffer.copy(n),this.buffer=n}this.buffer[this.pos++]=i},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!r)throw new TypeError("outputsize does not match decoded input");var i=new Buffer(this.pos);this.buffer.copy(i,0,0,this.pos),this.buffer=i}return this.buffer},t._coerced=!0,t};X.Err=k;X.decode=function(e,t,r){for(var i=Ki(e),n=$f(t),o=new X(i,n);!("eof"in i&&i.eof());)if(o._init_block())o._read_bunzip();else{var a=o.reader.read(32)>>>0;if(a!==o.streamCRC&&Y(k.DATA_ERROR,"Bad stream CRC (got "+o.streamCRC.toString(16)+" expected "+a.toString(16)+")"),r&&"eof"in i&&!i.eof())o._start_bunzip(i,n);else break}if("getBuffer"in n)return n.getBuffer()};X.decodeBlock=function(e,t,r){var i=Ki(e),n=$f(r),o=new X(i,n);o.reader.seek(t);var a=o._get_next_block();if(a&&(o.blockCRC=new Mf,o.writeCopies=0,o._read_bunzip()),"getBuffer"in n)return n.getBuffer()};X.table=function(e,t,r){var i=new St;i.delegate=Ki(e),i.pos=0,i.readByte=function(){return this.pos++,this.delegate.readByte()},i.delegate.eof&&(i.eof=i.delegate.eof.bind(i.delegate));var n=new St;n.pos=0,n.writeByte=function(){this.pos++};for(var o=new X(i,n),a=o.dbufSize;!("eof"in i&&i.eof());){var s=i.pos*8+o.reader.bitOffset;if(o.reader.hasByte&&(s-=8),o._init_block()){var f=n.pos;o._read_bunzip(),t(s,n.pos-f)}else{var c=o.reader.read(32);if(r&&"eof"in i&&!i.eof())o._start_bunzip(i,n),console.assert(o.dbufSize===a,"shouldn't change block size within multistream file");else break}}};X.Stream=St;X.version=Wf.version;X.license=Wf.license;Hf.exports=X});var Kf=d((Yf,Zf)=>{var Wd=require("stream");Yf=Zf.exports=Vi;Vi.through=Vi;function Vi(e,t,r){e=e||function(l){this.queue(l)},t=t||function(){this.queue(null)};var i=!1,n=!1,o=[],a=!1,s=new Wd;s.readable=s.writable=!0,s.paused=!1,s.autoDestroy=!(r&&r.autoDestroy===!1),s.write=function(l){return e.call(this,l),!s.paused};function f(){for(;o.length&&!s.paused;){var l=o.shift();if(l===null)return s.emit("end");s.emit("data",l)}}s.queue=s.push=function(l){return a||(l===null&&(a=!0),o.push(l),f()),s},s.on("end",function(){s.readable=!1,!s.writable&&s.autoDestroy&&process.nextTick(function(){s.destroy()})});function c(){s.writable=!1,t.call(s),!s.readable&&s.autoDestroy&&s.destroy()}return s.end=function(l){if(!i)return i=!0,arguments.length&&s.write(l),c(),s},s.destroy=function(){if(!n)return n=!0,i=!0,o.length=0,s.writable=s.readable=!1,s.emit("close"),s},s.pause=function(){if(!s.paused)return s.paused=!0,s},s.resume=function(){return s.paused&&(s.paused=!1,s.emit("resume")),f(),s.paused||s.emit("drain"),s},s}});var Xf=d((km,Vf)=>{function Xi(e){this.name="Bzip2Error",this.message=e,this.stack=new Error().stack}Xi.prototype=new Error;var Z={Error:function(e){throw new Xi(e)}},ae={};ae.Bzip2Error=Xi;ae.crcTable=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];ae.array=function(e){var t=0,r=0,i=[0,1,3,7,15,31,63,127,255];return function(n){for(var o=0;n>0;){var a=8-t;n>=a?(o<<=a,o|=i[a]&e[r++],t=0,n-=a):(o<<=n,o|=(e[r]&i[n]<<8-n-t)>>8-n-t,t+=n,n=0)}return o}};ae.simple=function(e,t){var r=ae.array(e),i=ae.header(r),n=!1,o=1e5*i,a=new Int32Array(o);do n=ae.decompress(r,t,a,o);while(!n)};ae.header=function(e){this.byteCount=new Int32Array(256),this.symToByte=new Uint8Array(256),this.mtfSymbol=new Int32Array(256),this.selectors=new Uint8Array(32768),e(24)!=4348520&&Z.Error("No magic number found");var t=e(8)-48;return(t<1||t>9)&&Z.Error("Not a BZIP archive"),t};ae.decompress=function(e,t,r,i,n){for(var o=20,a=258,s=0,f=1,c=50,l=-1,x="",u=0;u<6;u++)x+=e(8).toString(16);if(x=="177245385090"){var h=e(32)|0;return h!==n&&Z.Error("Error in bzip2: crc32 do not match"),e(null),null}x!="314159265359"&&Z.Error("eek not valid bzip data");var m=e(32)|0;e(1)&&Z.Error("unsupported obsolete version");var y=e(24);y>i&&Z.Error("Initial position larger than buffer size");var p=e(16),_=0;for(u=0;u<16;u++)if(p&1<<15-u){var g=e(16);for(D=0;D<16;D++)g&1<<15-D&&(this.symToByte[_++]=16*u+D)}var E=e(3);(E<2||E>6)&&Z.Error("another error");var N=e(15);N==0&&Z.Error("meh");for(var u=0;u<E;u++)this.mtfSymbol[u]=u;for(var u=0;u<N;u++){for(var D=0;e(1);D++)D>=E&&Z.Error("whoops another error");for(var R=this.mtfSymbol[D],g=D-1;g>=0;g--)this.mtfSymbol[g+1]=this.mtfSymbol[g];this.mtfSymbol[0]=R,this.selectors[u]=R}for(var O=_+2,J=[],j=new Uint8Array(a),z=new Uint16Array(o+1),v,D=0;D<E;D++){p=e(5);for(var u=0;u<O;u++){for(;(p<1||p>o)&&Z.Error("I gave up a while ago on writing error messages"),!!e(1);)e(1)?p--:p++;j[u]=p}var w,b;w=b=j[0];for(var u=1;u<O;u++)j[u]>b?b=j[u]:j[u]<w&&(w=j[u]);v=J[D]={},v.permute=new Int32Array(a),v.limit=new Int32Array(o+1),v.base=new Int32Array(o+1),v.minLen=w,v.maxLen=b;for(var C=v.base,q=v.limit,B=0,u=w;u<=b;u++)for(var p=0;p<O;p++)j[p]==u&&(v.permute[B++]=p);for(u=w;u<=b;u++)z[u]=q[u]=0;for(u=0;u<O;u++)z[j[u]]++;for(B=p=0,u=w;u<b;u++)B+=z[u],q[u]=B-1,B<<=1,C[u+1]=B-(p+=z[u]);q[b]=B+z[b]-1,C[w]=0}for(var u=0;u<256;u++)this.mtfSymbol[u]=u,this.byteCount[u]=0;var A,F,O,M;for(A=F=O=M=0;;){for(O--||(O=c-1,M>=N&&Z.Error("meow i'm a kitty, that's an error"),v=J[this.selectors[M++]],C=v.base,q=v.limit),u=v.minLen,D=e(u);u>v.maxLen&&Z.Error("rawr i'm a dinosaur"),!(D<=q[u]);)u++,D=D<<1|e(1);D-=C[u],(D<0||D>=a)&&Z.Error("moo i'm a cow");var T=v.permute[D];if(T==s||T==f){A||(A=1,p=0),T==s?p+=A:p+=2*A,A<<=1;continue}if(A)for(A=0,F+p>i&&Z.Error("Boom."),R=this.symToByte[this.mtfSymbol[0]],this.byteCount[R]+=p;p--;)r[F++]=R;if(T>_)break;F>=i&&Z.Error("I can't think of anything. Error"),u=T-1,R=this.mtfSymbol[u];for(var g=u-1;g>=0;g--)this.mtfSymbol[g+1]=this.mtfSymbol[g];this.mtfSymbol[0]=R,R=this.symToByte[R],this.byteCount[R]++,r[F++]=R}(y<0||y>=F)&&Z.Error("I'm a monkey and I'm throwing something at someone, namely you");for(var D=0,u=0;u<256;u++)g=D+this.byteCount[u],this.byteCount[u]=D,D=g;for(var u=0;u<F;u++)R=r[u]&255,r[this.byteCount[R]]|=u<<8,this.byteCount[R]++;var Se=0,Ae=0,Lr=0;F&&(Se=r[y],Ae=Se&255,Se>>=8,Lr=-1),F=F;for(var zr,Mr,It;F;){for(F--,Mr=Ae,Se=r[Se],Ae=Se&255,Se>>=8,Lr++==3?(zr=Ae,It=Mr,Ae=-1):(zr=1,It=Ae);zr--;)l=(l<<8^this.crcTable[(l>>24^It)&255])&4294967295,t(It);Ae!=Mr&&(Lr=0)}return l=(l^-1)>>>0,(l|0)!=(m|0)&&Z.Error("Error in bzip2: crc32 do not match"),n=(l^(n<<1|n>>>31))&4294967295,n};Vf.exports=ae});var e0=d((jm,Qf)=>{var Jf=[0,1,3,7,15,31,63,127,255];Qf.exports=function(t){var r=0,i=0,n=t(),o=function(a){if(a===null&&r!=0){r=0,i++;return}for(var s=0;a>0;){i>=n.length&&(i=0,n=t());var f=8-r;r===0&&a>0&&o.bytesRead++,a>=f?(s<<=f,s|=Jf[f]&n[i++],r=0,a-=f):(s<<=a,s|=(n[i]&Jf[a]<<8-a-r)>>8-a-r,r+=a,a=0)}return s};return o.bytesRead=0,o}});var i0=d((Nm,r0)=>{var $d=Kf(),t0=Xf(),Hd=e0();r0.exports=Gd;function Gd(){var e=[],t=0,r=0,i=!1,n=!1,o=null,a=null;function s(l){if(r){var x=1e5*r,u=new Int32Array(x),h=[],m=function(y){h.push(y)};return a=t0.decompress(o,m,u,x,a),a===null?(r=0,!1):(l(Buffer.from(h)),!0)}else return r=t0.header(o),a=0,!0}var f=0;function c(l){if(!i)try{return s(function(x){l.queue(x),x!==null&&(f+=x.length)})}catch(x){return l.emit("error",x),i=!0,!1}}return $d(function(x){for(e.push(x),t+=x.length,o===null&&(o=Hd(function(){return e.shift()}));!i&&t-o.bytesRead+1>=(25e3+1e5*r||4);)c(this)},function(x){for(;!i&&o&&t>o.bytesRead;)c(this);i||(a!==null&&this.emit("error",new Error("input stream ended prematurely")),this.queue(null))})}});var s0=d((Um,a0)=>{"use strict";var n0=Er(),o0=Tf(),Yd=Wt(),Zd=Gf(),Kd=i0();a0.exports=()=>e=>!Buffer.isBuffer(e)&&!Yd(e)?Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`)):Buffer.isBuffer(e)&&(!o0(e)||o0(e).ext!=="bz2")?Promise.resolve([]):Buffer.isBuffer(e)?n0()(Zd.decode(e)):n0()(e.pipe(Kd()))});var l0=d((Lm,u0)=>{"use strict";var Vd=require("zlib"),Xd=Er(),f0=Zr(),Jd=Wt();u0.exports=()=>e=>{if(!Buffer.isBuffer(e)&&!Jd(e))return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof e}`));if(Buffer.isBuffer(e)&&(!f0(e)||f0(e).ext!=="gz"))return Promise.resolve([]);let t=Vd.createGunzip(),r=Xd()(t);return Buffer.isBuffer(e)?t.end(e):e.pipe(t),r}});var x0=d((zm,c0)=>{"use strict";c0.exports=function(e){return e&&e.length>1?e[0]===255&&e[1]===216&&e[2]===255?{ext:"jpg",mime:"image/jpeg"}:e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71?{ext:"png",mime:"image/png"}:e[0]===71&&e[1]===73&&e[2]===70?{ext:"gif",mime:"image/gif"}:e[8]===87&&e[9]===69&&e[10]===66&&e[11]===80?{ext:"webp",mime:"image/webp"}:e[0]===70&&e[1]===76&&e[2]===73&&e[3]===70?{ext:"flif",mime:"image/flif"}:(e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42)&&e[8]===67&&e[9]===82?{ext:"cr2",mime:"image/x-canon-cr2"}:e[0]===73&&e[1]===73&&e[2]===42&&e[3]===0||e[0]===77&&e[1]===77&&e[2]===0&&e[3]===42?{ext:"tif",mime:"image/tiff"}:e[0]===66&&e[1]===77?{ext:"bmp",mime:"image/bmp"}:e[0]===73&&e[1]===73&&e[2]===188?{ext:"jxr",mime:"image/vnd.ms-photo"}:e[0]===56&&e[1]===66&&e[2]===80&&e[3]===83?{ext:"psd",mime:"image/vnd.adobe.photoshop"}:e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===109&&e[31]===105&&e[32]===109&&e[33]===101&&e[34]===116&&e[35]===121&&e[36]===112&&e[37]===101&&e[38]===97&&e[39]===112&&e[40]===112&&e[41]===108&&e[42]===105&&e[43]===99&&e[44]===97&&e[45]===116&&e[46]===105&&e[47]===111&&e[48]===110&&e[49]===47&&e[50]===101&&e[51]===112&&e[52]===117&&e[53]===98&&e[54]===43&&e[55]===122&&e[56]===105&&e[57]===112?{ext:"epub",mime:"application/epub+zip"}:e[0]===80&&e[1]===75&&e[2]===3&&e[3]===4&&e[30]===77&&e[31]===69&&e[32]===84&&e[33]===65&&e[34]===45&&e[35]===73&&e[36]===78&&e[37]===70&&e[38]===47&&e[39]===109&&e[40]===111&&e[41]===122&&e[42]===105&&e[43]===108&&e[44]===108&&e[45]===97&&e[46]===46&&e[47]===114&&e[48]===115&&e[49]===97?{ext:"xpi",mime:"application/x-xpinstall"}:e[0]===80&&e[1]===75&&(e[2]===3||e[2]===5||e[2]===7)&&(e[3]===4||e[3]===6||e[3]===8)?{ext:"zip",mime:"application/zip"}:e[257]===117&&e[258]===115&&e[259]===116&&e[260]===97&&e[261]===114?{ext:"tar",mime:"application/x-tar"}:e[0]===82&&e[1]===97&&e[2]===114&&e[3]===33&&e[4]===26&&e[5]===7&&(e[6]===0||e[6]===1)?{ext:"rar",mime:"application/x-rar-compressed"}:e[0]===31&&e[1]===139&&e[2]===8?{ext:"gz",mime:"application/gzip"}:e[0]===66&&e[1]===90&&e[2]===104?{ext:"bz2",mime:"application/x-bzip2"}:e[0]===55&&e[1]===122&&e[2]===188&&e[3]===175&&e[4]===39&&e[5]===28?{ext:"7z",mime:"application/x-7z-compressed"}:e[0]===120&&e[1]===1?{ext:"dmg",mime:"application/x-apple-diskimage"}:e[0]===0&&e[1]===0&&e[2]===0&&(e[3]===24||e[3]===32)&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112||e[0]===51&&e[1]===103&&e[2]===112&&e[3]===53||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[16]===109&&e[17]===112&&e[18]===52&&e[19]===49&&e[20]===109&&e[21]===112&&e[22]===52&&e[23]===50&&e[24]===105&&e[25]===115&&e[26]===111&&e[27]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===105&&e[9]===115&&e[10]===111&&e[11]===109||e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===109&&e[9]===112&&e[10]===52&&e[11]===50&&e[12]===0&&e[13]===0&&e[14]===0&&e[15]===0?{ext:"mp4",mime:"video/mp4"}:e[0]===0&&e[1]===0&&e[2]===0&&e[3]===28&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===86?{ext:"m4v",mime:"video/x-m4v"}:e[0]===77&&e[1]===84&&e[2]===104&&e[3]===100?{ext:"mid",mime:"audio/midi"}:e[31]===109&&e[32]===97&&e[33]===116&&e[34]===114&&e[35]===111&&e[36]===115&&e[37]===107&&e[38]===97?{ext:"mkv",mime:"video/x-matroska"}:e[0]===26&&e[1]===69&&e[2]===223&&e[3]===163?{ext:"webm",mime:"video/webm"}:e[0]===0&&e[1]===0&&e[2]===0&&e[3]===20&&e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112?{ext:"mov",mime:"video/quicktime"}:e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===65&&e[9]===86&&e[10]===73?{ext:"avi",mime:"video/x-msvideo"}:e[0]===48&&e[1]===38&&e[2]===178&&e[3]===117&&e[4]===142&&e[5]===102&&e[6]===207&&e[7]===17&&e[8]===166&&e[9]===217?{ext:"wmv",mime:"video/x-ms-wmv"}:e[0]===0&&e[1]===0&&e[2]===1&&e[3].toString(16)[0]==="b"?{ext:"mpg",mime:"video/mpeg"}:e[0]===73&&e[1]===68&&e[2]===51||e[0]===255&&e[1]===251?{ext:"mp3",mime:"audio/mpeg"}:e[4]===102&&e[5]===116&&e[6]===121&&e[7]===112&&e[8]===77&&e[9]===52&&e[10]===65||e[0]===77&&e[1]===52&&e[2]===65&&e[3]===32?{ext:"m4a",mime:"audio/m4a"}:e[28]===79&&e[29]===112&&e[30]===117&&e[31]===115&&e[32]===72&&e[33]===101&&e[34]===97&&e[35]===100?{ext:"opus",mime:"audio/opus"}:e[0]===79&&e[1]===103&&e[2]===103&&e[3]===83?{ext:"ogg",mime:"audio/ogg"}:e[0]===102&&e[1]===76&&e[2]===97&&e[3]===67?{ext:"flac",mime:"audio/x-flac"}:e[0]===82&&e[1]===73&&e[2]===70&&e[3]===70&&e[8]===87&&e[9]===65&&e[10]===86&&e[11]===69?{ext:"wav",mime:"audio/x-wav"}:e[0]===35&&e[1]===33&&e[2]===65&&e[3]===77&&e[4]===82&&e[5]===10?{ext:"amr",mime:"audio/amr"}:e[0]===37&&e[1]===80&&e[2]===68&&e[3]===70?{ext:"pdf",mime:"application/pdf"}:e[0]===77&&e[1]===90?{ext:"exe",mime:"application/x-msdownload"}:(e[0]===67||e[0]===70)&&e[1]===87&&e[2]===83?{ext:"swf",mime:"application/x-shockwave-flash"}:e[0]===123&&e[1]===92&&e[2]===114&&e[3]===116&&e[4]===102?{ext:"rtf",mime:"application/rtf"}:e[0]===119&&e[1]===79&&e[2]===70&&e[3]===70&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)?{ext:"woff",mime:"application/font-woff"}:e[0]===119&&e[1]===79&&e[2]===70&&e[3]===50&&(e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0||e[4]===79&&e[5]===84&&e[6]===84&&e[7]===79)?{ext:"woff2",mime:"application/font-woff"}:e[34]===76&&e[35]===80&&(e[8]===0&&e[9]===0&&e[10]===1||e[8]===1&&e[9]===0&&e[10]===2||e[8]===2&&e[9]===0&&e[10]===2)?{ext:"eot",mime:"application/octet-stream"}:e[0]===0&&e[1]===1&&e[2]===0&&e[3]===0&&e[4]===0?{ext:"ttf",mime:"application/font-sfnt"}:e[0]===79&&e[1]===84&&e[2]===84&&e[3]===79&&e[4]===0?{ext:"otf",mime:"application/font-sfnt"}:e[0]===0&&e[1]===0&&e[2]===1&&e[3]===0?{ext:"ico",mime:"image/x-icon"}:e[0]===70&&e[1]===76&&e[2]===86&&e[3]===1?{ext:"flv",mime:"video/x-flv"}:e[0]===37&&e[1]===33?{ext:"ps",mime:"application/postscript"}:e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0?{ext:"xz",mime:"application/x-xz"}:e[0]===83&&e[1]===81&&e[2]===76&&e[3]===105?{ext:"sqlite",mime:"application/x-sqlite3"}:e[0]===78&&e[1]===69&&e[2]===83&&e[3]===26?{ext:"nes",mime:"application/x-nintendo-nes-rom"}:e[0]===67&&e[1]===114&&e[2]===50&&e[3]===52?{ext:"crx",mime:"application/x-google-chrome-extension"}:e[0]===77&&e[1]===83&&e[2]===67&&e[3]===70||e[0]===73&&e[1]===83&&e[2]===99&&e[3]===40?{ext:"cab",mime:"application/vnd.ms-cab-compressed"}:e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62&&e[7]===10&&e[8]===100&&e[9]===101&&e[10]===98&&e[11]===105&&e[12]===97&&e[13]===110&&e[14]===45&&e[15]===98&&e[16]===105&&e[17]===110&&e[18]===97&&e[19]===114&&e[20]===121?{ext:"deb",mime:"application/x-deb"}:e[0]===33&&e[1]===60&&e[2]===97&&e[3]===114&&e[4]===99&&e[5]===104&&e[6]===62?{ext:"ar",mime:"application/x-unix-archive"}:e[0]===237&&e[1]===171&&e[2]===238&&e[3]===219?{ext:"rpm",mime:"application/x-rpm"}:e[0]===31&&e[1]===160||e[0]===31&&e[1]===157?{ext:"Z",mime:"application/x-compress"}:e[0]===76&&e[1]===90&&e[2]===73&&e[3]===80?{ext:"lz",mime:"application/x-lzip"}:e[0]===208&&e[1]===207&&e[2]===17&&e[3]===224&&e[4]===161&&e[5]===177&&e[6]===26&&e[7]===225?{ext:"msi",mime:"application/x-msi"}:null:null}});var g0=d((Mm,_0)=>{"use strict";var Qi="pending",d0="settled",Ar="fulfilled",Fr="rejected",Qd=function(){},h0=typeof global<"u"&&typeof global.process<"u"&&typeof global.process.emit=="function",eh=typeof setImmediate>"u"?setTimeout:setImmediate,At=[],Ji;function th(){for(var e=0;e<At.length;e++)At[e][0](At[e][1]);At=[],Ji=!1}function Or(e,t){At.push([e,t]),Ji||(Ji=!0,eh(th,0))}function rh(e,t){function r(n){en(t,n)}function i(n){Ft(t,n)}try{e(r,i)}catch(n){i(n)}}function p0(e){var t=e.owner,r=t._state,i=t._data,n=e[r],o=e.then;if(typeof n=="function"){r=Ar;try{i=n(i)}catch(a){Ft(o,a)}}m0(o,i)||(r===Ar&&en(o,i),r===Fr&&Ft(o,i))}function m0(e,t){var r;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(t&&(typeof t=="function"||typeof t=="object")){var i=t.then;if(typeof i=="function")return i.call(t,function(n){r||(r=!0,t===n?y0(e,n):en(e,n))},function(n){r||(r=!0,Ft(e,n))}),!0}}catch(n){return r||Ft(e,n),!0}return!1}function en(e,t){(e===t||!m0(e,t))&&y0(e,t)}function y0(e,t){e._state===Qi&&(e._state=d0,e._data=t,Or(ih,e))}function Ft(e,t){e._state===Qi&&(e._state=d0,e._data=t,Or(nh,e))}function v0(e){e._then=e._then.forEach(p0)}function ih(e){e._state=Ar,v0(e)}function nh(e){e._state=Fr,v0(e),!e._handled&&h0&&global.process.emit("unhandledRejection",e._data,e)}function oh(e){global.process.emit("rejectionHandled",e)}function Q(e){if(typeof e!="function")throw new TypeError("Promise resolver "+e+" is not a function");if(!(this instanceof Q))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._then=[],rh(e,this)}Q.prototype={constructor:Q,_state:Qi,_then:null,_data:void 0,_handled:!1,then:function(e,t){var r={owner:this,then:new this.constructor(Qd),fulfilled:e,rejected:t};return(t||e)&&!this._handled&&(this._handled=!0,this._state===Fr&&h0&&Or(oh,this)),this._state===Ar||this._state===Fr?Or(p0,r):this._then.push(r),r.then},catch:function(e){return this.then(null,e)}};Q.all=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.all().");return new Q(function(t,r){var i=[],n=0;function o(f){return n++,function(c){i[f]=c,--n||t(i)}}for(var a=0,s;a<e.length;a++)s=e[a],s&&typeof s.then=="function"?s.then(o(a),r):i[a]=s;n||t(i)})};Q.race=function(e){if(!Array.isArray(e))throw new TypeError("You must pass an array to Promise.race().");return new Q(function(t,r){for(var i=0,n;i<e.length;i++)n=e[i],n&&typeof n.then=="function"?n.then(t,r):t(n)})};Q.resolve=function(e){return e&&typeof e=="object"&&e.constructor===Q?e:new Q(function(t){t(e)})};Q.reject=function(e){return new Q(function(t,r){r(e)})};_0.exports=Q});var b0=d((Wm,w0)=>{"use strict";w0.exports=typeof Promise=="function"?Promise:g0()});var tn=d(($m,S0)=>{"use strict";var E0=Object.getOwnPropertySymbols,ah=Object.prototype.hasOwnProperty,sh=Object.prototype.propertyIsEnumerable;function fh(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function uh(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;var i=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(i.join("")!=="0123456789")return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(o){n[o]=o}),Object.keys(Object.assign({},n)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}S0.exports=uh()?Object.assign:function(e,t){for(var r,i=fh(e),n,o=1;o<arguments.length;o++){r=Object(arguments[o]);for(var a in r)ah.call(r,a)&&(i[a]=r[a]);if(E0){n=E0(r);for(var s=0;s<n.length;s++)sh.call(r,n[s])&&(i[n[s]]=r[n[s]])}}return i}});var F0=d((Hm,A0)=>{var lh=require("stream").PassThrough,ch=tn();A0.exports=function(e){e=ch({},e);var t=e.array,r=e.encoding,i=r==="buffer",n=!1;t?n=!(r||i):r=r||"utf8",i&&(r=null);var o=0,a=[],s=new lh({objectMode:n});return r&&s.setEncoding(r),s.on("data",function(f){a.push(f),n?o=a.length:o+=f.length}),s.getBufferedValue=function(){return t?a:i?Buffer.concat(a,o):a.join("")},s.getBufferedLength=function(){return o},s}});var R0=d((Gm,Rr)=>{"use strict";var O0=b0(),rn=tn(),xh=F0();function nn(e,t){if(!e)return O0.reject(new Error("Expected a stream"));t=rn({maxBuffer:1/0},t);var r=t.maxBuffer,i,n,o=new O0(function(a,s){i=xh(t),e.once("error",f),e.pipe(i),i.on("data",function(){i.getBufferedLength()>r&&s(new Error("maxBuffer exceeded"))}),i.once("error",f),i.on("end",a),n=function(){e.unpipe&&e.unpipe(i)};function f(c){c&&(c.bufferedData=i.getBufferedValue()),s(c)}});return o.then(n,n),o.then(function(){return i.getBufferedValue()})}Rr.exports=nn;Rr.exports.buffer=function(e,t){return nn(e,rn({},t,{encoding:"buffer"}))};Rr.exports.array=function(e,t){return nn(e,rn({},t,{array:!0}))}});var on=d((Ym,B0)=>{"use strict";var P0=function(e,t,r){return function(){for(var i=this,n=new Array(arguments.length),o=0;o<arguments.length;o++)n[o]=arguments[o];return new t(function(a,s){n.push(function(f,c){if(f)s(f);else if(r.multiArgs){for(var l=new Array(arguments.length-1),x=1;x<arguments.length;x++)l[x-1]=arguments[x];a(l)}else a(c)}),e.apply(i,n)})}},T0=B0.exports=function(e,t,r){typeof t!="function"&&(r=t,t=Promise),r=r||{},r.exclude=r.exclude||[/.+Sync$/];var i=function(o){var a=function(s){return typeof s=="string"?o===s:s.test(o)};return r.include?r.include.some(a):!r.exclude.some(a)},n=typeof e=="function"?function(){return r.excludeMain?e.apply(this,arguments):P0(e,t,r).apply(this,arguments)}:{};return Object.keys(e).reduce(function(o,a){var s=e[a];return o[a]=typeof s=="function"&&i(a)?P0(s,t,r):s,o},n)};T0.all=T0});var I0=d((Zm,D0)=>{D0.exports=Pr;function Pr(){this.pending=0,this.max=1/0,this.listeners=[],this.waiting=[],this.error=null}Pr.prototype.go=function(e){this.pending<this.max?q0(this,e):this.waiting.push(e)};Pr.prototype.wait=function(e){this.pending===0?e(this.error):this.listeners.push(e)};Pr.prototype.hold=function(){return C0(this)};function C0(e){e.pending+=1;var t=!1;return r;function r(n){if(t)throw new Error("callback called twice");if(t=!0,e.error=e.error||n,e.pending-=1,e.waiting.length>0&&e.pending<e.max)q0(e,e.waiting.shift());else if(e.pending===0){var o=e.listeners;e.listeners=[],o.forEach(i)}}function i(n){n(e.error)}}function q0(e,t){t(C0(e))}});var j0=d(Rt=>{var Ot=require("fs"),Tr=require("util"),an=require("stream"),k0=an.Readable,sn=an.Writable,dh=an.PassThrough,hh=I0(),Br=require("events").EventEmitter;Rt.createFromBuffer=ph;Rt.createFromFd=mh;Rt.BufferSlicer=pe;Rt.FdSlicer=he;Tr.inherits(he,Br);function he(e,t){t=t||{},Br.call(this),this.fd=e,this.pend=new hh,this.pend.max=1,this.refCount=0,this.autoClose=!!t.autoClose}he.prototype.read=function(e,t,r,i,n){var o=this;o.pend.go(function(a){Ot.read(o.fd,e,t,r,i,function(s,f,c){a(),n(s,f,c)})})};he.prototype.write=function(e,t,r,i,n){var o=this;o.pend.go(function(a){Ot.write(o.fd,e,t,r,i,function(s,f,c){a(),n(s,f,c)})})};he.prototype.createReadStream=function(e){return new Cr(this,e)};he.prototype.createWriteStream=function(e){return new qr(this,e)};he.prototype.ref=function(){this.refCount+=1};he.prototype.unref=function(){var e=this;if(e.refCount-=1,e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.autoClose&&Ot.close(e.fd,t);function t(r){r?e.emit("error",r):e.emit("close")}};Tr.inherits(Cr,k0);function Cr(e,t){t=t||{},k0.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end,this.pos=this.start,this.destroyed=!1}Cr.prototype._read=function(e){var t=this;if(!t.destroyed){var r=Math.min(t._readableState.highWaterMark,e);if(t.endOffset!=null&&(r=Math.min(r,t.endOffset-t.pos)),r<=0){t.destroyed=!0,t.push(null),t.context.unref();return}t.context.pend.go(function(i){if(t.destroyed)return i();var n=new Buffer(r);Ot.read(t.context.fd,n,0,r,t.pos,function(o,a){o?t.destroy(o):a===0?(t.destroyed=!0,t.push(null),t.context.unref()):(t.pos+=a,t.push(n.slice(0,a))),i()})})}};Cr.prototype.destroy=function(e){this.destroyed||(e=e||new Error("stream destroyed"),this.destroyed=!0,this.emit("error",e),this.context.unref())};Tr.inherits(qr,sn);function qr(e,t){t=t||{},sn.call(this,t),this.context=e,this.context.ref(),this.start=t.start||0,this.endOffset=t.end==null?1/0:+t.end,this.bytesWritten=0,this.pos=this.start,this.destroyed=!1,this.on("finish",this.destroy.bind(this))}qr.prototype._write=function(e,t,r){var i=this;if(!i.destroyed){if(i.pos+e.length>i.endOffset){var n=new Error("maximum file length exceeded");n.code="ETOOBIG",i.destroy(),r(n);return}i.context.pend.go(function(o){if(i.destroyed)return o();Ot.write(i.context.fd,e,0,e.length,i.pos,function(a,s){a?(i.destroy(),o(),r(a)):(i.bytesWritten+=s,i.pos+=s,i.emit("progress"),o(),r())})})}};qr.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.context.unref())};Tr.inherits(pe,Br);function pe(e,t){Br.call(this),t=t||{},this.refCount=0,this.buffer=e,this.maxChunkSize=t.maxChunkSize||Number.MAX_SAFE_INTEGER}pe.prototype.read=function(e,t,r,i,n){var o=i+r,a=o-this.buffer.length,s=a>0?a:r;this.buffer.copy(e,t,i,o),setImmediate(function(){n(null,s)})};pe.prototype.write=function(e,t,r,i,n){e.copy(this.buffer,i,t,t+r),setImmediate(function(){n(null,r,e)})};pe.prototype.createReadStream=function(e){e=e||{};var t=new dh(e);t.destroyed=!1,t.start=e.start||0,t.endOffset=e.end,t.pos=t.endOffset||this.buffer.length;for(var r=this.buffer.slice(t.start,t.pos),i=0;;){var n=i+this.maxChunkSize;if(n>=r.length){i<r.length&&t.write(r.slice(i,r.length));break}t.write(r.slice(i,n)),i=n}return t.end(),t.destroy=function(){t.destroyed=!0},t};pe.prototype.createWriteStream=function(e){var t=this;e=e||{};var r=new sn(e);return r.start=e.start||0,r.endOffset=e.end==null?this.buffer.length:+e.end,r.bytesWritten=0,r.pos=r.start,r.destroyed=!1,r._write=function(i,n,o){if(!r.destroyed){var a=r.pos+i.length;if(a>r.endOffset){var s=new Error("maximum file length exceeded");s.code="ETOOBIG",r.destroyed=!0,o(s);return}i.copy(t.buffer,r.pos,0,i.length),r.bytesWritten+=i.length,r.pos=a,r.emit("progress"),o()}},r.destroy=function(){r.destroyed=!0},r};pe.prototype.ref=function(){this.refCount+=1};pe.prototype.unref=function(){if(this.refCount-=1,this.refCount<0)throw new Error("invalid unref")};function ph(e,t){return new pe(e,t)}function mh(e,t){return new he(e,t)}});var L0=d((Vm,U0)=>{var we=require("buffer").Buffer,fn=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(fn=new Int32Array(fn));function N0(e){if(we.isBuffer(e))return e;var t=typeof we.alloc=="function"&&typeof we.from=="function";if(typeof e=="number")return t?we.alloc(e):new we(e);if(typeof e=="string")return t?we.from(e):new we(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function yh(e){var t=N0(4);return t.writeInt32BE(e,0),t}function un(e,t){e=N0(e),we.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=~~t^-1,i=0;i<e.length;i++)r=fn[(r^e[i])&255]^r>>>8;return r^-1}function ln(){return yh(un.apply(null,arguments))}ln.signed=function(){return un.apply(null,arguments)};ln.unsigned=function(){return un.apply(null,arguments)>>>0};U0.exports=ln});var Y0=d(fe=>{var cn=require("fs"),vh=require("zlib"),z0=j0(),_h=L0(),kr=require("util"),jr=require("events").EventEmitter,M0=require("stream").Transform,xn=require("stream").PassThrough,gh=require("stream").Writable;fe.open=wh;fe.fromFd=W0;fe.fromBuffer=bh;fe.fromRandomAccessReader=dn;fe.dosDateTimeToDate=H0;fe.validateFileName=G0;fe.ZipFile=be;fe.Entry=Pt;fe.RandomAccessReader=Ee;function wh(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!0),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),r==null&&(r=Ir),cn.open(e,"r",function(i,n){if(i)return r(i);W0(n,t,function(o,a){o&&cn.close(n,Ir),r(o,a)})})}function W0(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose==null&&(t.autoClose=!1),t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1),r==null&&(r=Ir),cn.fstat(e,function(i,n){if(i)return r(i);var o=z0.createFromFd(e,{autoClose:!0});dn(o,n.size,t,r)})}function bh(e,t,r){typeof t=="function"&&(r=t,t=null),t==null&&(t={}),t.autoClose=!1,t.lazyEntries==null&&(t.lazyEntries=!1),t.decodeStrings==null&&(t.decodeStrings=!0),t.validateEntrySizes==null&&(t.validateEntrySizes=!0),t.strictFileNames==null&&(t.strictFileNames=!1);var i=z0.createFromBuffer(e,{maxChunkSize:65536});dn(i,e.length,t,r)}function dn(e,t,r,i){typeof r=="function"&&(i=r,r=null),r==null&&(r={}),r.autoClose==null&&(r.autoClose=!0),r.lazyEntries==null&&(r.lazyEntries=!1),r.decodeStrings==null&&(r.decodeStrings=!0);var n=!!r.decodeStrings;if(r.validateEntrySizes==null&&(r.validateEntrySizes=!0),r.strictFileNames==null&&(r.strictFileNames=!1),i==null&&(i=Ir),typeof t!="number")throw new Error("expected totalSize parameter to be a number");if(t>Number.MAX_SAFE_INTEGER)throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double.");e.ref();var o=22,a=65535,s=Math.min(o+a,t),f=se(s),c=t-f.length;ot(e,f,0,s,c,function(l){if(l)return i(l);for(var x=s-o;x>=0;x-=1)if(f.readUInt32LE(x)===101010256){var u=f.slice(x),h=u.readUInt16LE(4);if(h!==0)return i(new Error("multi-disk zip files are not supported: found disk number: "+h));var m=u.readUInt16LE(10),y=u.readUInt32LE(16),p=u.readUInt16LE(20),_=u.length-o;if(p!==_)return i(new Error("invalid comment length. expected: "+_+". found: "+p));var g=n?Dr(u,22,u.length,!1):u.slice(22);if(!(m===65535||y===4294967295))return i(null,new be(e,y,t,m,g,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames));var E=se(20),N=c+x-E.length;ot(e,E,0,E.length,N,function(R){if(R)return i(R);if(E.readUInt32LE(0)!==117853008)return i(new Error("invalid zip64 end of central directory locator signature"));var J=at(E,8),j=se(56);ot(e,j,0,j.length,J,function(z){return z?i(z):j.readUInt32LE(0)!==101075792?i(new Error("invalid zip64 end of central directory record signature")):(m=at(j,32),y=at(j,48),i(null,new be(e,y,t,m,g,r.autoClose,r.lazyEntries,n,r.validateEntrySizes,r.strictFileNames)))})});return}i(new Error("end of central directory record signature not found"))})}kr.inherits(be,jr);function be(e,t,r,i,n,o,a,s,f,c){var l=this;jr.call(l),l.reader=e,l.reader.on("error",function(x){$0(l,x)}),l.reader.once("close",function(){l.emit("close")}),l.readEntryCursor=t,l.fileSize=r,l.entryCount=i,l.comment=n,l.entriesRead=0,l.autoClose=!!o,l.lazyEntries=!!a,l.decodeStrings=!!s,l.validateEntrySizes=!!f,l.strictFileNames=!!c,l.isOpen=!0,l.emittedError=!1,l.lazyEntries||l._readEntry()}be.prototype.close=function(){this.isOpen&&(this.isOpen=!1,this.reader.unref())};function re(e,t){e.autoClose&&e.close(),$0(e,t)}function $0(e,t){e.emittedError||(e.emittedError=!0,e.emit("error",t))}be.prototype.readEntry=function(){if(!this.lazyEntries)throw new Error("readEntry() called without lazyEntries:true");this._readEntry()};be.prototype._readEntry=function(){var e=this;if(e.entryCount===e.entriesRead){setImmediate(function(){e.autoClose&&e.close(),!e.emittedError&&e.emit("end")});return}if(!e.emittedError){var t=se(46);ot(e.reader,t,0,t.length,e.readEntryCursor,function(r){if(r)return re(e,r);if(!e.emittedError){var i=new Pt,n=t.readUInt32LE(0);if(n!==33639248)return re(e,new Error("invalid central directory file header signature: 0x"+n.toString(16)));if(i.versionMadeBy=t.readUInt16LE(4),i.versionNeededToExtract=t.readUInt16LE(6),i.generalPurposeBitFlag=t.readUInt16LE(8),i.compressionMethod=t.readUInt16LE(10),i.lastModFileTime=t.readUInt16LE(12),i.lastModFileDate=t.readUInt16LE(14),i.crc32=t.readUInt32LE(16),i.compressedSize=t.readUInt32LE(20),i.uncompressedSize=t.readUInt32LE(24),i.fileNameLength=t.readUInt16LE(28),i.extraFieldLength=t.readUInt16LE(30),i.fileCommentLength=t.readUInt16LE(32),i.internalFileAttributes=t.readUInt16LE(36),i.externalFileAttributes=t.readUInt32LE(38),i.relativeOffsetOfLocalHeader=t.readUInt32LE(42),i.generalPurposeBitFlag&64)return re(e,new Error("strong encryption is not supported"));e.readEntryCursor+=46,t=se(i.fileNameLength+i.extraFieldLength+i.fileCommentLength),ot(e.reader,t,0,t.length,e.readEntryCursor,function(o){if(o)return re(e,o);if(!e.emittedError){var a=(i.generalPurposeBitFlag&2048)!==0;i.fileName=e.decodeStrings?Dr(t,0,i.fileNameLength,a):t.slice(0,i.fileNameLength);var s=i.fileNameLength+i.extraFieldLength,f=t.slice(i.fileNameLength,s);i.extraFields=[];for(var c=0;c<f.length-3;){var l=f.readUInt16LE(c+0),x=f.readUInt16LE(c+2),u=c+4,h=u+x;if(h>f.length)return re(e,new Error("extra field length exceeds extra field buffer size"));var m=se(x);f.copy(m,0,u,h),i.extraFields.push({id:l,data:m}),c=h}if(i.fileComment=e.decodeStrings?Dr(t,s,s+i.fileCommentLength,a):t.slice(s,s+i.fileCommentLength),i.comment=i.fileComment,e.readEntryCursor+=t.length,e.entriesRead+=1,i.uncompressedSize===4294967295||i.compressedSize===4294967295||i.relativeOffsetOfLocalHeader===4294967295){for(var y=null,c=0;c<i.extraFields.length;c++){var p=i.extraFields[c];if(p.id===1){y=p.data;break}}if(y==null)return re(e,new Error("expected zip64 extended information extra field"));var _=0;if(i.uncompressedSize===4294967295){if(_+8>y.length)return re(e,new Error("zip64 extended information extra field does not include uncompressed size"));i.uncompressedSize=at(y,_),_+=8}if(i.compressedSize===4294967295){if(_+8>y.length)return re(e,new Error("zip64 extended information extra field does not include compressed size"));i.compressedSize=at(y,_),_+=8}if(i.relativeOffsetOfLocalHeader===4294967295){if(_+8>y.length)return re(e,new Error("zip64 extended information extra field does not include relative header offset"));i.relativeOffsetOfLocalHeader=at(y,_),_+=8}}if(e.decodeStrings)for(var c=0;c<i.extraFields.length;c++){var p=i.extraFields[c];if(p.id===28789){if(p.data.length<6||p.data.readUInt8(0)!==1)continue;var g=p.data.readUInt32LE(1);if(_h.unsigned(t.slice(0,i.fileNameLength))!==g)continue;i.fileName=Dr(p.data,5,p.data.length,!0);break}}if(e.validateEntrySizes&&i.compressionMethod===0){var E=i.uncompressedSize;if(i.isEncrypted()&&(E+=12),i.compressedSize!==E){var N="compressed/uncompressed size mismatch for stored file: "+i.compressedSize+" != "+i.uncompressedSize;return re(e,new Error(N))}}if(e.decodeStrings){e.strictFileNames||(i.fileName=i.fileName.replace(/\\/g,"/"));var R=G0(i.fileName,e.validateFileNameOptions);if(R!=null)return re(e,new Error(R))}e.emit("entry",i),e.lazyEntries||e._readEntry()}})}})}};be.prototype.openReadStream=function(e,t,r){var i=this,n=0,o=e.compressedSize;if(r==null)r=t,t={};else{if(t.decrypt!=null){if(!e.isEncrypted())throw new Error("options.decrypt can only be specified for encrypted entries");if(t.decrypt!==!1)throw new Error("invalid options.decrypt value: "+t.decrypt);if(e.isCompressed()&&t.decompress!==!1)throw new Error("entry is encrypted and compressed, and options.decompress !== false")}if(t.decompress!=null){if(!e.isCompressed())throw new Error("options.decompress can only be specified for compressed entries");if(!(t.decompress===!1||t.decompress===!0))throw new Error("invalid options.decompress value: "+t.decompress)}if(t.start!=null||t.end!=null){if(e.isCompressed()&&t.decompress!==!1)throw new Error("start/end range not allowed for compressed entry without options.decompress === false");if(e.isEncrypted()&&t.decrypt!==!1)throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false")}if(t.start!=null){if(n=t.start,n<0)throw new Error("options.start < 0");if(n>e.compressedSize)throw new Error("options.start > entry.compressedSize")}if(t.end!=null){if(o=t.end,o<0)throw new Error("options.end < 0");if(o>e.compressedSize)throw new Error("options.end > entry.compressedSize");if(o<n)throw new Error("options.end < options.start")}}if(!i.isOpen)return r(new Error("closed"));if(e.isEncrypted()&&t.decrypt!==!1)return r(new Error("entry is encrypted, and options.decrypt !== false"));i.reader.ref();var a=se(30);ot(i.reader,a,0,a.length,e.relativeOffsetOfLocalHeader,function(s){try{if(s)return r(s);var f=a.readUInt32LE(0);if(f!==67324752)return r(new Error("invalid local file header signature: 0x"+f.toString(16)));var c=a.readUInt16LE(26),l=a.readUInt16LE(28),x=e.relativeOffsetOfLocalHeader+a.length+c+l,u;if(e.compressionMethod===0)u=!1;else if(e.compressionMethod===8)u=t.decompress!=null?t.decompress:!0;else return r(new Error("unsupported compression method: "+e.compressionMethod));var h=x,m=h+e.compressedSize;if(e.compressedSize!==0&&m>i.fileSize)return r(new Error("file data overflows file bounds: "+h+" + "+e.compressedSize+" > "+i.fileSize));var y=i.reader.createReadStream({start:h+n,end:h+o}),p=y;if(u){var _=!1,g=vh.createInflateRaw();y.on("error",function(E){setImmediate(function(){_||g.emit("error",E)})}),y.pipe(g),i.validateEntrySizes?(p=new Tt(e.uncompressedSize),g.on("error",function(E){setImmediate(function(){_||p.emit("error",E)})}),g.pipe(p)):p=g,p.destroy=function(){_=!0,g!==p&&g.unpipe(p),y.unpipe(g),y.destroy()}}r(null,p)}finally{i.reader.unref()}})};function Pt(){}Pt.prototype.getLastModDate=function(){return H0(this.lastModFileDate,this.lastModFileTime)};Pt.prototype.isEncrypted=function(){return(this.generalPurposeBitFlag&1)!==0};Pt.prototype.isCompressed=function(){return this.compressionMethod===8};function H0(e,t){var r=e&31,i=(e>>5&15)-1,n=(e>>9&127)+1980,o=0,a=(t&31)*2,s=t>>5&63,f=t>>11&31;return new Date(n,i,r,f,s,a,o)}function G0(e){return e.indexOf("\\")!==-1?"invalid characters in fileName: "+e:/^[a-zA-Z]:/.test(e)||/^\//.test(e)?"absolute path: "+e:e.split("/").indexOf("..")!==-1?"invalid relative path: "+e:null}function ot(e,t,r,i,n,o){if(i===0)return setImmediate(function(){o(null,se(0))});e.read(t,r,i,n,function(a,s){if(a)return o(a);if(s<i)return o(new Error("unexpected EOF"));o()})}kr.inherits(Tt,M0);function Tt(e){M0.call(this),this.actualByteCount=0,this.expectedByteCount=e}Tt.prototype._transform=function(e,t,r){if(this.actualByteCount+=e.length,this.actualByteCount>this.expectedByteCount){var i="too many bytes in the stream. expected "+this.expectedByteCount+". got at least "+this.actualByteCount;return r(new Error(i))}r(null,e)};Tt.prototype._flush=function(e){if(this.actualByteCount<this.expectedByteCount){var t="not enough bytes in the stream. expected "+this.expectedByteCount+". got only "+this.actualByteCount;return e(new Error(t))}e()};kr.inherits(Ee,jr);function Ee(){jr.call(this),this.refCount=0}Ee.prototype.ref=function(){this.refCount+=1};Ee.prototype.unref=function(){var e=this;if(e.refCount-=1,e.refCount>0)return;if(e.refCount<0)throw new Error("invalid unref");e.close(t);function t(r){if(r)return e.emit("error",r);e.emit("close")}};Ee.prototype.createReadStream=function(e){var t=e.start,r=e.end;if(t===r){var i=new xn;return setImmediate(function(){i.end()}),i}var n=this._readStreamForRange(t,r),o=!1,a=new Nr(this);n.on("error",function(f){setImmediate(function(){o||a.emit("error",f)})}),a.destroy=function(){n.unpipe(a),a.unref(),n.destroy()};var s=new Tt(r-t);return a.on("error",function(f){setImmediate(function(){o||s.emit("error",f)})}),s.destroy=function(){o=!0,a.unpipe(s),a.destroy()},n.pipe(a).pipe(s)};Ee.prototype._readStreamForRange=function(e,t){throw new Error("not implemented")};Ee.prototype.read=function(e,t,r,i,n){var o=this.createReadStream({start:i,end:i+r}),a=new gh,s=0;a._write=function(f,c,l){f.copy(e,t+s,0,f.length),s+=f.length,l()},a.on("finish",n),o.on("error",function(f){n(f)}),o.pipe(a)};Ee.prototype.close=function(e){setImmediate(e)};kr.inherits(Nr,xn);function Nr(e){xn.call(this),this.context=e,this.context.ref(),this.unreffedYet=!1}Nr.prototype._flush=function(e){this.unref(),e()};Nr.prototype.unref=function(e){this.unreffedYet||(this.unreffedYet=!0,this.context.unref())};var Eh="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0";function Dr(e,t,r,i){if(i)return e.toString("utf8",t,r);for(var n="",o=t;o<r;o++)n+=Eh[e[o]];return n}function at(e,t){var r=e.readUInt32LE(t),i=e.readUInt32LE(t+4);return i*4294967296+r}var se;typeof Buffer.allocUnsafe=="function"?se=function(e){return Buffer.allocUnsafe(e)}:se=function(e){return new Buffer(e)};function Ir(e){if(e)throw e}});var X0=d((Jm,V0)=>{"use strict";var Z0=x0(),Sh=R0(),K0=on(),Ah=Y0(),Fh=(e,t)=>{let o=e.versionMadeBy>>8;return(t&61440)===40960?"symlink":(t&61440)===16384||o===0&&e.externalFileAttributes===16?"directory":"file"},Oh=(e,t)=>{let r={mode:e.externalFileAttributes>>16&65535,mtime:e.getLastModDate(),path:e.fileName};return r.type=Fh(e,r.mode),r.mode===0&&r.type==="directory"&&(r.mode=493),r.mode===0&&(r.mode=420),K0(t.openReadStream.bind(t))(e).then(Sh.buffer).then(i=>(r.data=i,r.type==="symlink"&&(r.linkname=i.toString()),r)).catch(i=>{throw t.close(),i})},Rh=e=>new Promise((t,r)=>{let i=[];e.readEntry(),e.on("entry",n=>{Oh(n,e).catch(r).then(o=>{i.push(o),e.readEntry()})}),e.on("error",r),e.on("end",()=>t(i))});V0.exports=()=>e=>Buffer.isBuffer(e)?!Z0(e)||Z0(e).ext!=="zip"?Promise.resolve([]):K0(Ah.fromBuffer)(e,{lazyEntries:!0}).then(Rh):Promise.reject(new TypeError(`Expected a Buffer, got ${typeof e}`))});var eu=d((Qm,Q0)=>{"use strict";var J0=(e,t)=>function(){let r=t.promiseModule,i=new Array(arguments.length);for(let n=0;n<arguments.length;n++)i[n]=arguments[n];return new r((n,o)=>{t.errorFirst?i.push(function(a,s){if(t.multiArgs){let f=new Array(arguments.length-1);for(let c=1;c<arguments.length;c++)f[c-1]=arguments[c];a?(f.unshift(a),o(f)):n(f)}else a?o(a):n(s)}):i.push(function(a){if(t.multiArgs){let s=new Array(arguments.length-1);for(let f=0;f<arguments.length;f++)s[f]=arguments[f];n(s)}else n(a)}),e.apply(this,i)})};Q0.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=n=>{let o=a=>typeof a=="string"?n===a:a.test(n);return t.include?t.include.some(o):!t.exclude.some(o)},i;typeof e=="function"?i=function(){return t.excludeMain?e.apply(this,arguments):J0(e,t).apply(this,arguments)}:i=Object.create(Object.getPrototypeOf(e));for(let n in e){let o=e[n];i[n]=typeof o=="function"&&r(n)?J0(o,t):o}return i}});var nu=d((ey,hn)=>{"use strict";var Ph=require("fs"),qe=require("path"),tu=eu(),ru={mode:511&~process.umask(),fs:Ph},iu=e=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(qe.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}};hn.exports=(e,t)=>Promise.resolve().then(()=>{iu(e),t=Object.assign({},ru,t);let r=tu(t.fs.mkdir),i=tu(t.fs.stat),n=o=>r(o,t.mode).then(()=>o).catch(a=>{if(a.code==="ENOENT"){if(a.message.includes("null bytes")||qe.dirname(o)===o)throw a;return n(qe.dirname(o)).then(()=>n(o))}return i(o).then(s=>s.isDirectory()?o:Promise.reject()).catch(()=>{throw a})});return n(qe.resolve(e))});hn.exports.sync=(e,t)=>{iu(e),t=Object.assign({},ru,t);let r=i=>{try{t.fs.mkdirSync(i,t.mode)}catch(n){if(n.code==="ENOENT"){if(n.message.includes("null bytes")||qe.dirname(i)===i)throw n;return r(qe.dirname(i)),r(i)}try{if(!t.fs.statSync(i).isDirectory())throw new Error("The path is not a directory")}catch{throw n}}return i};return r(qe.resolve(e))}});var au=d((ty,ou)=>{"use strict";ou.exports=function(t,r){if(r){if(typeof r!="object")throw new TypeError(String(r)+" is not an object. Expected an object that has boolean `includeZero` property.");if("includeZero"in r){if(typeof r.includeZero!="boolean")throw new TypeError(String(r.includeZero)+" is neither true nor false. `includeZero` option must be a Boolean value.");if(r.includeZero&&t===0)return!0}}return Number.isSafeInteger(t)&&t>=1}});var fu=d((ry,su)=>{"use strict";var Bt=require("path"),Ct=require("util"),Th=au();su.exports=function(t,r,i){if(typeof t!="string")throw new TypeError(Ct.inspect(t)+" is not a string. First argument to strip-dirs must be a path string.");if(Bt.posix.isAbsolute(t)||Bt.win32.isAbsolute(t))throw new Error(`${t} is an absolute path. strip-dirs requires a relative path.`);if(!Th(r,{includeZero:!0}))throw new Error("The Second argument of strip-dirs must be a natural number or 0, but received "+Ct.inspect(r)+".");if(i){if(typeof i!="object")throw new TypeError(Ct.inspect(i)+" is not an object. Expected an object with a boolean `disallowOverflow` property.");if(Array.isArray(i))throw new TypeError(Ct.inspect(i)+" is an array. Expected an object with a boolean `disallowOverflow` property.");if("disallowOverflow"in i&&typeof i.disallowOverflow!="boolean")throw new TypeError(Ct.inspect(i.disallowOverflow)+" is neither true nor false. `disallowOverflow` option must be a Boolean value.")}else i={disallowOverflow:!1};let n=Bt.normalize(t).split(Bt.sep);if(n.length>1&&n[0]==="."&&n.shift(),r>n.length-1){if(i.disallowOverflow)throw new RangeError("Cannot strip more directories than there are.");r=n.length-1}return Bt.join.apply(null,n.slice(r))}});var lu=d((iy,uu)=>{"use strict";var Ur=require("path"),Bh=In(),Ch=Er(),qh=s0(),Dh=l0(),Ih=X0(),pn=nu(),kh=on(),jh=fu(),ee=kh(Bh),Nh=(e,t)=>t.plugins.length===0?Promise.resolve([]):Promise.all(t.plugins.map(r=>r(e,t))).then(r=>r.reduce((i,n)=>i.concat(n))),mn=(e,t)=>ee.realpath(e).catch(r=>{let i=Ur.dirname(e);return mn(i,t)}).then(r=>{if(r.indexOf(t)!==0)throw new Error("Refusing to create a directory outside the output path.");return pn(e).then(ee.realpath)}),Uh=(e,t)=>ee.readlink(e).catch(r=>null).then(r=>{if(r)throw new Error("Refusing to write into a symlink");return t}),Lh=(e,t,r)=>Nh(e,r).then(i=>(r.strip>0&&(i=i.map(n=>(n.path=jh(n.path,r.strip),n)).filter(n=>n.path!==".")),typeof r.filter=="function"&&(i=i.filter(r.filter)),typeof r.map=="function"&&(i=i.map(r.map)),t?Promise.all(i.map(n=>{let o=Ur.join(t,n.path),a=n.mode&~process.umask(),s=new Date;return n.type==="directory"?pn(t).then(f=>ee.realpath(f)).then(f=>mn(o,f)).then(()=>ee.utimes(o,s,n.mtime)).then(()=>n):pn(t).then(f=>ee.realpath(f)).then(f=>mn(Ur.dirname(o),f).then(()=>f)).then(f=>n.type==="file"?Uh(o,f):f).then(f=>ee.realpath(Ur.dirname(o)).then(c=>{if(c.indexOf(f)!==0)throw new Error("Refusing to write outside output directory: "+c)})).then(()=>n.type==="link"||n.type==="symlink"&&process.platform==="win32"?ee.link(n.linkname,o):n.type==="symlink"?ee.symlink(n.linkname,o):ee.writeFile(o,n.data,{mode:a})).then(()=>n.type==="file"&&ee.utimes(o,s,n.mtime)).then(()=>n)})):i));uu.exports=(e,t,r)=>typeof e!="string"&&!Buffer.isBuffer(e)?Promise.reject(new TypeError("Input file required")):(typeof t=="object"&&(r=t,t=null),r=Object.assign({plugins:[Ch(),qh(),Dh(),Ih()]},r),(typeof e=="string"?ee.readFile(e):Promise.resolve(e)).then(n=>Lh(n,t,r)))});var $h={};gu($h,{AZUREAUTH_NAME:()=>vn,install:()=>hu});module.exports=wu($h);var st=jt(require("node:path"),1),me=jt(require("node:fs"),1),xu=jt(Sn(),1),du=jt(lu(),1),zh="0.8.4";async function Mh(e,t){let r=new xu.DownloaderHelper(e,t);return new Promise((i,n)=>{r.on("end",()=>i()),r.on("error",o=>n(o)),r.on("progress.throttled",o=>{let a=o.progress<100?o.progress.toPrecision(2):100;console.info(`Downloaded: ${a}%`)}),r.start()})}var Dt=process.platform,cu=process.arch,qt={name:"azureauth",url:"https://github.com/AzureAD/microsoft-authentication-cli/releases/download/",version:zh},yn={def:"azureauth",win32:"azureauth.exe",linux:"azureauth.exe"},vn=Dt in yn?yn[Dt]:yn.def,hu=async()=>{let e=st.default.join(__dirname,"..","bin"),t=i=>{try{return me.default.existsSync(i)}catch{return!1}};if(me.default.existsSync(e)||(me.default.mkdirSync(e,{recursive:!0}),console.info(`${e} directory was created`)),t(st.default.join(e,"azureauth",vn))){console.log("azureauth is already installed");return}let r={win32:{x64:`azureauth-${qt.version}-win10-x64.zip`},darwin:{x64:`azureauth-${qt.version}-osx-x64.tar.gz`,arm64:`azureauth-${qt.version}-osx-arm64.tar.gz`}};if(Dt in r){let i="";if(cu in r[Dt])i=r[Dt][cu];else throw new Error("Arch is not supported in azureauth");let n=`${qt.url}${qt.version}/${i}`,o=st.default.join(e,"azureauth"),a=st.default.join(e,i);console.log(`Downloading azureauth from ${n}`);try{await Mh(n,e)}catch(f){throw new Error(`Download failed: ${f.message}`)}console.log(`Downloaded in ${e}`),me.default.mkdirSync(o,{recursive:!0});let s=st.default.join(o,vn);await(0,du.default)(a,o),t(s)&&(me.default.chmodSync(s,me.default.constants.S_IXUSR||64),me.default.chmodSync(s,493)),console.log(`Unzipped in ${a}`),me.default.unlinkSync(a)}};async function Wh(){for(let t=0;t<3;t++){try{await hu();break}catch(r){console.log(`Install failed: ${r.message}`)}if(t===2)throw new Error("Install failed after 3 attempts")}}Wh().catch(e=>{console.error(e),process.exit(1)});0&&(module.exports={AZUREAUTH_NAME,install});
6
6
  /*! Bundled license information:
7
7
 
8
8
  .store/safe-buffer-npm-5.2.1-3481c8aa9b/package/index.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "azureauth",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "node-azure auth wrapps the AzureAuth CLI wrapper for performing AAD Authentication",
5
5
  "bin": "./scripts/azureauth.cjs",
6
6
  "repository": {
@@ -40,12 +40,12 @@
40
40
  "@types/decompress": "^4.2.7",
41
41
  "@types/node": "^20.17.28",
42
42
  "decompress": "^4.2.1",
43
- "esbuild": "^0.23.1",
43
+ "esbuild": "^0.28.1",
44
44
  "execa": "^7.2.0",
45
45
  "node-downloader-helper": "^2.1.9",
46
46
  "prettier": "^3.5.3",
47
47
  "typescript": "^5.8.2",
48
- "vite": "~5.3.6",
49
- "vitest": "^2.1.9"
48
+ "vite": "^6.4.2",
49
+ "vitest": "^4.1.0"
50
50
  }
51
51
  }