codemod 0.13.12 → 0.13.13
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/index.cjs +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -860,7 +860,7 @@ See: https://github.com/isaacs/node-glob/issues/167`);return new JU(t,e).found}f
|
|
|
860
860
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof JU))return new JU(t,e);if(oZi(this,t,e),this.noprocess)return this;var n=this.minimatch.set.length;this.matches=new Array(n);for(var r=0;r<n;r++)this._process(this.minimatch.set[r],r,!1);this._finish()}JU.prototype._finish=function(){if(USr.ok(this instanceof JU),this.realpath){var t=this;this.matches.forEach(function(e,n){var r=t.matches[n]=Object.create(null);for(var a in e)try{a=t._makeAbs(a);var c=aZi.realpathSync(a,t.realpathCache);r[c]=!0}catch(f){if(f.syscall==="stat")r[t._makeAbs(a)]=!0;else throw f}})}rlt.finish(this)};JU.prototype._process=function(t,e,n){USr.ok(this instanceof JU);for(var r=0;typeof t[r]=="string";)r++;var a;switch(r){case t.length:this._processSimple(t.join("/"),e);return;case 0:a=null;break;default:a=t.slice(0,r).join("/");break}var c=t.slice(r),f;a===null?f=".":((lqt(a)||lqt(t.map(function(E){return typeof E=="string"?E:"[*]"}).join("/")))&&(!a||!lqt(a))&&(a="/"+a),f=a);var y=this._makeAbs(f);if(!lZi(this,f)){var v=c[0]===GSr.GLOBSTAR;v?this._processGlobStar(a,f,y,c,e,n):this._processReaddir(a,f,y,c,e,n)}};JU.prototype._processReaddir=function(t,e,n,r,a,c){var f=this._readdir(n,c);if(f){for(var y=r[0],v=!!this.minimatch.negate,E=y._glob,C=this.dot||E.charAt(0)===".",L=[],R=0;R<f.length;R++){var F=f[R];if(F.charAt(0)!=="."||C){var V;v&&!t?V=!F.match(y):V=F.match(y),V&&L.push(F)}}var U=L.length;if(U!==0){if(r.length===1&&!this.mark&&!this.stat){this.matches[a]||(this.matches[a]=Object.create(null));for(var R=0;R<U;R++){var F=L[R];t&&(t.slice(-1)!=="/"?F=t+"/"+F:F=t+F),F.charAt(0)==="/"&&!this.nomount&&(F=nPn.join(this.root,F)),this._emitMatch(a,F)}return}r.shift();for(var R=0;R<U;R++){var F=L[R],Q;t?Q=[t,F]:Q=[F],this._process(Q.concat(r),a,c)}}}};JU.prototype._emitMatch=function(t,e){if(!cZi(this,e)){var n=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=n),!this.matches[t][e]){if(this.nodir){var r=this.cache[n];if(r==="DIR"||Array.isArray(r))return}this.matches[t][e]=!0,this.stat&&this._stat(e)}}};JU.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var e,n,r;try{n=this.fs.lstatSync(t)}catch(c){if(c.code==="ENOENT")return null}var a=n&&n.isSymbolicLink();return this.symlinks[t]=a,!a&&n&&!n.isDirectory()?this.cache[t]="FILE":e=this._readdir(t,!1),e};JU.prototype._readdir=function(t,e){var n;if(e&&!rPn(this.symlinks,t))return this._readdirInGlobStar(t);if(rPn(this.cache,t)){var r=this.cache[t];if(!r||r==="FILE")return null;if(Array.isArray(r))return r}try{return this._readdirEntries(t,this.fs.readdirSync(t))}catch(a){return this._readdirError(t,a),null}};JU.prototype._readdirEntries=function(t,e){if(!this.mark&&!this.stat)for(var n=0;n<e.length;n++){var r=e[n];t==="/"?r=t+r:r=t+"/"+r,this.cache[r]=!0}return this.cache[t]=e,e};JU.prototype._readdirError=function(t,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(t);if(this.cache[n]="FILE",n===this.cwdAbs){var r=new Error(e.code+" invalid cwd "+this.cwd);throw r.path=this.cwd,r.code=e.code,r}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};JU.prototype._processGlobStar=function(t,e,n,r,a,c){var f=this._readdir(n,c);if(f){var y=r.slice(1),v=t?[t]:[],E=v.concat(y);this._process(E,a,!1);var C=f.length,L=this.symlinks[n];if(!(L&&c))for(var R=0;R<C;R++){var F=f[R];if(!(F.charAt(0)==="."&&!this.dot)){var V=v.concat(f[R],y);this._process(V,a,!0);var U=v.concat(f[R],r);this._process(U,a,!0)}}}};JU.prototype._processSimple=function(t,e){var n=this._stat(t);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!n){if(t&&lqt(t)&&!this.nomount){var r=/[\/\\]$/.test(t);t.charAt(0)==="/"?t=nPn.join(this.root,t):(t=nPn.resolve(this.root,t),r&&(t+="/"))}process.platform==="win32"&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t)}};JU.prototype._stat=function(t){var e=this._makeAbs(t),n=t.slice(-1)==="/";if(t.length>this.maxLength)return!1;if(!this.stat&&rPn(this.cache,e)){var f=this.cache[e];if(Array.isArray(f)&&(f="DIR"),!n||f==="DIR")return f;if(n&&f==="FILE")return!1}var r,a=this.statCache[e];if(!a){var c;try{c=this.fs.lstatSync(e)}catch(y){if(y&&(y.code==="ENOENT"||y.code==="ENOTDIR"))return this.statCache[e]=!1,!1}if(c&&c.isSymbolicLink())try{a=this.fs.statSync(e)}catch{a=c}else a=c}this.statCache[e]=a;var f=!0;return a&&(f=a.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||f,n&&f==="FILE"?!1:f};JU.prototype._mark=function(t){return rlt.mark(this,t)};JU.prototype._makeAbs=function(t){return rlt.makeAbs(this,t)}});var sPn=Fe((RCo,HSr)=>{HSr.exports=qSr;function qSr(t,e){if(t&&e)return qSr(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(r){n[r]=t[r]}),n;function n(){for(var r=new Array(arguments.length),a=0;a<r.length;a++)r[a]=arguments[a];var c=t.apply(this,r),f=r[r.length-1];return typeof c=="function"&&c!==f&&Object.keys(f).forEach(function(y){c[y]=f[y]}),c}}});var oPn=Fe((MCo,aPn)=>{var JSr=sPn();aPn.exports=JSr(cqt);aPn.exports.strict=JSr($Sr);cqt.proto=cqt(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return cqt(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return $Sr(this)},configurable:!0})});function cqt(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function $Sr(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},n=t.name||"Function wrapped with `once`";return e.onceError=n+" shouldn't be called more than once",e.called=!1,e}});var YSr=Fe((FCo,XSr)=>{var uZi=sPn(),CMt=Object.create(null),fZi=oPn();XSr.exports=uZi(dZi);function dZi(t,e){return CMt[t]?(CMt[t].push(e),null):(CMt[t]=[e],pZi(t))}function pZi(t){return fZi(function e(){var n=CMt[t],r=n.length,a=mZi(arguments);try{for(var c=0;c<r;c++)n[c].apply(null,a)}finally{n.length>r?(n.splice(0,r),process.nextTick(function(){e.apply(null,a)})):delete CMt[t]}})}function mZi(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r]=t[r];return n}});var iPn=Fe((jCo,ZSr)=>{ZSr.exports=ilt;var hZi=JIn(),QSr=sqt(),BCo=QSr.Minimatch,_Zi=r6(),gZi=require("events").EventEmitter,lPn=require("path"),cPn=require("assert"),DMt=oqt(),fPn=KSr(),slt=tPn(),yZi=slt.setopts,uPn=slt.ownProp,dPn=YSr(),WCo=require("util"),xZi=slt.childrenIgnored,vZi=slt.isIgnored,bZi=oPn();function ilt(t,e,n){if(typeof e=="function"&&(n=e,e={}),e||(e={}),e.sync){if(n)throw new TypeError("callback provided to sync glob");return fPn(t,e)}return new SP(t,e,n)}ilt.sync=fPn;var EZi=ilt.GlobSync=fPn.GlobSync;ilt.glob=ilt;function SZi(t,e){if(e===null||typeof e!="object")return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}ilt.hasMagic=function(t,e){var n=SZi({},e);n.noprocess=!0;var r=new SP(t,n),a=r.minimatch.set;if(!t)return!1;if(a.length>1)return!0;for(var c=0;c<a[0].length;c++)if(typeof a[0][c]!="string")return!0;return!1};ilt.Glob=SP;_Zi(SP,gZi);function SP(t,e,n){if(typeof e=="function"&&(n=e,e=null),e&&e.sync){if(n)throw new TypeError("callback provided to sync glob");return new EZi(t,e)}if(!(this instanceof SP))return new SP(t,e,n);yZi(this,t,e),this._didRealPath=!1;var r=this.minimatch.set.length;this.matches=new Array(r),typeof n=="function"&&(n=bZi(n),this.on("error",n),this.on("end",function(v){n(null,v)}));var a=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(r===0)return y();for(var c=!0,f=0;f<r;f++)this._process(this.minimatch.set[f],f,!1,y);c=!1;function y(){--a._processing,a._processing<=0&&(c?process.nextTick(function(){a._finish()}):a._finish())}}SP.prototype._finish=function(){if(cPn(this instanceof SP),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();slt.finish(this),this.emit("end",this.found)}};SP.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var t=this.matches.length;if(t===0)return this._finish();for(var e=this,n=0;n<this.matches.length;n++)this._realpathSet(n,r);function r(){--t===0&&e._finish()}};SP.prototype._realpathSet=function(t,e){var n=this.matches[t];if(!n)return e();var r=Object.keys(n),a=this,c=r.length;if(c===0)return e();var f=this.matches[t]=Object.create(null);r.forEach(function(y,v){y=a._makeAbs(y),hZi.realpath(y,a.realpathCache,function(E,C){E?E.syscall==="stat"?f[y]=!0:a.emit("error",E):f[C]=!0,--c===0&&(a.matches[t]=f,e())})})};SP.prototype._mark=function(t){return slt.mark(this,t)};SP.prototype._makeAbs=function(t){return slt.makeAbs(this,t)};SP.prototype.abort=function(){this.aborted=!0,this.emit("abort")};SP.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};SP.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;e<t.length;e++){var n=t[e];this._emitMatch(n[0],n[1])}}if(this._processQueue.length){var r=this._processQueue.slice(0);this._processQueue.length=0;for(var e=0;e<r.length;e++){var a=r[e];this._processing--,this._process(a[0],a[1],a[2],a[3])}}}};SP.prototype._process=function(t,e,n,r){if(cPn(this instanceof SP),cPn(typeof r=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([t,e,n,r]);return}for(var a=0;typeof t[a]=="string";)a++;var c;switch(a){case t.length:this._processSimple(t.join("/"),e,r);return;case 0:c=null;break;default:c=t.slice(0,a).join("/");break}var f=t.slice(a),y;c===null?y=".":((DMt(c)||DMt(t.map(function(C){return typeof C=="string"?C:"[*]"}).join("/")))&&(!c||!DMt(c))&&(c="/"+c),y=c);var v=this._makeAbs(y);if(xZi(this,y))return r();var E=f[0]===QSr.GLOBSTAR;E?this._processGlobStar(c,y,v,f,e,n,r):this._processReaddir(c,y,v,f,e,n,r)}};SP.prototype._processReaddir=function(t,e,n,r,a,c,f){var y=this;this._readdir(n,c,function(v,E){return y._processReaddir2(t,e,n,r,a,c,E,f)})};SP.prototype._processReaddir2=function(t,e,n,r,a,c,f,y){if(!f)return y();for(var v=r[0],E=!!this.minimatch.negate,C=v._glob,L=this.dot||C.charAt(0)===".",R=[],F=0;F<f.length;F++){var V=f[F];if(V.charAt(0)!=="."||L){var U;E&&!t?U=!V.match(v):U=V.match(v),U&&R.push(V)}}var Q=R.length;if(Q===0)return y();if(r.length===1&&!this.mark&&!this.stat){this.matches[a]||(this.matches[a]=Object.create(null));for(var F=0;F<Q;F++){var V=R[F];t&&(t!=="/"?V=t+"/"+V:V=t+V),V.charAt(0)==="/"&&!this.nomount&&(V=lPn.join(this.root,V)),this._emitMatch(a,V)}return y()}r.shift();for(var F=0;F<Q;F++){var V=R[F],ee;t&&(t!=="/"?V=t+"/"+V:V=t+V),this._process([V].concat(r),a,c,y)}y()};SP.prototype._emitMatch=function(t,e){if(!this.aborted&&!vZi(this,e)){if(this.paused){this._emitQueue.push([t,e]);return}var n=DMt(e)?e:this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=n),!this.matches[t][e]){if(this.nodir){var r=this.cache[n];if(r==="DIR"||Array.isArray(r))return}this.matches[t][e]=!0;var a=this.statCache[n];a&&this.emit("stat",e,a),this.emit("match",e)}}};SP.prototype._readdirInGlobStar=function(t,e){if(this.aborted)return;if(this.follow)return this._readdir(t,!1,e);var n="lstat\0"+t,r=this,a=dPn(n,c);a&&r.fs.lstat(t,a);function c(f,y){if(f&&f.code==="ENOENT")return e();var v=y&&y.isSymbolicLink();r.symlinks[t]=v,!v&&y&&!y.isDirectory()?(r.cache[t]="FILE",e()):r._readdir(t,!1,e)}};SP.prototype._readdir=function(t,e,n){if(!this.aborted&&(n=dPn("readdir\0"+t+"\0"+e,n),!!n)){if(e&&!uPn(this.symlinks,t))return this._readdirInGlobStar(t,n);if(uPn(this.cache,t)){var r=this.cache[t];if(!r||r==="FILE")return n();if(Array.isArray(r))return n(null,r)}var a=this;a.fs.readdir(t,TZi(this,t,n))}};function TZi(t,e,n){return function(r,a){r?t._readdirError(e,r,n):t._readdirEntries(e,a,n)}}SP.prototype._readdirEntries=function(t,e,n){if(!this.aborted){if(!this.mark&&!this.stat)for(var r=0;r<e.length;r++){var a=e[r];t==="/"?a=t+a:a=t+"/"+a,this.cache[a]=!0}return this.cache[t]=e,n(null,e)}};SP.prototype._readdirError=function(t,e,n){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(t);if(this.cache[r]="FILE",r===this.cwdAbs){var a=new Error(e.code+" invalid cwd "+this.cwd);a.path=this.cwd,a.code=e.code,this.emit("error",a),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e);break}return n()}};SP.prototype._processGlobStar=function(t,e,n,r,a,c,f){var y=this;this._readdir(n,c,function(v,E){y._processGlobStar2(t,e,n,r,a,c,E,f)})};SP.prototype._processGlobStar2=function(t,e,n,r,a,c,f,y){if(!f)return y();var v=r.slice(1),E=t?[t]:[],C=E.concat(v);this._process(C,a,!1,y);var L=this.symlinks[n],R=f.length;if(L&&c)return y();for(var F=0;F<R;F++){var V=f[F];if(!(V.charAt(0)==="."&&!this.dot)){var U=E.concat(f[F],v);this._process(U,a,!0,y);var Q=E.concat(f[F],r);this._process(Q,a,!0,y)}}y()};SP.prototype._processSimple=function(t,e,n){var r=this;this._stat(t,function(a,c){r._processSimple2(t,e,a,c,n)})};SP.prototype._processSimple2=function(t,e,n,r,a){if(this.matches[e]||(this.matches[e]=Object.create(null)),!r)return a();if(t&&DMt(t)&&!this.nomount){var c=/[\/\\]$/.test(t);t.charAt(0)==="/"?t=lPn.join(this.root,t):(t=lPn.resolve(this.root,t),c&&(t+="/"))}process.platform==="win32"&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t),a()};SP.prototype._stat=function(t,e){var n=this._makeAbs(t),r=t.slice(-1)==="/";if(t.length>this.maxLength)return e();if(!this.stat&&uPn(this.cache,n)){var a=this.cache[n];if(Array.isArray(a)&&(a="DIR"),!r||a==="DIR")return e(null,a);if(r&&a==="FILE")return e()}var c,f=this.statCache[n];if(f!==void 0){if(f===!1)return e(null,f);var y=f.isDirectory()?"DIR":"FILE";return r&&y==="FILE"?e():e(null,y,f)}var v=this,E=dPn("stat\0"+n,C);E&&v.fs.lstat(n,E);function C(L,R){if(R&&R.isSymbolicLink())return v.fs.stat(n,function(F,V){F?v._stat2(t,n,null,R,e):v._stat2(t,n,F,V,e)});v._stat2(t,n,L,R,e)}};SP.prototype._stat2=function(t,e,n,r,a){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return this.statCache[e]=!1,a();var c=t.slice(-1)==="/";if(this.statCache[e]=r,e.slice(-1)==="/"&&r&&!r.isDirectory())return a(null,!1,r);var f=!0;return r&&(f=r.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||f,c&&f==="FILE"?a():a(null,f,r)}});var _Pn=Fe((GCo,o2r)=>{o2r.exports=hPn;hPn.sync=a2r;var RI=require("assert"),r2r=require("path"),e2r=require("fs"),m1t=void 0;try{m1t=iPn()}catch{}var i2r=parseInt("666",8),AZi={nosort:!0,silent:!0},pPn=0,wMt=process.platform==="win32";function s2r(t){var e=["unlink","chmod","stat","lstat","rmdir","readdir"];if(e.forEach(function(n){t[n]=t[n]||e2r[n],n=n+"Sync",t[n]=t[n]||e2r[n]}),t.maxBusyTries=t.maxBusyTries||3,t.emfileWait=t.emfileWait||1e3,t.glob===!1&&(t.disableGlob=!0),t.disableGlob!==!0&&m1t===void 0)throw Error("glob dependency not found, set `options.disableGlob = true` if intentional");t.disableGlob=t.disableGlob||!1,t.glob=t.glob||AZi}function hPn(t,e,n){typeof e=="function"&&(n=e,e={}),RI(t,"rimraf: missing path"),RI.equal(typeof t,"string","rimraf: path should be a string"),RI.equal(typeof n,"function","rimraf: callback function required"),RI(e,"rimraf: invalid options argument provided"),RI.equal(typeof e,"object","rimraf: options should be object"),s2r(e);var r=0,a=null,c=0;if(e.disableGlob||!m1t.hasMagic(t))return y(null,[t]);e.lstat(t,function(v,E){if(!v)return y(null,[t]);m1t(t,e.glob,y)});function f(v){a=a||v,--c===0&&n(a)}function y(v,E){if(v)return n(v);if(c=E.length,c===0)return n();E.forEach(function(C){mPn(C,e,function L(R){if(R){if((R.code==="EBUSY"||R.code==="ENOTEMPTY"||R.code==="EPERM")&&r<e.maxBusyTries){r++;var F=r*100;return setTimeout(function(){mPn(C,e,L)},F)}if(R.code==="EMFILE"&&pPn<e.emfileWait)return setTimeout(function(){mPn(C,e,L)},pPn++);R.code==="ENOENT"&&(R=null)}pPn=0,f(R)})})}}function mPn(t,e,n){RI(t),RI(e),RI(typeof n=="function"),e.lstat(t,function(r,a){if(r&&r.code==="ENOENT")return n(null);if(r&&r.code==="EPERM"&&wMt&&t2r(t,e,r,n),a&&a.isDirectory())return uqt(t,e,r,n);e.unlink(t,function(c){if(c){if(c.code==="ENOENT")return n(null);if(c.code==="EPERM")return wMt?t2r(t,e,c,n):uqt(t,e,c,n);if(c.code==="EISDIR")return uqt(t,e,c,n)}return n(c)})})}function t2r(t,e,n,r){RI(t),RI(e),RI(typeof r=="function"),n&&RI(n instanceof Error),e.chmod(t,i2r,function(a){a?r(a.code==="ENOENT"?null:n):e.stat(t,function(c,f){c?r(c.code==="ENOENT"?null:n):f.isDirectory()?uqt(t,e,n,r):e.unlink(t,r)})})}function n2r(t,e,n){RI(t),RI(e),n&&RI(n instanceof Error);try{e.chmodSync(t,i2r)}catch(a){if(a.code==="ENOENT")return;throw n}try{var r=e.statSync(t)}catch(a){if(a.code==="ENOENT")return;throw n}r.isDirectory()?fqt(t,e,n):e.unlinkSync(t)}function uqt(t,e,n,r){RI(t),RI(e),n&&RI(n instanceof Error),RI(typeof r=="function"),e.rmdir(t,function(a){a&&(a.code==="ENOTEMPTY"||a.code==="EEXIST"||a.code==="EPERM")?CZi(t,e,r):a&&a.code==="ENOTDIR"?r(n):r(a)})}function CZi(t,e,n){RI(t),RI(e),RI(typeof n=="function"),e.readdir(t,function(r,a){if(r)return n(r);var c=a.length;if(c===0)return e.rmdir(t,n);var f;a.forEach(function(y){hPn(r2r.join(t,y),e,function(v){if(!f){if(v)return n(f=v);--c===0&&e.rmdir(t,n)}})})})}function a2r(t,e){e=e||{},s2r(e),RI(t,"rimraf: missing path"),RI.equal(typeof t,"string","rimraf: path should be a string"),RI(e,"rimraf: missing options"),RI.equal(typeof e,"object","rimraf: options should be object");var n;if(e.disableGlob||!m1t.hasMagic(t))n=[t];else try{e.lstatSync(t),n=[t]}catch{n=m1t.sync(t,e.glob)}if(n.length)for(var r=0;r<n.length;r++){var t=n[r];try{var a=e.lstatSync(t)}catch(f){if(f.code==="ENOENT")return;f.code==="EPERM"&&wMt&&n2r(t,e,f)}try{a&&a.isDirectory()?fqt(t,e,null):e.unlinkSync(t)}catch(f){if(f.code==="ENOENT")return;if(f.code==="EPERM")return wMt?n2r(t,e,f):fqt(t,e,f);if(f.code!=="EISDIR")throw f;fqt(t,e,f)}}}function fqt(t,e,n){RI(t),RI(e),n&&RI(n instanceof Error);try{e.rmdirSync(t)}catch(r){if(r.code==="ENOENT")return;if(r.code==="ENOTDIR")throw n;(r.code==="ENOTEMPTY"||r.code==="EEXIST"||r.code==="EPERM")&&DZi(t,e)}}function DZi(t,e){RI(t),RI(e),e.readdirSync(t).forEach(function(f){a2r(r2r.join(t,f),e)});var n=wMt?100:1,r=0;do{var a=!0;try{var c=e.rmdirSync(t,e);return a=!1,c}finally{if(++r<n&&a)continue}}while(!0)}});var gPn=Fe((UCo,u2r)=>{var IMt=require("path"),l2r=require("fs"),c2r=parseInt("0777",8);u2r.exports=h1t.mkdirp=h1t.mkdirP=h1t;function h1t(t,e,n,r){typeof e=="function"?(n=e,e={}):(!e||typeof e!="object")&&(e={mode:e});var a=e.mode,c=e.fs||l2r;a===void 0&&(a=c2r),r||(r=null);var f=n||function(){};t=IMt.resolve(t),c.mkdir(t,a,function(y){if(!y)return r=r||t,f(null,r);switch(y.code){case"ENOENT":if(IMt.dirname(t)===t)return f(y);h1t(IMt.dirname(t),e,function(v,E){v?f(v,E):h1t(t,e,f,E)});break;default:c.stat(t,function(v,E){v||!E.isDirectory()?f(y,r):f(null,r)});break}})}h1t.sync=function t(e,n,r){(!n||typeof n!="object")&&(n={mode:n});var a=n.mode,c=n.fs||l2r;a===void 0&&(a=c2r),r||(r=null),e=IMt.resolve(e);try{c.mkdirSync(e,a),r=r||e}catch(y){switch(y.code){case"ENOENT":r=t(IMt.dirname(e),n,r),t(e,n,r);break;default:var f;try{f=c.statSync(e)}catch{throw y}if(!f.isDirectory())throw y;break}}return r}});var dqt=Fe((VCo,f2r)=>{f2r.exports=yPn;function yPn(t){if(t._collected)return;if(t._paused)return t.on("resume",yPn.bind(null,t));t._collected=!0,t.pause(),t.on("data",n),t.on("end",n);var e=[];function n(f){typeof f=="string"&&(f=new Buffer(f)),!(Buffer.isBuffer(f)&&!f.length)&&e.push(f)}t.on("entry",a);var r=[];function a(f){yPn(f),r.push(f)}t.on("proxy",c);function c(f){f.pause()}t.pipe=function(f){return function(y){var v=0;(function C(){var L=r[v++];if(!L)return E();L.on("end",C),y?y.add(L):t.emit("entry",L)})();function E(){t.removeListener("entry",a),t.removeListener("data",n),t.removeListener("end",n),t.pipe=f,y&&t.pipe(y),e.forEach(function(C){C?t.emit("data",C):t.emit("end")}),t.resume()}return y}}(t.pipe)}});var xPn=Fe((zCo,p2r)=>{p2r.exports=Jqe;var pqt=_1t(),wZi=r6(),IZi=gPn(),d2r=require("path"),PZi=dqt();wZi(Jqe,pqt);function Jqe(t){var e=this;e instanceof Jqe||e.error("DirWriter must be called as constructor.",null,!0),(t.type!=="Directory"||!t.Directory)&&e.error("Non-directory type "+t.type+" "+JSON.stringify(t),null,!0),pqt.call(this,t)}Jqe.prototype._create=function(){var t=this;IZi(t._path,pqt.dirmode,function(e){if(e)return t.error(e);t.ready=!0,t.emit("ready"),t._process()})};Jqe.prototype.write=function(){return!0};Jqe.prototype.end=function(){this._ended=!0,this._process()};Jqe.prototype.add=function(t){var e=this;return PZi(t),!e.ready||e._currentEntry?(e._buffer.push(t),!1):e._ended?e.error("add after end"):(e._buffer.push(t),e._process(),this._buffer.length===0)};Jqe.prototype._process=function(){var t=this;if(t._processing)return;var e=t._buffer.shift();if(!e){t.emit("drain"),t._ended&&t._finish();return}t._processing=!0,t.emit("entry",e);var n=e,r;do{if(r=n._path||n.path,r===t.root._path||r===t._path||r&&r.indexOf(t._path)===0)return t._processing=!1,e._collected&&e.pipe(),t._process();n=n.parent}while(n);var a={parent:t,root:t.root||t,type:e.type,depth:t.depth+1};r=e._path||e.path||e.props.path,e.parent&&(r=r.substr(e.parent._path.length+1)),a.path=d2r.join(t.path,d2r.join("/",r)),a.filter=t.filter,Object.keys(e.props).forEach(function(v){a.hasOwnProperty(v)||(a[v]=e.props[v])});var c=t._currentChild=new pqt(a);c.on("ready",function(){e.pipe(c),e.resume()}),c.on("error",function(v){c._swallowErrors?(t.warn(v),c.emit("end"),c.emit("close")):t.emit("error",v)}),c.on("close",y);var f=!1;function y(){f||(f=!0,t._currentChild=null,t._processing=!1,t._process())}}});var vPn=Fe((KCo,y2r)=>{y2r.exports=PMt;var h2r=MPe(),_2r=_1t(),NZi=r6(),kZi=require("path"),LZi=_Pn();NZi(PMt,_2r);function PMt(t){var e=this;if(!(e instanceof PMt))throw new Error("LinkWriter must be called as constructor.");if(!(t.type==="Link"&&t.Link||t.type==="SymbolicLink"&&t.SymbolicLink))throw new Error("Non-link type "+t.type);t.linkpath===""&&(t.linkpath="."),t.linkpath||e.error("Need linkpath property to create "+t.type),_2r.call(this,t)}PMt.prototype._create=function(){var t=this,e=t.type==="Link"||process.platform==="win32",n=e?"link":"symlink",r=e?kZi.resolve(t.dirname,t.linkpath):t.linkpath;if(e)return m2r(t,r,n);h2r.readlink(t._path,function(a,c){if(c&&c===r)return g2r(t);m2r(t,r,n)})};function m2r(t,e,n){LZi(t._path,function(r){if(r)return t.error(r);OZi(t,e,n)})}function OZi(t,e,n){h2r[n](e,t._path,function(r){if(r)if((r.code==="ENOENT"||r.code==="EACCES"||r.code==="EPERM")&&process.platform==="win32")t.ready=!0,t.emit("ready"),t.emit("end"),t.emit("close"),t.end=t._finish=function(){};else return t.error(r);g2r(t)})}function g2r(t){t.ready=!0,t.emit("ready"),t._ended&&!t._finished&&t._finish()}PMt.prototype.end=function(){this._ended=!0,this.ready&&(this._finished=!0,this._finish())}});var bPn=Fe((qCo,v2r)=>{v2r.exports=alt;var RZi=MPe(),mqt=_1t(),MZi=r6(),x2r={};MZi(alt,mqt);function alt(t){var e=this;if(!(e instanceof alt))throw new Error("FileWriter must be called as constructor.");if(t.type!=="File"||!t.File)throw new Error("Non-file type "+t.type);e._buffer=[],e._bytesWritten=0,mqt.call(this,t)}alt.prototype._create=function(){var t=this;if(!t._stream){var e={};t.props.flags&&(e.flags=t.props.flags),e.mode=mqt.filemode,t._old&&t._old.blksize&&(e.bufferSize=t._old.blksize),t._stream=RZi.createWriteStream(t._path,e),t._stream.on("open",function(){t.ready=!0,t._buffer.forEach(function(n){n===x2r?t._stream.end():t._stream.write(n)}),t.emit("ready"),t.emit("drain")}),t._stream.on("error",function(n){t.emit("error",n)}),t._stream.on("drain",function(){t.emit("drain")}),t._stream.on("close",function(){t._finish()})}};alt.prototype.write=function(t){var e=this;if(e._bytesWritten+=t.length,!e.ready){if(!Buffer.isBuffer(t)&&typeof t!="string")throw new Error("invalid write data");return e._buffer.push(t),!1}var n=e._stream.write(t);return n===!1&&e._stream._queue?e._stream._queue.length<=2:n};alt.prototype.end=function(t){var e=this;return t&&e.write(t),e.ready?e._stream.end():(e._buffer.push(x2r),!1)};alt.prototype._finish=function(){var t=this;typeof t.size=="number"&&t._bytesWritten!==t.size&&t.error(`Did not get expected byte count.
|
|
861
861
|
expect: `+t.size+`
|
|
862
862
|
actual: `+t._bytesWritten),mqt.prototype._finish.call(t)}});var SPn=Fe((HCo,b2r)=>{b2r.exports=$qe;var EPn=_1t(),FZi=vMt(),BZi=r6(),WZi=dqt(),jZi=require("fs");BZi($qe,EPn);function $qe(t){var e=this;if(!(e instanceof $qe))throw new Error("ProxyWriter must be called as constructor.");e.props=t,e._needDrain=!1,EPn.call(e,t)}$qe.prototype._stat=function(){var t=this,e=t.props,n=e.follow?"stat":"lstat";jZi[n](e.path,function(r,a){var c;r||!a?c="File":c=FZi(a),e[c]=!0,e.type=t.type=c,t._old=a,t._addProxy(EPn(e,a))})};$qe.prototype._addProxy=function(t){var e=this;if(e._proxy)return e.error("proxy already set");e._proxy=t,["ready","error","close","pipe","drain","warn"].forEach(function(r){t.on(r,e.emit.bind(e,r))}),e.emit("proxy",t);var n=e._buffer;n.forEach(function(r){t[r[0]].apply(t,r[1])}),e._buffer.length=0,e._needsDrain&&e.emit("drain")};$qe.prototype.add=function(t){return WZi(t),this._proxy?this._proxy.add(t):(this._buffer.push(["add",[t]]),this._needDrain=!0,!1)};$qe.prototype.write=function(t){return this._proxy?this._proxy.write(t):(this._buffer.push(["write",[t]]),this._needDrain=!0,!1)};$qe.prototype.end=function(t){return this._proxy?this._proxy.end(t):(this._buffer.push(["end",[t]]),!1)}});var _1t=Fe((JCo,P2r)=>{P2r.exports=Y_e;var X_e=MPe(),GZi=r6(),UZi=_Pn(),VZi=gPn(),NMt=require("path"),S2r=process.platform==="win32"?0:process.umask(),T2r=vMt(),A2r=XKt();GZi(Y_e,A2r);Y_e.dirmode=parseInt("0777",8)&~S2r;Y_e.filemode=parseInt("0666",8)&~S2r;var zZi=xPn(),KZi=vPn(),qZi=bPn(),HZi=SPn();function Y_e(t,e){var n=this;typeof t=="string"&&(t={path:t});var r=T2r(t),a=Y_e;switch(r){case"Directory":a=zZi;break;case"File":a=qZi;break;case"Link":case"SymbolicLink":a=KZi;break;case null:default:a=HZi;break}if(!(n instanceof a))return new a(t);A2r.call(n),t.path||n.error("Must provide a path",null,!0),n.type=t.type,n.props=t,n.depth=t.depth||0,n.clobber=t.clobber===!1?t.clobber:!0,n.parent=t.parent||null,n.root=t.root||t.parent&&t.parent.root||n,n._path=n.path=NMt.resolve(t.path),process.platform==="win32"&&(n.path=n._path=n.path.replace(/\?/g,"_"),n._path.length>=260&&(n._swallowErrors=!0,n._path="\\\\?\\"+n.path.replace(/\//g,"\\"))),n.basename=NMt.basename(t.path),n.dirname=NMt.dirname(t.path),n.linkpath=t.linkpath||null,t.parent=t.root=null,n.size=t.size,typeof t.mode=="string"&&(t.mode=parseInt(t.mode,8)),n.readable=!1,n.writable=!0,n._buffer=[],n.ready=!1,n.filter=typeof t.filter=="function"?t.filter:null,n._stat(e)}Y_e.prototype._create=function(){var t=this;X_e[t.props.follow?"stat":"lstat"](t._path,function(e){if(e)return t.warn("Cannot create "+t._path+`
|
|
863
|
-
Unsupported type: `+t.type,"ENOTSUP");t._finish()})};Y_e.prototype._stat=function(t){var e=this,n=e.props,r=n.follow?"stat":"lstat",a=e._proxy||e;t?c(null,t):X_e[r](e._path,c);function c(f,y){if(e.filter&&!e.filter.call(a,a,y)){e._aborted=!0,e.emit("end"),e.emit("close");return}if(f||!y)return TPn(e);e._old=y;var v=T2r(y);if(v!==e.type||e.type==="File"&&y.nlink>1)return UZi(e._path,function(E){if(E)return e.error(E);e._old=null,TPn(e)});TPn(e)}};function TPn(t){VZi(NMt.dirname(t._path),Y_e.dirmode,function(e,n){return e?t.error(e):(t._madeDir=n,t._create())})}function C2r(t,e,n,r,a){var c=e.mode,f=e.follow||t.type!=="SymbolicLink"?"chmod":"lchmod";if(!X_e[f]||typeof c!="number")return a();var y=n.mode&parseInt("0777",8);if(c=c&parseInt("0777",8),c===y)return a();X_e[f](r,c,a)}function D2r(t,e,n,r,a){if(process.platform==="win32"||!process.getuid||process.getuid()!==0||typeof e.uid!="number"&&typeof e.gid!="number"||n.uid===e.uid&&n.gid===e.gid)return a();var c=t.props.follow||t.type!=="SymbolicLink"?"chown":"lchown";if(!X_e[c])return a();typeof e.uid!="number"&&(e.uid=n.uid),typeof e.gid!="number"&&(e.gid=n.gid),X_e[c](r,e.uid,e.gid,a)}function w2r(t,e,n,r,a){if(!X_e.utimes||process.platform==="win32")return a();var c=e.follow||t.type!=="SymbolicLink"?"utimes":"lutimes";if(c==="lutimes"&&!X_e[c]&&(c="utimes"),!X_e[c])return a();var f=n.atime,y=n.mtime,v=e.atime,E=e.mtime;if(v===void 0&&(v=f),E===void 0&&(E=y),E2r(v)||(v=new Date(v)),E2r(E)||(v=new Date(E)),v.getTime()===f.getTime()&&E.getTime()===y.getTime())return a();X_e[c](r,v,E,a)}Y_e.prototype._finish=function(){var t=this;if(t._finishing)return;t._finishing=!0;var e=0,n=null,r=!1;if(t._old)t._old.atime=new Date(0),t._old.mtime=new Date(0),c(t._old);else{var a=t.props.follow?"stat":"lstat";X_e[a](t._path,function(y,v){if(y)if(y.code==="ENOENT"&&(t.type==="Link"||t.type==="SymbolicLink")&&process.platform==="win32"){t.ready=!0,t.emit("ready"),t.emit("end"),t.emit("close"),t.end=t._finish=function(){};return}else return t.error(y);c(t._old=v)})}return;function c(y){e+=3,C2r(t,t.props,y,t._path,f("chmod")),D2r(t,t.props,y,t._path,f("chown")),w2r(t,t.props,y,t._path,f("utimes"))}function f(y){return function(v){if(n)return;if(v)return v.fstream_finish_call=y,t.error(n=v);if(--e>0||r)return;if(r=!0,t._madeDir)I2r(t,t._path,E);else return E();function E(C){if(C)return C.fstream_finish_call="setupMadeDir",t.error(C);t.emit("end"),t.emit("close")}}}};function I2r(t,e,n){var r=t._madeDir,a=NMt.dirname(e);JZi(t,a,function(c){if(c)return n(c);if(a===r)return n();I2r(t,a,n)})}function JZi(t,e,n){var r={};Object.keys(t.props).forEach(function(y){r[y]=t.props[y],y==="mode"&&t.type!=="Directory"&&(r[y]=r[y]|parseInt("0111",8))});var a=3,c=null;X_e.stat(e,function(y,v){if(y)return n(c=y);C2r(t,r,v,e,f),D2r(t,r,v,e,f),w2r(t,r,v,e,f)});function f(y){if(!c){if(y)return n(c=y);if(--a===0)return n()}}}Y_e.prototype.pipe=function(){this.error("Can't pipe from writable stream")};Y_e.prototype.add=function(){this.error("Can't add to non-Directory type")};Y_e.prototype.write=function(){return!0};function $Zi(t){return Object.prototype.toString.call(t)}function E2r(t){return typeof t=="object"&&$Zi(t)==="[object Date]"}});var APn=Fe(jD=>{jD.Abstract=XKt();jD.Reader=Zot();jD.Writer=_1t();jD.File={Reader:WIn(),Writer:bPn()};jD.Dir={Reader:BIn(),Writer:xPn()};jD.Link={Reader:MIn(),Writer:vPn()};jD.Proxy={Reader:GIn(),Writer:SPn()};jD.Reader.Dir=jD.DirReader=jD.Dir.Reader;jD.Reader.File=jD.FileReader=jD.File.Reader;jD.Reader.Link=jD.LinkReader=jD.Link.Reader;jD.Reader.Proxy=jD.ProxyReader=jD.Proxy.Reader;jD.Writer.Dir=jD.DirWriter=jD.Dir.Writer;jD.Writer.File=jD.FileWriter=jD.File.Writer;jD.Writer.Link=jD.LinkWriter=jD.Link.Writer;jD.Writer.Proxy=jD.ProxyWriter=jD.Proxy.Writer;jD.collect=dqt()});var k2r=Fe((XCo,N2r)=>{N2r.exports=tes;var XZi=BKt(),YZi=APn().Writer,CPn=require("path"),QZi=require("stream"),ZZi=wIn(),ees=Wqe();function tes(t){t.path=CPn.resolve(CPn.normalize(t.path));var e=new XZi(t),n=new QZi.Writable({objectMode:!0});n._write=function(a,c,f){if(a.type=="Directory")return f();var y=CPn.join(t.path,a.path.replace(/\\/g,"/"));if(y.indexOf(t.path)!=0)return f();let v=t.getWriter?t.getWriter({path:y}):YZi({path:y});a.pipe(v).on("error",f).on("close",f)};var r=ZZi(e,n);return e.once("crx-header",function(a){r.crxHeader=a}),e.pipe(n).on("finish",function(){r.emit("close")}),r.promise=function(){return new ees(function(a,c){r.on("close",a),r.on("error",c)})},r}});var L2r=Fe((YCo,hqt)=>{var $U=function(t){"use strict";var e=1e7,n=7,r=9007199254740992,a=R(r),c="0123456789abcdefghijklmnopqrstuvwxyz",f=typeof BigInt=="function";function y(An,Dr,Rr,Vi){return typeof An>"u"?y[0]:typeof Dr<"u"?+Dr==10&&!Rr?Oa(An):Aa(An,Dr,Rr,Vi):Oa(An)}function v(An,Dr){this.value=An,this.sign=Dr,this.isSmall=!1}v.prototype=Object.create(y.prototype);function E(An){this.value=An,this.sign=An<0,this.isSmall=!0}E.prototype=Object.create(y.prototype);function C(An){this.value=An}C.prototype=Object.create(y.prototype);function L(An){return-r<An&&An<r}function R(An){return An<1e7?[An]:An<1e14?[An%1e7,Math.floor(An/1e7)]:[An%1e7,Math.floor(An/1e7)%1e7,Math.floor(An/1e14)]}function F(An){V(An);var Dr=An.length;if(Dr<4&&yr(An,a)<0)switch(Dr){case 0:return 0;case 1:return An[0];case 2:return An[0]+An[1]*e;default:return An[0]+(An[1]+An[2]*e)*e}return An}function V(An){for(var Dr=An.length;An[--Dr]===0;);An.length=Dr+1}function U(An){for(var Dr=new Array(An),Rr=-1;++Rr<An;)Dr[Rr]=0;return Dr}function Q(An){return An>0?Math.floor(An):Math.ceil(An)}function ee(An,Dr){var Rr=An.length,Vi=Dr.length,qt=new Array(Rr),Es=0,Eo=e,bi,io;for(io=0;io<Vi;io++)bi=An[io]+Dr[io]+Es,Es=bi>=Eo?1:0,qt[io]=bi-Es*Eo;for(;io<Rr;)bi=An[io]+Es,Es=bi===Eo?1:0,qt[io++]=bi-Es*Eo;return Es>0&&qt.push(Es),qt}function ge(An,Dr){return An.length>=Dr.length?ee(An,Dr):ee(Dr,An)}function Oe(An,Dr){var Rr=An.length,Vi=new Array(Rr),qt=e,Es,Eo;for(Eo=0;Eo<Rr;Eo++)Es=An[Eo]-qt+Dr,Dr=Math.floor(Es/qt),Vi[Eo]=Es-Dr*qt,Dr+=1;for(;Dr>0;)Vi[Eo++]=Dr%qt,Dr=Math.floor(Dr/qt);return Vi}v.prototype.add=function(An){var Dr=Oa(An);if(this.sign!==Dr.sign)return this.subtract(Dr.negate());var Rr=this.value,Vi=Dr.value;return Dr.isSmall?new v(Oe(Rr,Math.abs(Vi)),this.sign):new v(ge(Rr,Vi),this.sign)},v.prototype.plus=v.prototype.add,E.prototype.add=function(An){var Dr=Oa(An),Rr=this.value;if(Rr<0!==Dr.sign)return this.subtract(Dr.negate());var Vi=Dr.value;if(Dr.isSmall){if(L(Rr+Vi))return new E(Rr+Vi);Vi=R(Math.abs(Vi))}return new v(Oe(Vi,Math.abs(Rr)),Rr<0)},E.prototype.plus=E.prototype.add,C.prototype.add=function(An){return new C(this.value+Oa(An).value)},C.prototype.plus=C.prototype.add;function Se(An,Dr){var Rr=An.length,Vi=Dr.length,qt=new Array(Rr),Es=0,Eo=e,bi,io;for(bi=0;bi<Vi;bi++)io=An[bi]-Es-Dr[bi],io<0?(io+=Eo,Es=1):Es=0,qt[bi]=io;for(bi=Vi;bi<Rr;bi++){if(io=An[bi]-Es,io<0)io+=Eo;else{qt[bi++]=io;break}qt[bi]=io}for(;bi<Rr;bi++)qt[bi]=An[bi];return V(qt),qt}function Ze(An,Dr,Rr){var Vi;return yr(An,Dr)>=0?Vi=Se(An,Dr):(Vi=Se(Dr,An),Rr=!Rr),Vi=F(Vi),typeof Vi=="number"?(Rr&&(Vi=-Vi),new E(Vi)):new v(Vi,Rr)}function Lt(An,Dr,Rr){var Vi=An.length,qt=new Array(Vi),Es=-Dr,Eo=e,bi,io;for(bi=0;bi<Vi;bi++)io=An[bi]+Es,Es=Math.floor(io/Eo),io%=Eo,qt[bi]=io<0?io+Eo:io;return qt=F(qt),typeof qt=="number"?(Rr&&(qt=-qt),new E(qt)):new v(qt,Rr)}v.prototype.subtract=function(An){var Dr=Oa(An);if(this.sign!==Dr.sign)return this.add(Dr.negate());var Rr=this.value,Vi=Dr.value;return Dr.isSmall?Lt(Rr,Math.abs(Vi),this.sign):Ze(Rr,Vi,this.sign)},v.prototype.minus=v.prototype.subtract,E.prototype.subtract=function(An){var Dr=Oa(An),Rr=this.value;if(Rr<0!==Dr.sign)return this.add(Dr.negate());var Vi=Dr.value;return Dr.isSmall?new E(Rr-Vi):Lt(Vi,Math.abs(Rr),Rr>=0)},E.prototype.minus=E.prototype.subtract,C.prototype.subtract=function(An){return new C(this.value-Oa(An).value)},C.prototype.minus=C.prototype.subtract,v.prototype.negate=function(){return new v(this.value,!this.sign)},E.prototype.negate=function(){var An=this.sign,Dr=new E(-this.value);return Dr.sign=!An,Dr},C.prototype.negate=function(){return new C(-this.value)},v.prototype.abs=function(){return new v(this.value,!1)},E.prototype.abs=function(){return new E(Math.abs(this.value))},C.prototype.abs=function(){return new C(this.value>=0?this.value:-this.value)};function qe(An,Dr){var Rr=An.length,Vi=Dr.length,qt=Rr+Vi,Es=U(qt),Eo=e,bi,io,Dc,Kp,op;for(Dc=0;Dc<Rr;++Dc){Kp=An[Dc];for(var C0=0;C0<Vi;++C0)op=Dr[C0],bi=Kp*op+Es[Dc+C0],io=Math.floor(bi/Eo),Es[Dc+C0]=bi-io*Eo,Es[Dc+C0+1]+=io}return V(Es),Es}function rt(An,Dr){var Rr=An.length,Vi=new Array(Rr),qt=e,Es=0,Eo,bi;for(bi=0;bi<Rr;bi++)Eo=An[bi]*Dr+Es,Es=Math.floor(Eo/qt),Vi[bi]=Eo-Es*qt;for(;Es>0;)Vi[bi++]=Es%qt,Es=Math.floor(Es/qt);return Vi}function Wt(An,Dr){for(var Rr=[];Dr-- >0;)Rr.push(0);return Rr.concat(An)}function tn(An,Dr){var Rr=Math.max(An.length,Dr.length);if(Rr<=30)return qe(An,Dr);Rr=Math.ceil(Rr/2);var Vi=An.slice(Rr),qt=An.slice(0,Rr),Es=Dr.slice(Rr),Eo=Dr.slice(0,Rr),bi=tn(qt,Eo),io=tn(Vi,Es),Dc=tn(ge(qt,Vi),ge(Eo,Es)),Kp=ge(ge(bi,Wt(Se(Se(Dc,bi),io),Rr)),Wt(io,2*Rr));return V(Kp),Kp}function lt(An,Dr){return-.012*An-.012*Dr+15e-6*An*Dr>0}v.prototype.multiply=function(An){var Dr=Oa(An),Rr=this.value,Vi=Dr.value,qt=this.sign!==Dr.sign,Es;if(Dr.isSmall){if(Vi===0)return y[0];if(Vi===1)return this;if(Vi===-1)return this.negate();if(Es=Math.abs(Vi),Es<e)return new v(rt(Rr,Es),qt);Vi=R(Es)}return lt(Rr.length,Vi.length)?new v(tn(Rr,Vi),qt):new v(qe(Rr,Vi),qt)},v.prototype.times=v.prototype.multiply;function xn(An,Dr,Rr){return An<e?new v(rt(Dr,An),Rr):new v(qe(Dr,R(An)),Rr)}E.prototype._multiplyBySmall=function(An){return L(An.value*this.value)?new E(An.value*this.value):xn(Math.abs(An.value),R(Math.abs(this.value)),this.sign!==An.sign)},v.prototype._multiplyBySmall=function(An){return An.value===0?y[0]:An.value===1?this:An.value===-1?this.negate():xn(Math.abs(An.value),this.value,this.sign!==An.sign)},E.prototype.multiply=function(An){return Oa(An)._multiplyBySmall(this)},E.prototype.times=E.prototype.multiply,C.prototype.multiply=function(An){return new C(this.value*Oa(An).value)},C.prototype.times=C.prototype.multiply;function mr(An){var Dr=An.length,Rr=U(Dr+Dr),Vi=e,qt,Es,Eo,bi,io;for(Eo=0;Eo<Dr;Eo++){bi=An[Eo],Es=0-bi*bi;for(var Dc=Eo;Dc<Dr;Dc++)io=An[Dc],qt=2*(bi*io)+Rr[Eo+Dc]+Es,Es=Math.floor(qt/Vi),Rr[Eo+Dc]=qt-Es*Vi;Rr[Eo+Dr]=Es}return V(Rr),Rr}v.prototype.square=function(){return new v(mr(this.value),!1)},E.prototype.square=function(){var An=this.value*this.value;return L(An)?new E(An):new v(mr(R(Math.abs(this.value))),!1)},C.prototype.square=function(An){return new C(this.value*this.value)};function sn(An,Dr){var Rr=An.length,Vi=Dr.length,qt=e,Es=U(Dr.length),Eo=Dr[Vi-1],bi=Math.ceil(qt/(2*Eo)),io=rt(An,bi),Dc=rt(Dr,bi),Kp,op,C0,m_,Iy,Bm,kl;for(io.length<=Rr&&io.push(0),Dc.push(0),Eo=Dc[Vi-1],op=Rr-Vi;op>=0;op--){for(Kp=qt-1,io[op+Vi]!==Eo&&(Kp=Math.floor((io[op+Vi]*qt+io[op+Vi-1])/Eo)),C0=0,m_=0,Bm=Dc.length,Iy=0;Iy<Bm;Iy++)C0+=Kp*Dc[Iy],kl=Math.floor(C0/qt),m_+=io[op+Iy]-(C0-kl*qt),C0=kl,m_<0?(io[op+Iy]=m_+qt,m_=-1):(io[op+Iy]=m_,m_=0);for(;m_!==0;){for(Kp-=1,C0=0,Iy=0;Iy<Bm;Iy++)C0+=io[op+Iy]-qt+Dc[Iy],C0<0?(io[op+Iy]=C0+qt,C0=0):(io[op+Iy]=C0,C0=1);m_+=C0}Es[op]=Kp}return io=Pn(io,bi)[0],[F(Es),F(io)]}function $r(An,Dr){for(var Rr=An.length,Vi=Dr.length,qt=[],Es=[],Eo=e,bi,io,Dc,Kp,op;Rr;){if(Es.unshift(An[--Rr]),V(Es),yr(Es,Dr)<0){qt.push(0);continue}io=Es.length,Dc=Es[io-1]*Eo+Es[io-2],Kp=Dr[Vi-1]*Eo+Dr[Vi-2],io>Vi&&(Dc=(Dc+1)*Eo),bi=Math.ceil(Dc/Kp);do{if(op=rt(Dr,bi),yr(op,Es)<=0)break;bi--}while(bi);qt.push(bi),Es=Se(Es,op)}return qt.reverse(),[F(qt),F(Es)]}function Pn(An,Dr){var Rr=An.length,Vi=U(Rr),qt=e,Es,Eo,bi,io;for(bi=0,Es=Rr-1;Es>=0;--Es)io=bi*qt+An[Es],Eo=Q(io/Dr),bi=io-Eo*Dr,Vi[Es]=Eo|0;return[Vi,bi|0]}function hr(An,Dr){var Rr,Vi=Oa(Dr);if(f)return[new C(An.value/Vi.value),new C(An.value%Vi.value)];var qt=An.value,Es=Vi.value,Eo;if(Es===0)throw new Error("Cannot divide by zero");if(An.isSmall)return Vi.isSmall?[new E(Q(qt/Es)),new E(qt%Es)]:[y[0],An];if(Vi.isSmall){if(Es===1)return[An,y[0]];if(Es==-1)return[An.negate(),y[0]];var bi=Math.abs(Es);if(bi<e){Rr=Pn(qt,bi),Eo=F(Rr[0]);var io=Rr[1];return An.sign&&(io=-io),typeof Eo=="number"?(An.sign!==Vi.sign&&(Eo=-Eo),[new E(Eo),new E(io)]):[new v(Eo,An.sign!==Vi.sign),new E(io)]}Es=R(bi)}var Dc=yr(qt,Es);if(Dc===-1)return[y[0],An];if(Dc===0)return[y[An.sign===Vi.sign?1:-1],y[0]];qt.length+Es.length<=200?Rr=sn(qt,Es):Rr=$r(qt,Es),Eo=Rr[0];var Kp=An.sign!==Vi.sign,op=Rr[1],C0=An.sign;return typeof Eo=="number"?(Kp&&(Eo=-Eo),Eo=new E(Eo)):Eo=new v(Eo,Kp),typeof op=="number"?(C0&&(op=-op),op=new E(op)):op=new v(op,C0),[Eo,op]}v.prototype.divmod=function(An){var Dr=hr(this,An);return{quotient:Dr[0],remainder:Dr[1]}},C.prototype.divmod=E.prototype.divmod=v.prototype.divmod,v.prototype.divide=function(An){return hr(this,An)[0]},C.prototype.over=C.prototype.divide=function(An){return new C(this.value/Oa(An).value)},E.prototype.over=E.prototype.divide=v.prototype.over=v.prototype.divide,v.prototype.mod=function(An){return hr(this,An)[1]},C.prototype.mod=C.prototype.remainder=function(An){return new C(this.value%Oa(An).value)},E.prototype.remainder=E.prototype.mod=v.prototype.remainder=v.prototype.mod,v.prototype.pow=function(An){var Dr=Oa(An),Rr=this.value,Vi=Dr.value,qt,Es,Eo;if(Vi===0)return y[1];if(Rr===0)return y[0];if(Rr===1)return y[1];if(Rr===-1)return Dr.isEven()?y[1]:y[-1];if(Dr.sign)return y[0];if(!Dr.isSmall)throw new Error("The exponent "+Dr.toString()+" is too large.");if(this.isSmall&&L(qt=Math.pow(Rr,Vi)))return new E(Q(qt));for(Es=this,Eo=y[1];Vi&!0&&(Eo=Eo.times(Es),--Vi),Vi!==0;)Vi/=2,Es=Es.square();return Eo},E.prototype.pow=v.prototype.pow,C.prototype.pow=function(An){var Dr=Oa(An),Rr=this.value,Vi=Dr.value,qt=BigInt(0),Es=BigInt(1),Eo=BigInt(2);if(Vi===qt)return y[1];if(Rr===qt)return y[0];if(Rr===Es)return y[1];if(Rr===BigInt(-1))return Dr.isEven()?y[1]:y[-1];if(Dr.isNegative())return new C(qt);for(var bi=this,io=y[1];(Vi&Es)===Es&&(io=io.times(bi),--Vi),Vi!==qt;)Vi/=Eo,bi=bi.square();return io},v.prototype.modPow=function(An,Dr){if(An=Oa(An),Dr=Oa(Dr),Dr.isZero())throw new Error("Cannot take modPow with modulus 0");var Rr=y[1],Vi=this.mod(Dr);for(An.isNegative()&&(An=An.multiply(y[-1]),Vi=Vi.modInv(Dr));An.isPositive();){if(Vi.isZero())return y[0];An.isOdd()&&(Rr=Rr.multiply(Vi).mod(Dr)),An=An.divide(2),Vi=Vi.square().mod(Dr)}return Rr},C.prototype.modPow=E.prototype.modPow=v.prototype.modPow;function yr(An,Dr){if(An.length!==Dr.length)return An.length>Dr.length?1:-1;for(var Rr=An.length-1;Rr>=0;Rr--)if(An[Rr]!==Dr[Rr])return An[Rr]>Dr[Rr]?1:-1;return 0}v.prototype.compareAbs=function(An){var Dr=Oa(An),Rr=this.value,Vi=Dr.value;return Dr.isSmall?1:yr(Rr,Vi)},E.prototype.compareAbs=function(An){var Dr=Oa(An),Rr=Math.abs(this.value),Vi=Dr.value;return Dr.isSmall?(Vi=Math.abs(Vi),Rr===Vi?0:Rr>Vi?1:-1):-1},C.prototype.compareAbs=function(An){var Dr=this.value,Rr=Oa(An).value;return Dr=Dr>=0?Dr:-Dr,Rr=Rr>=0?Rr:-Rr,Dr===Rr?0:Dr>Rr?1:-1},v.prototype.compare=function(An){if(An===1/0)return-1;if(An===-1/0)return 1;var Dr=Oa(An),Rr=this.value,Vi=Dr.value;return this.sign!==Dr.sign?Dr.sign?1:-1:Dr.isSmall?this.sign?-1:1:yr(Rr,Vi)*(this.sign?-1:1)},v.prototype.compareTo=v.prototype.compare,E.prototype.compare=function(An){if(An===1/0)return-1;if(An===-1/0)return 1;var Dr=Oa(An),Rr=this.value,Vi=Dr.value;return Dr.isSmall?Rr==Vi?0:Rr>Vi?1:-1:Rr<0!==Dr.sign?Rr<0?-1:1:Rr<0?1:-1},E.prototype.compareTo=E.prototype.compare,C.prototype.compare=function(An){if(An===1/0)return-1;if(An===-1/0)return 1;var Dr=this.value,Rr=Oa(An).value;return Dr===Rr?0:Dr>Rr?1:-1},C.prototype.compareTo=C.prototype.compare,v.prototype.equals=function(An){return this.compare(An)===0},C.prototype.eq=C.prototype.equals=E.prototype.eq=E.prototype.equals=v.prototype.eq=v.prototype.equals,v.prototype.notEquals=function(An){return this.compare(An)!==0},C.prototype.neq=C.prototype.notEquals=E.prototype.neq=E.prototype.notEquals=v.prototype.neq=v.prototype.notEquals,v.prototype.greater=function(An){return this.compare(An)>0},C.prototype.gt=C.prototype.greater=E.prototype.gt=E.prototype.greater=v.prototype.gt=v.prototype.greater,v.prototype.lesser=function(An){return this.compare(An)<0},C.prototype.lt=C.prototype.lesser=E.prototype.lt=E.prototype.lesser=v.prototype.lt=v.prototype.lesser,v.prototype.greaterOrEquals=function(An){return this.compare(An)>=0},C.prototype.geq=C.prototype.greaterOrEquals=E.prototype.geq=E.prototype.greaterOrEquals=v.prototype.geq=v.prototype.greaterOrEquals,v.prototype.lesserOrEquals=function(An){return this.compare(An)<=0},C.prototype.leq=C.prototype.lesserOrEquals=E.prototype.leq=E.prototype.lesserOrEquals=v.prototype.leq=v.prototype.lesserOrEquals,v.prototype.isEven=function(){return(this.value[0]&1)===0},E.prototype.isEven=function(){return(this.value&1)===0},C.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},v.prototype.isOdd=function(){return(this.value[0]&1)===1},E.prototype.isOdd=function(){return(this.value&1)===1},C.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},v.prototype.isPositive=function(){return!this.sign},E.prototype.isPositive=function(){return this.value>0},C.prototype.isPositive=E.prototype.isPositive,v.prototype.isNegative=function(){return this.sign},E.prototype.isNegative=function(){return this.value<0},C.prototype.isNegative=E.prototype.isNegative,v.prototype.isUnit=function(){return!1},E.prototype.isUnit=function(){return Math.abs(this.value)===1},C.prototype.isUnit=function(){return this.abs().value===BigInt(1)},v.prototype.isZero=function(){return!1},E.prototype.isZero=function(){return this.value===0},C.prototype.isZero=function(){return this.value===BigInt(0)},v.prototype.isDivisibleBy=function(An){var Dr=Oa(An);return Dr.isZero()?!1:Dr.isUnit()?!0:Dr.compareAbs(2)===0?this.isEven():this.mod(Dr).isZero()},C.prototype.isDivisibleBy=E.prototype.isDivisibleBy=v.prototype.isDivisibleBy;function _a(An){var Dr=An.abs();if(Dr.isUnit())return!1;if(Dr.equals(2)||Dr.equals(3)||Dr.equals(5))return!0;if(Dr.isEven()||Dr.isDivisibleBy(3)||Dr.isDivisibleBy(5))return!1;if(Dr.lesser(49))return!0}function Ir(An,Dr){for(var Rr=An.prev(),Vi=Rr,qt=0,Es,Eo,bi,io;Vi.isEven();)Vi=Vi.divide(2),qt++;e:for(bi=0;bi<Dr.length;bi++)if(!An.lesser(Dr[bi])&&(io=$U(Dr[bi]).modPow(Vi,An),!(io.isUnit()||io.equals(Rr)))){for(Es=qt-1;Es!=0;Es--){if(io=io.square().mod(An),io.isUnit())return!1;if(io.equals(Rr))continue e}return!1}return!0}v.prototype.isPrime=function(An){var Dr=_a(this);if(Dr!==t)return Dr;var Rr=this.abs(),Vi=Rr.bitLength();if(Vi<=64)return Ir(Rr,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var qt=Math.log(2)*Vi.toJSNumber(),Es=Math.ceil(An===!0?2*Math.pow(qt,2):qt),Eo=[],bi=0;bi<Es;bi++)Eo.push($U(bi+2));return Ir(Rr,Eo)},C.prototype.isPrime=E.prototype.isPrime=v.prototype.isPrime,v.prototype.isProbablePrime=function(An,Dr){var Rr=_a(this);if(Rr!==t)return Rr;for(var Vi=this.abs(),qt=An===t?5:An,Es=[],Eo=0;Eo<qt;Eo++)Es.push($U.randBetween(2,Vi.minus(2),Dr));return Ir(Vi,Es)},C.prototype.isProbablePrime=E.prototype.isProbablePrime=v.prototype.isProbablePrime,v.prototype.modInv=function(An){for(var Dr=$U.zero,Rr=$U.one,Vi=Oa(An),qt=this.abs(),Es,Eo,bi;!qt.isZero();)Es=Vi.divide(qt),Eo=Dr,bi=Vi,Dr=Rr,Vi=qt,Rr=Eo.subtract(Es.multiply(Rr)),qt=bi.subtract(Es.multiply(qt));if(!Vi.isUnit())throw new Error(this.toString()+" and "+An.toString()+" are not co-prime");return Dr.compare(0)===-1&&(Dr=Dr.add(An)),this.isNegative()?Dr.negate():Dr},C.prototype.modInv=E.prototype.modInv=v.prototype.modInv,v.prototype.next=function(){var An=this.value;return this.sign?Lt(An,1,this.sign):new v(Oe(An,1),this.sign)},E.prototype.next=function(){var An=this.value;return An+1<r?new E(An+1):new v(a,!1)},C.prototype.next=function(){return new C(this.value+BigInt(1))},v.prototype.prev=function(){var An=this.value;return this.sign?new v(Oe(An,1),!0):Lt(An,1,this.sign)},E.prototype.prev=function(){var An=this.value;return An-1>-r?new E(An-1):new v(a,!0)},C.prototype.prev=function(){return new C(this.value-BigInt(1))};for(var fs=[1];2*fs[fs.length-1]<=e;)fs.push(2*fs[fs.length-1]);var Ti=fs.length,kn=fs[Ti-1];function ss(An){return Math.abs(An)<=e}v.prototype.shiftLeft=function(An){var Dr=Oa(An).toJSNumber();if(!ss(Dr))throw new Error(String(Dr)+" is too large for shifting.");if(Dr<0)return this.shiftRight(-Dr);var Rr=this;if(Rr.isZero())return Rr;for(;Dr>=Ti;)Rr=Rr.multiply(kn),Dr-=Ti-1;return Rr.multiply(fs[Dr])},C.prototype.shiftLeft=E.prototype.shiftLeft=v.prototype.shiftLeft,v.prototype.shiftRight=function(An){var Dr,Rr=Oa(An).toJSNumber();if(!ss(Rr))throw new Error(String(Rr)+" is too large for shifting.");if(Rr<0)return this.shiftLeft(-Rr);for(var Vi=this;Rr>=Ti;){if(Vi.isZero()||Vi.isNegative()&&Vi.isUnit())return Vi;Dr=hr(Vi,kn),Vi=Dr[1].isNegative()?Dr[0].prev():Dr[0],Rr-=Ti-1}return Dr=hr(Vi,fs[Rr]),Dr[1].isNegative()?Dr[0].prev():Dr[0]},C.prototype.shiftRight=E.prototype.shiftRight=v.prototype.shiftRight;function $a(An,Dr,Rr){Dr=Oa(Dr);for(var Vi=An.isNegative(),qt=Dr.isNegative(),Es=Vi?An.not():An,Eo=qt?Dr.not():Dr,bi=0,io=0,Dc=null,Kp=null,op=[];!Es.isZero()||!Eo.isZero();)Dc=hr(Es,kn),bi=Dc[1].toJSNumber(),Vi&&(bi=kn-1-bi),Kp=hr(Eo,kn),io=Kp[1].toJSNumber(),qt&&(io=kn-1-io),Es=Dc[0],Eo=Kp[0],op.push(Rr(bi,io));for(var C0=Rr(Vi?1:0,qt?1:0)!==0?$U(-1):$U(0),m_=op.length-1;m_>=0;m_-=1)C0=C0.multiply(kn).add($U(op[m_]));return C0}v.prototype.not=function(){return this.negate().prev()},C.prototype.not=E.prototype.not=v.prototype.not,v.prototype.and=function(An){return $a(this,An,function(Dr,Rr){return Dr&Rr})},C.prototype.and=E.prototype.and=v.prototype.and,v.prototype.or=function(An){return $a(this,An,function(Dr,Rr){return Dr|Rr})},C.prototype.or=E.prototype.or=v.prototype.or,v.prototype.xor=function(An){return $a(this,An,function(Dr,Rr){return Dr^Rr})},C.prototype.xor=E.prototype.xor=v.prototype.xor;var Ma=1<<30,ka=(e&-e)*(e&-e)|Ma;function sl(An){var Dr=An.value,Rr=typeof Dr=="number"?Dr|Ma:typeof Dr=="bigint"?Dr|BigInt(Ma):Dr[0]+Dr[1]*e|ka;return Rr&-Rr}function ul(An,Dr){if(Dr.compareTo(An)<=0){var Rr=ul(An,Dr.square(Dr)),Vi=Rr.p,qt=Rr.e,Es=Vi.multiply(Dr);return Es.compareTo(An)<=0?{p:Es,e:qt*2+1}:{p:Vi,e:qt*2}}return{p:$U(1),e:0}}v.prototype.bitLength=function(){var An=this;return An.compareTo($U(0))<0&&(An=An.negate().subtract($U(1))),An.compareTo($U(0))===0?$U(0):$U(ul(An,$U(2)).e).add($U(1))},C.prototype.bitLength=E.prototype.bitLength=v.prototype.bitLength;function Pu(An,Dr){return An=Oa(An),Dr=Oa(Dr),An.greater(Dr)?An:Dr}function Xt(An,Dr){return An=Oa(An),Dr=Oa(Dr),An.lesser(Dr)?An:Dr}function Zu(An,Dr){if(An=Oa(An).abs(),Dr=Oa(Dr).abs(),An.equals(Dr))return An;if(An.isZero())return Dr;if(Dr.isZero())return An;for(var Rr=y[1],Vi,qt;An.isEven()&&Dr.isEven();)Vi=Xt(sl(An),sl(Dr)),An=An.divide(Vi),Dr=Dr.divide(Vi),Rr=Rr.multiply(Vi);for(;An.isEven();)An=An.divide(sl(An));do{for(;Dr.isEven();)Dr=Dr.divide(sl(Dr));An.greater(Dr)&&(qt=Dr,Dr=An,An=qt),Dr=Dr.subtract(An)}while(!Dr.isZero());return Rr.isUnit()?An:An.multiply(Rr)}function ja(An,Dr){return An=Oa(An).abs(),Dr=Oa(Dr).abs(),An.divide(Zu(An,Dr)).multiply(Dr)}function hm(An,Dr,Rr){An=Oa(An),Dr=Oa(Dr);var Vi=Rr||Math.random,qt=Xt(An,Dr),Es=Pu(An,Dr),Eo=Es.subtract(qt).add(1);if(Eo.isSmall)return qt.add(Math.floor(Vi()*Eo));for(var bi=Zl(Eo,e).value,io=[],Dc=!0,Kp=0;Kp<bi.length;Kp++){var op=Dc?bi[Kp]+(Kp+1<bi.length?bi[Kp+1]/e:0):e,C0=Q(Vi()*op);io.push(C0),C0<bi[Kp]&&(Dc=!1)}return qt.add(y.fromArray(io,e,!1))}var Aa=function(An,Dr,Rr,Vi){Rr=Rr||c,An=String(An),Vi||(An=An.toLowerCase(),Rr=Rr.toLowerCase());var qt=An.length,Es,Eo=Math.abs(Dr),bi={};for(Es=0;Es<Rr.length;Es++)bi[Rr[Es]]=Es;for(Es=0;Es<qt;Es++){var io=An[Es];if(io!=="-"&&io in bi&&bi[io]>=Eo){if(io==="1"&&Eo===1)continue;throw new Error(io+" is not a valid digit in base "+Dr+".")}}Dr=Oa(Dr);var Dc=[],Kp=An[0]==="-";for(Es=Kp?1:0;Es<An.length;Es++){var io=An[Es];if(io in bi)Dc.push(Oa(bi[io]));else if(io==="<"){var op=Es;do Es++;while(An[Es]!==">"&&Es<An.length);Dc.push(Oa(An.slice(op+1,Es)))}else throw new Error(io+" is not a valid character")}return dl(Dc,Dr,Kp)};function dl(An,Dr,Rr){var Vi=y[0],qt=y[1],Es;for(Es=An.length-1;Es>=0;Es--)Vi=Vi.add(An[Es].times(qt)),qt=qt.times(Dr);return Rr?Vi.negate():Vi}function ad(An,Dr){return Dr=Dr||c,An<Dr.length?Dr[An]:"<"+An+">"}function Zl(An,Dr){if(Dr=$U(Dr),Dr.isZero()){if(An.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(Dr.equals(-1)){if(An.isZero())return{value:[0],isNegative:!1};if(An.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-An.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var Rr=Array.apply(null,Array(An.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return Rr.unshift([1]),{value:[].concat.apply([],Rr),isNegative:!1}}var Vi=!1;if(An.isNegative()&&Dr.isPositive()&&(Vi=!0,An=An.abs()),Dr.isUnit())return An.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(An.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:Vi};for(var qt=[],Es=An,Eo;Es.isNegative()||Es.compareAbs(Dr)>=0;){Eo=Es.divmod(Dr),Es=Eo.quotient;var bi=Eo.remainder;bi.isNegative()&&(bi=Dr.minus(bi).abs(),Es=Es.next()),qt.push(bi.toJSNumber())}return qt.push(Es.toJSNumber()),{value:qt.reverse(),isNegative:Vi}}function Da(An,Dr,Rr){var Vi=Zl(An,Dr);return(Vi.isNegative?"-":"")+Vi.value.map(function(qt){return ad(qt,Rr)}).join("")}v.prototype.toArray=function(An){return Zl(this,An)},E.prototype.toArray=function(An){return Zl(this,An)},C.prototype.toArray=function(An){return Zl(this,An)},v.prototype.toString=function(An,Dr){if(An===t&&(An=10),An!==10||Dr)return Da(this,An,Dr);for(var Rr=this.value,Vi=Rr.length,qt=String(Rr[--Vi]),Es="0000000",Eo;--Vi>=0;)Eo=String(Rr[Vi]),qt+=Es.slice(Eo.length)+Eo;var bi=this.sign?"-":"";return bi+qt},E.prototype.toString=function(An,Dr){return An===t&&(An=10),An!=10||Dr?Da(this,An,Dr):String(this.value)},C.prototype.toString=E.prototype.toString,C.prototype.toJSON=v.prototype.toJSON=E.prototype.toJSON=function(){return this.toString()},v.prototype.valueOf=function(){return parseInt(this.toString(),10)},v.prototype.toJSNumber=v.prototype.valueOf,E.prototype.valueOf=function(){return this.value},E.prototype.toJSNumber=E.prototype.valueOf,C.prototype.valueOf=C.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function pl(An){if(L(+An)){var Dr=+An;if(Dr===Q(Dr))return f?new C(BigInt(Dr)):new E(Dr);throw new Error("Invalid integer: "+An)}var Rr=An[0]==="-";Rr&&(An=An.slice(1));var Vi=An.split(/e/i);if(Vi.length>2)throw new Error("Invalid integer: "+Vi.join("e"));if(Vi.length===2){var qt=Vi[1];if(qt[0]==="+"&&(qt=qt.slice(1)),qt=+qt,qt!==Q(qt)||!L(qt))throw new Error("Invalid integer: "+qt+" is not a valid exponent.");var Es=Vi[0],Eo=Es.indexOf(".");if(Eo>=0&&(qt-=Es.length-Eo-1,Es=Es.slice(0,Eo)+Es.slice(Eo+1)),qt<0)throw new Error("Cannot include negative exponent part for integers");Es+=new Array(qt+1).join("0"),An=Es}var bi=/^([0-9][0-9]*)$/.test(An);if(!bi)throw new Error("Invalid integer: "+An);if(f)return new C(BigInt(Rr?"-"+An:An));for(var io=[],Dc=An.length,Kp=n,op=Dc-Kp;Dc>0;)io.push(+An.slice(op,Dc)),op-=Kp,op<0&&(op=0),Dc-=Kp;return V(io),new v(io,Rr)}function ia(An){if(f)return new C(BigInt(An));if(L(An)){if(An!==Q(An))throw new Error(An+" is not an integer.");return new E(An)}return pl(An.toString())}function Oa(An){return typeof An=="number"?ia(An):typeof An=="string"?pl(An):typeof An=="bigint"?new C(An):An}for(var Ms=0;Ms<1e3;Ms++)y[Ms]=Oa(Ms),Ms>0&&(y[-Ms]=Oa(-Ms));return y.one=y[1],y.zero=y[0],y.minusOne=y[-1],y.max=Pu,y.min=Xt,y.gcd=Zu,y.lcm=ja,y.isInstance=function(An){return An instanceof v||An instanceof E||An instanceof C},y.randBetween=hm,y.fromArray=function(An,Dr,Rr){return dl(An.map(Oa),Oa(Dr||10),Rr)},y}();typeof hqt<"u"&&hqt.hasOwnProperty("exports")&&(hqt.exports=$U);typeof define=="function"&&define.amd&&define(function(){return $U})});var M2r=Fe((QCo,R2r)=>{var Xqe=L2r(),nes=require("stream"),_qt;function res(){var t=3988292384,e,n,r;for(_qt=[],n=0;n<256;n++){for(e=n,r=0;r<8;r++)e=e&1?t^e>>>1:e=e>>>1;_qt[n]=e>>>0}}function O2r(t,e){return _qt||res(),t.charCodeAt&&(t=t.charCodeAt(0)),Xqe(e).shiftRight(8).and(16777215).xor(_qt[Xqe(e).xor(t).and(255)]).value}function g1t(){if(!(this instanceof g1t))return new g1t;this.key0=305419896,this.key1=591751049,this.key2=878082192}g1t.prototype.update=function(t){this.key0=O2r(t,this.key0),this.key1=Xqe(this.key0).and(255).and(4294967295).add(this.key1),this.key1=Xqe(this.key1).multiply(134775813).add(1).and(4294967295).value,this.key2=O2r(Xqe(this.key1).shiftRight(24).and(255),this.key2)};g1t.prototype.decryptByte=function(t){var e=Xqe(this.key2).or(2);return t=t^Xqe(e).multiply(Xqe(e^1)).shiftRight(8).and(255),this.update(t),t};g1t.prototype.stream=function(){var t=nes.Transform(),e=this;return t._transform=function(n,r,a){for(var c=0;c<n.length;c++)n[c]=e.decryptByte(n[c]);this.push(n),a()},t};R2r.exports=g1t});var W2r=Fe((ZCo,B2r)=>{var ies=Wqe(),ses=M2r(),aes=OKt(),F2r=require("stream"),oes=require("zlib"),les=MKt(),ces=FKt(),ues=cMt();B2r.exports=function(e,n,r,a,c){var f=aes(),y=F2r.PassThrough(),v=e.stream(n,c);return v.pipe(f).on("error",function(E){y.emit("error",E)}),y.vars=f.pull(30).then(function(E){var C=ues.parse(E,[["signature",4],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return C.lastModifiedDateTime=ces(C.lastModifiedDate,C.lastModifiedTime),f.pull(C.fileNameLength).then(function(L){return C.fileName=L.toString("utf8"),f.pull(C.extraFieldLength)}).then(function(L){var R;return C.extra=les(L,C),a&&a.compressedSize&&(C=a),C.flags&1&&(R=f.pull(12).then(function(F){if(!r)throw new Error("MISSING_PASSWORD");var V=ses();String(r).split("").forEach(function(ee){V.update(ee)});for(var U=0;U<F.length;U++)F[U]=V.decryptByte(F[U]);C.decrypt=V,C.compressedSize-=12;var Q=C.flags&8?C.lastModifiedTime>>8&255:C.crc32>>24&255;if(F[11]!==Q)throw new Error("BAD_PASSWORD");return C})),ies.resolve(R).then(function(){return y.emit("vars",C),C})})}),y.vars.then(function(E){var C=!(E.flags&8)||E.compressedSize>0,L,R=E.compressionMethod?oes.createInflateRaw():F2r.PassThrough();C?(y.size=E.uncompressedSize,L=E.compressedSize):(L=Buffer.alloc(4),L.writeUInt32LE(134695760,0));var F=f.stream(L);E.decrypt&&(F=F.pipe(E.decrypt.stream())),F.pipe(R).on("error",function(V){y.emit("error",V)}).pipe(y).on("finish",function(){v.destroy?v.destroy():v.abort?v.abort():v.close?v.close():v.push?v.push():console.log("warning - unable to close stream")})}).catch(function(E){y.emit("error",E)}),y}});var U2r=Fe((eDo,G2r)=>{var LMt=OKt(),fes=W2r(),kMt=Wqe(),des=RKt(),pes=MKt(),DPn=require("path"),mes=APn().Writer,hes=FKt(),OMt=cMt(),j2r=Buffer.alloc(4);j2r.writeUInt32LE(101010256,0);function _es(t){var e=t.stream(0).pipe(LMt());return e.pull(4).then(function(n){var r=n.readUInt32LE(0);if(r===875721283){var a;return e.pull(12).then(function(c){a=OMt.parse(c,[["version",4],["pubKeyLength",4],["signatureLength",4]])}).then(function(){return e.pull(a.pubKeyLength+a.signatureLength)}).then(function(c){return a.publicKey=c.slice(0,a.pubKeyLength),a.signature=c.slice(a.pubKeyLength),a.size=16+a.pubKeyLength+a.signatureLength,a})}})}function ges(t,e){var n=OMt.parse(e,[["signature",4],["diskNumber",4],["offsetToStartOfCentralDirectory",8],["numberOfDisks",4]]);if(n.signature!=117853008)throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x"+n.signature.toString(16));var r=LMt();return t.stream(n.offsetToStartOfCentralDirectory).pipe(r),r.pull(56)}function yes(t){var e=OMt.parse(t,[["signature",4],["sizeOfCentralDirectory",8],["version",2],["versionsNeededToExtract",2],["diskNumber",4],["diskStart",4],["numberOfRecordsOnDisk",8],["numberOfRecords",8],["sizeOfCentralDirectory",8],["offsetToStartOfCentralDirectory",8]]);if(e.signature!=101075792)throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0"+e.signature.toString(16));return e}G2r.exports=function(e,n){var r=LMt(),a=LMt(),c=n&&n.tailSize||80,f,y,v,E;return n&&n.crx&&(y=_es(e)),e.size().then(function(C){return f=C,e.stream(Math.max(0,C-c)).on("error",function(L){r.emit("error",L)}).pipe(r),r.pull(j2r)}).then(function(){return kMt.props({directory:r.pull(22),crxHeader:y})}).then(function(C){var L=C.directory;if(v=C.crxHeader&&C.crxHeader.size||0,E=OMt.parse(L,[["signature",4],["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]),E.numberOfRecords==65535||E.numberOfRecords==65535||E.offsetToStartOfCentralDirectory==4294967295){let F=f-(c-r.match+20),V=LMt();return e.stream(F).pipe(V),V.pull(20).then(function(U){return ges(e,U)}).then(function(U){E=yes(U)})}else E.offsetToStartOfCentralDirectory+=v}).then(function(){if(E.commentLength)return r.pull(E.commentLength).then(function(C){E.comment=C.toString("utf8")})}).then(function(){return e.stream(E.offsetToStartOfCentralDirectory).pipe(a),E.extract=function(C){if(!C||!C.path)throw new Error("PATH_MISSING");return C.path=DPn.resolve(DPn.normalize(C.path)),E.files.then(function(L){return kMt.map(L,function(R){if(R.type!="Directory"){var F=DPn.join(C.path,R.path);if(F.indexOf(C.path)==0){var V=C.getWriter?C.getWriter({path:F}):mes({path:F});return new kMt(function(U,Q){R.stream(C.password).on("error",Q).pipe(V).on("close",U).on("error",Q)})}}},{concurrency:C.concurrency>1?C.concurrency:1})})},E.files=kMt.mapSeries(Array(E.numberOfRecords),function(){return a.pull(46).then(function(C){var L=L=OMt.parse(C,[["signature",4],["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return L.offsetToLocalFileHeader+=v,L.lastModifiedDateTime=hes(L.lastModifiedDate,L.lastModifiedTime),a.pull(L.fileNameLength).then(function(R){return L.pathBuffer=R,L.path=R.toString("utf8"),L.isUnicode=(L.flags&2048)!=0,a.pull(L.extraFieldLength)}).then(function(R){return L.extra=pes(R,L),a.pull(L.fileCommentLength)}).then(function(R){L.comment=R,L.type=L.uncompressedSize===0&&/[\/\\]$/.test(L.path)?"Directory":"File";var F=n&&n.padding||1e3;return L.stream=function(V){var U=30+F+(L.extraFieldLength||0)+(L.fileNameLength||0)+L.compressedSize;return fes(e,L.offsetToLocalFileHeader,V,L,U)},L.buffer=function(V){return des(L.stream(V))},L})})}),kMt.props(E)})}});var K2r=Fe((tDo,z2r)=>{var V2r=MPe(),gqt=Wqe(),RMt=U2r(),xes=require("stream");z2r.exports={buffer:function(t,e){var n={stream:function(r,a){var c=xes.PassThrough(),f=a?r+a:void 0;return c.end(t.slice(r,f)),c},size:function(){return gqt.resolve(t.length)}};return RMt(n,e)},file:function(t,e){var n={stream:function(r,a){var c=a?r+a:void 0;return V2r.createReadStream(t,{start:r,end:c})},size:function(){return new gqt(function(r,a){V2r.stat(t,function(c,f){c?a(c):r(f.size)})})}};return RMt(n,e)},url:function(t,e,n){if(typeof e=="string"&&(e={url:e}),!e.url)throw"URL missing";e.headers=e.headers||{};var r={stream:function(a,c){var f=Object.create(e),y=c?a+c:"";return f.headers=Object.create(e.headers),f.headers.range="bytes="+a+"-"+y,t(f)},size:function(){return new gqt(function(a,c){var f=t(e);f.on("response",function(y){f.abort(),y.headers["content-length"]?a(y.headers["content-length"]):c(new Error("Missing content length header"))}).on("error",c)})}};return RMt(r,n)},s3:function(t,e,n){var r={size:function(){return new gqt(function(a,c){t.headObject(e,function(f,y){f?c(f):a(y.ContentLength)})})},stream:function(a,c){var f={};for(var y in e)f[y]=e[y];var v=c?a+c:"";return f.Range="bytes="+a+"-"+v,t.getObject(f).createReadStream()}};return RMt(r,n)},custom:function(t,e){return RMt(t,e)}}});var q2r=Fe(MMt=>{"use strict";MMt.Parse=BKt();MMt.ParseOne=GEr();MMt.Extract=k2r();MMt.Open=K2r()});var ves,wPn,IPn,H2r,BPe,J2r,$2r,X2r,Y2r,Q2r=tr(()=>{"use strict";ves=Od(Bhr(),1);sgr();wPn=Od(avr(),1),IPn=Od(obr(),1),H2r=Od(q2r(),1),BPe=require("node:fs/promises"),J2r=async(t,e)=>{await(0,BPe.access)(t,BPe.constants.F_OK).catch(()=>{throw new Error(`[Archiver]: source ${t} does not exist`)}),await(0,BPe.access)(e,BPe.constants.F_OK).catch(()=>(0,BPe.mkdir)(e,{recursive:!0}))},$2r=async(t,e)=>(await J2r(t,e),wPn.x({file:t,cwd:e})),X2r=async(t,e)=>(await J2r(t,e),await H2r.default.Open.file(t).then(n=>n.extract({path:e,concurrency:5})),e),Y2r=async t=>{let e=IPn.pack();for(let{name:a,data:c}of Object.values(t))e.entry({name:a},c);e.finalize();let n=[];return e.on("data",a=>n.push(a)),await new Promise((a,c)=>{e.on("end",a),e.on("error",c)}),Buffer.from(igr.gzip(Buffer.concat(n)))}});async function WPe(t){let{source:e,throwOnNotFound:n=!1}=t,r=await(0,Z2r.readFile)((0,eTr.join)(e,".codemodrc.json"),{encoding:"utf-8"}).catch(()=>null);if(r===null){let c=`Could not locate the .codemodrc.json file at ${e}`;if(n)throw new Error(c);return{config:null,error:c}}let a;try{a=tqe(JSON.parse(r))}catch{let f=`Failed to parse the .codemodrc.json file at ${e}`;if(n)throw new Error(f);return{config:null,error:f}}return{config:a,error:null}}async function e4e(t){let{source:e,throwOnNotFound:n}=t,{config:r,error:a}=await WPe({source:e,throwOnNotFound:!1});if(r===null){if(n)throw new Error(a);return{path:null,error:a}}let c;switch(r.engine){case"ast-grep":c="**/rule.yaml";break;default:c="src/index.{ts,js}";break}let f=r.entry?`Make sure the entry point path under ${aD("entry")} key is correct in .codemodrc.json`:`Could not find an entry point under ${aD(c)}. Either create it or provide a path at ${aD("entry")} key in .codemodrc.json`,v=(await Tne(r.entry??c,{absolute:!0,cwd:e,nodir:!0})).at(0)??null;if(v===null){if(n)throw new Error(f);return{path:null,error:f}}return{path:v,error:null}}var Z2r,eTr,tTr=tr(()=>{"use strict";Z2r=require("node:fs/promises"),eTr=require("node:path");oqe();sOt();AUt()});var nTr=tr(()=>{"use strict"});var rTr=tr(()=>{"use strict"});var iTr=tr(()=>{"use strict"});var sTr,aTr,D3,oTr,PPn=tr(()=>{"use strict";sTr=require("node:child_process"),aTr=require("node:util"),D3=(0,aTr.promisify)(sTr.exec),oTr=async t=>{let e=t(),{done:n}=await e.next();return n}});async function yqt(t,e=!1){let n=null,r=null;try{let{stdout:c}=await D3("git rev-parse --show-toplevel",{cwd:t}),f=c.trim();if(f.length&&(r=f,e))return{rootPath:r}}catch{}if(r===null){let c=t;for(;;){try{await(0,ZEe.access)((0,olt.join)(c,".git"),ZEe.constants.R_OK|ZEe.constants.W_OK);let y=(0,olt.join)(c,"package.json");await(0,ZEe.access)(y,ZEe.constants.R_OK|ZEe.constants.W_OK),r=c}catch{}if(r){if(e)return{rootPath:r};break}let f=(0,olt.dirname)(c);if(f===c)break;c=f}}let a=t;for(;;){for(let f of Object.keys(lTr))try{await(0,ZEe.access)((0,olt.join)(a,f),ZEe.constants.R_OK|ZEe.constants.W_OK),n=lTr[f],r===null&&(r=a);break}catch{}if(r){if(e)return{rootPath:r};break}let c=(0,olt.dirname)(a);if(c===a)break;a=c}return{rootPath:r,detectedPackageManager:n}}var ZEe,olt,lTr,cTr=tr(()=>{"use strict";ZEe=require("node:fs/promises"),olt=require("node:path");PPn();lTr={"package-lock.json":"npm","yarn.lock":"yarn","pnpm-lock.yaml":"pnpm","bun.lockb":"bun"}});var bes,FMt,uTr,NPn=tr(()=>{"use strict";Wae();bes=CC({engine:ov("jscodeshift"),parser:WL([ov("babel"),ov("babylon"),ov("flow"),ov("ts"),ov("tsx")])}),FMt=WL([bes]),uTr=t=>{let e=_fe(FMt,t);return e.success?e.output:null}});var fTr,kPn,LPn,dTr,OPn,pTr,BMt,llt,mTr,hTr=tr(()=>{"use strict";Wae();DUt();sOt();NPn();fTr=CC({$schema:lv(Ev()),path:Ev(),source:WL([ov("local"),ov("remote")]),type:WL([ov("standalone"),ov("package")]),safeArgumentRecord:lv(CUt,{}),engineOptions:lv(BLt(FMt),null)}),kPn=CC({...fTr.entries,...CC({config:DSn}).entries}),LPn=CC({...fTr.entries,...CC({config:wSn,codemods:lv(KU(kPn),[])}).entries}),dTr=WL([kPn,LPn]),OPn=t=>_fe(kPn,t),pTr=t=>_fe(LPn,t),BMt=t=>LEn(LPn,t),llt=t=>lQ(dTr,t),mTr=t=>_fe(dTr,t)});var _Tr=tr(()=>{"use strict"});var vDo,bDo,gTr=tr(()=>{"use strict";Wae();vDo=CC({codemodSource:Ev(),codemodEngine:WL([ov("jscodeshift"),ov("ts-morph"),ov("workflow")]),codemodArguments:lv(Ev()),repoUrl:lv(Ev()),branch:lv(Ev()),persistent:lv(ZM())}),bDo=CC({jobId:Ev()})});var XU=tr(()=>{"use strict";uor();Cur();lhr();Q2r();tTr();nTr();rTr();AUt();iTr();PPn();cTr();oSn();DUt();sOt();hTr();NPn();_Tr();gTr()});var Ees,yTr,xTr=tr(()=>{"use strict";Wae();XU();Ees=WL([CC({kind:ov("initialization"),path:Ev(),codemodSource:Ev(),engine:WL([ov("jscodeshift"),ov("ts-morph"),ov("ast-grep"),ov("workflow")]),format:ZM(),safeArgumentRecord:CUt,engineOptions:BLt(FMt)}),CC({kind:ov("exit")}),CC({kind:ov("runCodemod"),path:Ev(),data:Ev()})]),yTr=t=>lQ(Ees,t)});var vTr=tr(()=>{"use strict"});var Ses,bTr,ETr=tr(()=>{"use strict";Wae();FEn();Ses=WL([CC({kind:ov("commands"),commands:MEn(),path:lv(Ev())}),CC({kind:ov("error"),message:Ev(),path:lv(Ev())}),CC({kind:ov("console"),consoleKind:cor,message:Ev()})]),bTr=t=>lQ(Ses,t)});var d4=tr(()=>{"use strict";RJ();Ksr();Zar();sor();FEn();xTr();vTr();ETr()});var eSe,WMt=tr(()=>{eSe="0.13.12"});var STr,TTr,RPn,tSe,jMt,rwo,y1t=tr(()=>{"use strict";STr=Od(require("node:os"),1),TTr=require("node:path");d4();RPn=process.stdout.write,tSe=(0,TTr.join)(STr.homedir(),".codemod"),jMt=Yo.green("\u2714"),rwo=Yo.red("\u2716")});var MPn,x1t,FPn,xqt,vqt,BPn=tr(()=>{"use strict";MPn=Od(require("node:fs"),1),x1t=Od(require("node:os"),1),FPn=require("node:path");d4();XU();WMt();y1t();xqt=(0,FPn.join)(tSe,"logs"),vqt=async t=>{let{prefix:e,content:n,fatal:r}=t,a=(0,FPn.join)(xqt,`${r?"FATAL-":""}${new Date().toISOString()}-error.log`),c=`- CLI version: ${eSe}
|
|
863
|
+
Unsupported type: `+t.type,"ENOTSUP");t._finish()})};Y_e.prototype._stat=function(t){var e=this,n=e.props,r=n.follow?"stat":"lstat",a=e._proxy||e;t?c(null,t):X_e[r](e._path,c);function c(f,y){if(e.filter&&!e.filter.call(a,a,y)){e._aborted=!0,e.emit("end"),e.emit("close");return}if(f||!y)return TPn(e);e._old=y;var v=T2r(y);if(v!==e.type||e.type==="File"&&y.nlink>1)return UZi(e._path,function(E){if(E)return e.error(E);e._old=null,TPn(e)});TPn(e)}};function TPn(t){VZi(NMt.dirname(t._path),Y_e.dirmode,function(e,n){return e?t.error(e):(t._madeDir=n,t._create())})}function C2r(t,e,n,r,a){var c=e.mode,f=e.follow||t.type!=="SymbolicLink"?"chmod":"lchmod";if(!X_e[f]||typeof c!="number")return a();var y=n.mode&parseInt("0777",8);if(c=c&parseInt("0777",8),c===y)return a();X_e[f](r,c,a)}function D2r(t,e,n,r,a){if(process.platform==="win32"||!process.getuid||process.getuid()!==0||typeof e.uid!="number"&&typeof e.gid!="number"||n.uid===e.uid&&n.gid===e.gid)return a();var c=t.props.follow||t.type!=="SymbolicLink"?"chown":"lchown";if(!X_e[c])return a();typeof e.uid!="number"&&(e.uid=n.uid),typeof e.gid!="number"&&(e.gid=n.gid),X_e[c](r,e.uid,e.gid,a)}function w2r(t,e,n,r,a){if(!X_e.utimes||process.platform==="win32")return a();var c=e.follow||t.type!=="SymbolicLink"?"utimes":"lutimes";if(c==="lutimes"&&!X_e[c]&&(c="utimes"),!X_e[c])return a();var f=n.atime,y=n.mtime,v=e.atime,E=e.mtime;if(v===void 0&&(v=f),E===void 0&&(E=y),E2r(v)||(v=new Date(v)),E2r(E)||(v=new Date(E)),v.getTime()===f.getTime()&&E.getTime()===y.getTime())return a();X_e[c](r,v,E,a)}Y_e.prototype._finish=function(){var t=this;if(t._finishing)return;t._finishing=!0;var e=0,n=null,r=!1;if(t._old)t._old.atime=new Date(0),t._old.mtime=new Date(0),c(t._old);else{var a=t.props.follow?"stat":"lstat";X_e[a](t._path,function(y,v){if(y)if(y.code==="ENOENT"&&(t.type==="Link"||t.type==="SymbolicLink")&&process.platform==="win32"){t.ready=!0,t.emit("ready"),t.emit("end"),t.emit("close"),t.end=t._finish=function(){};return}else return t.error(y);c(t._old=v)})}return;function c(y){e+=3,C2r(t,t.props,y,t._path,f("chmod")),D2r(t,t.props,y,t._path,f("chown")),w2r(t,t.props,y,t._path,f("utimes"))}function f(y){return function(v){if(n)return;if(v)return v.fstream_finish_call=y,t.error(n=v);if(--e>0||r)return;if(r=!0,t._madeDir)I2r(t,t._path,E);else return E();function E(C){if(C)return C.fstream_finish_call="setupMadeDir",t.error(C);t.emit("end"),t.emit("close")}}}};function I2r(t,e,n){var r=t._madeDir,a=NMt.dirname(e);JZi(t,a,function(c){if(c)return n(c);if(a===r)return n();I2r(t,a,n)})}function JZi(t,e,n){var r={};Object.keys(t.props).forEach(function(y){r[y]=t.props[y],y==="mode"&&t.type!=="Directory"&&(r[y]=r[y]|parseInt("0111",8))});var a=3,c=null;X_e.stat(e,function(y,v){if(y)return n(c=y);C2r(t,r,v,e,f),D2r(t,r,v,e,f),w2r(t,r,v,e,f)});function f(y){if(!c){if(y)return n(c=y);if(--a===0)return n()}}}Y_e.prototype.pipe=function(){this.error("Can't pipe from writable stream")};Y_e.prototype.add=function(){this.error("Can't add to non-Directory type")};Y_e.prototype.write=function(){return!0};function $Zi(t){return Object.prototype.toString.call(t)}function E2r(t){return typeof t=="object"&&$Zi(t)==="[object Date]"}});var APn=Fe(jD=>{jD.Abstract=XKt();jD.Reader=Zot();jD.Writer=_1t();jD.File={Reader:WIn(),Writer:bPn()};jD.Dir={Reader:BIn(),Writer:xPn()};jD.Link={Reader:MIn(),Writer:vPn()};jD.Proxy={Reader:GIn(),Writer:SPn()};jD.Reader.Dir=jD.DirReader=jD.Dir.Reader;jD.Reader.File=jD.FileReader=jD.File.Reader;jD.Reader.Link=jD.LinkReader=jD.Link.Reader;jD.Reader.Proxy=jD.ProxyReader=jD.Proxy.Reader;jD.Writer.Dir=jD.DirWriter=jD.Dir.Writer;jD.Writer.File=jD.FileWriter=jD.File.Writer;jD.Writer.Link=jD.LinkWriter=jD.Link.Writer;jD.Writer.Proxy=jD.ProxyWriter=jD.Proxy.Writer;jD.collect=dqt()});var k2r=Fe((XCo,N2r)=>{N2r.exports=tes;var XZi=BKt(),YZi=APn().Writer,CPn=require("path"),QZi=require("stream"),ZZi=wIn(),ees=Wqe();function tes(t){t.path=CPn.resolve(CPn.normalize(t.path));var e=new XZi(t),n=new QZi.Writable({objectMode:!0});n._write=function(a,c,f){if(a.type=="Directory")return f();var y=CPn.join(t.path,a.path.replace(/\\/g,"/"));if(y.indexOf(t.path)!=0)return f();let v=t.getWriter?t.getWriter({path:y}):YZi({path:y});a.pipe(v).on("error",f).on("close",f)};var r=ZZi(e,n);return e.once("crx-header",function(a){r.crxHeader=a}),e.pipe(n).on("finish",function(){r.emit("close")}),r.promise=function(){return new ees(function(a,c){r.on("close",a),r.on("error",c)})},r}});var L2r=Fe((YCo,hqt)=>{var $U=function(t){"use strict";var e=1e7,n=7,r=9007199254740992,a=R(r),c="0123456789abcdefghijklmnopqrstuvwxyz",f=typeof BigInt=="function";function y(An,Dr,Rr,Vi){return typeof An>"u"?y[0]:typeof Dr<"u"?+Dr==10&&!Rr?Oa(An):Aa(An,Dr,Rr,Vi):Oa(An)}function v(An,Dr){this.value=An,this.sign=Dr,this.isSmall=!1}v.prototype=Object.create(y.prototype);function E(An){this.value=An,this.sign=An<0,this.isSmall=!0}E.prototype=Object.create(y.prototype);function C(An){this.value=An}C.prototype=Object.create(y.prototype);function L(An){return-r<An&&An<r}function R(An){return An<1e7?[An]:An<1e14?[An%1e7,Math.floor(An/1e7)]:[An%1e7,Math.floor(An/1e7)%1e7,Math.floor(An/1e14)]}function F(An){V(An);var Dr=An.length;if(Dr<4&&yr(An,a)<0)switch(Dr){case 0:return 0;case 1:return An[0];case 2:return An[0]+An[1]*e;default:return An[0]+(An[1]+An[2]*e)*e}return An}function V(An){for(var Dr=An.length;An[--Dr]===0;);An.length=Dr+1}function U(An){for(var Dr=new Array(An),Rr=-1;++Rr<An;)Dr[Rr]=0;return Dr}function Q(An){return An>0?Math.floor(An):Math.ceil(An)}function ee(An,Dr){var Rr=An.length,Vi=Dr.length,qt=new Array(Rr),Es=0,Eo=e,bi,io;for(io=0;io<Vi;io++)bi=An[io]+Dr[io]+Es,Es=bi>=Eo?1:0,qt[io]=bi-Es*Eo;for(;io<Rr;)bi=An[io]+Es,Es=bi===Eo?1:0,qt[io++]=bi-Es*Eo;return Es>0&&qt.push(Es),qt}function ge(An,Dr){return An.length>=Dr.length?ee(An,Dr):ee(Dr,An)}function Oe(An,Dr){var Rr=An.length,Vi=new Array(Rr),qt=e,Es,Eo;for(Eo=0;Eo<Rr;Eo++)Es=An[Eo]-qt+Dr,Dr=Math.floor(Es/qt),Vi[Eo]=Es-Dr*qt,Dr+=1;for(;Dr>0;)Vi[Eo++]=Dr%qt,Dr=Math.floor(Dr/qt);return Vi}v.prototype.add=function(An){var Dr=Oa(An);if(this.sign!==Dr.sign)return this.subtract(Dr.negate());var Rr=this.value,Vi=Dr.value;return Dr.isSmall?new v(Oe(Rr,Math.abs(Vi)),this.sign):new v(ge(Rr,Vi),this.sign)},v.prototype.plus=v.prototype.add,E.prototype.add=function(An){var Dr=Oa(An),Rr=this.value;if(Rr<0!==Dr.sign)return this.subtract(Dr.negate());var Vi=Dr.value;if(Dr.isSmall){if(L(Rr+Vi))return new E(Rr+Vi);Vi=R(Math.abs(Vi))}return new v(Oe(Vi,Math.abs(Rr)),Rr<0)},E.prototype.plus=E.prototype.add,C.prototype.add=function(An){return new C(this.value+Oa(An).value)},C.prototype.plus=C.prototype.add;function Se(An,Dr){var Rr=An.length,Vi=Dr.length,qt=new Array(Rr),Es=0,Eo=e,bi,io;for(bi=0;bi<Vi;bi++)io=An[bi]-Es-Dr[bi],io<0?(io+=Eo,Es=1):Es=0,qt[bi]=io;for(bi=Vi;bi<Rr;bi++){if(io=An[bi]-Es,io<0)io+=Eo;else{qt[bi++]=io;break}qt[bi]=io}for(;bi<Rr;bi++)qt[bi]=An[bi];return V(qt),qt}function Ze(An,Dr,Rr){var Vi;return yr(An,Dr)>=0?Vi=Se(An,Dr):(Vi=Se(Dr,An),Rr=!Rr),Vi=F(Vi),typeof Vi=="number"?(Rr&&(Vi=-Vi),new E(Vi)):new v(Vi,Rr)}function Lt(An,Dr,Rr){var Vi=An.length,qt=new Array(Vi),Es=-Dr,Eo=e,bi,io;for(bi=0;bi<Vi;bi++)io=An[bi]+Es,Es=Math.floor(io/Eo),io%=Eo,qt[bi]=io<0?io+Eo:io;return qt=F(qt),typeof qt=="number"?(Rr&&(qt=-qt),new E(qt)):new v(qt,Rr)}v.prototype.subtract=function(An){var Dr=Oa(An);if(this.sign!==Dr.sign)return this.add(Dr.negate());var Rr=this.value,Vi=Dr.value;return Dr.isSmall?Lt(Rr,Math.abs(Vi),this.sign):Ze(Rr,Vi,this.sign)},v.prototype.minus=v.prototype.subtract,E.prototype.subtract=function(An){var Dr=Oa(An),Rr=this.value;if(Rr<0!==Dr.sign)return this.add(Dr.negate());var Vi=Dr.value;return Dr.isSmall?new E(Rr-Vi):Lt(Vi,Math.abs(Rr),Rr>=0)},E.prototype.minus=E.prototype.subtract,C.prototype.subtract=function(An){return new C(this.value-Oa(An).value)},C.prototype.minus=C.prototype.subtract,v.prototype.negate=function(){return new v(this.value,!this.sign)},E.prototype.negate=function(){var An=this.sign,Dr=new E(-this.value);return Dr.sign=!An,Dr},C.prototype.negate=function(){return new C(-this.value)},v.prototype.abs=function(){return new v(this.value,!1)},E.prototype.abs=function(){return new E(Math.abs(this.value))},C.prototype.abs=function(){return new C(this.value>=0?this.value:-this.value)};function qe(An,Dr){var Rr=An.length,Vi=Dr.length,qt=Rr+Vi,Es=U(qt),Eo=e,bi,io,Dc,Kp,op;for(Dc=0;Dc<Rr;++Dc){Kp=An[Dc];for(var C0=0;C0<Vi;++C0)op=Dr[C0],bi=Kp*op+Es[Dc+C0],io=Math.floor(bi/Eo),Es[Dc+C0]=bi-io*Eo,Es[Dc+C0+1]+=io}return V(Es),Es}function rt(An,Dr){var Rr=An.length,Vi=new Array(Rr),qt=e,Es=0,Eo,bi;for(bi=0;bi<Rr;bi++)Eo=An[bi]*Dr+Es,Es=Math.floor(Eo/qt),Vi[bi]=Eo-Es*qt;for(;Es>0;)Vi[bi++]=Es%qt,Es=Math.floor(Es/qt);return Vi}function Wt(An,Dr){for(var Rr=[];Dr-- >0;)Rr.push(0);return Rr.concat(An)}function tn(An,Dr){var Rr=Math.max(An.length,Dr.length);if(Rr<=30)return qe(An,Dr);Rr=Math.ceil(Rr/2);var Vi=An.slice(Rr),qt=An.slice(0,Rr),Es=Dr.slice(Rr),Eo=Dr.slice(0,Rr),bi=tn(qt,Eo),io=tn(Vi,Es),Dc=tn(ge(qt,Vi),ge(Eo,Es)),Kp=ge(ge(bi,Wt(Se(Se(Dc,bi),io),Rr)),Wt(io,2*Rr));return V(Kp),Kp}function lt(An,Dr){return-.012*An-.012*Dr+15e-6*An*Dr>0}v.prototype.multiply=function(An){var Dr=Oa(An),Rr=this.value,Vi=Dr.value,qt=this.sign!==Dr.sign,Es;if(Dr.isSmall){if(Vi===0)return y[0];if(Vi===1)return this;if(Vi===-1)return this.negate();if(Es=Math.abs(Vi),Es<e)return new v(rt(Rr,Es),qt);Vi=R(Es)}return lt(Rr.length,Vi.length)?new v(tn(Rr,Vi),qt):new v(qe(Rr,Vi),qt)},v.prototype.times=v.prototype.multiply;function xn(An,Dr,Rr){return An<e?new v(rt(Dr,An),Rr):new v(qe(Dr,R(An)),Rr)}E.prototype._multiplyBySmall=function(An){return L(An.value*this.value)?new E(An.value*this.value):xn(Math.abs(An.value),R(Math.abs(this.value)),this.sign!==An.sign)},v.prototype._multiplyBySmall=function(An){return An.value===0?y[0]:An.value===1?this:An.value===-1?this.negate():xn(Math.abs(An.value),this.value,this.sign!==An.sign)},E.prototype.multiply=function(An){return Oa(An)._multiplyBySmall(this)},E.prototype.times=E.prototype.multiply,C.prototype.multiply=function(An){return new C(this.value*Oa(An).value)},C.prototype.times=C.prototype.multiply;function mr(An){var Dr=An.length,Rr=U(Dr+Dr),Vi=e,qt,Es,Eo,bi,io;for(Eo=0;Eo<Dr;Eo++){bi=An[Eo],Es=0-bi*bi;for(var Dc=Eo;Dc<Dr;Dc++)io=An[Dc],qt=2*(bi*io)+Rr[Eo+Dc]+Es,Es=Math.floor(qt/Vi),Rr[Eo+Dc]=qt-Es*Vi;Rr[Eo+Dr]=Es}return V(Rr),Rr}v.prototype.square=function(){return new v(mr(this.value),!1)},E.prototype.square=function(){var An=this.value*this.value;return L(An)?new E(An):new v(mr(R(Math.abs(this.value))),!1)},C.prototype.square=function(An){return new C(this.value*this.value)};function sn(An,Dr){var Rr=An.length,Vi=Dr.length,qt=e,Es=U(Dr.length),Eo=Dr[Vi-1],bi=Math.ceil(qt/(2*Eo)),io=rt(An,bi),Dc=rt(Dr,bi),Kp,op,C0,m_,Iy,Bm,kl;for(io.length<=Rr&&io.push(0),Dc.push(0),Eo=Dc[Vi-1],op=Rr-Vi;op>=0;op--){for(Kp=qt-1,io[op+Vi]!==Eo&&(Kp=Math.floor((io[op+Vi]*qt+io[op+Vi-1])/Eo)),C0=0,m_=0,Bm=Dc.length,Iy=0;Iy<Bm;Iy++)C0+=Kp*Dc[Iy],kl=Math.floor(C0/qt),m_+=io[op+Iy]-(C0-kl*qt),C0=kl,m_<0?(io[op+Iy]=m_+qt,m_=-1):(io[op+Iy]=m_,m_=0);for(;m_!==0;){for(Kp-=1,C0=0,Iy=0;Iy<Bm;Iy++)C0+=io[op+Iy]-qt+Dc[Iy],C0<0?(io[op+Iy]=C0+qt,C0=0):(io[op+Iy]=C0,C0=1);m_+=C0}Es[op]=Kp}return io=Pn(io,bi)[0],[F(Es),F(io)]}function $r(An,Dr){for(var Rr=An.length,Vi=Dr.length,qt=[],Es=[],Eo=e,bi,io,Dc,Kp,op;Rr;){if(Es.unshift(An[--Rr]),V(Es),yr(Es,Dr)<0){qt.push(0);continue}io=Es.length,Dc=Es[io-1]*Eo+Es[io-2],Kp=Dr[Vi-1]*Eo+Dr[Vi-2],io>Vi&&(Dc=(Dc+1)*Eo),bi=Math.ceil(Dc/Kp);do{if(op=rt(Dr,bi),yr(op,Es)<=0)break;bi--}while(bi);qt.push(bi),Es=Se(Es,op)}return qt.reverse(),[F(qt),F(Es)]}function Pn(An,Dr){var Rr=An.length,Vi=U(Rr),qt=e,Es,Eo,bi,io;for(bi=0,Es=Rr-1;Es>=0;--Es)io=bi*qt+An[Es],Eo=Q(io/Dr),bi=io-Eo*Dr,Vi[Es]=Eo|0;return[Vi,bi|0]}function hr(An,Dr){var Rr,Vi=Oa(Dr);if(f)return[new C(An.value/Vi.value),new C(An.value%Vi.value)];var qt=An.value,Es=Vi.value,Eo;if(Es===0)throw new Error("Cannot divide by zero");if(An.isSmall)return Vi.isSmall?[new E(Q(qt/Es)),new E(qt%Es)]:[y[0],An];if(Vi.isSmall){if(Es===1)return[An,y[0]];if(Es==-1)return[An.negate(),y[0]];var bi=Math.abs(Es);if(bi<e){Rr=Pn(qt,bi),Eo=F(Rr[0]);var io=Rr[1];return An.sign&&(io=-io),typeof Eo=="number"?(An.sign!==Vi.sign&&(Eo=-Eo),[new E(Eo),new E(io)]):[new v(Eo,An.sign!==Vi.sign),new E(io)]}Es=R(bi)}var Dc=yr(qt,Es);if(Dc===-1)return[y[0],An];if(Dc===0)return[y[An.sign===Vi.sign?1:-1],y[0]];qt.length+Es.length<=200?Rr=sn(qt,Es):Rr=$r(qt,Es),Eo=Rr[0];var Kp=An.sign!==Vi.sign,op=Rr[1],C0=An.sign;return typeof Eo=="number"?(Kp&&(Eo=-Eo),Eo=new E(Eo)):Eo=new v(Eo,Kp),typeof op=="number"?(C0&&(op=-op),op=new E(op)):op=new v(op,C0),[Eo,op]}v.prototype.divmod=function(An){var Dr=hr(this,An);return{quotient:Dr[0],remainder:Dr[1]}},C.prototype.divmod=E.prototype.divmod=v.prototype.divmod,v.prototype.divide=function(An){return hr(this,An)[0]},C.prototype.over=C.prototype.divide=function(An){return new C(this.value/Oa(An).value)},E.prototype.over=E.prototype.divide=v.prototype.over=v.prototype.divide,v.prototype.mod=function(An){return hr(this,An)[1]},C.prototype.mod=C.prototype.remainder=function(An){return new C(this.value%Oa(An).value)},E.prototype.remainder=E.prototype.mod=v.prototype.remainder=v.prototype.mod,v.prototype.pow=function(An){var Dr=Oa(An),Rr=this.value,Vi=Dr.value,qt,Es,Eo;if(Vi===0)return y[1];if(Rr===0)return y[0];if(Rr===1)return y[1];if(Rr===-1)return Dr.isEven()?y[1]:y[-1];if(Dr.sign)return y[0];if(!Dr.isSmall)throw new Error("The exponent "+Dr.toString()+" is too large.");if(this.isSmall&&L(qt=Math.pow(Rr,Vi)))return new E(Q(qt));for(Es=this,Eo=y[1];Vi&!0&&(Eo=Eo.times(Es),--Vi),Vi!==0;)Vi/=2,Es=Es.square();return Eo},E.prototype.pow=v.prototype.pow,C.prototype.pow=function(An){var Dr=Oa(An),Rr=this.value,Vi=Dr.value,qt=BigInt(0),Es=BigInt(1),Eo=BigInt(2);if(Vi===qt)return y[1];if(Rr===qt)return y[0];if(Rr===Es)return y[1];if(Rr===BigInt(-1))return Dr.isEven()?y[1]:y[-1];if(Dr.isNegative())return new C(qt);for(var bi=this,io=y[1];(Vi&Es)===Es&&(io=io.times(bi),--Vi),Vi!==qt;)Vi/=Eo,bi=bi.square();return io},v.prototype.modPow=function(An,Dr){if(An=Oa(An),Dr=Oa(Dr),Dr.isZero())throw new Error("Cannot take modPow with modulus 0");var Rr=y[1],Vi=this.mod(Dr);for(An.isNegative()&&(An=An.multiply(y[-1]),Vi=Vi.modInv(Dr));An.isPositive();){if(Vi.isZero())return y[0];An.isOdd()&&(Rr=Rr.multiply(Vi).mod(Dr)),An=An.divide(2),Vi=Vi.square().mod(Dr)}return Rr},C.prototype.modPow=E.prototype.modPow=v.prototype.modPow;function yr(An,Dr){if(An.length!==Dr.length)return An.length>Dr.length?1:-1;for(var Rr=An.length-1;Rr>=0;Rr--)if(An[Rr]!==Dr[Rr])return An[Rr]>Dr[Rr]?1:-1;return 0}v.prototype.compareAbs=function(An){var Dr=Oa(An),Rr=this.value,Vi=Dr.value;return Dr.isSmall?1:yr(Rr,Vi)},E.prototype.compareAbs=function(An){var Dr=Oa(An),Rr=Math.abs(this.value),Vi=Dr.value;return Dr.isSmall?(Vi=Math.abs(Vi),Rr===Vi?0:Rr>Vi?1:-1):-1},C.prototype.compareAbs=function(An){var Dr=this.value,Rr=Oa(An).value;return Dr=Dr>=0?Dr:-Dr,Rr=Rr>=0?Rr:-Rr,Dr===Rr?0:Dr>Rr?1:-1},v.prototype.compare=function(An){if(An===1/0)return-1;if(An===-1/0)return 1;var Dr=Oa(An),Rr=this.value,Vi=Dr.value;return this.sign!==Dr.sign?Dr.sign?1:-1:Dr.isSmall?this.sign?-1:1:yr(Rr,Vi)*(this.sign?-1:1)},v.prototype.compareTo=v.prototype.compare,E.prototype.compare=function(An){if(An===1/0)return-1;if(An===-1/0)return 1;var Dr=Oa(An),Rr=this.value,Vi=Dr.value;return Dr.isSmall?Rr==Vi?0:Rr>Vi?1:-1:Rr<0!==Dr.sign?Rr<0?-1:1:Rr<0?1:-1},E.prototype.compareTo=E.prototype.compare,C.prototype.compare=function(An){if(An===1/0)return-1;if(An===-1/0)return 1;var Dr=this.value,Rr=Oa(An).value;return Dr===Rr?0:Dr>Rr?1:-1},C.prototype.compareTo=C.prototype.compare,v.prototype.equals=function(An){return this.compare(An)===0},C.prototype.eq=C.prototype.equals=E.prototype.eq=E.prototype.equals=v.prototype.eq=v.prototype.equals,v.prototype.notEquals=function(An){return this.compare(An)!==0},C.prototype.neq=C.prototype.notEquals=E.prototype.neq=E.prototype.notEquals=v.prototype.neq=v.prototype.notEquals,v.prototype.greater=function(An){return this.compare(An)>0},C.prototype.gt=C.prototype.greater=E.prototype.gt=E.prototype.greater=v.prototype.gt=v.prototype.greater,v.prototype.lesser=function(An){return this.compare(An)<0},C.prototype.lt=C.prototype.lesser=E.prototype.lt=E.prototype.lesser=v.prototype.lt=v.prototype.lesser,v.prototype.greaterOrEquals=function(An){return this.compare(An)>=0},C.prototype.geq=C.prototype.greaterOrEquals=E.prototype.geq=E.prototype.greaterOrEquals=v.prototype.geq=v.prototype.greaterOrEquals,v.prototype.lesserOrEquals=function(An){return this.compare(An)<=0},C.prototype.leq=C.prototype.lesserOrEquals=E.prototype.leq=E.prototype.lesserOrEquals=v.prototype.leq=v.prototype.lesserOrEquals,v.prototype.isEven=function(){return(this.value[0]&1)===0},E.prototype.isEven=function(){return(this.value&1)===0},C.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},v.prototype.isOdd=function(){return(this.value[0]&1)===1},E.prototype.isOdd=function(){return(this.value&1)===1},C.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},v.prototype.isPositive=function(){return!this.sign},E.prototype.isPositive=function(){return this.value>0},C.prototype.isPositive=E.prototype.isPositive,v.prototype.isNegative=function(){return this.sign},E.prototype.isNegative=function(){return this.value<0},C.prototype.isNegative=E.prototype.isNegative,v.prototype.isUnit=function(){return!1},E.prototype.isUnit=function(){return Math.abs(this.value)===1},C.prototype.isUnit=function(){return this.abs().value===BigInt(1)},v.prototype.isZero=function(){return!1},E.prototype.isZero=function(){return this.value===0},C.prototype.isZero=function(){return this.value===BigInt(0)},v.prototype.isDivisibleBy=function(An){var Dr=Oa(An);return Dr.isZero()?!1:Dr.isUnit()?!0:Dr.compareAbs(2)===0?this.isEven():this.mod(Dr).isZero()},C.prototype.isDivisibleBy=E.prototype.isDivisibleBy=v.prototype.isDivisibleBy;function _a(An){var Dr=An.abs();if(Dr.isUnit())return!1;if(Dr.equals(2)||Dr.equals(3)||Dr.equals(5))return!0;if(Dr.isEven()||Dr.isDivisibleBy(3)||Dr.isDivisibleBy(5))return!1;if(Dr.lesser(49))return!0}function Ir(An,Dr){for(var Rr=An.prev(),Vi=Rr,qt=0,Es,Eo,bi,io;Vi.isEven();)Vi=Vi.divide(2),qt++;e:for(bi=0;bi<Dr.length;bi++)if(!An.lesser(Dr[bi])&&(io=$U(Dr[bi]).modPow(Vi,An),!(io.isUnit()||io.equals(Rr)))){for(Es=qt-1;Es!=0;Es--){if(io=io.square().mod(An),io.isUnit())return!1;if(io.equals(Rr))continue e}return!1}return!0}v.prototype.isPrime=function(An){var Dr=_a(this);if(Dr!==t)return Dr;var Rr=this.abs(),Vi=Rr.bitLength();if(Vi<=64)return Ir(Rr,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var qt=Math.log(2)*Vi.toJSNumber(),Es=Math.ceil(An===!0?2*Math.pow(qt,2):qt),Eo=[],bi=0;bi<Es;bi++)Eo.push($U(bi+2));return Ir(Rr,Eo)},C.prototype.isPrime=E.prototype.isPrime=v.prototype.isPrime,v.prototype.isProbablePrime=function(An,Dr){var Rr=_a(this);if(Rr!==t)return Rr;for(var Vi=this.abs(),qt=An===t?5:An,Es=[],Eo=0;Eo<qt;Eo++)Es.push($U.randBetween(2,Vi.minus(2),Dr));return Ir(Vi,Es)},C.prototype.isProbablePrime=E.prototype.isProbablePrime=v.prototype.isProbablePrime,v.prototype.modInv=function(An){for(var Dr=$U.zero,Rr=$U.one,Vi=Oa(An),qt=this.abs(),Es,Eo,bi;!qt.isZero();)Es=Vi.divide(qt),Eo=Dr,bi=Vi,Dr=Rr,Vi=qt,Rr=Eo.subtract(Es.multiply(Rr)),qt=bi.subtract(Es.multiply(qt));if(!Vi.isUnit())throw new Error(this.toString()+" and "+An.toString()+" are not co-prime");return Dr.compare(0)===-1&&(Dr=Dr.add(An)),this.isNegative()?Dr.negate():Dr},C.prototype.modInv=E.prototype.modInv=v.prototype.modInv,v.prototype.next=function(){var An=this.value;return this.sign?Lt(An,1,this.sign):new v(Oe(An,1),this.sign)},E.prototype.next=function(){var An=this.value;return An+1<r?new E(An+1):new v(a,!1)},C.prototype.next=function(){return new C(this.value+BigInt(1))},v.prototype.prev=function(){var An=this.value;return this.sign?new v(Oe(An,1),!0):Lt(An,1,this.sign)},E.prototype.prev=function(){var An=this.value;return An-1>-r?new E(An-1):new v(a,!0)},C.prototype.prev=function(){return new C(this.value-BigInt(1))};for(var fs=[1];2*fs[fs.length-1]<=e;)fs.push(2*fs[fs.length-1]);var Ti=fs.length,kn=fs[Ti-1];function ss(An){return Math.abs(An)<=e}v.prototype.shiftLeft=function(An){var Dr=Oa(An).toJSNumber();if(!ss(Dr))throw new Error(String(Dr)+" is too large for shifting.");if(Dr<0)return this.shiftRight(-Dr);var Rr=this;if(Rr.isZero())return Rr;for(;Dr>=Ti;)Rr=Rr.multiply(kn),Dr-=Ti-1;return Rr.multiply(fs[Dr])},C.prototype.shiftLeft=E.prototype.shiftLeft=v.prototype.shiftLeft,v.prototype.shiftRight=function(An){var Dr,Rr=Oa(An).toJSNumber();if(!ss(Rr))throw new Error(String(Rr)+" is too large for shifting.");if(Rr<0)return this.shiftLeft(-Rr);for(var Vi=this;Rr>=Ti;){if(Vi.isZero()||Vi.isNegative()&&Vi.isUnit())return Vi;Dr=hr(Vi,kn),Vi=Dr[1].isNegative()?Dr[0].prev():Dr[0],Rr-=Ti-1}return Dr=hr(Vi,fs[Rr]),Dr[1].isNegative()?Dr[0].prev():Dr[0]},C.prototype.shiftRight=E.prototype.shiftRight=v.prototype.shiftRight;function $a(An,Dr,Rr){Dr=Oa(Dr);for(var Vi=An.isNegative(),qt=Dr.isNegative(),Es=Vi?An.not():An,Eo=qt?Dr.not():Dr,bi=0,io=0,Dc=null,Kp=null,op=[];!Es.isZero()||!Eo.isZero();)Dc=hr(Es,kn),bi=Dc[1].toJSNumber(),Vi&&(bi=kn-1-bi),Kp=hr(Eo,kn),io=Kp[1].toJSNumber(),qt&&(io=kn-1-io),Es=Dc[0],Eo=Kp[0],op.push(Rr(bi,io));for(var C0=Rr(Vi?1:0,qt?1:0)!==0?$U(-1):$U(0),m_=op.length-1;m_>=0;m_-=1)C0=C0.multiply(kn).add($U(op[m_]));return C0}v.prototype.not=function(){return this.negate().prev()},C.prototype.not=E.prototype.not=v.prototype.not,v.prototype.and=function(An){return $a(this,An,function(Dr,Rr){return Dr&Rr})},C.prototype.and=E.prototype.and=v.prototype.and,v.prototype.or=function(An){return $a(this,An,function(Dr,Rr){return Dr|Rr})},C.prototype.or=E.prototype.or=v.prototype.or,v.prototype.xor=function(An){return $a(this,An,function(Dr,Rr){return Dr^Rr})},C.prototype.xor=E.prototype.xor=v.prototype.xor;var Ma=1<<30,ka=(e&-e)*(e&-e)|Ma;function sl(An){var Dr=An.value,Rr=typeof Dr=="number"?Dr|Ma:typeof Dr=="bigint"?Dr|BigInt(Ma):Dr[0]+Dr[1]*e|ka;return Rr&-Rr}function ul(An,Dr){if(Dr.compareTo(An)<=0){var Rr=ul(An,Dr.square(Dr)),Vi=Rr.p,qt=Rr.e,Es=Vi.multiply(Dr);return Es.compareTo(An)<=0?{p:Es,e:qt*2+1}:{p:Vi,e:qt*2}}return{p:$U(1),e:0}}v.prototype.bitLength=function(){var An=this;return An.compareTo($U(0))<0&&(An=An.negate().subtract($U(1))),An.compareTo($U(0))===0?$U(0):$U(ul(An,$U(2)).e).add($U(1))},C.prototype.bitLength=E.prototype.bitLength=v.prototype.bitLength;function Pu(An,Dr){return An=Oa(An),Dr=Oa(Dr),An.greater(Dr)?An:Dr}function Xt(An,Dr){return An=Oa(An),Dr=Oa(Dr),An.lesser(Dr)?An:Dr}function Zu(An,Dr){if(An=Oa(An).abs(),Dr=Oa(Dr).abs(),An.equals(Dr))return An;if(An.isZero())return Dr;if(Dr.isZero())return An;for(var Rr=y[1],Vi,qt;An.isEven()&&Dr.isEven();)Vi=Xt(sl(An),sl(Dr)),An=An.divide(Vi),Dr=Dr.divide(Vi),Rr=Rr.multiply(Vi);for(;An.isEven();)An=An.divide(sl(An));do{for(;Dr.isEven();)Dr=Dr.divide(sl(Dr));An.greater(Dr)&&(qt=Dr,Dr=An,An=qt),Dr=Dr.subtract(An)}while(!Dr.isZero());return Rr.isUnit()?An:An.multiply(Rr)}function ja(An,Dr){return An=Oa(An).abs(),Dr=Oa(Dr).abs(),An.divide(Zu(An,Dr)).multiply(Dr)}function hm(An,Dr,Rr){An=Oa(An),Dr=Oa(Dr);var Vi=Rr||Math.random,qt=Xt(An,Dr),Es=Pu(An,Dr),Eo=Es.subtract(qt).add(1);if(Eo.isSmall)return qt.add(Math.floor(Vi()*Eo));for(var bi=Zl(Eo,e).value,io=[],Dc=!0,Kp=0;Kp<bi.length;Kp++){var op=Dc?bi[Kp]+(Kp+1<bi.length?bi[Kp+1]/e:0):e,C0=Q(Vi()*op);io.push(C0),C0<bi[Kp]&&(Dc=!1)}return qt.add(y.fromArray(io,e,!1))}var Aa=function(An,Dr,Rr,Vi){Rr=Rr||c,An=String(An),Vi||(An=An.toLowerCase(),Rr=Rr.toLowerCase());var qt=An.length,Es,Eo=Math.abs(Dr),bi={};for(Es=0;Es<Rr.length;Es++)bi[Rr[Es]]=Es;for(Es=0;Es<qt;Es++){var io=An[Es];if(io!=="-"&&io in bi&&bi[io]>=Eo){if(io==="1"&&Eo===1)continue;throw new Error(io+" is not a valid digit in base "+Dr+".")}}Dr=Oa(Dr);var Dc=[],Kp=An[0]==="-";for(Es=Kp?1:0;Es<An.length;Es++){var io=An[Es];if(io in bi)Dc.push(Oa(bi[io]));else if(io==="<"){var op=Es;do Es++;while(An[Es]!==">"&&Es<An.length);Dc.push(Oa(An.slice(op+1,Es)))}else throw new Error(io+" is not a valid character")}return dl(Dc,Dr,Kp)};function dl(An,Dr,Rr){var Vi=y[0],qt=y[1],Es;for(Es=An.length-1;Es>=0;Es--)Vi=Vi.add(An[Es].times(qt)),qt=qt.times(Dr);return Rr?Vi.negate():Vi}function ad(An,Dr){return Dr=Dr||c,An<Dr.length?Dr[An]:"<"+An+">"}function Zl(An,Dr){if(Dr=$U(Dr),Dr.isZero()){if(An.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(Dr.equals(-1)){if(An.isZero())return{value:[0],isNegative:!1};if(An.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-An.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var Rr=Array.apply(null,Array(An.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return Rr.unshift([1]),{value:[].concat.apply([],Rr),isNegative:!1}}var Vi=!1;if(An.isNegative()&&Dr.isPositive()&&(Vi=!0,An=An.abs()),Dr.isUnit())return An.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(An.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:Vi};for(var qt=[],Es=An,Eo;Es.isNegative()||Es.compareAbs(Dr)>=0;){Eo=Es.divmod(Dr),Es=Eo.quotient;var bi=Eo.remainder;bi.isNegative()&&(bi=Dr.minus(bi).abs(),Es=Es.next()),qt.push(bi.toJSNumber())}return qt.push(Es.toJSNumber()),{value:qt.reverse(),isNegative:Vi}}function Da(An,Dr,Rr){var Vi=Zl(An,Dr);return(Vi.isNegative?"-":"")+Vi.value.map(function(qt){return ad(qt,Rr)}).join("")}v.prototype.toArray=function(An){return Zl(this,An)},E.prototype.toArray=function(An){return Zl(this,An)},C.prototype.toArray=function(An){return Zl(this,An)},v.prototype.toString=function(An,Dr){if(An===t&&(An=10),An!==10||Dr)return Da(this,An,Dr);for(var Rr=this.value,Vi=Rr.length,qt=String(Rr[--Vi]),Es="0000000",Eo;--Vi>=0;)Eo=String(Rr[Vi]),qt+=Es.slice(Eo.length)+Eo;var bi=this.sign?"-":"";return bi+qt},E.prototype.toString=function(An,Dr){return An===t&&(An=10),An!=10||Dr?Da(this,An,Dr):String(this.value)},C.prototype.toString=E.prototype.toString,C.prototype.toJSON=v.prototype.toJSON=E.prototype.toJSON=function(){return this.toString()},v.prototype.valueOf=function(){return parseInt(this.toString(),10)},v.prototype.toJSNumber=v.prototype.valueOf,E.prototype.valueOf=function(){return this.value},E.prototype.toJSNumber=E.prototype.valueOf,C.prototype.valueOf=C.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function pl(An){if(L(+An)){var Dr=+An;if(Dr===Q(Dr))return f?new C(BigInt(Dr)):new E(Dr);throw new Error("Invalid integer: "+An)}var Rr=An[0]==="-";Rr&&(An=An.slice(1));var Vi=An.split(/e/i);if(Vi.length>2)throw new Error("Invalid integer: "+Vi.join("e"));if(Vi.length===2){var qt=Vi[1];if(qt[0]==="+"&&(qt=qt.slice(1)),qt=+qt,qt!==Q(qt)||!L(qt))throw new Error("Invalid integer: "+qt+" is not a valid exponent.");var Es=Vi[0],Eo=Es.indexOf(".");if(Eo>=0&&(qt-=Es.length-Eo-1,Es=Es.slice(0,Eo)+Es.slice(Eo+1)),qt<0)throw new Error("Cannot include negative exponent part for integers");Es+=new Array(qt+1).join("0"),An=Es}var bi=/^([0-9][0-9]*)$/.test(An);if(!bi)throw new Error("Invalid integer: "+An);if(f)return new C(BigInt(Rr?"-"+An:An));for(var io=[],Dc=An.length,Kp=n,op=Dc-Kp;Dc>0;)io.push(+An.slice(op,Dc)),op-=Kp,op<0&&(op=0),Dc-=Kp;return V(io),new v(io,Rr)}function ia(An){if(f)return new C(BigInt(An));if(L(An)){if(An!==Q(An))throw new Error(An+" is not an integer.");return new E(An)}return pl(An.toString())}function Oa(An){return typeof An=="number"?ia(An):typeof An=="string"?pl(An):typeof An=="bigint"?new C(An):An}for(var Ms=0;Ms<1e3;Ms++)y[Ms]=Oa(Ms),Ms>0&&(y[-Ms]=Oa(-Ms));return y.one=y[1],y.zero=y[0],y.minusOne=y[-1],y.max=Pu,y.min=Xt,y.gcd=Zu,y.lcm=ja,y.isInstance=function(An){return An instanceof v||An instanceof E||An instanceof C},y.randBetween=hm,y.fromArray=function(An,Dr,Rr){return dl(An.map(Oa),Oa(Dr||10),Rr)},y}();typeof hqt<"u"&&hqt.hasOwnProperty("exports")&&(hqt.exports=$U);typeof define=="function"&&define.amd&&define(function(){return $U})});var M2r=Fe((QCo,R2r)=>{var Xqe=L2r(),nes=require("stream"),_qt;function res(){var t=3988292384,e,n,r;for(_qt=[],n=0;n<256;n++){for(e=n,r=0;r<8;r++)e=e&1?t^e>>>1:e=e>>>1;_qt[n]=e>>>0}}function O2r(t,e){return _qt||res(),t.charCodeAt&&(t=t.charCodeAt(0)),Xqe(e).shiftRight(8).and(16777215).xor(_qt[Xqe(e).xor(t).and(255)]).value}function g1t(){if(!(this instanceof g1t))return new g1t;this.key0=305419896,this.key1=591751049,this.key2=878082192}g1t.prototype.update=function(t){this.key0=O2r(t,this.key0),this.key1=Xqe(this.key0).and(255).and(4294967295).add(this.key1),this.key1=Xqe(this.key1).multiply(134775813).add(1).and(4294967295).value,this.key2=O2r(Xqe(this.key1).shiftRight(24).and(255),this.key2)};g1t.prototype.decryptByte=function(t){var e=Xqe(this.key2).or(2);return t=t^Xqe(e).multiply(Xqe(e^1)).shiftRight(8).and(255),this.update(t),t};g1t.prototype.stream=function(){var t=nes.Transform(),e=this;return t._transform=function(n,r,a){for(var c=0;c<n.length;c++)n[c]=e.decryptByte(n[c]);this.push(n),a()},t};R2r.exports=g1t});var W2r=Fe((ZCo,B2r)=>{var ies=Wqe(),ses=M2r(),aes=OKt(),F2r=require("stream"),oes=require("zlib"),les=MKt(),ces=FKt(),ues=cMt();B2r.exports=function(e,n,r,a,c){var f=aes(),y=F2r.PassThrough(),v=e.stream(n,c);return v.pipe(f).on("error",function(E){y.emit("error",E)}),y.vars=f.pull(30).then(function(E){var C=ues.parse(E,[["signature",4],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return C.lastModifiedDateTime=ces(C.lastModifiedDate,C.lastModifiedTime),f.pull(C.fileNameLength).then(function(L){return C.fileName=L.toString("utf8"),f.pull(C.extraFieldLength)}).then(function(L){var R;return C.extra=les(L,C),a&&a.compressedSize&&(C=a),C.flags&1&&(R=f.pull(12).then(function(F){if(!r)throw new Error("MISSING_PASSWORD");var V=ses();String(r).split("").forEach(function(ee){V.update(ee)});for(var U=0;U<F.length;U++)F[U]=V.decryptByte(F[U]);C.decrypt=V,C.compressedSize-=12;var Q=C.flags&8?C.lastModifiedTime>>8&255:C.crc32>>24&255;if(F[11]!==Q)throw new Error("BAD_PASSWORD");return C})),ies.resolve(R).then(function(){return y.emit("vars",C),C})})}),y.vars.then(function(E){var C=!(E.flags&8)||E.compressedSize>0,L,R=E.compressionMethod?oes.createInflateRaw():F2r.PassThrough();C?(y.size=E.uncompressedSize,L=E.compressedSize):(L=Buffer.alloc(4),L.writeUInt32LE(134695760,0));var F=f.stream(L);E.decrypt&&(F=F.pipe(E.decrypt.stream())),F.pipe(R).on("error",function(V){y.emit("error",V)}).pipe(y).on("finish",function(){v.destroy?v.destroy():v.abort?v.abort():v.close?v.close():v.push?v.push():console.log("warning - unable to close stream")})}).catch(function(E){y.emit("error",E)}),y}});var U2r=Fe((eDo,G2r)=>{var LMt=OKt(),fes=W2r(),kMt=Wqe(),des=RKt(),pes=MKt(),DPn=require("path"),mes=APn().Writer,hes=FKt(),OMt=cMt(),j2r=Buffer.alloc(4);j2r.writeUInt32LE(101010256,0);function _es(t){var e=t.stream(0).pipe(LMt());return e.pull(4).then(function(n){var r=n.readUInt32LE(0);if(r===875721283){var a;return e.pull(12).then(function(c){a=OMt.parse(c,[["version",4],["pubKeyLength",4],["signatureLength",4]])}).then(function(){return e.pull(a.pubKeyLength+a.signatureLength)}).then(function(c){return a.publicKey=c.slice(0,a.pubKeyLength),a.signature=c.slice(a.pubKeyLength),a.size=16+a.pubKeyLength+a.signatureLength,a})}})}function ges(t,e){var n=OMt.parse(e,[["signature",4],["diskNumber",4],["offsetToStartOfCentralDirectory",8],["numberOfDisks",4]]);if(n.signature!=117853008)throw new Error("invalid zip64 end of central dir locator signature (0x07064b50): 0x"+n.signature.toString(16));var r=LMt();return t.stream(n.offsetToStartOfCentralDirectory).pipe(r),r.pull(56)}function yes(t){var e=OMt.parse(t,[["signature",4],["sizeOfCentralDirectory",8],["version",2],["versionsNeededToExtract",2],["diskNumber",4],["diskStart",4],["numberOfRecordsOnDisk",8],["numberOfRecords",8],["sizeOfCentralDirectory",8],["offsetToStartOfCentralDirectory",8]]);if(e.signature!=101075792)throw new Error("invalid zip64 end of central dir locator signature (0x06064b50): 0x0"+e.signature.toString(16));return e}G2r.exports=function(e,n){var r=LMt(),a=LMt(),c=n&&n.tailSize||80,f,y,v,E;return n&&n.crx&&(y=_es(e)),e.size().then(function(C){return f=C,e.stream(Math.max(0,C-c)).on("error",function(L){r.emit("error",L)}).pipe(r),r.pull(j2r)}).then(function(){return kMt.props({directory:r.pull(22),crxHeader:y})}).then(function(C){var L=C.directory;if(v=C.crxHeader&&C.crxHeader.size||0,E=OMt.parse(L,[["signature",4],["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]),E.numberOfRecords==65535||E.numberOfRecords==65535||E.offsetToStartOfCentralDirectory==4294967295){let F=f-(c-r.match+20),V=LMt();return e.stream(F).pipe(V),V.pull(20).then(function(U){return ges(e,U)}).then(function(U){E=yes(U)})}else E.offsetToStartOfCentralDirectory+=v}).then(function(){if(E.commentLength)return r.pull(E.commentLength).then(function(C){E.comment=C.toString("utf8")})}).then(function(){return e.stream(E.offsetToStartOfCentralDirectory).pipe(a),E.extract=function(C){if(!C||!C.path)throw new Error("PATH_MISSING");return C.path=DPn.resolve(DPn.normalize(C.path)),E.files.then(function(L){return kMt.map(L,function(R){if(R.type!="Directory"){var F=DPn.join(C.path,R.path);if(F.indexOf(C.path)==0){var V=C.getWriter?C.getWriter({path:F}):mes({path:F});return new kMt(function(U,Q){R.stream(C.password).on("error",Q).pipe(V).on("close",U).on("error",Q)})}}},{concurrency:C.concurrency>1?C.concurrency:1})})},E.files=kMt.mapSeries(Array(E.numberOfRecords),function(){return a.pull(46).then(function(C){var L=L=OMt.parse(C,[["signature",4],["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return L.offsetToLocalFileHeader+=v,L.lastModifiedDateTime=hes(L.lastModifiedDate,L.lastModifiedTime),a.pull(L.fileNameLength).then(function(R){return L.pathBuffer=R,L.path=R.toString("utf8"),L.isUnicode=(L.flags&2048)!=0,a.pull(L.extraFieldLength)}).then(function(R){return L.extra=pes(R,L),a.pull(L.fileCommentLength)}).then(function(R){L.comment=R,L.type=L.uncompressedSize===0&&/[\/\\]$/.test(L.path)?"Directory":"File";var F=n&&n.padding||1e3;return L.stream=function(V){var U=30+F+(L.extraFieldLength||0)+(L.fileNameLength||0)+L.compressedSize;return fes(e,L.offsetToLocalFileHeader,V,L,U)},L.buffer=function(V){return des(L.stream(V))},L})})}),kMt.props(E)})}});var K2r=Fe((tDo,z2r)=>{var V2r=MPe(),gqt=Wqe(),RMt=U2r(),xes=require("stream");z2r.exports={buffer:function(t,e){var n={stream:function(r,a){var c=xes.PassThrough(),f=a?r+a:void 0;return c.end(t.slice(r,f)),c},size:function(){return gqt.resolve(t.length)}};return RMt(n,e)},file:function(t,e){var n={stream:function(r,a){var c=a?r+a:void 0;return V2r.createReadStream(t,{start:r,end:c})},size:function(){return new gqt(function(r,a){V2r.stat(t,function(c,f){c?a(c):r(f.size)})})}};return RMt(n,e)},url:function(t,e,n){if(typeof e=="string"&&(e={url:e}),!e.url)throw"URL missing";e.headers=e.headers||{};var r={stream:function(a,c){var f=Object.create(e),y=c?a+c:"";return f.headers=Object.create(e.headers),f.headers.range="bytes="+a+"-"+y,t(f)},size:function(){return new gqt(function(a,c){var f=t(e);f.on("response",function(y){f.abort(),y.headers["content-length"]?a(y.headers["content-length"]):c(new Error("Missing content length header"))}).on("error",c)})}};return RMt(r,n)},s3:function(t,e,n){var r={size:function(){return new gqt(function(a,c){t.headObject(e,function(f,y){f?c(f):a(y.ContentLength)})})},stream:function(a,c){var f={};for(var y in e)f[y]=e[y];var v=c?a+c:"";return f.Range="bytes="+a+"-"+v,t.getObject(f).createReadStream()}};return RMt(r,n)},custom:function(t,e){return RMt(t,e)}}});var q2r=Fe(MMt=>{"use strict";MMt.Parse=BKt();MMt.ParseOne=GEr();MMt.Extract=k2r();MMt.Open=K2r()});var ves,wPn,IPn,H2r,BPe,J2r,$2r,X2r,Y2r,Q2r=tr(()=>{"use strict";ves=Od(Bhr(),1);sgr();wPn=Od(avr(),1),IPn=Od(obr(),1),H2r=Od(q2r(),1),BPe=require("node:fs/promises"),J2r=async(t,e)=>{await(0,BPe.access)(t,BPe.constants.F_OK).catch(()=>{throw new Error(`[Archiver]: source ${t} does not exist`)}),await(0,BPe.access)(e,BPe.constants.F_OK).catch(()=>(0,BPe.mkdir)(e,{recursive:!0}))},$2r=async(t,e)=>(await J2r(t,e),wPn.x({file:t,cwd:e})),X2r=async(t,e)=>(await J2r(t,e),await H2r.default.Open.file(t).then(n=>n.extract({path:e,concurrency:5})),e),Y2r=async t=>{let e=IPn.pack();for(let{name:a,data:c}of Object.values(t))e.entry({name:a},c);e.finalize();let n=[];return e.on("data",a=>n.push(a)),await new Promise((a,c)=>{e.on("end",a),e.on("error",c)}),Buffer.from(igr.gzip(Buffer.concat(n)))}});async function WPe(t){let{source:e,throwOnNotFound:n=!1}=t,r=await(0,Z2r.readFile)((0,eTr.join)(e,".codemodrc.json"),{encoding:"utf-8"}).catch(()=>null);if(r===null){let c=`Could not locate the .codemodrc.json file at ${e}`;if(n)throw new Error(c);return{config:null,error:c}}let a;try{a=tqe(JSON.parse(r))}catch{let f=`Failed to parse the .codemodrc.json file at ${e}`;if(n)throw new Error(f);return{config:null,error:f}}return{config:a,error:null}}async function e4e(t){let{source:e,throwOnNotFound:n}=t,{config:r,error:a}=await WPe({source:e,throwOnNotFound:!1});if(r===null){if(n)throw new Error(a);return{path:null,error:a}}let c;switch(r.engine){case"ast-grep":c="**/rule.yaml";break;default:c="src/index.{ts,js}";break}let f=r.entry?`Make sure the entry point path under ${aD("entry")} key is correct in .codemodrc.json`:`Could not find an entry point under ${aD(c)}. Either create it or provide a path at ${aD("entry")} key in .codemodrc.json`,v=(await Tne(r.entry??c,{absolute:!0,cwd:e,nodir:!0})).at(0)??null;if(v===null){if(n)throw new Error(f);return{path:null,error:f}}return{path:v,error:null}}var Z2r,eTr,tTr=tr(()=>{"use strict";Z2r=require("node:fs/promises"),eTr=require("node:path");oqe();sOt();AUt()});var nTr=tr(()=>{"use strict"});var rTr=tr(()=>{"use strict"});var iTr=tr(()=>{"use strict"});var sTr,aTr,D3,oTr,PPn=tr(()=>{"use strict";sTr=require("node:child_process"),aTr=require("node:util"),D3=(0,aTr.promisify)(sTr.exec),oTr=async t=>{let e=t(),{done:n}=await e.next();return n}});async function yqt(t,e=!1){let n=null,r=null;try{let{stdout:c}=await D3("git rev-parse --show-toplevel",{cwd:t}),f=c.trim();if(f.length&&(r=f,e))return{rootPath:r}}catch{}if(r===null){let c=t;for(;;){try{await(0,ZEe.access)((0,olt.join)(c,".git"),ZEe.constants.R_OK|ZEe.constants.W_OK);let y=(0,olt.join)(c,"package.json");await(0,ZEe.access)(y,ZEe.constants.R_OK|ZEe.constants.W_OK),r=c}catch{}if(r){if(e)return{rootPath:r};break}let f=(0,olt.dirname)(c);if(f===c)break;c=f}}let a=t;for(;;){for(let f of Object.keys(lTr))try{await(0,ZEe.access)((0,olt.join)(a,f),ZEe.constants.R_OK|ZEe.constants.W_OK),n=lTr[f],r===null&&(r=a);break}catch{}if(r){if(e)return{rootPath:r};break}let c=(0,olt.dirname)(a);if(c===a)break;a=c}return{rootPath:r,detectedPackageManager:n}}var ZEe,olt,lTr,cTr=tr(()=>{"use strict";ZEe=require("node:fs/promises"),olt=require("node:path");PPn();lTr={"package-lock.json":"npm","yarn.lock":"yarn","pnpm-lock.yaml":"pnpm","bun.lockb":"bun"}});var bes,FMt,uTr,NPn=tr(()=>{"use strict";Wae();bes=CC({engine:ov("jscodeshift"),parser:WL([ov("babel"),ov("babylon"),ov("flow"),ov("ts"),ov("tsx")])}),FMt=WL([bes]),uTr=t=>{let e=_fe(FMt,t);return e.success?e.output:null}});var fTr,kPn,LPn,dTr,OPn,pTr,BMt,llt,mTr,hTr=tr(()=>{"use strict";Wae();DUt();sOt();NPn();fTr=CC({$schema:lv(Ev()),path:Ev(),source:WL([ov("local"),ov("remote")]),type:WL([ov("standalone"),ov("package")]),safeArgumentRecord:lv(CUt,{}),engineOptions:lv(BLt(FMt),null)}),kPn=CC({...fTr.entries,...CC({config:DSn}).entries}),LPn=CC({...fTr.entries,...CC({config:wSn,codemods:lv(KU(kPn),[])}).entries}),dTr=WL([kPn,LPn]),OPn=t=>_fe(kPn,t),pTr=t=>_fe(LPn,t),BMt=t=>LEn(LPn,t),llt=t=>lQ(dTr,t),mTr=t=>_fe(dTr,t)});var _Tr=tr(()=>{"use strict"});var vDo,bDo,gTr=tr(()=>{"use strict";Wae();vDo=CC({codemodSource:Ev(),codemodEngine:WL([ov("jscodeshift"),ov("ts-morph"),ov("workflow")]),codemodArguments:lv(Ev()),repoUrl:lv(Ev()),branch:lv(Ev()),persistent:lv(ZM())}),bDo=CC({jobId:Ev()})});var XU=tr(()=>{"use strict";uor();Cur();lhr();Q2r();tTr();nTr();rTr();AUt();iTr();PPn();cTr();oSn();DUt();sOt();hTr();NPn();_Tr();gTr()});var Ees,yTr,xTr=tr(()=>{"use strict";Wae();XU();Ees=WL([CC({kind:ov("initialization"),path:Ev(),codemodSource:Ev(),engine:WL([ov("jscodeshift"),ov("ts-morph"),ov("ast-grep"),ov("workflow")]),format:ZM(),safeArgumentRecord:CUt,engineOptions:BLt(FMt)}),CC({kind:ov("exit")}),CC({kind:ov("runCodemod"),path:Ev(),data:Ev()})]),yTr=t=>lQ(Ees,t)});var vTr=tr(()=>{"use strict"});var Ses,bTr,ETr=tr(()=>{"use strict";Wae();FEn();Ses=WL([CC({kind:ov("commands"),commands:MEn(),path:lv(Ev())}),CC({kind:ov("error"),message:Ev(),path:lv(Ev())}),CC({kind:ov("console"),consoleKind:cor,message:Ev()})]),bTr=t=>lQ(Ses,t)});var d4=tr(()=>{"use strict";RJ();Ksr();Zar();sor();FEn();xTr();vTr();ETr()});var eSe,WMt=tr(()=>{eSe="0.13.13"});var STr,TTr,RPn,tSe,jMt,rwo,y1t=tr(()=>{"use strict";STr=Od(require("node:os"),1),TTr=require("node:path");d4();RPn=process.stdout.write,tSe=(0,TTr.join)(STr.homedir(),".codemod"),jMt=Yo.green("\u2714"),rwo=Yo.red("\u2716")});var MPn,x1t,FPn,xqt,vqt,BPn=tr(()=>{"use strict";MPn=Od(require("node:fs"),1),x1t=Od(require("node:os"),1),FPn=require("node:path");d4();XU();WMt();y1t();xqt=(0,FPn.join)(tSe,"logs"),vqt=async t=>{let{prefix:e,content:n,fatal:r}=t,a=(0,FPn.join)(xqt,`${r?"FATAL-":""}${new Date().toISOString()}-error.log`),c=`- CLI version: ${eSe}
|
|
864
864
|
- Node version: ${process.versions.node}
|
|
865
865
|
- OS: ${x1t.type()} ${x1t.release()} ${x1t.arch()}
|
|
866
866
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"imports": {
|
|
5
5
|
"#*": "./src/*"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.13.
|
|
7
|
+
"version": "0.13.13",
|
|
8
8
|
"description": "A codemod engine for Node.js libraries (jscodeshift, ts-morph, etc.)",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"exports": null,
|
|
@@ -60,13 +60,12 @@
|
|
|
60
60
|
"valibot": "^0.34.0",
|
|
61
61
|
"vitest": "^1.0.1",
|
|
62
62
|
"yargs": "^17.6.2",
|
|
63
|
+
"@codemod-com/printer": "1.0.1",
|
|
63
64
|
"@codemod-com/api-types": "1.0.0",
|
|
65
|
+
"@codemod-com/telemetry": "1.1.0",
|
|
64
66
|
"@codemod-com/filemod": "2.1.0",
|
|
65
67
|
"@codemod-com/runner": "1.1.2",
|
|
66
|
-
"@codemod-com/
|
|
67
|
-
"@codemod-com/utilities": "1.1.7",
|
|
68
|
-
"@codemod-com/telemetry": "1.1.0",
|
|
69
|
-
"@codemod.com/workflow": "0.0.29"
|
|
68
|
+
"@codemod-com/utilities": "1.1.7"
|
|
70
69
|
},
|
|
71
70
|
"engines": {
|
|
72
71
|
"node": ">=18.5.0"
|
|
@@ -89,7 +88,8 @@
|
|
|
89
88
|
"keytar": "^7.9.0",
|
|
90
89
|
"@octokit/rest": "^20.0.2",
|
|
91
90
|
"blessed": "^0.1.81",
|
|
92
|
-
"esbuild": "^0.23.0"
|
|
91
|
+
"esbuild": "^0.23.0",
|
|
92
|
+
"@codemod.com/workflow": "0.0.31"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"build": "tsc && node ./build.js",
|