@imfelixyeung/git-swarm 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,118 +1,119 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var Ug=Object.create;var{getPrototypeOf:Gg,defineProperty:Ii,getOwnPropertyNames:Wg}=Object;var Ni=Object.prototype.hasOwnProperty;function Vg(e){return this[e]}var qg,Jg,at=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var o=t?qg??=new WeakMap:Jg??=new WeakMap,s=o.get(e);if(s)return s}r=e!=null?Ug(Gg(e)):{};let i=t||!e||!e.__esModule||!Ni.call(e,"default")?Ii(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let u of Wg(e))if(!Ni.call(i,u))Ii(i,u,{get:Vg.bind(e,u),enumerable:!0})}if(n)o.set(e,i);return i};var j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pt=import.meta.require;var Ui=j(function(Sk,Hi){var zt=1000,Rt=zt*60,It=Rt*60,bt=It*24,rD=bt*7,nD=bt*365.25;Hi.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return oD(e);else if(r==="number"&&isFinite(e))return t.long?iD(e):sD(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function oD(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*nD;case"weeks":case"week":case"w":return r*rD;case"days":case"day":case"d":return r*bt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*It;case"minutes":case"minute":case"mins":case"min":case"m":return r*Rt;case"seconds":case"second":case"secs":case"sec":case"s":return r*zt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function sD(e){var t=Math.abs(e);if(t>=bt)return Math.round(e/bt)+"d";if(t>=It)return Math.round(e/It)+"h";if(t>=Rt)return Math.round(e/Rt)+"m";if(t>=zt)return Math.round(e/zt)+"s";return e+"ms"}function iD(e){var t=Math.abs(e);if(t>=bt)return Jr(e,t,bt,"day");if(t>=It)return Jr(e,t,It,"hour");if(t>=Rt)return Jr(e,t,Rt,"minute");if(t>=zt)return Jr(e,t,zt,"second");return e+" ms"}function Jr(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var po=j(function(Ok,Gi){function uD(e){r.debug=r,r.default=r,r.coerce=a,r.disable=i,r.enable=o,r.enabled=u,r.humanize=Ui(),r.destroy=c,Object.keys(e).forEach((l)=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let p=0;for(let f=0;f<l.length;f++)p=(p<<5)-p+l.charCodeAt(f),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=t;function r(l){let p,f=null,h,d;function m(...y){if(!m.enabled)return;let A=m,v=Number(new Date),M=v-(p||v);if(A.diff=M,A.prev=p,A.curr=v,p=v,y[0]=r.coerce(y[0]),typeof y[0]!=="string")y.unshift("%O");let G=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(F,N)=>{if(F==="%%")return"%";G++;let P=r.formatters[N];if(typeof P==="function"){let Z=y[G];F=P.call(A,Z),y.splice(G,1),G--}return F}),r.formatArgs.call(A,y),(A.log||r.log).apply(A,y)}if(m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(f!==null)return f;if(h!==r.namespaces)h=r.namespaces,d=r.enabled(l);return d},set:(y)=>{f=y}}),typeof r.init==="function")r.init(m);return m}function n(l,p){let f=r(this.namespace+(typeof p>"u"?":":p)+l);return f.log=this.log,f}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let p=(typeof l==="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of p)if(f[0]==="-")r.skips.push(f.slice(1));else r.names.push(f)}function s(l,p){let f=0,h=0,d=-1,m=0;while(f<l.length)if(h<p.length&&(p[h]===l[f]||p[h]==="*"))if(p[h]==="*")d=h,m=f,h++;else f++,h++;else if(d!==-1)h=d+1,m++,f=m;else return!1;while(h<p.length&&p[h]==="*")h++;return h===p.length}function i(){let l=[...r.names,...r.skips.map((p)=>"-"+p)].join(",");return r.enable(""),l}function u(l){for(let p of r.skips)if(s(l,p))return!1;for(let p of r.names)if(s(l,p))return!0;return!1}function a(l){if(l instanceof Error)return l.stack||l.message;return l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Gi.exports=uD});var Wi=j(function(fo,Kr){fo.formatArgs=cD;fo.save=lD;fo.load=pD;fo.useColors=aD;fo.storage=fD();fo.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();fo.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function aD(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function cD(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Kr.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(o)=>{if(o==="%%")return;if(r++,o==="%c")n=r}),e.splice(n,0,t)}fo.log=console.debug||console.log||(()=>{});function lD(e){try{if(e)fo.storage.setItem("debug",e);else fo.storage.removeItem("debug")}catch(t){}}function pD(){let e;try{e=fo.storage.getItem("debug")||fo.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function fD(){try{return localStorage}catch(e){}}Kr.exports=po()(fo);var{formatters:hD}=Kr.exports;hD.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Ji=j(function(ho,Xr){var xD=Pt("tty"),Yr=Pt("util");ho.init=SD;ho.log=ED;ho.formatArgs=wD;ho.save=$D;ho.load=kD;ho.useColors=vD;ho.destroy=Yr.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ho.colors=[6,2,3,4,5,1];try{let e=(()=>{throw new Error("Cannot require module "+"supports-color");})();if(e&&(e.stderr||e).level>=2)ho.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}ho.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n))n=!0;else if(/^(no|off|false|disabled)$/i.test(n))n=!1;else if(n==="null")n=null;else n=Number(n);return e[r]=n,e},{});function vD(){return"colors"in ho.inspectOpts?Boolean(ho.inspectOpts.colors):xD.isatty(process.stderr.fd)}function wD(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
3
+ var M_=Object.create;var{getPrototypeOf:Z_,defineProperty:ou,getOwnPropertyNames:j_}=Object;var su=Object.prototype.hasOwnProperty;function H_(e){return this[e]}var U_,G_,ot=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var o=t?U_??=new WeakMap:G_??=new WeakMap,s=o.get(e);if(s)return s}r=e!=null?M_(Z_(e)):{};let i=t||!e||!e.__esModule||!su.call(e,"default")?ou(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let u of j_(e))if(!su.call(i,u))ou(i,u,{get:H_.bind(e,u),enumerable:!0})}if(n)o.set(e,i);return i};var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Lt=import.meta.require;var fu=F(function(hA,pu){var Bt=1000,Mt=Bt*60,Zt=Mt*60,wt=Zt*24,X_=wt*7,Q_=wt*365.25;pu.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return ey(e);else if(r==="number"&&isFinite(e))return t.long?ry(e):ty(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ey(e){if(e=String(e),e.length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Q_;case"weeks":case"week":case"w":return r*X_;case"days":case"day":case"d":return r*wt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Zt;case"minutes":case"minute":case"mins":case"min":case"m":return r*Mt;case"seconds":case"second":case"secs":case"sec":case"s":return r*Bt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function ty(e){var t=Math.abs(e);if(t>=wt)return Math.round(e/wt)+"d";if(t>=Zt)return Math.round(e/Zt)+"h";if(t>=Mt)return Math.round(e/Mt)+"m";if(t>=Bt)return Math.round(e/Bt)+"s";return e+"ms"}function ry(e){var t=Math.abs(e);if(t>=wt)return pn(e,t,wt,"day");if(t>=Zt)return pn(e,t,Zt,"hour");if(t>=Mt)return pn(e,t,Mt,"minute");if(t>=Bt)return pn(e,t,Bt,"second");return e+" ms"}function pn(e,t,r,n){var o=t>=r*1.5;return Math.round(e/r)+" "+n+(o?"s":"")}});var $o=F(function(dA,hu){function ny(e){r.debug=r,r.default=r,r.coerce=a,r.disable=i,r.enable=o,r.enabled=u,r.humanize=fu(),r.destroy=c,Object.keys(e).forEach((l)=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let p=0;for(let f=0;f<l.length;f++)p=(p<<5)-p+l.charCodeAt(f),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=t;function r(l){let p,f=null,h,d;function m(...b){if(!m.enabled)return;let A=m,v=Number(new Date),j=v-(p||v);if(A.diff=j,A.prev=p,A.curr=v,p=v,b[0]=r.coerce(b[0]),typeof b[0]!=="string")b.unshift("%O");let G=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(T,L)=>{if(T==="%%")return"%";G++;let P=r.formatters[L];if(typeof P==="function"){let M=b[G];T=P.call(A,M),b.splice(G,1),G--}return T}),r.formatArgs.call(A,b),(A.log||r.log).apply(A,b)}if(m.namespace=l,m.useColors=r.useColors(),m.color=r.selectColor(l),m.extend=n,m.destroy=r.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(f!==null)return f;if(h!==r.namespaces)h=r.namespaces,d=r.enabled(l);return d},set:(b)=>{f=b}}),typeof r.init==="function")r.init(m);return m}function n(l,p){let f=r(this.namespace+(typeof p>"u"?":":p)+l);return f.log=this.log,f}function o(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let p=(typeof l==="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of p)if(f[0]==="-")r.skips.push(f.slice(1));else r.names.push(f)}function s(l,p){let f=0,h=0,d=-1,m=0;while(f<l.length)if(h<p.length&&(p[h]===l[f]||p[h]==="*"))if(p[h]==="*")d=h,m=f,h++;else f++,h++;else if(d!==-1)h=d+1,m++,f=m;else return!1;while(h<p.length&&p[h]==="*")h++;return h===p.length}function i(){let l=[...r.names,...r.skips.map((p)=>"-"+p)].join(",");return r.enable(""),l}function u(l){for(let p of r.skips)if(s(l,p))return!1;for(let p of r.names)if(s(l,p))return!0;return!1}function a(l){if(l instanceof Error)return l.stack||l.message;return l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}hu.exports=ny});var du=F(function(Oo,fn){Oo.formatArgs=sy;Oo.save=iy;Oo.load=uy;Oo.useColors=oy;Oo.storage=ay();Oo.destroy=(()=>{let e=!1;return()=>{if(!e)e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();Oo.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function oy(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function sy(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+fn.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,(o)=>{if(o==="%%")return;if(r++,o==="%c")n=r}),e.splice(n,0,t)}Oo.log=console.debug||console.log||(()=>{});function iy(e){try{if(e)Oo.storage.setItem("debug",e);else Oo.storage.removeItem("debug")}catch(t){}}function uy(){let e;try{e=Oo.storage.getItem("debug")||Oo.storage.getItem("DEBUG")}catch(t){}if(!e&&typeof process<"u"&&"env"in process)e=process.env.DEBUG;return e}function ay(){try{return localStorage}catch(e){}}fn.exports=$o()(Oo);var{formatters:cy}=fn.exports;cy.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var _u=F(function(Ao,dn){var _y=Lt("tty"),hn=Lt("util");Ao.init=Cy;Ao.log=xy;Ao.formatArgs=Dy;Ao.save=vy;Ao.load=wy;Ao.useColors=yy;Ao.destroy=hn.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Ao.colors=[6,2,3,4,5,1];try{let e=(()=>{throw new Error("Cannot require module "+"supports-color");})();if(e&&(e.stderr||e).level>=2)Ao.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(e){}Ao.inspectOpts=Object.keys(process.env).filter((e)=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n))n=!0;else if(/^(no|off|false|disabled)$/i.test(n))n=!1;else if(n==="null")n=null;else n=Number(n);return e[r]=n,e},{});function yy(){return"colors"in Ao.inspectOpts?Boolean(Ao.inspectOpts.colors):_y.isatty(process.stderr.fd)}function Dy(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,o="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
4
4
  `).join(`
5
- `+s),e.push(o+"m+"+Xr.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=CD()+t+" "+e[0]}function CD(){if(ho.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function ED(...e){return process.stderr.write(Yr.formatWithOptions(ho.inspectOpts,...e)+`
6
- `)}function $D(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function kD(){return process.env.DEBUG}function SD(e){e.inspectOpts={};let t=Object.keys(ho.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=ho.inspectOpts[t[r]]}Xr.exports=po()(ho);var{formatters:Vi}=Xr.exports;Vi.o=function(e){return this.inspectOpts.colors=this.useColors,Yr.inspect(e,this.inspectOpts).split(`
7
- `).map((t)=>t.trim()).join(" ")};Vi.O=function(e){return this.inspectOpts.colors=this.useColors,Yr.inspect(e,this.inspectOpts)}});var go=j(function(Tk,mo){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)mo.exports=Wi();else mo.exports=Ji()});var Ki=j(function(Re){var ID=Re&&Re.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Re,"__esModule",{value:!0});var ND=Pt("fs"),LD=ID(go()),Nt=LD.default("@kwsites/file-exists");function ZD(e,t,r){Nt("checking %s",e);try{let n=ND.statSync(e);if(n.isFile()&&t)return Nt("[OK] path represents a file"),!0;if(n.isDirectory()&&r)return Nt("[OK] path represents a directory"),!0;return Nt("[FAIL] path represents something other than a file or directory"),!1}catch(n){if(n.code==="ENOENT")return Nt("[FAIL] path is not accessible: %o",n),!1;throw Nt("[FATAL] %o",n),n}}function BD(e,t=Re.READABLE){return ZD(e,(t&Re.FILE)>0,(t&Re.FOLDER)>0)}Re.exists=BD;Re.FILE=1;Re.FOLDER=2;Re.READABLE=Re.FILE+Re.FOLDER});var Yi=j(function(Qr){function MD(e){for(var t in e)if(!Qr.hasOwnProperty(t))Qr[t]=e[t]}Object.defineProperty(Qr,"__esModule",{value:!0});MD(Ki())});var bo=j(function(Xi){Object.defineProperty(Xi,"__esModule",{value:!0});Xi.createDeferred=Xi.deferred=void 0;function _o(){let e,t,r="pending";return{promise:new Promise((o,s)=>{e=o,t=s}),done(o){if(r==="pending")r="resolved",e(o)},fail(o){if(r==="pending")r="rejected",t(o)},get fulfilled(){return r!=="pending"},get status(){return r}}}Xi.deferred=_o;Xi.createDeferred=_o;Xi.default=_o});var br=j(function(PS,Jc){var qc={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},k0={...qc,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},S0={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Jc.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:S0,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?k0:qc}}});var yr=j(function(P0){var{REGEX_BACKSLASH:O0,REGEX_REMOVE_BACKSLASH:A0,REGEX_SPECIAL_CHARS:F0,REGEX_SPECIAL_CHARS_GLOBAL:T0}=br();P0.isObject=(e)=>e!==null&&typeof e==="object"&&!Array.isArray(e);P0.hasRegexChars=(e)=>F0.test(e);P0.isRegexChar=(e)=>e.length===1&&P0.hasRegexChars(e);P0.escapeRegex=(e)=>e.replace(T0,"\\$1");P0.toPosixSlashes=(e)=>e.replace(O0,"/");P0.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let e=navigator.platform.toLowerCase();return e==="win32"||e==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};P0.removeBackslashes=(e)=>e.replace(A0,(t)=>t==="\\"?"":t);P0.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);if(n===-1)return e;if(e[n-1]==="\\")return P0.escapeLast(e,t,n-1);return`${e.slice(0,n)}\\${e.slice(n)}`};P0.removePrefix=(e,t={})=>{let r=e;if(r.startsWith("./"))r=r.slice(2),t.prefix="./";return r};P0.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${e})${o}`;if(t.negated===!0)s=`(?:^(?!${s}).*$)`;return s};P0.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];if(n==="")return r[r.length-2];return n}});var sl=j(function(RS,ol){var Xc=yr(),{CHAR_ASTERISK:ps,CHAR_AT:H0,CHAR_BACKWARD_SLASH:Wt,CHAR_COMMA:U0,CHAR_DOT:fs,CHAR_EXCLAMATION_MARK:hs,CHAR_FORWARD_SLASH:nl,CHAR_LEFT_CURLY_BRACE:ds,CHAR_LEFT_PARENTHESES:xn,CHAR_LEFT_SQUARE_BRACKET:G0,CHAR_PLUS:W0,CHAR_QUESTION_MARK:Qc,CHAR_RIGHT_CURLY_BRACE:V0,CHAR_RIGHT_PARENTHESES:el,CHAR_RIGHT_SQUARE_BRACKET:q0}=br(),tl=(e)=>e===nl||e===Wt,rl=(e)=>{if(e.isPrefix!==!0)e.depth=e.isGlobstar?1/0:1},J0=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.tokens===!0||r.scanToEnd===!0,s=[],i=[],u=[],a=e,c=-1,l=0,p=0,f=!1,h=!1,d=!1,m=!1,y=!1,A=!1,v=!1,M=!1,G=!1,I=!1,F=0,N,P,Z={value:"",depth:0,isGlob:!1},g=()=>c>=n,he=()=>a.charCodeAt(c+1),re=()=>(N=P,a.charCodeAt(++c));while(c<n){P=re();let V;if(P===Wt){if(v=Z.backslashes=!0,P=re(),P===ds)A=!0;continue}if(A===!0||P===ds){F++;while(g()!==!0&&(P=re())){if(P===Wt){v=Z.backslashes=!0,re();continue}if(P===ds){F++;continue}if(A!==!0&&P===fs&&(P=re())===fs){if(f=Z.isBrace=!0,d=Z.isGlob=!0,I=!0,o===!0)continue;break}if(A!==!0&&P===U0){if(f=Z.isBrace=!0,d=Z.isGlob=!0,I=!0,o===!0)continue;break}if(P===V0){if(F--,F===0){A=!1,f=Z.isBrace=!0,I=!0;break}}}if(o===!0)continue;break}if(P===nl){if(s.push(c),i.push(Z),Z={value:"",depth:0,isGlob:!1},I===!0)continue;if(N===fs&&c===l+1){l+=2;continue}p=c+1;continue}if(r.noext!==!0){if((P===W0||P===H0||P===ps||P===Qc||P===hs)===!0&&he()===xn){if(d=Z.isGlob=!0,m=Z.isExtglob=!0,I=!0,P===hs&&c===l)G=!0;if(o===!0){let $e=0;while(g()!==!0&&(P=re())){if(P===Wt){v=Z.backslashes=!0,re();continue}if(P===xn){$e++;continue}if(P===el&&--$e===0){I=!0;break}}continue}break}}if(P===ps){if(N===ps)y=Z.isGlobstar=!0;if(d=Z.isGlob=!0,I=!0,o===!0)continue;break}if(P===Qc){if(d=Z.isGlob=!0,I=!0,o===!0)continue;break}if(P===G0){while(g()!==!0&&(V=re())){if(V===Wt){v=Z.backslashes=!0,re();continue}if(V===q0){h=Z.isBracket=!0,d=Z.isGlob=!0,I=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&P===hs&&c===l){M=Z.negated=!0,l++;continue}if(r.noparen!==!0&&P===xn){if(d=Z.isGlob=!0,o===!0){let ve=1;while(g()!==!0&&(P=re())){if(P===Wt){v=Z.backslashes=!0,re();continue}if(P===xn){ve++;continue}if(P===el&&--ve===0){I=!0;break}}continue}break}if(d===!0){if(I=!0,o===!0)continue;break}}if(r.noext===!0)m=!1,d=!1;let ee=a,b="",_="";if(l>0)b=a.slice(0,l),a=a.slice(l),p-=l;if(ee&&d===!0&&p>0)ee=a.slice(0,p),_=a.slice(p);else if(d===!0)ee="",_=a;else ee=a;if(ee&&ee!==""&&ee!=="/"&&ee!==a){if(tl(ee.charCodeAt(ee.length-1)))ee=ee.slice(0,-1)}if(r.unescape===!0){if(_)_=Xc.removeBackslashes(_);if(ee&&v===!0)ee=Xc.removeBackslashes(ee)}let Fe={prefix:b,input:e,start:l,base:ee,glob:_,isBrace:f,isBracket:h,isGlob:d,isExtglob:m,isGlobstar:y,negated:M,negatedExtglob:G};if(r.tokens===!0){if(Fe.maxDepth=0,!tl(P))i.push(Z);Fe.tokens=i}if(r.parts===!0||r.tokens===!0){let V;for(let ae=0;ae<s.length;ae++){let ut=V!==void 0?V+1:l,Dt=s[ae],rt=e.slice(ut,Dt);if(r.tokens){if(ae===0&&l!==0)i[ae].isPrefix=!0,i[ae].value=b;else i[ae].value=rt;rl(i[ae]),Fe.maxDepth+=i[ae].depth}if(Dt>=l)u.push(rt),V=Dt}let ve=V!==void 0?V+1:l,$e=e.slice(ve);if(u.push($e),r.tokens&&V&&V+1<e.length)i[i.length-1].value=$e,rl(i[i.length-1]),Fe.maxDepth+=i[i.length-1].depth;Fe.slashes=s,Fe.parts=u}return Fe};ol.exports=J0});var cl=j(function(IS,al){var xr=br(),Ne=yr(),{MAX_LENGTH:vn,POSIX_REGEX_SOURCE:K0,REGEX_NON_SPECIAL_CHARS:Y0,REGEX_SPECIAL_CHARS_BACKREF:X0,REPLACEMENTS:il}=xr,Q0=(e,t)=>{if(typeof t.expandRange==="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((o)=>Ne.escapeRegex(o)).join("..")}return r},Vt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,ul=(e)=>{let t=[],r=0,n=0,o=0,s="",i=!1;for(let u of e){if(i===!0){s+=u,i=!1;continue}if(u==="\\"){s+=u,i=!0;continue}if(u==='"'){o=o===1?0:1,s+=u;continue}if(o===0){if(u==="[")r++;else if(u==="]"&&r>0)r--;else if(r===0){if(u==="(")n++;else if(u===")"&&n>0)n--;else if(u==="|"&&n===0){t.push(s),s="";continue}}}s+=u}return t.push(s),t},ev=(e)=>{let t=!1;for(let r of e){if(t===!0){t=!1;continue}if(r==="\\"){t=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},gs=(e)=>{let t=e.trim(),r=!0;while(r===!0)if(r=!1,/^@\([^\\()[\]{}|]+\)$/.test(t))t=t.slice(2,-1),r=!0;if(!ev(t))return;return t.replace(/\\(.)/g,"$1")},tv=(e)=>{let t=e.map(gs).filter(Boolean);for(let r=0;r<t.length;r++)for(let n=r+1;n<t.length;n++){let o=t[r],s=t[n],i=o[0];if(!i||o!==i.repeat(o.length)||s!==i.repeat(s.length))continue;if(o===s||o.startsWith(s)||s.startsWith(o))return!0}return!1},ms=(e,t=!0)=>{if(e[0]!=="+"&&e[0]!=="*"||e[1]!=="(")return;let r=0,n=0,o=0,s=!1;for(let i=1;i<e.length;i++){let u=e[i];if(s===!0){s=!1;continue}if(u==="\\"){s=!0;continue}if(u==='"'){o=o===1?0:1;continue}if(o===1)continue;if(u==="["){r++;continue}if(u==="]"&&r>0){r--;continue}if(r>0)continue;if(u==="("){n++;continue}if(u===")"){if(n--,n===0){if(t===!0&&i!==e.length-1)return;return{type:e[0],body:e.slice(2,i),end:i}}}}},rv=(e)=>`${e.length===1?Ne.escapeRegex(e[0]):`[${e.map((r)=>Ne.escapeRegex(r)).join("")}]`}*`,nv=(e)=>{let t=0,r=[];while(t<e.length){let n=ms(e.slice(t),!1);if(!n||n.type!=="*")return;let o=ul(n.body).map((i)=>i.trim());if(o.length!==1)return;let s=gs(o[0]);if(!s||s.length!==1)return;r.push(s),t+=n.end+1}if(r.length<1)return;return r},ov=(e)=>{let t=0,r=e.trim(),n=ms(r);while(n)t++,r=n.body.trim(),n=ms(r);return t},sv=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==="number"?t.maxExtglobRecursion:xr.DEFAULT_MAX_EXTGLOB_RECURSION,n=ul(e).map((u)=>u.trim());if(n.length>1){if(n.some((u)=>u==="")||n.some((u)=>/^[*?]+$/.test(u))||tv(n))return{risky:!0}}let o=[],s=!1,i=!0;for(let u of n){let a=nv(u);if(a){s=!0,o.push(...a);continue}let c=gs(u);if(c&&c.length===1){o.push(c);continue}if(i=!1,ov(u)>r)return{risky:!0}}if(s)return i?{risky:!0,safeOutput:rv([...new Set(o)])}:{risky:!0};return{risky:!1}},Ds=(e,t)=>{if(typeof e!=="string")throw TypeError("Expected a string");e=il[e]||e;let r={...t},n=typeof r.maxLength==="number"?Math.min(vn,r.maxLength):vn,o=e.length;if(o>n)throw SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},i=[s],u=r.capture?"":"?:",a=xr.globChars(r.windows),c=xr.extglobChars(a),{DOT_LITERAL:l,PLUS_LITERAL:p,SLASH_LITERAL:f,ONE_CHAR:h,DOTS_SLASH:d,NO_DOT:m,NO_DOT_SLASH:y,NO_DOTS_SLASH:A,QMARK:v,QMARK_NO_DOT:M,STAR:G,START_ANCHOR:I}=a,F=(E)=>`(${u}(?:(?!${I}${E.dot?d:l}).)*?)`,N=r.dot?"":m,P=r.dot?v:M,Z=r.bash===!0?F(r):G;if(r.capture)Z=`(${Z})`;if(typeof r.noext==="boolean")r.noextglob=r.noext;let g={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};e=Ne.removePrefix(e,g),o=e.length;let he=[],re=[],ee=[],b=s,_,Fe=()=>g.index===o-1,V=g.peek=(E=1)=>e[g.index+E],ve=g.advance=()=>e[++g.index]||"",$e=()=>e.slice(g.index+1),ae=(E="",X=0)=>{g.consumed+=E,g.index+=X},ut=(E)=>{g.output+=E.output!=null?E.output:E.value,ae(E.value)},Dt=()=>{let E=1;while(V()==="!"&&(V(2)!=="("||V(3)==="?"))ve(),g.start++,E++;if(E%2===0)return!1;return g.negated=!0,g.start++,!0},rt=(E)=>{g[E]++,ee.push(E)},Je=(E)=>{g[E]--,ee.pop()},B=(E)=>{if(b.type==="globstar"){let X=g.braces>0&&(E.type==="comma"||E.type==="brace"),w=E.extglob===!0||he.length&&(E.type==="pipe"||E.type==="paren");if(E.type!=="slash"&&E.type!=="paren"&&!X&&!w)g.output=g.output.slice(0,-b.output.length),b.type="star",b.value="*",b.output=Z,g.output+=b.output}if(he.length&&E.type!=="paren")he[he.length-1].inner+=E.value;if(E.value||E.output)ut(E);if(b&&b.type==="text"&&E.type==="text"){b.output=(b.output||b.value)+E.value,b.value+=E.value;return}E.prev=b,i.push(E),b=E},Tt=(E,X)=>{let w={...c[X],conditions:1,inner:""};w.prev=b,w.parens=g.parens,w.output=g.output,w.startIndex=g.index,w.tokensIndex=i.length;let C=(r.capture?"(":"")+w.open;rt("parens"),B({type:E,value:X,output:g.output?"":h}),B({type:"paren",extglob:!0,value:ve(),output:C}),he.push(w)},io=(E)=>{let X=e.slice(E.startIndex,g.index+1),w=e.slice(E.startIndex+2,g.index),C=sv(w,r);if((E.type==="plus"||E.type==="star")&&C.risky){let z=C.safeOutput?(E.output?"":h)+(r.capture?`(${C.safeOutput})`:C.safeOutput):void 0,ne=i[E.tokensIndex];ne.type="text",ne.value=X,ne.output=z||Ne.escapeRegex(X);for(let De=E.tokensIndex+1;De<i.length;De++)i[De].value="",i[De].output="",delete i[De].suffix;g.output=E.output+ne.output,g.backtrack=!0,B({type:"paren",extglob:!0,value:_,output:""}),Je("parens");return}let x=E.close+(r.capture?")":""),S;if(E.type==="negate"){let z=Z;if(E.inner&&E.inner.length>1&&E.inner.includes("/"))z=F(r);if(z!==Z||Fe()||/^\)+$/.test($e()))x=E.close=`)$))${z}`;if(E.inner.includes("*")&&(S=$e())&&/^\.[^\\/.]+$/.test(S)){let ne=Ds(S,{...t,fastpaths:!1}).output;x=E.close=`)${ne})${z})`}if(E.prev.type==="bos")g.negatedExtglob=!0}B({type:"paren",extglob:!0,value:_,output:x}),Je("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let E=!1,X=e.replace(X0,(w,C,x,S,z,ne)=>{if(S==="\\")return E=!0,w;if(S==="?"){if(C)return C+S+(z?v.repeat(z.length):"");if(ne===0)return P+(z?v.repeat(z.length):"");return v.repeat(x.length)}if(S===".")return l.repeat(x.length);if(S==="*"){if(C)return C+S+(z?Z:"");return Z}return C?w:`\\${w}`});if(E===!0)if(r.unescape===!0)X=X.replace(/\\/g,"");else X=X.replace(/\\+/g,(w)=>w.length%2===0?"\\\\":w?"\\":"");if(X===e&&r.contains===!0)return g.output=e,g;return g.output=Ne.wrapOutput(X,g,t),g}while(!Fe()){if(_=ve(),_==="\x00")continue;if(_==="\\"){let w=V();if(w==="/"&&r.bash!==!0)continue;if(w==="."||w===";")continue;if(!w){_+="\\",B({type:"text",value:_});continue}let C=/^\\+/.exec($e()),x=0;if(C&&C[0].length>2){if(x=C[0].length,g.index+=x,x%2!==0)_+="\\"}if(r.unescape===!0)_=ve();else _+=ve();if(g.brackets===0){B({type:"text",value:_});continue}}if(g.brackets>0&&(_!=="]"||b.value==="["||b.value==="[^")){if(r.posix!==!1&&_===":"){let w=b.value.slice(1);if(w.includes("[")){if(b.posix=!0,w.includes(":")){let C=b.value.lastIndexOf("["),x=b.value.slice(0,C),S=b.value.slice(C+2),z=K0[S];if(z){if(b.value=x+z,g.backtrack=!0,ve(),!s.output&&i.indexOf(b)===1)s.output=h;continue}}}}if(_==="["&&V()!==":"||_==="-"&&V()==="]")_=`\\${_}`;if(_==="]"&&(b.value==="["||b.value==="[^"))_=`\\${_}`;if(r.posix===!0&&_==="!"&&b.value==="[")_="^";b.value+=_,ut({value:_});continue}if(g.quotes===1&&_!=='"'){_=Ne.escapeRegex(_),b.value+=_,ut({value:_});continue}if(_==='"'){if(g.quotes=g.quotes===1?0:1,r.keepQuotes===!0)B({type:"text",value:_});continue}if(_==="("){rt("parens"),B({type:"paren",value:_});continue}if(_===")"){if(g.parens===0&&r.strictBrackets===!0)throw SyntaxError(Vt("opening","("));let w=he[he.length-1];if(w&&g.parens===w.parens+1){io(he.pop());continue}B({type:"paren",value:_,output:g.parens?")":"\\)"}),Je("parens");continue}if(_==="["){if(r.nobracket===!0||!$e().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw SyntaxError(Vt("closing","]"));_=`\\${_}`}else rt("brackets");B({type:"bracket",value:_});continue}if(_==="]"){if(r.nobracket===!0||b&&b.type==="bracket"&&b.value.length===1){B({type:"text",value:_,output:`\\${_}`});continue}if(g.brackets===0){if(r.strictBrackets===!0)throw SyntaxError(Vt("opening","["));B({type:"text",value:_,output:`\\${_}`});continue}Je("brackets");let w=b.value.slice(1);if(b.posix!==!0&&w[0]==="^"&&!w.includes("/"))_=`/${_}`;if(b.value+=_,ut({value:_}),r.literalBrackets===!1||Ne.hasRegexChars(w))continue;let C=Ne.escapeRegex(b.value);if(g.output=g.output.slice(0,-b.value.length),r.literalBrackets===!0){g.output+=C,b.value=C;continue}b.value=`(${u}${C}|${b.value})`,g.output+=b.value;continue}if(_==="{"&&r.nobrace!==!0){rt("braces");let w={type:"brace",value:_,output:"(",outputIndex:g.output.length,tokensIndex:g.tokens.length};re.push(w),B(w);continue}if(_==="}"){let w=re[re.length-1];if(r.nobrace===!0||!w){B({type:"text",value:_,output:_});continue}let C=")";if(w.dots===!0){let x=i.slice(),S=[];for(let z=x.length-1;z>=0;z--){if(i.pop(),x[z].type==="brace")break;if(x[z].type!=="dots")S.unshift(x[z].value)}C=Q0(S,r),g.backtrack=!0}if(w.comma!==!0&&w.dots!==!0){let x=g.output.slice(0,w.outputIndex),S=g.tokens.slice(w.tokensIndex);w.value=w.output="\\{",_=C="\\}",g.output=x;for(let z of S)g.output+=z.output||z.value}B({type:"brace",value:_,output:C}),Je("braces"),re.pop();continue}if(_==="|"){if(he.length>0)he[he.length-1].conditions++;B({type:"text",value:_});continue}if(_===","){let w=_,C=re[re.length-1];if(C&&ee[ee.length-1]==="braces")C.comma=!0,w="|";B({type:"comma",value:_,output:w});continue}if(_==="/"){if(b.type==="dot"&&g.index===g.start+1){g.start=g.index+1,g.consumed="",g.output="",i.pop(),b=s;continue}B({type:"slash",value:_,output:f});continue}if(_==="."){if(g.braces>0&&b.type==="dot"){if(b.value===".")b.output=l;let w=re[re.length-1];b.type="dots",b.output+=_,b.value+=_,w.dots=!0;continue}if(g.braces+g.parens===0&&b.type!=="bos"&&b.type!=="slash"){B({type:"text",value:_,output:l});continue}B({type:"dot",value:_,output:l});continue}if(_==="?"){if(!(b&&b.value==="(")&&r.noextglob!==!0&&V()==="("&&V(2)!=="?"){Tt("qmark",_);continue}if(b&&b.type==="paren"){let C=V(),x=_;if(b.value==="("&&!/[!=<:]/.test(C)||C==="<"&&!/<([!=]|\w+>)/.test($e()))x=`\\${_}`;B({type:"text",value:_,output:x});continue}if(r.dot!==!0&&(b.type==="slash"||b.type==="bos")){B({type:"qmark",value:_,output:M});continue}B({type:"qmark",value:_,output:v});continue}if(_==="!"){if(r.noextglob!==!0&&V()==="("){if(V(2)!=="?"||!/[!=<:]/.test(V(3))){Tt("negate",_);continue}}if(r.nonegate!==!0&&g.index===0){Dt();continue}}if(_==="+"){if(r.noextglob!==!0&&V()==="("&&V(2)!=="?"){Tt("plus",_);continue}if(b&&b.value==="("||r.regex===!1){B({type:"plus",value:_,output:p});continue}if(b&&(b.type==="bracket"||b.type==="paren"||b.type==="brace")||g.parens>0){B({type:"plus",value:_});continue}B({type:"plus",value:p});continue}if(_==="@"){if(r.noextglob!==!0&&V()==="("&&V(2)!=="?"){B({type:"at",extglob:!0,value:_,output:""});continue}B({type:"text",value:_});continue}if(_!=="*"){if(_==="$"||_==="^")_=`\\${_}`;let w=Y0.exec($e());if(w)_+=w[0],g.index+=w[0].length;B({type:"text",value:_});continue}if(b&&(b.type==="globstar"||b.star===!0)){b.type="star",b.star=!0,b.value+=_,b.output=Z,g.backtrack=!0,g.globstar=!0,ae(_);continue}let E=$e();if(r.noextglob!==!0&&/^\([^?]/.test(E)){Tt("star",_);continue}if(b.type==="star"){if(r.noglobstar===!0){ae(_);continue}let w=b.prev,C=w.prev,x=w.type==="slash"||w.type==="bos",S=C&&(C.type==="star"||C.type==="globstar");if(r.bash===!0&&(!x||E[0]&&E[0]!=="/")){B({type:"star",value:_,output:""});continue}let z=g.braces>0&&(w.type==="comma"||w.type==="brace"),ne=he.length&&(w.type==="pipe"||w.type==="paren");if(!x&&w.type!=="paren"&&!z&&!ne){B({type:"star",value:_,output:""});continue}while(E.slice(0,3)==="/**"){let Ke=e[g.index+4];if(Ke&&Ke!=="/")break;E=E.slice(3),ae("/**",3)}let De=Fe()||g.parens>0&&E===")".repeat(g.parens)&&!he.some((Ke)=>Ke.type==="negate");if(w.type==="bos"&&Fe()){b.type="globstar",b.value+=_,b.output=F(r),g.output=b.output,g.globstar=!0,ae(_);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&!S&&De){g.output=g.output.slice(0,-(w.output+b.output).length),w.output=`(?:${w.output}`,b.type="globstar",b.output=F(r)+(r.strictSlashes?")":"|$)"),b.value+=_,g.globstar=!0,g.output+=w.output+b.output,ae(_);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&E[0]==="/"){let Ke=E[1]!==void 0?"|$":"";g.output=g.output.slice(0,-(w.output+b.output).length),w.output=`(?:${w.output}`,b.type="globstar",b.output=`${F(r)}${f}|${f}${Ke})`,b.value+=_,g.output+=w.output+b.output,g.globstar=!0,ae(_+ve()),B({type:"slash",value:"/",output:""});continue}if(w.type==="bos"&&E[0]==="/"){b.type="globstar",b.value+=_,b.output=`(?:^|${f}|${F(r)}${f})`,g.output=b.output,g.globstar=!0,ae(_+ve()),B({type:"slash",value:"/",output:""});continue}g.output=g.output.slice(0,-b.output.length),b.type="globstar",b.output=F(r),b.value+=_,g.output+=b.output,g.globstar=!0,ae(_);continue}let X={type:"star",value:_,output:Z};if(r.bash===!0){if(X.output=".*?",b.type==="bos"||b.type==="slash")X.output=N+X.output;B(X);continue}if(b&&(b.type==="bracket"||b.type==="paren")&&r.regex===!0){X.output=_,B(X);continue}if(g.index===g.start||b.type==="slash"||b.type==="dot"){if(b.type==="dot")g.output+=y,b.output+=y;else if(r.dot===!0)g.output+=A,b.output+=A;else g.output+=N,b.output+=N;if(V()!=="*")g.output+=h,b.output+=h}B(X)}while(g.brackets>0){if(r.strictBrackets===!0)throw SyntaxError(Vt("closing","]"));g.output=Ne.escapeLast(g.output,"["),Je("brackets")}while(g.parens>0){if(r.strictBrackets===!0)throw SyntaxError(Vt("closing",")"));g.output=Ne.escapeLast(g.output,"("),Je("parens")}while(g.braces>0){if(r.strictBrackets===!0)throw SyntaxError(Vt("closing","}"));g.output=Ne.escapeLast(g.output,"{"),Je("braces")}if(r.strictSlashes!==!0&&(b.type==="star"||b.type==="bracket"))B({type:"maybe_slash",value:"",output:`${f}?`});if(g.backtrack===!0){g.output="";for(let E of g.tokens)if(g.output+=E.output!=null?E.output:E.value,E.suffix)g.output+=E.suffix}return g};Ds.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength==="number"?Math.min(vn,r.maxLength):vn,o=e.length;if(o>n)throw SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=il[e]||e;let{DOT_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:u,DOTS_SLASH:a,NO_DOT:c,NO_DOTS:l,NO_DOTS_SLASH:p,STAR:f,START_ANCHOR:h}=xr.globChars(r.windows),d=r.dot?l:c,m=r.dot?p:c,y=r.capture?"":"?:",A={negated:!1,prefix:""},v=r.bash===!0?".*?":f;if(r.capture)v=`(${v})`;let M=(N)=>{if(N.noglobstar===!0)return v;return`(${y}(?:(?!${h}${N.dot?a:s}).)*?)`},G=(N)=>{switch(N){case"*":return`${d}${u}${v}`;case".*":return`${s}${u}${v}`;case"*.*":return`${d}${v}${s}${u}${v}`;case"*/*":return`${d}${v}${i}${u}${m}${v}`;case"**":return d+M(r);case"**/*":return`(?:${d}${M(r)}${i})?${m}${u}${v}`;case"**/*.*":return`(?:${d}${M(r)}${i})?${m}${v}${s}${u}${v}`;case"**/.*":return`(?:${d}${M(r)}${i})?${s}${u}${v}`;default:{let P=/^(.*?)\.(\w+)$/.exec(N);if(!P)return;let Z=G(P[1]);if(!Z)return;return Z+s+P[2]}}},I=Ne.removePrefix(e,A),F=G(I);if(F&&r.strictSlashes!==!0)F+=`${i}?`;return F};al.exports=Ds});var fl=j(function(NS,pl){var iv=sl(),_s=cl(),ll=yr(),uv=br(),av=(e)=>e&&typeof e==="object"&&!Array.isArray(e),pe=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map((f)=>pe(f,t,r));return(f)=>{for(let h of l){let d=h(f);if(d)return d}return!1}}let n=av(e)&&e.tokens&&e.input;if(e===""||typeof e!=="string"&&!n)throw TypeError("Expected pattern to be a non-empty string");let o=t||{},s=o.windows,i=n?pe.compileRe(e,t):pe.makeRe(e,t,!1,!0),u=i.state;delete i.state;let a=()=>!1;if(o.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};a=pe(o.ignore,l,r)}let c=(l,p=!1)=>{let{isMatch:f,match:h,output:d}=pe.test(l,i,t,{glob:e,posix:s}),m={glob:e,state:u,regex:i,posix:s,input:l,output:d,match:h,isMatch:f};if(typeof o.onResult==="function")o.onResult(m);if(f===!1)return m.isMatch=!1,p?m:!1;if(a(l)){if(typeof o.onIgnore==="function")o.onIgnore(m);return m.isMatch=!1,p?m:!1}if(typeof o.onMatch==="function")o.onMatch(m);return p?m:!0};if(r)c.state=u;return c};pe.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!=="string")throw TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let s=r||{},i=s.format||(o?ll.toPosixSlashes:null),u=e===n,a=u&&i?i(e):e;if(u===!1)a=i?i(e):e,u=a===n;if(u===!1||s.capture===!0)if(s.matchBase===!0||s.basename===!0)u=pe.matchBase(e,t,r,o);else u=t.exec(a);return{isMatch:Boolean(u),match:u,output:a}};pe.matchBase=(e,t,r,n=r&&r.windows)=>(t instanceof RegExp?t:pe.makeRe(t,r)).test(ll.basename(e,{windows:n}));pe.isMatch=(e,t,r)=>pe(t,r)(e);pe.parse=(e,t)=>{if(Array.isArray(e))return e.map((r)=>pe.parse(r,t));return _s(e,{...t,fastpaths:!1})};pe.scan=(e,t)=>iv(e,t);pe.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},s=o.contains?"":"^",i=o.contains?"":"$",u=`${s}(?:${e.output})${i}`;if(e&&e.negated===!0)u=`^(?!${u}).*$`;let a=pe.toRegex(u,t);if(n===!0)a.state=e;return a};pe.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!=="string")throw TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};if(t.fastpaths!==!1&&(e[0]==="."||e[0]==="*"))o.output=_s.fastpaths(e,t);if(!o.output)o=_s(e,t);return pe.compileRe(o,t,r,n)};pe.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};pe.constants=uv;pl.exports=pe});var gl=j(function(LS,ml){var hl=fl(),cv=yr();function dl(e,t,r=!1){if(t&&(t.windows===null||t.windows===void 0))t={...t,windows:cv.isWindows()};return hl(e,t,r)}Object.assign(dl,hl);ml.exports=dl});var Id=j(function(EF,mi){var Jn=process||{},zd=Jn.argv||[],qn=Jn.env||{},PC=!(!!qn.NO_COLOR||zd.includes("--no-color"))&&(!!qn.FORCE_COLOR||zd.includes("--color")||Jn.platform==="win32"||(Jn.stdout||{}).isTTY&&qn.TERM!=="dumb"||!!qn.CI),zC=(e,t,r=e)=>(n)=>{let o=""+n,s=o.indexOf(t,e.length);return~s?e+RC(o,t,r,s)+t:e+o+t},RC=(e,t,r,n)=>{let o="",s=0;do o+=e.substring(s,n)+r,s=n+t.length,n=e.indexOf(t,s);while(~n);return o+e.substring(s)},Rd=(e=PC)=>{let t=e?zC:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};mi.exports=Rd();mi.exports.createColors=Rd});var Wd=j(function(zF,Gd){var Md=1/0,Hd=9007199254740991,BC=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,jd=NaN,MC="[object Function]",jC="[object GeneratorFunction]",HC="[object Symbol]",UC=/^\s+|\s+$/g,GC=/^[-+]0x[0-9a-f]+$/i,WC=/^0b[01]+$/i,VC=/^0o[0-7]+$/i,qC=/^(?:0|[1-9]\d*)$/,JC=parseInt,KC=Object.prototype,Ud=KC.toString,{ceil:YC,max:XC}=Math;function QC(e,t,r){var n=-1,o=e.length;if(t<0)t=-t>o?0:o+t;if(r=r>o?o:r,r<0)r+=o;o=t>r?0:r-t>>>0,t>>>=0;var s=Array(o);while(++n<o)s[n]=e[n+t];return s}function eE(e,t){return t=t==null?Hd:t,!!t&&(typeof e=="number"||qC.test(e))&&(e>-1&&e%1==0&&e<t)}function tE(e,t,r){if(!Kn(r))return!1;var n=typeof t;if(n=="number"?oE(r)&&eE(t,r.length):n=="string"&&(t in r))return nE(r[t],e);return!1}function rE(e,t,r){if(r?tE(e,t,r):t===void 0)t=1;else t=XC(lE(t),0);var n=e?e.length:0;if(!n||t<1)return[];var o=0,s=0,i=Array(YC(n/t));while(o<n)i[s++]=QC(e,o,o+=t);return i}function nE(e,t){return e===t||e!==e&&t!==t}function oE(e){return e!=null&&iE(e.length)&&!sE(e)}function sE(e){var t=Kn(e)?Ud.call(e):"";return t==MC||t==jC}function iE(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Hd}function Kn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function uE(e){return!!e&&typeof e=="object"}function aE(e){return typeof e=="symbol"||uE(e)&&Ud.call(e)==HC}function cE(e){if(!e)return e===0?e:0;if(e=pE(e),e===Md||e===-Md){var t=e<0?-1:1;return t*BC}return e===e?e:0}function lE(e){var t=cE(e),r=t%1;return t===t?r?t-r:t:0}function pE(e){if(typeof e=="number")return e;if(aE(e))return jd;if(Kn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Kn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(UC,"");var r=WC.test(e);return r||VC.test(e)?JC(e.slice(2),r?2:8):GC.test(e)?jd:+e}Gd.exports=rE});var Qn=j(function(u1,rm){var xi=[],tm=0,Ee=(e,t)=>{if(tm>=t)xi.push(e)};Ee.WARN=1;Ee.INFO=2;Ee.DEBUG=3;Ee.reset=()=>{xi=[]};Ee.setDebugLevel=(e)=>{tm=e};Ee.warn=(e)=>Ee(e,Ee.WARN);Ee.info=(e)=>Ee(e,Ee.INFO);Ee.debug=(e)=>Ee(e,Ee.DEBUG);Ee.debugMessages=()=>xi;rm.exports=Ee});var om=j(function(a1,nm){nm.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var im=j(function(c1,sm){var vE=om();sm.exports=(e)=>typeof e==="string"?e.replace(vE(),""):e});var am=j(function(l1,vi){var um=(e)=>{if(Number.isNaN(e))return!1;if(e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141))return!0;return!1};vi.exports=um;vi.exports.default=um});var lm=j(function(p1,cm){cm.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var fm=j(function(f1,wi){var wE=im(),CE=am(),EE=lm(),pm=(e)=>{if(typeof e!=="string"||e.length===0)return 0;if(e=wE(e),e.length===0)return 0;e=e.replace(EE()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);if(n<=31||n>=127&&n<=159)continue;if(n>=768&&n<=879)continue;if(n>65535)r++;t+=CE(n)?2:1}return t};wi.exports=pm;wi.exports.default=pm});var Ci=j(function(h1,gm){var hm=fm();function eo(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function tt(e){let t=eo();return(""+e).replace(t,"").split(`
8
- `).reduce(function(o,s){return hm(s)>o?hm(s):o},0)}function Br(e,t){return Array(t+1).join(e)}function $E(e,t,r,n){let o=tt(e);if(t+1>=o){let s=t-o;switch(n){case"right":{e=Br(r,s)+e;break}case"center":{let i=Math.ceil(s/2),u=s-i;e=Br(r,u)+e+Br(r,i);break}default:{e=e+Br(r,s);break}}}return e}var er={};function Mr(e,t,r){t="\x1B["+t+"m",r="\x1B["+r+"m",er[t]={set:e,to:!0},er[r]={set:e,to:!1},er[e]={on:t,off:r}}Mr("bold",1,22);Mr("italics",3,23);Mr("underline",4,24);Mr("inverse",7,27);Mr("strikethrough",9,29);function dm(e,t){let r=t[1]?parseInt(t[1].split(";")[0]):0;if(r>=30&&r<=39||r>=90&&r<=97){e.lastForegroundAdded=t[0];return}if(r>=40&&r<=49||r>=100&&r<=107){e.lastBackgroundAdded=t[0];return}if(r===0){for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))delete e[o];return}let n=er[t[0]];if(n)e[n.set]=n.to}function kE(e){let t=eo(!0),r=t.exec(e),n={};while(r!==null)dm(n,r),r=t.exec(e);return n}function mm(e,t){let{lastBackgroundAdded:r,lastForegroundAdded:n}=e;if(delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(o){if(e[o])t+=er[o].off}),r&&r!="\x1B[49m")t+="\x1B[49m";if(n&&n!="\x1B[39m")t+="\x1B[39m";return t}function SE(e,t){let{lastBackgroundAdded:r,lastForegroundAdded:n}=e;if(delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(o){if(e[o])t=er[o].on+t}),r&&r!="\x1B[49m")t=r+t;if(n&&n!="\x1B[39m")t=n+t;return t}function OE(e,t){if(e.length===tt(e))return e.substr(0,t);while(tt(e)>t)e=e.slice(0,-1);return e}function AE(e,t){let r=eo(!0),n=e.split(eo()),o=0,s=0,i="",u,a={};while(s<t){u=r.exec(e);let c=n[o];if(o++,s+tt(c)>t)c=OE(c,t-s);if(i+=c,s+=tt(c),s<t){if(!u)break;i+=u[0],dm(a,u)}}return mm(a,i)}function FE(e,t,r){if(r=r||"\u2026",tt(e)<=t)return e;t-=tt(r);let o=AE(e,t);o+=r;let s="\x1B]8;;\x07";if(e.includes(s)&&!o.includes(s))o+=s;return o}function TE(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function PE(e,t){e=e||{},t=t||TE();let r=Object.assign({},t,e);return r.chars=Object.assign({},t.chars,e.chars),r.style=Object.assign({},t.style,e.style),r}function zE(e,t){let r=[],n=t.split(/(\s+)/g),o=[],s=0,i;for(let u=0;u<n.length;u+=2){let a=n[u],c=s+tt(a);if(s>0&&i)c+=i.length;if(c>e){if(s!==0)r.push(o.join(""));o=[a],s=tt(a)}else o.push(i||"",a),s=c;i=n[u+1]}if(s)r.push(o.join(""));return r}function RE(e,t){let r=[],n="";function o(i,u){if(n.length&&u)n+=u;n+=i;while(n.length>e)r.push(n.slice(0,e)),n=n.slice(e)}let s=t.split(/(\s+)/g);for(let i=0;i<s.length;i+=2)o(s[i],i&&s[i-1]);if(n.length)r.push(n);return r}function IE(e,t,r=!0){let n=[];t=t.split(`
9
- `);let o=r?zE:RE;for(let s=0;s<t.length;s++)n.push.apply(n,o(e,t[s]));return n}function NE(e){let t={},r=[];for(let n=0;n<e.length;n++){let o=SE(t,e[n]);t=kE(o);let s=Object.assign({},t);r.push(mm(s,o))}return r}function LE(e,t){return["\x1B]","8",";",";",e||t,"\x07",t,"\x1B]","8",";",";","\x07"].join("")}gm.exports={strlen:tt,repeat:Br,pad:$E,truncate:FE,mergeOptions:PE,wordWrap:IE,colorizeLines:NE,hyperlink:LE}});var ym=j(function(d1,bm){var _m={};bm.exports=_m;var Dm={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(Dm).forEach(function(e){var t=Dm[e],r=_m[e]=[];r.open="\x1B["+t[0]+"m",r.close="\x1B["+t[1]+"m"})});var vm=j(function(m1,xm){xm.exports=function(e,t){t=t||process.argv;var r=t.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",o=t.indexOf(n+e);return o!==-1&&(r===-1?!0:o<r)}});var Cm=j(function(g1,wm){var ZE=Pt("os"),qe=vm(),Ae=process.env,tr=void 0;if(qe("no-color")||qe("no-colors")||qe("color=false"))tr=!1;else if(qe("color")||qe("colors")||qe("color=true")||qe("color=always"))tr=!0;if("FORCE_COLOR"in Ae)tr=Ae.FORCE_COLOR.length===0||parseInt(Ae.FORCE_COLOR,10)!==0;function BE(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ME(e){if(tr===!1)return 0;if(qe("color=16m")||qe("color=full")||qe("color=truecolor"))return 3;if(qe("color=256"))return 2;if(e&&!e.isTTY&&tr!==!0)return 0;var t=tr?1:0;if(process.platform==="win32"){var r=ZE.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586)return Number(r[2])>=14931?3:2;return 1}if("CI"in Ae){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(o){return o in Ae})||Ae.CI_NAME==="codeship")return 1;return t}if("TEAMCITY_VERSION"in Ae)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ae.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ae){var n=parseInt((Ae.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ae.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Ae.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ae.TERM))return 1;if("COLORTERM"in Ae)return 1;if(Ae.TERM==="dumb")return t;return t}function Ei(e){var t=ME(e);return BE(t)}wm.exports={supportsColor:Ei,stdout:Ei(process.stdout),stderr:Ei(process.stderr)}});var $m=j(function(D1,Em){Em.exports=function(t,r){var n="";t=t||"Run the trap, drop the bass",t=t.split("");var o={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return t.forEach(function(s){s=s.toLowerCase();var i=o[s]||[" "],u=Math.floor(Math.random()*i.length);if(typeof o[s]<"u")n+=o[s][u];else n+=s}),n}});var Sm=j(function(_1,km){km.exports=function(t,r){t=t||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},o=[].concat(n.up,n.down,n.mid);function s(a){var c=Math.floor(Math.random()*a);return c}function i(a){var c=!1;return o.filter(function(l){c=l===a}),c}function u(a,c){var l="",p,f;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",a=a.split("");for(f in a){if(i(f))continue;switch(l=l+a[f],p={up:0,down:0,mid:0},c.size){case"mini":p.up=s(8),p.mid=s(2),p.down=s(8);break;case"maxi":p.up=s(16)+3,p.mid=s(4)+1,p.down=s(64)+3;break;default:p.up=s(8)+1,p.mid=s(6)/2,p.down=s(8)+1;break}var h=["up","mid","down"];for(var d in h){var m=h[d];for(var y=0;y<=p[m];y++)if(c[m])l=l+n[m][s(n[m].length)]}}return l}return u(t,r)}});var Am=j(function(b1,Om){Om.exports=function(e){return function(t,r,n){if(t===" ")return t;switch(r%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}});var Tm=j(function(y1,Fm){Fm.exports=function(e){return function(t,r,n){return r%2===0?t:e.inverse(t)}}});var zm=j(function(x1,Pm){Pm.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(r,n,o){if(r===" ")return r;else return e[t[n++%t.length]](r)}}});var Im=j(function(v1,Rm){Rm.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,o){return r===" "?r:e[t[Math.round(Math.random()*(t.length-2))]](r)}}});var Mm=j(function(C1,Bm){var H={};Bm.exports=H;H.themes={};var jE=Pt("util"),Ft=H.styles=ym(),Nm=Object.defineProperties,HE=new RegExp(/[\r\n]+/g);H.supportsColor=Cm().supportsColor;if(typeof H.enabled>"u")H.enabled=H.supportsColor()!==!1;H.enable=function(){H.enabled=!0};H.disable=function(){H.enabled=!1};H.stripColors=H.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var w1=H.stylize=function(t,r){if(!H.enabled)return t+"";var n=Ft[r];if(!n&&r in H)return H[r](t);return n.open+t+n.close},UE=/[|\\{}()[\]^$+*?.]/g,GE=function(e){if(typeof e!=="string")throw TypeError("Expected a string");return e.replace(UE,"\\$&")};function Lm(e){var t=function r(){return VE.apply(r,arguments)};return t._styles=e,t.__proto__=WE,t}var Zm=function(){var e={};return Ft.grey=Ft.gray,Object.keys(Ft).forEach(function(t){Ft[t].closeRe=new RegExp(GE(Ft[t].close),"g"),e[t]={get:function(){return Lm(this._styles.concat(t))}}}),e}(),WE=Nm(function(){},Zm);function VE(){var e=Array.prototype.slice.call(arguments),t=e.map(function(i){if(i!=null&&i.constructor===String)return i;else return jE.inspect(i)}).join(" ");if(!H.enabled||!t)return t;var r=t.indexOf(`
10
- `)!=-1,n=this._styles,o=n.length;while(o--){var s=Ft[n[o]];if(t=s.open+t.replace(s.closeRe,s.open)+s.close,r)t=t.replace(HE,function(i){return s.close+i+s.open})}return t}H.setTheme=function(e){if(typeof e==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(r){H[r]=function(n){if(typeof e[r]==="object"){var o=n;for(var s in e[r])o=H[e[r][s]](o);return o}return H[e[r]](n)}})(t)};function qE(){var e={};return Object.keys(Zm).forEach(function(t){e[t]={get:function(){return Lm([t])}}}),e}var JE=function(t,r){var n=r.split("");return n=n.map(t),n.join("")};H.trap=$m();H.zalgo=Sm();H.maps={};H.maps.america=Am()(H);H.maps.zebra=Tm()(H);H.maps.rainbow=zm()(H);H.maps.random=Im()(H);for($i in H.maps)(function(e){H[e]=function(t){return JE(H.maps[e],t)}})($i);var $i;Nm(H,qE())});var Hm=j(function(E1,jm){var KE=Mm();jm.exports=KE});var Vm=j(function($1,no){var{info:YE,debug:Wm}=Qn(),Me=Ci();class jr{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){if(["boolean","number","bigint","string"].indexOf(typeof e)!==-1)e={content:""+e};e=e||{},this.options=e;let t=e.content;if(["boolean","number","bigint","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw Error("Content needs to be a primitive, got: "+typeof t);if(this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let r=this.options.chars||{},n=e.chars,o=this.chars={};QE.forEach(function(u){ki(r,n,u,o)}),this.truncate=this.options.truncate||e.truncate;let s=this.options.style=this.options.style||{},i=e.style;ki(s,i,"padding-left",this),ki(s,i,"padding-right",this),this.head=s.head||i.head,this.border=s.border||i.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=Me.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:r=t}=this.options;if(this.fixedWidth&&r){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let s=1;while(s<this.colSpan)this.fixedWidth+=e.colWidths[this.x+s],s++}let{wrapOnWordBoundary:n=!0}=e,{wrapOnWordBoundary:o=n}=this.options;return this.wrapLines(Me.wordWrap(this.fixedWidth,this.content,o))}return this.wrapLines(this.content.split(`
11
- `))}wrapLines(e){let t=Me.colorizeLines(e);if(this.href)return t.map((r)=>Me.hyperlink(this.href,r));return t}init(e){let t=this.x,r=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(r,r+this.rowSpan),this.width=this.widths.reduce(Gm,-1),this.height=this.heights.reduce(Gm,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[r],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let r=Me.truncate(this.content,10,this.truncate);if(!e)YE(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${r}`);let n=Math.max(this.height-this.lines.length,0),o;switch(this.vAlign){case"center":o=Math.ceil(n/2);break;case"bottom":o=n;break;default:o=0}if(e<o||e>=o+this.lines.length)return this.drawEmpty(this.drawRight,t);let s=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-o,this.drawRight,s,t)}drawTop(e){let t=[];if(this.cells)this.widths.forEach(function(r,n){t.push(this._topLeftChar(n)),t.push(Me.repeat(this.chars[this.y==0?"top":"mid"],r))},this);else t.push(this._topLeftChar(0)),t.push(Me.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(e)t.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,r;if(this.y==0)r=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)r="leftMid";else if(r=e==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][t]instanceof jr.ColSpanCell)r=e==0?"topMid":"mid";if(e==0){let o=1;while(this.cells[this.y][t-o]instanceof jr.ColSpanCell)o++;if(this.cells[this.y][t-o]instanceof jr.RowSpanCell)r="leftMid"}}return this.chars[r]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let r=Hm();for(let n=this[e].length-1;n>=0;n--)r=r[this[e][n]];return r(t)}catch(r){return t}else return t}drawLine(e,t,r,n){let o=this.chars[this.x==0?"left":"middle"];if(this.x&&n&&this.cells){let p=this.cells[this.y+n][this.x-1];while(p instanceof to)p=this.cells[p.y][p.x-1];if(!(p instanceof ro))o=this.chars.rightMid}let s=Me.repeat(" ",this.paddingLeft),i=t?this.chars.right:"",u=Me.repeat(" ",this.paddingRight),a=this.lines[e],c=this.width-(this.paddingLeft+this.paddingRight);if(r)a+=this.truncate||"\u2026";let l=Me.truncate(a,c,this.truncate);return l=Me.pad(l,c," ",this.hAlign),l=s+l+u,this.stylizeLine(o,l,i)}stylizeLine(e,t,r){if(e=this.wrapWithStyleColors("border",e),r=this.wrapWithStyleColors("border",r),this.y===0)t=this.wrapWithStyleColors("head",t);return e+t+r}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],r=Me.repeat(this.chars.bottom,this.width),n=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+r+n)}drawEmpty(e,t){let r=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let s=this.cells[this.y+t][this.x-1];while(s instanceof to)s=this.cells[s.y][s.x-1];if(!(s instanceof ro))r=this.chars.rightMid}let n=e?this.chars.right:"",o=Me.repeat(" ",this.width);return this.stylizeLine(r,o,n)}}class to{constructor(){}draw(e){if(typeof e==="number")Wm(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class ro{constructor(e){this.originalCell=e}init(e){let t=this.y,r=this.originalCell.y;this.cellOffset=t-r,this.offset=XE(e.rowHeights,r,this.cellOffset)}draw(e){if(e=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(e=="bottom")return this.originalCell.draw("bottom");return Wm(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e)}mergeTableOptions(){}}function Um(...e){return e.filter((t)=>t!==void 0&&t!==null).shift()}function ki(e,t,r,n){let o=r.split("-");if(o.length>1)o[1]=o[1].charAt(0).toUpperCase()+o[1].substr(1),o=o.join(""),n[o]=Um(e[o],e[r],t[o],t[r]);else n[r]=Um(e[r],t[r])}function XE(e,t,r){let n=e[t];for(let o=1;o<r;o++)n+=1+e[t+o];return n}function Gm(e,t){return e+t+1}var QE=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];no.exports=jr;no.exports.ColSpanCell=to;no.exports.RowSpanCell=ro});var Km=j(function(k1,Jm){var{warn:e$,debug:t$}=Qn(),Si=Vm(),{ColSpanCell:r$,RowSpanCell:n$}=Si;(function(){function e(h,d){if(h[d]>0)return e(h,d+1);return d}function t(h){let d={};h.forEach(function(m,y){let A=0;m.forEach(function(v){v.y=y,v.x=y?e(d,A):A;let M=v.rowSpan||1,G=v.colSpan||1;if(M>1)for(let I=0;I<G;I++)d[v.x+I]=M;A=v.x+G}),Object.keys(d).forEach((v)=>{if(d[v]--,d[v]<1)delete d[v]})})}function r(h){let d=0;return h.forEach(function(m){m.forEach(function(y){d=Math.max(d,y.x+(y.colSpan||1))})}),d}function n(h){return h.length}function o(h,d){let m=h.y,y=h.y-1+(h.rowSpan||1),A=d.y,v=d.y-1+(d.rowSpan||1),M=!(m>v||A>y),G=h.x,I=h.x-1+(h.colSpan||1),F=d.x,N=d.x-1+(d.colSpan||1),P=!(G>N||F>I);return M&&P}function s(h,d,m){let y=Math.min(h.length-1,m),A={x:d,y:m};for(let v=0;v<=y;v++){let M=h[v];for(let G=0;G<M.length;G++)if(o(A,M[G]))return!0}return!1}function i(h,d,m,y){for(let A=m;A<y;A++)if(s(h,A,d))return!1;return!0}function u(h){h.forEach(function(d,m){d.forEach(function(y){for(let A=1;A<y.rowSpan;A++){let v=new n$(y);v.x=y.x,v.y=y.y+A,v.colSpan=y.colSpan,c(v,h[m+A])}})})}function a(h){for(let d=h.length-1;d>=0;d--){let m=h[d];for(let y=0;y<m.length;y++){let A=m[y];for(let v=1;v<A.colSpan;v++){let M=new r$;M.x=A.x+v,M.y=A.y,m.splice(y+1,0,M)}}}}function c(h,d){let m=0;while(m<d.length&&d[m].x<h.x)m++;d.splice(m,0,h)}function l(h){let d=n(h),m=r(h);t$(`Max rows: ${d}; Max cols: ${m}`);for(let y=0;y<d;y++)for(let A=0;A<m;A++)if(!s(h,A,y)){let v={x:A,y,colSpan:1,rowSpan:1};A++;while(A<m&&!s(h,A,y))v.colSpan++,A++;let M=y+1;while(M<d&&i(h,M,v.x,v.x+v.colSpan))v.rowSpan++,M++;let G=new Si(v);G.x=v.x,G.y=v.y,e$(`Missing cell at ${G.y}-${G.x}.`),c(G,h[y])}}function p(h){return h.map(function(d){if(!Array.isArray(d)){let m=Object.keys(d)[0];if(d=d[m],Array.isArray(d))d=d.slice(),d.unshift(m);else d=[m,d]}return d.map(function(m){return new Si(m)})})}function f(h){let d=p(h);return t(d),l(d),u(d),a(d),d}Jm.exports={makeTableLayout:f,layoutTable:t,addRowSpanCells:u,maxWidth:r,fillInTable:l,computeWidths:qm("colSpan","desiredWidth","x",1),computeHeights:qm("rowSpan","desiredHeight","y",1)}})();function qm(e,t,r,n){return function(o,s){let i=[],u=[],a={};s.forEach(function(c){c.forEach(function(l){if((l[e]||1)>1)u.push(l);else i[l[r]]=Math.max(i[l[r]]||0,l[t]||0,n)})}),o.forEach(function(c,l){if(typeof c==="number")i[l]=c});for(let c=u.length-1;c>=0;c--){let l=u[c],p=l[e],f=l[r],h=i[f],d=typeof o[f]==="number"?0:1;if(typeof h==="number"){for(let m=1;m<p;m++)if(h+=1+i[f+m],typeof o[f+m]!=="number")d++}else if(h=t==="desiredWidth"?l.desiredWidth-1:1,!a[f]||a[f]<h)a[f]=h;if(l[t]>h){let m=0;while(d>0&&l[t]>h){if(typeof o[f+m]!=="number"){let y=Math.round((l[t]-h)/d);h+=y,i[f+m]+=y,d--}m++}}}Object.assign(o,i,a);for(let c=0;c<o.length;c++)o[c]=Math.max(n,o[c]||0)}}});var Xm=j(function(S1,Ym){var it=Qn(),o$=Ci(),Ai=Km();class Fi extends Array{constructor(e){super();let t=o$.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":it.setDebugLevel(it.WARN);break;case"number":it.setDebugLevel(t.debug);break;case"string":it.setDebugLevel(parseInt(t.debug,10));break;default:it.setDebugLevel(it.WARN),it.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return it.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;if(t){if(e=[this.options.head],this.length)e.push.apply(e,this)}else this.options.style.head=[];let r=Ai.makeTableLayout(e);r.forEach(function(o){o.forEach(function(s){s.mergeTableOptions(this.options,r)},this)},this),Ai.computeWidths(this.options.colWidths,r),Ai.computeHeights(this.options.rowHeights,r),r.forEach(function(o){o.forEach(function(s){s.init(this.options)},this)},this);let n=[];for(let o=0;o<r.length;o++){let s=r[o],i=this.options.rowHeights[o];if(o===0||!this.options.style.compact||o==1&&t)Oi(s,"top",n);for(let u=0;u<i;u++)Oi(s,u,n);if(o+1==r.length)Oi(s,"bottom",n)}return n.join(`
5
+ `+s),e.push(o+"m+"+dn.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=by()+t+" "+e[0]}function by(){if(Ao.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function xy(...e){return process.stderr.write(hn.formatWithOptions(Ao.inspectOpts,...e)+`
6
+ `)}function vy(e){if(e)process.env.DEBUG=e;else delete process.env.DEBUG}function wy(){return process.env.DEBUG}function Cy(e){e.inspectOpts={};let t=Object.keys(Ao.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=Ao.inspectOpts[t[r]]}dn.exports=$o()(Ao);var{formatters:mu}=dn.exports;mu.o=function(e){return this.inspectOpts.colors=this.useColors,hn.inspect(e,this.inspectOpts).split(`
7
+ `).map((t)=>t.trim()).join(" ")};mu.O=function(e){return this.inspectOpts.colors=this.useColors,hn.inspect(e,this.inspectOpts)}});var To=F(function(_A,Fo){if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)Fo.exports=du();else Fo.exports=_u()});var yu=F(function(Ie){var Ty=Ie&&Ie.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ie,"__esModule",{value:!0});var Py=Lt("fs"),Ry=Ty(To()),jt=Ry.default("@kwsites/file-exists");function zy(e,t,r){jt("checking %s",e);try{let n=Py.statSync(e);if(n.isFile()&&t)return jt("[OK] path represents a file"),!0;if(n.isDirectory()&&r)return jt("[OK] path represents a directory"),!0;return jt("[FAIL] path represents something other than a file or directory"),!1}catch(n){if(n.code==="ENOENT")return jt("[FAIL] path is not accessible: %o",n),!1;throw jt("[FATAL] %o",n),n}}function Iy(e,t=Ie.READABLE){return zy(e,(t&Ie.FILE)>0,(t&Ie.FOLDER)>0)}Ie.exists=Iy;Ie.FILE=1;Ie.FOLDER=2;Ie.READABLE=Ie.FILE+Ie.FOLDER});var Du=F(function(mn){function Ny(e){for(var t in e)if(!mn.hasOwnProperty(t))mn[t]=e[t]}Object.defineProperty(mn,"__esModule",{value:!0});Ny(yu())});var zo=F(function(bu){Object.defineProperty(bu,"__esModule",{value:!0});bu.createDeferred=bu.deferred=void 0;function Ro(){let e,t,r="pending";return{promise:new Promise((o,s)=>{e=o,t=s}),done(o){if(r==="pending")r="resolved",e(o)},fail(o){if(r==="pending")r="rejected",t(o)},get fulfilled(){return r!=="pending"},get status(){return r}}}bu.deferred=Ro;bu.createDeferred=Ro;bu.default=Ro});var wr=F(function(yF,_l){var gl={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)",SEP:"/"},w0={...gl,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},C0={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};_l.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:C0,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?w0:gl}}});var Cr=F(function(O0){var{REGEX_BACKSLASH:E0,REGEX_REMOVE_BACKSLASH:k0,REGEX_SPECIAL_CHARS:S0,REGEX_SPECIAL_CHARS_GLOBAL:$0}=wr();O0.isObject=(e)=>e!==null&&typeof e==="object"&&!Array.isArray(e);O0.hasRegexChars=(e)=>S0.test(e);O0.isRegexChar=(e)=>e.length===1&&O0.hasRegexChars(e);O0.escapeRegex=(e)=>e.replace($0,"\\$1");O0.toPosixSlashes=(e)=>e.replace(E0,"/");O0.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let e=navigator.platform.toLowerCase();return e==="win32"||e==="windows"}if(typeof process<"u"&&process.platform)return process.platform==="win32";return!1};O0.removeBackslashes=(e)=>e.replace(k0,(t)=>t==="\\"?"":t);O0.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);if(n===-1)return e;if(e[n-1]==="\\")return O0.escapeLast(e,t,n-1);return`${e.slice(0,n)}\\${e.slice(n)}`};O0.removePrefix=(e,t={})=>{let r=e;if(r.startsWith("./"))r=r.slice(2),t.prefix="./";return r};O0.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",o=r.contains?"":"$",s=`${n}(?:${e})${o}`;if(t.negated===!0)s=`(?:^(?!${s}).*$)`;return s};O0.basename=(e,{windows:t}={})=>{let r=e.split(t?/[\\/]/:"/"),n=r[r.length-1];if(n==="")return r[r.length-2];return n}});var Sl=F(function(bF,kl){var bl=Cr(),{CHAR_ASTERISK:Ss,CHAR_AT:B0,CHAR_BACKWARD_SLASH:Yt,CHAR_COMMA:M0,CHAR_DOT:$s,CHAR_EXCLAMATION_MARK:Os,CHAR_FORWARD_SLASH:El,CHAR_LEFT_CURLY_BRACE:As,CHAR_LEFT_PARENTHESES:In,CHAR_LEFT_SQUARE_BRACKET:Z0,CHAR_PLUS:j0,CHAR_QUESTION_MARK:xl,CHAR_RIGHT_CURLY_BRACE:H0,CHAR_RIGHT_PARENTHESES:vl,CHAR_RIGHT_SQUARE_BRACKET:U0}=wr(),wl=(e)=>e===El||e===Yt,Cl=(e)=>{if(e.isPrefix!==!0)e.depth=e.isGlobstar?1/0:1},G0=(e,t)=>{let r=t||{},n=e.length-1,o=r.parts===!0||r.tokens===!0||r.scanToEnd===!0,s=[],i=[],u=[],a=e,c=-1,l=0,p=0,f=!1,h=!1,d=!1,m=!1,b=!1,A=!1,v=!1,j=!1,G=!1,N=!1,T=0,L,P,M={value:"",depth:0,isGlob:!1},g=()=>c>=n,he=()=>a.charCodeAt(c+1),re=()=>(L=P,a.charCodeAt(++c));while(c<n){P=re();let W;if(P===Yt){if(v=M.backslashes=!0,P=re(),P===As)A=!0;continue}if(A===!0||P===As){T++;while(g()!==!0&&(P=re())){if(P===Yt){v=M.backslashes=!0,re();continue}if(P===As){T++;continue}if(A!==!0&&P===$s&&(P=re())===$s){if(f=M.isBrace=!0,d=M.isGlob=!0,N=!0,o===!0)continue;break}if(A!==!0&&P===M0){if(f=M.isBrace=!0,d=M.isGlob=!0,N=!0,o===!0)continue;break}if(P===H0){if(T--,T===0){A=!1,f=M.isBrace=!0,N=!0;break}}}if(o===!0)continue;break}if(P===El){if(s.push(c),i.push(M),M={value:"",depth:0,isGlob:!1},N===!0)continue;if(L===$s&&c===l+1){l+=2;continue}p=c+1;continue}if(r.noext!==!0){if((P===j0||P===B0||P===Ss||P===xl||P===Os)===!0&&he()===In){if(d=M.isGlob=!0,m=M.isExtglob=!0,N=!0,P===Os&&c===l)G=!0;if(o===!0){let ke=0;while(g()!==!0&&(P=re())){if(P===Yt){v=M.backslashes=!0,re();continue}if(P===In){ke++;continue}if(P===vl&&--ke===0){N=!0;break}}continue}break}}if(P===Ss){if(L===Ss)b=M.isGlobstar=!0;if(d=M.isGlob=!0,N=!0,o===!0)continue;break}if(P===xl){if(d=M.isGlob=!0,N=!0,o===!0)continue;break}if(P===Z0){while(g()!==!0&&(W=re())){if(W===Yt){v=M.backslashes=!0,re();continue}if(W===U0){h=M.isBracket=!0,d=M.isGlob=!0,N=!0;break}}if(o===!0)continue;break}if(r.nonegate!==!0&&P===Os&&c===l){j=M.negated=!0,l++;continue}if(r.noparen!==!0&&P===In){if(d=M.isGlob=!0,o===!0){let ve=1;while(g()!==!0&&(P=re())){if(P===Yt){v=M.backslashes=!0,re();continue}if(P===In){ve++;continue}if(P===vl&&--ve===0){N=!0;break}}continue}break}if(d===!0){if(N=!0,o===!0)continue;break}}if(r.noext===!0)m=!1,d=!1;let ee=a,D="",y="";if(l>0)D=a.slice(0,l),a=a.slice(l),p-=l;if(ee&&d===!0&&p>0)ee=a.slice(0,p),y=a.slice(p);else if(d===!0)ee="",y=a;else ee=a;if(ee&&ee!==""&&ee!=="/"&&ee!==a){if(wl(ee.charCodeAt(ee.length-1)))ee=ee.slice(0,-1)}if(r.unescape===!0){if(y)y=bl.removeBackslashes(y);if(ee&&v===!0)ee=bl.removeBackslashes(ee)}let Fe={prefix:D,input:e,start:l,base:ee,glob:y,isBrace:f,isBracket:h,isGlob:d,isExtglob:m,isGlobstar:b,negated:j,negatedExtglob:G};if(r.tokens===!0){if(Fe.maxDepth=0,!wl(P))i.push(M);Fe.tokens=i}if(r.parts===!0||r.tokens===!0){let W;for(let ue=0;ue<s.length;ue++){let lt=W!==void 0?W+1:l,xt=s[ue],nt=e.slice(lt,xt);if(r.tokens){if(ue===0&&l!==0)i[ue].isPrefix=!0,i[ue].value=D;else i[ue].value=nt;Cl(i[ue]),Fe.maxDepth+=i[ue].depth}if(xt>=l)u.push(nt),W=xt}let ve=W!==void 0?W+1:l,ke=e.slice(ve);if(u.push(ke),r.tokens&&W&&W+1<e.length)i[i.length-1].value=ke,Cl(i[i.length-1]),Fe.maxDepth+=i[i.length-1].depth;Fe.slashes=s,Fe.parts=u}return Fe};kl.exports=G0});var Fl=F(function(xF,Al){var Er=wr(),Le=Cr(),{MAX_LENGTH:Nn,POSIX_REGEX_SOURCE:W0,REGEX_NON_SPECIAL_CHARS:q0,REGEX_SPECIAL_CHARS_BACKREF:V0,REPLACEMENTS:$l}=Er,J0=(e,t)=>{if(typeof t.expandRange==="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map((o)=>Le.escapeRegex(o)).join("..")}return r},Xt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Ol=(e)=>{let t=[],r=0,n=0,o=0,s="",i=!1;for(let u of e){if(i===!0){s+=u,i=!1;continue}if(u==="\\"){s+=u,i=!0;continue}if(u==='"'){o=o===1?0:1,s+=u;continue}if(o===0){if(u==="[")r++;else if(u==="]"&&r>0)r--;else if(r===0){if(u==="(")n++;else if(u===")"&&n>0)n--;else if(u==="|"&&n===0){t.push(s),s="";continue}}}s+=u}return t.push(s),t},K0=(e)=>{let t=!1;for(let r of e){if(t===!0){t=!1;continue}if(r==="\\"){t=!0;continue}if(/[?*+@!()[\]{}]/.test(r))return!1}return!0},Ts=(e)=>{let t=e.trim(),r=!0;while(r===!0)if(r=!1,/^@\([^\\()[\]{}|]+\)$/.test(t))t=t.slice(2,-1),r=!0;if(!K0(t))return;return t.replace(/\\(.)/g,"$1")},Y0=(e)=>{let t=e.map(Ts).filter(Boolean);for(let r=0;r<t.length;r++)for(let n=r+1;n<t.length;n++){let o=t[r],s=t[n],i=o[0];if(!i||o!==i.repeat(o.length)||s!==i.repeat(s.length))continue;if(o===s||o.startsWith(s)||s.startsWith(o))return!0}return!1},Fs=(e,t=!0)=>{if(e[0]!=="+"&&e[0]!=="*"||e[1]!=="(")return;let r=0,n=0,o=0,s=!1;for(let i=1;i<e.length;i++){let u=e[i];if(s===!0){s=!1;continue}if(u==="\\"){s=!0;continue}if(u==='"'){o=o===1?0:1;continue}if(o===1)continue;if(u==="["){r++;continue}if(u==="]"&&r>0){r--;continue}if(r>0)continue;if(u==="("){n++;continue}if(u===")"){if(n--,n===0){if(t===!0&&i!==e.length-1)return;return{type:e[0],body:e.slice(2,i),end:i}}}}},X0=(e)=>`${e.length===1?Le.escapeRegex(e[0]):`[${e.map((r)=>Le.escapeRegex(r)).join("")}]`}*`,Q0=(e)=>{let t=0,r=[];while(t<e.length){let n=Fs(e.slice(t),!1);if(!n||n.type!=="*")return;let o=Ol(n.body).map((i)=>i.trim());if(o.length!==1)return;let s=Ts(o[0]);if(!s||s.length!==1)return;r.push(s),t+=n.end+1}if(r.length<1)return;return r},ew=(e)=>{let t=0,r=e.trim(),n=Fs(r);while(n)t++,r=n.body.trim(),n=Fs(r);return t},tw=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==="number"?t.maxExtglobRecursion:Er.DEFAULT_MAX_EXTGLOB_RECURSION,n=Ol(e).map((u)=>u.trim());if(n.length>1){if(n.some((u)=>u==="")||n.some((u)=>/^[*?]+$/.test(u))||Y0(n))return{risky:!0}}let o=[],s=!1,i=!0;for(let u of n){let a=Q0(u);if(a){s=!0,o.push(...a);continue}let c=Ts(u);if(c&&c.length===1){o.push(c);continue}if(i=!1,ew(u)>r)return{risky:!0}}if(s)return i?{risky:!0,safeOutput:X0([...new Set(o)])}:{risky:!0};return{risky:!1}},Ps=(e,t)=>{if(typeof e!=="string")throw TypeError("Expected a string");e=$l[e]||e;let r={...t},n=typeof r.maxLength==="number"?Math.min(Nn,r.maxLength):Nn,o=e.length;if(o>n)throw SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},i=[s],u=r.capture?"":"?:",a=Er.globChars(r.windows),c=Er.extglobChars(a),{DOT_LITERAL:l,PLUS_LITERAL:p,SLASH_LITERAL:f,ONE_CHAR:h,DOTS_SLASH:d,NO_DOT:m,NO_DOT_SLASH:b,NO_DOTS_SLASH:A,QMARK:v,QMARK_NO_DOT:j,STAR:G,START_ANCHOR:N}=a,T=(E)=>`(${u}(?:(?!${N}${E.dot?d:l}).)*?)`,L=r.dot?"":m,P=r.dot?v:j,M=r.bash===!0?T(r):G;if(r.capture)M=`(${M})`;if(typeof r.noext==="boolean")r.noextglob=r.noext;let g={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};e=Le.removePrefix(e,g),o=e.length;let he=[],re=[],ee=[],D=s,y,Fe=()=>g.index===o-1,W=g.peek=(E=1)=>e[g.index+E],ve=g.advance=()=>e[++g.index]||"",ke=()=>e.slice(g.index+1),ue=(E="",X=0)=>{g.consumed+=E,g.index+=X},lt=(E)=>{g.output+=E.output!=null?E.output:E.value,ue(E.value)},xt=()=>{let E=1;while(W()==="!"&&(W(2)!=="("||W(3)==="?"))ve(),g.start++,E++;if(E%2===0)return!1;return g.negated=!0,g.start++,!0},nt=(E)=>{g[E]++,ee.push(E)},Ke=(E)=>{g[E]--,ee.pop()},Z=(E)=>{if(D.type==="globstar"){let X=g.braces>0&&(E.type==="comma"||E.type==="brace"),w=E.extglob===!0||he.length&&(E.type==="pipe"||E.type==="paren");if(E.type!=="slash"&&E.type!=="paren"&&!X&&!w)g.output=g.output.slice(0,-D.output.length),D.type="star",D.value="*",D.output=M,g.output+=D.output}if(he.length&&E.type!=="paren")he[he.length-1].inner+=E.value;if(E.value||E.output)lt(E);if(D&&D.type==="text"&&E.type==="text"){D.output=(D.output||D.value)+E.value,D.value+=E.value;return}E.prev=D,i.push(E),D=E},Nt=(E,X)=>{let w={...c[X],conditions:1,inner:""};w.prev=D,w.parens=g.parens,w.output=g.output,w.startIndex=g.index,w.tokensIndex=i.length;let C=(r.capture?"(":"")+w.open;nt("parens"),Z({type:E,value:X,output:g.output?"":h}),Z({type:"paren",extglob:!0,value:ve(),output:C}),he.push(w)},wo=(E)=>{let X=e.slice(E.startIndex,g.index+1),w=e.slice(E.startIndex+2,g.index),C=tw(w,r);if((E.type==="plus"||E.type==="star")&&C.risky){let z=C.safeOutput?(E.output?"":h)+(r.capture?`(${C.safeOutput})`:C.safeOutput):void 0,ne=i[E.tokensIndex];ne.type="text",ne.value=X,ne.output=z||Le.escapeRegex(X);for(let _e=E.tokensIndex+1;_e<i.length;_e++)i[_e].value="",i[_e].output="",delete i[_e].suffix;g.output=E.output+ne.output,g.backtrack=!0,Z({type:"paren",extglob:!0,value:y,output:""}),Ke("parens");return}let x=E.close+(r.capture?")":""),S;if(E.type==="negate"){let z=M;if(E.inner&&E.inner.length>1&&E.inner.includes("/"))z=T(r);if(z!==M||Fe()||/^\)+$/.test(ke()))x=E.close=`)$))${z}`;if(E.inner.includes("*")&&(S=ke())&&/^\.[^\\/.]+$/.test(S)){let ne=Ps(S,{...t,fastpaths:!1}).output;x=E.close=`)${ne})${z})`}if(E.prev.type==="bos")g.negatedExtglob=!0}Z({type:"paren",extglob:!0,value:y,output:x}),Ke("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let E=!1,X=e.replace(V0,(w,C,x,S,z,ne)=>{if(S==="\\")return E=!0,w;if(S==="?"){if(C)return C+S+(z?v.repeat(z.length):"");if(ne===0)return P+(z?v.repeat(z.length):"");return v.repeat(x.length)}if(S===".")return l.repeat(x.length);if(S==="*"){if(C)return C+S+(z?M:"");return M}return C?w:`\\${w}`});if(E===!0)if(r.unescape===!0)X=X.replace(/\\/g,"");else X=X.replace(/\\+/g,(w)=>w.length%2===0?"\\\\":w?"\\":"");if(X===e&&r.contains===!0)return g.output=e,g;return g.output=Le.wrapOutput(X,g,t),g}while(!Fe()){if(y=ve(),y==="\x00")continue;if(y==="\\"){let w=W();if(w==="/"&&r.bash!==!0)continue;if(w==="."||w===";")continue;if(!w){y+="\\",Z({type:"text",value:y});continue}let C=/^\\+/.exec(ke()),x=0;if(C&&C[0].length>2){if(x=C[0].length,g.index+=x,x%2!==0)y+="\\"}if(r.unescape===!0)y=ve();else y+=ve();if(g.brackets===0){Z({type:"text",value:y});continue}}if(g.brackets>0&&(y!=="]"||D.value==="["||D.value==="[^")){if(r.posix!==!1&&y===":"){let w=D.value.slice(1);if(w.includes("[")){if(D.posix=!0,w.includes(":")){let C=D.value.lastIndexOf("["),x=D.value.slice(0,C),S=D.value.slice(C+2),z=W0[S];if(z){if(D.value=x+z,g.backtrack=!0,ve(),!s.output&&i.indexOf(D)===1)s.output=h;continue}}}}if(y==="["&&W()!==":"||y==="-"&&W()==="]")y=`\\${y}`;if(y==="]"&&(D.value==="["||D.value==="[^"))y=`\\${y}`;if(r.posix===!0&&y==="!"&&D.value==="[")y="^";D.value+=y,lt({value:y});continue}if(g.quotes===1&&y!=='"'){y=Le.escapeRegex(y),D.value+=y,lt({value:y});continue}if(y==='"'){if(g.quotes=g.quotes===1?0:1,r.keepQuotes===!0)Z({type:"text",value:y});continue}if(y==="("){nt("parens"),Z({type:"paren",value:y});continue}if(y===")"){if(g.parens===0&&r.strictBrackets===!0)throw SyntaxError(Xt("opening","("));let w=he[he.length-1];if(w&&g.parens===w.parens+1){wo(he.pop());continue}Z({type:"paren",value:y,output:g.parens?")":"\\)"}),Ke("parens");continue}if(y==="["){if(r.nobracket===!0||!ke().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw SyntaxError(Xt("closing","]"));y=`\\${y}`}else nt("brackets");Z({type:"bracket",value:y});continue}if(y==="]"){if(r.nobracket===!0||D&&D.type==="bracket"&&D.value.length===1){Z({type:"text",value:y,output:`\\${y}`});continue}if(g.brackets===0){if(r.strictBrackets===!0)throw SyntaxError(Xt("opening","["));Z({type:"text",value:y,output:`\\${y}`});continue}Ke("brackets");let w=D.value.slice(1);if(D.posix!==!0&&w[0]==="^"&&!w.includes("/"))y=`/${y}`;if(D.value+=y,lt({value:y}),r.literalBrackets===!1||Le.hasRegexChars(w))continue;let C=Le.escapeRegex(D.value);if(g.output=g.output.slice(0,-D.value.length),r.literalBrackets===!0){g.output+=C,D.value=C;continue}D.value=`(${u}${C}|${D.value})`,g.output+=D.value;continue}if(y==="{"&&r.nobrace!==!0){nt("braces");let w={type:"brace",value:y,output:"(",outputIndex:g.output.length,tokensIndex:g.tokens.length};re.push(w),Z(w);continue}if(y==="}"){let w=re[re.length-1];if(r.nobrace===!0||!w){Z({type:"text",value:y,output:y});continue}let C=")";if(w.dots===!0){let x=i.slice(),S=[];for(let z=x.length-1;z>=0;z--){if(i.pop(),x[z].type==="brace")break;if(x[z].type!=="dots")S.unshift(x[z].value)}C=J0(S,r),g.backtrack=!0}if(w.comma!==!0&&w.dots!==!0){let x=g.output.slice(0,w.outputIndex),S=g.tokens.slice(w.tokensIndex);w.value=w.output="\\{",y=C="\\}",g.output=x;for(let z of S)g.output+=z.output||z.value}Z({type:"brace",value:y,output:C}),Ke("braces"),re.pop();continue}if(y==="|"){if(he.length>0)he[he.length-1].conditions++;Z({type:"text",value:y});continue}if(y===","){let w=y,C=re[re.length-1];if(C&&ee[ee.length-1]==="braces")C.comma=!0,w="|";Z({type:"comma",value:y,output:w});continue}if(y==="/"){if(D.type==="dot"&&g.index===g.start+1){g.start=g.index+1,g.consumed="",g.output="",i.pop(),D=s;continue}Z({type:"slash",value:y,output:f});continue}if(y==="."){if(g.braces>0&&D.type==="dot"){if(D.value===".")D.output=l;let w=re[re.length-1];D.type="dots",D.output+=y,D.value+=y,w.dots=!0;continue}if(g.braces+g.parens===0&&D.type!=="bos"&&D.type!=="slash"){Z({type:"text",value:y,output:l});continue}Z({type:"dot",value:y,output:l});continue}if(y==="?"){if(!(D&&D.value==="(")&&r.noextglob!==!0&&W()==="("&&W(2)!=="?"){Nt("qmark",y);continue}if(D&&D.type==="paren"){let C=W(),x=y;if(D.value==="("&&!/[!=<:]/.test(C)||C==="<"&&!/<([!=]|\w+>)/.test(ke()))x=`\\${y}`;Z({type:"text",value:y,output:x});continue}if(r.dot!==!0&&(D.type==="slash"||D.type==="bos")){Z({type:"qmark",value:y,output:j});continue}Z({type:"qmark",value:y,output:v});continue}if(y==="!"){if(r.noextglob!==!0&&W()==="("){if(W(2)!=="?"||!/[!=<:]/.test(W(3))){Nt("negate",y);continue}}if(r.nonegate!==!0&&g.index===0){xt();continue}}if(y==="+"){if(r.noextglob!==!0&&W()==="("&&W(2)!=="?"){Nt("plus",y);continue}if(D&&D.value==="("||r.regex===!1){Z({type:"plus",value:y,output:p});continue}if(D&&(D.type==="bracket"||D.type==="paren"||D.type==="brace")||g.parens>0){Z({type:"plus",value:y});continue}Z({type:"plus",value:p});continue}if(y==="@"){if(r.noextglob!==!0&&W()==="("&&W(2)!=="?"){Z({type:"at",extglob:!0,value:y,output:""});continue}Z({type:"text",value:y});continue}if(y!=="*"){if(y==="$"||y==="^")y=`\\${y}`;let w=q0.exec(ke());if(w)y+=w[0],g.index+=w[0].length;Z({type:"text",value:y});continue}if(D&&(D.type==="globstar"||D.star===!0)){D.type="star",D.star=!0,D.value+=y,D.output=M,g.backtrack=!0,g.globstar=!0,ue(y);continue}let E=ke();if(r.noextglob!==!0&&/^\([^?]/.test(E)){Nt("star",y);continue}if(D.type==="star"){if(r.noglobstar===!0){ue(y);continue}let w=D.prev,C=w.prev,x=w.type==="slash"||w.type==="bos",S=C&&(C.type==="star"||C.type==="globstar");if(r.bash===!0&&(!x||E[0]&&E[0]!=="/")){Z({type:"star",value:y,output:""});continue}let z=g.braces>0&&(w.type==="comma"||w.type==="brace"),ne=he.length&&(w.type==="pipe"||w.type==="paren");if(!x&&w.type!=="paren"&&!z&&!ne){Z({type:"star",value:y,output:""});continue}while(E.slice(0,3)==="/**"){let Ye=e[g.index+4];if(Ye&&Ye!=="/")break;E=E.slice(3),ue("/**",3)}let _e=Fe()||g.parens>0&&E===")".repeat(g.parens)&&!he.some((Ye)=>Ye.type==="negate");if(w.type==="bos"&&Fe()){D.type="globstar",D.value+=y,D.output=T(r),g.output=D.output,g.globstar=!0,ue(y);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&!S&&_e){g.output=g.output.slice(0,-(w.output+D.output).length),w.output=`(?:${w.output}`,D.type="globstar",D.output=T(r)+(r.strictSlashes?")":"|$)"),D.value+=y,g.globstar=!0,g.output+=w.output+D.output,ue(y);continue}if(w.type==="slash"&&w.prev.type!=="bos"&&E[0]==="/"){let Ye=E[1]!==void 0?"|$":"";g.output=g.output.slice(0,-(w.output+D.output).length),w.output=`(?:${w.output}`,D.type="globstar",D.output=`${T(r)}${f}|${f}${Ye})`,D.value+=y,g.output+=w.output+D.output,g.globstar=!0,ue(y+ve()),Z({type:"slash",value:"/",output:""});continue}if(w.type==="bos"&&E[0]==="/"){D.type="globstar",D.value+=y,D.output=`(?:^|${f}|${T(r)}${f})`,g.output=D.output,g.globstar=!0,ue(y+ve()),Z({type:"slash",value:"/",output:""});continue}g.output=g.output.slice(0,-D.output.length),D.type="globstar",D.output=T(r),D.value+=y,g.output+=D.output,g.globstar=!0,ue(y);continue}let X={type:"star",value:y,output:M};if(r.bash===!0){if(X.output=".*?",D.type==="bos"||D.type==="slash")X.output=L+X.output;Z(X);continue}if(D&&(D.type==="bracket"||D.type==="paren")&&r.regex===!0){X.output=y,Z(X);continue}if(g.index===g.start||D.type==="slash"||D.type==="dot"){if(D.type==="dot")g.output+=b,D.output+=b;else if(r.dot===!0)g.output+=A,D.output+=A;else g.output+=L,D.output+=L;if(W()!=="*")g.output+=h,D.output+=h}Z(X)}while(g.brackets>0){if(r.strictBrackets===!0)throw SyntaxError(Xt("closing","]"));g.output=Le.escapeLast(g.output,"["),Ke("brackets")}while(g.parens>0){if(r.strictBrackets===!0)throw SyntaxError(Xt("closing",")"));g.output=Le.escapeLast(g.output,"("),Ke("parens")}while(g.braces>0){if(r.strictBrackets===!0)throw SyntaxError(Xt("closing","}"));g.output=Le.escapeLast(g.output,"{"),Ke("braces")}if(r.strictSlashes!==!0&&(D.type==="star"||D.type==="bracket"))Z({type:"maybe_slash",value:"",output:`${f}?`});if(g.backtrack===!0){g.output="";for(let E of g.tokens)if(g.output+=E.output!=null?E.output:E.value,E.suffix)g.output+=E.suffix}return g};Ps.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength==="number"?Math.min(Nn,r.maxLength):Nn,o=e.length;if(o>n)throw SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${n}`);e=$l[e]||e;let{DOT_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:u,DOTS_SLASH:a,NO_DOT:c,NO_DOTS:l,NO_DOTS_SLASH:p,STAR:f,START_ANCHOR:h}=Er.globChars(r.windows),d=r.dot?l:c,m=r.dot?p:c,b=r.capture?"":"?:",A={negated:!1,prefix:""},v=r.bash===!0?".*?":f;if(r.capture)v=`(${v})`;let j=(L)=>{if(L.noglobstar===!0)return v;return`(${b}(?:(?!${h}${L.dot?a:s}).)*?)`},G=(L)=>{switch(L){case"*":return`${d}${u}${v}`;case".*":return`${s}${u}${v}`;case"*.*":return`${d}${v}${s}${u}${v}`;case"*/*":return`${d}${v}${i}${u}${m}${v}`;case"**":return d+j(r);case"**/*":return`(?:${d}${j(r)}${i})?${m}${u}${v}`;case"**/*.*":return`(?:${d}${j(r)}${i})?${m}${v}${s}${u}${v}`;case"**/.*":return`(?:${d}${j(r)}${i})?${s}${u}${v}`;default:{let P=/^(.*?)\.(\w+)$/.exec(L);if(!P)return;let M=G(P[1]);if(!M)return;return M+s+P[2]}}},N=Le.removePrefix(e,A),T=G(N);if(T&&r.strictSlashes!==!0)T+=`${i}?`;return T};Al.exports=Ps});var Rl=F(function(vF,Pl){var rw=Sl(),Rs=Fl(),Tl=Cr(),nw=wr(),ow=(e)=>e&&typeof e==="object"&&!Array.isArray(e),le=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map((f)=>le(f,t,r));return(f)=>{for(let h of l){let d=h(f);if(d)return d}return!1}}let n=ow(e)&&e.tokens&&e.input;if(e===""||typeof e!=="string"&&!n)throw TypeError("Expected pattern to be a non-empty string");let o=t||{},s=o.windows,i=n?le.compileRe(e,t):le.makeRe(e,t,!1,!0),u=i.state;delete i.state;let a=()=>!1;if(o.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};a=le(o.ignore,l,r)}let c=(l,p=!1)=>{let{isMatch:f,match:h,output:d}=le.test(l,i,t,{glob:e,posix:s}),m={glob:e,state:u,regex:i,posix:s,input:l,output:d,match:h,isMatch:f};if(typeof o.onResult==="function")o.onResult(m);if(f===!1)return m.isMatch=!1,p?m:!1;if(a(l)){if(typeof o.onIgnore==="function")o.onIgnore(m);return m.isMatch=!1,p?m:!1}if(typeof o.onMatch==="function")o.onMatch(m);return p?m:!0};if(r)c.state=u;return c};le.test=(e,t,r,{glob:n,posix:o}={})=>{if(typeof e!=="string")throw TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let s=r||{},i=s.format||(o?Tl.toPosixSlashes:null),u=e===n,a=u&&i?i(e):e;if(u===!1)a=i?i(e):e,u=a===n;if(u===!1||s.capture===!0)if(s.matchBase===!0||s.basename===!0)u=le.matchBase(e,t,r,o);else u=t.exec(a);return{isMatch:Boolean(u),match:u,output:a}};le.matchBase=(e,t,r,n=r&&r.windows)=>(t instanceof RegExp?t:le.makeRe(t,r)).test(Tl.basename(e,{windows:n}));le.isMatch=(e,t,r)=>le(t,r)(e);le.parse=(e,t)=>{if(Array.isArray(e))return e.map((r)=>le.parse(r,t));return Rs(e,{...t,fastpaths:!1})};le.scan=(e,t)=>rw(e,t);le.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let o=t||{},s=o.contains?"":"^",i=o.contains?"":"$",u=`${s}(?:${e.output})${i}`;if(e&&e.negated===!0)u=`^(?!${u}).*$`;let a=le.toRegex(u,t);if(n===!0)a.state=e;return a};le.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!=="string")throw TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};if(t.fastpaths!==!1&&(e[0]==="."||e[0]==="*"))o.output=Rs.fastpaths(e,t);if(!o.output)o=Rs(e,t);return le.compileRe(o,t,r,n)};le.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};le.constants=nw;Pl.exports=le});var Ll=F(function(wF,Nl){var zl=Rl(),sw=Cr();function Il(e,t,r=!1){if(t&&(t.windows===null||t.windows===void 0))t={...t,windows:sw.isWindows()};return zl(e,t,r)}Object.assign(Il,zl);Nl.exports=Il});var em=F(function(lP,Fi){var lo=process||{},Xd=lo.argv||[],co=lo.env||{},PE=!(!!co.NO_COLOR||Xd.includes("--no-color"))&&(!!co.FORCE_COLOR||Xd.includes("--color")||lo.platform==="win32"||(lo.stdout||{}).isTTY&&co.TERM!=="dumb"||!!co.CI),RE=(e,t,r=e)=>(n)=>{let o=""+n,s=o.indexOf(t,e.length);return~s?e+zE(o,t,r,s)+t:e+o+t},zE=(e,t,r,n)=>{let o="",s=0;do o+=e.substring(s,n)+r,s=n+t.length,n=e.indexOf(t,s);while(~n);return o+e.substring(s)},Qd=(e=PE)=>{let t=e?RE:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Fi.exports=Qd();Fi.exports.createColors=Qd});var lm=F(function(DP,cm){var sm=1/0,um=9007199254740991,ME=179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,im=NaN,ZE="[object Function]",jE="[object GeneratorFunction]",HE="[object Symbol]",UE=/^\s+|\s+$/g,GE=/^[-+]0x[0-9a-f]+$/i,WE=/^0b[01]+$/i,qE=/^0o[0-7]+$/i,VE=/^(?:0|[1-9]\d*)$/,JE=parseInt,KE=Object.prototype,am=KE.toString,{ceil:YE,max:XE}=Math;function QE(e,t,r){var n=-1,o=e.length;if(t<0)t=-t>o?0:o+t;if(r=r>o?o:r,r<0)r+=o;o=t>r?0:r-t>>>0,t>>>=0;var s=Array(o);while(++n<o)s[n]=e[n+t];return s}function ek(e,t){return t=t==null?um:t,!!t&&(typeof e=="number"||VE.test(e))&&(e>-1&&e%1==0&&e<t)}function tk(e,t,r){if(!po(r))return!1;var n=typeof t;if(n=="number"?ok(r)&&ek(t,r.length):n=="string"&&(t in r))return nk(r[t],e);return!1}function rk(e,t,r){if(r?tk(e,t,r):t===void 0)t=1;else t=XE(lk(t),0);var n=e?e.length:0;if(!n||t<1)return[];var o=0,s=0,i=Array(YE(n/t));while(o<n)i[s++]=QE(e,o,o+=t);return i}function nk(e,t){return e===t||e!==e&&t!==t}function ok(e){return e!=null&&ik(e.length)&&!sk(e)}function sk(e){var t=po(e)?am.call(e):"";return t==ZE||t==jE}function ik(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=um}function po(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function uk(e){return!!e&&typeof e=="object"}function ak(e){return typeof e=="symbol"||uk(e)&&am.call(e)==HE}function ck(e){if(!e)return e===0?e:0;if(e=pk(e),e===sm||e===-sm){var t=e<0?-1:1;return t*ME}return e===e?e:0}function lk(e){var t=ck(e),r=t%1;return t===t?r?t-r:t:0}function pk(e){if(typeof e=="number")return e;if(ak(e))return im;if(po(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=po(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(UE,"");var r=WE.test(e);return r||qE.test(e)?JE(e.slice(2),r?2:8):GE.test(e)?im:+e}cm.exports=rk});var Dt=F(function(CP,Zr){function hk(e){return e&&e.__esModule?e:{default:e}}Zr.exports=hk,Zr.exports.__esModule=!0,Zr.exports.default=Zr.exports});var Ri=F(function(EP,at){function Pi(e){return at.exports=Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},at.exports.__esModule=!0,at.exports.default=at.exports,Pi(e)}at.exports=Pi,at.exports.__esModule=!0,at.exports.default=at.exports});var dm=F(function(kP,jr){var hm=Ri().default;function dk(e,t){if(hm(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(hm(n)!="object")return n;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}jr.exports=dk,jr.exports.__esModule=!0,jr.exports.default=jr.exports});var zi=F(function(SP,Hr){var mk=Ri().default,gk=dm();function _k(e){var t=gk(e,"string");return mk(t)=="symbol"?t:t+""}Hr.exports=_k,Hr.exports.__esModule=!0,Hr.exports.default=Hr.exports});var mm=F(function($P,Ur){var yk=zi();function Dk(e,t,r){return(t=yk(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Ur.exports=Dk,Ur.exports.__esModule=!0,Ur.exports.default=Ur.exports});var Rt=F(function(OP,Gr){function bk(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}Gr.exports=bk,Gr.exports.__esModule=!0,Gr.exports.default=Gr.exports});var zt=F(function(AP,Wr){var xk=zi();function gm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,xk(n.key),n)}}function vk(e,t,r){return t&&gm(e.prototype,t),r&&gm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}Wr.exports=vk,Wr.exports.__esModule=!0,Wr.exports.default=Wr.exports});var Ii=F(function(FP,qr){function wk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}qr.exports=wk,qr.exports.__esModule=!0,qr.exports.default=qr.exports});var _m=F(function(TP,Vr){var Ck=Ii();function Ek(e){if(Array.isArray(e))return Ck(e)}Vr.exports=Ek,Vr.exports.__esModule=!0,Vr.exports.default=Vr.exports});var ym=F(function(PP,Jr){function kk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}Jr.exports=kk,Jr.exports.__esModule=!0,Jr.exports.default=Jr.exports});var bm=F(function(RP,Kr){var Dm=Ii();function Sk(e,t){if(e){if(typeof e=="string")return Dm(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dm(e,t):void 0}}Kr.exports=Sk,Kr.exports.__esModule=!0,Kr.exports.default=Kr.exports});var xm=F(function(zP,Yr){function $k(){throw TypeError(`Invalid attempt to spread non-iterable instance.
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}Yr.exports=$k,Yr.exports.__esModule=!0,Yr.exports.default=Yr.exports});var vm=F(function(IP,Xr){var Ok=_m(),Ak=ym(),Fk=bm(),Tk=xm();function Pk(e){return Ok(e)||Ak(e)||Fk(e)||Tk()}Xr.exports=Pk,Xr.exports.__esModule=!0,Xr.exports.default=Xr.exports});var wm=F(function(Nk){var Rk=Dt(),zk=Rk(vm()),Ik={functions:"Jexl Function",transforms:"Transform"};Nk.ArrayLiteral=function(e){return this.evalArray(e.value)};Nk.BinaryExpression=function(e){var t=this,r=this._grammar.elements[e.operator];if(r.evalOnDemand){var n=function(s){return{eval:function(){return t.eval(s)}}};return r.evalOnDemand(n(e.left),n(e.right))}return this.Promise.all([this.eval(e.left),this.eval(e.right)]).then(function(o){return r.eval(o[0],o[1])})};Nk.ConditionalExpression=function(e){var t=this;return this.eval(e.test).then(function(r){if(r){if(e.consequent)return t.eval(e.consequent);return r}return t.eval(e.alternate)})};Nk.FilterExpression=function(e){var t=this;return this.eval(e.subject).then(function(r){if(e.relative)return t._filterRelative(r,e.expr);return t._filterStatic(r,e.expr)})};Nk.Identifier=function(e){if(!e.from)return e.relative?this._relContext[e.value]:this._context[e.value];return this.eval(e.from).then(function(t){if(t===void 0||t===null)return;if(Array.isArray(t))t=t[0];return t[e.value]})};Nk.Literal=function(e){return e.value};Nk.ObjectLiteral=function(e){return this.evalMap(e.value)};Nk.FunctionCall=function(e){var t=Ik[e.pool];if(!t)throw Error("Corrupt AST: Pool '".concat(e.pool,"' not found"));var r=this._grammar[e.pool],n=r[e.name];if(!n)throw Error("".concat(t," ").concat(e.name," is not defined."));return this.evalArray(e.args||[]).then(function(o){return n.apply(void 0,(0,zk.default)(o))})};Nk.UnaryExpression=function(e){var t=this;return this.eval(e.right).then(function(r){return t._grammar.elements[e.operator].eval(r)})}});var km=F(function(LP,Em){var Cm=Dt(),qk=Cm(Rt()),Vk=Cm(zt()),Jk=wm(),Kk=function(){function e(t,r,n){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Promise;(0,qk.default)(this,e),this._grammar=t,this._context=r||{},this._relContext=n||this._context,this.Promise=o}return(0,Vk.default)(e,[{key:"eval",value:function(r){var n=this;return this.Promise.resolve().then(function(){return Jk[r.type].call(n,r)})}},{key:"evalArray",value:function(r){var n=this;return this.Promise.all(r.map(function(o){return n.eval(o)}))}},{key:"evalMap",value:function(r){var n=this,o=Object.keys(r),s={},i=o.map(function(u){return n.eval(r[u])});return this.Promise.all(i).then(function(u){return u.forEach(function(a,c){s[o[c]]=a}),s})}},{key:"_filterRelative",value:function(r,n){var o=this,s=[];if(!Array.isArray(r))r=r===void 0?[]:[r];return r.forEach(function(i){var u=new e(o._grammar,o._context,i,o.Promise);s.push(u.eval(n))}),this.Promise.all(s).then(function(i){var u=[];return i.forEach(function(a,c){if(a)u.push(r[c])}),u})}},{key:"_filterStatic",value:function(r,n){return this.eval(n).then(function(o){if(typeof o==="boolean")return o?r:void 0;return r[o]})}}]),e}();Em.exports=Kk});var Am=F(function(BP,Om){var $m=Dt(),Yk=$m(Rt()),Xk=$m(zt()),Qk=/^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/,Sm=/^[a-zA-Z\u0430-\u044F\u0410-\u042F_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Z\u0430-\u044F\u0410-\u042F0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/,eS=/\\\\/,tS=/^\s*$/,rS=["'(?:(?:\\\\')|[^'])*'",'"(?:(?:\\\\")|[^"])*"',"\\s+","\\btrue\\b","\\bfalse\\b"],nS=["[a-zA-Z\u0430-\u044F\u0410-\u042F_\xC0-\xD6\xD8-\xF6\xF8-\xFF\\$][a-zA-Z0-9\u0430-\u044F\u0410-\u042F_\xC0-\xD6\xD8-\xF6\xF8-\xFF\\$]*","(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)"],oS=["binaryOp","unaryOp","openParen","openBracket","question","colon"],sS=function(){function e(t){(0,Yk.default)(this,e),this._grammar=t}return(0,Xk.default)(e,[{key:"getElements",value:function(r){var n=this._getSplitRegex();return r.split(n).filter(function(o){return o})}},{key:"getTokens",value:function(r){var n=[],o=!1;for(var s=0;s<r.length;s++)if(this._isWhitespace(r[s])){if(n.length)n[n.length-1].raw+=r[s]}else if(r[s]==="-"&&this._isNegative(n))o=!0;else{if(o)r[s]="-"+r[s],o=!1;n.push(this._createToken(r[s]))}if(o)n.push(this._createToken("-"));return n}},{key:"tokenize",value:function(r){var n=this.getElements(r);return this.getTokens(n)}},{key:"_createToken",value:function(r){var n={type:"literal",value:r,raw:r};if(r[0]==='"'||r[0]==="'")n.value=this._unquote(r);else if(r.match(Qk))n.value=parseFloat(r);else if(r==="true"||r==="false")n.value=r==="true";else if(this._grammar.elements[r])n.type=this._grammar.elements[r].type;else if(r.match(Sm))n.type="identifier";else throw Error("Invalid expression token: ".concat(r));return n}},{key:"_escapeRegExp",value:function(r){if(r=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r.match(Sm))r="\\b"+r+"\\b";return r}},{key:"_getSplitRegex",value:function(){var r=this;if(!this._splitRegex){var n=Object.keys(this._grammar.elements).sort(function(o,s){return s.length-o.length}).map(function(o){return r._escapeRegExp(o)},this);this._splitRegex=new RegExp("("+[rS.join("|"),n.join("|"),nS.join("|")].join("|")+")")}return this._splitRegex}},{key:"_isNegative",value:function(r){if(!r.length)return!0;return oS.some(function(n){return n===r[r.length-1].type})}},{key:"_isWhitespace",value:function(r){return!!r.match(tS)}},{key:"_unquote",value:function(r){var n=r[0],o=new RegExp("\\\\"+n,"g");return r.substr(1,r.length-2).replace(o,n).replace(eS,"\\")}}]),e}();Om.exports=sS});var Ni=F(function(iS){iS.argVal=function(e){if(e)this._cursor.args.push(e)};iS.arrayStart=function(){this._placeAtCursor({type:"ArrayLiteral",value:[]})};iS.arrayVal=function(e){if(e)this._cursor.value.push(e)};iS.binaryOp=function(e){var t=this._grammar.elements[e.value].precedence||0,r=this._cursor._parent;while(r&&r.operator&&this._grammar.elements[r.operator].precedence>=t)this._cursor=r,r=r._parent;var n={type:"BinaryExpression",operator:e.value,left:this._cursor};this._setParent(this._cursor,n),this._cursor=r,this._placeAtCursor(n)};iS.dot=function(){if(this._nextIdentEncapsulate=this._cursor&&this._cursor.type!=="UnaryExpression"&&(this._cursor.type!=="BinaryExpression"||this._cursor.type==="BinaryExpression"&&this._cursor.right),this._nextIdentRelative=!this._cursor||this._cursor&&!this._nextIdentEncapsulate,this._nextIdentRelative)this._relative=!0};iS.filter=function(e){this._placeBeforeCursor({type:"FilterExpression",expr:e,relative:this._subParser.isRelative(),subject:this._cursor})};iS.functionCall=function(){this._placeBeforeCursor({type:"FunctionCall",name:this._cursor.value,args:[],pool:"functions"})};iS.identifier=function(e){var t={type:"Identifier",value:e.value};if(this._nextIdentEncapsulate)t.from=this._cursor,this._placeBeforeCursor(t),this._nextIdentEncapsulate=!1;else{if(this._nextIdentRelative)t.relative=!0,this._nextIdentRelative=!1;this._placeAtCursor(t)}};iS.literal=function(e){this._placeAtCursor({type:"Literal",value:e.value})};iS.objKey=function(e){this._curObjKey=e.value};iS.objStart=function(){this._placeAtCursor({type:"ObjectLiteral",value:{}})};iS.objVal=function(e){this._cursor.value[this._curObjKey]=e};iS.subExpression=function(e){this._placeAtCursor(e)};iS.ternaryEnd=function(e){this._cursor.alternate=e};iS.ternaryMid=function(e){this._cursor.consequent=e};iS.ternaryStart=function(){this._tree={type:"ConditionalExpression",test:this._tree},this._cursor=this._tree};iS.transform=function(e){this._placeBeforeCursor({type:"FunctionCall",name:e.value,args:[this._cursor],pool:"transforms"})};iS.unaryOp=function(e){this._placeAtCursor({type:"UnaryExpression",operator:e.value})}});var Fm=F(function(ES){var Re=Ni();ES.states={expectOperand:{tokenTypes:{literal:{toState:"expectBinOp"},identifier:{toState:"identifier"},unaryOp:{},openParen:{toState:"subExpression"},openCurl:{toState:"expectObjKey",handler:Re.objStart},dot:{toState:"traverse"},openBracket:{toState:"arrayVal",handler:Re.arrayStart}}},expectBinOp:{tokenTypes:{binaryOp:{toState:"expectOperand"},pipe:{toState:"expectTransform"},dot:{toState:"traverse"},question:{toState:"ternaryMid",handler:Re.ternaryStart}},completable:!0},expectTransform:{tokenTypes:{identifier:{toState:"postTransform",handler:Re.transform}}},expectObjKey:{tokenTypes:{identifier:{toState:"expectKeyValSep",handler:Re.objKey},closeCurl:{toState:"expectBinOp"}}},expectKeyValSep:{tokenTypes:{colon:{toState:"objVal"}}},postTransform:{tokenTypes:{openParen:{toState:"argVal"},binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},postArgs:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},pipe:{toState:"expectTransform"}},completable:!0},identifier:{tokenTypes:{binaryOp:{toState:"expectOperand"},dot:{toState:"traverse"},openBracket:{toState:"filter"},openParen:{toState:"argVal",handler:Re.functionCall},pipe:{toState:"expectTransform"},question:{toState:"ternaryMid",handler:Re.ternaryStart}},completable:!0},traverse:{tokenTypes:{identifier:{toState:"identifier"}}},filter:{subHandler:Re.filter,endStates:{closeBracket:"identifier"}},subExpression:{subHandler:Re.subExpression,endStates:{closeParen:"expectBinOp"}},argVal:{subHandler:Re.argVal,endStates:{comma:"argVal",closeParen:"postArgs"}},objVal:{subHandler:Re.objVal,endStates:{comma:"expectObjKey",closeCurl:"expectBinOp"}},arrayVal:{subHandler:Re.arrayVal,endStates:{comma:"arrayVal",closeBracket:"expectBinOp"}},ternaryMid:{subHandler:Re.ternaryMid,endStates:{colon:"ternaryEnd"}},ternaryEnd:{subHandler:Re.ternaryEnd,completable:!0}}});var Rm=F(function(jP,Pm){var Tm=Dt(),SS=Tm(Rt()),$S=Tm(zt()),OS=Ni(),fo=Fm().states,AS=function(){function e(t,r,n){(0,SS.default)(this,e),this._grammar=t,this._state="expectOperand",this._tree=null,this._exprStr=r||"",this._relative=!1,this._stopMap=n||{}}return(0,$S.default)(e,[{key:"addToken",value:function(r){if(this._state==="complete")throw Error("Cannot add a new token to a completed Parser");var n=fo[this._state],o=this._exprStr;if(this._exprStr+=r.raw,n.subHandler){if(!this._subParser)this._startSubExpression(o);var s=this._subParser.addToken(r);if(s){if(this._endSubExpression(),this._parentStop)return s;this._state=s}}else if(n.tokenTypes[r.type]){var i=n.tokenTypes[r.type],u=OS[r.type];if(i.handler)u=i.handler;if(u)u.call(this,r);if(i.toState)this._state=i.toState}else if(this._stopMap[r.type])return this._stopMap[r.type];else throw Error("Token ".concat(r.raw," (").concat(r.type,") unexpected in expression: ").concat(this._exprStr));return!1}},{key:"addTokens",value:function(r){r.forEach(this.addToken,this)}},{key:"complete",value:function(){if(this._cursor&&!fo[this._state].completable)throw Error("Unexpected end of expression: ".concat(this._exprStr));if(this._subParser)this._endSubExpression();return this._state="complete",this._cursor?this._tree:null}},{key:"isRelative",value:function(){return this._relative}},{key:"_endSubExpression",value:function(){fo[this._state].subHandler.call(this,this._subParser.complete()),this._subParser=null}},{key:"_placeAtCursor",value:function(r){if(!this._cursor)this._tree=r;else this._cursor.right=r,this._setParent(r,this._cursor);this._cursor=r}},{key:"_placeBeforeCursor",value:function(r){this._cursor=this._cursor._parent,this._placeAtCursor(r)}},{key:"_setParent",value:function(r,n){Object.defineProperty(r,"_parent",{value:n,writable:!0})}},{key:"_startSubExpression",value:function(r){var n=fo[this._state].endStates;if(!n)this._parentStop=!0,n=this._stopMap;this._subParser=new e(this._grammar,r,n)}}]),e}();Pm.exports=AS});var Nm=F(function(HP,Im){var zm=Dt(),FS=zm(Rt()),TS=zm(zt()),bt=function(){function e(t){(0,FS.default)(this,e),t(this._resolve.bind(this),this._reject.bind(this))}return(0,TS.default)(e,[{key:"catch",value:function(r){if(this.error)try{this._resolve(r(this.error))}catch(n){this._reject(n)}return this}},{key:"then",value:function(r,n){if(!this.error)try{this._resolve(r(this.value))}catch(o){this._reject(o)}if(n)this.catch(n);return this}},{key:"_reject",value:function(r){this.value=void 0,this.error=r}},{key:"_resolve",value:function(r){if(r instanceof e)if(r.error)this._reject(r.error);else this._resolve(r.value);else this.value=r,this.error=void 0}}]),e}();bt.all=function(e){return new bt(function(t){var r=e.map(function(n){while(n instanceof bt){if(n.error)throw Error(n.error);n=n.value}return n});t(r)})};bt.resolve=function(e){return new bt(function(t){return t(e)})};bt.reject=function(e){return new bt(function(t,r){return r(e)})};Im.exports=bt});var Mm=F(function(UP,Bm){var Lm=Dt(),PS=Lm(Rt()),RS=Lm(zt()),zS=km(),IS=Am(),NS=Rm(),LS=Nm(),BS=function(){function e(t,r){(0,PS.default)(this,e),this._grammar=t,this._exprStr=r,this._ast=null}return(0,RS.default)(e,[{key:"compile",value:function(){var r=new IS(this._grammar),n=new NS(this._grammar),o=r.tokenize(this._exprStr);return n.addTokens(o),this._ast=n.complete(),this}},{key:"eval",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._eval(r,Promise)}},{key:"evalSync",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this._eval(r,LS);if(n.error)throw n.error;return n.value}},{key:"_eval",value:function(r,n){var o=this;return n.resolve().then(function(){var s=o._getAst(),i=new zS(o._grammar,r,void 0,n);return i.eval(s)})}},{key:"_getAst",value:function(){if(!this._ast)this.compile();return this._ast}}]),e}();Bm.exports=BS});var Zm=F(function(MS){MS.getGrammar=function(){return{elements:{".":{type:"dot"},"[":{type:"openBracket"},"]":{type:"closeBracket"},"|":{type:"pipe"},"{":{type:"openCurl"},"}":{type:"closeCurl"},":":{type:"colon"},",":{type:"comma"},"(":{type:"openParen"},")":{type:"closeParen"},"?":{type:"question"},"+":{type:"binaryOp",precedence:30,eval:function(t,r){return t+r}},"-":{type:"binaryOp",precedence:30,eval:function(t,r){return t-r}},"*":{type:"binaryOp",precedence:40,eval:function(t,r){return t*r}},"/":{type:"binaryOp",precedence:40,eval:function(t,r){return t/r}},"//":{type:"binaryOp",precedence:40,eval:function(t,r){return Math.floor(t/r)}},"%":{type:"binaryOp",precedence:50,eval:function(t,r){return t%r}},"^":{type:"binaryOp",precedence:50,eval:function(t,r){return Math.pow(t,r)}},"==":{type:"binaryOp",precedence:20,eval:function(t,r){return t==r}},"!=":{type:"binaryOp",precedence:20,eval:function(t,r){return t!=r}},">":{type:"binaryOp",precedence:20,eval:function(t,r){return t>r}},">=":{type:"binaryOp",precedence:20,eval:function(t,r){return t>=r}},"<":{type:"binaryOp",precedence:20,eval:function(t,r){return t<r}},"<=":{type:"binaryOp",precedence:20,eval:function(t,r){return t<=r}},"&&":{type:"binaryOp",precedence:10,evalOnDemand:function(t,r){return t.eval().then(function(n){if(!n)return n;return r.eval()})}},"||":{type:"binaryOp",precedence:10,evalOnDemand:function(t,r){return t.eval().then(function(n){if(n)return n;return r.eval()})}},in:{type:"binaryOp",precedence:20,eval:function(t,r){if(typeof r==="string")return r.indexOf(t)!==-1;if(Array.isArray(r))return r.some(function(n){return n===t});return!1}},"!":{type:"unaryOp",precedence:1/0,eval:function(t){return!t}}},functions:{},transforms:{}}}});var Hm=F(function(WP,Bi){var Li=Dt(),jS=Li(mm()),HS=Li(Rt()),US=Li(zt()),GS=Mm(),WS=Zm(),qS=WS.getGrammar,jm=function(){function e(){(0,HS.default)(this,e),this.expr=this.expr.bind(this),this._grammar=qS()}return(0,US.default)(e,[{key:"addBinaryOp",value:function(r,n,o,s){this._addGrammarElement(r,(0,jS.default)({type:"binaryOp",precedence:n},s?"evalOnDemand":"eval",o))}},{key:"addFunction",value:function(r,n){this._grammar.functions[r]=n}},{key:"addFunctions",value:function(r){for(var n in r)this._grammar.functions[n]=r[n]}},{key:"addUnaryOp",value:function(r,n){this._addGrammarElement(r,{type:"unaryOp",weight:1/0,eval:n})}},{key:"addTransform",value:function(r,n){this._grammar.transforms[r]=n}},{key:"addTransforms",value:function(r){for(var n in r)this._grammar.transforms[n]=r[n]}},{key:"compile",value:function(r){var n=this.createExpression(r);return n.compile()}},{key:"createExpression",value:function(r){return new GS(this._grammar,r)}},{key:"getFunction",value:function(r){return this._grammar.functions[r]}},{key:"getTransform",value:function(r){return this._grammar.transforms[r]}},{key:"eval",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.createExpression(r);return o.eval(n)}},{key:"evalSync",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.createExpression(r);return o.evalSync(n)}},{key:"expr",value:function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];var i=r.reduce(function(u,a,c){var l=c<o.length?o[c]:"";return u+=a+l,u},"");return this.createExpression(i)}},{key:"removeOp",value:function(r){if(this._grammar.elements[r]&&(this._grammar.elements[r].type==="binaryOp"||this._grammar.elements[r].type==="unaryOp"))delete this._grammar.elements[r]}},{key:"_addGrammarElement",value:function(r,n){this._grammar.elements[r]=n}}]),e}();Bi.exports=new jm;Bi.exports.Jexl=jm});var mo=F(function(aR,qm){var Zi=[],Wm=0,Ee=(e,t)=>{if(Wm>=t)Zi.push(e)};Ee.WARN=1;Ee.INFO=2;Ee.DEBUG=3;Ee.reset=()=>{Zi=[]};Ee.setDebugLevel=(e)=>{Wm=e};Ee.warn=(e)=>Ee(e,Ee.WARN);Ee.info=(e)=>Ee(e,Ee.INFO);Ee.debug=(e)=>Ee(e,Ee.DEBUG);Ee.debugMessages=()=>Zi;qm.exports=Ee});var Jm=F(function(cR,Vm){Vm.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Ym=F(function(lR,Km){var n$=Jm();Km.exports=(e)=>typeof e==="string"?e.replace(n$(),""):e});var Qm=F(function(pR,ji){var Xm=(e)=>{if(Number.isNaN(e))return!1;if(e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141))return!0;return!1};ji.exports=Xm;ji.exports.default=Xm});var tg=F(function(fR,eg){eg.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var ng=F(function(hR,Hi){var o$=Ym(),s$=Qm(),i$=tg(),rg=(e)=>{if(typeof e!=="string"||e.length===0)return 0;if(e=o$(e),e.length===0)return 0;e=e.replace(i$()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);if(n<=31||n>=127&&n<=159)continue;if(n>=768&&n<=879)continue;if(n>65535)r++;t+=s$(n)?2:1}return t};Hi.exports=rg;Hi.exports.default=rg});var Ui=F(function(dR,ug){var og=ng();function go(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function rt(e){let t=go();return(""+e).replace(t,"").split(`
9
+ `).reduce(function(o,s){return og(s)>o?og(s):o},0)}function Qr(e,t){return Array(t+1).join(e)}function u$(e,t,r,n){let o=rt(e);if(t+1>=o){let s=t-o;switch(n){case"right":{e=Qr(r,s)+e;break}case"center":{let i=Math.ceil(s/2),u=s-i;e=Qr(r,u)+e+Qr(r,i);break}default:{e=e+Qr(r,s);break}}}return e}var or={};function en(e,t,r){t="\x1B["+t+"m",r="\x1B["+r+"m",or[t]={set:e,to:!0},or[r]={set:e,to:!1},or[e]={on:t,off:r}}en("bold",1,22);en("italics",3,23);en("underline",4,24);en("inverse",7,27);en("strikethrough",9,29);function sg(e,t){let r=t[1]?parseInt(t[1].split(";")[0]):0;if(r>=30&&r<=39||r>=90&&r<=97){e.lastForegroundAdded=t[0];return}if(r>=40&&r<=49||r>=100&&r<=107){e.lastBackgroundAdded=t[0];return}if(r===0){for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))delete e[o];return}let n=or[t[0]];if(n)e[n.set]=n.to}function a$(e){let t=go(!0),r=t.exec(e),n={};while(r!==null)sg(n,r),r=t.exec(e);return n}function ig(e,t){let{lastBackgroundAdded:r,lastForegroundAdded:n}=e;if(delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(o){if(e[o])t+=or[o].off}),r&&r!="\x1B[49m")t+="\x1B[49m";if(n&&n!="\x1B[39m")t+="\x1B[39m";return t}function c$(e,t){let{lastBackgroundAdded:r,lastForegroundAdded:n}=e;if(delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(o){if(e[o])t=or[o].on+t}),r&&r!="\x1B[49m")t=r+t;if(n&&n!="\x1B[39m")t=n+t;return t}function l$(e,t){if(e.length===rt(e))return e.substr(0,t);while(rt(e)>t)e=e.slice(0,-1);return e}function p$(e,t){let r=go(!0),n=e.split(go()),o=0,s=0,i="",u,a={};while(s<t){u=r.exec(e);let c=n[o];if(o++,s+rt(c)>t)c=l$(c,t-s);if(i+=c,s+=rt(c),s<t){if(!u)break;i+=u[0],sg(a,u)}}return ig(a,i)}function f$(e,t,r){if(r=r||"\u2026",rt(e)<=t)return e;t-=rt(r);let o=p$(e,t);o+=r;let s="\x1B]8;;\x07";if(e.includes(s)&&!o.includes(s))o+=s;return o}function h$(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function d$(e,t){e=e||{},t=t||h$();let r=Object.assign({},t,e);return r.chars=Object.assign({},t.chars,e.chars),r.style=Object.assign({},t.style,e.style),r}function m$(e,t){let r=[],n=t.split(/(\s+)/g),o=[],s=0,i;for(let u=0;u<n.length;u+=2){let a=n[u],c=s+rt(a);if(s>0&&i)c+=i.length;if(c>e){if(s!==0)r.push(o.join(""));o=[a],s=rt(a)}else o.push(i||"",a),s=c;i=n[u+1]}if(s)r.push(o.join(""));return r}function g$(e,t){let r=[],n="";function o(i,u){if(n.length&&u)n+=u;n+=i;while(n.length>e)r.push(n.slice(0,e)),n=n.slice(e)}let s=t.split(/(\s+)/g);for(let i=0;i<s.length;i+=2)o(s[i],i&&s[i-1]);if(n.length)r.push(n);return r}function _$(e,t,r=!0){let n=[];t=t.split(`
10
+ `);let o=r?m$:g$;for(let s=0;s<t.length;s++)n.push.apply(n,o(e,t[s]));return n}function y$(e){let t={},r=[];for(let n=0;n<e.length;n++){let o=c$(t,e[n]);t=a$(o);let s=Object.assign({},t);r.push(ig(s,o))}return r}function D$(e,t){return["\x1B]","8",";",";",e||t,"\x07",t,"\x1B]","8",";",";","\x07"].join("")}ug.exports={strlen:rt,repeat:Qr,pad:u$,truncate:f$,mergeOptions:d$,wordWrap:_$,colorizeLines:y$,hyperlink:D$}});var pg=F(function(mR,lg){var cg={};lg.exports=cg;var ag={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(ag).forEach(function(e){var t=ag[e],r=cg[e]=[];r.open="\x1B["+t[0]+"m",r.close="\x1B["+t[1]+"m"})});var hg=F(function(gR,fg){fg.exports=function(e,t){t=t||process.argv;var r=t.indexOf("--"),n=/^-{1,2}/.test(e)?"":"--",o=t.indexOf(n+e);return o!==-1&&(r===-1?!0:o<r)}});var mg=F(function(_R,dg){var b$=Lt("os"),Je=hg(),Ae=process.env,sr=void 0;if(Je("no-color")||Je("no-colors")||Je("color=false"))sr=!1;else if(Je("color")||Je("colors")||Je("color=true")||Je("color=always"))sr=!0;if("FORCE_COLOR"in Ae)sr=Ae.FORCE_COLOR.length===0||parseInt(Ae.FORCE_COLOR,10)!==0;function x$(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function v$(e){if(sr===!1)return 0;if(Je("color=16m")||Je("color=full")||Je("color=truecolor"))return 3;if(Je("color=256"))return 2;if(e&&!e.isTTY&&sr!==!0)return 0;var t=sr?1:0;if(process.platform==="win32"){var r=b$.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(r[0])>=10&&Number(r[2])>=10586)return Number(r[2])>=14931?3:2;return 1}if("CI"in Ae){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(o){return o in Ae})||Ae.CI_NAME==="codeship")return 1;return t}if("TEAMCITY_VERSION"in Ae)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ae.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ae){var n=parseInt((Ae.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ae.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Ae.TERM))return 2;if(/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ae.TERM))return 1;if("COLORTERM"in Ae)return 1;if(Ae.TERM==="dumb")return t;return t}function Gi(e){var t=v$(e);return x$(t)}dg.exports={supportsColor:Gi,stdout:Gi(process.stdout),stderr:Gi(process.stderr)}});var _g=F(function(yR,gg){gg.exports=function(t,r){var n="";t=t||"Run the trap, drop the bass",t=t.split("");var o={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return t.forEach(function(s){s=s.toLowerCase();var i=o[s]||[" "],u=Math.floor(Math.random()*i.length);if(typeof o[s]<"u")n+=o[s][u];else n+=s}),n}});var Dg=F(function(DR,yg){yg.exports=function(t,r){t=t||" he is here ";var n={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},o=[].concat(n.up,n.down,n.mid);function s(a){var c=Math.floor(Math.random()*a);return c}function i(a){var c=!1;return o.filter(function(l){c=l===a}),c}function u(a,c){var l="",p,f;c=c||{},c.up=typeof c.up<"u"?c.up:!0,c.mid=typeof c.mid<"u"?c.mid:!0,c.down=typeof c.down<"u"?c.down:!0,c.size=typeof c.size<"u"?c.size:"maxi",a=a.split("");for(f in a){if(i(f))continue;switch(l=l+a[f],p={up:0,down:0,mid:0},c.size){case"mini":p.up=s(8),p.mid=s(2),p.down=s(8);break;case"maxi":p.up=s(16)+3,p.mid=s(4)+1,p.down=s(64)+3;break;default:p.up=s(8)+1,p.mid=s(6)/2,p.down=s(8)+1;break}var h=["up","mid","down"];for(var d in h){var m=h[d];for(var b=0;b<=p[m];b++)if(c[m])l=l+n[m][s(n[m].length)]}}return l}return u(t,r)}});var xg=F(function(bR,bg){bg.exports=function(e){return function(t,r,n){if(t===" ")return t;switch(r%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}});var wg=F(function(xR,vg){vg.exports=function(e){return function(t,r,n){return r%2===0?t:e.inverse(t)}}});var Eg=F(function(vR,Cg){Cg.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(r,n,o){if(r===" ")return r;else return e[t[n++%t.length]](r)}}});var Sg=F(function(wR,kg){kg.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(r,n,o){return r===" "?r:e[t[Math.round(Math.random()*(t.length-2))]](r)}}});var Tg=F(function(ER,Fg){var H={};Fg.exports=H;H.themes={};var w$=Lt("util"),It=H.styles=pg(),$g=Object.defineProperties,C$=new RegExp(/[\r\n]+/g);H.supportsColor=mg().supportsColor;if(typeof H.enabled>"u")H.enabled=H.supportsColor()!==!1;H.enable=function(){H.enabled=!0};H.disable=function(){H.enabled=!1};H.stripColors=H.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var CR=H.stylize=function(t,r){if(!H.enabled)return t+"";var n=It[r];if(!n&&r in H)return H[r](t);return n.open+t+n.close},E$=/[|\\{}()[\]^$+*?.]/g,k$=function(e){if(typeof e!=="string")throw TypeError("Expected a string");return e.replace(E$,"\\$&")};function Og(e){var t=function r(){return $$.apply(r,arguments)};return t._styles=e,t.__proto__=S$,t}var Ag=function(){var e={};return It.grey=It.gray,Object.keys(It).forEach(function(t){It[t].closeRe=new RegExp(k$(It[t].close),"g"),e[t]={get:function(){return Og(this._styles.concat(t))}}}),e}(),S$=$g(function(){},Ag);function $$(){var e=Array.prototype.slice.call(arguments),t=e.map(function(i){if(i!=null&&i.constructor===String)return i;else return w$.inspect(i)}).join(" ");if(!H.enabled||!t)return t;var r=t.indexOf(`
11
+ `)!=-1,n=this._styles,o=n.length;while(o--){var s=It[n[o]];if(t=s.open+t.replace(s.closeRe,s.open)+s.close,r)t=t.replace(C$,function(i){return s.close+i+s.open})}return t}H.setTheme=function(e){if(typeof e==="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(r){H[r]=function(n){if(typeof e[r]==="object"){var o=n;for(var s in e[r])o=H[e[r][s]](o);return o}return H[e[r]](n)}})(t)};function O$(){var e={};return Object.keys(Ag).forEach(function(t){e[t]={get:function(){return Og([t])}}}),e}var A$=function(t,r){var n=r.split("");return n=n.map(t),n.join("")};H.trap=_g();H.zalgo=Dg();H.maps={};H.maps.america=xg()(H);H.maps.zebra=wg()(H);H.maps.rainbow=Eg()(H);H.maps.random=Sg()(H);for(Wi in H.maps)(function(e){H[e]=function(t){return A$(H.maps[e],t)}})(Wi);var Wi;$g(H,O$())});var Rg=F(function(kR,Pg){var F$=Tg();Pg.exports=F$});var Lg=F(function(SR,Do){var{info:T$,debug:Ng}=mo(),je=Ui();class tn{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){if(["boolean","number","bigint","string"].indexOf(typeof e)!==-1)e={content:""+e};e=e||{},this.options=e;let t=e.content;if(["boolean","number","bigint","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw Error("Content needs to be a primitive, got: "+typeof t);if(this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href)Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let r=this.options.chars||{},n=e.chars,o=this.chars={};R$.forEach(function(u){qi(r,n,u,o)}),this.truncate=this.options.truncate||e.truncate;let s=this.options.style=this.options.style||{},i=e.style;qi(s,i,"padding-left",this),qi(s,i,"padding-right",this),this.head=s.head||i.head,this.border=s.border||i.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=je.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:r=t}=this.options;if(this.fixedWidth&&r){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let s=1;while(s<this.colSpan)this.fixedWidth+=e.colWidths[this.x+s],s++}let{wrapOnWordBoundary:n=!0}=e,{wrapOnWordBoundary:o=n}=this.options;return this.wrapLines(je.wordWrap(this.fixedWidth,this.content,o))}return this.wrapLines(this.content.split(`
12
+ `))}wrapLines(e){let t=je.colorizeLines(e);if(this.href)return t.map((r)=>je.hyperlink(this.href,r));return t}init(e){let t=this.x,r=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(r,r+this.rowSpan),this.width=this.widths.reduce(Ig,-1),this.height=this.heights.reduce(Ig,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[r],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let r=je.truncate(this.content,10,this.truncate);if(!e)T$(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${r}`);let n=Math.max(this.height-this.lines.length,0),o;switch(this.vAlign){case"center":o=Math.ceil(n/2);break;case"bottom":o=n;break;default:o=0}if(e<o||e>=o+this.lines.length)return this.drawEmpty(this.drawRight,t);let s=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-o,this.drawRight,s,t)}drawTop(e){let t=[];if(this.cells)this.widths.forEach(function(r,n){t.push(this._topLeftChar(n)),t.push(je.repeat(this.chars[this.y==0?"top":"mid"],r))},this);else t.push(this._topLeftChar(0)),t.push(je.repeat(this.chars[this.y==0?"top":"mid"],this.width));if(e)t.push(this.chars[this.y==0?"topRight":"rightMid"]);return this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,r;if(this.y==0)r=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)r="leftMid";else if(r=e==0?"midMid":"bottomMid",this.cells){if(this.cells[this.y-1][t]instanceof tn.ColSpanCell)r=e==0?"topMid":"mid";if(e==0){let o=1;while(this.cells[this.y][t-o]instanceof tn.ColSpanCell)o++;if(this.cells[this.y][t-o]instanceof tn.RowSpanCell)r="leftMid"}}return this.chars[r]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let r=Rg();for(let n=this[e].length-1;n>=0;n--)r=r[this[e][n]];return r(t)}catch(r){return t}else return t}drawLine(e,t,r,n){let o=this.chars[this.x==0?"left":"middle"];if(this.x&&n&&this.cells){let p=this.cells[this.y+n][this.x-1];while(p instanceof _o)p=this.cells[p.y][p.x-1];if(!(p instanceof yo))o=this.chars.rightMid}let s=je.repeat(" ",this.paddingLeft),i=t?this.chars.right:"",u=je.repeat(" ",this.paddingRight),a=this.lines[e],c=this.width-(this.paddingLeft+this.paddingRight);if(r)a+=this.truncate||"\u2026";let l=je.truncate(a,c,this.truncate);return l=je.pad(l,c," ",this.hAlign),l=s+l+u,this.stylizeLine(o,l,i)}stylizeLine(e,t,r){if(e=this.wrapWithStyleColors("border",e),r=this.wrapWithStyleColors("border",r),this.y===0)t=this.wrapWithStyleColors("head",t);return e+t+r}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],r=je.repeat(this.chars.bottom,this.width),n=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+r+n)}drawEmpty(e,t){let r=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let s=this.cells[this.y+t][this.x-1];while(s instanceof _o)s=this.cells[s.y][s.x-1];if(!(s instanceof yo))r=this.chars.rightMid}let n=e?this.chars.right:"",o=je.repeat(" ",this.width);return this.stylizeLine(r,o,n)}}class _o{constructor(){}draw(e){if(typeof e==="number")Ng(`${this.y}-${this.x}: 1x1 ColSpanCell`);return""}init(){}mergeTableOptions(){}}class yo{constructor(e){this.originalCell=e}init(e){let t=this.y,r=this.originalCell.y;this.cellOffset=t-r,this.offset=P$(e.rowHeights,r,this.cellOffset)}draw(e){if(e=="top")return this.originalCell.draw(this.offset,this.cellOffset);if(e=="bottom")return this.originalCell.draw("bottom");return Ng(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e)}mergeTableOptions(){}}function zg(...e){return e.filter((t)=>t!==void 0&&t!==null).shift()}function qi(e,t,r,n){let o=r.split("-");if(o.length>1)o[1]=o[1].charAt(0).toUpperCase()+o[1].substr(1),o=o.join(""),n[o]=zg(e[o],e[r],t[o],t[r]);else n[r]=zg(e[r],t[r])}function P$(e,t,r){let n=e[t];for(let o=1;o<r;o++)n+=1+e[t+o];return n}function Ig(e,t){return e+t+1}var R$=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];Do.exports=tn;Do.exports.ColSpanCell=_o;Do.exports.RowSpanCell=yo});var Zg=F(function($R,Mg){var{warn:z$,debug:I$}=mo(),Vi=Lg(),{ColSpanCell:N$,RowSpanCell:L$}=Vi;(function(){function e(h,d){if(h[d]>0)return e(h,d+1);return d}function t(h){let d={};h.forEach(function(m,b){let A=0;m.forEach(function(v){v.y=b,v.x=b?e(d,A):A;let j=v.rowSpan||1,G=v.colSpan||1;if(j>1)for(let N=0;N<G;N++)d[v.x+N]=j;A=v.x+G}),Object.keys(d).forEach((v)=>{if(d[v]--,d[v]<1)delete d[v]})})}function r(h){let d=0;return h.forEach(function(m){m.forEach(function(b){d=Math.max(d,b.x+(b.colSpan||1))})}),d}function n(h){return h.length}function o(h,d){let m=h.y,b=h.y-1+(h.rowSpan||1),A=d.y,v=d.y-1+(d.rowSpan||1),j=!(m>v||A>b),G=h.x,N=h.x-1+(h.colSpan||1),T=d.x,L=d.x-1+(d.colSpan||1),P=!(G>L||T>N);return j&&P}function s(h,d,m){let b=Math.min(h.length-1,m),A={x:d,y:m};for(let v=0;v<=b;v++){let j=h[v];for(let G=0;G<j.length;G++)if(o(A,j[G]))return!0}return!1}function i(h,d,m,b){for(let A=m;A<b;A++)if(s(h,A,d))return!1;return!0}function u(h){h.forEach(function(d,m){d.forEach(function(b){for(let A=1;A<b.rowSpan;A++){let v=new L$(b);v.x=b.x,v.y=b.y+A,v.colSpan=b.colSpan,c(v,h[m+A])}})})}function a(h){for(let d=h.length-1;d>=0;d--){let m=h[d];for(let b=0;b<m.length;b++){let A=m[b];for(let v=1;v<A.colSpan;v++){let j=new N$;j.x=A.x+v,j.y=A.y,m.splice(b+1,0,j)}}}}function c(h,d){let m=0;while(m<d.length&&d[m].x<h.x)m++;d.splice(m,0,h)}function l(h){let d=n(h),m=r(h);I$(`Max rows: ${d}; Max cols: ${m}`);for(let b=0;b<d;b++)for(let A=0;A<m;A++)if(!s(h,A,b)){let v={x:A,y:b,colSpan:1,rowSpan:1};A++;while(A<m&&!s(h,A,b))v.colSpan++,A++;let j=b+1;while(j<d&&i(h,j,v.x,v.x+v.colSpan))v.rowSpan++,j++;let G=new Vi(v);G.x=v.x,G.y=v.y,z$(`Missing cell at ${G.y}-${G.x}.`),c(G,h[b])}}function p(h){return h.map(function(d){if(!Array.isArray(d)){let m=Object.keys(d)[0];if(d=d[m],Array.isArray(d))d=d.slice(),d.unshift(m);else d=[m,d]}return d.map(function(m){return new Vi(m)})})}function f(h){let d=p(h);return t(d),l(d),u(d),a(d),d}Mg.exports={makeTableLayout:f,layoutTable:t,addRowSpanCells:u,maxWidth:r,fillInTable:l,computeWidths:Bg("colSpan","desiredWidth","x",1),computeHeights:Bg("rowSpan","desiredHeight","y",1)}})();function Bg(e,t,r,n){return function(o,s){let i=[],u=[],a={};s.forEach(function(c){c.forEach(function(l){if((l[e]||1)>1)u.push(l);else i[l[r]]=Math.max(i[l[r]]||0,l[t]||0,n)})}),o.forEach(function(c,l){if(typeof c==="number")i[l]=c});for(let c=u.length-1;c>=0;c--){let l=u[c],p=l[e],f=l[r],h=i[f],d=typeof o[f]==="number"?0:1;if(typeof h==="number"){for(let m=1;m<p;m++)if(h+=1+i[f+m],typeof o[f+m]!=="number")d++}else if(h=t==="desiredWidth"?l.desiredWidth-1:1,!a[f]||a[f]<h)a[f]=h;if(l[t]>h){let m=0;while(d>0&&l[t]>h){if(typeof o[f+m]!=="number"){let b=Math.round((l[t]-h)/d);h+=b,i[f+m]+=b,d--}m++}}}Object.assign(o,i,a);for(let c=0;c<o.length;c++)o[c]=Math.max(n,o[c]||0)}}});var Hg=F(function(OR,jg){var ct=mo(),B$=Ui(),Ki=Zg();class Yi extends Array{constructor(e){super();let t=B$.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":ct.setDebugLevel(ct.WARN);break;case"number":ct.setDebugLevel(t.debug);break;case"string":ct.setDebugLevel(parseInt(t.debug,10));break;default:ct.setDebugLevel(ct.WARN),ct.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return ct.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;if(t){if(e=[this.options.head],this.length)e.push.apply(e,this)}else this.options.style.head=[];let r=Ki.makeTableLayout(e);r.forEach(function(o){o.forEach(function(s){s.mergeTableOptions(this.options,r)},this)},this),Ki.computeWidths(this.options.colWidths,r),Ki.computeHeights(this.options.rowHeights,r),r.forEach(function(o){o.forEach(function(s){s.init(this.options)},this)},this);let n=[];for(let o=0;o<r.length;o++){let s=r[o],i=this.options.rowHeights[o];if(o===0||!this.options.style.compact||o==1&&t)Ji(s,"top",n);for(let u=0;u<i;u++)Ji(s,u,n);if(o+1==r.length)Ji(s,"bottom",n)}return n.join(`
12
13
  `)}get width(){return this.toString().split(`
13
- `)[0].length}}Fi.reset=()=>it.reset();function Oi(e,t,r){let n=[];e.forEach(function(s){n.push(s.draw(t))});let o=n.join("");if(o.length)r.push(o)}Ym.exports=Fi});class _t extends Error{constructor(e,t,r){super(r);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}class Ye extends _t{constructor(e){super(1,"commander.invalidArgument",e);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}class Ur{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(e,t){if(t===this.defaultValue||!Array.isArray(t))return[e];return t.push(e),t}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Ye(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(t,r);return t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Gr(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as Qg}from"events";import co from"child_process";import nt from"path";import Vr from"fs";import q from"process";import{stripVTControlCharacters as eD}from"util";import{stripVTControlCharacters as Kg}from"util";class Wr{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter((n)=>!n._hidden),r=e._getHelpCommand();if(r&&!r._hidden)t.push(r);if(this.sortSubcommands)t.sort((n,o)=>n.name().localeCompare(o.name()));return t}compareOptions(e,t){let r=(n)=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter((n)=>!n.hidden),r=e._getHelpOption();if(r&&!r.hidden){let n=r.short&&e._findOption(r.short),o=r.long&&e._findOption(r.long);if(!n&&!o)t.push(r);else if(r.long&&!o)t.push(e.createOption(r.long,r.description));else if(r.short&&!n)t.push(e.createOption(r.short,r.description))}if(this.sortOptions)t.sort(this.compareOptions);return t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let n=r.options.filter((o)=>!o.hidden);t.push(...n)}if(this.sortOptions)t.sort(this.compareOptions);return t}visibleArguments(e){if(e._argsDescription)e.registeredArguments.forEach((t)=>{t.description=t.description||e._argsDescription[t.name()]||""});if(e.registeredArguments.find((t)=>t.description))return e.registeredArguments;return[]}subcommandTerm(e){let t=e.registeredArguments.map((r)=>Gr(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;if(e._aliases[0])t=t+"|"+e._aliases[0];let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices)t.push(`choices: ${e.argChoices.map((r)=>JSON.stringify(r)).join(", ")}`);if(e.defaultValue!==void 0){if(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==="boolean")t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(e.presetArg!==void 0&&e.optional)t.push(`preset: ${JSON.stringify(e.presetArg)}`);if(e.envVar!==void 0)t.push(`env: ${e.envVar}`);if(t.length>0){let r=`(${t.join(", ")})`;if(e.description)return`${e.description} ${r}`;return r}return e.description}argumentDescription(e){let t=[];if(e.argChoices)t.push(`choices: ${e.argChoices.map((r)=>JSON.stringify(r)).join(", ")}`);if(e.defaultValue!==void 0)t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`);if(t.length>0){let r=`(${t.join(", ")})`;if(e.description)return`${e.description} ${r}`;return r}return e.description}formatItemList(e,t,r){if(t.length===0)return[];return[r.styleTitle(e),...t,""]}groupItems(e,t,r){let n=new Map;return e.forEach((o)=>{let s=r(o);if(!n.has(s))n.set(s,[])}),t.forEach((o)=>{let s=r(o);if(!n.has(s))n.set(s,[]);n.get(s).push(o)}),n}formatHelp(e,t){let r=t.padWidth(e,t),n=t.helpWidth??80;function o(l,p){return t.formatItem(l,r,p,t)}let s=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],i=t.commandDescription(e);if(i.length>0)s=s.concat([t.boxWrap(t.styleCommandDescription(i),n),""]);let u=t.visibleArguments(e).map((l)=>o(t.styleArgumentTerm(t.argumentTerm(l)),t.styleArgumentDescription(t.argumentDescription(l))));if(s=s.concat(this.formatItemList("Arguments:",u,t)),this.groupItems(e.options,t.visibleOptions(e),(l)=>l.helpGroupHeading??"Options:").forEach((l,p)=>{let f=l.map((h)=>o(t.styleOptionTerm(t.optionTerm(h)),t.styleOptionDescription(t.optionDescription(h))));s=s.concat(this.formatItemList(p,f,t))}),t.showGlobalOptions){let l=t.visibleGlobalOptions(e).map((p)=>o(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));s=s.concat(this.formatItemList("Global Options:",l,t))}return this.groupItems(e.commands,t.visibleCommands(e),(l)=>l.helpGroup()||"Commands:").forEach((l,p)=>{let f=l.map((h)=>o(t.styleSubcommandTerm(t.subcommandTerm(h)),t.styleSubcommandDescription(t.subcommandDescription(h))));s=s.concat(this.formatItemList(p,f,t))}),s.join(`
14
- `)}displayWidth(e){return Kg(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map((t)=>{if(t==="[options]")return this.styleOptionText(t);if(t==="[command]")return this.styleSubcommandText(t);if(t[0]==="["||t[0]==="<")return this.styleArgumentText(t);return this.styleCommandText(t)}).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map((t)=>{if(t==="[options]")return this.styleOptionText(t);if(t[0]==="["||t[0]==="<")return this.styleArgumentText(t);return this.styleSubcommandText(t)}).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,n){let s=" ".repeat(2);if(!r)return s+e;let i=e.padEnd(t+e.length-n.displayWidth(e)),u=2,c=(this.helpWidth??80)-t-u-2,l;if(c<this.minWidthToWrap||n.preformatted(r))l=r;else l=n.boxWrap(r,c).replace(/\n/g,`
14
+ `)[0].length}}Yi.reset=()=>ct.reset();function Ji(e,t,r){let n=[];e.forEach(function(s){n.push(s.draw(t))});let o=n.join("");if(o.length)r.push(o)}jg.exports=Yi});class vt extends Error{constructor(e,t,r){super(r);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}class Xe extends vt{constructor(e){super(1,"commander.invalidArgument",e);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}class sn{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(e,t){if(t===this.defaultValue||!Array.isArray(t))return[e];return t.push(e),t}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Xe(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(t,r);return t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function un(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as J_}from"events";import ko from"child_process";import st from"path";import cn from"fs";import q from"process";import{stripVTControlCharacters as K_}from"util";import{stripVTControlCharacters as W_}from"util";class an{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter((n)=>!n._hidden),r=e._getHelpCommand();if(r&&!r._hidden)t.push(r);if(this.sortSubcommands)t.sort((n,o)=>n.name().localeCompare(o.name()));return t}compareOptions(e,t){let r=(n)=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter((n)=>!n.hidden),r=e._getHelpOption();if(r&&!r.hidden){let n=r.short&&e._findOption(r.short),o=r.long&&e._findOption(r.long);if(!n&&!o)t.push(r);else if(r.long&&!o)t.push(e.createOption(r.long,r.description));else if(r.short&&!n)t.push(e.createOption(r.short,r.description))}if(this.sortOptions)t.sort(this.compareOptions);return t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let n=r.options.filter((o)=>!o.hidden);t.push(...n)}if(this.sortOptions)t.sort(this.compareOptions);return t}visibleArguments(e){if(e._argsDescription)e.registeredArguments.forEach((t)=>{t.description=t.description||e._argsDescription[t.name()]||""});if(e.registeredArguments.find((t)=>t.description))return e.registeredArguments;return[]}subcommandTerm(e){let t=e.registeredArguments.map((r)=>un(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(n)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(n)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,n)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(n)))),0)}commandUsage(e){let t=e._name;if(e._aliases[0])t=t+"|"+e._aliases[0];let r="";for(let n=e.parent;n;n=n.parent)r=n.name()+" "+r;return r+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices)t.push(`choices: ${e.argChoices.map((r)=>JSON.stringify(r)).join(", ")}`);if(e.defaultValue!==void 0){if(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue==="boolean")t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}if(e.presetArg!==void 0&&e.optional)t.push(`preset: ${JSON.stringify(e.presetArg)}`);if(e.envVar!==void 0)t.push(`env: ${e.envVar}`);if(t.length>0){let r=`(${t.join(", ")})`;if(e.description)return`${e.description} ${r}`;return r}return e.description}argumentDescription(e){let t=[];if(e.argChoices)t.push(`choices: ${e.argChoices.map((r)=>JSON.stringify(r)).join(", ")}`);if(e.defaultValue!==void 0)t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`);if(t.length>0){let r=`(${t.join(", ")})`;if(e.description)return`${e.description} ${r}`;return r}return e.description}formatItemList(e,t,r){if(t.length===0)return[];return[r.styleTitle(e),...t,""]}groupItems(e,t,r){let n=new Map;return e.forEach((o)=>{let s=r(o);if(!n.has(s))n.set(s,[])}),t.forEach((o)=>{let s=r(o);if(!n.has(s))n.set(s,[]);n.get(s).push(o)}),n}formatHelp(e,t){let r=t.padWidth(e,t),n=t.helpWidth??80;function o(l,p){return t.formatItem(l,r,p,t)}let s=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],i=t.commandDescription(e);if(i.length>0)s=s.concat([t.boxWrap(t.styleCommandDescription(i),n),""]);let u=t.visibleArguments(e).map((l)=>o(t.styleArgumentTerm(t.argumentTerm(l)),t.styleArgumentDescription(t.argumentDescription(l))));if(s=s.concat(this.formatItemList("Arguments:",u,t)),this.groupItems(e.options,t.visibleOptions(e),(l)=>l.helpGroupHeading??"Options:").forEach((l,p)=>{let f=l.map((h)=>o(t.styleOptionTerm(t.optionTerm(h)),t.styleOptionDescription(t.optionDescription(h))));s=s.concat(this.formatItemList(p,f,t))}),t.showGlobalOptions){let l=t.visibleGlobalOptions(e).map((p)=>o(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));s=s.concat(this.formatItemList("Global Options:",l,t))}return this.groupItems(e.commands,t.visibleCommands(e),(l)=>l.helpGroup()||"Commands:").forEach((l,p)=>{let f=l.map((h)=>o(t.styleSubcommandTerm(t.subcommandTerm(h)),t.styleSubcommandDescription(t.subcommandDescription(h))));s=s.concat(this.formatItemList(p,f,t))}),s.join(`
15
+ `)}displayWidth(e){return W_(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map((t)=>{if(t==="[options]")return this.styleOptionText(t);if(t==="[command]")return this.styleSubcommandText(t);if(t[0]==="["||t[0]==="<")return this.styleArgumentText(t);return this.styleCommandText(t)}).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map((t)=>{if(t==="[options]")return this.styleOptionText(t);if(t[0]==="["||t[0]==="<")return this.styleArgumentText(t);return this.styleSubcommandText(t)}).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,r,n){let s=" ".repeat(2);if(!r)return s+e;let i=e.padEnd(t+e.length-n.displayWidth(e)),u=2,c=(this.helpWidth??80)-t-u-2,l;if(c<this.minWidthToWrap||n.preformatted(r))l=r;else l=n.boxWrap(r,c).replace(/\n/g,`
15
16
  `+" ".repeat(t+u));return s+i+" ".repeat(u)+l.replace(/\n/g,`
16
17
  ${s}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),n=/[\s]*[^\s]+/g,o=[];return r.forEach((s)=>{let i=s.match(n);if(i===null){o.push("");return}let u=[i.shift()],a=this.displayWidth(u[0]);i.forEach((c)=>{let l=this.displayWidth(c);if(a+l<=t){u.push(c),a+=l;return}o.push(u.join(""));let p=c.trimStart();u=[p],a=this.displayWidth(p)}),o.push(u.join(""))}),o.join(`
17
- `)}}class We{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=Yg(e);if(this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;if(typeof e==="string")t={[e]:!0};return this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){if(t===this.defaultValue||!Array.isArray(t))return[e];return t.push(e),t}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Ye(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(t,r);return t},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return Li(this.name().replace(/^no-/,""));return Li(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class uo{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((t)=>{if(t.negate)this.negativeOptions.set(t.attributeName(),t);else this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{if(this.positiveOptions.has(r))this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let n=this.negativeOptions.get(r).presetArg,o=n!==void 0?n:!1;return t.negate===(o===e)}}function Li(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Yg(e){let t,r,n=/^-[^-]$/,o=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(n.test(s[0]))t=s.shift();if(o.test(s[0]))r=s.shift();if(!t&&n.test(s[0]))t=s.shift();if(!t&&o.test(s[0]))t=r,r=s.shift();if(s[0].startsWith("-")){let i=s[0],u=`option creation failed due to '${i}' in option flags '${e}'`;if(/^-[^-][^-]/.test(i))throw Error(`${u}
18
+ `)}}class qe{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let r=q_(e);if(this.short=r.shortFlag,this.long=r.longFlag,this.negate=!1,this.long)this.negate=this.long.startsWith("--no-");this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;if(typeof e==="string")t={[e]:!0};return this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_collectValue(e,t){if(t===this.defaultValue||!Array.isArray(t))return[e];return t.push(e),t}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,r)=>{if(!this.argChoices.includes(t))throw new Xe(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(t,r);return t},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return iu(this.name().replace(/^no-/,""));return iu(this.name())}helpGroup(e){return this.helpGroupHeading=e,this}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class Co{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((t)=>{if(t.negate)this.negativeOptions.set(t.attributeName(),t);else this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,r)=>{if(this.positiveOptions.has(r))this.dualOptions.add(r)})}valueFromOption(e,t){let r=t.attributeName();if(!this.dualOptions.has(r))return!0;let n=this.negativeOptions.get(r).presetArg,o=n!==void 0?n:!1;return t.negate===(o===e)}}function iu(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function q_(e){let t,r,n=/^-[^-]$/,o=/^--[^-]/,s=e.split(/[ |,]+/).concat("guard");if(n.test(s[0]))t=s.shift();if(o.test(s[0]))r=s.shift();if(!t&&n.test(s[0]))t=s.shift();if(!t&&o.test(s[0]))t=r,r=s.shift();if(s[0].startsWith("-")){let i=s[0],u=`option creation failed due to '${i}' in option flags '${e}'`;if(/^-[^-][^-]/.test(i))throw Error(`${u}
18
19
  - a short flag is a single dash and a single character
19
20
  - either use a single dash and a single character (for a short flag)
20
21
  - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(n.test(i))throw Error(`${u}
21
22
  - too many short flags`);if(o.test(i))throw Error(`${u}
22
23
  - too many long flags`);throw Error(`${u}
23
- - unrecognised flag format`)}if(t===void 0&&r===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function Xg(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let s;if(e[o-1]===t[n-1])s=0;else s=1;if(r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+s),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1])r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1)}return r[e.length][t.length]}function ao(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");if(r)e=e.slice(2),t=t.map((i)=>i.slice(2));let n=[],o=3,s=0.4;if(t.forEach((i)=>{if(i.length<=1)return;let u=Xg(e,i),a=Math.max(e.length,i.length);if((a-u)/a>s){if(u<o)o=u,n=[i];else if(u===o)n.push(i)}}),n.sort((i,u)=>i.localeCompare(u)),r)n=n.map((i)=>`--${i}`);if(n.length>1)return`
24
+ - unrecognised flag format`)}if(t===void 0&&r===void 0)throw Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}function V_(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let s;if(e[o-1]===t[n-1])s=0;else s=1;if(r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+s),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1])r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1)}return r[e.length][t.length]}function Eo(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");if(r)e=e.slice(2),t=t.map((i)=>i.slice(2));let n=[],o=3,s=0.4;if(t.forEach((i)=>{if(i.length<=1)return;let u=V_(e,i),a=Math.max(e.length,i.length);if((a-u)/a>s){if(u<o)o=u,n=[i];else if(u===o)n.push(i)}}),n.sort((i,u)=>i.localeCompare(u)),r)n=n.map((i)=>`--${i}`);if(n.length>1)return`
24
25
  (Did you mean one of ${n.join(", ")}?)`;if(n.length===1)return`
25
- (Did you mean ${n[0]}?)`;return""}class U extends Qg{constructor(e){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(t)=>q.stdout.write(t),writeErr:(t)=>q.stderr.write(t),outputError:(t,r)=>r(t),getOutHelpWidth:()=>q.stdout.isTTY?q.stdout.columns:void 0,getErrHelpWidth:()=>q.stderr.isTTY?q.stderr.columns:void 0,getOutHasColors:()=>Bi()??(q.stdout.isTTY&&q.stdout.hasColors?.()),getErrHasColors:()=>Bi()??(q.stderr.isTTY&&q.stderr.hasColors?.()),stripColor:(t)=>eD(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,o=r;if(typeof n==="object"&&n!==null)o=n,n=null;o=o||{};let[,s,i]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);if(n)u.description(n),u._executableHandler=!0;if(o.isDefault)this._defaultCommandName=u._name;if(u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,i)u.arguments(i);if(this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),n)return this;return u}createCommand(e){return new U(e)}createHelp(){return Object.assign(new Wr,this.configureHelp())}configureHelp(e){if(e===void 0)return this._helpConfiguration;return this._helpConfiguration=e,this}configureOutput(e){if(e===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...e},this}showHelpAfterError(e=!0){if(typeof e!=="string")e=!!e;return this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
26
- - specify the name in Command constructor or using .name()`);if(t=t||{},t.isDefault)this._defaultCommandName=e._name;if(t.noHelp||t.hidden)e._hidden=!0;return this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new Ur(e,t)}argument(e,t,r,n){let o=this.createArgument(e,t);if(typeof r==="function")o.default(n).argParser(r);else o.default(r);return this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach((t)=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==="boolean"){if(this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let r=e??"help [command]",[,n,o]=r.match(/([^ ]+) *(.*)/),s=t??"display help for command",i=this.createCommand(n);if(i.helpOption(!1),o)i.arguments(o);if(s)i.description(s);if(this._addImplicitHelpCommand=!0,this._helpCommand=i,e||t)this._initCommandGroup(i);return this}addHelpCommand(e,t){if(typeof e!=="object")return this.helpCommand(e,t),this;return this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
27
- Expecting one of '${r.join("', '")}'`);if(this._lifeCycleHooks[e])this._lifeCycleHooks[e].push(t);else this._lifeCycleHooks[e]=[t];return this}exitOverride(e){if(e)this._exitCallback=e;else this._exitCallback=(t)=>{if(t.code!=="commander.executeSubCommandAsync")throw t};return this}_exit(e,t,r){if(this._exitCallback)this._exitCallback(new _t(e,t,r));q.exit(e)}action(e){let t=(r)=>{let n=this.registeredArguments.length,o=r.slice(0,n);if(this._storeOptionsAsProperties)o[n]=this;else o[n]=this.opts();return o.push(this),e.apply(this,o)};return this._actionHandler=t,this}createOption(e,t){return new We(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${n} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
28
- - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=(n)=>[n.name()].concat(n.aliases()),r=t(e).find((n)=>this._findCommand(n));if(r){let n=t(this._findCommand(r)).join("|"),o=t(e).join("|");throw Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.defaultValue!==void 0)this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(o,s,i)=>{if(o==null&&e.presetArg!==void 0)o=e.presetArg;let u=this.getOptionValue(r);if(o!==null&&e.parseArg)o=this._callParseArg(e,o,u,s);else if(o!==null&&e.variadic)o=e._collectValue(o,u);if(o==null)if(e.negate)o=!1;else if(e.isBoolean()||e.optional)o=!0;else o="";this.setOptionValueWithSource(r,o,i)};if(this.on("option:"+t,(o)=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;n(o,s,"cli")}),e.envVar)this.on("optionEnv:"+t,(o)=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;n(o,s,"env")});return this}_optionEx(e,t,r,n,o){if(typeof t==="object"&&t instanceof We)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,r);if(s.makeOptionMandatory(!!e.mandatory),typeof n==="function")s.default(o).argParser(n);else if(n instanceof RegExp){let i=n;n=(u,a)=>{let c=i.exec(u);return c?c[0]:a},s.default(o).argParser(n)}else s.default(n);return this.addOption(s)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){if(this._storeOptionsAsProperties)return this[e];return this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){if(this._storeOptionsAsProperties)this[e]=t;else this._optionValues[e]=t;return this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach((r)=>{if(r.getOptionValueSource(e)!==void 0)t=r.getOptionValueSource(e)}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){if(q.versions?.electron)t.from="electron";let n=q.execArgv??[];if(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))t.from="eval"}if(e===void 0)e=q.argv;this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":if(q.defaultApp)this._scriptPath=e[1],r=e.slice(2);else r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){if(this._savedState===null)this.options.filter((e)=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach((e)=>{let t=e.long.replace(/^--no-/,"--");if(!this._findOption(t))this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
29
- - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(Vr.existsSync(e))return;let n=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
26
+ (Did you mean ${n[0]}?)`;return""}class U extends J_{constructor(e){super();this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:(t)=>q.stdout.write(t),writeErr:(t)=>q.stderr.write(t),outputError:(t,r)=>r(t),getOutHelpWidth:()=>q.stdout.isTTY?q.stdout.columns:void 0,getErrHelpWidth:()=>q.stderr.isTTY?q.stderr.columns:void 0,getOutHasColors:()=>au()??(q.stdout.isTTY&&q.stdout.hasColors?.()),getErrHasColors:()=>au()??(q.stderr.isTTY&&q.stderr.hasColors?.()),stripColor:(t)=>K_(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,r){let n=t,o=r;if(typeof n==="object"&&n!==null)o=n,n=null;o=o||{};let[,s,i]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);if(n)u.description(n),u._executableHandler=!0;if(o.isDefault)this._defaultCommandName=u._name;if(u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,i)u.arguments(i);if(this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),n)return this;return u}createCommand(e){return new U(e)}createHelp(){return Object.assign(new an,this.configureHelp())}configureHelp(e){if(e===void 0)return this._helpConfiguration;return this._helpConfiguration=e,this}configureOutput(e){if(e===void 0)return this._outputConfiguration;return this._outputConfiguration={...this._outputConfiguration,...e},this}showHelpAfterError(e=!0){if(typeof e!=="string")e=!!e;return this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw Error(`Command passed to .addCommand() must have a name
27
+ - specify the name in Command constructor or using .name()`);if(t=t||{},t.isDefault)this._defaultCommandName=e._name;if(t.noHelp||t.hidden)e._hidden=!0;return this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new sn(e,t)}argument(e,t,r,n){let o=this.createArgument(e,t);if(typeof r==="function")o.default(n).argParser(r);else o.default(r);return this.addArgument(o),this}arguments(e){return e.trim().split(/ +/).forEach((t)=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t?.variadic)throw Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e==="boolean"){if(this._addImplicitHelpCommand=e,e&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let r=e??"help [command]",[,n,o]=r.match(/([^ ]+) *(.*)/),s=t??"display help for command",i=this.createCommand(n);if(i.helpOption(!1),o)i.arguments(o);if(s)i.description(s);if(this._addImplicitHelpCommand=!0,this._helpCommand=i,e||t)this._initCommandGroup(i);return this}addHelpCommand(e,t){if(typeof e!=="object")return this.helpCommand(e,t),this;return this._addImplicitHelpCommand=!0,this._helpCommand=e,this._initCommandGroup(e),this}_getHelpCommand(){if(this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))){if(this._helpCommand===void 0)this.helpCommand(void 0,void 0);return this._helpCommand}return null}hook(e,t){let r=["preSubcommand","preAction","postAction"];if(!r.includes(e))throw Error(`Unexpected value for event passed to hook : '${e}'.
28
+ Expecting one of '${r.join("', '")}'`);if(this._lifeCycleHooks[e])this._lifeCycleHooks[e].push(t);else this._lifeCycleHooks[e]=[t];return this}exitOverride(e){if(e)this._exitCallback=e;else this._exitCallback=(t)=>{if(t.code!=="commander.executeSubCommandAsync")throw t};return this}_exit(e,t,r){if(this._exitCallback)this._exitCallback(new vt(e,t,r));q.exit(e)}action(e){let t=(r)=>{let n=this.registeredArguments.length,o=r.slice(0,n);if(this._storeOptionsAsProperties)o[n]=this;else o[n]=this.opts();return o.push(this),e.apply(this,o)};return this._actionHandler=t,this}createOption(e,t){return new qe(e,t)}_callParseArg(e,t,r,n){try{return e.parseArg(t,r)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${n} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(e){let t=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(t){let r=e.long&&this._findOption(e.long)?e.long:e.short;throw Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
29
+ - already used by option '${t.flags}'`)}this._initOptionGroup(e),this.options.push(e)}_registerCommand(e){let t=(n)=>[n.name()].concat(n.aliases()),r=t(e).find((n)=>this._findCommand(n));if(r){let n=t(this._findCommand(r)).join("|"),o=t(e).join("|");throw Error(`cannot add command '${o}' as already have command '${n}'`)}this._initCommandGroup(e),this.commands.push(e)}addOption(e){this._registerOption(e);let t=e.name(),r=e.attributeName();if(e.defaultValue!==void 0)this.setOptionValueWithSource(r,e.defaultValue,"default");let n=(o,s,i)=>{if(o==null&&e.presetArg!==void 0)o=e.presetArg;let u=this.getOptionValue(r);if(o!==null&&e.parseArg)o=this._callParseArg(e,o,u,s);else if(o!==null&&e.variadic)o=e._collectValue(o,u);if(o==null)if(e.negate)o=!1;else if(e.isBoolean()||e.optional)o=!0;else o="";this.setOptionValueWithSource(r,o,i)};if(this.on("option:"+t,(o)=>{let s=`error: option '${e.flags}' argument '${o}' is invalid.`;n(o,s,"cli")}),e.envVar)this.on("optionEnv:"+t,(o)=>{let s=`error: option '${e.flags}' value '${o}' from env '${e.envVar}' is invalid.`;n(o,s,"env")});return this}_optionEx(e,t,r,n,o){if(typeof t==="object"&&t instanceof qe)throw Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(t,r);if(s.makeOptionMandatory(!!e.mandatory),typeof n==="function")s.default(o).argParser(n);else if(n instanceof RegExp){let i=n;n=(u,a)=>{let c=i.exec(u);return c?c[0]:a},s.default(o).argParser(n)}else s.default(n);return this.addOption(s)}option(e,t,r,n){return this._optionEx({},e,t,r,n)}requiredOption(e,t,r,n){return this._optionEx({mandatory:!0},e,t,r,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(e=!0){if(this.options.length)throw Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){if(this._storeOptionsAsProperties)return this[e];return this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,r){if(this._storeOptionsAsProperties)this[e]=t;else this._optionValues[e]=t;return this._optionValueSources[e]=r,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach((r)=>{if(r.getOptionValueSource(e)!==void 0)t=r.getOptionValueSource(e)}),t}_prepareUserArgs(e,t){if(e!==void 0&&!Array.isArray(e))throw Error("first parameter to parse must be array or undefined");if(t=t||{},e===void 0&&t.from===void 0){if(q.versions?.electron)t.from="electron";let n=q.execArgv??[];if(n.includes("-e")||n.includes("--eval")||n.includes("-p")||n.includes("--print"))t.from="eval"}if(e===void 0)e=q.argv;this.rawArgs=e.slice();let r;switch(t.from){case void 0:case"node":this._scriptPath=e[1],r=e.slice(2);break;case"electron":if(q.defaultApp)this._scriptPath=e[1],r=e.slice(2);else r=e.slice(1);break;case"user":r=e.slice(0);break;case"eval":r=e.slice(1);break;default:throw Error(`unexpected parse option { from: '${t.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",r}parse(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return this._parseCommand([],r),this}async parseAsync(e,t){this._prepareForParse();let r=this._prepareUserArgs(e,t);return await this._parseCommand([],r),this}_prepareForParse(){if(this._savedState===null)this.options.filter((e)=>e.negate&&e.defaultValue===void 0&&this.getOptionValue(e.attributeName())===void 0).forEach((e)=>{let t=e.long.replace(/^--no-/,"--");if(!this._findOption(t))this.setOptionValueWithSource(e.attributeName(),!0,"default")}),this.saveStateBeforeParse();else this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw Error(`Can not call parse again when storeOptionsAsProperties is true.
30
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(e,t,r){if(cn.existsSync(e))return;let n=t?`searched for local subcommand relative to directory '${t}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${e}' does not exist
30
31
  - if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
31
32
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
32
- - ${n}`;throw Error(o)}_executeSubCommand(e,t){t=t.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function n(c,l){let p=nt.resolve(c,l);if(Vr.existsSync(p))return p;if(r.includes(nt.extname(l)))return;let f=r.find((h)=>Vr.existsSync(`${p}${h}`));if(f)return`${p}${f}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let c;try{c=Vr.realpathSync(this._scriptPath)}catch{c=this._scriptPath}s=nt.resolve(nt.dirname(c),s)}if(s){let c=n(s,o);if(!c&&!e._executableFile&&this._scriptPath){let l=nt.basename(this._scriptPath,nt.extname(this._scriptPath));if(l!==this._name)c=n(s,`${l}-${e._name}`)}o=c||o}let i=r.includes(nt.extname(o)),u;if(q.platform!=="win32")if(i)t.unshift(o),t=Zi(q.execArgv).concat(t),u=co.spawn(q.argv[0],t,{stdio:"inherit"});else u=co.spawn(o,t,{stdio:"inherit"});else this._checkForMissingExecutable(o,s,e._name),t.unshift(o),t=Zi(q.execArgv).concat(t),u=co.spawn(q.execPath,t,{stdio:"inherit"});if(!u.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((l)=>{q.on(l,()=>{if(u.killed===!1&&u.exitCode===null)u.kill(l)})});let a=this._exitCallback;u.on("close",(c)=>{if(c=c??1,!a)q.exit(c);else a(new _t(c,"commander.executeSubCommandAsync","(close)"))}),u.on("error",(c)=>{if(c.code==="ENOENT")this._checkForMissingExecutable(o,s,e._name);else if(c.code==="EACCES")throw Error(`'${o}' not executable`);if(!a)q.exit(1);else{let l=new _t(1,"commander.executeSubCommandAsync","(error)");l.nestedError=c,a(l)}}),this.runningCommand=u}_dispatchSubcommand(e,t,r){let n=this._findCommand(e);if(!n)this.help({error:!0});n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(r));else return n._parseCommand(t,r)}),o}_dispatchHelpCommand(e){if(!e)this.help();let t=this._findCommand(e);if(t&&!t._executableHandler)t.help();return this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((e,t)=>{if(e.required&&this.args[t]==null)this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let e=(r,n,o)=>{let s=n;if(n!==null&&r.parseArg){let i=`error: command-argument value '${n}' is invalid for argument '${r.name()}'.`;s=this._callParseArg(r,n,o,i)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,n)=>{let o=r.defaultValue;if(r.variadic){if(n<this.args.length){if(o=this.args.slice(n),r.parseArg)o=o.reduce((s,i)=>e(r,i,s),r.defaultValue)}else if(o===void 0)o=[]}else if(n<this.args.length){if(o=this.args[n],r.parseArg)o=e(r,o,r.defaultValue)}t[n]=o}),this.processedArgs=t}_chainOrCall(e,t){if(e?.then&&typeof e.then==="function")return e.then(()=>t());return t()}_chainOrCallHooks(e,t){let r=e,n=[];if(this._getCommandAndAncestors().reverse().filter((o)=>o._lifeCycleHooks[t]!==void 0).forEach((o)=>{o._lifeCycleHooks[t].forEach((s)=>{n.push({hookedCommand:o,callback:s})})}),t==="postAction")n.reverse();return n.forEach((o)=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;if(this._lifeCycleHooks[r]!==void 0)this._lifeCycleHooks[r].forEach((o)=>{n=this._chainOrCall(n,()=>o(this,t))});return n}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{if(r.unknown.length>0)this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;if(s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent)s=this._chainOrCall(s,()=>{this.parent.emit(o,e,t)});return s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);if(this.listenerCount("command:*"))this.emit("command:*",e,t);else if(this.commands.length)this.unknownCommand();else n(),this._processArguments()}else if(this.commands.length)n(),this.help({error:!0});else n(),this._processArguments()}_findCommand(e){if(!e)return;return this.commands.find((t)=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find((t)=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((e)=>{e.options.forEach((t)=>{if(t.mandatory&&e.getOptionValue(t.attributeName())===void 0)e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter((r)=>{let n=r.attributeName();if(this.getOptionValue(n)===void 0)return!1;return this.getOptionValueSource(n)!=="default"});e.filter((r)=>r.conflictsWith.length>0).forEach((r)=>{let n=e.find((o)=>r.conflictsWith.includes(o.attributeName()));if(n)this._conflictingOption(r,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((e)=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],n=t;function o(c){return c.length>1&&c[0]==="-"}let s=(c)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(c))return!1;return!this._getCommandAndAncestors().some((l)=>l.options.map((p)=>p.short).some((p)=>/^-\d$/.test(p)))},i=null,u=null,a=0;while(a<e.length||u){let c=u??e[a++];if(u=null,c==="--"){if(n===r)n.push(c);n.push(...e.slice(a));break}if(i&&(!o(c)||s(c))){this.emit(`option:${i.name()}`,c);continue}if(i=null,o(c)){let l=this._findOption(c);if(l){if(l.required){let p=e[a++];if(p===void 0)this.optionMissingArgument(l);this.emit(`option:${l.name()}`,p)}else if(l.optional){let p=null;if(a<e.length&&(!o(e[a])||s(e[a])))p=e[a++];this.emit(`option:${l.name()}`,p)}else this.emit(`option:${l.name()}`);i=l.variadic?l:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let l=this._findOption(`-${c[1]}`);if(l){if(l.required||l.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${l.name()}`,c.slice(2));else this.emit(`option:${l.name()}`),u=`-${c.slice(2)}`;continue}}if(/^--[^=]+=/.test(c)){let l=c.indexOf("="),p=this._findOption(c.slice(0,l));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,c.slice(l+1));continue}}if(n===t&&o(c)&&!(this.commands.length===0&&s(c)))n=r;if((this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(c)){t.push(c),r.push(...e.slice(a));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){t.push(c,...e.slice(a));break}else if(this._defaultCommandName){r.push(c,...e.slice(a));break}}if(this._passThroughOptions){n.push(c,...e.slice(a));break}n.push(c)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let n=this.options[r].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){if(this._outputConfiguration.outputError(`${e}
33
+ - ${n}`;throw Error(o)}_executeSubCommand(e,t){t=t.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function n(c,l){let p=st.resolve(c,l);if(cn.existsSync(p))return p;if(r.includes(st.extname(l)))return;let f=r.find((h)=>cn.existsSync(`${p}${h}`));if(f)return`${p}${f}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let c;try{c=cn.realpathSync(this._scriptPath)}catch{c=this._scriptPath}s=st.resolve(st.dirname(c),s)}if(s){let c=n(s,o);if(!c&&!e._executableFile&&this._scriptPath){let l=st.basename(this._scriptPath,st.extname(this._scriptPath));if(l!==this._name)c=n(s,`${l}-${e._name}`)}o=c||o}let i=r.includes(st.extname(o)),u;if(q.platform!=="win32")if(i)t.unshift(o),t=uu(q.execArgv).concat(t),u=ko.spawn(q.argv[0],t,{stdio:"inherit"});else u=ko.spawn(o,t,{stdio:"inherit"});else this._checkForMissingExecutable(o,s,e._name),t.unshift(o),t=uu(q.execArgv).concat(t),u=ko.spawn(q.execPath,t,{stdio:"inherit"});if(!u.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((l)=>{q.on(l,()=>{if(u.killed===!1&&u.exitCode===null)u.kill(l)})});let a=this._exitCallback;u.on("close",(c)=>{if(c=c??1,!a)q.exit(c);else a(new vt(c,"commander.executeSubCommandAsync","(close)"))}),u.on("error",(c)=>{if(c.code==="ENOENT")this._checkForMissingExecutable(o,s,e._name);else if(c.code==="EACCES")throw Error(`'${o}' not executable`);if(!a)q.exit(1);else{let l=new vt(1,"commander.executeSubCommandAsync","(error)");l.nestedError=c,a(l)}}),this.runningCommand=u}_dispatchSubcommand(e,t,r){let n=this._findCommand(e);if(!n)this.help({error:!0});n._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,n,"preSubcommand"),o=this._chainOrCall(o,()=>{if(n._executableHandler)this._executeSubCommand(n,t.concat(r));else return n._parseCommand(t,r)}),o}_dispatchHelpCommand(e){if(!e)this.help();let t=this._findCommand(e);if(t&&!t._executableHandler)t.help();return this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((e,t)=>{if(e.required&&this.args[t]==null)this.missingArgument(e.name())}),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)return;if(this.args.length>this.registeredArguments.length)this._excessArguments(this.args)}_processArguments(){let e=(r,n,o)=>{let s=n;if(n!==null&&r.parseArg){let i=`error: command-argument value '${n}' is invalid for argument '${r.name()}'.`;s=this._callParseArg(r,n,o,i)}return s};this._checkNumberOfArguments();let t=[];this.registeredArguments.forEach((r,n)=>{let o=r.defaultValue;if(r.variadic){if(n<this.args.length){if(o=this.args.slice(n),r.parseArg)o=o.reduce((s,i)=>e(r,i,s),r.defaultValue)}else if(o===void 0)o=[]}else if(n<this.args.length){if(o=this.args[n],r.parseArg)o=e(r,o,r.defaultValue)}t[n]=o}),this.processedArgs=t}_chainOrCall(e,t){if(e?.then&&typeof e.then==="function")return e.then(()=>t());return t()}_chainOrCallHooks(e,t){let r=e,n=[];if(this._getCommandAndAncestors().reverse().filter((o)=>o._lifeCycleHooks[t]!==void 0).forEach((o)=>{o._lifeCycleHooks[t].forEach((s)=>{n.push({hookedCommand:o,callback:s})})}),t==="postAction")n.reverse();return n.forEach((o)=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(e,t,r){let n=e;if(this._lifeCycleHooks[r]!==void 0)this._lifeCycleHooks[r].forEach((o)=>{n=this._chainOrCall(n,()=>o(this,t))});return n}_parseCommand(e,t){let r=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(r.operands),t=r.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(t),this._dispatchSubcommand(this._defaultCommandName,e,t);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{if(r.unknown.length>0)this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;if(s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent)s=this._chainOrCall(s,()=>{this.parent.emit(o,e,t)});return s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))n(),this._processArguments(),this.parent.emit(o,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);if(this.listenerCount("command:*"))this.emit("command:*",e,t);else if(this.commands.length)this.unknownCommand();else n(),this._processArguments()}else if(this.commands.length)n(),this.help({error:!0});else n(),this._processArguments()}_findCommand(e){if(!e)return;return this.commands.find((t)=>t._name===e||t._aliases.includes(e))}_findOption(e){return this.options.find((t)=>t.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((e)=>{e.options.forEach((t)=>{if(t.mandatory&&e.getOptionValue(t.attributeName())===void 0)e.missingMandatoryOptionValue(t)})})}_checkForConflictingLocalOptions(){let e=this.options.filter((r)=>{let n=r.attributeName();if(this.getOptionValue(n)===void 0)return!1;return this.getOptionValueSource(n)!=="default"});e.filter((r)=>r.conflictsWith.length>0).forEach((r)=>{let n=e.find((o)=>r.conflictsWith.includes(o.attributeName()));if(n)this._conflictingOption(r,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((e)=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let t=[],r=[],n=t;function o(c){return c.length>1&&c[0]==="-"}let s=(c)=>{if(!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(c))return!1;return!this._getCommandAndAncestors().some((l)=>l.options.map((p)=>p.short).some((p)=>/^-\d$/.test(p)))},i=null,u=null,a=0;while(a<e.length||u){let c=u??e[a++];if(u=null,c==="--"){if(n===r)n.push(c);n.push(...e.slice(a));break}if(i&&(!o(c)||s(c))){this.emit(`option:${i.name()}`,c);continue}if(i=null,o(c)){let l=this._findOption(c);if(l){if(l.required){let p=e[a++];if(p===void 0)this.optionMissingArgument(l);this.emit(`option:${l.name()}`,p)}else if(l.optional){let p=null;if(a<e.length&&(!o(e[a])||s(e[a])))p=e[a++];this.emit(`option:${l.name()}`,p)}else this.emit(`option:${l.name()}`);i=l.variadic?l:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let l=this._findOption(`-${c[1]}`);if(l){if(l.required||l.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${l.name()}`,c.slice(2));else this.emit(`option:${l.name()}`),u=`-${c.slice(2)}`;continue}}if(/^--[^=]+=/.test(c)){let l=c.indexOf("="),p=this._findOption(c.slice(0,l));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,c.slice(l+1));continue}}if(n===t&&o(c)&&!(this.commands.length===0&&s(c)))n=r;if((this._enablePositionalOptions||this._passThroughOptions)&&t.length===0&&r.length===0){if(this._findCommand(c)){t.push(c),r.push(...e.slice(a));break}else if(this._getHelpCommand()&&c===this._getHelpCommand().name()){t.push(c,...e.slice(a));break}else if(this._defaultCommandName){r.push(c,...e.slice(a));break}}if(this._passThroughOptions){n.push(c,...e.slice(a));break}n.push(c)}return{operands:t,unknown:r}}opts(){if(this._storeOptionsAsProperties){let e={},t=this.options.length;for(let r=0;r<t;r++){let n=this.options[r].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,t)=>Object.assign(e,t.opts()),{})}error(e,t){if(this._outputConfiguration.outputError(`${e}
33
34
  `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError}
34
35
  `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(`
35
- `),this.outputHelp({error:!0});let r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach((e)=>{if(e.envVar&&e.envVar in q.env){let t=e.attributeName();if(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))if(e.required||e.optional)this.emit(`optionEnv:${e.name()}`,q.env[e.envVar]);else this.emit(`optionEnv:${e.name()}`)}})}_parseOptionsImplied(){let e=new uo(this.options),t=(r)=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter((r)=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach((r)=>{Object.keys(r.implied).filter((n)=>!t(n)).forEach((n)=>{this.setOptionValueWithSource(n,r.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=(s)=>{let i=s.attributeName(),u=this.getOptionValue(i),a=this.options.find((l)=>l.negate&&i===l.attributeName()),c=this.options.find((l)=>!l.negate&&i===l.attributeName());if(a&&(a.presetArg===void 0&&u===!1||a.presetArg!==void 0&&u===a.presetArg))return a;return c||s},n=(s)=>{let i=r(s),u=i.attributeName();if(this.getOptionValueSource(u)==="env")return`environment variable '${i.envVar}'`;return`option '${i.flags}'`},o=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter((i)=>i.long).map((i)=>i.long);n=n.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);t=ao(e,n)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",n=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),i=`error: too many arguments${o}. Expected ${t} argument${r} but got ${n}: ${s}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach((o)=>{if(n.push(o.name()),o.alias())n.push(o.alias())}),t=ao(e,n)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
36
- `),this._exit(0,"commander.version",e)}),this}description(e,t){if(e===void 0&&t===void 0)return this._description;if(this._description=e,t)this._argsDescription=t;return this}summary(e){if(e===void 0)return this._summary;return this._summary=e,this}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)t=this.commands[this.commands.length-1];if(e===t._name)throw Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let n=[r.name()].concat(r.aliases()).join("|");throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){if(e===void 0)return this._aliases;return e.forEach((t)=>this.alias(t)),this}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map((r)=>Gr(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){if(e===void 0)return this._name;return this._name=e,this}helpGroup(e){if(e===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=e,this}commandsGroup(e){if(e===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=e,this}optionsGroup(e){if(e===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=e,this}_initOptionGroup(e){if(this._defaultOptionGroup&&!e.helpGroupHeading)e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){if(this._defaultCommandGroup&&!e.helpGroup())e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=nt.basename(e,nt.extname(e)),this}executableDir(e){if(e===void 0)return this._executableDir;return this._executableDir=e,this}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let n=t.formatHelp(this,t);if(r.hasColors)return n;return this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let t=!!e.error,r,n,o;if(t)r=(i)=>this._outputConfiguration.writeErr(i),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth();else r=(i)=>this._outputConfiguration.writeOut(i),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth();return{error:t,write:(i)=>{if(!n)i=this._outputConfiguration.stripColor(i);return r(i)},hasColors:n,helpWidth:o}}outputHelp(e){let t;if(typeof e==="function")t=e,e=void 0;let r=this._getOutputContext(e),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach((s)=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:r.error});if(t){if(o=t(o),typeof o!=="string"&&!Buffer.isBuffer(o))throw Error("outputHelp callback must return a string or a Buffer")}if(r.write(o),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",n),this._getCommandAndAncestors().forEach((s)=>s.emit("afterAllHelp",n))}helpOption(e,t){if(typeof e==="boolean"){if(e){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),e||t)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(q.exitCode??0);if(t===0&&e&&typeof e!=="function"&&e.error)t=1;this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw Error(`Unexpected value for position to addHelpText.
36
+ `),this.outputHelp({error:!0});let r=t||{},n=r.exitCode||1,o=r.code||"commander.error";this._exit(n,o,e)}_parseOptionsEnv(){this.options.forEach((e)=>{if(e.envVar&&e.envVar in q.env){let t=e.attributeName();if(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))if(e.required||e.optional)this.emit(`optionEnv:${e.name()}`,q.env[e.envVar]);else this.emit(`optionEnv:${e.name()}`)}})}_parseOptionsImplied(){let e=new Co(this.options),t=(r)=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter((r)=>r.implied!==void 0&&t(r.attributeName())&&e.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach((r)=>{Object.keys(r.implied).filter((n)=>!t(n)).forEach((n)=>{this.setOptionValueWithSource(n,r.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let r=(s)=>{let i=s.attributeName(),u=this.getOptionValue(i),a=this.options.find((l)=>l.negate&&i===l.attributeName()),c=this.options.find((l)=>!l.negate&&i===l.attributeName());if(a&&(a.presetArg===void 0&&u===!1||a.presetArg!==void 0&&u===a.presetArg))return a;return c||s},n=(s)=>{let i=r(s),u=i.attributeName();if(this.getOptionValueSource(u)==="env")return`environment variable '${i.envVar}'`;return`option '${i.flags}'`},o=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter((i)=>i.long).map((i)=>i.long);n=n.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);t=Eo(e,n)}let r=`error: unknown option '${e}'${t}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,r=t===1?"":"s",n=e.length,o=this.parent?` for '${this.name()}'`:"",s=e.join(", "),i=`error: too many arguments${o}. Expected ${t} argument${r} but got ${n}: ${s}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach((o)=>{if(n.push(o.name()),o.alias())n.push(o.alias())}),t=Eo(e,n)}let r=`error: unknown command '${e}'${t}`;this.error(r,{code:"commander.unknownCommand"})}version(e,t,r){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",r=r||"output the version number";let n=this.createOption(t,r);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
37
+ `),this._exit(0,"commander.version",e)}),this}description(e,t){if(e===void 0&&t===void 0)return this._description;if(this._description=e,t)this._argsDescription=t;return this}summary(e){if(e===void 0)return this._summary;return this._summary=e,this}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)t=this.commands[this.commands.length-1];if(e===t._name)throw Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(e);if(r){let n=[r.name()].concat(r.aliases()).join("|");throw Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){if(e===void 0)return this._aliases;return e.forEach((t)=>this.alias(t)),this}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map((r)=>un(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){if(e===void 0)return this._name;return this._name=e,this}helpGroup(e){if(e===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=e,this}commandsGroup(e){if(e===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=e,this}optionsGroup(e){if(e===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=e,this}_initOptionGroup(e){if(this._defaultOptionGroup&&!e.helpGroupHeading)e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){if(this._defaultCommandGroup&&!e.helpGroup())e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=st.basename(e,st.extname(e)),this}executableDir(e){if(e===void 0)return this._executableDir;return this._executableDir=e,this}helpInformation(e){let t=this.createHelp(),r=this._getOutputContext(e);t.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let n=t.formatHelp(this,t);if(r.hasColors)return n;return this._outputConfiguration.stripColor(n)}_getOutputContext(e){e=e||{};let t=!!e.error,r,n,o;if(t)r=(i)=>this._outputConfiguration.writeErr(i),n=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth();else r=(i)=>this._outputConfiguration.writeOut(i),n=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth();return{error:t,write:(i)=>{if(!n)i=this._outputConfiguration.stripColor(i);return r(i)},hasColors:n,helpWidth:o}}outputHelp(e){let t;if(typeof e==="function")t=e,e=void 0;let r=this._getOutputContext(e),n={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach((s)=>s.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let o=this.helpInformation({error:r.error});if(t){if(o=t(o),typeof o!=="string"&&!Buffer.isBuffer(o))throw Error("outputHelp callback must return a string or a Buffer")}if(r.write(o),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",n),this._getCommandAndAncestors().forEach((s)=>s.emit("afterAllHelp",n))}helpOption(e,t){if(typeof e==="boolean"){if(e){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),e||t)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(q.exitCode??0);if(t===0&&e&&typeof e!=="function"&&e.error)t=1;this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let r=["beforeAll","before","after","afterAll"];if(!r.includes(e))throw Error(`Unexpected value for position to addHelpText.
37
38
  Expecting one of '${r.join("', '")}'`);let n=`${e}Help`;return this.on(n,(o)=>{let s;if(typeof t==="function")s=t({error:o.error,command:o.command});else s=t;if(s)o.write(`${s}
38
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();if(t&&e.find((n)=>t.is(n)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Zi(e){return e.map((t)=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",s;if((s=t.match(/^(--inspect(-brk)?)$/))!==null)r=s[1];else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(r=s[1],/^\d+$/.test(s[3]))o=s[3];else n=s[3];else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)r=s[1],n=s[3],o=s[4];if(r&&o!=="0")return`${r}=${n}:${parseInt(o)+1}`;return t})}function Bi(){if(q.env.NO_COLOR||q.env.FORCE_COLOR==="0"||q.env.FORCE_COLOR==="false")return!1;if(q.env.FORCE_COLOR||q.env.CLICOLOR_FORCE!==void 0)return!0;return}var vk=new U;var ar={name:"@imfelixyeung/git-swarm",description:"Manage multiple Git repositories with ease.",version:"0.2.0",repository:{type:"git",url:"https://github.com/imfelixyeung/git-swarm"},module:"src/cli.ts",bin:{"git-swarm":"dist/cli.js"},files:["dist"],type:"module",private:!1,scripts:{build:"bun build ./src/cli.ts --target=bun --minify --outdir=dist --sourcemap=linked",dev:"bun run build --watch",prepack:"bun run build && jq 'del(.dependencies, .devDependencies, .peerDependencies)' package.json > package.json.tmp && mv package.json.tmp package.json",postpack:"git checkout package.json",typecheck:"tsc --noEmit",biome:"biome check",ci:"biome ci",test:"bun test","config-json-schema:update":"bun run src/scripts/make-config-json-schema.ts > src/config/schema.json",changeset:"changeset","changeset:version":"changeset version && biome check --write",release:"bun run build && changeset publish"},devDependencies:{"@biomejs/biome":"2.5.12","@changesets/changelog-github":"^1.0.1","@changesets/cli":"^3.0.2","@types/bun":"latest","@types/lodash.chunk":"^4.2.9",prettier:"3.9.6"},publishConfig:{access:"public",provenance:!0},peerDependencies:{typescript:"^7"},dependencies:{"cli-table3":"^0.6.5",commander:"^15.0.0","date-fns":"^4.4.0",dedent:"^1.7.2","lodash.chunk":"^4.2.0","p-limit":"^7.3.2",picocolors:"^1.1.1","pluralize-esm":"^9.0.5","simple-git":"^3.36.0",tinyglobby:"^0.2.17",zod:"^4.5.4"}};import{relative as xE}from"path";class Mi{value;next;constructor(e){this.value=e}}class qr{#e;#t;#r;constructor(){this.clear()}enqueue(e){let t=new Mi(e);if(this.#e)this.#t.next=t,this.#t=t;else this.#e=t,this.#t=t;this.#r++}dequeue(){let e=this.#e;if(!e)return;if(this.#e=this.#e.next,this.#r--,!this.#e)this.#t=void 0;return e.value}peek(){if(!this.#e)return;return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;while(e)yield e.value,e=e.next}*drain(){while(this.#e)yield this.dequeue()}}function lo(e){let t=!1;if(typeof e==="object")({concurrency:e,rejectOnClear:t=!1}=e);if(ji(e),typeof t!=="boolean")throw TypeError("Expected `rejectOnClear` to be a boolean");let r=new qr,n=0,o=()=>{if(n<e&&r.size>0)n++,r.dequeue().run()},s=()=>{n--,o()},i=async(c,l,p)=>{let f=(async()=>c(...p))();l(f);try{await f}catch{}s()},u=(c,l,p,f)=>{let h={reject:p};if(new Promise((d)=>{h.run=d,r.enqueue(h)}).then(i.bind(void 0,c,l,f)),n<e)o()},a=(c,...l)=>new Promise((p,f)=>{u(c,p,f,l)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>r.size},clearQueue:{value(){if(!t){r.clear();return}let c=AbortSignal.abort().reason;while(r.size>0)r.dequeue().reject(c)}},concurrency:{get:()=>e,set(c){ji(c),e=c,queueMicrotask(()=>{while(n<e&&r.size>0)o()})}},map:{async value(c,l){let p=Array.from(c,(f,h)=>a(l,f,h));return Promise.all(p)}}}),a}function ji(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up")}var ln=at(Yi(),1);var Do=new WeakMap;function Lt(...e){let t=new String(e);return Do.set(t,e),t}function je(e){return e instanceof String&&Do.has(e)}function Zt(e){return Do.get(e)??[]}var an=at(go(),1);import{spawn as sb}from"child_process";var pc=at(bo(),1);import{normalize as wy}from"path";function*eu(e,t){let r=t==="global";for(let n of e)n.isGlobal===r&&(yield n)}var UD=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),GD=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),WD=new Set(["edit","remove-section","rename-section","set","unset"]),VD=new Set(["get","get-color","get-colorbool","list"]);function qD(e,t){for(let{name:n}of eu(e,"task")){if(UD.has(n))return Bt(!0,t);if(GD.has(n))return Bt(!1,t)}let r=t.at(0)?.toLowerCase();return r===void 0?null:WD.has(r)?Bt(!0,t.slice(1)):VD.has(r)?Bt(!1,t.slice(1)):t.length===1?Bt(!1,t):Bt(!0,t)}function Bt(e=!1,t=[]){let r=t.at(0)?.toLowerCase();return r===void 0?null:{isWrite:e,isRead:!e,key:r,value:t.at(1)}}function JD(e,t){return t.isWrite&&t.value!==void 0?{key:t.key,value:t.value,scope:e}:{key:t.key,scope:e}}function KD(e){let t=e?.indexOf("=")||-1;return!e||t<0?null:{key:e.slice(0,t).trim().toLowerCase(),value:e.slice(t+1)}}function YD(e){for(let{name:t}of eu(e,"task"))switch(t){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function XD({name:e}){if(e==="-c"||e==="--config")return"inline";if(e==="--config-env")return"env"}function*QD(e){for(let t of e){let r=XD(t),n=r&&KD(t.value);n&&(yield{...n,scope:r})}}function e_(e,t,r){let n={read:[],write:[...QD(t)]};return e==="config"&&t_(n,YD(t),qD(t,r)),n}function t_(e,t,r){if(r===null)return;let n=JD(t,r);r.isWrite?e.write.push(n):e.read.push(n)}var tu={short:new Map([["c",!0]])},r_={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...tu.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},n_={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},o_={short:new Map,long:new Set};function s_(e){let t=n_[e??""]??o_;return{short:new Map([...tu.short.entries(),...t.short.entries()]),long:t.long}}function ru(e,t=r_){if(e.startsWith("--")){let r=e.indexOf("=");if(r>2)return[{name:e.slice(0,r),value:e.slice(r+1),needsNext:!1}];let n=e.slice(2);return[{name:e,needsNext:t.long.has(n)}]}if(e.length===2){let r=e.charAt(1),n=t.short.get(r);return[{name:e,needsNext:n===!0}]}return i_(e,t.short)}function i_(e,t){let r=e.slice(1).split(""),n=[];for(let o=0;o<r.length;o++){let s=r[o],i=t.get(s);if(i===void 0)return[{name:e,needsNext:!1}];if(i){let u=r.slice(o+1).join("");if(u&&![...u].every((a)=>t.has(a)))return n.push({name:`-${s}`,value:u,needsNext:!1}),n}n.push({name:`-${s}`,needsNext:i})}return n}function u_(e,t=[]){let r=0;for(;r<e.length;){let n=String(e[r]);if(!n.startsWith("-")||n.length<2)break;let o=ru(n),s=r+1;for(let i of o){let u={name:i.name,value:i.value,absorbedNext:!1,isGlobal:!0};i.needsNext&&u.value===void 0&&s<e.length&&(u.value=String(e[s]),u.absorbedNext=!0,s++),t.push(u)}r=s}return{flags:t,taskIndex:r}}function a_(e,t,r=[]){let n=s_(t),o=[],s=[],i=0;for(;i<e.length;){let u=e[i];if(je(u)){s.push(...Zt(u)),i++;continue}let a=String(u);if(a==="--"){for(let p=i+1;p<e.length;p++){let f=e[p];je(f)?s.push(...Zt(f)):s.push(String(f))}break}if(!a.startsWith("-")||a.length<2){o.push(a),i++;continue}let c=ru(a,n),l=i+1;for(let p of c){let f={name:p.name,value:p.value,absorbedNext:!1,isGlobal:!1};p.needsNext&&f.value===void 0&&l<e.length&&!je(e[l])&&(f.value=String(e[l]),f.absorbedNext=!0,l++),r.push(f)}i=l}return{flags:r,positionals:o,pathspecs:s}}function*c_({write:e}){for(let t of e)for(let r of l_){let n=r(t.key);n&&(yield n)}}function Ue(e,t,r=String(e)){let n=typeof e=="string"?new RegExp(`\\s*${e.toLowerCase()}`):e;return function(o){if(n.test(o))return{category:t,message:`Configuring ${r} is not permitted without enabling ${t}`}}}function He(e,t){let r=new RegExp(`\\s*${e.toLowerCase().replace(/\./g,"(..+)?.")}`);return Ue(r,t,e)}var l_=[Ue("alias","allowUnsafeAlias"),Ue("core.askPass","allowUnsafeAskPass"),Ue("core.editor","allowUnsafeEditor"),Ue("core.fsmonitor","allowUnsafeFsMonitor"),Ue("core.gitProxy","allowUnsafeGitProxy"),Ue("core.hooksPath","allowUnsafeHooksPath"),Ue("core.pager","allowUnsafePager"),Ue("core.sshCommand","allowUnsafeSshCommand"),He("credential.helper","allowUnsafeCredentialHelper"),He("diff.command","allowUnsafeDiffExternal"),Ue("diff.external","allowUnsafeDiffExternal"),He("diff.textconv","allowUnsafeDiffTextConv"),He("filter.clean","allowUnsafeFilter"),He("filter.smudge","allowUnsafeFilter"),He("gpg.program","allowUnsafeGpgProgram"),Ue("init.templateDir","allowUnsafeTemplateDir"),He("merge.driver","allowUnsafeMergeDriver"),He("mergetool.path","allowUnsafeMergeDriver"),He("mergetool.cmd","allowUnsafeMergeDriver"),He("protocol.allow","allowUnsafeProtocolOverride"),He("remote.receivepack","allowUnsafePack"),He("remote.uploadpack","allowUnsafePack"),Ue("sequence.editor","allowUnsafeEditor")];function*p_(e,t){for(let r of t)for(let n of f_){let o=n(e,r.name);o&&(yield o)}}function lr(e,t,r,n=String(t)){let o=typeof t=="string"?new RegExp(`\\s*${t.toLowerCase()}`):t,s=`Use of ${e?`${e} with option `:""}${n} is not permitted without enabling ${r}`;return function(i,u){if((!e||i===e)&&o.test(u))return{category:r,message:s}}}var f_=[lr(null,/--(upload|receive)-pack/,"allowUnsafePack","--upload-pack or --receive-pack"),lr("clone",/^-\w*u/,"allowUnsafePack"),lr("clone","--u","allowUnsafePack"),lr("push","--exec","allowUnsafePack"),lr(null,"--template","allowUnsafeTemplateDir")];function nu(e,t,r){return[...p_(e,t),...c_(r)]}function h_(...e){let{flags:t,taskIndex:r}=u_(e),n=r<e.length?String(e[r]).toLowerCase():null,o=n!==null?e.slice(r+1):[],{positionals:s,pathspecs:i}=a_(o,n,t),u=e_(n,t,s);return{task:n,flags:t.map(m_),paths:i,config:u,vulnerabilities:d_(nu(n,t,u))}}function d_(e){return Object.defineProperty(e,"vulnerabilities",{value:e})}function m_({value:e,name:t}){return e!==void 0?{name:t,value:e}:{name:t}}var ou={editor:"allowUnsafeEditor",git_askpass:"allowUnsafeAskPass",git_config_global:"allowUnsafeConfigPaths",git_config_system:"allowUnsafeConfigPaths",git_config_count:"allowUnsafeConfigEnvCount",git_config:"allowUnsafeConfigPaths",git_editor:"allowUnsafeEditor",git_exec_path:"allowUnsafeConfigPaths",git_external_diff:"allowUnsafeDiffExternal",git_pager:"allowUnsafePager",git_proxy_command:"allowUnsafeGitProxy",git_template_dir:"allowUnsafeTemplateDir",git_sequence_editor:"allowUnsafeEditor",git_ssh:"allowUnsafeSshCommand",git_ssh_command:"allowUnsafeSshCommand",pager:"allowUnsafePager",prefix:"allowUnsafeConfigPaths",ssh_askpass:"allowUnsafeAskPass"};function*g_(e){let t=parseInt(e.git_config_count??"0",10);for(let r=0;r<t;r++){let n=e[`git_config_key_${r}`],o=e[`git_config_value_${r}`];n!==void 0&&(yield{key:n.toLowerCase().trim(),value:o,scope:"env"})}}function*D_(e){for(let t of Object.keys(e))if(su(t)){let r=ou[t];yield{category:r,message:`Use of "${t.toUpperCase()}" is not permitted without enabling ${r}`}}}function su(e){return Object.hasOwn(ou,e)}function __(e){let t={};for(let[r,n]of Object.entries(e)){let o=r.toLowerCase().trim();(su(o)||o.startsWith("git"))&&(t[o]=String(n))}return t}function b_(e){let t=__(e),r={read:[],write:[...g_(t)]},n=[...D_(t),...nu(null,[],r)];return{config:r,vulnerabilities:n}}function iu(e,t){return[...h_(...e).vulnerabilities,...b_(t).vulnerabilities]}var Mt=at(bo(),1);import{EventEmitter as bx}from"events";var{defineProperty:Bo,getOwnPropertyDescriptor:y_,getOwnPropertyNames:Mo}=Object,x_=Object.prototype.hasOwnProperty,k=(e,t)=>function(){return e&&(t=(0,e[Mo(e)[0]])(e=0)),t},v_=(e,t)=>function(){return t||(0,e[Mo(e)[0]])((t={exports:{}}).exports,t),t.exports},de=(e,t)=>{for(var r in t)Bo(e,r,{get:t[r],enumerable:!0})},w_=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of Mo(t))if(!x_.call(e,o)&&o!==r)Bo(e,o,{get:()=>t[o],enumerable:!(n=y_(t,o))||n.enumerable})}return e},ce=(e)=>w_(Bo({},"__esModule",{value:!0}),e),ot,lt=k({"src/lib/errors/git-error.ts"(){ot=class extends Error{constructor(e,t){super(t);this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),dr,Ut=k({"src/lib/errors/git-response-error.ts"(){lt(),dr=class extends ot{constructor(e,t){super(void 0,t||String(e));this.git=e}}}}),Lu,Zu=k({"src/lib/errors/task-configuration-error.ts"(){lt(),Lu=class extends ot{constructor(e){super(void 0,e)}}}});function Bu(e){if(typeof e!=="function")return wt;return e}function Mu(e){return typeof e==="function"&&e!==wt}function ju(e,t){let r=e.indexOf(t);if(r<=0)return[e,""];return[e.substr(0,r),e.substr(r+1)]}function Hu(e,t=0){return Uu(e)&&e.length>t?e[t]:void 0}function vt(e,t=0){if(Uu(e)&&e.length>t)return e[e.length-1-t]}function Uu(e){return dn(e)}function mr(e="",t=!0,r=`
39
- `){return e.split(r).reduce((n,o)=>{let s=t?o.trim():o;if(s)n.push(s);return n},[])}function jo(e,t){return mr(e,!0).map((r)=>t(r))}function Ho(e){return ln.exists(e,ln.FOLDER)}function Ge(e,t){if(Array.isArray(e)){if(!e.includes(t))e.push(t)}else e.add(t);return t}function Gu(e,t){if(Array.isArray(e)&&!e.includes(t))e.push(t);return e}function pn(e,t){if(Array.isArray(e)){let r=e.indexOf(t);if(r>=0)e.splice(r,1)}else e.delete(t);return t}function Xe(e){return Array.isArray(e)?e:[e]}function Wu(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Gt(e){return Xe(e).map((t)=>t instanceof String?t:String(t))}function Q(e,t=0){if(e==null)return t;let r=parseInt(e,10);return Number.isNaN(r)?t:r}function fr(e,t){let r=[];for(let n=0,o=e.length;n<o;n++)r.push(t,e[n]);return r}function hr(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Vu(e,t){let r={};return t.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]}),r}function $o(e=0){return new Promise((t)=>setTimeout(t,e))}function ko(e){if(e===!1)return;return e}var jt,wt,gr,fn=k({"src/lib/utils/util.ts"(){Uo(),jt="\x00",wt=()=>{},gr=Object.prototype.toString.call.bind(Object.prototype.toString)}});function we(e,t,r){if(t(e))return e;return arguments.length>2?r:void 0}function So(e,t){let r=je(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function hn(e){return!!e&&gr(e)==="[object Object]"}function qu(e){return typeof e==="function"}var Dr,Ju,ue,sn,dn,Uo=k({"src/lib/utils/argument-filters.ts"(){fn(),Dr=(e)=>Array.isArray(e),Ju=(e)=>typeof e==="number",ue=(e)=>typeof e==="string"||je(e),sn=(e)=>ue(e)||Array.isArray(e)&&e.every(ue),dn=(e)=>{if(e==null||"number|boolean|function".includes(typeof e))return!1;return typeof e.length==="number"}}}),Oo,C_=k({"src/lib/utils/exit-codes.ts"(){Oo=((e)=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(Oo||{})}}),un,E_=k({"src/lib/utils/git-output-streams.ts"(){un=class e{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new e(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function $_(){throw Error("LineParser:useMatches not implemented")}var L,ct,k_=k({"src/lib/utils/line-parser.ts"(){L=class{constructor(e,t){if(this.matches=[],this.useMatches=$_,this.parse=(r,n)=>{if(this.resetMatches(),!this._regExp.every((o,s)=>this.addMatch(o,s,r(s))))return!1;return this.useMatches(n,this.prepareMatches())!==!1},this._regExp=Array.isArray(e)?e:[e],t)this.useMatches=t}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);if(n)this.pushMatch(t,n);return!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},ct=class extends L{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){if(e>0||t.length>1)super.pushMatch(e,t)}}}});function Ku(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...Yu},...e.filter((n)=>typeof n==="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Yu,S_=k({"src/lib/utils/simple-git-options.ts"(){Yu={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Go(e,t=[]){if(!hn(e))return t;return Object.keys(e).reduce((r,n)=>{let o=e[n];if(je(o))r.push(o);else if(So(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o)){for(let s of o)if(!So(s,["string","number"]))r.push(n+"="+s)}else r.push(n);return r},t)}function ke(e,t=0,r=!1){let n=[];for(let o=0,s=t<0?e.length:t;o<s;o++)if("string|number".includes(typeof e[o]))n.push(String(e[o]));if(Go(Wo(e),n),!r)n.push(...O_(e));return n}function O_(e){let t=typeof vt(e)==="function";return Gt(we(vt(e,t?1:0),Dr,[]))}function Wo(e){let t=qu(vt(e));return we(vt(e,t?1:0),hn)}function oe(e,t=!0){let r=Bu(vt(e));return t||Mu(r)?r:void 0}var A_=k({"src/lib/utils/task-options.ts"(){Uo(),fn()}});function Ao(e,t){return e(t.stdOut,t.stdErr)}function Pe(e,t,r,n=!0){return Xe(r).forEach((o)=>{for(let s=mr(o,n),i=0,u=s.length;i<u;i++){let a=(c=0)=>{if(i+c>=u)return;return s[i+c]};t.some(({parse:c})=>c(a,e))}}),e}var F_=k({"src/lib/utils/task-parser.ts"(){fn()}}),Xu={};de(Xu,{ExitCodes:()=>Oo,GitOutputStreams:()=>un,LineParser:()=>L,NOOP:()=>wt,NULL:()=>jt,RemoteLineParser:()=>ct,append:()=>Ge,appendTaskOptions:()=>Go,asArray:()=>Xe,asCamelCase:()=>Wu,asFunction:()=>Bu,asNumber:()=>Q,asStringArray:()=>Gt,bufferToString:()=>hr,callTaskParser:()=>Ao,createInstanceConfig:()=>Ku,delay:()=>$o,filterArray:()=>Dr,filterFunction:()=>qu,filterHasLength:()=>dn,filterNumber:()=>Ju,filterPlainObject:()=>hn,filterPrimitives:()=>So,filterString:()=>ue,filterStringOrStringArray:()=>sn,filterType:()=>we,first:()=>Hu,folderExists:()=>Ho,forEachLineWithContent:()=>jo,getTrailingOptions:()=>ke,including:()=>Gu,isUserFunction:()=>Mu,last:()=>vt,objectToString:()=>gr,orVoid:()=>ko,parseStringResponse:()=>Pe,pick:()=>Vu,prefixedArray:()=>fr,remove:()=>pn,splitOn:()=>ju,toLinesWithContent:()=>mr,trailingFunctionArgument:()=>oe,trailingOptionsArgument:()=>Wo});var R=k({"src/lib/utils/index.ts"(){Uo(),C_(),E_(),k_(),S_(),A_(),F_(),fn()}}),Qu={};de(Qu,{CheckRepoActions:()=>Fo,checkIsBareRepoTask:()=>ta,checkIsRepoRootTask:()=>ea,checkIsRepoTask:()=>T_});function T_(e){switch(e){case"bare":return ta();case"root":return ea()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:mn,parser:Vo}}function ea(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:mn,parser(t){return/^\.(git)?$/.test(t.trim())}}}function ta(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:mn,parser:Vo}}function P_(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Fo,mn,Vo,ra=k({"src/lib/tasks/check-is-repo.ts"(){R(),Fo=((e)=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Fo||{}),mn=({exitCode:e},t,r,n)=>{if(e===128&&P_(t))return r(Buffer.from("false"));n(t)},Vo=(e)=>e.trim()==="true"}});function z_(e,t){let r=new na(e),n=e?sa:oa;return mr(t).forEach((o)=>{let s=o.replace(n,"");r.paths.push(s),(ia.test(s)?r.folders:r.files).push(s)}),r}var na,oa,sa,ia,R_=k({"src/lib/responses/CleanSummary.ts"(){R(),na=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},oa=/^[a-z]+\s*/i,sa=/^[a-z]+\s+[a-z]+\s*/i,ia=/\/$/}}),To={};de(To,{EMPTY_COMMANDS:()=>gn,adhocExecTask:()=>ua,configurationErrorTask:()=>Te,isBufferTask:()=>ca,isEmptyTask:()=>la,straightThroughBufferTask:()=>aa,straightThroughStringTask:()=>Se});function ua(e){return{commands:gn,format:"empty",parser:e}}function Te(e){return{commands:gn,format:"empty",parser(){throw typeof e==="string"?new Lu(e):e}}}function Se(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function aa(e){return{commands:e,format:"buffer",parser(t){return t}}}function ca(e){return e.format==="buffer"}function la(e){return e.format==="empty"||!e.commands.length}var gn,le=k({"src/lib/tasks/task.ts"(){Zu(),gn=[]}}),pa={};de(pa,{CONFIG_ERROR_INTERACTIVE_MODE:()=>qo,CONFIG_ERROR_MODE_REQUIRED:()=>Jo,CONFIG_ERROR_UNKNOWN_OPTION:()=>Ko,CleanOptions:()=>tn,cleanTask:()=>fa,cleanWithOptionsTask:()=>I_,isCleanOptionsArray:()=>N_});function I_(e,t){let{cleanMode:r,options:n,valid:o}=L_(e);if(!r)return Te(Jo);if(!o.options)return Te(Ko+JSON.stringify(e));if(n.push(...t),n.some(M_))return Te(qo);return fa(r,n)}function fa(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return z_(e==="n",n)}}}function N_(e){return Array.isArray(e)&&e.every((t)=>Yo.has(t))}function L_(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach((o)=>{if(Z_(o))t=o,n.cleanMode=!0;else n.options=n.options&&B_(r[r.length]=`-${o}`)}),{cleanMode:t,options:r,valid:n}}function Z_(e){return e==="f"||e==="n"}function B_(e){return/^-[a-z]$/i.test(e)&&Yo.has(e.charAt(1))}function M_(e){if(/^-[^\-]/.test(e))return e.indexOf("i")>0;return e==="--interactive"}var qo,Jo,Ko,tn,Yo,ha=k({"src/lib/tasks/clean.ts"(){R_(),R(),le(),qo="Git clean interactive mode is not supported",Jo='Git clean mode parameter ("n" or "f") is required',Ko="Git clean unknown option found in: ",tn=((e)=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(tn||{}),Yo=new Set(["i",...Gt(Object.values(tn))])}});function j_(e){let t=new ma;for(let r of da(e))t.addValue(r.file,String(r.key),r.value);return t}function H_(e,t){let r=null,n=[],o=new Map;for(let s of da(e,t)){if(s.key!==t)continue;if(n.push(r=s.value),!o.has(s.file))o.set(s.file,[]);o.get(s.file).push(r)}return{key:t,paths:Array.from(o.keys()),scopes:o,value:r,values:n}}function U_(e){return e.replace(/^(file):/,"")}function*da(e,t=null){let r=e.split("\x00");for(let n=0,o=r.length-1;n<o;){let s=U_(r[n++]),i=r[n++],u=t;if(i.includes(`
40
- `)){let a=ju(i,`
41
- `);u=a[0],i=a[1]}yield{file:s,key:u,value:i}}}var ma,G_=k({"src/lib/responses/ConfigList.ts"(){R(),ma=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){if(!this._all)this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{});return this._all}addFile(e){if(!(e in this.values)){let t=vt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);if(!Object.hasOwn(n,t))n[t]=r;else if(Array.isArray(n[t]))n[t].push(r);else n[t]=[n[t],r];this._all=void 0}}}});function yo(e,t){if(typeof e==="string"&&Object.hasOwn(Po,e))return e;return t}function W_(e,t,r,n){let o=["config",`--${n}`];if(r)o.push("--add");return o.push(e,t),{commands:o,format:"utf-8",parser(s){return s}}}function V_(e,t){let r=["config","--null","--show-origin","--get-all",e];if(t)r.splice(1,0,`--${t}`);return{commands:r,format:"utf-8",parser(n){return H_(n,e)}}}function q_(e){let t=["config","--list","--show-origin","--null"];if(e)t.push(`--${e}`);return{commands:t,format:"utf-8",parser(r){return j_(r)}}}function J_(){return{addConfig(e,t,...r){return this._runTask(W_(e,t,r[0]===!0,yo(r[1],"local")),oe(arguments))},getConfig(e,t){return this._runTask(V_(e,yo(t,void 0)),oe(arguments))},listConfig(...e){return this._runTask(q_(yo(e[0],void 0)),oe(arguments))}}}var Po,ga=k({"src/lib/tasks/config.ts"(){G_(),R(),Po=((e)=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Po||{})}});function K_(e){return Da.has(e)}var xo,Da,_a=k({"src/lib/tasks/diff-name-status.ts"(){xo=((e)=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(xo||{}),Da=new Set(Object.values(xo))}});function Y_(...e){return new ya().param(...e)}function X_(e){let t=new Set,r={};return jo(e,(n)=>{let[o,s,i]=n.split(jt);t.add(o),(r[o]=r[o]||[]).push({line:Q(s),path:o,preview:i})}),{paths:t,results:r}}function Q_(){return{grep(e){let t=oe(arguments),r=ke(arguments);for(let o of ba)if(r.includes(o))return this._runTask(Te(`git.grep: use of "${o}" is not supported.`),t);if(typeof e==="string")e=Y_().param(e);let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(o){return X_(o)}},t)}}}var ba,pr,uu,ya,xa=k({"src/lib/tasks/grep.ts"(){R(),le(),ba=["-h"],pr=Symbol("grepQuery"),ya=class{constructor(){this[uu]=[]}*[(uu=pr,Symbol.iterator)](){for(let e of this[pr])yield e}and(...e){return e.length&&this[pr].push("--and","(",...fr(e,"-e"),")"),this}param(...e){return this[pr].push(...fr(e,"-e")),this}}}}),va={};de(va,{ResetMode:()=>rn,getResetMode:()=>tb,resetTask:()=>eb});function eb(e,t){let r=["reset"];if(wa(e))r.push(`--${e}`);return r.push(...t),Se(r)}function tb(e){if(wa(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}return}function wa(e){return typeof e==="string"&&Ca.includes(e)}var rn,Ca,Ea=k({"src/lib/tasks/reset.ts"(){R(),le(),rn=((e)=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(rn||{}),Ca=Gt(Object.values(rn))}});function rb(){return an.default("simple-git")}function au(e,t,r){if(!t||!String(t).replace(/\s*/,""))return!r?e:(n,...o)=>{e(n,...o),r(n,...o)};return(n,...o)=>{if(e(`%s ${n}`,t,...o),r)r(n,...o)}}function nb(e,t,{namespace:r}){if(typeof e==="string")return e;let n=t&&t.namespace||"";if(n.startsWith(r))return n.substr(r.length+1);return n||r}function Xo(e,t,r,n=rb()){let o=e&&`[${e}]`||"",s=[],i=typeof t==="string"?n.extend(t):t,u=nb(we(t,ue),i,n);return c(r);function a(l,p){return Ge(s,Xo(e,u.replace(/^[^:]+/,l),p,n))}function c(l){let p=l&&`[${l}]`||"",f=i&&au(i,p)||wt,h=au(n,`${o} ${p}`,f);return Object.assign(i?f:h,{label:e,sibling:a,info:h,step:c})}}var $a=k({"src/lib/git-logger.ts"(){R(),an.default.formatters.L=(e)=>String(dn(e)?e.length:"-"),an.default.formatters.B=(e)=>{if(Buffer.isBuffer(e))return e.toString("utf8");return gr(e)}}}),ka,ob=k({"src/lib/runners/tasks-pending-queue.ts"(){lt(),$a(),ka=class e{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=e.getName(t.commands[0]),n=Xo(this.logLabel,r);return{task:t,logger:n,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:n}]of Array.from(this._queue.entries())){if(r===t.task)n.info("Failed %o",t),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted");else n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message);this.complete(r)}if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){if(this.withProgress(t))this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new ot(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function xt(e,t){return{method:Hu(e.commands)||"",commands:t}}function ib(e,t){return(r)=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function cu(e,t,r,n){return(o)=>{r("%s received %L bytes",t,o),n("%B",o),e.push(o)}}var zo,ub=k({"src/lib/runners/git-executor-chain.ts"(){lt(),le(),R(),ob(),zo=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new ka}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return await(la(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n))}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof ot?Object.assign(t,{task:e}):new ot(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",xt(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],{...xt(e,e.commands),env:{...this.env}}),o=await this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),s=await this.handleTaskData(e,n,o,t.step("HANDLE"));if(t("passing response to task's parser as a %s",e.format),ca(e))return Ao(e.parser,s);return Ao(e.parser,s.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,n){let{exitCode:o,rejection:s,stdOut:i,stdErr:u}=r;return new Promise((a,c)=>{n("Preparing to handle process response exitCode=%d stdOut=",o);let{error:l}=this._plugins.exec("task.error",{error:s},{...xt(e,t),...r});if(l&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,l,(p)=>{n.info("custom error handler treated as success"),n("custom error returned a %s",gr(p)),a(new un(Array.isArray(p)?Buffer.concat(p):p,Buffer.concat(u)))},c);if(l)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",o,u.length,s),c(l);n.info("retrieving task output complete"),a(new un(Buffer.concat(i),Buffer.concat(u)))})}async gitResponse(e,t,r,n,o){let s=o.sibling("output"),i=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},xt(e,e.commands));return new Promise((u)=>{let a=[],c=[];o.info("%s %o",t,r),o("%O",i);let l=this._beforeSpawn(e,r);if(l)return u({stdOut:a,stdErr:c,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,{...xt(e,r),kill(f){l=f||l}});let p=sb(t,r,i);if(p.stdout.on("data",cu(a,"stdOut",o,s.step("stdOut"))),p.stderr.on("data",cu(c,"stdErr",o,s.step("stdErr"))),p.on("error",ib(c,o)),n)o("Passing child process stdOut/stdErr to custom outputHandler"),n(t,p.stdout,p.stderr,[...r]);this._plugins.exec("spawn.after",void 0,{...xt(e,r),spawned:p,close(f,h){u({stdOut:a,stdErr:c,exitCode:f,rejection:l||h})},kill(f){if(p.killed)return;l=f,p.kill("SIGINT")}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...xt(e,t),kill(n){r=n||r}}),r}}}}),Sa={};de(Sa,{GitExecutor:()=>Oa});var Oa,ab=k({"src/lib/runners/git-executor.ts"(){ub(),Oa=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new zo(this,this._scheduler,this._plugins)}chain(){return new zo(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function cb(e,t,r=wt){let n=(s)=>{r(null,s)},o=(s)=>{if(s?.task===e)r(s instanceof dr?lb(s):s,void 0)};t.then(n,o)}function lb(e){let t=(n)=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=wt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,o){if(o in e)return n;return n[o]={enumerable:!1,configurable:!1,get(){return t(o),e.git[o]}},n}}var pb=k({"src/lib/task-callback.ts"(){Ut(),R()}});function lu(e,t){return ua((r)=>{if(!Ho(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var fb=k({"src/lib/tasks/change-working-directory.ts"(){R(),le()}});function vo(e){let t=["checkout",...e];if(t[1]==="-b"&&t.includes("-B"))t[1]=pn(t,"-B");return Se(t)}function hb(){return{checkout(){return this._runTask(vo(ke(arguments,1)),oe(arguments))},checkoutBranch(e,t){return this._runTask(vo(["-b",e,t,...ke(arguments)]),oe(arguments))},checkoutLocalBranch(e){return this._runTask(vo(["-b",e,...ke(arguments)]),oe(arguments))}}}var db=k({"src/lib/tasks/checkout.ts"(){R(),le()}});function mb(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function gb(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return Pe(mb(),[Aa],e)}})}}}var Aa,Db=k({"src/lib/tasks/count-objects.ts"(){R(),Aa=new L(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=Wu(t);if(Object.hasOwn(e,n))e[n]=Q(r)})}});function _b(e){return Pe({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Fa,e)}var Fa,bb=k({"src/lib/parsers/parse-commit.ts"(){R(),Fa=[new L(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new L(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();if(!n||!n.includes("@"))return;e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()}}),new L(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new L(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let o=parseInt(r,10)||0;if(n==="-")e.summary.deletions=o;else if(n==="+")e.summary.insertions=o})]}});function yb(e,t,r){return{commands:["-c","core.abbrev=40","commit",...fr(e,"-m"),...t,...r],format:"utf-8",parser:_b}}function xb(){return{commit(t,...r){let n=oe(arguments),o=e(t)||yb(Xe(t),Xe(we(r[0],sn,[])),[...Gt(we(r[1],Dr,[])),...ke(arguments,0,!0)]);return this._runTask(o,n)}};function e(t){return!sn(t)&&Te("git.commit: requires the commit message to be supplied as a string/string[]")}}var vb=k({"src/lib/tasks/commit.ts"(){bb(),R(),le()}});function wb(){return{firstCommit(){return this._runTask(Se(["rev-list","--max-parents=0","HEAD"],!0),oe(arguments))}}}var Cb=k({"src/lib/tasks/first-commit.ts"(){R(),le()}});function Eb(e,t){let r=["hash-object",e];if(t)r.push("-w");return Se(r,!0)}var $b=k({"src/lib/tasks/hash-object.ts"(){le()}});function kb(e,t,r){let n=String(r).trim(),o;if(o=Ta.exec(n))return new nn(e,t,!1,o[1]);if(o=Pa.exec(n))return new nn(e,t,!0,o[1]);let s="",i=n.split(" ");while(i.length)if(i.shift()==="in"){s=i.join(" ");break}return new nn(e,t,/^re/i.test(n),s)}var nn,Ta,Pa,Sb=k({"src/lib/responses/InitSummary.ts"(){nn=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},Ta=/^Init.+ repository in (.+)$/,Pa=/^Rein.+ in (.+)$/}});function Ob(e){return e.includes(Qo)}function Ab(e=!1,t,r){let n=["init",...r];if(e&&!Ob(n))n.splice(1,0,Qo);return{commands:n,format:"utf-8",parser(o){return kb(n.includes("--bare"),t,o)}}}var Qo,Fb=k({"src/lib/tasks/init.ts"(){Sb(),Qo="--bare"}});function es(e){for(let t=0;t<e.length;t++){let r=ts.exec(e[t]);if(r)return`--${r[1]}`}return""}function Tb(e){return ts.test(e)}var ts,_r=k({"src/lib/args/log-format.ts"(){ts=/^--(stat|numstat|name-only|name-status)(=|$)/}}),za,Pb=k({"src/lib/responses/DiffSummary.ts"(){za=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Ra(e=""){let t=Ia[e];return(r)=>Pe(new za,t,r,!1)}var wo,pu,fu,hu,Ia,Na=k({"src/lib/parsers/parse-diff-summary.ts"(){_r(),Pb(),_a(),R(),wo=[new L(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:Q(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new L(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:Q(r),after:Q(n),binary:!0})}),new L(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);e.changed=Q(t),e.insertions=Q(n?.[1]),e.deletions=Q(o?.[1])})],pu=[new L(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let o=Q(t),s=Q(r);e.changed++,e.insertions+=o,e.deletions+=s,e.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new L(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],fu=[new L(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],hu=[new L(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,o,s])=>{e.changed++,e.files.push({file:s??n,changes:0,insertions:0,deletions:0,binary:!1,status:ko(K_(t)&&t),from:ko(!!s&&n!==s&&n),similarity:Q(r)})})],Ia={[""]:wo,["--stat"]:wo,["--numstat"]:pu,["--name-status"]:hu,["--name-only"]:fu}}});function zb(e,t){return t.reduce((r,n,o)=>(r[n]=e[o]||"",r),Object.create({diff:null}))}function La(e=os,t=Za,r=""){let n=Ra(r);return function(o){let s=mr(o.trim(),!1,rs).map(function(i){let u=i.split(ns),a=zb(u[0].split(e),t);if(u.length>1&&!!u[1].trim())a.diff=n(u[1]);return a});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var rs,ns,os,Za,Ba=k({"src/lib/parsers/parse-list-log-summary.ts"(){R(),Na(),_r(),rs="\xF2\xF2\xF2\xF2\xF2\xF2 ",ns=" \xF2\xF2",os=" \xF2 ",Za=["hash","date","message","refs","author_name","author_email"]}}),Ma={};de(Ma,{diffSummaryTask:()=>Rb,validateLogFormatConfig:()=>Dn});function Rb(e){let t=es(e),r=["diff"];if(t==="")t="--stat",r.push("--stat=4096");return r.push(...e),Dn(r)||{commands:r,format:"utf-8",parser:Ra(t)}}function Dn(e){let t=e.filter(Tb);if(t.length>1)return Te(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return Te(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var ss=k({"src/lib/tasks/diff.ts"(){_r(),Na(),le()}});function Ib(e,t){let r=[],n=[];return Object.keys(e).forEach((o)=>{r.push(o),n.push(String(e[o]))}),[r,n.join(t)]}function Nb(e){return Object.keys(e).reduce((t,r)=>{if(!(r in Ro))t[r]=e[r];return t},{})}function ja(e={},t=[]){let r=we(e.splitter,ue,os),n=hn(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[o,s]=Ib(n,r),i=[],u=[`--pretty=format:${rs}${s}${ns}`,...t],a=e.n||e["max-count"]||e.maxCount;if(a)u.push(`--max-count=${a}`);if(e.from||e.to){let c=e.symmetric!==!1?"...":"..";i.push(`${e.from||""}${c}${e.to||""}`)}if(ue(e.file))u.push("--follow",Lt(e.file));return Go(Nb(e),u),{fields:o,splitter:r,commands:[...u,...i]}}function Lb(e,t,r){let n=La(e,t,es(r));return{commands:["log",...r],format:"utf-8",parser:n}}function Zb(){return{log(...r){let n=oe(arguments),o=ja(Wo(arguments),Gt(we(arguments[0],Dr,[]))),s=t(...r)||Dn(o.commands)||e(o);return this._runTask(s,n)}};function e(r){return Lb(r.splitter,r.fields,r.commands)}function t(r,n){return ue(r)&&ue(n)&&Te("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Ro,Ha=k({"src/lib/tasks/log.ts"(){_r(),Ba(),R(),le(),ss(),Ro=((e)=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(Ro||{})}}),on,Ua,Bb=k({"src/lib/responses/MergeSummary.ts"(){on=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},Ua=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){if(this.conflicts.length)return`CONFLICTS: ${this.conflicts.join(", ")}`;return"OK"}}}}),Io,Ga,Mb=k({"src/lib/responses/PullSummary.ts"(){Io=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ga=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Co(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function du(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:Q(t&&t[1]||"0"),delta:Q(r&&r[1]||"0")}}var Wa,jb=k({"src/lib/parsers/parse-remote-objects.ts"(){R(),Wa=[new ct(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),o=Co(e.remoteMessages);Object.assign(o,{[n]:Q(r)})}),new ct(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),o=Co(e.remoteMessages);Object.assign(o,{[n]:Q(r)})}),new ct(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let o=Co(e.remoteMessages);o.total=du(t),o.reused=du(r),o.packReused=Q(n)})]}});function Va(e,t){return Pe({remoteMessages:new Ja},qa,t)}var qa,Ja,Ka=k({"src/lib/parsers/parse-remote-messages.ts"(){R(),jb(),qa=[new ct(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Wa,new ct([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new ct([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:Q(t),summary:r,url:n}})],Ja=class{constructor(){this.all=[]}}}});function Hb(e,t){let r=Pe(new Ga,Ya,[e,t]);return r.message&&r}var mu,gu,Du,_u,Ya,bu,is,Xa=k({"src/lib/parsers/parse-pull.ts"(){Mb(),R(),Ka(),mu=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,gu=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Du=/^(create|delete) mode \d+ (.+)/,_u=[new L(mu,(e,[t,r,n])=>{if(e.files.push(t),r)e.insertions[t]=r.length;if(n)e.deletions[t]=n.length}),new L(gu,(e,[t,,r,,n])=>{if(r!==void 0||n!==void 0)return e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0;return!1}),new L(Du,(e,[t,r])=>{Ge(e.files,r),Ge(t==="create"?e.created:e.deleted,r)})],Ya=[new L(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new L(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new L(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,o])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=o,e.hash.remote=r})],bu=(e,t)=>Pe(new Io,_u,[e,t]),is=(e,t)=>Object.assign(new Io,bu(e,t),Va(e,t))}}),yu,Qa,xu,Ub=k({"src/lib/parsers/parse-merge.ts"(){Bb(),R(),Xa(),yu=[new L(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new L(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new on(t,r))}),new L(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new on(t,r,{deleteRef:n}))}),new L(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new on(t,null))}),new L(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Qa=(e,t)=>Object.assign(xu(e,t),is(e,t)),xu=(e)=>Pe(new Ua,yu,e)}});function vu(e){if(!e.length)return Te("Git.merge requires at least one option");return{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Qa(t,r);if(n.failed)throw new dr(n);return n}}}var Gb=k({"src/lib/tasks/merge.ts"(){Ut(),Ub(),le()}});function Wb(e,t,r){let n=r.includes("deleted"),o=r.includes("tag")||/^refs\/tags/.test(e),s=!r.includes("new");return{deleted:n,tag:o,branch:!o,new:!s,alreadyUpdated:s,local:e,remote:t}}var wu,ec,Cu,Vb=k({"src/lib/parsers/parse-push.ts"(){R(),Ka(),wu=[new L(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new L(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new L(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(Wb(t,r,n))}),new L(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:n}}),new L(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,o])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:o}}})],ec=(e,t)=>{let r=Cu(e,t),n=Va(e,t);return{...r,...n}},Cu=(e,t)=>Pe({pushed:[]},wu,[e,t])}}),tc={};de(tc,{pushTagsTask:()=>qb,pushTask:()=>us});function qb(e={},t){return Ge(t,"--tags"),us(e,t)}function us(e={},t){let r=["push",...t];if(e.branch)r.splice(1,0,e.branch);if(e.remote)r.splice(1,0,e.remote);return pn(r,"-v"),Ge(r,"--verbose"),Ge(r,"--porcelain"),{commands:r,format:"utf-8",parser:ec}}var rc=k({"src/lib/tasks/push.ts"(){Vb(),R()}});function Jb(){return{showBuffer(){let e=["show",...ke(arguments,1)];if(!e.includes("--binary"))e.splice(1,0,"--binary");return this._runTask(aa(e),oe(arguments))},show(){let e=["show",...ke(arguments,1)];return this._runTask(Se(e),oe(arguments))}}}var Kb=k({"src/lib/tasks/show.ts"(){R(),le()}}),Eu,nc,Yb=k({"src/lib/responses/FileStatusSummary.ts"(){Eu=/^(.+)\0(.+)$/,nc=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=Eu.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function $u(e){let[t,r]=e.split(jt);return{from:r||t,to:t}}function Ie(e,t,r){return[`${e}${t}`,r]}function Eo(e,...t){return t.map((r)=>Ie(e,r,(n,o)=>n.conflicted.push(o)))}function Xb(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(o,s,i){let u=`${o}${s}`,a=oc.get(u);if(a)a(e,i);if(u!=="##"&&u!=="!!")e.files.push(new nc(i,o,s))}}var ku,oc,sc,Qb=k({"src/lib/responses/StatusSummary.ts"(){R(),Yb(),ku=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},oc=new Map([Ie(" ","A",(e,t)=>e.created.push(t)),Ie(" ","D",(e,t)=>e.deleted.push(t)),Ie(" ","M",(e,t)=>e.modified.push(t)),Ie("A"," ",(e,t)=>{e.created.push(t),e.staged.push(t)}),Ie("A","M",(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Ie("D"," ",(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Ie("M"," ",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Ie("M","M",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Ie("R"," ",(e,t)=>{e.renamed.push($u(t))}),Ie("R","M",(e,t)=>{let r=$u(t);e.renamed.push(r),e.modified.push(r.to)}),Ie("!","!",(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Ie("?","?",(e,t)=>e.not_added.push(t)),...Eo("A","A","U"),...Eo("D","D","U"),...Eo("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,o=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,i=/\son\s(\S+?)(?=\.{3}|$)/,u=r.exec(t);if(e.ahead=u&&+u[1]||0,u=n.exec(t),e.behind=u&&+u[1]||0,u=o.exec(t),e.current=we(u?.[1],ue,null),u=s.exec(t),e.tracking=we(u?.[1],ue,null),u=i.exec(t),u)e.current=we(u?.[1],ue,e.current);e.detached=/\(no branch\)/.test(t)}]]),sc=function(e){let t=e.split(jt),r=new ku;for(let n=0,o=t.length;n<o;){let s=t[n++].trim();if(!s)continue;if(s.charAt(0)==="R")s+=jt+(t[n++]||"");Xb(r,s)}return r}}});function ey(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter((r)=>!ic.includes(r))],parser(r){return sc(r)}}}var ic,ty=k({"src/lib/tasks/status.ts"(){Qb(),ic=["--null","-z"]}});function cn(e=0,t=0,r=0,n="",o=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:o},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function ry(){return cn(0,0,0,"",!1)}function ny(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:oy,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(as));n(t)}})}}}function oy(e){if(e===as)return ry();return Pe(cn(0,0,0,e),uc,e)}var as,uc,sy=k({"src/lib/tasks/version.ts"(){R(),as="installed=false",uc=[new L(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,o=""])=>{Object.assign(e,cn(Q(t),Q(r),Q(n),o))}),new L(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,o=""])=>{Object.assign(e,cn(Q(t),Q(r),n,o))})]}});function Su(e,t,r,...n){if(!ue(r))return Te(`git.${e}() requires a string 'repoPath'`);return t(r,we(n[0],ue),ke(arguments))}function iy(){return{clone(e,...t){return this._runTask(Su("clone",No,we(e,ue),...t),oe(arguments))},mirror(e,...t){return this._runTask(Su("mirror",ac,we(e,ue),...t),oe(arguments))}}}var No,ac,uy=k({"src/lib/tasks/clone.ts"(){le(),R(),No=(e,t,r)=>{let n=["clone",...r];return ue(e)&&n.push(Lt(e)),ue(t)&&n.push(Lt(t)),Se(n)},ac=(e,t,r)=>(Ge(r,"--mirror"),No(e,t,r))}}),cc={};de(cc,{SimpleGitApi:()=>Lo});var Lo,ay=k({"src/lib/simple-git-api.ts"(){pb(),fb(),db(),Db(),vb(),ga(),Cb(),xa(),$b(),Fb(),Ha(),Gb(),rc(),Kb(),ty(),le(),sy(),R(),uy(),Lo=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);if(t)cb(e,n,t);return Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(Se(["add",...Xe(e)]),oe(arguments))}cwd(e){let t=oe(arguments);if(typeof e==="string")return this._runTask(lu(e,this._executor),t);if(typeof e?.path==="string")return this._runTask(lu(e.path,e.root&&this._executor||void 0),t);return this._runTask(Te("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(Eb(e,t===!0),oe(arguments))}init(e){return this._runTask(Ab(e===!0,this._executor.cwd,ke(arguments)),oe(arguments))}merge(){return this._runTask(vu(ke(arguments)),oe(arguments))}mergeFromTo(e,t){if(!(ue(e)&&ue(t)))return this._runTask(Te("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"));return this._runTask(vu([e,t,...ke(arguments)]),oe(arguments,!1))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=us({remote:we(arguments[0],ue),branch:we(arguments[1],ue)},ke(arguments));return this._runTask(e,oe(arguments))}stash(){return this._runTask(Se(["stash",...ke(arguments)]),oe(arguments))}status(){return this._runTask(ey(ke(arguments)),oe(arguments))}},Object.assign(Lo.prototype,hb(),iy(),xb(),J_(),gb(),wb(),Q_(),Zb(),Jb(),ny())}}),lc={};de(lc,{Scheduler:()=>fc});var Ou,fc,cy=k({"src/lib/runners/scheduler.ts"(){R(),$a(),Ou=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=pc.createDeferred();return{promise:t,done:r,id:e}}})(),fc=class{constructor(e=2){this.concurrency=e,this.logger=Xo("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=Ge(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),pn(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=Ge(this.pending,Ou());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),hc={};de(hc,{applyPatchTask:()=>ly});function ly(e,t){return Se(["apply",...t,...e])}var py=k({"src/lib/tasks/apply-patch.ts"(){le()}});function fy(e,t){return{branch:e,hash:t,success:!0}}function hy(e){return{branch:e,hash:null,success:!1}}var dc,dy=k({"src/lib/responses/BranchDeleteSummary.ts"(){dc=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function mc(e,t){return t===1&&Zo.test(e)}var Au,Zo,Fu,_n,my=k({"src/lib/parsers/parse-branch-delete.ts"(){dy(),R(),Au=/(\S+)\s+\(\S+\s([^)]+)\)/,Zo=/^error[^']+'([^']+)'/m,Fu=[new L(Au,(e,[t,r])=>{let n=fy(t,r);e.all.push(n),e.branches[t]=n}),new L(Zo,(e,[t])=>{let r=hy(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],_n=(e,t)=>Pe(new dc,Fu,[e,t])}}),gc,gy=k({"src/lib/responses/BranchSummary.ts"(){gc=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,o){if(e==="*")this.detached=t,this.current=r;this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:o}}}}});function Tu(e){return e?e.charAt(0):""}function Dc(e,t=!1){return Pe(new gc,t?[bc]:_c,e)}var _c,bc,Dy=k({"src/lib/parsers/parse-branch.ts"(){gy(),R(),_c=[new L(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,o])=>{e.push(Tu(t),!0,r,n,o)}),new L(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,n,o])=>{e.push(Tu(t),!1,r,n,o)})],bc=new L(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),yc={};de(yc,{branchLocalTask:()=>by,branchTask:()=>_y,containsDeleteBranchCommand:()=>xc,deleteBranchTask:()=>xy,deleteBranchesTask:()=>yy});function xc(e){let t=["-d","-D","--delete"];return e.some((r)=>t.includes(r))}function _y(e){let t=xc(e),r=e.includes("--show-current"),n=["branch",...e];if(n.length===1)n.push("-a");if(!n.includes("-v"))n.splice(1,0,"-v");return{format:"utf-8",commands:n,parser(o,s){if(t)return _n(o,s).all[0];return Dc(o,r)}}}function by(){return{format:"utf-8",commands:["branch","-v"],parser(e){return Dc(e)}}}function yy(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return _n(r,n)},onError({exitCode:r,stdOut:n},o,s,i){if(!mc(String(o),r))return i(o);s(n)}}}function xy(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,o){return _n(n,o).branches[e]},onError({exitCode:n,stdErr:o,stdOut:s},i,u,a){if(!mc(String(i),n))return a(i);throw new dr(r.parser(hr(s),hr(o)),String(i))}};return r}var vy=k({"src/lib/tasks/branch.ts"(){Ut(),my(),Dy(),R()}});function Cy(e){let t=e.trim().replace(/^["']|["']$/g,"");return t&&wy(t)}var vc,Ey=k({"src/lib/responses/CheckIgnore.ts"(){vc=(e)=>e.split(/\n/g).map(Cy).filter(Boolean)}}),wc={};de(wc,{checkIgnoreTask:()=>$y});function $y(e){return{commands:["check-ignore",...e],format:"utf-8",parser:vc}}var ky=k({"src/lib/tasks/check-ignore.ts"(){Ey()}});function Sy(e,t){return Pe({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},Cc,[e,t])}var Cc,Oy=k({"src/lib/parsers/parse-fetch.ts"(){R(),Cc=[new L(/From (.+)$/,(e,[t])=>{e.remote=t}),new L(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new L(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new L(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new L(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,o])=>{e.updated.push({name:n,tracking:o,to:r,from:t})})]}}),Ec={};de(Ec,{fetchTask:()=>Fy});function Ay(e){return/^--upload-pack(=|$)/.test(e)}function Fy(e,t,r){let n=["fetch",...r];if(e&&t)n.push(e,t);if(n.find(Ay))return Te("git.fetch: potential exploit argument blocked.");return{commands:n,format:"utf-8",parser:Sy}}var Ty=k({"src/lib/tasks/fetch.ts"(){Oy(),le()}});function Py(e){return Pe({moves:[]},$c,e)}var $c,zy=k({"src/lib/parsers/parse-move.ts"(){R(),$c=[new L(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),kc={};de(kc,{moveTask:()=>Ry});function Ry(e,t){return{commands:["mv","-v",...Xe(e),t],format:"utf-8",parser:Py}}var Iy=k({"src/lib/tasks/move.ts"(){zy(),R()}}),Sc={};de(Sc,{pullTask:()=>Ny});function Ny(e,t,r){let n=["pull",...r];if(e&&t)n.splice(1,0,e,t);return{commands:n,format:"utf-8",parser(o,s){return is(o,s)},onError(o,s,i,u){let a=Hb(hr(o.stdOut),hr(o.stdErr));if(a)return u(new dr(a));u(s)}}}var Ly=k({"src/lib/tasks/pull.ts"(){Ut(),Xa(),R()}});function Zy(e){let t={};return Oc(e,([r])=>t[r]={name:r}),Object.values(t)}function By(e){let t={};return Oc(e,([r,n,o])=>{if(!Object.hasOwn(t,r))t[r]={name:r,refs:{fetch:"",push:""}};if(o&&n)t[r].refs[o.replace(/[^a-z]/g,"")]=n}),Object.values(t)}function Oc(e,t){jo(e,(r)=>t(r.split(/\s+/)))}var My=k({"src/lib/responses/GetRemoteSummary.ts"(){R()}}),Ac={};de(Ac,{addRemoteTask:()=>jy,getRemotesTask:()=>Hy,listRemotesTask:()=>Uy,remoteTask:()=>Gy,removeRemoteTask:()=>Wy});function jy(e,t,r){return Se(["remote","add",...r,e,t])}function Hy(e){let t=["remote"];if(e)t.push("-v");return{commands:t,format:"utf-8",parser:e?By:Zy}}function Uy(e){let t=[...e];if(t[0]!=="ls-remote")t.unshift("ls-remote");return Se(t)}function Gy(e){let t=[...e];if(t[0]!=="remote")t.unshift("remote");return Se(t)}function Wy(e){return Se(["remote","remove",e])}var Vy=k({"src/lib/tasks/remote.ts"(){My(),le()}}),Fc={};de(Fc,{stashListTask:()=>qy});function qy(e={},t){let r=ja(e),n=["stash","list",...r.commands,...t],o=La(r.splitter,r.fields,es(n));return Dn(n)||{commands:n,format:"utf-8",parser:o}}var Jy=k({"src/lib/tasks/stash-list.ts"(){_r(),Ba(),ss(),Ha()}}),Tc={};de(Tc,{addSubModuleTask:()=>Ky,initSubModuleTask:()=>Yy,subModuleTask:()=>bn,updateSubModuleTask:()=>Xy});function Ky(e,t){return bn(["add",e,t])}function Yy(e){return bn(["init",...e])}function bn(e){let t=[...e];if(t[0]!=="submodule")t.unshift("submodule");return Se(t)}function Xy(e){return bn(["update",...e])}var Qy=k({"src/lib/tasks/sub-module.ts"(){le()}});function ex(e,t){let r=Number.isNaN(e),n=Number.isNaN(t);if(r!==n)return r?1:-1;return r?Pc(e,t):0}function Pc(e,t){return e===t?0:e>t?1:-1}function tx(e){return e.trim()}function en(e){if(typeof e==="string")return parseInt(e.replace(/^\D+/g,""),10)||0;return 0}var Pu,zc,rx=k({"src/lib/responses/TagList.ts"(){Pu=class{constructor(e,t){this.all=e,this.latest=t}},zc=function(e,t=!1){let r=e.split(`
42
- `).map(tx).filter(Boolean);if(!t)r.sort(function(o,s){let i=o.split("."),u=s.split(".");if(i.length===1||u.length===1)return ex(en(i[0]),en(u[0]));for(let a=0,c=Math.max(i.length,u.length);a<c;a++){let l=Pc(en(i[a]),en(u[a]));if(l)return l}return 0});let n=t?r[0]:[...r].reverse().find((o)=>o.indexOf(".")>=0);return new Pu(r,n)}}}),Rc={};de(Rc,{addAnnotatedTagTask:()=>sx,addTagTask:()=>ox,tagListTask:()=>nx});function nx(e=[]){let t=e.some((r)=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return zc(r,t)}}}function ox(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function sx(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var ix=k({"src/lib/tasks/tag.ts"(){rx()}}),ux=v_({"src/git.js"(e,t){var{GitExecutor:r}=(ab(),ce(Sa)),{SimpleGitApi:n}=(ay(),ce(cc)),{Scheduler:o}=(cy(),ce(lc)),{adhocExecTask:s,configurationErrorTask:i}=(le(),ce(To)),{asArray:u,filterArray:a,filterPrimitives:c,filterString:l,filterStringOrStringArray:p,filterType:f,getTrailingOptions:h,trailingFunctionArgument:d,trailingOptionsArgument:m}=(R(),ce(Xu)),{applyPatchTask:y}=(py(),ce(hc)),{branchTask:A,branchLocalTask:v,deleteBranchesTask:M,deleteBranchTask:G}=(vy(),ce(yc)),{checkIgnoreTask:I}=(ky(),ce(wc)),{checkIsRepoTask:F}=(ra(),ce(Qu)),{cleanWithOptionsTask:N,isCleanOptionsArray:P}=(ha(),ce(pa)),{diffSummaryTask:Z}=(ss(),ce(Ma)),{fetchTask:g}=(Ty(),ce(Ec)),{moveTask:he}=(Iy(),ce(kc)),{pullTask:re}=(Ly(),ce(Sc)),{pushTagsTask:ee}=(rc(),ce(tc)),{addRemoteTask:b,getRemotesTask:_,listRemotesTask:Fe,remoteTask:V,removeRemoteTask:ve}=(Vy(),ce(Ac)),{getResetMode:$e,resetTask:ae}=(Ea(),ce(va)),{stashListTask:ut}=(Jy(),ce(Fc)),{addSubModuleTask:Dt,initSubModuleTask:rt,subModuleTask:Je,updateSubModuleTask:B}=(Qy(),ce(Tc)),{addAnnotatedTagTask:Tt,addTagTask:io,tagListTask:E}=(ix(),ce(Rc)),{straightThroughBufferTask:X,straightThroughStringTask:w}=(le(),ce(To));function C(x,S){this._plugins=S,this._executor=new r(x.baseDir,new o(x.maxConcurrentProcesses),S),this._trimmed=x.trimmed}(C.prototype=Object.create(n.prototype)).constructor=C,C.prototype.customBinary=function(x){return this._plugins.reconfigure("binary",x),this},C.prototype.env=function(x,S){if(arguments.length===1&&typeof x==="object")this._executor.env=x;else(this._executor.env=this._executor.env||{})[x]=S;return this},C.prototype.stashList=function(x){return this._runTask(ut(m(arguments)||{},a(x)&&x||[]),d(arguments))},C.prototype.mv=function(x,S){return this._runTask(he(x,S),d(arguments))},C.prototype.checkoutLatestTag=function(x){var S=this;return this.pull(function(){S.tags(function(z,ne){S.checkout(ne.latest,x)})})},C.prototype.pull=function(x,S,z,ne){return this._runTask(re(f(x,l),f(S,l),h(arguments)),d(arguments))},C.prototype.fetch=function(x,S){return this._runTask(g(f(x,l),f(S,l),h(arguments)),d(arguments))},C.prototype.silent=function(x){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},C.prototype.tags=function(x,S){return this._runTask(E(h(arguments)),d(arguments))},C.prototype.rebase=function(){return this._runTask(w(["rebase",...h(arguments)]),d(arguments))},C.prototype.reset=function(x){return this._runTask(ae($e(x),h(arguments)),d(arguments))},C.prototype.revert=function(x){let S=d(arguments);if(typeof x!=="string")return this._runTask(i("Commit must be a string"),S);return this._runTask(w(["revert",...h(arguments,0,!0),x]),S)},C.prototype.addTag=function(x){let S=typeof x==="string"?io(x):i("Git.addTag requires a tag name");return this._runTask(S,d(arguments))},C.prototype.addAnnotatedTag=function(x,S){return this._runTask(Tt(x,S),d(arguments))},C.prototype.deleteLocalBranch=function(x,S,z){return this._runTask(G(x,typeof S==="boolean"?S:!1),d(arguments))},C.prototype.deleteLocalBranches=function(x,S,z){return this._runTask(M(x,typeof S==="boolean"?S:!1),d(arguments))},C.prototype.branch=function(x,S){return this._runTask(A(h(arguments)),d(arguments))},C.prototype.branchLocal=function(x){return this._runTask(v(),d(arguments))},C.prototype.raw=function(x){let S=!Array.isArray(x),z=[].slice.call(S?arguments:x,0);for(let De=0;De<z.length&&S;De++)if(!c(z[De])){z.splice(De,z.length-De);break}z.push(...h(arguments,0,!0));var ne=d(arguments);if(!z.length)return this._runTask(i("Raw: must supply one or more command to execute"),ne);return this._runTask(w(z,this._trimmed),ne)},C.prototype.submoduleAdd=function(x,S,z){return this._runTask(Dt(x,S),d(arguments))},C.prototype.submoduleUpdate=function(x,S){return this._runTask(B(h(arguments,!0)),d(arguments))},C.prototype.submoduleInit=function(x,S){return this._runTask(rt(h(arguments,!0)),d(arguments))},C.prototype.subModule=function(x,S){return this._runTask(Je(h(arguments)),d(arguments))},C.prototype.listRemote=function(){return this._runTask(Fe(h(arguments)),d(arguments))},C.prototype.addRemote=function(x,S,z){return this._runTask(b(x,S,h(arguments)),d(arguments))},C.prototype.removeRemote=function(x,S){return this._runTask(ve(x),d(arguments))},C.prototype.getRemotes=function(x,S){return this._runTask(_(x===!0),d(arguments))},C.prototype.remote=function(x,S){return this._runTask(V(h(arguments)),d(arguments))},C.prototype.tag=function(x,S){let z=h(arguments);if(z[0]!=="tag")z.unshift("tag");return this._runTask(w(z),d(arguments))},C.prototype.updateServerInfo=function(x){return this._runTask(w(["update-server-info"]),d(arguments))},C.prototype.pushTags=function(x,S){let z=ee({remote:f(x,l)},h(arguments));return this._runTask(z,d(arguments))},C.prototype.rm=function(x){return this._runTask(w(["rm","-f",...u(x)]),d(arguments))},C.prototype.rmKeepLocal=function(x){return this._runTask(w(["rm","--cached",...u(x)]),d(arguments))},C.prototype.catFile=function(x,S){return this._catFile("utf-8",arguments)},C.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},C.prototype._catFile=function(x,S){var z=d(S),ne=["cat-file"],De=S[0];if(typeof De==="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),z);if(Array.isArray(De))ne.push.apply(ne,De);let Ke=x==="buffer"?X(ne):w(ne);return this._runTask(Ke,z)},C.prototype.diff=function(x,S){let z=l(x)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):w(["diff",...h(arguments)]);return this._runTask(z,d(arguments))},C.prototype.diffSummary=function(){return this._runTask(Z(h(arguments,1)),d(arguments))},C.prototype.applyPatch=function(x){let S=!p(x)?i("git.applyPatch requires one or more string patches as the first argument"):y(u(x),h([].slice.call(arguments,1)));return this._runTask(S,d(arguments))},C.prototype.revparse=function(){let x=["rev-parse",...h(arguments,!0)];return this._runTask(w(x,!0),d(arguments))},C.prototype.clean=function(x,S,z){let ne=P(x),De=ne&&x.join("")||f(x,l)||"",Ke=h([].slice.call(arguments,ne?1:0));return this._runTask(N(De,Ke),d(arguments))},C.prototype.exec=function(x){let S={commands:[],format:"utf-8",parser(){if(typeof x==="function")x()}};return this._runTask(S)},C.prototype.clearQueue=function(){return this._runTask(s(()=>console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},C.prototype.checkIgnore=function(x,S){return this._runTask(I(u(f(x,p,[]))),d(arguments))},C.prototype.checkIsRepo=function(x,S){return this._runTask(F(f(x,l)),d(arguments))},t.exports=C}});lt();var ax=class extends ot{constructor(e,t){super(void 0,t);this.config=e}};lt();lt();var Ht=class extends ot{constructor(e,t,r){super(e,r);this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Ut();Zu();ra();ha();ga();_a();xa();Ea();function cx(e){if(!e)return;return[{type:"spawn.before",action(n,o){if(e.aborted)o.kill(new Ht(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Ht(void 0,"abort","Abort signal received"))}e.addEventListener("abort",s),o.spawned.on("close",()=>e.removeEventListener("abort",s))}}]}function lx(e={}){return{type:"spawn.args",action(t,{env:r}){for(let n of iu(t,r))if(e[n.category]!==!0)throw new Ht(void 0,"unsafe",n.message);return t}}}R();function px(e){let t=fr(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}R();var zu=Mt.deferred().promise;function fx({onClose:e=!0,onExit:t=50}={}){function r(){let o=-1,s={close:Mt.deferred(),closeTimeout:Mt.deferred(),exit:Mt.deferred(),exitTimeout:Mt.deferred()},i=Promise.race([e===!1?zu:s.closeTimeout.promise,t===!1?zu:s.exitTimeout.promise]);return n(e,s.close,s.closeTimeout),n(t,s.exit,s.exitTimeout),{close(u){o=u,s.close.done()},exit(u){o=u,s.exit.done()},get exitCode(){return o},result:i}}function n(o,s,i){if(o===!1)return;(o===!0?s.promise:s.promise.then(()=>$o(o))).then(i.done)}return{type:"spawn.after",async action(o,{spawned:s,close:i}){let u=r(),a=!0,c=()=>void(a=!1);s.stdout?.on("data",c),s.stderr?.on("data",c),s.on("error",c),s.on("close",(l)=>u.close(l)),s.on("exit",(l)=>u.exit(l));try{if(await u.result,a)await $o(50);i(u.exitCode)}catch(l){i(u.exitCode,l)}}}}R();var hx="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Ru="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function dx(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function Iu(e,t){if(e.length<1||e.length>2)throw new Ht(void 0,"binary",hx);if(e.some(dx))if(t)console.warn(Ru);else throw new Ht(void 0,"binary",Ru);let[n,o]=e;return{binary:n,prefix:o}}function mx(e,t=["git"],r=!1){let n=Iu(Xe(t),r);e.on("binary",(o)=>{n=Iu(Xe(o),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",(o)=>n.prefix?[n.prefix,...o]:o)}lt();function gx(e){return!!(e.exitCode&&e.stdErr.length)}function Dx(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function _x(e=!1,t=gx,r=Dx){return(n,o)=>{if(!e&&n||!t(o))return n;return r(o)}}function Nu(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});if(Buffer.isBuffer(n))return{error:new ot(void 0,n.toString("utf-8"))};return{error:n}}}}R();var yx=class{constructor(){this.plugins=new Set,this.events=new bx}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=Ge(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return Xe(e).forEach((r)=>r&&this.plugins.add(Ge(t,r))),()=>{t.forEach((r)=>this.plugins.delete(r))}}exec(e,t,r){let n=t,o=Object.freeze(Object.create(r));for(let s of this.plugins)if(s.type===e)n=s.action(n,o);return n}};R();function xx(e){let r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,i){if(!r.includes(i.method))return s;return Gu(s,"--progress")}},{type:"spawn.after",action(s,i){if(!i.commands.includes("--progress"))return;i.spawned.stderr?.on("data",(u)=>{let a=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(u.toString("utf8"));if(!a)return;e({method:i.method,stage:vx(a[1]),progress:Q(a[2]),processed:Q(a[3]),total:Q(a[4])})})}}]}function vx(e){return String(e.toLowerCase().split(" ",1))||"unknown"}R();function wx(e){let t=Vu(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function Cx({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,o){let s;function i(){s&&clearTimeout(s),s=setTimeout(a,e)}function u(){o.spawned.stdout?.off("data",i),o.spawned.stderr?.off("data",i),o.spawned.off("exit",u),o.spawned.off("close",u),s&&clearTimeout(s)}function a(){u(),o.kill(new Ht(void 0,"timeout","block timeout reached"))}r&&o.spawned.stdout?.on("data",i),t&&o.spawned.stderr?.on("data",i),o.spawned.on("exit",u),o.spawned.on("close",u),i()}}}function Ex(){return{type:"spawn.args",action(e){let t=[],r;function n(o){(r=r||[]).push(...o)}for(let o=0;o<e.length;o++){let s=e[o];if(je(s)){n(Zt(s));continue}if(s==="--"){n(e.slice(o+1).flatMap((i)=>je(i)&&Zt(i)||i));break}t.push(s)}return!r?t:[...t,"--",...r.map(String)]}}}R();var $x=ux();function kx(e,t){let r=new yx,n=Ku(e&&(typeof e==="string"?{baseDir:e}:e)||{},t);if(!Ho(n.baseDir))throw new ax(n,"Cannot use simple-git on a directory that does not exist");if(Array.isArray(n.config))r.add(px(n.config));return r.add(lx(n.unsafe)),r.add(fx(n.completion)),n.abort&&r.add(cx(n.abort)),n.progress&&r.add(xx(n.progress)),n.timeout&&r.add(Cx(n.timeout)),n.spawnOptions&&r.add(wx(n.spawnOptions)),r.add(Ex()),r.add(Nu(_x(!0))),n.errors&&r.add(Nu(n.errors)),mx(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new $x(n,r)}Ut();var Ic=kx;import{stat as Ld}from"fs/promises";import{dirname as IC,join as NC,resolve as LC}from"path";import{readdir as lv,readdirSync as pv,realpath as fv,realpathSync as hv,stat as dv,statSync as mv}from"fs";import{isAbsolute as gv,posix as Ct,resolve as Dv}from"path";import{fileURLToPath as _v}from"url";import{createRequire as Sx}from"module";import{basename as Ox,dirname as ls,normalize as Ax,relative as Fx,resolve as Tx,sep as Zc}from"path";import*as Px from"fs";var Nc=Sx(import.meta.url);function zx(e){let t=Ax(e);if(t.length>1&&t[t.length-1]===Zc)t=t.substring(0,t.length-1);return t}var Rx=/[\\/]/g;function Bc(e,t){return e.replace(Rx,t)}var Ix=/^[a-z]:[\\/]$/i;function Nx(e){return e==="/"||Ix.test(e)}function cs(e,t){let{resolvePaths:r,normalizePath:n,pathSeparator:o}=t,s=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r)e=Tx(e);if(n||s)e=zx(e);if(e===".")return"";let i=e[e.length-1]!==o;return Bc(i?e+o:e,o)}function Mc(e,t){return t+e}function Lx(e,t){return function(r,n){if(n.startsWith(e))return n.slice(e.length)+r;else return Bc(Fx(e,n),t.pathSeparator)+t.pathSeparator+r}}function Zx(e){return e}function Bx(e,t,r){return t+e+r}function Mx(e,t){let{relativePaths:r,includeBasePath:n}=t;return r&&e?Lx(e,t):n?Mc:Zx}function jx(e){return function(t,r){r.push(t.substring(e.length)||".")}}function Hx(e){return function(t,r,n){let o=t.substring(e.length)||".";if(n.every((s)=>s(o,!0)))r.push(o)}}var Ux=(e,t)=>{t.push(e||".")},Gx=(e,t,r)=>{let n=e||".";if(r.every((o)=>o(n,!0)))t.push(n)},Wx=()=>{};function Vx(e,t){let{includeDirs:r,filters:n,relativePaths:o}=t;if(!r)return Wx;if(o)return n&&n.length?Hx(e):jx(e);return n&&n.length?Gx:Ux}var qx=(e,t,r,n)=>{if(n.every((o)=>o(e,!1)))r.files++},Jx=(e,t,r,n)=>{if(n.every((o)=>o(e,!1)))t.push(e)},Kx=(e,t,r,n)=>{r.files++},Yx=(e,t)=>{t.push(e)},Xx=()=>{};function Qx(e){let{excludeFiles:t,filters:r,onlyCounts:n}=e;if(t)return Xx;if(r&&r.length)return n?qx:Jx;else if(n)return Kx;else return Yx}var e0=(e)=>e,t0=()=>[""].slice(0,0);function r0(e){return e.group?t0:e0}var n0=(e,t,r)=>{e.push({directory:t,files:r,dir:t})},o0=()=>{};function s0(e){return e.group?n0:o0}var i0=function(e,t,r){let{queue:n,fs:o,options:{suppressErrors:s}}=t;n.enqueue(),o.realpath(e,(i,u)=>{if(i)return n.dequeue(s?null:i,t);o.stat(u,(a,c)=>{if(a)return n.dequeue(s?null:a,t);if(c.isDirectory()&&jc(e,u,t))return n.dequeue(null,t);r(c,u),n.dequeue(null,t)})})},u0=function(e,t,r){let{queue:n,fs:o,options:{suppressErrors:s}}=t;n.enqueue();try{let i=o.realpathSync(e),u=o.statSync(i);if(u.isDirectory()&&jc(e,i,t))return;r(u,i)}catch(i){if(!s)throw i}};function a0(e,t){if(!e.resolveSymlinks||e.excludeSymlinks)return null;return t?u0:i0}function jc(e,t,r){if(r.options.useRealPaths)return c0(t,r);let n=ls(e),o=1;while(n!==r.root&&o<2){let s=r.symlinks.get(n);if(!!s&&(s===t||s.startsWith(t)||t.startsWith(s)))o++;else n=ls(n)}return r.symlinks.set(e,t),o>1}function c0(e,t){return t.visited.includes(e+t.options.pathSeparator)}var l0=(e)=>e.counts,p0=(e)=>e.groups,f0=(e)=>e.paths,h0=(e)=>e.paths.slice(0,e.options.maxFiles),d0=(e,t,r)=>(yn(t,r,e.counts,e.options.suppressErrors),null),m0=(e,t,r)=>(yn(t,r,e.paths,e.options.suppressErrors),null),g0=(e,t,r)=>(yn(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),D0=(e,t,r)=>(yn(t,r,e.groups,e.options.suppressErrors),null);function yn(e,t,r,n){if(e&&!n)t(e,r);else t(null,r)}function _0(e,t){let{onlyCounts:r,group:n,maxFiles:o}=e;if(r)return t?l0:d0;else if(n)return t?p0:D0;else if(o)return t?h0:g0;else return t?f0:m0}var Hc={withFileTypes:!0},b0=(e,t,r,n,o)=>{if(e.queue.enqueue(),n<0)return e.queue.dequeue(null,e);let{fs:s}=e;e.visited.push(t),e.counts.directories++,s.readdir(t||".",Hc,(i,u=[])=>{o(u,r,n),e.queue.dequeue(e.options.suppressErrors?null:i,e)})},y0=(e,t,r,n,o)=>{let{fs:s}=e;if(n<0)return;e.visited.push(t),e.counts.directories++;let i=[];try{i=s.readdirSync(t||".",Hc)}catch(u){if(!e.options.suppressErrors)throw u}o(i,r,n)};function x0(e){return e?y0:b0}var v0=class{count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){if(this.onQueueEmpty&&(--this.count<=0||e)){if(this.onQueueEmpty(e,t),e)t.controller.abort(),this.onQueueEmpty=void 0}}},w0=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}get dirs(){return this._directories}},C0=class{aborted=!1;abort(){this.aborted=!0}},Uc=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,r){this.isSynchronous=!r,this.callbackInvoker=_0(t,this.isSynchronous),this.root=cs(e,t),this.state={root:Nx(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new w0,options:t,queue:new v0((n,o)=>this.callbackInvoker(o,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new C0,fs:t.fs||Px},this.joinPath=Mx(this.root,t),this.pushDirectory=Vx(this.root,t),this.pushFile=Qx(t),this.getArray=r0(t),this.groupFiles=s0(t),this.resolveSymlink=a0(t,this.isSynchronous),this.walkDirectory=x0(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,r)=>{let{paths:n,options:{filters:o,resolveSymlinks:s,excludeSymlinks:i,exclude:u,maxFiles:a,signal:c,useRealPaths:l,pathSeparator:p},controller:f}=this.state;if(f.aborted||c&&c.aborted||a&&n.length>a)return;let h=this.getArray(this.state.paths);for(let d=0;d<e.length;++d){let m=e[d];if(m.isFile()||m.isSymbolicLink()&&!s&&!i){let y=this.joinPath(m.name,t);this.pushFile(y,h,this.state.counts,o)}else if(m.isDirectory()){let y=Bx(m.name,t,this.state.options.pathSeparator);if(u&&u(m.name,y))continue;this.pushDirectory(y,n,o),this.walkDirectory(this.state,y,y,r-1,this.walk)}else if(this.resolveSymlink&&m.isSymbolicLink()){let y=Mc(m.name,t);this.resolveSymlink(y,this.state,(A,v)=>{if(A.isDirectory()){if(v=cs(v,this.state.options),u&&u(m.name,l?v:y+p))return;this.walkDirectory(this.state,v,l?v:y+p,r-1,this.walk)}else{v=l?v:y;let M=Ox(v),G=cs(ls(v),this.state.options);v=this.joinPath(M,G),this.pushFile(v,h,this.state.counts,o)}})}}this.groupFiles(this.state.groups,t,h)}};function E0(e,t){return new Promise((r,n)=>{Gc(e,t,(o,s)=>{if(o)return n(o);r(s)})})}function Gc(e,t,r){new Uc(e,t,r).start()}function $0(e,t){return new Uc(e,t).start()}var Lc=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return E0(this.root,this.options)}withCallback(e){Gc(this.root,this.options,e)}sync(){return $0(this.root,this.options)}},Wc=null;try{Nc.resolve("picomatch"),Wc=Nc("picomatch")}catch{}var Vc=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:Zc,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new Lc(e||".",this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new Lc(e||".",this.options)}glob(...e){if(this.globFunction)return this.globWithOptions(e);return this.globWithOptions(e,...[{dot:!0}])}globWithOptions(e,...t){let r=this.globFunction||Wc;if(!r)throw Error("Please specify a glob function to use glob matching.");var n=this.globCache[e.join("\x00")];if(!n)n=r(e,...t),this.globCache[e.join("\x00")]=n;return this.options.filters.push((o)=>n(o)),this}};var qt=at(gl(),1),bv=Array.isArray,yl=/\\/g,yv=/^[A-Za-z]:$/,xl=process.platform==="win32",xv=/^(\/?\.\.)+$/;function vv(e,t={}){let r=e.length,n=Array(r),o=Array(r),s,i;for(s=0;s<r;s++){let u=vl(e[s]);n[s]=u;let a=u.length,c=Array(a);for(i=0;i<a;i++)c[i]=qt.default(u[i],t);o[s]=c}return(u)=>{let a=u.split("/");if(a[0]===".."&&xv.test(u))return!0;for(s=0;s<r;s++){let c=n[s],l=o[s],p=a.length,f=Math.min(p,c.length);i=0;while(i<f){let h=c[i];if(h.includes("/"))return!0;if(!l[i](a[i]))break;if(!t.noglobstar&&h==="**")return!0;i++}if(i===p)return!0}return!1}}var wv=/^[A-Z]:\/$/i,Cv=xl?(e)=>wv.test(e):(e)=>e==="/";function Dl(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){let o=e.length+ +!Cv(e);return(s,i)=>s.slice(o,i?-1:void 0)||"."}let n=t.slice(e.length+1);if(n)return(o,s)=>{if(o===".")return n;let i=`${n}/${o}`;return s?i.slice(0,-1):i};return(o,s)=>s&&o!=="."?o.slice(0,-1):o}if(r)return(n)=>Ct.relative(e,n)||".";return(n)=>Ct.relative(e,`${t}/${n}`)||"."}function Ev(e,t){if(t.startsWith(`${e}/`)){let r=t.slice(e.length+1);return(n)=>`${r}/${n}`}return(r)=>{let n=Ct.relative(e,`${t}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function _l(e){return e.replace(yv,(t)=>`${t}/`)}var $v={parts:!0};function vl(e){var t;let r=qt.default.scan(e,$v);return((t=r.parts)===null||t===void 0?void 0:t.length)?r.parts:[e]}var kv=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Sv=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ov=(e)=>e.replace(kv,"\\$&"),Av=(e)=>e.replace(Sv,"\\$&"),Fv=xl?Av:Ov;function Tv(e,t){if((t===null||t===void 0?void 0:t.caseSensitiveMatch)===!1)return!0;let r=qt.default.scan(e);return r.isGlob||r.negated}function vr(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}function wl(e){return typeof e==="string"?[e]:e!==null&&e!==void 0?e:[]}var Pv=/^(\/?\.\.)+/,zv=/\\(?=[()[\]{}!*+?@|])/g;function bs(e,t,r,n){var o;let s=t.cwd,i=e;if(e[e.length-1]==="/")i=e.slice(0,-1);if(i[i.length-1]!=="*"&&t.expandDirectories)i+="/**";let u=Fv(s);i=gv(i.replace(zv,""))?Ct.relative(u,i):Ct.normalize(i);let a=(o=Pv.exec(i))===null||o===void 0?void 0:o[0],c=vl(i);if(a){let p=(a.length+1)/3,f=0,h=u.split("/");while(f<p&&c[f+p]===h[h.length+f-p])i=i.slice(0,(p-f-1)*3)+i.slice((p-f)*3+c[f+p].length+1)||".",f++;let d=Ct.join(s,a.slice(f*3));if(d[0]!=="."&&r.root.length>d.length)r.root=_l(d),r.depthOffset=-p+f}if(!n&&r.depthOffset>=0){var l;(l=r.commonPath)!==null&&l!==void 0||(r.commonPath=c);let p=[],f=Math.min(r.commonPath.length,c.length);for(let h=0;h<f;h++){let d=c[h];if(d==="**"&&!c[h+1]){p.pop();break}if(h===c.length-1||d!==r.commonPath[h]||Tv(d))break;p.push(d)}r.depthOffset=p.length,r.commonPath=p,r.root=_l(p.length>0?Ct.join(s,...p):s)}return i}function Rv(e,t,r){let n=[],o=[];for(let s of e.ignore){if(!s)continue;if(s[0]!=="!"||s[1]==="(")o.push(bs(s,e,r,!0))}for(let s of t){if(!s)continue;if(s[0]!=="!"||s[1]==="(")n.push(bs(s,e,r,!1));else if(s[1]!=="!"||s[2]==="(")o.push(bs(s.slice(1),e,r,!0))}return{match:n,ignore:o}}function Iv(e,t){let r=e.cwd,n={root:r,depthOffset:0},o=Rv(e,t,n);if(e.debug)vr("internal processing patterns:",o);let{absolute:s,caseSensitiveMatch:i,debug:u,dot:a,followSymbolicLinks:c,onlyDirectories:l}=e,p=n.root.replace(yl,""),f={dot:a,nobrace:e.braceExpansion===!1,nocase:!i,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},h=qt.default(o.match,f),d=qt.default(o.ignore,f),m=vv(o.match,f),y=Dl(r,p,s),A=s?y:Dl(r,p,!0),v=(I,F)=>{let N=A(F,!0);return N!=="."&&!m(N)||d(N)},M;if(e.deep!==void 0)M=Math.round(e.deep-n.depthOffset);let G=new Vc({filters:[u?(I,F)=>{let N=y(I,F),P=h(N)&&!d(N);if(P)vr(`matched ${N}`);return P}:(I,F)=>{let N=y(I,F);return h(N)&&!d(N)}],exclude:u?(I,F)=>{let N=v(I,F);return vr(`${N?"skipped":"crawling"} ${F}`),N}:v,fs:e.fs,pathSeparator:"/",relativePaths:!s,resolvePaths:s,includeBasePath:s,resolveSymlinks:c,excludeSymlinks:!c,excludeFiles:l,includeDirs:l||!e.onlyFiles,maxDepth:M,signal:e.signal}).crawl(p);if(e.debug)vr("internal properties:",{...n,root:p});return[G,r!==p&&!s&&Ev(r,p)]}function Nv(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}var bl={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Lv(e){let t=Object.assign({},e);for(let r in bl)if(t[r]===void 0)Object.assign(t,{[r]:bl[r]});if(t.cwd=(t.cwd instanceof URL?_v(t.cwd):Dv(t.cwd||process.cwd())).replace(yl,"/"),t.ignore=wl(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||lv,readdirSync:t.fs.readdirSync||pv,realpath:t.fs.realpath||fv,realpathSync:t.fs.realpathSync||hv,stat:t.fs.stat||dv,statSync:t.fs.statSync||mv}),t.debug)vr("globbing with options:",t);return t}function Zv(e,t={}){var r;if(e&&(t===null||t===void 0?void 0:t.patterns))throw Error("Cannot pass patterns as both an argument and an option");let n=bv(e)||typeof e==="string",o=wl((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),s=Lv(n?t:e);return o.length>0?Iv(s,o):[]}async function Cl(e,t){let[r,n]=Zv(e,t);return r?Nv(await r.withPromise(),n):[]}var{YAML:Td}=globalThis.Bun;function wn(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function xs(e,t="|"){return e.map((r)=>Cs(r)).join(t)}function Er(e,t){if(typeof t==="bigint")return t.toString();return t}function Cn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function El(e){return e===null||e===void 0}function En(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function $l(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function Ce(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ft(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function kl(e){return JSON.stringify(e)}function Sl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var vs="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Ol=Cn(()=>{if(Le.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Jt(e){if(Cr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Cr(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function ws(e){if(Jt(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Al=new Set(["string","number","symbol"]);function Kt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qe(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function T(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Cs(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Fl(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Tl=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))();function Bv(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=ft(e._zod.def,{get shape(){let i={};for(let u of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(r.shape,u))throw Error(`Unrecognized key: "${String(u)}"`);if(!t[u])continue;Ce(i,u,r.shape[u])}return Ce(this,"shape",i),i},checks:[]});return Qe(e,s)}function Mv(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=ft(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let u of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(r.shape,u))throw Error(`Unrecognized key: "${String(u)}"`);if(!t[u])continue;delete i[u]}return Ce(this,"shape",i),i},checks:[]});return Qe(e,s)}function jv(e,t){if(!Jt(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=ft(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ce(this,"shape",s),s}});return Qe(e,o)}function Hv(e,t){if(!Jt(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=ft(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ce(this,"shape",n),n}});return Qe(e,r)}function Uv(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=ft(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ce(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Qe(e,r)}function Pl(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let u=ft(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let l of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(a,l))throw Error(`Unrecognized key: "${String(l)}"`);if(!r[l])continue;c[l]=e?new e({type:"optional",innerType:a[l]}):a[l]}else for(let l of Reflect.ownKeys(a))c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return Ce(this,"shape",c),c},checks:[]});return Qe(t,u)}function Gv(e,t,r){let n=ft(t._zod.def,{get shape(){let o=t._zod.def.shape,s={...o};if(r)for(let i of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(s,i))throw Error(`Unrecognized key: "${String(i)}"`);if(!r[i])continue;s[i]=new e({type:"nonoptional",innerType:o[i]})}else for(let i of Reflect.ownKeys(o))s[i]=new e({type:"nonoptional",innerType:o[i]});return Ce(this,"shape",s),s}});return Qe(t,n)}function $t(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function zl(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function $n(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function wr(e){return typeof e==="string"?e:e?.message}function Es(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function ht(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:wr(e.inst?._zod.def?.error?.(e))??wr(s?.(e))??wr(t?.error?.(e))??wr(r.customError?.(e))??wr(r.localeError?.(e))??"Invalid input",{inst:u,schema:a,continue:c,input:l,...p}=e;if(p.path??(p.path=[]),p.message=i,t?.reportInput)p.input=l;return p}var Wv=/[\uD800-\uDBFF]/;function kn(e){let t=e.length;if(!Wv.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function Sn(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Rl(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function kt(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function Il(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else Vv(e,r,n.value)}}function Et(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function $s(e,t,r){return Et(e,t,r,!1)}function Vv(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Et(this,t,r.bind(this))},set(n){Et(this,t,n)}})}function qv(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var ys,pt=!1,Jv={configurable:!0,get(){pt=!0;return}};function J(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&ys!==e._zod){ys=void 0;return}ys=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Jv);let o=pt;pt=!1;try{let s=r(this);if(pt)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return pt=pt||o,s}catch(s){throw delete this[t],pt=pt||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Kv(e,t,r,n){let o=qv(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var Yv="~constantCatch";function Nl(e){let t=()=>e;return t[Yv]=!0,t}var Ll;var ks={value:void 0,enumerable:!1},Zl="captureStackTrace"in Error?Error:null;function Xv(e){let t=Zl;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Zl=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function D(e,t,r,n){let o={};function s(f){this.def=f,this.constr=p,this.traits=new Set}s.prototype=o;let i=r,u=i&&new WeakSet;function a(f,h){if(!f._zod){ks.value=new s(h);try{Object.defineProperty(f,"_zod",ks)}finally{ks.value=void 0}}if(f._zod.traits.has(e))return;if(f._zod.traits.add(e),t(f,h),u){let m=Object.getPrototypeOf(f),y=f._zod.constr.prototype,A=m;while(A&&A!==y)A=Object.getPrototypeOf(A);let v=A??m;if(!u.has(v))u.add(v),Il(v,i)}let d=p.prototype;for(let m in d){if(!Object.prototype.hasOwnProperty.call(d,m))continue;if(!(m in f))f[m]=d[m].bind(f)}}let c=n?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function p(f){let h=n?.Parent?Xv(l):this;a(h,f);let d=h._zod.deferred;if(d){for(let y of d)y();h._zod.deferred=void 0}let m=globalThis.__zod_globalConfig?.postProcessor;if(m)m(h);return h}return Object.defineProperty(p,"init",{value:a}),Object.defineProperty(p,Symbol.hasInstance,{value:(f)=>{if(n?.Parent&&f instanceof n.Parent)return!0;return f?._zod?.traits?.has(e)}}),Object.defineProperty(p,"name",{value:e}),p}class st extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class $r extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Ll=globalThis).__zod_globalConfig??(Ll.__zod_globalConfig={});var Le=globalThis.__zod_globalConfig;function Ve(e){if(e)Object.assign(Le,e);return Le}function Qv(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Er,2)),e.message}function ew(e){this._zod.message=e}var tw={get:Qv,set:ew,enumerable:!0,configurable:!0},Os={value:void 0,enumerable:!1},As={value:void 0,enumerable:!1},Bl=new WeakSet([Object.prototype,Error.prototype]),Ml=(e,t)=>{e.name="$ZodError",Os.value=e._zod,Object.defineProperty(e,"_zod",Os),As.value=t,Object.defineProperty(e,"issues",As),Os.value=void 0,As.value=void 0,Object.defineProperty(e,"message",tw);let r=Object.getPrototypeOf(e);if(!Bl.has(r))Bl.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},On=D("$ZodError",Ml),Fs=D("$ZodError",Ml,void 0,{Parent:Error});function rw(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function jl(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)rw(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function Hl(e,t=(r)=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((u)=>n({issues:u},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let u=[...s,...i.path];if(u.length===0)r._errors.push(t(i));else{let a=r,c=0;while(c<u.length){let l=u[c],p=c===u.length-1;if(l==="_errors"){if(p)a._errors.push(t(i));c++;continue}if(!Object.prototype.hasOwnProperty.call(a,l))Object.defineProperty(a,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=a[l];if(p)f._errors.push(t(i));a=f,c++}}}};return n(e),r}function An(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Fn=(e)=>{let t=(r,n,o,s)=>{let i=o?{...o,async:!1}:{async:!1},u=r._zod.run({value:n,issues:[]},i);if(u instanceof Promise)throw new st;if(u.issues.length){let a=new(s?.Err??e)(u.issues.map((c)=>ht(c,i,Ve())));throw vs(a,s?.callee??t),a}return u.value};return t};var Tn=(e)=>{let t=async(r,n,o,s)=>{let i=o?{...o,async:!0}:{async:!0},u=r._zod.run({value:n,issues:[]},i);if(u instanceof Promise)u=await u;if(u.issues.length){let a=new(s?.Err??e)(u.issues.map((c)=>ht(c,i,Ve())));throw vs(a,s?.callee??t),a}return u.value};return t};var kr=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new st;return s.issues.length?{success:!1,error:new(e??On)(s.issues.map((i)=>ht(i,o,Ve())))}:{success:!0,data:s.value}},Ul=kr(Fs),Sr=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((i)=>ht(i,o,Ve())))}:{success:!0,data:s.value}},Gl=Sr(Fs);var Wl=(e)=>{let t=Fn(e),r=(n,o,s,i)=>{let u=s?{...s,direction:"backward"}:{direction:"backward"};return t(n,o,u,An(r,i))};return r};var Vl=(e)=>{let t=Fn(e),r=(n,o,s,i)=>t(n,o,s,An(r,i));return r};var ql=(e)=>{let t=Tn(e),r=async(n,o,s,i)=>{let u=s?{...s,direction:"backward"}:{direction:"backward"};return await t(n,o,u,An(r,i))};return r};var Jl=(e)=>{let t=Tn(e),r=async(n,o,s,i)=>await t(n,o,s,An(r,i));return r};var Kl=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return kr(e)(t,r,o)};var Yl=(e)=>(t,r,n)=>kr(e)(t,r,n);var Xl=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Sr(e)(t,r,o)};var Ql=(e)=>async(t,r,n)=>Sr(e)(t,r,n);var ep=/^[cC][0-9a-z]{6,}$/,tp=/^[0-9a-z]+$/,rp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,np=/^[0-9a-vA-V]{20}$/,op=/^[A-Za-z0-9]{27}$/,sp=/^[a-zA-Z0-9_-]{21}$/;function ip(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var up=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var ap=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ps=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var cp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ow="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function lp(){return new RegExp(ow,"u")}var pp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var hp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,dp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zs=/^[A-Za-z0-9_-]*$/;var gp=/^https?$/,Dp=/^\+[1-9]\d{6,14}$/;var _p="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function sw(e){return new RegExp(`^${e}$`)}var bp=sw(_p);function Ts(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function yp(e){return new RegExp(`^${Ts(e)}$`)}function xp(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Ts({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${Ts({precision:e.precision})}`:r;return new RegExp(`^${_p}T(?:${n})$`)}var vp=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var wp=/^-?\d+$/,Cp=/^-?\d+(?:\.\d+)?$/;var Ep=/^[^A-Z]*$/,$p=/^[^a-z]*$/;var xe=D("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Rs=(e)=>{let t=e.value;return!El(t)&&t.length!==void 0},zn={number:"number",bigint:"bigint",object:"date"},Is=D("$ZodCheckLessThan",(e,t)=>{xe.init(e,t);let r=zn[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)o.maximum=t.value;else o.exclusiveMaximum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:zn[typeof n.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ns=D("$ZodCheckGreaterThan",(e,t)=>{xe.init(e,t);let r=zn[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)o.minimum=t.value;else o.exclusiveMinimum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:zn[typeof n.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kp=D("$ZodCheckMultipleOf",(e,t)=>{xe.init(e,t),e._zod.onattach.push((r)=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):$l(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Sp=D("$ZodCheckNumberFormat",(e,t)=>{xe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=Tl[t.format];e._zod.onattach.push((i)=>{let u=i._zod.bag;if(u.format=t.format,u.minimum=o,u.maximum=s,r)u.pattern=wp}),e._zod.check=(i)=>{let u=i.value;if(r){if(!Number.isInteger(u)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){if(u>0)i.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else i.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(u<o)i.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(u>s)i.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Op=D("$ZodCheckMaxLength",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Rs),e._zod.onattach.push((n)=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<o)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let o=n.value,s=o.length;if((typeof o==="string"&&s>t.maximum?kn(o):s)<=t.maximum)return;let u=Sn(o);n.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ap=D("$ZodCheckMinLength",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Rs),e._zod.onattach.push((n)=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>o)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let o=n.value,s=o.length;if((typeof o==="string"&&s>=t.minimum&&s<t.minimum*2?kn(o):s)>=t.minimum)return;let u=Sn(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Fp=D("$ZodCheckLengthEquals",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Rs),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=(n)=>{let o=n.value,s=o.length,i=typeof o==="string"&&s>=t.length&&s<=t.length*2?kn(o):s;if(i===t.length)return;let u=Sn(o),a=i>t.length;n.issues.push({origin:u,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Or=D("$ZodCheckStringFormat",(e,t)=>{var r,n;if(xe.init(e,t),e._zod.onattach.push((o)=>{let s=o._zod.bag;if(s.format=t.format,t.pattern)s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),Tp=D("$ZodCheckRegex",(e,t)=>{Or.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pp=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ep),Or.init(e,t)}),zp=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$p),Or.init(e,t)}),Rp=D("$ZodCheckIncludes",(e,t)=>{xe.init(e,t);let r=Kt(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.onattach.push((o)=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Ip=D("$ZodCheckStartsWith",(e,t)=>{xe.init(e,t);let r=new RegExp(`^${Kt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Np=D("$ZodCheckEndsWith",(e,t)=>{xe.init(e,t);let r=new RegExp(`.*${Kt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var Lp=D("$ZodCheckOverwrite",(e,t)=>{xe.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class Ls{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
39
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();if(t&&e.find((n)=>t.is(n)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function uu(e){return e.map((t)=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",s;if((s=t.match(/^(--inspect(-brk)?)$/))!==null)r=s[1];else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(r=s[1],/^\d+$/.test(s[3]))o=s[3];else n=s[3];else if((s=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)r=s[1],n=s[3],o=s[4];if(r&&o!=="0")return`${r}=${n}:${parseInt(o)+1}`;return t})}function au(){if(q.env.NO_COLOR||q.env.FORCE_COLOR==="0"||q.env.FORCE_COLOR==="false")return!1;if(q.env.FORCE_COLOR||q.env.CLICOLOR_FORCE!==void 0)return!0;return}var uA=new U;var fr={name:"@imfelixyeung/git-swarm",description:"Manage multiple Git repositories with ease.",version:"0.3.0",repository:{type:"git",url:"https://github.com/imfelixyeung/git-swarm"},module:"src/cli.ts",bin:{"git-swarm":"dist/cli.js"},files:["dist"],type:"module",private:!1,scripts:{build:"bun build ./src/cli.ts --target=bun --minify --outdir=dist --sourcemap=linked",dev:"bun run build --watch",prepack:"bun run build && jq 'del(.dependencies, .devDependencies, .peerDependencies)' package.json > package.json.tmp && mv package.json.tmp package.json",postpack:"git checkout package.json",typecheck:"tsc --noEmit",biome:"biome check",ci:"biome ci",test:"bun test","config-json-schema:update":"bun run src/scripts/make-config-json-schema.ts > src/config/schema.json",changeset:"changeset","changeset:version":"changeset version && biome check --write",release:"bun run build && changeset publish"},devDependencies:{"@biomejs/biome":"2.5.12","@changesets/changelog-github":"^1.0.1","@changesets/cli":"^3.0.2","@types/bun":"latest","@types/jexl":"^2.3.4","@types/lodash.chunk":"^4.2.9",prettier:"3.9.6"},publishConfig:{access:"public",provenance:!0},peerDependencies:{typescript:"^7"},dependencies:{"cli-table3":"^0.6.5",commander:"^15.0.0","date-fns":"^4.4.0",dedent:"^1.7.2",jexl:"^2.3.0","lodash.chunk":"^4.2.0","p-limit":"^7.3.2",picocolors:"^1.1.1","pluralize-esm":"^9.0.5","simple-git":"^3.36.0",tinyglobby:"^0.2.17",zod:"^4.5.4"}};import{relative as r$}from"path";class cu{value;next;constructor(e){this.value=e}}class ln{#e;#t;#r;constructor(){this.clear()}enqueue(e){let t=new cu(e);if(this.#e)this.#t.next=t,this.#t=t;else this.#e=t,this.#t=t;this.#r++}dequeue(){let e=this.#e;if(!e)return;if(this.#e=this.#e.next,this.#r--,!this.#e)this.#t=void 0;return e.value}peek(){if(!this.#e)return;return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;while(e)yield e.value,e=e.next}*drain(){while(this.#e)yield this.dequeue()}}function So(e){let t=!1;if(typeof e==="object")({concurrency:e,rejectOnClear:t=!1}=e);if(lu(e),typeof t!=="boolean")throw TypeError("Expected `rejectOnClear` to be a boolean");let r=new ln,n=0,o=()=>{if(n<e&&r.size>0)n++,r.dequeue().run()},s=()=>{n--,o()},i=async(c,l,p)=>{let f=(async()=>c(...p))();l(f);try{await f}catch{}s()},u=(c,l,p,f)=>{let h={reject:p};if(new Promise((d)=>{h.run=d,r.enqueue(h)}).then(i.bind(void 0,c,l,f)),n<e)o()},a=(c,...l)=>new Promise((p,f)=>{u(c,p,f,l)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>r.size},clearQueue:{value(){if(!t){r.clear();return}let c=AbortSignal.abort().reason;while(r.size>0)r.dequeue().reject(c)}},concurrency:{get:()=>e,set(c){lu(c),e=c,queueMicrotask(()=>{while(n<e&&r.size>0)o()})}},map:{async value(c,l){let p=Array.from(c,(f,h)=>a(l,f,h));return Promise.all(p)}}}),a}function lu(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up")}var En=ot(Du(),1);var Po=new WeakMap;function Ht(...e){let t=new String(e);return Po.set(t,e),t}function He(e){return e instanceof String&&Po.has(e)}function Ut(e){return Po.get(e)??[]}var wn=ot(To(),1);import{spawn as tb}from"child_process";var Pc=ot(zo(),1);import{normalize as Dx}from"path";function*vu(e,t){let r=t==="global";for(let n of e)n.isGlobal===r&&(yield n)}var My=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),Zy=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),jy=new Set(["edit","remove-section","rename-section","set","unset"]),Hy=new Set(["get","get-color","get-colorbool","list"]);function Uy(e,t){for(let{name:n}of vu(e,"task")){if(My.has(n))return Gt(!0,t);if(Zy.has(n))return Gt(!1,t)}let r=t.at(0)?.toLowerCase();return r===void 0?null:jy.has(r)?Gt(!0,t.slice(1)):Hy.has(r)?Gt(!1,t.slice(1)):t.length===1?Gt(!1,t):Gt(!0,t)}function Gt(e=!1,t=[]){let r=t.at(0)?.toLowerCase();return r===void 0?null:{isWrite:e,isRead:!e,key:r,value:t.at(1)}}function Gy(e,t){return t.isWrite&&t.value!==void 0?{key:t.key,value:t.value,scope:e}:{key:t.key,scope:e}}function Wy(e){let t=e?.indexOf("=")||-1;return!e||t<0?null:{key:e.slice(0,t).trim().toLowerCase(),value:e.slice(t+1)}}function qy(e){for(let{name:t}of vu(e,"task"))switch(t){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function Vy({name:e}){if(e==="-c"||e==="--config")return"inline";if(e==="--config-env")return"env"}function*Jy(e){for(let t of e){let r=Vy(t),n=r&&Wy(t.value);n&&(yield{...n,scope:r})}}function Ky(e,t,r){let n={read:[],write:[...Jy(t)]};return e==="config"&&Yy(n,qy(t),Uy(t,r)),n}function Yy(e,t,r){if(r===null)return;let n=Gy(t,r);r.isWrite?e.write.push(n):e.read.push(n)}var wu={short:new Map([["c",!0]])},Xy={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...wu.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},Qy={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},eD={short:new Map,long:new Set};function tD(e){let t=Qy[e??""]??eD;return{short:new Map([...wu.short.entries(),...t.short.entries()]),long:t.long}}function Cu(e,t=Xy){if(e.startsWith("--")){let r=e.indexOf("=");if(r>2)return[{name:e.slice(0,r),value:e.slice(r+1),needsNext:!1}];let n=e.slice(2);return[{name:e,needsNext:t.long.has(n)}]}if(e.length===2){let r=e.charAt(1),n=t.short.get(r);return[{name:e,needsNext:n===!0}]}return rD(e,t.short)}function rD(e,t){let r=e.slice(1).split(""),n=[];for(let o=0;o<r.length;o++){let s=r[o],i=t.get(s);if(i===void 0)return[{name:e,needsNext:!1}];if(i){let u=r.slice(o+1).join("");if(u&&![...u].every((a)=>t.has(a)))return n.push({name:`-${s}`,value:u,needsNext:!1}),n}n.push({name:`-${s}`,needsNext:i})}return n}function nD(e,t=[]){let r=0;for(;r<e.length;){let n=String(e[r]);if(!n.startsWith("-")||n.length<2)break;let o=Cu(n),s=r+1;for(let i of o){let u={name:i.name,value:i.value,absorbedNext:!1,isGlobal:!0};i.needsNext&&u.value===void 0&&s<e.length&&(u.value=String(e[s]),u.absorbedNext=!0,s++),t.push(u)}r=s}return{flags:t,taskIndex:r}}function oD(e,t,r=[]){let n=tD(t),o=[],s=[],i=0;for(;i<e.length;){let u=e[i];if(He(u)){s.push(...Ut(u)),i++;continue}let a=String(u);if(a==="--"){for(let p=i+1;p<e.length;p++){let f=e[p];He(f)?s.push(...Ut(f)):s.push(String(f))}break}if(!a.startsWith("-")||a.length<2){o.push(a),i++;continue}let c=Cu(a,n),l=i+1;for(let p of c){let f={name:p.name,value:p.value,absorbedNext:!1,isGlobal:!1};p.needsNext&&f.value===void 0&&l<e.length&&!He(e[l])&&(f.value=String(e[l]),f.absorbedNext=!0,l++),r.push(f)}i=l}return{flags:r,positionals:o,pathspecs:s}}function*sD({write:e}){for(let t of e)for(let r of iD){let n=r(t.key);n&&(yield n)}}function Ge(e,t,r=String(e)){let n=typeof e=="string"?new RegExp(`\\s*${e.toLowerCase()}`):e;return function(o){if(n.test(o))return{category:t,message:`Configuring ${r} is not permitted without enabling ${t}`}}}function Ue(e,t){let r=new RegExp(`\\s*${e.toLowerCase().replace(/\./g,"(..+)?.")}`);return Ge(r,t,e)}var iD=[Ge("alias","allowUnsafeAlias"),Ge("core.askPass","allowUnsafeAskPass"),Ge("core.editor","allowUnsafeEditor"),Ge("core.fsmonitor","allowUnsafeFsMonitor"),Ge("core.gitProxy","allowUnsafeGitProxy"),Ge("core.hooksPath","allowUnsafeHooksPath"),Ge("core.pager","allowUnsafePager"),Ge("core.sshCommand","allowUnsafeSshCommand"),Ue("credential.helper","allowUnsafeCredentialHelper"),Ue("diff.command","allowUnsafeDiffExternal"),Ge("diff.external","allowUnsafeDiffExternal"),Ue("diff.textconv","allowUnsafeDiffTextConv"),Ue("filter.clean","allowUnsafeFilter"),Ue("filter.smudge","allowUnsafeFilter"),Ue("gpg.program","allowUnsafeGpgProgram"),Ge("init.templateDir","allowUnsafeTemplateDir"),Ue("merge.driver","allowUnsafeMergeDriver"),Ue("mergetool.path","allowUnsafeMergeDriver"),Ue("mergetool.cmd","allowUnsafeMergeDriver"),Ue("protocol.allow","allowUnsafeProtocolOverride"),Ue("remote.receivepack","allowUnsafePack"),Ue("remote.uploadpack","allowUnsafePack"),Ge("sequence.editor","allowUnsafeEditor")];function*uD(e,t){for(let r of t)for(let n of aD){let o=n(e,r.name);o&&(yield o)}}function dr(e,t,r,n=String(t)){let o=typeof t=="string"?new RegExp(`\\s*${t.toLowerCase()}`):t,s=`Use of ${e?`${e} with option `:""}${n} is not permitted without enabling ${r}`;return function(i,u){if((!e||i===e)&&o.test(u))return{category:r,message:s}}}var aD=[dr(null,/--(upload|receive)-pack/,"allowUnsafePack","--upload-pack or --receive-pack"),dr("clone",/^-\w*u/,"allowUnsafePack"),dr("clone","--u","allowUnsafePack"),dr("push","--exec","allowUnsafePack"),dr(null,"--template","allowUnsafeTemplateDir")];function Eu(e,t,r){return[...uD(e,t),...sD(r)]}function cD(...e){let{flags:t,taskIndex:r}=nD(e),n=r<e.length?String(e[r]).toLowerCase():null,o=n!==null?e.slice(r+1):[],{positionals:s,pathspecs:i}=oD(o,n,t),u=Ky(n,t,s);return{task:n,flags:t.map(pD),paths:i,config:u,vulnerabilities:lD(Eu(n,t,u))}}function lD(e){return Object.defineProperty(e,"vulnerabilities",{value:e})}function pD({value:e,name:t}){return e!==void 0?{name:t,value:e}:{name:t}}var ku={editor:"allowUnsafeEditor",git_askpass:"allowUnsafeAskPass",git_config_global:"allowUnsafeConfigPaths",git_config_system:"allowUnsafeConfigPaths",git_config_count:"allowUnsafeConfigEnvCount",git_config:"allowUnsafeConfigPaths",git_editor:"allowUnsafeEditor",git_exec_path:"allowUnsafeConfigPaths",git_external_diff:"allowUnsafeDiffExternal",git_pager:"allowUnsafePager",git_proxy_command:"allowUnsafeGitProxy",git_template_dir:"allowUnsafeTemplateDir",git_sequence_editor:"allowUnsafeEditor",git_ssh:"allowUnsafeSshCommand",git_ssh_command:"allowUnsafeSshCommand",pager:"allowUnsafePager",prefix:"allowUnsafeConfigPaths",ssh_askpass:"allowUnsafeAskPass"};function*fD(e){let t=parseInt(e.git_config_count??"0",10);for(let r=0;r<t;r++){let n=e[`git_config_key_${r}`],o=e[`git_config_value_${r}`];n!==void 0&&(yield{key:n.toLowerCase().trim(),value:o,scope:"env"})}}function*hD(e){for(let t of Object.keys(e))if(Su(t)){let r=ku[t];yield{category:r,message:`Use of "${t.toUpperCase()}" is not permitted without enabling ${r}`}}}function Su(e){return Object.hasOwn(ku,e)}function dD(e){let t={};for(let[r,n]of Object.entries(e)){let o=r.toLowerCase().trim();(Su(o)||o.startsWith("git"))&&(t[o]=String(n))}return t}function mD(e){let t=dD(e),r={read:[],write:[...fD(t)]},n=[...hD(t),...Eu(null,[],r)];return{config:r,vulnerabilities:n}}function $u(e,t){return[...cD(...e).vulnerabilities,...mD(t).vulnerabilities]}var Wt=ot(zo(),1);import{EventEmitter as mv}from"events";var{defineProperty:rs,getOwnPropertyDescriptor:gD,getOwnPropertyNames:ns}=Object,_D=Object.prototype.hasOwnProperty,k=(e,t)=>function(){return e&&(t=(0,e[ns(e)[0]])(e=0)),t},yD=(e,t)=>function(){return t||(0,e[ns(e)[0]])((t={exports:{}}).exports,t),t.exports},de=(e,t)=>{for(var r in t)rs(e,r,{get:t[r],enumerable:!0})},DD=(e,t,r,n)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let o of ns(t))if(!_D.call(e,o)&&o!==r)rs(e,o,{get:()=>t[o],enumerable:!(n=gD(t,o))||n.enumerable})}return e},ae=(e)=>DD(rs({},"__esModule",{value:!0}),e),it,ft=k({"src/lib/errors/git-error.ts"(){it=class extends Error{constructor(e,t){super(t);this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),yr,Jt=k({"src/lib/errors/git-response-error.ts"(){ft(),yr=class extends it{constructor(e,t){super(void 0,t||String(e));this.git=e}}}}),ia,ua=k({"src/lib/errors/task-configuration-error.ts"(){ft(),ia=class extends it{constructor(e){super(void 0,e)}}}});function aa(e){if(typeof e!=="function")return St;return e}function ca(e){return typeof e==="function"&&e!==St}function la(e,t){let r=e.indexOf(t);if(r<=0)return[e,""];return[e.substr(0,r),e.substr(r+1)]}function pa(e,t=0){return fa(e)&&e.length>t?e[t]:void 0}function kt(e,t=0){if(fa(e)&&e.length>t)return e[e.length-1-t]}function fa(e){return On(e)}function Dr(e="",t=!0,r=`
40
+ `){return e.split(r).reduce((n,o)=>{let s=t?o.trim():o;if(s)n.push(s);return n},[])}function os(e,t){return Dr(e,!0).map((r)=>t(r))}function ss(e){return En.exists(e,En.FOLDER)}function We(e,t){if(Array.isArray(e)){if(!e.includes(t))e.push(t)}else e.add(t);return t}function ha(e,t){if(Array.isArray(e)&&!e.includes(t))e.push(t);return e}function kn(e,t){if(Array.isArray(e)){let r=e.indexOf(t);if(r>=0)e.splice(r,1)}else e.delete(t);return t}function Qe(e){return Array.isArray(e)?e:[e]}function da(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Kt(e){return Qe(e).map((t)=>t instanceof String?t:String(t))}function Q(e,t=0){if(e==null)return t;let r=parseInt(e,10);return Number.isNaN(r)?t:r}function gr(e,t){let r=[];for(let n=0,o=e.length;n<o;n++)r.push(t,e[n]);return r}function _r(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function ma(e,t){let r={};return t.forEach((n)=>{if(e[n]!==void 0)r[n]=e[n]}),r}function jo(e=0){return new Promise((t)=>setTimeout(t,e))}function Ho(e){if(e===!1)return;return e}var qt,St,br,Sn=k({"src/lib/utils/util.ts"(){is(),qt="\x00",St=()=>{},br=Object.prototype.toString.call.bind(Object.prototype.toString)}});function we(e,t,r){if(t(e))return e;return arguments.length>2?r:void 0}function Uo(e,t){let r=He(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function $n(e){return!!e&&br(e)==="[object Object]"}function ga(e){return typeof e==="function"}var xr,_a,ie,xn,On,is=k({"src/lib/utils/argument-filters.ts"(){Sn(),xr=(e)=>Array.isArray(e),_a=(e)=>typeof e==="number",ie=(e)=>typeof e==="string"||He(e),xn=(e)=>ie(e)||Array.isArray(e)&&e.every(ie),On=(e)=>{if(e==null||"number|boolean|function".includes(typeof e))return!1;return typeof e.length==="number"}}}),Go,bD=k({"src/lib/utils/exit-codes.ts"(){Go=((e)=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(Go||{})}}),vn,xD=k({"src/lib/utils/git-output-streams.ts"(){vn=class e{constructor(t,r){this.stdOut=t,this.stdErr=r}asStrings(){return new e(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function vD(){throw Error("LineParser:useMatches not implemented")}var B,pt,wD=k({"src/lib/utils/line-parser.ts"(){B=class{constructor(e,t){if(this.matches=[],this.useMatches=vD,this.parse=(r,n)=>{if(this.resetMatches(),!this._regExp.every((o,s)=>this.addMatch(o,s,r(s))))return!1;return this.useMatches(n,this.prepareMatches())!==!1},this._regExp=Array.isArray(e)?e:[e],t)this.useMatches=t}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);if(n)this.pushMatch(t,n);return!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},pt=class extends B{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){if(e>0||t.length>1)super.pushMatch(e,t)}}}});function ya(...e){let t=process.cwd(),r=Object.assign({baseDir:t,...Da},...e.filter((n)=>typeof n==="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Da,CD=k({"src/lib/utils/simple-git-options.ts"(){Da={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function us(e,t=[]){if(!$n(e))return t;return Object.keys(e).reduce((r,n)=>{let o=e[n];if(He(o))r.push(o);else if(Uo(o,["boolean"]))r.push(n+"="+o);else if(Array.isArray(o)){for(let s of o)if(!Uo(s,["string","number"]))r.push(n+"="+s)}else r.push(n);return r},t)}function Se(e,t=0,r=!1){let n=[];for(let o=0,s=t<0?e.length:t;o<s;o++)if("string|number".includes(typeof e[o]))n.push(String(e[o]));if(us(as(e),n),!r)n.push(...ED(e));return n}function ED(e){let t=typeof kt(e)==="function";return Kt(we(kt(e,t?1:0),xr,[]))}function as(e){let t=ga(kt(e));return we(kt(e,t?1:0),$n)}function oe(e,t=!0){let r=aa(kt(e));return t||ca(r)?r:void 0}var kD=k({"src/lib/utils/task-options.ts"(){is(),Sn()}});function Wo(e,t){return e(t.stdOut,t.stdErr)}function Pe(e,t,r,n=!0){return Qe(r).forEach((o)=>{for(let s=Dr(o,n),i=0,u=s.length;i<u;i++){let a=(c=0)=>{if(i+c>=u)return;return s[i+c]};t.some(({parse:c})=>c(a,e))}}),e}var SD=k({"src/lib/utils/task-parser.ts"(){Sn()}}),ba={};de(ba,{ExitCodes:()=>Go,GitOutputStreams:()=>vn,LineParser:()=>B,NOOP:()=>St,NULL:()=>qt,RemoteLineParser:()=>pt,append:()=>We,appendTaskOptions:()=>us,asArray:()=>Qe,asCamelCase:()=>da,asFunction:()=>aa,asNumber:()=>Q,asStringArray:()=>Kt,bufferToString:()=>_r,callTaskParser:()=>Wo,createInstanceConfig:()=>ya,delay:()=>jo,filterArray:()=>xr,filterFunction:()=>ga,filterHasLength:()=>On,filterNumber:()=>_a,filterPlainObject:()=>$n,filterPrimitives:()=>Uo,filterString:()=>ie,filterStringOrStringArray:()=>xn,filterType:()=>we,first:()=>pa,folderExists:()=>ss,forEachLineWithContent:()=>os,getTrailingOptions:()=>Se,including:()=>ha,isUserFunction:()=>ca,last:()=>kt,objectToString:()=>br,orVoid:()=>Ho,parseStringResponse:()=>Pe,pick:()=>ma,prefixedArray:()=>gr,remove:()=>kn,splitOn:()=>la,toLinesWithContent:()=>Dr,trailingFunctionArgument:()=>oe,trailingOptionsArgument:()=>as});var I=k({"src/lib/utils/index.ts"(){is(),bD(),xD(),wD(),CD(),kD(),SD(),Sn()}}),xa={};de(xa,{CheckRepoActions:()=>qo,checkIsBareRepoTask:()=>wa,checkIsRepoRootTask:()=>va,checkIsRepoTask:()=>$D});function $D(e){switch(e){case"bare":return wa();case"root":return va()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:An,parser:cs}}function va(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:An,parser(t){return/^\.(git)?$/.test(t.trim())}}}function wa(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:An,parser:cs}}function OD(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var qo,An,cs,Ca=k({"src/lib/tasks/check-is-repo.ts"(){I(),qo=((e)=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(qo||{}),An=({exitCode:e},t,r,n)=>{if(e===128&&OD(t))return r(Buffer.from("false"));n(t)},cs=(e)=>e.trim()==="true"}});function AD(e,t){let r=new Ea(e),n=e?Sa:ka;return Dr(t).forEach((o)=>{let s=o.replace(n,"");r.paths.push(s),($a.test(s)?r.folders:r.files).push(s)}),r}var Ea,ka,Sa,$a,FD=k({"src/lib/responses/CleanSummary.ts"(){I(),Ea=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},ka=/^[a-z]+\s*/i,Sa=/^[a-z]+\s+[a-z]+\s*/i,$a=/\/$/}}),Vo={};de(Vo,{EMPTY_COMMANDS:()=>Fn,adhocExecTask:()=>Oa,configurationErrorTask:()=>Te,isBufferTask:()=>Fa,isEmptyTask:()=>Ta,straightThroughBufferTask:()=>Aa,straightThroughStringTask:()=>$e});function Oa(e){return{commands:Fn,format:"empty",parser:e}}function Te(e){return{commands:Fn,format:"empty",parser(){throw typeof e==="string"?new ia(e):e}}}function $e(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function Aa(e){return{commands:e,format:"buffer",parser(t){return t}}}function Fa(e){return e.format==="buffer"}function Ta(e){return e.format==="empty"||!e.commands.length}var Fn,ce=k({"src/lib/tasks/task.ts"(){ua(),Fn=[]}}),Pa={};de(Pa,{CONFIG_ERROR_INTERACTIVE_MODE:()=>ls,CONFIG_ERROR_MODE_REQUIRED:()=>ps,CONFIG_ERROR_UNKNOWN_OPTION:()=>fs,CleanOptions:()=>_n,cleanTask:()=>Ra,cleanWithOptionsTask:()=>TD,isCleanOptionsArray:()=>PD});function TD(e,t){let{cleanMode:r,options:n,valid:o}=RD(e);if(!r)return Te(ps);if(!o.options)return Te(fs+JSON.stringify(e));if(n.push(...t),n.some(ND))return Te(ls);return Ra(r,n)}function Ra(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return AD(e==="n",n)}}}function PD(e){return Array.isArray(e)&&e.every((t)=>hs.has(t))}function RD(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach((o)=>{if(zD(o))t=o,n.cleanMode=!0;else n.options=n.options&&ID(r[r.length]=`-${o}`)}),{cleanMode:t,options:r,valid:n}}function zD(e){return e==="f"||e==="n"}function ID(e){return/^-[a-z]$/i.test(e)&&hs.has(e.charAt(1))}function ND(e){if(/^-[^\-]/.test(e))return e.indexOf("i")>0;return e==="--interactive"}var ls,ps,fs,_n,hs,za=k({"src/lib/tasks/clean.ts"(){FD(),I(),ce(),ls="Git clean interactive mode is not supported",ps='Git clean mode parameter ("n" or "f") is required',fs="Git clean unknown option found in: ",_n=((e)=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(_n||{}),hs=new Set(["i",...Kt(Object.values(_n))])}});function LD(e){let t=new Na;for(let r of Ia(e))t.addValue(r.file,String(r.key),r.value);return t}function BD(e,t){let r=null,n=[],o=new Map;for(let s of Ia(e,t)){if(s.key!==t)continue;if(n.push(r=s.value),!o.has(s.file))o.set(s.file,[]);o.get(s.file).push(r)}return{key:t,paths:Array.from(o.keys()),scopes:o,value:r,values:n}}function MD(e){return e.replace(/^(file):/,"")}function*Ia(e,t=null){let r=e.split("\x00");for(let n=0,o=r.length-1;n<o;){let s=MD(r[n++]),i=r[n++],u=t;if(i.includes(`
41
+ `)){let a=la(i,`
42
+ `);u=a[0],i=a[1]}yield{file:s,key:u,value:i}}}var Na,ZD=k({"src/lib/responses/ConfigList.ts"(){I(),Na=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){if(!this._all)this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{});return this._all}addFile(e){if(!(e in this.values)){let t=kt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);if(!Object.hasOwn(n,t))n[t]=r;else if(Array.isArray(n[t]))n[t].push(r);else n[t]=[n[t],r];this._all=void 0}}}});function Io(e,t){if(typeof e==="string"&&Object.hasOwn(Jo,e))return e;return t}function jD(e,t,r,n){let o=["config",`--${n}`];if(r)o.push("--add");return o.push(e,t),{commands:o,format:"utf-8",parser(s){return s}}}function HD(e,t){let r=["config","--null","--show-origin","--get-all",e];if(t)r.splice(1,0,`--${t}`);return{commands:r,format:"utf-8",parser(n){return BD(n,e)}}}function UD(e){let t=["config","--list","--show-origin","--null"];if(e)t.push(`--${e}`);return{commands:t,format:"utf-8",parser(r){return LD(r)}}}function GD(){return{addConfig(e,t,...r){return this._runTask(jD(e,t,r[0]===!0,Io(r[1],"local")),oe(arguments))},getConfig(e,t){return this._runTask(HD(e,Io(t,void 0)),oe(arguments))},listConfig(...e){return this._runTask(UD(Io(e[0],void 0)),oe(arguments))}}}var Jo,La=k({"src/lib/tasks/config.ts"(){ZD(),I(),Jo=((e)=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Jo||{})}});function WD(e){return Ba.has(e)}var No,Ba,Ma=k({"src/lib/tasks/diff-name-status.ts"(){No=((e)=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(No||{}),Ba=new Set(Object.values(No))}});function qD(...e){return new ja().param(...e)}function VD(e){let t=new Set,r={};return os(e,(n)=>{let[o,s,i]=n.split(qt);t.add(o),(r[o]=r[o]||[]).push({line:Q(s),path:o,preview:i})}),{paths:t,results:r}}function JD(){return{grep(e){let t=oe(arguments),r=Se(arguments);for(let o of Za)if(r.includes(o))return this._runTask(Te(`git.grep: use of "${o}" is not supported.`),t);if(typeof e==="string")e=qD().param(e);let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(o){return VD(o)}},t)}}}var Za,mr,Ou,ja,Ha=k({"src/lib/tasks/grep.ts"(){I(),ce(),Za=["-h"],mr=Symbol("grepQuery"),ja=class{constructor(){this[Ou]=[]}*[(Ou=mr,Symbol.iterator)](){for(let e of this[mr])yield e}and(...e){return e.length&&this[mr].push("--and","(",...gr(e,"-e"),")"),this}param(...e){return this[mr].push(...gr(e,"-e")),this}}}}),Ua={};de(Ua,{ResetMode:()=>yn,getResetMode:()=>YD,resetTask:()=>KD});function KD(e,t){let r=["reset"];if(Ga(e))r.push(`--${e}`);return r.push(...t),$e(r)}function YD(e){if(Ga(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}return}function Ga(e){return typeof e==="string"&&Wa.includes(e)}var yn,Wa,qa=k({"src/lib/tasks/reset.ts"(){I(),ce(),yn=((e)=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(yn||{}),Wa=Kt(Object.values(yn))}});function XD(){return wn.default("simple-git")}function Au(e,t,r){if(!t||!String(t).replace(/\s*/,""))return!r?e:(n,...o)=>{e(n,...o),r(n,...o)};return(n,...o)=>{if(e(`%s ${n}`,t,...o),r)r(n,...o)}}function QD(e,t,{namespace:r}){if(typeof e==="string")return e;let n=t&&t.namespace||"";if(n.startsWith(r))return n.substr(r.length+1);return n||r}function ds(e,t,r,n=XD()){let o=e&&`[${e}]`||"",s=[],i=typeof t==="string"?n.extend(t):t,u=QD(we(t,ie),i,n);return c(r);function a(l,p){return We(s,ds(e,u.replace(/^[^:]+/,l),p,n))}function c(l){let p=l&&`[${l}]`||"",f=i&&Au(i,p)||St,h=Au(n,`${o} ${p}`,f);return Object.assign(i?f:h,{label:e,sibling:a,info:h,step:c})}}var Va=k({"src/lib/git-logger.ts"(){I(),wn.default.formatters.L=(e)=>String(On(e)?e.length:"-"),wn.default.formatters.B=(e)=>{if(Buffer.isBuffer(e))return e.toString("utf8");return br(e)}}}),Ja,eb=k({"src/lib/runners/tasks-pending-queue.ts"(){ft(),Va(),Ja=class e{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let r=e.getName(t.commands[0]),n=ds(this.logLabel,r);return{task:t,logger:n,name:r}}push(t){let r=this.createProgress(t);return r.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,r),r}fatal(t){for(let[r,{logger:n}]of Array.from(this._queue.entries())){if(r===t.task)n.info("Failed %o",t),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted");else n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",t.message);this.complete(r)}if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){if(this.withProgress(t))this._queue.delete(t)}attempt(t){let r=this.withProgress(t);if(!r)throw new it(void 0,"TasksPendingQueue: attempt called for an unknown task");return r.logger("Starting task"),r}static getName(t="empty"){return`task:${t}:${++e.counter}`}static{this.counter=0}}}});function Et(e,t){return{method:pa(e.commands)||"",commands:t}}function rb(e,t){return(r)=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function Fu(e,t,r,n){return(o)=>{r("%s received %L bytes",t,o),n("%B",o),e.push(o)}}var Ko,nb=k({"src/lib/runners/git-executor-chain.ts"(){ft(),ce(),I(),eb(),Ko=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Ja}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return await(Ta(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n))}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}}onFatalException(e,t){let r=t instanceof it?Object.assign(t,{task:e}):new it(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(e,t){let r=this._plugins.exec("spawn.binary","",Et(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],{...Et(e,e.commands),env:{...this.env}}),o=await this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),s=await this.handleTaskData(e,n,o,t.step("HANDLE"));if(t("passing response to task's parser as a %s",e.format),Fa(e))return Wo(e.parser,s);return Wo(e.parser,s.asStrings())}async attemptEmptyTask(e,t){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}handleTaskData(e,t,r,n){let{exitCode:o,rejection:s,stdOut:i,stdErr:u}=r;return new Promise((a,c)=>{n("Preparing to handle process response exitCode=%d stdOut=",o);let{error:l}=this._plugins.exec("task.error",{error:s},{...Et(e,t),...r});if(l&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,l,(p)=>{n.info("custom error handler treated as success"),n("custom error returned a %s",br(p)),a(new vn(Array.isArray(p)?Buffer.concat(p):p,Buffer.concat(u)))},c);if(l)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",o,u.length,s),c(l);n.info("retrieving task output complete"),a(new vn(Buffer.concat(i),Buffer.concat(u)))})}async gitResponse(e,t,r,n,o){let s=o.sibling("output"),i=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Et(e,e.commands));return new Promise((u)=>{let a=[],c=[];o.info("%s %o",t,r),o("%O",i);let l=this._beforeSpawn(e,r);if(l)return u({stdOut:a,stdErr:c,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,{...Et(e,r),kill(f){l=f||l}});let p=tb(t,r,i);if(p.stdout.on("data",Fu(a,"stdOut",o,s.step("stdOut"))),p.stderr.on("data",Fu(c,"stdErr",o,s.step("stdErr"))),p.on("error",rb(c,o)),n)o("Passing child process stdOut/stdErr to custom outputHandler"),n(t,p.stdout,p.stderr,[...r]);this._plugins.exec("spawn.after",void 0,{...Et(e,r),spawned:p,close(f,h){u({stdOut:a,stdErr:c,exitCode:f,rejection:l||h})},kill(f){if(p.killed)return;l=f,p.kill("SIGINT")}})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,{...Et(e,t),kill(n){r=n||r}}),r}}}}),Ka={};de(Ka,{GitExecutor:()=>Ya});var Ya,ob=k({"src/lib/runners/git-executor.ts"(){nb(),Ya=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new Ko(this,this._scheduler,this._plugins)}chain(){return new Ko(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function sb(e,t,r=St){let n=(s)=>{r(null,s)},o=(s)=>{if(s?.task===e)r(s instanceof yr?ib(s):s,void 0)};t.then(n,o)}function ib(e){let t=(n)=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=St};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,o){if(o in e)return n;return n[o]={enumerable:!1,configurable:!1,get(){return t(o),e.git[o]}},n}}var ub=k({"src/lib/task-callback.ts"(){Jt(),I()}});function Tu(e,t){return Oa((r)=>{if(!ss(e))throw Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var ab=k({"src/lib/tasks/change-working-directory.ts"(){I(),ce()}});function Lo(e){let t=["checkout",...e];if(t[1]==="-b"&&t.includes("-B"))t[1]=kn(t,"-B");return $e(t)}function cb(){return{checkout(){return this._runTask(Lo(Se(arguments,1)),oe(arguments))},checkoutBranch(e,t){return this._runTask(Lo(["-b",e,t,...Se(arguments)]),oe(arguments))},checkoutLocalBranch(e){return this._runTask(Lo(["-b",e,...Se(arguments)]),oe(arguments))}}}var lb=k({"src/lib/tasks/checkout.ts"(){I(),ce()}});function pb(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function fb(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return Pe(pb(),[Xa],e)}})}}}var Xa,hb=k({"src/lib/tasks/count-objects.ts"(){I(),Xa=new B(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=da(t);if(Object.hasOwn(e,n))e[n]=Q(r)})}});function db(e){return Pe({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Qa,e)}var Qa,mb=k({"src/lib/parsers/parse-commit.ts"(){I(),Qa=[new B(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new B(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();if(!n||!n.includes("@"))return;e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()}}),new B(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new B(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let o=parseInt(r,10)||0;if(n==="-")e.summary.deletions=o;else if(n==="+")e.summary.insertions=o})]}});function gb(e,t,r){return{commands:["-c","core.abbrev=40","commit",...gr(e,"-m"),...t,...r],format:"utf-8",parser:db}}function _b(){return{commit(t,...r){let n=oe(arguments),o=e(t)||gb(Qe(t),Qe(we(r[0],xn,[])),[...Kt(we(r[1],xr,[])),...Se(arguments,0,!0)]);return this._runTask(o,n)}};function e(t){return!xn(t)&&Te("git.commit: requires the commit message to be supplied as a string/string[]")}}var yb=k({"src/lib/tasks/commit.ts"(){mb(),I(),ce()}});function Db(){return{firstCommit(){return this._runTask($e(["rev-list","--max-parents=0","HEAD"],!0),oe(arguments))}}}var bb=k({"src/lib/tasks/first-commit.ts"(){I(),ce()}});function xb(e,t){let r=["hash-object",e];if(t)r.push("-w");return $e(r,!0)}var vb=k({"src/lib/tasks/hash-object.ts"(){ce()}});function wb(e,t,r){let n=String(r).trim(),o;if(o=ec.exec(n))return new Dn(e,t,!1,o[1]);if(o=tc.exec(n))return new Dn(e,t,!0,o[1]);let s="",i=n.split(" ");while(i.length)if(i.shift()==="in"){s=i.join(" ");break}return new Dn(e,t,/^re/i.test(n),s)}var Dn,ec,tc,Cb=k({"src/lib/responses/InitSummary.ts"(){Dn=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},ec=/^Init.+ repository in (.+)$/,tc=/^Rein.+ in (.+)$/}});function Eb(e){return e.includes(ms)}function kb(e=!1,t,r){let n=["init",...r];if(e&&!Eb(n))n.splice(1,0,ms);return{commands:n,format:"utf-8",parser(o){return wb(n.includes("--bare"),t,o)}}}var ms,Sb=k({"src/lib/tasks/init.ts"(){Cb(),ms="--bare"}});function gs(e){for(let t=0;t<e.length;t++){let r=_s.exec(e[t]);if(r)return`--${r[1]}`}return""}function $b(e){return _s.test(e)}var _s,vr=k({"src/lib/args/log-format.ts"(){_s=/^--(stat|numstat|name-only|name-status)(=|$)/}}),rc,Ob=k({"src/lib/responses/DiffSummary.ts"(){rc=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function nc(e=""){let t=oc[e];return(r)=>Pe(new rc,t,r,!1)}var Bo,Pu,Ru,zu,oc,sc=k({"src/lib/parsers/parse-diff-summary.ts"(){vr(),Ob(),Ma(),I(),Bo=[new B(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:Q(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new B(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:Q(r),after:Q(n),binary:!0})}),new B(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),o=/(\d+) d/.exec(r);e.changed=Q(t),e.insertions=Q(n?.[1]),e.deletions=Q(o?.[1])})],Pu=[new B(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let o=Q(t),s=Q(r);e.changed++,e.insertions+=o,e.deletions+=s,e.files.push({file:n,changes:o+s,insertions:o,deletions:s,binary:!1})}),new B(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],Ru=[new B(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],zu=[new B(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,o,s])=>{e.changed++,e.files.push({file:s??n,changes:0,insertions:0,deletions:0,binary:!1,status:Ho(WD(t)&&t),from:Ho(!!s&&n!==s&&n),similarity:Q(r)})})],oc={[""]:Bo,["--stat"]:Bo,["--numstat"]:Pu,["--name-status"]:zu,["--name-only"]:Ru}}});function Ab(e,t){return t.reduce((r,n,o)=>(r[n]=e[o]||"",r),Object.create({diff:null}))}function ic(e=bs,t=uc,r=""){let n=nc(r);return function(o){let s=Dr(o.trim(),!1,ys).map(function(i){let u=i.split(Ds),a=Ab(u[0].split(e),t);if(u.length>1&&!!u[1].trim())a.diff=n(u[1]);return a});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var ys,Ds,bs,uc,ac=k({"src/lib/parsers/parse-list-log-summary.ts"(){I(),sc(),vr(),ys="\xF2\xF2\xF2\xF2\xF2\xF2 ",Ds=" \xF2\xF2",bs=" \xF2 ",uc=["hash","date","message","refs","author_name","author_email"]}}),cc={};de(cc,{diffSummaryTask:()=>Fb,validateLogFormatConfig:()=>Tn});function Fb(e){let t=gs(e),r=["diff"];if(t==="")t="--stat",r.push("--stat=4096");return r.push(...e),Tn(r)||{commands:r,format:"utf-8",parser:nc(t)}}function Tn(e){let t=e.filter($b);if(t.length>1)return Te(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return Te(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var xs=k({"src/lib/tasks/diff.ts"(){vr(),sc(),ce()}});function Tb(e,t){let r=[],n=[];return Object.keys(e).forEach((o)=>{r.push(o),n.push(String(e[o]))}),[r,n.join(t)]}function Pb(e){return Object.keys(e).reduce((t,r)=>{if(!(r in Yo))t[r]=e[r];return t},{})}function lc(e={},t=[]){let r=we(e.splitter,ie,bs),n=$n(e.format)?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[o,s]=Tb(n,r),i=[],u=[`--pretty=format:${ys}${s}${Ds}`,...t],a=e.n||e["max-count"]||e.maxCount;if(a)u.push(`--max-count=${a}`);if(e.from||e.to){let c=e.symmetric!==!1?"...":"..";i.push(`${e.from||""}${c}${e.to||""}`)}if(ie(e.file))u.push("--follow",Ht(e.file));return us(Pb(e),u),{fields:o,splitter:r,commands:[...u,...i]}}function Rb(e,t,r){let n=ic(e,t,gs(r));return{commands:["log",...r],format:"utf-8",parser:n}}function zb(){return{log(...r){let n=oe(arguments),o=lc(as(arguments),Kt(we(arguments[0],xr,[]))),s=t(...r)||Tn(o.commands)||e(o);return this._runTask(s,n)}};function e(r){return Rb(r.splitter,r.fields,r.commands)}function t(r,n){return ie(r)&&ie(n)&&Te("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Yo,pc=k({"src/lib/tasks/log.ts"(){vr(),ac(),I(),ce(),xs(),Yo=((e)=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(Yo||{})}}),bn,fc,Ib=k({"src/lib/responses/MergeSummary.ts"(){bn=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},fc=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){if(this.conflicts.length)return`CONFLICTS: ${this.conflicts.join(", ")}`;return"OK"}}}}),Xo,hc,Nb=k({"src/lib/responses/PullSummary.ts"(){Xo=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},hc=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Mo(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function Iu(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:Q(t&&t[1]||"0"),delta:Q(r&&r[1]||"0")}}var dc,Lb=k({"src/lib/parsers/parse-remote-objects.ts"(){I(),dc=[new pt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),o=Mo(e.remoteMessages);Object.assign(o,{[n]:Q(r)})}),new pt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),o=Mo(e.remoteMessages);Object.assign(o,{[n]:Q(r)})}),new pt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let o=Mo(e.remoteMessages);o.total=Iu(t),o.reused=Iu(r),o.packReused=Q(n)})]}});function mc(e,t){return Pe({remoteMessages:new _c},gc,t)}var gc,_c,yc=k({"src/lib/parsers/parse-remote-messages.ts"(){I(),Lb(),gc=[new pt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...dc,new pt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new pt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:Q(t),summary:r,url:n}})],_c=class{constructor(){this.all=[]}}}});function Bb(e,t){let r=Pe(new hc,Dc,[e,t]);return r.message&&r}var Nu,Lu,Bu,Mu,Dc,Zu,vs,bc=k({"src/lib/parsers/parse-pull.ts"(){Nb(),I(),yc(),Nu=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Lu=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,Bu=/^(create|delete) mode \d+ (.+)/,Mu=[new B(Nu,(e,[t,r,n])=>{if(e.files.push(t),r)e.insertions[t]=r.length;if(n)e.deletions[t]=n.length}),new B(Lu,(e,[t,,r,,n])=>{if(r!==void 0||n!==void 0)return e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0;return!1}),new B(Bu,(e,[t,r])=>{We(e.files,r),We(t==="create"?e.created:e.deleted,r)})],Dc=[new B(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new B(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new B(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,o])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=o,e.hash.remote=r})],Zu=(e,t)=>Pe(new Xo,Mu,[e,t]),vs=(e,t)=>Object.assign(new Xo,Zu(e,t),mc(e,t))}}),ju,xc,Hu,Mb=k({"src/lib/parsers/parse-merge.ts"(){Ib(),I(),bc(),ju=[new B(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new B(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new bn(t,r))}),new B(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new bn(t,r,{deleteRef:n}))}),new B(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new bn(t,null))}),new B(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],xc=(e,t)=>Object.assign(Hu(e,t),vs(e,t)),Hu=(e)=>Pe(new fc,ju,e)}});function Uu(e){if(!e.length)return Te("Git.merge requires at least one option");return{commands:["merge",...e],format:"utf-8",parser(t,r){let n=xc(t,r);if(n.failed)throw new yr(n);return n}}}var Zb=k({"src/lib/tasks/merge.ts"(){Jt(),Mb(),ce()}});function jb(e,t,r){let n=r.includes("deleted"),o=r.includes("tag")||/^refs\/tags/.test(e),s=!r.includes("new");return{deleted:n,tag:o,branch:!o,new:!s,alreadyUpdated:s,local:e,remote:t}}var Gu,vc,Wu,Hb=k({"src/lib/parsers/parse-push.ts"(){I(),yc(),Gu=[new B(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new B(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref={...e.ref||{},local:t}}),new B(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(jb(t,r,n))}),new B(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch={...e.branch||{},local:t,remote:r,remoteName:n}}),new B(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,o])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:o}}})],vc=(e,t)=>{let r=Wu(e,t),n=mc(e,t);return{...r,...n}},Wu=(e,t)=>Pe({pushed:[]},Gu,[e,t])}}),wc={};de(wc,{pushTagsTask:()=>Ub,pushTask:()=>ws});function Ub(e={},t){return We(t,"--tags"),ws(e,t)}function ws(e={},t){let r=["push",...t];if(e.branch)r.splice(1,0,e.branch);if(e.remote)r.splice(1,0,e.remote);return kn(r,"-v"),We(r,"--verbose"),We(r,"--porcelain"),{commands:r,format:"utf-8",parser:vc}}var Cc=k({"src/lib/tasks/push.ts"(){Hb(),I()}});function Gb(){return{showBuffer(){let e=["show",...Se(arguments,1)];if(!e.includes("--binary"))e.splice(1,0,"--binary");return this._runTask(Aa(e),oe(arguments))},show(){let e=["show",...Se(arguments,1)];return this._runTask($e(e),oe(arguments))}}}var Wb=k({"src/lib/tasks/show.ts"(){I(),ce()}}),qu,Ec,qb=k({"src/lib/responses/FileStatusSummary.ts"(){qu=/^(.+)\0(.+)$/,Ec=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=qu.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function Vu(e){let[t,r]=e.split(qt);return{from:r||t,to:t}}function Ne(e,t,r){return[`${e}${t}`,r]}function Zo(e,...t){return t.map((r)=>Ne(e,r,(n,o)=>n.conflicted.push(o)))}function Vb(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return n(" ",r.charAt(0),r.slice(2));default:return}function n(o,s,i){let u=`${o}${s}`,a=kc.get(u);if(a)a(e,i);if(u!=="##"&&u!=="!!")e.files.push(new Ec(i,o,s))}}var Ju,kc,Sc,Jb=k({"src/lib/responses/StatusSummary.ts"(){I(),qb(),Ju=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},kc=new Map([Ne(" ","A",(e,t)=>e.created.push(t)),Ne(" ","D",(e,t)=>e.deleted.push(t)),Ne(" ","M",(e,t)=>e.modified.push(t)),Ne("A"," ",(e,t)=>{e.created.push(t),e.staged.push(t)}),Ne("A","M",(e,t)=>{e.created.push(t),e.staged.push(t),e.modified.push(t)}),Ne("D"," ",(e,t)=>{e.deleted.push(t),e.staged.push(t)}),Ne("M"," ",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Ne("M","M",(e,t)=>{e.modified.push(t),e.staged.push(t)}),Ne("R"," ",(e,t)=>{e.renamed.push(Vu(t))}),Ne("R","M",(e,t)=>{let r=Vu(t);e.renamed.push(r),e.modified.push(r.to)}),Ne("!","!",(e,t)=>{(e.ignored=e.ignored||[]).push(t)}),Ne("?","?",(e,t)=>e.not_added.push(t)),...Zo("A","A","U"),...Zo("D","D","U"),...Zo("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,o=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,i=/\son\s(\S+?)(?=\.{3}|$)/,u=r.exec(t);if(e.ahead=u&&+u[1]||0,u=n.exec(t),e.behind=u&&+u[1]||0,u=o.exec(t),e.current=we(u?.[1],ie,null),u=s.exec(t),e.tracking=we(u?.[1],ie,null),u=i.exec(t),u)e.current=we(u?.[1],ie,e.current);e.detached=/\(no branch\)/.test(t)}]]),Sc=function(e){let t=e.split(qt),r=new Ju;for(let n=0,o=t.length;n<o;){let s=t[n++].trim();if(!s)continue;if(s.charAt(0)==="R")s+=qt+(t[n++]||"");Vb(r,s)}return r}}});function Kb(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter((r)=>!$c.includes(r))],parser(r){return Sc(r)}}}var $c,Yb=k({"src/lib/tasks/status.ts"(){Jb(),$c=["--null","-z"]}});function Cn(e=0,t=0,r=0,n="",o=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:o},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function Xb(){return Cn(0,0,0,"",!1)}function Qb(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:ex,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(Cs));n(t)}})}}}function ex(e){if(e===Cs)return Xb();return Pe(Cn(0,0,0,e),Oc,e)}var Cs,Oc,tx=k({"src/lib/tasks/version.ts"(){I(),Cs="installed=false",Oc=[new B(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,o=""])=>{Object.assign(e,Cn(Q(t),Q(r),Q(n),o))}),new B(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,o=""])=>{Object.assign(e,Cn(Q(t),Q(r),n,o))})]}});function Ku(e,t,r,...n){if(!ie(r))return Te(`git.${e}() requires a string 'repoPath'`);return t(r,we(n[0],ie),Se(arguments))}function rx(){return{clone(e,...t){return this._runTask(Ku("clone",Qo,we(e,ie),...t),oe(arguments))},mirror(e,...t){return this._runTask(Ku("mirror",Ac,we(e,ie),...t),oe(arguments))}}}var Qo,Ac,nx=k({"src/lib/tasks/clone.ts"(){ce(),I(),Qo=(e,t,r)=>{let n=["clone",...r];return ie(e)&&n.push(Ht(e)),ie(t)&&n.push(Ht(t)),$e(n)},Ac=(e,t,r)=>(We(r,"--mirror"),Qo(e,t,r))}}),Fc={};de(Fc,{SimpleGitApi:()=>es});var es,ox=k({"src/lib/simple-git-api.ts"(){ub(),ab(),lb(),hb(),yb(),La(),bb(),Ha(),vb(),Sb(),pc(),Zb(),Cc(),Wb(),Yb(),ce(),tx(),I(),nx(),es=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);if(t)sb(e,n,t);return Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask($e(["add",...Qe(e)]),oe(arguments))}cwd(e){let t=oe(arguments);if(typeof e==="string")return this._runTask(Tu(e,this._executor),t);if(typeof e?.path==="string")return this._runTask(Tu(e.path,e.root&&this._executor||void 0),t);return this._runTask(Te("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(xb(e,t===!0),oe(arguments))}init(e){return this._runTask(kb(e===!0,this._executor.cwd,Se(arguments)),oe(arguments))}merge(){return this._runTask(Uu(Se(arguments)),oe(arguments))}mergeFromTo(e,t){if(!(ie(e)&&ie(t)))return this._runTask(Te("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"));return this._runTask(Uu([e,t,...Se(arguments)]),oe(arguments,!1))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=ws({remote:we(arguments[0],ie),branch:we(arguments[1],ie)},Se(arguments));return this._runTask(e,oe(arguments))}stash(){return this._runTask($e(["stash",...Se(arguments)]),oe(arguments))}status(){return this._runTask(Kb(Se(arguments)),oe(arguments))}},Object.assign(es.prototype,cb(),rx(),_b(),GD(),fb(),Db(),JD(),zb(),Gb(),Qb())}}),Tc={};de(Tc,{Scheduler:()=>Rc});var Yu,Rc,sx=k({"src/lib/runners/scheduler.ts"(){I(),Va(),Yu=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=Pc.createDeferred();return{promise:t,done:r,id:e}}})(),Rc=class{constructor(e=2){this.concurrency=e,this.logger=ds("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=We(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),kn(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=We(this.pending,Yu());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),zc={};de(zc,{applyPatchTask:()=>ix});function ix(e,t){return $e(["apply",...t,...e])}var ux=k({"src/lib/tasks/apply-patch.ts"(){ce()}});function ax(e,t){return{branch:e,hash:t,success:!0}}function cx(e){return{branch:e,hash:null,success:!1}}var Ic,lx=k({"src/lib/responses/BranchDeleteSummary.ts"(){Ic=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function Nc(e,t){return t===1&&ts.test(e)}var Xu,ts,Qu,Pn,px=k({"src/lib/parsers/parse-branch-delete.ts"(){lx(),I(),Xu=/(\S+)\s+\(\S+\s([^)]+)\)/,ts=/^error[^']+'([^']+)'/m,Qu=[new B(Xu,(e,[t,r])=>{let n=ax(t,r);e.all.push(n),e.branches[t]=n}),new B(ts,(e,[t])=>{let r=cx(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],Pn=(e,t)=>Pe(new Ic,Qu,[e,t])}}),Lc,fx=k({"src/lib/responses/BranchSummary.ts"(){Lc=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,o){if(e==="*")this.detached=t,this.current=r;this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:o}}}}});function ea(e){return e?e.charAt(0):""}function Bc(e,t=!1){return Pe(new Lc,t?[Zc]:Mc,e)}var Mc,Zc,hx=k({"src/lib/parsers/parse-branch.ts"(){fx(),I(),Mc=[new B(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,o])=>{e.push(ea(t),!0,r,n,o)}),new B(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,r,n,o])=>{e.push(ea(t),!1,r,n,o)})],Zc=new B(/^(\S+)$/s,(e,[t])=>{e.push("*",!1,t,"","")})}}),jc={};de(jc,{branchLocalTask:()=>mx,branchTask:()=>dx,containsDeleteBranchCommand:()=>Hc,deleteBranchTask:()=>_x,deleteBranchesTask:()=>gx});function Hc(e){let t=["-d","-D","--delete"];return e.some((r)=>t.includes(r))}function dx(e){let t=Hc(e),r=e.includes("--show-current"),n=["branch",...e];if(n.length===1)n.push("-a");if(!n.includes("-v"))n.splice(1,0,"-v");return{format:"utf-8",commands:n,parser(o,s){if(t)return Pn(o,s).all[0];return Bc(o,r)}}}function mx(){return{format:"utf-8",commands:["branch","-v"],parser(e){return Bc(e)}}}function gx(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return Pn(r,n)},onError({exitCode:r,stdOut:n},o,s,i){if(!Nc(String(o),r))return i(o);s(n)}}}function _x(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,o){return Pn(n,o).branches[e]},onError({exitCode:n,stdErr:o,stdOut:s},i,u,a){if(!Nc(String(i),n))return a(i);throw new yr(r.parser(_r(s),_r(o)),String(i))}};return r}var yx=k({"src/lib/tasks/branch.ts"(){Jt(),px(),hx(),I()}});function bx(e){let t=e.trim().replace(/^["']|["']$/g,"");return t&&Dx(t)}var Uc,xx=k({"src/lib/responses/CheckIgnore.ts"(){Uc=(e)=>e.split(/\n/g).map(bx).filter(Boolean)}}),Gc={};de(Gc,{checkIgnoreTask:()=>vx});function vx(e){return{commands:["check-ignore",...e],format:"utf-8",parser:Uc}}var wx=k({"src/lib/tasks/check-ignore.ts"(){xx()}});function Cx(e,t){return Pe({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},Wc,[e,t])}var Wc,Ex=k({"src/lib/parsers/parse-fetch.ts"(){I(),Wc=[new B(/From (.+)$/,(e,[t])=>{e.remote=t}),new B(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new B(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new B(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new B(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,o])=>{e.updated.push({name:n,tracking:o,to:r,from:t})})]}}),qc={};de(qc,{fetchTask:()=>Sx});function kx(e){return/^--upload-pack(=|$)/.test(e)}function Sx(e,t,r){let n=["fetch",...r];if(e&&t)n.push(e,t);if(n.find(kx))return Te("git.fetch: potential exploit argument blocked.");return{commands:n,format:"utf-8",parser:Cx}}var $x=k({"src/lib/tasks/fetch.ts"(){Ex(),ce()}});function Ox(e){return Pe({moves:[]},Vc,e)}var Vc,Ax=k({"src/lib/parsers/parse-move.ts"(){I(),Vc=[new B(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),Jc={};de(Jc,{moveTask:()=>Fx});function Fx(e,t){return{commands:["mv","-v",...Qe(e),t],format:"utf-8",parser:Ox}}var Tx=k({"src/lib/tasks/move.ts"(){Ax(),I()}}),Kc={};de(Kc,{pullTask:()=>Px});function Px(e,t,r){let n=["pull",...r];if(e&&t)n.splice(1,0,e,t);return{commands:n,format:"utf-8",parser(o,s){return vs(o,s)},onError(o,s,i,u){let a=Bb(_r(o.stdOut),_r(o.stdErr));if(a)return u(new yr(a));u(s)}}}var Rx=k({"src/lib/tasks/pull.ts"(){Jt(),bc(),I()}});function zx(e){let t={};return Yc(e,([r])=>t[r]={name:r}),Object.values(t)}function Ix(e){let t={};return Yc(e,([r,n,o])=>{if(!Object.hasOwn(t,r))t[r]={name:r,refs:{fetch:"",push:""}};if(o&&n)t[r].refs[o.replace(/[^a-z]/g,"")]=n}),Object.values(t)}function Yc(e,t){os(e,(r)=>t(r.split(/\s+/)))}var Nx=k({"src/lib/responses/GetRemoteSummary.ts"(){I()}}),Xc={};de(Xc,{addRemoteTask:()=>Lx,getRemotesTask:()=>Bx,listRemotesTask:()=>Mx,remoteTask:()=>Zx,removeRemoteTask:()=>jx});function Lx(e,t,r){return $e(["remote","add",...r,e,t])}function Bx(e){let t=["remote"];if(e)t.push("-v");return{commands:t,format:"utf-8",parser:e?Ix:zx}}function Mx(e){let t=[...e];if(t[0]!=="ls-remote")t.unshift("ls-remote");return $e(t)}function Zx(e){let t=[...e];if(t[0]!=="remote")t.unshift("remote");return $e(t)}function jx(e){return $e(["remote","remove",e])}var Hx=k({"src/lib/tasks/remote.ts"(){Nx(),ce()}}),Qc={};de(Qc,{stashListTask:()=>Ux});function Ux(e={},t){let r=lc(e),n=["stash","list",...r.commands,...t],o=ic(r.splitter,r.fields,gs(n));return Tn(n)||{commands:n,format:"utf-8",parser:o}}var Gx=k({"src/lib/tasks/stash-list.ts"(){vr(),ac(),xs(),pc()}}),el={};de(el,{addSubModuleTask:()=>Wx,initSubModuleTask:()=>qx,subModuleTask:()=>Rn,updateSubModuleTask:()=>Vx});function Wx(e,t){return Rn(["add",e,t])}function qx(e){return Rn(["init",...e])}function Rn(e){let t=[...e];if(t[0]!=="submodule")t.unshift("submodule");return $e(t)}function Vx(e){return Rn(["update",...e])}var Jx=k({"src/lib/tasks/sub-module.ts"(){ce()}});function Kx(e,t){let r=Number.isNaN(e),n=Number.isNaN(t);if(r!==n)return r?1:-1;return r?tl(e,t):0}function tl(e,t){return e===t?0:e>t?1:-1}function Yx(e){return e.trim()}function gn(e){if(typeof e==="string")return parseInt(e.replace(/^\D+/g,""),10)||0;return 0}var ta,rl,Xx=k({"src/lib/responses/TagList.ts"(){ta=class{constructor(e,t){this.all=e,this.latest=t}},rl=function(e,t=!1){let r=e.split(`
43
+ `).map(Yx).filter(Boolean);if(!t)r.sort(function(o,s){let i=o.split("."),u=s.split(".");if(i.length===1||u.length===1)return Kx(gn(i[0]),gn(u[0]));for(let a=0,c=Math.max(i.length,u.length);a<c;a++){let l=tl(gn(i[a]),gn(u[a]));if(l)return l}return 0});let n=t?r[0]:[...r].reverse().find((o)=>o.indexOf(".")>=0);return new ta(r,n)}}}),nl={};de(nl,{addAnnotatedTagTask:()=>tv,addTagTask:()=>ev,tagListTask:()=>Qx});function Qx(e=[]){let t=e.some((r)=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return rl(r,t)}}}function ev(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function tv(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var rv=k({"src/lib/tasks/tag.ts"(){Xx()}}),nv=yD({"src/git.js"(e,t){var{GitExecutor:r}=(ob(),ae(Ka)),{SimpleGitApi:n}=(ox(),ae(Fc)),{Scheduler:o}=(sx(),ae(Tc)),{adhocExecTask:s,configurationErrorTask:i}=(ce(),ae(Vo)),{asArray:u,filterArray:a,filterPrimitives:c,filterString:l,filterStringOrStringArray:p,filterType:f,getTrailingOptions:h,trailingFunctionArgument:d,trailingOptionsArgument:m}=(I(),ae(ba)),{applyPatchTask:b}=(ux(),ae(zc)),{branchTask:A,branchLocalTask:v,deleteBranchesTask:j,deleteBranchTask:G}=(yx(),ae(jc)),{checkIgnoreTask:N}=(wx(),ae(Gc)),{checkIsRepoTask:T}=(Ca(),ae(xa)),{cleanWithOptionsTask:L,isCleanOptionsArray:P}=(za(),ae(Pa)),{diffSummaryTask:M}=(xs(),ae(cc)),{fetchTask:g}=($x(),ae(qc)),{moveTask:he}=(Tx(),ae(Jc)),{pullTask:re}=(Rx(),ae(Kc)),{pushTagsTask:ee}=(Cc(),ae(wc)),{addRemoteTask:D,getRemotesTask:y,listRemotesTask:Fe,remoteTask:W,removeRemoteTask:ve}=(Hx(),ae(Xc)),{getResetMode:ke,resetTask:ue}=(qa(),ae(Ua)),{stashListTask:lt}=(Gx(),ae(Qc)),{addSubModuleTask:xt,initSubModuleTask:nt,subModuleTask:Ke,updateSubModuleTask:Z}=(Jx(),ae(el)),{addAnnotatedTagTask:Nt,addTagTask:wo,tagListTask:E}=(rv(),ae(nl)),{straightThroughBufferTask:X,straightThroughStringTask:w}=(ce(),ae(Vo));function C(x,S){this._plugins=S,this._executor=new r(x.baseDir,new o(x.maxConcurrentProcesses),S),this._trimmed=x.trimmed}(C.prototype=Object.create(n.prototype)).constructor=C,C.prototype.customBinary=function(x){return this._plugins.reconfigure("binary",x),this},C.prototype.env=function(x,S){if(arguments.length===1&&typeof x==="object")this._executor.env=x;else(this._executor.env=this._executor.env||{})[x]=S;return this},C.prototype.stashList=function(x){return this._runTask(lt(m(arguments)||{},a(x)&&x||[]),d(arguments))},C.prototype.mv=function(x,S){return this._runTask(he(x,S),d(arguments))},C.prototype.checkoutLatestTag=function(x){var S=this;return this.pull(function(){S.tags(function(z,ne){S.checkout(ne.latest,x)})})},C.prototype.pull=function(x,S,z,ne){return this._runTask(re(f(x,l),f(S,l),h(arguments)),d(arguments))},C.prototype.fetch=function(x,S){return this._runTask(g(f(x,l),f(S,l),h(arguments)),d(arguments))},C.prototype.silent=function(x){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},C.prototype.tags=function(x,S){return this._runTask(E(h(arguments)),d(arguments))},C.prototype.rebase=function(){return this._runTask(w(["rebase",...h(arguments)]),d(arguments))},C.prototype.reset=function(x){return this._runTask(ue(ke(x),h(arguments)),d(arguments))},C.prototype.revert=function(x){let S=d(arguments);if(typeof x!=="string")return this._runTask(i("Commit must be a string"),S);return this._runTask(w(["revert",...h(arguments,0,!0),x]),S)},C.prototype.addTag=function(x){let S=typeof x==="string"?wo(x):i("Git.addTag requires a tag name");return this._runTask(S,d(arguments))},C.prototype.addAnnotatedTag=function(x,S){return this._runTask(Nt(x,S),d(arguments))},C.prototype.deleteLocalBranch=function(x,S,z){return this._runTask(G(x,typeof S==="boolean"?S:!1),d(arguments))},C.prototype.deleteLocalBranches=function(x,S,z){return this._runTask(j(x,typeof S==="boolean"?S:!1),d(arguments))},C.prototype.branch=function(x,S){return this._runTask(A(h(arguments)),d(arguments))},C.prototype.branchLocal=function(x){return this._runTask(v(),d(arguments))},C.prototype.raw=function(x){let S=!Array.isArray(x),z=[].slice.call(S?arguments:x,0);for(let _e=0;_e<z.length&&S;_e++)if(!c(z[_e])){z.splice(_e,z.length-_e);break}z.push(...h(arguments,0,!0));var ne=d(arguments);if(!z.length)return this._runTask(i("Raw: must supply one or more command to execute"),ne);return this._runTask(w(z,this._trimmed),ne)},C.prototype.submoduleAdd=function(x,S,z){return this._runTask(xt(x,S),d(arguments))},C.prototype.submoduleUpdate=function(x,S){return this._runTask(Z(h(arguments,!0)),d(arguments))},C.prototype.submoduleInit=function(x,S){return this._runTask(nt(h(arguments,!0)),d(arguments))},C.prototype.subModule=function(x,S){return this._runTask(Ke(h(arguments)),d(arguments))},C.prototype.listRemote=function(){return this._runTask(Fe(h(arguments)),d(arguments))},C.prototype.addRemote=function(x,S,z){return this._runTask(D(x,S,h(arguments)),d(arguments))},C.prototype.removeRemote=function(x,S){return this._runTask(ve(x),d(arguments))},C.prototype.getRemotes=function(x,S){return this._runTask(y(x===!0),d(arguments))},C.prototype.remote=function(x,S){return this._runTask(W(h(arguments)),d(arguments))},C.prototype.tag=function(x,S){let z=h(arguments);if(z[0]!=="tag")z.unshift("tag");return this._runTask(w(z),d(arguments))},C.prototype.updateServerInfo=function(x){return this._runTask(w(["update-server-info"]),d(arguments))},C.prototype.pushTags=function(x,S){let z=ee({remote:f(x,l)},h(arguments));return this._runTask(z,d(arguments))},C.prototype.rm=function(x){return this._runTask(w(["rm","-f",...u(x)]),d(arguments))},C.prototype.rmKeepLocal=function(x){return this._runTask(w(["rm","--cached",...u(x)]),d(arguments))},C.prototype.catFile=function(x,S){return this._catFile("utf-8",arguments)},C.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},C.prototype._catFile=function(x,S){var z=d(S),ne=["cat-file"],_e=S[0];if(typeof _e==="string")return this._runTask(i("Git.catFile: options must be supplied as an array of strings"),z);if(Array.isArray(_e))ne.push.apply(ne,_e);let Ye=x==="buffer"?X(ne):w(ne);return this._runTask(Ye,z)},C.prototype.diff=function(x,S){let z=l(x)?i("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):w(["diff",...h(arguments)]);return this._runTask(z,d(arguments))},C.prototype.diffSummary=function(){return this._runTask(M(h(arguments,1)),d(arguments))},C.prototype.applyPatch=function(x){let S=!p(x)?i("git.applyPatch requires one or more string patches as the first argument"):b(u(x),h([].slice.call(arguments,1)));return this._runTask(S,d(arguments))},C.prototype.revparse=function(){let x=["rev-parse",...h(arguments,!0)];return this._runTask(w(x,!0),d(arguments))},C.prototype.clean=function(x,S,z){let ne=P(x),_e=ne&&x.join("")||f(x,l)||"",Ye=h([].slice.call(arguments,ne?1:0));return this._runTask(L(_e,Ye),d(arguments))},C.prototype.exec=function(x){let S={commands:[],format:"utf-8",parser(){if(typeof x==="function")x()}};return this._runTask(S)},C.prototype.clearQueue=function(){return this._runTask(s(()=>console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},C.prototype.checkIgnore=function(x,S){return this._runTask(N(u(f(x,p,[]))),d(arguments))},C.prototype.checkIsRepo=function(x,S){return this._runTask(T(f(x,l)),d(arguments))},t.exports=C}});ft();var ov=class extends it{constructor(e,t){super(void 0,t);this.config=e}};ft();ft();var Vt=class extends it{constructor(e,t,r){super(e,r);this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};Jt();ua();Ca();za();La();Ma();Ha();qa();function sv(e){if(!e)return;return[{type:"spawn.before",action(n,o){if(e.aborted)o.kill(new Vt(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,o){function s(){o.kill(new Vt(void 0,"abort","Abort signal received"))}e.addEventListener("abort",s),o.spawned.on("close",()=>e.removeEventListener("abort",s))}}]}function iv(e={}){return{type:"spawn.args",action(t,{env:r}){for(let n of $u(t,r))if(e[n.category]!==!0)throw new Vt(void 0,"unsafe",n.message);return t}}}I();function uv(e){let t=gr(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}I();var ra=Wt.deferred().promise;function av({onClose:e=!0,onExit:t=50}={}){function r(){let o=-1,s={close:Wt.deferred(),closeTimeout:Wt.deferred(),exit:Wt.deferred(),exitTimeout:Wt.deferred()},i=Promise.race([e===!1?ra:s.closeTimeout.promise,t===!1?ra:s.exitTimeout.promise]);return n(e,s.close,s.closeTimeout),n(t,s.exit,s.exitTimeout),{close(u){o=u,s.close.done()},exit(u){o=u,s.exit.done()},get exitCode(){return o},result:i}}function n(o,s,i){if(o===!1)return;(o===!0?s.promise:s.promise.then(()=>jo(o))).then(i.done)}return{type:"spawn.after",async action(o,{spawned:s,close:i}){let u=r(),a=!0,c=()=>void(a=!1);s.stdout?.on("data",c),s.stderr?.on("data",c),s.on("error",c),s.on("close",(l)=>u.close(l)),s.on("exit",(l)=>u.exit(l));try{if(await u.result,a)await jo(50);i(u.exitCode)}catch(l){i(u.exitCode,l)}}}}I();var cv="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",na="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function lv(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(e)}function oa(e,t){if(e.length<1||e.length>2)throw new Vt(void 0,"binary",cv);if(e.some(lv))if(t)console.warn(na);else throw new Vt(void 0,"binary",na);let[n,o]=e;return{binary:n,prefix:o}}function pv(e,t=["git"],r=!1){let n=oa(Qe(t),r);e.on("binary",(o)=>{n=oa(Qe(o),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",(o)=>n.prefix?[n.prefix,...o]:o)}ft();function fv(e){return!!(e.exitCode&&e.stdErr.length)}function hv(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function dv(e=!1,t=fv,r=hv){return(n,o)=>{if(!e&&n||!t(o))return n;return r(o)}}function sa(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});if(Buffer.isBuffer(n))return{error:new it(void 0,n.toString("utf-8"))};return{error:n}}}}I();var gv=class{constructor(){this.plugins=new Set,this.events=new mv}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=We(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return Qe(e).forEach((r)=>r&&this.plugins.add(We(t,r))),()=>{t.forEach((r)=>this.plugins.delete(r))}}exec(e,t,r){let n=t,o=Object.freeze(Object.create(r));for(let s of this.plugins)if(s.type===e)n=s.action(n,o);return n}};I();function _v(e){let r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,i){if(!r.includes(i.method))return s;return ha(s,"--progress")}},{type:"spawn.after",action(s,i){if(!i.commands.includes("--progress"))return;i.spawned.stderr?.on("data",(u)=>{let a=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(u.toString("utf8"));if(!a)return;e({method:i.method,stage:yv(a[1]),progress:Q(a[2]),processed:Q(a[3]),total:Q(a[4])})})}}]}function yv(e){return String(e.toLowerCase().split(" ",1))||"unknown"}I();function Dv(e){let t=ma(e,["uid","gid"]);return{type:"spawn.options",action(r){return{...t,...r}}}}function bv({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,o){let s;function i(){s&&clearTimeout(s),s=setTimeout(a,e)}function u(){o.spawned.stdout?.off("data",i),o.spawned.stderr?.off("data",i),o.spawned.off("exit",u),o.spawned.off("close",u),s&&clearTimeout(s)}function a(){u(),o.kill(new Vt(void 0,"timeout","block timeout reached"))}r&&o.spawned.stdout?.on("data",i),t&&o.spawned.stderr?.on("data",i),o.spawned.on("exit",u),o.spawned.on("close",u),i()}}}function xv(){return{type:"spawn.args",action(e){let t=[],r;function n(o){(r=r||[]).push(...o)}for(let o=0;o<e.length;o++){let s=e[o];if(He(s)){n(Ut(s));continue}if(s==="--"){n(e.slice(o+1).flatMap((i)=>He(i)&&Ut(i)||i));break}t.push(s)}return!r?t:[...t,"--",...r.map(String)]}}}I();var vv=nv();function wv(e,t){let r=new gv,n=ya(e&&(typeof e==="string"?{baseDir:e}:e)||{},t);if(!ss(n.baseDir))throw new ov(n,"Cannot use simple-git on a directory that does not exist");if(Array.isArray(n.config))r.add(uv(n.config));return r.add(iv(n.unsafe)),r.add(av(n.completion)),n.abort&&r.add(sv(n.abort)),n.progress&&r.add(_v(n.progress)),n.timeout&&r.add(bv(n.timeout)),n.spawnOptions&&r.add(Dv(n.spawnOptions)),r.add(xv()),r.add(sa(dv(!0))),n.errors&&r.add(sa(n.errors)),pv(r,n.binary,n.unsafe?.allowUnsafeCustomBinary),new vv(n,r)}Jt();var ol=wv;import{stat as rm}from"fs/promises";import{dirname as IE,join as NE,resolve as LE}from"path";import{readdir as iw,readdirSync as uw,realpath as aw,realpathSync as cw,stat as lw,statSync as pw}from"fs";import{isAbsolute as fw,posix as $t,resolve as hw}from"path";import{fileURLToPath as dw}from"url";import{createRequire as Cv}from"module";import{basename as Ev,dirname as ks,normalize as kv,relative as Sv,resolve as $v,sep as ul}from"path";import*as Ov from"fs";var sl=Cv(import.meta.url);function Av(e){let t=kv(e);if(t.length>1&&t[t.length-1]===ul)t=t.substring(0,t.length-1);return t}var Fv=/[\\/]/g;function al(e,t){return e.replace(Fv,t)}var Tv=/^[a-z]:[\\/]$/i;function Pv(e){return e==="/"||Tv.test(e)}function Es(e,t){let{resolvePaths:r,normalizePath:n,pathSeparator:o}=t,s=process.platform==="win32"&&e.includes("/")||e.startsWith(".");if(r)e=$v(e);if(n||s)e=Av(e);if(e===".")return"";let i=e[e.length-1]!==o;return al(i?e+o:e,o)}function cl(e,t){return t+e}function Rv(e,t){return function(r,n){if(n.startsWith(e))return n.slice(e.length)+r;else return al(Sv(e,n),t.pathSeparator)+t.pathSeparator+r}}function zv(e){return e}function Iv(e,t,r){return t+e+r}function Nv(e,t){let{relativePaths:r,includeBasePath:n}=t;return r&&e?Rv(e,t):n?cl:zv}function Lv(e){return function(t,r){r.push(t.substring(e.length)||".")}}function Bv(e){return function(t,r,n){let o=t.substring(e.length)||".";if(n.every((s)=>s(o,!0)))r.push(o)}}var Mv=(e,t)=>{t.push(e||".")},Zv=(e,t,r)=>{let n=e||".";if(r.every((o)=>o(n,!0)))t.push(n)},jv=()=>{};function Hv(e,t){let{includeDirs:r,filters:n,relativePaths:o}=t;if(!r)return jv;if(o)return n&&n.length?Bv(e):Lv(e);return n&&n.length?Zv:Mv}var Uv=(e,t,r,n)=>{if(n.every((o)=>o(e,!1)))r.files++},Gv=(e,t,r,n)=>{if(n.every((o)=>o(e,!1)))t.push(e)},Wv=(e,t,r,n)=>{r.files++},qv=(e,t)=>{t.push(e)},Vv=()=>{};function Jv(e){let{excludeFiles:t,filters:r,onlyCounts:n}=e;if(t)return Vv;if(r&&r.length)return n?Uv:Gv;else if(n)return Wv;else return qv}var Kv=(e)=>e,Yv=()=>[""].slice(0,0);function Xv(e){return e.group?Yv:Kv}var Qv=(e,t,r)=>{e.push({directory:t,files:r,dir:t})},e0=()=>{};function t0(e){return e.group?Qv:e0}var r0=function(e,t,r){let{queue:n,fs:o,options:{suppressErrors:s}}=t;n.enqueue(),o.realpath(e,(i,u)=>{if(i)return n.dequeue(s?null:i,t);o.stat(u,(a,c)=>{if(a)return n.dequeue(s?null:a,t);if(c.isDirectory()&&ll(e,u,t))return n.dequeue(null,t);r(c,u),n.dequeue(null,t)})})},n0=function(e,t,r){let{queue:n,fs:o,options:{suppressErrors:s}}=t;n.enqueue();try{let i=o.realpathSync(e),u=o.statSync(i);if(u.isDirectory()&&ll(e,i,t))return;r(u,i)}catch(i){if(!s)throw i}};function o0(e,t){if(!e.resolveSymlinks||e.excludeSymlinks)return null;return t?n0:r0}function ll(e,t,r){if(r.options.useRealPaths)return s0(t,r);let n=ks(e),o=1;while(n!==r.root&&o<2){let s=r.symlinks.get(n);if(!!s&&(s===t||s.startsWith(t)||t.startsWith(s)))o++;else n=ks(n)}return r.symlinks.set(e,t),o>1}function s0(e,t){return t.visited.includes(e+t.options.pathSeparator)}var i0=(e)=>e.counts,u0=(e)=>e.groups,a0=(e)=>e.paths,c0=(e)=>e.paths.slice(0,e.options.maxFiles),l0=(e,t,r)=>(zn(t,r,e.counts,e.options.suppressErrors),null),p0=(e,t,r)=>(zn(t,r,e.paths,e.options.suppressErrors),null),f0=(e,t,r)=>(zn(t,r,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),h0=(e,t,r)=>(zn(t,r,e.groups,e.options.suppressErrors),null);function zn(e,t,r,n){if(e&&!n)t(e,r);else t(null,r)}function d0(e,t){let{onlyCounts:r,group:n,maxFiles:o}=e;if(r)return t?i0:l0;else if(n)return t?u0:h0;else if(o)return t?c0:f0;else return t?a0:p0}var pl={withFileTypes:!0},m0=(e,t,r,n,o)=>{if(e.queue.enqueue(),n<0)return e.queue.dequeue(null,e);let{fs:s}=e;e.visited.push(t),e.counts.directories++,s.readdir(t||".",pl,(i,u=[])=>{o(u,r,n),e.queue.dequeue(e.options.suppressErrors?null:i,e)})},g0=(e,t,r,n,o)=>{let{fs:s}=e;if(n<0)return;e.visited.push(t),e.counts.directories++;let i=[];try{i=s.readdirSync(t||".",pl)}catch(u){if(!e.options.suppressErrors)throw u}o(i,r,n)};function _0(e){return e?g0:m0}var y0=class{count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){if(this.onQueueEmpty&&(--this.count<=0||e)){if(this.onQueueEmpty(e,t),e)t.controller.abort(),this.onQueueEmpty=void 0}}},D0=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}get dirs(){return this._directories}},b0=class{aborted=!1;abort(){this.aborted=!0}},fl=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,r){this.isSynchronous=!r,this.callbackInvoker=d0(t,this.isSynchronous),this.root=Es(e,t),this.state={root:Pv(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new D0,options:t,queue:new y0((n,o)=>this.callbackInvoker(o,n,r)),symlinks:new Map,visited:[""].slice(0,0),controller:new b0,fs:t.fs||Ov},this.joinPath=Nv(this.root,t),this.pushDirectory=Hv(this.root,t),this.pushFile=Jv(t),this.getArray=Xv(t),this.groupFiles=t0(t),this.resolveSymlink=o0(t,this.isSynchronous),this.walkDirectory=_0(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,r)=>{let{paths:n,options:{filters:o,resolveSymlinks:s,excludeSymlinks:i,exclude:u,maxFiles:a,signal:c,useRealPaths:l,pathSeparator:p},controller:f}=this.state;if(f.aborted||c&&c.aborted||a&&n.length>a)return;let h=this.getArray(this.state.paths);for(let d=0;d<e.length;++d){let m=e[d];if(m.isFile()||m.isSymbolicLink()&&!s&&!i){let b=this.joinPath(m.name,t);this.pushFile(b,h,this.state.counts,o)}else if(m.isDirectory()){let b=Iv(m.name,t,this.state.options.pathSeparator);if(u&&u(m.name,b))continue;this.pushDirectory(b,n,o),this.walkDirectory(this.state,b,b,r-1,this.walk)}else if(this.resolveSymlink&&m.isSymbolicLink()){let b=cl(m.name,t);this.resolveSymlink(b,this.state,(A,v)=>{if(A.isDirectory()){if(v=Es(v,this.state.options),u&&u(m.name,l?v:b+p))return;this.walkDirectory(this.state,v,l?v:b+p,r-1,this.walk)}else{v=l?v:b;let j=Ev(v),G=Es(ks(v),this.state.options);v=this.joinPath(j,G),this.pushFile(v,h,this.state.counts,o)}})}}this.groupFiles(this.state.groups,t,h)}};function x0(e,t){return new Promise((r,n)=>{hl(e,t,(o,s)=>{if(o)return n(o);r(s)})})}function hl(e,t,r){new fl(e,t,r).start()}function v0(e,t){return new fl(e,t).start()}var il=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return x0(this.root,this.options)}withCallback(e){hl(this.root,this.options,e)}sync(){return v0(this.root,this.options)}},dl=null;try{sl.resolve("picomatch"),dl=sl("picomatch")}catch{}var ml=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:ul,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new il(e||".",this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new il(e||".",this.options)}glob(...e){if(this.globFunction)return this.globWithOptions(e);return this.globWithOptions(e,...[{dot:!0}])}globWithOptions(e,...t){let r=this.globFunction||dl;if(!r)throw Error("Please specify a glob function to use glob matching.");var n=this.globCache[e.join("\x00")];if(!n)n=r(e,...t),this.globCache[e.join("\x00")]=n;return this.options.filters.push((o)=>n(o)),this}};var Qt=ot(Ll(),1),mw=Array.isArray,jl=/\\/g,gw=/^[A-Za-z]:$/,Hl=process.platform==="win32",_w=/^(\/?\.\.)+$/;function yw(e,t={}){let r=e.length,n=Array(r),o=Array(r),s,i;for(s=0;s<r;s++){let u=Ul(e[s]);n[s]=u;let a=u.length,c=Array(a);for(i=0;i<a;i++)c[i]=Qt.default(u[i],t);o[s]=c}return(u)=>{let a=u.split("/");if(a[0]===".."&&_w.test(u))return!0;for(s=0;s<r;s++){let c=n[s],l=o[s],p=a.length,f=Math.min(p,c.length);i=0;while(i<f){let h=c[i];if(h.includes("/"))return!0;if(!l[i](a[i]))break;if(!t.noglobstar&&h==="**")return!0;i++}if(i===p)return!0}return!1}}var Dw=/^[A-Z]:\/$/i,bw=Hl?(e)=>Dw.test(e):(e)=>e==="/";function Bl(e,t,r){if(e===t||t.startsWith(`${e}/`)){if(r){let o=e.length+ +!bw(e);return(s,i)=>s.slice(o,i?-1:void 0)||"."}let n=t.slice(e.length+1);if(n)return(o,s)=>{if(o===".")return n;let i=`${n}/${o}`;return s?i.slice(0,-1):i};return(o,s)=>s&&o!=="."?o.slice(0,-1):o}if(r)return(n)=>$t.relative(e,n)||".";return(n)=>$t.relative(e,`${t}/${n}`)||"."}function xw(e,t){if(t.startsWith(`${e}/`)){let r=t.slice(e.length+1);return(n)=>`${r}/${n}`}return(r)=>{let n=$t.relative(e,`${t}/${r}`);return r[r.length-1]==="/"&&n!==""?`${n}/`:n||"."}}function Ml(e){return e.replace(gw,(t)=>`${t}/`)}var vw={parts:!0};function Ul(e){var t;let r=Qt.default.scan(e,vw);return((t=r.parts)===null||t===void 0?void 0:t.length)?r.parts:[e]}var ww=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,Cw=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ew=(e)=>e.replace(ww,"\\$&"),kw=(e)=>e.replace(Cw,"\\$&"),Sw=Hl?kw:Ew;function $w(e,t){if((t===null||t===void 0?void 0:t.caseSensitiveMatch)===!1)return!0;let r=Qt.default.scan(e);return r.isGlob||r.negated}function kr(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...e)}function Gl(e){return typeof e==="string"?[e]:e!==null&&e!==void 0?e:[]}var Ow=/^(\/?\.\.)+/,Aw=/\\(?=[()[\]{}!*+?@|])/g;function zs(e,t,r,n){var o;let s=t.cwd,i=e;if(e[e.length-1]==="/")i=e.slice(0,-1);if(i[i.length-1]!=="*"&&t.expandDirectories)i+="/**";let u=Sw(s);i=fw(i.replace(Aw,""))?$t.relative(u,i):$t.normalize(i);let a=(o=Ow.exec(i))===null||o===void 0?void 0:o[0],c=Ul(i);if(a){let p=(a.length+1)/3,f=0,h=u.split("/");while(f<p&&c[f+p]===h[h.length+f-p])i=i.slice(0,(p-f-1)*3)+i.slice((p-f)*3+c[f+p].length+1)||".",f++;let d=$t.join(s,a.slice(f*3));if(d[0]!=="."&&r.root.length>d.length)r.root=Ml(d),r.depthOffset=-p+f}if(!n&&r.depthOffset>=0){var l;(l=r.commonPath)!==null&&l!==void 0||(r.commonPath=c);let p=[],f=Math.min(r.commonPath.length,c.length);for(let h=0;h<f;h++){let d=c[h];if(d==="**"&&!c[h+1]){p.pop();break}if(h===c.length-1||d!==r.commonPath[h]||$w(d))break;p.push(d)}r.depthOffset=p.length,r.commonPath=p,r.root=Ml(p.length>0?$t.join(s,...p):s)}return i}function Fw(e,t,r){let n=[],o=[];for(let s of e.ignore){if(!s)continue;if(s[0]!=="!"||s[1]==="(")o.push(zs(s,e,r,!0))}for(let s of t){if(!s)continue;if(s[0]!=="!"||s[1]==="(")n.push(zs(s,e,r,!1));else if(s[1]!=="!"||s[2]==="(")o.push(zs(s.slice(1),e,r,!0))}return{match:n,ignore:o}}function Tw(e,t){let r=e.cwd,n={root:r,depthOffset:0},o=Fw(e,t,n);if(e.debug)kr("internal processing patterns:",o);let{absolute:s,caseSensitiveMatch:i,debug:u,dot:a,followSymbolicLinks:c,onlyDirectories:l}=e,p=n.root.replace(jl,""),f={dot:a,nobrace:e.braceExpansion===!1,nocase:!i,noextglob:e.extglob===!1,noglobstar:e.globstar===!1,posix:!0},h=Qt.default(o.match,f),d=Qt.default(o.ignore,f),m=yw(o.match,f),b=Bl(r,p,s),A=s?b:Bl(r,p,!0),v=(N,T)=>{let L=A(T,!0);return L!=="."&&!m(L)||d(L)},j;if(e.deep!==void 0)j=Math.round(e.deep-n.depthOffset);let G=new ml({filters:[u?(N,T)=>{let L=b(N,T),P=h(L)&&!d(L);if(P)kr(`matched ${L}`);return P}:(N,T)=>{let L=b(N,T);return h(L)&&!d(L)}],exclude:u?(N,T)=>{let L=v(N,T);return kr(`${L?"skipped":"crawling"} ${T}`),L}:v,fs:e.fs,pathSeparator:"/",relativePaths:!s,resolvePaths:s,includeBasePath:s,resolveSymlinks:c,excludeSymlinks:!c,excludeFiles:l,includeDirs:l||!e.onlyFiles,maxDepth:j,signal:e.signal}).crawl(p);if(e.debug)kr("internal properties:",{...n,root:p});return[G,r!==p&&!s&&xw(r,p)]}function Pw(e,t){if(t)for(let r=e.length-1;r>=0;r--)e[r]=t(e[r]);return e}var Zl={caseSensitiveMatch:!0,debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function Rw(e){let t=Object.assign({},e);for(let r in Zl)if(t[r]===void 0)Object.assign(t,{[r]:Zl[r]});if(t.cwd=(t.cwd instanceof URL?dw(t.cwd):hw(t.cwd||process.cwd())).replace(jl,"/"),t.ignore=Gl(t.ignore),t.fs&&(t.fs={readdir:t.fs.readdir||iw,readdirSync:t.fs.readdirSync||uw,realpath:t.fs.realpath||aw,realpathSync:t.fs.realpathSync||cw,stat:t.fs.stat||lw,statSync:t.fs.statSync||pw}),t.debug)kr("globbing with options:",t);return t}function zw(e,t={}){var r;if(e&&(t===null||t===void 0?void 0:t.patterns))throw Error("Cannot pass patterns as both an argument and an option");let n=mw(e)||typeof e==="string",o=Gl((r=n?e:e.patterns)!==null&&r!==void 0?r:"**/*"),s=Rw(n?t:e);return o.length>0?Tw(s,o):[]}async function Wl(e,t){let[r,n]=zw(e,t);return r?Pw(await r.withPromise(),n):[]}var{YAML:Kd}=globalThis.Bun;function Ln(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function Ns(e,t="|"){return e.map((r)=>Ms(r)).join(t)}function Or(e,t){if(typeof t==="bigint")return t.toString();return t}function Bn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function ql(e){return e===null||e===void 0}function Mn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Vl(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function Ce(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function dt(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Jl(e){return JSON.stringify(e)}function Kl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ls="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $r(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Yl=Bn(()=>{if(Be.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function er(e){if($r(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if($r(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Bs(e){if(er(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var Xl=new Set(["string","number","symbol"]);function tr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function et(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function R(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Ms(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Ql(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var ep=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))();function Iw(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s=dt(e._zod.def,{get shape(){let i={};for(let u of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(r.shape,u))throw Error(`Unrecognized key: "${String(u)}"`);if(!t[u])continue;Ce(i,u,r.shape[u])}return Ce(this,"shape",i),i},checks:[]});return et(e,s)}function Nw(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=dt(e._zod.def,{get shape(){let i={...e._zod.def.shape};for(let u of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(r.shape,u))throw Error(`Unrecognized key: "${String(u)}"`);if(!t[u])continue;delete i[u]}return Ce(this,"shape",i),i},checks:[]});return et(e,s)}function Lw(e,t){if(!er(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let s=e._zod.def.shape;for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=dt(e._zod.def,{get shape(){let s={...e._zod.def.shape,...t};return Ce(this,"shape",s),s}});return et(e,o)}function Bw(e,t){if(!er(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=dt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ce(this,"shape",n),n}});return et(e,r)}function Mw(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=dt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return Ce(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return et(e,r)}function tp(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let u=dt(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let l of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(a,l))throw Error(`Unrecognized key: "${String(l)}"`);if(!r[l])continue;c[l]=e?new e({type:"optional",innerType:a[l]}):a[l]}else for(let l of Reflect.ownKeys(a))c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return Ce(this,"shape",c),c},checks:[]});return et(t,u)}function Zw(e,t,r){let n=dt(t._zod.def,{get shape(){let o=t._zod.def.shape,s={...o};if(r)for(let i of Reflect.ownKeys(r)){if(!Object.prototype.hasOwnProperty.call(s,i))throw Error(`Unrecognized key: "${String(i)}"`);if(!r[i])continue;s[i]=new e({type:"nonoptional",innerType:o[i]})}else for(let i of Reflect.ownKeys(o))s[i]=new e({type:"nonoptional",innerType:o[i]});return Ce(this,"shape",s),s}});return et(t,n)}function At(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function rp(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Zn(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Sr(e){return typeof e==="string"?e:e?.message}function Zs(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function mt(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Sr(e.inst?._zod.def?.error?.(e))??Sr(s?.(e))??Sr(t?.error?.(e))??Sr(r.customError?.(e))??Sr(r.localeError?.(e))??"Invalid input",{inst:u,schema:a,continue:c,input:l,...p}=e;if(p.path??(p.path=[]),p.message=i,t?.reportInput)p.input=l;return p}var jw=/[\uD800-\uDBFF]/;function jn(e){let t=e.length;if(!jw.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function Hn(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function np(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Ft(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function op(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else Hw(e,r,n.value)}}function Ot(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function js(e,t,r){return Ot(e,t,r,!1)}function Hw(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Ot(this,t,r.bind(this))},set(n){Ot(this,t,n)}})}function Uw(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Is,ht=!1,Gw={configurable:!0,get(){ht=!0;return}};function J(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&Is!==e._zod){Is=void 0;return}Is=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Gw);let o=ht;ht=!1;try{let s=r(this);if(ht)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return ht=ht||o,s}catch(s){throw delete this[t],ht=ht||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Ww(e,t,r,n){let o=Uw(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var qw="~constantCatch";function sp(e){let t=()=>e;return t[qw]=!0,t}var ip;var Hs={value:void 0,enumerable:!1},up="captureStackTrace"in Error?Error:null;function Vw(e){let t=up;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return up=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function _(e,t,r,n){let o={};function s(f){this.def=f,this.constr=p,this.traits=new Set}s.prototype=o;let i=r,u=i&&new WeakSet;function a(f,h){if(!f._zod){Hs.value=new s(h);try{Object.defineProperty(f,"_zod",Hs)}finally{Hs.value=void 0}}if(f._zod.traits.has(e))return;if(f._zod.traits.add(e),t(f,h),u){let m=Object.getPrototypeOf(f),b=f._zod.constr.prototype,A=m;while(A&&A!==b)A=Object.getPrototypeOf(A);let v=A??m;if(!u.has(v))u.add(v),op(v,i)}let d=p.prototype;for(let m in d){if(!Object.prototype.hasOwnProperty.call(d,m))continue;if(!(m in f))f[m]=d[m].bind(f)}}let c=n?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function p(f){let h=n?.Parent?Vw(l):this;a(h,f);let d=h._zod.deferred;if(d){for(let b of d)b();h._zod.deferred=void 0}let m=globalThis.__zod_globalConfig?.postProcessor;if(m)m(h);return h}return Object.defineProperty(p,"init",{value:a}),Object.defineProperty(p,Symbol.hasInstance,{value:(f)=>{if(n?.Parent&&f instanceof n.Parent)return!0;return f?._zod?.traits?.has(e)}}),Object.defineProperty(p,"name",{value:e}),p}class ut extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ar extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(ip=globalThis).__zod_globalConfig??(ip.__zod_globalConfig={});var Be=globalThis.__zod_globalConfig;function Ve(e){if(e)Object.assign(Be,e);return Be}function Jw(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Or,2)),e.message}function Kw(e){this._zod.message=e}var Yw={get:Jw,set:Kw,enumerable:!0,configurable:!0},Gs={value:void 0,enumerable:!1},Ws={value:void 0,enumerable:!1},ap=new WeakSet([Object.prototype,Error.prototype]),cp=(e,t)=>{e.name="$ZodError",Gs.value=e._zod,Object.defineProperty(e,"_zod",Gs),Ws.value=t,Object.defineProperty(e,"issues",Ws),Gs.value=void 0,Ws.value=void 0,Object.defineProperty(e,"message",Yw);let r=Object.getPrototypeOf(e);if(!ap.has(r))ap.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},Un=_("$ZodError",cp),qs=_("$ZodError",cp,void 0,{Parent:Error});function Xw(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function lp(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)Xw(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function pp(e,t=(r)=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((u)=>n({issues:u},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let u=[...s,...i.path];if(u.length===0)r._errors.push(t(i));else{let a=r,c=0;while(c<u.length){let l=u[c],p=c===u.length-1;if(l==="_errors"){if(p)a._errors.push(t(i));c++;continue}if(!Object.prototype.hasOwnProperty.call(a,l))Object.defineProperty(a,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=a[l];if(p)f._errors.push(t(i));a=f,c++}}}};return n(e),r}function Gn(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Wn=(e)=>{let t=(r,n,o,s)=>{let i=o?{...o,async:!1}:{async:!1},u=r._zod.run({value:n,issues:[]},i);if(u instanceof Promise)throw new ut;if(u.issues.length){let a=new(s?.Err??e)(u.issues.map((c)=>mt(c,i,Ve())));throw Ls(a,s?.callee??t),a}return u.value};return t};var qn=(e)=>{let t=async(r,n,o,s)=>{let i=o?{...o,async:!0}:{async:!0},u=r._zod.run({value:n,issues:[]},i);if(u instanceof Promise)u=await u;if(u.issues.length){let a=new(s?.Err??e)(u.issues.map((c)=>mt(c,i,Ve())));throw Ls(a,s?.callee??t),a}return u.value};return t};var Fr=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ut;return s.issues.length?{success:!1,error:new(e??Un)(s.issues.map((i)=>mt(i,o,Ve())))}:{success:!0,data:s.value}},fp=Fr(qs),Tr=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;return s.issues.length?{success:!1,error:new e(s.issues.map((i)=>mt(i,o,Ve())))}:{success:!0,data:s.value}},hp=Tr(qs);var dp=(e)=>{let t=Wn(e),r=(n,o,s,i)=>{let u=s?{...s,direction:"backward"}:{direction:"backward"};return t(n,o,u,Gn(r,i))};return r};var mp=(e)=>{let t=Wn(e),r=(n,o,s,i)=>t(n,o,s,Gn(r,i));return r};var gp=(e)=>{let t=qn(e),r=async(n,o,s,i)=>{let u=s?{...s,direction:"backward"}:{direction:"backward"};return await t(n,o,u,Gn(r,i))};return r};var _p=(e)=>{let t=qn(e),r=async(n,o,s,i)=>await t(n,o,s,Gn(r,i));return r};var yp=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Fr(e)(t,r,o)};var Dp=(e)=>(t,r,n)=>Fr(e)(t,r,n);var bp=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Tr(e)(t,r,o)};var xp=(e)=>async(t,r,n)=>Tr(e)(t,r,n);var vp=/^[cC][0-9a-z]{6,}$/,wp=/^[0-9a-z]+$/,Cp=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ep=/^[0-9a-vA-V]{20}$/,kp=/^[A-Za-z0-9]{27}$/,Sp=/^[a-zA-Z0-9_-]{21}$/;function $p(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Op=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Ap=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Js=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Fp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var eC="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Tp(){return new RegExp(eC,"u")}var Pp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var zp=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ip=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Np=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ks=/^[A-Za-z0-9_-]*$/;var Lp=/^https?$/,Bp=/^\+[1-9]\d{6,14}$/;var Mp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function tC(e){return new RegExp(`^${e}$`)}var Zp=tC(Mp);function Vs(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function jp(e){return new RegExp(`^${Vs(e)}$`)}function Hp(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Vs({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${Vs({precision:e.precision})}`:r;return new RegExp(`^${Mp}T(?:${n})$`)}var Up=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var Gp=/^-?\d+$/,Wp=/^-?\d+(?:\.\d+)?$/;var qp=/^[^A-Z]*$/,Vp=/^[^a-z]*$/;var xe=_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Ys=(e)=>{let t=e.value;return!ql(t)&&t.length!==void 0},Jn={number:"number",bigint:"bigint",object:"date"},Xs=_("$ZodCheckLessThan",(e,t)=>{xe.init(e,t);let r=Jn[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<s)if(t.inclusive)o.maximum=t.value;else o.exclusiveMaximum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:Jn[typeof n.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Qs=_("$ZodCheckGreaterThan",(e,t)=>{xe.init(e,t);let r=Jn[typeof t.value];e._zod.onattach.push((n)=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>s)if(t.inclusive)o.minimum=t.value;else o.exclusiveMinimum=t.value}),e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:Jn[typeof n.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jp=_("$ZodCheckMultipleOf",(e,t)=>{xe.init(e,t),e._zod.onattach.push((r)=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):Vl(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Kp=_("$ZodCheckNumberFormat",(e,t)=>{xe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=ep[t.format];e._zod.onattach.push((i)=>{let u=i._zod.bag;if(u.format=t.format,u.minimum=o,u.maximum=s,r)u.pattern=Gp}),e._zod.check=(i)=>{let u=i.value;if(r){if(!Number.isInteger(u)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){if(u>0)i.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else i.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(u<o)i.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(u>s)i.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Yp=_("$ZodCheckMaxLength",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Ys),e._zod.onattach.push((n)=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<o)n._zod.bag.maximum=t.maximum}),e._zod.check=(n)=>{let o=n.value,s=o.length;if((typeof o==="string"&&s>t.maximum?jn(o):s)<=t.maximum)return;let u=Hn(o);n.issues.push({origin:u,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Xp=_("$ZodCheckMinLength",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Ys),e._zod.onattach.push((n)=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>o)n._zod.bag.minimum=t.minimum}),e._zod.check=(n)=>{let o=n.value,s=o.length;if((typeof o==="string"&&s>=t.minimum&&s<t.minimum*2?jn(o):s)>=t.minimum)return;let u=Hn(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Qp=_("$ZodCheckLengthEquals",(e,t)=>{var r;xe.init(e,t),(r=e._zod.def).when??(r.when=Ys),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=(n)=>{let o=n.value,s=o.length,i=typeof o==="string"&&s>=t.length&&s<=t.length*2?jn(o):s;if(i===t.length)return;let u=Hn(o),a=i>t.length;n.issues.push({origin:u,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Pr=_("$ZodCheckStringFormat",(e,t)=>{var r,n;if(xe.init(e,t),e._zod.onattach.push((o)=>{let s=o._zod.bag;if(s.format=t.format,t.pattern)s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern)}),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),ef=_("$ZodCheckRegex",(e,t)=>{Pr.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),tf=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qp),Pr.init(e,t)}),rf=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Vp),Pr.init(e,t)}),nf=_("$ZodCheckIncludes",(e,t)=>{xe.init(e,t);let r=tr(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.onattach.push((o)=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),of=_("$ZodCheckStartsWith",(e,t)=>{xe.init(e,t);let r=new RegExp(`^${tr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),sf=_("$ZodCheckEndsWith",(e,t)=>{xe.init(e,t);let r=new RegExp(`.*${tr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push((n)=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var uf=_("$ZodCheckOverwrite",(e,t)=>{xe.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class ei{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
43
44
  `).filter((s)=>s),n=Math.min(...r.map((s)=>s.length-s.trimStart().length)),o=r.map((s)=>s.slice(n)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
44
45
  ${t.join(`
45
46
  `)}
46
- };`)(...Object.values(this.closed))}}var Bp={major:4,minor:5,patch:4};var fe=D("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bp;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let s of o)for(let i of s._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(u,a,c)=>{if(u.memo)return u;let l=$t(u),p;for(let f of a){if(f._zod.def.when){if(zl(u))continue;if(!f._zod.def.when(u))continue}else if(l)continue;let h=u.issues.length,d=f._zod.check(u);if(d instanceof Promise&&c?.async===!1)throw new st;if(p||d instanceof Promise)p=(p??Promise.resolve()).then(async()=>{if(await d,u.issues.length===h)return;if(Es(u.issues,h,e),!l)l=$t(u,h)});else{if(u.issues.length===h)continue;if(Es(u.issues,h,e),!l)l=$t(u,h)}}if(p)return p.then(()=>u);return u},i=(u,a,c)=>{if($t(u))return u.aborted=!0,u;let l=s(a,o,c);if(l instanceof Promise){if(c.async===!1)throw new st;return l.then((p)=>e._zod.parse(p,c))}return e._zod.parse(l,c)};e._zod.run=(u,a)=>{if(a.skipChecks)return e._zod.parse(u,a);if(a.direction==="backward"){let l=e._zod.parse({value:u.value,issues:[]},{...a,skipChecks:!0});if(l instanceof Promise)return l.then((p)=>i(p,u,a));return i(l,u,a)}let c=e._zod.parse(u,a);if(c instanceof Promise){if(a.async===!1)throw new st;return c.then((l)=>s(l,o,a))}return s(c,o,a)}}},{get "~standard"(){return $s(this,"~standard",Bs(this))},set "~standard"(e){Et(this,"~standard",e)}}),Mp=(e)=>e.success?{value:e.data}:{issues:e.error?.issues};function Bs(e){return{validate:(t)=>{try{return Mp(Ul(e,t))}catch(r){return Gl(e,t).then(Mp)}},vendor:"zod",version:1}}var Nn=D("$ZodString",(e,t)=>{fe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vp(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),te=D("$ZodStringFormat",(e,t)=>{Or.init(e,t),Nn.init(e,t)}),Xp=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ap),te.init(e,t)}),Qp=D("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ps(n))}else t.pattern??(t.pattern=Ps());te.init(e,t)}),ef=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cp),te.init(e,t)}),tf=1,rf=2;function iw(e,t){if(!t.normalize&&t.protocol?.source===gp.source&&!/^https?:\/\//i.test(e))return tf;try{return new URL(e)}catch{return rf}}var uw=/[\t\n\r]/g;function aw(e){return e.replace(uw,"")}function cw(e,t){return t.lastIndex=0,t.test(e.hostname)}function lw(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var nf=D("$ZodURL",(e,t)=>{te.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=iw(n,t);if(o===tf){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===rf){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(t.hostname&&!cw(o,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!lw(o,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?o.href:aw(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),of=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=lp()),te.init(e,t)}),sf=D("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?sp:ip(t.length)),te.init(e,t)}),uf=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ep),te.init(e,t)}),af=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tp),te.init(e,t)}),cf=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=rp),te.init(e,t)}),lf=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=np),te.init(e,t)}),pf=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=op),te.init(e,t)}),ff=D("$ZodISODateTime",(e,t)=>{if(t.pattern??(t.pattern=xp(t)),te.init(e,t),t.local||t.precision===-1)e._zod.bag.laxFormat=!0,e._zod.onattach.push((r)=>{r._zod.bag.laxFormat=!0})}),hf=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=bp),te.init(e,t)}),df=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=yp(t)),te.init(e,t)}),mf=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=up),te.init(e,t)}),gf=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pp),te.init(e,t),e._zod.bag.format="ipv4"}),pw=/^[0-9a-fA-F:.]+$/;function Df(e){if(!pw.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var _f=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=fp),te.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(r)=>{if(!Df(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var bf=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=hp),te.init(e,t)});function fw(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return Df(r)}var yf=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=dp),te.init(e,t),e._zod.check=(r)=>{if(!fw(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function xf(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var vf=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=mp),te.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(xf(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function hw(e){if(!zs.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return xf(r)}var wf=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=zs),te.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(hw(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Cf=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Dp),te.init(e,t)});function dw(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var Ef=D("$ZodJWT",(e,t)=>{te.init(e,t),e._zod.check=(r)=>{if(dw(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Ms=D("$ZodNumber",(e,t)=>{fe.init(e,t),e._zod.pattern=e._zod.bag.pattern??Cp,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?String(o):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),$f=D("$ZodNumberFormat",(e,t)=>{Sp.init(e,t),Ms.init(e,t)});var kf=D("$ZodUnknown",(e,t)=>{fe.init(e,t),e._zod.parse=(r)=>r}),Sf=D("$ZodNever",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function jp(e,t,r){if(e.issues.length)t.issues.push(...$n(r,e.issues));t.value[r]=e.value}var Of=D("$ZodArray",(e,t)=>{fe.init(e,t);let r=Le.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=r?r.alloc(e,n,Array(s.length),o):Array(s.length);let i=[];for(let u=0;u<s.length;u++){let a=s[u],c=t.element._zod.run({value:a,issues:[]},o);if(c instanceof Promise)i.push(c.then((l)=>jp(l,n,u)));else jp(c,n,u)}if(i.length)return Promise.all(i).then(()=>n);return n}});function In(e,t,r,n,o,s){let i=r in n,u=s==="optional";if(!i&&u&&o==="optional")return;if(e.issues.length){if(o!==void 0&&u&&!i)return;t.issues.push(...$n(r,e.issues))}if(!i&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i)t.value[r]=void 0}else t.value[r]=e.value}var mw=[];function Af(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:mw,o=n.length?[...t,...n]:t;for(let i of o)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=Fl(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Ff(e,t,r,n,o,s){let i=[],u=o.keySet,a=o.catchall._zod,c=a.def.type,{optin:l,optout:p}=a;for(let f in t){if(u.has(f))continue;if(f==="__proto__"){if(c==="never")i.push(f);continue}if(c==="never"){i.push(f);continue}let h=a.run({value:t[f],issues:[]},n);if(h instanceof Promise)e.push(h.then((d)=>In(d,r,f,t,l,p)));else In(h,r,f,t,l,p)}if(i.length)r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var Hp=new WeakMap,gw=D("$ZodObject",(e,t)=>{if(fe.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Hp.set(t,a),Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),Hp.set(t,c),c}})}let n=Cn(()=>Af(t));J(e,"propValues",(a)=>{let c=a.def.shape,l={};for(let p in c){let f=c[p]._zod;if(f.values){if(!Object.prototype.hasOwnProperty.call(l,p))Ce(l,p,new Set);for(let h of f.values)l[p].add(h);if(f.optin!==void 0)l[p].add(void 0)}}return l});let o=Cr,s=t.catchall,i,u=Le.memoizer;u?.attach(e),e._zod.parse=(a,c)=>{i??(i=n.value);let l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value=u?u.alloc(e,a,{},c):{};let p=[],f=i.shape;for(let h of i.allKeys){if(h==="__proto__")continue;let d=f[h],m=d._zod.optin,y=d._zod.optout,A=d._zod.run({value:l[h],issues:[]},c);if(A instanceof Promise)p.push(A.then((v)=>In(v,a,h,l,m,y)));else In(A,a,h,l,m,y)}if(!s)return p.length?Promise.all(p).then(()=>a):a;return Ff(p,l,a,c,n.value,e)}}),Tf=D("$ZodObjectJIT",(e,t)=>{gw.init(e,t);let r=e._zod.parse,n=Cn(()=>Af(t)),o=Le.memoizer,s=(h)=>{let d=n.value,m=d.symbolKeys,y=new Ls(["payload","ctx"],{shape:h,inst:e,memo:o,syms:m}),A=(I)=>`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`,v=(I,F)=>`
47
- for (let i = 0; i < ${I}.issues.length; i++) {
48
- const iss = ${I}.issues[i];
49
- iss.path = iss.path ? [${F}, ...iss.path] : [${F}];
47
+ };`)(...Object.values(this.closed))}}var cf={major:4,minor:5,patch:4};var pe=_("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=cf;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let s of o)for(let i of s._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(u,a,c)=>{if(u.memo)return u;let l=At(u),p;for(let f of a){if(f._zod.def.when){if(rp(u))continue;if(!f._zod.def.when(u))continue}else if(l)continue;let h=u.issues.length,d=f._zod.check(u);if(d instanceof Promise&&c?.async===!1)throw new ut;if(p||d instanceof Promise)p=(p??Promise.resolve()).then(async()=>{if(await d,u.issues.length===h)return;if(Zs(u.issues,h,e),!l)l=At(u,h)});else{if(u.issues.length===h)continue;if(Zs(u.issues,h,e),!l)l=At(u,h)}}if(p)return p.then(()=>u);return u},i=(u,a,c)=>{if(At(u))return u.aborted=!0,u;let l=s(a,o,c);if(l instanceof Promise){if(c.async===!1)throw new ut;return l.then((p)=>e._zod.parse(p,c))}return e._zod.parse(l,c)};e._zod.run=(u,a)=>{if(a.skipChecks)return e._zod.parse(u,a);if(a.direction==="backward"){let l=e._zod.parse({value:u.value,issues:[]},{...a,skipChecks:!0});if(l instanceof Promise)return l.then((p)=>i(p,u,a));return i(l,u,a)}let c=e._zod.parse(u,a);if(c instanceof Promise){if(a.async===!1)throw new ut;return c.then((l)=>s(l,o,a))}return s(c,o,a)}}},{get "~standard"(){return js(this,"~standard",ri(this))},set "~standard"(e){Ot(this,"~standard",e)}}),lf=(e)=>e.success?{value:e.data}:{issues:e.error?.issues};function ri(e){return{validate:(t)=>{try{return lf(fp(e,t))}catch(r){return hp(e,t).then(lf)}},vendor:"zod",version:1}}var Xn=_("$ZodString",(e,t)=>{pe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Up(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),te=_("$ZodStringFormat",(e,t)=>{Pr.init(e,t),Xn.init(e,t)}),xf=_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ap),te.init(e,t)}),vf=_("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Js(n))}else t.pattern??(t.pattern=Js());te.init(e,t)}),wf=_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fp),te.init(e,t)}),Cf=1,Ef=2;function rC(e,t){if(!t.normalize&&t.protocol?.source===Lp.source&&!/^https?:\/\//i.test(e))return Cf;try{return new URL(e)}catch{return Ef}}var nC=/[\t\n\r]/g;function oC(e){return e.replace(nC,"")}function sC(e,t){return t.lastIndex=0,t.test(e.hostname)}function iC(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var kf=_("$ZodURL",(e,t)=>{te.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=rC(n,t);if(o===Cf){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Ef){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(t.hostname&&!sC(o,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!iC(o,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?o.href:oC(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Sf=_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Tp()),te.init(e,t)}),$f=_("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Sp:$p(t.length)),te.init(e,t)}),Of=_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vp),te.init(e,t)}),Af=_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=wp),te.init(e,t)}),Ff=_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Cp),te.init(e,t)}),Tf=_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ep),te.init(e,t)}),Pf=_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=kp),te.init(e,t)}),Rf=_("$ZodISODateTime",(e,t)=>{if(t.pattern??(t.pattern=Hp(t)),te.init(e,t),t.local||t.precision===-1)e._zod.bag.laxFormat=!0,e._zod.onattach.push((r)=>{r._zod.bag.laxFormat=!0})}),zf=_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Zp),te.init(e,t)}),If=_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=jp(t)),te.init(e,t)}),Nf=_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Op),te.init(e,t)}),Lf=_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Pp),te.init(e,t),e._zod.bag.format="ipv4"}),uC=/^[0-9a-fA-F:.]+$/;function Bf(e){if(!uC.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Mf=_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Rp),te.init(e,t),e._zod.bag.format="ipv6",e._zod.check=(r)=>{if(!Bf(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var Zf=_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=zp),te.init(e,t)});function aC(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return Bf(r)}var jf=_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ip),te.init(e,t),e._zod.check=(r)=>{if(!aC(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function Hf(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Uf=_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Np),te.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(Hf(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function cC(e){if(!Ks.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Hf(r)}var Gf=_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ks),te.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(cC(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Wf=_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Bp),te.init(e,t)});function lC(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var qf=_("$ZodJWT",(e,t)=>{te.init(e,t),e._zod.check=(r)=>{if(lC(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var ni=_("$ZodNumber",(e,t)=>{pe.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wp,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?String(o):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Vf=_("$ZodNumberFormat",(e,t)=>{Kp.init(e,t),ni.init(e,t)});var Jf=_("$ZodUnknown",(e,t)=>{pe.init(e,t),e._zod.parse=(r)=>r}),Kf=_("$ZodNever",(e,t)=>{pe.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function pf(e,t,r){if(e.issues.length)t.issues.push(...Zn(r,e.issues));t.value[r]=e.value}var Yf=_("$ZodArray",(e,t)=>{pe.init(e,t);let r=Be.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=r?r.alloc(e,n,Array(s.length),o):Array(s.length);let i=[];for(let u=0;u<s.length;u++){let a=s[u],c=t.element._zod.run({value:a,issues:[]},o);if(c instanceof Promise)i.push(c.then((l)=>pf(l,n,u)));else pf(c,n,u)}if(i.length)return Promise.all(i).then(()=>n);return n}});function Yn(e,t,r,n,o,s){let i=r in n,u=s==="optional";if(!i&&u&&o==="optional")return;if(e.issues.length){if(o!==void 0&&u&&!i)return;t.issues.push(...Zn(r,e.issues))}if(!i&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i)t.value[r]=void 0}else t.value[r]=e.value}var pC=[];function Xf(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:pC,o=n.length?[...t,...n]:t;for(let i of o)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=Ql(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Qf(e,t,r,n,o,s){let i=[],u=o.keySet,a=o.catchall._zod,c=a.def.type,{optin:l,optout:p}=a;for(let f in t){if(u.has(f))continue;if(f==="__proto__"){if(c==="never")i.push(f);continue}if(c==="never"){i.push(f);continue}let h=a.run({value:t[f],issues:[]},n);if(h instanceof Promise)e.push(h.then((d)=>Yn(d,r,f,t,l,p)));else Yn(h,r,f,t,l,p)}if(i.length)r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var ff=new WeakMap,fC=_("$ZodObject",(e,t)=>{if(pe.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;ff.set(t,a),Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),ff.set(t,c),c}})}let n=Bn(()=>Xf(t));J(e,"propValues",(a)=>{let c=a.def.shape,l={};for(let p in c){let f=c[p]._zod;if(f.values){if(!Object.prototype.hasOwnProperty.call(l,p))Ce(l,p,new Set);for(let h of f.values)l[p].add(h);if(f.optin!==void 0)l[p].add(void 0)}}return l});let o=$r,s=t.catchall,i,u=Be.memoizer;u?.attach(e),e._zod.parse=(a,c)=>{i??(i=n.value);let l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value=u?u.alloc(e,a,{},c):{};let p=[],f=i.shape;for(let h of i.allKeys){if(h==="__proto__")continue;let d=f[h],m=d._zod.optin,b=d._zod.optout,A=d._zod.run({value:l[h],issues:[]},c);if(A instanceof Promise)p.push(A.then((v)=>Yn(v,a,h,l,m,b)));else Yn(A,a,h,l,m,b)}if(!s)return p.length?Promise.all(p).then(()=>a):a;return Qf(p,l,a,c,n.value,e)}}),eh=_("$ZodObjectJIT",(e,t)=>{fC.init(e,t);let r=e._zod.parse,n=Bn(()=>Xf(t)),o=Be.memoizer,s=(h)=>{let d=n.value,m=d.symbolKeys,b=new ei(["payload","ctx"],{shape:h,inst:e,memo:o,syms:m}),A=(N)=>`shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`,v=(N,T)=>`
48
+ for (let i = 0; i < ${N}.issues.length; i++) {
49
+ const iss = ${N}.issues[i];
50
+ iss.path = iss.path ? [${T}, ...iss.path] : [${T}];
50
51
  payload.issues.push(iss);
51
- }`;y.write("const input = payload.value;");let M=Object.create(null),G=0;for(let I of d.allKeys)M[I]=`key_${G++}`;y.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let I of d.allKeys){if(I==="__proto__")continue;let F=M[I],N=typeof I==="symbol"?`syms[${m.indexOf(I)}]`:kl(I),P=`${N} in input`,Z=h[I],g=Z?._zod?.optin,he=g!==void 0,re=Z?._zod?.optout==="optional";if(y.write(`const ${F} = ${A(N)};`),he&&re){let ee=g==="optional"?`${F}_present`:`${F}.value !== undefined || ${F}_present`;y.write(`
52
- const ${F}_present = ${P};
53
- if (!${F}.issues.length || ${F}_present) {
54
- if (${F}.issues.length) {${v(F,N)}
52
+ }`;b.write("const input = payload.value;");let j=Object.create(null),G=0;for(let N of d.allKeys)j[N]=`key_${G++}`;b.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let N of d.allKeys){if(N==="__proto__")continue;let T=j[N],L=typeof N==="symbol"?`syms[${m.indexOf(N)}]`:Jl(N),P=`${L} in input`,M=h[N],g=M?._zod?.optin,he=g!==void 0,re=M?._zod?.optout==="optional";if(b.write(`const ${T} = ${A(L)};`),he&&re){let ee=g==="optional"?`${T}_present`:`${T}.value !== undefined || ${T}_present`;b.write(`
53
+ const ${T}_present = ${P};
54
+ if (!${T}.issues.length || ${T}_present) {
55
+ if (${T}.issues.length) {${v(T,L)}
55
56
  }
56
57
 
57
58
  if (${ee}) {
58
- newResult[${N}] = ${F}.value;
59
+ newResult[${L}] = ${T}.value;
59
60
  }
60
61
  }
61
62
 
62
- `)}else if(!he)y.write(`
63
- const ${F}_present = ${P};
64
- if (${F}.issues.length) {${v(F,N)}
63
+ `)}else if(!he)b.write(`
64
+ const ${T}_present = ${P};
65
+ if (${T}.issues.length) {${v(T,L)}
65
66
  }
66
- if (!${F}_present && !${F}.issues.length) {
67
+ if (!${T}_present && !${T}.issues.length) {
67
68
  payload.issues.push({
68
69
  code: "invalid_type",
69
70
  expected: "nonoptional",
70
71
  input: undefined,
71
- path: [${N}]
72
+ path: [${L}]
72
73
  });
73
74
  }
74
75
 
75
- if (${F}_present) {
76
- newResult[${N}] = ${F}.value;
76
+ if (${T}_present) {
77
+ newResult[${L}] = ${T}.value;
77
78
  }
78
79
 
79
- `);else y.write(`
80
- if (${F}.issues.length) {${v(F,N)}
80
+ `);else b.write(`
81
+ if (${T}.issues.length) {${v(T,L)}
81
82
  }
82
83
 
83
- if (${F}.value === undefined) {
84
+ if (${T}.value === undefined) {
84
85
  if (${P}) {
85
- newResult[${N}] = undefined;
86
+ newResult[${L}] = undefined;
86
87
  }
87
88
  } else {
88
- newResult[${N}] = ${F}.value;
89
+ newResult[${L}] = ${T}.value;
89
90
  }
90
91
 
91
- `)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},i,u=Cr,a=!Le.jitless,l=a&&Ol.value,p=t.catchall,f;e._zod.parse=(h,d)=>{f??(f=n.value);let m=h.value;if(!u(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h;if(a&&l&&d?.async===!1&&d.jitless!==!0){if(!i)i=s(t.shape);if(h=i(h,d),!p)return h;return Ff([],m,h,d,f,e)}return r(h,d)}});function Up(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter((s)=>!$t(s));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>ht(i,n,Ve())))}),t}var Pf=D("$ZodUnion",(e,t)=>{fe.init(e,t),J(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),J(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),J(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),J(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((s)=>s._zod.pattern);return new RegExp(`^(${o.map((s)=>En(s.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let u of t.options){let a=u._zod.run({value:n.value,issues:[]},o);if(a instanceof Promise)i.push(a),s=!0;else{if(a.issues.length===0)return a;i.push(a)}}if(!s)return Up(i,n,e,o);return Promise.all(i).then((u)=>Up(u,n,e,o))}});var zf=D("$ZodIntersection",(e,t)=>{fe.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([a,c])=>Gp(r,a,c));return Gp(r,s,i)}});function Zs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Jt(e)&&Jt(t)){let r=Object.keys(t),n=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let s of n){if(s==="__proto__")continue;let i=Zs(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n],i=Zs(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Gp(e,t,r){let n=new Map,o,s=new Map,i=(c,l)=>{let p;if(c.code==="unrecognized_keys"&&!c.path?.length)o??(o=c),p=c.keys;else if(c.code==="invalid_key"&&c.origin==="record"&&c.path?.length===1){let f=String(c.path[0]);if(!s.has(f))s.set(f,c);p=[f]}else return!1;for(let f of p){if(!n.has(f))n.set(f,{});n.get(f)[l]=!0}return!0};for(let c of t.issues)if(!i(c,"l"))e.issues.push(c);for(let c of r.issues)if(!i(c,"r"))e.issues.push(c);let u=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(u.length){let c=o?u.filter((l)=>o.keys.includes(l)):[];if(c.length)e.issues.push({...o,keys:c});for(let l of u)if(!c.includes(l)&&s.has(l))e.issues.push(s.get(l))}let a=Zs(t.value,r.value);if(!a.valid){if($t(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var Rf=D("$ZodEnum",(e,t)=>{fe.init(e,t);let r=wn(t.entries),n=new Set(r);e._zod.values=n;let o=r.filter((s)=>Al.has(typeof s));e._zod.pattern=new RegExp(o.length?`^(${o.map((s)=>Kt(s.toString())).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(s,i)=>{let u=s.value;if(n.has(u))return s;return s.issues.push({code:"invalid_value",values:r,input:u,inst:e}),s}});var If=D("$ZodTransform",(e,t)=>{fe.init(e,t),e._zod.optin="optional",Le.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $r(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((i)=>(r.value=i,r));if(o instanceof Promise)throw new st;return r.value=o,r}});function Wp(e,t){return e.value=t.issues.length?void 0:t.value,e}var js=D("$ZodOptional",(e,t)=>{fe.init(e,t),J(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",J(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),J(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${En(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((s)=>Wp(r,s));return Wp(r,o)}return t.innerType._zod.run(r,n)}}),Nf=D("$ZodExactOptional",(e,t)=>{js.init(e,t),J(e,"values",(r)=>r.def.innerType._zod.values),J(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Lf=D("$ZodNullable",(e,t)=>{fe.init(e,t),J(e,"optin",(r)=>r.def.innerType._zod.optin),J(e,"optout",(r)=>r.def.innerType._zod.optout),J(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${En(n.source)}|null)$`):void 0}),J(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),Zf=D("$ZodDefault",(e,t)=>{fe.init(e,t),e._zod.optin="defaulted",J(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>Vp(s,t));return Vp(o,t)}});function Vp(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Bf=D("$ZodPrefault",(e,t)=>{fe.init(e,t),e._zod.optin="defaulted",J(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),Mf=D("$ZodNonOptional",(e,t)=>{fe.init(e,t),J(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>qp(s,e));return qp(o,e)}});function qp(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Jp(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>ht(o,n,Ve()))},input:e.value}),e}var jf=D("$ZodCatch",(e,t)=>{fe.init(e,t),J(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),J(e,"optout",(r)=>r.def.innerType._zod.optout),J(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((s)=>Jp(r,s,t,n));return Jp(r,o,t,n)}});var Hf=D("$ZodPipe",(e,t)=>{fe.init(e,t),J(e,"values",(r)=>r.def.in._zod.values),J(e,"optin",(r)=>r.def.in._zod.optin),J(e,"optout",(r)=>r.def.out._zod.optout),J(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);if(s instanceof Promise)return s.then((i)=>Rn(i,t.in,n));return Rn(s,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>Rn(s,t.out,n));return Rn(o,t.out,n)}});function Rn(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Uf=D("$ZodReadonly",(e,t)=>{fe.init(e,t),J(e,"propValues",(r)=>r.def.innerType._zod.propValues),J(e,"values",(r)=>r.def.innerType._zod.values),J(e,"optin",(r)=>r.def.innerType?._zod?.optin),J(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(Kp);return Kp(o)}});function Kp(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Gf=D("$ZodCustom",(e,t)=>{xe.init(e,t),fe.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((s)=>Yp(s,r,n,e));Yp(o,r,n,e);return}});function Yp(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(kt(o))}}class qf extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Us="~memo",Wf=[];function Hs(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Vf=new WeakMap;function Jf(e,t){let r=Vf.get(e);if(r!==void 0)return r;if(t.has(e))return!0;t.add(e);let n=!1,o=(u)=>{if(!n&&u?._zod&&Jf(u,t))n=!0},s=e._zod.def,i=s.type;switch(i){case"object":{for(let u of Reflect.ownKeys(s.shape))o(s.shape[u]);o(s.catchall);break}case"array":o(s.element);break;case"tuple":for(let u of s.items)o(u);o(s.rest);break;case"record":case"map":o(s.keyType),o(s.valueType);break;case"set":o(s.valueType);break;case"union":for(let u of s.options)o(u);break;case"intersection":o(s.left),o(s.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(s.innerType);break;case"pipe":o(s.in),o(s.out);break;case"function":o(s.input),o(s.output);break;case"lazy":o(e._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in s){let a=Object.getOwnPropertyDescriptor(s,u);if(!a||a.get)continue;let c=a.value;if(!c||typeof c!=="object")continue;if(c._zod)o(c);else if(Array.isArray(c))for(let l of c)o(l)}}return t.delete(e),Vf.set(e,n),n}function Dw(e,t){let r=e.buckets.get(t);if(!r)r=new Map,e.buckets.set(t,r);return r}var Ln,Zn=[],_w={alloc(e,t,r){let n=Ln;if(!n)return r;Ln=void 0;let o={value:r,issues:null};return n.set(t.value,o),Zn.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,s)=>{if(s.direction!=="backward"&&bw(s,o.value))throw new qf;return r(o,s)};if(e._zod.parse=n,e._zod.run===r)e._zod.run=n})},attach(e){var t;let r,n,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,i=(u,a)=>{if(r===void 0){if(r=Jf(e,new Set),!r){if(e._zod.parse=s,e._zod.run===i)e._zod.run=s;return s(u,a)}}let c=u.value;if(c===null||typeof c!=="object")return s(u,a);let l=a[Us];if(!l)l={buckets:new Map,backEdges:void 0},a[Us]=l;let p;if(n===a)p=o;else p=Dw(l,e),n=a,o=p;let f=p.get(c);if(f){if(u.value=f.value,f.issues){if(f.issues.length)u.issues.push(...Hs(f.issues))}else u.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(f.value);return u}Ln=p;let h=Zn.length,d=s(u,a);Ln=void 0;let m=Zn.length>h?Zn.pop():void 0;if(d instanceof Promise)return d.then((y)=>{if(m)m.issues=y.issues.length?Hs(y.issues):Wf;return y});if(m)m.issues=d.issues.length?Hs(d.issues):Wf;return d};if(e._zod.parse=i,e._zod.run===s)e._zod.run=i})}};function Kf(){return _w}function bw(e,t){let r=e[Us]?.backEdges;return r!==void 0&&t!==null&&typeof t==="object"&&r.has(t)}var yw=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(s,i){if(s==="number"&&typeof i==="number"&&!Number.isFinite(i))return String(i);return n[s]??s}return(s)=>{switch(s.code){case"invalid_type":{let i=o(s.expected),u=Rl(s.input),a=o(u,s.input);return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Cs(s.values[0])}`;return`Invalid option: expected one of ${xs(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",u=t(s.origin);if(u)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${u.unit??"elements"}`;return`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",u=t(s.origin);if(u)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${u.unit}`;return`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${xs(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":if(s.options&&Array.isArray(s.options)&&s.options.length>0)return`Invalid discriminator value. Expected ${s.options.map((u)=>`'${u}'`).join(" | ")}`;if(s.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function Gs(){return{localeError:yw()}}var Yf;class Xf{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function xw(){return new Xf}(Yf=globalThis).__zod_globalRegistry??(Yf.__zod_globalRegistry=xw());var St=globalThis.__zod_globalRegistry;function Qf(e,t){return new e({type:"string",...T(t)})}function eh(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}function th(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}function rh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}function nh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}function oh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}function sh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}function ih(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}function uh(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}function ah(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}function ch(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}function lh(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}function ph(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}function fh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}function hh(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}function dh(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}function mh(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}function gh(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}function Dh(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}function _h(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}function bh(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}function yh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}function xh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}function vh(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}function wh(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}function Ch(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}function Eh(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}function $h(e,t){return new e({type:"number",checks:[],...T(t)})}function kh(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}function Sh(e){return new e({type:"unknown"})}function Oh(e,t){return new e({type:"never",...T(t)})}function Bn(e,t){return new Is({check:"less_than",...T(t),value:e,inclusive:!1})}function Ar(e,t){return new Is({check:"less_than",...T(t),value:e,inclusive:!0})}function Mn(e,t){return new Ns({check:"greater_than",...T(t),value:e,inclusive:!1})}function Fr(e,t){return new Ns({check:"greater_than",...T(t),value:e,inclusive:!0})}function jn(e,t){return new kp({check:"multiple_of",...T(t),value:e})}function Hn(e,t){return new Op({check:"max_length",...T(t),maximum:e})}function Yt(e,t){return new Ap({check:"min_length",...T(t),minimum:e})}function Un(e,t){return new Fp({check:"length_equals",...T(t),length:e})}function Ws(e,t){return new Tp({check:"string_format",format:"regex",...T(t),pattern:e})}function Vs(e){return new Pp({check:"string_format",format:"lowercase",...T(e)})}function qs(e){return new zp({check:"string_format",format:"uppercase",...T(e)})}function Js(e,t){return new Rp({check:"string_format",format:"includes",...T(t),includes:e})}function Ks(e,t){return new Ip({check:"string_format",format:"starts_with",...T(t),prefix:e})}function Ys(e,t){return new Np({check:"string_format",format:"ends_with",...T(t),suffix:e})}function dt(e){return new Lp({check:"overwrite",tx:e})}function Xs(e){return dt((t)=>t.normalize(e))}function Qs(){return dt((e)=>e.trim())}function ei(){return dt((e)=>e.toLowerCase())}function ti(){return dt((e)=>e.toUpperCase())}function ri(){return dt((e)=>Sl(e))}function Ah(e,t,r){return new e({type:"array",element:t,...T(r)})}function Fh(e,t,r){return new e({type:"custom",check:"custom",fn:t,...T(r)})}function Th(e,t){let r=vw((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(kt(o,n.value,r._zod.def));else{let s=o;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=n.value;s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(kt(s))}},e(n.value,n)),t);return r}function vw(e,t){let r=new xe({check:"custom",...T(t)});return r._zod.check=e,r}function Tr(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))Ce(e,n,r[n]);return e}function oi(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??St,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Ot(e,t,r,n,o){let s=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw Error(o);return Object.assign(r,s),!0}function be(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let u=e._zod.toJSONSchema?.();if(u)i.schema=u;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let f=i.schema,h=t.processors[o.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,l)}let p=e._zod.parent;if(p){if(!i.ref)i.ref=p;be(p,t,l),t.seen.get(p).isParent=!0}}let a=t.metadataRegistry.get(e);if(a)Tr(i.schema,a);if(t.io==="input"&&Oe(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(n=i.schema).default??(n.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function Ph(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function si(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let i of e.seen.entries()){let u=e.metadataRegistry.get(i[0])?.id;if(u){let a=n.get(u);if(a&&a!==i[0])throw Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(u,i[0])}}let o=(i)=>{let u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(i[0])?.id,f=e.external.uri??((d)=>d);if(p)return{ref:f(p)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${u}/${Ph(h)}`}}let a="#",c=`${a}/${u}/`;if(i[1]===r&&!i[1].schema.id)return{ref:a};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+Ph(l)}},s=(i)=>{if(i[1].schema.$ref)return;let u=i[1],{ref:a,defId:c}=o(i);if(u.def={...u.schema},c)u.defId=c;let l=u.schema;for(let p in l)delete l[p];l.$ref=a};if(e.cycles==="throw")for(let i of e.seen.entries()){let u=i[1];if(u.cycle)throw Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
92
+ `)}return b.write("payload.value = newResult;"),b.write("return payload;"),b.compile()},i,u=$r,a=!Be.jitless,l=a&&Yl.value,p=t.catchall,f;e._zod.parse=(h,d)=>{f??(f=n.value);let m=h.value;if(!u(m))return h.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),h;if(a&&l&&d?.async===!1&&d.jitless!==!0){if(!i)i=s(t.shape);if(h=i(h,d),!p)return h;return Qf([],m,h,d,f,e)}return r(h,d)}});function hf(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter((s)=>!At(s));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>mt(i,n,Ve())))}),t}var th=_("$ZodUnion",(e,t)=>{pe.init(e,t),J(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),J(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),J(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),J(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((s)=>s._zod.pattern);return new RegExp(`^(${o.map((s)=>Mn(s.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let u of t.options){let a=u._zod.run({value:n.value,issues:[]},o);if(a instanceof Promise)i.push(a),s=!0;else{if(a.issues.length===0)return a;i.push(a)}}if(!s)return hf(i,n,e,o);return Promise.all(i).then((u)=>hf(u,n,e,o))}});var rh=_("$ZodIntersection",(e,t)=>{pe.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([a,c])=>df(r,a,c));return df(r,s,i)}});function ti(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(er(e)&&er(t)){let r=Object.keys(t),n=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let s of n){if(s==="__proto__")continue;let i=ti(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n],i=ti(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function df(e,t,r){let n=new Map,o,s=new Map,i=(c,l)=>{let p;if(c.code==="unrecognized_keys"&&!c.path?.length)o??(o=c),p=c.keys;else if(c.code==="invalid_key"&&c.origin==="record"&&c.path?.length===1){let f=String(c.path[0]);if(!s.has(f))s.set(f,c);p=[f]}else return!1;for(let f of p){if(!n.has(f))n.set(f,{});n.get(f)[l]=!0}return!0};for(let c of t.issues)if(!i(c,"l"))e.issues.push(c);for(let c of r.issues)if(!i(c,"r"))e.issues.push(c);let u=[...n].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(u.length){let c=o?u.filter((l)=>o.keys.includes(l)):[];if(c.length)e.issues.push({...o,keys:c});for(let l of u)if(!c.includes(l)&&s.has(l))e.issues.push(s.get(l))}let a=ti(t.value,r.value);if(!a.valid){if(At(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}var nh=_("$ZodEnum",(e,t)=>{pe.init(e,t);let r=Ln(t.entries),n=new Set(r);e._zod.values=n;let o=r.filter((s)=>Xl.has(typeof s));e._zod.pattern=new RegExp(o.length?`^(${o.map((s)=>tr(s.toString())).join("|")})$`:"^[^\\s\\S]$"),e._zod.parse=(s,i)=>{let u=s.value;if(n.has(u))return s;return s.issues.push({code:"invalid_value",values:r,input:u,inst:e}),s}});var oh=_("$ZodTransform",(e,t)=>{pe.init(e,t),e._zod.optin="optional",Be.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ar(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((i)=>(r.value=i,r));if(o instanceof Promise)throw new ut;return r.value=o,r}});function mf(e,t){return e.value=t.issues.length?void 0:t.value,e}var oi=_("$ZodOptional",(e,t)=>{pe.init(e,t),J(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",J(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),J(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Mn(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((s)=>mf(r,s));return mf(r,o)}return t.innerType._zod.run(r,n)}}),sh=_("$ZodExactOptional",(e,t)=>{oi.init(e,t),J(e,"values",(r)=>r.def.innerType._zod.values),J(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),ih=_("$ZodNullable",(e,t)=>{pe.init(e,t),J(e,"optin",(r)=>r.def.innerType._zod.optin),J(e,"optout",(r)=>r.def.innerType._zod.optout),J(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Mn(n.source)}|null)$`):void 0}),J(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),uh=_("$ZodDefault",(e,t)=>{pe.init(e,t),e._zod.optin="defaulted",J(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>gf(s,t));return gf(o,t)}});function gf(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var ah=_("$ZodPrefault",(e,t)=>{pe.init(e,t),e._zod.optin="defaulted",J(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),ch=_("$ZodNonOptional",(e,t)=>{pe.init(e,t),J(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>_f(s,e));return _f(o,e)}});function _f(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function yf(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>mt(o,n,Ve()))},input:e.value}),e}var lh=_("$ZodCatch",(e,t)=>{pe.init(e,t),J(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),J(e,"optout",(r)=>r.def.innerType._zod.optout),J(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((s)=>yf(r,s,t,n));return yf(r,o,t,n)}});var ph=_("$ZodPipe",(e,t)=>{pe.init(e,t),J(e,"values",(r)=>r.def.in._zod.values),J(e,"optin",(r)=>r.def.in._zod.optin),J(e,"optout",(r)=>r.def.out._zod.optout),J(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);if(s instanceof Promise)return s.then((i)=>Kn(i,t.in,n));return Kn(s,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((s)=>Kn(s,t.out,n));return Kn(o,t.out,n)}});function Kn(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var fh=_("$ZodReadonly",(e,t)=>{pe.init(e,t),J(e,"propValues",(r)=>r.def.innerType._zod.propValues),J(e,"values",(r)=>r.def.innerType._zod.values),J(e,"optin",(r)=>r.def.innerType?._zod?.optin),J(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(Df);return Df(o)}});function Df(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var hh=_("$ZodCustom",(e,t)=>{xe.init(e,t),pe.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((s)=>bf(s,r,n,e));bf(o,r,n,e);return}});function bf(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(Ft(o))}}class gh extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var ii="~memo",dh=[];function si(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var mh=new WeakMap;function _h(e,t){let r=mh.get(e);if(r!==void 0)return r;if(t.has(e))return!0;t.add(e);let n=!1,o=(u)=>{if(!n&&u?._zod&&_h(u,t))n=!0},s=e._zod.def,i=s.type;switch(i){case"object":{for(let u of Reflect.ownKeys(s.shape))o(s.shape[u]);o(s.catchall);break}case"array":o(s.element);break;case"tuple":for(let u of s.items)o(u);o(s.rest);break;case"record":case"map":o(s.keyType),o(s.valueType);break;case"set":o(s.valueType);break;case"union":for(let u of s.options)o(u);break;case"intersection":o(s.left),o(s.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":o(s.innerType);break;case"pipe":o(s.in),o(s.out);break;case"function":o(s.input),o(s.output);break;case"lazy":o(e._zod.innerType);break;case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let u in s){let a=Object.getOwnPropertyDescriptor(s,u);if(!a||a.get)continue;let c=a.value;if(!c||typeof c!=="object")continue;if(c._zod)o(c);else if(Array.isArray(c))for(let l of c)o(l)}}return t.delete(e),mh.set(e,n),n}function hC(e,t){let r=e.buckets.get(t);if(!r)r=new Map,e.buckets.set(t,r);return r}var Qn,eo=[],dC={alloc(e,t,r){let n=Qn;if(!n)return r;Qn=void 0;let o={value:r,issues:null};return n.set(t.value,o),eo.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,s)=>{if(s.direction!=="backward"&&mC(s,o.value))throw new gh;return r(o,s)};if(e._zod.parse=n,e._zod.run===r)e._zod.run=n})},attach(e){var t;let r,n,o;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,i=(u,a)=>{if(r===void 0){if(r=_h(e,new Set),!r){if(e._zod.parse=s,e._zod.run===i)e._zod.run=s;return s(u,a)}}let c=u.value;if(c===null||typeof c!=="object")return s(u,a);let l=a[ii];if(!l)l={buckets:new Map,backEdges:void 0},a[ii]=l;let p;if(n===a)p=o;else p=hC(l,e),n=a,o=p;let f=p.get(c);if(f){if(u.value=f.value,f.issues){if(f.issues.length)u.issues.push(...si(f.issues))}else u.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(f.value);return u}Qn=p;let h=eo.length,d=s(u,a);Qn=void 0;let m=eo.length>h?eo.pop():void 0;if(d instanceof Promise)return d.then((b)=>{if(m)m.issues=b.issues.length?si(b.issues):dh;return b});if(m)m.issues=d.issues.length?si(d.issues):dh;return d};if(e._zod.parse=i,e._zod.run===s)e._zod.run=i})}};function yh(){return dC}function mC(e,t){let r=e[ii]?.backEdges;return r!==void 0&&t!==null&&typeof t==="object"&&r.has(t)}var gC=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"credit card number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(s,i){if(s==="number"&&typeof i==="number"&&!Number.isFinite(i))return String(i);return n[s]??s}return(s)=>{switch(s.code){case"invalid_type":{let i=o(s.expected),u=np(s.input),a=o(u,s.input);return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Ms(s.values[0])}`;return`Invalid option: expected one of ${Ns(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",u=t(s.origin);if(u)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${u.unit??"elements"}`;return`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",u=t(s.origin);if(u)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${u.unit}`;return`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Ns(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":if(s.options&&Array.isArray(s.options)&&s.options.length>0)return`Invalid discriminator value. Expected ${s.options.map((u)=>`'${u}'`).join(" | ")}`;if(s.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function ui(){return{localeError:gC()}}var Dh;class bh{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function _C(){return new bh}(Dh=globalThis).__zod_globalRegistry??(Dh.__zod_globalRegistry=_C());var Tt=globalThis.__zod_globalRegistry;function xh(e,t){return new e({type:"string",...R(t)})}function vh(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...R(t)})}function wh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...R(t)})}function Ch(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...R(t)})}function Eh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(t)})}function kh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(t)})}function Sh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(t)})}function $h(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...R(t)})}function Oh(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...R(t)})}function Ah(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(t)})}function Fh(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...R(t)})}function Th(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(t)})}function Ph(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...R(t)})}function Rh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...R(t)})}function zh(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(t)})}function Ih(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(t)})}function Nh(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(t)})}function Lh(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(t)})}function Bh(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(t)})}function Mh(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...R(t)})}function Zh(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...R(t)})}function jh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...R(t)})}function Hh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...R(t)})}function Uh(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(t)})}function Gh(e,t){return new e({type:"string",format:"date",check:"string_format",...R(t)})}function Wh(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...R(t)})}function qh(e,t){return new e({type:"string",format:"duration",check:"string_format",...R(t)})}function Vh(e,t){return new e({type:"number",checks:[],...R(t)})}function Jh(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...R(t)})}function Kh(e){return new e({type:"unknown"})}function Yh(e,t){return new e({type:"never",...R(t)})}function to(e,t){return new Xs({check:"less_than",...R(t),value:e,inclusive:!1})}function Rr(e,t){return new Xs({check:"less_than",...R(t),value:e,inclusive:!0})}function ro(e,t){return new Qs({check:"greater_than",...R(t),value:e,inclusive:!1})}function zr(e,t){return new Qs({check:"greater_than",...R(t),value:e,inclusive:!0})}function no(e,t){return new Jp({check:"multiple_of",...R(t),value:e})}function oo(e,t){return new Yp({check:"max_length",...R(t),maximum:e})}function rr(e,t){return new Xp({check:"min_length",...R(t),minimum:e})}function so(e,t){return new Qp({check:"length_equals",...R(t),length:e})}function ai(e,t){return new ef({check:"string_format",format:"regex",...R(t),pattern:e})}function ci(e){return new tf({check:"string_format",format:"lowercase",...R(e)})}function li(e){return new rf({check:"string_format",format:"uppercase",...R(e)})}function pi(e,t){return new nf({check:"string_format",format:"includes",...R(t),includes:e})}function fi(e,t){return new of({check:"string_format",format:"starts_with",...R(t),prefix:e})}function hi(e,t){return new sf({check:"string_format",format:"ends_with",...R(t),suffix:e})}function gt(e){return new uf({check:"overwrite",tx:e})}function di(e){return gt((t)=>t.normalize(e))}function mi(){return gt((e)=>e.trim())}function gi(){return gt((e)=>e.toLowerCase())}function _i(){return gt((e)=>e.toUpperCase())}function yi(){return gt((e)=>Kl(e))}function Xh(e,t,r){return new e({type:"array",element:t,...R(r)})}function Qh(e,t,r){return new e({type:"custom",check:"custom",fn:t,...R(r)})}function ed(e,t){let r=yC((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(Ft(o,n.value,r._zod.def));else{let s=o;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=n.value;s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(Ft(s))}},e(n.value,n)),t);return r}function yC(e,t){let r=new xe({check:"custom",...R(t)});return r._zod.check=e,r}function Ir(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))Ce(e,n,r[n]);return e}function bi(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Tt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Pt(e,t,r,n,o){let s=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw Error(o);return Object.assign(r,s),!0}function De(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let u=e._zod.toJSONSchema?.();if(u)i.schema=u;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let f=i.schema,h=t.processors[o.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,l)}let p=e._zod.parent;if(p){if(!i.ref)i.ref=p;De(p,t,l),t.seen.get(p).isParent=!0}}let a=t.metadataRegistry.get(e);if(a)Ir(i.schema,a);if(t.io==="input"&&Oe(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(n=i.schema).default??(n.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function td(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function xi(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let i of e.seen.entries()){let u=e.metadataRegistry.get(i[0])?.id;if(u){let a=n.get(u);if(a&&a!==i[0])throw Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(u,i[0])}}let o=(i)=>{let u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(i[0])?.id,f=e.external.uri??((d)=>d);if(p)return{ref:f(p)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${u}/${td(h)}`}}let a="#",c=`${a}/${u}/`;if(i[1]===r&&!i[1].schema.id)return{ref:a};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+td(l)}},s=(i)=>{if(i[1].schema.$ref)return;let u=i[1],{ref:a,defId:c}=o(i);if(u.def={...u.schema},c)u.defId=c;let l=u.schema;for(let p in l)delete l[p];l.$ref=a};if(e.cycles==="throw")for(let i of e.seen.entries()){let u=i[1];if(u.cycle)throw Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
92
93
 
93
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let u=i[1];if(t===i[0]){s(i);continue}if(e.external){let c=e.external.registry.get(i[0])?.id;if(t!==i[0]&&c){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(u.cycle){s(i);continue}if(u.count>1){if(e.reused==="ref"){s(i);continue}}}if(e.external)e.sharedDefsExtractedFor=e.external}function Ih(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!=="object")return;Ih(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let s=n.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!=="string")return;if(!r.includes(i))r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Nh=new Set(["type","properties","required","additionalProperties"]),zh=["oneOf","anyOf"];function Rh(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function ni(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!Nh.has(i))return null;t.push(s)}let r={},n=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let u=[];for(let c of t){let l=c.properties?.[i]??Rh(c);if(l===null||l===void 0)continue;if(!u.some((p)=>JSON.stringify(p)===JSON.stringify(l)))u.push(l)}let a=u.length===1?u[0]:ni(u)??{allOf:u};Ce(r,i,a)}for(let i of s.required??[])n.add(i)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((s)=>s.additionalProperties===!1))o.additionalProperties=!1;else{let s=[];for(let i of t){let u=Rh(i);if(u&&!s.some((a)=>JSON.stringify(a)===JSON.stringify(u)))s.push(u)}if(s.length===1)o.additionalProperties=s[0];else if(s.length>1)o.additionalProperties={allOf:s}}return o}function ww(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Nh)if(o in e)return;let r=t.filter((o)=>zh.some((s)=>Array.isArray(o[s]))),n=null;if(!r.length)n=ni(t);else{let o=r[0],s=zh.find((a)=>Array.isArray(o[a]));if(Object.keys(o).length!==1)return;let i=t.filter((a)=>a!==o),u=o[s].map((a)=>ni([...i,a]));if(u.some((a)=>!a))return;n={[s]:u}}if(!n)return;delete e.allOf,Tr(e,n)}function ii(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(u)=>{let a=e.seen.get(u);if(a.ref===null)return;let c=a.def??a.schema,l={...c},p=a.ref;if(a.ref=null,p){n(p);let h=e.seen.get(p),d=h.schema;if(d.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))c.allOf=c.allOf??[],c.allOf.push(d);else Tr(c,d);if(Tr(c,l),u._zod.parent===p)for(let y in c){if(y==="$ref"||y==="allOf")continue;if(!(y in l))delete c[y]}if(d.$ref&&h.def)for(let y in c){if(y==="$ref"||y==="allOf")continue;if(y in h.def&&JSON.stringify(c[y])===JSON.stringify(h.def[y]))delete c[y]}}let f=u._zod.parent;if(f&&f!==p){n(f);let h=e.seen.get(f);if(h?.schema.$ref){if(c.$ref=h.schema.$ref,h.def)for(let d in c){if(d==="$ref"||d==="allOf")continue;if(d in h.def&&JSON.stringify(c[d])===JSON.stringify(h.def[d]))delete c[d]}}}e.override({zodSchema:u,jsonSchema:c,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let u of[...e.seen.entries()].reverse())n(u[0]);if(e.target!=="openapi-3.0")for(let u of e.seen.entries())Ih(u[1].def??u[1].schema);for(let u of e.deferred)u();if(e.intersections.length){let u=new Map;for(let a of e.seen.values())for(let c of[a.schema,a.def]){let l=c?.allOf;if(!Array.isArray(l))continue;let p=u.get(l);if(p)p.push(c);else u.set(l,[c])}for(let a of e.intersections)for(let c of u.get(a)??[])ww(c)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let u=e.external.registry.get(t)?.id;if(!u)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(u)}Tr(o,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&o.id===s)delete o.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let u of e.seen.entries()){let a=u[1];if(a.def&&a.defId){if(a.def.id===a.defId)delete a.def.id;Ce(i,a.defId,a.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")o.$defs=i;else o.definitions=i;try{let u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Pr(t,"input",e.processors),output:Pr(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch(u){throw Error("Error converting schema to JSON.")}}function Oe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Oe(n.element,r);if(n.type==="set")return Oe(n.valueType,r);if(n.type==="lazy")return Oe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Oe(n.innerType,r);if(n.type==="intersection")return Oe(n.left,r)||Oe(n.right,r);if(n.type==="record"||n.type==="map")return Oe(n.keyType,r)||Oe(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return Oe(n.in,r)||Oe(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(Oe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Oe(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Oe(o,r))return!0;if(n.rest&&Oe(n.rest,r))return!0;return!1}return!1}var Lh=(e,t={})=>(r)=>{let n=oi({...r,processors:t});return be(e,n),si(n,e),ii(n,e)},Pr=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:s}=n??{},i=oi({...o??{},target:s,io:t,processors:r});return be(e,i),si(i,e),ii(i,e)};var Cw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zh=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:u,patterns:a,contentEncoding:c,laxFormat:l}=e._zod.bag;if(typeof s==="number")o.minLength=s;if(typeof i==="number")o.maxLength=i;if(u){if(o.format=Cw[u]??u,o.format==="")delete o.format;if(u==="time"||l)delete o.format}if(c)o.contentEncoding=c;if(a&&a.size>0){let p=[...a];if(p.length===1)o.pattern=p[0].source;else if(p.length>1)o.allOf=[...p.map((f)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))]}},Bh=(e,t,r,n)=>{let o=r,{minimum:s,maximum:i,format:u,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;if(typeof u==="string"&&u.includes("int"))o.type="integer";else o.type="number";let p=typeof l==="number"&&l>=(s??Number.NEGATIVE_INFINITY),f=typeof c==="number"&&c<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(p)if(h)o.minimum=l,o.exclusiveMinimum=!0;else o.exclusiveMinimum=l;else if(typeof s==="number")o.minimum=s;if(f)if(h)o.maximum=c,o.exclusiveMaximum=!0;else o.exclusiveMaximum=c;else if(typeof i==="number")o.maximum=i;if(typeof a==="number")if(Number.isFinite(a)&&a!==0)o.multipleOf=Math.abs(a);else Ot(e,t,o,n,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`)};var Mh=(e,t,r,n)=>{r.not={}};var jh=(e,t,r,n)=>{};var Hh=(e,t,r,n)=>{let o=e._zod.def,s=wn(o.entries);if(s.length===0){r.not={};return}if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s};var Uh=(e,t,r,n)=>{Ot(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Gh=(e,t,r,n)=>{Ot(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Wh=(e,t,r,n)=>{let o=r,s=e._zod.def,{minimum:i,maximum:u}=e._zod.bag;if(typeof i==="number")o.minItems=i;if(typeof u==="number")o.maxItems=u;o.type="array",o.items=be(s.element,t,{...n,path:[...n.path,"items"]})};function ui(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return ui(t.out);if(t.type==="catch")return ui(t.innerType);return e._zod.optin}var Vh=(e,t,r,n)=>{let o=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Ot(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let l in i)Ce(o.properties,l,be(i[l],t,{...n,path:[...n.path,"properties",l]}));let a=new Set(Object.keys(i)),c=new Set([...a].filter((l)=>{let p=s.shape[l];if(t.io==="input")return ui(p)===void 0;else return p._zod.optout===void 0}));if(c.size>0)o.required=Array.from(c);if(s.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")o.additionalProperties=!1}else if(s.catchall)o.additionalProperties=be(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},qh=(e,t,r,n)=>{let o=e._zod.def,s=o.inclusive===!1,i=o.options.map((u,a)=>be(u,t,{...n,path:[...n.path,s?"oneOf":"anyOf",a]}));if(s)r.oneOf=i;else r.anyOf=i},Jh=(e,t,r,n)=>{let o=e._zod.def,s=be(o.left,t,{...n,path:[...n.path,"allOf",0]}),i=be(o.right,t,{...n,path:[...n.path,"allOf",1]}),u=(c)=>("allOf"in c)&&Object.keys(c).length===1,a=[...u(s)?s.allOf:[s],...u(i)?i.allOf:[i]];r.allOf=a,t.intersections.push(a)};var Kh=(e,t,r,n)=>{let o=e._zod.def,s=be(o.innerType,t,n),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=o.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},Yh=(e,t,r,n)=>{let o=e._zod.def;be(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType},ai=Symbol();function Xh(e,t,r,n,o){let s=!1,i=JSON.stringify(e,(u,a)=>{if(typeof a!=="bigint")return a;return s=!0,null});if(!s)return JSON.parse(i);return Ot(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),ai}var Qh=(e,t,r,n)=>{let o=e._zod.def;be(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType;let i=Xh(o.defaultValue,e,t,r,n);if(i!==ai)r.default=i},ed=(e,t,r,n)=>{let o=e._zod.def;be(o.innerType,t,n);let s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;let i=Xh(o.defaultValue,e,t,r,n);if(i!==ai)r._prefault=i},td=(e,t,r,n)=>{let o=e._zod.def;be(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Ot(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},rd=(e,t,r,n)=>{let o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;be(i,t,n);let u=t.seen.get(e);u.ref=i},nd=(e,t,r,n)=>{let o=e._zod.def;be(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType,r.readOnly=!0};var ci=(e,t,r,n)=>{let o=e._zod.def;be(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType};var od=new WeakSet([Object.prototype,Error.prototype]);function Gn(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var Fw=(e,t)=>{On.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(od.has(r))return;od.add(r),Gn(r,"format",(n)=>(o)=>Hl(n,o)),Gn(r,"flatten",(n)=>(o)=>jl(n,o)),Gn(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,Er,2)}),Gn(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,Er,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var Ze=D("ZodError",Fw,void 0,{Parent:Error});var sd=Fn(Ze),id=Tn(Ze),ud=kr(Ze),ad=Sr(Ze),cd=Wl(Ze),ld=Vl(Ze),pd=ql(Ze),fd=Jl(Ze),hd=Kl(Ze),dd=Yl(Ze),md=Xl(Ze),gd=Ql(Ze);function Pw(){if(!Le.localeError)Ve(Gs())}function fi(){if(!Le.memoizer)Ve({memoizer:Kf()})}var me=D("ZodType",(e,t)=>(Pw(),fe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ft(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Qe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(kC(e,t))},superRefine(e,t){return this.check(SC(e,t))},overwrite(e){return this.check(dt(e))},optional(){return bd(this)},exactOptional(){return dC(this)},nullable(){return yd(this)},nullish(){return bd(yd(this))},nonoptional(e){return yC(this,e)},array(){return hi(this)},or(e){return $d([this,e])},and(e){return pC(this,e)},transform(e){return xd(this,hC(e))},default(e){return DC(this,e)},prefault(e){return bC(this,e)},catch(e){return vC(this,e)},pipe(e){return xd(this,e)},readonly(){return EC(this)},describe(e){let t=this.clone();return St.add(t,{description:e}),t},meta(...e){if(e.length===0)return St.get(this);let t=this.clone();return St.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return $s(this,"~standard",{...Bs(this),jsonSchema:{input:Pr(this,"input"),output:Pr(this,"output")}})},set "~standard"(e){Et(this,"~standard",e)},parse:function e(t,r){return sd(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await id(this,t,r,{callee:e})},safeParse(e,t){return ud(this,e,t)},async safeParseAsync(e,t){return ad(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Et(this,"spa",e)},encode:function e(t,r){return cd(this,t,r,{callee:e})},decode:function e(t,r){return ld(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await pd(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await fd(this,t,r,{callee:e})},safeEncode(e,t){return hd(this,e,t)},safeDecode(e,t){return dd(this,e,t)},async safeEncodeAsync(e,t){return md(this,e,t)},async safeDecodeAsync(e,t){return gd(this,e,t)},toJSONSchema(e){return Lh(this,{})(e)},get description(){return St.get(this)?.description},get _def(){return this._zod.def}}),vd=D("_ZodString",(e,t)=>{Nn.init(e,t),me.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Zh(e,n,o,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null},{regex(...e){return this.check(Ws(...e))},includes(...e){return this.check(Js(...e))},startsWith(...e){return this.check(Ks(...e))},endsWith(...e){return this.check(Ys(...e))},min(...e){return this.check(Yt(...e))},max(...e){return this.check(Hn(...e))},length(...e){return this.check(Un(...e))},nonempty(...e){return this.check(Yt(1,...e))},lowercase(e){return this.check(Vs(e))},uppercase(e){return this.check(qs(e))},trim(){return this.check(Qs())},normalize(...e){return this.check(Xs(...e))},toLowerCase(){return this.check(ei())},toUpperCase(){return this.check(ti())},slugify(){return this.check(ri())}}),zw=D("ZodString",(e,t)=>{Nn.init(e,t),vd.init(e,t)},{email(e){return this.check(eh(Zw,e))},url(e){return this.check(ih(Mw,e))},jwt(e){return this.check(xh(rC,e))},emoji(e){return this.check(uh(jw,e))},guid(e){return this.check(th(Bw,e))},uuid(e){return this.check(rh(Wn,e))},uuidv4(e){return this.check(nh(Wn,e))},uuidv6(e){return this.check(oh(Wn,e))},uuidv7(e){return this.check(sh(Wn,e))},nanoid(e){return this.check(ah(Hw,e))},cuid(e){return this.check(ch(Uw,e))},cuid2(e){return this.check(lh(Gw,e))},ulid(e){return this.check(ph(Ww,e))},base64(e){return this.check(_h(Qw,e))},base64url(e){return this.check(bh(eC,e))},xid(e){return this.check(fh(Vw,e))},ksuid(e){return this.check(hh(qw,e))},ipv4(e){return this.check(dh(Jw,e))},ipv6(e){return this.check(mh(Kw,e))},cidrv4(e){return this.check(gh(Yw,e))},cidrv6(e){return this.check(Dh(Xw,e))},e164(e){return this.check(yh(tC,e))},datetime(e){return this.check(vh(Rw,e))},date(e){return this.check(wh(Iw,e))},time(e){return this.check(Ch(Nw,e))},duration(e){return this.check(Eh(Lw,e))}});function zr(e){return Qf(zw,e)}var ie=D("ZodStringFormat",(e,t)=>{te.init(e,t),vd.init(e,t)}),Rw=D("ZodISODateTime",(e,t)=>{ff.init(e,t),ie.init(e,t)}),Iw=D("ZodISODate",(e,t)=>{hf.init(e,t),ie.init(e,t)}),Nw=D("ZodISOTime",(e,t)=>{df.init(e,t),ie.init(e,t)}),Lw=D("ZodISODuration",(e,t)=>{mf.init(e,t),ie.init(e,t)}),Zw=D("ZodEmail",(e,t)=>{ef.init(e,t),ie.init(e,t)});var Bw=D("ZodGUID",(e,t)=>{Xp.init(e,t),ie.init(e,t)});var Wn=D("ZodUUID",(e,t)=>{Qp.init(e,t),ie.init(e,t)});var Mw=D("ZodURL",(e,t)=>{nf.init(e,t),ie.init(e,t)});var jw=D("ZodEmoji",(e,t)=>{of.init(e,t),ie.init(e,t)});var Hw=D("ZodNanoID",(e,t)=>{sf.init(e,t),ie.init(e,t)});var Uw=D("ZodCUID",(e,t)=>{uf.init(e,t),ie.init(e,t)});var Gw=D("ZodCUID2",(e,t)=>{af.init(e,t),ie.init(e,t)});var Ww=D("ZodULID",(e,t)=>{cf.init(e,t),ie.init(e,t)});var Vw=D("ZodXID",(e,t)=>{lf.init(e,t),ie.init(e,t)});var qw=D("ZodKSUID",(e,t)=>{pf.init(e,t),ie.init(e,t)});var Jw=D("ZodIPv4",(e,t)=>{gf.init(e,t),ie.init(e,t)});var Kw=D("ZodIPv6",(e,t)=>{_f.init(e,t),ie.init(e,t)});var Yw=D("ZodCIDRv4",(e,t)=>{bf.init(e,t),ie.init(e,t)});var Xw=D("ZodCIDRv6",(e,t)=>{yf.init(e,t),ie.init(e,t)});var Qw=D("ZodBase64",(e,t)=>{vf.init(e,t),ie.init(e,t)});var eC=D("ZodBase64URL",(e,t)=>{wf.init(e,t),ie.init(e,t)});var tC=D("ZodE164",(e,t)=>{Cf.init(e,t),ie.init(e,t)});var rC=D("ZodJWT",(e,t)=>{Ef.init(e,t),ie.init(e,t)});var wd=D("ZodNumber",(e,t)=>{Ms.init(e,t),me.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Bh(e,n,o,s);let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null},{gt(e,t){return this.check(Mn(e,t))},gte(e,t){return this.check(Fr(e,t))},min(e,t){return this.check(Fr(e,t))},lt(e,t){return this.check(Bn(e,t))},lte(e,t){return this.check(Ar(e,t))},max(e,t){return this.check(Ar(e,t))},int(e){return this.check(Dd(e))},safe(e){return this.check(Dd(e))},positive(e){return this.check(Mn(0,e))},nonnegative(e){return this.check(Fr(0,e))},negative(e){return this.check(Bn(0,e))},nonpositive(e){return this.check(Ar(0,e))},multipleOf(e,t){return this.check(jn(e,t))},step(e,t){return this.check(jn(e,t))},finite(){return this}});function nC(e){return $h(wd,e)}var oC=D("ZodNumberFormat",(e,t)=>{$f.init(e,t),wd.init(e,t)});function Dd(e){return kh(oC,e)}var sC=D("ZodUnknown",(e,t)=>{kf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jh(e,r,n,o)});function _d(){return Sh(sC)}var iC=D("ZodNever",(e,t)=>{Sf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mh(e,r,n,o)});function Cd(e){return Oh(iC,e)}var uC=D("ZodArray",(e,t)=>{fi(),Of.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wh(e,r,n,o),e.element=t.element},{min(e,t){return this.check(Yt(e,t))},nonempty(e){return this.check(Yt(1,e))},max(e,t){return this.check(Hn(e,t))},length(e,t){return this.check(Un(e,t))},unwrap(){return this.element}});function hi(e,t){return Ah(uC,e,t)}var Ed=D("ZodObject",(e,t)=>{fi(),Tf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vh(e,r,n,o),Kv(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return kd(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:_d()})},loose(){return this.clone({...this._zod.def,catchall:_d()})},strict(){return this.clone({...this._zod.def,catchall:Cd()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return jv(this,e)},safeExtend(e){return Hv(this,e)},merge(e){return Uv(this,e)},pick(e){return Bv(this,e)},omit(e){return Mv(this,e)},partial(...e){return Pl(Sd,this,e[0])},exactPartial(...e){return Pl(Od,this,e[0],"exactPartial")},required(...e){return Gv(Ad,this,e[0])}});function di(e,t){let r={type:"object",shape:e??{},...T(t)};return new Ed(r)}function aC(e,t){return new Ed({type:"object",shape:e,catchall:Cd(),...T(t)})}var cC=D("ZodUnion",(e,t)=>{Pf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qh(e,r,n,o),e.options=t.options});function $d(e,t){return new cC({type:"union",options:e,...T(t)})}var lC=D("ZodIntersection",(e,t)=>{zf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Jh(e,r,n,o)});function pC(e,t){return new lC({type:"intersection",left:e,right:t})}var pi=D("ZodEnum",(e,t)=>{Rf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Hh(e,n,o,s),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new pi({...t,checks:[],...T(o),entries:s})},e.exclude=(n,o)=>{let s={...t.entries};for(let i of n)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new pi({...t,checks:[],...T(o),entries:s})}});function kd(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new pi({type:"enum",entries:r,...T(t)})}var fC=D("ZodTransform",(e,t)=>{fi(),If.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gh(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $r(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(kt(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=r.value;i.inst??(i.inst=e),r.issues.push(kt(i))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((s)=>(r.value=s,r));return r.value=o,r}});function hC(e){return new fC({type:"transform",transform:e})}var Sd=D("ZodOptional",(e,t)=>{js.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ci(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function bd(e){return new Sd({type:"optional",innerType:e})}var Od=D("ZodExactOptional",(e,t)=>{Nf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ci(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function dC(e){return new Od({type:"optional",innerType:e})}var mC=D("ZodNullable",(e,t)=>{Lf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Kh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function yd(e){return new mC({type:"nullable",innerType:e})}var gC=D("ZodDefault",(e,t)=>{Zf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function DC(e,t){return new gC({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():ws(t)}})}var _C=D("ZodPrefault",(e,t)=>{Bf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ed(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function bC(e,t){return new _C({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():ws(t)}})}var Ad=D("ZodNonOptional",(e,t)=>{Mf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yh(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function yC(e,t){return new Ad({type:"nonoptional",innerType:e,...T(t)})}var xC=D("ZodCatch",(e,t)=>{jf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>td(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function vC(e,t){return new xC({type:"catch",innerType:e,catchValue:typeof t==="function"?t:Nl(t)})}var wC=D("ZodPipe",(e,t)=>{Hf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rd(e,r,n,o),e.in=t.in,e.out=t.out});function xd(e,t){return new wC({type:"pipe",in:e,out:t})}var CC=D("ZodReadonly",(e,t)=>{Uf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>nd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function EC(e){return new CC({type:"readonly",innerType:e})}var $C=D("ZodCustom",(e,t)=>{Gf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Uh(e,r,n,o)});function kC(e,t={}){return Fh($C,e,t)}function SC(e,t){return Th(e,t)}var mt="git-swarm.config.yaml",Ir={$schema:`https://raw.githubusercontent.com/imfelixyeung/git-swarm/v${ar.version}/src/config/schema.json`,options:{parallel:1,where:""}},OC=di({$schema:zr().nullish(),repositories:hi(di({path:zr()})).nullish(),options:di({parallel:nC().gte(0).nullish().default(Ir.options.parallel),where:zr().nullish().default(Ir.options.where)}).nullish()}),Vn={$schema:Ir.$schema,options:{parallel:Ir.options.parallel,where:Ir.options.where}},Nr=()=>Bun.file(mt),AC=async()=>Nr().exists(),FC=async(e)=>{await Nr().write(Td.stringify(e,null,4))},Rr=null,Pd=async()=>{if(Rr!==null)return Rr;if(!await Nr().exists())return Rr=Vn,Rr;let e=await Nr().text(),t=Td.parse(e),r=await OC.parseAsync(t);return Rr=r,r},TC=async(e)=>(await Pd()).options?.[e]??Vn.options[e],Be={file:Nr,exists:AC,write:FC,get:Pd,getOption:TC};var Nd=at(Id(),1),O=Nd.default;var Zd=(e,t)=>{console.error(`${O.red("\u2717")} Config repository path ${t}: "${e}"`),console.error(`${O.gray("Hint:")} Run ${O.bold("`git-swarm config refresh`")} to refresh repository paths`),process.exit(1)},ZC=async(e,t)=>{let r=LC(e,t),n=await Ld(r).catch(()=>null);if(n===null||!n.isDirectory())Zd(t,n===null?"not found":"is not a directory");try{await Ld(NC(r,".git"))}catch{Zd(t,"is not a git repository")}};async function*Bd(e,t){if(!t.skipConfig){let n=await Be.get().then((o)=>o.repositories);if(n){for(let o of n)await ZC(e,o.path),yield o.path;return}}let r=await Cl("**/.git",{cwd:e,dot:!0,onlyFiles:!1,expandDirectories:!1,absolute:!0});for(let n of r)yield IC(n)}var ge=(e)=>e.filter((t)=>t!==null);var qd=at(Wd(),1);var Xt=(e)=>{process.stdout.write(e)},gt={carriageReturn:()=>Xt("\r"),hideCursor:()=>Xt("\x1B[?25l"),showCursor:()=>Xt("\x1B[?25h"),moveUp:(e=1)=>{if(e<=0)return;Xt(`\x1B[${e}A`)},clearLine:()=>Xt("\x1B[2K"),clearBelow:()=>Xt("\x1B[J")};var Vd=(e)=>(e.match(/\n/g)||[]).length,fE={pending:" ",started:".",done:O.green("\u2713"),error:O.red("\u26A0")};class gi{width;repos;repoStatus;isFirstRender=!0;constructor(e){this.repos=e,this.width=Math.max(1,(process.stdout.columns||80)-2-this.maxBuildSummaryStringLength()),this.repoStatus=new Map,e.forEach((t)=>{this.repoStatus.set(t,"pending")})}start(){gt.hideCursor(),this.render()}update(e,t){this.repoStatus.set(e,t),this.render()}buildRepoStatusString(e){return fE[this.repoStatus.get(e)??"pending"]}buildSummaryStringFromValues(e,t){return` ${e}/${t}`}buildSummaryString(){let e=[...this.repoStatus.values().filter((t)=>t==="done")].length;return this.buildSummaryStringFromValues(e,this.repos.length)}maxBuildSummaryStringLength(){return this.buildSummaryStringFromValues(this.repos.length,this.repos.length).length}buildProgress(){return`${qd.default(this.repos,this.width).map((r)=>r.map((n)=>this.buildRepoStatusString(n)).join("")).map((r)=>`[${r}]`).join(`
94
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let u=i[1];if(t===i[0]){s(i);continue}if(e.external){let c=e.external.registry.get(i[0])?.id;if(t!==i[0]&&c){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(u.cycle){s(i);continue}if(u.count>1){if(e.reused==="ref"){s(i);continue}}}if(e.external)e.sharedDefsExtractedFor=e.external}function od(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!=="object")return;od(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let s=n.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!=="string")return;if(!r.includes(i))r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var sd=new Set(["type","properties","required","additionalProperties"]),rd=["oneOf","anyOf"];function nd(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Di(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!sd.has(i))return null;t.push(s)}let r={},n=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let u=[];for(let c of t){let l=c.properties?.[i]??nd(c);if(l===null||l===void 0)continue;if(!u.some((p)=>JSON.stringify(p)===JSON.stringify(l)))u.push(l)}let a=u.length===1?u[0]:Di(u)??{allOf:u};Ce(r,i,a)}for(let i of s.required??[])n.add(i)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((s)=>s.additionalProperties===!1))o.additionalProperties=!1;else{let s=[];for(let i of t){let u=nd(i);if(u&&!s.some((a)=>JSON.stringify(a)===JSON.stringify(u)))s.push(u)}if(s.length===1)o.additionalProperties=s[0];else if(s.length>1)o.additionalProperties={allOf:s}}return o}function DC(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of sd)if(o in e)return;let r=t.filter((o)=>rd.some((s)=>Array.isArray(o[s]))),n=null;if(!r.length)n=Di(t);else{let o=r[0],s=rd.find((a)=>Array.isArray(o[a]));if(Object.keys(o).length!==1)return;let i=t.filter((a)=>a!==o),u=o[s].map((a)=>Di([...i,a]));if(u.some((a)=>!a))return;n={[s]:u}}if(!n)return;delete e.allOf,Ir(e,n)}function vi(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(u)=>{let a=e.seen.get(u);if(a.ref===null)return;let c=a.def??a.schema,l={...c},p=a.ref;if(a.ref=null,p){n(p);let h=e.seen.get(p),d=h.schema;if(d.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))c.allOf=c.allOf??[],c.allOf.push(d);else Ir(c,d);if(Ir(c,l),u._zod.parent===p)for(let b in c){if(b==="$ref"||b==="allOf")continue;if(!(b in l))delete c[b]}if(d.$ref&&h.def)for(let b in c){if(b==="$ref"||b==="allOf")continue;if(b in h.def&&JSON.stringify(c[b])===JSON.stringify(h.def[b]))delete c[b]}}let f=u._zod.parent;if(f&&f!==p){n(f);let h=e.seen.get(f);if(h?.schema.$ref){if(c.$ref=h.schema.$ref,h.def)for(let d in c){if(d==="$ref"||d==="allOf")continue;if(d in h.def&&JSON.stringify(c[d])===JSON.stringify(h.def[d]))delete c[d]}}}e.override({zodSchema:u,jsonSchema:c,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let u of[...e.seen.entries()].reverse())n(u[0]);if(e.target!=="openapi-3.0")for(let u of e.seen.entries())od(u[1].def??u[1].schema);for(let u of e.deferred)u();if(e.intersections.length){let u=new Map;for(let a of e.seen.values())for(let c of[a.schema,a.def]){let l=c?.allOf;if(!Array.isArray(l))continue;let p=u.get(l);if(p)p.push(c);else u.set(l,[c])}for(let a of e.intersections)for(let c of u.get(a)??[])DC(c)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let u=e.external.registry.get(t)?.id;if(!u)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(u)}Ir(o,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&o.id===s)delete o.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let u of e.seen.entries()){let a=u[1];if(a.def&&a.defId){if(a.def.id===a.defId)delete a.def.id;Ce(i,a.defId,a.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")o.$defs=i;else o.definitions=i;try{let u=JSON.parse(JSON.stringify(o));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Nr(t,"input",e.processors),output:Nr(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch(u){throw Error("Error converting schema to JSON.")}}function Oe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return Oe(n.element,r);if(n.type==="set")return Oe(n.valueType,r);if(n.type==="lazy")return Oe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return Oe(n.innerType,r);if(n.type==="intersection")return Oe(n.left,r)||Oe(n.right,r);if(n.type==="record"||n.type==="map")return Oe(n.keyType,r)||Oe(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return Oe(n.in,r)||Oe(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(Oe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(Oe(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(Oe(o,r))return!0;if(n.rest&&Oe(n.rest,r))return!0;return!1}return!1}var id=(e,t={})=>(r)=>{let n=bi({...r,processors:t});return De(e,n),xi(n,e),vi(n,e)},Nr=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:s}=n??{},i=bi({...o??{},target:s,io:t,processors:r});return De(e,i),xi(i,e),vi(i,e)};var bC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ud=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:u,patterns:a,contentEncoding:c,laxFormat:l}=e._zod.bag;if(typeof s==="number")o.minLength=s;if(typeof i==="number")o.maxLength=i;if(u){if(o.format=bC[u]??u,o.format==="")delete o.format;if(u==="time"||l)delete o.format}if(c)o.contentEncoding=c;if(a&&a.size>0){let p=[...a];if(p.length===1)o.pattern=p[0].source;else if(p.length>1)o.allOf=[...p.map((f)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))]}},ad=(e,t,r,n)=>{let o=r,{minimum:s,maximum:i,format:u,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;if(typeof u==="string"&&u.includes("int"))o.type="integer";else o.type="number";let p=typeof l==="number"&&l>=(s??Number.NEGATIVE_INFINITY),f=typeof c==="number"&&c<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(p)if(h)o.minimum=l,o.exclusiveMinimum=!0;else o.exclusiveMinimum=l;else if(typeof s==="number")o.minimum=s;if(f)if(h)o.maximum=c,o.exclusiveMaximum=!0;else o.exclusiveMaximum=c;else if(typeof i==="number")o.maximum=i;if(typeof a==="number")if(Number.isFinite(a)&&a!==0)o.multipleOf=Math.abs(a);else Pt(e,t,o,n,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`)};var cd=(e,t,r,n)=>{r.not={}};var ld=(e,t,r,n)=>{};var pd=(e,t,r,n)=>{let o=e._zod.def,s=Ln(o.entries);if(s.length===0){r.not={};return}if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s};var fd=(e,t,r,n)=>{Pt(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var hd=(e,t,r,n)=>{Pt(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var dd=(e,t,r,n)=>{let o=r,s=e._zod.def,{minimum:i,maximum:u}=e._zod.bag;if(typeof i==="number")o.minItems=i;if(typeof u==="number")o.maxItems=u;o.type="array",o.items=De(s.element,t,{...n,path:[...n.path,"items"]})};function wi(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return wi(t.out);if(t.type==="catch")return wi(t.innerType);return e._zod.optin}var md=(e,t,r,n)=>{let o=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Pt(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let l in i)Ce(o.properties,l,De(i[l],t,{...n,path:[...n.path,"properties",l]}));let a=new Set(Object.keys(i)),c=new Set([...a].filter((l)=>{let p=s.shape[l];if(t.io==="input")return wi(p)===void 0;else return p._zod.optout===void 0}));if(c.size>0)o.required=Array.from(c);if(s.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")o.additionalProperties=!1}else if(s.catchall)o.additionalProperties=De(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},gd=(e,t,r,n)=>{let o=e._zod.def,s=o.inclusive===!1,i=o.options.map((u,a)=>De(u,t,{...n,path:[...n.path,s?"oneOf":"anyOf",a]}));if(s)r.oneOf=i;else r.anyOf=i},_d=(e,t,r,n)=>{let o=e._zod.def,s=De(o.left,t,{...n,path:[...n.path,"allOf",0]}),i=De(o.right,t,{...n,path:[...n.path,"allOf",1]}),u=(c)=>("allOf"in c)&&Object.keys(c).length===1,a=[...u(s)?s.allOf:[s],...u(i)?i.allOf:[i]];r.allOf=a,t.intersections.push(a)};var yd=(e,t,r,n)=>{let o=e._zod.def,s=De(o.innerType,t,n),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=o.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},Dd=(e,t,r,n)=>{let o=e._zod.def;De(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType},Ci=Symbol();function bd(e,t,r,n,o){let s=!1,i=JSON.stringify(e,(u,a)=>{if(typeof a!=="bigint")return a;return s=!0,null});if(!s)return JSON.parse(i);return Pt(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Ci}var xd=(e,t,r,n)=>{let o=e._zod.def;De(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType;let i=bd(o.defaultValue,e,t,r,n);if(i!==Ci)r.default=i},vd=(e,t,r,n)=>{let o=e._zod.def;De(o.innerType,t,n);let s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;let i=bd(o.defaultValue,e,t,r,n);if(i!==Ci)r._prefault=i},wd=(e,t,r,n)=>{let o=e._zod.def;De(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Pt(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},Cd=(e,t,r,n)=>{let o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;De(i,t,n);let u=t.seen.get(e);u.ref=i},Ed=(e,t,r,n)=>{let o=e._zod.def;De(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType,r.readOnly=!0};var Ei=(e,t,r,n)=>{let o=e._zod.def;De(o.innerType,t,n);let s=t.seen.get(e);s.ref=o.innerType};var kd=new WeakSet([Object.prototype,Error.prototype]);function io(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var SC=(e,t)=>{Un.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(kd.has(r))return;kd.add(r),io(r,"format",(n)=>(o)=>pp(n,o)),io(r,"flatten",(n)=>(o)=>lp(n,o)),io(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,Or,2)}),io(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,Or,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var Me=_("ZodError",SC,void 0,{Parent:Error});var Sd=Wn(Me),$d=qn(Me),Od=Fr(Me),Ad=Tr(Me),Fd=dp(Me),Td=mp(Me),Pd=gp(Me),Rd=_p(Me),zd=yp(Me),Id=Dp(Me),Nd=bp(Me),Ld=xp(Me);function OC(){if(!Be.localeError)Ve(ui())}function $i(){if(!Be.memoizer)Ve({memoizer:yh()})}var me=_("ZodType",(e,t)=>(OC(),pe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(dt(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return et(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(kE(e,t))},superRefine(e,t){return this.check(SE(e,t))},overwrite(e){return this.check(gt(e))},optional(){return Zd(this)},exactOptional(){return hE(this)},nullable(){return jd(this)},nullish(){return Zd(jd(this))},nonoptional(e){return DE(this,e)},array(){return Wd(this)},or(e){return uE([this,e])},and(e){return cE(this,e)},transform(e){return Hd(this,fE(e))},default(e){return gE(this,e)},prefault(e){return yE(this,e)},catch(e){return xE(this,e)},pipe(e){return Hd(this,e)},readonly(){return CE(this)},describe(e){let t=this.clone();return Tt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Tt.get(this);let t=this.clone();return Tt.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return js(this,"~standard",{...ri(this),jsonSchema:{input:Nr(this,"input"),output:Nr(this,"output")}})},set "~standard"(e){Ot(this,"~standard",e)},parse:function e(t,r){return Sd(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await $d(this,t,r,{callee:e})},safeParse(e,t){return Od(this,e,t)},async safeParseAsync(e,t){return Ad(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ot(this,"spa",e)},encode:function e(t,r){return Fd(this,t,r,{callee:e})},decode:function e(t,r){return Td(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Pd(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Rd(this,t,r,{callee:e})},safeEncode(e,t){return zd(this,e,t)},safeDecode(e,t){return Id(this,e,t)},async safeEncodeAsync(e,t){return Nd(this,e,t)},async safeDecodeAsync(e,t){return Ld(this,e,t)},toJSONSchema(e){return id(this,{})(e)},get description(){return Tt.get(this)?.description},get _def(){return this._zod.def}}),Ud=_("_ZodString",(e,t)=>{Xn.init(e,t),me.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ud(e,n,o,s);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null},{regex(...e){return this.check(ai(...e))},includes(...e){return this.check(pi(...e))},startsWith(...e){return this.check(fi(...e))},endsWith(...e){return this.check(hi(...e))},min(...e){return this.check(rr(...e))},max(...e){return this.check(oo(...e))},length(...e){return this.check(so(...e))},nonempty(...e){return this.check(rr(1,...e))},lowercase(e){return this.check(ci(e))},uppercase(e){return this.check(li(e))},trim(){return this.check(mi())},normalize(...e){return this.check(di(...e))},toLowerCase(){return this.check(gi())},toUpperCase(){return this.check(_i())},slugify(){return this.check(yi())}}),AC=_("ZodString",(e,t)=>{Xn.init(e,t),Ud.init(e,t)},{email(e){return this.check(vh(zC,e))},url(e){return this.check($h(NC,e))},jwt(e){return this.check(Hh(XC,e))},emoji(e){return this.check(Oh(LC,e))},guid(e){return this.check(wh(IC,e))},uuid(e){return this.check(Ch(uo,e))},uuidv4(e){return this.check(Eh(uo,e))},uuidv6(e){return this.check(kh(uo,e))},uuidv7(e){return this.check(Sh(uo,e))},nanoid(e){return this.check(Ah(BC,e))},cuid(e){return this.check(Fh(MC,e))},cuid2(e){return this.check(Th(ZC,e))},ulid(e){return this.check(Ph(jC,e))},base64(e){return this.check(Mh(JC,e))},base64url(e){return this.check(Zh(KC,e))},xid(e){return this.check(Rh(HC,e))},ksuid(e){return this.check(zh(UC,e))},ipv4(e){return this.check(Ih(GC,e))},ipv6(e){return this.check(Nh(WC,e))},cidrv4(e){return this.check(Lh(qC,e))},cidrv6(e){return this.check(Bh(VC,e))},e164(e){return this.check(jh(YC,e))},datetime(e){return this.check(Uh(FC,e))},date(e){return this.check(Gh(TC,e))},time(e){return this.check(Wh(PC,e))},duration(e){return this.check(qh(RC,e))}});function Oi(e){return xh(AC,e)}var se=_("ZodStringFormat",(e,t)=>{te.init(e,t),Ud.init(e,t)}),FC=_("ZodISODateTime",(e,t)=>{Rf.init(e,t),se.init(e,t)}),TC=_("ZodISODate",(e,t)=>{zf.init(e,t),se.init(e,t)}),PC=_("ZodISOTime",(e,t)=>{If.init(e,t),se.init(e,t)}),RC=_("ZodISODuration",(e,t)=>{Nf.init(e,t),se.init(e,t)}),zC=_("ZodEmail",(e,t)=>{wf.init(e,t),se.init(e,t)});var IC=_("ZodGUID",(e,t)=>{xf.init(e,t),se.init(e,t)});var uo=_("ZodUUID",(e,t)=>{vf.init(e,t),se.init(e,t)});var NC=_("ZodURL",(e,t)=>{kf.init(e,t),se.init(e,t)});var LC=_("ZodEmoji",(e,t)=>{Sf.init(e,t),se.init(e,t)});var BC=_("ZodNanoID",(e,t)=>{$f.init(e,t),se.init(e,t)});var MC=_("ZodCUID",(e,t)=>{Of.init(e,t),se.init(e,t)});var ZC=_("ZodCUID2",(e,t)=>{Af.init(e,t),se.init(e,t)});var jC=_("ZodULID",(e,t)=>{Ff.init(e,t),se.init(e,t)});var HC=_("ZodXID",(e,t)=>{Tf.init(e,t),se.init(e,t)});var UC=_("ZodKSUID",(e,t)=>{Pf.init(e,t),se.init(e,t)});var GC=_("ZodIPv4",(e,t)=>{Lf.init(e,t),se.init(e,t)});var WC=_("ZodIPv6",(e,t)=>{Mf.init(e,t),se.init(e,t)});var qC=_("ZodCIDRv4",(e,t)=>{Zf.init(e,t),se.init(e,t)});var VC=_("ZodCIDRv6",(e,t)=>{jf.init(e,t),se.init(e,t)});var JC=_("ZodBase64",(e,t)=>{Uf.init(e,t),se.init(e,t)});var KC=_("ZodBase64URL",(e,t)=>{Gf.init(e,t),se.init(e,t)});var YC=_("ZodE164",(e,t)=>{Wf.init(e,t),se.init(e,t)});var XC=_("ZodJWT",(e,t)=>{qf.init(e,t),se.init(e,t)});var Gd=_("ZodNumber",(e,t)=>{ni.init(e,t),me.init(e,t),e._zod.processJSONSchema=(n,o,s)=>ad(e,n,o,s);let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null},{gt(e,t){return this.check(ro(e,t))},gte(e,t){return this.check(zr(e,t))},min(e,t){return this.check(zr(e,t))},lt(e,t){return this.check(to(e,t))},lte(e,t){return this.check(Rr(e,t))},max(e,t){return this.check(Rr(e,t))},int(e){return this.check(Bd(e))},safe(e){return this.check(Bd(e))},positive(e){return this.check(ro(0,e))},nonnegative(e){return this.check(zr(0,e))},negative(e){return this.check(to(0,e))},nonpositive(e){return this.check(Rr(0,e))},multipleOf(e,t){return this.check(no(e,t))},step(e,t){return this.check(no(e,t))},finite(){return this}});function QC(e){return Vh(Gd,e)}var eE=_("ZodNumberFormat",(e,t)=>{Vf.init(e,t),Gd.init(e,t)});function Bd(e){return Jh(eE,e)}var tE=_("ZodUnknown",(e,t)=>{Jf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ld(e,r,n,o)});function Md(){return Kh(tE)}var rE=_("ZodNever",(e,t)=>{Kf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>cd(e,r,n,o)});function nE(e){return Yh(rE,e)}var oE=_("ZodArray",(e,t)=>{$i(),Yf.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>dd(e,r,n,o),e.element=t.element},{min(e,t){return this.check(rr(e,t))},nonempty(e){return this.check(rr(1,e))},max(e,t){return this.check(oo(e,t))},length(e,t){return this.check(so(e,t))},unwrap(){return this.element}});function Wd(e,t){return Xh(oE,e,t)}var sE=_("ZodObject",(e,t)=>{$i(),eh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>md(e,r,n,o),Ww(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return lE(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Md()})},loose(){return this.clone({...this._zod.def,catchall:Md()})},strict(){return this.clone({...this._zod.def,catchall:nE()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Lw(this,e)},safeExtend(e){return Bw(this,e)},merge(e){return Mw(this,e)},pick(e){return Iw(this,e)},omit(e){return Nw(this,e)},partial(...e){return tp(qd,this,e[0])},exactPartial(...e){return tp(Vd,this,e[0],"exactPartial")},required(...e){return Zw(Jd,this,e[0])}});function Ai(e,t){let r={type:"object",shape:e??{},...R(t)};return new sE(r)}var iE=_("ZodUnion",(e,t)=>{th.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>gd(e,r,n,o),e.options=t.options});function uE(e,t){return new iE({type:"union",options:e,...R(t)})}var aE=_("ZodIntersection",(e,t)=>{rh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_d(e,r,n,o)});function cE(e,t){return new aE({type:"intersection",left:e,right:t})}var Si=_("ZodEnum",(e,t)=>{nh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(n,o,s)=>pd(e,n,o,s),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new Si({...t,checks:[],...R(o),entries:s})},e.exclude=(n,o)=>{let s={...t.entries};for(let i of n)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new Si({...t,checks:[],...R(o),entries:s})}});function lE(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Si({type:"enum",entries:r,...R(t)})}var pE=_("ZodTransform",(e,t)=>{$i(),oh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>hd(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ar(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(Ft(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=r.value;i.inst??(i.inst=e),r.issues.push(Ft(i))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((s)=>(r.value=s,r));return r.value=o,r}});function fE(e){return new pE({type:"transform",transform:e})}var qd=_("ZodOptional",(e,t)=>{oi.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ei(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Zd(e){return new qd({type:"optional",innerType:e})}var Vd=_("ZodExactOptional",(e,t)=>{sh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ei(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function hE(e){return new Vd({type:"optional",innerType:e})}var dE=_("ZodNullable",(e,t)=>{ih.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function jd(e){return new dE({type:"nullable",innerType:e})}var mE=_("ZodDefault",(e,t)=>{uh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gE(e,t){return new mE({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Bs(t)}})}var _E=_("ZodPrefault",(e,t)=>{ah.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>vd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function yE(e,t){return new _E({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Bs(t)}})}var Jd=_("ZodNonOptional",(e,t)=>{ch.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Dd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function DE(e,t){return new Jd({type:"nonoptional",innerType:e,...R(t)})}var bE=_("ZodCatch",(e,t)=>{lh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wd(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xE(e,t){return new bE({type:"catch",innerType:e,catchValue:typeof t==="function"?t:sp(t)})}var vE=_("ZodPipe",(e,t)=>{ph.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cd(e,r,n,o),e.in=t.in,e.out=t.out});function Hd(e,t){return new vE({type:"pipe",in:e,out:t})}var wE=_("ZodReadonly",(e,t)=>{fh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ed(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function CE(e){return new wE({type:"readonly",innerType:e})}var EE=_("ZodCustom",(e,t)=>{hh.init(e,t),me.init(e,t),e._zod.processJSONSchema=(r,n,o)=>fd(e,r,n,o)});function kE(e,t={}){return Qh(EE,e,t)}function SE(e,t){return ed(e,t)}var _t="git-swarm.config.yaml",Br={$schema:`https://raw.githubusercontent.com/imfelixyeung/git-swarm/v${fr.version}/src/config/schema.json`,options:{parallel:1,where:""}},OE=Ai({$schema:Oi().nullish(),repositories:Wd(Ai({path:Oi()})).nullish(),options:Ai({parallel:QC().gte(0).nullish().default(Br.options.parallel),where:Oi().nullish().default(Br.options.where)}).nullish()}),ao={$schema:Br.$schema,options:{parallel:Br.options.parallel,where:Br.options.where}},Mr=()=>Bun.file(_t),AE=async()=>Mr().exists(),FE=async(e)=>{await Mr().write(Kd.stringify(e,null,4))},Lr=null,Yd=async()=>{if(Lr!==null)return Lr;if(!await Mr().exists())return Lr=ao,Lr;let e=await Mr().text(),t=Kd.parse(e),r=await OE.parseAsync(t);return Lr=r,r},TE=async(e)=>(await Yd()).options?.[e]??ao.options[e],Ze={file:Mr,exists:AE,write:FE,get:Yd,getOption:TE};var tm=ot(em(),1),O=tm.default;var nm=(e,t)=>{console.error(`${O.red("\u2717")} Config repository path ${t}: "${e}"`),console.error(`${O.gray("Hint:")} Run ${O.bold("`git-swarm config refresh`")} to refresh repository paths`),process.exit(1)},BE=async(e,t)=>{let r=LE(e,t),n=await rm(r).catch(()=>null);if(n===null||!n.isDirectory())nm(t,n===null?"not found":"is not a directory");try{await rm(NE(r,".git"))}catch{nm(t,"is not a git repository")}};async function*om(e,t){if(!t.skipConfig){let n=await Ze.get().then((o)=>o.repositories);if(n){for(let o of n)await BE(e,o.path),yield o.path;return}}let r=await Wl("**/.git",{cwd:e,dot:!0,onlyFiles:!1,expandDirectories:!1,absolute:!0});for(let n of r)yield IE(n)}var ge=(e)=>e.filter((t)=>t!==null);var fm=ot(lm(),1);var nr=(e)=>{process.stdout.write(e)},yt={carriageReturn:()=>nr("\r"),hideCursor:()=>nr("\x1B[?25l"),showCursor:()=>nr("\x1B[?25h"),moveUp:(e=1)=>{if(e<=0)return;nr(`\x1B[${e}A`)},clearLine:()=>nr("\x1B[2K"),clearBelow:()=>nr("\x1B[J")};var pm=(e)=>(e.match(/\n/g)||[]).length,fk={pending:" ",started:".",done:O.green("\u2713"),error:O.red("\u26A0")};class Ti{width;repos;repoStatus;isFirstRender=!0;constructor(e){this.repos=e,this.width=Math.max(1,(process.stdout.columns||80)-2-this.maxBuildSummaryStringLength()),this.repoStatus=new Map,e.forEach((t)=>{this.repoStatus.set(t,"pending")})}start(){yt.hideCursor(),this.render()}update(e,t){this.repoStatus.set(e,t),this.render()}buildRepoStatusString(e){return fk[this.repoStatus.get(e)??"pending"]}buildSummaryStringFromValues(e,t){return` ${e}/${t}`}buildSummaryString(){let e=[...this.repoStatus.values().filter((t)=>t==="done")].length;return this.buildSummaryStringFromValues(e,this.repos.length)}maxBuildSummaryStringLength(){return this.buildSummaryStringFromValues(this.repos.length,this.repos.length).length}buildProgress(){return`${fm.default(this.repos,this.width).map((r)=>r.map((n)=>this.buildRepoStatusString(n)).join("")).map((r)=>`[${r}]`).join(`
94
95
  `)}${this.buildSummaryString()}
95
- `}render(){let e=this.buildProgress();if(!this.isFirstRender)gt.moveUp(Vd(e)),gt.carriageReturn();else this.isFirstRender=!1;process.stdout.write(e)}stop(){let e=this.buildProgress();gt.moveUp(Vd(e)),gt.carriageReturn(),gt.clearBelow(),gt.showCursor(),this.isFirstRender=!0}log(e){this.stop(),console.log(e),this.start()}}var Di=[],_i=[],Jd=new Set,Lr=new Map,Zr=new Map,Kd=(e)=>typeof e==="string"?new RegExp("^".concat(e,"$"),"i"):e,Yn=(e,t)=>{if(typeof t!=="string")return e;if(e===t)return t;if(e===e.toLowerCase())return t.toLowerCase();if(e===e.toUpperCase())return t.toUpperCase();if(e[0]===e[0].toUpperCase())return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase();return t.toLowerCase()},Yd=(e,t,r)=>{if(!e.length||Jd.has(e))return t;let{length:n}=r;while(n--){let o=r[n];if(o[0].test(t))return t.replace(o[0],function(){for(var s=arguments.length,i=Array(s),u=0;u<s;u++)i[u]=arguments[u];let[a,c]=i,l=o[1].replace(/\$(\d{1,2})/g,(p,f)=>i[f]||"");if(a==="")return Yn(t[c-1],l);return Yn(a,l)})}return t},Xd=(e,t,r,n)=>{let o=e.toLowerCase();if(r.has(o))return Yn(e,o);if(t.has(o))return Yn(e,t.get(o));return Yd(o,e,n)},Qd=(e,t,r,n)=>{let o=e.toLowerCase();if(r.has(o))return!0;if(t.has(o))return!1;return Yd(o,o,n)===o},W=(e,t,r)=>{let n=t===1?W.singular(e):W.plural(e);if(r)return"".concat(t," ").concat(n);return n};W.plural=(e)=>Xd(e,Zr,Lr,Di);W.singular=(e)=>Xd(e,Lr,Zr,_i);W.addPluralRule=(e,t)=>{Di.push([Kd(e),t])};W.addSingularRule=(e,t)=>{_i.push([Kd(e),t])};W.addIrregularRule=(e,t)=>{let r=t.toLowerCase(),n=e.toLowerCase();Zr.set(n,r),Lr.set(r,n)};W.addUncountableRule=(e)=>{if(typeof e==="string"){Jd.add(e.toLowerCase());return}W.addPluralRule(e,"$0"),W.addSingularRule(e,"$0")};W.isPlural=(e)=>Qd(e,Zr,Lr,Di);W.isSingular=(e)=>Qd(e,Lr,Zr,_i);var hE=[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]],dE=[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]],mE=[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]],gE=["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[e\u00E9]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i];for(let[e,t]of hE)W.addIrregularRule(e,t);for(let[e,t]of dE)W.addPluralRule(e,t);for(let[e,t]of mE)W.addSingularRule(e,t);for(let e of gE)W.addUncountableRule(e);var bi=(e,t)=>!new Set(e).isDisjointFrom(new Set(t));var se=(e)=>e instanceof Error?e:Error(`${e}`,{cause:e}),ye=(e,t)=>{let r=(t instanceof Error?t.message:`${t}`).trim();return console.error(`${O.red("\u2717")} ${e}: ${r}`),null};var At=(e)=>e===null||e===void 0;var DE={"github.com":"github","gitlab.com":"gitlab","bitbucket.org":"bitbucket"};function _E(e,t,r){if(!r||typeof r!=="string")return null;let n=r.trim(),o="https",s="",i="",u=n.match(/^(?:([^@]+)@)?([^:]+):(.+)$/);if(u&&!n.includes("://"))o="ssh",s=u[2],i=u[3];else try{let h=new URL(n);o=h.protocol.replace(":","")||"https",s=h.hostname,i=h.pathname.replace(/^\//,"")}catch{return null}i=i.replace(/\.git$/,"").replace(/\/$/,"");let a=i.split("/").filter(Boolean);if(a.length<2)return null;let c=a.pop(),l=a[0],p=[...a,c].join("/"),f=DE[s.toLowerCase()]||"unknown";return{ref:e,direction:t,provider:f,protocol:o,host:s,owner:l,name:c,fullName:p,href:`https://${s}/${p}`}}var Xn=(e)=>ge(e.flatMap((t)=>Object.entries(t.refs).map(([r,n])=>_E(t.name,r,n))));var Qt=$d([zr(),hi(zr())]).transform((e)=>Array.isArray(e)?e:[e]).nullish(),bE=kd(["true","false"]).transform((e)=>e==="true").nullish(),yE=aC({branch:Qt,clean:bE,"remote.ref":Qt,"remote.provider":Qt,"remote.owner":Qt,"remote.host":Qt,"remote.name":Qt}),yi=(e)=>{let t=new URLSearchParams(e),r={};for(let[o,s]of t.entries()){if(o in r){if(r[o]===void 0)continue;r[o]=Array.isArray(r[o])?[...r[o],s]:[r[o],s];continue}r[o]=s}let n=yE.safeParse(r);if(n.error){let o=n.error.issues.map((s)=>{if(s.code==="unrecognized_keys")return`${W("unknown filter",s.keys.length,!0)}: ${s.keys.map((i)=>`"${i}"`).join(", ")}`;return`${s.path}: ${s.message}`}).join(". ");throw Error(`Invalid filter query. ${o}`)}return n.data},em=async(e,t)=>{let r=["ref","provider","owner","host","name"],n=!At(t.branch)||!At(t.clean),o=r.some((s)=>!At(t[`remote.${s}`]));if(!n&&!o)return!0;if(n){let s=await e.git.status().catch(se);if(s instanceof Error)return!1;if(!At(t.branch)&&s.current){if(!bi(t.branch,[s.current]))return!1}if(!At(t.clean)){let i=s.isClean();if(t.clean!==i)return!1}}if(o){let s=await e.git.getRemotes(!0).catch(se);if(s instanceof Error)return!1;let i=Xn(s);for(let u of r){let a=`remote.${u}`;if(!At(t[a])){let c=t[a],l=i.map((p)=>p[u]);if(!bi(c,l))return!1}}}return!0};var K=async(e,t,r)=>{let n=lo(r.parallel),o=await Array.fromAsync(Bd(e,{skipConfig:r.skipConfig??!1})),s=await Promise.all(o.map((u)=>n(async()=>{let a={path:{absolute:u,relative:xE(e,u)||"."},git:Ic(u,{baseDir:u})};if(!await em(a,r.where))return null;return a}))).then(ge),i=r.progress&&process.stdout.isTTY===!0&&s.length>0?new gi(s):null;i?.start();try{let u=s.map((a)=>n(async()=>{i?.update(a,"started");try{let c=await t(a,i?(l)=>i.log(l):console.log);return i?.update(a,"done"),c}catch(c){throw i?.update(a,"error"),c}}));return await Promise.all(u)}finally{i?.stop()}};var Qm=at(Xm(),1);class _e extends Qm.default{constructor(e){super({...e,style:{head:["bold","underline","gray"],"padding-left":0,"padding-right":0},chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "}})}}var eg=new U("checkout").description("Switch branches").argument("<branch>","the branch to checkout").action(async(e)=>{let t=Y(),r=process.cwd(),n=new _e({head:["path","result"]}),o=!1,s=await K(r,async({path:i,git:u})=>{let a=await u.checkout(e).catch(se);if(a instanceof Error)return o=!0,ye(i.relative,a);return[i.relative,O.green(e)]},t);if(o)process.exitCode=1;n.push(...ge(s)),console.log(n.toString())});function tg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function rg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tg(Object(r),!0).forEach(function(n){s$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function s$(e,t,r){if(t=i$(t),t in e)Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[t]=r;return e}function i$(e){var t=u$(e,"string");return typeof t==="symbol"?t:String(t)}function u$(e,t){if(typeof e!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!=="object")return n;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var a$=ng({}),rr=a$;function ng(e){return t.withOptions=(r)=>ng(rg(rg({},e),r)),t;function t(r,...n){let o=typeof r==="string"?[r]:r.raw,{alignValues:s=!1,escapeSpecialCharacters:i=Array.isArray(r),trimWhitespace:u=!0}=e,a="";for(let p=0;p<o.length;p++){let f=o[p];if(i)f=f.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{");if(a+=f,p<n.length){let h=s?c$(n[p],a):n[p];a+=h}}let c=a.split(`
96
+ `}render(){let e=this.buildProgress();if(!this.isFirstRender)yt.moveUp(pm(e)),yt.carriageReturn();else this.isFirstRender=!1;process.stdout.write(e)}stop(){let e=this.buildProgress();yt.moveUp(pm(e)),yt.carriageReturn(),yt.clearBelow(),yt.showCursor(),this.isFirstRender=!0}log(e){this.stop(),console.log(e),this.start()}}var Um=ot(Hm(),1);import{basename as KS}from"path";var VS={"github.com":"github","gitlab.com":"gitlab","bitbucket.org":"bitbucket"};function JS(e,t,r){if(!r||typeof r!=="string")return null;let n=r.trim(),o="https",s="",i="",u=n.match(/^(?:([^@]+)@)?([^:]+):(.+)$/);if(u&&!n.includes("://"))o="ssh",s=u[2],i=u[3];else try{let h=new URL(n);o=h.protocol.replace(":","")||"https",s=h.hostname,i=h.pathname.replace(/^\//,"")}catch{return null}i=i.replace(/\.git$/,"").replace(/\/$/,"");let a=i.split("/").filter(Boolean);if(a.length<2)return null;let c=a.pop(),l=a[0],p=[...a,c].join("/"),f=VS[s.toLowerCase()]||"unknown";return{ref:e,direction:t,provider:f,protocol:o,host:s,owner:l,name:c,fullName:p,href:`https://${s}/${p}`}}var ho=(e)=>ge(e.flatMap((t)=>Object.entries(t.refs).map(([r,n])=>JS(t.name,r,n))));var YS=new Set(["branch","detached","clean","stagedFiles","modifiedFiles","untrackedFiles","ahead","behind","hasUpstream"]),XS=(e)=>({branch:e.current||null,detached:e.detached,clean:e.isClean(),stagedFiles:e.staged.length,modifiedFiles:e.modified.length,untrackedFiles:e.not_added.length,ahead:e.ahead,behind:e.behind,hasUpstream:Boolean(e.tracking)}),QS=(e)=>{let t=ho(e),r=t.find((n)=>n.ref==="origin")??t[0];if(r===void 0)return{provider:null,host:null,owner:null,repo:null};return{provider:e$(r.provider),host:r.host||null,owner:r.owner||null,repo:r.name||null}},e$=(e)=>e==="unknown"?"other":e,Mi=(e)=>{let t=e.trim();if(t.length===0)return{expression:null};let r=Um.default.createExpression(t);return r.compile(),{expression:r}},t$=(e)=>{let t=null,r=null,n=null,o=null,s=()=>t??=e.git.status().then(XS),i=()=>r??=e.git.branch(["-a"]).then((c)=>c.all),u=()=>n??=e.git.branchLocal().then((c)=>c.all),a=()=>o??=e.git.getRemotes(!0).then(QS);return new Proxy({},{get(c,l){if(l==="name")return KS(e.path.absolute);if(l==="path")return e.path.relative;if(l==="branches")return i();if(l==="localBranches")return u();if(l==="remote")return a();if(typeof l==="string"&&YS.has(l))return s().then((p)=>p[l]);return}})},Gm=async(e,t)=>{if(t.expression===null)return!0;try{return Boolean(await t.expression.eval(t$(e)))}catch{return!1}};var K=async(e,t,r)=>{let n=So(r.parallel),o=await Array.fromAsync(om(e,{skipConfig:r.skipConfig??!1})),s=await Promise.all(o.map((u)=>n(async()=>{let a={path:{absolute:u,relative:r$(e,u)||"."},git:ol(u,{baseDir:u})};if(!await Gm(a,r.where))return null;return a}))).then(ge),i=r.progress&&process.stdout.isTTY===!0&&s.length>0?new Ti(s):null;i?.start();try{let u=s.map((a)=>n(async()=>{i?.update(a,"started");try{let c=await t(a,i?(l)=>i.log(l):console.log);return i?.update(a,"done"),c}catch(c){throw i?.update(a,"error"),c}}));return await Promise.all(u)}finally{i?.stop()}};var fe=(e)=>e instanceof Error?e:Error(`${e}`,{cause:e}),be=(e,t)=>{let r=(t instanceof Error?t.message:`${t}`).trim();return console.error(`${O.red("\u2717")} ${e}: ${r}`),null};var Ug=ot(Hg(),1);class ye extends Ug.default{constructor(e){super({...e,style:{head:["bold","underline","gray"],"padding-left":0,"padding-right":0},chars:{top:"","top-mid":"","top-left":"","top-right":"",bottom:"","bottom-mid":"","bottom-left":"","bottom-right":"",left:"","left-mid":"",mid:"","mid-mid":"",right:"","right-mid":"",middle:" "}})}}var Gg=new U("checkout").description("Switch branches").argument("<branch>","the branch to checkout").action(async(e)=>{let t=Y(),r=process.cwd(),n=new ye({head:["path","result"]}),o=!1,s=await K(r,async({path:i,git:u})=>{let a=await u.checkout(e).catch(fe);if(a instanceof Error)return o=!0,be(i.relative,a);return[i.relative,O.green(e)]},t);if(o)process.exitCode=1;n.push(...ge(s)),console.log(n.toString())});function Wg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function qg(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wg(Object(r),!0).forEach(function(n){M$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M$(e,t,r){if(t=Z$(t),t in e)Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0});else e[t]=r;return e}function Z$(e){var t=j$(e,"string");return typeof t==="symbol"?t:String(t)}function j$(e,t){if(typeof e!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!=="object")return n;throw TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var H$=Vg({}),ir=H$;function Vg(e){return t.withOptions=(r)=>Vg(qg(qg({},e),r)),t;function t(r,...n){let o=typeof r==="string"?[r]:r.raw,{alignValues:s=!1,escapeSpecialCharacters:i=Array.isArray(r),trimWhitespace:u=!0}=e,a="";for(let p=0;p<o.length;p++){let f=o[p];if(i)f=f.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{");if(a+=f,p<n.length){let h=s?U$(n[p],a):n[p];a+=h}}let c=a.split(`
96
97
  `),l=null;for(let p of c){let f=p.match(/^(\s+)\S+/);if(f){let h=f[1].length;if(!l)l=h;else l=Math.min(l,h)}}if(l!==null){let p=l;a=c.map((f)=>f[0]===" "||f[0]==="\t"?f.slice(p):f).join(`
97
98
  `)}if(u)a=a.trim();if(i)a=a.replace(/\\n/g,`
98
- `).replace(/\\t/g,"\t").replace(/\\r/g,"\r").replace(/\\v/g,"\v").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\0/g,"\x00").replace(/\\x([\da-fA-F]{2})/g,(p,f)=>String.fromCharCode(parseInt(f,16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g,(p,f)=>String.fromCodePoint(parseInt(f,16))).replace(/\\u([\da-fA-F]{4})/g,(p,f)=>String.fromCharCode(parseInt(f,16)));if(typeof Bun<"u")a=a.replace(/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,(p,f,h)=>{var d;let m=(d=f!==null&&f!==void 0?f:h)!==null&&d!==void 0?d:"";return String.fromCodePoint(parseInt(m,16))});return a}}function c$(e,t){if(typeof e!=="string"||!e.includes(`
99
+ `).replace(/\\t/g,"\t").replace(/\\r/g,"\r").replace(/\\v/g,"\v").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\0/g,"\x00").replace(/\\x([\da-fA-F]{2})/g,(p,f)=>String.fromCharCode(parseInt(f,16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g,(p,f)=>String.fromCodePoint(parseInt(f,16))).replace(/\\u([\da-fA-F]{4})/g,(p,f)=>String.fromCharCode(parseInt(f,16)));if(typeof Bun<"u")a=a.replace(/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,(p,f,h)=>{var d;let m=(d=f!==null&&f!==void 0?f:h)!==null&&d!==void 0?d:"";return String.fromCodePoint(parseInt(m,16))});return a}}function U$(e,t){if(typeof e!=="string"||!e.includes(`
99
100
  `))return e;let n=t.slice(t.lastIndexOf(`
100
101
  `)+1).match(/^(\s+)/);if(n){let o=n[1];return e.replace(/\n/g,`
101
- ${o}`)}return e}var og=new U("init").description(rr`
102
+ ${o}`)}return e}var Jg=new U("init").description(ir`
102
103
  Initialises a git swarm config.
103
- Creates a ${mt} if they don't exist.
104
+ Creates a ${_t} if they don't exist.
104
105
  This does not run 'git init'
105
- `).option("--force","Force creation of a fresh config file even if one already exists").passThroughOptions().action(async(e)=>{if(!e.force&&await Be.exists())console.log(O.red(`${mt} already exists.`)),process.exit();let t=Y(),r=process.cwd(),n=await K(r,async(s)=>s,{...t,skipConfig:!0});n.sort((s,i)=>s.path.relative.localeCompare(i.path.relative));let o={...Vn,repositories:n.map((s)=>({path:s.path.relative}))};await Be.write(o),console.log(O.green(`${mt} created successfully, with ${n.length} repositores.`))});var sg=new U("refresh").description(rr`
106
+ `).option("--force","Force creation of a fresh config file even if one already exists").passThroughOptions().action(async(e)=>{if(!e.force&&await Ze.exists())console.log(O.red(`${_t} already exists.`)),process.exit();let t=Y(),r=process.cwd(),n=await K(r,async(s)=>s,{...t,skipConfig:!0});n.sort((s,i)=>s.path.relative.localeCompare(i.path.relative));let o={...ao,repositories:n.map((s)=>({path:s.path.relative}))};await Ze.write(o),console.log(O.green(`${_t} created successfully, with ${n.length} repositores.`))});var Kg=new U("refresh").description(ir`
106
107
  Refreshes the git swarm config with new repositores.
107
108
  Other options are kept as is.'
108
- `).option("--force","Force creation of a fresh config file even if one already exists").passThroughOptions().action(async()=>{if(!await Be.exists())console.log(O.red(`${mt} missing. Run ${O.bold("`git swarm init`")} first`)),process.exit();let e=await Be.get(),t=Y(),r=process.cwd(),n=await K(r,async(s)=>s,{...t,skipConfig:!0});n.sort((s,i)=>s.path.relative.localeCompare(i.path.relative));let o={...e,repositories:n.map((s)=>({path:s.path.relative}))};await Be.write(o),console.log(O.green(`${mt} refreshed successfully, with ${n.length} repositores.`))});var ig=new U("config").description("Commands related to git swarm configuration").enablePositionalOptions().addCommand(og).addCommand(sg);var l$=(e,t)=>{if(t.binary)return[e,O.gray(t.file),O.gray("binary"),"",""];return[e,t.file,String(t.changes),O.green(`+${t.insertions}`),O.red(`-${t.deletions}`)]},p$=(e,t)=>[e,String(t.changed),O.green(`+${t.insertions}`),O.red(`-${t.deletions}`)],ug=new U("diff").description("Show changes across all repositories").argument("[rev]").option("--cached","show changes staged in the index").option("--stat","show the diff summary for each repository").action(async(e,t)=>{let r=Y(),n=process.cwd(),o=t.cached?["--cached"]:[],s=!1,i=await K(n,async({path:d,git:m})=>{let y=await m.diffSummary(e?[e,...o]:o).catch(se);if(y instanceof Error)return s=!0,ye(d.relative,y);if(y.changed===0)return null;return{path:d.relative,summary:y}},r),u=ge(i);if(u.length===0){process.exitCode=s?1:0;return}let a=t.stat?["path","files","insertions","deletions"]:["path","file","changes","insertions","deletions"],c=new _e({head:a});for(let{path:d,summary:m}of u)if(t.stat)c.push(p$(d,m));else c.push(...m.files.map((y)=>l$(d,y)));console.log(c.toString());let l=u.length,p=u.reduce((d,m)=>d+m.summary.changed,0),f=u.reduce((d,m)=>d+m.summary.insertions,0),h=u.reduce((d,m)=>d+m.summary.deletions,0);console.log([O.bold(`${l} repos`),O.gray("\xB7"),O.bold(`${p} files`),O.gray("\xB7"),O.green(`+${f}`),O.red(`-${h}`)].join(" ")),process.exitCode=1});var f$=(e,t)=>{let r=t.mode==="error"?"\u2717":"\u26A0",n=t.mode==="error"?O.red:O.yellow;return console.warn(n(rr`
109
+ `).option("--force","Force creation of a fresh config file even if one already exists").passThroughOptions().action(async()=>{if(!await Ze.exists())console.log(O.red(`${_t} missing. Run ${O.bold("`git swarm init`")} first`)),process.exit();let e=await Ze.get(),t=Y(),r=process.cwd(),n=await K(r,async(s)=>s,{...t,skipConfig:!0});n.sort((s,i)=>s.path.relative.localeCompare(i.path.relative));let o={...e,repositories:n.map((s)=>({path:s.path.relative}))};await Ze.write(o),console.log(O.green(`${_t} refreshed successfully, with ${n.length} repositores.`))});var Yg=new U("config").description("Commands related to git swarm configuration").enablePositionalOptions().addCommand(Jg).addCommand(Kg);var G$=(e,t)=>{if(t.binary)return[e,O.gray(t.file),O.gray("binary"),"",""];return[e,t.file,String(t.changes),O.green(`+${t.insertions}`),O.red(`-${t.deletions}`)]},W$=(e,t)=>[e,String(t.changed),O.green(`+${t.insertions}`),O.red(`-${t.deletions}`)],Xg=new U("diff").description("Show changes across all repositories").argument("[rev]").option("--cached","show changes staged in the index").option("--stat","show the diff summary for each repository").action(async(e,t)=>{let r=Y(),n=process.cwd(),o=t.cached?["--cached"]:[],s=!1,i=await K(n,async({path:d,git:m})=>{let b=await m.diffSummary(e?[e,...o]:o).catch(fe);if(b instanceof Error)return s=!0,be(d.relative,b);if(b.changed===0)return null;return{path:d.relative,summary:b}},r),u=ge(i);if(u.length===0){process.exitCode=s?1:0;return}let a=t.stat?["path","files","insertions","deletions"]:["path","file","changes","insertions","deletions"],c=new ye({head:a});for(let{path:d,summary:m}of u)if(t.stat)c.push(W$(d,m));else c.push(...m.files.map((b)=>G$(d,b)));console.log(c.toString());let l=u.length,p=u.reduce((d,m)=>d+m.summary.changed,0),f=u.reduce((d,m)=>d+m.summary.insertions,0),h=u.reduce((d,m)=>d+m.summary.deletions,0);console.log([O.bold(`${l} repos`),O.gray("\xB7"),O.bold(`${p} files`),O.gray("\xB7"),O.green(`+${f}`),O.red(`-${h}`)].join(" ")),process.exitCode=1});var Xi=[],Qi=[],Qg=new Set,rn=new Map,nn=new Map,e_=(e)=>typeof e==="string"?new RegExp("^".concat(e,"$"),"i"):e,bo=(e,t)=>{if(typeof t!=="string")return e;if(e===t)return t;if(e===e.toLowerCase())return t.toLowerCase();if(e===e.toUpperCase())return t.toUpperCase();if(e[0]===e[0].toUpperCase())return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase();return t.toLowerCase()},t_=(e,t,r)=>{if(!e.length||Qg.has(e))return t;let{length:n}=r;while(n--){let o=r[n];if(o[0].test(t))return t.replace(o[0],function(){for(var s=arguments.length,i=Array(s),u=0;u<s;u++)i[u]=arguments[u];let[a,c]=i,l=o[1].replace(/\$(\d{1,2})/g,(p,f)=>i[f]||"");if(a==="")return bo(t[c-1],l);return bo(a,l)})}return t},r_=(e,t,r,n)=>{let o=e.toLowerCase();if(r.has(o))return bo(e,o);if(t.has(o))return bo(e,t.get(o));return t_(o,e,n)},n_=(e,t,r,n)=>{let o=e.toLowerCase();if(r.has(o))return!0;if(t.has(o))return!1;return t_(o,o,n)===o},V=(e,t,r)=>{let n=t===1?V.singular(e):V.plural(e);if(r)return"".concat(t," ").concat(n);return n};V.plural=(e)=>r_(e,nn,rn,Xi);V.singular=(e)=>r_(e,rn,nn,Qi);V.addPluralRule=(e,t)=>{Xi.push([e_(e),t])};V.addSingularRule=(e,t)=>{Qi.push([e_(e),t])};V.addIrregularRule=(e,t)=>{let r=t.toLowerCase(),n=e.toLowerCase();nn.set(n,r),rn.set(r,n)};V.addUncountableRule=(e)=>{if(typeof e==="string"){Qg.add(e.toLowerCase());return}V.addPluralRule(e,"$0"),V.addSingularRule(e,"$0")};V.isPlural=(e)=>n_(e,nn,rn,Xi);V.isSingular=(e)=>n_(e,rn,nn,Qi);var q$=[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["my","our"],["its","their"],["his","their"],["her","their"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"],["canvas","canvases"]],V$=[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]],J$=[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/(dg|ss|ois|lk|ok|wn|mb|th|ch|ec|oal|is|ck|ix|sser|ts|wb)ies$/i,"$1ie"],[/\b(l|(?:neck|cross|hog|aun)?t|coll|faer|food|gen|goon|group|hipp|junk|vegg|(?:pork)?p|charl|calor|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]],K$=["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[e\u00E9]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i];for(let[e,t]of q$)V.addIrregularRule(e,t);for(let[e,t]of V$)V.addPluralRule(e,t);for(let[e,t]of J$)V.addSingularRule(e,t);for(let e of K$)V.addUncountableRule(e);var Y$=(e,t)=>{let r=t.mode==="error"?"\u2717":"\u26A0",n=t.mode==="error"?O.red:O.yellow;return console.warn(n(ir`
109
110
  ${r} ${e}
110
111
  ${t.detail}
111
- `))},h$=(e)=>{console.info(O.green(`\u2713 ${e}`))},ag=new U("doctor").description("Run diagnostics").action(async()=>{let e=Y(),t=process.cwd(),r=await K(t,async({path:n,git:o})=>{let s=[],i=n.relative,u=await o.status().catch(se);if(u instanceof Error)return s.push({mode:"error",detail:`git status failed: ${u.message}`}),{path:i,issues:s};if(u.detached)s.push({mode:"warn",detail:"HEAD is detached"});let a=await o.getRemotes().catch(se);if(!(!(a instanceof Error)&&a.length>0))s.push({mode:"warn",detail:"No remotes configured"});if(u.current&&!u.tracking)s.push({mode:"warn",detail:`Branch '${u.current}' has no upstream`});if(u.behind&&u.ahead){let l=["ahead","behind"].map((p)=>`${W("commit",u[p],!0)} ${p}`).join(" ");s.push({mode:"warn",detail:`'${u.current}' has diverged from ${u.tracking}. ${l}`})}else for(let l of["ahead","behind"])if(u[l])s.push({mode:"warn",detail:`'${u.current}' is ${W("commit",u[l],!0)} ${l} ${u.tracking}`});return{path:i,issues:s}},e);for(let n of r){if(n.issues.length===0){h$(n.path);continue}for(let o of n.issues)if(f$(n.path,o),o.mode==="error")process.exitCode=1}console.log(O.gray("Run `git-swarm config refresh` if repositories have changed."))});var d$=async(e,t,r)=>{let n=Bun.spawn({cmd:r,cwd:t,stdout:"pipe",stderr:"pipe"}),[o,s]=await Promise.all([new Response(n.stdout).text(),new Response(n.stderr).text()]),u=await n.exited.catch(()=>n.exitCode??1)===0;return{lines:`${o}
112
+ `))},X$=(e)=>{console.info(O.green(`\u2713 ${e}`))},o_=new U("doctor").description("Run diagnostics").action(async()=>{let e=Y(),t=process.cwd(),r=await K(t,async({path:n,git:o})=>{let s=[],i=n.relative,u=await o.status().catch(fe);if(u instanceof Error)return s.push({mode:"error",detail:`git status failed: ${u.message}`}),{path:i,issues:s};if(u.detached)s.push({mode:"warn",detail:"HEAD is detached"});let a=await o.getRemotes().catch(fe);if(!(!(a instanceof Error)&&a.length>0))s.push({mode:"warn",detail:"No remotes configured"});if(u.current&&!u.tracking)s.push({mode:"warn",detail:`Branch '${u.current}' has no upstream`});if(u.behind&&u.ahead){let l=["ahead","behind"].map((p)=>`${V("commit",u[p],!0)} ${p}`).join(" ");s.push({mode:"warn",detail:`'${u.current}' has diverged from ${u.tracking}. ${l}`})}else for(let l of["ahead","behind"])if(u[l])s.push({mode:"warn",detail:`'${u.current}' is ${V("commit",u[l],!0)} ${l} ${u.tracking}`});return{path:i,issues:s}},e);for(let n of r){if(n.issues.length===0){X$(n.path);continue}for(let o of n.issues)if(Y$(n.path,o),o.mode==="error")process.exitCode=1}console.log(O.gray("Run `git-swarm config refresh` if repositories have changed."))});var Q$=async(e,t,r)=>{let n=Bun.spawn({cmd:r,cwd:t,stdout:"pipe",stderr:"pipe"}),[o,s]=await Promise.all([new Response(n.stdout).text(),new Response(n.stderr).text()]),u=await n.exited.catch(()=>n.exitCode??1)===0;return{lines:`${o}
112
113
  ${s}`.split(`
113
- `).map((c)=>c.trimEnd()).filter((c)=>c.trim()),path:e,success:u}},cg=(e)=>e?O.green("\u2713"):O.red("\u2717"),lg=(e,t)=>{for(let r of t)console.log(`${e}${r}`)},pg=new U("exec").description("Run a command in every repository").option("-v, --verbose","use compact output format").passThroughOptions().argument("<command...>","the command and arguments to run").action(async(e,t)=>{let r=Y(),n=process.cwd(),o=await K(n,async({path:s})=>d$(s.relative,s.absolute,e),r);if(t.verbose){let s=Math.max(...o.map((i)=>`[${i.path}]`.length));for(let i of o){let u=`${cg(i.success)} ${`[${i.path}]`.padEnd(s)}`;if(i.lines.length)lg(`${u} `,i.lines);else console.log(u.trimEnd())}return}console.log();for(let s of o)console.log(`${cg(s.success)} ${s.path}`),lg(" ",s.lines),console.log()});var m$=(e)=>[e.branches.length?O.green(W("new branch",e.branches.length,!0)):null,e.tags.length?O.green(W("new tag",e.tags.length,!0)):null,e.updated.length?`${W("branch",e.updated.length,!0)} updated`:null,e.deleted.length?O.red(`${W("branch",e.deleted.length,!0)} deleted`):null].filter(Boolean).join(", ")||O.gray("already up-to-date"),fg=new U("fetch").description("Download objects and refs from another repository").option("-p, --prune","prune remote-tracking branches no longer on the remote").action(async(e)=>{let t=Y(),r=process.cwd(),n=new _e({head:["path","result"]}),o=!1,s=await K(r,async({path:i,git:u})=>{let a=await u.fetch(e?.prune?["--prune"]:[]).catch(se);if(a instanceof Error)return o=!0,ye(i.relative,a);return[i.relative,m$(a)]},t);if(o)process.exitCode=1;n.push(...ge(s)),console.log(n.toString())});var g$=(e,t)=>{if(t.includes(e))return O.green(e);let r=t.filter((n)=>n.includes(e));if(r.length)return`${r.map(O.yellow).join(`
114
+ `).map((c)=>c.trimEnd()).filter((c)=>c.trim()),path:e,success:u}},s_=(e)=>e?O.green("\u2713"):O.red("\u2717"),i_=(e,t)=>{for(let r of t)console.log(`${e}${r}`)},u_=new U("exec").description("Run a command in every repository").option("-v, --verbose","use compact output format").passThroughOptions().argument("<command...>","the command and arguments to run").action(async(e,t)=>{let r=Y(),n=process.cwd(),o=await K(n,async({path:s})=>Q$(s.relative,s.absolute,e),r);if(t.verbose){let s=Math.max(...o.map((i)=>`[${i.path}]`.length));for(let i of o){let u=`${s_(i.success)} ${`[${i.path}]`.padEnd(s)}`;if(i.lines.length)i_(`${u} `,i.lines);else console.log(u.trimEnd())}return}console.log();for(let s of o)console.log(`${s_(s.success)} ${s.path}`),i_(" ",s.lines),console.log()});var eO=(e)=>[e.branches.length?O.green(V("new branch",e.branches.length,!0)):null,e.tags.length?O.green(V("new tag",e.tags.length,!0)):null,e.updated.length?`${V("branch",e.updated.length,!0)} updated`:null,e.deleted.length?O.red(`${V("branch",e.deleted.length,!0)} deleted`):null].filter(Boolean).join(", ")||O.gray("already up-to-date"),a_=new U("fetch").description("Download objects and refs from another repository").option("-p, --prune","prune remote-tracking branches no longer on the remote").action(async(e)=>{let t=Y(),r=process.cwd(),n=new ye({head:["path","result"]}),o=!1,s=await K(r,async({path:i,git:u})=>{let a=await u.fetch(e?.prune?["--prune"]:[]).catch(fe);if(a instanceof Error)return o=!0,be(i.relative,a);return[i.relative,eO(a)]},t);if(o)process.exitCode=1;n.push(...ge(s)),console.log(n.toString())});var tO=(e,t)=>{if(t.includes(e))return O.green(e);let r=t.filter((n)=>n.includes(e));if(r.length)return`${r.map(O.yellow).join(`
114
115
  `)}
115
- ${O.gray("(fuzzy match)")}`;return null},hg=new U("find-branch").description("Search repositories for a branch by name").argument("<branch>","the branch name to search for").action(async(e)=>{let t=Y(),r=process.cwd(),n=new _e({head:["path","result"]}),o=await K(r,async({path:i,git:u})=>{let a=await u.branch().catch(se);if(a instanceof Error)return ye(i.relative,a);let c=g$(e,a.all);if(c)return[i.relative,c];return null},t),s=ge(o);if(console.log(`${O.gray("branch")} ${O.bold(e)} ${O.gray(`found in ${W("repo",s.length,!0)}:`)}`),s.length===0)return;n.push(...s),console.log(n.toString())});var dg=new U("grep").description("Search for a pattern across all repositories").passThroughOptions().argument("<pattern>","the search pattern").argument("[options...]","git-grep search options",[]).action(async(e,t)=>{let r=Y(),n=process.cwd(),s=(await K(n,async({path:u,git:a})=>{let c=await a.grep(e,t).catch(se);if(c instanceof Error)return ye(u.relative,c);let l=[];for(let[p,f]of Object.entries(c.results))for(let h of f)l.push({file:p,line:h.line,preview:h.preview});if(l.length===0)return null;return l.sort((p,f)=>p.file.localeCompare(f.file)||p.line-f.line),{repo:u.relative,lines:l}},r)).filter((u)=>u!==null),i=s.reduce((u,a)=>u+a.lines.length,0);if(s.length===0)return;for(let u of s){console.log(O.bold(u.repo));for(let{file:a,line:c,preview:l}of u.lines)console.log(` ${O.gray(`${a}:${c}`)}:${l}`);console.log()}console.log(`${O.bold(`${s.length} repos`)} ${O.gray("\xB7")} ${O.bold(`${i} matches`)}`)});var mg=new U("list").description("List repositories discovered below the current directory").action(async()=>{let e=Y(),t=process.cwd(),r=new _e({head:["path"]}),n=await K(t,async({path:o})=>o.relative,e);for(let o of n)r.push([o]);console.log(r.toString())});var D$=Math.pow(10,8)*24*60*60*1000,QT=-D$;var Hr=43200,Ti=1440;var Pi=Symbol.for("constructDateFrom");function nr(e,t){if(typeof e==="function")return e(t);if(e&&typeof e==="object"&&Pi in e)return e[Pi](t);if(e instanceof Date)return new e.constructor(t);return new Date(t)}function ze(e,t){return nr(t||e,e)}var _$={};function gg(){return _$}function zi(e){let t=ze(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function or(e,...t){let r=nr.bind(null,e||t.find((n)=>typeof n==="object"));return t.map(r)}function sr(e,t){let r=+ze(e)-+ze(t);if(r<0)return-1;else if(r>0)return 1;return r}function Dg(e){return nr(e,Date.now())}function _g(e,t,r){let[n,o]=or(r?.in,e,t),s=n.getFullYear()-o.getFullYear(),i=n.getMonth()-o.getMonth();return s*12+i}function bg(e){return(t)=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function yg(e,t){return+ze(e)-+ze(t)}function xg(e,t){let r=ze(e,t?.in);return r.setHours(23,59,59,999),r}function vg(e,t){let r=ze(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function wg(e,t){let r=ze(e,t?.in);return+xg(r,t)===+vg(r,t)}function Cg(e,t,r){let[n,o,s]=or(r?.in,e,e,t),i=sr(o,s),u=Math.abs(_g(o,s));if(u<1)return 0;if(o.getMonth()===1&&o.getDate()>27)o.setDate(30);o.setMonth(o.getMonth()-i*u);let a=sr(o,s)===-i;if(wg(n)&&u===1&&sr(n,s)===1)a=!1;let c=i*(u-+a);return c===0?0:c}function Eg(e,t,r){let n=yg(e,t)/1000;return bg(r?.roundingMethod)(n)}var b$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$g=(e,t,r)=>{let n,o=b$[e];if(typeof o==="string")n=o;else if(t===1)n=o.one;else n=o.other.replace("{{count}}",t.toString());if(r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+n;else return n+" ago";return n};function oo(e){return(t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var y$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},x$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},v$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kg={date:oo({formats:y$,defaultWidth:"full"}),time:oo({formats:x$,defaultWidth:"full"}),dateTime:oo({formats:v$,defaultWidth:"full"})};var w$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Sg=(e,t,r,n)=>w$[e];function ir(e){return(t,r)=>{let n=r?.context?String(r.context):"standalone",o;if(n==="formatting"&&e.formattingValues){let i=e.defaultFormattingWidth||e.defaultWidth,u=r?.width?String(r.width):i;o=e.formattingValues[u]||e.formattingValues[i]}else{let i=e.defaultWidth,u=r?.width?String(r.width):e.defaultWidth;o=e.values[u]||e.values[i]}let s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}var C$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},E$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$$={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},k$={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},S$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},O$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},A$=(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Og={ordinalNumber:A$,era:ir({values:C$,defaultWidth:"wide"}),quarter:ir({values:E$,defaultWidth:"wide",argumentCallback:(e)=>e-1}),month:ir({values:$$,defaultWidth:"wide"}),day:ir({values:k$,defaultWidth:"wide"}),dayPeriod:ir({values:S$,defaultWidth:"wide",formattingValues:O$,defaultFormattingWidth:"wide"})};function ur(e){return(t,r={})=>{let n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;let i=s[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],a=Array.isArray(u)?T$(u,(p)=>p.test(i)):F$(u,(p)=>p.test(i)),c;c=e.valueCallback?e.valueCallback(a):a,c=r.valueCallback?r.valueCallback(c):c;let l=t.slice(i.length);return{value:c,rest:l}}}function F$(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r;return}function T$(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r;return}function Ag(e){return(t,r={})=>{let n=t.match(e.matchPattern);if(!n)return null;let o=n[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=r.valueCallback?r.valueCallback(i):i;let u=t.slice(o.length);return{value:i,rest:u}}}var P$=/^(\d+)(th|st|nd|rd)?/i,z$=/\d+/i,R$={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},I$={any:[/^b/i,/^(a|c)/i]},N$={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},L$={any:[/1/i,/2/i,/3/i,/4/i]},Z$={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},B$={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},M$={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},j$={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},H$={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},U$={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Fg={ordinalNumber:Ag({matchPattern:P$,parsePattern:z$,valueCallback:(e)=>parseInt(e,10)}),era:ur({matchPatterns:R$,defaultMatchWidth:"wide",parsePatterns:I$,defaultParseWidth:"any"}),quarter:ur({matchPatterns:N$,defaultMatchWidth:"wide",parsePatterns:L$,defaultParseWidth:"any",valueCallback:(e)=>e+1}),month:ur({matchPatterns:Z$,defaultMatchWidth:"wide",parsePatterns:B$,defaultParseWidth:"any"}),day:ur({matchPatterns:M$,defaultMatchWidth:"wide",parsePatterns:j$,defaultParseWidth:"any"}),dayPeriod:ur({matchPatterns:H$,defaultMatchWidth:"any",parsePatterns:U$,defaultParseWidth:"any"})};var Ri={code:"en-US",formatDistance:$g,formatLong:kg,formatRelative:Sg,localize:Og,match:Fg,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Tg(e,t,r){let n=gg(),o=r?.locale??n.locale??Ri,s=2520,i=sr(e,t);if(isNaN(i))throw RangeError("Invalid time value");let u=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[a,c]=or(r?.in,...i>0?[t,e]:[e,t]),l=Eg(c,a),p=(zi(c)-zi(a))/1000,f=Math.round((l-p)/60),h;if(f<2)if(r?.includeSeconds)if(l<5)return o.formatDistance("lessThanXSeconds",5,u);else if(l<10)return o.formatDistance("lessThanXSeconds",10,u);else if(l<20)return o.formatDistance("lessThanXSeconds",20,u);else if(l<40)return o.formatDistance("halfAMinute",0,u);else if(l<60)return o.formatDistance("lessThanXMinutes",1,u);else return o.formatDistance("xMinutes",1,u);else if(f===0)return o.formatDistance("lessThanXMinutes",1,u);else return o.formatDistance("xMinutes",f,u);else if(f<45)return o.formatDistance("xMinutes",f,u);else if(f<90)return o.formatDistance("aboutXHours",1,u);else if(f<Ti){let d=Math.round(f/60);return o.formatDistance("aboutXHours",d,u)}else if(f<2520)return o.formatDistance("xDays",1,u);else if(f<Hr){let d=Math.round(f/Ti);return o.formatDistance("xDays",d,u)}else if(f<Hr*2)return h=Math.round(f/Hr),o.formatDistance("aboutXMonths",h,u);if(h=Cg(c,a),h<12){let d=Math.round(f/Hr);return o.formatDistance("xMonths",d,u)}else{let d=h%12,m=Math.trunc(h/12);if(d<3)return o.formatDistance("aboutXYears",m,u);else if(d<9)return o.formatDistance("overXYears",m,u);else return o.formatDistance("almostXYears",m+1,u)}}function Pg(e,t){return Tg(e,Dg(e),t)}var zg=new U("log").description("Show commit logs across all repositories").argument("[rev]","the revision or revision range to log").option("--all","show commits on all branches").option("--after <date>","show commits more recent than a specific date").option("--before <date>","show commits older than a specific date").option("--exact-date","show the exact commit date instead of a relative time").option("--author","show the author of each commit").action(async(e,t)=>{let r=Y(),n=process.cwd(),o=[...t.all?["--all"]:[],...e?[e]:[],...t.after?[`--after=${t.after}`]:[],...t.before?[`--before=${t.before}`]:[]],s=await K(n,async({path:l,git:p})=>{let f=await p.log(["--stat=4096",...o]).catch(se);if(f instanceof Error)return ye(l.relative,f);if(f.all.length===0)return null;return{path:l.relative,log:f}},r),i=ge(s);if(i.length===0)return;let u=[];for(let{path:l,log:p}of i)for(let f of p.all)u.push({path:l,hash:f.hash.slice(0,7),message:f.message,date:t.exactDate?f.date:Pg(new Date(f.date),{addSuffix:!0}),time:new Date(f.date).getTime(),author:f.author_name,files:f.diff?.changed??0,insertions:f.diff?.insertions??0,deletions:f.diff?.deletions??0});u.sort((l,p)=>p.time-l.time);let a=["path","hash","date",...t.author?["author"]:[],"message","files","insertions","deletions"],c=new _e({head:a});for(let l of u)c.push([l.path,O.gray(l.hash),O.gray(l.date),...t.author?[l.author]:[],l.message,String(l.files),O.green(`+${l.insertions}`),O.red(`-${l.deletions}`)]);console.log(c.toString())});var G$=(e)=>{if(!e.files.length)return O.gray("already up-to-date");let{insertions:t,deletions:r}=e.summary;return[`${W("file",e.files.length,!0)} changed`,t?O.green(`+${t}`):null,r?O.red(`-${r}`):null].filter(Boolean).join(" ")},Rg=new U("pull").description("Fetch from and integrate with another repository").argument("[remote]","the remote to pull from").argument("[branch]","the branch to pull").action(async(e,t)=>{let r=Y(),n=process.cwd(),o=new _e({head:["path","result"]}),s=!1,i=await K(n,async({path:u,git:a})=>{let c=await a.pull(e??void 0,t??void 0).catch(se);if(c instanceof Error)return s=!0,ye(u.relative,c);return[u.relative,G$(c)]},r);if(s)process.exitCode=1;o.push(...ge(i)),console.log(o.toString())});var W$=(e,t)=>{let r=new Map;for(let o of t)r.set(o.ref,[...r.get(o.ref)??[],o]);let n=[];for(let[o,s]of r){let i=s.find((a)=>a.direction==="fetch"),u=s.find((a)=>a.direction==="push");if(i&&u&&i.protocol===u.protocol&&i.href===u.href){let a=i;n.push([e,o,"push, fetch",a.href,a.provider,a.owner,a.name]);continue}for(let a of s)n.push([e,o,a.direction,a.href,a.provider,a.owner,a.name])}return n},Ig=new U("remote").description("List remotes for each repository").action(async()=>{let e=Y(),t=process.cwd(),r=new _e({head:["path","remote","direction","url","provider","owner","name"]}),n=await K(t,async({path:s,git:i})=>{let u=await i.getRemotes(!0).catch(se);if(u instanceof Error)return ye(s.relative,u);let a=Xn(u);if(a.length===0)return null;return W$(s.relative,a)},e),o=ge(n).flat();r.push(...o),console.log(r.toString())});var V$=(e)=>{if(e.modified.length)return O.red("modified");if(e.ahead||e.behind)return O.yellow(`\u2191 ${e.ahead} \u2193 ${e.behind}`);if(e.detached)return O.red("detached");if(e.isClean())return O.green("clean");if(e.not_added.length)return O.red(W("untracked item",e.not_added.length,!0));return O.gray("unknown")},Ng=new U("status").description("Show the working tree status").action(async()=>{let e=Y(),t=process.cwd(),r=new _e({head:["path","branch","tracking","status"]}),n=await K(t,async({path:o,git:s})=>{let i=await s.status().catch(se);if(i instanceof Error)return ye(o.relative,i);return[o.relative,i.current,i.tracking,V$(i)]},e);r.push(...ge(n)),console.log(r.toString())});var Zg=(e)=>{let t=Number(e);if(!Number.isInteger(t)||t<0)throw new Ye("expected a non-negative integer (0 = unlimited, 1 = sequential)");if(t===0)return 1/0;return t},q$=(e)=>{switch(!0){case e===0:return"unlimited";case e===1:return"sequential";default:return e.toLocaleString()}},Lg=Zg(await Be.getOption("parallel")),Bg=new We("--parallel <count>","run git in parallel, 0 = unlimited").default(Lg,q$(Lg)).argParser(Zg);var Mg=new We("--no-progress","disable the progress bar (defaults to enabled only when stdout is a TTY)").default(!0,"auto");var jg=await Be.getOption("where"),Hg=new We("--where <query>","filter repos by a query string").default(yi(jg),jg||"all repos").argParser((e)=>{try{return yi(e)}catch(t){if(t instanceof Error)throw new Ye(t.message);throw t}});var so=new U,Y=()=>so.opts();so.name("git-swarm").description(ar.description).version(ar.version).enablePositionalOptions().addOption(Bg).addOption(Mg).addOption(Hg).addCommand(eg).addCommand(ig).addCommand(ug).addCommand(ag).addCommand(pg).addCommand(fg).addCommand(hg).addCommand(dg).addCommand(mg).addCommand(zg).addCommand(Rg).addCommand(Ig).addCommand(Ng);so.parse();
116
+ ${O.gray("(fuzzy match)")}`;return null},c_=new U("find-branch").description("Search repositories for a branch by name").argument("<branch>","the branch name to search for").action(async(e)=>{let t=Y(),r=process.cwd(),n=new ye({head:["path","result"]}),o=await K(r,async({path:i,git:u})=>{let a=await u.branch().catch(fe);if(a instanceof Error)return be(i.relative,a);let c=tO(e,a.all);if(c)return[i.relative,c];return null},t),s=ge(o);if(console.log(`${O.gray("branch")} ${O.bold(e)} ${O.gray(`found in ${V("repo",s.length,!0)}:`)}`),s.length===0)return;n.push(...s),console.log(n.toString())});var l_=new U("grep").description("Search for a pattern across all repositories").passThroughOptions().argument("<pattern>","the search pattern").argument("[options...]","git-grep search options",[]).action(async(e,t)=>{let r=Y(),n=process.cwd(),s=(await K(n,async({path:u,git:a})=>{let c=await a.grep(e,t).catch(fe);if(c instanceof Error)return be(u.relative,c);let l=[];for(let[p,f]of Object.entries(c.results))for(let h of f)l.push({file:p,line:h.line,preview:h.preview});if(l.length===0)return null;return l.sort((p,f)=>p.file.localeCompare(f.file)||p.line-f.line),{repo:u.relative,lines:l}},r)).filter((u)=>u!==null),i=s.reduce((u,a)=>u+a.lines.length,0);if(s.length===0)return;for(let u of s){console.log(O.bold(u.repo));for(let{file:a,line:c,preview:l}of u.lines)console.log(` ${O.gray(`${a}:${c}`)}:${l}`);console.log()}console.log(`${O.bold(`${s.length} repos`)} ${O.gray("\xB7")} ${O.bold(`${i} matches`)}`)});var p_=new U("list").description("List repositories discovered below the current directory").action(async()=>{let e=Y(),t=process.cwd(),r=new ye({head:["path"]}),n=await K(t,async({path:o})=>o.relative,e);for(let o of n)r.push([o]);console.log(r.toString())});var rO=Math.pow(10,8)*24*60*60*1000,t2=-rO;var on=43200,eu=1440;var tu=Symbol.for("constructDateFrom");function ur(e,t){if(typeof e==="function")return e(t);if(e&&typeof e==="object"&&tu in e)return e[tu](t);if(e instanceof Date)return new e.constructor(t);return new Date(t)}function ze(e,t){return ur(t||e,e)}var nO={};function f_(){return nO}function ru(e){let t=ze(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function ar(e,...t){let r=ur.bind(null,e||t.find((n)=>typeof n==="object"));return t.map(r)}function cr(e,t){let r=+ze(e)-+ze(t);if(r<0)return-1;else if(r>0)return 1;return r}function h_(e){return ur(e,Date.now())}function d_(e,t,r){let[n,o]=ar(r?.in,e,t),s=n.getFullYear()-o.getFullYear(),i=n.getMonth()-o.getMonth();return s*12+i}function m_(e){return(t)=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function g_(e,t){return+ze(e)-+ze(t)}function __(e,t){let r=ze(e,t?.in);return r.setHours(23,59,59,999),r}function y_(e,t){let r=ze(e,t?.in),n=r.getMonth();return r.setFullYear(r.getFullYear(),n+1,0),r.setHours(23,59,59,999),r}function D_(e,t){let r=ze(e,t?.in);return+__(r,t)===+y_(r,t)}function b_(e,t,r){let[n,o,s]=ar(r?.in,e,e,t),i=cr(o,s),u=Math.abs(d_(o,s));if(u<1)return 0;if(o.getMonth()===1&&o.getDate()>27)o.setDate(30);o.setMonth(o.getMonth()-i*u);let a=cr(o,s)===-i;if(D_(n)&&u===1&&cr(n,s)===1)a=!1;let c=i*(u-+a);return c===0?0:c}function x_(e,t,r){let n=g_(e,t)/1000;return m_(r?.roundingMethod)(n)}var oO={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},v_=(e,t,r)=>{let n,o=oO[e];if(typeof o==="string")n=o;else if(t===1)n=o.one;else n=o.other.replace("{{count}}",t.toString());if(r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+n;else return n+" ago";return n};function xo(e){return(t={})=>{let r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var sO={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},iO={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},uO={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},w_={date:xo({formats:sO,defaultWidth:"full"}),time:xo({formats:iO,defaultWidth:"full"}),dateTime:xo({formats:uO,defaultWidth:"full"})};var aO={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},C_=(e,t,r,n)=>aO[e];function lr(e){return(t,r)=>{let n=r?.context?String(r.context):"standalone",o;if(n==="formatting"&&e.formattingValues){let i=e.defaultFormattingWidth||e.defaultWidth,u=r?.width?String(r.width):i;o=e.formattingValues[u]||e.formattingValues[i]}else{let i=e.defaultWidth,u=r?.width?String(r.width):e.defaultWidth;o=e.values[u]||e.values[i]}let s=e.argumentCallback?e.argumentCallback(t):t;return o[s]}}var cO={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},lO={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pO={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fO={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},dO={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mO=(e,t)=>{let r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},E_={ordinalNumber:mO,era:lr({values:cO,defaultWidth:"wide"}),quarter:lr({values:lO,defaultWidth:"wide",argumentCallback:(e)=>e-1}),month:lr({values:pO,defaultWidth:"wide"}),day:lr({values:fO,defaultWidth:"wide"}),dayPeriod:lr({values:hO,defaultWidth:"wide",formattingValues:dO,defaultFormattingWidth:"wide"})};function pr(e){return(t,r={})=>{let n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],s=t.match(o);if(!s)return null;let i=s[0],u=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],a=Array.isArray(u)?_O(u,(p)=>p.test(i)):gO(u,(p)=>p.test(i)),c;c=e.valueCallback?e.valueCallback(a):a,c=r.valueCallback?r.valueCallback(c):c;let l=t.slice(i.length);return{value:c,rest:l}}}function gO(e,t){for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r;return}function _O(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r;return}function k_(e){return(t,r={})=>{let n=t.match(e.matchPattern);if(!n)return null;let o=n[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=r.valueCallback?r.valueCallback(i):i;let u=t.slice(o.length);return{value:i,rest:u}}}var yO=/^(\d+)(th|st|nd|rd)?/i,DO=/\d+/i,bO={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xO={any:[/^b/i,/^(a|c)/i]},vO={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},wO={any:[/1/i,/2/i,/3/i,/4/i]},CO={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},EO={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},kO={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},SO={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$O={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},OO={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},S_={ordinalNumber:k_({matchPattern:yO,parsePattern:DO,valueCallback:(e)=>parseInt(e,10)}),era:pr({matchPatterns:bO,defaultMatchWidth:"wide",parsePatterns:xO,defaultParseWidth:"any"}),quarter:pr({matchPatterns:vO,defaultMatchWidth:"wide",parsePatterns:wO,defaultParseWidth:"any",valueCallback:(e)=>e+1}),month:pr({matchPatterns:CO,defaultMatchWidth:"wide",parsePatterns:EO,defaultParseWidth:"any"}),day:pr({matchPatterns:kO,defaultMatchWidth:"wide",parsePatterns:SO,defaultParseWidth:"any"}),dayPeriod:pr({matchPatterns:$O,defaultMatchWidth:"any",parsePatterns:OO,defaultParseWidth:"any"})};var nu={code:"en-US",formatDistance:v_,formatLong:w_,formatRelative:C_,localize:E_,match:S_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $_(e,t,r){let n=f_(),o=r?.locale??n.locale??nu,s=2520,i=cr(e,t);if(isNaN(i))throw RangeError("Invalid time value");let u=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:i}),[a,c]=ar(r?.in,...i>0?[t,e]:[e,t]),l=x_(c,a),p=(ru(c)-ru(a))/1000,f=Math.round((l-p)/60),h;if(f<2)if(r?.includeSeconds)if(l<5)return o.formatDistance("lessThanXSeconds",5,u);else if(l<10)return o.formatDistance("lessThanXSeconds",10,u);else if(l<20)return o.formatDistance("lessThanXSeconds",20,u);else if(l<40)return o.formatDistance("halfAMinute",0,u);else if(l<60)return o.formatDistance("lessThanXMinutes",1,u);else return o.formatDistance("xMinutes",1,u);else if(f===0)return o.formatDistance("lessThanXMinutes",1,u);else return o.formatDistance("xMinutes",f,u);else if(f<45)return o.formatDistance("xMinutes",f,u);else if(f<90)return o.formatDistance("aboutXHours",1,u);else if(f<eu){let d=Math.round(f/60);return o.formatDistance("aboutXHours",d,u)}else if(f<2520)return o.formatDistance("xDays",1,u);else if(f<on){let d=Math.round(f/eu);return o.formatDistance("xDays",d,u)}else if(f<on*2)return h=Math.round(f/on),o.formatDistance("aboutXMonths",h,u);if(h=b_(c,a),h<12){let d=Math.round(f/on);return o.formatDistance("xMonths",d,u)}else{let d=h%12,m=Math.trunc(h/12);if(d<3)return o.formatDistance("aboutXYears",m,u);else if(d<9)return o.formatDistance("overXYears",m,u);else return o.formatDistance("almostXYears",m+1,u)}}function O_(e,t){return $_(e,h_(e),t)}var A_=new U("log").description("Show commit logs across all repositories").argument("[rev]","the revision or revision range to log").option("--all","show commits on all branches").option("--after <date>","show commits more recent than a specific date").option("--before <date>","show commits older than a specific date").option("--exact-date","show the exact commit date instead of a relative time").option("--author","show the author of each commit").action(async(e,t)=>{let r=Y(),n=process.cwd(),o=[...t.all?["--all"]:[],...e?[e]:[],...t.after?[`--after=${t.after}`]:[],...t.before?[`--before=${t.before}`]:[]],s=await K(n,async({path:l,git:p})=>{let f=await p.log(["--stat=4096",...o]).catch(fe);if(f instanceof Error)return be(l.relative,f);if(f.all.length===0)return null;return{path:l.relative,log:f}},r),i=ge(s);if(i.length===0)return;let u=[];for(let{path:l,log:p}of i)for(let f of p.all)u.push({path:l,hash:f.hash.slice(0,7),message:f.message,date:t.exactDate?f.date:O_(new Date(f.date),{addSuffix:!0}),time:new Date(f.date).getTime(),author:f.author_name,files:f.diff?.changed??0,insertions:f.diff?.insertions??0,deletions:f.diff?.deletions??0});u.sort((l,p)=>p.time-l.time);let a=["path","hash","date",...t.author?["author"]:[],"message","files","insertions","deletions"],c=new ye({head:a});for(let l of u)c.push([l.path,O.gray(l.hash),O.gray(l.date),...t.author?[l.author]:[],l.message,String(l.files),O.green(`+${l.insertions}`),O.red(`-${l.deletions}`)]);console.log(c.toString())});var AO=(e)=>{if(!e.files.length)return O.gray("already up-to-date");let{insertions:t,deletions:r}=e.summary;return[`${V("file",e.files.length,!0)} changed`,t?O.green(`+${t}`):null,r?O.red(`-${r}`):null].filter(Boolean).join(" ")},F_=new U("pull").description("Fetch from and integrate with another repository").argument("[remote]","the remote to pull from").argument("[branch]","the branch to pull").action(async(e,t)=>{let r=Y(),n=process.cwd(),o=new ye({head:["path","result"]}),s=!1,i=await K(n,async({path:u,git:a})=>{let c=await a.pull(e??void 0,t??void 0).catch(fe);if(c instanceof Error)return s=!0,be(u.relative,c);return[u.relative,AO(c)]},r);if(s)process.exitCode=1;o.push(...ge(i)),console.log(o.toString())});var FO=(e,t)=>{let r=new Map;for(let o of t)r.set(o.ref,[...r.get(o.ref)??[],o]);let n=[];for(let[o,s]of r){let i=s.find((a)=>a.direction==="fetch"),u=s.find((a)=>a.direction==="push");if(i&&u&&i.protocol===u.protocol&&i.href===u.href){let a=i;n.push([e,o,"push, fetch",a.href,a.provider,a.owner,a.name]);continue}for(let a of s)n.push([e,o,a.direction,a.href,a.provider,a.owner,a.name])}return n},T_=new U("remote").description("List remotes for each repository").action(async()=>{let e=Y(),t=process.cwd(),r=new ye({head:["path","remote","direction","url","provider","owner","name"]}),n=await K(t,async({path:s,git:i})=>{let u=await i.getRemotes(!0).catch(fe);if(u instanceof Error)return be(s.relative,u);let a=ho(u);if(a.length===0)return null;return FO(s.relative,a)},e),o=ge(n).flat();r.push(...o),console.log(r.toString())});var TO=(e)=>{if(e.modified.length)return O.red("modified");if(e.ahead||e.behind)return O.yellow(`\u2191 ${e.ahead} \u2193 ${e.behind}`);if(e.detached)return O.red("detached");if(e.isClean())return O.green("clean");if(e.not_added.length)return O.red(V("untracked item",e.not_added.length,!0));return O.gray("unknown")},P_=new U("status").description("Show the working tree status").action(async()=>{let e=Y(),t=process.cwd(),r=new ye({head:["path","branch","tracking","status"]}),n=await K(t,async({path:o,git:s})=>{let i=await s.status().catch(fe);if(i instanceof Error)return be(o.relative,i);return[o.relative,i.current,i.tracking,TO(i)]},e);r.push(...ge(n)),console.log(r.toString())});var z_=(e)=>{let t=Number(e);if(!Number.isInteger(t)||t<0)throw new Xe("expected a non-negative integer (0 = unlimited, 1 = sequential)");if(t===0)return 1/0;return t},PO=(e)=>{switch(!0){case e===0:return"unlimited";case e===1:return"sequential";default:return e.toLocaleString()}},R_=z_(await Ze.getOption("parallel")),I_=new qe("--parallel <count>","run git in parallel, 0 = unlimited").default(R_,PO(R_)).argParser(z_);var N_=new qe("--no-progress","disable the progress bar (defaults to enabled only when stdout is a TTY)").default(!0,"auto");var L_=await Ze.getOption("where"),B_=new qe("--where <expression>","filter repos by a JEXL expression").default(Mi(L_),L_.trim()||"all repos").argParser((e)=>{try{return Mi(e)}catch(t){if(t instanceof Error)throw new Xe(t.message);throw t}});var vo=new U,Y=()=>vo.opts();vo.name("git-swarm").description(fr.description).version(fr.version).enablePositionalOptions().addOption(I_).addOption(N_).addOption(B_).addCommand(Gg).addCommand(Yg).addCommand(Xg).addCommand(o_).addCommand(u_).addCommand(a_).addCommand(c_).addCommand(l_).addCommand(p_).addCommand(A_).addCommand(F_).addCommand(T_).addCommand(P_);vo.parse();
116
117
 
117
- //# debugId=CD5CA2CB8430BE6E64756E2164756E21
118
+ //# debugId=1E093DB7566F9A8B64756E2164756E21
118
119
  //# sourceMappingURL=cli.js.map